_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
356a13070e1019df7be110791f7ab6c640f8a80976d5dda30199cc6eef5ec032
KestrelInstitute/Specware
Preface.lisp
(in-package :cl-user) (defpackage :Specware) (defpackage :Emacs) (defpackage :System-Spec) The following is in ./Languages / SpecCalculus / Semantics / Evaluate / Make.sw : ;; ;; op Specware.run_cmd : String * List String -> () % defined in toplevel.lisp file for each application [perhaps just Prism] ;; Make.sw i...
null
https://raw.githubusercontent.com/KestrelInstitute/Specware/2be6411c55f26432bf5c9e2f7778128898220c24/Applications/Specware/Handwritten/Lisp/Preface.lisp
lisp
op Specware.run_cmd : String * List String -> () % defined in toplevel.lisp file for each application [perhaps just Prism] (env *environment-list*) (wait t) pty input if-input-does-not-exist output (if-output-exists :error) (error :output) (if-error-exists :error) sta...
(in-package :cl-user) (defpackage :Specware) (defpackage :Emacs) (defpackage :System-Spec) The following is in ./Languages / SpecCalculus / Semantics / Evaluate / Make.sw : Make.sw is only used by Prism for now , so this is pre - emptive , in case itself begins to use it : To avoid compiler warnings about run_...
0e2971babacf218984c87cd05f44619d2f68dfa3424e30d42ada6819021fcf3a
reactiveml/rml
main.ml
Js_of_ocaml example * / * Copyright ( C ) 2010 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation ; either version 2 of the License , or * ( at your option ) any later ve...
null
https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/js-of-ocaml/examples/wysiwyg/main.ml
ocaml
see * -spec.html
Js_of_ocaml example * / * Copyright ( C ) 2010 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation ; either version 2 of the License , or * ( at your option ) any later ve...
e5eb026818fa5ac3e31c188711bbc61df33ffa706a3743cfe6849f4f630bdb0a
vmchale/madlang
Utils.hs
# LANGUAGE FlexibleInstances # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} -- | Internal utils to help out elsewhere module Text.Madlibs.Internal.Utils where import Control.Arrow (first) import Control.Exception (IOException, catch, throw...
null
https://raw.githubusercontent.com/vmchale/madlang/321e349d693bde3d133f5e251259afdcfc041526/src/Text/Madlibs/Internal/Utils.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE TypeSynonymInstances # | Internal utils to help out elsewhere | Drop file Extension | Get directory associated to a file | Function to apply a value on both arguments, e.g. > between .$ (char '"') | Normalize pre-tokens/corresponding probabilities | Helper function f...
# LANGUAGE FlexibleInstances # module Text.Madlibs.Internal.Utils where import Control.Arrow (first) import Control.Exception (IOException, catch, throw) import qualified Data.Text as T import Data.Void import Text.Madlibs.Cata.SemE...
eeed207eb11defd9ad4448d9a83811f6089fb5c4d5f00c9e94e9d1d20d9c8966
symbiont-io/detsys-testkit
Traces.hs
# LANGUAGE DeriveGeneric # module Ldfi.Traces where import Data.Hashable (Hashable) import Data.Set (Set) import qualified Data.Set as Set import GHC.Generics (Generic) import GHC.Natural ------------------------------------------------------------------------ -- * Traces type Trace = [Event] data Event = Event ...
null
https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/ldfi/src/Ldfi/Traces.hs
haskell
---------------------------------------------------------------------- * Traces
# LANGUAGE DeriveGeneric # module Ldfi.Traces where import Data.Hashable (Hashable) import Data.Set (Set) import qualified Data.Set as Set import GHC.Generics (Generic) import GHC.Natural type Trace = [Event] data Event = Event { from :: Node, sent :: Time, to :: Node, recv :: Time } deriving (E...
1f6baccb818e90efe5245edbfb8e0dd94b1e6b7504beee0cbf3854343bde007e
alanz/ghc-exactprint
Stream.hs
module Stream (Stream, carry, addStream, rationalToStream, streamToFloat, addFiniteStream, negate', average) where import Data.Ratio type Digit = Integer type Stream = [Integer] -- Convert from a Rational fraction to its stream representation rationalToStream :: Rational -> Stream rationalToStream...
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/Stream.hs
haskell
Convert from a Rational fraction to its stream representation Convert from a stream to the Float value Generate a list of x Utility function for addFinitieStream Normalise the sum Negate a stream
module Stream (Stream, carry, addStream, rationalToStream, streamToFloat, addFiniteStream, negate', average) where import Data.Ratio type Digit = Integer type Stream = [Integer] rationalToStream :: Rational -> Stream rationalToStream x |t<1 = 0:rationalToStream t |otherw...
3e679a17e1fd915c1b99406d2b86d0efc2ec09d373a530a281b704a604d6852d
borodust/alien-works
scene.lisp
(cl:in-package :alien-works.tools.resources) ;;; ;;; LOGGING ;;; (cffi:defcallback write-assimp-log :void ((message :pointer) (data :pointer)) (declare (ignore data)) (format *standard-output* "~A" (cffi:foreign-string-to-lisp message))) (defmacro with-logging (() &body body) (a:with-gensyms (logger) `(cr...
null
https://raw.githubusercontent.com/borodust/alien-works/909f4f4a756498811af3ffd68f98aff4f1b6ea64/tools/resources/scene/scene.lisp
lisp
LOGGING SCENE
(cl:in-package :alien-works.tools.resources) (cffi:defcallback write-assimp-log :void ((message :pointer) (data :pointer)) (declare (ignore data)) (format *standard-output* "~A" (cffi:foreign-string-to-lisp message))) (defmacro with-logging (() &body body) (a:with-gensyms (logger) `(cref:c-with ((,logger ...
99f1245af18ff252d97ce19bdab94f4b87eed69ab2b86a66434998ae1308f5a5
factisresearch/large-hashable
CryptoHash.hs
# LANGUAGE ExistentialQuantification # # LANGUAGE MagicHash # module Data.LargeHashable.Benchmarks.CryptoHash where keep imports in alphabetic order ( in Emacs , use " M - x sort - lines " ) import Data.Bits import Data.Byteable import Data.List (foldl') import Data.Word import qualified Crypto.Hash as H import qual...
null
https://raw.githubusercontent.com/factisresearch/large-hashable/7b7c2ed6ac6e096478e8ee00160fa9d220df853a/benchmark/Data/LargeHashable/Benchmarks/CryptoHash.hs
haskell
we can make this faster by accessing the machine represenation of an int
# LANGUAGE ExistentialQuantification # # LANGUAGE MagicHash # module Data.LargeHashable.Benchmarks.CryptoHash where keep imports in alphabetic order ( in Emacs , use " M - x sort - lines " ) import Data.Bits import Data.Byteable import Data.List (foldl') import Data.Word import qualified Crypto.Hash as H import qual...
0804055c1ba7635d3cc7a6d46c3bee4339cdd519f1e92d9111c409736edc1eda
facebook/Haxl
DataSource.hs
Copyright ( c ) 2014 - present , Facebook , Inc. -- All rights reserved. -- This source code is distributed under the terms of a BSD license , -- found in the LICENSE file. {-# LANGUAGE ConstraintKinds #-} # LANGUAGE ExistentialQuantification # {-# LANGUAGE GADTs #-} # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE...
null
https://raw.githubusercontent.com/facebook/Haxl/ca65bb92d0bbcf266ecb70324d9b758811f189c4/Haxl/Core/DataSource.hs
haskell
All rights reserved. found in the LICENSE file. # LANGUAGE ConstraintKinds # # LANGUAGE GADTs # # LANGUAGE OverloadedStrings # # LANGUAGE Rank2Types # | The 'DataSource' class and related types and functions. This module is provided for access to Haxl internals only; most users * Data fetching * Result variab...
Copyright ( c ) 2014 - present , Facebook , Inc. This source code is distributed under the terms of a BSD license , # LANGUAGE ExistentialQuantification # # LANGUAGE MultiParamTypeClasses # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # should import " Haxl . Core " instead . module Haxl.Core.DataSo...
389c118ff0e57e51b38cc42f3a9363cffbd7b598e4ad13b760d87e29d5f3e4d5
juxt/roll
route_53.cljs
(ns roll.modules.route-53 (:require [roll.utils :refer [tf-path-to $]] [clojure.string])) (defn generate "Create Alias Resource Record Sets" [config] (when (not-empty (:route-53-aliases config)) {:resource {:aws-route53-record (into {} (for [{:keys [resource-name name-pre...
null
https://raw.githubusercontent.com/juxt/roll/1ef07d72f05b5604eec4f7d6a5dbf0d21ec3c8b3/src/roll/modules/route_53.cljs
clojure
for why we do lower
(ns roll.modules.route-53 (:require [roll.utils :refer [tf-path-to $]] [clojure.string])) (defn generate "Create Alias Resource Record Sets" [config] (when (not-empty (:route-53-aliases config)) {:resource {:aws-route53-record (into {} (for [{:keys [resource-name name-pre...
1d114105c63ffd1eb0a626fb0b9ac1b4b9c70dae86ff345d62c425e7353b9fe0
Storkle/clj-forex
spawn.clj
(clojure.core/use 'nstools.ns) (ns+ forex.util.spawn (:clone clj.core) (:use forex.util.general forex.util.zmq) (:import forex.util.zmq.Poller) (:require [forex.util.fiber.spawn :as s])) (def- *pid* (atom [])) (defalias pid? s/pid?) (defalias self s/self) (def kill-all s/kill-all) TODO : add ...
null
https://raw.githubusercontent.com/Storkle/clj-forex/1800b982037b821732b9df1e2e5ea1eda70f941f/src/forex/util/spawn.clj
clojure
TODO: fair queue? prevent too much messages hogging sequence? who knows! ... TODO: memory overflow with getting all messsages? probably not .... ? with multiple sources or change to poll !? (timeout) ?? (filter)
(clojure.core/use 'nstools.ns) (ns+ forex.util.spawn (:clone clj.core) (:use forex.util.general forex.util.zmq) (:import forex.util.zmq.Poller) (:require [forex.util.fiber.spawn :as s])) (def- *pid* (atom [])) (defalias pid? s/pid?) (defalias self s/self) (def kill-all s/kill-all) TODO : add ...
972fd6f6fb7d25a64a80a4a112596270cc458897fb3b6043837e1fd3ea724eaa
paurkedal/ocaml-prime
test_int64.ml
Copyright ( C ) 2016 - -2022 Petter A. Urkedal < > * * This library is free software ; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or ( at your * option ) any la...
null
https://raw.githubusercontent.com/paurkedal/ocaml-prime/42efa85317069d726e8e3989e51c24ba03c56b47/tests/test_int64.ml
ocaml
pow
Copyright ( C ) 2016 - -2022 Petter A. Urkedal < > * * This library is free software ; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or ( at your * option ) any la...
7250cd15296a29ba12a6e016eef8102566de3be97a2af0f375c557927a4ba9e8
samrushing/irken-compiler
stdio_ffi.scm
;; bootstrap version. (includes "stdio.h" ) (cflags ) (lflags ) (sig fopen ((* char) (* char) -> (* FILE))) (sig fwrite ((* void) int int (* FILE) -> int)) (sig fread ((* void) int int (* FILE) -> int)) (sig fgetc ((* FILE) -> int)) (sig fclose ((* FILE) -> int)) (sig fflush ((* FILE) -> int)) (sig fdopen (int (* char...
null
https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/ffi/stdio_ffi.scm
scheme
bootstrap version.
(includes "stdio.h" ) (cflags ) (lflags ) (sig fopen ((* char) (* char) -> (* FILE))) (sig fwrite ((* void) int int (* FILE) -> int)) (sig fread ((* void) int int (* FILE) -> int)) (sig fgetc ((* FILE) -> int)) (sig fclose ((* FILE) -> int)) (sig fflush ((* FILE) -> int)) (sig fdopen (int (* char) -> (* FILE))) (sig p...
52e5533744911e8e11a0651b9689565f926c1ccf57f86d32d515eff3ec17d144
ajhc/ajhc
ReadSource.hs
-- routines dealing with reading and preprocessing source code files. module Ho.ReadSource( preprocess, preprocessHs, languageFlags, fetchCompilerFlags, parseHsSource ) where import Control.Monad import Data.Char import Data.Maybe import System.FilePath as FP import System.Process import System.Director...
null
https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/src/Ho/ReadSource.hs
haskell
routines dealing with reading and preprocessing source code files. translates a list of language extensions as pased to a LANGUAGE pragma or line pragma line pragma ^ file path to compiler, compiler arguments
module Ho.ReadSource( preprocess, preprocessHs, languageFlags, fetchCompilerFlags, parseHsSource ) where import Control.Monad import Data.Char import Data.Maybe import System.FilePath as FP import System.Process import System.Directory import qualified Data.ByteString as BS import qualified Data.ByteStr...
f93fbd5d3af3768ffc2f465f2d823ab3fa733bb31aab07710cc7d7f27f8a6bc8
jwiegley/notes
Sexp.hs
{-# LANGUAGE OverloadedStrings #-} module Sexp where import Data.Text import Text.Parsec import Text.Parsec.Char import Text.Parsec.Combinator import Text.Parsec.Text data Sexp = Atom Text | Sub [Sexp] deriving Show data Sexp = Sexp Text deriving Show sexp :: Parser Sexp sexp = undefined ast :...
null
https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Sexp.hs
haskell
# LANGUAGE OverloadedStrings #
module Sexp where import Data.Text import Text.Parsec import Text.Parsec.Char import Text.Parsec.Combinator import Text.Parsec.Text data Sexp = Atom Text | Sub [Sexp] deriving Show data Sexp = Sexp Text deriving Show sexp :: Parser Sexp sexp = undefined ast :: Parsec Sexp () AST ast = undefine...
10d675561fe3f84f602308739d480f63cf245e41de24b7718aab89567766672a
esl/MongooseIM
mongoose_c2s_acc.erl
@doc Interface for actions that handler modules might request ` ' to act upon . %% Note that some of the keys take a list of elements, which, in the case of a hook with many %% handlers, means that at the end of the queue `mongoose_c2s' will get a list of requests %% by different modules. These will be acted upon in...
null
https://raw.githubusercontent.com/esl/MongooseIM/ec9f47c6cb7d5c020e9497fd0369a81ccbca0900/src/c2s/mongoose_c2s_acc.erl
erlang
Note that some of the keys take a list of elements, which, in the case of a hook with many handlers, means that at the end of the queue `mongoose_c2s' will get a list of requests by different modules. These will be acted upon in the same order they were inserted in the hook list, according to their priority. The f...
@doc Interface for actions that handler modules might request ` ' to act upon . -module(mongoose_c2s_acc). -export([new/0, new/1, get_statem_result/1, from_mongoose_acc/2, to_acc/3, to_acc_many/2 ]). -type key() :: state_mod | actions | c2s_state | c2s_data | stop | hard_stop | r...
273c6d2c5e798df771a02c2d1e0e323311d0e135b4b5611170363375cf55d013
vimus/libmpd-haskell
UtilSpec.hs
{-# LANGUAGE OverloadedStrings #-} # OPTIONS_GHC -fno - warn - type - defaults # module UtilSpec (main, spec) where import Arbitrary import TestUtil import Test.Hspec.QuickCheck (prop) import Test.QuickCheck import Data.List (sort) import Data.Maybe (fromJ...
null
https://raw.githubusercontent.com/vimus/libmpd-haskell/1ec02deba33ce2a16012d8f0954e648eb4b5c485/tests/UtilSpec.hs
haskell
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -fno - warn - type - defaults # module UtilSpec (main, spec) where import Arbitrary import TestUtil import Test.Hspec.QuickCheck (prop) import Test.QuickCheck import Data.List (sort) import Data.Maybe (fromJust, isJust) import Data....
c7352572c292b71d97794f05bce82aa346a26fc2ab325e52bdc3bb5e2d866581
francescoc/erlangprogramming
serial_tests.erl
%% Code from %% Erlang Programming and O'Reilly , 2008 %% / / ( c ) and -module(serial_tests). -include_lib("eunit/include/eunit.hrl"). -import(serial, [treeToList/1, tree0/0,tree1/0, listToTree/1]). leaf_test() -> ?assertEqual(tree0() , listToTree(treeToList(tr...
null
https://raw.githubusercontent.com/francescoc/erlangprogramming/b4c39cbebe6599f23eb9d1a052316baf75e40a47/chapter19/serial_tests.erl
erlang
Code from Erlang Programming /
and O'Reilly , 2008 / ( c ) and -module(serial_tests). -include_lib("eunit/include/eunit.hrl"). -import(serial, [treeToList/1, tree0/0,tree1/0, listToTree/1]). leaf_test() -> ?assertEqual(tree0() , listToTree(treeToList(tree0()))). leaf_value_test() -> ?assertE...
e0166e8d789faa11d74ebd56393dfdf191ddaabcebd578602ce994ced2dc0333
mirage/irmin
branch_intf.ml
* Copyright ( c ) 2013 - 2022 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND...
null
https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/irmin/branch_intf.ml
ocaml
* The type for branches. * The name of the main branch. * Check if the branch is valid. * {1 Branch Store} * Base functions on keys. * Base functions on values. * [String] is an implementation of {{!Branch.S} S} where branches are strings. The [main] branch is ["main"]. Valid branch names contain only ...
* Copyright ( c ) 2013 - 2022 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND...
42d23f02667d54592628f107bb383f7c34b26ab27ff8decc212bbb23f0f45d7e
kana/sicp
ex-3.7.scm
Exercise 3.7 . Consider the bank account objects created by make - account , with the password modification described in exercise 3.3 . Suppose that our ;;; banking system requires the ability to make joint accounts. Define a procedure make - joint that accomplishes this . Make - joint should take three argum...
null
https://raw.githubusercontent.com/kana/sicp/912bda4276995492ffc2ec971618316701e196f6/ex-3.7.scm
scheme
banking system requires the ability to make joint accounts. Define must match the password with which the account was defined in order for the Make-joint is to create an additional access to the original account using open-sesame, then and the password rosebud. You may wish to modify your solution to exercise =>...
Exercise 3.7 . Consider the bank account objects created by make - account , with the password modification described in exercise 3.3 . Suppose that our a procedure make - joint that accomplishes this . Make - joint should take three arguments . The first is a password - protected account . The second argumen...
238a143b1c5e07ec184e45b69beef5698a66d5ed4c42f30bcc85ad9b0bbfc664
karlhof26/gimp-scheme
layerfx_02.scm
; GIMP Layer Effects Copyright ( c ) 2008 ; ; --------------------------------------------------------------------- ; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either vers...
null
https://raw.githubusercontent.com/karlhof26/gimp-scheme/18827dcc5abd7e3b22849b06301ebe8fc1b3e9f3/layerfx_02.scm
scheme
GIMP Layer Effects --------------------------------------------------------------------- This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the impl...
Copyright ( c ) 2008 it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License (define (get-blending-mode modesk) (let* ( ...
0668f05e20d640e67023c3c9e0f7e6bcb8932ad5e11e07c381887fd822e74351
Roam-Research/surreal
datascript.cljs
(ns roam.surreal.datascript (:require [datascript.db :as db] [me.tonsky.persistent-sorted-set :as bset])) (defn prep-datascript-db [db] (into {} (-> db (update :eavt #(into [] %)) (update :aevt #(into [] %)) (update :avet #(into [] %)) (update :hash deref)))) (defn recover-...
null
https://raw.githubusercontent.com/Roam-Research/surreal/36e8b3ae3b74edef3eeefa8e943a53c01e36bc14/src/roam/surreal/datascript.cljs
clojure
(ns roam.surreal.datascript (:require [datascript.db :as db] [me.tonsky.persistent-sorted-set :as bset])) (defn prep-datascript-db [db] (into {} (-> db (update :eavt #(into [] %)) (update :aevt #(into [] %)) (update :avet #(into [] %)) (update :hash deref)))) (defn recover-...
357b4597d0286ea68afc1968e1428a57ac16a10655bcdb80f57318925791c3e0
killme2008/ip-service
project.clj
(defproject ip-service "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojars.smee/binary "0.3.0"] [org.clojure/data.json "0.2.5"] [hbs "0.6.0"] [comp...
null
https://raw.githubusercontent.com/killme2008/ip-service/56a28264c1a7bc28a52752aebb1f078c9951d93b/version-1/project.clj
clojure
(defproject ip-service "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojars.smee/binary "0.3.0"] [org.clojure/data.json "0.2.5"] [hbs "0.6.0"] [comp...
8ff506020d5f9b7e65ff954dd9b44cd96087a83aad77cc4c48829ca3fa2e8a75
haskell-game/sdl2
Lesson05.hs
# LANGUAGE CPP # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE LambdaCase # {-# LANGUAGE MultiWayIf #-} # LANGUAGE PatternSynonyms # module TwinkleBear.Lesson05 (main) where import Prelude hiding (init) import Control.Applicative import Control.Monad import Data.Monoid import Foreign.C.Types import SDL.Vect import qua...
null
https://raw.githubusercontent.com/haskell-game/sdl2/1578a635b8882883e5b07557e8a32cb486bde001/examples/twinklebear/Lesson05.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE MultiWayIf #
# LANGUAGE CPP # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # module TwinkleBear.Lesson05 (main) where import Prelude hiding (init) import Control.Applicative import Control.Monad import Data.Monoid import Foreign.C.Types import SDL.Vect import qualified SDL import Paths_sdl2 (getDataFileName) #if !MIN_VERSI...
8a7b62122f15b82ae183ebe5b4eee6bb793e4cccaa84b6dcaa383041771dfa61
dnlkrgr/hsreduce
Cabal.hs
module Reduce.Passes.Cabal where import Control.Concurrent.STM.Lifted import Control.Monad.Reader import Distribution.ModuleName import Distribution.PackageDescription import Util.Types import Util.Util cabalActions :: [R IO ()] cabalActions = [ rmvBenchmarks, rmvTestSuites, rmvExtraSrcFiles, runPass ...
null
https://raw.githubusercontent.com/dnlkrgr/hsreduce/8f66fdee036f8639053067572b55d9a64359d22c/src/Reduce/Passes/Cabal.hs
haskell
rmvModuleNames :: R IO () rmvModuleNames = do conf <- ask readTVarIO (_tState conf) >>= \case s@CabalState{..} -> do let p = packageDescription _pkgDesc _ -> return () where
module Reduce.Passes.Cabal where import Control.Concurrent.STM.Lifted import Control.Monad.Reader import Distribution.ModuleName import Distribution.PackageDescription import Util.Types import Util.Util cabalActions :: [R IO ()] cabalActions = [ rmvBenchmarks, rmvTestSuites, rmvExtraSrcFiles, runPass ...
48a2c5d3670c273ff35ca3833c411e7c8c7cf3b6b724264e6ac26c12e1ccb300
nvim-treesitter/nvim-treesitter
folds.scm
[ (function_definition) (for_statement) (if_statement) (while_statement) (with_statement) (match_statement) (parameters) (argument_list) (parenthesized_expression) (list_comprehension) (dictionary_comprehension) (tuple) (list) (dictionary) (string) ] @fold
null
https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/f8595b13bff62d5c64d54840e16678b9ad843620/queries/starlark/folds.scm
scheme
[ (function_definition) (for_statement) (if_statement) (while_statement) (with_statement) (match_statement) (parameters) (argument_list) (parenthesized_expression) (list_comprehension) (dictionary_comprehension) (tuple) (list) (dictionary) (string) ] @fold
9d61a47cd4be1e492b7442a0d3135965c950fa252df791dc25bc1b389053a350
donut-party/datapotato
next_jdbc_test.clj
(ns donut.datapotato.next-jdbc-test (:require [clojure.test :refer [deftest is use-fixtures]] [donut.datapotato.core :as dc] [donut.datapotato.generate-test :as dgt] [donut.datapotato.next-jdbc :as dnj] [malli.generator :as mg] [matcher-combinators.test] [next.jdbc :as jdbc] [next.jdbc.sql :as...
null
https://raw.githubusercontent.com/donut-party/datapotato/0af48d8e23888a48b876ec852770c15fff8bfb02/datapotato-next-jdbc/test/donut/datapotato/next_jdbc_test.clj
clojure
--- --- --- schemas --- --- tests ---
(ns donut.datapotato.next-jdbc-test (:require [clojure.test :refer [deftest is use-fixtures]] [donut.datapotato.core :as dc] [donut.datapotato.generate-test :as dgt] [donut.datapotato.next-jdbc :as dnj] [malli.generator :as mg] [matcher-combinators.test] [next.jdbc :as jdbc] [next.jdbc.sql :as...
f900d576f1c207292e5cdec4a47b9e12c8289930ffda4aaa47d4dc89a877ce20
ailisp/Graphic-Forms
status-bar.lisp
(in-package :graphic-forms.uitoolkit.widgets) ;;; ;;; helper functions ;;; (declaim (inline stb-is-simple)) (defun stb-is-simple (status-bar) (/= (gfs::send-message (gfs:handle status-bar) gfs::+sb-issimple+ 0 0) 0)) (defun stb-get-border-widths (status-bar) "Returns a list of integer widths (0: horz ...
null
https://raw.githubusercontent.com/ailisp/Graphic-Forms/1e0723d07e1e4e02b8ae375db8f3d65d1b444f11/src/uitoolkit/widgets/status-bar.lisp
lisp
helper functions methods
(in-package :graphic-forms.uitoolkit.widgets) (declaim (inline stb-is-simple)) (defun stb-is-simple (status-bar) (/= (gfs::send-message (gfs:handle status-bar) gfs::+sb-issimple+ 0 0) 0)) (defun stb-get-border-widths (status-bar) "Returns a list of integer widths (0: horz border, 1: vert border, 2: inter...
1bd3d7cab9c66fc8ff59aa4a92dd2b4009bc9caaf1a70083e23d648a944288d0
Gopiandcode/petrol
test_static_person.ml
[@@@warning "-27-26"] open Lwt_result.Syntax let db = Petrol.StaticSchema.init () module Person = struct type t = {name: string; age: int} module Sql = struct open Petrol let t, Expr.[name;age] = StaticSchema.declare_table db ~name:"person" Schema.[ field ~constraints:[primary_ke...
null
https://raw.githubusercontent.com/Gopiandcode/petrol/f74366519fccdd7dc452fd815541e9fb17f15d6e/test/test_static_person.ml
ocaml
[@@@warning "-27-26"] open Lwt_result.Syntax let db = Petrol.StaticSchema.init () module Person = struct type t = {name: string; age: int} module Sql = struct open Petrol let t, Expr.[name;age] = StaticSchema.declare_table db ~name:"person" Schema.[ field ~constraints:[primary_ke...
46d61bd5e5122b1fa6febc74f93c79c011d86f0cd5a0072ee748c94638a99808
alanz/ghc-exactprint
QuasiQuote.hs
# LANGUAGE QuasiQuotes # module QuasiQuote where import T7918A ex1 = [qq|e1|] ex2 = [qq|e2|] ex3 = [qq|e3|] ex4 = [qq|e4|] tx1 = undefined :: [qq|t1|] tx2 = undefined :: [qq|t2|] tx3 = undefined :: [qq|t3|] tx4 = undefined :: [qq|t4|] px1 [qq|p1|] = undefined px2 [qq|p2|] = undefined px3 [qq|p3|] = undefined px4 [q...
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/QuasiQuote.hs
haskell
# LANGUAGE QuasiQuotes # module QuasiQuote where import T7918A ex1 = [qq|e1|] ex2 = [qq|e2|] ex3 = [qq|e3|] ex4 = [qq|e4|] tx1 = undefined :: [qq|t1|] tx2 = undefined :: [qq|t2|] tx3 = undefined :: [qq|t3|] tx4 = undefined :: [qq|t4|] px1 [qq|p1|] = undefined px2 [qq|p2|] = undefined px3 [qq|p3|] = undefined px4 [q...
c21aa58e2436aee80b336cb3a2ea631d7616a766e4afe4451766e96d818388b3
naproche/naproche
Show.hs
-- | Authors : ( 2001 - 2008 ) , ( 2017 - 2018 ) -- -- TODO: Add description. # OPTIONS_GHC -fno - warn - orphans # {-# LANGUAGE OverloadedStrings #-} module SAD.Data.Formula.Show ( showArgumentsWith, commaSeparated, symEncode, symChars ) where import Data.Text.Lazy (Text) import Data.Text....
null
https://raw.githubusercontent.com/naproche/naproche/6284a64b4b84eaa53dd0eb7ecb39737fb9135a0d/src/SAD/Data/Formula/Show.hs
haskell
| TODO: Add description. # LANGUAGE OverloadedStrings # show instances decoding of symbolic names map application: "(.)" Symbolic names
Authors : ( 2001 - 2008 ) , ( 2017 - 2018 ) # OPTIONS_GHC -fno - warn - orphans # module SAD.Data.Formula.Show ( showArgumentsWith, commaSeparated, symEncode, symChars ) where import Data.Text.Lazy (Text) import Data.Text.Lazy qualified as Text import SAD.Data.Formula.Base import SAD.Data....
2859e7ee9a4407a467766649e39e32838eb4a792159ea440117a62d01ad8bf14
angavrilov/cl-gpu
type-inf.lisp
;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; Copyright ( c ) 2010 by . ;;; ;;; See LICENCE for details. ;;; ;;; This file defines core C type management functions ;;; and type inference rules for special forms. ;;; (in-package :cl-gpu) (def function parse-global-type (type-spec &key form) (atypecase (parse-...
null
https://raw.githubusercontent.com/angavrilov/cl-gpu/1523ec3c42db904815f7276a776d354ec30c6b7b/core/type-inf.lisp
lisp
-*- mode: Lisp; Syntax: Common-Lisp; -*- See LICENCE for details. This file defines core C type management functions and type inference rules for special forms. Type properties Alignment helpers Misc checks Local var creation Type propagation engine Type cast Variable reference Constants Assignment Va...
Copyright ( c ) 2010 by . (in-package :cl-gpu) (def function parse-global-type (type-spec &key form) (atypecase (parse-lisp-type type-spec :error-cb (curry #'gpu-code-error form)) (gpu-array-type (unless (specific-type-p it) (gpu-code-error form "Insufficiently specific type spec: ~S" type-spec)...
7f15234b340a44ce0d4fa7ec637a1bf1e1d7b34fdfccbd4728607113ad03331c
cj1128/sicp-review
2.73.scm
;; Exercise 2.73 ;; symbolic differentiation written in data-directed programming (define (deriv exp var) (cond ((number? exp) 0) ((variable? exp) (if (same-variable? exp var) 1 0)) (else ((get 'deriv (operator exp)) (operands exp) var)))) (define (operator exp) (car exp)) (define (operands e...
null
https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-2/2.4/2.73.scm
scheme
Exercise 2.73 symbolic differentiation written in data-directed programming a: number? and same-variable? are predicates, there is nothing to dispatch b: c: d the only thing to do is changing the order of arguments in procedure put
(define (deriv exp var) (cond ((number? exp) 0) ((variable? exp) (if (same-variable? exp var) 1 0)) (else ((get 'deriv (operator exp)) (operands exp) var)))) (define (operator exp) (car exp)) (define (operands exp) (cdr exp)) (define (install-sum) (define make-sum (addend augend) (li...
74db2a1968f9ce203731d951301421dc5ca3c4a9b9780dbe2be4a03cb0c2857a
OCamlPro/ocp-build
parser.ml
(**************************************************************************) (* *) (* Typerex Tools *) (* *) Copyrigh...
null
https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/tools/ocp-pp/compat/4.00.0/parser.ml
ocaml
************************************************************************ Typerex Tools ...
Copyright 2011 - 2017 OCamlPro SAS the GNU General Public License version 3 described in the file type token = | AMPERAMPER | AMPERSAND | AND | AS | ASSERT | BACKQUOTE | BANG | BAR | BARBAR | BARRBRACKET | BEGIN | CHAR of (char) | CLASS | ...
27e4b42aa59f1fe0f2acfb77cc3dbb27950ff75fc40cf2f3a6ce57d638ed627f
gelisam/klister
SplitType.hs
# LANGUAGE TemplateHaskell # module SplitType where import Control.Lens hiding (children) import Control.Monad.Writer import Data.Map (Map) import qualified Data.Map as Map import PartialType import Type import Unique newtype SplitTypePtr = SplitTypePtr Unique deriving (Eq, Ord) instance Show SplitTypePtr where ...
null
https://raw.githubusercontent.com/gelisam/klister/71c71e6ab768e7e6b43e9402bc127423cd6e562b/src/SplitType.hs
haskell
# LANGUAGE TemplateHaskell # module SplitType where import Control.Lens hiding (children) import Control.Monad.Writer import Data.Map (Map) import qualified Data.Map as Map import PartialType import Type import Unique newtype SplitTypePtr = SplitTypePtr Unique deriving (Eq, Ord) instance Show SplitTypePtr where ...
96f4077b83ef244871d8eef62d3c2d2c4a55fabf0834e6a536ff8196bda69693
souenzzo/souenzzo.github.io
connect_test.clj
(ns br.com.souenzzo.inga.connect-test (:require [clojure.test :refer [deftest]] [br.com.souenzzo.inga.connect :as ic] [midje.sweet :refer [fact =>]] [clojure.spec.test.alpha :as stest] [edn-query-language.core :as eql])) (stest/instrument) (deftest ast (fact "ju...
null
https://raw.githubusercontent.com/souenzzo/souenzzo.github.io/30a811c4e5633ad07bba1d58d19eb091dac222e9/inga/test/br/com/souenzzo/inga/connect_test.clj
clojure
(ns br.com.souenzzo.inga.connect-test (:require [clojure.test :refer [deftest]] [br.com.souenzzo.inga.connect :as ic] [midje.sweet :refer [fact =>]] [clojure.spec.test.alpha :as stest] [edn-query-language.core :as eql])) (stest/instrument) (deftest ast (fact "ju...
46d5fe8ff03156630220ee325bbf97f2da1d666b035de5eeb89ad5803d1a1756
rbkmoney/consuela
leader_sup_SUITE.erl
%%% %%% Testing zombie reaper behaves well -module(leader_sup_SUITE). -include_lib("common_test/include/ct.hrl"). -include_lib("stdlib/include/assert.hrl"). -type group_name() :: atom(). -type test_name() :: atom(). -type config() :: [{atom(), _}]. -export([all/0]). -export([init_per_suite/1]). -export([end_per_sui...
null
https://raw.githubusercontent.com/rbkmoney/consuela/56d065bff0f1c8de4cede40d670b9061942b4ea8/test/leader_sup_SUITE.erl
erlang
Testing zombie reaper behaves well Supervisor Description Startup / shutdown Definitions pid() > atom() Supervisor
-module(leader_sup_SUITE). -include_lib("common_test/include/ct.hrl"). -include_lib("stdlib/include/assert.hrl"). -type group_name() :: atom(). -type test_name() :: atom(). -type config() :: [{atom(), _}]. -export([all/0]). -export([init_per_suite/1]). -export([end_per_suite/1]). -export([init_per_testcase/2]). -ex...
4b7045d2365c533f3644c6e9a6722324b1e63a8a7094d46e0de34e4d020f62e7
patricoferris/ocaml-multicore-monorepo
build_fs.ml
Js_of_ocaml compiler * / * Copyright ( C ) 2020 Hugo Heuzard * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of th...
null
https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/624b3293ee41e83736fe7ac3a79f810c2b70f68b/duniverse/js_of_ocaml/compiler/bin-js_of_ocaml/build_fs.ml
ocaml
Js_of_ocaml compiler * / * Copyright ( C ) 2020 Hugo Heuzard * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of th...
2c32aed07676e10b3107547c4f60a86485826895f28f88ce98dab28c4a8ed10f
eareese/htdp-exercises
166-compute-wages-pay-checks.rkt
#lang htdp/bsl Exercise 166 . The wage*.v2 function consumes a list of work records and produces a list of numbers . Of course , functions may also produce lists of structures . ;; Develop a data representation for pay checks . Assume that a pay check contains two distinctive pieces of information : the employee ’...
null
https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part02-arbitrarily-large-data/166-compute-wages-pay-checks.rkt
racket
In reality, a pay check also contains an employee number. Develop a data representation for employee information and change the data definition for work records so that it uses employee information and not just a string for the employee’s name. Also change your data representation of pay checks so that it contains a...
#lang htdp/bsl Exercise 166 . The wage*.v2 function consumes a list of work records and produces a list of numbers . Of course , functions may also produce lists of structures . Develop a data representation for pay checks . Assume that a pay check contains two distinctive pieces of information : the employee ’s n...
5d08e539b8f687d80678bfd427a6e88142e60f924ec7190c9716457d153b24e8
aharisu/Gauche-CV
line-iterator.scm
(use cv) (define (sum-line-pixels image pt1 pt2) (receive (count iterator) (cv-init-line-iterator image pt1 pt2 8) (let loop ([i 0] [blue-sum 0] [green-sum 0] [red-sum 0]) (let ([b (cv-get-byte-line-iterator iterator 0)] [g (cv-get-byte-line-iter...
null
https://raw.githubusercontent.com/aharisu/Gauche-CV/5e4c51501431c72270765121ea4d92693f11d60b/sample/line-iterator.scm
scheme
(use cv) (define (sum-line-pixels image pt1 pt2) (receive (count iterator) (cv-init-line-iterator image pt1 pt2 8) (let loop ([i 0] [blue-sum 0] [green-sum 0] [red-sum 0]) (let ([b (cv-get-byte-line-iterator iterator 0)] [g (cv-get-byte-line-iter...
87e66fd1b914b0b25bee2e7ae690bfd2b0312418a29186613a6aae81af53bdbe
0install/0install
console.ml
Copyright ( C ) 2013 , the README file for details , or visit . * See the README file for details, or visit . *) (** Common types for user interface callbacks *) open Support open Support.Common module U = Support.Utils external get_terminal_width : unit -> int = "ocaml_0install_get_terminal_width" le...
null
https://raw.githubusercontent.com/0install/0install/22eebdbe51a9f46cda29eed3e9e02e37e36b2d18/src/zeroinstall/console.ml
ocaml
* Common types for user interface callbacks [> 0] when we're asking the user a question Select the most interesting download in [downloads] and return its ID. * Also, removes any finished downloads from the list. (could be bytes or percent) log_debug "Start monitoring %s" dl.Downloader.url; The last downlo...
Copyright ( C ) 2013 , the README file for details , or visit . * See the README file for details, or visit . *) open Support open Support.Common module U = Support.Utils external get_terminal_width : unit -> int = "ocaml_0install_get_terminal_width" let is_in_progress = function | None -> false |...
45e6a64c64af608b59e5d6323d09c1fc806256a8753eb2a74730fd556cb5bba2
arcfide/oleg
myenv-chez.scm
My Standard Scheme " Prelude " Version for Petite Chez Scheme 6.0a $ I d : myenv - chez.scm , v 1.3 2004/11/03 22:45:29 oleg Exp $ (define-syntax include (syntax-rules () ((include "myenv.scm") (begin #f)) ((include file) (load file)))) (define pp pretty-print) ( define ) (define-syntax declare...
null
https://raw.githubusercontent.com/arcfide/oleg/c6826870436925fd4c873c01d7fcc24a7a7f95dc/ssax/lib/myenv-chez.scm
scheme
Gambit-specific compiler-decl Frequently-occurring syntax-rule macros A symbol? predicate at the macro-expand time symbol?? FORM KT KF FORM is an arbitrary form or datum It's a pair, not a symbol It's a vector, not a symbol A macro-expand-time memv function for identifiers FORM is an arbitrary form or datum, I...
My Standard Scheme " Prelude " Version for Petite Chez Scheme 6.0a $ I d : myenv - chez.scm , v 1.3 2004/11/03 22:45:29 oleg Exp $ (define-syntax include (syntax-rules () ((include "myenv.scm") (begin #f)) ((include file) (load file)))) (define pp pretty-print) ( define ) (syntax-rules () ((d...
de58233995dd0ee2dfb75ae767bcc4ad8b6eb793dc4a8537b7b0b2db47590b05
hopv/MoCHi
useless_elim.ml
open Utilities open CEGAR_syntax open CEGAR_type open CEGAR_util type typ = TVar of int | TTop | TBase | TFun of typ * typ exception TypingError let counter = ref 0 let new_int ( ) = let n = ! counter in incr counter ; n let new_tvar ( ) = TVar ( new_int ( ) ) let rec get_fv ...
null
https://raw.githubusercontent.com/hopv/MoCHi/b0ac0d626d64b1e3c779d8e98cb232121cc3196a/src/useless_elim.ml
ocaml
let rec meat typ1 typ2 = match typ1,typ2 with TVar{contents=typ1}, typ2 | typ1, TVar{contents=typ2} -> meat typ1 typ2 | TUnit, typ | typ, TUnit -> typ | TBool, TBool -> TBool | TFun(typ11,typ12), TFun(typ21,typ22) -> TFun(meat typ11 typ21, meat typ12 typ22) | _ -> assert false ...
open Utilities open CEGAR_syntax open CEGAR_type open CEGAR_util type typ = TVar of int | TTop | TBase | TFun of typ * typ exception TypingError let counter = ref 0 let new_int ( ) = let n = ! counter in incr counter ; n let new_tvar ( ) = TVar ( new_int ( ) ) let rec get_fv ...
b547b69c70deb4b80d885f161c00a0b6e9314feacca9009e0c6883a0aa318bb8
mirage/irmin
util.ml
* Copyright ( c ) 2018 - 2022 Tarides < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS...
null
https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/libirmin/util.ml
ocaml
Handle errors and set error function, returns [return] if an exception is raised Similar to [with_repo] but returns a null pointer Similar to [with_store] but returns a null pointer
* Copyright ( c ) 2018 - 2022 Tarides < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS...
cdf050f2dcc205bff557c0951958665c6a19173b1ff8886cb6fa999fd44f9a48
mattsta/car
car_sup.erl
-module(car_sup). -behaviour(supervisor). %% External exports -export([start_link/0]). %% supervisor callbacks -export([init/1]). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). init([]) -> Processes = [], Strategy = {one_for_one, 10, 10}, {ok, {Strategy, lists:flatten(Processes)}}...
null
https://raw.githubusercontent.com/mattsta/car/e51e880b9e71e9d67659c3d30f090560da640aa3/src/car_sup.erl
erlang
External exports supervisor callbacks
-module(car_sup). -behaviour(supervisor). -export([start_link/0]). -export([init/1]). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). init([]) -> Processes = [], Strategy = {one_for_one, 10, 10}, {ok, {Strategy, lists:flatten(Processes)}}.
b8039f9403d7581bf44b14ee1f4d57a1f76bdfdb08cacf1c8f7ea0bcb1ce1d87
cronburg/antlr-haskell
ATN.hs
module ATN where import Text.ANTLR.Grammar import Text.ANTLR.Allstar.ATN import Example.Grammar import Text.ANTLR.Set (fromList, union) import System.IO.Unsafe (unsafePerformIO) This is the Grammar from page 6 of the -- 'Adaptive LL(*) Parsing: The Power of Dynamic Analysis' -- paper, namely the expected transition...
null
https://raw.githubusercontent.com/cronburg/antlr-haskell/7a9367038eaa58f9764f2ff694269245fbebc155/test/atn/ATN.hs
haskell
'Adaptive LL(*) Parsing: The Power of Dynamic Analysis' paper, namely the expected transitions based on Figures Names as shown in paper: Submachine for S: Submachine for A: always _ = True never _ = False
module ATN where import Text.ANTLR.Grammar import Text.ANTLR.Allstar.ATN import Example.Grammar import Text.ANTLR.Set (fromList, union) import System.IO.Unsafe (unsafePerformIO) This is the Grammar from page 6 of the 5 through 8 : paperATNGrammar = (defaultGrammar "C" :: Grammar () String String ()) { ns = from...
5ea66a1b0492c810c1882d94e4b3f14c1b3d3542cbf4e4e899277dd78467b680
discus-lang/ddc
Binds.hs
module DDC.Core.Check.Judge.Module.Binds where import DDC.Core.Check.Base import DDC.Core.Check.Exp import DDC.Core.Module import DDC.Core.Env.EnvX (EnvX) import DDC.Core.Interface.Oracle (Oracle) import DDC.Control.CheckIO (throw) import qualified DDC.Core.En...
null
https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Check/Judge/Module/Binds.hs
haskell
------------------------------------------------------------------------------------------------- | Check that the exported signatures match the types of their bindings. ^ Starting environment. ^ Exported types. ^ Exported values ^ Environment of top-level bindings defined by the module | If some bind is expor...
module DDC.Core.Check.Judge.Module.Binds where import DDC.Core.Check.Base import DDC.Core.Check.Exp import DDC.Core.Module import DDC.Core.Env.EnvX (EnvX) import DDC.Core.Interface.Oracle (Oracle) import DDC.Control.CheckIO (throw) import qualified DDC.Core.En...
20d4b49677735b0f02eff18b2fa6d7bac1fdca79903509aac63eb203af9ea51b
athos/tetrlang
parser.clj
(ns parser (:use tmino) ) (def whitespace-chars #{\space \u3000}) (declare >>=) (defn >> [m k] (>>= m (fn [_] k))) (defmacro doM [expr & exprs] (cond (empty? exprs) expr (not (list? expr)) `(>> ~expr (doM ~@exprs)) :else (let [[a1 a2 a3 & rest] expr] (cond (= a1 'let) `(let [~a2 ~a3] (doM ~@exprs)) ...
null
https://raw.githubusercontent.com/athos/tetrlang/bb625b97ffc033b2299d3895c4407f48c7644779/src/parser.clj
clojure
for debug
(ns parser (:use tmino) ) (def whitespace-chars #{\space \u3000}) (declare >>=) (defn >> [m k] (>>= m (fn [_] k))) (defmacro doM [expr & exprs] (cond (empty? exprs) expr (not (list? expr)) `(>> ~expr (doM ~@exprs)) :else (let [[a1 a2 a3 & rest] expr] (cond (= a1 'let) `(let [~a2 ~a3] (doM ~@exprs)) ...
0adcf6ddc130201e1c99766b51d8b60885e446fc769a83808ba56d9514cfbb2a
webyrd/n-grams-for-synthesis
variant-expert-ordering-with-application-optimization-ml.scm
(define *output-table-file-name* "tmp/variant-expert-ordering-with-application-optimization-ml-table.scm") (define allow-incomplete-search? #f) (define lookup-optimization? #f) (load "mk-vicare.scm") (load "mk.scm") (load "test-check.scm") (load "interp-app-optimization-ml.scm") (load "construct-ordering-ml.scm") (l...
null
https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/variant-expert-ordering-with-application-optimization-ml.scm
scheme
(define *output-table-file-name* "tmp/variant-expert-ordering-with-application-optimization-ml-table.scm") (define allow-incomplete-search? #f) (define lookup-optimization? #f) (load "mk-vicare.scm") (load "mk.scm") (load "test-check.scm") (load "interp-app-optimization-ml.scm") (load "construct-ordering-ml.scm") (l...
153a4ea4a4db1ef11ad2159c8176784f83c5f29e3391db7109bf556a764fb7fb
bmeurer/ocaml-arm
output.mli
(***********************************************************************) (* *) (* OCaml *) (* *) , projet ...
null
https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/lex/output.mli
ocaml
********************************************************************* OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . $ Id$ Output the DFA tables and it...
810a4368fd03f9b9776757a059d68bd8441f67f2ecb46a5fab96e0c8340aeeaa
clojure/math.numeric-tower
numeric_tower.clj
Copyright ( c ) , and contributors . All rights reserved . ; The use and distribution terms for this software are covered by the ; Eclipse Public License 1.0 (-1.0.php) ; which can be found in the file epl-v10.html at the root of this distribution. ; By using this software in any fashion, you are a...
null
https://raw.githubusercontent.com/clojure/math.numeric-tower/a3cd25fa1427fa7deda943274e6c869cbd01c276/src/main/clojure/clojure/math/numeric_tower.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not re...
Copyright ( c ) , and contributors . All rights reserved . types in Clojure 's numeric tower , as well as math functions by ( ) May 21 , 2011 (ns ^{:author "Mark Engelberg", :doc "Math functions that deal intelligently with the various types in Clojure's numeric tower, as well ...
a4558f027b0ec0401eead7dbffe0a222969709d2384983d4616140adf21a6009
mistupv/cauder-core
case.erl
-module(ex). -export([ex/0]). ex() -> X = 1, Y = 1, case X of Y -> true; _ -> false end.
null
https://raw.githubusercontent.com/mistupv/cauder-core/b676fccd1bbd629eb63f3cb5259f7a9a8c6da899/examples/case.erl
erlang
-module(ex). -export([ex/0]). ex() -> X = 1, Y = 1, case X of Y -> true; _ -> false end.
e9f614b91e7203978c9b565848b1b449bb010e5318cb3358c1a01215d783f549
opencog/agi-bio
singleton-similarity-rule.scm
; ============================================================================= ; SingletonSimilarityRule ; IntensionalSimilarity ; SetLink ; A ; SetLink ; B ; |- IntensionalSimilarity ; A ; B ; ; ----------------------------------------------------------------------------- (define pln-rule-sin...
null
https://raw.githubusercontent.com/opencog/agi-bio/9c03d9b0e81cb8a8b3a58179f3134f336e5dbdb6/reasoning/simple-by-hand/local-rules/singleton-similarity-rule.scm
scheme
============================================================================= SingletonSimilarityRule SetLink A SetLink B |- A B ----------------------------------------------------------------------------- Name the rule
IntensionalSimilarity IntensionalSimilarity (define pln-rule-singleton-similarity (BindLink (VariableList (VariableNode "$A") (VariableNode "$B")) (IntensionalSimilarityLink (SetLink (VariableNode "$A")) (SetLink (V...
bee3d02e981c3bfe8d2a51dd2b29250541673896433e53c654045543230fc393
anton-k/processing-for-haskell
Interpolate.hs
-- original code: Linear Interpolation . -- -- Move the mouse across the screen and the symbol will follow. -- Between drawing each frame of the animation, the ellipse moves part of the distance ( 0.05 ) from its current position toward -- the cursor using the lerp() function * This is the same as the Easing un...
null
https://raw.githubusercontent.com/anton-k/processing-for-haskell/7f99414f3c266135b6a2848978fcb572fd7b67b1/examples/Math/Interpolate.hs
haskell
original code: Move the mouse across the screen and the symbol will follow. Between drawing each frame of the animation, the ellipse moves the cursor using the lerp() function * This is the same as --------------------------------------- Side note
Linear Interpolation . part of the distance ( 0.05 ) from its current position toward the Easing under input only with lerp ( ) instead . import Graphics.Proc main = runProc $ def { procSetup = setup, procDraw = draw, procUpdate = update } width = 640 height = 360 center = 0.5 *^ (P2 width height) setup = do...
0cfea93c629e5d2458db240437799ce8b97be4b7d612432625b81ca52137a6c8
selfsame/procadia2016
tricks.clj
(ns game.tricks (:use hard.seed) (:require game.data)) (def prefixes [ 'fleeb 'sun 'heel 'big 'pop 'laser 'hard 'death 'wacko 'fun 'scoot ...
null
https://raw.githubusercontent.com/selfsame/procadia2016/31ecd59a776e1731b1a99cd9f6f2f511cde1d053/Assets/game/tricks.clj
clojure
(ns game.tricks (:use hard.seed) (:require game.data)) (def prefixes [ 'fleeb 'sun 'heel 'big 'pop 'laser 'hard 'death 'wacko 'fun 'scoot ...
3b3510519ef2fb8fdc6a4970bf8dc7742c8d194375ddaf7efabc30017825bddc
quephird/fun-with-quil
wavey-thingy.clj
(ns fun-with-quil.sketches.tweetable (:use quil.core)) (def screen-w 1024) (def screen-h screen-w) (defn make-wave-fn [] "[x1 y1] specifies the epicenter of the waves [x2 y2] specifies an anti-epicenter of sorts l controls the length between waves b controls the width of the crests" (let [[x1 y1] [(ran...
null
https://raw.githubusercontent.com/quephird/fun-with-quil/3b3a6885771f5a1a4cffeb8379f05a28048a1616/src/fun_with_quil/sketches/wavey-thingy.clj
clojure
(ns fun-with-quil.sketches.tweetable (:use quil.core)) (def screen-w 1024) (def screen-h screen-w) (defn make-wave-fn [] "[x1 y1] specifies the epicenter of the waves [x2 y2] specifies an anti-epicenter of sorts l controls the length between waves b controls the width of the crests" (let [[x1 y1] [(ran...
eeb7152e15d8d236ef3d46cee89e61b89d1e09039ffaec5b0e717fa3d6f4537d
mirage/ocaml-9p
protocol_9p_client.mli
* Copyright ( C ) 2015 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
null
https://raw.githubusercontent.com/mirage/ocaml-9p/b72ccf01d3c8d7942e7ba8daefda08bf08c902b1/lib/protocol_9p_client.mli
ocaml
* A thread which wakes up when the connection to the server has been broken * [create t path name perm] creates a new empty file [name] inside [path] with * the given permissions. * [read t path offset count] returns a list of buffers containing [count] bytes from offset [offset] in the file given b...
* Copyright ( C ) 2015 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
540e921f9dd2e975a3557750bab17c91a13f338120f92cc4f60fa90f55769fd6
input-output-hk/project-icarus-importer
Failure.hs
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} -- | Toil failures. module Pos.Txp.Toil.Failure ( ToilVerFailure (..) , WitnessVerFailure (..) , TxOutVerFailure (..) ) where import Universum import qualified Data.Text.Buildable import Formatting (bprin...
null
https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/txp/Pos/Txp/Toil/Failure.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE DeriveAnyClass # | Toil failures. -------------------------------------------------------------------------- ToilVerFailure -------------------------------------------------------------------------- | Result of transaction processing ^ Transaction is already in the storage (ca...
module Pos.Txp.Toil.Failure ( ToilVerFailure (..) , WitnessVerFailure (..) , TxOutVerFailure (..) ) where import Universum import qualified Data.Text.Buildable import Formatting (bprint, build, int, ords, shown, stext, (%)) import GHC.TypeLits (TypeError) im...
06e30cc405900f433a7bf5d0ea78041a400abd2e736f9e588758f0343d8f66db
metosin/malli
cljs_kondo_preload.cljc
(ns malli.dev.cljs-kondo-preload "Shadow-cljs preload for browser builds, used to persist clj-kondo config collected from function schemas to disk during development." #?(:cljs (:require-macros [malli.dev.cljs-kondo-preload])) (:require [malli.clj-kondo :as clj-kondo] #?@(:cljs [[shado...
null
https://raw.githubusercontent.com/metosin/malli/04c39f20966f226b07d2c8ad860854d73cf4b1ac/src/malli/dev/cljs_kondo_preload.cljc
clojure
(ns malli.dev.cljs-kondo-preload "Shadow-cljs preload for browser builds, used to persist clj-kondo config collected from function schemas to disk during development." #?(:cljs (:require-macros [malli.dev.cljs-kondo-preload])) (:require [malli.clj-kondo :as clj-kondo] #?@(:cljs [[shado...
6271faddc5c6f845b1a31958013b8d4cdf4c64c8052b8e5196e6a3056ccfc523
2mol/pboy
Main.hs
module Main where 8888888b . d8888 8888888b . 888888888 8888888b . . .d88888b . Y88b d88P 888 Y88b d88888 888 Y88b888 888 Y88b 888 " 88b d88P " " Y88b Y88b d88P 888 888 d88P888 888 888888 888 888 888 .88P 888 888 Y88o88P 888 d88P d88P 888 888 ...
null
https://raw.githubusercontent.com/2mol/pboy/51b350c5d94dcfc8af7fdbb13b11946250137c98/app/Main.hs
haskell
module Main where 8888888b . d8888 8888888b . 888888888 8888888b . . .d88888b . Y88b d88P 888 Y88b d88888 888 Y88b888 888 Y88b 888 " 88b d88P " " Y88b Y88b d88P 888 888 d88P888 888 888888 888 888 888 .88P 888 888 Y88o88P 888 d88P d88P 888 888 ...
563117c7d54d82f43f44d80c8d90970313a82fb1fc9a00897bebd32b7f018c6d
haskell/unix
Signals004.hs
# OPTIONS_GHC -fno - warn - missing - signatures # module Main where import Control.Concurrent import System.Posix import Control.Monad -- signal stress test: threads installing signal handlers while -- signals are being constantly thrown and caught. installers = 50 too many signals overflows the IO manager 's pi...
null
https://raw.githubusercontent.com/haskell/unix/4291a5bf644449b57bb1d6e8c75ef582c09a8803/tests/Signals004.hs
haskell
signal stress test: threads installing signal handlers while signals are being constantly thrown and caught. to be the most we can get away with:
# OPTIONS_GHC -fno - warn - missing - signatures # module Main where import Control.Concurrent import System.Posix import Control.Monad installers = 50 too many signals overflows the IO manager 's pipe buffer , this seems sigs = 400 main = do c <- newChan m <- newEmptyMVar _ <- installHandler sigUSR1 (hand...
748c8ed528053740f05bf3f0ce43dbbc3e73b9aec5a44abebe89df012597f558
janestreet/async_unix
time_source_tests.ml
open! Core open! Import module Time_source = Async_kernel.Time_source let run_cycles_until_no_jobs_remain = Kernel_scheduler.run_cycles_until_no_jobs_remain let%bench_module "Clock.every" = (module struct let scheduler = Kernel_scheduler.t () let time_source = scheduler.time_source |> Time_source.of_synchro...
null
https://raw.githubusercontent.com/janestreet/async_unix/2562a6b9316d7c6757726305482380bd7e6dba06/src/time_source_tests.ml
ocaml
open! Core open! Import module Time_source = Async_kernel.Time_source let run_cycles_until_no_jobs_remain = Kernel_scheduler.run_cycles_until_no_jobs_remain let%bench_module "Clock.every" = (module struct let scheduler = Kernel_scheduler.t () let time_source = scheduler.time_source |> Time_source.of_synchro...
4521ed80f92e55f2c762e2bf49e8905105d16ad38f3df7d4b85105a82d11ea17
ocaml-multicore/ocaml-tsan
map.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/ae9c1502103845550162a49fcd3f76276cdfa866/stdlib/map.ml
ocaml
************************************************************************ OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the module type OrderedType = sig type t val compare: t -> t -> int end module type S = sig ...
a69c29a88f02162f95d320b1f1e170cd83e9c7f68756335224f0729cc74192be
saltlang/saltlang
Control.hs
Copyright ( c ) 2015 . All rights reserved . -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1 . Redistributions of source code must retain the above copyright -- notice, this list of conditions and ...
null
https://raw.githubusercontent.com/saltlang/saltlang/f3478904139f19373f23824f25d28e8be745dc60/test/library/Tests/Control.hs
haskell
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer in the documentation and/or other ma...
Copyright ( c ) 2015 . All rights reserved . 1 . Redistributions of source code must retain the above copyright 2 . Redistributions in binary form must reproduce the above copyright 3 . Neither the name of the author nor the names of any contributors THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTO...
1b5571893886efdfaf240f193c05baad99772a17d7defe9be6e200e5dae242fa
darioteixeira/rip
database.ml
(********************************************************************************) Database.ml Copyright ( c ) 2016 < > Copyright (c) 2016 Dario Teixeira <> *) (********************************************************************************) type t = { dict: (int, string) Hashtbl.t; muta...
null
https://raw.githubusercontent.com/darioteixeira/rip/b915d0ade721c1e89dfeae36fbc847948aa03286/examples/01-crud/database.ml
ocaml
****************************************************************************** ****************************************************************************** ****************************************************************************** * {1 Public functions and values} ****...
Database.ml Copyright ( c ) 2016 < > Copyright (c) 2016 Dario Teixeira <> *) type t = { dict: (int, string) Hashtbl.t; mutable counter: int; } let init () = { dict = Hashtbl.create 10; counter = 0; } let get_one db id = try Some (Hashtbl.find db.dict id) wi...
abd42f798c33f9bff9371cef9305f9aa25e5e6aef275f431fa51e96379b584a8
angavrilov/ecl-compute
loops.lisp
;;; -*- mode:lisp; indent-tabs-mode: nil; -*- (in-package fast-compute) (defun get-num-step (step) (match step (`(* ,x) x) (_ (or step 1)))) (defun get-ord-step (step) (match step (`(* ,_) nil) (_ step))) (defun index-iterexpr (item iname &key (as iname) (var as) step (skip '(0 0)) ...
null
https://raw.githubusercontent.com/angavrilov/ecl-compute/466f0d287f8b6ab0e2b5c2ac03693ad4f4df6a3f/logic/loops.lisp
lisp
-*- mode:lisp; indent-tabs-mode: nil; -*- Multiple bands Single band
(in-package fast-compute) (defun get-num-step (step) (match step (`(* ,x) x) (_ (or step 1)))) (defun get-ord-step (step) (match step (`(* ,_) nil) (_ step))) (defun index-iterexpr (item iname &key (as iname) (var as) step (skip '(0 0)) (skip-low (car skip)) (skip-high (ca...
2343256ac5879eb5c81a47b952472d2c28f8787509961e30b9d7fd1e64b9f2aa
gfour/gic
Eval.hs
-- | The ZOIL interpreter that corresponds to the \"dictionary\"-based semantics -- of the intensional language. -- It is call-by-name, /including the built-in IO functions/. Nested -- pattern matching is not supported. -- -- For more details, read: Fourtounis , , and . '' The Intensional -- ...
null
https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/SLIC/ITrans/Eval.hs
haskell
| The ZOIL interpreter that corresponds to the \"dictionary\"-based semantics of the intensional language. It is call-by-name, /including the built-in IO functions/. Nested pattern matching is not supported. For more details, read: Transformation for Functional Languages with User-Defined Data T...
Fourtounis , , and . '' The Intensional In Proceedings of the 8th Panhellenic Logic Symposium , 2011 . module SLIC.ITrans.Eval (evalZOILCBN) where import Data.List (intercalate) import SLIC.AuxFun (ierr, spaces) import SLIC.DFI (DFI) import SLIC.Front.Defunc (dfFlags) import SLIC.ITrans.Syntax ...
3089b0d1fee1c8a78dc3fa4f6bd7fba14f38823a833b01d60699c2216ebb3d2e
liqd/aula
AulaMetrics.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # # OPTIONS_GHC -Werror -Wall # module AulaMetrics ( AulaMetrics(..), aulaUsersGauge , registerAulaMetrics ) where import Control.Lens import System.Metrics (Store, createGauge) import System.Remote.Gauge (Gauge) data AulaMetrics = Aula...
null
https://raw.githubusercontent.com/liqd/aula/f96dbf85cd80d0b445e7d198c9b2866bed9c4e3d/src/AulaMetrics.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell # # OPTIONS_GHC -Werror -Wall # module AulaMetrics ( AulaMetrics(..), aulaUsersGauge , registerAulaMetrics ) where import Control.Lens import System.Metrics (Store, createGauge) import System.Remote.Gauge (Gauge) data AulaMetrics = AulaMetrics { _aulaUsersGauge :: Ga...
61dcbbb8637ad98fc65e58dddf66d8a09002cba3df6024c3a9dd6fb2ceaa0a7d
RNCryptor/rncryptor-hs
PasswordBasedVectors.hs
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module PasswordBasedVectors where import Crypto.MAC.HMAC (update) import Crypto.RNCryptor.Types import Crypto.RNCryptor.V3.Encrypt import Data.ByteString as B import Data.Byte...
null
https://raw.githubusercontent.com/RNCryptor/rncryptor-hs/a81769adad6a446aac75c5e8741b9dd2ae4c311f/test/PasswordBasedVectors.hs
haskell
# LANGUAGE BangPatterns # # LANGUAGE OverloadedStrings # ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Test the streaming API --...
# LANGUAGE RecordWildCards # module PasswordBasedVectors where import Crypto.MAC.HMAC (update) import Crypto.RNCryptor.Types import Crypto.RNCryptor.V3.Encrypt import Data.ByteString as B import Data.ByteString.Base16 import Data.Monoid import qualified Data....
99edeccab5639d8e77ba266b67082d4ab3a829863bb6ca00f7406fc5cc55298d
LennMars/algorithms_in_OCaml
sequentialPrediction.ml
open Util let anon_fun s = "unknown argument: " ^ s |> print_endline (* options init *) let to_display = ref false let seed = ref 0 let turn = ref 1 let prob = ref 0.5 let m = ref 10 let spec_display = ("-d", Arg.Bool (fun x -> to_display := x), "") let spec_seed = ("-s", Arg.Int (fun x -> seed := x), "set seed") let ...
null
https://raw.githubusercontent.com/LennMars/algorithms_in_OCaml/f7fb8ca9f497883d86be3167bfc98a4a28ac73c9/machineLearning/sequentialPrediction.ml
ocaml
options init Sampling from binomial distribution whose #experiments is n and success probability is p. binomial coefficient C(n, k).
open Util let anon_fun s = "unknown argument: " ^ s |> print_endline let to_display = ref false let seed = ref 0 let turn = ref 1 let prob = ref 0.5 let m = ref 10 let spec_display = ("-d", Arg.Bool (fun x -> to_display := x), "") let spec_seed = ("-s", Arg.Int (fun x -> seed := x), "set seed") let spec_turn = ("-t", ...
db47de28d7747b25c200af73c081b49ed6b07070a8d783f9dd03f5638880e0f4
kakaranet/white_rabbit
nsm_mq_db_test.erl
-module(nsm_mq_db_test). -include("nsm_mq.hrl"). -include_lib("eunit/include/eunit.hrl"). -compile(export_all). -define(APP, nsm_mq). -record(put_test_state, {publisher, worker}). -record(test_data, {id, payload}). start_basic_test_() -> {setup, fun start_application/0, fun(_) -> ...
null
https://raw.githubusercontent.com/kakaranet/white_rabbit/7cb50b6cda93a95981c6a680cfd4462a426ccc54/test/nsm_mq_db_test.erl
erlang
wait until data arrive to writer and will be stored this function is only for testing purposes and not exported when compiled not for tests. Local functions change message queue parameters to prevent damage of the real data
-module(nsm_mq_db_test). -include("nsm_mq.hrl"). -include_lib("eunit/include/eunit.hrl"). -compile(export_all). -define(APP, nsm_mq). -record(put_test_state, {publisher, worker}). -record(test_data, {id, payload}). start_basic_test_() -> {setup, fun start_application/0, fun(_) -> ...
d5d7dc6906dfb00824fa39124cbfcfbbe152ddfe0adb1726f1cf07c7159062ad
ekmett/auth
Auth.hs
# language AllowAmbiguousTypes # {-# language ConstraintKinds #-} {-# language DefaultSignatures #-} {-# language DeriveFunctor #-} {-# language FlexibleContexts #-} # language KindSignatures # # language LambdaCase # # language RankNTypes # {-# language ScopedTypeVariables #-} {-# language TupleSections #-} # language...
null
https://raw.githubusercontent.com/ekmett/auth/51a5478a763b7c94fda42e1fc75eab42ce0970af/old/src/Auth.hs
haskell
# language ConstraintKinds # # language DefaultSignatures # # language DeriveFunctor # # language FlexibleContexts # # language ScopedTypeVariables # # language TupleSections # # language TypeFamilies # class ( forall a. Evident t (t a) , forall a. (Show a, Read a) => Evident t a) => Authentic t where Cont, Accum, .....
# language AllowAmbiguousTypes # # language KindSignatures # # language LambdaCase # # language RankNTypes # # language TypeApplications # # language TypeOperators # module Auth where import Control.Monad (ap) import Control.Monad.Trans.Class import Crypto.Hash.SHA1 import Data.ByteString.Lazy.UTF8 as UTF8 import Dat...
1e1f80193fcc047a44ab235b1cd2058054c7414387352e1afcdbf2695543c1eb
jepsen-io/jepsen
internal.clj
(ns jepsen.faunadb.internal "Explores internal consistency of FaunaDB transactions" (:refer-clojure :exclude [test]) (:import com.faunadb.client.errors.UnavailableException) (:import java.io.IOException) (:import java.util.concurrent.ExecutionException) (:require [jepsen [client :as client] ...
null
https://raw.githubusercontent.com/jepsen-io/jepsen/a75d5a50dd5fa8d639a622c124bf61253460b754/faunadb/src/jepsen/faunadb/internal.clj
clojure
Indices aren't necessarily serializable, so we have to check here to make sure the things we're deleting still exist This is neat: temporal queries which happen to be at the current txn timestamp observe mutability. Note that we permute this object literal in the opposite order to the let binding, so that we en...
(ns jepsen.faunadb.internal "Explores internal consistency of FaunaDB transactions" (:refer-clojure :exclude [test]) (:import com.faunadb.client.errors.UnavailableException) (:import java.io.IOException) (:import java.util.concurrent.ExecutionException) (:require [jepsen [client :as client] ...
2221dad14b42ae9721166d2c97a1f896895dd4974e979f8e04746c9e94d9dfa6
runeksvendsen/orderbook
Util.hs
module OrderBook.Util ( combine -- * Re-exports , sortOn ) where import Prelude import Data.List (sortOn) -- | Combine adjacent list items. -- -- Invariants: -- "combine (const $ const Nothing) = id" " combine ( const $ const $ Just value ) _ = [ value ] " combine :: (a -> a -> Maybe a...
null
https://raw.githubusercontent.com/runeksvendsen/orderbook/6521d80ffbf17a524de70bda040da170643e5e78/src/OrderBook/Util.hs
haskell
* Re-exports | Combine adjacent list items. Invariants: "combine (const $ const Nothing) = id" otherwise 'Nothing'.
module OrderBook.Util ( combine , sortOn ) where import Prelude import Data.List (sortOn) " combine ( const $ const $ Just value ) _ = [ value ] " combine :: (a -> a -> Maybe a) ^ If the two adjacent list items can be combined , return ' Just ' of an item that is the combination of the two...
cb2af8903750097beb0c2bddd6e5a33f3621a37c649a90156b60eb43f9e7f7aa
NaOHman/XMonadPlus
GroupNavigation.hs
{-# LANGUAGE DeriveDataTypeable #-} ---------------------------------------------------------------------- -- | Module : XMonad . Actions . GroupNavigation -- Copyright : (c) -- License : BSD3-style (see LICENSE) -- -- Maintainer : -- Stability : unstable -- Portability : unportable -- -- Provides m...
null
https://raw.githubusercontent.com/NaOHman/XMonadPlus/1495e102ae3304817d1897a393e1f31fef71d41f/xmonad-contrib-darcs/XMonad/Actions/GroupNavigation.hs
haskell
# LANGUAGE DeriveDataTypeable # -------------------------------------------------------------------- | Copyright : (c) License : BSD3-style (see LICENSE) Maintainer : Stability : unstable Portability : unportable Provides methods for cycling through groups of windows across workspaces, ignoring win...
Module : XMonad . Actions . GroupNavigation Direction (..) , nextMatch , nextMatchOrDo , nextMatchWithThis , historyHo...
ef95f3b064a9aff08892a2f653bb240b96fa18d07b352e365725ea515525a846
roddyyaga/quests
response.mli
(** Functions for dealing with responses from requests. *) (** The response from a request. The [request] field contains details about the actual request sent (for instance, it includes headers added by Quests, and the URL will have a query string with any supplied parameters. *) type t = { content: string; status...
null
https://raw.githubusercontent.com/roddyyaga/quests/72395040b5da1f02a6fe3a0fe0d1e96e9f8d50cd/lib/response.mli
ocaml
* Functions for dealing with responses from requests. * The response from a request. The [request] field contains details about the actual request sent (for instance, it includes headers added by Quests, and the URL will have a query string with any supplied parameters. * Returns whether a request has been successful...
type t = { content: string; status_code: int; headers: Cohttp.Header.t; request: Request.t; } val pp : Format.formatter -> t -> unit [@@ocaml.toplevel_printer] val show : t -> string val content : t -> string val status_code : t -> int val headers : t -> Cohttp.Header.t val ok : t -> bool val json : t -...
0764d16eb2bf810bd76e3cc387407f28e6bb6df5ffbcc66d026e1af74dee0065
polyfy/polylith
color.clj
(ns polylith.clj.core.util.interface.color (:require [polylith.clj.core.util.colorizer :as colorizer])) (def none "none") (defn clean-colors [message] (colorizer/clean-colors message)) (defn blue [color-mode & messages] (colorizer/blue color-mode messages)) (defn cyan [color-mode & messages] (colorizer/cyan...
null
https://raw.githubusercontent.com/polyfy/polylith/76936c752fb5b729c216b23d92c8a8d71cfdc92f/components/util/src/polylith/clj/core/util/interface/color.clj
clojure
(ns polylith.clj.core.util.interface.color (:require [polylith.clj.core.util.colorizer :as colorizer])) (def none "none") (defn clean-colors [message] (colorizer/clean-colors message)) (defn blue [color-mode & messages] (colorizer/blue color-mode messages)) (defn cyan [color-mode & messages] (colorizer/cyan...
e1bdeb829ef58731731fdf7f164dff89f15127b23fbb156607502930f652735b
jumarko/web-development-with-clojure
core_test.cljs
;--- Excerpted from " Web Development with Clojure , Second Edition " , published by The Pragmatic Bookshelf . Copyrights apply to this code . It may not be used to create training material , ; courses, books, articles, and the like. Contact us if you are in doubt. ; We make no guarantees that this code is fit fo...
null
https://raw.githubusercontent.com/jumarko/web-development-with-clojure/dfff6e40c76b64e9fcd440d80c7aa29809601b6b/code/picture-gallery-war/test/cljs/picture_gallery/core_test.cljs
clojure
--- courses, books, articles, and the like. Contact us if you are in doubt. We make no guarantees that this code is fit for any purpose. Visit for more book information. ---
Excerpted from " Web Development with Clojure , Second Edition " , published by The Pragmatic Bookshelf . Copyrights apply to this code . It may not be used to create training material , (ns picture-gallery.core-test (:require [cljs.test :refer-macros [is are deftest testing use-fixtures]] [reagent....
cb40b4d3a75280c67a0aef54691b427e0d8a97d78f895851489cb60a52c84fa4
erlangonrails/devdb
vclock.erl
2007 - 2008 Basho Technologies ( 1978 ) . " Time , clocks , and the ordering of events in a distributed system " . Communications of the ACM 21 ( 7 ): 558 - 565 . ( 1988 ) . " Virtual Time and Global States of Distributed Systems " . Workshop on Parallel and Distributed Algorithms : pp . 215 - 226 @au...
null
https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/kai-0.4.0/src/vclock.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 permissions...
2007 - 2008 Basho Technologies ( 1978 ) . " Time , clocks , and the ordering of events in a distributed system " . Communications of the ACM 21 ( 7 ): 558 - 565 . ( 1988 ) . " Virtual Time and Global States of Distributed Systems " . Workshop on Parallel and Distributed Algorithms : pp . 215 - 226 @au...
27c57b0b1ca6befe819673cf1fbde27f80f02d71a82c2f8202d93674fcfea309
bn-d/ppx_pyformat
test_pyformat_rewriter.ml
open OUnit2 let test exp act _ = assert_equal ~printer:Fun.id exp act let text_tests = "text" >::: [ "simple" >:: test "123abcABC,.;' \t\n" [%pyformat "123abcABC,.;' \t\n"]; "curl_escape" >:: test "{}}{" [%pyformat "{{}}}}{{"]; "consolidation" >:: test "123{}321" [%pyformat "123{{}}321"...
null
https://raw.githubusercontent.com/bn-d/ppx_pyformat/bcb0031cf9fbce12d54d0e8d927ecf41ff3cab97/test/rewriter/test_pyformat_rewriter.ml
ocaml
precision_tests;
open OUnit2 let test exp act _ = assert_equal ~printer:Fun.id exp act let text_tests = "text" >::: [ "simple" >:: test "123abcABC,.;' \t\n" [%pyformat "123abcABC,.;' \t\n"]; "curl_escape" >:: test "{}}{" [%pyformat "{{}}}}{{"]; "consolidation" >:: test "123{}321" [%pyformat "123{{}}321"...
4817fced48e1f42d17b529f7960bb3d8738cdc5c823e461dc1156dc415ddd622
clojure-interop/google-cloud-clients
Storage$BlobTargetOption.clj
(ns com.google.cloud.storage.Storage$BlobTargetOption "Class for specifying blob target options." (:refer-clojure :only [require comment defn ->]) (:import [com.google.cloud.storage Storage$BlobTargetOption])) (defn *user-project "Returns an option for blob's billing user project. This option is only used by t...
null
https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.storage/src/com/google/cloud/storage/Storage%24BlobTargetOption.clj
clojure
at present, this is only for upload.
(ns com.google.cloud.storage.Storage$BlobTargetOption "Class for specifying blob target options." (:refer-clojure :only [require comment defn ->]) (:import [com.google.cloud.storage Storage$BlobTargetOption])) (defn *user-project "Returns an option for blob's billing user project. This option is only used by t...
b103e5e1a6476c47ced38552a69077e42aa072940daee0267a0855cc8750706d
lispbuilder/lispbuilder
video.lisp
(in-package #:lispbuilder-sdl-cffi) (defbitfield hardware-flags (:hw-available #x0001) (:wm-available #x0002) (:unused_bits_1 #x0004) (:unused_bits_2 #x0008) (:unused_bits_3 #x0010) (:unused_bits_4 #x0020) (:unused_bits_5 #x0040) (:unused_bits_6 #x0080) (:unused_bits_7 #x0100) ...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/cffi/video.lisp
lisp
New for SDL-1.2.11 New for SDL-1.2.11 (defun SDL_AllocSurface ()
(in-package #:lispbuilder-sdl-cffi) (defbitfield hardware-flags (:hw-available #x0001) (:wm-available #x0002) (:unused_bits_1 #x0004) (:unused_bits_2 #x0008) (:unused_bits_3 #x0010) (:unused_bits_4 #x0020) (:unused_bits_5 #x0040) (:unused_bits_6 #x0080) (:unused_bits_7 #x0100) ...
a659bc34ecff539d911baf9dba84a1712d85e84c19319ba1e7eba2af7c9472bb
ijvcms/chuanqi_dev
map_32112.erl
-module(map_32112). -export([ range/0, data/0 ]). range() -> {36, 24}. data() -> { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1...
null
https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/map_data/map_32112.erl
erlang
-module(map_32112). -export([ range/0, data/0 ]). range() -> {36, 24}. data() -> { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,1,1...
2d5990f7712b9198b21d0d4a3143fbc39fd3eaff800d024953de6ac9439aae38
conal/Fran
Point2.hs
RBMH 2d point abstraction . -- Last modified We d Nov 05 16:24:57 1997 -- When has type relations ( multi - parameter type classes ) , move most of stuff to an AffineSpace type relation . -- -- To do: replace names like "pointPlusVector2" with arithmetic-looking -- operators. module Point2 ...
null
https://raw.githubusercontent.com/conal/Fran/a113693cfab23f9ac9704cfee9c610c5edc13d9d/src/Point2.hs
haskell
To do: replace names like "pointPlusVector2" with arithmetic-looking operators. :: Point2 :: RealVal -> RealVal -> Point2 :: Radians -> Length -> Point2 :: Point2 -> Point2 -> Length :: Point2 -> Point2 -> Length :: Point2 -> Point2 -> RealVal -> Point2 :: Point2 -> Vector2 :: Point2 -...
RBMH 2d point abstraction . Last modified We d Nov 05 16:24:57 1997 When has type relations ( multi - parameter type classes ) , move most of stuff to an AffineSpace type relation . module Point2 ( Point2(..) : : Point2 - > ( RealVal , ) : : Point2 - > ( Length , Radi...
ca02d4a0f09e2d0baf3ae2ff229dd07adad4f74c92a3097d2f5bddb36d2d09c1
hdevtools/hdevtools
CommandLoop.hs
# LANGUAGE CPP , ViewPatterns # module CommandLoop ( newCommandLoopState , Config(..) , CabalConfig(..) , updateConfig , startCommandLoop ) where import Control.Exception import Control.Applicative ((<|>)) import Control.Monad (when, void) import Data.IORef import Data.List (find, intercalate)...
null
https://raw.githubusercontent.com/hdevtools/hdevtools/a866f017b74f4b27fabda0861f635da82e43d9fe/src/CommandLoop.hs
haskell
Exit Exit or errors to stdout for the loaded source files, we're only interested in the module graph of the loaded targets reset the old log_action
# LANGUAGE CPP , ViewPatterns # module CommandLoop ( newCommandLoopState , Config(..) , CabalConfig(..) , updateConfig , startCommandLoop ) where import Control.Exception import Control.Applicative ((<|>)) import Control.Monad (when, void) import Data.IORef import Data.List (find, intercalate)...
ac02c040385e0c5b53b8a929683632377519a92a64b3b19275897c7557a16703
mvaldesdeleon/aoc18
Day15Main.hs
module Day15Main where import Day15 (day15) main :: IO () main = day15
null
https://raw.githubusercontent.com/mvaldesdeleon/aoc18/1a6f6de7c482e5de264360e36f97a3c7487e2457/app/Day15Main.hs
haskell
module Day15Main where import Day15 (day15) main :: IO () main = day15
91adb95a98f2b1165fae1681f1ac243a7751efc09e091082fd1d0a32a140447a
jaked/ooauth
oauth_util.ml
open Oauth_common let make_key ?(rng = Cryptokit.Random.device_rng "/dev/random") () = Cryptokit.Random.string rng 16 |> Cryptokit.transform_string (Oauth_base32.encode ())
null
https://raw.githubusercontent.com/jaked/ooauth/8fa9d19570c7c5dea1036b5e9f5bbd945e51166d/oauth_util.ml
ocaml
open Oauth_common let make_key ?(rng = Cryptokit.Random.device_rng "/dev/random") () = Cryptokit.Random.string rng 16 |> Cryptokit.transform_string (Oauth_base32.encode ())
dee340eefe539c2a2d9ede5edceef873bc1f34496a773a27e5f16e32d1233cd2
openmusic-project/OMChroma
regions.lisp
;===================================================== ; CHROMA ;===================================================== part of the OMChroma library - > High - level control of sound synthesis in OM ;===================================================== ; ;This program is free software; you can redistribute it and/...
null
https://raw.githubusercontent.com/openmusic-project/OMChroma/5ded34f22b59a1a93ea7b87e182c9dbdfa95e047/sources/chroma/models/regions.lisp
lisp
===================================================== CHROMA ===================================================== ===================================================== This program is free software; you can redistribute it and/or either version 2 of the License, or (at your option) any later version. See file LIC...
part of the OMChroma library - > High - level control of sound synthesis in OM modify it under the terms of the GNU General Public License (in-package :chroma) (defclass regions (chroma-model) ((region-list :accessor region-list :initform () :initarg :region-list :docume...
e13d51b0e36c84f21c7abba1c715898fcc20824558a02edb43d01c185aab4bc7
lambe-lang/nethra
t01_eval.ml
open Common open Nethra.Syntax.Parser let parser_eos () = let open Parsers.Eval (Parsec) in let result = response @@ eos @@ Parsec.source [] and expected = (Some (), false) in Alcotest.(check (pair (option unit) bool)) "eos" expected result let parser_eos_fail () = let open Parsers.Eval (Parsec) in let re...
null
https://raw.githubusercontent.com/lambe-lang/nethra/42d891fca424bd9365e09236b36f51c0e8799db3/test/nethra/syntax/t01_eval.ml
ocaml
open Common open Nethra.Syntax.Parser let parser_eos () = let open Parsers.Eval (Parsec) in let result = response @@ eos @@ Parsec.source [] and expected = (Some (), false) in Alcotest.(check (pair (option unit) bool)) "eos" expected result let parser_eos_fail () = let open Parsers.Eval (Parsec) in let re...
2eaf1b10b6dacb50157e89247074206bbf78f82f6f018df841af4507fc8fb9f4
strojure/ring-undertow
session_test.clj
(ns ring.session-test (:require [clojure.test :as test :refer [deftest testing]] [java-http-clj.core :as http] [strojure.ring-undertow.server :as server] [strojure.undertow.api.types :as types] [strojure.undertow.handler :as handler]) (:import (java.net CookieManager)...
null
https://raw.githubusercontent.com/strojure/ring-undertow/90ceb30f0ea3966429f10f1920c33791a393bdeb/test/ring/session_test.clj
clojure
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
(ns ring.session-test (:require [clojure.test :as test :refer [deftest testing]] [java-http-clj.core :as http] [strojure.ring-undertow.server :as server] [strojure.undertow.api.types :as types] [strojure.undertow.handler :as handler]) (:import (java.net CookieManager)...
fe414abed75ab1a122ab02994c869cca31d722d160f96b4d502b34d145aa9918
stolyaroleh/grafanix
Nix.hs
module Nix ( drvPath , pkgPath , depGraph ) where import Control.Error ( Script , scriptIO ) import Data.Attoparsec.Text ( Parser ...
null
https://raw.githubusercontent.com/stolyaroleh/grafanix/d4689ac9d5c1cb085da7a725b56931eb23472b6a/backend/src/Nix.hs
haskell
Attempt to strip a color sequence All color sequences look like this: ESC[#(;#)m
module Nix ( drvPath , pkgPath , depGraph ) where import Control.Error ( Script , scriptIO ) import Data.Attoparsec.Text ( Parser ...
152f72351f471b93ebd476c7f6240206005484915a8e2797c7d4c86c3078dbee
chrovis/cljam
cli.clj
(ns cljam.tools.cli "Implementations of the command-line tool." (:refer-clojure :exclude [sort merge]) (:require [clojure.string :as cstr] [clj-sub-command.core :refer [sub-command candidate-message]] [clojure.tools.cli :refer [parse-opts]] [cljam.io.sam :as sam] [c...
null
https://raw.githubusercontent.com/chrovis/cljam/2b8e7386765be8efdbbbb4f18dbc52447f4a08af/src/cljam/tools/cli.clj
clojure
CLI functions ------------- Sub-commands ------------ Main command ------------
(ns cljam.tools.cli "Implementations of the command-line tool." (:refer-clojure :exclude [sort merge]) (:require [clojure.string :as cstr] [clj-sub-command.core :refer [sub-command candidate-message]] [clojure.tools.cli :refer [parse-opts]] [cljam.io.sam :as sam] [c...
3dab1640167907bf9bf2a1642632e8dd5b7cdb6ac662e199b31f6e88c2351a71
herd/herdtools7
backend.mli
(****************************************************************************) (* the diy toolsuite *) (* *) , University College London , UK . , INRIA Par...
null
https://raw.githubusercontent.com/herd/herdtools7/daedd7431cb00884afea2ec39749222e2c367c6b/asllib/backend.mli
ocaml
************************************************************************** the diy toolsuite en Automatique and ...
, University College London , UK . , INRIA Paris - Rocquencourt , France . Copyright 2015 - present Institut National de Recherche en Informatique et This software is governed by the CeCILL - B license under French law and modify and/ or redistribu...
5abb5ba5f4f0b61b52041379644578dcffdac3389f001068b6b3299c336e6fc2
mbutterick/aoc-racket
01.rkt
#lang br (require racket/file rackunit) (define depths (map string->number (file->lines "01.rktd"))) (define (positive-deltas depths) (filter positive? (for/list ([d1 (in-list depths)] [d2 (in-list (cdr depths))]) (- d2 d1)))) (check-equal? (length (positive-deltas depths...
null
https://raw.githubusercontent.com/mbutterick/aoc-racket/af8752d29ecf8642dfc93bad7bed2ef2f9f62fd8/2021/01.rkt
racket
#lang br (require racket/file rackunit) (define depths (map string->number (file->lines "01.rktd"))) (define (positive-deltas depths) (filter positive? (for/list ([d1 (in-list depths)] [d2 (in-list (cdr depths))]) (- d2 d1)))) (check-equal? (length (positive-deltas depths...
9b8c90f4f0b1d89f336fab1d804db42b895ef4a57400bf8044781b4ee6fcf359
txyyss/Project-Euler
Euler096.hs
( Japanese meaning number place ) is the name given to a -- popular puzzle concept. Its origin is unclear, but credit must be attributed to who invented a similar , and much more difficult , puzzle idea called Latin Squares . The objective of Su Doku puzzles , however , is to replace the blanks ( or zeros )...
null
https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler096.hs
haskell
popular puzzle concept. Its origin is unclear, but credit must be starting puzzle grid and its solution grid. solved by logic, although it may be necessary to employ "guess and test" methods in order to eliminate options (there is much contested opinion over this). The complexity of the search determines the diff...
( Japanese meaning number place ) is the name given to a attributed to who invented a similar , and much more difficult , puzzle idea called Latin Squares . The objective of Su Doku puzzles , however , is to replace the blanks ( or zeros ) in a 9 by 9 grid in such that each row , column , and 3 by 3 box c...
7fd1b11fb1f4b7405035110d087a77ba7d1bb0d89801cb64a02d288c340ba24f
borkdude/respeced
impl.cljc
(ns ^:no-doc respeced.impl (:require [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as stest] #?(:cljs [goog.string]) [clojure.test.check] [clojure.test.check.properties]) #?(:cljs (:require-macros [respeced.impl :refer [deftime ? with-instrument-disabled...
null
https://raw.githubusercontent.com/borkdude/respeced/3d36adfa019214f5a8afe5f3a4a4c8d898cc02b6/src/respeced/impl.cljc
clojure
(ns ^:no-doc respeced.impl (:require [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as stest] #?(:cljs [goog.string]) [clojure.test.check] [clojure.test.check.properties]) #?(:cljs (:require-macros [respeced.impl :refer [deftime ? with-instrument-disabled...
22c02fda0d9dff376f5554b1b2e3605026a7cbf234f0bf703dfa65ef1ee61925
vagarenko/static-tensor
VectorLenSquare.hs
# LANGUAGE TypeApplications # {-# LANGUAGE TypeInType #-} module CoreDump.Vector.VectorLenSquare where import Data.Vector.Static import TensorInstances () vectorLenSquare_ :: Vector 4 Float -> Float vectorLenSquare_ = vectorLenSquare
null
https://raw.githubusercontent.com/vagarenko/static-tensor/8409d281707c23f3fe2028e926f1d4e8f7a9bc2d/tests/CoreDump/Vector/VectorLenSquare.hs
haskell
# LANGUAGE TypeInType #
# LANGUAGE TypeApplications # module CoreDump.Vector.VectorLenSquare where import Data.Vector.Static import TensorInstances () vectorLenSquare_ :: Vector 4 Float -> Float vectorLenSquare_ = vectorLenSquare
caf5be0f1a804636e9a99f6ff0dd50dac245e7444c79d04df4d3626942710060
defaultxr/cl-patterns
pdef.lisp
;;;; pdef.lisp - pdef and associated functionality to define and reference "named patterns". ;;; FIX: ;;; - implement `reset' method and test to ensure end-condition works properly (in-package #:cl-patterns) (defgeneric pdef-name (pdef) (:documentation "The name (\"key\") of PDEF.")) (defgeneric pdef-pattern (pdef...
null
https://raw.githubusercontent.com/defaultxr/cl-patterns/d7ee3a64b031240149dcac676ac11df594cff371/src/patterns/pdef.lisp
lisp
pdef.lisp - pdef and associated functionality to define and reference "named patterns". FIX: - implement `reset' method and test to ensure end-condition works properly (play (pdef :foo)) ; redefine the pdef 's pattern ... note that the redefinition does n't become audible until the current loop finishes playing :...
(in-package #:cl-patterns) (defgeneric pdef-name (pdef) (:documentation "The name (\"key\") of PDEF.")) (defgeneric pdef-pattern (pdef) (:documentation "The pattern that PDEF points to.")) (defgeneric pdef-pstream (pdef) (:documentation "The currently-playing pstream of PDEF's pattern.")) (defgeneric pdef-ta...
72d754a724e1b7fad2041712f7b87c8f293dfd25f6d521dfea823e6d3e59c1b8
metametadata/clj-fakes
macros.cljc
(ns unit.fixtures.macros (:require [clj-fakes.core :as f] [clj-fakes.context :as fc]) ; declare macros for export #?(:cljs (:require-macros [unit.fixtures.macros :refer [my-fake ctx-my-fake my-recorded-fake ctx-my-recorded-fake ...
null
https://raw.githubusercontent.com/metametadata/clj-fakes/d928ddfd11b150b1cd2df5621265c447bf42395a/test/unit/fixtures/macros.cljc
clojure
declare macros for export
(ns unit.fixtures.macros (:require [clj-fakes.core :as f] [clj-fakes.context :as fc]) #?(:cljs (:require-macros [unit.fixtures.macros :refer [my-fake ctx-my-fake my-recorded-fake ctx-my-recorded-fake my-reify-fake ...
38823f2370287210168ba0747406fbb09d21ffbb333d2334a2b74d1bf7a7e914
lispnik/cl-http
update.lisp
(in-package "URL") Prototype Fast Dynamic Updates to registered URLs . Copyright ( C ) 1995 ( OBC ) all rights reserved . ;;; ;;; This provides fast and cheap alternatives to reloading all exports ;;; to update the server when anything signification changes in the ;;; server location such as new name, new address...
null
https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/acl/server/update.lisp
lisp
This provides fast and cheap alternatives to reloading all exports to update the server when anything signification changes in the server location such as new name, new address, new port or new physical location for contents. Provide bare updating the url table for local context changes and for translated pathn...
(in-package "URL") Prototype Fast Dynamic Updates to registered URLs . Copyright ( C ) 1995 ( OBC ) all rights reserved . in one place and move it to a new site where it will start running (defpackage "URL" (:use) (:export "UPDATE-URLS" "UPDATE-URLS-PATHNAME" "SHOW-URLS")) (defvar *url-table2* (make-hash-ta...
cff3bd845f17441de06a0f0ace2e81e341095a57d4914846ec8291d49bb0e47b
MaskRay/OJHaskell
39.hs
import Data.Array import Data.List import Data.Ord f x = [a+b+c | m <- [2..ceiling . sqrt . fromIntegral $ x], n <- [1..m-1], let a = m^2-n^2; b = 2*m*n; c = m^2+n^2, a+b+c <= x, even a || even b, gcd a b == 1] g n = [x*p | x <- f n, p <- [1..n `div` x]] main = print . head . maximumBy (comparing length) . gr...
null
https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Project%20Euler/39.hs
haskell
import Data.Array import Data.List import Data.Ord f x = [a+b+c | m <- [2..ceiling . sqrt . fromIntegral $ x], n <- [1..m-1], let a = m^2-n^2; b = 2*m*n; c = m^2+n^2, a+b+c <= x, even a || even b, gcd a b == 1] g n = [x*p | x <- f n, p <- [1..n `div` x]] main = print . head . maximumBy (comparing length) . gr...