_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 |
|---|---|---|---|---|---|---|---|---|
631b2e37ced49d6ede8af586d035a1eeb0db68cbd28be2d1838a0b9311375bf0 | turion/has-transformers | TwoReaders.hs | module Examples.TwoReaders where
import "has-transformers" Control.Monad.Trans.Has.Reader
| Our " business logic " program using two ' ReaderT ' effects .
-- Note that we use a type signature to help the type checker understand
-- which environment is which.
program ::
(Monad m, HasReader Int m, HasReader Boo... | null | https://raw.githubusercontent.com/turion/has-transformers/09bef863777a151a113e5984c9af468881fa4096/examples/Examples/TwoReaders.hs | haskell | Note that we use a type signature to help the type checker understand
which environment is which.
| The 'Int' environment we are going to supply
| The 'Bool' environment we are going to supply
| For documentation, this is the stack that will be handled.
(But we don't actually ever use this type alias.)
| T... | module Examples.TwoReaders where
import "has-transformers" Control.Monad.Trans.Has.Reader
| Our " business logic " program using two ' ReaderT ' effects .
program ::
(Monad m, HasReader Int m, HasReader Bool m) =>
m (Int, Bool)
program = do
envInt <- ask
envBool <- ask
return (envInt, envBool)
envInt :: ... |
db7dbeb49d3cfedfcc371f1eae66565e7b7a74bbcf8bc30277ad697e822d25e2 | ih/ikarus.dev | tests-2.4-req.scm |
(add-tests-with-string-output "letrec"
[(letrec () 12) => "12\n"]
[(letrec ([f 12]) f) => "12\n"]
[(letrec ([f 12] [g 13]) (fx+ f g)) => "25\n"]
[(letrec ([fact
(lambda (n)
(if (fxzero? n)
1
(fx* n (fact (fxsub1 n)))))])
(fact 5)) => "120\n... | null | https://raw.githubusercontent.com/ih/ikarus.dev/8bb0c8e4d1122cf0f9aeb675cb51bc7df178959b/scheme/tests/tests-2.4-req.scm | scheme |
(add-tests-with-string-output "letrec"
[(letrec () 12) => "12\n"]
[(letrec ([f 12]) f) => "12\n"]
[(letrec ([f 12] [g 13]) (fx+ f g)) => "25\n"]
[(letrec ([fact
(lambda (n)
(if (fxzero? n)
1
(fx* n (fact (fxsub1 n)))))])
(fact 5)) => "120\n... | |
8f57a1ed4654efe68e9413ed87db1cb13e03468410fc040c5227379d8836c516 | kadena-io/chainweaver | Impl.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Standa... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/5d40e91411995e0a9a7e782d6bb2d89ac1c65d52/frontend/src/Frontend/ModuleExplorer/Impl.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
License : BSD-style (see the file LICENSE)
* Interface
* Types
* Creation
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------... | # LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
... |
392acd0a1a18f994d3beb709bbe41bf080f357de170135173f27cf679f95eaf1 | zotonic/cowmachine | main_app.erl | -module(main_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
Name = cowmachine_listener,
TransportOpts = [ inet, {port, 1234} ],
ProtocolOpts = cowboy_options(),
{ok, _} = cowboy:start_clear(
Name,
TransportOpts,
ProtocolOpts).
stop(_State) ->
... | null | https://raw.githubusercontent.com/zotonic/cowmachine/ad592a3e70ccce87434e3555c58fa1664bfa00c6/examples/controller_functions/apps/main/src/main_app.erl | erlang | internal functions
Use this module as middleware, and controller | -module(main_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
Name = cowmachine_listener,
TransportOpts = [ inet, {port, 1234} ],
ProtocolOpts = cowboy_options(),
{ok, _} = cowboy:start_clear(
Name,
TransportOpts,
ProtocolOpts).
stop(_State) ->
... |
57e37d49a99c3f98cf682030f170adf4922467b6126a29b2cc42c5feee68a520 | pentlandedge/s4607 | stanag_types.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright 2016 Pentland Edge Ltd.
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
%% use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% U... | null | https://raw.githubusercontent.com/pentlandedge/s4607/b3cdae404ac5bd50419f33259dfa62af9d1a8d60/src/stanag_types.erl | erlang |
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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitati... | Copyright 2016 Pentland Edge Ltd.
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
@doc The Stanag 4607 standard defines a number of types which are used
-module(stanag_types).
-export([
i8_to_int... |
e3bd7df54f29b5eff5ab0c42caf13571d3c01da24a1fc8e361fc8996f3230369 | jwiegley/categorical | Gather.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Categorical.Gather where
import ConCat.Category
import ConCat.Rep
import Prelude hiding (id, (.), curry, uncurry, const)
newtype Gather a b = Gather { runGather :: Int }
gather :: Gat... | null | https://raw.githubusercontent.com/jwiegley/categorical/dc2b5e55a3c953db97d035b6c7768d46de23e9f9/src/Categorical/Gather.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Categorical.Gather where
import ConCat.Category
import ConCat.Rep
import Prelude hiding (id, (.), curry, uncurry, const)
newtype Gather a b = Gather { runGather :: Int }
gather :: Gat... | |
c4771c9e3d2a66d07ccb2a81b117095a76fdc919210aff901a6902834190fb9d | reifyhealth/specmonstah | 12.clj | (ns reifyhealth.specmonstah-tutorial.12
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[reifyhealth.specmonstah.core :as sm]
[reifyhealth.specmonstah.spec-gen :as sg]))
(def id-seq (atom 0))
(s/def ::id (s/with-gen pos-int?
#(gen/fmap (fn [_] (... | null | https://raw.githubusercontent.com/reifyhealth/specmonstah/afe38e7a39149836c31719f7e36a7504c14dbb80/tutorial/reifyhealth/specmonstah_tutorial/12.clj | clojure | the visiting function into multiple functions. | (ns reifyhealth.specmonstah-tutorial.12
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[reifyhealth.specmonstah.core :as sm]
[reifyhealth.specmonstah.spec-gen :as sg]))
(def id-seq (atom 0))
(s/def ::id (s/with-gen pos-int?
#(gen/fmap (fn [_] (... |
e2593f3d9e86cd84d4a17c1e58127943018c7396e99e4be52d3d56ed32b5fd12 | ghcjs/ghcjs-dom | Selection.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.Selection
(js_collapse, collapse, js_collapseToEnd, collapseToEnd,
js_collapseT... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/Selection.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/Selection.empty Mozilla Selection.empty documentation>
| <-US/docs/Web/API/Selection.modify Mozilla Selection.modify documentation>
| <-US/docs/Web/API/Selection.anchorNode Mozilla Selection.anchorNode ... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.Selection
(js_collapse, collapse, js_collapseToEnd, collapseToEnd,
js_collapseToStart, collapseToStart, js_deleteFromDocument,
deleteFromDocument, js_containsNode, contai... |
00a81d6630f2dc82b5a7c5fb19477ec6b79ccbf376187b21713aa3f929f74593 | tautologico/paip-ocaml | eliza1.ml |
*
* eliza1.ml
* Implementation of the ELIZA chat program
*
* From Chapter 5 of the book
* " Paradigms of Artificial Intelligence Programming " by
*
* , 2011 - 04 - 29
*
*
* eliza1.ml
* Implementation of the ELIZA chat program
*
* From Chapter 5 of the book
* "Paradigms of Art... | null | https://raw.githubusercontent.com/tautologico/paip-ocaml/cbc498506e247d149729917f37aa61d007188b2a/ch5-eliza/eliza1.ml | ocaml | Compile with ocamlc -o eliza -I .. ../util.cmo eliza1.ml
* Indicates pattern matching failure
* Indicates matching success, with no variables
* Is s a variable (a string beginning with '?')?
* Find a (var, value) pair in a binding list
* Add a (var, value) pair to a binding list
* Is this a segment matching patt... |
*
* eliza1.ml
* Implementation of the ELIZA chat program
*
* From Chapter 5 of the book
* " Paradigms of Artificial Intelligence Programming " by
*
* , 2011 - 04 - 29
*
*
* eliza1.ml
* Implementation of the ELIZA chat program
*
* From Chapter 5 of the book
* "Paradigms of Art... |
c1dc9603ae5b4586bfc08a990da881a2936c047580809f9398e14b28ab089c65 | tezos/tezos-mirror | durable.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 - 2023 TriliTech < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/a305d9ded27e234c7937fce7adfc1f199196283a/src/lib_scoru_wasm/test/durable_snapshot/durable.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 - 2023 TriliTech < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
7f33f9518536f0dfaf34f521d6c26af53f4c61c36c3bd1375c8d97fb38514540 | niquola/pg3 | backup.clj | (ns pg3.backup)
| null | https://raw.githubusercontent.com/niquola/pg3/5ae683813bd724fa2dad3162dcfb2b600f63bc7d/src/pg3/backup.clj | clojure | (ns pg3.backup)
| |
9a2c7b297347842a01b89924b3bde4420a340df4f95a3464180bc0a87cedf98c | stla/isosurfaces | Palettes.hs | module Colors.Palettes
(palettes, Palette)
where
import Data.Map.Strict (Map, fromList)
type Palette = [[Double]]
klingon :: Palette
klingon =
[
[1, 0.9804, 0.0471],
[0.9882, 0.9608, 0.0431],
[0.9804, 0.9451, 0.0392],
[0.9765, 0.9255, 0.0392],
[0.9686, 0.9098, 0.0353],
[0.9608... | null | https://raw.githubusercontent.com/stla/isosurfaces/c563ec5e6ab4ad41510f74bad407d34c5ac8a659/src/Colors/Palettes.hs | haskell | module Colors.Palettes
(palettes, Palette)
where
import Data.Map.Strict (Map, fromList)
type Palette = [[Double]]
klingon :: Palette
klingon =
[
[1, 0.9804, 0.0471],
[0.9882, 0.9608, 0.0431],
[0.9804, 0.9451, 0.0392],
[0.9765, 0.9255, 0.0392],
[0.9686, 0.9098, 0.0353],
[0.9608... | |
9a476f779f4afd2040e2bf65c13f1b6ab345f8f8be9cc667983fb14bde1fe2ed | racket/rhombus-prototype | import-invert.rkt | #lang racket/base
(require syntax/parse/pre
"space-in.rkt")
(provide import-invert)
(define (import-invert r orig-stx orig-r)
(define (disallow-dotted mp)
(syntax-parse mp
#:datum-literals (import-dotted)
[(import-dotted . _)
(raise-syntax-error #f "phase shifting not supported with ... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/dcf7fb9b002c0957fc0adbf9bd3475c26a8b2c01/rhombus/private/import-invert.rkt | racket | #lang racket/base
(require syntax/parse/pre
"space-in.rkt")
(provide import-invert)
(define (import-invert r orig-stx orig-r)
(define (disallow-dotted mp)
(syntax-parse mp
#:datum-literals (import-dotted)
[(import-dotted . _)
(raise-syntax-error #f "phase shifting not supported with ... | |
b974d28f4da38c3e6280f9240c26af118250e10bbb575356512ddf129b1825c4 | stylewarning/hypergeometrica | modular-arithmetic.lisp | ;;;; modular-arithmetic.lisp
;;;;
Copyright ( c ) 2019
(in-package #:hypergeometrica)
Modular Arithmetic ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
These two variables are for efficiency reasons only . They 're
;;; changeable at compile-time, and affect the moduli that are found
in # ' DEFAULT - MOD... | null | https://raw.githubusercontent.com/stylewarning/hypergeometrica/00062e5e6f838cb089dde078918bed879b6cccea/src/modular-arithmetic.lisp | lisp | modular-arithmetic.lisp
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
changeable at compile-time, and affect the moduli that are found
These are NOTINLINE'd below.
X divides M
Has a precondition that < 2^(64 + min-modulus-length)
r = r - q*m - m*2
B and its companion B-INV is intended to be calculated once,... | Copyright ( c ) 2019
(in-package #:hypergeometrica)
These two variables are for efficiency reasons only . They 're
in # ' DEFAULT - MODULI .
(defconstant +modulus-bits+ 63
"The number of bits that each modulus must have.")
(defconstant +lg-modulus+ (1- +modulus-bits+))
(defconstant $max-modulus (1- $base... |
06e17c62f3cb1d7c8415028505dc3631eb669a9b71f0ead8dec8b735800ba883 | hanshuebner/bknr-web | web-visitor.lisp | (in-package :bknr.web)
(define-persistent-class web-visitor-event (event)
((user :read :relaxed-object-reference t)
(session-id :read :initform nil)
(host :read))
(:documentation "web site being visited by a user"))
(define-persistent-class web-visitor-left-event (web-visitor-event)
()
(:documentation "... | null | https://raw.githubusercontent.com/hanshuebner/bknr-web/5c30b61818a2f02f6f2e5dc69fd77396ec3afc51/src/web/web-visitor.lisp | lisp | (in-package :bknr.web)
(define-persistent-class web-visitor-event (event)
((user :read :relaxed-object-reference t)
(session-id :read :initform nil)
(host :read))
(:documentation "web site being visited by a user"))
(define-persistent-class web-visitor-left-event (web-visitor-event)
()
(:documentation "... | |
114533074c13c61a237e2955e1bb64f5d6d83db09c7f0f2b1b35864874c0791c | l29ah/hatexmpp3 | IQAvatar.hs | -- |
Stability : Ultra - Violence
-- Portability : I'm too young to die
-- XEP-0008: IQ-Based Avatars
{-# LANGUAGE OverloadedStrings #-}
module Network.Xmpp.Extras.IQAvatar
( askIQAvatar
) where
import Data.XML.Types as DXT
import Network.Xmpp.Internal hiding (priority, status)
askIQAvatar jid = sendIQ' N... | null | https://raw.githubusercontent.com/l29ah/hatexmpp3/9d3e25c6acf4c0978a2c1d88b3572ad20b1c228d/Network/Xmpp/Extras/IQAvatar.hs | haskell | |
Portability : I'm too young to die
XEP-0008: IQ-Based Avatars
# LANGUAGE OverloadedStrings # | Stability : Ultra - Violence
module Network.Xmpp.Extras.IQAvatar
( askIQAvatar
) where
import Data.XML.Types as DXT
import Network.Xmpp.Internal hiding (priority, status)
askIQAvatar jid = sendIQ' Nothing (Just jid) Get Nothing (DXT.Element "query" [("xmlns", [DXT.ContentText "jabber:iq:avatar"])] []) []
|
a30e395112fd0d4bb122eec64d8251c804878336fec800c64b7621dd674ad92a | anwarmamat/cmsc330fall20 | disc4.mli | (*The functions we give you*)
val map : ('a -> 'b) -> 'a list -> 'b list
val foldl : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
val foldr : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
val get_last_element : 'a list -> 'a
val rev : 'a list -> 'a list
type student_information = { name : string; age : int; gpa : float; }
(*Th... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330fall20/1f185a757ad86c37587ec15d580ea0ff728d9472/disc4/src/disc4.mli | ocaml | The functions we give you
The functions we have you implement | val map : ('a -> 'b) -> 'a list -> 'b list
val foldl : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
val foldr : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
val get_last_element : 'a list -> 'a
val rev : 'a list -> 'a list
type student_information = { name : string; age : int; gpa : float; }
val mul_thresh : int list -> int -... |
240461766c4553e8e33ba0a60e63f95ab59b2e0a6e32061f89fc15ae03845fb6 | erlang/otp | diameter_codec_test.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2010 - 2023 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/diameter/test/diameter_codec_test.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2010 - 2023 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(diameter_codec_test).
-export([base/0,
gen/1,
lib/0]).
-include("diameter.hrl").
-defi... |
4c77d0d1ba99de12e7bfa1f561126e7e3a3014c31598f536d39ffb8d3bcade32 | stackbuilders/rollbar-haskell | Wai.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
Module : . Wai
Copyright : ( c ) 2020 Stack Builders Inc.
License : MIT
Maintainer : < >
--
-- For a fully working example check the following link:
--
-- <-haskell/blob/master/rollbar-wai/example/Main.hs>
module Rollbar.Wai
( rollbarOnException
, rollbarOnExcept... | null | https://raw.githubusercontent.com/stackbuilders/rollbar-haskell/4ed679e34a1ddf5859f4f44414744d1012ab5eaa/rollbar-wai/src/Rollbar/Wai.hs | haskell | # LANGUAGE OverloadedStrings #
|
For a fully working example check the following link:
<-haskell/blob/master/rollbar-wai/example/Main.hs>
'Settings'. Under the hood, this function uses 'createItem' function from
rollbar-client.
__Example__
> settings <- readSettings "rollbar.yaml"
> (setOnException (rollb... |
Module : . Wai
Copyright : ( c ) 2020 Stack Builders Inc.
License : MIT
Maintainer : < >
module Rollbar.Wai
( rollbarOnException
, rollbarOnExceptionWith
, mkRequest
) where
import qualified Data.CaseInsensitive as CI
import qualified Data.Aeson.KeyMap as KM
import qualified Data.Aeson.Key as K
im... |
5eefd36020104d6bd2e1d55a6e4b0c6e5b7d1c4b6d611c8b2b217c4c15c819f1 | haskell-opengl/OpenGLRaw | MultiDrawArrays.hs | --------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.EXT.MultiDrawArrays
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
---------------------------------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/EXT/MultiDrawArrays.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.EXT.MultiDrawArrays
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Functions | Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.EXT.MultiDrawArrays (
glGetEXTMultiDrawArrays,
gl_EXT_multi_draw_arrays,
glMultiDrawArraysEXT,
glMultiDrawElementsEXT
) where
import Graphics.GL.ExtensionPredicates
import Graphics.GL.Functions
|
b6fff51bd146bd01f3a3d52ae3195d37051d4f31f054443e65e8accf88d7b653 | sunshineclt/Racket-Helper | 6-SICP2.41-非递归非循环.rkt | #lang racket
(define (accumulate op init seq)
(if (null? seq)
init
(op (car seq) (accumulate op init (cdr seq)))))
(define (enumerate-interval a b)
(if (> a b)
'()
(cons a (enumerate-interval (+ a 1) b))))
(define (flatmap proc seq)
(accumulate append '() (map proc seq)))
(define (tri... | null | https://raw.githubusercontent.com/sunshineclt/Racket-Helper/bf85f38dd8d084db68265bb98d8c38bada6494ec/%E5%BE%90%E7%8E%89%E9%BA%9F/%E4%BD%9C%E4%B8%9A3/6-SICP2.41-%E9%9D%9E%E9%80%92%E5%BD%92%E9%9D%9E%E5%BE%AA%E7%8E%AF.rkt | racket | #lang racket
(define (accumulate op init seq)
(if (null? seq)
init
(op (car seq) (accumulate op init (cdr seq)))))
(define (enumerate-interval a b)
(if (> a b)
'()
(cons a (enumerate-interval (+ a 1) b))))
(define (flatmap proc seq)
(accumulate append '() (map proc seq)))
(define (tri... | |
117742d8f9e865d302d1c00361c843fdd4c466213fd271fe7877f23a933d64f1 | mokus0/junkbox | Adj2.hs |
- ` ` Adj2 ''
- ( c ) 2008
- ``Adj2''
- (c) 2008 James Cook
-}
# LANGUAGE
MultiParamTypeClasses ,
OverlappingInstances ,
FlexibleInstances ,
IncoherentInstances
#
MultiParamTypeClasses,
OverlappingInstances,
Flexible... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/TypeExperiments/Adj2.hs | haskell | left :: (f x -> y) -> (x -> g y)
right :: (x -> g y) -> (f x -> y)
vector space with a given set (type) as basis |
- ` ` Adj2 ''
- ( c ) 2008
- ``Adj2''
- (c) 2008 James Cook
-}
# LANGUAGE
MultiParamTypeClasses ,
OverlappingInstances ,
FlexibleInstances ,
IncoherentInstances
#
MultiParamTypeClasses,
OverlappingInstances,
Flexible... |
e9530d8a2a5ea239d3de6b9c3dafea9d434c7786307c197a9596d9d0d8f9e83e | ConsenSysMesh/Fae | Messages.hs | |
Module : Blockchain . Fae . Internal . MEssages
Description : Message types for Fae
Copyright : ( c ) , 2017 - 2018
License : MIT
Maintainer :
Stability : experimental
The structure of blocks and transactions as they are transmitted , plus
cryptography .
Module: Blockchain.Fae.Internal.MEssage... | null | https://raw.githubusercontent.com/ConsenSysMesh/Fae/3ff023f70fa403e9cef80045907e415ccd88d7e8/src/Blockchain/Fae/Internal/Messages.hs | haskell | * Types
| The transaction message as transmitted. This does not include the
full module files, but only their "previews", containing sufficient
information for the client to decide if the memory cost of requesting
the module is acceptable, and to request it if so.
| The digest uniquely identifies the module, and... | |
Module : Blockchain . Fae . Internal . MEssages
Description : Message types for Fae
Copyright : ( c ) , 2017 - 2018
License : MIT
Maintainer :
Stability : experimental
The structure of blocks and transactions as they are transmitted , plus
cryptography .
Module: Blockchain.Fae.Internal.MEssage... |
f1738ad2e0b70331bc7c3d07d19ceb9cf806bd72ac78231106926ecede6e9248 | lehins/hip | Lib.hs | -- |
-- Module : Lib
Copyright : ( c ) 2020
-- License : BSD3
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable
--
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
| null | https://raw.githubusercontent.com/lehins/hip/1386e83ad4c3e1bdb01f3d6bdec6fe40489dabd1/hip-chart/src/Lib.hs | haskell | |
Module : Lib
License : BSD3
Stability : experimental
Portability : non-portable
| Copyright : ( c ) 2020
Maintainer : < >
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
|
1fd92b43bb851a63c6c23eb654ffa521333e6b84824d1140de257fa01a5ea861 | jaked/ooauth | oauth_server.mli | module type Http =
sig
type request
val http_method : request -> [ `Get | `Post | `Head ]
val url : request -> string
val header : request -> string -> string (* throws Not_found *)
val argument : request -> ?default:string -> string -> string (* throws Not_found *)
val arguments : request -> (string * stri... | null | https://raw.githubusercontent.com/jaked/ooauth/8fa9d19570c7c5dea1036b5e9f5bbd945e51166d/oauth_server.mli | ocaml | throws Not_found
throws Not_found
throws Not_found
throws Not_found
throws Not_found
throws Failure
throws Failure
throws Not_found | module type Http =
sig
type request
val http_method : request -> [ `Get | `Post | `Head ]
val url : request -> string
val arguments : request -> (string * string) list
type response
val respond : request -> Nethttp.http_status -> (string * string) list -> string -> response
exception Error of Nethttp.ht... |
b7d0474618b604c1b67d3640c1db8a91e5d929da3d49ca249ffe86f9fabe5c64 | district0x/cljs-ipfs-api | misc.cljs | (ns cljs-ipfs-api.misc
(:require [taoensso.timbre :as timbre :refer-macros [log
trace
debug
info
w... | null | https://raw.githubusercontent.com/district0x/cljs-ipfs-api/01c5e6943d3cc5e0e54d436a796e98dc8145b0ba/src/cljs_ipfs_api/misc.cljs | clojure | (ns cljs-ipfs-api.misc
(:require [taoensso.timbre :as timbre :refer-macros [log
trace
debug
info
w... | |
0a7a9646a1e3f77d3b643ccb59c415c6bcb9d73b3a97495bc110f751092d7223 | polyfy/polylith | string_util_test.clj | (ns polylith.clj.core.util.string-util-test
(:require [clojure.test :refer :all]
[polylith.clj.core.util.interface.str :as str]))
(deftest skip-until--when-having-a-string-without-a-slash--return-nil
(is (= nil
(str/skip-until "user.clj" "/"))))
(deftest skip-until--when-having-a-string-with-... | null | https://raw.githubusercontent.com/polyfy/polylith/76936c752fb5b729c216b23d92c8a8d71cfdc92f/components/util/test/polylith/clj/core/util/string_util_test.clj | clojure | (ns polylith.clj.core.util.string-util-test
(:require [clojure.test :refer :all]
[polylith.clj.core.util.interface.str :as str]))
(deftest skip-until--when-having-a-string-without-a-slash--return-nil
(is (= nil
(str/skip-until "user.clj" "/"))))
(deftest skip-until--when-having-a-string-with-... | |
c61de645061b877398a61e8d0d48484f16a145fee220bef86cb23267d90ff2e0 | alwx/luno-react-native | core.cljs | (ns luno.android.core
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[luno.handlers]
[luno.subs]
[luno.shared.ui :as ui]
[luno.android.ui :as android-ui]
[luno.android.styles :as s]
[luno.andr... | null | https://raw.githubusercontent.com/alwx/luno-react-native/34f9f8b01c1248cf64f40be9638e8352fd8fd448/src/luno/android/core.cljs | clojure | (ns luno.android.core
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[luno.handlers]
[luno.subs]
[luno.shared.ui :as ui]
[luno.android.ui :as android-ui]
[luno.android.styles :as s]
[luno.andr... | |
e41eb572d21253eadc4a68897cd1553fe85732c59a3539b4bb56d1cd41351e43 | chrovis/cljam | option_test.clj | (ns cljam.io.sam.util.option-test
(:require [clojure.test :refer [deftest is are testing]]
[cljam.io.sam.util.option :as opt]))
(deftest parse-optional-field
(testing "regression"
(are [?str ?expect]
(and (= (opt/parse-optional-field ?str) ?expect)
(= (opt/stringify-optional-... | null | https://raw.githubusercontent.com/chrovis/cljam/2b8e7386765be8efdbbbb4f18dbc52447f4a08af/test/cljam/io/sam/util/option_test.clj | clojure | (ns cljam.io.sam.util.option-test
(:require [clojure.test :refer [deftest is are testing]]
[cljam.io.sam.util.option :as opt]))
(deftest parse-optional-field
(testing "regression"
(are [?str ?expect]
(and (= (opt/parse-optional-field ?str) ?expect)
(= (opt/stringify-optional-... | |
34325a4cc0458bfaf9e01d311542abb6ff1ca6064ad77fc54171af10ced5386f | kaoskorobase/mescaline | SSF.hs | # LANGUAGE
Arrows
, FlexibleInstances
, MultiParamTypeClasses
, RankNTypes
#
Arrows
, FlexibleInstances
, MultiParamTypeClasses
, RankNTypes
#-}
module Mescaline.Synth.SSF (
module Data.Signal.SF.Event
, State
-- , initially
, tag
, never
, once
, filter
, hold
, ac... | null | https://raw.githubusercontent.com/kaoskorobase/mescaline/13554fc4826d0c977d0010c0b4fb74ba12ced6b9/lib/mescaline/Mescaline/Synth/SSF.hs | haskell | , initially
* Switching
, switch'
, rswitch'
* Server state
import Control.Arrow.Transformer
import Control.Arrow.Transformer (lift)
app = ST (arr (\((ST f, x), s) -> (f, (x, s))) >>> app)
instance ArrowPlus SF where
Other instances
instance Alternative (SF a) where
f <|> g = f <+> g
... | # LANGUAGE
Arrows
, FlexibleInstances
, MultiParamTypeClasses
, RankNTypes
#
Arrows
, FlexibleInstances
, MultiParamTypeClasses
, RankNTypes
#-}
module Mescaline.Synth.SSF (
module Data.Signal.SF.Event
, State
, tag
, never
, once
, filter
, hold
, accum
, accumHold... |
aa4804e8c94a68ff08bea41df34f20a748732ad5eea35e4b484163275c9270a3 | NorfairKing/sydtest | AesonSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Test.Syd.AesonSpec (spec) where
import Control.Exception
import Control.Monad
import Data.Aeson as JSON
import Data.Text (Text)
import System.Directory (doesFileExist, removeFile)
import Test.Syd
import Test.Syd.Aeson
spec :: Spec
spec = do
... | null | https://raw.githubusercontent.com/NorfairKing/sydtest/d127699918efdf0b0c0c4dd2a3a8b2867b3e205d/sydtest-aeson/test/Test/Syd/AesonSpec.hs | haskell | # LANGUAGE OverloadedStrings #
Make sure there is nothing in the way
Try to write, this will fail
Make sure there is no file afterwards
Make sure there is nothing in the way
Try to write, this will fail
Make sure there is no file afterwards | # LANGUAGE ScopedTypeVariables #
module Test.Syd.AesonSpec (spec) where
import Control.Exception
import Control.Monad
import Data.Aeson as JSON
import Data.Text (Text)
import System.Directory (doesFileExist, removeFile)
import Test.Syd
import Test.Syd.Aeson
spec :: Spec
spec = do
describe "pureGoldenJSONFile" $ do... |
493d3a459a4a3b54e0ce331080895801e26c37cc3354a288da954893d5c621bb | tsoding/kgbotka | Eval.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE ViewPatterns #
module Control.Monad.Trans.Eval where
import Control.Applicative
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Except
import Control.Monad.Trans.State.Strict
newtype EvalT s e m a = EvalT
{ runEvalT :: StateT s (Except... | null | https://raw.githubusercontent.com/tsoding/kgbotka/67278a93611b0abe4e07df7967559884263147aa/src/Control/Monad/Trans/Eval.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE ViewPatterns #
module Control.Monad.Trans.Eval where
import Control.Applicative
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Except
import Control.Monad.Trans.State.Strict
newtype EvalT s e m a = EvalT
{ runEvalT :: StateT s (Except... | |
1168abc6764765145f4aae1ae9d182049ffb85cafce0eb8f16764b9500866baf | cky/guile | threads.scm | Copyright ( C ) 1996 , 1998 , 2001 , 2002 , 2003 , 2006 , 2010 , 2011 ,
2012 Free Software Foundation , Inc.
;;;;
;;;; 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 Foundation ; either
... | null | https://raw.githubusercontent.com/cky/guile/89ce9fb31b00f1f243fe6f2450db50372cc0b86d/module/ice-9/threads.scm | scheme |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library 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. Se... | Copyright ( C ) 1996 , 1998 , 2001 , 2002 , 2003 , 2006 , 2010 , 2011 ,
2012 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston... |
5e4b6c7d00afaa344a354e6439ec20cd750ce0dbd96d162c0b2cb1385a1e01e6 | agrafix/superrecord | Variant.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE RoleAnnotations #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
module SuperRecord.Variant
... | null | https://raw.githubusercontent.com/agrafix/superrecord/f1c8cf87fd25243e715fd9585e595a90fff34050/src/SuperRecord/Variant.hs | haskell | # LANGUAGE GADTs #
| A variant is used to express that a values type is of any of
the types tracked in the type level list.
# UNPACK #
useful to provide type signatures for the 'Variant's.
| An empty 'Variant', equivalent to `()`
if the variant is not of the desired type.
| Remove an option from a 'Variant'
| Ad... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE RoleAnnotations #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
module SuperRecord.Variant
( Variant
, Variant... |
70b9ee26e58cbe67f20760f96c6557c723aed29d4f56357932c5e7c85a30cf4f | electric-sql/vaxine | inter_dc_query_dealer.erl | %% -------------------------------------------------------------------
%%
Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
%% >
%%
This file is provided... | null | https://raw.githubusercontent.com/electric-sql/vaxine/872a83ea8d4935a52c7b850bb17ab099ee9c346b/apps/antidote/src/inter_dc_query_dealer.erl | erlang | -------------------------------------------------------------------
>
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either expressed or implied. See the License for the
specific language governing perm... | Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
This file is provided to you under the Apache License ,
except in compliance with the License . You... |
cbd08f6a7e7699e9a18c26b4eeb7024d215f181d7723cfb2693aa36681d78902 | gvolpe/haskell-book-exercises | Hello.hs | module Hello where
sayHello :: String -> IO ()
sayHello name = putStrLn ("Hi " ++ name ++ "!")
| null | https://raw.githubusercontent.com/gvolpe/haskell-book-exercises/5c1b9d8dc729ee5a90c8709b9c889cbacb30a2cb/chapter13/hello-haskell/src/Hello.hs | haskell | module Hello where
sayHello :: String -> IO ()
sayHello name = putStrLn ("Hi " ++ name ++ "!")
| |
add07c118c9772d70e3f64f5f48c46cf9c722a67bd59fa33bd39676ddf637129 | chebert/schemeish | lexical-body-definitions.lisp | (in-package #:schemeish.internals)
(install-syntax!)
(defvar *definition-name-field-table* (make-hash-table :weakness :key)
"A hash table from function -> definition-name-field.")
(defun register-definition-name-field (function name-field)
(assert (functionp function))
(setf (gethash function *definition-name-f... | null | https://raw.githubusercontent.com/chebert/schemeish/872ea3dc3f2ea8438388b5e7660acd9446c49948/src/lexical-body-definitions.lisp | lisp | Iteration: Closure definition.
Base: Function definiton.
Iteration: Closure definition.
Base: Function definiton.
Register define and define-values
| (in-package #:schemeish.internals)
(install-syntax!)
(defvar *definition-name-field-table* (make-hash-table :weakness :key)
"A hash table from function -> definition-name-field.")
(defun register-definition-name-field (function name-field)
(assert (functionp function))
(setf (gethash function *definition-name-f... |
411574aaaa928c89597215ba86caf8d756fed09b9ec19330e36fc04937df1b08 | pjotrp/guix | build.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
;;;
;;; 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 So... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/guix/scripts/build.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 © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
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 (guix scripts build)
#:use-module (guix ui)
#:u... |
93d41ec2e7da00c9c5babd0a9f113a622adaaf89b6b02db7734a00e23c6ddfd8 | bhaskara/programmable-reinforcement-learning | sparse-dp.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; dp/sparse-dp.lisp
dynamic programming algorithms for < smdp >
unlike the ones in dp.lisp ( now removed ) , these do n't form an adjacency matrix , and so
;; are more suited to sparse representations
;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/dp/sparse-dp.lisp | lisp |
dp/sparse-dp.lisp
are more suited to sparse representations
value iteration
backup
check how much v has changed by
copy over new-val into v
policy iteration
Policy evaluation
Policy improvement
policy evaluation
q from v
helper functions
inner function for policy evaluat... | dynamic programming algorithms for < smdp >
unlike the ones in dp.lisp ( now removed ) , these do n't form an adjacency matrix , and so
(in-package dp)
(defmethod value-iteration ((m <smdp>) &key (epsilon .01) (verbose nil)
(init-val) (discount 1.0))
(recover-value-fn
m (value-itera... |
2f50bb0864e9b8865f442fd1d83bfe5058be5c6fe4d78be56c7abba06024ba31 | tnelson/Forge | make-b-sig.rkt | #lang forge
sig B {} | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/example/store/with-command/make-b-sig.rkt | racket | #lang forge
sig B {} | |
aa52295db4ffcfbaac96de8162f7aadfbf73438b8dc6297352631854df70c70b | input-output-hk/cardano-ledger | TxAuxData.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/b9aa1ad1728c0ceeca62657ec94d6d099896c052/eras/shelley/impl/src/Cardano/Ledger/Shelley/TxAuxData.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
# DEPRECATED Metadata "Use `ShelleyTxAuxData` instead" #
Usually we derive SafeToHash instances, but since ShelleyTxAuxData preserves its serialisation
bytes we can just extract them here, and make an explicit SafeToHash instance.
# COMPLETE ShelleyTxAuxData #
... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGU... |
65f76c8f45dd8a78a12616f0cbe2a8fa9fa5b8f1fe81b6e53190378732e3ec92 | project-oak/hafnium-verification | Rearrange.mli |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/biabduction/Rearrange.mli | ocaml | * Re-arrangement and extension of structures with fresh variables
TODO: this description is not clear
* Check for dereference errors: dereferencing 0, a freed value, or an undefined value
* Check that an expression representing an objc block can be null and raise a [B1] null exception.
It's used to check that w... |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
ba7cf38633e58024f9875155211fe1fe1d902af772d344ee51d3c46881df7a4c | billstclair/trubanc-lisp | strings.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; strings.lisp --- Conversions between strings and UB8 vectors.
;;;
Copyright ( C ) 2007 ,
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/babel_0.3.1/src/strings.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
strings.lisp --- Conversions between strings and UB8 vectors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, pu... | Copyright ( C ) 2007 ,
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package #:babel)
... |
408e0f04f05e357d9bbb4879e4b2cf759033411ed12a915c3f0856adb081a2f9 | zliu41/multi-containers | Conversions.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.Multimap.Conversions
Maintainer : < >
--
-- Conversions between 'Multimap' and 'SetMultimap'.
module Data.Multimap.Conversions (
toMultimapAsc
, toMultimapDesc
, toSetMultimap
) where
import qualifi... | null | https://raw.githubusercontent.com/zliu41/multi-containers/3711e7c8640282d26e948e9074ed576a31138ed7/src/Data/Multimap/Conversions.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Multimap.Conversions
Conversions between 'Multimap' and 'SetMultimap'.
are in ascending order.
> toMultimapAsc (Data.Multimap.Set.fromList [(1,'a'),(1,'b'),(2,'c')]) === Data.Multimap.fromList [(1,'a'),(1,'b'),(2,'c... | Maintainer : < >
module Data.Multimap.Conversions (
toMultimapAsc
, toMultimapDesc
, toSetMultimap
) where
import qualified Data.List.NonEmpty as NonEmpty
import qualified Data.Map as Map
import Data.Multimap.Internal (Multimap (..))
import Data.Multimap.Set.Internal (SetMultimap (..))
import qualified ... |
b64904945e54b4871520edb53388996c4b4d3fbb336422844f214ce234585987 | SKS-Keyserver/sks-keyserver | recode.ml | (***********************************************************************)
(* recode.ml *)
(* *)
Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2... | null | https://raw.githubusercontent.com/SKS-Keyserver/sks-keyserver/a4e5267d817cddbdfee13d07a7fb38a9b94b3eee/recode.ml | ocaml | *********************************************************************
recode.ml
redistribute it and/or modify it under ... | Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2011 , 2012 , 2013 and Contributors
This file is part of SKS . SKS is free software ; you can
Public License as published by the Free Software Foundation ; either
version 2 of the License , or... |
1b1e45e35eae49dc2be08b007e0598593a0779416b79f998a79e021d79f84208 | xapi-project/xen-api | xen_api_lwt_unix.ml |
* Copyright ( C ) 2012 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/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/xen-api-client/lwt/xen_api_lwt_unix.ml | ocaml | let write_line (_, oc) = Lwt_io.write_line oc
TODO: modify do_it to accept the timeout and remove the warnings |
* Copyright ( C ) 2012 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... |
c9ec4bb005ffd5834e5cf724546b026296994d4f2a87fae4ee15e3627535495c | aprell/compiler-potpourri | IR.ml | open Utils
type stmt =
| Move of var * expr (* x := e *)
| Load of var * mem (* x := M[i] *)
| Store of mem * expr (* M[i] := e *)
| Label of label (* L:... | null | https://raw.githubusercontent.com/aprell/compiler-potpourri/df0778eb37fe327f0a6b10316ffec54405e7095e/basic_blocks/three_address_code/IR.ml | ocaml | x := e
x := M[i]
M[i] := e
L:
goto L
return e
Phi-functions (SSA)
x := PHI(...)
Constructor for labels
The parser doesn't accept identifiers that start with '$', so these
... | open Utils
type stmt =
if e goto L1 else L2
and expr =
| Const of int
| Val of var
| Binop of binop * expr * expr
| Relop of relop * expr * expr
and var = Var of name
and mem = Mem of base * offset
and base = var
and offset = expr
and binop = Plus | Minus | Mul | Div | Mod
and relop = EQ | NE | LT ... |
8b70f89812af5737e24e9de5d50be1e40fae9b525369da4d1844baab0fd5e39b | dbuenzli/logs | logs_top.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 The logs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/logs/f948d255cde88b5b8a3d0e3ab16120e55d748836/src/logs_top.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 The logs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | |
052bc3f9099607bf6060854205b420c97aa3665bc1f9808e88e823267fa22f62 | 8c6794b6/haskell-sc-scratch | SampleData.hs | module SampleData where
import Sound.SC3
import Sound.SC3.ID
import Sound.SC3.Lepton
t1 :: SCNode
t1 =
Group 0
[Group 1
[Group 10
[Group 100
[Synth 1001 "lfnz"
["out":=100,"mul":=1500,"add":=1500,"freq":=0.125]
,Synth 1002 "lftri"
["out":=101,"mul":=1760,"ad... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Misc/SampleData.hs | haskell | Tree treated as base.
Should return 'n_free 1411' from diff(t3,t5)
Make 'n_set' message from diff(t3,t5)
| Base node
| Insert node#2002 after node#2001 from t00
| Delete node#2001 from t0
| Modified node#, insert node#2002 after node#2001 from t00
XXX: When new node has inserted soon after modified node, messa... | module SampleData where
import Sound.SC3
import Sound.SC3.ID
import Sound.SC3.Lepton
t1 :: SCNode
t1 =
Group 0
[Group 1
[Group 10
[Group 100
[Synth 1001 "lfnz"
["out":=100,"mul":=1500,"add":=1500,"freq":=0.125]
,Synth 1002 "lftri"
["out":=101,"mul":=1760,"ad... |
ad22298e15cfb4948302de6650e6693e49591c1d93cd05d6480987549c89d361 | mokus0/junkbox | FixedFloating.hs | # LANGUAGE ViewPatterns , RankNTypes #
module Math.FixedFloating where
import Math.Converge
import Math.GCF
import TypeExperiments.WithResolution
import Data.Fixed
import Data.StateRef
import Control.Monad.ST
import Data.Ratio
import Data.List
evalGcfFixed :: HasResolution r => [(Rational, Rational)] -> Fixed r
eva... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Math/FixedFloating.hs | haskell | fails for n=2, underconverges for numbers with large num/denoms | # LANGUAGE ViewPatterns , RankNTypes #
module Math.FixedFloating where
import Math.Converge
import Math.GCF
import TypeExperiments.WithResolution
import Data.Fixed
import Data.StateRef
import Control.Monad.ST
import Data.Ratio
import Data.List
evalGcfFixed :: HasResolution r => [(Rational, Rational)] -> Fixed r
eva... |
aca9494104b5a3a8c6ec893709643328c21a36f6f5e100801c7bceeab5091a97 | vyorkin/tiger | env.ml | module T = Type
module L = Location
module S = Symbol
module ST = Symbol_table
type var_entry = {
access: Translate.access;
ty: T.t
} [@@deriving show { with_path = false }]
type fun_entry = {
level: Translate.level;
label: Temp.label;
formals: T.t list;
result: T.t
} [@@deriving show { with_path = false ... | null | https://raw.githubusercontent.com/vyorkin/tiger/54dd179c1cd291df42f7894abce3ee9064e18def/chapter6/lib/env.ml | ocaml | module T = Type
module L = Location
module S = Symbol
module ST = Symbol_table
type var_entry = {
access: Translate.access;
ty: T.t
} [@@deriving show { with_path = false }]
type fun_entry = {
level: Translate.level;
label: Temp.label;
formals: T.t list;
result: T.t
} [@@deriving show { with_path = false ... | |
c3c29c27aeee7766097fe8869cf141f248c07d93fa1d110055ba2d1bf887acf7 | m4dc4p/haskelldb | DBDirect.hs | import Database.HaskellDB.DynConnect
import Database.HaskellDB.DBDirect
main :: IO ()
main = dbdirect driver
| null | https://raw.githubusercontent.com/m4dc4p/haskelldb/a1fbc8a2eca8c70ebe382bf4c022275836d9d510/driver-dynamic/DBDirect.hs | haskell | import Database.HaskellDB.DynConnect
import Database.HaskellDB.DBDirect
main :: IO ()
main = dbdirect driver
| |
9f07a7c2300d90c689393be10467251da2376145967c41324316c1058de6dcfd | Alaya-in-Matrix/CLaSH-Processor | Esprockell.hs | # language RecordWildCards #
module Components.Esprockell where
{-------------------------
| TODO:
| add error status
| store address in register such pointer could be implemented
-------------------------}
import CLaSH.Prelude hiding(Word)
import Components.Types
import Debug.Trace
decode :: DAddr -- ^ st... | null | https://raw.githubusercontent.com/Alaya-in-Matrix/CLaSH-Processor/4b109d9de90dc5c3bd3a076130029aff6369fcfd/Components/Esprockell.hs | haskell | ------------------------
| TODO:
| add error status
| store address in register such pointer could be implemented
------------------------
^ stack pointer
^ current instruction
^ target machine code
forever loop here
operator
to operands
result and Conditional test resutl
此时,toreg应该是zeroreg
(immediate-number,... | # language RecordWildCards #
module Components.Esprockell where
import CLaSH.Prelude hiding(Word)
import Components.Types
import Debug.Trace
decode sp instr = case instr of
Arith op r0 r1 r2 -> def {ldCode = LdAlu, opCode = op, fromReg0 = r0, fromReg1 = r1, toReg = r2}
Jump jType jAddr -> def {jmpCo... |
b0a2c2295392f62b56312da90e674f804e7f0b28c8947201ab125336f1a95efc | haskell-mafia/tinfoil | Encode.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Tinfoil.Encode(
hexEncode
, hexDecode
) where
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Base16 as Base16
import qualified Data.Text.Encoding as T
import ... | null | https://raw.githubusercontent.com/haskell-mafia/tinfoil/f46b2ea0b9984ac9a97073932b5584ce0a2e0554/src/Tinfoil/Encode.hs | haskell | # LANGUAGE OverloadedStrings #
| Parse a hex-encoded bytestring of a given length (number of bytes
in the data, not its hexadecimal encoding). | # LANGUAGE NoImplicitPrelude #
module Tinfoil.Encode(
hexEncode
, hexDecode
) where
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Base16 as Base16
import qualified Data.Text.Encoding as T
import P
hexEncode :: ByteString -> Text
... |
d382caca54330e36fb9c09eab7ba1051f3d5f3d0233a57d31adf2bceadf0c1fa | perf101/rage | som_page_handler.ml | open! Core.Std
open Utils
let jira_hostname = "jira.uk.xensource.com"
let t ~args = object (self)
inherit Html_handler.t ~args
val show_for_value = "0"
method private write_som_info som_info =
let i = som_info#get_all.(0) in
let id = i.(0) in
let name = sprintf "<span class='som_name'>%s</span>" i... | null | https://raw.githubusercontent.com/perf101/rage/e8630659b2754b6621df7c49f3663fa7c4fac5eb/src/som_page_handler.ml | ocaml | LABELS
OPTIONS | open! Core.Std
open Utils
let jira_hostname = "jira.uk.xensource.com"
let t ~args = object (self)
inherit Html_handler.t ~args
val show_for_value = "0"
method private write_som_info som_info =
let i = som_info#get_all.(0) in
let id = i.(0) in
let name = sprintf "<span class='som_name'>%s</span>" i... |
0bd076c7004eace4e4f5a4b46c6a8a8c8fdeba37dadc5bfdd17f7750a49ce313 | anoma/juvix | Options.hs | module Commands.Dev.Options
( module Commands.Dev.Options,
module Commands.Dev.Asm.Options,
module Commands.Dev.Core.Options,
module Commands.Dev.Geb.Options,
module Commands.Dev.Internal.Options,
module Commands.Dev.Parse.Options,
module Commands.Dev.Highlight.Options,
module Commands.Dev... | null | https://raw.githubusercontent.com/anoma/juvix/23f34403f521c0aaab481b7e4071d0736da08508/app/Commands/Dev/Options.hs | haskell | module Commands.Dev.Options
( module Commands.Dev.Options,
module Commands.Dev.Asm.Options,
module Commands.Dev.Core.Options,
module Commands.Dev.Geb.Options,
module Commands.Dev.Internal.Options,
module Commands.Dev.Parse.Options,
module Commands.Dev.Highlight.Options,
module Commands.Dev... | |
d9b42894b2f9b29c225a849dfc17c12eb9be5854d509b4355a6f631ed41abb06 | argp/bap | test_multipmap.ml | open OUnit
open BatPervasives
open BatMultiPMap
let test_multimap_empty_assoc_lists () =
let map =
add 0 "foo" empty |> add 0 "bar" |> add 0 "sna" |>
remove 0 "foo" |> remove 0 "bar" |> remove 0 "sna"
in
if mem 0 map then
assert_failure
(Printf.sprintf "map[0] should be empty but contains... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/testsuite/test_multipmap.ml | ocaml | open OUnit
open BatPervasives
open BatMultiPMap
let test_multimap_empty_assoc_lists () =
let map =
add 0 "foo" empty |> add 0 "bar" |> add 0 "sna" |>
remove 0 "foo" |> remove 0 "bar" |> remove 0 "sna"
in
if mem 0 map then
assert_failure
(Printf.sprintf "map[0] should be empty but contains... | |
9a5e6bc176743d898ddfea18c054fc6cbfa0f17d2ee12665ed87bb6247a8c1b3 | janestreet/bonsai | render_form.mli | open! Core
open Bonsai_web
val to_vdom
: ?theme:View.Theme.t
-> ?on_submit:Bonsai_web_ui_form.View.submission_options
-> ?editable:Bonsai_web_ui_form.View.editable
-> Bonsai_web_ui_form.View.t
-> Vdom.Node.t
| null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/web_ui/auto_generated/src/render_form.mli | ocaml | open! Core
open Bonsai_web
val to_vdom
: ?theme:View.Theme.t
-> ?on_submit:Bonsai_web_ui_form.View.submission_options
-> ?editable:Bonsai_web_ui_form.View.editable
-> Bonsai_web_ui_form.View.t
-> Vdom.Node.t
| |
4b2f4ca1d3dc0adf1fd1941fed6d4da3b04550745a65927dde401f3278637c8b | kblake/erlang-chat-demo | element_radiogroup.erl | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (element_radiogroup).
-include_lib ("wf.hrl").
-compile(export_all).
reflect() -> record_info(fields, radiogroup).
render_element(Record) ->
Set the group to the current HtmlID ...
Ancho... | null | https://raw.githubusercontent.com/kblake/erlang-chat-demo/6fd2fce12f2e059e25a24c9a84169b088710edaf/apps/nitrogen/src/elements/forms/element_radiogroup.erl | erlang | Render the record... | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (element_radiogroup).
-include_lib ("wf.hrl").
-compile(export_all).
reflect() -> record_info(fields, radiogroup).
render_element(Record) ->
Set the group to the current HtmlID ...
Ancho... |
ea8ad9cab805cf293c087e5f784e77da096338eb50376a09d652b11adb49d2f9 | exoscale/vinyl | aggregates.clj | (ns exoscale.vinyl.aggregates
(:require [exoscale.vinyl.fn :as fn]
[exoscale.vinyl.store :as store]
[exoscale.vinyl.tuple :as tuple])
(:import
com.apple.foundationdb.record.provider.foundationdb.FDBRecordStore
com.apple.foundationdb.record.metadata.IndexAggregateFunction
com.appl... | null | https://raw.githubusercontent.com/exoscale/vinyl/aed9094588f3c5ab9ea2868f9eebc05d2c19bba2/src/exoscale/vinyl/aggregates.clj | clojure | If this gets bigger let's move to auspex | (ns exoscale.vinyl.aggregates
(:require [exoscale.vinyl.fn :as fn]
[exoscale.vinyl.store :as store]
[exoscale.vinyl.tuple :as tuple])
(:import
com.apple.foundationdb.record.provider.foundationdb.FDBRecordStore
com.apple.foundationdb.record.metadata.IndexAggregateFunction
com.appl... |
27a7b7105b8fd2f9abdf30d61d52ddae3f02f411ea3b95d082f663de4f84134a | adamdoupe/find_ear_rails | visitor.mli |
(* This is the same visitor type that is used by CIL *)
type 'a visitAction =
SkipChildren (** Do not visit the children. Return
the node as it is. *)
| DoChildren (** Continue with the children of this
... | null | https://raw.githubusercontent.com/adamdoupe/find_ear_rails/38f892f9962ad415a583973caf24fbab1a011be1/diamondback-ruby-0.20090726/src/visitor.mli | ocaml | This is the same visitor type that is used by CIL
* Do not visit the children. Return
the node as it is.
* Continue with the children of this
node. Rebuild the node on return
if any ... |
type 'a visitAction =
* Replace the expression with the
given one
given one *)
* First consider that the entire
exp is replaced by the first
... |
434a66e995c534a35d5e85895f00c4efaa135dfea55f519e687dd3ce0659e7df | samply/blaze | type.clj | (ns blaze.interaction.history.type
"FHIR history interaction on the whole system.
#history"
(:require
[blaze.async.comp :refer [do-sync]]
[blaze.db.api :as d]
[blaze.db.spec]
[blaze.fhir.spec.type :as type]
[blaze.handler.fhir.util :as fhir-util]
[blaze.interaction.history.util :as histor... | null | https://raw.githubusercontent.com/samply/blaze/948eee38021467fa343c522a644a7fd4b24b6467/modules/interaction/src/blaze/interaction/history/type.clj | clojure | we need take here again because we take page-size + 1 above | (ns blaze.interaction.history.type
"FHIR history interaction on the whole system.
#history"
(:require
[blaze.async.comp :refer [do-sync]]
[blaze.db.api :as d]
[blaze.db.spec]
[blaze.fhir.spec.type :as type]
[blaze.handler.fhir.util :as fhir-util]
[blaze.interaction.history.util :as histor... |
ddacc42a94ddd5fa205e85644e2b53d969b61b5e730afb6a9c500c597ab9d3c9 | careercup/CtCI-6th-Edition-Clojure | chapter_4_q7.clj | (ns ^{:author "Leeor Engel"}
chapter-4.chapter-4-q7
(:require [data-structures.graph :refer :all]))
(defn build-order [projects dependencies]
(let [with-deps (reduce-kv (fn [m k v]
(assoc m k (into [] (map second v)))) {} (group-by first dependencies))
no-deps (reduce (fn [m ... | null | https://raw.githubusercontent.com/careercup/CtCI-6th-Edition-Clojure/ef151b94978af82fb3e0b1b0cd084d910870c52a/src/chapter_4/chapter_4_q7.clj | clojure | (ns ^{:author "Leeor Engel"}
chapter-4.chapter-4-q7
(:require [data-structures.graph :refer :all]))
(defn build-order [projects dependencies]
(let [with-deps (reduce-kv (fn [m k v]
(assoc m k (into [] (map second v)))) {} (group-by first dependencies))
no-deps (reduce (fn [m ... | |
c5e2cfdd88b63d406e5417760fb576e77796d17d38316936d82ee35839093f43 | rescript-lang/rescript-compiler | ext_namespace_encode.mli | Copyright ( C ) 2020- Authors of ReScript
*
* 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 , either version 3 of the License , or
* ( at your option ) any later version ... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/ext/ext_namespace_encode.mli | ocaml | Copyright ( C ) 2020- Authors of ReScript
*
* 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 , either version 3 of the License , or
* ( at your option ) any later version ... | |
7d5c9df6d79d2e6ac1a59b03b288b0f38a12c643641d40f69fa4a12cfeae45a6 | ckampfe/stanley | core.clj | (ns stanley.core
"
main module for building the site.
to run the specs, export the namespace to your repl
and run:
(->> (clojure.spec.test/instrument)
clojure.spec.test/check
clojure.spec.test/summarize-results
clojure.pprint/pprint)
"
(:require [clojure.java.io :as io]
[... | null | https://raw.githubusercontent.com/ckampfe/stanley/d2342521cadd422c67d34fa1636d860b968c4f3e/src/stanley/core.clj | clojure | (ns stanley.core
"
main module for building the site.
to run the specs, export the namespace to your repl
and run:
(->> (clojure.spec.test/instrument)
clojure.spec.test/check
clojure.spec.test/summarize-results
clojure.pprint/pprint)
"
(:require [clojure.java.io :as io]
[... | |
a2b435b248613fd564aa033b534333f2dcc7711f7878329049052d9cd01fa9fa | ndmitchell/tagsoup | Parser.hs |
module Compiler.Parser(parse) where
import Compiler.Type
import Data.List
import Data.Char
parse :: String -> Program1
parse = map (parseStmt . words) . joinLines .
filter (\x -> not $ all isSpace x || "#" `isPrefixOf` x) . lines
joinLines :: [String] -> [String]
joinLines (x:(y:ys):zs) | isSpace y = join... | null | https://raw.githubusercontent.com/ndmitchell/tagsoup/e116d3b965e4f149581bd55e45a05661b1113536/dead/parser/Compiler/old/Parser.hs | haskell | foo(xs) = (foo,xs) |
module Compiler.Parser(parse) where
import Compiler.Type
import Data.List
import Data.Char
parse :: String -> Program1
parse = map (parseStmt . words) . joinLines .
filter (\x -> not $ all isSpace x || "#" `isPrefixOf` x) . lines
joinLines :: [String] -> [String]
joinLines (x:(y:ys):zs) | isSpace y = join... |
aa795f1adcdf52750e2f7bad8cfd045028f5f38197de1d36a95bdc416b1a24ac | argp/bap | utf8_test.ml | #load "utf8.cmo";;
let () =
let b = Buffer.create 10 in
for i = 0 to 0x10ffff do
if (i >= 0xd800) && (i <= 0xdfff) then ()
else (
(try Utf8.store b i with Utf8.MalFormed ->
Printf.eprintf "Conversion failure %x\n" i; exit 1);
let s = Buffer.contents b in
Buffer.clear b;
let j =
t... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/libtracewrap/libtrace/piqi/piqi/deps/ulex-1.1/utf8_test.ml | ocaml | #load "utf8.cmo";;
let () =
let b = Buffer.create 10 in
for i = 0 to 0x10ffff do
if (i >= 0xd800) && (i <= 0xdfff) then ()
else (
(try Utf8.store b i with Utf8.MalFormed ->
Printf.eprintf "Conversion failure %x\n" i; exit 1);
let s = Buffer.contents b in
Buffer.clear b;
let j =
t... | |
5473800664a55c29ccd5f21205f7ee2d9e8aafe3384ab3dca2e7049743dcdd0d | robert-strandh/SICL | multiple-values.lisp | (cl:in-package #:sicl-run-time)
;;; This function is called by code that replaces the
INITIALIZE - VALUES - INSTRUCTION . That instruction has a single
;;; output which is a lexical location that will hold all the multiple
values to be used when the function passed to MULTIPLE - VALUE - CALL
is invoked . In ... | null | https://raw.githubusercontent.com/robert-strandh/SICL/42132900f8f10b3de86ec698c36e502aaea40ead/Code/Compiler/Run-time/multiple-values.lisp | lisp | This function is called by code that replaces the
output which is a lexical location that will hold all the multiple
to append values to that lexical location, we make it contain a
CONS cell of the list initially have both its CAR and its CDR
The CDR holds the beginning of the list.
list described above. We need... | (cl:in-package #:sicl-run-time)
INITIALIZE - VALUES - INSTRUCTION . That instruction has a single
values to be used when the function passed to MULTIPLE - VALUE - CALL
is invoked . In order to allow for the - VALUES - INSTRUCTION
list of length 51 . Recall that 50 is the limit allowed by the
standard ... |
f7548905f1ae2cad91af30b980dc80fc1c262134ee76053dd624e45c286ba18c | PyroclastIO/metamorphic | trace.cljc | (ns metamorphic.trace
(:require [metamorphic.runtime :as rt]
[metamorphic.match-buffer :as m]
[metamorphic.util :as u]))
(defn update-history [history pending-states head]
(reduce
(fn [history* {:state/keys [previous-id id] :as pending-state}]
(cond-> history*
(not (get histo... | null | https://raw.githubusercontent.com/PyroclastIO/metamorphic/27dc43ad89423873ca6bcc012cd91fbe2d39271d/src/metamorphic/trace.cljc | clojure | (ns metamorphic.trace
(:require [metamorphic.runtime :as rt]
[metamorphic.match-buffer :as m]
[metamorphic.util :as u]))
(defn update-history [history pending-states head]
(reduce
(fn [history* {:state/keys [previous-id id] :as pending-state}]
(cond-> history*
(not (get histo... | |
0d13a3e7ae2cf768d83c71beba2db85efa55abced130414c89ba68037228e336 | auser/beehive | bh_bee_stats_srv.erl | %%%-------------------------------------------------------------------
%%% File : bh_bee_stats_srv.erl
Author :
%%% Description :
%%%
Created : Sun Dec 13 20:51:04 PST 2009
%%%-------------------------------------------------------------------
-module (bh_bee_stats_srv).
-include ("beehive.hrl").
-behav... | null | https://raw.githubusercontent.com/auser/beehive/dfe257701b21c56a50af73c8203ecac60ed21991/lib/erlang/apps/beehive/src/bh_rest/bh_bee_stats_srv.erl | erlang | -------------------------------------------------------------------
File : bh_bee_stats_srv.erl
Description :
-------------------------------------------------------------------
API
gen_server callbacks
dict of the bees and their stats
====================================================================
API
... | Author :
Created : Sun Dec 13 20:51:04 PST 2009
-module (bh_bee_stats_srv).
-include ("beehive.hrl").
-behaviour(gen_server).
-export([
start_link/0,
bee_dump/0,
bee_dump/1,
bee_stat/1,
new_bee_stat/0
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_ch... |
2c6c1c360c6c9001ef13e15285fffac2a2485df848dbc46868df280b471e9c5f | sellout/quid-pro-quo | stack-example.lisp | (defpackage qpq-stack-example
(:use #:cl) ; NOTE: would normally use QPQ, but qualification helps illustrate
(:export #:stack
#:size #:capacity
#:item #:emptyp #:fullp
#:put #:unput))
(in-package #:qpq-stack-example)
(defclass stack ()
((size :initform 0 :reader size :type (inte... | null | https://raw.githubusercontent.com/sellout/quid-pro-quo/c35156d5883efb15e21ad4db932a57e353f4d329/stack-example.lisp | lisp | NOTE: would normally use QPQ, but qualification helps illustrate | (defpackage qpq-stack-example
(:export #:stack
#:size #:capacity
#:item #:emptyp #:fullp
#:put #:unput))
(in-package #:qpq-stack-example)
(defclass stack ()
((size :initform 0 :reader size :type (integer 0))
(capacity :initarg :capacity :reader capacity :type (integer 0))
re... |
ebbd4bb70228624d830b7b260804aec7c61a0acc5ee38b64575b784e7e54117b | haskellari/microstache | Spec.hs | module Main (main) where
import Test.Hspec
import qualified Text.Microstache.ParserSpec as P
import qualified Text.Microstache.RenderSpec as R
import qualified Text.Microstache.TypeSpec as T
main :: IO ()
main = hspec $ do
P.spec
R.spec
T.spec
| null | https://raw.githubusercontent.com/haskellari/microstache/b5ffba1ff12b6b566ec3de8cff494c7912856d8a/tests/Spec.hs | haskell | module Main (main) where
import Test.Hspec
import qualified Text.Microstache.ParserSpec as P
import qualified Text.Microstache.RenderSpec as R
import qualified Text.Microstache.TypeSpec as T
main :: IO ()
main = hspec $ do
P.spec
R.spec
T.spec
| |
1fd2ab586350aee89cb5440eeeac5271ed962523c5686c2adc844ea06bfc0f46 | shirok/Gauche | 9.scm | ;;;
;;; SRFI-9.SCM - defining record types
;;;
;; SRFI-9 (define-record-type) is superseded by gauche.record
(define-module srfi.9 (extend gauche.record))
| null | https://raw.githubusercontent.com/shirok/Gauche/e606bfe5a94b100d5807bca9c2bb95df94f60aa6/lib/srfi/9.scm | scheme |
SRFI-9.SCM - defining record types
SRFI-9 (define-record-type) is superseded by gauche.record |
(define-module srfi.9 (extend gauche.record))
|
6b64e872d15096a7bec098a194cb92181facf9eb8e8933901315bc46a09bdeb4 | SquidDev/illuaminate | lint_string_quote.mli | (** Enforces a specific quote style for strings. *)
include Linter.S
| null | https://raw.githubusercontent.com/SquidDev/illuaminate/da18b101b4710881b71c42554d70a3a7d17c3cd6/src/lint/lint_string_quote.mli | ocaml | * Enforces a specific quote style for strings. |
include Linter.S
|
2a0f7e0ffdc29f62804b3ef32ab4a38633687eab0c24efe1a47869c458a33318 | scheme/edwin48 | packages.scm | ;; (define-interface cosmacs:command-reader/interface
;; (export dispatch-on-key))
;; (define-structures
;; ((cosmacs:command-reader cosmacs:command-reader/interface)
( : mode : mode / interface ) )
( open scheme aliases : command srfi-1 srfi-69 srfi-89 srfi-78 srfi-14
;; define-recor... | null | https://raw.githubusercontent.com/scheme/edwin48/fbe3c7ca14f1418eafddebd35f78ad12e42ea851/cosmacs/packages.scm | scheme | (define-interface cosmacs:command-reader/interface
(export dispatch-on-key))
(define-structures
((cosmacs:command-reader cosmacs:command-reader/interface)
define-record-type* errors keystroke aliases keystroke-discloser
(for-syntax (open scheme macro-helpers))
(files (../edwin48/scsh macros)
... |
( : mode : mode / interface ) )
( open scheme aliases : command srfi-1 srfi-69 srfi-89 srfi-78 srfi-14
: string - table : doc - string sorting ascii )
.. / modes
(define-interface cosmetic-emacs-interface
(export start
wait-for-key
%read-char
... |
8494580a79b9832e8df3935abfb3a1801bc52e1eb17f169e4edd0d145ec826ef | bytekid/mkbtt | slPrint.ml | open SlTerms
open SlTptp
let rec string_of_suffix i =
match i with
0 -> "0"
| x -> (string_of_int x) (* "'" ^ (string_of_suffix (i-1)) *)
;;
let string_of_variable s i =
s ^ (string_of_suffix i)
;;
let rec string_of_term = function
| V(s,i) -> string_of_variable s i
| T(s,[]) -> s
| T(s,t::[]... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mkbtt/slothrop/slPrint.ml | ocaml | "'" ^ (string_of_suffix (i-1))
let rec string_of_relation f s = function
(match xs with [] -> "" | _ -> "\n") ^
(string_of_relation f s xs)
| [] -> ""
;; | open SlTerms
open SlTptp
let rec string_of_suffix i =
match i with
0 -> "0"
;;
let string_of_variable s i =
s ^ (string_of_suffix i)
;;
let rec string_of_term = function
| V(s,i) -> string_of_variable s i
| T(s,[]) -> s
| T(s,t::[]) -> s ^ "(" ^ (string_of_term t) ^ ")"
| T(s,t::tl) -> s ^ "(" ... |
5acefd3eae39651f941981525b6b02347b799b1d325e599898120db1039bb2ac | bluddy/rails | stats.ml | open Containers
type t = {
mutable dist_traveled: int;
} [@@ deriving yojson]
let default = {
dist_traveled=0;
}
| null | https://raw.githubusercontent.com/bluddy/rails/941017827f7f14583b13e9a6248a30e4c39969ef/bin/backend/stats.ml | ocaml | open Containers
type t = {
mutable dist_traveled: int;
} [@@ deriving yojson]
let default = {
dist_traveled=0;
}
| |
ff900f56096004b943f33a93c9fbf732f677254b5d7d18a451004e8fa9173b21 | LexiFi/menhir | expandTokenAliases.ml | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/src/expandTokenAliases.ml | ocaml | ****************************************************************************
file LICEN... |
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU General Public License version 2 , as... |
5946b0c90a06523e1c35c6ab1ab7354c608670a1e3b776ba2a8c3dc298114fc8 | dinosaure/bob | recv.ml | open Stdbob
open Prgrss
let choose = function
| true -> fun _identity -> Fiber.return `Accept
| false ->
let open Fiber in
fun identity ->
let rec asking () =
Fiber.getline Unix.stdin >>| Stdlib.Option.map String.lowercase_ascii
>>= function
| Some ("y" | "yes" | "... | null | https://raw.githubusercontent.com/dinosaure/bob/210dce2f3f7bfe1b15472a7d09544b4afbac8ca6/bin/recv.ml | ocaml | XXX(dinosaure): report the commit and the root directory.
XXX(dinosaure): note that we save the stream into [tmp] BUT the file
we don't ensure that [tmp] will be a well-formed PACK file. The only
thing interesting into [tmp] is last bytes which permits to verify
if we received correctly the file. | open Stdbob
open Prgrss
let choose = function
| true -> fun _identity -> Fiber.return `Accept
| false ->
let open Fiber in
fun identity ->
let rec asking () =
Fiber.getline Unix.stdin >>| Stdlib.Option.map String.lowercase_ascii
>>= function
| Some ("y" | "yes" | "... |
c8085fa6f371b531a71d1dcd1279b2e7d25076bb18049bcd1229a3e3a47087a9 | spacefrogg/clfswm | tools.lisp | ;;; --------------------------------------------------------------------------
;;; CLFSWM - FullScreen Window Manager
;;;
;;; --------------------------------------------------------------------------
;;; Documentation: General tools
;;; --------------------------------------------------------------------------
;;;
(... | null | https://raw.githubusercontent.com/spacefrogg/clfswm/d5d399c21db016cb03a1e406716f4d51f3a8ca1c/src/tools.lisp | lisp | --------------------------------------------------------------------------
CLFSWM - FullScreen Window Manager
--------------------------------------------------------------------------
Documentation: General tools
--------------------------------------------------------------------------
This program is free s... | ( C ) 2005 - 2015 < >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
(in-package :common-lisp-user)
(defpackage tools
(:use common-li... |
87546d5481f764d6058953339c9ff11b94d6c0c45f81faa62d9c885f89623b9f | thepower/tpnode | tpnode_txsync.erl | -module(tpnode_txsync).
-include("include/tplog.hrl").
-export([synchronize/2, run_sync/3]).
synchronize(TxID, #{min_peers:=_}=Opts0) ->
Opts=maps:merge(
#{
timeout=>90,
retry=>3,
notify=>self()
},
Opts0),
Parent=self(),
Pid=erlang:spawn(
fun() ->
... | null | https://raw.githubusercontent.com/thepower/tpnode/6212422bc9061d44d150ef2d777d6e694396ed15/apps/tpnode/src/tpnode_txsync.erl | erlang | -module(tpnode_txsync).
-include("include/tplog.hrl").
-export([synchronize/2, run_sync/3]).
synchronize(TxID, #{min_peers:=_}=Opts0) ->
Opts=maps:merge(
#{
timeout=>90,
retry=>3,
notify=>self()
},
Opts0),
Parent=self(),
Pid=erlang:spawn(
fun() ->
... | |
5bad34fa94050f1b24541d3f56a0cc37782893218e58f35f339e9a53ff1e80d9 | NorfairKing/super-user-spark | Bake.hs | # LANGUAGE RecordWildCards #
The responsibility of the baker is to turn raw deployments into baked
deployments . This takes care of everything that could n't happen during
compilation yet . The differences between raw deployments and baked
deployments are :
- Baked deployments only deal w... | null | https://raw.githubusercontent.com/NorfairKing/super-user-spark/3c286a52a0b81e083c0e6d39f6f2b02aa9bb9231/src/SuperUserSpark/Bake.hs | haskell | # LANGUAGE RecordWildCards #
The responsibility of the baker is to turn raw deployments into baked
deployments . This takes care of everything that could n't happen during
compilation yet . The differences between raw deployments and baked
deployments are :
- Baked deployments only deal w... | |
c9a5615d082f16d820aa0a3e605c3c546494ec644f3c34fc40ee600e329799fc | alan-j-hu/ocaml-plist-xml | error.ml | type error =
[ `Expected_tag of string
| `Expected_start
| `Expected_end
| `Expected_start_or_end
| `Expected_data
| `Malformed_base64 of string
| `Malformed_date of string
| `Malformed_int of string
| `Malformed_real of string
| `Unknown_tag of string ]
exception Error of (int * int) * error
* [ E... | null | https://raw.githubusercontent.com/alan-j-hu/ocaml-plist-xml/9ad7cadb42239d21ef1344b4fefcdc67c640acb9/src/error.ml | ocaml | type error =
[ `Expected_tag of string
| `Expected_start
| `Expected_end
| `Expected_start_or_end
| `Expected_data
| `Malformed_base64 of string
| `Malformed_date of string
| `Malformed_int of string
| `Malformed_real of string
| `Unknown_tag of string ]
exception Error of (int * int) * error
* [ E... | |
86c46f485cc4a3a9a25a15c1b6b52b2cbf8d1e4f885a0a1a719ec863b90ecb9c | onedata/op-worker | atm_openfaas_monitor.erl | %%%-------------------------------------------------------------------
@author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Module responsible for monitoring ... | null | https://raw.githubusercontent.com/onedata/op-worker/171b05ac629acb4fc337b7dc2f5bf7c433d2c23f/src/modules/automation/task/executor/platforms/openfaas/monitor/atm_openfaas_monitor.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Module responsible for monitoring status of OpenFaaS service.
If its status transitions from 'healthy' to any other status and remains
as such for prolonged period of ti... | @author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(atm_openfaas_monitor).
-author("Bartosz Walkowicz").
-behaviour(gen_server).
-include("modules/automation/atm_execution.hrl").
-include("modules/fslogic/fslogic_common.hrl").
-include_lib(... |
4fa60551245721b0efbaa12063c6970931ffab7591d7adbc2fdc1443a727dbf1 | haskell/lsp | Declaration.hs | # LANGUAGE DuplicateRecordFields #
{-# LANGUAGE TemplateHaskell #-}
module Language.LSP.Types.Declaration where
import Data.Aeson.TH
import Language.LSP.Types.Progress
import Language.LSP.Types.StaticRegistrationOptions
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils
data DeclarationClie... | null | https://raw.githubusercontent.com/haskell/lsp/5422dd13f0362917e5981e07d60617ca6e233833/lsp-types/src/Language/LSP/Types/Declaration.hs | haskell | # LANGUAGE TemplateHaskell #
| Whether declaration supports dynamic registration. If this is set to 'true'
for the corresponding server capability as well.
| The client supports additional metadata in the form of declaration links. | # LANGUAGE DuplicateRecordFields #
module Language.LSP.Types.Declaration where
import Data.Aeson.TH
import Language.LSP.Types.Progress
import Language.LSP.Types.StaticRegistrationOptions
import Language.LSP.Types.TextDocument
import Language.LSP.Types.Utils
data DeclarationClientCapabilities =
DeclarationClientCap... |
29893f5ca98c6c1671dd48f0f94c4d7efb17a9dc70789152bd493e06ac20eb5b | plewto/Cadejo | just.clj | (ns cadejo.scale.just
(:require [cadejo.util.user-message :as umsg])
(:require [cadejo.scale.table])
;(:require [cadejo.scale.intonation :as intonation])
(:require [cadejo.scale.scale-utilities :as scale-util]))
(def table-length cadejo.scale.table/table-length)
(def just-scale-templates
{:just-c1 {:templa... | null | https://raw.githubusercontent.com/plewto/Cadejo/2a98610ce1f5fe01dce5f28d986a38c86677fd67/src/cadejo/scale/just.clj | clojure | (:require [cadejo.scale.intonation :as intonation])
Build first octave
Copy remaining octaves | (ns cadejo.scale.just
(:require [cadejo.util.user-message :as umsg])
(:require [cadejo.scale.table])
(:require [cadejo.scale.scale-utilities :as scale-util]))
(def table-length cadejo.scale.table/table-length)
(def just-scale-templates
{:just-c1 {:template '[1/1 16/15 9/8 6/5 5/4 4/3 36/25 3/2 8/5 5/3 9/5 15... |
6612b27e7d94535628acd255f9614348baa336ecf2ad07d13da742b5815a5aeb | GAumala/TranslateJPBot | JMdictParser.hs | {-# LANGUAGE OverloadedStrings #-}
module Text.XML.JMdictParser (parseJMdictFile, JMdictEntry (JMdictEntry)) where
import Data.Maybe
import Control.Monad.Trans.Resource
import Data.Conduit (Consumer, Sink, runConduitRes, (.|))
import Data.Text (Text, unpack, concat)
import Data.XML.Types (Event)
import Text.XML.Stre... | null | https://raw.githubusercontent.com/GAumala/TranslateJPBot/af008f0f3a2a13079982b8de5966a3903194380d/src/Text/XML/JMdictParser.hs | haskell | # LANGUAGE OverloadedStrings # |
module Text.XML.JMdictParser (parseJMdictFile, JMdictEntry (JMdictEntry)) where
import Data.Maybe
import Control.Monad.Trans.Resource
import Data.Conduit (Consumer, Sink, runConduitRes, (.|))
import Data.Text (Text, unpack, concat)
import Data.XML.Types (Event)
import Text.XML.Stream.Parse
data JMdictEntry = JMdict... |
873012f30e32b66bd8e4f80593d92d39e551dea2ca359dee1e87863ff7c89067 | renanroberto/whatsyourquestion-bot | TelegramTypes.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE TemplateHaskell #-}
module TelegramTypes where
import Control.Lens
import Data.Aeson
import qualified Data.Map.Strict as Map
import GHC.Generics
import ... | null | https://raw.githubusercontent.com/renanroberto/whatsyourquestion-bot/4443c095e4a36be6fc94baf7886c181e06b030cc/src/TelegramTypes.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
} | # LANGUAGE DuplicateRecordFields #
module TelegramTypes where
import Control.Lens
import Data.Aeson
import qualified Data.Map.Strict as Map
import GHC.Generics
import Prelude hiding (id)
data Chat = Chat
{ id :: Int
} deriving (Show, Generic, ToJSON, FromJSON)
ma... |
e9b42d981f68f2fdbeec0670cd3d622beafd635b541890ff719397c79539b974 | lisp-korea/sicp | ex-1-3-seungwon0.scm | ;; ex-1.29
(define (cube x) (* x x x))
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
(define (integral f a b dx)
(define (add-dx x) (+ x dx))
(* (sum f (+ a (/ dx 2.0)) add-dx b)
dx))
(integral cube 0 1 0.01) ;.24998750000000042
(in... | null | https://raw.githubusercontent.com/lisp-korea/sicp/4cdc1b1d858c6da7c9f4ec925ff4a724f36041cc/ch01/1.3/ex-1-3-seungwon0.scm | scheme | ex-1.29
.24998750000000042
.249999875000001
ex-1.30
ex-1.31
ex-1.32
ex-1.33
ex-1.34
ex-1.35
ex-1.36
a
.6180344478216819
.6666666666666666
.6179775280898876
.6180555555555556
b
ex-1.38
ex-1.39
ex-1.40
ex-1.41
ex-1.42
ex-1.43
ex-1.44
ex-1.45
ex-1.46
.7395672022122561 | (define (cube x) (* x x x))
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
(define (integral f a b dx)
(define (add-dx x) (+ x dx))
(* (sum f (+ a (/ dx 2.0)) add-dx b)
dx))
(define (inc n) (+ n 1))
(define (simpsons-rule f a b n)
(define h (/ ... |
28e62585386191c0c7f04a344fabcae734269651ec1e7c1ef6c9b59e6353c690 | fourmolu/fourmolu | Terminal.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
-- | An abstraction for colorful output in terminal.
module Ormolu.Terminal
( -- * The 'Term' monad
Term,
ColorMode (..),
runTerm,
-- * Styling
bold,
cyan,
green,
red,
-- * Pr... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/1f8903a92c8d5001dc1ec8ecfd4a04a3b61c3283/src/Ormolu/Terminal.hs | haskell | # LANGUAGE OverloadedStrings #
| An abstraction for colorful output in terminal.
* The 'Term' monad
* Styling
* Printing
--------------------------------------------------------------------------
The 'Term' monad
| Terminal monad.
| Reader context of 'Term'.
| Whether to use colors
| Handle to print to
| Whet... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
module Ormolu.Terminal
Term,
ColorMode (..),
runTerm,
bold,
cyan,
green,
red,
put,
putS,
putSrcSpan,
putRealSrcSpan,
newline,
)
where
import Control.Monad.Reader
import Data.Text (Text)
import qual... |
44d6f0f1d58b0705235379cb6e8c8b72be4740a6dc80095f941f99392eddd5d7 | geophf/1HaskellADay | Solution.hs | module Y2018.M10.D17.Solution where
-
Today . Write a function that takes 2 dates then writes a set of SQL INSERT
statements that enumerates every day between those days into the packet
table .
The packet table structure is
packet table
------------
id , serial
download_dt , timestamp
from_date , d... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M10/D17/Solution.hs | haskell | ----------
----------
}
} | module Y2018.M10.D17.Solution where
-
Today . Write a function that takes 2 dates then writes a set of SQL INSERT
statements that enumerates every day between those days into the packet
table .
The packet table structure is
packet table
id , serial
download_dt , timestamp
from_date , date
to_date ,... |
b621e49257671c54c9692bf8b142b0e5a3a3efcecbbc975df200ec34227e5219 | EFanZh/EOPL-Exercises | exercise-7.24-test.rkt | #lang racket
(require (except-in rackunit check))
(require "../solutions/exercise-7.24.rkt")
(check-equal? (run "11") (num-val 11))
(check-equal? (run "-33") (num-val -33))
(check-equal? (run "-(44, 33)") (num-val 11))
(check-equal? (run "-(-(44, 33), 22)") (num-val -11))
(check-equal? (run "-(55, -(22, 11))") (num-v... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/tests/exercise-7.24-test.rkt | racket | #lang racket
(require (except-in rackunit check))
(require "../solutions/exercise-7.24.rkt")
(check-equal? (run "11") (num-val 11))
(check-equal? (run "-33") (num-val -33))
(check-equal? (run "-(44, 33)") (num-val 11))
(check-equal? (run "-(-(44, 33), 22)") (num-val -11))
(check-equal? (run "-(55, -(22, 11))") (num-v... | |
96f4a2c0d358e1051c059bed2b5e7e766f7249a59b2f54d22d27e42f68555c7c | owickstrom/gi-gtk-declarative | Exit.hs | {-# LANGUAGE OverloadedLabels #-}
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
module Exit where
import Control.Concurrent ( threadDelay )
import Control.Monad ( void )
import Data.Functor ( ($>) )
import qualified Dat... | null | https://raw.githubusercontent.com/owickstrom/gi-gtk-declarative/205351a54698be7b583dd34d189a89470ee2b11b/examples/Exit.hs | haskell | # LANGUAGE OverloadedLabels #
# LANGUAGE OverloadedStrings # | # LANGUAGE OverloadedLists #
module Exit where
import Control.Concurrent ( threadDelay )
import Control.Monad ( void )
import Data.Functor ( ($>) )
import qualified Data.Text as Text
import GI.Gtk ... |
b138a25cd4a244d79e4983d996674f5ef1890db9bb23141f39e69bde8fdd0752 | obsidiansystems/obelisk-oauth | Backend.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Backend where
import Control.Monad.IO.Class (liftIO)
import Data.Map ((!))
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Network.HTTP.Client as Http
import qualified Network.HTTP.Client.... | null | https://raw.githubusercontent.com/obsidiansystems/obelisk-oauth/d6c04107c90f7195d9c2da93bf726147cc8de61a/example/backend/src/Backend.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
^ this response should include the access token and probably a refresh token | # LANGUAGE LambdaCase #
module Backend where
import Control.Monad.IO.Class (liftIO)
import Data.Map ((!))
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Network.HTTP.Client as Http
import qualified Network.HTTP.Client.TLS as Https
import Obelisk.Route
import Obelisk.Backend (... |
545ed04b7fc48587eaf6a63f094fbf78a21051991c69f6f8c340863b7016bda1 | acieroid/pcesk | pcesk.ml | open Types
open Exceptions
open Cesk_types
open Cesk_base
open Pcesk_types
open Pviz
open Parallel_garbage_collection
module Tid = Tid.ConcreteTID
(** Helper functions *)
let merge_threads context tcount tid x y = match x, y with
| Some x, Some y ->
Some (ContextSet.union
(match ThreadCountMap.find ... | null | https://raw.githubusercontent.com/acieroid/pcesk/f5bd9b6ad00b5d3753c79621f53825cb0e6cc3f5/pcesk/pcesk.ml | ocaml | * Helper functions
* Stepping
thread is still computing, we're blocked until it halts
If it was the only thread, remove its count (since it halted)
Step a context, creating a (or multiple) new pstate for each stepped
* context
* Injection
* Evaluation
Extract the final values of a pstate, ie. the values r... | open Types
open Exceptions
open Cesk_types
open Cesk_base
open Pcesk_types
open Pviz
open Parallel_garbage_collection
module Tid = Tid.ConcreteTID
let merge_threads context tcount tid x y = match x, y with
| Some x, Some y ->
Some (ContextSet.union
(match ThreadCountMap.find tid tcount with
... |
e8f49cfa2837f7ffd7fd7690ceff134710624ea83b191f12333bbb8b024d21c0 | jfeser/L2 | eval.mli | open Core
open Collections
exception RuntimeError of Error.t
exception HitRecursionLimit
val eval : ?recursion_limit:int -> Value.t Ctx.t -> Expr.t -> Value.t
val partial_eval :
?recursion_limit:int -> ?ctx:ExprValue.t Ctx.t -> ExprValue.t -> ExprValue.t
| null | https://raw.githubusercontent.com/jfeser/L2/a66659c7d75f75788c48a17b531045fb3d5f8351/lib/eval.mli | ocaml | open Core
open Collections
exception RuntimeError of Error.t
exception HitRecursionLimit
val eval : ?recursion_limit:int -> Value.t Ctx.t -> Expr.t -> Value.t
val partial_eval :
?recursion_limit:int -> ?ctx:ExprValue.t Ctx.t -> ExprValue.t -> ExprValue.t
| |
16b7df879b91ed8f59bba035da172348f781afdc054b632f4df305bffde85ecf | manuel-serrano/bigloo | parse_args.scm | ;*=====================================================================*/
* ... /prgm / project / bigloo / / comptime / Init / parse_args.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : S... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/ce1487d4fba030b456ded7ac7121f925ad57f83f/comptime/Init/parse_args.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The command line arguments parsing */
*===========================... | * ... /prgm / project / bigloo / / comptime / Init / parse_args.scm * /
* Author : * /
* Creation : Sun Aug 7 11:47:46 1994 * /
* Last change : We d Dec 14 12:45:06 2022 ( serrano ) * /
* Copyrig... |
93aeaa4b47f010f4141f3d83034de535d351d9eb34a0bf9c59fc38147e6c5ce2 | ParaPhraseAGH/erlang-emas | emas_genetic_ops.erl | @author jstypka < >
%% @version 1.0
%% @doc The module contains the definition of genetic operator callbacks to be implemented.
-module (emas_genetic_ops).
-include ("emas.hrl").
-type sim_params() :: mas:sim_params().
-type solution() :: emas:solution().
-callback solution(sim_params()) ->
solution().
-call... | null | https://raw.githubusercontent.com/ParaPhraseAGH/erlang-emas/08b936a437af90a38f55d4bcb0c8a61f10ccb9a6/src/emas_genetic_ops.erl | erlang | @version 1.0
@doc The module contains the definition of genetic operator callbacks to be implemented. | @author jstypka < >
-module (emas_genetic_ops).
-include ("emas.hrl").
-type sim_params() :: mas:sim_params().
-type solution() :: emas:solution().
-callback solution(sim_params()) ->
solution().
-callback evaluation(solution(), sim_params()) ->
float().
-callback mutation(solution(), sim_params()) ->
... |
a10bf4fc57603a4f4cb03d465783631a05ef9477cfdb398b8486e850344a7b89 | alanz/ghc-exactprint | performGC.hs | module Main (main) where
Test for # 10545
import System.Environment
import Control.Concurrent
import Control.Exception
import Control.Monad
import RandomPGC
import System.Mem
import qualified Data.Set as Set
main = do
[n] <- getArgs
forkIO $ doSomeWork
forM [1..read n] $ \n -> do print n; threadDelay 1000; p... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/performGC.hs | haskell | module Main (main) where
Test for # 10545
import System.Environment
import Control.Concurrent
import Control.Exception
import Control.Monad
import RandomPGC
import System.Mem
import qualified Data.Set as Set
main = do
[n] <- getArgs
forkIO $ doSomeWork
forM [1..read n] $ \n -> do print n; threadDelay 1000; p... | |
59b85972a721d00d89f279031cb57425e281ae30ef4c144fd28b9442069c9117 | melange-re/melange | test_format.ml |
let () =
begin
Format.fprintf Format.std_formatter "%d" 3
end
| null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/test_format.ml | ocaml |
let () =
begin
Format.fprintf Format.std_formatter "%d" 3
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.