_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 |
|---|---|---|---|---|---|---|---|---|
0abbc9fd234876451f8517d0e56fa6b7157016993379926932cf4f0cbb867548 | Guest0x0/normalization-bench | Data.ml |
module TMap = struct
open Map.Make(Int)
type nonrec 'a t =
{ data : 'a t
; len : int }
let empty = { data = empty; len = 0 }
let push value tmap =
{ data = add tmap.len value tmap.data
; len = tmap.len + 1 }
let get idx tmap =
find (tmap.len - idx - 1) ... | null | https://raw.githubusercontent.com/Guest0x0/normalization-bench/1bee9a029671cb307a1ff3c423d2a1bc7352ffaa/Common/Data.ml | ocaml |
module TMap = struct
open Map.Make(Int)
type nonrec 'a t =
{ data : 'a t
; len : int }
let empty = { data = empty; len = 0 }
let push value tmap =
{ data = add tmap.len value tmap.data
; len = tmap.len + 1 }
let get idx tmap =
find (tmap.len - idx - 1) ... | |
247343560ff5f92fd17af9e80cb2aa76ae062f7821a1742be5c1eaf48d35687d | unison-code/unison | Size.hs | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.Hexagon.SpecsGen.Size (size) where
import Unison.Target.Hexagon.SpecsGen.HexagonInstructionDecl
size i
| i `elem`
[A2_tfrpi_demat, A2_tfrpi_demat_ce, A2_tfrpi_source,
A2_tfrpi_source_ce, A2_tfrsi_demat, A2_tfrsi_de... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Target/Hexagon/SpecsGen/Size.hs | haskell | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.Hexagon.SpecsGen.Size (size) where
import Unison.Target.Hexagon.SpecsGen.HexagonInstructionDecl
size i
| i `elem`
[A2_tfrpi_demat, A2_tfrpi_demat_ce, A2_tfrpi_source,
A2_tfrpi_source_ce, A2_tfrsi_demat, A2_tfrsi_de... | |
7b8d187e3328302cfe8eea974676073cb4baafd0868b7672dfc238ea6fd20c76 | dgtized/shimmers | shader.cljs | (ns shimmers.common.shader
(:require [quil.core :as q :include-macros true]))
(defn pass [shader [w h] uniforms]
(q/shader shader)
(doseq [[key value] uniforms]
(q/set-uniform shader key value))
(q/rect 0 0 w h))
(defn transform
[shader buffer image [w h] uniforms]
(when (q/loaded? shader)
(q/with... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/common/shader.cljs | clojure | (ns shimmers.common.shader
(:require [quil.core :as q :include-macros true]))
(defn pass [shader [w h] uniforms]
(q/shader shader)
(doseq [[key value] uniforms]
(q/set-uniform shader key value))
(q/rect 0 0 w h))
(defn transform
[shader buffer image [w h] uniforms]
(when (q/loaded? shader)
(q/with... | |
abaf330cac3fc356b58031918917cfd48972b9b7f0a8546eaca2e3d87b9b9c18 | fukamachi/mito | sqlite3.lisp | (in-package :cl-user)
(defpackage mito-test.migration.sqlite3
(:use #:cl
#:prove
#:mito
#:mito.migration
#:mito-test.util))
(in-package :mito-test.migration.sqlite3)
(plan nil)
(setf *connection* (reconnect-to-testdb (connect-to-testdb :sqlite3)))
(when (find-class 'tweets nil)
(s... | null | https://raw.githubusercontent.com/fukamachi/mito/2fbfc8aa6f9e3e8029bf09888c74b9af98dad341/t/migration/sqlite3.lisp | lisp | (in-package :cl-user)
(defpackage mito-test.migration.sqlite3
(:use #:cl
#:prove
#:mito
#:mito.migration
#:mito-test.util))
(in-package :mito-test.migration.sqlite3)
(plan nil)
(setf *connection* (reconnect-to-testdb (connect-to-testdb :sqlite3)))
(when (find-class 'tweets nil)
(s... | |
898b1b03d131ca0840e1e9b563b420bf289da680268b3b61261b17fd0f413d5f | quchen/generative-art | Integrate.hs | -- | Compute definite integrals.
module Numerics.Integrate (
integrateMidpoint
, integrateSimpson13
) where
import Data.List
sum' :: Num a => [a] -> a
sum' = foldl' (+) 0
{-# INLINE sum' #-}
-- | Numerical integration with the midpoint method. This is one of the simplest
-- integration algorithms.
--
--
i... | null | https://raw.githubusercontent.com/quchen/generative-art/b4edf7bc9e623192eac6faef0ba3ca779b162a6c/src/Numerics/Integrate.hs | haskell | | Compute definite integrals.
# INLINE sum' #
| Numerical integration with the midpoint method. This is one of the simplest
integration algorithms.
^ \(f\)
^ \(b\)
^ Number of interval subdivisions
quadratic polynomials. It’s not that complicated but still does very well on
not-so-crazy functions.
Usefu... | module Numerics.Integrate (
integrateMidpoint
, integrateSimpson13
) where
import Data.List
sum' :: Num a => [a] -> a
sum' = foldl' (+) 0
integrateMidpoint
:: Fractional a
^ )
^ \(\int_a^b\mathrm dt\ , f(t)\ )
integrateMidpoint f a b n =
h * ( f a / 2
+ sum' [f (a + fromIntegral k*h) |... |
b56dc366cc323577365ad29ceb0436f12f6cb3b02e9f0000941a585b85e15be7 | kadena-io/chainweaver | Signature.hs | module Frontend.Crypto.Signature where
import Control.Monad ((<=<))
import Control.Monad.Fail (MonadFail)
import Control.Monad.Except (MonadError, throwError)
import Control.Newtype.Generics (Newtype (..))
import Data.Aeson ... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/228e28e314f015c2eda662faf795d95e170c2b4c/frontend/src/Frontend/Crypto/Signature.hs | haskell | | Parse just a public key with some sanity checks applied. | module Frontend.Crypto.Signature where
import Control.Monad ((<=<))
import Control.Monad.Fail (MonadFail)
import Control.Monad.Except (MonadError, throwError)
import Control.Newtype.Generics (Newtype (..))
import Data.Aeson ... |
2f16c05d53d2edec381a7023fbc0699c8bd54a7ad6eb2a56ba1f7e108c7dc42d | gergoerdi/hm-compo | Compositional.hs | # LANGUAGE MultiParamTypeClasses , FlexibleInstances #
{-# LANGUAGE RecordWildCards, TupleSections #-}
module Language.HM.Compositional
( polyVars, runM
, tyCheckBinds
, Typing0(..)
)
where
import Language.HM.Monad
import Language.HM.Syntax
import Language.HM.Meta
import Language.HM.... | null | https://raw.githubusercontent.com/gergoerdi/hm-compo/386826e570fc6b6a078927bde85f3941e9a77e87/src/Language/HM/Compositional.hs | haskell | # LANGUAGE RecordWildCards, TupleSections # | # LANGUAGE MultiParamTypeClasses , FlexibleInstances #
module Language.HM.Compositional
( polyVars, runM
, tyCheckBinds
, Typing0(..)
)
where
import Language.HM.Monad
import Language.HM.Syntax
import Language.HM.Meta
import Language.HM.Compositional.Error
import Language.HM.Pretty
i... |
a47562f762f73601635752aac7ebd81c56abe27eab2762caad79a58e50cf2f7b | input-output-hk/cardano-ledger-byron | ValidationMode.hs | module Cardano.Chain.UTxO.ValidationMode
( TxValidationMode (..)
) where
import Cardano.Prelude
--------------------------------------------------------------------------------
-- TxValidationMode
--------------------------------------------------------------------------------
-- | Indicates what sort of transac... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/src/Cardano/Chain/UTxO/ValidationMode.hs | haskell | ------------------------------------------------------------------------------
TxValidationMode
------------------------------------------------------------------------------
| Indicates what sort of transaction validation should be performed.
^ Perform all transaction validations.
^ Because we've already validated... | module Cardano.Chain.UTxO.ValidationMode
( TxValidationMode (..)
) where
import Cardano.Prelude
data TxValidationMode
= TxValidation
| TxValidationNoCrypto
| NoTxValidation
deriving (Eq, Show)
|
14740a125ff636913afbb3e8466565eea437f50a32741722b0cdd09a85b43d74 | racket/web-server | xexpr.rkt | #lang racket/base
(require racket/contract
racket/match
racket/list
racket/pretty
xml)
(define-struct (exn:pretty exn) (xexpr))
(provide/contract
[struct (exn:pretty exn) ([message string?]
[continuation-marks continuation-mark-set?]
... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/private/xexpr.rkt | racket | XXX Can this be XML escaped?
()
(datum ...)
((p ...) ...) | #lang racket/base
(require racket/contract
racket/match
racket/list
racket/pretty
xml)
(define-struct (exn:pretty exn) (xexpr))
(provide/contract
[struct (exn:pretty exn) ([message string?]
[continuation-marks continuation-mark-set?]
... |
7004ba97c1fe6730fe061783adab4452218462997e4052345d0b431b3600495c | evrim/core-server | grovel.lisp | (in-package :tr.gen.core.ffi)
(ctype retval "int")
;;;-----------------------------------------------------------------------------
;;; GETPROTOBYNAME, GETHOSTBYNAME TYPE DEFINITIONS
;;;-----------------------------------------------------------------------------
(include "netdb.h")
(cstruct protoent "struct protoent... | null | https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/io/grovel.lisp | lisp | -----------------------------------------------------------------------------
GETPROTOBYNAME, GETHOSTBYNAME TYPE DEFINITIONS
-----------------------------------------------------------------------------
possible values for "ai-flags"
+----------------------------------------------------------------------------
|IPV... | (in-package :tr.gen.core.ffi)
(ctype retval "int")
(include "netdb.h")
(cstruct protoent "struct protoent"
(name "p_name" :type :string)
(aliases "p_aliases" :type :pointer)
(proto "p_proto" :type :int))
(cstruct hostent "struct hostent"
(name "h_name" :type :string)
(aliases "h_aliases" :type :pointer)
... |
24e646c0080d55b4749fef4e1f0b23c9feace68f97ed76f6050f81a67cce1f82 | kelsey-sorrels/robinson | add_all_weapons.clj | (require
'[robinson.player :as rp]
'[robinson.itemgen :as ig]
'[robinson.monstergen :as mg])
(let [item-ids [:knife
:club
:throwing-hammer
:sling
:dagger
:throwing-axe
:boomerang
:spear
... | null | https://raw.githubusercontent.com/kelsey-sorrels/robinson/337fd2646882708331257d1f3db78a3074ccc67a/src/robinson_tools/snippets/add_all_weapons.clj | clojure | (require
'[robinson.player :as rp]
'[robinson.itemgen :as ig]
'[robinson.monstergen :as mg])
(let [item-ids [:knife
:club
:throwing-hammer
:sling
:dagger
:throwing-axe
:boomerang
:spear
... | |
1f7ee3eb3bd119a9899d4f2bb50cf7b58dcf6b530990e5ded8990cfaa5262cac | jwvg0425/HaskellStudy | solution.hs |
# 1 : Direction & Position
data Direction = L | R | U | D
data Position a = Position a a
move :: (Num a) => Position a -> Direction -> a -> Position a
move (Position x y) L dx = Position (x-dx) y
move (Position x y) R dx = Position (x+dx) y
move (Position x y) U dy = Position x (y-dy)
move (Position x y) D dy = ... | null | https://raw.githubusercontent.com/jwvg0425/HaskellStudy/8e8b90d0e703e54ca06c296b6989940e13dc26ac/practice/6/solution.hs | haskell |
# 1 : Direction & Position
data Direction = L | R | U | D
data Position a = Position a a
move :: (Num a) => Position a -> Direction -> a -> Position a
move (Position x y) L dx = Position (x-dx) y
move (Position x y) R dx = Position (x+dx) y
move (Position x y) U dy = Position x (y-dy)
move (Position x y) D dy = ... | |
35fa4e35a01858276bc3108f4c0ed5612678b700d75e54d88d5cb5c6c44b3bc3 | ghc/packages-Cabal | cabal.test.hs | import Test.Cabal.Prelude
main = cabalTest $ do
cabal "v2-build" ["q"]
cabal "v2-build" ["q"]
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.test.hs | haskell | import Test.Cabal.Prelude
main = cabalTest $ do
cabal "v2-build" ["q"]
cabal "v2-build" ["q"]
| |
c71c67924f0b33db74e16e63d4ad704dbc28e2a64da81963840bdfd73479b620 | ocaml-multicore/ocaml-tsan | test_c_thread_has_lock.ml | TEST
modules = " test_c_thread_has_lock_cstubs.c "
* bytecode
* native
modules = "test_c_thread_has_lock_cstubs.c"
* bytecode
* native
*)
external test_with_lock : unit -> bool = "with_lock"
external test_without_lock : unit -> bool = "without_lock"
let passed b = Printf.printf (if b then ... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/c-api/test_c_thread_has_lock.ml | ocaml | TEST
modules = " test_c_thread_has_lock_cstubs.c "
* bytecode
* native
modules = "test_c_thread_has_lock_cstubs.c"
* bytecode
* native
*)
external test_with_lock : unit -> bool = "with_lock"
external test_without_lock : unit -> bool = "without_lock"
let passed b = Printf.printf (if b then ... | |
6ba14ebf2c7dd49884dab0a52d0a66d1a2f4f8b24ce2da9de3a7b4a214dbc9ed | vikram/lisplibraries | dataform.lisp |
(in-package :weblocks-test)
;;; Define a test suite for dataform testing
(deftestsuite dataform-suite (weblocks-suite)
((dataform (make-instance 'dataform :data (copy-template *joe*)))))
;;; click modify, change some data, click cancel
(addtest render-dataform-modify/cancel
;; initial state
(render-widget data... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/test/widgets/dataform.lisp | lisp | Define a test suite for dataform testing
click modify, change some data, click cancel
initial state
click modify
click modify, change some data, click submit
initial state
click modify
change to bob and click submit
click modify, introduce some errors, submit
initial state
click modify
make sure slots witho... |
(in-package :weblocks-test)
(deftestsuite dataform-suite (weblocks-suite)
((dataform (make-instance 'dataform :data (copy-template *joe*)))))
(addtest render-dataform-modify/cancel
(render-widget dataform)
(do-action (find-ui-link :name "Modify"))
change name to and click cancel
(do-action (find-ui-form :... |
41d387002873ede707c98036fefd082b535659c5ab4bef2e5e76c067db808677 | Clozure/ccl-tests | random-type-prop.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Thu Dec 23 20:39:22 2004
;;;; Contains: Randomized tests of type propagation in the compiler
(in-package :cl-test)
(eval-when (:compile-toplevel :load-toplevel)
(compile-and-load "random-aux.lsp")
(compile-and-load "random-int-form.lsp"))
(defvar *print-rando... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/random-type-prop.lsp | lisp | -*- Mode: Lisp -*-
Contains: Randomized tests of type propagation in the compiler
operator A lisp operator (either a symbol or a lambda form)
arg-types A list consisting either of certain kinds of lisp types
(that make-random-element-of-type understands) and/or
functions that yield t... | Author :
Created : Thu Dec 23 20:39:22 2004
(in-package :cl-test)
(eval-when (:compile-toplevel :load-toplevel)
(compile-and-load "random-aux.lsp")
(compile-and-load "random-int-form.lsp"))
(defvar *print-random-type-prop-input* nil)
(defparameter *random-type-prop-result* nil)
(declaim (special *par... |
aeb1b1daf2cc68e69ed996d131300c2f7c1dc99d6b239e7c0caa625fc0062c10 | nuprl/gradual-typing-performance | make-cards.rkt | (module make-cards typed/racket
(require #;racket/class
"list-hash.rkt"
(prefix-in mred: typed/racket/gui)
(prefix-in card-class: "card-class.rkt")
"typed-base.rkt")
(provide back deck-of-cards make-card)
(: get-bitmap ((U #;Path-For-Some-System Path-String Input-Po... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/cards/cards/make-cards.rkt | racket | racket/class
Path-For-Some-System Path-String Input-Port) -> (Instance mred:Bitmap%)))
make-object mred:bitmap-dc% [bitmap bm])])
make-object card-class:card%
make-object card-class:card% | (module make-cards typed/racket
"list-hash.rkt"
(prefix-in mred: typed/racket/gui)
(prefix-in card-class: "card-class.rkt")
"typed-base.rkt")
(provide back deck-of-cards make-card)
(define (get-bitmap file)
(make-object mred:bitmap% file))
(: make-dim ((Instanc... |
c54d0812af76980d8e53bebef45207f4fd8b9e99d58ce860bc6b31a07cad903b | tek/ribosome | LuaRef.hs | module Ribosome.Host.Data.LuaRef where
import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode)
import Ribosome.Host.Class.Msgpack.Encode (MsgpackEncode)
newtype LuaRef =
LuaRef { unLuaRef :: Int64 }
deriving stock (Generic)
deriving anyclass (MsgpackDecode, MsgpackEncode)
| null | https://raw.githubusercontent.com/tek/ribosome/a676b4f0085916777bfdacdcc761f82d933edb80/packages/host/lib/Ribosome/Host/Data/LuaRef.hs | haskell | module Ribosome.Host.Data.LuaRef where
import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode)
import Ribosome.Host.Class.Msgpack.Encode (MsgpackEncode)
newtype LuaRef =
LuaRef { unLuaRef :: Int64 }
deriving stock (Generic)
deriving anyclass (MsgpackDecode, MsgpackEncode)
| |
5aa66827014b89bde56f66cdf0ff10c9c1f899edf622c538be7eb1ca0d8c6274 | clojure/core.typed | internal_test.clj | (ns clojure.core.typed.test.internal-test
"Tests for c.c.t.internal"
(:require [clojure.test :refer :all]
[clojure.core.typed.test.test-utils :refer :all]
[clojure.core.typed.internal :as internal]))
(deftest parse-fn-test
(is (= (:fn (internal/parse-fn* '(fn [a b c] a)))
(:fn (i... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/test/clojure/core/typed/test/internal_test.clj | clojure | unannotated
fully annotated, no poly
method intersections
polymorphic protocols with doc
polymorphic method | (ns clojure.core.typed.test.internal-test
"Tests for c.c.t.internal"
(:require [clojure.test :refer :all]
[clojure.core.typed.test.test-utils :refer :all]
[clojure.core.typed.internal :as internal]))
(deftest parse-fn-test
(is (= (:fn (internal/parse-fn* '(fn [a b c] a)))
(:fn (i... |
ac283ef98846f169b5574e3563b4f5dbeda9ea708ebc23d8e5f2226e076547aa | hipsleek/hipsleek | globProver.ml | #include "xdebug.cppo"
let tmp_files_path = ref ""
path for the temporary files used by the prover . If you change this path here it is
mandatory to also change the value of TMP_FILES_PATH in Makefile accordingly to the changes made here
mandatory to also change the value of TMP_FILES_PATH in Makefile accordingl... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/globProver.ml | ocaml | type of process used for communicating with the prover
methods that need to be defined in order to use a prover incrementally - if the prover provides this functionality
method add_to_context: 'a -> unit | #include "xdebug.cppo"
let tmp_files_path = ref ""
path for the temporary files used by the prover . If you change this path here it is
mandatory to also change the value of TMP_FILES_PATH in Makefile accordingly to the changes made here
mandatory to also change the value of TMP_FILES_PATH in Makefile accordingl... |
0fb71e93d2dce0cd95f0ec2c3369aac4f6d92d64d61a1c539f0b14f5bb457127 | fredrikt/yxa | pstnproxy.erl | %%%-------------------------------------------------------------------
%%% File : pstnproxy.erl
@author < >
%%% @doc An SIP application level 'firewall' to defend a PSTN
%%% gateway from misuse and to make sure users are
%%% authorized to make calls to different 'classes' of
%%% ... | null | https://raw.githubusercontent.com/fredrikt/yxa/85da46a999d083e6f00b5f156a634ca9be65645b/src/pstnproxy.erl | erlang | -------------------------------------------------------------------
File : pstnproxy.erl
@doc An SIP application level 'firewall' to defend a PSTN
gateway from misuse and to make sure users are
authorized to make calls to different 'classes' of
numbers (configured through regu... | @author < >
perform ENUM lookups on requests _ from _ the PSTN gw .
@since 15 Nov 2002 by < >
-module(pstnproxy).
-behaviour(yxa_app).
-export([
config_defaults/0,
init/0,
request/2,
response/2,
terminate/1
]).
-export([test/0]).
-include("siprecords.hrl").
-include("sipsocke... |
d754a5147d804727f0671c2d091f5710a4717837781ef54fc1a5d963b71d5f68 | jepst/CloudHaskell | KMeansCommon.hs | {-# LANGUAGE DeriveDataTypeable #-}
module KMeansCommon where
import Data.List (foldl')
import Data.Typeable (Typeable)
import Data.Data (Data)
import Data.Binary
import Data.Array.Unboxed
import qualified Data.ByteString.Lazy as B
import Debug.Trace
-- Change this and recompile to change the cardinality of the data ... | null | https://raw.githubusercontent.com/jepst/CloudHaskell/6acbcb6b2fc6bb6789cce2083cdd4747ef427627/examples/kmeans/KMeansCommon.hs | haskell | # LANGUAGE DeriveDataTypeable #
Change this and recompile to change the cardinality of the data set! | module KMeansCommon where
import Data.List (foldl')
import Data.Typeable (Typeable)
import Data.Data (Data)
import Data.Binary
import Data.Array.Unboxed
import qualified Data.ByteString.Lazy as B
import Debug.Trace
vectorSize :: Int
vectorSize = 100
type ClusterId = Int
data Vector = Vector !(UArray Int Double) deri... |
e7cbc8380b4a0c530895109d0c40d05f27b987f459d339f8a4ae5e6a635ff7cb | BardurArantsson/cqrs | SnapshotStore.hs | module Data.CQRS.SnapshotStore
( nullSnapshotStore
, SnapshotStore
) where
import Data.CQRS.Types.SnapshotStore
| null | https://raw.githubusercontent.com/BardurArantsson/cqrs/2491d83e2bcd68c883aaea33cdce6c5ea8c0cd1a/cqrs-core/src/Data/CQRS/SnapshotStore.hs | haskell | module Data.CQRS.SnapshotStore
( nullSnapshotStore
, SnapshotStore
) where
import Data.CQRS.Types.SnapshotStore
| |
b73fe7d89e39f711f01467ac85d5ab30911ec78e4fcd7edea8cd3329355fdfd2 | clash-lang/clash-compiler | NestedPrimitives2.hs | module NestedPrimitives2 where
import Clash.Prelude
topEntity :: Vec 5 (Vec 3 (Signed 32))
topEntity = map (take d3) o
where
o :: Vec 5 (Vec 5 (Signed 32))
o = replicate d5 (replicate d5 (bit 31))
| null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/tests/shouldwork/Basic/NestedPrimitives2.hs | haskell | module NestedPrimitives2 where
import Clash.Prelude
topEntity :: Vec 5 (Vec 3 (Signed 32))
topEntity = map (take d3) o
where
o :: Vec 5 (Vec 5 (Signed 32))
o = replicate d5 (replicate d5 (bit 31))
| |
8b2b3080a07f5333eb08cea1f506bf998680a54be9da38d0b12d1f88864b5f13 | typeable/dom-parser | Parser.hs | module Text.XML.DOM.Parser
( module Text.XML.DOM.Parser.Attributes
, module Text.XML.DOM.Parser.Buildable
, module Text.XML.DOM.Parser.Combinators
, module Text.XML.DOM.Parser.Content
, module Text.XML.DOM.Parser.FromAttribute
, module Text.XML.DOM.Parser.FromDom
, module Text.XML.DOM.Parser.Types
) whe... | null | https://raw.githubusercontent.com/typeable/dom-parser/7d556ba528bfa216e99714f8a0d4d00f452803a9/src/Text/XML/DOM/Parser.hs | haskell | module Text.XML.DOM.Parser
( module Text.XML.DOM.Parser.Attributes
, module Text.XML.DOM.Parser.Buildable
, module Text.XML.DOM.Parser.Combinators
, module Text.XML.DOM.Parser.Content
, module Text.XML.DOM.Parser.FromAttribute
, module Text.XML.DOM.Parser.FromDom
, module Text.XML.DOM.Parser.Types
) whe... | |
4e53121f1ae8d795cd1e2e439f047cb200e07fae830aee7734230de3175b64d0 | aistrate/Okasaki | Ex06_02.hs | module Ex06_02 (module Queue, BankersQueue(..)) where
import Prelude hiding (head, tail)
import Queue
data BankersQueue a = BQ Int [a] Int [a]
deriving (Eq, Show)
check lenf f lenr r =
if lenr <= 2 * lenf then BQ lenf f lenr r
else BQ (lenf+lenr) (f ++ reverse r) 0 []
instance Queue Banke... | null | https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/MyCode/Ch06/Ex06_02.hs | haskell | module Ex06_02 (module Queue, BankersQueue(..)) where
import Prelude hiding (head, tail)
import Queue
data BankersQueue a = BQ Int [a] Int [a]
deriving (Eq, Show)
check lenf f lenr r =
if lenr <= 2 * lenf then BQ lenf f lenr r
else BQ (lenf+lenr) (f ++ reverse r) 0 []
instance Queue Banke... | |
49ba95797f199472573f1b30fae9fb0cca5068875fc02f3724ff08cf7866e5a8 | zcaudate/hara | type.clj | (ns hara.string.base.type
(:require [hara.string.base.common :as common]))
(defn re-sub
"substitute a pattern by applying a function
(re-sub \"aTa\" +hump-pattern+ (fn [_] \"$\"))
=> \"$a\""
{:added "3.0"}
[^String value pattern sub-func]
(loop [matcher (re-matcher pattern value)
result []
... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/string/base/type.clj | clojure | (ns hara.string.base.type
(:require [hara.string.base.common :as common]))
(defn re-sub
"substitute a pattern by applying a function
(re-sub \"aTa\" +hump-pattern+ (fn [_] \"$\"))
=> \"$a\""
{:added "3.0"}
[^String value pattern sub-func]
(loop [matcher (re-matcher pattern value)
result []
... | |
8a3a842b320c45396f0e5263dc6171499fc4c48d609118160b263f290e93c4de | drfloob/ezic | ezic_record_tests.erl | -module(ezic_record_tests).
-include("include/ezic.hrl").
-include_lib("eunit/include/eunit.hrl").
| null | https://raw.githubusercontent.com/drfloob/ezic/d95e92d1dc5ac763558da52c271b8a1b76f48122/test/ezic_record_tests.erl | erlang | -module(ezic_record_tests).
-include("include/ezic.hrl").
-include_lib("eunit/include/eunit.hrl").
| |
34cd7a1bab7bb4c447086ab0d4bd0bb6a7b35786ff5fe52ab039dba66d4dbc75 | xapi-project/xen-api | reporter_interdomain.ml |
* Copyright ( C ) 2013 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/6c2aadbb44166b389a3bd956c8a6af5787003d68/ocaml/xcp-rrdd/lib/plugin/reporter_interdomain.ml | ocaml |
* Copyright ( C ) 2013 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | |
d7d8becd961ecfbde71c81fd01706f9011968826e6d65d5af4b437324767804c | racket/racket-lang-org | hello-world.rkt | #lang racket/gui
(define my-language 'Italian)
(define translations
#hash((Chinese . "你好世界")
(English . "Hello world")
(French . "Bonjour monde")
[German . "Hallo Welt"]
[Greek . "γειά σου κόσμος"]
[Portuguese . "Olá mundo"]
[Spanish . "Hola mundo"]))
(define my-hell... | null | https://raw.githubusercontent.com/racket/racket-lang-org/88dada2ee769ada9afaf1e3ec1fb28b8ddf216db/www/hello-world.rkt | racket | - - - - - - - - - - - - - - - - - - - - - - - - | #lang racket/gui
(define my-language 'Italian)
(define translations
#hash((Chinese . "你好世界")
(English . "Hello world")
(French . "Bonjour monde")
[German . "Hallo Welt"]
[Greek . "γειά σου κόσμος"]
[Portuguese . "Olá mundo"]
[Spanish . "Hola mundo"]))
(define my-hell... |
f3128b766f629c21570fc63044bd4be11b1171a0a69976dcd7ab4d4bfee5808a | craigl64/clim-ccl | extended-regions.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-utils)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . "
;;; Extended regions
;;; Lines
(... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/utils/extended-regions.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
See the file LICENSE for the full license governing this code.
Extended regions
Lines
By using perpendicular-distance from line instead of slope and intercept
robust against roundoff error.
spec says only coincidence satisf... |
(in-package :clim-utils)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . "
(defclass standard-line (line)
((start-x :initarg :start-x :type coordinate)
(start-y :initarg :start-y :type coordinate)
(end-x :initarg :end-x :type coordinate)
(end-y :initarg :end-y :type... |
e13b79206573f92225b6b444c6a70e1d9f578f1402996c438871272284c2fc66 | olivermg/owlisp | symbols.lisp | (in-package :owlisp/helper)
(export '(symbol->keyword
prefix-symbol))
(defun symbol->keyword (symbol)
(intern (symbol-name symbol)
:keyword))
(defun prefix-symbol (symbol prefix)
(intern (concatenate 'string
prefix
(symbol-name symbol))
(symbol-package symbol)))
| null | https://raw.githubusercontent.com/olivermg/owlisp/dbf6d1d9e813f16124c170a0e1bfe155752e017b/src/helper/symbols.lisp | lisp | (in-package :owlisp/helper)
(export '(symbol->keyword
prefix-symbol))
(defun symbol->keyword (symbol)
(intern (symbol-name symbol)
:keyword))
(defun prefix-symbol (symbol prefix)
(intern (concatenate 'string
prefix
(symbol-name symbol))
(symbol-package symbol)))
| |
7ff07af7d31f764328c4b11ff3b1a7ae928ee8221992dd70539d536be1bc0c77 | YoshikuniJujo/funpaala | forkGame1.hs | data Item = Banana | Club | Shield | Armor | Sord | Star
deriving (Show, Eq, Ord, Bounded)
type Baggage = [Item]
data Stage = Fork Stage Stage | Goal Item deriving Show
point :: Item -> Integer
point Banana = 10
point Club = 20
point Shield = 50
point Armor = 80
point Sord = 100
point Star = 200
baggage1, baggage2... | null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/41_foldable/forkGame1.hs | haskell | data Item = Banana | Club | Shield | Armor | Sord | Star
deriving (Show, Eq, Ord, Bounded)
type Baggage = [Item]
data Stage = Fork Stage Stage | Goal Item deriving Show
point :: Item -> Integer
point Banana = 10
point Club = 20
point Shield = 50
point Armor = 80
point Sord = 100
point Star = 200
baggage1, baggage2... | |
b32c3085b69455488e0736b6e410b86e6ebd31b6bc0166a04c985ec6f33c39ad | wfnuser/sicp-solutions | e4-15.scm | (define (run-forever) (run-forever))
(define (try p)
(if (halts? p p)
(run-forever)
'halted))
; try try
; => if (halts? try try)
; if (halts? try try) returns #t
; try try will go in run-forever, which is in a paradox
; otherwise, try try should not halt, but (halts? try try) returns #f | null | https://raw.githubusercontent.com/wfnuser/sicp-solutions/2c94b28d8ee004dcbfe7311f866e5a346ee01d12/ch4/e4-15.scm | scheme | try try
=> if (halts? try try)
if (halts? try try) returns #t
try try will go in run-forever, which is in a paradox
otherwise, try try should not halt, but (halts? try try) returns #f | (define (run-forever) (run-forever))
(define (try p)
(if (halts? p p)
(run-forever)
'halted))
|
8c03ffa0e1faaf86ed694372ebdbd6024204b8804a9b2be684b143c834c59896 | bit-ranger/scheme-bootstrap | let*-eval.scm | (load "eval/core.scm")
(load "eval/analyze.scm")
(load "syntax/let.scm")
;对let*处理
(define (install-let*-eval)
(define (binds exp)
(cadr exp))
(define (body exp)
(cddr exp))
(define (new-binds k-v)
(list k-v))
(define (new-body seq)
(list seq))
(define new-let ((make-let) 'co... | null | https://raw.githubusercontent.com/bit-ranger/scheme-bootstrap/a9155ebd29efe1196854b2dcd76941357dab151e/eval/let*-eval.scm | scheme | 对let*处理 | (load "eval/core.scm")
(load "eval/analyze.scm")
(load "syntax/let.scm")
(define (install-let*-eval)
(define (binds exp)
(cadr exp))
(define (body exp)
(cddr exp))
(define (new-binds k-v)
(list k-v))
(define (new-body seq)
(list seq))
(define new-let ((make-let) 'construct))... |
2252a1df1bfc3c137203a09d56963d02d019bda1bc2a1cd5e78505e6f707149d | UBTECH-Walker/WalkerSimulationFor2020WAIC | cruiser_diagnostics.lisp | ; Auto-generated. Do not edit!
(cl:in-package cruiser_msgs-msg)
;//! \htmlinclude cruiser_diagnostics.msg.html
(cl:defclass <cruiser_diagnostics> (roslisp-msg-protocol:ros-message)
((level
:reader level
:initarg :level
:type cl:integer
:initform 0)
(name
:reader name
:initarg :name
... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_18.04_v1.2_20200616/walker_install/share/common-lisp/ros/cruiser_msgs/msg/cruiser_diagnostics.lisp | lisp | Auto-generated. Do not edit!
//! \htmlinclude cruiser_diagnostics.msg.html |
(cl:in-package cruiser_msgs-msg)
(cl:defclass <cruiser_diagnostics> (roslisp-msg-protocol:ros-message)
((level
:reader level
:initarg :level
:type cl:integer
:initform 0)
(name
:reader name
:initarg :name
:type cl:string
:initform "")
(message
:reader message
:initar... |
65ff9bf97795df1587031b15a22d6e1b73170cd2dd05b3f1774a6d78fb2f62c2 | btmura/b1 | Graph.hs | module B1.Program.Chart.Graph
( GraphInput(..)
, GraphOutput(..)
, GraphOptions(..)
, GraphState
, GraphBoundSet(..)
, drawGraph
, newGraphState
, cleanGraphState
) where
import Control.Monad
import Data.Maybe
import Graphics.Rendering.OpenGL
import B1.Data.List
import B1.Data.Price
import B1.Data.R... | null | https://raw.githubusercontent.com/btmura/b1/9cf0514ba1e03e9f4da05be9231acde07b199864/src/B1/Program/Chart/Graph.hs | haskell | TODO: Make a function in Animation to get the final alpha value.
TODO: Make a function in Animation to make smooth transitions | module B1.Program.Chart.Graph
( GraphInput(..)
, GraphOutput(..)
, GraphOptions(..)
, GraphState
, GraphBoundSet(..)
, drawGraph
, newGraphState
, cleanGraphState
) where
import Control.Monad
import Data.Maybe
import Graphics.Rendering.OpenGL
import B1.Data.List
import B1.Data.Price
import B1.Data.R... |
d7feaf2022a40ca592ff20ed56bb8cc3269dd4efa67ece364c3de09e442fb8ac | andreas/ocaml-memcached | memcached.mli | open Core.Std
open Async.Std
module type S = sig
type t
type value
type opcode =
Get
| Set
| Add
| Replace
| Delete
| Increment
| Decrement
| Quit
| Flush
| GetQ
| NoOp
| Version
| GetK
| GetKQ
| Append
| Prepend
| Stat
| SetQ
| AddQ
... | null | https://raw.githubusercontent.com/andreas/ocaml-memcached/a05432eb41dab4139819b66070a9806d92166a6b/memcached.mli | ocaml | open Core.Std
open Async.Std
module type S = sig
type t
type value
type opcode =
Get
| Set
| Add
| Replace
| Delete
| Increment
| Decrement
| Quit
| Flush
| GetQ
| NoOp
| Version
| GetK
| GetKQ
| Append
| Prepend
| Stat
| SetQ
| AddQ
... | |
4d3308b5513f7ed35216ba1b914358d03e81e86cac9ca384cdf1dd6d0430d0e9 | vraid/earthgen | sunlight.rkt | #lang typed/racket
(provide (all-defined-out))
(require math/flonum)
(define solar-constant 1361.0) ; joule / s / m^2
(: sunlight (Float Float -> Float))
(define (sunlight solar-equator latitude)
(* solar-constant
(max 0.0 (flcos (fl- solar-equator latitude)))))
(: cloud-cover (Float -> Float))
(define (clo... | null | https://raw.githubusercontent.com/vraid/earthgen/208ac834c02208ddc16a31aa9e7ff7f91c18e046/planet/climate/sunlight.rkt | racket | joule / s / m^2 | #lang typed/racket
(provide (all-defined-out))
(require math/flonum)
(: sunlight (Float Float -> Float))
(define (sunlight solar-equator latitude)
(* solar-constant
(max 0.0 (flcos (fl- solar-equator latitude)))))
(: cloud-cover (Float -> Float))
(define (cloud-cover relative-humidity)
(* 0.5 relative-hum... |
8ecca06536646b3efc5531b3adab64c338123c80442e2b98a0fb24a03eec1344 | ivanjovanovic/sicp | e-1.26.scm | Exercise 1.26 .
;
is having great difficulty doing exercise 1.24 . His fast - prime ? test seems to run more slowly
than his prime ? test . calls his friend over to help .
When they examine 's code , they find that he has rewritten the
; expmod procedure to use an explicit multiplication, rather than c... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/1.2/e-1.26.scm | scheme |
expmod procedure to use an explicit multiplication, rather than calling square:
-----------------------------
If we know that applicative substitution evaluates parameters every time then
fact we are halving the problem we are doubling the number of calls. So at the
end we are cancelling logarithm with exponend ... | Exercise 1.26 .
is having great difficulty doing exercise 1.24 . His fast - prime ? test seems to run more slowly
than his prime ? test . calls his friend over to help .
When they examine 's code , they find that he has rewritten the
(define (expmod base exp m)
(cond ((= exp 0) 1)
((even? ex... |
625b9ed250721ceb9fd2f48adaa23f207357215b71846f1dbcd907440d7f1e55 | well-typed-lightbulbs/ocaml-esp32 | github9344.ml | (* TEST
use_runtime = "false"
* setup-ocamlc.byte-build-env
** ocamlc.byte
flags = "-w a -output-complete-exe -ccopt -I${ocamlsrcdir}/runtime"
program = "github9344"
*** run
program = "sh ${test_source_directory}/github9344.sh"
**** check-program-output
*)
raise Not_found
| null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/output-complete-obj/github9344.ml | ocaml | TEST
use_runtime = "false"
* setup-ocamlc.byte-build-env
** ocamlc.byte
flags = "-w a -output-complete-exe -ccopt -I${ocamlsrcdir}/runtime"
program = "github9344"
*** run
program = "sh ${test_source_directory}/github9344.sh"
**** check-program-output
|
raise Not_found
|
6936bf2c3a1fc861b0eb39a8540d4898839b815ec9389fe4553b4d4e68220154 | mmottl/gpr | cov_se_fat.ml | File : cov_se_fat.ml
OCaml - GPR - Gaussian Processes for OCaml
Copyright ( C ) 2009-
email :
WWW :
This library is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software F... | null | https://raw.githubusercontent.com/mmottl/gpr/64c4dce01b1779feff85d36d5902afa3b143bdae/src/cov_se_fat.ml | ocaml | TODO: sparse diagonal derivatives? | File : cov_se_fat.ml
OCaml - GPR - Gaussian Processes for OCaml
Copyright ( C ) 2009-
email :
WWW :
This library is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software F... |
85786e51d0bdaf5180ea9fdd7a2e4622e2e896b10c6638cb1a6ebd62321dd51c | MrEbbinghaus/fulcro-material-ui-wrapper | table.cljc | (ns mui.data-display.table
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Table" :default Table]
["@mui/material/TableBody" :default TableBody]
["@mui/material/TableCell" :default TableCell]
["@mui/material/TableContainer" ... | null | https://raw.githubusercontent.com/MrEbbinghaus/fulcro-material-ui-wrapper/058f1dd4b85542914f92f48a4010ea9ad497e48f/src/mui/data_display/table.cljc | clojure | (ns mui.data-display.table
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Table" :default Table]
["@mui/material/TableBody" :default TableBody]
["@mui/material/TableCell" :default TableCell]
["@mui/material/TableContainer" ... | |
46439b8e469edd1577e823b651f21a45e3bf86c550f23e0ed68930ac6db2b691 | mikesperber/icfp2020 | PlayerServer.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
# LANGUAGE TypeApplications #
module PlayerServer (runServer) where
import Control.Monad.Identity
import Control.Monad.IO.Class (liftIO)
import ... | null | https://raw.githubusercontent.com/mikesperber/icfp2020/974b8b7ca7ee8811f43398551c97c8ac7ae1cbb1/hearts/app/PlayerServer.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeApplications #
module PlayerServer (runServer) where
import Control.Monad.Identity
import Control.Monad.IO.Class (liftIO)
import Polysemy
import qualified Polysemy.State as State
import ... |
7f7ccc8a250c5c7fee96e2d7ca3c6dc4e94d61b4d04b28de582b325be07384f4 | pbrisbin/load-env | Main.hs | module Main (main) where
import Test.DocTest
main :: IO ()
main = doctest ["-isrc", "src/"]
| null | https://raw.githubusercontent.com/pbrisbin/load-env/bfde2b75374e0677a38fb5637e2ccd9680f9a056/doctest/Main.hs | haskell | module Main (main) where
import Test.DocTest
main :: IO ()
main = doctest ["-isrc", "src/"]
| |
4438b809b44787d77ca7b43e6904226a32b47fe8c2c44a107c9764e5261dfa7e | ska80/thinlisp | format.lisp | (in-package "TL")
;;;; Module FORMAT
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright ( c ) 1996 Gensym Corporation .
;;; All rights reserved.
This file is part of ThinLisp .
ThinLisp is open source ; you can redistribute it and/or modify it
under the terms of the ThinLisp License as published by ... | null | https://raw.githubusercontent.com/ska80/thinlisp/173573a723256d901887f1cbc26d5403025879ca/tl/lisp/format.lisp | lisp | Module FORMAT
All rights reserved.
you can redistribute it and/or modify it
either version 1 or ( at your option ) any later version .
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Format and Supporting Stream Operations
This module implements fo... | (in-package "TL")
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright ( c ) 1996 Gensym Corporation .
This file is part of ThinLisp .
under the terms of the ThinLisp License as published by the ThinLisp
ThinLisp is distributed in the hope that it will be useful , but
For additional information se... |
42a0245ed1881bf0549360bc16fe2525bd5b21202b0fff390b57b39547d9bbbd | amnh/PCG | memoizer-fuzzer.hs | {-# LANGUAGE BangPatterns #-}
module Main where
import Control.Concurrent
import Control.DeepSeq
import Control.Parallel.Strategies
import Control.Parallel.Custom
import Data.Bits
import Data.Functor
import Data.Foldable
import Data.Hashable.Memoize
import Data.List (zip3)
import Data.Time.Clock
import Data.Word
impo... | null | https://raw.githubusercontent.com/amnh/PCG/bf0f886422a53e566a0dcd0771e84532006acf27/prototype/memoizer-fuzzer.hs | haskell | # LANGUAGE BangPatterns #
expensiveFunction
let v0 = sum . force $ parmap rpar memo args
let v1 = sum' . force $ parmap rpar memo args' |
module Main where
import Control.Concurrent
import Control.DeepSeq
import Control.Parallel.Strategies
import Control.Parallel.Custom
import Data.Bits
import Data.Functor
import Data.Foldable
import Data.Hashable.Memoize
import Data.List (zip3)
import Data.Time.Clock
import Data.Word
import System.Random
import System... |
c1f96c17e0aa92d7442c25e32b5af71836a87f63e2bb1a0bae930f5aaaf29acc | liqd/thentos | Core.hs | {-# LANGUAGE OverloadedStrings #-}
module Thentos.Frontend.Pages.Core where
import Text.Blaze.Html (Html, (!))
import Text.Digestive.Blaze.Html5 (form, childErrorList)
import Text.Digestive.Form (Form, check, validate)
import Text.Digestive.Types (Result(Success, Error))
import Text.Digestive.View (View, absoluteRef)
... | null | https://raw.githubusercontent.com/liqd/thentos/f7d53d8e9d11956d2cc83efb5f5149876109b098/thentos-core/src/Thentos/Frontend/Pages/Core.hs | haskell | # LANGUAGE OverloadedStrings #
* base layout
| Create an html document with default headings from title,
optional headings, and body.
* forms
| Protect a form from CSRF attacks by including a secret token as a hidden field.
* error / status reports to the user
* form field validation | module Thentos.Frontend.Pages.Core where
import Text.Blaze.Html (Html, (!))
import Text.Digestive.Blaze.Html5 (form, childErrorList)
import Text.Digestive.Form (Form, check, validate)
import Text.Digestive.Types (Result(Success, Error))
import Text.Digestive.View (View, absoluteRef)
import qualified Data.Text as ST
i... |
c6af9a6e090a8e31ac461e306ec84446145b0f37af025b910876b9f3f2d8e15c | mbj/stratosphere | Scte20SourceSettingsProperty.hs | module Stratosphere.MediaLive.Channel.Scte20SourceSettingsProperty (
Scte20SourceSettingsProperty(..), mkScte20SourceSettingsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Strato... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/medialive/gen/Stratosphere/MediaLive/Channel/Scte20SourceSettingsProperty.hs | haskell | module Stratosphere.MediaLive.Channel.Scte20SourceSettingsProperty (
Scte20SourceSettingsProperty(..), mkScte20SourceSettingsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Strato... | |
8aa0edad703d8f680ab5321ff60dc4a7a83e9bb550e8e17087d3aead8ed15991 | aws-beam/aws-erlang | aws_tnb.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
@doc Amazon Web Services Telco Network Builder ( TNB ) is a network
%% automation service that helps you deploy and manage telecom networks.
%%
%% AWS TNB helps you with the lifecycle management of your telecommunication
%% netw... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_tnb.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
automation service that helps you deploy and manage telecom networks.
AWS TNB helps you with the lifecycle management of your telecommunication
network functions throughout planning, deployment, and post-deployment
activities.
============================================... | See -beam/aws-codegen for more details .
@doc Amazon Web Services Telco Network Builder ( TNB ) is a network
-module(aws_tnb).
-export([cancel_sol_network_operation/3,
cancel_sol_network_operation/4,
create_sol_function_package/2,
create_sol_function_package/3,
create_sol_netwo... |
5c500395fb51f39aa4d695993f9e26661f96e83da86461f0842edc1d37301b7f | openbadgefactory/salava | modal.cljs | (ns salava.user.ui.modal
(:require [reagent.core :refer [atom cursor]]
[reagent.session :as session]
[salava.core.ui.ajax-utils :as ajax]
[salava.core.ui.layout :as layout]
[salava.core.ui.share :as s]
[salava.core.ui.helper :refer [path-for hyperlink privat... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/user/ui/modal.cljs | clojure | (path-for (str "/badge/info/" id))
]
(path-for (str "/page/view/" id)) | (ns salava.user.ui.modal
(:require [reagent.core :refer [atom cursor]]
[reagent.session :as session]
[salava.core.ui.ajax-utils :as ajax]
[salava.core.ui.layout :as layout]
[salava.core.ui.share :as s]
[salava.core.ui.helper :refer [path-for hyperlink privat... |
d5976c2cfd0739f669f28e2a24da13129e380ed97baa14418a690a1bbd68f1f8 | cse-bristol/110-thermos-ui | objective.cljs | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-frontend.params.objective
(:require [reagent.core :as reagent]
[thermos-frontend.inputs :as inputs]
[t... | null | https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/src/thermos_frontend/params/objective.cljs | clojure | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-frontend.params.objective
(:require [reagent.core :as reagent]
[thermos-frontend.inputs :as inputs]
[t... | |
c0d14e7121227bc11c2cd703a3a9e044774537785169be513370657ef6631e9c | dmitryvk/sbcl-win32-threads | queue.lisp | Lock - free FIFO queues , from " An Optimistic Approach to Lock - Free FIFO
Queues " by and .
;;;;
Written by for SBCL .
;;;;
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was written at
Carnegie... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/contrib/sb-concurrency/queue.lisp | lisp |
more information.
software is in the public domain and is provided with absolutely no
warranty. See the COPYING and CREDITS files for more information.
These assignment is not present in the paper, but are
equivalent to the free(head.ptr) call there.
the paper leaves the dangling pointer in place.
otherwise... | Lock - free FIFO queues , from " An Optimistic Approach to Lock - Free FIFO
Queues " by and .
Written by for SBCL .
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was written at
Carnegie Mellon University and released into t... |
9e09878029aa697653613784ac024062bf4b01b89e84b4911b1143eb77db5784 | janegca/htdp2e | Exercise-070-Editor.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Exercise-070-Editor) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/01-FixedSizeData/Exercise-070-Editor.rkt | racket | about the language level of this file in a form that our tools can easily process.
Design the function render, which consumes an Editor and produces an image.
The purpose of the function is to render the text within an empty scene of
We started with this expression:
(overlay/align "left" "center"
... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Exercise-070-Editor) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decim... |
5140d59930a494bb16003069fa2432bdd73105669be0236b3e02acd409cf74d9 | Vaguery/klapaucius | util.clj | (ns acceptance.util
(:require [push.core :as push]
[push.type.definitions.interval :as iv]
[push.type.definitions.complex :as complex]
[push.type.definitions.quoted :as qc])
(:use [midje.sweet])
)
;; literal generators
(defn some-boolean
[]
(rand-nth [true false]))
(de... | null | https://raw.githubusercontent.com/Vaguery/klapaucius/17b55eb76feaa520a85d4df93597cccffe6bdba4/test/acceptance/util.clj | clojure | literal generators
code generation
; :refs '()
:set '()
| (ns acceptance.util
(:require [push.core :as push]
[push.type.definitions.interval :as iv]
[push.type.definitions.complex :as complex]
[push.type.definitions.quoted :as qc])
(:use [midje.sweet])
)
(defn some-boolean
[]
(rand-nth [true false]))
(defn some-long
"return... |
21fd384adc60b24a863c0fd85fe98567d6a2982d8e237b223aaba00a6aa00cea | jasonstolaruk/CurryMUD | Telnet.hs | # LANGUAGE OverloadedStrings , ViewPatterns #
module Mud.Util.Telnet where
import Mud.Data.Misc
import Mud.TopLvlDefs.Telnet.Chars
import Mud.TopLvlDefs.Telnet.CodeMap
import qualified Mud.Util.Misc as U (pmf)
import Mud.Util.Misc hiding (pmf)
import Mud.Util.Operator... | null | https://raw.githubusercontent.com/jasonstolaruk/CurryMUD/f9775fb3ede08610f33f27bb1fb5fc0565e98266/lib/Mud/Util/Telnet.hs | haskell | ================================================== | # LANGUAGE OverloadedStrings , ViewPatterns #
module Mud.Util.Telnet where
import Mud.Data.Misc
import Mud.TopLvlDefs.Telnet.Chars
import Mud.TopLvlDefs.Telnet.CodeMap
import qualified Mud.Util.Misc as U (pmf)
import Mud.Util.Misc hiding (pmf)
import Mud.Util.Operator... |
4fa7077205eeb7ba5435ca468dfdf0f61a5202cec3b8f48cacf56b1c113e0bf6 | sirherrbatka/vellum | generics.lisp | (cl:in-package #:vellum.table)
(defgeneric hstack* (frame more-frames &key isolate))
(defgeneric vstack* (frame more-frames))
(defgeneric select (frame &key columns rows))
(defgeneric vmask (frame mask &key in-place))
(defgeneric at (frame row column))
(defgeneric (setf at) (new-value frame row column))
(defgen... | null | https://raw.githubusercontent.com/sirherrbatka/vellum/92e133e0d2592b51a6cd5683761d37bbc663b17b/src/table/generics.lisp | lisp | (cl:in-package #:vellum.table)
(defgeneric hstack* (frame more-frames &key isolate))
(defgeneric vstack* (frame more-frames))
(defgeneric select (frame &key columns rows))
(defgeneric vmask (frame mask &key in-place))
(defgeneric at (frame row column))
(defgeneric (setf at) (new-value frame row column))
(defgen... | |
c7c980017f4b856a20110150a53931340bb8b6a4d5ad9dd397dae66cc9414a01 | ctdean/backtick | engine.clj | (ns backtick.engine
"@ctdean @jimbru"
(:require
[backtick.cleaner :as cleaner]
[backtick.conf :refer [master-cf]]
[backtick.db :as db]
[backtick.registry :refer [resolve-worker->fn]]
[clj-cron-parse.core :as cron]
[clj-time.core :as t]
[clj-time.coerce :refer [to-sql-time to-date-time]]
[clo... | null | https://raw.githubusercontent.com/ctdean/backtick/00f16405903fbd11b161b32572a199b3bc9c11b0/src/backtick/engine.clj | clojure | I know it's strange to delete a job in a function called "add",
but this ensures that a newly disabled recurring job's old
database entry is disabled to match.
Not fault tolerant
Pop from the queue
Send the job to be processed
Sleep if queue is empty | (ns backtick.engine
"@ctdean @jimbru"
(:require
[backtick.cleaner :as cleaner]
[backtick.conf :refer [master-cf]]
[backtick.db :as db]
[backtick.registry :refer [resolve-worker->fn]]
[clj-cron-parse.core :as cron]
[clj-time.core :as t]
[clj-time.coerce :refer [to-sql-time to-date-time]]
[clo... |
591d23c9b74996f54220422af14997f6ae054d25e97a5e11002fed5abc4ced47 | patricoferris/ocaml-multicore-monorepo | bigstringaf.ml | type bigstring =
(char, Bigarray_compat.int8_unsigned_elt, Bigarray_compat.c_layout) Bigarray_compat.Array1.t
type t = bigstring
let create size = Bigarray_compat.(Array1.create char c_layout size)
let empty = create 0
module BA1 = Bigarray_compat.Array1
let length t = BA1.dim t
external get : t -> int -> ... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/bigstringaf/lib/bigstringaf.ml | ocaml | A note on bounds checking.
*
* The code should perform the following check to ensure that the blit doesn't
* run off the end of the input buffer:
*
* {[off + len <= buffer_len]}
*
* However, this may lead to an integer overflow for large values of [off],
* e.g., [max_int], which will cause the comparison to ... | type bigstring =
(char, Bigarray_compat.int8_unsigned_elt, Bigarray_compat.c_layout) Bigarray_compat.Array1.t
type t = bigstring
let create size = Bigarray_compat.(Array1.create char c_layout size)
let empty = create 0
module BA1 = Bigarray_compat.Array1
let length t = BA1.dim t
external get : t -> int -> ... |
bb4f5650a9b57400956889629c52b31a9fe7c2507d850da85bf3334a98a0ed47 | RyanGlScott/text-show | PtrSpec.hs | |
Module : Spec . Foreign . : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for pointer data types .
Module: Spec.Foreign.PtrSpec
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-s... | null | https://raw.githubusercontent.com/RyanGlScott/text-show/5ea297d0c7ae2d043f000c791cc12ac53f469944/tests/Spec/Foreign/PtrSpec.hs | haskell | | Verifies the 'Show' instance for 'ForeignPtr' is accurate. | |
Module : Spec . Foreign . : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for pointer data types .
Module: Spec.Foreign.PtrSpec
Copyright: (C) 2014-2017 Ryan Scott
License: BSD-s... |
6e04501a927e31a6aee7bcceb8382624dbf9b09d5363124bfa6f457d84a8c500 | luminus-framework/examples | handler.clj | (ns guestbook.handler
(:require
[guestbook.middleware :as middleware]
[guestbook.layout :refer [error-page]]
[guestbook.routes.home :refer [home-routes]]
[reitit.ring :as ring]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.webjars :refer [wrap-webjars]]
[guestb... | null | https://raw.githubusercontent.com/luminus-framework/examples/cbeee2fef8f457a6a6bac2cae0b640370ae2499b/guestbook/src/clj/guestbook/handler.clj | clojure | (ns guestbook.handler
(:require
[guestbook.middleware :as middleware]
[guestbook.layout :refer [error-page]]
[guestbook.routes.home :refer [home-routes]]
[reitit.ring :as ring]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.webjars :refer [wrap-webjars]]
[guestb... | |
df13b66d07dfb088b62a7343da10f60d63f57a8ef94c044d4f1bf49b145bf383 | fulcro-legacy/semantic-ui-wrapper | ui_popup_header.cljs | (ns fulcrologic.semantic-ui.modules.popup.ui-popup-header
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/modules/Popup/PopupHeader" :default PopupHeader]))
(def ui-popup-header
"A PopupHeader displays a header in a Popover.
Props:
- as (custom): An elem... | null | https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/modules/popup/ui_popup_header.cljs | clojure | (ns fulcrologic.semantic-ui.modules.popup.ui-popup-header
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/modules/Popup/PopupHeader" :default PopupHeader]))
(def ui-popup-header
"A PopupHeader displays a header in a Popover.
Props:
- as (custom): An elem... | |
7443e50771c6316cdfce9be900c02b1a4fa71bd8bdd38fb811783c61778a19a8 | gfredericks/debug-repl | async.clj | (ns com.gfredericks.debug-repl.async
(:require
[com.gfredericks.debug-repl :as debug-repl]
[com.gfredericks.debug-repl.util :as util])
(:import (java.util.concurrent
SynchronousQueue
TimeUnit)))
(def the-executor nil) ;; global mutable state
(def ^:private msg-var
(if (util/requi... | null | https://raw.githubusercontent.com/gfredericks/debug-repl/f725058c8fd74fc2f1cb963b6a59e281b21a8d89/src/com/gfredericks/debug_repl/async.clj | clojure | global mutable state
this just checks if we're in a repl | (ns com.gfredericks.debug-repl.async
(:require
[com.gfredericks.debug-repl :as debug-repl]
[com.gfredericks.debug-repl.util :as util])
(:import (java.util.concurrent
SynchronousQueue
TimeUnit)))
(def ^:private msg-var
(if (util/require? 'nrepl.server)
(resolve 'nrepl.middlewa... |
5a01d9a80b7ba9d12cad78809bea74ad29880fe24e39cbb2135aed8e702951c2 | ifesdjeen/deflisp | Types.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleInstances #
module Deflisp.Core.Types where
import Data.Generics
import Control.DeepSeq
import Control.Monad.State
import qualified Data.Map as Map
import Control.Monad.Error
type LispEnvironment = (Map.Map LispExpression LispExpression)
type Context = State ... | null | https://raw.githubusercontent.com/ifesdjeen/deflisp/5733c22edb13a346d1cb1f85092420bdcc581028/src/DefLisp/Core/Types.hs | haskell | # LANGUAGE DeriveDataTypeable #
toSexp x = LispList $ map toSexp x
List operations
todo add empty collection handling
todo add empty collection handling
todo add empty collection handling
todo add empty collection handling
++ (show a) ++ " and " ++ (show b) | # LANGUAGE FlexibleInstances #
module Deflisp.Core.Types where
import Data.Generics
import Control.DeepSeq
import Control.Monad.State
import qualified Data.Map as Map
import Control.Monad.Error
type LispEnvironment = (Map.Map LispExpression LispExpression)
type Context = State LispEnvironment LispExpression
data ... |
7bfd311131d3553650797fa6b2889ddd4536b01a991a38c7f03f4890cfde95b1 | thierry-martinez/stdcompat | list.mli | val length : 'a list -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val append : 'a list -> 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val flatten : 'a l... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/4.04/list.mli | ocaml | val length : 'a list -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val rev : 'a list -> 'a list
val append : 'a list -> 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val flatten : 'a l... | |
0071b9e2187c258c1c5f6c7a9094bc9838826d75c65d9d4208155f896c02520c | finnishtransportagency/harja | soratietarkastusraportti_test.clj | (ns harja.palvelin.raportointi.soratietarkastusraportti-test
(:require [clojure.test :refer :all]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.toimenpidekoodit :refer :all]
[harja.palvelin.palvelut.urakat :refer :all]
[harja.testi :ref... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/488b1e096f0611e175221d74ba4f2ffed6bea8f1/test/clj/harja/palvelin/raportointi/soratietarkastusraportti_test.clj | clojure | (ns harja.palvelin.raportointi.soratietarkastusraportti-test
(:require [clojure.test :refer :all]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.toimenpidekoodit :refer :all]
[harja.palvelin.palvelut.urakat :refer :all]
[harja.testi :ref... | |
fd193483fc36da0f924bd7ebb57031cb97e3f91dfc4b7d92143b986c0585ff80 | zxymike93/SICP | 238.rkt | #lang sicp
(define (fold-right op init seq)
(if (null? seq)
init
(op (car seq)
(fold-right op init (cdr seq)))))
(define (fold-left op init seq)
(define (iter result rest)
(if (null? rest)
result
(iter (op result (car rest))
(cdr rest))))
(iter init seq))
... | null | https://raw.githubusercontent.com/zxymike93/SICP/9d8e84d6a185bf4d7f28c414fc3359741384beb5/chapter2/238.rkt | racket | op 满足交换律和结合律 | #lang sicp
(define (fold-right op init seq)
(if (null? seq)
init
(op (car seq)
(fold-right op init (cdr seq)))))
(define (fold-left op init seq)
(define (iter result rest)
(if (null? rest)
result
(iter (op result (car rest))
(cdr rest))))
(iter init seq))
... |
16113719c31fc07ac6226a41c131bcde4c8cf2ecfa221da3bc798c37dbfc9ac2 | may-liu/qtalk | ejabberd_regexp.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_regexp.erl
Author :
Purpose : Frontend to Re and Regexp OTP modules
Created : 8 Dec 2011 by
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
%%%
%%% This program is free software; you can redistribut... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/ejabberd_regexp.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_regexp.erl
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without ev... | Author :
Purpose : Frontend to Re and Regexp OTP modules
Created : 8 Dec 2011 by
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of th... |
2b0628e9cf4e7aa917f0b86353a4eb3ec25b81a0e6b068a29e79dcc817843fb3 | minio/minio-hs | ListIncompleteUploads.hs | #!/usr/bin/env stack
-- stack --resolver lts-14.11 runghc --package minio-hs
--
MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc.
--
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
... | null | https://raw.githubusercontent.com/minio/minio-hs/d59f45fec4481313cfb5fafd635558ce385e7422/examples/ListIncompleteUploads.hs | haskell | stack --resolver lts-14.11 runghc --package minio-hs
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
S... | #!/usr/bin/env stack
MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
import Conduit
import Network.Minio
import Prelude
| The following example uses 's play server at... |
317cbf648fcdf1fbe9fa53a517602e7b908a7addc106d81919d7176570d73875 | leafclick/pgmig | unclogging.clj | (ns alexandermann.unclogging
(:require [clojure.string :as string]
[clojure.walk :as walk]
[taoensso.timbre :as log]
[taoensso.timbre :as timbre])
(:import [clojure.lang
ArraySeq
LazySeq]
[java.util.logging Level
Lo... | null | https://raw.githubusercontent.com/leafclick/pgmig/60dcbe719d83479cf8c4df39d3eeba28dcfad8f5/src/clj/alexandermann/unclogging.clj | clojure | (ns alexandermann.unclogging
(:require [clojure.string :as string]
[clojure.walk :as walk]
[taoensso.timbre :as log]
[taoensso.timbre :as timbre])
(:import [clojure.lang
ArraySeq
LazySeq]
[java.util.logging Level
Lo... | |
c4b78dfc20754c1eb8780acc63d6257df95deb9d6b4b492ce9bd58ed869d5cbb | janestreet/virtual_dom | help_text.ml | open Core
open Import
module View_spec = struct
type t =
{ key : string -> Vdom.Node.t
; plain_text : string -> Vdom.Node.t
}
let plain =
let open Vdom in
{ key = Node.text; plain_text = Node.text }
;;
let with_classes ~key_class ~plain_text_class =
let text_span class_ text =
l... | null | https://raw.githubusercontent.com/janestreet/virtual_dom/3dd6e8080bdc54fe32e1e9701700ad27df81bf83/keyboard/src/help_text.ml | ocaml | open Core
open Import
module View_spec = struct
type t =
{ key : string -> Vdom.Node.t
; plain_text : string -> Vdom.Node.t
}
let plain =
let open Vdom in
{ key = Node.text; plain_text = Node.text }
;;
let with_classes ~key_class ~plain_text_class =
let text_span class_ text =
l... | |
88d31f95ec4f875396a0be71ed3b60832fe98ebcaec87461000dfcee5fae1025 | jaredly/reason-language-server | typedecl.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
and ,... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/407/typedecl.ml | ocaml | ************************************************************************
OCaml
... | and , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Asttypes
open Parsetree
open Primitive
open Types
open Typetexp
type native_repr_kind = Unboxed | Unta... |
5747e5b13ca7edfc9527c4d97f75e6880e1a8b579cb113fcfc73944113695ce3 | mbenke/zpf2013 | TimeIt.hs | module TimeIt(timeIt, timeItT) where
import System.CPUTime
import Text.Printf
-- |Wrap an 'IO' computation so that it prints out the execution time.
timeIt :: IO a -> IO a
timeIt ioa = do
(t, a) <- timeItT ioa
printf "CPU time: %6.2fs\n" t
return a
|Wrap an ' IO ' computation so that it returns executio... | null | https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/Concur/TimeIt.hs | haskell | |Wrap an 'IO' computation so that it prints out the execution time. | module TimeIt(timeIt, timeItT) where
import System.CPUTime
import Text.Printf
timeIt :: IO a -> IO a
timeIt ioa = do
(t, a) <- timeItT ioa
printf "CPU time: %6.2fs\n" t
return a
|Wrap an ' IO ' computation so that it returns execution time is seconds as well as the real value .
timeItT :: IO a -> IO (Do... |
f5af8e2f19b6b9380e0174449c3b6acf7b76909780504acad2c4c594e675aea9 | adamdoupe/find_ear_rails | forest.ml | open Forest_parser
open Forest_lexer
open Parse_tree
let () = Printf.printf "
Print a parse forest for a small grammar
Grammar :
S -> E
E -> int
E -> E + E
example : 1+2+3 yields
((1+2)+3)
(1+(2+3))
'q' to quit
"
let () = flush stdout
let lexbuf = Lexing.from_channel stdin
let print_forest forest =
let rec aux... | null | https://raw.githubusercontent.com/adamdoupe/find_ear_rails/38f892f9962ad415a583973caf24fbab1a011be1/diamondback-ruby-0.20090726/dypgen-20070627/demos/forest/forest.ml | ocaml | open Forest_parser
open Forest_lexer
open Parse_tree
let () = Printf.printf "
Print a parse forest for a small grammar
Grammar :
S -> E
E -> int
E -> E + E
example : 1+2+3 yields
((1+2)+3)
(1+(2+3))
'q' to quit
"
let () = flush stdout
let lexbuf = Lexing.from_channel stdin
let print_forest forest =
let rec aux... | |
4669a53d2530781239f17787d4fd304a240cb53426cbdec8b72b1a71fb19d0d9 | dsheets/ocaml-sodium | test_auth.ml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/dsheets/ocaml-sodium/1f064fa90cd02c44e2dcc0708d4ba3a256a9c1f2/lib_test/test_auth.ml | ocaml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
2ff99983d9b8b672119c4fae851a199f40c0f51babd11ce48bf219b1b7daa00e | andrewthad/sockets | MutableBytes.hs | # language BangPatterns #
# language DataKinds #
# language NamedFieldPuns #
module Socket.Connected.MutableBytes
( Buffer
, Peer
, advance
, length
, send
) where
import Prelude hiding (length)
import Data.Bytes.Types (MutableBytes(MutableBytes))
import Socket.MutableBytes (Buffer,length,advance)
import... | null | https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/src-internal/Socket/Connected/MutableBytes.hs | haskell | socket, not a stream socket. | # language BangPatterns #
# language DataKinds #
# language NamedFieldPuns #
module Socket.Connected.MutableBytes
( Buffer
, Peer
, advance
, length
, send
) where
import Prelude hiding (length)
import Data.Bytes.Types (MutableBytes(MutableBytes))
import Socket.MutableBytes (Buffer,length,advance)
import... |
c195f16536f7ae891357e04a4c135cb8f10564fa628b9bf9dbe60bfc9a201ce0 | Apress/java-image-processing-recipes | videosample.clj | (ns opencv3.videosample
(:require
[opencv3.core :refer :all]
[opencv3.video :as v]
[opencv3.utils :as u]))
(defn -main[ & args]
(u/simple-cam-window
(fn [buffer]
(u/resize-by buffer 0.5)
(let [ output (new-mat) bottom (-> buffer clone (flip! -1)) ]
(-> buffer (cvt-color! COLOR_RGB2GRAY... | null | https://raw.githubusercontent.com/Apress/java-image-processing-recipes/dd59c00838c4261c118d81f08bcef1e3456fe01b/SOURCES/CODE2/sample-cljcv/test/opencv3/videosample.clj | clojure | (ns opencv3.videosample
(:require
[opencv3.core :refer :all]
[opencv3.video :as v]
[opencv3.utils :as u]))
(defn -main[ & args]
(u/simple-cam-window
(fn [buffer]
(u/resize-by buffer 0.5)
(let [ output (new-mat) bottom (-> buffer clone (flip! -1)) ]
(-> buffer (cvt-color! COLOR_RGB2GRAY... | |
dccd1fdd52353c33edfa09801c93d78b3630af645bf5a7fa34aef6262deaa474 | mmottl/gsl-ocaml | do_common.ml | let channel_with_file open_ch close_ch name ~f =
let ch = open_ch name in
Fun.protect ~finally:(fun () -> close_ch ch) (fun () -> f ch)
module In_channel = struct
let with_file file = channel_with_file open_in close_in file
let rec iter_lines ic ~f =
match input_line ic with
| line -> f line; iter_lin... | null | https://raw.githubusercontent.com/mmottl/gsl-ocaml/76f8d93cccc1f23084f4a33d3e0a8f1289450580/src/config/do_common.ml | ocaml | In_channel
Out_channel | let channel_with_file open_ch close_ch name ~f =
let ch = open_ch name in
Fun.protect ~finally:(fun () -> close_ch ch) (fun () -> f ch)
module In_channel = struct
let with_file file = channel_with_file open_in close_in file
let rec iter_lines ic ~f =
match input_line ic with
| line -> f line; iter_lin... |
e450c6139f1bbc5a9288c3c8bd9b33433ab0719f8a651671b3100275754524de | LuisThiamNye/chic | stacktrace.clj | (ns chic.error.stacktrace
(:require
[chic.clj.source :as clj.source]
[taoensso.encore :as enc]
[io.github.humbleui.paint :as huipaint]
[chic.debug :as debug]
[chic.style :as style]
[chic.ui :as cui]
[chic.ui.layout :as cuilay]
[clojure.repl :as repl]
[clojure.string :as str]
[io.github.h... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/error/stacktrace.clj | clojure | (= "invoke" (:method-name frame))
last element is non-repeated frames | (ns chic.error.stacktrace
(:require
[chic.clj.source :as clj.source]
[taoensso.encore :as enc]
[io.github.humbleui.paint :as huipaint]
[chic.debug :as debug]
[chic.style :as style]
[chic.ui :as cui]
[chic.ui.layout :as cuilay]
[clojure.repl :as repl]
[clojure.string :as str]
[io.github.h... |
22057ba95af7669136df328b9d94fd92b4478f60cc6c129a0374db1dcd8806ab | REPROSEC/dolev-yao-star | Lib_UpdateMulti_Lemmas.ml | open Prims
type uint8 = FStar_UInt8.t
let repeat_f :
'a .
Prims.pos ->
('a -> uint8 FStar_Seq_Base.seq -> 'a) ->
uint8 FStar_Seq_Base.seq -> 'a -> 'a
= fun block_length -> fun update -> fun b -> fun acc -> update acc b
let repeat_l :
'a .
Prims.pos ->
('a -> uint8 FStar_Seq_Base.seq ... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Lib_UpdateMulti_Lemmas.ml | ocaml | open Prims
type uint8 = FStar_UInt8.t
let repeat_f :
'a .
Prims.pos ->
('a -> uint8 FStar_Seq_Base.seq -> 'a) ->
uint8 FStar_Seq_Base.seq -> 'a -> 'a
= fun block_length -> fun update -> fun b -> fun acc -> update acc b
let repeat_l :
'a .
Prims.pos ->
('a -> uint8 FStar_Seq_Base.seq ... | |
824ed5d21ee5d237bff7a298070363ed05bb92a40fec20ca02311d61632e7ccd | tommaisey/aeon | pv-mag-shift.help.scm | ;; (pv-mag-shift buffer stretch shift)
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/fft/pv-mag-shift.help.scm | scheme | (pv-mag-shift buffer stretch shift) | |
24ec14b636ffa288d60449efd7a885ec00ccf4c71889d3680bfef4fcd5b01ed9 | mstksg/inCode | Archive.hs | {-# LANGUAGE LambdaCase #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
module Blog.Rule.Archive where
import Blog.Types
import Blog.Util
import Control.Monad
import Data.Maybe
import Data.Time.Calendar
import Data.Time.LocalTime
import ... | null | https://raw.githubusercontent.com/mstksg/inCode/e1f80a3dfd83eaa2b817dc922fd7f331cd1ece8a/src/Blog/Rule/Archive.hs | haskell | # LANGUAGE LambdaCase #
where
let (y, m, _) = toGregorian $ localDay t
in (y, toEnum (m - 1)) | # LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
module Blog.Rule.Archive where
import Blog.Types
import Blog.Util
import Control.Monad
import Data.Maybe
import Data.Time.Calendar
import Data.Time.LocalTime
import Hakyll
import qualified ... |
13477b6f262484ed0bcf910ec4cd24976e49e9391aa4d0257c9fa71f295f6e60 | artyom-poptsov/guile-deck | presence.scm | ;;; presence.scm -- A description of <presence> class.
Copyright ( C ) 2021 < >
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;; (at your optio... | null | https://raw.githubusercontent.com/artyom-poptsov/guile-deck/417296482ad2d8ce3064efab8e098072e3da6c7f/modules/deck/core/types/presence.scm | scheme | presence.scm -- A description of <presence> class.
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
The program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR... |
Copyright ( C ) 2021 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(define-module (deck core types presence)
#:use-module (oop goops)
... |
f9da545679ddb5b3e80170ed9685db2627bd84b598c303f25498cfb8798570ef | borkdude/speculative | clj_2443.cljc | (ns patch.clj-2443
(:require
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]))
(in-ns 'clojure.spec.test.alpha)
(defn- spec-checking-fn
[v f fn-spec]
(let [fn-spec (@#'s/maybe-spec fn-spec)
args-spec (:args fn-spec)
conform! (fn [v role spec data args]
(wh... | null | https://raw.githubusercontent.com/borkdude/speculative/4e773794a4065a84bdadd997516e52c76ab51b1f/src/patch/clj_2443.cljc | clojure | (ns patch.clj-2443
(:require
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]))
(in-ns 'clojure.spec.test.alpha)
(defn- spec-checking-fn
[v f fn-spec]
(let [fn-spec (@#'s/maybe-spec fn-spec)
args-spec (:args fn-spec)
conform! (fn [v role spec data args]
(wh... | |
8d3b2bdb678c2f7a57cd2eb6e3adeb46474bb06a08f5abfea0813ec44bdea195 | jimpil/Clondie24 | util.clj | (ns Clondie24.lib.util
(:require [clojure.pprint :refer [pprint, print-table]]
;[clojure.math.combinatorics :as combi]
[clojure.edn :as edn]))
;----------------------------------------<SOURCE>--------------------------------------------------------------------
;-------------... | null | https://raw.githubusercontent.com/jimpil/Clondie24/7045fab11bfd6e94cd95c032149a97146bae8d89/src/Clondie24/lib/util.clj | clojure | [clojure.math.combinatorics :as combi]
----------------------------------------<SOURCE>--------------------------------------------------------------------
----------------------------------------<CODE>----------------------------------------------------------------------
Helper fn for creting Points
returning nil here... | (ns Clondie24.lib.util
(:require [clojure.pprint :refer [pprint, print-table]]
[clojure.edn :as edn]))
(set! *unchecked-math* true)
(set! *warn-on-reflection* true)
(defn- with-thread-pool* [num-threads f]
(let [pool (java.util.concurrent.Executors/newFixedThreadPool num-threads)]
... |
c27654f3f875e5cbe7901bb3569a3e30bc081359e132ae98c3633bf26b796f23 | janestreet/core_kernel | bench_pooled_hashtbl.ml | open! Core
open! Pooled_hashtbl
let%bench_module "Pooled_hashtbl" =
(module struct
(* Big enough so that the arrays are not allocated on the minor. Minor allocations
should be small and independent of the size. *)
let size = 512
let create () =
let t = Poly.create ~size () in
for i = ... | null | https://raw.githubusercontent.com/janestreet/core_kernel/597299d11c2ee99f219592d89a5890f8f0b6dfe7/pooled_hashtbl/bench/bench_pooled_hashtbl.ml | ocaml | Big enough so that the arrays are not allocated on the minor. Minor allocations
should be small and independent of the size. | open! Core
open! Pooled_hashtbl
let%bench_module "Pooled_hashtbl" =
(module struct
let size = 512
let create () =
let t = Poly.create ~size () in
for i = 1 to size do
add_exn t ~key:i ~data:42
done;
t
;;
let%bench "create" = create ()
let%bench "create+resize" = ... |
1c6f7ca5be085bca25f5ed6170845a8f9cf8fba74166b6330658710b41d3128b | joelburget/react-haskell | SimpleAnim.hs | {-# LANGUAGE OverloadedStrings, NamedFieldPuns, LiberalTypeSynonyms #-}
module SimpleAnim (simpleAnimClass) where
import React
import Prelude hiding (fst, snd)
import Data.Map
-- model
data ClassState = ClassState
{ fst :: JSString
, snd :: JSString
, cur :: JSString
}
data Transition
= Typing ... | null | https://raw.githubusercontent.com/joelburget/react-haskell/5de76473b7cfdd6b85ac618bea31e658794b54e2/example/animation/SimpleAnim.hs | haskell | # LANGUAGE OverloadedStrings, NamedFieldPuns, LiberalTypeSynonyms #
model
update
view
animTop <- getAnimationState
change the input value as the user types
they enter | module SimpleAnim (simpleAnimClass) where
import React
import Prelude hiding (fst, snd)
import Data.Map
data ClassState = ClassState
{ fst :: JSString
, snd :: JSString
, cur :: JSString
}
data Transition
= Typing JSString
| Enter
type AnimationState = Map JSString Double
type SimpleAnim ... |
7a9a9a623447d91cedbe2873589d27d6f2510dc3402e16f5ef1e8192be5c9caa | ssor/erlangDemos | cowboy_websocket_demo_sup.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(cowboy_websocket_demo_sup).
-behaviour(supervisor).
-export([start_link/0]). %% API.
-export([init/1]). %% supervisor.
-define(SUPERVISOR, ?MODULE).
%% API.
-spec start_link() -> {ok, Pid::pid()}.
start_link() ->
supervisor:start_link({local, ?SU... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/cowboy_examples/websocket_demo/src/cowboy_websocket_demo_sup.erl | erlang | Feel free to use, reuse and abuse the code in this file.
API.
supervisor.
API.
supervisor. |
-module(cowboy_websocket_demo_sup).
-behaviour(supervisor).
-define(SUPERVISOR, ?MODULE).
-spec start_link() -> {ok, Pid::pid()}.
start_link() ->
supervisor:start_link({local, ?SUPERVISOR}, ?MODULE, []).
init([]) ->
{ok, {{one_for_one, 10, 10}, []}}.
|
e796b351641b732debe1679c3977668281e64e3aece14277a489d91355de6de6 | pjotrp/guix | vm.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 , 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/build/vm.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2014 , 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu build vm)
#:use-module (guix build utils)
#:use-module (guix build store-cop... |
6ebe52bb043931c6937f857b2dc7ee1e53d8a06e36d53c73769c9a1306fb7d7e | eugenkiss/7guis-Clojure-Seesaw | flightbooker.clj | (ns sevenguis.flightbooker
(:use [seesaw core]
sevenguis.core)
(:require [seesaw.bind :as b]))
(defn date->str [date]
(.format (java.text.SimpleDateFormat. "dd.MM.yyyy") date))
(defn str->date [str]
(let [str (.trim str)
date-format (java.text.SimpleDateFormat. "dd.MM.yyyy")
date (.parse d... | null | https://raw.githubusercontent.com/eugenkiss/7guis-Clojure-Seesaw/4ab08883ee0fbc6daa7e573d11b130b546189b67/src/sevenguis/flightbooker.clj | clojure | Regarding the color of the text fields.
Regarding the status of the return date text field.
Regarding the status of the book button.
An ideal solution would like something like the following.
Note that I would not have to explicitly funnel flight-type, start-date
and return-date (it should be figured out automati... | (ns sevenguis.flightbooker
(:use [seesaw core]
sevenguis.core)
(:require [seesaw.bind :as b]))
(defn date->str [date]
(.format (java.text.SimpleDateFormat. "dd.MM.yyyy") date))
(defn str->date [str]
(let [str (.trim str)
date-format (java.text.SimpleDateFormat. "dd.MM.yyyy")
date (.parse d... |
a19c3a311d43d6e786b52d9d50491180a02e1e7a15cf237204e6bdd77206a412 | Perry961002/SICP | exa3.5.3-calculation-stream.scm |
(define (average x y)
(/ (+ x y) 2))
(define (sqrt-improve guess x)
(average guess (/ x guess)))
(define (sqrt-stream x)
(define guess
(stream-cons 1.0
(stream-map (lambda (guess)
(sqrt-improve guess x))
g... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap3/example/exa3.5.3-calculation-stream.scm | scheme | 序列加速器
超级加速器,构造流的流
------------------------------------------------------------------
序对的无穷流
将两个序对交替取出
s1,t1,s2,t2,...,si,ti,...
序对流
(display-top10 (pairs integers integers))
----------------------------------------------------------------
将流作为信号
两个流相加 |
(define (average x y)
(/ (+ x y) 2))
(define (sqrt-improve guess x)
(average guess (/ x guess)))
(define (sqrt-stream x)
(define guess
(stream-cons 1.0
(stream-map (lambda (guess)
(sqrt-improve guess x))
g... |
311e5707abeea5d81ef14fdd7508fca301da90f3ed64ad9bea8ba7b226d15dfc | polyfy/polylith | projects_from_disk.clj | (ns polylith.clj.core.workspace-clj.projects-from-disk
(:require [clojure.set :as set]
[clojure.string :as str]
[clojure.tools.deps.util.maven :as mvn]
[polylith.clj.core.common.interface.config :as config]
[polylith.clj.core.file.interface :as file]
[polyli... | null | https://raw.githubusercontent.com/polyfy/polylith/e3bc4556f5efa0346bd144dfe579a7a453a4464d/components/workspace-clj/src/polylith/clj/core/workspace_clj/projects_from_disk.clj | clojure | todo: support filtering on individual bricks. | (ns polylith.clj.core.workspace-clj.projects-from-disk
(:require [clojure.set :as set]
[clojure.string :as str]
[clojure.tools.deps.util.maven :as mvn]
[polylith.clj.core.common.interface.config :as config]
[polylith.clj.core.file.interface :as file]
[polyli... |
c79918eb2b53a4d31d814afdfcc7222d8f2b63e3d48a21bbd41cdcd962b06a2c | ocaml-dune/fiber | fiber_lwt.mli | (** Lwt integration for fibers *)
module Fiber_inside_lwt : sig
val run : 'a Fiber.t -> 'a Lwt.t
(** Should only be called inside a [run] *)
val callback_to_lwt : (unit -> 'a Lwt.t) -> ('a, exn) result Fiber.t
end
| null | https://raw.githubusercontent.com/ocaml-dune/fiber/0b322636da0d0cce5b8dd2179b6197a4d765d09a/fiber-lwt/fiber_lwt.mli | ocaml | * Lwt integration for fibers
* Should only be called inside a [run] |
module Fiber_inside_lwt : sig
val run : 'a Fiber.t -> 'a Lwt.t
val callback_to_lwt : (unit -> 'a Lwt.t) -> ('a, exn) result Fiber.t
end
|
0363b1315bfc2972d1e10aaf2443267b69e33215415dcd0ef6e18030ae0f7e9c | thelema/ocaml-community | frx_text.mli | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of OCaml
(* *)
, , and ... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/frx/frx_text.mli | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of OCaml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
c2322716f90a8015bd2c77a8d64737d52073d9873de1f1e1573770f3b83170eb | semilin/layoup | lela.lisp |
(MAKE-LAYOUT :NAME "lela" :MATRIX
(APPLY #'KEY-MATRIX '("ylwkjzfou." "crstvbnaei" "xmgdqph';,"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/lela.lisp | lisp |
(MAKE-LAYOUT :NAME "lela" :MATRIX
(APPLY #'KEY-MATRIX '("ylwkjzfou." "crstvbnaei" "xmgdqph';,"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
2d1b80d4083760742887b34d1acccf4e93dcfdab018cccad9c70ce41cf660416 | GaloisInc/HaLVM | IOPorts.hs | BANNERSTART
- Copyright 2006 - 2008 , Galois , Inc.
- This software is distributed under a standard , three - clause BSD license .
-- - Please see the file LICENSE, distributed with this software, for specific
-- - terms and conditions.
Author : Iavor < >
BANNEREND
module Hypervisor.IOPorts
( IOPort
, i... | null | https://raw.githubusercontent.com/GaloisInc/HaLVM/3ec1d7e4b6bcb91304ba2bfe8ee280cb1699f24d/src/HALVMCore/Hypervisor/IOPorts.hs | haskell | - Please see the file LICENSE, distributed with this software, for specific
- terms and conditions. | BANNERSTART
- Copyright 2006 - 2008 , Galois , Inc.
- This software is distributed under a standard , three - clause BSD license .
Author : Iavor < >
BANNEREND
module Hypervisor.IOPorts
( IOPort
, in8, in16, in32
, out8, out16, out32
) where
import Data.Word
type IOPort = Word16
foreign import cc... |
f41f516806182ee63109538d66d75995d901caeaafd8d61480b39a0bb5a719d6 | hyperfiddle/electric | hfql_sub_editor.cljc | (ns dustin.y2022.hfql.hfql-sub-editor
(:require [clojure.spec.alpha :as s]
[hyperfiddle.api :as hf]
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui2 :as ui])
#?(:cljs (:require-macros dustin.y2022.hfql.hfql-sub-editor)))
(defn scho... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/hfql/hfql_sub_editor.cljc | clojure | route cycle
emit inline
won't work, no specs for 'school etc | (ns dustin.y2022.hfql.hfql-sub-editor
(:require [clojure.spec.alpha :as s]
[hyperfiddle.api :as hf]
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui2 :as ui])
#?(:cljs (:require-macros dustin.y2022.hfql.hfql-sub-editor)))
(defn scho... |
9dec1001531a3a55955fc739d8e34298080203d83fd99fdac0fabe756d6e742c | thomcc/dunjeon | frame.clj | (ns dunjeon.frame
(:use [dunjeon.core :only [create-ui]])
(:import [java.awt BorderLayout]
[javax.swing JFrame JPanel SwingUtilities]
[java.awt.event KeyListener])
(:gen-class))
(defn init-frame []
(let [{:keys [^JPanel panel, ^KeyListener ka]} (create-ui)]
(doto (JFrame. "(dunjeon)")... | null | https://raw.githubusercontent.com/thomcc/dunjeon/9114076282e7f29a31124cda7fe5e1a090831990/src/dunjeon/frame.clj | clojure | (ns dunjeon.frame
(:use [dunjeon.core :only [create-ui]])
(:import [java.awt BorderLayout]
[javax.swing JFrame JPanel SwingUtilities]
[java.awt.event KeyListener])
(:gen-class))
(defn init-frame []
(let [{:keys [^JPanel panel, ^KeyListener ka]} (create-ui)]
(doto (JFrame. "(dunjeon)")... | |
5453c74fcaafe53d57adb9521e982df191dfe603d1d5f72b062cabc371dcafd7 | bobzhang/fan | demo1.ml | Simplest possible use for embedded Prolog
*
* Compile with :
* ocamlc -pp ' .. / .. /fan.run -keep -plugin plc ' -o demo1 demo1.ml
*
* Add -dsource to command to see what actually gets compiled
* Executing ./demo1 should output cheese
*
* Compile with:
* ocamlc -pp '../../fan.run -keep -p... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/unitest/plc/demo1.ml | ocaml | Simplest possible use for embedded Prolog
*
* Compile with :
* ocamlc -pp ' .. / .. /fan.run -keep -plugin plc ' -o demo1 demo1.ml
*
* Add -dsource to command to see what actually gets compiled
* Executing ./demo1 should output cheese
*
* Compile with:
* ocamlc -pp '../../fan.run -keep -p... | |
3a798f0c9011c09d07b4eb7c16959be6ed28fbdd240dd66c5197fa77bffe0d23 | rmloveland/scheme48-0.53 | ddata.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
Stuff moved from segment.scm 6/5/93
Some of that stuff moved to state.scm 4/28/95
; Debug-data records are for communicating information from the
; compiler to various debugging tools.
; An environment map has the form
; #(pc-before pc-after #(na... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/bcomp/ddata.scm | scheme | Debug-data records are for communicating information from the
compiler to various debugging tools.
An environment map has the form
#(pc-before pc-after #(name ...) (env-map ...))
environment. The names indicate which variables become bound at
pc-before, and the list of env-maps is for inferior (deeper)
enviro... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
Stuff moved from segment.scm 6/5/93
Some of that stuff moved to state.scm 4/28/95
where the two pc 's delimit the region of code that executes in this
is returning the value of i'th subexpression in the source expression .
(define-record-typ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.