_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
fab692a0e04d33817991dacca970b1f44c8cfa9097bb232f8cc631347a3267b3
neilprosser/mr-maestro
hubot.clj
(ns maestro.hubot (:require [cemerick.url :refer [url]] [cheshire.core :as json] [clojure.string :as str] [clojure.tools.logging :as log] [environ.core :refer [env]] [maestro [environments :as environments] [http :as http]])) (def ...
null
https://raw.githubusercontent.com/neilprosser/mr-maestro/469790fd712262016729c1d83d4b4e11869237a2/src/maestro/hubot.clj
clojure
(ns maestro.hubot (:require [cemerick.url :refer [url]] [cheshire.core :as json] [clojure.string :as str] [clojure.tools.logging :as log] [environ.core :refer [env]] [maestro [environments :as environments] [http :as http]])) (def ...
7adac6605668a6e10982de64459e19b98d561c7ca2bdc8aa6325bb215d01a11d
jimweirich/sicp-study
ex2_24.scm
SICP 2.24 Exercise 2.24 . Suppose we evaluate the expression ( list 1 ( list 2 ( list 3 4 ) ) ) . Give the result printed by the interpreter , the ;; corresponding box-and-pointer structure, and the interpretation of this as a tree ( as in figure 2.6 ) . ;; ANSWER -------------------------------------------...
null
https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter2/ex2_24.scm
scheme
corresponding box-and-pointer structure, and the interpretation of ANSWER ------------------------------------------------------------ +---+---+ +---+---+ +---+---+ +---+---+ | o | o-|----->| o | o-|---->| o | o-|----->| o | / | +-|-+---+ +-|-+---+ +---+---+ +-|-+---+ | ...
SICP 2.24 Exercise 2.24 . Suppose we evaluate the expression ( list 1 ( list 2 ( list 3 4 ) ) ) . Give the result printed by the interpreter , the this as a tree ( as in figure 2.6 ) . (define (count-leaves items) (cond ((null? items) 0) ((pair? items) (+ (count-leaves (car items)) ...
2f2c10c0e0aa890db4d059d7fbec1e9452905090b933d2e496061015072ad0a0
mirage/spamtacus
bayesianBody_005.ml
open Database open BayesianBody_004 let db = db |> Map.add "necessity" { in_spam = 2; in_ham = 4 } |> Map.add "ned" { in_spam = 0; in_ham = 6 } |> Map.add "need" { in_spam = 97; in_ham = 282 } |> Map.add "needed" { in_spam = 23; in_ham = 79 } |> Map.add "needlessly" { in_spam = 0; in_ham = 7 } |> Map.add...
null
https://raw.githubusercontent.com/mirage/spamtacus/9d9882d67b2b24292f7134e7ba87715c3555dae9/bayesian_filter/database/bayesianBody_005.ml
ocaml
open Database open BayesianBody_004 let db = db |> Map.add "necessity" { in_spam = 2; in_ham = 4 } |> Map.add "ned" { in_spam = 0; in_ham = 6 } |> Map.add "need" { in_spam = 97; in_ham = 282 } |> Map.add "needed" { in_spam = 23; in_ham = 79 } |> Map.add "needlessly" { in_spam = 0; in_ham = 7 } |> Map.add...
b6fbe7d401876d05106ab673cc029472a045f526f662f8a8379b3d829e868bbd
danr/hipspec
Queue.hs
{-# LANGUAGE DeriveDataTypeable, TypeFamilies #-} module Main where import Control.Applicative hiding (empty) import Data.Function import Data.Typeable import Test.QuickCheck import Test.QuickSpec hiding (size) import Hip.HipSpec hiding (size) -- Invariant : front is never empty unless back also is data Queue = Qu...
null
https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/examples/old-examples/quickspec/Queue.hs
haskell
# LANGUAGE DeriveDataTypeable, TypeFamilies # Invariant : front is never empty unless back also is These properties are not true , con "True" True
module Main where import Control.Applicative hiding (empty) import Data.Function import Data.Typeable import Test.QuickCheck import Test.QuickSpec hiding (size) import Hip.HipSpec hiding (size) data Queue = Queue { front :: [Int] , back :: [Int] } deriving (Show,Typeable) Equality and Ordering is by lists ins...
2b7e3ea387f89a7bf84a88fbf0bd79ed7b63e642359d14a79635bcbfebb4c87e
korya/efuns
wX_popup.ml
(***********************************************************************) (* *) (* ____ *) (* *) Fabrice Le Fessa...
null
https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/toolkit/wX_popup.ml
ocaml
********************************************************************* ____ ...
Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt Copyright 1999 Institut National de Recherche en Informatique et Automatique . Distributed only by permission . open Xtypes open WX_types type menu = item array and item = label * action and label = string ...
a506a9b2a338eded9f50db2286bb9c4ecada70f1b1c013ca646218c10612baef
cr-org/supernova
PulsarApi_Fields.hs
{- This file was auto-generated from pulsar_api.proto by the proto-lens-protoc program. -} # LANGUAGE ScopedTypeVariables , DataKinds , TypeFamilies , UndecidableInstances , GeneralizedNewtypeDeriving , MultiParamTypeClasses , FlexibleContexts , FlexibleInstances , PatternSynonyms , MagicHash , NoImplicitPrelude , Data...
null
https://raw.githubusercontent.com/cr-org/supernova/602409a18f47a38541ba24f5e885199efd383f48/lib/src/Proto/PulsarApi_Fields.hs
haskell
This file was auto-generated from pulsar_api.proto by the proto-lens-protoc program. # OPTIONS_GHC -Wno-unused-imports# # OPTIONS_GHC -Wno-duplicate-exports#
# LANGUAGE ScopedTypeVariables , DataKinds , TypeFamilies , UndecidableInstances , GeneralizedNewtypeDeriving , MultiParamTypeClasses , FlexibleContexts , FlexibleInstances , PatternSynonyms , MagicHash , NoImplicitPrelude , DataKinds , BangPatterns , TypeApplications , OverloadedStrings , DerivingStrategies # # OPTION...
6e3e64bb2c73562f0502235a032aea0c2754ae1dc7c8e69439200035b82d5223
Metaxal/bazaar
comparison.rkt
#lang racket/base (require bazaar/order) (provide (all-from-out bazaar/order))
null
https://raw.githubusercontent.com/Metaxal/bazaar/2968178aa62288c8ff41018a42dd306afb458046/comparison.rkt
racket
#lang racket/base (require bazaar/order) (provide (all-from-out bazaar/order))
855661b0954d8702460473239187cc7d8b6907046f721ce96b997b18c11627ca
ucsd-progsys/liquidhaskell
T743_mini.hs
{-@ LIQUID "--expect-any-error" @-} module T743_mini (bar) where @ bar : : @ bar :: Int bar = 2 - 10 data Foo a = FooCon a data Dict = DictCon @ mkDict : : Dict @ mkDict :: Foo Int -> Dict mkDict _ = DictCon dict = mkDict dictList dictList = readListPrecDefault dict {-@ readListPrecDefault :: Dict -> F...
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/neg/T743_mini.hs
haskell
@ LIQUID "--expect-any-error" @ @ readListPrecDefault :: Dict -> Foo Int @
module T743_mini (bar) where @ bar : : @ bar :: Int bar = 2 - 10 data Foo a = FooCon a data Dict = DictCon @ mkDict : : Dict @ mkDict :: Foo Int -> Dict mkDict _ = DictCon dict = mkDict dictList dictList = readListPrecDefault dict readListPrecDefault :: Dict -> Foo Int readListPrecDefault = undefined
6a793a3930e00e28ab1bd60937da83cfe668e2d519cb91ac3079797b792f4b10
charlieg/Sparser
loader.lisp
;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(CTI-source LISP) -*- copyright ( c ) 1990,1991 Content Technologies Inc. copyright ( c ) 1991 -- all rights reserved ;;; ;;; File: "loader" Module : " model;sl : whos news : tests : " version : 1.2 November 1991 1.1 ( 6/27 ) switched to loadi...
null
https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/model/sl/Who's-News/tests/loader.lisp
lisp
-*- Mode:LISP; Syntax:Common-Lisp; Package:(CTI-source LISP) -*- File: "loader" moved to the corpus tests : tests : tests :
copyright ( c ) 1990,1991 Content Technologies Inc. copyright ( c ) 1991 -- all rights reserved Module : " model;sl : whos news : tests : " version : 1.2 November 1991 1.1 ( 6/27 ) switched to loading the logicals from the corpus level 1.2 ( 11/25 v2.1 ) commented out everything except the or...
4450c9f7f5da8cf7658bb26a15d0080eb9c403444295a2b42ce922daae92bc8a
RunOrg/RunOrg
person.ml
(* © 2014 RunOrg *) include PersonLib.Commands include PersonLib.Queries include PersonLib.Auth
null
https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/person.ml
ocaml
© 2014 RunOrg
include PersonLib.Commands include PersonLib.Queries include PersonLib.Auth
00ab4da38b8c0aea3f1ccf0f9e2f39490fcfd92f80aa0853dd6b847a124e890b
heroku/sdiff
demo.erl
-module(demo). -export([run/1]). run(Port) -> application:ensure_all_started(ranch), application:ensure_all_started(sdiff), ets:new(client, [named_table, public, set]), ets:new(server, [named_table, public, set]), sdiff_serv:start_link({local,server}, fun(K) -> ...
null
https://raw.githubusercontent.com/heroku/sdiff/15e3fb2974919b7349387288a89881c2850f3073/demo/demo.erl
erlang
pre-populate the client here communicate to the tree
-module(demo). -export([run/1]). run(Port) -> application:ensure_all_started(ranch), application:ensure_all_started(sdiff), ets:new(client, [named_table, public, set]), ets:new(server, [named_table, public, set]), sdiff_serv:start_link({local,server}, fun(K) -> ...
1f36c92d96a12a73afdb50050beb21f5ebbce1317c3b4018ac466d7d098968ce
aantron/luv
helpers.ml
This file is part of Luv , released under the MIT license . See LICENSE.md for details , or visit . details, or visit . *) module type WITH_DATA_FIELD = sig type 'kind base type 'kind t = ('kind base) Ctypes.structure val set_data : ([ `Base ] t) Ctypes.ptr -> unit Ctypes.ptr -> unit val get_data ...
null
https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/src/helpers.ml
ocaml
This file is part of Luv , released under the MIT license . See LICENSE.md for details , or visit . details, or visit . *) module type WITH_DATA_FIELD = sig type 'kind base type 'kind t = ('kind base) Ctypes.structure val set_data : ([ `Base ] t) Ctypes.ptr -> unit Ctypes.ptr -> unit val get_data ...
5ed64bc3a8d322508051514fc91b4d5b9183ec34eabc20041b4c37135aa245ce
satos---jp/mincaml_self_hosting
yacc_1_main.ml
let buf = Lexing.from_channel stdin let rec main _ = let v = Yacc_1.toplevel Yacc_1_lex.main buf in print_int v; print_string "\n"; if v < 0 then () else main () let _ = main ()
null
https://raw.githubusercontent.com/satos---jp/mincaml_self_hosting/5fdf8b5083437d7607a924142eea52d9b1de0439/test/yacc_1_main.ml
ocaml
let buf = Lexing.from_channel stdin let rec main _ = let v = Yacc_1.toplevel Yacc_1_lex.main buf in print_int v; print_string "\n"; if v < 0 then () else main () let _ = main ()
64394550cbc2b3a1624eb6b545590681c62c932ad3c8fcf3fc8ffa5e5dff1cdf
nodew/haskell-dapr
Setup.hs
import Data.ProtoLens.Setup main = defaultMainGeneratingProtos "proto"
null
https://raw.githubusercontent.com/nodew/haskell-dapr/26eaa2e7c04981db3a15da1f9ceef5f3d046f686/dapr-proto/Setup.hs
haskell
import Data.ProtoLens.Setup main = defaultMainGeneratingProtos "proto"
933510717d50fa5f2e5c23802c9edf1d2a35079d25c9907d904e8500e7b2f041
heidegger/JSConTest
utils.mli
* Some utils @author : @author: Phillip Heidegger *) * [ first order v1 v2 ] returns [ Some true ] with if v1 should be generated before v2 with respect to an order [ order ] ( e.g. generated by [ get_order ] ) . [ Some false ] is returned if v2 < v1 . Otherwise , [ None ] is ret...
null
https://raw.githubusercontent.com/heidegger/JSConTest/7c807a76af998da25775fba1f5cbe1cf8031d121/ocaml/utils/utils.mli
ocaml
* Some utils @author : @author: Phillip Heidegger *) * [ first order v1 v2 ] returns [ Some true ] with if v1 should be generated before v2 with respect to an order [ order ] ( e.g. generated by [ get_order ] ) . [ Some false ] is returned if v2 < v1 . Otherwise , [ None ] is ret...
1b14c7a6eced401e30a883781bec284262df42e70ca0f24f6efc256255b69cb2
aksh-at/rss-to-email
rsstoemail.clj
(ns datomic.ion.rsstoemail (:require [datomic.client.api :as d] [datomic.ion.cast :as cast] [datomic.ion.rsstoemail.mailer :as mailer] [datomic.ion.rsstoemail.poller :as poller] [datomic.ion.rsstoemail.schema :as schema] [datomic.ion.rsstoemail.db-utils :as db-utils])) (cast/initialize-redirect :st...
null
https://raw.githubusercontent.com/aksh-at/rss-to-email/8303440aabfeecfdae00e5e3720950c5113450b1/src/datomic/ion/rsstoemail.clj
clojure
Manage existing subs Poller
(ns datomic.ion.rsstoemail (:require [datomic.client.api :as d] [datomic.ion.cast :as cast] [datomic.ion.rsstoemail.mailer :as mailer] [datomic.ion.rsstoemail.poller :as poller] [datomic.ion.rsstoemail.schema :as schema] [datomic.ion.rsstoemail.db-utils :as db-utils])) (cast/initialize-redirect :st...
fa2ff49edbb031cae39f79b4877b39619879dda6602daaa398c0f3c5b97ee43b
THISISDINOSAUR/Anatomy
lexer-test.rkt
#lang br (require "lexer.rkt" brag/support rackunit) (define (lex str) (apply-lexer anatomy-lexer str)) (check-equal? (lex "") empty) (check-equal? (lex " ") (list (srcloc-token (token " " #:skip? #t) (srcloc 'string #f #f 1 1)))) (check-equal? (lex "//comment ignored\n") (list (srcloc-toke...
null
https://raw.githubusercontent.com/THISISDINOSAUR/Anatomy/883aa140c41cd375575a2944bda79608c660935b/reader/lexer-test.rkt
racket
#lang br (require "lexer.rkt" brag/support rackunit) (define (lex str) (apply-lexer anatomy-lexer str)) (check-equal? (lex "") empty) (check-equal? (lex " ") (list (srcloc-token (token " " #:skip? #t) (srcloc 'string #f #f 1 1)))) (check-equal? (lex "//comment ignored\n") (list (srcloc-toke...
477bf18760915775562bfa66aa46b88cfed4f78a9d84caf2b42d9457de1ed555
scrintal/heroicons-reagent
magnifying_glass.cljs
(ns com.scrintal.heroicons.outline.magnifying-glass) (defn render [] [:svg {:xmlns "" :fill "none" :viewBox "0 0 24 24" :strokeWidth "1.5" :stroke "currentColor" :aria-hidden "true"} [:path {:strokeLinecap "round" :strokeLinejoin "round...
null
https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/magnifying_glass.cljs
clojure
(ns com.scrintal.heroicons.outline.magnifying-glass) (defn render [] [:svg {:xmlns "" :fill "none" :viewBox "0 0 24 24" :strokeWidth "1.5" :stroke "currentColor" :aria-hidden "true"} [:path {:strokeLinecap "round" :strokeLinejoin "round...
88b865a893eab097b2a553a7379528438f54bdb9328e2699a265c65f9025e516
melange-re/melange
melc_cli.ml
Copyright ( C ) 2022- Authors of Melange * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later version ....
null
https://raw.githubusercontent.com/melange-re/melange/13edf6108d884e64cd510bce077ef2ce73de6a97/jscomp/main/melc_cli.ml
ocaml
The args in this module are accepted by the CLI but ignored. They exist * for compatibility with currently published packages. Different than Ext_cli_args because we need to normalize `-w -foo` to * `-w=-foo`
Copyright ( C ) 2022- Authors of Melange * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later version ....
41ac9fe32d1cbd73b53b2b8d2448148de1807f65c1cb3e41d1172eff80d663a2
facebook/pyre-check
serverTest.ml
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
null
https://raw.githubusercontent.com/facebook/pyre-check/fa38aa1180d4bb7d1c334c2846aca0ed14e22399/source/server/test/serverTest.ml
ocaml
We assume that watchman root is the same as global root. Open a connection to the started server and send some test messages.
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
891d4eb4c01544c5157e3fa9a0c7d8393b006726d314b07fb5498f6667624ab5
hugoduncan/swell
api.clj
(ns swell.api "A CL style restart library for clojure." (:require [swell.internal :as internal])) (defmacro defmacro-fwd [sym ns] (let [args (gensym "args")] `(defmacro ~sym [& ~args] `(~'~(symbol (name ns) (name sym)) ~@~args)))) (try (require 'swell.slingshot) (defmacro-fwd with-exception-...
null
https://raw.githubusercontent.com/hugoduncan/swell/51932d92b3c4dc13393a28426a4f139b7880ad72/src/swell/api.clj
clojure
(ns swell.api "A CL style restart library for clojure." (:require [swell.internal :as internal])) (defmacro defmacro-fwd [sym ns] (let [args (gensym "args")] `(defmacro ~sym [& ~args] `(~'~(symbol (name ns) (name sym)) ~@~args)))) (try (require 'swell.slingshot) (defmacro-fwd with-exception-...
27adfe76bb34d1d80669a5b9c3f58b53c7abf1fe0da13191c0289123a4c6a6f4
gotthardp/erlang-ntlm
ntlm_auth.erl
% Copyright ( c ) 2016 - 2019 < > % All rights reserved. Distributed under the terms of the MIT License . See the LICENSE file . % -module(ntlm_auth). -export([negotiate/0, authenticate/5]). -define(NEGOTIATE_HEADER, 40). % length of the fixed-size fields before payload -define(AUTHENTICATE_HEADER, 72). negoti...
null
https://raw.githubusercontent.com/gotthardp/erlang-ntlm/9e78be32dd627d350f7ff0c52693c46b4e25fb02/src/ntlm_auth.erl
erlang
All rights reserved. length of the fixed-size fields before payload NEGOTIATE_MESSAGE NTLMSSP_NEGOTIATE_DATAGRAM NTLMSSP_NEGOTIATE_SEAL (unused) NTLM_NEGOTIATE_OEM NTLMSSP_NEGOTIATE_UNICODE NTLMSSP_NEGOTIATE_ALWAYS_SIGN (unused) NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPL...
Copyright ( c ) 2016 - 2019 < > Distributed under the terms of the MIT License . See the LICENSE file . -module(ntlm_auth). -export([negotiate/0, authenticate/5]). -define(AUTHENTICATE_HEADER, 72). negotiate() -> NEGOTIATE flags in the little endian byte - order NTLMSSP_NEGOTIATE_LM_KEY NTLMSSP_REQUES...
b7138937ed88e42a2e7530888b92a7b7c656cb50e73a87e95c39002b66198e04
google/ormolu
inline-comment-1-out.hs
showPs env ((n, _, Let _ t v) : bs) = " " ++ show n ++ " : " ++ showEnv env ({- normalise ctxt env -} t) ++ " = " ++ showEnv env ({- normalise ctxt env -} v) ++ "\n" ++ showPs env bs showPs env ((n, _, b) : bs) = " " ++ show n ++ " : " ++ showEnv env ({- normalise ctxt env -} (binderTy...
null
https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/other/inline-comment-1-out.hs
haskell
normalise ctxt env normalise ctxt env normalise ctxt env
showPs env ((n, _, Let _ t v) : bs) = " " ++ show n ++ " : " ++ " = " ++ "\n" ++ showPs env bs showPs env ((n, _, b) : bs) = " " ++ show n ++ " : " ++ "\n" ++ showPs env bs
816d0b9196d36d421c0a131026bae0e1e7510e737cf3fdc169db37884b11d772
MercuryTechnologies/ghc-specter
Main.hs
# LANGUAGE ApplicativeDo # module Main where import Data.Aeson as A import Data.ByteString.Lazy as B (readFile, split, toStrict) import Data.Char (ord) import Data.Text.Encoding (decodeUtf8') import Data.Traversable (for) import Lib import Options.Applicative data Opts = Opts { file :: FilePath } deriving (Sho...
null
https://raw.githubusercontent.com/MercuryTechnologies/ghc-specter/6954b858cb307b66d3d633e8287fa19dc46469a1/ghc-build-analyzer/app/Main.hs
haskell
# LANGUAGE ApplicativeDo # module Main where import Data.Aeson as A import Data.ByteString.Lazy as B (readFile, split, toStrict) import Data.Char (ord) import Data.Text.Encoding (decodeUtf8') import Data.Traversable (for) import Lib import Options.Applicative data Opts = Opts { file :: FilePath } deriving (Sho...
b40691a4e83b343f3a053f9ee39204f7997fe3ba4ad95b6c85bb8d73e4aa4a91
kowainik/hit-on
Tag.hs
| Module : Hit . Git . Tag Copyright : ( c ) 2020 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > Stability : Stable Portability : Portable @hit tag@ command runner and helpers . Module : Hit...
null
https://raw.githubusercontent.com/kowainik/hit-on/c6b3fc764a8b6cc69542e935a0715985fe72eba6/src/Hit/Git/Tag.hs
haskell
| @hit tag@ command. delete tag locally delete tag remotely
| Module : Hit . Git . Tag Copyright : ( c ) 2020 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > Stability : Stable Portability : Portable @hit tag@ command runner and helpers . Module : Hit...
704e984f8da203fa60572a074e6bda9de538389bfcbcfdd049833f6beeaf019c
Perry961002/SICP
exe4.62.scm
; 规则定义了如果一个列表里只有一个元素,那么这个元素就是最后一个元素 (rule (last-pair (?x) (?x))) ; 规则定义了如果x是cdr部分的最后一个元素,那么这个元素就是最后一个元素 (rule (last-pair (?y . ?z) (?x)) (last-pair (?z) (?x)))
null
https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap4/exercise/exe4.62.scm
scheme
规则定义了如果一个列表里只有一个元素,那么这个元素就是最后一个元素 规则定义了如果x是cdr部分的最后一个元素,那么这个元素就是最后一个元素
(rule (last-pair (?x) (?x))) (rule (last-pair (?y . ?z) (?x)) (last-pair (?z) (?x)))
34a2c0e382757521192c995b4ab47f31839fc1782b629459e20cb83006858eb2
graninas/Andromeda
TranslationTest.hs
{-# LANGUAGE Rank2Types #-} # LANGUAGE FlexibleContexts # module Test.TranslationTest where -- import Control . Lens hiding ( ) import Control . Monad . Trans . State as S import Control . Monad import Control . Monad . IO.Class ( liftIO ) -- import qualified Data.Map as M import Data . Maybe -- -- import T...
null
https://raw.githubusercontent.com/graninas/Andromeda/6b56052bca64fc6f55a28f8001dd775a744b95bf/trash/TranslationTest.hs
haskell
# LANGUAGE Rank2Types # import qualified Data.Map as M import Test.Common import Paths_Andromeda TODO: move code into lib enableScriptTranslation st = do assertNoScriptTranslation assign scriptTranslation (Just st) disableScriptTranslation = assign scriptTranslation Nothing isScriptTranslation = d...
# LANGUAGE FlexibleContexts # module Test.TranslationTest where import Control . Lens hiding ( ) import Control . Monad . Trans . State as S import Control . Monad import Control . Monad . IO.Class ( liftIO ) import Data . Maybe isScriptTranslation : : mbst < - use scriptTranslation mbst < -...
609807bf836c2549702fee43325af7878c622249adf0761592a80e50096164a4
fulcro-legacy/semantic-ui-wrapper
ui_table_header.cljs
(ns fulcrologic.semantic-ui.collections.table.ui-table-header (:require [fulcrologic.semantic-ui.factory-helpers :as h] ["semantic-ui-react/dist/commonjs/collections/Table/TableHeader" :default TableHeader])) (def ui-table-header "A table can have a header. Props: - as (custom): An element type to...
null
https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/collections/table/ui_table_header.cljs
clojure
(ns fulcrologic.semantic-ui.collections.table.ui-table-header (:require [fulcrologic.semantic-ui.factory-helpers :as h] ["semantic-ui-react/dist/commonjs/collections/Table/TableHeader" :default TableHeader])) (def ui-table-header "A table can have a header. Props: - as (custom): An element type to...
c454abf3bbed6b8b2bdabf319bc621ae2784dc9d2750f515b17705db07c65916
yutopp/rill
subcommand_ar.ml
* Copyright yutopp 2021 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2021 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
null
https://raw.githubusercontent.com/yutopp/rill/375b67c03ab2087d0a2a833bd9e80f3e51e2694f/rillc/bin/tool/compile/subcommand_ar.ml
ocaml
* Copyright yutopp 2021 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2021 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
3e0046672bf0ae89cd6023b347d65ae6b3ee7757716538801fdab9bf694cd72a
haroldcarr/learn-haskell-coq-ml-etc
RetrofitDebug.hs
{-# LANGUAGE OverloadedStrings #-} module RetrofitDebug where ------------------------------------------------------------------------------ import qualified Raft as R import qualified Types as R ------------------------------------------------------------------------------ ...
null
https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/logging/structured-log-lines/src/RetrofitDebug.hs
haskell
# LANGUAGE OverloadedStrings # ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- HERE HERE so it can match any type
module RetrofitDebug where import qualified Raft as R import qualified Types as R import qualified LogData as L import Control.Lens import Control.Monad (void, join, when) import qualified Data.ByteString as BS i...
efed3b2522f77ab1fc5f544e735e856195e4799aee8a7f9213f27daa366268e9
borodust/alien-works
utils.lisp
#+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) (require "sb-cltl2")) (cl:defpackage :alien-works.utils.empty (:use)) (defpackage :alien-works.cltl2 (:use #:cl #+sbcl #:sb-cltl2 #+lispworks #:hcl #+ecl #:si #+openmcl #:ccl) #+lispworks (:import-from #:lw #:compile...
null
https://raw.githubusercontent.com/borodust/alien-works/b0df8d8fb5ae281b9a0eb942cc02990acbc90c83/src/utils/utils.lisp
lisp
OUTPUT
#+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) (require "sb-cltl2")) (cl:defpackage :alien-works.utils.empty (:use)) (defpackage :alien-works.cltl2 (:use #:cl #+sbcl #:sb-cltl2 #+lispworks #:hcl #+ecl #:si #+openmcl #:ccl) #+lispworks (:import-from #:lw #:compile...
7b3c591e0f2716b04d3dfcb962952104a6809f90e5361078443f1be1a84ae182
namin/reflection-schemes
imp_tests.scm
(eg (evl #f 1 '()) '((:result . 1))) (eg (evl #f '(+ 1 2 3) '()) '((:result . 6))) (eg (evl #f '(if #t 1 2) '()) '((:result . 1))) (eg (evl #f '(begin 1) '()) '((:result . 1))) (eg (evl #f '(begin (set! my 1) (+ 1 my)) '()) '((:result . 2) (my . 1))) (eg (evl #f '(begin (speculate (set! my 1)) (commit) ...
null
https://raw.githubusercontent.com/namin/reflection-schemes/d3fd61aa7edc8af5f7f2c9783b4e3c5356cd2bd5/01-toyos-jit/imp_tests.scm
scheme
(eg (evl #f 1 '()) '((:result . 1))) (eg (evl #f '(+ 1 2 3) '()) '((:result . 6))) (eg (evl #f '(if #t 1 2) '()) '((:result . 1))) (eg (evl #f '(begin 1) '()) '((:result . 1))) (eg (evl #f '(begin (set! my 1) (+ 1 my)) '()) '((:result . 2) (my . 1))) (eg (evl #f '(begin (speculate (set! my 1)) (commit) ...
e1638c862f550d8be62e58bc46ba4f438a307795c61c40973777116bbc6eeb29
mirage/ocaml-cow
xml.mli
* Copyright ( c ) 2013 < > * Copyright ( c ) 2011 - 2013 < > * Copyright ( c ) 2012 Anil Madhavapeddy < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permiss...
null
https://raw.githubusercontent.com/mirage/ocaml-cow/44cdd5bb66c7096ba94aeb311474cd3f3a3cf1fa/src/xml.mli
ocaml
* XML combinators. * {1 Combinators} * [empty] is the empty XML fragment. * [some t] is [t] if it's not empty, {!empty} otherwise. * [uri t] is [t]. * [tag k v] is [<k>v</k>] * [tago k v] is [k v] if [v] is not [None], otherwise it's {!empty}. * [x ++ y] is [x y]
* Copyright ( c ) 2013 < > * Copyright ( c ) 2011 - 2013 < > * Copyright ( c ) 2012 Anil Madhavapeddy < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permiss...
4250f0d898749e702cfaa86fa2ef3fbee9263b270c5612fbf3cbcea38e52151d
Decentralized-Pictures/T4L3NT
alpha_context.mli
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > Copyright ( c...
null
https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_alpha/lib_protocol/alpha_context.mli
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > Copyright ( c ) 2019 - 2021 Nomadic Labs < > Copyright ( c ) 2021 , < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to ...
5ef7f153d2b710277cd97b2c233d617349b66d9a63ad638f917c31780498bfce
samrushing/irken-compiler
urandom.scm
;; -*- Mode: Irken -*- (define (urandom-make) (let ((fd (open "/dev/random" O_RDONLY 0))) (define (get n) (let ((bytes (read fd n))) (when (not (= (string-length bytes) n)) (raise (:Urandom/Underflow n))) bytes)) get ))
null
https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/lib/urandom.scm
scheme
-*- Mode: Irken -*-
(define (urandom-make) (let ((fd (open "/dev/random" O_RDONLY 0))) (define (get n) (let ((bytes (read fd n))) (when (not (= (string-length bytes) n)) (raise (:Urandom/Underflow n))) bytes)) get ))
a4ac0ca98e737771bdd61e70974a190ca25f7be5c756b39bca9e9a34914b7885
finnishtransportagency/harja
budjettisuunnittelu.cljc
(ns harja.domain.budjettisuunnittelu (:require [clojure.spec.alpha :as s] [specql.transform :as tx] [specql.rel] [harja.kyselyt.specql] [harja.domain.toimenpideinstanssi :as tpi] #?(:clj [harja.kyselyt.specql-db :refer [define-tables]])) #?(:cljs (:re...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/3fc631a035ca25987651bc759bb7ae9dc659c390/src/cljc/harja/domain/budjettisuunnittelu.cljc
clojure
(ns harja.domain.budjettisuunnittelu (:require [clojure.spec.alpha :as s] [specql.transform :as tx] [specql.rel] [harja.kyselyt.specql] [harja.domain.toimenpideinstanssi :as tpi] #?(:clj [harja.kyselyt.specql-db :refer [define-tables]])) #?(:cljs (:re...
c0d6b5548593dcc66d7b8777329a03b652c9c9788ee96b1b3f81d11aeccca372
emina/rosette
sum.rkt
#lang rosette (define (sum xs) (cond [(null? xs) 0] [(null? (cdr xs)) (car xs)] [(andmap (curry = (car xs)) (cdr xs)) (* (length xs) (cdr xs))] [else (apply + xs)])) (define-symbolic xs integer? #:length 4) (assume (positive? (sum xs))) (verify (assert (ormap positive? xs)))
null
https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/rosette/guide/scribble/error-tracing/sum.rkt
racket
#lang rosette (define (sum xs) (cond [(null? xs) 0] [(null? (cdr xs)) (car xs)] [(andmap (curry = (car xs)) (cdr xs)) (* (length xs) (cdr xs))] [else (apply + xs)])) (define-symbolic xs integer? #:length 4) (assume (positive? (sum xs))) (verify (assert (ormap positive? xs)))
1e1036afae32d9ceb704948553aae0661ee79b8575d28858c7a346bf309b9741
bluddy/rails
menu.ml
open Containers Menu is specialized to 2 type parameters : 1 . The type of the messages it sends 2 . The type of the data it reads into its checkbox and visibility lambdas 1. The type of the messages it sends 2. The type of the data it reads into its checkbox and visibility lambdas *) module L = Utils...
null
https://raw.githubusercontent.com/bluddy/rails/b3cb9307825285bb983c303e3627725b55bccbde/bin/ui/menu.ml
ocaml
a click but no action Not a selection, but noop Get the active char for the menu item function to check checkbox status open for keyboard shortcuts test_enabled: entry can be disabled under some circumstances Compute menu size dynamically start calculating internal y entry coordinates are internal to...
open Containers Menu is specialized to 2 type parameters : 1 . The type of the messages it sends 2 . The type of the data it reads into its checkbox and visibility lambdas 1. The type of the messages it sends 2. The type of the data it reads into its checkbox and visibility lambdas *) module L = Utils...
66d64b36b8d5636f00234faa3fb0c607ab303b28a1c9cae9a801a05ba435cc25
GillianPlatform/Gillian
Proc.ml
(** GIL Procedures *) * Labeled procedures . Every command is annotated with a label , and the gotos indicate to which label one should jump . Labels can be of any type . However , we say " labeled " when the labels are strings , and " indexed " when the labels are integers . Most functions in that work w...
null
https://raw.githubusercontent.com/GillianPlatform/Gillian/064097945f7d70264be49bb0d54369646269de96/GillianCore/GIL_Syntax/Proc.ml
ocaml
* GIL Procedures Replace labels with numbers in the procedure commands Check the arguments correspond * -----------------------------------------------------------------------------------
* Labeled procedures . Every command is annotated with a label , and the gotos indicate to which label one should jump . Labels can be of any type . However , we say " labeled " when the labels are strings , and " indexed " when the labels are integers . Most functions in that work with indexed procedures...
d64a2bc9e62e657a9a88ad298764e94f017b34f615d01499f2520e1ba80e9750
ocaml-multicore/lockfree
mpmc_queue.ml
open Lockfree.Mpmc_relaxed_queue let num_of_elements = ref 500_000 let num_of_pushers = ref 4 let num_of_takers = ref 4 let num_of_iterations = ref 10 let use_cas_intf = ref false let pop = ref Not_lockfree.pop let push = ref Not_lockfree.push let taker queue num_of_elements () = let i = ref 0 in while !i < num_o...
null
https://raw.githubusercontent.com/ocaml-multicore/lockfree/9d5ef7f434b66e09b023a289641edfc2dfd742e8/bench/mpmc_queue.ml
ocaml
define function to start domains start domains run test
open Lockfree.Mpmc_relaxed_queue let num_of_elements = ref 500_000 let num_of_pushers = ref 4 let num_of_takers = ref 4 let num_of_iterations = ref 10 let use_cas_intf = ref false let pop = ref Not_lockfree.pop let push = ref Not_lockfree.push let taker queue num_of_elements () = let i = ref 0 in while !i < num_o...
15ebf3affeaf08400ff9169b6a75ebb5aec2b67875013aec51d6cd8038d28c24
gfour/gic
exmh205.hs
integrate g h a b = integ g h a b 0 0; integ g h a b i s = if i < (b-a) then integ g h a b (i+1) (s + g h (a + i)) else s; trapezoid f x = (f(x) + f(x+1)) `div` 2; square x = x * x; absolute x = if x < 0 then 0-x else x; diff g1 = absolute (integrate g1 square 0 1); result = diff trap...
null
https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/Examples/Num/exmh205.hs
haskell
integrate g h a b = integ g h a b 0 0; integ g h a b i s = if i < (b-a) then integ g h a b (i+1) (s + g h (a + i)) else s; trapezoid f x = (f(x) + f(x+1)) `div` 2; square x = x * x; absolute x = if x < 0 then 0-x else x; diff g1 = absolute (integrate g1 square 0 1); result = diff trap...
c79207655fe12983ac1b69e351fd2a56badb8e0ac68ab71575916f9e24bee82d
nixeagle/cl-irc
mp2eliza.lisp
;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*- Code from Paradigms of AI Programming Copyright ( c ) 1991 File mp2eliza.lisp : 's code for EECS 492 Machine Problem 2 . ;;; assembled from auxfns.lisp, eliza.lisp, eliza1.lisp, patmatch.lisp, and ;;; auxfns (defpackage :eliza (:use :common-lisp) ...
null
https://raw.githubusercontent.com/nixeagle/cl-irc/efaea15f2962107ea9b1a2fad5cd9db492b4247b/tags/0.8.1/example/mp2eliza.lisp
lisp
-*- Mode: Lisp; Syntax: Common-Lisp -*- assembled from auxfns.lisp, eliza.lisp, eliza1.lisp, patmatch.lisp, auxfns patmatch: Pattern matcher from section 6.2 *** *** Once we add a "real" binding, we can get rid of the dummy no-bindings *** fix, rjf 10/1/92 (was <) *** fix, rjf 10/1/92 (used to eval binding ...
Code from Paradigms of AI Programming Copyright ( c ) 1991 File mp2eliza.lisp : 's code for EECS 492 Machine Problem 2 . and (defpackage :eliza (:use :common-lisp) (:export :eliza)) (in-package :eliza) (defun starts-with (list x) "Is x a list whose first element is x?" (and (cons...
2aa5fced63c8218175decc7b0adfefd0428d3e0814758f2ec3f3f58780887e67
racket/racket7
a.rkt
#lang racket/base (printf "pkg-test1-staging/a loaded\n") (exit 0)
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/pkgs/racket-test/tests/pkg/test-pkgs/pkg-test1-staging/a.rkt
racket
#lang racket/base (printf "pkg-test1-staging/a loaded\n") (exit 0)
11c950faa63667a7405962980d4e828d319e10a1af3facfb286aade9c4307bfb
iu-parfunc/lvars
Main.hs
-- #!/usr/bin/env runghc -i.. # LANGUAGE CPP # -- | This module aggregates all the unit tests in this directory. module Main where import Test.Tasty (TestTree, testGroup, defaultMain) import TestHelpers ( defaultMainSeqTests ) import qualified MemoTests import qualified LVishAndIVar import qualified ArrayTests imp...
null
https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/lvish/tests/Main.hs
haskell
#!/usr/bin/env runghc -i.. | This module aggregates all the unit tests in this directory. import qualified SatMapTests import qualified LayeredSatMapTests alltests :: [TestTree] , ArrayTests.tests , MemoTests.tests , MaxPosIntTests.tests , LayeredSatMap.tests , SatMapTests.tests ...
# LANGUAGE CPP # module Main where import Test.Tasty (TestTree, testGroup, defaultMain) import TestHelpers ( defaultMainSeqTests ) import qualified MemoTests import qualified LVishAndIVar import qualified ArrayTests import qualified LogicalTests import qualified SkipListTests import qualified SNZITests import qual...
853039b3b28634d98a6dc57f6041c6108adf8c6951af830e357be22ec954be75
vikram/lisplibraries
adler32.lisp
;;; Copyright ( c ) 2007 , All Rights Reserved ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of condit...
null
https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/salza2-2.0.5/adler32.lisp
lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form...
Copyright ( c ) 2007 , All Rights Reserved DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , (in-package #:salza2) (defconstant +adler32-base+ 65521) (defun adler32-update (adler-high adler-low buf start count) (declare (t...
1956f7f0f7756c686fefeb381b8cf55e5f3d64c5489a9cfd88aff81841b7b8da
Carnap/Carnap
Settings.hs
{-# Language CPP #-} -- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. In addition , you can configure a number of different aspects of Yesod by overriding methods in the Yesod typeclass . That instance is declared in the...
null
https://raw.githubusercontent.com/Carnap/Carnap/99546e377008247c5a1e8de1e294aac8e22584d7/Carnap-Server/Settings.hs
haskell
# Language CPP # | Settings are centralized, as much as possible, into this file. This includes database connection settings, static file locations, etc. | Runtime settings to configure this application. These settings can be loaded from various sources: defaults, environment variables, config files, theoretically...
In addition , you can configure a number of different aspects of Yesod by overriding methods in the Yesod typeclass . That instance is declared in the Foundation.hs file . module Settings where import ClassyPrelude.Yesod import Control.Exception (throw) import Data.Aeson (Result (..), ...
c37693c1907a2b4c3483097e19987181665582cbcf05bab2e9cfe6e1c4461732
RoccoMathijn/programming-in-haskell
chapter04.hs
module Chapter4 where 1 . halve :: [a] -> ([a],[a]) halve xs = (take half xs, drop half xs) where half = length xs `div` 2 2 . third :: [a] -> a third xs = head (tail (tail xs)) third' :: [a] -> a third' xs = xs !! 2 third'' :: [a] -> a third'' (_:_:thrd:_) = thrd 3 . safetail :: [a] -> [a] safeta...
null
https://raw.githubusercontent.com/RoccoMathijn/programming-in-haskell/ef2e3a5fa8c8a82154fdd5cd067d83b1fef1f220/chapter04.hs
haskell
module Chapter4 where 1 . halve :: [a] -> ([a],[a]) halve xs = (take half xs, drop half xs) where half = length xs `div` 2 2 . third :: [a] -> a third xs = head (tail (tail xs)) third' :: [a] -> a third' xs = xs !! 2 third'' :: [a] -> a third'' (_:_:thrd:_) = thrd 3 . safetail :: [a] -> [a] safeta...
d81d91243d790c7e7564ac85f73d8e17bcc22bd5c9297164e92dc76194074b8a
EligiusSantori/L2Apf
enchant.scm
(module logic racket/base (require "../packet/game/client/use_item.scm" "../packet/game/client/enchant_item.scm" (only-in "../system/connection.scm" send-packet) (only-in "../system/event.scm" next-tick!) ) (provide enchant) (define (enchant cn what-id with-id) (send-packet cn (game-client-packet/use-ite...
null
https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/api/enchant.scm
scheme
(module logic racket/base (require "../packet/game/client/use_item.scm" "../packet/game/client/enchant_item.scm" (only-in "../system/connection.scm" send-packet) (only-in "../system/event.scm" next-tick!) ) (provide enchant) (define (enchant cn what-id with-id) (send-packet cn (game-client-packet/use-ite...
cb5c2346f755a99d82e31669dce5213f6d6159ded97da8dad53eac413eaa9b63
cyga/real-world-haskell
NestedLets.hs
-- file: ch03/NestedLets.hs foo = let a = 1 in let b = 2 in a + b -- file: ch03/NestedLets.hs bar = let x = 1 in ((let x = "foo" in x), x) -- file: ch03/NestedLets.hs quux a = let a = "foo" in a ++ "eek!"
null
https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch03/NestedLets.hs
haskell
file: ch03/NestedLets.hs file: ch03/NestedLets.hs file: ch03/NestedLets.hs
foo = let a = 1 in let b = 2 in a + b bar = let x = 1 in ((let x = "foo" in x), x) quux a = let a = "foo" in a ++ "eek!"
f1a260eddbc0c57999bc4f4b29db535c78604980b9735f5e6c78bc5ee73198e0
mokus0/junkbox
Comonads.hs
# LANGUAGE GADTs , RankNTypes # module TypeExperiments.Comonads where import Control.Applicative import Control.Monad import Control.Comonad import Control.Monad.Reader (Reader(..), ask, local) import Data.Monoid import qualified Data.Set as S import Data.List import Text.Regex instance Monoid r => Copointed (Reader ...
null
https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/TypeExperiments/Comonads.hs
haskell
is there a "correct" order for the mappend here? is it just what they chose? a time when it can be realized. base case; ensures values can only be constructed out of a very sketchy idea i had -- seems like lexing could be "almost" comonadic.
# LANGUAGE GADTs , RankNTypes # module TypeExperiments.Comonads where import Control.Applicative import Control.Monad import Control.Comonad import Control.Monad.Reader (Reader(..), ask, local) import Data.Monoid import qualified Data.Set as S import Data.List import Text.Regex instance Monoid r => Copointed (Reader ...
0e48d100bfe9e7dac695f8a7aea20315a087170b087c7409f7fd146b2136d071
kztk-m/sparcl
Syntax.hs
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE StandaloneDeriving #-} # LANGUAGE TypeApplications # {-# LANGUAGE TypeFamilies #-} # LANGUAGE TypeFamilyDependencies # # LANGUAGE UndecidableInstances # {-# LANGUAGE ViewPatterns #-} module Language.Sparcl.Surface.Syntax ( XId, XT...
null
https://raw.githubusercontent.com/kztk-m/sparcl/f52d333ce50e0aa6cb307da08811719f8c684f7d/src/Language/Sparcl/Surface/Syntax.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies # # LANGUAGE ViewPatterns # Surface Syntax located types (not linear) The following would be a bit generous definition, but we want to allow types that are parameterized by multiplicity. max p1 ... p...
# LANGUAGE TypeApplications # # LANGUAGE TypeFamilyDependencies # # LANGUAGE UndecidableInstances # module Language.Sparcl.Surface.Syntax ( XId, XTId, LTy, Ty(..), TConstraint(..), isTyArr, decomposeArrTy, decomposeTyCon, LPat, Pat(..), LExp, Exp(..), Clause(..), Prec(..), Assoc(..), Decls(.....
e083feccff23ecd7a687e3c71a50d0be89c5aeca160b7e5c86e110267b212b9f
MUSTE-Project/MULLE
Tree.hs
# OPTIONS_GHC -Wall -Wno - name - shadowing -Wno - incomplete - patterns # # Language DeriveAnyClass , DeriveGeneric , DerivingStrategies , GeneralizedNewtypeDeriving , LambdaCase , OverloadedStrings , StandaloneDeriving # DeriveAnyClass, DeriveGeneric, DerivingStrategies, GeneralizedNewtypeD...
null
https://raw.githubusercontent.com/MUSTE-Project/MULLE/7908a97e765a21a869ff4ee5c46def9e12360c29/muste/src/Muste/Tree.hs
haskell
import Text.Read (readEither) * Trees challenge here is that we depend on the specific implementation of 'Read', 'Show' and possibly other things. | A semantic category * = Typed Trees This is a representation of gramatically structured natural languages sentences. The representation lends ideas from type | ...
# OPTIONS_GHC -Wall -Wno - name - shadowing -Wno - incomplete - patterns # # Language DeriveAnyClass , DeriveGeneric , DerivingStrategies , GeneralizedNewtypeDeriving , LambdaCase , OverloadedStrings , StandaloneDeriving # DeriveAnyClass, DeriveGeneric, DerivingStrategies, GeneralizedNewtypeD...
786ffc57f81c2caa2944e719923629c64c68da9cc11af7d06984e654610ff36d
travisbrady/flajolet
sbitmap.ml
open Core.Std open Printf module B = Core_extended.Std.Bitarray type t = { nmax: int; error: float; error2: float; m: float; (*v: B.t;*) v: Bitarray.t; mutable l: float; c: int; d: int; r: float; tt: ...
null
https://raw.githubusercontent.com/travisbrady/flajolet/a6c530bf1dd73b9fa8b7185d84a5e20458a3d8af/lib/sbitmap.ml
ocaml
v: B.t;
open Core.Std open Printf module B = Core_extended.Std.Bitarray type t = { nmax: int; error: float; error2: float; m: float; v: Bitarray.t; mutable l: float; c: int; d: int; r: float; tt: float; seed: ...
328c9044e245f60bca6a93eb179482a99b52caee804061f51d15760067627e86
LdBeth/star-lisp
valid-pvar-type.lisp
-*- SYNTAX : COMMON - LISP ; MODE : LISP ; BASE : 10 ; PACKAGE : * SIM - I ; MUSER : YES -*- (in-package :*sim-i) ;;;> *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ ;;;> ;;;> The Thinking Machines *Lisp Simulator is in the public domain. ;;;> You are free to do whatever y...
null
https://raw.githubusercontent.com/LdBeth/star-lisp/034fb97fe8780d6e9fbff7c1d8c4a6b8c331797b/source/valid-pvar-type.lisp
lisp
MODE : LISP ; BASE : 10 ; PACKAGE : * SIM - I ; MUSER : YES -*- > *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+ > > The Thinking Machines *Lisp Simulator is in the public domain. > You are free to do whatever you like with it, including but > not limited to distributing, mod...
(in-package :*sim-i) (defvar *warn-about-integer-dimension* t) (defvar *warn-about-array-rank* t) (defun vicious-dotted-pair-catcher-for-jeff (list) (cond ((null list) nil) ((not (listp (cdr list))) t) (t (or (and (listp (car list)) (vicious-dotted-pair-catcher-for-jeff (car list))) (vicious-...
594992afdd2d17f8dee6bb031ae54e3ff6cc24cad1e18237e061d2c7a2957013
ghcjs/ghcjs
infixDataConst.hs
data Ty1 = Int `InfixConst1` Int deriving Show data Ty2 = Bool `InfixConst2` Bool deriving Show data Ty3 = Ty1 :=> Ty2 deriving Show t = (123 `InfixConst1` 123) :=> (False `InfixConst2` True) main = print t
null
https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/fay/infixDataConst.hs
haskell
data Ty1 = Int `InfixConst1` Int deriving Show data Ty2 = Bool `InfixConst2` Bool deriving Show data Ty3 = Ty1 :=> Ty2 deriving Show t = (123 `InfixConst1` 123) :=> (False `InfixConst2` True) main = print t
3880a1acf11589973ad7bff37dd22db6593417e1ce891832b32eeb158289dee7
dnadales/sandbox
B.hs
-- | module B where data B = B
null
https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/haddock-re-exports/src/B.hs
haskell
|
module B where data B = B
7cd0153e9d7874a2da36c28c84ee86f171799730f536a1a621bbf9b81b8f4386
mcorbin/riemann-discovery
foo.clj
(ns riemann-discovery.edn.foo)
null
https://raw.githubusercontent.com/mcorbin/riemann-discovery/c9f68ed4c90e12526c511e459261f2c408ddc234/test/riemann_discovery/edn/foo.clj
clojure
(ns riemann-discovery.edn.foo)
7dd3e3fbeb384cdbf9b74626242b002d254493f57226c5461cfc2deab274c964
pedestal/pedestal-app
project.clj
Copyright 2013 Relevance , Inc. ; The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( ) ; which can be found in the file epl-v10.html at the root of this distribution. ; ; By using this software in any fashion, you are agreeing to be bound by ; the terms of this licens...
null
https://raw.githubusercontent.com/pedestal/pedestal-app/509ab766a54921c0fbb2dd7c6a3cb20223b8e1a1/app-tools/project.clj
clojure
The use and distribution terms for this software are covered by the which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
Copyright 2013 Relevance , Inc. Eclipse Public License 1.0 ( ) (defproject io.pedestal/pedestal.app-tools "0.3.0-SNAPSHOT" :description "Pedestal tools for application development" :min-lein-version "2.0.0" :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/clojurescript "0.0-1835"]...
3e6d2a2c26f7cd0c69e0bccb1caa3040ecbe6a961416e3f5ce15f2cf5bcbd969
wargrey/graphics
base.rkt
#lang typed/racket (provide (all-defined-out) Stroke-Paint Fill-Paint) (require "digitama/source.rkt") (require "digitama/misc.rkt") (require/provide "digitama/base.rkt" "digitama/stdio.rkt" "digitama/unsafe/convert.rkt") (require/provide "constructor.rkt" "composite.rkt" "resize.rkt") (require/provide "color.rkt" "...
null
https://raw.githubusercontent.com/wargrey/graphics/a361a929f446c3d4aff85a089d36b5c0772d376f/bitmap/base.rkt
racket
-images/#image-fragments path?id=binding
#lang typed/racket (provide (all-defined-out) Stroke-Paint Fill-Paint) (require "digitama/source.rkt") (require "digitama/misc.rkt") (require/provide "digitama/base.rkt" "digitama/stdio.rkt" "digitama/unsafe/convert.rkt") (require/provide "constructor.rkt" "composite.rkt" "resize.rkt") (require/provide "color.rkt" "...
25b2592273659d7c0ec06735d21fc199e57170e34c26374ffa6f2ab0bda1be00
futurice/haskell-mega-repo
Worker.hs
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DerivingStrategies # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} module PlanMill.Worker where import Control.Concurrent ...
null
https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/planmill-client/src/PlanMill/Worker.hs
haskell
# LANGUAGE CPP # # LANGUAGE DeriveAnyClass # # LANGUAGE GADTs # # LANGUAGE OverloadedStrings # # LANGUAGE TypeSynonymInstances # wait. ^ names arbitrary size | 'bracket' pattern ^ names
# LANGUAGE DerivingStrategies # # LANGUAGE FlexibleInstances # module PlanMill.Worker where import Control.Concurrent (ThreadId, forkFinally, killThread) import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TBQueue (TBQueue, isFullTBQueue, newTBQueue, readTBQueue, ...
610f44b3cac63803e22646320c561428491edc55ffa28534fb2fe40f3acb6a31
MyDataFlow/ttalk-server
ejabberd_loglevel.erl
%%%---------------------------------------------------------------------- %%% File : ejabberd_loglevel.erl Author : < > Purpose : Loglevel switcher . %%% %%% ejabberd , Copyright ( C ) 2002 - 2012 ProcessOne , Erlang Solutions Ltd. %%% %%% This program is free software; you can redistribute it and/or ...
null
https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/ejabberd/src/ejabberd_loglevel.erl
erlang
---------------------------------------------------------------------- File : ejabberd_loglevel.erl 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, but WITHOUT ANY WARRANTY; without ...
Author : < > Purpose : Loglevel switcher . ejabberd , Copyright ( C ) 2002 - 2012 ProcessOne , Erlang Solutions Ltd. 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 P...
ea513c6cfdd4e494a14bb53486f1a6622379a8edec78d6549927f0b7d40431d5
samth/zuo
main.rkt
#lang racket/base (require racket/list (for-syntax racket/base)) (require (rename-in zuo/base [define-syntax -define-syntax])) (provide (rename-out [-define-syntax define-syntax])) (provide (all-from-out zuo/base)) ; this is a horrible hack (define-for-syntax bp (build-path (find-executable-path (find-system-path...
null
https://raw.githubusercontent.com/samth/zuo/e8bb2b7587b6a7461d1a2deb182946db0bb80714/main.rkt
racket
this is a horrible hack
#lang racket/base (require racket/list (for-syntax racket/base)) (require (rename-in zuo/base [define-syntax -define-syntax])) (provide (rename-out [-define-syntax define-syntax])) (provide (all-from-out zuo/base)) (define-for-syntax bp (build-path (find-executable-path (find-system-path 'exec-file) ...
68b7e76e4157c09e37e6995b055ab55bd32392a3edf7b2a54a20a90a72f91bda
tekul/broch
Token.hs
# LANGUAGE BangPatterns , OverloadedStrings # module Broch.OAuth2.Token ( TokenType (..) , AccessTokenResponse (..) , TokenError (..) , processTokenRequest ) where import Control.Error import Control.Monad.Trans (lift) import Control.Monad (when) import Data.Aeson hiding (decode) import Data.Aeson...
null
https://raw.githubusercontent.com/tekul/broch/885ace4652cad4dcd806c8c31c1a59bf6a9a3337/Broch/OAuth2/Token.hs
haskell
TODO: newtypes for tokens scopestring etc See #section-5.2 for error handling
# LANGUAGE BangPatterns , OverloadedStrings # module Broch.OAuth2.Token ( TokenType (..) , AccessTokenResponse (..) , TokenError (..) , processTokenRequest ) where import Control.Error import Control.Monad.Trans (lift) import Control.Monad (when) import Data.Aeson hiding (decode) import Data.Aeson...
28ba455efdf147574466db2451c782a8a478d89464ef8839345efcac242d1e80
static-analysis-engineering/codehawk
jCHSSA.mli
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CodeHawk Java Analyzer Author : ------------------------------------------------------------------------------ The MIT License ( MIT ) ...
null
https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchsys/jCHSSA.mli
ocaml
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = CodeHawk Java Analyzer Author : ------------------------------------------------------------------------------ The MIT License ( MIT ) ...
8ca241ef4c76a15a5984ab0bb058f2c0605da11421646aad8205154ec4a76f28
ChrisPenner/Firefly
Response.hs
# language FlexibleInstances # {-# language OverloadedStrings #-} {-# language UndecidableInstances #-} # language RankNTypes # module Web.Firefly.Response ( ToResponse(..) , Json(..) , respond , respondWith ) where import Data.Function ((&)) import Control.Monad.Except import qualified Data.Text as T import...
null
https://raw.githubusercontent.com/ChrisPenner/Firefly/eed9da3409991dcac3b59a462afbee41df4dbd2d/firefly/src/Web/Firefly/Response.hs
haskell
# language OverloadedStrings # # language UndecidableInstances # | A simple newtype wrapper you can use to wrap values, signifying they should be JSON encoded sent with the "application/json" Content-Type. | This class represents all types which can be converted into a valid 'W.Response'. Feel free to implement ad...
# language FlexibleInstances # # language RankNTypes # module Web.Firefly.Response ( ToResponse(..) , Json(..) , respond , respondWith ) where import Data.Function ((&)) import Control.Monad.Except import qualified Data.Text as T import qualified Data.Text.Lazy as TL import Data.Aeson as Aeson import Networ...
122c4bb4bb6f6eb365c1917ee1f955fcefa8fe87c9c8348eb9395a8e70ed5af9
robert-strandh/Second-Climacs
folio.lisp
(cl:in-package #:second-climacs-syntax-common-lisp) ;;; This file contains the definition of a protocol called FOLIO. ;;; Conceptually, a folio consists of a certain number of LINEs, each ;;; line containing a certain number of ITEMs. Lines are numbered ;;; sequentially starting at 0 within a folio, and items are num...
null
https://raw.githubusercontent.com/robert-strandh/Second-Climacs/1d1bc30f4431d8ea7893aea58a63464e216377a4/Code/Syntax/Common-Lisp/folio.lisp
lisp
This file contains the definition of a protocol called FOLIO. Conceptually, a folio consists of a certain number of LINEs, each line containing a certain number of ITEMs. Lines are numbered sequentially starting at 0 within a folio, and items are numbered sequentially starting at 0 within each line. The base cla...
(cl:in-package #:second-climacs-syntax-common-lisp) (defclass folio () ()) (defgeneric line-count (folio)) (defgeneric line-length (folio line-number)) (defgeneric line-contents (folio line-number)) (defgeneric item (folio line-number item-number))
a0f2fde9598104ff159f70dd6c182afbf21ae19024dfc1fa14b8a9c066d94ad0
zadean/xqerl
method_xhtml_SUITE.erl
-module('method_xhtml_SUITE'). -include_lib("common_test/include/ct.hrl"). -export([ all/0, groups/0, suite/0 ]). -export([ init_per_suite/1, init_per_group/2, end_per_group/2, end_per_suite/1 ]). -export(['Serialization-xhtml-1'/1]). -export(['Serialization-xhtml-1a'/1]). -export(['Seri...
null
https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/ser/method_xhtml_SUITE.erl
erlang
-module('method_xhtml_SUITE'). -include_lib("common_test/include/ct.hrl"). -export([ all/0, groups/0, suite/0 ]). -export([ init_per_suite/1, init_per_group/2, end_per_group/2, end_per_suite/1 ]). -export(['Serialization-xhtml-1'/1]). -export(['Serialization-xhtml-1a'/1]). -export(['Seri...
990b30e1846c6a78bd94997eb595e120f79294ba51e9c71f3bd36679ef7e9bcd
caradoc-org/caradoc
TestTree.ml
(*****************************************************************************) (* Caradoc: a PDF parser and validator *) Copyright ( C ) 2015 ANSSI Copyright ( C ) 2015 - 2017 (* ...
null
https://raw.githubusercontent.com/caradoc-org/caradoc/100f53bc55ef682049e10fabf24869bc019dc6ce/test/TestTree.ml
ocaml
*************************************************************************** Caradoc: a PDF parser and validator This program is free software; you can redistribute it and/or modify ...
Copyright ( C ) 2015 ANSSI Copyright ( C ) 2015 - 2017 it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation . You should have rece...
ba88d13af948008d0e5ab59cbec9161de43b5d920d149cce63887b601dd04278
lexi-lambda/racket-collections
collection.rkt
#lang racket/base (require rackunit data/collection racket/set racket/function) (test-case "Basic collection operations (conj)" (check-equal? (conj '() 'a) '(a)) (check-equal? (conj '(a) 'b) '(b a)) (check-equal? (conj #() 'a) #(a)) (check-equal? (conj #(a) 'b) #(a b)) (check-equal? (conj (hash) '(a . b...
null
https://raw.githubusercontent.com/lexi-lambda/racket-collections/c4822fc200b0488922cd6e86b4f2ea7cf8c565da/collections-test/tests/data/collection/collection.rkt
racket
#lang racket/base (require rackunit data/collection racket/set racket/function) (test-case "Basic collection operations (conj)" (check-equal? (conj '() 'a) '(a)) (check-equal? (conj '(a) 'b) '(b a)) (check-equal? (conj #() 'a) #(a)) (check-equal? (conj #(a) 'b) #(a b)) (check-equal? (conj (hash) '(a . b...
00b4788b960c3269a27daa4c921620e0d808b98d4ddb784d266327eba2f52205
jimpil/jedi-time
nav_test.clj
(ns jedi-time.nav-test (:require [clojure.test :refer :all] [jedi-time.core :as jdt] [clojure.datafy :as d]) (:import (java.time ZonedDateTime OffsetDateTime LocalDateTime LocalDate LocalTime ...
null
https://raw.githubusercontent.com/jimpil/jedi-time/7224780812308b70df10a68b949c70758b80b32a/test/jedi_time/nav_test.clj
clojure
(ns jedi-time.nav-test (:require [clojure.test :refer :all] [jedi-time.core :as jdt] [clojure.datafy :as d]) (:import (java.time ZonedDateTime OffsetDateTime LocalDateTime LocalDate LocalTime ...
6222d80a85f660eabf812db5e0c79facdc3877981b0c5678137d70f4cc806072
NorfairKing/intray
Checkout.hs
# LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # module Intray.Web.Server.Handler.Checkout ( getCheckoutR, getCheckoutSuccessR, getCheckoutCanceledR, ) where import Data.Time import Intray.Client import Intray.Web.Server.Foundation import Text.Julius import Text.Time.Pretty import Yesod getCheck...
null
https://raw.githubusercontent.com/NorfairKing/intray/b1b4c14c1a4e419d2a1bf96d757780981229a1e2/intray-web-server/src/Intray/Web/Server/Handler/Checkout.hs
haskell
# LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # module Intray.Web.Server.Handler.Checkout ( getCheckoutR, getCheckoutSuccessR, getCheckoutCanceledR, ) where import Data.Time import Intray.Client import Intray.Web.Server.Foundation import Text.Julius import Text.Time.Pretty import Yesod getCheck...
751ac0d96366ed0e71f70661f48d52e229f610ec069f780de8ec5c686468cd60
tweag/asterius
cgrun077.hs
# LANGUAGE BangPatterns , CPP , MagicHash # module Main ( main ) where import Data.Bits import GHC.Prim import GHC.Word #include "MachDeps.h" main = putStr (test_lzCnt ++ "\n" ++ test_lzCnt8 ++ "\n" ++ test_lzCnt16 ++ "\n" ++ test_lzCnt32 ++ "\n" ++ test_lzCnt64 ++ "\n" ...
null
https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/codeGen/cgrun077.hs
haskell
# LANGUAGE BangPatterns , CPP , MagicHash # module Main ( main ) where import Data.Bits import GHC.Prim import GHC.Word #include "MachDeps.h" main = putStr (test_lzCnt ++ "\n" ++ test_lzCnt8 ++ "\n" ++ test_lzCnt16 ++ "\n" ++ test_lzCnt32 ++ "\n" ++ test_lzCnt64 ++ "\n" ...
b8d608f307e0da59def790314a345e875f25f77c167b9116e76089e8348b7c1d
softwarelanguageslab/maf
R5RS_WeiChenRompf2019_the-little-schemer_ch3-5.scm
; Changes: * removed : 0 * added : 0 * swaps : 1 ; * negated predicates: 0 * swapped branches : 2 ; * calls to id fun: 0 (letrec ((rember (lambda (a lat) (if (null? lat) () (if (eq? (car lat) a) (cdr lat) ...
null
https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_WeiChenRompf2019_the-little-schemer_ch3-5.scm
scheme
Changes: * negated predicates: 0 * calls to id fun: 0
* removed : 0 * added : 0 * swaps : 1 * swapped branches : 2 (letrec ((rember (lambda (a lat) (if (null? lat) () (if (eq? (car lat) a) (cdr lat) (cons (car lat) (rember a (cdr lat)))))))) (rember ...
f3ebe0251cec48f09797667bda4658e7dd12c435069ec7c52180e1251d236c87
raaz-crypto/raaz
ChaCha20Spec.hs
module Encrypt.ChaCha20Spec where import Encrypt import qualified Encrypt.ChaCha20.CPortable as CP import qualified Encrypt.ChaCha20.CHandWritten as CH spec :: Spec spec = do describe "encryption" $ encryptSpec [ (CP.name, CP.encrypt) , (CH.name, CH.encrypt) ...
null
https://raw.githubusercontent.com/raaz-crypto/raaz/f3352b6b21ea7bba3e47a507b25dc69f3feb4f97/tests/comparative/Encrypt/ChaCha20Spec.hs
haskell
module Encrypt.ChaCha20Spec where import Encrypt import qualified Encrypt.ChaCha20.CPortable as CP import qualified Encrypt.ChaCha20.CHandWritten as CH spec :: Spec spec = do describe "encryption" $ encryptSpec [ (CP.name, CP.encrypt) , (CH.name, CH.encrypt) ...
2413c253cf0715e1259d37c3f29d52535d2b196c5cccba878d8b0ba770218d80
rkallos/wrek
wrek_sleep_vert.erl
-module(wrek_sleep_vert). -behaviour(wrek_vert). -export([run/2]). run(_Args, Parent) -> Pwd = os:cmd("pwd") -- "\n", {ok, Fun} = wrek_vert:exec(Parent, Pwd, "sleep 9000"), ok = Fun(), {ok, #{}}.
null
https://raw.githubusercontent.com/rkallos/wrek/3859e9efdf21227e6e8e0ea81095b229eceb6641/test/verts/wrek_sleep_vert.erl
erlang
-module(wrek_sleep_vert). -behaviour(wrek_vert). -export([run/2]). run(_Args, Parent) -> Pwd = os:cmd("pwd") -- "\n", {ok, Fun} = wrek_vert:exec(Parent, Pwd, "sleep 9000"), ok = Fun(), {ok, #{}}.
27cf351e3fc92d39a07cfdd7396a665eff6e0faf49a787768c936a2b54754c98
UU-ComputerScience/js-asteroids
Events.hs
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------------------- | Module : Events Copyright : ( c ) 2003 License : wxWindows Maintainer : Stability : provisional Portability : portable Dynamically ...
null
https://raw.githubusercontent.com/UU-ComputerScience/js-asteroids/b7015d8ad4aa57ff30f2631e0945462f6e1ef47a/wxasteroids/src/Graphics/UI/WXCore/Events.hs
haskell
# OPTIONS -fglasgow-exts # --------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------- import Foreign.StablePtr import Foreign.Ptr import Foreign.C.String import Foreign.Marshal.Array import Foreign.Marsh...
| Module : Events Copyright : ( c ) 2003 License : wxWindows Maintainer : Stability : provisional Portability : portable Dynamically set ( and get ) event handlers for basic wxWindows events . Note that one should always call ' skipCurrentEvent ' when...
75b7f27e94acc3730508ecb8fe015222f71cc793bd60099d4915fe5b912feb6e
zwizwa/erl_tools
ws_layout.erl
-module(ws_layout). -export([button/2, button/3, clickable/3, tagged_table/1, table/2, input/2]). Layout functions for ws_widget style web widgets . First argument is Env that is passed to a widget 's layout function %% as {layout, Env}. %% FIXME: Why is this here? Replaced with button/3 belo...
null
https://raw.githubusercontent.com/zwizwa/erl_tools/affd4060ab5b963e0cc8fcfd4a1ca5023aa518d3/src/ws_layout.erl
erlang
as {layout, Env}. FIXME: Why is this here? Replaced with button/3 below button(#{ send := Send }, ID, Text) -> ID_enc = ws:encode_id(ID), {button, [{onclick, Send}, {'data-decoder', button}, %% Type conversion for js->erl messages. % DOM behavior for erl->js messages % erl<->js messages ...
-module(ws_layout). -export([button/2, button/3, clickable/3, tagged_table/1, table/2, input/2]). Layout functions for ws_widget style web widgets . First argument is Env that is passed to a widget 's layout function button(Env, Tag) -> Text = tools:format_binary("~p",[Tag]), button(E...
184645f3d622a64522a52b88937b91c24413c908c6ae35b356a007c008d4f180
alexandergunnarson/quantum
core.cljc
(ns quantum.test.apis.google.youtube.core (:require [quantum.apis.google.youtube.core :as ns])) #_(defn test:access-token []) #_(defn test:list-channels []) #_(defn test:delete-playlist! [id])
null
https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/test/quantum/test/apis/google/youtube/core.cljc
clojure
(ns quantum.test.apis.google.youtube.core (:require [quantum.apis.google.youtube.core :as ns])) #_(defn test:access-token []) #_(defn test:list-channels []) #_(defn test:delete-playlist! [id])
c909e02a3101d1fbcbcd810ab48d417c807e497d98c52c7f8dfdf25aa431cded
yawaramin/bs-webapi
Yawaramin_BsWebapi_Test.ml
module Web = Yawaramin_BsWebapi let test ( target : Web.EventTarget.this Web . EventTarget.t ) = Web . Element.className target module Web = Yawaramin_BsWebapi let test (target: Web.EventTarget.this Web.EventTarget.t) = Web.Element.className target *)
null
https://raw.githubusercontent.com/yawaramin/bs-webapi/0c8646ad8096685e175db8e18bee8ea4f364d567/src/Yawaramin_BsWebapi/Yawaramin_BsWebapi_Test.ml
ocaml
module Web = Yawaramin_BsWebapi let test ( target : Web.EventTarget.this Web . EventTarget.t ) = Web . Element.className target module Web = Yawaramin_BsWebapi let test (target: Web.EventTarget.this Web.EventTarget.t) = Web.Element.className target *)
a56c1303608b25efa0c9ebe349d2aeb6cd6e3218ef8b90d10628d13f8e34d3a2
nunchaku-inria/nunchaku
Problem.mli
(* This file is free software, part of nunchaku. See file "license" for more details. *) * { 1 Top - Level Statements ( with locations ) } type metadata = ProblemMetadata.t type loc = Location.t type id = ID.t type 'a printer = Format.formatter -> 'a -> unit type 'a to_sexp = 'a -> Sexp_lib.t type 'a or_error = ('a...
null
https://raw.githubusercontent.com/nunchaku-inria/nunchaku/16f33db3f5e92beecfb679a13329063b194f753d/src/core/Problem.mli
ocaml
This file is free software, part of nunchaku. See file "license" for more details. * Build a problem from statements * Map each statement to a list of statements, and flatten the result into a new problem. @param prelude if provided, this is added at the beginning of the result * Printer for a problem * Il...
* { 1 Top - Level Statements ( with locations ) } type metadata = ProblemMetadata.t type loc = Location.t type id = ID.t type 'a printer = Format.formatter -> 'a -> unit type 'a to_sexp = 'a -> Sexp_lib.t type 'a or_error = ('a, string) CCResult.t * { 2 Problem : a Set of Statements } type ('t, 'ty) t = private {...
83db8c2ac467edeee124771e7d47c2ca5fd9eedd10a222789992b32a51a1b58f
ekmett/gl
Proc.hs
# LANGUAGE ForeignFunctionInterface , CPP # -------------------------------------------------------------------------------- -- | Copyright : ( c ) and 2014 - 2016 , ( c ) 2013 -- License : BSD3 -- Maintainer : < > -- Stability : stable -- Portability : portable -- -- This module offers ...
null
https://raw.githubusercontent.com/ekmett/gl/1488e8dce368279d39b269b5ae5dda86ba10eb2d/gl/src/Graphics/GL/Internal/Proc.hs
haskell
------------------------------------------------------------------------------ | License : BSD3 Stability : stable Portability : portable This module offers a portable way to retrieve OpenGL extension entries, providing a portability layer upon platform-specific mechanisms like This internal module o...
# LANGUAGE ForeignFunctionInterface , CPP # Copyright : ( c ) and 2014 - 2016 , ( c ) 2013 Maintainer : < > @glXGetProcAddress@ , @wglGetProcAddress@ or @NSAddressOfSymbol@. module Graphics.GL.Internal.Proc ( getProcAddress , Invoker , extensions ) where import Control.Monad #if __GLA...
e2d603749526d40b925b38895bb1a19b2ecc140a1b95f6780461e7261443932d
borgeby/jarl
array_test.cljc
(ns jarl.builtins.array-test (:require [test.utils :refer [testing-builtin]] #?(:clj [clojure.test :refer [deftest]] :cljs [cljs.test :refer [deftest]]))) (deftest builtin-array-concat-test (testing-builtin "array.concat" [[1 2] [3]] [1 2 3] [[1 2 3] []] [1 2 3] [[1] ["a"]] [1 "a...
null
https://raw.githubusercontent.com/borgeby/jarl/2659afc6c72afb961cb1e98b779beb2b0b5d79c6/core/src/test/cljc/jarl/builtins/array_test.cljc
clojure
(ns jarl.builtins.array-test (:require [test.utils :refer [testing-builtin]] #?(:clj [clojure.test :refer [deftest]] :cljs [cljs.test :refer [deftest]]))) (deftest builtin-array-concat-test (testing-builtin "array.concat" [[1 2] [3]] [1 2 3] [[1 2 3] []] [1 2 3] [[1] ["a"]] [1 "a...
472b6127b656f656c5ad4e7292d84c07b0743d73e4e09ce30ae29f39682799d3
wavewave/hoodle
Menu.hs
# LANGUAGE CPP # # LANGUAGE ForeignFunctionInterface # {-# LANGUAGE OverloadedStrings #-} module Hoodle.GUI.Menu where import Control.Lens (set) import Control.Monad (foldM, when) import qualified Data.Foldable as F (forM_) import Data.Hoodle.Predefined ( predefinedEraserFine, predefinedEraserMedium, predef...
null
https://raw.githubusercontent.com/wavewave/hoodle/0d94530020e3e9641a652edade77cd0eb8d9a1a4/core/src/Hoodle/GUI/Menu.hs
haskell
# LANGUAGE OverloadedStrings # Refer to leksah IDE.Find module. | | | | | | | | icons ------------- file menu -- ------------- ------------- edit menu -- ------------- ------------- view menu -- ------------- -------------- layer menu -- -------------- -------------- embed menu -- ------------...
# LANGUAGE CPP # # LANGUAGE ForeignFunctionInterface # module Hoodle.GUI.Menu where import Control.Lens (set) import Control.Monad (foldM, when) import qualified Data.Foldable as F (forM_) import Data.Hoodle.Predefined ( predefinedEraserFine, predefinedEraserMedium, predefinedEraserThick, predefinedEras...
98b13d1ae46c575793a7f258943b0b1df0af7996e57661fc9b6a91e811e9f0a3
exoscale/seql
params_condition_test.clj
(ns seql.params-condition-test " Conditions are optional selectors for query that restrict the output. They map to SQL where conditions. Conditions may be either static, in which case a single field value is looked up, field conditions where a value for the field is provided at query time, or functions which ...
null
https://raw.githubusercontent.com/exoscale/seql/7142132a5c364baf201936052095589489320e99/test/seql/params_condition_test.clj
clojure
(ns seql.params-condition-test " Conditions are optional selectors for query that restrict the output. They map to SQL where conditions. Conditions may be either static, in which case a single field value is looked up, field conditions where a value for the field is provided at query time, or functions which ...
4c165c832a86da4b6190e325174b06505b84c3978455a0a2a9574f4e9d228ab7
ocaml-sf/learn-ocaml-corpus
get_product.ml
let is_empty s = s.length = 0 let empty = let length = 0 and get _ = raise OutOfBounds and foreach _k = () in { length; get; foreach } let singleton x = let length = 1 and get i = if i = 0 then x else raise OutOfBounds and foreach k = k x in { length; get; foreach } let sum s1 s2 = let length = ...
null
https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/symbolic_sequences_objects/wrong/get_product.ml
ocaml
wrong Such a division could occur on an out-of-bounds access.
let is_empty s = s.length = 0 let empty = let length = 0 and get _ = raise OutOfBounds and foreach _k = () in { length; get; foreach } let singleton x = let length = 1 and get i = if i = 0 then x else raise OutOfBounds and foreach k = k x in { length; get; foreach } let sum s1 s2 = let length = ...
f6eada637c846ac3a72668016af2c8473e8a39054cf11bd23fd47fb02a92b35e
ocaml-ppx/ocaml-migrate-parsetree
migrate_410_411.ml
open Stdlib0 module From = Ast_410 module To = Ast_411 let rec copy_toplevel_phrase : Ast_410.Parsetree.toplevel_phrase -> Ast_411.Parsetree.toplevel_phrase = function | Ast_410.Parsetree.Ptop_def x0 -> Ast_411.Parsetree.Ptop_def (copy_structure x0) | Ast_410.Parsetree.Ptop_dir x0 -> Ast_411.Parsetr...
null
https://raw.githubusercontent.com/ocaml-ppx/ocaml-migrate-parsetree/4a05cf7a00d84e5f827cc9ae9c75e5dc85126085/src/migrate_410_411.ml
ocaml
open Stdlib0 module From = Ast_410 module To = Ast_411 let rec copy_toplevel_phrase : Ast_410.Parsetree.toplevel_phrase -> Ast_411.Parsetree.toplevel_phrase = function | Ast_410.Parsetree.Ptop_def x0 -> Ast_411.Parsetree.Ptop_def (copy_structure x0) | Ast_410.Parsetree.Ptop_dir x0 -> Ast_411.Parsetr...
4d84e1992edc1e642414f92663c71f05e38b301683b49e3c5cb2969c68d795c3
morpheusgraphql/morpheus-graphql
Spec.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE NoImplicitPrelude # module Main ( main, ) where import qualified Case.Enum.Test as Enum import qualified Case.Fragments.Test as Fragments import qualified Case.Github.Test as Github import qualified Case.Interface.Test as Interface import qualified Case.LocalGlobal.Te...
null
https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/7b93de9028e597111b680201c2b87321c3bb7459/morpheus-graphql-client/test/Spec.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # module Main ( main, ) where import qualified Case.Enum.Test as Enum import qualified Case.Fragments.Test as Fragments import qualified Case.Github.Test as Github import qualified Case.Interface.Test as Interface import qualified Case.LocalGlobal.Test as LocalGlobal import qualified ...
e7f249a7f6c3a0d870001316c3dc1153bfbcccaedb935980970dde95c43b1f9c
falsetru/htdp
40.3.1.scm
#lang racket ;(require (lib "htdp-advanced-reader.ss" "lang")) (require rackunit) (require rackunit/text-ui) (define struct-mutators-tests (test-suite "Test for struct-mutators" (test-case "1." (define-struct movie (title producer) #:mutable) (check-true (procedure? set-movie-title!)) (check-tru...
null
https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/40/40.3.1.scm
scheme
(require (lib "htdp-advanced-reader.ss" "lang"))
#lang racket (require rackunit) (require rackunit/text-ui) (define struct-mutators-tests (test-suite "Test for struct-mutators" (test-case "1." (define-struct movie (title producer) #:mutable) (check-true (procedure? set-movie-title!)) (check-true (procedure? set-movie-producer!))) (test-cas...
e1d4a7b23b36c0d07355bc1d5d217d60980787a591fe35752b73dd3597644124
discus-lang/ddc
CreateDCX.hs
module DDC.War.Create.CreateDCX (create) where import DDC.War.Create.Way import DDC.War.Driver import System.FilePath import DDC.War.Job () import Data.Set (Set) import qualified DDC.War.Job.RunDCX as RunDCX import qualified DDC.War.Job.D...
null
https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-tools/src/ddc-war/DDC/War/Create/CreateDCX.hs
haskell
| Run .dcx files with the interpreter.
module DDC.War.Create.CreateDCX (create) where import DDC.War.Create.Way import DDC.War.Driver import System.FilePath import DDC.War.Job () import Data.Set (Set) import qualified DDC.War.Job.RunDCX as RunDCX import qualified DDC.War.Job.D...
7212ec65fe540be4be3bf05cb25f1a629e76fbd47663627d13611a5860a42f5e
tlaplus/tlapm
e_action.mli
(* * expr/e_action.mli --- expand action operators using quantification * * *) open E_t val expand_definition: hyp -> expr -> active_expansion:bool -> opname:string -> pfdirective:string -> expr val var_to_fresh: int -> string -> string val invert_renaming: ctx -> expr -> expr val expand_d...
null
https://raw.githubusercontent.com/tlaplus/tlapm/581ebd8afbe927b2b7d31c62ccec3a3409d9d8ce/src/expr/e_action.mli
ocaml
* expr/e_action.mli --- expand action operators using quantification * *
open E_t val expand_definition: hyp -> expr -> active_expansion:bool -> opname:string -> pfdirective:string -> expr val var_to_fresh: int -> string -> string val invert_renaming: ctx -> expr -> expr val expand_definitions: ctx -> expr -> expand_enabled:bool -> expand_cdot:bool -> ...
5c66cc3d4e7590e6d6cb1bdfa7bf074c2b14eafc89cfa789b117b940a9791c9c
emqx/lc
lc_sup.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy o...
null
https://raw.githubusercontent.com/emqx/lc/90f601fe844fabb057a324dca0aea605b8cac0b9/src/lc_sup.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 ...
Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(lc_sup). -behaviour(supervisor). -export([ start_link/0 , stop_runq_flagman/1 ...
9c5bce6f1d19df8a50403f6856cbf2c60c85ea63c3762bc906761d17ad82ac02
jixiuf/helloerlang
group_leader_io.erl
-module(group_leader_io). -export([print/0]). print()-> io:format("hello t1 ,group leader:~p~n",[erlang:group_leader()]) , erlang:group_leader(whereis(user),self()), io:format("hello t2 ,group leader:~p~n",[erlang:group_leader()]) . %% erl -sname t1 %% erl -sname t2 %% 在t1中执行: %% net_kernel:conne...
null
https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/group_leader_io/src/group_leader_io.erl
erlang
erl -sname t1 erl -sname t2 在t1中执行: net_kernel:connect_node(''). 会看到t2中输出hello world 另外,想把shell的输出重定向的文件里,可以这样 erlang:group_leader(Log, self()).
-module(group_leader_io). -export([print/0]). print()-> io:format("hello t1 ,group leader:~p~n",[erlang:group_leader()]) , erlang:group_leader(whereis(user),self()), io:format("hello t2 ,group leader:~p~n",[erlang:group_leader()]) . rpc:call(' ' , group_leader_io , print , [ ] ) . { ok , L...
072d37d4454ad65b9640a70c44672db9273305cd2d814b1800633937fd398242
testedminds/edgewise
reader_test.clj
(ns edgewise.edgelist.reader-test (:require [clojure.test :refer :all] [edgewise.core :refer :all] [edgewise.edgelist :refer :all] [clojure.java.io :as io])) (deftest should-read-valid-edgelist (let [g (edgelist->g (io/resource "resources/edgelist.txt")) id (label-index ...
null
https://raw.githubusercontent.com/testedminds/edgewise/0fb64c718e6a8e70eda87b77677a6679770569d1/test/edgewise/edgelist/reader_test.clj
clojure
(ns edgewise.edgelist.reader-test (:require [clojure.test :refer :all] [edgewise.core :refer :all] [edgewise.edgelist :refer :all] [clojure.java.io :as io])) (deftest should-read-valid-edgelist (let [g (edgelist->g (io/resource "resources/edgelist.txt")) id (label-index ...
31b8ec38f8e8772b526547006dd5274d7330c6a4861d4ffbb98751b0584cfefc
kivra/mechanus_fsm
act_match_oap.erl
-module(act_match_oap). -behaviour(mechanus_action). -export([perform/1]). -include_lib("mechanus_fsm/include/mechanus.hrl"). perform(_) -> #result{events=[s2_rand:pick([ #event{name=match_oap_yes} , #event{name=match_oap_no} ])]}.
null
https://raw.githubusercontent.com/kivra/mechanus_fsm/e7dfcd5d4b7d5d1843b746b76f9e11ad9dadaeec/test/act_match_oap.erl
erlang
-module(act_match_oap). -behaviour(mechanus_action). -export([perform/1]). -include_lib("mechanus_fsm/include/mechanus.hrl"). perform(_) -> #result{events=[s2_rand:pick([ #event{name=match_oap_yes} , #event{name=match_oap_no} ])]}.
fac5419f7c1f4e3fbfee2b115bd0f96b5b8d78fb19925fded91780fb61c141ce
OCamlPro/ocaml-solidity
solidity_common.mli
(**************************************************************************) (* *) Copyright ( c ) 2021 OCamlPro & Origin Labs (* *) (* All right...
null
https://raw.githubusercontent.com/OCamlPro/ocaml-solidity/b7ab4a0f6d671ebcb7433eb95bfaa5e60684e6d0/src/solidity-common/solidity_common.mli
ocaml
************************************************************************ All rights reserved. This file is distributed u...
Copyright ( c ) 2021 OCamlPro & Origin Labs Public License version 2.1 , with the special exception on linking type pos = string * (int * int) * (int * int) val dummy_pos : pos exception GenericError of string val error : ('a, Format.formatter, unit, 'b) format4 -> 'a type r...
4cff92e6d26119db5eb44f5122ae1b07cc5f346a4a06466c3a0fb6091b360bc7
SamuelSchlesinger/AutomataTheory
nfa.hs
import Control.Monad import Data.List (intersect) -- | A nondeterministic finite state automata type NFA q c = ([(q, c, q)], q, [q]) -- (transition, start, accepting states) -- | Maps a transition relation, a current state, and a current character -- | into a set of new states. transit :: (Eq q, Eq c) => [(q, c, q)] ...
null
https://raw.githubusercontent.com/SamuelSchlesinger/AutomataTheory/f53e186c3278ee0086830da029bb074f47566627/nfa.hs
haskell
| A nondeterministic finite state automata (transition, start, accepting states) | Maps a transition relation, a current state, and a current character | into a set of new states. | Maps a transition relation, a list of current states, and a current character | into a set of new states. | Removes duplicates from...
import Control.Monad import Data.List (intersect) transit :: (Eq q, Eq c) => [(q, c, q)] -> q -> c -> [q] transit d q0 c = [ q' | (q, c', q') <- d, q == q0, c' == c] totaltransit :: (Eq q, Eq c) => [(q, c, q)] -> [q] -> c -> [q] totaltransit d q0s c = rmdup $ join [transit d q0 c | q0 <- q0s] rmdup :: (Eq q) =...
704a831ca060a76eea15fc0b37f84a61300fe280dbcc856185a7e5374a7d5c24
wilkerlucio/pathom
misc.cljc
(ns com.wsscode.pathom.misc #?(:clj (:import (java.util UUID)))) #?(:clj (def INCLUDE_SPECS true) :cljs (goog-define INCLUDE_SPECS true)) (defn pathom-random-uuid [] #?(:clj (UUID/randomUUID) :cljs (random-uuid))) (defn distinct-by "Returns a lazy sequence of the elements of coll...
null
https://raw.githubusercontent.com/wilkerlucio/pathom/4ec25055d3d156241e9174d68ec438c93c971b9b/src/com/wsscode/pathom/misc.cljc
clojure
(ns com.wsscode.pathom.misc #?(:clj (:import (java.util UUID)))) #?(:clj (def INCLUDE_SPECS true) :cljs (goog-define INCLUDE_SPECS true)) (defn pathom-random-uuid [] #?(:clj (UUID/randomUUID) :cljs (random-uuid))) (defn distinct-by "Returns a lazy sequence of the elements of coll...
353b24d76e6e1ac169b4cc938362968777766cc6e035388d72c227643e3c7b8d
y42/clj-druid
handler.clj
(ns handler (:require [compojure.api.sweet :refer :all] [ring.util.http-response :refer :all] [clj-druid.schemas.query :refer :all] [clj-druid.client :as client])) (def default-druid-host ":8083/druid/v2") (def druid-client (client/connect {:hosts [default-druid-host]})) (defn do-query [q] (ok (clien...
null
https://raw.githubusercontent.com/y42/clj-druid/37fc967f000dc63816610695a2b6c028b7b7d8b5/examples/src/handler.clj
clojure
(ns handler (:require [compojure.api.sweet :refer :all] [ring.util.http-response :refer :all] [clj-druid.schemas.query :refer :all] [clj-druid.client :as client])) (def default-druid-host ":8083/druid/v2") (def druid-client (client/connect {:hosts [default-druid-host]})) (defn do-query [q] (ok (clien...
d4e5bc0ebbcb89f1767c608652d351abe98615cae0c2455e34f55e053e55547b
1Jajen1/Brokkr
Exception.hs
module Network.Exception ( ConnectionClosed(..) , PacketFailure(..) , Showable(..) , InvalidProtocol(..) , ClientTimedOut(..) , InvalidKeepAlive(..) ) where import Control.Exception import Data.ByteString import Data.Int import Data.String import Data.Text -- Exceptions data ConnectionClosed = ConnectionClosed ...
null
https://raw.githubusercontent.com/1Jajen1/Brokkr/fe56efaf450f29a5571cc34fa01f7301678f3eaf/src/Network/Exception.hs
haskell
Exceptions
module Network.Exception ( ConnectionClosed(..) , PacketFailure(..) , Showable(..) , InvalidProtocol(..) , ClientTimedOut(..) , InvalidKeepAlive(..) ) where import Control.Exception import Data.ByteString import Data.Int import Data.String import Data.Text data ConnectionClosed = ConnectionClosed deriving stock...
cd5984f22baa1ed9641850fd31d02c29715440d7db8a2839dd1841cbe8a8a3e5
serokell/log-warper
Test.hs
import Universum import Spec (spec) import Test.Hspec (hspec) main :: IO () main = hspec spec
null
https://raw.githubusercontent.com/serokell/log-warper/a6dd74a1085e8c6d94a4aefc2a036efe30f6cde5/test/Test.hs
haskell
import Universum import Spec (spec) import Test.Hspec (hspec) main :: IO () main = hspec spec