_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
c9ba4ae6c6db643adf96d64d72cd4c9ddbc5462736570cdf1441fbf79e5123e8
mmottl/sqlite3-ocaml
test_stmt.ml
open Printf open Sqlite3 let assert_ok rc = assert (rc = Rc.OK) let assert_done rc = assert (rc = Rc.DONE) let column_decltype s i = match column_decltype s i with | None -> "<NONE>" | Some str -> str let stepbystep s = assert_done (iter s ~f:(function r -> Array.iteri (fun i c -> printf "%s column...
null
https://raw.githubusercontent.com/mmottl/sqlite3-ocaml/4a8a5ba4800fe2476637d0eaa1ec296cf98e98c4/test/test_stmt.ml
ocaml
Test the finalization... printf "Create statement %d\n%!" i; printf "Create statement %d\n%!" i; printf "Create statement %d\n%!" i; printf "Create statement %d\n%!" i; printf "Create statement %d\n%!" i; Collect any dangling statements
open Printf open Sqlite3 let assert_ok rc = assert (rc = Rc.OK) let assert_done rc = assert (rc = Rc.DONE) let column_decltype s i = match column_decltype s i with | None -> "<NONE>" | Some str -> str let stepbystep s = assert_done (iter s ~f:(function r -> Array.iteri (fun i c -> printf "%s column...
876593ec73d8962069c05fa9248b8c1c88dcdf2ba1810e94d2c1074aaaed3eba
iskandr/parakeet-retired
SSA_Transform.ml
open Base open PhiNode open TypedSSA type direction = Forward | Backward type 'a update = | NoChange | Update of 'a | UpdateWithStmts of 'a * (stmt_node list) | UpdateWithBlock of 'a * block module type SIMPLE_TRANSFORM_RULES = sig val dir : direction type context val init : fn -> context val finaliz...
null
https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/SSA/SSA_Transform.ml
ocaml
use a record instead of an object to track block state for improved performance initializer add statement to block unless it's a no-op works for both value_node and exp_node check for memory equality of returned results to avoid creating redundant cons cells these exist so we can access the t...
open Base open PhiNode open TypedSSA type direction = Forward | Backward type 'a update = | NoChange | Update of 'a | UpdateWithStmts of 'a * (stmt_node list) | UpdateWithBlock of 'a * block module type SIMPLE_TRANSFORM_RULES = sig val dir : direction type context val init : fn -> context val finaliz...
400eec60ba77498c294e661be103854305180115db4268b24a2f3c88e817feac
tautologico/opfp
c02-basico.ml
OCaml : na Prática do do e valores OCaml: Programação Funcional na Prática Andrei de A. Formiga - Casa do Código Exemplos do Capítulo 02 - Tipos e valores basicos *) Os exemplos deste capítulo foram pensados para uso no REPL , digitando uma expressão de cada vez . usando...
null
https://raw.githubusercontent.com/tautologico/opfp/74ef9ed97b0ab6b78c147c3edf7e0b69f2acf9d1/capitulos/c02-basico.ml
ocaml
Definindo operadores Tuplas Listas Declaração explícita de tipo
OCaml : na Prática do do e valores OCaml: Programação Funcional na Prática Andrei de A. Formiga - Casa do Código Exemplos do Capítulo 02 - Tipos e valores basicos *) Os exemplos deste capítulo foram pensados para uso no REPL , digitando uma expressão de cada vez . usando...
e6ae03551ac0fc937419b835ea7945ab2b1145fc24cad3c9674a5468c310e748
Simre1/haskell-game
InspectorSpec.hs
# LANGUAGE TemplateHaskell # module InspectorSpec where import Control.Monad import Data.IORef import Polysemy import Polysemy.Error import Polysemy.State import Test.Hspec data Callback m a where Callback :: m String -> Callback m () makeSem ''Callback spec :: Spec spec = parallel $ describe "Inspector" $ d...
null
https://raw.githubusercontent.com/Simre1/haskell-game/272a0674157aedc7b0e0ee00da8d3a464903dc67/polysemy/test/InspectorSpec.hs
haskell
# LANGUAGE TemplateHaskell # module InspectorSpec where import Control.Monad import Data.IORef import Polysemy import Polysemy.Error import Polysemy.State import Test.Hspec data Callback m a where Callback :: m String -> Callback m () makeSem ''Callback spec :: Spec spec = parallel $ describe "Inspector" $ d...
8ae4d290c8672fea48ad0eea05d5482e5586e65bf90cd27dd037178ddc7fb60c
brendanhay/terrafomo
Resources.hs
-- This module is auto-generated. # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # -- | Module : . MySQL.Resources Copyright : ( c ) 2017 - 2018 License : Mo...
null
https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-mysql/gen/Terrafomo/MySQL/Resources.hs
haskell
This module is auto-generated. | Stability : auto-generated * mysql_database * mysql_grant | The main @mysql_database@ resource definition. ^ @default_character_set@ - (Default __@utf8@__) ^ @default_collation@ - (Default __@utf8_general_ci@__) ^ @name@ - (Required, Forces New) s Text Expr s Text ^ ...
# LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # Module : . MySQL.Resources Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Maint...
a9bf10e113434f958faec63bdd7c460807b807a32f2e176333301144d574c117
dbuenzli/uuseg
B0.ml
open B0_kit.V000 open Result.Syntax let unicode_version = 15, 0, 0, None (* Adjust on new releases *) let next_major = let maj, _, _, _ = unicode_version in (maj + 1), 0, 0, None (* OCaml library names *) let uuseg = B0_ocaml.libname "uuseg" let uuseg_string = B0_ocaml.libname "uuseg.string" let uucp = B0_ocaml.lib...
null
https://raw.githubusercontent.com/dbuenzli/uuseg/470cacc00fee8afe3890acb1067fb875000e5148/B0.ml
ocaml
Adjust on new releases OCaml library names Libraries Tools Tests FIXME b0, this is not so good. Packs
open B0_kit.V000 open Result.Syntax let next_major = let maj, _, _, _ = unicode_version in (maj + 1), 0, 0, None let uuseg = B0_ocaml.libname "uuseg" let uuseg_string = B0_ocaml.libname "uuseg.string" let uucp = B0_ocaml.libname "uucp" let uutf = B0_ocaml.libname "uutf" let cmdliner = B0_ocaml.libname "cmdliner" ...
0a4766598e667e0e17777de1499b954ca60156d16777396f1b176d249a5e7153
rabbitmq/rabbitmq-management
rabbit_mgmt_wm_reset.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 /. %% Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . %% -module(rabbit_mgmt_wm_reset). -export([init/2, ...
null
https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/543906f01ccd0344aff648f21bb6b5156b2a2ca2/src/rabbit_mgmt_wm_reset.erl
erlang
--------------------------------------------------------------------
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 /. Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . -module(rabbit_mgmt_wm_reset). -export([init/2, is_aut...
00db85c9857895361486ab37e08ce2ac113fe79aee26174ddbba6e8297ea7c4b
haskell/ghcide
FileExists.hs
# LANGUAGE OverloadedLists # {-# LANGUAGE TypeFamilies #-} # LANGUAGE UndecidableInstances # module Development.IDE.Core.FileExists ( fileExistsRules , modifyFileExists , getFileExists , watchedGlobs ) where import Control.Concurrent.Extra import Control.Exception import ...
null
https://raw.githubusercontent.com/haskell/ghcide/3ef4ef99c4b9cde867d29180c32586947df64b9e/src/Development/IDE/Core/FileExists.hs
haskell
# LANGUAGE TypeFamilies # | A map for tracking the file existence. If a path maps to 'True' then it exists; if it maps to 'False' then it doesn't exist'; and if it's not in the map then we don't know. | A wrapper around a mutable 'FileExistsState' | Modify the global store of file exists. Masked to ensure...
# LANGUAGE OverloadedLists # # LANGUAGE UndecidableInstances # module Development.IDE.Core.FileExists ( fileExistsRules , modifyFileExists , getFileExists , watchedGlobs ) where import Control.Concurrent.Extra import Control.Exception import Control.Monad.Extra import ...
b2821bf072c17cce81f88fd944f912edfa2c661f9596c9520c93ff63f87e6c7a
Deducteam/Logipedia
midAgda.ml
module B = Kernel.Basic module D = Api.Dep module E = Parsing.Entry module R = Kernel.Rule module T = Kernel.Term module U = Core.Uri type tx = | TxFun (** Definition *) | TxRule (** Rewrite rule *) | TxInd (** Inductive Type *) | TxCons (** Constructor of a type *) | TxProj (** Projection *) type item = Pa...
null
https://raw.githubusercontent.com/Deducteam/Logipedia/09797a35ae36ab671e40e615fcdc09a7bba69134/src/middleware/midAgda.ml
ocaml
* Definition * Rewrite rule * Inductive Type * Constructor of a type * Projection * Exception raised when reading an ill formed taxon. A type in the encoding should always start by "Agda.Term" All rule should be on its own entry.
module B = Kernel.Basic module D = Api.Dep module E = Parsing.Entry module R = Kernel.Rule module T = Kernel.Term module U = Core.Uri type tx = type item = Parsing.Entry.entry exception IllTaxon let theory = "Agda" let encoding = [B.mk_mident "Agda", B.mk_mident "univ"] let right_most : T.term -> T.term = fun ty ...
43d8c24e235f4b612eddcd6cffe176c9b7e9e85522cc39b417b4e9c08efb2234
dongcarl/guix
environment.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2014 , 2015 , 2018 < > Copyright © 2015 , 2016 , 2017 , 2018 , 2019 , 2020 , 2021 < > Copyright © 2018 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of ...
null
https://raw.githubusercontent.com/dongcarl/guix/d2b30db788f1743f9f8738cb1de977b77748567f/guix/scripts/environment.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2014 , 2015 , 2018 < > Copyright © 2015 , 2016 , 2017 , 2018 , 2019 , 2020 , 2021 < > Copyright © 2018 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (defin...
fcc35e91f95d183765a6286123a825a0e03b0bf1cc48d528d78a49680e05ed9b
fragnix/fragnix
Network.Wai.Handler.Warp.PackInt.hs
# LANGUAGE Haskell98 # # LINE 1 " Network / Wai / Handler / Warp / PackInt.hs " # # LANGUAGE OverloadedStrings , BangPatterns # module Network.Wai.Handler.Warp.PackInt where import Control.Monad (when) import Data.ByteString.Internal (ByteString(..), unsafeCreate) import Data.Word8 (Word8) import Foreign.Ptr (Ptr, pl...
null
https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/application/Network.Wai.Handler.Warp.PackInt.hs
haskell
$setup >>> import Test.QuickCheck (Large(..)) | prop> packIntegral (abs n) == B.pack (show (abs n)) prop> \(Large n) -> let n' = fromIntegral (abs n :: Int) in packIntegral n' == B.pack (show n') # SPECIALIZE packIntegral :: Int -> ByteString # |
# LANGUAGE Haskell98 # # LINE 1 " Network / Wai / Handler / Warp / PackInt.hs " # # LANGUAGE OverloadedStrings , BangPatterns # module Network.Wai.Handler.Warp.PackInt where import Control.Monad (when) import Data.ByteString.Internal (ByteString(..), unsafeCreate) import Data.Word8 (Word8) import Foreign.Ptr (Ptr, pl...
f364ca523e126c776efcb63e2d93f1de81aa58b89ddefcb03d00d23117e9a405
exercism/babashka
raindrops_test.clj
(ns raindrops-test (:require [clojure.test :refer [deftest is]] raindrops)) (deftest one (is (= "1" (raindrops/convert 1)))) (deftest three (is (= "Pling" (raindrops/convert 3)))) (deftest five (is (= "Plang" (raindrops/convert 5)))) (deftest seven (is (= "Plong" (raindrops/convert 7)))) (def...
null
https://raw.githubusercontent.com/exercism/babashka/7375f1938ff95b242320313eaeedb8eca31a1b5b/exercises/practice/raindrops/test/raindrops_test.clj
clojure
(ns raindrops-test (:require [clojure.test :refer [deftest is]] raindrops)) (deftest one (is (= "1" (raindrops/convert 1)))) (deftest three (is (= "Pling" (raindrops/convert 3)))) (deftest five (is (= "Plang" (raindrops/convert 5)))) (deftest seven (is (= "Plong" (raindrops/convert 7)))) (def...
87bb78ca4d397bbfeede1fb0604b27fc37ac96be4ef55bed6b3ada2becb1618d
pfdietz/ansi-test
member-if.lsp
;-*- Mode: Lisp -*- Author : Created : Sat Apr 19 22:51:56 2003 ;;;; Contains: Tests of MEMBER-IF (deftest member-if.1 (member-if #'listp nil) nil) (deftest member-if.2 (member-if #'(lambda (x) (eqt x 'a)) '(1 2 a 3 4)) (a 3 4)) (deftest member-if.3 (member-if #'(lambda (x) (eql x 12)) '...
null
https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/cons/member-if.lsp
lisp
-*- Mode: Lisp -*- Contains: Tests of MEMBER-IF Order of argument tests Keyword tests Error cases
Author : Created : Sat Apr 19 22:51:56 2003 (deftest member-if.1 (member-if #'listp nil) nil) (deftest member-if.2 (member-if #'(lambda (x) (eqt x 'a)) '(1 2 a 3 4)) (a 3 4)) (deftest member-if.3 (member-if #'(lambda (x) (eql x 12)) '(4 12 11 73 11) :key #'1+) (11 73 11)) (deftest member-...
a10b7c782b694629bc9029c125060a47771cddac502c494e51e5e1917831a09f
jankronquist/rock-paper-scissors-in-clojure
project.clj
(defproject rock-paper-scissors-datomic "0.1.0-SNAPSHOT" :description "The game rock-paper-scissors implemented using Datomic" :url "-paper-scissors-with-datomic" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [com.datomic/dat...
null
https://raw.githubusercontent.com/jankronquist/rock-paper-scissors-in-clojure/9abecaa4d1a305e3ee268eed9a010c24b36c152d/datomic/project.clj
clojure
(defproject rock-paper-scissors-datomic "0.1.0-SNAPSHOT" :description "The game rock-paper-scissors implemented using Datomic" :url "-paper-scissors-with-datomic" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.5.1"] [com.datomic/dat...
3c740a62f76f502723d04faa3dc9eeafabb88ca64cbc528ecf1e33c1811e0604
haskell-repa/repa
Unsafe.hs
-- | Functions without sanity or bounds checks. module Data.Array.Repa.Unsafe ( unsafeBackpermute , unsafeBackpermuteDft , unsafeSlice , unsafeExtend , unsafeTraverse , unsafeTraverse2 , unsafeTraverse3 , unsafeTraverse4) where import Data.Array.Repa.Oper...
null
https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa/Data/Array/Repa/Unsafe.hs
haskell
| Functions without sanity or bounds checks.
module Data.Array.Repa.Unsafe ( unsafeBackpermute , unsafeBackpermuteDft , unsafeSlice , unsafeExtend , unsafeTraverse , unsafeTraverse2 , unsafeTraverse3 , unsafeTraverse4) where import Data.Array.Repa.Operators.IndexSpace import Data.Array.Repa.Operator...
2950d190ee5c8de6689bea1b4204c8c57d09beded0d4e18e9c933d0416a8d730
xapi-project/xen-api
pciutil.ml
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * 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 ; version 2.1 only . with the special * exception on linking describe...
null
https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/libs/pciutil/pciutil.ml
ocaml
* Util to parse pciids defaults, if we can't find better information: device ignore if this is some other vendor's device abort reading, we found what we want vendor is that the correct path ?
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * 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 ; version 2.1 only . with the special * exception on linking describe...
99344a8561f61e9f0d26b8b88ad706d9b52bcaff179a6f96e475365812c38783
protz/mezzo
Identifier.ml
(*****************************************************************************) (* Mezzo, a programming language based on permissions *) Copyright ( C ) 2011 , 2012 and (* *) (* This program is free softwar...
null
https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/parsing/Identifier.ml
ocaml
*************************************************************************** Mezzo, a programming language based on permissions This program is free software: you can redistribute it and/or modify (at your optio...
Copyright ( C ) 2011 , 2012 and 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 Make (U : sig end) = struct ...
c45743e4743f76d28798f44c0eebf36fa2468df4258b8859777c4e3c8a65f026
fulcro-legacy/fulcro-lein-template
project.clj
(defproject {{name}} "0.1.0-SNAPSHOT" :description "My Cool Project" :license {:name "MIT" :url ""} :min-lein-version "2.8.1" These " paths " directives are technical " duplicate " since the plugin will get them , ;; but needed or you end up with the default leiningen "src" and "test" on the classpath, whic...
null
https://raw.githubusercontent.com/fulcro-legacy/fulcro-lein-template/41195fc3b5e4054ee8b0cfff379bbadb006be046/resources/leiningen/new/fulcro/project.clj
clojure
but needed or you end up with the default leiningen "src" and "test" on the classpath, which is bad.
(defproject {{name}} "0.1.0-SNAPSHOT" :description "My Cool Project" :license {:name "MIT" :url ""} :min-lein-version "2.8.1" These " paths " directives are technical " duplicate " since the plugin will get them , :source-paths ["src/main"] :test-paths ["src/test"] :plugins [[lein-tools-deps "0.4.1"]] ...
17b57cf216f6ed2cadb0fbe15b1f48992582a3cdd8535b936176def952645c9e
joewilliams/erl_geo_dns
geo_dns_udp.erl
-module(geo_dns_udp). -behaviour(gen_server). -include("../include/geo_dns.hrl"). -type socket() :: any(). -record( state, {socket :: socket(), host :: hostname(), port :: pos_integer()}). %% API -export([start_link/2]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_in...
null
https://raw.githubusercontent.com/joewilliams/erl_geo_dns/682c3925959db61ead99f13160ef8bd77486a871/apps/geo_dns/src/geo_dns_udp.erl
erlang
API gen_server callbacks
-module(geo_dns_udp). -behaviour(gen_server). -include("../include/geo_dns.hrl"). -type socket() :: any(). -record( state, {socket :: socket(), host :: hostname(), port :: pos_integer()}). -export([start_link/2]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_chan...
8b33cf4f7bdc3c505344ff78af7a9d22c38439a02c7ca1e74b1242ff9b3c1aed
ocaml-multicore/tezos
internal_pervasives.ml
(** Local “Pervasives” module for flextesa. See also ["docs/tutorials/flextesa.rst"]. *) include Base let ( // ) = Caml.Filename.concat let ksprintf, sprintf = Printf.(ksprintf, sprintf) * Wrapper around the [ EasyFormat ] library to use for console display . module EF = struct type t = Easy_format.t open Easy...
null
https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/vendors/flextesa-lib/internal_pervasives.ml
ocaml
* Local “Pervasives” module for flextesa. See also ["docs/tutorials/flextesa.rst"]. * Debug-display module (non-cooperative output to [stderr]). * Little experiment for fun … * An “decorated result type” based on polymorphic variants let error e : (_, _) t = Lwt.return (error e) * The module opened everywhere...
include Base let ( // ) = Caml.Filename.concat let ksprintf, sprintf = Printf.(ksprintf, sprintf) * Wrapper around the [ EasyFormat ] library to use for console display . module EF = struct type t = Easy_format.t open Easy_format let default_list = list let default_atom = atom let default_label = label ...
3e7a408a8162472431dd6a92f1e64089c6b2734f06042a477f76f6589892debe
RoccoMathijn/programming-in-haskell
chapter15.hs
module Chapter15 where import Prelude hiding (repeat, take, replicate) 4 . fibs :: [Integer] fibs = 0 : 1 : [prev + prevprev | (prevprev, prev) <- zip fibs (tail fibs)] 5 . --data Tree a = Leaf | Node (Tree a) a (Tree a) -- deriving Show -- this is all wrong --repeat :: Tree a -> Tree a --repeat (No...
null
https://raw.githubusercontent.com/RoccoMathijn/programming-in-haskell/ef2e3a5fa8c8a82154fdd5cd067d83b1fef1f220/chapter15.hs
haskell
data Tree a = Leaf | Node (Tree a) a (Tree a) deriving Show this is all wrong repeat :: Tree a -> Tree a repeat (Node l v r) = repeat (Node (Node l v r) v (Node l v r)) take :: Int -> Tree a -> Tree a take 0 _ = Leaf take _ Leaf = Leaf take n (Node l v r) = Node (take (n-1) l) v (take (n-1) r) replicate ...
module Chapter15 where import Prelude hiding (repeat, take, replicate) 4 . fibs :: [Integer] fibs = 0 : 1 : [prev + prevprev | (prevprev, prev) <- zip fibs (tail fibs)] 5 . 6 . sqroot' :: Double -> Double sqroot' n = snd (head (filter (\t -> (snd t) - (fst t) < 0.00001) zipped)) where ...
3dea2e577a53894604197567d74de6124104bf9802e73f4da04477b31076e5cd
emaphis/HtDP2e-solutions
05_On_Testing.rkt
The first three lines of this file were inserted by . They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname 05_On_Testing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-dec...
null
https://raw.githubusercontent.com/emaphis/HtDP2e-solutions/ecb60b9a7bbf9b8999c0122b6ea152a3301f0a68/1-Fixed-Size-Data/03-HtDP/05_On_Testing.rkt
racket
about the language level of this file in a form that our tools can easily process. Exercises 36-40 Using check-expect helps automate testing Number -> Number a wrong example
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-beginner-reader.ss" "lang")((modname 05_On_Testing) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) HtDP 2e 3 How to Design Functions 3.5 On Testing F...
bac7b35c19ead581859765eeaa63546dddf8966b1a625ecbb6ee3aa93d74b788
vikram/lisplibraries
lexer.lisp
-*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*- $ Header : /usr / local / cvsrep / cl - ppcre / lexer.lisp , v 1.26 2007/01/01 23:43:10 edi Exp $ ;;; The lexer's responsibility is to convert the regex string into a ;;; sequence of tokens which are in turn consumed by the parser. ;;;...
null
https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/dependencies/cl-ppcre-1.2.19/lexer.lisp
lisp
Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*- The lexer's responsibility is to convert the regex string into a sequence of tokens which are in turn consumed by the parser. (with a little help from the parser) how many register groups it has opened so far. (The latter is necessary for interpreting ...
$ Header : /usr / local / cvsrep / cl - ppcre / lexer.lisp , v 1.26 2007/01/01 23:43:10 edi Exp $ The lexer is aware of 's ' extended mode ' and it also ' knows ' strings like " \\10 " correctly . ) Copyright ( c ) 2002 - 2007 , Dr. . All rights reserved . DIRECT , INDIRECT , INCIDENTAL , SPECIAL , E...
35c752dc81a8412c5d99f3bb57e2ddcb783c19e72aeaea2a126d0245c744b887
ParaPhraseAGH/erlang-mas
mas_misc_util.erl
@author jstypka < > %% @version 1.0 %% @doc This module contains common helpers for different models of computation -module(mas_misc_util). -export([group_by/1, shuffle/1, clear_inbox/0, result/1, find/2, average_number/2, map_index/4, shortest_zip/2, ...
null
https://raw.githubusercontent.com/ParaPhraseAGH/erlang-mas/e53ac7ace59b50696bd5e89a1e710d88213e2b1d/src/utils/mas_misc_util.erl
erlang
@version 1.0 @doc This module contains common helpers for different models of computation ==================================================================== API functions ==================================================================== @doc Groups tuples as following: [{K1,V1},{K2,V2},...] -> [{K1,[V1,V3]}...
@author jstypka < > -module(mas_misc_util). -export([group_by/1, shuffle/1, clear_inbox/0, result/1, find/2, average_number/2, map_index/4, shortest_zip/2, seed_random/0, log_now/2, meeting_proxy/4, create_new_counter...
ed7f1aa342aecefd23f4020dcf9b1c410c17d8eda8fb190d978963673a5f38e7
finnishtransportagency/harja
budjettisuunnittelu.clj
(ns harja.palvelin.palvelut.budjettisuunnittelu (:require [com.stuartsierra.component :as component] [clojure.java.jdbc :as jdbc] [specql.core :refer [fetch update! insert!]] [specql.op :as op] [harja.palvelin.asetukset :refer [ominaisuus-kaytossa?]] [harja...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/6170c269fefe11ce5bf93932e85b5c9a9edb4879/src/clj/harja/palvelin/palvelut/budjettisuunnittelu.clj
clojure
---- IndeksikorjauksetSTART ---- tarvittavat vahvistustiedot.
(ns harja.palvelin.palvelut.budjettisuunnittelu (:require [com.stuartsierra.component :as component] [clojure.java.jdbc :as jdbc] [specql.core :refer [fetch update! insert!]] [specql.op :as op] [harja.palvelin.asetukset :refer [ominaisuus-kaytossa?]] [harja...
8be7775b5728d566f27318831747df816f2ff6329f8404922217d30363e342b7
Olical/cljs-test-runner
other_test.cljs
(ns other.other-test (:require [cljs.test :as t])) (t/deftest other-should-run (t/testing "this should run in the other dir" (t/is (= 1 1))))
null
https://raw.githubusercontent.com/Olical/cljs-test-runner/a9cc21916f32fb6caa9f54e349e7cc32b199b0c2/other-tests/other/other_test.cljs
clojure
(ns other.other-test (:require [cljs.test :as t])) (t/deftest other-should-run (t/testing "this should run in the other dir" (t/is (= 1 1))))
b9517d8821f1a495c5086202a47c9074ba3d3bd5f0367fe3df5efa3315c708da
thma/lambda-ski
ReductionBenchmarks.hs
module ReductionBenchmarks where import Criterion.Main ( defaultMain, bench, nf ) import Parser ( parseEnvironment, Expr(Int, (:@)) ) import LambdaToSKI ( abstractToSKI, compile ) import GraphReduction ( allocate, normalForm, toString, Graph ) import Data.Maybe (fromJust) import Data.STRef ( STRef ) import Control.Mon...
null
https://raw.githubusercontent.com/thma/lambda-ski/b41112a53287fad390521143e86c7fb553e7a7a0/benchmark/ReductionBenchmarks.hs
haskell
module ReductionBenchmarks where import Criterion.Main ( defaultMain, bench, nf ) import Parser ( parseEnvironment, Expr(Int, (:@)) ) import LambdaToSKI ( abstractToSKI, compile ) import GraphReduction ( allocate, normalForm, toString, Graph ) import Data.Maybe (fromJust) import Data.STRef ( STRef ) import Control.Mon...
4f82dc87ba1be8646e26e99c79fdef642eb55f24f6f2d987db59bf673b05cb4f
spartango/CS153
ast.ml
The abstract syntax for our little subset of Fortran type var = string type pos = int (* position is line number in source file *) type binop = Plus | Minus | Times | Div (* +, -, *, / *) | Eq | Neq | Lt | Lte | Gt | Gte (* ==, !=, <, <=, >, >= *) type rexp = Int of int | Var of v...
null
https://raw.githubusercontent.com/spartango/CS153/16faf133889f1b287cb95c1ea1245d76c1d8db49/ps2/ast.ml
ocaml
position is line number in source file +, -, *, / ==, !=, <, <=, >, >= !x x < y && y < z x < y || x < z x = y+42 every expression comes with its position return e; every statement comes with its position simulate a skip statement
The abstract syntax for our little subset of Fortran type var = string type binop = type rexp = Int of int | Var of var | Binop of exp * binop * exp and exp = rexp * pos type rstmt = x = 3 + 4 ; x = 2 * 9 ; y = 42 ; if ( x = = y ) x = 42 else y = 43 while ( x < y ) x = x + 1 ; for ( x=0 ; x < y ; x...
74cee872f46c4341f87c6b502b8d3a5235c49d681ddb23ee9d4c02e9afbe091a
robert-strandh/Cluffer
utilities.lisp
(cl:in-package #:cluffer-test) (defmacro assert-error (form error-type) `(multiple-value-bind (value error) (ignore-errors ,form) (declare (ignore value)) (assert (typep error ',error-type))))
null
https://raw.githubusercontent.com/robert-strandh/Cluffer/4aad29c276a58a593064e79972ee4d77cae0af4a/Test/utilities.lisp
lisp
(cl:in-package #:cluffer-test) (defmacro assert-error (form error-type) `(multiple-value-bind (value error) (ignore-errors ,form) (declare (ignore value)) (assert (typep error ',error-type))))
8d80eaf06156a08686f305105d4490a3f703108bff19f35d22e3404eb731f3cd
rnons/ted2srt
fetch.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # import qualified Data.Text as T import qualified Data.Text.IO.Utf8 as Utf8 import Data.Time (getCurrentTime) import Database.Persist (Entity (..)) import LoadEnv (loadEnv) import ...
null
https://raw.githubusercontent.com/rnons/ted2srt/7456f109bce2b9f07d0c929bef2fd42e6bc4f75d/backend/app/fetch.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards # import qualified Data.Text as T import qualified Data.Text.IO.Utf8 as Utf8 import Data.Time (getCurrentTime) import Database.Persist (Entity (..)) import LoadEnv (loadEnv) import Network.HTTP.Conduit (simp...
79c33624e619aebff9c09a07c5188d3360cfdc90814a27080a507115d6fad118
skanev/playground
42.scm
SICP exercise 4.42 ; Solve the following " Liars " puzzle ( from Phillips 1934 ): ; Five schoolgirls sat for an examination . Their parents - so they thought - ; showed an undue degree of interest in the result. They therefore agreed that , in writing home about the examination , each girl should make one...
null
https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/04/42.scm
scheme
showed an undue degree of interest in the result. They therefore agreed from their letters: The solution to the puzzle is: The code that discovers it is below. The rest of the interpreter.
SICP exercise 4.42 Solve the following " Liars " puzzle ( from Phillips 1934 ): Five schoolgirls sat for an examination . Their parents - so they thought - that , in writing home about the examination , each girl should make one true statement and one untrue one . The following are the relevant passages...
271c426e54c7f7f476805ed0d07db99cc5e14bfa6170f8bc39b5ebadc7f32005
onedata/op-worker
transfer.erl
%%%------------------------------------------------------------------- @author ( C ) 2017 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . %%% @end %%%------------------------------------------------------------------- %%% @doc Model storing information about tran...
null
https://raw.githubusercontent.com/onedata/op-worker/afc25178632796e095468a491a7d91b9d47aeafb/src/modules/datastore/models/transfer/transfer.erl
erlang
------------------------------------------------------------------- @end ------------------------------------------------------------------- @doc as a trigger for starting a transfer. - replication - replica_eviction - migration (replica_eviction preceded by replication) @end ------------------------...
@author ( C ) 2017 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . Model storing information about transfers . Creation of doc works We distinguish 3 types of transfers : -module(transfer). -author("Tomasz Lichon"). -include("modules/datastore/datastore_models...
4c88c6c4807de9ed690ffc9178645b811e97587d4871019689177d79f8f03d14
gedge-platform/gedge-platform
ra_bench.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 /. %% Copyright ( c ) 2017 - 2020 VMware , Inc. or its affiliates . All rights reserved . %% %% @hidden -module(ra_bench). -behaviour(ra_machi...
null
https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/ra/src/ra_bench.erl
erlang
@hidden profile/0, stop_profile/0 msg_ids are scoped per customer ra_indexes holds all raft indexes for enqueues currently on queue wait for each pid error_logger:logfile(filename:join(ra_env:data_dir(), "log.log")), then top up as they are applied profile() -> lg_file_tracer, G...
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 /. Copyright ( c ) 2017 - 2020 VMware , Inc. or its affiliates . All rights reserved . -module(ra_bench). -behaviour(ra_machine). -compile(in...
bc543b35593670eee4e9e7a23769c8f45f572099a7bfa9b4f0cec7d069bae9b9
schemeorg-community/index.scheme.org
srfi.99.records.inspection.scm
(((name . "record?") (signature lambda (obj) boolean?) (tags pure predicate)) ((name . "record-rtd") (signature lambda ((record? rec)) rtd?) (tags pure)) ((name . "rtd-name") (signature lambda ((rtd? rtd)) symbol?) (tags pure)) ((name . "rtd-parent") (signature lambda ((rtd? rtd)) (or #f rtd?)) (tags pure)) ((n...
null
https://raw.githubusercontent.com/schemeorg-community/index.scheme.org/32e1afcfe423a158ac8ce014f5c0b8399d12a1ea/types/srfi.99.records.inspection.scm
scheme
(((name . "record?") (signature lambda (obj) boolean?) (tags pure predicate)) ((name . "record-rtd") (signature lambda ((record? rec)) rtd?) (tags pure)) ((name . "rtd-name") (signature lambda ((rtd? rtd)) symbol?) (tags pure)) ((name . "rtd-parent") (signature lambda ((rtd? rtd)) (or #f rtd?)) (tags pure)) ((n...
a0ef7835acf333b9cf7f2a31e4663bdcd5085c1d152191c540bfcaf28d5d1cbf
unclebob/spacewar
hit.cljc
(ns spacewar.game-logic.hit (:require [clojure.spec.alpha :as s])) (s/def ::weapon #{:phaser :torpedo :kinetic}) (s/def ::damage (s/or :damage-amount number? :phaser-ranges (s/coll-of number?))) (s/def ::hit (s/keys :req-un [::weapon ::damage]))
null
https://raw.githubusercontent.com/unclebob/spacewar/71c3195b050c4fdb7e643f53556ab580d70f27ba/src/spacewar/game_logic/hit.cljc
clojure
(ns spacewar.game-logic.hit (:require [clojure.spec.alpha :as s])) (s/def ::weapon #{:phaser :torpedo :kinetic}) (s/def ::damage (s/or :damage-amount number? :phaser-ranges (s/coll-of number?))) (s/def ::hit (s/keys :req-un [::weapon ::damage]))
136a25ca0aa38d5a1925b4bc3c1f856e870a3ae7f0f84b1e73da55880a3a245c
fission-codes/fission
Types.hs
module Fission.CLI.IPFS.Version.Types (Version (..)) where import Servant.API import Fission.Prelude data Version = Version { major :: Word8 , minor :: Word8 , patch :: Word8 } deriving (Show, Eq) instance Display Version where display Version {..} = mconcat [ "v" , d...
null
https://raw.githubusercontent.com/fission-codes/fission/e07965d911c05f79b01f47aff7b76cd92d21e290/fission-cli/library/Fission/CLI/IPFS/Version/Types.hs
haskell
module Fission.CLI.IPFS.Version.Types (Version (..)) where import Servant.API import Fission.Prelude data Version = Version { major :: Word8 , minor :: Word8 , patch :: Word8 } deriving (Show, Eq) instance Display Version where display Version {..} = mconcat [ "v" , d...
a46dc216a280e9e7f38a8aaf9dff06472ae983a5fdc58800924b4ae94eb95bc8
dbuenzli/lit
lit_gles.ml
--------------------------------------------------------------------------- Copyright ( c ) 2014 . All rights reserved . Distributed under the ISC license , see terms at the end of the file . % % NAME%% % % --------------------------------------------------------------------------- Copyright (c) ...
null
https://raw.githubusercontent.com/dbuenzli/lit/4058b8a133cd51d3bf756c66b9ab620e39e1d2c4/src/lit_gles.ml
ocaml
--------------------------------------------------------------------------- Copyright ( c ) 2014 . All rights reserved . Distributed under the ISC license , see terms at the end of the file . % % NAME%% % % --------------------------------------------------------------------------- Copyright (c) ...
23e100a9d8724a90bb6dfc21606adb8cac1c0a54b6794b607b83e39fcecc4ab7
clojure/core.async
timers_test.cljs
Copyright ( c ) and contributors . All rights reserved . ;; The use and distribution terms for this software are covered by the ;; Eclipse Public License 1.0 (-1.0.php) ;; which can be found in the file epl-v10.html at the root of this distribution. ;; By using this software in any fashion, you are agreei...
null
https://raw.githubusercontent.com/clojure/core.async/edc3e16c034106f06e861ffbf91ba0ea87107208/src/test/cljs/cljs/core/async/timers_test.cljs
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove ...
Copyright ( c ) and contributors . All rights reserved . (ns cljs.core.async.timers-test (:require [cljs.core.async.impl.timers :as timers] [cljs.test :refer-macros [deftest testing is are]])) (deftest skip-list-tests (testing "accessing empty skip list" (is (nil? (.ceilingEntry (timers/skip...
c26a060c5736d6011d60e98338a84a513b6aedb80af7250adc550373a18509b4
dmillett/political-canvas
tools.clj
(ns political-canvas.shared.tools (:require [clojure.string :as str])) (defn local-file "Refer to a local file somewhere in the project directory." [filename] (str (System/getProperty "user.dir") "/" filename)) (defn data-to-file "Dump a clojure data structure to an EDN file using (with-out-str). This req...
null
https://raw.githubusercontent.com/dmillett/political-canvas/ec59a065b832277ec06f80e67977eee196a6a194/src/political_canvas/shared/tools.clj
clojure
(apply ->Foo [1 2 3]) works getSimpleName
(ns political-canvas.shared.tools (:require [clojure.string :as str])) (defn local-file "Refer to a local file somewhere in the project directory." [filename] (str (System/getProperty "user.dir") "/" filename)) (defn data-to-file "Dump a clojure data structure to an EDN file using (with-out-str). This req...
a4e65686f5fbe9a1322e48620a733b42cc09578f1cab5fedf3d708056574a3c0
braidchat/braid
common.clj
(ns braid.chat.db.common (:require [clojure.edn :as edn] [datomic.api :as d])) (defn create-entity-txn "create entity with attrs, return (after-fn entity)" [attrs after-fn] (let [new-id (d/tempid :entities)] [(with-meta (assoc attrs :db/id new-id) {:braid.core.server.db/return ...
null
https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/chat/db/common.clj
clojure
(ns braid.chat.db.common (:require [clojure.edn :as edn] [datomic.api :as d])) (defn create-entity-txn "create entity with attrs, return (after-fn entity)" [attrs after-fn] (let [new-id (d/tempid :entities)] [(with-meta (assoc attrs :db/id new-id) {:braid.core.server.db/return ...
ce63bfe48a620003267d8944955794cb416d2b802a15483b6a90356e23d5f03c
milho-lang/milho-haskell
Spec.hs
# LANGUAGE QuasiQuotes # # LANGUAGE TypeApplications # # LANGUAGE DataKinds # import Canjica.EvalApply ( eval ) import qualified Canjica.Std as Std import Capability.Error import Capability.Reader import Capability.State import Data.FileE...
null
https://raw.githubusercontent.com/milho-lang/milho-haskell/475b89bc460933714b3fb7f0452876c9d12516a7/test/Spec.hs
haskell
Arithmetic tests Variable definition tests List operation tests Control flow tests Error raise and handling tests Import testing
# LANGUAGE QuasiQuotes # # LANGUAGE TypeApplications # # LANGUAGE DataKinds # import Canjica.EvalApply ( eval ) import qualified Canjica.Std as Std import Capability.Error import Capability.Reader import Capability.State import Data.FileE...
2b3d9f916cbf3b862bbff4f59cf4290517f914d0e076648b26e441a82975ca91
simonjbeaumont/ocaml-pci
ffi_stubgen.ml
let _ = let prefix = "libpci_stub" in let generate_ml, generate_c = ref false, ref false in Arg.(parse [ ("-ml", Set generate_ml, "Generate ML"); ("-c", Set generate_c, "Generate C") ]) (fun _ -> failwith "unexpected anonymous argument") "stubgen [-ml|-c]"; match !generate_ml, !generate_...
null
https://raw.githubusercontent.com/simonjbeaumont/ocaml-pci/936cff8794bcb2ac0c4de6f8431f1810ba4e6941/stubgen/ffi_stubgen.ml
ocaml
let _ = let prefix = "libpci_stub" in let generate_ml, generate_c = ref false, ref false in Arg.(parse [ ("-ml", Set generate_ml, "Generate ML"); ("-c", Set generate_c, "Generate C") ]) (fun _ -> failwith "unexpected anonymous argument") "stubgen [-ml|-c]"; match !generate_ml, !generate_...
a4fe86c824b7e9692097aaf2d1fa1b29546daa4ca9586d49cad11f8f62c9e0c8
swamp-agr/proof-assistant-bot
Main.hs
module Main where import Proof.Assistant.Bot (run) main :: IO () main = run
null
https://raw.githubusercontent.com/swamp-agr/proof-assistant-bot/8d19e889ebaea49a4f27eee4d2ecc9977ce42ae9/app/Main.hs
haskell
module Main where import Proof.Assistant.Bot (run) main :: IO () main = run
6a14877d62e3743771819b6ee7efaea57dc5eb20ca883e1d4edbf326a9bec6a0
y2q-actionman/with-c-syntax
libc_math.lisp
(in-package #:with-c-syntax.test) ;;; I decided to write libc tests with `with-c-syntax' itself, ;;; if they are not free-standing. (in-readtable with-c-syntax-readtable) (defmacro check-errno (form expected-errno &key (alternate-errno nil aeno-supplied-p)) `(let ((|errno| nil)) (prog1 ,...
null
https://raw.githubusercontent.com/y2q-actionman/with-c-syntax/19bb38c761d9431280f68aa3821814c1499ce3d6/test/libc_math.lisp
lisp
I decided to write libc tests with `with-c-syntax' itself, if they are not free-standing. Specials Specials Specials Specials Specials Specials Specials Specials Specials Spe...
(in-package #:with-c-syntax.test) (in-readtable with-c-syntax-readtable) (defmacro check-errno (form expected-errno &key (alternate-errno nil aeno-supplied-p)) `(let ((|errno| nil)) (prog1 ,form ,@(if (not aeno-supplied-p) `((is (eql |errno| ,expected-errno))) ...
2ce3fa782a546e77b6fff89bf38ed6986877b896809f5120b291383824e1bb7e
LCBH/UKano
pievent.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cryptographic protocol verifier * * * ...
null
https://raw.githubusercontent.com/LCBH/UKano/13c046ddaca48b45d3652c3ea08e21599e051527/proverif2.01/src/pievent.ml
ocaml
When the "end" event is present and the "begin" event is injective, we set the "end" event injective as well, so that it has the same occurrence argument as the "begin" event, and we can remove the "begin" event from the clause that concludes "end" Setting the events inside queries Checking events i...
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cryptographic protocol verifier * * * ...
0b8f7c915efec6dd94f0e4549f0111f3b9ab3dc604a88768b1b2df02a46ce77f
a-sassmannshausen/guile-config
helpers.scm
Config --- Configuration specification in GNU Copyright © 2017 < > ;;; This file is part of Guile - Config . ;;; ;;; Config 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 Li...
null
https://raw.githubusercontent.com/a-sassmannshausen/guile-config/b05957743ee8ab8d111683697a56e46a82429b6f/config/helpers.scm
scheme
Config is free software; you can redistribute it and/or modify it under either version 3 of the License , or ( at your option ) any later version. Config 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...
Config --- Configuration specification in GNU Copyright © 2017 < > This file is part of Guile - Config . the terms of the GNU General Public License as published by the Free You should have received a copy of the GNU General Public License 59 Temple Place - Suite 330 Fax : +1 - 617 - 542 - 2...
c7a41f785013eb6a13adde25f5f7460f811388cbfd0f941aa9be3aa1f64b02b9
yesodweb/yesod
pong.hs
# LANGUAGE TemplateHaskell , QuasiQuotes , TypeFamilies # import Yesod.Core import Network.Wai.Handler.Warp data Pong = Pong mkYesod "Pong" [parseRoutes| / HomeR GET |] instance Yesod Pong getHomeR = liftHandlerT $ return "PONG" main = warp 3000 Pong
null
https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/yesod-core/attic/pong.hs
haskell
# LANGUAGE TemplateHaskell , QuasiQuotes , TypeFamilies # import Yesod.Core import Network.Wai.Handler.Warp data Pong = Pong mkYesod "Pong" [parseRoutes| / HomeR GET |] instance Yesod Pong getHomeR = liftHandlerT $ return "PONG" main = warp 3000 Pong
650a02bae07793f0d2a33981012fe5f5174bc41f936f69f8f732962f836d7251
semilin/layoup
therein.lisp
(MAKE-LAYOUT :NAME "therein" :MATRIX (APPLY #'KEY-MATRIX '("zjoukwplcm" "siaedythrn" ".;vbxgqf?,")) :SHIFT-MATRIX NIL :KEYBOARD NIL)
null
https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/therein.lisp
lisp
(MAKE-LAYOUT :NAME "therein" :MATRIX (APPLY #'KEY-MATRIX '("zjoukwplcm" "siaedythrn" ".;vbxgqf?,")) :SHIFT-MATRIX NIL :KEYBOARD NIL)
5f1955f9fbf8d3ac9f8535bbf591548cd7ce0995e1411788b3ace1a5ba4cdd8b
dsheets/ocaml-unix-sys-stat
myocamlbuild.ml
open Ocamlbuild_plugin;; open Ocamlbuild_pack;; let ctypes_libdir = Sys.getenv "CTYPES_LIB_DIR" in let lwt_libdir = Sys.getenv "LWT_LIB_DIR" in let ocaml_libdir = Sys.getenv "OCAML_LIB_DIR" in dispatch begin function | After_rules -> Ctypes_rules.rules ~prefix:"sys_stat" ~ctypes_libdir ~lwt_libdir ~ocam...
null
https://raw.githubusercontent.com/dsheets/ocaml-unix-sys-stat/6e1b61bc9bc19933d4b28e4dccd146089808da95/myocamlbuild.ml
ocaml
open Ocamlbuild_plugin;; open Ocamlbuild_pack;; let ctypes_libdir = Sys.getenv "CTYPES_LIB_DIR" in let lwt_libdir = Sys.getenv "LWT_LIB_DIR" in let ocaml_libdir = Sys.getenv "OCAML_LIB_DIR" in dispatch begin function | After_rules -> Ctypes_rules.rules ~prefix:"sys_stat" ~ctypes_libdir ~lwt_libdir ~ocam...
19f7b87fe4b79ec69a266b698b0fce55ffede1f1cd692b114bc06954493a6457
AndrasKovacs/ELTE-func-lang
Tut11.hs
{-# OPTIONS -Wincomplete-patterns #-} # LANGUAGE InstanceSigs , DeriveFunctor , , DeriveTraversable # -------------------------------------------------------------------------------- import Data.Foldable import Data.Traversable import Control.Monad import Control.Applicative ----------------------------------------...
null
https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/6ae31f29f0e4b2a163472f6ade668db75e90f2ce/2021-22-1/gyak_3/Tut11.hs
haskell
# OPTIONS -Wincomplete-patterns # ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Basic operations: Examples: ------------------------------------------------------------------------------ Bonus: ----------...
# LANGUAGE InstanceSigs , DeriveFunctor , , DeriveTraversable # import Data.Foldable import Data.Traversable import Control.Monad import Control.Applicative data State s a = State { runState :: s -> (a, s) } deriving (Functor) instance Applicative (State s) where pure = return (<*>) = ap instance Monad (S...
1f41501377695284d23acdd239e309cd5bd3d273f933a93a9e1b309878881c42
evrim/core-server
dyna.lisp
(in-package :core-server) (defclass+ dynamic-class+ (class+) ())
null
https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/class%2B/dyna.lisp
lisp
(in-package :core-server) (defclass+ dynamic-class+ (class+) ())
04793c4f3a7459f784c89e648e4007614a7a9cdcb407f569e025ee8e678e505c
kupl/LearnML
original.ml
type lambda = V of var | P of (var * lambda) | C of (lambda * lambda) and var = string let rec isin ((str : string), (lst : string list)) : bool = match lst with | [] -> false | hd :: tl -> if hd = str then true else isin (str, tl) let rec filter (lst : string list) (lst2 : string list) : bool = match lst w...
null
https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/lambda/sub97/original.ml
ocaml
type lambda = V of var | P of (var * lambda) | C of (lambda * lambda) and var = string let rec isin ((str : string), (lst : string list)) : bool = match lst with | [] -> false | hd :: tl -> if hd = str then true else isin (str, tl) let rec filter (lst : string list) (lst2 : string list) : bool = match lst w...
932377cf0ed1eef5c5a3173d1bb92900780f6cd8b193ccc64daf72c42c2c7acb
aspiwack/porcupine
OptParse.hs
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE FlexibleInstances # # LANGUAGE GADTs # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE ScopedTypeVariables #-} # LANGUAGE TypeFamili...
null
https://raw.githubusercontent.com/aspiwack/porcupine/23dcba1523626af0fdf6085f4107987d4bf718d7/docrecords/src/Data/DocRecord/OptParse.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeOperators # | Identifies the source of a value in the configuration, so that we can be sure to override the right values with the right values. JSON and ...
# LANGUAGE FlexibleInstances # # LANGUAGE GADTs # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -Wall # # OPTIONS_GHC -Wno - unticked - promoted - constructors # module Data.DocRecord.Op...
be47070c9fd98ee55979888fea078a225a714147b525f76c61617505a2c8fb7f
vlstill/hsExprTest
safety.solution.nok.hs
import qualified Solution foo = Solution.foo
null
https://raw.githubusercontent.com/vlstill/hsExprTest/391fc823c1684ec248ac8f76412fefeffb791865/examples/safety.solution.nok.hs
haskell
import qualified Solution foo = Solution.foo
c55def6ff629939c514a89a8f6cf018bb1dca7fd194b5eacdfa8f76c1f47e33c
autolwe/autolwe
Rules.ml
(* * Infrastructure for defining derived rules. *) (* ** Imports and abbreviations *) open Nondet open Abbrevs open Util open Syms open Type open Expr open ExprUtils open Game open Assumption open CoreTypes open CoreRules open Tactic module Ht = Hashtbl (* ** Operators for tacticals * ------------------------------...
null
https://raw.githubusercontent.com/autolwe/autolwe/3452c3dae06fc8e9815d94133fdeb8f3b8315f32/src/Derived/Rules.ml
ocaml
* Infrastructure for defining derived rules. ** Imports and abbreviations ** Operators for tacticals * ----------------------------------------------------------------------- let se = ju.ju_se in if equal_sec_exp se se' then ** Extracting samplings, lets, and guards from game * ----------------------------...
open Nondet open Abbrevs open Util open Syms open Type open Expr open ExprUtils open Game open Assumption open CoreTypes open CoreRules open Tactic module Ht = Hashtbl let ( @> ) = t_seq let ( @>> ) = t_seq_list let ( @>>= ) = t_bind let ( @>= ) = t_bind_ignore let ( @| ) = t_or let (@||) t1 t2 ju = let pss ...
d60bb64bbdb11f7fabf49759f3050b167e7522f3515e2dd7b3741028ed317bb8
nd/sicp
2.35.scm
(define (count-leaves t) (accumulate + 0 (map (lambda (x) (if (pair? x) (count-leaves x) 1)) t)))
null
https://raw.githubusercontent.com/nd/sicp/d8587a0403d95af7c7bcf59b812f98c4f8550afd/ch02/2.35.scm
scheme
(define (count-leaves t) (accumulate + 0 (map (lambda (x) (if (pair? x) (count-leaves x) 1)) t)))
12c1ab24562e523dd15c46f6a4937636a0c924326f6457d85805b6cdaa738a6f
sirherrbatka/clusters
sinkhorn.lisp
(cl:in-package #:clusters.distance) (defun max-condition (u sum-row n epsilon) (iterate (for i from 0 below n) (maximize (abs (- (aref u i) (aref sum-row i))) into maximum) (thereis (> maximum epsilon)))) (defun sum-row (u transport-matrix n m) (iterate (for i from 0 below n) (...
null
https://raw.githubusercontent.com/sirherrbatka/clusters/20b8b60005ac8e27d12d05d277b26d8b5ca5c238/source/distance/sinkhorn.lisp
lisp
initialize cost matrix normalize matrix
(cl:in-package #:clusters.distance) (defun max-condition (u sum-row n epsilon) (iterate (for i from 0 below n) (maximize (abs (- (aref u i) (aref sum-row i))) into maximum) (thereis (> maximum epsilon)))) (defun sum-row (u transport-matrix n m) (iterate (for i from 0 below n) (...
7f80958628f6eae5082c8d45e26ccd6dd36383ddfee20ef795698fdab4ff1623
scicloj/tablecloth.time
indexing_test.clj
(ns tablecloth.time.api.indexing-test (:require [clojure.test :refer [deftest is testing]] [tablecloth.time.time-literals] [tablecloth.time.api.indexing :refer [index-by rename-index]] [tablecloth.api :refer [dataset]])) (deftest index-by-test (testing "index 'validatable'" ...
null
https://raw.githubusercontent.com/scicloj/tablecloth.time/a2571dfd42dd7f0264eda40f0f1f43f031fb07a0/test/tablecloth/time/api/indexing_test.clj
clojure
(ns tablecloth.time.api.indexing-test (:require [clojure.test :refer [deftest is testing]] [tablecloth.time.time-literals] [tablecloth.time.api.indexing :refer [index-by rename-index]] [tablecloth.api :refer [dataset]])) (deftest index-by-test (testing "index 'validatable'" ...
4acdefd6073054d415df3847a92fe2d9e45e217251d4c6561a97feaf12cf82aa
mhuebert/re-view
re_frame_simple.clj
(ns re-view.re-frame-simple) (defmacro defupdate "Registers an event handler with re-frame which updates the db." [name & args] (let [docstring (when (string? (first args)) (first args)) [[db-sym & arg-syms] & body] (cond-> args docstring (rest))] `(~'re-frame.core/reg-event-db ~name (fn [~(or...
null
https://raw.githubusercontent.com/mhuebert/re-view/ba38cd09b78b3c6db6a2983f3e2cf1bd6294564f/re-frame-simple/src/re_view/re_frame_simple.clj
clojure
(ns re-view.re-frame-simple) (defmacro defupdate "Registers an event handler with re-frame which updates the db." [name & args] (let [docstring (when (string? (first args)) (first args)) [[db-sym & arg-syms] & body] (cond-> args docstring (rest))] `(~'re-frame.core/reg-event-db ~name (fn [~(or...
73a694aeca56c44b8771f81724a181e7bea00bccb71384e472710ababbe5f73a
nickzuber/infrared
uniquify.ml
open InfraredUtils open InfraredParser.Ast open InfraredAst exception Unexpected_compiler_phase of string type env_t = (identifier', string) Hashtbl.t (* Return the latest hash for a given variable variable. Since the variables * are stored in the hashtable, a failed lookup means this variable was never * declared...
null
https://raw.githubusercontent.com/nickzuber/infrared/904263ad9ee425c536937a48e0c70217e4298257/InfraredCompiler/transformers/uniquify.ml
ocaml
Return the latest hash for a given variable variable. Since the variables * are stored in the hashtable, a failed lookup means this variable was never * declared, so there's a chance its a global. @NOTE: Environment Copying * Copying the environment for the function body is what lets us remove * variable...
open InfraredUtils open InfraredParser.Ast open InfraredAst exception Unexpected_compiler_phase of string type env_t = (identifier', string) Hashtbl.t let get_hash (tbl : env_t) (key : identifier') : string = try Hashtbl.find tbl key with _ -> "" let get_hashed_variable id hash = match hash with | "" -> id ...
a96e632eaa248faffde27a5c3e14c26e6ef558b8e3fd0230e4db32d6368d831d
helium/router
helium_router_service.erl
-module(helium_router_service). -behavior(helium_router_bhvr). -include_lib("helium_proto/include/blockchain_state_channel_v1_pb.hrl"). -ifdef(TEST). -define(TIMEOUT, 5000). -else. -define(TIMEOUT, 8000). -endif. -export([ route/2 ]). route(Ctx, #blockchain_state_channel_message_v1_pb{msg = {packet, SCPacket}}...
null
https://raw.githubusercontent.com/helium/router/154a6551e71bdf5ed10408487d4adb54068b826f/src/grpc/helium_router_service.erl
erlang
handle the packet and then await a response if no response within given time, then give up and return error ------------------------------------------------------------------ ------------------------------------------------------------------
-module(helium_router_service). -behavior(helium_router_bhvr). -include_lib("helium_proto/include/blockchain_state_channel_v1_pb.hrl"). -ifdef(TEST). -define(TIMEOUT, 5000). -else. -define(TIMEOUT, 8000). -endif. -export([ route/2 ]). route(Ctx, #blockchain_state_channel_message_v1_pb{msg = {packet, SCPacket}}...
37a1317991a627818f7df9f6602fd9a712dfe1c23d4190d39d15a2564ba30449
tuura/graph-visualisation
Hierarchical.hs
# LANGUAGE NoMonomorphismRestriction # # LANGUAGE FlexibleContexts # {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module: Visualise.Hierarchical Copyright : ( c ) 2018 -- -- Draw...
null
https://raw.githubusercontent.com/tuura/graph-visualisation/5609ec225de197d25283e15057a7bcdfbfc280bb/src/Visualise/Hierarchical.hs
haskell
# LANGUAGE TypeFamilies # # LANGUAGE ScopedTypeVariables # --------------------------------------------------------------------------- | Module: Visualise.Hierarchical Draws a graph as a hierarchical graph by grouping together vertices with common connections and containing them with a box. T...
# LANGUAGE NoMonomorphismRestriction # # LANGUAGE FlexibleContexts # Copyright : ( c ) 2018 colours as defined by ' alternatingColour ' , as well as a second function module Visualise.Hierarchical ( drawHier, drawHier', defaultHierSettings, drawDefaultHierNode, alternatingColour ) w...
dd5312905a4c9bb9d43292bf261f9eb23f84aebf275638de025f0294b3ef6942
iijlab/direct-hs
SkewsSpec.hs
# LANGUAGE CPP # {-# LANGUAGE OverloadedStrings #-} module Network.WebSockets.SkewsSpec ( spec ) where import Control.Applicative (empty, (<|>)) import Control.Concurrent (threadDelay) import Control.Concurrent.Async (async, replicateConcurrently, ...
null
https://raw.githubusercontent.com/iijlab/direct-hs/2422fd6fe008109e8dfb74f31d65b0d5a0330788/skews/test/Network/WebSockets/SkewsSpec.hs
haskell
# LANGUAGE OverloadedStrings # import Debug.Trace FIXME: -- timeout function doesn't kill `WS.receive conn`. -- So I can't test the exact behaviour of forgetDefaultResponse resLast <- timeout 1 $ WS.receive conn return (ress, resLast)
# LANGUAGE CPP # module Network.WebSockets.SkewsSpec ( spec ) where import Control.Applicative (empty, (<|>)) import Control.Concurrent (threadDelay) import Control.Concurrent.Async (async, replicateConcurrently, re...
9de93b0ebc29900e8deaab677d66d2f43ae431c5a98ae41402d8f40b2266c379
herd/herdtools7
parsedConstant.ml
(****************************************************************************) (* the diy toolsuite *) (* *) , University College London , UK . , INRIA Par...
null
https://raw.githubusercontent.com/herd/herdtools7/b22ec02af1300a45e2b646cce4253ecd4fa7f250/lib/parsedConstant.ml
ocaml
************************************************************************** the diy toolsuite en Automatique and ...
, University College London , UK . , INRIA Paris - Rocquencourt , France . Copyright 2017 - present Institut National de Recherche en Informatique et This software is governed by the CeCILL - B license under French law and modify and/ or redistribu...
5590732b1d89f7c84e9c0abecb7c7ae945be7a61fea2f4f1811ec881e40c8185
ocsigen/html_of_wiki
HTML5outliner.ml
open Js_of_ocaml let sectionning_content = [ "article"; "aside"; "nav"; "section" ] let sectionning_root = [ "blockquote"; "body"; "details"; "fieldset"; "figure"; "td" ] let sectionning_tag = sectionning_root @ sectionning_content let heading_content = [ "h1"; "h2"; "h3"; "h4"; "h5"; "h6"; "hgroup" ] The h1 el...
null
https://raw.githubusercontent.com/ocsigen/html_of_wiki/08f5d140cf41846ccd504d851e2bab6b418f43ee/src/client/HTML5outliner.ml
ocaml
ignore these nodes...
open Js_of_ocaml let sectionning_content = [ "article"; "aside"; "nav"; "section" ] let sectionning_root = [ "blockquote"; "body"; "details"; "fieldset"; "figure"; "td" ] let sectionning_tag = sectionning_root @ sectionning_content let heading_content = [ "h1"; "h2"; "h3"; "h4"; "h5"; "h6"; "hgroup" ] The h1 el...
69c012ba2b351265deb4d120fa68912a70f289b05666409087fb1b7902ec972b
HealthSamurai/stresty
select.cljc
(ns anti.select (:require [anti.util :refer [class-names block ratom cursor]] [stylo.core :refer [c c?]] [zf.core :as zf] [zframes.dom] [zframes.re-frame :as zrf] #?(:cljs [reagent.core :as r]) [clojure.string :as str])) (def default-id-fn identity) (defmulti search-fn (fn [k options...
null
https://raw.githubusercontent.com/HealthSamurai/stresty/130cedde6bf53e07fe25a6b0b13b8bf70846f15a/src-ui/anti/select.cljc
clojure
(ns anti.select (:require [anti.util :refer [class-names block ratom cursor]] [stylo.core :refer [c c?]] [zf.core :as zf] [zframes.dom] [zframes.re-frame :as zrf] #?(:cljs [reagent.core :as r]) [clojure.string :as str])) (def default-id-fn identity) (defmulti search-fn (fn [k options...
bbb1489508c6a8a2bc646039705e4733197316c2bfe9b16e2fabe3215107df14
mflatt/shrubbery-rhombus-0
check.rkt
#lang racket/base (require "../proc-name.rkt") (provide check-is-syntax) (define (check-is-syntax val proc) (unless (syntax? val) (raise-result-error (proc-name proc) "syntax?" val)) val)
null
https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/aa2203842de916f9f71c9700ab18a7ec32969ac8/enforest/private/check.rkt
racket
#lang racket/base (require "../proc-name.rkt") (provide check-is-syntax) (define (check-is-syntax val proc) (unless (syntax? val) (raise-result-error (proc-name proc) "syntax?" val)) val)
521e1db2d1399a80e59bbe62d29afb035348ddc01f1a64bc64bea95d0141d572
zoomhub/zoomhub
ExploreRecentContent.hs
# LANGUAGE BlockArguments # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module ZoomHub.Web.Page.ExploreRecentContent ( ExploreRecentContent (..), ) where import Data.Foldable (forM_, for_) import Data.Monoid ((<>)) import qualified Data.Text as T import qualified Lucid as H import qualified Zo...
null
https://raw.githubusercontent.com/zoomhub/zoomhub/dd6bc69c2cc6f68e04096a43bfe9c93c9ba1ad2b/src/ZoomHub/Web/Page/ExploreRecentContent.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE BlockArguments # # LANGUAGE RecordWildCards # module ZoomHub.Web.Page.ExploreRecentContent ( ExploreRecentContent (..), ) where import Data.Foldable (forM_, for_) import Data.Monoid ((<>)) import qualified Data.Text as T import qualified Lucid as H import qualified ZoomHub.API.Types.Content as Content ...
ea3afe9f801dea7f9684361af51ce8467d60ff70fd76d31070380c8238644a7e
jgoerzen/anydbm
AnyDBM.hs
arch - tag : Object Support Copyright ( C ) 2005 < > 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 2.1 of the License , or ( at your option ) any later ve...
null
https://raw.githubusercontent.com/jgoerzen/anydbm/61f75f1926c084182056d5943014b92fa26d81b9/src/Database/AnyDBM.hs
haskell
* The AnyDBM class * AnyDBM utilities | The main class for items implementing this interface. People implementing this class should provide methods for: * 'closeA' (unless you have no persistent storage) * 'flushA' (unless you have no persistent storage) * 'insertA' * 'deleteA' * 'lookupA' * either 'toListA' ...
arch - tag : Object Support Copyright ( C ) 2005 < > 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 2.1 of the License , or ( at your option ) any later ve...
634f075c3466aa3136b36e4dda302a61cb71bdb82c19072db665d89652b2279e
emillon/ocaml-noise
bench.ml
let crypto_random_bytes n = let ic = Pervasives.open_in_bin "/dev/urandom" in let s = Pervasives.really_input_string ic n in close_in ic; Cstruct.of_string s let random_private_key len = Noise.Private_key.of_bytes @@ crypto_random_bytes len let ensure_ok r = match r with | Ok _ -> () | Error e -> fail...
null
https://raw.githubusercontent.com/emillon/ocaml-noise/d5a3e0f634fba1f8d948a91c70a1dad6470722b0/test/bench/bench.ml
ocaml
let crypto_random_bytes n = let ic = Pervasives.open_in_bin "/dev/urandom" in let s = Pervasives.really_input_string ic n in close_in ic; Cstruct.of_string s let random_private_key len = Noise.Private_key.of_bytes @@ crypto_random_bytes len let ensure_ok r = match r with | Ok _ -> () | Error e -> fail...
afef80935f8b4c94a7a155151990f77e0a6f4c41b5388b785980f8296b418a5f
binsec/haunted
prover.ml
(**************************************************************************) This file is part of BINSEC . (* *) Copyright ( C ) 2016 - 2019 CEA ( Co...
null
https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/formula/prover.ml
ocaml
************************************************************************ alternatives) you can redistribute it an...
This file is part of BINSEC . Copyright ( C ) 2016 - 2019 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , ve...
186c1bf1c3f34515b1658c46c97d48616a999d4db26224985ab8f3a4ab08212e
tsloughter/kuberl
kuberl_v1_rbd_persistent_volume_source.erl
-module(kuberl_v1_rbd_persistent_volume_source). -export([encode/1]). -export_type([kuberl_v1_rbd_persistent_volume_source/0]). -type kuberl_v1_rbd_persistent_volume_source() :: #{ 'fsType' => binary(), 'image' := binary(), 'keyring' => binary(), 'monitors' := list(), 'pool' => binary...
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_rbd_persistent_volume_source.erl
erlang
-module(kuberl_v1_rbd_persistent_volume_source). -export([encode/1]). -export_type([kuberl_v1_rbd_persistent_volume_source/0]). -type kuberl_v1_rbd_persistent_volume_source() :: #{ 'fsType' => binary(), 'image' := binary(), 'keyring' => binary(), 'monitors' := list(), 'pool' => binary...
35a8efa07727e493b33e73dd242d02bba921236f4dddbd1476aad9412b152931
nasa/Common-Metadata-Repository
echo_util.clj
(ns cmr.mock-echo.client.echo-util "Contains helper functions for working with the echo mock" (:require [clojure.set :as set] [clojure.string :as string] [cmr.common-app.api.launchpad-token-validation :as lt-validation] [cmr.common.log :as log :refer (debug info warn error)] [cmr.common.util :as util...
null
https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/0e64f0edcef65742c05b6ccf3da4d5c5586e814b/mock-echo-app/src/cmr/mock_echo/client/echo_util.clj
clojure
Token related ACL related subscription management acl
(ns cmr.mock-echo.client.echo-util "Contains helper functions for working with the echo mock" (:require [clojure.set :as set] [clojure.string :as string] [cmr.common-app.api.launchpad-token-validation :as lt-validation] [cmr.common.log :as log :refer (debug info warn error)] [cmr.common.util :as util...
28c23f8550f60675026c6ce74a584566398073aea152c199cd5ef6b1e914a030
gebi/jungerl
builder.erl
%%%---------------------------------------------------------------------- %%% File : builder.erl Author : Mats < > : < > Purpose : Simplify build of OTP applications & boot scripts Created : 2 Jan 2001 by Mats < etxmacr@avc386 > %%%-----------------------------------------------------------------...
null
https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/builder/src/builder.erl
erlang
---------------------------------------------------------------------- File : builder.erl ---------------------------------------------------------------------- <p>This program compiles .rel, .script, .boot and sys.config files and is intended to be (much) easier and safer to use than doing it all files.</p> ...
Author : Mats < > : < > Purpose : Simplify build of OTP applications & boot scripts Created : 2 Jan 2001 by Mats < etxmacr@avc386 > @doc OTP release script builder . for erlang applications . It supports incremental and recursive builds , manually . This program does not generate beam code ...
fec91ea35f65cbbf5dd415019d1ad10b23c9155041b6691abe38442ad769c921
jimcrayne/jhc
Map.hs
module Options.Map(processLanguageFlags,languageDefault,generateJhcParams) where -- LANGUAGE -> FlagOpts mapping import Data.Char(toLower) import Data.List(sort) import qualified Data.ByteString.Char8 as BS8 import qualified Data.Map as Map import qualified Data.Set as Set import qualified FlagOpts as FO # NOINLINE ...
null
https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/src/Options/Map.hs
haskell
LANGUAGE -> FlagOpts mapping these will be cleared by a language specification maps to set of flags erases all previous set flags # NOINLINE generateJhcParams #
module Options.Map(processLanguageFlags,languageDefault,generateJhcParams) where import Data.Char(toLower) import Data.List(sort) import qualified Data.ByteString.Char8 as BS8 import qualified Data.Map as Map import qualified Data.Set as Set import qualified FlagOpts as FO # NOINLINE processLanguageFlags # processLa...
9ff3751a6c41b14951e9d250043b830fa1aae570d28967aafe875370398854d3
tlaplus/tlapm
expr.ml
Packaging module for modules that work on TLA+ expressions . Copyright ( C ) 2011 - 2019 INRIA and Microsoft Corporation Copyright (C) 2011-2019 INRIA and Microsoft Corporation *) module T = E_t module Fmt = E_fmt module Subst = E_subst module Visit = E_visit module Eq = E_eq module Deref = E_deref module Le...
null
https://raw.githubusercontent.com/tlaplus/tlapm/158386319f5b6cd299f95385a216ade2b85c9f72/src/expr.ml
ocaml
Packaging module for modules that work on TLA+ expressions . Copyright ( C ) 2011 - 2019 INRIA and Microsoft Corporation Copyright (C) 2011-2019 INRIA and Microsoft Corporation *) module T = E_t module Fmt = E_fmt module Subst = E_subst module Visit = E_visit module Eq = E_eq module Deref = E_deref module Le...
c6182265ffea39bae73260f0d36ad95d6759d33467a055cf517949cf73f8dad0
inhabitedtype/ocaml-aws
createDBParameterGroup.ml
open Types open Aws type input = CreateDBParameterGroupMessage.t type output = CreateDBParameterGroupResult.t type error = Errors_internal.t let service = "rds" let signature_version = Request.V4 let to_http service region req = let uri = Uri.add_query_params (Uri.of_string (Aws.Util.of_option_exn (En...
null
https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/createDBParameterGroup.ml
ocaml
open Types open Aws type input = CreateDBParameterGroupMessage.t type output = CreateDBParameterGroupResult.t type error = Errors_internal.t let service = "rds" let signature_version = Request.V4 let to_http service region req = let uri = Uri.add_query_params (Uri.of_string (Aws.Util.of_option_exn (En...
91a76388f1aa9cc325a61ba962fb78a24aab1da8dbf91ec35b056ae84305d4d7
rodo/tsung-tricks
samplemod.erl
%% %% Sample module to show how using dynvars in module %% %% %% You have defined the following lines in your scenario %% and want to use the var named bar1 in your module %% %% <setdynvars sourcetype="random_string" length="13"> %% <var name="bar1" /> %% </setdynvars> %% %% <setdynvars sourcetype="erlang" callba...
null
https://raw.githubusercontent.com/rodo/tsung-tricks/f6c1e9638132745cec3628a65fbea2fdfcb6e17a/samplemod.erl
erlang
Sample module to show how using dynvars in module You have defined the following lines in your scenario and want to use the var named bar1 in your module <setdynvars sourcetype="random_string" length="13"> <var name="bar1" /> </setdynvars> <setdynvars sourcetype="erlang" callback="samplemod:foo"> ...
-module('samplemod'). -export([foo/1]). foo({_Pid, DynVars})-> {ok, Rand}=ts_dynvars:lookup(bar1,DynVars), "random=" ++ binary_to_list(Rand).
8db7f0a755d5abafe5d0c07db29a7c9dc9a776970c9f24d00dcf029614264118
Z572/guile-wlroots
xcursor.scm
(define-module (wlroots types xcursor) #:use-module (wayland list) ;; #:use-module (wlroots render renderer) ;; #:use-module (wlroots types output-layout) #:use-module (wlroots utils) #:use-module (wlroots types) #:use-module (bytestructures guile) #:use-module ((system foreign) #:select ((uint32 . ffi:ui...
null
https://raw.githubusercontent.com/Z572/guile-wlroots/dc6cd05d5c46f811d75cbc30d1464820b19b1de8/wlroots/types/xcursor.scm
scheme
#:use-module (wlroots render renderer) #:use-module (wlroots types output-layout)
(define-module (wlroots types xcursor) #:use-module (wayland list) #:use-module (wlroots utils) #:use-module (wlroots types) #:use-module (bytestructures guile) #:use-module ((system foreign) #:select ((uint32 . ffi:uint32) (float . ffi:float) ...
ba66ddcff58008b51a5bdd7ea05f7356a8527befe5c73aaacbc5c7816e735456
privet-kitty/cl-competitive
compile-test.lisp
#-swank (quit :unix-status (process-exit-code (run-program *runtime-pathname* (list "--noinform" "--eval" (format nil "(compile-file \"~A\")" *load-pathname*) "--quit") :output t :error t :input t)))
null
https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/non-module/compile-test.lisp
lisp
#-swank (quit :unix-status (process-exit-code (run-program *runtime-pathname* (list "--noinform" "--eval" (format nil "(compile-file \"~A\")" *load-pathname*) "--quit") :output t :error t :input t)))
165265e798daf0d9834dcf71bdee719638a3687c9cff41d0d4f33e2dc0e28be5
spell-music/csound-expression
Main.hs
{-# Language OverloadedStrings #-} module Main where import Control.Applicative import qualified Data.Tree as T import qualified Data.Map as M import Data.String import Shelly import Csound.Gen.Types import Csound.Gen.Parse import Csound.Gen.Pretty import Paths_gen_csound_opcodes main = do mainBy Dynamic ma...
null
https://raw.githubusercontent.com/spell-music/csound-expression/29c1611172153347b16d0b6b133e4db61a7218d5/gen-csound-opcodes/app/Main.hs
haskell
# Language OverloadedStrings # print "hi" -- mainBy Dynamic
module Main where import Control.Applicative import qualified Data.Tree as T import qualified Data.Map as M import Data.String import Shelly import Csound.Gen.Types import Csound.Gen.Parse import Csound.Gen.Pretty import Paths_gen_csound_opcodes main = do mainBy Dynamic mainBy Typed mkProjectDir :: Packag...
8d2f15e3d67995a61f970a5c71bd0c50dee7f0877e77df1a23371ebc7aa6fee4
GlideAngle/flare-timing
PublishedRMain.hs
import Test.Tasty (TestTree, testGroup, defaultMain) import qualified Published.Flat as F import qualified Published.Sphere as S import qualified Published.Ellipsoid.Vincenty as V import qualified Published.Ellipsoid.AndoyerLambert as AL import qualified Published.Ellipsoid.ForsytheAndoyerLambert as FAL main :: IO ()...
null
https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/earth/test-suite-published-r/PublishedRMain.hs
haskell
import Test.Tasty (TestTree, testGroup, defaultMain) import qualified Published.Flat as F import qualified Published.Sphere as S import qualified Published.Ellipsoid.Vincenty as V import qualified Published.Ellipsoid.AndoyerLambert as AL import qualified Published.Ellipsoid.ForsytheAndoyerLambert as FAL main :: IO ()...
43da84a0518086c5ea2f10d064db00c0f4be04af0d0925c4ef80c2273eef30b7
smucclaw/dsl
RelevanceSpec.hs
{-# LANGUAGE OverloadedStrings #-} module AnyAll.RelevanceSpec where import qualified Data.Text as T import Data.Tree import Test.Hspec import AnyAll.Types import AnyAll.Relevance import qualified Data.Map as Map import AnyAll.BoolStruct import Test.Hspec.QuickCheck (prop) import Test.QuickCheck.Instances.Text markin...
null
https://raw.githubusercontent.com/smucclaw/dsl/c37a58833688da1a6e7c6485d8b6970be1f67f97/lib/haskell/anyall/test/AnyAll/RelevanceSpec.hs
haskell
# LANGUAGE OverloadedStrings #
module AnyAll.RelevanceSpec where import qualified Data.Text as T import Data.Tree import Test.Hspec import AnyAll.Types import AnyAll.Relevance import qualified Data.Map as Map import AnyAll.BoolStruct import Test.Hspec.QuickCheck (prop) import Test.QuickCheck.Instances.Text markingMap :: Either (Maybe Bool) (Maybe ...
b00764ed1e8ece810af4d1a492d6753fda33b9a33088a7648f9000f021b5d7fa
josefs/Gradualizer
flow.erl
-module(flow). -export([foo/0, bar/1]). foo() -> bar(apa). -spec bar(apa | bepa) -> true | false. bar(apa) -> true; bar(bepa) -> false.
null
https://raw.githubusercontent.com/josefs/Gradualizer/f647ae76b1510f6d3b367fec06dc2d68c7ede88c/test/should_pass/flow.erl
erlang
-module(flow). -export([foo/0, bar/1]). foo() -> bar(apa). -spec bar(apa | bepa) -> true | false. bar(apa) -> true; bar(bepa) -> false.
2805510cf05e6acaf42efa8341e4c94d5d21c26b98fd2c809d5908f36b160118
bef/erlswf
swfmime.erl
-module(swfmime). -export([getmime/1]). @doc match for known swf - related mimetype ( ) ) - > swf | abc | empty | unknown getmime(<<"CWS", _/binary>>) -> swf; getmime(<<"FWS", _/binary>>) -> swf; getmime(<<X:16/unsigned-integer-little, 46:16/unsigned-integer-little, _/binary>>) when X =:= 16; X =:= 15; X =:= 14 ...
null
https://raw.githubusercontent.com/bef/erlswf/1397591d012aaa020f9ffc0ecd5436e65814e668/src/swfmime.erl
erlang
-module(swfmime). -export([getmime/1]). @doc match for known swf - related mimetype ( ) ) - > swf | abc | empty | unknown getmime(<<"CWS", _/binary>>) -> swf; getmime(<<"FWS", _/binary>>) -> swf; getmime(<<X:16/unsigned-integer-little, 46:16/unsigned-integer-little, _/binary>>) when X =:= 16; X =:= 15; X =:= 14 ...
9e0d8b608d251b5089cfd3d593adb01dedc004639f6e15815e1f3e3de927b506
yoriyuki/Camomile
uPervasives.mli
(** Functions for toplevel *) Copyright ( C ) 2002 , 2003 . (* This library is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public License *) as published by the Free Software Foundation ; either version 2 of the License , or ( at your option ) any la...
null
https://raw.githubusercontent.com/yoriyuki/Camomile/d7d8843c88fae774f513610f8e09a613778e64b3/Camomile/public/uPervasives.mli
ocaml
* Functions for toplevel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License may link, statically or dynamically, a "work that uses this library" with a publicly distributed version of this library to produce an executable file conta...
Copyright ( C ) 2002 , 2003 . as published by the Free Software Foundation ; either version 2 of the License , or ( at your option ) any later version . As a special exception to the GNU Library General Public License , you additional requirements listed in clause 6 of the GNU Library General we mean e...
1d0220338cadb83e64d53bcfddcf369c7039ba58a84d1e29d247e9a2ffc6ddd1
matijapretnar/eff
queensNative.ml
(******************************************************************************) let no_attack (x, y) (x', y') = x <> x' && y <> y' && abs (x - x') <> abs (y - y') let rec not_attacked x' = function | [] -> true | x :: xs -> if no_attack x' x then not_attacked x' xs else false let available (number_of_queens, ...
null
https://raw.githubusercontent.com/matijapretnar/eff/0b0ec7a83e7db4d040ed8fdfc1ac6e3c0f344be1/misc/code-generation-benchmarks/benchmark-suite/queensNative.ml
ocaml
**************************************************************************** **************************************************************************** **************************************************************************** **************************************************************************** ************...
let no_attack (x, y) (x', y') = x <> x' && y <> y' && abs (x - x') <> abs (y - y') let rec not_attacked x' = function | [] -> true | x :: xs -> if no_attack x' x then not_attacked x' xs else false let available (number_of_queens, x, qs) = let rec loop (possible, y) = if y < 1 then possible else if no...
5ec8a1c09fad07b357f86b5fd154174c5612013ca034731d4d433dad8087a848
lamdu/lamdu
PrimVal.hs
module Lamdu.Builtins.PrimVal ( KnownPrim(..) , fromKnown, toKnown ) where import Data.Binary.Extended (encodeS, decodeS) import Lamdu.Builtins.Anchors (bytesTid, floatTid, charTid) import qualified Lamdu.Calc.Term as V import Lamdu.Prelude data KnownPrim = Float Double ...
null
https://raw.githubusercontent.com/lamdu/lamdu/8ea5e9d95e295bdbc12719437934ef2ed85f2fdb/src/Lamdu/Builtins/PrimVal.hs
haskell
module Lamdu.Builtins.PrimVal ( KnownPrim(..) , fromKnown, toKnown ) where import Data.Binary.Extended (encodeS, decodeS) import Lamdu.Builtins.Anchors (bytesTid, floatTid, charTid) import qualified Lamdu.Calc.Term as V import Lamdu.Prelude data KnownPrim = Float Double ...
6b5517b009e827c876b4e437ca4ae36c9effa5510c23ff6101d98d7d57ae2be4
secYOUre/taider
taider_tai.erl
Copyright ( c ) 2006 - 2011 , , Security Pillar Ltd ( secYOUre ) %% 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 %...
null
https://raw.githubusercontent.com/secYOUre/taider/1ce911af49f8f881b868f4a86bf7594dc0235e58/src/taider_tai.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...
Copyright ( c ) 2006 - 2011 , , Security Pillar Ltd ( secYOUre ) * Neither the name of Security Pillar Ltd nor the names of its " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT COPYRIGHT OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGE...
e988164da13f374bb50ce402f07871baf8f1cdf71c91efa94c5b5472c2b0d94c
Tclv/HaskellBook
typekwondo.hs
data Woot data Blah f :: Woot -> Blah f = undefined g :: (Blah, Woot) -> (Blah, Blah) g (b, w) = (b, f w) f' :: Int -> String f' = undefined g' :: String -> Char g' = undefined h' :: Int -> Char h' = g' . f' data A data B data C q :: A -> B q = undefined w :: B -> C w = undefined e :: A -> C e = w . q data ...
null
https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch5/typekwondo.hs
haskell
data Woot data Blah f :: Woot -> Blah f = undefined g :: (Blah, Woot) -> (Blah, Blah) g (b, w) = (b, f w) f' :: Int -> String f' = undefined g' :: String -> Char g' = undefined h' :: Int -> Char h' = g' . f' data A data B data C q :: A -> B q = undefined w :: B -> C w = undefined e :: A -> C e = w . q data ...
2bdacf9392f7f8fccc4cb29d0ada2c90bc59a600ecb9ff2f4f77a6cebc459d63
open-company/open-company-storage
components.clj
(ns oc.storage.components (:require [com.stuartsierra.component :as component] [taoensso.timbre :as timbre] [org.httpkit.server :as httpkit] [oc.lib.db.pool :as pool] [oc.lib.sqs :as sqs] [oc.lib.sentry.core :refer (map->SentryCapturer)] [oc.stor...
null
https://raw.githubusercontent.com/open-company/open-company-storage/ae4bbe6245f8736f3c1813c3048448035aff5815/src/oc/storage/components.clj
clojure
core.async channel consumer for notification events core.async channel consumer for notification events
(ns oc.storage.components (:require [com.stuartsierra.component :as component] [taoensso.timbre :as timbre] [org.httpkit.server :as httpkit] [oc.lib.db.pool :as pool] [oc.lib.sqs :as sqs] [oc.lib.sentry.core :refer (map->SentryCapturer)] [oc.stor...
bbe86178b0a6560c14f0174d0cb3a88d60243d3951b3003f3364413132b1771b
diku-dk/futhark
Monad.hs
# LANGUAGE QuasiQuotes # -- | C code generator framework. module Futhark.CodeGen.Backends.GenericC.Monad ( -- * Pluggable compiler Operations (..), Publicness (..), OpCompiler, ErrorCompiler, CallCompiler, PointerQuals, MemoryType, WriteScalar, writeScalarPointerWithQuals, Rea...
null
https://raw.githubusercontent.com/diku-dk/futhark/7cb7e64f66bc8923b2c437b123389d316cdc9f04/src/Futhark/CodeGen/Backends/GenericC/Monad.hs
haskell
| C code generator framework. * Pluggable compiler * Building Blocks How public an array type definition sould be. Public types show up in the generated API, while private types are used only to implement the members of opaques. | In which part of the header file we put the declaration. This is to ensure that...
# LANGUAGE QuasiQuotes # module Futhark.CodeGen.Backends.GenericC.Monad Operations (..), Publicness (..), OpCompiler, ErrorCompiler, CallCompiler, PointerQuals, MemoryType, WriteScalar, writeScalarPointerWithQuals, ReadScalar, readScalarPointerWithQuals, Allocate, De...
8f268831abb4cc2e21fb0495c4cdb3737fb7f2df45462c3a5d0723855728f8eb
robbielynch/ierlang
ierl_script.erl
%%%------------------------------------------------------------------- @author < > ( C ) 2014 , %%% @doc This modules defines functions used to starts all the %%% IErlang servers, to handle messages, and to parse the json %%% configuration file. %%% %%% @end Created : 31 . Mar 2014 10:02 %%%------...
null
https://raw.githubusercontent.com/robbielynch/ierlang/c5ee5ae5b91c0dca496405a312ffc5681013e196/src/ierl_script.erl
erlang
------------------------------------------------------------------- @doc This modules defines functions used to starts all the IErlang servers, to handle messages, and to parse the json configuration file. @end ------------------------------------------------------------------- JSON FILE CONTENTS Recei...
@author < > ( C ) 2014 , Created : 31 . Mar 2014 10:02 -module (ierl_script). -export ([main/1]). The list contains the absolute path to the file . stdin_port : 52248 , ip : " 127.0.0.1 " , control_port : 52249 , hb_port : 52250 , signature_scheme : " hmac - sha256 " ,...
b010f15d915c3a9cc494a7b1aa55f18965c3192ddf5d1be91fbd6aff439f2d74
mfikes/fifth-postulate
ns205.cljs
(ns fifth-postulate.ns205) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
null
https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns205.cljs
clojure
(ns fifth-postulate.ns205) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
d42e9d5cda946c65338a61543289bbfdc4609930dde03f8c55ce42fbadbfbf49
spechub/Hets
StatAna.hs
| Module : ./CASL_DL / StatAna.hs Description : static analysis of DL parts Copyright : ( c ) , Uni Bremen 2005 License : GPLv2 or higher , see LICENSE.txt Maintainer : Stability : provisional Portability : portable static analysis of DL parts especially cardinali...
null
https://raw.githubusercontent.com/spechub/Hets/bbaa9dd2d2e5eb1f2fd3ec6c799a6dde7dee6da2/CASL_DL/StatAna.hs
haskell
| True -> extend all sort declarations without a supersort with supersort Thing False -> remove Thing from all sort declarations with supersort Thing | marker for sig items added to a basic spec | symbol map analysis | extract the Id from any OP_SYMB
| Module : ./CASL_DL / StatAna.hs Description : static analysis of DL parts Copyright : ( c ) , Uni Bremen 2005 License : GPLv2 or higher , see LICENSE.txt Maintainer : Stability : provisional Portability : portable static analysis of DL parts especially cardinali...
b42879db31cf7577e8e110688d466d5fdb935af2472572d4361effe579a43aeb
FlowerWrong/mblog
shop3.erl
%% --- Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . %% Copyrights apply to this code. It may not be used to create training material, %% courses, books, articles, and the like. Contact us if you are in doubt. %% We make no guarantees that this code is fit for...
null
https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/shop3.erl
erlang
--- Copyrights apply to this code. It may not be used to create training material, courses, books, articles, and the like. Contact us if you are in doubt. We make no guarantees that this code is fit for any purpose. Visit for more book information. ---
Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . -module(shop3). -export([total/1]). total([{What, N}|T]) -> case (catch shop:cost(What)) of {'EXIT', _} -> io:format("The shop does not sell ~p~n",[What]), total(T); Cost -> Cost * N + total(T) ...
d3d03b03401422f642e9af009eae9b633f6257756436ae65177e30617e7f2e8c
opennars/Narjure
bag.clj
(ns narjure.test.bag (:require [clojure.test :refer :all] [narjure.bag :as b])) (deftest test-default-bag (let [n 10 elements (mapv (fn [id] {:priority (rand) :id id}) (range n)) bag (reduce b/add-element (b/default-bag n) el...
null
https://raw.githubusercontent.com/opennars/Narjure/cd5a72e6777fc47271d721fef8362aa2dad664ca/test/narjure/test/bag.clj
clojure
(ns narjure.test.bag (:require [clojure.test :refer :all] [narjure.bag :as b])) (deftest test-default-bag (let [n 10 elements (mapv (fn [id] {:priority (rand) :id id}) (range n)) bag (reduce b/add-element (b/default-bag n) el...
5b5a3f44fab5bf2ce6f344e62ec58f876b02f4472759cceda4f5f7f33774beb5
simplex-chat/simplexmq
CLITests.hs
{-# LANGUAGE OverloadedStrings #-} module CLITests where import Data.Ini (lookupValue, readIniFile) import Data.List (isPrefixOf) import Simplex.Messaging.Notifications.Server.Main import Simplex.Messaging.Server.Main import Simplex.Messaging.Transport (simplexMQVersion) import Simplex.Messaging.Util (catchAll_) impo...
null
https://raw.githubusercontent.com/simplex-chat/simplexmq/56eea29ec36ba723fda6ae27a18e03a4e5aad6e8/tests/CLITests.hs
haskell
# LANGUAGE OverloadedStrings #
module CLITests where import Data.Ini (lookupValue, readIniFile) import Data.List (isPrefixOf) import Simplex.Messaging.Notifications.Server.Main import Simplex.Messaging.Server.Main import Simplex.Messaging.Transport (simplexMQVersion) import Simplex.Messaging.Util (catchAll_) import System.Directory (doesFileExist)...
06ec135bb84bd62825d3cd246776582ccd06ba0cbfd2abe2dedc03ca0691673c
weavejester/ns-tracker
core.clj
(ns ns-tracker.core "Keeps track of which namespaces have changed and need to be reloaded." (:import java.io.PushbackReader java.io.File) (:require [clojure.java.io :as io] [clojure.set :refer [union]] [clojure.tools.namespace.file :refer [clojure-file?]] [clojure.to...
null
https://raw.githubusercontent.com/weavejester/ns-tracker/f863301dbd28b91a0de76272324bd4717cbe6864/src/ns_tracker/core.clj
clojure
(ns ns-tracker.core "Keeps track of which namespaces have changed and need to be reloaded." (:import java.io.PushbackReader java.io.File) (:require [clojure.java.io :as io] [clojure.set :refer [union]] [clojure.tools.namespace.file :refer [clojure-file?]] [clojure.to...
6b37b07311f3b16abecf9ce831f862418b0e274063793e38aecdd15949b461c1
JKTKops/ProtoHaskell
local.hs
example code from ParserTest.hs , adapted into various forms for testing test1 :: IO TestTree test1 = goldenPShow "Parser Golden Tests" "test/Compiler/Parser/testcases" runParse where runParse fn = parse fn noFlags test2 :: IO TestTree test2 = let name = "Parser Golden Test...
null
https://raw.githubusercontent.com/JKTKops/ProtoHaskell/437c37d7bd6d862008f86d7e8045c7a60b12b532/test/Compiler/Parser/testcases/shouldsucceed/local.hs
haskell
nested block contexts
example code from ParserTest.hs , adapted into various forms for testing test1 :: IO TestTree test1 = goldenPShow "Parser Golden Tests" "test/Compiler/Parser/testcases" runParse where runParse fn = parse fn noFlags test2 :: IO TestTree test2 = let name = "Parser Golden Test...