_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
e3913fd67e6ea9661d313219f639a681475f61f29bf889d237c1cf7312995857
fpco/unliftio
MemoizeSpec.hs
{-# LANGUAGE DeriveDataTypeable #-} module UnliftIO.MemoizeSpec (spec) where import Control.Concurrent (threadDelay) import Control.Monad (replicateM_) import Test.Hspec import Test.Hspec.QuickCheck import UnliftIO import Data.Typeable data Dummy = Dummy deriving (Show, Typeable) instance Exception Dummy spec :: S...
null
https://raw.githubusercontent.com/fpco/unliftio/d7ac43b9ae69efea0ca911aa556852e9f95af128/unliftio/test/UnliftIO/MemoizeSpec.hs
haskell
# LANGUAGE DeriveDataTypeable #
module UnliftIO.MemoizeSpec (spec) where import Control.Concurrent (threadDelay) import Control.Monad (replicateM_) import Test.Hspec import Test.Hspec.QuickCheck import UnliftIO import Data.Typeable data Dummy = Dummy deriving (Show, Typeable) instance Exception Dummy spec :: Spec spec = do let basics maker = d...
1152630e51f7090c811970904f4686a8cfe29ed6d11e9a5e53598dd3628082ac
jayrbolton/coursework
Identity.hs
{-# LANGUAGE EmptyDataDecls , ExistentialQuantification , ScopedTypeVariables , NoMonomorphismRestriction #-} module MAlonzo.Category.Monad.Identity where import qualified Unsafe.Coerce import qualified MAlonzo.Category.Monad import qualified MAlonzo.Category.Monad.Indexed name3 = ("C...
null
https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computability_and_formal_languages/project__/agda/MAlonzo/Category/Monad/Identity.hs
haskell
# LANGUAGE EmptyDataDecls , ExistentialQuantification , ScopedTypeVariables , NoMonomorphismRestriction #
module MAlonzo.Category.Monad.Identity where import qualified Unsafe.Coerce import qualified MAlonzo.Category.Monad import qualified MAlonzo.Category.Monad.Indexed name3 = ("Category.Monad.Identity.Identity") d3 v0 = ((Unsafe.Coerce.unsafeCoerce) (v0)) name5 = ("Category.Monad.Identity.IdentityMonad") d5 = ((Unsafe.C...
dca857c339523b993a6bfb0eb1bfe08c5eaf6be8d71e743f50f3097aee8fbcd8
xapix-io/axel-f
search.cljc
(ns axel-f.excel.search (:require [matchete.data-form :as df] [matchete.core :as m] [#?(:clj clojure.tools.reader.edn :cljs cljs.tools.reader.edn) :as edn])) (defn edn->pattern [edn-string] (df/make-pattern (edn/read-string edn-string))) (defn json-search* "" [data edn-...
null
https://raw.githubusercontent.com/xapix-io/axel-f/ec8fca880033e0ae78a8d9f42538d4a71fba29bd/src/axel_f/excel/search.cljc
clojure
(ns axel-f.excel.search (:require [matchete.data-form :as df] [matchete.core :as m] [#?(:clj clojure.tools.reader.edn :cljs cljs.tools.reader.edn) :as edn])) (defn edn->pattern [edn-string] (df/make-pattern (edn/read-string edn-string))) (defn json-search* "" [data edn-...
d834fc7ae98d8af82accef40e781a32afb2676858981e1026cd23ebc37f694f4
maoe/ghc-prof
Regression.hs
# LANGUAGE CPP # # LANGUAGE ViewPatterns # module Main where import Control.Applicative import Control.Monad import Data.Foldable import Data.Monoid import Data.Traversable import System.Directory import System.Environment import System.FilePath import System.IO import Prelude import System.IO.Temp import System.Proce...
null
https://raw.githubusercontent.com/maoe/ghc-prof/cd8b3c8c6222b3fd77e36d110f5b0b03a66396e8/tests/Regression.hs
haskell
# LANGUAGE CPP # # LANGUAGE ViewPatterns # module Main where import Control.Applicative import Control.Monad import Data.Foldable import Data.Monoid import Data.Traversable import System.Directory import System.Environment import System.FilePath import System.IO import Prelude import System.IO.Temp import System.Proce...
30ce81d854e4b32b53e903084843da8bdefdcea85bf694107561f8e654e1f3aa
noinia/hgeometry
LowerTangentSpec.hs
module Geometry.Polygon.Convex.LowerTangentSpec (spec) where import Algorithms.Geometry.ConvexHull.GrahamScan (lowerHull) import Control.Lens import Data.Ext import qualified Data.Foldable as F import Geometry hiding (vect...
null
https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-test/src/Geometry/Polygon/Convex/LowerTangentSpec.hs
haskell
I've disabled these tests for now since the old implementation was not very robust to colinear points; having degenerate polygons etc. Hence, on the testcases generated that implementation loops. lowerTangent lh rh == LowerT.lowerTangent lh rh upperTangent lh rh == LowerT.upperTangent l...
module Geometry.Polygon.Convex.LowerTangentSpec (spec) where import Algorithms.Geometry.ConvexHull.GrahamScan (lowerHull) import Control.Lens import Data.Ext import qualified Data.Foldable as F import Geometry hiding (vect...
a9aeee5fc03362a37964fd24f08a92b5d29456752de7d7702efbd42e8766d182
FestCat/festival-ca
nitech_us_slt_arctic_tagger.scm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Carnegie Mellon University ; ; ; and and ; ; ; Copyright ( c ) 1998 - 2000 ...
null
https://raw.githubusercontent.com/FestCat/festival-ca/f6b2d9bf4fc4f77b80890ebb95770075ad36ccaf/src/data/festvox.orig/nitech_us_slt_arctic_tagger.scm
scheme
;;; ; ; ; ; ; ; ; ; ;;; Permission is hereby granted, free of charge, to use and distribute ;;; this software and its documentation without restriction, including ;;; withou...
POS tagger for English (require 'pos) (define (nitech_us_slt_arctic::select_tagger) "(nitech_us_slt_arctic::select_tagger) Set up the POS tagger English." (set! pos_lex_name "english_poslex") (set! pos_ngram_name 'english_pos_ngram) (set! pos_supported t) ) (define (nitech_us_slt_arctic::reset_tagger) "(...
b4acdae776ae127b3184f38d84520a36346a8c8fb0ff62bcefcee8ad231caeec
spwhitton/consfigurator
libacl.lisp
(in-package :consfigurator.util.posix1e) (include "sys/types.h" "sys/acl.h") (ctype acl_tag_t "acl_tag_t") (ctype acl_type_t "acl_type_t") (ctype acl_entry_t "acl_entry_t") (constant (ACL_USER "ACL_USER")) (constant (ACL_GROUP "ACL_GROUP")) (constant (ACL_TYPE_ACCESS "ACL_TYPE_ACCESS")) (constant (ACL_TYPE_DEFAULT "...
null
https://raw.githubusercontent.com/spwhitton/consfigurator/3019bfea87ab6df33845f3bf7f7df03a33a5970d/src/libacl.lisp
lisp
(in-package :consfigurator.util.posix1e) (include "sys/types.h" "sys/acl.h") (ctype acl_tag_t "acl_tag_t") (ctype acl_type_t "acl_type_t") (ctype acl_entry_t "acl_entry_t") (constant (ACL_USER "ACL_USER")) (constant (ACL_GROUP "ACL_GROUP")) (constant (ACL_TYPE_ACCESS "ACL_TYPE_ACCESS")) (constant (ACL_TYPE_DEFAULT "...
6173203c01693621acf43afc99e7dca79691a2df174c66b3caa1833df7e9f194
LexiFi/gen_js_api
types.ml
type 'a of_js = Ojs.t -> 'a type 'a to_js = 'a -> Ojs.t [@@@ocaml.text " JS-able types "] let (_ : string of_js) = Ojs.string_of_js let (_ : string to_js) = Ojs.string_to_js let (_ : int of_js) = Ojs.int_of_js let (_ : int to_js) = Ojs.int_to_js let (_ : bool of_js) = Ojs.bool_of_js let (_ : bool to_js) = Ojs.bool_to_j...
null
https://raw.githubusercontent.com/LexiFi/gen_js_api/ed6e3483e855f46c6081cf451a34950da967364e/ppx-test/expected/types.ml
ocaml
type 'a of_js = Ojs.t -> 'a type 'a to_js = 'a -> Ojs.t [@@@ocaml.text " JS-able types "] let (_ : string of_js) = Ojs.string_of_js let (_ : string to_js) = Ojs.string_to_js let (_ : int of_js) = Ojs.int_of_js let (_ : int to_js) = Ojs.int_to_js let (_ : bool of_js) = Ojs.bool_of_js let (_ : bool to_js) = Ojs.bool_to_j...
d3db0d8e08f91dfe48a032711e81d413aa79ce6107536737e5d294e215b8c0cc
rd--/hsc3
demand.help.hs
-- demand ; monadic form uid_st_eval ( do r <- dustM kr 1 s <- dgeomM dinf (midiCps 72) (midiRatio 1) let t = impulse kr 10 0 f = demand t r s o = sinOsc ar (mce [f,f + 0.7]) 0 return (max (cubed o) 0 * 0.1)) -- demand let n = diwhiteId 'α' dinf 60 72 t = impulse kr 10 0 s = ...
null
https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/demand.help.hs
haskell
demand ; monadic form demand demand ; audio rate (poll output is equal for x1 and x2) demand demand
uid_st_eval ( do r <- dustM kr 1 s <- dgeomM dinf (midiCps 72) (midiRatio 1) let t = impulse kr 10 0 f = demand t r s o = sinOsc ar (mce [f,f + 0.7]) 0 return (max (cubed o) 0 * 0.1)) let n = diwhiteId 'α' dinf 60 72 t = impulse kr 10 0 s = midiCps n f = demand t 0 s ...
3c09c264468c8bb67889fffef52afb4a7bf9df5e10485aabb4ee4ae4e01b113b
GlideAngle/flare-timing
CrossZoneMain.hs
import Debug.Trace (traceShowId) import Prelude hiding (span) import System.Environment (getProgName) import System.Console.CmdArgs.Implicit (cmdArgs) import Data.Coerce (coerce) import Formatting ((%), fprint) import Formatting.Clock (timeSpecs) import System.Clock (getTime, Clock(Monotonic)) import Data.Maybe (catMay...
null
https://raw.githubusercontent.com/GlideAngle/flare-timing/34873946be9b93c37048ed118ef5b4649c71d630/lang-haskell/flare-timing/prod-apps/cross-zone/CrossZoneMain.hs
haskell
windows or if they jump the gun by too much. arising from a use of ‘madeZones’
import Debug.Trace (traceShowId) import Prelude hiding (span) import System.Environment (getProgName) import System.Console.CmdArgs.Implicit (cmdArgs) import Data.Coerce (coerce) import Formatting ((%), fprint) import Formatting.Clock (timeSpecs) import System.Clock (getTime, Clock(Monotonic)) import Data.Maybe (catMay...
7064ac2348b3c58b89ac3975355fbc0de1b31778ee2eba477fd6accffb3512d3
soulomoon/SICP
Exercise3.03.scm
Exercise 3.3 : Modify the make - account procedure so that it creates password - protected accounts . That is , make - account should take a symbol as an additional argument , as in ( define acc ( make - account 100 ' secret - password ) ) ; The resulting account object should process a request only if it is a...
null
https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter3/Exercise3.03.scm
scheme
The resulting account object should process a request only if it is accompanied by the password with which the account was created, and should otherwise return a complaint: "Incorrect password" memory limit : 128 MB . "Incorrect password" "Incorrect password" >
Exercise 3.3 : Modify the make - account procedure so that it creates password - protected accounts . That is , make - account should take a symbol as an additional argument , as in ( define acc ( make - account 100 ' secret - password ) ) ( ( acc ' secret - password ' withdraw ) 40 ) 60 ( ( acc ' some...
143f222ce476c03538d4106790b619a0dacf97fb8835585d4d4c7ab3351bc8d1
huangz1990/SICP-answers
34-horner-eval.scm
34-horner-eval.scm (load "p78-accumulate.scm") (define (horner-eval x coefficient-sequence) (accumulate (lambda (this-coeff higher-terms) (+ this-coeff (* x higher-terms))) 0 coefficient-sequence))
null
https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/34-horner-eval.scm
scheme
34-horner-eval.scm (load "p78-accumulate.scm") (define (horner-eval x coefficient-sequence) (accumulate (lambda (this-coeff higher-terms) (+ this-coeff (* x higher-terms))) 0 coefficient-sequence))
667490928abf00e7868b636c8194c6d307114498db2dfe18fd4956852a4a1aba
donut-party/dbxray
build.clj
(ns build "dbxray's build script. inspired by: * * -clj Run tests: clojure -X:test clojure -X:test-cljs For more information, run: clojure -A:deps -T:build help/doc" (:refer-clojure :exclude [test]) (:require [clojure.tools.build.api :as b] [org.corfield.build :as bb])) (def lib 'part...
null
https://raw.githubusercontent.com/donut-party/dbxray/fc0b119f332ec9bb78fedd8d1186985c49517c37/build.clj
clojure
(ns build "dbxray's build script. inspired by: * * -clj Run tests: clojure -X:test clojure -X:test-cljs For more information, run: clojure -A:deps -T:build help/doc" (:refer-clojure :exclude [test]) (:require [clojure.tools.build.api :as b] [org.corfield.build :as bb])) (def lib 'part...
cd1d4c388ca4739281eaa4e2d8e6d1493d8ac15975d37d43b65a8489e30daefa
gvolpe/musikell
Artist.hs
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} | The Neo4j repository for Artist , including interface and cypher queries . module Repository.Artist ( mkArtistRepository , ArtistRepository(..) ) where import Data.Functor ( (<&>) ...
null
https://raw.githubusercontent.com/gvolpe/musikell/2ec837b605b87b268e460cd6e13b82e7eea8169b/src/Repository/Artist.hs
haskell
# LANGUAGE OverloadedStrings, RecordWildCards #
| The Neo4j repository for Artist , including interface and cypher queries . module Repository.Artist ( mkArtistRepository , ArtistRepository(..) ) where import Data.Functor ( (<&>) , void ...
bfc92cda27e918688d7a29b05cab993403c50e4e5c85207c80850b2bebe840b1
CryptoKami/cryptokami-core
Examples.hs
# LANGUAGE QuasiQuotes # -- | Some example scripts used in tests. module Pos.Script.Examples ( -- * Trivial alwaysSuccessValidator , alwaysFailureValidator , idValidator -- * Int , intValidator , goodIntRedeemer , badIntRedeemer * , stdlibValidato...
null
https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/txp/Pos/Script/Examples.hs
haskell
| Some example scripts used in tests. * Trivial * Int * Multisig * Extra names * Stress testing -------------------------------------------------------------------------- Trivial validators/redeemers -------------------------------------------------------------------------- --------------------------------------...
# LANGUAGE QuasiQuotes # module Pos.Script.Examples alwaysSuccessValidator , alwaysFailureValidator , idValidator , intValidator , goodIntRedeemer , badIntRedeemer * , stdlibValidator , goodStdlibRedeemer , multisigValidator , multisigRedeem...
aef22f0559d027270d7784ee9a881c4d68fee71f1760991c68d3032d12085dfe
acowley/CLUtil
Scratch.hs
# LANGUAGE ConstraintKinds , FlexibleContexts # -- | Helpers for working with scratch memory. See 'scratchImage' for a -- discussion of applicability. module CLUtil.Scratch where import CLUtil.Resource import CLUtil.Image (ValidImage) import Data.IORef import Data.Traversable (sequenceA) import Linear (V2(..)) -- | On...
null
https://raw.githubusercontent.com/acowley/CLUtil/d57f05cb3419001b3079d4dfd738bf4538a115ce/src/CLUtil/Scratch.hs
haskell
| Helpers for working with scratch memory. See 'scratchImage' for a discussion of applicability. | One often wants to present a pseudo-functional interface such inputs in place. Rather than create a new output value from whole cloth, it is much more efficient to re-use a previously allocated output value. This me...
# LANGUAGE ConstraintKinds , FlexibleContexts # module CLUtil.Scratch where import CLUtil.Resource import CLUtil.Image (ValidImage) import Data.IORef import Data.Traversable (sequenceA) import Linear (V2(..)) that " output values are returned rather than modifying result of @scratchImage@ is a function that retur...
3f85531f50eb1b0d8237eef749ab729dc6ef49748fc0b44e7ba6814d327e98e2
scymtym/architecture.builder-protocol
util.lisp
;;;; util.lisp --- Utilities used by the builder-protocol.xpath module. ;;;; Copyright ( C ) 2015 , 2016 Jan Moringen ;;;; Author : < > (cl:in-package #:architecture.builder-protocol.xpath) (declaim (inline string->name)) (defun string->name (string) (substitute #\_ #\/ string)) (defun symbol->name (symbol)...
null
https://raw.githubusercontent.com/scymtym/architecture.builder-protocol/a48abddff7f6e0779b89666f46ab87ef918488f0/src/xpath/util.lisp
lisp
util.lisp --- Utilities used by the builder-protocol.xpath module.
Copyright ( C ) 2015 , 2016 Jan Moringen Author : < > (cl:in-package #:architecture.builder-protocol.xpath) (declaim (inline string->name)) (defun string->name (string) (substitute #\_ #\/ string)) (defun symbol->name (symbol) (string->name (string-downcase symbol))) (defun symbol->namespace (symbol) (...
f2b38fbdfcf1d5fbe781cf2159d9a9a11de328a08c55c64c8e5b9fd9d980cdbe
jeapostrophe/exp
cbz.rkt
#lang racket/base (require racket/fixnum racket/unsafe/ops) ;; XXX make package (define (ctz x) (cond [(fx= x 0) 32] [else (define n 0) (define-syntax-rule (round cm mod) (when (zero? (unsafe-fxand x cm)) (set! n (unsafe-fx+ n mod)) (set! x (unsafe-fxrshift x mod)...
null
https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/cbz.rkt
racket
XXX make package
#lang racket/base (require racket/fixnum racket/unsafe/ops) (define (ctz x) (cond [(fx= x 0) 32] [else (define n 0) (define-syntax-rule (round cm mod) (when (zero? (unsafe-fxand x cm)) (set! n (unsafe-fx+ n mod)) (set! x (unsafe-fxrshift x mod)))) (round #x00...
25a632e4308ec80ef3da5771131a768aa1d824742411e7c7d0fab4873168e5fd
ThomasHintz/keep-the-records
run-tests.scm
#!/usr/local/bin/csi (load "~/keep-the-records/src/utils/test-runner.scm") (exit)
null
https://raw.githubusercontent.com/ThomasHintz/keep-the-records/c20e648e831bed2ced3f2f74bfc590dc06b5f076/run-tests.scm
scheme
#!/usr/local/bin/csi (load "~/keep-the-records/src/utils/test-runner.scm") (exit)
629204c0df398b2635745a8af48abaf74580b713b6b092a0db65aa60e7d3e581
PrecursorApp/precursor
plan.cljs
(ns frontend.models.plan (:require [cljs-time.core :as time] [cljs-time.coerce] [goog.date])) (defn in-trial? [plan] (when (:plan/trial-end plan) (time/after? (cljs-time.coerce/from-date (:plan/trial-end plan)) (time/now)))) (defn trial-over? [plan] (not (in-trial? plan))) (defn act...
null
https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src-cljs/frontend/models/plan.cljs
clojure
(ns frontend.models.plan (:require [cljs-time.core :as time] [cljs-time.coerce] [goog.date])) (defn in-trial? [plan] (when (:plan/trial-end plan) (time/after? (cljs-time.coerce/from-date (:plan/trial-end plan)) (time/now)))) (defn trial-over? [plan] (not (in-trial? plan))) (defn act...
a19389c051d014f8538ce2091ebe8956aaf0fc8df64db91e165c1e0292f974e2
typelead/eta
tc230.hs
{ - # OPTIONS_GHC -fno - warn - redundant - constraints # - } {-# LANGUAGE ImplicitParams, RankNTypes #-} Trac # 1445 module Bug where f :: () -> (?p :: ()) => () -> () f _ _ = () g :: (?p :: ()) => () g = f () ()
null
https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tc230.hs
haskell
# LANGUAGE ImplicitParams, RankNTypes #
{ - # OPTIONS_GHC -fno - warn - redundant - constraints # - } Trac # 1445 module Bug where f :: () -> (?p :: ()) => () -> () f _ _ = () g :: (?p :: ()) => () g = f () ()
bdf42d82c7c844a1506ab3e98d23946030690667a5903f7cf987128e5d88b0e3
zcaudate-me/gita
repository.clj
(ns gita.api.repository (:require [clojure.java.io :as io] [gita.interop :as interop]) (:import [org.eclipse.jgit.lib Repository Constants] [org.eclipse.jgit.treewalk TreeWalk CanonicalTreeParser AbstractTreeIterator] [org.eclipse.jgit.revwalk RevWalk RevCommit] org.ecli...
null
https://raw.githubusercontent.com/zcaudate-me/gita/6d2cc3b66e6b8d404dda3032d7bcf4da6241893b/src/gita/api/repository.clj
clojure
(ns gita.api.repository (:require [clojure.java.io :as io] [gita.interop :as interop]) (:import [org.eclipse.jgit.lib Repository Constants] [org.eclipse.jgit.treewalk TreeWalk CanonicalTreeParser AbstractTreeIterator] [org.eclipse.jgit.revwalk RevWalk RevCommit] org.ecli...
ca1521213f15df714d2afbbbf2df821853de958aa3c94a58b81f22612fe632dd
wireless-net/erlang-nommu
wxScrollWinEvent.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2008 - 2013 . All Rights Reserved . %% The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Publi...
null
https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxScrollWinEvent.erl
erlang
%CopyrightBegin% compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitatio...
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved . The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in Software distributed under the License is distributed on an " AS IS " See also the message variant { @link wxE...
47cb969f074fcf1cf9240406ff5e41fb8ecf40a25987d02dcd71d42a9b9295b4
mokus0/junkbox
STMIO.hs
- ` ` Util / STMIO.hs '' - ( c ) 2008 , , Inc. - ``Util/STMIO.hs'' - (c) 2008 Cook, J. MR SSD, Inc. -} module Util.STMIO where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Control.Monad.Loops import IO type STMGet a = STM a type STMPut ...
null
https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Idioms%2C%20%26c./Util/STMIO.hs
haskell
TODO: dup() the handle? STM Bool value indicating whether all pending output has been written to the stream the writer thread the interface to be returned. be as strict as possible, so that exceptions in the string occur in the caller's context
- ` ` Util / STMIO.hs '' - ( c ) 2008 , , Inc. - ``Util/STMIO.hs'' - (c) 2008 Cook, J. MR SSD, Inc. -} module Util.STMIO where import Control.Concurrent import Control.Concurrent.STM import Control.Monad import Control.Monad.Loops import IO type STMGet a = STM a type STMPut ...
da3a55fe29f8cc1282c53a46c5cf79a75f394a180dc4e0efaa07dd5b5c6846f1
graphx-design/ocaml-serializers
benchmarks.ml
open Core open Core_bench Generic data let string_a = String.make 1000 'A' let string_b = String.make 500 'B' Raw Yojson let yojson_data = Yojson.Basic.( `Assoc [ "first", `Bool false; "second", `Bool true; "third", `Float 12345678.117; "fourth", `Int 234567; ...
null
https://raw.githubusercontent.com/graphx-design/ocaml-serializers/3165941359af5fbf48c11382468b25e6e969c974/src/benchmarks.ml
ocaml
ATD ocaml-protoc: binary & JSON ppx_deriving_yojson ppx_deriving_protobuf Putting it all together spacer
open Core open Core_bench Generic data let string_a = String.make 1000 'A' let string_b = String.make 500 'B' Raw Yojson let yojson_data = Yojson.Basic.( `Assoc [ "first", `Bool false; "second", `Bool true; "third", `Float 12345678.117; "fourth", `Int 234567; ...
0b6df2efcb84d8d8c2e6bc4fe0b9063ddd98f78d2254d704a79f33ec5906ddc9
pavlobaron/ErlangOTPBookSamples
dynbehavior.erl
-module(dynbehavior). -export([start/0, send/1, loop/1]). f(Msg) -> fun() -> io:format("Last message was: ~p~n", [Msg]) end. start() -> register(?MODULE, spawn(?MODULE, loop, [f("N/A")])). send(Msg) -> ?MODULE ! Msg. loop(F) -> receive Msg -> F(), loop(f(Msg)) end. ...
null
https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/nebenlaeufigkeit/dynbehavior.erl
erlang
-module(dynbehavior). -export([start/0, send/1, loop/1]). f(Msg) -> fun() -> io:format("Last message was: ~p~n", [Msg]) end. start() -> register(?MODULE, spawn(?MODULE, loop, [f("N/A")])). send(Msg) -> ?MODULE ! Msg. loop(F) -> receive Msg -> F(), loop(f(Msg)) end. ...
ff565256622ce40505fc757b8f3070ab136cd1b06f0058420aa3f8ae1f95c19b
clojurecademy/clojurecademy
course.clj
(ns clojurecademy.dao.course (:require [datomic.api :as d] [clojurecademy.dao.db :as db])) (defn find-number-of-courses [] (db/q '[:find (count ?course-id) . :where [?course-id :course/active? true]])) (defn find-number-of-released-courses [] (db/q '[:find (count ?course-id...
null
https://raw.githubusercontent.com/clojurecademy/clojurecademy/97dc7f9b91a90a3f30ca5a3de88542c90a50ce01/src/clj/clojurecademy/dao/course.clj
clojure
TODO warning -> ?courses returns all courses like active false released false....
(ns clojurecademy.dao.course (:require [datomic.api :as d] [clojurecademy.dao.db :as db])) (defn find-number-of-courses [] (db/q '[:find (count ?course-id) . :where [?course-id :course/active? true]])) (defn find-number-of-released-courses [] (db/q '[:find (count ?course-id...
6a163cecb0603eaeeac1338f0bd3771aee862c3b3bc7a545fdc65c51cc5ac57d
rmculpepper/crypto
ffi.rkt
Copyright 2018 ;; ;; This library 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 , either version 3 of the License , or ;; (at your option) any later version. ;; ;; This library is distributed in...
null
https://raw.githubusercontent.com/rmculpepper/crypto/fec745e8af7e3f4d5eaf83407dde2817de4c2eb0/crypto-lib/private/b2/ffi.rkt
racket
This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCH...
Copyright 2018 by the Free Software Foundation , either version 3 of the License , or GNU Lesser General Public License for more details . You should have received a copy of the GNU Lesser General Public License #lang racket/base (require (for-syntax racket/base) ffi/unsafe ffi/unsafe/defi...
3ceb19d778179a7334f4908ec6173879e7d72def1562b8416d7a9691d64acf20
someteam/acha
emoji.clj
(ns acha.emoji) (defn- codepoint-seq [s] (mapv #(.codePointAt s %) (range (.codePointCount s 0 (count s))))) (defn- unicode-emoji? [cp] (or (<= 0x1f300 cp 0x1f5ff) ;; Miscellaneous Symbols and Pictographs (<= 0x1f600 cp 0x1f64f) ;; Emoticons (<= 0x1f680 cp 0x1f6ff) ;; Transport and maps (<= 0x2...
null
https://raw.githubusercontent.com/someteam/acha/6b957f6cb6773f4fc184d094b40de79039bb58cc/src-clj/acha/emoji.clj
clojure
Miscellaneous Symbols and Pictographs Emoticons Transport and maps Miscellaneous Symbols Dingbats
(ns acha.emoji) (defn- codepoint-seq [s] (mapv #(.codePointAt s %) (range (.codePointCount s 0 (count s))))) (defn- unicode-emoji? [cp] (or (declare codes) (defn contains-emoji? [s] (or (some unicode-emoji? (codepoint-seq s)) (some codes (re-seq #"\:[\w0-9]+\:" s)))) (def codes #{ ":bowtie:...
d4d1baa49126f2cb33d41afaf20aab427f6232593d94763e0fea0e8468537c97
bennn/iPoe
string.rkt
#lang racket/base (provide string-count-chars ( - > ( U Char ( - > ) ) String Natural ) ;; Count the number of characters satisfying the predicate string-empty? ;; (->* [String] [#:trim? Boolean #f] Boolean) ;; True if the argument is an empty string ;; Optional argument #:trim decides whether to igno...
null
https://raw.githubusercontent.com/bennn/iPoe/4a988f6537fb738b4fe842c404f9d78f658ab76f/ipoe/private/util/string.rkt
racket
Count the number of characters satisfying the predicate (->* [String] [#:trim? Boolean #f] Boolean) True if the argument is an empty string Optional argument #:trim decides whether to ignore whitespace. (-> String String) Filter non-alphabetic characters from the string & downcase what's left (-> String Any) Us...
#lang racket/base (provide string-count-chars ( - > ( U Char ( - > ) ) String Natural ) string-empty? string-normalize-downcase read-from-string string-ascii ) (require (only-in racket/port with-input-from-string) (only-in racket/string non-empty-string? string-trim) ) (define (st...
9e10f976a7ee134adf302da74d9cf51c2950b863af7073f9788ad9c306395d57
gbwey/predicate-typed
Extra.hs
# LANGUAGE TypeOperators # # LANGUAGE ViewPatterns # # LANGUAGE UndecidableInstances # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeApplications # # LANGUAGE DataKinds # {-# LANGUAGE GADTs #-} # LANGUAGE TypeFamilies # # LANGUAGE PolyKinds # # LANGUAGE S...
null
https://raw.githubusercontent.com/gbwey/predicate-typed/51f8d51f662722e1109d2ff35644aea1e0371b42/src/Predicate/Data/Extra.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # # LANGUAGE OverloadedStrings # # LANGUAGE ConstraintKinds # # LANGUAGE EmptyDataDeriving # | extra promoted functions ** list functions ** primes ** luhn check $setup >>> :set -XDataKinds >>> :set -XTypeApplications >>> :set -XTypeOperators >>> import qualified Data.T...
# LANGUAGE TypeOperators # # LANGUAGE ViewPatterns # # LANGUAGE UndecidableInstances # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeApplications # # LANGUAGE DataKinds # # LANGUAGE TypeFamilies # # LANGUAGE PolyKinds # # LANGUAGE ScopedTypeVariables # # ...
c29432b397a53ead029bf54f074e692da199727205b5c1089da2d7ef17103ee9
basho/riak_ensemble
synctree_leveldb.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may ob...
null
https://raw.githubusercontent.com/basho/riak_ensemble/f279810f3b9b3a1b4bc82dda738364242896ff32/src/synctree_leveldb.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved . This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(...
81237827be4747cb1eb66edc9c4455101df8d2794cc73301f0bedbb6e62086be
dwayne/eopl3
array.test.rkt
#lang racket (require "./array.rkt") (require "./store.rkt") (require rackunit) (initialize-store!) (let ([arr (newarray 3 -99)]) (check-equal? (arrayref arr 0) -99) (check-equal? (arrayref arr 1) -99) (check-equal? (arrayref arr 2) -99) (arrayset arr 1 99) (check-equal? (arrayref arr 1) 99))
null
https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/04-ch4/interpreters/racket/MUTABLE-PAIRS-4.29/array.test.rkt
racket
#lang racket (require "./array.rkt") (require "./store.rkt") (require rackunit) (initialize-store!) (let ([arr (newarray 3 -99)]) (check-equal? (arrayref arr 0) -99) (check-equal? (arrayref arr 1) -99) (check-equal? (arrayref arr 2) -99) (arrayset arr 1 99) (check-equal? (arrayref arr 1) 99))
ad91d0973b60411c688dab74216e63129022c193311a0603a14752063131a755
montelibero-org/veche
Dashboard.hs
# LANGUAGE BlockArguments # # LANGUAGE ImportQualifiedPost # # LANGUAGE NamedFieldPuns # # LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE QuasiQuotes # # LANGUAGE TemplateHaskell # module Handler.Dashboard (getDashboardR) where import Import import Model.Issue qualified as Issue import Mo...
null
https://raw.githubusercontent.com/montelibero-org/veche/6e4ffd079e047d0bbba6c30e8c9ff0f27b41a65e/veche-web/src/Handler/Dashboard.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE BlockArguments # # LANGUAGE ImportQualifiedPost # # LANGUAGE NamedFieldPuns # # LANGUAGE NoImplicitPrelude # # LANGUAGE QuasiQuotes # # LANGUAGE TemplateHaskell # module Handler.Dashboard (getDashboardR) where import Import import Model.Issue qualified as Issue import Model.Request qualified as Request im...
b26a08a1e83a6eed85e6d30a3c514ec461f64220731ec1e8d6f1410274b388e1
Kalimehtar/gtk-cffi
rectangle.lisp
(in-package :gdk-cffi) (defclass rectangle (struct) ()) (defmethod new-struct ((class (eql 'rectangle))) (foreign-alloc 'cairo_rectangle_t)) (defcstruct-accessors (rectangle . cairo_rectangle_t)) (defcfun gdk-rectangle-intersect :boolean (src1 (struct rectangle)) (src2 (struct rectangle)) (dest (struct rec...
null
https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gdk/rectangle.lisp
lisp
(in-package :gdk-cffi) (defclass rectangle (struct) ()) (defmethod new-struct ((class (eql 'rectangle))) (foreign-alloc 'cairo_rectangle_t)) (defcstruct-accessors (rectangle . cairo_rectangle_t)) (defcfun gdk-rectangle-intersect :boolean (src1 (struct rectangle)) (src2 (struct rectangle)) (dest (struct rec...
af8355f242faa436af29e58c36d23b771b642ef4052519c52a17883b7411a62f
LeastAuthority/haskell-magic-wormhole
Sequential.hs
-- | Tests for sequential sort of messages. module Sequential (tests) where import Protolude import Hedgehog (forAll, property, (===)) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import Test.Tasty (TestTree, testGroup) import Test.Tasty.Hedgehog (testProperty) import qualified Magic...
null
https://raw.githubusercontent.com/LeastAuthority/haskell-magic-wormhole/781f915a87b3a9ed0cb34bae662de9c8825bbeeb/tests/Sequential.hs
haskell
| Tests for sequential sort of messages. Sequential with an arbitrary start point that gets the rank from the An arbitrary list of messages... ... ranked from our arbitrary start... ... in an arbitrary order. Insert them all. Pull them all out.
module Sequential (tests) where import Protolude import Hedgehog (forAll, property, (===)) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import Test.Tasty (TestTree, testGroup) import Test.Tasty.Hedgehog (testProperty) import qualified MagicWormhole.Internal.Sequential as Sequential ...
9e2c9b0d020fe7270b9767116285fca356b8d244293cda7d6474ed54dfb1ead9
w3ntao/sicp-solution
2-31.rkt
#lang racket (define (square-tree tree) (tree-map square tree)) (define (square x) (* x x)) (define (tree-map f tree) (map (lambda (x) (if (pair? x) (tree-map f x) (f x))) tree)) (define test-case (list 1 (list 2 (list 3 4) 5) ...
null
https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-2/2-31.rkt
racket
#lang racket (define (square-tree tree) (tree-map square tree)) (define (square x) (* x x)) (define (tree-map f tree) (map (lambda (x) (if (pair? x) (tree-map f x) (f x))) tree)) (define test-case (list 1 (list 2 (list 3 4) 5) ...
153a98f76d54825f5e3750b6767e09db501544a85a385c9e1ebaeafa12bd8e5a
GaloisInc/parameterized-utils
Classes.hs
| Description : Classes for working with type of kind @k - > * @ Copyright : ( c ) Galois , Inc 2014 - 2019 Maintainer : < > This module declares classes for working with types with the kind @k - > * @ for any kind @k@. These are generalizations of the " Data . Functor . Classes " types as they w...
null
https://raw.githubusercontent.com/GaloisInc/parameterized-utils/1b2073d49f29b53454dda1f7abe51b762a8d1eda/src/Data/Parameterized/Classes.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # # LANGUAGE Safe # * Equality exports * Ordering generalization * Type function application constructor * Optics generalizations * Re-exports checking. ---------------------------------------------------------------------- CoercibleF | An instance of 'CoercibleF' gives ...
| Description : Classes for working with type of kind @k - > * @ Copyright : ( c ) Galois , Inc 2014 - 2019 Maintainer : < > This module declares classes for working with types with the kind @k - > * @ for any kind @k@. These are generalizations of the " Data . Functor . Classes " types as they w...
4ae9c84c03ce8596cfe256b34491adba42751ab9d2f0558d4efab66ef6301829
ocurrent/opam-health-check
json.mli
val pkgs_to_json : Intf.Pkg.t list -> Yojson.Safe.t
null
https://raw.githubusercontent.com/ocurrent/opam-health-check/7ed76095b10cbb49519740ee1cfe3acc31298202/server/lib/json.mli
ocaml
val pkgs_to_json : Intf.Pkg.t list -> Yojson.Safe.t
e639c2b740dd5e457c07e6ccb17fa8d082b2b81e7a70abecf9b650c4b984248b
facebook/pyre-check
taintTransforms.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/pyre-check/83be58c61b14dd0812e07a75bdbff756d57db47c/source/interprocedural_analyses/taint/taintTransforms.ml
ocaml
TaintTransforms: defines a list of taint transforms, as well as basic * operations on them. See transform operations in `TaintTransformOperation` * for the actual logic that applies transforms on taint. A:B:C represents the transforms for x in `x = A(B(C(taint)))` A:B:C represents the transforms for x in `taint ...
* 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...
eb2d211931e882f6c3f30e99f68349f8d39949178555686c3e0800ce7d8c2457
athos/Bigmouth
project.clj
(defproject bigmouth "0.1.0-SNAPSHOT" :description "Clojure framework to build delivery-only Mastodon-compatible web apps" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [clojure-future-spec "1.9.0-alpha17"] ...
null
https://raw.githubusercontent.com/athos/Bigmouth/d7a43cc0317175eabb3be22a1211caf34011eb2e/project.clj
clojure
(defproject bigmouth "0.1.0-SNAPSHOT" :description "Clojure framework to build delivery-only Mastodon-compatible web apps" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] [clojure-future-spec "1.9.0-alpha17"] ...
9cb302f62d37790e64d6ded8345471af1e3aa1a6e6c14ab2eb7eaab1923d305c
racket/typed-racket
channel-contract.rkt
#lang racket/load ;; Test typed-untyped interaction with channels (module typed typed/racket/shallow (: ch (Channelof (Boxof Integer))) (define ch (make-channel)) (: putter (-> Thread)) (define (putter) (thread (λ () (channel-put ch (box 3))))) (provide putter ch)) (require 'typed) (putter) (set-box! (...
null
https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/channel-contract.rkt
racket
Test typed-untyped interaction with channels
#lang racket/load (module typed typed/racket/shallow (: ch (Channelof (Boxof Integer))) (define ch (make-channel)) (: putter (-> Thread)) (define (putter) (thread (λ () (channel-put ch (box 3))))) (provide putter ch)) (require 'typed) (putter) (set-box! (channel-get ch) "not an integer")
6adecdda839bf8298ddf967486ce759f7814290d8fc219c0ef5ca664d7c91229
charlesrosenbauer/Bzo-Compiler
BzoFileSorter.hs
This is the bootstrapping compiler for the Bzo programming language . Copyright ( C ) 2020 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 yo...
null
https://raw.githubusercontent.com/charlesrosenbauer/Bzo-Compiler/08aed007aaabaa676996b7c7be05baed42a12e64/src/BzoFileSorter.hs
haskell
This is the bootstrapping compiler for the Bzo programming language . Copyright ( C ) 2020 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 yo...
be8fa6462d55ce1a6fff6ab3e8c59ea17dbd29df8a8efda8d59de048be23ac68
lloda/guile-newra
maxwell.scm
-*- mode : scheme ; coding : utf-8 -*- ( c ) 2019 ; This library 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 version. ;;; Comme...
null
https://raw.githubusercontent.com/lloda/guile-newra/fa42f1b6039f39286a16aab4ee50deeec7b31d38/examples/maxwell.scm
scheme
coding : utf-8 -*- This library is free software; you can redistribute it and/or modify it under either version 3 of the License , or ( at your option ) any later version. Commentary: FIXME Redo with lazy ops. Code: transpose/untranspose isn't convenient here :-\
( c ) 2019 the terms of the GNU General Public License as published by the Free 4 - vector potential vacuum field equations Version of ' Maxwell ' from Chaitin 1986 , Physics in APL2 , p.20 , to demo guile - newra . (import (newra) (srfi 64) (ice-9 format) (only (srfi 43) vector-swap!) (on...
05cc2eedd5d0def66b40988e791f0058dacc9767ed971b5f2c24457a47c3cf7f
maximedenes/native-coq
record.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/toplevel/record.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** * [declare_projections ref name coer...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Names open Term open Sig...
e113fb50d76e88a06cb1eeed3b8c9ceac187f65bed1d89d7b3d5c7447ea28186
hypernumbers/LuvvieScript
make_tests.erl
@author ( C ) 2013 , %%% @doc This script makes common test suites %%% %%% @end Created : 15 Aug 2013 by -module(make_tests). -export([ make_tests/2 ]). -define(JSDIR, "js/"). -define(TESTDIRS, ["test/passing"]). make_tests(_Config, AppFile) -> App = filename:basena...
null
https://raw.githubusercontent.com/hypernumbers/LuvvieScript/d10da50e0719ff26690749570c75e1e614214381/priv/rebar_plugins/make_tests.erl
erlang
@doc This script makes common test suites @end
@author ( C ) 2013 , Created : 15 Aug 2013 by -module(make_tests). -export([ make_tests/2 ]). -define(JSDIR, "js/"). -define(TESTDIRS, ["test/passing"]). make_tests(_Config, AppFile) -> App = filename:basename(AppFile), case App of "luvviescript.app.src" -> ...
2fbea3dc7195bc86010493bbed4f015f6688eef53cb03a3665cd63e051589f44
jpmonettas/clindex
api_test.clj
(ns clindex.api-test (:require [clindex.api :as api] [clojure.test :refer [deftest testing is use-fixtures]] [datascript.core :as d] [clojure.java.io :as io] [clojure.spec.test.alpha :as stest] [expound.alpha :as expound] [clojure.spec.alpha :as ...
null
https://raw.githubusercontent.com/jpmonettas/clindex/77097d80a23aa85d2ff50e55645a1452f2dcb3c0/test/clindex/api_test.clj
clojure
too big to run specs, takes forever
(ns clindex.api-test (:require [clindex.api :as api] [clojure.test :refer [deftest testing is use-fixtures]] [datascript.core :as d] [clojure.java.io :as io] [clojure.spec.test.alpha :as stest] [expound.alpha :as expound] [clojure.spec.alpha :as ...
7845cd3e965e758aab01ca211bf3157592611f90bae660f8a33c8581f5bf02cb
adamwalker/clash-utils
CarrySaveSpec.hs
module Arithmetic.CarrySaveSpec where import qualified Clash.Prelude as Clash import Clash.Prelude (Signal, Vec(..), BitVector, Index, Signed, Unsigned, SFixed, Bit, SNat(..), simulate, simulate_lazy, listToVecTH, KnownNat, pack, unpack, (++#), mealy, mux, bundle, unbundle, ...
null
https://raw.githubusercontent.com/adamwalker/clash-utils/96dbb94db9c2502687a6b909f8f6ff89da7c1eeb/tests/Arithmetic/CarrySaveSpec.hs
haskell
Misc
module Arithmetic.CarrySaveSpec where import qualified Clash.Prelude as Clash import Clash.Prelude (Signal, Vec(..), BitVector, Index, Signed, Unsigned, SFixed, Bit, SNat(..), simulate, simulate_lazy, listToVecTH, KnownNat, pack, unpack, (++#), mealy, mux, bundle, unbundle, ...
0017b7ab48761988c98831494a5dbc588e0d3ce294356df3324295e648044148
ocsigen/js_of_ocaml
dom_html.ml
Js_of_ocaml library * / * Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot * * 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 ...
null
https://raw.githubusercontent.com/ocsigen/js_of_ocaml/e9701a478abb21c73734a881fa0733d961ae15fe/lib/js_of_ocaml/dom_html.ml
ocaml
All modern browsers only features supported by all browser. (IE9+) * Information on current selection The toplevel object ** ** XXX Should provide creation functions a la lablgtk... ** *** Alphabetic Characters Digits Editing Misc Printable Function keys Modifier keys Sound Media Browser spe...
Js_of_ocaml library * / * Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot * * 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 ...
09b7dd5532b5e6c9c93435f8aa4231563a8e1b54e99c36becffa0abf9522c9dd
markbastian/partsbin
core.clj
(ns partsbin.core "A variant of the reloaded system idea. However, in this case the system is captured in an atom instead of a dynamic var. This makes it more flexible and easy to have multiple independent systems if needed." (:require [integrant.core :as ig])) (defprotocol IGSys (system [this]) (config [thi...
null
https://raw.githubusercontent.com/markbastian/partsbin/8dc159327f296c9625d129b5943ec79433019e54/src/partsbin/core.clj
clojure
(ns partsbin.core "A variant of the reloaded system idea. However, in this case the system is captured in an atom instead of a dynamic var. This makes it more flexible and easy to have multiple independent systems if needed." (:require [integrant.core :as ig])) (defprotocol IGSys (system [this]) (config [thi...
87b117cdb49590380026f95e4c544fffaf172b9e6bcb60d6caf1fa717beea62e
janestreet/krb
cred_cache.mli
open! Core open! Async open! Import * @inline * Return number of active credential renewal loops , as started by calls to [ keep_valid_indefintely ] . Note that it avoids creating a new loop for credentials that are already being renewed , even if [ keep_valid_indefinitely ] is called multiple times ...
null
https://raw.githubusercontent.com/janestreet/krb/96feb2c8721bc0e33e87fd4ed7c0839d3b0f51f8/src/cred_cache.mli
ocaml
open! Core open! Async open! Import * @inline * Return number of active credential renewal loops , as started by calls to [ keep_valid_indefintely ] . Note that it avoids creating a new loop for credentials that are already being renewed , even if [ keep_valid_indefinitely ] is called multiple times ...
5d17f7645e6675968306c35b95d8b2079ceb4c02c0b87540f5eb1441b88ba590
bodil/BODOL
lambda.clj
(ns bodol.lambda (:require [clojure.core.match :refer [match]] [clojure.string :as string] [bodol.types :as t] [bodol.match :refer [find-match]] [bodol.error :as err])) (def ^:private alphabet "abcdefghijklmnopqrstuvwxyz") (defn gen-args [num] (map str (take num alp...
null
https://raw.githubusercontent.com/bodil/BODOL/ed00ab59a91a19da4d70ff5488c90ffad04904c6/src/bodol/lambda.clj
clojure
(ns bodol.lambda (:require [clojure.core.match :refer [match]] [clojure.string :as string] [bodol.types :as t] [bodol.match :refer [find-match]] [bodol.error :as err])) (def ^:private alphabet "abcdefghijklmnopqrstuvwxyz") (defn gen-args [num] (map str (take num alp...
bf7d4f0e29de7a7aa1cbaa2d2f7831559c1fc561585cb0410d464866ad26018c
atgreen/lisp-openshift
conditions.lisp
;;;; conditions.lisp -- various error conditions (in-package :ironclad) (define-condition ironclad-error (simple-error) ()) (define-condition key-not-supplied (ironclad-error) ((cipher :initarg :cipher :reader cipher)) (:report (lambda (condition stream) (format stream "Cipher ~A requires a key" (...
null
https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/ironclad_0.30/src/conditions.lisp
lisp
conditions.lisp -- various error conditions
(in-package :ironclad) (define-condition ironclad-error (simple-error) ()) (define-condition key-not-supplied (ironclad-error) ((cipher :initarg :cipher :reader cipher)) (:report (lambda (condition stream) (format stream "Cipher ~A requires a key" (cipher condition)))) (:documentation "Signaled ...
d67bfddbc24037657cf13beebd02071db9f03a530ea51704da0f37bfb1c77e24
TakaiKinoko/Cornell_CS3110_OCaml
09_12_16char_map.ml
module CharMap = Map.Make (Char) * 9 . val empty : ' a t val add : key - > ' a - > ' a t - > ' a t val remove : key - > ' a t - > ' a t val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val remove : key -> 'a t -> 'a t *) * 10 . type has val compare : t - > t - > int defined i...
null
https://raw.githubusercontent.com/TakaiKinoko/Cornell_CS3110_OCaml/0a830bc50a5e39f010074dc289161426294cad1d/Chap5_Modules/08exercises/09_12_16char_map.ml
ocaml
module CharMap = Map.Make (Char) * 9 . val empty : ' a t val add : key - > ' a - > ' a t - > ' a t val remove : key - > ' a t - > ' a t val empty : 'a t val add : key -> 'a -> 'a t -> 'a t val remove : key -> 'a t -> 'a t *) * 10 . type has val compare : t - > t - > int defined i...
1069e083f103d690f3a7f8862439b7bc25a942aa7911edf056a67139dfdbf4ca
dgtized/shimmers
overlapping_polygons.cljs
(ns shimmers.sketches.overlapping-polygons (:require [quil.core :as q :include-macros true] [quil.middleware :as m] [shimmers.common.framerate :as framerate] [shimmers.common.quil :as cq] [shimmers.common.quil-draws-geom :as qdg] [shimmers.math.geometry.group :as gg] [shimmers.sketch :as sketch :...
null
https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/overlapping_polygons.cljs
clojure
bracketing polygons, or for the circle/square the intersection, and then pacman and remainder of the square. Possibly algorithms Can we detect the arc segment and keep that as an arc instead of using small lines Note this *only* works for convex polygons, weird results otherwise
(ns shimmers.sketches.overlapping-polygons (:require [quil.core :as q :include-macros true] [quil.middleware :as m] [shimmers.common.framerate :as framerate] [shimmers.common.quil :as cq] [shimmers.common.quil-draws-geom :as qdg] [shimmers.math.geometry.group :as gg] [shimmers.sketch :as sketch :...
846e39f37e656d8d6ab4fb91b8c99b7effbb88ae578579ed89174a433bfb7190
noinia/hgeometry
Internal.hs
# LANGUAGE TemplateHaskell # -------------------------------------------------------------------------------- -- | -- Module : Geometry.Arrangement.Internal Copyright : ( C ) -- License : see the LICENSE file Maintainer : -- -- Data type for representing an Arrangement of lines in \(\mathbb{...
null
https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Geometry/Arrangement/Internal.hs
haskell
------------------------------------------------------------------------------ | Module : Geometry.Arrangement.Internal License : see the LICENSE file Data type for representing an Arrangement of lines in \(\mathbb{R}^2\). ------------------------------------------------------------------------------ -...
# LANGUAGE TemplateHaskell # Copyright : ( C ) Maintainer : module Geometry.Arrangement.Internal where import Algorithms.BinarySearch import Control.Lens import Data.Bifunctor import qualified Data.CircularSeq as CSeq import Data.Ext import qualif...
f91e4ce3bad1b667d9237b8c3bfc3cbec78c8c5ad4e1f8bff6fccbeed2fb12f1
anthonygalea/riemann-console
events.cljs
(ns riemann-console.events (:require-macros [cljs.core.async.macros :refer [go]]) (:require [ajax.core :as ajax] [amalloy.ring-buffer :as ring-buffer] [clojure.string :as string] [cljs.core.async :as a :refer [<! >!]] [cognitect.transit :as t] [goog.string :as gstring] [day8.re-frame.http-fx] ...
null
https://raw.githubusercontent.com/anthonygalea/riemann-console/d4eb21bbde8b191f6a4d853a3b14d370b9fc0761/src/cljs/riemann_console/events.cljs
clojure
event streaming
(ns riemann-console.events (:require-macros [cljs.core.async.macros :refer [go]]) (:require [ajax.core :as ajax] [amalloy.ring-buffer :as ring-buffer] [clojure.string :as string] [cljs.core.async :as a :refer [<! >!]] [cognitect.transit :as t] [goog.string :as gstring] [day8.re-frame.http-fx] ...
472a8d07eb8ab577cf01a590637b40990047aa64915ce804131f5b9a1074db57
shayan-najd/NativeMetaprogramming
TcRun038_B.hs
# LANGUAGE FlexibleContexts # module TcRun038_B where class Foo a where op :: a -> Int -- Note the (Foo Int) constraint here; and the fact that there is no ( ) instance in this module -- It's in the importing module! bar :: Foo Int => Int -> Int bar x = op x + 7
null
https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/typecheck/should_run/TcRun038_B.hs
haskell
Note the (Foo Int) constraint here; and the fact It's in the importing module!
# LANGUAGE FlexibleContexts # module TcRun038_B where class Foo a where op :: a -> Int that there is no ( ) instance in this module bar :: Foo Int => Int -> Int bar x = op x + 7
7ee8be1c7137506034f3b64ae47ccc486ad0df4e3427b1335a5a96f9780dc774
robert-strandh/SICL
instruction.lisp
(cl:in-package #:cleavir-ir) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Instructions. (defgeneric inputs (instruction)) (defgeneric (setf inputs) (new-inputs instruction)) (defmethod (setf inputs) :before (new-inputs instruction) (assert (listp new-inputs)) (assert (every (la...
null
https://raw.githubusercontent.com/robert-strandh/SICL/bd3ec8f991d9455541d1629a3c672ae3d46dc16d/Code/Cleavir/Intermediate-representation/instruction.lisp
lisp
Instructions. Remove this instruction as a using instruction from the existing inputs. Add this instruction as a using instruction to the new inputs. common, so we provide a function for it. Both for cleanliness and efficiency. bypass the accessor to avoid the above methods. Now maintain consistency. Remove ...
(cl:in-package #:cleavir-ir) (defgeneric inputs (instruction)) (defgeneric (setf inputs) (new-inputs instruction)) (defmethod (setf inputs) :before (new-inputs instruction) (assert (listp new-inputs)) (assert (every (lambda (input) (typep input 'datum)) new-inputs)) (loop for input in (inputs instruction) ...
a4ad14057f59e473fd3c0b59f505b40b814313cb52f5136c8fbae74edaac46e1
stchang/graph
info.rkt
#lang setup/infotab (define scribblings '(("scribblings/graph.scrbl" ())))
null
https://raw.githubusercontent.com/stchang/graph/0ff9a1934f4421c53ec4b71cb48d54a6ad86c7b9/graph-doc/graph/info.rkt
racket
#lang setup/infotab (define scribblings '(("scribblings/graph.scrbl" ())))
401a99637b019c8273608fc5100a87e70d8fac10c7a60dbc0ca28de4dc535ccd
replikativ/datahike-frontend
schema.cljs
(ns app.dashboard.ui.queries.schema (:require [com.fulcrologic.fulcro.components :as comp :refer [defsc]] [com.fulcrologic.fulcro.dom :as dom :refer [div ul li p h3 button b table thead tr th td tbody]])) ;; TODO: BUG: when sreen width is too small, it is no longer possible to click on the 'schema' and 'Dato...
null
https://raw.githubusercontent.com/replikativ/datahike-frontend/6e3ab3bb761b41c4ffea792297286f8942a27909/src/main/app/dashboard/ui/queries/schema.cljs
clojure
TODO: BUG: when sreen width is too small, it is no longer possible to click on the 'schema' and 'Datoms' link. TODO: 'when' because the input from db contains some entries without a :db/ident. Fix this later.
(ns app.dashboard.ui.queries.schema (:require [com.fulcrologic.fulcro.components :as comp :refer [defsc]] [com.fulcrologic.fulcro.dom :as dom :refer [div ul li p h3 button b table thead tr th td tbody]])) (defsc Schema [this {:schema/keys [id elements] :as props}] {:query [:schema/id :schema/elements] :...
926d9f8092f08f0b20537b4aee42f03320e236e4dbe46de5b360a495a31fc100
juxt/tick
app.clj
(ns tick.docs.app (:require [cljs.env :as env])) (defmacro analyzer-state [[_ ns-sym]] `'~(get-in @env/*compiler* [:cljs.analyzer/namespaces ns-sym]))
null
https://raw.githubusercontent.com/juxt/tick/4438103d96e00927f777229bc22576bf4fd6c901/docs/src/tick/docs/app.clj
clojure
(ns tick.docs.app (:require [cljs.env :as env])) (defmacro analyzer-state [[_ ns-sym]] `'~(get-in @env/*compiler* [:cljs.analyzer/namespaces ns-sym]))
19943a4c22885b3a18cf4b18d30469c4d0eb8024dada3b1cd486f26a8fb33033
racket/typed-racket
make-predicate-top-level.rkt
#lang racket/load (require typed/racket/shallow) (: f (Any -> Boolean : Number)) (define f (make-predicate Number)) (: g (Listof Number)) (define g (filter f '(1 2 3 4 "5")))
null
https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/make-predicate-top-level.rkt
racket
#lang racket/load (require typed/racket/shallow) (: f (Any -> Boolean : Number)) (define f (make-predicate Number)) (: g (Listof Number)) (define g (filter f '(1 2 3 4 "5")))
4020f2f03e5eebfd8e8226cfd51561f255006eb176e0cd9cc9a0235a7a01273c
grzm/awyeah-api
ec2_metadata_utils.clj
Copyright ( c ) Cognitect , Inc. ;; All rights reserved. (ns ^:skip-wiki com.grzm.awyeah.ec2-metadata-utils "Impl, don't call directly" (:require [clojure.core.async :as a] [clojure.string :as str] [com.grzm.awyeah.http :as http] [com.grzm.awyeah.json :as json] [com.grzm.awyeah.retry :as retry] ...
null
https://raw.githubusercontent.com/grzm/awyeah-api/1810bf624da2be58c77813106a1d51e32db11690/src/com/grzm/awyeah/ec2_metadata_utils.clj
clojure
All rights reserved. TODO: handle unhappy paths -JS
Copyright ( c ) Cognitect , Inc. (ns ^:skip-wiki com.grzm.awyeah.ec2-metadata-utils "Impl, don't call directly" (:require [clojure.core.async :as a] [clojure.string :as str] [com.grzm.awyeah.http :as http] [com.grzm.awyeah.json :as json] [com.grzm.awyeah.retry :as retry] [com.grzm.awyeah.util :...
f74366c996eaa83c2718e83444130797a8ef244070193aa91222ed2adf274c52
jordanthayer/ocaml-search
nom_by_nom.ml
* Nominal by nominal plots . @author eaburns @since 2010 - 05 - 10 @author eaburns @since 2010-05-10 *)
null
https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/spt/src/nom_by_nom.ml
ocaml
* Nominal by nominal plots . @author eaburns @since 2010 - 05 - 10 @author eaburns @since 2010-05-10 *)
7ced0110a9372592edb7d648b3ddf4a7c467744d9eec9ba1b42fdd1c6836e0c1
8c6794b6/guile-tjit
t-nest-21.scm
;; Nested loop. Passing returned value from scheme procedure `add2' in ;; outer loop to inner loop. (define (loop1 n) (let lp ((n n) (acc 0)) (if (= n 0) acc (lp (- n 1) (+ acc n))))) (define (add2 n) (+ n 2)) (define (loop2 n) (let lp ((n n) (acc 0)) (if (= n 0) acc (lp...
null
https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/t-nest-21.scm
scheme
Nested loop. Passing returned value from scheme procedure `add2' in outer loop to inner loop.
(define (loop1 n) (let lp ((n n) (acc 0)) (if (= n 0) acc (lp (- n 1) (+ acc n))))) (define (add2 n) (+ n 2)) (define (loop2 n) (let lp ((n n) (acc 0)) (if (= n 0) acc (lp (- n 1) (+ acc (loop1 (add2 n))))))) (loop2 #e1e4)
2bc1c176aafccac65440701899b3ae67b64f29e7d48c37a38287024f98b59761
wireapp/wire-server
ServiceRef_provider.hs
-- This file is part of the Wire Server implementation. -- Copyright ( C ) 2022 Wire Swiss GmbH < > -- -- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License...
null
https://raw.githubusercontent.com/wireapp/wire-server/c428355b7683b7b7722ea544eba314fc843ad8fa/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ServiceRef_provider.hs
haskell
This file is part of the Wire Server implementation. This program is free software: you can redistribute it and/or modify it under later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTI...
Copyright ( C ) 2022 Wire Swiss GmbH < > the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any You should have received a copy of the GNU Affero General Public License along module Test.Wire.API.Golden.Gene...
c995c51859f3b62d9479501892bc9ee5478b248b482186e457761e64887c67e8
Dimercel/listopia
listopia.lisp
(defpackage :listopia (:use :cl) (:export :head :last :tail :init :uncons ;; List transformations :map :intersperse :intercalate ;; Reducing lists (folds) :foldl :foldl1 :foldr ...
null
https://raw.githubusercontent.com/Dimercel/listopia/2d2a1a3c35580252ca0085e15ebf625f73230d60/src/listopia.lisp
lisp
List transformations Reducing lists (folds) Special folds Building lists Scans Accumulating maps Infinite lists Unfolding Sublists Extracting sublists Predicates Searching lists Searching by equality Searching with a predicate Indexing lists Zipping and unzipping lists Laziness Basic functions List t...
(defpackage :listopia (:use :cl) (:export :head :last :tail :init :uncons :map :intersperse :intercalate :foldl :foldl1 :foldr :foldr1 :concat :concat-map :and...
3df93e25ccf9fa7b95182cb5570da4ae866cee649cc247904a8884ebd1c060e4
acw/eve
MapJumps.hs
{-# LANGUAGE OverloadedStrings #-} module EVE.API.XML.MapJumps( parse ) where import EVE.API.XML.Helpers(cachedFetcher) import Text.Read(readMaybe) import Text.XML.Light(Element, findElements, findAttr) readJumpInfo :: Element -> Maybe [(Word, Word)] readJumpInfo el = sequence $ map parseRow (findEle...
null
https://raw.githubusercontent.com/acw/eve/95c3a158e181e9708c2f3b5d998512bbc1b06e57/src/EVE/API/XML/MapJumps.hs
haskell
# LANGUAGE OverloadedStrings #
module EVE.API.XML.MapJumps( parse ) where import EVE.API.XML.Helpers(cachedFetcher) import Text.Read(readMaybe) import Text.XML.Light(Element, findElements, findAttr) readJumpInfo :: Element -> Maybe [(Word, Word)] readJumpInfo el = sequence $ map parseRow (findElements "row" el) where parseRow x...
7f87dee979e079590591e08aff5823cc327127eec55e0ec60cb689ead42b05d7
jfeser/castor
prim_type.mli
type t = | NullT | IntT of { nullable : bool } | DateT of { nullable : bool } | FixedT of { nullable : bool } | StringT of { nullable : bool; padded : bool } | BoolT of { nullable : bool } | TupleT of t list | VoidT [@@deriving compare, equal, hash, sexp] val pp : Format.formatter -> t -> unit val null...
null
https://raw.githubusercontent.com/jfeser/castor/39005df41a094fee816e85c4c673bfdb223139f7/lib/prim_type.mli
ocaml
type t = | NullT | IntT of { nullable : bool } | DateT of { nullable : bool } | FixedT of { nullable : bool } | StringT of { nullable : bool; padded : bool } | BoolT of { nullable : bool } | TupleT of t list | VoidT [@@deriving compare, equal, hash, sexp] val pp : Format.formatter -> t -> unit val null...
423331ac19feead25fd7c0887e5e9a144101a7a09ba522a8de37ca08fd63ced6
erlang/rebar3
rebar_compiler_dag_SUITE.erl
-module(rebar_compiler_dag_SUITE). -compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -include_lib("kernel/include/file.hrl"). all() -> [exists, {group, with_project}, prune_preserve_artifacts]. groups() -> %% The tests in this grou...
null
https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/test/rebar_compiler_dag_SUITE.erl
erlang
The tests in this group are dirty, the order is specific and required across runs for tests to work. ensure it is loaded assume an empty graph All timestamps are the same since we just created the thing assume an empty graph assume an empty graph All timestamps are the same since we just created the thing assu...
-module(rebar_compiler_dag_SUITE). -compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -include_lib("kernel/include/file.hrl"). all() -> [exists, {group, with_project}, prune_preserve_artifacts]. groups() -> [{with_project, [sequence...
caf58326de24431465a46e1afc6d413ffd6c6064f9007749919f94f396436d77
input-output-hk/cardano-wallet
StoreSpec.hs
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # module Cardano.Wallet.DB.Store.Wallets.StoreSpec ( spec , genDeltaTxWallets ) where import Prelude import Cardano.DB.Sqlite ( ForeignKeysSetting (..) ) import Cardano.Wallet.DB.Arbitrary ...
null
https://raw.githubusercontent.com/input-output-hk/cardano-wallet/cf96cdebe256cb3c60f43648e125974075a8f382/lib/wallet/test/unit/Cardano/Wallet/DB/Store/Wallets/StoreSpec.hs
haskell
# LANGUAGE RankNTypes #
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # module Cardano.Wallet.DB.Store.Wallets.StoreSpec ( spec , genDeltaTxWallets ) where import Prelude import Cardano.DB.Sqlite ( ForeignKeysSetting (..) ) import Cardano.Wallet.DB.Arbitrary () import Cardano.Wallet...
bb833c046704915c26c43f4f375dcc4141de5a29e9e8f6604a27be7d0e95a0e3
rabbitmq/erlando
list_m.erl
The contents of this file are subject to the Mozilla Public License %% Version 1.1 (the "License"); you may not use this file except in %% compliance with the License. You may obtain a copy of the License %% at / %% Software distributed under the License is distributed on an " AS IS " %% basis, WITHOUT WARRANTY OF ...
null
https://raw.githubusercontent.com/rabbitmq/erlando/1c1ef25a9bc228671b32b4a6ee30c7525314b1fd/src/list_m.erl
erlang
Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at / basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Note that using...
The contents of this file are subject to the Mozilla Public License Software distributed under the License is distributed on an " AS IS " The Original Code is Erlando . The Initial Developer of the Original Code is VMware , Inc. Copyright ( c ) 2011 - 2013 VMware , Inc. All rights reserved . List Monad ....
dba264e89210308a6075e87403a091400959574893e7bc6b545186ce55a8e675
opencog/learn
count-links.scm
; ; count-links.scm ; ; --------------------------------------------------------------------- ; Link-counting utilities. ; ; If a pseudo-connector needs to be promoted to a real connector, ; i.e. a real link with a direction on it, then how many real links are there in a dataset ? The three functions below count them...
null
https://raw.githubusercontent.com/opencog/learn/c599c856f59c1815b92520bee043c588d0d1ebf9/learn-lang-diary/utils/count-links.scm
scheme
count-links.scm --------------------------------------------------------------------- Link-counting utilities. If a pseudo-connector needs to be promoted to a real connector, i.e. a real link with a direction on it, then how many real links Warning; the last one is very very slow. All functions expect a word...
are there in a dataset ? The three functions below count them . i.e. ( define pca ( make - pseudo - cset - api ) ) (use-modules (ice-9 threads)) the left or to the right . WORD - LST should be a list of WordNodes . This just gets the two connectors that WordNode might appear in , and then counts the number o...
bacf04c916ae26967686811ced61499fe6cbf3a9354b952d3a5cd01eb31d8908
synrc/nitro
element_col.erl
-module(element_col). -author('Vladimir Galunshchikov'). -include_lib("nitro/include/nitro.hrl"). -compile(export_all). render_element(Record) when Record#col.show_if==false -> [<<>>]; render_element(Record) -> List = [ %global {<<"accesskey">>, Record#col.accesskey}, {<<"class">>, Record#col.cla...
null
https://raw.githubusercontent.com/synrc/nitro/753b543626add2c014584546ec50870808a2eb90/src/elements/table/element_col.erl
erlang
global spec
-module(element_col). -author('Vladimir Galunshchikov'). -include_lib("nitro/include/nitro.hrl"). -compile(export_all). render_element(Record) when Record#col.show_if==false -> [<<>>]; render_element(Record) -> List = [ {<<"accesskey">>, Record#col.accesskey}, {<<"class">>, Record#col.class}, {<<...
92687f49d9d04b12c9fcec4a55129cda7951779aa48d92f7c931ca02ce90426f
threatgrid/ctia
schemas.clj
(ns ctia.flows.hooks-service.schemas (:require [ctia.flows.hook-protocol :refer [Hook]] [schema.core :as s])) (s/defschema HookType (s/enum :before-create :after-create :before-update :after-update :before-delete :after-delete :event)) (s/def...
null
https://raw.githubusercontent.com/threatgrid/ctia/32857663cdd7ac385161103dbafa8dc4f98febf0/src/ctia/flows/hooks_service/schemas.clj
clojure
(ns ctia.flows.hooks-service.schemas (:require [ctia.flows.hook-protocol :refer [Hook]] [schema.core :as s])) (s/defschema HookType (s/enum :before-create :after-create :before-update :after-update :before-delete :after-delete :event)) (s/def...
46be64c31135bb3df0836b77f4a50feeafb26a620466448d4a22ace4fece5255
sonyxperiadev/dataflow
JSONGraphFormat.hs
{-# LANGUAGE OverloadedStrings #-} module DataFlow.JSONGraphFormat ( Val(..), Metadata(), Document(..), Graph(..), Node(..), Edge(..) ) where import Data.Aeson import Data.Aeson.Types (Pair) import qualified Data.Map as M import Data.Vector (fromList) data Val ...
null
https://raw.githubusercontent.com/sonyxperiadev/dataflow/8bef5bd6bf96a918197e66ad9d675ff8cd2a4e33/src/DataFlow/JSONGraphFormat.hs
haskell
# LANGUAGE OverloadedStrings #
module DataFlow.JSONGraphFormat ( Val(..), Metadata(), Document(..), Graph(..), Node(..), Edge(..) ) where import Data.Aeson import Data.Aeson.Types (Pair) import qualified Data.Map as M import Data.Vector (fromList) data Val = Str String | Arr [Val] ...
c4d6655dbef442ed6fda75c1c0fca6889bbfc6fa97d5d6860dc06dbcc9209bb2
c-cube/stimsym
Subst.ml
(* This file is free software. See file "license" for more details. *) * { 1 Substitutions } open Base_types module E = Expr module IntMap = CCMap.Make(CCInt) module Fmt = CCFormat type t = expr IntMap.t let empty = IntMap.empty let is_empty = IntMap.is_empty let add = IntMap.add let mem = IntMap.mem let get = Int...
null
https://raw.githubusercontent.com/c-cube/stimsym/38c744b5f770b52980abbfe7636a0dc2b91bbeb7/src/core/Subst.ml
ocaml
This file is free software. See file "license" for more details.
* { 1 Substitutions } open Base_types module E = Expr module IntMap = CCMap.Make(CCInt) module Fmt = CCFormat type t = expr IntMap.t let empty = IntMap.empty let is_empty = IntMap.is_empty let add = IntMap.add let mem = IntMap.mem let get = IntMap.get let pp out (s:t) = Format.fprintf out "{@[<hv>%a@]}" (In...
762297435f1fc305d3ec304d6aff1b00c4e91c2af5a1265e56b8e5656157ab4a
tek/polysemy-hasql
JsonTest.hs
module Polysemy.Hasql.Test.Tree.JsonTest where import qualified Data.Aeson as Aeson import Exon (exon) import Polysemy.Db.Data.Partial (partial) import Polysemy.Db.Tree.Data.PartialPayload ( PartialPayload, decodePartialPayload, decodePartialPayloadTree, partialPayload, ) import Polysemy.Db.Tree.Partial (Par...
null
https://raw.githubusercontent.com/tek/polysemy-hasql/7dfe6831efa05f92b24fa4cef8760e13f795495f/packages/hasql/test/Polysemy/Hasql/Test/Tree/JsonTest.hs
haskell
module Polysemy.Hasql.Test.Tree.JsonTest where import qualified Data.Aeson as Aeson import Exon (exon) import Polysemy.Db.Data.Partial (partial) import Polysemy.Db.Tree.Data.PartialPayload ( PartialPayload, decodePartialPayload, decodePartialPayloadTree, partialPayload, ) import Polysemy.Db.Tree.Partial (Par...
24f9d8814cb63045bc55a6e2c1e9bd388937d0d28662b9a5c4e68a1dbcffe8c8
mkcp/raft-consensus
request_vote.clj
(ns raft.request-vote (:require [clojure.spec :as s])) (defn higher-term? [local remote] (< local remote)) ;; TODO Def spec (defn request-vote [message {:keys [id current-term]}] [:request-vote {:from id :to (:id message) :term current-term :last-log-inde...
null
https://raw.githubusercontent.com/mkcp/raft-consensus/575cc831d3861ae415e372bd6c15ab067b683471/src/raft/request_vote.clj
clojure
TODO Def spec TODO Def spec
(ns raft.request-vote (:require [clojure.spec :as s])) (defn higher-term? [local remote] (< local remote)) (defn request-vote [message {:keys [id current-term]}] [:request-vote {:from id :to (:id message) :term current-term :last-log-index :todo-last-log-...
01a4e4ebe11aeddce1bf0a6461897cf6338ed960950fb3182a93d8fce4a96aa3
nedap/formatting-stack
pretty_printer.clj
(ns formatting-stack.reporters.pretty-printer "Prints an optionally colorized, indented, possibly truncated output of the reports." (:require [clojure.stacktrace :refer [print-stack-trace]] [formatting-stack.protocols.reporter :as reporter] [formatting-stack.protocols.spec :as protocols.spec] [formattin...
null
https://raw.githubusercontent.com/nedap/formatting-stack/c43e74d5409e9338f208457bb8928ce437381a3f/src/formatting_stack/reporters/pretty_printer.clj
clojure
print summary in order sort filenames for consistent output
(ns formatting-stack.reporters.pretty-printer "Prints an optionally colorized, indented, possibly truncated output of the reports." (:require [clojure.stacktrace :refer [print-stack-trace]] [formatting-stack.protocols.reporter :as reporter] [formatting-stack.protocols.spec :as protocols.spec] [formattin...
baf395a2410ed17f45727971e7ac3c45ce7ab2a65cc403bdbe3b14cc245d08e3
basho/riak_test
riak_kv_js_manager_intercepts.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2014 Basho Technologies , Inc. %% This file is provided to you 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 Li...
null
https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/intercepts/riak_kv_js_manager_intercepts.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2014 Basho Technologies , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(riak_kv_js_manager_inter...
15f0d8d5ebfb6ee8c55a3f0000802d374561f10071b652277fe9137f4e9eb3ff
gsakkas/rite
2200.ml
let rec sepConcat sep sl = match sl with | [] -> "" | h::t -> let f a x = a ^ (sep ^ x) in let base = h in let l = sepConcat sep t in List.fold_left f base l;; (* fix let rec sepConcat sep sl = match sl with | [] -> "" | h::t -> let f a x = a ^ (sep ^ x) in let base = h in let l ...
null
https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14/2200.ml
ocaml
fix let rec sepConcat sep sl = match sl with | [] -> "" | h::t -> let f a x = a ^ (sep ^ x) in let base = h in let l = t in List.fold_left f base l;; changed spans (7,31)-(7,46) t VarG
let rec sepConcat sep sl = match sl with | [] -> "" | h::t -> let f a x = a ^ (sep ^ x) in let base = h in let l = sepConcat sep t in List.fold_left f base l;; type error slice ( 2,4)-(7,75 ) ( 2,19)-(7,73 ) ( 2,23)-(7,73 ) ( 3,3)-(7,73 ) ( 4,11)-(4,13 ) ( 7,23)-(7,73 ) ( 7,31)-(7...
743346332725a822a918d34d72b7f4cef22e69c0705288bf8694e6ab5b894411
iij/lmq
lmq_cow_prop.erl
-module(lmq_cow_prop). -export([init/3, rest_init/2, allowed_methods/2, delete_resource/2, content_types_provided/2, content_types_accepted/2]). -export([to_json/2, update_props/2]). -record(state, {method, name}). init(_Transport, _Req, _Opts) -> {upgrade, protocol, cowboy_rest}. rest_init(Req, []) -> ...
null
https://raw.githubusercontent.com/iij/lmq/3f01c555af973a07a3f2b22ff95a2bc1c7930bc2/src/lmq_cow_prop.erl
erlang
-module(lmq_cow_prop). -export([init/3, rest_init/2, allowed_methods/2, delete_resource/2, content_types_provided/2, content_types_accepted/2]). -export([to_json/2, update_props/2]). -record(state, {method, name}). init(_Transport, _Req, _Opts) -> {upgrade, protocol, cowboy_rest}. rest_init(Req, []) -> ...
cc3b7616a0b066b1eaa7795490324caf1a3bd38da44bba7976dba447f82c53c3
haskell-mafia/tinfoil
Iv.hs
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # module Test.IO.Tinfoil.AEAD.AESGCM.Iv where import Disorder.Core.IO (testIO) import Disorder.Core.Property ((=/=)) import P import System.IO import Test.QuickCheck import Test.Tinfoil.Arbitrary ()...
null
https://raw.githubusercontent.com/haskell-mafia/tinfoil/f46b2ea0b9984ac9a97073932b5584ce0a2e0554/test/Test/IO/Tinfoil/AEAD/AESGCM/Iv.hs
haskell
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # module Test.IO.Tinfoil.AEAD.AESGCM.Iv where import Disorder.Core.IO (testIO) import Disorder.Core.Property ((=/=)) import P import System.IO import Test.QuickCheck import Test.Tinfoil.Arbitrary ()...
71134f79c1d9476009aed98491d50fb0a140e3eab61aed6c24173cd072429940
cojna/iota
Integral.hs
# LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # # LANGUAGE ViewPatterns # module Test.Prop.Integral (integralSpec) where import Test.Prelude integralSpec :: forall a. (Arbitrary a, Integral a, Show a, Eq a) => Proxy a -> Spec integralSpec _ = do describe "divMod" $ prop "(x `div` y) * y + (x `...
null
https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/test/Test/Prop/Integral.hs
haskell
# LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # # LANGUAGE ViewPatterns # module Test.Prop.Integral (integralSpec) where import Test.Prelude integralSpec :: forall a. (Arbitrary a, Integral a, Show a, Eq a) => Proxy a -> Spec integralSpec _ = do describe "divMod" $ prop "(x `div` y) * y + (x `...
a262b5977dc770b15a0726a16ef21960c3f70e5985bc581513c8f8eef3d5e378
UU-ComputerScience/uhc
IORef.hs
# LANGUAGE NoImplicitPrelude , CPP # # OPTIONS_GHC -XNoImplicitPrelude # ----------------------------------------------------------------------------- -- | -- Module : Data.IORef Copyright : ( c ) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maint...
null
https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/ehclib/uhcbase/Data/IORef.hs
haskell
--------------------------------------------------------------------------- | Module : Data.IORef License : BSD-style (see the file libraries/base/LICENSE) Maintainer : Stability : experimental Portability : portable ---------------------------------------------------------------------------...
# LANGUAGE NoImplicitPrelude , CPP # # OPTIONS_GHC -XNoImplicitPrelude # Copyright : ( c ) The University of Glasgow 2001 Mutable references in the IO monad . module Data.IORef ( * IORefs abstract , instance of : , #if !defined(__PARALLEL_HASKELL__) && defined(__GLASGOW_HASKELL__) #endif ) ...
cec8b621cfa3fcff2df40d0306a7f1082566b9b25df60b1201fb2f0c81dc4433
kupl/LearnML
original.ml
let rec sigma (f : int -> int) (a : int) (b : int) : int = if a > b then 1 else f a * sigma f (a + 1) b
null
https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/sigma/sub10/original.ml
ocaml
let rec sigma (f : int -> int) (a : int) (b : int) : int = if a > b then 1 else f a * sigma f (a + 1) b
a7f6c6c72349600a79757e7312e906030e519913b60a4c997c965e9b28902385
haskelling/aoc2020
23b.hs
import AOC import qualified Data.IntMap.Strict as IM import Data.IntMap ((!)) import Control.Monad.ST import qualified Data.Vector.Unboxed.Mutable as V main = interact $ f' . map digitToInt . head nIters = 10000000 n = 1000000 dec 0 = n - 1 dec x = x - 1 h :: V.MVector s Int -> Int -> ST s Int h v current = do x1 ...
null
https://raw.githubusercontent.com/haskelling/aoc2020/0f0e44ad16d3eda4add1f05684070dd161010d75/23b.hs
haskell
import AOC import qualified Data.IntMap.Strict as IM import Data.IntMap ((!)) import Control.Monad.ST import qualified Data.Vector.Unboxed.Mutable as V main = interact $ f' . map digitToInt . head nIters = 10000000 n = 1000000 dec 0 = n - 1 dec x = x - 1 h :: V.MVector s Int -> Int -> ST s Int h v current = do x1 ...
065ff0f90efece12ecc740b58cec183ae7ef6ba4a29ee296faa5a5036a746265
40ants/barista
vars.lisp
(defpackage #:barista/vars (:use #:cl) (:import-from #:cl-colors) (:import-from #:alexandria) (:export #:*plugin* #:*debug* #:+default-font-size+ #:+supported-colors+)) (in-package barista/vars) (defvar *plugin* nil "Current plugin.") (defvar *debug* nil "If True, then debugger will be invok...
null
https://raw.githubusercontent.com/40ants/barista/92071a899762c43640139d7b6f7d005cf386a949/vars.lisp
lisp
(defpackage #:barista/vars (:use #:cl) (:import-from #:cl-colors) (:import-from #:alexandria) (:export #:*plugin* #:*debug* #:+default-font-size+ #:+supported-colors+)) (in-package barista/vars) (defvar *plugin* nil "Current plugin.") (defvar *debug* nil "If True, then debugger will be invok...
deeb09245649ca04dc025c8c7e784fbc6ec6a0a5ad87b3bcc8cbb011b479763c
RichiH/git-annex
TransferrerPool.hs
A pool of " git - annex transferkeys " processes available for use - - Copyright 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module Assistant.Types.TransferrerPool where import Annex.Commo...
null
https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Assistant/Types/TransferrerPool.hs
haskell
Each item in the pool may have a transferrer running, and has an - IO action that can be used to check if it's still ok to use the - transferrer.
A pool of " git - annex transferkeys " processes available for use - - Copyright 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module Assistant.Types.TransferrerPool where import Annex.Commo...
5899125f945f133020e02c1d5ca1af8fae91889b7fea9c3f848ec0e4c5cf9646
taezos/real-world-yesod
User.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE QuasiQuotes #-} # LANGUAGE StandaloneD...
null
https://raw.githubusercontent.com/taezos/real-world-yesod/cd861b6f414fa389eec8fff5ac21f7d0312f9f94/src/Database/Model/User.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE DerivingStrategies # # LANGUAGE GADTs # # LANGUAGE QuasiQuotes # # LANGUAGE TemplateHaskell # # LANGUAGE UndecidableInstances # real-world-yesod uuid "Guest" is chosen as a table name because "user" is a r...
# LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies # module Database.Model.User where import Data.Text import Handler.Internal.Email import ...
d112373b5ee5adf99c3f80a84d7e8e73fb029879e8241b2efbe821632c733cd4
ashinn/chibi-scheme
ray.scm
RAY -- Ray - trace a simple scene with spheres , generating a " .pgm " file . Translated to Scheme from book ANSI Common Lisp , Example 9.8 (import (scheme base) (scheme inexact) (scheme file) (scheme read) (scheme write) (scheme time)) (define (make-point x y z) (vect...
null
https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/benchmarks/gabriel/ray.scm
scheme
RAY -- Ray - trace a simple scene with spheres , generating a " .pgm " file . Translated to Scheme from book ANSI Common Lisp , Example 9.8 (import (scheme base) (scheme inexact) (scheme file) (scheme read) (scheme write) (scheme time)) (define (make-point x y z) (vect...
1739b9b4ff54bae3b0871647254a4412b1a9ede96ea9fa7c544b43304470475f
blockchain-unica/defi-workbench
test_wallet.ml
let a = Address.addr "a" let t0 = init "t0" let t1 = init "t1" let t2 = mintAMM(t0,t1) let w1 = Wallet.empty a |> Wallet.update t0 1 |> Wallet.update t0 2 |> Wallet.update t1 4 let w2 = Wallet.set_balance (Wallet.balance_of_list [(t0,5)]) w1 let w3 = Wallet.update t0 (-1) w2;; print_endline (Wallet.to_string w1)...
null
https://raw.githubusercontent.com/blockchain-unica/defi-workbench/a3606bf425cef8e81d1f12b13dc1410a48f3e860/test/test_wallet.ml
ocaml
let a = Address.addr "a" let t0 = init "t0" let t1 = init "t1" let t2 = mintAMM(t0,t1) let w1 = Wallet.empty a |> Wallet.update t0 1 |> Wallet.update t0 2 |> Wallet.update t1 4 let w2 = Wallet.set_balance (Wallet.balance_of_list [(t0,5)]) w1 let w3 = Wallet.update t0 (-1) w2;; print_endline (Wallet.to_string w1)...
d2a53445ac0547ce5857ee0da316300e065022b60ed5416644c6dc71192b7c7c
basho/riak_test
ts_simple_describe_table.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2015 - 2016 Basho Technologies , Inc. %% This file is provided to you 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...
null
https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ts_simple_describe_table.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2015 - 2016 Basho Technologies , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(ts_simple_descri...
f24ae8ebfa1bd552673fe32151c8bd1fb939d8cf28f95236d7be5f2c9de22eea
jonase/learndatalogtoday
handler.clj
(ns learndatalogtoday.handler (:gen-class) (:require [clojure.java.io :as io] [clojure.edn :as edn] [compojure.core :refer [routes GET POST]] [compojure.handler :as handler] [compojure.route :as route] [datomic-query-helpers.core :refer [check-query ...
null
https://raw.githubusercontent.com/jonase/learndatalogtoday/9f0a66b3d474ffedf0ed9613013fb45f092792f7/src/clj/learndatalogtoday/handler.clj
clojure
(ns learndatalogtoday.handler (:gen-class) (:require [clojure.java.io :as io] [clojure.edn :as edn] [compojure.core :refer [routes GET POST]] [compojure.handler :as handler] [compojure.route :as route] [datomic-query-helpers.core :refer [check-query ...
850359a8483d365c99d06a81454bd2cf8aaa0a900da7c915e118e99f81374481
nomeata/kaleidogen
Program.hs
# LANGUAGE RecordWildCards # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} # LANGUAGE LambdaCase # module Program ( Program , Time , ProgramRunner , Callbacks(..) , DrawResult(..) , switchProgram ) where import Data.Text (Text) import Control.Monad.Ref import Data.Int import DNA import ...
null
https://raw.githubusercontent.com/nomeata/kaleidogen/8e0f7f9b5f52b9598c6b829370f84bb120d961ad/src/Program.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # A combinator to switch to another program upon onTut Remember screen size Still running Presentation stopped, switch to main program Serialization always based on main program Clicking during other programs ends it Other is not running, so Pretend the mouse...
# LANGUAGE RecordWildCards # # LANGUAGE LambdaCase # module Program ( Program , Time , ProgramRunner , Callbacks(..) , DrawResult(..) , switchProgram ) where import Data.Text (Text) import Control.Monad.Ref import Data.Int import DNA import Shaders import Presentation (Animating) import qualified Presen...
85bc47940d7708258260e062b71802cdb5a2795bfe24a1bf4ad112ab8be77505
NethermindEth/horus-checker
Expr.hs
# LANGUAGE UndecidableInstances # module Horus.Expr ( Expr (.., (:+), (:*), Negate, FeltConst) , Ty (..) , IsProper , isProper , Cast (..) , cast , cast' , unfoldVariadic , apply , apply1 , function , const , transform , transformId , transform_ , canonicalize , not , mod , div ...
null
https://raw.githubusercontent.com/NethermindEth/horus-checker/b4ce60c7739a0d12dab6c9b2ff87719b321f6200/src/Horus/Expr.hs
haskell
main expression type types and functions for n-ary function pattern matching function pattern synonyms smart constructors for basic operations
# LANGUAGE UndecidableInstances # module Horus.Expr ( Expr (.., (:+), (:*), Negate, FeltConst) , Ty (..) , IsProper , isProper , Cast (..) , cast , cast' , unfoldVariadic , apply , apply1 , function , const , transform , transformId , transform_ , canonicalize , not , mod , div ...
6976b55a7b5cec7c7dad5122665c2d538ce910d4a89dd2cc0c6f6c35892dd380
camsaul/toucan2
hydrate.clj
(ns toucan.hydrate (:require [potemkin :as p] [toucan2.tools.hydrate :as hydrate])) (comment hydrate/keep-me) (p/import-vars [hydrate hydrate])
null
https://raw.githubusercontent.com/camsaul/toucan2/0c12f4ee60996a4a8bc9b10458ea56462489a2a6/toucan1/src/toucan/hydrate.clj
clojure
(ns toucan.hydrate (:require [potemkin :as p] [toucan2.tools.hydrate :as hydrate])) (comment hydrate/keep-me) (p/import-vars [hydrate hydrate])
9279391acd6e53b2e0650a9dbac97673a8622cb825529d7f9112153ed5477f62
FlowerWrong/mblog
benchmark_assoc.erl
%% --- Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . %% Copyrights apply to this code. It may not be used to create training material, %% courses, books, articles, and the like. Contact us if you are in doubt. %% We make no guarantees that this code is fit for...
null
https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/benchmark_assoc.erl
erlang
--- Copyrights apply to this code. It may not be used to create training material, courses, books, articles, and the like. Contact us if you are in doubt. We make no guarantees that this code is fit for any purpose. Visit for more book information. --- make a random list of [{<<Bin>>, Int}] length N creat...
Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . -module(benchmark_assoc). -compile(export_all). -import(lib_misc, [unconsult/2]). test1(K) when K < 200000-> L = make_assoc_list(K), Mid = K div 2, {Key,_} = lists:nth(Mid, L), File = "big.tmp", l...