_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 |
|---|---|---|---|---|---|---|---|---|
7e9a788d91526b045d0699a523c408787c71b794df1acfaf18d48f0d842c4d26 | sky-big/RabbitMQ | rabbit_mgmt_wm_node.erl | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITH... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-management/src/rabbit_mgmt_wm_node.erl | erlang | compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
--------------------------------------------------------------------
---... | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ Management Console .
The Initial Developer of the Original Cod... |
782022cfb93d42e891a1d287484f025e42477a932594117403da54852ac1022c | jqueiroz/lojban.io | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Server.Website.Main
( handleRoot
) where
import Core
import Serializer (personalizedExerciseToJSON, validateExerciseAnswer)
import qualified Study.Courses.English.Grammar.Introduction.Course
import qualified Study.Courses.English.Grammar.Crash.Course
import qualified Study.Co... | null | https://raw.githubusercontent.com/jqueiroz/lojban.io/68c3e919f92ea1294f32ee7772662ab5667ecef6/haskell/src/Server/Website/Main.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: consider adding breadcrumbs (/)
* Handlers |
module Server.Website.Main
( handleRoot
) where
import Core
import Serializer (personalizedExerciseToJSON, validateExerciseAnswer)
import qualified Study.Courses.English.Grammar.Introduction.Course
import qualified Study.Courses.English.Grammar.Crash.Course
import qualified Study.Courses.English.Vocabulary.Attitudina... |
16769ee90dfe01fada030708fd03217d068c0ade9e0f0b147998db2e82e69c47 | KULeuven-CS/CPL | 1.21.rkt | #lang eopl
(require rackunit)
ex 1.21
(define product
(lambda (sos1 sos2)
(if (null? sos1)
'()
(append (subproduct (car sos1) sos2) (product (cdr sos1) sos2)))))
(define subproduct
(lambda (s sos2)
(if (null? sos2)
'()
(cons (list s (car sos2)) (subproduct s (cdr ... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter1/1.21.rkt | racket | #lang eopl
(require rackunit)
ex 1.21
(define product
(lambda (sos1 sos2)
(if (null? sos1)
'()
(append (subproduct (car sos1) sos2) (product (cdr sos1) sos2)))))
(define subproduct
(lambda (s sos2)
(if (null? sos2)
'()
(cons (list s (car sos2)) (subproduct s (cdr ... | |
6d96e05b49795013dea0b016d07488b27cc76c32daa3e5c88ed297ee6ed0720c | Gabriella439/nix-diff | Utils.hs | # LANGUAGE RecordWildCards #
{-# LANGUAGE OverloadedStrings #-}
module Golden.Utils where
import qualified Data.ByteString.Lazy.Char8 as BS
import qualified Data.Set
import qualified Control.Monad.Reader
import qualified Control.Monad.State
import Control.Monad (unless)
import Control.Exception ( throwIO, ErrorCall(E... | null | https://raw.githubusercontent.com/Gabriella439/nix-diff/8d365e5e8fe9d86add59aab07f79d05ca51d6ade/test/Golden/Utils.hs | haskell | # LANGUAGE OverloadedStrings #
drop new-line char
drop new-line char | # LANGUAGE RecordWildCards #
module Golden.Utils where
import qualified Data.ByteString.Lazy.Char8 as BS
import qualified Data.Set
import qualified Control.Monad.Reader
import qualified Control.Monad.State
import Control.Monad (unless)
import Control.Exception ( throwIO, ErrorCall(ErrorCall) )
import System.Process.T... |
9951f927d6faaf6f30287b7aae3967a5d51a755255d345d3dff5afcfc7e3d272 | hiroshi-unno/coar | constDatatype.ml | open Core
open LogicOld
let name_of_sel cons_name i = sprintf "%s#%d" cons_name i
let unit_dt =
let dt = Datatype.create "unit" [Datatype.mk_dt "unit" []] Datatype.FDt in
Datatype.add_cons dt (Datatype.mk_cons "()")
let option_dt =
let param = Sort.mk_fresh_svar () in
let dt = Datatype.create "option" [Datat... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/ast/constDatatype.ml | ocaml | |> Map.Poly.add_exn ~key:"exn" ~data:exn_dt | open Core
open LogicOld
let name_of_sel cons_name i = sprintf "%s#%d" cons_name i
let unit_dt =
let dt = Datatype.create "unit" [Datatype.mk_dt "unit" []] Datatype.FDt in
Datatype.add_cons dt (Datatype.mk_cons "()")
let option_dt =
let param = Sort.mk_fresh_svar () in
let dt = Datatype.create "option" [Datat... |
40b46fcd1f2ae85a65061b07411be596d40c16f448a588323ac5ebd57762cd83 | xvw/preface | arrow_choice.ml | open QCheck2
module Suite
(R : Model.PROFUNCTORIAL)
(P : Preface_specs.ARROW_CHOICE with type ('a, 'b) t = ('a, 'b) R.t)
(A : Model.T0)
(B : Model.T0)
(C : Model.T0)
(D : Model.T0) =
struct
module Arrow = Arrow.Suite (R) (P) (A) (B) (C) (D)
module Laws = Preface_laws.Arrow_choice.For (P)
... | null | https://raw.githubusercontent.com/xvw/preface/84a297e1ee2967ad4341dca875da8d2dc6d7638c/lib/preface_qcheck/arrow_choice.ml | ocaml | open QCheck2
module Suite
(R : Model.PROFUNCTORIAL)
(P : Preface_specs.ARROW_CHOICE with type ('a, 'b) t = ('a, 'b) R.t)
(A : Model.T0)
(B : Model.T0)
(C : Model.T0)
(D : Model.T0) =
struct
module Arrow = Arrow.Suite (R) (P) (A) (B) (C) (D)
module Laws = Preface_laws.Arrow_choice.For (P)
... | |
9eddc1df69d892a10b68a6d1753feea17eeb95bc652e6d75bbc501e7bbe26a54 | WhatsApp/erlt | str3.erl | -file("dev/src/str3.erlt", 1).
-module(str3).
-eqwalizer_unchecked([{mk_str2, 0}, {mk_str3, 0}]).
-export_type([str3/0]).
-export([mk_str2/0, mk_str3/0]).
-type str3() :: {'$#str3:str3', str2:str2()}.
mk_str2() -> {'$#str2:str2', {'$#str1:str1', 0}}.
mk_str3() ->
{'$#str3:str3', {'$#str2:str2', {'$#str1:str1... | null | https://raw.githubusercontent.com/WhatsApp/erlt/616a4adc628ca8754112e659701e57f1cd7fecd1/tests/dev/ir-spec/str3.erl | erlang | -file("dev/src/str3.erlt", 1).
-module(str3).
-eqwalizer_unchecked([{mk_str2, 0}, {mk_str3, 0}]).
-export_type([str3/0]).
-export([mk_str2/0, mk_str3/0]).
-type str3() :: {'$#str3:str3', str2:str2()}.
mk_str2() -> {'$#str2:str2', {'$#str1:str1', 0}}.
mk_str3() ->
{'$#str3:str3', {'$#str2:str2', {'$#str1:str1... | |
19a0e700ae9ab734e04033a169f8babe9c5cabd8a6fb2db2b32e33361f6de9f0 | realworldocaml/book | virtual_rules.ml | open Import
module Pp_spec : sig
type t
val make :
Preprocess.Without_instrumentation.t Preprocess.t Module_name.Per_item.t
-> Ocaml.Version.t
-> t
val pped_module : t -> Module.t -> Module.t
end = struct
type t = (Module.t -> Module.t) Module_name.Per_item.t
let make preprocess v =
Mod... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_rules/virtual_rules.ml | ocaml | open Import
module Pp_spec : sig
type t
val make :
Preprocess.Without_instrumentation.t Preprocess.t Module_name.Per_item.t
-> Ocaml.Version.t
-> t
val pped_module : t -> Module.t -> Module.t
end = struct
type t = (Module.t -> Module.t) Module_name.Per_item.t
let make preprocess v =
Mod... | |
2d35e1ce23cfd96b8eed0d7ecfa2d46e3ccb656e67120290a766650d6bdca50f | futurice/haskell-mega-repo | Classes.hs | -- |
Copyright : ( c ) 2015 Futurice Oy
-- License : BSD3
Maintainer : < >
--
-- Various classes, and re-exports of often used ones.
module PlanMill.Classes (
HasPlanMillCfg (..),
MonadCRandom(..),
ContainsCryptoGenError,
CRandT,
evalCRandT,
MonadTime(..),
) where
import PlanMill.I... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/planmill-client/src/PlanMill/Classes.hs | haskell | |
License : BSD3
Various classes, and re-exports of often used ones. | Copyright : ( c ) 2015 Futurice Oy
Maintainer : < >
module PlanMill.Classes (
HasPlanMillCfg (..),
MonadCRandom(..),
ContainsCryptoGenError,
CRandT,
evalCRandT,
MonadTime(..),
) where
import PlanMill.Internal.Prelude
import Futurice.CryptoRandom
(CRandT, ContainsCryptoGenError... |
a978fc9c53ee7539f2f097bb851dc00bbd849dfd5a2732a4de85c97c3bcdc376 | shiguredo/swidden | swidden_interceptor.erl | -module(swidden_interceptor).
引数なし API の事前処理
-callback preprocess(module(), function(), swidden:json_object()) ->
{continue, swidden:json_object()} |
{stop, ok} |
{stop, {ok, swidden:json_object()}} |
{stop, {redirect, binary()}} |
{stop, {error, binary()}} |
{stop, {error, binary(), map()}}.... | null | https://raw.githubusercontent.com/shiguredo/swidden/0ac3c2e3e8618d9f3bb853a7689844e6e1ecd6fd/src/swidden_interceptor.erl | erlang | 引数あり API の事前処理
事後処理 | -module(swidden_interceptor).
引数なし API の事前処理
-callback preprocess(module(), function(), swidden:json_object()) ->
{continue, swidden:json_object()} |
{stop, ok} |
{stop, {ok, swidden:json_object()}} |
{stop, {redirect, binary()}} |
{stop, {error, binary()}} |
{stop, {error, binary(), map()}}.... |
a607a5058187f37bb3dcb06854fcae45e776502af7bf42100ac5edf2ef0cbd9c | criticic/llpp | glTex.mli | $ I d : glTex.mli , v 1.8 2012 - 03 - 06 03:31:02 garrigue Exp $
open Gl
val coord : s:float -> ?t:float -> ?r:float -> ?q:float -> unit -> unit
val coord2 : float * float -> unit
val coord3 : float * float * float -> unit
val coord4 : float * float * float * float -> unit
type env_param = [
`mode of [`modulat... | null | https://raw.githubusercontent.com/criticic/llpp/04431d79a40dcc0215f87a2ad577f126a85c1e61/lablGL/glTex.mli | ocaml | $ I d : glTex.mli , v 1.8 2012 - 03 - 06 03:31:02 garrigue Exp $
open Gl
val coord : s:float -> ?t:float -> ?r:float -> ?q:float -> unit -> unit
val coord2 : float * float -> unit
val coord3 : float * float * float -> unit
val coord4 : float * float * float * float -> unit
type env_param = [
`mode of [`modulat... | |
280b5d0f846e1a0d64b8eedae4451da265caa3598099c5a6f43cd7c4ecd1fe6d | dalaing/little-languages | Pretty.hs | module Components.Type.Bool.Pretty where
import Control.Lens (preview)
import Text.PrettyPrint.ANSI.Leijen
import Common.Recursion
import Common.Type.Pretty
import Components.Type.Bool.Data
prettyTyBool :: WithBoolType ty
=> ty
-> Maybe Doc
prettyTyBool =
fmap (const . text $ "Bool") .
... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/multityped/nb-modular/src/Components/Type/Bool/Pretty.hs | haskell | module Components.Type.Bool.Pretty where
import Control.Lens (preview)
import Text.PrettyPrint.ANSI.Leijen
import Common.Recursion
import Common.Type.Pretty
import Components.Type.Bool.Data
prettyTyBool :: WithBoolType ty
=> ty
-> Maybe Doc
prettyTyBool =
fmap (const . text $ "Bool") .
... | |
40989d1260f9ed2ee41980b375603eef2f28a47b4245063a3b9d60e2736210ef | imrehg/ypsilon | paint.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk paint)
(export gtk_paint_arrow
gtk_paint_box
gtk_paint_box_gap
gtk_paint_check
gtk_paint_diamo... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/paint.scm | scheme | [end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk paint)
(export gtk_paint_arrow
gtk_paint_box
gtk_paint_box_gap
gtk_paint_check
gtk_paint_diamo... |
2a6fed408e852120631536a1cb4bc286c7edee89d2f3ab937c40e4bf4ff1a71a | Engelberg/ubergraph | alg.clj | (ns ubergraph.alg
"Contains algorithms that operate on Ubergraphs, and all the functions associated with paths"
(:require [ubergraph.core :as uber]
[ubergraph.protocols :as prots]
[potemkin :refer [import-vars]]
[clojure.core.reducers :as r]
[loom.graph :as lg]
... | null | https://raw.githubusercontent.com/Engelberg/ubergraph/1a6b326135995a44c4c7dc337602024e9a91edf6/src/ubergraph/alg.clj | clojure | Various searches for shortest paths
Path protocols
path-between Reserved for future use in all-paths algorithms
Curated loom algorithms
TBD - Looking for volunteer to analyze flow and minimum spanning tree algos
from loom and ensure correctness for graphs with parallel edges.
Used to search all possibil... | (ns ubergraph.alg
"Contains algorithms that operate on Ubergraphs, and all the functions associated with paths"
(:require [ubergraph.core :as uber]
[ubergraph.protocols :as prots]
[potemkin :refer [import-vars]]
[clojure.core.reducers :as r]
[loom.graph :as lg]
... |
b9c0a9daa7e7acc554039c5837833d4966ef977ba001bfdf55c45a6eac5b635c | mdippery/stackim | db.clj | (ns stackim.db
(:require [clojure.java.jdbc :as jdbc])
(:import [java.io File]
[java.net URI]
[java.sql BatchUpdateException]))
(def cwd
(.getCanonicalPath (File. ".")))
(def default-database-url
(str "postgres:stackim@localhost/stackim"))
(def database-url
(or (System/getenv "DATABA... | null | https://raw.githubusercontent.com/mdippery/stackim/619724836908e6127a770b404304425ad62c5660/src/stackim/db.clj | clojure | (ns stackim.db
(:require [clojure.java.jdbc :as jdbc])
(:import [java.io File]
[java.net URI]
[java.sql BatchUpdateException]))
(def cwd
(.getCanonicalPath (File. ".")))
(def default-database-url
(str "postgres:stackim@localhost/stackim"))
(def database-url
(or (System/getenv "DATABA... | |
abcbbd71551e64b60a5a53974786030fcd2ce584dfce39dbf26d51f3d2226878 | cmoid/erlbutt | ssb_feed.erl | SPDX - License - Identifier : GPL-2.0 - only
%%
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(ssb_feed).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("ssb.hrl").
-behaviour(gen_server).
%% API
-export([start_link/1]).
-export([whoami/1,
post_content/2,
stor... | null | https://raw.githubusercontent.com/cmoid/erlbutt/9e15ace3e9009c8bce6cf3251cf16e1f8611e16a/apps/ssb/src/ssb_feed.erl | erlang |
API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
=============================================================... | SPDX - License - Identifier : GPL-2.0 - only
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(ssb_feed).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("ssb.hrl").
-behaviour(gen_server).
-export([start_link/1]).
-export([whoami/1,
post_content/2,
store_msg/2,
... |
629fa1ba4a365bd19358569881db5fa36e5bc55f99174560ac42f7118b205715 | mishadoff/evolville | spawn.clj | (ns evolville.spawn
(:require [evolville.config :as config]
[evolville.creature :as creature]
[evolville.world :as w]))
(defn spawn [world [id creature]]
(let [now (System/currentTimeMillis)
last-spawn-ts (some-> creature :spawn :ts)]
(cond
;; initially make creature aware... | null | https://raw.githubusercontent.com/mishadoff/evolville/f37e7478ae6373a3b431741bd1ecaac42ea5d9f0/src/evolville/spawn.clj | clojure | initially make creature aware about spawning
if time has passed creature can spawn
nothing changes, leave the world as is | (ns evolville.spawn
(:require [evolville.config :as config]
[evolville.creature :as creature]
[evolville.world :as w]))
(defn spawn [world [id creature]]
(let [now (System/currentTimeMillis)
last-spawn-ts (some-> creature :spawn :ts)]
(cond
(nil? last-spawn-ts) (assoc-in w... |
fbd24df0b6b1c1411a40851e486f05512bdde4a4b4580a6fd0352d9ce47ce83c | ntoronto/drbayes | random-bool-set.rkt | #lang typed/racket/base
(require drbayes/private/set)
(provide (all-defined-out))
(: random-bool-set (-> Bool-Set))
(define (random-bool-set)
(booleans->bool-set ((random) . < . 0.5) ((random) . < . 0.5)))
(: random-bool (Bool-Set -> Boolean))
(define (random-bool A)
(cond [(empty-bool-set? A) (raise-argument-... | null | https://raw.githubusercontent.com/ntoronto/drbayes/e59eb7c7867118bf4c77ca903e133c7530e612a3/drbayes/tests/random-sets/random-bool-set.rkt | racket | #lang typed/racket/base
(require drbayes/private/set)
(provide (all-defined-out))
(: random-bool-set (-> Bool-Set))
(define (random-bool-set)
(booleans->bool-set ((random) . < . 0.5) ((random) . < . 0.5)))
(: random-bool (Bool-Set -> Boolean))
(define (random-bool A)
(cond [(empty-bool-set? A) (raise-argument-... | |
552c2190c27e1305c4e243494094f36463023e9307a7ab6ae047af806dc6ee9f | Workiva/eva | nodes.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/dev/src/eva/datastructures/test_version/logic/nodes.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.datastructures.test-version.logic.nodes
(:require [eva.datastructures.test-version.logic.state :as state]
[eva.datastructures.test-version.logic.protocols :as protocols :refer :all]
... |
29fd73167bb5902a9a0d8d88e4e1ad06004f8dd6c846b88f4a4a7cc0bfaa49de | clojure-interop/aws-api | core.clj | (ns core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.servermigration.core])
| null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.servermigration/src/core.clj | clojure | (ns core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.servermigration.core])
| |
7aadae359cb685823bc5e4a86e7074ef1f76bc81aee07d812b37eaa8468b2aee | silkapp/girella | HLint.hs | module HLint.HLint where
import "hint" HLint.Default
import "hint" HLint.Builtin.All
import "hint" HLint.Dollar
import " hint " HLint .
warn = return ==> pure
warn = (>>) ==> (*>)
warn = liftIO . atomically ==> atomicallyIO
| null | https://raw.githubusercontent.com/silkapp/girella/f2fbbaaa2536f1afc5bc1a493d02f92cec81da18/HLint.hs | haskell | module HLint.HLint where
import "hint" HLint.Default
import "hint" HLint.Builtin.All
import "hint" HLint.Dollar
import " hint " HLint .
warn = return ==> pure
warn = (>>) ==> (*>)
warn = liftIO . atomically ==> atomicallyIO
| |
93e25948f21053b9aacb793bed2aff9841e5f8f19ddadad7f510443426ec5c81 | vincenthz/hs-asn1 | Tests.hs | import Test.QuickCheck
import Test.Framework(defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2(testProperty)
import Text.Printf
import Data.Serialize.Put (runPut)
import Data.ASN1.Get (runGet, Result(..))
import Data.ASN1.BitArray
import Data.ASN1.Stream (ASN1(..), ASN1ConstructionType(..))
import D... | null | https://raw.githubusercontent.com/vincenthz/hs-asn1/c017c03b0f71a3b45165468a1d1028a0ed7502c0/data/Tests.hs | haskell | , Real Double
, return Enumerated | import Test.QuickCheck
import Test.Framework(defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2(testProperty)
import Text.Printf
import Data.Serialize.Put (runPut)
import Data.ASN1.Get (runGet, Result(..))
import Data.ASN1.BitArray
import Data.ASN1.Stream (ASN1(..), ASN1ConstructionType(..))
import D... |
56a986f43903c824d80940edabcdcf57d0148bae58fa62a96106fd76d802d723 | evolutics/haskell-formatter | Input.hs | commented = commented
-- ^ comment
| null | https://raw.githubusercontent.com/evolutics/haskell-formatter/3919428e312db62b305de4dd1c84887e6cfa9478/testsuite/resources/source/comments/empty_lines/between_declaration_and_comment/after/2/Input.hs | haskell | ^ comment | commented = commented
|
4a6e0b9e70a9a87c6fac0c0de56f987799522d68428373f1acf1c2c5174a82bc | herd/herdtools7 | StringSet.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/lib/StringSet.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2015 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
962b37807453ab8a84663c4cb96067ab7bf81afb3d0bacb8c99c1ff57204a449 | patricoferris/ocaml-multicore-monorepo | baijiu_keccak_256.ml | module By = Digestif_by
module Bi = Digestif_bi
module type S = sig
type ctx
type kind = [ `SHA3_256 ]
val init : unit -> ctx
val unsafe_feed_bytes : ctx -> By.t -> int -> int -> unit
val unsafe_feed_bigstring : ctx -> Bi.t -> int -> int -> unit
val unsafe_get : ctx -> By.t
val dup : ctx -> ctx
end... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/digestif/src-ocaml/baijiu_keccak_256.ml | ocaml | module By = Digestif_by
module Bi = Digestif_bi
module type S = sig
type ctx
type kind = [ `SHA3_256 ]
val init : unit -> ctx
val unsafe_feed_bytes : ctx -> By.t -> int -> int -> unit
val unsafe_feed_bigstring : ctx -> Bi.t -> int -> int -> unit
val unsafe_get : ctx -> By.t
val dup : ctx -> ctx
end... | |
9a18b52458cf9fe8589b8f0ab96ad8654c026941d16bb8817990f8ab42a6470d | airalab/hs-web3 | Compact.hs | -- |
-- Module : Codec.Scale.Compact
Copyright : 2016 - 2021
-- License : Apache-2.0
--
-- Maintainer :
-- Stability : experimental
-- Portability : noportable
--
-- Efficient general integer codec.
--
module Codec.Scale.Compact (Compact(..)) where
import Control.Monad (repli... | null | https://raw.githubusercontent.com/airalab/hs-web3/01926d3db4f4c83ecd9fc15bc4ce5bfa5c656c02/packages/scale/src/Codec/Scale/Compact.hs | haskell | |
Module : Codec.Scale.Compact
License : Apache-2.0
Maintainer :
Stability : experimental
Portability : noportable
Efficient general integer codec.
| A "compact" or general integer encoding is sufficient for encoding
values than the fixed-width version. | Copyright : 2016 - 2021
module Codec.Scale.Compact (Compact(..)) where
import Control.Monad (replicateM)
import Data.Bits (shiftL, shiftR, (.&.), (.|.))
import Data.List (unfoldr)
import Data.Serialize.Get (getWord16le, getWord32le, getWord8,
... |
56b9c4697631ecfed5cd64ddc340b8a428c0c025ca32d3992431c42eca6a7563 | kahua/Gauche-dbd-pg | pg.scm | ;;; dbd.pg - PostgreSQL driver
;;;
Copyright ( c ) 2003 - 2005 Scheme Arts , L.L.C. , All rights reserved .
Copyright ( c ) 2003 - 2005 Time Intermedia Corporation , All rights reserved .
;;; See COPYING for terms and conditions of using this software
;;;
(define-module dbd.pg
(use dbi)
(use gauche.mop.sing... | null | https://raw.githubusercontent.com/kahua/Gauche-dbd-pg/2c73feaff511157beeb8a4963be843efb2c60f9f/dbd/pg.scm | scheme | dbd.pg - PostgreSQL driver
See COPYING for terms and conditions of using this software
low-level stuff
Loads extension
public accessor
Postgres has prepared statement feature. Eventually we're going
Relation API
use call-with-iterator | Copyright ( c ) 2003 - 2005 Scheme Arts , L.L.C. , All rights reserved .
Copyright ( c ) 2003 - 2005 Time Intermedia Corporation , All rights reserved .
(define-module dbd.pg
(use dbi)
(use gauche.mop.singleton)
(use gauche.sequence)
(use scheme.list)
(export <pg-driver>
<pg-connection>
... |
829ce903e4735e0b8962660356e4d339058ed56381b76da09ce22d303866db35 | sky-big/RabbitMQ | rabbit_federation_link_util.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-federation/src/rabbit_federation_link_util.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
real
temp
----... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ Federation .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved... |
6f6cbc54f2c5e58610ae325983ac8f95f4e58b32e76f1c5d4f88a3a5a70a3bab | klutometis/clrs | 13.3-6.scm | (load "red-black-tree.scm")
(use red-black-tree test)
(let* ((root nil)
(root (insert/parents! root (make-node key: 41)))
(root (insert/parents! root (make-node key: 38)))
(root (insert/parents! root (make-node key: 31)))
(root (insert/parents! root (make-node key: 12)))
(root (inser... | null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/13/13.3-6.scm | scheme | (load "red-black-tree.scm")
(use red-black-tree test)
(let* ((root nil)
(root (insert/parents! root (make-node key: 41)))
(root (insert/parents! root (make-node key: 38)))
(root (insert/parents! root (make-node key: 31)))
(root (insert/parents! root (make-node key: 12)))
(root (inser... | |
b7a1a385bdf3911fccef5b7aa14cad9d7ef5c029dadaf4758478b6b2aea460c8 | lk-geimfari/secrets.clj | core_test.clj | (ns secrets.core-test
(:require [clojure.test :refer [deftest testing is are]]
[clojure.string :as str]
[secrets.core :as core]))
(deftest token-hex-test
(testing "Generate a random hex string"
(assert (= (count (core/token-hex)) 64))
(assert (= (count (core/token-hex 64)) 128))))
... | null | https://raw.githubusercontent.com/lk-geimfari/secrets.clj/4dc7223242766b15c02ebc131885b707ccb4b8dc/test/secrets/core_test.clj | clojure | (ns secrets.core-test
(:require [clojure.test :refer [deftest testing is are]]
[clojure.string :as str]
[secrets.core :as core]))
(deftest token-hex-test
(testing "Generate a random hex string"
(assert (= (count (core/token-hex)) 64))
(assert (= (count (core/token-hex 64)) 128))))
... | |
21c29e93eabf17efd6a92c0213f2c1425e0a1f712b374a2fdb36f8ac61dfa910 | Olical/propel | util.clj | (ns propel.util
"Useful things that don't conceptually belong to one namespace."
(:require [clojure.main :as clojure]
[clojure.pprint :as pprint])
(:import [java.net ServerSocket]))
(defn log [& msg]
(apply println "[Propel]" msg))
(defn error [err & msg]
(binding [*out* *err*]
(apply log "E... | null | https://raw.githubusercontent.com/Olical/propel/407ccf1ae507876e9a879239fac96380f2c1de2b/src/propel/util.clj | clojure | (ns propel.util
"Useful things that don't conceptually belong to one namespace."
(:require [clojure.main :as clojure]
[clojure.pprint :as pprint])
(:import [java.net ServerSocket]))
(defn log [& msg]
(apply println "[Propel]" msg))
(defn error [err & msg]
(binding [*out* *err*]
(apply log "E... | |
8a1a1f3429da3c6d51cab7b457aac413a38cc9e872ed561d0b8a38788e834261 | incoherentsoftware/defect-process | Item.hs | module Level.Room.Item
( module Level.Room.Item.Types
, mkRoomItem
) where
import Data.Dynamic (fromDynamic)
import Data.Typeable (Typeable)
import qualified Data.Set as S
import Collision.Hitbox
import Level.Room.Item.Types
import Msg
import Util
mkRoomItem :: Typeable d => RoomItemType -> d -> M... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/15f2569e7d0e481c2e28c0ca3a5e72d2c049b667/src/Level/Room/Item.hs | haskell | module Level.Room.Item
( module Level.Room.Item.Types
, mkRoomItem
) where
import Data.Dynamic (fromDynamic)
import Data.Typeable (Typeable)
import qualified Data.Set as S
import Collision.Hitbox
import Level.Room.Item.Types
import Msg
import Util
mkRoomItem :: Typeable d => RoomItemType -> d -> M... | |
05aee3a46b3b66c833c25dfb2f20b0d062cc69857dd1b0e005b92712e260c3e0 | abailly/xxi-century-typed | ParserSpec.hs | module Minilang.ParserSpec where
import qualified Data.Text as Text
import Minilang.Parser
import Test.Hspec
import Text.Parsec.Error
import Text.Parsec.Pos
spec :: Spec
spec = parallel $
describe "Minilang Parser" $ do
describe "Parsing Terms and Expressions" $ do
it "parse Number" $ do
... | null | https://raw.githubusercontent.com/abailly/xxi-century-typed/89df5eab3747ddb0ea37030ddb1947fb8c14265b/minilang/test/Minilang/ParserSpec.hs | haskell | module Minilang.ParserSpec where
import qualified Data.Text as Text
import Minilang.Parser
import Test.Hspec
import Text.Parsec.Error
import Text.Parsec.Pos
spec :: Spec
spec = parallel $
describe "Minilang Parser" $ do
describe "Parsing Terms and Expressions" $ do
it "parse Number" $ do
... | |
19f7d155eef11cbf56980d07ce13f96b299d5184fdd8c46c44f939f97ffc21a6 | oriansj/mes-m2 | firstclassops.scm | GNU --- Maxwell Equations of Software
Copyright ( C ) 2008 Kragen
;;;
This file is part of GNU .
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or ( ... | null | https://raw.githubusercontent.com/oriansj/mes-m2/b44fbc976ae334252de4eb82a57c361a195f2194/test/test063/firstclassops.scm | scheme |
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Setup output file
only nece... | GNU --- Maxwell Equations of Software
Copyright ( C ) 2008 Kragen
This file is part of GNU .
under the terms of the GNU General Public License as published by
GNU is distributed in the hope that it will be useful , but
You should have received a copy of the GNU General Public License
along with GNU... |
59aa6fa828db0283eaabb2c73252bc70ea46e0f4f2159dee1048e7dacacc2697 | janestreet/bonsai | bonsai_experimental_animation.ml | open! Core
open Bonsai.Let_syntax
open Bonsai.For_open
module _ = struct
type t = float * float [@@deriving sexp, equal]
end
module Callback = struct
type t = unit Effect.t
let sexp_of_t = sexp_of_opaque
let t_of_sexp _ = failwith "stop using tangle"
let equal = phys_equal
end
module Interpolator = struct... | null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/experimental/animation/src/bonsai_experimental_animation.ml | ocaml | open! Core
open Bonsai.Let_syntax
open Bonsai.For_open
module _ = struct
type t = float * float [@@deriving sexp, equal]
end
module Callback = struct
type t = unit Effect.t
let sexp_of_t = sexp_of_opaque
let t_of_sexp _ = failwith "stop using tangle"
let equal = phys_equal
end
module Interpolator = struct... | |
8969e378c45c44c04f1dac5f64a61b1336abdbfff71b15100418e0f9bae5fecc | grin-compiler/ghc-wpc-sample-programs | Treeless.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE PatternSynonyms #
-- | The treeless syntax is intended to be used as input for the compiler backends.
It is more low - level than Internal syntax and is not used for type checking .
--
-- Some of the features of treeless syntax are:
-- - case expressions instead of case... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/Syntax/Treeless.hs | haskell | # LANGUAGE DeriveDataTypeable #
| The treeless syntax is intended to be used as input for the compiler backends.
Some of the features of treeless syntax are:
- case expressions instead of case trees
- no instantiated datatypes / constructors
| The treeless compiler can behave differently depending on the target
... | # LANGUAGE PatternSynonyms #
It is more low - level than Internal syntax and is not used for type checking .
module Agda.Syntax.Treeless
( module Agda.Syntax.Abstract.Name
, module Agda.Syntax.Treeless
) where
import Control.Arrow (first, second)
import Data.Data (Data)
import Data.Word
import Agda.Sy... |
74f5358242a461e0d2d8e86706fa02205101d21a51a3e7fc252787ac629144b0 | owickstrom/pandoc-emphasize-code | ChunkingTest.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - missing - signatures #
module Text.Pandoc.Filter.EmphasizeCode.ChunkingTest where
import Test.Tasty.Hspec
import Text.Pandoc.Filter.EmphasizeCode.Chunking
import Text.Pandoc.Filter.EmphasizeCode.Range
import Text.P... | null | https://raw.githubusercontent.com/owickstrom/pandoc-emphasize-code/8f2de8fd78206eb6583bb5a6beca492f250cc25e/test/Text/Pandoc/Filter/EmphasizeCode/ChunkingTest.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - missing - signatures #
module Text.Pandoc.Filter.EmphasizeCode.ChunkingTest where
import Test.Tasty.Hspec
import Text.Pandoc.Filter.EmphasizeCode.Chunking
import Text.Pandoc.Filter.EmphasizeCode.Range
import Text.Pandoc.Filter.EmphasizeCode.Testing.... |
caeae0652a28104d751975e30a80edacec986b0ef98ea6deb065fbd16520e1fe | lsrcz/grisette | EvaluateSymTests.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Grisette.Core.Data.Class.EvaluateSymTests where
import Control.Monad.Except
import Control.Monad.Identity
import Control.Monad.Trans.Maybe
import qualified Control.Monad.Writer.Lazy a... | null | https://raw.githubusercontent.com/lsrcz/grisette/51d492f60fb37b74a626b591ec4c7ed128fa6217/test/Grisette/.Core/Data/Class/EvaluateSymTests.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Grisette.Core.Data.Class.EvaluateSymTests where
import Control.Monad.Except
import Control.Monad.Identity
import Control.Monad.Trans.Maybe
import qualified Control.Monad.Writer.Lazy as WriterLazy
import qualified Contr... |
64f56b2b3c2fa34f3c81410e5a78cc408140744a788e4ebfe656c67882c66589 | google/btls | Result.hs | Copyright 2018 Google LLC
--
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
-- use this file except in compliance with the License. You may obtain a copy of
-- the License at
--
-- -2.0
--
-- Unless required by applicable law or agreed to in writing, software
distributed und... | null | https://raw.githubusercontent.com/google/btls/6de13194f15468b186fe62d089b3a7189795c704/src/BTLS/Result.hs | haskell |
use this file except in compliance with the License. You may obtain a copy of
the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitati... | Copyright 2018 Google LLC
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
module BTLS.Result
( alwaysSucceeds, requireSuccess
, Result, Error, file, line, errorData, errorDataIsHumanReadable
, che... |
ea656992c366a77944a0f778b2adca9ef4d5853b2c913e62fab011f36e1f4ae9 | ice1000/learn | playing-with-laziness.hs | module Laziness where
import Control.Arrow
type Matrix = [[Bool]]
mx = 100
myFind :: Matrix -> Int -> Int -> (Int, Int)
myFind m x y
|m !! x !! y = (x, y)
|x == mx = myFind m 0 $ y + 1
|otherwise = myFind m (x + 1) y
---
findTrue :: Matrix -> (Int, Int)
findTrue m = myFind (take mx <$> (take mx <$> m))... | null | https://raw.githubusercontent.com/ice1000/learn/4ce5ea1897c97f7b5b3aee46ccd994e3613a58dd/Haskell/CW-Kata/playing-with-laziness.hs | haskell | - | module Laziness where
import Control.Arrow
type Matrix = [[Bool]]
mx = 100
myFind :: Matrix -> Int -> Int -> (Int, Int)
myFind m x y
|m !! x !! y = (x, y)
|x == mx = myFind m 0 $ y + 1
|otherwise = myFind m (x + 1) y
findTrue :: Matrix -> (Int, Int)
findTrue m = myFind (take mx <$> (take mx <$> m)) 0 0... |
78a5a653928e1ba95c213cae36518d38bedd586ea955e7e778edc372842b904b | rescript-lang/rescript-compiler | ext_bytes.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/ext/ext_bytes.ml | ocaml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | |
dbcca00191027691e0eda7fc151a761056812069679bb6faf3a91efdb38e4c80 | ferd/lrw | lrw_prop.erl | -module(lrw_prop).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(PROPMOD, proper).
-define(PROP(A), {timeout, 45, ?_assert(?PROPMOD:quickcheck(A(), [10000]))}).
proper_test_() ->
{"Run all property-based tests",
[?PROP(prop_all_ip), ?PROP(prop_all),
?PROP(p... | null | https://raw.githubusercontent.com/ferd/lrw/91761be19efcc46a4d10ea50df93183e0dea7dbb/test/lrw_prop.erl | erlang | order is okay
losing nodes is okay
term should work. This just speeds up the test.
order is okay
losing nodes is okay
same order
term should work. This just speeds up the test.
same order | -module(lrw_prop).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(PROPMOD, proper).
-define(PROP(A), {timeout, 45, ?_assert(?PROPMOD:quickcheck(A(), [10000]))}).
proper_test_() ->
{"Run all property-based tests",
[?PROP(prop_all_ip), ?PROP(prop_all),
?PROP(p... |
42a999ffba698209f90eb0e8ba26b6d1ac0d67140cb6523adde321368523b51f | schibsted/spid-tech-docs | apis.clj | (ns spid-docs.cultivate.apis
"Process data in resources/apis.edn into a map of endpoints, where the
two-level category is key and a map with description and related endpoints
are the values."
(:require [spid-docs.formatting :refer [to-id-str]]
[spid-docs.homeless :refer [update-vals in?]]
... | null | https://raw.githubusercontent.com/schibsted/spid-tech-docs/ee6a4394e9732572e97fc3a55506b2d6b9a9fe2b/src/spid_docs/cultivate/apis.clj | clojure | (ns spid-docs.cultivate.apis
"Process data in resources/apis.edn into a map of endpoints, where the
two-level category is key and a map with description and related endpoints
are the values."
(:require [spid-docs.formatting :refer [to-id-str]]
[spid-docs.homeless :refer [update-vals in?]]
... | |
eb185525c268bb4de9062a6d9fb2e8e753a044648c4ffbafb43c203da61c3d01 | naveensundarg/prover | dpll-system.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: common-lisp-user -*-
;;; File: dpll-system.lisp
The contents of this file are subject to the Mozilla Public License
;;; Version 1.1 (the "License"); you may not use this file except in
;;; compliance with the License. You may obtain a copy of the License at
;;; /
;;;
... | null | https://raw.githubusercontent.com/naveensundarg/prover/812baf098d8bf77e4d634cef4d12de94dcd1e113/snark-20120808r02/src/dpll-system.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; Package: common-lisp-user -*-
File: dpll-system.lisp
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for th... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is SNARK .
The Initial Developer of the Original Code is SRI International .
Portions created by the Initial Developer are Copyright ( C ) 1981 - 2010 .
... |
d1813e2d6b5c9e03e1848f097c393170ae5a0e5603670472b0d517686fdee62e | thierry-martinez/refl | deep_variables.ml | type ('a, 'b) t =
| A of 'a
| B of 'b option [@@deriving refl]
type 'a u = ('a, int) t
[@@deriving refl]
| null | https://raw.githubusercontent.com/thierry-martinez/refl/64e7c86f25c47c29aeeaa581a751ef37e138a42f/tests/deep_variables/deep_variables.ml | ocaml | type ('a, 'b) t =
| A of 'a
| B of 'b option [@@deriving refl]
type 'a u = ('a, int) t
[@@deriving refl]
| |
6dd38f7eb660d4f3a4f08d18b6adc30c46f4c14aff3b541bb176ac982409744e | candera/vmt | wind.cljs | (ns weathergen.wind
"Library for rendering iconography associated with wind."
(:require [goog.string :as gstring]
[goog.string.format]
[hoplon.svg :as svg]
[weathergen.math :as math]))
(defn barb
[speed]
(let [pennants (-> speed (/ 50) long)
speed' (-> speed (- (* 50... | null | https://raw.githubusercontent.com/candera/vmt/8cf450e6c34af87d748152afd7f547b92ae9b38e/src/weathergen/wind.cljs | clojure | from the beginning of the barb
TODO: Refactor this so it uses paths everywhere rather
than a mixture of lines and paths
Full tails | (ns weathergen.wind
"Library for rendering iconography associated with wind."
(:require [goog.string :as gstring]
[goog.string.format]
[hoplon.svg :as svg]
[weathergen.math :as math]))
(defn barb
[speed]
(let [pennants (-> speed (/ 50) long)
speed' (-> speed (- (* 50... |
b55f68c90680bb3366bad968e25f4fc994cfc32fe5f361abe59a96fa4f5056df | ovotech/kafka-avro-confluent | specs.clj | (ns kafka-avro-confluent.v2.specs
(:require [clojure.spec.alpha :as s]
[clojure.string :as string]
[clojure.walk :as w]))
(s/def ::non-blank-string (s/and string? (complement string/blank?)))
(s/def :schema-registry/base-url ::non-blank-string)
(s/def :schema-registry/username ::non-blank-st... | null | https://raw.githubusercontent.com/ovotech/kafka-avro-confluent/b014de61d2bc217ab5c8962c2a3d3f61f3553dd5/src/kafka_avro_confluent/v2/specs.clj | clojure | (ns kafka-avro-confluent.v2.specs
(:require [clojure.spec.alpha :as s]
[clojure.string :as string]
[clojure.walk :as w]))
(s/def ::non-blank-string (s/and string? (complement string/blank?)))
(s/def :schema-registry/base-url ::non-blank-string)
(s/def :schema-registry/username ::non-blank-st... | |
1392790e812022404c35c45a13ae3bde5b4a0ddfed2db67f1776a672e53a43f1 | yetanalytics/dl4clj | listeners.clj | (ns ^{:doc "listener creation namespace. composes the listeners package from dl4j
see: -summary.html"}
dl4clj.optimize.listeners
(:import [org.deeplearning4j.optimize.listeners
ParamAndGradientIterationListener
ComposableIterationListener
ScoreIterationListener
Per... | null | https://raw.githubusercontent.com/yetanalytics/dl4clj/9ef055b2a460f1a6246733713136b981fd322510/src/dl4clj/optimize/listeners.clj | clojure |
multi method that sets up the constructor/builder
| (ns ^{:doc "listener creation namespace. composes the listeners package from dl4j
see: -summary.html"}
dl4clj.optimize.listeners
(:import [org.deeplearning4j.optimize.listeners
ParamAndGradientIterationListener
ComposableIterationListener
ScoreIterationListener
Per... |
921a71d11a731cc8126392292632b096b968d4638b7db6b00c079134aadd74a5 | kana/sicp | ex-3.25.scm | Exercise 3.25 . Generalizing one- and two - dimensional tables , show how to
;;; implement a table in which values are stored under an arbitrary number of
;;; keys and different values may be stored under different numbers of keys.
;;; The lookup and insert! procedures should take as input a list of keys used
;;; t... | null | https://raw.githubusercontent.com/kana/sicp/912bda4276995492ffc2ec971618316701e196f6/ex-3.25.scm | scheme | implement a table in which values are stored under an arbitrary number of
keys and different values may be stored under different numbers of keys.
The lookup and insert! procedures should take as input a list of keys used
to access the table.
Let's consider the following interaction:
(define t (make-table))
... | Exercise 3.25 . Generalizing one- and two - dimensional tables , show how to
If t was a one - dimensional table , we could assume that each key is paired
with a value . If t was a two - dimensional table , we could assume that each
one - dimensional tables . But t is not . A key might have both a value... |
a8528da48a34a7c5416f5d0be7b27bf52e546715d48a6d98a520285a2ce14871 | ocaml-ppx/ppxlib | context_free.mli | (** Context free rewriting, to define local rewriting rules that will all be
applied at once by the driver. *)
open! Import
(** Local rewriting rules.
This module lets you define local rewriting rules, such as extension point
expanders. It is not completely generic and you cannot define any kind of
r... | null | https://raw.githubusercontent.com/ocaml-ppx/ppxlib/1110af2ea18f351cc3f2ccbee8444bb2a4b257b7/src/context_free.mli | ocaml | * Context free rewriting, to define local rewriting rules that will all be
applied at once by the driver.
* Local rewriting rules.
This module lets you define local rewriting rules, such as extension point
expanders. It is not completely generic and you cannot define any kind of
rewriting, it currentl... |
open! Import
module Rule : sig
type t
val extension : Extension.t -> t
val special_function : string -> (expression -> expression option) -> t
* [ special_function i d expand ] is a rule to rewrite a function call at
parsing time . [ i d ] is the identifier to match on and [ expand ] is used to
... |
7aaa2b4ea78432bbd72ad4864e435b37da7da8a1d915a0854b0c5c0be29d4514 | carl-eastlund/dracula | random.rkt | #lang racket
(require
racket/require
(path-up "self/require.rkt")
(for-syntax (cce-in syntax))
(cce-in function)
(prefix-in raw-
(combine-in
(random-in random)
srfi/27)))
(provide/contract
[prob/c (case->
(-> flat-contract?)
(-> (one-of/c 0 1) flat-contract?)
(... | null | https://raw.githubusercontent.com/carl-eastlund/dracula/a937f4b40463779246e3544e4021c53744a33847/private/fasttest/random.rkt | racket |
SETUP
random-boolean/fair : (Random Boolean)
random-boolean : [Prob] -> (Random Boolean)
Make these depend on their optional arguments once I learn how.
random-real/uniform : Real Real>=lo -> Real in [lo,hi]
DEFAULT NUMBER DISTRIBUTIONS
Primitive constructors
Exported construct... | #lang racket
(require
racket/require
(path-up "self/require.rkt")
(for-syntax (cce-in syntax))
(cce-in function)
(prefix-in raw-
(combine-in
(random-in random)
srfi/27)))
(provide/contract
[prob/c (case->
(-> flat-contract?)
(-> (one-of/c 0 1) flat-contract?)
(... |
21413bd017713e123693da06cf8fc837e2445bab61d401724cd528f60cf9c802 | ocurrent/ocurrent-deployer | aws.ml | (* Compose configuration for a AWS ECS *)
type t = {
name: string;
branch: string;
vcpu: float;
memory: int;
storage: int option;
replicas: int;
command: string option;
port: int;
certificate: string;
}
let command_colon = function
| None -> ""
| Some cmd -> " command: " ^ cmd ^ "\n"
let sto... | null | https://raw.githubusercontent.com/ocurrent/ocurrent-deployer/ec01824b1abd9ad77cea7d058316293515b11f68/src/aws.ml | ocaml | Compose configuration for a AWS ECS
service
command: something
ports: - n where n is the container port the service is running on
Number of instances to create
xxxTCPyyListerner set the SSL certificate to use |
type t = {
name: string;
branch: string;
vcpu: float;
memory: int;
storage: int option;
replicas: int;
command: string option;
port: int;
certificate: string;
}
let command_colon = function
| None -> ""
| Some cmd -> " command: " ^ cmd ^ "\n"
let storage_colon n gb =
match gb with
| None... |
49450309c26e7b525de4e5f09eb31aaa59395ea38083e2ab3572848663744f16 | solomon-b/monoidal-functors | Monoidal.hs | module Data.Bifunctor.Monoidal
( -- * Semigroupal
Semigroupal (..),
* Unital
Unital (..),
-- * Monoidal
Monoidal,
)
where
--------------------------------------------------------------------------------
import Control.Applicative (Alternative (..), Applicative (..), pure, (<$>))
import Control... | null | https://raw.githubusercontent.com/solomon-b/monoidal-functors/4caa75b76bb9b0cf1d09f33f21becc400c1b45bb/src/Data/Bifunctor/Monoidal.hs | haskell | * Semigroupal
* Monoidal
------------------------------------------------------------------------------
------------------------------------------------------------------------------
=== Laws
__Associativity:__
\[
\require{AMScd}
\begin{CD}
(F A B \bullet F C D) \bullet F X Y @>>{\alpha_... | module Data.Bifunctor.Monoidal
Semigroupal (..),
* Unital
Unital (..),
Monoidal,
)
where
import Control.Applicative (Alternative (..), Applicative (..), pure, (<$>))
import Control.Arrow (Kleisli (..))
import Control.Category (Category (..))
import Control.Category.Cartesian (Cocartesian (..), Semic... |
aa1b2fe135d37db251f920cf36488dd6266440086839b480cc40933ca4cdd83f | malyn/mondrian | macros.clj | (ns mondrian.macros
(use [dommy.macros :only [sel1]]))
(defmacro defmondrian
"Defines a mondrian animation function given the initial state and a
pair of functions that drive the the animation. The resulting
function takes a reference to a mondrian DOM element, which must
include a canvas element upon which... | null | https://raw.githubusercontent.com/malyn/mondrian/4ba922d7c4190fbfef92348dfd1c9b8873c27a13/src/clj/mondrian/macros.clj | clojure | (ns mondrian.macros
(use [dommy.macros :only [sel1]]))
(defmacro defmondrian
"Defines a mondrian animation function given the initial state and a
pair of functions that drive the the animation. The resulting
function takes a reference to a mondrian DOM element, which must
include a canvas element upon which... | |
f30e89478c0de65f57608da29bc7f061df740f8a36889db15aeaa3919f94d9c8 | xapi-project/message-switch | gpumon_interface_test.ml | open Idl_test_common
module GenPath = struct let test_data_path = "gpu_gen" end
module OldPath = struct let test_data_path = "test_data/gpumon" end
module C = Gpumon_interface.RPC_API (GenTestData (GenPath) (TJsonrpc))
module T = Gpumon_interface.RPC_API (TestOldRpcs (OldPath) (TJsonrpc))
let tests = !C.implementat... | null | https://raw.githubusercontent.com/xapi-project/message-switch/1d0d1aa45c01eba144ac2826d0d88bb663e33101/xapi-idl/lib_test/gpumon_interface_test.ml | ocaml | open Idl_test_common
module GenPath = struct let test_data_path = "gpu_gen" end
module OldPath = struct let test_data_path = "test_data/gpumon" end
module C = Gpumon_interface.RPC_API (GenTestData (GenPath) (TJsonrpc))
module T = Gpumon_interface.RPC_API (TestOldRpcs (OldPath) (TJsonrpc))
let tests = !C.implementat... | |
260376a729f73fd429ef4a628ceb5a7fabd39d4563cc4f00afcb6ef3e38e744d | jarohen/yoyo | om.cljs | (ns {{name}}.ui.app
(:require [clojure.string :as s]
[om.core :as om]
[om.dom :as dom]
[nrepl.embed :refer [connect-brepl!]]))
(enable-console-print!)
(connect-brepl!)
(defn hello-world []
(om/component
(dom/p nil "Hello world!")))
(set! (.-onload js/window)
(fn []
... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/templates/yoyo-webapp/src/leiningen/new/yoyo_webapp/cljs/om.cljs | clojure | ------------------------------------------------------------
Below this line is only required for the Yo-yo welcome page, feel
free to just delete all of it when you want to get cracking on your
own project! | (ns {{name}}.ui.app
(:require [clojure.string :as s]
[om.core :as om]
[om.dom :as dom]
[nrepl.embed :refer [connect-brepl!]]))
(enable-console-print!)
(connect-brepl!)
(defn hello-world []
(om/component
(dom/p nil "Hello world!")))
(set! (.-onload js/window)
(fn []
... |
36e34a1bdfb8741dcda6f8315505d4c01d059c41cf646f36c16c8cf74c076a48 | c4-project/c4f | delitmus.mli | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/cmd_c/src/delitmus.mli | ocaml | * Command for act's C/Litmus delitmusifier.
* [command] is the top-level 'act-c delitmus' command. | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... |
bf47e9d6d22213909ab90549a50fe50d4ecc1b20e1b272f37ebc4fac72e36294 | sshine/hs-jq | Expr.hs |
module Jq.Expr where
import Data.Scientific (Scientific)
import Data.Text (Text)
The jq grammar :
A derived BNF : -language-grammar.md
Initially , only look at expressions and skip jq modules , function defs and
imperative constructs . You know , I did n't even know that jq had support for
modules until... | null | https://raw.githubusercontent.com/sshine/hs-jq/157b89a34b1f72581b02302b876785d6074dffa3/src/Jq/Expr.hs | haskell | Function definitions
Control structures
'break' $ IDENT (JBOL Term)
'='
'or'
'and'
'//'
'?//'
'//='
'|='
'|'
','
'+'
'+='
'-'
'-='
'*'
'*='
'/'
'/='
'%'
'%='
'=='
'!='
'<'
'>'
'<='
'>='
Prefix/postfix
suffix '?'
prefix '-'
Begins with '.'
'.'
'..'
'.foo'
'."foo"'
Postfix [], postfix... |
module Jq.Expr where
import Data.Scientific (Scientific)
import Data.Text (Text)
The jq grammar :
A derived BNF : -language-grammar.md
Initially , only look at expressions and skip jq modules , function defs and
imperative constructs . You know , I did n't even know that jq had support for
modules until... |
82ec071e3e9b00d67deff7663a892cc83170cee492c4eda7a97760e64415bc79 | janestreet/memtrace_viewer_with_deps | expect_test_config.ml | module IO_run = struct
type 'a t = 'a
let return x = x
let bind t ~f = f t
end
module IO_flush = struct
include IO_run
let to_run t = t
end
let flush () = () (* the runtime already flushes [stdout] *)
let run f = f ()
let flushed () = true (* the runtime flushed [stdout] before calling this function *)
... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/ppx_expect/config/expect_test_config.ml | ocaml | the runtime already flushes [stdout]
the runtime flushed [stdout] before calling this function | module IO_run = struct
type 'a t = 'a
let return x = x
let bind t ~f = f t
end
module IO_flush = struct
include IO_run
let to_run t = t
end
let run f = f ()
let upon_unreleasable_issue = `CR
|
13226d2767ccdd42e1505158fda7057ba24e2d7ea1c6408775b58a51ac304bc3 | PacktPublishing/Haskell-High-Performance-Programming | fib.hs | import Control.Parallel
fib :: Int -> Int
fib n
| n <= 1 = 1
| n <= 28 = fib (n - 1) + fib (n - 2)
| otherwise = let a = fib (n - 1)
b = fib (n - 2)
in a `par` b `par` a + b
-- in a + b
main = do
let x = fib 37
y = fib 38
... | null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter05/fib.hs | haskell | in a + b
print (x,y,z,w) | import Control.Parallel
fib :: Int -> Int
fib n
| n <= 1 = 1
| n <= 28 = fib (n - 1) + fib (n - 2)
| otherwise = let a = fib (n - 1)
b = fib (n - 2)
in a `par` b `par` a + b
main = do
let x = fib 37
y = fib 38
z = fib 39
w = fib 40
... |
592b7fba16020bb060eda94be245ba914f10129bdd9ab8fa68b5bbeb90df3699 | michaelklishin/monger | querying_test.clj | (ns monger.test.querying-test
(:refer-clojure :exclude [select find sort])
(:import [com.mongodb WriteResult WriteConcern DBObject ReadPreference]
org.bson.types.ObjectId
java.util.Date)
(:require [monger.core :as mg]
[monger.collection :as mc]
monger.joda-time
... | null | https://raw.githubusercontent.com/michaelklishin/monger/9f3d192dffb16da011f805355b87ae172c584a69/test/monger/test/querying_test.clj | clojure |
monger.collection/* finders ("low-level API")
exact match over string field
exact match over string field with limit
$all
$exists
$mod
$ne
monger.query DSL features
pagination
documents have fields as strings,
not keywords | (ns monger.test.querying-test
(:refer-clojure :exclude [select find sort])
(:import [com.mongodb WriteResult WriteConcern DBObject ReadPreference]
org.bson.types.ObjectId
java.util.Date)
(:require [monger.core :as mg]
[monger.collection :as mc]
monger.joda-time
... |
282003c6b24c400ed7533c63facac967a0e5eaced4b283c9c4f32c22143fad65 | lambdaisland/launchpad | shadow.clj | re - enable
lambdaisland.launchpad.shadow
(:require [clojure.java.io :as io]
[shadow.cljs.devtools.api :as api]
[shadow.cljs.devtools.config :as config]
[shadow.cljs.devtools.server :as server]
[shadow.cljs.devtools.server.runtime :as runtime]
[lambdaisla... | null | https://raw.githubusercontent.com/lambdaisland/launchpad/16137ecfd49d86f7f7dbe7d54e386c82e7720ab6/src/lambdaisland/launchpad/shadow.clj | clojure | Not sure yet if this is a good idea | re - enable
lambdaisland.launchpad.shadow
(:require [clojure.java.io :as io]
[shadow.cljs.devtools.api :as api]
[shadow.cljs.devtools.config :as config]
[shadow.cljs.devtools.server :as server]
[shadow.cljs.devtools.server.runtime :as runtime]
[lambdaisla... |
d50486ec8e8ff33071de90150e6c8912214d4260f4a687a455c0e0aa825d3217 | racket/gui | snip-canvas.rkt | #lang racket/base
(require racket/gui/base racket/class)
(provide snip-canvas%)
(define snip-canvas%
(class editor-canvas%
(init parent
make-snip
[style null]
[label #f]
[horizontal-inset 5]
[vertical-inset 5]
[enabled #t]
[vert-margin 0]
... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mrlib/snip-canvas.rkt | racket | #lang racket/base
(require racket/gui/base racket/class)
(provide snip-canvas%)
(define snip-canvas%
(class editor-canvas%
(init parent
make-snip
[style null]
[label #f]
[horizontal-inset 5]
[vertical-inset 5]
[enabled #t]
[vert-margin 0]
... | |
e55ffb4f7ff77f5654e76d9ad9bf44dd23d10e7f7c8e699282e89d9c38bcfbab | startalkIM/ejabberd | ejabberd_system_monitor.erl | %%%-------------------------------------------------------------------
%%% File : ejabberd_system_monitor.erl
Author : < >
%%% Description : Ejabberd watchdog
Created : 21 Mar 2007 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can redistr... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/ejabberd_system_monitor.erl | erlang | -------------------------------------------------------------------
File : ejabberd_system_monitor.erl
Description : Ejabberd watchdog
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,... | Author : < >
Created : 21 Mar 2007 by < >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
91bbc38017fc88bb12038abd80b1c4e65798cce5a63a4c2baee4de264643e6c5 | unnohideyuki/bunny | sample334.hs | f x = case x of
0 -> "zero"
_ -> "non-zero"
main = do putStrLn $ f 1
putStrLn $ f 0
putStrLn $ f (1::Int)
putStrLn $ f (0::Integer)
putStrLn $ f (1.0::Double)
putStrLn $ f (0.0::Float)
| null | https://raw.githubusercontent.com/unnohideyuki/bunny/f01735ac55b40f977f1c5055919e16b97aa1bf13/compiler/test/samples/sample334.hs | haskell | f x = case x of
0 -> "zero"
_ -> "non-zero"
main = do putStrLn $ f 1
putStrLn $ f 0
putStrLn $ f (1::Int)
putStrLn $ f (0::Integer)
putStrLn $ f (1.0::Double)
putStrLn $ f (0.0::Float)
| |
bec4d1c1ef6ebaf546f64c07b487b187c99a3ed9f5a58b326779fb07e4b1a00b | ucsd-progsys/nate | taquin.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/examples_labltk/taquin.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
7ffeaee4a52452ba948010a7ba89438e7a7f932e87531748fac845d2cb4d2c8c | evturn/programming-in-haskell | 13.08-arithmetic-expressions.hs | import Control.Applicative
import Data.Char
newtype Parser a = P (String -> [(a, String)])
-----------------------------------------------------------------------------
-- expr ::= term (+ expr | ∊)
-- term ::= factor (* term | ∊)
factor : : = ( expr ) | nat
-- nat ::= 0 | 1 | 2 | ..... | null | https://raw.githubusercontent.com/evturn/programming-in-haskell/0af2c48c8221b5bcd052492e2be2b79635f6994c/13-monadic-parsing/13.08-arithmetic-expressions.hs | haskell | ---------------------------------------------------------------------------
expr ::= term (+ expr | ∊)
term ::= factor (* term | ∊)
nat ::= 0 | 1 | 2 | ...
--------------------------------------------------------------------------- | import Control.Applicative
import Data.Char
newtype Parser a = P (String -> [(a, String)])
factor : : = ( expr ) | nat
expr :: Parser Int
expr = do
t <- term
do
symbol "+"
e <- expr
return (t + e) <|> return t
term :: Parser Int
term = do
f <- factor
do
symbol "*"
... |
fbbb5dcb9ceb1e5439ae692de93c36ebe37d66b5b2aac45db7907307cd55e663 | ledger/ledger4 | Setup.hs | import Distribution.Simple
main = defaultMain | null | https://raw.githubusercontent.com/ledger/ledger4/0dd4d772dbd6a94ef83398e79e9acab2029a5a3a/commodities/Setup.hs | haskell | import Distribution.Simple
main = defaultMain | |
28ae3ce063811bad28ae6aad168b7b45b5217e61a5d2762ad044bfd27af37b30 | Eonblast/Scalaxis | merkle_tree.erl | 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distribut... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/src/rrepair/merkle_tree.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
@doc tree implementation
-module(merkle_tree).
-include("record_helpers.hrl").
-include("scalaris.hrl").
-export([... |
b02ef6ee1ecd9aa4008ebac817b9aedd1ffa9e7e1182e5ec53a688c2917090cd | wardle/concierge | nhs_number.clj | (ns com.eldrix.concierge.nhs-number)
(defn valid?
"Validate an NHS number using the modulus 11 algorithm.
An NHS number should be 10 numeric digits with the tenth digit a check digit.
The validation occurs thusly:
1. Multiply each of the first nine digits by a weighting factor (digit 1:10, 2:9, 3:8, 4:7, 5:6, ... | null | https://raw.githubusercontent.com/wardle/concierge/bb738cbc775b2cfde1c3f6bc526cded1af300978/src/com/eldrix/concierge/nhs_number.clj | clojure | the check digit
convert string into integers
multiply and total
what we think should be the check digit | (ns com.eldrix.concierge.nhs-number)
(defn valid?
"Validate an NHS number using the modulus 11 algorithm.
An NHS number should be 10 numeric digits with the tenth digit a check digit.
The validation occurs thusly:
1. Multiply each of the first nine digits by a weighting factor (digit 1:10, 2:9, 3:8, 4:7, 5:6, ... |
8f6563122292130c757026ec34689c5062b6312d2e5b86ecbc694f755e000c78 | keera-studios/keera-hails | AppDataBasic.hs | {-# LANGUAGE DeriveDataTypeable #-}
-- |
--
Copyright : ( C ) Keera Studios Ltd , 2013
-- License : BSD3
Maintainer :
module AppDataBasic where
import Data.Data
import Data.Default
import Data . Typeable
-- This is the CLI app definition : what we get from the user
data AppDataBasic = AppDataBasic {
... | null | https://raw.githubusercontent.com/keera-studios/keera-hails/bf069e5aafc85a1f55fa119ae45a025a2bd4a3d0/keera-hails/src/AppDataBasic.hs | haskell | # LANGUAGE DeriveDataTypeable #
|
License : BSD3
This is the CLI app definition : what we get from the user | Copyright : ( C ) Keera Studios Ltd , 2013
Maintainer :
module AppDataBasic where
import Data.Data
import Data.Default
import Data . Typeable
data AppDataBasic = AppDataBasic {
action :: HailsAction
, outputDir :: Maybe FilePath
, overwrite :: Bool
}
deriving (Show, Data, Typeable)
data Hai... |
542e846c9fdb6f62a5d0f9d5bde332a565e16328effd69d5c4008bd35db2c6c8 | mariari/Misc-ML-Scripts | shunt.hs | # LANGUAGE DeriveGeneric #
-- |
- This implements the Shunt Yard algorithm for determining the
-- precedence of operations
module Shunt where
import Data.List.NonEmpty
import GHC.Generics hiding (Associativity)
import Control.Monad (foldM)
data Associativity
= Left'
| Right'
| NonAssoc
deriving (Eq, Show,... | null | https://raw.githubusercontent.com/mariari/Misc-ML-Scripts/34e53528f06203766b47464ed53c14ce88096cdd/Haskell/shunt.hs | haskell | |
precedence of operations
Not a real ordering, hence not an ord instance
application given by shunt | # LANGUAGE DeriveGeneric #
- This implements the Shunt Yard algorithm for determining the
module Shunt where
import Data.List.NonEmpty
import GHC.Generics hiding (Associativity)
import Control.Monad (foldM)
data Associativity
= Left'
| Right'
| NonAssoc
deriving (Eq, Show, Generic)
data Precedence sym = Pr... |
7167446ce2b2e031e6c8e7df25ebaef0336fb81b01ecd6cd96003db9c3847656 | metametadata/aide | events.cljs | (ns app.events
(:require [app.api :as api]
[aide.core :as aide]
[aide-history.core :as aide-history]
[goog.functions :as goog-functions]))
(aide/defevent on-search-success
[app [q friends]]
(if (= q (:query @(:*model app)))
(swap! (:*model app) assoc :friends friends)
... | null | https://raw.githubusercontent.com/metametadata/aide/0828b53503e8c7f54f84e1b140a1d02ad80aff36/examples/friend-list/src/app/events.cljs | clojure | (ns app.events
(:require [app.api :as api]
[aide.core :as aide]
[aide-history.core :as aide-history]
[goog.functions :as goog-functions]))
(aide/defevent on-search-success
[app [q friends]]
(if (= q (:query @(:*model app)))
(swap! (:*model app) assoc :friends friends)
... | |
b73dcc49199967f8350c7265c78d43280ad78f3873e169097c1ac944ade53c3e | EFanZh/EOPL-Exercises | exercise-6.27.rkt | #lang eopl
Exercise 6.27 [ ★ ★ ] As it stands , cps - of - let - exp will generate a useless let expression . ( Why ? ) Modify this procedure
;; so that the continuation variable is the same as the let variable. Then if exp1 is nonsimple,
;;
( cps - of - exp < < let var1 = exp1 in exp2 > > K )
= ( cps - ... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-6.27.rkt | racket | so that the continuation variable is the same as the let variable. Then if exp1 is nonsimple,
Transformer.
Data structures - expressed values.
Data structures - environment.
Data structures - continuation.
Interpreter. | #lang eopl
Exercise 6.27 [ ★ ★ ] As it stands , cps - of - let - exp will generate a useless let expression . ( Why ? ) Modify this procedure
( cps - of - exp < < let var1 = exp1 in exp2 > > K )
= ( cps - of - exp exp1 < < proc ( var1 ) ( cps - of - exp exp2 K ) > >
CPS - IN grammar .
(define the-lex... |
823744dbfc9aca4fd2c02a1c0f3ecfc1fe7899f55fd9220039895813fa1e3f63 | exercism/haskell | Phone.hs | module Phone (number) where
import Data.Char (isDigit)
number :: String -> Maybe String
number input = clean input >>= check
check :: String -> Maybe String
check ('0':_) = Nothing
check ('1':_) = Nothing
check (_:_:_:'0':_) = Nothing
check (_:_:_:'1':_) = Nothing
check s = Just s
clean :: String -> Maybe String
cle... | null | https://raw.githubusercontent.com/exercism/haskell/ae17e9fc5ca736a228db6dda5e3f3b057fa6f3d0/exercises/practice/phone-number/.meta/examples/success-standard/src/Phone.hs | haskell | module Phone (number) where
import Data.Char (isDigit)
number :: String -> Maybe String
number input = clean input >>= check
check :: String -> Maybe String
check ('0':_) = Nothing
check ('1':_) = Nothing
check (_:_:_:'0':_) = Nothing
check (_:_:_:'1':_) = Nothing
check s = Just s
clean :: String -> Maybe String
cle... | |
a0a4ead2b1e8ffe3e6530db9c975ced99cee1bf3983f6bff83503146fea18cd1 | layerware/hugsql | project.clj | (defproject com.layerware/hugsql-adapter "0.5.3"
:description "hugsql adapter support/protocol"
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:scm {:dir ".."}
:dependencies [[org.clojure/clojure "1.8.0"]])
| null | https://raw.githubusercontent.com/layerware/hugsql/ad73d080f84487c3438058ed5203d44f06c46365/hugsql-adapter/project.clj | clojure | (defproject com.layerware/hugsql-adapter "0.5.3"
:description "hugsql adapter support/protocol"
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:scm {:dir ".."}
:dependencies [[org.clojure/clojure "1.8.0"]])
| |
68b42061349044050fa02689ee976a47bd8258d2b55bbdf6892ec4e16f79cd7a | weavejester/environ | plugin.clj | (ns lein-environ.plugin
(:use [robert.hooke :only (add-hook)])
(:require [clojure.java.io :as io]
leiningen.core.main))
(defn- as-edn [& args]
(binding [*print-dup* false
*print-meta* false
*print-length* false
*print-level* false]
(apply prn-str args)))
... | null | https://raw.githubusercontent.com/weavejester/environ/bd355e6422399703c46abe7c890b54685632ae10/lein-environ/src/lein_environ/plugin.clj | clojure | (ns lein-environ.plugin
(:use [robert.hooke :only (add-hook)])
(:require [clojure.java.io :as io]
leiningen.core.main))
(defn- as-edn [& args]
(binding [*print-dup* false
*print-meta* false
*print-length* false
*print-level* false]
(apply prn-str args)))
... | |
4cbde841a42545f322c8dff8e5b695a78c73767e885a50ed90d74c48b4be15d6 | kumarshantanu/lein-clr | project.clj | (defproject lein-clr/parent "0.0.0"
:description "Housekeeping project for lein-clr"
:url "-clr"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.0.0"
:plugins [[lein-sub "0.2.4"]]
:sub ["lein-template"
"plugin"]
:eval-in :leiningen)
| null | https://raw.githubusercontent.com/kumarshantanu/lein-clr/de43519353c3c4a8a4e1520faf7f9a576910382e/project.clj | clojure | (defproject lein-clr/parent "0.0.0"
:description "Housekeeping project for lein-clr"
:url "-clr"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.0.0"
:plugins [[lein-sub "0.2.4"]]
:sub ["lein-template"
"plugin"]
:eval-in :leiningen)
| |
87fdf752305fedb81223a1d28bf700594ebf02042b9a7dbdd21f0d8893432588 | Clojure2D/clojure2d-examples | ex43_noise_figures.clj | (ns ex43-noise-figures
(:require [clojure2d.core :refer :all]
[fastmath.random :as r]
[fastmath.core :as m]
[clojure2d.color :as c]
[fastmath.fields :as f]
[fastmath.vector :as v]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/9de82f5ac0737b7e78e07a17cf03ac577d973817/src/ex43_noise_figures.clj | clojure | (ns ex43-noise-figures
(:require [clojure2d.core :refer :all]
[fastmath.random :as r]
[fastmath.core :as m]
[clojure2d.color :as c]
[fastmath.fields :as f]
[fastmath.vector :as v]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/... | |
23ee73ef776938b8137a14302b5853c53c027a12e278e4ad21fba455b96ab806 | runtimeverification/haskell-backend | AndTerms.hs | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Simplify.AndTerms (
termUnification,
maybeTermAnd,
maybeTermEquals,
TermSimplifier,
TermTransformationOld,
c... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/f2c86d14fcc67aaa580b9913f9bccbc56c5281a3/kore/src/Kore/Simplify/AndTerms.hs | haskell | | Used to simplify subterm "and".
| Used to simplify subterm "and".
| Simplify the conjunction of terms where one is a predicate.
| Matches
@
\\equals{_, _}(t, t)
@
and
@
\\and{_}(t, t)
@
| Returns the term as a pattern.
| Match the unification of an element variable with a function-like term.
| Unify a vari... | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Simplify.AndTerms (
termUnification,
maybeTermAnd,
maybeTermEquals,
TermSimplifier,
TermTransformationOld,
c... |
159fc2cdc6ef59950639294d668b5b69909819c3d7377510b8642a126e43a4ba | stevebleazard/ocaml-jsonxt | process.ml | let error msg _json = raise (Failure msg)
module Internal = struct
module type S = sig
type json
val null : unit -> json
end
module type Internal_strict_intf = sig
type json
val member : string -> [> `Assoc of (string * json) list ] -> json
val index : int -> [> `List of json list ] -> json... | null | https://raw.githubusercontent.com/stevebleazard/ocaml-jsonxt/fe982b6087dd76ca003d8fbc19ae9a519f54b828/lib/process.ml | ocaml | let error msg _json = raise (Failure msg)
module Internal = struct
module type S = sig
type json
val null : unit -> json
end
module type Internal_strict_intf = sig
type json
val member : string -> [> `Assoc of (string * json) list ] -> json
val index : int -> [> `List of json list ] -> json... | |
9b5fed7c6dd8e9955b32a39b3a8cba28e72c80a9646e40ba0a74c8a08d36dad2 | xapi-project/xen-api | unixfd.ml | (** file descriptor with location *)
type raw = Unix.file_descr * string
type t = raw Safe.t
let borrow_exn t = Safe.borrow_exn t |> fst
let ( ! ) = borrow_exn
let release (chan, _) = Unix.close chan
Calling functions that may take locks inside a finaliser can lead to
deadlocks , see and
-project/xcp-... | null | https://raw.githubusercontent.com/xapi-project/xen-api/5c9c44c6d40a9930f454722c9cd09c7079ec814e/ocaml/libs/resources/unixfd.ml | ocaml | * file descriptor with location
the channels are using [dup]-ed FDs, close original now | type raw = Unix.file_descr * string
type t = raw Safe.t
let borrow_exn t = Safe.borrow_exn t |> fst
let ( ! ) = borrow_exn
let release (chan, _) = Unix.close chan
Calling functions that may take locks inside a finaliser can lead to
deadlocks , see and
-project/xcp-idl/pull/288 .
This can be work... |
017987a97ac51e80dbd5a92fc0091b9f7379d3b50578635c44f8546861b539c0 | ml-in-barcelona/server-reason-react | jsso-react-pre-ocaml.ml |
This is the file that handles turning Reason JSX ' agnostic function call into
a jsoo - react - specific function call . , this is a macro , using 's ppx
facilities ; -guide-to-extension-
points - in - ocaml/
This is the file that handles turning Reason JSX' agnostic function call into
a jsoo-re... | null | https://raw.githubusercontent.com/ml-in-barcelona/server-reason-react/02950c3028b994efe7291e747b5ec29f0d150d1f/arch/jsso-react-pre-ocaml.ml | ocaml | unlike reason-react ppx, we don't transform to array, just apply mapper to children
unlike reason-react ppx, we don't transform to array, just apply mapper to children
no children provided? Place a placeholder list
Helper method to look up the [@react.component] attribute
Helper method to filter out any attrib... |
This is the file that handles turning Reason JSX ' agnostic function call into
a jsoo - react - specific function call . , this is a macro , using 's ppx
facilities ; -guide-to-extension-
points - in - ocaml/
This is the file that handles turning Reason JSX' agnostic function call into
a jsoo-re... |
a2c17aa3329c67ce95e834b7df1e6ebde25e553ccc74ebb0b3711d2d5f58e894 | Eonblast/Scalaxis | hfs_lhsp_md5.erl | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
di... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/src/rrepair/hfs_lhsp_md5.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2006 by ,
" Less Hashing , Same Performance : Building a Better Bloom Filter
2000 ... |
33829c5f33573dcb958648e16a551aca8d322009a8533b7fc01c505480f62c8d | homebaseio/datalog-console | transact_cards.cljs | (ns datalog-console.workspaces.transact-cards)
| null | https://raw.githubusercontent.com/homebaseio/datalog-console/af831c85addc345cc5e1af4412821f0cfb80b808/src/dev/datalog_console/workspaces/transact_cards.cljs | clojure | (ns datalog-console.workspaces.transact-cards)
| |
2cc83a80dafc36100a176de3de7ff3ce8f698713ad9b099cff2c54d5d4a9dd5a | dasuxullebt/uxul-world | constants.lisp | Copyright 2009 - 2011
(in-package :uxul-world)
(defmacro mydefconst (x y)
`(eval-when (:compile-toplevel :load-toplevel)
(when (or (not (boundp ',x))
(not (equal ,y
(symbol-value ',x))))
(defconstant ,x ,y))))
(mydefconst +screen-width+ 1024)
(mydefconst +screen-height+ 768)
(mydefc... | null | https://raw.githubusercontent.com/dasuxullebt/uxul-world/f05e44b099e5976411b3ef1f980ec616bd221425/constants.lisp | lisp | Copyright 2009 - 2011
(in-package :uxul-world)
(defmacro mydefconst (x y)
`(eval-when (:compile-toplevel :load-toplevel)
(when (or (not (boundp ',x))
(not (equal ,y
(symbol-value ',x))))
(defconstant ,x ,y))))
(mydefconst +screen-width+ 1024)
(mydefconst +screen-height+ 768)
(mydefc... | |
00dfadf2546e4340ef197235128fbd7d2ac3af328e568fa05f789a8b250b93d1 | LambdaHack/LambdaHack | HandleHumanGlobalM.hs | | Semantics of " Game . LambdaHack . Client . UI.HumanCmd "
-- client commands that return server requests.
-- A couple of them do not take time, the rest does.
-- Here prompts and menus are displayed, but any feedback resulting
-- from the commands (e.g., from inventory manipulation) is generated later on,
-- by the... | null | https://raw.githubusercontent.com/LambdaHack/LambdaHack/80d7c24a67224e09673a1d3e80cef9ffb0d91aa4/engine-src/Game/LambdaHack/Client/UI/HandleHumanGlobalM.hs | haskell | client commands that return server requests.
A couple of them do not take time, the rest does.
Here prompts and menus are displayed, but any feedback resulting
from the commands (e.g., from inventory manipulation) is generated later on,
by the server, for all clients that witness the results of the commands.
* Gl... | | Semantics of " Game . LambdaHack . Client . UI.HumanCmd "
module Game.LambdaHack.Client.UI.HandleHumanGlobalM
* Meta commands
byAreaHuman, byAimModeHuman
, composeIfLocalHuman, composeUnlessErrorHuman, compose2ndLocalHuman
, loopOnNothingHuman, executeIfClearHuman
, waitHuman, waitHuman10, yellHuman, mo... |
e77042183fe7b6065368d3447c3a554705efd4a3f291c305545e941b5d3d05d2 | angelhof/flumina | configuration.erl | -module(configuration).
-export([create/4,
create/5,
get_mailbox_name_node/1,
get_children/1,
get_children_mbox_pids/1,
get_children_node_names/1,
find_node/2,
find_children/2,
find_children_mbox_pids/2,
find_children_node_pids/2,
find_children_preds/2,
find_children_spec_pre... | null | https://raw.githubusercontent.com/angelhof/flumina/9602454b845cddf8e3dff8c54089c7f970ee08e1/src/configuration.erl | erlang |
This function creates the configuration
from a tree specification.
- It spawns and creates the nodes
- It initializes the router
Register this node as the master node
Spawns the nodes
Create the configuration tree
Send the configuration tree to all nodes' mailboxes
Spawns the nodes based on the tree configur... | -module(configuration).
-export([create/4,
create/5,
get_mailbox_name_node/1,
get_children/1,
get_children_mbox_pids/1,
get_children_node_names/1,
find_node/2,
find_children/2,
find_children_mbox_pids/2,
find_children_node_pids/2,
find_children_preds/2,
find_children_spec_pre... |
38da7710ae90af9e2202dff6bd3f1f96f5f668bafce4aaab251fff74ab1fba6d | astrada/ocaml-extjs | ext_Loader.mli | * Ext . Loader is the heart of the new dynamic depende ...
{ % < p><a href="#!/api / Ext . Loader " rel="Ext . Loader " class="docClass">Ext . is the heart of the new dynamic dependency loading capability in Ext JS 4 + . It is most commonly used
via the < a href="#!/api / Ext - method - require " rel="Ext - ... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_Loader.mli | ocaml | * {% <p>An array of class names to keep track of the dependency loading order.
This is not guaranteed to be the same everytime due to the asynchronous
nature of the Loader.</p> %}
* {% <p>The get parameter name for the cache buster's timestamp.</p> %}
Defaults to: ['_dc']
* {% <p>Whether or not to en... | * Ext . Loader is the heart of the new dynamic depende ...
{ % < p><a href="#!/api / Ext . Loader " rel="Ext . Loader " class="docClass">Ext . is the heart of the new dynamic dependency loading capability in Ext JS 4 + . It is most commonly used
via the < a href="#!/api / Ext - method - require " rel="Ext - ... |
51e7dd297901c422a8e8c5c75aa56512ca436e572af1a636c49113463eccd53b | metabase/metabase | subscription_test.clj | (ns ^:mb/once metabase-enterprise.advanced-permissions.api.subscription-test
"Permisisons tests for API that needs to be enforced by Application Permissions to create and edit alerts/subscriptions."
(:require
[clojure.test :refer :all]
[metabase.api.alert :as api.alert]
[metabase.api.alert-test :as alert-t... | null | https://raw.githubusercontent.com/metabase/metabase/0288adb5e4ed8ded2798c03c65c7c54a786903ab/enterprise/backend/test/metabase_enterprise/advanced_permissions/api/subscription_test.clj | clojure | manually add another user as recipient | (ns ^:mb/once metabase-enterprise.advanced-permissions.api.subscription-test
"Permisisons tests for API that needs to be enforced by Application Permissions to create and edit alerts/subscriptions."
(:require
[clojure.test :refer :all]
[metabase.api.alert :as api.alert]
[metabase.api.alert-test :as alert-t... |
43e3a81056cea5405ef3eeea2c42fd7b2e737ec0062304f748d1adc0d8fa898d | basho/riak_test | ensemble_vnode_crash.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 - 2014 Basho Technologies , Inc.
%%
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... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ensemble_vnode_crash.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 permissio... | Copyright ( c ) 2013 - 2014 Basho Technologies , Inc.
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(ensemble_vnode_c... |
428d4736b81b7b913c211b7527163942801bcc6dca1f8290b8c8b7a0b2b45b5b | ivankocienski/lspec | 00-basic-examples.lisp | (in-package :cl-user)
(defpackage :lspec-example
(:use :cl :lspec))
(in-package :lspec-example)
(specify "A group of tests"
(around-each
;; do some set up
(yield)
;; cleanup
)
(context "a way of nesting and segmenting tests"
(it "is okay"
(let ((zero 0))
(expect zero :to-be-... | null | https://raw.githubusercontent.com/ivankocienski/lspec/489346b7f53692f2ff9c86748a14ebea89eedfd6/examples/00-basic-examples.lisp | lisp | do some set up
cleanup
set up
tear down
set up
tear down
set up
tear down | (in-package :cl-user)
(defpackage :lspec-example
(:use :cl :lspec))
(in-package :lspec-example)
(specify "A group of tests"
(around-each
(yield)
)
(context "a way of nesting and segmenting tests"
(it "is okay"
(let ((zero 0))
(expect zero :to-be-zero)))
(it "will fail"
... |
2b785f894be65c4505c873a54561747332e5e78929462460a6aa0bca7d4f988b | ghcjs/ghcjs-dom | SQLTransactionErrorCallback.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.SQLTransactionErrorCallback
(newSQLTransactionErrorCallback,
newSQLTransactionE... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SQLTransactionErrorCallback.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.SQLTransactionErrorCallback
(newSQLTransactionErrorCallback,
newSQLTransactionErrorCallbackSync,
newSQLTransactionErrorCallbackAsync, SQLTransactionErrorCallback)
... |
d99c57df673717aad2302638cb2d8047a5088b39b535c1a49f0212a12e9eec49 | ghc/packages-Cabal | CabalLanguage.hs | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -freduction-depth=0 #-}
#else
{-# OPTIONS_GHC -fcontext-stack=151 #-}
#endif
# OPTIONS_GHC -fno - warn - orphans #
module Data.TreeDiff.Instances.CabalLanguage () where
import Data.TreeDiff
import Language.Haskell.Extension (Extension, KnownExtension, Lan... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/Cabal/Cabal-tree-diff/src/Data/TreeDiff/Instances/CabalLanguage.hs | haskell | # OPTIONS_GHC -freduction-depth=0 #
# OPTIONS_GHC -fcontext-stack=151 #
These are big enums, so they are in separate file.
| # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
#else
#endif
# OPTIONS_GHC -fno - warn - orphans #
module Data.TreeDiff.Instances.CabalLanguage () where
import Data.TreeDiff
import Language.Haskell.Extension (Extension, KnownExtension, Language)
instance ToExpr Extension
instance ToExpr KnownExtension
instance ToExpr... |
11d9deb1164f2c90095ae756d99a357ab418a1be34ce2fecd5c8d59b2b646509 | glondu/belenios | group.ml | (**************************************************************************)
(* BELENIOS *)
(* *)
Copyright © 2012 - 2023
(* ... | null | https://raw.githubusercontent.com/glondu/belenios/5306402c15c6a76438b13b8b9da0f45d02a0563d/src/lib/v1/group.ml | ocaml | ************************************************************************
BELENIOS
This program is free softw... | Copyright © 2012 - 2023
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
exemption that compiling , linking , and/or using OpenSSL is allowed .
You should have rece... |
aa0e63050f4063fd9df7051d582b8313a2a8ef20c1ed54f9bb7aad1f635653a0 | adamschoenemann/clofrp | RecSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
{-# LANGUAGE RankNTypes #-}
module CloFRP.Check.RecSpec where
import Test.Tasty.Hspec
import CloFRP.Check.TestUtils
import CloFRP.TestUtils
import CloFRP.QuasiQuoter
import CloFRP.Check.Pr... | null | https://raw.githubusercontent.com/adamschoenemann/clofrp/c26f86aec2cdb8fa7fd317acd13f7d77af984bd3/test-suite/CloFRP/Check/RecSpec.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
let errs e x = fst x `shouldBe` e
without annotations :O
without annotations :O
without annotations :O
we have to wrap it in a "newtype" to make it a functor
-- without annotations :O | # LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
module CloFRP.Check.RecSpec where
import Test.Tasty.Hspec
import CloFRP.Check.TestUtils
import CloFRP.TestUtils
import CloFRP.QuasiQuoter
import CloFRP.Check.Prog
import CloFRP.Check.TypingM
import CloFR... |
2d93ffb3e03dc478d3d0696b589b3d5973b163b4ee4086643f31a19ec20aba0b | np/ling | Fmt.hs | module Ling.Fmt where
import System.Environment (getArgs)
import System.Exit (exitFailure)
import System.IO
import Ling.ErrM
import Ling.Fmt.Albert.Abs as A
import Ling.Fmt.Albert.Layout as A
import Ling.Fmt.Albert.Migrate... | null | https://raw.githubusercontent.com/np/ling/ca942db83ac927420d1ae5e24b4da164394ddbbe/Ling/Fmt.hs | haskell | module Ling.Fmt where
import System.Environment (getArgs)
import System.Exit (exitFailure)
import System.IO
import Ling.ErrM
import Ling.Fmt.Albert.Abs as A
import Ling.Fmt.Albert.Layout as A
import Ling.Fmt.Albert.Migrate... | |
2b204a79231e9b8a321c7b484ca7ce7d0231fe96f261f2586e5eca8badbe6bf4 | kelamg/HtDP2e-workthrough | ex35.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex35) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Fixed-size-Data/ex35.rkt | racket | about the language level of this file in a form that our tools can easily process.
String -> 1String
extracts the last character from a non-empty string
given:
"Datboi" for str
expected:
"i" | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex35) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define (string-last str)
(if (> (string-length str) 0)
(st... |
ce228cdeb15c63b88009340dc6f3ebeca54bdff927da7af44a2e0eceb982a1f1 | schemeway/lalr-scm | calc.scm | ;;;
;;;; Simple calculator in Scheme
;;;
;;
;; This program illustrates the use of the lalr-scm parser generator
;; for Scheme. It is NOT robust, since calling a function with
;; the wrong number of arguments may generate an error that will
;; cause the calculator to crash.
;;;
;;;; The LALR(1) parser... | null | https://raw.githubusercontent.com/schemeway/lalr-scm/e3048fae5809b2869c654bb301e92f6d84d5b0be/calc.scm | scheme |
Simple calculator in Scheme
This program illustrates the use of the lalr-scm parser generator
for Scheme. It is NOT robust, since calling a function with
the wrong number of arguments may generate an error that will
cause the calculator to crash.
The LALR(1) parser
--- Options
output a pa... |
(define calc-parser
(lalr-parser
(output: calc-parser "calc.yy.scm")
output the LALR table to calc.out
(out-table: "calc.out")
(expect: 5)
(ID NUM = LPAREN RPAREN NEWLINE COMMA
(left: + -)
(left: * /)
(nonassoc: uminus))
(lines (lines line) : (di... |
5d6f3d10f5e6648f3b65459189ff9facf3e3c39fce2da04b2fc3b6626a57df2e | lambe-lang/nethra | t03_product.ml | open Common
open Nethra.Toy.Compiler
open Preface_stdlib.Result.Functor (struct
type t = Nethra.Syntax.Source.Region.t Pass.error
end)
let compile_basic_product () =
let result =
Pass.run
{toy|
sig Unit : type
sig unit : Unit
------------
sig pair : (X:type) * X
v... | null | https://raw.githubusercontent.com/lambe-lang/nethra/892b84deb9475021b95bfa6274dc8b70cb3e44ea/test/nethra/toy/s00_compiler/t03_product.ml | ocaml | open Common
open Nethra.Toy.Compiler
open Preface_stdlib.Result.Functor (struct
type t = Nethra.Syntax.Source.Region.t Pass.error
end)
let compile_basic_product () =
let result =
Pass.run
{toy|
sig Unit : type
sig unit : Unit
------------
sig pair : (X:type) * X
v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.