_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 |
|---|---|---|---|---|---|---|---|---|
42b4b15b4ce9195134fc27c32145094a774f21bcf57541e7c484a7b4e3d929eb | uw-unsat/serval | define.rkt | #lang rosette
(require
(for-syntax
(only-in racket/syntax format-id))
"../base.rkt")
(provide define-insn)
; The main macro for defining instructions.
(define-syntax (define-insn stx)
(syntax-case stx ()
[(_ (arg ...) #:encode encode [(field ...) op interp] ...)
#'(begin
(struct op (arg... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/arm32/interp/define.rkt | racket | The main macro for defining instructions.
split for type checking
Type checking guards. | #lang rosette
(require
(for-syntax
(only-in racket/syntax format-id))
"../base.rkt")
(provide define-insn)
(define-syntax (define-insn stx)
(syntax-case stx ()
[(_ (arg ...) #:encode encode [(field ...) op interp] ...)
#'(begin
(struct op (arg ...)
#:transparent
#:gu... |
3fb5170212ba075288253e45753f29c86d9b5e8d4c965364a0afdc2399486474 | abhin4v/link | Server.hs | module Link.Server where
import Control.Concurrent
import Control.Exception hiding (handle)
import Control.Monad (forever, join, void)
import Network.Socket ( AddrInfo (..), AddrInfoFlag(..), SocketType(..)
, SocketOption(..), withSocketsDo, accept
, socket... | null | https://raw.githubusercontent.com/abhin4v/link/130ec707f8470a9cfee96378cee2a518fb1eb1d2/src/Link/Server.hs | haskell | module Link.Server where
import Control.Concurrent
import Control.Exception hiding (handle)
import Control.Monad (forever, join, void)
import Network.Socket ( AddrInfo (..), AddrInfoFlag(..), SocketType(..)
, SocketOption(..), withSocketsDo, accept
, socket... | |
abb83b5cc0b6578b483d9c03cdf9e4858c3be7c56d7a2518ac54e862e67f594a | fission-codes/fission | Link.hs | module Fission.Web.Server.Link (mkLink) where
import Servant hiding (route)
import Servant.API.Generic
import qualified Fission.Web.API.Types as Fission
type BasicAPI = ToServantApi Fission.Routes
mkLink :: (IsElem route BasicAPI, HasLink route) => Proxy route -> MkLink route Link
... | null | https://raw.githubusercontent.com/fission-codes/fission/7e69c0da210a77412c96631f5ff7ef1b38240d37/fission-web-server/library/Fission/Web/Server/Link.hs | haskell | module Fission.Web.Server.Link (mkLink) where
import Servant hiding (route)
import Servant.API.Generic
import qualified Fission.Web.API.Types as Fission
type BasicAPI = ToServantApi Fission.Routes
mkLink :: (IsElem route BasicAPI, HasLink route) => Proxy route -> MkLink route Link
... | |
ab760c803ca458f30c28b7c4dfbb288623119b1d7eab256366e376514111e211 | replete-repl/replete-shared | repl.clj | (ns replete.repl)
(defmacro ^:private with-err-str
"Evaluates exprs in a context in which *print-err-fn* is bound to .append
on a fresh StringBuffer. Returns the string created by any nested
printing calls."
[& body]
`(let [sb# (js/goog.string.StringBuffer.)]
(binding [cljs.core/*print-newline* true
... | null | https://raw.githubusercontent.com/replete-repl/replete-shared/8c289b6c8be4eb7ffabcd92a712155b03d8dc665/src/replete/repl.clj | clojure | (ns replete.repl)
(defmacro ^:private with-err-str
"Evaluates exprs in a context in which *print-err-fn* is bound to .append
on a fresh StringBuffer. Returns the string created by any nested
printing calls."
[& body]
`(let [sb# (js/goog.string.StringBuffer.)]
(binding [cljs.core/*print-newline* true
... | |
033bf2fd6215cb1d1614bcd5801462c5788e31e7c2206b0dd82451c86bf8a3af | innoq/statuses | config.clj | {:title "innoQ Status Updates"
:database-path "data/db.json"
:save-interval 2
:http-port 8080
:host "localhost"
:run-mode :prod
; {username} is replaced with the username
:avatar-url "/{username}/avatar/32x32"
;:avatar-url "-user-420.png"
:profile-url-prefix "/"}
| null | https://raw.githubusercontent.com/innoq/statuses/66f3f8c8c88bc6445d63ac29310a93baa2e3cf23/config.clj | clojure | {username} is replaced with the username
:avatar-url "-user-420.png" | {:title "innoQ Status Updates"
:database-path "data/db.json"
:save-interval 2
:http-port 8080
:host "localhost"
:run-mode :prod
:avatar-url "/{username}/avatar/32x32"
:profile-url-prefix "/"}
|
d7609cbd977c6d77c9abeddd531bdda02796972430636298b7f264da0d5ccafc | oakmac/cljs-cheatsheet | util.cljs | (ns cljs-cheatsheet-client.util
(:require
[clojure.walk :refer [keywordize-keys]]
[cognitect.transit :as transit]
[oops.core :refer [ocall oget oset!]]))
;;------------------------------------------------------------------------------
;; Util Functions
;;--------------------------------------------------... | null | https://raw.githubusercontent.com/oakmac/cljs-cheatsheet/93e0b6e59e8d0132ddaf51fe5783801b210700f6/cljs-client/cljs_cheatsheet_client/util.cljs | clojure | ------------------------------------------------------------------------------
Util Functions
------------------------------------------------------------------------------
------------------------------------------------------------------------------
AJAX
-------------------------------------------------------------... | (ns cljs-cheatsheet-client.util
(:require
[clojure.walk :refer [keywordize-keys]]
[cognitect.transit :as transit]
[oops.core :refer [ocall oget oset!]]))
(defn half [n]
(/ n 2))
(defn extract-namespace [full-name]
(let [first-slash-pos (.indexOf full-name "/")]
(subs full-name 0 first-slash-po... |
f749c0286f569cd3ec8171720b362bd6e98b1e822488bacd82cc2efd141c8288 | exercism/common-lisp | lillys-lasagna-test.lisp | ;; Ensures that lillys-lasagna.lisp and the testing library are always loaded
(eval-when (:compile-toplevel :load-toplevel :execute)
(load "lillys-lasagna")
(ql:quickload :fiveam))
Defines the testing package with symbols from - lasagna and FiveAM in scope
;; The `run-tests` function is exported for use by both... | null | https://raw.githubusercontent.com/exercism/common-lisp/3f2a0da01cb82ef08ec5ef8c2e8f7cec627155d9/exercises/concept/lillys-lasagna/lillys-lasagna-test.lisp | lisp | Ensures that lillys-lasagna.lisp and the testing library are always loaded
The `run-tests` function is exported for use by both the user and test-runner
Enter the testing package
Define and enter a new FiveAM test-suite
Test helper function | (eval-when (:compile-toplevel :load-toplevel :execute)
(load "lillys-lasagna")
(ql:quickload :fiveam))
Defines the testing package with symbols from - lasagna and FiveAM in scope
(defpackage :lillys-lasagna-test
(:use :cl :fiveam :lillys-lasagna)
(:export :run-tests))
(in-package :lillys-lasagna-test)
(de... |
3cce8e0096a7dcdb0fb38557c9da7bef73bc0f6b9594e238dd747cc8c297ce9f | geocaml/ocaml-topojson | topojson.ml | (* Implentation of TopoJSON Objects *)
module Intf = Topojson_intf
module type S = Topojson_intf.S
module type Json = Topojson_intf.Json
let ( let* ) = Result.bind
let decode_or_err f v =
match f v with Ok x -> x | Error (`Msg m) -> failwith m
module Make (J : Intf.Json) = struct
type json = J.t
let bbox_to... | null | https://raw.githubusercontent.com/geocaml/ocaml-topojson/0b820bdb867fb2932e7ef2cd69ad2e31423acca2/src/topojson/topojson.ml | ocaml | Implentation of TopoJSON Objects |
module Intf = Topojson_intf
module type S = Topojson_intf.S
module type Json = Topojson_intf.Json
let ( let* ) = Result.bind
let decode_or_err f v =
match f v with Ok x -> x | Error (`Msg m) -> failwith m
module Make (J : Intf.Json) = struct
type json = J.t
let bbox_to_json_or_empty = function
| None ->... |
65fa90f1ca30a272a661978e5accbd844e91d3d5ac68ab7cee4b8eb6acd26293 | hidaris/thinking-dumps | 02_racket_basics.rkt | #lang racket
(provide (all-defined-out))
val x = 3
(define y (+ x 2)) ; + is a function, call it here
(define cube1
(lambda (x)
(* x (* x x))))
(define cube2
(lambda (x)
(* x x x)))
(define (cube3 x)
(* x x x))
x to the yth power ( y must be nonegative )
(if (= y 0)
1
(* x (pow1 x... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/cse341/racket/02_racket_basics.rkt | racket | + is a function, call it here | #lang racket
(provide (all-defined-out))
val x = 3
(define cube1
(lambda (x)
(* x (* x x))))
(define cube2
(lambda (x)
(* x x x)))
(define (cube3 x)
(* x x x))
x to the yth power ( y must be nonegative )
(if (= y 0)
1
(* x (pow1 x (- y 1)))))
(define pow2
(lambda (x)
(lambd... |
852aa9f511c9e75cb20e444ffa0796c2b0cc7b5eefa6b06e271a1ff75ae4ce3a | Timothy-G-Griffin/cc_cl_cam_ac_uk | free_vars.ml | open Ast
let rec inlist x = function
| [] -> false
| y :: rest -> if x = y then true else inlist x rest
(* free_vars (bvars, e) returns a
list, with no duplicates, of all free variables
of e that are not in the list bvars.
*)
let free_vars(bvars, exp) =
let rec aux bound free = function
... | null | https://raw.githubusercontent.com/Timothy-G-Griffin/cc_cl_cam_ac_uk/aabaf64c997301ea69060a1b69e915b9d1031573/slang/free_vars.ml | ocaml | free_vars (bvars, e) returns a
list, with no duplicates, of all free variables
of e that are not in the list bvars.
| open Ast
let rec inlist x = function
| [] -> false
| y :: rest -> if x = y then true else inlist x rest
let free_vars(bvars, exp) =
let rec aux bound free = function
| Var x -> if (inlist x bound) || (inlist x free) then free else x :: free
| UnaryOp(_, e) -> aux bound free ... |
10e0f239dc358122bf0c8287131f9c4413c45940ef3754ec6a329f5a8dd288b5 | andrejbauer/plzoo | type_check.ml | (** Type checking. *)
type ctype =
| CFree of vtype (** free type [F s] *)
| CArrow of vtype * ctype (** Function type [s -> t] *)
and vtype =
| VInt (** integer [int] *)
| VBool (** booleans [bool] *)
| VForget of ctype (** thunked type [U t] *)
le... | null | https://raw.githubusercontent.com/andrejbauer/plzoo/ae6041c65baf1eebf65a60617819efeb8dcd3420/src/levy/type_check.ml | ocaml | * Type checking.
* free type [F s]
* Function type [s -> t]
* integer [int]
* booleans [bool]
* thunked type [U t]
* [vtype_of ctx e] computes the value type of an expression [e] in context [ctx].
It raises type error if [e] does not have a value type.
* [ctype_of ctx e] computes the computation type of a co... |
type ctype =
and vtype =
let type_error ?loc = Zoo.error ~kind:"Typing error" ?loc
let rec print_vtype ?max_level vty ppf =
match vty with
| VInt -> Format.fprintf ppf "int"
| VBool -> Format.fprintf ppf "bool"
| VForget cty ->
Zoo.print_parens ?max_level ~at_level:2 ppf
"U@ %t"
... |
5a515ccab26a2cd88771f26ed71f53b2d14632aacc06427fe4e6962c21f726ef | repl-electric/cassiopeia | project.clj | (defproject stars "0.1.0-SNAPSHOT"
:description "Repl Electric: Cassiopeia"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[overtone "0.9.1"]
[mud "0.1.0-SNAPSHOT"]
[korg-nano-kontrol2 "0.1.0-SNAPSHO... | null | https://raw.githubusercontent.com/repl-electric/cassiopeia/a42c01752fc8dd04ea5db95c8037f393c29cdb75/project.clj | clojure | [shadertone "0.2.4"]
Minimum and maximum sizes of the
heap
conjunction with
the concurrent garbage collector
Enable multi-threaded concurrent
gc work (ParNewGC)
gc pauses
minimize pauses
Specify the max and min size of
the new
generation to be small
Uses thread-local object
allocation blocks. This
impr... | (defproject stars "0.1.0-SNAPSHOT"
:description "Repl Electric: Cassiopeia"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[overtone "0.9.1"]
[mud "0.1.0-SNAPSHOT"]
[korg-nano-kontrol2 "0.1.0-SNAPSHO... |
590d4c6b26c4359dc271a262570f78dc33d37f202d47bda2f04a2eb49e1259c2 | jrm-code-project/LISP-Machine | udasm.lisp | -*- Mode : LISP ; Package : LAMBDA ; : CL ; Base:8 -*-
;;;;;;;;;;;;;;;;;;;;;
;;; Does this look ugly? Use a landscape.
;;;;;;;;;;;;;;;;;;;;;
(defconstant *dont-count-these-instructions-in-those-that-have-no-predecessors*
'(HIGHEST-KERNAL-UCODE-LOCATION)
"Anything on this list is not included in the ... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/jrm/udasm.lisp | lisp | Package : LAMBDA ; : CL ; Base:8 -*-
Does this look ugly? Use a landscape.
following forms are meaningful:
(args <reg1> <reg2> ..) ;this subroutine takes args in these regs.
(values <reg1> <reg2> ..) ;this subroutine returns values here
(clobbers <reg1> <reg2> ..);clobbers or may clobber these. the ser... |
(defconstant *dont-count-these-instructions-in-those-that-have-no-predecessors*
'(HIGHEST-KERNAL-UCODE-LOCATION)
"Anything on this list is not included in the *instructions-without-predecessors*.")
(defparameter *default-scanning-distance* 10. "Declarations can be this far ahead of applicable instruct... |
5d2cf38298830286e77e904d5017e3082d142f42d9f986dfa84d74ed9fec684c | patricoferris/sesame | responsive.ml | module Images = struct
type t = MaxWidth of int * int * t | Default of int
type conf = { root : Fpath.t; conf : Image.Transform.conf }
let rec get_default_size = function
| Default i -> i
| MaxWidth (_, _, xs) -> get_default_size xs
let rec get_sizes = function
| Default i -> [ float_of_int i ]
... | null | https://raw.githubusercontent.com/patricoferris/sesame/8521e2a086b49d0bc20f0fca705f07675c52e1ae/src/sesame/responsive.ml | ocaml | module Images = struct
type t = MaxWidth of int * int * t | Default of int
type conf = { root : Fpath.t; conf : Image.Transform.conf }
let rec get_default_size = function
| Default i -> i
| MaxWidth (_, _, xs) -> get_default_size xs
let rec get_sizes = function
| Default i -> [ float_of_int i ]
... | |
9619201ed08dfcd5cdda35347aa596f3633287a43625df5ec69f9daa1d8852c0 | softwarelanguageslab/maf | R5RS_scp1_multiply-3.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((rec-multiply (lambda (a b)
(if (zero? b) 0 (+ a (rec-multiply a (- b 1))))))
(iter-multiply (lambda (a b)
(<change>
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_multiply-3.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 1
* swaps : 0
(letrec ((rec-multiply (lambda (a b)
(if (zero? b) 0 (+ a (rec-multiply a (- b 1))))))
(iter-multiply (lambda (a b)
(<change>
()
(display (lambda (result coun... |
d48d5e6abc963e7375f8a2614bfa314382ac7a6125233b01535db259400d1662 | noinia/hgeometry | RayTracer.hs | module Demo.RayTracer where
-- import Algorithms.Geometry.HiddenSurfaceRemoval (compareDepthOrder, Tri)
import Data.Ord (comparing)
import qualified Data.List as List
import Data.Maybe (mapMaybe)
import Data.Ext
import Control.Lens
import Geometry.Line
import ... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-examples/src/Demo/RayTracer.hs | haskell | import Algorithms.Geometry.HiddenSurfaceRemoval (compareDepthOrder, Tri)
------------------------------------------------------------------------------
^ Screen size (i.e. number of pixels)
and their distance from p.
| reports the intersection point with the squared distance to the intersection point
intersectT ... | module Demo.RayTracer where
import Data.Ord (comparing)
import qualified Data.List as List
import Data.Maybe (mapMaybe)
import Data.Ext
import Control.Lens
import Geometry.Line
import Geometry.Point
import Geometry.Vector
import Geometry.T... |
9a43d56a2fc17bd709bceedf1ec5823d7bbd7ec33155349ad5df50df2cc38866 | larcenists/larceny | intern.scm | intern.scm - private api functions for Sassy
Copyright ( C ) 2005
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any l... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/intern.scm | scheme | This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library 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 t... | intern.scm - private api functions for Sassy
Copyright ( C ) 2005
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA
Sunnyside , ... |
95705eddbdaf151d7ec8f12a94c0cba57e40fa9ed2c566ea0723a1a235fc0b2f | Elzair/nazghul | player.scm | ;;----------------------------------------------------------------------------
;; test/player.scm - basic player setup
;;
;; This will create a basic player character and party for testing. Test
;; scripts can customize it by adding party member and equipment afterwards.
;; ---------------------------------------------... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.002/test/player.scm | scheme | ----------------------------------------------------------------------------
test/player.scm - basic player setup
This will create a basic player character and party for testing. Test
scripts can customize it by adding party member and equipment afterwards.
---------------------------------------------------------... |
(kern-mk-char
starting str / int / dex
hit points ( kernel will set to shortly )
mana points ( kernel will set to shortly )
)
(bind
(kern-mk-player
turns to next meal ( 5 hours )
(kern-mk-inventory nil)
)
(tbl-mk))
(kern-party-add-member player ch_wanderer)
|
95d77cb1f49517fe28fc120b7db1d1199ae0509700b78c07199ae1b66299da0a | puppetlabs/pcp-broker | connection_test.clj | (ns puppetlabs.pcp.broker.connection-test
(:require [clojure.test :refer :all]
[puppetlabs.pcp.broker.connection :refer :all]))
(deftest make-connection-test
(testing "It returns a map that matches represents a new socket"
(let [socket (make-connection :dummy-ws {:encode identity :decode identity} ... | null | https://raw.githubusercontent.com/puppetlabs/pcp-broker/7806c6a6045c406c256b2c9d6129382923ba3d03/test/unit/puppetlabs/pcp/broker/connection_test.clj | clojure | (ns puppetlabs.pcp.broker.connection-test
(:require [clojure.test :refer :all]
[puppetlabs.pcp.broker.connection :refer :all]))
(deftest make-connection-test
(testing "It returns a map that matches represents a new socket"
(let [socket (make-connection :dummy-ws {:encode identity :decode identity} ... | |
245e6533bc229f7cdfcc7785c095762b6f895f4f342a1a74b057fcf5d2a77df6 | senapk/funcional_arcade | brena.hs | import Data.List
import Data.Maybe
ehPrimo x
| (length [y | y <- [1..x], x `mod` y == 0]) > 2 = False
| otherwise = True
primos = [y | y <- [2,3..] , ehPrimo y]
pegarTantos :: Int -> [Int] -> [Int]
pegarTantos x = takeWhile (< x)
fatoracao x = [y | y <- pegarTantos x primos, x `mod` y == 0]
expoen... | null | https://raw.githubusercontent.com/senapk/funcional_arcade/7bfbd3d1407c5c8013550691d4fa048d74a53339/base/076/brena.hs | haskell | import Data.List
import Data.Maybe
ehPrimo x
| (length [y | y <- [1..x], x `mod` y == 0]) > 2 = False
| otherwise = True
primos = [y | y <- [2,3..] , ehPrimo y]
pegarTantos :: Int -> [Int] -> [Int]
pegarTantos x = takeWhile (< x)
fatoracao x = [y | y <- pegarTantos x primos, x `mod` y == 0]
expoen... | |
818278e4e0c972712e2de76fce8f9b30b682e0a38b184e95026104290c21d164 | CryptoKami/cryptokami-core | NtpCheck.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE ScopedTypeVariables #
module Pos.NtpCheck
( mkNtpStatusVar
, ntpSettings
, withNtpCheck
, NtpStatus(..)
, NtpCheckMonad
) where
import Universum
import Control.Monad.Trans.Control (MonadBaseControl)
import qualified Data.List... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/NtpCheck.hs | haskell | # LANGUAGE DataKinds # | # LANGUAGE ScopedTypeVariables #
module Pos.NtpCheck
( mkNtpStatusVar
, ntpSettings
, withNtpCheck
, NtpStatus(..)
, NtpCheckMonad
) where
import Universum
import Control.Monad.Trans.Control (MonadBaseControl)
import qualified Data.List.NonEmpty as NE
import Data... |
68a0b7894771f1cf2fbc1e366af6e8a708665fa14ca8cf8f4b5fe65f0825a926 | ucsd-progsys/nate | jg_text.mli | (*************************************************************************)
(* *)
(* Objective Caml LablTk library *)
(* *)
,... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/browser/jg_text.mli | ocaml | ***********************************************************************
Objective Caml LablTk library
... | , Kyoto University RIMS
Copyright 1999 Institut National de Recherche en Informatique et
en Automatique and Kyoto University . All rights reserved .
This file is distributed under the terms of the GNU Library
$ I d : jg_text.mli , v 1.7 2001/12/... |
3dc4325f8893a4b177ba97df324b86a4bdd57aaa482f3cc4dca1bc263c468e21 | ocaml-flambda/ocaml-jst | main.ml | TEST
readonly_files = " foo.ml "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
module = " foo.ml "
* * * ocaml with ocamlcommon
ocaml_script_as_argument = " true "
test_file = " gen_cached_cmi.ml "
arguments = " cached_cmi.ml "
* * * * ocamlc.byte
module = " "
program = " $ { test_build_... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/1bb6c797df7c63ddae1fc2e6f403a0ee9896cc8e/testsuite/tests/self-contained-toplevel/main.ml | ocaml | Make sure it's no longer available on disk | TEST
readonly_files = " foo.ml "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
module = " foo.ml "
* * * ocaml with ocamlcommon
ocaml_script_as_argument = " true "
test_file = " gen_cached_cmi.ml "
arguments = " cached_cmi.ml "
* * * * ocamlc.byte
module = " "
program = " $ { test_build_... |
0035b393294fa9367e46ef65dc59190ef1092a8b7fae4fb0fb7a1b3c8daf5a0a | austinhaas/kanren | tests.cljc | (ns pettomato.kanren.muKanren.tests
(:refer-clojure :exclude [==])
(:require
[clojure.test :refer [is deftest]]
[pettomato.kanren.util.llist :refer [empty-llist llist llist* llist->seq lcons]]
[pettomato.kanren.muKanren.types :refer [lvar]]
[pettomato.kanren.muKanren.core :refer [empty-s ext-s unify wal... | null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/test/pettomato/kanren/muKanren/tests.cljc | clojure | =============================================================================
unify
-----------------------------------------------------------------------------
nil
-----------------------------------------------------------------------------
object
--------------------------------------------------------------... | (ns pettomato.kanren.muKanren.tests
(:refer-clojure :exclude [==])
(:require
[clojure.test :refer [is deftest]]
[pettomato.kanren.util.llist :refer [empty-llist llist llist* llist->seq lcons]]
[pettomato.kanren.muKanren.types :refer [lvar]]
[pettomato.kanren.muKanren.core :refer [empty-s ext-s unify wal... |
c195284cf99ba4b56bdb24d22dca767ec6b31ece0164497965c53a5b5c143aef | jfmcbrayer/germinal | middleware.lisp | (in-package :germinal)
(defun basic-logging (handler)
"Middleware that logs requests to *standard-output*."
(lambda (request)
(let ((response (funcall handler request)))
(format
*standard-output*
"[~A] ~A \"~A\" ~A ~A ~%"
(local-time:now)
(usocket:host-to-hostname (request-cli... | null | https://raw.githubusercontent.com/jfmcbrayer/germinal/cfc5d3b6a81cc47fd01d4a67decd07ec81eef048/middleware.lisp | lisp | (in-package :germinal)
(defun basic-logging (handler)
"Middleware that logs requests to *standard-output*."
(lambda (request)
(let ((response (funcall handler request)))
(format
*standard-output*
"[~A] ~A \"~A\" ~A ~A ~%"
(local-time:now)
(usocket:host-to-hostname (request-cli... | |
8d0fe058c37d9ebe0345eb7d81cd46159b163a6a2da0cd95b09290e44e0d495e | Andromedans/andromeda | external.mli | (** Lookup an external value, if it exists. *)
val lookup : string -> Runtime.value option
| null | https://raw.githubusercontent.com/Andromedans/andromeda/a5c678450e6c6d4a7cd5eee1196bde558541b994/src/runtime/external.mli | ocaml | * Lookup an external value, if it exists. | val lookup : string -> Runtime.value option
|
2d6d8e6ad013b0adc772ea0f3a5412fba852ee64cde2397b3b4d49494988315c | caisah/sicp-exercises-and-examples | ex_2.83.scm | ;; Suppose you are designing a generic arithmetic system for dealing with the tower of
types shown in . : integer , rational , real , complex . For each type ( except complex ) ,
design a procedure that raises objects of that type one level in the tower . Show how
;; to install a generic raise operation that will ... | null | https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/2.5.2-combining_data_of_different_types/ex_2.83.scm | scheme | Suppose you are designing a generic arithmetic system for dealing with the tower of
to install a generic raise operation that will work for each type (except complex). | types shown in . : integer , rational , real , complex . For each type ( except complex ) ,
design a procedure that raises objects of that type one level in the tower . Show how
(define (raise x) apply-generic 'raise x)
(put 'raise 'integer
(lambda (n) (make-rational n 1)))
(put 'raise 'rational
(... |
f00c5546ee7843ee59fe30a37faba6d6fdac8bcfc2037de0fc01a94a733ed20f | geophf/1HaskellADay | Exercise.hs | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Y2018.M04.D18.Exercise where
Picking up where we left off on the World Policy Journal articles , see , e.g. :
import Y2018.M04.D02.Exercise
-- I realized I never stored the Raw JSON. We need to do that, in case we mess
-- up along the way, we can always go back ... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M04/D18/Exercise.hs | haskell | I realized I never stored the Raw JSON. We need to do that, in case we mess
up along the way, we can always go back to the source JSON and see what went
wrong.
you can work either with the json stored locally:
or you can download some fresh articles from the REST endpoint:
id as the json_id for inserting the even... | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Y2018.M04.D18.Exercise where
Picking up where we left off on the World Policy Journal articles , see , e.g. :
import Y2018.M04.D02.Exercise
import Data.Aeson
import Data.Aeson.Encode.Pretty
import Database.PostgreSQL.Simple
import Database.PostgreSQL.Simple.Sq... |
6d3bb37b80353ffa3bf0c1f10f28c4f7a9a5fb45695245acf031018d6890e3de | silkapp/rest | DashedName.hs | # LANGUAGE ScopedTypeVariables #
module Api.Test.DashedName (resource) where
import Control.Monad.Reader
import Control.Monad.Trans.Except
import Rest
import qualified Rest.Resource as R
import Api.Test (WithText)
type SiteId = String
type WithSiteSubscription = ReaderT SiteId WithText
resource :: Resource WithTex... | null | https://raw.githubusercontent.com/silkapp/rest/f0462fc36709407f236f57064d8e37c77bdf8a79/rest-example/example-api/Api/Test/DashedName.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Api.Test.DashedName (resource) where
import Control.Monad.Reader
import Control.Monad.Trans.Except
import Rest
import qualified Rest.Resource as R
import Api.Test (WithText)
type SiteId = String
type WithSiteSubscription = ReaderT SiteId WithText
resource :: Resource WithTex... | |
bb7f294dc8623a9af62dcf19be51b1e4dcd41bdd1aa8675b6a975fd7ac415fda | project-oak/hafnium-verification | ProcAttributes.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/IR/ProcAttributes.ml | ocaml | * Attributes of a procedure.
* Type for ObjC accessors
* visibility access
* name and type of variables captured in blocks
* exceptions thrown by the procedure
* name and type of formal parameters
* list of indices of formals that are const-qualified
* the procedure is abstract
* the procedure is a model for th... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
b41e514e7b00646a38e45507035927e933e1525c692af6363ea41c14bb5c98a6 | timbod7/haskell-chart | ExampleStocks.hs | module ExampleStocks where
import Data.Time.Calendar
import Data.Time.LocalTime
mkDate :: Integer -> LocalTime
mkDate jday =
LocalTime (ModifiedJulianDay jday) midnight
Price data imported from Yahoo : low , open , close , high
pricesAAPL :: [(LocalTime,(Double,Double,Double,Double))]
pricesMSFT :: [(LocalTime,(... | null | https://raw.githubusercontent.com/timbod7/haskell-chart/692fe212039abac07acdda8ce5956f1a155bbe6c/wiki-examples/ExampleStocks.hs | haskell | module ExampleStocks where
import Data.Time.Calendar
import Data.Time.LocalTime
mkDate :: Integer -> LocalTime
mkDate jday =
LocalTime (ModifiedJulianDay jday) midnight
Price data imported from Yahoo : low , open , close , high
pricesAAPL :: [(LocalTime,(Double,Double,Double,Double))]
pricesMSFT :: [(LocalTime,(... | |
d1c70decc0df6647a70477ccd95651b5a36e4dbaaf8958cba043673df9ec1b53 | didierverna/declt | package.lisp | ;;; package.lisp --- Package documentation
Copyright ( C ) 2010 - 2013 , 2015 - 2017 , 2020 - 2022
Author : < >
This file is part of Declt .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright noti... | null | https://raw.githubusercontent.com/didierverna/declt/2da3df1d07ca1e2dfbd0ec07a1d465c0b6eadb84/core/src/doc/package.lisp | lisp | package.lisp --- Package documentation
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MER... |
Copyright ( C ) 2010 - 2013 , 2015 - 2017 , 2020 - 2022
Author : < >
This file is part of Declt .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PR... |
e7f8354a50364e539792dd610a6ca0179edcf8abd5c056f93244ad6772cd418a | lorepub/moot | devel.hs | {-# LANGUAGE PackageImports #-}
import "moot" Application (develMain)
import Prelude (IO)
main :: IO ()
main = develMain
| null | https://raw.githubusercontent.com/lorepub/moot/793c72d046762ec01a250416667e041b35eec7f8/app/devel.hs | haskell | # LANGUAGE PackageImports # | import "moot" Application (develMain)
import Prelude (IO)
main :: IO ()
main = develMain
|
98fb8b4a9b33e102deac96192daa0a91649791a4b914d62f858db32499ef7e65 | input-output-hk/cardano-ledger-byron | Slotting.hs | module Cardano.Chain.Slotting
( module X
)
where
import Cardano.Chain.Slotting.EpochAndSlotCount as X
import Cardano.Chain.Slotting.EpochNumber as X
import Cardano.Chain.Slotting.EpochSlots as X
import Cardano.Chain.Slotting.SlotCount as X
import Cardano.Chain.Slotting.SlotNumber as X
| null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/src/Cardano/Chain/Slotting.hs | haskell | module Cardano.Chain.Slotting
( module X
)
where
import Cardano.Chain.Slotting.EpochAndSlotCount as X
import Cardano.Chain.Slotting.EpochNumber as X
import Cardano.Chain.Slotting.EpochSlots as X
import Cardano.Chain.Slotting.SlotCount as X
import Cardano.Chain.Slotting.SlotNumber as X
| |
cb34f8586dc8d6672d1cca8110a6f54039f481df89d513b166c68187733137c5 | herd/herdtools7 | runTest.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/574c59e111deda09afbba1f2bdd94353f437faaf/herd/runTest.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2023 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
9b968278a0360d17a35c8c12c97a79170b386542c82c9e479e4afbc790ca4aec | Cumulus/Syndic | syndic_xml.ml | type dtd = string option
module Error = Syndic_error
type pos = Xmlm.pos
type tag = Xmlm.tag
type t = Node of pos * tag * t list | Data of pos * string
let resolve ~xmlbase uri =
match xmlbase with None -> uri | Some b -> Uri.resolve "" b uri
Specialized version of the Xmlm.make_input one .
let input_of_channel... | null | https://raw.githubusercontent.com/Cumulus/Syndic/7a70e3062e42f9ee0ec77f282e1924736b0dff2a/lib/syndic_xml.ml | ocaml | Xmlm.make_input does not raise any exception.
Xmlm.make_output does not raise any exception. | type dtd = string option
module Error = Syndic_error
type pos = Xmlm.pos
type tag = Xmlm.tag
type t = Node of pos * tag * t list | Data of pos * string
let resolve ~xmlbase uri =
match xmlbase with None -> uri | Some b -> Uri.resolve "" b uri
Specialized version of the Xmlm.make_input one .
let input_of_channel... |
2a5a516acdaff26b8370d610a9a167e19102fa06a1dca8432bd6b925d4c586c7 | scrintal/heroicons-reagent | chat_bubble_oval_left.cljs | (ns com.scrintal.heroicons.mini.chat-bubble-oval-left)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2 10c0-3.967 3.69-7 8-7 4.31 0 8 3.033 8 7s-3.69 7-8 7a9.165 9.165 0... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/chat_bubble_oval_left.cljs | clojure | (ns com.scrintal.heroicons.mini.chat-bubble-oval-left)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2 10c0-3.967 3.69-7 8-7 4.31 0 8 3.033 8 7s-3.69 7-8 7a9.165 9.165 0... | |
a97440c5b91dd83776ad24c2f9b13740187d62309716a4623ff38f4d2d76a641 | TyOverby/mono | vdom_based_tests.ml | open! Core
open! Bonsai_web
open! Bonsai_web_test
open Bonsai.Let_syntax
open Shared
module Test = struct
include Shared.Test
let create
(type a)
?(visible_range = 0, 100)
?(map = small_map)
?(should_print_styles = false)
?(should_set_bounds = true)
component
: ... | null | https://raw.githubusercontent.com/TyOverby/mono/7666c0328d194bf9a569fb65babc0486f2aaa40d/vendor/janestreet-bonsai/web_ui/partial_render_table/test/vdom_based_tests.ml | ocaml | No assocs here because it just uses the Incr_map function directly
Change the visibility to show the rest of the nodes
extending the range upwards should only add to the end
move back into bounds
Sanity check: re-stabilizing after doing no actions does not cause recomputation
Re-setting a column to its exist... | open! Core
open! Bonsai_web
open! Bonsai_web_test
open Bonsai.Let_syntax
open Shared
module Test = struct
include Shared.Test
let create
(type a)
?(visible_range = 0, 100)
?(map = small_map)
?(should_print_styles = false)
?(should_set_bounds = true)
component
: ... |
25ab5075cc0e3d3bc3c141b17288f7bd1f982571959436e0b78a181969cc834d | ocaml-sf/learn-ocaml-corpus | test26.ml | (* The empty random access list. *)
let empty : 'a . 'a seq =
Nil
(* Example random access lists. *)
let test24 : int seq =
Zero (One ((2, 6), Nil))
| null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/random_access_lists/wrong/test26.ml | ocaml | The empty random access list.
Example random access lists. |
let empty : 'a . 'a seq =
Nil
let test24 : int seq =
Zero (One ((2, 6), Nil))
|
27949a98394afaac22c1f74f16ba80f5933567251a8bd209ee7c9dee17b120e3 | atdixon/me.untethr.nostr-desk | avatar.clj | (ns me.untethr.nostr.avatar
(:require [me.untethr.nostr.util :as util]
[me.untethr.nostr.cache :as cache])
(:import (javafx.scene.image Image)))
(def color
(memoize
(fn [^String public-key]
(util/rand-hex-color (.hashCode public-key)))))
(defonce image-cache
(cache/build-loading "initial... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-desk/0ef74ca5e1a80ce71abd84a1569d71e3cba2be9a/src/me/untethr/nostr/avatar.clj | clojure | (ns me.untethr.nostr.avatar
(:require [me.untethr.nostr.util :as util]
[me.untethr.nostr.cache :as cache])
(:import (javafx.scene.image Image)))
(def color
(memoize
(fn [^String public-key]
(util/rand-hex-color (.hashCode public-key)))))
(defonce image-cache
(cache/build-loading "initial... | |
c2972aaf704409d1983356c34cb782af630d575ae0a19713feb6349e269f3b85 | paurkedal/ocaml-radixmap | bitword.mli | Copyright ( C ) 2017 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | null | https://raw.githubusercontent.com/paurkedal/ocaml-radixmap/93d0df62ac1da91c42dfdbac579e0e55a2dbdd5e/lib/bitword.mli | ocaml | * {2 Parts}
* {2 Queue-Like Operations}
These functions operate around index 0. That is, for big-endian it
changes the prefix bit and for low-endian the suffix bit. | Copyright ( C ) 2017 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... |
be0c9475fc3f1e46e8b8d16f9fc8996d4c9a7085f62ffd01b81e6af393c95c38 | emina/rosette | imdb250_4.rkt | #lang rosette
(require (only-in racket/runtime-path define-runtime-path))
(require "../dom.rkt")
(require "../websynth.rkt")
(require "../websynthlib.rkt")
(define-runtime-path html (build-path ".." "html/imdb250.html"))
(define dom (read-DOMNode html))
(define-tags (tags dom))
(define max_zpath_depth (depth dom))
;... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/sdsl/websynth/benchmarks/imdb250_4.rkt | racket | Record 0 fields
Record 1 fields
Record 2 fields
Record 3 fields
Cross-record Mask
Record 0 zpath asserts
Record 1 zpath asserts
Record 2 zpath asserts
Record 3 zpath asserts
Record Mask
Solve
Record 0 zpaths
Record 1 zpaths
Record 2 zpaths
Record 3 zpaths | #lang rosette
(require (only-in racket/runtime-path define-runtime-path))
(require "../dom.rkt")
(require "../websynth.rkt")
(require "../websynthlib.rkt")
(define-runtime-path html (build-path ".." "html/imdb250.html"))
(define dom (read-DOMNode html))
(define-tags (tags dom))
(define max_zpath_depth (depth dom))
(... |
2de286a28d328e92d198357f29bed8d8570a16657a12762f34b1ac3e7a14eeb2 | fortytools/holumbus | ControllerData.hs | -- ----------------------------------------------------------------------------
|
Module : Holumbus . FileSystem . Controller . ControllerData
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/storage/source/Holumbus/FileSystem/Controller/ControllerData.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
* datatypes
* creation and destruction
----------------------------------------------------------------------------
-------------------------------------------... |
|
Module : Holumbus . FileSystem . Controller . ControllerData
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Module : Holumbus.FileSystem.Controller.ControllerData
Copyright ... |
ca35508d2671b5c55b33138941f7cbce2b41c0fd4478ff786b7cec713b7fa0ff | emotiq/emotiq | startup.lisp | There are two entry points for - development and binary ( production ) .
;;
;; At the moment, we favor development activities over binary building. Developers
; should be able to load-and-go. The MAIN entry point is an example of what developers
; might use. MAIN does nothing, but test whether make-key-pair doe... | null | https://raw.githubusercontent.com/emotiq/emotiq/9af78023f670777895a3dac29a2bbe98e19b6249/src/startup.lisp | lisp |
At the moment, we favor development activities over binary building. Developers
should be able to load-and-go. The MAIN entry point is an example of what developers
might use. MAIN does nothing, but test whether make-key-pair doesn't crash.
When building binaries, we use the DELIVER function. This function... | There are two entry points for - development and binary ( production ) .
with multitasking turned on . In code , multitasking is required
system during startup . The START function is called by a binary , as its
entry point . During the building of a binary , / etc / deliver / deliver.lisp
( as l... |
51ef521e0d109be199fe35a0d91ca92a2dcc7a210722e58d30cbfa12ee6f3635 | cirfi/sicp-my-solutions | 1.22.scm | define runtime for GNU
;;; (define (runtime) (tms:clock (times)))
;;; define runtime for Racket
;;; (define (runtime) (current-milliseconds))
;;; timed prime, modified
(define (timed-prime-test n)
(start-prime-test n (runtime)))
(define (start-prime-test n start-time)
(if (prime? n)
(report-prime n (- (r... | null | https://raw.githubusercontent.com/cirfi/sicp-my-solutions/4b6cc17391aa2c8c033b42b076a663b23aa022de/ch1/1.22.scm | scheme | (define (runtime) (tms:clock (times)))
define runtime for Racket
(define (runtime) (current-milliseconds))
timed prime, modified
prime?
search-for-primes
1013 *** 0.
10007 *** 0.
the former cases are too small for modern computers
10000000033 *** .13
10000000061 *** .14 | define runtime for GNU
(define (timed-prime-test n)
(start-prime-test n (runtime)))
(define (start-prime-test n start-time)
(if (prime? n)
(report-prime n (- (runtime) start-time))
#f))
(define (report-prime n elapsed-time)
(display n)
(display " *** ")
(display elapsed-time)
(newline))
(d... |
f443c7332a4c2f997d237d1d7932adb02dddba084947636ec038b440bb824cac | Frama-C/Frama-C-snapshot | register.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/report/register.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
8abf601193f68468b0ca3fafe84c337f4da33f431149510dfd4429d760c51d73 | protz/mezzo | Kind.ml | type kind =
| KValue
| KType
| KPerm
| KArrow of kind * kind
let karrow bindings kind =
List.fold_right (fun (_, kind1) kind2 ->
KArrow (kind1, kind2)
) bindings kind
let as_arrow k =
let rec as_arrow accu = function
| KArrow (k1, k2) ->
as_arrow (k1 :: accu) k2
| k ->
List.r... | null | https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/parsing/Kind.ml | ocaml | type kind =
| KValue
| KType
| KPerm
| KArrow of kind * kind
let karrow bindings kind =
List.fold_right (fun (_, kind1) kind2 ->
KArrow (kind1, kind2)
) bindings kind
let as_arrow k =
let rec as_arrow accu = function
| KArrow (k1, k2) ->
as_arrow (k1 :: accu) k2
| k ->
List.r... | |
9d3fd2763163042eaa88e4334c93bbdbd10d994b61dee673e26ee4acecb0551c | archaelus/erlirc | irc_messages_tests.erl | %%%-------------------------------------------------------------------
Geoff Ca nt
@author nt < >
%% @version {@vsn}, {@date} {@time}
%% @doc
%% @end
%%%-------------------------------------------------------------------
-module(irc_messages_tests).
-include_lib("irc.hrl").
-include_lib("logging.hrl").
-inclu... | null | https://raw.githubusercontent.com/archaelus/erlirc/b922b2004f0f9f58a6ccf8fe71313190dee081c6/src/irc_messages_tests.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
@doc
@end
-------------------------------------------------------------------
numreply_test() -> | Geoff Ca nt
@author nt < >
-module(irc_messages_tests).
-include_lib("irc.hrl").
-include_lib("logging.hrl").
-include_lib("eunit/include/eunit.hrl").
-import(irc_messages, [parse_line/1
,to_list/1
,decode_ctcp_delims/1
,encode_ctcp_delims/1... |
a8b4cdac9bdb39661d3d07c3d7d8387cfe11541eff006845eb5ae7485324c0a2 | sras/servant-examples | CustomPostFormat.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
module CustomPostFormat where
import Servant ( PlainText
, MimeUnrender(..)
, Accept(..)
... | null | https://raw.githubusercontent.com/sras/servant-examples/923b54a13e14a4c2a37a3633dc7e2fa8fe49adc6/src/CustomPostFormat.hs | haskell | # LANGUAGE OverloadedStrings #
Syntax for importing type operator
In this example, we see how we can accept data
in any custom format. Earlier example, we were accepting
data in JSON format, which Servant has built in support for.
This is our new format that we will be using along with JSON. We won't be needing a ... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
module CustomPostFormat where
import Servant ( PlainText
, MimeUnrender(..)
, Accept(..)
, Post
, ReqBody
... |
4edf2d26ee952f9e97f2391485387608a8aa59af7f19a5c4938a5f95a5880b1f | DougHamil/threeagent | entity.cljs | (ns threeagent.entity
(:require ["three" :as three]))
(defprotocol IEntityType
(create [this context entity-config]
"Returns a new instance of this entity type, based on the provided `entity-config` and `context`.
The returned instance should be a ThreeJS `Object3D` or one of its sub-classes.")
(destroy... | null | https://raw.githubusercontent.com/DougHamil/threeagent/8f8b158bcbbf484b41d6f4a87436ce6f81ca7c04/src/main/threeagent/entity.cljs | clojure | (ns threeagent.entity
(:require ["three" :as three]))
(defprotocol IEntityType
(create [this context entity-config]
"Returns a new instance of this entity type, based on the provided `entity-config` and `context`.
The returned instance should be a ThreeJS `Object3D` or one of its sub-classes.")
(destroy... | |
d0043603c4e923355ed85ec0c432983f9fc494adfdcd29215b705e94b77f7a6a | Decentralized-Pictures/T4L3NT | test_typechecking.ml | * Testing
-------
Component : Protocol ( type - checking )
Invocation : cd src / proto_011_PtHangz2 / lib_protocol / test
dune exec ./main.exe -- test " ^typechecking$ "
Subject : Type - checking
-------
Component: Protocol (type-checking)
Invoca... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_011_PtHangz2/lib_protocol/test/test_typechecking.ml | ocaml | Test for Script_ir_translator.unparse_script on a script declaring views.
* Check that the custom stack overflow exception is triggered when
it should be.
NOTE: this test fails with an out-of-memory exception.
Meme
pair nat (nat %b)
pair nat (nat %b)
unparse_comparable_ty is not exported, the simplest wa... | * Testing
-------
Component : Protocol ( type - checking )
Invocation : cd src / proto_011_PtHangz2 / lib_protocol / test
dune exec ./main.exe -- test " ^typechecking$ "
Subject : Type - checking
-------
Component: Protocol (type-checking)
Invoca... |
864d3b017499a757e46293bfee9d740d94e6b3af258e3fc034f0360b597ef406 | prg-titech/baccaml | simple1.ml | ;;
let rec interp bytecode pc a =
jit_dispatch (pc = 0) bytecode a;
(* if pc = 0 then test_trace a bytecode else *)
let opcode = bytecode.(pc) in
if opcode = 0
then (* INCR_A *)
interp bytecode (pc + 1) (a + 1)
else if opcode = 1
then (* DECR_A *)
interp bytecode (pc + 1) (a - 1)
else if opcode ... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/test/interp_example/simple1.ml | ocaml | if pc = 0 then test_trace a bytecode else
INCR_A
DECR_A
RETURN_A | ;;
let rec interp bytecode pc a =
jit_dispatch (pc = 0) bytecode a;
let opcode = bytecode.(pc) in
if opcode = 0
interp bytecode (pc + 1) (a + 1)
else if opcode = 1
interp bytecode (pc + 1) (a - 1)
else if opcode = 2
then (
JUMP_IF
let target = bytecode.(pc + 1) in
if a > 0 then interp byte... |
89532136778ec8968e7917af209614d03b347737eb97956b6a66c30f64563a07 | shayne-fletcher/zen | red_black_tree.ml | module type Ordered_type_sig = sig
type t
val compare : t -> t -> int
end
module type Set_sig = sig
type element
type t
exception Empty_set
val empty : t (*The empty set*)
val add : t -> element -> t (*Add an element*)
val remove : t -> element -> t * element (*Remove an element*)
val fold : t -> '... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/red_black_tree/red_black_tree.ml | ocaml | The empty set
Add an element
Remove an element
Visit elements in order
Test for membership
Cardinality of a set
The minimum value of the set
The maximum value of the set
Input signature of the functor [Make]
Output signature of the functor [Make]
Functor building an implementation of the set structure given a
total... | module type Ordered_type_sig = sig
type t
val compare : t -> t -> int
end
module type Set_sig = sig
type element
type t
exception Empty_set
The union of two sets
The intersection of two sets
Construct set from unordered list
end
module type SET = sig
module type Ordered_type = Ordered_type_sig
modu... |
9093d88d9dc82a5db4a5aa6c36990ef1b5158f123ca4085d81f86f5b29583d21 | rjohnsondev/haskellshop | Feedback.hs | {-# LANGUAGE OverloadedStrings, ScopedTypeVariables, NoMonomorphismRestriction, GADTs #-}
module Admin.Feedback where
import Application
import Data.ByteString (ByteString)
import Data.Text
import Snap.Core
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Session
import Text.Printf
import qualified D... | null | https://raw.githubusercontent.com/rjohnsondev/haskellshop/645f9e40b9843fc987d37a0ee58460929ef50aae/src/Admin/Feedback.hs | haskell | # LANGUAGE OverloadedStrings, ScopedTypeVariables, NoMonomorphismRestriction, GADTs # |
module Admin.Feedback where
import Application
import Data.ByteString (ByteString)
import Data.Text
import Snap.Core
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Session
import Text.Printf
import qualified Data.ByteString.Char8 as C8
import qualified Control.Monad.CatchIO as CIO
import qualified ... |
90161e1649e172aeeb3489c12ca5e7da66b5565bdebe1f2af152d40bccfc2451 | ocaml-multicore/parafuzz | lazy_.ml | (* TEST *)
let rec c = lazy (0 + d) and d = 3;;
let () = Printf.printf "%d\n" (Lazy.force c)
| null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/letrec-compilation/lazy_.ml | ocaml | TEST |
let rec c = lazy (0 + d) and d = 3;;
let () = Printf.printf "%d\n" (Lazy.force c)
|
165bf30ec91223613096ae4a3d8e852c36144688b86fdd0a89042900c193f814 | racket/plot | lazy-snip-types.rkt | #lang typed/racket/base
(require (only-in typed/mred/mred Snip% Frame% Bitmap%)
plot/utils)
(provide (all-defined-out))
(define-type Plot-Snip% (Class #:implements Snip% #:implements Plot-Metrics<%>))
(define-type Make-2D-Plot-Snip
(-> (Instance Bitmap%)
Plot-Parameters
(-> Boolean Rect Posit... | null | https://raw.githubusercontent.com/racket/plot/c4126001f2c609e36c3aa12f300e9c673ab1a806/plot-gui-lib/plot/private/gui/lazy-snip-types.rkt | racket | #lang typed/racket/base
(require (only-in typed/mred/mred Snip% Frame% Bitmap%)
plot/utils)
(provide (all-defined-out))
(define-type Plot-Snip% (Class #:implements Snip% #:implements Plot-Metrics<%>))
(define-type Make-2D-Plot-Snip
(-> (Instance Bitmap%)
Plot-Parameters
(-> Boolean Rect Posit... | |
990f315d66d11b1ad94bcb41bbeb2ffa6309456776f8b1d9688c8017fc401880 | softwarelanguageslab/maf | R5RS_scp1_count-pairs2-5.scm | ; Changes:
* removed : 0
* added : 2
* swaps : 1
; * negated predicates: 0
* swapped branches : 1
; * calls to id fun: 0
(letrec ((count-pairs (lambda (lst)
(let ((path ()))
(<change>
()
(lambda (curre... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_count-pairs2-5.scm | scheme | Changes:
* negated predicates: 0
* calls to id fun: 0 | * removed : 0
* added : 2
* swaps : 1
* swapped branches : 1
(letrec ((count-pairs (lambda (lst)
(let ((path ()))
(<change>
()
(lambda (current)
(if (null? current)
... |
299737aad3a81338e38ef2aa0e7444d9d94445df76d4f0be9beeb7f323a80a9f | raghavkarol/edt | edt_profile_store.erl | %%
%% edt_profile_store is a in memory store for traces
%%
Copyright 2021 .
%%
-module(edt_profile_store).
-export([
crec_id/2,
crec_id/4,
find/1,
find_crecs/1, find_crecs/2,
find_srecs/0,
init_store/0, init_store/1,
srec/8,
srec_id/5,
store/1,
track_call/7,
track_summar... | null | https://raw.githubusercontent.com/raghavkarol/edt/c9ac86d4161deb7f23ff20b6ae713e77706e52fa/src/edt_profile_store.erl | erlang |
edt_profile_store is a in memory store for traces
---------------------------------------------------------
---------------------------------------------------------
TODO Don't use normal as default value
---------------------------------------------------------
API
--------------------------------------------... | Copyright 2021 .
-module(edt_profile_store).
-export([
crec_id/2,
crec_id/4,
find/1,
find_crecs/1, find_crecs/2,
find_srecs/0,
init_store/0, init_store/1,
srec/8,
srec_id/5,
store/1,
track_call/7,
track_summary/6,
context_id/0
]).
-include_lib("stdlib/include/ms_tra... |
be26a847e9392a377a01bbacb1ee4d6571633f1bae6999e76b400ef926a0fe3b | CarlosMChica/HaskellBook | ChapterExercises.hs | # LANGUAGE FlexibleInstances #
module ChapterExercises where
import GHC.Arr
import FunctorLaws
import Test.QuickCheck
import Test.QuickCheck.Function
type IntToString = Fun Int String
type StringToInt = Fun String Int
1 .
-- data Bool = False | True
No valid Functor instance possible as is not a higher kinded ... | null | https://raw.githubusercontent.com/CarlosMChica/HaskellBook/86f82cf36cd00003b1a1aebf264e4b5d606ddfad/chapter16/ChapterExercises.hs | haskell | data Bool = False | True
This is equivalent to Maybe and I'm lazy so I'm not writing it again :). It's a perfectly valid functor.
(* -> *) -> * This kind means that the type argument f is itself a higher-kinded type. Applying f would leave kind *.
Given type
Fixed type
Given type
data Company a b c = DeepBlue a ... | # LANGUAGE FlexibleInstances #
module ChapterExercises where
import GHC.Arr
import FunctorLaws
import Test.QuickCheck
import Test.QuickCheck.Function
type IntToString = Fun Int String
type StringToInt = Fun String Int
1 .
No valid Functor instance possible as is not a higher kinded type , it 's kind is * , fun... |
d68a67e211ce8736434ffd8c1f8a4aa9b6c9237f0672cd3a11806bf055642818 | haskell/statistics | FDistribution.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveDataTypeable , DeriveGeneric #
-- |
-- Module : Statistics.Distribution.FDistribution
Copyright : ( c ) 2011
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- Fisher F distribution
module Statistics.Distribut... | null | https://raw.githubusercontent.com/haskell/statistics/a2aa25181e50cd63db4a785c20c973a3c4dd5dac/Statistics/Distribution/FDistribution.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : Statistics.Distribution.FDistribution
License : BSD3
Maintainer :
Stability : experimental
Portability : portable
Fisher F distribution
* Constructors
* Accessors
| F distribution
# UNPACK #
# UNPACK #
# UNPACK #
Only matches +∞
NOTE: Here we rely on impl... | # LANGUAGE DeriveDataTypeable , DeriveGeneric #
Copyright : ( c ) 2011
module Statistics.Distribution.FDistribution (
FDistribution
, fDistribution
, fDistributionE
, fDistributionReal
, fDistributionRealE
, fDistributionNDF1
, fDistributionNDF2
) where
import Control.Applicative
import Data.Aeso... |
1d3b20c5422f942149de4b07b2a2b522b4fed887a660703843e9f353478b3f32 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | InvoiceSettingCustomField.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema InvoiceSettingCustomField
module StripeAPI.Types.InvoiceSettingCustomField ... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/InvoiceSettingCustomField.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema InvoiceSettingCustomField
| Defines the object schema located at @components.schemas.invoice_setting_custom_field@ in the specification.
| name: The name of the custom field.
Constraints:
| value: The value of t... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.InvoiceSettingCustomField where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import q... |
615ba1cb60cf08e8fcd80dd0cd35fc3769e90beda92d3e29f539404e9e3d1bde | ricardobcl/DottedDB | dotted_db_vnode.erl | -module(dotted_db_vnode).
-behaviour(riak_core_vnode).
-include_lib("dotted_db.hrl").
-include_lib("riak_core/include/riak_core_vnode.hrl").
-export([start_vnode/1,
init/1,
terminate/2,
handle_command/3,
handle_info/2,
is_empty/1,
delete/1,
handle_handoff_... | null | https://raw.githubusercontent.com/ricardobcl/DottedDB/e3b96a9ec77439af90f94a80b875a01732c1425e/src/dotted_db_vnode.erl | erlang | node id used for in logical clocks
the atom representing the vnode id
index on the consistent hashing ring
my peers ids
node logical clock
what me and my peers know about me and their peers
map for keys that this node replicates (eventually all keys are safely pruned from this)
the left list of pairs of deleted... | -module(dotted_db_vnode).
-behaviour(riak_core_vnode).
-include_lib("dotted_db.hrl").
-include_lib("riak_core/include/riak_core_vnode.hrl").
-export([start_vnode/1,
init/1,
terminate/2,
handle_command/3,
handle_info/2,
is_empty/1,
delete/1,
handle_handoff_... |
ced00395c65b3a8a4f3bf39b8e734d3be643996e7122b35b21944810cfa00f79 | gwright83/Wheeler | IO.hs | {-# LANGUAGE TypeSynonymInstances #-}
--
IO.hs
--
-- Basic input and output of expressions.
--
, 22 April 2011
--
module Math.Symbolic.Wheeler.IO where
import Control.Monad.Identity
import Text.Parsec
import Text.Parsec.Expr as Ex
import Text.Parsec.Language
import Text.Parsec.String
import qualified Text.Pars... | null | https://raw.githubusercontent.com/gwright83/Wheeler/cfc8c66f019de92f087cc8157f2a9be22ae26cf7/src/Math/Symbolic/Wheeler/IO.hs | haskell | # LANGUAGE TypeSynonymInstances #
Basic input and output of expressions.
# SOURCE #
Read an expression from a string.
Parse an expression. Formerly, certain transformations
that put subexpressions into canonical form
were done on the fly. This is no longer the case. The
string is converted to an unsimpli... | IO.hs
, 22 April 2011
module Math.Symbolic.Wheeler.IO where
import Control.Monad.Identity
import Text.Parsec
import Text.Parsec.Expr as Ex
import Text.Parsec.Language
import Text.Parsec.String
import qualified Text.Parsec.Token as P
import Math.Symbolic.Wheeler.Canonicalize
import Math . Symbolic . Wheeler .... |
6f93660aab14d835c3d71e33bdd0043a3c262929824a1844227a93d9f028f52f | potapenko/playphraseme-site | util.clj | (ns playphraseme.common.util
(:require [clojure.string :as string]
[clojure.java.io :as io]
[clojure.walk :as walk]
[playphraseme.common.nlp :as nlp])
(:import [java.net URL URLEncoder]))
(defn- change-keys
[data pred]
(let [transform-map (fn [form]
(... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/common/util.clj | clojure | (ns playphraseme.common.util
(:require [clojure.string :as string]
[clojure.java.io :as io]
[clojure.walk :as walk]
[playphraseme.common.nlp :as nlp])
(:import [java.net URL URLEncoder]))
(defn- change-keys
[data pred]
(let [transform-map (fn [form]
(... | |
05877cbbed43481b143dc3bc0ccad5bd80134b26db498c5912d09f821fa2581b | startalkIM/ejabberd | fast_tls_app.erl | %%%----------------------------------------------------------------------
%%% File : fast_tls_app.erl
Author : < >
Purpose : application
Created : 4 Apr 2013 by < >
%%%
%%%
Copyright ( C ) 2002 - 2016 ProcessOne , SARL . All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( t... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/fast_tls/src/fast_tls_app.erl | erlang | ----------------------------------------------------------------------
File : fast_tls_app.erl
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 CONDITI... | Author : < >
Purpose : application
Created : 4 Apr 2013 by < >
Copyright ( C ) 2002 - 2016 ProcessOne , SARL . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(fast_tls_app).
-b... |
57371b72bb517b36d7bfdc6af3c808b88805e4df34608a6737926e0030abe609 | coccinelle/coccinelle | char.mli | external code : char -> int = "%identity"
val chr : int -> char
val escaped : char -> string
val lowercase : char -> char
val uppercase : char -> char
val lowercase_ascii : char -> char
val uppercase_ascii : char -> char
type t = char
val compare : t -> t -> int
val equal : t -> t -> bool
external unsafe_chr : int -> c... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/5448bb2bd03491ffec356bf7bd6ddcdbf4d36bc9/bundles/stdcompat/stdcompat-current/interfaces/4.13/char.mli | ocaml | external code : char -> int = "%identity"
val chr : int -> char
val escaped : char -> string
val lowercase : char -> char
val uppercase : char -> char
val lowercase_ascii : char -> char
val uppercase_ascii : char -> char
type t = char
val compare : t -> t -> int
val equal : t -> t -> bool
external unsafe_chr : int -> c... | |
69d68f2606b4dc517222ceae304f16394f259ed2478e415cd00f0d6642fac7ed | klarna-incubator/bec | bec_permission_group_t.erl | %%==============================================================================
Type definition for the Permission Group structure
%%==============================================================================
-module(bec_permission_group_t).
%%=====================================================================... | null | https://raw.githubusercontent.com/klarna-incubator/bec/b090bfbeeff298b4fc40e16a9da217f2ce404844/src/bec_permission_group_t.erl | erlang | ==============================================================================
==============================================================================
==============================================================================
Exports
==========================================================================... | Type definition for the Permission Group structure
-module(bec_permission_group_t).
-export([ from_config/1
, from_map/1
, to_map/1
]).
-include("bitbucket.hrl").
-type permission_type() :: 'REPO_ADMIN' | 'REPO_READ' | 'REPO_WRITE'.
-type permission() :: #{ groupname => bec_group_t:na... |
b2ce26af58042a147e7e3748a7ead4829d089b3303383a1f8256c3ef637d35b9 | hasura/pg-client-hs | Interrupt.hs | # LANGUAGE ScopedTypeVariables #
module Control.Concurrent.Interrupt
( interruptOnAsyncException,
)
where
-------------------------------------------------------------------------------
import Control.Concurrent.Async (async, asyncThreadId, wait, waitCatch)
import Control.Exception
( SomeAsyncException,
So... | null | https://raw.githubusercontent.com/hasura/pg-client-hs/5793e998c20358eef6ca86b5d480956e08b7e07a/src/Control/Concurrent/Interrupt.hs | haskell | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
| interruptOnAsyncexception runs the given action in in a separate thread,
running the given cancel action before passing on any asynchronous
exceptions to that ... | # LANGUAGE ScopedTypeVariables #
module Control.Concurrent.Interrupt
( interruptOnAsyncException,
)
where
import Control.Concurrent.Async (async, asyncThreadId, wait, waitCatch)
import Control.Exception
( SomeAsyncException,
SomeException,
mask,
throwIO,
throwTo,
try,
)
import Prelude
i... |
fb0d39f489811fe7d09695161aa425756950a449dd0056842bb91088588e40d7 | filonenko-mikhail/cl-portaudio | portaudio.lisp | ;;; Generated by Verrazano 0.5
(in-package portaudio)
(define-foreign-library libportaudio
(:darwin "libportaudio.dylib") ;; <--- added
((:and :unix (:not :darwin)) (:or "libportaudio.so.2" "libportaudio.so"))
((:or :win32 :x86-64) (:or "libportaudio" "libportaudio-2"
"portaudio" "portaudio_x64" "portaudio_x86_64")... | null | https://raw.githubusercontent.com/filonenko-mikhail/cl-portaudio/c50cd061c25216a736f684e45101f5c0188a384f/src/portaudio.lisp | lisp | Generated by Verrazano 0.5
<--- added
cffi::float
cffi::int32
:int24 ; not supported
:int16 ; cffi::int16 troubles
cffi::int8
cffi::uint8
(:custom-format #x00010000) ; not supported
(:non-interleaved #x80000000)
(defconstant +non-interleaved+ #x80000000)
(:never-drop-input #x00000... | (in-package portaudio)
(define-foreign-library libportaudio
((:and :unix (:not :darwin)) (:or "libportaudio.so.2" "libportaudio.so"))
((:or :win32 :x86-64) (:or "libportaudio" "libportaudio-2"
"portaudio" "portaudio_x64" "portaudio_x86_64"))
((:or :win32 :x86) (:or "libportaudio" "libportaudio-2" "portaudio"
"porta... |
f273ab9bf767bd7dc461be5e57c2bfedb8ccc52990991edac57d78a267f1bcf6 | andrewmcloud/consimilo | random_seed_test.clj | (ns consimilo.random-seed-test
(:refer-clojure :exclude [rand rand-bigint])
(:require [clojure.test :refer :all]
[consimilo.random-seed :refer :all])
(:import (clojure.lang BigInt)))
(defn- get-seeded-random
"Generates a seeded random number for testing"
[seed max-range]
(set-random-seed! seed)... | null | https://raw.githubusercontent.com/andrewmcloud/consimilo/db96c1695248c3486e1d23de5589b39f0e0bd49f/test/consimilo/random_seed_test.clj | clojure | (ns consimilo.random-seed-test
(:refer-clojure :exclude [rand rand-bigint])
(:require [clojure.test :refer :all]
[consimilo.random-seed :refer :all])
(:import (clojure.lang BigInt)))
(defn- get-seeded-random
"Generates a seeded random number for testing"
[seed max-range]
(set-random-seed! seed)... | |
0b9541e9c6ba7b6f21ac789e2a0418ad6818924e05bb47c78b72378a92ae51a7 | tisnik/clojure-examples | project.clj | ;
( C ) Copyright 2018 , 2020
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(defproject spec-demo4 "0.1.0-SNAPSH... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/1350d206ec6702248a560a6c9569d2128de2da60/spec-demo4/project.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2018 , 2020
-v10.html
(defproject spec-demo4 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:plugins [[lein-codox "0.10.7"]
[t... |
0e6c374592a13a63a445839d3d6067c67f8252ada1cfcd63c02e29ac99f33fd4 | shayne-fletcher/zen | curves.mli | (** Curves *)
include Curves_sig.S
| null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/curve/curves.mli | ocaml | * Curves | include Curves_sig.S
|
f635453f8a661c622db98b2b9fffa8fe50bb563676397608960ef003e54a6f02 | nyu-acsys/drift | mc91_95.ml |
Res : OCaml - > 91
imprecision : Oct : 91 < = v < = 101
Liquid Haskell : false by property { -@ m : : x : Int - > { b : Int | ( b = = 91 ) } @- }
Res: OCaml -> 91
imprecision: Oct: 91 <= v <= 101
Liquid Haskell: false by property {-@ m :: x:Int -> {b:Int | (b == 91)} @-}
*)
let rec m x =
if x > 100
then x... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/first/mc91_95.ml | ocaml | -:{v:Int | true} |
Res : OCaml - > 91
imprecision : Oct : 91 < = v < = 101
Liquid Haskell : false by property { -@ m : : x : Int - > { b : Int | ( b = = 91 ) } @- }
Res: OCaml -> 91
imprecision: Oct: 91 <= v <= 101
Liquid Haskell: false by property {-@ m :: x:Int -> {b:Int | (b == 91)} @-}
*)
let rec m x =
if x > 100
then x... |
1579aab359f317b3b615d473f56c3205894bcb897e5c391b37c8c551f9eea455 | mirage/mirage-nat | util.ml | (* Some convenience functions to hide how ugly some packet operations are.
This module, and others like it, might inspire some API changes in the next
major release of mirage-tcpip. *)
let get_dst (`IPv4 (packet, _) : Nat_packet.t) = packet.Ipv4_packet.dst
let try_decompose cache ~now f packet =
let cache', r... | null | https://raw.githubusercontent.com/mirage/mirage-nat/1bed6c49b7554123a99e5e56d1f0967707424bb2/example/util.ml | ocaml | Some convenience functions to hide how ugly some packet operations are.
This module, and others like it, might inspire some API changes in the next
major release of mirage-tcpip. |
let get_dst (`IPv4 (packet, _) : Nat_packet.t) = packet.Ipv4_packet.dst
let try_decompose cache ~now f packet =
let cache', r = Nat_packet.of_ipv4_packet !cache ~now:(now ()) packet in
cache := cache';
match r with
| Error e ->
Logs.err (fun m -> m "of_ipv4_packet error %a" Nat_packet.pp_error e);
Lwt... |
a91a3c990a897f3c06382e98b6c6f9d4ee6ca70d43ab23e8412784767e3149dd | khotyn/4clojure-answer | 18-sequences-filter.clj | '(6 7)
| null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/18-sequences-filter.clj | clojure | '(6 7)
| |
1c23f5cce936ab30c3437a9c3125e1e3c64e314cd4064900d1e3a1135a579b82 | fargonauts/copycat-lisp | run.lisp | ;---------------------------------------------
; RUN: This file contains functions for running the program.
;---------------------------------------------
(in-package 'user)
(defun run-ccat ()
; Runs the main loop of the program: choose a codelet, run it. Every
% time - step - time - steps , update everything ... | null | https://raw.githubusercontent.com/fargonauts/copycat-lisp/a7733ca91a1169d0b5c7af8a46c4804e764d3175/run.lisp | lisp | ---------------------------------------------
RUN: This file contains functions for running the program.
---------------------------------------------
Runs the main loop of the program: choose a codelet, run it. Every
values on the workspace, all the activations in the slipnet, etc.).
This is the main loop of the... |
(in-package 'user)
(defun run-ccat ()
% time - step - time - steps , update everything in the program ( all the
(loop until *quit-program* do
If the program has run for % time - step - length% steps , then
(if* (= (mod *codelet-count* %time-step-length%) 0)
then (update-everything))
initial se... |
173a54a216c5aebae336d2138c4d3a3078aaac6669eddc406029f958ac0b310f | fulcrologic/fulcro-native-template | util.cljc | (ns app.util
#?(:cljs (:refer-clojure :exclude [uuid]))
(:require
[com.fulcrologic.guardrails.core :refer [>defn =>]]
[clojure.spec.alpha :as s]))
(>defn uuid
"Generate a UUID the same way via clj/cljs. Without args gives random UUID. With args, builds UUID based on input (which
is useful in tests)."
... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-native-template/2c0a331c722af7df15a7e80c88d224db00f234b3/src/main/app/util.cljc | clojure | (ns app.util
#?(:cljs (:refer-clojure :exclude [uuid]))
(:require
[com.fulcrologic.guardrails.core :refer [>defn =>]]
[clojure.spec.alpha :as s]))
(>defn uuid
"Generate a UUID the same way via clj/cljs. Without args gives random UUID. With args, builds UUID based on input (which
is useful in tests)."
... | |
9515c0661d3b523ba4d44ebf7955dc0fbf9999168a50692b1d82cd65363e0262 | rtoy/cmucl | window.lisp | -*- Log : hemlock.log ; Package : Hemlock - Internals -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/hem... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/hemlock/window.lisp | lisp | Package : Hemlock - Internals -*-
**********************************************************************
**********************************************************************
This file contains implementation independent code which implements
other aspects of the interface to redisplay.
CURRENT-WINDOW.
... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/hemlock/window.lisp $")
the Hemlock window primitives and most of the code which defines
Written by and .
(in-package "HEMLOCK-INTERNALS"... |
f368f65886c5fe64eb826ef5edfc7fef1ba527db9babb9cafb07be4f66d3804e | cognitect-labs/pedestal.kafka | consumer.clj | (ns com.cognitect.kafka.consumer
(:require [clojure.spec :as s]
[clojure.walk :as walk]
[clojure.stacktrace :as stacktrace]
[io.pedestal.log :as log]
[io.pedestal.interceptor.chain :as interceptor.chain]
... | null | https://raw.githubusercontent.com/cognitect-labs/pedestal.kafka/91e826112b2f2bdc6a366a66b6a3cc07f7fca20b/src/com/cognitect/kafka/consumer.clj | clojure | ----------------------------------------
Utility functions | (ns com.cognitect.kafka.consumer
(:require [clojure.spec :as s]
[clojure.walk :as walk]
[clojure.stacktrace :as stacktrace]
[io.pedestal.log :as log]
[io.pedestal.interceptor.chain :as interceptor.chain]
... |
90c7c151d2237b47a12ef5f9abd795a63ef4022ee3c01a3f2f18e01b710c935b | lisp-mirror/clpm | sync.lisp | ;;;; clpm sync
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm-cli/commands/sync
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/interface-defs)
(:import-from #:adopt)
(:import-from #:clpm))
(in... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/cli/commands/sync.lisp | lisp | clpm sync
LICENSE for license information. | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm-cli/commands/sync
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/interface-defs)
(:import-from #:adopt)
(:import-from #:clpm))
(in-package #:clpm-cli/commands/sync)
(define-string *help-t... |
9f3ee39852b34eac8c2f194ed3f6eb6fb1c9c372eb3c93fa1bb0696280285348 | cram2/cram | neem-generator.lisp | (in-package :cslg)
(defun generate-neem (&optional objects-to-fetch-deliever)
(setf cram-tf:*tf-broadcasting-enabled* t)
(roslisp-utilities:startup-ros :name "cram" :anonymous nil)
(let ((objects-str (roslisp:get-param "/neem_generator/objects"))
objects '())
(loop for x in (split-sequence:split-se... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_learning/cram_sim_log_generator/src/neem-generator.lisp | lisp | (in-package :cslg)
(defun generate-neem (&optional objects-to-fetch-deliever)
(setf cram-tf:*tf-broadcasting-enabled* t)
(roslisp-utilities:startup-ros :name "cram" :anonymous nil)
(let ((objects-str (roslisp:get-param "/neem_generator/objects"))
objects '())
(loop for x in (split-sequence:split-se... | |
63d6b26b2c7c1de7ea40da6c9ae795ec8c9e57f3847bc448d46b72449464aa5f | inconvergent/weird | weir-with.lisp |
(in-package #:weird-tests)
(plan 8)
(veq:vprogn
(subtest "test-weir-with "
(let ((wer (init-weir)))
(weir:with (wer %)
(% (2add-vert? (veq:f2 11f0 3f0)))
(list 4.5
(% (2move-vert? 0 (veq:f2 1f0 0f0)))
nil t
(list 5 (% (2add-vert? (veq:f2 12f0 3f0... | null | https://raw.githubusercontent.com/inconvergent/weird/106d154ec2cd0e4ec977c3672ba717d6305c1056/test/weir-with.lisp | lisp | there was a bug vprogn/vdef. it does not handle dotted pairs
TODO: the dotted pairs bug is fiexed. so maybe rewrite this?
graph sequentially while relying on the state of the graph
this exhibits "side-effects"
this exhibits "side-effects"
no "side effect" in the sense described above.
alterations avoid side-effe... |
(in-package #:weird-tests)
(plan 8)
(veq:vprogn
(subtest "test-weir-with "
(let ((wer (init-weir)))
(weir:with (wer %)
(% (2add-vert? (veq:f2 11f0 3f0)))
(list 4.5
(% (2move-vert? 0 (veq:f2 1f0 0f0)))
nil t
(list 5 (% (2add-vert? (veq:f2 12f0 3f0... |
ad008ee63950542b0f8afac43676e0394a4ec2290a425beb9f81631f0c986684 | jellelicht/guix | java.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 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 ; ei... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/java.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 © 2015 < >
Copyright © 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 < / > .
(define-module (gnu packages java)
#:use-module ((guix licenses) #:prefix license:)
... |
e7204a5b681973bde319381cd960b005687fd266a730c277d5b4c878f8f9a01f | cabol/oauth2_mnesia_backend | oauth2_mnesia_backend.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of ... | null | https://raw.githubusercontent.com/cabol/oauth2_mnesia_backend/9127536f43a6f076ef5cd5458eb052c685ef0e89/src/oauth2_mnesia_backend.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@author < >
( C... |
e9cf2cd0fc5496410c02709b7b91ed1cd8226181834b1c01365d3ccd2c9195f2 | JeffreyBenjaminBrown/hode | RunLeaf.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
# LANGUAGE LambdaCase #
module Hode.Qseq.RunLeaf where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Hode.Qseq.Types
import Hode.Util.Misc
-- | = Running ato... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/hode/79a54a6796fa01570cde6903b398675c42954e62/hode/Hode/Qseq/RunLeaf.hs | haskell | | = Running atomic queries | # LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
# LANGUAGE LambdaCase #
module Hode.Qseq.RunLeaf where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Hode.Qseq.Types
import Hode.Util.Misc
runVarTest :: Pos... |
0627de17f30b88c8bb4a2edb7bc214dfd4cb9193018cd01280aaa3c42de74671 | kmi/irs | load.lisp | Copyright © 2008 The Open University
(in-package #:ocml)
(def-ontology lhdl-tests
"Definitions for the LHDL test suite."
:type :goal
:allowed-editors ("john")
:author "dave"
:files ("test")
:includes (lhdl-goals))
| null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/apps/lhdl/ontologies/lhdl-tests/load.lisp | lisp | Copyright © 2008 The Open University
(in-package #:ocml)
(def-ontology lhdl-tests
"Definitions for the LHDL test suite."
:type :goal
:allowed-editors ("john")
:author "dave"
:files ("test")
:includes (lhdl-goals))
| |
15fdcb02e9e90dbbc72b679fd5e0d75c3f470d9d078b2d39b290ce0c470d5a0e | schemedoc/implementation-metadata | qscheme.scm | (title "QScheme")
(tagline "fast interpreter with GTK bindings")
(homepage-url "-e.html")
(repology "qscheme")
(person "Daniel Crettol")
(features
r5rs)
| null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/qscheme.scm | scheme | (title "QScheme")
(tagline "fast interpreter with GTK bindings")
(homepage-url "-e.html")
(repology "qscheme")
(person "Daniel Crettol")
(features
r5rs)
| |
afefe71059868bd66441a4957d5c86c737148640dc573a20fbd2875d9a5a53a2 | zotonic/zotonic | action_wires_form_reset.erl | @author < >
2010 - 2023
%% @doc Reset all input fields in a form.
Copyright 2010 - 2023
%%
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 req... | null | https://raw.githubusercontent.com/zotonic/zotonic/f74d8ae093fc7d37601c55981c349d59c23f7d1e/apps/zotonic_mod_wires/src/actions/action_wires_form_reset.erl | erlang | @doc Reset all input fields in a form.
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 ... | @author < >
2010 - 2023
Copyright 2010 - 2023
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(action_wires_form_reset).
-include_lib("zotonic_core/include/zotonic.hrl").
-export([render_action/4]).
re... |
376081cd30b66ab88e8574608b56f6011c6eba041d59101d89363db42bf3b55f | logseq/deprecated-github-backend | rss.clj | (ns app.handler.rss
(:require [app.db.page :as page]
[app.db.user :as u]
[hiccup.page :as html]
[clj-time.core :as t]
[clj-time.coerce :as tc]
[clj-time.format :as tf]
[clojure.string :as string]
[app.config :as config]
[a... | null | https://raw.githubusercontent.com/logseq/deprecated-github-backend/7aa2f187f0f2d7b1e9c3f6a057bede939b4790b7/src/main/app/handler/rss.clj | clojure | (ns app.handler.rss
(:require [app.db.page :as page]
[app.db.user :as u]
[hiccup.page :as html]
[clj-time.core :as t]
[clj-time.coerce :as tc]
[clj-time.format :as tf]
[clojure.string :as string]
[app.config :as config]
[a... | |
3cb030de21309cd7352660f71e0ed949a8734347dbe2e345815bd67a2cf9c19b | alvatar/spheres | pad.scm | ;;;============================================================================
File : " rfc1423.scm " , Time - stamp : < 2007 - 04 - 05 00:52:53 feeley >
Copyright ( c ) 2006 - 2007 by , All Rights Reserved .
;;;============================================================================
Generalized messag... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/crypto/pad.scm | scheme | ============================================================================
============================================================================
Enhancement for Internet Electronic Mail: Part III: Algorithms,
Modes, and Identifiers).
===========================================================================... |
File : " rfc1423.scm " , Time - stamp : < 2007 - 04 - 05 00:52:53 feeley >
Copyright ( c ) 2006 - 2007 by , All Rights Reserved .
Generalized message padding / unpadding from RFC 1423 ( Privacy
(define* (RFC1423-pad u8vect (multiple 8))
(if (or (<= multiple 0) (>= multiple 256))
(error "illegal pad... |
02263f385ceb3804ec68dd8c504ae9edf88092ec768d7233bf193e323515c7bb | ghc/testsuite | mc25.hs | -- Checks that using the "by" clause in a transform requires a function parameter
# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #
module ShouldFail where
import Data.List(take)
z = [x | x <- [1..10], then group by x using take ]
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/mc25.hs | haskell | Checks that using the "by" clause in a transform requires a function parameter |
# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #
module ShouldFail where
import Data.List(take)
z = [x | x <- [1..10], then group by x using take ]
|
d18168d4da212ab02b3dfbfc5da176c1245133fa43ed10385feef3860b4a19c6 | dwayne/eopl3 | interpreter.test.rkt | #lang racket
(require "./interpreter.rkt")
(require rackunit)
(check-equal?
(run "5")
(num-val 5))
(check-equal?
(run "x")
(num-val 10))
(check-equal?
(run "zero?(i)")
(bool-val #f))
(check-equal?
(run "zero?(-(i, 1))")
(bool-val #t))
(check-equal?
(run "-(55, -(x, 11))")
(num-val 56))
(check-equal?
... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/03-ch3/interpreters/racket/PROC-3.19/interpreter.test.rkt | racket | (4 3 1)
This is not possible anymore since we can't define unnamed procedures:
(check-equal?
(run
#<<CODE
(proc (f) (f (f 77))
CODE
)
(num-val 55)) | #lang racket
(require "./interpreter.rkt")
(require rackunit)
(check-equal?
(run "5")
(num-val 5))
(check-equal?
(run "x")
(num-val 10))
(check-equal?
(run "zero?(i)")
(bool-val #f))
(check-equal?
(run "zero?(-(i, 1))")
(bool-val #t))
(check-equal?
(run "-(55, -(x, 11))")
(num-val 56))
(check-equal?
... |
00ee4ccce6ce816fac8eb8a0de3e1aa3a6bbb5a07a46a66a6850db47a4ef04c1 | ndmitchell/uniplate | DataOnly.hs | # LANGUAGE CPP , FlexibleInstances , FlexibleContexts , MultiParamTypeClasses #
# OPTIONS_GHC -Wno - simplifiable - class - constraints #
module Uniplate.DataOnly where
import Data.Generics.Uniplate.DataOnly
import Data.Generics.Uniplate.Data.Instances
#define SKIP_ZIPPER
#include "CommonInc.hs"
| null | https://raw.githubusercontent.com/ndmitchell/uniplate/7d3039606d7a083f6d77f9f960c919668788de91/Uniplate/DataOnly.hs | haskell | # LANGUAGE CPP , FlexibleInstances , FlexibleContexts , MultiParamTypeClasses #
# OPTIONS_GHC -Wno - simplifiable - class - constraints #
module Uniplate.DataOnly where
import Data.Generics.Uniplate.DataOnly
import Data.Generics.Uniplate.Data.Instances
#define SKIP_ZIPPER
#include "CommonInc.hs"
| |
022d394e981381535b82a01ece4a19da025affd8a5cb6db08e9b4f462ed2b66b | qiao/sicp-solutions | 2.11.scm | (define (make-interval a b) (cons a b))
(define (upper-bound z)
(max (car z)
(cdr z)))
(define (lower-bound z)
(min (car z)
(cdr z)))
(define (sign-pair lo up)
(cond ((and (< lo 0) (< up 0)) -1)
((and (< lo 0) (> up 0)) 0)
(else 1)))
(define (mul-interval x y)
(let ((xl (lowe... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter2/2.11.scm | scheme | - - - -
- - - +
- - + +
- + - -
- + - +
- + + +
+ + - -
+ + - +
+ + + + | (define (make-interval a b) (cons a b))
(define (upper-bound z)
(max (car z)
(cdr z)))
(define (lower-bound z)
(min (car z)
(cdr z)))
(define (sign-pair lo up)
(cond ((and (< lo 0) (< up 0)) -1)
((and (< lo 0) (> up 0)) 0)
(else 1)))
(define (mul-interval x y)
(let ((xl (lowe... |
5aa99fc2724f62ce3bb79bca4bafa92d040edbb592511bdee7d5bdd439a5e114 | music-suite/music-suite | Annotations.hs | # OPTIONS_GHC -fno - warn - incomplete - patterns #
# OPTIONS_GHC -fno - warn - name - shadowing
-fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-unused-imports
-fno-warn-redundant-constraints #-}
------------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Music/Score/Meta/Annotations.hs | haskell | -----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
|
License : BSD-style
Stability : experimental
Provides a basic way annotating scores.
|
An annotation is a unique textual value attach... | # OPTIONS_GHC -fno - warn - incomplete - patterns #
# OPTIONS_GHC -fno - warn - name - shadowing
-fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-unused-imports
-fno-warn-redundant-constraints #-}
Copyright : ( c ) 2012 - 2014
Maintainer :
Portability : non -... |
efacb8922d75dc8b455d102c0763f3e45a4b7141b14bd6e9e2a2958b6adf2c9e | kaznum/programming_in_ocaml_exercise | intersect.ml | let rec intersect s1 s2 =
match
(s1, s2)
with
([], _) -> []
| (x::xs, ys) when mem x ys -> x::(intersect xs ys)
| (x::xs, ys) -> intersect xs ys;;
intersect [1;3;5;7] [1;5;3;4;2];;
| null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex5.3/intersect.ml | ocaml | let rec intersect s1 s2 =
match
(s1, s2)
with
([], _) -> []
| (x::xs, ys) when mem x ys -> x::(intersect xs ys)
| (x::xs, ys) -> intersect xs ys;;
intersect [1;3;5;7] [1;5;3;4;2];;
| |
f3511128fb9c018055a874f83185b70d48d4797d2d4d35b32191a01326ef8671 | elastic/eui-cljs | icon_currency.cljs | (ns eui.icon-currency
(:require ["@elastic/eui/lib/components/icon/assets/currency.js" :as eui]))
(def currency eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_currency.cljs | clojure | (ns eui.icon-currency
(:require ["@elastic/eui/lib/components/icon/assets/currency.js" :as eui]))
(def currency eui/icon)
| |
b05ffac44ca28bffda6c68a4a246439fab5acb10e0387d4f19a13243477a3589 | solidsnack/system-uuid | Main.hs | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
USAGE : hooty ( -1|-4 ) ? ( -n < number to make > ) ?
The ` hooty ` program generates any number of UUIDs ( one by default ) , using
either the version 1 ( time and MAC ) or version 4 ( random ) algorithm ( version
1 is the d... | null | https://raw.githubusercontent.com/solidsnack/system-uuid/572f44a50d4fdd81a103f05df48a7e2cb75a17f3/Main.hs | haskell | number < number > Create < number > many UUIDs in one go .
sequential Create version 1 ( time and MAC ) UUIDs .
random Create version 4 ( random ) UUIDs .
help Print this help and exit .
version Print version and exit .
number <number> Creat... | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
USAGE : hooty ( -1|-4 ) ? ( -n < number to make > ) ?
The ` hooty ` program generates any number of UUIDs ( one by default ) , using
either the version 1 ( time and MAC ) or version 4 ( random ) algorithm ( version
1 is the d... |
fb37021e24fdd86cf55b19712dc3e8f820608673d3303b94bd77eed2e7f1b9c0 | johnlinvc/erruby | erruby_object.erl | -module(erruby_object).
-include("rb.hrl").
-behavior(gen_server).
-export([init/1, terminate/2, code_change/3, handle_call/3, handle_cast/2, handle_info/2]).
%for vm
-export([def_method/4, find_instance_method/2, def_global_const/2, find_global_const/1, def_const/3, find_const/2, init_object_class/0,object_class/0]).
... | null | https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erruby_object.erl | erlang | for vm
TODO unify these?
erruby_debug:debug_tmp("finding instance method ~p in ~p",[ Name, Self]),
TODO call def_const instead
TODO ability to use custom getter/setter
io:format("Method ~p not found~n",[Name]),
TODO extract to Kernal
TODO raise error if file not found
TODO raise error if file not found
TODO support pro... | -module(erruby_object).
-include("rb.hrl").
-behavior(gen_server).
-export([init/1, terminate/2, code_change/3, handle_call/3, handle_cast/2, handle_info/2]).
-export([def_method/4, find_instance_method/2, def_global_const/2, find_global_const/1, def_const/3, find_const/2, init_object_class/0,object_class/0]).
-export(... |
94c9f0fd99c5b33c0597d4c25a048fbfc9c2e1fb9c33892711e9617035aaafdd | tweag/asterius | CmpWord16.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE MagicHash #
module Main where
import Data.Word
import Data.List
import GHC.Prim
import GHC.Exts
Having a wrapper gives us two things :
-- * it's easier to test everything (no need for code using raw primops)
* we test the deriving mechanism for Word16 #
data TestWord16 =... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/primops/CmpWord16.hs | haskell | # LANGUAGE BangPatterns #
* it's easier to test everything (no need for code using raw primops)
(==)
(/=)
(<)
(>)
(<=)
(>=)
hence choosing a smaller range | # LANGUAGE MagicHash #
module Main where
import Data.Word
import Data.List
import GHC.Prim
import GHC.Exts
Having a wrapper gives us two things :
* we test the deriving mechanism for Word16 #
data TestWord16 = T16 Word16#
deriving (Eq, Ord)
mkT16 :: Word -> TestWord16
mkT16 (W# a) = T16 (narrowWord16# a)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.