_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
5b44934b1a26d32faf401640591beae652560ab34f2191eaa1d16bcca3f0f7d2
launchdarkly/erlang-server-sdk
ldclient_rollout_randomization_consistency_SUITE.erl
-module(ldclient_rollout_randomization_consistency_SUITE). -include_lib("common_test/include/ct.hrl"). %% ct functions -export([ all/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2 ]). %% Tests -export([ bucket_context_by_key/1, bucket_context_with_seed/1 ])....
null
https://raw.githubusercontent.com/launchdarkly/erlang-server-sdk/d9a4442a8a214bf950dec8182b26cd042436f4c8/test/ldclient_rollout_randomization_consistency_SUITE.erl
erlang
ct functions Tests ==================================================================== ct functions ==================================================================== ==================================================================== Helpers ==================================================================== ...
-module(ldclient_rollout_randomization_consistency_SUITE). -include_lib("common_test/include/ct.hrl"). -export([ all/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2 ]). -export([ bucket_context_by_key/1, bucket_context_with_seed/1 ]). all() -> [ ...
660cf5798021449be1fdbabcbc3509d71ccdd5f511b2f363ea5e555c38d25901
yesodweb/persistent
MkSqlBackend.hs
{-# LANGUAGE RankNTypes #-} module Database.Persist.SqlBackend.Internal.MkSqlBackend where import Control.Monad.Logger (Loc, LogLevel, LogSource, LogStr) import Data.Text (Text) import Database.Persist.Names import Database.Persist.SqlBackend.Internal.InsertSqlResult import Database.Persist.SqlBackend.Internal.Isolat...
null
https://raw.githubusercontent.com/yesodweb/persistent/d7a67f0fea5e07f6f6562a54c0838de23c51d387/persistent/Database/Persist/SqlBackend/Internal/MkSqlBackend.hs
haskell
# LANGUAGE RankNTypes # | This type shares many of the same field names as the 'SqlBackend' type. It's useful for library authors to use this when migrating from using the For fields that aren't present on this record, you'll want to use the various @set@ functions or ^ This function should prepare a 'Statement'...
module Database.Persist.SqlBackend.Internal.MkSqlBackend where import Control.Monad.Logger (Loc, LogLevel, LogSource, LogStr) import Data.Text (Text) import Database.Persist.Names import Database.Persist.SqlBackend.Internal.InsertSqlResult import Database.Persist.SqlBackend.Internal.IsolationLevel import Database.Per...
2017136e587071a7f25bafcf25c10ac20902314e40e53a76910d0c972199feae
aib/Project-Euler
euler93.hs
import Data.Function import Data.List targets :: [a -> a -> a] -> [a] -> [a] targets ops nums = do opOrder < - concatMap permutations $ multicombinations ( length nums - 1 ) ops opOrder <- sequence . replicate (length nums - 1) $ ops numOrder <- permutations nums return $ target opOrder numOrder where...
null
https://raw.githubusercontent.com/aib/Project-Euler/a01a142d360f3a30fcea69ab29d4d198160ee921/euler93.hs
haskell
import Data.Function import Data.List targets :: [a -> a -> a] -> [a] -> [a] targets ops nums = do opOrder < - concatMap permutations $ multicombinations ( length nums - 1 ) ops opOrder <- sequence . replicate (length nums - 1) $ ops numOrder <- permutations nums return $ target opOrder numOrder where...
a55f27ee99794b27ef5d4b3480709cdb870e3ea55ad9e96775a63aadc9d4a5ca
MastodonC/witan.ui
shared.clj
(ns witan.ui.style.shared (:require [garden.units :refer [px em percent]] [witan.ui.style.colour :as colour] [witan.ui.style.fonts :as fonts] [witan.ui.style.values :as values] [witan.ui.style.util :refer [transition]])) (def style [[:.shared-search-input ...
null
https://raw.githubusercontent.com/MastodonC/witan.ui/5ea6baaff52824ac61737911dd2c11b451157bad/src/styles/witan/ui/style/shared.clj
clojure
(ns witan.ui.style.shared (:require [garden.units :refer [px em percent]] [witan.ui.style.colour :as colour] [witan.ui.style.fonts :as fonts] [witan.ui.style.values :as values] [witan.ui.style.util :refer [transition]])) (def style [[:.shared-search-input ...
606b0d154fba9e54e757d26506457c4a155b32db0b0896f4f719c03a2b976b74
racket/typed-racket
type-alias-env.rkt
#lang racket/base (require "env-utils.rkt" "../utils/utils.rkt" syntax/private/id-table (only-in "../rep/type-rep.rkt" Type? Name? Name-id) "../utils/tc-utils.rkt" "../typecheck/renamer.rkt" (prefix-in c: (contract-req)) racket/match) (provide register-ty...
null
https://raw.githubusercontent.com/racket/typed-racket/d65ff8bd7146b15b79f31506f8aca410aed196e4/typed-racket-lib/typed-racket/env/type-alias-env.rkt
racket
a parameter, whose value is either: false, which indicates the type checker is not registering type alias a mapping from id to boolean otherwise. signal that the type alias will start registration signal that the type alias will finish registration if the input is a Name?, return whether the type alias it represe...
#lang racket/base (require "env-utils.rkt" "../utils/utils.rkt" syntax/private/id-table (only-in "../rep/type-rep.rkt" Type? Name? Name-id) "../utils/tc-utils.rkt" "../typecheck/renamer.rkt" (prefix-in c: (contract-req)) racket/match) (provide register-ty...
fff942a0e22fe082d79b5e5b65799696edac46e049564c726267b0d426ab020e
ibawt/chezuv
125.body.scm
Copyright 2015 . ;;; ;;; Permission to copy this software, in whole or in part, to use this ;;; software for any lawful purpose, and to redistribute this software ;;; is granted subject to the restriction that all copies made of this ;;; software must include this copyright and permission notice in full. ;;; ;;; I...
null
https://raw.githubusercontent.com/ibawt/chezuv/0075ebe8f2529d916946aaa7e441b5134c4ab0e5/vendor/srfi/%253a125/125.body.scm
scheme
Permission to copy this software, in whole or in part, to use this software for any lawful purpose, and to redistribute this software is granted subject to the restriction that all copies made of this software must include this copyright and permission notice in full. I also request that you send me a copy of an...
Copyright 2015 . Ten of the SRFI 125 procedures are deprecated , and another two allow alternative arguments that are deprecated . (define (issue-deprecated-warnings?) #t) (define (issue-warning-deprecated name-of-deprecated-misfeature) (if (not (memq name-of-deprecated-misfeature already-warned)) ...
d4f6c65a9b49e27c9959bf766f95875c913ea92be4da401e85c05ebd2591f1a5
fosskers/aura
Dependencies.hs
# LANGUAGE DeriveGeneric # {-# LANGUAGE LambdaCase #-} # LANGUAGE TupleSections # -- | Module : Aura . Dependencies Copyright : ( c ) , 2012 - 2021 -- License : GPL3 Maintainer : < > -- -- Library for handling package dependencies and version conflicts. module Aura.Dependencies ( resolveDeps ) whe...
null
https://raw.githubusercontent.com/fosskers/aura/08cd46eaa598094f7395455d66690d3d8c59e965/haskell/aura/lib/Aura/Dependencies.hs
haskell
# LANGUAGE LambdaCase # | License : GPL3 Library for handling package dependencies and version conflicts. - | The results of dependency resolution. | Given some `Package`s, determine its full dependency graph. The graph is collapsed into layers of packages which are not interdependent, and thus can be buil...
# LANGUAGE DeriveGeneric # # LANGUAGE TupleSections # Module : Aura . Dependencies Copyright : ( c ) , 2012 - 2021 Maintainer : < > module Aura.Dependencies ( resolveDeps ) where import Algebra.Graph.AdjacencyMap import Algebra.Graph.AdjacencyMap.Algorithm (scc) import qualified Al...
e2a711517416f5c96ce8ddf9ce827572232fd7046773fdd891a3b7f1efa76304
well-typed/large-records
Zipping.hs
{-# LANGUAGE ConstraintKinds #-} # LANGUAGE DataKinds # {-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE ExistentialQuantification # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances ...
null
https://raw.githubusercontent.com/well-typed/large-records/fb983aa136c2602499c2421323bd52b6a54b7c9a/beam-large-records/test/Test/Record/Beam/Zipping.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE DeriveAnyClass # # LANGUAGE KindSignatures # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fplugin=Data.Record.Plugin.WithR...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE ExistentialQuantification # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE StandaloneDeriving # #...
28f34a5ac385d19d0a5d01dda07a32c6782348c7a2b8207c263f9d1cfc4213cd
iij/lmq
lmq.erl
-module(lmq). -include("lmq.hrl"). -export([start/0, stop/0]). -export([push/2, push/3, pull/1, pull/2, pull/3, ack/2, abort/2, keep/2, push_all/2, push_all/3, pull_any/1, pull_any/2, pull_any/3, delete/1, get_props/1, update_props/1, update_props/2, set_default_props/1, get_default_props/0, status/0, ...
null
https://raw.githubusercontent.com/iij/lmq/3f01c555af973a07a3f2b22ff95a2bc1c7930bc2/src/lmq.erl
erlang
================================================================== Public API ================================================================== ================================================================== Private functions ==================================================================
-module(lmq). -include("lmq.hrl"). -export([start/0, stop/0]). -export([push/2, push/3, pull/1, pull/2, pull/3, ack/2, abort/2, keep/2, push_all/2, push_all/3, pull_any/1, pull_any/2, pull_any/3, delete/1, get_props/1, update_props/1, update_props/2, set_default_props/1, get_default_props/0, status/0, ...
4fc41260a0606d6e3f85dc72921ba9eb466c6f14a7c4b5761e3b8900d9ea8da3
huangz1990/real-world-haskell-cn
FunctorLaws.hs
-- file: ch10/FunctorLaws.hs fmap id == id fmap (f . g) == fmap f . fmap g
null
https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch10/FunctorLaws.hs
haskell
file: ch10/FunctorLaws.hs
fmap id == id fmap (f . g) == fmap f . fmap g
fbe71a656fd3f001df4c9677e3bca0b59b653d1c11eb920c4058e44896eca85c
fluentpython/lispy
chap7c.scm
$ I d : , v 4.3 2006/11/24 18:16:37 queinnec Exp $ ;;;(((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) ;;; This file is part of the files that accompany the book: LISP Implantation Semantique Programmation ( InterEditions , France ) By Christian Queinnec < > ;;; Newest version may ...
null
https://raw.githubusercontent.com/fluentpython/lispy/6b995c398e2d100fc3fc292e34ba1a00c0ae9b5a/references/LiSP-2ndEdition-2006Dec11/src/chap7c.scm
scheme
(((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) This file is part of the files that accompany the book: Newest version may be retrieved from: Check the README file before using this file. (((((((((((((((((((((((((((((((( L i S P )))))))))))))))))))))))))))))))) Refinement of chap6d and cha...
$ I d : , v 4.3 2006/11/24 18:16:37 queinnec Exp $ LISP Implantation Semantique Programmation ( InterEditions , France ) By Christian Queinnec < > ( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz (define *val* #f) (define *fun* #f) (define *arg1* #f) (define *arg2* ...
e7e0a29e971bafe032d2bd9a07e8b22aba538059c38f63d8124fd840def772a4
sdanzan/erlang-systools
testinotify.erl
%%% ------------------------------------------------------------------------- %%% Sample test / demonstration program. Simply call testinotify : test ( ) in erlang shell and play around with the %%% watched directory / file. To stop the program, just touch/create a file %%% named 'stop' in the watched directory. %%% ...
null
https://raw.githubusercontent.com/sdanzan/erlang-systools/ced3faf1c807d36c528e53cbb366d69f464ff4e5/test/testinotify.erl
erlang
------------------------------------------------------------------------- Sample test / demonstration program. watched directory / file. To stop the program, just touch/create a file named 'stop' in the watched directory. ex.: test("."). test("/tmp", [ recursive ]). test("/tmp", [ { exclude, "toto"...
Simply call testinotify : test ( ) in erlang shell and play around with the -module(testinotify). -export([test/0, test/1, test/2]). -record(inotify, { event, isdir, file, watched }). test() -> test("."). test(Watched) -> test(Watched, []). test(Watched, Options) -> Wrapper = inotifywrapper:start(Watched, Opti...
6e2bfb276b566cd54ce8f4a7849c81bb2965ed88abdfc5bda276a9bf142d5b67
jgm/grammata
main.hs
{-# LANGUAGE OverloadedStrings #-} import Grammata.Parse (interpretDoc) import Grammata.Util (showInterpreterError) import Options.Applicative hiding (UnknownError) import Control.Monad.RWS import Language.Haskell.Interpreter -- hint import Grammata.Types import System.IO (stderr, hPutStrLn) import Data.Char (toUpper,...
null
https://raw.githubusercontent.com/jgm/grammata/3d8a09f5d287ecfe4611f51b603f51926e77811e/src/main.hs
haskell
# LANGUAGE OverloadedStrings # hint
import Grammata.Parse (interpretDoc) import Grammata.Util (showInterpreterError) import Options.Applicative hiding (UnknownError) import Control.Monad.RWS import Grammata.Types import System.IO (stderr, hPutStrLn) import Data.Char (toUpper, toLower) import qualified Data.ByteString.Lazy as BL data Options = Options ...
c6018c1f77f7f994c736ad7687dc09ff5c7df6bf585911385ff946ffc87124f6
lambdaisland/ansi
cljs_test_runner.clj
(ns lambdaisland.ansi.cljs-test-runner (:gen-class) (:require [doo.core :as doo] [cljs.build.api :as cljs])) (def cljs-config {:main 'lambdaisland.ansi-test :output-to "out/testable.js" :output-dir "out" :optimizations :simple :tar...
null
https://raw.githubusercontent.com/lambdaisland/ansi/76a239f820e8f85790cf5b578ad0f08c8e24cf75/test/lambdaisland/ansi/cljs_test_runner.clj
clojure
(ns lambdaisland.ansi.cljs-test-runner (:gen-class) (:require [doo.core :as doo] [cljs.build.api :as cljs])) (def cljs-config {:main 'lambdaisland.ansi-test :output-to "out/testable.js" :output-dir "out" :optimizations :simple :tar...
e4a391542e35204d1ae281308741c1fc3bce7238906ba3a982d851fae43660ab
huangjs/cl
mring.lisp
A Maxima ring stucture Copyright ( C ) 2005 , 2007 , Barton Willis Department of Mathematics University of Nebraska at Kearney ;; Kearney NE 68847 ;; ;; This source code is licensed under the terms of the Lisp Lesser GNU Public License ( LLGPL ) . The LLGPL consists of a preamble , published by Fran...
null
https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/share/linearalgebra/mring.lisp
lisp
Kearney NE 68847 This source code is licensed under the terms of the Lisp Lesser any later version. When the preamble conflicts with the LGPL, the preamble takes precedence. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHA...
A Maxima ring stucture Copyright ( C ) 2005 , 2007 , Barton Willis Department of Mathematics University of Nebraska at Kearney GNU Public License ( LLGPL ) . The LLGPL consists of a preamble , published by Franz Inc. ( ) , and the GNU Library General Public License ( LGPL ) , version 2 , or ( at yo...
04c92c7feb3a26c257237bb942c0d46b43d0a5e2c36e43a2eac943e1a6baebdc
haroldcarr/plutus-pioneer-program-3
StateMachine.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE MultiParamTypeClasses # # LANGUAGE NoImplicitPrelude # # LANGUAGE OverloadedStrings # {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Templ...
null
https://raw.githubusercontent.com/haroldcarr/plutus-pioneer-program-3/b66f285d4bb5457ced740c50adb490b50aa0ed74/Lecture-07/StateMachine.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE DeriveAnyClass # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # # LANGUAGE TypeOperators # ---------------------------------------------------------------------------...
# LANGUAGE MultiParamTypeClasses # # LANGUAGE NoImplicitPrelude # # LANGUAGE OverloadedStrings # # LANGUAGE TypeApplications # # LANGUAGE TypeFamilies # module Week07.StateMachine ( Game (..) , GameChoice (..) , FirstParams (..) , SecondParams (..) , GameSchema , Last ...
72a4cfad1fa10790830909b389a22b4bd69711296e435b9755fa754c223f94e5
joneshf/open-source
Exit.hs
-- | -- Module: Exit -- Description: An effect for 'Exit'ing the program. -- Copyright : ( c ) , 2018 -- License: BSD3 -- Maintainer: -- Stability: experimental module Exit ( Exit(..) , Exiter , die , failure , io ) where import "freer-simple" Control.Monad.Freer (Eff, Member) import "text" Data.Text ...
null
https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/packages/dhall-javascript/haskell/src/Exit.hs
haskell
| Module: Exit Description: An effect for 'Exit'ing the program. License: BSD3 Maintainer: Stability: experimental | How to exit the program. | Synonym to clean up type signatures | Interpret the exit effect to 'IO'. | Helper to make exiting with a 'Die' easier. | Helper to make exiting with a 'Failur...
Copyright : ( c ) , 2018 module Exit ( Exit(..) , Exiter , die , failure , io ) where import "freer-simple" Control.Monad.Freer (Eff, Member) import "text" Data.Text (Text) import qualified "freer-simple" Control.Monad.Freer import qualified "text" Data.Text import qualified "base" S...
da065e772f1ef5751927d87f4114fa92a572e706055ef1bcc4055e15ab638a94
GlideAngle/flare-timing
EdgeToEdge.hs
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-} module EdgeToEdge (edgeToEdgeUnits, toLatLngDbl) where import Prelude hiding (span) import Data.Ratio((%)) import qualified Data.Number.FixedFunctions as F import Data.List (inits) import Test.Tasty (TestTree, TestName, testGroup) import Test.Tasty.HUnit as HU ...
null
https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/task/test-suite-task/EdgeToEdge.hs
haskell
# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin # | The input pair is in degrees while the output is in radians. | The input pair is in degrees while the output is in radians. NOTE: Use p1' to avoid an hlint duplication warning.
module EdgeToEdge (edgeToEdgeUnits, toLatLngDbl) where import Prelude hiding (span) import Data.Ratio((%)) import qualified Data.Number.FixedFunctions as F import Data.List (inits) import Test.Tasty (TestTree, TestName, testGroup) import Test.Tasty.HUnit as HU ((@?=), (@?), testCase) import Data.UnitsOfMeasure ((/:),...
ce3c6cdf8fcb9f6292c7320bad7ffbbcab6dfbd9e94becf326371ca8b0af8b67
rfkm/zou
rule_test.clj
(ns zou.finder.rule-test (:require [clojure.test :as t] [midje.sweet :refer :all] [zou.component :as c] [zou.finder.proto :as proto] [zou.finder.rule :as sut])) (def test-var) (t/deftest helper-test (fact "expand-kw" (let [conf {nil :hoge.handler ...
null
https://raw.githubusercontent.com/rfkm/zou/228feefae3e008f56806589cb8019511981f7b01/lib/test/zou/finder/rule_test.clj
clojure
longer match wins
(ns zou.finder.rule-test (:require [clojure.test :as t] [midje.sweet :refer :all] [zou.component :as c] [zou.finder.proto :as proto] [zou.finder.rule :as sut])) (def test-var) (t/deftest helper-test (fact "expand-kw" (let [conf {nil :hoge.handler ...
3e822c364cc0e42f66379e716a6bb1cf5ca59545fdb2217f9886f66a79c1f441
yomimono/stitchcraft
controls.ml
open Stitchy.Types type view = { x_off : int; y_off : int; block_display : [ `Symbol | `Solid ]; zoom : int; } type pane = { width : int; height : int; } (* dimensions of the x-axis labels and y-axis labels (the upper-right and lower-left rectangles respectively) are implicitly defined by the empty...
null
https://raw.githubusercontent.com/yomimono/stitchcraft/329e528544c22971182c310d1240050ef8273960/notty_canvas/lib/controls.ml
ocaml
dimensions of the x-axis labels and y-axis labels (the upper-right and lower-left rectangles respectively) are implicitly defined by the empty corner and stitch grid (the upper-left and lower-right rectangles)
open Stitchy.Types type view = { x_off : int; y_off : int; block_display : [ `Symbol | `Solid ]; zoom : int; } type pane = { width : int; height : int; } type left_pane = { empty_corner : pane; stitch_grid : pane; } let switch_view v = match v.block_display with | `Symbol -> {v with block_displa...
1e57b301655491e0fe4d68b6995494a9f4bde14d9ab16594a5b1e0d4b061a203
typelead/etlas
Script.hs
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.Script Copyright : 2009 -- -- Maintainer : -- Portability : portable -- -- This module provides an library interface to the @hc-pkg@ program. Currently only GHC and LHC have hc...
null
https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Simple/Program/Script.hs
haskell
--------------------------------------------------------------------------- | Module : Distribution.Simple.Program.Script Maintainer : Portability : portable This module provides an library interface to the @hc-pkg@ program. as appropriate for the given system. | Generate a POSIX shell script that i...
Copyright : 2009 Currently only GHC and LHC have hc - pkg programs . module Distribution.Simple.Program.Script ( invocationAsSystemScript, invocationAsShellScript, invocationAsBatchFile, ) where import Prelude () import Distribution.Compat.Prelude import Distribution.Simple.Program.Run impo...
c728a7bd5a8074dc9cc190a8deae6658b0729991a5e12dbeca55cb8019b68981
clojure-interop/google-cloud-clients
Instance.clj
(ns com.google.cloud.spanner.Instance "Represents a Cloud Spanner Instance. Instance adds a layer of service related functionality over InstanceInfo." (:refer-clojure :only [require comment defn ->]) (:import [com.google.cloud.spanner Instance])) (defn reload "returns: `com.google.cloud.spanner.Instance`" ...
null
https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.spanner/src/com/google/cloud/spanner/Instance.clj
clojure
(ns com.google.cloud.spanner.Instance "Represents a Cloud Spanner Instance. Instance adds a layer of service related functionality over InstanceInfo." (:refer-clojure :only [require comment defn ->]) (:import [com.google.cloud.spanner Instance])) (defn reload "returns: `com.google.cloud.spanner.Instance`" ...
e7a8105d8db13abef1c6bc6a5ca2cdba579ac6b75147c7e8233dee2b01e5c492
softwarelanguageslab/maf
R5RS_WeiChenRompf2019_the-little-schemer_ch2-2.scm
; Changes: * removed : 0 * added : 0 * swaps : 1 ; * negated predicates: 0 * swapped branches : 1 ; * calls to id fun: 0 (letrec ((atom? (lambda (x) (if (not (pair? x)) (<change> (not (null? x)) #f) (<cha...
null
https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_WeiChenRompf2019_the-little-schemer_ch2-2.scm
scheme
Changes: * negated predicates: 0 * calls to id fun: 0
* removed : 0 * added : 0 * swaps : 1 * swapped branches : 1 (letrec ((atom? (lambda (x) (if (not (pair? x)) (<change> (not (null? x)) #f) (<change> #f (not...
910de451c3dd72d2cd6eb51b5bf6c971fda724b7fef3da7f55c72a47d24f04fd
manuel-serrano/bigloo
date.scm
;*=====================================================================*/ * serrano / prgm / project / bigloo / api / web / src / Llib / date.scm * / ;* ------------------------------------------------------------- */ * Author : * / * Creation : Tue Jul 22 08:06:43 2008 ...
null
https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/web/src/Llib/date.scm
scheme
*=====================================================================*/ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ * See: */ * -datetime-19980827 ...
* serrano / prgm / project / bigloo / api / web / src / Llib / date.scm * / * Author : * / * Creation : Tue Jul 22 08:06:43 2008 * / * Last change : Tue Mar 22 08:20:59 2011 ( serrano ) * / * Copyright : 2008 - 11 ...
1b10f45c769952f82ba7a55cb4ee772d7c5d4f9fa860efe6ddd77a7f7ef2ba25
ghosthamlet/algorithm-data-structure
binary_search_tree_test.clj
(ns algorithm-data-structure.data-structures.binary-search-tree-test (:require [algorithm-data-structure.data-structures.binary-search-tree :as bst] [algorithm-data-structure.data-structures.hash-table :as ht] [clojure.test :refer :all])) (def tree (bst/create)) (deftest create-test (is (=...
null
https://raw.githubusercontent.com/ghosthamlet/algorithm-data-structure/017f41a79d8b1d62ff5a6cceffa1b0f0ad3ead6b/test/algorithm_data_structure/data_structures/binary_search_tree_test.clj
clojure
(ns algorithm-data-structure.data-structures.binary-search-tree-test (:require [algorithm-data-structure.data-structures.binary-search-tree :as bst] [algorithm-data-structure.data-structures.hash-table :as ht] [clojure.test :refer :all])) (def tree (bst/create)) (deftest create-test (is (=...
6fea15cc599f4409b97485208f380a5ec8aa4c060423ec2115a299d2e6034954
lehins/massiv
FuseSeq.hs
# LANGUAGE FlexibleContexts # {-# LANGUAGE GADTs #-} module Main where import Bench import Bench.Massiv as A import Criterion.Main import Data.Array.Repa as R import Data.Vector.Unboxed as VU import Prelude as P main :: IO () main = do let t2 = (1600, 1200) :: (Int, Int) defaultMain [ bgroup "map (+2...
null
https://raw.githubusercontent.com/lehins/massiv/67a920d4403f210d0bfdad1acc4bec208d80a588/massiv-bench/bench/FuseSeq.hs
haskell
# LANGUAGE GADTs #
# LANGUAGE FlexibleContexts # module Main where import Bench import Bench.Massiv as A import Criterion.Main import Data.Array.Repa as R import Data.Vector.Unboxed as VU import Prelude as P main :: IO () main = do let t2 = (1600, 1200) :: (Int, Int) defaultMain [ bgroup "map (+25)" [ env ...
3d32332dddd05301edafbb4a73b4010c26a42b66e50b1f125cbda1e17979f6c8
40ants/reblocks-ui
heroku-compile.lisp
(declaim (optimize (debug 3))) (ql:quickload :qlot) (format t "*load-truename*: ~S~%" *load-truename*) (let* ((raw-qlfile (uiop:merge-pathnames* #P"qlfile" (uiop:pathname-directory-pathname *load-truename*))) (qlfile ...
null
https://raw.githubusercontent.com/40ants/reblocks-ui/6c91a6d51130bea801b879e2f267cf539ba84cc9/heroku-compile.lisp
lisp
These modules are required because sources will not be available at runtime these systems into the Lisp image
(declaim (optimize (debug 3))) (ql:quickload :qlot) (format t "*load-truename*: ~S~%" *load-truename*) (let* ((raw-qlfile (uiop:merge-pathnames* #P"qlfile" (uiop:pathname-directory-pathname *load-truename*))) (qlfile ...
425e85f76f25236961cd9c04d9e673b37b6eb6b9ab8a548b5722ddd64841f80b
johanatan/speako
schema.cljs
Copyright ( c ) 2016 (ns speako.schema (:require [cljs.nodejs :as node] [cljs.core.match :refer-macros [match]] [speako.common :as common] [instaparse.core :as insta])) (def fs (node/require "fs")) (def ^:private grammar "<S> = TYPE+ TYPE = <WS> (OBJECT | UNION | ENUM) ...
null
https://raw.githubusercontent.com/johanatan/speako/0d542aaaf1dcf73d84250c325529a51668284722/src/speako/schema.cljs
clojure
Copyright ( c ) 2016 (ns speako.schema (:require [cljs.nodejs :as node] [cljs.core.match :refer-macros [match]] [speako.common :as common] [instaparse.core :as insta])) (def fs (node/require "fs")) (def ^:private grammar "<S> = TYPE+ TYPE = <WS> (OBJECT | UNION | ENUM) ...
6bfea5a7f72cfce820311710455e46b5618e1f782059938b8e5f3ee72fda3924
ahrefs/atd
test2j.expected.ml
(* Auto-generated from "test2.atd" *) [@@@ocaml.warning "-27-32-33-35-39"] open Test open Test2 open Testj let write_poly write__aa write__bb = ( Testj.write_poly write__aa write__bb ) let string_of_poly write__aa write__bb ?(len = 1024) x = let ob = Buffer.create len in write_poly write__aa write__bb ob x; Bu...
null
https://raw.githubusercontent.com/ahrefs/atd/1f2b3bcc54d14159a5e25e9b23b5c9bed163721c/atdgen/test/test2j.expected.ml
ocaml
Auto-generated from "test2.atd"
[@@@ocaml.warning "-27-32-33-35-39"] open Test open Test2 open Testj let write_poly write__aa write__bb = ( Testj.write_poly write__aa write__bb ) let string_of_poly write__aa write__bb ?(len = 1024) x = let ob = Buffer.create len in write_poly write__aa write__bb ob x; Buffer.contents ob let read_poly read__a...
ea841cdc9ca4d2f84af5d586a8667477c9f173fa5003af98efabecb7c66c67c5
okuoku/nausicaa
run.sps
Copyright ( c ) 2008 ;;; ;;;This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation ; either version 2 of the ;;;License, or (at your option) any later version. ;;; ;;;This library...
null
https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/scheme/tests/r6rs/run.sps
scheme
This library is free software; you can redistribute it and/or modify either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ...
Copyright ( c ) 2008 it under the terms of the GNU Library General Public License as Library General Public License for more details . You should have received a copy of the GNU Library General Public Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 U...
dee9398a119a7c774235db127a852f6accd0b9edba241a591d05ac1b897f4b18
JoelSanchez/ventas
ui.cljs
(ns ventas.utils.ui) (defn with-handler [cb] (fn [e] (doto e .preventDefault .stopPropagation) (cb e)))
null
https://raw.githubusercontent.com/JoelSanchez/ventas/dc8fc8ff9f63dfc8558ecdaacfc4983903b8e9a1/src/cljs/ventas/utils/ui.cljs
clojure
(ns ventas.utils.ui) (defn with-handler [cb] (fn [e] (doto e .preventDefault .stopPropagation) (cb e)))
d10de21ed948b168ffc42acfeb0e25d353e16dbfa4f9dd84469825ca734a4a68
benzap/fif
def.cljc
(ns fif.def (:require [clojure.string :as str] [fif.stack-machine :as stack] [fif.stack-machine.evaluators :as evaluators] [fif.stack-machine.error-handling :as error-handling] [fif.stack-machine.exceptions :as exceptions] [fif.stack-machine.verification :as verification] [fif.stack-machine.words...
null
https://raw.githubusercontent.com/benzap/fif/972adab8b86c016b04babea49d52198585172fe3/src/fif/def.cljc
clojure
Check to see if the main stack has enough arguments to satisfy the word operation. Check to see if the main stack has enough arguments to satisfy the word function. Define Stack Functions Define Stack Procedures Define Global Variables Define Global Words
(ns fif.def (:require [clojure.string :as str] [fif.stack-machine :as stack] [fif.stack-machine.evaluators :as evaluators] [fif.stack-machine.error-handling :as error-handling] [fif.stack-machine.exceptions :as exceptions] [fif.stack-machine.verification :as verification] [fif.stack-machine.words...
160acf3af2193a6b90959b325ea3f7a2c63a6a6901acb1138f7abd0a80971530
senorcarbone/erlang-nnar-kvs
kvs.erl
-module(kvs). -behavior(gen_server). -export([start/1, start/2, stop/1, put/3, get/2, configure/3, callbacks/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, addItemToStoreList/3]). -record(state, {callee, beb, rs, ts=0, store=orddict:new(), writeSet=orddict:new(), readSet=orddict:ne...
null
https://raw.githubusercontent.com/senorcarbone/erlang-nnar-kvs/defb7a529b5fb3c248be7f620fa7fbbd312723b5/src/kvs.erl
erlang
GEN_SERVER io:format("~n ~p got putreply from ~p for key ~p",[self(), From, Key ]), io:format("~n ~p got put for : ~p",[self(), Data]), private functions
-module(kvs). -behavior(gen_server). -export([start/1, start/2, stop/1, put/3, get/2, configure/3, callbacks/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, addItemToStoreList/3]). -record(state, {callee, beb, rs, ts=0, store=orddict:new(), writeSet=orddict:new(), readSet=orddict:ne...
9db2fda709664bbf6ec715dfd825e1c1836fdbba7c9259d88ec44793ff167b52
chaitanyagupta/chronicity
repeater-fortnight.lisp
-*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*- ;;; repeater-fortnight.lisp ;;; See the LICENSE file for licensing information. (cl:in-package #:chronicity) (defclass repeater-fortnight (repeater) ((current-fortnight-start :initform nil))) (defmethod r-next ((repeater repeater-for...
null
https://raw.githubusercontent.com/chaitanyagupta/chronicity/5841d1548cad0ca6917d8e68933124a5af68f5ec/src/repeaters/repeater-fortnight.lisp
lisp
Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*- repeater-fortnight.lisp See the LICENSE file for licensing information.
(cl:in-package #:chronicity) (defclass repeater-fortnight (repeater) ((current-fortnight-start :initform nil))) (defmethod r-next ((repeater repeater-fortnight) pointer) (with-slots (current-fortnight-start now) repeater (let ((sunday (start-of-week now))) (if (not current-fortnight-start) ...
c23fe1610004e590f5301c85611141f0766e9f4058f3ef8df4547c08ef58592b
cosmos72/hyperluminal-mem
b+leaf.lisp
;; -*- lisp -*- ;; This file is part of Hyperluminal-mem. Copyright ( c ) 2013 - 2015 ;; ;; This library is free software: you can redistribute it and/or modify it under the terms of the Lisp Lesser General Public License ;; (), known as the LLGPL. ;; ;; This library is distributed in the hope that it will be us...
null
https://raw.githubusercontent.com/cosmos72/hyperluminal-mem/29c23361260e3a94fb1e09f3fdeab469b035504d/tree/b%2Bleaf.lisp
lisp
-*- lisp -*- This file is part of Hyperluminal-mem. This library is free software: you can redistribute it and/or (), known as the LLGPL. This library 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 PU...
Copyright ( c ) 2013 - 2015 modify it under the terms of the Lisp Lesser General Public License (in-package :hyperluminal-mem-tree) (defun b+leaf (&key (leaf t) size capacity contents contents-start contents-end) (declare (type (or null b+size) size capacity contents-start contents-end) (type (or...
3f40a506a886144a3d1c3581eb910c6be4bab513a462f45f091070f291e661dc
chetmurthy/utjson
ututil.ml
open Pa_ppx_utils.Std (* borrowed from ounit *) let failwithf fmt = Fmt.kstrf failwith fmt let raise_failwith loc s = Ploc.raise loc (Failure s) let raise_failwithf loc fmt = Fmt.kstrf (raise_failwith loc) fmt module Stack = struct let push l x = (l := x :: !l) let pop l = match !l with h::tl -> l := tl ...
null
https://raw.githubusercontent.com/chetmurthy/utjson/6e65ce058d6741b937888f51cd5f8f61f51a3936/ututil.ml
ocaml
borrowed from ounit
open Pa_ppx_utils.Std let failwithf fmt = Fmt.kstrf failwith fmt let raise_failwith loc s = Ploc.raise loc (Failure s) let raise_failwithf loc fmt = Fmt.kstrf (raise_failwith loc) fmt module Stack = struct let push l x = (l := x :: !l) let pop l = match !l with h::tl -> l := tl | [] -> invalid_arg "pop...
46bc55ffe86b01f155bcd4c5e14924b052ab838ad4953e7829c9bf3cab26dde1
mbenke/zpf2013
DiaBadCat.hs
module DiaCat where import Dialogue1 cat :: Dialogue cat ~(Success : ~((Str userInput) : ~(Success : ~(r4 : _)))) = [ AppendChan stdout "enter filename\n", ReadChan stdin, AppendChan stdout name, ReadFile name, AppendChan stdout (case r4 of Str contents -> contents Failure...
null
https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/IO/DiaBadCat.hs
haskell
where (name : _) = lines userInput
module DiaCat where import Dialogue1 cat :: Dialogue cat ~(Success : ~((Str userInput) : ~(Success : ~(r4 : _)))) = [ AppendChan stdout "enter filename\n", ReadChan stdin, AppendChan stdout name, ReadFile name, AppendChan stdout (case r4 of Str contents -> contents Failure...
7e5af03b4a0166a19ec1978bc7e722dbddfd6b881ea66f4c2d5e7fa067eebf27
jaycfields/jry
set.clj
(ns jry.set) (defn rel->hash-map [rel key-fn & {:keys [val-fn] :or {val-fn identity}}] (reduce (fn [result e] (assoc result (key-fn e) (val-fn e))) {} rel)) (defn hash-map->rel [m kk vk] (map (fn [[k v]] (hash-map kk k vk v)) m)) (defn transform [rel transform-fns] (map #(reduce (fn [result [t-k t-fn]] ...
null
https://raw.githubusercontent.com/jaycfields/jry/d79cc8ec552c11122001bc1dd01b9ef6c251a9fb/src/clojure/jry/set.clj
clojure
(ns jry.set) (defn rel->hash-map [rel key-fn & {:keys [val-fn] :or {val-fn identity}}] (reduce (fn [result e] (assoc result (key-fn e) (val-fn e))) {} rel)) (defn hash-map->rel [m kk vk] (map (fn [[k v]] (hash-map kk k vk v)) m)) (defn transform [rel transform-fns] (map #(reduce (fn [result [t-k t-fn]] ...
d2706ec14c24c94bd3cc7ae1e7dcc67a236d82d0891b23e3dda0bd1cabda4644
zotonic/zotonic
search_query.erl
@author < > 2009 - 2023 @doc Handler for m.search[{query , .. } ] 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...
null
https://raw.githubusercontent.com/zotonic/zotonic/f74d8ae093fc7d37601c55981c349d59c23f7d1e/apps/zotonic_mod_search/src/support/search_query.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 permi...
@author < > 2009 - 2023 @doc Handler for m.search[{query , .. } ] Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(search_query). -author("Arjan Scherpenisse <>"). -export([ search/2, ...
1350b2fa175898d921d6ad21da393d74ac89d8e784042e191cbcc0926ab179e0
kind2-mc/kind2
lustreSyntaxChecks.mli
This file is part of the Kind 2 model checker . Copyright ( c ) 2021 by the Board of Trustees of the University of Iowa 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 a...
null
https://raw.githubusercontent.com/kind2-mc/kind2/d34694b4461323322fdcc291aa3c3d9c453fc098/src/lustre/lustreSyntaxChecks.mli
ocaml
* Conservative syntactic check of clock arguments for merge expressions. To eventually be replaced with more general clock inference/checking. Note: type information is needed for this check, causing this check to be called in the lustreTypeChecker
This file is part of the Kind 2 model checker . Copyright ( c ) 2021 by the Board of Trustees of the University of Iowa 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 a...
370a5c280d91e2f89ffa3047b59a765dc5bd94339b48bb1c4ed46a5ce0499aab
cojna/iota
Safe.hs
{-# LANGUAGE BangPatterns #-} # LANGUAGE CPP # {-# LANGUAGE Safe #-} module Data.IntMod.Safe where import Data.Bits import Data.Int import Data.Ratio #define MOD 1000000007 modulus :: (Num a) => a modulus = MOD # INLINE modulus # infixr 8 ^% infixl 7 *%, /% infixl 6 +%, -% (+%) :: Int64 -> Int64 -> Int64 x +% y =...
null
https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/src/Data/IntMod/Safe.hs
haskell
# LANGUAGE BangPatterns # # LANGUAGE Safe # # INLINE (-%) # # INLINE (*%) # | >>> 1 /% 0 0 # INLINE (/%) #
# LANGUAGE CPP # module Data.IntMod.Safe where import Data.Bits import Data.Int import Data.Ratio #define MOD 1000000007 modulus :: (Num a) => a modulus = MOD # INLINE modulus # infixr 8 ^% infixl 7 *%, /% infixl 6 +%, -% (+%) :: Int64 -> Int64 -> Int64 x +% y = case x + y of r | r < MOD -> r | otherwis...
880b2ad4e4341f8b01efd7495a0af199b15bdceb86c784e85a7e450901fe36c4
nd/bird
8.4.4.hs
Complexity of foldr insert empty would be n . log n, while complexity of mkBag is n
null
https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch08/8.4.4.hs
haskell
Complexity of foldr insert empty would be n . log n, while complexity of mkBag is n
5b76f5ca59358a5561f93df4cc78b58c42ff165c1c196b71e43f61aa73e8215a
lspitzner/exference
Monoid.hs
module Data.Monoid where class Monoid a where mempty :: a mappend :: a -> a -> a mconcat :: [a] -> a instance Monoid Ordering instance Monoid () instance Monoid Any instance Monoid All instance Monoid Event instance Monoid [a] instance Monoid a => Monoid (Maybe a) instance Monoid (Last a) ...
null
https://raw.githubusercontent.com/lspitzner/exference/d8a336f8b9df905e54173339f78ba892daa3f688/environment/Monoid.hs
haskell
instance Monoid b => Monoid (a -> b) instance Monoid (Proxy * s)
module Data.Monoid where class Monoid a where mempty :: a mappend :: a -> a -> a mconcat :: [a] -> a instance Monoid Ordering instance Monoid () instance Monoid Any instance Monoid All instance Monoid Event instance Monoid [a] instance Monoid a => Monoid (Maybe a) instance Monoid (Last a) ...
cfb761a46970ee5b44053f74fc18d1c4a78e356ce4429da3bd01cbc74c695adb
candera/vmt
main.cljs
(ns app.main (:require [weathergen.ipc :as ipc] [weathergen.falcon.install :as install])) (def electron (js/require "electron")) (def app (.-app electron)) (def path (js/require "path")) (def BrowserWindow (.-BrowserWindow electron)) (def ipcMain (.-ipcMain electron)) (goog...
null
https://raw.githubusercontent.com/candera/vmt/8cf450e6c34af87d748152afd7f547b92ae9b38e/src/app/main.cljs
clojure
Shows how to make a child window that's always on top of the app window: TODO: Anything we want to do differently? TODO: Maybe show splash screen
(ns app.main (:require [weathergen.ipc :as ipc] [weathergen.falcon.install :as install])) (def electron (js/require "electron")) (def app (.-app electron)) (def path (js/require "path")) (def BrowserWindow (.-BrowserWindow electron)) (def ipcMain (.-ipcMain electron)) (goog...
31e0b17277df2fd2767e85ac4dc0038cf7bb31492a2de7b9ee1f0c779d32537d
georepl/georepl
main.clj
(ns georepl.main (:require [clojure.java.io :as io] [clojure.string :as str] [georepl.draw-framework :as frame] [georepl.shapes :as shapes] [georepl.mathlib :as math] [georepl.elements :as elements] [georepl.user :as user] [georepl.co...
null
https://raw.githubusercontent.com/georepl/georepl/1502ae04bbc3cab757000714008ccecc4e9e571b/src/georepl/main.clj
clojure
read drawing from a file scale a drawing so it fits in a given icon box order a list of icons to fit in a box of the given size helper to find a number as part of a string create an empty drawing to start with select a drawing from the ones in the working directory (defined in configs) Start gui frame with the se...
(ns georepl.main (:require [clojure.java.io :as io] [clojure.string :as str] [georepl.draw-framework :as frame] [georepl.shapes :as shapes] [georepl.mathlib :as math] [georepl.elements :as elements] [georepl.user :as user] [georepl.co...
86c0e5725b92dec107b6fccea80500558f146efc2b03f9a5c4ccb0b4e968e446
kmi/irs
trusted-travel-suite.lisp
, 2007 ;;; Testing material for the trusted virtual travel agent application. (in-package :irs.tests) (def-suite trusted-travel-suite :description "Tests for the trusted virtual travel agent application.") (in-suite trusted-travel-suite) (test goal-invocation-test (is (string-equal "( Applicable ...
null
https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/tests/trusted-travel-suite.lisp
lisp
Testing material for the trusted virtual travel agent application.
, 2007 (in-package :irs.tests) (def-suite trusted-travel-suite :description "Tests for the trusted virtual travel agent application.") (in-suite trusted-travel-suite) (test goal-invocation-test (is (string-equal "( Applicable Web Services: <br/>GET-TRAIN-TIMETABLE-SERVICE-T3 <br/>GET-TRAIN-TIMET...
63bb419871c93c422da345ea7bdbd226785e59e880f1463fa8445a20f6db6c6b
sboehler/servant-starter-app
Entity.hs
module Types.Entity ( Entity(..) , Id ) where import Data.Aeson (ToJSON, (.=), object, toJSON) import Database.PostgreSQL.Simple.FromField (FromField(..)) import Database.PostgreSQL.Simple.FromRow (FromRow, field, fromRow) import Database.PostgreSQL.Simple.ToField (ToField(..)) import Database.PostgreSQL.Simple....
null
https://raw.githubusercontent.com/sboehler/servant-starter-app/ebcd90ba0ec8e7ed411ebeb5ef2119e6000cc398/src/Types/Entity.hs
haskell
A type family for database ids A wrapper for models
module Types.Entity ( Entity(..) , Id ) where import Data.Aeson (ToJSON, (.=), object, toJSON) import Database.PostgreSQL.Simple.FromField (FromField(..)) import Database.PostgreSQL.Simple.FromRow (FromRow, field, fromRow) import Database.PostgreSQL.Simple.ToField (ToField(..)) import Database.PostgreSQL.Simple....
b63acd1475f23e90cd42171b5bb6246c15f12f8c7a55cc574d4924c9057afcc6
tdammers/sprinkles
TemplateContext.hs
# LANGUAGE DeriveGeneric # # LANGUAGE NoImplicitPrelude # {-#LANGUAGE OverloadedStrings #-} # LANGUAGE OverloadedLists # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeApplications # module Web.Spri...
null
https://raw.githubusercontent.com/tdammers/sprinkles/a9161e4506427a3cf5f686654edc7ed9aa3ea82b/src/Web/Sprinkles/TemplateContext.hs
haskell
#LANGUAGE OverloadedStrings # valid call, but category not implemented
# LANGUAGE DeriveGeneric # # LANGUAGE NoImplicitPrelude # # LANGUAGE OverloadedLists # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeApplications # module Web.Sprinkles.TemplateContext where impor...
b54484f0c7b796104295eed5c9ca0c911bf7ecb0ff88f4d42db0f381df86e0c2
bollu/koans
observer-pattern.hs
{-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE Rank2Types #-} # LANGUAGE TypeFamilies # {-# LANGUAGE GADTs #-} import Control.Applicative import Data.Traversable data Observer m e where MkObserver :: (e -> Maybe a) -> (a -> m ()) -> Observer m e data Event = KeyEvent Char | MouseEvent (Int, Int) data...
null
https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/observer-pattern.hs
haskell
# LANGUAGE ExplicitForAll # # LANGUAGE Rank2Types # # LANGUAGE GADTs #
# LANGUAGE TypeFamilies # import Control.Applicative import Data.Traversable data Observer m e where MkObserver :: (e -> Maybe a) -> (a -> m ()) -> Observer m e data Event = KeyEvent Char | MouseEvent (Int, Int) data Dispatcher m e = Dispatcher { observers :: [Observer m e] } runEvent :: Applic...
3277445e67a5cd108bd627ac9d4d01fcb3213ed94353cf640649127df3f05923
csabahruska/jhc-components
Desugar.hs
-- various desugaring routines -- -- The general desugaring routine creates selectors for data -- constructors with named fields, changes all pattern bindings -- into 'simple' pattern bindings, and adds failure cases to lambda -- expressions which have failable patterns module FrontEnd.Desugar (desugarHsModule, de...
null
https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-frontend/src/FrontEnd/Desugar.hs
haskell
various desugaring routines The general desugaring routine creates selectors for data constructors with named fields, changes all pattern bindings into 'simple' pattern bindings, and adds failure cases to lambda expressions which have failable patterns a new (unique) name introduced in pattern selector functions...
module FrontEnd.Desugar (desugarHsModule, desugarHsStmt) where import FrontEnd.HsSyn import FrontEnd.SrcLoc import FrontEnd.Syn.Traverse import Name.Names import Ty.Level import Util.Std import Util.UniqueMonad type PatSM = Uniq instance MonadSrcLoc PatSM where instance MonadSetSrcLoc PatSM where withSrcLoc' _ ...
cf5c0f8f9215847b9cb374bf062a3e297399cabd8e22831eca5497a19775ba57
yutopp/rill
sema_type.ml
* Copyright yutopp 2017 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2017 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
null
https://raw.githubusercontent.com/yutopp/rill/375b67c03ab2087d0a2a833bd9e80f3e51e2694f/rillc/_migrating/sema_type.ml
ocaml
* exclude parameters which are not required to call. * (Ex. has a default value) * Currently, it is not supported.
* Copyright yutopp 2017 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2017 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
8f4636417d0af3baf97d0d71ddfc0313294edebe6ee77fe4ca8a43408481b9cf
erikd/system-linux-proc
test-io.hs
import Hedgehog.Main (defaultMain) import qualified Test.System.Linux.Proc main :: IO () main = defaultMain [ Test.System.Linux.Proc.tests ]
null
https://raw.githubusercontent.com/erikd/system-linux-proc/b5fc50b0e9f2b28a92c3152908799e53ae16589e/test/test-io.hs
haskell
import Hedgehog.Main (defaultMain) import qualified Test.System.Linux.Proc main :: IO () main = defaultMain [ Test.System.Linux.Proc.tests ]
4dfb25a455c2f537821a1ade0d76008dce7b76a61f546e151263e74c3132b3da
cgrand/regex
charset.clj
(ns net.cgrand.regex.charset (:refer-clojure :exclude [complement * + - not contains?])) (defprotocol Rangeable (ranges [cs])) (defprotocol Charsetable (charset [x])) (extend-protocol Rangeable String (ranges [s] (map vector s s)) Character (ranges [c] [[c c]]) java.lang.Number (ranges [n] [[n n]])...
null
https://raw.githubusercontent.com/cgrand/regex/200ce13e07b7c4da67b2d2dafc9f708cffeec66c/src/net/cgrand/regex/charset.clj
clojure
(ns net.cgrand.regex.charset (:refer-clojure :exclude [complement * + - not contains?])) (defprotocol Rangeable (ranges [cs])) (defprotocol Charsetable (charset [x])) (extend-protocol Rangeable String (ranges [s] (map vector s s)) Character (ranges [c] [[c c]]) java.lang.Number (ranges [n] [[n n]])...
06a1df9dbe8a5a652ab9208cd62caa186b9eecd6de4e8b881f633c99c316d1cc
tezos-checker/checker
burrow.ml
open FixedPoint open Kit open Tok open Parameters open LiquidationAuctionPrimitiveTypes open Constants open Error open Common [@@@coverage off] type burrow = { (* Whether the creation deposit for the burrow has been paid. If the * creation deposit has been paid, the burrow is considered "active" and * "cl...
null
https://raw.githubusercontent.com/tezos-checker/checker/f8604c1493c2ecf94b17ebc35346d59f5028ecaa/src/burrow.ml
ocaml
Whether the creation deposit for the burrow has been paid. If the * creation deposit has been paid, the burrow is considered "active" and * "closed"/inactive otherwise. Paying the creation deposit re-activates * a "closed" burrow. Address of the contract holding the burrow's collateral. Collateral c...
open FixedPoint open Kit open Tok open Parameters open LiquidationAuctionPrimitiveTypes open Constants open Error open Common [@@@coverage off] type burrow = active : bool; address: Ligo.address; collateral : tok; outstanding_kit : kit; adjustment_index : fixedpoint; collateral_at_auction : to...
c3514c310602a461500a4dcd64d7a25a3115a9a6e01aea9089cdbb860d2f5cb9
abyala/advent-2021-clojure
day09_test.clj
(ns advent-2021-clojure.day09-test (:require [clojure.test :refer :all] [advent-2021-clojure.day09 :refer :all])) (def test-input "2199943210\n3987894921\n9856789892\n8767896789\n9899965678") (def puzzle-input (slurp "resources/day09_data.txt")) (deftest part1-test (are [expected input] (= expected (p...
null
https://raw.githubusercontent.com/abyala/advent-2021-clojure/5e01dec4963cb87a738d389893674eeb13aea42b/test/advent_2021_clojure/day09_test.clj
clojure
(ns advent-2021-clojure.day09-test (:require [clojure.test :refer :all] [advent-2021-clojure.day09 :refer :all])) (def test-input "2199943210\n3987894921\n9856789892\n8767896789\n9899965678") (def puzzle-input (slurp "resources/day09_data.txt")) (deftest part1-test (are [expected input] (= expected (p...
d4c52eceba9e30dc67ff09b1b8981a9856b4ba331e923c53bfac948fc67db2c5
helins/wasm.cljc
decompile.clj
Decompiling and pretty printing a WASM program such as " my_program.wasm " : ;; ;; $ bb decompile.clj my_program.wasm ;; Following WASM specs 1.1 , compatible with > = 0.3.5 (require '[babashka.deps :as deps]) (deps/add-deps '{:deps {io.helins/wasm {:mvn/version "0.0.0-alpha2"}}}) (require 'clojure.pprint ...
null
https://raw.githubusercontent.com/helins/wasm.cljc/bef1393899089763e0114aefbaec6303838ec7a0/src/babashka/decompile.clj
clojure
$ bb decompile.clj my_program.wasm
Decompiling and pretty printing a WASM program such as " my_program.wasm " : Following WASM specs 1.1 , compatible with > = 0.3.5 (require '[babashka.deps :as deps]) (deps/add-deps '{:deps {io.helins/wasm {:mvn/version "0.0.0-alpha2"}}}) (require 'clojure.pprint '[helins.wasm :as wasm]) (-> *command-...
02b19ee4387a2954b4140385a8ad7be953d77bdbe930d0d13a4aa4db5cead401
cunger/pythia
utils.clj
(ns setup.utils (:require [clojure.java.io :as io] [clojure.set :as set])) ;; IO (defn files-in [dir-name] (rest (file-seq (io/file dir-name)))) (defn file-name-matches? [re file] (not (nil? (re-find re (.getName file))))) (defn strip-src [file-name] (clojure.string/replace file-name "src/" ""...
null
https://raw.githubusercontent.com/cunger/pythia/f58e35395968d4c46aef495fd363c26b1102003c/src/setup/utils.clj
clojure
IO LIST ARRAY case where no equivalence class for x was found case where c is an equivalence for x case where c is not an equivalence class for x collapses all arrays that differ at most in values for keys-to-collapse STRING
(ns setup.utils (:require [clojure.java.io :as io] [clojure.set :as set])) (defn files-in [dir-name] (rest (file-seq (io/file dir-name)))) (defn file-name-matches? [re file] (not (nil? (re-find re (.getName file))))) (defn strip-src [file-name] (clojure.string/replace file-name "src/" "")) (de...
229eeb0e49f6e78b8ff201188426bc365081e9664fcb3391fe83878f5a882bbf
VincentToups/racket-lib
lofi-graphics.rkt
#lang racket (require racket/gui racket/class racket/dict utilities/sprite-loading) (define character-sheet "./oryx-lofi/x4-lofi_char.png") (define character-sheet-type 'png/alpha) (define x4-characters (make-hash)) (dict-set! x4-characters 'normal-0-0 (load-image character-shee...
null
https://raw.githubusercontent.com/VincentToups/racket-lib/d8aed0959fd148615b000ceecd7b8a6128cfcfa8/roguelikes/lofi-graphics.rkt
racket
#lang racket (require racket/gui racket/class racket/dict utilities/sprite-loading) (define character-sheet "./oryx-lofi/x4-lofi_char.png") (define character-sheet-type 'png/alpha) (define x4-characters (make-hash)) (dict-set! x4-characters 'normal-0-0 (load-image character-shee...
c0b3b77e90a795c4bdedc94e9c9c23ddd99f5b47b45506b1370b7fdfa449c2b6
acl2/acl2
remove-guard-holders.lisp
Copyright ( C ) 2021 , ForrestHunt , Inc. Written by License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 . ; This book was renamed from file remove-guard-holders-strong-3.lsp in late January , 2023 and also significantly expanded from that file . ; This book contains progress t...
null
https://raw.githubusercontent.com/acl2/acl2/eb1c548cabe41b555e80af3a52296c306694d168/books/system/remove-guard-holders.lisp
lisp
This book was renamed from file remove-guard-holders-strong-3.lsp in late This book contains progress towards converting ACL2 source function remove-guard-holders from :program mode to guard-verified :logic mode. (Note that :logic mode ACL2 source functions must be guard-verified.) See the book remove-guard-hold...
Copyright ( C ) 2021 , ForrestHunt , Inc. Written by License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 . January , 2023 and also significantly expanded from that file . (in-package "ACL2") (include-book "tools/flag" :dir :system) (include-book "remove-guard-holders1") (in...
5a8372b5bd77b87f6eda680a97e0a6c8b5004bb94482d097a5884c1ac782ede3
xapi-project/xen-api
lwt_support.mli
* Copyright ( C ) 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 described in file LI...
null
https://raw.githubusercontent.com/xapi-project/xen-api/ade9c3eb5a64fdc06880ffae75c4de86d266de6a/ocaml/wsproxy/src/lwt_support.mli
ocaml
* Really write a string to a file descriptor - repeats until the whole string is done * Read from an Lwt fd and send the chunks to an iteratee * Read from a named file and send the chunks to an iteratee * Given a file descriptor (Lwt), it executes the function [callback] passing it the connected file descri...
* Copyright ( C ) 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 described in file LI...
fb26d41902982ffd2bc6627ff3f304916ae633571c45bf7889ff35fcdaf9f347
PKUHelper/pkuipgw
locale.clj
(ns pkuipgw.locale (:require [clojure.java.io :as io]) (:require [cheshire.core :as json])) (def ^:private home-path (System/getProperty "user.home")) (def ^:private config-path (str home-path "/.pkuipgwconfig")) (defn- config-exist? [] (.exists (io/file config-path))) (defn load-config [] (if (config-exist?)...
null
https://raw.githubusercontent.com/PKUHelper/pkuipgw/fe602c892cf047ab8b95dce2b8bc4190a814c387/src/pkuipgw/locale.clj
clojure
(ns pkuipgw.locale (:require [clojure.java.io :as io]) (:require [cheshire.core :as json])) (def ^:private home-path (System/getProperty "user.home")) (def ^:private config-path (str home-path "/.pkuipgwconfig")) (defn- config-exist? [] (.exists (io/file config-path))) (defn load-config [] (if (config-exist?)...
d1c8f97c0f0c4873d68ff05cc416af5959607335b23e009210ddf17c69ed2a40
hlprmnky/ion-appsync-example
node_pages.clj
(ns ^{:doc "Generation of AWS Cloudformation templates which provide html pages running in Node.js Lambdas."} cf.node-pages (:require [crucible.core :refer [template parameter resource output xref encode join sub region account-id]] [crucible.aws.s3 :as s3] [crucible.aws.iam :as iam] [crucible.aws.lam...
null
https://raw.githubusercontent.com/hlprmnky/ion-appsync-example/76a3dcfcf2d09c066a8d4dac7f1e930f79fb1237/src-pages/cf/node_pages.clj
clojure
used to create lambdas without real code loaded Important! Lambda must be invoked using a POST using join instead of sub because once fixed, then use (sub "${Application}-home-page") defined as a vars so that the Crucible lein task can be used to generate
(ns ^{:doc "Generation of AWS Cloudformation templates which provide html pages running in Node.js Lambdas."} cf.node-pages (:require [crucible.core :refer [template parameter resource output xref encode join sub region account-id]] [crucible.aws.s3 :as s3] [crucible.aws.iam :as iam] [crucible.aws.lam...
22c1d8081035bc4cf7cf867856661acdf850c0bc116a96a517b5d9b82933fdba
geophf/1HaskellADay
Exercise.hs
module Y2021.M04.D28.Exercise where - This is interesting > > > Nothing > Just 70 False > > > Nothing < Just 70 True ... huh . So Nothing is ... Just 0 ? That , for me , is n't good . I do n't want something to succeed when I have only partial data . me . So , we have some functions that take t...
null
https://raw.githubusercontent.com/geophf/1HaskellADay/613e0ec29b256f276fde29897e9b64c1a8f9ef73/exercises/HAD/Y2021/M04/D28/Exercise.hs
haskell
} note: you may have some, or all, trending data. And you have function-type that takes trending data and returns a buy/sell recommendation } Now we have recommendation functions to set up, we need functions that compare data in the monadic domain 'less than' 'greater than' 'and' for monadic booleans now, defi...
module Y2021.M04.D28.Exercise where - This is interesting > > > Nothing > Just 70 False > > > Nothing < Just 70 True ... huh . So Nothing is ... Just 0 ? That , for me , is n't good . I do n't want something to succeed when I have only partial data . me . So , we have some functions that take t...
55fdd13f3f9cabf065e62fcbb8f444196808f33781997366a12568f6ec194726
haskell-works/avro
Int64Spec.hs
# LANGUAGE DeriveGeneric # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} # LANGUAGE StrictData # # LANGUAGE TemplateHaskell # module Avro.Codec.Int64Spec (spec) where import Data.Avro.Internal.Zig (zig) import Data.Bits import Data.ByteString.Build...
null
https://raw.githubusercontent.com/haskell-works/avro/9eb4970fd72939a68aa6f947d3d2dc17280352f8/test/Avro/Codec/Int64Spec.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE QuasiQuotes #
# LANGUAGE DeriveGeneric # # LANGUAGE StrictData # # LANGUAGE TemplateHaskell # module Avro.Codec.Int64Spec (spec) where import Data.Avro.Internal.Zig (zig) import Data.Bits import Data.ByteString.Builder import qualified Data.ByteString.Lazy as BL import Dat...
fcb22f0326047619bf34137801e74cc733aabe22a7c24ff9168e3b408b25f0f7
agrafix/funblog
Post.hs
{-# LANGUAGE OverloadedStrings #-} module Web.Forms.Post where import Model.CoreTypes import Data.Time import Text.Blaze.Html (Html) import Text.Digestive hiding (Post) import Text.Digestive.Bootstrap postForm :: Monad m => UTCTime -> Form Html m Post postForm now = Post <$> "title" .: text Nothing <*> ...
null
https://raw.githubusercontent.com/agrafix/funblog/d401fb61aef9a0d8310b767f44893ee7b13015c7/src/Web/Forms/Post.hs
haskell
# LANGUAGE OverloadedStrings #
module Web.Forms.Post where import Model.CoreTypes import Data.Time import Text.Blaze.Html (Html) import Text.Digestive hiding (Post) import Text.Digestive.Bootstrap postForm :: Monad m => UTCTime -> Form Html m Post postForm now = Post <$> "title" .: text Nothing <*> "date" .: stringRead "Couldn't pars...
fb735bf3d456bd2e73ebdc4ccac90f55c7b91f40524a00edf9a51b779e106026
rescript-lang/rescript-compiler
ext_string.ml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2017 - , Authors of ReScript * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/81a3dc63ca387b2af23fed297db283254ae3ab20/jscomp/ext/ext_string.ml
ocaml
{[ split " test_unsafe_obj_ffi_ppx.cmi" ~keep_empty:false ' ']} * return an index which is minus when [s] does not end with [beg] let check_suffix_case = ends_with it is unsafe to expose such API as unsafe since user can provide bad input range * TODO: optimize avoid nonterminating when strin...
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2017 - , Authors of ReScript * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the...
d1a62496a0360d3a9bfbd1a2d453864843e8232c07020eccd4bb9e0b0c16038e
janestreet/async_unix
writer_intf.ml
open! Core open! Import module type Writer0 = sig * [ Writer ] is Async 's main API for output to a file descriptor . It is the analog of [ Core . Out_channel ] . Each writer has an internal buffer , to which [ Writer.write * ] adds data . Each writer uses an Async cooperative thread that ma...
null
https://raw.githubusercontent.com/janestreet/async_unix/e5d9e9d388a23237cec3bf42d7e310c459de4309/src/writer_intf.ml
ocaml
* default is [true] * default is [Unix] * default is [Time_source.wall_clock ()] * [set_buffer_age_limit t buffer_age_limit] replaces the existing buffer age limit with the new one. This is useful for stdout and stderr, which are lazily created in a context that does not allow applications to specify [b...
open! Core open! Import module type Writer0 = sig * [ Writer ] is Async 's main API for output to a file descriptor . It is the analog of [ Core . Out_channel ] . Each writer has an internal buffer , to which [ Writer.write * ] adds data . Each writer uses an Async cooperative thread that ma...
7877fd7bc10733ac914121a338c6f3ff504f48e683380e775d59611864bc3c8c
gafiatulin/codewars
FakeBinary.hs
-- Fake Binary module Codewars.Kata.FakeBinary where fakeBin :: String -> String fakeBin = map (\c -> if c < '5' then '0' else '1' )
null
https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/8%20kyu/FakeBinary.hs
haskell
Fake Binary
module Codewars.Kata.FakeBinary where fakeBin :: String -> String fakeBin = map (\c -> if c < '5' then '0' else '1' )
8d55af5e13401e36d629bd26a2d10f632d38f1504b0e9635bf4d0cdc2d319c3b
Clozure/ccl
x86-numbers.lisp
-*- Mode : Lisp ; Package : CCL -*- ;;; Copyright 1994 - 2009 Clozure Associates ;;; 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 appl...
null
https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-0/X86/x86-numbers.lisp
lisp
Package : CCL -*- 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 la...
Copyright 1994 - 2009 Clozure Associates distributed under the License is distributed on an " AS IS " BASIS , (in-package "CCL") #+x8664-target (progn (defx86lapfunction %fixnum-signum ((number arg_z)) (movq ($ '-1) (% arg_x)) (movq ($ '1) (% arg_y)) (testq (% number) (% number)) (cmovsq (% arg_x) (% ...
e50bd93be34af9e142cdd61b30b8e13f55bdb5c5c6d2037872afcbe5ad196ac4
bytekid/mkbtt
selectionLexer.ml
# 20 "selectionLexer.mll" (* lexing selection strategies *) open SelectionParser # 7 "selectionLexer.ml" let __ocaml_lex_tables = { Lexing.lex_base = "\000\000\233\255\234\255\235\255\236\255\237\255\238\255\239\255\ \241\255\243\255\244\255\245\255\246\255\247\255\000\000\000\000\ \000\000\000\000\0...
null
https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mascott/src/selectionLexer.ml
ocaml
lexing selection strategies
# 20 "selectionLexer.mll" open SelectionParser # 7 "selectionLexer.ml" let __ocaml_lex_tables = { Lexing.lex_base = "\000\000\233\255\234\255\235\255\236\255\237\255\238\255\239\255\ \241\255\243\255\244\255\245\255\246\255\247\255\000\000\000\000\ \000\000\000\000\000\000\001\000\002\000\000\000\001\...
5e0668d4201e91c0fdcb0a161b76c3d6a7680daedb723f8aa22916847ce95317
YoshikuniJujo/funpaala
useSome.hs
import Some d :: Int d = a * b
null
https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/24_adt_module/useSome.hs
haskell
import Some d :: Int d = a * b
6763ef0e06042b76e3714b37bc6b78bb88efbdebb25f8f2068fb8541e2362526
ndmitchell/hlint
Brackets.hs
# LANGUAGE MultiParamTypeClasses , FlexibleInstances , FlexibleContexts # # OPTIONS_GHC -Wno - incomplete - patterns -Wno - overlapping - patterns # module GHC.Util.Brackets (Brackets(..), isApp,isOpApp,isAnyApp) where import GHC.Hs import GHC.Types.SrcLoc import GHC.Types.SourceText import Language.Haskell.GhclibPar...
null
https://raw.githubusercontent.com/ndmitchell/hlint/d06148be027179469333a892294fb7a90b9ea51c/src/GHC/Util/Brackets.hs
haskell
Write out a paren. | Is this item lexically requiring no bracketing ever i.e. is totally atomic. | Is the child safe free from brackets in the parent position. Err on the side of caution, True = don't know. 'HsPar (Section[L|R])'. There is no concrete syntax that will result in a "naked" section. Consequently, g...
# LANGUAGE MultiParamTypeClasses , FlexibleInstances , FlexibleContexts # # OPTIONS_GHC -Wno - incomplete - patterns -Wno - overlapping - patterns # module GHC.Util.Brackets (Brackets(..), isApp,isOpApp,isAnyApp) where import GHC.Hs import GHC.Types.SrcLoc import GHC.Types.SourceText import Language.Haskell.GhclibPar...
f564d08b2dc83049e5bc9777be26252bda59f9150aeeebef3de7e63b2bd78ff8
c4-project/c4f
atomic_cmpxchg.mli
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
null
https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/fir/src/atomic_cmpxchg.mli
ocaml
* Atomic compare-exchange operations. Atomic compare-exchanges can appear in statement position (where the boolean output is ignored) or expression position (where it isn't). Because of the possibility of them being in expressions, most of this module is parametric on an expression type to avoid cycles...
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
eeb98cbd463fbd0cc6053dced7b1794efb2c47320a0d7297860ecce1f59ed182
chshersh/iris
Mode.hs
module Test.Iris.Colour.Mode (modeSpec) where import Data.Foldable (for_) import System.Environment (setEnv, unsetEnv) import System.IO (stderr, stdout) import Test.Hspec (Spec, before_, describe, it, shouldReturn) import Iris.Cli.Colour (ColourOption (..)) import Iris.Colour.Mode (ColourMode (..), detectColourMode) ...
null
https://raw.githubusercontent.com/chshersh/iris/8d5627284ac6b6814c6e026d709fde9ac07656a8/test/Test/Iris/Colour/Mode.hs
haskell
Helper functions
module Test.Iris.Colour.Mode (modeSpec) where import Data.Foldable (for_) import System.Environment (setEnv, unsetEnv) import System.IO (stderr, stdout) import Test.Hspec (Spec, before_, describe, it, shouldReturn) import Iris.Cli.Colour (ColourOption (..)) import Iris.Colour.Mode (ColourMode (..), detectColourMode) ...
363383168179953cbbee4df0e321c44b2daa72385d45b40364cadbbfd7d57d6c
fieldstrength/aeson-deriving
Main.hs
{-# Language DerivingVia #-} {-# Language DataKinds #-} {-# Language TemplateHaskell #-} {-# Language DeriveAnyClass #-} {-# Language DuplicateRecordFields #-} module Main where import Data.Aeson import Data.Aeson.Deriving import Data.Foldable (for_) import Data.Aeson.Deriving.Text.Unsafe import Data.Text import GHC....
null
https://raw.githubusercontent.com/fieldstrength/aeson-deriving/861dc8ebc05792a0924e8fe6aae2ae41a59fc751/test/Main.hs
haskell
# Language DerivingVia # # Language DataKinds # # Language TemplateHaskell # # Language DeriveAnyClass # # Language DuplicateRecordFields # An example of how to require a particular constant object
module Main where import Data.Aeson import Data.Aeson.Deriving import Data.Foldable (for_) import Data.Aeson.Deriving.Text.Unsafe import Data.Text import GHC.Generics import Hedgehog import Hedgehog.Main (defaultMain) main :: IO () main = defaultMain [checkParallel $$(discover)] type IdiomaticEncoded = GenericEnc...
a27af0c943291fc5c655993cfdbed7239cc286dd86b3963b2ffa333197fa81d8
tezos/tezos-mirror
durable_operations_generator.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2023 TriliTech < > (* ...
null
https://raw.githubusercontent.com/tezos/tezos-mirror/a305d9ded27e234c7937fce7adfc1f199196283a/src/lib_scoru_wasm/test/helpers/durable_operations_generator.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2023 TriliTech < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHE...
562ebc39abf8072d11a2f8f67131202dd1545204022ade99560aaa2d69d81c76
tweag/sparkle
Main.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE StaticPointers # module Main where import Control.Distributed.Closure import Control.Distributed.Spark as RDD import qualified Data.Text as Text main :: IO () main = forwardUnhandledExceptionsToSpark $ do conf <- newSparkConf "RDD operations demo" sc <- getOrCr...
null
https://raw.githubusercontent.com/tweag/sparkle/7ad678c6830cfe689b3bed03e008728e59c40cfc/apps/rdd-ops/Main.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE StaticPointers # module Main where import Control.Distributed.Closure import Control.Distributed.Spark as RDD import qualified Data.Text as Text main :: IO () main = forwardUnhandledExceptionsToSpark $ do conf <- newSparkConf "RDD operations demo" sc <- getOrCreateSparkContext conf rdd <- p...
1820a171f1c1543cff0eab752ebdf8ca690b540fe89b1b834d3fd5225b709ad9
imandra-ai/fix-engine
bench_engine_decode.ml
open Lwt.Syntax (* ony block of test data *) let test_data : string = Test_engine_data.fix_data |> String.split_on_char '\n' |> List.map String.trim |> List.filter (fun s -> s <> "") |> String.concat "" (* reference implementation *) module Ref = struct open Lwt.Infix Converts [ ' 5 ' ; ' 2 ' ; ' = ' ; ' A...
null
https://raw.githubusercontent.com/imandra-ai/fix-engine/42f3c4f3ca432469969e89e461ca76b52c21f282/tests/benchs/engine/bench_engine_decode.ml
ocaml
ony block of test data reference implementation channel reading [n] copies of [test_data] see if we still have bytes to read from [test_data] how many bytes to copy Printf.printf "read %d messages\n%!" _count ; Printf.printf "read %d messages\n%!" _count ;
open Lwt.Syntax let test_data : string = Test_engine_data.fix_data |> String.split_on_char '\n' |> List.map String.trim |> List.filter (fun s -> s <> "") |> String.concat "" module Ref = struct open Lwt.Infix Converts [ ' 5 ' ; ' 2 ' ; ' = ' ; ' A ' ] to ( " 52 " , " A " ) let extract_key_value (chlist :...
eb761cad53683e78eff2f87ab3bc1fee675daecfe3a951c64211587fa12324c9
mariari/Misc-Lisp-Scripts
draw.lisp
(defpackage :clim-yaml (:use :clim :clim-lisp :cl-user) (:export main-gui)) (in-package :clim-yaml) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass stack-yaml-view (view) ((%yaml :initarg :stack-yam...
null
https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/8ab235865227bae0f249b3938b819f6c6420f92a/projects/haskell-yaml-generator/gui/draw.lisp
lisp
Types Main Application Filtered version of the function. Could call #'cl-user::stack-yaml-packages if one wants madness of arrows! Filtering Children Packages Could be done more generally by getting the list of children, then disjoint union Commands Presentation Color Drawing Dragging functionali...
(defpackage :clim-yaml (:use :clim :clim-lisp :cl-user) (:export main-gui)) (in-package :clim-yaml) (defclass stack-yaml-view (view) ((%yaml :initarg :stack-yaml :reader stack-yaml))) (defclass stack-yaml-object-wraper () ((%yaml :initarg :stack-yaml :reader stack-yaml))) (defclass show-view (view) ()) (d...
cbc452613e5c70a4617959a2dcde84407e023ad2e0181120d631c7cca326ab6c
alsonkemp/turbinado-website
Home.hs
module App.Controllers.Home where import Turbinado.Controller index :: Controller () index = return () performance :: Controller () performance = return () install :: Controller () install = return () architecture :: Controller () architecture= return () hello :: Controller () hello = clearLayout
null
https://raw.githubusercontent.com/alsonkemp/turbinado-website/310f38dd7d13cdb838e2ea6181c61521021c32b5/App/Controllers/Home.hs
haskell
module App.Controllers.Home where import Turbinado.Controller index :: Controller () index = return () performance :: Controller () performance = return () install :: Controller () install = return () architecture :: Controller () architecture= return () hello :: Controller () hello = clearLayout
e18162b6799b40ec2b9d9823a4ac7aeb4166a620cbb273e80fe049c7a2788f7e
composewell/streamly-coreutils
Dirname.hs
-- | Module : Streamly . Coreutils . Dirname Copyright : ( c ) 2022 Composewell Technologies -- License : BSD-3-Clause -- Maintainer : -- Stability : experimental Portability : GHC -- Strip the last component from file name . module Streamly.Coreutils.Dirname (dirname) where import System...
null
https://raw.githubusercontent.com/composewell/streamly-coreutils/0a80210f2bbe63c5400682d23e6b1d5a18c11c3d/src/Streamly/Coreutils/Dirname.hs
haskell
| License : BSD-3-Clause Maintainer : Stability : experimental
Module : Streamly . Coreutils . Dirname Copyright : ( c ) 2022 Composewell Technologies Portability : GHC Strip the last component from file name . module Streamly.Coreutils.Dirname (dirname) where import System.FilePath (takeDirectory) dirname :: FilePath -> FilePath dirname = takeDirectory
9b0fc3d883e329ccaa58c1b654056334823cb0deccb5183237d41ebd48aa1a97
csabahruska/jhc-components
TypeCheck.hs
module E.TypeCheck( canBeBox, eAp, inferType, infertype, typecheck, match, sortSortLike, sortKindLike, sortTermLike, sortTypeLike, typeInfer, typeInfer' ) where import Control.Monad.Reader import Control.Monad.Writer import qualified Data.Map as Map import Doc.DocLi...
null
https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-core/src/E/TypeCheck.hs
haskell
# SOURCE # # SOURCE # sort kind sort superkind sort box functions from values to values are boxed and lazy functions from values to unboxed tuples are boxed and lazy functions from unboxed tuples to values are boxed and strict functions from unboxed tuples to unboxed tuples are boxed and strict may have ...
module E.TypeCheck( canBeBox, eAp, inferType, infertype, typecheck, match, sortSortLike, sortKindLike, sortTermLike, sortTypeLike, typeInfer, typeInfer' ) where import Control.Monad.Reader import Control.Monad.Writer import qualified Data.Map as Map import Doc.DocLi...
cfd5070ff15dd69684e388efa7fe1ff6c0159b651bfbb8f08a229f9260432107
yminer/libml
backpropCommonVisitor.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [ LibML - Machine Learning Library ] Copyright ( C ) 2002 - 2003 LAGACHERIE This program is free software ; you can redistribute it and/or modify it under the te...
null
https://raw.githubusercontent.com/yminer/libml/1475dd87c2c16983366fab62124e8bbfbbf2161b/src/nn/propagate/backpropCommonVisitor.ml
ocaml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [ LibML - Machine Learning Library ] Copyright ( C ) 2002 - 2003 LAGACHERIE This program is free software ; you can redistribute it and/or modify it under the te...
4105e55fc76f760d84a71e04af61f176fbb850f48fb4a7625e8ff319065db1ec
haskus/haskus-system
Diagrams.hs
# LANGUAGE FlexibleContexts # module Demo.Diagrams ( topBarDiag , infoPageDiag , customPage ) where import Haskus.System import Haskus.System.Graphics.Diagrams import Haskus.Format.String import Haskus.System.Linux.Info -- | Top-bar topBarDiag :: Float -> Float -> VDiagram topBarDiag screenWidth _screenH...
null
https://raw.githubusercontent.com/haskus/haskus-system/38b3a363c26bc4d82e3493d8638d46bc35678616/haskus-system-examples/src/demo/Demo/Diagrams.hs
haskell
| Top-bar bar background button + label button button background button text label text
# LANGUAGE FlexibleContexts # module Demo.Diagrams ( topBarDiag , infoPageDiag , customPage ) where import Haskus.System import Haskus.System.Graphics.Diagrams import Haskus.Format.String import Haskus.System.Linux.Info topBarDiag :: Float -> Float -> VDiagram topBarDiag screenWidth _screenHeight = diag ...
1ce5d5af1e9738b48c781a7b0462e58e942ecde206ef35a4201dd4012f70425f
tek/ribosome
TestConfig.hs
module Ribosome.Host.Test.Data.TestConfig where import Ribosome.Host.Data.HostConfig (HostConfig (HostConfig), dataLogConc) data TestConfig = TestConfig { freezeTime :: Bool, host :: HostConfig } deriving stock (Eq, Show, Generic) instance Default TestConfig where def = TestConfig False (HostConf...
null
https://raw.githubusercontent.com/tek/ribosome/a676b4f0085916777bfdacdcc761f82d933edb80/packages/host-test/lib/Ribosome/Host/Test/Data/TestConfig.hs
haskell
module Ribosome.Host.Test.Data.TestConfig where import Ribosome.Host.Data.HostConfig (HostConfig (HostConfig), dataLogConc) data TestConfig = TestConfig { freezeTime :: Bool, host :: HostConfig } deriving stock (Eq, Show, Generic) instance Default TestConfig where def = TestConfig False (HostConf...
908e394089d6cc06ae0b814b22ea8e233cc6f06f93036f6d11d0858afb515e9f
HumbleUI/HumbleUI
settings.clj
(ns examples.settings (:require [examples.state :as state] [io.github.humbleui.debug :as debug] [io.github.humbleui.paint :as paint] [io.github.humbleui.ui :as ui])) (def ui (ui/with-scale scale (let [padding-inner 12 fill-bg (paint/fill 0xFFF2F2F2) stroke-bg (p...
null
https://raw.githubusercontent.com/HumbleUI/HumbleUI/5bf5e2a47bf99818c6e7f712c43462d4ecb6254c/dev/examples/settings.clj
clojure
(ns examples.settings (:require [examples.state :as state] [io.github.humbleui.debug :as debug] [io.github.humbleui.paint :as paint] [io.github.humbleui.ui :as ui])) (def ui (ui/with-scale scale (let [padding-inner 12 fill-bg (paint/fill 0xFFF2F2F2) stroke-bg (p...
8a4b3a3b2bb130c83c01f0244b902cbb63e4dfa490e3cbec760fd95e7f238a42
clojerl/clojerl
clojerl.Future.erl
-module('clojerl.Future'). -include("clojerl.hrl"). -include("clojerl_int.hrl"). -behaviour(gen_server). -behavior('erlang.io.ICloseable'). -behavior('clojerl.IBlockingDeref'). -behavior('clojerl.IDeref'). -behavior('clojerl.IEquiv'). -behavior('clojerl.IHash'). -behavior('clojerl.IPending'). -behavior('clojerl.IStr...
null
https://raw.githubusercontent.com/clojerl/clojerl/506000465581d6349659898dd5025fa259d5cf28/src/erl/lang/clojerl.Future.erl
erlang
eval gen_server callbacks ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ clojerl.ICloseable clojerl.IDeref clojerl.IEquiv clojerl.IPending clojerl.IStringable -------------------------------------------...
-module('clojerl.Future'). -include("clojerl.hrl"). -include("clojerl_int.hrl"). -behaviour(gen_server). -behavior('erlang.io.ICloseable'). -behavior('clojerl.IBlockingDeref'). -behavior('clojerl.IDeref'). -behavior('clojerl.IEquiv'). -behavior('clojerl.IHash'). -behavior('clojerl.IPending'). -behavior('clojerl.IStr...
4a2093ea6cb260c3b1b1519c19ec8f6bf61386e382ec7f9d30d9f20807386746
input-output-hk/cardano-wallet
Launcher.hs
# LANGUAGE CPP # {-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # # LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # # LANGUAGE ScopedTypeVariables # HLINT ignore " Unused LANGUAGE pragma " -- | Copyright : © 2018 - 2020 IOHK -- License: Apache-2.0 -- -- This module contains a mechanism for launching e...
null
https://raw.githubusercontent.com/input-output-hk/cardano-wallet/f8455ff02816acfef11131f6fbd6b11334309c2a/lib/launcher/src/Cardano/Launcher.hs
haskell
# LANGUAGE DeriveAnyClass # | License: Apache-2.0 This module contains a mechanism for launching external processes, ensuring that they are terminated on exceptions. * Logging are expected to be prefixed with `--` or `-`. For example: @ Command "cardano-wallet" [ "server" , "--network", "mainnet" ...
# LANGUAGE CPP # # LANGUAGE DeriveGeneric # # LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # # LANGUAGE ScopedTypeVariables # HLINT ignore " Unused LANGUAGE pragma " Copyright : © 2018 - 2020 IOHK module Cardano.Launcher ( Command (..) , StdStream(..) , ProcessHasExited(..) , withBackendProces...
49b618b759e36dab60e1581af7cbe4f464afb8bd469ea806d49f102bc30b67ba
babashka/babashka
test_util.cljc
(ns lambdaisland.regal.test-util (:require [lambdaisland.regal :as regal]) #?(:cljs (:require-macros [lambdaisland.regal.test-util :refer [inline-resource]]) :clj (:require [clojure.java.io :as io] [clojure.test.check.generators :as gen] [lambdaisland.r...
null
https://raw.githubusercontent.com/babashka/babashka/665ae4dd97535bf72a5ce34a19d624e74e5c4fe8/test-resources/lib_tests/lambdaisland/regal/test_util.cljc
clojure
BB-TEST-PATCH: Don't have this dependency BB-TEST-PATCH: bb doesn't have Pattern class BB-TEST-PATCH: Uses ns that can't load This should eventually be moved to lambdaisland.regal.generator when we have our own charset implementation
(ns lambdaisland.regal.test-util (:require [lambdaisland.regal :as regal]) #?(:cljs (:require-macros [lambdaisland.regal.test-util :refer [inline-resource]]) :clj (:require [clojure.java.io :as io] [clojure.test.check.generators :as gen] [lambdaisland.r...
7d3a21fda494ae278da6c56853504eb8d72a7db6adc60c2ff34807a85801dca0
brownplt/lambda-py
python-tools.rkt
#lang racket/base (require racket/pretty "get-structured-python.rkt" "python-interp.rkt" "python-phases.rkt" "python-phase2.rkt" "python-phase1.rkt" "python-desugar.rkt" "python-cps.rkt" "python-macros.rkt" "python-lib.rkt" "run-...
null
https://raw.githubusercontent.com/brownplt/lambda-py/c3ee39502c8953d36b886e5a203f2eb51d2f495b/base/python-tools.rkt
racket
#lang racket/base (require racket/pretty "get-structured-python.rkt" "python-interp.rkt" "python-phases.rkt" "python-phase2.rkt" "python-phase1.rkt" "python-desugar.rkt" "python-cps.rkt" "python-macros.rkt" "python-lib.rkt" "run-...
b3a0c3fd9a75d56294e8be105b70d49248a2aff12a527d0ee0f9f9e9af788698
ds-wizard/engine-backend
Reference.hs
module Wizard.Service.KnowledgeModel.Squash.Event.Reference where import Shared.Model.Event.Reference.ReferenceEvent import Wizard.Service.KnowledgeModel.Squash.Event.Common instance SimpleEventSquash EditReferenceEvent where isSimpleEventSquashApplicable _ = True isReorderEventSquashApplicable _ _ = False -- ...
null
https://raw.githubusercontent.com/ds-wizard/engine-backend/c60bcc649d3d1aefe73d54ba990bcb024c8948eb/engine-wizard/src/Wizard/Service/KnowledgeModel/Squash/Event/Reference.hs
haskell
-------------------------------------- --------------------------------------
module Wizard.Service.KnowledgeModel.Squash.Event.Reference where import Shared.Model.Event.Reference.ReferenceEvent import Wizard.Service.KnowledgeModel.Squash.Event.Common instance SimpleEventSquash EditReferenceEvent where isSimpleEventSquashApplicable _ = True isReorderEventSquashApplicable _ _ = False isT...
e19ee85f8514e41bb0c7a1902da59509e24859837599f0ece66f1f6ce79c60fb
mransan/raft-udp
raft_app_srv.mli
(** Generic App server implementation *) * This module implements the protocol between the App sever and the Raft server generically . It is parametrized by a module which simply specify how to decode the Application specific transaction data . Raft server generically. It is parametrized by a mod...
null
https://raw.githubusercontent.com/mransan/raft-udp/ffa307fa6d8bdaa3133f3cc66149ac7dfda5fc7c/src/app/raft_app_srv.mli
ocaml
* Generic App server implementation * Module signature to be implemented by each specific application. * Data associated with each new log entry * Decoding function * Result data of the log application in the application * Encoding function * [start configuration] returns the continuous stream of request to ...
* This module implements the protocol between the App sever and the Raft server generically . It is parametrized by a module which simply specify how to decode the Application specific transaction data . Raft server generically. It is parametrized by a module which simply specify how to deco...
47597ef195d99c69e02391216bb3e6e74df04e140d41989d22ecfa64f80c1f4b
kadena-community/bag-of-holding
Test.hs
module Main ( main ) where import Data . Aeson ( decode , encode ) -- import Holding import RIO import Test.Tasty import Test . Tasty . HUnit ( Assertion , assertBool , ) --- main :: IO () main = defaultMain suites suites :: TestTree suites = testGroup "Tests" [ testGroup "Unit Tests" [ -- testCase "keys...
null
https://raw.githubusercontent.com/kadena-community/bag-of-holding/73aa21741b88d8af15e967d93d8cd2ea2605afa1/test/Test.hs
haskell
import Holding - testCase "keysJsonIso" keysJsonIso keysJsonIso :: Assertion keysJsonIso = do mks <- decode . encode . Hidden <$> keys assertBool "keysJsonIso failed" $ isJust (mks :: Maybe Keys)
module Main ( main ) where import Data . Aeson ( decode , encode ) import RIO import Test.Tasty import Test . Tasty . HUnit ( Assertion , assertBool , ) main :: IO () main = defaultMain suites suites :: TestTree suites = testGroup "Tests" [ testGroup "Unit Tests" ] ]
81faa0dbf435e2259e96dbb40a16573d170feb7307c927bd2744c523d74f729b
philnguyen/soft-contract
tree.rkt
#lang racket (provide tree-state lplaced% generate-tree tree-next hand-out? ) (require "../base/untyped.rkt" "board.rkt" "state.rkt" ) (require (only-in "basics.rkt" shares-available? shares-order? )) ;; ----------------------------------------------------------------------------- (struct hand-o...
null
https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/gradual-typing-benchmarks/acquire/tree.rkt
racket
----------------------------------------------------------------------------- HandOut = (hand-out t st) (tree<%>) (abstract next) template hook pattern: template template hook pattern: template hook how many transitions in THIS tree (up to depth n) satisfy the given predicate Nat [Listof ShareOrder] [Placed -> ...
#lang racket (provide tree-state lplaced% generate-tree tree-next hand-out? ) (require "../base/untyped.rkt" "board.rkt" "state.rkt" ) (require (only-in "basics.rkt" shares-available? shares-order? )) (struct hand-out ( tile tree)) denotes that player received tile t and st is the Tree ge...
6ff1aa543f57a76cd9520e74550f726afbf1276a237ce6de20d100d6859010f8
jackfirth/lens
syntax.rkt
#lang reprovide lens/private/syntax/main
null
https://raw.githubusercontent.com/jackfirth/lens/733db7744921409b69ddc78ae5b23ffaa6b91e37/lens-unstable/unstable/lens/syntax.rkt
racket
#lang reprovide lens/private/syntax/main
8b1fd6dde7a1de42dd2de914aca0f46d0e5bd1b0c4b1fed3ae387d6ba904aa3e
geremih/xcljb
common.clj
(ns xcljb.common) (defmulti read-reply (fn [ext-name opcode _] [ext-name opcode])) (defmulti read-event (fn [ext-name n _] [ext-name n])) (defmulti read-error (fn [ext-name n _] [ext-name n])) (defn padding [n] (rem (- 4 (rem n 4)) 4)) (defn bit-count [n] (.bitCount (BigInteger/valueOf n)))
null
https://raw.githubusercontent.com/geremih/xcljb/59e9ff795bf00595a3d46231a7bb4ec976852396/src/xcljb/common.clj
clojure
(ns xcljb.common) (defmulti read-reply (fn [ext-name opcode _] [ext-name opcode])) (defmulti read-event (fn [ext-name n _] [ext-name n])) (defmulti read-error (fn [ext-name n _] [ext-name n])) (defn padding [n] (rem (- 4 (rem n 4)) 4)) (defn bit-count [n] (.bitCount (BigInteger/valueOf n)))
feb44faadc14fef351b1b28cd06d608a0aa24bdf618f5e76bbbbac8f7834075a
sharplispers/ironclad
util.lisp
;;;; -*- mode: lisp; indent-tabs-mode: nil -*- ;;;; util.lisp -- functions that come in handy in crypto applications (in-package :crypto) (declaim (inline byte-array-to-hex-string hex-string-to-byte-array ascii-string-to-byte-array)) (defun byte-array-to-hex-string (vector &key (sta...
null
https://raw.githubusercontent.com/sharplispers/ironclad/6cc4da8554558ee2e89ea38802bbf6d83100d4ea/src/util.lisp
lisp
-*- mode: lisp; indent-tabs-mode: nil -*- util.lisp -- functions that come in handy in crypto applications so that the compiler optimization can jump in
(in-package :crypto) (declaim (inline byte-array-to-hex-string hex-string-to-byte-array ascii-string-to-byte-array)) (defun byte-array-to-hex-string (vector &key (start 0) end (element-type 'base-char)) "Return a string containing the hexadecimal representation of the subsequence ...
e0c5d62abc6ce5ad3aa8474a50e6d081dc77fe240f4333f7d58560f26e477dc9
rmculpepper/gamble
basic.rkt
Copyright ( c ) 2014 Released under the terms of the 2 - clause BSD license . ;; See the file COPYRIGHT for details. #lang gamble (require (for-syntax racket/base) (except-in rackunit fail)) ;; Parameterized by sampler method and tolerance? (define (make-basic-tests name compute-dist tolerance) (def...
null
https://raw.githubusercontent.com/rmculpepper/gamble/a5231e2eb3dc0721eedc63a77ee6d9333846323e/gamble/tests/basic.rkt
racket
See the file COPYRIGHT for details. Parameterized by sampler method and tolerance?
Copyright ( c ) 2014 Released under the terms of the 2 - clause BSD license . #lang gamble (require (for-syntax racket/base) (except-in rackunit fail)) (define (make-basic-tests name compute-dist tolerance) (define-syntax (test stx) (syntax-case stx () [(test expr expected) #`(test-...
f27b60bf5070d18cabe8bfa37945a51c4b6c55d3e4830a7eb8a7153317c9a21a
c4-project/c4f
scope.ml
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
null
https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/common/test/scope.ml
ocaml
Local scope with different thread IDs isn't well-defined, so we don't test it.
This file is part of c4f . Copyright ( c ) 2018 - 2022 C4 Project c4 t itself is licensed under the MIT License . See the LICENSE file in the project root for more information . Parts of c4 t are based on code from the Herdtools7 project ( ) : see the LICENSE.herd file in the project...
a11dbee4e6b8766ea5109ca4f2c1b98910d03e422401cb16b495c444b0529d61
hoytech/antiweb
encode.lisp
This file is part of yason , a Common Lisp JSON parser / encoder ;; Copyright ( c ) 2008 ;; All rights reserved. ;; ;; Please see the file LICENSE in the distribution. (in-package :yason) (defvar *json-output*) (defmacro with-standard-output-to ((stream) &body body) `(let ((*standard-output* ,stream)) ,...
null
https://raw.githubusercontent.com/hoytech/antiweb/53c38f78ea01f04f6d1a1ecdca5c012e7a9ae4bb/bundled/yason/encode.lisp
lisp
All rights reserved. Please see the file LICENSE in the distribution.
This file is part of yason , a Common Lisp JSON parser / encoder Copyright ( c ) 2008 (in-package :yason) (defvar *json-output*) (defmacro with-standard-output-to ((stream) &body body) `(let ((*standard-output* ,stream)) ,@body)) (defgeneric encode (object &optional stream) (:documentation "Encode O...