_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
dbfb063252be7b6ab5e484d3743be2a7a9005cf197a67e3ade2b7fcd4217d0d2
dbasch/bitcoin-paper-wallet
wallet.clj
(ns bitcoin.wallet (:gen-class :main true) (:import java.awt.image.BufferedImage [java.awt Font Color] com.google.zxing.qrcode.QRCodeWriter com.google.zxing.common.BitMatrix com.google.zxing.BarcodeFormat com.google.zxing.client.j2se.MatrixToImageWriter ...
null
https://raw.githubusercontent.com/dbasch/bitcoin-paper-wallet/fb59e431fa2ba5d7f5df17a953c791f5a5f90492/src/bitcoin/wallet.clj
clojure
generate qr code as an image I'm no artist, I just draw everything with absolute coordinates in a way that looks ok for me.
(ns bitcoin.wallet (:gen-class :main true) (:import java.awt.image.BufferedImage [java.awt Font Color] com.google.zxing.qrcode.QRCodeWriter com.google.zxing.common.BitMatrix com.google.zxing.BarcodeFormat com.google.zxing.client.j2se.MatrixToImageWriter ...
4d5ca974daea953eaaf78a26ba0ccef9b9e970f07fa124890683db6746d79096
clojure-interop/google-cloud-clients
core.clj
(ns com.google.cloud.translate.spi.core (:refer-clojure :only [require comment defn ->]) (:import )) (require '[com.google.cloud.translate.spi.TranslateRpcFactory])
null
https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.translate/src/com/google/cloud/translate/spi/core.clj
clojure
(ns com.google.cloud.translate.spi.core (:refer-clojure :only [require comment defn ->]) (:import )) (require '[com.google.cloud.translate.spi.TranslateRpcFactory])
d25663fcce50c4a0fc5389c9624575f96a2fb7ce941657d9def756a75c2511da
ijvcms/chuanqi_dev
player_instance_pass_cache.erl
%%%------------------------------------------------------------------- @author zhengsiying ( C ) 2015 , < COMPANY > %%% @doc %%% %%% @end Created : 15 . 十二月 2015 下午8:18 %%%------------------------------------------------------------------- -module(player_instance_pass_cache). -include("common.hrl"). -include("c...
null
https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/player/player_instance_pass_cache.erl
erlang
------------------------------------------------------------------- @doc @end ------------------------------------------------------------------- API ==================================================================== API functions ==================================================================== ==========...
@author zhengsiying ( C ) 2015 , < COMPANY > Created : 15 . 十二月 2015 下午8:18 -module(player_instance_pass_cache). -include("common.hrl"). -include("cache.hrl"). -export([ select_all/1, select_row/1, insert/1, update/2, delete/1 ]). select_all(PlayerId) -> db_cache_lib:select_all(?DB_PLAYER_INSTANCE_PASS,...
ab25cc7c43a745bd2d89846e37b45960c0a37af08ea47d07f0476b53b2ee8b4a
Relph1119/sicp-solutions-manual
p1-23-next.scm
(define (next n) (if (= n 2) 3 (+ n 2)))
null
https://raw.githubusercontent.com/Relph1119/sicp-solutions-manual/f2ff309a6c898376209c198030c70d6adfac1fc1/src/practices/ch01/p1-23-next.scm
scheme
(define (next n) (if (= n 2) 3 (+ n 2)))
72ce0f1842bb98221b259d58a44fdf34d5f2e4ece03c18ef097a327b680dd273
clojure-interop/aws-api
AmazonSNSAsync.clj
(ns com.amazonaws.services.sns.AmazonSNSAsync "Interface for accessing Amazon SNS asynchronously. Each asynchronous method will return a Java Future object overloads which accept an AsyncHandler can be used to receive notification when an asynchronous operation completes. Note: Do not directly implement this i...
null
https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.sns/src/com/amazonaws/services/sns/AmazonSNSAsync.clj
clojure
(ns com.amazonaws.services.sns.AmazonSNSAsync "Interface for accessing Amazon SNS asynchronously. Each asynchronous method will return a Java Future object overloads which accept an AsyncHandler can be used to receive notification when an asynchronous operation completes. Note: Do not directly implement this i...
5c419eebf09615b8e4947fcaa365972ab4cb677daece84167eea7673eb321fbf
mbattyani/cl-typesetting
kw-extensions.lisp
extensions ;;; This stuff will be dispatched into better locations later. (in-package #:typeset) ;; user-configurable default settings (defvar *paper-size* :letter "Paper format, supported values as in tt:top-level, i.e. :a4 or :letter") (defvar *page-margins* '(72 72 72 50) "Print margins LEFT TOP RIGHT BO...
null
https://raw.githubusercontent.com/mbattyani/cl-typesetting/86eba981fc4254addebecf765578ec350d6e3b75/kw-extensions.lisp
lisp
This stuff will be dispatched into better locations later. user-configurable default settings FIXME: currently draws on top of page instead of below new content. Needs toplevel extension :new-page-fn state for internal chapter handling higher-level chapter number and table of contents handling OBSOLETE, fixme, u...
extensions (in-package #:typeset) (defvar *paper-size* :letter "Paper format, supported values as in tt:top-level, i.e. :a4 or :letter") (defvar *page-margins* '(72 72 72 50) "Print margins LEFT TOP RIGHT BOTTOM in 1/72 inch units") (defvar *twosided* t "If true, use alternating page headers suitable for...
9bf871c170f6ffd704fc92b0a98a798b6fc3460baf733bcc69cdeeed35bcc202
wavewave/hoodle
HoodleState.hs
{-# LANGUAGE OverloadedStrings #-} module Hoodle.Type.HoodleState ( HoodleState, HoodleModeState (..), UnitHoodle, IsOneTimeSelectMode (..), Settings, UIComponentSignalHandler, FileStore (..), -- | labels unitKey, unitUUID, unitButton, hoodleModeState, hoodleFileContro...
null
https://raw.githubusercontent.com/wavewave/hoodle/fa7481d14a53733b2f6ae9debc95357d904a943c/core/src/Hoodle/Type/HoodleState.hs
haskell
# LANGUAGE OverloadedStrings # | labels | others | additional lenses , getCanvasInfoMap | for debug | | | (pen color, pen width, use variable cursor) | current unit | lens for unitKey | lens for unitKey | lens for unitKey | lens for hoodleModeState | | lens for cvsInfoMap | lens for frameState | le...
module Hoodle.Type.HoodleState ( HoodleState, HoodleModeState (..), UnitHoodle, IsOneTimeSelectMode (..), Settings, UIComponentSignalHandler, FileStore (..), unitKey, unitUUID, unitButton, hoodleModeState, hoodleFileControl, cvsInfoMap, currentCanvas, isOneTime...
31f81adc831ffef0cc6acfde1f5d918406323f6673d6556c71f73b6218e65852
tallaproject/onion
prop_random.erl
%%% Copyright ( c ) 2016 The Talla Authors . All rights reserved . %%% Use of this source code is governed by a BSD-style %%% license that can be found in the LICENSE file. %%% %%% ----------------------------------------------------------- @author < > %%% @doc Property Tests for onion_random. %%% @end %%% -----...
null
https://raw.githubusercontent.com/tallaproject/onion/d0c3f86c726c302744d3cfffa2de21f85c190cf0/test/prop_random.erl
erlang
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ----------------------------------------------------------- @doc Property Tests for onion_random. @end ----------------------------------------------------------- Properties.
Copyright ( c ) 2016 The Talla Authors . All rights reserved . @author < > -module(prop_random). -export([prop_time_range/0]). -include_lib("onion/include/onion_test.hrl"). -spec prop_time_range() -> term(). prop_time_range() -> ?FORALL({Min, Max}, {pos_integer(), pos_integer()}, begin ...
72bf1d1f22efbcd7a35358000515a931b1393777550a03b1727c7de8fd093445
roelvandijk/base-unicode-symbols
Unicode.hs
# LANGUAGE NoImplicitPrelude , UnicodeSyntax # module Control.Monad.Unicode ( (≫=), (≫), (=≪), (↣), (↢) ) where ------------------------------------------------------------------------------- -- Imports ------------------------------------------------------------------------------- -- from base: import Control.Monad...
null
https://raw.githubusercontent.com/roelvandijk/base-unicode-symbols/f1607c281ee821d20d6829ab38180c30d350321b/src/Control/Monad/Unicode.hs
haskell
----------------------------------------------------------------------------- Imports ----------------------------------------------------------------------------- from base: ----------------------------------------------------------------------------- Fixities -------------------------------------------------------...
# LANGUAGE NoImplicitPrelude , UnicodeSyntax # module Control.Monad.Unicode ( (≫=), (≫), (=≪), (↣), (↢) ) where import Control.Monad ( Monad, (>>=), (>>), (=<<), (>=>), (<=<) ) infixl 1 ≫= infixl 1 ≫ infixr 1 =≪ infixl 1 ↣ infixr 1 ↢ (≫=) ∷ Monad m ⇒ m α → (α → m β) → m β (≫=) = (>>=) (≫) ∷ Monad m ⇒ m α → m...
67cee882a2a4da5ca6053cd97aadaf50c075a5819c1c8bc6daba1a93f2b1b68b
bazurbat/chicken-scheme
chicken-depends.scm
(import scheme chicken) (define (remove pred ls) (cond ((null? ls) '()) ((pred (car ls)) (remove pred (cdr ls))) (else (cons (car ls) (remove pred (cdr ls)))))) (define library-modules '(srfi-13 srfi-14 srfi-18 srfi-69)) (define core-modules (remove (cut memq <> library-modules) `(list ...
null
https://raw.githubusercontent.com/bazurbat/chicken-scheme/f0c9d1fd8b68eb322e320e65ec40b0bf7d1b41dc/chicken-depends.scm
scheme
(register-feature! 'debug) swallow #\>
(import scheme chicken) (define (remove pred ls) (cond ((null? ls) '()) ((pred (car ls)) (remove pred (cdr ls))) (else (cons (car ls) (remove pred (cdr ls)))))) (define library-modules '(srfi-13 srfi-14 srfi-18 srfi-69)) (define core-modules (remove (cut memq <> library-modules) `(list ...
a10670fb28e01bce8801b001f7a83b1c2085e3db2504ee2585975fdf0d2cf179
diprism/perpl
Lex.hs
code module Parse.Lex (Token (..), keywords, Pos, lexFile) where import Data.Char (isAlpha, isDigit) -- Possible tokens data Token = TkVar String -- "x" | TkNum Double -- floating-point literal | TkLam -- "\" | TkParenL -- "(" | TkParenR -- ")" | TkEq -- "=" | TkFail -- "fail" | TkAmb -- "amb" ...
null
https://raw.githubusercontent.com/diprism/perpl/1df30ea2b895e7e87f6d2130a5a26970ee5347d9/src/Parse/Lex.hs
haskell
Possible tokens "x" floating-point literal "\" "(" ")" "=" "fail" "amb" "factor" "case" "of" "let" "in" "->" ":" "." "," "<" ">" "|" ";" "define" "extern" "data" "Bool" "if" "then" "else" "==" Punctuation tokens Keyword tokens Line, column Increments column by n Goes to the next line ...
code module Parse.Lex (Token (..), keywords, Pos, lexFile) where import Data.Char (isAlpha, isDigit) data Token = deriving Eq instance Show Token where show (TkVar x) = x show (TkNum n) = show n show TkLam = "\\" show TkParenL = "(" show TkParenR = ")" show TkEq = "=" show TkArr = "->" show TkCo...
200da785a75f1390bc92aa201452543cbce67fc929e74e8f05b73759917486ad
naoto-ogawa/h-xproto-mysql
Example14.hs
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ConstraintKinds #-} module Example.Example14 where import Control.Exception.Safe (SomeException, catch) import qualified Data.Text as T import Data.Time import qualified Data.Word as W -- my library import DataBase.MySQLX.DateTime im...
null
https://raw.githubusercontent.com/naoto-ogawa/h-xproto-mysql/1eacd6486c99b849016bf088788cb8d8b166f964/src/Example/Example14.hs
haskell
# LANGUAGE ScopedTypeVariables # # LANGUAGE ConstraintKinds # my library ,stock_asset :: Ratio Int colVal <*> Ratio Decimal to Double repeat row retrival. get resultset mapM_ print $ resultFrom people $ result
module Example.Example14 where import Control.Exception.Safe (SomeException, catch) import qualified Data.Text as T import Data.Time import qualified Data.Word as W import DataBase.MySQLX.DateTime import DataBase.MySQLX.NodeSession import DataBase.MySQLX.Statement data People = Peopl...
34e673dad3d3ba19ea96d83c14f7c4a22774158265bd801e8c87e1a675f38d9d
mbutterick/describe
float-test-double.rkt
#lang racket/base (require "main.rkt") (printf "--- Using literals (double precision) ---~n") (describe 0.1) (describe 0.2) (describe 0.3) (describe 0.4) (describe 0.5) (describe 0.6) (describe 0.7) (describe 0.8) (describe 0.9) (describe 1.0) (printf "--- Using summation (double precision) ---~n") (for/fold ((sum 0...
null
https://raw.githubusercontent.com/mbutterick/describe/e694813d9540623a04cbff78034502c2a693e90a/describe/float-test-double.rkt
racket
#lang racket/base (require "main.rkt") (printf "--- Using literals (double precision) ---~n") (describe 0.1) (describe 0.2) (describe 0.3) (describe 0.4) (describe 0.5) (describe 0.6) (describe 0.7) (describe 0.8) (describe 0.9) (describe 1.0) (printf "--- Using summation (double precision) ---~n") (for/fold ((sum 0...
a6d594590860fbba033e23effec70b5feb3aa148a3b5539f6c977c77ce8a2e0c
lopec/LoPEC
logger_int.erl
%%%------------------------------------------------------------------- @author ( C ) 2009 , Clusterbusters %%% @doc The internal logger %%% Sends logging messages to the external logger who writes to disk %%% @end %%%------------------------------------------------------------------- -module(logger_int). %% API ...
null
https://raw.githubusercontent.com/lopec/LoPEC/29a3989c48a60e5990615dea17bad9d24d770f7b/branches/stable-1/old_stuff/old_slave/src/logger/logger_int.erl
erlang
------------------------------------------------------------------- @doc The internal logger Sends logging messages to the external logger who writes to disk @end ------------------------------------------------------------------- API =================================================================== Exported fun...
@author ( C ) 2009 , Clusterbusters -module(logger_int). -export([start_link/2, stop/1]). Internal functions -export([init/2]). @private @spec start_link(ExternalLogger , FlagList::list ( ) ) - > { ok , Pid } | { error , Error } start_link(ExternalLogger, FlagList) -> ...
a3fe1d678577d24c6885c79b62463c3f8bdb212dc12165d0601e01b83e295d4d
ghcjs/ghcjs-dom
CSSFontFaceRule.hs
# LANGUAGE PatternSynonyms # # LANGUAGE ForeignFunctionInterface # # LANGUAGE JavaScriptFFI # -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} module GHCJS.DOM.JSFFI.Generated.CSSFontFaceRule (js_getStyle, getStyle, CSSFontFaceRule(..), gTypeCSSFontFaceRule) ...
null
https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/CSSFontFaceRule.hs
haskell
For HasCallStack compatibility # LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
# LANGUAGE PatternSynonyms # # LANGUAGE ForeignFunctionInterface # # LANGUAGE JavaScriptFFI # module GHCJS.DOM.JSFFI.Generated.CSSFontFaceRule (js_getStyle, getStyle, CSSFontFaceRule(..), gTypeCSSFontFaceRule) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, ...
7ac312e57a6eb3cda07af18faaf763ab69a564bf4997da223c5a9356ec489932
RedPRL/algaeff
Mutex.ml
module type S = sig exception Locked val exclusively : (unit -> 'a) -> 'a val run : (unit -> 'a) -> 'a end module Make () = struct exception Locked let () = Printexc.register_printer @@ function | Locked -> Some "Mutex already locked" | _ -> None module S = State.Make(struct type state = boo...
null
https://raw.githubusercontent.com/RedPRL/algaeff/c2d2bf9050c6f4340ffa056da5c8e8328315e1a4/src/Mutex.ml
ocaml
module type S = sig exception Locked val exclusively : (unit -> 'a) -> 'a val run : (unit -> 'a) -> 'a end module Make () = struct exception Locked let () = Printexc.register_printer @@ function | Locked -> Some "Mutex already locked" | _ -> None module S = State.Make(struct type state = boo...
2aa708c55b1c2838f59696323ac3c6c75dbcb039859dc9ba2b2bdd9dd9acc712
ulrikstrid/reason-native-web
Jwk.mli
type t = { alg: string option; kty: string; use: string option; n: string; e: string; kid: string; x5t: string option; } val empty : t val make : Nocrypto.Rsa.pub -> (t, [ `Msg of string]) result val to_json : t -> Yojson.Basic.t val from_json : Yojson.Basic.t -> t val from_string : string -> t
null
https://raw.githubusercontent.com/ulrikstrid/reason-native-web/81d1a1145d17f6eddd8174ae0463db3ed0fdbb0c/jose/src/Jwk.mli
ocaml
type t = { alg: string option; kty: string; use: string option; n: string; e: string; kid: string; x5t: string option; } val empty : t val make : Nocrypto.Rsa.pub -> (t, [ `Msg of string]) result val to_json : t -> Yojson.Basic.t val from_json : Yojson.Basic.t -> t val from_string : string -> t
1746906e391f9b3ddc6394c456834d399145a2d8636ef8559d63510c425033b6
bmourad01/ocamlchess
move.ml
open Core_kernel [@@warning "-D"] let bits = Piece.kind_bits + (Square.bits * 2) module T = struct type t = int [@@deriving compare, equal, hash, sexp] end include T include Comparable.Make(T) module Promote = struct module T = struct type t = Knight | Bishop | Rook | Queen [@@deriving compare, equal, h...
null
https://raw.githubusercontent.com/bmourad01/ocamlchess/6c7214f5b709d9b1327b384a057fbdb2b5a9c3db/chess/src/move.ml
ocaml
As a hack, we'll use all set bits to indicate that no piece was promoted.
open Core_kernel [@@warning "-D"] let bits = Piece.kind_bits + (Square.bits * 2) module T = struct type t = int [@@deriving compare, equal, hash, sexp] end include T include Comparable.Make(T) module Promote = struct module T = struct type t = Knight | Bishop | Rook | Queen [@@deriving compare, equal, h...
be2913e842887d712c525913b31ae00746319f97be1180c162bbc23053eae29e
exercism/babashka
project.clj
(defproject rotational-cipher "0.1.0-SNAPSHOT" :description "rotational cipher exercise." :url "-cipher" :dependencies [[org.clojure/clojure "1.10.0"]])
null
https://raw.githubusercontent.com/exercism/babashka/707356c52e08490e66cb1b2e63e4f4439d91cf08/exercises/practice/rotational-cipher/project.clj
clojure
(defproject rotational-cipher "0.1.0-SNAPSHOT" :description "rotational cipher exercise." :url "-cipher" :dependencies [[org.clojure/clojure "1.10.0"]])
4d9901d2ab3ae594fa522bd06cdef7dcbb0181a144c7aefdac23522c824f8fdd
fpco/ide-backend
StateT.hs
# LANGUAGE FlexibleInstances , MultiParamTypeClasses # | Version on StateT which evaluates the state strictly at every step module IdeSession.Strict.StateT ( -- * Transformer StrictStateT(..) , modify , evalStateT , execStateT -- * As base monad , StrictState , runState , evalState , execSta...
null
https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend-common/IdeSession/Strict/StateT.hs
haskell
* Transformer * As base monad ----------------------------------------------------------------------------- As base monad -----------------------------------------------------------------------------
# LANGUAGE FlexibleInstances , MultiParamTypeClasses # | Version on StateT which evaluates the state strictly at every step module IdeSession.Strict.StateT ( StrictStateT(..) , modify , evalStateT , execStateT , StrictState , runState , evalState , execState ) where import Control.Applicative imp...
a2b4e1f12f8bf1ed09aeaa2df8cc374312e906f3cf2cb060391da4b20b51b7fa
Frama-C/Frama-C-snapshot
pretty.ml
(**************************************************************************) (* *) This file is part of WP plug - in of Frama - C. (* *) Copyrigh...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/qed/pretty.ml
ocaml
************************************************************************ alternatives) ...
This file is part of WP plug - in of Frama - C. Copyright ( C ) 2007 - 2019 CEA ( Commissariat a l'energie atomique et aux energies Lesser General Public License as published by the Free Software Foundation ,...
a2f3d6dd5cd49aeec6d8b808e512d8a84d0c8834bc8b5693b323d4385cf62997
scheme/rx
packages.scm
(define-structure error-package (export warn error) (open (subset signals (error warn)))) (define-structure utilities utilities-interface (open bitwise error-package loopholes let-opt scheme records record-types threads threads-internal placeholders locks (subset srfi-1 (fold))) (...
null
https://raw.githubusercontent.com/scheme/rx/dd9037f6f9ea01019390614f6b126b7dd293798d/packages.scm
scheme
Stuff that could appear in code produced by (rx ...) File Exports ---- ------- parse sre->regexp regexp->sre parse-sre parse-sres regexp->scheme char-set->in-pair static-regexp? posixstr regexp->posix-string re-high compile-regexp regexp-search regexp-search? ...
(define-structure error-package (export warn error) (open (subset signals (error warn)))) (define-structure utilities utilities-interface (open bitwise error-package loopholes let-opt scheme records record-types threads threads-internal placeholders locks (subset srfi-1 (fold))) (...
ca4f5a697887e31efaf2daae44f33f56f6a3783b2d10e7ead4c121f8bea7abb4
haroldcarr/learn-haskell-coq-ml-etc
S8AesonBytestring.hs
#!/usr/bin/env stack -- stack --resolver lts-8.12 script # OPTIONS_GHC -fno - warn - missing - signatures # # OPTIONS_GHC -fno - warn - type - defaults # {-# LANGUAGE OverloadedStrings #-} module S8AesonBytestring where import Data.Aeson import Data.ByteString (ByteString) import qua...
null
https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2017-05-snoyman-applied-haskell-at-lambdaconf/S8AesonBytestring.hs
haskell
stack --resolver lts-8.12 script # LANGUAGE OverloadedStrings #
#!/usr/bin/env stack # OPTIONS_GHC -fno - warn - missing - signatures # # OPTIONS_GHC -fno - warn - type - defaults # module S8AesonBytestring where import Data.Aeson import Data.ByteString (ByteString) import qualified Data.ByteString.Base64 as B64 import qualified Data.ByteString.L...
4c0b8f7209b812ff262ff99ba756efba638c6157d3dcb3c3f5f1658d32b0df27
lispbuilder/lispbuilder
library.lisp
;;; -*- lisp -*- (in-package #:lispbuilder-openrm-cffi) #+win32(eval-when (:compile-toplevel :load-toplevel :execute) (pushnew (merge-pathnames "../bin/" (directory-namestring (or *load-truename* *default-pathname-defaults*))) cffi:*foreign-library-directories* :test #'equal)) ( cffi : define - fo...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-openrm/native/library.lisp
lisp
-*- lisp -*- (:windows "OPENGL32.dll") (:unix (:or "libGL")))
(in-package #:lispbuilder-openrm-cffi) #+win32(eval-when (:compile-toplevel :load-toplevel :execute) (pushnew (merge-pathnames "../bin/" (directory-namestring (or *load-truename* *default-pathname-defaults*))) cffi:*foreign-library-directories* :test #'equal)) ( cffi : define - foreign - library G...
d24bc38d59da289b5966fe11f0c14fdec1efb0d3c8ab544142d532390e90538f
show-matz/CL-STL
cl-stl-tuple.lisp
(in-package :cl-stl) #-cl-stl-0x98 (locally (declare (optimize speed)) (defun __make_tuple-from-list (lst) (declare (type cl::list lst)) (let* ((cnt (length lst)) (arr (make-array cnt :initial-element nil))) (declare (type fixnum cnt)) (declare (type simple-vector arr)) (let ((i 0)) (declare (type...
null
https://raw.githubusercontent.com/show-matz/CL-STL/c6ffeac2815fa933121bc4c8b331d9c3516dff88/src/cl-stl-tuple.lisp
lisp
------------------------------------------------------------------------------ tuple ------------------------------------------------------------------------------ ---------------------------------------------------------- constructors ---------------------------------------------------------- default constructor c...
(in-package :cl-stl) #-cl-stl-0x98 (locally (declare (optimize speed)) (defun __make_tuple-from-list (lst) (declare (type cl::list lst)) (let* ((cnt (length lst)) (arr (make-array cnt :initial-element nil))) (declare (type fixnum cnt)) (declare (type simple-vector arr)) (let ((i 0)) (declare (type...
a1e125a62d1570da8fa0017decb95b3697c9091c92e2bbc5306f872d65e3305e
wargrey/graphics
zlib.rkt
#lang typed/racket/base (provide png-test-zlib-decompression) (require "../../base.rkt") (require typed/racket/draw) ;;; (define zlib-decomporess : (-> Path-String PNG) (lambda [src.png] (define z??n2c08.png (collection-file-path src.png "png" "tamer" "schaik")) (time (read-bitmap z??n2c08.png 'unknown/...
null
https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/png/tamer/schaik/zlib.rkt
racket
#lang typed/racket/base (provide png-test-zlib-decompression) (require "../../base.rkt") (require typed/racket/draw) (define zlib-decomporess : (-> Path-String PNG) (lambda [src.png] (define z??n2c08.png (collection-file-path src.png "png" "tamer" "schaik")) (time (read-bitmap z??n2c08.png 'unknown/alpha...
e9132032110e64719d5826fee3e0c237d37a97ecbc3045e125a16d92e01fda1d
fendor/hsimport
ParseTest1.hs
{-# Language PatternGuards #-} module Blub ( blub , foo , bar ) where #include "Foo.h" import Ugah.Foo import Control.Applicative #ifdef FOO import Ugah.Blub #endif f :: Int -> Int f = (+ 3) g :: Int -> Int
null
https://raw.githubusercontent.com/fendor/hsimport/9be9918b06545cfd7282e4db08c2b88f1d8162cd/tests/goldenFiles/ParseTest1.hs
haskell
# Language PatternGuards #
module Blub ( blub , foo , bar ) where #include "Foo.h" import Ugah.Foo import Control.Applicative #ifdef FOO import Ugah.Blub #endif f :: Int -> Int f = (+ 3) g :: Int -> Int
f47d04254ff757310ef40a2419feec61e5d1acfc426ba7e2d333f5606d1ec976
Zetawar/zetawar
router.cljs
(ns zetawar.router (:require [cljs.core.async :refer [<! >! chan offer!]] [datascript.core :as d] [goog.object :as gobj] [zetawar.logging :as log] [zetawar.players :as players]) (:require-macros [cljs.core.async.macros :refer [go go-loop]])) (when-not (exists? js/Raven) (let [stub #js {"capture...
null
https://raw.githubusercontent.com/Zetawar/zetawar/dc1ee8d27afcac1cd98904859289012c2806e58c/src/cljs/zetawar/router.cljs
clojure
TODO: something better than js/console.trace TODO: block with timeout when notifying players Handle event
(ns zetawar.router (:require [cljs.core.async :refer [<! >! chan offer!]] [datascript.core :as d] [goog.object :as gobj] [zetawar.logging :as log] [zetawar.players :as players]) (:require-macros [cljs.core.async.macros :refer [go go-loop]])) (when-not (exists? js/Raven) (let [stub #js {"capture...
c00da0c60c32643af69947d5c1d9b412ac7ac3163240f6a15b94b87d895ba913
borodust/alien-works-demo
bundle.lisp
(cl:defpackage :alien-works-demo.bundle (:use :cl) (:local-nicknames (:awd :alien-works-delivery)) (:export)) (cl:in-package :alien-works-demo.bundle) (awd:defbundle :alien-works-demo :system :alien-works-demo/app :entry-point (:alien-works :run) :assets ((:file (:system "assets/helmet.bin")) (...
null
https://raw.githubusercontent.com/borodust/alien-works-demo/e45b012171271de45dde775e008518ac6861c7e2/bundle/bundle.lisp
lisp
(cl:defpackage :alien-works-demo.bundle (:use :cl) (:local-nicknames (:awd :alien-works-delivery)) (:export)) (cl:in-package :alien-works-demo.bundle) (awd:defbundle :alien-works-demo :system :alien-works-demo/app :entry-point (:alien-works :run) :assets ((:file (:system "assets/helmet.bin")) (...
6afd36195700464d5e13f50ac1f8cc98f89673bae81142d12935f176fc1c31d6
melange-re/melange
gpr_5280_optimize_test.ml
[@@@config { flags = [| "-w"; "@A-70"; (* "-drawlambda"; *) (* "-dtypedtree"; *) "-bs-diagnose" (* "-dparsetree"; *) (* "-dsource"; *) (* "-bs-no-builtin-ppx"; *); |]; }] type color = Orange | Color of string let a = Color "#ffff" let c = match a with Orang...
null
https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/gpr_5280_optimize_test.ml
ocaml
"-drawlambda"; "-dtypedtree"; "-dparsetree"; "-dsource"; "-bs-no-builtin-ppx";
[@@@config { flags = [| "-w"; "@A-70"; "-bs-diagnose" |]; }] type color = Orange | Color of string let a = Color "#ffff" let c = match a with Orange -> "orange" | Color "#ffff" -> "white" | Color s -> s
2ab5a8ad84480e4f36de1cf8c28a38a6f10cdefe754160951f3c49ab6bfdf357
robert-strandh/SICL
condition-reporters-english.lisp
(cl:in-package #:cleavir-literals) (defmethod acclimation:report-condition ((condition object-not-externalizable) stream (language acclimation:english)) (with-accessors ((object object)) condition (format stream "The object ~S is not externalizable." object)))
null
https://raw.githubusercontent.com/robert-strandh/SICL/a443126733755974f0b706c247ae376568d62c18/Code/Cleavir/CST-to-AST/Literals/condition-reporters-english.lisp
lisp
(cl:in-package #:cleavir-literals) (defmethod acclimation:report-condition ((condition object-not-externalizable) stream (language acclimation:english)) (with-accessors ((object object)) condition (format stream "The object ~S is not externalizable." object)))
80837150c26c88da14e99de3af0b5ed9394bfa3057904cb7d0fb93f6a5923c2b
fjames86/winhttp
ffi.lisp
Copyright ( c ) 2017 < > This code is licensed under the MIT license . (in-package #:winhttp) (define-foreign-library winhttp (:windows "WinHttp.dll")) (use-foreign-library winhttp) (defcfun (%format-message "FormatMessageA" :convention :stdcall) :uint32 (flags :uint32) (source :pointer) (msg-id...
null
https://raw.githubusercontent.com/fjames86/winhttp/31fd07c658307272f38e09db5369375364362ecd/ffi.lisp
lisp
struct URL_COMPONENTS { LPWSTR lpszUserName; }; 1==http 2==https 3==ftp? _In_ LPCWSTR pwszUrl, ); HINTERNET WINAPI WinHttpOpen( _In_opt_ LPCWSTR pwszUserAgent, _In_ LPCWSTR pwszProxyName, ); BOOL WINAPI WinHttpCloseHandle( _In_ HINTERNET hInternet ); BOO...
Copyright ( c ) 2017 < > This code is licensed under the MIT license . (in-package #:winhttp) (define-foreign-library winhttp (:windows "WinHttp.dll")) (use-foreign-library winhttp) (defcfun (%format-message "FormatMessageA" :convention :stdcall) :uint32 (flags :uint32) (source :pointer) (msg-id...
d5b506332573fee9c20f6afe1698ca97142f901f292a2cc7f637a7fa05f1195c
ugglan/cljaws
ec2.clj
(ns cljaws.ec2 (:use (cljaws core helpers)) (:import (com.xerox.amazonws.ec2 Jec2 ImageDescription))) ;; ;; Elastic cloud / EC2 ;; (defn list-ec2-images "Returns a sequence of maps containing information about all available EC2 images." [] (let [ec2 (Jec2. *aws-id* *aws-key*)] (map bean (.describ...
null
https://raw.githubusercontent.com/ugglan/cljaws/0df2312d61e6c7d52520479b3c103858c72e9f5b/src/cljaws/ec2.clj
clojure
Elastic cloud / EC2
(ns cljaws.ec2 (:use (cljaws core helpers)) (:import (com.xerox.amazonws.ec2 Jec2 ImageDescription))) (defn list-ec2-images "Returns a sequence of maps containing information about all available EC2 images." [] (let [ec2 (Jec2. *aws-id* *aws-key*)] (map bean (.describeImages ec2 '()))))
fcb4951670ec7b313f380d692c722969a37917ff2f0845f46b0911dea749c38f
mvr/at
SmithNormalFormTest.hs
module SmithNormalFormTest where import Test.Hspec import Test.QuickCheck import Data.List (dropWhileEnd, sort) import Data.Matrix (Matrix) import qualified Data.Matrix as M import qualified Data.Vector as V import Math.Algebra.SmithNormalForm import ArbitraryInstances () isDiagonal :: (Eq a, Num a) => Matrix a ->...
null
https://raw.githubusercontent.com/mvr/at/f08b25ee2d83f761fd288a66f05dad1943879db1/test/SmithNormalFormTest.hs
haskell
module SmithNormalFormTest where import Test.Hspec import Test.QuickCheck import Data.List (dropWhileEnd, sort) import Data.Matrix (Matrix) import qualified Data.Matrix as M import qualified Data.Vector as V import Math.Algebra.SmithNormalForm import ArbitraryInstances () isDiagonal :: (Eq a, Num a) => Matrix a ->...
80ceabdd6cfbed35b2af12c3aba346a729fd27647716928e519baefcb8a9114e
cartazio/tlaps
util.ml
* util.ml --- format utilities * * * Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation * util.ml --- format utilities * * * Copyright (C) 2008-2010 INRIA and Microsoft Corporation *) Revision.f "$Rev: 34678 $";; open Ext open Property open Loc type hint = string wrapped let pp_print...
null
https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/util/util.ml
ocaml
Backend.Toolbox.print_message "error" msg ^"\n"^bugmsg; ***************************************
* util.ml --- format utilities * * * Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation * util.ml --- format utilities * * * Copyright (C) 2008-2010 INRIA and Microsoft Corporation *) Revision.f "$Rev: 34678 $";; open Ext open Property open Loc type hint = string wrapped let pp_print...
b5dc802d015a62308927b6d5c54d284c9f9b8e365ba5fc43f8f68b8b8a508a14
eudoxia0/lucerne
models.lisp
(in-package :cl-user) (defpackage utweet.models (:use :cl) ;; Users (:export :user :user-username :user-full-name :user-password :user-avatar-url) ;; Subscriptions (follows) (:export :subscription :subscription-follower :subscription-followed) ...
null
https://raw.githubusercontent.com/eudoxia0/lucerne/7037f2c20d5bbf7a789bd9fe2e85eb1ed3ef247c/examples/utweet/models.lisp
lisp
Users Subscriptions (follows) Tweets Some functions Storage Functions
(in-package :cl-user) (defpackage utweet.models (:use :cl) (:export :user :user-username :user-full-name :user-password :user-avatar-url) (:export :subscription :subscription-follower :subscription-followed) (:export :tweet :tweet-auth...
50144f572db6c0b60316b62e87b5b88ec0be22aeb8dd2306db68b546e4ee503c
simonmichael/games
caverunner.hs
#!/usr/bin/env stack stack script --optimize --verbosity = warn --resolver = nightly-2021 - 11 - 15 --ghc - options=-threaded --package ansi - terminal --package ansi - terminal - game --package containers --package directory --package extra --package filepath --package pretty - show ...
null
https://raw.githubusercontent.com/simonmichael/games/8b6c0a5e99194e46b190d3a14de9d775e36412ba/caverunner/caverunner.hs
haskell
optimize --verbosity = warn --resolver = nightly-2021 - 11 - 15 ghc - options=-threaded package ansi - terminal package ansi - terminal - game package containers package directory package extra package filepath package pretty - show package pretty - simple package safe package time package typed - process ...
#!/usr/bin/env stack -} way to run this program reliably . On first run the script may seem to hang ( perhaps for minutes ) while downloading and unpacking GHC ; the above haskell packages and a suitable GHC version ( eg 8.10 ) , # OPTIONS_GHC -Wno - missing - signatures -Wno - unused - imports # import Contr...
b027b6049c8550ffecbfd169014d768d4416c5a2b26a4b9b1c466f21b04c9ed5
RBornat/jape
boxdraw.mli
Copyright ( C ) 2003 - 19 This file is part of the proof engine , which is part of . 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 ver...
null
https://raw.githubusercontent.com/RBornat/jape/afe9f207e89e965636b43ef8fad38fd1f69737ae/distrib/camlengine/boxdraw.mli
ocaml
Copyright ( C ) 2003 - 19 This file is part of the proof engine , which is part of . 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 ver...
a2c118f0e0bf4dd1992e115ad02f79550071ce94cdaecb137e2558e953e06797
hasktorch/hasktorch
Jit.hs
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # module Torch.Jit wher...
null
https://raw.githubusercontent.com/hasktorch/hasktorch/7218e00e1fb3b6e85b7f655aa1ba56418f636d37/hasktorch/src/Torch/Jit.hs
haskell
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # module Torch.Jit wher...
b64c6cdcd635a8768e7ab9ae18a18ab29394e3301d3fe3f060869515161593bd
nikita-volkov/rerebase
Bits.hs
module Data.Bits ( module Rebase.Data.Bits ) where import Rebase.Data.Bits
null
https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Data/Bits.hs
haskell
module Data.Bits ( module Rebase.Data.Bits ) where import Rebase.Data.Bits
9069562d1b881b57eb9f02b534e93ac6f50d72bb580ca5c167a430982a4b135c
rtoy/ansi-cl-tests
sublis.lsp
;-*- Mode: Lisp -*- Author : Created : Sat Apr 19 21:32:50 2003 Contains : Tests of (in-package :cl-test) (compile-and-load "cons-aux.lsp") (deftest sublis.1 (check-sublis '((a b) g (d e 10 g h) 15 . g) '((e . e2) (g . 17))) ((a b) 17 (d e2 10 17 h) 15 . 17)) (deftest sublis.2 ...
null
https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/sublis.lsp
lisp
-*- Mode: Lisp -*- Check that a null key arg is ignored. Order of argument evaluation Const fold tests Keyword tests Argument error cases
Author : Created : Sat Apr 19 21:32:50 2003 Contains : Tests of (in-package :cl-test) (compile-and-load "cons-aux.lsp") (deftest sublis.1 (check-sublis '((a b) g (d e 10 g h) 15 . g) '((e . e2) (g . 17))) ((a b) 17 (d e2 10 17 h) 15 . 17)) (deftest sublis.2 (check-sublis '(f6 10 ...
67b278a33baf03b80ef0fad4c721a482ee3787212067dfa16638bd9969152d12
imandra-ai/catapult
clock.mli
val now_us : unit -> float (** Time elapsed since beginning of program, in microseconds *)
null
https://raw.githubusercontent.com/imandra-ai/catapult/4bc5444a8471c5d0d7cb9a376a5a895c0ab042e6/src/core/clock.mli
ocaml
* Time elapsed since beginning of program, in microseconds
val now_us : unit -> float
966df9bd5bf521ce9a9e441852c953a7a6d273e1a6fce7d6229292932b64ac33
Cmdv/Haskell-Interview-Tests
SpaceAge.hs
module SpaceAge (Planet(..), ageOn) where data Planet = Mercury | Venus | Earth | Mars | Jupiter | Saturn | Uranus | Neptune secEarthYear :: Float secEarthYear = 31557600 ageOn :: Planet -> Float -> Float ageOn planet seconds = cas...
null
https://raw.githubusercontent.com/Cmdv/Haskell-Interview-Tests/787bf5e07fdfd37f9eeb8c5a3570b99840d00d4c/src/Exercism/space-age/SpaceAge.hs
haskell
module SpaceAge (Planet(..), ageOn) where data Planet = Mercury | Venus | Earth | Mars | Jupiter | Saturn | Uranus | Neptune secEarthYear :: Float secEarthYear = 31557600 ageOn :: Planet -> Float -> Float ageOn planet seconds = cas...
573e6c984a038c9bc276f7892ae18a993aacf52eec25705a229089fc5e86be3c
alexandergunnarson/quantum
core.cljc
(ns ^{:doc "A very rough and terribly incomplete mini-library for Selenium, especially PhantomJS." :attribution "alexandergunnarson"} quantum.browser.core (:require [com.stuartsierra.component :as comp ] [quantum.core.spec :as s :refer [...
null
https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/browser/core.cljc
clojure
(com.teamdev.jxbrowser.chromium Browser) INSTALLATION PROCEDURE sudo mvn deploy:deploy-file -DgroupId=local -DartifactId=jxbrowser \ -Dversion=5.4.3 -Dpackaging=jar -Dfile=./lib/jxbrowser-5.4.3.jar \ -Durl=file:lib -Dversion=5.4.3 -Dpackaging=jar -Dfile=./lib/jxbrowser-mac-5.4.3.jar \ -Durl=file:lib -Dversion=1...
(ns ^{:doc "A very rough and terribly incomplete mini-library for Selenium, especially PhantomJS." :attribution "alexandergunnarson"} quantum.browser.core (:require [com.stuartsierra.component :as comp ] [quantum.core.spec :as s :refer [...
b8e5582d87f6110c862e5e700cac5b82dfc4724e909213862e3aacab795b2dda
roddyyaga/ocoi
parameters.ml
open Base open Opium module type None = sig type t = unit end module None = struct type t = unit end module type Json = sig type t val t_of_yojson : Yojson.Safe.t -> t end module Json = struct module type Jwt = sig type parameters val parameters_of_yojson : Yojson.Safe.t -> parameters type ...
null
https://raw.githubusercontent.com/roddyyaga/ocoi/0a07e9457add9890cb507ac8bb4e55044d86a640/ocoi/lib/api/parameters.ml
ocaml
open Base open Opium module type None = sig type t = unit end module None = struct type t = unit end module type Json = sig type t val t_of_yojson : Yojson.Safe.t -> t end module Json = struct module type Jwt = sig type parameters val parameters_of_yojson : Yojson.Safe.t -> parameters type ...
ddde47476cb0610616562fe78ad40ade9536f31a1ab3faeba7e5610faf2e46a9
avsm/mirage-duniverse
transaction.ml
* Copyright ( C ) Citrix Systems Inc. * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation ; version 2.1 only . with the special * exception on linking described in file LI...
null
https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/xenstore/server/transaction.ml
ocaml
ok then it doesn't exists in the old version and the current version, just sneak it in as a child of the parent node if it exists, or else fail ok it doesn't exists, just bail out. get the lowest path of the query and verify that it hasn't been modified by others transactions. no reads recorded no ...
* Copyright ( C ) Citrix Systems Inc. * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation ; version 2.1 only . with the special * exception on linking described in file LI...
6cb730f2436ee6e8cfb524a1943fc149d83a40b88bcac3ab0aaad8c0d7b3361c
serras/cat-theory-lambdaconf-wr-2017
Day2.hs
# language MultiParamTypeClasses , FunctionalDependencies # # language FlexibleInstances , TypeSynonymInstances # # language PolyKinds , KindSignatures # # language DataKinds , ConstraintKinds , TypeInType # # language GADTs , RankNTypes # # language TypeOperators # {-# language TypeFamilies #-} {-# language Undecidabl...
null
https://raw.githubusercontent.com/serras/cat-theory-lambdaconf-wr-2017/106a094536bb819eb84668268ea4c6d2d47f50f7/Day2.hs
haskell
# language TypeFamilies # # language UndecidableInstances # ================== ========= ===========
# language MultiParamTypeClasses , FunctionalDependencies # # language FlexibleInstances , TypeSynonymInstances # # language PolyKinds , KindSignatures # # language DataKinds , ConstraintKinds , TypeInType # # language GADTs , RankNTypes # # language TypeOperators # module Day2 where import Data.Kind import Day1 6 ...
aed1a18582b190ff9e4a01bac4d1ccf4cad8c8af5315269f9d1cd8991dca033a
austral/austral
Names.mli
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions . See LICENSE file for details . SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions. See LICENSE file for details. SPDX...
null
https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/Names.mli
ocaml
* This module contains the names of language constructs.
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions . See LICENSE file for details . SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions. See LICENSE file for details. SPDX...
80118326c4e136b5c3f6c4709a152b0fc62932d22e7b139b3f28c5ede9970df0
amperity/ken
trace_test.clj
(ns ken.trace-test (:require [clojure.test :refer [deftest testing is]] [ken.event :as event] [ken.trace :as trace])) (deftest trace-data (testing "no context" (trace/with-data nil (is (nil? (trace/current-data))) (is (nil? (trace/current-trace-id))) (is (nil? (trace/current-span...
null
https://raw.githubusercontent.com/amperity/ken/0dc87a286016aa121ece88ee6cebbc17b890bf7a/test/ken/trace_test.clj
clojure
(ns ken.trace-test (:require [clojure.test :refer [deftest testing is]] [ken.event :as event] [ken.trace :as trace])) (deftest trace-data (testing "no context" (trace/with-data nil (is (nil? (trace/current-data))) (is (nil? (trace/current-trace-id))) (is (nil? (trace/current-span...
a36ecdef6be843df194008a64431347532c4c2c05a7a6c19ddf58e8ebd56371b
haskell-opengl/OpenGLRaw
EnvmapBumpmap.hs
# LANGUAGE PatternSynonyms # -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ATI.EnvmapBumpmap Copyright : ( c ) 2019 -- License : BSD3 -- Maintainer : < > -- Stability : stable -- Portability : portable -- ------------------...
null
https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/ATI/EnvmapBumpmap.hs
haskell
------------------------------------------------------------------------------ | Module : Graphics.GL.ATI.EnvmapBumpmap License : BSD3 Stability : stable Portability : portable ------------------------------------------------------------------------------ * Extension Support * Enums * Functions
# LANGUAGE PatternSynonyms # Copyright : ( c ) 2019 Maintainer : < > module Graphics.GL.ATI.EnvmapBumpmap ( glGetATIEnvmapBumpmap, gl_ATI_envmap_bumpmap, pattern GL_BUMP_ENVMAP_ATI, pattern GL_BUMP_NUM_TEX_UNITS_ATI, pattern GL_BUMP_ROT_MATRIX_ATI, pattern GL_BUMP_ROT_MATRIX_SIZE_ATI, p...
6aadb6297a6bb02b037dcc8f4a2636785aeaaf5ca89127a62367910ef030448e
cedlemo/OCaml-GI-ctypes-bindings-generator
Image.mli
open Ctypes type t val t_typ : t typ val create : unit -> Widget.t ptr val create_from_animation : Pixbuf_animation.t ptr -> Widget.t ptr val create_from_file : string -> Widget.t ptr Not implemented gtk_image_new_from_gicon type interface not implemented val create_from_icon_name : string option -> int32 -> ...
null
https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Image.mli
ocaml
Not implemented gtk_image_get_gicon type interface not implemented Not implemented gtk_image_set_from_gicon type interface not implemented
open Ctypes type t val t_typ : t typ val create : unit -> Widget.t ptr val create_from_animation : Pixbuf_animation.t ptr -> Widget.t ptr val create_from_file : string -> Widget.t ptr Not implemented gtk_image_new_from_gicon type interface not implemented val create_from_icon_name : string option -> int32 -> ...
4f65870a02da56f2fb1e9265ba93adf66888cfcaec7fc17ad4a9bfff6b428607
shakacode/rescript-logger
Lib.ml
open Ppxlib open Ast_helper module Env = struct let level = "RES_LOG" let logger = "RES_LOGGER" let only = "RES_LOG_ONLY" end module Delimiter = struct let key_val = '=' let entries = ',' end module Level = struct type t = | Trace | Debug | Info | Warn | Error let from_string = ...
null
https://raw.githubusercontent.com/shakacode/rescript-logger/d5b014277bc909615d187c5e6f039847102124bb/ppx/lib/Lib.ml
ocaml
TODO: Use Base getters once ppxlib is updated Reason I'm not sure if it's what meant by `input_name`
open Ppxlib open Ast_helper module Env = struct let level = "RES_LOG" let logger = "RES_LOGGER" let only = "RES_LOG_ONLY" end module Delimiter = struct let key_val = '=' let entries = ',' end module Level = struct type t = | Trace | Debug | Info | Warn | Error let from_string = ...
df5fafbd2e8854aeb07292cc868dbca745d00694d4457dd20b13d6cfbb8f6d3f
lilyball/projecteuler-ocaml
prob1.ml
If we list all the natural numbers below 10 that are multiples of 3 or 5 , we get 3 , 5 , 6 and 9 . The sum of these multiples is 23 . Find the sum of all the multiples of 3 or 5 below 1000 . If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these mu...
null
https://raw.githubusercontent.com/lilyball/projecteuler-ocaml/a88ed8355b565ad0726cfcac4916d2b80512da7a/prob1.ml
ocaml
If we list all the natural numbers below 10 that are multiples of 3 or 5 , we get 3 , 5 , 6 and 9 . The sum of these multiples is 23 . Find the sum of all the multiples of 3 or 5 below 1000 . If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these mu...
d15466fb8bc1631124d5d25ba28ffca65dd25b151ab5ba5972e16acb19c369ae
eugeneia/athens
conditions.lisp
;;;; -*- mode: lisp; indent-tabs-mode: nil -*- ;;;; conditions.lisp -- various error conditions (in-package :ironclad) (define-condition ironclad-error (simple-error) ()) (define-condition key-not-supplied (ironclad-error) ((cipher :initarg :cipher :reader cipher)) (:report (lambda (condition stream) ...
null
https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/ironclad-v0.40/src/conditions.lisp
lisp
-*- mode: lisp; indent-tabs-mode: nil -*- conditions.lisp -- various error conditions
(in-package :ironclad) (define-condition ironclad-error (simple-error) ()) (define-condition key-not-supplied (ironclad-error) ((cipher :initarg :cipher :reader cipher)) (:report (lambda (condition stream) (format stream "Cipher ~A requires a key" (cipher condition)))) (:documentation "Signaled ...
f77603c7b73d2fec1b716b38c81c07ed69831f931b1807a2e8af601ad4909334
dktr0/estuary
Estuary.hs
# LANGUAGE RecursiveDo # module Estuary.Test.Estuary where import Reflex.Dom import Data.Time import Control.Concurrent.MVar import Control.Monad (liftM) import Control.Monad.IO.Class (liftIO) import Estuary.WebDirt.WebDirt import Estuary.WebDirt.SuperDirt import Estuary.Protocol.Foreign import Estuary.WebDirt.Sam...
null
https://raw.githubusercontent.com/dktr0/estuary/8bfa63317b44780197f2a34e5d4e858465c7a223/client/src/Estuary/test/Estuary/Test/Estuary.hs
haskell
# LANGUAGE RecursiveDo # module Estuary.Test.Estuary where import Reflex.Dom import Data.Time import Control.Concurrent.MVar import Control.Monad (liftM) import Control.Monad.IO.Class (liftIO) import Estuary.WebDirt.WebDirt import Estuary.WebDirt.SuperDirt import Estuary.Protocol.Foreign import Estuary.WebDirt.Sam...
4ac754d6f8f8c5d0185e9098327b2cff8379d50b4152471454b4fb78b8327fba
vlstill/hsExprTest
simple-3.nok.hs
f = 0
null
https://raw.githubusercontent.com/vlstill/hsExprTest/391fc823c1684ec248ac8f76412fefeffb791865/test/simple-3.nok.hs
haskell
f = 0
fbc2d9d61c692d9ad8c192f8b6ab1c8edc30eaa7911f815840afcfbe4697dfb7
bcc32/advent-of-code
event.ml
open! Core open! Async open! Import type ev = | Begin_shift of int | Sleep | Wake [@@deriving sexp] type t = { event : ev ; minute : int } [@@deriving sexp] let event_re, begin_shift_mark, sleep_mark, wake_mark = let begin_shift_mark, begin_shift = Re.(mark (seq [ str "Guard #"; group (rep1 digit);...
null
https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2018/04/event.ml
ocaml
must be in chronological order
open! Core open! Async open! Import type ev = | Begin_shift of int | Sleep | Wake [@@deriving sexp] type t = { event : ev ; minute : int } [@@deriving sexp] let event_re, begin_shift_mark, sleep_mark, wake_mark = let begin_shift_mark, begin_shift = Re.(mark (seq [ str "Guard #"; group (rep1 digit);...
71217d2fe81c874d80469145f0fe3b56eb86b2d7f821a770fe51ab8c20545884
xapi-project/xen-api-libs
xen_cmdline.ml
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation ; version 2.1 only . with the special * exception on linking describe...
null
https://raw.githubusercontent.com/xapi-project/xen-api-libs/d603ee2b8456bc2aac99b0a4955f083e22f4f314/xen-utils/xen_cmdline.ml
ocaml
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc. * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation ; version 2.1 only . with the special * exception on linking describe...
b466cacf3c71b5e0a6f312381b22ebf7502416035e39de0818d7392dd4d12ee2
pzque/realword-haskell
IfExpr.hs
module IfExpr where -- if表达式 myDrop n xs = if n <= 0 || null xs then xs else myDrop (n - 1) (tail xs)
null
https://raw.githubusercontent.com/pzque/realword-haskell/1da0188a3293fd417740fe12167eebccef4ba626/contents/IfExpr.hs
haskell
if表达式
module IfExpr where myDrop n xs = if n <= 0 || null xs then xs else myDrop (n - 1) (tail xs)
9574b895f6efc3cc72d546482dc724a59fc9e2b70c7f02d04ef2813e6eb7f8ef
csabahruska/jhc-components
IO.hs
module IO ( Handle, HandlePosn, IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode), BufferMode(NoBuffering,LineBuffering,BlockBuffering), SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd), stdin, stdout, stderr, openFile, hClose, hFileSize, hIsEOF, isEOF, hSetBuffering, hGetBuffering, hFlush,...
null
https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/lib/haskell98/IO.hs
haskell
...and what the Prelude exports | The 'bracket' function captures a common allocate, compute, deallocate idiom in which the deallocation step must occur even in the case of an The version of @bracket@ in "Control.Exception" handles all exceptions, and should be used instead. and should be used instead.
module IO ( Handle, HandlePosn, IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode), BufferMode(NoBuffering,LineBuffering,BlockBuffering), SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd), stdin, stdout, stderr, openFile, hClose, hFileSize, hIsEOF, isEOF, hSetBuffering, hGetBuffering, hFlush,...
275ad363979525430a6bd77743da122e411536af0093182e2c6651b6bdc69608
ocaml/dune
dune_util.ml
module Config = Config module Log = Log module Persistent = Persistent module Report_error = Report_error module Stringlike = Stringlike module Stringlike_intf = Stringlike_intf module Value = Value module Build_path_prefix_map = Build_path_prefix_map0 module Flock = Flock module Global_lock = Global_lock open Stdune ...
null
https://raw.githubusercontent.com/ocaml/dune/f6bb45ac4d2f47ce41a349a58c93532cd9cd535e/src/dune_util/dune_util.ml
ocaml
module Config = Config module Log = Log module Persistent = Persistent module Report_error = Report_error module Stringlike = Stringlike module Stringlike_intf = Stringlike_intf module Value = Value module Build_path_prefix_map = Build_path_prefix_map0 module Flock = Flock module Global_lock = Global_lock open Stdune ...
b4c5ddd701dfb631ba6737f20a7c03e5321341532ee4e4cc5067de5600acf4c7
ocaml-ppx/ocaml-migrate-parsetree
ast_402.ml
(**************************************************************************) (* *) (* OCaml Migrate Parsetree *) (* *) ...
null
https://raw.githubusercontent.com/ocaml-ppx/ocaml-migrate-parsetree/4a05cf7a00d84e5f827cc9ae9c75e5dc85126085/src/ast_402.ml
ocaml
************************************************************************ OCaml Migrate Parsetree ...
and , Europe , projet Cristal , INRIA Rocquencourt , LexiFi , projet Cristal , INRIA Rocquencourt Copyright 2017 Institut...
ffad7525c40b119406ad8550b5339f4e9449e2dcd58119fd12151fda54ef15a6
den1k/vimsical
interop.cljs
(ns vimsical.frontend.router.interop (:require [bidi.bidi :as bidi] [clojure.spec.alpha :as s] [pushy.core :as pushy]) (:import (goog.Uri))) ;; ;; * Routes and query-params ;; (defn match-route [routes path] (let [match (bidi/match-route routes path) uri (goog.Uri. path) ...
null
https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/router/interop.cljs
clojure
* Routes and query-params * History NOTE We need to wait until the app is initialized before we init the router, or we'll get a dispatch before we got a chance to setup our db etc. However token to its current value
(ns vimsical.frontend.router.interop (:require [bidi.bidi :as bidi] [clojure.spec.alpha :as s] [pushy.core :as pushy]) (:import (goog.Uri))) (defn match-route [routes path] (let [match (bidi/match-route routes path) uri (goog.Uri. path) query-data (.getQueryData uri) ...
f9ab92cf509b4f44585d8458843582f86522ff6cd104698f8f4343cdd9d90808
tmfg/mmtis-national-access-point
interfaces.cljs
(ns ote.views.admin.interfaces "Admin panel views. Note this has a limited set of users and is not currently localized, all UI text is in Finnish." (:require [cljs-react-material-ui.reagent :as ui] [ote.app.controller.admin :as admin-controller] [clojure.string :as str] [ote.lo...
null
https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/src/cljs/ote/views/admin/interfaces.cljs
clojure
(ns ote.views.admin.interfaces "Admin panel views. Note this has a limited set of users and is not currently localized, all UI text is in Finnish." (:require [cljs-react-material-ui.reagent :as ui] [ote.app.controller.admin :as admin-controller] [clojure.string :as str] [ote.lo...
8166dbec65d4977b5dcbb1d9c43d7bd7952b52d2aed3c99e2edcef02915079be
hipsleek/hipsleek
iincr.ml
#include "xdebug.cppo" open VarGen open Gen open Globals open Wrapper open Others open Exc.GTable open Cformula module CP = Cpure module CF = Cformula INFERENCE CHECK : which kind of inference let is_infer_const sf0 it = let rec recf sf= match sf with | CF.EList el -> List.exists (fun (lbl,sf) -> r...
null
https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/src/iincr.ml
ocaml
add_fnc: - add_pre_shape_relation - add_post_shape_relation | [] -> raise Not_found in [proc.Cast.proc_static_specs] (orig_view, der_view) list subst original view_formual by the new ones with quantifiers let () = proc.Cast.proc_stk_of_static_specs # pop in let inf_props = proc_extract_inf...
#include "xdebug.cppo" open VarGen open Gen open Globals open Wrapper open Others open Exc.GTable open Cformula module CP = Cpure module CF = Cformula INFERENCE CHECK : which kind of inference let is_infer_const sf0 it = let rec recf sf= match sf with | CF.EList el -> List.exists (fun (lbl,sf) -> r...
ab947a92c67678a6d5126024fa7b33beb589bd2c2c5abf17a8efd62fdb230ef4
patricoferris/ocaml-df
df.ml
include Ffi_bindings.M (G)
null
https://raw.githubusercontent.com/patricoferris/ocaml-df/617654587d66f394096277eb952947847cf3649f/ffi/lib/df.ml
ocaml
include Ffi_bindings.M (G)
435de00b2678b1a787ca9b8af9205387ada1228bfba57d0244c42d588876527e
stalefruits/aufi
ring.clj
(ns aufi.ring (:require [aufi.ring [download :as download] [health :as health] [middlewares :as middlewares] [pools :as pools] [upload :as upload]] [ronda.routing :as routing] [ronda.routing [bidi :as bidi] ...
null
https://raw.githubusercontent.com/stalefruits/aufi/def535f9ef958e6ea7273a19524e8f12c832bd59/src/aufi/ring.clj
clojure
(ns aufi.ring (:require [aufi.ring [download :as download] [health :as health] [middlewares :as middlewares] [pools :as pools] [upload :as upload]] [ronda.routing :as routing] [ronda.routing [bidi :as bidi] ...
136b73c0f0f372ed6a91ee3963da27b3740fc174ed88759a1499f326ada0b0ea
fulcrologic/fulcro-rad-demo
authorization.clj
(ns com.example.model.authorization (:require [com.example.components.database-queries :as queries] [com.example.model.timezone :as timezone] [com.fulcrologic.fulcro.server.api-middleware :as fmw] [com.fulcrologic.rad.attributes :as attr] [com.fulcrologic.rad.authorization :as auth] [taoensso....
null
https://raw.githubusercontent.com/fulcrologic/fulcro-rad-demo/28b8c2dd3cd9f9be66a621627d079bb19bd5e53b/src/shared/com/example/model/authorization.clj
clojure
(ns com.example.model.authorization (:require [com.example.components.database-queries :as queries] [com.example.model.timezone :as timezone] [com.fulcrologic.fulcro.server.api-middleware :as fmw] [com.fulcrologic.rad.attributes :as attr] [com.fulcrologic.rad.authorization :as auth] [taoensso....
c670b8f555da7140c096986d659459e58b88ffbd99340a848471143a720a9acb
kvakvs/E4VM
test1.erl
-module(test1). -compile([export_all]). test1() -> map_1(0, {1, 2, 3, test_return_var(4)}). map_1(_, undefined) -> undefined; map_1(F, {K, V, Smaller, Larger}) -> {K, F(K, V), map_1(F, Smaller), map_1(F, Larger)}. test_return_var(X) -> Y = X * 2, Y.
null
https://raw.githubusercontent.com/kvakvs/E4VM/2eac924efad972cfd488f1ad75e2f055cd18bd14/Compiler/testData/test1.erl
erlang
-module(test1). -compile([export_all]). test1() -> map_1(0, {1, 2, 3, test_return_var(4)}). map_1(_, undefined) -> undefined; map_1(F, {K, V, Smaller, Larger}) -> {K, F(K, V), map_1(F, Smaller), map_1(F, Larger)}. test_return_var(X) -> Y = X * 2, Y.
da0ffc93b4e9f9a576259ed022853afb9b13cd5219164609ea963117398cce70
feeley/define-library
when-unless.scm
;; File: when-unless.scm (define-library (when-unless) ;; the following import will be required when syntax-rules is hygienic #; (import (only (gambit) if not begin)) ;; required by expansions of when and unless (export when unless) (begin (define-syntax when (syntax-rules () ...
null
https://raw.githubusercontent.com/feeley/define-library/56a6eda7ef9248751f4cada832edf98f5c6bb469/when-unless.scm
scheme
File: when-unless.scm the following import will be required when syntax-rules is hygienic required by expansions of when and unless
(define-library (when-unless) (import (only (gambit) (export when unless) (begin (define-syntax when (syntax-rules () ((_ test expr expr* ...) (if test (begin expr expr* ...))))) (define-syntax unless (syntax-rules () ((_ test expr expr* ...) (if (not te...
fef6f0f8f12c67824e7d6bc6ffc01d54b931bf40b78fcedad6b8b447c7266871
camsaul/sqlhoney
parse.clj
(ns sql-honey.parse (:require [clojure.java.io :as io] [clojure.string :as str] [clojure.walk :as walk] [instaparse.core :as instaparse] [sql-honey.types :as types])) (def grammar (delay (slurp (io/resource "sql_honey/grammar.bnf")))) (def parser (delay (instapars...
null
https://raw.githubusercontent.com/camsaul/sqlhoney/5343ea6dc197532325688e23010b40c70e2400e8/src/sql_honey/parse.clj
clojure
(defmethod transform :unquoted-unqualified-indentifier [[_ s]] (str/lower-case s)) (defmethod transform :quoted-unqualified-identifier [[_ s]] (quoted s)) (remove-method transform :select-as) (defmethod transform :from-as [[_ table alias]] [table alias]) (defmethod transform :join-source [[_ w...
(ns sql-honey.parse (:require [clojure.java.io :as io] [clojure.string :as str] [clojure.walk :as walk] [instaparse.core :as instaparse] [sql-honey.types :as types])) (def grammar (delay (slurp (io/resource "sql_honey/grammar.bnf")))) (def parser (delay (instapars...
08588c9a05af5a9511fb730e58201edc49d2d5bd59b91b3d139325d6f185eca5
AndreaCrotti/elo
migrate_users.clj
(ns data-migrations.migrate-users (:require [byf.db :as db] [honeysql.core :as sql] [honeysql.helpers :as h] [clojure.java.jdbc :as jdbc] [byf.generators :as gen]) (:import (java.util UUID))) (defn all-players-by-league [] (let [league-ids (map :id (db/load-leag...
null
https://raw.githubusercontent.com/AndreaCrotti/elo/98c4b13b2c4e0605015d5d17a8be6cbb78c3f3f6/resources/data_migrations/migrate_users.clj
clojure
(ns data-migrations.migrate-users (:require [byf.db :as db] [honeysql.core :as sql] [honeysql.helpers :as h] [clojure.java.jdbc :as jdbc] [byf.generators :as gen]) (:import (java.util UUID))) (defn all-players-by-league [] (let [league-ids (map :id (db/load-leag...
0933d5a054439e9bb5ee04572e7ab62507395284f95fc90a81c5db4206a7e311
idubrov/siperl
sip_sup.erl
@author < > %%% @doc Primary application supervisor. %%% %%% @end 2011 - 2012 . See LICENSE file . -module(sip_sup). -behaviour(supervisor). %% API -export([start_link/0]). %% Supervisor callbacks -export([init/1]). -include("sip_common.hrl"). -include("sip_sup_specs.hrl"). %% API -spec start_link() ->...
null
https://raw.githubusercontent.com/idubrov/siperl/251daf3a0d7c7442f56f42cfd6c92764a4f475a7/apps/sip/src/sip_sup.erl
erlang
@doc Primary application supervisor. @end API Supervisor callbacks API Supervisor callbacks
@author < > 2011 - 2012 . See LICENSE file . -module(sip_sup). -behaviour(supervisor). -export([start_link/0]). -export([init/1]). -include("sip_common.hrl"). -include("sip_sup_specs.hrl"). -spec start_link() -> {ok, pid()} | any(). start_link() -> supervisor:start_link(?MODULE, []). @private -...
dfb4a26af27e702b2130dd3f4567271f1173786cee6f0645dc4aca2881a8f0a2
mfikes/fifth-postulate
ns183.cljs
(ns fifth-postulate.ns183) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
null
https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns183.cljs
clojure
(ns fifth-postulate.ns183) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
380257fb81ee38473e636ef8ee88bff8706c3a74cc04863ae1d400e013f3d47f
borkdude/advent-of-cljc
borkdude.cljc
(ns aoc.y2018.d07.borkdude (:refer-clojure :exclude [read-string format]) (:require [aoc.utils :as u :refer [deftest read-string format]] [aoc.y2018.d07.data :refer [input answer-1 answer-2]] [clojure.test :refer [is testing]] [clojure.string :as str] [clojure.set :as set])) (def re #"Step (\w) must...
null
https://raw.githubusercontent.com/borkdude/advent-of-cljc/17c8abb876b95ab01eee418f1da2e402e845c596/src/aoc/y2018/d07/borkdude.cljc
clojure
Scratch
(ns aoc.y2018.d07.borkdude (:refer-clojure :exclude [read-string format]) (:require [aoc.utils :as u :refer [deftest read-string format]] [aoc.y2018.d07.data :refer [input answer-1 answer-2]] [clojure.test :refer [is testing]] [clojure.string :as str] [clojure.set :as set])) (def re #"Step (\w) must...
bcce422492f6fb545532d6196b229555ec0c449c1ebaf6942c5cbc8ec4d5170d
JoeKennedy/fantasy
House.hs
module Handler.House where import Import import Handler.Character (FullCharacter, charactersTable) import qualified Database.Esqueleto as E import Database.Esqueleto ((^.), (?.)) import Text.Blaze (toMarkup) ------------ -- Routes -- ------------ getHousesR :: Handler Html getHousesR = do ho...
null
https://raw.githubusercontent.com/JoeKennedy/fantasy/eb9dc9bf6074be5c5ca951e323c6497676424dda/Handler/House.hs
haskell
---------- Routes -- ---------- ----------- Queries -- -----------
module Handler.House where import Import import Handler.Character (FullCharacter, charactersTable) import qualified Database.Esqueleto as E import Database.Esqueleto ((^.), (?.)) import Text.Blaze (toMarkup) getHousesR :: Handler Html getHousesR = do houses <- getHouses defaultLayout $ d...
e9bf0a9ffb5733a9c3f8f8e31d6312c1b2d4e548983e5602a0946475c3c2ce4f
swarm-game/swarm
Persistence.hs
{-# LANGUAGE OverloadedStrings #-} -- | SPDX - License - Identifier : BSD-3 - Clause -- -- Load/save logic for achievements. module Swarm.Game.Achievement.Persistence where import Control.Arrow (left) import Control.Carrier.Lift (sendIO) import Control.Monad (forM, forM_) import Data.Either (partitionEithers) impor...
null
https://raw.githubusercontent.com/swarm-game/swarm/affc8668b77b7e85d3d23c182a5159df36d17306/src/Swarm/Game/Achievement/Persistence.hs
haskell
# LANGUAGE OverloadedStrings # | Load/save logic for achievements. | Get path to swarm achievements, optionally creating necessary directories. Returns a tuple of warnings and attained achievements.
SPDX - License - Identifier : BSD-3 - Clause module Swarm.Game.Achievement.Persistence where import Control.Arrow (left) import Control.Carrier.Lift (sendIO) import Control.Monad (forM, forM_) import Data.Either (partitionEithers) import Data.Yaml qualified as Y import Swarm.Game.Achievement.Attainment import Swarm...
cf07422ee449bd2dcaf0f6a6c599794641365fc060a5f0b4c3c03224e29fbda5
Ejhfast/Clogger
style.clj
(ns site.style ) (defn style ([nm a-map] (let [myks (keys a-map)] (str nm "{\n" (apply str (map (fn [k] (str "\t" k ":" (a-map k) ";\n")) myks)) "}\n"))) ([type nm a-map] (let [point (cond (= type :class) "." (= type...
null
https://raw.githubusercontent.com/Ejhfast/Clogger/302070ed092824b0e62fac45823d0446bbc04d19/src/site/extras/style.clj
clojure
(ns site.style ) (defn style ([nm a-map] (let [myks (keys a-map)] (str nm "{\n" (apply str (map (fn [k] (str "\t" k ":" (a-map k) ";\n")) myks)) "}\n"))) ([type nm a-map] (let [point (cond (= type :class) "." (= type...
f4c0bfc19e2337cffad9e328c0c1544f9b0fd18ca43766428cf95134882481da
haskell-github/github
IsMergedPull.hs
module CheckIfPullMerged where import qualified Github.PullRequests as Github import Github.Auth main :: IO () main = do mergeResult <- Github.isPullRequestMerged (OAuth "authtoken") "thoughtbot" "paperclip" 575 case mergeResult of (Left err) -> putStrLn $ "Error: " ++ (show err) (Right stat) -> pu...
null
https://raw.githubusercontent.com/haskell-github/github/81d9b658c33a706f18418211a78d2690752518a4/samples/Pulls/IsMergedPull.hs
haskell
module CheckIfPullMerged where import qualified Github.PullRequests as Github import Github.Auth main :: IO () main = do mergeResult <- Github.isPullRequestMerged (OAuth "authtoken") "thoughtbot" "paperclip" 575 case mergeResult of (Left err) -> putStrLn $ "Error: " ++ (show err) (Right stat) -> pu...
97b7df931edd5f95b225f3bd8d39e7b90e500b6d114e666102d6d243e02800b0
huangjs/cl
song-source.lisp
(in-package :com.gigamonkeys.shoutcast) (defclass song () ((file :reader file :initarg :file) (title :reader title :initarg :title) (id3-size :reader id3-size :initarg :id3-size))) (defgeneric find-song-source (type request) (:documentation "Find the song-source of the given type for the given...
null
https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/other-code/practicals-1.0.3/Chapter28/song-source.lisp
lisp
(in-package :com.gigamonkeys.shoutcast) (defclass song () ((file :reader file :initarg :file) (title :reader title :initarg :title) (id3-size :reader id3-size :initarg :id3-size))) (defgeneric find-song-source (type request) (:documentation "Find the song-source of the given type for the given...
8fea270262ded2150196426b18fcd7d77b9a4e0242ec263b81f39d468a0b6a23
avsm/eeww
main.ml
let main ~stdout = Eio.Flow.copy_string "Hello, world!\n" stdout let () = Eio_main.run @@ fun env -> main ~stdout:(Eio.Stdenv.stdout env)
null
https://raw.githubusercontent.com/avsm/eeww/17c68b93536cd382b901ba675411c2f69831fdac/lib/eio/examples/hello/main.ml
ocaml
let main ~stdout = Eio.Flow.copy_string "Hello, world!\n" stdout let () = Eio_main.run @@ fun env -> main ~stdout:(Eio.Stdenv.stdout env)
2d74423d90f3c0e3673b9374f46503db2f64f3f0fba61c7650e10f73a8e3e8de
tlaplus/tlapm
system.ml
* Copyright ( C ) 2012 INRIA and Microsoft Corporation * Copyright (C) 2012 INRIA and Microsoft Corporation *) (** A few system-related functions *) Kill the process tree rooted at the given PID . This is done by parsing the output of " ps x " ( or " ps -l " ) . We do n't use process group...
null
https://raw.githubusercontent.com/tlaplus/tlapm/7eae6cccedab0b36ec6c74ee0ee042f7ea943197/src/system.ml
ocaml
* A few system-related functions Use the wait system call to harvest the dead children processes. *************************************** ignore unknown input
* Copyright ( C ) 2012 INRIA and Microsoft Corporation * Copyright (C) 2012 INRIA and Microsoft Corporation *) Kill the process tree rooted at the given PID . This is done by parsing the output of " ps x " ( or " ps -l " ) . We do n't use process groups because they do n't seem to be avail...
5144745b5ba735505a88732899ce5b7344153c5185e0b29433f50546847726bb
anoma/juvix-circuits
package.lisp
(defpackage #:alu.stepper (:documentation "Provides a code walker for CL that can instrument Stack trace information.") (:shadow #:step #:single) (:use #:common-lisp #:serapeum) (:local-nicknames (#:stack #:alu.stack)) (:export #:single #:body #:mode #:*mode* #:split-declaration)) (defpackage #:alu.stepper...
null
https://raw.githubusercontent.com/anoma/juvix-circuits/51f8ea2db5b1200c400ff1bc6d5f51249afc0073/src/stepper/package.lisp
lisp
(defpackage #:alu.stepper (:documentation "Provides a code walker for CL that can instrument Stack trace information.") (:shadow #:step #:single) (:use #:common-lisp #:serapeum) (:local-nicknames (#:stack #:alu.stack)) (:export #:single #:body #:mode #:*mode* #:split-declaration)) (defpackage #:alu.stepper...
f4a91fe97d490099427a439c414c654cc72ec1bf4acec35ff4867f7636ff05f9
UnixJunkie/parany
test.ml
open Printf let n = 100_000 let inputs = Array.init n (fun i -> i) let counter = ref 0 let demux () = if !counter = n then raise Parany.End_of_input else let res = inputs.(!counter) in incr counter; res let res_counter = ref 0 let results = Array.make n 0 let mux x = results.(!res_counter) <-...
null
https://raw.githubusercontent.com/UnixJunkie/parany/e607995e145cfcb7bc429d1e7e2cfc17cb39af5e/src/test.ml
ocaml
Parany.set_core_pinning true; we test init/finalize only with preserve
open Printf let n = 100_000 let inputs = Array.init n (fun i -> i) let counter = ref 0 let demux () = if !counter = n then raise Parany.End_of_input else let res = inputs.(!counter) in incr counter; res let res_counter = ref 0 let results = Array.make n 0 let mux x = results.(!res_counter) <-...
636cd1161b484f869a28703390d84a051d37e63cf57a928409fd47843656ea48
oofp/Beseder
Classes.hs
# LANGUAGE MultiParamTypeClasses # module Beseder.Base.Internal.Classes ( TaskPoster (..) , GetInstance (..) , CreateFrom (..) ) where import Protolude class (MonadIO q) => TaskPoster q where getTaskPoster :: q (q Bool -> IO ()) class GetInstance a where getInstance :: a class CreateFrom a...
null
https://raw.githubusercontent.com/oofp/Beseder/a0f5c5e3138938b6fa18811d646535ee6df1a4f4/src/Beseder/Base/Internal/Classes.hs
haskell
# LANGUAGE MultiParamTypeClasses # module Beseder.Base.Internal.Classes ( TaskPoster (..) , GetInstance (..) , CreateFrom (..) ) where import Protolude class (MonadIO q) => TaskPoster q where getTaskPoster :: q (q Bool -> IO ()) class GetInstance a where getInstance :: a class CreateFrom a...
8a322393e28737172f546e12e77a889b6f347470cfe93a68fd1ae77fac825a30
input-output-hk/quickcheck-dynamic
SmartShrinking.hs
module Test.QuickCheck.DynamicLogic.SmartShrinking (shrinkSmart) where import Test.QuickCheck -- | This combinator captures the 'smart shrinking' implemented for the -- Smart type wrapper in Test.QuickCheck.Modifiers. shrinkSmart :: (a -> [a]) -> Smart a -> [Smart a] shrinkSmart shr (Smart i x) = take i' ys `ilv` dro...
null
https://raw.githubusercontent.com/input-output-hk/quickcheck-dynamic/aef136ede729a25762aecf95979951c07add817a/quickcheck-dynamic/src/Test/QuickCheck/DynamicLogic/SmartShrinking.hs
haskell
| This combinator captures the 'smart shrinking' implemented for the Smart type wrapper in Test.QuickCheck.Modifiers.
module Test.QuickCheck.DynamicLogic.SmartShrinking (shrinkSmart) where import Test.QuickCheck shrinkSmart :: (a -> [a]) -> Smart a -> [Smart a] shrinkSmart shr (Smart i x) = take i' ys `ilv` drop i' ys where ys = [Smart j y | (j, y) <- [0 ..] `zip` shr x] i' = 0 `max` (i - 2) [] `ilv` bs = bs as `il...
65e8a36b5654c2923664cd4c2bde16402494ce1369be2a897a5d02076f6ed5e0
arttuka/reagent-material-ui
sensor_occupied_two_tone.cljs
(ns reagent-mui.icons.sensor-occupied-two-tone "Imports @mui/icons-material/SensorOccupiedTwoTone as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def sensor-occ...
null
https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/sensor_occupied_two_tone.cljs
clojure
(ns reagent-mui.icons.sensor-occupied-two-tone "Imports @mui/icons-material/SensorOccupiedTwoTone as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def sensor-occ...
694c798d57f8c09bd2f4e00df04c29102d6fd422a486b09f4cb44788d3534fda
ocaml/opam
md5check.ml
let file, md5 = if Array.length Sys.argv <> 3 then ( Printf.eprintf "usage: ocaml %s <file> <md5>\n" Sys.argv.(0); exit 1 ) else Sys.argv.(1), Sys.argv.(2) let md5_of_file = Digest.to_hex (Digest.file file) let () = if md5 <> md5_of_file then ( Printf.eprintf "MD5 for %s differs:\n\ ...
null
https://raw.githubusercontent.com/ocaml/opam/3e6e20a63865e1b5736bfb592b2df5fd837c424f/shell/md5check.ml
ocaml
let file, md5 = if Array.length Sys.argv <> 3 then ( Printf.eprintf "usage: ocaml %s <file> <md5>\n" Sys.argv.(0); exit 1 ) else Sys.argv.(1), Sys.argv.(2) let md5_of_file = Digest.to_hex (Digest.file file) let () = if md5 <> md5_of_file then ( Printf.eprintf "MD5 for %s differs:\n\ ...
20f952e83949c0ff2f761750c0f4c69fcae67cc91d1c68ea9e605cdc1b280b75
pixlsus/registry.gimp.org_static
ff-bokeh.scm
; 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 , either version 3 of the License , or ; (at your option) any later version. ; ; This program is distributed in the hope that it wil...
null
https://raw.githubusercontent.com/pixlsus/registry.gimp.org_static/ffcde7400f402728373ff6579947c6ffe87d1a5e/registry.gimp.org/files/ff-bokeh.scm
scheme
This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GN...
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 Author : Date : 13 - 4 - 2013 Version : 1.0 Required : Gimp 2...
2f909b9f9edac99f47786415c5d5bd2eaac1a6571ca2beeaa04611276d9329b3
magnars/prone
code_trunc.clj
(ns prone.code-trunc "Truncate too big code samples while focusing on a certain line" (:require [clojure.string :as str])) (defn- indented? [str] (re-find #"^\s" str)) (defn- find-top-level-form "Assume that every top-level form (often a function i Clojure, classes in Java) starts on a line with no identati...
null
https://raw.githubusercontent.com/magnars/prone/50ed099bb95ad3dfa6d70d506f62faf0fdccebf8/src/prone/code_trunc.clj
clojure
(ns prone.code-trunc "Truncate too big code samples while focusing on a certain line" (:require [clojure.string :as str])) (defn- indented? [str] (re-find #"^\s" str)) (defn- find-top-level-form "Assume that every top-level form (often a function i Clojure, classes in Java) starts on a line with no identati...
cac6dedc55f0fd274a12388145aed0b162703ff53c5423c8a1d70e8b020e9902
ocsigen/ocsigenserver
authbasic.ml
Ocsigen * * Module authbasic.ml * Copyright ( C ) 2008 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of th...
null
https://raw.githubusercontent.com/ocsigen/ocsigenserver/d468cf464dcc9f05f820c35f346ffdbe6b9c7931/src/extensions/authbasic.ml
ocaml
register_basic_authentication_method Basic authentication with a predefined login/password (example) * Registration of the extension
Ocsigen * * Module authbasic.ml * Copyright ( C ) 2008 * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of th...
187cacf569bd388e94c815d4e97fc9765caf6a6e87e42c3ea809b8282417a9e9
nuvla/api-server
event_test.cljc
(ns sixsq.nuvla.server.resources.spec.event-test (:require [clojure.test :refer [deftest]] [sixsq.nuvla.server.resources.event :as t] [sixsq.nuvla.server.resources.spec.event :as event] [sixsq.nuvla.server.resources.spec.spec-test-utils :as stu])) (def event-timestamp "2015-01-16T08:05:00.00Z") (d...
null
https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/test/sixsq/nuvla/server/resources/spec/event_test.cljc
clojure
mandatory keywords optional keywords
(ns sixsq.nuvla.server.resources.spec.event-test (:require [clojure.test :refer [deftest]] [sixsq.nuvla.server.resources.event :as t] [sixsq.nuvla.server.resources.spec.event :as event] [sixsq.nuvla.server.resources.spec.spec-test-utils :as stu])) (def event-timestamp "2015-01-16T08:05:00.00Z") (d...
19624d169ab42f2db2e0da4bab782218389fb7cd8453d9933c640140842ae5d3
donut-party/datapotato
fluree_test.clj
(ns donut.datapotato.fluree-test (:require [clojure.test :refer [deftest is]] [donut.datapotato.core :as dc] [donut.datapotato.generate-test :as dgt] [donut.datapotato.fluree :as df] [fluree.db.api :as fdb] [malli.generator :as mg])) (def fdb-host ":8090") (defonce conn-atom (atom nil)) ;;--- ;; s...
null
https://raw.githubusercontent.com/donut-party/datapotato/0af48d8e23888a48b876ec852770c15fff8bfb02/datapotato-fluree/test/donut/datapotato/fluree_test.clj
clojure
--- schemas ---
(ns donut.datapotato.fluree-test (:require [clojure.test :refer [deftest is]] [donut.datapotato.core :as dc] [donut.datapotato.generate-test :as dgt] [donut.datapotato.fluree :as df] [fluree.db.api :as fdb] [malli.generator :as mg])) (def fdb-host ":8090") (defonce conn-atom (atom nil)) (def User...
aa7140f71112cab8bed85f493f8170bf5c64bb966c24f3ca68628c5b0821810f
zadean/xqerl
op_numeric_unary_minus_SUITE.erl
-module('op_numeric_unary_minus_SUITE'). -include_lib("common_test/include/ct.hrl"). -export([ all/0, groups/0, suite/0 ]). -export([ init_per_suite/1, init_per_group/2, end_per_group/2, end_per_suite/1 ]). -export(['op-numeric-unary-minusint1args-1'/1]). -export(['op-numeric-unary-minus...
null
https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/op/op_numeric_unary_minus_SUITE.erl
erlang
-module('op_numeric_unary_minus_SUITE'). -include_lib("common_test/include/ct.hrl"). -export([ all/0, groups/0, suite/0 ]). -export([ init_per_suite/1, init_per_group/2, end_per_group/2, end_per_suite/1 ]). -export(['op-numeric-unary-minusint1args-1'/1]). -export(['op-numeric-unary-minus...
1363fb5d89caaf497c19ee844e89285fa7a3f64ab477ae7cecba74d574ebd5d5
racket/racket7
file-position.rkt
#lang racket/base (require "../common/check.rkt" "../host/thread.rkt" "port.rkt" "input-port.rkt" "output-port.rkt" "check.rkt") (provide file-position file-position* do-simple-file-position) (define/who file-position (case-lambda [(p) (do-sim...
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/port/file-position.rkt
racket
#lang racket/base (require "../common/check.rkt" "../host/thread.rkt" "port.rkt" "input-port.rkt" "output-port.rkt" "check.rkt") (provide file-position file-position* do-simple-file-position) (define/who file-position (case-lambda [(p) (do-sim...
172ebed2089f0907bc8da5ac7a1c956e9eb7db1639290556c4339b170ed0e1c5
skanev/playground
43-tests.scm
(require rackunit rackunit/text-ui) (load "../43.scm") (define (square x) (* x x)) (define sicp-1.43-tests (test-suite "Tests for SICP exercise 1.43" (check-equal? ((repeated square 2) 5) 625) )) (run-tests sicp-1.43-tests)
null
https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/tests/43-tests.scm
scheme
(require rackunit rackunit/text-ui) (load "../43.scm") (define (square x) (* x x)) (define sicp-1.43-tests (test-suite "Tests for SICP exercise 1.43" (check-equal? ((repeated square 2) 5) 625) )) (run-tests sicp-1.43-tests)
436783be91a9195d03ba332a81fb7573e2da4b04043470ab5d0a00a8ec53ea44
peterholko/pax_server
mtest.erl
-module(mtest). -export([loop/0, start/0]). start() -> map_port:start(), map_port:load(), get_map_tiles([203,204,205,253,254,255,303,304,305], []), map_port:get(254). % P = spawn(fun() -> loop() end), % P ! {start}, % timer:sleep(500), P ! { tilelist , [ ] } , % timer:sleep(500), ...
null
https://raw.githubusercontent.com/peterholko/pax_server/62b2ec1fae195ff915d19af06e56a7c4567fd4b8/src/mtest.erl
erlang
P = spawn(fun() -> loop() end), P ! {start}, timer:sleep(500), timer:sleep(500),
-module(mtest). -export([loop/0, start/0]). start() -> map_port:start(), map_port:load(), get_map_tiles([203,204,205,253,254,255,303,304,305], []), map_port:get(254). P ! { tilelist , [ ] } , P ! { tile , 1 } . loop() -> receive {start} -> map_port:start(), ...
e617fa90a81685eedebc7e70f87a3ba640ddb6db808388cea1b4aad12107a249
ndaniels/MRFy
V2.hs
# LANGUAGE BangPatterns , GeneralizedNewtypeDeriving , TypeFamilies , MultiParamTypeClasses , FlexibleContexts # # OPTIONS_GHC -Wall -fno - warn - name - shadowing # module V2 ( Tree(..), AA(..), StateLabel(..), FullStateLabel(..) , HMMNode(..), BeginNode(..) , costTree, canFollow , aCostTre...
null
https://raw.githubusercontent.com/ndaniels/MRFy/9b522d991a9bf98a6690f791dc92ad6fe675115c/V2.hs
haskell
damn lie, leaves off the end transition XXX wrong, needs inf cost XXX wrong, needs inf cost memoize here; probably worth trying both Memo.list and also Memo.wrap in the Plan7 scheme. This predicate is symmetric: order doesn't matter. --------- array version ^ 0-origin mvelems :: array index a -> [a] memoize!...
# LANGUAGE BangPatterns , GeneralizedNewtypeDeriving , TypeFamilies , MultiParamTypeClasses , FlexibleContexts # # OPTIONS_GHC -Wall -fno - warn - name - shadowing # module V2 ( Tree(..), AA(..), StateLabel(..), FullStateLabel(..) , HMMNode(..), BeginNode(..) , costTree, canFollow , aCostTre...
3dbcbf53b87b7797728c528281dd15f3f51ab4c4bdd986705261798a50b0777f
grin-compiler/ghc-wpc-sample-programs
AssocList.hs
-- ------------------------------------------------------------ | Module : Data . AssocList Copyright : Copyright ( C ) 2010 License : MIT Maintainer : ( ) Stability : stable Portability : portable Simple key value assocciation list implemented as unordered...
null
https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/hxt-9.3.1.18/src/Data/AssocList.hs
haskell
------------------------------------------------------------ ------------------------------------------------------------ | lookup with default value | lookup with empty list (empty string) as default value | test for existence of a key | add an entry, remove an existing entry before adding the new one at the top...
| Module : Data . AssocList Copyright : Copyright ( C ) 2010 License : MIT Maintainer : ( ) Stability : stable Portability : portable Simple key value assocciation list implemented as unordered list of pairs Module : Data.AssocList Copyright :...
e10aa8a187c92aaa815b8460c8d0e66c4cfcf66ea6df21c2758f7659693c5084
ndmitchell/catch
PhantomType.hs
data Cons data NotCons newtype List a t = List [a] deriving Show nil :: List a NotCons nil = List [] cons :: a -> [a] -> List a Cons cons a as = List (a:as) fromList :: [a] -> List a NotCons fromList xs = List xs safeHead :: List a Cons -> a safeHead (List (a:as)) = a
null
https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/scratch/safe-lists/PhantomType.hs
haskell
data Cons data NotCons newtype List a t = List [a] deriving Show nil :: List a NotCons nil = List [] cons :: a -> [a] -> List a Cons cons a as = List (a:as) fromList :: [a] -> List a NotCons fromList xs = List xs safeHead :: List a Cons -> a safeHead (List (a:as)) = a