_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 |
|---|---|---|---|---|---|---|---|---|
fa73fac27a3fed0e1cfc9e91d4d785caa48d5f2e062b5927c19f62783c3b7dcd | corasaurus-hex/fs | fs_test.clj | (ns corasaurus-hex.fs-test
{:clj-kondo/config '{:linters {:unresolved-symbol {:exclude []}}
:lint-as {corasaurus-hex.fs/with-temp-directory clojure.core/fn
corasaurus-hex.fs/with-temp-file clojure.core/fn}}}
(:require [clojure.test :as test :refer [deftest is ... | null | https://raw.githubusercontent.com/corasaurus-hex/fs/1f45ebc152e1174072a54f6bf3a259fcbe00f28e/test/corasaurus_hex/fs_test.clj | clojure | (ns corasaurus-hex.fs-test
{:clj-kondo/config '{:linters {:unresolved-symbol {:exclude []}}
:lint-as {corasaurus-hex.fs/with-temp-directory clojure.core/fn
corasaurus-hex.fs/with-temp-file clojure.core/fn}}}
(:require [clojure.test :as test :refer [deftest is ... | |
cbcce8bd0b896615a0aba2fe102a2155415c6cc796223972a8f838f3fafa6c16 | jwiegley/notes | speed.hs | module Speed where
import Data.List
import qualified Data.ByteString as BS
foo f z = foldl' f z . BS.unpack
bar f z = BS.foldl' f z
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/misc/speed.hs | haskell | module Speed where
import Data.List
import qualified Data.ByteString as BS
foo f z = foldl' f z . BS.unpack
bar f z = BS.foldl' f z
| |
0eb9649b18724a402d422cc70383e020e122b229b9734dec1ca0811ebf5ba3e2 | unison-code/unison | ARMItineraryDecl.hs | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.ARM.SpecsGen.ARMItineraryDecl
(ARMItinerary(..)) where
data ARMItinerary = NoItinerary
| IIC_iALUi
| IIC_iALUr
| IIC_iALUsr
| IIC_iBITi
... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Target/ARM/SpecsGen/ARMItineraryDecl.hs | haskell | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.ARM.SpecsGen.ARMItineraryDecl
(ARMItinerary(..)) where
data ARMItinerary = NoItinerary
| IIC_iALUi
| IIC_iALUr
| IIC_iALUsr
| IIC_iBITi
... | |
fcc7be72fc3899c060947db346f51501557122aab4c2835d7d74872b5995656c | Lelio-Brun/Obelisk | normalize.ml | (** This module provides a way to "flatten" the groups of productions. *)
open Ast
open List
(** Normalize an actual.
Note that the anonymous rules are normalized in the same ways as
the groups, see {!normalize_group}. *)
let rec normalize_actual = function
| Symbol (s, xs) ->
Symbol (s, map normalize_a... | null | https://raw.githubusercontent.com/Lelio-Brun/Obelisk/ab8ab94f1974caca8a164768634fa171cfe47503/src/normalize.ml | ocaml | * This module provides a way to "flatten" the groups of productions.
* Normalize an actual.
Note that the anonymous rules are normalized in the same ways as
the groups, see {!normalize_group}.
* Normalize a production by normalizing its actuals.
* Normalize a rule by normalizing its groups.
In general, t... |
open Ast
open List
let rec normalize_actual = function
| Symbol (s, xs) ->
Symbol (s, map normalize_actual xs)
| Modifier (x, m) ->
Modifier (normalize_actual x, m)
| Anonymous gs ->
let gs = fold_right normalize_group gs [] in
Anonymous gs
and normalize_production p =
map normalize_actual p
... |
59f7d4843d2fdfdbbfd41508aa5cbd5bf4564dd59086ee0db0fd09eb508c3853 | fgalassi/cs61a-sp11 | 4.25.scm | (define (unless condition usual-value exceptional-value)
(if condition exceptional-value usual-value))
(define (factorial n)
(unless (= n 1)
(* n (factorial (- n 1)))
1))
( factorial 5 ) in applicative order ?
;
; it grows the stack indefinitely because it calculates (factorial (- n 1)) before checking ... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/homework/4.25.scm | scheme |
it grows the stack indefinitely because it calculates (factorial (- n 1)) before checking the
until it crashes | (define (unless condition usual-value exceptional-value)
(if condition exceptional-value usual-value))
(define (factorial n)
(unless (= n 1)
(* n (factorial (- n 1)))
1))
( factorial 5 ) in applicative order ?
condition so it goes ( fac 5 ) ( fac 4 ) ( fac 3 ) ( fac 2 ) ( fac 1 ) ( fac 0 ) ( fac -1 ) ... |
2b883ba3082e637305c65c0eae5a5285f9327ccd4a9e30995469a06ffd9d6fcc | awakesecurity/hocker | ErrorHandling.hs | # LANGUAGE CPP #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
-------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/awakesecurity/hocker/4610befce9881e85925e96ebf464e925fae67164/src/Network/Wreq/ErrorHandling.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
---------------------------------------------------------------------------
|
License : Apache-2.0
Stability : stable
-------------------------------------------------------------------------- | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
Module : Network . . ErrorHandling
Copyright : ( C ) 2016 Awake Networks
Maintainer : Awake Networks < >
module Network.Wreq.ErrorHandling where
import ... |
b824574e927ca1208037ffc457aa968e839f566855ff4578cdf137680c373cd0 | opencog/agi-bio | load-reduced-biospace.scm | (use-modules (opencog))
(define REDUCED_BIOSPACE_FILE "reduced-biospace-LY96-TBK1.scm")
( define " )
;(define knowledge-dir "/home/eddie/opencog/bio-data/scheme-representations/")
;(define subgraph-dir (string-append knowledge-dir "subgraphs/"))
( define ( f )
; (load (string-append knowledge-dir f)))
;(defin... | null | https://raw.githubusercontent.com/opencog/agi-bio/9c03d9b0e81cb8a8b3a58179f3134f336e5dbdb6/reasoning/simple-by-hand/load-reduced-biospace.scm | scheme | (define knowledge-dir "/home/eddie/opencog/bio-data/scheme-representations/")
(define subgraph-dir (string-append knowledge-dir "subgraphs/"))
(load (string-append knowledge-dir f)))
(define (loadsub f) (load (string-append subgraph-dir f)))
compute gene tvs
(define num-genes (length (cog-get-atoms 'GeneNode)))
(de... | (use-modules (opencog))
(define REDUCED_BIOSPACE_FILE "reduced-biospace-LY96-TBK1.scm")
( define " )
( define ( f )
(define (set-tvs-for-type strength confidence type)
(let ([atoms (cog-get-atoms type)])
(for-each (lambda (atom)
(cog-set-tv! atom (cog-new-stv strength confidence)))
... |
0b4e63d988a011afb21533034e8a5dd3b29c07d00b2bacc3b602864a97186252 | ddmcdonald/sparser | fsa-words.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1993 - 1999,2012 - 2021 -- all rights reserved
Copyright ( c ) 2007 BBNT Solutions LLC . All Rights Reserved
;;;
File : " fsa words "
Module : " : numbers : "
Version : December 2021
initiated ( redesigned fro... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/507389af41c018a74603e08cc36401d481273be1/Sparser/code/s/grammar/model/core/numbers/fsa-words.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
version with stubs for the multi-word case 12/6. Fixed a bug 1/14/94.
position after a number-word wouldn't have been scanned yet.
the workbench by changing the edge-making call in Number-word-fsa.
There didn't seem to be a problem with the o... | copyright ( c ) 1993 - 1999,2012 - 2021 -- all rights reserved
Copyright ( c ) 2007 BBNT Solutions LLC . All Rights Reserved
File : " fsa words "
Module : " : numbers : "
Version : December 2021
initiated ( redesigned from scratch ) 11/30/93 v2.3 , finished the first
0.1 ( 3/30 ) Flu... |
235c5aa5940adf810f1ed7be0cfa2d2c220324354fd06d8dbe05bf6e87d53651 | phantomics/seed | extension.lisp | ;;;; extension.lisp
(in-package #:seed.ui-model.react)
(export 'dygraph-chart-view-mode)
| null | https://raw.githubusercontent.com/phantomics/seed/f128969c671c078543574395d6b23a1a5f2723f8/seed.ui-spec.form.mode-chart-dygraph/extension.lisp | lisp | extension.lisp |
(in-package #:seed.ui-model.react)
(export 'dygraph-chart-view-mode)
|
860bd37965ac6ba69d1a39ecc8bfc3968aa1dd69116f5f6e216869ef5ad3ca99 | iu-parfunc/lvars | Logical.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE ConstraintKinds , TypeFamilies #
| Not exported directly . Reexported by " Control . " .
module Control.LVish.Internal.Logical (asyncAnd, asyncOr, andMap, orMap) where
import Control.Par.EffectSigs
import Control.LVish.Internal.Basics
import Control.LVish.Internal (Par(Wr... | null | https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/lvish/Control/LVish/Internal/Logical.hs | haskell | # LANGUAGE BangPatterns #
------------------------------------------------------------------------------
- whenever a False appears on either branch .
We COULD assume idempotency and execute kont False twice,
but since we have the counter anyway let us dedup:
OR this could expose:
asyncAnd :: Maybe HandlerPool -> (... | # LANGUAGE ConstraintKinds , TypeFamilies #
| Not exported directly . Reexported by " Control . " .
module Control.LVish.Internal.Logical (asyncAnd, asyncOr, andMap, orMap) where
import Control.Par.EffectSigs
import Control.LVish.Internal.Basics
import Control.LVish.Internal (Par(WrapPar))
import Control.LVish.I... |
4005059f2cb17cd128de44472f0720eb1b10b2f394feb78bc014432196b1605d | fyquah/hardcaml_zprize | reg_with_enable.ml | open Base
open Hardcaml
open Signal
let reg spec ~enable x = reg spec ~enable x
let pipeline spec ~enable ~n x =
if n < 0
then raise_s [%message "pipeline cannot take a negative integer as argument!" (n : int)];
pipeline spec ~enable ~n x
;;
| null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/553b1be10ae9b977decbca850df6ee2d0595e7ff/libs/field_ops/src/reg_with_enable.ml | ocaml | open Base
open Hardcaml
open Signal
let reg spec ~enable x = reg spec ~enable x
let pipeline spec ~enable ~n x =
if n < 0
then raise_s [%message "pipeline cannot take a negative integer as argument!" (n : int)];
pipeline spec ~enable ~n x
;;
| |
7249dc5f60d2bde0b5eedd8348c93bed2ae7bb170231c3361b999f098a1931a3 | mransan/ocaml-protoc | test07_ml.ml | module T = Test07_types
module Pb = Test07_pb
module Pp = Test07_pp
let decode_ref_data () =
{
T.value = 1l;
T.left = T.Node { T.value = 2l; T.left = T.Empty 0l; T.right = T.Empty 0l };
T.right = T.Node { T.value = 3l; T.left = T.Empty 0l; T.right = T.Empty 0l };
}
let () =
let mode = Test_util.pars... | null | https://raw.githubusercontent.com/mransan/ocaml-protoc/e43b509b9c4a06e419edba92a0d3f8e26b0a89ba/src/tests/integration-tests/test07_ml.ml | ocaml | module T = Test07_types
module Pb = Test07_pb
module Pp = Test07_pp
let decode_ref_data () =
{
T.value = 1l;
T.left = T.Node { T.value = 2l; T.left = T.Empty 0l; T.right = T.Empty 0l };
T.right = T.Node { T.value = 3l; T.left = T.Empty 0l; T.right = T.Empty 0l };
}
let () =
let mode = Test_util.pars... | |
443159c4d74f1d0c04837e9511bacab88acf35b09d2b97154fd34ba5131f9360 | mu-chaco/ReWire | RW_REPL_OD19Filter.hs | import ReWire
import ReWire.Bits
import OD19Filter.ProgramCounter
-------
-- Tests 1-4.
-------
Each of the following is implemented in in vhdl / filterprims.vhd .
test1 :: W32 -> W32 -> Bit
test1 = nativeVhdl "test1" test1
test2 :: W32 -> W32 -> Bit
test2 = nativeVhdl "test2" test2
test3 :: W32 -> W32 -> Bit
t... | null | https://raw.githubusercontent.com/mu-chaco/ReWire/b04686a4cd6cb36ca9976a4b6c42bc195ce69462/tests/integration/RW_REPL_OD19Filter.hs | haskell | -----
Tests 1-4.
-----
-----
end of tests
-----
# INLINE check # | import ReWire
import ReWire.Bits
import OD19Filter.ProgramCounter
Each of the following is implemented in in vhdl / filterprims.vhd .
test1 :: W32 -> W32 -> Bit
test1 = nativeVhdl "test1" test1
test2 :: W32 -> W32 -> Bit
test2 = nativeVhdl "test2" test2
test3 :: W32 -> W32 -> Bit
test3 = nativeVhdl "test3" test... |
c4dbbeb2a712033dd7b090c42e66ad5fe7d5ccead22b3e9ebbf38d294e41f0a4 | input-output-hk/plutus-apps | Extra.hs | # LANGUAGE TypeOperators #
module Servant.Extra
( capture
, left
, right
) where
import Data.Bifunctor (bimap)
import Servant ((:<|>) ((:<|>)))
capture ::
((a -> b)
:<|> (a -> c))
-> a
-> (b
:<|> c)
capture handlers arg = bimap ($ arg) ($ arg) handlers
left ::
(... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/d637b1916522e4ec20b719487a8a2e066937aceb/plutus-pab/src/Servant/Extra.hs | haskell | # LANGUAGE TypeOperators #
module Servant.Extra
( capture
, left
, right
) where
import Data.Bifunctor (bimap)
import Servant ((:<|>) ((:<|>)))
capture ::
((a -> b)
:<|> (a -> c))
-> a
-> (b
:<|> c)
capture handlers arg = bimap ($ arg) ($ arg) handlers
left ::
(... | |
1c1b8147d51efe00006930e68c768f40f6b0c1afe9c3dd1de0660fb24d1d67a5 | ndmitchell/shake | Server.hs |
-- | The endpoints on the cloud server
module Development.Shake.Internal.History.Server(
Server, BuildTree(..),
newServer,
serverAllKeys, serverOneKey, serverDownloadFiles,
serverUpload
) where
import Development.Shake.Internal.History.Bloom
import Development.Shake.Internal.History.Serialise
impo... | null | https://raw.githubusercontent.com/ndmitchell/shake/99c5a7a4dc1d5a069b13ed5c1bc8e4bc7f13f4a6/src/Development/Shake/Internal/History/Server.hs | haskell | | The endpoints on the cloud server |
module Development.Shake.Internal.History.Server(
Server, BuildTree(..),
newServer,
serverAllKeys, serverOneKey, serverDownloadFiles,
serverUpload
) where
import Development.Shake.Internal.History.Bloom
import Development.Shake.Internal.History.Serialise
import Development.Shake.Internal.Value
imp... |
fad5f70c803512e78b65613b0ad7e14af3cf5640dcf8c975f2c4c19b05b31916 | FlowerWrong/mblog | darray_test.erl | %% ---
Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/nifs/darray_test.erl | erlang | ---
Copyrights apply to this code. It may not be used to create training material,
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
-module(darray_test).
-export([load_lib/0, test/0, make_array/1, set_element/3, get_element/2]).
-on_load(load_lib/0).
load_lib() ->
erlang:load_nif("./darray", 0).
test() ->
spawn(fun() -> test1() end).
te... |
e562388156cc91656a5a597900ca8bae8bc1dde779d11c0268250e99c2210121 | may-liu/qtalk | http_setrbtinfo.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(http_setrbtinfo).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("ejabberd.hrl").
-include("logger.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
%%{Url,_} = cowboy_req:url(Req),
{Met... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/http_setrbtinfo.erl | erlang | Feel free to use, reuse and abuse the code in this file.
{Url,_} = cowboy_req:url(Req),
{Host,Req3} = cowboy_req:host(Req),
{Host,_} = cowboy_req:host(Req), |
-module(http_setrbtinfo).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("ejabberd.hrl").
-include("logger.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
{Method, _} = cowboy_req:method(Req),
case Method of
<<"GET">> ->
{ok, Req4} = echo(<<"No Get Me... |
971976af59cd188b5364eec3013a15daa8b271136d2a2d64a2f660c94f7fa5ab | auser/hermes | test_suite.erl | -module (test_suite).
-include_lib("eunit/include/eunit.hrl").
all_test_() ->
[
% {module, hermes_logger_test},
{module, config_test},
{module, rest_server_test},
{module, utils_test},
{module, athens_test},
{module, mon_server_test},
{module, mapreduce_test}
]. | null | https://raw.githubusercontent.com/auser/hermes/32741eb75398ebbcbf640e2c73dfd2a54f0d1241/test/src/test_suite.erl | erlang | {module, hermes_logger_test}, | -module (test_suite).
-include_lib("eunit/include/eunit.hrl").
all_test_() ->
[
{module, config_test},
{module, rest_server_test},
{module, utils_test},
{module, athens_test},
{module, mon_server_test},
{module, mapreduce_test}
]. |
0b2a0813409e47514c0633553c3f3d93cbe42436b3f7923c7da4ace68abb6158 | reborg/clojure-essential-reference | 9.clj | < 1 >
(and
measure
(re-matches #"[0-9\.]*" measure)))
< 2 >
(and
name
(re-matches #"Class\D" name)
(every? measure? measures)))
(defn header? [[kind & [code]]] ; <3>
(and
(#{"Wireless" "Wired"} kind)
(#{"MXD" "QXD" "CXP"} code)))
< 4 >
(and
(header? header)
(every? m... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Sequences/SequentialCollections/seqandsequence/9.clj | clojure | <3>
true | < 1 >
(and
measure
(re-matches #"[0-9\.]*" measure)))
< 2 >
(and
name
(re-matches #"Class\D" name)
(every? measure? measures)))
(and
(#{"Wireless" "Wired"} kind)
(#{"MXD" "QXD" "CXP"} code)))
< 4 >
(and
(header? header)
(every? metric? metrics)))
< 5 >
... |
6e4aa36e493b56dd2c9b92861bbf7d2a0000ef655c63a884acfdcfce4bee6083 | vlstill/hsExprTest | no-expr.q.hs | -- @ compiled: True
import qualified Student
import System.Exit ( exitSuccess, exitFailure )
evaluator :: () -> IO ()
evaluator _ = if Student.b then exitSuccess else exitFailure
| null | https://raw.githubusercontent.com/vlstill/hsExprTest/391fc823c1684ec248ac8f76412fefeffb791865/test/no-expr.q.hs | haskell | @ compiled: True |
import qualified Student
import System.Exit ( exitSuccess, exitFailure )
evaluator :: () -> IO ()
evaluator _ = if Student.b then exitSuccess else exitFailure
|
845b3c037c3cea3f3041935239e225542b90ad2f4a03148d6d544355c206873c | haskell-tools/haskell-tools | Simple_res.hs | module Refactor.ExtractBinding.Simple where
stms = map (\s -> exaggerate s) ["a", "b"]
where exaggerate s = s ++ "!" | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/ExtractBinding/Simple_res.hs | haskell | module Refactor.ExtractBinding.Simple where
stms = map (\s -> exaggerate s) ["a", "b"]
where exaggerate s = s ++ "!" | |
a739b51500b8423db628eab6c8cbb507356a73da2cdc5191a6fe9607d47b5dea | racket/rhombus-prototype | armor.rkt | #lang at-exp racket/base
(require racket/class
racket/pretty
"../lex.rkt"
"../parse.rkt"
"../armor.rkt"
"like-text.rkt"
"input.rkt")
(define (out name parsed write)
(define path (build-path (find-system-path 'temp-dir) name))
(printf "~a\n" path)
(call-with-o... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/f21679842c56b0841b156dde6b389e0366f15532/shrubbery/tests/armor.rkt | racket | helps with source locations on error
unarmor not right yet for continuing | #lang at-exp racket/base
(require racket/class
racket/pretty
"../lex.rkt"
"../parse.rkt"
"../armor.rkt"
"like-text.rkt"
"input.rkt")
(define (out name parsed write)
(define path (build-path (find-system-path 'temp-dir) name))
(printf "~a\n" path)
(call-with-o... |
f1365256e8c5a0be3efa62ed2c61fe53b9072fd279cf8e03f7ee0eac4fb003b9 | acowley/GLUtil | Textures.hs | # LANGUAGE MultiParamTypeClasses , FlexibleInstances ,
ScopedTypeVariables , TypeFamilies , FlexibleContexts #
ScopedTypeVariables, TypeFamilies, FlexibleContexts #-}
-- |Utilities for loading texture data.
module Graphics.GLUtil.Textures where
import Control.Monad (forM_)
import Graphics.Re... | null | https://raw.githubusercontent.com/acowley/GLUtil/09faac00072b08c72ab12bcc57d4ab2a02ff1c88/src/Graphics/GLUtil/Textures.hs | haskell | |Utilities for loading texture data.
|A basic texture information record.
dimensions.
|Class for containers of texture data.
|Wrapper whose 'IsPixelData' instance treats the pointer underlying
|Replace a 2D texture's pixel data with data from a 'TexInfo'.
| Set texture coordinate wrapping options for both the 'S... | # LANGUAGE MultiParamTypeClasses , FlexibleInstances ,
ScopedTypeVariables , TypeFamilies , FlexibleContexts #
ScopedTypeVariables, TypeFamilies, FlexibleContexts #-}
module Graphics.GLUtil.Textures where
import Control.Monad (forM_)
import Graphics.Rendering.OpenGL
import qualified Graphics... |
9fa4d74400497240af1965b7ea86fd0f9f54747b950b01f6ed8593bf0ca66e17 | binsec/binsec | dwarf_lines.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/binsec/8ed9991d36451a3ae7487b966c4b38acca21a5b3/src/dwarf/dwarf_lines.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
9616959200adfc325d64d0ad8cfb8a0ddd72e5de067637028e42b2f914e3e2f9 | AndrasKovacs/ELTE-func-lang | Notes07.hs |
State , Reader
--------------------------------------------------------------------------------
import Control.Monad.State
import Control.Monad.Reader
Ismétlés : ( lásd Notes03.hs )
------------------------------------------------------------
data Expr = Literal Int | Add Expr Expr | Mul Expr Expr | Var Stri... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-1/lectures/Notes07.hs | haskell | ------------------------------------------------------------------------------
----------------------------------------------------------
runProgram [] == []
Kiértékelés Maybe-vel
------------------------------------------------------------------------------
Kiértékelés Reader-el
------------------------------------... |
State , Reader
import Control.Monad.State
import Control.Monad.Reader
Ismétlés : ( lásd Notes03.hs )
data Expr = Literal Int | Add Expr Expr | Mul Expr Expr | Var String
deriving Show
" 10 + ( 20 + x ) "
e1 = Add (Literal 10) (Add (Literal 20) (Var "x"))
" y * x + 100 "
e2 = Add (Mul (Var "y") (Var "... |
68991250e414f69e810bd67b28b77f24cd73ecb434328ad1ec4e4ab2b85c400a | skypher/blackthorn | main.lisp | Blackthorn -- Lisp Game Engine
;;;;
Copyright ( c ) 2007 - 2011 , < >
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limita... | null | https://raw.githubusercontent.com/skypher/blackthorn/914b38a95f1d192219f197e4b4a77b1632daa94b/src/blackthorn/main.lisp | lisp |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do so, subject to the following conditions:... | Blackthorn -- Lisp Game Engine
Copyright ( c ) 2007 - 2011 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRA... |
26d2dae270f2e22e93f7c06df64f1579348553358c3cd49a8ef8b4949502d73a | RyanGlScott/text-show-instances | Trans.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -Wno - orphans #
|
Module : TextShow . Control . Monad . Trans
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
' TextShow ' instances for monad trans... | null | https://raw.githubusercontent.com/RyanGlScott/text-show-instances/b08f4b46466cdc3c3f3c979b7a0abf5590fa2916/src/TextShow/Control/Monad/Trans.hs | haskell | # LANGUAGE OverloadedStrings #
# INLINE liftMShowbUnaryWith #
# INLINE liftShowbPrec #
# INLINE liftShowbPrec #
# INLINE liftShowbPrec #
# INLINE liftShowbPrec #
# INLINE liftShowbPrec # | # OPTIONS_GHC -Wno - orphans #
|
Module : TextShow . Control . Monad . Trans
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
' TextShow ' instances for monad transformers .
/Since : 2/
Module: ... |
76a8804cbf735db1c74a49e27e560078bbf1869939701282f255e5cde3ac7018 | YoshikuniJujo/test_haskell | Patterns.hs | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Patterns where
newtype Foo = Foo Int deriving Show
pattern FooOne :: Foo
pattern FooOne <- Foo 1 where
FooOne = Foo 1
| null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/0e37b8fb4acbc508c73fd471581b24461cb4757a/tribial/try-tribials/src/Patterns.hs | haskell | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Patterns where
newtype Foo = Foo Int deriving Show
pattern FooOne :: Foo
pattern FooOne <- Foo 1 where
FooOne = Foo 1
| |
c1d5c60723350bebba54862b6484bd758191555fc30cada6ca062e76bd93ab70 | votinginfoproject/data-processor | election.clj | (ns vip.data-processor.validation.v5.election
(:require [korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.validation.v5.util :as util]
[vip.data-processor.errors :as errors]
[clojure.tools.logging :as log]))
(defn validate-one-ele... | null | https://raw.githubusercontent.com/votinginfoproject/data-processor/b4baf334b3a6219d12125af8e8c1e3de93ba1dc9/src/vip/data_processor/validation/v5/election.clj | clojure | (ns vip.data-processor.validation.v5.election
(:require [korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.validation.v5.util :as util]
[vip.data-processor.errors :as errors]
[clojure.tools.logging :as log]))
(defn validate-one-ele... | |
479ba171022c0013b540144fbc5c5b30854905f7c3a86aac7d59103f9239d33f | pikatchu/LinearML | global.ml |
Copyright ( c ) 2011 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are
met :
1 . Redistributions of source code must retain the above copyright
notice , this list of conditions and the foll... | null | https://raw.githubusercontent.com/pikatchu/LinearML/76da04134b9eb3a9ca4252e9cb41d412b50a072a/compiler/global.ml | ocaml |
Copyright ( c ) 2011 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are
met :
1 . Redistributions of source code must retain the above copyright
notice , this list of conditions and the foll... | |
a78532581594463a0300c101d177202865b63fcb089ac0f081ff4e52d6f16da6 | kennyjwilli/malli-eql | malli_eql_test.clj | (ns kwill.malli-eql-test
(:require
[clojure.test :refer :all]
[kwill.malli-eql :as malli-eql]
[malli.core :as m]
[malli.util :as mu]))
(def registry (merge (m/default-schemas) (mu/schemas)))
(deftest ->eql-test
(is (= [] (malli-eql/->eql [:map]))
"empty map is empty eql")
(is (= [:a] (malli-... | null | https://raw.githubusercontent.com/kennyjwilli/malli-eql/d9f1dc9752e4330d6f913bc7b62bd341014dfa28/test/kwill/malli_eql_test.clj | clojure | (ns kwill.malli-eql-test
(:require
[clojure.test :refer :all]
[kwill.malli-eql :as malli-eql]
[malli.core :as m]
[malli.util :as mu]))
(def registry (merge (m/default-schemas) (mu/schemas)))
(deftest ->eql-test
(is (= [] (malli-eql/->eql [:map]))
"empty map is empty eql")
(is (= [:a] (malli-... | |
0a344c8e97e290acb31321f54b1f1cf2d23e064b608f557912a49ccf4acdc0a0 | appleby/99-lisp-problems | p91.lisp | ( * * ) 's tour
;;;
;;; Another famous problem is this one: How can a knight jump on an
NxN chessboard in such a way that it visits every square exactly
;;; once?
;;;
;;; Hints: Represent the squares by pairs of their coordinates of the
;;; form (X Y), where both X and Y are integers between 1 and
;;; N. Define a ... | null | https://raw.githubusercontent.com/appleby/99-lisp-problems/a12b2a585ac5af06f456f844d308bbada78e647c/p91.lisp | lisp |
Another famous problem is this one: How can a knight jump on an
once?
Hints: Represent the squares by pairs of their coordinates of the
form (X Y), where both X and Y are integers between 1 and
N. Define a function (jump N (X Y)) that returns a list of the
positions (U V) such that a knight can jump from (X Y) ... | ( * * ) 's tour
NxN chessboard in such a way that it visits every square exactly
a NxN chessboard . And finally , represent the solution of our
(in-package :99-problems)
(defvar *possible-knight-moves* nil
"Initialized to an NxN array of possible knight moves to/from each
square on a NxN board.")
(defun knig... |
b15d536b881bc3f97b604cf42e09fd4f862833eca476b1ea4f32ec506a799e40 | janestreet/bonsai | size_tracker.ml | open! Core
open! Import
open! Bonsai_web
open! Js_of_ocaml
module Dimensions = struct
type t =
{ width : float
; height : float
}
end
module T = struct
module State = struct
type t =
{ mutable callback : width:float -> height:float -> unit
; mutable observer : ResizeObserver.resizeObse... | null | https://raw.githubusercontent.com/janestreet/bonsai/4baeedc75bf73a0915e04dc02d8a49b78779e9b0/web_ui/element_size_hooks/src/size_tracker.ml | ocaml | We take the whole state here so that we can mutate the callback in it and
witness the change in the observer
This assumes writing-mode:horizontal.
-US/docs/Web/API/ResizeObserverEntry/borderBoxSize | open! Core
open! Import
open! Bonsai_web
open! Js_of_ocaml
module Dimensions = struct
type t =
{ width : float
; height : float
}
end
module T = struct
module State = struct
type t =
{ mutable callback : width:float -> height:float -> unit
; mutable observer : ResizeObserver.resizeObse... |
760d9e7aa1eece385f54f380677fd46a520171c4061e4546d5ce678a7017f342 | mirage/ocaml-git | capability.mli | * Capabilities module .
When the client talks with the server , it needs to inform capabilities ( what
it can handle ) . This is the exhaustive list of capabilities on the current
Smart protocol . Then , the server responds too with capabilities .
The common part between the client and the ser... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/src/not-so-smart/capability.mli | ocaml | * This is an extension of [`Multi_ack] that permits client to better
understand ther server's in-memory state.
* See [`Side_band_64k].
* This capability adds ["deepen"], ["shallow"] and ["unshallow"] commands
to the fetch-pack/upload-pack protocol so clients can request shallow
clones.
* This... | * Capabilities module .
When the client talks with the server , it needs to inform capabilities ( what
it can handle ) . This is the exhaustive list of capabilities on the current
Smart protocol . Then , the server responds too with capabilities .
The common part between the client and the ser... |
fbc8bf0341b2ee601d3a6d83a52ae0bce7905a5d028a514a200153c75469ed40 | yesodweb/yesod | Swedish.hs | {-# LANGUAGE OverloadedStrings #-}
module Yesod.Form.I18n.Swedish where
import Yesod.Form.Types (FormMessage (..))
import Data.Monoid (mappend)
import Data.Text (Text)
swedishFormMessage :: FormMessage -> Text
swedishFormMessage (MsgInvalidInteger t) = "Ogiltigt antal: " `Data.Monoid.mappend` t
swedishFormMessage (Ms... | null | https://raw.githubusercontent.com/yesodweb/yesod/48d05fd6ab12ad440e1f2aa32684ed08b23f0613/yesod-form/Yesod/Form/I18n/Swedish.hs | haskell | # LANGUAGE OverloadedStrings # | module Yesod.Form.I18n.Swedish where
import Yesod.Form.Types (FormMessage (..))
import Data.Monoid (mappend)
import Data.Text (Text)
swedishFormMessage :: FormMessage -> Text
swedishFormMessage (MsgInvalidInteger t) = "Ogiltigt antal: " `Data.Monoid.mappend` t
swedishFormMessage (MsgInvalidNumber t) = "Ogiltigt numme... |
0fd6e7d25bf6b4cf9fceac1555455ade716f69059c64470d43b98b0a7e03075b | goldfirere/thesis | Syn.hs | An implementation of Pico .
Copyright ( c ) 2016
{-# LANGUAGE StandaloneDeriving, TemplateHaskell #-}
module Pico.Syn where
import Pico.Ott
type Unique = Int
data Var = Var String Unique
deriving Show
-- negative Uniques are wired-in
-- non-negative ones are generated
instance Eq Va... | null | https://raw.githubusercontent.com/goldfirere/thesis/22f066bc26b1147530525aabb3df686416b3e4aa/hs/Pico/Syn.hs | haskell | # LANGUAGE StandaloneDeriving, TemplateHaskell #
negative Uniques are wired-in
non-negative ones are generated | An implementation of Pico .
Copyright ( c ) 2016
module Pico.Syn where
import Pico.Ott
type Unique = Int
data Var = Var String Unique
deriving Show
instance Eq Var where
Var _ u1 == Var _ u2 = u1 == u2
a, a0, a1, a2, a3, b, b1, b2, b3, x, x0, x1, x2, x3 :: Var
a = Var "a" (-1)
a0 = Var "a0" (-2)
a... |
04a1372e2a2e6e28f3c67bd65caedc81043510388b002381d2c800e823ba8d3a | earl-ducaine/cl-garnet | lucid-loop.lisp | patches for Garnet / Lucid LISP to allow for safe
;;; multiprocessing.
;;;
;;; Contact:
;;; A process is created at initialization time. Call with-pause to do
;;; something with the main-event-loop process paused.
Based , in large part , on multiprocessing modifications
to Garnet .
;;; Added a safe eve... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/contrib/lucid-loop.lisp | lisp | multiprocessing.
Contact:
A process is created at initialization time. Call with-pause to do
something with the main-event-loop process paused.
Added a safe event loop pause function, temporary suspension of other
processes to fix errors in the Garnet loop, checks when killing processes
to make sure process i... | patches for Garnet / Lucid LISP to allow for safe
Based , in large part , on multiprocessing modifications
to Garnet .
from Garnet files to make it easy to install .
File replaces functions from OPAL and INTERACTORS package
(in-package "OPAL")
bug in Lucid / CLX , fixed in 4.4
's mods for mult... |
3695a1e451735ac61d8ec05a1d49c156e7bb10aa525a96ad241eab3ce449dc75 | FlowerWrong/mblog | tut15.erl | -module(tut15).
-export([start/0, ping/2, pong/0]).
ping(0, Pong_PID) ->
Pong_PID ! finished,
io:format("ping finished~n", []);
ping(N, Pong_PID) ->
Pong_PID ! {ping, self()},
receive
pong ->
io:format("Ping received pong~n", [])
end,
ping(N - 1, Pong_PID).
pong() ->
... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/tut15.erl | erlang | -module(tut15).
-export([start/0, ping/2, pong/0]).
ping(0, Pong_PID) ->
Pong_PID ! finished,
io:format("ping finished~n", []);
ping(N, Pong_PID) ->
Pong_PID ! {ping, self()},
receive
pong ->
io:format("Ping received pong~n", [])
end,
ping(N - 1, Pong_PID).
pong() ->
... | |
d5887ff6f39d1d4eda37bac5ecaeea9e82937b5898bf1c9a1ab20ccd6febc65a | CardanoSolutions/kupo | SlotRangeSpec.hs | 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 /.
module Test.Kupo.Data.Http.SlotRangeSpec
( spec
) where
import Kupo.Prelude
import Kupo.Data.Cardano
( pointFromText
)
import... | null | https://raw.githubusercontent.com/CardanoSolutions/kupo/fd1cc035e6c6d703bb9d96caf97013490c305967/test/Test/Kupo/Data/Http/SlotRangeSpec.hs | haskell | 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 /.
module Test.Kupo.Data.Http.SlotRangeSpec
( spec
) where
import Kupo.Prelude
import Kupo.Data.Cardano
( pointFromText
)
import... | |
63587779825da810826fe2adbe46d3abf2d610047483f7ea332bd9fd32a25994 | google/ormolu | operator-and-parens-out.hs | scientifically :: (Scientific -> a) -> Parser a
scientifically h = do
something
(I.satisfy (\w -> w == 'e' || w == 'E')
*> fmap (h . Sci.scientific signedCoeff . (e +)) (signed decimal))
<|> return (h $ Sci.scientific signedCoeff e)
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/value/function/do/operator-and-parens-out.hs | haskell | scientifically :: (Scientific -> a) -> Parser a
scientifically h = do
something
(I.satisfy (\w -> w == 'e' || w == 'E')
*> fmap (h . Sci.scientific signedCoeff . (e +)) (signed decimal))
<|> return (h $ Sci.scientific signedCoeff e)
| |
3c1842eaf02ae905793e237bbeb77227c48505e9856907275c3b73ade850649b | zwizwa/staapl | pattern-tx.rkt | #lang racket/base
;; Syntax transformer utilities for pattern.rkt
(require
"../ns-tx.rkt"
;; "../tools.rkt"
"../tools/list.rkt"
"../op/static.rkt"
racket/pretty
(for-template
racket/base
"../op.rkt"
"../tools.rkt"
"../scat.rkt"
"../ns.rkt"
"pattern-runtime.rkt"
"rep.rkt"
racket/match
;; (lib "m... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/coma/pattern-tx.rkt | racket | Syntax transformer utilities for pattern.rkt
"../tools.rkt"
(lib "match.rkt")
Output assembly is accumulated in reverse on the stack for
efficiency (cons). The pattern matcher macros will present a
normal ordering, so they require to reverse both the pattern at
compile time and the eventual expression at run tim... | #lang racket/base
(require
"../ns-tx.rkt"
"../tools/list.rkt"
"../op/static.rkt"
racket/pretty
(for-template
racket/base
"../op.rkt"
"../tools.rkt"
"../scat.rkt"
"../ns.rkt"
"pattern-runtime.rkt"
"rep.rkt"
racket/match
))
(provide
asm-pattern-tx
asm-template-tx
asm-lambda-tx
asm-transfor... |
1012141c35b7475b2c58e99c847024a2d81af22bd3c896bed5d2248abb0ec28d | vehicle-lang/vehicle | Interface.hs | module Vehicle.Verify.Verifier.Interface where
import Control.Monad.IO.Class (MonadIO)
import Vehicle.Compile.Prelude
import Vehicle.Compile.Queries.LinearExpr
import Vehicle.Compile.Queries.Variable
import Vehicle.Compile.Queries.VariableReconstruction
import Vehicle.Verify.Core
import Vehicle.Verify.Specification
im... | null | https://raw.githubusercontent.com/vehicle-lang/vehicle/9c8d7b081faf75718f6497dfbe4a0000b1484aab/vehicle/src/Vehicle/Verify/Verifier/Interface.hs | haskell | | The type of methods that compile queries for a verifier
| The type of methods to call a verifier on a query
| A complete verifier implementation
| The name of the executable for the verifier
| The command to invoke the verifier
| The command to compile an individual query | module Vehicle.Verify.Verifier.Interface where
import Control.Monad.IO.Class (MonadIO)
import Vehicle.Compile.Prelude
import Vehicle.Compile.Queries.LinearExpr
import Vehicle.Compile.Queries.Variable
import Vehicle.Compile.Queries.VariableReconstruction
import Vehicle.Verify.Core
import Vehicle.Verify.Specification
im... |
350dd63a1f270734d81afe45b3d19f63bbe5079509cd36847d3a03b0981d2da3 | mmirman/caledon | Parser.hs | # LANGUAGE
RecordWildCards ,
TemplateHaskell ,
FlexibleContexts ,
IncoherentInstances ,
TypeSynonymInstances ,
FlexibleInstances ,
MultiParamTypeClasses
#
RecordWildCards,
TemplateHaskell,
FlexibleContexts,
IncoherentInstances,
TypeSynonymInstances,
FlexibleInstances,
MultiParamTypeClasse... | null | https://raw.githubusercontent.com/mmirman/caledon/7e97110270362d46d8784a5197a84b6a4b7e2982/sources/Parser.hs | haskell | ---------------------------------------------------------------------
------------------------ PARSER -------------------------------------
---------------------------------------------------------------------
now terms must be parsed in pattern normal form | # LANGUAGE
RecordWildCards ,
TemplateHaskell ,
FlexibleContexts ,
IncoherentInstances ,
TypeSynonymInstances ,
FlexibleInstances ,
MultiParamTypeClasses
#
RecordWildCards,
TemplateHaskell,
FlexibleContexts,
IncoherentInstances,
TypeSynonymInstances,
FlexibleInstances,
MultiParamTypeClasse... |
f822fdcfef66acee7d1c36e9010ad448473d16b45c921942ae012ecf1e63f466 | hammerlab/biokepi | vcftools.ml | open Biokepi_run_environment
open Common
(*
Most of the “implementation” part of this module is in the
{!Workflow_utilities} module (because functions are used to prepare VCFs
associated with reference genomres).
*)
* VCFs using [ " vcftools concat " ] .
let vcf_concat ~(run_with:Machine.t) ?more_edges ... | null | https://raw.githubusercontent.com/hammerlab/biokepi/d64eb2c891b41bda3444445cd2adf4e3251725d4/src/bfx_tools/vcftools.ml | ocaml |
Most of the “implementation” part of this module is in the
{!Workflow_utilities} module (because functions are used to prepare VCFs
associated with reference genomres).
| open Biokepi_run_environment
open Common
* VCFs using [ " vcftools concat " ] .
let vcf_concat ~(run_with:Machine.t) ?more_edges vcfs ~final_vcf =
let vcftools = Machine.get_tool run_with Machine.Tool.Default.vcftools in
let host = Machine.(as_host run_with) in
let run_program = Machine.run_program run_with i... |
b2fcb50c3a9714395221be801a0dc29da78964495330c2bc2ef0139dd6a36bc3 | realworldocaml/book | sexp_conv_grammar.ml | let unit_sexp_grammar : unit Sexp_grammar.t = { untyped = List Empty }
let bool_sexp_grammar : bool Sexp_grammar.t = { untyped = Bool }
let string_sexp_grammar : string Sexp_grammar.t = { untyped = String }
let bytes_sexp_grammar : bytes Sexp_grammar.t = { untyped = String }
let char_sexp_grammar : char Sexp_grammar.t ... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/sexplib0/src/sexp_conv_grammar.ml | ocaml | let unit_sexp_grammar : unit Sexp_grammar.t = { untyped = List Empty }
let bool_sexp_grammar : bool Sexp_grammar.t = { untyped = Bool }
let string_sexp_grammar : string Sexp_grammar.t = { untyped = String }
let bytes_sexp_grammar : bytes Sexp_grammar.t = { untyped = String }
let char_sexp_grammar : char Sexp_grammar.t ... | |
a53cd9c757dcdbaf41767d8def8c0a78959b037daad8304a94fd442657de4710 | ocaml-opam/opam2web | compressed.ml |
written by . = > Urheber / Copyright
This is free software and it can be redistributed under the
General Public License ( GPL ) version 2 .
written by Oliver Bandel. => Urheber / Copyright Oliver Bandel
This is free software and it can be redistributed under the
General Public License (... | null | https://raw.githubusercontent.com/ocaml-opam/opam2web/0797940ad5fa779555d34a5561dc288e10fca0b1/src/apalog/compressed.ml | ocaml | -------------------------------------------------------------------------------
This module offers the following functionality: Open a gzip'ed file for reading
and giving back a channel on it, as well as closing the channel and checking,
if there were any problems in reading it. It uses zcat to open the file,... |
written by . = > Urheber / Copyright
This is free software and it can be redistributed under the
General Public License ( GPL ) version 2 .
written by Oliver Bandel. => Urheber / Copyright Oliver Bandel
This is free software and it can be redistributed under the
General Public License (... |
42b105e9d34cbcb7bc15a1618131068459af453c9a8bcb4ba764110b5ef7453b | areina/elfeed-cljsrn | entry.cljs | (ns elfeed-cljsrn.android.scenes.entry
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch]]
[elfeed-cljsrn.rn :as rn]
[elfeed-cljsrn.ui :as ui :refer [colors palette button icon]]
[elfeed-cljsrn.events]
[elfeed-cljsrn.subs]))
(defn rem... | null | https://raw.githubusercontent.com/areina/elfeed-cljsrn/4dea27f785d24a16da05c0ab2ac0c6a6f23360f1/src/elfeed_cljsrn/android/scenes/entry.cljs | clojure | (function() {
| (ns elfeed-cljsrn.android.scenes.entry
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch]]
[elfeed-cljsrn.rn :as rn]
[elfeed-cljsrn.ui :as ui :refer [colors palette button icon]]
[elfeed-cljsrn.events]
[elfeed-cljsrn.subs]))
(defn rem... |
b2a5faff4f0f382c759b6f9d2a46bc19e37988327ad3bc46c4e6744299391b41 | finnishtransportagency/harja | toteumat_test.cljs | (ns harja.views.urakka.toteumat-test
(:require [cljs.test :as test :refer-macros [deftest is testing async]]
[harja.views.urakka.toteumat :as toteumat]
[harja.testutils :refer [fake-palvelut-fixture fake-palvelukutsu jvh-fixture]]
[harja.testutils.shared-testutils :as u]
... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/75b352f128d2c3e2c357f2889a289cbb6c12bea4/test/cljs/harja/views/urakka/toteumat_test.cljs | clojure | (ns harja.views.urakka.toteumat-test
(:require [cljs.test :as test :refer-macros [deftest is testing async]]
[harja.views.urakka.toteumat :as toteumat]
[harja.testutils :refer [fake-palvelut-fixture fake-palvelukutsu jvh-fixture]]
[harja.testutils.shared-testutils :as u]
... | |
f283100d1b6283077c8e67182752afb633b3eba13abef0c263ef2f4965194e0d | release-project/benchmarks | chat_db.erl | %%%--------------------------------------------------------------------
%%% CHAT_DB MODULE
%%%
@author : upon a design by
( C ) 2014 , RELEASE project
%%% @doc
%%% Chat_DB module for the Distributed Erlang instant messenger (IM)
application developed as a real benchmark for the Scalable
Distributed Erlang... | null | https://raw.githubusercontent.com/release-project/benchmarks/55f042dca3a2c680e2967c59edc9636456047bd5/IM/RSD-IM/chat_db.erl | erlang | --------------------------------------------------------------------
CHAT_DB MODULE
@doc
Chat_DB module for the Distributed Erlang instant messenger (IM)
This module implementes the functionality for the database that
stores the chat sessions happening at a given time in a system
@end
-------------------------... | @author : upon a design by
( C ) 2014 , RELEASE project
application developed as a real benchmark for the Scalable
Distributed Erlang extension of the Erlang / OTP language .
similar to the system described in the Section 2 of the document
" Instant Messenger Architectures Design Proposal " .
... |
9d2e1f33d5228fe1b8ff1bd2d98049f3bd6915997b66e8145f52004d36bd3b75 | meiersi/blaze-builder | BuilderBufferRange.hs | # LANGUAGE CPP , BangPatterns #
-- |
Module : BuilderBufferRange
Copyright : ( c ) 2010
-- License : BSD3-style (see LICENSE)
--
Maintainer : < >
-- Stability : experimental
Portability : tested on GHC only
--
-- Benchmark the benefit of using a packed representation for the buffer range.... | null | https://raw.githubusercontent.com/meiersi/blaze-builder/2d8ce308951656ebf0318097989dc1c017dcff83/benchmarks/BuilderBufferRange.hs | haskell | |
License : BSD3-style (see LICENSE)
Stability : experimental
Benchmark the benefit of using a packed representation for the buffer range.
FIXME: is this the right module for access to 'Chunks'?
----------------------------------------------------------------------------
Benchmarks
---------------------... | # LANGUAGE CPP , BangPatterns #
Module : BuilderBufferRange
Copyright : ( c ) 2010
Maintainer : < >
Portability : tested on GHC only
module BuilderBufferRange where
import Foreign
import Data.Monoid
import Control.Monad (unless)
import qualified Data.ByteString as S
import qualified Data.... |
424f2b2bc721f144842a730eb191f7704b9369c24ad066a53d3919a6d1ba208b | helium/erlang-multihash | multihash.erl | -module(multihash).
-export([digest/2, hash/1, code/1]).
-include("multihash.hrl").
-type code() :: non_neg_integer().
-type hash() ::
identity |
sha1 |
sha2_256 |
sha2_512 |
sha3_224 |
sha3_256 |
sha3_384 |
sha3_512 |
keccak224 |
keccak256 |
keccak384 |
keccak512 |
... | null | https://raw.githubusercontent.com/helium/erlang-multihash/d2057bf37d580d840dbd64918c768ef210f7d298/src/multihash.erl | erlang | -module(multihash).
-export([digest/2, hash/1, code/1]).
-include("multihash.hrl").
-type code() :: non_neg_integer().
-type hash() ::
identity |
sha1 |
sha2_256 |
sha2_512 |
sha3_224 |
sha3_256 |
sha3_384 |
sha3_512 |
keccak224 |
keccak256 |
keccak384 |
keccak512 |
... | |
90c37521a493f1b4761700a12ca0bcb953b9bf0227bfeb0df168f0dd352d944f | kazu-yamamoto/mighttpd | Config.hs | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
module Config (Option(..), parseOption, defaultOption) where
import Control.Applicative hiding (many,optional,(<|>))
import Data.List (isPrefixOf)
import Text.Parsec
import Text.Parsec.String
----------------------------------------------------------------
defau... | null | https://raw.githubusercontent.com/kazu-yamamoto/mighttpd/0e5c5db56fefaff4c7d40e2a696f22e67100fd6c/Config.hs | haskell | --------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
-----... | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
module Config (Option(..), parseOption, defaultOption) where
import Control.Applicative hiding (many,optional,(<|>))
import Data.List (isPrefixOf)
import Text.Parsec
import Text.Parsec.String
defaultOption :: Option
defaultOption = Option {
opt_port = 8080
... |
eea3ab52cdfc6d1270121a55cadf79c5c760b6890743f92787ea7991f4de751e | UU-ComputerScience/uhc | GetProgName.hs | {- ----------------------------------------------------------------------------------------
what : yield prog name + args
expected: ok, result may vary on how program is invoked from testing environment
constraints: exclude-if-js
------------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/99/GetProgName.hs | haskell | ----------------------------------------------------------------------------------------
what : yield prog name + args
expected: ok, result may vary on how program is invoked from testing environment
constraints: exclude-if-js
--------------------------------------------------------------------------------... |
module GetProgName where
import System.Environment
main :: IO ()
main
= do p <- getProgName
a <- getArgs
putStrLn p
putStrLn (show a)
|
42df2264f82c418da1c9ec4e0f95fd72fd16540abf6964cc327035c95cfa5ddb | xtdb/xtdb | mock_data.clj | (ns mock-data
(:require dev
[clojure.edn :as edn]
[clojure.string :as string]
[xtdb.api :as xt]))
(defn read-doc
[doc-title]
(edn/read-string (slurp (str "dev/mock-data/" doc-title))))
(def employees (read-doc "employees.edn"))
(def customers (read-doc "customers.edn"))
(def... | null | https://raw.githubusercontent.com/xtdb/xtdb/e2f51ed99fc2716faa8ad254c0b18166c937b134/dev/mock_data.clj | clojure | (ns mock-data
(:require dev
[clojure.edn :as edn]
[clojure.string :as string]
[xtdb.api :as xt]))
(defn read-doc
[doc-title]
(edn/read-string (slurp (str "dev/mock-data/" doc-title))))
(def employees (read-doc "employees.edn"))
(def customers (read-doc "customers.edn"))
(def... | |
7e5408fe47074900ad467e317655c606dc6a0b537a996b7e18a9830759c6849a | bergey/gooey | Main.hs | -- |
module Main where
import GHCJS.DOM
import GHCJS.DOM.Document
import GHCJS.DOM.Element
import GHCJS.DOM.EventTarget
import GHCJS.DOM.EventTargetClosures
import GHCJS.DOM.HTMLInputElement (getValue)
import GHCJS.DOM.Types hiding... | null | https://raw.githubusercontent.com/bergey/gooey/774795ab95058f66b57f1004a0fcc1d541176771/echo-button/src/Main.hs | haskell | | |
module Main where
import GHCJS.DOM
import GHCJS.DOM.Document
import GHCJS.DOM.Element
import GHCJS.DOM.EventTarget
import GHCJS.DOM.EventTargetClosures
import GHCJS.DOM.HTMLInputElement (getValue)
import GHCJS.DOM.Types hiding (Eve... |
6d7ca2817d61a125a44331e5f31c96f9e7c66ec473132b3664a0d2c70edd7c55 | wilkerlucio/pathom | indexes_test.cljc | (ns com.wsscode.pathom.connect.indexes-test
(:require
[clojure.test :refer [deftest is are run-tests testing]]
[com.wsscode.pathom.connect :as pc]
[com.wsscode.pathom.connect.indexes :as pci]
[edn-query-language.core :as eql]))
(deftest test-resolver-provides
(is (= (pci/resolver-provides {})
... | null | https://raw.githubusercontent.com/wilkerlucio/pathom/4ec25055d3d156241e9174d68ec438c93c971b9b/test/com/wsscode/pathom/connect/indexes_test.cljc | clojure | (ns com.wsscode.pathom.connect.indexes-test
(:require
[clojure.test :refer [deftest is are run-tests testing]]
[com.wsscode.pathom.connect :as pc]
[com.wsscode.pathom.connect.indexes :as pci]
[edn-query-language.core :as eql]))
(deftest test-resolver-provides
(is (= (pci/resolver-provides {})
... | |
503a8478eeaa3ad687ae84079ac81f5ef8d9242b77ca9ea38b18bfbc7fce5544 | pfdietz/ansi-test | pathname.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Nov 29 05:06:57 2003
;;;; Contains: Tests of the function PATHNAME
(deftest pathname.1
(loop for x in *pathnames*
always (eq x (pathname x)))
t)
(deftest pathname.2
(equalt #p"pathname.txt" (pathname "p... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/pathnames/pathname.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of the function PATHNAME
Error tests | Author :
Created : Sat Nov 29 05:06:57 2003
(deftest pathname.1
(loop for x in *pathnames*
always (eq x (pathname x)))
t)
(deftest pathname.2
(equalt #p"pathname.txt" (pathname "pathname.txt"))
t)
(deftest pathname.3
(let ((s (open "pathname.txt" :direction :input)))
(prog1 (... |
95082c295c780b0658faafff2e75fff45c59336bcee06306ab6c8769d9c61f77 | bytekid/mkbtt | real.ml | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 is free software : you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation , either ve... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/logic/src/real.ml | ocaml | ** SUBMODULES **************************************************************
** TYPES *******************************************************************
(c,d,m) = c + sqrt(m)d
** GLOBALS *****************************************************************
** FUNCTIONS *****************************************************... | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 is free software : you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation , either ve... |
1c3e8ad1fe3cf3e86c499865bb37db3320739e21f42b21e7d12d3a29a43dd0f1 | nuvla/api-server | ui_hints.cljc | (ns sixsq.nuvla.server.resources.spec.ui-hints
"Attributes that can be used to provide visualization hints for browser (or
other visual) user interfaces."
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[spec-tools.core :as st]))
(s/def ::group
(-> (st/spec ... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/spec/ui_hints.cljc | clojure | (ns sixsq.nuvla.server.resources.spec.ui-hints
"Attributes that can be used to provide visualization hints for browser (or
other visual) user interfaces."
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[spec-tools.core :as st]))
(s/def ::group
(-> (st/spec ... | |
07f1966141e1d1d5a05f7c8cdb38992a4e2a7b66b23989343d25ae6fe2ee9e06 | ucsd-progsys/dsolve | binheap.ml | An implementation of binary heap in DML
datatype tree with nat =
{n:nat} Node(n) of int(n) * int * treelist(n)
and treelist with nat =
Tempty(0)
| {m:nat, n:nat | m >= n} Tcons(m+1) of tree(m) * treelist(n)
datatype heap with nat =
Hempty(0)
| {m:nat, n:nat | n = 0 \/ m+1 < n} Hcons(m+1) of tree(m)... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/xiog/DMLex/binheap.ml | ocaml | An implementation of binary heap in DML
datatype tree with nat =
{n:nat} Node(n) of int(n) * int * treelist(n)
and treelist with nat =
Tempty(0)
| {m:nat, n:nat | m >= n} Tcons(m+1) of tree(m) * treelist(n)
datatype heap with nat =
Hempty(0)
| {m:nat, n:nat | n = 0 \/ m+1 < n} Hcons(m+1) of tree(m)... | |
12f00b24ed4449df3ef5701dbf240f7c4aa2065096a20320e73efc2618fe55d3 | Tritlo/spectacular | Utils.hs | {-# LANGUAGE OverloadedStrings #-}
module Application.TermSearch.Utils where
import Data.Map ( Map )
import qualified Data.Map as Map
import Data.Text ( Text )
import qualified Data.Text as Text
import Data.ECT... | null | https://raw.githubusercontent.com/Tritlo/spectacular/00621f4f0f03e5d0afea3c730434a8842e473546/src/Application/TermSearch/Utils.hs | haskell | # LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
----------------------------- Type Constructors ------------------------------
------------------------------------------------------------------------------
------------------
----- Functions and arguments
---... |
module Application.TermSearch.Utils where
import Data.Map ( Map )
import qualified Data.Map as Map
import Data.Text ( Text )
import qualified Data.Text as Text
import Data.ECTA
import Data.ECTA.Paths
... |
01dd45668d027431607efe6f04ced9a591e701a5033b3ee88f212f766d516c87 | cutsea110/Kestrel | Wiki.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - do - bind #
module Handler.Wiki where
import Prelude (read, undefined)
import Import hiding (head, groupBy, undefined)
import Data.Tuple.HT
import Data.Algorithm.Diff (Diff(..), getDiff)
import Data.List (head, tail, groupBy)
import qua... | null | https://raw.githubusercontent.com/cutsea110/Kestrel/9af7f7ab17a15854e21cc6cb25ac922379a97df7/Handler/Wiki.hs | haskell | pages
view page
edit page
delete page
simple page
query word
Utility
Pages
FIXME Conflict?
view page
edit page
FIXME: use sendResponseCreated API
Utility
pages
view
edit
diff to previous
diff to current
revert
illegal
Utility
... | # OPTIONS_GHC -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - do - bind #
module Handler.Wiki where
import Prelude (read, undefined)
import Import hiding (head, groupBy, undefined)
import Data.Tuple.HT
import Data.Algorithm.Diff (Diff(..), getDiff)
import Data.List (head, tail, groupBy)
import qua... |
79fc07ce506fd21da0f878649787893a83e8cd0e61d7f60cd6f0bbfc66ea26bc | turquoise-hexagon/euler | solution.scm | (import
(chicken fixnum)
(euler))
(define (make-phi n)
(let ((acc (make-vector (fx+ n 1) 1)))
(do ((i 0 (fx+ i 1))) ((fx> i n))
(vector-set! acc i i))
(for-each
(lambda (p)
(do ((m p (fx+ m p))) ((fx> m n))
(vector-set! acc m (fx- (vector-ref acc m) (fx/ (vector-ref acc m) p... | null | https://raw.githubusercontent.com/turquoise-hexagon/euler/fa058f7c391e8c9fd79cd8c143b924fca763f3ef/src/072/solution.scm | scheme | (import
(chicken fixnum)
(euler))
(define (make-phi n)
(let ((acc (make-vector (fx+ n 1) 1)))
(do ((i 0 (fx+ i 1))) ((fx> i n))
(vector-set! acc i i))
(for-each
(lambda (p)
(do ((m p (fx+ m p))) ((fx> m n))
(vector-set! acc m (fx- (vector-ref acc m) (fx/ (vector-ref acc m) p... | |
ed010ce5d78435a588570ed4094f5ecd30568e21bbceba3dc7194bbcc0d06fbc | typelead/eta | T2357.hs | # LANGUAGE NoMonomorphismRestriction #
module Foo where
f :: Read a => a
-- This one needs NoMonomorphismRestriction else f could
-- not get a polymorphic type
(f, _) = (read "3", True)
g :: Read a => a
g = f
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T2357.hs | haskell | This one needs NoMonomorphismRestriction else f could
not get a polymorphic type | # LANGUAGE NoMonomorphismRestriction #
module Foo where
f :: Read a => a
(f, _) = (read "3", True)
g :: Read a => a
g = f
|
df85a384397ae3418cbef71d0755053c1eeef96ec42cdd0234711d5651d76849 | JacquesCarette/Drasil | Development.hs | | Developing the expression language in . Re - export many things to simplify external use .
module Language.Drasil.Development (
* NounPhrase
NounPhrase(phraseNP, pluralNP)
-- Sentence.Extract
, sdep, shortdep, lnames, lnames'
-- * UID
, showUID
) where
import Language.Drasil.NounPhrase (NounPhrase(.... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/a1c22b739c958ae169e8fe4fb2ea2b0a670dc7df/code/drasil-lang/lib/Language/Drasil/Development.hs | haskell | Sentence.Extract
* UID | | Developing the expression language in . Re - export many things to simplify external use .
module Language.Drasil.Development (
* NounPhrase
NounPhrase(phraseNP, pluralNP)
, sdep, shortdep, lnames, lnames'
, showUID
) where
import Language.Drasil.NounPhrase (NounPhrase(..))
import Language.Drasil.Senten... |
08a36f043ef1b11264e4e4afb4039d2b5cdd1b1d92e30cf11fc5733c9c6f5c81 | gsakkas/rite | 20060403-23:30:42-935cb5f8947224ca15c05bc1b31c5394.seminal.ml |
* * * * * Note : Problem 1 does not use ; see the assignment * * * *
exception Unimplemented
exception RuntimeTypeError
exception BadSourceProgram
exception BadPrecomputation
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # ... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060403-23%3A30%3A42-935cb5f8947224ca15c05bc1b31c5394.seminal.ml | ocaml | store env!
********* examples and testing ********** |
* * * * * Note : Problem 1 does not use ; see the assignment * * * *
exception Unimplemented
exception RuntimeTypeError
exception BadSourceProgram
exception BadPrecomputation
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # ... |
e074aedcea0c4b6d6ad76a46813d89d6da98113f35184171c14fe0f42ab098dc | hjcapple/reading-sicp | exercise_3_48.scm | #lang sicp
P219 - [ 练习 3.48 ]
(#%require "serializer.scm")
exchange 需要获取两个账号的串行化队列。假设为 A、B 队列 。
获取 A、B 队列分为可打断的 2 步,假如一个进程 P1 获取了 A,试图去获取 B 。
而 P2 获取了 B , 试图去获取
; 会发生死锁,主要因为获取队列的顺序问题,P1、P2 获取的队列的顺序是不同的。假如对账号编号,强制 P1、P2 都
按照 A、B 的顺序去获取队列,死锁就不会发生 。
(define (make-account-and-serializer id balance)
(def... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_3/exercise_3_48.scm | scheme | 会发生死锁,主要因为获取队列的顺序问题,P1、P2 获取的队列的顺序是不同的。假如对账号编号,强制 P1、P2 都 | #lang sicp
P219 - [ 练习 3.48 ]
(#%require "serializer.scm")
exchange 需要获取两个账号的串行化队列。假设为 A、B 队列 。
获取 A、B 队列分为可打断的 2 步,假如一个进程 P1 获取了 A,试图去获取 B 。
而 P2 获取了 B , 试图去获取
按照 A、B 的顺序去获取队列,死锁就不会发生 。
(define (make-account-and-serializer id balance)
(define (withdraw amount)
(if (>= balance amount)
(b... |
9da125432c8896226ebbdbbf6ada49b50be937d1851bf35fa496aa5b8774cb81 | patricoferris/ocaml-multicore-monorepo | graphql_intf.ml | (* IO signature *)
module type IO = sig
type +'a t
val return : 'a -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
module Stream : sig
type 'a t
type +'a io
val map : 'a t -> ('a -> 'b io) -> 'b t
val iter : 'a t -> ('a -> unit io) -> unit io
val close : 'a t -> unit
end with type 'a io... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/ocaml-graphql-server/graphql/src/graphql_intf.ml | ocaml | IO signature
Field_error signature
* GraphQL schema signature
Map.S with type key = String.t
Argument constructors
* [execute schema ctx variables doc] evaluates the [doc] against [schema]
with the given context [ctx] and [variables]. | module type IO = sig
type +'a t
val return : 'a -> 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
module Stream : sig
type 'a t
type +'a io
val map : 'a t -> ('a -> 'b io) -> 'b t
val iter : 'a t -> ('a -> unit io) -> unit io
val close : 'a t -> unit
end with type 'a io := 'a t
end
modul... |
09f6cf8471acdfa07ab7e153e9bdc993b196a0c59582d57005599a026b400dd7 | mbenke/zpf2013 | ArrFromNested.hs | # LANGUAGE TypeFamilies , FlexibleInstances #
module ArrFromNested where
import Data.Array
type family ListOfIndex i a
-- type instance ListOfIndex () a = a
type instance ListOfIndex Int a = [a]
type instance ListOfIndex (Int, i) a = [ListOfIndex i a]
class Ix i => ArrConv i where
acArgs :: ListOfIndex i a -> ((i, ... | null | https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Slides/02Typ2/ArrFromNested.hs | haskell | type instance ListOfIndex () a = a
instance ArrConv () where
acArgs x = (((), ()), [x]) | # LANGUAGE TypeFamilies , FlexibleInstances #
module ArrFromNested where
import Data.Array
type family ListOfIndex i a
type instance ListOfIndex Int a = [a]
type instance ListOfIndex (Int, i) a = [ListOfIndex i a]
class Ix i => ArrConv i where
acArgs :: ListOfIndex i a -> ((i, i), [a])
instance ArrConv Int where
... |
0aa9d21856ebae4261bc69c7374baad02e915e13e6e2e3e7f061350b8e3e94e0 | kaoskorobase/mescaline | Vector.hs | {-# LANGUAGE BangPatterns #-}
module Sound.Analysis.Vector (
transpose
) where
import Control.Monad
import qualified Control.Monad.ST as ST
import qualified Data.Vector.Generic as V
import qualified Data.Vector.Generic.Mutable as MV
transpose :: V.Vector v a => [v a] -> [v a]
transpose [] = []
transpose... | null | https://raw.githubusercontent.com/kaoskorobase/mescaline/13554fc4826d0c977d0010c0b4fb74ba12ced6b9/lib/mescaline-database/Sound/Analysis/Vector.hs | haskell | # LANGUAGE BangPatterns # | module Sound.Analysis.Vector (
transpose
) where
import Control.Monad
import qualified Control.Monad.ST as ST
import qualified Data.Vector.Generic as V
import qualified Data.Vector.Generic.Mutable as MV
transpose :: V.Vector v a => [v a] -> [v a]
transpose [] = []
transpose xs = ST.runST $ do
mvs <-... |
5310e7037a9b6355e50936d45f070b7b027b4f12cc2eaa6efcb6bbea68074ace | tarides/opam-monorepo | testable.mli | val r_msg : Rresult.R.msg Alcotest.testable
val sexp : Sexplib0.Sexp.t Alcotest.testable
val opam_package_name_set : OpamPackage.Name.Set.t Alcotest.testable
| null | https://raw.githubusercontent.com/tarides/opam-monorepo/9262e7f71d749520b7e046fbd90a4732a43866e9/test/lib/testable.mli | ocaml | val r_msg : Rresult.R.msg Alcotest.testable
val sexp : Sexplib0.Sexp.t Alcotest.testable
val opam_package_name_set : OpamPackage.Name.Set.t Alcotest.testable
| |
0aaaf83ff31ee160c281f24bfbf16d2af4ba80fe8e82a49dbce3134c9799c403 | candera/vmt | canvas.cljs | (ns weathergen.canvas
"A library for drawing on the canvas in a less horrible way.")
(defn create-context
"Create a new context object that knwos about things like grid
coordinates"
[canvas cell-count dimensions]
(let [[x-cells y-cells] cell-count
[w h] dimensions
cell-width (/ w x-cells)
... | null | https://raw.githubusercontent.com/candera/vmt/8cf450e6c34af87d748152afd7f547b92ae9b38e/src/weathergen/canvas.cljs | clojure | (ns weathergen.canvas
"A library for drawing on the canvas in a less horrible way.")
(defn create-context
"Create a new context object that knwos about things like grid
coordinates"
[canvas cell-count dimensions]
(let [[x-cells y-cells] cell-count
[w h] dimensions
cell-width (/ w x-cells)
... | |
fbe3b6d3d790748e5b9058395aa0d6a633caa4da575ef89e7230db57805aa57e | input-output-hk/plutus-apps | Ada.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DerivingVia #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
-- Otherwise we get a complaint about the 'fromIntegral' call in the generated instance of 'Integral' for 'Ada'
# OPTIONS_G... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/e8688b8f86a92b285e7d93eb418ccc314ad41bf9/plutus-script-utils/src/Plutus/Script/Utils/Ada.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DerivingVia #
Otherwise we get a complaint about the 'fromIntegral' call in the generated instance of 'Integral' for 'Ada'
* Constructors
* Etc.
# INLINABLE adaSymbol #
| The 'TokenName' of the 'Ada' currency.
1M Lovelace is one Ada.
| Create a 'Value' containing ... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wno - identities #
# OPTIONS_GHC -fno - omit - interface - pragmas #
| Functions for working with ' ' in Template Haskell .
module Plutus.Script.Utils.Ada(
Ada (..)
... |
9f89a4c9a73baea98b61d2240b2aee1d4280159626e7e7f4e774ab8041863420 | aerolang/aero | aero_parse_tests.erl | -module(aero_parse_tests).
-include_lib("eunit/include/eunit.hrl").
scan(Source) ->
Result = aero_scan:scan(Source),
?assertMatch({ok, _}, Result),
{ok, Tokens} = Result,
Tokens.
parse(Source) ->
Tokens = scan(Source),
Result = aero_parse:parse(Tokens),
{ok, Ast} = Result,
Ast.
empty_test_() ->
... | null | https://raw.githubusercontent.com/aerolang/aero/45bb9961b872a2c61b7a514fce06f34be57a4dfb/test/aero_parse_tests.erl | erlang | Empty source.
Only a newline.
Single expression.
Single block.
Identifier and a block.
Identifier and a block (explicit comma). | -module(aero_parse_tests).
-include_lib("eunit/include/eunit.hrl").
scan(Source) ->
Result = aero_scan:scan(Source),
?assertMatch({ok, _}, Result),
{ok, Tokens} = Result,
Tokens.
parse(Source) ->
Tokens = scan(Source),
Result = aero_parse:parse(Tokens),
{ok, Ast} = Result,
Ast.
empty_test_() ->
... |
46e499bfec347d27a1811159c463c71bedfb3f8ba16de74784534d851fd1aed4 | racket/typed-racket | shallow-in-array.rkt | #lang typed/racket/shallow
;; Use 'in-array'
;; inspired by jpeg benchmark
(require (only-in math/array in-array Array))
(: read-dct-scan (-> (Array Integer) Void))
(define (read-dct-scan dest)
(for ((mcu (in-array dest)))
(void)))
| null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/external/succeed/shallow-in-array.rkt | racket | Use 'in-array'
inspired by jpeg benchmark | #lang typed/racket/shallow
(require (only-in math/array in-array Array))
(: read-dct-scan (-> (Array Integer) Void))
(define (read-dct-scan dest)
(for ((mcu (in-array dest)))
(void)))
|
2b6a016f6a0d029856ccdfba39b7295df467528d91ada79fd1e233ada52b85aa | aggieben/weblocks | misc.lisp |
(in-package :weblocks)
(export '(gen-id humanize-name attributize-name insert-after insert-at
slot-value-by-path safe-apply safe-funcall request-parameter
request-parameters string-whitespace-p render-extra-tags
with-extra-tags alist->plist intersperse
remove-keyword-parameter remove-keyword-parameters
... | null | https://raw.githubusercontent.com/aggieben/weblocks/8d86be6a4fff8dde0b94181ba60d0dca2cbd9e25/src/utils/misc.lisp | lisp | Status of a symbol
String helpers
Element insertion
URI from pathname
|
(in-package :weblocks)
(export '(gen-id humanize-name attributize-name insert-after insert-at
slot-value-by-path safe-apply safe-funcall request-parameter
request-parameters string-whitespace-p render-extra-tags
with-extra-tags alist->plist intersperse
remove-keyword-parameter remove-keyword-parameters
... |
4cde794a02944f28888f3551f6acc962d7770287fc5475be3f84072ef8dc8dc2 | Leberwurscht/Diaspora-User-Directory | catchup.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/catchup.ml | ocaml | **********************************************************************
*********************************************************************
* code used by the reconserver to catch up on whatever updates have
been made to the key database
*************************************************************
***************... | 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 ... |
c183ea422047116d3f6b9ff82553f8b71b028187e48bdd8b122efc71b64a7bed | aristidb/aws | Sqs.hs | {-# LANGUAGE OverloadedStrings #-}
import qualified Aws
import qualified Aws.Core
import qualified Aws.Sqs as Sqs
import Control.Concurrent
import Control.Error
import Control.Monad.IO.Class
import Data.Monoid
import Data.String
import qualified Data.Text.IO as T
import qualified Data.Text as T
import qualified Dat... | null | https://raw.githubusercontent.com/aristidb/aws/a99113ed7768f9758346052c0d8939b66c6efa87/Examples/Sqs.hs | haskell | # LANGUAGE OverloadedStrings #
Set up AWS credentials and the default configuration.
Create a QueueName object, sqsQName, to hold the name of this queue for the duration
list queue attributes -- for this example we will only list the approximateNumberOfMessages in this queue.
Here we add some messages to the que... |
import qualified Aws
import qualified Aws.Core
import qualified Aws.Sqs as Sqs
import Control.Concurrent
import Control.Error
import Control.Monad.IO.Class
import Data.Monoid
import Data.String
import qualified Data.Text.IO as T
import qualified Data.Text as T
import qualified Data.Text.Read as TR
import Control.Mo... |
40446250916ca41685b5a13614bea49dcfe1bef9ac9acedac1d49a13c385b113 | incoherentsoftware/defect-process | Camera.hs | module World.Camera
( WorldCamera
, mkWorldCamera
, calculateWorldCameraPos
, updateWorldCamera
, setWorldCameraLocked
, drawWorldCamera
) where
import Control.Monad (unless)
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (fromMaybe)
import Configs
import Co... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/15f2569e7d0e481c2e28c0ca3a5e72d2c049b667/src/World/Camera.hs | haskell | module World.Camera
( WorldCamera
, mkWorldCamera
, calculateWorldCameraPos
, updateWorldCamera
, setWorldCameraLocked
, drawWorldCamera
) where
import Control.Monad (unless)
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (fromMaybe)
import Configs
import Co... | |
7936cfb62822eb5aa966de35dcd36d4b40e3c83079c52d2b1af694b9c3b79c5c | RichiH/git-annex | Hash.hs | git - annex hashing backends
-
- Copyright 2011 - 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Backend.Hash (
backends,
testKeyBackend,
) where
import Annex.Common
import qual... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Backend/Hash.hs | haskell | A key is a hash of its contents.
Extension preserving keys.
long enough for "jpeg"
A key's checksum is checked during fsck.
A bug caused checksums to be prefixed with \ in some
- cases; still accept these as legal now that the bug has been
- fixed.
Upgrade keys that have the \ prefix on their sha due to... | git - annex hashing backends
-
- Copyright 2011 - 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Backend.Hash (
backends,
testKeyBackend,
) where
import Annex.Common
import qual... |
e2dd59aac6e39d5ca1b9a02f446d0542a2f554758db13c445aeba74f73431ed4 | alanz/ghc-exactprint | TH_bracket3.hs | # LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TemplateHaskellQuotes #-}
module TH_bracket3 where
d_class = [d| class Classy a b where
f :: a -> b
instance Classy Int Bool where
f x = if x == 0 then True else False
|]
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/TH_bracket3.hs | haskell | # LANGUAGE TemplateHaskellQuotes # | # LANGUAGE MultiParamTypeClasses #
module TH_bracket3 where
d_class = [d| class Classy a b where
f :: a -> b
instance Classy Int Bool where
f x = if x == 0 then True else False
|]
|
9026c5c1a616f80e512487914ace42fc41fe1406f861a0ad8b65b079b5bc720d | jeroanan/rkt-coreutils | md5sum.rkt | #lang s-exp "util/program/file-by-file-processor-program.rkt"
Copyright 2020
; See COPYING for details
(require racket/list
file/md5)
(define help-text (list "Compute and print MD5 message digest"
"(execute files) -- compute and print MD5 message digest for files"))
(file-by-fil... | null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/repl/md5sum.rkt | racket | See COPYING for details | #lang s-exp "util/program/file-by-file-processor-program.rkt"
Copyright 2020
(require racket/list
file/md5)
(define help-text (list "Compute and print MD5 message digest"
"(execute files) -- compute and print MD5 message digest for files"))
(file-by-file-processor md5sum file-ha... |
88a7d6e81fc0918ff45c459b086584525d59b811cc9824484d2dc80c8b19523a | walck/learn-physics | PlotTools.hs | # OPTIONS_GHC -Wall #
|
Module : Physics . Learn . Visual . PlotTools
Copyright : ( c ) 2011 - 2014
License : BSD3 ( see LICENSE )
Maintainer : < >
Stability : experimental
This module contains helping functions for using Gnuplot .
Module : Physics.Learn.Visua... | null | https://raw.githubusercontent.com/walck/learn-physics/99611ca49940b78a0e13402f35082805cc7db294/src/Physics/Learn/Visual/PlotTools.hs | haskell | | An 'Attribute' with a given label at a given position.
| An 'Attribute' that requests postscript output.
| An 'Attribute' giving the postscript file name.
| An example of the use of 'label'. See the source code.
| An example of the use of 'postscript' and 'psFile'. See the source code. | # OPTIONS_GHC -Wall #
|
Module : Physics . Learn . Visual . PlotTools
Copyright : ( c ) 2011 - 2014
License : BSD3 ( see LICENSE )
Maintainer : < >
Stability : experimental
This module contains helping functions for using Gnuplot .
Module : Physics.Learn.Visua... |
6a57a80b7e21df0d23dcefc389b99ef868fc22bc230737ee9b7f3e28f36f2e03 | MrEbbinghaus/fulcro-material-ui-wrapper | alert.cljc | (ns mui.feedback.alert
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs [["@mui/material/Alert" :default Alert]
["@mui/material/AlertTitle" :default AlertTitle]])))
(def alert (interop/react-factory #?(:cljs Alert :clj nil)))
(def title (interop/react-factory #... | null | https://raw.githubusercontent.com/MrEbbinghaus/fulcro-material-ui-wrapper/058f1dd4b85542914f92f48a4010ea9ad497e48f/src/mui/feedback/alert.cljc | clojure | (ns mui.feedback.alert
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs [["@mui/material/Alert" :default Alert]
["@mui/material/AlertTitle" :default AlertTitle]])))
(def alert (interop/react-factory #?(:cljs Alert :clj nil)))
(def title (interop/react-factory #... | |
75e4badfa22bbf7c1b7d9828bd0011dbd7cf03495004d89b4e032e4f8a8aee6c | anurudhp/CPHaskell | a.hs | import Control.Arrow ((>>>))
main :: IO ()
main = interact $ read >>> solve
solve :: Int -> String
solve n
| even n = "White"
| otherwise = "Black"
| null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/atcoder/abc181/a.hs | haskell | import Control.Arrow ((>>>))
main :: IO ()
main = interact $ read >>> solve
solve :: Int -> String
solve n
| even n = "White"
| otherwise = "Black"
| |
f6c7d9c4f8c19ad921ef8a0d12b988389e824819eccd0e154df4a116aa49c757 | vinted/kafka-elasticsearch-tool | http.clj | (ns core.http
(:require [org.httpkit.client :as http])
(:import (javax.net.ssl SSLParameters SSLEngine SNIHostName)
(java.net URI)))
(defn sni-configure
[^SSLEngine ssl-engine ^URI uri]
(let [^SSLParameters ssl-params (.getSSLParameters ssl-engine)]
(.setServerNames ssl-params [(SNIHostName. (.g... | null | https://raw.githubusercontent.com/vinted/kafka-elasticsearch-tool/281de24d51cbd2a7ad78e3c1d13a4619b786210d/src/core/http.clj | clojure | (ns core.http
(:require [org.httpkit.client :as http])
(:import (javax.net.ssl SSLParameters SSLEngine SNIHostName)
(java.net URI)))
(defn sni-configure
[^SSLEngine ssl-engine ^URI uri]
(let [^SSLParameters ssl-params (.getSSLParameters ssl-engine)]
(.setServerNames ssl-params [(SNIHostName. (.g... | |
5b2704a32b863ca0704a8e632d708c114d77de8620a091138a7258ddecbd74d8 | tlehman/sicp-exercises | ex-2.32.scm | Exercise 2.32 : We can represent a set as a list of distinct
; elements, and we can represent the set of all subsets of the set as
; a list of lists. For example, if the set is (1 2 3), then the set of
all subsets is ( ( ) ( 3 ) ( 2 ) ( 2 3 ) ( 1 ) ( 1 3 ) ( 1 2 ) ( 1 2 3 ) ) .
;
; Complete the following definition... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-2.32.scm | scheme | elements, and we can represent the set of all subsets of the set as
a list of lists. For example, if the set is (1 2 3), then the set of
Complete the following definition of a procedure that generates the
set of subsets of a set and give a clear explanation of why it
works:
The reason this works is that for any ... | Exercise 2.32 : We can represent a set as a list of distinct
all subsets is ( ( ) ( 3 ) ( 2 ) ( 2 3 ) ( 1 ) ( 1 3 ) ( 1 2 ) ( 1 2 3 ) ) .
(load "helpers.scm")
(define (subsets s)
(if (null? s)
(list nil)
(let ((rest (subsets (cdr s))))
(append rest (map (lambda (x) (cons (car s) x))
rest)))))
... |
f1c4000460d9d0f459e6db9e5da8d483adbfd6047caf060749cc02c3326b42ba | finkel-lang/finkel | Recompile.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
-- | Module containing types and functions for object code recompilation check.
module Language.Finkel.Make.Recompile
( RecompM(..)
, RecompState(..)
, emptyRecompState
, checkRecompileRequired
, checkModSummary
, adjustIncludePaths
) wher... | null | https://raw.githubusercontent.com/finkel-lang/finkel/48f912a1064d99e32ea2dcb672bb1567772db6d4/finkel-kernel/src/Language/Finkel/Make/Recompile.hs | haskell | # LANGUAGE OverloadedStrings #
| Module containing types and functions for object code recompilation check.
base
filepath
internal
------------------------------------------------------------------------
------------------------------------------------------------------------
See: 'MkIface.checkModUsage'.
---... | # LANGUAGE CPP #
module Language.Finkel.Make.Recompile
( RecompM(..)
, RecompState(..)
, emptyRecompState
, checkRecompileRequired
, checkModSummary
, adjustIncludePaths
) where
#include "ghc_modules.h"
import Control.Monad (forM_, when)
import Cont... |
8ba452bef9bddb274e948636c8608bb7bbc7692b9e5469da01f647091e246008 | jbreindel/battlecraft | bc_player.erl |
-module(bc_player).
-export([create/4,
id/1,
handle/1,
team/1,
pid/1,
serialize/1]).
%%
%% @doc player map for player indentification
%%
-type player() :: #{id => integer(),
handle => string(),
team => integer(),
pid => pid()}.
-spec create(Id :: integer(),
Handle :: string(),
... | null | https://raw.githubusercontent.com/jbreindel/battlecraft/622131a1ad8c46f19cf9ffd6bf32ba4a74ef4137/apps/bc_game/src/bc_player.erl | erlang |
@doc player map for player indentification
|
-module(bc_player).
-export([create/4,
id/1,
handle/1,
team/1,
pid/1,
serialize/1]).
-type player() :: #{id => integer(),
handle => string(),
team => integer(),
pid => pid()}.
-spec create(Id :: integer(),
Handle :: string(),
Team :: integer(),
PlayerPid :: pid()) -> pl... |
c3711a7fb8d40efeb2eb515287da0011c46e7bb995329dabb589fa74eb64dd51 | mariari/Misc-Lisp-Scripts | cool.lisp | Chapter 5 - ---------------------------------------------------------
(defun fif (if then &optional else)
"Checks the given parameter for a function and acts accordingly"
#'(lambda (x)
(if (funcall if x)
(funcall then x)
(if else (funcall else x)))))
;; Useage
( mapcar ( fif # ' oddp (... | null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/acecadc75fcbe15e6b97e084d179aacdbbde06a8/Books/OnLisp/cool.lisp | lisp | Useage
'(1 2 3 4 5 6 ))
-> nil t nil t nil t
(mapcar (fif #'oddp #'- #'evenp)
'(1 2 3 4 5 6 ))
-> -1 T -3 T -5 T
Testing compusing F(g(x))
We might as well just use apply and list outside of this | Chapter 5 - ---------------------------------------------------------
(defun fif (if then &optional else)
"Checks the given parameter for a function and acts accordingly"
#'(lambda (x)
(if (funcall if x)
(funcall then x)
(if else (funcall else x)))))
( mapcar ( fif # ' oddp ( lambda ( ... |
73e2d0a037bf5da96468706b332db5531ee4327f260c5caa11e2af43bb5b4660 | DerekCuevas/interview-cake-clj | core.clj | (ns find-repeat-space-edition.core
(:gen-class))
(defn- bound [floor ceiling]
{:floor floor :ceiling ceiling})
(defn- bound->midpoint [{:keys [floor ceiling]}]
(-> (- ceiling floor)
(/ 2)
int
(+ floor)))
(defn- bound->length [{:keys [floor ceiling]}]
(inc (- ceiling floor)))
(defn- lower-b... | null | https://raw.githubusercontent.com/DerekCuevas/interview-cake-clj/f17d3239bb30bcc17ced473f055a9859f9d1fb8d/find-repeat-space-edition/src/find_repeat_space_edition/core.clj | clojure | (ns find-repeat-space-edition.core
(:gen-class))
(defn- bound [floor ceiling]
{:floor floor :ceiling ceiling})
(defn- bound->midpoint [{:keys [floor ceiling]}]
(-> (- ceiling floor)
(/ 2)
int
(+ floor)))
(defn- bound->length [{:keys [floor ceiling]}]
(inc (- ceiling floor)))
(defn- lower-b... | |
e9deb989ad52420115b394531cf6fe60531f13daa000cc0f10e42d9fd6dbcb2e | alpacaaa/zero-bullshit-haskell | ShoppingCart.hs | module Ex07ShoppingCart.ShoppingCart where
import GHC.Generics (Generic)
import qualified Data.Aeson as Aeson
import qualified Zero.Server as Server
data Item
= Item { model :: String, quantity :: Int }
deriving (Eq, Show, Generic, Aeson.FromJSON, Aeson.ToJSON)
data Cart
= Cart [Item]
deriving (Eq, Show, Ge... | null | https://raw.githubusercontent.com/alpacaaa/zero-bullshit-haskell/6463b9bfd175ac50e82c326c6eda61d11751cab7/exercises/src/Ex07ShoppingCart/ShoppingCart.hs | haskell | append item at the end of the list | module Ex07ShoppingCart.ShoppingCart where
import GHC.Generics (Generic)
import qualified Data.Aeson as Aeson
import qualified Zero.Server as Server
data Item
= Item { model :: String, quantity :: Int }
deriving (Eq, Show, Generic, Aeson.FromJSON, Aeson.ToJSON)
data Cart
= Cart [Item]
deriving (Eq, Show, Ge... |
d21cdc28d3270ff5e2f390f4458d705c8b32ca1dcad13b9b5329ed4e9c64a297 | facebookarchive/pfff | pretty_print.mli |
(* used by prettyphp *)
val program:
(string -> unit) -> Ast_pp.program -> unit
(* used by test *)
val program_env:
Pretty_print_code.env -> Ast_pp.program -> unit
(* used by spatch *)
val stmts:
Pretty_print_code.env -> Ast_pp.stmt list -> unit
val class_elements:
Pretty_print_code.env -> Ast_pp.class_elem... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_php/pretty/pretty_print.mli | ocaml | used by prettyphp
used by test
used by spatch
used by xhpize |
val program:
(string -> unit) -> Ast_pp.program -> unit
val program_env:
Pretty_print_code.env -> Ast_pp.program -> unit
val stmts:
Pretty_print_code.env -> Ast_pp.stmt list -> unit
val class_elements:
Pretty_print_code.env -> Ast_pp.class_element list -> unit
val class_header:
Pretty_print_code.env -> A... |
07f60b14c6fcb93f9405dbbb3098034d7ec305af53ca1eaf75e4fc4eb20fdd9d | kmi/irs | grounding.lisp | Copyright © 2008 The Open University
;;; ATTENTION! DO NOT REFORMAT THE STRINGS IN HERE!
;;;
;;; They are sensitive to white space changes which are a pain to
;;; debug. You break it, you fix it.
(in-package #:irs.tests)
(def-suite grounding-suite
:description "Tests for the groundings.")
(in-suite groundin... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/tests/grounding.lisp | lisp | ATTENTION! DO NOT REFORMAT THE STRINGS IN HERE!
They are sensitive to white space changes which are a pain to
debug. You break it, you fix it. | Copyright © 2008 The Open University
(in-package #:irs.tests)
(def-suite grounding-suite
:description "Tests for the groundings.")
(in-suite grounding-suite)
(test http-goal-invocation
(is (string=
(ip::raw-irs-achieve-goal 'ocml::irs-tests
'ocml::ocml-query-goal
`((ocml::has-ontology "IRS... |
35b6c06822bed5fc013605bcd5ab253a93187e4d29fca93594745ea568779b54 | robert-strandh/SICL | condition-reporters-en.lisp | (cl:in-package #:sicl-iteration)
(defun name-package (name)
(let ((real-name (if (symbolp name) name (cadr name))))
(package-name (symbol-package real-name))))
;;; I used to think that we should not use FORMAT for these condition
reporters . I now think it is OK . RS -- 2014 - 09 - 15 .
(defmethod acclim... | null | https://raw.githubusercontent.com/robert-strandh/SICL/ec906617ea81bf9e033699bd27c32a346d21a1c1/Code/Iteration/condition-reporters-en.lisp | lisp | I used to think that we should not use FORMAT for these condition | (cl:in-package #:sicl-iteration)
(defun name-package (name)
(let ((real-name (if (symbolp name) name (cadr name))))
(package-name (symbol-package real-name))))
reporters . I now think it is OK . RS -- 2014 - 09 - 15 .
(defmethod acclimation:report-condition ((c malformed-binding-var)
... |
3714065f9e3fc80524221c1283409c2958f52d7efa1471a38d646b7816a36a0e | WorksHub/client | views.cljs | (ns wh.promotions.preview.views
(:require [reagent.core :as r]
[wh.promotions.preview.events]
[wh.promotions.preview.subs :as subs]
[wh.re-frame.subs :refer [<sub]]
[wh.styles.promotions :as styles]
[wh.util :as util]))
(defn promotion
[{:keys [id start-d... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/client/src/wh/promotions/preview/views.cljs | clojure | (ns wh.promotions.preview.views
(:require [reagent.core :as r]
[wh.promotions.preview.events]
[wh.promotions.preview.subs :as subs]
[wh.re-frame.subs :refer [<sub]]
[wh.styles.promotions :as styles]
[wh.util :as util]))
(defn promotion
[{:keys [id start-d... | |
9333acf076800410d4a422bd0e0c20a52f608c057b8e1081950a0f945dbfa989 | bet365/erpc | erpc_lib.erl | %%
%% %CopyrightBegin%
%%
Copyright Hillside Technology Ltd. 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by ap... | null | https://raw.githubusercontent.com/bet365/erpc/77c63d4398ad6baa07178e976d26eb95240e17a8/src/erpc_lib.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Hillside Technology Ltd. 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(erpc_lib).
-export([
log_msg/2
]).
log_msg(Fmt, Args) ->
case application:get_en... |
ca02b37b1dd39b6ef87d79448767e0f8ecbf9bbabf95075a8f1f2633fbc99482 | ocaml-flambda/flambda-backend | flambda_backend_flags.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/bed9613a24b4bc5ed377ca20c3b685195c993e21/driver/flambda_backend_flags.ml | ocaml | ************************************************************************
OCaml
... | , OCamlPro
and ,
Copyright 2013 - -2021 OCamlPro SAS
Copyright 2014 - -2021 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the ... |
2df36cd92039619d662db1e0e848cf9b371a454a1cad4ef2032a4438d5b4f942 | nallen05/djula | util.lisp |
(in-package :djula)
; util
(defmacro aif (test &optional (then 'it) else)
`(let ((it ,test))
(if it
,then
,else)))
(defun .keyword (thing)
(values (intern (string-upcase (string thing)) :keyword)))
(defun .funcall-and-concatenate (thunks)
(apply 'concatenate 'string (mapcar 'princ-to-string (mapcar ... | null | https://raw.githubusercontent.com/nallen05/djula/331e2d5b0c9967b636e4df22e847ac98f16f6ba9/src/util.lisp | lisp | util
url/html encoding
this function was created by modifying HUNCHENTOOT:ESCAPE-FOR-HTML
" out))
"note that there's no comma in there - because of cookies"
--Hunchentoot source
I don't know why there's no comma "because of cookies",
it's what hunchentoot did so I copied it..
--Nick
may... |
(in-package :djula)
(defmacro aif (test &optional (then 'it) else)
`(let ((it ,test))
(if it
,then
,else)))
(defun .keyword (thing)
(values (intern (string-upcase (string thing)) :keyword)))
(defun .funcall-and-concatenate (thunks)
(apply 'concatenate 'string (mapcar 'princ-to-string (mapcar 'funcal... |
ce40339223dadc7e093b563083ac5f44b6024068169b34614aa0273aca7b2f31 | hidaris/thinking-dumps | interp.rkt | (module interp (lib "eopl.ss" "eopl")
;; interpreter for the EXPLICIT-REFS language
(require "drscheme-init.rkt")
(require "lang.rkt")
(require "data-structures.rkt")
(require "environments.rkt")
(require "store.rkt")
(provide value-of-program value-of instrument-let instrument-newref)
;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/eopl-solutions/chap4/4-13/store-passing/interp.rkt | racket | interpreter for the EXPLICIT-REFS language
switches for instrument-let ;;;;;;;;;;;;;;;;
say (instrument-let #t) to turn instrumentation on.
(instrument-let #f) to turn it off again.
the interpreter ;;;;;;;;;;;;;;;;
(initialize-store!) ; new for explicit refs.
\commentbox{ (value-of (const-exp \n... | (module interp (lib "eopl.ss" "eopl")
(require "drscheme-init.rkt")
(require "lang.rkt")
(require "data-structures.rkt")
(require "environments.rkt")
(require "store.rkt")
(provide value-of-program value-of instrument-let instrument-newref)
(define instrument-let (make-parameter #f))
value - of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.