_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 |
|---|---|---|---|---|---|---|---|---|
e32366d0470765adddb47ca55c299ef76b14539128192ebc896f6f44cb06822c | zalando-stups/mint-worker | sync_password_test.clj | (ns org.zalando.stups.mint.worker.job.sync-password-test
(:require [clojure.test :refer :all]
[clj-time.core :as time]
[org.zalando.stups.mint.worker.job.sync-password :refer [sync-password]]
[org.zalando.stups.mint.worker.test-helpers :refer [test-tokens
... | null | https://raw.githubusercontent.com/zalando-stups/mint-worker/df6758936101e02f091f059b967733c5b76a58b3/test/org/zalando/stups/mint/worker/job/sync_password_test.clj | clojure | should not skip if last rotation never happened
signature: url user txid
should throw if a bucket is not writable
should not handle errors | (ns org.zalando.stups.mint.worker.job.sync-password-test
(:require [clojure.test :refer :all]
[clj-time.core :as time]
[org.zalando.stups.mint.worker.job.sync-password :refer [sync-password]]
[org.zalando.stups.mint.worker.test-helpers :refer [test-tokens
... |
640adb8676584a55b30299b0728359daf510967c712c126fd9fc25647aa78f3d | inventi/seed | aggregate_test.clj | (ns seed.core.aggregate-test
(:require [clojure.core.async :refer [go <!!]]
[seed.core.util :refer [success error]]
[seed.core.event-store :as es]
[seed.core.aggregate :as aggr])
(:use [seed.core.aggregate]
[clojure.test]))
(defrecord SuccessHappened [])
(extend-protoco... | null | https://raw.githubusercontent.com/inventi/seed/0a0088a587d6b147215694dcba585b6782eeec80/test/seed/core/aggregate_test.clj | clojure | (ns seed.core.aggregate-test
(:require [clojure.core.async :refer [go <!!]]
[seed.core.util :refer [success error]]
[seed.core.event-store :as es]
[seed.core.aggregate :as aggr])
(:use [seed.core.aggregate]
[clojure.test]))
(defrecord SuccessHappened [])
(extend-protoco... | |
ed309491bf5adfdc0ce5c8c848b45876ecf1447105d1ebc18fa13c45b32c30d5 | Tritlo/PropR | ThreeFixes.hs | module ThreeFixes where
prop_1 = a == 3
where
(a, _, _) = brokenPair
prop_2 = b == 4
where
(_, b, _) = brokenPair
prop_3 = c == 5
where
(_, _, c) = brokenPair
prop_4 = a < 5 && b < 5 && c > 0
where
(a, b, c) = brokenPair
brokenPair :: (Int, Int, Int)
brokenPair = (1, 2, 3) | null | https://raw.githubusercontent.com/Tritlo/PropR/39a57e1463fe724199f78ec3929d58de90916c0e/examples/ThreeFixes.hs | haskell | module ThreeFixes where
prop_1 = a == 3
where
(a, _, _) = brokenPair
prop_2 = b == 4
where
(_, b, _) = brokenPair
prop_3 = c == 5
where
(_, _, c) = brokenPair
prop_4 = a < 5 && b < 5 && c > 0
where
(a, b, c) = brokenPair
brokenPair :: (Int, Int, Int)
brokenPair = (1, 2, 3) | |
a746b77791f44d75b94374ab5198da323d3eb9971eb67ae79b9319474db81c60 | arttuka/reagent-material-ui | minor_crash_sharp.cljs | (ns reagent-mui.icons.minor-crash-sharp
"Imports @mui/icons-material/MinorCrashSharp 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 minor-crash-sharp (crea... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/minor_crash_sharp.cljs | clojure | (ns reagent-mui.icons.minor-crash-sharp
"Imports @mui/icons-material/MinorCrashSharp 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 minor-crash-sharp (crea... | |
c26d25488bf2a8feca7d7d68ed318c91c43a835415047b2d81f98c49a94d9568 | AndrasKovacs/ELTE-func-lang | Notes05.hs |
Monádok ( motivációs feladatok )
------------------------------------------------------------
1 . Írj egy függvényt , 0 - tól kezdve
egy .
-- Pl: labelTree1 (Node1 (Leaf1 ()) (Node1 (Leaf1 ()) (Leaf1 ())))
= = ( Node1 ( Leaf1 0 ) ( Node1 ( Leaf1 1 ) ( Leaf1 2 ) ) )
data Tree1 a = Leaf1 a ... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-1/lectures/Notes05.hs | haskell | ----------------------------------------------------------
Pl: labelTree1 (Node1 (Leaf1 ()) (Node1 (Leaf1 ()) (Leaf1 ())))
ugyanezt a következő fára is:
pl: labelTree2 (Node2 () [Node2 () [], Node2 () [Node2 () []]]) |
Monádok ( motivációs feladatok )
1 . Írj egy függvényt , 0 - tól kezdve
egy .
= = ( Node1 ( Leaf1 0 ) ( Node1 ( Leaf1 1 ) ( Leaf1 2 ) ) )
data Tree1 a = Leaf1 a | Node1 (Tree1 a) (Tree1 a) deriving Show
labelTree1 :: Tree1 a -> Tree1 Int
labelTree1 = fst . go 0 where
go :: Int -> Tree1... |
249a71eb8cf539f257fcc1ed47694c6527af4c1c65197cd8a5005b4eff1912a5 | manuel-serrano/bigloo | produce.scm | (module jas_produce
(import jas_classfile jas_lib)
(export (produce ::binary-port ::obj) ) )
;;
;; Binary output
;;
(define (outchar outchan n)
(output-char outchan n) )
(define (outbyte outchan n)
(outchar outchan (integer->char (bit-and n #xFF))) )
(define (outshort outchan n)
(outbyte outchan (bit-... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Jas/produce.scm | scheme |
Binary output
| (module jas_produce
(import jas_classfile jas_lib)
(export (produce ::binary-port ::obj) ) )
(define (outchar outchan n)
(output-char outchan n) )
(define (outbyte outchan n)
(outchar outchan (integer->char (bit-and n #xFF))) )
(define (outshort outchan n)
(outbyte outchan (bit-rsh n 8))
(outbyte o... |
4f3f8c60aa35b66b1f57c5774996300b16e755d375149b7b0b7ed2bba7f0a195 | mbuczko/cerber-oauth2-provider | token.clj | (ns cerber.stores.token
"Functions handling OAuth2 token storage."
(:require [cerber.oauth2.settings :as settings]
[cerber
[db :as db]
[error :as error]
[helpers :as helpers]
[mappers :as mappers]
[store :refer :all]]
[failjure... | null | https://raw.githubusercontent.com/mbuczko/cerber-oauth2-provider/56ef50366bc83630ae41d438fa017e5411c20fdd/src/cerber/stores/token.clj | clojure | retrieval
revocation
access-tokens are kept in no-sql stores under a key: access:<secret> for performance reasons,
but that makes them hard to revoke as there is no client/login information attached to the key.
on the other hand, refresh-tokens are stored under key: refresh:<secret>:<client-id>:<login>
which make... | (ns cerber.stores.token
"Functions handling OAuth2 token storage."
(:require [cerber.oauth2.settings :as settings]
[cerber
[db :as db]
[error :as error]
[helpers :as helpers]
[mappers :as mappers]
[store :refer :all]]
[failjure... |
381b1e5c287bc570cf9b4d6d6391ae847c554e5b90f201619613f988b4629b45 | SquidDev/urn | resolve.lisp | (import core/prelude ())
(define-native active-node
"Get the node currently being resolved."
:bind-to "_compiler['active-node']")
(define-native active-scope
"Get the scope of the node currently being resolved."
:bind-to "_compiler['active-scope']")
(define-native active-module
"Get the module of the node ... | null | https://raw.githubusercontent.com/SquidDev/urn/6e6717cf1376b0950e569e3771cb7e287aed291d/lib/compiler/resolve.lisp | lisp | (import core/prelude ())
(define-native active-node
"Get the node currently being resolved."
:bind-to "_compiler['active-node']")
(define-native active-scope
"Get the scope of the node currently being resolved."
:bind-to "_compiler['active-scope']")
(define-native active-module
"Get the module of the node ... | |
26f42218b71e567f9306e8551231b5fa69cbdbe86c43ac2a7043c59a902e0782 | hipsleek/hipsleek | ti2.ml | #include "xdebug.cppo"
open VarGen
(* module CP = Cpure *)
module CF =
(* module MCP = Mcpure *)
open Cprinter
open Globals
open Gen
open Tlutils
open Tid
open Ti3
let om_simplify f =
(* let () = x_tinfo_hp (add_str "om_simplify" !CP.print_formula) f no_pos in *)
(* Tpdispatcher.simplify_raw f *)
try
... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/src/ti2.ml | ocaml | module CP = Cpure
module MCP = Mcpure
let () = x_tinfo_hp (add_str "om_simplify" !CP.print_formula) f no_pos in
Tpdispatcher.simplify_raw f
Tpdispatcher.simplify_raw
let (pr_weak, pr_strong) = CP.drop_complex_ops in
Omega.is_sat_ops pr_weak pr_strong f ""
To be improved
let unsat_base_nth... | #include "xdebug.cppo"
open VarGen
module CF =
open Cprinter
open Globals
open Gen
open Tlutils
open Tid
open Ti3
let om_simplify f =
try
if CP.is_linear_formula f then
let ( ) = x_binfo_hp ( add_str " is_omega_running " string_of_bool ) ! Omega.is_omega_running in
x_add_1 Omega.simplify f
else... |
eed2c1ee554f65a7acb2c1c75e0e62ab2e0c6be616d2801f127a86a374e1c72d | triffon/fp-2021-22 | 05.reverse-digits.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
(define (count-digits n)
(if (< n 10)
1
(+ 1 (count-digits (quotient n 10)))))
# # # зад 5
Обръща реда на цифрите на число .
5032 | 1
; quotient | remainder
(define (reverse-digits n)
(if (< n 10)
n
(+
2305
(* (... | null | https://raw.githubusercontent.com/triffon/fp-2021-22/48a10b1c2c9fa509490b975ddea3a18978f654e5/exercises/6/02-rec-iter/solutions/05.reverse-digits.rkt | racket | quotient | remainder
n = 50321
(check = (reverse-digits -1093) -3901) | #lang racket
(require rackunit)
(require rackunit/text-ui)
(define (count-digits n)
(if (< n 10)
1
(+ 1 (count-digits (quotient n 10)))))
# # # зад 5
Обръща реда на цифрите на число .
5032 | 1
(define (reverse-digits n)
(if (< n 10)
n
(+
2305
(* (remainder n 10)
... |
cf2aae81af68029b51adab67d37d07c80871dd56f3870b432aa7d3c13b5d70c4 | EDToaster/CSC324-A2-TestingSuite | testIntLiteral.rkt | ; Just a lonely integer :(
1 | null | https://raw.githubusercontent.com/EDToaster/CSC324-A2-TestingSuite/f07cbd01587a46c61aac29c52a6804864a4eb77b/tests/testIntLiteral.rkt | racket | Just a lonely integer :( | 1 |
5ebb1c5a7632ef8a71ceb7c841d61bbd478a8c17c534ddec319384d0fcad592c | softwarelanguageslab/maf | R5RS_ad_linear-3.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 1
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((create-hash-table (lambda (size hash-fct)
(let ((content (make-vector size 0))
(same? =))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_ad_linear-3.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 0
* added : 1
* swaps : 1
* calls to i d fun : 1
(letrec ((create-hash-table (lambda (size hash-fct)
(let ((content (make-vector size 0))
(same? =))
(letrec ((next-index (lambda (index)
... |
17c6630555f030e2c2ff8f5605338edaa02a21243f3426f25dcd7134433a3d6b | rtoy/cmucl | graphics.lisp | -*- Mode : LISP ; Syntax : Common - lisp ; Package : XLIB ; Base : 10 ; Lowercase : Yes -*-
CLX drawing requests
;;;
TEXAS INSTRUMENTS INCORPORATED
;;; P.O. BOX 2909
AUSTIN , TEXAS 78769
;;;
Copyright ( C ) 1987 Texas Instruments Incorporated .
;;;
;;; Permission is granted to any individua... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/clx/graphics.lisp | lisp | Syntax : Common - lisp ; Package : XLIB ; Base : 10 ; Lowercase : Yes -*-
P.O. BOX 2909
Permission is granted to any individual or institution to use, copy, modify,
and distribute this software, provided that this complete copyright and
permission notice is maintained, intact, in all copies and supporting
... |
CLX drawing requests
TEXAS INSTRUMENTS INCORPORATED
AUSTIN , TEXAS 78769
Copyright ( C ) 1987 Texas Instruments Incorporated .
Texas Instruments Incorporated provides this software " as is " without
(in-package :xlib)
(defvar *inhibit-appending* nil)
(defun draw-point (drawable gcontext x y)
... |
146c6f16465a718cf4a62b44c0fb360c0349ffb2c8e9ea6aaeb97e4138109733 | mcna/closer-mop | jeffs-code.lisp | 2004 - 04 - 16
LWL 4.3
;;;
;;; To reproduce the issues I have come across:
;;;
1 . ( asdf : oos ' asdf : load - op ' closer - mop )
2 . ( compile - file " c2mop-attributes.lisp " : load t )
3 . ( in - package # : c2mop - test )
C2MOP - TEST > ( setq cr ( make - instance ' credit - rating ) )
= > Stack o... | null | https://raw.githubusercontent.com/mcna/closer-mop/f0ee095aee92743beea783dd112dc4f5682ef03b/test/jeffs-code.lisp | lisp |
To reproduce the issues I have come across:
(In this code, I accidently took out the format statements
creating the output below. You may wish to put them back
methods at the bottom of this file.)
slot-value-using-class class #<ATTRIBUTES-CLASS CREDIT-RATING 2134BF1C>
object #<CREDIT-RATING 21732B2C> slot-n... | 2004 - 04 - 16
LWL 4.3
1 . ( asdf : oos ' asdf : load - op ' closer - mop )
2 . ( compile - file " c2mop-attributes.lisp " : load t )
3 . ( in - package # : c2mop - test )
C2MOP - TEST > ( setq cr ( make - instance ' credit - rating ) )
= > Stack overflow ( stack size 16000 ) .
in the slot - value - u... |
249598ea618d6955f8910714f0164bc3c4ab5e27e897e4d9c9d8be54d20a9041 | tonyfloatersu/solution-haskell-craft-of-FP | Deque.hs | module Deque ( Deque
, emptyDQ
, isEmptyDQ
, addFDQ
, addBDQ
, remFDQ
, remBDQ ) where
newtype Deque a = Deque { unDeque :: [a] }
emptyDQ :: Deque a
emptyDQ = Deque []
isEmptyDQ :: Deque a -> Bool
isEmptyDQ (Deque []) = True
isEmptyD... | null | https://raw.githubusercontent.com/tonyfloatersu/solution-haskell-craft-of-FP/0d4090ef28417c82a7b01e4a764f657641cb83f3/Deque.hs | haskell | module Deque ( Deque
, emptyDQ
, isEmptyDQ
, addFDQ
, addBDQ
, remFDQ
, remBDQ ) where
newtype Deque a = Deque { unDeque :: [a] }
emptyDQ :: Deque a
emptyDQ = Deque []
isEmptyDQ :: Deque a -> Bool
isEmptyDQ (Deque []) = True
isEmptyD... | |
a6ac84ea3b7ce5e6bea75af955d38945fc0412cbb585e52d38cce20ce0af0ab1 | softlab-ntua/bencherl | moves_par.erl | -module(moves_par).
-export([moves/1, test/0]).
-include("../../../benchutil/ets.hrl").
-define(WHITE, 119).
-define(EMPTY, 101).
-define(BLACK, 98).
-define(LEFT_DIRECTION, -1).
-define(RIGHT_DIRECTION, 1).
moves(String) ->
moves(String, erlang:system_info(schedulers)).
moves(String, NrOfWorkers) ->
... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/bench/moves/src/moves_par.erl | erlang | -module(moves_par).
-export([moves/1, test/0]).
-include("../../../benchutil/ets.hrl").
-define(WHITE, 119).
-define(EMPTY, 101).
-define(BLACK, 98).
-define(LEFT_DIRECTION, -1).
-define(RIGHT_DIRECTION, 1).
moves(String) ->
moves(String, erlang:system_info(schedulers)).
moves(String, NrOfWorkers) ->
... | |
b752af79813ddb2d84333ee842e22e4f0de5fb19fd018a9beb5c2da548e35f4a | ocaml-ppx/ppx_tools_versioned | update_dune.ml | let versions =
["402"; "403"; "404"; "405"; "406"; "407"; "408"; "409"; "410"; "411"]
let flags = "(:standard -w +A-4-17-44-45-105-42 -safe-string)"
let ppx_tools_versioned_modules =
versions
|> List.map (fun v ->
[ "ast_convenience"
; "ast_mapper_class"
; "ast_lifter"
; "ppx_tools" ]
... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx_tools_versioned/00a0150cdabfa7f0dad2c5e0e6b32230d22295ca/gen/update_dune.ml | ocaml | let versions =
["402"; "403"; "404"; "405"; "406"; "407"; "408"; "409"; "410"; "411"]
let flags = "(:standard -w +A-4-17-44-45-105-42 -safe-string)"
let ppx_tools_versioned_modules =
versions
|> List.map (fun v ->
[ "ast_convenience"
; "ast_mapper_class"
; "ast_lifter"
; "ppx_tools" ]
... | |
db81f70f4bfc3043ea35aad63ce58ecbd075f950b7566dc9bac9d5931dcc4035 | gafiatulin/codewars | StarTriangle.hs | Star Triangle
--
module StarTriangle where
makeStarTriangle :: Int -> String
makeStarTriangle n = init . unlines . map (\x -> replicate (n-x) ' ' ++ replicate (2*(x-1) + 1) '*') $ [1..n]
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/Beta/StarTriangle.hs | haskell | Star Triangle
module StarTriangle where
makeStarTriangle :: Int -> String
makeStarTriangle n = init . unlines . map (\x -> replicate (n-x) ' ' ++ replicate (2*(x-1) + 1) '*') $ [1..n]
| |
61f5e957549418667aedf16aabb00520b801163296f81349c122364d73c48929 | eareese/htdp-exercises | 076-formulate-data-definitions.rkt | Formulate data definitions for the following structure type definitions:
(define-struct movie [title producer year])
a movie has three parts :
; - title, which is a string (the title of the movie)
; - producer, a string (the producer of the movie)
; - year, a number (the date in which the movie was released)
(defin... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part01-fixed-size-data/076-formulate-data-definitions.rkt | racket | - title, which is a string (the title of the movie)
- producer, a string (the producer of the movie)
- year, a number (the date in which the movie was released)
- name, a string representing the person's name
- hair, perhaps t/f indicating whether or not they have hair
- eyes, t/f does the person have eyes
- pho... | Formulate data definitions for the following structure type definitions:
(define-struct movie [title producer year])
a movie has three parts :
(define-struct person [name hair eyes phone])
a person has four parts :
(define-struct pet [name number])
a pet has two parts :
(define-struct CD [artist title price])... |
fc43f17a00c5b17298eec68532c0fc9ee3551b4d389d5258bf959732ee72407d | dalaing/little-languages | Test.hs | |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
module Main (
main
) where
-- from 'tasty'
import Test.... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/b/tests/Test.hs | haskell | from 'tasty'
local | |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
module Main (
main
) where
import Test.Tasty (TestTree,... |
987e4cb645d09b37ef3fcce54d13a46304924907646d955ea7ab5dcd0888aa17 | joodie/flutter | test_labels.clj | (ns flutter.test-labels
(:use clojure.test
flutter.core
flutter.html4.input-fields
flutter.labels))
(deftest labels
(let [field (-> field
wrap-basic-input-fields
(wrap-labels {:my-name "Label"}))]
(is (= (field :input {:type :text} :my-name nil "val")... | null | https://raw.githubusercontent.com/joodie/flutter/336e40386ff4e79ce9243ec8690e2a62c41f80a3/test/flutter/test_labels.clj | clojure | (ns flutter.test-labels
(:use clojure.test
flutter.core
flutter.html4.input-fields
flutter.labels))
(deftest labels
(let [field (-> field
wrap-basic-input-fields
(wrap-labels {:my-name "Label"}))]
(is (= (field :input {:type :text} :my-name nil "val")... | |
7ab4f3ec6609d399aa6376dd0477255680645766ced84e8cd4d03506e7163a6a | lagenorhynque/aqoursql | eastwood_config.clj | (disable-warning
{:linter :constant-test
:if-inside-macroexpansion-of #{'clojure.spec.alpha/every}
:reason "clojure.spec.alpha/every can expand to code with constant test."})
| null | https://raw.githubusercontent.com/lagenorhynque/aqoursql/a7f00ee588ff7e1c1f10ac3f550aafea2ef661ab/dev/resources/eastwood_config.clj | clojure | (disable-warning
{:linter :constant-test
:if-inside-macroexpansion-of #{'clojure.spec.alpha/every}
:reason "clojure.spec.alpha/every can expand to code with constant test."})
| |
487b3d651e878d2ed9f64f78ad3eed6cbb66cb720c4b9011233a6ca042abab75 | as-capabl/armageddon | Automaton.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE RankNTypes #-}
module
Control.Arrow.Machine.Automaton (
Automaton(..),
constructAuto
)
where
import Prelude hiding ((.), id)
import Control.Category
import Control.Arrow
import ... | null | https://raw.githubusercontent.com/as-capabl/armageddon/f9724b7a545f7e66931d2a46732402a67a59a03e/machinecell-extra/src/Control/Arrow/Machine/Automaton.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependencies #
module
Control.Arrow.Machine.Automaton (
Automaton(..),
constructAuto
)
where
import Prelude hiding ((.), id)
import Control.Category
import Control.Arrow
import Control.Arrow.Machine.Types
... |
1073193990dbbb8b9fee3fe817e21ab0275730c978a12c4e89e10c927e8e4904 | samrushing/irken-compiler | t_macro0.scm | ;; -*- Mode: Irken -*-
(datatype bool (:true) (:false))
(define (< a b)
(%%cexp (int int -> bool) "%0<%1" a b))
(defmacro zand
(zand) -> #t
(zand test) -> test
(zand test1 test2 ...) -> (if test1 (zand test2 ...) #f)
)
(zand (< 1 2) (< 3 4) (< 5 6))
| null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_macro0.scm | scheme | -*- Mode: Irken -*- |
(datatype bool (:true) (:false))
(define (< a b)
(%%cexp (int int -> bool) "%0<%1" a b))
(defmacro zand
(zand) -> #t
(zand test) -> test
(zand test1 test2 ...) -> (if test1 (zand test2 ...) #f)
)
(zand (< 1 2) (< 3 4) (< 5 6))
|
0302c399aead146d7c692fab41fe2de0298bae65bb038b104ae13ec669df1d5f | locusmath/locus | object.clj | (ns locus.order.meet-semilattice.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.con.core.setpart :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.structure.protocols :refer... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/order/meet_semilattice/core/object.clj | clojure | A meet semilattice is a category having all binary products
Create a meet semilattice from a set of ordered pairs | (ns locus.order.meet-semilattice.core.object
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.con.core.setpart :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.structure.protocols :refer... |
291d0550bfdfae92f1309a0733ae0e75b28376a3442b922c47633d89215c256d | OCamlPro/socaml-analyzer | funs.ml | open Data
let field i f env =
let l = Fm.fold (fun _ a l -> a.(i)::l) f.f [] in
match l with
| [x] when Ids.cardinal x = 1 -> get_env ( Ids.choose x ) env
| _ ->
List.fold_left (fun data ids ->
Ids.fold
(fun i data -> union data ( get_env i env ))
ids data
) bottom l
let... | null | https://raw.githubusercontent.com/OCamlPro/socaml-analyzer/f39121e1d05a9e5bb6f005497eaaa5a67f256d4c/src/data/funs.ml | ocaml | open Data
let field i f env =
let l = Fm.fold (fun _ a l -> a.(i)::l) f.f [] in
match l with
| [x] when Ids.cardinal x = 1 -> get_env ( Ids.choose x ) env
| _ ->
List.fold_left (fun data ids ->
Ids.fold
(fun i data -> union data ( get_env i env ))
ids data
) bottom l
let... | |
ab8e46a6e66c04f3118750075c5791d4e37823e87cb24ffd3da27b750f525dce | manuel-serrano/bigloo | mpg123.scm | ;*=====================================================================*/
;* .../prgm/project/bigloo/api/multimedia/src/Llib/mpg123.scm */
;* ------------------------------------------------------------- */
* Author : * /
* Creation : Tue Jul 10... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/multimedia/src/Llib/mpg123.scm | scheme | *=====================================================================*/
* .../prgm/project/bigloo/api/multimedia/src/Llib/mpg123.scm */
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The MPG123 Bigloo bindi... | * Author : * /
* Creation : Tue Jul 10 10:45:58 2007 * /
* Last change : We d Jan 25 17:41:35 2012 ( serrano ) * /
* Copyright : 2007 - 12 * /
(module __multimedia-mpg123
... |
7e807abb7d562a44c4cd6b3e6ca8dd4921e1c11c62a53db31a5216a0569daed5 | philnguyen/soft-contract | nucleic3.rkt | #lang racket/base
; File: "nucleic3.rkt"
;
Author : ( )
Last modification by Feeley : June 6 , 1994 .
Modified for R5RS Scheme by : 22 October 1996 .
Modified for Racket by : 20 May 2010 .
Last modification by St - Amour 20 May 2010 .
;
; This program is a modified version of the program described i... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/termination/r5rs-ish/nucleic3.rkt | racket | File: "nucleic3.rkt"
This program is a modified version of the program described in
Constraint Satisfaction Problems: an Application to Nucleic Acid 3D
Structure Determination. Lisp and Symbolic Computation 7(2/3),
The differences between this program and the original are described in
Functional Langu... | #lang racket/base
Author : ( )
Last modification by Feeley : June 6 , 1994 .
Modified for R5RS Scheme by : 22 October 1996 .
Modified for Racket by : 20 May 2010 .
Last modification by St - Amour 20 May 2010 .
, , . Using Multilisp for Solving
231 - 246 , 1994 .
P.H. Hartel , ,... |
0e49318101405bebeab3f8bfa135bc03ce5ee85395fff978ccf177a725c75ce3 | msantos/epcap_compile | bpf_ex.erl | -module(bpf_ex).
-export([f/0, f/1, f/2]).
f() ->
f("en1").
f(Dev) ->
case os:type() of
{unix, BSD} when
BSD == darwin;
BSD == freebsd;
BSD == netbsd;
BSD == openbsd
->
f(Dev, "ip and ( src host 192.168.10.1 or dst host 192.168.10.1 )... | null | https://raw.githubusercontent.com/msantos/epcap_compile/e3979c51b39b6edf695433c7b6bdd3a195fe5370/examples/bpf_ex.erl | erlang | -module(bpf_ex).
-export([f/0, f/1, f/2]).
f() ->
f("en1").
f(Dev) ->
case os:type() of
{unix, BSD} when
BSD == darwin;
BSD == freebsd;
BSD == netbsd;
BSD == openbsd
->
f(Dev, "ip and ( src host 192.168.10.1 or dst host 192.168.10.1 )... | |
4fe2931410527f78fc5ab2c910246eb5d1f6d05cc3353376a5d320a090c542dc | blockfrost/blockfrost-haskell | UserAgent.hs | -- | Blockfrost client version via user agent header
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
{-# LANGUAGE OverloadedStrings #-}
module Blockfrost.Client.... | null | https://raw.githubusercontent.com/blockfrost/blockfrost-haskell/c3812a14a5c0071a17972d9f2ba66ac56ebcbb8a/blockfrost-client-core/src/Blockfrost/Client/UserAgent.hs | haskell | | Blockfrost client version via user agent header
# LANGUAGE OverloadedStrings #
# OVERLAPS # |
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module Blockfrost.Client.UserAgent () where
import Blockfrost.Util.UserAgent
import Data.CaseInsensitive (mk)
im... |
843864d451254f3d399ca16f9f3e188658955656fb7486aa160cb09b36ac6d32 | gwkkwg/cl-mathstats | svd.lisp | -*- Mode : Common - Lisp ; Package : eksl - utilities ; -*-
;;;; *-* File: eksl-math:svd.lisp *-*
* - * Last - edit : Tuesday , August 24 , 2004 11:30:30 ; Edited - By :
* - * Machine : * - *
* - * Software : Macintosh Common Lisp , Version 5.1b2 * - *
;;;; *-* Lisp: Macintosh Common Lisp, Version 5.1b2... | null | https://raw.githubusercontent.com/gwkkwg/cl-mathstats/39af1b5e1ebbad6f75dab2c4214ce48852031bbf/dev/svd.lisp | lisp | Package : eksl - utilities ; -*-
*-* File: eksl-math:svd.lisp *-*
Edited - By :
*-* Lisp: Macintosh Common Lisp, Version 5.1b2 *-*
**************************************************************************
**************************************************************************
* ... | * - * Machine : * - *
* - * Software : Macintosh Common Lisp , Version 5.1b2 * - *
* Singular Value Decomposition *
SVD is the preferred method for inverting nearly singular matrices . The
following routines are adapted from Numerical Recipes in C.
Written b... |
87779c0163508028ee6a97f9ab801875dbdaa1c62a8195af73202adda11d3da3 | sru-systems/protobuf-simple | WireFormat.hs | -- |
-- Module: Data.ProtoBuf.WireFormat
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
--
Functions for converting to wire format and back .
module Data.ProtoBuf.WireFormat
( module Data.ProtoBuf.Default
, module Data.ProtoBuf.FieldNumber
, module Data.Proto... | null | https://raw.githubusercontent.com/sru-systems/protobuf-simple/8d19dfc68466c1ce69e9d3af6e75df16fffd32cc/src/Data/ProtoBuf/WireFormat.hs | haskell | |
Module: Data.ProtoBuf.WireFormat
> decCustomType = decode
| Decode a required bool field.
| Decode an optional bool field.
| Decode a packed repeated bool field.
| Decode a required bytes field.
| Decode an optional bytes field.
| Decode a required double field.
| Decode an optional double field.
... | Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
Functions for converting to wire format and back .
module Data.ProtoBuf.WireFormat
( module Data.ProtoBuf.Default
, module Data.ProtoBuf.FieldNumber
, module Data.ProtoBuf.Mergeable
, module Data.ProtoBuf.Required... |
85f078febf44c09189d139277b2a7f565f978ba673cbe735455b1e0ddfc131d2 | roman01la/cljs-rum-realworld-example-app | home.cljs | (ns conduit.components.home
(:require [rum.core :as rum]
[bidi.bidi :as bidi]
[citrus.core :as citrus]
[conduit.mixins :as mixins]
[conduit.routes :refer [routes]]
[conduit.components.grid :as grid]
[conduit.components.base :as base]))
(rum/defc... | null | https://raw.githubusercontent.com/roman01la/cljs-rum-realworld-example-app/962695bd391806a7066340461c3e02f2215fdc48/src/conduit/components/home.cljs | clojure | (ns conduit.components.home
(:require [rum.core :as rum]
[bidi.bidi :as bidi]
[citrus.core :as citrus]
[conduit.mixins :as mixins]
[conduit.routes :refer [routes]]
[conduit.components.grid :as grid]
[conduit.components.base :as base]))
(rum/defc... | |
50d7e0e71aeb02d6c0243eb70a0803ddfaa221e9b769ad728494aae4c711ae20 | Datomic/codeq | core_test.clj | (ns datomic.codeq.core-test
(:use clojure.test
datomic.codeq.core))
(deftest a-test
(testing "FIXME, I fail."
(is (= 1 1)))) | null | https://raw.githubusercontent.com/Datomic/codeq/de60a9d2df23cc750b1fa4aa4c7d4c2c926a1422/test/datomic/codeq/core_test.clj | clojure | (ns datomic.codeq.core-test
(:use clojure.test
datomic.codeq.core))
(deftest a-test
(testing "FIXME, I fail."
(is (= 1 1)))) | |
e1451e4bbc9a860b92a7847861384780bcb2631c7d263df2338f6cdfac7bc5c0 | janestreet/hardcaml | test_cyclesim_introspection.ml | open! Import
open! Signal
let ( <--. ) dst src = dst := Bits.of_int ~width:(Bits.width !dst) src
let assign_bits_mutable dst src =
Bits.Mutable.copy_bits ~src:(Bits.of_int ~width:(Bits.Mutable.width dst) src) ~dst
;;
let%expect_test "Cyclesim.internal_port can peek at combinational node" =
let create_sim () =
... | null | https://raw.githubusercontent.com/janestreet/hardcaml/a9b1880ca2fb1a566eac66d935cacf344ec76b13/test/lib/test_cyclesim_introspection.ml | ocaml | Replace the contents of a register with some dummy value and make sure
it is picked up by the simulator.
Cannot lookup a memory as a reg.
Write mem.(17) normally, and make sure we can read it through [mem]
Poke mem.(42) with a value, and make sure the regular simulation reads out
that value in the me... | open! Import
open! Signal
let ( <--. ) dst src = dst := Bits.of_int ~width:(Bits.width !dst) src
let assign_bits_mutable dst src =
Bits.Mutable.copy_bits ~src:(Bits.of_int ~width:(Bits.Mutable.width dst) src) ~dst
;;
let%expect_test "Cyclesim.internal_port can peek at combinational node" =
let create_sim () =
... |
a84ce46a20e336a27533dac068d640b87cee5f57c96a314bfb3395f3c2fcfc10 | janestreet/merlin-jst | msource.mli | * { 0 representation of a textual source code }
It bundles filename and a content , and offers functions for computing
positions in the source .
It bundles filename and a content, and offers functions for computing
positions in the source.
*)
type t
(** Making a content from name and contents.... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/src/kernel/msource.mli | ocaml | * Making a content from name and contents.
* Updating content
* Source code of the file | * { 0 representation of a textual source code }
It bundles filename and a content , and offers functions for computing
positions in the source .
It bundles filename and a content, and offers functions for computing
positions in the source.
*)
type t
val make : string -> t
* { 1 Position manag... |
d0236b5a4cb7ba0aa20cf446f2f3af0a2dd19def06c6b60ee90b1a6b2f5bd6b1 | hodur-org/hodur-engine | core.cljc | (ns hodur-engine.core
(:require #?@(:clj
[[clojure.edn :as edn]
[clojure.java.io :as io]])
[camel-snake-kebab.core :refer [->camelCaseKeyword
->PascalCaseKeyword
->kebab-case-keyword
... | null | https://raw.githubusercontent.com/hodur-org/hodur-engine/ec28d6679e7e58bbad3403a80f243cab4b84f990/src/hodur_engine/core.cljc | clojure | general meta nodes
type meta nodes
field meta nodes
param meta nodes
FIXME: move these to a README/TUTORIAL when one is available
Some queries
Temp ID state stuff
Parsing functions
is a field proper
is a coll of params
Public functions
| (ns hodur-engine.core
(:require #?@(:clj
[[clojure.edn :as edn]
[clojure.java.io :as io]])
[camel-snake-kebab.core :refer [->camelCaseKeyword
->PascalCaseKeyword
->kebab-case-keyword
... |
1c38cf390fe97489dabfeb0799defd83d5cabe9867b13dbad241d0276fc99560 | onyx-platform/onyx | window_max_test.clj | (ns onyx.windowing.window-max-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[onyx.windowing.aggregation]
[onyx.refinements]
[onyx.windowing.window-compile :as wc]
[onyx.windowing.window-extensions :as we]
[onyx.peer.window-state :as ... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/test/onyx/windowing/window_max_test.clj | clojure | (ns onyx.windowing.window-max-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[onyx.windowing.aggregation]
[onyx.refinements]
[onyx.windowing.window-compile :as wc]
[onyx.windowing.window-extensions :as we]
[onyx.peer.window-state :as ... | |
105ecfe829af0403c4160245de3e213acaf93a35c9513ae9e1f7b62729097b44 | PrincetonUniversity/lucid | SyntaxToCore.ml | open Batteries
module S = Syntax
module C = CoreSyntax
let err span str =
Console.error_position span
@@ "Internal error: Cannot translate "
^ str
^ " to backend syntax"
;;
let err_unsupported span str =
Console.error_position span
@@ "cannot translate to backend syntax. the construct "
^ str
^ " does... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/8ca93fd803caaa80cf2e301154791564dd3fed7e/src/lib/midend/transformations/SyntaxToCore.ml | ocaml | Dummy translation needed for foreign functions
(match s.s with
| SSeq _ | SNoop -> ()
| _ -> print_endline @@ "Translating " ^ Printing.statement_to_string s); | open Batteries
module S = Syntax
module C = CoreSyntax
let err span str =
Console.error_position span
@@ "Internal error: Cannot translate "
^ str
^ " to backend syntax"
;;
let err_unsupported span str =
Console.error_position span
@@ "cannot translate to backend syntax. the construct "
^ str
^ " does... |
670f9be794a4b7a851418d1b942e67021178ed1949fa7b8de28cf77e95eacdb6 | axelarge/advent-of-code | day04.clj | (ns advent-of-code.y2017.day04
(:require [advent-of-code.support :refer :all]))
(def input (get-input 2017 4))
(defn no-dupes-by [f phrase]
(= (count (distinct (map f phrase)))
(count phrase)))
(defn solve [f input]
(->> input
(split-lines split-ws)
(count-where (partial no-dupes-by f))))
(... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2017/day04.clj | clojure | (ns advent-of-code.y2017.day04
(:require [advent-of-code.support :refer :all]))
(def input (get-input 2017 4))
(defn no-dupes-by [f phrase]
(= (count (distinct (map f phrase)))
(count phrase)))
(defn solve [f input]
(->> input
(split-lines split-ws)
(count-where (partial no-dupes-by f))))
(... | |
39cd2cba5b245f8319b575a027efab665e6e7f276e2fffc2969febf5755c1ca7 | jfeser/L2 | example_deduction.ml | open Core
open Core_extended.Std
open Hypothesis
open Collections
module Sk = Skeleton
module Sp = Specification
exception Bottom
exception Non_unifiable
type example = ExprValue.t list * ExprValue.t [@@deriving sexp]
let timer =
let t = Timer.empty () in
let n = Timer.add_zero t in
n "scan" "Total time spent... | null | https://raw.githubusercontent.com/jfeser/L2/a66659c7d75f75788c48a17b531045fb3d5f8351/lib/example_deduction.ml | ocaml | printf "No examples found. (%s)\n" op;
print_newline ();
printf "ERROR: %s\n" (Error.to_string_hum err);
printf "Pushing specifications for %s.\n" func_name;
print_endline "Parent spec:";
Util.print_sexp s [%sexp_of:Sp.t];
print_endline "Arg specs:";
Util.print_sexp arg_specs [%sexp_of:Sp.t list];
prin... | open Core
open Core_extended.Std
open Hypothesis
open Collections
module Sk = Skeleton
module Sp = Specification
exception Bottom
exception Non_unifiable
type example = ExprValue.t list * ExprValue.t [@@deriving sexp]
let timer =
let t = Timer.empty () in
let n = Timer.add_zero t in
n "scan" "Total time spent... |
735703da834a9e0204a7c323ccdd5ae209f234d014fb3293e14e2ca7244fc4c4 | dmjio/stripe | InvoiceItem.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
-------------------------------------------
-- |
-- Module : Web.Stripe.InvoiceItem
Copyright : ( c ) , 2014
-- Maintainer :
-- Stability : experimental
-- Porta... | null | https://raw.githubusercontent.com/dmjio/stripe/967334629933fcb55247eb3270c7801c05d6bf61/stripe-core/src/Web/Stripe/InvoiceItem.hs | haskell | -----------------------------------------
|
Module : Web.Stripe.InvoiceItem
Maintainer :
Stability : experimental
Portability : POSIX
@
main :: IO ()
main = do
result <- stripe config $ createCustomer
case result of
(Left stripeError) -> print stripeError
(Right (Customer { customerI... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
Copyright : ( c ) , 2014
< https:/\/\stripe.com / docs / >
{ -\ # LANGUAGE OverloadedStrings \#- }
import Web . Stripe
import Web . Stripe . Customer
import We... |
cb37a418321deccce5a55c16930b38f78e7feb71901be473eeceeecd310ebcba | AbstractMachinesLab/caramel | erlang.ml | external length : 'a list -> int = ""
external throw : 'a -> 'a = ""
(************** processes *****************)
type 'm pid
external register : 'a -> 'm pid -> bool = ""
external self : unit -> 'm pid = ""
external send : 'm pid -> 'm -> unit = ""
external spawn : (unit -> 'a) -> 'm pid = ""
external where_is... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/stdlib/erlang.ml | ocaml | ************* processes ****************
************* is_* guards ****************
************* *_to_* parsers ****************
************* math functions **************** | external length : 'a list -> int = ""
external throw : 'a -> 'a = ""
type 'm pid
external register : 'a -> 'm pid -> bool = ""
external self : unit -> 'm pid = ""
external send : 'm pid -> 'm -> unit = ""
external spawn : (unit -> 'a) -> 'm pid = ""
external where_is : 'a -> 'm pid = "whereis"
external is_ato... |
a0d06e0ce88fa09927a3f68dc64ffd66d488bba54ed97be7a66d69d8bfb669c0 | donut-party/datapotato | 07.clj | (ns donut.datapotato-tutorial.07
"uniqueness constraint"
(:require [donut.datapotato.core :as dc]))
(def bad-schema
{:user {:prefix :u}
:post {:prefix :p}
:like {:prefix :l
:spec ::like
:relations {:post-id [:post :id]
:created-by-id [:user :i... | null | https://raw.githubusercontent.com/donut-party/datapotato/5a28e07a852d5065fa50aa309357aa098c7c7fb7/docs/tutorial/donut/datapotato_tutorial/07.clj | clojure | (ns donut.datapotato-tutorial.07
"uniqueness constraint"
(:require [donut.datapotato.core :as dc]))
(def bad-schema
{:user {:prefix :u}
:post {:prefix :p}
:like {:prefix :l
:spec ::like
:relations {:post-id [:post :id]
:created-by-id [:user :i... | |
9bd900800eedcd6c9e31e192663d6a8fac576e5963afe02518c3b4233879ab39 | shirok/Gauche | pager.scm | ;;;
;;; text.pager - display text using appropriate pager
;;;
Copyright ( c ) 2020 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must r... | null | https://raw.githubusercontent.com/shirok/Gauche/b773899dbe0b2955e1c4f1daa066da874070c1e4/lib/text/pager.scm | scheme |
text.pager - display text using appropriate pager
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and th... | Copyright ( c ) 2020 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(define-module text.pager
(use gauche.pro... |
2788d0d468ed03d5d10443c716a55fe2a676b23505bbfb8ee8c53583b31d9cb7 | conreality/conreality | theater.ml | (* This is free and unencumbered software released into the public domain. *)
open Prelude
let objects = ref ([] : Object.t list)
let reset () =
objects := []
let is_empty () =
!objects = []
let label () : string option = None
TODO
let register (obj : Object.t) =
objects := obj :: !objects
let unregiste... | null | https://raw.githubusercontent.com/conreality/conreality/e03328ef1f0056b58e4ffe181a279a1dc776e094/src/consensus/model/theater.ml | ocaml | This is free and unencumbered software released into the public domain. |
open Prelude
let objects = ref ([] : Object.t list)
let reset () =
objects := []
let is_empty () =
!objects = []
let label () : string option = None
TODO
let register (obj : Object.t) =
objects := obj :: !objects
let unregister (obj : Object.t) =
TODO
let iter (f : (Object.t -> unit)) =
List.iter f... |
c9e6bb7f5dfd14e5af8384394ae857a04c7ac77bc44a21c7647ba175d6f1a57a | nikita-volkov/rebase | Bool.hs | module Rebase.Data.Type.Bool
(
module Data.Type.Bool
)
where
import Data.Type.Bool
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Data/Type/Bool.hs | haskell | module Rebase.Data.Type.Bool
(
module Data.Type.Bool
)
where
import Data.Type.Bool
| |
eaf89743dc2ad530f056ea93bd0d2154b19a94a9c16fabbd71b955c12de35547 | tbelaire/http-pokemon | main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative
import Control.Monad
import Data.Monoid
import System.Random
import Data.Text
import qualified Data.ByteString.Lazy as L
import Data.Aeson
import Network.HTTP.Conduit
data MoveSummary = MoveSummary {
move_summary_name :: Text,
m... | null | https://raw.githubusercontent.com/tbelaire/http-pokemon/144a0160083247e78995e1407b1774a870c56384/src/main.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import Control.Applicative
import Control.Monad
import Data.Monoid
import System.Random
import Data.Text
import qualified Data.ByteString.Lazy as L
import Data.Aeson
import Network.HTTP.Conduit
data MoveSummary = MoveSummary {
move_summary_name :: Text,
move_summary_uri :: Text
} deriving ... |
8e71492025ca86c10df882a522cede82600eff45573bfa2a6f1eb9ac1871f8d1 | applied-science/rdata | rdata_test.clj | (ns appliedsciencestudio.rdata-test
(:require [clojure.test :refer :all]
[appliedsciencestudio.rdata :refer [read-rdata make-serializer clojurize-sexp]]))
(def eval-r
"An instance of the Renjin script engine, which we will use to generate test data."
(let [engine (.getScriptEngine (org.renjin.script.... | null | https://raw.githubusercontent.com/applied-science/rdata/888d388954366b93a3a53d773a0b05249bdecb58/test/appliedsciencestudio/rdata_test.clj | clojure | originally taking ideas from -test/index.html#more-data-conversion-examples
XXX
java->clj might be trying too hard to keywordize?
(eval-r "list(A=1,B=2,'#123strange ()'=3)"))
In R this is:
1 2 3
b 2 1 1
... with this meta:
clojisr gives this, which I'm not sure is what I'd want:
bringing the clojisr code o... | (ns appliedsciencestudio.rdata-test
(:require [clojure.test :refer :all]
[appliedsciencestudio.rdata :refer [read-rdata make-serializer clojurize-sexp]]))
(def eval-r
"An instance of the Renjin script engine, which we will use to generate test data."
(let [engine (.getScriptEngine (org.renjin.script.... |
cc73048acbc9b3f69806219fc2558ba6dfe9ab23fc3eaba5321f5312a2b71b2e | clojurewerkz/statistiker | correlation_test.clj | (ns clojurewerkz.statistiker.correlation-test
(:require [clojurewerkz.statistiker.correlation :refer :all]
[clojure.test :refer :all]))
(deftest pearsons-correlation-test
(testing "abslutely correlated items"
(let [v1 [1 2 3 4 5 6]
v2 [1 2 3 4 5 6]]
(is (= 1.0 (pearsons-correlation ... | null | https://raw.githubusercontent.com/clojurewerkz/statistiker/f056f68c975cf3d6e0f1c8212aef9114d4eb657c/test/clj/clojurewerkz/statistiker/correlation_test.clj | clojure | (ns clojurewerkz.statistiker.correlation-test
(:require [clojurewerkz.statistiker.correlation :refer :all]
[clojure.test :refer :all]))
(deftest pearsons-correlation-test
(testing "abslutely correlated items"
(let [v1 [1 2 3 4 5 6]
v2 [1 2 3 4 5 6]]
(is (= 1.0 (pearsons-correlation ... | |
98ac151799549e49e8fb7f32eb372365a86138542f41bbe9eec91e04e4c58028 | Helium4Haskell/helium | GuardedGuard.hs | module GuardedGuard where
f | 3 = 5
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/typeerrors/Examples/GuardedGuard.hs | haskell | module GuardedGuard where
f | 3 = 5
| |
eae8884a92a608498e5a7fae1e749646d9f3f43f976058908c001e03bb5b8449 | vikram/lisplibraries | xml-util.lisp | -*- package : NOX ; Syntax : Common - lisp ; Base : 10 -*-
;;;
;;;; xml-util.lisp
;;;
;;;
;;; --------------------------------------------------------------------------------------
;;;
;;; The contents of this file are subject to the NOKOS License Version 1.0a (the
;;; "License"); you may not use this file exce... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/wilbur/nox/xml-util.lisp | lisp | Syntax : Common - lisp ; Base : 10 -*-
xml-util.lisp
--------------------------------------------------------------------------------------
The contents of this file are subject to the NOKOS License Version 1.0a (the
"License"); you may not use this file except in compliance with the License.
WARRANT... |
Software distributed under the License is distributed on an " AS IS " basis , WITHOUT
The Original Software is
WILBUR2 : Nokia Semantic Web Toolkit for CLOS
Copyright ( c ) 2001 - 2005 Nokia and others . All Rights Reserved .
Portions Copyright ( c ) 1989 - 1992 . All Rights Reserved .
Cont... |
11da9559ac0fc9d9f640c65d80d378088ba3fa812b8d57c12c243270939dd8b0 | mejgun/haskell-tdlib | DownloadFile.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.DownloadFile where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
data Dow... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/DownloadFile.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
| Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offs... |
module TD.Query.DownloadFile where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data DownloadFile = DownloadFile
synchronous :: Maybe Bool,
| Number of bytes which need to be downloaded starting from the " offset " position before the download will automat... |
c2d968f631c906e63e77e22183ab6dd985547ac31096fd42b4ee7895dadc0136 | whalliburton/academy | common-lisp.lisp | (in-package :academy)
(defun list-all-common-lisp-symbols ()
(loop for symbol being each external-symbol in :cl
for is-function = (handler-case (symbol-function symbol) (undefined-function () ()))
when is-function
collect symbol into functions
when (not is-function)
collect sy... | null | https://raw.githubusercontent.com/whalliburton/academy/87a1a13ffbcd60d8553e42e647c59486c761e8cf/common-lisp.lisp | lisp | (in-package :academy)
(defun list-all-common-lisp-symbols ()
(loop for symbol being each external-symbol in :cl
for is-function = (handler-case (symbol-function symbol) (undefined-function () ()))
when is-function
collect symbol into functions
when (not is-function)
collect sy... | |
43b799a14fa2c9a4c76997cf50257fb5d109189e8267c308c00091b15b078972 | arcfide/oleg | html-parser.scm | An example of using the SSAX library : a permissive HTML parser
;
; IMPORT
The following is a Bigloo - specific module declaration .
; Other Scheme systems have something similar.
; (module permissive-HTML-parser
; (include "myenv-bigloo.scm")
( include " srfi-13-local.scm " ) ; or import from SRFI-13 if availa... | null | https://raw.githubusercontent.com/arcfide/oleg/c6826870436925fd4c873c01d7fcc24a7a7f95dc/ssax/examples/html-parser.scm | scheme |
IMPORT
Other Scheme systems have something similar.
(module permissive-HTML-parser
(include "myenv-bigloo.scm")
or import from SRFI-13 if available
(include "char-encoding.scm")
(include "util.scm")
(include "look-for-str.scm")
(include "input-parse.scm")
(include "SSAX-code.scm"))
To satisfy SSAX imp... | An example of using the SSAX library : a permissive HTML parser
The following is a Bigloo - specific module declaration .
$ I d : html - parser.scm , v 1.4 2003/04/09 21:27:52 oleg Exp $
(define parser-error error)
(define ssax:warn cerr)
(define doc
"<html> <head> <title> </title> <title> whatever </title> </... |
99c61765daf21ad0031f09aad3b8225ec0ac17c9066e6d229cfc22db622142e2 | abarbu/haskell-torch | Initialization.hs | # LANGUAGE AllowAmbiguousTypes , CPP , ConstraintKinds , DataKinds , DefaultSignatures , , DeriveGeneric , FlexibleContexts #
# LANGUAGE FlexibleInstances , FunctionalDependencies , GADTs , OverloadedLabels , OverloadedLists , OverloadedStrings #
# LANGUAGE PartialTypeSignatures , PolyKinds , QuasiQ... | null | https://raw.githubusercontent.com/abarbu/haskell-torch/03b2c10bf8ca3d4508d52c2123e753d93b3c4236/haskell-torch/src/Torch/Initialization.hs | haskell | # OPTIONS_GHC -pgmP cc -optP -E -optP -undef -optP -std=c89 #
* Initialization schemes
* Extract tensors
| Extract all of the tensors from inside a model or a layer. This is like to
parameters.
* Extract parameters
| Extract parameters from a layer or some other structure. You may also
it's the state of a syste... | # LANGUAGE AllowAmbiguousTypes , CPP , ConstraintKinds , DataKinds , DefaultSignatures , , DeriveGeneric , FlexibleContexts #
# LANGUAGE FlexibleInstances , FunctionalDependencies , GADTs , OverloadedLabels , OverloadedLists , OverloadedStrings #
# LANGUAGE PartialTypeSignatures , PolyKinds , QuasiQ... |
96a559c83e94229731d4554563d08864d5d61bab6154db25a9b8245550e018c7 | tcsprojects/pgsolver | smtsolve.mli | open Paritygame ;;
val solve : paritygame -> solution * strategy
| null | https://raw.githubusercontent.com/tcsprojects/pgsolver/b0c31a8b367c405baed961385ad645d52f648325/src/solvers/smtsolve.mli | ocaml | open Paritygame ;;
val solve : paritygame -> solution * strategy
| |
19f1ad3b29615f5fd06272602a8a897a65c91286a1696b10ba05b37d5be2a482 | hyperfiddle/electric | popover4.cljc | (ns dustin.y2022.popover4
(:require #?(:clj [datomic.api :as d])
#?(:cljs goog.events)
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.rcf :refer [tests tap % with]]
[missionary.core :as m])
#?(:cljs (:require-macros dustin.y2022.p... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/popover/popover4.cljc | clojure | popover anchor
popover body
preserve command
clear command | (ns dustin.y2022.popover4
(:require #?(:clj [datomic.api :as d])
#?(:cljs goog.events)
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.rcf :refer [tests tap % with]]
[missionary.core :as m])
#?(:cljs (:require-macros dustin.y2022.p... |
ba6609c34ce92e4aded58703a50707f511e33c0feaee63167cd6aa27a18395a6 | jesperes/aoc_erlang | aoc2021_day24.erl | -module(aoc2021_day24).
-behavior(aoc_puzzle).
-export([parse/1, solve/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 24,
name = "Arithmeti... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/7d987f3d980f59cbdc7b7393162b65ed64a50157/src/2021/aoc2021_day24.erl | erlang | The stack-machine trick was taken from
/
Helper functionsd | -module(aoc2021_day24).
-behavior(aoc_puzzle).
-export([parse/1, solve/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 24,
name = "Arithmeti... |
6719351dfe3dfacee6e7e1ee5d575be2412148f2d4ad25e59e5f2ded66524a89 | bmeurer/ocamljit2 | path.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/typing/path.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
type t =
Pident of Ident.... |
bf4860c6401aa20fc35a2eaad54a95665f2f3ad8ab93916ba820683f91a95156 | yetanalytics/project-persephone | profile.cljc | (ns com.yetanalytics.persephone.utils.profile
(:require [clojure.spec.alpha :as s]
[com.yetanalytics.pan.objects.profile :as pan-profile]
[com.yetanalytics.pan.objects.profiles.version :as pan-versions]
[com.yetanalytics.persephone.utils.time :as time]))
;; TODO: Move other util f... | null | https://raw.githubusercontent.com/yetanalytics/project-persephone/aba5e3c69d4dc05c3d7ca717a507a2fd2dbf1d1b/src/main/com/yetanalytics/persephone/utils/profile.cljc | clojure | TODO: Move other util functions like `pat/mapify-all` or
`pat/primary-patterns` to this namespace.
O(n) search instead of O(n log n) sorting.
latest-ts occured before newest-ts
okay since empty arrays are banned by the spec | (ns com.yetanalytics.persephone.utils.profile
(:require [clojure.spec.alpha :as s]
[com.yetanalytics.pan.objects.profile :as pan-profile]
[com.yetanalytics.pan.objects.profiles.version :as pan-versions]
[com.yetanalytics.persephone.utils.time :as time]))
(s/fdef latest-version
... |
d55bd07650784f68e8d3f089c7913110d8b0947f7fb4a0c17dfb1d62074d16ea | chef/chef_authn | chef_keyring_tests.erl | Copyright 2012 Opscode , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agre... | null | https://raw.githubusercontent.com/chef/chef_authn/2ba22845aa5d706cd4e3d5b867f0d9ca038e649a/test/chef_keyring_tests.erl | erlang |
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Check that key is unknown in ... | Copyright 2012 Opscode , 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
-module(chef_keyring_tests... |
b7d95f506c2f3501634c19a017fa33f2b9c45668af5a506fd6704dc9160615ce | dmvianna/haskellbook | Ch27-Trace.hs |
import Debug.Trace
inc = (+1)
twice = inc . inc
howManyTimes =
inc (trace "I got eval'd" (1 + 1))
+ twice (trace "I got eval'd" (1 + 1))
howManyTimes' =
let onePlusOne = trace "I got eval'd" (1 + 1)
in inc onePlusOne + twice onePlusOne
| null | https://raw.githubusercontent.com/dmvianna/haskellbook/b1fdce66283ccf3e740db0bb1ad9730a7669d1fc/src/Ch27-Trace.hs | haskell |
import Debug.Trace
inc = (+1)
twice = inc . inc
howManyTimes =
inc (trace "I got eval'd" (1 + 1))
+ twice (trace "I got eval'd" (1 + 1))
howManyTimes' =
let onePlusOne = trace "I got eval'd" (1 + 1)
in inc onePlusOne + twice onePlusOne
| |
670f4346ed0e9e7c9889c6690339eb355d820e3a5ccc3eb4acbb554e2238a37e | fourmolu/fourmolu | specialize-instance-four-out.hs | data Foo a = Foo a
data VT v m r = VT v m r
instance (Eq a) => Eq (Foo a) where
# SPECIALIZE instance ( Foo [ ( Int , Bar ) ] ) #
(==) (Foo a) (Foo b) = (==) a b
instance (Num r, V.Vector v r, Factored m r) => Num (VT v m r) where
# SPECIALIZE instance
( ( Factored m Int ) = > ( Int )
)
... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/f47860f01cb3cac3b973c5df6ecbae48bbb4c295/data/examples/declaration/signature/specialize/specialize-instance-four-out.hs | haskell | data Foo a = Foo a
data VT v m r = VT v m r
instance (Eq a) => Eq (Foo a) where
# SPECIALIZE instance ( Foo [ ( Int , Bar ) ] ) #
(==) (Foo a) (Foo b) = (==) a b
instance (Num r, V.Vector v r, Factored m r) => Num (VT v m r) where
# SPECIALIZE instance
( ( Factored m Int ) = > ( Int )
)
... | |
8a4735295c5ff2304ff22d9930a43e4ea0e0e2af3cf5a04fd94effe028d6ff02 | ludat/conferer | CLIArgs.hs | -- |
Copyright : ( c ) 2019
-- License: MPL-2.0
Maintainer : < >
-- Stability: stable
-- Portability: portable
--
-- Command line arguments based source
module Conferer.Source.CLIArgs where
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Maybe (mapMaybe)
import System.Environment (get... | null | https://raw.githubusercontent.com/ludat/conferer/13af5727c3b34779e87a1bdb4b0f247581ce4bc4/packages/conferer/src/Conferer/Source/CLIArgs.hs | haskell | |
License: MPL-2.0
Stability: stable
Portability: portable
Command line arguments based source
| This source provides keys from the command line arguments passed into
the program. It only accepts arguments with @--@ and an equals, for
example: @./awesomeapp --warp.port=5000@
| Type alias for cli args
| Creat... | Copyright : ( c ) 2019
Maintainer : < >
module Conferer.Source.CLIArgs where
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Maybe (mapMaybe)
import System.Environment (getArgs)
import Conferer.Source
import qualified Conferer.Source.InMemory as InMemory
import Data.List (intercalate... |
dc2dab19457dcbe808a099f20bf76d97c8da6a11613f080cced35ff36b20e71f | ermine/sulci | plugin_markov_dbm.ml |
* ( c ) 2004 - 2010
* (c) 2004-2010 Anastasia Gornostaeva
*)
open XMPP
open JID
open Hooks
open Muc
exception Result of string
module Index = Map.Make(String)
let () = Random.self_init ()
let open_markovdb path (lnode, ldomain) =
if not (Sys.file_exists path) then Unix.mkdir path 0o755;
let file = Fi... | null | https://raw.githubusercontent.com/ermine/sulci/3ee4bd609b01e2093a6d37bf74579728d0a93b70/src/plugin_markov_dbm.ml | ocaml |
* ( c ) 2004 - 2010
* (c) 2004-2010 Anastasia Gornostaeva
*)
open XMPP
open JID
open Hooks
open Muc
exception Result of string
module Index = Map.Make(String)
let () = Random.self_init ()
let open_markovdb path (lnode, ldomain) =
if not (Sys.file_exists path) then Unix.mkdir path 0o755;
let file = Fi... | |
e7af5ab9ded10c801e83f870240bb9b4a2a6f919389ff9e6cc577ed57aa5e6ef | awslabs/s2n-bignum | bignum_modoptneg.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/arm/proofs/bignum_modoptneg.ml | ocaml | =========================================================================
Optional modular negation of bignum.
=========================================================================
*** print_literal_from_elf "arm/generic/bignum_modoptneg.o";;
***
arm_CSETM X2 Condition_N... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_modoptneg_mc =
define_assert_from_elf "bignum_modoptn... |
5801cc2c6188d8aa084b9f2b89a764c9a182e338db2e4e3f47753524eb83a4e4 | futurice/haskell-mega-repo | AddEmployeeToGroup.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
{-# LANGU... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/9d9af11c5f2a2925e7385a47452b8659253d71f4/fum-carbon-app/src/Futurice/App/FUM/Command/AddEmployeeToGroup.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators # | # LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
module Futurice.App.FUM.Command.AddEmployeeToGroup (AddEmployeeToGroup) where
import Control.Lens (contains, (.=))
import Futurice.Generics
import Futurice.Prelude
import Prelude ()
... |
5c649f8f6bea46d7340cbf802d115460aaf8ab0d8501236e474c2fea185d1340 | gafiatulin/codewars | ALaCarte 2.hs | -- Data Types à la Carte
--
# LANGUAGE TypeOperators , DeriveFunctor , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances , FlexibleContexts #
module ALaCarte where
-- Definitions
newtype Expr f = In (f (Expr f))
-- We define a separate data type for each constructor we want to use
-- then we can combine them tog... | null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/3%20kyu/ALaCarte%202.hs | haskell | Data Types à la Carte
Definitions
We define a separate data type for each constructor we want to use
then we can combine them together using the (:+:) operator to make
our data types à la carte.
By defining functor instances we can write a generic fold operator
which will be useful to evaluate our expressions.... |
# LANGUAGE TypeOperators , DeriveFunctor , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances , FlexibleContexts #
module ALaCarte where
newtype Expr f = In (f (Expr f))
newtype Lit a = Lit Int
data Add a = Add a a
data (f :+: g) e = Inl (f e) | Inr (g e)
infixr 1 :+:
instance Functor Lit where
fmap f (Li... |
007ba3e1cf5897ec2200da5052223292f06a9d4d25d7da02907f41d6ea588c89 | erlcloud/erlcloud | erlcloud_ecs_container_credentials.erl | -module(erlcloud_ecs_container_credentials).
-include("erlcloud.hrl").
-include("erlcloud_aws.hrl").
-export([get_container_credentials/1]).
%%%---------------------------------------------------------------------------
-spec get_container_credentials( Config :: aws_config() ) -> {ok, binary()} | {error, container_c... | null | https://raw.githubusercontent.com/erlcloud/erlcloud/d1d60130929436b5524a0e70ae17f6da6a2a14b9/src/erlcloud_ecs_container_credentials.erl | erlang | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
This convenience function will retrieve the credentials from the AWS metadata available at
${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}
| -module(erlcloud_ecs_container_credentials).
-include("erlcloud.hrl").
-include("erlcloud_aws.hrl").
-export([get_container_credentials/1]).
-spec get_container_credentials( Config :: aws_config() ) -> {ok, binary()} | {error, container_credentials_unavailable | erlcloud_aws:httpc_result_error()}.
@doc Retrieve th... |
8e8cb3b98ce9d4e153e908584937e349ba7c4dc7bf128f09a244cad5b19a7488 | huangz1990/real-world-haskell-cn | Adler32.hs | file : ch04 / Adler32.hs
import Data.Char (ord)
import Data.Bits (shiftL, (.&.), (.|.))
base = 65521
adler32 xs = helper 1 0 xs
where helper a b (x:xs) = let a' = (a + (ord x .&. 0xff)) `mod` base
b' = (a' + b) `mod` base
in helper a' b' xs
... | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch04/Adler32.hs | haskell | file : ch04 / Adler32.hs
import Data.Char (ord)
import Data.Bits (shiftL, (.&.), (.|.))
base = 65521
adler32 xs = helper 1 0 xs
where helper a b (x:xs) = let a' = (a + (ord x .&. 0xff)) `mod` base
b' = (a' + b) `mod` base
in helper a' b' xs
... | |
55f96bf3ae0c059fcc8d6051620ff683734ca1f8e1c90d38739a7a183005ac01 | fulcrologic/semantic-ui-wrapper | ui_container.cljc | (ns com.fulcrologic.semantic-ui.elements.container.ui-container
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Container" :as Container])))
(def ui-container
"A container limits content to a maximum width.
Props:
- as (elementType): An element type to re... | null | https://raw.githubusercontent.com/fulcrologic/semantic-ui-wrapper/7bd53f445bc4ca7e052c69596dc089282671df6c/src/main/com/fulcrologic/semantic_ui/elements/container/ui_container.cljc | clojure | (ns com.fulcrologic.semantic-ui.elements.container.ui-container
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Container" :as Container])))
(def ui-container
"A container limits content to a maximum width.
Props:
- as (elementType): An element type to re... | |
7baebf1184ea812483155485eed09655ca66685838da7515d3efb5d5da82795c | clojure-emacs/refactor-nrepl | rebuild.clj | (ns refactor-nrepl.ns.rebuild
(:require
[clojure.string :as str]
[refactor-nrepl.config :as config]
[refactor-nrepl.core :refer [prefix prefix-form? suffix]]
[refactor-nrepl.util :as util]))
(defn- assert-single-alias
[libspecs alias]
(for [libspec libspecs
:let [libspec-alias (:as libspec)]]... | null | https://raw.githubusercontent.com/clojure-emacs/refactor-nrepl/3824d33e3ef2cfeb56d689f2c9d032581af61c27/src/refactor_nrepl/ns/rebuild.clj | clojure | penalize prefix forms so [foo.bar :as bar]
return the forms with no conditionals.
otherwise if we have *both* clj and cljs form (but they're different),
or just one or the other, generate a splicing conditional form. | (ns refactor-nrepl.ns.rebuild
(:require
[clojure.string :as str]
[refactor-nrepl.config :as config]
[refactor-nrepl.core :refer [prefix prefix-form? suffix]]
[refactor-nrepl.util :as util]))
(defn- assert-single-alias
[libspecs alias]
(for [libspec libspecs
:let [libspec-alias (:as libspec)]]... |
c8b8a571c80c930e3331ee3fbb4442fb2b212b0a440c32f0e50872879192cf45 | gelisam/giggles-is-you | Display.hs |
module Graphics.Gloss.Data.Display
(Display(..))
where
-- | Describes how Gloss should display its output.
data Display
-- | Display in a window with the given name, size and position.
= InWindow String (Int, Int) (Int, Int)
-- | Display full screen.
| FullScreen
der... | null | https://raw.githubusercontent.com/gelisam/giggles-is-you/6487120b219bad80ff87a43f1d7d9fb97d17dfb5/gloss/Graphics/Gloss/Data/Display.hs | haskell | | Describes how Gloss should display its output.
| Display in a window with the given name, size and position.
| Display full screen. |
module Graphics.Gloss.Data.Display
(Display(..))
where
data Display
= InWindow String (Int, Int) (Int, Int)
| FullScreen
deriving (Eq, Read, Show)
|
e1181ae08e34d565d0041e3d429ecfabddbdff0ed643160801bc04f23eb19a34 | LdBeth/star-lisp | sim.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : ( * SIM - I COMMON - LISP - GLOBAL ) ; Base : 10 ; Muser : yes -*-
(in-package :*sim-i)
;;;> *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
;;;>
;;;> The Thinking Machines *Lisp Simulator is in the public domain.
;;;> Yo... | null | https://raw.githubusercontent.com/LdBeth/star-lisp/034fb97fe8780d6e9fbff7c1d8c4a6b8c331797b/source/sim.lisp | lisp | Syntax : COMMON - LISP ; Package : ( * SIM - I COMMON - LISP - GLOBAL ) ; Base : 10 ; Muser : yes -*-
> *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
>
> The Thinking Machines *Lisp Simulator is in the public domain.
> You are free to do whatever you like with it, including ... |
(in-package :*sim-i)
This will copy the contents of a pvar into another pvar conditionally
(defun *copy-pvar (dest-pvar source-pvar)
(simple-pvar-argument!! dest-pvar source-pvar)
(safety-check (new-pvar-check source-pvar '*set))
(safety-check (new-pvar-check-lvalue dest-pvar '*set))
(let ((des... |
f03697426942396020ef4625721afd9c25e19572fa9534bfe3e00bb9aca3520f | ghc/packages-base | Ix.hs | # LANGUAGE Trustworthy #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Ix
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : stable
-- Portability ... | null | https://raw.githubusercontent.com/ghc/packages-base/52c0b09036c36f1ed928663abb2f295fd36a88bb/Data/Ix.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Ix
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : stable
Portability : portable
The 'Ix' class is used to map a contiguous subrange of values in
type onto integers... | # LANGUAGE Trustworthy #
Copyright : ( c ) The University of Glasgow 2001
module Data.Ix
(
Ix
( range
, index
, inRange
, rangeSize
)
Ix Int
Ix Integer
Ix Bool
is the same numbering defined by the ' ' class . For example , given
> ... |
e174c63e8201b26aa78d50ee64eee0dd5199396f10f2c54d62009b4526351473 | albertoruiz/easyVision | Normalization.hs | -----------------------------------------------------------------------------
|
Module : Contours . Normalization
Copyright : ( c ) 2007 - 11
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Shape normalization and whitening .
Module : C... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/contours/contours/src/Contours/Normalization.hs | haskell | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
| Mean and covariance matrix of a continuous piecewise-linear contour.
^ closed polyline
| Mean and covariance matrix of the boundary of a continuous piecewise-linea... | |
Module : Contours . Normalization
Copyright : ( c ) 2007 - 11
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Shape normalization and whitening .
Module : Contours.Normalization
Copyright : (c) Alberto Ruiz 2007-11
License : G... |
902f706f5d0df12727c9acba419d988643404f6503a1c85ae66f02ffb83a5a8d | gregnwosu/haskellbook | Lib.hs | {-# LANGUAGE OverloadedStrings #-}
module Lib
( someFunc
) where
import Web.Scotty
import Data.Monoid (mconcat)
-- works if you go to :3000/word?word=3
someFunc :: IO ()
someFunc = scotty 3000 $
get ":/word" $ do
beam <- param "word"
html (mconcat
["<h1>Scottty, ",
beam,
"me up! </... | null | https://raw.githubusercontent.com/gregnwosu/haskellbook/b21fb6772e58f07cff334d9c551d0477ec856897/chapter19/scottymonoid/src/Lib.hs | haskell | # LANGUAGE OverloadedStrings #
works if you go to :3000/word?word=3 | module Lib
( someFunc
) where
import Web.Scotty
import Data.Monoid (mconcat)
someFunc :: IO ()
someFunc = scotty 3000 $
get ":/word" $ do
beam <- param "word"
html (mconcat
["<h1>Scottty, ",
beam,
"me up! </h1>"
])
|
d00e95f336cc018811d30bc948f86f48b7e84b9e60d691a3bdfc78f885127f65 | masateruk/micro-caml | int_op3.ml | let () =
let rec print_fst x y = print_int x in
print_fst (1 + -1) (10 + -9)
| null | https://raw.githubusercontent.com/masateruk/micro-caml/0c0bd066b87cf54ce33709355c422993a85a86a1/test/int_op3.ml | ocaml | let () =
let rec print_fst x y = print_int x in
print_fst (1 + -1) (10 + -9)
| |
0a90f14d8eb68b1a7802aa428b476a93213474159c6c3c073d4e106f32f6e9c8 | RyanGlScott/text-show | ApplicativeSpec.hs | |
Module : Spec . Control . ApplicativeSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for data types in the " Control . Applicative " module .
Module: Spec.Control.Applica... | null | https://raw.githubusercontent.com/RyanGlScott/text-show/5ea297d0c7ae2d043f000c791cc12ac53f469944/tests/Spec/Control/ApplicativeSpec.hs | haskell | |
Module : Spec . Control . ApplicativeSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for data types in the " Control . Applicative " module .
Module: Spec.Control.Applica... | |
8beb32a68de9d3d35a18d498284b27fbd282d33d3485b325692789cbc3425d14 | mentat-collective/emmy | indexed_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.calculus.indexed-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[emmy.calculus.basis :as b]
[emmy.calculus.coordinate :refer [let-coordinates]]
[emmy.calculus.form-field :as... | null | https://raw.githubusercontent.com/mentat-collective/emmy/535b237a8e3fd7067b9c0ade8b2a4b3419f9f132/test/emmy/calculus/indexed_test.cljc | clojure | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.calculus.indexed-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[emmy.calculus.basis :as b]
[emmy.calculus.coordinate :refer [let-coordinates]]
[emmy.calculus.form-field :as... | |
2479a458bb8b8263a31f337ac5f76392178f40dc8517bdfca959953cca6dffde | nasser/magic | numbers.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; 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
; ... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/tests/clojure/test_clojure/numbers.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
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 terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
scgilardi ( gmail )
Created 30 October 2008
(ns clojure.test-clojure.numbers
(:use clojure.test
#_ [clojure.test.generative :exclude (is)]
clojure.template)
(:require #_ [clojure.data.generators :as gen]
[clojure.test-he... |
74fd4a676d4f3df1bf82568a499aaa3eabcadb2979acfbb5e7063be67db0c0bd | mfelleisen/RacketSchool | 0-house-direct.rkt | #lang racket
(require "gui.rkt"
"ops.rkt")
;(form Box1HouseOwning
[ hasSoldHouse " Did you sell a house in 2010 ? " boolean - widget ]
[ hasBoughtHouse " Did you buy a house in 2010 ? " boolean - widget ]
; [hasMaintLoan "Did you enter a loan for maintenance/reconstruction?" boolean-widget]... | null | https://raw.githubusercontent.com/mfelleisen/RacketSchool/ada599f31d548a538a37d998b32d80aa881d699a/Plan/ql/0-house-direct.rkt | racket | (form Box1HouseOwning
[hasMaintLoan "Did you enter a loan for maintenance/reconstruction?" boolean-widget]
[sellingPrice "Price the house was sold for:" money-widget]
[privateDebt "Private debts for the sold house:" money-widget]
guard
not a computed field
guard
guard | #lang racket
(require "gui.rkt"
"ops.rkt")
[ hasSoldHouse " Did you sell a house in 2010 ? " boolean - widget ]
[ hasBoughtHouse " Did you buy a house in 2010 ? " boolean - widget ]
( when hasSoldHouse
[ valueResidue " Value residue : " money - widget ( -/coerce sellingPrice priv... |
79a017e567d22147a65caab39f653ecda8a95bf33aee4562d5d5310ba1e4832d | michaelklishin/langohr | channel_test.clj | Copyright ( c ) 2011 - 2020 , , and the ClojureWerkz Team
;;
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; 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... | null | https://raw.githubusercontent.com/michaelklishin/langohr/0c63ac3c6bc97d73e290ed366e9e97e07d39dedb/test/langohr/test/channel_test.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 terms of this license.
You must not remove this notice, or any other, from this software. | Copyright ( c ) 2011 - 2020 , , and the ClojureWerkz Team
Eclipse Public License 1.0 ( -1.0.php )
(ns langohr.test.channel-test
(:require [langohr.core :as lc]
[langohr.channel :as lch]
[clojure.test :refer [deftest is]])
(:import com.rabbitmq.client.Connection))
(deftest test-... |
175582dfb1092dbb27b6dfcc9379815ba85e068001e304f8ad8a18324bfe5f18 | chrissound/XMonadLayouts | WindowColumn.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module WindowColumn where
import XMonad
import WindowCoordinates
import Data.List
import Types
windowPositionToWindow :: WindowPosition -> [Rectangle] -> Rectangle
windowPositionToWindow wp r = case (wColumn wp, wDirection wp) of
(Type... | null | https://raw.githubusercontent.com/chrissound/XMonadLayouts/e1327f0658418fd605660da1420ab661a3238498/lib/WindowColumn.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module WindowColumn where
import XMonad
import WindowCoordinates
import Data.List
import Types
windowPositionToWindow :: WindowPosition -> [Rectangle] -> Rectangle
windowPositionToWindow wp r = case (wColumn wp, wDirection wp) of
(Type... | |
cbc099826e232a73e094311e9175c79c69ad1c9d2ffece4c0fc2e01448845803 | zippy/anansi | xmpp_bridge_out.clj | (ns anansi.test.streamscapes.channels.xmpp-bridge-out
(:use [anansi.streamscapes.channels.xmpp-bridge-out] :reload)
(:use [anansi.ceptr]
[anansi.receptor.scape]
[anansi.receptor.user :only [user-def]]
[anansi.streamscapes.streamscapes]
[anansi.streamscapes.contact :only [contact-def]... | null | https://raw.githubusercontent.com/zippy/anansi/881aa279e5e7836f3002fc2ef7623f2ee1860c9a/test/anansi/test/streamscapes/channels/xmpp_bridge_out.clj | clojure | (ns anansi.test.streamscapes.channels.xmpp-bridge-out
(:use [anansi.streamscapes.channels.xmpp-bridge-out] :reload)
(:use [anansi.ceptr]
[anansi.receptor.scape]
[anansi.receptor.user :only [user-def]]
[anansi.streamscapes.streamscapes]
[anansi.streamscapes.contact :only [contact-def]... | |
d3f6122a5c9919fd956a7bcb1278de881ea98f24968da3ad935f82e0e9b71d7d | pjotrp/guix | databases.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2012 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2014 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/databases.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2012 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2014 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received ... |
30751808d76ee22b5928396e7c82c868f748369a8b7bdeec58fa3f227818c2b8 | clojure/core.typed | multi_utils.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; 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
;... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/src/clojure/core/typed/checker/check/multi_utils.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
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 terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns clojure.core.typed.checker.check.multi-utils
(:require [clojure.core.typed.contract-utils :as con]
[clojure.core.typed.checker.type-rep :as r]))
(defonce ^:dynamic *current-mm* nil)
(set-validator! #'*current-mm* (some-fn nil?
... |
ea32db80274d5bd38b94233b9f62f6e711ed0fcee35ace4dc4eb201c429f22ba | mbutterick/beautiful-racket | main.rkt | #lang pl-checklist-lang-maker | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/pl-checklist-demo/main.rkt | racket | #lang pl-checklist-lang-maker | |
d7fe939b4e83f65a5793f87d6e3be1d71e6f3e5556aafa535a49e7c7bc1f61cb | haskell/text | Search.hs | -- | Search for a pattern in a file, find the number of occurrences
--
-- Tested in this benchmark:
--
-- * Searching all occurrences of a pattern using library routines
--
module Benchmarks.Search
( initEnv
, benchmark
) where
import Test.Tasty.Bench (Benchmark, bench, bgroup, whnf)
import qualified Data.... | null | https://raw.githubusercontent.com/haskell/text/7b13f15ded23953d5b52b9e74bfe7e2cbc8bb692/benchmarks/haskell/Benchmarks/Search.hs | haskell | | Search for a pattern in a file, find the number of occurrences
Tested in this benchmark:
* Searching all occurrences of a pattern using library routines
| module Benchmarks.Search
( initEnv
, benchmark
) where
import Test.Tasty.Bench (Benchmark, bench, bgroup, whnf)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.IO as TL
type Env = (T.Text, TL.Text)
initEnv :: FilePat... |
3490d6865504de0a881061b2fe166e5b037d89b91ab35b18e2cae00e309f413b | Asana/kraken | kraken_memcached.erl | %% @doc Synchronous TCP Client Interface based on the Memcached protocol so that
%% we can use existing Memcached clients. This protocol may seem a little
%% counter intuitive but that is because we want it to map cleanly to the
%% Memcached protocol. For example, our own protocol would have single line
SUBSCRIBE and... | null | https://raw.githubusercontent.com/Asana/kraken/51c7a2e334b6f40d7e3614b991dd3c877a07e6dc/src/kraken_memcached.erl | erlang | @doc Synchronous TCP Client Interface based on the Memcached protocol so that
we can use existing Memcached clients. This protocol may seem a little
counter intuitive but that is because we want it to map cleanly to the
Memcached protocol. For example, our own protocol would have single line
the number of bytes.
... | SUBSCRIBE and UNSUBSCRIBE operations such that we would n't need to include
Request : " set register 0 0 0\r\n\r\n "
stores the current serial number from each rouer shard in the waitress
" STORED\r\n "
the client to new topics without changing the existing
" STORED\r\n "
the client from... |
71f799771da443e0aecef23b15dcbd1904af838e4e3f93818d9a6494ca9f53bb | snaiper80/hashids-erlang | hashid_testsuites_tests.erl | -module(hashid_testsuites_tests).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-define(PARAMSTRING_REGEX, "#\\s+salt:\\s+'([^']*)'\\s+min_len:\\s+(\\d+)\\s+alphabet:\\s+(?:'([^']+)'|(<default>))$").
setup() ->
ok.
teardown(_) ->
ok.
make_tests_from_file(FileName) ->
BaseFiles = filelib:wildca... | null | https://raw.githubusercontent.com/snaiper80/hashids-erlang/c6bb42ade888558635c01b40f16d1efbebd48632/test/hashid_testsuites_tests.erl | erlang | -module(hashid_testsuites_tests).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-define(PARAMSTRING_REGEX, "#\\s+salt:\\s+'([^']*)'\\s+min_len:\\s+(\\d+)\\s+alphabet:\\s+(?:'([^']+)'|(<default>))$").
setup() ->
ok.
teardown(_) ->
ok.
make_tests_from_file(FileName) ->
BaseFiles = filelib:wildca... | |
61ec6455c9766cb29f47da13e13243853bc8de125f49a3b1a8c70b3b349fa3a5 | dnaeon/clingon | test-package.lisp | Copyright ( c ) 2021 Nikolov < >
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
1 . Redistributions of source code must retain the above copyright
;; notice, this list of co... | null | https://raw.githubusercontent.com/dnaeon/clingon/2b1fd889d364061c0d0fe35700004382608f9603/tests/test-package.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer
in this position and unchanged.
notice, this list of conditions and the fo... | Copyright ( c ) 2021 Nikolov < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S ) ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES... |
906e68e8bba41a3fb9ee658a9f2ae96a83d91a135316fa83a128da92aeae09db | shayne-fletcher/zen | recognizer.ml | Recognizers
Read a grammar directly as a recognizer .
Read a grammar directly as a recognizer.
*)
(* Recognizer constructors. *)
type 'a remaining =
| Remains of 'a list
| Fails
;;
(* The type of a recognizer is an abbreviation. *)
type 'a recognizer = 'a list -> 'a remaining ;;
(* The recogn... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/recognizer/recognizer.ml | ocaml | Recognizer constructors.
The type of a recognizer is an abbreviation.
The recognizer associated with epsilon always succeeds and never
consumes anything from its list-argument.
We associate the recognizer p1 orelse p2 with the disjunction of
the recognizers p1 and p2.
# ((char 'a') /* andalso */ (char 'b... | Recognizers
Read a grammar directly as a recognizer .
Read a grammar directly as a recognizer.
*)
type 'a remaining =
| Remains of 'a list
| Fails
;;
type 'a recognizer = 'a list -> 'a remaining ;;
let empty : 'a recognizer = fun toks -> Remains toks ;;
let token : ('a -> bool) -> 'a recogn... |
da867fd63105d1dea09c39ed391beba7d7f9e9babf17f13b7baeda17687f85ef | hstreamdb/hstream | FileUtils.hs | module HStream.MetaStore.FileUtils where
import Control.Exception (catch, throw, throwIO)
import Data.Aeson (FromJSON, ToJSON)
import qualified Data.Aeson as A
import qualified Data.Aeson.Text as A
import Data.Bifunctor (first)
import Data.ByteS... | null | https://raw.githubusercontent.com/hstreamdb/hstream/125d9982d47874aee5e33324b55689d64bd664c2/common/hstream/HStream/MetaStore/FileUtils.hs | haskell | module HStream.MetaStore.FileUtils where
import Control.Exception (catch, throw, throwIO)
import Data.Aeson (FromJSON, ToJSON)
import qualified Data.Aeson as A
import qualified Data.Aeson.Text as A
import Data.Bifunctor (first)
import Data.ByteS... | |
6b8267a4c65aa423ac08a3a56c10125f151da29ff5c07cc3cab8e967212a8ff0 | AccelerateHS/accelerate-examples | Spectral.hs |
module Test.Spectral (
test_spectral
) where
import Config
import Test.Framework
import Test.Spectral.BlackScholes
import Test.Spectral.SMVM
import Test.Spectral.RadixSort
import Data.Array.Accelerate.Examples.Internal
test_spectral :: Backend -> Config -> Test
test_spectral be conf =
testGroup "spectral"
... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/nofib/Test/Spectral.hs | haskell |
module Test.Spectral (
test_spectral
) where
import Config
import Test.Framework
import Test.Spectral.BlackScholes
import Test.Spectral.SMVM
import Test.Spectral.RadixSort
import Data.Array.Accelerate.Examples.Internal
test_spectral :: Backend -> Config -> Test
test_spectral be conf =
testGroup "spectral"
... | |
6a496971db525fd6205c0473a5aec82e29ae26a4f7fdb3c7c21a23f2000d8a42 | lispm/measures | unit-defs.lisp | (in-package :ms)
(eval-when (:execute :compile-toplevel :load-toplevel)
(setq *no-warnings-default-p* t)
(reset-prime-numbers)) ;; Allow reloading of this file.
;;
;; Sources:
[ NIST ]
;; Guide for the Use of the International System of Units (SI)
U.S. Department of Commerce
National Institute of Stan... | null | https://raw.githubusercontent.com/lispm/measures/84f9d746d754f0bd0c96fb1cb8602cd42904b080/source/unit-defs.lisp | lisp | Allow reloading of this file.
Sources:
Guide for the Use of the International System of Units (SI)
Measure for Measure
Littleton , Colorado , USA )
International foot, inch, yard, mile. Differs slightly
Reserve for nanometer
is defined in terms of the international foot.
It really should be the sur... | (in-package :ms)
(eval-when (:execute :compile-toplevel :load-toplevel)
(setq *no-warnings-default-p* t)
[ NIST ]
U.S. Department of Commerce
National Institute of Standards and Technology ( NIST )
NIST Special Publication 811 , 1995 Edition
[ ]
and
1996 . ISBN 1 - 889796 - 00 - X
(... |
cec09566c534261026e6bf6697137a02a3a71b22b41e38e124c627132d584518 | typelead/intellij-eta | ProjectBuildException.hs | module FFI.Org.JetBrains.JPS.Incremental.ProjectBuildException where
import P
import Data.Typeable
-- Start org.jetbrains.jps.incremental.ProjectBuildException
data ProjectBuildException = ProjectBuildException @org.jetbrains.jps.incremental.ProjectBuildException
deriving (Class, Typeable)
type instance Inherits ... | null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/main/eta/FFI/Org/JetBrains/JPS/Incremental/ProjectBuildException.hs | haskell | Start org.jetbrains.jps.incremental.ProjectBuildException
End org.jetbrains.jps.incremental.ProjectBuildException | module FFI.Org.JetBrains.JPS.Incremental.ProjectBuildException where
import P
import Data.Typeable
data ProjectBuildException = ProjectBuildException @org.jetbrains.jps.incremental.ProjectBuildException
deriving (Class, Typeable)
type instance Inherits ProjectBuildException = '[JException]
foreign import java un... |
313e3e30ed861f6b06c1da5b790d75dd9ddaec904e3c713e780ecf972610f945 | uw-unsat/serval-sosp19 | base.rkt | #lang racket/base
(provide (all-defined-out))
(struct module (globals functions) #:transparent)
(struct value (name type) #:transparent)
(struct function value (arguments blocks) #:transparent)
(struct argument value () #:transparent)
(struct basic-block value (instructions) #:transparent)
(struct instruction va... | null | https://raw.githubusercontent.com/uw-unsat/serval-sosp19/175c42660fad84b44e4c9f6f723fd3c9450d65d4/serval/serval/llvm/base.rkt | racket | #lang racket/base
(provide (all-defined-out))
(struct module (globals functions) #:transparent)
(struct value (name type) #:transparent)
(struct function value (arguments blocks) #:transparent)
(struct argument value () #:transparent)
(struct basic-block value (instructions) #:transparent)
(struct instruction va... | |
3d9f2df1adbcef8b8fabe21a5b99ad0863365f245ba077616ffd6cb763cd926c | shayan-najd/QFeldspar | TemplateHaskell.hs | module QFeldspar.Expression.Utils.TemplateHaskell ((===),unQ,stripNameSpace,trmEql)
where
import Prelude
import QFeldspar.ErrorMonad
import Language.Haskell.TH.Syntax hiding (unQ)
(===) :: Name -> Name -> Bool
n1 === n2 = stripNameSpace n1 == stripNameSpace n2
unQ :: Q a -> a
unQ = frmRgt. runQ
stripNameSpace :... | null | https://raw.githubusercontent.com/shayan-najd/QFeldspar/ed60ce02794a548833317388f6e82e2ab1eabc1c/QFeldspar/Expression/Utils/TemplateHaskell.hs | haskell | module QFeldspar.Expression.Utils.TemplateHaskell ((===),unQ,stripNameSpace,trmEql)
where
import Prelude
import QFeldspar.ErrorMonad
import Language.Haskell.TH.Syntax hiding (unQ)
(===) :: Name -> Name -> Bool
n1 === n2 = stripNameSpace n1 == stripNameSpace n2
unQ :: Q a -> a
unQ = frmRgt. runQ
stripNameSpace :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.