_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
f6ca6c8773bf0a4693558de115e5b10edca140137c1b8f06f0de850c769aef5a
xu-hao/QueryArrow
Server.hs
# LANGUAGE TypeFamilies , MultiParamTypeClasses , StaticPointers , RankNTypes , GADTs , ConstraintKinds , FlexibleContexts , TypeApplications , ScopedTypeVariables , FlexibleInstances # module QueryArrow.Remote.NoTranslation.Server where import QueryArrow.DB.DB import QueryArrow.DB.NoTranslation import QueryArrow.DB....
null
https://raw.githubusercontent.com/xu-hao/QueryArrow/4dd5b8a22c8ed2d24818de5b8bcaa9abc456ef0d/QueryArrow-db-remote/src/QueryArrow/Remote/NoTranslation/Server.hs
haskell
# LANGUAGE TypeFamilies , MultiParamTypeClasses , StaticPointers , RankNTypes , GADTs , ConstraintKinds , FlexibleContexts , TypeApplications , ScopedTypeVariables , FlexibleInstances # module QueryArrow.Remote.NoTranslation.Server where import QueryArrow.DB.DB import QueryArrow.DB.NoTranslation import QueryArrow.DB....
7efdc225eea45365e3de3a81c83953fd527e61924684c6330f4095b3c3ebee9d
matijapretnar/eff
multicoreOCaml.ml
(* Compilation to multicore ocaml *) open Utils module Backend : Language.Backend.S = struct (* ------------------------------------------------------------------------ *) (* Setup *) type state = { prog : Syntax.cmd list; primitive_effects : (Syntax.effect * (Syntax.ty * Syntax.ty) * (string * s...
null
https://raw.githubusercontent.com/matijapretnar/eff/1be07f0c7fbaadf5c28437bf11fe818aa76640e7/src/05-backends/multicore-ocaml/multicoreOCaml.ml
ocaml
Compilation to multicore ocaml ------------------------------------------------------------------------ Setup Auxiliary functions ------------------------------------------------------------------------ Processing functions
open Utils module Backend : Language.Backend.S = struct type state = { prog : Syntax.cmd list; primitive_effects : (Syntax.effect * (Syntax.ty * Syntax.ty) * (string * string * string)) list; } let initial_state = { prog = []; primitive_effects = [] } let update state cmd = Print.de...
a6f0ac239503317af126ded6aae886b46be1e94c56e871addfae9ad6b5e7f0c2
hasktorch/hasktorch
TestFunctions.hs
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE PolyKinds # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE UndecidableInstances # module TestFunctions wh...
null
https://raw.githubusercontent.com/hasktorch/hasktorch/8fa4d2a6cdb7f144484f7d24d8d4924fb0faecd2/examples/optimizers-cpp-typed/TestFunctions.hs
haskell
Convex Quadratic function ackley :: Float -> Float -> Float -> Tensor -> Tensor where b' = asTensor b c' = asTensor c d = asTensor . product $ shape x
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE PolyKinds # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE UndecidableInstances # module TestFunctions wh...
e465c33fb4f4453c291c569b7494e6e93517594231ff69ce97d3e1f2739ca9d3
Mikolaj/horde-ad
MinimalTest.hs
# LANGUAGE CPP # #if defined(VERSION_ghc_typelits_natnormalise) -- Not really used here, but this squashes a warning caused by a hack # OPTIONS_GHC -fplugin GHC.TypeLits . KnownNat . Solver # {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} #endif module Main (main) where import Prelude import Data.Proxy...
null
https://raw.githubusercontent.com/Mikolaj/horde-ad/24867746254691667658cbfe30f2232ab573642e/test/MinimalTest.hs
haskell
Not really used here, but this squashes a warning caused by a hack # OPTIONS_GHC -fplugin GHC.TypeLits.Normalise # Limit interleaving of characters in parallel tests.
# LANGUAGE CPP # #if defined(VERSION_ghc_typelits_natnormalise) # OPTIONS_GHC -fplugin GHC.TypeLits . KnownNat . Solver # #endif module Main (main) where import Prelude import Data.Proxy import qualified System.IO as SIO import Test.Tasty import Test.Tasty.Options import Test.T...
ce18fd505536c6cf154e074fa63ed5d08c4b86490f86127b3aade7bd6016bba4
S8A/htdp-exercises
ex156.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-beginner-reader.ss" "lang")((modname ex156) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt...
null
https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex156.rkt
racket
about the language level of this file in a form that our tools can easily process. distances in terms of pixels graphical constants - '() - (cons Number List-of-nombers) A Shot is a Number. interpretation represents the shot's y-coordinate interpretation each number on such a list represents the y-coordinate...
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-beginner-reader.ss" "lang")((modname ex156) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t ...
4cb92c1dd1b2fc2728681bfd5626a4fca1a7725e247c59a04802a0a7066a6dde
opencog/opencog
data_#5.scm
Test # 5 ;; "It looks like a dog" ;; Expected result: ;; False (It is not a pleonastic it) (LemmaLink (WordInstanceNode "it") (WordNode "it") ) (EvaluationLink (DefinedLinguisticRelationshipNode "_obj") (ListLink (WordInstanceNode "like@0236eff7-e8e5-4de5-8ec3-99dc5782b7e2") (WordInstanceNode "...
null
https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/tests/nlp/anaphora/data/pleonastic_it/data_%235.scm
scheme
"It looks like a dog" Expected result: False (It is not a pleonastic it)
Test # 5 (LemmaLink (WordInstanceNode "it") (WordNode "it") ) (EvaluationLink (DefinedLinguisticRelationshipNode "_obj") (ListLink (WordInstanceNode "like@0236eff7-e8e5-4de5-8ec3-99dc5782b7e2") (WordInstanceNode "dog@978f75d0-2c6a-40ad-800f-06231f27f523") ) ) (EvaluationLink (DefinedLingui...
afdfc38d421cf586c996d96765c903dc727e3cb81b61c95a44e42280b3d71cff
iijlab/direct-hs
Interactive.hs
{-# LANGUAGE CPP #-} # LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # module Web.Direct.CLI.Interactive ( defaultMain , mainWith , noRoomIdConfigured , RunCommand , State (currentTalk, receivedYesNos, receivedSelects, receivedTasks) , defaultRunCommand ...
null
https://raw.githubusercontent.com/iijlab/direct-hs/2422fd6fe008109e8dfb74f31d65b0d5a0330788/direct4bi/src/Web/Direct/CLI/Interactive.hs
haskell
# LANGUAGE CPP #
# LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # module Web.Direct.CLI.Interactive ( defaultMain , mainWith , noRoomIdConfigured , RunCommand , State (currentTalk, receivedYesNos, receivedSelects, receivedTasks) , defaultRunCommand , HelpLine , defaultHelpLines ...
8114d790cf583366e3841933cccaeee4304f505f5a40a2c41ceac4de81de4c0f
TaktInc/freer
Loop.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE MultiParamTypeClasses # module Tests.Loop ( runFixLoop , runTailLoop , runForeverLoop ) where import Control.Concurrent (forkIO, killThread, threadDelay) import Control.Monad (forever) import ...
null
https://raw.githubusercontent.com/TaktInc/freer/b1e4911832ad12ef0b9b23883548dcf44ea3bd59/tests/Tests/Loop.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # | This loops forever as expected | This loops as expected | This <<loop>>s.
# LANGUAGE MultiParamTypeClasses # module Tests.Loop ( runFixLoop , runTailLoop , runForeverLoop ) where import Control.Concurrent (forkIO, killThread, threadDelay) import Control.Monad (forever) import Eff import Data.Function (fix) fixLoop :: Member IO ...
83e893962d1228c19f79fa0b08fc819be7f164ea8270dd895ea09bf5180557ec
reasonml/reason
reason_syntax_util.cppo.ml
Hello ! Welcome to the Reason syntax util logic . This file 's shared between the repo and the BuckleScript repo . In Reason , it 's in src / reason - parser . In BuckleScript , it 's in jscomp / outcome_printer . We periodically copy this file from Reason ( the source of truth ) to BuckleScript , t...
null
https://raw.githubusercontent.com/reasonml/reason/4f6ff7616bfa699059d642a3d16d8905d83555f6/src/reason-parser/reason_syntax_util.cppo.ml
ocaml
Rename labels in function definition/application and records It can't be a match if s is shorter than keyword Ensure s starts with keyword... ...and contains nothing else except trailing _ characters If we've made it this far there's a potential conflict * Add/remove an appropriate suffix when mangling potent...
Hello ! Welcome to the Reason syntax util logic . This file 's shared between the repo and the BuckleScript repo . In Reason , it 's in src / reason - parser . In BuckleScript , it 's in jscomp / outcome_printer . We periodically copy this file from Reason ( the source of truth ) to BuckleScript , t...
3305ea5627fd08d0b38ea0d2eaaedb6e939eaf20237fe8e83d74084648994c74
erlang/rebar3
ec_plists.erl
-*- mode : Erlang ; fill - column : 80 ; comment - column : 75 ; -*- %%% vi:ts=4 sw=4 et %%% The MIT License %%% Copyright ( c ) 2007 %%% %%% Permission is hereby granted, free of charge, to any person obtaining a copy %%% of this software and associated documentation files (the "Software"), to deal in the Soft...
null
https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/vendor/erlware_commons/src/ec_plists.erl
erlang
vi:ts=4 sw=4 et The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal to use, copy, modify, merge, publish, distribute, sublicense, and/or sell furnished to do so, subject to the following condit...
-*- mode : Erlang ; fill - column : 80 ; comment - column : 75 ; -*- Copyright ( c ) 2007 in the Software without restriction , including without limitation the rights copies of the Software , and to permit persons to whom the Software is all copies or substantial portions of the Software . THE SOFTWARE I...
ef62afd924ea4af16cf26086d331dab9c2fa444680c18a426ed6e0bf9813c623
kudu-dynamics/blaze
CallGraph.hs
module Blaze.Import.Source.Ghidra.CallGraph where import Blaze.Prelude hiding (Symbol) import qualified Blaze.Types.Function as Func import Blaze.Import.Source.Ghidra.Types (convertAddress) import Blaze.Types.CallGraph ( CallSite ( CallSite ), ) import qualified Blaze.Types.CallGraph as CG import Blaze.Type...
null
https://raw.githubusercontent.com/kudu-dynamics/blaze/2220a07d372a817e79525ec2707984b189fe98c9/src/Blaze/Import/Source/Ghidra/CallGraph.hs
haskell
so for now, if isVariadic is true, we use FuncVarArgInfo | Gets a Function based on address. Assumes function is in "ram" Are these sensible options for blaze?
module Blaze.Import.Source.Ghidra.CallGraph where import Blaze.Prelude hiding (Symbol) import qualified Blaze.Types.Function as Func import Blaze.Import.Source.Ghidra.Types (convertAddress) import Blaze.Types.CallGraph ( CallSite ( CallSite ), ) import qualified Blaze.Types.CallGraph as CG import Blaze.Type...
ab36b502dbbf2adf93e03a1adf253dc5e6f915b9069fb33ba4f0e02b90fb6431
bhauman/advent-of-clojure
day17.clj
(ns advent-2017.day17) (def input-steps 335) ;; Use a circular linked list that takes the form ;; {a -> b, b -> c, c -> a} ;; this allows a fast insertion of DD at b like so ;; {a -> b, b -> DD, DD -> c, c -> a} using an Array of Long for the underlying associative structure ;; for speed (defn splice-in-fast [^lo...
null
https://raw.githubusercontent.com/bhauman/advent-of-clojure/856763baf45bf7bf452ffd304dc1b89f9bc879a6/src/advent-2017/day17.clj
clojure
Use a circular linked list that takes the form {a -> b, b -> c, c -> a} this allows a fast insertion of DD at b like so {a -> b, b -> DD, DD -> c, c -> a} for speed idea from @val_waeselynck
(ns advent-2017.day17) (def input-steps 335) using an Array of Long for the underlying associative structure (defn splice-in-fast [^long step ^longs state ^long current-number] (loop [previous-number (dec current-number) step-count (mod step current-number)] (if (zero? ^long step-count) (let [...
80e26e57d1562b669cf05efea5115614f166977dc7044b8c2fa35538d54be236
evidentsystems/converge
ops.cljc
Copyright 2020 Evident Systems LLC 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 distributed ...
null
https://raw.githubusercontent.com/evidentsystems/converge/0d4c0bb47da9e90057450e5d629a61de45de6fac/converge/src/converge/editscript/ops.cljc
clojure
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 governing permis...
Copyright 2020 Evident Systems LLC distributed under the License is distributed on an " AS IS " BASIS , (ns converge.editscript.ops (:require [converge.domain :as domain])) #?(:clj (set! *warn-on-reflection* true) :cljs (set! *warn-on-infer* true)) (def ^:const EDIT 20) (defn edit [edits] (domain/op...
bba7ecef754f012a949bca02a56a703e499c8a036cbd6a77ff22c8b2769b40a6
dnadales/sandbox
Strategies.hs
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-} # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE StandaloneDeriving # -- | Use of deriving strategies. -- -- See: -- - -to-deriving-in-ghc-82/ -- - /~ghc/latest/docs/html/users_guide/glasgow_exts.html#default-deriving-str...
null
https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/haskell-extensions/src/Deriving/Strategies.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE DerivingStrategies # | Use of deriving strategies. See: - -to-deriving-in-ghc-82/ - /~ghc/latest/docs/html/users_guide/glasgow_exts.html#default-deriving-strategy
# LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE StandaloneDeriving # module Deriving.Strategies where newtype Foo a = MkFoo a deriving Show class Show a => Bar a where bar :: a -> String bar = show deriving newtype instance Bar a => Bar (Foo a) instance Bar Int
4384a685ce80c6f4adaa39462cbf58b89791df897141cc9c8bcc0d6c1c6b4e46
aufishgrp/istype
istype_transform.erl
-module(istype_transform). -export([parse_transform/2]). %%==================================================================== %% parse_transform api %%==================================================================== parse_transform(Forms, _Options) -> UserTypes = forms : reduce(fun get_types/2 , # { types = > # ...
null
https://raw.githubusercontent.com/aufishgrp/istype/4d30777eaf1309dbef73fff99605235a46a3e61b/src/istype_transform.erl
erlang
==================================================================== parse_transform api ==================================================================== is_integer(Value) orelse is_boolean(Value) ... OR begin __IsType_1 = expression(), is_integer(__IsType_1) orelse is_boolean(__IsType_1) ... end ...
-module(istype_transform). -export([parse_transform/2]). parse_transform(Forms, _Options) -> UserTypes = forms : reduce(fun get_types/2 , # { types = > # { } , records = > # { } } , Forms ) , forms : map(fun(Form ) - > do_transform(Form , UserTypes ) end , Forms ) . Records = forms:reduce(fun get_records/2, #{}, F...
7d02826c40c037a1df63ee8d35b25be42f4574a713a92a06b6c020377b5a58c5
asmyczek/simple-avro
utils_tests.clj
(ns simple-avro.utils-tests (:use (simple-avro schema core utils) (clojure test))) (defavro-record Test "field1" avro-string "field2" avro-int) (def test-records [{"field1" "record1" "field2" 10} {"field1" "record2" "field2" 20} {"field1" "record3" "field2" 30} {"field1" "record4" "field2" 40...
null
https://raw.githubusercontent.com/asmyczek/simple-avro/25825319e008316e20e9d4d867e2d88fcd389c7c/test/simple_avro/utils_tests.clj
clojure
Reader/writer example
(ns simple-avro.utils-tests (:use (simple-avro schema core utils) (clojure test))) (defavro-record Test "field1" avro-string "field2" avro-int) (def test-records [{"field1" "record1" "field2" 10} {"field1" "record2" "field2" 20} {"field1" "record3" "field2" 30} {"field1" "record4" "field2" 40...
6bad602a6d352352d6619a4a23070004d3c7c07c88953e5237c8732d207889f4
nodew/haskell-realworld-example
JWT.hs
module Conduit.JWT where import RIO hiding ((^?), (^.)) import Control.Monad.Except (runExceptT) import Crypto.JWT ( JWK, bestJWSAlg, ClaimsSet, JWTError, decodeCompact, encodeCompact, newJWSHeader, claimAud, claimExp, claimIat, claimIss, claimSub, ...
null
https://raw.githubusercontent.com/nodew/haskell-realworld-example/43c24450de8ef39faced4c078f26dc31b49d9919/src/Conduit/JWT.hs
haskell
module Conduit.JWT where import RIO hiding ((^?), (^.)) import Control.Monad.Except (runExceptT) import Crypto.JWT ( JWK, bestJWSAlg, ClaimsSet, JWTError, decodeCompact, encodeCompact, newJWSHeader, claimAud, claimExp, claimIat, claimIss, claimSub, ...
ea9efed287e36df46fa58efee5cb16aeb929359b50ed200c6ed1c33b62007b6a
tweag/ormolu
injective.hs
type family Id a = result | result -> a where Id a = a type family G (a :: k) b c = foo | foo -> k b where G a b c = (a, b)
null
https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/type-families/closed-type-family/injective.hs
haskell
type family Id a = result | result -> a where Id a = a type family G (a :: k) b c = foo | foo -> k b where G a b c = (a, b)
3121c8c3ae5ae75b04d01037bb3c4c66d8cfbad74ea7359ff1ae8d0704dadd94
polymeris/cljs-aws
cloud_directory.cljs
(ns cljs-aws.cloud-directory (:require [cljs-aws.base.requests]) (:require-macros [cljs-aws.base.service :refer [defservice]])) (defservice "CloudDirectory" "clouddirectory-2016-05-10.min.json")
null
https://raw.githubusercontent.com/polymeris/cljs-aws/3326e7c4db4dfc36dcb80770610c14c8a7fd0d66/src/cljs_aws/cloud_directory.cljs
clojure
(ns cljs-aws.cloud-directory (:require [cljs-aws.base.requests]) (:require-macros [cljs-aws.base.service :refer [defservice]])) (defservice "CloudDirectory" "clouddirectory-2016-05-10.min.json")
661c0b68cdb0a14efac805ad4deafc5eb3299bb20f2173e38238c6dd65b4487a
Kakadu/fp2022
tree.ml
* Copyright 2022 - 2023 , and contributors * SPDX - License - Identifier : LGPL-3.0 - or - later open Type exception Duplicate exception NotFound open Helper (* the following is the type of a tree: 'a tree = | EmptyLeaf | Leaf of (int * 'a) | Node of (int * 'a * 'a tree * 'a tree) *) let empty = EmptyLeaf l...
null
https://raw.githubusercontent.com/Kakadu/fp2022/0eb49bf60d173287607678159465c425cdf699be/SQLyd/lib/tree.ml
ocaml
the following is the type of a tree: 'a tree = | EmptyLeaf | Leaf of (int * 'a) | Node of (int * 'a * 'a tree * 'a tree)
* Copyright 2022 - 2023 , and contributors * SPDX - License - Identifier : LGPL-3.0 - or - later open Type exception Duplicate exception NotFound open Helper let empty = EmptyLeaf let is_empty = function | EmptyLeaf -> true | _ -> false ;; let rec size = function | EmptyLeaf -> 0 | Leaf _ -> 1 | Nod...
9781b560e8395343c47e37808a178f23573b97136add5b20cffc44134f167d66
mbj/mhs
Test.hs
import Test.Tasty import Test.Tasty.MGolden main :: IO () main = defaultMain $ testGroup "golden tests" [ goldenTest "example-a" "example/example-a.txt" $ pure "foo\nbar\n" , goldenTest "example-b" "example/example-b.txt" $ pure "foo\nbaz\n" ]
null
https://raw.githubusercontent.com/mbj/mhs/520755dacbed9f4fbb066dc90267e0c0cf9e8f93/tasty-mgolden/example/Test.hs
haskell
import Test.Tasty import Test.Tasty.MGolden main :: IO () main = defaultMain $ testGroup "golden tests" [ goldenTest "example-a" "example/example-a.txt" $ pure "foo\nbar\n" , goldenTest "example-b" "example/example-b.txt" $ pure "foo\nbaz\n" ]
64db2a2d27b3b709df7f4d40036f3331c9eadc2d897a0f4e7fa5e2afd2043f7e
andrewthad/sockets
Socket.hs
# language BangPatterns # # language DataKinds # {-# language DeriveAnyClass #-} # language DerivingStrategies # # language DuplicateRecordFields # # language GADTs # # language KindSignatures # # language StandaloneDeriving # module Socket ( SocketUnrecoverableException(..) , SocketException(..) , BindException...
null
https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/src-internal/Socket.hs
haskell
# language DeriveAnyClass # | This is used as a phantom type to distinguish between pinned and unpinned memory. The distinction drawn here concerns the manner in which the user while those resulting from newByteArray# are to pin a byte array requested by newByteArray# | A limit on the number of open file descript...
# language BangPatterns # # language DataKinds # # language DerivingStrategies # # language DuplicateRecordFields # # language GADTs # # language KindSignatures # # language StandaloneDeriving # module Socket ( SocketUnrecoverableException(..) , SocketException(..) , BindException(..) , Direction(..) , Conne...
0c2caf855d8bd3f0ea45c3f94ec025e6c55361520b653fb73d6b0065a6e9c041
synduce/Synduce
count_lt.ml
let xi_1 x2 = 1 + x2 let xi_0 x0 x1 = x1 < x0 ? 1 : 0 let c0 = 0 let rec g = function Elt(x) -> xi_0 a x | Cons(hd, tl) -> hd < a ? xi_1 (g tl) : c0
null
https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/extras/solutions/constraints/sortedlist/count_lt.ml
ocaml
let xi_1 x2 = 1 + x2 let xi_0 x0 x1 = x1 < x0 ? 1 : 0 let c0 = 0 let rec g = function Elt(x) -> xi_0 a x | Cons(hd, tl) -> hd < a ? xi_1 (g tl) : c0
bd858adabb02db97678861ad73f3763c34428b3cac0a64eb1b343e3336c76946
mirage/mirage
f0.mli
open Functoria.DSL val register : ?packages:package list -> ?keys:abstract_key list -> ?init:job impl list -> ?src:[ `Auto | `None | `Some of string ] -> string -> job impl list -> unit module Tool : sig val run_with_argv : ?help_ppf:Format.formatter -> ?err_ppf:Format.formatter -> string ...
null
https://raw.githubusercontent.com/mirage/mirage/7e36d793ad8bd34beb51bbba62a39aa035f7e297/test/f0/f0.mli
ocaml
open Functoria.DSL val register : ?packages:package list -> ?keys:abstract_key list -> ?init:job impl list -> ?src:[ `Auto | `None | `Some of string ] -> string -> job impl list -> unit module Tool : sig val run_with_argv : ?help_ppf:Format.formatter -> ?err_ppf:Format.formatter -> string ...
16f203dcc151cd6d52037764962b7fb7c88342f3c410ab9fd5f70ec8a85a7afd
agocorona/TCache
TCache.hs
# OPTIONS_GHC -fno - warn - orphans # # LANGUAGE ScopedTypeVariables , ExistentialQuantification , FlexibleInstances , UndecidableInstances # FlexibleInstances, UndecidableInstances #-} | TCache is a transactional cache with configurable persistence that permits STM transactions with objects that synchronize...
null
https://raw.githubusercontent.com/agocorona/TCache/72158de657f72c3b480cea1878b5cebfbfd65d13/Data/TCache.hs
haskell
* Operations with cached database references * @IResource@ class * Operations with cached objects data definition used to communicate object Inserts and Deletes to the cache empty resources * Trigger operations * Cache control } * Other import Debug.Trace (!>) = flip trace The Maybe one keeps it alive until th...
# OPTIONS_GHC -fno - warn - orphans # # LANGUAGE ScopedTypeVariables , ExistentialQuantification , FlexibleInstances , UndecidableInstances # FlexibleInstances, UndecidableInstances #-} | TCache is a transactional cache with configurable persistence that permits STM transactions with objects that synchronize...
a0a2fc777776907320920d6ba12ddfad859dca5345c297d9f81ee8f0a588c75f
dundalek/closh
throw2.cljc
(defn my-throw [] (throw (Exception. "my exception"))) (my-throw)
null
https://raw.githubusercontent.com/dundalek/closh/b1a7fd310b6511048fbacb8e496f574c8ccfa291/fixtures/script-mode-tests/throw2.cljc
clojure
(defn my-throw [] (throw (Exception. "my exception"))) (my-throw)
4500ce872a751b3667abdec3af848a457a7f9241266bef508cf877586d3bef72
ocsigen/js_of_ocaml
test_time.ml
Js_of_ocaml compiler * / * Copyright ( C ) 2019 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of the License ,...
null
https://raw.githubusercontent.com/ocsigen/js_of_ocaml/e451f5b70125f72a20597898a086ce45626a837d/compiler/tests-jsoo/test_time.ml
ocaml
check gmtime
Js_of_ocaml compiler * / * Copyright ( C ) 2019 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of the License ,...
aed2249901f284b86bc8dcebb96b57d774a9ba96dfd94258237ae2b8a6a809ec
borodust/claw
packages.lisp
(uiop:define-package :claw.generator.common (:use :cl :alexandria :claw.util) (:export #:explode-library-definition #:generate-binding #:generate-forward-declaration #:signal-unknown-entity #:check-entity-known #:dependablep #:foreign-entity-depend...
null
https://raw.githubusercontent.com/borodust/claw/ef59eeaed16841da659e3b6f449486950240791a/src/gen/common/packages.lisp
lisp
(uiop:define-package :claw.generator.common (:use :cl :alexandria :claw.util) (:export #:explode-library-definition #:generate-binding #:generate-forward-declaration #:signal-unknown-entity #:check-entity-known #:dependablep #:foreign-entity-depend...
370224f1293e81b8b012954acf791ca8263ade15560a898888f383e0e52970de
tlikonen/cl-decimals
decimals.lisp
A decimal number parser and formatting package for Common Lisp . ;; Author : < > ;; ;; License: Creative Commons CC0 (public domain dedication) ;; (defpackage #:decimals (:use #:cl) (:export #:round-half-away-from-zero #:format-decimal-number #:parse-decimal-number #:decima...
null
https://raw.githubusercontent.com/tlikonen/cl-decimals/b7980f11282e00ac91b93b537778dad04fe85c11/decimals.lisp
lisp
License: Creative Commons CC0 (public domain dedication)
A decimal number parser and formatting package for Common Lisp . Author : < > (defpackage #:decimals (:use #:cl) (:export #:round-half-away-from-zero #:format-decimal-number #:parse-decimal-number #:decimal-parse-error #:decimal-parse-error-string #:def...
e924a8810940fee4bf769a300dee25e627491be953d2c959b5260409ee48db9a
thheller/shadow-cljs
perf.cljs
(ns test.perf)
null
https://raw.githubusercontent.com/thheller/shadow-cljs/ba0a02aec050c6bc8db1932916009400f99d3cce/src/repl/test/perf.cljs
clojure
(ns test.perf)
76205cb2a522fc7651d00f687f6e59764331c78982691d306d03d499c684b5db
nomnom-insights/nomnom.stature
statsd_server.clj
(ns stature.helper.statsd-server (:require [aleph.udp :as udp] [byte-streams :as bs] [clojure.string :as str] [manifold.stream :as s])) ;; Adopted from aleph.udp examples (defn parse-statsd-packet [{:keys [message]}] (let [message (bs/to-string message)] (->> message str/split-lines...
null
https://raw.githubusercontent.com/nomnom-insights/nomnom.stature/857111b711d637094e813487acab7e915f78b06d/test/stature/helper/statsd_server.clj
clojure
Adopted from aleph.udp examples
(ns stature.helper.statsd-server (:require [aleph.udp :as udp] [byte-streams :as bs] [clojure.string :as str] [manifold.stream :as s])) (defn parse-statsd-packet [{:keys [message]}] (let [message (bs/to-string message)] (->> message str/split-lines (map #(str/split % #":")...
aebb494c0ab0f4885fea00c68aa114996c99fa7014f4839b1b0f2ac65b71cf16
openmusic-project/OMChroma
ad1m-rt.lisp
;****************************************************************** ; CLASS AD1M ;****************************************************************** ; Example of advanced class (in-package :cr) Define base class from Csound ORC (defclass-from-cs-orc (merge-pathnames "ad1m.orc" *load-pathname*)) ;;; Extension...
null
https://raw.githubusercontent.com/openmusic-project/OMChroma/5ded34f22b59a1a93ea7b87e182c9dbdfa95e047/sources/omsharp/cs-events/advanced-cs-classes/ad1m-rt.lisp
lisp
****************************************************************** CLASS AD1M ****************************************************************** Example of advanced class Extension with additional global slots and array fields additional fields are used for the some parsing predefined-methods redefinition (i...
(in-package :cr) Define base class from Csound ORC (defclass-from-cs-orc (merge-pathnames "ad1m.orc" *load-pathname*)) (defclass! ad1m-x (ad1m) (om::elts :initarg :elts :accessor om::elts :initform 1 :documentation "number of elements (csound 'notes')") (action-time :initarg :action-time :accessor action...
485002cc6cf67aa335a2df6098a55ba453e251428170ae81b872422a526109c0
fragnix/fragnix
IX.hs
module IX where import C1 import C2 import T instance C1 Int where c1 = 5 where x = c2 :: T Bool
null
https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/quick/CrazyCycles/IX.hs
haskell
module IX where import C1 import C2 import T instance C1 Int where c1 = 5 where x = c2 :: T Bool
6a3e2ec8457b9c3efabf2a60cf073f55414898001a49921ebe1e717e6092b6f0
mbenke/zpf2013
Bad2.hs
module Bad2 where import Impure printStr :: String -> () printStr [] = () printStr (c:cs) = let () = iputchar c () = printStr cs in () main :: IO() main = printStr "Hello\n" `seq` return ()
null
https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/IO/Bad2.hs
haskell
module Bad2 where import Impure printStr :: String -> () printStr [] = () printStr (c:cs) = let () = iputchar c () = printStr cs in () main :: IO() main = printStr "Hello\n" `seq` return ()
4484bba59effe51033a9a18e034f34c985989d4aebc960fc60caa63c63efdefe
cushon/project-euler
111.rkt
#lang racket (require "common.rkt") Find the sum of all 10 digits primes that have the maximal occurence of some ; digit. (define (solve) (define (seen lst) (define (h last last-c lst) (cond [(and (empty? lst) (> last 9)) '()] [(empty? lst) (cons last-c (h (add1 last) 0 lst))] ...
null
https://raw.githubusercontent.com/cushon/project-euler/d7fcbfff0cd59b2c3691293ff35bb2043b409f68/111.rkt
racket
digit.
#lang racket (require "common.rkt") Find the sum of all 10 digits primes that have the maximal occurence of some (define (solve) (define (seen lst) (define (h last last-c lst) (cond [(and (empty? lst) (> last 9)) '()] [(empty? lst) (cons last-c (h (add1 last) 0 lst))] [(= last...
b39b067019ccc44b2bd56fccd02d7256203fe8a520c2114f4a7afdbb68549903
LexiFi/landmarks
ppx_landmarks.ml
(** Nothing here, just bind the library to register the mapper. *)
null
https://raw.githubusercontent.com/LexiFi/landmarks/ea90c657f39d03d14d892732ad58123711eb9457/ppx/ppx_landmarks.ml
ocaml
* Nothing here, just bind the library to register the mapper.
9cc7463872fa8d88e806bfba8be648ce8a444bec5369693391c3787ac743f34d
input-output-hk/cardano-sl
Addresses.hs
# LANGUAGE TypeApplications # module Test.Spec.Addresses (spec, withFixture, Fixture(..)) where import Universum import Control.Monad.Except (runExceptT) import Data.Acid (update) import qualified Data.ByteString as B import qualified Data.Map.Strict as M import qualified Data.Set as S i...
null
https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/test/unit/Test/Spec/Addresses.hs
haskell
| Prepare some fixtures using the 'PropertyM' context to prepare the data, scope (after the bracket initialisation). account for this wallet, placed at 'firstHardened'. by default each fresh account gets a new address. Low & behold here lies an hack: in order to produce the data in the same order in which it will...
# LANGUAGE TypeApplications # module Test.Spec.Addresses (spec, withFixture, Fixture(..)) where import Universum import Control.Monad.Except (runExceptT) import Data.Acid (update) import qualified Data.ByteString as B import qualified Data.Map.Strict as M import qualified Data.Set as S i...
4e98f2f81ad07197110b6265ba8e549367265c533dfb7bba8fbf3cd6c4e0c986
facebook/flow
flowLsp.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/3087a6613a614e5a08f1fe2a7cb2b65edd07fff8/src/lsp/flowLsp.ml
ocaml
********************************************************************** ********************************************************************** * Given an ID that came from the server, we have to wrap it when we pass it on to the client, to encode which instance of the server it came from. That way, if a response com...
* 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...
7792aa5ccf950a8bfe5a35a8841f4b9790cfb216a96bb2a9502fa496a55c4eba
derniercri/erl-test-runner
travis_runner.erl
2015 %% @version 1.0.0 @title A small travis bootstrapper for Erlang without REBAR -module(travis_runner). -vsn(1). -author(["Arthur d'Azémar", "Xavier van De Woestyne"]). -export([run/0]). %% Execute test for a gived module %% Raise an exception if the test fail check_test(Module) -> io:format("===========...
null
https://raw.githubusercontent.com/derniercri/erl-test-runner/0256b7c1cd26fd7a0dadc68834f490754ee4f70c/src/travis_runner.erl
erlang
@version 1.0.0 Execute test for a gived module Raise an exception if the test fail Entry point
2015 @title A small travis bootstrapper for Erlang without REBAR -module(travis_runner). -vsn(1). -author(["Arthur d'Azémar", "Xavier van De Woestyne"]). -export([run/0]). check_test(Module) -> io:format("===============~nTesting module : ~s~n===============~n", [Module]), case eunit:test(Module) of ...
79c16b756315b7312f2be1d3e4b385ddc076d8400ce77a7bd8315a4543913f71
DalekBaldwin/on-lisp
chapter-18.lisp
(in-package :on-lisp.18) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Chapter 18 - Destructuring (defmacro dbind (pat seq &body body) (let ((gseq (gensym))) `(let ((,gseq ,seq)) ,(dbind-ex (destruc pat gseq #'atom) body)))) (eval-when (:compile-toplevel :load-toplevel :execute) (defun destruc (pat seq &optional ...
null
https://raw.githubusercontent.com/DalekBaldwin/on-lisp/b13e8b6e956bef45c4fd7194a062c27555268048/src/chapter-18.lisp
lisp
missing in text
(in-package :on-lisp.18) Chapter 18 - Destructuring (defmacro dbind (pat seq &body body) (let ((gseq (gensym))) `(let ((,gseq ,seq)) ,(dbind-ex (destruc pat gseq #'atom) body)))) (eval-when (:compile-toplevel :load-toplevel :execute) (defun destruc (pat seq &optional (atom? #'atom) (n 0)) (if (n...
313d18dce0fa847d33a863ccec23aea038e41e5d51bcbd26dfa1cedc778b2f08
drathier/elm-offline
Paths.hs
# OPTIONS_GHC -Wall # module Stuff.Paths ( docs , summary , prepublishDir , removeStuff , elmi , elmo , moduleDocs , temp ) where import Control.Monad.Trans (liftIO) import qualified System.Directory as Dir import System.FilePath ((</>), (<.>)) import qualified Elm.Compiler as Compiler import qua...
null
https://raw.githubusercontent.com/drathier/elm-offline/f562198cac29f4cda15b69fde7e66edde89b34fa/builder/src/Stuff/Paths.hs
haskell
PATHS REMOVE STUFF TEMP
# OPTIONS_GHC -Wall # module Stuff.Paths ( docs , summary , prepublishDir , removeStuff , elmi , elmo , moduleDocs , temp ) where import Control.Monad.Trans (liftIO) import qualified System.Directory as Dir import System.FilePath ((</>), (<.>)) import qualified Elm.Compiler as Compiler import qua...
3f6de21d54ea9fd2ba3bb73e80558405906969e2bf849db3c5bfc1996a957f65
mokus0/junkbox
DataSet.hs
# LANGUAGE GeneralizedNewtypeDeriving , GADTs # module Experiments.DataSet where -- basic idea: -- A "persistent data set" is an environment in which persistent -- references can be managed. Those references are mutable and persistent, -- though in this sketch the storage subsystem is not necessarily very -- reli...
null
https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Experiments/DataSet.hs
haskell
basic idea: A "persistent data set" is an environment in which persistent references can be managed. Those references are mutable and persistent, though in this sketch the storage subsystem is not necessarily very reliable (if the program crashes, it may enter an inconsistent state), This is a very rough out...
# LANGUAGE GeneralizedNewtypeDeriving , GADTs # module Experiments.DataSet where nor does it support more than one open instance of a data set . of the store in a multiprocess - friendly way , but also providing algorithms for handling the data in the store . Mutexes or a transaction * one piece of ...
ebcd3c6f1e81591e02708a29ee4507a8c4222f64247a892f96bd84ed330cd126
aeternity/eblake2
eblake2_tests.erl
%%%============================================================================= ( C ) 2019 , %%% @doc Unit tests for the module %%% %%% @end %%%============================================================================= -module(eblake2_tests). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). blake2...
null
https://raw.githubusercontent.com/aeternity/eblake2/60a079f00d72d1bfcc25de8e6996d28f912db3fd/test/eblake2_tests.erl
erlang
============================================================================= @doc @end ============================================================================= Benchmark Blake2b against enacl. Helper functions
( C ) 2019 , Unit tests for the module -module(eblake2_tests). -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). blake2b_test_() -> {"Tests for BLAKE2b hash implementation", [ fun() -> blake2b(TC) end || TC <- filter_test_vectors(<<"blake2b">>) ]}. blake2b(_TC = #{in := Msg, key := Key, out :...
58322c43f244d5b12fd6cb26e5b17a2aec382f889b0724aeb653d95876540eaa
jrh13/hol-light
counterexample.ml
(******************************************************************************) (* FILE : counterexample.ml *) (* DESCRIPTION : Simple counterexample checker *) Based on ideas and suggestions from (* ...
null
https://raw.githubusercontent.com/jrh13/hol-light/ea44a4cacd238d7fa5a397f043f3e3321eb66543/Boyer_Moore/counterexample.ml
ocaml
**************************************************************************** FILE : counterexample.ml DESCRIPTION : Simple counterexample checker READS FILES...
Based on ideas and suggestions from AUTHOR : P. Papapanagiotou ( University of Edinburgh ) DATE : July 2009 let counter_check_num = ref 500;; let counter_checks t = counter_check_num := t;; ...
9b757cdbbf02e79a024ad2ca26f541ab8b08dd3d369aca4ec2cc7611caec0b6d
let-def/ttx
print_utils.ml
open Cmon let option f = function | None -> construct "None" [] | Some x -> construct "Some" [f x] let pair fx fy (x, y) = tuple [fx x; fy y] let tup3 f1 f2 f3 (v1, v2, v3) = tuple [f1 v1; f2 v2; f3 v3] let tup4 f1 f2 f3 f4 (v1, v2, v3, v4) = tuple [f1 v1; f2 v2; f3 v3; f4 v4] let cmon_ref f {contents} = ...
null
https://raw.githubusercontent.com/let-def/ttx/0a50ba7253056d1202f108b67faf4d9cc78e020d/lib/types_printer/print_utils.ml
ocaml
open Cmon let option f = function | None -> construct "None" [] | Some x -> construct "Some" [f x] let pair fx fy (x, y) = tuple [fx x; fy y] let tup3 f1 f2 f3 (v1, v2, v3) = tuple [f1 v1; f2 v2; f3 v3] let tup4 f1 f2 f3 f4 (v1, v2, v3, v4) = tuple [f1 v1; f2 v2; f3 v3; f4 v4] let cmon_ref f {contents} = ...
1586d6c7a800a975112303e9c4c384b4a5d60a88f03981c648690999585ee897
nklein/grid-generators
cuboid.lisp
(in-package #:grid-generators-tests) (nst:def-test-group 1d-grid-generator-tests () (nst:def-test 1d-grid (generates ((1) (4) (7))) (grid-generators:make-grid-generator '(7) :from '(1) :by '(3))) (nst:def-test 1d-grid-default-by (generates ((1) (2) (3))) (grid-generators:make-grid-generator '(3) :from...
null
https://raw.githubusercontent.com/nklein/grid-generators/5f7b790c339123f84710d907ddafdb52c160d44e/test/cuboid.lisp
lisp
(in-package #:grid-generators-tests) (nst:def-test-group 1d-grid-generator-tests () (nst:def-test 1d-grid (generates ((1) (4) (7))) (grid-generators:make-grid-generator '(7) :from '(1) :by '(3))) (nst:def-test 1d-grid-default-by (generates ((1) (2) (3))) (grid-generators:make-grid-generator '(3) :from...
d1710743e04a73145e89ea53d5d24d3ee33b40169bea8a09be71f98658e83256
AccelerateHS/accelerate-examples
ZipWith.hs
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # {-# LANGUAGE TypeOperators #-} module Test.Prelude.ZipWith ( test_zipWith ) where import Prelude as P import Data.B...
null
https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/nofib/Test/Prelude/ZipWith.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE FlexibleContexts # # LANGUAGE RankNTypes # # LANGUAGE TypeOperators # ------------------------------------------------------------------- relational and equality operators relational and equality operators Reference Implementation ---------------------...
# LANGUAGE ScopedTypeVariables # module Test.Prelude.ZipWith ( test_zipWith ) where import Prelude as P import Data.Bits as P import Data.Label import Data.Maybe import Data.Typeable import Test.QuickCheck ...
c3d329d609826488428d9b5f8e0d1149dd3b94b054545c1da8edcffaa732b94f
mzp/coq-ruby
dischargedhypsmap.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/library/dischargedhypsmap.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** i i s Discharged hypothesis. Here we...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * i $ I d : dischargedhypsmap...
b61428c6fc33e735678aa87ef9cbb80158ec6e7bde719f9c1c68a7551014a4cd
ocaml-sf/learn-ocaml-corpus
sat_always_sat.ml
(* ------------------------------------------------------------------------------ *) (* Building formulae. *) let var x = FVar x let falsity = FConst false let truth = FConst true let const sense = if sense then truth else falsity (* [FConst sense] would work too, but would allocate memory *) let neg ...
null
https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/sat/wrong/sat_always_sat.ml
ocaml
------------------------------------------------------------------------------ Building formulae. [FConst sense] would work too, but would allocate memory ------------------------------------------------------------------------------ Evaluating formulae. We assume [n < Sys.word_size - 1]. -----------------...
let var x = FVar x let falsity = FConst false let truth = FConst true let const sense = if sense then truth else falsity let neg f = match f with | FConst sense -> const (not sense) | FNeg f -> f | _ -> FNeg f let conn sense f1 f2 = match f1, f2 with | FConst sense', f | f...
7897ec9ad9987bd22b3729bae618e8b3fddf52d427f2b8ba28bdfe2466aaed65
opencog/learn
marginals-mst.scm
#! /usr/bin/env -S guile !# ; ; marginals-mst.scm ; ; After disjunct counting has been completed, this script is run to ; compute marginal statistics. This computes assorted totals and ; conditional probabilities needed before disjunct clustering can be ; done. ; (load "cogserver.scm") Init the statistics objects . ...
null
https://raw.githubusercontent.com/opencog/learn/fb038fd29848bee57ebb1c80ad3f8310ac7f3075/attic/run-v3/run-common/marginals-mst.scm
scheme
marginals-mst.scm After disjunct counting has been completed, this script is run to compute marginal statistics. This computes assorted totals and conditional probabilities needed before disjunct clustering can be done. Compute the matrix-transpose marginals. As a side-effect, this will also compute the suppo...
#! /usr/bin/env -S guile !# (load "cogserver.scm") Init the statistics objects . (define pca (make-pseudo-cset-api)) (define psa (add-pair-stars pca)) (define btr (batch-transpose psa)) Load up the disjuncts -- this can take over half an hour ! (display "Fetch all disjuncts. This may take well over half-an-hour!\...
c27837b29a0fe4177fc0107086950bb9a16694da524e097aef0ce456cd9e0e32
lblod/app-gelinkt-notuleren
generic-model-plugin-domain.lisp
(define-resource rdfs-class () :class (s-prefix "rdfs:Class") :properties `((:label :string ,(s-prefix "rdfs:label")) (:description :string ,(s-prefix "rdfs:comment")) (:api-path :string ,(s-prefix "ext:apiPath")) (:display-properties :string ,(s-prefix "ext:displayPr...
null
https://raw.githubusercontent.com/lblod/app-gelinkt-notuleren/f3b160e22bb63b239a728a2477c34411057f8d41/config/resources/generic-model-plugin-domain.lisp
lisp
(define-resource rdfs-class () :class (s-prefix "rdfs:Class") :properties `((:label :string ,(s-prefix "rdfs:label")) (:description :string ,(s-prefix "rdfs:comment")) (:api-path :string ,(s-prefix "ext:apiPath")) (:display-properties :string ,(s-prefix "ext:displayPr...
827c2a929cd8664c6a5156be4ee64ddc1e553a2c423d85f6d6f2888fd94616b6
diagrams/diagrams-contrib
Logo.hs
# LANGUAGE NoMonomorphismRestriction # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # # OPTIONS_GHC -fno - warn - missing - signatures # ----------------------------------------------------------------------------- -- | -- Module : Diagrams.Example.Logo Copyright : ...
null
https://raw.githubusercontent.com/diagrams/diagrams-contrib/63f2aec4c070d1f558a5fcefd67b5315d64faaf5/src/Diagrams/Example/Logo.hs
haskell
--------------------------------------------------------------------------- | Module : Diagrams.Example.Logo License : BSD-style (see LICENSE) Maintainer : Source code for creating the diagrams logo. <<diagrams/src_Diagrams_Example_Logo_diaLogo.svg#diagram=diaLogo&height=100>> -------------------...
# LANGUAGE NoMonomorphismRestriction # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # # OPTIONS_GHC -fno - warn - missing - signatures # Copyright : ( c ) 2011 module Diagrams.Example.Logo where > = logo import Diagrams.Prelude import Diagram...
2e21b7a256b4fad58a61ff6278c77eeeadc685f89f0d25c82bbf2f410f39bd9b
drcode/EconIsle
engine_test.clj
(ns elon-tusk.engine-test (:require [elon-tusk.engine :refer :all] [fbc-utils.test :as te])) (te/test (calc-affordability [{:owned 0 :price 4} {:owned 5 :price 2} {:owned 5 ...
null
https://raw.githubusercontent.com/drcode/EconIsle/c84fd2182662c47d5a8b628b033c0757fcea3b56/src/elon_tusk/engine_test.clj
clojure
(ns elon-tusk.engine-test (:require [elon-tusk.engine :refer :all] [fbc-utils.test :as te])) (te/test (calc-affordability [{:owned 0 :price 4} {:owned 5 :price 2} {:owned 5 ...
bd3b5886fc62aa77a93dafa7c5cdc1ecaa654d61be00bdd7007f86ebd70b2258
lambdam/mook
core.cljs
(ns mook.core (:require [clojure.spec.alpha :as s] [mook.react :as mr] [promesa.core :as p]) (:require-macros [mook.core :refer [dev-print!]])) (defprotocol Watchable (listen! [this key f]) (unlisten! [this key])) (extend-type Atom Watchable (listen! [this key f] (add-watch thi...
null
https://raw.githubusercontent.com/lambdam/mook/273318c38b28fe894c16365973032a52e472eb86/src/mook/core.cljs
clojure
Commands and state stores Store Handle declarative state transitions Always set the latest version of the states --- Hooks Fire a re-render ---
(ns mook.core (:require [clojure.spec.alpha :as s] [mook.react :as mr] [promesa.core :as p]) (:require-macros [mook.core :refer [dev-print!]])) (defprotocol Watchable (listen! [this key f]) (unlisten! [this key])) (extend-type Atom Watchable (listen! [this key f] (add-watch thi...
d8752fb6f5b5e039cd803969af6a0890b45700d00509e4f6f435aa60019af05a
yetanalytics/re-thread
core.cljs
(ns todomvc-worker.core (:require-macros [secretary.core :refer [defroute]]) (:require [re-thread.client :refer [init dispatch]] [goog.events :as events] [reagent.core :as reagent] [secretary.core :as secretary] [devtools.core :as devtools] [todomvc-worker...
null
https://raw.githubusercontent.com/yetanalytics/re-thread/5fb40224d809d82ba5011fefee34b95f22d72454/examples/todomvc-worker/src/todomvc_worker/core.cljs
clojure
-- Debugging aids ---------------------------------------------------------- we love -devtools so println writes to console.log -- Worker Bootstrap -------------------------------------------------------- -- Routes and History ------------------------------------------------------ -- Entry Point -----------------...
(ns todomvc-worker.core (:require-macros [secretary.core :refer [defroute]]) (:require [re-thread.client :refer [init dispatch]] [goog.events :as events] [reagent.core :as reagent] [secretary.core :as secretary] [devtools.core :as devtools] [todomvc-worker...
c32e6fbfa2f473bc7f21fe9223916eee292346cce95e67e0c9b609fe09cd882d
avsm/platform
html_types.mli
TyXML * * Copyright ( C ) 2010 by * Copyright ( C ) 2010 by ( C ) 2010 by * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; ...
null
https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/tyxml.4.3.0/lib/html_types.mli
ocaml
* {1 Attribute types.} * Character data * A document-unique identifier * A reference to a document-unique identifier * A space-separated list of references to document-unique identifiers * A name with the same character constraints as ID above * A character encoding, as per RFC2045 (MIME). @see <> RFC2045...
TyXML * * Copyright ( C ) 2010 by * Copyright ( C ) 2010 by ( C ) 2010 by * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; ...
10241b1b013826acd666383bb59a1dc47e60953e1e2d109cc4c693d317f6ab48
glebec/haskell-programming-allen-moronuki
Ex26_05.hs
# LANGUAGE InstanceSigs # module Ex26_05 where newtype StateT s m a = StateT { runStateT :: s -> m (a,s) } 1 . instance Functor m => Functor (StateT s m) where fmap :: (a -> b) -> StateT s m a -> StateT s m b fmap f (StateT s2Mas) = StateT $ fmap (\(a, s') -> (f a, s')) . s2Mas 2 . -- Surprisingly, we...
null
https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/26-monad-transformers/Ex26_05.hs
haskell
Surprisingly, we need the monad constraint for applicative. See -it-possible-to-implement-applicative-m-applicative-statet-s-m
# LANGUAGE InstanceSigs # module Ex26_05 where newtype StateT s m a = StateT { runStateT :: s -> m (a,s) } 1 . instance Functor m => Functor (StateT s m) where fmap :: (a -> b) -> StateT s m a -> StateT s m b fmap f (StateT s2Mas) = StateT $ fmap (\(a, s') -> (f a, s')) . s2Mas 2 . and instance Mon...
3ac6baffb3f603bcba57d0a825250f2d4a003efbaf0927c739562ca0a791d602
webyrd/n-grams-for-synthesis
test-generic-arithmetic.scm
; This file is part of the reference implementation of the R6RS Arithmetic SRFI. ; See file COPYING. ; Tests for R5RS-style generic arithmetic (define (n-r5rs= a b) (= a (r5rs->number b))) (check (numerical complex? 3+4i) => #t) (check (numerical complex? 3) => #t) (check (numerical real? 3) => #t) (check (real...
null
https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-77/arithmetic-reference/test-generic-arithmetic.scm
scheme
This file is part of the reference implementation of the R6RS Arithmetic SRFI. See file COPYING. Tests for R5RS-style generic arithmetic
(define (n-r5rs= a b) (= a (r5rs->number b))) (check (numerical complex? 3+4i) => #t) (check (numerical complex? 3) => #t) (check (numerical real? 3) => #t) (check (real? (numerical make-rectangular -2.5 0.0)) => #f) (check (real? (numerical make-rectangular -2.5 0)) => #t) (check (numerical real? -2.5) => #...
c9167377d90f59d5c2237177a6129d4085b908696c9a882e10f38207a501a052
logicmoo/wam_common_lisp
load.lsp
(load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl/reference/ecl-OLD/src/lsp/export.lsp" :verbose t) (load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl/reference/ecl-OLD/src/lsp/defmacro.lsp" :verbose t) (load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common...
null
https://raw.githubusercontent.com/logicmoo/wam_common_lisp/4396d9e26b050f68182d65c9a2d5a939557616dd/prolog/wam_cl/src/lsp/load.lsp
lisp
(load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl/reference/ecl-OLD/src/lsp/export.lsp" :verbose t) (load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common_lisp/prolog/wam_cl/reference/ecl-OLD/src/lsp/defmacro.lsp" :verbose t) (load "/home/dmiles/logicmoo_workspace/packs_usr/wam_common...
1fb854c1be2c3b75b8818cb7ecaa34629beec474e555b7f63d7c22b84c0b44cf
timothypratley/vone
version_one_request.clj
(ns vone.version-one-request (:require [vone.helpers :refer :all] [vone.config :refer :all] [clj-http.lite.client :as client] [clojure.xml :as xml] [ring.util.codec :as codec] [noir.session :as session])) TODO : with - connection - pool from clj - http mig...
null
https://raw.githubusercontent.com/timothypratley/vone/b026f7000dda752f0090a1203b53706a583749fe/src/vone/version_one_request.clj
clojure
key-value pairs ... but do want to log other errors
(ns vone.version-one-request (:require [vone.helpers :refer :all] [vone.config :refer :all] [clj-http.lite.client :as client] [clojure.xml :as xml] [ring.util.codec :as codec] [noir.session :as session])) TODO : with - connection - pool from clj - http mig...
62bd84cf38f21c6dc25d3d1cf0eabd46fc391748fa4ff68776a3604d869d0bf0
gethop-dev/hop-cli
keycloak.clj
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this ;; file, You can obtain one at / (ns hop-cli.bootstrap.profile.registry.authentication.keycloak (:require [hop-cli.bootstrap.profile.registry :as registry] [hop-cl...
null
https://raw.githubusercontent.com/gethop-dev/hop-cli/0b3240371fd2b7fbedf29d7420ce860619cc4f24/src/hop_cli/bootstrap/profile/registry/authentication/keycloak.clj
clojure
file, You can obtain one at / Application related environment variables
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this (ns hop-cli.bootstrap.profile.registry.authentication.keycloak (:require [hop-cli.bootstrap.profile.registry :as registry] [hop-cli.bootstrap.util :as bp.util] ...
601faa41e7f66b6a703953946bc94d794a684e096caae80b39c1360ca80d876a
autolwe/autolwe
NormUtils.ml
(* * Non-core functions for normal form *) (* ** Imports *) open Expr open ExprUtils open Norm open Type (* ** Remove tuple projections * ----------------------------------------------------------------------- *) let rm_tuple_proj e es = match es with | e1::es -> begin try let i, e2 = destr_P...
null
https://raw.githubusercontent.com/autolwe/autolwe/3452c3dae06fc8e9815d94133fdeb8f3b8315f32/src/Derived/NormUtils.ml
ocaml
* Non-core functions for normal form ** Imports ** Remove tuple projections * ----------------------------------------------------------------------- ** Abbreviate g^1 = g and g^log(A) = A * -----------------------------------------------------------------------
open Expr open ExprUtils open Norm open Type let rm_tuple_proj e es = match es with | e1::es -> begin try let i, e2 = destr_Proj e1 in if i <> 0 then raise Not_found; if List.length es + 1 <> List.length (destr_Prod_exn e2.e_ty) then raise Not_found; List.iter...
03a8b0cbe808ce9a1081093fbdf5e380efdb4a0485ec20d0b84243f85f911c70
oshyshko/adventofcode
TestD18.hs
module Y15.TestD18 where import qualified Data.Vector.Unboxed.Mutable as VUM import Test.Hspec import Geom.XY import Imports import MVec2 import Parser import qualified Vec2 as V import Y15.D18 mkLights :: PrimMonad m => [[Bool]] -> m...
null
https://raw.githubusercontent.com/oshyshko/adventofcode/95b6bb4d514cf02680ba1a62de5a5dca2bf9e92d/test/Y15/TestD18.hs
haskell
initial state initial state
module Y15.TestD18 where import qualified Data.Vector.Unboxed.Mutable as VUM import Test.Hspec import Geom.XY import Imports import MVec2 import Parser import qualified Vec2 as V import Y15.D18 mkLights :: PrimMonad m => [[Bool]] -> m...
67837cc5313be0661e5a2b840de69478a363fd01c082cff7cd17e09ed94ff1cd
ktahar/ocaml-lp
lp.mli
(** top module of package {!module:Lp} *) module Var = Var module Term = Term module Poly = Poly module Cnstr = Cnstr module Objective = Objective module Problem = Problem (** Module for the optimization problem class. *) module Pclass = Problem.Pclass (** Map with Poly.t key. It can be used to pack optimization res...
null
https://raw.githubusercontent.com/ktahar/ocaml-lp/2ee56e7994f46a97536e11c27456663d930e1579/src/lp/lp.mli
ocaml
* top module of package {!module:Lp} * Module for the optimization problem class. * Map with Poly.t key. It can be used to pack optimization result. polynomial builders and operators * Make monomial of a constant value. * Make monomial of a variable. You can optionally set its bounds ([lb] and [ub]) and wheth...
module Var = Var module Term = Term module Poly = Poly module Cnstr = Cnstr module Objective = Objective module Problem = Problem module Pclass = Problem.Pclass module PMap : Map.S with type key = Poly.t val c : float -> Poly.t val var : ?integer:bool -> ?lb:float -> ?ub:float -> string -> Poly.t val binary : st...
e9ca53f8be930097f807be22a433069527890e843e7ca779a35bb6cfa131aa69
imandra-ai/ocaml-opentelemetry
trace_service_pb.mli
(** trace_service.proto Binary Encoding *) * { 2 Protobuf Encoding } val encode_export_trace_service_request : Trace_service_types.export_trace_service_request -> Pbrt.Encoder.t -> unit (** [encode_export_trace_service_request v encoder] encodes [v] with the given [encoder] *) val encode_export_trace_partial_succes...
null
https://raw.githubusercontent.com/imandra-ai/ocaml-opentelemetry/3dc7d63c7d2c345ba13e50b67b56aff878b6d0bb/src/trace_service_pb.mli
ocaml
* trace_service.proto Binary Encoding * [encode_export_trace_service_request v encoder] encodes [v] with the given [encoder] * [encode_export_trace_partial_success v encoder] encodes [v] with the given [encoder] * [encode_export_trace_service_response v encoder] encodes [v] with the given [encoder] * [decode_export...
* { 2 Protobuf Encoding } val encode_export_trace_service_request : Trace_service_types.export_trace_service_request -> Pbrt.Encoder.t -> unit val encode_export_trace_partial_success : Trace_service_types.export_trace_partial_success -> Pbrt.Encoder.t -> unit val encode_export_trace_service_response : Trace_servic...
fc11998fa114440e24b57929e70a1b4d7bbc086c305eb92503af96dfe0839ee6
dmitryvk/sbcl-win32-threads
clocc-ansi-test-known-bugs.lisp
;;;; Set up *BUGID->KNOWNP* for clocc-ansi.test.sh. This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; While most of SBCL is derived from the CMU CL system , the test ;;;; files (like this one) were written from scratch after the fork from CMU CL . ;;;; ;;;; This softw...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/tests/clocc-ansi-test-known-bugs.lisp
lisp
Set up *BUGID->KNOWNP* for clocc-ansi.test.sh. more information. files (like this one) were written from scratch after the fork This software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. bugs, bugs, bugs FIXME: several metaproblem...
This software is part of the SBCL system . See the README file for While most of SBCL is derived from the CMU CL system , the test from CMU CL . (in-package :cl-user) (defvar *bugid->knownp* (make-hash-table)) (map nil (lambda (bugid) (setf (gethash bugid *bugid->knownp*) t)) use...
d1796f1caf454f0d7c8cf1fc29f771b0cc62a5122431b6549f71057bf8390f91
gildor478/ounit
testRunner.ml
(**************************************************************************) The OUnit library (* *) Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman . Copyright...
null
https://raw.githubusercontent.com/gildor478/ounit/faf4936b17507406c7592186dcaa3f25c6fc138a/test/libtest/testRunner.ml
ocaml
************************************************************************ Permission is hereby grante...
The OUnit library Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman . Copyright ( C ) 2010 OCamlCore SARL Copyright ( C ) 2013 The package OUnit is cop...
94e775fbd41f5f0a55e9aca1fa25f45f10bcffcc5bbf351dda41514a5077eed0
mario-goulart/spock
sections.scm
;;;; sections.scm - section handling for internal xref database ;; this must be portable syntax-rules, since it runs in the ;; host implementation (define-syntax define-library-section (syntax-rules (default strict depends define define-syntax define-inline) ((_ "walk" sec ()) (void)) ((_ "walk" sec ...
null
https://raw.githubusercontent.com/mario-goulart/spock/b88f08f8bc689babc433ad8288559ce5c28c52d5/sections.scm
scheme
sections.scm - section handling for internal xref database this must be portable syntax-rules, since it runs in the host implementation
(define-syntax define-library-section (syntax-rules (default strict depends define define-syntax define-inline) ((_ "walk" sec ()) (void)) ((_ "walk" sec ((default def ...) . more)) (begin (define-library-section "walk-defs" sec (def ...)) (define-library-section "walk" sec more)))...
4ef58c921021f6fba2823ec0872a5d0763efe4f8b33ec15e704622efa66e8840
Psi-Prod/Mehari
vhost.ml
let router = Mehari_eio.virtual_hosts [ ("localhost.foo", fun _ -> Mehari.response_text "Requesting subdomain foo"); ("localhost.bar", fun _ -> Mehari.response_text "Requesting subdomain bar"); ] let main ~net ~cwd = let certchains = Eio.Path. [ X509_eio.private_of_pems ~cert:...
null
https://raw.githubusercontent.com/Psi-Prod/Mehari/e57202510dd43fa1ce75695cf1ab8f8caa49f0f0/examples/vhost.ml
ocaml
let router = Mehari_eio.virtual_hosts [ ("localhost.foo", fun _ -> Mehari.response_text "Requesting subdomain foo"); ("localhost.bar", fun _ -> Mehari.response_text "Requesting subdomain bar"); ] let main ~net ~cwd = let certchains = Eio.Path. [ X509_eio.private_of_pems ~cert:...
5ff80bd7156dfac7e56628d00da65b0b5d3bd2a88ece8a31893b8c8d8afbb382
ekataglobal/github-changelog
core_spec.clj
(ns github-changelog.core-spec (:require [clojure.spec.alpha :as s] [github-changelog.git :as git] [github-changelog.github :as github] [github-changelog.semver :as semver])) (s/def ::commits (s/* ::git/commit)) (s/def ::tag (s/merge ::git/tag (s/keys :req-un [::semver/version ...
null
https://raw.githubusercontent.com/ekataglobal/github-changelog/29dcaab03407c69584549a79ed449bdddebc1e16/src/github_changelog/core_spec.clj
clojure
(ns github-changelog.core-spec (:require [clojure.spec.alpha :as s] [github-changelog.git :as git] [github-changelog.github :as github] [github-changelog.semver :as semver])) (s/def ::commits (s/* ::git/commit)) (s/def ::tag (s/merge ::git/tag (s/keys :req-un [::semver/version ...
6dd94420251f4207fa234f66cfe1161c0de5973dbfaa12810affabc1744a75b9
borodust/trivial-gamekit
bodge.lisp
(cl:defpackage :trivial-gamekit.documentation (:nicknames :gamekit.documentation) (:use :cl :gamekit :gamekit.distribution :trivial-docstring) (:export render-documentation)) (cl:in-package :trivial-gamekit.documentation) #| (docstring #' " Example: ```common-lisp ```") |# (docstring #'vec2 "Makes a two-di...
null
https://raw.githubusercontent.com/borodust/trivial-gamekit/17e4be8ff69e711346dddda0680677ca5bafc61b/docs/bodge.lisp
lisp
(docstring #' " Example: ```common-lisp ```")
(cl:defpackage :trivial-gamekit.documentation (:nicknames :gamekit.documentation) (:use :cl :gamekit :gamekit.distribution :trivial-docstring) (:export render-documentation)) (cl:in-package :trivial-gamekit.documentation) (docstring #'vec2 "Makes a two-dimensional vector. Example: ```common-lisp (gamekit:ve...
0b20ddef732f95d61740e9449e7bb4bf88858e540f941530ce5e61ae04db60ff
metosin/compojure-api
handler.clj
(ns example.handler (:require [compojure.api.sweet :refer :all] [ring.util.http-response :refer :all] [metrics.ring.instrument :refer [instrument]] [metrics.core :refer [default-registry]] [metrics.ring.expose :refer [render-metrics]] [schema.core :as s])) ...
null
https://raw.githubusercontent.com/metosin/compojure-api/5c88f32fe56cdb6fcdb3cc506bb956943fcd8c17/examples/metrics-ring/src/example/handler.clj
clojure
(ns example.handler (:require [compojure.api.sweet :refer :all] [ring.util.http-response :refer :all] [metrics.ring.instrument :refer [instrument]] [metrics.core :refer [default-registry]] [metrics.ring.expose :refer [render-metrics]] [schema.core :as s])) ...
4f983706d3ffa6125682fe66118ee58d7f9f504130b35efcfbe0e7ba93720c86
mejgun/haskell-tdlib
TestUseUpdate.hs
{-# LANGUAGE OverloadedStrings #-} -- | module TD.Query.TestUseUpdate where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified Utils as U -- | -- Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorizat...
null
https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/TestUseUpdate.hs
haskell
# LANGUAGE OverloadedStrings # | | Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
module TD.Query.TestUseUpdate where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified Utils as U data TestUseUpdate = TestUseUpdate { } deriving (Eq) instance Show TestUseUpdate where show TestUseUpdate = "TestUseUpdate" ++ U.cc [] instance T.ToJSON ...
562878c88ee38f55c3e584819327dcc352e0933b6fa19a46c8920d4c4567cc80
emil0r/ez-database
queries.clj
(ns ez-database.test.queries (:require [ez-database.core :as db] [ez-database.test.core :refer [reset-db! db-spec db-spec-2]] [midje.sweet :refer :all] [yesql.core :refer [defqueries]])) (defqueries "queries/test.sql") (fact "queries" (let [db (db/map->EzDatabase {:db-specs {:d...
null
https://raw.githubusercontent.com/emil0r/ez-database/eb269f411a18c8a4e90761e8ca0c7210a8851057/test/ez_database/test/queries.clj
clojure
(ns ez-database.test.queries (:require [ez-database.core :as db] [ez-database.test.core :refer [reset-db! db-spec db-spec-2]] [midje.sweet :refer :all] [yesql.core :refer [defqueries]])) (defqueries "queries/test.sql") (fact "queries" (let [db (db/map->EzDatabase {:db-specs {:d...
7e58f1d9a24a335ed8eda426cad9be7bbfe41497bb7ba3a31def508d37a1b174
alsonkemp/turbinado
PostgreSQL.hs
module Turbinado.Database.ORM.Adapters.PostgreSQL where import Data.List import Database.HDBC import Turbinado.Database.ORM.Types import qualified Turbinado.Database.ORM.Adapters.Types as T ormAdapter = T.baseAdapter { T.getPrimaryKeys = getPrimaryKeys, T.getForeignKeyReferences = getFo...
null
https://raw.githubusercontent.com/alsonkemp/turbinado/da2ba7c3443ddf6a51d1ec5b05cb45a85efc0809/Turbinado/Database/ORM/Adapters/PostgreSQL.hs
haskell
* Functions for extracting information from the database
module Turbinado.Database.ORM.Adapters.PostgreSQL where import Data.List import Database.HDBC import Turbinado.Database.ORM.Types import qualified Turbinado.Database.ORM.Adapters.Types as T ormAdapter = T.baseAdapter { T.getPrimaryKeys = getPrimaryKeys, T.getForeignKeyReferences = getFo...
f2a1a08ecf5d741cc0ec0ebe4a78b4c6804b0913e90deff72a779f9757003712
nd/bird
4.5.5.hs
remdups :: (Eq a) => [a] -> [a] remdups xs = foldr f [] xs where f x [] = [x] f x (y:ys) = if x == y then y:ys else x:y:ys remdups' xs = foldl f [] xs where f [] x = [x] f xs x = if (last xs) == x then xs else xs ++ [x]
null
https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch04/4.5.5.hs
haskell
remdups :: (Eq a) => [a] -> [a] remdups xs = foldr f [] xs where f x [] = [x] f x (y:ys) = if x == y then y:ys else x:y:ys remdups' xs = foldl f [] xs where f [] x = [x] f xs x = if (last xs) == x then xs else xs ++ [x]
03d3380f92f8e215ef106ed8d23dfd28f0d9f7c59a0fa6fbeb14297c69ac667c
webnf/webnf
test_util.clj
(ns webnf.test-util (:require [webnf.base :refer [autoload autoload-some forcat]] [clojure.test :refer [assert-expr report]] [clojure.core.unify :refer [unify]])) clojure.test/is extensions ( submap ? super sub ) form useable as a predicate in test - is . ; C...
null
https://raw.githubusercontent.com/webnf/webnf/6a2ccaa755e6e40528eb13a5c36bae16ba4947e7/base/src/webnf/test_util.clj
clojure
Checks for every entry in sub whether its value is equal. ## Mock requests
(ns webnf.test-util (:require [webnf.base :refer [autoload autoload-some forcat]] [clojure.test :refer [assert-expr report]] [clojure.core.unify :refer [unify]])) clojure.test/is extensions ( submap ? super sub ) form useable as a predicate in test - is . (defmethod assert-expr 'submap? [msg form]...
6b2e8d6e44de2fabaf93a5a90d471903b9cbf121eaf961f5d5189ab1293a7d11
mbutterick/typesetting
reference.rkt
#lang debug racket/base (require "core.rkt" "object.rkt" fontland/zlib) (provide (all-defined-out)) (define ref-listeners null) (define (register-ref-listener proc) (set! ref-listeners (cons proc ref-listeners))) (define current-id 0) (define (set-current-ref-id! val) (set! current-id val)) (de...
null
https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/pitfall/pitfall/reference.rkt
racket
#lang debug racket/base (require "core.rkt" "object.rkt" fontland/zlib) (provide (all-defined-out)) (define ref-listeners null) (define (register-ref-listener proc) (set! ref-listeners (cons proc ref-listeners))) (define current-id 0) (define (set-current-ref-id! val) (set! current-id val)) (de...
6f43dd4d15cfd807f186ce7f09da2af1cb8d21407622274e913f7ce3b72cad14
tsloughter/kuberl
kuberl_v1_config_map_key_selector.erl
-module(kuberl_v1_config_map_key_selector). -export([encode/1]). -export_type([kuberl_v1_config_map_key_selector/0]). -type kuberl_v1_config_map_key_selector() :: #{ 'key' := binary(), 'name' => binary(), 'optional' => boolean() }. encode(#{ 'key' := Key, 'name' := Name, '...
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_config_map_key_selector.erl
erlang
-module(kuberl_v1_config_map_key_selector). -export([encode/1]). -export_type([kuberl_v1_config_map_key_selector/0]). -type kuberl_v1_config_map_key_selector() :: #{ 'key' := binary(), 'name' => binary(), 'optional' => boolean() }. encode(#{ 'key' := Key, 'name' := Name, '...
5bd69a178b626cb2fd5e39201d98f8382efccec4e406bfcdfa92111bed8c686f
c4-project/c4f
my_format.mli
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
null
https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/utils/src/my_format.mli
ocaml
* Miscellaneous formatting utilities. * [null_formatter ()] is a formatter that silently discards anything printed to it. * [pp_c_braces pi f i] wraps a vertical pretty-printer [pi] inside a C-style brace pair. * [pp_set pp_elem] pretty-prints prints a set, using {!pp_elem} as the element printer. * [pp...
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
4cb863bd9b8f9c472c9c16a9d7f34dc5e7a2bfa6f1db4ba36525711cbb4beb41
reborg/clojure-essential-reference
3.clj
< 1 > < 2 > ;; evaluated 1
null
https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/SequentialGeneration/OtherGenerators/lazy-seq/3.clj
clojure
evaluated
< 1 > < 2 > 1
6d15916d2f513157c72881300944787c4fb6121476de4d4827ab0c583bb20836
spl/ivy
soptim.ml
(* * soptim.ml * * Remove redundant calls to the instrumentation functions. * *) open Cil open Pretty open Expcompare open Ivyutil open Sutil open Sfunctions module E = Errormsg module DF = Dataflow module UD = Usedef module IH = Inthash module AELV = Availexpslv let debug = ref false (* * When ignore_inst re...
null
https://raw.githubusercontent.com/spl/ivy/b1b516484fba637eb24e83d27555d273495e622b/src/sharC/soptim.ml
ocaml
* soptim.ml * * Remove redundant calls to the instrumentation functions. * * When ignore_inst returns true, then * the instruction in question has no * effects on the abstract state. * When ignore_call returns true, then * the instruction only has side-effects * from the assignment if there is one. The...
open Cil open Pretty open Expcompare open Ivyutil open Sutil open Sfunctions module E = Errormsg module DF = Dataflow module UD = Usedef module IH = Inthash module AELV = Availexpslv let debug = ref false let ignore_inst = ref (fun i -> false) let ignore_call = ref (fun i -> false) let registerIgnoreInst (f : inst...
dda6626847be9c77d3aa3d6e68eea69359056dc24673ab60162af629b5ad1cb1
melange-re/melange
ocaml_proto_test.mli
(***)
null
https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/ocaml_proto_test.mli
ocaml
*
9ee97f790aeb349cba231c1ec0c99b8fd350a256f23af14d7eecdbb4669ab7c0
broadinstitute/firecloud-ui
synchronize.cljs
(ns broadfcui.page.workspace.summary.synchronize (:require [dmohs.react :as react] [clojure.set :as set] [broadfcui.common :as common] [broadfcui.common.components :as comps] [broadfcui.common.method.messages :as messages] [broadfcui.common.method.sync :as sync-common] [broadfcui.components.block...
null
https://raw.githubusercontent.com/broadinstitute/firecloud-ui/8eb077bc137ead105db5665a8fa47a7523145633/src/cljs/main/broadfcui/page/workspace/summary/synchronize.cljs
clojure
(ns broadfcui.page.workspace.summary.synchronize (:require [dmohs.react :as react] [clojure.set :as set] [broadfcui.common :as common] [broadfcui.common.components :as comps] [broadfcui.common.method.messages :as messages] [broadfcui.common.method.sync :as sync-common] [broadfcui.components.block...
7ccf8abe2baae227092072f1da87d294a3bcfbdbf4c6fc0e82579e8a8ab89392
namin/logically
fsm.clj
(ns logically.art.interpreters.fsm (:refer-clojure :exclude [==]) (:use [clojure.core.logic :exclude [is] :as l] [clojure.core.logic.nominal :exclude [fresh hash] :as nom])) ;; Section 17.1 Finite State Machines Program 17.1 An interpreter for a nondeterministic finite automaton ( NDFA ) (defn create-nd...
null
https://raw.githubusercontent.com/namin/logically/49e814e04ff0f5f20efa75122c0b869e400487ac/src/logically/art/interpreters/fsm.clj
clojure
Section 17.1 Finite State Machines Program 17.2 An NDFA that accepts the language (ab)*
(ns logically.art.interpreters.fsm (:refer-clojure :exclude [==]) (:use [clojure.core.logic :exclude [is] :as l] [clojure.core.logic.nominal :exclude [fresh hash] :as nom])) Program 17.1 An interpreter for a nondeterministic finite automaton ( NDFA ) (defn create-ndfa [initial final delta] (letfn [(ac...
0268156d2b1cde6e3dd905e3d5ec85af3bc7a59c1227db6eb4ad252184f65ccf
atlas-engineer/nyxt
search-buffer.lisp
SPDX - FileCopyrightText : Atlas Engineer LLC SPDX - License - Identifier : BSD-3 - Clause (in-package :nyxt/tests) (define-test toggle-search-buffer-mode () (let ((buffer (make-instance 'modable-buffer))) (with-current-buffer buffer (assert-true (enable-modes* 'nyxt/search-buffer-mode:search-buffer-m...
null
https://raw.githubusercontent.com/atlas-engineer/nyxt/65a9aa568b16c109281fa403a7c045b3b6d87025/tests/offline/mode/search-buffer.lisp
lisp
SPDX - FileCopyrightText : Atlas Engineer LLC SPDX - License - Identifier : BSD-3 - Clause (in-package :nyxt/tests) (define-test toggle-search-buffer-mode () (let ((buffer (make-instance 'modable-buffer))) (with-current-buffer buffer (assert-true (enable-modes* 'nyxt/search-buffer-mode:search-buffer-m...
ecdb7d110dfefc64131b89c520c9bca18af3b3ce24c54cd536192c377e3f02cb
reborg/clojure-essential-reference
9.clj
(require '[clojure.test :refer [is deftest] :as t]) (deftest sqrt-test < 1 > < 2 > (is (instance? Double (sqrt nil)))) ; <3> < 4 > < 5 > ;; FAIL in () (form-init7968799.clj:2) expected : ( thrown ? IllegalArgumentException ( sqrt -4 ) ) ;; actual: nil ;; ;; FAIL in () (form-init7968799.clj:3) expecte...
null
https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/TheToolbox/clojure.test/9.clj
clojure
<3> FAIL in () (form-init7968799.clj:2) actual: nil FAIL in () (form-init7968799.clj:3) actual: nil expected: (instance? Double (sqrt nil)) actual: java.lang.NullPointerException: null clojure.lang.Numbers.isNeg (Numbers.java:100) user$sqrt.invokeStatic (form-init7968.clj:2)
(require '[clojure.test :refer [is deftest] :as t]) (deftest sqrt-test < 1 > < 2 > < 4 > < 5 > expected : ( thrown ? IllegalArgumentException ( sqrt -4 ) ) expected : ( thrown - with - msg ? IllegalArgumentException # " negative " ( sqrt -4 ) ) ERROR in ( ) ( ) at clojure.lang.Numbers.ops ( )
7f3c10888df1c437cd6377c00d1195120bc2248e48230135d44e6da963a062fc
lehins/RockAnts
Main.hs
module Main where import Spec import System.IO (BufferMode (LineBuffering), hSetBuffering, stdout) import Test.Hspec main :: IO () main = do hSetBuffering stdout LineBuffering hspec spec
null
https://raw.githubusercontent.com/lehins/RockAnts/6b8cfcc476bb1230396ac18359cee578e5012154/tests/Main.hs
haskell
module Main where import Spec import System.IO (BufferMode (LineBuffering), hSetBuffering, stdout) import Test.Hspec main :: IO () main = do hSetBuffering stdout LineBuffering hspec spec
ad45e63c9489796b8e7dcee0875ab44b5627887bf6c43b3aa6ac1c746f770448
Gastove/doctopus
head.clj
(ns doctopus.doctopus.head (:require [clojure.core.async :as async] [clojure.edn :as edn] [clojure.string :as str] [compojure.core :refer [context routes]] [doctopus.channels :refer [build-channel]] [doctopus.configuration :refer [server-config]] ...
null
https://raw.githubusercontent.com/Gastove/doctopus/407ca58bb01a6da84f3a76a58c800ee0a7f14190/src/doctopus/doctopus/head.clj
clojure
Head
(ns doctopus.doctopus.head (:require [clojure.core.async :as async] [clojure.edn :as edn] [clojure.string :as str] [compojure.core :refer [context routes]] [doctopus.channels :refer [build-channel]] [doctopus.configuration :refer [server-config]] ...
4c8845964141bb8027e9e7b719b150ab04e3defe2e8984ee7a81d10a22713533
5outh/Bang
Interpreter.hs
module Bang.Interpreter where import Bang.Interface.Drum import Bang.Music.Class import Data.Ratio import System.MIDI toList :: Music PercussionSound -> [MidiEvent] toList m = map drumToMidiEvent (interpret m) interpret :: Music a -> [Primitive a] interpret = go 0 where go...
null
https://raw.githubusercontent.com/5outh/Bang/46ae674621c33e67ce57dc96d38f9e97ea6b4d05/src/Bang/Interpreter.hs
haskell
module Bang.Interpreter where import Bang.Interface.Drum import Bang.Music.Class import Data.Ratio import System.MIDI toList :: Music PercussionSound -> [MidiEvent] toList m = map drumToMidiEvent (interpret m) interpret :: Music a -> [Primitive a] interpret = go 0 where go...
5f8aa693b3778d62deb3bc4694c7f91584188fb85e6154628dceb3bfe3db503e
brendanhay/gogol
Patch.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # {-# LANGUAGE St...
null
https://raw.githubusercontent.com/brendanhay/gogol/77394c4e0f5bd729e6fe27119701c45f9d5e1e9a/lib/services/gogol-iam/gen/Gogol/IAM/Projects/Locations/WorkloadIdentityPools/Patch.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated * Resource ** Constructing a Request | A resource alias for @iam.projects.locations.workloadIdentityPools.patch@ method which the 'IAMProjectsLocationsWorkloadIdentityPoolsPatch' request conforms to. /See:/ 'newIAMProjectsLo...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators...
a3f47535d85ed3e5815881091139bb6920e9cba60378a0f1028e0f33fddefc1d
qiao/sicp-solutions
1.37.scm
(define (cont-frac n d k) (define (recur i) (/ (n i) (+ (d i) (if (= k i) 0 (recur (+ 1 i)))))) (recur 1)) (define (cont-frac-iter n d k) (define (iter k acc) (if (= 0 k) acc (iter (- k 1) (/ (n k) (+ (d k) acc))))) ...
null
https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter1/1.37.scm
scheme
(define (cont-frac n d k) (define (recur i) (/ (n i) (+ (d i) (if (= k i) 0 (recur (+ 1 i)))))) (recur 1)) (define (cont-frac-iter n d k) (define (iter k acc) (if (= 0 k) acc (iter (- k 1) (/ (n k) (+ (d k) acc))))) ...
b54ff73106e6ff31a74c76616d7ae72b20dffc097108706082b6bc9f91614e87
terezka/cherry-core
Token.hs
{-# LANGUAGE PackageImports #-} module Token (Token, generate, resolve) where import qualified Prelude as P import qualified Data.Either as Either import qualified Data.Maybe as HMaybe import qualified Data.Aeson.Types as Json import qualified Data.Aeson as Aeson import qualified "text" Data.Text as T import qualifi...
null
https://raw.githubusercontent.com/terezka/cherry-core/d9bd446e226fc9b04783532969fa670211a150c6/src/Token.hs
haskell
# LANGUAGE PackageImports # | GENERATE | | SHARED TODO err type ?
module Token (Token, generate, resolve) where import qualified Prelude as P import qualified Data.Either as Either import qualified Data.Maybe as HMaybe import qualified Data.Aeson.Types as Json import qualified Data.Aeson as Aeson import qualified "text" Data.Text as T import qualified "text" Data.Text.Lazy as TL i...
c2bea66e565cce9bbf0ca42965bd09c9758ae97f5fda03f19b615a3de835c9ed
marigold-dev/deku
test_ed25519.ml
module Crypto = struct include Deku_crypto.Ed25519 type id = { public_key_hash : Key_hash.t; public_key : Key.t; secret_key : Secret.t; } let e1 = { public_key_hash = Option.get @@ Key_hash.of_b58 "tz1NS9mkwQxD2jgH8kiGVPD33VmLXVVe3wug"; public_key = Option.get ...
null
https://raw.githubusercontent.com/marigold-dev/deku/7dd9237937b2a07edecd788e104eca3aed74ddbc/deku-p/src/core/crypto/tests/test_ed25519.ml
ocaml
module Crypto = struct include Deku_crypto.Ed25519 type id = { public_key_hash : Key_hash.t; public_key : Key.t; secret_key : Secret.t; } let e1 = { public_key_hash = Option.get @@ Key_hash.of_b58 "tz1NS9mkwQxD2jgH8kiGVPD33VmLXVVe3wug"; public_key = Option.get ...
4359350484b8e21da1eee6bbf7594ab87e0037b29c8f6ad252a9d0605c6324a6
TheClimateCorporation/geojson-schema
runner.cljs
(ns testing.runner (:require [cljs.test :as test] [doo.runner :refer-macros [doo-all-tests doo-tests]] [com.climate.geojson-schema.test.geojson-cljs])) (doo-tests 'com.climate.geojson-schema.test.geojson-cljs)
null
https://raw.githubusercontent.com/TheClimateCorporation/geojson-schema/6571958391b0a41b5d53e4b1d14da1eeae6d6283/test-cljs/testing/runner.cljs
clojure
(ns testing.runner (:require [cljs.test :as test] [doo.runner :refer-macros [doo-all-tests doo-tests]] [com.climate.geojson-schema.test.geojson-cljs])) (doo-tests 'com.climate.geojson-schema.test.geojson-cljs)
e24c2badeca386040f7c2dc37fcdc493d6aaadb02ca9e03352a8d2df2e3ee403
garrigue/lablgtk
seppala.ml
(**************************************************************************) Lablgtk - Examples (* *) (* This code is in the public domain. *) (* You may f...
null
https://raw.githubusercontent.com/garrigue/lablgtk/504fac1257e900e6044c638025a4d6c5a321284c/examples/seppala.ml
ocaml
************************************************************************ This code is in the public domain. You may freely copy parts of it in your application. ...
Lablgtk - Examples open Gtk let destroy () = GMain.quit () let main () = GMain.init (); let main_window = GWindow.window () in let accel_group = GtkData.AccelGroup.create () in main_window#add_accel_group accel_group; let quit_button = GButton.button ~label...
b224c6110cdd33371de1fe05597584ef8160f06694d674ac8da702a18ee16879
AlexKnauth/music
partition-point.rkt
#lang agile (provide partition-points partition-points/segment time-period-count-minimal-segments) (require "../time/main.rkt") A PartitionPoint is a Position ;; where a note (or other timed element) begins or ends A Segment is a TimePeriod ;; that begins at a partition point and ends at a par...
null
https://raw.githubusercontent.com/AlexKnauth/music/b4489c27d7c0f7116d769344c787fa76b479e5fa/music/data/chord/partition-point.rkt
racket
where a note (or other timed element) begins or ends that begins at a partition point and ends at a partition point Do not account for measure length (time-period-count-minimal-segments doesn't) partition-points/segment : time-period-count-minimal-segments : Do not account for measure length (partition-points d...
#lang agile (provide partition-points partition-points/segment time-period-count-minimal-segments) (require "../time/main.rkt") A PartitionPoint is a Position A Segment is a TimePeriod partition - points : [ [ Timed Any ] ] - > [ PartitionPoint ] (define (partition-points tes) (remove-d...
005f0a5651fa9a9fbf77f110e1d11eb75c00947b145d15d3923f24b6182ad954
monadbobo/ocaml-core
extended_common.mli
(** Pervasive functions. *) val run_main : (unit -> unit) -> _ (** [write_wrap ~atomic ~f fname] Runs [f] on an [out_channel]. If [mode] is [`Atomic] or [`Atomic_update] is set all the changes will be written to a temporary file which will then be moved over [fname] otherwise we are writing straight to [f...
null
https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/extended_common.mli
ocaml
* Pervasive functions. * [write_wrap ~atomic ~f fname] Runs [f] on an [out_channel]. If [mode] is [`Atomic] or [`Atomic_update] is set all the changes will be written to a temporary file which will then be moved over [fname] otherwise we are writing straight to [fname]. Values for [mode]: - [`Clob...
val run_main : (unit -> unit) -> _ val write_wrap : ?mode:[`Clobber|`Append|`Atomic|`Atomic_update] -> f:(out_channel -> 'a) -> string -> 'a
0340ad683b8303f65db63adbd5cb0091516f80bb696ee4f4aec7caac9a534054
priestjim/gen_rpc
remote_SUITE.erl
-*-mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*- ex : set utf-8 sts=4 ts=4 sw=4 et : %%% Copyright 2015 . All Rights Reserved . %%% -module(remote_SUITE). -author("Panagiotis Papadomitsos <>"). CT Macros -include_lib("test/include/ct.hrl"). %%% No need to e...
null
https://raw.githubusercontent.com/priestjim/gen_rpc/6e17cac4e886f36ecb35bbda91e6bb3293aaa723/test/ct/remote_SUITE.erl
erlang
No need to export anything, everything is automatically exported as part of the test profile =================================================== CT callback functions =================================================== [{group, tcp}]. [{tcp, [], Cases}]. Our group name is the name of the driver Starting Dist...
-*-mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*- ex : set utf-8 sts=4 ts=4 sw=4 et : Copyright 2015 . All Rights Reserved . -module(remote_SUITE). -author("Panagiotis Papadomitsos <>"). CT Macros -include_lib("test/include/ct.hrl"). all() -> [{group, t...
5dba7941e44671574d43b7148f1700a46c8d508a97d685cc354efe4499853419
smimram/catt
extlib.ml
module Enum = struct type 'a t = unit -> 'a exception End let empty : 'a t = fun () -> raise End let once x : 'a t = let dead = ref false in fun () -> if !dead then raise End else (dead := true; x) let get (e : 'a t) = e () let map f e : 'a t = fun () -> f (get e) let rec may_map f e = fun (...
null
https://raw.githubusercontent.com/smimram/catt/a44015bd71ef759db6736943a732bae643147b75/src/extlib.ml
ocaml
module Enum = struct type 'a t = unit -> 'a exception End let empty : 'a t = fun () -> raise End let once x : 'a t = let dead = ref false in fun () -> if !dead then raise End else (dead := true; x) let get (e : 'a t) = e () let map f e : 'a t = fun () -> f (get e) let rec may_map f e = fun (...