_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 |
|---|---|---|---|---|---|---|---|---|
350636f386d7209b54f5d1c442baa4243939e29ba355c989260790656754ccaf | rkaippully/webgear | Trait.hs | {-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE UndecidableInstances #
-- |
Copyright : ( c ) , 2020 - 2021
-- License : MPL-2.0
-- Maintainer :
--
Traits are optional attributes associated with a value . For
-- example, a list containing totally ordered values might have a
-- @Maximum@ t... | null | https://raw.githubusercontent.com/rkaippully/webgear/db122125c35e5853251bfd68a0e5222fafd6cd49/webgear-server/src/WebGear/Trait.hs | haskell | # LANGUAGE ScopedTypeVariables #
|
License : MPL-2.0
Maintainer :
example, a list containing totally ordered values might have a
@Maximum@ trait where the associated attribute is the maximum
value. This trait exists only if the list is non-empty. The 'Trait'
typeclass provides an interface to e... | # LANGUAGE UndecidableInstances #
Copyright : ( c ) , 2020 - 2021
Traits are optional attributes associated with a value . For
module WebGear.Trait
Trait (..)
, Linked
, linkzero
, unlink
, probe
, transcribe
, HasTrait (..)
, pick
, HaveTraits
, MissingTrait
) where
import Dat... |
5fc32f64c29354fde4f0b2f7a9f8c8c5dabbf2e1fb472d8802649f60737d3e40 | roburio/traceroute | config.ml | open Mirage
let host =
let doc = Key.Arg.info ~doc:"The host to trace." ["host"] in
Key.(create "host" Arg.(opt ipv4_address (Ipaddr.V4.of_string_exn "141.1.1.1") doc))
let timeout =
let doc = Key.Arg.info ~doc:"Timeout (in millisecond)" ["timeout"] in
Key.(create "timeout" Arg.(opt int 1000 doc))
let ipv4 =... | null | https://raw.githubusercontent.com/roburio/traceroute/54106b0c5736784c7c64e30efafe2240528a6f71/config.ml | ocaml | open Mirage
let host =
let doc = Key.Arg.info ~doc:"The host to trace." ["host"] in
Key.(create "host" Arg.(opt ipv4_address (Ipaddr.V4.of_string_exn "141.1.1.1") doc))
let timeout =
let doc = Key.Arg.info ~doc:"Timeout (in millisecond)" ["timeout"] in
Key.(create "timeout" Arg.(opt int 1000 doc))
let ipv4 =... | |
fc1be894a3c7587333ccd329313ba83a0dc7282fd68881f34d7558bac9d5d79f | NorfairKing/intray | Import.hs | module Import
( module X,
)
where
import Control.Applicative as X
import Control.Arrow as X
import Control.Monad as X hiding (fail)
import Control.Monad.Fail as X
import Control.Monad.IO.Class as X
import Data.ByteString as X (ByteString)
import Data.Monoid as X
import Data.Proxy as X
import Data.Text as X (Text)
... | null | https://raw.githubusercontent.com/NorfairKing/intray/81724b3e1d7b3d59a760addd9e0a3b6cee1b8050/intray-api/src/Import.hs | haskell | module Import
( module X,
)
where
import Control.Applicative as X
import Control.Arrow as X
import Control.Monad as X hiding (fail)
import Control.Monad.Fail as X
import Control.Monad.IO.Class as X
import Data.ByteString as X (ByteString)
import Data.Monoid as X
import Data.Proxy as X
import Data.Text as X (Text)
... | |
45dda48094c06dd32107928f6eba8f37c3b33a0948c9a54247acee7620d65153 | TatriX/cl-selenium-webdriver | utils.lisp | (defpackage my-test
(:use :cl :cl-selenium)
(:import-from :cl-selenium-utils
:send-keys
:click
:wait-for))
(in-package :my-test)
(with-session ()
(setf (url) "")
(send-keys "cl-selenium-webdriver")
(click "[name=btnG]")
(wait-for "#resultStats"))
| null | https://raw.githubusercontent.com/TatriX/cl-selenium-webdriver/51a4b6833731281353ae6585e404dc934ad8df33/examples/utils.lisp | lisp | (defpackage my-test
(:use :cl :cl-selenium)
(:import-from :cl-selenium-utils
:send-keys
:click
:wait-for))
(in-package :my-test)
(with-session ()
(setf (url) "")
(send-keys "cl-selenium-webdriver")
(click "[name=btnG]")
(wait-for "#resultStats"))
| |
bd787b5c6a360f70bcfa1d5b50dae975562cf240b1301e6b9d1daa079c07ddf2 | puffnfresh/sonic2 | Sprites.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
module Game.Sega.Sonic.Sprites (
copySpriteTile
, copySpriteMapping
, AnimationState(..)
, emptyAnimationState
, stepAnimation
, Sprite(..)
, stepSprite
, spriteAnimationState
, renderSprite
, loadSpriteMappings
) where
import Contr... | null | https://raw.githubusercontent.com/puffnfresh/sonic2/0abc3e109a847582c2e16edb13e83e611419fc8a/src/Game/Sega/Sonic/Sprites.hs | haskell | # LANGUAGE FlexibleContexts # | # LANGUAGE MultiParamTypeClasses #
module Game.Sega.Sonic.Sprites (
copySpriteTile
, copySpriteMapping
, AnimationState(..)
, emptyAnimationState
, stepAnimation
, Sprite(..)
, stepSprite
, spriteAnimationState
, renderSprite
, loadSpriteMappings
) where
import Control.Applicative (liftA2)
impo... |
6fd71c85e4a79156a96e6c694258793e503cb1db78e077c5558fde5d881eb595 | wanishing/sap | describe.clj | (ns sap.commands.describe
(:require
[sap.client :as client]))
(defn describe
([{:keys [id]} _]
(client/describe id)))
| null | https://raw.githubusercontent.com/wanishing/sap/1d4c9f8c8a648eec9e09cf87b900b854ba483e42/src/sap/commands/describe.clj | clojure | (ns sap.commands.describe
(:require
[sap.client :as client]))
(defn describe
([{:keys [id]} _]
(client/describe id)))
| |
c8070e5ecd4db68dde6250c769471ffbaa8de9acbc9bdf3e3194fbdba5d5fdad | JKTKops/cspim | PeepholeSplices.hs | # LANGUAGE TemplateHaskell #
module MIPS.Peephole.PeepholeSplices where
import MIPS.Peephole.PeepholeTH
import MIPS.Language
mkSourcesAndDestsFuns
| null | https://raw.githubusercontent.com/JKTKops/cspim/0218d88ee774023eecef2c4a0733c3cf1184f443/src/MIPS/Peephole/PeepholeSplices.hs | haskell | # LANGUAGE TemplateHaskell #
module MIPS.Peephole.PeepholeSplices where
import MIPS.Peephole.PeepholeTH
import MIPS.Language
mkSourcesAndDestsFuns
| |
19a893f729c7b829800decb6264e45c44a88cba8e57ecb0bf2395b7169c6c5a3 | valderman/haste-compiler | Unboxed.hs | # LANGUAGE Trustworthy #
-----------------------------------------------------------------------------
-- |
Module : Data . Array .
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
--... | null | https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/libraries/ghc-7.10/array/Data/Array/Unboxed.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (uses Data.Array.IArray)
Unboxed immutable arrays.
-----------------------------------------------... | # LANGUAGE Trustworthy #
Module : Data . Array .
Copyright : ( c ) The University of Glasgow 2001
module Data.Array.Unboxed (
UArray,
module Data.Array.IArray,
) where
import Data.Array.Base
import Data.Array.IArray
|
482061c248c82945d306a67a777b0929927c57cb643e4c076f76cd6c1d723d30 | ucsd-progsys/dsolve | test.ml | fun id x = x
withtype {a:int} int(a) -> int
val y = id (id 0 + id 0)
val x = # " c "
x ' = 1 : : [ 2,3 ]
val i d = fn x = > x
sort pos = { a : int | a > 0 }
val ( x , y ) = ( ~1 , 1 )
datatype ' a list with =
nil(0 ) | { n : nat } cons(n+1 ) of ' a * ' a list(n )
fun('a )
length nil = ... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/xiog/DMLex/test.ml | ocaml | fun id x = x
withtype {a:int} int(a) -> int
val y = id (id 0 + id 0)
val x = # " c "
x ' = 1 : : [ 2,3 ]
val i d = fn x = > x
sort pos = { a : int | a > 0 }
val ( x , y ) = ( ~1 , 1 )
datatype ' a list with =
nil(0 ) | { n : nat } cons(n+1 ) of ' a * ' a list(n )
fun('a )
length nil = ... | |
88fecc89545abc8f6304e5ebe984d43361626ac1eb0f8b8a0b11eb937f0b9fcb | fimad/prometheus-haskell | Prometheus.hs | | This module provides the basics for instrumenting executables for
-- use with the </ Prometheus> monitoring system.
module Prometheus (
-- * Registry
registerIO
, register
, unsafeRegisterIO
, unsafeRegister
, unregisterAll
, collectMetrics
-- * Exporting
, exportMetricsAsText
-- * Metrics
--
... | null | https://raw.githubusercontent.com/fimad/prometheus-haskell/4e2c2f1da1f891e9de3ce5a5260ae92882a9f35e/prometheus-client/src/Prometheus.hs | haskell | use with the </ Prometheus> monitoring system.
* Registry
* Exporting
* Metrics
| A metric represents a single value that is being monitored. For example
a metric could be the number of open files, the current CPU temperature, the
elapsed time of execution, and the latency of HTTP requests.
and metric vectors... | | This module provides the basics for instrumenting executables for
module Prometheus (
registerIO
, register
, unsafeRegisterIO
, unsafeRegister
, unregisterAll
, collectMetrics
, exportMetricsAsText
This module provides 4 built - in metric types : counters , gauges , summaries ,
> > > rep... |
324cb81b498286bb32cb917c0ff022a734152e6ffd7887390a93cc930c534214 | nikita-volkov/postgresql-binary | PTI.hs | module Main.PTI where
import qualified Database.PostgreSQL.LibPQ as LibPQ
import Main.Prelude hiding (bool)
-- | A Postgresql type info
data PTI = PTI {ptiOID :: !OID, ptiArrayOID :: !(Maybe OID)}
-- | A Word32 and a LibPQ representation of an OID
data OID = OID {oidWord32 :: !Word32, oidPQ :: !LibPQ.Oid}
mkOID :: ... | null | https://raw.githubusercontent.com/nikita-volkov/postgresql-binary/406cb9a69890eaa92f5aa69092c93e95fc1e0c89/tasty/Main/PTI.hs | haskell | | A Postgresql type info
| A Word32 and a LibPQ representation of an OID
* Constants | module Main.PTI where
import qualified Database.PostgreSQL.LibPQ as LibPQ
import Main.Prelude hiding (bool)
data PTI = PTI {ptiOID :: !OID, ptiArrayOID :: !(Maybe OID)}
data OID = OID {oidWord32 :: !Word32, oidPQ :: !LibPQ.Oid}
mkOID :: Word32 -> OID
mkOID x =
OID x ((LibPQ.Oid . fromIntegral) x)
mkPTI :: Word32... |
565579d97d616d30fa1caa6f8c631ce7074719941189c31b28100c620f142970 | may-liu/qtalk | sync_ets_cache.erl | -module(sync_ets_cache).
-export([send_sync_node_notcie/5,send_sync_nodes_notcie/4,send_async_node_notcie/5]).
-include("logger.hrl").
send_sync_nodes_notcie(Server,Module,Function,Args) ->
Nodes = [node()] ++ nodes() ,
lists:map(fun(Node) ->
send_sync_node_notcie(Server,Node,Module,Function,Args)
end,Nodes)... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/sync_ets_cache.erl | erlang | -module(sync_ets_cache).
-export([send_sync_node_notcie/5,send_sync_nodes_notcie/4,send_async_node_notcie/5]).
-include("logger.hrl").
send_sync_nodes_notcie(Server,Module,Function,Args) ->
Nodes = [node()] ++ nodes() ,
lists:map(fun(Node) ->
send_sync_node_notcie(Server,Node,Module,Function,Args)
end,Nodes)... | |
27790b6eff2afc8497468a635b651487cc45f17e7e138f04af7d8a0e90faa156 | pascal-knodel/haskell-craft | E'8'16.hs | --
--
--
-----------------
Exercise 8.16 .
-----------------
--
--
--
module E'8'16 where
Note : Chapter 7 > cabal install
import E'7'33 ( isPalin )
checkPalindromes :: IO ()
checkPalindromes
= do putStr "\nThink you palindromes (after each input, a message indicates\n\
\if it is a palindro... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Chapter%208/E'8'16.hs | haskell |
---------------
---------------
Think you palindromes (after each input, a message indicates
if it is a palindrome or not, abort with 'no input and press ENTER'):
Dog god.
... It's one.
Good dog.
... It's none. | Exercise 8.16 .
module E'8'16 where
Note : Chapter 7 > cabal install
import E'7'33 ( isPalin )
checkPalindromes :: IO ()
checkPalindromes
= do putStr "\nThink you palindromes (after each input, a message indicates\n\
\if it is a palindrome or not, abort with 'no input and press ENTER'):\n\n... |
e539f174fc8069886d70fa7fa81f0276f3fc8d38b3bcce17994ebb353ab66398 | input-output-hk/plutus | TH.hs | | Some basic Template Haskell to reduce boilerplate in the cost model tests .
We have to put this in a separate source file because of staging
restrictions .
We have to put this in a separate source file because of staging
restrictions.
-}
# LANGUAGE TemplateHaskell #
module TH (genTest)
where
im... | null | https://raw.githubusercontent.com/input-output-hk/plutus/6d759c46b3fbb54f9f0a01d84fdbc9d996a1805a/plutus-core/cost-model/test/TH.hs | haskell | | Some basic Template Haskell to reduce boilerplate in the cost model tests .
We have to put this in a separate source file because of staging
restrictions .
We have to put this in a separate source file because of staging
restrictions.
-}
# LANGUAGE TemplateHaskell #
module TH (genTest)
where
im... | |
1ac0fa9aee469688ace60dc271d57fc05ec65d3b67077fcf3596e7b55ef146b7 | paurkedal/ocaml-caqti | caqti_eio.ml | Copyright ( C ) 2022 < >
*
* 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 version 3 of the License , or ( at your
* option ) any later version , with the ... | null | https://raw.githubusercontent.com/paurkedal/ocaml-caqti/14bd63f4ef7e81f45fcef28c45167cb13c0ad665/caqti-eio/lib/caqti_eio.ml | ocaml | Copyright ( C ) 2022 < >
*
* 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 version 3 of the License , or ( at your
* option ) any later version , with the ... | |
7fc83042156841c9b383eb02ae75918896e8a1772be5bf69cb93c643ac40a907 | alanzplus/EOPL | 2.21-test.rkt | #lang eopl
(require rackunit "2.21.rkt")
(require rackunit/text-ui)
(define a-env
(extend-env 'a 1 (empty-env)))
(define env-test
(test-suite
"Tests for env"
(check-equal? (apply-env 'a a-env) 1)
(check-equal? (has-binding? 'a a-env) #t)
(check-equal? (has-binding? 'b a-env) #f)))
(run-tests env... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch2/2.21-test.rkt | racket | #lang eopl
(require rackunit "2.21.rkt")
(require rackunit/text-ui)
(define a-env
(extend-env 'a 1 (empty-env)))
(define env-test
(test-suite
"Tests for env"
(check-equal? (apply-env 'a a-env) 1)
(check-equal? (has-binding? 'a a-env) #t)
(check-equal? (has-binding? 'b a-env) #f)))
(run-tests env... | |
c3fa6b53feb60f57ddd0e3706afd6f23bd47bb3eef52919ed18431e8a5c4a508 | klarna/mnesia_eleveldb | mnesia_eleveldb_proper_semantics_test.erl | %%----------------------------------------------------------------
Copyright ( c ) 2013 - 2016 Klarna AB
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/klarna/mnesia_eleveldb/1bbeb9243cf0e7f3ef36a713bf657b3ebf31fb63/test/mnesia_eleveldb_proper_semantics_test.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 express or implied. See the License for the
specific language governing permissions an... | Copyright ( c ) 2013 - 2016 Klarna AB
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@doc Verify dirty vs transaction seman... |
93bd5e277cab162b37f9057ec6f445dda68f68e502db7ba72a16257f1932bc71 | K1D77A/lunamech-matrix-api | conditions.lisp | (in-package #:lunamech-matrix-api/v2)
(define-condition lunamech-matrix-api-condition (error)
())
(define-condition api-error (lunamech-matrix-api-condition)
((api-error-error
:accessor api-error-error
:initarg :api-error-error
:initform "default"
:type string)
(api-error-code
:accessor api... | null | https://raw.githubusercontent.com/K1D77A/lunamech-matrix-api/02c5161d9d9d0c28cbfc02074583bb53abf5c940/api/v2/conditions.lisp | lisp | (in-package #:lunamech-matrix-api/v2)
(define-condition lunamech-matrix-api-condition (error)
())
(define-condition api-error (lunamech-matrix-api-condition)
((api-error-error
:accessor api-error-error
:initarg :api-error-error
:initform "default"
:type string)
(api-error-code
:accessor api... | |
394550682820169b106d0c0ff7342e0e18f0f6109910ceb03cba9e49283b52e8 | melange-re/melange | lam_convert.mli | Copyright ( C ) 2018 - 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/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/core/lam_convert.mli | ocaml | val happens_to_be_diff:
(int * Lambda.lambda) list -> int option | Copyright ( C ) 2018 - 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... |
f2566113e3e5b95d4a3c7f0f32204a6646c637360a26ddfb99991dba271b1c83 | tmattio/js-bindings | es2017_typedarrays.mli | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem
[@@@ocaml.warning "-7-11-32-33-39"]
]
open Ts2ocaml_baselib
(*
unknown identifiers:
- Float32Array
- Float64Array
- Int16Array
- Int32Array
- Int8Array
- Uint16Array
- Uint32Array
- Uint8Array
- Uint8ClampedArray
*)
[@@@js.stop]
module type Miss... | null | https://raw.githubusercontent.com/tmattio/js-bindings/fe1d40a5b8cae157af85fa84ca482fb6b0ddf1e0/lib/es2018/_gen/es2017_typedarrays.mli | ocaml |
unknown identifiers:
- Float32Array
- Float64Array
- Int16Array
- Int32Array
- Int8Array
- Uint16Array
- Uint32Array
- Uint8Array
- Uint8ClampedArray
| [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem
[@@@ocaml.warning "-7-11-32-33-39"]
]
open Ts2ocaml_baselib
[@@@js.stop]
module type Missing = sig
module Float32Array : sig
type t_0
val t_0_to_js: t_0 -> Ojs.t
val t_0_of_js: Ojs.t -> t_0
end
module Float64Array : sig
type t_0
val t_0_to_j... |
b9162b294f7ee3e8fbfff5d3d08c8869edfc73297e63b9582eaac341656f7eb0 | erlang/rebar3 | rebar_prv_lock.erl | -module(rebar_prv_lock).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include("rebar.hrl").
-define(PROVIDER, lock).
-define(DEPS, [install_deps]).
%% ===================================================================
%% Public API
%% ==========================================... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/rebar_prv_lock.erl | erlang | ===================================================================
Public API
===================================================================
Only lock default profile run
Remove the checkout dependencies from the old lock info
so that they do not appear in the rebar_utils:info_useless/1 warning.
TODO: don'... | -module(rebar_prv_lock).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include("rebar.hrl").
-define(PROVIDER, lock).
-define(DEPS, [install_deps]).
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
State1 = rebar_state:add_provider(State, providers:creat... |
a94f8014575aea4d886ce9180292f703d15b3134a3af875f6dabffb38ba511d1 | abooij/sudbury | DispatchFFI.hs | |
Module : Graphics . Sudbury . CABI.DispatchFFI
Description : C ABI
Copyright : ( c ) , 2015 - 2017
License : MIT
Maintainer :
Stability : experimental
Use libffi to call C functions for callbacks
Module : Graphics.Sudbury.CABI.DispatchFFI
Description : C ABI
Copyright : (... | null | https://raw.githubusercontent.com/abooij/sudbury/a9ab559728487d78469db73ecf516d145b6c21ec/Graphics/Sudbury/CABI/DispatchFFI.hs | haskell | |
Module : Graphics . Sudbury . CABI.DispatchFFI
Description : C ABI
Copyright : ( c ) , 2015 - 2017
License : MIT
Maintainer :
Stability : experimental
Use libffi to call C functions for callbacks
Module : Graphics.Sudbury.CABI.DispatchFFI
Description : C ABI
Copyright : (... | |
24b20a0577a5919f7da48128913dcd07471f59ee60e60e2fabc8e961f9bc59ca | 2600hz-archive/whistle | mochiweb_multipart.erl | @author < >
2007 Mochi Media , Inc.
@doc Utilities for parsing multipart / form - data .
-module(mochiweb_multipart).
-author('').
-export([parse_form/1, parse_form/2]).
-export([parse_multipart_request/2]).
-export([parts_to_body/3, parts_to_multipart_body/4]).
-export([default_file_handler/2]).
-define(... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/mochiweb-1.7.1/src/mochiweb_multipart.erl | erlang | TODO: DOCUMENT THIS MODULE.
@type key() = atom() | string() | binary().
@type value() = atom() | iolist() | integer().
@type header() = {key(), value()}.
@type request().
@type file_handler() = (Filename::string(), ContentType::string()) -> file_handler_callback().
@type file_handler_callback() = (binary() | eof... | @author < >
2007 Mochi Media , Inc.
@doc Utilities for parsing multipart / form - data .
-module(mochiweb_multipart).
-author('').
-export([parse_form/1, parse_form/2]).
-export([parse_multipart_request/2]).
-export([parts_to_body/3, parts_to_multipart_body/4]).
-export([default_file_handler/2]).
-define(... |
f9f55eb1a0919255e7e86d258c79d6c62cc3b48a6723ff1fd8fa9c3123f66784 | bmeurer/ocamljit2 | testfork.ml | (* POSIX threads and fork() *)
let compute_thread c = ignore c
while true do
print_char c ; flush stdout ;
for i = 1 to 100000 do ignore(ref [ ] ) done
done
while true do
print_char c; flush stdout;
for i = 1 to 100000 do ignore(ref []) done
done
*)
let main () =
ignore(Thread.cre... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/testsuite/tests/lib-systhreads/testfork.ml | ocaml | POSIX threads and fork() |
let compute_thread c = ignore c
while true do
print_char c ; flush stdout ;
for i = 1 to 100000 do ignore(ref [ ] ) done
done
while true do
print_char c; flush stdout;
for i = 1 to 100000 do ignore(ref []) done
done
*)
let main () =
ignore(Thread.create compute_thread '1');
Thre... |
b1f4f519cb97b996d4b7c8e5857631c44854d8c10aee2b3ec743409a4ad5bbf9 | tweag/inline-js | Instruction.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Language.JavaScript.Inline.Core.Instruction where
import Control.Concurrent.STM
import Control.Exception
import Data.Binary.Get
import qualified Data.ByteString.Lazy as LBS
import Data... | null | https://raw.githubusercontent.com/tweag/inline-js/ef675745e84d23d51c50660d40acf9e684fbb2d6/inline-js-core/src/Language/JavaScript/Inline/Core/Instruction.hs | haskell | # LANGUAGE OverloadedStrings #
When this function returns, the eval request has been sent to the eval
server, but the result may not be sent back yet. The returned value is a
The caveats of lazy I/O apply here as well. For instance, returning
problem. In case when it's desirable to ensure the evaluation has comple... | # LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Language.JavaScript.Inline.Core.Instruction where
import Control.Concurrent.STM
import Control.Exception
import Data.Binary.Get
import qualified Data.ByteString.Lazy as LBS
import Data.Proxy
import Foreign
import Langua... |
39a22b2668564fea8412db167bfd7bea5ba5e99a8bbc276a8ce53602280ad60f | narkisr-deprecated/core | networking.clj | (ns re-core.integration.networking
(:use midje.sweet)
(:require
[re-core.fixtures.data :refer :all]
[re-core.fixtures.core :refer [with-conf]]
[hypervisors.networking :as n :refer (initialize-range long-to-ip list-used-ips clear-range)])
)
(with-conf
(with-state-changes [(before :facts (do (clear... | null | https://raw.githubusercontent.com/narkisr-deprecated/core/85b4a768ef4b3a4eae86695bce36d270dd51dbae/test/re_core/integration/networking.clj | clojure | (ns re-core.integration.networking
(:use midje.sweet)
(:require
[re-core.fixtures.data :refer :all]
[re-core.fixtures.core :refer [with-conf]]
[hypervisors.networking :as n :refer (initialize-range long-to-ip list-used-ips clear-range)])
)
(with-conf
(with-state-changes [(before :facts (do (clear... | |
fb0cc61c59a26ea96bc507ed2a3b55fb189725d6fffb6efbce15967f35646e72 | FreeProving/free-compiler | Expr.hs | | This module contains functions for converting expressions to Coq .
module FreeC.Backend.Coq.Converter.Expr where
import Control.Monad ( (>=>) )
import Data.Maybe ( fromMaybe )
import qualified FreeC.Backend.Coq.Base as Coq.Base
import ... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Backend/Coq/Converter/Expr.hs | haskell | -----------------------------------------------------------------------------
Expressions --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
@case@ ... | | This module contains functions for converting expressions to Coq .
module FreeC.Backend.Coq.Converter.Expr where
import Control.Monad ( (>=>) )
import Data.Maybe ( fromMaybe )
import qualified FreeC.Backend.Coq.Base as Coq.Base
import ... |
f1efcaa743ea41c596b2e22dfec2bdf1e11012b8bab1df58717d7d81c258c5a6 | Beluga-lang/Beluga | options.ml | (** Centralized module for global flags.
Think twice (no, make it thrice) about adding anything here.
*)
module Testing = struct
let print_external_syntax = ref false
end
module PrinterControl = struct
type subst_style =
[ `natural
| `de_bruijn
]
let implicit = ref false
let subst_style : s... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/1d39095c99dc255d972a339d447dc04286d8c13f/src/core/options.ml | ocaml | * Centralized module for global flags.
Think twice (no, make it thrice) about adding anything here.
* on: is true if we call the interpreter with argument: +t
The result is to print the timings to stdout when signature
reconstruction ends.
* onf: is true if we call the interpreter with argument: ... |
module Testing = struct
let print_external_syntax = ref false
end
module PrinterControl = struct
type subst_style =
[ `natural
| `de_bruijn
]
let implicit = ref false
let subst_style : subst_style ref = ref `natural
end
module Subord = struct
let dump = ref false
end
module Debug = struct
l... |
1a601b68b03484c5615839854ee81fee977f7816533e42babb10ad9a6f951d50 | HaskellForCats/HaskellForCats | LearnCh4.hs | # LANGUAGE NPlusKPatterns #
module Fib where
import Test.QuickCheck
-- foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
myFib 6 = = fib 6
myFib :: Integer -> Integer
myFib 0 = 0
myFib 1 = 1
myFib n = (myFib (n - 1) + myFib (n - 2))
grahamFib :: Integer -> Integer
grahamFib 0 = 0
grahamFib 1 = 1... | null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/LearnYouAHaskell/LearnCh4.hs | haskell | foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b | # LANGUAGE NPlusKPatterns #
module Fib where
import Test.QuickCheck
myFib 6 = = fib 6
myFib :: Integer -> Integer
myFib 0 = 0
myFib 1 = 1
myFib n = (myFib (n - 1) + myFib (n - 2))
grahamFib :: Integer -> Integer
grahamFib 0 = 0
grahamFib 1 = 1
grahamFib (n + 2) = grahamFib n + grahamFib (n + 1)
... |
35da9a48a8af03b833bc6f535d813aec73f7c8c22c7b7b0ad95bbabc11c32a67 | ragkousism/Guix-on-Hurd | dejagnu.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/dejagnu.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages dejagnu)
#:use-module (guix packages)
#:use-module (gui... |
9fd0722c6ec8316a4eed32c0e32ee2039c4fb2a9a5a412e1d8a46e78e8545c55 | 1HaskellADay/1HAD | Exercise.hs | module HAD.Y2014.M03.D13.Exercise where
| pairToList Transform a pair of same type elements in a list of two
-- elements.
--
-- Of course, the major challenge is to find a point free function
-- (without lambda). And, if you want more fun, do it without (++).
--
prop > replicate 2 ( x : : Int ) = = pairToList ( x... | null | https://raw.githubusercontent.com/1HaskellADay/1HAD/3b3f9b7448744f9b788034f3aca2d5050d1a5c73/exercises/HAD/Y2014/M03/D13/Exercise.hs | haskell | elements.
Of course, the major challenge is to find a point free function
(without lambda). And, if you want more fun, do it without (++).
prop> (\(f,s) -> [f,s]) x == pairToList x
| module HAD.Y2014.M03.D13.Exercise where
| pairToList Transform a pair of same type elements in a list of two
prop > replicate 2 ( x : : Int ) = = pairToList ( x , x )
pairToList :: (a,a) -> [a]
pairToList = undefined
|
10aad0a61cdfca2b00009d10453934e4f0bc89b552292b8d9460f34d19eacfc4 | TrustInSoft/tis-kernel | split_return.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/value/legacy/split_return.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
392692853a7a60bef7c4b0efadb554e4d6181fa46c003c1b43e1548f09a57770 | solita/mnt-teet | container.cljs | (ns teet.ui.container
(:require [herb.core :refer [<class]]
[teet.theme.container-theme :as container-theme]
[teet.ui.icons :as icons]
[teet.ui.material-ui :refer [Collapse IconButton]]
[teet.ui.typography :as typography]))
(defn collapsible-container-heading
"The he... | null | https://raw.githubusercontent.com/solita/mnt-teet/e160c91ec64a11735e6e701c4295205b40abb583/app/frontend/src/cljs/teet/ui/container.cljs | clojure | (ns teet.ui.container
(:require [herb.core :refer [<class]]
[teet.theme.container-theme :as container-theme]
[teet.ui.icons :as icons]
[teet.ui.material-ui :refer [Collapse IconButton]]
[teet.ui.typography :as typography]))
(defn collapsible-container-heading
"The he... | |
425fd59a53238b05491d9f82fcf3fb56df57d3bc576c634ebfc2668f39a9eefd | hiroshi-unno/coar | search.ml | (*
USED: PEPM2013 as search
*)
type my_option = MyNone | MySome of int
let rec exists test f n m =
if n < m
then
if test (f n)
then MySome n
else exists test f (n+1) m
else
MyNone
let mult3 n = 3 * n
let main n m =
let test x = x = m in
match exists test mult3 0 n with
MyNone -> ... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/benchmarks/OCaml/safety/tacas2015/search.ml | ocaml |
USED: PEPM2013 as search
|
type my_option = MyNone | MySome of int
let rec exists test f n m =
if n < m
then
if test (f n)
then MySome n
else exists test f (n+1) m
else
MyNone
let mult3 n = 3 * n
let main n m =
let test x = x = m in
match exists test mult3 0 n with
MyNone -> ()
| MySome x -> assert (... |
6c71d2b01d88a8d67edaecee3d1aacfabf38d373de6d41619d93c62a384a2419 | elaforge/karya | Sub_test.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Derive.Call.Sub_test where
import qualified Derive.Args as Args
import qualified Derive.Call.CallTest as CallTest
import qualified Derive.Call.NoteUtil as NoteUtil
import qualified... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/Derive/Call/Sub_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
Simple inversion.
Make sure empty tracks are stripped. But the title of the empty track
is still applied.
Initial empty track is also stripped.
This used to fail when I used an Inverted state instead of st... | Copyright 2013
module Derive.Call.Sub_test where
import qualified Derive.Args as Args
import qualified Derive.Call.CallTest as CallTest
import qualified Derive.Call.NoteUtil as NoteUtil
import qualified Derive.Call.Sub as Sub
import qualified Derive.Derive as Derive
import qualified Derive.DeriveTest as DeriveTest... |
0cd1fea7faac6284c5434dc8e689975a2837e66b8bd1f38163da64811d40791a | mitchellwrosen/planet-mitchell | Int.hs | module Num.Int
( Int
, Int8
, Int16
, Int32
, Int64
) where
import GHC.Int (Int, Int16, Int32, Int64, Int8)
| null | https://raw.githubusercontent.com/mitchellwrosen/planet-mitchell/18dd83204e70fffcd23fe12dd3a80f70b7fa409b/planet-mitchell/src/Num/Int.hs | haskell | module Num.Int
( Int
, Int8
, Int16
, Int32
, Int64
) where
import GHC.Int (Int, Int16, Int32, Int64, Int8)
| |
05769b3b33ad38c506eb9a391b74841a951eccb805583002dc7fb63cc52b522f | kowainik/summoner | License.hs | |
Module : Summoner . License
Copyright : ( c ) 2017 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
Data types that represent license names and license content ... | null | https://raw.githubusercontent.com/kowainik/summoner/0c03dd0d6ee71c79227974b697f171396d3d09a7/summoner-cli/src/Summoner/License.hs | haskell | | Licenses supported by @summoner@.
| Replaces name/year placeholders with the actual data.
| Fetches the license by given name and customises user information where
applicable.
| Show license name along with its short description. | |
Module : Summoner . License
Copyright : ( c ) 2017 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
Data types that represent license names and license content ... |
06f7544a934790cb300e83abe827bb7c76516447f62c0dd264a7ac88d70bed1d | mini-monkey/mini-monkey | mm_room.erl | %%%-------------------------------------------------------------------
@doc MiniMonkey Room
%%
%% The best analogy is a chat system. You enter a room and you can
%% either post or you can subscribe
%% @end
%%%-------------------------------------------------------------------
-module(mm_room).
-behaviour(gen_server)... | null | https://raw.githubusercontent.com/mini-monkey/mini-monkey/4afa4385256c0f1d23db522c0725c3291a8c86c8/src/mm_room.erl | erlang | -------------------------------------------------------------------
The best analogy is a chat system. You enter a room and you can
either post or you can subscribe
@end
-------------------------------------------------------------------
API
Behaviour
--------------------------------------------------------------... | @doc MiniMonkey Room
-module(mm_room).
-behaviour(gen_server).
-export([start_link/2,
reset/1,
publish/3,
subscribe/4,
unsubscribe/2,
count_subscribers/1,
permissions/5,
is_admin/2,
forward_from_to/3,
count_forwards/1,
forward_dropoff/2]).
-export([init/1,
handle_call/3,
handle_cast/2,
ha... |
62c132cdbb3b9593c6533d1989684e9e2391c06086a5415baab4f0842213355c | yesodweb/persistent | JSONTest.hs | # LANGUAGE ExistentialQuantification #
# language DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE St... | null | https://raw.githubusercontent.com/yesodweb/persistent/bf2ceea762f155c5f90a34502502d47a694ce97e/persistent-postgresql/test/JSONTest.hs | haskell | # LANGUAGE OverloadedStrings #
[[],'b',{test: [null],test2: 'yes'},4,null,{}] == True
[null,4,'b',{},[],{test:[null],test2: 'yes'}, false] == False
[null,4,'b',{},[],{test: [null],test2: 'yes'}] @>. [{}] == True
[{"test1":[null]}] == False
[[],[],[[],[]]] @>. [[]] == True
[[],[3,... | # LANGUAGE ExistentialQuantification #
# language DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE Deriv... |
806c7e52a27fb96263713f988640b6fa0605d282d7d70e5fae5615f16edc4e36 | seanhess/robotquest | Middleware.hs | {-# LANGUAGE OverloadedStrings #-}
module Botland.Middleware where
import Botland.Types hiding (Direction(..))
import Botland.Control
import Botland.Helpers
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, decode)
import Data.ByteString.Lazy.Char8 (ByteString, unpack)
import Database.MongoDB (Ac... | null | https://raw.githubusercontent.com/seanhess/robotquest/98328579d6bbfad2cd678811a9759c907cf6b268/Botland/Middleware.hs | haskell | # LANGUAGE OverloadedStrings #
lets you make sure they have control over a bot before letting them play with it
parse the body as something, and call "k" with the result |
module Botland.Middleware where
import Botland.Types hiding (Direction(..))
import Botland.Control
import Botland.Helpers
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, decode)
import Data.ByteString.Lazy.Char8 (ByteString, unpack)
import Database.MongoDB (Action, Pipe, access, master, Databas... |
671a0ce9f7216e98a208182f9d6666b14d53b1dff7dc51e162c16640572a604f | HugoPeters1024/hs-sleuth | Types.hs | # LANGUAGE BangPatterns , ExistentialQuantification #
-- |
-- Module : Data.Text.Internal.Fusion.Types
Copyright : ( c ) 2008 - 2009 ,
( c ) 2009 ,
( c ) 2009 ,
( c ) 2011
--
-- License : BSD-style
-- Maintainer :
-- Stability : experimental
... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/91aa2806ea71b7a26add3801383b3133200971a5/test-project/text-nofusion/src/Data/Text/Internal/Fusion/Types.hs | haskell | |
Module : Data.Text.Internal.Fusion.Types
License : BSD-style
Maintainer :
Stability : experimental
/Warning/: this is an internal module, and does not have a stable
API or name. Functions in this module may not check or enforce
preconditions expected by public modules. Use at your own risk!
|... | # LANGUAGE BangPatterns , ExistentialQuantification #
Copyright : ( c ) 2008 - 2009 ,
( c ) 2009 ,
( c ) 2009 ,
( c ) 2011
Portability : GHC
Core stream fusion functionality for text .
module Data.Text.Internal.Fusion.Types
(
CC(..)
, Pai... |
5ac2cbb232378f9c0ee524ed1d51cb0ab374e56a8c0e475ba482d1a6b7e09edc | baffalop/aoc22-haskell | Day23.hs | module Day23 (parse, solve1, solve2, viz) where
import Data.Text (Text, unpack)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe)
import Data.Foldable (find)
import Control.Arrow ((&&&))
import Data.Matrix (Matrix)
import qualifi... | null | https://raw.githubusercontent.com/baffalop/aoc22-haskell/31ccaf4bbbe8106e8867ef11e2b0d96b430c342e/src/Day23.hs | haskell | debugging | module Day23 (parse, solve1, solve2, viz) where
import Data.Text (Text, unpack)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe)
import Data.Foldable (find)
import Control.Arrow ((&&&))
import Data.Matrix (Matrix)
import qualifi... |
05b0f3a10d632e53bc8196bec4ad97fd1b42c7cba6aaa333eaffd4c58d2e6432 | notogawa/graceful | GracefulSpec.hs | # LANGUAGE CPP #
module System.Posix.GracefulSpec ( spec ) where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Data.List
import Network
import Network.Socket
#if MIN_VERSION_process(1,0,1)
#else
import System.Cmd
#endif
import System.Directory
import System.Exit
import System.FilePath
... | null | https://raw.githubusercontent.com/notogawa/graceful/695ce590ddd2967eb1625d90fb4be56450698ca9/test/System/Posix/GracefulSpec.hs | haskell | master + 4 worker
master + 4 worker
restarted workers
master + 4 worker
master + 4 worker
master + 4 worker
master + 4 worker
abort upgrade | # LANGUAGE CPP #
module System.Posix.GracefulSpec ( spec ) where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Data.List
import Network
import Network.Socket
#if MIN_VERSION_process(1,0,1)
#else
import System.Cmd
#endif
import System.Directory
import System.Exit
import System.FilePath
... |
e2e95219128aa83db87f82d9c09ae734ca2bbb6f0cf85737cd2429d77f4fb22b | camsaul/lein-check-namespace-decls | project.clj | (defproject lein-check-namespace-decls "1.0.5-SNAPSHOT"
:min-lein-version "2.5.0"
:description
"Linter that checks that namespace decls for files in a Leinigen project's `:source-paths` are cleaned the way
`clj-refactor` would clean them."
:url "-check-namespace-decls"
:license
{:name "EPL-2.0"
:url ... | null | https://raw.githubusercontent.com/camsaul/lein-check-namespace-decls/dbfb8854bfeddc94e17622fb84e1477f4e55b259/project.clj | clojure | for tests | (defproject lein-check-namespace-decls "1.0.5-SNAPSHOT"
:min-lein-version "2.5.0"
:description
"Linter that checks that namespace decls for files in a Leinigen project's `:source-paths` are cleaned the way
`clj-refactor` would clean them."
:url "-check-namespace-decls"
:license
{:name "EPL-2.0"
:url ... |
94622500e3add0ed04f456ff88d7ea7b99b23dfabc08e0828c8c286ccb1b3cf9 | multimodalrouting/osm-fulcro | loader_ws.cljs | (ns app.loader-ws
(:require [nubank.workspaces.core :refer [defcard]]
[nubank.workspaces.card-types.fulcro3 :as ct.fulcro]
[com.fulcrologic.fulcro.components :refer [defsc]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.data-fetch :refer [refresh!... | null | https://raw.githubusercontent.com/multimodalrouting/osm-fulcro/dedbf40686a18238349603021687694e5a4c31b6/src/workspaces/app/loader_ws.cljs | clojure | (ns app.loader-ws
(:require [nubank.workspaces.core :refer [defcard]]
[nubank.workspaces.card-types.fulcro3 :as ct.fulcro]
[com.fulcrologic.fulcro.components :refer [defsc]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.data-fetch :refer [refresh!... | |
39a0e97194d30d9bf3828db31f0e3f80dd64669c00ae4630cfd7489f21cddb04 | diagrams/diagrams-contrib | BTreeTestPure.hs | # LANGUAGE NoMonomorphismRestriction #
import Control.Applicative
import Control.Lens hiding (( # ))
import Control.Monad.Random
import Control.Monad.Reader
import Control.Monad.State
import Diagrams.Backend.Cairo.CmdLine
import D... | null | https://raw.githubusercontent.com/diagrams/diagrams-contrib/63f2aec4c070d1f558a5fcefd67b5315d64faaf5/test/BTreeTestPure.hs | haskell | sierpinskiTree n k
|
----------------------------------------------------------
Critical Boltzmann generator for binary trees | # LANGUAGE NoMonomorphismRestriction #
import Control.Applicative
import Control.Lens hiding (( # ))
import Control.Monad.Random
import Control.Monad.Reader
import Control.Monad.State
import Diagrams.Backend.Cairo.CmdLine
import D... |
c87e374f6db65408f5b1262e77c88303cf0223f94a21adf5d53383868775ea38 | tkonolige/dbignore | Test.hs | {-# OPTIONS_GHC -Wall -fwarn-tabs #-}
----------------------------------------------------------------
~ 2009.02.06
-- |
Module : Data . Trie . ByteStringInternal . Test
Copyright : Copyright ( c ) 2008 - -2009 wren
-- License : BSD3
-- Maintai... | null | https://raw.githubusercontent.com/tkonolige/dbignore/237a03f9cdc82af882e3f8ccbfd4115000a8bb1d/bytestring-trie/test/Data/Trie/ByteStringInternal/Test.hs | haskell | # OPTIONS_GHC -Wall -fwarn-tabs #
--------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : provisional
Portability : portable
--------------------------------------------------------------
--------------------------------------------------------------
|... |
~ 2009.02.06
Module : Data . Trie . ByteStringInternal . Test
Copyright : Copyright ( c ) 2008 - -2009 wren
Testing helper functions on ' ByteString 's .
module Data.Trie.ByteStringInternal.Test where
import Data.Trie.ByteStringInternal
import D... |
369e2925b47724901ea2e53d689d3bbbd08597f0aeff580f3fb8b27ef0aa144d | ssor/erlangDemos | ti_server.erl | -module(ti_server).
-behaviour(gen_server).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-record(state, {lsock}).
start_link(LSock) ->
gen_server:start_link(?MODULE, [LSock], []).
init([LSock]) ->
{ok, #state{lsock = LSock}, ... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/erlware-Erlang-and-OTP-in-Action-Source/chapter_11/tcp_interface/src/ti_server.erl | erlang | -module(ti_server).
-behaviour(gen_server).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-record(state, {lsock}).
start_link(LSock) ->
gen_server:start_link(?MODULE, [LSock], []).
init([LSock]) ->
{ok, #state{lsock = LSock}, ... | |
7c47fdba8dee629548ab4908e1fb31fb4e5029117a9d2a9d5bb0b79d5d1b046d | padsproj/oforest | simple.ml |
Use Makefile in examples directory
:
./desugar.sh simple / simple.ml
Compile :
make simple
Use Makefile in examples directory
Desugar:
./desugar.sh simple/simple.ml
Compile:
make simple
*)
open Forest
module CostMon = CostNameMon
let exName = "simple";;
[%%forest {|
ofile = file o... | null | https://raw.githubusercontent.com/padsproj/oforest/e10abf1c35f6d49d4bdf13d51cab44487629b3a3/examples/simple/simple.ml | ocaml |
Use Makefile in examples directory
:
./desugar.sh simple / simple.ml
Compile :
make simple
Use Makefile in examples directory
Desugar:
./desugar.sh simple/simple.ml
Compile:
make simple
*)
open Forest
module CostMon = CostNameMon
let exName = "simple";;
[%%forest {|
ofile = file o... | |
6e5c94fc7389f3678f3d619ab029bfe1b94bd080c67c85a5bdaca76df7c443fd | diogob/pg-recorder | Config.hs | module PgRecorder.Config ( prettyVersion
, minimumPgVersion
, readOptions
, AppConfig (..)
) where
import PgRecorder.Prelude
import qualified Data.Text as T
import Data.Version ... | null | https://raw.githubusercontent.com/diogob/pg-recorder/b4fdd2952f8b0f4c66e140cadebdc2316fc03fe3/src/PgRecorder/Config.hs | haskell | | Data type to store all command line options
| User friendly version number
| Function to read and parse options from the command line | module PgRecorder.Config ( prettyVersion
, minimumPgVersion
, readOptions
, AppConfig (..)
) where
import PgRecorder.Prelude
import qualified Data.Text as T
import Data.Version ... |
ea965869219b46dda5e5935dc71796beb35a02a2ac982ca85759c5e963452218 | caisah/sicp-exercises-and-examples | ex.3.21.scm | decides to test the queue implementation described above . He types in
;; the procedures to the List interpreter and proceeds to try them out:
;; (define q1 (make-queue))
;; (insert-queue! q1 'a)
;; ((a) a)
;; (insert-queue! q1 'b)
;; ((a b) b)
;; (delete-queue! q1)
;; ((b) b)
;; (delete-queue! q1... | null | https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/3.3.2-representing_queues/ex.3.21.scm | scheme | the procedures to the List interpreter and proceeds to try them out:
(define q1 (make-queue))
(insert-queue! q1 'a)
((a) a)
(insert-queue! q1 'b)
((a b) b)
(delete-queue! q1)
((b) b)
(delete-queue! q1)
(() b)
"It's all wrong!" he complains. "The interpreter's response shows that the last it... | decides to test the queue implementation described above . He types in
inserted into the queue twice . And when I delete both items , the second b is still there ,
so the queue is n't empty , even though it 's supposed to be . " suggests that
has misunderstood that is happening . " It 's not that the i... |
594240744fa7c99c5403f15dbf734acfb1bac2c446b5b456d2b892e49d05f97c | zkincaid/duet | test_srk_poly.ml | open OUnit
let _ =
ignore (run_test_tt_main Test_polyhedron.suite);
ignore (run_test_tt_main Test_intLattice.suite);
ignore (run_test_tt_main Test_polynomialLattice.suite);
ignore (run_test_tt_main Test_polynomialCone.suite);
ignore (run_test_tt_main Test_polynomialConeCpClosure.suite)
| null | https://raw.githubusercontent.com/zkincaid/duet/162d3da830f12ab8e8d51f7757cddcb49c4084ca/srk/test/test_srk_poly.ml | ocaml | open OUnit
let _ =
ignore (run_test_tt_main Test_polyhedron.suite);
ignore (run_test_tt_main Test_intLattice.suite);
ignore (run_test_tt_main Test_polynomialLattice.suite);
ignore (run_test_tt_main Test_polynomialCone.suite);
ignore (run_test_tt_main Test_polynomialConeCpClosure.suite)
| |
de48c37cc48153ef79db66073947ddc0964ec65a317bbda437c830b244320604 | timbod7/haskell-chart | example5-m.hs | import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Backend.Cairo
values :: [ (String,Double,Bool) ]
values = [ ("Mexico City",19.2,False), ("Mumbai",12.9,False), ("Sydney",4.3,False), ("London",8.3,False), ("New York",8.2,True) ]
pitem (s,v,o) = pitem_value .~ v
$ pitem_label .~ s
... | null | https://raw.githubusercontent.com/timbod7/haskell-chart/8c5a823652ea1b4ec2adbced4a92a8161065ead6/wiki-examples/example5-m.hs | haskell | import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Backend.Cairo
values :: [ (String,Double,Bool) ]
values = [ ("Mexico City",19.2,False), ("Mumbai",12.9,False), ("Sydney",4.3,False), ("London",8.3,False), ("New York",8.2,True) ]
pitem (s,v,o) = pitem_value .~ v
$ pitem_label .~ s
... | |
f4bd912e3c47c31e6de305d31734a25e94f1045bdb98ab2646c5feb1eb853c15 | ocsigen/tyxml | tyxml.ml | (** Typed implementation for HTML, SVG and XML
This is the natural implementation of the TyXML combinators
based on an XML data-structure.
{%
Other implementations are available, see <<a_manual chapter="intro"|the manual>> for details. %}
*)
(** Typesafe constructors and printers for HTML documents.
... | null | https://raw.githubusercontent.com/ocsigen/tyxml/8551b673857fdc1defebe7c502ffcb920f04009e/implem/tyxml.ml | ocaml | * Typed implementation for HTML, SVG and XML
This is the natural implementation of the TyXML combinators
based on an XML data-structure.
{%
Other implementations are available, see <<a_manual chapter="intro"|the manual>> for details. %}
* Typesafe constructors and printers for HTML documents.
@se... |
module Html = Tyxml_html
* Typesafe constructors and printers for Svg documents .
@see < > W3C Recommendation
@see <> W3C Recommendation *)
module Svg = Tyxml_svg
module Xml = Tyxml_xml
module Html5 = Tyxml_html
[@@ocaml.deprecated "Use Tyxml.Html"]
|
a7cf932060a6a38425ce278a6f00db22f4ae674ceb72f5e72e65bef08f395419 | quephird/dodonpascii | score.clj | (ns dodonpascii.score)
(defn get-score [score-type]
"Returns the score for a given type."
({:heli 100
:blue-plane 100
:large-plane 1000
:biplane 150
:tank 100
:boss-hit 100
:bullet-graze 10
:bonus-star 250} score-type))
| null | https://raw.githubusercontent.com/quephird/dodonpascii/5a04c41d0f4a5b78118572a1a64e4e8a4be98bb3/src/dodonpascii/score.clj | clojure | (ns dodonpascii.score)
(defn get-score [score-type]
"Returns the score for a given type."
({:heli 100
:blue-plane 100
:large-plane 1000
:biplane 150
:tank 100
:boss-hit 100
:bullet-graze 10
:bonus-star 250} score-type))
| |
5ed9d42b4c0ba4d54a0cb203866acb31f94a59b778195ce228aac63053a893e9 | MLstate/opalang | pass_ExplicitInstantiation.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/qmlpasses/pass_ExplicitInstantiation.ml | ocaml | refactoring in progress
depends
alias
shorthands
--
Here a reference to published map
Same hack as above, but for ei to update the link between current identifiers and the one before slicing
----------------------------------------
------ a few memoization utils ---------
---------------------------------... |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
7d3f9e7640e2666119dc39b9f5484477f9e25b3f642d4ed4ce36ed073acaeb96 | mpdairy/posh | util.cljc | (ns posh.lib.util)
(defn exception [^String msg]
#?(:clj
(throw (Exception. msg))
:cljs
(throw (js/Error. msg))))
;;;; db stuff
(defn t-for-datoms [q-fn db datoms]
(q-fn '[:find ?e ?a ?v ?t
:in $ [[?e ?a ?v] ...]
:where
[?e ?a _ ?t]]
db
datoms))
| null | https://raw.githubusercontent.com/mpdairy/posh/2347c8505f795ab252dbab2fcdf27eca65a75b58/src/posh/lib/util.cljc | clojure | db stuff | (ns posh.lib.util)
(defn exception [^String msg]
#?(:clj
(throw (Exception. msg))
:cljs
(throw (js/Error. msg))))
(defn t-for-datoms [q-fn db datoms]
(q-fn '[:find ?e ?a ?v ?t
:in $ [[?e ?a ?v] ...]
:where
[?e ?a _ ?t]]
db
datoms))
|
d1328768e54e779aed1ce3bbd5196b31a9eb102b662bbeccff8fcb08ce12089f | Sheinxy/Advent2022 | day_21.hs | module Main where
import Data.Map (Map, (!), insert, empty, fromList, adjust)
data Monkey = Number Int
| Operation { left :: String, op :: (Int -> Int -> Int), inv :: (Int -> Int -> Int), right :: String, commutative :: Bool}
| Unsure
parseMonkey :: String -> (String, Monkey)
parseMonkey = ... | null | https://raw.githubusercontent.com/Sheinxy/Advent2022/4f05c190c7bde8afed08ad37b613968d8b7c8ab4/Day_21/day_21.hs | haskell | module Main where
import Data.Map (Map, (!), insert, empty, fromList, adjust)
data Monkey = Number Int
| Operation { left :: String, op :: (Int -> Int -> Int), inv :: (Int -> Int -> Int), right :: String, commutative :: Bool}
| Unsure
parseMonkey :: String -> (String, Monkey)
parseMonkey = ... | |
e2b7d4833d16d291289eff99eacaedca947d295b41d419c01345ce7e1c994560 | wdebeaum/step | variety.lisp | ;;;;
;;;; W::VARIETY
;;;;
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::VARIETY
(SENSES
((meta-data :origin calo :entry-date 20031229 :change-date nil :comments html-purchasing-corpus)
(LF-PARENT ONT::grouping)
(TEMPL OTHER-RELN-TEMPL)
)
)
)
))
| null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/variety.lisp | lisp |
W::VARIETY
|
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::VARIETY
(SENSES
((meta-data :origin calo :entry-date 20031229 :change-date nil :comments html-purchasing-corpus)
(LF-PARENT ONT::grouping)
(TEMPL OTHER-RELN-TEMPL)
)
)
)
))
|
451640420be2ed82bb8c2967d8f854c48e874b2adcd6e911a767cd2092f95167 | ekmett/speculation | Traversable.hs | # LANGUAGE MagicHash , , UnboxedTuples , BangPatterns #
# LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 702
# LANGUAGE Trustworthy #
#endif
-----------------------------------------------------------------------------
-- |
Module : Control . Concurrent . Speculation .
Copyright : ( C ) 2010 - 2015 ,
--... | null | https://raw.githubusercontent.com/ekmett/speculation/354a3accdb1eebc3a8c99e1c5e3f58ebad8104a2/src/Control/Concurrent/Speculation/Traversable.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : provisional
--------------------------------------------------------------------------
** STM-based traversals with transactional rollback
* Accumulating parameters
# INLIN... | # LANGUAGE MagicHash , , UnboxedTuples , BangPatterns #
# LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 702
# LANGUAGE Trustworthy #
#endif
Module : Control . Concurrent . Speculation .
Copyright : ( C ) 2010 - 2015 ,
Maintainer : < >
Portability : non - portable ( UnboxedTuples , Rank2Typ... |
a31addf93ede532addb42fb56bc298036f42e967a49032fcbbef072bb8face08 | ryzhyk/cocoon | Validate.hs |
Copyrights ( c ) 2016 . Samsung Electronics Ltd. All right 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 applicable law or agreed to in ... | null | https://raw.githubusercontent.com/ryzhyk/cocoon/409d10b848a4512e7cf653d5b6cf6ecf247eb794/cocoon/Validate.hs | haskell | # LANGUAGE RecordWildCards, FlexibleContexts #
refinements from the spec, and validates each context separately.
All functions are defined
case grCycle (funcGraph r) of
Nothing -> return ()
$ statFuncsRec r $ roleBody rl)
$ refineNodes r
Apply definitions in new on top of prev.
chec... |
Copyrights ( c ) 2016 . Samsung Electronics Ltd. All right 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 applicable law or agreed to in ... |
6454fa60309b1b2b9928c6dc23a857dec1e85a5e83733aa4b0ff236169a0e9f4 | boomerang-lang/boomerang | int.mli | (***************************************************)
The Harmony Project
(* *)
(* int.mli - interface for ints *)
(***************************************************)
$ Id$
(** Structures of Integers *)
module typ... | null | https://raw.githubusercontent.com/boomerang-lang/boomerang/b42c2bfc72030bbe5c32752c236c0aad3b17d149/hbase/int.mli | ocaml | *************************************************
int.mli - interface for ints
*************************************************
* Structures of Integers
* Sets of ints
* Finite maps with ints as keys
* Sets of sets of int | The Harmony Project
$ Id$
module type SET = sig include Set.S end
module Set : Set.S with type elt = int
module Map : Mapplus.SMap with type key_t = int
and type key_set = Set.t
module Hash : Hashtbl.S with type key = int
module SetSet : SET with ... |
f5b873fecb22c2ea59d9aa774000169b3135e79cc72af9755361cffa14b94b8f | fulcro-legacy/fulcro-todomvc | CI_runner.cljs | (ns fulcro-todomvc.CI-runner
(:require
fulcro-todomvc.tests-to-run
[doo.runner :refer-macros [doo-all-tests]]))
This file is for running JS tests via karma / node for CI server
(doo-all-tests #".*-spec")
| null | https://raw.githubusercontent.com/fulcro-legacy/fulcro-todomvc/928ec1f5bf790e83093bfb595667d895f319068e/src/test/fulcro_todomvc/CI_runner.cljs | clojure | (ns fulcro-todomvc.CI-runner
(:require
fulcro-todomvc.tests-to-run
[doo.runner :refer-macros [doo-all-tests]]))
This file is for running JS tests via karma / node for CI server
(doo-all-tests #".*-spec")
| |
d5f1c9fe0ef97006380398b6d86d1fb5164c9d734d81c93e1f2179a3e20c9c8b | MyDataFlow/ttalk-server | protobuffs_file.erl | @author < >
( C ) 2011 ,
%%% @doc
%%%
%%% @end
Created : 25 Sep 2011 by < >
-module(protobuffs_file).
-export([open/2,path_open/3,close/1,format/3,request/1,compile_forms/2,write_file/2]).
open(File, Options) ->
file:open(File,Options).
path_open(Path, File, Modes) ->
file:path_open(Path, Fil... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/deps/protobuffs/src/protobuffs_file.erl | erlang | @doc
@end | @author < >
( C ) 2011 ,
Created : 25 Sep 2011 by < >
-module(protobuffs_file).
-export([open/2,path_open/3,close/1,format/3,request/1,compile_forms/2,write_file/2]).
open(File, Options) ->
file:open(File,Options).
path_open(Path, File, Modes) ->
file:path_open(Path, File, Modes).
close(File... |
bd824507ac7c875a47a6b1ad3f7dd7633310fdd64c223e9bd3e30c5cf7b70fb1 | talex5/cuekeeper | ck_model.ml | Copyright ( C ) 2015 , the README file for details .
* See the README file for details. *)
open Lwt.Infix
open Ck_sigs
open Ck_utils
module Make(Clock : Ck_clock.S)
(Git : Git_storage_s.S)
(G : GUI_DATA)
(RPC : RPC) = struct
module R = Ck_rev.Make(Git)
module Node = R.Nod... | null | https://raw.githubusercontent.com/talex5/cuekeeper/ef8c97637627cf90902a0be50c8d39eadacc88b3/lib/ck_model.ml | ocaml | int is the sort order
Items come before groups for non-indented lists
ID is unique in tree
ID is unique within parent
Label is unique within parent
Add [/group*/child] to [top]
* If any group (with the same key) already exists, add to that instead.
* Since groups are only used as templates if the g... | Copyright ( C ) 2015 , the README file for details .
* See the README file for details. *)
open Lwt.Infix
open Ck_sigs
open Ck_utils
module Make(Clock : Ck_clock.S)
(Git : Git_storage_s.S)
(G : GUI_DATA)
(RPC : RPC) = struct
module R = Ck_rev.Make(Git)
module Node = R.Nod... |
402e649c0580c2baadf0d290616be099485689ccc2bdbe6c34d1fd593dcd5d5c | fukamachi/rove | assertion.lisp | (in-package #:cl-user)
(defpackage #:rove/core/assertion
(:use #:cl
#:rove/core/stats
#:rove/core/result)
(:shadow #:continue)
(:import-from #:dissect
#:stack)
(:export #:*debug-on-error*
#:ok
#:ng
#:assert-ok
#:assert-ng
#:s... | null | https://raw.githubusercontent.com/fukamachi/rove/f98ed2531836e2933bcf3792abedb4b9edc90eb1/core/assertion.lisp | lisp | (in-package #:cl-user)
(defpackage #:rove/core/assertion
(:use #:cl
#:rove/core/stats
#:rove/core/result)
(:shadow #:continue)
(:import-from #:dissect
#:stack)
(:export #:*debug-on-error*
#:ok
#:ng
#:assert-ok
#:assert-ng
#:s... | |
5cdc43dccb79025a21d01ad07cfb800affd5924db30f94a82adff7471cbb7b3b | phadej/language-pts | Sigma.hs | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
#ifdef LANGUAGE_PTS_HAS_SIGMA
#ifdef LANGUAGE_PTS_HAS_BOOL
#ifdef LANGUAGE_PTS_HAS_NAT
#define SIGMA_EXAMPLES
#endif
#endif
#endif
module Language.PTS.Examples.Sigma (
#ifdef SIGMA_EXAMPLES
eitherScript,
pairScript,
#endif
) where
#ifdef SIGMA_EXAMPLES
i... | null | https://raw.githubusercontent.com/phadej/language-pts/761e5b92b14506b75164bd3162487df2d7fbfa93/src/Language/PTS/Examples/Sigma.hs | haskell | |
If we have Booleans and dependent pair , we can make Either
--
1 . Boolean prelude
---------------------
--
= λ r b t f → 𝔹-elim (λ _ → r) t f b
--
-- We a need variant in higher universe too
= λ r b t f → 𝔹-elim (λ _ → r) t f b
--
2 . Type
----------
--
λ» :define Eithe... | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
#ifdef LANGUAGE_PTS_HAS_SIGMA
#ifdef LANGUAGE_PTS_HAS_BOOL
#ifdef LANGUAGE_PTS_HAS_NAT
#define SIGMA_EXAMPLES
#endif
#endif
#endif
module Language.PTS.Examples.Sigma (
#ifdef SIGMA_EXAMPLES
eitherScript,
pairScript,
#endif
) where
#ifdef SIGMA_EXAMPLES
i... |
868e13fc244511dcad78b53190cee91a35525b00b6f78cc0d9764c31e0266506 | bravit/hid-examples | temp-kinds.hs | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
data TempUnits = F | C
newtype Temp (u :: TempUnits) = Temp Double
deriving (Num, Fractional)
paperBurning :: Temp F
paperBurnin... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch11/temperature/temp-kinds.hs | haskell | nonsense :: Temp Bool
nonsense = Temp 0
TYPE ERROR: Couldn't match type ‘C’ with ‘F’
err = paperBurning - absoluteZero | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
data TempUnits = F | C
newtype Temp (u :: TempUnits) = Temp Double
deriving (Num, Fractional)
paperBurning :: Temp F
paperBurnin... |
37a2d3eb7220dfde2ecc1265437c25ca1784e07f5675d8105df7bf1691824a8b | soegaard/metapict | save-svg.rkt | #lang racket
(require "def.rkt" pict racket/draw)
(provide save-pict-as-svg)
;; (define (use-a4-paper)
;; (define setup (new ps-setup%))
;; (current-ps-setup setup)
( send setup set - paper - name " A4 210 x 297 mm " )
;; ; introduce margins such that the result is centered
( def α 0.9 )
( send setu... | null | https://raw.githubusercontent.com/soegaard/metapict/47ae265f73cbb92ff3e7bdd61e49f4af17597fdf/metapict/save-svg.rkt | racket | (define (use-a4-paper)
(define setup (new ps-setup%))
(current-ps-setup setup)
; introduce margins such that the result is centered
(send setup set-scaling α α))
(send (current-ps-setup) set-file filename)
(send (current-ps-setup) set-translation 0 0)
(define dc (new pdf-dc% [interactive #f] [parent #f]... | #lang racket
(require "def.rkt" pict racket/draw)
(provide save-pict-as-svg)
( send setup set - paper - name " A4 210 x 297 mm " )
( def α 0.9 )
( send setup set - margin ( / ( * ( - 1 α ) a4 - width ) 2 ) ( / ( * ( - 1 α ) a4 - height ) 2 ) )
( send setup set - editor - margin 0 0 )
(define (new-svg... |
dc7bdc9b41cd79955d76071b7dc877ddce7351f1bb81b5594751a31be71c09d6 | Autodesk-AutoCAD/AutoLispExt | formatedBasefile1.lsp | (defun c:formatTest (/ a b)
(setq a 3)
(setq b "test")
(princ a)
(princ b)
)
| null | https://raw.githubusercontent.com/Autodesk-AutoCAD/AutoLispExt/13574b27b76fe521a3e5c7914f16c9a1d9978eac/extension/src/test/Baseline/formatedBasefile1.lsp | lisp | (defun c:formatTest (/ a b)
(setq a 3)
(setq b "test")
(princ a)
(princ b)
)
| |
ec62846fcde3bd5c137449b3924a5a40bc6788954b7557bca9bdd86c41aed65f | cram-code/cram_core | misc-utils.lisp | ;;;
Copyright ( c ) 2009 , < > ,
< >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyri... | null | https://raw.githubusercontent.com/cram-code/cram_core/984046abe2ec9e25b63e52007ed3b857c3d9a13c/cram_test_utilities/src/misc-utils.lisp | lisp |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redi... | Copyright ( c ) 2009 , < > ,
< >
* Neither the name of Willow Garage , Inc. nor the names of its
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT... |
0432d7fbd234ff890210a097f8197aec881f3c9573c03793a8e49c1581728e37 | fukamachi/sxql-abstract | sxql-abstract.lisp | (in-package #:cl-user)
(defpackage #:sxql-abstract
(:nicknames #:sxqla)
(:use #:cl)
(:import-from #:sxql-abstract/type
#:normalize-serial-type)
(:import-from #:sxql-abstract/config
#:*database-type*
#:with-database-type)
(:import-from #:sxql-abstract/util
... | null | https://raw.githubusercontent.com/fukamachi/sxql-abstract/5c658406552110f4b2b0197adb1e0fc89aa6300b/src/sxql-abstract.lisp | lisp | FIXME: it'll raise an error if the index name is too long | (in-package #:cl-user)
(defpackage #:sxql-abstract
(:nicknames #:sxqla)
(:use #:cl)
(:import-from #:sxql-abstract/type
#:normalize-serial-type)
(:import-from #:sxql-abstract/config
#:*database-type*
#:with-database-type)
(:import-from #:sxql-abstract/util
... |
28ca0ba9f72adc2caab9869f654152b1170089b59423fc3043d7971da065045f | mauricioszabo/repl-tooling | orchard-cmds.clj | (defn info [ns-name var-name params]
(clojure.core/let [s (orchard.info/info (symbol ns-name) (symbol var-name) (eval params))]
(clojure.core/tagged-literal
'repl-tooling/interactive
{:html '(cond
(:ns ?state)
[:div.rows
[:div.title (cond->> (str (:name ?sta... | null | https://raw.githubusercontent.com/mauricioszabo/repl-tooling/a340895ebaf79791decb8354903958fd186b586c/resources/orchard-cmds.clj | clojure | (defn info [ns-name var-name params]
(clojure.core/let [s (orchard.info/info (symbol ns-name) (symbol var-name) (eval params))]
(clojure.core/tagged-literal
'repl-tooling/interactive
{:html '(cond
(:ns ?state)
[:div.rows
[:div.title (cond->> (str (:name ?sta... | |
13c42b73b6127449bc6e9ccdbf0ca35a6bc220aceeae3ac4a71447b84e6d7a1b | amnh/poy5 | timer.ml | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
(* *)
(* This program is free softwa... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/timer.ml | ocaml |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This progra... | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... |
18aa9781bd605761cc5ddae1262fb24a095f96cbbceb9a43695579be47d85c97 | lisp-mirror/clpm | requirement.lisp | ;;;; Requirement resolution
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/resolve/requirement
(:use #:cl
#:alexandria
#:clpm/log
#:clpm/resolve/defs
#:clpm/resolve/node
... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/174b7db5e548518aff668cdd1f4d1a7b863becfb/clpm/resolve/requirement.lisp | lisp | Requirement resolution
LICENSE for license information.
* Find Requirement Source
* Requirement States
* Resolve Requirement
Make a release from the file system.
Make a release from the file system.
If the systems are defined, we only need to grovel the files in which
those systems are defined. Otherwise we n... | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/resolve/requirement
(:use #:cl
#:alexandria
#:clpm/log
#:clpm/resolve/defs
#:clpm/resolve/node
#:clpm/requirement
#:clpm/source)
(:export #:*releases... |
75defae526cdd7018c91fe3e8ff30516b7b45300a3cf265b96921876d7d1d371 | melange-re/melange-compiler-libs | typedtree.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/melange-re/melange-compiler-libs/2fac95b0ea97fb676240662aeeec8c6f6495dd9c/typing/typedtree.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Asttypes
open Types
type partial = Partial | Total
type attribute = Parsetree.attribute
type att... |
634cbf3df07ea7fed06c28b684d3538ca607fdadcbb79b7bb5a8bb74e2a2aa49 | spawnfest/eep49ers | wxStaticLine.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . 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/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxStaticLine.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 2008 - 2020 . 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(wxStaticLine).
-include("wxe.hrl").
-export([create/2,create/3,destroy/1,getDefaultSize/0,isVertical/1,new/0... |
4ca776e42d523ad3737e309476a5f58fe245294e37096df73c12140588e079b8 | nilern/monnit | option.cljc | (ns monnit.option
"A computation that can fail to produce a meaningful result; a more robust
alternative to returning a value that may be `nil`. Implements [[monnit.core/Functor]],
[[monnit.core/Monad]] and [[monnit.core/Alternative]]."
(:refer-clojure :exclude [some some?])
(:require [monnit.core :as m]
... | null | https://raw.githubusercontent.com/nilern/monnit/cc5fe2a031ef8540c4f77bb620d05a0f0564292b/src/monnit/option.cljc | clojure | a more robust
a more robust
call [[run]] | (ns monnit.option
alternative to returning a value that may be `nil`. Implements [[monnit.core/Functor]],
[[monnit.core/Monad]] and [[monnit.core/Alternative]]."
(:refer-clojure :exclude [some some?])
(:require [monnit.core :as m]
[monnit.impl.util :refer [typecase]]))
(defprotocol Option
alterna... |
e2948c4d8a054b0ea9fa2e1776e65b179d52c50211ef7a1fdd82362de633353b | skinkade/uniformity | util.cljs | (ns uniformity.internals.js.util
(:require [goog.crypt :refer [byteArrayToHex hexToByteArray]]
[goog.crypt.base64 :as base64]
[clojure.string :as string]
["msgpack5" :as msgpack5]
[uniformity.internals.validation :refer [compat-count]]))
(defonce msgpack (msgpack5))
... | null | https://raw.githubusercontent.com/skinkade/uniformity/e9d007a7be833e70b4358c02700fd81866de775a/src/uniformity/internals/js/util.cljs | clojure | super hacky! | (ns uniformity.internals.js.util
(:require [goog.crypt :refer [byteArrayToHex hexToByteArray]]
[goog.crypt.base64 :as base64]
[clojure.string :as string]
["msgpack5" :as msgpack5]
[uniformity.internals.validation :refer [compat-count]]))
(defonce msgpack (msgpack5))
... |
6a445a971a5b52b3f6819f3d3943003ff4ac75ddfddf57289a010b4d39a45cf5 | LexiFi/menhir | IncrementalEngine.ml | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/lib/IncrementalEngine.ml | ocaml | ****************************************************************************
special ex... |
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU Library General Public License versio... |
4d3cce1036e3899ba4174f8723fdfc154f90b19324e9577a9d7ad6b46127c641 | khotyn/4clojure-answer | 119-win-at-tic-tac-toe.clj | (fn [piece board]
(letfn [(step [board]
(filter (complement nil?) (map
(fn [index]
(let [line (board index)]
(if (and
(= 2 (count ... | null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/119-win-at-tic-tac-toe.clj | clojure | (fn [piece board]
(letfn [(step [board]
(filter (complement nil?) (map
(fn [index]
(let [line (board index)]
(if (and
(= 2 (count ... | |
2ccb7d6c951093231f57cba140ef9cd58760d7f7b670fcae927614d88af008ef | haskell/text | Pure.hs | -- | Benchmarks various pure functions from the Text library
--
-- Tested in this benchmark:
--
-- * Most pure functions defined the string types
--
# LANGUAGE BangPatterns , CPP , GADTs , MagicHash #
# LANGUAGE DeriveGeneric , RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
module Benchmarks.Pure
( initEnv... | null | https://raw.githubusercontent.com/haskell/text/7b13f15ded23953d5b52b9e74bfe7e2cbc8bb692/benchmarks/haskell/Benchmarks/Pure.hs | haskell | | Benchmarks various pure functions from the Text library
Tested in this benchmark:
* Most pure functions defined the string types
Evaluate stuff before actually running the benchmark, we don't want to
count it here.
ByteString A
Lengths
Lines
, bgroup "concatMap"
]
'Data.Text.Internal.safe' does not ... | # LANGUAGE BangPatterns , CPP , GADTs , MagicHash #
# LANGUAGE DeriveGeneric , RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
module Benchmarks.Pure
( initEnv
, benchmark
) where
import Control.DeepSeq (NFData (..))
import Control.Exception (evaluate)
import Data.Char (chr, ord)
import Test.Tasty.... |
dca813f88cd3a62706fba21f86bd572ac467b2d8b5f442c93a7ad6ec6ac66b55 | igorhvr/bedlam | match-simple.scm |
(define-syntax match
(syntax-rules ()
((match expr (pat . body) ...)
(match-gen-labels expr start () (pat . body) ...))))
(define-syntax match-gen-labels
(syntax-rules (=>)
((_ expr label ((k1 fk1 pat1 . body1) (k fk pat . body) ...))
(let ((tmp expr))
(letrec ((k (lambda () (match-one tm... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/match/other/matchable/chicken/match-simple.scm | scheme |
gimme some sugar baby |
(define-syntax match
(syntax-rules ()
((match expr (pat . body) ...)
(match-gen-labels expr start () (pat . body) ...))))
(define-syntax match-gen-labels
(syntax-rules (=>)
((_ expr label ((k1 fk1 pat1 . body1) (k fk pat . body) ...))
(let ((tmp expr))
(letrec ((k (lambda () (match-one tm... |
5cbc3b6c579e72d1bebf12a357bc708dd9dd4bc272c8f8d8e01a954e8cd3bacd | Clozure/ccl-tests | phase.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Sep 6 21:15:54 2003
;;;; Contains: Tests of PHASE
(in-package :cl-test)
(deftest phase.error.1
(signals-error (phase) program-error)
t)
(deftest phase.error.2
(signals-error (phase 0 0) program-error)
t)
(deftest phase.error.3
(check-type-error #... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/phase.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of PHASE
Negative zeros | Author :
Created : Sat Sep 6 21:15:54 2003
(in-package :cl-test)
(deftest phase.error.1
(signals-error (phase) program-error)
t)
(deftest phase.error.2
(signals-error (phase 0 0) program-error)
t)
(deftest phase.error.3
(check-type-error #'phase #'numberp)
nil)
(deftest phase.1
(eqlt (ph... |
0c7a1cc280a3cdde679a8d82b998cc267f8b5c28d5e537668dae812d3e2ff5b0 | fulcrologic/fulcro-rad-kvstore | config.clj | (ns com.example.components.config
(:require
[com.fulcrologic.fulcro.server.config :as fserver]
[com.example.lib.logging :as logging]
[mount.core :refer [defstate args]]
[taoensso.timbre :as log]))
(defstate config
"The overrides option in args is for overriding
configuration in tests."
:start ... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-kvstore/f0046c21e386214b42d4621b33dcb3aa1058ad52/src/demo-project/com/example/components/config.clj | clojure | (ns com.example.components.config
(:require
[com.fulcrologic.fulcro.server.config :as fserver]
[com.example.lib.logging :as logging]
[mount.core :refer [defstate args]]
[taoensso.timbre :as log]))
(defstate config
"The overrides option in args is for overriding
configuration in tests."
:start ... | |
dd1437a86fa40bb5de4d66b4c464507395343be35978277210ff86fbf57d04a1 | fyquah/hardcaml_zprize | model.ml | Build a model of the pipeline and required controller so we can experiment with
different schemes .
Our core problem is that we must compute [ a = a + b ] , so we can not start a new
calculation for [ a ] if a current computation is currently in the adder pipeline .
The pipeline is some 150 cycle... | null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/553b1be10ae9b977decbca850df6ee2d0595e7ff/libs/pippenger/test/model.ml | ocaml | Is the value at the head of the queue in the processing pipelined for the given window.
Used for both scalar and stalled values.
Put the given value into the pipeline
Put a 'bubble' into the pipeline
Add the head of the given queue to the pipeline
Add the next scalar value for the given window to the stalle... | Build a model of the pipeline and required controller so we can experiment with
different schemes .
Our core problem is that we must compute [ a = a + b ] , so we can not start a new
calculation for [ a ] if a current computation is currently in the adder pipeline .
The pipeline is some 150 cycle... |
8c7de69a3e84b033e9ad19f1567416acebb70cef5e6210be10982d369f415d35 | gebi/jungerl | mapform0.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright ( C ) 2003 < > .
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
1 . Redistributions of source co... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/smart_exceptions/src/mapform0.erl | erlang |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following
disclaimer in... | Copyright ( C ) 2003 < > .
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTI... |
162af65a8bcc62f02fb5437aeff6059bc8286decc7a79f5dae5c97d5d04917e4 | helium/erlang-lorawan | lora_plan.erl | -module(lora_plan).
-export([
datarate_to_index/2,
datarate_to_binary/2,
datarate_to_atom/2,
datarate_to_string/2,
up_to_down_datarate/3,
max_uplink_payload_size/2,
max_downlink_payload_size/2,
dwelltime_payload_size/2,
max_downlink_snr/3,
max_uplink_snr/1,
max_uplink_snr/2,... | null | https://raw.githubusercontent.com/helium/erlang-lorawan/196df145061fea25c370fc62a91e4c140df7ed9b/src/lora_plan.erl | erlang | ------------------------------------------------------------------
DataRate Functions
------------------------------------------------------------------
Note - APIs are constructed so that in general datarate index, atom and binary
can all be considered synonmyous. For this reason symbol names are often simplifie... | -module(lora_plan).
-export([
datarate_to_index/2,
datarate_to_binary/2,
datarate_to_atom/2,
datarate_to_string/2,
up_to_down_datarate/3,
max_uplink_payload_size/2,
max_downlink_payload_size/2,
dwelltime_payload_size/2,
max_downlink_snr/3,
max_uplink_snr/1,
max_uplink_snr/2,... |
a469321a9507d2157a327cb1ad00dcfffe89a95fbb0f952fdb811fc14b74b98e | ghcjs/jsaddle-dom | NodeIterator.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.NodeIterator
(nextNode, nextNode_, nextNodeUnsafe, nextNodeUnchecked,
previousNode, previousNode_, previous... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/NodeIterator.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/NodeIterator.pointerBeforeReferenceNode Mozilla NodeIterator.pointerBeforeReferenceNode documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.NodeIterator
(nextNode, nextNode_, nextNodeUnsafe, nextNodeUnchecked,
previousNode, previousNode_, previousNodeUnsafe,
previousNodeUnchecked, detach, getRoot, getReferenceNode,
getPointerBef... |
554fba7c3be677b7974159000bd4f9925268572eb0b29220ff5e51219e8da468 | nuvla/api-server | session_template_password.cljc | (ns sixsq.nuvla.server.resources.spec.session-template-password
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[sixsq.nuvla.server.resources.spec.session-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::username
... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/spec/session_template_password.cljc | clojure | all parameters must be specified in both the template and the create resource
Defines the contents of the password session-template resource itself.
Defines the contents of the password template used in a create resource. | (ns sixsq.nuvla.server.resources.spec.session-template-password
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.core :as core]
[sixsq.nuvla.server.resources.spec.session-template :as ps]
[sixsq.nuvla.server.util.spec :as su]
[spec-tools.core :as st]))
(s/def ::username
... |
e009f724853ce3ceb0d7a3a65377904eb9fd4d54ff6ba953d30bbeadbf9b71c5 | roman/servant-playground | Database.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedSt... | null | https://raw.githubusercontent.com/roman/servant-playground/37639f20c01306fb1a59050f7996f6779a627a1f/app/App/Component/Database.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE NamedFieldPuns #
module App.Component.Database where
import RIO
import RIO.Orphans ()
import qualified RIO.Text as Text
import qualified System.Etc as Etc
import Control.M... |
f32d79a3a5b47141d5f59892e234b97df7cb14a57de31e8409b7495e1a1d29ea | serefayar/ayatori | service.clj | (ns example.service
(:require [reitit.ring :as ring]
[ring.util.response :as resp]
[ring.adapter.jetty :as jetty]
[clj-http.client :as client]
[muuntaja.core :as m]
[reitit.coercion.spec]
[reitit.ring.coercion :as rrc]
[reitit.ring.mi... | null | https://raw.githubusercontent.com/serefayar/ayatori/4ae80d64439850b7e515526554d9ff29ee078fc9/examples/service3/src/example/service.clj | clojure | (prn (-> request :lra-headers)) | (ns example.service
(:require [reitit.ring :as ring]
[ring.util.response :as resp]
[ring.adapter.jetty :as jetty]
[clj-http.client :as client]
[muuntaja.core :as m]
[reitit.coercion.spec]
[reitit.ring.coercion :as rrc]
[reitit.ring.mi... |
bdce84c42b7a9177b9090a6b5010cd521086c81dda3ec9cb253720507b88a0d3 | jdan/ocaml-data-structures | red_black_tree_test.ml | open Red_black_tree;;
module Person = struct
type t = string * int
let compare (_, a) (_, b) = compare a b
let show (name, age) =
"(" ^ name ^ ", " ^ (string_of_int age) ^ ")"
end
module Int = struct
type t = int
let compare = compare
let show = string_of_int
end
module PersonRBT = RedBlackTree(Perso... | null | https://raw.githubusercontent.com/jdan/ocaml-data-structures/b27e0c4fd8997900b5852a110a971f00ce3e922c/src/red_black_tree_test.ml | ocaml | Assert that balancing works for left-heavy and right-heavy trees | open Red_black_tree;;
module Person = struct
type t = string * int
let compare (_, a) (_, b) = compare a b
let show (name, age) =
"(" ^ name ^ ", " ^ (string_of_int age) ^ ")"
end
module Int = struct
type t = int
let compare = compare
let show = string_of_int
end
module PersonRBT = RedBlackTree(Perso... |
f349fde5b33f2e047ba108494dc73e39e0a19fd675a81c08c6fbc5d855717783 | kommen/datahike-heroku | datahike_heroku.clj | (ns clj.new.datahike-heroku
(:require [clj.new.templates :refer [renderer project-data ->files]]))
(defn datahike-heroku
"FIXME: write documentation"
[name]
(let [render (renderer "datahike-heroku")
data (project-data name)]
(println "Generating fresh 'clj new' datahike-heroku project.")
(->f... | null | https://raw.githubusercontent.com/kommen/datahike-heroku/1ad6b45a6ee49a785f34ba9f12b10db3cae80399/src/clj/new/datahike_heroku.clj | clojure | (ns clj.new.datahike-heroku
(:require [clj.new.templates :refer [renderer project-data ->files]]))
(defn datahike-heroku
"FIXME: write documentation"
[name]
(let [render (renderer "datahike-heroku")
data (project-data name)]
(println "Generating fresh 'clj new' datahike-heroku project.")
(->f... | |
062d345ee834aa3e8b55c75020a038f4dd2ff853274fd70135c39fa9ff1dde50 | input-output-hk/cardano-ledger | Failure.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Test.Cardano.Ledger.Binary.Vintage.Failure (tests) where
import Cardano.Ledger.Binary hiding (Range)
import Data.List.NonEmpty (NonEmpty)
import Data.Set (Set)
import GHC.Stack (HasCallStack, withFrozenCallStack)
impo... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/b9aa1ad1728c0ceeca62657ec94d6d099896c052/libs/cardano-ledger-binary/test/Test/Cardano/Ledger/Binary/Vintage/Failure.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
--------------------------------------------------------------------
----------------------- Generators -----------------------------
NonEmpty Bool
--------------------------------------------------------------------
----------------------- Properties --... | # LANGUAGE TemplateHaskell #
module Test.Cardano.Ledger.Binary.Vintage.Failure (tests) where
import Cardano.Ledger.Binary hiding (Range)
import Data.List.NonEmpty (NonEmpty)
import Data.Set (Set)
import GHC.Stack (HasCallStack, withFrozenCallStack)
import Hedgehog
import qualified Hedgehog.Gen as Gen
import Hedgehog.... |
0bff79b6173c1e27949e52c917686c02fa83bf3eb195f00bd722b82ece2cc8e6 | haskell-game/sdl2 | Raw.hs | | Raw low - level FFI bindings to the sdl2 C library . Ease of use is not a
design factor , use " SDL " instead if you can .
module SDL.Raw (
module SDL.Raw.Audio,
module SDL.Raw.Basic,
module SDL.Raw.Enum,
module SDL.Raw.Error,
module SDL.Raw.Event,
module SDL.Raw.Filesystem,
module SDL.Raw.Haptic,
... | null | https://raw.githubusercontent.com/haskell-game/sdl2/a2646ede53d98aebf8f7c49b01f99236701b7e44/src/SDL/Raw.hs | haskell | | Raw low - level FFI bindings to the sdl2 C library . Ease of use is not a
design factor , use " SDL " instead if you can .
module SDL.Raw (
module SDL.Raw.Audio,
module SDL.Raw.Basic,
module SDL.Raw.Enum,
module SDL.Raw.Error,
module SDL.Raw.Event,
module SDL.Raw.Filesystem,
module SDL.Raw.Haptic,
... | |
75f41ca923088fdb3cd94cd865785db0a3d14f004617ac348291b26ad1a1d838 | takikawa/racket-ppa | require+provide.rkt | #lang racket/base
(require "../common/set.rkt"
"../common/list-ish.rkt"
"../syntax/syntax.rkt"
"../syntax/property.rkt"
"../common/phase.rkt"
"../common/phase+space.rkt"
"../syntax/scope.rkt"
"../syntax/binding.rkt"
"../syntax/error.rkt"
"... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/src/expander/expand/require%2Bprovide.rkt | racket | ----------------------------------------
module-path-index to recognize definitions among requires
intern table
require-phase -> list of module-path-index
mpi [interned] -> require-phase+space-shift -> sym -> list-ish of [bulk-]required
phase+space -> sym -> binding or protected
phase -> sym -> (or/c 'variable '... | #lang racket/base
(require "../common/set.rkt"
"../common/list-ish.rkt"
"../syntax/syntax.rkt"
"../syntax/property.rkt"
"../common/phase.rkt"
"../common/phase+space.rkt"
"../syntax/scope.rkt"
"../syntax/binding.rkt"
"../syntax/error.rkt"
"... |
cbc93cf224dd002ecc02191dce281f8b7406232e169f0a16daa4a1489949cba0 | Decentralized-Pictures/T4L3NT | fees_storage.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_012_Psithaca/lib_protocol/fees_storage.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
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... |
8247069bd00b15949e4bc58e5763206b6d5bbd9961703c19dad39c0fdea5f58b | bytekid/mkbtt | mKBtt.mli | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mkbtt/mKBtt.mli | ocaml | ** VALUES ************************************************************ | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... |
e550fc410708d7d2b3d06a2fde5ca88d1b5ea7bfe7c6bfb414286631c9d45626 | openvstorage/alba | generic_bench.ml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
open Lwt.Infix
let report oc name (n, d,speed, latency, min_d, max_d) =
L... | null | https://raw.githubusercontent.com/openvstorage/alba/459bd459335138d6b282d332fcff53a1b4300c29/ocaml/src/generic_bench.ml | ocaml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
open Lwt.Infix
let report oc name (n, d,speed, latency, min_d, max_d) =
L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.