_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 |
|---|---|---|---|---|---|---|---|---|
e5b54b4cffe4f5b419946349c84f78257a09b3a581bca2cf1db219174a7a0ad4 | metaocaml/ber-metaocaml | w59.ml | (* TEST
flags = "-w A"
compile_only = "true"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
* no-flambda
** setup-ocamlopt.byte-build-env
*** ocamlopt.byte
**** check-ocamlopt.byte-output
* flambda
compiler_reference = "${test_source_directory}/w59.flambda.reference"
** setup-ocamlopt.byt... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/warnings/w59.ml | ocaml | TEST
flags = "-w A"
compile_only = "true"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
* no-flambda
** setup-ocamlopt.byte-build-env
*** ocamlopt.byte
**** check-ocamlopt.byte-output
* flambda
compiler_reference = "${test_source_directory}/w59.flambda.reference"
** setup-ocamlopt.byte-... |
Check that the warning 59 ( assignment to immutable value ) does not
trigger on those examples
trigger on those examples *)
let a = Lazy.force (lazy "a")
let b = Lazy.force (lazy 1)
let c = Lazy.force (lazy 3.14)
let d = Lazy.force (lazy 'a')
let e = Lazy.force (lazy (fun x -> x+1))
let rec f (x:int) : int =... |
b5b49e782e6589e9362540cb5b79b83a1e037a9cffbc9965561e3ae13146a367 | nokia/web-assembly-self-certifying-compilation-framework | state_types.ml | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
open Wasm
open Wasm_utils
open Instr_graph
open Func_types
open Script_types
o... | null | https://raw.githubusercontent.com/nokia/web-assembly-self-certifying-compilation-framework/8c31df0bd7d2d94cfbc22089944f5cabb3a61158/src/validator/proofs/state_types.ml | ocaml | We need to handle symbolic pointers, and so we go an indirect route;
* The types need to be general enough to encode interleaving of:
* value stack; local variables; global variables; and linear memory
pointer identified by an id
Arrays -- as in the theory of arrays
* This is how we will model the
* value st... | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
open Wasm
open Wasm_utils
open Instr_graph
open Func_types
open Script_types
o... |
e6bcad4f5d92f8af99a9fa7feb4e013597004dae2fa99f03e23fc72a87cb2471 | penpot/penpot | undo.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.path.undo
(:require
[app.common.data :as d]
[app.common.data.undo-stack :a... | null | https://raw.githubusercontent.com/penpot/penpot/cc18f84d620e37d8efafc5bed1bcdbe70ec23c1e/frontend/src/app/main/data/workspace/path/undo.cljs | clojure |
Copyright (c) KALEIDOS INC | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.data.workspace.path.undo
(:require
[app.common.data :as d]
[app.common.data.undo-stack :as u]
[app.common.uuid :as uuid... |
e93cb6966defd781211dea192e815eebbd8590faba40215047d2e84d61dc636b | ndmitchell/build-shootout | Main.hs | #!/usr/bin/env runhaskell
-- | A test script to check those build systems claiming to implement a test
-- do in fact do so.
module Main(main) where
import Util
main :: IO ()
main = do
test "basic" basic
test "parallel" parallel
test "include" include
test "wildcard" wildcard
test "spaces" spac... | null | https://raw.githubusercontent.com/ndmitchell/build-shootout/40b2fd3804d89f8c7cf0a37b3a9d45a863be04ce/Main.hs | haskell | | A test script to check those build systems claiming to implement a test
do in fact do so. | #!/usr/bin/env runhaskell
module Main(main) where
import Util
main :: IO ()
main = do
test "basic" basic
test "parallel" parallel
test "include" include
test "wildcard" wildcard
test "spaces" spaces
test "monad1" monad1
test "monad2" monad2
test "monad3" monad3
test "unchanged" u... |
979b5e03110759eb65e30ac4941d602fffa73d016ae2e773eb35218e1ae0dc5e | ocaml-flambda/ocaml-jst | extensions.mli | * Syntax for our custom ocaml - jst language extensions . This module provides
two things :
1 . First - class ASTs for all syntax introduced by our language extensions ,
one for each OCaml AST we extend , divided up into one extension per
module and all available at once through modules... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/b1f0cf9f9114128db609bdd5a1edfda1e3144a30/parsing/extensions.mli | ocaml | * The ASTs for list and array comprehensions
* "in EXPR"
* PAT (in/=) ... [@...]
* "for PAT (in/=) ... and PAT (in/=) ... and ..."; must be nonempty
* "when EXPR"
* The body/generator of the comprehension
* The clauses of the comprehension; must be nonempty
* [BODY ...CLAUSES...]
* [|BODY ...CLAUSES...|] (flag ... | * Syntax for our custom ocaml - jst language extensions . This module provides
two things :
1 . First - class ASTs for all syntax introduced by our language extensions ,
one for each OCaml AST we extend , divided up into one extension per
module and all available at once through modules... |
be297e5b8d425b33fcf51d02f9c542ed5d5a1b8378f12b9a945dbe2ea33c67bd | fulcrologic/fulcro-inspect | main.cljs | (ns fulcro.inspect.chrome.content-script.main
(:require [goog.object :as gobj]
[cljs.core.async :as async :refer [go go-loop chan <! >! put!]]
[fulcro.inspect.remote.transit :as encode]))
(defonce active-messages* (atom {}))
(defn ack-message [msg]
(go
(let [id (gobj/get msg "__fulcro... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-inspect/a03b61cbd95384c0f03aa936368bcf5cf573fa32/src/chrome/fulcro/inspect/chrome/content_script/main.cljs | clojure | set browser icon
clear inspector
keep trying to send
restart the port in case of a timeout | (ns fulcro.inspect.chrome.content-script.main
(:require [goog.object :as gobj]
[cljs.core.async :as async :refer [go go-loop chan <! >! put!]]
[fulcro.inspect.remote.transit :as encode]))
(defonce active-messages* (atom {}))
(defn ack-message [msg]
(go
(let [id (gobj/get msg "__fulcro... |
2a87bb3741a167cec068a65f8fee596b05b054c572806ae3b75593378bd86325 | alaq/learning-clojure-in-public | project.clj | (defproject scratch "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[cheshire "5.3.1"]])
| null | https://raw.githubusercontent.com/alaq/learning-clojure-in-public/27d11c1d8cad289b3fb9278082812a019d42b8d8/code/scratch/project.clj | clojure | (defproject scratch "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[cheshire "5.3.1"]])
| |
10a9d1e28c593215f8aa7a80f4b7542ed2cb97f5d1855d1596b42a422ac015e3 | arichiardi/sicp-clojure | 1_2_exercises_1_21_1_28.clj | (ns sicp-clojure.1-2-exercises-1-21-1-28
(:require [clojure.test :as t]
[clojure.math.numeric-tower :as m]
[sicp-clojure.utils :as u]
[sicp-clojure.1-2-samples :as s]))
Exercise 1.21
;; Use the smallest-divisor procedure to find the smallest divisor of each of the following numb... | null | https://raw.githubusercontent.com/arichiardi/sicp-clojure/2dc128726406b12de3eaf38fea58dc469e3a60a6/src/sicp_clojure/1_2_exercises_1_21_1_28.clj | clojure | Use the smallest-divisor procedure to find the smallest divisor of each of the following numbers:
See tests at the bottom.
(search-first-n-primes-in-range 10000 99999 3)
(search-first-n-primes-in-range 100000 999999 3)
= > ~ 2800
= > ~ 8500
= > ~ 17000
= > ~ 55000
Even if the recursion causes stack overflow most... | (ns sicp-clojure.1-2-exercises-1-21-1-28
(:require [clojure.test :as t]
[clojure.math.numeric-tower :as m]
[sicp-clojure.utils :as u]
[sicp-clojure.1-2-samples :as s]))
Exercise 1.21
199 , 1999 , 19999 .
Exercise 1.22
(defn- search-helper [start end n primes]
(cond (= ... |
255148730b46280d3f72bdd899e5bb81c58c0dd018a8aeaa84dbda50c318f222 | vert-x/mod-lang-clojure | buffer.clj | Copyright 2013 the original author or authors .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/vert-x/mod-lang-clojure/dcf713460b8f46c08d0db6e7bf8537f1dd91f297/api/src/main/clojure/vertx/buffer.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright 2013 the original author or authors .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns vertx.buffer
"Functions for operating on Vert.x Buffers.
A Buffer represents a sequence of zero or more bytes that can be
written to or read from, and which expands as necessary to
ac... |
f0bfe9cce0105a424c76ff2fc55927a0b84aa0232bb181b2aa1ea73593a13bf6 | dmiller/clr.core.logic | nominal.clj | Copyright ( c ) , , contributors . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing... | null | https://raw.githubusercontent.com/dmiller/clr.core.logic/385e105b887e769ea934fcd127e7f520c0e101dd/src/main/clojure/clojure/core/logic/nominal.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , , contributors . All rights reserved .
(ns clojure.core.logic.nominal
(:refer-clojure :exclude [== hash])
(:use [clojure.core.logic.protocols]
[clojure.core.logic :exclude [fresh] :as l])
(:require [clojure.pprint :as pp])
[clojure.core.logic LVar LCons]
[c... |
300da33bc38592a37bfcfdbe288722efe03e7171322f826d3aa2914cd734c9b9 | SumitPadhiyar/confuzz | lwt_process.ml | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
type command = string * string array
let shell =
if Sys.win32 then
fun cmd -> ("", [|"cmd.exe"; "/c"; "\000" ^ cmd|])
else
fun cmd -> ("", [|"/bin/sh"; "-... | null | https://raw.githubusercontent.com/SumitPadhiyar/confuzz/7d6b2af51d7135025f9ed1e013a9ae0940f3663e/src/unix/lwt_process.ml | ocaml | +-----------------------------------------------------------------+
| OS-depentent command spawning |
+-----------------------------------------------------------------+
The process id.
A handle on windows, and a dummy value of Unix.
Do not run at_exit hooks
+-----------... | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
type command = string * string array
let shell =
if Sys.win32 then
fun cmd -> ("", [|"cmd.exe"; "/c"; "\000" ^ cmd|])
else
fun cmd -> ("", [|"/bin/sh"; "-... |
1d1492788b541e320c7a6cee5c9c231d0247de4bf188e60505c1297bfb3e8e50 | typedclojure/typedclojure | check_form.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/b67795220d68f4f8282485dfa6fb3f6444d7b1ae/typed/cljs.checker/src/typed/cljs/checker/check_form.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns typed.cljs.checker.check-form
(:require [cljs.compiler :as comp]
[cljs.env :as env]
[clojure.core.typed.ast-utils :as ast-u]
[clojure.core.typed.current-impl :as impl]
[typed.cljc.checker.check-form :as chk-form2]
TODO un... |
f078203127fe2490a97d117141519a18ae7cf04fb85827eae7c2fe70b1694feb | jrh13/hol-light | gcdrecurrence.ml | (* ========================================================================= *)
(* Some divisibility properties of certain linear integer recurrences. *)
(* ========================================================================= *)
needs "Library/prime.ml";;
needs "Library/integer.ml";;
prioritize_int();;
(*... | null | https://raw.githubusercontent.com/jrh13/hol-light/ea44a4cacd238d7fa5a397f043f3e3321eb66543/Examples/gcdrecurrence.ml | ocaml | =========================================================================
Some divisibility properties of certain linear integer recurrences.
=========================================================================
-------------------------------------------------------------------------
A customized in... |
needs "Library/prime.ml";;
needs "Library/integer.ml";;
prioritize_int();;
let INDUCT_SPECIAL = prove
(`!P. (!n. P 0 n) /\
(!m n. P m n <=> P n m) /\
(!m n. P m n ==> P n (m + n))
==> !m n. P m n`,
GEN_TAC THEN STRIP_TAC THEN
REPEAT GEN_TAC THEN WF_INDUCT_TAC `m + n:num` THEN
ASM_CASES_T... |
bc7235d8c296ed13c38b0c6d026ca84c5f5bcb2124f6e35e67831e118e144198 | liquidz/antq | git.clj | (ns antq.util.git
(:require
[antq.constant :as const]
[antq.log :as log]
[antq.util.async :as u.async]
[clojure.java.shell :as sh]
[clojure.string :as str]))
(defn- extract-tags
[ls-remote-resp]
(some->> (:out ls-remote-resp)
(str/split-lines)
(keep #(second (str/split % #"\t... | null | https://raw.githubusercontent.com/liquidz/antq/ca8472b28702f5e568492001bc476fb09e5b2e6b/src/antq/util/git.clj | clojure | Remove annotated tags
Annotated tag
NOTE: The annotated tag have priority
If there is an exact match, it is preferred | (ns antq.util.git
(:require
[antq.constant :as const]
[antq.log :as log]
[antq.util.async :as u.async]
[clojure.java.shell :as sh]
[clojure.string :as str]))
(defn- extract-tags
[ls-remote-resp]
(some->> (:out ls-remote-resp)
(str/split-lines)
(keep #(second (str/split % #"\t... |
549e6d2a1c1f97fa7b0d3ba2c586d55a87e3cfad5ebd20336c66a4137cc14175 | 2600hz/kazoo | cb_search.erl | %%%-----------------------------------------------------------------------------
( C ) 2011 - 2020 , 2600Hz
%%% @doc Crossbar API for search.
@author
%%%
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can ... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/applications/crossbar/src/modules/cb_search.erl | erlang | -----------------------------------------------------------------------------
@doc Crossbar API for search.
@end
-----------------------------------------------------------------------------
=============================================================================
API
==========================================... | ( C ) 2011 - 2020 , 2600Hz
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(cb_search).
-export([init/0
,allowed_methods/0 ,allowed_methods/1
,resource_e... |
a148db8dd10108ab9014c84a69c678e3fdc7b10fc004ab81beab571c55a63942 | nilenso/goose | client.clj | (ns goose.client
"Functions for executing job in async, scheduled or periodic manner."
(:require
[goose.broker :as b]
[goose.defaults :as d]
[goose.job :as j]
[goose.retry :as retry]
[goose.utils :as u])
(:import
(java.time Instant)))
(def default-opts
"Map of sample configs for produci... | null | https://raw.githubusercontent.com/nilenso/goose/cf42be9a79f4d0a8c65a93d8cb850bdc666bccb2/src/goose/client.clj | clojure | (ns goose.client
"Functions for executing job in async, scheduled or periodic manner."
(:require
[goose.broker :as b]
[goose.defaults :as d]
[goose.job :as j]
[goose.retry :as retry]
[goose.utils :as u])
(:import
(java.time Instant)))
(def default-opts
"Map of sample configs for produci... | |
3be5dc3d1b66c0677789d075cabd6f648dbbc90296594ea558f61b26052c5cda | dyoo/ffi-tutorial | info.rkt | #lang setup/infotab
(define name "A simple f2c temperature conversion example")
(define pre-install-collection "pre-installer.rkt")
| null | https://raw.githubusercontent.com/dyoo/ffi-tutorial/1efba84503adf4a062c4855225eabe992a06a34f/ffi/tutorial/examples/f2c/info.rkt | racket | #lang setup/infotab
(define name "A simple f2c temperature conversion example")
(define pre-install-collection "pre-installer.rkt")
| |
cf41aa31706997999ee8b1ea3fedbfe1cf45a627673143d1cb79333bd7a6f2ce | clojure-interop/aws-api | project.clj | (defproject clojure-interop/com.amazonaws.services.servicecatalog "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.servicecatalog"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:sour... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.servicecatalog/project.clj | clojure | (defproject clojure-interop/com.amazonaws.services.servicecatalog "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.servicecatalog"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:sour... | |
65e9646ea7d661887a23590dd022c90469fcf6dbedf03891ed5739ff9eaa0cb3 | hellonico/origami-fun | warping.clj | gorilla-repl.fileformat = 1
;; **
;;; # Warping
;; **
;; @@
(ns talented-silence
(:require
[opencv4.core :refer :all]
[opencv4.video :as v]
[opencv4.colors.rgb :as rgb]
[opencv4.utils :as u]
[opencv4.gorilla :as g]))
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-nil'>nil</span>","valu... | null | https://raw.githubusercontent.com/hellonico/origami-fun/80117788530d942eaa9a80e2995b37409fa24889/gorillas/chapter04/warping.clj | clojure | **
# Warping
**
@@
@@
=>
{"type":"html","content":"<span class='clj-nil'>nil</span>","value":"nil"}
<=
**
**
@@
@@
=>
{"type":"html","content":"<span class='clj-var'>#'talented-silence/my-fn</span>","value":"#'talented-silence/my-fn"}
<=
@@
@@
=>
{"type":"html","content":"<span class='clj-var'>#... | gorilla-repl.fileformat = 1
(ns talented-silence
(:require
[opencv4.core :refer :all]
[opencv4.video :as v]
[opencv4.colors.rgb :as rgb]
[opencv4.utils :as u]
[opencv4.gorilla :as g]))
# # # warping
(defn my-fn[mat]
(-> mat
(put-text! (str (java.util.Date.)) (new-point 100 50) FONT_HERS... |
ba0d40f5e79c933e4b3a78eadf3d81788b97ad57dee58182ae143f27c227b2f2 | emillon/ocaml-zeit | test_client.ml | open OUnit2
let cases = ( >::: )
module Cohttp_mock = struct
let call mock meth headers uri ~body =
Mock.call mock (meth, headers, uri, body)
let configure mock ~status ~body =
Mock.configure mock
(Mock.return (Lwt.return (Cohttp.Response.make ~status (), body)))
let equal_meth a b =
Strin... | null | https://raw.githubusercontent.com/emillon/ocaml-zeit/cdcdd0b155d406d1b8c8947e3c620527c3c9ecf7/test/test_client.ml | ocaml | open OUnit2
let cases = ( >::: )
module Cohttp_mock = struct
let call mock meth headers uri ~body =
Mock.call mock (meth, headers, uri, body)
let configure mock ~status ~body =
Mock.configure mock
(Mock.return (Lwt.return (Cohttp.Response.make ~status (), body)))
let equal_meth a b =
Strin... | |
f00d4461dc835bf0e82da2d1bd42712a89b2edc24cadd0a4b7d7b306dd048b1b | aistrate/Okasaki | RedBlackSet_Test.hs | import Test.HUnit
import Test.QuickCheck
import Data.List (sort, nub, group)
import Text.Printf (printf)
import TestHelper
import RedBlackSet -- 6.46s
--import Ex03_10a -- 6.27s
6.07s
main = do printTime $ runTestTT hunitTests
printTime $ mapM_ (\(s,a) -> printf "%-25s: " s >> a) qcheckTests
huni... | null | https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/MyCode/Ch03/RedBlackSet_Test.hs | haskell | 6.46s
import Ex03_10a -- 6.27s
"No red node has a red child"
"Every path from the root to an empty node
contains the same number of black nodes" | import Test.HUnit
import Test.QuickCheck
import Data.List (sort, nub, group)
import Text.Printf (printf)
import TestHelper
6.07s
main = do printTime $ runTestTT hunitTests
printTime $ mapM_ (\(s,a) -> printf "%-25s: " s >> a) qcheckTests
hunitTests = TestList [
"fromList/sorted input" ~:
[
testSe... |
8aac6e5cf6a77dd0ef18c5e17d42fba5d26c7a62c8278165fcbc784f780725ec | VERIMAG-Polyhedra/VPL | Var.ml | type t =
* Last bit : represents value 1 . The end of a path .
* Bit 0 . Take the left branch .
* Bit 1 . Take the right branch .
let toInt: t -> int
= fun p0 ->
let inc i =
let msb = Stdlib.max_int - (Stdlib.max_int lsr 1) in
if i = msb then (* overflow *)
Stdlib.invalid_arg "Var.toInt"
else
i lsl 1
in
... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/ocaml/datatypes/Var.ml | ocaml | overflow | type t =
* Last bit : represents value 1 . The end of a path .
* Bit 0 . Take the left branch .
* Bit 1 . Take the right branch .
let toInt: t -> int
= fun p0 ->
let inc i =
let msb = Stdlib.max_int - (Stdlib.max_int lsr 1) in
Stdlib.invalid_arg "Var.toInt"
else
i lsl 1
in
let rec fn i msb = function
| ... |
030be4fd3880c63e02611ee2370e60e550f98499705f6dc582fdbd5c59738c55 | INRIA/zelus | lident.ml | (***********************************************************************)
(* *)
(* *)
(* Zelus, a synchronous language for hybrid systems *)
(* ... | null | https://raw.githubusercontent.com/INRIA/zelus/685428574b0f9100ad5a41bbaa416cd7a2506d5e/compiler/global/lident.ml | ocaml | *********************************************************************
Zelus, a synchronous language for hybrid systems
... | ( c ) 2020 Paris ( see the file )
Automatique . All rights reserved . This file is distributed under
the terms of the INRIA Non - Commercial License Agreement ( see the
type t =
| Name of string
| Modname of qualident
and qualident = { qual: string; id: string }
let q... |
37dc49c9340083554613b63bd7d6ab6148b7626261151ae0873b299776c18504 | w3ntao/sicp-solution | 2-36.rkt | #lang racket
(define nil '())
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (accumulate-n op init seqs)
(if (null? (car seqs))
nil
(cons (accumulate op
init
... | null | https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-2/2-36.rkt | racket | (get-first-row test-case)
(get-remain-row test-case) | #lang racket
(define nil '())
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (accumulate-n op init seqs)
(if (null? (car seqs))
nil
(cons (accumulate op
init
... |
9af5d851a57b0b6119f5c8b5048af8174804a35ae5c962d88dd7420af5072bfa | avsm/platform | test.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/uucp.12.0.0%2Bdune/test/test.ml | ocaml | Test Uucp.Block.blocks at the same time | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
7b5575a9f86722642fef0fedc39a0e70bf47b0723c79836e8d4eae752807b34d | wh5a/thih | ConWithType.hs | -- ConWithType.hs
Output : 3
data Weird a b = Funny (a -> b)
data Woo a = W | N a
--fun :: Weird a b -> a -> b
fun = \w -> \x -> case w of
Funny f -> f x
-- main :: Int
main = fun (Funny inc) 2
inc :: Int -> Int
inc = \x -> x + 1
| null | https://raw.githubusercontent.com/wh5a/thih/dc5cb16ba4e998097135beb0c7b0b416cac7bfae/hatchet/examples/ConWithType.hs | haskell | ConWithType.hs
fun :: Weird a b -> a -> b
main :: Int | Output : 3
data Weird a b = Funny (a -> b)
data Woo a = W | N a
fun = \w -> \x -> case w of
Funny f -> f x
main = fun (Funny inc) 2
inc :: Int -> Int
inc = \x -> x + 1
|
626a0b46ea3dad21568e7dc359586dbd3cd525a5ac9991ccf1642f4cf6bbdf8b | plumatic/grab-bag | suggestions.clj | (ns domain.suggestions
"Schema for Suggestion Group"
(:use plumbing.core)
(:require
[schema.core :as s]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Schema
(def +suggestion-sources+
#{:facebook :twitter :curated :local :grabbag :pocket :google})
(s/... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/domain/src/domain/suggestions.clj | clojure |
Schema | (ns domain.suggestions
"Schema for Suggestion Group"
(:use plumbing.core)
(:require
[schema.core :as s]))
(def +suggestion-sources+
#{:facebook :twitter :curated :local :grabbag :pocket :google})
(s/defschema SuggestionGroupSource
(apply s/enum +suggestion-sources+))
(s/defschema SuggestionGroupType
... |
d2eaafedd22cfb60a859ee90fb0a41901b10a946f74b31725045f5a2a594d4ab | danilkolikov/dfl | Ast.hs | |
Module : Frontend . Desugaring . Grouping . Ast
Description : Desugared version of AST of DFL
Copyright : ( c ) , 2019
License : MIT
Desugared version of AST of DFL . Nodes with the same names are grouped together ,
names are disambiguated .
Module : Frontend.Desugaring.... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Frontend/Desugaring/Grouping/Ast.hs | haskell | | Infix pattern
| Pattern
^ Infix pattern
^ Application of a constructor
^ Application of a record constructor
^ Variable with possible pattern
^ Constant
^ Wildcard
| Record pattern binding
^ Field name
^ Pattern
| Infix expression
| Expression
^ Expression with an explicitly specified type
^ Lambda-abs... | |
Module : Frontend . Desugaring . Grouping . Ast
Description : Desugared version of AST of DFL
Copyright : ( c ) , 2019
License : MIT
Desugared version of AST of DFL . Nodes with the same names are grouped together ,
names are disambiguated .
Module : Frontend.Desugaring.... |
0489838bc311de94a16c1adf6ca952583a98d3eec7aacbb256e0fac0b3fd33e8 | tsloughter/kuberl | kuberl_v1beta1_eviction.erl | -module(kuberl_v1beta1_eviction).
-export([encode/1]).
-export_type([kuberl_v1beta1_eviction/0]).
-type kuberl_v1beta1_eviction() ::
#{ 'apiVersion' => binary(),
'deleteOptions' => kuberl_v1_delete_options:kuberl_v1_delete_options(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:ku... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_eviction.erl | erlang | -module(kuberl_v1beta1_eviction).
-export([encode/1]).
-export_type([kuberl_v1beta1_eviction/0]).
-type kuberl_v1beta1_eviction() ::
#{ 'apiVersion' => binary(),
'deleteOptions' => kuberl_v1_delete_options:kuberl_v1_delete_options(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:ku... | |
0e20d0609d395df1737405d2fb4ec48152218d137d5d9d47cc0aba8069528037 | anoma/juvix | Types.hs | module Juvix.Compiler.Backend.C.Data.Types where
import Juvix.Compiler.Backend.C.Data.BuiltinTable
import Juvix.Compiler.Backend.C.Language
import Juvix.Compiler.Internal.Language qualified as Micro
import Juvix.Prelude
newtype MiniCResult = MiniCResult
{ _resultCCode :: Text
}
data BindingInfo = BindingInfo
{... | null | https://raw.githubusercontent.com/anoma/juvix/01a44e436d9495b5f83bb8b7001225c62775cd75/src/Juvix/Compiler/Backend/C/Data/Types.hs | haskell | module Juvix.Compiler.Backend.C.Data.Types where
import Juvix.Compiler.Backend.C.Data.BuiltinTable
import Juvix.Compiler.Backend.C.Language
import Juvix.Compiler.Internal.Language qualified as Micro
import Juvix.Prelude
newtype MiniCResult = MiniCResult
{ _resultCCode :: Text
}
data BindingInfo = BindingInfo
{... | |
62acdb9cc329547b3265b76a3b3e51b7306868e8f364cbd77740491f0d745878 | petelliott/pscheme | library.scm | (define-library (pscheme compiler library)
(import (scheme base)
(scheme file)
(srfi 1)
(srfi 28)
(pscheme compiler compile)
(pscheme compiler syntax)
(pscheme string))
(export library?
library-name
library-imports
library-def... | null | https://raw.githubusercontent.com/petelliott/pscheme/b529ac9d102047e332a6f03ca9a65868b0b82a59/scm/pscheme/compiler/library.scm | scheme | TODO: we should resolve local shadowing before exported globals | (define-library (pscheme compiler library)
(import (scheme base)
(scheme file)
(srfi 1)
(srfi 28)
(pscheme compiler compile)
(pscheme compiler syntax)
(pscheme string))
(export library?
library-name
library-imports
library-def... |
fdb3705e09cb5028748e0353ee69d8821333e639a99c32c423eea0a9495841e8 | BitGameEN/bitgamex | ranch_acceptor.erl | Copyright ( c ) 2011 - 2018 , < >
%%
%% Permission to use, copy, modify, and/or 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.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/ranch/src/ranch_acceptor.erl | erlang |
Permission to use, copy, modify, and/or 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
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2011 - 2018 , < >
THE 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 PROFITS , WHETHER IN AN
-module(ranch_acceptor).
-export([start_link/4]).
-e... |
a4cc49a67ffc150c5dfcff468a8a5c9ee6f3d8f8b37578a8c49e87ab55e028bf | dannypsnl/plt-research | info.rkt | #lang info
(define collection "continuations")
(define deps '("base"))
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
(define pkg-desc "Description Here")
(define version "0.0")
(define pkg-authors '(dannypsnl))
| null | https://raw.githubusercontent.com/dannypsnl/plt-research/6e8c2af4252f418cb84ac1ead49991c89c5f377b/continuations/info.rkt | racket | #lang info
(define collection "continuations")
(define deps '("base"))
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
(define pkg-desc "Description Here")
(define version "0.0")
(define pkg-authors '(dannypsnl))
| |
03ae7bca214461259b34dc924c9a55d7962b828186555585a32322b35abf6005 | DHSProgram/DHS-Indicators-SPSS | WE_ASSETS_MR.sps | * Encoding: windows-1252.
*****************************************************************************************************
Program: WE_ASSETS_MR.sps
Purpose: Code to compute employment, earnings, and asset ownership in men and women
Data inputs: MR dataset
Data outputs: coded variables
Author: Shireen ... | null | https://raw.githubusercontent.com/DHSProgram/DHS-Indicators-SPSS/578e6d40eff9edebda7cf0db0d9a0a52a537d98c/Chap15_WE/WE_ASSETS_MR.sps | scheme | * Encoding: windows-1252.
*****************************************************************************************************
Program: WE_ASSETS_MR.sps
Purpose: Code to compute employment, earnings, and asset ownership in men and women
Data inputs: MR dataset
Data outputs: coded variables
Author: Shireen ... | |
67a455633ad0b782ada6a02d938cebc3f7c3cada339aceadca2622c64bfe51f9 | BranchTaken/Hemlock | test_wI_wX.ml | open! Basis.Rudiments
open! Basis
let test () =
File.Fmt.stdout
|> (fun formatter ->
List.fold I128.([of_string "0x8000_0000_0000_0000_0000_0000_0000_0000i128"; of_i64 (-1L);
of_i64 0L; of_i64 1L; of_string "0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffffi128"])
~init:formatter ~f:(fun formatter i ->
... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/convert/test_wI_wX.ml | ocaml | open! Basis.Rudiments
open! Basis
let test () =
File.Fmt.stdout
|> (fun formatter ->
List.fold I128.([of_string "0x8000_0000_0000_0000_0000_0000_0000_0000i128"; of_i64 (-1L);
of_i64 0L; of_i64 1L; of_string "0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffffi128"])
~init:formatter ~f:(fun formatter i ->
... | |
6b601a388e8c9530cb5949228a356ea2b823a71f10a0316e6958d92766fc0181 | binaryage/cljs-oops | schema.clj | (ns oops.schema
"The code for compile-time conversion of selectors to paths. Uses clojure.spec to do the heavy-lifting."
(:require [clojure.spec.alpha :as s]
[clojure.walk :refer [postwalk]]
[clojure.string :as string]
[oops.config :as config]
[oops.sdefs :as sdefs]
... | null | https://raw.githubusercontent.com/binaryage/cljs-oops/a2b48d59047c28decb0d6334e2debbf21848e29c/src/lib/oops/schema.clj | clojure | --- path utils ------------------------------------------------------------------------------------------------------------
in case of multiple standalone modifiers in a row, the left-most one wins | (ns oops.schema
"The code for compile-time conversion of selectors to paths. Uses clojure.spec to do the heavy-lifting."
(:require [clojure.spec.alpha :as s]
[clojure.walk :refer [postwalk]]
[clojure.string :as string]
[oops.config :as config]
[oops.sdefs :as sdefs]
... |
1b81bf479a607e3494477db27e9640155739500492044b383a780733c7fd04f5 | iand675/hs-opentelemetry | Detector.hs | module OpenTelemetry.Resource.Service.Detector where
import qualified Data.Text as T
import OpenTelemetry.Resource.Service
import System.Environment (getProgName, lookupEnv)
{- | Detect a service name using the 'OTEL_SERVICE_NAME' environment
variable. Otherwise, populates the name with 'unknown_service:process_nam... | null | https://raw.githubusercontent.com/iand675/hs-opentelemetry/b08550db292ca0d8b9ce9156988e6d08dd6a2e61/sdk/src/OpenTelemetry/Resource/Service/Detector.hs | haskell | | Detect a service name using the 'OTEL_SERVICE_NAME' environment
variable. Otherwise, populates the name with 'unknown_service:process_name'.
| module OpenTelemetry.Resource.Service.Detector where
import qualified Data.Text as T
import OpenTelemetry.Resource.Service
import System.Environment (getProgName, lookupEnv)
detectService :: IO Service
detectService = do
mSvcName <- lookupEnv "OTEL_SERVICE_NAME"
svcName <- case mSvcName of
Nothing -> T.pack ... |
c851ad20d58584a39646642f7a39d5fc374ba0a537b9d4074f8e3f0e4f473973 | lambdamikel/DLMAPS | syntactic-sugar12.lisp | -*- Mode : Lisp ; Syntax : Ansi - Common - Lisp ; Package : THEMATIC - SUBSTRATE ; Base : 10 -*-
(in-package :THEMATIC-SUBSTRATE)
(defmethod transform-datatype-expression ((parser nrql-abox-query-parser) property expr)
( and ( min 3 ) ( max 5 ) ( or ... ) )
(let ((attribute (get-attribute-for-datatype-property... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/query/syntactic-sugar12.lisp | lisp | Syntax : Ansi - Common - Lisp ; Package : THEMATIC - SUBSTRATE ; Base : 10 -*-
sonst wurde schon ersetzt!
TYPE CHECK:
(parser-error expr)
|
(in-package :THEMATIC-SUBSTRATE)
(defmethod transform-datatype-expression ((parser nrql-abox-query-parser) property expr)
( and ( min 3 ) ( max 5 ) ( or ... ) )
(let ((attribute (get-attribute-for-datatype-property parser property)))
(labels ((get-simple-expressions (list)
(remove-if-not #'(l... |
bfd3355a26f51d58aa11809f2f064c3baa4d0d52999ad8bbb9585caa579ea84a | VisionsGlobalEmpowerment/webchange | views_row.cljs | (ns webchange.editor-v2.course-table.views-row
(:require
[cljs-react-material-ui.icons :as ic]
[cljs-react-material-ui.reagent :as ui]
[re-frame.core :as re-frame]
[webchange.editor-v2.course-table.fields.activities.views :refer [activities]]
[webchange.editor-v2.course-table.fields.concepts.view... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/e5747e187937d85e9c92c728d52a704f323f00ef/src/cljs/webchange/editor_v2/course_table/views_row.cljs | clojure | (ns webchange.editor-v2.course-table.views-row
(:require
[cljs-react-material-ui.icons :as ic]
[cljs-react-material-ui.reagent :as ui]
[re-frame.core :as re-frame]
[webchange.editor-v2.course-table.fields.activities.views :refer [activities]]
[webchange.editor-v2.course-table.fields.concepts.view... | |
9aaa8e971d6bfb7d4347b8e343403262bd5ffe3d13026073228acbd16f55a868 | chrisdone/prana | Conc.hs | # LANGUAGE Unsafe #
# LANGUAGE CPP , NoImplicitPrelude #
# OPTIONS_GHC -Wno - missing - signatures #
# OPTIONS_HADDOCK not - home #
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Conc
Copyright : ( c ) The University of Glasgow , 1994 - 2002
-- License ... | null | https://raw.githubusercontent.com/chrisdone/prana/f2e45538937d326aff562b6d49296eaedd015662/prana-boot/packages/base-4.11.1.0/GHC/Conc.hs | haskell | ---------------------------------------------------------------------------
|
Module : GHC.Conc
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
Basic concurrency stuff.
---------------------------------------------------------------------------
No: #hide, because bits o... | # LANGUAGE Unsafe #
# LANGUAGE CPP , NoImplicitPrelude #
# OPTIONS_GHC -Wno - missing - signatures #
# OPTIONS_HADDOCK not - home #
Copyright : ( c ) The University of Glasgow , 1994 - 2002
Portability : non - portable ( GHC extensions )
module GHC.Conc
( ThreadId(..)
, forkIO
, f... |
b976b3e6422238c9c44035f9663413a5c76d8fd627ca0200beb6c288f94d6e30 | kayhide/wakame | Row.hs | module Test.Wakame.Row where
import GHC.Generics
import Test.Tasty
import Test.Tasty.Hspec
import Test.Tasty.QuickCheck
import Test.Utils ()
import Wakame.Generics ()
import Wakame.Row (NP (..), V (..), fromRow, toRow)
data Point = Point { x :: Double, y :: Double }
deriving (Eq, Show, Generic)
prop_toRow :: (V '... | null | https://raw.githubusercontent.com/kayhide/wakame/4d16ecf2221655300b5db588c2775cfc0b8d92cd/test/tasty/Test/Wakame/Row.hs | haskell | module Test.Wakame.Row where
import GHC.Generics
import Test.Tasty
import Test.Tasty.Hspec
import Test.Tasty.QuickCheck
import Test.Utils ()
import Wakame.Generics ()
import Wakame.Row (NP (..), V (..), fromRow, toRow)
data Point = Point { x :: Double, y :: Double }
deriving (Eq, Show, Generic)
prop_toRow :: (V '... | |
b19dc98e2be4c1be36a36dba21bdf0a06e3acecd6b5a056ad4f015e842089e07 | active-group/reacl-c | core_testing.cljc | (ns reacl-c.test-util.core-testing
(:require [reacl-c.base :as base]
[reacl-c.dom-base :as dom]
[reacl-c.core :as c]
[active.clojure.lens :as lens]
[clojure.string :as string]
[clojure.set :as set])
(:refer-clojure :exclude [contains?]))
(def ^:private cl... | null | https://raw.githubusercontent.com/active-group/reacl-c/46e7cf3512de0c3db4edae0b770f2f26dd64f9b5/src/reacl_c/test_util/core_testing.cljc | clojure | Only pure tests: No local-/state changes, no implicit mounting (init), no effects, no subscriptions.
TODO:?
TODO: + react items?
-> or an IRenderable extension point?
l1 contains l2 ?
if a1 contains a2; resp. a2 < a1
or sub matching for style and class attributes
item has all events defined that sub-item has:
... | (ns reacl-c.test-util.core-testing
(:require [reacl-c.base :as base]
[reacl-c.dom-base :as dom]
[reacl-c.core :as c]
[active.clojure.lens :as lens]
[clojure.string :as string]
[clojure.set :as set])
(:refer-clojure :exclude [contains?]))
(def ^:private cl... |
66cf856ce0ca370e7d8922a069f319db7d84eb4bc2cb3edebca1f90f44e354bf | jacekschae/learn-reitit-course-files | test_system.clj | (ns cheffy.test-system
(:require [clojure.test :refer :all]
[integrant.repl.state :as state]
[ring.mock.request :as mock]
[muuntaja.core :as m]))
(defn test-endpoint
([method uri]
(test-endpoint method uri nil))
([method uri opts]
(let [app (-> state/system :cheffy/app)
... | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/28-auth0-test-config/test/cheffy/test_system.clj | clojure | (ns cheffy.test-system
(:require [clojure.test :refer :all]
[integrant.repl.state :as state]
[ring.mock.request :as mock]
[muuntaja.core :as m]))
(defn test-endpoint
([method uri]
(test-endpoint method uri nil))
([method uri opts]
(let [app (-> state/system :cheffy/app)
... | |
bbb6d417568b328902848c9a0fe3e2abc3693e3d55030bc07b5998aa28fe0bd0 | Haskell-Things/HSlice | Orphans.hs | {- ORMOLU_DISABLE -}
- Copyright 2016 and
- Copyright 2019
-
- This program is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation , either version 3 of the License , or
- ( at your ... | null | https://raw.githubusercontent.com/Haskell-Things/HSlice/73c6bf1f34c946cd5903306b106356fcb73d916c/Graphics/Slicer/Orphans.hs | haskell | ORMOLU_DISABLE
This file is a container for orphan instances. these should go in their appropriate upstreams.
So that none of the orphans here generate warnings.
So we can use ℝ in instance declarations.
So we can add generic to ℝ
So we can add generic to ℝ
| Take apart a double, returning things hasTrie can al... |
- Copyright 2016 and
- Copyright 2019
-
- This program is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation , either version 3 of the License , or
- ( at your option ) any later ve... |
705ad4ca1ae4e1ef81ff13a7e79840af01411e8cb57e080d010b88b7a284e89a | 5HT/ant | Galley.ml |
open XNum;
open Runtime;
open Dim;
open Box;
type line_params =
{
baseline_skip : dim; (* amount of glue between baselines *)
line_skip_limit : num; (* minimal amout of glue between lines *)
line_skip : dim; (* the amout if the lines ar... | null | https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Typesetting/Galley.ml | ocaml | amount of glue between baselines
minimal amout of glue between lines
the amout if the lines are closer together
list of all lines and glue in reverse order
glue at the end of the galley
the width of the galley
<off> is the vertical offset of <b2> w.r.t. <b... |
open XNum;
open Runtime;
open Dim;
open Box;
type line_params =
{
leading : box -> box -> line_params -> dim;
penalty between two lines
};
type space_params =
{
space_factor : num;
space_skip : option dim;
xspace_skip : option dim;
victorian_spacing : bool
}... |
fc8ebc0c501d7ab60c3198da01f8a41c2cdf19b811969a4e71379aa11c645003 | screenshotbot/screenshotbot-oss | test-cdn.lisp | ;; Copyright 2018-Present Modern Interpreters Inc.
;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :util.test-cdn
(:use :cl
:alexandria
:fiveam))
(in-package :util... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/2372e102c5ef391ed63aa096f678e2ad1df36afe/src/util/tests/test-cdn.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
| This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :util.test-cdn
(:use :cl
:alexandria
:fiveam))
(in-package :util.test-cdn)
(def-suite* :util.test-cdn)
(test should-... |
071bea4d4ecd1f1da922bc73d7269968a7c836e5e82f420be3fa62addad7656a | freckle/faktory_worker_haskell | Main.hs | module Main (main) where
import Prelude
import Control.Exception.Safe
import Data.Aeson
import Faktory.Job (perform)
import Faktory.Producer
import GHC.Generics
import System.Environment (getArgs)
-- | Must match examples/consumer
newtype Job = Job { jobMessage :: String }
deriving stock Generic
deriving anyclas... | null | https://raw.githubusercontent.com/freckle/faktory_worker_haskell/1d58f03a54205430defc611356f31772421149be/examples/producer/Main.hs | haskell | | Must match examples/consumer | module Main (main) where
import Prelude
import Control.Exception.Safe
import Data.Aeson
import Faktory.Job (perform)
import Faktory.Producer
import GHC.Generics
import System.Environment (getArgs)
newtype Job = Job { jobMessage :: String }
deriving stock Generic
deriving anyclass ToJSON
main :: IO ()
main = bra... |
7de02afd102d1839869fe01dbfb2df1f91a9415c3deb16ef0f263dcd41a350c0 | A-Nony-Mus/Autolisp-Utilities | attredit.lsp | ;;**************************************************************************************************************;;
;;attredit ;;
;;Click on an attribute, enter value, repeat until enter is pressed ;;
Written CAB 12/7/17 ; ;
;;****************************************************************... | null | https://raw.githubusercontent.com/A-Nony-Mus/Autolisp-Utilities/d03e8f3feefe9377fa9c7dddd756d38011962c52/attredit.lsp | lisp | **************************************************************************************************************;;
attredit ;;
Click on an attribute, enter value, repeat until enter is pressed ;;
;
**********************************************************************************************************... | (defun c:attredit ( / pt ss)
(while (setq pt (getpoint "Select Attribute: "))
(setq ss (ssget pt))
(if ss
(if (eq (cdr (assoc 0 (entget (ssname ss 0)))) "INSERT")
(command ".attipedit" pt)
)
)
)
)
|
d65dcf0eaf48b296b2afe6670c11d5ede891d1d8bccc9dc0f267bdb0e81f5ac2 | JacquesCarette/Drasil | PrintingInformation.hs | # LANGUAGE TemplateHaskell #
-- | Defines types and functions to gather all the information needed for printing.
module Language.Drasil.Printing.PrintingInformation where
import Control.Lens (makeLenses, Lens', (^.))
import SysInfo.Drasil (sysinfodb, SystemInformation)
import Database.Drasil (ChunkDB)
import Languag... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/c00990e67f1072c0ae5b34847d0d8ff7c452af71/code/drasil-printers/lib/Language/Drasil/Printing/PrintingInformation.hs | haskell | | Defines types and functions to gather all the information needed for printing.
| Notation can be scientific or for engineering.
| Able to be printed.
| Holds the printing notation.
| Holds the printing configuration.
| Finds the notation used for the 'PrintingConfiguration'.
| Printing information contains a d... | # LANGUAGE TemplateHaskell #
module Language.Drasil.Printing.PrintingInformation where
import Control.Lens (makeLenses, Lens', (^.))
import SysInfo.Drasil (sysinfodb, SystemInformation)
import Database.Drasil (ChunkDB)
import Language.Drasil (Stage(..))
data Notation = Scientific
| Engineering
class ... |
052762be193007c40620fc7df660d5d51e9f0270a886ac406aaac797a0d624d3 | vernemq/vernemq_demo_plugin | vernemq_demo_plugin.erl | -module(vernemq_demo_plugin).
-behaviour(auth_on_register_hook).
-behaviour(auth_on_subscribe_hook).
-behaviour(auth_on_publish_hook).
-export([auth_on_register/5,
auth_on_publish/6,
auth_on_subscribe/3]).
%% This file demonstrates the hooks you typically want to use
%% if your plugin deals with Au... | null | https://raw.githubusercontent.com/vernemq/vernemq_demo_plugin/c21281609141733243dcb91c5dc1972996664390/src/vernemq_demo_plugin.erl | erlang | This file demonstrates the hooks you typically want to use
if your plugin deals with Authentication or Authorization.
All it does is:
- authenticate every user and write the log
- authorize every PUBLISH and SUBSCRIBE and write it to the log
needed for your use case.
IMPORTANT:
these hook functions run in... | -module(vernemq_demo_plugin).
-behaviour(auth_on_register_hook).
-behaviour(auth_on_subscribe_hook).
-behaviour(auth_on_publish_hook).
-export([auth_on_register/5,
auth_on_publish/6,
auth_on_subscribe/3]).
You do n't need to implement all of these hooks , just the one
auth_on_register({_IpAddr, _... |
b63026f84f8534b8d2387735afbbf7c8be2429666481ab8db1be99534ec971cf | ice1000/learn | perimeter-of-a-rectangle.hs | module Kata where
getPerimeter :: Int -> Int -> Int
getPerimeter x y = sum [x, x, y, y]
| null | https://raw.githubusercontent.com/ice1000/learn/4ce5ea1897c97f7b5b3aee46ccd994e3613a58dd/Haskell/CW-Kata/perimeter-of-a-rectangle.hs | haskell | module Kata where
getPerimeter :: Int -> Int -> Int
getPerimeter x y = sum [x, x, y, y]
| |
10e5dc29ef759c0ed4ef21a9c28b8907b511ec15d5969551590957b03e93cc66 | lordi/haskell-terminal | Theme.hs | module Hsterm.Theme (colorize) where
import Terminal.Types
import Data.Maybe (fromJust)
import Data.Colour.SRGB (Colour, sRGB24read)
colorMap = [ (Black, "#000000")
, (Red, "#ff6565")
, (Green, "#93d44f")
, (Yellow, "#eab93d")
, (Blue, "#204a87")
, (Magenta, "#ce5c00")
, (Cyan, "#89b6e2")
,... | null | https://raw.githubusercontent.com/lordi/haskell-terminal/037a1374c3e28a9cc00f9da0ec8b2887944ab943/src/Hsterm/Theme.hs | haskell | module Hsterm.Theme (colorize) where
import Terminal.Types
import Data.Maybe (fromJust)
import Data.Colour.SRGB (Colour, sRGB24read)
colorMap = [ (Black, "#000000")
, (Red, "#ff6565")
, (Green, "#93d44f")
, (Yellow, "#eab93d")
, (Blue, "#204a87")
, (Magenta, "#ce5c00")
, (Cyan, "#89b6e2")
,... | |
23f563ca73e9ceeda937e623115b7637e8a3a6a41e311003927e4e30a04a1516 | xvw/preface | pair.mli | val cases : count:int -> (string * unit Alcotest.test_case list) list
| null | https://raw.githubusercontent.com/xvw/preface/84a297e1ee2967ad4341dca875da8d2dc6d7638c/test/preface_laws_test/pair.mli | ocaml | val cases : count:int -> (string * unit Alcotest.test_case list) list
| |
e93fbbec9b3ed46dac8b059aaf7945c5e8e3e32571aff2ca4730392da8b76b1c | Workiva/eva | config.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/src/eva/contextual/config.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.contextual.config
(:require [clojure.spec.alpha :as s]))
(s/def ::config-options #{::as-per-config ::override})
(def ^:private config (atom {}))
(defn keep?
[tag option]
(cond
:else (throw (... |
3cb176df7e4a4ca427af72cfcb96fbd347bd80b105928b5caf052cc09894a7c9 | jrm-code-project/LISP-Machine | pfix.lisp | -*- Mode : LISP ; Package : FILE - SYSTEM ; : ZL ; ; Patch - File : T -*-
;;; FOR A LITTLE WHILE WRITE-PROPERTY-LIST WAS BROKEN.
;;; THIS KLUDGE TRIES TO READ THE PROPERTY LIST ANYWAY.
;;; EVEN GIVEN POSSIBLY INCORRECT LENGTH.
( C ) Copyright 1987 , LISP MACHINE INC
;;; See filename "Copyright.Text" for more in... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/gjcx/pkg/pfix.lisp | lisp | Package : FILE - SYSTEM ; : ZL ; ; Patch - File : T -*-
FOR A LITTLE WHILE WRITE-PROPERTY-LIST WAS BROKEN.
THIS KLUDGE TRIES TO READ THE PROPERTY LIST ANYWAY.
EVEN GIVEN POSSIBLY INCORRECT LENGTH.
See filename "Copyright.Text" for more information.
*********************************************************
****... |
( C ) Copyright 1987 , LISP MACHINE INC
* * * NOTE : This is an EXAMPLE , not LMI supported code . * * *
* * * are mere examples in one release may become built * * *
(DEFUN FIX-UP-AFTER-3-112-BUG ()
(LABELS ((RECURSE (PATH)
(PRINT PATH)
(DO ((L (FS:DIRECTORY-LIST PAT... |
dbc0a9c81d7d9eba453f6afa9d3bdf529bb2f17f97d7d0f243cb1a9b0153ba15 | engstrand-config/farg | reload.scm | (define-module (farg reload)
#:use-module (guix gexp)
#:use-module (srfi srfi-1)
#:use-module (ice-9 ftw)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 textual-ports)
#:export (reload-terminal-colors))
Procedures adapted from pywal , see :
(define (set-special index color)
(format #f "\x1b]~d;~a\x... | null | https://raw.githubusercontent.com/engstrand-config/farg/a4c3e7a459a8230decd01aa4f94b35df519c0acf/farg/reload.scm | scheme | Use default colors from palette
Override color index 0 and the named background color. | (define-module (farg reload)
#:use-module (guix gexp)
#:use-module (srfi srfi-1)
#:use-module (ice-9 ftw)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 textual-ports)
#:export (reload-terminal-colors))
Procedures adapted from pywal , see :
(define (set-special index color)
(format #f "\x1b]~d;~a\x... |
83b86710ebd0cf306eee1718ef3d05137200c59a9e85c267cff0f69ff4ed0a53 | yesodweb/wai | ForceSSLSpec.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module Network.Wai.Middleware.ForceSSLSpec
( main
, spec
) where
import Control.Monad (forM_)
import Data.ByteString (ByteString)
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid ((<>))
#endif
import Network.HTTP.Types (methodPost, status200, status301, ... | null | https://raw.githubusercontent.com/yesodweb/wai/5d1fd4926d0f210eb77c2bc0e546cb3cca6bc197/wai-extra/test/Network/Wai/Middleware/ForceSSLSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
module Network.Wai.Middleware.ForceSSLSpec
( main
, spec
) where
import Control.Monad (forM_)
import Data.ByteString (ByteString)
#if __GLASGOW_HASKELL__ < 804
import Data.Monoid ((<>))
#endif
import Network.HTTP.Types (methodPost, status200, status301, status307)
import Network.Wai
impor... |
9fb7efa9311ea1cc9183e82a1c36158389acaf45e3ba912f5eec6afa3b558866 | lisp-mirror/clpm | info.lisp | ;;;; clpm config info
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm-cli/commands/config/info
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/commands/config/common
#:clpm-cli/interface-de... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/cli/commands/config/info.lisp | lisp | clpm config info
LICENSE for license information. | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm-cli/commands/config/info
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/commands/config/common
#:clpm-cli/interface-defs
#:clpm/config)
(:import-from #:uiop
... |
149601df374ec027de17f5e4554994e34780044e2c102236f5d14f1fbe4abb1f | riemann/riemann | logstash.clj | (ns riemann.logstash
"Forwards events to LogStash."
(:refer-clojure :exclude [replace])
(:import
(java.net Socket
DatagramSocket
DatagramPacket
InetAddress)
(java.io Writer OutputStreamWriter BufferedWriter))
(:use [clojure.string :only [split join replace]]
... | null | https://raw.githubusercontent.com/riemann/riemann/1649687c0bd913c378701ee0b964a9863bde7c7c/src/riemann/logstash.clj | clojure | (ns riemann.logstash
"Forwards events to LogStash."
(:refer-clojure :exclude [replace])
(:import
(java.net Socket
DatagramSocket
DatagramPacket
InetAddress)
(java.io Writer OutputStreamWriter BufferedWriter))
(:use [clojure.string :only [split join replace]]
... | |
ed780ed75f9200ae228151731073f96d30aeb6f82ec8a6b15fe3cc4bfa31dc96 | cj1128/sicp-review | lazy-eval.scm | ;; lazy eval
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp ... | null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-4/lazy-eval.scm | scheme | lazy eval
redefine eval-if
implement thunks with memoization
this is force-it without memoization
(define (force-it obj)
(if (thunk? obj)
(actual-value (thunk-exp obj) (thunk-env obj))
obj)) |
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
... |
88064cbeaf67e6493263bfcf3ca3b6f78cfe3a83b77ea7e8a279db63dc593271 | Chris00/ocaml-benchmark | iter.ml | open Bigarray
let n = 1_000
(* Bigarrays *)
type vec = (float, float64_elt, c_layout) Array1.t
let a = Array1.create float64 c_layout n
let () = Array1.fill a 1.
let ba f (x: vec) =
for i = 0 to n - 1 do f x.{i} done
let ba_unsafe f (x: vec) =
for i = 0 to n - 1 do f (Array1.unsafe_get x i) done
(* Arrays *)
l... | null | https://raw.githubusercontent.com/Chris00/ocaml-benchmark/72965ad1558c6f5d47b1559cee74423cbc5e970f/examples/iter.ml | ocaml | Bigarrays
Arrays
Lists
Simulate a simple side effect | open Bigarray
let n = 1_000
type vec = (float, float64_elt, c_layout) Array1.t
let a = Array1.create float64 c_layout n
let () = Array1.fill a 1.
let ba f (x: vec) =
for i = 0 to n - 1 do f x.{i} done
let ba_unsafe f (x: vec) =
for i = 0 to n - 1 do f (Array1.unsafe_get x i) done
let b = Array.make n 1.
let a... |
a461328bd6f538b7a07856f73b7262fbb8c1142e99c876a764bc02e81c0f8e07 | bldl/magnolisp | test-type-infer-6.rkt | #lang magnolisp
(typedef int #:: (foreign))
(function (seven-of x) #:: ([type (exists T (-> T T))])
7)
(function (f) #:: (export)
(seven-of (cast int 0)))
(f)
| null | https://raw.githubusercontent.com/bldl/magnolisp/191d529486e688e5dda2be677ad8fe3b654e0d4f/tests/test-type-infer-6.rkt | racket | #lang magnolisp
(typedef int #:: (foreign))
(function (seven-of x) #:: ([type (exists T (-> T T))])
7)
(function (f) #:: (export)
(seven-of (cast int 0)))
(f)
| |
e3d5474e56f18c2b4636827b319d2ff587e0133196698e1b9ca8c8c6256a5963 | huangjs/cl | forma1.lisp | (declare (special $floatformat floatmax floatmin floatsmall
floatbig floatbigbig float-enote))
(defmvar $floatformat t)
;;; defaults
(defmvar floatmax 6)
(defmvar floatmin -4)
(defmvar floatbig 2)
(defmvar floatbigbig 1)
(defmvar floatsmall 3)
(defmvar float-enote 2)
(putprop 'makestring1 (get 'makestring 'sub... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/share/numeric/forma1.lisp | lisp | defaults | (declare (special $floatformat floatmax floatmin floatsmall
floatbig floatbigbig float-enote))
(defmvar $floatformat t)
(defmvar floatmax 6)
(defmvar floatmin -4)
(defmvar floatbig 2)
(defmvar floatbigbig 1)
(defmvar floatsmall 3)
(defmvar float-enote 2)
(putprop 'makestring1 (get 'makestring 'subr) 'subr)
(d... |
b2806cc07aed9b4c665cfd74166b1d9bfc6c0dab25c9906ad230292c091cdc20 | McCLIM/McCLIM | package.lisp | ;;; ---------------------------------------------------------------------------
;;; License: LGPL-2.1+ (See file 'Copyright' for details).
;;; ---------------------------------------------------------------------------
;;;
( c ) copyright 2019 - 2020 Jan Moringen < >
;;;
;;; --------------------------------------... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/7c890f1ac79f0c6f36866c47af89398e2f05b343/Apps/Clouseau/test/package.lisp | lisp | ---------------------------------------------------------------------------
License: LGPL-2.1+ (See file 'Copyright' for details).
---------------------------------------------------------------------------
---------------------------------------------------------------------------
| ( c ) copyright 2019 - 2020 Jan Moringen < >
Package definition for unit tests of the clouseau system .
(cl:defpackage #:clouseau.test
(:use
#:cl
#:clouseau
#:fiveam)
(:shadowing-import-from #:clouseau
#:inspect)
(:export
#:run-tests))
(cl:in-package #:clouseau.test)
(def-suite :clouseau... |
620b474afe6138cfdb6e6b770bc485d8a37598d4fca807d95c1c7d95ddab277e | ghc/packages-dph | Int.hs | {-# OPTIONS_HADDOCK hide #-}
# LANGUAGE CPP #
#include "fusion-phases.h"
| PR instance for Ints
module Data.Array.Parallel.PArray.PData.Int () where
import Data.Array.Parallel.PArray.PData.Base
import Data.Typeable as T
import qualified Data.Array.Parallel.Unlifted as U
import qualified ... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-lifted-vseg/Data/Array/Parallel/PArray/PData/Int.hs | haskell | # OPTIONS_HADDOCK hide #
PR -------------------------------------------------------------------------
Constructors -------------------------------
Projections --------------------------------
Pack and Combine ---------------------------
Conversions --------------------------------
PDatas ---------... | # LANGUAGE CPP #
#include "fusion-phases.h"
| PR instance for Ints
module Data.Array.Parallel.PArray.PData.Int () where
import Data.Array.Parallel.PArray.PData.Base
import Data.Typeable as T
import qualified Data.Array.Parallel.Unlifted as U
import qualified Data.Vector ... |
76215ffec02d1964e86c7d4a9b15f079d7e135ff838fc3681fafa411c6e162e1 | mzp/coq-ruby | coq_commands.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/ide/coq_commands.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
$Id: coq_commands.ml 10994 2008-05-... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
let commands = [
"Add A... |
8b22ef617380b800286725bca5d15f48bae79fcac56c43d5ece0c0cdbfc61111 | ocurrent/ocaml-ci | gitlab.ml | include Git_forge.Make (struct
let prefix = "gitlab"
let request_abbrev = "MR"
let request_prefix = "merge-request"
let org_url ~org = Printf.sprintf "" org
let repo_url ~org ~repo = Printf.sprintf "" org repo
let commit_url ~org ~repo ~hash =
Printf.sprintf "/-/commit/%s" org repo hash
let branch_u... | null | https://raw.githubusercontent.com/ocurrent/ocaml-ci/0d4e392299e6039f19edb4556eb65129936e1940/web-ui/view/gitlab.ml | ocaml | include Git_forge.Make (struct
let prefix = "gitlab"
let request_abbrev = "MR"
let request_prefix = "merge-request"
let org_url ~org = Printf.sprintf "" org
let repo_url ~org ~repo = Printf.sprintf "" org repo
let commit_url ~org ~repo ~hash =
Printf.sprintf "/-/commit/%s" org repo hash
let branch_u... | |
e9ccd57d62ea2a3d95d5c7977601715ea6cd7d680fa81b8b594cdc14ff8d58a1 | realworldocaml/book | trimmer.ml | open Stdune
open Dune_cache_storage
module Trimming_result = struct
type t = { trimmed_bytes : int64 }
let empty = { trimmed_bytes = 0L }
CR - someday amokhov : Right now Dune does n't support large ( > 1Gb ) files on
32 - bit platforms due to the pervasive use of [ int ] for representing
individ... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_cache/trimmer.ml | ocaml | A concurrent process must have removed this metadata file. No
need to try removing such "phantom" metadata files again.
If a metadata file can't be restored, let's trim it.
We do not expect to see any value entries in the cache. Let's
keep them untrimmed for now.
If another pr... | open Stdune
open Dune_cache_storage
module Trimming_result = struct
type t = { trimmed_bytes : int64 }
let empty = { trimmed_bytes = 0L }
CR - someday amokhov : Right now Dune does n't support large ( > 1Gb ) files on
32 - bit platforms due to the pervasive use of [ int ] for representing
individ... |
5a09a7ca3f6901f90930933c6f1b6fc147344604dbd7020bb7f3010c1c27d4b5 | namin/biohacker | tnst.lisp | ;; -*- Mode: Lisp; -*-
A simple domain theory for TGizmo
Last Edited : 1/29/93 , by KDF
Copyright ( c ) 1991 - 1993 , , Northwestern University ,
and , the Xerox Corporation .
;;; All rights reserved.
;;; See the file legal.txt for a paragraph stating scope of permission
;;; and disclaimer of warranty.... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/tgizmo/tnst.lisp | lisp | -*- Mode: Lisp; -*-
All rights reserved.
See the file legal.txt for a paragraph stating scope of permission
and disclaimer of warranty. The above copyright notice and that
paragraph must be included in any separate copy of this file.
at bottom
Assume that every kind of substance can exist in
in every phase ins... |
A simple domain theory for TGizmo
Last Edited : 1/29/93 , by KDF
Copyright ( c ) 1991 - 1993 , , Northwestern University ,
and , the Xerox Corporation .
(in-package :COMMON-LISP-USER)
(defentity (Container ?can)
(defentity (fluid-path ?path))
(defentity (heat-path ?path))
(defentity (Physob ?phob)
... |
987f2fe7cd817627c69d7e41646ffddd8355d7ca0519528ab73395e5901e03f3 | huangz1990/real-world-haskell-cn | AltSupply.hs | file : ch15 / AltSupply.hs
unwrapS :: Supply s a -> State [s] a
unwrapS (S s) = s
instance Monad (Supply s) where
s >>= m = S (unwrapS s >>= unwrapS . m)
return = S . return
| null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch15/AltSupply.hs | haskell | file : ch15 / AltSupply.hs
unwrapS :: Supply s a -> State [s] a
unwrapS (S s) = s
instance Monad (Supply s) where
s >>= m = S (unwrapS s >>= unwrapS . m)
return = S . return
| |
f4e5557bc469602287eaaa5bae6c402f796414871d6b24e0024ace2cea5bd56c | roddyyaga/ocoi | jwt_utils.ml | open Base
let make_token ~jwk claims =
let header = Jose.Header.make_header ~typ:"JWT" jwk in
let payload =
let open Jose.Jwt in
List.fold ~init:empty_payload
~f:(fun payload (key, value) -> payload |> add_claim key (`String value))
claims
in
Jose.Jwt.sign ~header ~payload jwk |> function
... | null | https://raw.githubusercontent.com/roddyyaga/ocoi/0a07e9457add9890cb507ac8bb4e55044d86a640/ocoi/lib/handlers/jwt_utils.ml | ocaml | open Base
let make_token ~jwk claims =
let header = Jose.Header.make_header ~typ:"JWT" jwk in
let payload =
let open Jose.Jwt in
List.fold ~init:empty_payload
~f:(fun payload (key, value) -> payload |> add_claim key (`String value))
claims
in
Jose.Jwt.sign ~header ~payload jwk |> function
... | |
80ce783d6867119bb1676ef2c09d0bb177c7062be2466e95e29e4bde1e5bd402 | syntax-objects/syntax-parse-example | syntax-class-contract-test.rkt | #lang racket/base
(module+ test
(require rackunit
syntax/macro-testing
(for-syntax
racket/base
racket/contract
(only-in syntax/parse str)
(only-in syntax/parse/experimental/reflect reify-syntax-class)
syntax-parse-example/syntax-cl... | null | https://raw.githubusercontent.com/syntax-objects/syntax-parse-example/0675ce0717369afcde284202ec7df661d7af35aa/syntax-class-contract/syntax-class-contract-test.rkt | racket | #lang racket/base
(module+ test
(require rackunit
syntax/macro-testing
(for-syntax
racket/base
racket/contract
(only-in syntax/parse str)
(only-in syntax/parse/experimental/reflect reify-syntax-class)
syntax-parse-example/syntax-cl... | |
b3a34074e09a519e24c12e80b3f815d83a0ec434f4ad153a3acc05676a35720d | yi-editor/yi | Rectangle.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Yi.Rectangle
-- License : GPL-2
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- emacs-style rectangle manipulation functions.
module Yi.Rectangle wh... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-core/src/Yi/Rectangle.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports #
# OPTIONS_HADDOCK show-extensions #
|
Module : Yi.Rectangle
License : GPL-2
Maintainer :
Stability : experimental
Portability : portable
emacs-style rectangle manipulation functions.
| Get the selected region as a rectangle.
Returns ... |
module Yi.Rectangle where
import Control.Monad (forM_)
import Data.List (sort, transpose)
import Data.Monoid ((<>))
import qualified Data.Text as T (Text, concat, justifyLeft, length)
import Yi.Buffer
import Yi.Editor (Edit... |
2c51e62f62de7c1385c5a612e78df5a2a5e329da0e1299f92123007feef97acf | ori-sky/hs-etch | Context.hs | # LANGUAGE FlexibleContexts #
module Etch.CodeGen.Context where
import qualified Data.HashMap.Lazy as HM
import Data.Maybe (maybe)
import Data.Text (Text)
import Control.Monad.State
type Scope a = HM.HashMap Text a
data Context a = Context { contextScopes :: [Scope a]
, contextNextID :: Int... | null | https://raw.githubusercontent.com/ori-sky/hs-etch/9a90df6090f0a9bf64962bd41ffe4469a9dcbd68/src/Etch/CodeGen/Context.hs | haskell | # LANGUAGE FlexibleContexts #
module Etch.CodeGen.Context where
import qualified Data.HashMap.Lazy as HM
import Data.Maybe (maybe)
import Data.Text (Text)
import Control.Monad.State
type Scope a = HM.HashMap Text a
data Context a = Context { contextScopes :: [Scope a]
, contextNextID :: Int... | |
dcbf7409ef6e74456f50bfbdf2d0490dbf3252a99f7e6b78cbb3f60297bc193c | benzap/eden | operator.cljc | (ns eden.stdlib.operator
(:require
[eden.def :refer [set-var!]]))
(def operator
{:add +
:sub -
:mult *
:div /
:not not
:and #(and %1 %2)
:or #(or %1 %2)})
(defn import-stdlib-operator [eden]
(-> eden
(set-var! 'operator operator)))
| null | https://raw.githubusercontent.com/benzap/eden/dbfa63dc18dbc5ef18a9b2b16dbb7af0e633f6d0/src/eden/stdlib/operator.cljc | clojure | (ns eden.stdlib.operator
(:require
[eden.def :refer [set-var!]]))
(def operator
{:add +
:sub -
:mult *
:div /
:not not
:and #(and %1 %2)
:or #(or %1 %2)})
(defn import-stdlib-operator [eden]
(-> eden
(set-var! 'operator operator)))
| |
b9ec0d286585a2864b39e52f35b0b9b81edfb5c54779e256f90ae887a38de2ca | oklm-wsh/MrMime | rfc5322.ml | let locate buff off len f =
let idx = ref 0 in
while !idx < len && f (Internal_buffer.get buff (off + !idx))
do incr idx done;
!idx
type phrase =
[ `Dot
| `Word of Rfc822.word
| `Encoded of (string * Rfc2047.raw) ] list
type domain =
[ `Domain of string list
| `Literal of Rfc5321.literal_domain ]
ty... | null | https://raw.githubusercontent.com/oklm-wsh/MrMime/4d2a9dc75905927a092c0424cff7462e2b26bb96/lib/rfc5322.ml | ocaml | we recognize Return-Path
we recognize Received | let locate buff off len f =
let idx = ref 0 in
while !idx < len && f (Internal_buffer.get buff (off + !idx))
do incr idx done;
!idx
type phrase =
[ `Dot
| `Word of Rfc822.word
| `Encoded of (string * Rfc2047.raw) ] list
type domain =
[ `Domain of string list
| `Literal of Rfc5321.literal_domain ]
ty... |
e286b15d3fb006110eecf25f15d1928f375c9a17193c50dbf94dc7ed6c9e4d88 | pariyatti/kosa | routes.clj | (ns kosa.routes
(:refer-clojure :exclude [resources])
(:require [kosa.library.handler]
[kosa.library.artefacts.image.handler :as image-handler]
[kosa.library.artefacts.image.spec]
[kosa.api.handler :as api-handler]
[kosa.auth.handler :as auth-handler]
[kos... | null | https://raw.githubusercontent.com/pariyatti/kosa/7d2dee40104f2e86d0fe6c2d2d2171b2e059def7/src/kosa/routes.clj | clojure | CRUD resources conflict between /new and /:id
consider {:conflicting true} instead
WARNING: these diffs are very handy, but very slow: | (ns kosa.routes
(:refer-clojure :exclude [resources])
(:require [kosa.library.handler]
[kosa.library.artefacts.image.handler :as image-handler]
[kosa.library.artefacts.image.spec]
[kosa.api.handler :as api-handler]
[kosa.auth.handler :as auth-handler]
[kos... |
626e9fe59ba3c222a5139c22f4a00256950000b069168dfedfcff81f9301b5a2 | Guest0x0/trebor | Unification.ml |
open Syntax
open Value
open Eval
let rec make_fun n body =
if n = 0
then body
else make_fun (n - 1) (Core.Fun("", body))
let close_value g level value =
Quote.value_to_core g level value
|> make_fun level
|> eval g 0 []
let env_to_elim level env =
let args =
env
|> Lis... | null | https://raw.githubusercontent.com/Guest0x0/trebor/c6b6c099e3e848979bd8f501d28c4c2f35f1235e/Kernel/Unification.ml | ocaml |
open Syntax
open Value
open Eval
let rec make_fun n body =
if n = 0
then body
else make_fun (n - 1) (Core.Fun("", body))
let close_value g level value =
Quote.value_to_core g level value
|> make_fun level
|> eval g 0 []
let env_to_elim level env =
let args =
env
|> Lis... | |
58586a07dc2752dc5b5d2958e309dc484d792273bc26b99776e8ff00efc28dec | melange-re/melange | undef_regression_test.ml |
external size_of_t : Obj.t -> 'a Js.undefined = "length" [@@bs.get]
let f obj =
if Js.typeof obj = "function" then
()
else
let size = size_of_t obj in
match Js.Undefined.toOption size with
| None -> ()
| Some s -> Js.log s (* TODO: This case should be peepwholed ..*)
| null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/undef_regression_test.ml | ocaml | TODO: This case should be peepwholed .. |
external size_of_t : Obj.t -> 'a Js.undefined = "length" [@@bs.get]
let f obj =
if Js.typeof obj = "function" then
()
else
let size = size_of_t obj in
match Js.Undefined.toOption size with
| None -> ()
|
db45423d06c2bc8dbb17344c4c26f1e0d5037fec3be6412b459dd846d5a35321 | 8c6794b6/guile-tjit | weak-vector.scm | ;;; installed-scm-file
Copyright ( C ) 2003 , 2006 , 2011 , 2014 Free Software Foundation , Inc.
;;;;
;;;; 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 ... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/ice-9/weak-vector.scm | scheme | installed-scm-file
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 PA... |
Copyright ( C ) 2003 , 2006 , 2011 , 2014 Free Software Foundation , Inc.
version 3 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 Street , Fifth Floor , Boston , USA
(define-module (ice-9 weak-v... |
a0e4f643a84ef33f33a7f19afdbe8f082f56fa28613c77fe75cb8e25cbc978f0 | potatosalad/erlang-jose | jose_curve25519_libsodium.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2022 ,
%%% @doc
%%%
%%% @end
Created : 02 Jan 2016 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/dbc4074066080692246afe613345ef6becc2a3fe/src/jwa/curve25519/jose_curve25519_libsodium.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
jose_curve25519 callbacks
====================================================================
jose_curve25519 callbacks
=================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2022 ,
Created : 02 Jan 2016 by < >
-module(jose_curve25519_libsodium).
-behaviour(jose_curve25519).
-export([eddsa_keypair/0]).
-export([eddsa_keypair/1]).
-export([eddsa_secret_to_public/1... |
089dee0fb1e4a02d1dfa6b30c561fd41c4f007a705f4dbac239e531377a1b137 | aligusnet/mltool | NeuralNetworkTest.hs | module MachineLearning.NeuralNetworkTest
(
tests
)
where
import Test.Framework (testGroup)
import Test.Framework.Providers.HUnit
import Test.HUnit
import Test.HUnit.Approx
import Test.HUnit.Plus
import MachineLearning.DataSets (dataset2)
import qualified Control.Monad.Random as RndM
import qualified Numeric.Linea... | null | https://raw.githubusercontent.com/aligusnet/mltool/92d74c4cc79221bfdcfb76aa058a2e8992ecfe2b/test/MachineLearning/NeuralNetworkTest.hs | haskell | module MachineLearning.NeuralNetworkTest
(
tests
)
where
import Test.Framework (testGroup)
import Test.Framework.Providers.HUnit
import Test.HUnit
import Test.HUnit.Approx
import Test.HUnit.Plus
import MachineLearning.DataSets (dataset2)
import qualified Control.Monad.Random as RndM
import qualified Numeric.Linea... | |
261d852f67016c2c7ccb471a1d962b324a0febe333db263994cfb0cacb3188f8 | keechma/keechma-toolbox | forms_test.cljs | (ns keechma.toolbox.forms-test
(:require [cljs.test :refer-macros [deftest testing is async]]
[keechma.toolbox.forms.core :as forms-core]
[keechma.toolbox.forms.controller :as forms-controller]
[keechma.toolbox.forms.mount-controller :as forms-mount-controller]
[keechma... | null | https://raw.githubusercontent.com/keechma/keechma-toolbox/61bf68cbffc1540b56b7b1925fef5e0aa12d60e7/test/cljs/keechma/toolbox/forms_test.cljs | clojure | (ns keechma.toolbox.forms-test
(:require [cljs.test :refer-macros [deftest testing is async]]
[keechma.toolbox.forms.core :as forms-core]
[keechma.toolbox.forms.controller :as forms-controller]
[keechma.toolbox.forms.mount-controller :as forms-mount-controller]
[keechma... | |
2c114da90d8d547e4f10108bc4c4d001975141ec1f179494d7f775351cff2e85 | ctford/goldberg | instrument.clj | (ns goldberg.instrument
(:use
[overtone.live]))
(definst harpsichord [freq 440]
(let [duration 1]
(*
(line:kr 1 1 duration FREE)
(pluck (* (white-noise) (env-gen (perc 0.001 5) :action FREE))
1
1
(/ 1 freq) (* duration 2) 0.25))))
| null | https://raw.githubusercontent.com/ctford/goldberg/9e312d0890393c9ee100f6e7486b33fe0102e5c1/src/goldberg/instrument.clj | clojure | (ns goldberg.instrument
(:use
[overtone.live]))
(definst harpsichord [freq 440]
(let [duration 1]
(*
(line:kr 1 1 duration FREE)
(pluck (* (white-noise) (env-gen (perc 0.001 5) :action FREE))
1
1
(/ 1 freq) (* duration 2) 0.25))))
| |
923ec2aef4ce6966aa6e7212aeab0525a52ab6d7429694671ab442c4bc01ffa2 | thelema/bench | single_write.ml | open Unix
let filename = "sw_temp.tmp"
let gen_data buf bs = for i = 0 to bs-1 do buf.[i] <- Char.chr (i land 0xff); done in
let bench_buf bs = (* n is buffer size *)
let buf = String.create bs in
let fd = openfile filename [O_WRONLY; O_CREAT; O_TRUNC] 0o700 in
for i = 0 to 100 do
gen_data buf bs;
igno... | null | https://raw.githubusercontent.com/thelema/bench/a0e8231464195399a7e5b6699358d012ad9ba87e/examples/single_write.ml | ocaml | n is buffer size | open Unix
let filename = "sw_temp.tmp"
let gen_data buf bs = for i = 0 to bs-1 do buf.[i] <- Char.chr (i land 0xff); done in
let buf = String.create bs in
let fd = openfile filename [O_WRONLY; O_CREAT; O_TRUNC] 0o700 in
for i = 0 to 100 do
gen_data buf bs;
ignore (write fd buf 0 bs);
done;
close fd... |
a092c98453f4b5aa34df622a38ded9b76606b7e8b1b41107e2cb9fb2dec9436a | msszczep/pequod-cljs | dep1ex66.clj | version -lfs.github.com/spec/v1
oid sha256:c18ba60c7efd8622270faf6f6d0b63b0e68bbce7312dbe5695a743187e5b7411
size 160903552
| null | https://media.githubusercontent.com/media/msszczep/pequod-cljs/986ad97fa39d5b83828c07daf80655460b27d2dd/src/clj/pequod_cljs/dep1ex66.clj | clojure | version -lfs.github.com/spec/v1
oid sha256:c18ba60c7efd8622270faf6f6d0b63b0e68bbce7312dbe5695a743187e5b7411
size 160903552
| |
91e66883968f3422185bff83e79a58a57bbbb303dc7746a55a16cb75bca0c1b2 | s-expressionists/Eclector | client.lisp | (cl:in-package #:eclector.parse-result.test)
(def-suite* :eclector.parse-result.client
:in :eclector.parse-result)
;;; Test annotating labeled object references
(defclass parse-result+annotation-client
(eclector.reader.test::label-reference-annotation-mixin
simple-result-client)
())
(test labeled-objec... | null | https://raw.githubusercontent.com/s-expressionists/Eclector/acd141db4efdbd88d57a8fe4f258ffc18cc47baa/test/parse-result/client.lisp | lisp | Test annotating labeled object references
labeled object references. | (cl:in-package #:eclector.parse-result.test)
(def-suite* :eclector.parse-result.client
:in :eclector.parse-result)
(defclass parse-result+annotation-client
(eclector.reader.test::label-reference-annotation-mixin
simple-result-client)
())
(test labeled-objects/annotation
"Test annotating labeled objec... |
a49bdb9a4712b039d4d70178da63e4bf1eeb3a5cca5fb2c0cb16b6c24e596747 | archhaskell/cblrepo | ConvertDB.hs |
- Copyright 2011 - 2014 Per
-
- Licensed under the Apache License , Version 2.0 ( the " License " ) ;
- you may not use this file except in compliance with the License .
- You may obtain a copy of the License at
-
- -2.0
-
- Unless required by applicable law or agreed to in writing , s... | null | https://raw.githubusercontent.com/archhaskell/cblrepo/83316afca397b1e5e526a69d360efd9cb260921b/src/ConvertDB.hs | haskell |
- Copyright 2011 - 2014 Per
-
- Licensed under the Apache License , Version 2.0 ( the " License " ) ;
- you may not use this file except in compliance with the License .
- You may obtain a copy of the License at
-
- -2.0
-
- Unless required by applicable law or agreed to in writing , s... | |
e0b6ceeca284bcf591fa9e441f369c0fc50b3935eef07e6bae5d718927765072 | ghc/ghc | Utils.hs |
# LANGUAGE DeriveFunctor #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
( c ) The University of Glasgow 2006
( c ) The GRASP / AQUA Project , Glasgow University , 1992 - 1999
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1999
-}
-- | ... | null | https://raw.githubusercontent.com/ghc/ghc/86f240ca956f633c20a61872ec44de9e21266624/compiler/GHC/Tc/TyCl/Utils.hs | haskell | | Analysis functions over data types. Specifically, detecting recursive types.
This stuff is only used for source-code decls; it's recorded in interface
files for imported data types.
* Implicits
* Record selectors
************************************************************************
* ... |
# LANGUAGE DeriveFunctor #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
( c ) The University of Glasgow 2006
( c ) The GRASP / AQUA Project , Glasgow University , 1992 - 1999
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1999
-}
modul... |
41529b888d5ee5e2f43c1f68c8f0ff46d6ed6810be82f9fa4611ea9b0290e38a | noinia/hgeometry | DualDT.hs | # LANGUAGE ScopedTypeVariables #
module Algorithms.Geometry.VoronoiDiagram.DualDT where
import Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer
import Algorithms.Geometry.DelaunayTriangulation.Types
import Control.Lens
import Data.Ext
import Geometry.Ball
imp... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Algorithms/Geometry/VoronoiDiagram/DualDT.hs | haskell | ------------------------------------------------------------------------------
this gives the unboundededges from their actual voronoi vertices
| Computes the unbounded edge corresponding to this dart of the
convex hull.
running time: \(O(1)\)
^ the delaunaytriangulation
the face to the left of this dart should ... | # LANGUAGE ScopedTypeVariables #
module Algorithms.Geometry.VoronoiDiagram.DualDT where
import Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer
import Algorithms.Geometry.DelaunayTriangulation.Types
import Control.Lens
import Data.Ext
import Geometry.Ball
imp... |
14e6879a6748aa63d8f58f1ac146e0e1f4e0d7f0bb56375d3b090277368e3333 | ucsd-progsys/liquidhaskell | Bare.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE NoMonomorphismRestriction #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TupleSections #
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
-- | This module contains the functions that convert /from/ description... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/afa10475b1bbf3c65f4e1874a367dc65dec57791/src/Language/Haskell/Liquid/Bare.hs | haskell | # LANGUAGE ScopedTypeVariables #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE OverloadedStrings #
| This module contains the functions that convert /from/ descriptions of
symbols, names and types (over freshly parsed /bare/ Strings),
The actual /representations/ of bare and real (refinement) t... | # LANGUAGE FlexibleContexts #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE TupleSections #
/to/ representations connected to GHC ' Var 's , ' Name 's , and ' Type 's .
module Language.Haskell.Liquid.Bare (
* Creating a TargetSpec
makeTargetSpec
, loadLiftedSpec
, saveLiftedS... |
de1e1a8661988d5cb5112d7231e3d89759fa549b78552930bbb2698011f57fe6 | readevalprintlove/black | cnv.scm | (define zip
(lambda (xs ys)
(cond
((or (null? xs) (null? ys))
'())
(else
(cons
(cons (car xs) (car ys))
(zip (cdr xs) (cdr ys)))))))
(define cnv2
(lambda (xs ys)
(define walk
(lambda (xs k)
(cond
((null? xs)
(k '() ys))
... | null | https://raw.githubusercontent.com/readevalprintlove/black/a45193c98473004f76319a6dfe48867a11507103/examples/cnv.scm | scheme | (define zip
(lambda (xs ys)
(cond
((or (null? xs) (null? ys))
'())
(else
(cons
(cons (car xs) (car ys))
(zip (cdr xs) (cdr ys)))))))
(define cnv2
(lambda (xs ys)
(define walk
(lambda (xs k)
(cond
((null? xs)
(k '() ys))
... | |
9c6f07bf68efcb27e5317eb67cf88cf501bad156959a4b2a9e311d18ff1beb43 | jeaye/orchestra | project.clj | (defproject orchestra "2021.01.01-1"
:description "Complete instrumentation for clojure.spec"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"]
[org.clojure/clojurescript "1.10.773" :scope "provided"]
... | null | https://raw.githubusercontent.com/jeaye/orchestra/81e5181f7b42e5e2763a2b37db17954f3be0314e/project.clj | clojure | (defproject orchestra "2021.01.01-1"
:description "Complete instrumentation for clojure.spec"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"]
[org.clojure/clojurescript "1.10.773" :scope "provided"]
... | |
e99d3f4e853816dc9e74532eef3a3ecc62f66b1e6c952effd274fcdc67bf3dc5 | eponai/sulolive | message.cljc | (ns eponai.client.parser.message
(:require [datascript.db :as db]
[datascript.core :as d]
[om.next :as om]
[eponai.common.database :as database]
[eponai.common.parser :as parser]
[taoensso.timbre :refer [debug warn error]])
#?(:clj (:import [datascript.db ... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/client/parser/message.cljc | clojure | -----------------------------
-- Mutation message public api
------------------------------------
-- Datascript mutation message storage implementation
Developer facing API. ;;;;;;;;;;;;;;;;;;
Usage:
(require '[eponai.client.parser.message :as msg])
Use `om-transact!` to perform mutation and get history-id.
(... | (ns eponai.client.parser.message
(:require [datascript.db :as db]
[datascript.core :as d]
[om.next :as om]
[eponai.common.database :as database]
[eponai.common.parser :as parser]
[taoensso.timbre :refer [debug warn error]])
#?(:clj (:import [datascript.db ... |
ba65ae600a271f22d0305f37c72d105943822a2693a2d4c3a8dec11b37d51213 | gethop-dev/payments.stripe | charge_test.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
;; file, You can obtain one at /
(ns dev.gethop.payments.stripe.charge-test
(:require [clojure.test :refer :all]
[dev.gethop.payments.core :as core]
[d... | null | https://raw.githubusercontent.com/gethop-dev/payments.stripe/2379ba790123d7380ffc397cf4920cbe2936f840/test/dev/gethop/payments/stripe/charge_test.clj | clojure | file, You can obtain one at / | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
(ns dev.gethop.payments.stripe.charge-test
(:require [clojure.test :refer :all]
[dev.gethop.payments.core :as core]
[dev.gethop.payments.stripe]
... |
7faa0d82d1686dfd47f7eb7a8013bf1c5d3b3ec9b74f952a9c478bd6a2c65519 | icicle-lang/x-ambiata | Merge.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PatternGuards #
# LANGUAGE LambdaCase #
module X.Data.Vector.Stream.Merge
( MergePullFrom(..)
, mergePullOrd
, mergePullJoin
, mergePullJoinBy
, mergeList
, merge
) where
import qualified Data.Vector.Fusion.Stream.Monadic as VS
i... | null | https://raw.githubusercontent.com/icicle-lang/x-ambiata/532f8473084b24fb9d8c90fda7fee9858b9fbe30/x-vector/src/X/Data/Vector/Stream/Merge.hs | haskell | | Which stream to pull from during a merge, and a single value to emit.
The value to emit will often be the read value - if pulling from left, emit the left, etc.
Left-biased: when elements from both inputs are equal, pull from left.
This is really just here as a specification.
Note that this is effectively pushin... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PatternGuards #
# LANGUAGE LambdaCase #
module X.Data.Vector.Stream.Merge
( MergePullFrom(..)
, mergePullOrd
, mergePullJoin
, mergePullJoinBy
, mergeList
, merge
) where
import qualified Data.Vector.Fusion.Stream.Monadic as VS
i... |
bfa8ff73307d9e18455374ebe6a0b731f6702c558d6d029407f5f5a995f9a083 | NorfairKing/really-safe-money | Account.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
-- === Importing this module
--
-- This module is designed to be imported as follows:
--
-- @
-- import Money.Account (Account)
-- import qualified Money.Account as Account
-- @
--
Or , if you have an @Account@ type already , maybe i... | null | https://raw.githubusercontent.com/NorfairKing/really-safe-money/6a4ecbdd47d094e51c8e3874cda57d900a03ff31/really-safe-money/src/Money/Account.hs | haskell | === Importing this module
This module is designed to be imported as follows:
@
import Money.Account (Account)
import qualified Money.Account as Account
@
@
import qualified Money.Account as Money (Account)
import qualified Money.Account as Account
@
| An account of money. Like 'Amount' but can also be ne... | # LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
Or , if you have an @Account@ type already , maybe in a
module Money.Account
( Account (..),
fromMinimalQuantisations,
toMinimalQuantisations,
fromDouble,
toDouble,
fromRational,
toRational,
zero,
ad... |
9385db368b7a5450ac4cfaca15aee3aeaa96ad94127bb30357f7346e678af2f4 | bjpop/blip | Compile.hs | # LANGUAGE TypeFamilies , TypeSynonymInstances , FlexibleInstances ,
PatternGuards , RecordWildCards #
PatternGuards, RecordWildCards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Blip.Compiler.Compile
Copyright : ( c ) 2012 , 2013 , 2014
-- Lic... | null | https://raw.githubusercontent.com/bjpop/blip/3d9105a44d1afb7bd007da3742fb19dc69372e10/blipcompiler/src/Blip/Compiler/Compile.hs | haskell | ---------------------------------------------------------------------------
|
Module : Blip.Compiler.Compile
License : BSD-style
Maintainer :
Stability : experimental
Basic algorithm:
The following Python constructs are compiled into code objects:
- The top-level of the module.
- Functi... | # LANGUAGE TypeFamilies , TypeSynonymInstances , FlexibleInstances ,
PatternGuards , RecordWildCards #
PatternGuards, RecordWildCards #-}
Copyright : ( c ) 2012 , 2013 , 2014
Portability : ghc
Compilation of Python 3 source code into bytecode .
1 ) Parse the source code into an AST .
2 ) Comput... |
d6e3bd0b3a1a4ed884021391fa261a912c90013c351a0bdefbb0afe2ed8732b1 | heechul/crest-z3 | ciltools.ml | open Cil
Contributed by
let isOne e =
isInteger e = Some Int64.one
written by
let is_volatile_tp tp =
List.exists (function (Attr("volatile",_)) -> true
| _ -> false) (typeAttrs tp)
written by
let is_volatile_vi vi =
let vi_vol =
List.exists (function (Attr("volatile",_)) -> true
| _ ... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/ext/ciltools.ml | ocaml | ****************************************************************************
* A collection of useful functions that were not already in CIL as far as I
* could tell. However, I have been surprised before . . .
***************************************************************************
******************************... | open Cil
Contributed by
let isOne e =
isInteger e = Some Int64.one
written by
let is_volatile_tp tp =
List.exists (function (Attr("volatile",_)) -> true
| _ -> false) (typeAttrs tp)
written by
let is_volatile_vi vi =
let vi_vol =
List.exists (function (Attr("volatile",_)) -> true
| _ ... |
07b5f31927b33ad381f18bbbdcbae5ad212a2245693349f93b44a4646c01fc56 | CIFASIS/QuickFuzz | String.hs | # LANGUAGE FlexibleInstances , IncoherentInstances #
module Test.QuickFuzz.Gen.Base.String where
import Test.QuickCheck
import qualified Data.Text as TS
import qualified Data.Text.Lazy as TL
import Test.QuickFuzz.Gen.Base.Value
-- String
instance Arbitrary String where
arbitrary = genStrValue "String"
-- Text
... | null | https://raw.githubusercontent.com/CIFASIS/QuickFuzz/a1c69f028b0960c002cb83e8145f039ecc0e0a23/src/Test/QuickFuzz/Gen/Base/String.hs | haskell | String
Text | # LANGUAGE FlexibleInstances , IncoherentInstances #
module Test.QuickFuzz.Gen.Base.String where
import Test.QuickCheck
import qualified Data.Text as TS
import qualified Data.Text.Lazy as TL
import Test.QuickFuzz.Gen.Base.Value
instance Arbitrary String where
arbitrary = genStrValue "String"
instance Arbitrary... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.