_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 |
|---|---|---|---|---|---|---|---|---|
acc12aa0fd98cdc9857ba19650f2b846ca686037729c45d542ca0624e92812a1 | psg-mit/probzelus-haskell | Numeric.hs | module Util.Numeric where
import Control.Arrow (second)
import Numeric.Log
import Numeric.SpecFunctions (logGamma)
average :: Fractional a => [a] -> a
average = go 0 0 where
go n x [] = x / fromIntegral n
go n x (z : zs) = go (n + 1) (x + z) zs
shiftByMax :: (Precise d, RealFloat d, Ord d) => [(a, Log d)] -> [(a... | null | https://raw.githubusercontent.com/psg-mit/probzelus-haskell/a4b66631451b6156938a9c5420cfff2999ecbbc6/haskell/src/Util/Numeric.hs | haskell | module Util.Numeric where
import Control.Arrow (second)
import Numeric.Log
import Numeric.SpecFunctions (logGamma)
average :: Fractional a => [a] -> a
average = go 0 0 where
go n x [] = x / fromIntegral n
go n x (z : zs) = go (n + 1) (x + z) zs
shiftByMax :: (Precise d, RealFloat d, Ord d) => [(a, Log d)] -> [(a... | |
d996f9fb709287d3ad84e9ae2f0ccc2a5beb3871cce796d3c168c26380985d43 | koka-lang/koka | Var.hs | ------------------------------------------------------------------------------
Copyright 2012 - 2021 , Microsoft Research , .
--
-- This is free software; you can redistribute it and/or modify it under the
terms of the Apache License , Version 2.0 . A copy of the License can be
-- found in the LICENSE file at the... | null | https://raw.githubusercontent.com/koka-lang/koka/2909df715aebf57966fbdd4afdc7a477f55f239e/src/Platform/haddock/Platform/Var.hs | haskell | ----------------------------------------------------------------------------
This is free software; you can redistribute it and/or modify it under the
found in the LICENSE file at the root of this distribution.
---------------------------------------------------------------------------
------------------------------... | Copyright 2012 - 2021 , Microsoft Research , .
terms of the Apache License , Version 2.0 . A copy of the License can be
Module that exports non - standardized ' MVar 's .
Module that exports non-standardized 'MVar's.
-}
module Platform.Var( Var, newVar, takeVar, putVar
) where
new... |
8f037827896fb6b8ac0f4f609dff23a2fdcbfd7829054d7b724053599ffe440c | evturn/haskellbook | fix-it.hs | module Sing where
1 .
fstString :: [Char] -> [Char]
fstString x = x ++ " in the rain"
sndString :: [Char] -> [Char]
sndString x = x ++ " over the rainbow"
2 .
sing =
if (x < y)
then fstString x
else sndString y
where x = "Singin"
y = "Somewhere"
3 .
main :: IO ()
main = do
print ((+... | null | https://raw.githubusercontent.com/evturn/haskellbook/3d310d0ddd4221ffc5b9fd7ec6476b2a0731274a/05/chapter-exercises/fix-it.hs | haskell | module Sing where
1 .
fstString :: [Char] -> [Char]
fstString x = x ++ " in the rain"
sndString :: [Char] -> [Char]
sndString x = x ++ " over the rainbow"
2 .
sing =
if (x < y)
then fstString x
else sndString y
where x = "Singin"
y = "Somewhere"
3 .
main :: IO ()
main = do
print ((+... | |
de0e1b9ceb4827d7a58aaa22c2c58d774edf606be5400b5f12f3f4bb8a812e12 | felipeZ/Haskell-abinitio | BasisSet.hs |
module Science.QuantumChemistry.BasisSet where
import Science.QuantumChemistry.BasisSet.FetchBasis
import Science.QuantumChemistry.BasisSet.NormalizeBasis
import Science.QuantumChemistry.BasisSet.SerializeBasis
| null | https://raw.githubusercontent.com/felipeZ/Haskell-abinitio/c019bc37c8de78affddf97eb858c1ef18af76d83/Science/QuantumChemistry/BasisSet.hs | haskell |
module Science.QuantumChemistry.BasisSet where
import Science.QuantumChemistry.BasisSet.FetchBasis
import Science.QuantumChemistry.BasisSet.NormalizeBasis
import Science.QuantumChemistry.BasisSet.SerializeBasis
| |
15123297b7cdcbd08f1498167af0579a3a1c2069ddf45f1e76412c0eb8738000 | haskell-game/sdl2 | Lesson02.hs | {-# LANGUAGE OverloadedStrings #-}
module Lazyfoo.Lesson02 (main) where
import Control.Concurrent (threadDelay)
import Control.Monad (void)
import Foreign.C.Types
import SDL.Vect
import qualified SDL
import Paths_sdl2 (getDataFileName)
screenWidth, screenHeight :: CInt
(screenWidth, screenHeight) = (640, 480)
main ... | null | https://raw.githubusercontent.com/haskell-game/sdl2/569f4160b74ec1e17ad9f28368fbfa202840201f/examples/lazyfoo/Lesson02.hs | haskell | # LANGUAGE OverloadedStrings # | module Lazyfoo.Lesson02 (main) where
import Control.Concurrent (threadDelay)
import Control.Monad (void)
import Foreign.C.Types
import SDL.Vect
import qualified SDL
import Paths_sdl2 (getDataFileName)
screenWidth, screenHeight :: CInt
(screenWidth, screenHeight) = (640, 480)
main :: IO ()
main = do
SDL.initialize... |
a997af824d3240788679ba5302816c153bd367e4230969df2c1f1b8c60e0a45c | HaskellZhangSong/Introduction_to_Haskell_2ed_source | GADTs.hs | {-# LANGUAGE GADTs #-}
data Exp a where
ValInt :: Int -> Exp Int
ValBool :: Bool -> Exp Bool
Add :: Exp Int -> Exp Int -> Exp Int
Equa :: Exp Int -> Exp Int -> Exp Bool
eval :: Exp a -> a
eval (ValInt i) = i
eval (ValBool b) = b
eval (Add e1 e2) = eval e1 + eval e2
eval (Equa e1 e2) =... | null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C08/GADTs.hs | haskell | # LANGUAGE GADTs # |
data Exp a where
ValInt :: Int -> Exp Int
ValBool :: Bool -> Exp Bool
Add :: Exp Int -> Exp Int -> Exp Int
Equa :: Exp Int -> Exp Int -> Exp Bool
eval :: Exp a -> a
eval (ValInt i) = i
eval (ValBool b) = b
eval (Add e1 e2) = eval e1 + eval e2
eval (Equa e1 e2) = eval e1 == eval e2
da... |
e3d9546f2327d41cd26ef9126a06fefec623df6b704c24244fb194a81197ec7c | bytekid/mkbtt | termx.ml | 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/termx.ml | ocaml | ** OPENS *******************************************************************
** SUBMODULES *********************************************************
** TYPES **************************************************************
** EXCEPTIONS *********************************************************
** GLOBALS ****************... | 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 (... |
69a466e2f1161db9d29b7870aadfd1a5102be9e3f7916c8290807c20c4fddcab | thheller/shadow-grove | arborist_test.clj | (ns shadow.experiments.arborist-test
(:require
[clojure.test :as t :refer (deftest is)]
[clojure.pprint :refer (pprint)]
[clojure.string :as str]
[shadow.arborist.fragments :as frag]))
(def test-body
'[[:foo {:i/key :key :bar 1 :foo foo :x nil :bool true}]
"hello"
[:div#id
(dynamic-thi... | null | https://raw.githubusercontent.com/thheller/shadow-grove/9cfa776e737d790a6390a464cc891d7d9f1e546a/src/test/shadow/experiments/arborist_test.clj | clojure | (ns shadow.experiments.arborist-test
(:require
[clojure.test :as t :refer (deftest is)]
[clojure.pprint :refer (pprint)]
[clojure.string :as str]
[shadow.arborist.fragments :as frag]))
(def test-body
'[[:foo {:i/key :key :bar 1 :foo foo :x nil :bool true}]
"hello"
[:div#id
(dynamic-thi... | |
e77b0b6bb33cc9119480a6d3e426df1bb70e229f143db76ca1d955f8ba6dc745 | Deducteam/SizeChangeTool | positivity_checker.ml | open Kernel
open Kernel.Basic
open Kernel.Term
open Sizematrix
open Sign
let d_pos = Debug.register_flag "Positivity"
type comp_cstr = Rules.rule_name * name * (int * term) * (int * term)
type constr_graph =
{ (** An array containing every type constructor and its status*)
constructors : name array
; (** T... | null | https://raw.githubusercontent.com/Deducteam/SizeChangeTool/0a4db26ee1beed6ca7cf404ba6edd0539d540371/src/positivity_checker.ml | ocaml | * An array containing every type constructor and its status
* The main order between type constructors
* [extract_constraints_of_typ t_arg] return the list of types which occur in positive position in [t_arg] and the list of types which occur in negative position in [t_arg].
* [empty_cst_gr] construct an graph whose ... | open Kernel
open Kernel.Basic
open Kernel.Term
open Sizematrix
open Sign
let d_pos = Debug.register_flag "Positivity"
type comp_cstr = Rules.rule_name * name * (int * term) * (int * term)
type constr_graph =
constructors : name array
typ_cstr_order : Bool_matrix.t
}
let extract_constraints_of_typ : int ... |
eb5e941c540bb4aae4653606b73715de66d3783477d549be3b0cce4e331978f6 | djblue/portal | deploy.clj | (ns tasks.deploy
(:require [tasks.ci :refer [ci]]
[tasks.info :refer [options]]
[tasks.package :as pkg]
[tasks.tools :refer [*cwd* clj gradle npx]]))
(defn- deploy-vscode []
(binding [*cwd* "extension-vscode"]
(npx :vsce :publish)))
(defn- deploy-open-vsx []
(binding [*cw... | null | https://raw.githubusercontent.com/djblue/portal/509a606f057cc4abff435aa78e49b2a6877903f9/dev/tasks/deploy.clj | clojure | (ns tasks.deploy
(:require [tasks.ci :refer [ci]]
[tasks.info :refer [options]]
[tasks.package :as pkg]
[tasks.tools :refer [*cwd* clj gradle npx]]))
(defn- deploy-vscode []
(binding [*cwd* "extension-vscode"]
(npx :vsce :publish)))
(defn- deploy-open-vsx []
(binding [*cw... | |
eb07914944bd8b13207082d554ec2d5ee679c360ee975251936b059ddf764378 | antoniogarrote/clj-s4 | core.clj | (ns sampleapp.test.core
(:use [sampleapp.core] :reload)
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/antoniogarrote/clj-s4/5d41b327682a532e4ed4672a139676adbc775714/sampleapps/random-numbers/test/sampleapp/test/core.clj | clojure | FIXME: write | (ns sampleapp.test.core
(:use [sampleapp.core] :reload)
(:use [clojure.test]))
(is false "No tests have been written."))
|
7648edefb379ded033bb646be76bf4ce18a05df05e031cfe0c3435d0429ed243 | wh5a/thih | HaskellList.hs | -- Automatically generated typing assumptions for List
module HaskellList where
import Testbed
import StaticList
defnsHaskellList
= ["findIndices" :>:
Forall [Star]
([] :=>
((TGen 0 `fn` tBool) `fn` TAp tList (TGen 0) `fn` TAp tList tInt)),
"findIndex" :>:
Forall [Star]
([] ... | null | https://raw.githubusercontent.com/wh5a/thih/dc5cb16ba4e998097135beb0c7b0b416cac7bfae/src/HaskellList.hs | haskell | Automatically generated typing assumptions for List
|
module HaskellList where
import Testbed
import StaticList
defnsHaskellList
= ["findIndices" :>:
Forall [Star]
([] :=>
((TGen 0 `fn` tBool) `fn` TAp tList (TGen 0) `fn` TAp tList tInt)),
"findIndex" :>:
Forall [Star]
([] :=>
((TGen 0 `fn` tBool) `fn` TAp tList (TGen 0) `... |
d347b07e307fee4612ffc3b13a8804e2f711b836dc0090abe354b41f3431465b | wz1000/hie-lsp | Profiled.hs | {-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
-... | null | https://raw.githubusercontent.com/wz1000/hie-lsp/dbb3caa97c0acbff0e4fd86fc46eeea748f65e89/reflex-0.6.1/src/Reflex/Profiled.hs | haskell | # LANGUAGE EmptyDataDecls #
|
Module:
Description:
profiling/cost-center information.
TODO: Instead of profiling just the input or output of each one, profile all the inputs and all the outputs
Profile before rather than after; this way fanout won't count against us | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
Reflex . Profiled
This mo... |
52d8fff3730e7d0f01c1c2e43e5414dae298b5ee6c64b6c1cf03616d272207f0 | babashka/babashka | paths_test.cljc | (ns expound.paths-test
(:require [clojure.test :as ct :refer [is deftest use-fixtures]]
[clojure.test.check.generators :as gen]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[expound.paths :as paths]
[expound.test-utils :as test-utils]
[com.gfr... | null | https://raw.githubusercontent.com/babashka/babashka/665ae4dd97535bf72a5ce34a19d624e74e5c4fe8/test-resources/lib_tests/expound/paths_test.cljc | clojure | (ns expound.paths-test
(:require [clojure.test :as ct :refer [is deftest use-fixtures]]
[clojure.test.check.generators :as gen]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[expound.paths :as paths]
[expound.test-utils :as test-utils]
[com.gfr... | |
f84e4aaf7680bd5b58d6abc0bb81b604e8326ba6479d499293129c47494f664e | originrose/cortex | optimisers_test.clj | (ns cortex.optimise.optimisers-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.core.matrix.operators :refer [+ - * /]]
[clojure.test :refer :all]
[cortex.optimise.optimisers :refer :all]
[cortex.optimise.protocols :as cp]
[cortex.util :refer [approx= def-]... | null | https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/examples/optimise/test/cortex/optimise/optimisers_test.clj | clojure | Ideally, there would be a standard way to mutate the internal state of an
optimiser, so that this code didn't have to rely on optimisers being of
particular types. But since they are maps, it's easy to do the mutation
directly, using assoc.
The following was computed manually using a calculator.
The following was... | (ns cortex.optimise.optimisers-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.core.matrix.operators :refer [+ - * /]]
[clojure.test :refer :all]
[cortex.optimise.optimisers :refer :all]
[cortex.optimise.protocols :as cp]
[cortex.util :refer [approx= def-]... |
50b1c768ca5d8a6e87be00cdcb58b8120eda388bbe0963527c4ea3e3beb5b4bf | nikita-volkov/rerebase | Environment.hs | module GHC.Environment
(
module Rebase.GHC.Environment
)
where
import Rebase.GHC.Environment
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/GHC/Environment.hs | haskell | module GHC.Environment
(
module Rebase.GHC.Environment
)
where
import Rebase.GHC.Environment
| |
60e3e4107185f81273058ae857e0d690d58e4db9fe83f2c5d44b9218dfdea035 | lehins/primal | Raises.hs | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE MagicHash #
# LANGUAGE TypeFamilies #
-- |
-- Module : Primal.Monad.Raises
Copyright : ( c ) 2020 - 2022
-- License : BSD3
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable
--
module Primal.Monad.Raises
( Raises(..)
... | null | https://raw.githubusercontent.com/lehins/primal/c620bfd4f2a6475f1c12183fbe8138cf29ab1dad/primal/src/Primal/Monad/Raises.hs | haskell | |
Module : Primal.Monad.Raises
License : BSD3
Stability : experimental
Portability : non-portable
| Handle an exception of a specific type and re-raise any other exception
into the `Raises` monad class.
@since 1.0.0
| A class for monads in which exceptions may be thrown.
Instances should obey th... | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE MagicHash #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2020 - 2022
Maintainer : < >
module Primal.Monad.Raises
( Raises(..)
, raiseLeft
, handleExceptT
) where
import Control.Exception
import Control.Monad.ST
import Control.Monad.ST.Unsafe
impo... |
edccbde4b31284b835bdb125e32ad562a8445fd07608db1ed7bc929d7d8c0961 | ocaml/ocaml | mctest.ml | (* TEST
* hasunix
include unix
** bytecode
** native
*)
* Copyright ( c ) 2015 , < >
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this... | null | https://raw.githubusercontent.com/ocaml/ocaml/79c6d0565284f98683293afbce8e5e5e581ec00e/testsuite/tests/parallel/mctest.ml | ocaml | TEST
* hasunix
include unix
** bytecode
** native
TODO KC: Replace with concurrent lock free bag --
* |
* Copyright ( c ) 2015 , < >
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE ... |
33bd3f7a1cc46206f105d646d50695f12e8a9adef95d01adca83dc7e18bfa3e8 | TrustInSoft/tis-interpreter | prover.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of WP plug - in of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/wp/prover.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat a l'energie atomique et aux energies
Lesser General Public License as published by the Free Soft... |
db0895f81306fb20810c3e171fc96949a9a6555327dd1a333c0fe6968b965ee7 | ocaml-gospel/cameleer | power_2_above.ml | (*@ open Power *)
let rec power_2_above x n = if x >= n then x else power_2_above (x * 2) n
@ r = power_2_above x n
requires x > 0
requires exists k. k > = 0 & & x = 2 ^ k
diverges
ensures exists 0 & & r = 2 ^ k & & r > = n
requires x > 0
requires exists k. k >= 0 && x... | null | https://raw.githubusercontent.com/ocaml-gospel/cameleer/fcf00fe27e0a41125880043aa9aa633399fc8cc2/examples/exercises/power_2_above.ml | ocaml | @ open Power |
let rec power_2_above x n = if x >= n then x else power_2_above (x * 2) n
@ r = power_2_above x n
requires x > 0
requires exists k. k > = 0 & & x = 2 ^ k
diverges
ensures exists 0 & & r = 2 ^ k & & r > = n
requires x > 0
requires exists k. k >= 0 && x = 2 ^ k
div... |
ee7264e6aa0336280a8d216dd51a10657156761e4096c012b3dd963c95cbc8fe | christiankissig/ocaml99 | problem34.ml | # P34 ( *
#
# Euler's so-called totient function phi(m) is defined as the number of positive
# integers r (1 <= r < m) that are coprime to m.
#
# Example: m = 10: r = 1,3,7,9; thus phi(m) = 4. Note the special case: phi(1) = 1.
#
# * (totient-phi 10)
# 4
#
# Find out what the value of phi(m) is if m is a prime numb... | null | https://raw.githubusercontent.com/christiankissig/ocaml99/c25f1790f695f9dd68b23abb472dc7c860d840f8/problem34.ml | ocaml | # P34 ( *
#
# Euler's so-called totient function phi(m) is defined as the number of positive
# integers r (1 <= r < m) that are coprime to m.
#
# Example: m = 10: r = 1,3,7,9; thus phi(m) = 4. Note the special case: phi(1) = 1.
#
# * (totient-phi 10)
# 4
#
# Find out what the value of phi(m) is if m is a prime numb... | |
34c624724a47a375aa0ce1f7c8a516d99082966e23ff85808f72ee4626e05e94 | erlangonrails/devdb | riak_kv_pb_listener.erl | %% -------------------------------------------------------------------
%%
%% riak_kv_pb_listener: Listen for protocol buffer clients
%%
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak-0.11.0/apps/riak_kv/src/riak_kv_pb_listener.erl | erlang | -------------------------------------------------------------------
riak_kv_pb_listener: Listen for protocol buffer clients
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 ... | Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
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
... |
bb1508539f906806dc84f333f296981e40cb4e257f091fbdfd5aa36c7c1437b3 | ocaml-sf/learn-ocaml-corpus | assured_win_naive.ml | open Seq
(* -------------------------------------------------------------------------- *)
(* The size of a tree. *)
let rec size (t : tree) : int =
match t with
| TLeaf _ ->
1
| TNonLeaf offspring ->
1 + size_offspring offspring
and size_offspring (offspring : offspring) : int =
match offspring(... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/alpha_beta/wrong/assured_win_naive.ml | ocaml | --------------------------------------------------------------------------
The size of a tree.
--------------------------------------------------------------------------
The height of a tree.
--------------------------------------------------------------------------
Evaluating a tree, with a sense parameter:... | open Seq
let rec size (t : tree) : int =
match t with
| TLeaf _ ->
1
| TNonLeaf offspring ->
1 + size_offspring offspring
and size_offspring (offspring : offspring) : int =
match offspring() with
| Nil ->
0
| Cons ((_move, t), offspring) ->
size t + size_offspring offspring
le... |
be95450de27257c06886dbea5693b8b683e5e5cb04f0425b536d0eb62f00c033 | EFanZh/EOPL-Exercises | exercise-4.42-test.rkt | #lang racket/base
(require rackunit)
(require "../solutions/exercise-4.x-call-by-need-lang.rkt")
(check-equal? (run "let* x = 3
in x")
(num-val 3))
(check-equal? (run "let* f = proc (x)
x
in (f 4)")
(num-val 4))
(chec... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/tests/exercise-4.42-test.rkt | racket | #lang racket/base
(require rackunit)
(require "../solutions/exercise-4.x-call-by-need-lang.rkt")
(check-equal? (run "let* x = 3
in x")
(num-val 3))
(check-equal? (run "let* f = proc (x)
x
in (f 4)")
(num-val 4))
(chec... | |
b4f686c4c56d07469478517495b46f70d99198d2b9fd34ef5230ff225cda9b28 | themetaschemer/malt | test-A-equality.rkt | (module+ test
(require rackunit)
(check-true ((equal-within-tolerance?) 1.00001 1.0001))
(check-true ((equal-within-tolerance?) 1.0002 1.0001))
(check-false ((equal-within-tolerance?) 1.0003 1.0001))
(define t0
(vector (vector (vector 0.0 2.0 4.0 6.0) (vector 8.0 10.0 12.0 14.0) (vector 16.0 18.0 20.0 2... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/nested-tensors/tensors/test/test-A-equality.rkt | racket | (module+ test
(require rackunit)
(check-true ((equal-within-tolerance?) 1.00001 1.0001))
(check-true ((equal-within-tolerance?) 1.0002 1.0001))
(check-false ((equal-within-tolerance?) 1.0003 1.0001))
(define t0
(vector (vector (vector 0.0 2.0 4.0 6.0) (vector 8.0 10.0 12.0 14.0) (vector 16.0 18.0 20.0 2... | |
b95c585591ab00e5688eda7f9cb7b315097b36062b315b81f1eb8d2668a930b7 | arttuka/reagent-material-ui | noise_control_off_two_tone.cljs | (ns reagent-mui.icons.noise-control-off-two-tone
"Imports @mui/icons-material/NoiseControlOffTwoTone as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def noise-c... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/noise_control_off_two_tone.cljs | clojure | (ns reagent-mui.icons.noise-control-off-two-tone
"Imports @mui/icons-material/NoiseControlOffTwoTone as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def noise-c... | |
6a7010b4f58ff590ca43c1d4ef4308e9a40968b2958a93ac9d79019ad706ccb6 | avsm/mirage-duniverse | std.ml |
module Big_int = struct
include Big_int
let sexp_of_big_int = Sexplib_num_conv.sexp_of_big_int
let big_int_of_sexp = Sexplib_num_conv.big_int_of_sexp
end
module Nat = struct
include Nat
let sexp_of_nat = Sexplib_num_conv.sexp_of_nat
let nat_of_sexp = Sexplib_num_conv.nat_of_sexp
end
module Ratio = stru... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/sexplib/num/lib/std.ml | ocaml |
module Big_int = struct
include Big_int
let sexp_of_big_int = Sexplib_num_conv.sexp_of_big_int
let big_int_of_sexp = Sexplib_num_conv.big_int_of_sexp
end
module Nat = struct
include Nat
let sexp_of_nat = Sexplib_num_conv.sexp_of_nat
let nat_of_sexp = Sexplib_num_conv.nat_of_sexp
end
module Ratio = stru... | |
6b04094fa5021eeecad1f8498ae444a8ef99529ed18c4cc681f5221cdd8e8cc2 | diku-dk/futhark | Intragroup.hs | # LANGUAGE TypeFamilies #
-- | Extract limited nested parallelism for execution inside
-- individual kernel workgroups.
module Futhark.Pass.ExtractKernels.Intragroup (intraGroupParallelise) where
import Control.Monad.Identity
import Control.Monad.RWS
import Control.Monad.Trans.Maybe
import Data.Map.Strict qualified a... | null | https://raw.githubusercontent.com/diku-dk/futhark/1955b604fabc8b86ad6c2231696eea365745480f/src/Futhark/Pass/ExtractKernels/Intragroup.hs | haskell | | Extract limited nested parallelism for execution inside
individual kernel workgroups.
| Convert the statements inside a map nest to kernel statements,
attempting to parallelise any remaining (top-level) parallel
statements. Anything that is not a map, scan or reduction will
simply be sequentialised. This incl... | # LANGUAGE TypeFamilies #
module Futhark.Pass.ExtractKernels.Intragroup (intraGroupParallelise) where
import Control.Monad.Identity
import Control.Monad.RWS
import Control.Monad.Trans.Maybe
import Data.Map.Strict qualified as M
import Data.Set qualified as S
import Futhark.Analysis.PrimExp.Convert
import Futhark.IR.G... |
43c80629f9f7e58445e008adbc5c8d971dbf7d326d24d7fbc7cf9bffcd18e723 | gedge-platform/gedge-platform | rabbit_mgmt_cors.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
%% Useful documentation about CORS:
%% *
%% * /
... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbitmq_management/src/rabbit_mgmt_cors.erl | erlang |
Useful documentation about CORS:
*
* /
* -domain-requests-with-cors/
Send vary: origin by default if nothing else was set.
Set allow-methods from what is defined in Module:allowed_methods/2.
Set allow-headers to the same as the request (accept all headers).
If the origin header is missing or "null", we disab... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_mgmt_cors).
-export([set_headers/2]).
... |
b99b76e8b0d730104abf8d684747fce04c5cd002f740203e0168ab8f6de08318 | higherkindness/mu-haskell | Examples.hs | # language DataKinds #
# language TypeApplications #
# language TypeFamilies #
{-|
Description : Examples for gRPC clients
Look at the source code of this module.
-}
module Mu.GRpc.Client.Examples where
import Data.Conduit
import Data.Conduit.Combinators as C
import Data.Con... | null | https://raw.githubusercontent.com/higherkindness/mu-haskell/e41ba786f556cfac962e0f183b36bf9ae81d69e4/grpc/client/src/Mu/GRpc/Client/Examples.hs | haskell | |
Description : Examples for gRPC clients
Look at the source code of this module.
| # language DataKinds #
# language TypeApplications #
# language TypeFamilies #
module Mu.GRpc.Client.Examples where
import Data.Conduit
import Data.Conduit.Combinators as C
import Data.Conduit.List (consume)
import qualified Data.Text as T
import ... |
4c268c93e17865d7196fc4474136de70bc32dad610e67c424a09a40dcb76f99a | racket/racket7 | bulk-binding.rkt | #lang racket/base
(require "../compile/serialize-property.rkt"
"syntax.rkt"
"binding-table.rkt" ; defines `prop:bulk-binding`
"binding.rkt"
"../common/module-path.rkt"
(only-in "../compile/reserved-symbol.rkt" bulk-binding-registry-id)
"../namespace/provided.rkt")
... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/syntax/bulk-binding.rkt | racket | defines `prop:bulk-binding`
When a require is something like `(require racket/base)`, then
fast step, and we'd like to share the information in syntax objects
from many different modules that all import `racket/base`. A
"bulk binding" implements that fast binding and sharing.
The difficult part is restoring shari... | #lang racket/base
(require "../compile/serialize-property.rkt"
"syntax.rkt"
"binding.rkt"
"../common/module-path.rkt"
(only-in "../compile/reserved-symbol.rkt" bulk-binding-registry-id)
"../namespace/provided.rkt")
(provide provide-binding-to-require-binding
make-... |
46b0b3a1539cfb781f4f373c330fbf9b27f4b4b85ee330433638474b6a905bdc | rowangithub/DOrder | app-succ.ml | let succ (b:int) (f:int->unit) x = f (x + 1)
let rec app (b:int) (f:int->unit) x =
if Random.bool () then app (b-1) (succ (b-1) f) (x - 1) else f x
let check (x:int) (y:int) = assert (x <= y)
let main n = app n (check n) n
let _ = main 5 | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/popl13/app-succ.ml | ocaml | let succ (b:int) (f:int->unit) x = f (x + 1)
let rec app (b:int) (f:int->unit) x =
if Random.bool () then app (b-1) (succ (b-1) f) (x - 1) else f x
let check (x:int) (y:int) = assert (x <= y)
let main n = app n (check n) n
let _ = main 5 | |
2e793e75700d59062956307da2ef36ed5e63a27ce9baca4f04e4b50cc20c1bb8 | Apress/practical-webdev-haskell | Auth.hs | module Adapter.PostgreSQL.Auth where
import ClassyPrelude
import qualified Domain.Auth.Types as D
import Text.StringRandom
import Data.Has
import Data.Pool
import Database.PostgreSQL.Simple.Migration
import Database.PostgreSQL.Simple
import Data.Time
type State = Pool Connection
type PG r m = (Has State r, MonadRe... | null | https://raw.githubusercontent.com/Apress/practical-webdev-haskell/17b90c06030def254bb0497b9e357f5d3b96d0cf/11/src/Adapter/PostgreSQL/Auth.hs | haskell | issue query
interpret result | module Adapter.PostgreSQL.Auth where
import ClassyPrelude
import qualified Domain.Auth.Types as D
import Text.StringRandom
import Data.Has
import Data.Pool
import Database.PostgreSQL.Simple.Migration
import Database.PostgreSQL.Simple
import Data.Time
type State = Pool Connection
type PG r m = (Has State r, MonadRe... |
964d99234f576d9c41ce8ec85cc6f76a985bbf9eeb934215cff2762f18b90078 | zalora/aws-ec2 | Canonical.hs | module Aws.Canonical where
import Data.IORef
import Data.Time.Clock
import Aws.Core
canonicalSigData :: IO SignatureData
canonicalSigData = do
emptyRef <- newIORef []
return SignatureData { signatureTimeInfo = AbsoluteTimestamp baseTime
, signatureTime = baseTime
... | null | https://raw.githubusercontent.com/zalora/aws-ec2/60b7ad4464edf3c69da8c2f023db4ba2fa7ffc48/src/Aws/Canonical.hs | haskell | module Aws.Canonical where
import Data.IORef
import Data.Time.Clock
import Aws.Core
canonicalSigData :: IO SignatureData
canonicalSigData = do
emptyRef <- newIORef []
return SignatureData { signatureTimeInfo = AbsoluteTimestamp baseTime
, signatureTime = baseTime
... | |
9f40151393257f602554e3b8d02f982daa0e85fa9e16360d27eb3864bae91ea0 | robert-strandh/SICL | typep-compound.lisp | (cl:in-package #:sicl-type)
;;; FIXME: check shape of type-specifier for each case.
(defun typep-compound (object type-specifier)
(case (first type-specifier)
(and
(loop for type-spec in (rest type-specifier)
always (typep object type-spec)))
(or
(loop for type-spec in (rest type-specifi... | null | https://raw.githubusercontent.com/robert-strandh/SICL/5b486e59cc0836b7650a6ad8cc0c8c2ac35b40f9/Code/Types/Typep/typep-compound.lisp | lisp | FIXME: check shape of type-specifier for each case.
We found an expander. Expand TYPE-SPECIFIER and call | (cl:in-package #:sicl-type)
(defun typep-compound (object type-specifier)
(case (first type-specifier)
(and
(loop for type-spec in (rest type-specifier)
always (typep object type-spec)))
(or
(loop for type-spec in (rest type-specifier)
thereis (typep object type-spec)))
(e... |
30cfdffa2fe0a33d68f4be9a4781e705e2e9850e72bd7790bc753211799a73f7 | plumatic/grab-bag | observer.clj | (ns plumbing.observer
(:use plumbing.core)
(:require
[plumbing.error :as err]
[plumbing.logging :as log]
[plumbing.map :as map]
[plumbing.time :as time])
(:import
[java.lang.ref WeakReference]
[java.util Timer TimerTask]
[java.util.concurrent ExecutorService Executors]))
Observer Interface... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/plumbing/src/plumbing/observer.clj | clojure | Helpers for implementors
update-key! takes a key-seq and update-fn.
TODO: remove this when log is fixed. | (ns plumbing.observer
(:use plumbing.core)
(:require
[plumbing.error :as err]
[plumbing.logging :as log]
[plumbing.map :as map]
[plumbing.time :as time])
(:import
[java.lang.ref WeakReference]
[java.util Timer TimerTask]
[java.util.concurrent ExecutorService Executors]))
Observer Interface... |
b2b5ed98a804d0222a3f72fe1df7b4a9da2a88e5849d0e321d41b73ae7e2b09f | songyahui/AlgebraicEffect | parsetree.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/songyahui/AlgebraicEffect/421afc58ed355f2ce1ada7e77733d7642c328815/parsing/parsetree.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
type basic_t = BINT of int | UNIT | VARName of string | List of int list
type instant =... |
b9798c60f15e08499cdaa5efc3b2554e9f0d8c8ebfcb8bb8d576456ebf0d9413 | mstksg/advent-of-code-2019 | Day21.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
-- |
-- Module : AOC.Challenge.Day21
-- License : BSD3
--
-- Stability : experimental
-- Portability : non-portable
--
Day 21 . See " AOC.Solver " for the types used in this module !
module AOC.Challenge.Day21 (
day21a
, day21b
... | null | https://raw.githubusercontent.com/mstksg/advent-of-code-2019/df2b1c76ad26ad20306f705e923a09b14d538374/src/AOC/Challenge/Day21.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : AOC.Challenge.Day21
License : BSD3
Stability : experimental
Portability : non-portable
jump if target is stable
RTemp == True
RTemp &&= r0
RTemp &&= r1
RTemp &&= r2
then don't jump
the logic:
jump whenever it is safe to do so. but don't jump frivolou... | # LANGUAGE TypeApplications #
Day 21 . See " AOC.Solver " for the types used in this module !
module AOC.Challenge.Day21 (
day21a
, day21b
) where
import AOC.Common (_CharFinite)
import AOC.Common.Intcode (Memory, parseMem, untilHalt, stepForever, IErr, preAsci... |
5b46823bdf295e2d569d4d05cfe0f794a40740ad0b5d42971cb92ee588543bed | SimulaVR/godot-haskell | Marshalls.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Marshalls
(Godot.Core.Marshalls.base64_to_raw,
... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/Marshalls.hs | haskell | | Returns a decoded @PoolByteArray@ corresponding to the Base64-encoded string @base64_str@.
| Returns a decoded @PoolByteArray@ corresponding to the Base64-encoded string @base64_str@.
| Returns a decoded string corresponding to the Base64-encoded string @base64_str@.
| Returns a decoded string corresponding to th... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Marshalls
(Godot.Core.Marshalls.base64_to_raw,
... |
03055315ff8c0e86ba81c52a88206580b7a94b5752a31c214d954a7df951bd22 | xmppjingle/snatch | claws_dummy.erl | -module(claws_dummy).
-compile([warnings_as_errors, debug_info]).
-export([send/2, send/3]).
send(Data, JID) ->
snatch_tests ! {?MODULE, Data, JID, undefined},
ok.
send(Data, JID, ID) ->
snatch_tests ! {?MODULE, Data, JID, ID},
ok.
| null | https://raw.githubusercontent.com/xmppjingle/snatch/da32ed1f17a05685461ec092800c4cb111a05f0b/test/claws_dummy.erl | erlang | -module(claws_dummy).
-compile([warnings_as_errors, debug_info]).
-export([send/2, send/3]).
send(Data, JID) ->
snatch_tests ! {?MODULE, Data, JID, undefined},
ok.
send(Data, JID, ID) ->
snatch_tests ! {?MODULE, Data, JID, ID},
ok.
| |
663da6b4460471afab6aa60dd69d6c92bc1a51a3f4a27a6e057608e1d6afafbd | exercism/haskell | Grains.hs | module Grains (square, total) where
import Data.Maybe (fromJust)
square :: Integer -> Maybe Integer
square x
| x < 1 = Nothing
| x > 64 = Nothing
| otherwise = Just . (2^) . pred $ x
total :: Integer
total = sum . map (fromJust . square) $ [1..64]
| null | https://raw.githubusercontent.com/exercism/haskell/ae17e9fc5ca736a228db6dda5e3f3b057fa6f3d0/exercises/practice/grains/.meta/examples/success-standard/src/Grains.hs | haskell | module Grains (square, total) where
import Data.Maybe (fromJust)
square :: Integer -> Maybe Integer
square x
| x < 1 = Nothing
| x > 64 = Nothing
| otherwise = Just . (2^) . pred $ x
total :: Integer
total = sum . map (fromJust . square) $ [1..64]
| |
9158c0672b4140e306a9e849ab4fb435d4b7f80f8d07430a7301ab708dc23c7f | aprolog-lang/aprolog | util.mli | Alpha Prolog
Utilities : exceptions and debugging
exception NYI;;
exception Error of string;;
exception RuntimeError of string;;
exception Impos of string;;
type 'a equal = 'a -> 'a -> bool;;
val nyi : unit -> 'a;;
val error : string -> 'a
val runtime_error : string -> 'a
val impos : string -> 'a
val do_trace... | null | https://raw.githubusercontent.com/aprolog-lang/aprolog/410327a615919eb6827d71661e69de14279b8c50/src/util.mli | ocaml | Alpha Prolog
Utilities : exceptions and debugging
exception NYI;;
exception Error of string;;
exception RuntimeError of string;;
exception Impos of string;;
type 'a equal = 'a -> 'a -> bool;;
val nyi : unit -> 'a;;
val error : string -> 'a
val runtime_error : string -> 'a
val impos : string -> 'a
val do_trace... | |
c65b634b6c608b0cd24319b24f5a948b2df1cae5549b1b977d8e873444c8416a | ynadji/lisp | presentation.lisp | Presentation Macro Demo
;;;; What are macros?
(defmacro sum (x y)
`(+ ,x ,y))
;;;; syntax
(defun macro-01 (x)
x)
(defun macro-02 (x)
(x 20 30))
(defun macro-03 (x)
'(x 20 30))
(defun macro-04 (x)
(x '20 '30))
(defun macro-05 (x)
`(x 20 30))
(defun macro-06 (x)
`(,x 20 30))
;; how do we handled ... | null | https://raw.githubusercontent.com/ynadji/lisp/758b5aebaa01f4994407d20026e617ebef90739e/chiglug-macros/presentation.lisp | lisp | What are macros?
syntax
how do we handled lists?
differences between defun and defmacro
lisp-1 vs. lisp-2
when to use macros
necessity due to splicing in the body
(ex-while 0)
conditional evaluation, see while
compile-time compilation
save function calls (just use (inline functionname))
common pitfalls -- b... | Presentation Macro Demo
(defmacro sum (x y)
`(+ ,x ,y))
(defun macro-01 (x)
x)
(defun macro-02 (x)
(x 20 30))
(defun macro-03 (x)
'(x 20 30))
(defun macro-04 (x)
(x '20 '30))
(defun macro-05 (x)
`(x 20 30))
(defun macro-06 (x)
`(,x 20 30))
(defun macro-07 (lst)
`(,lst 4 5))
(defun **---** (... |
949bf67e0575272548e10776ee59ae1c84dcb3780f3f69a1153a58a2f8a23678 | thierry-martinez/clangml | aux_lexer.mli | type lexeme =
| EOF
| Reference of { ident : string; number : string }
val main : Lexing.lexbuf -> lexeme
| null | https://raw.githubusercontent.com/thierry-martinez/clangml/de5dffeae98a9bef9934a8d272f077b307bec73f/tools/norm_extractor/aux_lexer.mli | ocaml | type lexeme =
| EOF
| Reference of { ident : string; number : string }
val main : Lexing.lexbuf -> lexeme
| |
508a96e65c63b4cc2eeb9770fcda71a36f92c54d66cc5c3a7861bcb808354bbe | SKA-ScienceDataProcessor/RC | Scheduler.hs | -- | Schedule program for execution. At the moment it schedule for
-- exact number of threads
module DNA.Compiler.Scheduler where
import Control.Monad
import Data.Graph.Inductive.Graph
import qualified Data.IntMap as IntMap
import Data.IntMap ((!))
import DNA.AST
import DNA.Actor
import DNA.Compiler.Type... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS1/dna/DNA/Compiler/Scheduler.hs | haskell | | Schedule program for execution. At the moment it schedule for
exact number of threads
--------------------------------------------------------------
Simple scheduler
--------------------------------------------------------------
| Number of nodes in the cluster
| Simple scheduler. It assumes that all optimizat... | module DNA.Compiler.Scheduler where
import Control.Monad
import Data.Graph.Inductive.Graph
import qualified Data.IntMap as IntMap
import Data.IntMap ((!))
import DNA.AST
import DNA.Actor
import DNA.Compiler.Types
type CAD = Int
schedule :: CAD -> DataflowGraph -> Compile DataflowGraph
schedule nTotal gr... |
0b0758e20fbf3c97de2c5d01faf4c5dba7eb35e60444df526e8daa71e4fb5ada | sKabYY/palestra | p55.scm | (load "stream.scm")
(stream-for-n println
(partial-sums integers)
10)
| null | https://raw.githubusercontent.com/sKabYY/palestra/0906cc3a1fb786093a388d5ae7d59120f5aae16c/old1/sicp/3/p55.scm | scheme | (load "stream.scm")
(stream-for-n println
(partial-sums integers)
10)
| |
26f03b736d506ccd1fe5af43889246f65fc3545713142d8e4ae71d68b1cdc5c0 | BillHallahan/G2 | AddToEven.hs | module AddToEven where
import Prelude hiding (zipWith)
{-@ LIQUID "--no-termination" @-}
@ type Even = { v : Int | v mod 2 = 0 } @
{-@ f :: Even -> Even @-}
f :: Int -> Int
f x = x + g 5
@ : : Int - > Even @
fBad :: Int -> Int
fBad x = x + x
Without the below refinement type for g , this file can not be verifi... | null | https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/Liquid/AddToEven.hs | haskell | @ LIQUID "--no-termination" @
@ f :: Even -> Even @
@ zipWith :: (a -> b -> c) -> v1:List a -> {v2:List b | size v1 > 0 => size v2 > 0} -> List c @
@ die :: {v:String | false} -> a @
@ f3 :: Int -> Even @
@ g3 :: Int -> Int @
@ f4 :: {x:Int | x == 0} @
@ g4 :: Int @ | module AddToEven where
import Prelude hiding (zipWith)
@ type Even = { v : Int | v mod 2 = 0 } @
f :: Int -> Int
f x = x + g 5
@ : : Int - > Even @
fBad :: Int -> Int
fBad x = x + x
Without the below refinement type for g , this file can not be verified
: : Int - > Even @- }
: : Int - > { v : Int | v... |
6db10931defb65a0d8bfb007d1a7dc7bf2c9c315d3b8c3b7baaa22d4d582f2b9 | ogaml/ogaml | text.mli | module Fx : sig
type t
type ('a,'b) it = 'a -> 'b -> ('b -> 'b) -> 'b
type ('a,'b,'c) full_it = ('a, 'b) it * 'b * ('b -> 'c)
val forall : 'c -> ('a, 'c list, 'c list) full_it
val foreach : ('a -> 'b) -> ('a, 'b list, 'b list) full_it
val foreachi : ('a -> int -> 'b) -> ('a, 'b list * int, 'b list) fu... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/src/graphics/2d/text.mli | ocaml | TODO: Exception when the iterator doesn't return list of right size | module Fx : sig
type t
type ('a,'b) it = 'a -> 'b -> ('b -> 'b) -> 'b
type ('a,'b,'c) full_it = ('a, 'b) it * 'b * ('b -> 'c)
val forall : 'c -> ('a, 'c list, 'c list) full_it
val foreach : ('a -> 'b) -> ('a, 'b list, 'b list) full_it
val foreachi : ('a -> int -> 'b) -> ('a, 'b list * int, 'b list) fu... |
a47439e40370d7a9aae55faee334588f3025e6d4f41c7fd85d226b35eafe02fa | LuisThiamNye/chic | source.clj | (ns chic.clj.source
(:require
[clojure.java.io :as io]
[clojure.repl :as repl]
[clojure.string :as str])
(:import
(java.io Reader PushbackReader)))
(defn reader-skip-lines [^Reader rdr nlines]
(when (< 0 nlines)
(while (let [c (.read rdr)]
(not (or (== c 10)
(==... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/clj/source.clj | clojure | what is a namespace file?
- ns form
- def macros -> vars
- extend / extend-type
- comments lines and blocks
- declare
so is unreliable if the file has changed in meantime
also need to make sure :file is relative in the metadata:
(caused when defing new var from nrepl)
directory is used to store things like... | (ns chic.clj.source
(:require
[clojure.java.io :as io]
[clojure.repl :as repl]
[clojure.string :as str])
(:import
(java.io Reader PushbackReader)))
(defn reader-skip-lines [^Reader rdr nlines]
(when (< 0 nlines)
(while (let [c (.read rdr)]
(not (or (== c 10)
(==... |
dd89be86d4ae65fcfa9cd69a349e19a4f24fd15a243309db806bd248c99743ad | ocaml/opam | opamCompat.mli | (**************************************************************************)
(* *)
Copyright 2018 - 2020 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/ocaml/opam/652474c528916d6bd9543a1119e56f19e3bda010/src/core/opamCompat.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2018 - 2020 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
module String
#if OCAML_VERSION >= (4, 13, 0)
= String
#else
: sig
include module type of struct include String end
val exists: (char -> bool) -> string -> bool
en... |
4033cf6b8d7f899bc177c66db68192de4e85762d0e2d56d20c8fdbcaffe6d058 | DSTOQ/haskell-stellar-sdk | PrinterSpec.hs | module Stellar.Core.Key.PrinterSpec where
import Hedgehog
import Protolude
import Stellar.Core.Types.Key
import Stellar.Gens
run :: IO Bool
run = checkParallel $ Group "Printer Properties"
[ ("Roundtrip public key", prop_roundtrip_public_key)
, ("Roundtrip secret key", prop_roundtrip_secret_key)
]
prop_roundtr... | null | https://raw.githubusercontent.com/DSTOQ/haskell-stellar-sdk/82a76c2f951a2aaabdc38092fdc89044b278c53d/tests/test/Stellar/Core/Key/PrinterSpec.hs | haskell | module Stellar.Core.Key.PrinterSpec where
import Hedgehog
import Protolude
import Stellar.Core.Types.Key
import Stellar.Gens
run :: IO Bool
run = checkParallel $ Group "Printer Properties"
[ ("Roundtrip public key", prop_roundtrip_public_key)
, ("Roundtrip secret key", prop_roundtrip_secret_key)
]
prop_roundtr... | |
666a56e6971848b2178a68d03024a0210fa2d7d4502241820532fcb78d4cd42d | hasura/graphql-parser-hs | Internal.hs | # LANGUAGE CPP #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - redundant - constraints #
-- | Internal GraphQL AST functionality.
--
-- This module is primarily necessary due to an incorrect
@-Wredundant - constraints@ warning emitted by GHC when compiling
-- 'liftTypedHashMap'.
module Language.GraphQL.Dr... | null | https://raw.githubusercontent.com/hasura/graphql-parser-hs/17596053e7fb24e387c9fe13fa0e48c7318c7421/src/Language/GraphQL/Draft/Syntax/Internal.hs | haskell | | Internal GraphQL AST functionality.
This module is primarily necessary due to an incorrect
'liftTypedHashMap'.
-----------------------------------------------------------------------------
----------------------------------------------------------------------------- | # LANGUAGE CPP #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - redundant - constraints #
@-Wredundant - constraints@ warning emitted by GHC when compiling
module Language.GraphQL.Draft.Syntax.Internal
( liftTypedHashMap,
)
where
import Data.HashMap.Strict (HashMap)
import Data.HashMap.Strict qualifi... |
da1946aa956136914cba4652e9155c8267d7168689befff09cdeac2fe70c7189 | kronusaturn/lw2-viewer | user-context.lisp | (uiop:define-package #:lw2.user-context
(:use #:cl)
(:export #:*current-auth-token* #:*current-auth-status* #:*current-userid* #:*current-username* #:*current-user-slug* #:*current-ignore-hash*
#:logged-in-userid #:logged-in-username #:logged-in-user-slug))
(in-package #:lw2.user-context)
(defvar *current-aut... | null | https://raw.githubusercontent.com/kronusaturn/lw2-viewer/f328105e9640be1314d166203c8706f9470054fa/src/user-context.lisp | lisp | (uiop:define-package #:lw2.user-context
(:use #:cl)
(:export #:*current-auth-token* #:*current-auth-status* #:*current-userid* #:*current-username* #:*current-user-slug* #:*current-ignore-hash*
#:logged-in-userid #:logged-in-username #:logged-in-user-slug))
(in-package #:lw2.user-context)
(defvar *current-aut... | |
3f0c34f5e35b5b2ce0fc76097caab439e4009af3196eb1e1ff4fa3c1d606ce57 | kanru/cl-isolated | isolated.lisp | ;;;; Isolated --- A isolated environment for evaluating Common Lisp
;;;; expressions
Copyright ( C ) 2014 , 2020 < >
Copyright ( C ) 2012 - 2013 < >
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the... | null | https://raw.githubusercontent.com/kanru/cl-isolated/05bbc0341b53791e1cff88ad4548bb94d0667cad/isolated.lisp | lisp | Isolated --- A isolated environment for evaluating Common Lisp
expressions
This program is free software: you can redistribute it and/or modify
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warra... |
Copyright ( C ) 2014 , 2020 < >
Copyright ( C ) 2012 - 2013 < >
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
You should have received a copy of the GNU Affero General Public
(defpackage #:isolated
(:use #:cl #:is... |
28251be28d41204ae27fe7ae9e1cc9c068b24f05ed93245f543da76a96f9b109 | ekmett/category-extras | Supply.hs | --------------------------------------------------------------------
-- |
-- Module : Control.Comonad.Supply
Copyright : ( c ) 2008
( c ) Iavor , 2007
-- License : BSD3
--
Maintainer : < >
-- Stability : provisional
-- Portability: portable
--
-- The technique for generating new values is ... | null | https://raw.githubusercontent.com/ekmett/category-extras/f0f3ca38a3dfcb49d39aa2bb5b31b719f2a5b1ae/Control/Comonad/Supply.hs | haskell | ------------------------------------------------------------------
|
Module : Control.Comonad.Supply
License : BSD3
Stability : provisional
Portability: portable
The technique for generating new values is based on the paper
''On Generating Unique Names''
Integrated from value-supply-0.1
TODO: a Suppl... | Copyright : ( c ) 2008
( c ) Iavor , 2007
Maintainer : < >
by , , and .
module Control.Comonad.Supply
( module Control.Comonad
, Supply
, newSupply
, newEnumSupply
, newNumSupply
, supplyValue
, supplyLeft
, supplyRight
, modifySupply
, split
, split2
, spli... |
dd95980c4d0b0ee2302758f2caf151e1dc41364bb6a1ecda675ef1b9c3952d05 | droitfintech/fset | bench_test.clj | (ns tech.droit.fset.bench-test
(:require
[clojure.test :refer :all]
[criterium.core :refer [bench quick-bench quick-benchmark benchmark]]
[tech.droit.fset :as fset]
[clojure.set :as cset]))
(defmacro b [expr] `(first (:mean (quick-benchmark ~expr {}))))
(deftest ^:bench rename-keys-bench
(let [m (... | null | https://raw.githubusercontent.com/droitfintech/fset/2031c11dadaaf0283c699ec1d66f27c6f6c93c8d/test/tech/droit/fset/bench_test.clj | clojure | 5.3075209319225114E-6 core into set
1.1675215159560017E-6 fset (union)
1.65369902375777E-6 fset
6.315077613519734E-7 core
6.226934114810922E-7 core
7.335592370838982E-6 cset
1.132363716780562E-5 sorted difference
3.4274965213695293E-6 difference
1.8558549234948711E-6 select
7.119121416749918E-7 cset
1.495636... | (ns tech.droit.fset.bench-test
(:require
[clojure.test :refer :all]
[criterium.core :refer [bench quick-bench quick-benchmark benchmark]]
[tech.droit.fset :as fset]
[clojure.set :as cset]))
(defmacro b [expr] `(first (:mean (quick-benchmark ~expr {}))))
(deftest ^:bench rename-keys-bench
(let [m (... |
dd0940030fa8b567a59d6a0125145e0dd7c6dd84d563ee2093b864a8987537e8 | philnguyen/soft-contract | parameters.rkt | #lang racket/base
(require racket/contract)
(define x (make-parameter 42))
(define y (make-parameter "hi"))
(define z (parameterize ([x (+ (x) 1)]
[y (string-length (y))])
(+ (x) 2 (y))))
(provide
(contract-out
[x (-> exact-integer?)]
[y (-> exact-integer?)]
[z exact-inte... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/issues/parameters.rkt | racket | #lang racket/base
(require racket/contract)
(define x (make-parameter 42))
(define y (make-parameter "hi"))
(define z (parameterize ([x (+ (x) 1)]
[y (string-length (y))])
(+ (x) 2 (y))))
(provide
(contract-out
[x (-> exact-integer?)]
[y (-> exact-integer?)]
[z exact-inte... | |
d4a835999385cde2c184cde55c16ed101a5e5036d5397a7056866a763ac0beff | CloudI/CloudI | cloudi_environment.erl | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
%%%
%%%------------------------------------------------------------------------
%%% @doc
%%% ==CloudI Runtime Environment==
%%% @end
%%%
MIT License
%%%
Copyright ( c ) 2014... | null | https://raw.githubusercontent.com/CloudI/CloudI/1dea07bacc53770290cf9026989caee4b14a9551/src/lib/cloudi_core/src/cloudi_environment.erl | erlang |
------------------------------------------------------------------------
@doc
==CloudI Runtime Environment==
@end
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, ... | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
MIT License
Copyright ( c ) 2014 - 2022 < mjtruog at protonmail dot com >
to deal in the Software without restriction , including without limitation
and/or sell copies... |
97b0dcbeab7d12c3fae9cc487b1dcb5edb692e668367b24eb4c40e3a09d5d61f | erlyaws/yaws | wiki_split.erl | -module(wiki_split).
%% File : wiki_format_txt.erl
Author : ( )
: , minor modifications
%% Purpose : Wiki formatting engine
%%
%% Split the text. Looking for blocks
%% < is represented as {open,Tag,string()}
%% ...
%% >
%% < is represented as {write_append,Ta... | null | https://raw.githubusercontent.com/erlyaws/yaws/da198c828e9d95ca2137da7884cddadd73941d13/applications/wiki/src/wiki_split.erl | erlang | File : wiki_format_txt.erl
Purpose : Wiki formatting engine
Split the text. Looking for blocks
< is represented as {open,Tag,string()}
...
>
< is represented as {write_append,Tag,string()}
...
>
Everything else is represented as {txt, Tag, string()}
... | -module(wiki_split).
Author : ( )
: , minor modifications
+ deftype wikiText ( ) = { wik , [ { text , tag(),string ( ) } |
-export([str2wiki/1, wiki2str/1,
getRegion/2, putRegion/3, writeAppendRegion/3]).
str2wiki(Str) ->
Blocks = str2wiki(Str, []),
{wik, number_blocks(Blocks,... |
de11498de64566083fe2c138b722e1b80087a2cff379ffdc85ae53543a391351 | coccinelle/coccinelle | popltoctl.mli |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/popl/popltoctl.mli | ocaml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | |
af32ea1b5077730fb4eae23b82580be4667eda5bf2beeed757f368a766841fc7 | Perry961002/SICP | exe4.68.scm | ( x)的反转也是(x )
(rule (reverse (?x) (?x)))
( x .
(rule (reverse (?x . ?y) ?z)
(and (reverse ?y ?reversed-y)
(append-to-form ?reversed-y (?x) ?z))) | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap4/exercise/exe4.68.scm | scheme | ( x)的反转也是(x )
(rule (reverse (?x) (?x)))
( x .
(rule (reverse (?x . ?y) ?z)
(and (reverse ?y ?reversed-y)
(append-to-form ?reversed-y (?x) ?z))) | |
d932b018bc8ecd7fa7a0eb1e4cee68cd31611ca6c280c005c99b233874d11eab | flambard/cl-erlang-term | erlang-reference.lisp | (in-package :erlang-term)
;;;;
Erlang reference
;;;;
(defconstant +reference-ext+ 101)
(defconstant +new-reference-ext+ 114)
(defclass erlang-reference (erlang-identifier)
()
(:documentation "Erlang ref."))
;;;
;;; Methods
;;;
(defun make-reference (node id creation)
(make-instance 'erlang-reference
... | null | https://raw.githubusercontent.com/flambard/cl-erlang-term/8e4da084107c2a6a3778856fe554dc37e9bc46bb/src/erlang-reference.lisp | lisp |
Methods
Encode/Decode
Perhaps always use new reference?
REFERENCE_EXT
+-----+------+----+----------+
+-----+------+----+----------+
| 101 | Node | ID | Creation |
+-----+------+----+----------+
NEW_REFERENCE_EXT
+-----+-----+------+----------+--------+
+-----+-----+------+----------+--------+
| 114 |... | (in-package :erlang-term)
Erlang reference
(defconstant +reference-ext+ 101)
(defconstant +new-reference-ext+ 114)
(defclass erlang-reference (erlang-identifier)
()
(:documentation "Erlang ref."))
(defun make-reference (node id creation)
(make-instance 'erlang-reference
:node (make-s... |
d0974d86db20f431f98caec97cd6a388d0626e3dc6bd726e10417975e235db31 | esl/erl_fuzzy_match | fuzzy_match_SUITE.erl | %%%-------------------------------------------------------------------
Copyright ( C ) 2015 , Erlang Solutions Ltd.
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% -... | null | https://raw.githubusercontent.com/esl/erl_fuzzy_match/c2c9914ba4011ab1f59847e4b248a0a95b4c24d8/test/fuzzy_match_SUITE.erl | erlang | -------------------------------------------------------------------
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 o... | Copyright ( C ) 2015 , Erlang Solutions Ltd.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
Fuzzy Name Matching Library .
Created : 9 Feb 2015 by < erlang-solutions.com >
IMPORTANT ! This file is ... |
801a5b7b6c877f13272174026f0ecd096628ea80faaa49e4759da9d74f4c2229 | bscarlet/llvm-general | DecodeAST.hs | {-# LANGUAGE
GeneralizedNewtypeDeriving,
MultiParamTypeClasses,
UndecidableInstances
#-}
module LLVM.General.Internal.DecodeAST where
import LLVM.General.Prelude
import Control.Monad.State
import Control.Monad.AnyCont
import Foreign.Ptr
import Foreign.C
import Data.Sequence (Seq)
import qualified Data.Seque... | null | https://raw.githubusercontent.com/bscarlet/llvm-general/61fd03639063283e7dc617698265cc883baf0eec/llvm-general/src/LLVM/General/Internal/DecodeAST.hs | haskell | # LANGUAGE
GeneralizedNewtypeDeriving,
MultiParamTypeClasses,
UndecidableInstances
# | module LLVM.General.Internal.DecodeAST where
import LLVM.General.Prelude
import Control.Monad.State
import Control.Monad.AnyCont
import Foreign.Ptr
import Foreign.C
import Data.Sequence (Seq)
import qualified Data.Sequence as Seq
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Array (Array)
impor... |
ba2d97b99279bd191d1c71a9551a5b71b666f978eaff8df3a0e1c369040f5516 | nuprl/gradual-typing-performance | constants.rkt |
(module constants racket
(require racket/class
racket/draw
)
(provide ANIMATION-STEPS
ANIMATION-TIME
PRETTY-CARD-SEP-AMOUNT
white-brush
hilite-brush
black-pen
dark-gray-pen
no-pen
black-color
nice-font)
(define ANIMATION-STEPS 5)
(define ANIMATION-TIME 0.3)
... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/gofish/base/cards/constants.rkt | racket |
(module constants racket
(require racket/class
racket/draw
)
(provide ANIMATION-STEPS
ANIMATION-TIME
PRETTY-CARD-SEP-AMOUNT
white-brush
hilite-brush
black-pen
dark-gray-pen
no-pen
black-color
nice-font)
(define ANIMATION-STEPS 5)
(define ANIMATION-TIME 0.3)
... | |
a88592c96d8a062c6661513b428b6d993a77ef32b48b55d921eac3e5e29a2953 | thepower/tpnode | tx.erl | -module(tx).
-include("include/tplog.hrl").
-export([del_ext/2, get_ext/2, set_ext/3]).
-export([sign/2, verify/1, verify/2, pack/1, pack/2, unpack/1, unpack/2]).
-export([txlist_hash/1, rate/2, mergesig/2]).
-export([encode_purpose/1, decode_purpose/1, encode_kind/2, decode_kind/1]).
-export([construct_tx/1,construct... | null | https://raw.githubusercontent.com/thepower/tpnode/67ae060af2b2ef0ae1560085b7f9c5d92dd4f115/apps/tpnode/src/tx.erl | erlang | Keys1=iolist_to_binary(lists:sort(PubKeys)),
TODO: remove this temporary fix
case maps:is_key("c",Unpacked) of
false -> Decoded;
true ->
Decoded#{
call=>#{function=>Function, args=>Args}
}
end;
contract issued. Check nodes key.
tx1:pack(Any).
correcton rate
{false, #{ cost=>null } };
S=... | -module(tx).
-include("include/tplog.hrl").
-export([del_ext/2, get_ext/2, set_ext/3]).
-export([sign/2, verify/1, verify/2, pack/1, pack/2, unpack/1, unpack/2]).
-export([txlist_hash/1, rate/2, mergesig/2]).
-export([encode_purpose/1, decode_purpose/1, encode_kind/2, decode_kind/1]).
-export([construct_tx/1,construct... |
bf7baf60687dbd7f18fed7b24b1acce50bb03d210241233f1222e075fcec183b | sdiehl/elliptic-curve | BrainpoolP320R1.hs | module Data.Curve.Weierstrass.BrainpoolP320R1
( module Data.Curve.Weierstrass
, Point(..)
-- * BrainpoolP320R1 curve
, module Data.Curve.Weierstrass.BrainpoolP320R1
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Weierstrass
--------------------------------... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/src/Data/Curve/Weierstrass/BrainpoolP320R1.hs | haskell | * BrainpoolP320R1 curve
-----------------------------------------------------------------------------
Types
-----------------------------------------------------------------------------
| BrainpoolP320R1 curve.
# INLINABLE a_ #
# INLINABLE h_ #
| Affine BrainpoolP320R1 curve point.
| Jacobian BrainpoolP320R1 point... | module Data.Curve.Weierstrass.BrainpoolP320R1
( module Data.Curve.Weierstrass
, Point(..)
, module Data.Curve.Weierstrass.BrainpoolP320R1
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Weierstrass
data BrainpoolP320R1
| Field of points of BrainpoolP320R1... |
36756d11c5d61709915810997c62c2ae4f6ff2e83fb48099691db82a9b5c0a34 | relaypro-open/imetrics | imetrics_slo.erl | -module(imetrics_slo).
-export([svr_ref/1, uid_name/1,
get/3, add/3, add/4, put/4, dump/1, dump/2, info/1, foldl_dump/3, remove/2]).
-define(CATCH_KNOWN_EXC(X), try
X
catch
exit:{noproc,{gen_server,call, _}} ->
... | null | https://raw.githubusercontent.com/relaypro-open/imetrics/d99bbafce7b564cb4527e42b2e5a23400a412668/src/imetrics_slo.erl | erlang | @doc remove/2 is provided for completeness, but will not typically be used. It's only useful
if you know a particular UId is no longer relevant and want to manage its lifetime manually. | -module(imetrics_slo).
-export([svr_ref/1, uid_name/1,
get/3, add/3, add/4, put/4, dump/1, dump/2, info/1, foldl_dump/3, remove/2]).
-define(CATCH_KNOWN_EXC(X), try
X
catch
exit:{noproc,{gen_server,call, _}} ->
... |
60257ad5a3317d1e44b14766a0a60035c3206b197d2d093aa132a97c642521b9 | Lysxia/twentyseven | Coord.hs | |
Encoding cube projections as @Int@ coordinates .
Explicit dictionary passing style :
using a class would require explicit type annotations /anyway/.
Encoding cube projections as @Int@ coordinates.
Explicit dictionary passing style:
using a class would require explicit type annotations /a... | null | https://raw.githubusercontent.com/Lysxia/twentyseven/bfcd3ddcf938bc6db933a364d331877b0fd1257e/src/Rubik/Cube/Coord.hs | haskell | * Raw coordinates
Unwrapped coordinate
| Encoding to an efficient datatype
for which it is possible to build tables
instead of computing functions.
# INLINE (!$) #
* Dictionaries
| Encoding dictionary.
Probably synonymous with instances for both
> inRange (range d) $ encode x
> encode . decode == id
> deco... | |
Encoding cube projections as @Int@ coordinates .
Explicit dictionary passing style :
using a class would require explicit type annotations /anyway/.
Encoding cube projections as @Int@ coordinates.
Explicit dictionary passing style:
using a class would require explicit type annotations /a... |
9b7b9e42cb1a53996250853e972514670e1ff029e9de8e53807b786ed2a66c36 | replikativ/datahike-jdbc | core_test.cljc | (ns datahike-jdbc.core-test
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datahike.api :as d]
[datahike-jdbc.core]))
(deftest ^:integration test-postgresql
(let [config {:store {:backend :jdbc
... | null | https://raw.githubusercontent.com/replikativ/datahike-jdbc/6903e1bb81551a50c5b1fb9097d7d411dd00ff97/test/datahike_jdbc/core_test.cljc | clojure | (ns datahike-jdbc.core-test
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datahike.api :as d]
[datahike-jdbc.core]))
(deftest ^:integration test-postgresql
(let [config {:store {:backend :jdbc
... | |
b0f2c1996913041c30a85b6ba6fd1ffec766102ad6e9be9e358cfbe35ae67e30 | RedBrainLabs/system-graph | system_graph_test.clj | (ns com.redbrainlabs.system-graph-test
(:require [com.stuartsierra.component :refer [Lifecycle] :as component]
[plumbing.core :refer [fnk]]
[midje.sweet :refer :all]
[com.redbrainlabs.system-graph :refer :all]))
(def lifecycle-sort :com.redbrainlabs.system-graph/lifecycle-sort)
... | null | https://raw.githubusercontent.com/RedBrainLabs/system-graph/928d5d7de34047e54b0f05d33cf5104d0d9be53a/test/com/redbrainlabs/system_graph_test.clj | clojure |
(prn {:x x :x-squared x-squared})
TODO: investgate this to see if this is a system-graph bug or component..
it looks like component doesn't assoc the deps on stop.. but the newer version says it does..
(-> cycled-system start-system stop-system :b :a :started) => false | (ns com.redbrainlabs.system-graph-test
(:require [com.stuartsierra.component :refer [Lifecycle] :as component]
[plumbing.core :refer [fnk]]
[midje.sweet :refer :all]
[com.redbrainlabs.system-graph :refer :all]))
(def lifecycle-sort :com.redbrainlabs.system-graph/lifecycle-sort)
... |
795f4dd6aa06ef5612a6f74b24bea42ca244e9fdec95dace4ea1956899fd1201 | clj-commons/potemkin | macros.clj | (ns potemkin.macros
(:require
[potemkin.walk :refer (postwalk)]
[riddley.walk :as r]))
(defn safe-resolve [x]
(try
(resolve x)
(catch Exception _
nil)))
(def unified-gensym-regex #"([a-zA-Z0-9\-\'\*]+)#__\d+__auto__$")
(def gensym-regex #"(_|[a-zA-Z0-9\-\'\*]+)#?_+(\d+_*#?)+(auto__)?$")
(d... | null | https://raw.githubusercontent.com/clj-commons/potemkin/3e404364ae2fd32f7a53b362a79d2012ab958ab2/src/potemkin/macros.clj | clojure | (ns potemkin.macros
(:require
[potemkin.walk :refer (postwalk)]
[riddley.walk :as r]))
(defn safe-resolve [x]
(try
(resolve x)
(catch Exception _
nil)))
(def unified-gensym-regex #"([a-zA-Z0-9\-\'\*]+)#__\d+__auto__$")
(def gensym-regex #"(_|[a-zA-Z0-9\-\'\*]+)#?_+(\d+_*#?)+(auto__)?$")
(d... | |
7659fb39d67052340b8056180536c663302b384d8d8c14ecdac1138dba8169da | khotyn/4clojure-answer | 20-penultimate-element.clj | (fn [x] (nth x (- (count x) 2)))
| null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/20-penultimate-element.clj | clojure | (fn [x] (nth x (- (count x) 2)))
| |
50737b4e042a580f386a7638184a8589a9ac19c9e8ae280d8ac9ee7ba8329af9 | data61/Mirza | Migrate.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
-- This module runs database migrations for our application.
module Mirza.SupplyChain.Database.Migrate where
import Mir... | null | https://raw.githubusercontent.com/data61/Mirza/24e5ccddfc307cceebcc5ce26d35e91020b8ee10/projects/or_scs/src/Mirza/SupplyChain/Database/Migrate.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
This module runs database migrations for our application.
| Whether or not to run silently | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
module Mirza.SupplyChain.Database.Migrate where
import Mirza.SupplyChain.Database.Schema.V0001 (migration)
import Mirza.SupplyChain.Database.Schema.SQL.V0001 ( m_0001 )
import Mirza.Common.Database ... |
d025ec139c700d2b99b81be1bac801e3ed593b26d15a060f8aecbfe56733df17 | RedPRL/stagedtt | Quoting.ml | type _ Effect.t +=
| GetSize : int Effect.t
let run ~(size:int) k =
let open Effect.Deep in
try_with k ()
{ effc = fun (type a) (eff : a Effect.t) ->
match eff with
| GetSize -> Option.some @@ fun (k : (a, _) continuation) ->
continue k size
| _ -> None
}
let bi... | null | https://raw.githubusercontent.com/RedPRL/stagedtt/f88538036b51cebb83ebb0b418ec9b089550275d/lib/eff/Quoting.ml | ocaml | type _ Effect.t +=
| GetSize : int Effect.t
let run ~(size:int) k =
let open Effect.Deep in
try_with k ()
{ effc = fun (type a) (eff : a Effect.t) ->
match eff with
| GetSize -> Option.some @@ fun (k : (a, _) continuation) ->
continue k size
| _ -> None
}
let bi... | |
7e33a8f89cf545983c4dfb274e8e77ee49102b6a84f38e4939bc87f209e5e33a | pnwamk/tr-calc | dtr-well-typed.rkt | #lang racket
(require redex
"dtr-lang.rkt"
"dtr-scope.rkt"
"dtr-subst.rkt"
"dtr-subtype.rkt"
"dtr-elim.rkt"
"utils.rkt")
(provide (all-defined-out))
;; ----------------------------------------------------------
;; Types of primitives
(define-metafunction DTR
δ-τ... | null | https://raw.githubusercontent.com/pnwamk/tr-calc/17baa511af28139e686737c1f4c30d3b187efa2d/rtr-redex/dtr-well-typed.rkt | racket | ----------------------------------------------------------
Types of primitives
----------------------------------------------------------
Well-formedness under an environment (Δ)
----------------------------------------------------------
Well-Typed judgement (simplified -- type only, ignores propositions)
------... | #lang racket
(require redex
"dtr-lang.rkt"
"dtr-scope.rkt"
"dtr-subst.rkt"
"dtr-subtype.rkt"
"dtr-elim.rkt"
"utils.rkt")
(provide (all-defined-out))
(define-metafunction DTR
δ-τ : p -> ([x : τ] → τ (ψ ∣ ψ))
[(δ-τ int?) ([x : ⊤] → Bool ((x ~ Int) ∣ (x ¬ Int)))]... |
27ecf5d4a4a0e20c30473c06fec8c5f1895fadd7f84e6ba29cbd699cc43532a4 | spawnfest/eep49ers | wxTextCtrl.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/wxTextCtrl.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(wxTextCtrl).
-include("wxe.hrl").
-export([appendText/2,canCopy/1,canCut/1,canPaste/1,canRedo/1,canUndo/1,ch... |
7766af2215ee792d698a2017ceabaa339f9b6c117f89e24c053545f6def1ad54 | robert-strandh/SICL | direct-slot-definition-class.lisp | (cl:in-package #:sicl-clos)
;;; For the specification of this generic function, see
;;; -MOP/direct-slot-definition-class.html
(defgeneric direct-slot-definition-class (class &rest initargs))
(defmethod direct-slot-definition-class
((class regular-class) &rest initargs)
(declare (ignore class initargs))
(find... | null | https://raw.githubusercontent.com/robert-strandh/SICL/0de61f577f31d7e9048ac444bfdc031c12fcb212/Code/CLOS/direct-slot-definition-class.lisp | lisp | For the specification of this generic function, see
-MOP/direct-slot-definition-class.html | (cl:in-package #:sicl-clos)
(defgeneric direct-slot-definition-class (class &rest initargs))
(defmethod direct-slot-definition-class
((class regular-class) &rest initargs)
(declare (ignore class initargs))
(find-class 'standard-direct-slot-definition))
|
02988bfc831754c569f506c9c4ba19bc047c36df9ad5ec5cc3a02a42c2339c80 | acieroid/scala-am | organigram.scm | (define organigram
'(directeur
(hoofd-verkoop (verkoopsleider-vlaanderen)
(verkoopsleider-brussel))
(hoofd-productie (hoofd-inkoop (bediende1)
(bediende2)
(bediende3))
(hoofd-fakturen))
(hoofd-adm... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/R5RS/scp1/organigram.scm | scheme | (define organigram
'(directeur
(hoofd-verkoop (verkoopsleider-vlaanderen)
(verkoopsleider-brussel))
(hoofd-productie (hoofd-inkoop (bediende1)
(bediende2)
(bediende3))
(hoofd-fakturen))
(hoofd-adm... | |
bf493561e9580ad87e01f318a3274706023e7370ec73cdcda4227d136782c1bb | pepeiborra/ghc-check | PackageDb.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveLift #-}
# OPTIONS_GHC -Wall #
| Discover the GHC version via the package database . Requirements :
--
-- * the package database must be compatible, which is usually not the case
across major ghc versions .
--
-- * the 'ghc' package is registered, which is not alway... | null | https://raw.githubusercontent.com/pepeiborra/ghc-check/24da337aaecd5248cee575ddbff44bf736af58e6/src/GHC/Check/PackageDb.hs | haskell | # LANGUAGE DeriveLift #
* the package database must be compatible, which is usually not the case
* the 'ghc' package is registered, which is not always the case. | # LANGUAGE CPP #
# OPTIONS_GHC -Wall #
| Discover the GHC version via the package database . Requirements :
across major ghc versions .
module GHC.Check.PackageDb
( PackageVersion(abi), version,
getPackageVersion,
fromVersionString
)
where
import Control.Monad.Trans.Class as Monad (MonadTrans (l... |
fcdd2704866fbb067c59ffa23f81da6b82609d6f2fe88dc7b01d47d43cb0e472 | uw-unsat/serval | extend-and-add.rkt | #lang rosette
(require
"common.rkt")
(provide
sxtb16 sxtb sxth
uxtb16 uxtb uxth)
(define (decode Rd rotate Rm)
(define d Rd)
(define m Rm)
(define rotation (zero-extend (concat rotate (bv #b000 3)) (bitvector 32)))
(when (|| (r15? d) (r15? m))
(unpredictable))
(values d m rotation))
(define (in... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/arm32/interp/extend-and-add.rkt | racket | #lang rosette
(require
"common.rkt")
(provide
sxtb16 sxtb sxth
uxtb16 uxtb uxth)
(define (decode Rd rotate Rm)
(define d Rd)
(define m Rm)
(define rotation (zero-extend (concat rotate (bv #b000 3)) (bitvector 32)))
(when (|| (r15? d) (r15? m))
(unpredictable))
(values d m rotation))
(define (in... | |
897f03d487547d2fd4c6c33eaf3b96a2576121c4d60a92daea2d5b1f5287899c | texmacs/tm-forge | tetris-with-tables.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : tetris-game.scm
;; DESCRIPTION : A proof-of-concept tetris clone implemented with tables.
COPYRIGHT : ( C ) 2015
;;
This software falls under the GNU general public license version 3 or later .
;; It comes WITHO... | null | https://raw.githubusercontent.com/texmacs/tm-forge/ee6e11a8f000b0971d6071733c66cc04cac3b319/miscellanea/tetris/tetris-with-tables.scm | scheme |
MODULE : tetris-game.scm
DESCRIPTION : A proof-of-concept tetris clone implemented with tables.
It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
in the root directory or <-3.0.html>.
DISCLAIMER:
It's *very* slow and lacks most of the features an actual game needs, in
particu... | COPYRIGHT : ( C ) 2015
This software falls under the GNU general public license version 3 or later .
This is a quick afternoon hack with the only purpose of having some fun .
(use-modules (utils library cursor))
(define-public the-board (tree ""))
(define (board-height board) (tree-arity board))
(defi... |
0d0de803fd3fa5174b77b18ee546072ba69e809f2cf19282d7e2f8c9653647e0 | jeroanan/rkt-coreutils | uptime.rkt | #lang s-exp "util/frontend-program.rkt"
(require "repl/uptime.rkt")
(uptime)
| null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/uptime.rkt | racket | #lang s-exp "util/frontend-program.rkt"
(require "repl/uptime.rkt")
(uptime)
| |
ad8d83160814231f2182fd6f352a1641a5a1459e082b8486b70b2e69c7ec8e3f | huangz1990/SICP-answers | test-29-branch-torque.scm | (load "test-manager/load.scm")
(load "29-mobile-represent.scm")
(load "29-branch-torque.scm")
(define branch (make-branch 10 20))
(define-each-check
(= (branch-torque branch)
200)
)
(run-registered-tests)
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/test-29-branch-torque.scm | scheme | (load "test-manager/load.scm")
(load "29-mobile-represent.scm")
(load "29-branch-torque.scm")
(define branch (make-branch 10 20))
(define-each-check
(= (branch-torque branch)
200)
)
(run-registered-tests)
| |
1246a3496613152e4519a7277434376968e013cc14d19bc80191869a918ee242 | odo/ramjet | ramjet_sup.erl | -module(ramjet_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% ===================================================================
%% API functions
%% ===================================================================
start_link() ->
supervisor:start... | null | https://raw.githubusercontent.com/odo/ramjet/e0453169abf574f81045c88bd1a43c143d977049/src/ramjet_sup.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
================================================... | -module(ramjet_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
Metrics = ramjet:config(metrics),
IgnoreMetrics = ramjet:config(no_stats_for),
StatsInterval = ramjet:config(stats_inter... |
608b9a751aa50b530d10fae104b953b7d625522ae49038352ad65a4352c56edd | prestancedesign/pingcrm-clojure | contacts.clj | (ns pingcrm.models.contacts
(:require [honey.sql :as h]
[honey.sql.helpers :refer [where]]
[next.jdbc :as jdbc]
[next.jdbc.sql :as sql]))
(defn retrieve-and-filter-contacts
([db filters]
(retrieve-and-filter-contacts db filters nil))
([db {:keys [search trashed]} offset]
... | null | https://raw.githubusercontent.com/prestancedesign/pingcrm-clojure/18c8cca1d068e56b71955081755c0eb152cbf29a/src/clj/pingcrm/models/contacts.clj | clojure | (ns pingcrm.models.contacts
(:require [honey.sql :as h]
[honey.sql.helpers :refer [where]]
[next.jdbc :as jdbc]
[next.jdbc.sql :as sql]))
(defn retrieve-and-filter-contacts
([db filters]
(retrieve-and-filter-contacts db filters nil))
([db {:keys [search trashed]} offset]
... | |
442cc724aaedcc6dfac585d28d9d1890e63d56245c2923fcf6056b028b9b2a0a | HeinrichApfelmus/reactive-banana | CRUD.hs | {-----------------------------------------------------------------------------
reactive-banana-wx
Example:
Small database with CRUD operations and filtering.
To keep things simple, the list box is rebuild every time
that the database is updated. This is perfectly fine for rapid prototyping.
... | null | https://raw.githubusercontent.com/HeinrichApfelmus/reactive-banana/79482f3e9bfab493e2d2197f70cdb11787b33a03/reactive-banana-wx/src/CRUD.hs | haskell | ----------------------------------------------------------------------------
reactive-banana-wx
Example:
Small database with CRUD operations and filtering.
To keep things simple, the list box is rebuild every time
that the database is updated. This is perfectly fine for rapid prototyping.
A... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE RecursiveDo #
import Prelude hiding (lookup)
import Data.List (isPrefixOf)
import Data.Maybe
import qualified Data.Map as Map
import Graphics.UI.WX hiding (Event, update)
import Reactive.Banana
import Reactive.Banana.WX
import Tidings
main :: IO ()
main = start $ do
f... |
ab7c43d9429722216cb947e9298dba09c742068a1c9bd3d713f3ccb366b804ce | RefactoringTools/wrangler | inspec_feedback_wrangler.erl | %% =====================================================================
Wrangler 's feedback interface module to Erlang E - learning
%% =====================================================================
%%
@author
[ ]
%%
%%
@doc Wrangler 's feedback interface module to Erlang E - learning
%%@priv... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/d3d84879b4269759b26d009013edc5bcff49a1af/src/inspec_feedback_wrangler.erl | erlang | =====================================================================
=====================================================================
@private
API for feedback tool.
Give the type (according to syntax_tools) of the patterns
in a function definition.
Collect all the function applications within a function... | Wrangler 's feedback interface module to Erlang E - learning
@author
[ ]
@doc Wrangler 's feedback interface module to Erlang E - learning
-module(inspec_feedback_wrangler).
-export([do_code_inspection/2]).
-export([long_functions/2,
large_modules/2,
calls_to_specific_function/2,... |
965a82f972b12c289e9525e4990806647081168e048bafcbf4aac88737129e7d | mirage/mirage-flow-rawlink | mirage_flow_rawlink.ml |
* Copyright ( c ) 2017 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/mirage-flow-rawlink/b0edf6c9b7ba5bbc6e58347a0e47cd05355155d1/src/mirage_flow_rawlink.ml | ocaml |
* Copyright ( c ) 2017 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
93d5336e637e3a113386a42a6d6da8ddb2441912de5626ca59abcf9cf1dca4f8 | cxphoe/SICP-solutions | 2.20.rkt | (define (same-parity x . y)
(define (filter proc items)
(if (null? items)
'()
(if (proc (car items))
(cons (car items)
(filter proc (cdr items)))
(filter proc (cdr items)))))
(let ((tail (if (even? x)
(filter even? y)
... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%202-Building%20Abstractions%20with%20Data/2.Hierarchical%20Data%20and%20the%20Closure%20Property/2.20.rkt | racket | (define (same-parity x . y)
(define (filter proc items)
(if (null? items)
'()
(if (proc (car items))
(cons (car items)
(filter proc (cdr items)))
(filter proc (cdr items)))))
(let ((tail (if (even? x)
(filter even? y)
... | |
9259e09755f96076f7384246570467e696550ad1615327d81ba8e5a937d7db2d | khibino/haskell-relational-record | DS.hs | module DS (definePgConTable) where
import Language.Haskell.TH
import Language . Haskell . TH.Name . CamelCase ( ConName )
import Database.HDBC.PostgreSQL (connectPostgreSQL)
import Database.HDBC.Query.TH
import Database.HDBC.Schema.PostgreSQL (driverPostgreSQL)
definePgConTable :: String -> String -> [Name] -> Q [D... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/doc/slide/code-reading-201601/DS.hs | haskell | module DS (definePgConTable) where
import Language.Haskell.TH
import Language . Haskell . TH.Name . CamelCase ( ConName )
import Database.HDBC.PostgreSQL (connectPostgreSQL)
import Database.HDBC.Query.TH
import Database.HDBC.Schema.PostgreSQL (driverPostgreSQL)
definePgConTable :: String -> String -> [Name] -> Q [D... | |
bd54a8a00bbd440920764d5e340e3220eec6fda6d32ad53005650e441c99bbdf | footprintanalytics/footprint-web | pre_alias_aggregations_test.clj | (ns metabase.query-processor.middleware.pre-alias-aggregations-test
"Tests for the `pre-alias-aggregations` middleware. For the most part we don't need to test the actual pre-alias
logic, as that comes from the MBQL library and is tested thoroughly there -- we just need to test that it gets
applied in the correct... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/query_processor/middleware/pre_alias_aggregations_test.clj | clojure | (ns metabase.query-processor.middleware.pre-alias-aggregations-test
"Tests for the `pre-alias-aggregations` middleware. For the most part we don't need to test the actual pre-alias
logic, as that comes from the MBQL library and is tested thoroughly there -- we just need to test that it gets
applied in the correct... | |
2e018275470ee61a9cada4dd167c9e238eee2fcc06732f8511da6a5a17364b3c | yurug/ocaml4.04.0-copatterns | spacetime.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/yurug/ocaml4.04.0-copatterns/b3ec6a3cc203bd2cde3b618546d29e10f1102323/stdlib/spacetime.mli | ocaml | ************************************************************************
OCaml
... | and ,
Copyright 2015 - -2016 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
* Profiling of a program 's space behaviour over time .
Currently only supported on x86 - 64 platforms running 64 - bit cod... |
8f483b98ade08eacae937ccb24c85db48205d8cedfe7ac36141c65593e49880e | tormaroe/cl-nats | nats.subject.lisp |
(in-package #:nats.subject)
(defun every-subject-char-p (str)
(cl-ppcre:scan "^[^\\s\\r\\n]+$" str))
(deftype subject ()
"SUBJECT must be a string containing at least one character,
and only visible characters."
'(and string
(satisfies every-subject-char-p))) | null | https://raw.githubusercontent.com/tormaroe/cl-nats/3aa6eb98401849aabecb553266c49d7a8a7d73fd/nats.subject.lisp | lisp |
(in-package #:nats.subject)
(defun every-subject-char-p (str)
(cl-ppcre:scan "^[^\\s\\r\\n]+$" str))
(deftype subject ()
"SUBJECT must be a string containing at least one character,
and only visible characters."
'(and string
(satisfies every-subject-char-p))) | |
3a4e2ee8c103f39d51bdeb6b41344377a0e103d19820c26ca918a1de65717b35 | AlfrescoLabs/technical-validation | util.clj | ;
Copyright © 2013,2014 ( )
;
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 writing, software
distributed under... | null | https://raw.githubusercontent.com/AlfrescoLabs/technical-validation/bd1b4b83f6a5e9dd150eedbeebecd30970d3b4aa/src/clojure/alfresco_technical_validation/impl/util.clj | clojure |
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 language governing pe... | Copyright © 2013,2014 ( )
distributed under the License is distributed on an " AS IS " BASIS ,
This file is part of an unsupported extension to Alfresco .
(ns alfresco-technical-validation.impl.util
(:require [clojure.string :as s]
[clojure.tools.logging :as log]
[clojure.java... |
e40e646324c3fce6568e8ad56abd291f42d36e499139917d45ccbed1e1cc160a | tanders/cluster-engine | 5f.lisp | (in-package cluster-engine) (setf *random-state* (make-random-state t)) (print
(cluster-engine::ClusterEngine 20 t nil
(append (cluster-engine::R-rhythms-one-voice-at-timepoints #'(lambda (x) (equal x '(0 1/4))) 0 '(2) :dur-start)
(cluster-engine::R-only-m-motifs 0))
'((4 4))
'(((1/4) (1/8) (1/16) (3/8)) ... | null | https://raw.githubusercontent.com/tanders/cluster-engine/064ad4fd107f8d9a3dfcaf260524c2ab034c6d3f/test_files/5f.lisp | lisp | (in-package cluster-engine) (setf *random-state* (make-random-state t)) (print
(cluster-engine::ClusterEngine 20 t nil
(append (cluster-engine::R-rhythms-one-voice-at-timepoints #'(lambda (x) (equal x '(0 1/4))) 0 '(2) :dur-start)
(cluster-engine::R-only-m-motifs 0))
'((4 4))
'(((1/4) (1/8) (1/16) (3/8)) ... | |
6c8f124d0c3713a81c459b11835038eb6bd6e6a17a06c37bdb02efd5ff0d39b8 | tsloughter/kuberl | kuberl_v1_quobyte_volume_source.erl | -module(kuberl_v1_quobyte_volume_source).
-export([encode/1]).
-export_type([kuberl_v1_quobyte_volume_source/0]).
-type kuberl_v1_quobyte_volume_source() ::
#{ 'group' => binary(),
'readOnly' => boolean(),
'registry' := binary(),
'tenant' => binary(),
'user' => binary(),
'volum... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_quobyte_volume_source.erl | erlang | -module(kuberl_v1_quobyte_volume_source).
-export([encode/1]).
-export_type([kuberl_v1_quobyte_volume_source/0]).
-type kuberl_v1_quobyte_volume_source() ::
#{ 'group' => binary(),
'readOnly' => boolean(),
'registry' := binary(),
'tenant' => binary(),
'user' => binary(),
'volum... | |
eddba04179ea23d8bba4cadec5b273992c96e7c448cff4c85da35bc66dfa16b1 | well-typed/large-records | Simple.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
# LANGUAGE ViewPatterns #
module Test.Prop.Record.Combinators.Simple (tests) where
import Control.Monad.State
import Data.Bifunctor
import Data.SOP
import qualified Data.Record.Anon.Advanced as Anon
import Test.Ta... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-anon/test/Test/Prop/Record/Combinators/Simple.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE TypeOperators #
------------------------------------------------------------------------------
Auxiliary
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Tests pro... | # LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
module Test.Prop.Record.Combinators.Simple (tests) where
import Control.Monad.State
import Data.Bifunctor
import Data.SOP
import qualified Data.Record.Anon.Advanced as Anon
import Test.Tasty
import Test.Tasty.QuickCheck
import Test.Prop.Record.Model.Orph... |
aca86c1046f1c552f73fe94bc4806435a9873e374adecb286d3a67a0596a39d3 | replikativ/datahike | tools.cljc | (ns ^:no-doc datahike.tools
(:require
[superv.async :refer [throw-if-exception-]]
#?(:clj [clojure.java.io :as io])
[taoensso.timbre :as log])
#?(:clj (:import [java.util Properties UUID Date])))
(defn combine-hashes [x y]
#?(:clj (clojure.lang.Util/hashCombine x y)
:cljs (hash-combine x y)))
#?(... | null | https://raw.githubusercontent.com/replikativ/datahike/b7795e6b0ae9c6649a11a27e958f6716c1b1ec9b/src/datahike/tools.cljc | clojure | (throwable-promise) derived from (promise) in clojure/core.clj.
* Clojure
* The use and distribution terms for this software are covered by the
* which can be found in the file epl-v10.html at the root of this distribution.
* By using this software in any fashion, you are agreeing to be bound by
* the t... | (ns ^:no-doc datahike.tools
(:require
[superv.async :refer [throw-if-exception-]]
#?(:clj [clojure.java.io :as io])
[taoensso.timbre :as log])
#?(:clj (:import [java.util Properties UUID Date])))
(defn combine-hashes [x y]
#?(:clj (clojure.lang.Util/hashCombine x y)
:cljs (hash-combine x y)))
#?(... |
8531fcdc5de3c6844e38148fd4aabc092a6e16034c1038bb9630872d79e630b3 | SilentCircle/scpf | scpf_SUITE.erl | %%%----------------------------------------------------------------
%%% Purpose: Test suite for the 'scpf' module.
%%%-----------------------------------------------------------------
-module(scpf_SUITE).
-include_lib("common_test/include/ct.hrl").
-include("scpf_SUITE.hrl").
-import(scpf_test_support,
[
... | null | https://raw.githubusercontent.com/SilentCircle/scpf/68d46626a056cfd8234d3b6f4661d7d037758619/test/scpf_SUITE.erl | erlang | ----------------------------------------------------------------
Purpose: Test suite for the 'scpf' module.
-----------------------------------------------------------------
--------------------------------------------------------------------
COMMON TEST CALLBACK FUNCTIONS
--------------------------------------------... |
-module(scpf_SUITE).
-include_lib("common_test/include/ct.hrl").
-include("scpf_SUITE.hrl").
-import(scpf_test_support,
[
get_sim_config/2,
get_svc_config/2,
make_sim_notification/2,
multi_store/2,
pv/2,
pv/3,
req_val/2,
start_apnsv3_sim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.