_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
143393912acc52d05d692cc1bac5e9308a64fa24dda911ed16d77487ed0e1d97
iu-parfunc/verified-instances
RunTestsCabal.hs
module Main (main) where import Control.Exception import Data.Foldable import Data.Function import Data.List import System.Directory import System.Environment import System.Exit import System.FilePath import System.Process main :: IO () main = do mbCabalHead <- lookupEnv "CABAL_HEAD" let cabalHead = case mbCabalH...
null
https://raw.githubusercontent.com/iu-parfunc/verified-instances/cebfdf1e3357a693360be74c90211be18ce3c045/generic-proofs/RunTestsCabal.hs
haskell
Infinitely loops for some reason
module Main (main) where import Control.Exception import Data.Foldable import Data.Function import Data.List import System.Directory import System.Environment import System.Exit import System.FilePath import System.Process main :: IO () main = do mbCabalHead <- lookupEnv "CABAL_HEAD" let cabalHead = case mbCabalH...
d22cbbbed8d9942be500ec4a13d5cc13ff338a3a864212a38757ad742d302943
lamdu/lamdu
OutdatedDefs.hs
# LANGUAGE TypeFamilies # module Lamdu.Sugar.Convert.DefExpr.OutdatedDefs ( scan ) where import Control.Applicative ((<|>)) import qualified Control.Lens.Extended as Lens import Control.Monad (foldM) import Control.Monad.Transaction (MonadTransaction(..)) import qualified Data.Map...
null
https://raw.githubusercontent.com/lamdu/lamdu/ca1d6ab0a64531352b8b658a83864d81e642c34d/src/Lamdu/Sugar/Convert/DefExpr/OutdatedDefs.hs
haskell
| Only if hole not already applied to it Function result changed (arg is the same). Function arg changed (result is the same).
# LANGUAGE TypeFamilies # module Lamdu.Sugar.Convert.DefExpr.OutdatedDefs ( scan ) where import Control.Applicative ((<|>)) import qualified Control.Lens.Extended as Lens import Control.Monad (foldM) import Control.Monad.Transaction (MonadTransaction(..)) import qualified Data.Map...
5c6fc22ddfa85facaf30e3f0600fb042f41d29a69336606bdc05850c527f5aba
CmdrDats/igoki
camera.clj
(ns igoki.camera (:require [igoki.util :as util] [igoki.simulated :as sim] [clojure.java.io :as io]) (:import (org.opencv.core MatOfPoint2f Mat Rect Size Core) (org.opencv.videoio Videoio VideoCapture) (org.opencv.imgcodecs Imgcodecs) (java.util LinkedList UUID) (java.io File) (o...
null
https://raw.githubusercontent.com/CmdrDats/igoki/73ac9af5cf118b8c4c220be32c30a5bbfe00808b/src/igoki/camera.clj
clojure
TODO: this chows memory - better to have a hook on update for each specific Helpful for debugging For simulation stepping (debugging) TODO: this multiple swap thing, no good. Older testing code... This was a good idea, but need to retrain the network to recognize these, so not entirely sure it's worthwhile? Woul...
(ns igoki.camera (:require [igoki.util :as util] [igoki.simulated :as sim] [clojure.java.io :as io]) (:import (org.opencv.core MatOfPoint2f Mat Rect Size Core) (org.opencv.videoio Videoio VideoCapture) (org.opencv.imgcodecs Imgcodecs) (java.util LinkedList UUID) (java.io File) (o...
30a68644e978e3c57b4d553021a24e40a6a3991b40451ed91a2cb45744423699
chaoxu/fancy-walks
B.hs
import Control.Applicative import Control.Monad import Data.Function import Data.Array solve :: Array Int Int -> Int solve arr = if z > 1 then -1 else s where func (a, b) c | c == maxBound = (a, b+1) | otherwise = (a+c, b) (s, z) = foldl func (0, 0) $ map snd $ assocs arr main = do ...
null
https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/codeforces.com/17/B.hs
haskell
import Control.Applicative import Control.Monad import Data.Function import Data.Array solve :: Array Int Int -> Int solve arr = if z > 1 then -1 else s where func (a, b) c | c == maxBound = (a, b+1) | otherwise = (a+c, b) (s, z) = foldl func (0, 0) $ map snd $ assocs arr main = do ...
d06883e4f2438a108a6059493d711b464e66b454888beb8a6afe8a6094b04e30
jiesoul/soul-talk
utils.cljs
(ns soul-talk.utils (:require [cljs-time.format :as cf :refer [parse unparse formatter formatters]] [cljs-time.coerce :as tc] [reagent.core :as r])) (def custom-formatter-date-time (formatter "yyyy-MM-dd HH:mm:ss")) (def custom-formatter-date (formatter "yyyy-MM-dd")) (defn to-date-time (...
null
https://raw.githubusercontent.com/jiesoul/soul-talk/630de08c6549b206d59023764d5f2576d97d1030/home/src/soul_talk/utils.cljs
clojure
(ns soul-talk.utils (:require [cljs-time.format :as cf :refer [parse unparse formatter formatters]] [cljs-time.coerce :as tc] [reagent.core :as r])) (def custom-formatter-date-time (formatter "yyyy-MM-dd HH:mm:ss")) (def custom-formatter-date (formatter "yyyy-MM-dd")) (defn to-date-time (...
33bdbc29c48e332a538a6d5a1551a0f494c0aa842cfd6c5163cbadd292a56dd2
brendanhay/terrafomo
Settings06.hs
-- This module is auto-generated. # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # -- | Module : . AWS.Settings06 Copyright : ( c ) 2017 - 2018 License : Moz...
null
https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-aws/gen/Terrafomo/AWS/Settings06.hs
haskell
This module is auto-generated. | Stability : auto-generated * VpcPeeringConnectionAccepterAccepter * VpcPeeringConnectionFilter * VpcPeeringConnectionOptionsAccepter * VpcPeeringConnectionOptionsRequester * VpcsFilter * VpnConnectionRoutes * VpnConnectionVgwTelemetry * VpnGatewayFilter * WafByteMatchSetB...
# LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # Module : . AWS.Settings06 Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Mainta...
bfc574ba539cbdd1e5643303ed6afcdb3c7dcddc105ed2a521ed412541f123ff
qfpl/reflex-workshop
Main.hs
module Main where import qualified GHC.IO.Encoding as E import Control.Monad (when, forM_) import Data.List (isPrefixOf) import System.Environment import Data.Text (Text) import qualified Data.Text as Text import System.FilePath import System.Directory import Text.Pandoc import Text.Pandoc.Highlighting (pygments) ...
null
https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/content/processor/src/Main.hs
haskell
module Main where import qualified GHC.IO.Encoding as E import Control.Monad (when, forM_) import Data.List (isPrefixOf) import System.Environment import Data.Text (Text) import qualified Data.Text as Text import System.FilePath import System.Directory import Text.Pandoc import Text.Pandoc.Highlighting (pygments) ...
9a7bf89ab9b4688d408e7647e475f45c2147678a0c7e82b8e1ea60a7a284e196
ocaml-multicore/tezos
test_temp_big_maps.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2021 Nomadic Labs , < > (* ...
null
https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/test/test_temp_big_maps.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2021 Nomadic Labs , < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER IN A...
b54544b898579f07db462ac0649d6f1a89c7468614bbc6892fd419af26b3ea52
Bodigrim/arithmoi
Montgomery.hs
-- | Module : Math . . Primes . Factorisation . Montgomery Copyright : ( c ) 2011 Licence : MIT Maintainer : < > -- Factorisation of ' Integer 's by the elliptic curve algorithm after Montgomery . -- The algorithm is explained at -- <-elliptic-curve-factorization-part-1/> -- and -- <-ell...
null
https://raw.githubusercontent.com/Bodigrim/arithmoi/c72a1017450c2f1f05a959943dec265678b1cbc3/Math/NumberTheory/Primes/Factorisation/Montgomery.hs
haskell
| The algorithm is explained at <-elliptic-curve-factorization-part-1/> and <-elliptic-curve-factorization-part-2/> # LANGUAGE BangPatterns # # LANGUAGE DataKinds # # LANGUAGE KindSignatures # * Complete factorisation functions ** Functions with input checking -- * Partial factorisati...
Module : Math . . Primes . Factorisation . Montgomery Copyright : ( c ) 2011 Licence : MIT Maintainer : < > Factorisation of ' Integer 's by the elliptic curve algorithm after Montgomery . # LANGUAGE CPP # # LANGUAGE LambdaCase # # LANGUAGE MagicHash ...
ebf173442bfefa3a82d72fe8688ce0cd193565d7818fa34080a6813fc70b88c2
UnixJunkie/consent
scons.ml
(* memory hungry version of consent *) open Lbvs_consent let () = Consent.main ()
null
https://raw.githubusercontent.com/UnixJunkie/consent/f065ee7ba5a1ae014b5c3a28d0985ba5ad1abda5/src/scons.ml
ocaml
memory hungry version of consent
open Lbvs_consent let () = Consent.main ()
629cd02e55d6693d252fc3e0aadd59d5603cbb33dc9d4a63d15ab4734f81a74c
pveber/bistro
cisbp.mli
open Bistro val fetch_pwm_archive : [`cisbp] directory val fetch_tf_information : tsv file type annotated_motif = { id : string ; tf_name : string ; pwm : Biotk.Pwm.t ; rc_pwm : Biotk.Pwm.t ; threshold : float ; infos : Biotk.Cisbp.TF_information.item list ; } val annotated_motifs : annotated_motif list...
null
https://raw.githubusercontent.com/pveber/bistro/da0ebc969c8c5ca091905366875cbf8366622280/lib/bio/cisbp.mli
ocaml
open Bistro val fetch_pwm_archive : [`cisbp] directory val fetch_tf_information : tsv file type annotated_motif = { id : string ; tf_name : string ; pwm : Biotk.Pwm.t ; rc_pwm : Biotk.Pwm.t ; threshold : float ; infos : Biotk.Cisbp.TF_information.item list ; } val annotated_motifs : annotated_motif list...
c9adef9bd4dc3bbdacd4b528a84951d30f333a32c69de1ea4e657cbd5cb9c759
glguy/advent
23.hs
# Language BangPatterns , LambdaCase , OverloadedStrings # | Module : Main Description : Day 23 solution Copyright : ( c ) , 2021 License : ISC Maintainer : < > We 're given a program that computes conjecture in a purpose - built assembly language . Module : Main Descripti...
null
https://raw.githubusercontent.com/glguy/advent/7ab9f9e47208fd5720e36bac33fee2b78d4ec50b/solutions/src/2015/23.hs
haskell
| >>> :main ^ program ^ initial a register ^ initial b register ^ final b register * Program data type | A program instruction ^ increment the register ^ jump to a fixed offset ^ jump to a fixed offset when the register is even ^ jump to a fixed offset when the register is odd | A program register * Pa...
# Language BangPatterns , LambdaCase , OverloadedStrings # | Module : Main Description : Day 23 solution Copyright : ( c ) , 2021 License : ISC Maintainer : < > We 're given a program that computes conjecture in a purpose - built assembly language . Module : Main Descripti...
59905ab0c3721b66e3589aab608b3435281543e0166a99ef8eb5d7c816fe6c0f
lexi-lambda/eff
NonDet.hs
module Control.Effect.NonDet ( NonDet(..) , Alternative(..) , runNonDetAll ) where import Control.Applicative import Control.Effect.Base import Control.Effect.Internal (NonDet(..)) | Handles a ' NonDet ' effect , collecting the results of all branches of the computation . The results are collected _ _ str...
null
https://raw.githubusercontent.com/lexi-lambda/eff/8c4df4bf54faf22456354be18095b14825be5e85/eff/src/Control/Effect/NonDet.hs
haskell
effects are evaluated (even if using an 'Alternative' that ignores subsequent results, such as 'Maybe'). The result is also built using a __left-associated__ sequence of '<|>' calls, which allows the result to be constructed in constant space if an appropriate 'Alternative' instance is used, but can lead to very ...
module Control.Effect.NonDet ( NonDet(..) , Alternative(..) , runNonDetAll ) where import Control.Applicative import Control.Effect.Base import Control.Effect.Internal (NonDet(..)) | Handles a ' NonDet ' effect , collecting the results of all branches of the computation . The results are collected _ _ str...
2fd787f3d748bb898f5cddef0a894d63a18c368e37597aaa24e39e4e75a6af3d
art-w/unicorn
enable_ppx.ml
module Ppx_deriving_optic = Ppx_deriving_optic module Ppx_deriving_show = Ppx_deriving_show (* from -ppx/ppx_deriving/blob/master//src/ppx_deriving_main.cppo.ml *) module Ast_mapper = Ocaml_common.Ast_mapper module From_current = Ppxlib_ast.Selected_ast.Of_ocaml module To_current = Ppxlib_ast.Selected_ast.To_ocaml le...
null
https://raw.githubusercontent.com/art-w/unicorn/38bb1e758a2f8361a218e47897969cf9ce68b65e/playground/enable_ppx.ml
ocaml
from -ppx/ppx_deriving/blob/master//src/ppx_deriving_main.cppo.ml
module Ppx_deriving_optic = Ppx_deriving_optic module Ppx_deriving_show = Ppx_deriving_show module Ast_mapper = Ocaml_common.Ast_mapper module From_current = Ppxlib_ast.Selected_ast.Of_ocaml module To_current = Ppxlib_ast.Selected_ast.To_ocaml let mapper _argv = let module Current_ast = Ppxlib_ast.Selected_ast in ...
acac89772da2752df6721fc45e54bf7c904ea7ef4d28a97dc54ac36111d6ff80
Soyn/sicp
Ex2.2.rkt
#lang racket ex 2.2 ;define point (define (make-point x y) (cons x y)) (define (x-point p) (car p)) (define (y-point p) (cdr p)) (define (print-point p) (newline) (display "(") (display (x-point p)) (display",") (display(y-point p)) (display")")) ;define segment (define (make-segment start-point e...
null
https://raw.githubusercontent.com/Soyn/sicp/d2aa6e3b053f6d4c8150ab1b033a18f61fca7e1b/CH2/CH2.1/Ex2.2.rkt
racket
define point define segment test
#lang racket ex 2.2 (define (make-point x y) (cons x y)) (define (x-point p) (car p)) (define (y-point p) (cdr p)) (define (print-point p) (newline) (display "(") (display (x-point p)) (display",") (display(y-point p)) (display")")) (define (make-segment start-point end-point) (cons start-point ...
10b91c6bd63689057d168e39f41a69200d857babace185a4b3bb19b51e7a51c2
rowangithub/DOrder
cegar2.ml
let rec loop x m n = if (x < n) then if (Random.bool ()) then loop (x+1) x n else loop (x+1) m n else if (n > 0) then assert (0 <= m && m < n) else () let main n = let x = 0 in let m = 0 in loop x m n let _ = main 5 let _ = main (-5)
null
https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/mcmc/cegar2.ml
ocaml
let rec loop x m n = if (x < n) then if (Random.bool ()) then loop (x+1) x n else loop (x+1) m n else if (n > 0) then assert (0 <= m && m < n) else () let main n = let x = 0 in let m = 0 in loop x m n let _ = main 5 let _ = main (-5)
9c0e01eb01a9dc4f7f79d855955409d84f82f5953f02c7c1a4b965779e3979c2
cburgmer/buildviz
junit_xml.clj
(ns buildviz.data.junit-xml (:require [clojure.data.xml :as xml] [clojure.string :as str] [clojure.java.io :as io] [buildviz.util.math :as math])) ;; Parsing is following schema documented in / (defn- is-failure? [testcase-elem] (some #(= :failure (:tag %)) (:content te...
null
https://raw.githubusercontent.com/cburgmer/buildviz/c012003beb069730a1e667b60fa7df77b934e1c9/src/buildviz/data/junit_xml.clj
clojure
Parsing is following schema documented in / work around -team/junit5/issues/1381
(ns buildviz.data.junit-xml (:require [clojure.data.xml :as xml] [clojure.string :as str] [clojure.java.io :as io] [buildviz.util.math :as math])) (defn- is-failure? [testcase-elem] (some #(= :failure (:tag %)) (:content testcase-elem))) (defn- is-error? [testcase-elem...
d3df1307dc45f088ff472da1b2cd73ebb6a1d9ef8b0a74d1181da0d568d454d6
ocaml-gospel/gospel
dumpast.ml
(**************************************************************************) (* *) GOSPEL -- A Specification Language for OCaml (* *) Copyright ( ...
null
https://raw.githubusercontent.com/ocaml-gospel/gospel/299f4b351fe5c65474bdead7f388ec7cf55f8f23/bin/dumpast.ml
ocaml
************************************************************************ (as described in file LICE...
GOSPEL -- A Specification Language for OCaml Copyright ( c ) 2018- The VOCaL Project This software is free software , distributed under the MIT license open Gospel open Tmodule open Parser_frontend module W = Gospel.Warnings type config = { load...
e57be76410dc03447d5c6dc0f0397f9062c8bf7f680261319b390329bb5eaf59
tezos/tezos-mirror
disk_persistence.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2022 Nomadic Labs , < > (* ...
null
https://raw.githubusercontent.com/tezos/tezos-mirror/448daee0f4ae76893ae524536e428aa0e22f1d60/src/lib_injector/disk_persistence.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2022 Nomadic Labs , < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER IN A...
d3f947bbb5fb1678554901d01ad7e736b2703b4c6c068c28d87ea54e3c19eb2e
gentoo-haskell/haskell-updater
GHC.hs
# LANGUAGE CPP # | Module : Distribution . Gentoo . GHC Description : Find GHC - related breakages on Gentoo . Copyright : ( c ) 2009 License : or later This module defines helper functions to find broken packages in GHC , or else find packages installed with older ver...
null
https://raw.githubusercontent.com/gentoo-haskell/haskell-updater/113b0f0e9de3829c033320f2772cc5e03b07ae2f/Distribution/Gentoo/GHC.hs
haskell
Other imports ----------------------------------------------------------------------------- Common helper utils, etc. verbosity args cabal-1.18+: new working dir cabal-1.18+: new environment input text and binary mode is output in binary mode arguments. somewhere, probably /usr/bin. somewhere, probably /usr...
# LANGUAGE CPP # | Module : Distribution . Gentoo . GHC Description : Find GHC - related breakages on Gentoo . Copyright : ( c ) 2009 License : or later This module defines helper functions to find broken packages in GHC , or else find packages installed with older ver...
6bcb1093030cbe8ac5f07e32ef2be2716f9e01a2f4c45e9cf0a41e4c6538cf5f
stumpwm/stumpwm
bindings.lisp
Copyright ( C ) 2003 - 2008 ;; This file is part of stumpwm . ;; stumpwm is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 , or ( at your option ) ;; any later version. stumpwm is ...
null
https://raw.githubusercontent.com/stumpwm/stumpwm/906ce63a5feef62b1d44fccf7b78225d31c27a0e/bindings.lisp
lisp
you can redistribute it and/or modify either version 2 , or ( at your option ) any later version. but 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. along with this software; see the file COPY...
Copyright ( C ) 2003 - 2008 This file is part of stumpwm . it under the terms of the GNU General Public License as published by stumpwm is distributed in the hope that it will be useful , You should have received a copy of the GNU General Public License (in-package #:stumpwm) (export '(*groups-map* ...
92f9032efad903725e10bc9cf763a8106f95bdc6ea6fbacb480abf19044a1453
darrenldl/ProVerif-ATP
version.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cryptographic protocol verifier * * * ...
null
https://raw.githubusercontent.com/darrenldl/ProVerif-ATP/7af6cfb9e0550ecdb072c471e15b8f22b07408bd/proverif2.00/src/version.ml
ocaml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Cryptographic protocol verifier * * * ...
2b3225e2a0a5828ef6cd1355f1e4234d055578c5dee23f46e79daca273f6984e
haskell-opengl/GLUT
Colormap.hs
-------------------------------------------------------------------------------- -- | Module : Graphics . UI.GLUT.Colormap Copyright : ( c ) 2002 - 2018 -- License : BSD3 -- Maintainer : < > -- Stability : stable -- Portability : portable -- -- OpenGL supports both RGBA and color in...
null
https://raw.githubusercontent.com/haskell-opengl/GLUT/36207fa51e4c1ea1e5512aeaa373198a4a56cad0/src/Graphics/UI/GLUT/Colormap.hs
haskell
------------------------------------------------------------------------------ | License : BSD3 Stability : stable Portability : portable OpenGL supports both RGBA and color index rendering. The RGBA mode is generally preferable to color index because more OpenGL rendering capabilities are available a...
Module : Graphics . UI.GLUT.Colormap Copyright : ( c ) 2002 - 2018 Maintainer : < > The GLUT color index state variables are used to read and write entries in a window\ 's color index colormap . Every GLUT color index window has its own GLUT color index windows within a program can att...
8d9baaa231a625f92067c490b9f471a0a73a10782bb6e71c8233493519a2648c
dhammikamare/Learn-OCaml
newton.ml
Task : Write a higher order function that uses ’s method to numerically approximate the * ( real ) roots of a function . Given a function f and its derivative f ' , begin with an initial guess of . * Then successively refine the approximation using the formula * x(n+1 ) = xn - f(xn)/f'(xn ) * The proces...
null
https://raw.githubusercontent.com/dhammikamare/Learn-OCaml/2d4e3da38ee86cd7477964ffb8756a8483260322/lab08%20Higher%20Order%20Functions/newton.ml
ocaml
Task : Write a higher order function that uses ’s method to numerically approximate the * ( real ) roots of a function . Given a function f and its derivative f ' , begin with an initial guess of . * Then successively refine the approximation using the formula * x(n+1 ) = xn - f(xn)/f'(xn ) * The proces...
2654e7c70e5296581a83019c94792bc4e9ea77e63886a1075c9f4c1f23074d03
zero-one-group/geni
cookbook-01.clj
(ns geni.cookbook-01 (:require [clojure.java.io] [clojure.java.shell] [zero-one.geni.core :as g] [zero-one.geni.ml :as ml])) (load-file "docs/cookbook/cookbook-util.clj") ;; Part 1: Reading and Writing Datasets (def bikes-data-url "-cookbook/master/data/bikes.csv") (def bikes-data-path "data/cookbook/...
null
https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/docs/cookbook/cookbook-01.clj
clojure
Part 1: Reading and Writing Datasets 1.3 Describing Columns
(ns geni.cookbook-01 (:require [clojure.java.io] [clojure.java.shell] [zero-one.geni.core :as g] [zero-one.geni.ml :as ml])) (load-file "docs/cookbook/cookbook-util.clj") (def bikes-data-url "-cookbook/master/data/bikes.csv") (def bikes-data-path "data/cookbook/bikes.csv") (download-data! bikes-data-...
2aec1e1b0d87fc58a7efe554a691f901b5745a17d150221e291492f2dd3543e0
antono/guix-debian
ftp-client.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2010 , 2011 , 2012 , 2013 , 2014 < > ;;; ;;; This file is part of GNU Guix. ;;; 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 ; ...
null
https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/guix/ftp-client.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2010 , 2011 , 2012 , 2013 , 2014 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-module (guix ftp-client) #:use-module (srfi srfi-1) #:use-module (srfi srf...
3371ff20b80e7ec7302e13029b45b57c6b8df3913e189b32cac5e8fb1b572dfa
systemd/erlang-sd_notify
sd_notify.erl
%%%---------------------------------------------------------------------- This is the MIT license . %%% Copyright ( c ) 2014 < > %%% %%% Permission is hereby granted, free of charge, to any person %%% obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Sof...
null
https://raw.githubusercontent.com/systemd/erlang-sd_notify/44dae67291d51b9aa3147722e83a7e6cb089a7ca/src/sd_notify.erl
erlang
---------------------------------------------------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/o...
This is the MIT license . Copyright ( c ) 2014 < > files ( the " Software " ) , to deal in the Software without copies of the Software , and to permit persons to whom the included in all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , ...
bf7b69d60cf453c5debac2579ecc74aa0f4730ac53c1b865673d84ab2df8e005
spechub/Hets
Comorphism.hs
| Module : ./DFOL / Comorphism.hs Description : Helper functions for the DFOL - > CASL translation Copyright : ( c ) , DFKI Bremen 2009 License : GPLv2 or higher , see LICENSE.txt Maintainer : Stability : experimental Portability : portable Module : ./DFOL/Co...
null
https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/DFOL/Comorphism.hs
haskell
shorthand notation the unique sort the special bot symbol signature map generating axioms for a translated signature generating axioms for translated predicate symbols generating axioms for translated function symbols generating axioms for translated sort symbols make argument names make a variable make an a...
| Module : ./DFOL / Comorphism.hs Description : Helper functions for the DFOL - > CASL translation Copyright : ( c ) , DFKI Bremen 2009 License : GPLv2 or higher , see LICENSE.txt Maintainer : Stability : experimental Portability : portable Module : ./DFOL/Co...
60774add3961bfd93b0b2b5de4172a8ac6923c7fc7ed8fd37e53ac10c3722651
PEZ/rich4clojure
problem_055.clj
(ns rich4clojure.medium.problem-055 (:require [hyperfiddle.rcf :refer [tests]])) ;; = Count Occurrences = By 4Clojure user : ;; Difficulty: Medium Tags : [ seqs core - functions ] ;; ;; Write a function which returns a map containing the ;; number of occurrences of each distinct item in a ;; sequence. (def re...
null
https://raw.githubusercontent.com/PEZ/rich4clojure/28ea575ede8677f3a97437a646cdb3376a28ebc9/src/rich4clojure/medium/problem_055.clj
clojure
= Count Occurrences = Difficulty: Medium Write a function which returns a map containing the number of occurrences of each distinct item in a sequence. Share your solution, and/or check how others did it:
(ns rich4clojure.medium.problem-055 (:require [hyperfiddle.rcf :refer [tests]])) By 4Clojure user : Tags : [ seqs core - functions ] (def restricted [frequencies]) (def __ :tests-will-fail) (comment ) (tests (__ [1 1 2 3 2 1 1]) := {1 4, 2 2, 3 1} (__ [:b :a :b :a :b]) := {:a 2, :b 3} (__ '([1 2]...
48614dc5318eda679cf575ef76033e8df42bcaf9bc4d30b39b2a34460d532eed
kowainik/extensions
Types.hs
# OPTIONS_GHC -fno - warn - orphans # {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} | Copyright : ( c ) 2020 - 2022 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > Data types and functions to work with different types of ' Extension 's . @extensions@ library supports ...
null
https://raw.githubusercontent.com/kowainik/extensions/188b1b6f751e80b9de9ce9a48cc36d7ef0e5f64a/src/Extensions/Types.hs
haskell
# LANGUAGE CPP # # LANGUAGE DeriveAnyClass # -----------------------------------------+----------------------------+ -----------------------------------------+----------------------------+ -----------------------------------------+----------------------------+ -----------------------------------------+---...
# OPTIONS_GHC -fno - warn - orphans # | Copyright : ( c ) 2020 - 2022 Kowainik SPDX - License - Identifier : MPL-2.0 Maintainer : < > Data types and functions to work with different types of ' Extension 's . @extensions@ library supports the following types of extensions : | @Haskell2010@ Default ...
e4415c6f617dfa09a0ffa10f0dc96c55d9452a9ae324d432c62e91da3b30fc57
circleci/analytics-clj
core.clj
(ns circleci.analytics-clj.core (:refer-clojure :exclude [alias flush]) (:require [circleci.analytics-clj.common :as common] [circleci.analytics-clj.external :refer :all] [circleci.analytics-clj.utils :refer [string-keys]]) (:import (com.segment.analytics Analytics) (com.segment...
null
https://raw.githubusercontent.com/circleci/analytics-clj/0172a88af4324e754ea323fcc10c4ef4f9bd3287/src/circleci/analytics_clj/core.clj
clojure
(ns circleci.analytics-clj.core (:refer-clojure :exclude [alias flush]) (:require [circleci.analytics-clj.common :as common] [circleci.analytics-clj.external :refer :all] [circleci.analytics-clj.utils :refer [string-keys]]) (:import (com.segment.analytics Analytics) (com.segment...
dfd406d439afbb37189dc8ef2e1440889dfcd259ef4444c3299048458a94e37a
as-capabl/clay-dhall
Export.hs
# LANGUAGE RecordWildCards # {-# LANGUAGE RankNTypes #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE LambdaCase # module Clay.Export where import Control.Monad (join) import Control.Monad.State import Control.Monad.Identity import Control.Monad.IO.Class import Data.Either.Validatio...
null
https://raw.githubusercontent.com/as-capabl/clay-dhall/5569da0214dcabca9c29087d3cbc18d17515dcef/src/Clay/Export.hs
haskell
# LANGUAGE RankNTypes # # LANGUAGE BangPatterns # # LANGUAGE OverloadedStrings # Exported functions TODO: set last error Settings Arguments Result type callback routine Context
# LANGUAGE RecordWildCards # # LANGUAGE LambdaCase # module Clay.Export where import Control.Monad (join) import Control.Monad.State import Control.Monad.Identity import Control.Monad.IO.Class import Data.Either.Validation import Data.Void import Foreign.C.Types (CChar) import Foreign.C.String import Foreign.Ptr...
dcbc4b5c6fff987c3f0c040028be5904b44817db2e02eedf26d6bf0e6f85ad18
adventuring/tootsville.net
maria.lisp
;;;; -*- lisp -*- ;;; src / db / maria.lisp is part of ;;; Copyright © 2008 - 2017 Bruce - Robert Pocock ; © 2018 - 2021 The Corporation for Inter - World Tourism and Adventuring ( ciwta.org ) . ;;; This program is Free Software : you can redistribute it and/or modify it under the...
null
https://raw.githubusercontent.com/adventuring/tootsville.net/985c11a91dd1a21b77d7378362d86cf1c031b22c/src/db/maria.lisp
lisp
-*- lisp -*- © 2018 - 2021 The either version 3 of 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 Affero General Public License for more det...
src / db / maria.lisp is part of Corporation for Inter - World Tourism and Adventuring ( ciwta.org ) . This program is Free Software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License the License , or ( at your option ) any later version . You ...
d4de97f71cf4c4a3d2875c4e8c7f872113d9a6e3f1ddac89829b3c16ad82c1f4
MLstate/opalang
qmlAstUtils.mli
Copyright © 2011 , 2012 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 us...
null
https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/libqmlcompil/qmlAstUtils.mli
ocaml
in Lang.Ast oups, I need an utils on B instead of * substitute old_expr new_expr global_expr =>replace in global_expr every occurrence of old_expr (based on the annotation number) with new_expr * collect sub_expr global_expr =>collect all occurrence of sub_expr (based on the annotation number) * ...
Copyright © 2011 , 2012 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 us...
c8dec98e0295177c4cb8f251ed5b59ae3d8f11b0e9d26cd9a7c0c4ad60e90bf4
jellelicht/guix
guix.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2013 , 2014 , 2015 , 2016 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either ...
null
https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/build-aux/hydra/guix.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2013 , 2014 , 2015 , 2016 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . This file defines build jobs of Guix itself for the Hydra continuation Attempt to use ou...
f2da536cdad0cba9d2904b707dffc42bf8165b5ca28e8b7e4ca20adbda2a5c2e
kingcons/cl-6502
packages.lisp
(defpackage :6502 (:use :cl) (:import-from :alexandria #:compose #:emptyp #:flatten #:make-keyword #:named-lambda) (:export ;; Public API #:execute #:step-cpu #:asm #:disasm #:disasm-to-str #:disasm-to-list #:current-instruction #:get-byte #:get-word #:get-range #:*cpu* #:cpu #:nm...
null
https://raw.githubusercontent.com/kingcons/cl-6502/0fbce82c55a63df0ceaf17d6e3d952219514a949/src/packages.lisp
lisp
Public API CPU struct Helpers
(defpackage :6502 (:use :cl) (:import-from :alexandria #:compose #:emptyp #:flatten #:make-keyword #:named-lambda) #:execute #:step-cpu #:asm #:disasm #:disasm-to-str #:disasm-to-list #:current-instruction #:get-byte #:get-word #:get-range #:*cpu* #:cpu #:nmi #:reset #:jit-step #:*o...
83a440c05fc8923d3e2d43c6403908649df7e0e5099e8b8698d3bc144332f3b7
yallop/ocaml-reex
leex.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. *) type 'f rhs = Skip | Error of...
null
https://raw.githubusercontent.com/yallop/ocaml-reex/1fc261e640af421bb606ddb6e2b022fe1053a484/lib/leex.ml
ocaml
* 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. *) type 'f rhs = Skip | Error of...
2b2d94313a5e727a3dc6cc0b0adf26fa4e956f940c82dd736d11457fc5ce83dd
pfdietz/ansi-test
intern.lsp
;-*- Mode: Lisp -*- Author : Created : Sat Apr 25 07:59:10 1998 ;;;; Contains: Tests of INTERN (declaim (optimize (safety 3))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; intern (deftest intern.1 (progn (safely-delete-package "TEMP1") (let ((p (make-package "TEMP1" :use nil)) (i ...
null
https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/packages/intern.lsp
lisp
-*- Mode: Lisp -*- Contains: Tests of INTERN intern String is a specialized sequence type Error tests
Author : Created : Sat Apr 25 07:59:10 1998 (declaim (optimize (safety 3))) (deftest intern.1 (progn (safely-delete-package "TEMP1") (let ((p (make-package "TEMP1" :use nil)) (i 0) x y) (multiple-value-bind* (sym1 status1) (find-symbol "FOO" p) (intern (progn (...
56c116064775b587a8a28ca89a7c22869993a119864683911450b138a7372e11
SquidDev/urn
match.lisp
"A pattern matching library. Utilities for manipulating deeply-nested data and lists in general, as well as binding multiple values. ## Literal patterns A literal pattern matches only if the scrutinee (what's being matched) compares [[eql?]] to the literal. One can use any Urn atom here: strings, numbers, keys ...
null
https://raw.githubusercontent.com/SquidDev/urn/6e6717cf1376b0950e569e3771cb7e287aed291d/lib/core/match.lisp
lisp
Matching against a fixed list Using cons patterns, and capturing inside nested patterns Declare a helper method for matching strings.
"A pattern matching library. Utilities for manipulating deeply-nested data and lists in general, as well as binding multiple values. ## Literal patterns A literal pattern matches only if the scrutinee (what's being matched) compares [[eql?]] to the literal. One can use any Urn atom here: strings, numbers, keys ...
520f4f84b9e43584031357a8abbd1b09d74f45fa9c126304f9239087e1dcfd75
fukamachi/clozure-cl
sort.lisp
-*-Mode : LISP ; Package : CCL -*- ;;; Copyright ( C ) 2009 Clozure Associates Copyright ( C ) 1994 - 2001 Digitool , Inc This file is part of Clozure CL . ;;; Clozure CL is licensed under the terms of the Lisp Lesser GNU Public License , known as the LLGPL and distributed with Clozure CL as the ;...
null
https://raw.githubusercontent.com/fukamachi/clozure-cl/4b0c69452386ae57b08984ed815d9b50b4bcc8a2/lib/sort.lisp
lisp
Package : CCL -*- file "LICENSE". The LLGPL consists of a preamble and the LGPL, conflict, the preamble takes precedence. Clozure CL is referenced in the preamble as the "LIBRARY." The LLGPL is also available online at Sort sorts a sequence destructively using a predicate which must be a seq...
Copyright ( C ) 2009 Clozure Associates Copyright ( C ) 1994 - 2001 Digitool , Inc This file is part of Clozure CL . Clozure CL is licensed under the terms of the Lisp Lesser GNU Public License , known as the LLGPL and distributed with Clozure CL as the which is distributed with Clozure CL as ...
ff70841260fad14d47de94d30ea1e9483ec429ce54de9f36ff35ab378cf6478c
haroldcarr/learn-haskell-coq-ml-etc
TestDay03.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module TestDay03 where import Control.Category ((>>>)) import Control.Lens import Control.Lens.Regex.Text import qualified Data.Map as Map import Data.Map....
null
https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/lens/2019-12-chris-penner-advent-of-optics/test/TestDay03.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE QuasiQuotes # -of-optics-03 regex to find each "instruction", then grab the full match as Text converts the String into an Int with read converts the cardinal direction into vector equivalent of that direction make replicate into the function: replicate :: (Int, V2...
# LANGUAGE NoImplicitPrelude # module TestDay03 where import Control.Category ((>>>)) import Control.Lens import Control.Lens.Regex.Text import qualified Data.Map as Map import Data.Map.Lens (toMapOf) import qualified Data.Set as S...
fdba7c81ada912daa2a403e403b2a15fe0108bed318d0294e4c00069449d8881
jml/servant-template
Internal.hs
-- | Definition of HTML content type. module {{ cookiecutter.module_name }}.API.Internal ( HTML ) where import Network.HTTP.Media ((//), (/:)) import Servant.API (Accept(..)) -- | HTML content type. data HTML instance Accept HTML where contentType _ = "text" // "html" /: ("charset", "utf-8")
null
https://raw.githubusercontent.com/jml/servant-template/d2a44b6466ad8091da8aad39027dbb995e02b3d2/%7B%7B%20cookiecutter.project_name%20%7D%7D/%7B%7B%20cookiecutter.project_name%20%7D%7D-api/src/%7B%7B%20cookiecutter.module_name%20%7D%7D/API/Internal.hs
haskell
| Definition of HTML content type. | HTML content type.
module {{ cookiecutter.module_name }}.API.Internal ( HTML ) where import Network.HTTP.Media ((//), (/:)) import Servant.API (Accept(..)) data HTML instance Accept HTML where contentType _ = "text" // "html" /: ("charset", "utf-8")
66db1cb4c03c75575d633d023834f3d72141baa351f7b65d060f6c2204cbcfed
pbl64k/gpif-datakinds
EvenOdd.hs
{-# LANGUAGE GADTs #-} # LANGUAGE DataKinds # # LANGUAGE PolyKinds # {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # # LANGUAGE TypeOperators # | Module : Control . IxFunctor . EvenOdd Description : E...
null
https://raw.githubusercontent.com/pbl64k/gpif-datakinds/1ae07ec5274f258c6bdf6633bd88532f6c3c1e04/src/Control/IxFunctor/EvenOdd.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # and `Odd` above.
# LANGUAGE DataKinds # # LANGUAGE PolyKinds # # LANGUAGE ScopedTypeVariables # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # # LANGUAGE TypeOperators # | Module : Control . IxFunctor . EvenOdd Description : Even - odd lists Copyright : , 2015 License...
ba27d392828324618b00e7e8938e69884cbb47852db67df2e74b4160c4fe0951
Frechmatz/cl-synthesizer
run-tests.lisp
(load "init-ql") (asdf:load-system "cl-synthesizer/test" :force t) (in-package :cl-synthesizer-test) (format t "~%Running tests...~%") (setf lisp-unit:*print-failures* t) ;;(use-debugger) (run-tests)
null
https://raw.githubusercontent.com/Frechmatz/cl-synthesizer/ba2e4003448829078187013f6723eb5c8ce8adbc/script/run-tests.lisp
lisp
(use-debugger)
(load "init-ql") (asdf:load-system "cl-synthesizer/test" :force t) (in-package :cl-synthesizer-test) (format t "~%Running tests...~%") (setf lisp-unit:*print-failures* t) (run-tests)
0d3c7bb316798a099ba598f42eb0b6a26f9a916c97c3d12fc2c45a7ee9398665
kawu/nerf
NELexicon.hs
| Handling the NELexicon dictionary . module NLP.Nerf.Dict.NELexicon ( parseNELexicon , readNELexicon ) where import qualified Data.Text.Lazy as L import qualified Data.Text.Lazy.IO as L import NLP.Nerf.Dict.Base | Parse the NELexicon into a list of entries . parseNELexicon :: L.Text -> [Entry] parseNELexicon =...
null
https://raw.githubusercontent.com/kawu/nerf/29ad341368d0869a15c205bda40247d9db2fdea8/src/NLP/Nerf/Dict/NELexicon.hs
haskell
| Read the dictionary from the file.
| Handling the NELexicon dictionary . module NLP.Nerf.Dict.NELexicon ( parseNELexicon , readNELexicon ) where import qualified Data.Text.Lazy as L import qualified Data.Text.Lazy.IO as L import NLP.Nerf.Dict.Base | Parse the NELexicon into a list of entries . parseNELexicon :: L.Text -> [Entry] parseNELexicon =...
a533a16ed2e132e1cf575b55b9a5613b5b9d196ae62b1baf69df24b6cc69a5f1
fp-works/2019-winter-Haskell-school
Exercise03Spec.hs
module CIS194.Homework01.Exercise03Spec where import CIS194.Homework01.Exercise03 import Test.Tasty.Hspec spec_sumDigits :: Spec spec_sumDigits = do it "returns 0 for an empty string" $ sumDigits [] `shouldBe` 0 it "returns the element value for a single element list" $ sumDigits [1] `shouldBe` 1 it...
null
https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week1/daniel-deng/test/CIS194/Homework01/Exercise03Spec.hs
haskell
module CIS194.Homework01.Exercise03Spec where import CIS194.Homework01.Exercise03 import Test.Tasty.Hspec spec_sumDigits :: Spec spec_sumDigits = do it "returns 0 for an empty string" $ sumDigits [] `shouldBe` 0 it "returns the element value for a single element list" $ sumDigits [1] `shouldBe` 1 it...
77c96a798d980c91e6e0b3e9e648b89838f136c253562436b9f394d06d7d7f01
TheRiver/L-MATH
package.lisp
;;; L-MATH: a library for simple linear algebra. Copyright ( C ) 2009 - 2011 Copyright ( C ) 2012 L - MATH ( See AUTHORS file ) ;;; ;;; 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 Foundation , eithe...
null
https://raw.githubusercontent.com/TheRiver/L-MATH/81f43d21ea0bc75f949fbdfb3701afbab4183d38/package.lisp
lisp
L-MATH: a library for simple linear algebra. 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 PA...
Copyright ( C ) 2009 - 2011 Copyright ( C ) 2012 L - MATH ( See AUTHORS file ) 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 copy of the GNU General Public License Additional permission un...
36b9b685c8eca0dd2bd1b81715dbaeb97ac0df65673690979e7ea13cbf10835f
ostinelli/misultin
misultin_acceptors_sup.erl
% ========================================================================================================== MISULTIN - Acceptors Supervisor % % >-|-|-(°> % Copyright ( C ) 2011 , < > , . % All rights reserved. % Code portions from have been originally taken under BSD license from Trapexit at the address ...
null
https://raw.githubusercontent.com/ostinelli/misultin/b9fe3125cf17f4415a6d7fc60642b670f5e18eb8/src/misultin_acceptors_sup.erl
erlang
========================================================================================================== >-|-|-(°> All rights reserved. <> BSD License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redis...
MISULTIN - Acceptors Supervisor Copyright ( C ) 2011 , < > , . Code portions from have been originally taken under BSD license from Trapexit at the address : THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS OR PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT...
3f279d94243015da71202047e0c946d2ede8c9724156433ef3aea463c4317648
metaocaml/ber-metaocaml
t253-offsetclosure2.ml
TEST include tool - ocaml - lib flags = " -w a " ocaml_script_as_argument = " true " * setup - ocaml - build - env * * include tool-ocaml-lib flags = "-w a" ocaml_script_as_argument = "true" * setup-ocaml-build-env ** ocaml *) open Lib;; let rec f _ = g and g _ = 10 in if f 3 4 <> 10 then raise Not_f...
null
https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t253-offsetclosure2.ml
ocaml
TEST include tool - ocaml - lib flags = " -w a " ocaml_script_as_argument = " true " * setup - ocaml - build - env * * include tool-ocaml-lib flags = "-w a" ocaml_script_as_argument = "true" * setup-ocaml-build-env ** ocaml *) open Lib;; let rec f _ = g and g _ = 10 in if f 3 4 <> 10 then raise Not_f...
cd87ededb2f027f0fd331bd7249eb87d24613a9abb15e4e38d1cc781ff0ca7b5
shayne-fletcher/zen
ml_longident.ml
type t = | Lident of string | Ldot of t * string | Lapply of t * t let flatten lid = let rec flat acc = function | Lident s -> s :: acc | Ldot (lid, s) -> flat (s :: acc) lid | Lapply (_, _) -> Ml_misc.fatal_error "Ml_longident.flat" in flat [] lid let last = function | Lident s -> s | Ldot (_,...
null
https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/cos/src/parsing/ml_longident.ml
ocaml
type t = | Lident of string | Ldot of t * string | Lapply of t * t let flatten lid = let rec flat acc = function | Lident s -> s :: acc | Ldot (lid, s) -> flat (s :: acc) lid | Lapply (_, _) -> Ml_misc.fatal_error "Ml_longident.flat" in flat [] lid let last = function | Lident s -> s | Ldot (_,...
6b36f9e62ddceee17046f24f94a0f928c111755bdf99e964fe8dabd38f35ac58
ocaml-sf/learn-ocaml-corpus
forget_x.ml
(* Beautiful inefficient definition: *) let rec inorder t = match t with | Leaf -> [] | Node (u, x, v) -> inorder u @ inorder v let rec preorder t = match t with | Leaf -> [] | Node (u, x, v) -> [x] @ preorder u @ preorder v
null
https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/stereo/wrong/forget_x.ml
ocaml
Beautiful inefficient definition:
let rec inorder t = match t with | Leaf -> [] | Node (u, x, v) -> inorder u @ inorder v let rec preorder t = match t with | Leaf -> [] | Node (u, x, v) -> [x] @ preorder u @ preorder v
7754f385c7f35d959d608222e6a3995702c8473f04500f0c1158f2d7e28e0266
Halfwake/web-adventure
test1.rkt
#lang racket/base (require "adventure.rkt") (define-deaths "Dungeons and Dodecahedrons" start-journey run-away "You have shamfeully failed. Care to try again?" eaten-by-grue "You have been eaten by a glutounous grue. Care to try again?" skeletons-flank "The skeletons surround you and tear your limbs off. Care t...
null
https://raw.githubusercontent.com/Halfwake/web-adventure/3008064cdbec144743a88426499f1cbbf3c0a624/test1.rkt
racket
#lang racket/base (require "adventure.rkt") (define-deaths "Dungeons and Dodecahedrons" start-journey run-away "You have shamfeully failed. Care to try again?" eaten-by-grue "You have been eaten by a glutounous grue. Care to try again?" skeletons-flank "The skeletons surround you and tear your limbs off. Care t...
416430c7751b708c8c86b9bfe497769e0fbde87c00d2a36197d65fec07104b0a
zsc/qubit-fpga
Deutsch.hs
module Deutsch where import CLaSH.Prelude import CLaSH.Sized.Fixed import qualified Data.List as L type RR = SFixed 1 10 --- Complex number utilities --- type CC = Vec 2 RR c0 = 0 :> 0 :> Nil c1 = 1 :> 0 :> Nil ci = 0 :> 1 :> Nil sqr_norm :: CC -> RR sqr_norm (a :> b :> Nil) = a * a + b * b cadd :: CC -> CC -> C...
null
https://raw.githubusercontent.com/zsc/qubit-fpga/d210264dd4afcae4a15fca9e36f0f6d0d0bdb384/Deutsch.hs
haskell
- Complex number utilities --- - Qubit utilities --- | amplitudes for |0> and |1>
module Deutsch where import CLaSH.Prelude import CLaSH.Sized.Fixed import qualified Data.List as L type RR = SFixed 1 10 type CC = Vec 2 RR c0 = 0 :> 0 :> Nil c1 = 1 :> 0 :> Nil ci = 0 :> 1 :> Nil sqr_norm :: CC -> RR sqr_norm (a :> b :> Nil) = a * a + b * b cadd :: CC -> CC -> CC cadd = zipWith (+) cneg :: CC ...
5b966ac7ebfead98b83bf6960853d8ffa97a039ffa7b8ade6476d94bb47df3c0
sdiehl/picologic
PrettyPrintTest.hs
import Picologic main :: IO () main = print $ ppExprLisp d where a = Disj (Var (Ident "some-var")) (Disj (Var (Ident "another-var")) (Iff (Var (Ident "ggg")) (Neg (Iff (Neg (Var (Ident "var-x"))) (Var (Ident "...
null
https://raw.githubusercontent.com/sdiehl/picologic/5ecd27fd80fea1ef5889f3ef46ea8a7fd917531a/tests/PrettyPrintTest.hs
haskell
import Picologic main :: IO () main = print $ ppExprLisp d where a = Disj (Var (Ident "some-var")) (Disj (Var (Ident "another-var")) (Iff (Var (Ident "ggg")) (Neg (Iff (Neg (Var (Ident "var-x"))) (Var (Ident "...
40452cf2bb3954fc6378739413a70cf1f6e22621f0940f4dd8dc106c63be1fec
mbutterick/aoc-racket
day23.rkt
#lang scribble/lp2 @(require scribble/manual aoc-racket/helper) @aoc-title[23] @defmodule[aoc-racket/day23] @link[""]{The puzzle}. Our @link-rp["day23-input.txt"]{input} is a list of instructions representing a program for a two-register virtual machine. @chunk[<day23> <day23-setup> <day23-q1> ...
null
https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/day23.rkt
racket
#lang scribble/lp2 @(require scribble/manual aoc-racket/helper) @aoc-title[23] @defmodule[aoc-racket/day23] @link[""]{The puzzle}. Our @link-rp["day23-input.txt"]{input} is a list of instructions representing a program for a two-register virtual machine. @chunk[<day23> <day23-setup> <day23-q1> ...
4a5cd207a50b40744e87bf87c0a01ff3c68d65768c700bad6cba46e63f253694
jsarracino/spyder
Bench.hs
module Language.Spyder.Bench ( boogSize , spySize , invSize ) where import Language.Spyder.AST.Spec import Language.Spyder.AST import qualified Language.Boogie.AST as BST import Language.Spyder.AST.Component import qualified Language.Spyder.AST.Imp as Imp -- don't use this; instead, diff at command line boog...
null
https://raw.githubusercontent.com/jsarracino/spyder/a2f6d08eb2a3907d31a89ae3d942b50aaba96a88/Language/Spyder/Bench.hs
haskell
don't use this; instead, diff at command line count of ast nodes for invariant
module Language.Spyder.Bench ( boogSize , spySize , invSize ) where import Language.Spyder.AST.Spec import Language.Spyder.AST import qualified Language.Boogie.AST as BST import Language.Spyder.AST.Component import qualified Language.Spyder.AST.Imp as Imp boogSize :: BST.Program -> Int boogSize = error "don'...
1eb38bc9d33b3ac189347e16a5dc38824d85cf5616fc1894576118c6e6650385
LdBeth/CLFSWM
load.lisp
;;; -------------------------------------------------------------------------- ;;; CLFSWM - FullScreen Window Manager ;;; ;;; -------------------------------------------------------------------------- ;;; Documentation: System loading functions ;;; -----------------------------------------------------------------------...
null
https://raw.githubusercontent.com/LdBeth/CLFSWM/4e936552d1388718d2947a5f6ca3eada19643e75/load.lisp
lisp
-------------------------------------------------------------------------- CLFSWM - FullScreen Window Manager -------------------------------------------------------------------------- Documentation: System loading functions -------------------------------------------------------------------------- This progra...
( C ) 2005 - 2015 < > it under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA . If you want , it can download ASDF and CLX for you . You 'll need w...
412c39a0bdb87c68f3eea89146e84c11a28a34218a06cf81e7afd288c6697319
unnohideyuki/bunny
sample312.hs
main = do print $ [LT ..] print $ [GT, EQ ..]
null
https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/test/samples/sample312.hs
haskell
main = do print $ [LT ..] print $ [GT, EQ ..]
879228da6d8017c8e9ac489a973eac1aa1cee65810593fd02c6606baeaf1caf4
karlhof26/gimp-scheme
egger-AddFilmGrain_02b.scm
; Add film grain , 2.10.32 ; ( ) ( C ) 2012 , Bern , Switzerland ( C ) 2022 , - tweet me @karlhof26 ; ; You can find more about adding realistic film grain to BW images at ; This script was tested with ; ; New versions will be distributed from / only ; ; This program is free sof...
null
https://raw.githubusercontent.com/karlhof26/gimp-scheme/10bcc1e9cc9b15db273d51c4d0cdfec74a1484c8/egger-AddFilmGrain_02b.scm
scheme
You can find more about adding realistic film grain to BW images at New versions will be distributed from / only This program is free software; you can redistribute it and/or modify either version 3 of the License , or (at your option) any later version. This program is distributed in the ho...
Add film grain , 2.10.32 ( ) ( C ) 2012 , Bern , Switzerland ( C ) 2022 , - tweet me @karlhof26 This script was tested with it under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License (define (script-fu-Eg...
ef6c9a6358199d24848da26da785c2c9a9b3c80b377b3c862f12eead0f744d74
magnars/optimus-img-transform
project.clj
(defproject optimus-img-transform "0.3.1" :description "An Optimus image transformation middleware." :url "-img-transform" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[fivetonine/collage "0.2.0"] [optimus "0.14.1"]] :jvm-opts ["-Djava.awt.headless=tru...
null
https://raw.githubusercontent.com/magnars/optimus-img-transform/fa80f0cc157962b6193cab0d9b7395184e63688b/project.clj
clojure
(defproject optimus-img-transform "0.3.1" :description "An Optimus image transformation middleware." :url "-img-transform" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[fivetonine/collage "0.2.0"] [optimus "0.14.1"]] :jvm-opts ["-Djava.awt.headless=tru...
fbf57509f30e757b1e7a9d2f9f692094e376f1e89c8b1e8faa8ff75591f4dd69
metabase/metabase
misc.clj
(ns metabuild-common.misc (:require [clojure.string :as str])) (defmacro varargs "Utility macro for passing varargs of a certain `klass` to a Java method. (Files/createTempFile \"driver\" \".jar\" (varargs FileAttribute))" {:arglists '([klass] [klass xs])} [klass & [objects]] (vary-meta `(into-array ...
null
https://raw.githubusercontent.com/metabase/metabase/5e9b52a32dfeab754d218c758d08fffbacb7c0e7/bin/build/src/metabuild_common/misc.clj
clojure
(ns metabuild-common.misc (:require [clojure.string :as str])) (defmacro varargs "Utility macro for passing varargs of a certain `klass` to a Java method. (Files/createTempFile \"driver\" \".jar\" (varargs FileAttribute))" {:arglists '([klass] [klass xs])} [klass & [objects]] (vary-meta `(into-array ...
4ec8f421bb9219792bbcc472b2f062283bc2866770b277f057efcc659350365e
aligusnet/mltool
MachineLearning.hs
| Module : MachineLearning Description : Machine Learning Copyright : ( c ) , 2016 License : BSD-3 Stability : experimental Portability : POSIX Module: MachineLearning Description: Machine Learning Copyright: (c) Alexander Ignatyev, 2016 License: BSD-3 Stability: experimental Portability: POSIX -} m...
null
https://raw.githubusercontent.com/aligusnet/mltool/92d74c4cc79221bfdcfb76aa058a2e8992ecfe2b/src/MachineLearning.hs
haskell
| Add biad dimension to the future matrix | Remove biad dimension | Caclulates mean and stddev values of every feature. Takes feature matrix X, returns pair of vectors of means and stddevs. | Maps the features into all polynomial terms of X up to the degree-th power | Splits data matrix to features matrix X and v...
| Module : MachineLearning Description : Machine Learning Copyright : ( c ) , 2016 License : BSD-3 Stability : experimental Portability : POSIX Module: MachineLearning Description: Machine Learning Copyright: (c) Alexander Ignatyev, 2016 License: BSD-3 Stability: experimental Portability: POSIX -} m...
2ed9ca81aa5fe5e81bb3a395e75d176dd691e8ee959adb461ed7a78bee230363
graninas/The-Amoeba-World
Runtime.hs
module Amoeba.GameLogic.Runtime where import Amoeba.GameLogic.Data.Facade as GL import Control.Concurrent as C -- N.B.: experimental mechanism. -- TODO: use lens data RunState = Initializing | Running [C.ThreadId] | Finishing [C.ThreadId] | Finished deriving (Show, Eq) ...
null
https://raw.githubusercontent.com/graninas/The-Amoeba-World/a147cd4dabf860bec8a6ae1c45c02b030916ddf4/src/Amoeba/GameLogic/Runtime.hs
haskell
N.B.: experimental mechanism. TODO: use lens TODO: maybe, do it with Either/Maybe?
module Amoeba.GameLogic.Runtime where import Amoeba.GameLogic.Data.Facade as GL import Control.Concurrent as C data RunState = Initializing | Running [C.ThreadId] | Finishing [C.ThreadId] | Finished deriving (Show, Eq) data GameRuntime = GameRuntime { grtRunState :: Ru...
7c8c98618e2b5dce76eead6a95b05c7f27fddd4b08c30e852f1e50e9c851f04a
nubank/vessel
containerizer.clj
(ns vessel.jib.containerizer "Containerization API built on top of Google Jib." (:require [vessel.jib.credentials :as credentials] [vessel.jib.helpers :as jib.helpers] [vessel.misc :as misc]) (:import [com.google.cloud.tools.jib.api Containerizer FilePermissions ImageFormat ImageReference ...
null
https://raw.githubusercontent.com/nubank/vessel/40036928d20cfd07b31b99bb2389d5421c49d26d/src/vessel/jib/containerizer.clj
clojure
(ns vessel.jib.containerizer "Containerization API built on top of Google Jib." (:require [vessel.jib.credentials :as credentials] [vessel.jib.helpers :as jib.helpers] [vessel.misc :as misc]) (:import [com.google.cloud.tools.jib.api Containerizer FilePermissions ImageFormat ImageReference ...
04550d5a8df5b7cebf9ef61bfb120647885c5624329afdf92e0fa1ea4442afb7
parof/wstat
ReductionIntervalCongruenceDomain.hs
# LANGUAGE MultiParamTypeClasses # module Domains.ReductionIntervalCongruenceDomain where -- import Domains.CongruenceDomain import Domains.IntervalDomain import Interfaces.ReducedProductDomain import Tools.Utilities import SyntacticStructure.WhileGrammar import Interfaces.AbstractStateDomain instance ReducedProduc...
null
https://raw.githubusercontent.com/parof/wstat/369cf5d1d92ef235049c29ad2f1cc6fd53747754/src/Domains/ReductionIntervalCongruenceDomain.hs
haskell
# LANGUAGE MultiParamTypeClasses # module Domains.ReductionIntervalCongruenceDomain where import Domains.CongruenceDomain import Domains.IntervalDomain import Interfaces.ReducedProductDomain import Tools.Utilities import SyntacticStructure.WhileGrammar import Interfaces.AbstractStateDomain instance ReducedProductDo...
43ed20c996cd7a7695554dbebab9e6594de596eede05e2fc0c38407ee2d0bf2a
sharkdp/yinsh
Pink.hs
-- | Trying to complete with the best module Pink ( aiPink -- , mhNumber -- , rhRingMoves -- , rhConnected -- , rhZero ) where import AI import Yinsh pinkHeuristic :: Pink -> AIValue pinkHeuristic ai | points W >= pointsForWin = hugeNumber ...
null
https://raw.githubusercontent.com/sharkdp/yinsh/8139baf6a0dc7d1fc8a07b152b6c6420694e3108/src/Pink.hs
haskell
| Trying to complete with the best , mhNumber , rhRingMoves , rhConnected , rhZero controlledM :: YCoord -> [YCoord] controlledM c = ringMoves b c
module Pink ( aiPink ) where import AI import Yinsh pinkHeuristic :: Pink -> AIValue pinkHeuristic ai | points W >= pointsForWin = hugeNumber | points B >= pointsForWin = -hugeNumber | otherwise = value W - value B where gs' = getGamestate ai ...
56082a97a96be770b72174996db4d362f7a849885a9f7fa825d45a72d6296777
nekketsuuu/tapis
constraintsL.ml
module ConstraintsL = Set.Make (struct type t = Type.level * Type.level (* l1 <= l2 *) let compare = compare end) include ConstraintsL open Error open Type (* sbst : Type.level sbst -> t -> t *) let sbst (sigma : Type.level Sbst.sbst) c = let sbst'' sigma l = match l with | LVar(x) -> b...
null
https://raw.githubusercontent.com/nekketsuuu/tapis/a61ecff95eaf2af27a85290d2a5f99341d28b43c/src/constraintsL.ml
ocaml
l1 <= l2 sbst : Type.level sbst -> t -> t solve : t -> Type.level sbst undirected graph get_cycle : Type.level -> string list -> var list bfs : ConstraintsL.t -> Type.level -> var list -> var list directed graph to_lvar : Type.level -> var Here, we should use precise composition get_nodes : Constrain...
module ConstraintsL = Set.Make (struct let compare = compare end) include ConstraintsL open Error open Type let sbst (sigma : Type.level Sbst.sbst) c = let sbst'' sigma l = match l with | LVar(x) -> begin try List.assoc x sigma with | Not_found -> l end | _ -> l in...
a3f6c73f1bab3a551fb4e0fee7ef5d13761ae2f3a10b98d825153155d2b51906
gregr/first-order-miniKanren
not-numbero-tests.rkt
(display "\nRunning not-numbero tests") (newline) (test 'not-numbero-0 (run* (x) (not-numbero x)) '(#s(Ans (_.0) ((not-num _.0))))) (test 'not-numbero-1 (run* (x) (not-numbero 1)) '()) (test 'not-numbero-2-a (run* (x) (not-numbero x) (== x "hello")) '(("hello"))) (test 'not-numbero-2-b (run* (x) (== x...
null
https://raw.githubusercontent.com/gregr/first-order-miniKanren/ba81d4d22601135619fa47278bb84a68b969de08/not-numbero-tests.rkt
racket
(display "\nRunning not-numbero tests") (newline) (test 'not-numbero-0 (run* (x) (not-numbero x)) '(#s(Ans (_.0) ((not-num _.0))))) (test 'not-numbero-1 (run* (x) (not-numbero 1)) '()) (test 'not-numbero-2-a (run* (x) (not-numbero x) (== x "hello")) '(("hello"))) (test 'not-numbero-2-b (run* (x) (== x...
63034d6979ab2107979c159caaa87361c3b8e2d84a8acddccaa27fd0766e8d25
Drup/adtr
field.ml
type field = { ty : Syntax.type_expr; pos : int} type t = field list let empty = [] let (+/) : t -> field -> t = fun a b -> a @ [b] * [ conflict p1 p2 ] check if one path is prefix of the other . Return which one is shortest , along with the extra bits Return which one is shortest, along with the extra bit...
null
https://raw.githubusercontent.com/Drup/adtr/a2d1cb8473522a52e475fd1261892cf363f215aa/src/field.ml
ocaml
type field = { ty : Syntax.type_expr; pos : int} type t = field list let empty = [] let (+/) : t -> field -> t = fun a b -> a @ [b] * [ conflict p1 p2 ] check if one path is prefix of the other . Return which one is shortest , along with the extra bits Return which one is shortest, along with the extra bit...
06ed84ff9d94b889be30150f70a56a821d1526a893641235e3b0871d5587d096
patricoferris/ocaml-multicore-monorepo
unstrctrd.ml
type elt = [ `Uchar of Uchar.t | `WSP of wsp | `LF | `CR | `FWS of wsp | `d0 | `OBS_NO_WS_CTL of obs | `Invalid_char of invalid_char ] and wsp = string and obs = char and invalid_char = char type t = elt list type error = [ `Msg of string ] let invalid_arg fmt = Format.kasprintf invalid_arg fmt let e...
null
https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/unstrctrd/lib/unstrctrd.ml
ocaml
'"' should never happen '(' should never happen ')' should never happen '\'
type elt = [ `Uchar of Uchar.t | `WSP of wsp | `LF | `CR | `FWS of wsp | `d0 | `OBS_NO_WS_CTL of obs | `Invalid_char of invalid_char ] and wsp = string and obs = char and invalid_char = char type t = elt list type error = [ `Msg of string ] let invalid_arg fmt = Format.kasprintf invalid_arg fmt let e...
d523e8c41647ce0b84d1b8cec973d5f00ce41127d64d44dd44db709a72347d81
ocaml-multicore/ocaml-tsan
pr8575.ml
(* TEST * expect *) module A = struct type t = A | B let x = B end;; [%%expect{| module A : sig type t = A | B val x : t end |}] let test () = match A.x with | A as a -> `A_t a | B when false -> `Onoes | B -> if Random.bool () then `Onoes else `A_t B;; [%%expect{| val test : unit -> [> `A_t of A.t | `Onoes...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/typing-polyvariants-bugs/pr8575.ml
ocaml
TEST * expect
module A = struct type t = A | B let x = B end;; [%%expect{| module A : sig type t = A | B val x : t end |}] let test () = match A.x with | A as a -> `A_t a | B when false -> `Onoes | B -> if Random.bool () then `Onoes else `A_t B;; [%%expect{| val test : unit -> [> `A_t of A.t | `Onoes ] = <fun> |}, Principa...
429d9d8b05652b5b0a85eb6c178dc070f94a9102ded82e4682d47519eb14ac3d
links-lang/links
transformSugar.ml
open CommonTypes open Operators open Sugartypes open SourceCode open SourceCode.WithPos open Utility open Types module TyEnv = Env.String type program_transformer = Types.typing_environment -> Sugartypes.program -> Sugartypes.program type sentence_transformer = Types.typing_environment -> Sugartypes.sentence -> Sug...
null
https://raw.githubusercontent.com/links-lang/links/5434779a4d296a58d7ca824c9cfda03804a77d4e/core/transformSugar.ml
ocaml
stilde ltilde tilde bring the inner effects into scope, then restore the environments afterwards bring the inner effects into scope, then restore the environments afterwards ensure that the formlet bindings are only in scope in the yields clause let o = {< formlet_env...
open CommonTypes open Operators open Sugartypes open SourceCode open SourceCode.WithPos open Utility open Types module TyEnv = Env.String type program_transformer = Types.typing_environment -> Sugartypes.program -> Sugartypes.program type sentence_transformer = Types.typing_environment -> Sugartypes.sentence -> Sug...
84a8c520adae3ce1e58078bc7a3d87cae9530f75e12e294c3ce17b3cbe6f28f9
appleshan/cl-http
configuration-appletalk.lisp
;;; -*- Mode: LISP; Package: HTTP; Syntax: ANSI-Common-Lisp -*- Copyright , 1994 - 1997 . ;;; All rights reserved. ;;;------------------------------------------------------------------- ;;; CONFIGURATION FILE FOR CL - HTTP RUNNING OVER ;;; This file configures CL - HTTP for AppleTalk HTTP service when DNS...
null
https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/mcl/examples/configuration-appletalk.lisp
lisp
-*- Mode: LISP; Package: HTTP; Syntax: ANSI-Common-Lisp -*- All rights reserved. ------------------------------------------------------------------- Do the standard configuration Repeat because some of the standard configurations step on these
Copyright , 1994 - 1997 . CONFIGURATION FILE FOR CL - HTTP RUNNING OVER This file configures CL - HTTP for AppleTalk HTTP service when DNS is available only via the hosts file in the system directory . When DNS is available , use the standard configuration . (in-package :http) Tell the MAC its do...
a576096d16aa5a3b879782153ef2f1cc9a9394ffcd5809e88eafd7d8c404c6f7
sarabander/p2pu-sicp
3.72.scm
(define (sum-of-squares p) (+ (square (first p)) (square (second p)))) (define square-base-pairs (weighted-pairs sum-of-squares integers integers)) (define threeway-squaresums (stream-filter (λ (p) (not (null? p))) (stream-map (λ (p1 p2 p3) (let ((sq1 (sum-of-squares p1)) (sq2 (su...
null
https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/3.5/3.72.scm
scheme
...
(define (sum-of-squares p) (+ (square (first p)) (square (second p)))) (define square-base-pairs (weighted-pairs sum-of-squares integers integers)) (define threeway-squaresums (stream-filter (λ (p) (not (null? p))) (stream-map (λ (p1 p2 p3) (let ((sq1 (sum-of-squares p1)) (sq2 (su...
9e5dbf5c9b5ddd0a9cdc07804969eaae2de5a962e75dacdddd6b0c70304b86cf
chenyukang/eopl
22.scm
;; Generating better code when K is already proc-exp for (K simp) (load-relative "../libs/init.scm") (load-relative "./base/test.scm") (load-relative "./base/cps.scm") (load-relative "./base/data-structures.scm") (load-relative "./base/cps-cases.scm") (load-relative "./base/cps-lang.scm") (load-relative "./base/base-...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch6/22.scm
scheme
Generating better code when K is already proc-exp for (K simp)
(load-relative "../libs/init.scm") (load-relative "./base/test.scm") (load-relative "./base/cps.scm") (load-relative "./base/data-structures.scm") (load-relative "./base/cps-cases.scm") (load-relative "./base/cps-lang.scm") (load-relative "./base/base-iterp.scm") make - send - to - cont : SimpleExp * SimpleExp - >...
a22e13312ba2e3d022ac4d952b5a28df51c18498ef520cb071ad5e5218e54fec
GillianPlatform/Gillian
Asrt.ml
module SSubst = Gillian.Symbolic.Subst open Gillian.Gil_syntax * { b JSIL logic assertions } . type t = | Emp (** Empty heap *) | Star of t * t (** Separating conjunction *) | PointsTo of Expr.t * Expr.t * Expr.t (** Heap cell assertion *) | MetaData of Expr.t * Expr.t (** MetaData ...
null
https://raw.githubusercontent.com/GillianPlatform/Gillian/1c8d65120c04ef87cda689a9d41268e25b5ffa7e/Gillian-JS/lib/JSIL/Asrt.ml
ocaml
* Empty heap * Separating conjunction * Heap cell assertion * MetaData * Predicates * emptyFields assertion * Pure formula * Typing assertion x(y1, ..., yn) types(e1:t1, ..., en:tn) MetaData (e1, e2) Pure
module SSubst = Gillian.Symbolic.Subst open Gillian.Gil_syntax * { b JSIL logic assertions } . type t = let compare x y = let cmp = Stdlib.compare in match (x, y) with | Pure (Eq (PVar x, _)), Pure (Eq (PVar y, _)) -> cmp x y | Pure (Eq (PVar _, _)), _ -> -1 | _, Pure (Eq (PVar _, _)) -> 1 | PointsTo _, P...
1ed55a1c611fd1de0f5faa1bd2e6ecf1fa3e596c287e7cb36e6667e9fccd3532
pirapira/coq2rust
proof_global.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/proofs/proof_global.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** ************************************...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Util open Pp open Names...
07bcb2b9847c15cd3cfc2a4d566d09e9c5927476067197dda93578779d65a1a8
dsorokin/aivika
ChemicalReaction.hs
# LANGUAGE RecursiveDo # This is model Chemical Reaction from the 5 - minute tutorial of Berkeley - Madonna . import Simulation.Aivika import Simulation.Aivika.SystemDynamics specs = Specs { spcStartTime = 0, spcStopTime = 13, spcDT = 0.01, spcMethod = RungeKutt...
null
https://raw.githubusercontent.com/dsorokin/aivika/7a14f460ab114b0f8cdfcd05d5cc889fdc2db0a4/examples/ChemicalReaction.hs
haskell
# LANGUAGE RecursiveDo # This is model Chemical Reaction from the 5 - minute tutorial of Berkeley - Madonna . import Simulation.Aivika import Simulation.Aivika.SystemDynamics specs = Specs { spcStartTime = 0, spcStopTime = 13, spcDT = 0.01, spcMethod = RungeKutt...
e4db6c83c428ce383c417566633dcc261d7ff5a0e726dc93f84b9169f64d4cb4
reborg/clojure-essential-reference
2.clj
user=> (+ 1 (/ 1 0)) Execution error (ArithmeticException) at user/eval8 (REPL:1). Divide by zero < 1 > #error { :cause "Divide by zero" :via [{:type java.lang.ArithmeticException :message "Divide by zero" :at [clojure.lang.Numbers divide "Numbers.java" 188]}] :trace [...]
null
https://raw.githubusercontent.com/reborg/clojure-essential-reference/9a3eb82024c8e5fbe17412af541c2cd30820c92e/DynamicVariablesintheStandardLibrary/*1%2C*2%2C*3and*e/2.clj
clojure
user=> (+ 1 (/ 1 0)) Execution error (ArithmeticException) at user/eval8 (REPL:1). Divide by zero < 1 > #error { :cause "Divide by zero" :via [{:type java.lang.ArithmeticException :message "Divide by zero" :at [clojure.lang.Numbers divide "Numbers.java" 188]}] :trace [...]
11a3b3c175b9a9677974abebb98489f7b398701d869afe7ed14b7c5c3b6e4033
josefs/Gradualizer
poly_map_type_var_should_fail.erl
-module(poly_map_type_var_should_fail). -export([map_type_var/1]). -gradualizer([solve_constraints]). -spec map_type_var(nonempty_list(#{atom() => integer()} | atom())) -> integer(). map_type_var(L) -> V = lists:nth(2, L), %% at this point V :: T case V of %% pattern matching a map against a type...
null
https://raw.githubusercontent.com/josefs/Gradualizer/22a8e19f1c88a00399eaeda41cf8ddde302061bd/test/should_fail/poly_map_type_var_should_fail.erl
erlang
at this point V :: T pattern matching a map against a type var
-module(poly_map_type_var_should_fail). -export([map_type_var/1]). -gradualizer([solve_constraints]). -spec map_type_var(nonempty_list(#{atom() => integer()} | atom())) -> integer(). map_type_var(L) -> V = lists:nth(2, L), case V of #{k := Int} -> Int end.
884080d855626988c16845fed97ba97322931731592e2d047dd79e92ec104138
jgertm/lang
type_checker.clj
(ns lang.type-checker (:refer-clojure :exclude [apply drop type]) (:require [clojure.core.match :refer [match]] clojure.reflect [clojure.set :as set] [clojure.string :as str] [clojure.walk :as walk] [lang.ast :as ast] [lang.interpreter :as inte...
null
https://raw.githubusercontent.com/jgertm/lang/5a4d73f01d93d7615e44f8ce2dfe8a237dd80766/src/lang/type_checker.clj
clojure
FIXME: multiple restrictions ElimeqUvarL ElimeqUvarR⊥ ElimeqBinV ElimeqClash Rec 1Iα^ ∀I ⊃I / ⊃I⊥ →I →Iα^ rm? Case +I variant wraps value variant is enum injector isn't defined +Iα^ ×I ×Iα^ Sub InstReach⊃ TODO(tjgr): recycle exvars InstSolve⊃ TODO: check for wellformedness ≡⊕F ≡⊕V TODO: chec...
(ns lang.type-checker (:refer-clojure :exclude [apply drop type]) (:require [clojure.core.match :refer [match]] clojure.reflect [clojure.set :as set] [clojure.string :as str] [clojure.walk :as walk] [lang.ast :as ast] [lang.interpreter :as inte...
dc00dc4bf87cec96e5bbbb15137ea425242b10c3b6d49c28147feb940a25335a
justinmeiners/exercises
2_44.scm
(define (flipped-pairs painter) (let ((painter2 (beside painter (flip-vert painter)))) (below painter2 painter2))) (define (right-split painter n) (if (= n 0) painter (let ((smaller (right-split painter (- n 1)))) (beside painter (below smaller smaller))))) (define (up-sp...
null
https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/sicp/2/2_44.scm
scheme
without the painter I don't think its really worth doing these
(define (flipped-pairs painter) (let ((painter2 (beside painter (flip-vert painter)))) (below painter2 painter2))) (define (right-split painter n) (if (= n 0) painter (let ((smaller (right-split painter (- n 1)))) (beside painter (below smaller smaller))))) (define (up-sp...
312690b0606d7e333ac5f116d75aa545cd4fbd83615de92f75249e9ff9e60a6a
army-cat/trooper
trooper_ssh_tests.erl
-module(trooper_ssh_tests). -author(''). -include_lib("eunit/include/eunit.hrl"). -define(USERNAME, "manuel.rubio"). -define(BASE_PATH, "_build/test/lib/trooper/test"). start_daemon() -> ok = ssh:start(), Opts = [ {system_dir, ?BASE_PATH "/daemon1"}, {user_dir, ?BASE_PATH "/user"} ], ...
null
https://raw.githubusercontent.com/army-cat/trooper/ec43c18674b0ef75d4f31a4258b4532887d7aedd/test/trooper_ssh_tests.erl
erlang
FIXME: Ok, maybe it's a configuration possible to get this FIXME: Ok, maybe it's a configuration possible to get this command, in the rest, we get only the return of the function. FIXME: trying to figure out how to make this working :'( long_polling_interactive_exec_test_() -> {user, ?USERNAME}, ...
-module(trooper_ssh_tests). -author(''). -include_lib("eunit/include/eunit.hrl"). -define(USERNAME, "manuel.rubio"). -define(BASE_PATH, "_build/test/lib/trooper/test"). start_daemon() -> ok = ssh:start(), Opts = [ {system_dir, ?BASE_PATH "/daemon1"}, {user_dir, ?BASE_PATH "/user"} ], ...
48f79251cfe546ae8abfff04053d38f1d230cc1e8af68acdf3e251f9d1c5bd99
cac-t-u-s/om-sharp
groups.lisp
;============================================================================ ; om#: visual programming language for computer-assisted music composition ;============================================================================ ; ; This program is free software. For information on usage ; and redistribution, see...
null
https://raw.githubusercontent.com/cac-t-u-s/om-sharp/6a9e50f3fc4f42ae881247996d249675b700d0cf/src/packages/score/editor/groups.lisp
lisp
============================================================================ om#: visual programming language for computer-assisted music composition ============================================================================ This program is free software. For information on usage and redistribution, see the "...
GROUPS in score editors . File author : , 2021 (in-package :om) (defmethod collect-group-ids ((self score-editor)) (let ((groups ())) (loop for c in (get-all-chords (object-value self)) do (loop for id in (group-ids c) unless (find id groups :test 'string-equal) ...
becc40f36d78bf470b4fe2c556d420f8388b03306ad018504dc2893e3b3b6f38
j3pic/lisp-binary
single-field-tests.lisp
(in-package :lisp-binary-test) (unit-test 'read/write-integer-test (let* ((integer 2948) (le-buffer (flexi-streams:with-output-to-sequence (out) (write-integer integer 4 out))) (be-buffer (flexi-streams:with-output-to-sequence (out) (write-integer integer 4 out :byte-order :big-endian))) (signe...
null
https://raw.githubusercontent.com/j3pic/lisp-binary/711c38c2d9862bec7b83c8bf42823dd3985dc517/test/single-field-tests.lisp
lisp
(in-package :lisp-binary-test) (unit-test 'read/write-integer-test (let* ((integer 2948) (le-buffer (flexi-streams:with-output-to-sequence (out) (write-integer integer 4 out))) (be-buffer (flexi-streams:with-output-to-sequence (out) (write-integer integer 4 out :byte-order :big-endian))) (signe...
32cd0224bb8b7118ce39d8c5a5153b705132edfe8e955ab0d60b04b1da49c23b
dmitryvk/sbcl-win32-threads
mop-12.impure-cload.lisp
miscellaneous side - effectful tests of the MOP This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; While most of SBCL is derived from the CMU CL system , the test ;;;; files (like this one) were written from scratch after the fork from CMU CL . ;;;; ;;;; This softwar...
null
https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/tests/mop-12.impure-cload.lisp
lisp
more information. files (like this one) were written from scratch after the fork This software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. this file attempts to test possible metacircularity issues arising from adding slots to met...
miscellaneous side - effectful tests of the MOP This software is part of the SBCL system . See the README file for While most of SBCL is derived from the CMU CL system , the test from CMU CL . (defpackage "MOP-12" (:use "CL" "SB-MOP")) (in-package "MOP-12") (defclass super-method () ((abc :accessor abc...
e9ab91bc28740df24085f5a23177b0f8b09ccf5c2b356c389a1585fa1320a9ef
defaultxr/cl-collider-tutorial
server.lisp
(in-package #:sc) (defvar *s* nil "Special symbol bound to the default scsynth server. If functions do not specify a target server, that message is sent to the *s* server.") (defvar *sc-synth-program* #+darwin "/Applications/SuperCollider/SuperCollider.app/Contents/Resources/scsynth" #+linux "/usr/bin/scsynth" ...
null
https://raw.githubusercontent.com/defaultxr/cl-collider-tutorial/266ae3e6aaa16d35695266ec884c30626fc8e38d/cl-collider/server.lisp
lisp
------------------------------------------------------- Server - base class ------------------------------------------------------- declare generic function for realtime server ------------------------------------------------------- realtime Server ------------------------------------------------------- schedul...
(in-package #:sc) (defvar *s* nil "Special symbol bound to the default scsynth server. If functions do not specify a target server, that message is sent to the *s* server.") (defvar *sc-synth-program* #+darwin "/Applications/SuperCollider/SuperCollider.app/Contents/Resources/scsynth" #+linux "/usr/bin/scsynth" ...
f96948eaf21754b80e70044ae3fe2d3f3ac33dec4a5443bae133ecaccbb7d200
avsm/mirage-duniverse
ppx_variants_conv.ml
(* Generated code should depend on the environment in scope as little as possible. E.g. rather than [foo = []] do [match foo with [] ->], to eliminate the use of [=]. It is especially important to not use polymorphic comparisons, since we are moving more and more to code that doesn't have them in scope. *) ...
null
https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/ppx_variants_conv/src/ppx_variants_conv.ml
ocaml
Generated code should depend on the environment in scope as little as possible. E.g. rather than [foo = []] do [match foo with [] ->], to eliminate the use of [=]. It is especially important to not use polymorphic comparisons, since we are moving more and more to code that doesn't have them in scope.
open Base open Ppxlib open Ast_builder.Default let raise_unsupported loc = Location.raise_errorf ~loc "Unsupported use of variants (you can only use it on variant types)." module Create = struct let lambda loc xs body = List.fold_right xs ~init:body ~f:(fun (label, p) e -> pexp_fun ~loc label None p e) ...
91b5fb9dee7ba5f73555674940dec11cff53627ed34fd44ce9e659ab1adfe846
albertoruiz/easyVision
Autofrontal.hs
----------------------------------------------------------------------------- | Module : Vision . Autofrontal Copyright : ( c ) 2006 License : GP Maintainer : ( aruiz at um dot es ) Stability : provisional Practical Planar Metric Rectification . . BMVC06 Module ...
null
https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/geometry/src/Vision/Autofrontal.hs
haskell
--------------------------------------------------------------------------- --------------------------------------------------------------------------- experiments on planar rectification :: [Maybe (Matrix Double)] this gives a low value if h is a similar transformation this gives a measure of the difference with a...
| Module : Vision . Autofrontal Copyright : ( c ) 2006 License : GP Maintainer : ( aruiz at um dot es ) Stability : provisional Practical Planar Metric Rectification . . BMVC06 Module : Vision.Autofrontal Copyright : (c) Alberto Ruiz 2006 License : ...
d433482bee1b1349ca8637ea2579e52af2812a687bee19ff027fd0c9c154350e
gelisam/klister
Expander.hs
TODO next step is add prisms for Type # LANGUAGE BlockArguments # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # {-# LANGUAGE RankNTypes #-} # LANGU...
null
https://raw.githubusercontent.com/gelisam/klister/795393ce4f8c17489b8ca4f855b462db409c5514/src/Expander.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # * Concrete expanders * Module system * Expander monad Check that all the identifiers are actually exported Shift the syntax literals in the module source code | Evaluate an expanded module at the current expansion phase, recursively l...
TODO next step is add prisms for Type # LANGUAGE BlockArguments # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # # LANGUAGE TypeApplications # # LANG...
d07858fde521b666e9b01cb054ad5ed0ad2e0b2e5e1db351910d33a111f24d25
tvraman/aster-math
new-document-methods.lisp
;;; -*- Mode: LISP -*- ;;; (in-package :aster) ;;; Method: READ-ALOUD Author: raman Created : Fri Oct 9 14:01:50 1992 (defmethod read-aloud ((fraction fraction)) "Read aloud fraction " (afl:new-block (afl:local-set-state (reading-state 'fraction)) (read-alo...
null
https://raw.githubusercontent.com/tvraman/aster-math/5aa9648260a8de0675336c51161969606f158d71/lisp/read-aloud/new-document-methods.lisp
lisp
-*- Mode: LISP -*- ;;; Method: READ-ALOUD Author: raman {{{ mbox }}} {{{fbox For the present treating fbox like mbox, will change reading rule later to add some bells and whistles. }}} {{{label ;;; automatically generated expander for label will not currently ;;; work....
(in-package :aster) Created : Fri Oct 9 14:01:50 1992 (defmethod read-aloud ((fraction fraction)) "Read aloud fraction " (afl:new-block (afl:local-set-state (reading-state 'fraction)) (read-aloud "Fraction with numerator: ") (afl:new-block (afl:local-set-state (reading-state 'fraction-numera...
4e1ccf0284a863051f620119da04fe91bbba61352a96738607f18b7400afff64
scalaris-team/scalaris
snapshot_leader.erl
2012 - 2015 Zuse Institute Berlin Licensed under the Apache License , Version 2.0 ( the " License " ) ; % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % -2.0 % % Unless required by applicable law or agreed to in writing, software d...
null
https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/src/snapshot_leader.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language gov...
2012 - 2015 Zuse Institute Berlin Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @author > -module(snapshot_leader). -author(''). -vsn('$Id$'). -define(TRACE(_X, _Y), ok). -behaviour(gen_component). -export...
b2f9f79d63486ca886fa3378b4bd37f853217aac3c67afbe378cfe8c04d28121
itsrainingmani/learn-clojure-in-public
ch8.clj
(ns clojure-noob.ch8 (:require [clojure.string :as str]) (:gen-class)) Writing Macros ;; Need to quote expressions to get unevaluated data structures back in the final list ;; need to careful about the difference between a symbol and a value (defmacro my-print [expression] (list 'let ['result expression] ...
null
https://raw.githubusercontent.com/itsrainingmani/learn-clojure-in-public/a02477e6a4129a12c66734cfa35f2b0e07d03792/code/clojure-noob/src/clojure_noob/ch8.clj
clojure
Need to quote expressions to get unevaluated data structures back in the final list need to careful about the difference between a symbol and a value => (+ 1 2) the ' character is a reader macro for the quote function => (if (the-cows-come :home) (do (call me :pappy) (slap me :silly))) when macro uses if and do s...
(ns clojure-noob.ch8 (:require [clojure.string :as str]) (:gen-class)) Writing Macros (defmacro my-print [expression] (list 'let ['result expression] (list 'println 'result) 'result)) quoting produces an unevaluated data structure (+ 1 2) = > 3 '(+ 1 2) (macroexpand '(when (the-cow...
e6e35654b998ca4c404e05fe662454f34ac17299b04ddde36e49d5ba9503dc5e
input-output-hk/cardano-coin-selection
CoinSpec.hs
# LANGUAGE TypeApplications # # OPTIONS_GHC -fno - warn - orphans # module Internal.CoinSpec ( spec ) where import Prelude import Data.Maybe ( catMaybes, fromMaybe ) import Internal.Coin ( Coin ) import Test.Hspec ( Spec, describe, it, shouldBe, shouldSatisfy ) import Test.QuickCheck ( Arbitr...
null
https://raw.githubusercontent.com/input-output-hk/cardano-coin-selection/cff368d674fe58bc1a12e6564a26ccea21eb5aac/src/test/Internal/CoinSpec.hs
haskell
# LANGUAGE TypeApplications # # OPTIONS_GHC -fno - warn - orphans # module Internal.CoinSpec ( spec ) where import Prelude import Data.Maybe ( catMaybes, fromMaybe ) import Internal.Coin ( Coin ) import Test.Hspec ( Spec, describe, it, shouldBe, shouldSatisfy ) import Test.QuickCheck ( Arbitr...
a1b013d87e4bf9a49eea345259a1fc25be1994f9f84152e7810cd08d79a6c095
w2l0o5/observerweb
observerweb_lib.erl
%%%------------------------------------------------------------------- @author ( C ) 2017 , Freecnpro %%% @doc %%% %%% @end Created : 2017 - 04 - 17 %%%------------------------------------------------------------------- -module(observerweb_lib). -author(""). %% API -export([fill_info/2, to_str/1, escape/1]). ...
null
https://raw.githubusercontent.com/w2l0o5/observerweb/0e4237c3765e7e69813974cec8c68407c28516e5/apps/observerweb/src/observerweb_lib.erl
erlang
------------------------------------------------------------------- @doc @end ------------------------------------------------------------------- API Special case used by crashdump_viewer when the value decides which header to use
@author ( C ) 2017 , Freecnpro Created : 2017 - 04 - 17 -module(observerweb_lib). -author(""). -export([fill_info/2, to_str/1, escape/1]). fill_info([{dynamic, Key}|Rest], Data) when is_atom(Key); is_function(Key) -> case get_value(Key, Data) of undefined -> [undefined | fill_info(Rest, Data)]; ...
1257d28b4f6c139380575d8e03a4b8fb3712a2efb1cb54d368bd107704b830e1
rems-project/cerberus
string_nat_big_num.mli
open Nat_big_num val chars_of_num_with_basis: int -> bool -> num -> char list val string_of_octal: num -> string val string_of_decimal: num -> string val string_of_hexadecimal: num -> string val string_of_hexadecimal_pad: int -> num -> string
null
https://raw.githubusercontent.com/rems-project/cerberus/124c93f10cb4c235f6396adec82ebf9563daeb7e/ocaml_frontend/pprinters/string_nat_big_num.mli
ocaml
open Nat_big_num val chars_of_num_with_basis: int -> bool -> num -> char list val string_of_octal: num -> string val string_of_decimal: num -> string val string_of_hexadecimal: num -> string val string_of_hexadecimal_pad: int -> num -> string
c64e766d364bb8a2f77496a15b93bb4a2321e7a7ccba56f8a3d1741acccc27e7
mariari/Misc-Lisp-Scripts
format-changer.lisp
(defpackage #:freq-csv.format-changer (:use #:uiop) (:use #:common-lisp) (:local-nicknames (:shell :inferior-shell)) (:export :epub-to-text-file :pdf-to-text-file)) (in-package :freq-csv.format-changer) (defun epub-to-text-file (input output) "converts a epub file into a text file" (shell:run `(ebo...
null
https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/16d868af6c5430d99825d5d2408499f728777a61/scripts/chinese-anki-import/src/format-changer.lisp
lisp
(defpackage #:freq-csv.format-changer (:use #:uiop) (:use #:common-lisp) (:local-nicknames (:shell :inferior-shell)) (:export :epub-to-text-file :pdf-to-text-file)) (in-package :freq-csv.format-changer) (defun epub-to-text-file (input output) "converts a epub file into a text file" (shell:run `(ebo...
9deefd0aa98b2329c1b5aa07e8ff8e38324eaf4ec1b318e6e78e40053d8d4db7
janestreet/file_path
bench_file_path.ml
open! Core (** We do not need to benchmark the [Types] module. *) module Types = File_path.Types module Part = Bench_part module Relative = Bench_relative module Absolute = Bench_absolute include Bench_path module Operators = Bench_operators (** We do not bother benchmarking stable serializations, they use the same ...
null
https://raw.githubusercontent.com/janestreet/file_path/975cd0bd0460212b939016769aed2de28665b5a0/bench/bench_file_path.ml
ocaml
* We do not need to benchmark the [Types] module. * We do not bother benchmarking stable serializations, they use the same code as unstable serializations.
open! Core module Types = File_path.Types module Part = Bench_part module Relative = Bench_relative module Absolute = Bench_absolute include Bench_path module Operators = Bench_operators module Stable = File_path.Stable
77d544fb6e23158f923b82271e69ac4f7723719aeb7a9ac1b19e696cd7d716e1
zcaudate/hara
listener_test.clj
(ns hara.lib.aether.listener-test (:use hara.test) (:require [hara.lib.aether.listener :refer :all])) ^{:refer hara.lib.aether.listener/event->rep :added "3.0"} (fact "converts the event to a map representation") ^{:refer hara.lib.aether.listener/record :added "3.0"} (fact "adds an event to the recorder") ^{:ref...
null
https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/test/hara/lib/aether/listener_test.clj
clojure
(ns hara.lib.aether.listener-test (:use hara.test) (:require [hara.lib.aether.listener :refer :all])) ^{:refer hara.lib.aether.listener/event->rep :added "3.0"} (fact "converts the event to a map representation") ^{:refer hara.lib.aether.listener/record :added "3.0"} (fact "adds an event to the recorder") ^{:ref...
25add66b9ecc06ea0bcd7916e27d60fbd500e194d024b8331b81ea50ebe8ed73
cbaggers/cepl
bake.lisp
(in-package :cepl.pipelines) ;; (bake-uniforms 'foo :jam (gpu-function (ham :int))) (defun+ bake-uniforms (pipeline &rest uniforms &key &allow-other-keys) (let* ((pipeline (typecase pipeline ((or list symbol) (pipeline-spec pipeline)) (function (cepl.pipelines::function-key...
null
https://raw.githubusercontent.com/cbaggers/cepl/d1a10b6c8f4cedc07493bf06aef3a56c7b6f8d5b/core/pipelines/bake.lisp
lisp
(bake-uniforms 'foo :jam (gpu-function (ham :int))) get pipeline details get uniform details check for proposed uniforms that arent in the pipeline check in case user passed symbol instead of a gpu-func Go for it
(in-package :cepl.pipelines) (defun+ bake-uniforms (pipeline &rest uniforms &key &allow-other-keys) (let* ((pipeline (typecase pipeline ((or list symbol) (pipeline-spec pipeline)) (function (cepl.pipelines::function-keyed-pipeline pipeline)) ...