_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
521b39314b135a3c0b09d0f2e30f4c78dca29fb39b6a417691e4bc3c67121d49
lasp-lang/lasp
lasp_storage_backend.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2014 SyncFree Consortium . All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may obtain...
null
https://raw.githubusercontent.com/lasp-lang/lasp/1701c8af77e193738dfc4ef4a5a703d205da41a1/src/lasp_storage_backend.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2014 SyncFree Consortium . All Rights Reserved . This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(las...
c82d59005ee5b1ddd133c16b0c7450033e05d41803976e47ba43cce736cb4d75
zadean/xqerl
xqerl_config.erl
Copyright ( c ) 2018 - 2020 . SPDX - FileCopyrightText : 2022 % SPDX - License - Identifier : Apache-2.0 @doc xqerl_config Handles the configuration files for xqerl . -module(xqerl_config). %% ==================================================================== %% API functions %% =================...
null
https://raw.githubusercontent.com/zadean/xqerl/06c651ec832d0ac2b77bef92c1b4ab14d8da8883/src/xqerl_config.erl
erlang
==================================================================== API functions ==================================================================== ==================================================================== ==================================================================== , trace_handler, stand...
Copyright ( c ) 2018 - 2020 . SPDX - FileCopyrightText : 2022 SPDX - License - Identifier : Apache-2.0 @doc xqerl_config Handles the configuration files for xqerl . -module(xqerl_config). -export([normalize/1]). normalize(App) -> Config = application:get_all_env(App), normalize(App, Config...
4d9424561fa031f2ee71ac7ca153ee0c00413b92ae5f8c05d83a5a2c6edbb6b0
TyOverby/mono
array_tests.ml
open Core open Core_bench let t1 = Bench.Test.create_indexed ~name:"ArrayCreateInt" ~args:[ 100; 200; 300; 400; 1000; 10000 ] (fun len -> Staged.stage (fun () -> for _ = 0 to 2000 do ignore (Array.create ~len 0) done)) ;; let tests = [ t1 ] let command = Bench.make_co...
null
https://raw.githubusercontent.com/TyOverby/mono/8d6b3484d5db63f2f5472c7367986ea30290764d/vendor/janestreet-core_bench/test/array_tests.ml
ocaml
open Core open Core_bench let t1 = Bench.Test.create_indexed ~name:"ArrayCreateInt" ~args:[ 100; 200; 300; 400; 1000; 10000 ] (fun len -> Staged.stage (fun () -> for _ = 0 to 2000 do ignore (Array.create ~len 0) done)) ;; let tests = [ t1 ] let command = Bench.make_co...
1ec14cb5a6be725c7733a1002532bdbd5260de95772a6da6bde22f9ae526e020
philnguyen/soft-contract
case-lambdas.rkt
#lang racket (define f (case-lambda [(x) x] [(x y) (+ x y)] [(x y . z) (string-join (cons (number->string x) ; don't have real `list*` yet (cons (number->string y) (map number->string z))) " + ")])) (define f1 (f 42)) (define f...
null
https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/issues/case-lambdas.rkt
racket
don't have real `list*` yet
#lang racket (define f (case-lambda [(x) x] [(x y) (+ x y)] [(x y . z) (cons (number->string y) (map number->string z))) " + ")])) (define f1 (f 42)) (define f2 (f 43 44)) (define f3 (f 45 46 47)) (provide (contract-out [f (para...
92f6b8dd2974f1540f364e10a8dff108f70f5aad2a834f815ec17f24e318d78a
mixphix/toolbox
Toolbox.hs
-- | -- Module : Data.Time.Format.Toolbox Copyright : ( c ) 2021 -- License : BSD3 (see the file LICENSE) -- Maintainer : -- -- Utility functions on top of 'Data.Time.Format'. -- -- This module re-exports the above module, so modules need only import 'Data.Time.Format.Toolbox'. module Data.Time.Fo...
null
https://raw.githubusercontent.com/mixphix/toolbox/9579422c75112c3108b9cfbc34d6bea21350ca8f/src/Data/Time/Format/Toolbox.hs
haskell
| Module : Data.Time.Format.Toolbox License : BSD3 (see the file LICENSE) Maintainer : Utility functions on top of 'Data.Time.Format'. This module re-exports the above module, so modules need only import 'Data.Time.Format.Toolbox'. * Formatting * Parsing * Re-exports | Format according to the ...
Copyright : ( c ) 2021 module Data.Time.Format.Toolbox ( mdy, ymd, shortMonthDayYear, longMonthDayYear, time24, time24s, time24ps, time12H, time12h, time12Hs, time12hs, ymd24, ymd24s, ymd24ps, ymd12H, ymd12h, ymd12Hs, parseMdy12hs, pars...
a1fe46a5feb90a91a295a5fd9cc1be5d81bdd01799dae6c7825a93e261424e1b
chef/chef-server
chefreq.erl
-module(chefreq). -compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). main([Path]) -> application:start(crypto), ssl:start(), ibrowse:start(), PFile = "/Users/seth/oc/environments/orgs/userprimary/.chef/seth.pem", {ok, PBin} = file:read_file(PFile), Private = ch...
null
https://raw.githubusercontent.com/chef/chef-server/6d31841ecd73d984d819244add7ad6ebac284323/src/oc_erchef/knife/chefreq.erl
erlang
-module(chefreq). -compile([export_all, nowarn_export_all]). -include_lib("eunit/include/eunit.hrl"). main([Path]) -> application:start(crypto), ssl:start(), ibrowse:start(), PFile = "/Users/seth/oc/environments/orgs/userprimary/.chef/seth.pem", {ok, PBin} = file:read_file(PFile), Private = ch...
77ffeb5d4b06ef0e101e10600e459930caf2397b046351859e135bb93c97f190
amosr/folderol
Helper.hs
module Bench.Array.Helper where # INLINE expensive # expensive :: Int -> Int expensive f = f * 2 # INLINE expensive1 # expensive1 :: Int -> Int expensive1 f = f * 2 # INLINE expensive2 # expensive2 :: Int -> Int expensive2 f = f `div` 2
null
https://raw.githubusercontent.com/amosr/folderol/9b8c0cd30cfb798dadaa404cc66404765b1fc4fe/bench/Bench/Array/Helper.hs
haskell
module Bench.Array.Helper where # INLINE expensive # expensive :: Int -> Int expensive f = f * 2 # INLINE expensive1 # expensive1 :: Int -> Int expensive1 f = f * 2 # INLINE expensive2 # expensive2 :: Int -> Int expensive2 f = f `div` 2
31e76ad44f08acdcb49f90d0f4f2b5311673c9642e708169cd190f0e41e53527
stan-dev/stanc3
Stmt.mli
(** MIR types and modules corresponding to the statements of the language *) open Common module Fixed : sig module Pattern : sig type ('a, 'b) t = | Assignment of 'a lvalue * 'a | TargetPE of 'a | NRFunApp of 'a Fun_kind.t * 'a list | Break | Continue | Return of 'a option ...
null
https://raw.githubusercontent.com/stan-dev/stanc3/975b2132890f2f6008875cee722ae4f766501952/src/middle/Stmt.mli
ocaml
* MIR types and modules corresponding to the statements of the language
open Common module Fixed : sig module Pattern : sig type ('a, 'b) t = | Assignment of 'a lvalue * 'a | TargetPE of 'a | NRFunApp of 'a Fun_kind.t * 'a list | Break | Continue | Return of 'a option | Skip | IfElse of 'a * 'b * 'b option | While of 'a * 'b ...
61bbb09a09c44a5ee2f1e556011b0f151b191909af9ff49b9a1be7877efa237c
yogthos/krueger
tag_editor.cljs
(ns krueger.components.widgets.tag-editor (:require [cljsjs.semantic-ui-react :as ui] [clojure.set :refer [difference]] [krueger.input-events :as input] [reagent.core :as r] [re-frame.core :refer [subscribe]] [re-frame.core :as rf]))
null
https://raw.githubusercontent.com/yogthos/krueger/782e1f8ab358867102b907c5a80e56ee6bc6ff82/src/cljs/krueger/components/widgets/tag_editor.cljs
clojure
(ns krueger.components.widgets.tag-editor (:require [cljsjs.semantic-ui-react :as ui] [clojure.set :refer [difference]] [krueger.input-events :as input] [reagent.core :as r] [re-frame.core :refer [subscribe]] [re-frame.core :as rf]))
7d8fffe2b4865dbcf99c35759c50e5e2112a69abcd0b52bc66970992f4103741
ucsd-progsys/liquidhaskell
Utf16.hs
# LANGUAGE MagicHash , BangPatterns # -- | -- Module : Data.Text.Encoding.Utf16 Copyright : ( c ) 2008 , 2009 , ( c ) 2009 , ( c ) 2009 -- -- License : BSD-style -- Maintainer : , , -- -- Stability : experimental Portability : GHC -- -- Basic UTF-...
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/benchmarks/text-0.11.2.3/Data/Text/Encoding/Utf16.hs
haskell
| Module : Data.Text.Encoding.Utf16 License : BSD-style Maintainer : , , Stability : experimental Basic UTF-16 validation and character manipulation.
# LANGUAGE MagicHash , BangPatterns # Copyright : ( c ) 2008 , 2009 , ( c ) 2009 , ( c ) 2009 Portability : GHC module Data.Text.Encoding.Utf16 ( chr2 , validate1 , validate2 ) where import GHC.Exts import GHC.Word (Word16(..)) chr2 :: Word16 -> Word...
bbeab1526b36b0c589e4f0ebb2fca7c129ee68dcf9d32b88e469d4661c029648
nkpart/kit
Repository.hs
module Kit.Repository ( -- KitRepository, makeRepository, -- readKitSpec, unpackKit, packagesDirectory, publishLocally ) where import Kit.Spec import Kit.Util import Data.Yaml (decodeFile) import Control.Error data KitRepository = KitRepository { dotKitDir :: FilePath } der...
null
https://raw.githubusercontent.com/nkpart/kit/ed217ddbc90688350e52156503cca092c9bf8300/Kit/Repository.hs
haskell
module Kit.Repository ( KitRepository, makeRepository, readKitSpec, unpackKit, packagesDirectory, publishLocally ) where import Kit.Spec import Kit.Util import Data.Yaml (decodeFile) import Control.Error data KitRepository = KitRepository { dotKitDir :: FilePath } deriving (Eq, Sho...
8d7c53546ce0207cd37353f50235dcbafea4815dc28faaa3fd276e650b76f803
dustin/environ
env_alert_mailer.erl
%% Copyright ( c ) 2006 < > %% -module(env_alert_mailer). -behaviour(gen_server). -export([start_link/0, code_change/3, handle_info/2, terminate/2]). -export([send_message/4, stop/0]). -export([init/1, handle_call/3, handle_cast/2]). start_link() -> gen_server:start_link({local, env_alert_mailer}, ?MODULE, [...
null
https://raw.githubusercontent.com/dustin/environ/a45e714752a38e0b67ebd7e8d0bf8fb0c74d7945/src/env_alert_mailer.erl
erlang
Copyright ( c ) 2006 < > -module(env_alert_mailer). -behaviour(gen_server). -export([start_link/0, code_change/3, handle_info/2, terminate/2]). -export([send_message/4, stop/0]). -export([init/1, handle_call/3, handle_cast/2]). start_link() -> gen_server:start_link({local, env_alert_mailer}, ?MODULE, [], [])...
f44fc78c8089709fd4622723d843c2cdf2a121d5791344f942895bf61eb2888f
debug-ito/wild-bind
Description.hs
-- | -- Module: WildBind.Description -- Description: Types about ActionDescription Maintainer : < > -- module WildBind.Description ( ActionDescription , Describable (..) ) where import Data.Text (Text) -- | Human-readable description of an action. 'ActionDescription' is -- used to describe ...
null
https://raw.githubusercontent.com/debug-ito/wild-bind/ef65370ded4f9687fed554107df4cc58247943de/wild-bind/src/WildBind/Description.hs
haskell
| Module: WildBind.Description Description: Types about ActionDescription | Human-readable description of an action. 'ActionDescription' is used to describe the current binding to the user. | Class for something describable. | @since 0.1.1.0
Maintainer : < > module WildBind.Description ( ActionDescription , Describable (..) ) where import Data.Text (Text) type ActionDescription = Text class Describable d where describe :: d -> ActionDescription instance (Describable a, Describable b) => Describable (Either a b) where desc...
8765bbe62e7a70d6a4f72dfa65555869f7c4f710950b796003b3ec9ea02e0074
simhu/cubical
Concrete.hs
{-# LANGUAGE TupleSections, ParallelListComp #-} | Convert the concrete syntax into the syntax of cubical TT . module Concrete where import Exp.Abs import qualified CTT as C import Pretty import Control.Applicative import Control.Arrow (second) import Control.Monad.Trans import Control.Monad.Trans.Reader import Co...
null
https://raw.githubusercontent.com/simhu/cubical/53bab8a89246ec658d4a6436534242d0ce15eb35/Concrete.hs
haskell
# LANGUAGE TupleSections, ParallelListComp # | Useful auxiliary functions Applicative cons tail recursive form to transform a sequence of applications App (App (App u v) ...) w into (u, [v, …, w]) into a list of idents ----------------------------------------------------------------------------- | Resolver and e...
| Convert the concrete syntax into the syntax of cubical TT . module Concrete where import Exp.Abs import qualified CTT as C import Pretty import Control.Applicative import Control.Arrow (second) import Control.Monad.Trans import Control.Monad.Trans.Reader import Control.Monad.Trans.Error hiding (throwError) impor...
01e271f3f9c21823aba5160f8099172c93eda9ac651065cfbe5aad5121831601
xvw/preface
arrow_zero.ml
module Suite (R : Model.PROFUNCTORIAL) (P : Preface_specs.ARROW_ZERO with type ('a, 'b) t = ('a, 'b) R.t) = Arrow.Suite (R) (P)
null
https://raw.githubusercontent.com/xvw/preface/84a297e1ee2967ad4341dca875da8d2dc6d7638c/lib/preface_qcheck/arrow_zero.ml
ocaml
module Suite (R : Model.PROFUNCTORIAL) (P : Preface_specs.ARROW_ZERO with type ('a, 'b) t = ('a, 'b) R.t) = Arrow.Suite (R) (P)
392e807ffef89803ea42af5e173548ef581bff8d350c5b1459b132f411808b64
2600hz-archive/whistle
amqp_network_connection.erl
The contents of this file are subject to the Mozilla Public License %% Version 1.1 (the "License"); you may not use this file except in %% compliance with the License. You may obtain a copy of the License at %% / %% Software distributed under the License is distributed on an " AS IS " %% basis, WITHOUT WARRANTY OF ...
null
https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/rabbitmq_erlang_client-2.4.1/src/amqp_network_connection.erl
erlang
Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at / basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. undefined | Rea...
The contents of this file are subject to the Mozilla Public License Software distributed under the License is distributed on an " AS IS " The Original Code is RabbitMQ . The Initial Developer of the Original Code is VMware , Inc. Copyright ( c ) 2007 - 2011 VMware , Inc. All rights reserved . @private -m...
3e3d423658d68d1aa38355f48cc1ec283ce8bdf4c25faa4031aa1b46e49a5a76
synduce/Synduce
leftmostodd.ml
* @synduce -s 2 -NB (* The type of labelled binary trees *) type 'a btree = | Empty | Node of 'a * 'a btree * 'a btree (* Zipper for labelled binary trees *) type sel = | Left | Right type 'c zipper = | Top | Zip of sel * 'c * 'c btree * 'c zipper let rec spec = function | Empty -> false, 1 | Node (...
null
https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/treepaths/leftmostodd.ml
ocaml
The type of labelled binary trees Zipper for labelled binary trees
* @synduce -s 2 -NB type 'a btree = | Empty | Node of 'a * 'a btree * 'a btree type sel = | Left | Right type 'c zipper = | Top | Zip of sel * 'c * 'c btree * 'c zipper let rec spec = function | Empty -> false, 1 | Node (a, l, r) -> let b1, x1 = spec l in if b1 then b1, x1 else if a mod 2 = ...
5340e46f74df6ae15fb7f4b6cfdf40f8fd6b1e494d919c2fd4571d7dc30894df
mbillingr/lisp-in-small-pieces
system.scm
(define-class Program Object ()) (define-class Reference Program (variable)) (define-class Local-Reference Reference ()) (define-class Global-Reference Reference ()) (define-class Predefined-Reference Reference ()) (define-class Global-Assignment Program (variable form)) (define-class Local-Assignment Program (refer...
null
https://raw.githubusercontent.com/mbillingr/lisp-in-small-pieces/b2b158dfa91dc95d75af4bd7d93f8df22219047e/09-macros/system.scm
scheme
(println "objectify" e) (make-Definition (objectify (car var) r) (objectify (cons 'lambda (cons (cdr var) body)) r)) (make-Definition (objectify var r) (objectify (car body) r)))) objectification. What if unquote shadows lexically a comma ? QUICK and DIRTY! ... Create resulting eva...
(define-class Program Object ()) (define-class Reference Program (variable)) (define-class Local-Reference Reference ()) (define-class Global-Reference Reference ()) (define-class Predefined-Reference Reference ()) (define-class Global-Assignment Program (variable form)) (define-class Local-Assignment Program (refer...
20b930151fbe9d102303e3968c1f42482a1842d230147022dad823e4689b8818
fakedata-haskell/fakedata
House.hs
# LANGUAGE TemplateHaskell # {-# LANGUAGE OverloadedStrings #-} module Faker.House where import Data.Text import Faker import Faker.Internal import Faker.Provider.House import Faker.TH $(generateFakeField "house" "furniture") $(generateFakeField "house" "rooms")
null
https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/House.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell # module Faker.House where import Data.Text import Faker import Faker.Internal import Faker.Provider.House import Faker.TH $(generateFakeField "house" "furniture") $(generateFakeField "house" "rooms")
b6bec2607a40cdb76d5fac47093392bd21864d6dedcc0a1164173e64f8805206
rcherrueau/APE
adder+let-test.rkt
#lang s-exp "../adder+let/lang.rkt" (let ([x 5] [y (add1 x)]) (sub1 y))
null
https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/pan/examples/adder%2Blet-test.rkt
racket
#lang s-exp "../adder+let/lang.rkt" (let ([x 5] [y (add1 x)]) (sub1 y))
e327d70c40111bcf179e59519d728667579a16fd1769bc0f15139aad1fe3b021
dmitryvk/sbcl-win32-threads
early-defstructs.lisp
This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no wa...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/early-defstructs.lisp
lisp
more information. public domain. The software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information.
This software is part of the SBCL system . See the README file for This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the (in-package "SB!KERNEL") (/show0 "entering early-defstructs.lisp") (!set-up-structure-object-class) #.`(progn ,@(mapca...
567d0cbf3731835caf1d578677d8ba313e74fcc81cdac2686bdefc9f6f1ea44c
sdiehl/write-you-a-haskell
Main.hs
# LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} # LANGUAGE MultiParamTypeClasses # # LANGUAGE GeneralizedNewtypeDeriving # import Syntax import Infer import Parser import Pretty import Eval import Data.Monoid import qualified Data.S...
null
https://raw.githubusercontent.com/sdiehl/write-you-a-haskell/ae73485e045ef38f50846b62bd91777a9943d1f7/chapter7/poly/src/Main.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE TypeSynonymInstances # ----------------------------------------------------------------------------- Types ----------------------------------------------------------------------------- Type environment Value environment -------------------------------------------------------...
# LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE GeneralizedNewtypeDeriving # import Syntax import Infer import Parser import Pretty import Eval import Data.Monoid import qualified Data.Set as Set import qualified Data.Map as Map import qualified Data.Text.Laz...
c4698d3b2b4783dbd30ea557bee883a6d682240957b65877d457293e840154de
LPCIC/matita
disambiguateTypes.ml
Copyright ( C ) 2004 , HELM Team . * * This file is part of HELM , an Hypertextual , Electronic * Library of Mathematics , developed at the Computer Science * Department , University of Bologna , Italy . * * is free software ; you can redistribute it and/or * modify it under the terms of the GNU...
null
https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/disambiguation/disambiguateTypes.ml
ocaml
unknown the given term any sort any (co)inductive type literal literal, instance num instance num module Domain = Set.Make (OrderedDomain) description
Copyright ( C ) 2004 , HELM Team . * * This file is part of HELM , an Hypertextual , Electronic * Library of Mathematics , developed at the Computer Science * Department , University of Bologna , Italy . * * is free software ; you can redistribute it and/or * modify it under the terms of the GNU...
b212b62334b5d38039bcd9358cb4c0c50fadfd296e61fd505e375135449ff1a7
ghcjs/jsaddle-dom
CSSPageRule.hs
# LANGUAGE PatternSynonyms # -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} # OPTIONS_GHC -fno - warn - unused - imports # module JSDOM.Generated.CSSPageRule (setSelectorText, getSelectorText, getSelectorTextUnsafe, getSelectorTextUnchecked, getStyle, C...
null
https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/CSSPageRule.hs
haskell
For HasCallStack compatibility # LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
# LANGUAGE PatternSynonyms # # OPTIONS_GHC -fno - warn - unused - imports # module JSDOM.Generated.CSSPageRule (setSelectorText, getSelectorText, getSelectorTextUnsafe, getSelectorTextUnchecked, getStyle, CSSPageRule(..), gTypeCSSPageRule) where import Prelude ((.), (==), (>>=), return, IO...
f109bda6b3e102966240f4945b079336ae664ebbc1ba331c44aced9ec0a3ca11
jpmonettas/clindex
api.clj
(ns clindex.api "The namespace intended to be required by clindex users. Use `index-project!` for indexing any project and `db` for retrieveing datascript dbs by platform." (:require [clindex.scanner :as scanner] [clindex.indexer :as indexer] [datascript.core :as d] [clojure...
null
https://raw.githubusercontent.com/jpmonettas/clindex/77097d80a23aa85d2ff50e55645a1452f2dcb3c0/src/clindex/api.clj
clojure
don't remove it if we are going to re load it, since we need the info there to avoid indexing emacs backup files kind can be :create, :modify or :delete ;; file is java.io.File index everything by platform install watcher for reindexing when on-new-facts callback provided
(ns clindex.api "The namespace intended to be required by clindex users. Use `index-project!` for indexing any project and `db` for retrieveing datascript dbs by platform." (:require [clindex.scanner :as scanner] [clindex.indexer :as indexer] [datascript.core :as d] [clojure...
5b104cdc5f89c925ffd8c61e741ed9890e83e4eb6189236276ed773d709928a5
haskell-foundation/foundation
Partial.hs
-- | -- Module : Foundation.Partial -- License : BSD-style Maintainer : < > -- Stability : experimental -- Portability : portable -- -- Partial give a way to annotate your partial function with -- a simple wrapper, which can only evaluated using 'fromPartial' -- > fromPartial ( head [ ] ) -- # LANGU...
null
https://raw.githubusercontent.com/haskell-foundation/foundation/58568e9f5368170d272000ecf16ef64fb91d0732/foundation/Foundation/Partial.hs
haskell
| Module : Foundation.Partial License : BSD-style Stability : experimental Portability : portable Partial give a way to annotate your partial function with a simple wrapper, which can only evaluated using 'fromPartial' | Partialiality wrapper. | An error related to the evaluation of a Partial val...
Maintainer : < > > fromPartial ( head [ ] ) # LANGUAGE GeneralizedNewtypeDeriving # module Foundation.Partial ( Partial , PartialError , partialError , partial , fromPartial , head , fromJust , fromLeft , fromRight ) where import Basement.Compat.Base import Basement.Com...
fc2189ec4e81027bcf29f02f4723e397e293ea75e79bab0703691305ee818346
ivanperez-keera/Yampa
TailgatingDetector.hs
{-# LANGUAGE Arrows #-} -- | Module : TailgatingDetector -- Description : AFRP Expressitivity Test Copyright : Yale University , 2003 Authors : -- Context: an autonomous flying vehicle carrying out traffic surveillance -- through an on-board video camera. -- -- Objective: finding a tailgater amon...
null
https://raw.githubusercontent.com/ivanperez-keera/Yampa/4465eb47c59f39b40214741dcb61995b7dfb4c5b/yampa/examples/TailgatingDetector/TailgatingDetector.hs
haskell
# LANGUAGE Arrows # | Description : AFRP Expressitivity Test Context: an autonomous flying vehicle carrying out traffic surveillance through an on-board video camera. Objective: finding a tailgater among a group of vehicles traveling along a highway lane. The group is defined by the section of the highway in re...
Module : TailgatingDetector Copyright : Yale University , 2003 Authors : view and thus changes dynamically as ground vehicles with non - zero I find this example interesting because it makes use of TWO COLLECTION of nature of the problem , and it makes use of the the fact that CONTINUATIONS...
f045448446603b1e0fb7027fa127822f22d820eed070b366646016c42e2dfab2
xh4/web-toolkit
dimension.lisp
(in-package :css) (defclass dimension () ((number :initarg :number :initform nil :accessor dimension-number) (unit :initarg :unit :initform nil :accessor dimension-unit))) (defmethod print-object ((dimension dimension) stream) (print-unreadable-object (dimension stream :type t) (for...
null
https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/css/dimension.lisp
lisp
FIXME: more strict rule
(in-package :css) (defclass dimension () ((number :initarg :number :initform nil :accessor dimension-number) (unit :initarg :unit :initform nil :accessor dimension-unit))) (defmethod print-object ((dimension dimension) stream) (print-unreadable-object (dimension stream :type t) (for...
a429e8519e4042f981acbbf13fc35ca96c1262e7e98f812fe1474a2bb69e86e7
screenshotbot/screenshotbot-oss
health-check.lisp
;;;; Copyright 2018-Present Modern Interpreters Inc. ;;;; This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (defpackage :util/health-check (:use #:cl) (:local-nicknames (#:a #:alexandria)) ...
null
https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/dc85ea5d70d195b17a83506cbe39cdc8ad85bc14/src/util/health-check.lisp
lisp
Copyright 2018-Present Modern Interpreters Inc. ;; (run-health-checks)
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (defpackage :util/health-check (:use #:cl) (:local-nicknames (#:a #:alexandria)) (:export #:def-health-check #:run-health-checks)) ...
11937d7bc0fb955276f375eb37ae6a8cd67f5762d0b7387c52cd9d8fef428744
dmitryvk/sbcl-win32-threads
hppa-vm.lisp
(in-package "SB!VM") (define-alien-type os-context-t (struct os-context-t-struct)) ;;;; MACHINE-TYPE (defun machine-type () "Returns a string describing the type of the local machine." "HPPA") FIXUP - CODE - OBJECT FIX - lav : unify code with genesis.lisp fixup (defun fixup-code-object (code offset value k...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/hppa-vm.lisp
lisp
MACHINE-TYPE FIXME: Should this and CONTEXT-PC be INLINE to reduce consing? (Are they used in anything time-critical, or just the debugger?) For now. Internal-error-arguments. INTERNAL-ERROR-ARGUMENTS -- interface. instruction stream.
(in-package "SB!VM") (define-alien-type os-context-t (struct os-context-t-struct)) (defun machine-type () "Returns a string describing the type of the local machine." "HPPA") FIXUP - CODE - OBJECT FIX - lav : unify code with genesis.lisp fixup (defun fixup-code-object (code offset value kind) (unless (ze...
3ea40d29fe4b2f1719e35a5cf8be78c9cd309912c0df2450e8eb2df9c00ac37f
clash-lang/clash-compiler
Main.hs
# LANGUAGE CPP # # LANGUAGE LambdaCase # # LANGUAGE NondecreasingIndentation # # LANGUAGE TupleSections # {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- -- GHC Driver program -- ( c ) The University of Glasgow 2005...
null
https://raw.githubusercontent.com/clash-lang/clash-compiler/8c98dfd55094b0dd0faaeb1667a681965d077946/clash-ghc/src-bin-9.0/Clash/Main.hs
haskell
# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE # --------------------------------------------------------------------------- --------------------------------------------------------------------------- Implementations of the various modes (--show-iface, mkdependHS. etc.) Various other random stuff ...
# LANGUAGE CPP # # LANGUAGE LambdaCase # # LANGUAGE NondecreasingIndentation # # LANGUAGE TupleSections # GHC Driver program ( c ) The University of Glasgow 2005 module Clash.Main (defaultMain, defaultMainWithAction) where The official GHC API import qualified GHC DynFlags ( .. ) , HscTarget ( .. ) , GhcMo...
add016e885b98196bd80e58c9feb703c4875500719c11298bef1b8b68bbde883
Frama-C/Frama-C-snapshot
split_return.ml
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/partitioning/split_return.ml
ocaml
************************************************************************ alternatives) ...
This file is part of Frama - C. Copyright ( C ) 2007 - 2019 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , v...
5c21b1e7b243dab54150e693ec01c37534be816d5bf00c385f2bc75c33d899bc
boris-ci/boris
Configuration.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE PackageImports #-} module Boris.Core.Data.Configuration ( Command (..) , BuildPattern (..) , Specification (..) , BuildNamePattern , renderBuildNamePattern , parseBuildNamePattern , matchesBuild ) where import Boris.Core.Data.Build import ...
null
https://raw.githubusercontent.com/boris-ci/boris/c321187490afc889bf281442ac4ef9398b77b200/boris-core/src/Boris/Core/Data/Configuration.hs
haskell
# LANGUAGE PackageImports #
# LANGUAGE NoImplicitPrelude # module Boris.Core.Data.Configuration ( Command (..) , BuildPattern (..) , Specification (..) , BuildNamePattern , renderBuildNamePattern , parseBuildNamePattern , matchesBuild ) where import Boris.Core.Data.Build import Boris.Prelude import qualifie...
c1aaf1156203fee27031052657bab273c618720924a4b1492389971474f65a9f
marick/fp-oo
monad.clj
(domonad maybe-m [a (+ 1 2) b nil c (+ a b)] c) (def oops! (fn [reason & args] (with-meta (merge {:reason reason} (apply hash-map args)) {:type :error}))) (def oopsie? (fn [value] (= (type value) :err...
null
https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/old-code/monad.clj
clojure
The monad laws, by example definitions for the sequence monad
(domonad maybe-m [a (+ 1 2) b nil c (+ a b)] c) (def oops! (fn [reason & args] (with-meta (merge {:reason reason} (apply hash-map args)) {:type :error}))) (def oopsie? (fn [value] (= (type value) :err...
e8f392ecfc4ab05130e27c03371337113dafef23ad5b5268706563a9366198e0
geneweb/geneweb
cousins.mli
open Gwdb open Config val default_max_cnt : int (** Default number of relatives that could be listed at the same page *) val max_cousin_level : config -> base -> person -> int val children_of_fam : base -> ifam -> iper list * Retruns list of children of the giving family val siblings : config -> base -> iper -> (ip...
null
https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/cousins.mli
ocaml
* Default number of relatives that could be listed at the same page * Same as [has_desc_lev] but used for a person's sibling as returned by [siblings].
open Gwdb open Config val default_max_cnt : int val max_cousin_level : config -> base -> person -> int val children_of_fam : base -> ifam -> iper list * Retruns list of children of the giving family val siblings : config -> base -> iper -> (iper * (iper * Def.sex)) list * Returns list of person 's siblings that inc...
49f7d9ed72f46949dda26a9296633363c130fedbf55f86e41e870b46e6da054a
Octachron/codept
deps.ml
module Edge = struct type t = Normal | Epsilon let max x y = if x = Epsilon then x else y let min x y = if x = Normal then x else y let sch = let open Schematic in custom (Sum["Normal", Void; "Epsilon", Void ]) (function Normal -> C E | Epsilon -> C (S E)) (function C E -> Normal | C S ...
null
https://raw.githubusercontent.com/Octachron/codept/771421500c1769a13b9dc51204c8841e7f1368c6/lib/deps.ml
ocaml
module Edge = struct type t = Normal | Epsilon let max x y = if x = Epsilon then x else y let min x y = if x = Normal then x else y let sch = let open Schematic in custom (Sum["Normal", Void; "Epsilon", Void ]) (function Normal -> C E | Epsilon -> C (S E)) (function C E -> Normal | C S ...
52eca46f208880a72bd8d6719c26777745f8d2274c443204e7ca3d6d5487bbc7
hyperfiddle/electric
hfql11.clj
(ns dustin.hfql11 (:require [clojure.walk :refer [walk prewalk postwalk]] [contrib.do :refer [via* Do-via *this !]] [datomic.api :as d] [dustin.fiddle :refer :all] [dustin.hf-nav :refer :all] [hyperfiddle.api :as hf] [meander.epsilon :as m :refer [match rewrite]] [minitest :refer [test...
null
https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2020/hfql/hfql11.clj
clojure
a thunked tree, feed it scopes while traversing interpret kw as entity nav ? There 's no need to , do n't do this ClassCastException query scope result :db/id is a self reference so this actually is coherent
(ns dustin.hfql11 (:require [clojure.walk :refer [walk prewalk postwalk]] [contrib.do :refer [via* Do-via *this !]] [datomic.api :as d] [dustin.fiddle :refer :all] [dustin.hf-nav :refer :all] [hyperfiddle.api :as hf] [meander.epsilon :as m :refer [match rewrite]] [minitest :refer [test...
78f336ea12c811a2fce02d49356b9f054c0cf20b3140113f7d86b1a5dd085173
PacktWorkshops/The-Clojure-Workshop
project.clj
(defproject packt-clj.chapter-4-tests "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" :url "-2.0/"} :dependencies [[org.clojure/clojure "1.10.0"] [semantic-csv "0.2.1-alpha1"] ...
null
https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter04/tests/packt-clj.chapter-4-tests/project.clj
clojure
(defproject packt-clj.chapter-4-tests "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" :url "-2.0/"} :dependencies [[org.clojure/clojure "1.10.0"] [semantic-csv "0.2.1-alpha1"] ...
6c733635574becb7219d6f683eb5f51a06bb8edc44a4e24bcaaa95c27bc0842c
tezos-checker/checker
testArbitrary.ml
open Ctok open Kit open Lqt open Tok * Generate a random non - negative tez amount in the full spectrum . Note that * most of these amounts are not expected in practice , since there is not that * much currency in existence ( and will never be ) . This means that for example * adding two amounts generated ...
null
https://raw.githubusercontent.com/tezos-checker/checker/04de01fd512c89d0d357aa7312610d04f20c6992/tests/testArbitrary.ml
ocaml
open Ctok open Kit open Lqt open Tok * Generate a random non - negative tez amount in the full spectrum . Note that * most of these amounts are not expected in practice , since there is not that * much currency in existence ( and will never be ) . This means that for example * adding two amounts generated ...
b44d3f44f15320515d907ea287513bca530adc04d7cf5118e85dab1e1932404c
ucsd-progsys/liquidhaskell
Poly2_degenerate.hs
module Poly2_degenerate (prop_id6) where import Language.Haskell.Liquid.Prelude myabs x = if x `gt` 0 then x else 0 `minus` x ---------------------------------------------------------- myid3 x y = y prop_id6 x = liquidAssertB (x' `geq` 0) where x' = myid3 [] $ myabs x
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/pos/Poly2_degenerate.hs
haskell
--------------------------------------------------------
module Poly2_degenerate (prop_id6) where import Language.Haskell.Liquid.Prelude myabs x = if x `gt` 0 then x else 0 `minus` x myid3 x y = y prop_id6 x = liquidAssertB (x' `geq` 0) where x' = myid3 [] $ myabs x
b8710d00d6eac23b6438210545e66c7f8f7f82e1dabad11f874ce39634199fbf
janestreet/ppx_css
css_inliner.mli
(* this file intentionally left blank *)
null
https://raw.githubusercontent.com/janestreet/ppx_css/3baeb2a2d9787bec88942a2cefbead6a257ef5a1/standalone/css_inliner.mli
ocaml
this file intentionally left blank
af543b2b048dfb3979791a573eeccfbfd1478b088056b9d5ca8b608ef759d659
flipstone/redcard
Types.hs
module Data.Validation.Types ( module Data.Validation.Types.Pure , module Data.Validation.Types.Trans ) where import Data.Validation.Types.Pure import Data.Validation.Types.Trans
null
https://raw.githubusercontent.com/flipstone/redcard/9a15a6a00a1ddac7095fe590c76c258da4053a84/src/Data/Validation/Types.hs
haskell
module Data.Validation.Types ( module Data.Validation.Types.Pure , module Data.Validation.Types.Trans ) where import Data.Validation.Types.Pure import Data.Validation.Types.Trans
08e42b97b27d959249541b00cadc5f6a3f9d94d572f37486aa1bbaf4ce5ae4be
yellowbean/clojucture
cn.clj
(ns clojucture.reader.cn (:require [clojucture.asset :as asset] [clojucture.assumption :as assump] [clojucture.account :as account] [clojucture.expense :as exp ] [clojucture.util :as u] [clojucture.tranche :as b] [clojucture.account :as a] [clojucture.pool :as p] [clojucture.spv :a...
null
https://raw.githubusercontent.com/yellowbean/clojucture/3ad99e06ecd9e5c478f653df4afbd69991cd4964/src/clj/clojucture/reader/cn.clj
clojure
(ns clojucture.reader.cn (:require [clojucture.asset :as asset] [clojucture.assumption :as assump] [clojucture.account :as account] [clojucture.expense :as exp ] [clojucture.util :as u] [clojucture.tranche :as b] [clojucture.account :as a] [clojucture.pool :as p] [clojucture.spv :a...
da876920eceb3747baed904c2b54649a449da32a99bf3f25beff24ca7738af81
alanz/ghc-exactprint
SlidingListComp.hs
foo = [concatMap (\(n, f) -> [findPath copts v >>= f (listArg "ghc" as) | v <- listArg n as]) [ ("project", Update.scanProject), ("file", Update.scanFile), ("path", Update.scanDirectory)], map (Update.scanCabal (listArg "ghc" as)) cabals]
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/SlidingListComp.hs
haskell
foo = [concatMap (\(n, f) -> [findPath copts v >>= f (listArg "ghc" as) | v <- listArg n as]) [ ("project", Update.scanProject), ("file", Update.scanFile), ("path", Update.scanDirectory)], map (Update.scanCabal (listArg "ghc" as)) cabals]
a3b3d4e95f515a0462260d6de830a860fcd0a6ec8c99762aa84291eccb374f82
aantron/luv
sigint.ml
let () = let handle = Luv.Signal.init () |> Result.get_ok in ignore @@ Luv.Signal.start handle Luv.Signal.sigint begin fun () -> Luv.Handle.close handle ignore; print_endline "Exiting" end; print_endline "Type Ctrl+C to continue..."; ignore (Luv.Loop.run () : bool)
null
https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/example/sigint.ml
ocaml
let () = let handle = Luv.Signal.init () |> Result.get_ok in ignore @@ Luv.Signal.start handle Luv.Signal.sigint begin fun () -> Luv.Handle.close handle ignore; print_endline "Exiting" end; print_endline "Type Ctrl+C to continue..."; ignore (Luv.Loop.run () : bool)
42e454b403c143f066b8d77466330e478fac0c18b5c7a9df8f99229743be8e96
johnwhitington/ocamli
mod_binding.ml
module LargeFile = struct external seek_out : out_channel -> int64 -> unit = "caml_ml_seek_out_64" end
null
https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/examples/mod_binding.ml
ocaml
module LargeFile = struct external seek_out : out_channel -> int64 -> unit = "caml_ml_seek_out_64" end
eb4373e39e53fe418c87e7261cce54953b2552db938a3eef2d75d05fe65d718b
rbrito/pkg-mp3packer
unicode.ml
type 'a t = Normal of 'a | Error of int;; external is_win : unit -> bool = "uni_is_win" "noalloc";; let win = is_win ();; (***********) UNICODE (***********) external set_utf8_output : unit -> unit = "uni_set_utf8_output";; external silly_print_c : string -> unit = "uni_silly_print";; let silly_print x...
null
https://raw.githubusercontent.com/rbrito/pkg-mp3packer/ac75f1d9cfd492f96248c6446147d0e510c1e299/unicode.ml
ocaml
********* ********* the length value is in WCHARS, not bytes! Unsafe since the length is not checked UTF8 external readdir_utf16_c : string -> string array = "uni_readdir_utf16";; This should really be "length - sizeof(WCHAR)", but this will round down correctly ERROR_NO_MORE_FILES ERROR_FILE_NOT_FOUND File in...
type 'a t = Normal of 'a | Error of int;; external is_win : unit -> bool = "uni_is_win" "noalloc";; let win = is_win ();; UNICODE external set_utf8_output : unit -> unit = "uni_set_utf8_output";; external silly_print_c : string -> unit = "uni_silly_print";; let silly_print x = flush stdout; silly_pri...
5eca82e4f3982e2d9a7c9654211cb16840c337917d3f90eb1b27ebcd493b10c6
fossas/fossa-cli
Extra.hs
module Algebra.Graph.AdjacencyMap.Extra ( gtraverse, shrink, shrinkSingle, splitGraph, ) where import Algebra.Graph.AdjacencyMap qualified as AM import Algebra.Graph.AdjacencyMap.Algorithm qualified as AMA import Data.Set (Set) import Data.Set qualified as Set -- | It's 'traverse', but for graphs -- -- It's a...
null
https://raw.githubusercontent.com/fossas/fossa-cli/cddea296c88ddc021913c7d0222a53948b6f1893/src/Algebra/Graph/AdjacencyMap/Extra.hs
haskell
| It's 'traverse', but for graphs It's also unlawful. 'f' might be called several times for each node in the graph If @vert@ has an edge to itself, it would be added back in by @overlay@ as an induced edge so delete vert from it's pre/post set | Split graph into distinct sibling graphs (unconnected subgraphs) v...
module Algebra.Graph.AdjacencyMap.Extra ( gtraverse, shrink, shrinkSingle, splitGraph, ) where import Algebra.Graph.AdjacencyMap qualified as AM import Algebra.Graph.AdjacencyMap.Algorithm qualified as AMA import Data.Set (Set) import Data.Set qualified as Set gtraverse :: (Applicative f, Ord b) => (a -> ...
0176c601a4ca1d935530c1946fe07e76d9f33386f5874d09e394eaf9656ee28a
dannypsnl/sauron
editor.rkt
#lang racket/gui (provide tool@) (require drracket/tool framework) (define-unit tool@ (import drracket:tool^) (export drracket:tool-exports^) (define (phase1) (void)) (define (phase2) (void)) (define drracket-editor-mixin (mixin (drracket:unit:definitions-text<%> racket:text<%>) () (supe...
null
https://raw.githubusercontent.com/dannypsnl/sauron/1d1d0e263e104251b44b2baa7741869374e922e1/tool/editor.rkt
racket
#lang racket/gui (provide tool@) (require drracket/tool framework) (define-unit tool@ (import drracket:tool^) (export drracket:tool-exports^) (define (phase1) (void)) (define (phase2) (void)) (define drracket-editor-mixin (mixin (drracket:unit:definitions-text<%> racket:text<%>) () (supe...
8cb81276c2333857f4468e02c5986a5abeb851b6675e5a9a5304933f7d28ad19
alvatar/spheres
c-define-array#.scm
! Build FFI procedures for C type arrays . Only for use with basic types , not structs . ;; (c-define-array float f32) -> ;; alloc-float* ;; float*-ref ;; float*-set! ;; *->float* ;; f32vector->float* (define-macro (c-define-array scheme-type . rest) (let ((c-type (%%get-key-arg rest c-type: scheme-type)) (sc...
null
https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/gambit/ffi/c-define-array%23.scm
scheme
(c-define-array float f32) -> alloc-float* float*-ref float*-set! *->float* f32vector->float* ,(%%generic-string-append "___result_voidstar = ___EXT(___alloc_rc)(___arg1*sizeof(" c-type "));") #t for debugging
! Build FFI procedures for C type arrays . Only for use with basic types , not structs . (define-macro (c-define-array scheme-type . rest) (let ((c-type (%%get-key-arg rest c-type: scheme-type)) (scheme-vector (%%get-key-arg rest scheme-vector: #f))) (if (not scheme-vector) (error "c-define-array macro ::...
b62b57907c140763ae51614fed35a00098778e7480b2f1cb08dbe81dd35f7d01
ygrek/opam-bundle
main.ml
open Printf open OpamTypes let match_package_atom nv (name,cstr) = OpamPackage.Name.compare (OpamPackage.name nv) name = 0 && match cstr with | None -> true | Some (relop,version) -> OpamFormula.eval_relop relop (OpamPackage.version nv) version let resolve_deps t atoms = let atoms = OpamSolution.sanitize_a...
null
https://raw.githubusercontent.com/ygrek/opam-bundle/2d35ee077186a58bb5fd39a7890dbf6b3a4731f6/src/main.ml
ocaml
OpamSolver.new_packages, but return in order old style comp file - not supported Install the compiler OpamSystem.real_path is pure evil expecting quoted commands gets the source (from url, local path, git, etc) and applies patches and substitutions dev? name * version constraint may raise Invalid_argum...
open Printf open OpamTypes let match_package_atom nv (name,cstr) = OpamPackage.Name.compare (OpamPackage.name nv) name = 0 && match cstr with | None -> true | Some (relop,version) -> OpamFormula.eval_relop relop (OpamPackage.version nv) version let resolve_deps t atoms = let atoms = OpamSolution.sanitize_a...
f9868f1f0274562b89829b15b506da5c674bf9ac760edf6d8b5ef93a65c2555b
zwizwa/staapl
pic18-dtc.rkt
#lang racket/base ;; Threaded Forth for PIC18. (require "../tools.rkt" "../ns.rkt" "../macro.rkt" (only-in "pic18.rkt" target-byte-address)) (require/provide "../asm.rkt" "asm.rkt" "dtc.rkt" "double-math.rkt" "../coma/macro-forth.rkt" "../coma/macro-forth-sig.rkt" "dtc-forth-unit.rkt") (provide...
null
https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/pic18/pic18-dtc.rkt
racket
Threaded Forth for PIC18. Map primitives. | _exit)
#lang racket/base (require "../tools.rkt" "../ns.rkt" "../macro.rkt" (only-in "pic18.rkt" target-byte-address)) (require/provide "../asm.rkt" "asm.rkt" "dtc.rkt" "double-math.rkt" "../coma/macro-forth.rkt" "../coma/macro-forth-sig.rkt" "dtc-forth-unit.rkt") (provide (all-defined-out) target-b...
521bcbcb874b9e24e0b077b5ab90df880a9d787d7aa18617285c149e8a55615a
ppaml-op3/insomnia
FromF.hs
# LANGUAGE TypeFamilies , FlexibleInstances # module Gambling.FromF where import Control.Applicative import Control.Monad.Reader hiding (forM) import Data.Function (on) import Data.List (sortBy) import Data.Traversable import Unbound.Generics.LocallyNameless import Insomnia.Common.Literal import Insomnia.Common.Sam...
null
https://raw.githubusercontent.com/ppaml-op3/insomnia/5fc6eb1d554e8853d2fc929a957c7edce9e8867d/src/Gambling/FromF.hs
haskell
dangerous! implement "return m" as "(lambda () e)" implement "let x ~ m1 in m2" as "(lambda () (let ([x' (e1)]) (e2)))" force a distribution monad thunk "m" as "(e)" compile constructor C applied to value m as "(cons 'C m)" gamble's sampler (mh-sample e) | implement tuples as immutable vectors ignore the retu...
# LANGUAGE TypeFamilies , FlexibleInstances # module Gambling.FromF where import Control.Applicative import Control.Monad.Reader hiding (forM) import Data.Function (on) import Data.List (sortBy) import Data.Traversable import Unbound.Generics.LocallyNameless import Insomnia.Common.Literal import Insomnia.Common.Sam...
22fa6228d8217cd2425b1ea083b78a9c1ff79f012e59673ed5724181c87023a3
ndmitchell/neil
FileData.hs
module Paper.Util.FileData( FileData(..), getFileData ) where import Control.Monad import Data.List.Extra import System.Directory import System.FilePath data FileData = FileData ^ All files must reside in one directory ,mainFile :: FilePath -- ^ The main file ,argFiles :: [FilePath] --...
null
https://raw.githubusercontent.com/ndmitchell/neil/7162f33af3baa76f1c1ffed9c05b1c965cac8a55/src/Paper/Util/FileData.hs
haskell
^ The main file ^ Files given on the command line ^ All files in the directory ^ Any flags given ^ The location of the _darcs directory return (directory, explicit, implicit) now pick the main file
module Paper.Util.FileData( FileData(..), getFileData ) where import Control.Monad import Data.List.Extra import System.Directory import System.FilePath data FileData = FileData ^ All files must reside in one directory } deriving Show getFileData :: [String] -> IO FileData getFileData args = do...
6b2d3baeb7da54cea1ebd7afce81ab278caa21fc1ed5bc29a5d36060764cf34d
project-oak/hafnium-verification
boundMap.ml
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/cost/boundMap.ml
ocaml
compute control vars, i.e. set of variables that affect the execution count bound = env(v1) *... * env(vn)
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
192fdfbeae2954dad8641f5c57064962bdfba7e1a3c04d5e5155336755f8d33b
DomainDrivenArchitecture/dda-k8s-crate
k8s.clj
Licensed to the Apache Software Foundation ( ASF ) under one ; or more contributor license agreements. See the NOTICE file ; distributed with this work for additional information ; regarding copyright ownership. The ASF licenses this file to you under the Apache License , Version 2.0 ( the ; "License"); you may not...
null
https://raw.githubusercontent.com/DomainDrivenArchitecture/dda-k8s-crate/eaeb4d965a63692973d3c1d98759fbdf756596b2/main/src/dda/pallet/dda_k8s_crate/infra/k8s.clj
clojure
or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required b...
Licensed to the Apache Software Foundation ( ASF ) under one to you under the Apache License , Version 2.0 ( the distributed under the License is distributed on an " AS IS " BASIS , (ns dda.pallet.dda-k8s-crate.infra.k8s (:require [schema.core :as s] [pallet.actions :as actions] [dda.provision :as p] ...
8e958a8476c29145032c74205188287bac1dfee97e77b5c7241309201271f920
aleator/CV
FunnyStatistics.hs
module CV.FunnyStatistics where import CV.Image import CV.Filters import qualified CV.ImageMath as IM import CV.ImageMathOp nthCM s n i = blur s $ ( i # - blur s i ) |^ n r_variance s i = msq #- (m #* m) where msq = gaussian s (i #* i) m = gaussian s i variance s i = msq #- (m #* m)...
null
https://raw.githubusercontent.com/aleator/CV/1e2c9116bcaacdf305044c861a1b36d0d8fb71b7/CV/FunnyStatistics.hs
haskell
module CV.FunnyStatistics where import CV.Image import CV.Filters import qualified CV.ImageMath as IM import CV.ImageMathOp nthCM s n i = blur s $ ( i # - blur s i ) |^ n r_variance s i = msq #- (m #* m) where msq = gaussian s (i #* i) m = gaussian s i variance s i = msq #- (m #* m)...
4bc1f5efce97f478724ff28cc20063c7eed8631ec2ad4616060dd07a5dfa556b
informatimago/lisp
priority-queue.lisp
-*- mode : lisp;coding : utf-8 -*- ;;;;************************************************************************** FILE : priority-queue.lisp ;;;;LANGUAGE: Common-Lisp ;;;;SYSTEM: Common-Lisp USER - INTERFACE : ;;;;DESCRIPTION ;;;; ;;;; Priority queues are lists ordered on...
null
https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/common-lisp/cesarum/priority-queue.lisp
lisp
coding : utf-8 -*- ************************************************************************** LANGUAGE: Common-Lisp SYSTEM: Common-Lisp DESCRIPTION Priority queues are lists ordered on a key of each element. LEGAL This program is free software: you can redistribute it and/or modify ...
FILE : priority-queue.lisp USER - INTERFACE : < PJB > < > MODIFICATIONS 2011 - 05 - 29 < PJB > Created . AGPL3 Copyright 2011 - 2016 it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of ...
bce4864bb409639f0f0938f3acdac6762c761c9b766ec3a23c4c21e7254daefd
mcorbin/tour-of-clojure
macros.clj
(defmacro infix [coll] (list (second coll) (first coll (last coll)))) (println (infix (2 + 3)) "\n") (println (macroexpand '(infix (2 + 3))))
null
https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/resources/public/pages/code/macros.clj
clojure
(defmacro infix [coll] (list (second coll) (first coll (last coll)))) (println (infix (2 + 3)) "\n") (println (macroexpand '(infix (2 + 3))))
a4013467533a612a3b989fea4726945c039e193fa94e157d92a3e717b7833e0a
heraldry/heraldicon
suggestions.cljs
(ns heraldicon.frontend.blazonry-editor.suggestions (:require [clojure.string :as str] [heraldicon.frontend.auto-complete :as auto-complete] [re-frame.core :as rf])) (def ^:private hint-order (into {} (map-indexed (fn [index hint] [hint index])) ["layout" "c...
null
https://raw.githubusercontent.com/heraldry/heraldicon/54e003614cf2c14cda496ef36358059ba78275b0/src/heraldicon/frontend/blazonry_editor/suggestions.cljs
clojure
(ns heraldicon.frontend.blazonry-editor.suggestions (:require [clojure.string :as str] [heraldicon.frontend.auto-complete :as auto-complete] [re-frame.core :as rf])) (def ^:private hint-order (into {} (map-indexed (fn [index hint] [hint index])) ["layout" "c...
39cd8c00c4df34ab2e9665dee7bcea5aa7ea1f2cbcd6544345fb565a2a0bbbc9
racket/drracket
info.rkt
#lang info (define collection 'multi) (define version "1.1") (define deps '("base" "compatibility-lib")) (define pkg-desc "DrRacket's plugin API") (define pkg-authors '(robby)) (define license '(Apache-2.0 OR MIT))
null
https://raw.githubusercontent.com/racket/drracket/a852792aa3a858a15debc5d1e5f553bce4d99d9c/drracket-plugin-lib/info.rkt
racket
#lang info (define collection 'multi) (define version "1.1") (define deps '("base" "compatibility-lib")) (define pkg-desc "DrRacket's plugin API") (define pkg-authors '(robby)) (define license '(Apache-2.0 OR MIT))
8484e5490e9fd1ff7a485faa97fda7f15a5b17cec5852764931a1aae3c8f78d2
softwarelanguageslab/maf
R5RS_scp1_haha-4.scm
; Changes: * removed : 0 * added : 0 * swaps : 1 ; * negated predicates: 0 ; * swapped branches: 0 * calls to i d fun : 1 (letrec ((result ()) (output (lambda (i) (set! result (cons i result)))) (hulp 2) (haha (lambda (x) (<change> ...
null
https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_haha-4.scm
scheme
Changes: * negated predicates: 0 * swapped branches: 0
* removed : 0 * added : 0 * swaps : 1 * calls to i d fun : 1 (letrec ((result ()) (output (lambda (i) (set! result (cons i result)))) (hulp 2) (haha (lambda (x) (<change> (let ((hulp (* x hulp))) (output hu...
22602a4ccb295a9ca6dbc571f686da02a93f4473a16da2476184da395151b74f
jarofghosts/clojure-koans
03_vectors.clj
(meditations "You can use vectors in clojure as array-like structures" (= 1 (count [42])) "You can create a vector from a list" (= [1] (vec '(1))) "Or from some elements" (= [nil nil] (vector nil nil)) "But you can populate it with any number of elements at once" (= [1 2] (vec '(1 2))) "Conjoining...
null
https://raw.githubusercontent.com/jarofghosts/clojure-koans/9bc2a46414f479021ff27ac8744d36dce507ad7f/03_vectors.clj
clojure
(meditations "You can use vectors in clojure as array-like structures" (= 1 (count [42])) "You can create a vector from a list" (= [1] (vec '(1))) "Or from some elements" (= [nil nil] (vector nil nil)) "But you can populate it with any number of elements at once" (= [1 2] (vec '(1 2))) "Conjoining...
e4906e440ae3b38953c7a6ae1c12ef565dd78298fe2459486f75bdb6a6124b03
remixlabs/wasicaml
wc_prims.ml
Copyright ( C ) 2021 by Figly , Inc. This code is free software , see the file LICENSE for details . This code is free software, see the file LICENSE for details. *) let mk_table l = let tab = Hashtbl.create 7 in List.iter (fun k -> Hashtbl.add tab k ()) l; tab (* primitives that cannot return fun...
null
https://raw.githubusercontent.com/remixlabs/wasicaml/74ff72535aa8e49ab94a05d9c32c059ce264c1bb/src/wasicaml/wc_prims.ml
ocaml
primitives that cannot return functions:
Copyright ( C ) 2021 by Figly , Inc. This code is free software , see the file LICENSE for details . This code is free software, see the file LICENSE for details. *) let mk_table l = let tab = Hashtbl.create 7 in List.iter (fun k -> Hashtbl.add tab k ()) l; tab let prims_non_func_result = [ "cam...
e88329662fb31c6972bdf119c42e804c624c29f463810e12f9772c41b14851a1
osteele/cl-spec
failing-spec.lisp
Copyright 2008 by . Released under the MIT License . (in-package #:cl-user) (cl-spec:specify "a spec with some failing examples" () ("should pass" (=> (+ 1 2) should = 3)) ("should fail" (=> (+ 1 2) should = 4)) ("should also fail" (=> (+ 1 2) should = 4))) (cl-spec:specify "a spec with all pass...
null
https://raw.githubusercontent.com/osteele/cl-spec/d83b8a89d55771691e439e2fb910ce202dbd6abe/examples/failing-spec.lisp
lisp
Copyright 2008 by . Released under the MIT License . (in-package #:cl-user) (cl-spec:specify "a spec with some failing examples" () ("should pass" (=> (+ 1 2) should = 3)) ("should fail" (=> (+ 1 2) should = 4)) ("should also fail" (=> (+ 1 2) should = 4))) (cl-spec:specify "a spec with all pass...
bfb7f90d50faa558b9014db76a3cdf4c05912a0a0e52b96ced787745b25be202
input-output-hk/project-icarus-importer
DB.hs
-- | Re-exports of Pos.DB functionality. module Pos.DB ( module Pos.DB.Sum , module Pos.DB.Rocks , module Pos.DB.Pure , module Pos.DB.Functions , module Pos.DB.Error , module Pos.DB.Class , module Pos.DB.BlockIndex , module Pos.DB.BatchOp , module Pos.DB.Mi...
null
https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/db/Pos/DB.hs
haskell
| Re-exports of Pos.DB functionality.
module Pos.DB ( module Pos.DB.Sum , module Pos.DB.Rocks , module Pos.DB.Pure , module Pos.DB.Functions , module Pos.DB.Error , module Pos.DB.Class , module Pos.DB.BlockIndex , module Pos.DB.BatchOp , module Pos.DB.Misc.Common , module Pos.DB.GState.C...
16fac32724aff5a2f9f7650013482d9e42e139e74d401b5a94590b8fc03163b5
RefactoringTools/HaRe
GuardsCase2.hs
module GuardsCase2 where f x = case x of 1 | x `mod` 4 == 0 -> g x where g x = x + 1 _ -> 42
null
https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/testing/whereToLet/GuardsCase2.hs
haskell
module GuardsCase2 where f x = case x of 1 | x `mod` 4 == 0 -> g x where g x = x + 1 _ -> 42
9542c0aa80decf362a6c6783756a7e2bdf902cad3d32f1672cdb0819e24b4095
alanzplus/EOPL
2.18-test.rkt
#lang eopl (require rackunit "2.18.rkt") (require rackunit/text-ui) (define test-lst '(6 (5 4 3 2 1) (7 8 9))) (define node-in-sequence-test (test-suite "Tests for node in sequence" (check-equal? (number->sequence 7) '(7 () ())) (check-equal? (current-element test-lst) 6) (check-equal? (move-to-l...
null
https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch2/2.18-test.rkt
racket
#lang eopl (require rackunit "2.18.rkt") (require rackunit/text-ui) (define test-lst '(6 (5 4 3 2 1) (7 8 9))) (define node-in-sequence-test (test-suite "Tests for node in sequence" (check-equal? (number->sequence 7) '(7 () ())) (check-equal? (current-element test-lst) 6) (check-equal? (move-to-l...
fe17ae92640e9fc831783cc5f3a323944ac350df5b58546ad9d6de4a9fb358a9
conscell/hugs-android
GetOpt.hs
# OPTIONS_GHC -cpp # ----------------------------------------------------------------------------- -- | Module : Distribution . Copyright : ( c ) 2002 - 2005 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : -- Stability : experimental -- Portability : port...
null
https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/Cabal/Distribution/GetOpt.hs
haskell
--------------------------------------------------------------------------- | License : BSD-style (see the file libraries/base/LICENSE) Maintainer : Stability : experimental Portability : portable This library provides facilities for parsing the command-line options @getopt@ library. ------------...
# OPTIONS_GHC -cpp # Module : Distribution . Copyright : ( c ) 2002 - 2005 in a standalone program . It is essentially a Haskell port of the GNU < > Oct. 1996 ( small changes Dec. 1997 ) Two rather obscure features are missing : The Bash 2.0 non - option hack ( if you do n't already...
143ddf3af771d401ff96814cfbfcbaba6528e82a12d2a539d4e63d01063aebd8
tarcieri/reia
reia_bytecode.erl
% reia_bytecode : Generate bytecode from compiled Reia AST Copyright ( C)2009 - 10 % Redistribution is permitted under the MIT license . See LICENSE for details . % -module(reia_bytecode). -export([compile/2, compile/3, load_file/1, load/1, load/2]). -include("reia_nodes.hrl"). -include("reia_compile_option...
null
https://raw.githubusercontent.com/tarcieri/reia/77b8b5603ae5d89a0d8fc0b3e179ef052260b5bf/src/compiler/reia_bytecode.erl
erlang
Ideally this record is opaque to everything except this module No other modules should operate directly on raw Reia bytecode Load the given file, executing its toplevel function the given arguments (in order to pass along a default binding) Compiled evaluation of a parsed Reia file
reia_bytecode : Generate bytecode from compiled Reia AST Copyright ( C)2009 - 10 Redistribution is permitted under the MIT license . See LICENSE for details . -module(reia_bytecode). -export([compile/2, compile/3, load_file/1, load/1, load/2]). -include("reia_nodes.hrl"). -include("reia_compile_options.hrl")...
59123cd940a2b9d6c7d088cc76d87c46080473c51e39ad799edd704582f721d4
purcell/adventofcode2016
Day2.hs
module Main where import AdventOfCode import qualified Data.Map as M import Data.Maybe (fromMaybe) data Direction = U | D | L | R data Button = Button { bNum :: String , bPos :: (Int, Int) } deriving (Show) type Grid = (Int, Int) -> Maybe String makeGrid :: [String] -> Grid makeGrid gridRows = flip M...
null
https://raw.githubusercontent.com/purcell/adventofcode2016/081f30de4ea6b939e6c3736d83836f4dd72ab9a2/src/Day2.hs
haskell
module Main where import AdventOfCode import qualified Data.Map as M import Data.Maybe (fromMaybe) data Direction = U | D | L | R data Button = Button { bNum :: String , bPos :: (Int, Int) } deriving (Show) type Grid = (Int, Int) -> Maybe String makeGrid :: [String] -> Grid makeGrid gridRows = flip M...
917295f126b154b478965109ddfd6020b97816e889e003610754afed1feeb75b
camlp5/camlp5
odyl_main.ml
(* camlp5r pa_macro.cmo *) (* odyl_main.ml,v *) Copyright ( c ) INRIA 2007 - 2017 let go = ref (fun () -> ());; let name = ref "odyl";; let first_arg_no_load () = let rec loop i = if i < Array.length Sys.argv then match Sys.argv.(i) with "-I" -> loop (i + 2) | "-nolib" -> loop (i + 1) ...
null
https://raw.githubusercontent.com/camlp5/camlp5/15e03f56f55b2856dafe7dd3ca232799069f5dda/ocaml_src/odyl/odyl_main.ml
ocaml
camlp5r pa_macro.cmo odyl_main.ml,v Load files in core
Copyright ( c ) INRIA 2007 - 2017 let go = ref (fun () -> ());; let name = ref "odyl";; let first_arg_no_load () = let rec loop i = if i < Array.length Sys.argv then match Sys.argv.(i) with "-I" -> loop (i + 2) | "-nolib" -> loop (i + 1) | "-where" -> loop (i + 1) | "--" -> i +...
18ec3a26c0736a7cbe65a99762739c18918f9f64e40635f3cc4c47d63ee38e1e
ocsigen/js_of_ocaml
test.ml
(* TEST *) let is_even x = (x mod 2 = 0) let string_of_even_opt x = if is_even x then Some (string_of_int x) else None let string_of_even_or_int x = if is_even x then Either.Left (string_of_int x) else Either.Right x (* Standard test case *) let () = let l = List.init 10 (fun x -> x) in ...
null
https://raw.githubusercontent.com/ocsigen/js_of_ocaml/31c8a3d9d4e34f3fd573dd5056e733233ca4f4f6/compiler/tests-ocaml/lib-list/test.ml
ocaml
TEST Standard test case The current implementation of List.equal calls the comparison function even for different-size lists. This is not part of the specification, so it would be valid to change this behavior, but we don't want to change it without noticing so here is a test for it. Empty te...
let is_even x = (x mod 2 = 0) let string_of_even_opt x = if is_even x then Some (string_of_int x) else None let string_of_even_or_int x = if is_even x then Either.Left (string_of_int x) else Either.Right x let () = let l = List.init 10 (fun x -> x) in let sl = List.init 10 string_of_int ...
5164fdb6467d7fe761e98bc39c3cf871b2d2ea5c4b61ec839ed50befe10aedca
synduce/Synduce
min.ml
* @synduce -s 2 --no - lifting -NB --se2gis type itree = | Leaf of int | Node of int * itree * itree let rec is_symmetric = function | Leaf x -> true | Node (a, l, r) -> symm1 l r && is_symmetric l && is_symmetric r and symm1 l = function | Leaf x -> is_leaf x l | Node (ar, rl, rr) -> symm2 ar rl rr l a...
null
https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/constraints/symmetric_tree/min.ml
ocaml
* @synduce -s 2 --no - lifting -NB --se2gis type itree = | Leaf of int | Node of int * itree * itree let rec is_symmetric = function | Leaf x -> true | Node (a, l, r) -> symm1 l r && is_symmetric l && is_symmetric r and symm1 l = function | Leaf x -> is_leaf x l | Node (ar, rl, rr) -> symm2 ar rl rr l a...
b8b0c50cdfc45ec89483c5924c84ea610f435ad3ae51a68a73f382cda33a9354
lambdaclass/erlang-katana
ktn_random_SUITE.erl
-module(ktn_random_SUITE). -export([ all/0, init_per_suite/1, end_per_suite/1 ]). -export([ string/1, uniform/1, pick/1 ]). -define(EXCLUDED_FUNS, [ module_info, all, test, init_per_suite, end_p...
null
https://raw.githubusercontent.com/lambdaclass/erlang-katana/ebb6b1358c974b5e3b16f5e95422061385ae34ac/test/ktn_random_SUITE.erl
erlang
Common test Test Cases
-module(ktn_random_SUITE). -export([ all/0, init_per_suite/1, end_per_suite/1 ]). -export([ string/1, uniform/1, pick/1 ]). -define(EXCLUDED_FUNS, [ module_info, all, test, init_per_suite, end_p...
ea070da27673873fe10d224ad569f9f70ac3582dfc6b5548314b4d498f183c01
argp/bap
asmir_vars.ml
(** Asmir variables *) open Type let x86_regs = Disasm_i386.regs_x86 let x64_regs = Disasm_i386.regs_x86_64 let full_regs = Disasm_i386.regs_full let x86_mem = Disasm_i386.R32.mem let x64_mem = Disasm_i386.R64.mem module X86 = struct module R32 = Disasm_i386.R32 module R64 = Disasm_i386.R64 end let mem_of_type...
null
https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocaml/asmir_vars.ml
ocaml
* Asmir variables x86 subregisters x64 subregisters
open Type let x86_regs = Disasm_i386.regs_x86 let x64_regs = Disasm_i386.regs_x86_64 let full_regs = Disasm_i386.regs_full let x86_mem = Disasm_i386.R32.mem let x64_mem = Disasm_i386.R64.mem module X86 = struct module R32 = Disasm_i386.R32 module R64 = Disasm_i386.R64 end let mem_of_type = function | Type.Re...
aea202168136a31594e2e6e2ae88c1438d743288ca3575431fa6afdd99fd39ec
logseq/mldoc
mldoc_parser.ml
open Angstrom open! Prelude let list_content_parsers config = let p = choice [ Table.parse config ; Type_parser.Block.parse config ; Latex_env.parse config ; Hr.parse config ; Type_parser.Block.results ; Comment.parse config ; Paragraph.parse ; Paragraph.sep ...
null
https://raw.githubusercontent.com/logseq/mldoc/e353ea9cffa73b6244cb6d62e48cd26c3169faf6/lib/mldoc_parser.ml
ocaml
Orders care
open Angstrom open! Prelude let list_content_parsers config = let p = choice [ Table.parse config ; Type_parser.Block.parse config ; Latex_env.parse config ; Hr.parse config ; Type_parser.Block.results ; Comment.parse config ; Paragraph.parse ; Paragraph.sep ...
037aed8fd3f859f4ddc458b2f337e333b4bb8f97bc1fd6eaa9288e128cd8fbfd
tmattio/js-bindings
vscode_languageserver_protocol_protocol_call_hierarchy.ml
[@@@js.dummy "!! This code has been generated by gen_js_api !!"] [@@@ocaml.warning "-7-32-39"] [@@@ocaml.warning "-7-11-32-33-39"] open Es5 open Vscode_jsonrpc open Vscode_languageserver_types open Vscode_languageserver_protocol_messages open Vscode_languageserver_protocol_protocol module CallHierarchyClientCapabilitie...
null
https://raw.githubusercontent.com/tmattio/js-bindings/ca3bd6a12db519c8de7f41b303f14cf70cfd4c5f/lib/vscode-languageserver-protocol/vscode_languageserver_protocol_protocol_call_hierarchy.ml
ocaml
[@@@js.dummy "!! This code has been generated by gen_js_api !!"] [@@@ocaml.warning "-7-32-39"] [@@@ocaml.warning "-7-11-32-33-39"] open Es5 open Vscode_jsonrpc open Vscode_languageserver_types open Vscode_languageserver_protocol_messages open Vscode_languageserver_protocol_protocol module CallHierarchyClientCapabilitie...
e364830277d00fc93a6b703f7e0f71ad0f8687f8c51373d86e1197c8a7f1e587
valderman/haste-compiler
Parsing.hs
# LANGUAGE FlexibleInstances # -- | Home-grown parser, just because. module Haste.Parsing ( Parse, runParser, char, charP, string, oneOf, possibly, atLeast, whitespace, word, Haste.Parsing.words, int, double, positiveDouble, suchThat, quotedString, skip, rest, lookahead, anyChar ) where import Control.App...
null
https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/libraries/haste-lib/src/Haste/Parsing.hs
haskell
| Home-grown parser, just because. | Require a specific character. | Parse a character that matches a given predicate. | Require a specific string. | Invoke a parser with the possibility of failure. | Invoke a parser at least n times. character. | Parse several words, separated by whitespace. | Parse an Int....
# LANGUAGE FlexibleInstances # module Haste.Parsing ( Parse, runParser, char, charP, string, oneOf, possibly, atLeast, whitespace, word, Haste.Parsing.words, int, double, positiveDouble, suchThat, quotedString, skip, rest, lookahead, anyChar ) where import Control.Applicative import Control.Monad import D...
8924a0adbe8a44880a5426031e77d0d0587fae1b0a075d16e5c03cec417f7606
marcinjangrzybowski/cubeViz2
ExprTransform.hs
# LANGUAGE TupleSections # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE ScopedTypeVariables # # LANGUAGE LambdaCase # # OPTIONS_GHC -fwarn - incomplete - patterns # module ExprTransform where import Syntax -- import Drawing.Base import Data.Maybe impo...
null
https://raw.githubusercontent.com/marcinjangrzybowski/cubeViz2/f73135e03db0b6c923cc103afe328b37da2d319d/src/ExprTransform.hs
haskell
import Drawing.Base use only for subfaces without parents in particular cylinder TODO : good place to intoduce NotFullSubFace type then clInterior a' else data ConstraintsOverrideStrategy = COSClearWithConstrained | COSClearNecessary | COSInflate deriving (Eq) | ReplaceAt Address (ClCub ()) | R...
# LANGUAGE TupleSections # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE ScopedTypeVariables # # LANGUAGE LambdaCase # # OPTIONS_GHC -fwarn - incomplete - patterns # module ExprTransform where import Syntax import Data.Maybe import Data.Either import D...
dbe41e32600ad68a3aa6820a34303459235de3c66e19cc676f22ace3e57bb165
madstap/cadastro-de-pessoa
cnpj.cljc
(ns cadastro-de-pessoa.cnpj (:refer-clojure :exclude [format]) (:require [cadastro-de-pessoa.shared :as shared])) (def length 14) (def ^:private mask1 [5 4 3 2 9 8 7 6 5 4 3 2]) (def ^:private mask2 [6 5 4 3 2 9 8 7 6 5 4 3 2]) (def control-digits (partial shared/control-digits mask1 mask2)) (def repeated ...
null
https://raw.githubusercontent.com/madstap/cadastro-de-pessoa/dd2ecc4a51c4f6bb39e1666055f16821dfec2d84/src/cadastro_de_pessoa/cnpj.cljc
clojure
(ns cadastro-de-pessoa.cnpj (:refer-clojure :exclude [format]) (:require [cadastro-de-pessoa.shared :as shared])) (def length 14) (def ^:private mask1 [5 4 3 2 9 8 7 6 5 4 3 2]) (def ^:private mask2 [6 5 4 3 2 9 8 7 6 5 4 3 2]) (def control-digits (partial shared/control-digits mask1 mask2)) (def repeated ...
8f64a14c43cc68922bdaf10c3b46ec6a4caea094375acf5ffc08a34e76d1aca2
riak-haskell-client/riak-haskell-client
Basic.hs
{-# LANGUAGE BangPatterns #-} # LANGUAGE CPP # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # -- | -- Module: Network.Riak.Basic Copyright : ( c ) 2011 MailRank , Inc. License : Apache Maintainer : < > , < > -- Stability: experimental -- Portability:...
null
https://raw.githubusercontent.com/riak-haskell-client/riak-haskell-client/a1eafc4c16b85a98b2d29e306165f4d93819609f/riak/src/Network/Riak/Basic.hs
haskell
# LANGUAGE BangPatterns # # LANGUAGE OverloadedStrings # | Module: Network.Riak.Basic Stability: experimental Portability: portable When storing and retrieving data, the functions in this module do not perform any encoding or decoding of data, nor do they resolve conflicts. * Client configuration ...
# LANGUAGE CPP # # LANGUAGE RecordWildCards # Copyright : ( c ) 2011 MailRank , Inc. License : Apache Maintainer : < > , < > Basic support for the Riak decentralized data store . module Network.Riak.Basic ( ClientID , Client(..) , defaultClient , Connect...
17045bb0a5105d963343773f36096950dcdc520d853d6b255d91a0a6afbaffdb
ryanpbrewster/haskell
P204.hs
module Problems.P204 ( solve ) where import qualified Data.Set as DS - A Hamming number is a positive number which has no prime factor larger than - 5 . So the first few Hamming numbers are 1 , 2 , 3 , 4 , 5 , 6 , 8 , 9 , 10 , 12 , 15 . - There are 1105 Hamming numbers not exceeding 10 ^ 8 . - - ...
null
https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Problems/P204.hs
haskell
module Problems.P204 ( solve ) where import qualified Data.Set as DS - A Hamming number is a positive number which has no prime factor larger than - 5 . So the first few Hamming numbers are 1 , 2 , 3 , 4 , 5 , 6 , 8 , 9 , 10 , 12 , 15 . - There are 1105 Hamming numbers not exceeding 10 ^ 8 . - - ...
6f770984507f92fa53866e47177f971dc6a1becc7a2a48249c32f6c703b20863
kupl/LearnML
original.ml
type formula = | True | False | Not of formula | AndAlso of (formula * formula) | OrElse of (formula * formula) | Imply of (formula * formula) | Equal of (exp * exp) and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp) let rec calc (f : exp) : int = match f with | Num x -> x | Plus (x...
null
https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/formula/sub103/original.ml
ocaml
type formula = | True | False | Not of formula | AndAlso of (formula * formula) | OrElse of (formula * formula) | Imply of (formula * formula) | Equal of (exp * exp) and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp) let rec calc (f : exp) : int = match f with | Num x -> x | Plus (x...
81b62121c6990905c34511dc2c8f0f134eeda57d69c28ca378178ddf92098cdd
avras/nsime
nsime_netdevice_SUITE.erl
%% Copyright ( C ) 2012 < > %% %% This file is part of nsime. %% nsime is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or %% (at your option) any later version....
null
https://raw.githubusercontent.com/avras/nsime/fc5c164272aa649541bb3895d9f4bea34f45beec/test/nsime_netdevice_SUITE.erl
erlang
This file is part of nsime. (at your option) any later version. nsime is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. along with...
Copyright ( C ) 2012 < > nsime is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License Author :...
05c2d6704d44fd0514270b552722b0c0e79100e01402bb8bf07822c99d2a1952
avsm/eeww
actions_helpers.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/avsm/eeww/4d65720b5dd51376842ffe5c8c220d5329c1dc10/boot/ocaml/ocamltest/actions_helpers.ml
ocaml
************************************************************************ OCaml ...
, projet Gallium , INRIA Paris Copyright 2016 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Ocamltest_stdlib let skip_with_reason reason = let code _log env = let result = Result.skip_with_r...
500d3624af29b7511c9401cac67c93fc1347fb582b63924340286228915b080a
dmitryvk/sbcl-win32-threads
objdef.lisp
;;;; machine-independent aspects of the object representation This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the ;;;; public domain. The software is ...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/compiler/generic/objdef.lisp
lisp
machine-independent aspects of the object representation more information. public domain. The software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. definitions, but in general they're not. In particular, if you try to add a slot to ...
This software is part of the SBCL system . See the README file for This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the (in-package "SB!VM") : The primitive objects here may look like self - contained * The GC scavenging code ( and for a...
377beb20277ccc0d611f15dc4c712d405600152aadd58a37032afd6a584c1479
bendoerr/real-world-haskell
return1.hs
Avoiding type errors with the IO Monad using return . -- import Data.Char(toUpper) isGreen :: IO Bool isGreen = do putStrLn "Is green your favorite color?" inpStr <- getLine return ((toUpper . head $ inpStr) == 'Y') -------------- -- return2.hs -- pure function broken out -- isYes2 :: String -> Bo...
null
https://raw.githubusercontent.com/bendoerr/real-world-haskell/fa43aa59e42a162f5d2d5655b274b964ebeb8f0a/ch07/return1.hs
haskell
------------ return2.hs pure function broken out ----------- return3.hs contrived example showing return doesn't need to be last
Avoiding type errors with the IO Monad using return . import Data.Char(toUpper) isGreen :: IO Bool isGreen = do putStrLn "Is green your favorite color?" inpStr <- getLine return ((toUpper . head $ inpStr) == 'Y') isYes2 :: String -> Bool isYes2 s = (toUpper . head $ s) == 'Y' isGreen2 :: IO Bool ...
1952589d83aa5d32dc2b9ac139d43c823f75ab69686e02791d11b504133a679c
tsloughter/kuberl
kuberl_v1_stateful_set_spec.erl
-module(kuberl_v1_stateful_set_spec). -export([encode/1]). -export_type([kuberl_v1_stateful_set_spec/0]). -type kuberl_v1_stateful_set_spec() :: #{ 'podManagementPolicy' => binary(), 'replicas' => integer(), 'revisionHistoryLimit' => integer(), 'selector' := kuberl_v1_label_selector:kuberl_v...
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_stateful_set_spec.erl
erlang
-module(kuberl_v1_stateful_set_spec). -export([encode/1]). -export_type([kuberl_v1_stateful_set_spec/0]). -type kuberl_v1_stateful_set_spec() :: #{ 'podManagementPolicy' => binary(), 'replicas' => integer(), 'revisionHistoryLimit' => integer(), 'selector' := kuberl_v1_label_selector:kuberl_v...
49a00231c5db98385f3f5aa73be77427aa4a83bfd710efb514007ea0ac1ed13a
jarmitage/jarmlib
Sensel.hs
-- Sensel OSC input params :{ let sensel1x = cF 0 "sensel1x" sensel1y = cF 0 "sensel1y" sensel1z = cF 0 "sensel1z" :} :{ let sensel n a = cF 0 $ "sensel" ++ (show n) ++ a :} p1 $ s "bd" # gain (sensel 1 "x")
null
https://raw.githubusercontent.com/jarmitage/jarmlib/853f6d18ab32630397be91ea89846d55e59e3d70/tidal/osc/controllers/Sensel.hs
haskell
Sensel OSC input params
:{ let sensel1x = cF 0 "sensel1x" sensel1y = cF 0 "sensel1y" sensel1z = cF 0 "sensel1z" :} :{ let sensel n a = cF 0 $ "sensel" ++ (show n) ++ a :} p1 $ s "bd" # gain (sensel 1 "x")
c3bc1cc606c5a0c64ed40ae9348ba94ddb06649c5826477ddeac34d0d761bf56
mark-watson/haskell_tutorial_cookbook_examples
LetAndWhere.hs
module Main where funnySummation w x y z = let bob = w + x sally = y + z in bob + sally testLetComprehension = [(a,b) | a <- [0..5], let b = 10 * a] testWhereBlocks a = z * q where z = a + 2 q = 2 functionWithWhere n = (n + 1) * tenn where tenn = 10 * n main = do print $ fu...
null
https://raw.githubusercontent.com/mark-watson/haskell_tutorial_cookbook_examples/0f46465b67d245fa3853b4e320d79b7d7234e061/Pure/LetAndWhere.hs
haskell
module Main where funnySummation w x y z = let bob = w + x sally = y + z in bob + sally testLetComprehension = [(a,b) | a <- [0..5], let b = 10 * a] testWhereBlocks a = z * q where z = a + 2 q = 2 functionWithWhere n = (n + 1) * tenn where tenn = 10 * n main = do print $ fu...
4320d39ceedf6f34722383973b666ddd2e51fa1fb278409a24197dadf5b0975c
McCLIM/McCLIM
binseq2.lisp
;;; --------------------------------------------------------------------------- ;;; License: LGPL-2.1+ (See file 'Copyright' for details). ;;; --------------------------------------------------------------------------- ;;; ( c ) copyright 2005 < > ;;; ;;; ---------------------------------------------------------...
null
https://raw.githubusercontent.com/McCLIM/McCLIM/7c890f1ac79f0c6f36866c47af89398e2f05b343/Libraries/Drei/Persistent/binseq2.lisp
lisp
--------------------------------------------------------------------------- License: LGPL-2.1+ (See file 'Copyright' for details). --------------------------------------------------------------------------- --------------------------------------------------------------------------- Differs from binseq in: ...
( c ) copyright 2005 < > Adaptation of binary sequences by ( real-world-phenomena.org ) nodes contain two counts : number of lines and number of objects (in-package #:binseq) NOTE : should use a 3 - vector instead of the 3 - list ... (or (eq s 'empty) (and (consp s) (or (and (eq (car...
c804c5c3cbd3a096943a5d88436dad44e1a812cdf6d4d09a2f03a6ccf6e649a5
pmatiello/mockfn
core.cljc
(ns mockfn.core (:require [mockfn.macros :as macros] [mockfn.matchers :as matchers])) (def #^{:macro true} ^:deprecated providing #'macros/providing) (def #^{:macro true} ^:deprecated verifying #'macros/verifying) (def ^:deprecated exactly matchers/exactly) (def ^:deprecated at-least matchers/at-least) ...
null
https://raw.githubusercontent.com/pmatiello/mockfn/f8940ae354033bb600b788f7e0a9cf6abf2146da/src/mockfn/core.cljc
clojure
(ns mockfn.core (:require [mockfn.macros :as macros] [mockfn.matchers :as matchers])) (def #^{:macro true} ^:deprecated providing #'macros/providing) (def #^{:macro true} ^:deprecated verifying #'macros/verifying) (def ^:deprecated exactly matchers/exactly) (def ^:deprecated at-least matchers/at-least) ...
248636342965577683b5aa57cd856f9c6430919e586b7ce3da4af350c1f6ac24
DrakeAxelrod/functional-programming
BlackJack.hs
module BlackJack where import Cards import RunGame import System.Random import Test.QuickCheck implementation = Interface { iFullDeck = fullDeck, iValue = value, iDisplay = display, iGameOver = gameOver, iWinner = winner, iDraw = draw, iPlayBank = playBank, iShuf...
null
https://raw.githubusercontent.com/DrakeAxelrod/functional-programming/9888822f0824c9568026a61da6beaeeecced518c/lab2/BlackJack.hs
haskell
main = do quickCheck prop_onTopOf_assoc ---------------------- A1 ------------------------ | Converts a rank to a short diplay representation | Converts the suit of a card to a short unicode representation | Display a card in short representation | Display of a hand of cards. A2 ------------------------ | Co...
module BlackJack where import Cards import RunGame import System.Random import Test.QuickCheck implementation = Interface { iFullDeck = fullDeck, iValue = value, iDisplay = display, iGameOver = gameOver, iWinner = winner, iDraw = draw, iPlayBank = playBank, iShuf...
686a80adf31d74a03bfa3882b446dc4528807a07195b10c9b1c889b38d835e04
LuxLang/lux
record.clj
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (ns lux.analyser.record (:require clojure.core.match clojure.core.match.array (lux [base :as & :refer [|let |do return ...
null
https://raw.githubusercontent.com/LuxLang/lux/91bc060bc498a0d2418198cfcb9dc39636d1d867/lux-bootstrapper/src/lux/analyser/record.clj
clojure
[Exports]
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. (ns lux.analyser.record (:require clojure.core.match clojure.core.match.array (lux [base :as & :refer [|let |do return ...
9590de1e3c81643be9fbfccd586ef5a723cbed917b3a81dad757da767ae1eabb
tezos-commons/baseDAO
Vote.hs
SPDX - FileCopyrightText : 2021 Tezos Commons SPDX - License - Identifier : LicenseRef - MIT - TC # LANGUAGE ApplicativeDo # | Contains test on @vote@ entrypoint for the LIGO contract . module Test.Ligo.BaseDAO.Proposal.Vote ( proposalCorrectlyTrackVotes , voteNonExistingProposal , voteDeletedProposal , ...
null
https://raw.githubusercontent.com/tezos-commons/baseDAO/c8cc03362b64e8f27432ec70cdb4c0df82abff35/haskell/test/Test/Ligo/BaseDAO/Proposal/Vote.hs
haskell
Create sample proposal Advance one voting period to a voting stage. Advance one voting period to a proposing stage. Create sample proposal Advance one voting period to a voting stage. Advance one voting period to a proposing stage. Create sample proposal Advance one voting period to a voting stage. Advance one...
SPDX - FileCopyrightText : 2021 Tezos Commons SPDX - License - Identifier : LicenseRef - MIT - TC # LANGUAGE ApplicativeDo # | Contains test on @vote@ entrypoint for the LIGO contract . module Test.Ligo.BaseDAO.Proposal.Vote ( proposalCorrectlyTrackVotes , voteNonExistingProposal , voteDeletedProposal , ...
c13fad892a9d0a59b79463e9087b96f6bbb989e1808ef753ca33ab65e957c9ce
ghadishayban/pex
tree.clj
(ns com.champbacon.pex.impl.tree (:refer-clojure :exclude [cat char not and])) (def ^:dynamic *macros* {}) (defprotocol OpTree (pattern [_])) ;; make this work on pairs and do associativity fix inline? (defn choice [alternatives] (case (count alternatives) 0 (throw (ex-info "Empty ordered choice operator...
null
https://raw.githubusercontent.com/ghadishayban/pex/aa3255f6aa9086ca867d0ff401b8bbb2a306d86c/src/com/champbacon/pex/impl/tree.clj
clojure
make this work on pairs and do associativity fix inline? make this work on pairs and do associativity fix inline? checkargs TODO Add macroexpansion 'reduce (reduce-value-stack (next l)) Optimizations A pattern is *nullable* if it can match without consuming any character; A pattern is *nofail* if it never fails ...
(ns com.champbacon.pex.impl.tree (:refer-clojure :exclude [cat char not and])) (def ^:dynamic *macros* {}) (defprotocol OpTree (pattern [_])) (defn choice [alternatives] (case (count alternatives) 0 (throw (ex-info "Empty ordered choice operator" {})) 1 (first alternatives) {:op :choice :chi...
ccbdfe319dcc0f50493a1c428283d00a666e006ad80ec0c8f3ce94e89a815d4b
karimarttila/clojure
users_dynamodb.clj
(ns simpleserver.userdb.users-dynamodb (:require [clojure.tools.logging :as log] [amazonica.aws.dynamodbv2 :as dynamodb] [environ.core :as environ] [simpleserver.userdb.users-service-interface :as ss-users-service-interface] [simpleserver.util.aws-utils :as ss-aws-utils] [simpleserver.userdb.u...
null
https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/clj-ring-cljs-reagent-demo/simple-server/src/simpleserver/userdb/users_dynamodb.clj
clojure
NOTE: We are skipping the pagination here since this is an exercise and See: #Query.Pagination In real life we should anticipate pagination and also test it.
(ns simpleserver.userdb.users-dynamodb (:require [clojure.tools.logging :as log] [amazonica.aws.dynamodbv2 :as dynamodb] [environ.core :as environ] [simpleserver.userdb.users-service-interface :as ss-users-service-interface] [simpleserver.util.aws-utils :as ss-aws-utils] [simpleserver.userdb.u...
8c45fcabff927373e589a287acd45f56a78d7f17cc21acee7fc3e4ab0028ddbd
tonyg/kali-scheme
disasm.scm
; -*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*- Copyright ( c ) 1993 , 1994 by and . Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING . ; This is file assem.scm. ; This defines a command processor command ; dis <expression> ; that evaluates <expression> to obtain a...
null
https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/env/disasm.scm
scheme
-*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*- This is file assem.scm. This defines a command processor command dis <expression> that evaluates <expression> to obtain a procedure or lambda-expression, which is then disassembled. Needs: template? template-name template-code closure? closure-tem...
Copyright ( c ) 1993 , 1994 by and . Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING . (define-command-syntax 'dis "[<exp>]" "disassemble procedure" '(&opt expression)) (define (dis . maybe-exp) (disassemble (if (null? maybe-exp) (focus-object) (eval (car may...
33dd473e6fde7227d501afb50c714b2ee96a6de6b6450558bc9324945c7ae45f
caisah/sicp-exercises-and-examples
stream.scm
(define (stream-ref s n) (if (= n 0) (stream-car s) (stream-ref (stream-cdr s) (- n 1)))) (define (stream-map proc s) (if (stream-null? s) the-empty-stream (cons-stream (proc (stream-car s)) (stream-map proc (stream-cdr s))))) (define (stream-for-each proc s) (if (stre...
null
https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/3.5.1-streams_are_delayed_lists/stream.scm
scheme
(define (stream-null? stream) (null? stream)) (define (stream-car stream) (car stream)) (define (stream-cdr stream) (force (cdr stream))) (define (cons-stream a b) (cons a (delay b))) (define the-empty-stream '()) (define (memo-proc proc) (let ((already-run? false) (result false)) (lambda () (if...
(define (stream-ref s n) (if (= n 0) (stream-car s) (stream-ref (stream-cdr s) (- n 1)))) (define (stream-map proc s) (if (stream-null? s) the-empty-stream (cons-stream (proc (stream-car s)) (stream-map proc (stream-cdr s))))) (define (stream-for-each proc s) (if (stre...