_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
063b25b5fb094db495c601e341a82dd056f9a04e50a83aff99309850af8eb8dd
joneshf/open-source
Format.hs
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # {-# LANGUAGE PackageImports #-} # LANGUAGE TypeApplications # module Shake.Haskell.Format (rules) where import "mtl" Control.Monad.Reader (ReaderT, asks, lift) import "shake" Development.Shake ( CmdOption(Traced) , Rules , cmd_ , copyFileChan...
null
https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/Shake/Haskell/Format.hs
haskell
# LANGUAGE PackageImports #
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE TypeApplications # module Shake.Haskell.Format (rules) where import "mtl" Control.Monad.Reader (ReaderT, asks, lift) import "shake" Development.Shake ( CmdOption(Traced) , Rules , cmd_ , copyFileChanged , need , needed ...
7b1c51a419a4679c174190b3fbb0bcde339d93758fc6c07752b80b1be2682de9
dsheets/ocaml-sodium
sodium.ml
* Copyright ( c ) 2013 - 2015 < > * Copyright ( c ) 2014 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE S...
null
https://raw.githubusercontent.com/dsheets/ocaml-sodium/1f064fa90cd02c44e2dcc0708d4ba3a256a9c1f2/lib/sodium.ml
ocaml
Invariant: a nonce is nonce_size bytes long. always returns 0 always returns 0 always returns 0 always returns 0 Invariant: a key is {public,secret}_key_size bytes long. Invariant: a signature is signature_size bytes long. Invariant: a seed is seed_size bytes long. always returns 0 always returns 0 ...
* Copyright ( c ) 2013 - 2015 < > * Copyright ( c ) 2014 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE S...
f088edfc0013e55d8427db4686d5298239836b9ca8bed3246f61f2b64c8438a7
dterei/SafeHaskellExamples
Trusted.hs
# LANGUAGE Trustworthy # -- | Run an unsafe plugin. -- -- By declaring a `Coercible` constraint in the context of `runPlugin`, the -- untrusted code can convince this module to generate a dictionary for it and -- pass it in. module Main where import safe UnsafePlugin import RIOInternal main :: IO () main = do let l...
null
https://raw.githubusercontent.com/dterei/SafeHaskellExamples/0f7bbb53cf1cbb8419ce3a4aa4258b84be30ffcc/roles4/Trusted.hs
haskell
| Run an unsafe plugin. By declaring a `Coercible` constraint in the context of `runPlugin`, the untrusted code can convince this module to generate a dictionary for it and pass it in.
# LANGUAGE Trustworthy # module Main where import safe UnsafePlugin import RIOInternal main :: IO () main = do let lv = LValue "secret" putStrLn "Starting..." rio $ (runPlugin :: LValue -> RIO ()) lv
e241c8f4529fc3e6f06f39d9d20f1b274400c7394e18649ce40c1ae2d98e776e
gsakkas/rite
20060305-22:23:52-2cddd39a2e0ba2ddb9831a32c8c470f4.seminal.ml
let rec reverseHelp place str = let revStr = Char.escaped str.[place] in let currPlace = place - 1 in if place > 0 then revStr ^ reverseHelp currPlace str else revStr let reverse str = let strLen = String.length str in let place = strLen - 1 in reverseHelp place str let rec...
null
https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060305-22%3A23%3A52-2cddd39a2e0ba2ddb9831a32c8c470f4.seminal.ml
ocaml
let rec reverseHelp place str = let revStr = Char.escaped str.[place] in let currPlace = place - 1 in if place > 0 then revStr ^ reverseHelp currPlace str else revStr let reverse str = let strLen = String.length str in let place = strLen - 1 in reverseHelp place str let rec...
1539189fa7fa98da8792b470ff238f304458af3ed5705fd1ac0a1ef1138e0478
spell-music/csound-expression
MathematicalOperations.hs
module Csound.Typed.Opcode.MathematicalOperations ( -- * Comparators and Accumulators. clear, vincr, -- * Amplitude Functions. ampdb, ampdbfs, dbamp, dbfsamp, -- * Random Functions. birnd, rnd, -- * Opcode Equivalents of Functions. divz, mac, maca, polynomial, po...
null
https://raw.githubusercontent.com/spell-music/csound-expression/29c1611172153347b16d0b6b133e4db61a7218d5/csound-expression-opcodes/src/Csound/Typed/Opcode/MathematicalOperations.hs
haskell
* Comparators and Accumulators. * Amplitude Functions. * Random Functions. * Opcode Equivalents of Functions. Comparators and Accumulators. | clear zeroes a list of audio signals. csound doc: <> | csound doc: <> Amplitude Functions. | Returns the amplitude equivalent of the decibel value x. Retu...
module Csound.Typed.Opcode.MathematicalOperations ( clear, vincr, ampdb, ampdbfs, dbamp, dbfsamp, birnd, rnd, divz, mac, maca, polynomial, pow, product', sum', taninv2) where import Control.Monad.Trans.Class import Csound.Dynamic import Csound.Typed Zeroes a list of audio s...
e997536c9776d083d455af8f14877b4c0321c1e3f6255a018a00963362f83e5a
psilord/option-9
damage.lisp
(in-package :option-9) If two collidables damage each other , one or both can die . (defmethod damage ((ent-1 collidable) (ent-2 collidable)) (when (and (alivep ent-1) (alivep ent-2)) (decf (hit-points ent-1) (damage-points ent-2)) (when (<= (hit-points ent-1) 0) (die ent-1)) (decf (hit-points e...
null
https://raw.githubusercontent.com/psilord/option-9/44d96cbc5543ee2acbdcf45d300207ef175462bc/damage.lisp
lisp
If a hardnose-shot has equal or more hit points than the other simple-shot it destroys it and keeps going undamaged. otherwise, we damage them both If a super-shot has equal or more hit points than the other collidable it destroys it and keeps going undamaged. otherwise, we damage them both... a tesla-field by i...
(in-package :option-9) If two collidables damage each other , one or both can die . (defmethod damage ((ent-1 collidable) (ent-2 collidable)) (when (and (alivep ent-1) (alivep ent-2)) (decf (hit-points ent-1) (damage-points ent-2)) (when (<= (hit-points ent-1) 0) (die ent-1)) (decf (hit-points e...
2863f950909eee91fd6b109d51ede037ac34cc3c26b08113699468f48fcd94a5
jnoll/gantt
FormatMarkdown.hs
module FormatMarkdown (formatMarkdown) where import Parse import DateRange import Control.Monad.Reader import Data.List (intercalate) import Data.Time.Calendar.WeekDate (toWeekDate) import Data.Time.Format (formatTime) import Data.Time.Locale.Compat (defaultTimeLocale) import Text.Printf (printf) status :: Day -> Day...
null
https://raw.githubusercontent.com/jnoll/gantt/e7099e1786177580526d8da43d62e0182f00e681/FormatMarkdown.hs
haskell
module FormatMarkdown (formatMarkdown) where import Parse import DateRange import Control.Monad.Reader import Data.List (intercalate) import Data.Time.Calendar.WeekDate (toWeekDate) import Data.Time.Format (formatTime) import Data.Time.Locale.Compat (defaultTimeLocale) import Text.Printf (printf) status :: Day -> Day...
429c9b71ddb26f0105223677d207f3152850e347f91aa4f6ce5207b4407c2d96
uim/uim
json.scm
;; JSON implementation for Scheme ;; See / or ;; Copyright ( c ) 2005 < > Copyright ( c ) 2005 LShift Ltd. < > ;; ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without ;;...
null
https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/scm/json.scm
scheme
JSON implementation for Scheme See / or 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, and/or sell copies furnished to...
Copyright ( c ) 2005 < > Copyright ( c ) 2005 LShift Ltd. < > 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 Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRA...
79a882793edf3aa9c0a872242273c66a4b6ba71dafba699e61ade5649f35ee7e
dbushenko/sitecompiler
hcparser.clj
(ns sitecompiler.parsers.hcparser (:require [sitecompiler.header :as header] [hiccup.core :as hc]) (:use sitecompiler.common)) (defrecord HiccupParser [] Supported (supported? [this ext] (= "hiccup" ext)) Parser (parse [this fl] (let [h (header/parse-file fl)] (assoc h ...
null
https://raw.githubusercontent.com/dbushenko/sitecompiler/ff916d4539a3c4694a1664f087a45cfdf847ecdc/src/sitecompiler/parsers/hcparser.clj
clojure
(ns sitecompiler.parsers.hcparser (:require [sitecompiler.header :as header] [hiccup.core :as hc]) (:use sitecompiler.common)) (defrecord HiccupParser [] Supported (supported? [this ext] (= "hiccup" ext)) Parser (parse [this fl] (let [h (header/parse-file fl)] (assoc h ...
8079a5af60017447092f62fe6fc8f534183790fd6895573e23e28f63039a38d8
metabase/metabase
core.clj
(ns better-cond.core "A clj-kondo hook to allow linting of better-cond `cond` macro. This supports better-cond version 2.0.0+. To use in a project, change the namespace to hooks.better-cond, put this code in file .clj-kondo/hooks/better_cond.clj, and include a config.edn entry in the :hooks key like: ...
null
https://raw.githubusercontent.com/metabase/metabase/b34fae975cf6e3893f37209920561cf1acd94949/.clj-kondo/better-cond/better-cond/better_cond/core.clj
clojure
Avoid reprocessing the cond with ns here better-cond allows single clause for default Handle special better-cond constructs Multi stage constructs fine for linting
(ns better-cond.core "A clj-kondo hook to allow linting of better-cond `cond` macro. This supports better-cond version 2.0.0+. To use in a project, change the namespace to hooks.better-cond, put this code in file .clj-kondo/hooks/better_cond.clj, and include a config.edn entry in the :hooks key like: ...
44e235b9c3279142e119443102d1408d467e1e7d42988b22dbf14317ace189fc
vnarek/jude
self_message.ml
open Jude module Backend = Backend.Make ((val Backend.create_config ())) module Arbiter = Jude.Arbiter.Make (Backend) module Msg = struct type t = First | Second | Third [@@deriving bin_io] end let self_message () ctx = let self_pid = Actor.self_pid ctx in let self_send = Arbiter.send self_pid (module Msg) in...
null
https://raw.githubusercontent.com/vnarek/jude/b1e9387d0242cd83b3b72695bce267c970de1857/example/self_message.ml
ocaml
open Jude module Backend = Backend.Make ((val Backend.create_config ())) module Arbiter = Jude.Arbiter.Make (Backend) module Msg = struct type t = First | Second | Third [@@deriving bin_io] end let self_message () ctx = let self_pid = Actor.self_pid ctx in let self_send = Arbiter.send self_pid (module Msg) in...
d57372396af997bf4f8731fb0361e6622eee5776164174455ea0b3289b30ee22
serokell/tzbot
Save.hs
SPDX - FileCopyrightText : 2022 > -- SPDX - License - Identifier : MPL-2.0 module TzBot.Feedback.Save ( FeedbackEntry (..) , saveFeedback ) where import Universum import Data.Aeson (ToJSON, encode) import Data.List.NonEmpty qualified as NE import Data.String.Conversions (cs) import Data.Time (UTCTime) i...
null
https://raw.githubusercontent.com/serokell/tzbot/635077e77d6c85ab9c1711076aa1d5970444e7aa/src/TzBot/Feedback/Save.hs
haskell
and record to the file if configured. Send to the slack channel We always render the translation for other users (not author), so the author can see how his message is translated for others Record to the file
SPDX - FileCopyrightText : 2022 > SPDX - License - Identifier : MPL-2.0 module TzBot.Feedback.Save ( FeedbackEntry (..) , saveFeedback ) where import Universum import Data.Aeson (ToJSON, encode) import Data.List.NonEmpty qualified as NE import Data.String.Conversions (cs) import Data.Time (UTCTime) impo...
9845681c2f52ca28c041c3a6ed5bdc9ae73450bec11c7407eb49072114fd72ff
GaloisInc/HaNS
Addr.hs
# LANGUAGE PatternSynonyms # # LANGUAGE DeriveGeneric # # LANGUAGE ExistentialQuantification # # LANGUAGE StandaloneDeriving # module Hans.Addr ( Addr(), sameFamily, NetworkAddr(..), putAddr, showAddr, ) where import Hans.Addr.Types import qualified Hans.IP4.Packet as IP4 import Data.Hash...
null
https://raw.githubusercontent.com/GaloisInc/HaNS/2af19397dbb4f828192f896b223ed2b77dd9a055/src/Hans/Addr.hs
haskell
| Forget what kind of address this is. | Try to remember what this opaque address was. | Check to see if this address is the wildcard address. | The wildcard address | Check to see if this address is the broadcast address. | The broadcast address.
# LANGUAGE PatternSynonyms # # LANGUAGE DeriveGeneric # # LANGUAGE ExistentialQuantification # # LANGUAGE StandaloneDeriving # module Hans.Addr ( Addr(), sameFamily, NetworkAddr(..), putAddr, showAddr, ) where import Hans.Addr.Types import qualified Hans.IP4.Packet as IP4 import Data.Hash...
59e9b525872d3c6ccbce455a0c05afe16ae2ac6ef00581002792f1c40b7e7024
thepower/tpnode
tx1.erl
-module(tx1). -include("include/tplog.hrl"). -export([sign/2,verify1/1,verify/2,pack/1,unpack_mp/1,mkmsg/1]). checkaddr(<<Ia:64/big>>) -> {true, Ia}; checkaddr(_) -> false. mkmsg(#{ from:=From, deploy:=VMType, code:=NewCode, seq:=Seq, timestamp:=Timestamp }=Tx) -> if is_b...
null
https://raw.githubusercontent.com/thepower/tpnode/6212422bc9061d44d150ef2d777d6e694396ed15/apps/tpnode/src/tx1.erl
erlang
throw({invalid_address, to}); true -> ok end, BinPatch=settings:mp(LPatch), contract issued. Check nodes key. parse fee data, if no extdata make exception if no cur data settings patch probably newly parsed extdata should have priority? or not?
-module(tx1). -include("include/tplog.hrl"). -export([sign/2,verify1/1,verify/2,pack/1,unpack_mp/1,mkmsg/1]). checkaddr(<<Ia:64/big>>) -> {true, Ia}; checkaddr(_) -> false. mkmsg(#{ from:=From, deploy:=VMType, code:=NewCode, seq:=Seq, timestamp:=Timestamp }=Tx) -> if is_b...
9080e8ae16777895708b0e0bae8f97c58bf4c4cc63e8cd84081a2851cad21332
GumTreeDiff/cgum
token_annot.mli
* Copyright 2014 , INRIA * * This file is part of Cgen . Much of it comes from Coccinelle , which is * also available under the GPLv2 license * * Cgen 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 So...
null
https://raw.githubusercontent.com/GumTreeDiff/cgum/8521aa80fcf4873a19e60ce8c846c886aaefb41b/parsing_c/token_annot.mli
ocaml
* Copyright 2014 , INRIA * * This file is part of Cgen . Much of it comes from Coccinelle , which is * also available under the GPLv2 license * * Cgen 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 So...
1946289b8014ef05b15fb07b966d70a5d179a2597be1640651dba2a8d60496fc
scrintal/heroicons-reagent
wrench_screwdriver.cljs
(ns com.scrintal.heroicons.mini.wrench-screwdriver) (defn render [] [:svg {:xmlns "" :viewBox "0 0 20 20" :fill "currentColor" :aria-hidden "true"} [:path {:fillRule "evenodd" :d "M14.5 10a4.5 4.5 0 004.284-5.882c-.105-.324-.51-.391-.752-.15L15.34 6.66...
null
https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/wrench_screwdriver.cljs
clojure
(ns com.scrintal.heroicons.mini.wrench-screwdriver) (defn render [] [:svg {:xmlns "" :viewBox "0 0 20 20" :fill "currentColor" :aria-hidden "true"} [:path {:fillRule "evenodd" :d "M14.5 10a4.5 4.5 0 004.284-5.882c-.105-.324-.51-.391-.752-.15L15.34 6.66...
431856dddaafd0dc61419d8e00d31a0fa26096ce80b3813520c4d22460e5ef30
zwizwa/staapl
prog.rkt
#lang racket/base ;; PK2 device programming (provide (all-defined-out)) (require "util.rkt" "pk2const.rkt" ;; PICkit2 bits "pk2script.rkt" ;; command and scripting languages Reader for Microchip 's programming scripts "cmd.rkt") ;; INTERFACE ;; Accept a chunk list like 'write-ihex. (define (write-and-...
null
https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/pk2/prog.rkt
racket
PK2 device programming PICkit2 bits command and scripting languages INTERFACE Accept a chunk list like 'write-ihex. DEBUG Programming primitives. (READ_STATUS) 1uS (target-off) (printf "downloading: ~s\n" lst) (printf "iterations: ~s\n" script-iterations)
#lang racket/base (provide (all-defined-out)) (require "util.rkt" Reader for Microchip 's programming scripts "cmd.rkt") (define (write-and-verify write read it) (let ((bytes (length it))) (printf "write/verify ~a bytes\n" bytes) (write it) (when read (let verify ((n 3)) (let ((read...
3db6fbd28c95d2b019c13f58bd4caa45daa58d23873d78fe2947a570344440ff
BranchTaken/Hemlock
test_of_string.ml
open! Basis.Rudiments open! Basis open Bytes let test () = let strs = [ ""; "<_>«‡𐆗»[_]"; ] in List.iter strs ~f:(fun s -> let bytes = of_string_slice (String.C.Slice.of_string s) in File.Fmt.stdout |> String.pp s |> Fmt.fmt " -> " |> pp bytes |> Fmt.fmt " -> " |> String.pp (...
null
https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/bytes/test_of_string.ml
ocaml
open! Basis.Rudiments open! Basis open Bytes let test () = let strs = [ ""; "<_>«‡𐆗»[_]"; ] in List.iter strs ~f:(fun s -> let bytes = of_string_slice (String.C.Slice.of_string s) in File.Fmt.stdout |> String.pp s |> Fmt.fmt " -> " |> pp bytes |> Fmt.fmt " -> " |> String.pp (...
e2a3dc22413d86bac14da24b60993c4a18570536e176639779623ca2b06822e3
clojure-liberator/liberator
test_handler_context.clj
(ns test-handler-context (:use midje.sweet [ring.mock.request :only [request header]] [liberator.core :only [defresource resource]] [liberator.representation :only [ring-response]])) (defn ^:private negotiate [header-key resource-key representation-key available accepted] (-> (request :get "") (#...
null
https://raw.githubusercontent.com/clojure-liberator/liberator/4de95d28b259f12f130bdccfae5d3ad7f8447cd9/test/test_handler_context.clj
clojure
(ns test-handler-context (:use midje.sweet [ring.mock.request :only [request header]] [liberator.core :only [defresource resource]] [liberator.representation :only [ring-response]])) (defn ^:private negotiate [header-key resource-key representation-key available accepted] (-> (request :get "") (#...
484056298f61c56d679d975c9803c26f1f47a8bf6c33ca121ca67348272eddc3
pfeiferj/nvim-hurl
injections.scm
; injections.scm (json_value) @json (xml) @html (multiline_string (multiline_string_type) @language (multiline_string_content) @content @include-children @combined)
null
https://raw.githubusercontent.com/pfeiferj/nvim-hurl/b3026127bceabda60ae6d1f3630959f26f584e72/queries/hurl/injections.scm
scheme
injections.scm
(json_value) @json (xml) @html (multiline_string (multiline_string_type) @language (multiline_string_content) @content @include-children @combined)
852da5e6d02dc718a573b40f32d3f386b0865e4d611ee74ad59535f8b270024a
marigold-dev/chusai
port.ml
let next = ref 0 let fresh () = let slot = !next mod 1000 in incr next; Tezt.Cli.options.starting_port + (1000 * (Tezt.Test.current_worker_id () |> Option.value ~default:0)) + slot ;; let () = Tezt.Test.declare_reset_function @@ fun () -> next := 0
null
https://raw.githubusercontent.com/marigold-dev/chusai/09f798c585121d3b02bf3fed0f52f15c3bdc79a1/tezt/lib/port.ml
ocaml
let next = ref 0 let fresh () = let slot = !next mod 1000 in incr next; Tezt.Cli.options.starting_port + (1000 * (Tezt.Test.current_worker_id () |> Option.value ~default:0)) + slot ;; let () = Tezt.Test.declare_reset_function @@ fun () -> next := 0
9f0e26b9dc725754a384ef03f810dac5973f5fbe6a7f4ace5818ff6f2f138d20
bugarela/GADTInference
Lcg.hs
module Lcg (lcg,lcgn,lcgn',lcgn2, lcgi) where import Head import Type lcg:: [Type] -> TI SimpleType lcg scs = do (qt, _) <- lcg' scs []; return qt ----------------------------------------------------------------------------- type Gen = [((SimpleType,SimpleType),Id)] lcg':: [Type] -> Gen -> TI (SimpleType, Gen) lcg...
null
https://raw.githubusercontent.com/bugarela/GADTInference/dd179f6df2cd76055c25c33da3187a60815688d1/Lcg.hs
haskell
--------------------------------------------------------------------------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- ----------------...
module Lcg (lcg,lcgn,lcgn',lcgn2, lcgi) where import Head import Type lcg:: [Type] -> TI SimpleType lcg scs = do (qt, _) <- lcg' scs []; return qt type Gen = [((SimpleType,SimpleType),Id)] lcg':: [Type] -> Gen -> TI (SimpleType, Gen) lcg' [sc] s = do qt <- freshInstance sc; return (qt,s) lcg' (sc:scs) s = do t...
0622ed28ccb7b45963c5482c53c0de367355975c19fe85b0190ad38b73a80598
silky/myth
nat_pred.ml
(* CONTAINS CONTEXT FUNCTIONS *) type bool = | True | False let rec andb (n1:bool) (n2:bool) : bool = match n1 with | True -> n2 | False -> False ;; let rec orb (n1:bool) (n2:bool) : bool = match n1 with | True -> True | False -> n2 ;; type nat = | O | S of nat (* NO NAT FUNCTIONS *) type list...
null
https://raw.githubusercontent.com/silky/myth/b631edefb2a27a1d731daa6654517d91ca660b95/tests/pldi-2015-contexts/nat_pred.ml
ocaml
CONTAINS CONTEXT FUNCTIONS NO NAT FUNCTIONS
type bool = | True | False let rec andb (n1:bool) (n2:bool) : bool = match n1 with | True -> n2 | False -> False ;; let rec orb (n1:bool) (n2:bool) : bool = match n1 with | True -> True | False -> n2 ;; type nat = | O | S of nat type list = | Nil | Cons of nat * list let rec append (l1:li...
566ea7e8607c3f10c444d64215bc8c2d34688081f75431385bebffc51cfe00a2
picnic/RelationExtraction
proofgen.mli
(****************************************************************************) RelationExtraction - Extraction of inductive relations for Coq (* *) (* This program is free software: you can redistribute it and/or modify *) it u...
null
https://raw.githubusercontent.com/picnic/RelationExtraction/a4cee37d0a8e5f0eff2e010e6305e037aa0d2564/proofgen.mli
ocaml
************************************************************************** This program is free software: you can redistribute it and/or modify (at your option) any later version. ...
RelationExtraction - Extraction of inductive relations for Coq 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 Copyright 2...
162d6fd0ac2c771855a41d7edf75c4673828756c3df80e3f028cd1ea1a8ea8d4
binsec/haunted
dba_io.ml
(**************************************************************************) This file is part of BINSEC . (* *) Copyright ( C ) 2016 - 2019 CEA ( Co...
null
https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/server/dba_io.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...
0a2b8de5d3ac89c2cfc72e42ec8d0af16a7d6fe15eb7b5d82abd76ed9521e2d7
boomerang-lang/boomerang
timing.ml
open Core.Std type entry = { mutable laps : float list } let data : entry String.Table.t = String.Table.create () ~size:10 ;; let record ~label ~action : 'a = let entry = match Hashtbl.find data label with | None -> let entry = { laps = [] } in Hashtbl.set data ~key:label ~data:entry; entry |...
null
https://raw.githubusercontent.com/boomerang-lang/boomerang/b42c2bfc72030bbe5c32752c236c0aad3b17d149/optician/timing.ml
ocaml
open Core.Std type entry = { mutable laps : float list } let data : entry String.Table.t = String.Table.create () ~size:10 ;; let record ~label ~action : 'a = let entry = match Hashtbl.find data label with | None -> let entry = { laps = [] } in Hashtbl.set data ~key:label ~data:entry; entry |...
7e45441c0cd7f2cae3b12511c4297eaa787b364f678e640fe243a8709c289f2a
korya/efuns
dvroom.ml
(***********************************************************************) (* *) (* GwML *) (* *) Fabrice Le Fessa...
null
https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/gwml/dvroom.ml
ocaml
********************************************************************* GwML ...
Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt Copyright 1999 Institut National de Recherche en Informatique et Automatique . Distributed only by permission . open Options open Xtypes open Stdconfig open Gwml * * * We may have 3 reasons for a window no...
b2d1e882b2eebb9673b07718b5fdd8017610ff23d18f7e35989c0cf637e21bd1
mattmundell/nightshade
info.lisp
;;; GNU Info mode. ;; TODO: Remember previous position of point in node. ;; Scroll across nodes. Handle more than one buffer of same manual . ;; Improve speed of loading large multiple-file manuals. ;; Show from Index (i). ;; Search (s). ;; Go To Node (g). ;; FIXes below. (...
null
https://raw.githubusercontent.com/mattmundell/nightshade/68e960eff95e007462f2613beabc6cac11e0dfa1/src/ed/info.lisp
lisp
GNU Info mode. TODO: Remember previous position of point in node. Scroll across nodes. Improve speed of loading large multiple-file manuals. Show from Index (i). Search (s). Go To Node (g). FIXes below. Highlighting. Highlight navigation line. Highlight menu item. Do a ch...
Handle more than one buffer of same manual . (in-package "ED") (defun highlight-info-line (line chi-info) (or (line-previous line) (progn (chi-mark line 0 *original-font* :comment chi-info) (return-from highlight-info-line))) (or (line-previous (line-previous line)) (when (plusp (line-le...
960f3b3a933aed1c223671f68db0e16195b3c007a4fad439b38a7e112f441f9b
appleshan/cl-http
mac-autotyper.lisp
-*- Syntax : Ansi - Common - Lisp ; Base : 10 ; Mode : lisp ; Package : ccl -*- ( C ) Copyright 2000 , . ;;; All Rights Reserved. ;;;------------------------------------------------------------------- ;;; ;;; AUTOMATICALLY SET FILE TYPE AND CREATOR BASED ON FILE EXTENSION ;;; rewritten 3/20/2000 -- JCMa ...
null
https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/mcl/utilities/mac-autotyper.lisp
lisp
Base : 10 ; Mode : lisp ; Package : ccl -*- All Rights Reserved. ------------------------------------------------------------------- AUTOMATICALLY SET FILE TYPE AND CREATOR BASED ON FILE EXTENSION conses
( C ) Copyright 2000 , . rewritten 3/20/2000 -- JCMa . (in-package :ccl) (defvar *file-type-extension-table* (make-hash-table :test #'equalp)) (defun %define-file-type-extentions (specs) (loop with table = *file-type-extension-table* initially (clrhash table) for spec in specs ...
7364da95dda329812172990db2897e30705f8c5bf1b6e0d8b26f8c4dcccd08cc
rizo/snowflake-os
multiboot.mli
open Bigarray type data = (int, int8_unsigned_elt, c_layout) Array1.t external open_module : unit -> data = "caml_multiboot_module"
null
https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/multiboot.mli
ocaml
open Bigarray type data = (int, int8_unsigned_elt, c_layout) Array1.t external open_module : unit -> data = "caml_multiboot_module"
1bbd0083e8712fefa793a24a01635b27f43b57b844cb398d896d37cb2c149b75
mbutterick/typesetting
bytes.rkt
#lang racket/base (require racket/class racket/match "base.rkt" "util.rkt" "number.rkt") (provide (all-defined-out)) #| approximates |# (define x:bytes% (class x:base% (super-new) (init-field [(@len len)]) (unless (length-resolvable? @len) (raise-argument-error 'x:buffer "resolvable length" @len)...
null
https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/xenomorph/xenomorph/bytes.rkt
racket
approximates
#lang racket/base (require racket/class racket/match "base.rkt" "util.rkt" "number.rkt") (provide (all-defined-out)) (define x:bytes% (class x:base% (super-new) (init-field [(@len len)]) (unless (length-resolvable? @len) (raise-argument-error 'x:buffer "resolvable length" @len)) (define/augme...
d39543c0e06d4a3797d54257c073537c6c73d2278b9729d818635172ffca63d9
tov/dssl2
common.rkt
#lang racket/base (provide grammar defexpform defexpform* defexpidform defexpidform* defsmplform defsmplform* defsmplidform defsmplidform* defcmpdform defcmpdform* defcmpdidform defcmpdidform* defclassform linkclass defconstform defprocform defprocforms de...
null
https://raw.githubusercontent.com/tov/dssl2/953e23942cf9502f40505d8080af27bc4d5999a1/scribblings/common.rkt
racket
format->stx : [String -> X] [Format-string-like "~a"] Identifier -> [Syntax-of X] : string? element? -> element? : string? block? -> block? (but this doesn't seem to work anyway).
#lang racket/base (provide grammar defexpform defexpform* defexpidform defexpidform* defsmplform defsmplform* defsmplidform defsmplidform* defcmpdform defcmpdform* defcmpdidform defcmpdidform* defclassform linkclass defconstform defprocform defprocforms de...
9535f82a60b7a70d6472ac1113313834706f3df097585030c51a1addf73af149
cxphoe/SICP-solutions
4.75.rkt
(define (single-stream? s) (and (not (null? s)) (null? (stream-cdr s)))) (define (unique-query operands) (car operands)) (define (uniquely-asserted operands frame-stream) (stream-flatmap (lambda (frame) (let ((res-f (qeval (unique-query operands) (singleton-stream frame))))...
null
https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%204-Metalinguistic%20Abstraction/4.Logical%20Programing/4.75.rkt
racket
check Query input:
(define (single-stream? s) (and (not (null? s)) (null? (stream-cdr s)))) (define (unique-query operands) (car operands)) (define (uniquely-asserted operands frame-stream) (stream-flatmap (lambda (frame) (let ((res-f (qeval (unique-query operands) (singleton-stream frame))))...
6b052e331423f630b7d07ec9306998a8f20d86f7be5ac135bfeef16e6cfb16ba
mirage/ocaml-git
test.ml
open Bos open Rresult open Lwt_backend open Store_backend (** logging: *) let () = Printexc.record_backtrace true let v2_28_0 = { Git_version.major = 2; minor = 28; patch = Some "0"; revision = None; release_candidate = None; } let git_version = match Bos.( OS.Cmd.run_out Cmd.(v "...
null
https://raw.githubusercontent.com/mirage/ocaml-git/d502acbee22328dd98981fdd306cdd6a25c1ab5b/test/smart/test.ml
ocaml
* logging: * utils: * conduit-related setup for tests: * tmp dir management: * to keep track of directories created by unit tests and clean them up afterwards XXX(dinosaure): FIFO "à la BOS". * to keep track of named pipes (aka FIFOs) created by unit tests and clean them up afterwards 013b31a07f0dd8a7 3...
open Bos open Rresult open Lwt_backend open Store_backend let () = Printexc.record_backtrace true let v2_28_0 = { Git_version.major = 2; minor = 28; patch = Some "0"; revision = None; release_candidate = None; } let git_version = match Bos.( OS.Cmd.run_out Cmd.(v "git" % "--versio...
252a9722a07b76d4661e72e18e8aa68412b2cdb0a33ecc83d1ff90bf7bf5e34b
junjihashimoto/pocket-dns
Pocket.hs
module Network.DNS.Pocket ( Port , runServer , setDomain , getDomain , deleteDomain , listDomain ) where import Network . DNS.Pocket . Type import Network.DNS.Pocket.Server
null
https://raw.githubusercontent.com/junjihashimoto/pocket-dns/0fc75697097d9b78b3ea09ecb829b79a6eac53fa/Network/DNS/Pocket.hs
haskell
module Network.DNS.Pocket ( Port , runServer , setDomain , getDomain , deleteDomain , listDomain ) where import Network . DNS.Pocket . Type import Network.DNS.Pocket.Server
2cda12fde399cb0ebf4a454a89976f26bed011b594142e5072ebe8c28e73ca54
helium/blockchain-core
blockchain_txn_update_gateway_oui_v1.erl
%%%------------------------------------------------------------------- %% @doc %% == Blockchain Transaction Update Gateway OUI == %% @end %%%------------------------------------------------------------------- -module(blockchain_txn_update_gateway_oui_v1). -behavior(blockchain_txn). -behavior(blockchain_json). -includ...
null
https://raw.githubusercontent.com/helium/blockchain-core/270f90544c870295d3d767771e59d8038535dbd5/src/transactions/v1/blockchain_txn_update_gateway_oui_v1.erl
erlang
------------------------------------------------------------------- @doc == Blockchain Transaction Update Gateway OUI == @end ------------------------------------------------------------------- -------------------------------------------------------------------- @doc Only kept for callback @end ------------------...
-module(blockchain_txn_update_gateway_oui_v1). -behavior(blockchain_txn). -behavior(blockchain_json). -include("blockchain_json.hrl"). -include("blockchain_txn_fees.hrl"). -include("blockchain_vars.hrl"). -include_lib("helium_proto/include/blockchain_txn_update_gateway_oui_v1_pb.hrl"). -export([ new/3, hash/...
e4b5f2806c5701c1935e6ffff457562818ff65d5f5bc4e592ac2c38489ff1b85
michiakig/sicp
ex-1.04.scm
;;;; Structure and Interpretation of Computer Programs Chapter 1 Section 1 Elements of Programming Exercise 1.04 describe the behavior of the following procedure : (define (a-plus-abs-b a b) ((if (> b 0) + -) a b)) Answer : If b is greater than zero , than the result is the sum of a and b. But if b is not ...
null
https://raw.githubusercontent.com/michiakig/sicp/1aa445f00b7895dbfaa29cf6984b825b4e5af492/ch1/ex-1.04.scm
scheme
Structure and Interpretation of Computer Programs Essentially, as the function is named, it adds the absolute value of b to a.
Chapter 1 Section 1 Elements of Programming Exercise 1.04 describe the behavior of the following procedure : (define (a-plus-abs-b a b) ((if (> b 0) + -) a b)) Answer : If b is greater than zero , than the result is the sum of a and b. But if b is not greater than zero , the result is the difference of a a...
cdcd4774929d0e8e6215ab4e1ecfc32a17ce70c727a458fdfce1f030a2ed8f0e
well-typed/large-records
HL080.hs
# LANGUAGE DataKinds # module Common.HListOfSize.HL080 where import Bench.Types import Bench.HList type ExampleFields = '[ 0 T 00 , T 01 , T 02 , T 03 , T 04 , T 05 , T 06 , T 07 , T 08 , T 09 1 , T 10 , T 11 , T 12 , T 13 , T 14 , T 15 , T 16...
null
https://raw.githubusercontent.com/well-typed/large-records/551f265845fbe56346988a6b484dca40ef380609/large-records-benchmarks/bench/experiments/Common/HListOfSize/HL080.hs
haskell
# LANGUAGE DataKinds # module Common.HListOfSize.HL080 where import Bench.Types import Bench.HList type ExampleFields = '[ 0 T 00 , T 01 , T 02 , T 03 , T 04 , T 05 , T 06 , T 07 , T 08 , T 09 1 , T 10 , T 11 , T 12 , T 13 , T 14 , T 15 , T 16...
2cee97428091d9c868c8fb01c4a34be905bef06ac50ef1dd0e51e55cb1938236
kaizhang/Taiji
Types.hs
# LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # module Taiji.Types where import Bio.Data.Bed (BED) import Data.Binary (Binary (..)) import qualified Data.ByteString.Char8 as B import Data.CaseInsensitive (CI, mk, original) import qualified Data.Map.Stri...
null
https://raw.githubusercontent.com/kaizhang/Taiji/f6a050ba0ee6acb6077435566669279455cef350/Taiji/src/Taiji/Types.hs
haskell
| Gene and its regulators
# LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # module Taiji.Types where import Bio.Data.Bed (BED) import Data.Binary (Binary (..)) import qualified Data.ByteString.Char8 as B import Data.CaseInsensitive (CI, mk, original) import qualified Data.Map.Stri...
073d630634501b5cb253be5cad7d1bf84aa646ed23dc2ca6f75fb65e75c88b06
lehins/massiv
Vector.hs
# LANGUAGE ScopedTypeVariables # module Main where import Criterion.Main import Data.Massiv.Array as A import Data.Massiv.Bench.Vector main :: IO () main = do defaultMain [benchV1 (randomV1 :: Vector P Double), benchVxV (randomVxV :: VxV P Double)]
null
https://raw.githubusercontent.com/lehins/massiv/67a920d4403f210d0bfdad1acc4bec208d80a588/massiv-bench/bench/Vector.hs
haskell
# LANGUAGE ScopedTypeVariables # module Main where import Criterion.Main import Data.Massiv.Array as A import Data.Massiv.Bench.Vector main :: IO () main = do defaultMain [benchV1 (randomV1 :: Vector P Double), benchVxV (randomVxV :: VxV P Double)]
ab31efa701a55f210e0e9007b010eec4f5fd011225d9d5f148d8ecb71db376f5
exercism/racket
armstrong-numbers.rkt
#lang racket (provide armstrong-number?) (define (armstrong-number? n) (error "Not implemented yet"))
null
https://raw.githubusercontent.com/exercism/racket/2ec0e750e5e8cde8d07542201e75c90625e222ea/exercises/practice/armstrong-numbers/armstrong-numbers.rkt
racket
#lang racket (provide armstrong-number?) (define (armstrong-number? n) (error "Not implemented yet"))
e7e43a5fb0c138f1a85b957c4688b6463a33d22f9e5a9a94feb2ee90d011a1bd
JustusAdam/language-haskell
T0070.hs
SYNTAX TEST " source.haskell " " Custom operators " data (:-> ) ^^^ storage.type.operator.haskell data ( :=>) a b c = D ^^^ storage.type.operator.haskell ^ ^ ^ variable.other.generic-type.haskell -- ^ constant.other.haskell f :: a :-> b -> c :=> e -- ^^^ storage.type.opera...
null
https://raw.githubusercontent.com/JustusAdam/language-haskell/c9ee1b3ee166c44db9ce350920ba502fcc868245/test/tickets/T0070.hs
haskell
^ constant.other.haskell ^^^ storage.type.operator.infix.haskell ^^ keyword.operator.arrow.haskell ^^^ storage.type.operator.infix.haskell
SYNTAX TEST " source.haskell " " Custom operators " data (:-> ) ^^^ storage.type.operator.haskell data ( :=>) a b c = D ^^^ storage.type.operator.haskell ^ ^ ^ variable.other.generic-type.haskell f :: a :-> b -> c :=> e
7b7e4673524e03c136413e9ef032be8e16be3333917457513cc0083c8365169b
mhwombat/som
SGM2Internal.hs
------------------------------------------------------------------------ -- | -- Module : Data.Datamining.Clustering.SGM2Internal Copyright : ( c ) 2012 - 2022 -- License : BSD-style -- Maintainer : -- Stability : experimental -- Portability : portable -- -- A module containing private @SGM@...
null
https://raw.githubusercontent.com/mhwombat/som/a17222853d2a0541c4fb8a914ce71d9902eddf7b/unused/SGM2Internal.hs
haskell
---------------------------------------------------------------------- | Module : Data.Datamining.Clustering.SGM2Internal License : BSD-style Maintainer : Stability : experimental Portability : portable A module containing private @SGM@ internals. Most developers should use @SGM@ instead. Thi...
Copyright : ( c ) 2012 - 2022 # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # module Data.Datamining.Clustering.SGM2Internal where import Prelude hiding (lookup) import Control.DeepSeq...
4226fe611a6c7c7e6c2f1f53ea32169b5025ebd185918e2a8f3146377e64b014
into-docker/unixsocket-http
data_test.clj
(ns unixsocket-http.data-test (:require [unixsocket-http.client :as client] [unixsocket-http.data :as data] [clojure.test :refer [deftest testing is]])) (def ^:private url ":12345") (def ^:private client {::client/factory (constantly nil) ::client/base-url url}) (deftest t-build-req...
null
https://raw.githubusercontent.com/into-docker/unixsocket-http/09376aa5af4a5af863b156e244b8fa194675e049/test/unixsocket_http/data_test.clj
clojure
(ns unixsocket-http.data-test (:require [unixsocket-http.client :as client] [unixsocket-http.data :as data] [clojure.test :refer [deftest testing is]])) (def ^:private url ":12345") (def ^:private client {::client/factory (constantly nil) ::client/base-url url}) (deftest t-build-req...
4dce55718c71166880349f20a1f59a8a12916ff4498555545638c615264a20e9
input-output-hk/project-icarus-importer
Address.hs
-- | Binary serialization of 'Address' and related types. module Pos.Binary.Core.Address (encodeAddr, encodeAddrCRC32) where import Universum import Codec.CBOR.Encoding (Encoding) import Pos.Binary.Class (Bi (..), encodeCrcProtected) import Pos.Core.Common.Types (Address (..)...
null
https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/core/src/Pos/Binary/Core/Address.hs
haskell
| Binary serialization of 'Address' and related types. -------------------------------------------------------------------------- Helper types serialization -------------------------------------------------------------------------- It's important to keep this function separated from the `encode` definition to avoid...
module Pos.Binary.Core.Address (encodeAddr, encodeAddrCRC32) where import Universum import Codec.CBOR.Encoding (Encoding) import Pos.Binary.Class (Bi (..), encodeCrcProtected) import Pos.Core.Common.Types (Address (..)) Encodes the ` Address ` _ _ without _ _ the CRC32 . ...
93ac948440b904d77d1e624abae0845d2a7d616e2ff8565228d50f234f75dbbf
Bost/corona_cases
lists.clj
( printf " Current - ns [ % s ] loading % s ... \n " * ns * ' ) (ns corona.msg.text.lists (:require [clojure.string :as cstr] [corona.api.cache :as cache] [corona.api.expdev07 :as data] [corona.common :as com] [corona.countries :as ccr] [corona.country-codes :as ccc] [corona.keywords :refer :...
null
https://raw.githubusercontent.com/Bost/corona_cases/b7f62d49b11d9c944e08b3e2e61b978b277e60d1/src/corona/msg/text/lists.clj
clojure
fun is one of: per-1e5, absolute-vals - TODO spec it! see rank - for - case Split the long list of all countries into smaller sub-parts omag - order of magnitude i.e. number of digits listing table sorted-by description; has its own new-line footer omag - order of magnitude i.e. number of digits listing table ...
( printf " Current - ns [ % s ] loading % s ... \n " * ns * ' ) (ns corona.msg.text.lists (:require [clojure.string :as cstr] [corona.api.cache :as cache] [corona.api.expdev07 :as data] [corona.common :as com] [corona.countries :as ccr] [corona.country-codes :as ccc] [corona.keywords :refer :...
3ee44a7b1ca2968e72dd531377301450ec659806a89569b918d23d8c8ad9f732
janestreet/hardcaml_verify
basic_gates.mli
Simple 1 and 2 input boolean logic . Basic consant propogation is perform in the constructor functions . Basic consant propogation is perform in the constructor functions. *) open Base module Uid : Uid.S type t [@@deriving compare, sexp] include Comparable.S with type t := t val optimise_muxs : bool val...
null
https://raw.githubusercontent.com/janestreet/hardcaml_verify/5d4f1622335caa2ec7db67de2adcddb13aa7c855/src/basic_gates.mli
ocaml
* [cofactor ~var p ~f] computes the cofactor of [f] wrt to [var]. [p=vdd] for positive cofactor and [p=gnd] for negative cofactor * boolean difference * universal quantification * existential quantification * [F = xF_x + x'F_x'] * Gate inputs * Visit all nodes in the list of functions and call [f]. Nodes are ...
Simple 1 and 2 input boolean logic . Basic consant propogation is perform in the constructor functions . Basic consant propogation is perform in the constructor functions. *) open Base module Uid : Uid.S type t [@@deriving compare, sexp] include Comparable.S with type t := t val optimise_muxs : bool val...
8dc34ab18cc04bd7b869b2b8ac02e4427b34155f9741bf2e382575e20bea03e1
yoriyuki/Camomile
uLine.ml
(** Line IO *) Copyright ( C ) 2003 . distributed with LGPL (* 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 lat...
null
https://raw.githubusercontent.com/yoriyuki/Camomile/d7d8843c88fae774f513610f8e09a613778e64b3/Camomile/public/uLine.ml
ocaml
* Line IO 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 containing portions ...
Copyright ( C ) 2003 . distributed with LGPL 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 Gener...
48e8241d9ef444171411c04d29c5c6dfb183427221cdfa0902340706b2df7dac
Carnap/Carnap
GenericParsers.hs
# LANGUAGE FlexibleContexts , AllowAmbiguousTypes # module Carnap.Languages.Util.GenericParsers where import Carnap.Core.Data.Types import Carnap.Languages.Util.LanguageClasses import Text.Parsec import Data.Typeable(Typeable) import Data.List (elemIndex) listToTry :: [ParsecT s u m a] -> ParsecT s u m a listToTry (x...
null
https://raw.githubusercontent.com/Carnap/Carnap/0df408cf319dfb7e8be9e605bec4376536de6dba/Carnap/src/Carnap/Languages/Util/GenericParsers.hs
haskell
------------------------------------------------------ Operators ------------------------------------------------------ ------------------------------------------------------ Predicates and Sentences ------------------------------------------------------ partially applied, returning a function these are out of order to...
# LANGUAGE FlexibleContexts , AllowAmbiguousTypes # module Carnap.Languages.Util.GenericParsers where import Carnap.Core.Data.Types import Carnap.Languages.Util.LanguageClasses import Text.Parsec import Data.Typeable(Typeable) import Data.List (elemIndex) listToTry :: [ParsecT s u m a] -> ParsecT s u m a listToTry (x...
e9766465c0adc9ff28fe60c4a66b205e362c1e5b9adbd3513767424ec5f22c1f
onyx-platform/onyx
publisher.clj
(ns onyx.messaging.protocols.publisher (:refer-clojure :exclude [key])) (defprotocol Publisher (info [this]) (equiv-meta [this pub-info]) (start [this]) (stop [this]) (set-short-id! [this new-short-id]) (set-replica-version! [this new-replica-version]) (set-epoch! [this new-epoch]) (set-endpoint-peer...
null
https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/messaging/protocols/publisher.clj
clojure
(ns onyx.messaging.protocols.publisher (:refer-clojure :exclude [key])) (defprotocol Publisher (info [this]) (equiv-meta [this pub-info]) (start [this]) (stop [this]) (set-short-id! [this new-short-id]) (set-replica-version! [this new-replica-version]) (set-epoch! [this new-epoch]) (set-endpoint-peer...
f736e56c88296ebb47f5ab30d9057690524ca12071b62b209f3adf26bbb8a93b
ninenines/cowboy
cowboy_stream_h.erl
Copyright ( c ) 2016 - 2017 , < > %% %% Permission to use, copy, modify, and/or distribute this software for any %% purpose with or without fee is hereby granted, provided that the above %% copyright notice and this permission notice appear in all copies. %% THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC...
null
https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/src/cowboy_stream_h.erl
erlang
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVE...
Copyright ( c ) 2016 - 2017 , < > THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN -module(cowboy_stream_h). -behavior(cowboy_stream). ...
2711f974954618cb1325337795180fcf8168dbb7d0ac0b7e04d802116ac0e779
jakemcc/sicp-study
2_25.clj
Exercise 2.25 ; ; Give the combination of car and ( first and rest ) that will pick 7 from the following ( 1 3 ( 5 7 ) 9 ) (first (rest (first (rest (rest '(1 3 (5 7) 9)))))) ; ( ( 7 ) ) (first (first '((7)))) ; ; ( 1 ( 2 ( 3 ( 4 ( 5 ( 6 7 ) ) ) ) ) ) (first (rest (first (rest (first (r...
null
https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section2.2/2_25.clj
clojure
Exercise 2.25 Give the combination of car and ( first and rest ) that will pick 7 from the following ( 1 3 ( 5 7 ) 9 ) (first (rest (first (rest (rest '(1 3 (5 7) 9)))))) ( ( 7 ) ) (first (first '((7)))) ( 1 ( 2 ( 3 ( 4 ( 5 ( 6 7 ) ) ) ) ) ) (first (rest (first (rest (first (rest ...
559e6220b7fb6cb3f48a8cdf39bca3a7fb96d76eb371dd0237a5a8615c952757
erlscripten/erlscripten
factorial.erl
-module(factorial). -export([factorial/1]). factorial(N) -> factorial(N, 1). factorial(0, Acc) -> Acc; factorial(N, Acc) -> factorial(N - 1, Acc * N).
null
https://raw.githubusercontent.com/erlscripten/erlscripten/6b70be39dc51c21388dd7bae1eb46a0d306ecdcc/examples/factorial.erl
erlang
-module(factorial). -export([factorial/1]). factorial(N) -> factorial(N, 1). factorial(0, Acc) -> Acc; factorial(N, Acc) -> factorial(N - 1, Acc * N).
5f1b64ca2ce43eb983ba1c26d5c9eb40596fb30ec91dbcfe2943cbe3c65c75e1
evolutics/haskell-formatter
Configuration.hs
{-| Description : Overall configuration -} module Language.Haskell.Formatter.Configuration (Configuration, configurationStyle, configurationStreamName, defaultConfiguration, check) where import qualified Language.Haskell.Formatter.Result as Result import qualified Language.Haskell.Formatter.Source...
null
https://raw.githubusercontent.com/evolutics/haskell-formatter/3919428e312db62b305de4dd1c84887e6cfa9478/src/library/Language/Haskell/Formatter/Configuration.hs
haskell
| Description : Overall configuration
module Language.Haskell.Formatter.Configuration (Configuration, configurationStyle, configurationStreamName, defaultConfiguration, check) where import qualified Language.Haskell.Formatter.Result as Result import qualified Language.Haskell.Formatter.Source as Source import qualified Language.Haskel...
13c3de564b1f0ac2c262e6ef4c71d2a836ec0d799659685de292de4ca8a75d31
kupl/FixML
sub41.ml
type exp = | V of var | P of var * exp | C of exp * exp and var = string let rec comparelist : 'a list -> 'a list -> 'a list = fun procdata vardata -> match (procdata, vardata) with (_,[]) -> [] | (hd1::tl1, hd2::tl2) -> if hd1 = hd2 then comparelist procdata tl2 else (comparelist [hd1] tl2)@...
null
https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/wellformedness/wellformedness/submissions/sub41.ml
ocaml
type exp = | V of var | P of var * exp | C of exp * exp and var = string let rec comparelist : 'a list -> 'a list -> 'a list = fun procdata vardata -> match (procdata, vardata) with (_,[]) -> [] | (hd1::tl1, hd2::tl2) -> if hd1 = hd2 then comparelist procdata tl2 else (comparelist [hd1] tl2)@...
070c67f4dfc5d5bc77e015cabe8adae1f9605b271d2420d6d9d66a5dc45e6d8b
skanev/playground
48.scm
SICP exercise 4.48 ; ; Extend the grammar given above to handle more complex sentences. For ; example, you could extend noun phrases and verb phrases to include ; adjectives and adverbs, or you could handle compound sentences. (require r5rs/init) ; Since this isn't very interesting, we only introducing adjectives a...
null
https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/04/48.scm
scheme
Extend the grammar given above to handle more complex sentences. For example, you could extend noun phrases and verb phrases to include adjectives and adverbs, or you could handle compound sentences. Since this isn't very interesting, we only introducing adjectives and adverbs. A noun phrase is [article adjective...
SICP exercise 4.48 (require r5rs/init) (define solution '((define nouns '(noun student professor cat class)) (define verbs '(verb studies lectures eats sleeps)) (define adjectives '(adjective brown fast quick sharp)) (define adverbs '(adverb solemnly quietly loudly silently)) (define articles '(a...
394db3c2c25445feaf696aab49c1fee9617078e91f67e34fb430d5b3894aaafa
bvaugon/ocapic
simul.mli
(*************************************************************************) (* *) (* OCaPIC *) (* *) ...
null
https://raw.githubusercontent.com/bvaugon/ocapic/a14cd9ec3f5022aeb5fe2264d595d7e8f1ddf58a/lib/extra/simul.mli
ocaml
*********************************************************************** OCaPIC ...
This file is distributed under the terms of the CeCILL license . * Tool to write OCaPIC simulator plug - in in OCaml This library can be used to write plug - in for the OCaPIC simulator . Like some graphical interface libraries , this...
61079a6bcdc5cb22bccd49e1ee561a44d5e75131368ea5373d68f468084ee712
Johni0702/guile-language-server
emacs.scm
Copyright ( C ) 2018 < > ;;;; ;;;; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or ;;;; (at your option) any later version. ;;;; ;;;; This program is dis...
null
https://raw.githubusercontent.com/Johni0702/guile-language-server/db134354e20720f1c198e213b340e90dcec710e0/language-server/emacs.scm
scheme
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 General Public...
Copyright ( C ) 2018 < > 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 (define-module (language-server emacs) #:use-module (srfi srfi-1) #:use-modu...
1d91347d4c665a3518d084033d7045a30b595c46c823c8bbb3560c6dabc890be
rtoy/cmucl
vm.lisp
;;; -*- Package: alpha -*- ;;; ;;; ********************************************************************** This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . ;;; (ext:file-comment "$Header: src/compiler/alpha/vm.lisp $") ;;; ;;; *...
null
https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/alpha/vm.lisp
lisp
-*- Package: alpha -*- ********************************************************************** ********************************************************************** This file contains the VM definition for the Alpha. Define the registers eval-when (compile eval) eval-when (compile load eval) Ra Arg 0-5 ...
This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . (ext:file-comment "$Header: src/compiler/alpha/vm.lisp $") Written by . Alpha conversion by . (in-package "ALPHA") (eval-when (compile eval) (defmacro defreg (name ...
7449fe2ca0e635ccc88bfa465aeb2fbdc54ff8e7c12ba767062b115a8473d8d6
avsm/ocaml-ssh
server.ml
* Copyright ( c ) 2004 < > * Copyright ( c ) 2004 Anil Madhavapeddy < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * ...
null
https://raw.githubusercontent.com/avsm/ocaml-ssh/26577d1501e7a43e4b520239b08da114c542eda4/server/server.ml
ocaml
The signature for a 'server function' A 'handler' (a style of dispatch) matches this signature handler which fork()s to serve every request The son exits, the grandson works Reclaim the son Return a socket bound to the supplied address and a specific request handler and it does the rest.
* Copyright ( c ) 2004 < > * Copyright ( c ) 2004 Anil Madhavapeddy < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * ...
c0e003588a838f1aa4c0eb88edfc0be5ed475d0e8bb09eeabe19787e5e3fe0e1
gedge-platform/gedge-platform
rabbit_net.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 - 2021 VMware , Inc. or its affiliates . All rights reserved . %% -module(rabbit_net). -include("rabbit.hrl"). -in...
null
https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbit_common/src/rabbit_net.erl
erlang
--------------------------------------------------------------------------- -type host_or_ip() :: binary() | inet:ip_address(). 'inbound' | 'outbound') -> ok_val_or_error({host_or_ip(), ip_port(), host_or_ip(), ip_port()}). -----------------------------------...
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 - 2021 VMware , Inc. or its affiliates . All rights reserved . -module(rabbit_net). -include("rabbit.hrl"). -include_...
4a60fedf16bf1c6c9c3d6067b60caa7d1eb3600aa8ac7782e112e6a11335d500
aspiwack/peppermint-prover
Spec.hs
module Main where import Data.Maybe import Control.Tactic (Tactic) import qualified Control.Tactic as Tactic import Test.Hspec import Control.Applicative -- A convoluted definition of the true proposition data Prop = T | Prop `And` Prop deriving (Eq, Show) newtype Thm = Proved Prop deriving (Show) check :: ...
null
https://raw.githubusercontent.com/aspiwack/peppermint-prover/203dbabcc6392a869fca7ae71320cac1a62ecc05/lensy-f/examples/Spec.hs
haskell
A convoluted definition of the true proposition
module Main where import Data.Maybe import Control.Tactic (Tactic) import qualified Control.Tactic as Tactic import Test.Hspec import Control.Applicative data Prop = T | Prop `And` Prop deriving (Eq, Show) newtype Thm = Proved Prop deriving (Show) check :: Prop -> Maybe Thm -> Bool check goal (Just (Proved ...
d8959299d22a61b2a7f962573580179b602b654543d9f4157b311b1a3b04b2f6
Average-user/gozar
events.cljs
(ns gozar.events (:require [re-frame.core :as re-frame] [gozar.db :as db] [gozar.util :as u])) (re-frame/reg-event-db :initialize-db (fn [_ _] db/default-db)) (re-frame/reg-event-db :analyze-mode-change (fn [db _] (if (:analyze-mode db) (-> db (assoc :analyze-mode fal...
null
https://raw.githubusercontent.com/Average-user/gozar/102a184bfb41f44a5ee1bc2aa03a63d72290592e/src/cljs/gozar/events.cljs
clojure
(ns gozar.events (:require [re-frame.core :as re-frame] [gozar.db :as db] [gozar.util :as u])) (re-frame/reg-event-db :initialize-db (fn [_ _] db/default-db)) (re-frame/reg-event-db :analyze-mode-change (fn [db _] (if (:analyze-mode db) (-> db (assoc :analyze-mode fal...
9a1f94072f8ab1d7cad715468164487fae5c5eedaca62a97146a7c9e1d471617
ssm-lang/sslang
Token.hs
# LANGUAGE NamedFieldPuns # | Sslang source code tokens . module Front.Token where import Common.Identifiers import Common.Pretty -- | Tokens extracted from source text. newtype Token = Token (Span, TokenType) deriving (Show, Eq) | Extract the ' TokenType ' from a ' Token ' . tokenType :: Token -> TokenType...
null
https://raw.githubusercontent.com/ssm-lang/sslang/d23597773d471fb222890e31a984d54289b45d28/src/Front/Token.hs
haskell
| Tokens extracted from source text. | The location of a token in the source text. | 'Pretty' instance for 'Span'. Reports both line:col and [addr+len]. | Pretty print a list of tokens.
# LANGUAGE NamedFieldPuns # | Sslang source code tokens . module Front.Token where import Common.Identifiers import Common.Pretty newtype Token = Token (Span, TokenType) deriving (Show, Eq) | Extract the ' TokenType ' from a ' Token ' . tokenType :: Token -> TokenType tokenType (Token (_, t)) = t data Spa...
a20ba9e8e2efb3768e7c214098f34bece66df33b7145d8e2a8af2dd36478c451
pingles/clj-kafka
producer.clj
(ns clj-kafka.test.producer (:use [expectations] [clj-kafka.producer]) (:import [kafka.producer KeyedMessage])) (expect KeyedMessage (message "topic" "value"))
null
https://raw.githubusercontent.com/pingles/clj-kafka/321f2d6a90a2860f4440431aa835de86a72e126d/test/clj_kafka/test/producer.clj
clojure
(ns clj-kafka.test.producer (:use [expectations] [clj-kafka.producer]) (:import [kafka.producer KeyedMessage])) (expect KeyedMessage (message "topic" "value"))
e92ccd26032e5432f3e61d079fb58d83c2da2f42f2d2a6de907f2d6cb25b2e7f
input-output-hk/ouroboros-network
Serialisation.hs
-- | Serialisation support for the HFC module Ouroboros.Consensus.HardFork.Combinator.Serialisation (module X) where import Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common as X (EraNodeToClientVersion (..), EraNodeToNodeVersion (..), HardForkNodeToClient...
null
https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/Serialisation.hs
haskell
| Serialisation support for the HFC
module Ouroboros.Consensus.HardFork.Combinator.Serialisation (module X) where import Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common as X (EraNodeToClientVersion (..), EraNodeToNodeVersion (..), HardForkNodeToClientVersion (..), Hard...
084983d197fadef5e2cf7e1ee1d2ba08abcbc6805e8301faea6a02f3f2218b40
tek/chiasma
TmuxQuery.hs
module Chiasma.Data.TmuxQuery where newtype TmuxQuery = TmuxQuery { unTmuxQuery :: Text } deriving stock (Eq, Show, Generic) deriving newtype (IsString, Semigroup, Monoid)
null
https://raw.githubusercontent.com/tek/chiasma/51751e19a416a9afe12f7797df8a67990b266240/packages/chiasma/lib/Chiasma/Data/TmuxQuery.hs
haskell
module Chiasma.Data.TmuxQuery where newtype TmuxQuery = TmuxQuery { unTmuxQuery :: Text } deriving stock (Eq, Show, Generic) deriving newtype (IsString, Semigroup, Monoid)
b793469b82eb187788ae40e2437d028bc6cf47af8f466aa5baaea6ef4f7411ae
smallhadroncollider/taskell
Due.hs
module Taskell.Events.State.Modal.Due ( showDue , clearDate , previous , next , goto ) where import ClassyPrelude import Control.Lens ((&), (.~), (^.)) import Data.Sequence ((!?)) import qualified Taskell.Data.Lists as L (clearDue, due) import Taskell.Data.Seq ...
null
https://raw.githubusercontent.com/smallhadroncollider/taskell/3c731476e9a58ede300cfa83aba412509b132a3e/src/Taskell/Events/State/Modal/Due.hs
haskell
module Taskell.Events.State.Modal.Due ( showDue , clearDate , previous , next , goto ) where import ClassyPrelude import Control.Lens ((&), (.~), (^.)) import Data.Sequence ((!?)) import qualified Taskell.Data.Lists as L (clearDue, due) import Taskell.Data.Seq ...
4558809ed63642cfdb7b318ade1b5e2a5f157d5f5b87015412658648bee95599
ckirkendall/kioo
reagent.clj
(ns kioo.reagent (:require [kioo.core :refer [component* get-react-sym emit-node wrap-fragment snippet*]] [kioo.util :refer [convert-attrs]] [net.cgrand.enlive-html :refer [any-node]])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This s...
null
https://raw.githubusercontent.com/ckirkendall/kioo/970d029ca0ab813a916c77286bcb7cf33a005e3c/src/kioo/reagent.clj
clojure
This support for reagent
(ns kioo.reagent (:require [kioo.core :refer [component* get-react-sym emit-node wrap-fragment snippet*]] [kioo.util :refer [convert-attrs]] [net.cgrand.enlive-html :refer [any-node]])) (defn emit-trans [node children] `((kioo.co...
cdc0f6c20c3336b0da948aa3676193814fe87cd0699b488cd934e4f688b84b77
lem-project/lem
main.lisp
(defpackage :lem-modeline-battery (:use :cl :lem) (:export :enable :disable)) (in-package :lem-modeline-battery) (defvar *last-time* nil) (defvar *cache-values* nil) (defvar *interval-second* 10) (defun update-cache-p () (let ((time (get-universal-time))) (when (or (null *last-time*) ...
null
https://raw.githubusercontent.com/lem-project/lem/3e7acafec74c2bb416b6e69cedd417553426c4af/contrib/modeline-battery/main.lisp
lisp
(defpackage :lem-modeline-battery (:use :cl :lem) (:export :enable :disable)) (in-package :lem-modeline-battery) (defvar *last-time* nil) (defvar *cache-values* nil) (defvar *interval-second* 10) (defun update-cache-p () (let ((time (get-universal-time))) (when (or (null *last-time*) ...
dbe3ca9c91bfcbfa5958ef6a39b3163ad5b69e25aed9494de0e239bca915d682
lazy-cat-io/metaverse
initializer.cljs
(ns metaverse.renderer.pages.initializer) (defn page [] [:h1 "Initializer"])
null
https://raw.githubusercontent.com/lazy-cat-io/metaverse/3f61868d7af4b8375d63208f6b2cc968fbf66d1c/src/main/clojure/metaverse/renderer/pages/initializer.cljs
clojure
(ns metaverse.renderer.pages.initializer) (defn page [] [:h1 "Initializer"])
15a3562137280a4501150543995ee326f6791dc86e2982e51073e1b871054555
mankyKitty/fantastic-waddle
Api.hs
module Common.Api where commonStuff :: String commonStuff = "here is a common string"
null
https://raw.githubusercontent.com/mankyKitty/fantastic-waddle/680ca473bf7141c63528195ae23cb799b2fb0eac/common/src/Common/Api.hs
haskell
module Common.Api where commonStuff :: String commonStuff = "here is a common string"
1eed195a45727a139c479536d9a534c9d13beb550b81da08a91066995ac0a99f
armstnp/advent-of-code-2019
day24.clj
Set NS before starting : C - c M - n n (ns advent-of-code-2019.day24 (:require [advent-of-code-2019.core :as core] [advent-of-code-2019.left-shark :as ls] [clojure.string :as str] [clojure.math.combinatorics :as combo] [is-prime.core :refer [is-prime]])) (: import ...
null
https://raw.githubusercontent.com/armstnp/advent-of-code-2019/68e21174394d8b0e14433f9f249e995c10ac6d67/src/advent_of_code_2019/day24.clj
clojure
Fill in parse components here
Set NS before starting : C - c M - n n (ns advent-of-code-2019.day24 (:require [advent-of-code-2019.core :as core] [advent-of-code-2019.left-shark :as ls] [clojure.string :as str] [clojure.math.combinatorics :as combo] [is-prime.core :refer [is-prime]])) (: import ...
846f10bd0e7aea76fadd33e9117e28a735d82723afa5aaf7024b897dfa6326a0
brendanhay/terrafomo
Resources.hs
-- This module is auto-generated. # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # -- | Module : . GitHub . Resources Copyright : ( c ) 2017 - 2018 License :...
null
https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-github/gen/Terrafomo/GitHub/Resources.hs
haskell
This module is auto-generated. | Stability : auto-generated * github_branch_protection * github_issue_label * github_membership * github_organization_project * github_organization_webhook * github_project_column * github_repository_collaborator * github_repository_deploy_key * github_repository_project ...
# LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # Module : . GitHub . Resources Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Ma...
1813bdb9d23f0e1de71b72f9328b019d680aeff611ea6242e2545bdffabdcbce
mmzeeman/breaky
breaky_test.erl
%% Some tests -module(breaky_test). -include_lib("eunit/include/eunit.hrl"). setup() -> application:start(breaky). teardown(_) -> application:stop(breaky). application_start_stop_test() -> ?assertEqual(ok, setup()), ?assertEqual(ok, teardown([])). breaky_test_() -> {foreach, local, fun setup/0...
null
https://raw.githubusercontent.com/mmzeeman/breaky/065a3c92bb3dff0facfb2655b50d3341a1f006e3/test/breaky_test.erl
erlang
Some tests started yet. Stop it. Kill the process. Give it some time to restart. Check if the process was restarted. Anyhow the circuit breaker is now in off state no pid
-module(breaky_test). -include_lib("eunit/include/eunit.hrl"). setup() -> application:start(breaky). teardown(_) -> application:stop(breaky). application_start_stop_test() -> ?assertEqual(ok, setup()), ?assertEqual(ok, teardown([])). breaky_test_() -> {foreach, local, fun setup/0, fun teardown...
f72ee01a0574f84fd2fd0c4d5173e40d7581f5ecadd661574b8e0bedc69726d6
grin-compiler/ghc-wpc-sample-programs
Plain.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} module Tests.Writers.Plain (tests) where import Prelude import Test.Tasty import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder infix 4 =: (=:) :: (ToString a, ToPandoc a) => String -> (a, String) -> T...
null
https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/test/Tests/Writers/Plain.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # module Tests.Writers.Plain (tests) where import Prelude import Test.Tasty import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder infix 4 =: (=:) :: (ToString a, ToPandoc a) => String -> (a, String) -> TestTree (=:) = test (purely (writeP...
0e4a0d84f5208587add8ad5632f6f783cad724e8bbc2a9f0904915660a8f8898
MLstate/opalang
mongo.mli
(* OP codes *) val _OP_REPLY : int val _OP_MSG : int val _OP_UPDATE : int val _OP_INSERT : int val _RESERVED : int val _OP_QUERY : int val _OP_GET_MORE : int val _OP_DELETE : int val _OP_KILL_CURSORS : int (* OP_INSERT *) val _ContinueOnError : int (* OP_UPDATE *) val _Upsert : int val _MultiUpdate : int OP_QUERY...
null
https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/ocamllib/libbase/mongo.mli
ocaml
OP codes OP_INSERT OP_UPDATE OP_DELETE OP_REPLY
val _OP_REPLY : int val _OP_MSG : int val _OP_UPDATE : int val _OP_INSERT : int val _RESERVED : int val _OP_QUERY : int val _OP_GET_MORE : int val _OP_DELETE : int val _OP_KILL_CURSORS : int val _ContinueOnError : int val _Upsert : int val _MultiUpdate : int OP_QUERY val _TailableCursor : int val _SlaveOk : int v...
37d1d121c550517ec4e28fa743d83f5af972d8f4aa419905ef6456bd90a526f6
BinaryAnalysisPlatform/bap
bap_core_theory_parser.ml
open Core_kernel[@@warning "-D"] open Bap_knowledge open Bap_core_theory_definition open Bap_core_theory_value module Value = Knowledge.Value module Grammar = Bap_core_theory_grammar_definition module Program = Bap_core_theory_program module Label = Program.Label module IEEE754 = Bap_core_theory_IEEE754 open Knowledg...
null
https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/bap_core_theory/bap_core_theory_parser.ml
ocaml
open Core_kernel[@@warning "-D"] open Bap_knowledge open Bap_core_theory_definition open Bap_core_theory_value module Value = Knowledge.Value module Grammar = Bap_core_theory_grammar_definition module Program = Bap_core_theory_program module Label = Program.Label module IEEE754 = Bap_core_theory_IEEE754 open Knowledg...
d9f3b33bb6258c9ce34a72df8e558028e4ec7e91ad62d0c6bfed2465dcadf450
amw-zero/sligh
codegen.ml
open Core let print_list delim l = String.concat delim l let string_of_generic_type n = match n with | "Set" -> "Array" | _ -> failwith (Printf.sprintf "Unknown generic type mapping: %s" n) let rec string_of_type t = match t with | STInt -> "number" | STCustom s -> s | STString -> "string" | STDecimal -...
null
https://raw.githubusercontent.com/amw-zero/sligh/a6c38a263a4593ecbecd64a0d20325d1c4a90dc5/lib/codegen.ml
ocaml
This is a little more complicated than necessary because state variables are compiled to member variables and there's no way to know if an identifier is a state variable without referencing the lsit of process variabless. Separating concrete from abstract syntax would improve this. More hassle than ne...
open Core let print_list delim l = String.concat delim l let string_of_generic_type n = match n with | "Set" -> "Array" | _ -> failwith (Printf.sprintf "Unknown generic type mapping: %s" n) let rec string_of_type t = match t with | STInt -> "number" | STCustom s -> s | STString -> "string" | STDecimal -...
5c6ece1d0860217868766324f25b5d5da9f1c50368fb78a1be0c5ed6cebc06fa
binsec/haunted
disasm_core.mli
(**************************************************************************) This file is part of BINSEC . (* *) Copyright ( C ) 2016 - 2019 CEA ( Co...
null
https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/disasm/disasm_core.mli
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...
789d3db7cc06f903ee4fac27b6ebe94f5ba726c6ab8a0f9eeabaa387544c83b8
vernemq/vernemq_dev
on_client_gone_hook.erl
%% @hidden -module(on_client_gone_hook). -include("vernemq_dev.hrl"). %% called as an 'all'-hook, return value is ignored -callback on_client_gone(SubscriberId :: subscriber_id()) -> any().
null
https://raw.githubusercontent.com/vernemq/vernemq_dev/6d622aa8c901ae7777433aef2bd049e380c474a6/src/on_client_gone_hook.erl
erlang
@hidden called as an 'all'-hook, return value is ignored
-module(on_client_gone_hook). -include("vernemq_dev.hrl"). -callback on_client_gone(SubscriberId :: subscriber_id()) -> any().
ad4c0c8d5024b663c009a12a3152cb68d16690c079ccd13da5ec66883f5b7de5
Elzair/nazghul
naz.scm
;; init.scm -- contains lots of common scheme utilities (load "lib/init.scm") ;; Result codes (these belong here because they are tied to kernel values, see ;; result.h) (define result-ok 0) (define result-no-target 1) (define result-no-effect 2) (define result-no-hostiles 3) (define result-lacks-skill 4...
null
https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/template/lib/naz.scm
scheme
init.scm -- contains lots of common scheme utilities Result codes (these belong here because they are tied to kernel values, see result.h) Test if a result code indicates that the action was not completed Override the default error hook to warn the loader when the interpreter encounters any errors during evaluati...
(load "lib/init.scm") (define result-ok 0) (define result-no-target 1) (define result-no-effect 2) (define result-no-hostiles 3) (define result-lacks-skill 4) (define result-failed 5) (define result-not-here 6) (define (abortive-result? result) (or (eq? result result-no-target) (eq? resu...
f941a82d462e1af8665bff7f21dbc7637ba14ead1099644863309b0ac6438c29
shortishly/pgec
common.erl
Copyright ( c ) 2022 < > %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless required by applicable law or agreed to in writing, software distributed under...
null
https://raw.githubusercontent.com/shortishly/pgec/92ee82cc20c89ea2ff19d2becb4bb6db747db48a/test/common.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissi...
Copyright ( c ) 2022 < > Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(common). -export([all/1]). -export([purge_applications/0]). -include_lib("common_test/include/ct.hrl"). is_a_test(is_a_test) -> f...
b37682001d57425ac4ccb93f156e551a6edf43fc0aa1e9c3f0948faf4a314ab9
haskus/haskus-system
PixelFormat.hs
# LANGUAGE DataKinds # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE TypeApplications # -- | Pixel formats module Haskus.System.Linux.Graphics.PixelFormat ( PixelFormat (..) , makePixelFormat , Format(..) , Endianness(..) , formatEndianness , formatFormat , formatBitDepth ) where import H...
null
https://raw.githubusercontent.com/haskus/haskus-system/38b3a363c26bc4d82e3493d8638d46bc35678616/haskus-system/src/lib/Haskus/System/Linux/Graphics/PixelFormat.hs
haskell
| Pixel formats ============================================================= ============================================================= | Create a pixel format | Get pixel format endianness | Get pixel format logical format | Convert a format string (as in the original .h file) into a code | Bit-depth per p...
# LANGUAGE DataKinds # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE TypeApplications # module Haskus.System.Linux.Graphics.PixelFormat ( PixelFormat (..) , makePixelFormat , Format(..) , Endianness(..) , formatEndianness , formatFormat , formatBitDepth ) where import Haskus.Binary.Endian...
068cd1b190b8e0f648b46084b79d041c9f0230c9af5405807d5b1e192bb86897
colis-anr/morbig
scripts.mli
(**************************************************************************) (* -*- tuareg -*- *) (* *) Copyright ( C ) 2017 - 2021 , , . ...
null
https://raw.githubusercontent.com/colis-anr/morbig/77c2ca402785979c4af351b412fe7be2d521838f/src/scripts.mli
ocaml
************************************************************************ -*- tuareg -*- This is free software: you...
Copyright ( C ) 2017 - 2021 , , . under the terms of the GNU General Public License , version 3 . val is_other_script: string -> bool * [ is_elf s ] returns [ true ] when the file with name [ s ] starts with the magic nu...
587ca9b419b7fdb1532d33e02e98679e258d200187d86f919e8efd52e5e70e23
caiorss/Functional-Programming
canfail.hs
Why Do Monads Matter ? - London Haskell Group Why Do Monads Matter? - London Haskell Group -} divby :: Integral a => a -> a -> a divby x y = div y x main = do print $ divby 2 . divby 5 $ 2310 print $ divby 3 . divby 7 $ 2310 print $ divby 5 . divby 1...
null
https://raw.githubusercontent.com/caiorss/Functional-Programming/ef3526898e3014e9c99bf495033ff36a4530503d/codes/canfail.hs
haskell
divbysafe :: Integral a => a -> a -> Err a *Main> divbysafe 0 10 Error *Main> divbysafe 9 10 OK 1 *Main> divbysafe 8 10 OK 1 *Main> *Main> divbysafe 2 `composeErr` divbysafe 5 $ 10 OK 1 *Main> divbysafe 2 `composeErr` divbysafe 0 $ 10 Error *Main> divbysafe ...
Why Do Monads Matter ? - London Haskell Group Why Do Monads Matter? - London Haskell Group -} divby :: Integral a => a -> a -> a divby x y = div y x main = do print $ divby 2 . divby 5 $ 2310 print $ divby 3 . divby 7 $ 2310 print $ divby 5 . divby 1...
c6b518a71e79dcde11fe145b7f4ca70afdea816517a0f9c00003ef8b91e433b9
quickdocs/quickdocs-api
dists.lisp
(defpackage #:quickdocs-api/controllers/dists (:use #:cl #:utopian) (:import-from #:quickdocs-api/views/dist #:show) (:import-from #:quickdocs-api/models #:dist #:dist-updated-projects) (:import-from #:assoc-utils #:aget) (:export #:show)...
null
https://raw.githubusercontent.com/quickdocs/quickdocs-api/11171822f2ff3bbc3a89399901844f4671c09b5b/controllers/dists.lisp
lisp
(defpackage #:quickdocs-api/controllers/dists (:use #:cl #:utopian) (:import-from #:quickdocs-api/views/dist #:show) (:import-from #:quickdocs-api/models #:dist #:dist-updated-projects) (:import-from #:assoc-utils #:aget) (:export #:show)...
3f0a6bfcce863af95e4e54a7949d37e941d7e9a5da2631e7ebcdf4fa9c7dec92
logicshan/pj-lester-book
Template1.hs
module Template1 where import Language import Utils runProg :: [Char] -> [Char] compile :: CoreProgram -> TiState eval :: TiState -> [TiState] showResults :: [TiState] -> [Char] runProg = showResults . eval . compile . parse compile program = (initial_stack, initialTiDump, initial_heap, globals, tiStatInitial) wh...
null
https://raw.githubusercontent.com/logicshan/pj-lester-book/2ddb3fadc35800582002dd34be351980df2dec65/Template1.hs
haskell
component is used to accumulate statistics. The spine stack is just a stack of heap addresses. Application Supercombinator A number Body of supercombinator Association of names to addresses address of root of instance
module Template1 where import Language import Utils runProg :: [Char] -> [Char] compile :: CoreProgram -> TiState eval :: TiState -> [TiState] showResults :: [TiState] -> [Char] runProg = showResults . eval . compile . parse compile program = (initial_stack, initialTiDump, initial_heap, globals, tiStatInitial) wh...
838ae696b033f7fce2ec1e564214de5761985c2fab6f7ca2a726fb7ad13d0996
PacktPublishing/Mastering-Clojure
read_and_eval.clj
(ns m-clj.c4.read-and-eval) ;; user> (read (-> "(list 1 2 3)" ;; .toCharArray ;; java.io.CharArrayReader. ;; java.io.PushbackReader.)) ;; (list 1 2 3) ;; user> (read-string "(list 1 2 3)") ;; (list 1 2 3) ;; user> (eval '(list 1 2 3)) ;; (1 2 3) ;; user> (eval (list + ...
null
https://raw.githubusercontent.com/PacktPublishing/Mastering-Clojure/5364ad907056c1c84c759491b17d45d06f4d7cdc/src/m_clj/c4/read_and_eval.clj
clojure
user> (read (-> "(list 1 2 3)" .toCharArray java.io.CharArrayReader. java.io.PushbackReader.)) (list 1 2 3) user> (read-string "(list 1 2 3)") (list 1 2 3) user> (eval '(list 1 2 3)) (1 2 3) user> (eval (list + 1 2 3)) user> (eval (read-string "(+ 1 2 3)")) ...
(ns m-clj.c4.read-and-eval) 6 6 user > ( read ( - > " # =( list 1 2 3 ) " user > ( read - string " # =( list 1 2 3 ) " ) 6 6 ( read - string ( read - string " # =( list 1 2 3 ) " ) ) ) RuntimeException EvalReader not allowed when * read - eval * is false . clojure.lang . Util.runtimeExce...
ffca03b10fa5feb589fa825186a8835f784ce8ac00fd7546cce563bf83148e61
TrustInSoft/tis-interpreter
collection.mli
Modified by TrustInSoft (**************************************************************************) (* *) This file is part of WP plug - in of Frama - C. (* ...
null
https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/wp/qed/src/collection.mli
ocaml
************************************************************************ alternatives) ...
Modified by TrustInSoft This file is part of WP plug - in of Frama - C. Copyright ( C ) 2007 - 2015 CEA ( Commissariat a l'energie atomique et aux energies Lesser General Public License as published by the Free Soft...
8716cb1e4f3428f94a8387ce2740942c2b3052e333cb67f9895c109e7465a85f
sashashakun/SICP
test.rkt
#lang racket/base (require rackunit "solution.rkt") (check-equal? (solution 1 2 3) 13) (check-equal? (solution 5 7 2) 74) (check-equal? (solution 5 4 3) 41)
null
https://raw.githubusercontent.com/sashashakun/SICP/2b5f15fa7c0ff5b0f31272eb100c691b5a4703fc/src/chapter1/1.3/test.rkt
racket
#lang racket/base (require rackunit "solution.rkt") (check-equal? (solution 1 2 3) 13) (check-equal? (solution 5 7 2) 74) (check-equal? (solution 5 4 3) 41)
02abe4baaa70a11ba75a45f8029e1c8109fb39e44a1f31deb031abe886fb5a40
vult-dsp/vult
wavFile.ml
The MIT License ( MIT ) Copyright ( c ) 2017 Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights ...
null
https://raw.githubusercontent.com/vult-dsp/vult/860b2b7a8e891aa729578175a931ce2a9345428b/src/util/wavFile.ml
ocaml
* Returns a character from the buffer and increases the index * Returns a character (as integer) from the buffer * Used to shift and combine characters into integers * Moves chunk by chunk until it finds the "data" chunk * Reads the given number of samples into the data arrays iterates reading the channels iter...
The MIT License ( MIT ) Copyright ( c ) 2017 Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without restriction , including without limitation the rights ...
00a6d8f50896244e0eac8baeaf0184f793466a95bd21098246c6c818880ebe87
bluddy/rails
track_graph.ml
open Containers let src = Logs.Src.create "track_graph" ~doc:"The track graph" module Log = (val Logs.src_log src: Logs.LOG) (* Graph for intersections and stations *) (* NOTE: must be per player! *) module Edge = struct type xy_dir = (int * int * Dir.t) [@@ deriving yojson] type t = { id: int; nodes...
null
https://raw.githubusercontent.com/bluddy/rails/20e753887bc6db4b4bd087a1b78584f5b53b45ad/bin/backend/track_graph.ml
ocaml
Graph for intersections and stations NOTE: must be per player! Either node can match Find the edge we want Follow an ixn in a given dir Clear block
open Containers let src = Logs.Src.create "track_graph" ~doc:"The track graph" module Log = (val Logs.src_log src: Logs.LOG) module Edge = struct type xy_dir = (int * int * Dir.t) [@@ deriving yojson] type t = { id: int; nodes: xy_dir * xy_dir; dist: int; mutable block: bool; } [@@ deriving...
fee86d0ac93ad79ece468b231e24618e74719dc13f351e32882fc0b03cd2dd85
FieryCod/holy-lambda
response_test.clj
(ns fierycod.holy-lambda.response-test (:require [clojure.test :as t] [fierycod.holy-lambda.response :as r])) (t/deftest response-utils-test (t/testing "bad-request should return valid response" (t/is (= {:statusCode 400, :headers {}, :body {}} (r/bad-request {}))) (t/is (= {:statusCode ...
null
https://raw.githubusercontent.com/FieryCod/holy-lambda/5a67b3dfb3d9f8d1ca462c86ada3c0f89d3f3541/test/fierycod/holy_lambda/response_test.clj
clojure
(ns fierycod.holy-lambda.response-test (:require [clojure.test :as t] [fierycod.holy-lambda.response :as r])) (t/deftest response-utils-test (t/testing "bad-request should return valid response" (t/is (= {:statusCode 400, :headers {}, :body {}} (r/bad-request {}))) (t/is (= {:statusCode ...
2d755792ea0630ce20bf775ee744085084c1d58f6d1cbe8905025e18e8f1a17e
clojure-interop/java-jdk
DefaultEditorKit$InsertContentAction.clj
(ns javax.swing.text.DefaultEditorKit$InsertContentAction "Places content into the associated document. If there is a selection, it is removed before the new content is added. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is ...
null
https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.swing/src/javax/swing/text/DefaultEditorKit%24InsertContentAction.clj
clojure
(ns javax.swing.text.DefaultEditorKit$InsertContentAction "Places content into the associated document. If there is a selection, it is removed before the new content is added. Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is ...
cb1a00758e332fa04b53c73b2cb3829f59e049d0de66796ce3c446431a8aec5d
martintrojer/frinj
infix.clj
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; File : infix.clj ;; Function : Infix Math library ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright ( c ) 2008 , ;; All rights reserved. ;; ;; Redistribution and use in source and binary form...
null
https://raw.githubusercontent.com/martintrojer/frinj/e588c8e022f13a59e529c19bc78657a4284d4e72/src/frinj/infix.clj
clojure
File : infix.clj Function : Infix Math library 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...
Copyright ( c ) 2008 , THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ` ` AS IS '' AND ANY DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABIL...
2e294e86e2245eb49535c7e01f71be409beca73247e53f6ad39dd38d78cd28f2
nasa/ogma
Extra.hs
Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved . -- -- Disclaimers -- No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTORY , IN...
null
https://raw.githubusercontent.com/nasa/ogma/825129e4133ac6c2c506676a3f197a14a35dc3e2/ogma-extra/src/System/Directory/Extra.hs
haskell
Disclaimers SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR GOVERNM...
Copyright 2020 United States Government as represented by the Administrator of the National Aeronautics and Space Administration . All Rights Reserved . No Warranty : THE SUBJECT SOFTWARE IS PROVIDED " AS IS " WITHOUT ANY WARRANTY OF ANY KIND , EITHER EXPRESSED , IMPLIED , OR STATUTORY , INCLUDING , BUT NOT L...
6cc22b1060ae03b341202f866002fe168e8c7b698a12ebde43e7c0605c8b7fad
moby/vpnkit
test.ml
module Error = Dns_forward.Error.Infix module Clock = Dns_forward_lwt_unix.Clock let fresh_id = let next = ref 1000 in fun () -> let this = !next in next := !next mod 0xffff; this let make_a_query name = let open Dns.Packet in let id = fresh_id () in let detail = { qr = Query; opcode = Standard...
null
https://raw.githubusercontent.com/moby/vpnkit/6dda85cda59e36875fcc6324205aaf0c7056ff0a/src/dns_forward_test/test.ml
ocaml
The virtual address we run our server on: a public server mapping 'foo' to a public ip a public server mapping 'foo' to a public ip Check the response has the correct transaction id a public server mapping 'foo' to a public ip Check the response has the correct transaction id a public server mapping 'foo' ...
module Error = Dns_forward.Error.Infix module Clock = Dns_forward_lwt_unix.Clock let fresh_id = let next = ref 1000 in fun () -> let this = !next in next := !next mod 0xffff; this let make_a_query name = let open Dns.Packet in let id = fresh_id () in let detail = { qr = Query; opcode = Standard...
4f9046722ddbb5c852e00f0b5ed5ad5411819bed321af74a5438ec2ee2d3640d
dramforever/clash-with-stack
Fold.hs
module PlayClash.Fold where import Clash.Prelude # ANN or12 Synthesize { t_name = " or12 " , t_inputs = [ PortName " in " ] , t_output = PortName " out " } # { t_name = "or12" , t_inputs = [ PortName "in" ] , t_output = PortName "out" } #-} or12 :: Vec 12 Bool -> Bool or12 = fo...
null
https://raw.githubusercontent.com/dramforever/clash-with-stack/e67e82dfa9c44c39e0962ee8542387c119e05285/src/PlayClash/Fold.hs
haskell
module PlayClash.Fold where import Clash.Prelude # ANN or12 Synthesize { t_name = " or12 " , t_inputs = [ PortName " in " ] , t_output = PortName " out " } # { t_name = "or12" , t_inputs = [ PortName "in" ] , t_output = PortName "out" } #-} or12 :: Vec 12 Bool -> Bool or12 = fo...
8f199736719993196862145dd91bd65550c0e4dcf39599431caf9790f62a903c
huangz1990/SICP-answers
p112-huffman.scm
;;; p112-huffman.scm ;; leaf (define (make-leaf symbol weight) (list 'leaf symbol weight)) (define (leaf? object) (eq? (car object) 'leaf)) (define (symbol-leaf x) (cadr x)) (define (weight-leaf x) (caddr x)) ;; tree (define (make-code-tree left right) (list left right (app...
null
https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/p112-huffman.scm
scheme
p112-huffman.scm leaf tree
(define (make-leaf symbol weight) (list 'leaf symbol weight)) (define (leaf? object) (eq? (car object) 'leaf)) (define (symbol-leaf x) (cadr x)) (define (weight-leaf x) (caddr x)) (define (make-code-tree left right) (list left right (append (symbols left) (symbols right)) ...