_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
4b35ee2a709ed71f701a8b9df9ab4c325b4c9208421f682e11a06646392c313c | simongray/sino.study | core.cljc | (ns sinostudy.rim.core
(:require [clojure.string :as str]))
;;;; TEXT-RELATED FUNCTIONS
based on code examples from StackOverflow :
;; -clojure-code-for-regular-expression-matches-and-their-position-in-string
;; -can-i-get-the-positions-of-regex-matches-in-clojurescript
(defn re-pos
"Like re-seq, but returns a ... | null | https://raw.githubusercontent.com/simongray/sino.study/b1b2954011841bc96449a1aa61eb51656930aee5/src/sinostudy/rim/core.cljc | clojure | TEXT-RELATED FUNCTIONS
-clojure-code-for-regular-expression-matches-and-their-position-in-string
-can-i-get-the-positions-of-regex-matches-in-clojurescript | (ns sinostudy.rim.core
(:require [clojure.string :as str]))
based on code examples from StackOverflow :
(defn re-pos
"Like re-seq, but returns a map of indexes to matches, not a seq of matches."
[re s]
#?(:clj (loop [out {}
m (re-matcher re s)]
(if (.find m)
... |
01a5fd37c65e116bec1f6fcaa5d3f7d30bf066a65626d983cfde5e8c3653887e | flora-pm/flora-server | Orphans.hs | # OPTIONS_GHC -Wno - orphans #
module Data.Text.Display.Orphans where
import Data.Text.Display
import Data.Time
deriving via (ShowInstance UTCTime) instance Display UTCTime
| null | https://raw.githubusercontent.com/flora-pm/flora-server/c214c0b5d5db71a8330eb69326284be5a4d5e858/src/orphans/Data/Text/Display/Orphans.hs | haskell | # OPTIONS_GHC -Wno - orphans #
module Data.Text.Display.Orphans where
import Data.Text.Display
import Data.Time
deriving via (ShowInstance UTCTime) instance Display UTCTime
| |
3cca126b2e020696bc00bdab4f9617f1c72fa61a3f8c20a726e578aba34cdd6c | amal029/Cgals | java.ml | module String = Batteries.String
module L = Batteries.List
module Hashtbl = Batteries.Hashtbl
module LL = Batteries.LazyList
open Sexplib
open Std
open Sexp
open PropositionalLogic
open TableauBuchiAutomataGeneration
exception Internal_error of string
open Pretty
let (++) = append
let (>>) x f = f x
let (|>) x f = ... | null | https://raw.githubusercontent.com/amal029/Cgals/c853499c6f0f18b004ec2e2b628a4777f0a869fb/backend/java.ml | ocaml | Make the body of the process!!
Now add the transitions
let updates = ref [] in
These are the updates to be made here!! | module String = Batteries.String
module L = Batteries.List
module Hashtbl = Batteries.Hashtbl
module LL = Batteries.LazyList
open Sexplib
open Std
open Sexp
open PropositionalLogic
open TableauBuchiAutomataGeneration
exception Internal_error of string
open Pretty
let (++) = append
let (>>) x f = f x
let (|>) x f = ... |
ec38efbeb5edaa59ddb53e56d420879f8ded0983ce10bca943a788ae0d0d443b | yetanalytics/dl4clj | hyper_rectangle.clj | (ns dl4clj.clustering.kdtree.hyper-rectangle
(:import [org.deeplearning4j.clustering.kdtree HyperRect HyperRect$Interval])
(:require [nd4clj.linalg.factory.nd4j :refer [vec-or-matrix->indarray]]))
(defn new-hyper-rect-interval
[& {:keys [^Double lower ^Double higher]}]
(HyperRect$Interval. lower higher))
(def... | null | https://raw.githubusercontent.com/yetanalytics/dl4clj/9ef055b2a460f1a6246733713136b981fd322510/src/dl4clj/clustering/kdtree/hyper_rectangle.clj | clojure |
hyper-rect api fns
finish this | (ns dl4clj.clustering.kdtree.hyper-rectangle
(:import [org.deeplearning4j.clustering.kdtree HyperRect HyperRect$Interval])
(:require [nd4clj.linalg.factory.nd4j :refer [vec-or-matrix->indarray]]))
(defn new-hyper-rect-interval
[& {:keys [^Double lower ^Double higher]}]
(HyperRect$Interval. lower higher))
(def... |
7b4bce1667c547943dd9d04a188000f0efbc40bec87a3d0a68b2ba640b718145 | wilkerlucio/pathom3 | eql_test.clj | (ns com.wsscode.pathom3.interface.async.eql-test
(:require
[check.core :refer [=> check]]
[clojure.string :as string]
[clojure.test :refer [deftest is testing]]
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir]
[com.wsscode.pathom3.connect.indexes :as pci]
[com.wsscode.pathom3.connect.... | null | https://raw.githubusercontent.com/wilkerlucio/pathom3/d337f573ac92d030de21b750bf8b54a3847f522c/test/com/wsscode/pathom3/interface/async/eql_test.clj | clojure | (ns com.wsscode.pathom3.interface.async.eql-test
(:require
[check.core :refer [=> check]]
[clojure.string :as string]
[clojure.test :refer [deftest is testing]]
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir]
[com.wsscode.pathom3.connect.indexes :as pci]
[com.wsscode.pathom3.connect.... | |
c62880fa85f4bd111f54fcab30be5d24c578ba2a10b85eda4eb2724a7ee5b431 | davelambert/clojure-powerloom | low.clj | Copyright © 2011
(ns powerloom.test.low
(:use clojure.test)
(:import [edu.isi.powerloom PLI])
(:require [powerloom [low :as lo] [util :as util]]))
(lo/initialize)
(deftest test-util
(testing "modules and environments"
(is (= "PL-USER" (.moduleName (lo/s-change-module "PL-USER"))))
(is (= "STELLA"... | null | https://raw.githubusercontent.com/davelambert/clojure-powerloom/4988cd8a4d41a62c577abd5c1ed6e2ca0c0e7df9/test/powerloom/test/low.clj | clojure | Copyright © 2011
(ns powerloom.test.low
(:use clojure.test)
(:import [edu.isi.powerloom PLI])
(:require [powerloom [low :as lo] [util :as util]]))
(lo/initialize)
(deftest test-util
(testing "modules and environments"
(is (= "PL-USER" (.moduleName (lo/s-change-module "PL-USER"))))
(is (= "STELLA"... | |
aec6edd3f0bd04a31d184cfa54c4a1980a16ee35f919fc407e6a92e86a676c9c | maxtuno/tooloud | rhythmic.clj | (ns tooloud.rhythmic
(:use [overtone.live]))
(defsynth kicki [out-bus 0 bpm 140 kick-vol 3 v 2]
(let [kickenv (decay (t2a (demand (impulse:kr (/ bpm 30)) 0 (dseq [1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0] INF))) 0.7)
kick (* (* kickenv 7) (sin-osc (+ 40 (* kickenv kickenv kickenv 200))))
kick (clip2 kick... | null | https://raw.githubusercontent.com/maxtuno/tooloud/136cdb516066879565280167e914c37e3d731466/src/tooloud/rhythmic.clj | clojure | (ns tooloud.rhythmic
(:use [overtone.live]))
(defsynth kicki [out-bus 0 bpm 140 kick-vol 3 v 2]
(let [kickenv (decay (t2a (demand (impulse:kr (/ bpm 30)) 0 (dseq [1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0] INF))) 0.7)
kick (* (* kickenv 7) (sin-osc (+ 40 (* kickenv kickenv kickenv 200))))
kick (clip2 kick... | |
ea4d505d77edef4e2a65fae76af17a2540dbc06ec90cd1046b28cb95a7c74a58 | lemmaandrew/CodingBatHaskell | withoutEnd.hs | From
Given a string , return a version without the first and last char , so \"Hello\ " yields
\"ell\ " . The string length will be at least 2 .
Given a string, return a version without the first and last char, so \"Hello\" yields
\"ell\". The string length will be at least 2.
-}
import Test.Hspec ( hspec, des... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/String-1/withoutEnd.hs | haskell | From
Given a string , return a version without the first and last char , so \"Hello\ " yields
\"ell\ " . The string length will be at least 2 .
Given a string, return a version without the first and last char, so \"Hello\" yields
\"ell\". The string length will be at least 2.
-}
import Test.Hspec ( hspec, des... | |
31efff9d35c9d9949dbeb670fc6d2d0d11978d25247b583d5d369d04fc12cc90 | ds-wizard/engine-backend | Migration.hs | module Registry.Database.Migration.Development.Migration (
runMigration,
) where
import qualified Registry.Database.Migration.Development.ActionKey.ActionKeySchemaMigration as ACK_Schema
import qualified Registry.Database.Migration.Development.Audit.AuditSchemaMigration as ADT_Schema
import qualified Registry.Databa... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/b87f6d481205dd7f0f00fd770145f8ee5c4be193/engine-registry/src/Registry/Database/Migration/Development/Migration.hs | haskell | module Registry.Database.Migration.Development.Migration (
runMigration,
) where
import qualified Registry.Database.Migration.Development.ActionKey.ActionKeySchemaMigration as ACK_Schema
import qualified Registry.Database.Migration.Development.Audit.AuditSchemaMigration as ADT_Schema
import qualified Registry.Databa... | |
0d7df818360f9d592886051b16ae878d8ac6d510e31c643f9aeedc1c768c5496 | babashka/nbb | build.clj | (ns nbb.build
"Provides bb tasks for building and releasing nbb"
(:require
[babashka.classpath :as classpath]
[babashka.fs :as fs]
[babashka.tasks :refer [clojure]]
[clojure.edn :as edn]
[clojure.string :as str]))
(defn- feature-files
[]
(filter fs/exists?
(map (fn [d]
... | null | https://raw.githubusercontent.com/babashka/nbb/bff81f8c9d66a69dfbbf5aeeea42649eb451e09b/build/src/nbb/build.clj | clojure | Each ./src/nbb_features.edn has a ./deps.edn
Pull out nbb from local/root or git/url | (ns nbb.build
"Provides bb tasks for building and releasing nbb"
(:require
[babashka.classpath :as classpath]
[babashka.fs :as fs]
[babashka.tasks :refer [clojure]]
[clojure.edn :as edn]
[clojure.string :as str]))
(defn- feature-files
[]
(filter fs/exists?
(map (fn [d]
... |
3db9a39d9a9e3ffa86edc133bc03adbc6cd23aed2b5964647372e5f7d3da161b | facebook/flow | exit.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/52e59c7a9dea8556e7caf0be2b2c5c2e310b5b65/src/common/exit/exit.ml | ocaml | Commands that exit with these exit codes handle json output themselves |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
9ec5961fe5113325ff891667df93fde64f7fc6723880f5d829a964bfa2023b94 | racket/sgl | gl-types.rkt | #lang racket/base
(require ffi/unsafe
ffi/cvector)
(provide (all-defined-out))
(define _float*
(make-ctype _float
(lambda (n)
(if (exact? n)
(exact->inexact n)
n))
#f))
(define (make-gl-vector-type t)
(make-ctype _cvect... | null | https://raw.githubusercontent.com/racket/sgl/7999abdf79058cc709da0e49dee4ec0569249085/gl-types.rkt | racket | Beware of problems with these type definitions.
They seem to be right for all currently supported
platforms, but in principle they can differ. | #lang racket/base
(require ffi/unsafe
ffi/cvector)
(provide (all-defined-out))
(define _float*
(make-ctype _float
(lambda (n)
(if (exact? n)
(exact->inexact n)
n))
#f))
(define (make-gl-vector-type t)
(make-ctype _cvect... |
d82c93084e000f9333d3452b7a6bbea23b9bf15db40b365f7dcf5c8ecd524a50 | geophf/1HaskellADay | Exercise.hs | module Y2016.M09.D01.Exercise where
import Crypto.Hash
below imports available from 1HaskellADay git repository
import Data.Monetary.BitCoin
import Data.Tree.Merkle
-
So , yesterday we looked at hashing data then hashing the hashes to those data .
Why ?
Well , because I said so ! It has NOTHING to do with... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2016/M09/D01/Exercise.hs | haskell | }
that was hard
Ya see what I did with branch, didja? A branch has either branches OR it
Perhaps there is some generic way to express branch so that this distinction
is clear without muddling things with different type values of Parent and
Branch ... thoughts on this?
Now, we do a simple leaf and branch construct... | module Y2016.M09.D01.Exercise where
import Crypto.Hash
below imports available from 1HaskellADay git repository
import Data.Monetary.BitCoin
import Data.Tree.Merkle
-
So , yesterday we looked at hashing data then hashing the hashes to those data .
Why ?
Well , because I said so ! It has NOTHING to do with... |
5c2239a58e8f63886102c3b923785fe5c850bb0de2bccdfa0e7f37c69c1fa5ee | wilkerlucio/pathom3-datomic | datomic_devlocal_test.clj | (ns com.wsscode.pathom3.connect.datomic-devlocal-test
(:require
[clojure.test :refer [deftest is testing]]
[com.wsscode.pathom3.connect.datomic :as pcd]
[com.wsscode.pathom3.connect.datomic.client :refer [client-config]]
[com.wsscode.pathom3.connect.indexes :as pci]
[com.wsscode.pathom3.connect.op... | null | https://raw.githubusercontent.com/wilkerlucio/pathom3-datomic/406f3664275937c2e840c3b105aab56563cb8f8f/test/com/wsscode/pathom3/connect/datomic_devlocal_test.clj | clojure |
Setup
| (ns com.wsscode.pathom3.connect.datomic-devlocal-test
(:require
[clojure.test :refer [deftest is testing]]
[com.wsscode.pathom3.connect.datomic :as pcd]
[com.wsscode.pathom3.connect.datomic.client :refer [client-config]]
[com.wsscode.pathom3.connect.indexes :as pci]
[com.wsscode.pathom3.connect.op... |
5f8fd98b71996b980b9491e92f208019117c557db8c910839a446a8b7e051c15 | triffon/fp-2022-23 | 03-is-major.rkt | #lang racket
един списък е подсписък на друг , ако елементите на първия списък се срещат непосредствено
последователно във втория
пример : ' ( 2 3 4 ) е подсписък на ' ( 1 2 3 4 5 )
връща списък от всички подсписъци на lst с дължина n
пример : ( sublists - n ' ( 1 2 3 4 5 ) 3 ) = > ' ( ( 1 2 3 ) ( 2 3 4 ) (... | null | https://raw.githubusercontent.com/triffon/fp-2022-23/8fb2bc9a3b17f883a61928d573dd1ccf401ca36b/exercises/inf2/exams/01-exam/exam-2021-2022/03-is-major.rkt | racket | n )
връща дали lst се мажорира от някой от списъците в ll
за всеки два съседни списъка li и li+1 в ll
; = > # t
; = > # f
----------------------------------------------
; = > ' ( ( 1 ) ( 2 ) ( 3 ) ( 1 2 ) ( 2 3 ) ( 1 2 3 ) )
; = > -4
; = > ' ( 1 2 3 ) | #lang racket
един списък е подсписък на друг , ако елементите на първия списък се срещат непосредствено
последователно във втория
пример : ' ( 2 3 4 ) е подсписък на ' ( 1 2 3 4 5 )
връща списък от всички подсписъци на lst с дължина n
пример : ( sublists - n ' ( 1 2 3 4 5 ) 3 ) = > ' ( ( 1 2 3 ) ( 2 3 4 ) (... |
73c15e5116fdc60d2c674d9ad79915a6b98123dca49378dc63228d67bc63fe8b | w3ntao/sicp-solution | 1-6.rkt | #lang racket
(define (new-if predicate then-do else-do)
(cond (predicate then-do)
(else else-do)))
(define (sqrt x)
(sqrt-iter 1.0 x))
(define (sqrt-iter guess x)
(new-if (good-enough? guess x)
guess
(sqrt-iter (improve guess x) x)))
(define (good-enough? guess x) (< (abs(- (* gues... | null | https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-1/1-6.rkt | racket | #lang racket
(define (new-if predicate then-do else-do)
(cond (predicate then-do)
(else else-do)))
(define (sqrt x)
(sqrt-iter 1.0 x))
(define (sqrt-iter guess x)
(new-if (good-enough? guess x)
guess
(sqrt-iter (improve guess x) x)))
(define (good-enough? guess x) (< (abs(- (* gues... | |
764432b43752fb8ac31d6a061fe9d0c70b2ab304780a4d93d32dc33870aff0ef | joearms/erlmediaserver | handler.erl | Author :
Created : May 3 , 2010
%% Description: TODO: Add description to handler
-module(handler).
%%
%% Include files
%%
-include_lib("eunit/include/eunit.hrl").
-include("/usr/local/lib/yaws/include/yaws_api.hrl").
%%
%% Exported Functions
%%
-export([make_response/2, make_response/3, make_header/1, make_all_res... | null | https://raw.githubusercontent.com/joearms/erlmediaserver/35ef0d8300c50a273ee0122ccce65973af4c3a73/src/handler.erl | erlang | Description: TODO: Add description to handler
Include files
Exported Functions
API Functions
Local Functions
Test Functions
| Author :
Created : May 3 , 2010
-module(handler).
-include_lib("eunit/include/eunit.hrl").
-include("/usr/local/lib/yaws/include/yaws_api.hrl").
-export([make_response/2, make_response/3, make_header/1, make_all_response/3]).
-export([get_soapaction/1, get_path/1]).
make_response(Status, Message) ->
make_respo... |
b62cba5afec245068b540d9692ebd3a17d2caa8bb2173c4a13c40d9835484d2c | mlabs-haskell/ply | NftM.hs | module Example.NftM (nftMp) where
import Plutarch.Api.V1
import qualified Plutarch.Api.V1.Value as PValue
import Plutarch.Prelude
nftMp :: ClosedTerm (PTxOutRef :--> PTokenName :--> PMintingPolicy)
nftMp = plam $ \ref tn _ ctx' -> popaque $
unTermCont $ do
ctx <- tcont $ pletFields @'["txInfo", "purpose"] ctx'
... | null | https://raw.githubusercontent.com/mlabs-haskell/ply/f474dcfeaf7f7a102f136b8bb71c5b684993eea4/example/src/Example/NftM.hs | haskell | > PTokenName :--> PMintingPolicy) | module Example.NftM (nftMp) where
import Plutarch.Api.V1
import qualified Plutarch.Api.V1.Value as PValue
import Plutarch.Prelude
nftMp = plam $ \ref tn _ ctx' -> popaque $
unTermCont $ do
ctx <- tcont $ pletFields @'["txInfo", "purpose"] ctx'
PMinting mintFlds <- tcont . pmatch $ getField @"purpose" ctx
... |
95e14b6a3ec16999691f88eb2cebfd57f0764d25409826acc8b9625a5d8d147f | haskell-tools/haskell-tools | ExternalInstanceReOrder_res.hs | module Refactor.AutoCorrect.ExternalInstanceReOrder where
x = f () 3
f :: (Show a, Num b) => a -> b -> ()
f _ _ = ()
a :: Integer
a = 3 | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/AutoCorrect/ExternalInstanceReOrder_res.hs | haskell | module Refactor.AutoCorrect.ExternalInstanceReOrder where
x = f () 3
f :: (Show a, Num b) => a -> b -> ()
f _ _ = ()
a :: Integer
a = 3 | |
6d15d9692167f8ece291aa639f10b2f8d2728ceb272303cd797d6ec5399868b6 | scalaris-team/scalaris | art.erl | 2011,2012 Zuse Institute Berlin
%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
dis... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/src/rrepair/art.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language go... | 2011,2012 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2002 - J.Byers , J.Considine , M.Mitzenmachen
Fast Approximate Reconcilication of Set Differe... |
0c4b06d640ff1a8099114a62a9c104775de68cfe0925ead884e8693eca1be269 | B-Lang-org/bsc | ARankMethCalls.hs | module ARankMethCalls(aRankMethCalls) where
import Data.List
import Data.Maybe
import Control.Monad.State
import ASyntax
import FStringCompat
import Id
import Error(ErrMsg(..), ErrorHandle, bsError, bsWarning)
import Position
import Pragma
XXX first separate methods from rules so find does n't fail
-- XXX need to... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/ARankMethCalls.hs | haskell | XXX need to do a deep copy of methods, because they might refer to
XXX what do we do about rules? should we require that they all be mentioned?
when ranks /= [], sets of method names such that each method in has
have a __RANK_ suffix appended.
only methods mentioned in the rank list survive, and a warning
is iss... | module ARankMethCalls(aRankMethCalls) where
import Data.List
import Data.Maybe
import Control.Monad.State
import ASyntax
import FStringCompat
import Id
import Error(ErrMsg(..), ErrorHandle, bsError, bsWarning)
import Position
import Pragma
XXX first separate methods from rules so find does n't fail
XXX the same... |
fdc87354b414e4dfe5742151898df1fa1d1d3b53e701385e12122a399418b5ee | semilin/layoup | Arensito.lisp |
(MAKE-LAYOUT :NAME "Arensito" :MATRIX
(APPLY #'KEY-MATRIX '("ql.p';fudk" "arenbgsito" "zw,hjvcymx"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/Arensito.lisp | lisp |
(MAKE-LAYOUT :NAME "Arensito" :MATRIX
(APPLY #'KEY-MATRIX '("ql.p';fudk" "arenbgsito" "zw,hjvcymx"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
ade54aba0156f21652d9a519634cf887e86df2e3a2de8c6334c86679066f1ba3 | holdenlee/depgraph | Test.hs | {-# OPTIONS
-XMultiParamTypeClasses
-XFunctionalDependencies
-XFlexibleInstances
-XRank2Types
-XGADTs
-XPolyKinds
#-}
module Main where
import System.Environment
import System.Directory
import System.IO
import Control.Monad
import Text.LaTeX.Base
import Text.LaTeX.Base.Render
import Tex... | null | https://raw.githubusercontent.com/holdenlee/depgraph/30081e9b8acb1083970dec47f7c753bcd47eb534/Test.hs | haskell | # OPTIONS
-XMultiParamTypeClasses
-XFunctionalDependencies
-XFlexibleInstances
-XRank2Types
-XGADTs
-XPolyKinds
#
txt <- readFileTex arg
|
module Main where
import System.Environment
import System.Directory
import System.IO
import Control.Monad
import Text.LaTeX.Base
import Text.LaTeX.Base.Render
import Text.LaTeX.Base.Parser
main = do
args <- getArgs
let arg = args!!0
latex <- parseLaTeXFile arg
writeFile "latex.txt" (show ... |
9978045dac087cac117c3980ef195dff0276b13d7fda42a2658967b625fe094a | GrammaTech/sel | qq.lisp | (uiop:define-package :software-evolution-library/utility/fare-qq
(:documentation "This package exists as a workaround to allow fare-quasiquote-extras to be loaded from a package-inferred system.")
(:use-reexport :fare-quasiquote))
| null | https://raw.githubusercontent.com/GrammaTech/sel/221337e70e7f15418e6ccd3a53abbca2cdce8f6c/utility/qq.lisp | lisp | (uiop:define-package :software-evolution-library/utility/fare-qq
(:documentation "This package exists as a workaround to allow fare-quasiquote-extras to be loaded from a package-inferred system.")
(:use-reexport :fare-quasiquote))
| |
466f17fb4de132df0062402c9885b85b0545b9fb9244c699ce7d24995a63798f | LPCIC/matita | libraryMisc.ml | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/library/libraryMisc.ml | ocaml | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... | |
1adbe9a4ca749ac29fbd423aed5971cbad94b9d926944a667dd24a12f8074ca9 | aymanosman/cl-missile-command | wav.lisp | (defpackage :wav
(:use :common-lisp)
(:export #:make-wav))
(in-package :wav)
(defun wav-write-vector (vector stream)
(loop :for elem :across vector
:do (vector-push elem stream)))
(defun wav-write-string (string stream)
(wav-write-vector (map 'vector #'char-code string) stream))
(defun write-u16 (n ... | null | https://raw.githubusercontent.com/aymanosman/cl-missile-command/5f99bc8cec1ff06a2450b9408feb2c57df1561b9/wav.lisp | lisp | RIFF + size
'fmt ' + size
size of fmt
'data' + size
PCM compression
channels
sample rate
block align
bits per sample | (defpackage :wav
(:use :common-lisp)
(:export #:make-wav))
(in-package :wav)
(defun wav-write-vector (vector stream)
(loop :for elem :across vector
:do (vector-push elem stream)))
(defun wav-write-string (string stream)
(wav-write-vector (map 'vector #'char-code string) stream))
(defun write-u16 (n ... |
552bc13678ecaabb344f7be9be2ed8022dfb8841563d6090cbced991d4775c99 | reagent-project/historian | tests.clj | (ns historian.tests
(:require [clojure.test :as t :refer (is deftest with-test run-tests testing)]
[historian.core :as hist]))
(def test-atom (atom ""))
(deftest undos-test
(reset! test-atom "ABC")
(is (= "ABC" @test-atom))
(hist/record! test-atom :test-atom) ;; start the recording
at this point... | null | https://raw.githubusercontent.com/reagent-project/historian/3fb87210fec4fe80a9ddaed10334d9f2b3463d65/test/historian/tests.clj | clojure | start the recording
change the atom state, add new record
restore the previous state
change the state
now we should return to the previous state
we shouldn't be watching this atom anymore | (ns historian.tests
(:require [clojure.test :as t :refer (is deftest with-test run-tests testing)]
[historian.core :as hist]))
(def test-atom (atom ""))
(deftest undos-test
(reset! test-atom "ABC")
(is (= "ABC" @test-atom))
at this point we should have taken the first record
(is (= "DEF" @test-a... |
f2476e6ad6af9ff67482b0422e94e130dbaf8aa88c643d55a0e313858f4c60dc | jordwalke/rehp | server.ml | open Lwt
open Cohttp
open Cohttp_lwt_unix
open Re
let _ = Findlib.init ()
let filesys = ref (Findlib.default_location ())
let server () =
let re_filesys =
compile (seq [str "/filesys/"; group (seq [str !filesys; rep any]); eos])
in
let header typ =
let h = Header.init () in
let h = Header.add h "Co... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/toplevel/examples/server/server.ml | ocaml | send binary file
send static file | open Lwt
open Cohttp
open Cohttp_lwt_unix
open Re
let _ = Findlib.init ()
let filesys = ref (Findlib.default_location ())
let server () =
let re_filesys =
compile (seq [str "/filesys/"; group (seq [str !filesys; rep any]); eos])
in
let header typ =
let h = Header.init () in
let h = Header.add h "Co... |
8f93803cb130f46b35c697a132f838f13374786847ca7f42c30c8e7b38fee904 | khotyn/4clojure-answer | 158-decurry.clj | (fn [f]
(fn [& args]
(reduce #(%1 %2) f args))) | null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/158-decurry.clj | clojure | (fn [f]
(fn [& args]
(reduce #(%1 %2) f args))) | |
208899786576cd06cec0b29d47ceb5e5cf87dd160c979851b2bddb330907b3e7 | lisp/de.setf.http | conditions.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Base : 10 ; Package : de.setf.http.implementation ; -*-
Copyright 2013 [ ) All Rights Reserved
(in-package :de.setf.http.implementation)
(define-condition http:condition (simple-condition)
#+sbcl () ; is broken
#-sbcl((code
:... | null | https://raw.githubusercontent.com/lisp/de.setf.http/1b219fdde06a43256118c7ca5c7887325752f078/conditions.lisp | lisp | Syntax : ansi - common - lisp ; Base : 10 ; Package : de.setf.http.implementation ; -*-
is broken
some conditions prescribe specific parameters. these are created like
and specialize the reporting argument construction or the entire
reposting method. others provide a default message as the format
string and permi... | Copyright 2013 [ ) All Rights Reserved
(in-package :de.setf.http.implementation)
(define-condition http:condition (simple-condition)
#-sbcl((code
:initform -1
:reader http:condition-code)
(text
:initform "" :initarg :text
:reader http:condition-text))
(:report http:report-condition)
(:de... |
f6bc3eb7389b7ade12faefa223b77319e63e36ba57affaab95015e903e8c450f | gusenov/stepik-functional-programming-hs | Demo.hs | В некоторых не , . , связанные с производительностью в некоторых ( весьма редких ) . ( почти консенсус ) , что это ограничение из . В GHCi оно по умолчанию , а вот при компиляции из модуля по умолчанию включено . Отключить monomorphism restriction можно , указав в начале файла исходного кода следу... | null | https://raw.githubusercontent.com/gusenov/stepik-functional-programming-hs/904164012b9b842a15d5ba3af05cfe589295fa5c/MultSecond/Demo.hs | haskell | В некоторых не , . , связанные с производительностью в некоторых ( весьма редких ) . ( почти консенсус ) , что это ограничение из . В GHCi оно по умолчанию , а вот при компиляции из модуля по умолчанию включено . Отключить monomorphism restriction можно , указав в начале файла исходного кода следу... | |
fd1d3c932fb5a2f77e1948638f01e8f59675862ee61956f5b8c1b680354e01b7 | opencog/opencog | pln-trail-1.scm | ;; Load PLN rule implication direct evaluation
(use-modules (opencog))
(use-modules (opencog nlp))
(use-modules (opencog pln))
(use-modules (opencog ure))
; FIXME: Doesn't return anything when confidence is low, don't use for now
( load - from - path " opencog / pln / rules / implication - direct - evaluation.scm " )
... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/opencog/ghost/procedures/pln-trail-1.scm | scheme | Load PLN rule implication direct evaluation
FIXME: Doesn't return anything when confidence is low, don't use for now
Extra knowledge ;;
Add knowledge about happy. The strenght is set low so that the new
inferred knowledge can get easily expressed.
(Word "playful")
(Set
(Implication (stv 0.51 0.0001)
... |
(use-modules (opencog))
(use-modules (opencog nlp))
(use-modules (opencog pln))
(use-modules (opencog ure))
( load - from - path " opencog / pln / rules / implication - direct - evaluation.scm " )
( add - to - pln - inferred - atoms
( add - to - pln - inferred - atoms
( add - to - pln - inferred - atoms
( add - to -... |
395c17d16f45096b0560771d1ba6bff214cef2c172bb6b97b3e9b066ea45c6c5 | mrkkrp/flac | Helpers.hs | # LANGUAGE ForeignFunctionInterface #
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module : Codec.Audio.FLAC.StreamEncoder.Internal.Helpers
Copyright : © 2016 – present
License : BSD 3 clause
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
-- Wrappers aro... | null | https://raw.githubusercontent.com/mrkkrp/flac/9a7beb51e74a396ef65f30c6619a601ee6b9655c/Codec/Audio/FLAC/StreamEncoder/Internal/Helpers.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : Codec.Audio.FLAC.StreamEncoder.Internal.Helpers
Stability : experimental
Portability : portable
Wrappers around helpers written to help work with the stream encoder.
| Encode given input file, return 'False' in case of failure.
| 'Encoder' to use
| Offset of... | # LANGUAGE ForeignFunctionInterface #
Copyright : © 2016 – present
License : BSD 3 clause
Maintainer : < >
module Codec.Audio.FLAC.StreamEncoder.Internal.Helpers
( encoderProcessHelper,
renderApodizationSpec,
)
where
import Codec.Audio.FLAC.StreamEncoder.Internal.Types
import Data.B... |
5c0e89d226855e2891bf92bdbb7796384a827170d7371facba4c7e30c567bf41 | mentat-collective/MathBox.cljs | data.cljs | (ns mathbox.primitives.data
(:require ["mathbox-react" :as box]
[mathbox.macros :refer [defprim]]))
(defprim box/Area
"*2D sampled matrix*
- `:aligned`: `false` (bool) - Use (fast) integer lookups
- `:axes`: `[1, 2]` (swizzle(2) axis) - Axis pair
- `:bufferHeight`: `1` (number) - Matrix buffer h... | null | https://raw.githubusercontent.com/mentat-collective/MathBox.cljs/281fc373ca2e2e05de7b789f0c1764ab5a66ea05/src/mathbox/primitives/data.cljs | clojure | (ns mathbox.primitives.data
(:require ["mathbox-react" :as box]
[mathbox.macros :refer [defprim]]))
(defprim box/Area
"*2D sampled matrix*
- `:aligned`: `false` (bool) - Use (fast) integer lookups
- `:axes`: `[1, 2]` (swizzle(2) axis) - Axis pair
- `:bufferHeight`: `1` (number) - Matrix buffer h... | |
2fc6490b63195988aeded1dbdb1cad97b300bc29b8d6dc24269e2ef493deaab3 | kayceesrk/ocaml5-tutorial | fib_twice.ml | let n = try int_of_string Sys.argv.(1) with _ -> 10
let rec fib n = if n < 2 then 1 else fib (n - 1) + fib (n - 2)
let main () =
let d1 = Domain.spawn (fun _ -> fib n) in
let d2 = Domain.spawn (fun _ -> fib n) in
let r1 = Domain.join d1 in
Printf.printf "fib(%d) = %d\n%!" n r1;
let r2 = Domain.join d2 in
... | null | https://raw.githubusercontent.com/kayceesrk/ocaml5-tutorial/36989cd5ffe42d7fc0b2710443b612f27bc9af5d/src/fib_twice.ml | ocaml | let n = try int_of_string Sys.argv.(1) with _ -> 10
let rec fib n = if n < 2 then 1 else fib (n - 1) + fib (n - 2)
let main () =
let d1 = Domain.spawn (fun _ -> fib n) in
let d2 = Domain.spawn (fun _ -> fib n) in
let r1 = Domain.join d1 in
Printf.printf "fib(%d) = %d\n%!" n r1;
let r2 = Domain.join d2 in
... | |
0af35c3b8184dd871b049c48db3a4f718b63ebef7936f2affa960a26e0b6f86d | LesBoloss-es/ppx_deriving_madcast | unpack_and_cast_option.ml | let () =
let res =
Some "2"
|> [%madcast: string option -> int]
in
assert (2 = res)
| null | https://raw.githubusercontent.com/LesBoloss-es/ppx_deriving_madcast/2d44cbf21f79cd7aeacb077c09672ee823e5ba3f/test/positive/unpack_and_cast_option.ml | ocaml | let () =
let res =
Some "2"
|> [%madcast: string option -> int]
in
assert (2 = res)
| |
1a6ae6ce223ade608937e01ecd1e43c51d88cede7102bc7626d34cf52fa2c4f8 | sidwubf/wechat-erlang-sdk | wechat_app.erl | %%%-------------------------------------------------------------------
%% @doc wechat public API
%% @end
%%%-------------------------------------------------------------------
-module(wechat_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%%=======================================... | null | https://raw.githubusercontent.com/sidwubf/wechat-erlang-sdk/5242ce4615423499f58fbb9b058361757073c6ee/apps/wechat/src/wechat_app.erl | erlang | -------------------------------------------------------------------
@doc wechat public API
@end
-------------------------------------------------------------------
Application callbacks
====================================================================
API
=========================================================... |
-module(wechat_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
application:start(cowboy),
application:start(crypto),
application:start(public_key),
application:start(ssl),
application:start(hackney),
application:start(jiffy),
Dispatch = cowboy... |
1f53f27b9b01046c5c14ae01011d821a023db9648911c07282610773a4b0c896 | audreyt/openafp | MCC.hs |
module OpenAFP.Records.AFP.MCC where
import OpenAFP.Types
import OpenAFP.Internals
data MCC = MCC {
mcc_Type :: !N3
,mcc_ :: !N3
,mcc :: !NStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/AFP/MCC.hs | haskell |
module OpenAFP.Records.AFP.MCC where
import OpenAFP.Types
import OpenAFP.Internals
data MCC = MCC {
mcc_Type :: !N3
,mcc_ :: !N3
,mcc :: !NStr
} deriving (Show, Typeable)
| |
0e2e7d61044661fb56b181f6dd442c96cde92bc8850b18697fcdf5a904ed39df | arthuredelstein/clooj | protocols.clj | Copyright ( c ) 2011 - 2013 ,
; All rights reserved.
Eclipse Public License 1.0
;
(ns clooj.protocols)
;; Repl protocol
(defprotocol Repl
(evaluate [this code] "Evaluate code (a string).")
(close [this] "Stop the repl instance."))
| null | https://raw.githubusercontent.com/arthuredelstein/clooj/6d78d07c16ff339e782b0031eae3a2ef1eeb5280/src/clooj/protocols.clj | clojure | All rights reserved.
Repl protocol | Copyright ( c ) 2011 - 2013 ,
Eclipse Public License 1.0
(ns clooj.protocols)
(defprotocol Repl
(evaluate [this code] "Evaluate code (a string).")
(close [this] "Stop the repl instance."))
|
ec9af5d41a4f37b49ea0dd90a0a6f833c305563c7affcc8bf8eccb83a51be91a | facebook/infer | doliObjCAst.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/67c44e839eb791c98d850208649708449745c85f/infer/src/textual/doliObjCAst.mli | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
17fdb4d4413f362acd2b70285de89f5aa56bec879a2de95ba454c25c0d9e524b | jacobobryant/mystery-cows | core.cljs | (ns cows.core
(:require-macros
[cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<!]]
[cows.components :as c]
[cows.db :as db]
[cows.mutations :as m]
[cows.lib :as lib]
[trident.util :as u]
[rum.core :as rum]))
(when (= "localhost" js/location.hostname)
(.us... | null | https://raw.githubusercontent.com/jacobobryant/mystery-cows/5edbab7d5ca5dcd8b14f855ae4665690d9b1387e/src/cows/core.cljs | clojure | (ns cows.core
(:require-macros
[cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<!]]
[cows.components :as c]
[cows.db :as db]
[cows.mutations :as m]
[cows.lib :as lib]
[trident.util :as u]
[rum.core :as rum]))
(when (= "localhost" js/location.hostname)
(.us... | |
9bdf512f138a9240d56b4c228556fdc76816e7616b5544776c2bd56d82f946e6 | gregr/ina | base-test.scm | ((require test module:base-primitive module:base language:base
premodule module:premodule module-apply namespace-link*))
(test 'testing-eval/parse #t #t)
(define ns (namespace-link* '() (list module:base-primitive module:base)))
(define name=>lang (list (cons 'base language:base)))
(define (ev form)
(defin... | null | https://raw.githubusercontent.com/gregr/ina/5e0a5b7ec44c8c9575b22ce5c394f7a96b766545/nscheme/old/old-5/lib/base-test.scm | scheme | Formal parameters are generalized to arbitrary trees.
Formal parameters are generalized to arbitrary trees. | ((require test module:base-primitive module:base language:base
premodule module:premodule module-apply namespace-link*))
(test 'testing-eval/parse #t #t)
(define ns (namespace-link* '() (list module:base-primitive module:base)))
(define name=>lang (list (cons 'base language:base)))
(define (ev form)
(defin... |
fc4a27da04207f29e27a2a188e1fd0df44d4a855df01d8767b60c8acb66573fb | sile/erl-rtmpmsg | rtmpmsg_message_decode_tests.erl | %% coding: latin-1
-module(rtmpmsg_message_decode_tests).
-include_lib("eunit/include/eunit.hrl").
-include("../include/rtmpmsg.hrl").
-include("../include/internal/rtmpmsg_internal.hrl").
%% NOTE: encodeのテストも兼ねてしまっている
decode_test_() ->
[
{"set_chunk_sizeメッセージのデコード",
fun () ->
assert_mes... | null | https://raw.githubusercontent.com/sile/erl-rtmpmsg/8ab84ef3cfe859d321f24d280b2959cd796156f2/test/rtmpmsg_message_decode_tests.erl | erlang | coding: latin-1
NOTE: encodeのテストも兼ねてしまっている | -module(rtmpmsg_message_decode_tests).
-include_lib("eunit/include/eunit.hrl").
-include("../include/rtmpmsg.hrl").
-include("../include/internal/rtmpmsg_internal.hrl").
decode_test_() ->
[
{"set_chunk_sizeメッセージのデコード",
fun () ->
assert_message_decode(rtmpmsg:set_chunk_size(1234))
e... |
146ca0fd7fee895fd31e657cec9a3ea5d2ed8bd2dce8eb1c875810306839386d | rohitjha/ProjectEuler | PE003.hs | import MPL.NumberTheory.Primes
main = putStrLn $ show $ last $ primeFactors 600851475143
| null | https://raw.githubusercontent.com/rohitjha/ProjectEuler/2f0a46bb1547b06a373c30966bba7a001b932bf4/MPL/PE003.hs | haskell | import MPL.NumberTheory.Primes
main = putStrLn $ show $ last $ primeFactors 600851475143
| |
2a8c02f924036b253d5304e6749bc746d4feeec51e45596b93d2d241e35aad41 | 1HaskellADay/1HAD | Exercise.hs | module HAD.Y2014.M04.D14.Exercise where
| stagedComputation
Given a list of endofunctions and an initial value , stagedComputation returns
the list of the staged computation of these functions
( might be unclear , check the examples )
Examples :
> > > stagedComputation [ ( +1 ) , ( * 2 ) ... | null | https://raw.githubusercontent.com/1HaskellADay/1HAD/3b3f9b7448744f9b788034f3aca2d5050d1a5c73/exercises/HAD/Y2014/M04/D14/Exercise.hs | haskell | module HAD.Y2014.M04.D14.Exercise where
| stagedComputation
Given a list of endofunctions and an initial value , stagedComputation returns
the list of the staged computation of these functions
( might be unclear , check the examples )
Examples :
> > > stagedComputation [ ( +1 ) , ( * 2 ) ... | |
4c0f09c3fb401a950b147f08a68ffee1369e2f65df050dd15618d73b5fcf1dcd | juspay/atlas | Handler.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/parking-bap/src/API/Parking/SearchId/Quotes/Handler.hs | haskell | TODO Do we need to check that personId == search.requestorId? | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... |
93a2cdbf5c85882de88cccee86cc6e2153b0c47d22588e79e241e1465f7d86e3 | VinylRecords/Vinyl | Functor.hs | # LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
# LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs ... | null | https://raw.githubusercontent.com/VinylRecords/Vinyl/43aa1ae22f98dd5a71e94f8275684f19a05af03b/Data/Vinyl/Functor.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
# LANGUAGE DeriveTraversable #
# LANGUAGE GADTs #
# LANGUAGE PolyKinds #
# LANGUAGE TypeOperators #
* Introduction
$introduction
* Data T... | # LANGUAGE CPP #
# LANGUAGE DeriveFoldable #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
module Data.Vinyl.Functor
Ide... |
d29a4291ece7fbce5132e22d28232ec6b17489fd518fbc569058997fa2eb8366 | pa-ba/compdata-param | HDifunctor.hs | # LANGUAGE TemplateHaskell , ScopedTypeVariables #
--------------------------------------------------------------------------------
-- |
Module : Data . Comp . . Multi . Derive . HDifunctor
Copyright : ( c ) 2011 ,
-- License : BSD3
Maintainer : < >
-- Stability : experimental
P... | null | https://raw.githubusercontent.com/pa-ba/compdata-param/5d6b0afa95a27fd3233f86e5efc6e6a6080f4236/src/Data/Comp/Param/Multi/Derive/HDifunctor.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Automatically derive instances of @HDifunctor@.
------------------------------------------------------------------------------
covariant argument
contravariant argument
Pattern for t... | # LANGUAGE TemplateHaskell , ScopedTypeVariables #
Module : Data . Comp . . Multi . Derive . HDifunctor
Copyright : ( c ) 2011 ,
Maintainer : < >
Portability : non - portable ( GHC Extensions )
module Data.Comp.Param.Multi.Derive.HDifunctor
(
HDifunctor,
makeHDifunctor
... |
2ff60a6e805ff374052cdf33f18d7e5bef36b71b6eeec6aae3928933165c6a40 | hadolint/hadolint | DL3049.hs | module Hadolint.Rule.DL3049 (rule) where
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Sequence as Seq
import qualified Data.Text as Text
import Hadolint.Rule
import Language.Docker.Syntax
rule :: LabelSchema -> Rule args
rule labelschema = mconcat $ fmap missingLabelRule (M... | null | https://raw.githubusercontent.com/hadolint/hadolint/be6658f1a3a4f5f02d04f990e69fb28680491b71/src/Hadolint/Rule/DL3049.hs | haskell | missingLabelRule
triggers on a `FROM` instruction when label `label` is not defined within
that stage. Tracks defined labels through multi stage builds | module Hadolint.Rule.DL3049 (rule) where
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Sequence as Seq
import qualified Data.Text as Text
import Hadolint.Rule
import Language.Docker.Syntax
rule :: LabelSchema -> Rule args
rule labelschema = mconcat $ fmap missingLabelRule (M... |
82b231de908b6a65b11a48210d07b6c661d2ff604efdd65a8a727958bd7a38b5 | comby-tools/comby | location.ml | open Core_kernel
type t =
{ offset : int
; line : int
; column : int
}
[@@deriving yojson, eq, sexp]
let default = { offset = -1; line = -1; column = -1 }
| null | https://raw.githubusercontent.com/comby-tools/comby/a36c63fb1e686adaff3e90aed00e88404f8cda78/lib/kernel/match/location.ml | ocaml | open Core_kernel
type t =
{ offset : int
; line : int
; column : int
}
[@@deriving yojson, eq, sexp]
let default = { offset = -1; line = -1; column = -1 }
| |
f5c8934e15e8d0b617610bbe4dd627ff658425c4c38cc43bf35655b27c9fc049 | Soonad/Formality-Haskell | Net.hs | module Spec.Net where
import qualified Data.Vector.Unboxed as V
import Data.Word
import Test.Hspec
import Test.QuickCheck
import Runtime.Net
instance Arbitrary NType where
arbitrary = arbitraryBoundedEnum
instance Arbitrary Slot where
arbitrary = arbitraryBoundedEnum
in... | null | https://raw.githubusercontent.com/Soonad/Formality-Haskell/c2aebe3daeb1031399fd33986729722906520e89/test/Spec/Net.hs | haskell | module Spec.Net where
import qualified Data.Vector.Unboxed as V
import Data.Word
import Test.Hspec
import Test.QuickCheck
import Runtime.Net
instance Arbitrary NType where
arbitrary = arbitraryBoundedEnum
instance Arbitrary Slot where
arbitrary = arbitraryBoundedEnum
in... | |
96d3530e1701ba24718af5d83043bfe8bf114bba28014fa9ec16876c70c22434 | re-ops/re-core | common.clj | (ns re-core.persistency.common
"common persistency layer functions"
(:require
[clojure.walk :refer [postwalk]]
[com.rpl.specter :refer (transform select ALL)]
[re-cog.facts.datalog :refer (flatten-keys fact-pairs)]
[clojure.string :refer (escape join)]))
(defn args-of
"grab args from string"
[s]
... | null | https://raw.githubusercontent.com/re-ops/re-core/e13490aedd6d34ff01f11b28adf359beb5c0bb5b/src/re_core/persistency/common.clj | clojure | (ns re-core.persistency.common
"common persistency layer functions"
(:require
[clojure.walk :refer [postwalk]]
[com.rpl.specter :refer (transform select ALL)]
[re-cog.facts.datalog :refer (flatten-keys fact-pairs)]
[clojure.string :refer (escape join)]))
(defn args-of
"grab args from string"
[s]
... | |
9630d2b08adf651c3cf4fab13454b6925811aba6c2dcb10a378aec67d17e4336 | ocamllabs/ocaml-modular-implicits | multdef.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/basic-multdef/multdef.mli | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
val f : int -> int
val f : int -> int
v... |
17a5e6faf8e74d202d4d011443dfdb873d1a86ca256491bb615aa77b25375029 | GaloisInc/renovate | Redirect.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
-- | This module is the entry point for binary code redirection
module Renovate.Redirect (
redirect,
BlockMapping(..),
RedirectionResult(..),
*
RM.runRedirectT,
RM.RewriterState(..),
RM.SectionInfo(..),
RM.SymbolMap,
RM.NewSymbolsMap
) where
im... | null | https://raw.githubusercontent.com/GaloisInc/renovate/89b82366f84be894c3437852e39c9b4e28666a37/renovate/src/Renovate/Redirect.hs | haskell | # LANGUAGE GADTs #
| This module is the entry point for binary code redirection
blocks to redirect execution to alternate blocks that have been
instrumented with the provided @instrumentor@. The instrumentor is
applied to each redirected basic block. The new blocks are laid
out starting at the new start address,... | # LANGUAGE FlexibleContexts #
module Renovate.Redirect (
redirect,
BlockMapping(..),
RedirectionResult(..),
*
RM.runRedirectT,
RM.RewriterState(..),
RM.SectionInfo(..),
RM.SymbolMap,
RM.NewSymbolsMap
) where
import qualified Control.Monad.Catch as X
import Control.Monad.Trans ( MonadIO ... |
8aad87b2ece8cd6e3cd004a141989a77c1faeb89121421f6db507ffb408bb169 | jakemcc/sicp-study | 2_28.clj | Exercise 2.28
; Write a procedure named fringe that takes as an argument
; a tree (represented as a list) and returns a list
; whose elements are all the leaves of the tree arranged in
; left-to-right order.
;
; Example:
( def x ' ( ( 1 2 ) ( 3 4 ) ) )
; (fringe x)
; (1 2 3 4)
(defn fringe [x]
(cond (not (seq? ... | null | https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section2.2/2_28.clj | clojure | Write a procedure named fringe that takes as an argument
a tree (represented as a list) and returns a list
whose elements are all the leaves of the tree arranged in
left-to-right order.
Example:
(fringe x)
(1 2 3 4) | Exercise 2.28
( def x ' ( ( 1 2 ) ( 3 4 ) ) )
(defn fringe [x]
(cond (not (seq? x)) (list x)
(empty? x) nil
:else
(concat (fringe (first x))
(fringe (rest x)))))
(fringe '(1 2 3))
(def x '((1 2) (3 4)))
(fringe x)
|
3f593ad1e707839cfc8cf7c8a5695e25c6e3b686b62c7ea17a3fa0a50c884adc | static-analysis-engineering/codehawk | bCHTrace.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchanalyze/bCHTrace.ml | ocaml | chutil
xprlib
bchlib
bchlibx86 | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
173da9ed21027d0ea1fba52ed753144a6db02874b5a9e6ca6c87c1a77f6609a3 | mejgun/haskell-tdlib | SearchMessages.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.SearchMessages where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ChatList as ChatList
import qualified TD.Data.SearchMessagesFilter as SearchMessagesFilter
import qualified Utils as U
-- |
-- Searches for mes... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Query/SearchMessages.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)).
| If not 0, the maximum date of the messages to return
| If not 0, the minimum date of the messages to return
| ... |
module TD.Query.SearchMessages where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ChatList as ChatList
import qualified TD.Data.SearchMessagesFilter as SearchMessagesFilter
import qualified Utils as U
For optimal performance , the number of returned messages is c... |
df73433750fd199add5694116b65962d05f76fd6a28cdf138f5cea8cf2b5be32 | maryrosecook/islaclj | home.clj | (ns tryclojure.views.home
(:require [noir.core :refer [defpartial defpage]]
[noir.response :refer [redirect]]
[hiccup.element :refer [javascript-tag link-to unordered-list]]
[hiccup.page :refer [include-css include-js html5]]))
(defn footer []
[:div.footer "<a href='/'>home</a>&... | null | https://raw.githubusercontent.com/maryrosecook/islaclj/4394ddcbd05d3d2da91c89f28e57c764bfef8d88/src/tryclojure/views/home.clj | clojure |
& nbsp ; < code > age is ' 2'</code><br/ >
& nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp;<code > is ' drum'</code><br/ >
<code>band is a list</code><br/>
& nbsp ; & nbsp ; & nbsp ; & nbsp ; & nbsp;<code > remove from band</code><br/ >
<code>write band</code><br/>
ga.async = true ;
... | (ns tryclojure.views.home
(:require [noir.core :refer [defpartial defpage]]
[noir.response :refer [redirect]]
[hiccup.element :refer [javascript-tag link-to unordered-list]]
[hiccup.page :refer [include-css include-js html5]]))
(defn footer []
<a href=''>mary rose ... |
b4278409f1be44b9aa5b6f3f89dac1a5b9f0310c721ccd3a2a6b55599bd2b3cc | lisp-mirror/cl-tar | posix.lisp | ;;;; This is part of cl-tar. See README.md and LICENSE for more information.
(in-package #:tar-create)
(defun check-for-hardlink (stat)
(uiop:nest
(when (hash-table-p *hard-links*))
(let ((nlinks (nix:stat-nlink stat))))
(when (> nlinks 1))
(gethash (list (nix:stat-dev stat)
(nix:stat-... | null | https://raw.githubusercontent.com/lisp-mirror/cl-tar/7c6e07a10c93d9e311f087b5f6328cddd481669a/src/create/posix.lisp | lisp | This is part of cl-tar. See README.md and LICENSE for more information.
Compute the common fields.
Build up the args
Handle the type specific parts.
Make the entry and add it to the archive
Record for hardlink detection
Make an entry for the directory itself.
Contents
Explicit merge, otherwise relative names w... |
(in-package #:tar-create)
(defun check-for-hardlink (stat)
(uiop:nest
(when (hash-table-p *hard-links*))
(let ((nlinks (nix:stat-nlink stat))))
(when (> nlinks 1))
(gethash (list (nix:stat-dev stat)
(nix:stat-ino stat))
*hard-links*)))
(defun maybe-register-hardlink (stat ... |
bf2b9a395d3f361f0dfa4429d3dd18b579183beb19305899fd009f774cc40832 | tarides/ocaml-platform-installer | installed_repo.ml | open Rresult
let update opam_opts t = Opam.update opam_opts [ Repo.name t ]
let with_repo_enabled opam_opts t f =
let repo_name = Repo.name t and repo_path = Repo.path t in
let unselect_repo () = ignore @@ Opam.Repository.remove opam_opts repo_name in
Opam.Repository.add opam_opts ~path:repo_path repo_name >>= ... | null | https://raw.githubusercontent.com/tarides/ocaml-platform-installer/d24fa0590888673cc3b0eb828a3be484c0f8a8af/src/lib/installed_repo.ml | ocaml | open Rresult
let update opam_opts t = Opam.update opam_opts [ Repo.name t ]
let with_repo_enabled opam_opts t f =
let repo_name = Repo.name t and repo_path = Repo.path t in
let unselect_repo () = ignore @@ Opam.Repository.remove opam_opts repo_name in
Opam.Repository.add opam_opts ~path:repo_path repo_name >>= ... | |
601a3371dae0a087325fbd7fdf4eed36fee7c9cfc1b36a3102b72b1350b82d78 | igrishaev/clj-java-book | io.clj | (ns project.io
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clj-http.client :as client])
(:import java.util.regex.Pattern
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream... | null | https://raw.githubusercontent.com/igrishaev/clj-java-book/667260c7111b87950b99608d37e1175bd168a5ca/project/src/project/io.clj | clojure | other fields... | (ns project.io
(:require [clojure.java.io :as io]
[clojure.string :as str]
[clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clj-http.client :as client])
(:import java.util.regex.Pattern
org.apache.commons.compress.archivers.zip.ZipArchiveInputStream... |
c98afcdf8029a760a95bdbcef9afff5369834d280bfef42818dc5864f275565a | OCamlPro/OCamlPro-OCaml-Branch | parsetree.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/OCamlPro/OCamlPro-OCaml-Branch/3a522985649389f89dac73e655d562c54f0456a5/inline-more/parsing/parsetree.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
open Asttypes
type core_typ... |
8bcb83ca8818c739058df6a8980dcea5755f5ba5722d5e126e9e37f6bb442c1a | nick8325/quickspec | MinMax.hs | {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
import QuickSpec
import Test.QuickCheck
import Data.Monoid
import Data.Typeable
newtype Constant = Constant Integer deriving (Eq, Ord, Typeable, Num)
instance Arbitrary Constant where
arbitrary = fmap (Constant . getPositive) arbitrary
main = quickSpec... | null | https://raw.githubusercontent.com/nick8325/quickspec/cb61f719d3d667674431867037ff44dec22ca4f9/examples/tests/MinMax.hs | haskell | # LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #
con "negate" (negate :: Integer -> Integer),
con "0" (0 :: Integer), | import QuickSpec
import Test.QuickCheck
import Data.Monoid
import Data.Typeable
newtype Constant = Constant Integer deriving (Eq, Ord, Typeable, Num)
instance Arbitrary Constant where
arbitrary = fmap (Constant . getPositive) arbitrary
main = quickSpec [
withMaxTermSize 9,
series [sig1, sig2] ]
sig1 = [
con ... |
9eac611d4f7d9579347c3cbbdfa9c4f0eb52a4dda7b56974084c2ee31472b5e6 | ZHaskell/stdio | BigSum.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
module Auto.G.BigSum where
import Control.DeepSeq
import Data.Aeson
import qualified Std.Data.JSON.Base as JSON
import GHC.Generics (Generic)
import Options
data BigSum = F01 | F02 | F03 | F04 | F05
| F06 | F07 | F08 | F09 | F10
| F11... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/bench/json/Auto/G/BigSum.hs | haskell | # LANGUAGE DeriveAnyClass # | # LANGUAGE DeriveGeneric #
module Auto.G.BigSum where
import Control.DeepSeq
import Data.Aeson
import qualified Std.Data.JSON.Base as JSON
import GHC.Generics (Generic)
import Options
data BigSum = F01 | F02 | F03 | F04 | F05
| F06 | F07 | F08 | F09 | F10
| F11 | F12 | F13 | F14 | F15
... |
cc8ec42b209fae4c8569770fe921061d44efae0930b6e839ab2a409022208fa1 | dbuenzli/useri | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let tsdl = Conf.with_pkg "tsdl"
let jsoo = Conf.with_pkg "js_of_ocaml"
let jsoo_test ~cond test =
Pkg.flatten
[ Pkg.test ~run:false ~cond ~auto:false (test ^ ".js");
Pkg.test ~run:false ~cond ~auto:false (test ^ ".html"); ]
let () =
Pkg.de... | null | https://raw.githubusercontent.com/dbuenzli/useri/4646a7b8f3c0d6ce34b1c3f789eebe56cb75b9d2/pkg/pkg.ml | ocaml | Pkg.test ~run:false "test/test_tsdl";
Pkg.test ~run:false ~cond:tsdl "test/test_tsdl_fut";
Pkg.test ~run:false ~cond:tsdl "test/test_tsdl_lwt";
Pkg.test ~run:false ~cond:tsdl "test/min";
jsoo_test ~cond:jsoo "test/min";
jsoo_test ~cond:jsoo "test/test_jsoo";
jsoo_test ~con... | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let tsdl = Conf.with_pkg "tsdl"
let jsoo = Conf.with_pkg "js_of_ocaml"
let jsoo_test ~cond test =
Pkg.flatten
[ Pkg.test ~run:false ~cond ~auto:false (test ^ ".js");
Pkg.test ~run:false ~cond ~auto:false (test ^ ".html"); ]
let () =
Pkg.de... |
10ac18c14efb5625357c175f42a9e3ea115ba4e6d0743cd95617cc284984a893 | Ptival/chick | Fresh.hs | module Term.Fresh where
import Data.List (union, (\\))
import Term.Free (freeVars)
import Term.Term (TermX, Variable, mkVariable)
freshNames :: [String]
freshNames = [c : s | s <- "" : freshNames, c <- ['a' .. 'z']]
freshVariables :: [Variable]
freshVariables = map mkVariable freshNames
freshAvoidStream :: [Variabl... | null | https://raw.githubusercontent.com/Ptival/chick/a5ce39a842ff72348f1c9cea303997d5300163e2/backend/lib/Term/Fresh.hs | haskell | module Term.Fresh where
import Data.List (union, (\\))
import Term.Free (freeVars)
import Term.Term (TermX, Variable, mkVariable)
freshNames :: [String]
freshNames = [c : s | s <- "" : freshNames, c <- ['a' .. 'z']]
freshVariables :: [Variable]
freshVariables = map mkVariable freshNames
freshAvoidStream :: [Variabl... | |
d13855b9a1feb6c7d14906de72678360b022a347a3a07a46d48fa717784f3735 | graninas/Hydra | Impl.hs | {-# LANGUAGE ExplicitForAll #-}
module Hydra.Core.Process.Impl where
import Hydra.Prelude
import qualified Data.Map as M
import qualified Hydra.Core.Domain.Process as D
import qualified Hydra.Core.RLens as RLens
import qualified Hydra.Core.Runtime as R
newtype LangRunner ... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-base/src/Hydra/Core/Process/Impl.hs | haskell | # LANGUAGE ExplicitForAll # |
module Hydra.Core.Process.Impl where
import Hydra.Prelude
import qualified Data.Map as M
import qualified Hydra.Core.Domain.Process as D
import qualified Hydra.Core.RLens as RLens
import qualified Hydra.Core.Runtime as R
newtype LangRunner m' = LangRunner (forall a. m' a ... |
3843782e335e3b56337ef7dadc18c783c500db087e8dfdb4b4fafabf1dcd3d47 | klutometis/clrs | section.scm | (require-extension
syntax-case
foof-loop
vector-lib
(srfi 9 26))
(module
section-10.1
(make-stack
stack-data
stack-empty?
push!
pop!
peek
make-queue
queue-data
enqueue!
dequeue!
make-deque
enqueue-tail!
enqueue-head!
dequeue-tail!
dequeue-head!
stack-enqueue!
stack-dequeue!
queue... | null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/10.1/section.scm | scheme | (require-extension
syntax-case
foof-loop
vector-lib
(srfi 9 26))
(module
section-10.1
(make-stack
stack-data
stack-empty?
push!
pop!
peek
make-queue
queue-data
enqueue!
dequeue!
make-deque
enqueue-tail!
enqueue-head!
dequeue-tail!
dequeue-head!
stack-enqueue!
stack-dequeue!
queue... | |
16580518a3fd7bc2a3612df9e3ca472c4ff9e5686ede411f31218eab28ed5575 | dparis/gen-phzr | scale_manager.cljs | (ns phzr.impl.accessors.scale-manager)
(def scale-manager-constants
{:exact-fit "EXACT_FIT"
:no-scale "NO_SCALE"
:resize "RESIZE"
:show-all "SHOW_ALL"
:user-scale "USER_SCALE"})
(def scale-manager-get-properties
{:aspect-ratio "aspectRatio"
:bounding-parent "boundingParent"
:bounds "bounds"
:... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/impl/accessors/scale_manager.cljs | clojure | (ns phzr.impl.accessors.scale-manager)
(def scale-manager-constants
{:exact-fit "EXACT_FIT"
:no-scale "NO_SCALE"
:resize "RESIZE"
:show-all "SHOW_ALL"
:user-scale "USER_SCALE"})
(def scale-manager-get-properties
{:aspect-ratio "aspectRatio"
:bounding-parent "boundingParent"
:bounds "bounds"
:... | |
63a217ed661363b2dfc01780c2ab908ef05c29b5207d16d209f9a2de536dd1cf | bobzhang/ocaml-book | test_stream.ml |
let rec walk dir =
let items =
try
Array.map (fun fn ->
let path = Filename.concat dir fn in
try if Sys.is_directory path then `Dir path else `File path
with e -> `Error(path,e) ) (Sys.readdir dir)
with e -> [| `Error (dir,e) |] in
Array.fold_right
(fun item rest -> match item with
... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/lang/code/stream/test_stream.ml | ocaml |
let rec walk dir =
let items =
try
Array.map (fun fn ->
let path = Filename.concat dir fn in
try if Sys.is_directory path then `Dir path else `File path
with e -> `Error(path,e) ) (Sys.readdir dir)
with e -> [| `Error (dir,e) |] in
Array.fold_right
(fun item rest -> match item with
... | |
c9d234fcd40c832eea760cb06db00f5e631e5728a22daba773e835216b2a8681 | mbutterick/brag | test-parser.rkt | #lang racket/base
(require rackunit
br-parser-tools/lex
brag/rules/parser
brag/rules/lexer
brag/rules/rule-structs)
;; quick-and-dirty helper for pos construction.
(define (p x)
(pos x #f #f))
FIXME : fix the test cases so they work on locations rather than just offsets .
... | null | https://raw.githubusercontent.com/mbutterick/brag/6c161ae31df9b4ae7f55a14f754c0b216b60c9a6/brag-lib/brag/test/test-parser.rkt | racket | quick-and-dirty helper for pos construction. | #lang racket/base
(require rackunit
br-parser-tools/lex
brag/rules/parser
brag/rules/lexer
brag/rules/rule-structs)
(define (p x)
(pos x #f #f))
FIXME : fix the test cases so they work on locations rather than just offsets .
(check-equal? (grammar-parser (tokenize (open-in... |
0967ad34a703bf8cd49039b52f588455df683c7debf535eeddbec3afdf968bc1 | MLanguage/mlang | format_mast.ml | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
This program is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option ) any later
... | null | https://raw.githubusercontent.com/MLanguage/mlang/24b4ae382aa3c31d4aaf3964ca750f5173a37285/src/mlang/m_frontend/format_mast.ml | ocaml | * AST pretty printer | Copyright ( C ) 2019 - 2021 Inria , contributor :
< >
This program is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option ) any later
... |
1ebfbd5a91c979373ba668bd3b4cd1257f539613fa58e17383569330b47766b3 | didier-wenzek/ocaml-kafka | tail_kafka_topic.ml | open Cmdliner
open Lwt
open Kafka.Metadata
let info =
let doc = "Echo all messages consumed from a kafka topic" in
let man = [
`S "DESCRIPTION";
`P "$(tname) prints all messages consumed from the kafka BROKERS along the topic TOPIC.";
`P "All partitions are consumed, unless a specific PARTITION is give... | null | https://raw.githubusercontent.com/didier-wenzek/ocaml-kafka/50712fe58c470c5c443c88227171194c9e798b3d/bin/tail_kafka_topic.ml | ocaml | open Cmdliner
open Lwt
open Kafka.Metadata
let info =
let doc = "Echo all messages consumed from a kafka topic" in
let man = [
`S "DESCRIPTION";
`P "$(tname) prints all messages consumed from the kafka BROKERS along the topic TOPIC.";
`P "All partitions are consumed, unless a specific PARTITION is give... | |
373cc7ef24a0b53ed9c3c838dc6ddd7c9544b76b803137c34887ec013d6927fc | fakedata-haskell/fakedata | Naruto.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Faker.Provider.Naruto where
import Config
import Control.Monad.Catch
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Monoid ((<>))
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider.TH
import Language.Haskell... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/7b0875067386e9bb844c8b985c901c91a58842ff/src/Faker/Provider/Naruto.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Provider.Naruto where
import Config
import Control.Monad.Catch
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Monoid ((<>))
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider.TH
import Language.Haskell.TH
parseNaruto :: FromJSON a => ... |
6bc2ec4092541ca8abb8d275db0f91452a3120f79baf2df38362d871e11fb1d8 | sampou-org/ghc_users_guide_ja | RedirectingOutput.hs | module Options.RedirectingOutput where
import Types
redirectingOutputOptions :: [Flag]
redirectingOutputOptions =
[ flag { flagName = "-hcsuf ⟨suffix⟩"
, flagDescription = "中間 C ファイル用の接尾辞を設定"
, flagType = DynamicFlag
}
, flag { flagName = "-hidir ⟨dir⟩"
, flagDescription = "インタ... | null | https://raw.githubusercontent.com/sampou-org/ghc_users_guide_ja/91ac4ee4347802bbfc63686cfcbd4fc12f95a584/8.2.2/mkUserGuidePart/Options/RedirectingOutput.hs | haskell | module Options.RedirectingOutput where
import Types
redirectingOutputOptions :: [Flag]
redirectingOutputOptions =
[ flag { flagName = "-hcsuf ⟨suffix⟩"
, flagDescription = "中間 C ファイル用の接尾辞を設定"
, flagType = DynamicFlag
}
, flag { flagName = "-hidir ⟨dir⟩"
, flagDescription = "インタ... | |
0525eb6d2c0618aff2255289beb3e2675a743b6ae741acb3f63335e04d086ff9 | OCamlPro/alt-ergo | ac.mli | (******************************************************************************)
(* *)
(* The Alt-Ergo theorem prover *)
Copyright ( C ) 2006 - 2013 ... | null | https://raw.githubusercontent.com/OCamlPro/alt-ergo/291523151417f4cd112744d740b58ab1e8a630b4/src/lib/reasoners/ac.mli | ocaml | ****************************************************************************
The Alt-Ergo theorem prover
... | Copyright ( C ) 2006 - 2013
... |
d82296af509f33c0cb1b3c887e8112efd7242fb8166f41dfa6676129e01cb9ad | jimrthy/frereth | service.clj | (ns backend.web.service
"Main wrapper that controls what the web server will do"
;; FIXME: Convert all the print calls to use weald
(:require [aleph.http.server :as aleph]
[aleph.netty]
[backend.web.routes :as routes]
[clojure.core.async :as async]
[clojure.java.io ... | null | https://raw.githubusercontent.com/jimrthy/frereth/e1c4a5c031355ff1ff3bb60741eb03dff2377e1d/apps/log-viewer/src/clj/backend/web/service.clj | clojure | FIXME: Convert all the print calls to use weald
Q: What are the legal options here?
Q: Worth enumerating the list of legal codes?
ring.core.protocols/StreamableResponseBody.
By default, that's fulfilled by the classes/interfaces
#{String ISeq File InputStream}
Those happen to be the same types that satisfy
Und... | (ns backend.web.service
"Main wrapper that controls what the web server will do"
(:require [aleph.http.server :as aleph]
[aleph.netty]
[backend.web.routes :as routes]
[clojure.core.async :as async]
[clojure.java.io :as io]
[clojure.pprint :refer (pprint)]
... |
af9770d4d9d6cb58fa3136ceb88d2fe07b931b195da00b59d61f3ed82ca38588 | HaskellForCats/HaskellForCats | simpcondi1.hs | module PosNegIf where
posOrNeg x =
if x >= 0
then "Pos "
else "Neg "
-- note no returns or paren
| null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/simpcondi1.hs | haskell | note no returns or paren | module PosNegIf where
posOrNeg x =
if x >= 0
then "Pos "
else "Neg "
|
0b21f96836b6270cd95b2410cf7bd976dc3b713793db5674d66c143ebeb180f7 | thephoeron/quipper-language | QuantumIf.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
| This module introduces a simple way of defini... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Algorithms/BF/QuantumIf.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
acting over qubits. See "Algorithms.BF.Main" for an overview of the boolean
formula algorithm.
-------------------------------------... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
| This module introduces a simple way of defining \"boolean statements\ "
module Algorithms.BF.QuantumIf where
import Quipper
* Quantum \"if then else\ " statements
$ This section introduces a simple way of defining \"boolean state... |
eca1f0a6a01c1e292d173f0b8529739e3d7ed93fb3db00ffb916a8129fdb4f46 | kostmo/circleci-failure-tracker | AuthStages.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module AuthStages where
import Data.Aeson
import Data.Text (Text)
import Database.PostgreSQL.Simple.FromField (FromField, fromField)
import GHC.Generics
import qualified JsonUtils
ne... | null | https://raw.githubusercontent.com/kostmo/circleci-failure-tracker/393d10a72080bd527fdb159da6ebfea23fcd52d1/app/fetcher/src/AuthStages.hs | haskell | # LANGUAGE OverloadedStrings #
TODO do error handling: -simple-0.6.2/docs/Database-PostgreSQL-Simple-FromField.html | # LANGUAGE DeriveGeneric #
module AuthStages where
import Data.Aeson
import Data.Text (Text)
import Database.PostgreSQL.Simple.FromField (FromField, fromField)
import GHC.Generics
import qualified JsonUtils
newtype Username = Username Text deri... |
f8fe296bd0d74dc6a5c4614485a41ada6e72d5a8925fcde182646486b25ec6d6 | tomoyuki28jp/web4r | arc-challenge.lisp | Take the Arc Challenge
;
;
; To run:
1 . Compile and load this file
2 . Go to :8080 / said
(eval-when (:compile-toplevel :load-toplevel :execute)
(asdf:oos 'asdf:load-op :web4r))
(in-package :cl-user)
(defpackage :arc (:use :cl :web4r :sml))
(in-package :arc)
Arc : codetree of 23 nodes : 15 leaves / t... | null | https://raw.githubusercontent.com/tomoyuki28jp/web4r/c0ebe1f8d29994af20bdece8e9ad8b356b136ae9/examples/arc-challenge.lisp | lisp |
To run:
(aform [w/link (pr "you said: " (arg _ "foo"))
(pr "click here")]
(input "foo")
(submit))) | Take the Arc Challenge
1 . Compile and load this file
2 . Go to :8080 / said
(eval-when (:compile-toplevel :load-toplevel :execute)
(asdf:oos 'asdf:load-op :web4r))
(in-package :cl-user)
(defpackage :arc (:use :cl :web4r :sml))
(in-package :arc)
Arc : codetree of 23 nodes : 15 leaves / tokens + 8 interi... |
3f25b74c715dc80fb39354a323c7735a834ee91de065e9f693b555384418b4b0 | semilin/layoup | Pine.lisp |
(MAKE-LAYOUT :NAME "Pine" :MATRIX
(APPLY #'KEY-MATRIX '("ylrdwjmou," "csntgphaei" "xzqvkbf'/."))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/Pine.lisp | lisp |
(MAKE-LAYOUT :NAME "Pine" :MATRIX
(APPLY #'KEY-MATRIX '("ylrdwjmou," "csntgphaei" "xzqvkbf'/."))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
5e2f30a425788ce65fddf9b692b4f23212c02e38c89cdc5ca50434971e5c7f1d | sullyj3/adventofcode2022 | Parsers.hs | -- designed to be imported qualified
module AOC.Parsers
( signedInt
, commaSeparatedInts
, pairOf
, pairOfBoth
, numPair
, linesOf
, numLine
) where
import AOC.Parse
import Text.Megaparsec.Char
import Prelude hiding (many, some)
import Data.Char (isDigit)
import Utils (zipA)
import ... | null | https://raw.githubusercontent.com/sullyj3/adventofcode2022/1b8f28e78ac69ec7af857132eb4785c1e9dca011/src/AOC/Parsers.hs | haskell | designed to be imported qualified
treats all non-digit characters as separators | module AOC.Parsers
( signedInt
, commaSeparatedInts
, pairOf
, pairOfBoth
, numPair
, linesOf
, numLine
) where
import AOC.Parse
import Text.Megaparsec.Char
import Prelude hiding (many, some)
import Data.Char (isDigit)
import Utils (zipA)
import Text.Megaparsec.Char.Lexer (signed)
... |
4a31b9d5533dbcdb3f66d263d4637a802fc7bc60a1e7a992d2f5a74f1a30c821 | semperos/webdriver-logic | core.clj | (ns ^{:doc "Benchmarks performed with criterium. Where quick-benchmark was used, this is noted."}
webdriver-logic.test.benchmarks.core
(:refer-clojure :exclude [==])
(:use webdriver-logic.core
clojure.core.logic
[clj-webdriver.core :only [quit start]]
criterium.core)
(:require [webdriver... | null | https://raw.githubusercontent.com/semperos/webdriver-logic/d6fa8795ebf9e023d3f6baffbdba27cdf784368f/test/webdriver_logic/test/benchmarks/core.clj | clojure |
This is the print out of my system data for each benchmark. | (ns ^{:doc "Benchmarks performed with criterium. Where quick-benchmark was used, this is noted."}
webdriver-logic.test.benchmarks.core
(:refer-clojure :exclude [==])
(:use webdriver-logic.core
clojure.core.logic
[clj-webdriver.core :only [quit start]]
criterium.core)
(:require [webdriver... |
94bdff9d6c29b3ea1a0c6b7e2e309d3adf6a095f1e4f5a5ba2367eba949c2901 | ghcjs/jsaddle-dom | RTCPeerConnectionIceEvent.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.RTCPeerConnectionIceEvent
(getCandidate, getCandidateUnsafe, getCandidateUnchecked,
RTCPeerConnectionIceEve... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/RTCPeerConnectionIceEvent.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.RTCPeerConnectionIceEvent
(getCandidate, getCandidateUnsafe, getCandidateUnchecked,
RTCPeerConnectionIceEvent(..), gTypeRTCPeerConnectionIceEvent)
where
import Prelude ((.), (==), (>>=), return, IO, ... |
bbdf53870112cfd9687004664c7f99c6720aa111f4d51ce74490f1be7867b6df | yogthos/Selmer | node.clj | (ns selmer.node
" Node protocol for the objects that get accum'd in the post-parse vector.
Same vector that will be processed by the runtime context-aware renderer.
Currently only TextNodes and FunctionNodes. Anything that requires action
upon context map data at runtime is handled by a generated anonymous func... | null | https://raw.githubusercontent.com/yogthos/Selmer/947dfaf2e337a25b86e8db11eac25a8a375b6b7c/src/selmer/node.clj | clojure | Implements fn handler for the context map. fn handlers can
access any data in the context map.
Implements dumb text content injection at runtime. | (ns selmer.node
" Node protocol for the objects that get accum'd in the post-parse vector.
Same vector that will be processed by the runtime context-aware renderer.
Currently only TextNodes and FunctionNodes. Anything that requires action
upon context map data at runtime is handled by a generated anonymous func... |
ef852d989d998cb53466191db937dc85df36c67bd9886c6f456eaf91af5d551c | bsansouci/bsb-native | string_access.ml |
external caml_string_get_16 : string -> int -> int = "%caml_string_get16"
external caml_string_get_32 : string -> int -> int32 = "%caml_string_get32"
external caml_string_get_64 : string -> int -> int64 = "%caml_string_get64"
external caml_string_set_16 : string -> int -> int -> unit =
"%caml_string_set16"
external... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/testsuite/tests/prim-bigstring/string_access.ml | ocaml |
external caml_string_get_16 : string -> int -> int = "%caml_string_get16"
external caml_string_get_32 : string -> int -> int32 = "%caml_string_get32"
external caml_string_get_64 : string -> int -> int64 = "%caml_string_get64"
external caml_string_set_16 : string -> int -> int -> unit =
"%caml_string_set16"
external... | |
8a3212fb5f354156d57abdffd59676f513d527c8e74a2f22386d8ec8dd748455 | S8A/htdp-exercises | ex395.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex395) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex395.rkt | racket | about the language level of this file in a form that our tools can easily process.
[List-of X] N -> [List-of X]
[List-of X] N -> [List-of X] | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex395) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
Produces the first n items of l
(define (take n l)
... |
17b88ccd3259222b4da3b75cb64bc05c4c96d824731d2ea49efe9089177c2289 | lwhjp/racket-asm | generic.rkt | #lang racket/base
(provide (all-defined-out))
(require racket/unit
"generic/generic-asm-sig.rkt"
"generic/generic-x86-unit.rkt")
(define-values/invoke-unit generic-x86@
(import)
(export generic-asm^))
| null | https://raw.githubusercontent.com/lwhjp/racket-asm/57abd235fcb8c7505990f8e9731c01c716324ee5/generic.rkt | racket | #lang racket/base
(provide (all-defined-out))
(require racket/unit
"generic/generic-asm-sig.rkt"
"generic/generic-x86-unit.rkt")
(define-values/invoke-unit generic-x86@
(import)
(export generic-asm^))
| |
d7a9712840c53f8be0aaf9b62c74fde2941909fd13d65a493ad291d41eb254e6 | idubrov/siperl | sip_transaction_base.erl | @author < >
%%% @doc Base transaction functions, which are used in macroses from
` sip_transaction.hrl ' to simplify transactions FSM code .
%%% @end
2011 - 2012 . See LICENSE file .
-module(sip_transaction_base).
%% Include files
-include("../sip_common.hrl").
-include("sip.hrl").
-include("sip_transact... | null | https://raw.githubusercontent.com/idubrov/siperl/251daf3a0d7c7442f56f42cfd6c92764a4f475a7/apps/sip/src/transaction/sip_transaction_base.erl | erlang | @doc Base transaction functions, which are used in macroses from
@end
Include files
Exports
API
-----------------------------------------------------------------
API
-----------------------------------------------------------------
This is mostly a problem for server transactions.
Send request to the given dest... | @author < >
` sip_transaction.hrl ' to simplify transactions FSM code .
2011 - 2012 . See LICENSE file .
-module(sip_transaction_base).
-include("../sip_common.hrl").
-include("sip.hrl").
-include("sip_transaction.hrl").
FSM callbacks
-export([handle_event/3, handle_sync_event/4, handle_info/3, term... |
7668bbbcd07b2ac999b4f60be2287c9b693ade4d71d9461efd0bbc2a4d8d0b12 | mishun/tangles | TangleFlypeClasses.hs | {-# LANGUAGE MultiWayIf #-}
module Math.Topology.KnotTh.Tabulation.TangleFlypeClasses
( generateFlypeEquivalentDecomposition
, generateFlypeEquivalentDecompositionInTriangle
, generateFlypeEquivalent
, generateFlypeEquivalentInTriangle
) where
import Control.Arrow (first)
import Control.Monad (forM... | null | https://raw.githubusercontent.com/mishun/tangles/9af39dd48e3dcc5e3944f8d060c8769ff3d81d02/src/Math/Topology/KnotTh/Tabulation/TangleFlypeClasses.hs | haskell | # LANGUAGE MultiWayIf # | module Math.Topology.KnotTh.Tabulation.TangleFlypeClasses
( generateFlypeEquivalentDecomposition
, generateFlypeEquivalentDecompositionInTriangle
, generateFlypeEquivalent
, generateFlypeEquivalentInTriangle
) where
import Control.Arrow (first)
import Control.Monad (forM_, when, guard)
import quali... |
92f7604732b87f640d011c6a5851c4b3930cc8e2406e366c5bb8db5491fa9d1b | metabase/metabase | nest_query.clj | (ns metabase.query-processor.util.nest-query
"Utility functions for raising/nesting parts of MBQL queries. Currently, this only has [[nest-expressions]], but in
the future hopefully we can generalize this a bit so we can do more things that require us to introduce another
level of nesting, e.g. support window fun... | null | https://raw.githubusercontent.com/metabase/metabase/e587a20cbee9b4046b97938e5bd4a04a6ccb1881/src/metabase/query_processor/util/nest_query.clj | clojure | preprocess this without a current user context so it's not subject to permissions checks. To get
is itself ok, so we don't need to run another check
don't rewrite anything inside any source queries or source metadata.
when recursing into joins use the refs from the parent level. | (ns metabase.query-processor.util.nest-query
"Utility functions for raising/nesting parts of MBQL queries. Currently, this only has [[nest-expressions]], but in
the future hopefully we can generalize this a bit so we can do more things that require us to introduce another
level of nesting, e.g. support window fun... |
580ecd82b1d050d357a9ac29eaa20d78ba5e9e13a265060f8aa71f8f786e1df4 | collbox/http-cron | core.clj | (ns collbox.http-cron.core
(:require
[clj-http.client :as http]
[clojure.tools.logging :as log]
[clojurewerkz.quartzite.conversion :as qc]
[clojurewerkz.quartzite.jobs :as qj]
[clojurewerkz.quartzite.schedule.cron :as qcron]
[clojurewerkz.quartzite.scheduler :as qs]
[clojurewerkz.quartzite.trigge... | null | https://raw.githubusercontent.com/collbox/http-cron/a7795d5eb5ca9dbe29c73dd83b5f68a81d0145f6/src/collbox/http_cron/core.clj | clojure |
Public
params
state
TODO: validate data | (ns collbox.http-cron.core
(:require
[clj-http.client :as http]
[clojure.tools.logging :as log]
[clojurewerkz.quartzite.conversion :as qc]
[clojurewerkz.quartzite.jobs :as qj]
[clojurewerkz.quartzite.schedule.cron :as qcron]
[clojurewerkz.quartzite.scheduler :as qs]
[clojurewerkz.quartzite.trigge... |
15f0d5a0f58e8cd667b706bf7fd65513b978d1631b0d8dda20958f99059ad570 | pfdietz/ansi-test | vector-push-extend.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Jan 25 08:04:35 2003
Contains : Tests for VECTOR - PUSH - EXTEND
(deftest vector-push-extend.1
(let ((a (make-array '(5) :fill-pointer 2
:initial-contents '(a b c d e)))
(i 0) x y)
(values
(fill-pointer a)
(vec... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/arrays/vector-push-extend.lsp | lisp | -*- Mode: Lisp -*-
Tests on displaced arrays
strings
float tests
Error tests
It's actually adjustable, or...
... this fails | Author :
Created : Sat Jan 25 08:04:35 2003
Contains : Tests for VECTOR - PUSH - EXTEND
(deftest vector-push-extend.1
(let ((a (make-array '(5) :fill-pointer 2
:initial-contents '(a b c d e)))
(i 0) x y)
(values
(fill-pointer a)
(vector-push-extend (progn (... |
3396ee72b158b389f71b4e3f1b08f560af4c3471e2e1ee4e793add8b615e5f1f | Sudha247/ocaml5-tutorial-icfp-22 | matrix_multiplication.ml | let _matrix_multiply res x y =
let i_n = Array.length x in
let j_n = Array.length y.(0) in
let k_n = Array.length y in
for i = 0 to i_n - 1 do
for j = 0 to j_n - 1 do
let w = ref 0 in
for k = 0 to k_n - 1 do
w := !w + x.(i).(k) * y.(k).(j);
done;
res.(i).(j) <- !w
done
... | null | https://raw.githubusercontent.com/Sudha247/ocaml5-tutorial-icfp-22/7f04991a10270e5f5be0d2b1b6d931b242f4d3a2/code/parallel/matrix_multiplication.ml | ocaml | print_matrix m1; print_matrix m2; | let _matrix_multiply res x y =
let i_n = Array.length x in
let j_n = Array.length y.(0) in
let k_n = Array.length y in
for i = 0 to i_n - 1 do
for j = 0 to j_n - 1 do
let w = ref 0 in
for k = 0 to k_n - 1 do
w := !w + x.(i).(k) * y.(k).(j);
done;
res.(i).(j) <- !w
done
... |
472647685cd587cd20640cd40d6ed9b5190e1075d1b5964867441ea000b8e687 | benweitzman/hooks | Context.hs | module Control.Monad.Hooks.Primitives.Context where
import Control.Monad.Hooks.Class
import GHC.TypeLits (Symbol)
import Control.Monad.Hooks.Runtime (Hooks(Use), stepHooks, applyStateUpdate)
import Control.Monad.Hooks.List (HookList, traverseHookList, Elem)
import Unsafe.Coerce (unsafeCoerce)
data Context (s :: Symbo... | null | https://raw.githubusercontent.com/benweitzman/hooks/4a87c55f78f80b4d751c749672ade496d2b6d843/src/Control/Monad/Hooks/Primitives/Context.hs | haskell | sneaky | module Control.Monad.Hooks.Primitives.Context where
import Control.Monad.Hooks.Class
import GHC.TypeLits (Symbol)
import Control.Monad.Hooks.Runtime (Hooks(Use), stepHooks, applyStateUpdate)
import Control.Monad.Hooks.List (HookList, traverseHookList, Elem)
import Unsafe.Coerce (unsafeCoerce)
data Context (s :: Symbo... |
449525d8e5f81b30474be7ca815adc3d4f6ec2ca7713223ff7a8f2a5400ec969 | 39aldo39/klfc | Mod.hs | # LANGUAGE UnicodeSyntax , NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
module Layout.Mod
( Mod(Mod)
, isEmptyMod
, applyMod
, applyInverseMod
) where
import BasePrelude
import Prelude.Unicode
import Data.Monoid.Unicode ((∅), (⊕))
import Data.Aeson
import Layout.Pos (Pos)
import Permutation (P... | null | https://raw.githubusercontent.com/39aldo39/klfc/83908c54c955b9c160b999bc8f0892401ba4adbf/src/Layout/Mod.hs | haskell | # LANGUAGE UnicodeSyntax , NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
module Layout.Mod
( Mod(Mod)
, isEmptyMod
, applyMod
, applyInverseMod
) where
import BasePrelude
import Prelude.Unicode
import Data.Monoid.Unicode ((∅), (⊕))
import Data.Aeson
import Layout.Pos (Pos)
import Permutation (P... | |
d3604897046ea7bf4f2e03fde45b728df808209d584c47321e6942a630f82e12 | earl-ducaine/cl-garnet | error.lisp | ;;; -*- Mode: COMMON-LISP; Package: GARNET-GADGETS -*- ;;
;;-------------------------------------------------------------------;;
Copyright 1993 ; ;
;;-------------------------------------------------------------------;;
;; This code is in the Public Domain. Anyone ... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/protected-eval/error.lisp | lisp | -*- Mode: COMMON-LISP; Package: GARNET-GADGETS -*- ;;
-------------------------------------------------------------------;;
;
-------------------------------------------------------------------;;
This code is in the Public Domain. Anyone who can get some use ;;
from it is welcome. ... |
$ Id$
follows : ( 1 ) If there is a restart named abort , use it . ( 2 ) If
top level , or the main event loop or whatever . ( 3 ) If you ca n't
I 've put in a patch which works for Allegro 4.1 . You 'll need to
(in-package "GARNET-GADGETS")
(eval-when (:compile-toplevel :load-toplevel :execu... |
6f0b8e36ccade065d97a955abdd521dbeac09fdccb05c4e198137fdb227dddb5 | haskell/haskell-language-server | AutoSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module CodeAction.AutoSpec where
import Wingman.Types
import Test.Hspec
import Utils
spec :: Spec
spec = do
let autoTest = goldenTest Auto ""
autoTestNoWhitespace = goldenTestNoWhitespace Auto ""
describe "golden" $ do
autoTest 11 8 "AutoSplitGADT"
autoTest 2 ... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/CodeAction/AutoSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
module CodeAction.AutoSpec where
import Wingman.Types
import Test.Hspec
import Utils
spec :: Spec
spec = do
let autoTest = goldenTest Auto ""
autoTestNoWhitespace = goldenTestNoWhitespace Auto ""
describe "golden" $ do
autoTest 11 8 "AutoSplitGADT"
autoTest 2 11 "GoldenEitherAuto"
autoTest ... |
b5374a5828c2d701663189926bee22fb8e7852fe15dc5b11a4471ae74b65c917 | takikawa/racket-ppa | stepper.rkt | #|
todo:
- tree diff
- step until a particular reduction happens (or a choice point is reached)
- break points: supply a function to traces that is a predicate on terms, indicating if
this one is one where the -> button should stop.
|#
#lang racket/base
(require racket/pretty
racket/gui/base... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/d336bb10e3e0ec3a20020e9ade9e77d2f6f80b6d/share/pkgs/redex-gui-lib/redex/private/stepper.rkt | racket |
todo:
- tree diff
- step until a particular reduction happens (or a choice point is reached)
- break points: supply a function to traces that is a predicate on terms, indicating if
this one is one where the -> button should stop.
for testing
all-nodes-ht : hash[sexp -o> (is-a/c node%)]
the current... |
#lang racket/base
(require racket/pretty
racket/gui/base
racket/list
racket/dict
racket/class
racket/set
framework
mrlib/graph
racket/contract
"sexp-diffs.rkt"
"size-snip.rkt"
redex/private/reduction-semantics
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.