_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
146500ded2707db4ff232ba31c903a6c40534cbc0ff8475db3e900f7eb0cee3e
Helium4Haskell/helium
TypeBug4.hs
module TypeBug4 where sp :: ([a] -> Int -> String) -> [a] -> String sp k l | length k < max length k (max.map(length l)) = k : sp k : " " | True = k
null
https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/simple/typeerrors/Examples/TypeBug4.hs
haskell
module TypeBug4 where sp :: ([a] -> Int -> String) -> [a] -> String sp k l | length k < max length k (max.map(length l)) = k : sp k : " " | True = k
a676740c375fcaa550c19b9fa1e9dfc85d76199cb186aa0861ffae0af03f4dd4
reborg/clojure-essential-reference
2.clj
< 1 > ;; #{1 4 3 2}
null
https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Sets/set/2.clj
clojure
#{1 4 3 2}
< 1 >
7e68b18aed59cf185fb51de569877065fba65ea79e9a490a57e37604653872cc
tomjridge/kv-hash
test2.ml
(** Test executable *) module X = Kv_hash.Nv_map_ii.Test2()
null
https://raw.githubusercontent.com/tomjridge/kv-hash/9854f6d992f5c30ab9fdad614ba16684d3bbd082/test/test2.ml
ocaml
* Test executable
module X = Kv_hash.Nv_map_ii.Test2()
a481a0e55be27331bb7384f5afbaf84dcbc21e5f8f6a4d12a45cb5c473040463
vyorkin/tiger
ex1_1b.ml
open Base type key = string type 'a tree = | Leaf | Tree of ('a tree) * key * 'a * ('a tree) let rec insert t k v = let open Base.Poly in match t with | Leaf -> Tree (Leaf, k, v, Leaf) | Tree (l, k', v', r) -> if k < k' then Tree (insert l k v, k', v', r) else if k > k' then Tree (l, k', v', inse...
null
https://raw.githubusercontent.com/vyorkin/tiger/54dd179c1cd291df42f7894abce3ee9064e18def/chapter1/ex1_1b.ml
ocaml
open Base type key = string type 'a tree = | Leaf | Tree of ('a tree) * key * 'a * ('a tree) let rec insert t k v = let open Base.Poly in match t with | Leaf -> Tree (Leaf, k, v, Leaf) | Tree (l, k', v', r) -> if k < k' then Tree (insert l k v, k', v', r) else if k > k' then Tree (l, k', v', inse...
f2b7a48b7b6026860e9d12d8768048fbcd0fb4bc0e7eb6c5fe61f70c2588ba58
calyau/maxima
mring.lisp
A Maxima ring structure Copyright ( C ) 2005 , 2007 , Barton Willis Department of Mathematics University of Nebraska at Kearney ;; Kearney NE 68847 ;; ;; This source code is licensed under the terms of the Lisp Lesser GNU Public License ( LLGPL ) . The LLGPL consists of a preamble , published by Fra...
null
https://raw.githubusercontent.com/calyau/maxima/9352a3f5c22b9b5d0b367fddeb0185c53d7f4d02/share/linearalgebra/mring.lisp
lisp
Kearney NE 68847 This source code is licensed under the terms of the Lisp Lesser any later version. When the preamble conflicts with the LGPL, the preamble takes precedence. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHA...
A Maxima ring structure Copyright ( C ) 2005 , 2007 , Barton Willis Department of Mathematics University of Nebraska at Kearney GNU Public License ( LLGPL ) . The LLGPL consists of a preamble , published by Franz Inc. ( ) , and the GNU Library General Public License ( LGPL ) , version 2 , or ( at y...
52a34dfa9c22ca4094b957b885402766eeac48f674df89e1a702c9473ae49f4c
gebi/jungerl
etest.erl
%%% File : test.erl %%% Author : <> %%% Description : small eintl test Created : 9 Sep 2003 by < > -module(etest). -compile(export_all). -include("../include/eintl.hrl"). -import(eintl, [gettext/1, dcgettext/3]). start() -> start("sv_SE"). start(Locale) -> LocaleDir = filename:join([code:lib_d...
null
https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/intl/test/etest.erl
erlang
File : test.erl Author : <> Description : small eintl test
Created : 9 Sep 2003 by < > -module(etest). -compile(export_all). -include("../include/eintl.hrl"). -import(eintl, [gettext/1, dcgettext/3]). start() -> start("sv_SE"). start(Locale) -> LocaleDir = filename:join([code:lib_dir(intl), "test", "locale"]), eintl:start(), eintl:setlocale(message...
1a1cec50f68267969a43aeba36161452092215fa350c7fc74550df8608323a7e
witan-org/witan
test.ml
(*************************************************************************) This file is part of Witan . (* *) Copyright ( C ) 2017 CEA ( Commi...
null
https://raw.githubusercontent.com/witan-org/witan/d26f9f810fc34bf44daccb91f71ad3258eb62037/src/tests/test.ml
ocaml
*********************************************************************** alternatives) Automatique) ...
This file is part of Witan . Copyright ( C ) 2017 CEA ( Commissariat à l'énergie atomique et aux énergies ( Institut National de Recherche en Informatique et en CNRS ( Centre nation...
a7577dafd4164b1e4fed986602aa281e776c95c58b21cc02afa7da54aade8108
tolysz/ghcjs-stack
InstalledPackageInfo.hs
# LANGUAGE DeriveGeneric # ----------------------------------------------------------------------------- -- | -- Module : Distribution.InstalledPackageInfo Copyright : ( c ) The University of Glasgow 2004 -- -- Maintainer : -- Portability : portable -- This is the information about an /installed/ pa...
null
https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal-next/Cabal/Distribution/InstalledPackageInfo.hs
haskell
--------------------------------------------------------------------------- | Module : Distribution.InstalledPackageInfo Maintainer : Portability : portable is communicated to the @ghc-pkg@ program in order to register a package. @ghc-pkg@ now consumes this package format (as of version The @.cabal...
# LANGUAGE DeriveGeneric # Copyright : ( c ) The University of Glasgow 2004 This is the information about an /installed/ package that 6.4 ) . This is specific to GHC at the moment . module Distribution.InstalledPackageInfo ( InstalledPackageInfo(..), installedComponentId, installed...
1e8fb4645e5a48bccae352e7bc99d154cbc20b3ffec189ba7f2cf4a17274e4e2
google/lisp-koans
multiple-values.lisp
Copyright 2013 Google Inc. ;;; 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 distrib...
null
https://raw.githubusercontent.com/google/lisp-koans/df5e58dc88429ef0ff202d0b45c21ce572144ba8/koans-solved/multiple-values.lisp
lisp
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing per...
Copyright 2013 Google Inc. distributed under the License is distributed on an " AS IS " BASIS , In Lisp , it is possible for a function to return more than one value . (define-test multiple-values (let ((x (floor 3/2)) (y (multiple-value-list (floor 3/2)))) (assert-equal x 1) (assert-equal y '...
6c18a72da38fcf792b03fd6982647ae921d2236801b78f7d4b2193b98ec23128
launchdarkly/haskell-server-sdk
DataSource.hs
module Spec.DataSource (allTests) where import Test.HUnit allTests :: Test allTests = TestList []
null
https://raw.githubusercontent.com/launchdarkly/haskell-server-sdk/b8642084591733e620dfc5c1598409be7cc40a63/test/Spec/DataSource.hs
haskell
module Spec.DataSource (allTests) where import Test.HUnit allTests :: Test allTests = TestList []
d681103a0f6a37affcbf9f2b98aefec530264c327cc66d4c0f556aa988c895e3
AccelerationNet/collectors
collectors.lisp
;; -*- lisp -*- (cl:defpackage :collectors-signals (:export ;; signals and restarts #:aggregating #:skip #:new-value #:value #:aggregator #:after-values #:done-aggregating #:aggregate)) (cl:defpackage :collectors (:use :cl :cl-user :collectors-signals) (:export #:collect-at-end #:append-at-end ...
null
https://raw.githubusercontent.com/AccelerationNet/collectors/426a143bfdd3fd6c91329e1d8077c4f654d2459b/collectors.lisp
lisp
-*- lisp -*- signals and restarts * Reducing and Collecting ** Reducing ACL was throwing errors about this not being finalized (seems odd) re github #3 Fix it by: -archive.com//msg00169.html combining them, with the aid of a reducing function, into a single final value. not to remove remove last elt remove...
(cl:defpackage :collectors-signals (:export #:aggregating #:skip #:new-value #:value #:aggregator #:after-values #:done-aggregating #:aggregate)) (cl:defpackage :collectors (:use :cl :cl-user :collectors-signals) (:export #:collect-at-end #:append-at-end #:make-simple-collector #:make-simple-a...
b877f0093b4dd0c57cca0c569ae781a621fff0c995b716f2370df2c11042c70d
ocamllabs/ocaml-modular-implicits
testfork.ml
(***********************************************************************) (* *) (* OCaml *) (* *) , projet ...
null
https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/lib-systhreads/testfork.ml
ocaml
********************************************************************* OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . let compute_thread c = ignore c wh...
4377b85a0918c7f31891f557d749159f0cae216696b23955a5d1671f5b2f3c1f
atgreen/lisp-openshift
regex-class.lisp
-*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*- $ Header : /usr / local / cvsrep / cl - ppcre / regex - class.lisp , v 1.44 2009/10/28 07:36:15 edi Exp $ ;;; This file defines the REGEX class. REGEX objects are used to ;;; represent the (transformed) parse trees internally Copyr...
null
https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/cl-ppcre-2.0.3/regex-class.lisp
lisp
Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*- This file defines the REGEX class. REGEX objects are used to represent the (transformed) parse trees internally Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are m...
$ Header : /usr / local / cvsrep / cl - ppcre / regex - class.lisp , v 1.44 2009/10/28 07:36:15 edi Exp $ Copyright ( c ) 2002 - 2009 , Dr. . All rights reserved . DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , (in-...
787983286309421f56e2145cfa4dcdf8e32be3f1a8a4f720a06d5808af217389
ppaml-op3/insomnia
MatchSigs.hs
-- | Semantic signature matching ≤ ∃αs . Σ ' ↑ τs ⇝ f -- -- The concrete signature on the left is said to match the abstract -- signature on the right if we can find some types τs (such that Γ ⊢ -- τ : κₐ ) such that Γ ⊢ Σ ≤ Σ'[τs/αs] ⇝ f (where this latter -- judgment is signature subtyping. The difference is...
null
https://raw.githubusercontent.com/ppaml-op3/insomnia/5fc6eb1d554e8853d2fc929a957c7edce9e8867d/src/FOmega/MatchSigs.hs
haskell
| Semantic signature matching The concrete signature on the left is said to match the abstract signature on the right if we can find some types τs (such that Γ ⊢ τ : κₐ ) such that Γ ⊢ Σ ≤ Σ'[τs/αs] ⇝ f (where this latter judgment is signature subtyping. The difference is that matching and depth subtyping of re...
≤ ∃αs . Σ ' ↑ τs ⇝ f is concerned with finding the concrete types in the LHS that stand for the abstract types in the RHS , while subtyping is about width The " F - ing modules " journal paper gives a decidable algorithm " lookup_αs(Σ , ' ) ↑ τs " for signature matching in Section 5.2 . The valid a...
00281c9948c2823cc220608d5f9c34aee38d5433340a346ad98a35b4d266c2d1
yallop/ocaml-reex
reex_match.ml
* Copyright ( c ) 2022 . * * This file is distributed under the terms of the MIT License . * See the file LICENSE for details . * Copyright (c) 2022 Jeremy Yallop. * * This file is distributed under the terms of the MIT License. * See the file LICENSE for details. *) open Reex_deriv module Cm = C...
null
https://raw.githubusercontent.com/yallop/ocaml-reex/94eea88bb06be5e295627f437d7a585bd9d9b0a6/lib/reex_match.ml
ocaml
As char_match_index, but with an optimization. Instead of testing for end-of-string initially if i = n then .~eof else match s.[i] with | ... incorporate the end-of-string test into the match: match s.[i] with | '\000' -> if .~i = .~len then .~eof else ... ...
* Copyright ( c ) 2022 . * * This file is distributed under the terms of the MIT License . * See the file LICENSE for details . * Copyright (c) 2022 Jeremy Yallop. * * This file is distributed under the terms of the MIT License. * See the file LICENSE for details. *) open Reex_deriv module Cm = C...
b8e47d2a0b7d8d489f792dea15b9de099b49cb0e5df72f0b228c20d3e8c475f8
DeepSec-prover/deepsec
display_ui.ml
(**************************************************************************) (* *) DeepSec (* *) ...
null
https://raw.githubusercontent.com/DeepSec-prover/deepsec/8ddc45ec79de5ec49810302ea7da32d3dc9f46e4/Source/interface/display_ui.ml
ocaml
************************************************************************ ...
DeepSec , project PESTO , , project PESTO , , project PESTO , Copyright ( C ) INRIA 2017 - 2020 the GNU General Publ...
7f27bccd95b3d67a297f059330dd7a9efe1caa748d68dd680b4f3933482182f0
jimcrayne/jhc
tc165.hs
# OPTIONS -dcore - lint Fails GHC 5.04.2 with -dcore - lint -- The issue ariseswhen you have a method that -- constrains a class variable module Test where class C a where f :: (Eq a) => a instance C () where f = f
null
https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/1_typecheck/2_pass/ghc/tc165.hs
haskell
The issue ariseswhen you have a method that constrains a class variable
# OPTIONS -dcore - lint Fails GHC 5.04.2 with -dcore - lint module Test where class C a where f :: (Eq a) => a instance C () where f = f
7f46e39f133fa7d742d29ff7af588c505907532d5638e9f9799913999a7b9e0f
ocaml-flambda/flambda-backend
dont_unbox_exn.ml
exception FoundAt of int external opaque : 'a -> 'a = "%opaque" external raise : exn -> 'a = "%raise" let test () = try if opaque false then raise (FoundAt (if opaque false then 1 else 2)); 0 with FoundAt i -> i
null
https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/92dbdba868235321a48916b8f1bb3f04ee884d3f/middle_end/flambda2/tests/ref_to_var/dont_unbox_exn.ml
ocaml
exception FoundAt of int external opaque : 'a -> 'a = "%opaque" external raise : exn -> 'a = "%raise" let test () = try if opaque false then raise (FoundAt (if opaque false then 1 else 2)); 0 with FoundAt i -> i
e58cb4617395bcb1d5f5042745b87f86823b09bb1ab48b89428d7b85d4ca9821
Workiva/eva
clojure_test_ext.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/core/test/eva/test/clojure_test_ext.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.test.clojure-test-ext "Provides extensions to clojure.test" (:require [clojure.test :refer :all])) This is particularly useful when dealing with ExecutionExceptions : @(future ( throw ( Ill...
1109dd0415c4410a969f1cbbadb8f8af339228ebe74813da4679a5020f87e86a
fogfish/datum
tree_SUITE.erl
%% Copyright ( c ) 2017 , %% All Rights Reserved. %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless required by applicable law or agreed t...
null
https://raw.githubusercontent.com/fogfish/datum/f5e8f0b5deb8b74d6febe046333dbb4f38b086d8/test/tree_SUITE.erl
erlang
All Rights Reserved. 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...
Copyright ( c ) 2017 , Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(tree_SUITE). -include_lib("common_test/include/ct.hrl"). -include_lib("datum/include/datum.hrl"). -compile({parse_transform, category}...
cdde6dc22095b87f3bae22f471d866216579df56121089475307beea82b0342a
2garryn/esli
esli_web.erl
%%% --------------------------------------------------------------- %%% File : esli_web.erl Author : Description : " loop"-file for MochiWeb %%% --------------------------------------------------------------- -module(esli_web). -include("esli.hrl"). -export([start/0, loop/2]). -define(REQUEST_TIMEOUT, 3...
null
https://raw.githubusercontent.com/2garryn/esli/6e48337b066bb230813317dcda613993c2929684/apps/esli/src/esli_web.erl
erlang
--------------------------------------------------------------- File : esli_web.erl --------------------------------------------------------------- functions to make "nice" and readable code Start short link proceeding Stop short link proceeding. Full link is got Start full link proceeding Stop full link p...
Author : Description : " loop"-file for MochiWeb -module(esli_web). -include("esli.hrl"). -export([start/0, loop/2]). -define(REQUEST_TIMEOUT, 3000). start() -> DocRoot = esli_conf:get_config(docroot), ets:new(clients_ip, [duplicate_bag, public, named_table]), Loop = fun (Req) -> ...
02350c9cbe23a6765741abeb63afeda7a19b199bc57915819ec7a783cd9e6bf4
mikeizbicki/HLearn
History.hs
-- | All optimization algorithms get run within the "History" monad provided in this module. -- This monad lets us thread user-defined debugging code throughout our optimization procedures. -- Most optimization libraries don't include significant debugging features because of the runtime overhead. -- That's not a probl...
null
https://raw.githubusercontent.com/mikeizbicki/HLearn/c6c0f5e7593be3867f20c56c79b998e7d7ded9fc/src/HLearn/History.hs
haskell
| All optimization algorithms get run within the "History" monad provided in this module. This monad lets us thread user-defined debugging code throughout our optimization procedures. Most optimization libraries don't include significant debugging features because of the runtime overhead. That's not a problem for u...
GHC / is able to optimize everything into tight , efficient loops . module HLearn.History ( History , History_ , runHistory , evalHistory , traceHistory , traceAllHistory , NoCxt , ValidCxt , Report (..) , beginFunction , report , withMsg , withMsgIO , it...
e7668b3421436bd2e3eff7751269c6e6b4ba3794a8b5c6b27abf2f1965aed1c6
cmsc430/www
types.rkt
#lang racket (provide (all-defined-out)) ;; type Value = ;; | Integer ;; | Boolean ;; type Bits = Integer (define int-shift 1) (define type-int #b0) (define type-bool #b1) (define val-true #b01) (define val-false #b11) ;; Bits -> Value (define (bits->value b) (cond [(= type-int (bitwise-and b #b1)) ...
null
https://raw.githubusercontent.com/cmsc430/www/d7635145c85ef168a05d15be8d565084e49e0f0f/langs/dupe/types.rkt
racket
type Value = | Integer | Boolean type Bits = Integer Bits -> Value Value -> Bits
#lang racket (provide (all-defined-out)) (define int-shift 1) (define type-int #b0) (define type-bool #b1) (define val-true #b01) (define val-false #b11) (define (bits->value b) (cond [(= type-int (bitwise-and b #b1)) (arithmetic-shift b (- int-shift))] [(= b val-true) #t] [(= b v...
dd7ca243251c2bb3754450134885cabcfa3bbca4dd460a6cf95a989fd79a23d4
sph-mn/sph-lib
scm-format.scm
(import (sph string) (sph) (sph other) (sph alist) (sph list) (srfi srfi-1) (sph hashtable) (sph lang scm-format) (sph test)) (define c scm-format-default-config) (hashtables-set! c (q format) (q indent-string) "--") (define (test-scm-format in exp) (let* ( (config-format (if (length-greater-one? in) ...
null
https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/other/manual-tests/scm-format.scm
scheme
multiple leading parenthesis spacing general nesting double parenthesis start\middle exprs limit max-line-chars this is a testcomment (this is a testcomment (this is a testcomment
(import (sph string) (sph) (sph other) (sph alist) (sph list) (srfi srfi-1) (sph hashtable) (sph lang scm-format) (sph test)) (define c scm-format-default-config) (hashtables-set! c (q format) (q indent-string) "--") (define (test-scm-format in exp) (let* ( (config-format (if (length-greater-one? in) ...
56d3c5965df7172e6d76e70f4ef252d964d2ad7f85cc6bece0e2050706b5cab7
LPCIC/matita
index.ml
||M|| This file is part of HELM , an Hypertextual , Electronic ||A|| Library of Mathematics , developed at the Computer Science ||T|| Department , University of Bologna , Italy . ||I|| ||T||...
null
https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/ng_paramodulation/index.ml
ocaml
assert (arity = 0); FIXME : should this be allowed or not ? | Terms.Node (Terms.Var _::_) -> assert false FIXME : if we can have a variable we can also have a term | Terms.Node (Terms.Node _::_) as t -> assert false
||M|| This file is part of HELM , an Hypertextual , Electronic ||A|| Library of Mathematics , developed at the Computer Science ||T|| Department , University of Bologna , Italy . ||I|| ||T||...
e8238475f7be75d31d11f8a4df1e35c847a1532264964b169cd7a87dd05e0010
cj1128/sicp-review
prime.scm
(define (smallest-divisor n) (find-divisor n 2)) (define (find-divisor n test) (cond ((> (square test) n) n) ((divides? test n) test) (else (find-divisor n (+ test 1))))) (define (divides? a b) (= (remainder b a) 0)) (define (prime? n) (= n (smallest-divisor n)))
null
https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-1/1.2/prime.scm
scheme
(define (smallest-divisor n) (find-divisor n 2)) (define (find-divisor n test) (cond ((> (square test) n) n) ((divides? test n) test) (else (find-divisor n (+ test 1))))) (define (divides? a b) (= (remainder b a) 0)) (define (prime? n) (= n (smallest-divisor n)))
2ae297eff54285e753e71c63eb8b8bfd59a80ceb8f117e9315e823862874edca
kpreid/e-on-cl
vat.lisp
Copyright 2005 - 2007 , under the terms of the MIT X license found at ................ (in-package :e.elib) ;;; *VAT* is declared in ref.lisp. (defun call-with-turn (body vat &key (label t)) "Execute the 'body' thunk, as a turn in the given vat." (assert label) (when (vat-in-turn vat) (error "~S is ...
null
https://raw.githubusercontent.com/kpreid/e-on-cl/f93d188051c66db0ad4ff150bd73b838f7bc25ed/lisp/vat.lisp
lisp
*VAT* is declared in ref.lisp. do one of : XXX future improvement: human-formatted time
Copyright 2005 - 2007 , under the terms of the MIT X license found at ................ (in-package :e.elib) (defun call-with-turn (body vat &key (label t)) "Execute the 'body' thunk, as a turn in the given vat." (assert label) (when (vat-in-turn vat) (error "~S is already executing a turn, ~S, so tu...
a032ebe34d16d01a988dd76c6174a59faacd04085f63157c0396367026d31072
mbutterick/beautiful-racket
lexer.rkt
#lang br (require brag/support) (define-lex-abbrev digits (:+ (char-set "0123456789"))) (define-lex-abbrev reserved-terms (:or "print" "goto" "end" "+" ":" ";" "let" "=" "input" "-" "*" "/" "^" "mod" "(" ")" "if" "then" "else" "<" ">" "<>" "and" "or" "not" "gosub" "return" "for" "to" "step" "next")) (define basic-le...
null
https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/basic-demo-2/lexer.rkt
racket
#lang br (require brag/support) (define-lex-abbrev digits (:+ (char-set "0123456789"))) (define-lex-abbrev reserved-terms (:or "print" "goto" "end" "+" ":" ";" "let" "=" "input" "-" "*" "/" "^" "mod" "(" ")" "if" "then" "else" "<" ">" "<>" "and" "or" "not" "gosub" "return" "for" "to" "step" "next")) (define basic-le...
19e37eb99c5ed7c55a445fe239f1adb4729c5494c60cfe46174fddbf383f8be4
ethercrow/lightstep-haskell
TestPropagation.hs
{-# LANGUAGE OverloadedStrings #-} module TestPropagation where import Control.Lens import Data.Function import Data.ProtoLens.Message (defMessage) import Data.Word import LightStep.Propagation import Test.Tasty.HUnit import Text.Printf prop_u64_roundtrip :: Word64 -> Bool prop_u64_roundtrip x = Just x == decode_u...
null
https://raw.githubusercontent.com/ethercrow/lightstep-haskell/f447fd37a6c53dcd38c32c53f71a71386f3e425a/unit-test/TestPropagation.hs
haskell
# LANGUAGE OverloadedStrings #
module TestPropagation where import Control.Lens import Data.Function import Data.ProtoLens.Message (defMessage) import Data.Word import LightStep.Propagation import Test.Tasty.HUnit import Text.Printf prop_u64_roundtrip :: Word64 -> Bool prop_u64_roundtrip x = Just x == decode_u64 (encode_u64 x) prop_text_propag...
1cb348253b461c63303d386cf48b86b322edffa93d4b3466573a073bc3fe84be
ivanperez-keera/dunai
SamplingMonad.hs
{-# LANGUAGE CPP #-} # LANGUAGE ExistentialQuantification # module Control.Monad.SamplingMonad where import Control.Monad.TaggingMonad import Data.Monoid import Data.Maybe.Util #if MIN_VERSION_base(4,9,0) import Data.Semigroup as Sem #endif type SamplingMonad t a = TaggingMonad (NextSample t) a...
null
https://raw.githubusercontent.com/ivanperez-keera/dunai/99091c3391c0ba15e9075579e0b73c5660e994c2/dunai-examples/taggingmonad/Control/Monad/SamplingMonad.hs
haskell
# LANGUAGE CPP # this is redundant starting with base-4.11 / GHC 8.4
# LANGUAGE ExistentialQuantification # module Control.Monad.SamplingMonad where import Control.Monad.TaggingMonad import Data.Monoid import Data.Maybe.Util #if MIN_VERSION_base(4,9,0) import Data.Semigroup as Sem #endif type SamplingMonad t a = TaggingMonad (NextSample t) a data NextSample a = Ord a => NextSample {...
276d0283fba9d3871758f08713bc7439423ee2642e8bc5b7f60d4da92e9c004f
alexandergunnarson/quantum
core.cljc
(ns quantum.untyped.core.core (:require #?@(:clj [[environ.core :as env]]) [cuerdas.core :as str+] [quantum.untyped.core.type.predicates :as utpred :refer [with-metable? metable?]])) ;; ===== Environment ===== ;; (def lang #?(:clj :clj :cljs :cljs)) ...
null
https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src-untyped/quantum/untyped/core/core.cljc
clojure
===== Environment ===== ;; ===== Compilation ===== ;; ; ===== Miscellaneous ===== ;; ===== COLLECTIONS ===== From `quantum.untyped.core.form.evaluate` — used below in `defalias` From `quantum.untyped.core.vars` — used below in `walk` to avoid warnings because this doesn't always get set correctly From `quantu...
(ns quantum.untyped.core.core (:require #?@(:clj [[environ.core :as env]]) [cuerdas.core :as str+] [quantum.untyped.core.type.predicates :as utpred :refer [with-metable? metable?]])) (def lang #?(:clj :clj :cljs :cljs)) #?(:clj (defn pid [] (->> (j...
e1f029c4cea42b0e63ce6fe310a80e86e5e9bc9510a870815308dda5d4ae9e49
namenu/advent-of-code
day11.clj
--- Day 11 : Space Police --- (ns aoc.year2019.day11 (:require [aoc.util :refer [input cart->polar]] [aoc.year2019.intcode :refer :all])) (defn move [{:keys [pos dir] :as robot}] (let [[x y] pos [dx dy] dir] (assoc robot :pos [(+ x dx) (+ y dy)]))) (defn turn [{:keys [dir] :as robot} lr]...
null
https://raw.githubusercontent.com/namenu/advent-of-code/83f8cf05931f814dab76696bf46fec1bb1276fac/2019/clojure/src/aoc/year2019/day11.clj
clojure
(prn "input cb") (prn "output cb" output)
--- Day 11 : Space Police --- (ns aoc.year2019.day11 (:require [aoc.util :refer [input cart->polar]] [aoc.year2019.intcode :refer :all])) (defn move [{:keys [pos dir] :as robot}] (let [[x y] pos [dx dy] dir] (assoc robot :pos [(+ x dx) (+ y dy)]))) (defn turn [{:keys [dir] :as robot} lr]...
c4f7c5fcc02ea12ea3b9f3fda074e39871a5a2e61976cdff5bf29dbdae5d719c
aggieben/weblocks
html-template.lisp
(in-package :weblocks) (export '(html-template with-widget-header render-widget-body)) (defwidget html-template (widget) ((tp :accessor tp :initform nil) (src :type string :accessor src :initarg :src :initform nil) (file :type pathname :accessor file :initarg :file :initform nil) (vars :type list :access...
null
https://raw.githubusercontent.com/aggieben/weblocks/8d86be6a4fff8dde0b94181ba60d0dca2cbd9e25/contrib/lpolzer/html-template.lisp
lisp
(in-package :weblocks) (export '(html-template with-widget-header render-widget-body)) (defwidget html-template (widget) ((tp :accessor tp :initform nil) (src :type string :accessor src :initarg :src :initform nil) (file :type pathname :accessor file :initarg :file :initform nil) (vars :type list :access...
1fac9cb41dd6637e74975c2079dffa8013831067f73a702f25d0386354392358
edsko/ChinesePodAPI
String.hs
-- | Utility functions on strings module Servant.ChinesePod.Util.String ( explode , dropBOM , trim , lowercase ) where import Data.Char | Split a string at the specified explode :: Char -> String -> [String] explode needle = go where go :: String -> [String] go haystack = case break (== needl...
null
https://raw.githubusercontent.com/edsko/ChinesePodAPI/f77ebfd55286316c4a54c42c195d5a51b4a0e4cd/src/Servant/ChinesePod/Util/String.hs
haskell
| Utility functions on strings | Drop unicode BOM character if present | Trim whitespace | Map every character to lowercase
module Servant.ChinesePod.Util.String ( explode , dropBOM , trim , lowercase ) where import Data.Char | Split a string at the specified explode :: Char -> String -> [String] explode needle = go where go :: String -> [String] go haystack = case break (== needle) haystack of ...
b06f8975ee8e60884691c85b859ba6fe81fe213fe7d6d3fa7522bcd9e0ca7eac
RichiH/git-annex
HashObject.hs
git hash - object interface - - Copyright 2011 - 2014 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2011-2014 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} # LANGUAGE CPP # module Git.HashObject where import Common import Git import Git.Sha impo...
null
https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Git/HashObject.hs
haskell
Injects a file into git, returning the Sha of the object. Injects a blob into git. Unfortunately, the current git-hash-object - interface does not allow batch hashing without using temp files.
git hash - object interface - - Copyright 2011 - 2014 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2011-2014 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} # LANGUAGE CPP # module Git.HashObject where import Common import Git import Git.Sha impo...
9985fdc07b2265a5e56709454e8d6f2820f4e2abb0da97e6ce0a62bb28124a22
fizruk/fpconf-2017-talk
Main.hs
# LANGUAGE DeriveGeneric # {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module Main where import Data.Aeson import GHC.Generics import GHCJS.Marshal import Miso.String import Miso (App(..), startApp, defaultEvents, noEff, onClick) import Miso.AFrame import Miso.AFram...
null
https://raw.githubusercontent.com/fizruk/fpconf-2017-talk/604d14b6a081d4f5fb25acde7fe9783be250e11d/miso-aframe-demo/src/Main.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE OverloadedStrings # ========================================================== ========================================================== ========================================================== Шаг 2. Красный куб ========================================================== ...
# LANGUAGE DeriveGeneric # # LANGUAGE RecordWildCards # module Main where import Data.Aeson import GHC.Generics import GHCJS.Marshal import Miso.String import Miso (App(..), startApp, defaultEvents, noEff, onClick) import Miso.AFrame import Miso.AFrame.Core Шаг 1 . step1 :: IO () step1 = startHtmlOnlyApp $ sc...
cde2c44d55e39aa0a60bea3e18a04789f3ec397170310f05565445bf60a30986
weyrick/roadsend-php
utils.scm
;; ***** BEGIN LICENSE BLOCK ***** Roadsend PHP Compiler Runtime Libraries Copyright ( C ) 2007 Roadsend , Inc. ;; ;; 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 2....
null
https://raw.githubusercontent.com/weyrick/roadsend-php/d6301a897b1a02d7a85bdb915bea91d0991eb158/runtime/utils.scm
scheme
***** BEGIN LICENSE BLOCK ***** This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License either version 2.1 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER...
Roadsend PHP Compiler Runtime Libraries Copyright ( C ) 2007 Roadsend , Inc. of the License , or ( at your option ) any later version . GNU Lesser General Public License for more details . You should have received a copy of the GNU Lesser General Public License Foundation , Inc. , 51 Franklin Street , Fifth...
292a2cde7395b8d93934a6951c9020d06a59077ce16032e2cb04810d9ee0a2df
sanjoy/Snippets
GenerateMatcher.hs
# LANGUAGE TemplateHaskell # module GenerateMatcher(generateMatcher) where import Language.Haskell.TH generateMatcher :: String -> [String] -> Q [Dec] generateMatcher name strs = return [FunD (mkName name) (map thMagic strs ++ baseCase)] where thMagic str = Clause [transform str] (NormalB (ConE 'True)) [] ...
null
https://raw.githubusercontent.com/sanjoy/Snippets/76dcbff1da333b010662d42d0d235f614a882b87/GenerateMatcher.hs
haskell
# LANGUAGE TemplateHaskell # module GenerateMatcher(generateMatcher) where import Language.Haskell.TH generateMatcher :: String -> [String] -> Q [Dec] generateMatcher name strs = return [FunD (mkName name) (map thMagic strs ++ baseCase)] where thMagic str = Clause [transform str] (NormalB (ConE 'True)) [] ...
4ea50679afba8368309822df1cdef838be823abdd28263d6e653092e41771927
sbcl/specializable
prototype-specializer.lisp
;;;; prototype-specializer.lisp --- Unit tests for the prototype specializer. ;;;; Copyright ( C ) 2013 , 2014 Copyright ( C ) 2014 , 2017 Jan Moringen ;;;; Author : < > Author : < > (cl:in-package #:prototype-specializer.test) Utilities (defmacro with-prototype-generic-function ((name lambda-list ...
null
https://raw.githubusercontent.com/sbcl/specializable/a08048ce874a2a8c58e4735d88de3bf3da0de052/test/prototype-specializer/prototype-specializer.lisp
lisp
prototype-specializer.lisp --- Unit tests for the prototype specializer. Test suite (as opposed to a symbol naming such an instance in the lexical environment) Cloning should inherit roles.
Copyright ( C ) 2013 , 2014 Copyright ( C ) 2014 , 2017 Jan Moringen Author : < > Author : < > (cl:in-package #:prototype-specializer.test) Utilities (defmacro with-prototype-generic-function ((name lambda-list &rest options) &body body) `(with-specializ...
bd85dc718f5bd1790cbfb3b5b236e91b99f111236c83748f00e1d36a3a2ed099
kseo/systemf
Spec.hs
import Language.LambdaCalculus import qualified Data.ByteString.Lazy.Char8 as BS import System.FilePath import System.FilePath.Glob import Test.Tasty import Test.Tasty.Golden as G main :: IO () main = do paths <- listTestFiles goldens <- mapM mkGoldenTest paths defaultMain (testGroup "Tests" goldens) listTest...
null
https://raw.githubusercontent.com/kseo/systemf/ea73fd42567adf2ddcd7bb60f11a66e10eebc154/test/Spec.hs
haskell
import Language.LambdaCalculus import qualified Data.ByteString.Lazy.Char8 as BS import System.FilePath import System.FilePath.Glob import Test.Tasty import Test.Tasty.Golden as G main :: IO () main = do paths <- listTestFiles goldens <- mapM mkGoldenTest paths defaultMain (testGroup "Tests" goldens) listTest...
0940f173ef62481df7931823fb5be2a740469d7ce0c702e81badbcba1013adfd
racket/db
mysql.rkt
#lang racket/base (require racket/contract/base openssl db/base "private/mysql/main.rkt") ;; FIXME: Contracts duplicated at main.rkt (provide/contract [mysql-connect (->* (#:user string?) (#:database (or/c string? #f) #:password (or/c string? (list/c 'hash string?) #f) ...
null
https://raw.githubusercontent.com/racket/db/0336d2522a613e76ebf60705cea3be4c237c447e/db-lib/db/mysql.rkt
racket
FIXME: Contracts duplicated at main.rkt
#lang racket/base (require racket/contract/base openssl db/base "private/mysql/main.rkt") (provide/contract [mysql-connect (->* (#:user string?) (#:database (or/c string? #f) #:password (or/c string? (list/c 'hash string?) #f) #:server (or/c string? #f) #:po...
d055c3b9b34236f1f9a620a6358747c6828d8f8050012e96aa571009381c5267
MLstate/opalang
traverse.mli
Copyright © 2011 MLstate This file is part of . is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . is distributed in the hope that it will be useful , ...
null
https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/ocamllib/libbase/traverse.mli
ocaml
module type TRAVERSE_LIFT = sig end * Some Extensions (e1,e2) is a pair of expression and you are currently treating * expressions, you write exactly that: * traverse all the nodes of the tree in an unspecified order * Folds all the nodes of the tree in an unspecified order * Non-recursive version...
Copyright © 2011 MLstate This file is part of . is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . is distributed in the hope that it will be useful , ...
982cedbbde3e9f32b2b361a970a83470975b0959525922694218962c7ce6d0ee
realark/vert
platformer-game-scene.lisp
(in-package :recurse.vert) ;;;; platformer-game-scene (defparameter *default-gravity-acceleration-seconds* 500 "The default downward force of gravity in px/s/s") @export-class (defclass platformer-game-scene (game-scene physics-context-2d) ((gravity-vector :initarg :gravity-vector :initform (m...
null
https://raw.githubusercontent.com/realark/vert/4cb88545abc60f1fba4a8604ce85e70cbd4764a2/src/plugins/platformer/platformer-game-scene.lisp
lisp
platformer-game-scene
(in-package :recurse.vert) (defparameter *default-gravity-acceleration-seconds* 500 "The default downward force of gravity in px/s/s") @export-class (defclass platformer-game-scene (game-scene physics-context-2d) ((gravity-vector :initarg :gravity-vector :initform (make-acceleration-vector-sec...
c1d3058a5644528116072945f612862a2d080e5c26e84e105872cbc60438f4bf
brendanhay/gogol
Patch.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # {-# LANGUAGE St...
null
https://raw.githubusercontent.com/brendanhay/gogol/77394c4e0f5bd729e6fe27119701c45f9d5e1e9a/lib/services/gogol-containerbuilder/gen/Gogol/ContainerBuilder/Cloudbuild/Projects/Locations/GithubEnterpriseConfigs/Patch.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated /See:/ <-build/docs/ Cloud Build API Reference> for @cloudbuild.projects.locations.githubEnterpriseConfigs.patch@. * Resource ** Constructing a Request | A resource alias for @cloudbuild.projects.locations.githubEnterpriseConf...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators...
4eb21474e9be96595e9c9e23e4dabb8461b7d1f5d151bbbb43b7ff78d91ff4f0
trchopan/scheduled-blocks
PersistReportSpec.hs
module Application.PersistReportSpec where import Test.Hspec ( Spec , describe , it , shouldBe ) ...
null
https://raw.githubusercontent.com/trchopan/scheduled-blocks/f79c4fb94f17d45ae9e6180a8cc9f9bcc5f16d34/test/Application/PersistReportSpec.hs
haskell
module Application.PersistReportSpec where import Test.Hspec ( Spec , describe , it , shouldBe ) ...
819855f5bcf9623eeab3bca5269b5ec2a26a99346d94a736541dcbb5bc5f9a9c
v0d1ch/plaid
Income.hs
module Data.Api.Income ( plaidGetIncome ) where import Data.Common plaidGetIncome :: ( MonadReader PlaidEnv m , MonadThrow m , PlaidHttp m ) => PlaidBody PlaidIncomeGet -> m ByteString plaidGetIncome body = do env <- ask let url = envUrl (env ^. plaidEnvEnvironment) executePos...
null
https://raw.githubusercontent.com/v0d1ch/plaid/c70dfe1064e06be0c56dc06384a7ff4ed0691019/Data/Api/Income.hs
haskell
module Data.Api.Income ( plaidGetIncome ) where import Data.Common plaidGetIncome :: ( MonadReader PlaidEnv m , MonadThrow m , PlaidHttp m ) => PlaidBody PlaidIncomeGet -> m ByteString plaidGetIncome body = do env <- ask let url = envUrl (env ^. plaidEnvEnvironment) executePos...
c1c43c0186ae05271451021c0a53af0bdd63a9ddfbe4cabf255b995f367187e2
hiroshi-unno/coar
variables.ml
open Core module StringSet = Set.Make(String) type t = StringSet.t let empty = StringSet.empty let union vars1 vars2 : t = StringSet.union vars1 vars2 let add var vars : t = StringSet.add vars var let sub vars1 vars2 : t = StringSet.diff vars1 vars2 let inter vars1 vars2 : t = StringSet.inter vars1 vars2 let is...
null
https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/c/variables.ml
ocaml
open Core module StringSet = Set.Make(String) type t = StringSet.t let empty = StringSet.empty let union vars1 vars2 : t = StringSet.union vars1 vars2 let add var vars : t = StringSet.add vars var let sub vars1 vars2 : t = StringSet.diff vars1 vars2 let inter vars1 vars2 : t = StringSet.inter vars1 vars2 let is...
dab50f32604b76d27e62652dc03bd67156642b4d06e5ecae597beecc7c60f310
dktr0/estuary
Reflex.hs
# LANGUAGE TypeFamilies , RankNTypes , OverloadedStrings # module Estuary.Test.Reflex where import Control.Concurrent.MVar import Control.Concurrent.Async import Control.Monad.IO.Class import Data.Map import Estuary.Test.Dom (findMatchingSelectorInDocument) import GHCJS.DOM.Types (Element, HTMLDivElement, fromJSStr...
null
https://raw.githubusercontent.com/dktr0/estuary/d4860cb61a7777d0b0a326ab6d8cb6e2d807e258/client/src/Estuary/test/Estuary/Test/Reflex.hs
haskell
renderSync renders the widget, waits for it to mount, and returns the container element it was mounted in. any exceptions should be thrown here renderSync_ renders the widget and waits for it to mount. any exceptions should be thrown here
# LANGUAGE TypeFamilies , RankNTypes , OverloadedStrings # module Estuary.Test.Reflex where import Control.Concurrent.MVar import Control.Concurrent.Async import Control.Monad.IO.Class import Data.Map import Estuary.Test.Dom (findMatchingSelectorInDocument) import GHCJS.DOM.Types (Element, HTMLDivElement, fromJSStr...
a478fcf66cb8ae654eaa0c2e35e3e1d7dd97f98cdbe603c4615a0e0ac8b74b8b
fulcrologic/statecharts
assign_current_small_step_spec.cljc
(ns com.fulcrologic.statecharts.algorithms.v20150901.assign-current-small-step-spec (:require [com.fulcrologic.statecharts.chart :as chart] [com.fulcrologic.statecharts.data-model.operations :as ops] [com.fulcrologic.statecharts.elements :refer [assign data-model on-entry parallel script state transi...
null
https://raw.githubusercontent.com/fulcrologic/statecharts/9a081be7da28ba9f9e2f7cdca75d1be4c030e3e0/src/test/com/fulcrologic/statecharts/algorithms/v20150901/assign_current_small_step_spec.cljc
clojure
(ns com.fulcrologic.statecharts.algorithms.v20150901.assign-current-small-step-spec (:require [com.fulcrologic.statecharts.chart :as chart] [com.fulcrologic.statecharts.data-model.operations :as ops] [com.fulcrologic.statecharts.elements :refer [assign data-model on-entry parallel script state transi...
504171f7eede11f309481095697cb86c2791c7a7644521df1bac86ecd48b8f59
smart-chain-fr/tokenomia
Convert.hs
# LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE DuplicateRecordFields # # LANGUAGE TupleSections # # LANGUAGE NumericUnderscores # # LANGUAGE NamedFieldPuns # module Tokenomia.ICO.Funds.Validation.CardanoC...
null
https://raw.githubusercontent.com/smart-chain-fr/tokenomia/01a6fdc97ccd9229a3fca1a821d0054f38a60e6b/src/Tokenomia/ICO/Funds/Validation/CardanoCLI/Convert.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE DuplicateRecordFields # # LANGUAGE TupleSections # # LANGUAGE NumericUnderscores # # LANGUAGE NamedFieldPuns # module Tokenomia.ICO.Funds.Validation.CardanoCLI.Convert ( convertInvestorPla...
d6c0b43051f249c41a6a68926920b363b6090f03bcafcc905fd8f09190eebdca
mhuebert/maria
core.cljs
(ns lark.value-viewer.core (:require [applied-science.js-interop :as j] [chia.view :as v] [chia.view.hiccup :as hiccup]) (:import [goog.async Deferred])) (def space \u00A0) (defn kind [thing] (cond (char? thing) :character (false? thing) :false (keyword? thing...
null
https://raw.githubusercontent.com/mhuebert/maria/dda46233bd618f2fc6dd3a412c4877ebaff1302a/editor/vendor/lark/value_viewer/core.cljs
clojure
(ns lark.value-viewer.core (:require [applied-science.js-interop :as j] [chia.view :as v] [chia.view.hiccup :as hiccup]) (:import [goog.async Deferred])) (def space \u00A0) (defn kind [thing] (cond (char? thing) :character (false? thing) :false (keyword? thing...
f8d73f7573f546cf189bf45a69e4b2d69ea6a507389733f45f3d1a023ae33fac
mtolly/onyxite-customs
Sng2014.hs
{-# LANGUAGE ImplicitParams #-} # LANGUAGE RecordWildCards # module Onyx.Rocksmith.Sng2014 where import Control.Monad import qualified Data.ByteString as B import Debug.Trace import Onyx.Codec.Binary import Onyx.Rocksmith.Crypt import Onyx.Xbox.STFS (runGet...
null
https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/Rocksmith/Sng2014.hs
haskell
# LANGUAGE ImplicitParams # actually <ebeat> actually <level> only in vocals files only in vocals files only in vocals files
# LANGUAGE RecordWildCards # module Onyx.Rocksmith.Sng2014 where import Control.Monad import qualified Data.ByteString as B import Debug.Trace import Onyx.Codec.Binary import Onyx.Rocksmith.Crypt import Onyx.Xbox.STFS (runGetM) lenArray :: (?endian :: ByteO...
060b13c6d645a5b7b886d6d9cbddd26ffcf5e5d02184cb170bd2ecfb2c2ef1f4
HealthSamurai/stresty
core.clj
(ns stresty.core (:require [stresty.server.core :as server]) (:gen-class)) (set! *warn-on-reflection* true) (defn -main [& args] (let [{err :error} (stresty.server.core/main args)] (if err (System/exit 1) (System/exit 0))))
null
https://raw.githubusercontent.com/HealthSamurai/stresty/1fd356bc7328735d56741bd6586b1ad0671fbb9a/src/stresty/core.clj
clojure
(ns stresty.core (:require [stresty.server.core :as server]) (:gen-class)) (set! *warn-on-reflection* true) (defn -main [& args] (let [{err :error} (stresty.server.core/main args)] (if err (System/exit 1) (System/exit 0))))
a69b3fbe87b42d8825e9df8b79988213d6b90cc8e667849d8b779827df94feb7
airbus-seclab/bincat
lowspeak.ml
C2Newspea : compiles C code into Newspeak . Newspeak is a minimal language well - suited for static analysis . Copyright ( C ) 2007 - 2022 , , , This library is free software ; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as p...
null
https://raw.githubusercontent.com/airbus-seclab/bincat/7d4a0b90cf950c0f43e252602a348cf9e2f858ba/ocaml/src/npk/newspeak/lowspeak.ml
ocaml
------- Types ------- ************************************************* Types Expressions Actual dump TODO: Clean this mess... StringMap Exported print functions TODO: Clean this mess... StringMap TODO: could do this after a sanity checks that checks the largest and smallest integer ever computed in ...
C2Newspea : compiles C code into Newspeak . Newspeak is a minimal language well - suited for static analysis . Copyright ( C ) 2007 - 2022 , , , This library is free software ; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as p...
5e53bb1bd747cbb4292a046a91f4c388e7b38a9fc9b533250c2cbd21413885d9
minio/minio-hs
Spec.hs
-- MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc. -- 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...
null
https://raw.githubusercontent.com/minio/minio-hs/d59f45fec4481313cfb5fafd635558ce385e7422/test/Spec.hs
haskell
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing per...
MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc. Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , import qualified Data.ByteString as B import qualified Data.List as L import Lib.Prelude import Network.Minio.API.Test impo...
f5d03261ceff7744537731656713503b48639aaf4d0639bdfa151ff9166935f8
racket/redex
all-info.rkt
#lang racket/base (require racket/runtime-path racket/list racket/path) (provide all-mods) (define-runtime-path here ".") (define (all-info-files) (for/list ([f (in-directory here)] #:when (and (file-exists? f) (regexp-match #rx"^.*info\\.rkt$" ...
null
https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-benchmark/redex/benchmark/models/all-info.rkt
racket
#lang racket/base (require racket/runtime-path racket/list racket/path) (provide all-mods) (define-runtime-path here ".") (define (all-info-files) (for/list ([f (in-directory here)] #:when (and (file-exists? f) (regexp-match #rx"^.*info\\.rkt$" ...
6be9412c9dcc1ba2727f18203a55394c938dd40ffc2c80a0ab176b9b04945ea1
alanz/ghc-exactprint
Q.hs
module Q where import qualified Map import Map(Map) mymember :: Int -> Map Int a -> Bool mymember k m = Map.member k m || Map.member (k + 1) m
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/Q.hs
haskell
module Q where import qualified Map import Map(Map) mymember :: Int -> Map Int a -> Bool mymember k m = Map.member k m || Map.member (k + 1) m
2fb790f34622b4bf40609a8341057f20b0decce39680b9c32f553f566e266772
ChrisTitusTech/gimphelp
210_edges_trans-border.scm
210_edges_trans-border.scm last modified / tested by [ gimphelp.org ] 05/11/2019 on GIMP 2.10.10 ;================================================== ; ; Installation: ; This script should be placed in the user or system-wide script folder. ; ; Windows 7/10 C:\Program Files\GIMP 2\share\gimp\2.0\scripts ; or ...
null
https://raw.githubusercontent.com/ChrisTitusTech/gimphelp/fdbc7e3671ce6bd74cefd83ecf7216e5ee0f1542/gimp_scripts-2.10/210_edges_trans-border.scm
scheme
================================================== Installation: This script should be placed in the user or system-wide script folder. Windows 7/10 or Linux /home/yourname/.config/GIMP/2.10/scripts or Linux system-wide /usr/share/gimp/2.0/scripts ================================================== ...
210_edges_trans-border.scm last modified / tested by [ gimphelp.org ] 05/11/2019 on GIMP 2.10.10 C:\Program Files\GIMP 2\share\gimp\2.0\scripts C:\Users\YOUR - NAME\AppData\Roaming\GIMP\2.10\scripts it under the terms of the GNU General Public License as published by the Free Software Foundation ,...
1d2ba8aaaad8d780a6d6f40832ada82b35ebbdcdc0e430e041dc5ccef4582e26
roehst/tapl-implementations
core.ml
open Format open Syntax open Support.Error open Support.Pervasive (* ------------------------ EVALUATION ------------------------ *) let rec isnumericval ctx t = match t with TmZero(_) -> true | TmSucc(_,t1) -> isnumericval ctx t1 | _ -> false let rec isval ctx t = match t with TmString _ -> true |...
null
https://raw.githubusercontent.com/roehst/tapl-implementations/23c0dc505a8c0b0a797201a7e4e3e5b939dd8fdb/fullomega/core.ml
ocaml
------------------------ EVALUATION ------------------------ ------------------------ TYPING ------------------------
open Format open Syntax open Support.Error open Support.Pervasive let rec isnumericval ctx t = match t with TmZero(_) -> true | TmSucc(_,t1) -> isnumericval ctx t1 | _ -> false let rec isval ctx t = match t with TmString _ -> true | TmUnit(_) -> true | TmLoc(_,_) -> true | TmFloat _ -> true | ...
db78a54deaa22945f53d029477d353aab6afcfcb5911f7260cec15048edb0753
wireless-net/erlang-nommu
wxe_server.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2008 - 2014 . All Rights Reserved . %% The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Publi...
null
https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/wxe_server.erl
erlang
%CopyrightBegin% compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitatio...
Copyright Ericsson AB 2008 - 2014 . All Rights Reserved . The contents of this file are subject to the Erlang 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 " Author : Created : 17 Jan 2007 b...
3a86f66d9d1cc5986cc6f3435eee7331c1562192da47693cb308c5508c2c8c68
hipsleek/hipsleek
dp.ml
#include "xdebug.cppo" open Globals open VarGen open Error open Cpure type var_rep = string type sformula = | STrue | SFalse | SComp of scform and scform = | Seq of (var_rep*var_rep) | Sneq of (var_rep*var_rep) | SAnd of (scform * scform) | SOr of (scform * scform) let rec string_of_scformula f = ma...
null
https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/src/dp.ml
ocaml
i f (x_add Omega.simplify) if not (sat_check afc) then true else false
#include "xdebug.cppo" open Globals open VarGen open Error open Cpure type var_rep = string type sformula = | STrue | SFalse | SComp of scform and scform = | Seq of (var_rep*var_rep) | Sneq of (var_rep*var_rep) | SAnd of (scform * scform) | SOr of (scform * scform) let rec string_of_scformula f = ma...
b99c54e231ab27793e9c41067f9be25f09f0079a0858950f9a932c283d1bb168
naoiwata/sicp
ex3.81.scm
;; ;; @author naoiwata SICP Chapter3 Exercise 3.81 . ;; ; ------------------------------------------------------------------------ ; question ; ------------------------------------------------------------------------ (add-load-path "./pages/" :relative) (load "stream.scm") (define (random-stream requests) (def...
null
https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter3/ex3.81.scm
scheme
@author naoiwata ------------------------------------------------------------------------ question ------------------------------------------------------------------------
SICP Chapter3 Exercise 3.81 . (add-load-path "./pages/" :relative) (load "stream.scm") (define (random-stream requests) (define (rand req prev) (random-update (cond ((and (symbol? req) (eq? req 'generate)) prev) ((and (pair? req) (eq? (car req) 'reset)) (cdr req)) (else ...
ae6bb8d7b50bc95a214825aa7ab7a7fa89cfc47bb89dc7c7cb62295343e3e3b9
input-output-hk/ouroboros-network
State.hs
{-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} # LANGUAGE UndecidableInstances # module Ouroboros.Consensus.Mock.Ledger.State ( -- * State of the mock ledger MockError (..) ...
null
https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus-mock/src/Ouroboros/Consensus/Mock/Ledger/State.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving # * State of the mock ledger ------------------------------------------------------------------------------ State of the mock ledger ------------------------------------------------------------------------------ -----...
# LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # # LANGUAGE UndecidableInstances # module Ouroboros.Consensus.Mock.Ledger.State ( MockError (..) , MockState (..) , updateMockState , updateMockTip , updateMockUTxO * Genesis state , genesisMockState ) where import Cardan...
0ef61b08a8407498f6495f1eec1c9f3a91609815f4afb99b2e322ee27dd66542
imdea-software/leap
YicesPairsQuery.mli
(***********************************************************************) (* *) LEAP (* *) , IMDEA ...
null
https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/solvers/backend/query/yices/YicesPairsQuery.mli
ocaml
********************************************************************* ...
LEAP , IMDEA Software Institute Copyright 2011 IMDEA Software Institute Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compl...
d94d2f4ab9111d11b1f3c9c70ec784f53554484a213187dd1ce89d80068f1ff6
tsahyt/clingo-haskell
TheoryAtoms.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Clingo.Control import Clingo.Model import Clingo.ProgramBuilding import Clingo.Solving import Clingo.Symbol import Control.Monad import Control.Monad.Catch import Control.Monad.IO.Class import Data.Maybe import Clingo.Inspection.Theory printModel :: (Monad...
null
https://raw.githubusercontent.com/tsahyt/clingo-haskell/083c84aae63565067644ccaa72223a4c12b33b88/examples/TheoryAtoms.hs
haskell
# LANGUAGE OverloadedStrings # obtain number of theory atoms via length find the atom b/1 and determine whether it has a guard
module Main where import Clingo.Control import Clingo.Model import Clingo.ProgramBuilding import Clingo.Solving import Clingo.Symbol import Control.Monad import Control.Monad.Catch import Control.Monad.IO.Class import Data.Maybe import Clingo.Inspection.Theory printModel :: (MonadIO (m s), MonadModel m) => Model s ...
110069aed80eb06691b117b89ca78de94689f13df7395db68438a859b7a55e49
cram2/cram
hypergeometric-randist.lisp
Regression test - RANDIST for GSLL , automatically generated ;; Copyright 2009 Distributed under the terms of the GNU General Public License ;; ;; This program 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 Fou...
null
https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/hypergeometric-randist.lisp
lisp
This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Publi...
Regression test - RANDIST for GSLL , automatically generated Copyright 2009 Distributed under the terms of the GNU General Public License it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a co...
9ab82e32aec55b8a98938b06a183a47d7a42299111186792b0962e50f263e9f6
re-ops/re-gent
log.clj
(ns re-gent.log "log setup" (:require [re-share.log :as log] [taoensso.timbre :refer (refer-timbre set-level!)])) (refer-timbre) (defn setup-logging "Sets up logging configuration: - steam collect logs - log level " [& {:keys [level] :or {level :info}}] (log/setup "re-gent" []) (set-level!...
null
https://raw.githubusercontent.com/re-ops/re-gent/78bcd22011a31ca3f19a7221e87a6a7afd7682a5/src/re_gent/log.clj
clojure
(ns re-gent.log "log setup" (:require [re-share.log :as log] [taoensso.timbre :refer (refer-timbre set-level!)])) (refer-timbre) (defn setup-logging "Sets up logging configuration: - steam collect logs - log level " [& {:keys [level] :or {level :info}}] (log/setup "re-gent" []) (set-level!...
10c94130b9be22a16cd7d8ba8fa2247f580a4876c4193e3d9df3bfa825ea9b9d
oriansj/mes-m2
load.scm
;;; -*-scheme-*- GNU --- Maxwell Equations of Software Copyright © 2016 Jan ( janneke ) Nieuwenhuizen < > ;;; 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 ; e...
null
https://raw.githubusercontent.com/oriansj/mes-m2/b44fbc976ae334252de4eb82a57c361a195f2194/test/data/load.scm
scheme
-*-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.
GNU --- Maxwell Equations of Software Copyright © 2016 Jan ( janneke ) Nieuwenhuizen < > 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 Lic...
a9ef4dfa50ab7d57944c686b14250fc55f4e1e043fcda78cd2621cd36d11c8b0
syntax-objects/syntax-parse-example
2-test.rkt
#lang racket/base (module+ test (require rackunit (only-in racket/port with-output-to-string) syntax-parse-example/try-catch-finally/2) (test-case "catch" (check-equal? (try (raise-syntax-error #f "a syntax error") (catch (exn:fail:syntax? e) "got a syntax ...
null
https://raw.githubusercontent.com/syntax-objects/syntax-parse-example/0675ce0717369afcde284202ec7df661d7af35aa/try-catch-finally/2-test.rkt
racket
#lang racket/base (module+ test (require rackunit (only-in racket/port with-output-to-string) syntax-parse-example/try-catch-finally/2) (test-case "catch" (check-equal? (try (raise-syntax-error #f "a syntax error") (catch (exn:fail:syntax? e) "got a syntax ...
9b56cfe7729d9c990d8021db18e2bbc1213fbca7784ffc277e89019dd65d26a8
khasm-lang/khasmc
lamlift.ml
open Exp open Kir type lamctx = { frees : (kirval * kirtype) list } [@@deriving show { with_path = false }] let emptyctx () = { frees = [] } let add_bound ctx v ts = { ctx with frees = (v, ts) :: ctx.frees } let ctxwith frees = { frees } let rec deconstruct_assoc_list al = match al with | [] -> ([], []) | [ x ...
null
https://raw.githubusercontent.com/khasm-lang/khasmc/e190cad60ba66e701ad0ae9d288ddb9a55e63a12/lib/middleend/lamlift.ml
ocaml
open Exp open Kir type lamctx = { frees : (kirval * kirtype) list } [@@deriving show { with_path = false }] let emptyctx () = { frees = [] } let add_bound ctx v ts = { ctx with frees = (v, ts) :: ctx.frees } let ctxwith frees = { frees } let rec deconstruct_assoc_list al = match al with | [] -> ([], []) | [ x ...
80808b60c1ed857356a7a4eb33117e5b8314932afaa970621732fa023c5bdf28
exercism/ocaml
bowling.mli
open Base (** Abstract type for the bowling game. *) type t (** A new bowling game *) val new_game: t (** This is called each time the player rolls a ball, with input the number of pins knocked down. The return value is the updated state of the game. *) val roll : int -> t -> (t, string) Result.t (** This is called...
null
https://raw.githubusercontent.com/exercism/ocaml/bfd6121f757817865a34db06c3188b5e0ccab518/exercises/practice/bowling/bowling.mli
ocaml
* Abstract type for the bowling game. * A new bowling game * This is called each time the player rolls a ball, with input the number of pins knocked down. The return value is the updated state of the game. * This is called at the end of a game to retrieve the final score.
open Base type t val new_game: t val roll : int -> t -> (t, string) Result.t val score : t -> (int, string) Result.t
433458fbd1939ed546a73f823f8b129dfb17e6e9a99b1ed0cfc0ac80d7681fcf
alaricsp/chicken-scheme
srfi-18-tests.scm
(require-extension srfi-18) (cond-expand (dribble (define-for-syntax count 0) (define-syntax trail (lambda (form r c) ; doesn't bother much with renaming (let ((loc (cadr form)) (expr (caddr form))) (set! count (add1 count)) `(,(r 'begin) (print "(" ,count ") " ,loc ": " ',expr ": get: " (##sys...
null
https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/tests/srfi-18-tests.scm
scheme
doesn't bother much with renaming allow put! operation prevent put! operation wait until object in mailbox prevent space leaks allow put! operation prevent get! operation (tprint 'start) (tprint "read: " x) (tprint 'put) (tprint 'exit)
(require-extension srfi-18) (cond-expand (dribble (define-for-syntax count 0) (define-syntax trail (let ((loc (cadr form)) (expr (caddr form))) (set! count (add1 count)) `(,(r 'begin) (print "(" ,count ") " ,loc ": " ',expr ": get: " (##sys#slot get-mutex 5) ", put: " (##sys#slot put-mutex 5)) (le...
b3b18e5ee3b2c5c5d9c2fdb313c66b80a4cf1d915f4851959dae2f67a14fbc5e
racket/racket7
pkgs-config.rkt
#lang racket/base (require racket/cmdline racket/format racket/path) ;; Adjust the configuration to consult a catalog that is ;; expected to map some packages to directory links. ;; Used by the top-level Makefile in the main Racket repository. (define config-dir-path (build-path "racket" "etc")) (d...
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/pkgs-config.rkt
racket
Adjust the configuration to consult a catalog that is expected to map some packages to directory links. Used by the top-level Makefile in the main Racket repository.
#lang racket/base (require racket/cmdline racket/format racket/path) (define config-dir-path (build-path "racket" "etc")) (define config-file-path (build-path config-dir-path "config.rktd")) (define catalog-relative-path (build-path 'up "share" "pkgs-catalog")) (define catalog-relative-path-str (p...
5b6cf03bbd286675c908046fa3f5d7c8bd925d2e357d75ffbd944dea610e57f4
rudymatela/express
Derive.hs
# LANGUAGE TemplateHaskell , CPP # -- | -- Module : Data.Express.Express.Derive Copyright : ( c ) 2019 - 2021 License : 3 - Clause BSD ( see the file LICENSE ) Maintainer : < > -- Allows automatic derivation of ' Express ' typeclass instances . module Data.Express.Express.Derive ( derive...
null
https://raw.githubusercontent.com/rudymatela/express/7a59ecc1cd8e7ff7f2fbe76d33380006d329be8c/src/Data/Express/Express/Derive.hs
haskell
| Module : Data.Express.Express.Derive If '-:', '->:', '->>:', '->>>:', ... are not in scope, this will derive them as well. | Same as 'deriveExpress' but does not warn when instance already exists ('deriveExpress' is preferable). cascading derivation of type arguments as well. but cascade through a...
# LANGUAGE TemplateHaskell , CPP # Copyright : ( c ) 2019 - 2021 License : 3 - Clause BSD ( see the file LICENSE ) Maintainer : < > Allows automatic derivation of ' Express ' typeclass instances . module Data.Express.Express.Derive ( deriveExpress , deriveExpressCascading , deriveExpressI...
8692ee1e76cb74e989eb495766731d43771e9b88f5b6754cd8ff86ad02f3c3cb
erlang/erlide_kernel
erlide_builder_server.erl
%%% ****************************************************************************** Copyright ( c ) 2009 and others . %%% All rights reserved. This program and the accompanying materials %%% are made available under the terms of the Eclipse Public License v1.0 %%% which accompanies this distribution, and is avai...
null
https://raw.githubusercontent.com/erlang/erlide_kernel/763a7fe47213f374b59862fd5a17d5dcc2811c7b/common/apps/erlide_builder/src/erlide_builder_server.erl
erlang
****************************************************************************** All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: ************************...
Copyright ( c ) 2009 and others . -v10.html Author : -module(erlide_builder_server). -behaviour(gen_server). -define(DEBUG , 1 ) . -include_lib("erlide_common/include/erlide_dbglog.hrl"). -export([ start/0, stop/0, add_project/2, remove_project/1 ]). -export([init/1, handle...
349248129384e593fa42ec88f32870a57cce51ce29f67ab8047c07ba3bda37c0
mtgred/netrunner
users.cljs
(ns nr.users (:require [clojure.string :as str] [nr.appstate :refer [app-state]] [nr.utils :refer [non-game-toast]] [nr.ws :as ws] [reagent.core :as r])) (def users-state (r/atom {})) (defmethod ws/event-msg-handler :admin/fetch-users [{{success :success} :?data}] (when success (reset! ...
null
https://raw.githubusercontent.com/mtgred/netrunner/7ef14ac2b02cd863879a339ffd7fbe2fa8d6e009/src/cljs/nr/users.cljs
clojure
else
(ns nr.users (:require [clojure.string :as str] [nr.appstate :refer [app-state]] [nr.utils :refer [non-game-toast]] [nr.ws :as ws] [reagent.core :as r])) (def users-state (r/atom {})) (defmethod ws/event-msg-handler :admin/fetch-users [{{success :success} :?data}] (when success (reset! ...
33df4a91d2ceed69e24fec103c913e2d2397ba9653c46d0e88e1b74cb0a7e379
privet-kitty/cl-competitive
integer-root.lisp
(defpackage :cp/integer-root (:use :cl) (:export #:iroot) (:documentation "Provides computation of the floor of the nth root of an integer.")) (in-package :cp/integer-root) This value is set for SBCL x86 - 64 (defconstant +bit-width+ 62) (deftype uint () '(unsigned-byte #.+bit-width+)) (declaim ((simple-ar...
null
https://raw.githubusercontent.com/privet-kitty/cl-competitive/c1c59532ccd1d7940b27c64362b957cebcf267a5/module/integer-root.lisp
lisp
(defpackage :cp/integer-root (:use :cl) (:export #:iroot) (:documentation "Provides computation of the floor of the nth root of an integer.")) (in-package :cp/integer-root) This value is set for SBCL x86 - 64 (defconstant +bit-width+ 62) (deftype uint () '(unsigned-byte #.+bit-width+)) (declaim ((simple-ar...
6a9d94d85507e4b78c011dbe10dea78c3364d0f894b11a8bffa760e15de24c32
amoe/boson
run-server.sps
#! /usr/bin/env scheme-r6rs #!r6rs (import (rnrs) (boson http)) (define httpd (web-server (list 'port 8080))) (web-server-start httpd (lambda () #t))
null
https://raw.githubusercontent.com/amoe/boson/51c77d8f9a08da39315d76cbba9e4d9ad318efe7/run-server.sps
scheme
#! /usr/bin/env scheme-r6rs #!r6rs (import (rnrs) (boson http)) (define httpd (web-server (list 'port 8080))) (web-server-start httpd (lambda () #t))
0e2ead6ceecb14a75fdd9d44acc44a23ea4d4e4c7a237c7e2f0d13913ec399c5
MedeaMelana/JsonGrammar2
Types.hs
module Types where import Data.Text (Text) data Person = Person { name :: Text , gender :: Gender , age :: Int , location :: Coords } deriving (Show, Eq) data Coords = Coords { lat :: Float, lng :: Float } deriving (Show, Eq) data Gender = Male | Female deriving (Show, Eq)
null
https://raw.githubusercontent.com/MedeaMelana/JsonGrammar2/1d3976f9ec5a00940cc9fc6f29a173df9b621bd4/tests/Types.hs
haskell
module Types where import Data.Text (Text) data Person = Person { name :: Text , gender :: Gender , age :: Int , location :: Coords } deriving (Show, Eq) data Coords = Coords { lat :: Float, lng :: Float } deriving (Show, Eq) data Gender = Male | Female deriving (Show, Eq)
4b69d7894764e1c12a82a3c317ac14712e9c19cfda91d7bf0a9efe880c3012a8
maximedenes/native-coq
unification.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/pretyping/unification.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** * The "unique" unification fonction ...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Term open Environ open E...
8f522bfe0b21a3008d84f67993fd40ee8db258dd68a32b01176f205e5da6c703
borkdude/advent-of-cljc
dfuenzalida.cljc
(ns aoc.y2017.d07.dfuenzalida (:refer-clojure :exclude [read-string format]) (:require [aoc.utils :as u :refer [deftest read-string format]] [aoc.y2017.d07.data :refer [input answer-1 answer-2]] [clojure.string :as s] [clojure.test :as t :refer [is testing]])) (defn parents-in [[k vs]] (reduce merge ...
null
https://raw.githubusercontent.com/borkdude/advent-of-cljc/17c8abb876b95ab01eee418f1da2e402e845c596/src/aoc/y2017/d07/dfuenzalida.cljc
clojure
name and children leave only nodes with children the current node is not balanced, all children have same weight Scratch
(ns aoc.y2017.d07.dfuenzalida (:refer-clojure :exclude [read-string format]) (:require [aoc.utils :as u :refer [deftest read-string format]] [aoc.y2017.d07.data :refer [input answer-1 answer-2]] [clojure.string :as s] [clojure.test :as t :refer [is testing]])) (defn parents-in [[k vs]] (reduce merge ...
55c0b10da135e588f1409033d8c64efa6b6ce7aab5f19fc1bdc973815a91e523
rbardou/red
spawn.mli
(** Spawn cooperative threads and run them. *) * { 2 Groups } (** Collections of tasks. *) type group (** The default group for new tasks. *) val default_group: group * Create a new empty collection of tasks . Subtasks ( tasks spawned by other tasks ) belong to the group of their parent by default . Ro...
null
https://raw.githubusercontent.com/rbardou/red/e23c2830909b9e5cd6afe563313435ddaeda90bf/termlib/spawn.mli
ocaml
* Spawn cooperative threads and run them. * Collections of tasks. * The default group for new tasks. * Cancel all tasks of a given collection. If you try to add a task to a dead group, the task will just be ignored. Warning: if a task is responsible of cleaning up something (like closing open file desc...
* { 2 Groups } type group val default_group: group * Create a new empty collection of tasks . Subtasks ( tasks spawned by other tasks ) belong to the group of their parent by default . Root tasks ( tasks which are spawned outside of any task ) belong to [ default ] . Subtasks (tasks spawned by oth...
470c580bdf21ae087db9de253c6e5f4cd695b7ad7a613a7c33d64f70b71b561d
byteally/dbrecord
PPCheck.hs
{-# LANGUAGE OverloadedStrings #-} module Test.DBRecord.PPCheck where import qualified DBRecord.Postgres.Internal.Sql.Pretty as PG import qualified DBRecord.MSSQL.Internal.Sql.Pretty as MSSQL import qualified DBRecord.MySQL.Internal.Sql.Pretty as MySQL import qualified DBRecord.Sqlite.Internal.Sql.Pretty as SQLite imp...
null
https://raw.githubusercontent.com/byteally/dbrecord/991efe9a293532ee9242b3e9a26434cf16f5b2a0/dbrecord-test/src/Test/DBRecord/PPCheck.hs
haskell
# LANGUAGE OverloadedStrings # Value -> offset , ("view_id", toConst viewId)
module Test.DBRecord.PPCheck where import qualified DBRecord.Postgres.Internal.Sql.Pretty as PG import qualified DBRecord.MSSQL.Internal.Sql.Pretty as MSSQL import qualified DBRecord.MySQL.Internal.Sql.Pretty as MySQL import qualified DBRecord.Sqlite.Internal.Sql.Pretty as SQLite import DBRecord.Internal.PrimQuery imp...
17f0072668e50a18e19f67604155947fb0112a879e2859e371ecfd30a8406b89
huiqing/percept2
egd_primitives.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2008 - 2009 . All Rights Reserved . %% The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Pu...
null
https://raw.githubusercontent.com/huiqing/percept2/fa796a730d6727210a71f185e6a39a960c2dcb90/src/egd_primitives.erl
erlang
%CopyrightBegin% compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limit...
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved . The contents of this file are subject to the Erlang 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 " -module(egd_primitives). -export([ crea...
031d1a1383ff0ab7749c8958f8a5c1d930f56c44075954b83fbc8d2c7570c8b0
namin/biohacker
lessons.lisp
(setq absent-essential-compounds '(ALA ASP DTTP)) (setq unproduceable-essential-compounds '(DATPDGTP)) (setq minimal-nutrient-set '(ASN GLY CTP UDP-GALACTOSE LYS UDP-GLUCOSE ADP-L-GLYCERO-D-MANNO-HEPTOSE ARG TRP SER FRUCTOSE-6P THR CYS GTP GLN UTP UDP RIBULOSE-5P GLYCEROL-3P CDPDIACYLGLYCEROL 3-OHMYRISTOYL-ACP WA...
null
https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/network-debugger/tests/lessons.lisp
lisp
(setq absent-essential-compounds '(ALA ASP DTTP)) (setq unproduceable-essential-compounds '(DATPDGTP)) (setq minimal-nutrient-set '(ASN GLY CTP UDP-GALACTOSE LYS UDP-GLUCOSE ADP-L-GLYCERO-D-MANNO-HEPTOSE ARG TRP SER FRUCTOSE-6P THR CYS GTP GLN UTP UDP RIBULOSE-5P GLYCEROL-3P CDPDIACYLGLYCEROL 3-OHMYRISTOYL-ACP WA...
333fdeef45ae0f61761e1b196f9d3fb156b2650801df1b445a4d2d4dde776088
zkincaid/duet
test_iteration.ml
open Srk open OUnit open Syntax open Test_pervasives module QQMatrix = Linear.QQMatrix module SP = struct include Iteration.MakeDomain(Iteration.ProductWedge (SolvablePolynomial.SolvablePolynomial) (Iteration.WedgeGuard)) let star srk tf = closure (...
null
https://raw.githubusercontent.com/zkincaid/duet/162d3da830f12ab8e8d51f7757cddcb49c4084ca/srk/test/test_iteration.ml
ocaml
open Srk open OUnit open Syntax open Test_pervasives module QQMatrix = Linear.QQMatrix module SP = struct include Iteration.MakeDomain(Iteration.ProductWedge (SolvablePolynomial.SolvablePolynomial) (Iteration.WedgeGuard)) let star srk tf = closure (...
61fef655f9f4253182d49f637e29f3a51034c134b09eaa86e76fcacd9b79c096
green-coder/minimallist
core_test.cljc
(ns minimallist.core-test (:require [clojure.test :refer [deftest testing is are]] [minimallist.core :refer [valid? explain describe undescribe] :as m] [minimallist.helper :as h] [minimallist.util :as util])) (comment (#'m/sequence-descriptions {} ; [:cat [:+ pos-int?] ;...
null
https://raw.githubusercontent.com/green-coder/minimallist/f10ebbd3c2b93e7579295618a7ed1e870c489bc4/test/minimallist/core_test.cljc
clojure
[:cat [:+ pos-int?] [:+ int?]] [:* int?] [:+ int?] fn enum and or set map, entries map, keys and values sequence, no collection type specified sequence, with condition sequence as a list sequence as a vector sequence as a string sequence with size specified using a model sequence with entries (f...
(ns minimallist.core-test (:require [clojure.test :refer [deftest testing is are]] [minimallist.core :refer [valid? explain describe undescribe] :as m] [minimallist.helper :as h] [minimallist.util :as util])) (comment (#'m/sequence-descriptions {} (h/cat (h/+ (h/fn pos-int?)...
c37590de33f2c0bcb6b5e616bcc30dce35046513cd78683128ee1546cc84a803
haskell-github/github
Example.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} import Prelude () import Prelude.Compat import Data.Text (Text, pack) import Data.Text.IO as T (putStrLn) import qualified GitHub.Endpoints.Users.Followers as GitHub main :: IO () main = do possibleUsers <- GitHub.usersFollowing "mike-bur...
null
https://raw.githubusercontent.com/haskell-github/github/81d9b658c33a706f18418211a78d2690752518a4/samples/Users/Followers/Example.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # import Prelude () import Prelude.Compat import Data.Text (Text, pack) import Data.Text.IO as T (putStrLn) import qualified GitHub.Endpoints.Users.Followers as GitHub main :: IO () main = do possibleUsers <- GitHub.usersFollowing "mike-burns" T.putStrLn $ either (("Erro...
7719a905e04db9bb860ad826552de62bb187448aaccd17e834c09cdc1c0cc59e
ixy-languages/ixy.ml
ixy_pci.ml
open Ixy_memory open Log type hw = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t type pci_config = { vendor : int ; device_id : int ; class_code : int ; subclass : int ; prog_if : int } let vendor_intel = 0x8086 module type S = sig type t val map_resource : t -> hw va...
null
https://raw.githubusercontent.com/ixy-languages/ixy.ml/e79dcc4a19afd8e531346c27624c54224f942dc9/lib/ixy_pci.ml
ocaml
entry_size is fixed for now might not be necessary
open Ixy_memory open Log type hw = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t type pci_config = { vendor : int ; device_id : int ; class_code : int ; subclass : int ; prog_if : int } let vendor_intel = 0x8086 module type S = sig type t val map_resource : t -> hw va...
8559d097f34e36aac92d4fac17a3daf0ed0f6e6dde40daa999d67e8f3f7583ae
unison-code/uni-instr-sel
Base.hs
| Copyright : Copyright ( c ) 2012 - 2017 , < > License : BSD3 ( see the LICENSE file ) Maintainer : Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <> License : BSD3 (see the LICENSE file) Maintainer : -} Main authors : < > Main authors: Gabriel Hjort ...
null
https://raw.githubusercontent.com/unison-code/uni-instr-sel/2edb2f3399ea43e75f33706261bd6b93bedc6762/uni-is-llvm/UniISLLVM/Drivers/Base.hs
haskell
# LANGUAGE DeriveDataTypeable # ------------ Data types ------------ | Options that can be given on the command line. | Represents 'make' actions.
| Copyright : Copyright ( c ) 2012 - 2017 , < > License : BSD3 ( see the LICENSE file ) Maintainer : Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <> License : BSD3 (see the LICENSE file) Maintainer : -} Main authors : < > Main authors: Gabriel Hjort ...
1db19c245b49c296ac81b037642226312da51daa881defd8e88d807f4c5cd487
racket/gui
gauge.rkt
#lang racket/base (require racket/class ffi/unsafe "../../syntax.rkt" "../common/event.rkt" "item.rkt" "utils.rkt" "const.rkt" "window.rkt" "wndclass.rkt" "types.rkt") (provide (protect-out gauge%)) (define PBS_VERTICAL #x04) (define PBM_SETRANGE (+ WM_USER 1)) ...
null
https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mred/private/wx/win32/gauge.rkt
racket
#lang racket/base (require racket/class ffi/unsafe "../../syntax.rkt" "../common/event.rkt" "item.rkt" "utils.rkt" "const.rkt" "window.rkt" "wndclass.rkt" "types.rkt") (provide (protect-out gauge%)) (define PBS_VERTICAL #x04) (define PBM_SETRANGE (+ WM_USER 1)) ...
b7ae6cba6f7e7eb68ef9ff7cf08017d826b4b46d922e3f847ac489cae85d5096
anycable/erlycable
anycable.erl
-*- coding : utf-8 -*- %% Automatically generated, do not edit Generated by gpb_compile version 3.24.4 -module(anycable). -export([encode_msg/1, encode_msg/2]). -export([decode_msg/2, decode_msg/3]). -export([merge_msgs/2, merge_msgs/3]). -export([verify_msg/1, verify_msg/2]). -export([get_msg_defs/0]). -export([g...
null
https://raw.githubusercontent.com/anycable/erlycable/6f52a5b16c080bfa0feeb1f4f9e45fc552af71b5/src/protos/anycable.erl
erlang
Automatically generated, do not edit
-*- coding : utf-8 -*- Generated by gpb_compile version 3.24.4 -module(anycable). -export([encode_msg/1, encode_msg/2]). -export([decode_msg/2, decode_msg/3]). -export([merge_msgs/2, merge_msgs/3]). -export([verify_msg/1, verify_msg/2]). -export([get_msg_defs/0]). -export([get_msg_names/0]). -export([get_enum_name...
215d042a7b67fca23c6af3c1a9cc56163bef910922f0c79344ec118831cc6f5e
onedata/op-worker
atm_workflow_execution_api.erl
%%%------------------------------------------------------------------- @author ( C ) 2021 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . %%% @end %%%------------------------------------------------------------------- %%% @doc %%% API module for performing operatio...
null
https://raw.githubusercontent.com/onedata/op-worker/171b05ac629acb4fc337b7dc2f5bf7c433d2c23f/src/modules/automation/atm_workflow_execution_api.erl
erlang
------------------------------------------------------------------- @end ------------------------------------------------------------------- @doc API module for performing operations on automation workflow executions. An execution is created according to specified automation workflow schema revision - to learn mor...
@author ( C ) 2021 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . Those schemas ( workflow and all used lambdas ) are fetched from Onezone and is made of one or more runs . Lane execution * run * is an attempt of execution Two types of manual repeat is suppo...
ac4e50a79876eea91770533172c5786c850e10d7201e9b26459bbff5dd3fb3eb
jafingerhut/clojure-benchmarks
spectralnorm.clj
The Computer Language Benchmarks Game ;; / ;; ported from Java # 2 provided by (ns spectralnorm (:import [java.util.concurrent CyclicBarrier] [clojure.lang Numbers]) (:gen-class)) (set! *warn-on-reflection* true) (set! *unchecked-math* true) (defmacro a [i j] `(/ 1.0 (double (+ (Numbers/unsi...
null
https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/2017-mar-31-benchmarks-game-site-versions/spectralnorm.clj
clojure
/
The Computer Language Benchmarks Game ported from Java # 2 provided by (ns spectralnorm (:import [java.util.concurrent CyclicBarrier] [clojure.lang Numbers]) (:gen-class)) (set! *warn-on-reflection* true) (set! *unchecked-math* true) (defmacro a [i j] `(/ 1.0 (double (+ (Numbers/unsignedShif...
98a0bdf640d18eeef06f210616baae76950ad6f1b7e57d20cc83c66305eee3a2
Ramarren/png-read
png-state.lisp
(in-package :png-read) (defclass png-state () ((file :accessor png-file :initform nil) (finished :accessor finished :initform nil) (width :accessor width) (height :accessor height) (bit-depth :accessor bit-depth) (colour-type :accessor colour-type) (compression :accessor compression) (filter-met...
null
https://raw.githubusercontent.com/Ramarren/png-read/ec29f38a689972b9f1373f13bbbcd6b05deada88/png-state.lisp
lisp
ancillaries
(in-package :png-read) (defclass png-state () ((file :accessor png-file :initform nil) (finished :accessor finished :initform nil) (width :accessor width) (height :accessor height) (bit-depth :accessor bit-depth) (colour-type :accessor colour-type) (compression :accessor compression) (filter-met...
09685078b9a85a75c2b35f836fc4e51e5016849e096a5a27271ceb7b90e24d5d
adamliesko/dynamo
vector_clock.erl
-module (vector_clock). -export ([new/1, fix/2, incr/2, prune/1, diff/2, join/2,leq/2,equal/2]). -define(PRUNE_LIMIT, 5). new(Node) -> [{Node, 1}]. resolve key value from two ppossibly different vector clocks fix({FClock, FValues} = First, {SClock, SValues} = Second) -> ComparisonResult = diff(FClock,SClock), ...
null
https://raw.githubusercontent.com/adamliesko/dynamo/cd97a96d1ce250e93f39cd16f9a3ef6c7030678d/src/vector_clock.erl
erlang
Searches the list of tuples TupleList1 for a tuple whose Nth element % Returns { value , Tuple , TupleList2 } if such a tuple is found, otherwise false. TupleList2 is a copy of TupleList1 where the keymerge(N, TupleList1, TupleList2) -> TupleList3 tuples compare equal, the tuple from TupleList1 is picked before...
-module (vector_clock). -export ([new/1, fix/2, incr/2, prune/1, diff/2, join/2,leq/2,equal/2]). -define(PRUNE_LIMIT, 5). new(Node) -> [{Node, 1}]. resolve key value from two ppossibly different vector clocks fix({FClock, FValues} = First, {SClock, SValues} = Second) -> ComparisonResult = diff(FClock,SClock), ...
8f61b91c64302d196046c0c0cbb13d8bbcadbd4b486cc6d4c7eb2eb06ec8fe06
mbj/mhs
OpenApi.hs
module OpenApi where import OpenApi.OpenApi import OpenApi.Prelude import qualified Data.Aeson as JSON import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS import qualified Data.Yaml as YAML import qualified System.Path as Path loadSpecFileJSON :: f...
null
https://raw.githubusercontent.com/mbj/mhs/71d96825e92df3549c2ca5b0058acbb91fc2a6e7/openapi/src/OpenApi.hs
haskell
module OpenApi where import OpenApi.OpenApi import OpenApi.Prelude import qualified Data.Aeson as JSON import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS import qualified Data.Yaml as YAML import qualified System.Path as Path loadSpecFileJSON :: f...
e57e112a16ac68bfd2d2fe6349a40091e857a41883e19a9f56bd1142ee73238b
caisah/sicp-exercises-and-examples
ex_2.66.scm
;; Implement the lookup procedure for the case where the set of records is structured as ;; a binary tree, ordered by the numerical values of the keys. (define (lookup given-key set-of-records) (cond ((null? set-of-records) false) ((= given-key (key (entry set-of-records))) (entry set-of-records)...
null
https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/2.3.3-representing_sets/ex_2.66.scm
scheme
Implement the lookup procedure for the case where the set of records is structured as a binary tree, ordered by the numerical values of the keys.
(define (lookup given-key set-of-records) (cond ((null? set-of-records) false) ((= given-key (key (entry set-of-records))) (entry set-of-records)) ((< given-key (key (entry set-of-records))) (lookup given-key (left-branch set-of-records))) (else (lookup given-key (righ...
657d700a20e096feb38a51a19f53ee226051fc29b5cd694624745f512daf203d
dleslie/allegro-egg
utf8.scm
(define make-utf-string* (foreign-lambda utf-string "al_ustr_new" c-string)) (define (make-utf-string-from-buffer* b) ((foreign-lambda utf-string "al_ustr_new_from_buffer" blob integer) b (blob-size b))) (define (make-utf-string str) (let ((s (make-utf-string* str))) (set-finalizer! s free-utf-string!) s)) ...
null
https://raw.githubusercontent.com/dleslie/allegro-egg/0435fb891dda5c64e95aa9dedccddd31b17e27da/utf8.scm
scheme
")) va_list ap));
(define make-utf-string* (foreign-lambda utf-string "al_ustr_new" c-string)) (define (make-utf-string-from-buffer* b) ((foreign-lambda utf-string "al_ustr_new_from_buffer" blob integer) b (blob-size b))) (define (make-utf-string str) (let ((s (make-utf-string* str))) (set-finalizer! s free-utf-string!) s)) ...
3f9d2d1252e6e73ec4cf0d764246b42b380258084e980d1f049187e0061d16a5
alanz/ghc-exactprint
records-check-sels.hs
# LANGUAGE PatternSynonyms # module Qux where -- Make sure selectors aren't generated for normal synonyms pattern Uni a = Just a pattern a :+: b = (a, b) qux = a (Just True)
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/records-check-sels.hs
haskell
Make sure selectors aren't generated for normal synonyms
# LANGUAGE PatternSynonyms # module Qux where pattern Uni a = Just a pattern a :+: b = (a, b) qux = a (Just True)