_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 |
|---|---|---|---|---|---|---|---|---|
5186171a3e16eea39ad61d78fd4f9ae5e459357dac5e8a3217a255e5246dfc7f | racket/racket7 | id-set.rkt | #lang racket/base
(require (for-syntax racket/base syntax/parse syntax/stx racket/syntax)
racket/set racket/dict racket/sequence racket/stream racket/contract
syntax/id-table)
i d formatting helper fns ---------------------------------------------------
;; mk-pred-name : identifier -> identifier
... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/syntax/private/id-set.rkt | racket | mk-pred-name : identifier -> identifier
fmt-set-id-fn-name : identifier string -> identifier
(fmt-set-id-fn-name #'free "empty?") => #'free-id-set-empty?
fmt-table-id-fn-name : identifier string -> identifier
(fmt-table-id-fn-name #'free "ref") => #'free-id-table-ref
fmt-id : string identifier -> identifier
form... | #lang racket/base
(require (for-syntax racket/base syntax/parse syntax/stx racket/syntax)
racket/set racket/dict racket/sequence racket/stream racket/contract
syntax/id-table)
i d formatting helper fns ---------------------------------------------------
(define-for-syntax (fmt-pred-name id) (form... |
ab5babac4ae961bbbbb7b2ece18ff4b70babcb209895c836d4369f3137eda76d | guicho271828/eazy-opencl | 0-package.lisp |
(defpackage :eazy-opencl.fancy
(:use :cl :alexandria :iterate :trivia :eazy-opencl.host)
(:import-from :eazy-opencl.bindings
:boxed-command-queue
:boxed-context
:boxed-device-id
:boxed-event
:boxed-kernel
:boxed-mem
... | null | https://raw.githubusercontent.com/guicho271828/eazy-opencl/ec3b2aae3a768bed738d825a0c7e2394a3d6622a/3.fancy-src/0-package.lisp | lisp |
(defpackage :eazy-opencl.fancy
(:use :cl :alexandria :iterate :trivia :eazy-opencl.host)
(:import-from :eazy-opencl.bindings
:boxed-command-queue
:boxed-context
:boxed-device-id
:boxed-event
:boxed-kernel
:boxed-mem
... | |
daf8d48fba57a08e3f6624ef451b014c3665f7c6f133720f76718fc905d30519 | keechma/keechma-toolbox | helpers.cljs | (ns keechma.toolbox.forms.helpers
(:require [keechma.ui-component :as ui]
[keechma.toolbox.forms.core :as forms-core]
[reagent.ratom]
[forms.util :as keechma-forms-util]
[forms.core :as keechma-forms-core])
(:require-macros
[reagent.ratom :refer [reaction]]))
(def... | null | https://raw.githubusercontent.com/keechma/keechma-toolbox/61bf68cbffc1540b56b7b1925fef5e0aa12d60e7/src/cljs/keechma/toolbox/forms/helpers.cljs | clojure | (ns keechma.toolbox.forms.helpers
(:require [keechma.ui-component :as ui]
[keechma.toolbox.forms.core :as forms-core]
[reagent.ratom]
[forms.util :as keechma-forms-util]
[forms.core :as keechma-forms-core])
(:require-macros
[reagent.ratom :refer [reaction]]))
(def... | |
11f420f99c6520b92da25940b2b8abb64a6f60eee7edc1424562dba77bc69aaa | leithaus/rhocaml | repl.ml | (* -*- mode: Tuareg;-*- *)
(* Filename: main.ml *)
(* Authors: lgm *)
Creation : Mon Mar 7 11:42:44 2005
Co... | null | https://raw.githubusercontent.com/leithaus/rhocaml/7b0c7bfa99dd98059a1e8899007c4b5d258f99ed/repl.ml | ocaml | -*- mode: Tuareg;-*-
Filename: main.ml
Authors: lgm
See LICENSE.BIOSIM in the license directory.
Description: ... | Creation : Mon Mar 7 11:42:44 2005
Copyright : Biosimilarity LLC 2004 - 2006 . All rights reserved .
let read_eval_print_loop () =
let dbg = ref false in
let rslt = ref true in
print_string " *** Rho Top Level version 0.01 *** \n";
try
(while ... |
b797a04eb31f95bc9f1e7cc9d11918b9682f6d77af79651fb5f64eacb4d15652 | braveclojure/cftbat-code | project.clj | (defproject fwpd "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:main ^:skip-aot fwpd.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| null | https://raw.githubusercontent.com/braveclojure/cftbat-code/006fbe19c8ef9a3db66c458991fb613e5824ee7f/04/fwpd/project.clj | clojure | (defproject fwpd "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:main ^:skip-aot fwpd.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
| |
3e985f622ebc491bfe26af0cf8ab87d58ba00a99142809657e49250ddb760e05 | Idorobots/spartan | factstore.rkt | #lang racket
;; Fact store for storing facts.
(require "utils.rkt")
(provide reset-facts! add-fact! remove-fact! map-facts)
State :
(define *facts* (ref null))
(define (reset-facts!)
(assign! *facts* null))
;; Fact store operations:
(define (add-fact! fact)
(unless (fact-asserted? fact)
(assign! *fact... | null | https://raw.githubusercontent.com/Idorobots/spartan/ef3b032906655585d284f1c9a33a58f1e35cb180/src/rete/factstore.rkt | racket | Fact store for storing facts.
Fact store operations:
Utils: | #lang racket
(require "utils.rkt")
(provide reset-facts! add-fact! remove-fact! map-facts)
State :
(define *facts* (ref null))
(define (reset-facts!)
(assign! *facts* null))
(define (add-fact! fact)
(unless (fact-asserted? fact)
(assign! *facts* (cons fact (deref *facts*)))))
(define (remove-fact! fa... |
d192af46bbded0c574ebb65732971f8c23e386e529ae53942dea7546ae62aea8 | sjl/cl-digraph | package.dot.lisp | (defpackage :digraph.dot
(:use :cl :digraph :digraph.quickutils)
(:export :draw :*vertex-shape*))
| null | https://raw.githubusercontent.com/sjl/cl-digraph/936a18cb7de3a7c7e59c244cf4326f217afec85f/package.dot.lisp | lisp | (defpackage :digraph.dot
(:use :cl :digraph :digraph.quickutils)
(:export :draw :*vertex-shape*))
| |
011adb3b23fc67a758dbfc0ebdbf98c9425c9d8a08b7c9b914e3d0f2c8ea412c | SquidDev/illuaminate | loader.ml | open IlluaminateCore
module FileStore = IlluaminateData.Programs.FileStore
module StringMap = Map.Make (String)
module Config = IlluaminateConfigFormat
let src = Logs.Src.create ~doc:"Loads files from directories." __MODULE__
module Log = (val Logs.src_log src)
type file =
{ root : Fpath.t;
path : Fpath.t;
... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/7a6e4bf56f01e81a47c743cb452791c2168ccbda/src/bin/cli/loader.ml | ocaml | TODO: Warn on duplicate files. | open IlluaminateCore
module FileStore = IlluaminateData.Programs.FileStore
module StringMap = Map.Make (String)
module Config = IlluaminateConfigFormat
let src = Logs.Src.create ~doc:"Loads files from directories." __MODULE__
module Log = (val Logs.src_log src)
type file =
{ root : Fpath.t;
path : Fpath.t;
... |
59684a7bfab205e04742ea23608fb4fcd2cf82ed098ae1442de10b662ac55076 | instedd/planwise | coverage.clj | (ns planwise.boundary.coverage
(:require [planwise.model.coverage :as model]
[planwise.util.geo :as geo]
[clojure.spec.alpha :as s]
[clojure.math.combinatorics :as combo]))
;; Specs =====================================================================
;;
(s/def ::pixel-resolution... | null | https://raw.githubusercontent.com/instedd/planwise/eb9ffe00e90d671b7a3a26b6148ecdd93c7072a1/src/planwise/boundary/coverage.clj | clojure | Specs =====================================================================
Protocol defintions =======================================================
returned values depend on the
Auxiliary functions =======================================================
REPL testing =========================================... | (ns planwise.boundary.coverage
(:require [planwise.model.coverage :as model]
[planwise.util.geo :as geo]
[clojure.spec.alpha :as s]
[clojure.math.combinatorics :as combo]))
(s/def ::pixel-resolution float?)
(s/def ::xres ::pixel-resolution)
(s/def ::yres ::pixel-resolution)
(s/de... |
dc65b99a71e06eae5c20159ba040eab2aa85d498c945b838b9419d03953f47a2 | haskell/hie-bios | Bios.hs | | The HIE Bios
Provides an abstraction over the GHC Api to initialise a GHC session and
loading modules in a project .
Defines the ` hie.yaml ` file specification . This is used to explicitly configure
how a project should be built by GHC .
Provides an abstraction over the GHC Api to initialise a GHC se... | null | https://raw.githubusercontent.com/haskell/hie-bios/ba6d3b3408b1ab23822d831d86ff8a8ff488631e/src/HIE/Bios.hs | haskell | * Find and load a Cradle
* Compiler Options | | The HIE Bios
Provides an abstraction over the GHC Api to initialise a GHC session and
loading modules in a project .
Defines the ` hie.yaml ` file specification . This is used to explicitly configure
how a project should be built by GHC .
Provides an abstraction over the GHC Api to initialise a GHC se... |
34716c9e54005774a6018c0dbb476450317207738d341ce816b893b8b09f84b8 | ucsd-progsys/liquidhaskell | Test00b.hs | {-@ LIQUID "--expect-any-error" @-}
module Test00b () where
import Language.Haskell.Liquid.Prelude
x = choose 0
foo :: Num a => a -> a
foo x = 0 - x
prop_abs :: Bool
prop_abs = if x > 0 then baz (foo x) else False
baz :: (Num a, Ord a) => a -> Bool
baz z = liquidAssertB (z > 0)
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/neg/Test00b.hs | haskell | @ LIQUID "--expect-any-error" @ | module Test00b () where
import Language.Haskell.Liquid.Prelude
x = choose 0
foo :: Num a => a -> a
foo x = 0 - x
prop_abs :: Bool
prop_abs = if x > 0 then baz (foo x) else False
baz :: (Num a, Ord a) => a -> Bool
baz z = liquidAssertB (z > 0)
|
74c03b5d2fa5681cf5e667a3496da05a8856eb4f2fc306a51b0084eb87d44428 | KIZI/sparqlab | env.clj | (ns sparqlab.env
(:require [clojure.tools.logging :as log]))
(def defaults
{:init
(fn []
(log/info "\n-=[sparqlab started successfully]=-"))
:stop
(fn []
(log/info "\n-=[sparqlab has shut down successfully]=-"))
:middleware identity})
| null | https://raw.githubusercontent.com/KIZI/sparqlab/33a80b13c0fa0eb9aa0edb294ad0510d2cf52abc/env/prod/clj/sparqlab/env.clj | clojure | (ns sparqlab.env
(:require [clojure.tools.logging :as log]))
(def defaults
{:init
(fn []
(log/info "\n-=[sparqlab started successfully]=-"))
:stop
(fn []
(log/info "\n-=[sparqlab has shut down successfully]=-"))
:middleware identity})
| |
d012c7ada6d0706680721faa6bede48fb364e343e6e1bb2aad76a5cce5f49975 | ucsd-progsys/nate | lang.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/examples_labltk/lang.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
161b659b13588f8f4492f201c8c9016b281a1ab83809ba1404ac774f1ef9e128 | LaurentMazare/tensorflow-ocaml | image.ml | open Base
open Tensorflow_core
type t =
{ tensor : (float, Bigarray.float32_elt) Tensor.t
; width : int
; height : int
}
let imagenet_mean = function
| `blue -> 103.939
| `green -> 116.779
| `red -> 123.68
let normalize x ~channel = Float.of_int x -. imagenet_mean channel
let unnormalize x ~channel = m... | null | https://raw.githubusercontent.com/LaurentMazare/tensorflow-ocaml/52c5f1dec1a8b7dc9bc6ef06abbc07da6cd90d39/examples/neural-style/image.ml | ocaml | open Base
open Tensorflow_core
type t =
{ tensor : (float, Bigarray.float32_elt) Tensor.t
; width : int
; height : int
}
let imagenet_mean = function
| `blue -> 103.939
| `green -> 116.779
| `red -> 123.68
let normalize x ~channel = Float.of_int x -. imagenet_mean channel
let unnormalize x ~channel = m... | |
33da02c58ab4259c51747c183a583b3de4f9391208e12c8256a313b0aa1a53d3 | marianoguerra/interfix | ifix_to_erl.erl | -module(ifix_to_erl).
-export([to_erl/1]).
-include("../include/ifix.hrl").
-record(call, {line=2, names=[], args=[]}).
-define(EMPTY_CALL, #call{names=[], args=[]}).
-define(Call(Names, Args), #call{names=Names, args=Args}).
-define(Call(Line, Names, Args), #call{line=Line, names=Names, args=Args}).
to_erl(Ast) -> ... | null | https://raw.githubusercontent.com/marianoguerra/interfix/4d29a68f85876ed8430f46a4a4b43f233852fe8f/src/ifix_to_erl.erl | erlang | ') -> 'rem';
shouldn't be used
shouldn't be used
shouldn't be used | -module(ifix_to_erl).
-export([to_erl/1]).
-include("../include/ifix.hrl").
-record(call, {line=2, names=[], args=[]}).
-define(EMPTY_CALL, #call{names=[], args=[]}).
-define(Call(Names, Args), #call{names=Names, args=Args}).
-define(Call(Line, Names, Args), #call{line=Line, names=Names, args=Args}).
to_erl(Ast) -> ... |
2e16a7fd95814ef104e472e057a6280eff1055a5a4a7a67633423a08c12c1614 | larandaA/hgraphs | Dsu.hs | module Data.Graph.Abstract.Accessor.Dsu
( Dsu
, new, find, union
) where
import Control.Monad
import Data.Graph.Abstract.Accessor
data Dsu s = Dsu
{ size :: VArray s Int
, parent :: VArray s (Vertex s)
}
new :: Accessor s e v (Dsu s)
new = do
s <- varray 1
p <- vbuild ... | null | https://raw.githubusercontent.com/larandaA/hgraphs/322b5cdfafbae851b4251c907e2c81b82cf02d4a/src/Data/Graph/Abstract/Accessor/Dsu.hs | haskell | module Data.Graph.Abstract.Accessor.Dsu
( Dsu
, new, find, union
) where
import Control.Monad
import Data.Graph.Abstract.Accessor
data Dsu s = Dsu
{ size :: VArray s Int
, parent :: VArray s (Vertex s)
}
new :: Accessor s e v (Dsu s)
new = do
s <- varray 1
p <- vbuild ... | |
28d0662978c655b8121a351bfe8f2b732f29445278d785c35a7fc4e419fdbc9c | mirage/either | either-as-alias.ml | type ('a, 'b) t = ('a, 'b) Stdlib.Either.t = Left of 'a | Right of 'b
include (Stdlib.Either : Either_intf.S with type ('a, 'b) t := ('a, 'b) t)
| null | https://raw.githubusercontent.com/mirage/either/043eba77c144b26790c2fd478bd9e607293099d6/src/either-as-alias.ml | ocaml | type ('a, 'b) t = ('a, 'b) Stdlib.Either.t = Left of 'a | Right of 'b
include (Stdlib.Either : Either_intf.S with type ('a, 'b) t := ('a, 'b) t)
| |
4fd0304848c720056d5c7ee5ef731e7212ba00bb22895e8761fd690cc2604d9c | Opetushallitus/ataru | application.cljs | (ns ataru.hakija.application
"Pure functions handling application data"
(:require [ataru.util :as util]
[ataru.application-common.application-field-common :refer [required-validators pad sanitize-value]]
[clojure.core.match :refer [match]]))
(defn- initial-valid-status [flattened-form-field... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/3ea053206f9a7cc11b9f2d56b888f18cdc94e686/src/cljs/ataru/hakija/application.cljs | clojure | (ns ataru.hakija.application
"Pure functions handling application data"
(:require [ataru.util :as util]
[ataru.application-common.application-field-common :refer [required-validators pad sanitize-value]]
[clojure.core.match :refer [match]]))
(defn- initial-valid-status [flattened-form-field... | |
24f6547c42491da21a56d83e071ffc7ada45e159ab55745becc78432c8dba18d | Helium4Haskell/helium | Thompson39.hs | main = (1,2,3,4,5,6,7,8,9,10,11)
Helium can show tuples with up to 10 elements
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/thompson/Thompson39.hs | haskell | main = (1,2,3,4,5,6,7,8,9,10,11)
Helium can show tuples with up to 10 elements
| |
ac918b96ee30851d6c20a29548ecb5c99f18281d219c7fdf9a22f33c5ae21d0b | appleby/Lisp-In-Small-Pieces | chap8c.scm | $ I d : chap8c.scm , v 4.3 2006/11/24 18:41:11
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is derived from the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge Unive... | null | https://raw.githubusercontent.com/appleby/Lisp-In-Small-Pieces/af4139232bb7170f32470774a92d647e83254721/src/chap8c.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is derived from the files that accompany the book:
The original sources can be downloaded from the author's website at
-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html
This file may have been altered from the original in order to... | $ I d : chap8c.scm , v 4.3 2006/11/24 18:41:11
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge University Press ) .
By Christian Queinnec < >
(define (meaning e r tail?)
(if (atom? e)
(if (symbol? e) (meaning-reference e r tail?)... |
0173225e6fff885252ae7d98a26d8dcb539fe83a4a2ba31db43130b6f0b1a4b1 | PDP-10/panda | glisp-test.lisp | 2 8677
changes to: (VARS GLTESTCOMS)
1 )
(PRETTYCOMPRINT GLTESTCOMS)
(RPAQQ GLTESTCOMS [(FNS GIVE-RAISE CURRENTDATE VECTORPLUS VECTORDIFF VECTORTIMES VECTORQUOTIENT
VECTORMOVE GRAPHICSOBJECTMOVE MGO-ACCELERATE TESTFN1 TESTFN2 DRAWRECT TP
IMod7Store IMod7Plus SA SB GROWCIRCLE SQU... | null | https://raw.githubusercontent.com/PDP-10/panda/522301975c062914ea3d630a1daefde261ddf590/files/lispusers/glisp-test.lisp | lisp | 2 8677
changes to: (VARS GLTESTCOMS)
1 )
(PRETTYCOMPRINT GLTESTCOMS)
(RPAQQ GLTESTCOMS [(FNS GIVE-RAISE CURRENTDATE VECTORPLUS VECTORDIFF VECTORTIMES VECTORQUOTIENT
VECTORMOVE GRAPHICSOBJECTMOVE MGO-ACCELERATE TESTFN1 TESTFN2 DRAWRECT TP
IMod7Store IMod7Plus SA SB GROWCIRCLE SQU... | |
3abdd8a30e2304ab9fb1d2bbac7afb4af0b7624c4a29e13a5aeb9d5dc20f149a | Zetawar/zetawar | selection_and_target.cljs | (ns zetawar.devcards.selection-and-target
(:require
[datascript.core :as d]
[devcards.core :as dc :include-macros true]
[integrant.core :as ig]
[reagent.core :as r]
[zetawar.app :as app]
[zetawar.data :as data]
[zetawar.db :refer [e]]
[zetawar.game :as game]
[zetawar.subs :as subs]
[zeta... | null | https://raw.githubusercontent.com/Zetawar/zetawar/dc1ee8d27afcac1cd98904859289012c2806e58c/src/cljs/zetawar/devcards/selection_and_target.cljs | clojure | TODO: add targeted-friend | (ns zetawar.devcards.selection-and-target
(:require
[datascript.core :as d]
[devcards.core :as dc :include-macros true]
[integrant.core :as ig]
[reagent.core :as r]
[zetawar.app :as app]
[zetawar.data :as data]
[zetawar.db :refer [e]]
[zetawar.game :as game]
[zetawar.subs :as subs]
[zeta... |
b71aa4128714dffdc3cec39e828408fcdd9131399a6ef765cb18165afb678810 | lingnand/VIMonad | RandomBackground.hs | -----------------------------------------------------------------------------
-- |
Module : XMonad . Actions . RandomBackground
Copyright : ( c ) 2009
translation to by
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : <>
-- Stability : unstable
-- Portability : ... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Actions/RandomBackground.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Maintainer : <>
Stability : unstable
Portability : unportable
An action to start terminals with a random background color
-----------------------------------------------------------------... | Module : XMonad . Actions . RandomBackground
Copyright : ( c ) 2009
translation to by
module XMonad.Actions.RandomBackground (
randomBg',
randomBg,
RandomColor(HSV,RGB)
) where
import XMonad(X, XConf(config), XConfig(terminal), io, spawn,
MonadIO, a... |
58603a2f6ef3057569e335f095db948c8f257a78efa290a12ef7928511246207 | Spivoxity/obc-3 | binary.mli |
* binary.mli
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006 - -2016 J. M. Spivey
* 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... | null | https://raw.githubusercontent.com/Spivoxity/obc-3/9e5094df8382ac5dd25ff08768277be6bd71a4ae/debugger/binary.mli | ocaml | This module keeps tables of information about procedures and line numbers
in the binary program. The tables are filled in from data that
comes from the symbol table in the bytecode file, and is sent over
the pipe by the debugging monitor at the start of the session.
Data types
regs -- machine register st... |
* binary.mli
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006 - -2016 J. M. Spivey
* 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... |
5339846f145b905f9c977f9fa11d708c6bc108a226c94a26825b2b3ca1f0700e | fission-codes/fission | User.hs | module Fission.Web.Server.Fixture.User (user) where
import Network.IPFS.Bytes.Types
import Network.IPFS.CID.Types
import qualified Web.UCAN.Internal.RSA2048.Pair.Types as RSA2048
import Fission.Prelude
import qualified Fission.Internal.Fixture.Key.Ed25519 as Ed25519
import Fi... | null | https://raw.githubusercontent.com/fission-codes/fission/ae177407dccc20be67948a901956b99f40d37ac8/fission-web-server/library/Fission/Web/Server/Fixture/User.hs | haskell | module Fission.Web.Server.Fixture.User (user) where
import Network.IPFS.Bytes.Types
import Network.IPFS.CID.Types
import qualified Web.UCAN.Internal.RSA2048.Pair.Types as RSA2048
import Fission.Prelude
import qualified Fission.Internal.Fixture.Key.Ed25519 as Ed25519
import Fi... | |
5aca1b469ebbb8619ea217d5b6c1a2ce27a7de6b156c9aa808459dead35e69f6 | ygmpkk/house | Parsec.hs | -----------------------------------------------------------------------------
-- |
Module : Text . ParserCombinators . Parsec
Copyright : ( c ) 1999 - 2001
-- License : BSD-style (see the file libraries/parsec/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portability : portab... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/parsec/Text/ParserCombinators/Parsec.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/parsec/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
<>.
Inspired by:
</~gmh/monparsing.ps>
This helper module exports elements from the basic li... | Module : Text . ParserCombinators . Parsec
Copyright : ( c ) 1999 - 2001
Parsec , the Fast combinator library , see
* and :
.
Technical report - TR-96 - 4 .
Department of Computer Science , University of Nottingham , 1996 .
* , :
Predictive parser combinators need ... |
ef6162a86c59cb68b39460cf3b486a4c07e1d9fbb5362c368ef3ed6bb709e71a | janestreet/merlin-jst | mreader_extend.ml | open Std
open Extend_protocol.Reader
let {Logger. log} = Logger.for_section "Mreader_extend"
type t = {
name : string;
args : string list;
config : Mconfig.t;
source : Msource.t;
driver : Extend_driver.t;
mutable stopped : bool;
}
let print () t = t.name
let incorrect_behavior fn t =
log ~title:fn "Ex... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/src/kernel/mreader_extend.ml | ocaml | open Std
open Extend_protocol.Reader
let {Logger. log} = Logger.for_section "Mreader_extend"
type t = {
name : string;
args : string list;
config : Mconfig.t;
source : Msource.t;
driver : Extend_driver.t;
mutable stopped : bool;
}
let print () t = t.name
let incorrect_behavior fn t =
log ~title:fn "Ex... | |
a52d487f0588baae5ecf1a7dfdd7b0cfa677db57ab6dfbe665ed742072b148d1 | Kaleb47/Haskell-Plutus-journal | lesson1.hs | import System.IO
import Data.List
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber x = if x > 100
then x
else x*2
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
rickSanchez = "Wabalaba dub dub!"
morty = "Oh man, oh jeez!"
... | null | https://raw.githubusercontent.com/Kaleb47/Haskell-Plutus-journal/f669992058c2b8e6eba9e288900cdd6365750d39/lesson1.hs | haskell | rather than writng a specific varable, we really should write _ because we are not calling a specific list | import System.IO
import Data.List
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber x = if x > 100
then x
else x*2
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
rickSanchez = "Wabalaba dub dub!"
morty = "Oh man, oh jeez!"
... |
327ef271a4a814a22a15d3868a906cb17807bfb609a2892436849cb39da29b2f | plumatic/grab-bag | mongo.clj | (ns store.mongo
(:refer-clojure :exclude [update ])
(:use [plumbing.core :exclude [update]])
(:require
[monger.collection :as mc]
[monger.core :as monger]
[monger.query :as query]
[store.bucket :as bucket])
(:import
[com.mongodb WriteConcern]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/store/src/store/mongo.clj | clojure |
Implementation
gargle
Monger doesn't take write concern...
TODO: just auto-munging keys for now, do something smarter
gargle
TODO:unique | (ns store.mongo
(:refer-clojure :exclude [update ])
(:use [plumbing.core :exclude [update]])
(:require
[monger.collection :as mc]
[monger.core :as monger]
[monger.query :as query]
[store.bucket :as bucket])
(:import
[com.mongodb WriteConcern]))
Protocols ( meant to decouple from mongo / bucke... |
a08c80e588a9749d59bcdd83742d4d087f4e8387128c8ea25eee11341d2eff41 | input-output-hk/nix-tools | Main.hs | -- I am a sinner!
# language RecordWildCards #
module Main (main) where
import Data.Maybe
import Data.Time.Clock
import Data.Time.Format
import Data.Time.Clock.POSIX
import Codec.Archive.Tar as Tar
import Codec.Archive.Tar.Entry as Tar
import Data.ByteString.Lazy as BS hiding (filter)
import Codec.Compression.GZip as... | null | https://raw.githubusercontent.com/input-output-hk/nix-tools/c9c10ab889a7b7f2f5f4bb71e8786fc01d49e53e/truncate-index/Main.hs | haskell | I am a sinner!
library.
| Filter Haskell Index
gzip headers containt he OS, but we want a stable hash.
| Convert @Entries e@ to a list while throwing an error on failure.
------------------------------------------------------------------------------
CLI Argument | # language RecordWildCards #
module Main (main) where
import Data.Maybe
import Data.Time.Clock
import Data.Time.Format
import Data.Time.Clock.POSIX
import Codec.Archive.Tar as Tar
import Codec.Archive.Tar.Entry as Tar
import Data.ByteString.Lazy as BS hiding (filter)
import Codec.Compression.GZip as GZip
import Opti... |
4c45501c93bd390ea3202ab307351060150793da04065b46245d8fb842414a14 | mkawalec/emailparse | Multipart.hs | module Network.Mail.Parse.Parsers.Multipart (parseMultipart) where
import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString as BS
import Data.Word8
import Data.Attoparsec.ByteString
import Network.Mail.Parse.Utils
isBoundaryMatched :: BSC.ByteString -> Int -> Word8 -> Maybe Int
isBoundaryMatche... | null | https://raw.githubusercontent.com/mkawalec/emailparse/c5533707c7339bcebd616e1f7cdb442ca2d16626/src/Network/Mail/Parse/Parsers/Multipart.hs | haskell | module Network.Mail.Parse.Parsers.Multipart (parseMultipart) where
import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString as BS
import Data.Word8
import Data.Attoparsec.ByteString
import Network.Mail.Parse.Utils
isBoundaryMatched :: BSC.ByteString -> Int -> Word8 -> Maybe Int
isBoundaryMatche... | |
15ee16aabb8e6c52eee1145714cf5f4df8fadebb6813bb7ecce0d9fc3fc2d0ed | ocaml/ocamlbuild | main.ml | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/7986721317f33552711e415972851aa2d8a74ebe/src/main.ml | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Compatibility with both OCaml < 4.08 and > = 5.00
mo... |
e940319654aa966f43f501fb9ccc3aad096fa5f1773b4b909a6459745e63f967 | OCamlPro/drom | main.ml | !{header-ml}
If you delete or rename this file , you should add
' ' to the ' skip ' field in " drom.toml "
'src/!{name}/main.ml' to the 'skip' field in "drom.toml" *)
let () = Printf.printf "Hello world!\n"
| null | https://raw.githubusercontent.com/OCamlPro/drom/7bc86026e0e170f1a468b437d369aefc5dbea5d7/src/drom_lib/share/drom/skeletons/packages/program/main.ml | ocaml | !{header-ml}
If you delete or rename this file , you should add
' ' to the ' skip ' field in " drom.toml "
'src/!{name}/main.ml' to the 'skip' field in "drom.toml" *)
let () = Printf.printf "Hello world!\n"
| |
a283e2387684e6e96028b492d2be928150038b1a67124eb1082d7107e0110b84 | imandra-ai/fix-engine | engine.ml | module SessionManager = struct
let ( let* ) = Lwt.( >>= )
type t = {
dir: string;
seqin: int;
seqout: int;
}
module Seqnum = struct
let fname_of_ty ~dir = function
| `In -> Filename.concat dir "seqin"
| `Out -> Filename.concat dir "seqout"
let read ~dir ty =
let fname = ... | null | https://raw.githubusercontent.com/imandra-ai/fix-engine/4d24f4d89a262ed7f16ff898570dbc9319730374/fix-engine/src-runtime/engine.ml | ocaml | * Calls Fix_engine.one_step and pubs outgoing messages while busy
This assumes that after one_step we can get either ontgoing internal or outgoing FIX message
the toplevel parser is supposed to catch everything | module SessionManager = struct
let ( let* ) = Lwt.( >>= )
type t = {
dir: string;
seqin: int;
seqout: int;
}
module Seqnum = struct
let fname_of_ty ~dir = function
| `In -> Filename.concat dir "seqin"
| `Out -> Filename.concat dir "seqout"
let read ~dir ty =
let fname = ... |
7bf20078aef3a03edb295b04fb3f66fc0708413ca9cd95294c674ff67f5a4186 | lf-/hsfixit | Pointless.hs | module Pointless where
| null | https://raw.githubusercontent.com/lf-/hsfixit/91a09f9153de72217eb418d7e0a11a20d458e769/hsfixit-test/src/Pointless.hs | haskell | module Pointless where
| |
588586ab2705cf21f506d0d7419d8e5ca21da14a27587c4743f43212bde36d56 | helium/blockchain-core | blockchain_snapshot_handler.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Blockchain Sybc Stream Handler ==
%% @end
%%%-------------------------------------------------------------------
-module(blockchain_snapshot_handler).
-behavior(libp2p_framed_stream).
-include_lib("helium_proto/include/blockchain_sn... | null | https://raw.githubusercontent.com/helium/blockchain-core/71cdd123813fa8ccfd4db08cf15f0c642c279464/src/handlers/blockchain_snapshot_handler.erl | erlang | -------------------------------------------------------------------
@doc
== Blockchain Sybc Stream Handler ==
@end
-------------------------------------------------------------------
------------------------------------------------------------------
API Function Exports
-------------------------------------------... | -module(blockchain_snapshot_handler).
-behavior(libp2p_framed_stream).
-include_lib("helium_proto/include/blockchain_snapshot_handler_pb.hrl").
-export([
server/4,
client/2
]).
-export([
init/3,
handle_data/3,
handle_info/3
]).
-record(state,
{
chain :: blockchain:blochain(),... |
db21ebfb80e0f2db37f9b6a162ac26cbda0e01d62a4f2d868e88bf2be393e841 | lancelet/wgpu-hs | Classy.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
-- |
Module :
-- Description : Get parameters from readers.
--
WGPU commands commonly take parameters such as the ' Instance ' , ' Device ' ... | null | https://raw.githubusercontent.com/lancelet/wgpu-hs/8e002bd2d9210688ccf63eef613889f6c62b05aa/wgpu-hs/src/WGPU/Classy.hs | haskell | # LANGUAGE ConstraintKinds #
|
Description : Get parameters from readers.
which are relatively unchanged across multiple commands. This module provides
a way to supply those parameters from a 'MonadReader'. Useful for the truly
lazy among us.
* Constraints
* Classes
* Lifted Functions
** Adapter
** Device
*... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
Module :
WGPU commands commonly take parameters such as the ' Instance ' , ' Device ' , etc ,
module WGPU.Classy
HasInstance,
HasSurface,
HasAdapter,
HasDevi... |
c2ae4161d8752bf4bfec03740130736345cb76006fadf6df2b1b7525e8d88e85 | b3rnie/crontab | crontab_server.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @doc
2012
%%% @end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%_* Module declaration ===============================================
-module(crontab_server).
-behaviour(gen_server).
%%%_* ... | null | https://raw.githubusercontent.com/b3rnie/crontab/d7f8fb707298661cb374670380c98c3600bd16e8/src/crontab_server.erl | erlang |
@doc
@end
_* Module declaration ===============================================
_* Exports ==========================================================
gen_server
_* Includes =========================================================
_* Macros ===========================================================
_* Code ======... | 2012
-module(crontab_server).
-behaviour(gen_server).
-export([ start_link/1
, add/4
, remove/2
]).
-export([ init/1
, terminate/2
, handle_call/3
, handle_cast/2
, handle_info/2
, code_change/3
]).
-include_lib("stdlib2/include/prelude.hrl").
-defin... |
daf73958272796f02c4b41abb4c01a23280fd032e2a1a5465671917a341f4b53 | clj-commons/seesaw | forms.clj | Copyright ( c ) , 2011 . 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 agreeing to b... | null | https://raw.githubusercontent.com/clj-commons/seesaw/4ca89d0dcdf0557d99d5fa84202b7cc6e2e92263/test/seesaw/test/examples/forms.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 rem... | Copyright ( c ) , 2011 . All rights reserved .
(ns seesaw.test.examples.forms
(:use [seesaw [core :exclude (separator)] forms]
seesaw.test.examples.example))
Example similar to
(defn frame-content
[]
(forms-panel
"pref,4dlu,80dlu,8dlu,pref,4dlu,80dlu"
:column-groups [[1 5]]
:item... |
5273810d2378ffcb21baf68fbfdd98dc8f1aa7d6588c4c6b22ad3722ab548687 | mhuebert/chia | patterns.cljs | (ns chia.db.patterns
(:require [chia.reactive :as r]
[clojure.set :as set]
[chia.util.perf :as perf]))
(def ^:private empty-patterns
"Map for building sets of patterns."
{:e__ #{} ;; <entity id>
:_a_ #{} ... | null | https://raw.githubusercontent.com/mhuebert/chia/74ee3ee9f86efbdf81d8829ab4f0a44d619c73d3/db/src/chia/db/patterns.cljs | clojure | <entity id>
<attribute>
[<attribute>, <value>]
[<entity id>, <attribute>] | (ns chia.db.patterns
(:require [chia.reactive :as r]
[clojure.set :as set]
[chia.util.perf :as perf]))
(def ^:private empty-patterns
"Map for building sets of patterns."
(defn added-patterns [prev-p next-p]
(cond->> next-p
(some? prev-p) (reduce-kv (fn [patterns k next-v]
... |
b06cd471e95a36ebe6326af7dfb41002171d7968a889b48087d91d146df48319 | MaxwellBo/scratches | ListFold.hs | {-# LANGUAGE RankNTypes #-}
import Control.Monad (ap)
data List a = List (forall b. (a -> b -> b) -> b -> b)
unList :: List a -> [a]
unList = foldr (:) []
nil :: List a
nil = List $ const id
cons :: a -> List a -> List a
cons x (List xss) = List $
\r b -> xss r (r x b)
instance Functor List whe... | null | https://raw.githubusercontent.com/MaxwellBo/scratches/3ba8f44eaa40b86d4dc1c2514b10b910fbd38f5a/ListFold.hs | haskell | # LANGUAGE RankNTypes # | import Control.Monad (ap)
data List a = List (forall b. (a -> b -> b) -> b -> b)
unList :: List a -> [a]
unList = foldr (:) []
nil :: List a
nil = List $ const id
cons :: a -> List a -> List a
cons x (List xss) = List $
\r b -> xss r (r x b)
instance Functor List where
fmap f = foldr (cons . ... |
fd058fb0859f31d42b0408973147f111b1828900844934de97425b75b7251806 | OCADml/OCADml | triangulate.mli | val triangulate : ?eps:float -> ?idxs:int array -> V.v2 array -> int list list
| null | https://raw.githubusercontent.com/OCADml/OCADml/2f624c6922c3b658aed426b0ff06113a45d91ce3/lib/triangulate.mli | ocaml | val triangulate : ?eps:float -> ?idxs:int array -> V.v2 array -> int list list
| |
be4c4cd323e60818bdfe60d1a312ed9f429d191d94342c09751acaf89bf0d3fb | jbracker/supermonad | MTIR.hs |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/hmtc/monad-param/MTIR.hs | haskell | annotations have been added. In particular, variables are represented
by symbols (with name, type info, and source position) as opposed to just
their names.
Not abstract. Instances: HasSrcPos.
Not abstract. Instances: HasSrcPos.
Not abstract. Instances: HasSrcPos.
Not abstract. Instances: HasSrcPos.
| Internal ... |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... |
eadebc260f8551cbda76b7dfdbadaaf351075d5dfc327309da85090042d753bf | scymtym/sbcl-ir-visualizer | package.lisp | ;;;; package.lisp --- Package definition for the sbcl-ir-visualizer system.
;;;;
Copyright ( C ) 2020 Jan Moringen
;;;;
Author : < >
(cl:defpackage #:sbcl-ir-visualizer
(:use
#:cl)
(:local-nicknames
(#:a #:alexandria))
(:export
#:run))
| null | https://raw.githubusercontent.com/scymtym/sbcl-ir-visualizer/2a944ffd458bd452bf93bc49a0a9685edd868719/code/package.lisp | lisp | package.lisp --- Package definition for the sbcl-ir-visualizer system.
| Copyright ( C ) 2020 Jan Moringen
Author : < >
(cl:defpackage #:sbcl-ir-visualizer
(:use
#:cl)
(:local-nicknames
(#:a #:alexandria))
(:export
#:run))
|
25b1a75b7442616f491238887c22098b37a6aebed5ba71988384f4713e02c0c9 | oakes/Nightmod | entities.clj | (defn touching?
"Returns true if the entities are touching each other."
[e1 e2]
(rectangle! (rectangle (:x e1) (:y e1) (:width e1) (:height e1))
:overlaps
(rectangle (:x e2) (:y e2) (:width e2) (:height e2))))
(defn touching-entities
"Returns the entities that are touching the given... | null | https://raw.githubusercontent.com/oakes/Nightmod/e1145a49d96c5322aaf4bdd5493ae14a7f0c0f8a/resources/arcade/entities.clj | clojure | (defn touching?
"Returns true if the entities are touching each other."
[e1 e2]
(rectangle! (rectangle (:x e1) (:y e1) (:width e1) (:height e1))
:overlaps
(rectangle (:x e2) (:y e2) (:width e2) (:height e2))))
(defn touching-entities
"Returns the entities that are touching the given... | |
8ebd140bbde55afc182b0299e92f9e2bf11a050163ecd75885af574bb88b6b16 | mindreframer/clojure-stuff | util_test.clj | (ns yesql.util-test
(:require [expectations :refer :all]
[clojure.template :refer [do-template]]
[yesql.util :refer :all]))
;;; Test distinct-except
(let [coll '[a b c a b]]
(expect '[a b c a]
(distinct-except coll #{'a}))
(expect '[a b c b]
(distinct-except coll #{'b}... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/krisajenkins/yesql/test/yesql/util_test.clj | clojure | Test distinct-except
Test underscores-to-dashes
Test whitespace?
Test slurp-from-classpath
Test str-non-nil | (ns yesql.util-test
(:require [expectations :refer :all]
[clojure.template :refer [do-template]]
[yesql.util :refer :all]))
(let [coll '[a b c a b]]
(expect '[a b c a]
(distinct-except coll #{'a}))
(expect '[a b c b]
(distinct-except coll #{'b}))
(expect '[a b c]
... |
4a6bc9aec237331b8cfad771210d14166162554e0bb515634ab739cd1cefbe7f | mzp/coq-ide-for-ios | cc_plugin_mod.ml | let _=Mltop.add_known_module"Ccalgo"
let _=Mltop.add_known_module"Ccproof"
let _=Mltop.add_known_module"Cctac"
let _=Mltop.add_known_module"G_congruence"
let _=Mltop.add_known_module"Cc_plugin_mod"
let _=Mltop.add_known_module"cc_plugin"
| null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/coq-8.2pl2/plugins/cc/cc_plugin_mod.ml | ocaml | let _=Mltop.add_known_module"Ccalgo"
let _=Mltop.add_known_module"Ccproof"
let _=Mltop.add_known_module"Cctac"
let _=Mltop.add_known_module"G_congruence"
let _=Mltop.add_known_module"Cc_plugin_mod"
let _=Mltop.add_known_module"cc_plugin"
| |
e9c9701c792e2386b49dc38dd406db8a16d13fb156db5fd0d9a9fda307df558c | joearms/music_experiments | midi_test.erl | -module(midi_test).
-compile(export_all).
test() ->
midi_event_gen:start(),
send_notes(),
midi_event_gen:stop(),
init:stop().
send_notes() ->
L = notes(),
send_notes(L).
send_notes([{sleep,I}|T]) ->
sleep(I),
send_notes(T);
send_notes([B|T]) ->
io:format("sending~p~n",[B]),
... | null | https://raw.githubusercontent.com/joearms/music_experiments/3c0db01d03571599a3506fcb1a001d0b8dd205d9/midi_mac_driver/midi_test.erl | erlang | -module(midi_test).
-compile(export_all).
test() ->
midi_event_gen:start(),
send_notes(),
midi_event_gen:stop(),
init:stop().
send_notes() ->
L = notes(),
send_notes(L).
send_notes([{sleep,I}|T]) ->
sleep(I),
send_notes(T);
send_notes([B|T]) ->
io:format("sending~p~n",[B]),
... | |
9a26f181914caa346aed77a3286dc411fb4d037b1b08c16d63608e8d7d13c8b1 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Numeral.UK.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
imp... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Numeral/UK/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Numeral.UK.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Numeral.UK.Corpus
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "UK Tests"
[ makeCorpusT... |
91955dcf6f19314d3d2e19e3f3c9b1ea9df5de5de1e6709dd4b63db7f0a316e8 | clj-kondo/clj-kondo | warn_on_reflection_test.clj | (ns clj-kondo.warn-on-reflection-test
(:require
[clj-kondo.test-utils :refer [lint! assert-submaps]]
[clojure.test :as t :refer [deftest is testing]]))
(deftest warn-on-reflection-test
(assert-submaps
[]
(lint! "(ns foo) (defn foo [])"
'{:linters {:warn-on-reflection {:level :warning}}}))
(... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/81e09de81df271e423f41a8a2fddc6db30133d95/test/clj_kondo/warn_on_reflection_test.clj | clojure | (ns clj-kondo.warn-on-reflection-test
(:require
[clj-kondo.test-utils :refer [lint! assert-submaps]]
[clojure.test :as t :refer [deftest is testing]]))
(deftest warn-on-reflection-test
(assert-submaps
[]
(lint! "(ns foo) (defn foo [])"
'{:linters {:warn-on-reflection {:level :warning}}}))
(... | |
1ae64bdf0f6b891209ed7cf72550c35d6095a48bc4ed70f15c9bc926b8475034 | cushon/project-euler | 39.rkt | #lang racket
(require "common.rkt")
Find p < = 1000 that number of right triangles with perimiter p is
; maximized.
(define (solve)
(define t (make-hash))
(for-each
(lambda (x)
(match x
[(list a b)
(define c (sqrt (+ (* a a) (* b b))))
(if (and (integer? c) (<= (+ a b c) ... | null | https://raw.githubusercontent.com/cushon/project-euler/d7fcbfff0cd59b2c3691293ff35bb2043b409f68/39.rkt | racket | maximized. | #lang racket
(require "common.rkt")
Find p < = 1000 that number of right triangles with perimiter p is
(define (solve)
(define t (make-hash))
(for-each
(lambda (x)
(match x
[(list a b)
(define c (sqrt (+ (* a a) (* b b))))
(if (and (integer? c) (<= (+ a b c) 1000))
... |
981e364f867400d191a613932bc31989ce4ef34973969633a2d3ee8dd9fa1606 | robert-strandh/Clump | condition-reporters-english.lisp | (cl:in-package #:clump-2-3-tree)
(defmethod acclimation:report-condition
((condition tree-for-insertion-must-be-empty)
stream
(language acclimation:english))
(format stream
"Insertion directly in a 2-3 tree~@
requires an empty tree,~@
but instead the following was found:~@
... | null | https://raw.githubusercontent.com/robert-strandh/Clump/1ea4dbac1cb86713acff9ae58727dd187d21048a/2-3-tree/condition-reporters-english.lisp | lisp | (cl:in-package #:clump-2-3-tree)
(defmethod acclimation:report-condition
((condition tree-for-insertion-must-be-empty)
stream
(language acclimation:english))
(format stream
"Insertion directly in a 2-3 tree~@
requires an empty tree,~@
but instead the following was found:~@
... | |
d8089f5ad68672aa4e6932d2999591c0773ba00e4496a9b84efa936905fdda78 | quephird/fun-with-quil | pinwheel.clj | (ns fun-with-quil.animations.pinwheel
(:require [quil.core :as q :include-macros true]
[quil.middleware :as m]))
(defn make-triangle []
{:r 0
:θ (q/random 360)
:h (q/random 50)})
(defn setup []
(q/smooth)
(q/no-stroke)
(q/color-mode :hsb)
[(make-triangle)])
(defn update [triangles]
(l... | null | https://raw.githubusercontent.com/quephird/fun-with-quil/3b3a6885771f5a1a4cffeb8379f05a28048a1616/src/fun_with_quil/animations/pinwheel.clj | clojure | (ns fun-with-quil.animations.pinwheel
(:require [quil.core :as q :include-macros true]
[quil.middleware :as m]))
(defn make-triangle []
{:r 0
:θ (q/random 360)
:h (q/random 50)})
(defn setup []
(q/smooth)
(q/no-stroke)
(q/color-mode :hsb)
[(make-triangle)])
(defn update [triangles]
(l... | |
ca9624d83f9449315e325dfd8fe02b91daba1fc36f7ea02729e4037bb55e200f | dsheets/ocaml-unix-time | test.ml |
* Copyright ( c ) 2016 < >
*
* 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/dsheets/ocaml-unix-time/b3f1db3185b04dce1f8704ec0d82687f95307802/unix_test/test.ml | ocaml |
* Copyright ( c ) 2016 < >
*
* 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... | |
302652fe3e2a5b0e36ca8487f59ee987114ef609247bf413ac8f01da8c9a5c82 | codedownio/aeson-typescript | ObjectWithSingleFieldTagSingleConstructors.hs |
module ObjectWithSingleFieldTagSingleConstructors (main, tests) where
import Data.Aeson as A
import Test.Hspec
import TestBoilerplate
import Util
$(testDeclarations "ObjectWithSingleField with tagSingleConstructors=True" (setTagSingleConstructors $ A.defaultOptions {sumEncoding=ObjectWithSingleField}))
main :: IO (... | null | https://raw.githubusercontent.com/codedownio/aeson-typescript/d6a3addf220d51dcc1199744869beda2b8bb2aa1/test/ObjectWithSingleFieldTagSingleConstructors.hs | haskell |
module ObjectWithSingleFieldTagSingleConstructors (main, tests) where
import Data.Aeson as A
import Test.Hspec
import TestBoilerplate
import Util
$(testDeclarations "ObjectWithSingleField with tagSingleConstructors=True" (setTagSingleConstructors $ A.defaultOptions {sumEncoding=ObjectWithSingleField}))
main :: IO (... | |
3408c28f88a48889aa1718a6f2c49de2b7942b4aa4485d4741d3dc0b2a944b6a | angavrilov/ecl-compute | time-loop.lisp | ;;; -*- mode:lisp; indent-tabs-mode: nil; -*-
;;
;; A time iteration control engine with check-points.
;;
;; In order to start the process, write an initialization
;; script of the following form:
;;
;; (init-processing
;; ... mandatory initialization ...
;; ... e.g. memory allocation ...)
;;
... first ... | null | https://raw.githubusercontent.com/angavrilov/ecl-compute/466f0d287f8b6ab0e2b5c2ac03693ad4f4df6a3f/time-loop.lisp | lisp | -*- mode:lisp; indent-tabs-mode: nil; -*-
A time iteration control engine with check-points.
In order to start the process, write an initialization
script of the following form:
(init-processing
... mandatory initialization ...
... e.g. memory allocation ...)
(execute-tasks '((iter-cnt name t... | ... first - time initialization ...
... ( setf * time - step * ... ) ...
Interface variables
(fast-compute:deflex *cur-time* 0.0
"Current inner time of the simulation.")
(fast-compute:deflex *time-step* 0.0
"Base time step of the simulation.")
(fast-compute:deflex *cur-time-bias* 0.0
"Bias to accoun... |
53535d3b22dc02e0c23a72435f80dc01d23dcd4a7d8d7e483ab21e6a822d4b0a | lexi-lambda/syntax-classes | info.rkt | #lang info
(define scribblings
'(["syntax-classes.scrbl" () ("Syntax Extensions")]))
| null | https://raw.githubusercontent.com/lexi-lambda/syntax-classes/a8a95ede1c72d7dae0764437126f5ce9bbe7967a/syntax-classes-doc/scribblings/info.rkt | racket | #lang info
(define scribblings
'(["syntax-classes.scrbl" () ("Syntax Extensions")]))
| |
2986ffa0f2871d1d2764d04909bfba26f3347e12d2185380a3a12aa643592c30 | input-output-hk/plutus-apps | Streaming.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE MultiWayIf #-}
module Cardano.Streaming
( withChainSyncEventStream
, CS.ChainSyncEvent (..)
, CS.ChainSyncEventException (..)
--
, CS.mkConnectInfo
, CS.mkLocalNodeConnectInfo
-- * Stream blocks and ledger states
, blocks
, blocksPipelined
, ledgerStates
, le... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/7647d072249f984cbad84435361c0bda8ecf1e9f/cardano-streaming/src/Cardano/Streaming.hs | haskell | # LANGUAGE MultiWayIf #
* Stream blocks and ledger states
| `withChainSyncEventStream` uses the chain-sync mini-protocol to
connect to a locally running node and fetch blocks from the given
starting point.
| Path to the node socket
| The point on the chain to start streaming from
| The stream consumer
The chai... | # LANGUAGE LambdaCase #
module Cardano.Streaming
( withChainSyncEventStream
, CS.ChainSyncEvent (..)
, CS.ChainSyncEventException (..)
, CS.mkConnectInfo
, CS.mkLocalNodeConnectInfo
, blocks
, blocksPipelined
, ledgerStates
, ledgerStatesPipelined
, foldLedgerState
, foldLedgerStateEvents
, ge... |
dbc201b066dd814b3d9a402bd6f31b2146e96dc136a0cbde1daa5781c010a8ff | typeclasses/dsv | FileStrictCsvZipView.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ApplicativeDo #
module DSV.Tests.FileStrictCsvZipView where
import DSV.TestPrelude
group :: Group
group = $$(discover)
| This is an example in the documentation for ' zipViewCsvF... | null | https://raw.githubusercontent.com/typeclasses/dsv/ae4eb823e27e4c569c4f9b097441985cf865fbab/dsv/test/DSV/Tests/FileStrictCsvZipView.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE ApplicativeDo #
module DSV.Tests.FileStrictCsvZipView where
import DSV.TestPrelude
group :: Group
group = $$(discover)
| This is an example in the documentation for ' zipViewCsvFileStrict ' .
prop_zipViewCsvFileSt... |
c573779340b7f750eccb60cf7f43087dff9ae1359895f6f6187fec3c462791fc | AccelerateHS/accelerate-fft | Ix.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
-- |
-- Module : Data.Array.Accelerate.Math.FFT.LLVM.Native.Ix
Copyright : [ 2017 .. 2020 ] The Accelerate Team
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
Portability : n... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-fft/3c195de6a4528071388d817f55b0a7adf0547cc6/src/Data/Array/Accelerate/Math/FFT/LLVM/Native/Ix.hs | haskell | |
Module : Data.Array.Accelerate.Math.FFT.LLVM.Native.Ix
License : BSD3
Stability : experimental
Converting between Accelerate multidimensional shapes/indices and those used
by the CArray package (Data.Ix)
| # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
Copyright : [ 2017 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.Math.FFT.LLVM.Native.Ix
where
import Data.Array.Accelerat... |
d73e66ed9917d14a2d07a73fb2a951ec5cbcbe9378538a114bf82f08ad14b63d | magnusjonsson/tidder-icfpc-2008 | collision-cache.scm | #lang scheme
(provide make insert! set! ref)
(require rnrs/arithmetic/bitwise-6)
; (hash key value)^size
(define (make size)
(make-vector (* 3 size) #f))
; equal-hash-code produces rather bad hash codes for integers... this helps.
;
stolen from
;
uint32_t hash ( uint32_t a )
a = ( a ^ 61 ) ^ ( a > > 16 )... | null | https://raw.githubusercontent.com/magnusjonsson/tidder-icfpc-2008/84d68fd9ac358c38e7eff99117d9cdfa86c1864a/playground/scheme/cache/collision-cache.scm | scheme | (hash key value)^size
equal-hash-code produces rather bad hash codes for integers... this helps.
a = a * 0x27d4eb2d;
return a;
}
| #lang scheme
(provide make insert! set! ref)
(require rnrs/arithmetic/bitwise-6)
(define (make size)
(make-vector (* 3 size) #f))
stolen from
uint32_t hash ( uint32_t a )
(define (scramble a)
(let* ((a (bitwise-xor 61 a (bitwise-arithmetic-shift-right a 16)))
(a (* a 9))
(a (bitwise-xor a (... |
e7dadfe46fb34ce6884cd07be060edab9816e4e53b2e92c531a4816d235d1a9d | programaker-project/Programaker-Core | automate_bot_engine_forking_flows_tests.erl | Automate bot engine getters tests .
%%% @end
-module(automate_bot_engine_forking_flows_tests).
-include_lib("eunit/include/eunit.hrl").
%% Data structures
-include("../../automate_storage/src/records.hrl").
-include("../src/program_records.hrl").
-include("../src/instructions.hrl").
-include("../../automate_channel... | null | https://raw.githubusercontent.com/programaker-project/Programaker-Core/ef10fc6d2a228b2096b121170c421f5c29f9f270/backend/apps/automate_bot_engine/test/automate_bot_engine_forking_flows_tests.erl | erlang | @end
Data structures
Test data
Milliseconds
Note, if waiting per instruction takes too much time consider adding a method
which checks periodically.
====================================================================
Test API
====================================================================
@doc App infrast... | Automate bot engine getters tests .
-module(automate_bot_engine_forking_flows_tests).
-include_lib("eunit/include/eunit.hrl").
-include("../../automate_storage/src/records.hrl").
-include("../src/program_records.hrl").
-include("../src/instructions.hrl").
-include("../../automate_channel_engine/src/records.hrl").
... |
3173fa8326a232e177d748c5a00ca4a71e8f2403cf7335e72dd30eb6951d48a1 | haskell-mafia/mismi | CloudwatchLogs.hs | # LANGUAGE NoImplicitPrelude #
module Mismi.CloudwatchLogs (
) where
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-cloudwatch-logs/src/Mismi/CloudwatchLogs.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Mismi.CloudwatchLogs (
) where
| |
7517c7482e2197c9aa4e979d7ce3ced4b5fe5bb19144aca90586f58cdd30f289 | stofel/erespool | ers_worker_emulator.erl |
-module(ers_worker_emulator).
-behaviour(gen_server).
-export([start/0, stop/1]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-include("erespool.hrl").
-define(TIMEOUT, 40 * 1000).
start() ->
gen_server:start(?MODUL... | null | https://raw.githubusercontent.com/stofel/erespool/f6051e8c1c55dc2a851fe94105b3b7bdf775abb9/src/ers_worker_emulator.erl | erlang |
Gen Server api
casts
calls
|
-module(ers_worker_emulator).
-behaviour(gen_server).
-export([start/0, stop/1]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-include("erespool.hrl").
-define(TIMEOUT, 40 * 1000).
start() ->
gen_server:start(?MODUL... |
5a7347f24f687730071d29221ef7586d68d3a5c491231b357a3ede7b1d540e49 | hakaru-dev/hakaru | Natural.hs | TODO : merge with the Posta version . And release them as a standalone package
# LANGUAGE CPP #
{-# OPTIONS_GHC -Wall -fwarn-tabs #-}
----------------------------------------------------------------
-- 2015.12.17
-- |
-- Module : Data.Number.Natural
Copyright... | null | https://raw.githubusercontent.com/hakaru-dev/hakaru/94157c89ea136c3b654a85cce51f19351245a490/haskell/Data/Number/Natural.hs | haskell | # OPTIONS_GHC -Wall -fwarn-tabs #
--------------------------------------------------------------
2015.12.17
|
Module : Data.Number.Natural
License : BSD3
Maintainer :
Stability : experimental
Portability : Haskell98 + CPP
A data type for natu... | TODO : merge with the Posta version . And release them as a standalone package
# LANGUAGE CPP #
Copyright : Copyright ( c ) 2016 the Hakaru team
module Data.Number.Natural
( Natural()
, fromNatural
, toNatural
, unsafeNatural
, MaxNatural(..)
, NonNegativeRational
, fromNonNegativeR... |
a1d5b0fde29cff68251b9795db40e13e2534e0f5d5d43df9e95d316ed2c5eb8c | facebookarchive/lex-pass | Id.hs | module Transf.Id where
import Lang.Php
import TransfUtil
import qualified Data.Intercal as IC
transfs :: [Transf]
transfs = [
"id" -:- ftype -?-
"For testing lex-pass. Rewrite all files as is."
-=- argless (lexPass $ changeNothing False True),
"no-op" -:- ftype -?-
"For testing lex-pass. Scan all files bu... | null | https://raw.githubusercontent.com/facebookarchive/lex-pass/dcfa9560a95f2c1344e15493dabcc1645b1ca5e8/src/Transf/Id.hs | haskell | optionally pretend we changed something to make this file count and force
rewrite. | module Transf.Id where
import Lang.Php
import TransfUtil
import qualified Data.Intercal as IC
transfs :: [Transf]
transfs = [
"id" -:- ftype -?-
"For testing lex-pass. Rewrite all files as is."
-=- argless (lexPass $ changeNothing False True),
"no-op" -:- ftype -?-
"For testing lex-pass. Scan all files bu... |
97ae61bca89fb50ce5ee752282272944a42281d3396a639ac42c6d19506bad0e | cxphoe/SICP-solutions | 1.28.rkt | (define (square x) (* x x))
(define (expmod base exp m)
(cond ((= exp 0) 1)
((even? exp)
(remainder (square (expmod base (/ exp 2) m))
m))
(else (remainder (* base (expmod base (- exp 1) m))
m))))
(define (miller-rabin-test n)
(define (try-it a... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%201-Building%20Abstractions%20with%20Procedures/1.28.rkt | racket | (prime? 1729) | (define (square x) (* x x))
(define (expmod base exp m)
(cond ((= exp 0) 1)
((even? exp)
(remainder (square (expmod base (/ exp 2) m))
m))
(else (remainder (* base (expmod base (- exp 1) m))
m))))
(define (miller-rabin-test n)
(define (try-it a... |
b3e94b1e2fc1a944ca726477a7d0691696e425a4d9b2b384338fa5e684cbd888 | backtracking/mlpost | color.ml | open Mlpost
module P = Path
module C = Color
parse < < > >
parse < <
let square c =
Box.pic (Path.fill ~color:c (Path.scale (Num.cm 0.4) Path.unitsquare))
let foi max i = float_of_int i /. max
let hsv_grid nbh nbv s =
let fnbh = float_of_int nbh in
let fnbv = float_of_int nbv in
Box.draw
(Box.tabular... | null | https://raw.githubusercontent.com/backtracking/mlpost/bd4305289fd64d531b9f42d64dd641d72ab82fd5/examples/color.ml | ocaml | parse >> <<color2
parse >> <<color4
parse >> | open Mlpost
module P = Path
module C = Color
parse < < > >
parse < <
let square c =
Box.pic (Path.fill ~color:c (Path.scale (Num.cm 0.4) Path.unitsquare))
let foi max i = float_of_int i /. max
let hsv_grid nbh nbv s =
let fnbh = float_of_int nbh in
let fnbv = float_of_int nbv in
Box.draw
(Box.tabular... |
8fffd6acd6d0e6db326af32f1609c39b1228b3acf95127e1e368c2ce95b88add | nchataing/caml-migrate-floatarray | annotate.ml | (******************************************************************)
Copyright ( C ) 2020 - 2021 . All rights reserved .
(* *)
(* This software may be modified and distributed under the terms *)
of the BSD license . See the LICENSE file for details... | null | https://raw.githubusercontent.com/nchataing/caml-migrate-floatarray/9e7bb55ba7a801f20cdd9ce7701f0bb0200c1459/src/annotate.ml | ocaml | ****************************************************************
This software may be modified and distributed under the terms
****************************************************************
We keep information about the functions that contain type v... | Copyright ( C ) 2020 - 2021 . All rights reserved .
of the BSD license . See the LICENSE file for details .
open Typedtree
open Types
open Asttypes
open Tast_iterator
open Location
open Patch
open Typ_utils
Checks if t_out contains
let rec type_contains env t_out t_in =
moregeneral env t_in t_ou... |
2e3233a422a934b5dcedd1257f351e22b0f974549ef1d8fc775fd9a3253eb4a5 | Plutonomicon/plutarch-plutus | ApiSpec.hs | # LANGUAGE AllowAmbiguousTypes #
NOTE : This module also contains ScriptContext mocks , which should ideally
-- moved to a module of its own after cleaning up to expose a easy to reason
-- about API.
module Plutarch.ApiSpec (
spec,
ctx,
validContext0,
validOutputs0,
invalidContext1,
d0Dat,
d0DatValue,
... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/plutarch-test/tests/Plutarch/ApiSpec.hs | haskell | moved to a module of its own after cleaning up to expose a easy to reason
about API.
The checkSignatory family of functions implicitly use tracing due to
------------------------------------------------------------------------------
| Simple script context, with minting and a single input
| A script input
| Minti... | # LANGUAGE AllowAmbiguousTypes #
NOTE : This module also contains ScriptContext mocks , which should ideally
module Plutarch.ApiSpec (
spec,
ctx,
validContext0,
validOutputs0,
invalidContext1,
d0Dat,
d0DatValue,
inp,
) where
import Test.Tasty.HUnit
import Control.Monad (forM_)
import Control.Monad.... |
8fadcb6eb6f735b11d9ebfc7d16996a754a92725abd16b57c5e9acd404545ee1 | slagyr/gaeshi | server.clj | (ns gaeshi.kuzushi.commands.server
(:require [clojure.string]
[leiningen.core.classpath :refer [get-classpath]]
[joodo.cmd :refer [java]]
[joodo.kuzushi.common :refer [symbolize with-lein-project *project*]])
(:import [mmargs Arguments]))
(def arg-spec (Arguments.))
(doto arg-sp... | null | https://raw.githubusercontent.com/slagyr/gaeshi/a5677ed1c8d9269d412f07a7ab33bbc40aa7011a/lein-gaeshi/src/gaeshi/kuzushi/commands/server.clj | clojure | (ns gaeshi.kuzushi.commands.server
(:require [clojure.string]
[leiningen.core.classpath :refer [get-classpath]]
[joodo.cmd :refer [java]]
[joodo.kuzushi.common :refer [symbolize with-lein-project *project*]])
(:import [mmargs Arguments]))
(def arg-spec (Arguments.))
(doto arg-sp... | |
85943236bef77a7de39207f19995e66ad6b98fa5de7d09e7a1b8d4249c16f8fb | conjure-cp/conjure | Apart.hs | # LANGUAGE DeriveGeneric , DeriveDataTypeable , DeriveFunctor , , DeriveFoldable #
module Conjure.Language.Expression.Op.Apart where
import Conjure.Prelude
import Conjure.Language.Expression.Op.Internal.Common
import qualified Data.Aeson as JSON -- aeson
import qualified Data.HashMap.Strict as M -... | null | https://raw.githubusercontent.com/conjure-cp/conjure/dd5a27df138af2ccbbb970274c2b8f22ac6b26a0/src/Conjure/Language/Expression/Op/Apart.hs | haskell | aeson
unordered-containers
vector | # LANGUAGE DeriveGeneric , DeriveDataTypeable , DeriveFunctor , , DeriveFoldable #
module Conjure.Language.Expression.Op.Apart where
import Conjure.Prelude
import Conjure.Language.Expression.Op.Internal.Common
data OpApart x = OpApart x x
deriving (Eq, Ord, Show, Data, Functor, Traversable, Foldable, Typeable... |
7a8fadcca1fd2763d577e35f2e33e580ebe71ded73ad8758cfd1891f67cc17c5 | japan-clojurians/curriculum | terminal.clj | Copyright ( c ) 2015 .
;;; Distributed under the BSD 3-Clause License.
;;; You must not remove this notice, or any other, from this software.
(ns animation-toh-clj.terminal
(:require [animation-toh-clj.core :refer [disk-states]]))
(defn- represent-fn [n]
(let [w (+ (* 6 (inc n)) 2)
h (+ n 3)
w-... | null | https://raw.githubusercontent.com/japan-clojurians/curriculum/b4646925df3a5c6a504f129382dfbe9cccd75791/tower-of-hanoi/src/animation_toh_clj/terminal.clj | clojure | Distributed under the BSD 3-Clause License.
You must not remove this notice, or any other, from this software. | Copyright ( c ) 2015 .
(ns animation-toh-clj.terminal
(:require [animation-toh-clj.core :refer [disk-states]]))
(defn- represent-fn [n]
(let [w (+ (* 6 (inc n)) 2)
h (+ n 3)
w-1 (dec w)
h-1 (dec h)
base-and-pegs (persistent!
(reduce
... |
22c13dd9641b425faf2357e83637e256af558a902b938dd18b86e6fadfcdb4a1 | returntocorp/ocaml-tree-sitter-core | Inline.ml | (*
Transform the grammar's original type definitions so as to inline
some of them. This is meant to make the OCaml types more readable.
*)
open Printf
open CST_grammar
(*
Iterate over rule names occurring in a rule body.
*)
let rec iter_ident f body =
match body with
| Symbol ident -> f ident
| Token _... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/ae47b86e4e9d8b85e97affa7904ce43b96439b3d/src/gen/lib/Inline.ml | ocaml |
Transform the grammar's original type definitions so as to inline
some of them. This is meant to make the OCaml types more readable.
Iterate over rule names occurring in a rule body.
Look up a rule definition.
Resolve a rule name into something that's not a rule name.
This is used to determine if a... |
open Printf
open CST_grammar
let rec iter_ident f body =
match body with
| Symbol ident -> f ident
| Token _ -> ()
| Blank -> ()
| Repeat body -> iter_ident f body
| Repeat1 body -> iter_ident f body
| Choice cases -> List.iter (fun (_name, body) -> iter_ident f body) cases
| Optional body -> iter_ide... |
4dc6a83609bb486ef98bc63e4fc6bc96b70a4057a45f67bdaea7a7a67c71a35b | rems-project/lem | tester.ml | open Str
open Unix
exception Missed_type_error
let rec read_in i =
try
let s = input_line i in
s ^ "\n" ^ read_in i
with
| End_of_file ->
""
let get_tests () =
split (regexp "^[ \t]*===========*[ \t]*\n") (read_in Pervasives.stdin)
let do_test o test =
let o' = open_out "test.lem" in
... | null | https://raw.githubusercontent.com/rems-project/lem/a839114e468119d9ac0868d7dc53eae7f3cc3a6c/tests/type_errors/tester.ml | ocaml | open Str
open Unix
exception Missed_type_error
let rec read_in i =
try
let s = input_line i in
s ^ "\n" ^ read_in i
with
| End_of_file ->
""
let get_tests () =
split (regexp "^[ \t]*===========*[ \t]*\n") (read_in Pervasives.stdin)
let do_test o test =
let o' = open_out "test.lem" in
... | |
f6516a9f31296d0e46bb6b6fbfb0cca5e665a7027feb3979a0107008368b8100 | dhess/sicp-solutions | ex1.39.scm | (define (cont-frac n d k)
(define (cont-frac-iter k result)
(if (= k 0)
result
(cont-frac-iter (- k 1) (/ (n k) (+ (d k) result)))))
(cont-frac-iter k 0))
(define (square x) (* x x))
(define (tan-cf x k)
(define (n k)
(if (= k 1)
x
(- (square x))))
(define (d k)
(- ... | null | https://raw.githubusercontent.com/dhess/sicp-solutions/2cf78db98917e9cb1252efda76fddc8e45fe4140/chap1/ex1.39.scm | scheme | (define (cont-frac n d k)
(define (cont-frac-iter k result)
(if (= k 0)
result
(cont-frac-iter (- k 1) (/ (n k) (+ (d k) result)))))
(cont-frac-iter k 0))
(define (square x) (* x x))
(define (tan-cf x k)
(define (n k)
(if (= k 1)
x
(- (square x))))
(define (d k)
(- ... | |
fb8635834a81403a8652e9a81929cb3929dd8a40b2c0f5a302b1efd86fb436bb | cl-axon/cl-paip | prolog.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prolog.lisp : prolog from ( 11.3 ) , with interactive backtracking .
(requires "unify") ; does not require "prolog1"
does not include destructive unification ( 11.6 ) ; see prologc.lisp
;; clauses ... | null | https://raw.githubusercontent.com/cl-axon/cl-paip/5922be8e3aae00197779bad4a05afa8ea1f6b8c9/prolog.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
does not require "prolog1"
see prologc.lisp
clauses are represented as (head . body) cons cells
clauses are stored on the predicate's plist
the predicate must be a non-variable symbol.
The predicate's "clauses" can be an atom:
a primitive function to call
t) | Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prolog.lisp : prolog from ( 11.3 ) , with interactive backtracking .
(defun clause-head (clause) (first clause))
(defun clause-body (clause) (rest clause))
(defun get-clauses (pred) (get pred 'clauses))
(defun predicate (relation) (first relat... |
900f55381721f91a2afb88e134d86e8b041055d492634f9e783fbcada1adb7d1 | may-liu/qtalk | http_client.erl | -module(http_client).
-include("logger.hrl").
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2,code_change/3]).
-export([http_post/6,
http_get/4,
get/1,
post/2]).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
-record(st... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/scripts/ejb_http_server/src/http_client.erl | erlang | -module(http_client).
-include("logger.hrl").
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2,code_change/3]).
-export([http_post/6,
http_get/4,
get/1,
post/2]).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
-record(st... | |
60dc6689367c1102957667af45a41d04519c0611a74799d3aad6edf65dc0072c | greglook/clj-cbor | text.clj | (ns clj-cbor.tags.text
"Built-in tag support for the text extensions in RFC 7049. See section
2.4.4."
(:refer-clojure :exclude [parse-uuid])
(:require
[clj-cbor.data.core :as data])
(:import
java.net.URI
java.nio.ByteBuffer
java.util.UUID
java.util.regex.Pattern))
# # URIs
(def ^:cons... | null | https://raw.githubusercontent.com/greglook/clj-cbor/bbb16a520b6293e94c46d0852f00ecacee1f034a/src/clj_cbor/tags/text.clj | clojure | ## Patterns | (ns clj-cbor.tags.text
"Built-in tag support for the text extensions in RFC 7049. See section
2.4.4."
(:refer-clojure :exclude [parse-uuid])
(:require
[clj-cbor.data.core :as data])
(:import
java.net.URI
java.nio.ByteBuffer
java.util.UUID
java.util.regex.Pattern))
# # URIs
(def ^:cons... |
3f73b738535edd8c935f9177f8185b491fb22f42227186e883966f59f6ab896d | ThoughtWorksInc/stonecutter | index.clj | (ns stonecutter.view.index
(:require [traduki.core :as t]
[net.cgrand.enlive-html :as html]
[stonecutter.routes :as r]
[stonecutter.view.view-helpers :as vh]))
(def unknown-error-translation-key "content:index/register-unknown-error")
(def error-translations
{:sign-in-email ... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/src/stonecutter/view/index.clj | clojure | (ns stonecutter.view.index
(:require [traduki.core :as t]
[net.cgrand.enlive-html :as html]
[stonecutter.routes :as r]
[stonecutter.view.view-helpers :as vh]))
(def unknown-error-translation-key "content:index/register-unknown-error")
(def error-translations
{:sign-in-email ... | |
932a5a7f71ccb208df27a4de8cfd59e6871c030ce493b7471e9d3ea55d09dc27 | byorgey/diagrams-play | IterLineFractal2.hs | # LANGUAGE NoMonomorphismRestriction #
import Data.List.Split
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Diagrams.TwoD.Path.IteratedSubset
main = defaultMain $
showGenerator terDragonGen
-- main = defaultMain $
-- iterGenerator invTerDragonGen
# take 8
# map ( bevelLine # > str... | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/IterLineFractal2.hs | haskell | main = defaultMain $
iterGenerator invTerDragonGen
# chunksOf 4 | # LANGUAGE NoMonomorphismRestriction #
import Data.List.Split
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Diagrams.TwoD.Path.IteratedSubset
main = defaultMain $
showGenerator terDragonGen
# take 8
# map ( bevelLine # > strokeLine # > lw veryThin # > sized ( dims ( 1 ^ & 1 ) ) )
... |
5b368e11edd1b26c72a079778cfe47333543857d5225463a6017ff943e124c62 | caiorss/Functional-Programming | Algebra.hs |
addMaybe1 :: Maybe Int
addMaybe1 =
Just 4 >>= \x ->
Just 5 >>= \y ->
return (x+y)
addMaybe2 :: Maybe Int
addMaybe2 = do
x <- Just 4
y <- Just 5
return (x+y)
profileSetup :: IO String
profileSetup = do
putStrLn "What is your name?"
name <- getLine
putStrLn ... | null | https://raw.githubusercontent.com/caiorss/Functional-Programming/ef3526898e3014e9c99bf495033ff36a4530503d/codes/Algebra.hs | haskell |
addMaybe1 :: Maybe Int
addMaybe1 =
Just 4 >>= \x ->
Just 5 >>= \y ->
return (x+y)
addMaybe2 :: Maybe Int
addMaybe2 = do
x <- Just 4
y <- Just 5
return (x+y)
profileSetup :: IO String
profileSetup = do
putStrLn "What is your name?"
name <- getLine
putStrLn ... | |
497af697d3fc5e97349c243fff221f7f814ed6ade9ca29d8e35bbe5f55d5a4dd | mirage/ocaml-git | git.mli | module type HASH = S.HASH
module type BASE = S.BASE
module type DIGEST = S.DIGEST
module Blob = Blob
module Commit = Commit
module Tree = Tree
module Tag = Tag
module User = User
module Reference = Reference
module Value = Value
module Traverse_bfs = Traverse_bfs
module Object_graph = Object_graph
module Search = Sear... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/src/git/git.mli | ocaml | module type HASH = S.HASH
module type BASE = S.BASE
module type DIGEST = S.DIGEST
module Blob = Blob
module Commit = Commit
module Tree = Tree
module Tag = Tag
module User = User
module Reference = Reference
module Value = Value
module Traverse_bfs = Traverse_bfs
module Object_graph = Object_graph
module Search = Sear... | |
7547c30c6655aeb383741bbfdbe537d8d070afab20dd3d9e371309a2b507e49a | bef/erlswf | swfabcformat.erl | %%
@doc format abc dumps in a logically structured and human readable manner
%%
-module(swfabcformat).
-export([abc/1, abc/3, dtfmt/1]).
-include("swfabc.hrl").
%% @doc same as abc(standard_io, Abc, all)
( ) ) - > ok
abc(Abc) ->
abc(standard_io, Abc, all).
@doc stream fancy abc to given io device
@spec a... | null | https://raw.githubusercontent.com/bef/erlswf/1397591d012aaa020f9ffc0ecd5436e65814e668/src/swfabcformat.erl | erlang |
@doc same as abc(standard_io, Abc, all)
constant pool multiname
metadata
incomplete/todo
try begin
end catch error:X -> throw({traitexc, MethodI, X}) end,
unknown/unimplemented trait type | @doc format abc dumps in a logically structured and human readable manner
-module(swfabcformat).
-export([abc/1, abc/3, dtfmt/1]).
-include("swfabc.hrl").
( ) ) - > ok
abc(Abc) ->
abc(standard_io, Abc, all).
@doc stream fancy abc to given io device
@spec abc(io_device ( ) , abc ( ) , [ identifier ( ) ] )... |
4ca00cc4f257126edd6502dd61a1dd5d9a7bb04521203f01442d52a2b5850479 | Leberwurscht/Diaspora-User-Directory | linearAlg.ml | (************************************************************************)
This file is part of SKS . SKS 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 (... | null | https://raw.githubusercontent.com/Leberwurscht/Diaspora-User-Directory/1ca4a06a67d591760516edffddb0308b86b6314c/trie_manager/linearAlg.ml | ocaml | **********************************************************************
*********************************************************************
*******************************************************************
*******************************************************************
*******************************************... | This file is part of SKS . SKS 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 version .
This program is distributed in ... |
a86da14c91e591a66a87898b672e0ccc84a5329d8f369a9e5756a368aa4f917d | mark-watson/loving-common-lisp | solr-client.lisp | Copyright 2001 - 2013 . All Rights Reserved .
License : AGPL version 3 ( -3.0.txt )
Alternative license : you may also use this software under the Apache 2 License .
;; This copyright notice should not be removed from this file and in files derived from this file.
(ql:quickload :drakma)
(ql:quickload :cl-js... | null | https://raw.githubusercontent.com/mark-watson/loving-common-lisp/32f6abf3d2e500baeffd15c085a502b03399a074/src/solr_examples/solr-client.lisp | lisp | This copyright notice should not be removed from this file and in files derived from this file.
Note: wrapping calls like:
retunrs result documents a a simple list of documents without
test:
add a new document to index.
if document with "id" already in index then
this overwrites key-values if they were defined a... | Copyright 2001 - 2013 . All Rights Reserved .
License : AGPL version 3 ( -3.0.txt )
Alternative license : you may also use this software under the Apache 2 License .
(ql:quickload :drakma)
(ql:quickload :cl-json)
(defun do-search (&rest terms)
(let ((query-string (format nil "~{~A~^+AND+~}" terms)))
(... |
c52a9bec3c3cfc2f78b33aa088d5b3c6ead65df3e7bdb1e37751eca535dd9423 | valderman/haste-compiler | Args.hs | module Haste.Args (parseArgs, printHelp) where
import System.Console.GetOpt
import Data.List
-- | Parse a list of command line arguments into a config, a list of args
for GHC , and a list of error messages .
Non - options are passed directly to GHC .
parseArgs :: [OptDescr (a -> a)]
-> String
... | null | https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/src/Haste/Args.hs | haskell | | Parse a list of command line arguments into a config, a list of args
TODO: this is a horrible hack to generally mangle arguments until
stuff works - replace ASAP with less hacky solution! | module Haste.Args (parseArgs, printHelp) where
import System.Console.GetOpt
import Data.List
for GHC , and a list of error messages .
Non - options are passed directly to GHC .
parseArgs :: [OptDescr (a -> a)]
-> String
-> [String]
-> Either String (a -> a, [String], [String])
par... |
fa716d773865cd3be61da4d4d83c1beb0e01107c2ce8be11e83fac9f51c95c26 | janestreet/textutils | ascii_table.ml | open Core
include Ascii_table_kernel
let output_screen ~oc ~screen ~bars =
Ascii_table_kernel.Screen.render screen ~bars ~close:ignore ~output:(fun attr buf ->
Console.Ansi.output_string attr oc (Buffer.contents buf);
Buffer.clear buf)
;;
type ('row, 'rest) renderer =
?display:Display.t (* Default: short_... | null | https://raw.githubusercontent.com/janestreet/textutils/a29ad92c0dca602e5793ed38cd3b67b70be0130b/ascii_table/src/ascii_table.ml | ocaml | Default: short_box
Default: false | open Core
include Ascii_table_kernel
let output_screen ~oc ~screen ~bars =
Ascii_table_kernel.Screen.render screen ~bars ~close:ignore ~output:(fun attr buf ->
Console.Ansi.output_string attr oc (Buffer.contents buf);
Buffer.clear buf)
;;
type ('row, 'rest) renderer =
Default : 1
defaults to 90 characte... |
389a1b4b9aaca46ab2c58b1e091e93f71780fa63d3687d0b18e3226ccf75a06b | penpot/penpot | options.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.ui.settings.options
(:require
[app.common.spec :as us]
[app.main.data.messages :as dm]
... | null | https://raw.githubusercontent.com/penpot/penpot/7303d311d5f23d515fa3fcdc6cd13cf7f429d1fe/frontend/src/app/main/ui/settings/options.cljs | clojure |
Copyright (c) KALEIDOS INC
--- Password Page | 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 app.main.ui.settings.options
(:require
[app.common.spec :as us]
[app.main.data.messages :as dm]
[app.main.data.users :as du]
... |
53b659d467ffb622393b2126515c44ea512872307044816dd8ae20006ae3a9bf | Shirakumo/kandria | storyline.lisp | (in-package #:org.shirakumo.fraf.kandria.quest)
(defvar *storylines* ())
(defclass storyline (describable scope)
((name :initform NIL)
(title :initform "storyline")
(quests :initform (make-hash-table :test 'eql) :reader quests)
(known-quests :initform () :accessor known-quests)
(on-activate :initarg :on... | null | https://raw.githubusercontent.com/Shirakumo/kandria/98f142c65372c331a29575aa950466465ee30709/quest/storyline.lisp | lisp | (in-package #:org.shirakumo.fraf.kandria.quest)
(defvar *storylines* ())
(defclass storyline (describable scope)
((name :initform NIL)
(title :initform "storyline")
(quests :initform (make-hash-table :test 'eql) :reader quests)
(known-quests :initform () :accessor known-quests)
(on-activate :initarg :on... | |
a33d403d8bd0a2aa4be4de9c1ba227b6f186758bfba671bcbe9b41ad74f7d31e | fluentpython/lispy | variante5.scm | $ I d : variante5.scm , v 1.3 1996/01/28 17:29:37
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is part of the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
;;; Newest version may... | null | https://raw.githubusercontent.com/fluentpython/lispy/6b995c398e2d100fc3fc292e34ba1a00c0ae9b5a/references/LiSP-2ndEdition-2006Dec11/meroonet/variante5.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is part of the files that accompany the book:
Newest version may be retrieved from:
Check the README file before using this file.
(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
VARIANT 5: next-... | $ I d : variante5.scm , v 1.3 1996/01/28 17:29:37
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz
This file is part of the Meroonet package .
(define-meroonet-macro (... |
7bacc5c9b1b0e15fc9794454ac119bc836d1c1bdc4eb16415fd5949e4c7b76dd | KaroshiBee/weevil | dap_request_message.ml | open Dap_base
type ('cmd, 'args, 'presence) t = {
seq : int;
type_ : ProtocolMessage_type.t;
command : 'cmd Dap_commands.t;
arguments : 'args;
}
let equal ~equal_arguments t1 t2 =
Int.equal t1.seq t2.seq &&
Dap_base.ProtocolMessage_type.equal t1.type_ t2.type_ &&
Dap_commands.equal t1.command t2.command... | null | https://raw.githubusercontent.com/KaroshiBee/weevil/1b166ba053062498c1ec05c885e04fba4ae7d831/lib/dapper/dap_request_message.ml | ocaml | open Dap_base
type ('cmd, 'args, 'presence) t = {
seq : int;
type_ : ProtocolMessage_type.t;
command : 'cmd Dap_commands.t;
arguments : 'args;
}
let equal ~equal_arguments t1 t2 =
Int.equal t1.seq t2.seq &&
Dap_base.ProtocolMessage_type.equal t1.type_ t2.type_ &&
Dap_commands.equal t1.command t2.command... | |
beda5211b18a655e980976a27c588d2e20c81280f899e2396eb6a3833edef94e | bcc32/advent-of-code | main.ml | open! Core
open! Async
open! Import
module State = struct
type t =
| Empty
| Occupied
| Floor
[@@deriving equal, sexp_of]
let of_char = function
| 'L' -> Empty
| '#' -> Occupied
| '.' -> Floor
| ch -> failwithf "invalid char %c" ch ()
;;
let is_occupied = function
| Empty | ... | null | https://raw.githubusercontent.com/bcc32/advent-of-code/86a9387c3d6be2afe07d2657a0607749217b1b77/2020/day_11/main.ml | ocaml | Pick an arbitrary major axis, since it doesn't matter.
Rows
Columns
NW-SE diagonals | open! Core
open! Async
open! Import
module State = struct
type t =
| Empty
| Occupied
| Floor
[@@deriving equal, sexp_of]
let of_char = function
| 'L' -> Empty
| '#' -> Occupied
| '.' -> Floor
| ch -> failwithf "invalid char %c" ch ()
;;
let is_occupied = function
| Empty | ... |
a71e05ea7f21ad484f1aac1ccd76fc7f11f561cccee7f098ed1e9abdd0c51cb8 | semerdzhiev/fp-2020-21 | 06-flatten.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
Искаме да от .
влагане да изчезнат .
(define (flatten xs)
(void)
)
(define tests
(test-suite "flatten tests"
(test-case "" (flatten '(1 2 (3 (4 5) 6) 7 8)) '(1 2 3 4 5 6 7 8))
)
)
(run-tests tests 'verbose) | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-b/exercises/08.generic-exercises/06-flatten.rkt | racket | #lang racket
(require rackunit)
(require rackunit/text-ui)
Искаме да от .
влагане да изчезнат .
(define (flatten xs)
(void)
)
(define tests
(test-suite "flatten tests"
(test-case "" (flatten '(1 2 (3 (4 5) 6) 7 8)) '(1 2 3 4 5 6 7 8))
)
)
(run-tests tests 'verbose) | |
a1d1b915cc4e46a069270f7e622d2550684ce30c8d9abd34f6e455d8193bf63c | appleshan/cl-http | inspect-ip.lisp | -*- Syntax : Ansi - Common - Lisp ; Package : inspector ; Base : 10 ; Mode : lisp -*-
( C ) Copyright 1997 , Digitool .
;;; All Rights Reserved.
;;;
You may want to make this available to MCL CL - HTTP users ; it adds an " IP Number "
;; line to integer value inspector windows.
(in-package "INSPECTOR")
; B... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/mcl/contrib/shain/inspect-ip.lisp | lisp | Package : inspector ; Base : 10 ; Mode : lisp -*-
All Rights Reserved.
it adds an " IP Number "
line to integer value inspector windows.
Bump count for IP address line
not a roman number
not a character
not a point
Add IP address line
maybe skip character.
maybe skip point | ( C ) Copyright 1997 , Digitool .
(in-package "INSPECTOR")
(defmethod compute-line-count ((num integer))
(let ((res 14))
(unless (<= #x-1000 (ash num -16) #xfff)
res))
(defmethod line-n ((num integer) n)
maybe skip .
(if (and (>= n 9) (not (<= #x-1000 (ash num -16) #xfff)))
(let* ((type :static... |
3b5054b23352fc39b9cff2aa4dd9e7cb0bc8c20b6a83dcc961725cae05fab395 | haskell/haskell-ide-engine | CodeActionImport.hs | main :: IO ()
main = when True $ putStrLn "hello" | null | https://raw.githubusercontent.com/haskell/haskell-ide-engine/d84b84322ccac81bf4963983d55cc4e6e98ad418/test/testdata/CodeActionImport.hs | haskell | main :: IO ()
main = when True $ putStrLn "hello" | |
5b4fda1c4882f1258360d8bab74913ecfb72d7abdef441a5611b0ab722d43a24 | MariaGrozdeva/Functional_programming | sum.rkt | #lang racket/base
(define (sum tree)
(if (null? tree)
0
(+ (car tree) (sum (cadr tree)) (sum (caddr tree))) )
) | null | https://raw.githubusercontent.com/MariaGrozdeva/Functional_programming/002e3dbbbc64558094eecd147cb1fd064ee84a03/Tasks%20on%20binary%20trees/sum.rkt | racket | #lang racket/base
(define (sum tree)
(if (null? tree)
0
(+ (car tree) (sum (cadr tree)) (sum (caddr tree))) )
) | |
02e54b225590315a3f9955ad523ec40ce6fdd566efe128360a557153807ba617 | imdea-software/leap | LeapSCC.ml |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/misc/LeapSCC.ml | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
279303440cd9e5b41dbd1aec610380c5955f2d8f9857a539939100d25505d460 | malcolmreynolds/GSLL | vector-add.lisp | Regression test VECTOR - ADD for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST VECTOR-ADD
(LISP-UNIT:ASSERT-NUMERICAL-EQUAL
(LIST
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-43.43 42.36 -2.8600001)))
(MULTIPLE-VALUE-LIST
(LET ((V1
(MAKE-MARRAY 'SINGLE-FLOAT :INIT... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/vector-add.lisp | lisp | Regression test VECTOR - ADD for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST VECTOR-ADD
(LISP-UNIT:ASSERT-NUMERICAL-EQUAL
(LIST
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-43.43 42.36 -2.8600001)))
(MULTIPLE-VALUE-LIST
(LET ((V1
(MAKE-MARRAY 'SINGLE-FLOAT :INIT... | |
217d56417038f66f38e91d140fcdb57c4b039645730e4efbcb99a0ecf4613f73 | balint99/sfpl | Unification.hs | # LANGUAGE LambdaCase , RankNTypes #
-- | Pattern unification algorithm.
module SFPL.Elab.Unification
( unify )
where
import Control.Monad.Except
import Data.HashMap.Lazy (HashMap)
import qualified Data.HashMap.Lazy as M
import SFPL.Base
import SFPL.Elab.Error (UnificationErrorReason (..))
import SFPL.Elab.Metaco... | null | https://raw.githubusercontent.com/balint99/sfpl/7cf8924e6f436704f578927ce2904e45caa76725/app/SFPL/Elab/Unification.hs | haskell | | Pattern unification algorithm.
--------------------------------------
Operator precedence
| A partial variable renaming.
| The size of the domain context, where the renaming maps to.
| The size of the codomain context, where the renaming maps from.
^ @since 1.0.0
| Lift a partial renaming to include an additio... | # LANGUAGE LambdaCase , RankNTypes #
module SFPL.Elab.Unification
( unify )
where
import Control.Monad.Except
import Data.HashMap.Lazy (HashMap)
import qualified Data.HashMap.Lazy as M
import SFPL.Base
import SFPL.Elab.Error (UnificationErrorReason (..))
import SFPL.Elab.Metacontext
import qualified SFPL.Eval as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.