_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
9254f54fb80232e67ab95f1f12dae0f75cf44499e3867d8b9d79aac8f2c8485e
pentlandedge/s4607
bcs.erl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright 2016 Pentland Edge Ltd. %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not %% use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% U...
null
https://raw.githubusercontent.com/pentlandedge/s4607/b3cdae404ac5bd50419f33259dfa62af9d1a8d60/src/bcs.erl
erlang
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 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitati...
Copyright 2016 Pentland Edge Ltd. Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not distributed under the License is distributed on an " AS IS " BASIS , WITHOUT @doc This module contains functions relating the the BCS ( Basic Character Set ) defined in the Stanag 4607 standard ...
aacf068eb9e333315c0e4f84e4d8e5b86f95493b1ed73b03bac3c1e73cd756be
pascal-knodel/haskell-craft
C'11.hs
-- Chapter 11 . -- module C'11 where import Prelude hiding ( id , flip ) import B'C'11 -- import C'6 import E'11'36 import E'11'35 import E'11'34 import E'11'33 import E'11'32 import E'11'31 import E'11'30 import E'11'29 import E'11'28 import E'11'27 import E'11'26 import E'11'25 import E'11'24 impor...
null
https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Chapter%C2%A011/C'11.hs
haskell
import C'6
Chapter 11 . module C'11 where import Prelude hiding ( id , flip ) import B'C'11 import E'11'36 import E'11'35 import E'11'34 import E'11'33 import E'11'32 import E'11'31 import E'11'30 import E'11'29 import E'11'28 import E'11'27 import E'11'26 import E'11'25 import E'11'24 import E'11'23 import E'1...
d8f3bf8bec77282b01b552a006f20a1d8e727b1809aa92389ac51cf256ff3382
erewok/servant-py
Requests.hs
module Servant.PY.Requests where import Data.Monoid ( (<>) ) import Data.Proxy import Data.Text (Text) import qualified Data.Text as T import Servant.PY.Internal -- | Generate python functions that use the requests library. -- Uses 'defCommonGener...
null
https://raw.githubusercontent.com/erewok/servant-py/e2ffac37dee31671cb00352fea3349049235fb52/src/Servant/PY/Requests.hs
haskell
| Generate python functions that use the requests library. Uses 'defCommonGeneratorOptions' for the generator options. | Generate python functions that use the requests library. Lets you specify your own 'CommonGeneratorOptions'.
module Servant.PY.Requests where import Data.Monoid ( (<>) ) import Data.Proxy import Data.Text (Text) import qualified Data.Text as T import Servant.PY.Internal requests :: PythonGenerator requests reqs = defPyImports <> mconcat (map requestsWithDe...
ce26bad862a66a37a1fe091b63651e1c4a95f4596cb675be6c9a9e0c57a6e2ba
practicalli/four-clojure
063_group_a_sequence.clj
(ns four-clojure.063-group-a-sequence) ;; #063 Group a Sequence ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Difficulty: Easy ;; Topics: core-functions ;; Restriction: group-by ;; Given a function f and a sequence s, write a function which returns a map. ;; The keys should be the values of f applied to each item i...
null
https://raw.githubusercontent.com/practicalli/four-clojure/9812b63769a06f9b0bfd63e5ffce380b67e5468b/src/four_clojure/063_group_a_sequence.clj
clojure
#063 Group a Sequence Difficulty: Easy Topics: core-functions Restriction: group-by Given a function f and a sequence s, write a function which returns a map. The keys should be the values of f applied to each item in s. The value at each key should be a vector of corresponding items in the order they appear in ...
(ns four-clojure.063-group-a-sequence) (= ( _ _ # ( > % 5 ) [ 1 3 6 8 ] ) { false [ 1 3 ] , true [ 6 8 ] } ) (= ( _ _ # ( apply / % ) [ [ 1 2 ] [ 2 4 ] [ 4 6 ] [ 3 6 ] ] ) { 1/2 [ [ 1 2 ] [ 2 4 ] [ 3 6 ] ] , 2/3 [ [ 4 6 ] ] } ) (= ( _ _ count [ [ 1 ] [ 1 2 ] [ 3 ] [ 1 2 3 ] [ 2 3 ] ] ) { 1 [ [ 1 ] [ 3 ] ] , ...
d59982707f1c7acbb3680662be2534343049cac846e0b3511f2e27151380cb19
syntax-objects/syntax-parse-example
marc-matcher-test.rkt
#lang racket (module+ test (require rackunit syntax-parse-example/marc-matcher/marc-matcher) (test-case "parse-264" (define parse-264 (marc-matcher ([#px"ab" #:as place-entity-groups] [#px"c" #:as date]) (for/list ([group place-entity-groups]) ...
null
https://raw.githubusercontent.com/syntax-objects/syntax-parse-example/0675ce0717369afcde284202ec7df661d7af35aa/marc-matcher/marc-matcher-test.rkt
racket
#lang racket (module+ test (require rackunit syntax-parse-example/marc-matcher/marc-matcher) (test-case "parse-264" (define parse-264 (marc-matcher ([#px"ab" #:as place-entity-groups] [#px"c" #:as date]) (for/list ([group place-entity-groups]) ...
d060661f0d6c0123740f6a15c1e2d64bc256d6dc60342d96ab361f8b77de65cd
frenchfrog42/Baguette
foreach.rkt
#lang racket (require "../compilation.rkt") (require "../hashtable.rkt") (require "../util.rkt") ; useful in the created code by the foreach macro (define (create-code-once function) (define code "") (new-var 'key) (new-var 'value) (set! code (first (compile-expr-all (function 'key 'value)))) (delete-var '...
null
https://raw.githubusercontent.com/frenchfrog42/Baguette/f2cbddeb7cd2bb519973a7afa8ec0bc433e5e4fb/work-in-progress/foreach.rkt
racket
useful in the created code by the foreach macro extract key and value code executed in the foreach loop foreach macro marker to know where the foreach loop is code unrolled of the foreach loop must burn key and value assert map is empty at the end The foreach contract This public function will execute a foreac...
#lang racket (require "../compilation.rkt") (require "../hashtable.rkt") (require "../util.rkt") (define (create-code-once function) (define code "") (new-var 'key) (new-var 'value) (set! code (first (compile-expr-all (function 'key 'value)))) (delete-var 'key) (delete-var 'value) (displayln code) (c...
8afaabe09a3b04a8651bf6107be9a203ae95932a619fde73ddfe7262120867ad
achirkin/vulkan
VK_KHR_win32_surface.hs
# OPTIONS_GHC -fno - warn - orphans # # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_HADDOCK not - home # {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} # LANGUAGE FlexibleInstances # # LANGUAGE ForeignFunctionInterface # {-# LANGUAGE MagicHash #-} {...
null
https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_KHR_win32_surface.hs
haskell
# LANGUAGE CPP # # LANGUAGE DataKinds # # LANGUAGE MagicHash # # LANGUAGE PatternSynonyms # # LANGUAGE Strict # # LANGUAGE TypeFamilies # # LANGUAGE ViewPatterns # > #include "vk_platform.h" # INLINE _VkCreateWin32Sur...
# OPTIONS_GHC -fno - warn - orphans # # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_HADDOCK not - home # # LANGUAGE FlexibleInstances # # LANGUAGE ForeignFunctionInterface # # LANGUAGE TypeApplications # module Graphics.Vulkan.Ext.VK_KHR_win32_surface (AHardwareBuffer(), ANativeWindow...
e7db82c60737cf3aeac90b2c758f42b0dec1ea3e31eabd216ec6b278756efe8f
icicle-lang/icicle-ambiata
Serial.hs
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # {-# LANGUAGE OverloadedStrings #-} # OPTIONS_GHC -fno - warn - missing - signatures # module Icicle.Test.Serial where import Icicle.Test.Arbitrary import Icicle.Serial import P import System.IO import Test....
null
https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-compiler/test/Icicle/Test/Serial.hs
haskell
# LANGUAGE OverloadedStrings # Render/parse symmtery =====================
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -fno - warn - missing - signatures # module Icicle.Test.Serial where import Icicle.Test.Arbitrary import Icicle.Serial import P import System.IO import Test.QuickCheck prop_eavt f = (parseE...
c433d3624b4ac3267c61e5955d095eadda0a8d52636caeeeeb821c7095fe3f3b
plumatic/grab-bag
optimize_function_test_suite.clj
(ns flop.optimize-function-test-suite "A collection of differentiable, multivariate functions for verifying correctness of optimizer code." (:use plumbing.core) (:require [hiphip.double :as dbl])) (defn square [x] (* x x)) (defn shifted "Returns a version of f shifted by vector a" [f a] (fn [xs] ...
null
https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/flop/src/flop/optimize_function_test_suite.clj
clojure
(ns flop.optimize-function-test-suite "A collection of differentiable, multivariate functions for verifying correctness of optimizer code." (:use plumbing.core) (:require [hiphip.double :as dbl])) (defn square [x] (* x x)) (defn shifted "Returns a version of f shifted by vector a" [f a] (fn [xs] ...
be94bb622bfe9bcf136b17bab18943cdd596fc775c45f591aa5af196f209682a
well-typed/visualize-cbn
JavaScript.hs
module CBN.Trace.JavaScript (render) where import Data.Set (Set) import Text.Blaze.Html.Renderer.String import Text.Blaze.Html5 (toHtml) import qualified Data.Set as Set import CBN.Eval import CBN.Heap import CBN.Pretty import CBN.Trace import CBN.Util.Doc.Rendered.HTML () import qualified CBN.Util.Doc as Do...
null
https://raw.githubusercontent.com/well-typed/visualize-cbn/499a8bc806ce03ce6d1bc12df1ea6e6df7768817/src/CBN/Trace/JavaScript.hs
haskell
module CBN.Trace.JavaScript (render) where import Data.Set (Set) import Text.Blaze.Html.Renderer.String import Text.Blaze.Html5 (toHtml) import qualified Data.Set as Set import CBN.Eval import CBN.Heap import CBN.Pretty import CBN.Trace import CBN.Util.Doc.Rendered.HTML () import qualified CBN.Util.Doc as Do...
403c1842c190d9d403f3504ce17344739b32ddcba7c764bfd6d690433c5b5827
AbstractMachinesLab/caramel
clflags.mli
(** {0 OCaml compiler compatible command-line parameters} For compatibility with typechecker. Argument parsing / build environment construction happens elsewhere. *) * { 1 Relevant settings } Parameters from OCaml compiler which affect Merlin behavior . Parameters from OCaml compiler which affect Me...
null
https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/src/ocaml/utils/clflags.mli
ocaml
* {0 OCaml compiler compatible command-line parameters} For compatibility with typechecker. Argument parsing / build environment construction happens elsewhere. max size of module related errors
* { 1 Relevant settings } Parameters from OCaml compiler which affect Merlin behavior . Parameters from OCaml compiler which affect Merlin behavior. *) val include_dirs : string list ref val fast : bool ref val classic : bool ref val principal : bool ref val re...
30ed664604383d06f57299726e6665196f1652f373a95a7e518b935877a17f37
johnwhitington/ocamli
nanocaml.ml
type op = Add | Sub | Mul | Div let string_of_op = function Add -> "Add" | Sub -> "Sub" | Mul -> "Mul" | Div -> "Div" type binding = string * t and envitem = bool * binding list ref and environment = envitem list and t = {t : t'; lets : (bool * binding list) list} and t' = Int of int | Bool of bool | Var...
null
https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/newtype/nanocaml.ml
ocaml
type op = Add | Sub | Mul | Div let string_of_op = function Add -> "Add" | Sub -> "Sub" | Mul -> "Mul" | Div -> "Div" type binding = string * t and envitem = bool * binding list ref and environment = envitem list and t = {t : t'; lets : (bool * binding list) list} and t' = Int of int | Bool of bool | Var...
0f0a57cef73eb4f21b24a08d0ee6014c79a971407a661d71e4f8852093a3d5be
fukamachi/http-body
multipart.lisp
(in-package :cl-user) (defpackage http-body.multipart (:use :cl) (:import-from :http-body.json :json-parse) (:import-from :http-body.urlencoded :urlencoded-parse) (:import-from :http-body.util :slurp-stream :starts-with) (:import-from :fast-http ...
null
https://raw.githubusercontent.com/fukamachi/http-body/3e4bedd6a9d9bc4e1dc0a45e5b55360ae30fd388/src/multipart.lisp
lisp
No Content-Type implies the body is a text data. Convert the body into a text if the Content-Type is text.
(in-package :cl-user) (defpackage http-body.multipart (:use :cl) (:import-from :http-body.json :json-parse) (:import-from :http-body.urlencoded :urlencoded-parse) (:import-from :http-body.util :slurp-stream :starts-with) (:import-from :fast-http ...
82566647bad479e8cc08c0ae805c108d30f392743d9578cba709596f68ace389
huiqing/percept2
ping.erl
-module(ping). -export([start/0, stop/1, send/1, loop/0]). start() -> spawn_link(ping, loop, []). stop(Pid) -> Pid ! stop. send(Pid) -> Pid ! {self(), ping}, receive pong ->pong end. loop()-> receive {Pid, ping} -> spawn(crash, do_not_ex...
null
https://raw.githubusercontent.com/huiqing/percept2/fa796a730d6727210a71f185e6a39a960c2dcb90/case_studies/par_sim_code/test/ping.erl
erlang
-module(ping). -export([start/0, stop/1, send/1, loop/0]). start() -> spawn_link(ping, loop, []). stop(Pid) -> Pid ! stop. send(Pid) -> Pid ! {self(), ping}, receive pong ->pong end. loop()-> receive {Pid, ping} -> spawn(crash, do_not_ex...
5d1cbb54b191706d2b06dd9ff73c5b30f851764e30686d7983c3ed6013feff0b
p2k/ecoinpool
ecoinpool_util.erl
%% Copyright ( C ) 2011 Patrick " p2k " < > %% %% This file is part of ecoinpool. %% %% ecoinpool 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...
null
https://raw.githubusercontent.com/p2k/ecoinpool/01ba76a7ab4b17b60cb0c525786fddef43ea80e1/apps/ecoinpool/src/ecoinpool_util.erl
erlang
This file is part of ecoinpool. ecoinpool is free software: you can redistribute it and/or modify (at your option) any later version. ecoinpool 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 PARTICULAR PURPOSE....
Copyright ( C ) 2011 Patrick " p2k " < > it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License -module(ecoinpool_util). -export([ hexbin_to_bin/1, h...
c57ea09da0374d74cf1a23d93d2b5c52e80bfc20b593c6befbf550eff6417076
triffon/fp-2022-23
more-lists.rkt
#lang racket Предния път работихме със ; функцията accumulate В racket ( и Haskell ) има 2 различни но много ; помежду си имплементации: 10 10 е разликата тогава ? ; foldr сгъва списъка от дясно наляво ;------------------------------------ ; (+ 1 (+ 2 (+ 3 (+ 4 0)))) foldr генерира рекурсивен проц...
null
https://raw.githubusercontent.com/triffon/fp-2022-23/fb293576057c603b19da312c3982a0fb7a582719/exercises/cs3%264/05/more-lists.rkt
racket
функцията accumulate помежду си имплементации: foldr сгъва списъка от дясно наляво ------------------------------------ (+ 1 (+ 2 (+ 3 (+ 4 0)))) отложени ------------------------------------ (+ 4 (+ 3 (+ 2 (+ 1 0)))) изчисляват в аргумента. има по-различна имплементация: Разликата е в реда на аргументит...
#lang racket Предния път работихме със В racket ( и Haskell ) има 2 различни но много 10 10 е разликата тогава ? foldr генерира рекурсивен процес и тези операции са т.е . да се , ако искате операциите ви да се изпълнят в обратен ред foldl сгъва списъка от ляво foldl генерира и опе...
779e00a23136587b6453422c73afed6c86aad5701fead04825f388f21edd595d
lpgauth/swirl
swirl_ets_manager.erl
-module(swirl_ets_manager). -include("swirl.hrl"). %% internal -export([ new_table/3, start_link/0, table/3 ]). -behaviour(gen_server). -export([ init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3 ]). -define(SERVER, ?MODULE). -record(state, { tab...
null
https://raw.githubusercontent.com/lpgauth/swirl/0b6cbe6979d65d28c17fa13b7dbc798e9413806a/src/swirl_ets_manager.erl
erlang
internal internal gen_server callbacks private
-module(swirl_ets_manager). -include("swirl.hrl"). -export([ new_table/3, start_link/0, table/3 ]). -behaviour(gen_server). -export([ init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3 ]). -define(SERVER, ?MODULE). -record(state, { tables }). -sp...
9b75f86fb9762b10b42fe57b0979d506559698d67879e097e1d6088f5ca97896
phadej/vec
Optics.hs
{-# LANGUAGE CPP #-} # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE RankNTypes #-} # LANGUAGE TypeFamilies # # OPTIONS_GHC -fno - warn - orphans # module Data.RAList.Optics ( -- * Indexing ix, ) where import Prelude (Int, Functor (...
null
https://raw.githubusercontent.com/phadej/vec/a895ab79e054987938295d5a149758eb79d85683/ral-optics/src/Data/RAList/Optics.hs
haskell
# LANGUAGE CPP # # LANGUAGE RankNTypes # * Indexing ----------------------------------------------------------------------------- Indexing ----------------------------------------------------------------------------- ------------------------------------------------------------------------...
# LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # # OPTIONS_GHC -fno - warn - orphans # module Data.RAList.Optics ( ix, ) where import Prelude (Int, Functor (..)) import qualified Optics.Core as L import qualified Data.RAList.NonEmpty.Optics.Internal as...
179b0bcb2a6b18cbc8f9d02ca0954b2f2ddb64793f34f0e9871e8ebe3b884e88
facebookincubator/hsthrift
HUnit.hs
Copyright ( c ) Facebook , Inc. and its affiliates . module Util.HUnit ( absError , assertAbsError , assertElem , assertSubsetOf , assertNotElem , assertPermutationOf , assertThrow ) where import Control.Exception import Data.Either (isLeft) import Data.Foldable (toList) import Data.List import Test...
null
https://raw.githubusercontent.com/facebookincubator/hsthrift/d3ff75d487e9d0c2904d18327373b603456e7a01/common/util/Util/HUnit.hs
haskell
| The absolute error between an expected and actual value. | Asserts that the absolute error of a value is within a given range. If you want the range to be in the realm of machine epsilon, use @Data.AEq@ instead. ^ Error message. ^ Expected value. ^ Error range (e.g., @1e-3@). ^ Actual value.
Copyright ( c ) Facebook , Inc. and its affiliates . module Util.HUnit ( absError , assertAbsError , assertElem , assertSubsetOf , assertNotElem , assertPermutationOf , assertThrow ) where import Control.Exception import Data.Either (isLeft) import Data.Foldable (toList) import Data.List import Test...
ba2192bf68fee3220f84fe83ccd2058911131a2dad1021867849e31b7d7dab62
mdedwards/slippery-chicken
post-gen-editing-examples.lsp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; File: post-gen-editing-examples.lsp ;;; Class Hierarchy : None ;;; Version : 1.0 ;;; ;;; Project: slippery chicken (algorithmic composition) ;;; ;;; Purpose: Lisp-code examples to accompany ...
null
https://raw.githubusercontent.com/mdedwards/slippery-chicken/c1c11fadcdb40cd869d5b29091ba5e53c5270e04/doc/examples/post-gen-editing-examples.lsp
lisp
File: post-gen-editing-examples.lsp Project: slippery chicken (algorithmic composition) Purpose: Lisp-code examples to accompany post-gen-editing.html Creation date: 17th July 2012 **** This file is part of slippery-chicken slippery...
Class Hierarchy : None Version : 1.0 Author : $ $ Last modified : 16:26:35 Mon Oct 20 2014 BST SVN ID : $ I d : post-gen-editing-examples.lsp 5043 2014 - 10 - 20 16:26:46Z medward2 $ Licence : Copyright ( c ) 2012 Public License as published by the Fr...
3f54c4d0ba065e9672230c07c11c5ce13b29ef1f0a2fb1fb6c6c18330a4801e7
ghcjs/ghcjs
t7233.hs
import Data.Int import Data.Word main = do print [5 `div` (minBound+k::Int) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int8) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int16) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int32) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int64) | k <- [0 .. 1...
null
https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/numeric/t7233.hs
haskell
import Data.Int import Data.Word main = do print [5 `div` (minBound+k::Int) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int8) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int16) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int32) | k <- [0 .. 10]] print [5 `div` (minBound+k::Int64) | k <- [0 .. 1...
d343622208e88d6784258f13a4b7907c27320172b2e24a583a9159f80260b37b
ekmett/hask
Constrained.hs
# LANGUAGE PolyKinds # {-# LANGUAGE RankNTypes #-} # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # {-# LANGUAGE ConstraintKinds #-} # LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FunctionalDependencies # # OPTIONS_GHC -Wall # --------------------------...
null
https://raw.githubusercontent.com/ekmett/hask/54ea964af8e0c1673ac2699492f4c07d977cb3c8/old/src/Hask/Constrained.hs
haskell
# LANGUAGE RankNTypes # # LANGUAGE ConstraintKinds # ------------------------------------------------------------------ | License : BSD3 Stability : experimental Portability: non-portable ------------------------------------------------------------------ | @(|=) :: Constraint -> * -> *@ | We could flip thi...
# LANGUAGE PolyKinds # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # # LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FunctionalDependencies # # OPTIONS_GHC -Wall # Copyright : ( c ) 2014 Maintainer : < > module Hask.Constrained where imp...
d80b8f66955ace13b5b7765042edca1fbbd2a9d8b9a466900d7ee0e9dcc33358
pa-ba/compdata
FreeVars.hs
# LANGUAGE TemplateHaskell , MultiParamTypeClasses , FlexibleInstances , FlexibleContexts , UndecidableInstances , TypeOperators , ScopedTypeVariables , TypeSynonymInstances , ConstraintKinds # TemplateHaskell, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, Und...
null
https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/benchmark/Functions/Comp/FreeVars.hs
haskell
we interpret integers as variables here
# LANGUAGE TemplateHaskell , MultiParamTypeClasses , FlexibleInstances , FlexibleContexts , UndecidableInstances , TypeOperators , ScopedTypeVariables , TypeSynonymInstances , ConstraintKinds # TemplateHaskell, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, Und...
4d7ae6ae8fc8532376ecb8ede0224b7f0c1ce0760f8834e78efd2cfbbc97c9ee
avsm/mirage-duniverse
context_free.ml
(*$ #use "cinaps_helpers" $*) open! Import open Common module E = Extension module EC = Extension.Context module A = Attribute module AC = Attribute.Context module Rule = struct module Attr_group_inline = struct type ('a, 'b, 'c) unpacked = { attribute : ('b, 'c) Attribute.t ; expect : bool ...
null
https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/ppxlib/src/context_free.ml
ocaml
$ #use "cinaps_helpers" $ We expect the lookup to fail most of the time, by making the table big (and sparse), we make it more likely to fail quickly No point recursing into every location Pre-conditions: - e.pexp_desc = Pexp_apply(func, args) - func.pexp_desc = Pexp_ident _ location doe...
open! Import open Common module E = Extension module EC = Extension.Context module A = Attribute module AC = Attribute.Context module Rule = struct module Attr_group_inline = struct type ('a, 'b, 'c) unpacked = { attribute : ('b, 'c) Attribute.t ; expect : bool ; expand : (loc:Location...
1e9c169ba4e021dcf61a1ec056f061d61aea8e69b24d8992a3a640d2543822b0
rescript-lang/rescript-compiler
js_obj_test.ml
open Js_obj type x = < say : int -> int > let suites = Mt.[ "empty", (fun _ -> Eq(0, empty () |> keys |> Array.length)); "assign", (fun _ -> Eq([%obj { a = 1 }], assign (empty ()) [%obj { a = 1 }])); ] ;; Mt.from_pair_suites __MODULE__ suites
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/85c2dceaa5ff7a9050054ee7f5a7f6d272d58a51/jscomp/test/js_obj_test.ml
ocaml
open Js_obj type x = < say : int -> int > let suites = Mt.[ "empty", (fun _ -> Eq(0, empty () |> keys |> Array.length)); "assign", (fun _ -> Eq([%obj { a = 1 }], assign (empty ()) [%obj { a = 1 }])); ] ;; Mt.from_pair_suites __MODULE__ suites
be11456f5e80826dc0fa05d16a38ecb65dba4ec01f5141f6acbdc947e5fbb4a7
OCamlPro/techelson
dtyp.mli
* Datatype types and helpers . open Common (** Type of type variables. *) type tvar = int (** Formats type variables. *) val fmt_tvar : formatter -> tvar -> unit (** Generates a fresh type variable. *) val fresh_tvar : unit -> tvar * Nullary datatypes . type leaf = | Str | Nat | Int | Bytes | Bool | Unit | Mutez |...
null
https://raw.githubusercontent.com/OCamlPro/techelson/932fbf08675cd13d34a07e3b3d77234bdafcf5bc/src/1_base/dtyp.mli
ocaml
* Type of type variables. * Formats type variables. * Generates a fresh type variable. * Formatter for nullary datatypes. * String to leaf conversion. * Type of type aliases. * Wraps a datatype with a name. * Actual datatype. * Field annotation. * Nameless datatype. * Actual datatype. * Type annotation. * N...
* Datatype types and helpers . open Common type tvar = int val fmt_tvar : formatter -> tvar -> unit val fresh_tvar : unit -> tvar * Nullary datatypes . type leaf = | Str | Nat | Int | Bytes | Bool | Unit | Mutez | Address | Operation | Key | KeyH | Signature | Timestamp | Var of tvar val fmt_leaf : formatter -> l...
4cef4b5437ac10e7d75c76621e07ec3b4fdec39bbe1dea280eb77285063dadbc
samrushing/irken-compiler
t_inline0.scm
(include "lib/core.scm") (include "lib/pair.scm") ;; we need a partial evaluator?, the inliner can't see < eq ? > and make this Do The Right Thing . XXX see appel " modern compiler implementation ... " 15.4 . ;; according to that we need loop-preheader and loop-invariant ;; optimizations. (printn (member...
null
https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_inline0.scm
scheme
we need a partial evaluator?, the inliner can't according to that we need loop-preheader and loop-invariant optimizations.
(include "lib/core.scm") (include "lib/pair.scm") see < eq ? > and make this Do The Right Thing . XXX see appel " modern compiler implementation ... " 15.4 . (printn (member? 0 '(0 1 2 3) eq?))
e95471a043c9df97acc7d3239903589a6f01c0d06065012e38b78e07e7ddbd82
kdltr/chicken-core
sgrep.scm
;;;; sgrep.scm - grepping benchmark (import chicken.io chicken.irregex chicken.port) (define big-string (with-input-from-file (optional (command-line-arguments) "compiler.scm") read-string)) (define-syntax bgrep (syntax-rules () ((_ n expr) (time (do ((i n (fx- i 1))) ((eq? i 0)) (with-input...
null
https://raw.githubusercontent.com/kdltr/chicken-core/b2e6c5243dd469064bec947cb3b49dafaa1514e5/tests/sgrep.scm
scheme
sgrep.scm - grepping benchmark
(import chicken.io chicken.irregex chicken.port) (define big-string (with-input-from-file (optional (command-line-arguments) "compiler.scm") read-string)) (define-syntax bgrep (syntax-rules () ((_ n expr) (time (do ((i n (fx- i 1))) ((eq? i 0)) (with-input-from-string big-string (lambda (...
2082852c7981b653f174bb21dee18621c0da769203821f3914f302175e5137fe
markandrus/twiml-haskell
Internal.hs
{-# LANGUAGE ConstraintKinds #-} # LANGUAGE DataKinds # {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} # LANGUAGE DeriveFunctor # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE PolyKinds # {-...
null
https://raw.githubusercontent.com/markandrus/twiml-haskell/3071234aba90b5b86a6f435eaf0e47a218ca103a/src/Text/XML/Twiml/Internal.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE DeriveAnyClass # # LANGUAGE DeriveDataTypeable # # LANGUAGE GADTs # # LANGUAGE RankNTypes # ----------------------------------------------------------------------------- | Module : Text.XML.Twiml.Internal License : BSD-style (see the file LICENSE) Stability : pr...
# LANGUAGE DataKinds # # LANGUAGE DeriveFunctor # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE PolyKinds # # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # # LANGUA...
5c979518f6f31678b014f7a624277785a61dbe637b2ef5a52a6a4bdc8656906b
ghc/packages-dph
Vectorised.hs
{-# LANGUAGE ParallelArrays, ParallelListComp #-} {-# OPTIONS -fvectorise #-} module Vectorised ( searchPA ) where import qualified Data.Array.Parallel.Prelude.Word8 as W import Data.Array.Parallel.Prelude.Word8 (Word8) import Data.Array.Parallel.Prelude.Int as I import Data.Array.Parallel import q...
null
https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-examples/examples/imaginary/StringSearch/Vectorised.hs
haskell
# LANGUAGE ParallelArrays, ParallelListComp # # OPTIONS -fvectorise # We can't use the Prelude Char and String types in vectorised code yet.. | Filter potential occurrences to find matches. | Find indices all occurrences of @w@ inside string @s@. ---------------------------------------------------------------- | SE...
module Vectorised ( searchPA ) where import qualified Data.Array.Parallel.Prelude.Word8 as W import Data.Array.Parallel.Prelude.Word8 (Word8) import Data.Array.Parallel.Prelude.Int as I import Data.Array.Parallel import qualified Prelude as Prel type Char = Word8 type String = [: Char :] For ...
6ded9d8e77531705d470ab12631c3ee47dd86690abf42e67adc953223f182920
quil-lang/sbcl-librarian
function.lisp
(in-package #:sbcl-librarian) (defvar *initialize-callables-p* nil "Bound to T when we are loading Lisp and want to reinitialize callables on load.") (defun canonical-signature (name result-type typed-lambda-list &key (function-prefix "") ...
null
https://raw.githubusercontent.com/quil-lang/sbcl-librarian/77aef19d6a49711d5426c619887cf717d7508ff7/src/function.lisp
lisp
(in-package #:sbcl-librarian) (defvar *initialize-callables-p* nil "Bound to T when we are loading Lisp and want to reinitialize callables on load.") (defun canonical-signature (name result-type typed-lambda-list &key (function-prefix "") ...
fda7c0696f997989824851a1473c86ea3cd13b03afcc5d196fe36b7f30b97748
racket/gui
once.rkt
#lang racket/base (require ffi/unsafe ffi/unsafe/global) ;; This module must be instantiated only once: (let ([v (register-process-global #"GRacket-support-initialized" (ptr-add #f 1))]) (when v (error "cannot instantiate `racket/gui/base' a second time in the same process")))
null
https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mred/private/wx/common/once.rkt
racket
This module must be instantiated only once:
#lang racket/base (require ffi/unsafe ffi/unsafe/global) (let ([v (register-process-global #"GRacket-support-initialized" (ptr-add #f 1))]) (when v (error "cannot instantiate `racket/gui/base' a second time in the same process")))
0ed9c48da1c9f8ab791c1136556b8db43de1839ecbfcbaf5604eb6cc0aea58a0
jship/context
Context.hs
# LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # module Context ( -- * Introduction -- $intro -- * Storage Store , withNonEmptyStore , withEmptyStore -- * Operations -- ** Registering context , use , adjust , withAdjusted -- ** Asking for context , mine , mines...
null
https://raw.githubusercontent.com/jship/context/7f43df124daf38852a882451b2bf514d279fb77e/context/library/Context.hs
haskell
* Introduction $intro * Storage * Operations ** Registering context ** Asking for context * Views * Exceptions * Concurrency * Lower-level storage | Provides a new, non-empty 'Store' that uses the specified context value as a default when the calling thread has no registered context. 'mine', 'mines', and '...
# LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # module Context Store , withNonEmptyStore , withEmptyStore , use , adjust , withAdjusted , mine , mines , mineMay , minesMay , module Context.View , NotFoundException(NotFoundException, threadId) , module Context.Concurre...
50075107a59939e598767a681a2a222c702ab4e4f501303a25e97f276dc9fddc
rescript-lang/rescript-compiler
js_re.ml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * 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 , either version 3 of the License , or * ( at your option ) any later...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/c3fcc430360079546a6aabd2b2770303480f8486/jscomp/others/js_re.ml
ocaml
* The RegExp object. * The result of a executing a RegExp on a string. * Deprecated. Use `captures` instead. * 0-based index of the match in the input string. * The original input string. * Returns the enabled flags as a string. * Returns a `bool` indicating whether the global flag is set. * Returns a `bool` i...
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * 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 , either version 3 of the License , or * ( at your option ) any later...
73030709e3b97c93b3a4c44644e1751f0ef46f165c09c4664913741acb711060
fredlund/McErlang
ltl_utils.erl
Copyright ( c ) 2009 , %% All rights reserved. %% %% Redistribution and use in source and binary forms, with or without %% modification, are permitted provided that the following conditions are met: %% %% Redistributions of source code must retain the above copyright %% notice, this list of conditions and...
null
https://raw.githubusercontent.com/fredlund/McErlang/25b38a38a729fdb3c3d2afb9be016bbb14237792/Ltl2Buchi/src/ltl_utils.erl
erlang
All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: %% Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. %% Redi...
Copyright ( c ) 2009 , IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR @author < > @copyright 2009 , -module(ltl_utils). -export([normalize/1, subformulas/1]). @spec ( ltl_formula ( ) ) - > ltl_...
639de82c5e9dabd3cb51acbb0e51e83437e6f3c8bdfe4ffd00adfc36f82c21de
ucsd-progsys/liquidhaskell
Unchecked.hs
----------------------------------------------------------------------------- -- | -- Module : Language.Stitch.LH.Unchecked Copyright : ( C ) 2015 ( C ) 2021 -- License : BSD-style (see LICENSE) -- Stability : experimental -- -- Defines the AST for un-type-checked expressions -...
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/benchmarks/stitch-lh/src/Language/Stitch/LH/Unchecked.hs
haskell
--------------------------------------------------------------------------- | Module : Language.Stitch.LH.Unchecked License : BSD-style (see LICENSE) Stability : experimental Defines the AST for un-type-checked expressions -------------------------------------------------------------------------- ...
Copyright : ( C ) 2015 ( C ) 2021 # LANGUAGE LambdaCase # module Language.Stitch.LH.Unchecked where import Language.Stitch.LH.Pretty import Language.Stitch.LH.Type import Language.Stitch.LH.Op import Language.Stitch.LH.Util import Language.Stitch.LH.Data.Nat as Nat import Text.PrettyPrin...
2460c524fd6f9a32eda8bf77b35f069b723b3f0a10a5e5c498f031e0202b0d71
fulcrologic/statecharts
custom_invocation.cljc
(ns custom-invocation (:require [clojure.core.async :as async] [com.fulcrologic.statecharts :as sc] [com.fulcrologic.statecharts.chart :refer [statechart]] [com.fulcrologic.statecharts.data-model.operations :as ops] [com.fulcrologic.statecharts.elements :refer [state transition script-fn invoke]] ...
null
https://raw.githubusercontent.com/fulcrologic/statecharts/82dab36fb45ee1b3d8755d8c52c7d21d1c55443e/src/examples/custom_invocation.cljc
clojure
Send this one to exit the top level machine stop the event loop
(ns custom-invocation (:require [clojure.core.async :as async] [com.fulcrologic.statecharts :as sc] [com.fulcrologic.statecharts.chart :refer [statechart]] [com.fulcrologic.statecharts.data-model.operations :as ops] [com.fulcrologic.statecharts.elements :refer [state transition script-fn invoke]] ...
6276bcbb7961ed73c03baf4458a8c570ad6fc4f9502d14b4954d142f08e9fab1
tonymorris/geo-gpx
SrcL.hs
module Data.Geo.GPX.Lens.SrcL where import Data.Lens.Common class SrcL a where srcL :: Lens a (Maybe String)
null
https://raw.githubusercontent.com/tonymorris/geo-gpx/526b59ec403293c810c2ba08d2c006dc526e8bf9/src/Data/Geo/GPX/Lens/SrcL.hs
haskell
module Data.Geo.GPX.Lens.SrcL where import Data.Lens.Common class SrcL a where srcL :: Lens a (Maybe String)
f90fa7a042a2ad577eb1251af34d00bd42bf3ae84fd2fa5e4105a09958c0297c
AdRoll/rebar3_format
sr_formatter_SUITE.erl
-module(sr_formatter_SUITE). -behaviour(ct_suite). -export([all/0]). -export([action/1, output_dir/1, options/1, complete_coverage/1]). all() -> [action, output_dir, options, complete_coverage]. action(_Config) -> steamroller:validator(fun(File, Opts) -> <<"brackets.erl">> = fil...
null
https://raw.githubusercontent.com/AdRoll/rebar3_format/2c241119cc24a964ecc08bfcecde30f7e755b17e/test/sr_formatter_SUITE.erl
erlang
When there is no expected output, steamroller should run in the input file When there is an expected output, steamroller should run on the input file
-module(sr_formatter_SUITE). -behaviour(ct_suite). -export([all/0]). -export([action/1, output_dir/1, options/1, complete_coverage/1]). all() -> [action, output_dir, options, complete_coverage]. action(_Config) -> steamroller:validator(fun(File, Opts) -> <<"brackets.erl">> = fil...
ce4cdef09a8661f7b7ae3a190fc322fed4573dd24790943ae0b9215ab410ab92
archimag/cl-pdf
defpackage.lisp
cl - pdf copyright 2002 - 2005 see license.txt for the details ;;; You can reach me at or ;;; The homepage of cl-pdf is here: -pdf.html (in-package #:cl-user) (defpackage :pdf (:nicknames :cl-pdf) (:use :common-lisp :iterate) (:export #:*compress-streams* #:*zlib-search-paths* #:*zlib-loaded* #:load-zl...
null
https://raw.githubusercontent.com/archimag/cl-pdf/b4925b5df9cb07b37ce4246c91914853e565a5bb/defpackage.lisp
lisp
You can reach me at or The homepage of cl-pdf is here: -pdf.html
cl - pdf copyright 2002 - 2005 see license.txt for the details (in-package #:cl-user) (defpackage :pdf (:nicknames :cl-pdf) (:use :common-lisp :iterate) (:export #:*compress-streams* #:*zlib-search-paths* #:*zlib-loaded* #:load-zlib #:*max-number-of-pages* #:max-number-of-pages-reached #:*afm-files...
5df9c7f4d3fde6bac7a33e9a650a8bd7345d345cf6c11d6c57018702fd3ee218
NetComposer/nksip
timer_test_ua1.erl
%% ------------------------------------------------------------------- %% %% timer_test: Timer (RFC4028) Tests %% Copyright ( c ) 2013 . 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 Lic...
null
https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/timer_test_ua1.erl
erlang
------------------------------------------------------------------- timer_test: Timer (RFC4028) Tests 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 s...
Copyright ( c ) 2013 . 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(timer_test_ua1). -i...
312f382998f46a6a2695f93fe1e1b09e7ac292feea197c789772c42742ce0a91
Tim-ats-d/Postem-markup
types.ml
type doc = expr list [@@deriving show] and expr = | Text of string | White of string | Unformat of string | Group of expr list | UnaryOp of { op : string; group : expr } | BinOp of { op : string; left : expr; right : expr }
null
https://raw.githubusercontent.com/Tim-ats-d/Postem-markup/0af4b265474d970662bbd14d2ee9c0bd4ecef1cd/src/ast/types.ml
ocaml
type doc = expr list [@@deriving show] and expr = | Text of string | White of string | Unformat of string | Group of expr list | UnaryOp of { op : string; group : expr } | BinOp of { op : string; left : expr; right : expr }
9823299f5d3745c00c658492d4a240cbf2a602823e575069bcdb1dd0aa3ef30a
DataHaskell/dh-core
Spec.hs
module Main where import qualified PropTests as P import qualified UnitTests as U import qualified Test.Tasty as Ts groupTest :: Ts.TestTree groupTest = Ts.testGroup "Analyze tests" [P.propTests, U.tests] main :: IO () main = do Ts.defaultMain groupTest
null
https://raw.githubusercontent.com/DataHaskell/dh-core/2beb8740f27fa9683db70eb8d8424ee6c75d3e91/analyze/test/Spec.hs
haskell
module Main where import qualified PropTests as P import qualified UnitTests as U import qualified Test.Tasty as Ts groupTest :: Ts.TestTree groupTest = Ts.testGroup "Analyze tests" [P.propTests, U.tests] main :: IO () main = do Ts.defaultMain groupTest
19260f2d8b678c59935b20b44576f2dca00b97a95088779718d2b29ae789bebc
glguy/advent2020
Day17.hs
# Language ImportQualifiedPost , BlockArguments # | Module : Main Description : Day 17 solution Copyright : ( c ) , 2020 License : ISC Maintainer : < > This automata implementation uses a few optimizations : It precomputes the neighborhood map that can be quickly translated to a...
null
https://raw.githubusercontent.com/glguy/advent2020/ed247131684efa699bd34b846b5d939e9db749fc/execs/Day17.hs
haskell
| Find the coordinates of live cells. | >>> :main ^ neighbor generator ^ input coordinates | Determine if a cell should be alive in the next generation. ^ previous generation ^ coordinate ^ live neighbor count ^ alive in next generation | Compute the ne...
# Language ImportQualifiedPost , BlockArguments # | Module : Main Description : Day 17 solution Copyright : ( c ) , 2020 License : ISC Maintainer : < > This automata implementation uses a few optimizations : It precomputes the neighborhood map that can be quickly translated to a...
7740259db8fdec85a95928a47ea06a8e97c4479cad67740b19777dc6c73545e5
michaelt/tagless
TTFdB.hs
-- * Essentially, Haskell98! # LANGUAGE NoMonomorphismRestriction # -- * Typed tagless-final interpreters for simply-typed lambda-calculus -- * de Bruijn indices -- based on the code accompanying the paper by , , and module TTFdB where -- * Abstracting over the final interpreter in IntroHOIF.hs -- This ...
null
https://raw.githubusercontent.com/michaelt/tagless/05ca14710d0704fb1e5a52ee6887f0d52a3c0372/TTFdB.hs
haskell
* Essentially, Haskell98! * Typed tagless-final interpreters for simply-typed lambda-calculus * de Bruijn indices based on the code accompanying the paper by * Abstracting over the final interpreter in IntroHOIF.hs This class defines syntax (and its instances, semantics) of our language Symantics would then ha...
# LANGUAGE NoMonomorphismRestriction # , , and module TTFdB where I could 've moved s and z into a separate ` ` class v : : var_repr h a - > repr h a class Symantics repr where add :: repr h Int -> repr h Int -> repr h Int s :: repr h a -> repr (any,h) a lam :: repr (a,h) b -> r...
0eb006b57cd7c22c352736a50c3fd5b10a83ae602d2c00af30d024494bb10270
careercup/CtCI-6th-Edition-Clojure
chapter_4_q8.clj
(ns ^{:author "Leeor Engel"} chapter-4.chapter-4-q8 (:require [clojure.zip :as zip] [data-structures.tree :refer :all])) (defn- parent [n depth] (let [parent (zip/up n)] (if (some? parent) [parent (dec depth)] [n depth]))) (defn- first-common-ancestor-helper [n1 n1-depth n2 n2-depth] (let [[n1-p...
null
https://raw.githubusercontent.com/careercup/CtCI-6th-Edition-Clojure/ef151b94978af82fb3e0b1b0cd084d910870c52a/src/chapter_4/chapter_4_q8.clj
clojure
(ns ^{:author "Leeor Engel"} chapter-4.chapter-4-q8 (:require [clojure.zip :as zip] [data-structures.tree :refer :all])) (defn- parent [n depth] (let [parent (zip/up n)] (if (some? parent) [parent (dec depth)] [n depth]))) (defn- first-common-ancestor-helper [n1 n1-depth n2 n2-depth] (let [[n1-p...
e75669810ba812664bc6205b50b0923b6b4d6c1cd0bf9624b7a8aacef926bf73
uselessd/eox9p
9p_zero.erl
Copyright ( c ) 2013 - 2014 Cloudozer LLP . All rights reserved . %% %% Redistribution and use in source and binary forms, with or without %% modification, are permitted provided that the following conditions are met: %% %% * Redistributions of source code must retain the above copyright notice, this %% list of con...
null
https://raw.githubusercontent.com/uselessd/eox9p/7b6d879ed9b0e00fb8006d9d819a715de8de1f5b/src/9p_zero.erl
erlang
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must r...
Copyright ( c ) 2013 - 2014 Cloudozer LLP . All rights reserved . THIS SOFTWARE IS PROVIDED BY CLOUDOZER LLP ` ` AS IS '' AND ANY EXPRESS OR DISCLAIMED . IN NO EVENT SHALL CLOUDOZER LLP BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMI...
ca0fd9db41573bd00e9db800d92ff50ae68bccf2a66ffd1656b2bd3457625948
joshvera/effects
Coroutine.hs
module Coroutine where import Control . Monad . Effect . Coroutine -- First example of coroutines yieldInt : : ( Member ( Yield Int ( ) ) r ) = > Int - > Eff r ( ) yieldInt = yield th1 : : ( Member ( Yield Int ( ) ) r ) = > Eff r ( ) th1 = yieldInt 1 > > yieldInt 2 c1 = ( loop = < < runC th1 ) w...
null
https://raw.githubusercontent.com/joshvera/effects/b2693454131dc7c00d2cf45bea69c17b986f0ea5/examples/src/Coroutine.hs
haskell
First example of coroutines First example of coroutines 1 2 Done Add dynamic variables The code is essentially the same as that in transf.hs (only added a type specialization on yield). The inferred signature is different though. Before it was th2 :: MonadReader Int m => CoT Int m () Now it is more genera...
module Coroutine where import Control . Monad . Effect . Coroutine yieldInt : : ( Member ( Yield Int ( ) ) r ) = > Int - > Eff r ( ) yieldInt = yield th1 : : ( Member ( Yield Int ( ) ) r ) = > Eff r ( ) th1 = yieldInt 1 > > yieldInt 2 c1 = ( loop = < < runC th1 ) where loop ( Y x k ) = trace ( sho...
9a3e31a21393385fbb2f29c51405b625cc375056293fdc6df46a3f3d0751ccf0
BetterThanTomorrow/joyride
bar.cljs
(ns bar (:require [foo] ["vscode" :as vscode])) (vscode/window.showInformationMessage (str (foo/x2 42)))
null
https://raw.githubusercontent.com/BetterThanTomorrow/joyride/3941a5464f444994b70991c3e3090b851407e116/playground/hello-joyride/.joyride/scripts/bar.cljs
clojure
(ns bar (:require [foo] ["vscode" :as vscode])) (vscode/window.showInformationMessage (str (foo/x2 42)))
625328df2ce3d9a65e688ebcd6e54ae4e441e11dae62ba8098feac27debed6c7
verement/lmdb-simple
Simple.hs
{-# LANGUAGE ConstraintKinds #-} | Module : Database . : Simple Haskell API for Copyright : © 2017–2018 : : Stability : experimental This module provides a simple Haskell API for the < -memory-mapped-database/ Lightning Memory - mapped Database > ( ) . Example usage : ...
null
https://raw.githubusercontent.com/verement/lmdb-simple/d857a421076e4403b02bae35707fc2d1b14d49a9/src/Database/LMDB/Simple.hs
haskell
# LANGUAGE ConstraintKinds # Just 2 Nothing Just 2 Nothing * Environments * Transactions * Databases * Access modes | LMDB environments have various limits on the size and number of databases and concurrent readers. ^ memory map size, in bytes (also the maximum size of all databases) ^ maximum number of ...
| Module : Database . : Simple Haskell API for Copyright : © 2017–2018 : : Stability : experimental This module provides a simple Haskell API for the < -memory-mapped-database/ Lightning Memory - mapped Database > ( ) . Example usage : @ module Main where import...
d25e80b81ce45c29d436ed88c7f2baf2ecd95688595c2fc0d2e1483111012713
mokus0/bitvec
MVector.hs
module Tests.MVector where import Support import Control.Monad import Control.Monad.ST import Data.Bit import Data.STRef import qualified Data.Vector.Generic as V import qualified Data.Vector.Generic.New as N import qualified Data.Vector.Unboxed.Bit as B import qualified Data.Vector.Unboxe...
null
https://raw.githubusercontent.com/mokus0/bitvec/abca33007838309043a352815f9f83ee86d9dbaf/test/Tests/MVector.hs
haskell
module Tests.MVector where import Support import Control.Monad import Control.Monad.ST import Data.Bit import Data.STRef import qualified Data.Vector.Generic as V import qualified Data.Vector.Generic.New as N import qualified Data.Vector.Unboxed.Bit as B import qualified Data.Vector.Unboxe...
582daa92b67e8da806c05ed5701864f80f37e8bfe9237f3936dd0c38296853cc
itchyny/vim-haskell-sort-import
import_operators_groups.in.hs
import E ((<>)) import C ( (<>), (<+>), (<*>) ) import B ( (<>), (<+>), (<*>) ) import D import A ( (<>), (<+>), (<*>) )
null
https://raw.githubusercontent.com/itchyny/vim-haskell-sort-import/bfe4b6a5e212828ef14e611fa8c358b3960d4f9f/test/operator/import_operators_groups.in.hs
haskell
import E ((<>)) import C ( (<>), (<+>), (<*>) ) import B ( (<>), (<+>), (<*>) ) import D import A ( (<>), (<+>), (<*>) )
c34b7b87d4d65825f35763e8828c2cd49b5dff10efd58169e439c099bc0c3fd1
xapi-project/xenopsd
coverage.mli
(** [init name] sets up coverage profiling for binary [name]. You could use [Sys.argv.(0)] for [name]. *) val init : string -> unit
null
https://raw.githubusercontent.com/xapi-project/xenopsd/f4da21a4ead7c6a7082af5ec32f778faf368cf1c/profiling/coverage.mli
ocaml
* [init name] sets up coverage profiling for binary [name]. You could use [Sys.argv.(0)] for [name].
val init : string -> unit
11b38040e1d9b4201efa15138bfe8c5cd7d54bfdae2cc230b8be6a8eb42d2854
yzh44yzh/erma
subselect_tests.erl
-module(subselect_tests). -include("erma.hrl"). -include_lib("eunit/include/eunit.hrl"). %%% module API subselect1_test() -> SQ = {select, ["id"], "users", [{where, [{"age", gt, 18}]}]}, Q = {select, [], "users", [{where, [{"id", in, SQ}]}]}, S = <<"SELECT * FROM users WHERE id IN (SELECT id FROM users W...
null
https://raw.githubusercontent.com/yzh44yzh/erma/454f127fcf6df0407de2f357f40a1d57f016d694/test/subselect_tests.erl
erlang
module API
-module(subselect_tests). -include("erma.hrl"). -include_lib("eunit/include/eunit.hrl"). subselect1_test() -> SQ = {select, ["id"], "users", [{where, [{"age", gt, 18}]}]}, Q = {select, [], "users", [{where, [{"id", in, SQ}]}]}, S = <<"SELECT * FROM users WHERE id IN (SELECT id FROM users WHERE age > 18)"...
289045d91cfb422fde690dee08c6b7a22bf686c0bbe6ff6add3586ba9cbf034f
bobzhang/fan
strip.ml
open Astf let ant x = x ;; %fans{ keep off; derive(Strip);};; %ocaml{%include{ "../common/astf.ml"};; };; (* local variables: *) compile - command : " cd .. & & pmake main_annot / strip.cmo " (* end: *)
null
https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/main/strip.ml
ocaml
local variables: end:
open Astf let ant x = x ;; %fans{ keep off; derive(Strip);};; %ocaml{%include{ "../common/astf.ml"};; };; compile - command : " cd .. & & pmake main_annot / strip.cmo "
fbcc8986bbd66c3e54a5c44ed7073072841e0dfb21469af8cf66376214317dc1
processone/epam
epam_app.erl
%%%------------------------------------------------------------------- %%% File : epam.erl Author : < > %%% Purpose : PAM application Created : 4 Apr 2013 by < > %%% %%% Copyright ( C ) 2002 - 2023 ProcessOne , SARL . All Rights Reserved . %%% Licensed under the Apache License , Version 2.0 ( the " L...
null
https://raw.githubusercontent.com/processone/epam/5a098856d173174a4e78d02db4a794f7b5073772/src/epam_app.erl
erlang
------------------------------------------------------------------- File : epam.erl Purpose : PAM application 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 WARRA...
Author : < > Created : 4 Apr 2013 by < > Copyright ( C ) 2002 - 2023 ProcessOne , SARL . All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(epam_app). -behaviour(application). -expo...
9ccc17f6e435b1d48580630f301d04d854584cf861f283dcdd7ce79479e82602
logicshan/pj-lester-book
Template5.hs
module Template5 where import Language import Utils runProg :: [Char] -> [Char] compile :: CoreProgram -> TiState eval :: TiState -> [TiState] showResults :: [TiState] -> [Char] runProg = showResults . eval . compile . parse type TiState = (TiStack, TiDump, TiHeap, TiGlobals, TiStats) type TiStack = [Addr] type TiHe...
null
https://raw.githubusercontent.com/logicshan/pj-lester-book/2ddb3fadc35800582002dd34be351980df2dec65/Template5.hs
haskell
Body of supercombinator Association of names to addresses address of root of instance Body of supercombinator Address of node to update Associate parameters to addresses Application Supercombinator Number Indirection Primitive Tag, list of components Get the arg node itself Extract the value Leaves root ...
module Template5 where import Language import Utils runProg :: [Char] -> [Char] compile :: CoreProgram -> TiState eval :: TiState -> [TiState] showResults :: [TiState] -> [Char] runProg = showResults . eval . compile . parse type TiState = (TiStack, TiDump, TiHeap, TiGlobals, TiStats) type TiStack = [Addr] type TiHe...
3fb2bf2de8cd651e8cdb491d872604704516b1826375316033cca6d8e1955a35
RoadRunnr/ezmq
ezmq_socket_dealer.erl
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 /. -module(ezmq_socket_dealer). %% -------------------------------------------------------------------- %% Include files %% ---------------------...
null
https://raw.githubusercontent.com/RoadRunnr/ezmq/79d10e8b2cb53d35b3371450267afe1f3f5f31f7/src/ezmq_socket_dealer.erl
erlang
-------------------------------------------------------------------- Include files -------------------------------------------------------------------- =================================================================== API =================================================================== ========================...
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 /. -module(ezmq_socket_dealer). -include("ezmq_internal.hrl"). -export([init/1, close/4, encap_msg/4, decap_msg/5]). -export([idle/4]). -record...
bfa7a08d46df2956a865423d17c6f0bfdd5fa2b45d0d560c66eeaa70f664fdb6
jguhlin/ODG
util.clj
(ns odg.util (:require [odg.batch :as batch] [odg.db :as db] [taoensso.timbre :as timbre] [co.paralleluniverse.pulsar.core :as p] clojure.core.memoize)) (timbre/refer-timbre) ( def landmarks - pool ( co.paralleluniverse.fibers . FiberForkJoinScheduler " landmarks - pool " 4 nil false ) ) ; Run i...
null
https://raw.githubusercontent.com/jguhlin/ODG/c8a09f273c278ba7b3acbd37155477979f8b4851/src/odg/util.clj
clojure
Run in a separate pool . 4 threads as a default .
(ns odg.util (:require [odg.batch :as batch] [odg.db :as db] [taoensso.timbre :as timbre] [co.paralleluniverse.pulsar.core :as p] clojure.core.memoize)) (timbre/refer-timbre) (defn dabs [^Double x] (java.lang.Math/abs x)) (defn- -create-landmark [landmark pos] (str (clojure.string/lowe...
a1a1153d1d6bb1c44ab5b3b6798dc9cfefc5b294d7086cab05099bfeed37d9bc
SuYi1995/game_server
rfc4627_jsonrpc_inets.erl
JSON - RPC for Erlang 's inets httpd %%--------------------------------------------------------------------------- @author < > @author LShift Ltd. < > 2007 , 2008 and LShift Ltd. @license %% %% Permission is hereby granted, free of charge, to any person %% obtaining a copy of this software and asso...
null
https://raw.githubusercontent.com/SuYi1995/game_server/b9a8574589075a1264c3d1f9a564d6d2ea8ae574/src/tools/json/rfc4627_jsonrpc_inets.erl
erlang
--------------------------------------------------------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, a...
JSON - RPC for Erlang 's inets httpd @author < > @author LShift Ltd. < > 2007 , 2008 and LShift Ltd. @license files ( the " Software " ) , to deal in the Software without of the Software , and to permit persons to whom the Software is included in all copies or substantial portions of the Soft...
647d985581b61ecbad7859ea50e15e4e6a5a6f33f9c871547e11c891cf57f8ea
kappelmann/engaging-large-scale-functional-programming
Exercise02.hs
module Exercise02 where import Data.List (sortBy, sort) startupRevenue : : [ Int ] - > Int loop ( sort cus ) 0 where loop [ ] x = x loop ( x : xs ) y | x * ( length xs + 1 ) > y = loop xs ( x * ( length xs + 1 ) ) | otherwise = loop xs y startupRevenue :: [Int] -> Int startupR...
null
https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/8ed2c056fbd611f1531230648497cb5436d489e4/resources/contest/example_data/02/uploads/functional0programators/Exercise02.hs
haskell
remember the numbers you checked
module Exercise02 where import Data.List (sortBy, sort) startupRevenue : : [ Int ] - > Int loop ( sort cus ) 0 where loop [ ] x = x loop ( x : xs ) y | x * ( length xs + 1 ) > y = loop xs ( x * ( length xs + 1 ) ) | otherwise = loop xs y startupRevenue :: [Int] -> Int startupR...
07e7e7b316af07675c66f3050dd60961c326a73d6c435bcae88db3df32b95fbb
lisp/de.setf.amqp
parameters.lisp
;;;-* Package: rabbitmq; -*- (in-package :rabbitmq) ;; PARAMETERS.LISP , Ravenbrook Limited , 2007 - 09 - 20 , setf.de , 2010 - 02 - 04 ;; 1 . INTRODUCTION ;; ;; This document is to define the parameters used by the rabbitmq interface. ;; ;; See Appendix C be...
null
https://raw.githubusercontent.com/lisp/de.setf.amqp/03181135ddf15cb3866fbf4285c8b6d3eeeb660e/rabbitmq/parameters.lisp
lisp
-* Package: rabbitmq; -*- PARAMETERS.LISP This document is to define the parameters used by the rabbitmq interface. See Appendix C below for copyright and license. seconds A. REFERENCES B. HISTORY See `rabbitmq.asd` for the license terms for the original org.levine.rabbitmq...
(in-package :rabbitmq) , Ravenbrook Limited , 2007 - 09 - 20 , setf.de , 2010 - 02 - 04 1 . INTRODUCTION 2 . CONFIGURE 2.1 . Run time parameters [ 1 ] [ org.levine.rabbitmq]( / cl - rabbit/ ) 2007 - 09 - 20 NDL Created . 2010 - 01 - 10 JAA Emulation / de.setf.amqp . C...
03f2f8eb5fdfca2c7015a042ab9806d6d01777ac2354b23984c680d65f27915d
alanz/ghc-exactprint
AddHiding1.hs
module AddHiding1 where import Data.Maybe import Data.Maybe hiding (n1,n2) f = 1
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/transform/AddHiding1.hs
haskell
module AddHiding1 where import Data.Maybe import Data.Maybe hiding (n1,n2) f = 1
4cf388fefe801149eb09d8a499b5061109f9d4d1f4bedbe0e204d0aa5db4d557
jship/monad-logger-aeson
MetadataNoThreadContextNo.hs
# LANGUAGE NamedFieldPuns # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE QuasiQuotes # module TestCase.LogErrorN.MetadataNoThreadContextNo ( testCase ) where import Control.Monad.Logger.Aeson (Loc(..), LogLevel(..), LoggedMessage(..), logErrorN) import Data.Aeson.QQ.Simple (aesonQQ) import Data.Time (UTCTime(..))...
null
https://raw.githubusercontent.com/jship/monad-logger-aeson/209a4f8cea11ac25721d5fe06783e4ce461c1d70/monad-logger-aeson/test-suite/TestCase/LogErrorN/MetadataNoThreadContextNo.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NamedFieldPuns # # LANGUAGE QuasiQuotes # module TestCase.LogErrorN.MetadataNoThreadContextNo ( testCase ) where import Control.Monad.Logger.Aeson (Loc(..), LogLevel(..), LoggedMessage(..), logErrorN) import Data.Aeson.QQ.Simple (aesonQQ) import Data.Time (UTCTime(..)) import TestCase (TestCase(..)) imp...
5256429ed11c4cacea0a496a716efe962aa5d5f62a0a87c9af14d09c5ecc1d0e
zkincaid/duet
compressedWeightedForest.ml
module A = BatDynArray type 'a link = { mutable parent : int; mutable weight : 'a } type node = int type 'a t = { links : ('a link option) A.t; one : 'a; mul : 'a -> 'a -> 'a } let create ~mul ~one = { links = A.make 32; one; mul } let rec compress forest i = match A.get forest.links i with |...
null
https://raw.githubusercontent.com/zkincaid/duet/eb3dbfe6c51d5e1a11cb39ab8f70584aaaa309f9/srk/src/compressedWeightedForest.ml
ocaml
module A = BatDynArray type 'a link = { mutable parent : int; mutable weight : 'a } type node = int type 'a t = { links : ('a link option) A.t; one : 'a; mul : 'a -> 'a -> 'a } let create ~mul ~one = { links = A.make 32; one; mul } let rec compress forest i = match A.get forest.links i with |...
f8690bc65a56d6c32a60e1a9de639fc3e7d91e373b42e0ca71c3c547858a6918
haskell/ghcup-hs
Spec.hs
-- file test/Spec.hs # OPTIONS_GHC -F - discover -optF --module - name = Spec #
null
https://raw.githubusercontent.com/haskell/ghcup-hs/00d5691a1394ad37bacd355c9c43fb9455e12c77/test/Spec.hs
haskell
file test/Spec.hs module - name = Spec #
c672202e892569aacdd5b013d1e58c3281206752732697201d2bcd3854ed8425
skanev/playground
03-tests.scm
(require rackunit rackunit/text-ui) (load-relative "../../support/eopl.scm") (load-relative "../03.scm") (define eopl-B.03-tests (test-suite "Tests for EOPL exercise B.03" (check-equal? (value-of "1 + 2") 3) (check-equal? (value-of "3 - 2") 1) (check-equal? (value-of "3 - 2 - 1") 0) (check-equal...
null
https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/B/tests/03-tests.scm
scheme
(require rackunit rackunit/text-ui) (load-relative "../../support/eopl.scm") (load-relative "../03.scm") (define eopl-B.03-tests (test-suite "Tests for EOPL exercise B.03" (check-equal? (value-of "1 + 2") 3) (check-equal? (value-of "3 - 2") 1) (check-equal? (value-of "3 - 2 - 1") 0) (check-equal...
0bc074ef401e2e83ce610aecc5a34728bfc177da43ac46450aabcad18f7ab5ea
onyx-platform/onyx
triggers.cljc
(ns onyx.triggers (:require [onyx.windowing.units :refer [coerce-key to-standard-units standard-units-for]] [onyx.static.util :refer [kw->fn now ms->ns]])) State helper functions (defn next-fire-time [{:keys [trigger/period] :as trigger}] (if (= (standard-units-for (second period)) :milliseconds) ...
null
https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/triggers.cljc
clojure
cljs clock is susceptible to time changes Fire predicate functions If this was stimulated by a new segment, check if it should fire. Otherwise if this was a completed task, always fire. Top level vars to bundle the functions together
(ns onyx.triggers (:require [onyx.windowing.units :refer [coerce-key to-standard-units standard-units-for]] [onyx.static.util :refer [kw->fn now ms->ns]])) State helper functions (defn next-fire-time [{:keys [trigger/period] :as trigger}] (if (= (standard-units-for (second period)) :milliseconds) ...
bf28385d4cca803b0448bb0f9912e7691780768e1be453cf74624a7ec0b18a99
randomseed-io/phone-number
dialing_region.clj
(ns ^{:doc "Clojure interface to Libphonenumber, dialing region." :author "Paweł Wilk" :added "8.12.4-2" :no-doc true} phone-number.dialing-region) (comment nil)
null
https://raw.githubusercontent.com/randomseed-io/phone-number/99ac91d5b89f3bca44db4d03b5e27e0999760908/src/phone_number/dialing_region.clj
clojure
(ns ^{:doc "Clojure interface to Libphonenumber, dialing region." :author "Paweł Wilk" :added "8.12.4-2" :no-doc true} phone-number.dialing-region) (comment nil)
b95f079539403825958e6730f19021d4ba7c33eb6f6e9e566deb3265d68a5152
PatrickMaier/HdpH
Closure.hs
This module implements an /explicit closure/ API as described in [ 2 ] below ; -- the closure representation is novel (and as yet unpublished). It makes extensive use of Template Haskell , and due to TH 's stage -- restrictions, internals like the actual closure representation are -- delegated to module 'Control.Pa...
null
https://raw.githubusercontent.com/PatrickMaier/HdpH/e836a5bcf5a6c93239f9c0d0109d7b81b459897f/hdph-closure/src/Control/Parallel/HdpH/Closure.hs
haskell
the closure representation is novel (and as yet unpublished). restrictions, internals like the actual closure representation are delegated to module 'Control.Parallel.HdpH.Closure.Internal'. --------------------------------------------------------------------------- References: * Explicit Closures ** Key fac...
This module implements an /explicit closure/ API as described in [ 2 ] below ; It makes extensive use of Template Haskell , and due to TH 's stage Author : | Explicit Closures , inspired by [ 1 ] and refined by [ 2 ] . ( 1 ) Epstein , Black , . /Towards in the Cloud/. Haskell Symposium 2011 . (...
aeb2cefdb9b1fc9e878612a3d3714f5f3ab536b72df1212fb4bcde9f68a29802
xtdb/xtdb
document_store.clj
(ns xtdb.fixtures.document-store (:require [clojure.test :as t] [xtdb.api :as xt] [xtdb.codec :as c] [xtdb.db :as db])) (defn test-doc-store [doc-store] (let [alice {:xt/id :alice, :name "Alice"} alice-key (c/new-id alice) bob {:xt/id :bob, :name "Bob"} b...
null
https://raw.githubusercontent.com/xtdb/xtdb/e2f51ed99fc2716faa8ad254c0b18166c937b134/test/src/xtdb/fixtures/document_store.clj
clojure
(ns xtdb.fixtures.document-store (:require [clojure.test :as t] [xtdb.api :as xt] [xtdb.codec :as c] [xtdb.db :as db])) (defn test-doc-store [doc-store] (let [alice {:xt/id :alice, :name "Alice"} alice-key (c/new-id alice) bob {:xt/id :bob, :name "Bob"} b...
edfd9ce43c17516bec0641a868d8f0384cfe9051731bc6a3ebf85a01996d3afc
pkpkpk/fress
codes.cljs
(ns fress.impl.codes) (def ^:const PRIORITY_CACHE_PACKED_START 0x80) (def ^:const PRIORITY_CACHE_PACKED_END 0xA0) (def ^:const STRUCT_CACHE_PACKED_START 0xA0) (def ^:const STRUCT_CACHE_PACKED_END 0xB0) (def ^:const LONG_ARRAY 0xB0) (def ^:const DOUBLE_ARRAY 0xB1) (def ^:const BOOLEAN_ARRAY 0xB2) (def ^:const INT_ARRAY...
null
https://raw.githubusercontent.com/pkpkpk/fress/16bd5bec7b0a9f4eb7809ae3b8c1c9cbca3d33da/src/main/cljs/fress/impl/codes.cljs
clojure
<= unique to fress client
(ns fress.impl.codes) (def ^:const PRIORITY_CACHE_PACKED_START 0x80) (def ^:const PRIORITY_CACHE_PACKED_END 0xA0) (def ^:const STRUCT_CACHE_PACKED_START 0xA0) (def ^:const STRUCT_CACHE_PACKED_END 0xB0) (def ^:const LONG_ARRAY 0xB0) (def ^:const DOUBLE_ARRAY 0xB1) (def ^:const BOOLEAN_ARRAY 0xB2) (def ^:const INT_ARRAY...
840c560e98b8d5d8403777279a638a9ea3f78be5bc1f0cff96b4acb0bd27ed75
zyla/type-level-web-server
Parser.hs
module Parser where import Data.Char import Text.Parsec import Text.Parsec.String type Cont = String type Bytes = [Int] data Operation = Exit | Listen Int Cont | Accept Int Cont | Write Int Bytes Cont | Read Int Int Cont | Open Bytes Cont | Close Int Cont deriving (Eq, Show)...
null
https://raw.githubusercontent.com/zyla/type-level-web-server/f13d90909fc670fc630e92798927e9fe4dcb2366/runtime/Parser.hs
haskell
HACK
module Parser where import Data.Char import Text.Parsec import Text.Parsec.String type Cont = String type Bytes = [Int] data Operation = Exit | Listen Int Cont | Accept Int Cont | Write Int Bytes Cont | Read Int Int Cont | Open Bytes Cont | Close Int Cont deriving (Eq, Show)...
3bf0044763852b49eafc4b8332040ee10e4c5b87b6d9ac7b779a8b543fbca964
bufferswap/ViralityEngine
examples.lisp
(in-package #:virality-examples) ;; TODO: Add prologue/epilogue example.
null
https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/examples/src/examples.lisp
lisp
TODO: Add prologue/epilogue example.
(in-package #:virality-examples)
deb5eb33d41fc2c600c7807e01b982651a57f53de32b8109f29891607d70080c
tommaisey/aeon
demand-env-gen.help.scm
;; Frequency envelope with random times. (hear (let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200)))) (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0)))) (y (mouse-y kr 0.01 3 1 0.1)) (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing))) (mul (sin-osc ar (mul f (mce2 1 1.0...
null
https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/demand/demand-env-gen.help.scm
scheme
Frequency envelope with random times. Frequency modulation
(hear (let* ((l (dseq dinf (make-mce (list 204 400 201 502 300 200)))) (t (drand dinf (make-mce (list 1.01 0.2 0.1 2.0)))) (y (mouse-y kr 0.01 3 1 0.1)) (f (demand-env-gen ar l (mul t y) 7 0 1 1 1 0 1 do-nothing))) (mul (sin-osc ar (mul f (mce2 1 1.01)) 0) 0.1))) (hear (let* ((x (mouse-x...
af4f76f163ae3f645f78786b33361a314f26b5a0571e8dc9b050888426930e3a
agda/agda
Strict.hs
# LANGUAGE TemplateHaskell # module Internal.Utils.Maybe.Strict ( tests ) where import Agda.Utils.Maybe.Strict import Data.Semigroup () import Prelude hiding ( Maybe ) import Internal.Helpers ------------------------------------------------------------------------------ -- Instances instance Arbitrary a => Arbit...
null
https://raw.githubusercontent.com/agda/agda/f50c14d3a4e92ed695783e26dbe11ad1ad7b73f7/test/Internal/Utils/Maybe/Strict.hs
haskell
---------------------------------------------------------------------------- Instances ---------------------------------------------------------------------------- Properties | 'Maybe a' is a monoid. ---------------------------------------------------------------------- * All tests ---------------------------------...
# LANGUAGE TemplateHaskell # module Internal.Utils.Maybe.Strict ( tests ) where import Agda.Utils.Maybe.Strict import Data.Semigroup () import Prelude hiding ( Maybe ) import Internal.Helpers instance Arbitrary a => Arbitrary (Maybe a) where arbitrary = toStrict <$> arbitrary shrink = map toStrict . shrin...
d39bfebd55c985f4f393d541b1ff60ddb76cd666f39edbfa55979c770bc9e8fb
grin-compiler/ghc-whole-program-compiler-project
FFI.hs
# LANGUAGE RecordWildCards , LambdaCase , OverloadedStrings , PatternSynonyms # module Stg.Interpreter.FFI where --- FFI experimental import qualified GHC.Exts as Exts import qualified Data.ByteString as BS import qualified Data.ByteString.Internal as BS import Control.Concurrent import Foreign.Storable import Foreig...
null
https://raw.githubusercontent.com/grin-compiler/ghc-whole-program-compiler-project/6e75aaccf4df0d78786f5bb1a28778d54c09a7be/external-stg-interpreter/lib/Stg/Interpreter/FFI.hs
haskell
- FFI experimental --- Literal (LitNumber LitNumInt i) Literal (LitNumber LitNumInt i) Literal (LitNumber LitNumInt i) Literal (LitNumber LitNumInt i) Literal (LitNumber LitNumInt i) -------------- -------------- static pointer API misc TODO: for testsuite HINT: getProgArgv :: Ptr CInt -> Ptr (Ptr CString) -> ...
# LANGUAGE RecordWildCards , LambdaCase , OverloadedStrings , PatternSynonyms # module Stg.Interpreter.FFI where import qualified GHC.Exts as Exts import qualified Data.ByteString as BS import qualified Data.ByteString.Internal as BS import Control.Concurrent import Foreign.Storable import Foreign.Ptr import Foreign....
f516a3a9a3b48d719775db34aec1bcefd9c0a12f1eff47c4ff2def944cfa7d20
ocaml-ppx/ppx_import-backup
stuff.cppo.ml
type a = A1 | A2 of string type b = { b1 : a; b2 : string; b3 : Int64.t; } type c = [ `A | `B | `C of string ] type d = Int64.t type e = string * int module type S = sig type f = int end type 'a g = Foo of 'a type h = Zero | Succ of h #if OCAML_VERSION >= (4, 03, 0) module MI = struct type i = int end open...
null
https://raw.githubusercontent.com/ocaml-ppx/ppx_import-backup/6362bc6259bd1a21f620a32d51ebe4653e96b93a/src_test/stuff.cppo.ml
ocaml
type a = A1 | A2 of string type b = { b1 : a; b2 : string; b3 : Int64.t; } type c = [ `A | `B | `C of string ] type d = Int64.t type e = string * int module type S = sig type f = int end type 'a g = Foo of 'a type h = Zero | Succ of h #if OCAML_VERSION >= (4, 03, 0) module MI = struct type i = int end open...
002ad848e06ee4fecc0e299ca1ca957b161b8bfb58c85f0e99f0ac119acbcfe6
backtracking/mlpost
duplicate.ml
(**************************************************************************) (* *) Copyright ( C ) Johannes Kanig , , and (* *) (* This software is f...
null
https://raw.githubusercontent.com/backtracking/mlpost/e82db2d3766f24392956478496fa26c8837c1fef/src/duplicate.ml
ocaml
************************************************************************ This software is free software; you can redistribute it and/or described in file LICENSE....
Copyright ( C ) Johannes Kanig , , and modify it under the terms of the GNU Library General Public License version 2.1 , with the special exception on linking open Types open Hashcons module MetaPath = struct type t = metapath_node hash_consed let equal =...
815b6753fe163ead0e17f666a58d99e611666697992bf3a5aa45fd15d7f22570
WormBase/wormbase_rest
overview.clj
(ns rest-api.classes.pseudogene.widgets.overview (:require [clojure.string :as str] [rest-api.classes.generic-fields :as generic] [rest-api.formatters.object :as obj :refer [pack-obj]])) (defn gene [pg] {:data (when-let [gene (:gene/_corresponding-pseudogene (first ...
null
https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/pseudogene/widgets/overview.clj
clojure
need sequence database (e.g. CRE31928) - not working through catalyst code.
(ns rest-api.classes.pseudogene.widgets.overview (:require [clojure.string :as str] [rest-api.classes.generic-fields :as generic] [rest-api.formatters.object :as obj :refer [pack-obj]])) (defn gene [pg] {:data (when-let [gene (:gene/_corresponding-pseudogene (first ...
a68ccbc86ea18c75386b54489a8833c73085920764113d7ed95c98cf8e440c9d
cjdev/cloud-seeder
ProvisionSpec.hs
module Network.CloudSeeder.ProvisionSpec (spec) where import Control.Lens ((&), (.~), review) import Control.Monad.Except (ExceptT, runExceptT) import Control.Monad.Mock (WithResult(..)) import Data.Functor.Identity (runIdentity) import Data.Semigroup ((<>)) import GHC.Exts (IsList(..)) import Test.Hspec import Netwo...
null
https://raw.githubusercontent.com/cjdev/cloud-seeder/242a3826a0cef58e1c390b51177e025781aecc66/test-suite/Network/CloudSeeder/ProvisionSpec.hs
haskell
module Network.CloudSeeder.ProvisionSpec (spec) where import Control.Lens ((&), (.~), review) import Control.Monad.Except (ExceptT, runExceptT) import Control.Monad.Mock (WithResult(..)) import Data.Functor.Identity (runIdentity) import Data.Semigroup ((<>)) import GHC.Exts (IsList(..)) import Test.Hspec import Netwo...
3dd6870152237b1b5b7139a6566b8b94ab5f83020cb03fb428f016f7d40d735c
tsloughter/kuberl
kuberl_apps_v1beta1_scale_spec.erl
-module(kuberl_apps_v1beta1_scale_spec). -export([encode/1]). -export_type([kuberl_apps_v1beta1_scale_spec/0]). -type kuberl_apps_v1beta1_scale_spec() :: #{ 'replicas' => integer() }. encode(#{ 'replicas' := Replicas }) -> #{ 'replicas' => Replicas }.
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_apps_v1beta1_scale_spec.erl
erlang
-module(kuberl_apps_v1beta1_scale_spec). -export([encode/1]). -export_type([kuberl_apps_v1beta1_scale_spec/0]). -type kuberl_apps_v1beta1_scale_spec() :: #{ 'replicas' => integer() }. encode(#{ 'replicas' := Replicas }) -> #{ 'replicas' => Replicas }.
b529e2514c38af3ba541d9be7404ea9c8ac62b8bf35248323a85decfac7e9ade
jordwalke/rehp
dot_file.ml
Graph viewer * 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 General Public License as published by * the Free Software Foundation ; either version 2 of the License , ...
null
https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/examples/graph_viewer/dot_file.ml
ocaml
Graph viewer * 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 General Public License as published by * the Free Software Foundation ; either version 2 of the License , ...
297afbd2c208a62a29c4f4985c72a78e365073f9ff66f6c927275e640862fad7
dabrady/LittleLogicLangs
micro-internals.rkt
#lang racket (provide conj disj == call/fresh reify-1st call/empty-state var =/=) ;; <- yuk! ;; We introduce a simple abstraction for variables. ;; Variables are numbers. (define (var x) (vector x)) (define (var? x) (vector? x)) ;; At an abstract level, our programs proceed by mandating things be ;; the same. This ma...
null
https://raw.githubusercontent.com/dabrady/LittleLogicLangs/9735f17281e2362d36ad245a1558cce3f93437a7/miniKanren/micro/micro-internals.rkt
racket
<- yuk! We introduce a simple abstraction for variables. Variables are numbers. At an abstract level, our programs proceed by mandating things be the same. This manifests as a list of things to which variables are bound -- including other variables. (define empty-s '()) We can find the meaning of a variable by ...
#lang racket (define (var x) (vector x)) (define (var? x) (vector? x)) (define (ext-s x v s) (cond ((occurs? x v s) #f) (else `((,x . ,v) . ,s)))) (define occurs? (lambda (x v s) (let ((v (walk v s))) (cond ((var? v) (eq? x v)) ((pair? v) (or (occurs? x (car v) s) ...
431476e31f5058c9708f3964f7ab8c25b6a6b7a941f46fb9c57ec1b2c39c315e
dixonary/microcosmos
Main.hs
from import Network.Wai.Handler.Warp (run) -- from warp import Network.HTTP.Types -- from http-types import Control.Monad import Control.Applicative import Data.Maybe import Data.Functor import Data.Function import Data.Bifunctor import System.IO import System.Process ...
null
https://raw.githubusercontent.com/dixonary/microcosmos/3591a94ab231b688bc76c06004d81056fcd43357/src/Main.hs
haskell
from warp from http-types from process from text from directory from directory from split from containers from containers from time from time from friendly-time from file-embed ---------------------------------------------------------- Constants Only consider these file extensions when looking for posts....
from import Control.Monad import Control.Applicative import Data.Maybe import Data.Functor import Data.Function import Data.Bifunctor import System.IO import Data.Char (isSpace) import qualified Data.ByteString.Lazy.Char8 as LBS from bytestring from bytestring from FilePath import qualified Data.List as...
872990d973ede691301da26220ee2e17cce704e4a6453683e91d92c895d7eba9
haskell-github/github
SearchSpec.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # module GitHub.SearchSpec where import Prelude () import Prelude.Compat import Data.Aeson (eitherDecodeStrict) import Data.FileEmbed (embedFile) import Data.Proxy (Proxy (..)) import Data.String (fromString) import System.Env...
null
https://raw.githubusercontent.com/haskell-github/github/d9ac0c7ffbcc720a24d06f0a96ea4e3891316d1a/spec/GitHub/SearchSpec.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell # module GitHub.SearchSpec where import Prelude () import Prelude.Compat import Data.Aeson (eitherDecodeStrict) import Data.FileEmbed (embedFile) import Data.Proxy (Proxy (..)) import Data.String (fromString) import System.Environment (lookupEnv) import Test.Hs...
15e636aba907473da501392934a5cdb08bf795f9d4aae6384f59ed9cfc583a8b
openmusic-project/RQ
tatum-seg-algorithm.lisp
(in-package :om) ;;;============================ ;;; ALGORITHM FOR SEGMENTATION IN CONSTANT-TATUM REGIONS ;;; Algorithm based on , , : " A Dynamic Programming Approach to for Rhythm Transcription " ;;; Note that the pseudo-code given in the above paper is false (indexes do not match), but the principle is...
null
https://raw.githubusercontent.com/openmusic-project/RQ/d6b1274a4462c1500dfc2edab81a4425a6dfcda7/src/algorithm/tatum-seg-algorithm.lisp
lisp
============================ ALGORITHM FOR SEGMENTATION IN CONSTANT-TATUM REGIONS Note that the pseudo-code given in the above paper is false (indexes do not match), but the principle is correct. Moreover, a customizable "new segment penalty" has been added in order to prevent the algorithm from placing a new segme...
(in-package :om) Algorithm based on , , : " A Dynamic Programming Approach to for Rhythm Transcription " (defpackage "CTSeg" (:nicknames :cts) (:use "COMMON-LISP" "CL-USER" "OM-API" "LISPWORKS" "OM-LISP") (:import-from "CL-USER") (:export #:segmentation) ) (in-package :cts) (de...
aa0837bc516484aaac8ab85cf245751761524d43322d09a35a877b3aba5df75c
racket/racket7
test.rkt
#lang racket (require rackunit rackunit/text-ui xml xml/plist mzlib/etc "to-list.rkt") test - bad - read - input : format - void First argument is the input , second is the error message (define ((mk-test-read-xml/exn read-xml) format-str err-string) (define str (...
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/pkgs/racket-test/tests/xml/test.rkt
racket
XXX need more read-xml tests XXX need more read-xml/element tests XXX need more syntax:read-xml tests XXX need more syntax:read-xml/element tests XXX need more write-xml tests XXX need more write-xml/content tests XXX need more display-xml tests XXX need more display-xml/content tests <i> %&quot;f") XXX more x...
#lang racket (require rackunit rackunit/text-ui xml xml/plist mzlib/etc "to-list.rkt") test - bad - read - input : format - void First argument is the input , second is the error message (define ((mk-test-read-xml/exn read-xml) format-str err-string) (define str (...
bfd00cc4e7d69033f8f0c2aebca988cdb55fca5c54f377d265dd4a53dc3a9698
janestreet/krb
context_sequencer.mli
open! Core open Async * Sequence all functions . We use a global context ( in C land ) and there are some functions that are not thread safe . We even have to sequence the finalizers because they too call functions that need a context . some functions that are not thread safe. We even have to sequence...
null
https://raw.githubusercontent.com/janestreet/krb/1105ba1e8b836f80f09e663bc1b4233cf2607e7b/internal/context_sequencer.mli
ocaml
open! Core open Async * Sequence all functions . We use a global context ( in C land ) and there are some functions that are not thread safe . We even have to sequence the finalizers because they too call functions that need a context . some functions that are not thread safe. We even have to sequence...
dcd37cc8bada1e7b8e1e4941783489c8dd1e265d7805ec1348699b601b344c5f
lemmaandrew/CodingBatHaskell
everyNth.hs
From Given a non - empty string and an int N , return the string made starting with char 0 , and then every Nth char of the string . So if N is 3 , use char 0 , 3 , 6 , ... and so on . N is 1 or more . Given a non-empty string and an int N, return the string made starting with char 0, and then every Nth cha...
null
https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Warmup-1/everyNth.hs
haskell
From Given a non - empty string and an int N , return the string made starting with char 0 , and then every Nth char of the string . So if N is 3 , use char 0 , 3 , 6 , ... and so on . N is 1 or more . Given a non-empty string and an int N, return the string made starting with char 0, and then every Nth cha...
d2f1193319ffaaa69d770b50334e2ad9e2a544d84686195e0c28377c931e6f0b
alpheccar/HPDF
PDF.hs
# LANGUAGE CPP # {-# LANGUAGE BangPatterns #-} --------------------------------------------------------- -- | Copyright : ( c ) 2006 - 2016 , alpheccar.org -- License : BSD-style -- -- Maintainer : -- Stability : experimental -- Portability : portable -- -- Generation of PDF documents -- A PDF library with...
null
https://raw.githubusercontent.com/alpheccar/HPDF/5a901376470b549b2354cdd8013e655f7ac19e0b/Graphics/PDF.hs
haskell
# LANGUAGE BangPatterns # ------------------------------------------------------- | License : BSD-style Maintainer : Stability : experimental Portability : portable Generation of PDF documents A PDF library with support for several pages, page transitions, outlines, annotations, compression, colors, ...
# LANGUAGE CPP # Copyright : ( c ) 2006 - 2016 , alpheccar.org # LANGUAGE FlexibleContexts # # LANGUAGE CPP # module Graphics.PDF ( * HPDF PDF , runPdf , pdfByteString , PDFRect(..) , PDFFloat , PDFReference , PDFString , PDFPage , Pages , module Graphics.PDF.Document , module Graphics...
927826428c109de588c99ccc1d6164204addc54930eeb01de05d06c3f31162c6
marcelosousa/llvmvf
Function.hs
------------------------------------------------------------------------------- -- Module : Analysis.Type.Memory.Function Copyright : ( c ) 2013 -- A Type System for Memory Analysis of LLVM IR Modules ------------------------------------------------------------------------------- module Analysis.Type.Memory....
null
https://raw.githubusercontent.com/marcelosousa/llvmvf/c314e43aa8bc8bb7fd9c83cebfbdcabee4ecfe1b/src/Analysis/Type/Memory/Function.hs
haskell
----------------------------------------------------------------------------- Module : Analysis.Type.Memory.Function A Type System for Memory Analysis of LLVM IR Modules ----------------------------------------------------------------------------- trace ("inserting " ++ show n) $ Analyse a function assuming t...
Copyright : ( c ) 2013 module Analysis.Type.Memory.Function (tyanFunction,tyanFnSig) where import qualified Data.Map as M import qualified Data.Set as S import Data.Maybe import Language.LLVMIR import Analysis.Type.Util import Analysis.Type.Memory.Util import Analysis.Type.Memory.Context import Analysis.Type....
5d974b028726da7ca551668f1f80554f80579f7b77464072704d6d5bc27a8c86
we-shop/arrows
arrows.cljc
(ns weshop.arrows #?(:cljs (:require-macros weshop.arrows))) (defmacro ->% "Creates an anonymous function, threading the parameter through the forms provided as the first parameter. Useful for getting around the restriction that you're not allowed to have nested anonymous functions (of the #() variety), esp...
null
https://raw.githubusercontent.com/we-shop/arrows/ab30a98e3fa5a268b731a6e2842ed24aed1b964e/src/weshop/arrows.cljc
clojure
(ns weshop.arrows #?(:cljs (:require-macros weshop.arrows))) (defmacro ->% "Creates an anonymous function, threading the parameter through the forms provided as the first parameter. Useful for getting around the restriction that you're not allowed to have nested anonymous functions (of the #() variety), esp...
7b5503560c6107b60101763a8f9d8e0c27ee8f23b882588e0da8d7118dbdcc65
debug-ito/greskell
GTraversal.hs
# LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies ...
null
https://raw.githubusercontent.com/debug-ito/greskell/ff21b8297a158cb4b5bafcbb85094cef462c5390/greskell/src/Data/Greskell/GTraversal.hs
haskell
# LANGUAGE GADTs # # LANGUAGE OverloadedStrings # | @GraphTraversal@ class object, and a DSL of composing graph traversal steps. * Types ** GraphTraversal and others ** Walk types * Walk/Steps __For now greskell does not cover all graph traversal steps.__ If you want some steps ...
# LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies # # OPTIONS_GHC -fno - warn - redundant - constraints # Module : Data . Gre...
668fc021f81c3773eece735dc01d416cc2c99a7aec9b630a59fb608510f97b2e
sph-mn/sph-lib
base64.scm
(define-test-module (test module sph base64) (import (rnrs bytevectors) (sph base64)) (define-test (base64-encode+decode inp exp) (let (r (base64-decode (base64-encode (first inp)))) (if (equal? (bytevector=? (first inp) r) exp) exp r))) (test-execute-procedures-lambda (base64-encode+decod...
null
https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/modules/test/module/sph/base64.scm
scheme
(define-test-module (test module sph base64) (import (rnrs bytevectors) (sph base64)) (define-test (base64-encode+decode inp exp) (let (r (base64-decode (base64-encode (first inp)))) (if (equal? (bytevector=? (first inp) r) exp) exp r))) (test-execute-procedures-lambda (base64-encode+decod...
6aee89df077446e92bbf44aeb9ca159196e6d553a5a2ce4c5385e08b6bbb3022
brendanhay/amazonka
WorkSpacesWeb.hs
# OPTIONS_GHC -fno - warn - orphans # # OPTIONS_GHC -fno - warn - unused - imports # Derived from AWS service descriptions , licensed under Apache 2.0 . -- | -- Module : Test.Amazonka.Gen.WorkSpacesWeb Copyright : ( c ) 2013 - 2023 License : Mozilla Public License , v. 2.0 . Maintainer : < ...
null
https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workspaces-web/test/Test/Amazonka/Gen/WorkSpacesWeb.hs
haskell
| Module : Test.Amazonka.Gen.WorkSpacesWeb Stability : auto-generated Auto-generated: the actual test selection needs to be manually placed into the top-level so that real test data can be incrementally added. This commented snippet is what the entire set should look like: fixtures :: TestTree fixtures ...
# OPTIONS_GHC -fno - warn - orphans # # OPTIONS_GHC -fno - warn - unused - imports # Derived from AWS service descriptions , licensed under Apache 2.0 . Copyright : ( c ) 2013 - 2023 License : Mozilla Public License , v. 2.0 . Maintainer : < brendan.g.hay+ > Portability : non - portable ( GHC ...
8ce05ed315c71b9ceade31830402f0cfe6b541fa40daee7c32ed65addc7d14fa
altenwald/eimap
eimap_command_namespace.erl
Copyright 2014 Kolab Systems AG ( ) %% ( Kolab Systems ) < seigo a kolabsys.com > %% %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation , either version 3 of the License , or %% (at ...
null
https://raw.githubusercontent.com/altenwald/eimap/cfa94c2e1303b240d8582b30546fd666a7ad128b/src/commands/eimap_command_namespace.erl
erlang
This program is free software: you can redistribute it and/or modify (at your option) any 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 PARTICULAR PURPOSE. See the GNU Library Gener...
Copyright 2014 Kolab Systems AG ( ) ( Kolab Systems ) < seigo a kolabsys.com > it under the terms of the GNU Library General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU Library General Public License -module(...
ce012930bcc669830fa2716c0d9c4e26d1d30e70176624f36304715395b30775
machine-intelligence/provability
Programming.hs
module Modal.Programming where import Prelude hiding ((.), id) import Control.Arrow import Control.Category import Data.Maybe import qualified Data.List as List import Modal.Display import Modal.Formulas import Modal.Parser import Text.Parsec (sepEndBy) import Text.Parsec.Text type ModalProgram a v = a -> ModalFormula...
null
https://raw.githubusercontent.com/machine-intelligence/provability/12d981dfe7d0420b06f5548e96afc3f39f338d26/src/Modal/Programming.hs
haskell
----------------------------------------------------------------------------- The type of partial programs. You must tell them "what to do next" in order Completes a program by adding a default action. Partial program that ignores the continuation and returns a. Partial program that either does t or e before the co...
module Modal.Programming where import Prelude hiding ((.), id) import Control.Arrow import Control.Category import Data.Maybe import qualified Data.List as List import Modal.Display import Modal.Formulas import Modal.Parser import Text.Parsec (sepEndBy) import Text.Parsec.Text type ModalProgram a v = a -> ModalFormula...
ff5ce2e4ceacb0e75c739d78d621cd759676807e8ebc78ecb222eb49c26b9b5f
dgiot/dgiot
dgiot_factory_shift.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2020 - 2021 DGIOT Technologies Co. , Ltd. All Rights Reserved . %% 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...
null
https://raw.githubusercontent.com/dgiot/dgiot/4d50ccac13b4b129b9eb8db2dcdbc51c1f0639b2/apps/dgiot_factory/src/dgiot_factory_shift.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2020 - 2021 DGIOT Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(dgiot_factory_shift). -author("jonhl"). -include_lib("dgiot/include/logger.hrl"). -inc...
48e9d0397c120e33d371674bb13c1678bfd54ce18f74c4a8d2dc390468d5bd2f
UChicago-PL/smyth
clean.mli
(** Hole context cleanup. *) open Lang val clean : hole_ctx -> hole_filling -> (hole_name * exp) list option * [ clean delta hf ] first propagates the expressions in the hole - filling [ hf ] upward to generate a new hole - filling with no expression holes ( except for self - recursive ones , e.g. from ...
null
https://raw.githubusercontent.com/UChicago-PL/smyth/08fea281f70d3ee604fde9dde140c8a570d6905d/lib/smyth/clean.mli
ocaml
* Hole context cleanup.
open Lang val clean : hole_ctx -> hole_filling -> (hole_name * exp) list option * [ clean delta hf ] first propagates the expressions in the hole - filling [ hf ] upward to generate a new hole - filling with no expression holes ( except for self - recursive ones , e.g. from the { e Defer } rule defined ...