_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 |
|---|---|---|---|---|---|---|---|---|
08a0cd7dcbb7ba93837ce91867bc734a80827b352b717e19936236f9b4e1250f | ocaml-sf/learn-ocaml-corpus | master.ml | (* BEGIN INCLUDE *)
(* Length. *)
(* TO DO: Define [length]. *)
let length (type a) (s : a seq) : int =
raise TODO
(* Constructors. *)
(* TO DO: Define [empty]. *)
(* TO DO: Define [singleton]. *)
(* TO DO: Define [sum]. *)
(* TO DO: Define [product]. *)
(* TO DO: Define [map]. *)
The remaining two accessor... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/symbolic_sequences_data/master.ml | ocaml | BEGIN INCLUDE
Length.
TO DO: Define [length].
Constructors.
TO DO: Define [empty].
TO DO: Define [singleton].
TO DO: Define [sum].
TO DO: Define [product].
TO DO: Define [map].
TO DO: Define [get].
TO DO: Define [foreach].
END INCLUDE
This implementation of [product] imposes the following inv... |
let length (type a) (s : a seq) : int =
raise TODO
The remaining two accessors .
let rec get : type a . a seq -> int -> a =
fun s i ->
raise TODO
let rec foreach : type a . a seq -> (a -> unit) -> unit =
fun s k ->
raise TODO
BEGIN EXCLUDE
let length ( type a ) ( s : a seq ) : int =
m... |
be8e0e03a42e38d5fef1c5dd51b1c976e46580da969d0acd13d28448bfcea11d | ucsd-progsys/liquidhaskell | PadLeft.hs | {-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ infixr ++ @-}
@ infixr ! ! @
module PadLeft where
import Prelude hiding (max, replicate, (++), (!!))
-----------------------------------------------------------------------------------
-- | Code
----------------------------... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/56f72d6d8d8106fda4e35645e5f0bcab7bc10eee/tests/ple/pos/PadLeft.hs | haskell | @ LIQUID "--reflection" @
@ LIQUID "--ple" @
@ infixr ++ @
---------------------------------------------------------------------------------
| Code
---------------------------------------------------------------------------------
@ leftPad :: n:Int -> c:a -> xs:[a] -> {v:[a] | size v = max n (si... | @ infixr ! ! @
module PadLeft where
import Prelude hiding (max, replicate, (++), (!!))
@ reflect leftPad @
leftPad :: Int -> a -> [a] -> [a]
leftPad n c xs
| 0 < pad = replicate pad c ++ xs
| otherwise = xs
where
pad = n - size xs
@ leftPadObvious : : n : Int - > c : a - > xs:[a ... |
01c82adc47514e068126912d9ad90826422c0a8e91c529bcf40c1523fc0d7c73 | ucsd-progsys/dsolve | quotations.mli | a small routine to parse a string as a toplevel stmt
val quote : string -> Parsetree.structure_item_desc
val quote_expr : string -> Parsetree.expression
val map_expr : (Parsetree.expression_desc -> Parsetree.expression_desc)
-> Parsetree.expression -> Parsetree.expression
val map_expr_desc : (Parsetree.expression... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/parsing/quotations.mli | ocaml | a small routine to parse a string as a toplevel stmt
val quote : string -> Parsetree.structure_item_desc
val quote_expr : string -> Parsetree.expression
val map_expr : (Parsetree.expression_desc -> Parsetree.expression_desc)
-> Parsetree.expression -> Parsetree.expression
val map_expr_desc : (Parsetree.expression... | |
1232c79044e88d898226c51a40d36ada74730762dffd6d8665a73484d1ad3dd8 | agda/agda2hs | AutoLambdaCaseInBind.hs | # LANGUAGE LambdaCase #
module AutoLambdaCaseInBind where
lcaseInsideBind :: Maybe (Maybe a) -> Maybe a
lcaseInsideBind mx
= do x <- mx
(\case
Nothing -> Nothing
Just _ -> Nothing)
x
| null | https://raw.githubusercontent.com/agda/agda2hs/a248c10876ad7832da3c908535a1ddeff84d210e/test/golden/AutoLambdaCaseInBind.hs | haskell | # LANGUAGE LambdaCase #
module AutoLambdaCaseInBind where
lcaseInsideBind :: Maybe (Maybe a) -> Maybe a
lcaseInsideBind mx
= do x <- mx
(\case
Nothing -> Nothing
Just _ -> Nothing)
x
| |
18ff52e68529e0a5d09e0d0b6749c18dbdfae610789ad22c06a647cf984f3ef3 | albertoruiz/easyVision | static.hs | -- Detects and optionally saves the static frames in the image sequence
import EasyVision
import System.Process(system)
import Control.Concurrent(forkIO)
import Util.Options
main = do
th <- getOption "--sensi" 0.01
thf <- getOption "--factor" 5
env <- getOption "--env" 5
run $ camera
>... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/old/simple/static.hs | haskell | Detects and optionally saves the static frames in the image sequence |
import EasyVision
import System.Process(system)
import Control.Concurrent(forkIO)
import Util.Options
main = do
th <- getOption "--sensi" 0.01
thf <- getOption "--factor" 5
env <- getOption "--env" 5
run $ camera
>>= detectStatic th thf env grayscale rgb
>>= monitor "Snapshot" ... |
b84aa98bc9257ea01f535fe1559602172760729bff20904b981c0ad241e753fe | samirose/sicp-compiler-project | override-special-form-as-operator.scm | (import (compiler-test)
(override-special-form-as-operator))
(compiler-test-begin "override-special-form-as-operator")
(compiler-test-eq
"let binding can override quote"
42 (override-quote-let))
(compiler-test-eq
"procedure parameter can override quote"
42 (override-quote-arg))
(compiler-test-eq
"let binding ... | null | https://raw.githubusercontent.com/samirose/sicp-compiler-project/2bc8a481044b5a653408f8595b2a2396600b8ad6/test-compiler/test/override-special-form-as-operator.scm | scheme | (import (compiler-test)
(override-special-form-as-operator))
(compiler-test-begin "override-special-form-as-operator")
(compiler-test-eq
"let binding can override quote"
42 (override-quote-let))
(compiler-test-eq
"procedure parameter can override quote"
42 (override-quote-arg))
(compiler-test-eq
"let binding ... | |
a9e206373b520d66de34249ebee9fd37f10ec9a99f1e35e273ac0c03b5452d96 | REPROSEC/dolev-yao-star | Vale_X64_CPU_Features_s.ml | open Prims
let (aesni_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet implemented:aesni_enabled")
let (avx_cpuid_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet implemented:avx_cpuid_enabled")
let (pclmulqdq_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet impl... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Vale_X64_CPU_Features_s.ml | ocaml | open Prims
let (aesni_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet implemented:aesni_enabled")
let (avx_cpuid_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet implemented:avx_cpuid_enabled")
let (pclmulqdq_enabled : Prims.bool) =
Obj.magic (fun uu___ -> failwith "Not yet impl... | |
88d85275e8b62d37f3b67455a049a3db66a132be48f67fe36f986f38c9d11b26 | damballa/parkour | word_count_test.clj | (ns parkour.example.word-count-test
(:require [clojure.test :refer :all]
[clojure.string :as str]
[clojure.java.io :as io]
[parkour.tool :as tool]
[parkour.test-helpers :as th]
[parkour.example.word-count :as e]))
(deftest test-example-word-count
(th/with... | null | https://raw.githubusercontent.com/damballa/parkour/2b3c5e1987e18b4c4284dfd4fcdaba267a4d7fbc/test/parkour/example/word_count_test.clj | clojure | (ns parkour.example.word-count-test
(:require [clojure.test :refer :all]
[clojure.string :as str]
[clojure.java.io :as io]
[parkour.tool :as tool]
[parkour.test-helpers :as th]
[parkour.example.word-count :as e]))
(deftest test-example-word-count
(th/with... | |
61d60fab6c3b390534fa4e65481ed0d708ac04a89fe05a9f6d0bbd776ece2ba3 | fgalassi/cs61a-sp11 | 3.11.scm | where is the local state for acc kept ?
it 's in the frame created by invoking ( make - account 50 )
accessible by the dispatch lambda returned and assigned to acc
;
How are local states for the two accounts kept distinct ?
; when invoking make-account a new environment is created for each account
;
which par... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/homework/3.11.scm | scheme |
when invoking make-account a new environment is created for each account
just the global environment and the make-account procedure | where is the local state for acc kept ?
it 's in the frame created by invoking ( make - account 50 )
accessible by the dispatch lambda returned and assigned to acc
How are local states for the two accounts kept distinct ?
which parts of the environment structure are shared between acc and acc2 ?
|
bcc146c229982e060bee70380147dd54788eb4f01d7483ad8de65d82399239af | amnh/phylocaml | sequence.mli | (** {2 Sequence} *)
(** The Sequence module allows the interaction of encoded arrays of data for C
usage. The sequence can be thought of as dynamically expandable arrays,
perfect for unaligned data. The [create] command allocates the upper bound of
space that can be manipulated, and prepend like function incre... | null | https://raw.githubusercontent.com/amnh/phylocaml/86aebc4f2664752668b16707214b3cad099434c0/lib/sequence.mli | ocaml | * {2 Sequence}
* The Sequence module allows the interaction of encoded arrays of data for C
usage. The sequence can be thought of as dynamically expandable arrays,
perfect for unaligned data. The [create] command allocates the upper bound of
space that can be manipulated, and prepend like function increase th... |
* { 2 Type Definitions }
type s
type elt = int
exception Invalid_Sequence of (string * string * int)
* error raised ; returns entire sequence , invalid base , and location
exception ReachedCapacity
exception Invalid_Base of elt
val compare : s -> s -> int
* Basic compare function for two sequences .
* { 2 Ba... |
7cf1592fcacd9f81a5f4b7d287c49592b91860ec6b7deddcb5d2e4827369c467 | ygmpkk/house | Bool.hs | {-# OPTIONS -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Bool
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experime... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/base/Data/Bool.hs | haskell | # OPTIONS -fno-implicit-prelude #
---------------------------------------------------------------------------
|
Module : Data.Bool
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
The 'Bool' type and related functions.
--... | Copyright : ( c ) The University of Glasgow 2001
module Data.Bool (
* Booleans
Bool(..),
: : Bool
: :
) where
#ifdef __GLASGOW_HASKELL__
import GHC.Base
#endif
#ifdef __NHC__
import Prelude
import Prelude
( Bool(..)
, (&&)
, (||)
, not
, otherwise
)
#endif
|
ea22cff5328ece14215b56686ee3fec71c0f71fce5918320c67c2edfd04619f2 | kmi/irs | lhdl.lisp | (in-package #:irs.applications.lhdl)
(defmethod initialise-application ((application (eql :lhdl)))
(pushnew "irs:apps;lhdl;ontologies;" ocml:*ontology-path*)
(webonto:require-ontologies '(:lhdl-application))
(start-web-interface))
(defmethod start-application ((application (eql :lhdl))))
| null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/apps/lhdl/lisp/lhdl.lisp | lisp | (in-package #:irs.applications.lhdl)
(defmethod initialise-application ((application (eql :lhdl)))
(pushnew "irs:apps;lhdl;ontologies;" ocml:*ontology-path*)
(webonto:require-ontologies '(:lhdl-application))
(start-web-interface))
(defmethod start-application ((application (eql :lhdl))))
| |
d7cf4f6371188aeb52e74a4d471b27d276986bdb11b3ee441ceb38d40860d9bc | kappamodeler/kappa | memory_control.ml | open Data
open Printf
let smaller a b = a<b
let greater a b = a>b
let test limit comp =
if limit < 1. then false else
let coef = 1024. *. 1024. /. 4. in
let max = float_of_int max_int in
let k =
if max /. coef < limit
then max
else (limit *. coef)
in
let used = float_of_int ... | null | https://raw.githubusercontent.com/kappamodeler/kappa/de63d1857898b1fc3b7f112f1027768b851ce14d/simplx_rep/src/main/memory_control.ml | ocaml | Setting gc alarm for memory overflow
Setting gc alarm for strong collection mode
Setting gc alarm for weak collection mode | open Data
open Printf
let smaller a b = a<b
let greater a b = a>b
let test limit comp =
if limit < 1. then false else
let coef = 1024. *. 1024. /. 4. in
let max = float_of_int max_int in
let k =
if max /. coef < limit
then max
else (limit *. coef)
in
let used = float_of_int ... |
1d5cb1eaa6de020b55e6f5a2b26f5cea8a2163e2e03d5bdc9655a53c53731c4c | rudymatela/leancheck | TypeBinding.hs | -- |
Module : Test . . Utils . TypeBinding
Copyright : ( c ) 2015 - 2020
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
--
This module is part of LeanCheck ,
-- a simple enumerative property-based testing library.
--
Infix operators for type binding using dummy fi... | null | https://raw.githubusercontent.com/rudymatela/leancheck/af299d3616a362816c21931ada6fa49a2af7f911/src/Test/LeanCheck/Utils/TypeBinding.hs | haskell | |
a simple enumerative property-based testing library.
Those are useful when property based testing to avoid repetition.
Suppose:
> prop_sortAppend xs = sort (xs++ys) == sort (ys++xs)
Then this:
> testResults n =
> [ holds n (prop_sortAppend :: [Int] -> [Int] -> Bool)
> , holds n (prop_sortAppend ::... | Module : Test . . Utils . TypeBinding
Copyright : ( c ) 2015 - 2020
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
This module is part of LeanCheck ,
Infix operators for type binding using dummy first - class values .
> prop_sortAppend : : a = > [ a ] - > Bool
... |
d46eadf9da4acdf91aa4065bcf52bb81cf34e94e9f994a20ec325eb8e936afb9 | sionescu/iolib | pkgdcl.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Package definition
;;;
(in-package :iolib/common-lisp-user)
(defpackage :iolib/syscalls
(:nicknames :isys :iolib.syscalls)
(:use :iolib/base :cffi)
(:shadow #:open #:close #:read #:write #:listen
#:truncate #:ftruncate #:time)
;; Specials
... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/syscalls/pkgdcl.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Package definition
Specials
Simple POSIX Types
-----------------------------------------
Error conditions, wrappers and definers
-----------------------------------------
CFFI Type Designators
SSTRING <-> CSTRING
Misc
--------------------------------
Structs, slo... |
(in-package :iolib/common-lisp-user)
(defpackage :iolib/syscalls
(:nicknames :isys :iolib.syscalls)
(:use :iolib/base :cffi)
(:shadow #:open #:close #:read #:write #:listen
#:truncate #:ftruncate #:time)
(:export
Deprecated , to be removed . 2011 - 09 - 05
#:*environ*)
(:export
#:bool
... |
4b82d217dcdff7ec14d4e33c618a2e4b519d51cb5af624efc1ff5c09cf4dd5d7 | wireless-net/erlang-nommu | wxGraphicsContext.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxGraphicsContext.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
< br />{@link wxGraphicsObject }
-modul... |
eb6d604082800126d18fcf83086e4c3bd29a7df0b54a7cb5b0ad13aa3d8c128e | janestreet/ocaml-probes | test.ml | simple example : run forever , print something once , when a probe is hit for
the first time .
the first time. *)
let p1_hit = ref false
let p2_hit = ref false
let p3_hit = ref false
let on_p name hit =
if not !hit then (
hit := true;
Printf.printf "Hit %s\n" name;
flush stdout
)
let () =... | null | https://raw.githubusercontent.com/janestreet/ocaml-probes/1ddd237eb647c94918ce77b13922bd51710e94d5/test/non-terminating/test.ml | ocaml | simple example : run forever , print something once , when a probe is hit for
the first time .
the first time. *)
let p1_hit = ref false
let p2_hit = ref false
let p3_hit = ref false
let on_p name hit =
if not !hit then (
hit := true;
Printf.printf "Hit %s\n" name;
flush stdout
)
let () =... | |
bedc8109a3f75d043dc77189443b02122f67f6ba5223f21d3a27ebb529b5817b | discus-lang/ddc | Stage.hs | -- | Compiler stages.
--
-- A compiler stage is a sequence of standard transformations.
-- Each of the individual transformations are expressed as a pipeline from
-- "DDC.Build.Pipeline". The stages here run several pipelines each,
-- and contain the code that can dump the intermediate program after
-- ... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-driver/DDC/Driver/Stage.hs | haskell | | Compiler stages.
A compiler stage is a sequence of standard transformations.
Each of the individual transformations are expressed as a pipeline from
"DDC.Build.Pipeline". The stages here run several pipelines each,
and contain the code that can dump the intermediate program after
each trans... | module DDC.Driver.Stage
( Config (..)
, ViaBackend (..)
, RuntimeLinkStrategy (..)
, sourceLoadText
, discusLoadText
, discusToSalt
, stageFlowLoad
, stageFlowPrep
, stageFlowRate
, stageFlowLower
, stageFlowWind
... |
a1385875db193a7fe1cb0cff870aac403c1e6358817f8b0e680094ca8c3ddd0d | binsec/xyntia | heuristic.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2019 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/xyntia/523e4c93520843dfd6f84f0ef2cefa6dcef508e8/src/lib/heuristic.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2019 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
322ec4691c13d8e2d15bf42d19eb22ece90aa386c2ba6e93cb245f9ec7426752 | keigoi/caramel-mpst | ets.erl | Source code generated with Caramel .
-module(ets).
-export_type([access/0]).
-export_type([concurrency/0]).
-export_type([make_opt/0]).
-export_type([t/2]).
-export_type([table_type/0]).
-opaque t(K, V) :: reference().
-type table_type() :: set
| ordered_set
| bag
... | null | https://raw.githubusercontent.com/keigoi/caramel-mpst/20551cdcc20c9a64e42bb5bd8ba313bd5952b6b7/stdlib/ets.erl | erlang | Source code generated with Caramel .
-module(ets).
-export_type([access/0]).
-export_type([concurrency/0]).
-export_type([make_opt/0]).
-export_type([t/2]).
-export_type([table_type/0]).
-opaque t(K, V) :: reference().
-type table_type() :: set
| ordered_set
| bag
... | |
2408552367b93e06f61fdde434438a41e1c5bffa855f3d28dcb00b2c29e44a3a | cfelde/ebbs-social-frontend | utils.cljs | (ns ebbs-social-frontend.misc.utils)
(def max-post-data-length 256)
(def max-post-meta-length 512)
(defn post-data->encoded-data
[post]
(into {} (remove #(-> % second nil?) {"1" (:title post)
"2" (:body post)
"3" (:post-link post)
... | null | https://raw.githubusercontent.com/cfelde/ebbs-social-frontend/ad47de958f3e60bbafe0867f3e192981d3acf3d6/src/ebbs_social_frontend/misc/utils.cljs | clojure | (ns ebbs-social-frontend.misc.utils)
(def max-post-data-length 256)
(def max-post-meta-length 512)
(defn post-data->encoded-data
[post]
(into {} (remove #(-> % second nil?) {"1" (:title post)
"2" (:body post)
"3" (:post-link post)
... | |
de6d4e386d086a494b07244b703fc98729a2e48367720679de11f6e511072b16 | 8c6794b6/haskell-sc-scratch | E.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portable
E , for serializing / deserializing expression tree .
Module : $Header$
CopyRigh... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/hsc3-lepton/src/lib/Sound/SC3/Lepton/Pattern/Interpreter/E.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
Helper functions
----------------------------------------------------------------------------
Base classes
----------------------------------------------------------------------------
Patter... | # LANGUAGE TemplateHaskell #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portable
E , for serializing / deserializing expression tree .
Module : $Header$
CopyRight : (c) 8c6794b6
License : BSD3
Maintainer :
Stabi... |
07f9a1d78f12fdbefb01742b84a7e01fd76b3bd359fefb0019458e0411d841a2 | dronowar/erlang_rest_api | erl_app.erl | -module(erl_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
Dispatch = cowbo... | null | https://raw.githubusercontent.com/dronowar/erlang_rest_api/d9c260f9fdb0f3012cc294642fc44c3dc13a4b10/src/erl_app.erl | erlang | Application callbacks
===================================================================
Application callbacks
=================================================================== | -module(erl_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
Dispatch = cowboy_router:compile([
{'_', [
{"/", hello_handler, []},
{"/register", register_handler, []},
{"/login", login_handler, []},
... |
77a6a3079363aeae533b0fb8f963d495b0f6c0d633359739bbdb96522353bb87 | ocaml/opam | opamPinned.ml | (**************************************************************************)
(* *)
Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam/3e764ac489e1ab545b3963cb4c0aa68b9adeb24e/src/state/opamPinned.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
open OpamTypes
open OpamStateTypes
open OpamFilename.Op
open OpamStd.Option.Op
let log fmt = ... |
0385eb936105b01d8a83bcd8c13db3b90958d208bda84d9d2872623bd88b2a41 | elaforge/karya | Tempo.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
# LANGUAGE CPP #
-- | Functions to handle tempo tracks.
module Derive.Tempo (
with_tempo, with_absolute, with_hybrid
#ifdef TESTING
, tempo_to_warp
#endif
) where
import qualified... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Derive/Tempo.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Functions to handle tempo tracks.
* normal
| Warp a deriver with a tempo signal.
tempo: trackpos over time. Warp is the time warping that the tempo
implies, which is the integral of (1/tempo).
^ If thi... | Copyright 2013
# LANGUAGE CPP #
module Derive.Tempo (
with_tempo, with_absolute, with_hybrid
#ifdef TESTING
, tempo_to_warp
#endif
) where
import qualified Ui.ScoreTime as ScoreTime
import qualified Derive.Derive as Derive
import qualified Derive.Deriver.Internal as Internal
import qualified Derive.Warp as... |
138c0a3c8867ded4336020aa436f1b4fe93d37189d35c18eccb85db4f5280270 | lojic/LearningRacket | etl-test.rkt | #lang racket
(require "etl.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"Tests for the etl exercise"
(test-case "transform one value"
(check-equal? (transform #hash((1 . (#\W)))) #hash((#\w . 1))))
(test-case "more values"
(... | null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/exercism.io/etl/etl-test.rkt | racket | #lang racket
(require "etl.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"Tests for the etl exercise"
(test-case "transform one value"
(check-equal? (transform #hash((1 . (#\W)))) #hash((#\w . 1))))
(test-case "more values"
(... | |
03de8f9816f8b81d3427c2ada873d49bba51b51240d8a480c464d72f27bdac03 | cljsinfo/cljs.info | state.cljs | (ns cljsinfo-client.state
(:require
[cljsinfo-client.util :refer [js-log log]]))
;;------------------------------------------------------------------------------
Shared State
;;------------------------------------------------------------------------------
(def current-size (atom nil)) | null | https://raw.githubusercontent.com/cljsinfo/cljs.info/32c21c4cceb8b74fdfc47adc33170868ea2e8162/cljs-client/cljsinfo_client/state.cljs | clojure | ------------------------------------------------------------------------------
------------------------------------------------------------------------------ | (ns cljsinfo-client.state
(:require
[cljsinfo-client.util :refer [js-log log]]))
Shared State
(def current-size (atom nil)) |
bbbfa1a7b174ed77ea69bd06d7eb6270bfae762de2a849daa4161c8e4ce50b01 | issuu/ocaml-zmq | tasksink.ml |
Task sink
Binds PULL socket to tcp:5558
Collects results from workers vis that socket
Task sink
Binds PULL socket to tcp:5558
Collects results from workers vis that socket
*)
let time_diff_ms t1 t2 =
truncate ((t2 -. t1) *. 1000.0)
let () =
let module Socket = Zmq.Socket in
(* Prepare our c... | null | https://raw.githubusercontent.com/issuu/ocaml-zmq/f1aad60f136529f45543a08a2f42c63d716e4e8f/zmq/examples/tasksink.ml | ocaml | Prepare our context and socket
Wait for start of batch
Start our clock now
Process 100 confirmations
Calculate and report duration of batch |
Task sink
Binds PULL socket to tcp:5558
Collects results from workers vis that socket
Task sink
Binds PULL socket to tcp:5558
Collects results from workers vis that socket
*)
let time_diff_ms t1 t2 =
truncate ((t2 -. t1) *. 1000.0)
let () =
let module Socket = Zmq.Socket in
let context = Zm... |
41996c4b2a6a24b9a9a01034cc5f3094f039c71528c346e5b627cf7469fa5511 | xapi-project/ocaml-opasswd | passwd.ml | open Ctypes
open Foreign
type file_descr = unit ptr
let file_descr : file_descr typ = ptr void
let fopen =
foreign ~check_errno:true "fopen" (string @-> string @-> returning file_descr)
let fclose' = foreign ~check_errno:true "fclose" (file_descr @-> returning int)
let fclose fd = fclose' fd |> ignore
type t = {
... | null | https://raw.githubusercontent.com/xapi-project/ocaml-opasswd/f7e608846d4f8a8b06343e97b662673897c73472/lib/passwd.ml | ocaml | uid : uid_t;
gid : gid_t;
Local Variables:
indent-tabs-mode: nil
End: | open Ctypes
open Foreign
type file_descr = unit ptr
let file_descr : file_descr typ = ptr void
let fopen =
foreign ~check_errno:true "fopen" (string @-> string @-> returning file_descr)
let fclose' = foreign ~check_errno:true "fclose" (file_descr @-> returning int)
let fclose fd = fclose' fd |> ignore
type t = {
... |
44e77eb933de72aee1a7db46c6945171d3b23549007243fb4c5e74cb65fd4ce7 | babashka/nbb | deps.cljs | (ns nbb.impl.deps
(:require
["child_process" :as cproc]
["crypto" :as crypto]
["fs" :as fs]
["path" :as path]
[nbb.classpath :as cp]
[nbb.core :as nbb :refer [opts]]))
(defn hash-deps
"Given a map of dependencies, generates a unique hash of that map for
caching purposes."
[deps]
(.. (crypto... | null | https://raw.githubusercontent.com/babashka/nbb/9cf69ec1746c7def2c593d06f2063ee138987de2/src/nbb/impl/deps.cljs | clojure | this wasn't necessary, so let's not do it yet | (ns nbb.impl.deps
(:require
["child_process" :as cproc]
["crypto" :as crypto]
["fs" :as fs]
["path" :as path]
[nbb.classpath :as cp]
[nbb.core :as nbb :refer [opts]]))
(defn hash-deps
"Given a map of dependencies, generates a unique hash of that map for
caching purposes."
[deps]
(.. (crypto... |
f3f5c999931d16ca1e7c6d6f9725a8ff21e8e1f78d82607ebcf8bc33634f5a5b | fjvallarino/monomer | Animation.hs | |
Module : . Widgets . Animation
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Widgets implementing different types of animations .
Module : Monomer.Widgets.Animation
Copyright : ... | null | https://raw.githubusercontent.com/fjvallarino/monomer/3b321ed0bd5c1458864c02696c43aa39b627640f/src/Monomer/Widgets/Animation.hs | haskell | |
Module : . Widgets . Animation
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Widgets implementing different types of animations .
Module : Monomer.Widgets.Animation
Copyright : ... | |
12c53f9c10b04a9093fc4ae376b3a40c6c99e84e8fb55dc2a3c2f5724a46115f | ml-in-barcelona/jsoo-react | hooks.ml | let use_ref initial =
let state, _ = Core.use_state (fun () -> ref initial) in
state
let use_ref_lazy init =
let state, _ = Core.use_state (fun () -> ref (init ())) in
state
let use_state initial = Core.use_state (fun () -> initial)
let use_state_lazy init = Core.use_state init
let use_reducer = Core.use_redu... | null | https://raw.githubusercontent.com/ml-in-barcelona/jsoo-react/b5f3b7b9a21b74b14a2ee696a8f36c59495bd742/lib/hooks.ml | ocaml | let use_ref initial =
let state, _ = Core.use_state (fun () -> ref initial) in
state
let use_ref_lazy init =
let state, _ = Core.use_state (fun () -> ref (init ())) in
state
let use_state initial = Core.use_state (fun () -> initial)
let use_state_lazy init = Core.use_state init
let use_reducer = Core.use_redu... | |
433f1e3128b385b9d4c5e5481ad072f2ad6aaf9fb0abf2afed13b75de74e1482 | ml4tp/tcoq | declarations.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/kernel/declarations.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This module defines the internal r... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
type s... |
07acf37c7a27e4575525fd6e144086509c9d4861eb549566a7c183bcae88ec16 | racket/gui | mred-unit.rkt | (module mred-unit mzscheme
(require mzlib/unit
"mred-sig.rkt"
"mred.rkt")
(provide standard-mred@)
(define-unit-from-context standard-mred@ mred^))
| null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mred/mred-unit.rkt | racket | (module mred-unit mzscheme
(require mzlib/unit
"mred-sig.rkt"
"mred.rkt")
(provide standard-mred@)
(define-unit-from-context standard-mred@ mred^))
| |
db6962389171b16f3b5017d3e7bd7c3779e42a7880b079387ceaf53ac6d7a89f | r0man/sablono | core_test.cljs | (ns sablono.core-test
(:require-macros [sablono.core :refer [html with-group]]
[sablono.test :refer [html-data html-str]])
(:require [cljsjs.create-react-class]
[clojure.pprint :refer [pprint]]
[clojure.test :refer [are is testing]]
[devcards.core :refer-macros... | null | https://raw.githubusercontent.com/r0man/sablono/3221c5bacd1c81f1f79bc1ec86f3d2652b1a12d2/test/sablono/core_test.cljs | clojure | (ns sablono.core-test
(:require-macros [sablono.core :refer [html with-group]]
[sablono.test :refer [html-data html-str]])
(:require [cljsjs.create-react-class]
[clojure.pprint :refer [pprint]]
[clojure.test :refer [are is testing]]
[devcards.core :refer-macros... | |
3ee5e334d28c443de739b2aa0305c46b31e3b4b4d37848a5cee06264bf3c4cd4 | magnusjonsson/tidder-icfpc-2008 | speedometer.scm | #lang scheme
(provide update value)
(require "vec2.scm")
(define last-t #f)
(define last-pos #f)
(define speed 0)
(define (value)
speed)
(define (update t pos)
(when (and last-t last-pos (> t last-t))
(set! speed (/ (vec2-distance pos last-pos) (- t last-t))))
(set! last-t t)
(set! last-pos pos)
spe... | null | https://raw.githubusercontent.com/magnusjonsson/tidder-icfpc-2008/84d68fd9ac358c38e7eff99117d9cdfa86c1864a/submission/icfp08/src/scheme/speedometer.scm | scheme | #lang scheme
(provide update value)
(require "vec2.scm")
(define last-t #f)
(define last-pos #f)
(define speed 0)
(define (value)
speed)
(define (update t pos)
(when (and last-t last-pos (> t last-t))
(set! speed (/ (vec2-distance pos last-pos) (- t last-t))))
(set! last-t t)
(set! last-pos pos)
spe... | |
071ebbc15be866a9be0db2f9a200be1e396f186a82497d3eb05346f066e89f25 | awslabs/s2n-bignum | bignum_optneg_sm2.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/6b53f075a0e28e6b89db12301de5f59ec788855c/x86/proofs/bignum_optneg_sm2.ml | ocaml | =========================================================================
Optional negation mod p_sm2, field characteristic for CC SM2 curve.
=========================================================================
*** print_literal_from_elf "x86/sm2/bignum_optneg_sm2.o";;
***
OR (% rax) (% rcx)
NEG (%... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_optneg_sm2_mc = define_assert_from_elf "bignum_optneg_s... |
362c9dcf09ace7fcdd34583cdcd1e0530eebad26f335f5e0bb222e873f407453 | binsec/haunted | formula.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/formula/formula.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
b117ddc6bd5c4b628d9b08003cbd9cd313ad72f2169d3854ca4dbc63cd144d5d | e-bigmoon/haskell-blog | Data.hs | -- @Chat/Data.hs
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeFamilies #
module Chat.Data where
import ... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/examples/ex3/chat/src/Chat/Data.hs | haskell | @Chat/Data.hs
# LANGUAGE FlexibleContexts #
# LANGUAGE QuasiQuotes #
# LANGUAGE RankNTypes #
# LANGUAGE TemplateHaskell #
| Our subsite foundation. We keep a channel of events that all connections
will share. | # LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
module Chat.Data where
import Blaze.ByteString.Builder.Char.Utf8 (fromText)
import Control.Concurrent.Chan
import Data.Monoid ((<>))
import Data.T... |
6570b258fc94a05201db15708d585632cd9e26d6191759f494997bcdcb853dec | racket/typed-racket | racket-eval-server.rkt | #lang racket
(require racket/sandbox)
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(namespace-require 'racket/math)
(namespace-require 'racket/flonum)
(namespace-require 'racket/unsafe/ops))
(eval '(define (safe-arithmetic-shift a b)
(if (> b 100000) b (arithmetic-shift a b... | null | https://raw.githubusercontent.com/racket/typed-racket/1d96c67cab9c444bb8887f2dcad40e6aac464f27/typed-racket-test/racket-eval-server.rkt | racket | #lang racket
(require racket/sandbox)
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(namespace-require 'racket/math)
(namespace-require 'racket/flonum)
(namespace-require 'racket/unsafe/ops))
(eval '(define (safe-arithmetic-shift a b)
(if (> b 100000) b (arithmetic-shift a b... | |
098a57e787a142914c544d1886a8ea8d3b2661cdf9d34ecdd0aefac7e4734a6c | vbmithr/ocaml-ledger-wallet | transport.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2017 Vincent Bernar... | null | https://raw.githubusercontent.com/vbmithr/ocaml-ledger-wallet/35cf78534b7d382d02d87f8fb1052f848475a912/src/transport.ml | ocaml | Those constants are provided by the vendor (e.g. check the udev
rules they provide):
These come from the ledger's udev rules | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2017 Vincent Bernar... |
204326234c9896b5879154dba355278499937eea54abf83e494fac1a0dc8c03a | wz1000/hie-lsp | Class.hs | | This module defines ' PerformEvent ' and ' TriggerEvent ' , which mediate the
-- interaction between a "Reflex"-based program and the external side-effecting
-- actions such as 'IO'.
# LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiPar... | null | https://raw.githubusercontent.com/wz1000/hie-lsp/dbb3caa97c0acbff0e4fd86fc46eeea748f65e89/reflex-0.6.1/src/Reflex/PerformEvent/Class.hs | haskell | interaction between a "Reflex"-based program and the external side-effecting
actions such as 'IO'.
# LANGUAGE RankNTypes #
# OPTIONS_GHC -fplugin=Reflex.Optimizer #
| 'PerformEvent' represents actions that can trigger other actions based on
'Event's.
| The type of action to be triggered; this is often not the same... | | This module defines ' PerformEvent ' and ' TriggerEvent ' , which mediate the
# LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# L... |
631442fd448c67f055ccc04638b855fe3f443020444edc4bd3d92463587e37ce | bendmorris/scotch | Show.hs | module Scotch.Types.Show where
import Data.List
import Data.List.Utils
import Numeric
import Scotch.Types.Types
formatString [] = []
formatString (h:t) = if h == '"' then "\\\"" ++ formatString t
else h : formatString t
removeBrackets s = if (s !! 0) == '[' && (s !! (l-1)) == ']'
... | null | https://raw.githubusercontent.com/bendmorris/scotch/7b4bb4546d0ea3bc6b345eedc65a5d7f82c98d10/Scotch/Types/Show.hs | haskell | module Scotch.Types.Show where
import Data.List
import Data.List.Utils
import Numeric
import Scotch.Types.Types
formatString [] = []
formatString (h:t) = if h == '"' then "\\\"" ++ formatString t
else h : formatString t
removeBrackets s = if (s !! 0) == '[' && (s !! (l-1)) == ']'
... | |
2e964df1fff0ffc97568e17f7a8dbf28d48c3d53b9e746f18fd6a32c277c3d11 | ocaml/dune | execution_parameters.ml | open Import
module Action_output_on_success = struct
type t =
| Print
| Swallow
| Must_be_empty
let all =
[ ("print", Print); ("swallow", Swallow); ("must-be-empty", Must_be_empty) ]
let to_dyn = function
| Print -> Dyn.Variant ("Print", [])
| Swallow -> Variant ("Swallow", [])
| Mu... | null | https://raw.githubusercontent.com/ocaml/dune/7bdc8d6ecb97630b96b406d0e71b12bb833cbe41/src/dune_engine/execution_parameters.ml | ocaml | open Import
module Action_output_on_success = struct
type t =
| Print
| Swallow
| Must_be_empty
let all =
[ ("print", Print); ("swallow", Swallow); ("must-be-empty", Must_be_empty) ]
let to_dyn = function
| Print -> Dyn.Variant ("Print", [])
| Swallow -> Variant ("Swallow", [])
| Mu... | |
7ca4eff54bbc59d4014c4df3ecd2632e9b9b0475db9cd5711f4d6b88fe0fcb75 | esumii/min-caml | reg_sw_bug.ml | (* -caml/pull/11 *)
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 =
if y17 = 2 then () else
f y2 y1 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| null | https://raw.githubusercontent.com/esumii/min-caml/8860b6fbc50786a27963aff1f7639b94c244618a/test/SPARC/reg_sw_bug.ml | ocaml | -caml/pull/11 | let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 =
if y17 = 2 then () else
f y2 y1 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
ee66480d6a0deb2c0f51da721d62be55ed5dc2ddc24ddb888fc26151d578a9ab | gonimo/gonimo | Types.hs | # LANGUAGE FlexibleInstances #
-- Types which are only relevant to the device.
-- They are either accepted from the device or sent to the device but have no further use
-- on the server side.
module Gonimo.SocketAPI.Types where
import Data.Aeson.Types (FromJSON, ToJSON (..), defaultOptions,
... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/gonimo-common/src/Gonimo/SocketAPI/Types.hs | haskell | Types which are only relevant to the device.
They are either accepted from the device or sent to the device but have no further use
on the server side.
Account:
User:
Family:
Invitation:
Family Account:
Device: | # LANGUAGE FlexibleInstances #
module Gonimo.SocketAPI.Types where
import Data.Aeson.Types (FromJSON, ToJSON (..), defaultOptions,
genericToEncoding)
import Data.Int (Int64)
import Data.Maybe (fromMaybe)
import Data.Text (... |
087f585903824bb923e62273458aca71a5b51e1ac63b64e9f8d72538cdc6c37a | samuelrivas/moka | moka_call_handler_history_tests.erl | Copyright ( c ) 2013 , < >
%%% All rights reserved.
%%% Redistribution and use in source and binary forms, with or without
%%% modification, are permitted provided that the following conditions are met:
%%% * Redistributions of source code must retain the above copyright
%%% notice, this list of conditio... | null | https://raw.githubusercontent.com/samuelrivas/moka/92521e43d1d685794f462ed49403c99baeae0226/test/component/moka_call_handler_history_tests.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistr... | Copyright ( c ) 2013 , < >
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTI... |
8fc7f46db4ba919f41ec5912df7561ac3ce6b0e6bfd9e2a4553d5e90d390601b | shenxs/about-scheme | 25-XML.rkt | #lang racket
(require 2htdp/image)
,
标签的参数 , 包括参数名和参数值
;(make-attribute symbol string)
(define-struct attribute [name value])
标签 , . 属性 , 内容
;(make-element string (list of attribute) (list any))
(define-struct element [name attributes content])
#| '(machine ((initial "red")) |#
#| (action ((state "red") (next "g... | null | https://raw.githubusercontent.com/shenxs/about-scheme/d458776a62cb0bbcbfbb2a044ed18b849f26fd0f/HTDP/25-XML.rkt | racket | (make-attribute symbol string)
(make-element string (list of attribute) (list any))
'(machine ((initial "red"))
(action ((state "red") (next "green")))
(action ((state "green") (next "yellow")))
(action ((state "yellow") (next "red"))))
;用symbol来表示Xexpr(即X-expression)
;- v.0
'(cons Symbol '())
;v1
;v2 ... | #lang racket
(require 2htdp/image)
,
标签的参数 , 包括参数名和参数值
(define-struct attribute [name value])
标签 , . 属性 , 内容
(define-struct element [name attributes content])
' ( cons Symbol [ list of ] )
' ( cons Symbol [ list - of X - expr.v2 ] )
' ( cons Symbol ( cons [ list - of attribute ] [ list - of X - expr.v... |
71db3c013f92eb0c5ee0e0d536a988e60fa898cb37d34331b84cc6ff42509ea8 | dalaing/little-languages | Message.hs | # LANGUAGE ScopedTypeVariables #
module Type.Error.Message where
import Data.Maybe (fromMaybe)
import Data.Foldable (asum)
import Data.Bitraversable
import Control.Lens (preview)
import qualified Data.Set as S
import Text.Trifecta.Rendering
import Text.Trifecta.Result
import Text.PrettyPrint.ANSI.Leijen hiding ((<... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/multityped/nb-srcloc/src/Type/Error/Message.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Type.Error.Message where
import Data.Maybe (fromMaybe)
import Data.Foldable (asum)
import Data.Bitraversable
import Control.Lens (preview)
import qualified Data.Set as S
import Text.Trifecta.Rendering
import Text.Trifecta.Result
import Text.PrettyPrint.ANSI.Leijen hiding ((<... | |
46889fbbb2b2e908d25ec4a7079f9ae0dbecfcab6be2bb3b9988a8eb9c7445eb | input-output-hk/plutus-apps | Schema.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE OverloadedLabels #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/d637b1916522e4ec20b719487a8a2e066937aceb/plutus-contract/src/Plutus/Contract/Schema.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
| Given a schema 's', 'Input s' is the 'Row' type of the inputs that
contracts with this schema accept. See [Contract Schema]
|... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedLabels #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableSuperClasses #
# OPTIONS_GHC -fn... |
485dd829c51cbfc0c6f88fad735f6301c6b22de838919068c8731aff1b701019 | Kappa-Dev/KappaTools | KaSa.ml | *
* main.ml
* openkappa
* , projet Abstraction / Antique , INRIA Paris - Rocquencourt
*
* Creation : December , the 18th of 2010
* Last modification : Time - stamp : < May 03 2018 >
* *
*
* Copyright 2010,2011 Institut National de Recherche en Informatique et
* en Automatique . All rig... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/KaSa_rep/main/KaSa.ml | ocaml | -----------------------------------------------------------------------
WORK IN PROCESS:
--------------------------------------------------------------------
-----------------------------------------------------------------------
-----------------------------------------------------------------------
------------------... | *
* main.ml
* openkappa
* , projet Abstraction / Antique , INRIA Paris - Rocquencourt
*
* Creation : December , the 18th of 2010
* Last modification : Time - stamp : < May 03 2018 >
* *
*
* Copyright 2010,2011 Institut National de Recherche en Informatique et
* en Automatique . All rig... |
97091fb160a26dfcff703dbb54939b02883833ea57d3fb8d7ecf1b92a6c48fb8 | huangz1990/SICP-answers | test-3-bigger-sum-of-squares.scm | (load "test-manager/load.scm")
(load "3-bigger-sum-of-squares.scm")
(define-each-check
(= (+ (square 3) (square 6))
(bigger-sum-of-squares 1 3 6))
(= (+ (square 4) (square 10))
(bigger-sum-of-squares 4 2 10))
)
(run-registered-tests)
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/test-3-bigger-sum-of-squares.scm | scheme | (load "test-manager/load.scm")
(load "3-bigger-sum-of-squares.scm")
(define-each-check
(= (+ (square 3) (square 6))
(bigger-sum-of-squares 1 3 6))
(= (+ (square 4) (square 10))
(bigger-sum-of-squares 4 2 10))
)
(run-registered-tests)
| |
1f91ed6533d3114f18d82744180407bf2de9e34e4294739eaece69513acb2e51 | yav/haskell-lexer | RegExp.hs | module RegExp where
--import List
import MUtils(usort)
infixl 2 !,-!,:!,:-!
infixr 3 &,:&
{-+ Transitions for transducers: -}
data Trans i o = I i | O o deriving (Show,Eq,Ord)
type Transducer i o = RegExp (Trans i o)
{-+ Regular expressions: -}
data RegExp t
= One -- the language containing the empty string, unit... | null | https://raw.githubusercontent.com/yav/haskell-lexer/357df3d88fa6638703126ad6178380386944819e/generator/src/RegExp.hs | haskell | import List
+ Transitions for transducers:
+ Regular expressions:
the language containing the empty string, unit of :&
the empty language, unit of :!
a single symbol
sequence (associative)
alternative (cummutative and associative)
difference
An experimental extension with a fix-point operator:
+ Some convenien... | module RegExp where
import MUtils(usort)
infixl 2 !,-!,:!,:-!
infixr 3 &,:&
data Trans i o = I i | O o deriving (Show,Eq,Ord)
type Transducer i o = RegExp (Trans i o)
data RegExp t
sequence of zero or more
sequence of one or more
| Fix (RegExp t)
| Self
deriving (Eq,Ord,Show)
e = One
z = Zero
t ... |
d01d2d30faec88229ac5e94438843dde62c5a89eb50382eac2ce5ee59aed93e4 | onedata/op-worker | atm_range_store_test_SUITE.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Tests of automation range store.
%... | null | https://raw.githubusercontent.com/onedata/op-worker/8df431e94ab05504fe1d8ce81934f18726c765f4/test_distributed/suites/automation/store/atm_range_store_test_SUITE.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Tests of automation range store.
@end
-------------------------------------------------------------------
exported for CT
tests
========================================... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(atm_range_store_test_SUITE).
-author("Bartosz Walkowicz").
-include("modules/automation/atm_execution.hrl").
-include("modules/datastore/datastore_models.hrl").
-include("modules/datastore/... |
f72845a50049b760439b73a86aebc27e09c1b74f0e72285f91b3326c8b67d274 | SimulaVR/godot-haskell | VisualScriptPropertySet.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualScriptPropertySet
(Godot.Core.VisualScriptProp... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/VisualScriptPropertySet.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualScriptPropertySet
(Godot.Core.VisualScriptProp... | |
9c000fc253dfc278705eef6f769223df4d4c8cb79a075fa954a3eb111851ee97 | NaaS/motto | icl_transformations.ml |
Program transformations related to the ICL runtime .
, Cambridge University Computer Lab , October 2015
Use of this source code is governed by the Apache 2.0 license ; see LICENSE
Program transformations related to the ICL runtime.
Nik Sultana, Cambridge University Computer Lab, October 2015
... | null | https://raw.githubusercontent.com/NaaS/motto/8ff3eba534be816d861dcfced93b68d593a12e2b/back-end/icl_transformations.ml | ocaml | { st with next_symbol = 1 + st.next_symbol }
NOTE currently we don't recurse into expressions within state_decls
and excepts_decls
We rewrite a process declaration into a specific type of function
declaration
the function signature is
transformed duri... |
Program transformations related to the ICL runtime .
, Cambridge University Computer Lab , October 2015
Use of this source code is governed by the Apache 2.0 license ; see LICENSE
Program transformations related to the ICL runtime.
Nik Sultana, Cambridge University Computer Lab, October 2015
... |
3e8eca94d991b2248f8eecc4bef7904107322550d8ba650f5c53bdb4961c69bc | haroldcarr/learn-haskell-coq-ml-etc | InteractWith.hs | import System.Environment (getArgs)
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
main = mainWith myFunction
where mainWith function = do
args <- getArgs
case args of
[input,output] -> interac... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/book/2009-Real_World_Haskell/InteractWith.hs | haskell | String -> String
replace "id" with the name of the function | import System.Environment (getArgs)
interactWith function inputFile outputFile = do
input <- readFile inputFile
writeFile outputFile (function input)
main = mainWith myFunction
where mainWith function = do
args <- getArgs
case args of
[input,output] -> interac... |
63bcbfba8e0ca51f18101d76f9883951b2a05efeeee708c49bc77be58420a74f | haskell/cabal | D.hs | module D where
import C
d = c
| null | https://raw.githubusercontent.com/haskell/cabal/c66a1260f86c9c2f16dc319604f766fd8f756045/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/src/D.hs | haskell | module D where
import C
d = c
| |
a7d7e7ac07a231de0407e628a7ac3acc20a50289f2920ed2bb6f9fd5ab03cd7b | johnlawrenceaspden/hobby-code | tryc.clj | ;; I often find that the default behaviour of exceptions in emacs/slime is a bit
;; annoying.
;; Up pops up a debugger window, but that moves the focus away from where
;; you're working, and the new window then needs dismissing, and has often
;; buggered up the size of other windows, etc...
;; Also when playing with ... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/tryc.clj | clojure | I often find that the default behaviour of exceptions in emacs/slime is a bit
annoying.
Up pops up a debugger window, but that moves the focus away from where
you're working, and the new window then needs dismissing, and has often
buggered up the size of other windows, etc...
Also when playing with experimental c... |
(defmacro tryc[ & e]
`(try ~@e
(catch Exception a# a#)))
|
59eda9b15b12fa0e30cf271bfb4d9da35c7559b9b2b49f3d4d865b704fd7366c | mirage/irmin-rpc | common.ml | module Server = Irmin_mem.KV.Make (Irmin.Contents.String)
module RPC =
Irmin_rpc.Make
(Server)
(Irmin_rpc.Config.Remote.None (Server))
(Irmin_rpc.Config.Pack.None (Server))
(** API changes to ease test-writing. Might want to upstream these at some
point. *)
module Client = struct
include RPC.Client... | null | https://raw.githubusercontent.com/mirage/irmin-rpc/e85663194efa049a44238522f1310387b4525249/test/common.ml | ocaml | * API changes to ease test-writing. Might want to upstream these at some
point.
* Extended [TESTABLE]s for store types.
TODO: upstream these equality functions to Capnp_rpc
* Helpers for constructing data.
* Tree with a single child. | module Server = Irmin_mem.KV.Make (Irmin.Contents.String)
module RPC =
Irmin_rpc.Make
(Server)
(Irmin_rpc.Config.Remote.None (Server))
(Irmin_rpc.Config.Pack.None (Server))
module Client = struct
include RPC.Client.Store
let of_branch = Fun.flip of_branch
end
module Alcotest = struct
let of_typ (... |
51e181222b020ef4a52456766f3be8bf32820b508a80ea0028ecb9de5ebf2369 | yetibot/yetibot | formatters.clj | (ns yetibot.commands.aws.formatters
(:require
[clojure.spec.alpha :as s]
[cognitect.aws.client.api :as aws]
[yetibot.commands.aws.specs :as aws.spec]
[yetibot.api.aws]))
(def iam-response-spec (partial aws/response-spec-key yetibot.api.aws/iam))
; AWS API response formatting utility function
(defmul... | null | https://raw.githubusercontent.com/yetibot/yetibot/2fb5c1182b1a53ab0e433d6bab2775ebd43367de/src/yetibot/commands/aws/formatters.clj | clojure | AWS API response formatting utility function | (ns yetibot.commands.aws.formatters
(:require
[clojure.spec.alpha :as s]
[cognitect.aws.client.api :as aws]
[yetibot.commands.aws.specs :as aws.spec]
[yetibot.api.aws]))
(def iam-response-spec (partial aws/response-spec-key yetibot.api.aws/iam))
(defmulti format-response
"Returns a dispatc... |
e745264fb24d15aa2a7cdeeafd1019f3102c9a1bb93b9384b603c6318c3b5ecb | reifyhealth/src-munch | core.cljs | (ns reifyhealth.src-munch.core
"Functions that parse development artifacts to produce consumable clojure EDN"
(:require [reifyhealth.src-munch.gallery.colors.parse :as gallery-colors]
[reifyhealth.src-munch.gallery.icons.parse :as gallery-icons]))
(def parse-colors gallery-colors/parse)
(def parse-ico... | null | https://raw.githubusercontent.com/reifyhealth/src-munch/aae08f87aded89750ea8c53cc92754d16dd906ac/src/reifyhealth/src_munch/core.cljs | clojure | (ns reifyhealth.src-munch.core
"Functions that parse development artifacts to produce consumable clojure EDN"
(:require [reifyhealth.src-munch.gallery.colors.parse :as gallery-colors]
[reifyhealth.src-munch.gallery.icons.parse :as gallery-icons]))
(def parse-colors gallery-colors/parse)
(def parse-ico... | |
fbc1ab7de59491969580cd4862c171f2d0c1170600b9c5a47294a91cef092295 | THISISDINOSAUR/Anatomy | a-maths.rkt | #lang br
(provide (matching-identifiers-out #rx"^a-" (all-defined-out)))
(require "../structs/point.rkt")
(define-macro-cases a-sum
[(_ VAL) #'VAL]
[(_ LEFT "+" RIGHT) #'(+ LEFT RIGHT)]
[(_ LEFT "-" RIGHT) #'(- LEFT RIGHT)])
(define-macro-cases a-product
[(_ VAL) #'VAL]
[(_ LEFT "*" RIGHT) #'(* LEFT RIGHT... | null | https://raw.githubusercontent.com/THISISDINOSAUR/Anatomy/883aa140c41cd375575a2944bda79608c660935b/expander/a-maths.rkt | racket | #lang br
(provide (matching-identifiers-out #rx"^a-" (all-defined-out)))
(require "../structs/point.rkt")
(define-macro-cases a-sum
[(_ VAL) #'VAL]
[(_ LEFT "+" RIGHT) #'(+ LEFT RIGHT)]
[(_ LEFT "-" RIGHT) #'(- LEFT RIGHT)])
(define-macro-cases a-product
[(_ VAL) #'VAL]
[(_ LEFT "*" RIGHT) #'(* LEFT RIGHT... | |
289a71492426486e62f35ea0084b71b96353589f3d6334d4ac3533eac3122a47 | alpmestan/servant | StaticFiles.hs | -- | This module defines a sever-side handler that lets you serve static files.
--
-- - 'serveDirectory' lets you serve anything that lives under a particular
-- directory on your filesystem.
module Servant.Utils.StaticFiles (
serveDirectory,
) where
import Filesystem.Path.CurrentOS (decodeString)
import Network.... | null | https://raw.githubusercontent.com/alpmestan/servant/d67b5e1f3e9af4b249f95ed72dcaebc4ce328a96/servant/src/Servant/Utils/StaticFiles.hs | haskell | | This module defines a sever-side handler that lets you serve static files.
- 'serveDirectory' lets you serve anything that lives under a particular
directory on your filesystem.
| Serve anything under the specified directory as a 'Raw' endpoint.
@
server :: Server MyApi
server = serveDirectory "\/var\/www... | module Servant.Utils.StaticFiles (
serveDirectory,
) where
import Filesystem.Path.CurrentOS (decodeString)
import Network.Wai.Application.Static
import Servant.API.Raw
import Servant.Server
type MyApi = " static " :> Raw
and send an appropriate /Content - header if possible .
If your goal is to serve HTML ,... |
5b69e034b3a646c7abc18940691f6fb65c1e687988f7fe63cef0266e6c9ea21e | clojure-interop/aws-api | AmazonWorkMailAsync.clj | (ns com.amazonaws.services.workmail.AmazonWorkMailAsync
"Interface for accessing Amazon WorkMail asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not directly i... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.workmail/src/com/amazonaws/services/workmail/AmazonWorkMailAsync.clj | clojure | (ns com.amazonaws.services.workmail.AmazonWorkMailAsync
"Interface for accessing Amazon WorkMail asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not directly i... | |
a6d3c7eb120359d5f14942f948ea7ea90d3c01a04122d5b8f8c96c272975a5ec | Gbury/ocaml-memgraph | example.ml |
let f x = x + 1
let g x y z = x+y+z
let g1 = g 5
let g2 = g 7
let g3 = g1 42
let env =
let h = Hashtbl.create 5 in
let h' = Hashtbl.create 13 in
(fun (y : int) (z: int) -> Hashtbl.find h y + Hashtbl.find h' z)
let rec h x1 x2 x3 = i x1 x2 x3
and i y1 y2 y3 = j y1 y2 y3
and j z1 z2 z3 = h z1 z2 z3
let... | null | https://raw.githubusercontent.com/Gbury/ocaml-memgraph/ae480ee30fee3658362c5d28b918f6660863cd87/examples/closure/example.ml | ocaml |
let f x = x + 1
let g x y z = x+y+z
let g1 = g 5
let g2 = g 7
let g3 = g1 42
let env =
let h = Hashtbl.create 5 in
let h' = Hashtbl.create 13 in
(fun (y : int) (z: int) -> Hashtbl.find h y + Hashtbl.find h' z)
let rec h x1 x2 x3 = i x1 x2 x3
and i y1 y2 y3 = j y1 y2 y3
and j z1 z2 z3 = h z1 z2 z3
let... | |
eb7a31c8296e808fc6006a70993cb35889187a97b627e2c07255a618f6e48722 | AshleyYakeley/Truth | OneSidedTypeVars.hs | module Language.Expression.Dolan.Simplify.OneSidedTypeVars
( eliminateOneSidedTypeVars
) where
import Data.Shim
import Language.Expression.Common
import Language.Expression.Dolan.Bisubstitute
import Language.Expression.Dolan.PShimWit
import Language.Expression.Dolan.Simplify.VarUses
import Language.Expression.... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/4440fb14943e8a6ff02e760261918b1c9c535e3f/Pinafore/typed-expression/lib/Language/Expression/Dolan/Simplify/OneSidedTypeVars.hs | haskell | module Language.Expression.Dolan.Simplify.OneSidedTypeVars
( eliminateOneSidedTypeVars
) where
import Data.Shim
import Language.Expression.Common
import Language.Expression.Dolan.Bisubstitute
import Language.Expression.Dolan.PShimWit
import Language.Expression.Dolan.Simplify.VarUses
import Language.Expression.... | |
79a7dff5117142d90d7c80e7642601a1dcd061ff6de851036d4023592b376dca | felipeZ/Haskell-abinitio | IntegralsEvaluation.hs | # Language BangPatterns , ViewPatterns #
|
Module : Science . QuantumChemistry . Integrals . IntegralsEvaluation
Description : Analytical evaluation of the overlap , core , nuclei - electron
and electron - electron integrals .
Command line checkers
Copyright : @2013 ,
The... | null | https://raw.githubusercontent.com/felipeZ/Haskell-abinitio/c019bc37c8de78affddf97eb858c1ef18af76d83/Science/QuantumChemistry/Integrals/IntegralsEvaluation.hs | haskell | (
(|>)
,(<|)
,(|>>)
,(<<|)
,(<<||>>)
,Operator(..)
,contracted4Centers
,evalIntbykey
,hcore
)
=================> Internal Modules <======================
=================================================================================================
== the Monad List are used to calculate the elements ... | # Language BangPatterns , ViewPatterns #
|
Module : Science . QuantumChemistry . Integrals . IntegralsEvaluation
Description : Analytical evaluation of the overlap , core , nuclei - electron
and electron - electron integrals .
Command line checkers
Copyright : @2013 ,
The... |
5098d6c3c470a1453d800eeb17b3c0bb18b8bb96d6ba88167d223c7f2c6584cf | input-output-hk/plutus-apps | Example1.hs | module Main where
import Cardano.Api qualified
import Cardano.Streaming (ChainSyncEvent (RollBackward, RollForward), withChainSyncEventStream)
import Common (Options (Options, optionsChainPoint, optionsNetworkId, optionsSocketPath), parseOptions)
import Data.Aeson.Text qualified as Aeson
import Data.Text.Lazy qualifie... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/56f80febe170e299e2aa765899332309912b7c22/cardano-streaming/examples/Example1.hs | haskell |
Main
| module Main where
import Cardano.Api qualified
import Cardano.Streaming (ChainSyncEvent (RollBackward, RollForward), withChainSyncEventStream)
import Common (Options (Options, optionsChainPoint, optionsNetworkId, optionsSocketPath), parseOptions)
import Data.Aeson.Text qualified as Aeson
import Data.Text.Lazy qualifie... |
c52d188ab7d5a435822ca1d2ea5385fb600a8b10c96f13899a77add8e588bd13 | ocaml-community/lambda-term | lTerm_history.ml |
* lTerm_history.ml
* ----------------
* Copyright : ( c ) 2012 , < >
* Licence : BSD3
*
* This file is a part of Lambda - Term .
* lTerm_history.ml
* ----------------
* Copyright : (c) 2012, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Lambda-Term.
*)
let return, (>... | null | https://raw.githubusercontent.com/ocaml-community/lambda-term/f6b1940863e94d437a0578e19076a342bc9b5a70/src/lTerm_history.ml | ocaml | A node contains an entry of the history.
When set, the cache is equal to the list of entries, from the
most recent to the oldest.
Check that [size1 + size2 < limit], handling overflow.
Remove the oldest entry of history, precondition: the history
contains at least one entry.
Make [last] become the end ... |
* lTerm_history.ml
* ----------------
* Copyright : ( c ) 2012 , < >
* Licence : BSD3
*
* This file is a part of Lambda - Term .
* lTerm_history.ml
* ----------------
* Copyright : (c) 2012, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Lambda-Term.
*)
let return, (>... |
cccae98d236be453e8c737bf8e272d269f2d33ebff25917843d70101745e6997 | mayconamaro/ringell | Gen.hs | module Gen where
import Test.QuickCheck
import Control.Monad
import ExpR
import qualified ExpL as L
import SizedType
import Unroll (transform, tsl')
type Context = [(String, Type)] -- (name, sized type)
fromIntToNat :: Int -> Nat
fromIntToNat x
| x > 0 = TSuc (fromIntToNat (x-1))
| otherwise = TZero
gen... | null | https://raw.githubusercontent.com/mayconamaro/ringell/4c55645c34cd5833f32fb799caa31240bd0fa587/Property-based%20tests/test/Gen.hs | haskell | (name, sized type)
generatorSoundAlternative :: Property
generatedProgramsTerminationAlternative :: Property
generatedProgramsTerminationAlternative = forAll (arbitrary :: Gen ExpR) (\e -> isValue (eval e))
If original program terminates with value v using at most f recursive calls
then the transformed program wi... | module Gen where
import Test.QuickCheck
import Control.Monad
import ExpR
import qualified ExpL as L
import SizedType
import Unroll (transform, tsl')
fromIntToNat :: Int -> Nat
fromIntToNat x
| x > 0 = TSuc (fromIntToNat (x-1))
| otherwise = TZero
genIndex :: Int -> Gen Nat
genIndex r
= do
i <- cho... |
298ab40d64b418eec710010e5e84fa89ecf6576a7c1bcb9673e8141c87acc14e | links-lang/links | mixingQuery.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * mixingQuery.mli * *
* * * * ... | null | https://raw.githubusercontent.com/links-lang/links/f6f164fea48c843bc0bd692cf0a71d46c346e14a/core/query/mixingQuery.mli | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * mixingQuery.mli * *
* * * * ... | |
c024b7d53d1fa5ed0b99f89981c9c0bf49e15dde21a2496ecb21cef5565b3cbc | exercism/common-lisp | utils.lisp | (in-package :stubs)
(defun relative-directory (&rest dirs)
(make-pathname :directory `(:relative ,@dirs)))
(defun file-in-dir (dir file) (merge-pathnames file dir))
(defun subdir (parent dir) (merge-pathnames (relative-directory dir) parent))
(defun recursive-listing (directory)
(directory (merge-pathnames
... | null | https://raw.githubusercontent.com/exercism/common-lisp/950c21d2a96b6bf87824fb8f6b935f89b02a33b1/src/ex-maint-utils/stubs/utils.lisp | lisp | (in-package :stubs)
(defun relative-directory (&rest dirs)
(make-pathname :directory `(:relative ,@dirs)))
(defun file-in-dir (dir file) (merge-pathnames file dir))
(defun subdir (parent dir) (merge-pathnames (relative-directory dir) parent))
(defun recursive-listing (directory)
(directory (merge-pathnames
... | |
f85d2656a2094ac985cdc008c8f41bce4fcdba7820e7d3d863c477648262182b | SamB/coq | system.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/lib/system.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Expanding shell variables and home-... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ Id$
open Pp
open Util
... |
f4f422af90c949f8906cd4ff0fdd185a5e7efa3250502492b3101692f1a931c0 | purerl/purerl | Optimizer.hs | -- |
-- This module optimizes code in the simplified-Erlang intermediate representation.
--
-- The following optimizations are supported:
--
* Inlining of ( > > =) and ret for the Eff monad
--
module Language.PureScript.Erl.CodeGen.Optimizer (optimize) where
import Prelude.Compat
import Control.Monad.Supply.Class ... | null | https://raw.githubusercontent.com/purerl/purerl/d4c933b36dfaed8f4ae4e07a8806cf8a822885f4/src/Language/PureScript/Erl/CodeGen/Optimizer.hs | haskell | |
This module optimizes code in the simplified-Erlang intermediate representation.
The following optimizations are supported:
|
|
Take all top-level ASTs and return a function for expanding top-level
variables during the various inlining steps in `optimize`.
Everything that gets inlined as an optimization ... | * Inlining of ( > > =) and ret for the Eff monad
module Language.PureScript.Erl.CodeGen.Optimizer (optimize) where
import Prelude.Compat
import Control.Monad.Supply.Class (MonadSupply)
import Language.PureScript.Erl.CodeGen.AST
( everywhereOnErl, Erl(..), pattern EApp, Atom )
import Language.PureScript.Erl.Co... |
677209dc2fd7744b481ec7a81b22a6bd611180b039acdc72033749989fc25ad2 | tnelson/Forge | info.rkt | #lang setup/infotab
(define collection 'multi)
(define deps '(
;; these are what the package system tells me I need:
"base"
"net-lib"
"rackunit-lib"
"web-server-lib"
)) | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/racket-rfc6455/info.rkt | racket | these are what the package system tells me I need: | #lang setup/infotab
(define collection 'multi)
(define deps '(
"base"
"net-lib"
"rackunit-lib"
"web-server-lib"
)) |
eaeceae56e7fca5d2b1a08e0c8c884e39c570db319e7ea9251fbc1a2462331f6 | yrashk/socket.io-erlang | socketio_http_misultin.erl | -module(socketio_http_misultin).
-behaviour(socketio_http_server).
-export([start_link/1, file/2, respond/2, respond/3, respond/4, parse_post/1, headers/2, chunk/2, stream/2,
socket/1, get_headers/1, websocket_send/2, ensure_longpolling_request/1]).
start_link(Opts) ->
Port = proplists:get_value(port, Opt... | null | https://raw.githubusercontent.com/yrashk/socket.io-erlang/7a6c768a28cf18d58efd7abe0eb276a22dbc7974/src/socketio_http_misultin.erl | erlang | FIXME: pass it through to the end user? | -module(socketio_http_misultin).
-behaviour(socketio_http_server).
-export([start_link/1, file/2, respond/2, respond/3, respond/4, parse_post/1, headers/2, chunk/2, stream/2,
socket/1, get_headers/1, websocket_send/2, ensure_longpolling_request/1]).
start_link(Opts) ->
Port = proplists:get_value(port, Opt... |
9033eb1d4e393b677cd61ed4b8ba5ff5d194d637bd48288507ec2b88e17fc048 | dmbarbour/awelon | Setup.hs | import Distribution.Simple
main = defaultMain
| null | https://raw.githubusercontent.com/dmbarbour/awelon/af9124654dd9462cc4887dccf67b3e33302c7351/Setup.hs | haskell | import Distribution.Simple
main = defaultMain
| |
1ef41e8c2f50080880b773b7b44443861ba5cfdfd175f7a05a4886a7684c9a08 | ghollisjr/cl-ana | lfields-test.lisp | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
;;;;
This file is part of cl - ana .
;;;;
;;;; cl-ana is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the Li... | null | https://raw.githubusercontent.com/ghollisjr/cl-ana/5cb4c0b0c9c4957452ad2a769d6ff9e8d5df0b10/makeres-table/tests/lfields-test.lisp | lisp |
cl-ana is free software: you can redistribute it and/or modify it
(at your option) any later version.
cl-ana is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License... | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
This file is part of cl - ana .
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
... |
3e132b564fc544c6522bbc0dd5b8fcfc76f9d2e0f3eac88b7d57bd71ae1149d9 | Deducteam/CoqInE | tunivs.mli |
val translate_all_universes : Info.info -> UGraph.t -> unit
| null | https://raw.githubusercontent.com/Deducteam/CoqInE/c38cca7fa27ee56c3ab2e8712d904b1620f8546d/src/tunivs.mli | ocaml |
val translate_all_universes : Info.info -> UGraph.t -> unit
| |
ac8271975b156fee619fcf26c78fb6598026066f9c226fefffcff065f3aa960a | furkan3ayraktar/clojure-polylith-realworld-example-app | interface.clj | (ns clojure.realworld.user.interface
(:require [clojure.realworld.user.core :as core]
[clojure.realworld.user.store :as store]))
(defn login! [login-input]
(core/login! login-input))
(defn register! [register-input]
(core/register! register-input))
(defn user-by-token [token]
(core/user-by-token ... | null | https://raw.githubusercontent.com/furkan3ayraktar/clojure-polylith-realworld-example-app/2f16552fb4e9a56e24e21795cbb038433085453c/components/user/src/clojure/realworld/user/interface.clj | clojure | (ns clojure.realworld.user.interface
(:require [clojure.realworld.user.core :as core]
[clojure.realworld.user.store :as store]))
(defn login! [login-input]
(core/login! login-input))
(defn register! [register-input]
(core/register! register-input))
(defn user-by-token [token]
(core/user-by-token ... | |
a9566fce41b9528c9b0f7a330452554cb1c5de8c8b2b0154cad6e49776488a20 | roburio/ocaml-openpgp | signature_packet.ml | open Types
open Rresult
type signature_asf =
| RSA_sig_asf of { m_pow_d_mod_n : mpi } (* PKCS1-*)
| DSA_sig_asf of { r: mpi; s: mpi; }
let pp_signature_asf fmt sig_asf =
Fmt.pf fmt "%s" @@ match sig_asf with
| RSA_sig_asf _ -> "RSA signature"
| DSA_sig_asf _ -> "DSA signature"
type signature_subpacket =
... | null | https://raw.githubusercontent.com/roburio/ocaml-openpgp/55459ad98a69f80789c79219c6d3be19ef6ef521/lib/signature_packet.ml | ocaml | PKCS1-
[t] and [signature_subpacket] are mutually
recursive due to Embedded_signature containing
its own [t]. we store the Cs.t and defer
parsing to a later point.
This implementation ignores "unhashed subpacket da... | open Types
open Rresult
type signature_asf =
| DSA_sig_asf of { r: mpi; s: mpi; }
let pp_signature_asf fmt sig_asf =
Fmt.pf fmt "%s" @@ match sig_asf with
| RSA_sig_asf _ -> "RSA signature"
| DSA_sig_asf _ -> "DSA signature"
type signature_subpacket =
| Signature_creation_time of Ptime.t
| Signature_expi... |
24f00dd9a9157b020a1a2a8e2d42f20129f31a9e04f5368d8cb74bd51cdcc03d | dennismckinnon/Ethereum-Contracts | Doug-v4.lsp |
;
;Default Behaviour: If a name has not been registered before, Automatically accept
; If "ACL" has not been registered yet, Automatically accept
;Usage:
;API
;Check Name - Permission needed: 0
; - Form: "check" "Name"
- Returns : 0 ( DNE ) , 0xContractAddress
;Get DB Size - Permission needed:... | null | https://raw.githubusercontent.com/dennismckinnon/Ethereum-Contracts/25b5e7037da382dd95a1376fad81f936f6610b36/DOUG-v4%20%2B%20ACL/Doug-v4.lsp | lisp |
Default Behaviour: If a name has not been registered before, Automatically accept
If "ACL" has not been registered yet, Automatically accept
Usage:
API
Check Name - Permission needed: 0
- Form: "check" "Name"
Get DB Size - Permission needed: 0
- Form: "dbsize"
- Returns: # of entries
Data Dump... |
- Returns : 0 ( DNE ) , 0xContractAddress
- Returns : 1 ( Is Known ) , 0 ( Not )
Register Name - Permission needed : 1
- Returns : 1 ( Success ) , 0 ( Failure )
Bi - Directional in order to future proof incase deletions are someday
This version of will store a history of every contract whi... |
9e4ab6aeb420752a525cf559cbfba0a96fc97ad08a6e03c4cd3326bddb5884bc | arielnetworks/cl-markup | util.lisp | (in-package :cl-markup)
(defvar *auto-escape* t)
(defun map-group-if (pred list fn)
(loop
while list
for cur = (pop list)
for cur-res = (funcall pred cur)
append
(let ((res (nreverse
(loop with acc = (list cur)
while list
for x = (pop l... | null | https://raw.githubusercontent.com/arielnetworks/cl-markup/e0eb7debf4bdff98d1f49d0f811321a6a637b390/src/util.lisp | lisp | ") | (in-package :cl-markup)
(defvar *auto-escape* t)
(defun map-group-if (pred list fn)
(loop
while list
for cur = (pop list)
for cur-res = (funcall pred cur)
append
(let ((res (nreverse
(loop with acc = (list cur)
while list
for x = (pop l... |
ed4d969a5fd862927a7dbe95536241d54bba1e6e748b57c4c5cecb1526a719e2 | grimmelm/littleton | semantics.mli | open Term
open Common
open Event
module type SEMANTICS = sig
module U : TERM
module N : TERM
type t [@@deriving sexp]
type term = U.t [@@deriving sexp]
type named_term = N.t [@@deriving sexp]
val init : t
val unlift : t -> term
val owns : t -> person -> t
val occurs : t -> event -> t
val conv... | null | https://raw.githubusercontent.com/grimmelm/littleton/efa8c90ae13b3965c81876723f6622f6d0319e80/lib/semantics.mli | ocaml | open Term
open Common
open Event
module type SEMANTICS = sig
module U : TERM
module N : TERM
type t [@@deriving sexp]
type term = U.t [@@deriving sexp]
type named_term = N.t [@@deriving sexp]
val init : t
val unlift : t -> term
val owns : t -> person -> t
val occurs : t -> event -> t
val conv... | |
1a5b8ba9bdfaa12f29396d2a8605fbfacf08c0d650313ad600205f33c0038736 | nikita-volkov/hasql | Encoders.hs | -- |
-- A DSL for declaration of query parameter encoders.
module Hasql.Private.Encoders where
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Hasql.Private.Encoders.Array as Array
import qualified Hasql.Private.Encoders.Params as Params
import qualified Ha... | null | https://raw.githubusercontent.com/nikita-volkov/hasql/bd5cc3dc0fe556703a758def844a369f7d6f5756/library/Hasql/Private/Encoders.hs | haskell | |
A DSL for declaration of query parameter encoders.
* Parameters Product Encoder
|
Encoder of some representation of a parameters product.
which you can use to compose multiple parameters together.
E.g.,
@
someParamsEncoder =
@
consider the functions of the @contrazip@ family
E.g., here's how you can ac... | module Hasql.Private.Encoders where
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Hasql.Private.Encoders.Array as Array
import qualified Hasql.Private.Encoders.Params as Params
import qualified Hasql.Private.Encoders.Value as Value
import qualified Hasql.... |
ccd9acddcc67bb7dac1253311b47fb158bbfda4021d11d65204e4424e2159c51 | lambdacube3d/lambdacube-gl | pickInt.hs | # LANGUAGE PackageImports , LambdaCase , OverloadedStrings , StandaloneDeriving , ViewPatterns #
import Control.Monad
import Data.Aeson
import Data.Vect (Mat4(..), Vec3(..), Vec4(..))
import Graphics.GL.Core33 as GL
import Lambd... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-gl/bcd2c642d1282646d0022fc0da1d2ccaa7b40ab4/examples/pickInt.hs | haskell | --------------------------------------------------
See: -started
--------------------------------------------------
setup render data
check schema compatibility
update graphics input
should be fb 0 fb 1 (pick)
black 0
render to render texture
render to framebuffer & pick
geo... | # LANGUAGE PackageImports , LambdaCase , OverloadedStrings , StandaloneDeriving , ViewPatterns #
import Control.Monad
import Data.Aeson
import Data.Vect (Mat4(..), Vec3(..), Vec4(..))
import Graphics.GL.Core33 as GL
import Lambd... |
7d4f8b59fc29179c704c3d5695a0004bf8a8722449035daf0dc92f6a13e7f48c | dbousamra/imgui-haskell | Imgui.hs | module ImGui (
module ImGui.Internal.Bindings
) where
import ImGui.Internal.Bindings
| null | https://raw.githubusercontent.com/dbousamra/imgui-haskell/d27cb756c50cb2040d04b1699995b928cca445ff/src/Imgui.hs | haskell | module ImGui (
module ImGui.Internal.Bindings
) where
import ImGui.Internal.Bindings
| |
c75aa264dc7ad7412e7c108fdcaf88fef54732e7e9b143fe8f92276666ce031a | Bogdanp/racket-redis | easy.rkt | #lang racket/base
(require (for-syntax racket/base
racket/provide-transform
syntax/stx)
racket/contract
"private/client.rkt"
"private/error.rkt"
"private/pool.rkt"
"private/script.rkt")
(define/contract current-redis-client
(para... | null | https://raw.githubusercontent.com/Bogdanp/racket-redis/0f6c1a723f25f40dd9c6f682dee30fa8a9288f86/redis-lib/easy.rkt | racket | connection commands
geo commands
hash commands
hyperloglog commands
key commands
list commands
pubsub commands
script commands
server commands
set commands
sorted set commands
stream commands
bytestring commands | #lang racket/base
(require (for-syntax racket/base
racket/provide-transform
syntax/stx)
racket/contract
"private/client.rkt"
"private/error.rkt"
"private/pool.rkt"
"private/script.rkt")
(define/contract current-redis-client
(para... |
ffb3c4c1c81dbe312b72830f603d02f19b67db91d1dbb2736d89449e15983194 | kushidesign/kushi | clean.cljs | (ns ^:dev/always kushi.clean
(:require [clojure.string :as string]))
;; This a toggle for debugging while developing kushi itself
(def log-clean? false)
(defn log-cleaning-summary!
[rules rules-len sheet-id]
(let [log-msg (if (pos? rules-len)
(str "Deleting " rules-len " rule(s) in stylesheet ... | null | https://raw.githubusercontent.com/kushidesign/kushi/5f0b220beaa67624821a5f2bd174e5649b0ffdc3/src/kushi/clean.cljs | clojure | This a toggle for debugging while developing kushi itself | (ns ^:dev/always kushi.clean
(:require [clojure.string :as string]))
(def log-clean? false)
(defn log-cleaning-summary!
[rules rules-len sheet-id]
(let [log-msg (if (pos? rules-len)
(str "Deleting " rules-len " rule(s) in stylesheet #" sheet-id " ...")
(str "No rules to delet... |
e72cc5c1c3dc63b71c09a3420f38cfda2cbc940e5fa9eef99bc90e9bff79a68c | composewell/unicode-data | PropList.hs | -- autogenerated from
-- |
Module : Unicode . Internal . . PropList
Copyright : ( c ) 2020 Composewell Technologies and Contributors
-- License : Apache-2.0
-- Maintainer :
-- Stability : experimental
{-# OPTIONS_HADDOCK hide #-}
module Unicode.Internal.Char.PropList
(isPattern_Syntax , isPatte... | null | https://raw.githubusercontent.com/composewell/unicode-data/3dac84295d5a0eaf620f33a7dab19943df84956b/unicode-data/lib/Unicode/Internal/Char/PropList.hs | haskell | autogenerated from
|
License : Apache-2.0
Maintainer :
Stability : experimental
# OPTIONS_HADDOCK hide # | Module : Unicode . Internal . . PropList
Copyright : ( c ) 2020 Composewell Technologies and Contributors
module Unicode.Internal.Char.PropList
(isPattern_Syntax , isPattern_White_Space , isWhite_Space)
where
import Data.Char (ord)
import Data.Word (Word8)
import GHC.Exts (Ptr(..))
import Unicode.Inter... |
852de7c1d2dcb4bc34f919dcec3601857c29380286ef679424a724810f0a5c60 | rbkmoney/cds | cds.erl | -module(cds).
-behaviour(supervisor).
-behaviour(application).
-include("cds.hrl").
%% Supervisor callbacks
-export([init/1]).
%% Application callbacks
-export([start/2]).
-export([stop/1]).
%% Storage operations
-export([get_cardholder_data/1]).
-export([put_card/1]).
-export([put_session/2]).
-export([get_sessio... | null | https://raw.githubusercontent.com/rbkmoney/cds/7daa88e44a95de6ba0404ff492344d73fae64a95/apps/cds/src/cds.erl | erlang | Supervisor callbacks
Application callbacks
Storage operations
Supervisor callbacks
Application callbacks
Storage operations
Internals
| -module(cds).
-behaviour(supervisor).
-behaviour(application).
-include("cds.hrl").
-export([init/1]).
-export([start/2]).
-export([stop/1]).
-export([get_cardholder_data/1]).
-export([put_card/1]).
-export([put_session/2]).
-export([get_session_data/1]).
-export([update_cardholder_data/2]).
-export([update_sessi... |
0561df151c9c6c63daa0157d3129b9297b661bedb851b63d03f684ce26d004c2 | singleheart/programming-in-haskell | ex10.hs | import Data.Char
positions :: Eq a => a -> [a] -> [Int]
positions x xs = [i | (x', i) <- zip xs [0 ..], x == x']
count :: Char -> String -> Int
count x xs = length [x' | x' <- xs, x == x']
alphabets :: [Char] -> Int
alphabets xs =
length [x | x <- xs, (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')]
let2int :: C... | null | https://raw.githubusercontent.com/singleheart/programming-in-haskell/80c7efc0425babea3cd982e47e121f19bec0aba9/ch05/ex10.hs | haskell | import Data.Char
positions :: Eq a => a -> [a] -> [Int]
positions x xs = [i | (x', i) <- zip xs [0 ..], x == x']
count :: Char -> String -> Int
count x xs = length [x' | x' <- xs, x == x']
alphabets :: [Char] -> Int
alphabets xs =
length [x | x <- xs, (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')]
let2int :: C... | |
c5b0194369be089083ff2701eb95246e77cdefc52a222f135da5af734cc508ee | samrat/ecstatic | utils.clj | (ns ecstatic.utils
(:use ring.adapter.jetty
ring.middleware.file
ring.util.response))
(defn serve-static-wrapper [output]
(defn serve-static [req]
(let [mime-types {".clj" "text/plain"
".mp4" "video/mp4"
".ogv" "video/ogg"}]
(if-let [f (file-re... | null | https://raw.githubusercontent.com/samrat/ecstatic/ee7e33eef6baec1a4f0b80453c1c477058e0a707/src/ecstatic/utils.clj | clojure | (ns ecstatic.utils
(:use ring.adapter.jetty
ring.middleware.file
ring.util.response))
(defn serve-static-wrapper [output]
(defn serve-static [req]
(let [mime-types {".clj" "text/plain"
".mp4" "video/mp4"
".ogv" "video/ogg"}]
(if-let [f (file-re... | |
85715f3083fb515a234b955312592fe9d5d00334625b1946f105c0a135ae0ad9 | chiroptical/book-of-monads | FinalStyle.hs | module FinalStyle where
-- Final Style
import Prelude hiding (writeFile)
class RandomGen m where
random :: Int -> Int -> m Int
class FS m where
writeFile :: FilePath -> String -> m (Either IOError ())
readFile :: FilePath -> m (Either IOError String)
-- Composition is straight forward, need interpretations f... | null | https://raw.githubusercontent.com/chiroptical/book-of-monads/c2eff1c67a8958b28cfd2001d652f8b68e7c84df/chapter14/src/FinalStyle.hs | haskell | Final Style
Composition is straight forward, need interpretations for `Monad m` | module FinalStyle where
import Prelude hiding (writeFile)
class RandomGen m where
random :: Int -> Int -> m Int
class FS m where
writeFile :: FilePath -> String -> m (Either IOError ())
readFile :: FilePath -> m (Either IOError String)
randomWrite :: (Monad m, FS m, RandomGen m) => FilePath -> m (Either IOEr... |
aac183d556c266782a7abc1a7e65ea94c16bd24b1e2f8b9f2234df4b4bfad40e | ocaml/oasis | MyOCamlbuildFindlib.ml | (******************************************************************************)
OASIS : architecture for building OCaml libraries and applications
(* *)
Copyright ( C ) 2011 - 2016 ,
Copyrig... | null | https://raw.githubusercontent.com/ocaml/oasis/3d1a9421db92a0882ebc58c5df219b18c1e5681d/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml | ocaml | ****************************************************************************
This library is free software; you can redistribute it and/or modify it
under the t... | OASIS : architecture for building OCaml libraries and applications
Copyright ( C ) 2011 - 2016 ,
Copyright ( C ) 2008 - 2011 , OCamlCore SARL
the Free Software Foundation ; either version 2.1 of the License , or ( at
You s... |
dd275df2d6ccb2d3f9331cc964520c97f45d3b8853db93f2d648fa839a350c12 | clash-lang/clash-compiler | HaskellPrelude.hs | |
Copyright : ( C ) 2019 , QBayLogic B.V.
( C ) 2021 , QBayLogic B.V.
License : BSD2 ( see the file LICENSE )
Maintainer : QBayLogic B.V < >
" Clash . HaskellPrelude " re - exports most of the " Prelude " with the
exception of those functions that the Clash API defi... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/62022223a035d62511d5d0dbc79f28074d68852e/clash-prelude/src/Clash/HaskellPrelude.hs | haskell | # LANGUAGE NoGeneralizedNewtypeDeriving #
# LANGUAGE Safe #
# OPTIONS_HADDOCK show-extensions, not-home # | |
Copyright : ( C ) 2019 , QBayLogic B.V.
( C ) 2021 , QBayLogic B.V.
License : BSD2 ( see the file LICENSE )
Maintainer : QBayLogic B.V < >
" Clash . HaskellPrelude " re - exports most of the " Prelude " with the
exception of those functions that the Clash API defi... |
efb09c77c27d59ae5ad120abf382b95911641f451c52eeec9ae1ed55869a50bd | reflex-frp/reflex-vty | Host.hs | {-|
Module: Reflex.Vty.Host
Description: Scaffolding for running a reflex-vty application
-}
module Reflex.Vty.Host
( VtyApp
, VtyResult(..)
, getDefaultVty
, runVtyApp
, runVtyAppWithHandle
, MonadVtyApp
, VtyEvent
) where
import Control.Concurrent (forkIO, killThread)
import Control.Concurrent.Chan (... | null | https://raw.githubusercontent.com/reflex-frp/reflex-vty/95141a8a15c257c2942eca600fc94ba081ada30b/src/Reflex/Vty/Host.hs | haskell | |
Module: Reflex.Vty.Host
Description: Scaffolding for running a reflex-vty application
probably ultimately be replaced by something defined in this library.
^ The current vty output. 'runVtyAppWithHandle' samples this value every time an
event fires and updates the display.
^ An event that requests application te... | module Reflex.Vty.Host
( VtyApp
, VtyResult(..)
, getDefaultVty
, runVtyApp
, runVtyAppWithHandle
, MonadVtyApp
, VtyEvent
) where
import Control.Concurrent (forkIO, killThread)
import Control.Concurrent.Chan (newChan, readChan, writeChan)
import Control.Exception (onException)
import Control.Monad (fo... |
57be09ebf19a4de14f0d9ac54133552411dfec857d33a582e804fbad358d6ee6 | rufus-lang/rufus | rufus_benchmark_test.erl | -module(rufus_benchmark_test).
-include_lib("eunit/include/eunit.hrl").
untyped_some_arguments_function_calls_test() ->
Iterations = 10000000,
StartTime = os:timestamp(),
benchmark(Iterations, fun() ->
some_arguments(1, 1, 1, 1)
end),
Duration = time_diff(StartTime),
io:format("time sp... | null | https://raw.githubusercontent.com/rufus-lang/rufus/fb3ec8f67c06e8d656c6aa6c4297461559ee168f/rf/benchmark/rufus_benchmark_test.erl | erlang | Test helper functions | -module(rufus_benchmark_test).
-include_lib("eunit/include/eunit.hrl").
untyped_some_arguments_function_calls_test() ->
Iterations = 10000000,
StartTime = os:timestamp(),
benchmark(Iterations, fun() ->
some_arguments(1, 1, 1, 1)
end),
Duration = time_diff(StartTime),
io:format("time sp... |
6811f9721250070b095bbf612b00b4a28e0ee4bdc04fd325a5ada6aa6ded3f24 | fluree/db | permissions_validate.cljc | (ns fluree.db.permissions-validate
(:require [fluree.db.dbproto :as dbproto]
[fluree.db.util.log :as log :include-macros true]
[fluree.db.flake :as flake]
[clojure.core.async :refer [go <!] :as async]
[fluree.db.util.async :refer [<? go-try channel?]]
[flure... | null | https://raw.githubusercontent.com/fluree/db/ab7ab2e18dcfe2ef12aed5ea57ea3ec9c68df540/src/fluree/db/permissions_validate.cljc | clojure | note, classes will return empty list if none found ()
always default to false! (deny)
always default to false! (deny)
default-allow? will be the default for all flakes that don't have a property-specific policy | (ns fluree.db.permissions-validate
(:require [fluree.db.dbproto :as dbproto]
[fluree.db.util.log :as log :include-macros true]
[fluree.db.flake :as flake]
[clojure.core.async :refer [go <!] :as async]
[fluree.db.util.async :refer [<? go-try channel?]]
[flure... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.