_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 |
|---|---|---|---|---|---|---|---|---|
05a6d65800ea2882acef6c6697010e35df51431537a5c540f8a0c125e4b9c54d | metabase/metabase | time_field_test.clj | (ns metabase.query-processor-test.time-field-test
(:require
[clojure.test :refer :all]
[metabase.driver :as driver]
[metabase.query-processor-test :as qp.test]
[metabase.test :as mt]))
(defn- time-query [filter-type & filter-args]
(mt/formatted-rows [int identity identity]
(mt/dataset test-data-wit... | null | https://raw.githubusercontent.com/metabase/metabase/f1fa503fa31657ac7009e44fdf4053ec3cf07442/test/metabase/query_processor_test/time_field_test.clj | clojure | Databases like PostgreSQL ignore timezone information when
using a time field, the result below is what happens when the
time by the DB | (ns metabase.query-processor-test.time-field-test
(:require
[clojure.test :refer :all]
[metabase.driver :as driver]
[metabase.query-processor-test :as qp.test]
[metabase.test :as mt]))
(defn- time-query [filter-type & filter-args]
(mt/formatted-rows [int identity identity]
(mt/dataset test-data-wit... |
d9a98081229a4b541388f63f73e9fdb9f17e6d753584d7735b1d5d37f24dd117 | AdRoll/rebar3_hank | unused_ignores_SUITE.erl | %%% @doc Tests for the unused ignore warnings
-module(unused_ignores_SUITE).
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export([unused_ignores/1]).
all() ->
[unused_ignores].
init_per_testcase(_, Config) ->
hank_test_utils:init_per_testcase(Config, "unused_ignores").
end_per_testcase(_, Con... | null | https://raw.githubusercontent.com/AdRoll/rebar3_hank/c41a7f422b95b8e0b253c26423e19f96761a0279/test/unused_ignores_SUITE.erl | erlang | @doc Tests for the unused ignore warnings | -module(unused_ignores_SUITE).
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export([unused_ignores/1]).
all() ->
[unused_ignores].
init_per_testcase(_, Config) ->
hank_test_utils:init_per_testcase(Config, "unused_ignores").
end_per_testcase(_, Config) ->
hank_test_utils:end_per_testcase(C... |
a859c46024a8c3f8ba25e3ed5cbb86f6f5285e641ce6aa2db698a785ef74bcbe | mfp/oraft | oraft_lwt_extprot_io.mli | open Oraft_lwt_s
module Make (C : SERVER_CONF) : LWTIO with type op = C.op
* Ready - to - use implementation of LWTIO interface using ` extprot ` for
message serialization .
message serialization. *)
| null | https://raw.githubusercontent.com/mfp/oraft/cf7352eb8f1324717d47dc294a058c857ebef9eb/src/oraft_lwt_extprot_io.mli | ocaml | open Oraft_lwt_s
module Make (C : SERVER_CONF) : LWTIO with type op = C.op
* Ready - to - use implementation of LWTIO interface using ` extprot ` for
message serialization .
message serialization. *)
| |
03a860b57fd6338e9c0277f4e40252eca00f041ec24d037134f5aeab411b78ef | rtoy/cmucl | subprim.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Base : 10 ; Package : x86 -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to use this ... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/x86/subprim.lisp | lisp | Syntax : Common - Lisp ; Base : 10 ; Package : x86 -*-
**********************************************************************
**********************************************************************
Linkage information for standard static functions, and random vops.
Length | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to use this code or any part of CMU Common Lisp , please contact
or .
(ext:file-comment
"$Header: src/compiler/x86/subprim.lisp $")
Written by .
by Sp... |
436d3951199e51cfc3551490e816b7a339b37a80a44483466d51c09c517645b1 | beam-telemetry/telemetry | telemetry_app.erl | @private
-module(telemetry_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
telemetry_sup:start_link().
stop(_State) ->
ok.
| null | https://raw.githubusercontent.com/beam-telemetry/telemetry/09c132f1083cb6faa56d05dfdd0c443800bdf5cc/src/telemetry_app.erl | erlang | @private
-module(telemetry_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
telemetry_sup:start_link().
stop(_State) ->
ok.
| |
c7838cae1298d796b999e1d0ca9f6652b3d1a9d7cf0da5e9d3f76b258cb6da79 | adityaathalye/sicp | ch1-3-1-procedures-as-arguments.scm | ; Ex. 1.3.1 Procedures as Arguments
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
; A procedure to calculate a sum of cubes in a given range:
(define (cube n) (* n n n))
(define (inc n) (+ n 1))
(define (sum-cubes a b)
(sum cube ... | null | https://raw.githubusercontent.com/adityaathalye/sicp/c8b62c366dade1d5101238a32267dab177808105/ch1-3-1-procedures-as-arguments.scm | scheme | Ex. 1.3.1 Procedures as Arguments
A procedure to calculate a sum of cubes in a given range:
Definite integral of a function f between limits a and b: |
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
(define (cube n) (* n n n))
(define (inc n) (+ n 1))
(define (sum-cubes a b)
(sum cube a inc b))
(define (identity n) n)
(define (sum-integers a b)
(sum identity a inc b))
... |
1fe9b9a58cef94352f46fd61625bb7e32fece3b1ffaf182e2330843f186c7b21 | racket/drdr | run-collect.rkt | #lang racket/base
(require racket/local
racket/match
racket/list
racket/contract/base
racket/async-channel
"status.rkt"
"notify.rkt"
"rewriting.rkt"
"dirstruct.rkt"
"cache.rkt")
(define (command+args+env->command+args
#:env env
... | null | https://raw.githubusercontent.com/racket/drdr/2b31a8bba9422aefe3bd9313c81e2206a50e31ca/run-collect.rkt | racket | Run the command
Run it without input
Wait for all the output and the process death or timeout
before sending the death
signal | #lang racket/base
(require racket/local
racket/match
racket/list
racket/contract/base
racket/async-channel
"status.rkt"
"notify.rkt"
"rewriting.rkt"
"dirstruct.rkt"
"cache.rkt")
(define (command+args+env->command+args
#:env env
... |
9bc06ca575c660f0ca1b2f01f5adf9554ac4492724fd93524aac260e278806f0 | xvw/preface | pair.mli | (** Implementation for [Pair.t]. *)
(** [Pair.t] is the simplest product type. In addition to allowing the generic
description of product types, it allows the description of a conjunction. *)
* { 1 Type }
type ('a, 'b) t = 'a * 'b
(** {1 Implementation} *)
* { 2 Bifunctor }
module Bifunctor : Preface_specs.BI... | null | https://raw.githubusercontent.com/xvw/preface/d6424579efdc91744414db2ca6541eb9469ac1a8/lib/preface_stdlib/pair.mli | ocaml | * Implementation for [Pair.t].
* [Pair.t] is the simplest product type. In addition to allowing the generic
description of product types, it allows the description of a conjunction.
* {1 Implementation}
* {1 Additional functions}
Additional functions to facilitate practical work with [Pair.t].
* Swap both ... |
* { 1 Type }
type ('a, 'b) t = 'a * 'b
* { 2 Bifunctor }
module Bifunctor : Preface_specs.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) t
val fst : ('a, 'b) t -> 'a
* Extract the first component of a pair .
val snd : ('a, 'b) t -> 'b
* Extract the second component of a pair .
val swap : ('a, 'b) t -> ('b, 'a) t
... |
1850ad9d5cda4eccbd0b3fb6d64ff014534900f9982bb3093dfef06bbd70be3b | c-cube/linol | sigs.ml |
* { 2 Parametrized IO Interface }
module type IO = sig
type 'a t
val return : 'a -> 'a t
val failwith : string -> 'a t
val (let+) : 'a t -> ('a -> 'b) -> 'b t
val (let*) : 'a t -> ('a -> 'b t) -> 'b t
val (and+) : 'a t -> 'b t -> ('a * 'b) t
type in_channel
type out_channel
val stdin : in_channe... | null | https://raw.githubusercontent.com/c-cube/linol/e77fded63833bb3db45862a182e4c89634db22d7/src/sigs.ml | ocaml | * Spawn a new task that executes concurrently. |
* { 2 Parametrized IO Interface }
module type IO = sig
type 'a t
val return : 'a -> 'a t
val failwith : string -> 'a t
val (let+) : 'a t -> ('a -> 'b) -> 'b t
val (let*) : 'a t -> ('a -> 'b t) -> 'b t
val (and+) : 'a t -> 'b t -> ('a * 'b) t
type in_channel
type out_channel
val stdin : in_channe... |
a49fa57b6ee4ab38978e41d5dafc96cfdbaa02d9e5dacb34778b1bae9ca0962b | eareese/htdp-exercises | 055-rocket-mockups.rkt | #lang htdp/bsl
(require 2htdp/image)
; physical constants
(define HEIGHT 300)
(define WIDTH 100)
(define YDELTA 3)
; graphical constants
(define BACKG (empty-scene WIDTH HEIGHT))
(define ROCKET (rectangle 5 30 "solid" "blue"))
(define ROCKET-CENTER (/ (image-height ROCKET) 2))
(define ROCKET-X 10)
(place-image ROCK... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part01-fixed-size-data/055-rocket-mockups.rkt | racket | physical constants
graphical constants | #lang htdp/bsl
(require 2htdp/image)
(define HEIGHT 300)
(define WIDTH 100)
(define YDELTA 3)
(define BACKG (empty-scene WIDTH HEIGHT))
(define ROCKET (rectangle 5 30 "solid" "blue"))
(define ROCKET-CENTER (/ (image-height ROCKET) 2))
(define ROCKET-X 10)
(place-image ROCKET ROCKET-X HEIGHT BACKG)
(place-image ROCK... |
4b58d1909d99362333452f92fa45c571fdedf543b612fc6dbf57c507f16a9115 | AdaCore/why3 | gnat_server.ml | open Why3
open Json_util
(* Initialization: Add all libexec executables to PATH (to be able to launch
cvc4, z3, altergo etc) *)
let () =
let path_separator =
match Sys.os_type with
| "Unix" | "Cygwin" -> ":"
| "Win32" -> ";"
| _ -> assert false in
(* ??? This does not always return the absolute ... | null | https://raw.githubusercontent.com/AdaCore/why3/d00c613f9ac9c0b240461bc6b01a3e3bbe6e2c1a/src/gnat/gnat_server.ml | ocaml | Initialization: Add all libexec executables to PATH (to be able to launch
cvc4, z3, altergo etc)
??? This does not always return the absolute location of gnat_server but
this use case should be ok (see documentation of Ocaml
Sys.executable_name).
A disavantage is that we only treat one request at a ti... | open Why3
open Json_util
let () =
let path_separator =
match Sys.os_type with
| "Unix" | "Cygwin" -> ":"
| "Win32" -> ";"
| _ -> assert false in
let gnat_server_path = Filename.dirname (Sys.executable_name) in
let cur_env = Unix.getenv "PATH" in
let new_env = cur_env ^ path_separator ^ gnat_ser... |
fce7c4aa656baa7b89693c31fea8c4e7d10413cf0373e79f6cd2d4b3b6f63520 | kushidesign/kushi | utility.cljc | (ns kushi.ui.utility
(:require
[kushi.utils :refer [deep-merge]]
[kushi.utils :as util]))
(def disabled {:opacity :45%!important
:cursor :not-allowed!important})
(def combo-flex-utility-classes
Combinatorial flexbox utilities
;; ------------------------------------------------------
[:fl... | null | https://raw.githubusercontent.com/kushidesign/kushi/095f9852d426d0b58ec0cdc06fb278dbdf05353b/src/kushi/ui/utility.cljc | clojure | ------------------------------------------------------
Visual debugging utilities
------------------------------------------------------
------------------------------------------------------
northwest
north
east
northeast
southwest
south
southeast
west
Surfaces, buttons, containers
----------------------... | (ns kushi.ui.utility
(:require
[kushi.utils :refer [deep-merge]]
[kushi.utils :as util]))
(def disabled {:opacity :45%!important
:cursor :not-allowed!important})
(def combo-flex-utility-classes
Combinatorial flexbox utilities
[:flex-row-c {:flex-direction :row
... |
54a3dfcddf2afb56e726aa5bd8bf98adf0ae5dcbf99cda2267ab6a14ba4a29df | EveryTian/Haskell-Codewars | checking-groups.hs | -- -groups
module Codewars.Kata.Groups where
groupCheck :: String -> Bool
groupCheck = stack ""
where stack s "" = null s
stack s (x:xs)
| x `elem` "({[" = stack (x:s) xs
| x == ')' = not (null s) && '(' == head s && stack (tail s) xs
| x == ']' = not (null s) &... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/6kyu/checking-groups.hs | haskell | -groups |
module Codewars.Kata.Groups where
groupCheck :: String -> Bool
groupCheck = stack ""
where stack s "" = null s
stack s (x:xs)
| x `elem` "({[" = stack (x:s) xs
| x == ')' = not (null s) && '(' == head s && stack (tail s) xs
| x == ']' = not (null s) && '[' == he... |
1b1532fdd2243eed09375ca73551932c9b9b56d704becaa27f19c1452b66135e | footprintanalytics/footprint-web | streaming_response_test.clj | (ns metabase.async.streaming-response-test
(:require [clj-http.client :as http]
[clojure.core.async :as a]
[clojure.test :refer :all]
[metabase.async.streaming-response :as streaming-response]
[metabase.async.streaming-response.thread-pool :as thread-pool]
[... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/async/streaming_response_test.clj | clojure | Daemon threads do not block shutdown of the JVM
wait a little while for the query to start running -- this should usually happen fairly quickly | (ns metabase.async.streaming-response-test
(:require [clj-http.client :as http]
[clojure.core.async :as a]
[clojure.test :refer :all]
[metabase.async.streaming-response :as streaming-response]
[metabase.async.streaming-response.thread-pool :as thread-pool]
[... |
2745b9782375a4480dafe95df9dafeed03603823b81d15618f8f379be72fad8d | brenoae/metabase-impala-driver | project.clj | (defproject metabase/impala "1.0.0"
:min-lein-version "2.5.0"
:dependencies
[[org.clojure/core.logic "0.8.11"
:exclusions [org.clojure/clojure]]]
:jvm-opts
["-XX:+IgnoreUnrecognizedVMOptions"
"--add-modules=java.xml.bind"]
:profiles
{:provided
{:dependencies
[[org.clojure/clojure "1.10.0"... | null | https://raw.githubusercontent.com/brenoae/metabase-impala-driver/5dbf9b5276e1d784662b6ff73480b98ea26a346a/project.clj | clojure | (defproject metabase/impala "1.0.0"
:min-lein-version "2.5.0"
:dependencies
[[org.clojure/core.logic "0.8.11"
:exclusions [org.clojure/clojure]]]
:jvm-opts
["-XX:+IgnoreUnrecognizedVMOptions"
"--add-modules=java.xml.bind"]
:profiles
{:provided
{:dependencies
[[org.clojure/clojure "1.10.0"... | |
32d7306607085d28e04f4e1f872bd4eeef6ff00330aff8b1cc78c8fd5bffb7c7 | lojic/LearningRacket | listify.rkt | #lang racket
(provide listify)
(define (listify func)
(λ (str) (list->string (func (string->list str)))))
| null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/exercism.io/listify.rkt | racket | #lang racket
(provide listify)
(define (listify func)
(λ (str) (list->string (func (string->list str)))))
| |
145873477efd16e4e127400ef4f74525695ef72774b4e321c579a9b8294559e4 | wdebeaum/step | unify.lisp | ;;; This file contains functions that let us unify parts of the logical form
;;; from the parser.
;______________________________________________________________________________
;; Declaration of being in the parser package.
(in-package parser)
;______________________________________________________________________... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/Parser/Trips-parser/unify.lisp | lisp | This file contains functions that let us unify parts of the logical form
from the parser.
______________________________________________________________________________
Declaration of being in the parser package.
______________________________________________________________________________
Global variables.
#||
_... |
(in-package parser)
(defvar *dummy-var* '*DUMMY* "Placeholder for the variable of the object
currently being investigated")
or NIL , if unification is not possible .
(defun match-arb (s1 s2)
(when (and (atom s1) (atom s2))
(cond ((equal s1 s2)
s1)
((and (var s1) (var s2))
(match-objects (cdr (l... |
bc8315c5f1fa52d999d5b4e42a8425444ca78fc6ad532f074f004066e05cfce4 | AnthonySuper/jordan | JSONError.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE UndecidableInstances #
module Jordan.Types.JSONError where
import Control.DeepSeq
import Data.Coerce
import Data.Foldable
import Data.... | null | https://raw.githubusercontent.com/AnthonySuper/jordan/ec4e0f771fd54b38f53891e6ae996eb6bb0f1f51/jordan/lib/Jordan/Types/JSONError.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
| Generic, user-provided error message
| JSON was not up to spec
| Bad type encountered (Expected, Actual)
| There was no value for this JSON
| Text constant was wrong.
| An object had some bad values.
| An array had some bad in... | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
# LANGUAGE UndecidableInstances #
module Jordan.Types.JSONError where
import Control.DeepSeq
import Data.Coerce
import Data.Foldable
import Data.Functor.Contravariant
import qualified Data.List.NonEmpty as NE
import qualified Data.Map.Strict ... |
b78156f4a57eb31cf69462f3eb947853a0c82cbc32db42c4bbf6cff53b03a85e | tezos/tezos-mirror | alcotest_lwt.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/fc48af9a32db8e55cd3dc34c4679c339fcdb4cbb/tezt/lib_alcotezt/alcotest_lwt.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
1a3d7e3a403369f84663cebff43f2041a4c041cd2d753140a1434ecf8fa1f1dc | owlbarn/owl_symbolic | owl_symbolic_engine_onnx.ml |
* OWL - OCaml Scientific and Engineering Computing
* Copyright ( c ) 2016 - 2020 < >
* OWL - OCaml Scientific and Engineering Computing
* Copyright (c) 2016-2020 Liang Wang <>
*)
open Owl_symbolic_specs
open Owl_symbolic_types
module S = Owl_symbolic_symbol
type t = Onnx_types.model_proto
(* TODO: ref... | null | https://raw.githubusercontent.com/owlbarn/owl_symbolic/dc853a016757d3f143c5e07e50075e7ae605d969/src/engines/owl_symbolic_engine_onnx.ml | ocaml | TODO: refactoring-- simplify the building of attributions
* Mapping functions
* Wrapper for building onnx-proto's
* Functions to build part of onnx graph
* if input dtypes is not null, then set currently symbol to that type and then return this type;
* else return the pre-specified dtype.
Get input types
Typ... |
* OWL - OCaml Scientific and Engineering Computing
* Copyright ( c ) 2016 - 2020 < >
* OWL - OCaml Scientific and Engineering Computing
* Copyright (c) 2016-2020 Liang Wang <>
*)
open Owl_symbolic_specs
open Owl_symbolic_types
module S = Owl_symbolic_symbol
type t = Onnx_types.model_proto
let map_el... |
9b6ab571e99afd6a1eb91fcc411533c70069dd6fbe40d91315736a195adc6536 | satori-com/mzbench | mzb_api_connection.erl | -module(mzb_api_connection).
-export([start_and_link_with/6,
send_message/2,
wait_close/2,
monitor/1,
demonitor/1]).
start_and_link_with(PidToLinkWith, Purpose, Host, Port, Dispatcher, State) ->
Self = self(),
Pid = spawn(fun () ->
link(PidToLinkWith),
try g... | null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/server/src/mzb_api_connection.erl | erlang | -module(mzb_api_connection).
-export([start_and_link_with/6,
send_message/2,
wait_close/2,
monitor/1,
demonitor/1]).
start_and_link_with(PidToLinkWith, Purpose, Host, Port, Dispatcher, State) ->
Self = self(),
Pid = spawn(fun () ->
link(PidToLinkWith),
try g... | |
a98932e35d2b3bdbe3b006b80002b2710d6342cf1a0f9c9bb5855c550658f8fc | finkel-lang/finkel | newtype.hs | newtype N = N {unN :: Int} -- Haskell
| null | https://raw.githubusercontent.com/finkel-lang/finkel/c3c7729d5228bd7e0cf76e8ff05fe2f79a0ec0a2/doc/include/language-syntax/decl/newtype.hs | haskell | Haskell | |
e47e3881572b0fc521b009a65a9d93b4045ab805ed4450f3ac3816d4dfd673cb | hpyhacking/openpoker | deck.erl | -module(deck).
-export([new/0, new/1, draw/1, size/1]).
-include("openpoker.hrl").
new() ->
case op_common:get_env(deck, ?UNDEF) of
?UNDEF ->
shuffle(make_deck());
Cards ->
hand:make_cards(Cards)
end.
new(Cards) ->
Cards.
draw([]) ->
none;
draw([H|T]) ->
{H, T}.
size(Cards) ->
len... | null | https://raw.githubusercontent.com/hpyhacking/openpoker/643193c94f34096cdcfcd610bdb1f18e7bf1e45e/src/texas/deck.erl | erlang | -module(deck).
-export([new/0, new/1, draw/1, size/1]).
-include("openpoker.hrl").
new() ->
case op_common:get_env(deck, ?UNDEF) of
?UNDEF ->
shuffle(make_deck());
Cards ->
hand:make_cards(Cards)
end.
new(Cards) ->
Cards.
draw([]) ->
none;
draw([H|T]) ->
{H, T}.
size(Cards) ->
len... | |
d285bc9029ab10bff273c37eb16d1b2adae477db949b8bb92b06bf73529f1e1f | fimad/prometheus-haskell | VectorSpec.hs | {-# language OverloadedStrings #-}
module Prometheus.Metric.VectorSpec (
spec
) where
import Prometheus
import Control.Monad
import qualified Data.Text as T
import Test.Hspec
spec :: Spec
spec = describe "Prometheus.Metric.Vector" $ do
it "starts with no labels" $ do
m <- register $ vector ("a... | null | https://raw.githubusercontent.com/fimad/prometheus-haskell/4e2c2f1da1f891e9de3ce5a5260ae92882a9f35e/prometheus-client/tests/Prometheus/Metric/VectorSpec.hs | haskell | # language OverloadedStrings # |
module Prometheus.Metric.VectorSpec (
spec
) where
import Prometheus
import Control.Monad
import qualified Data.Text as T
import Test.Hspec
spec :: Spec
spec = describe "Prometheus.Metric.Vector" $ do
it "starts with no labels" $ do
m <- register $ vector ("a", "b") $ counter (Info "name" "hel... |
2ddfda72a116542fba0634dce48f38b6e34e170f9de8fe5285bf37ce035b6dc9 | xapi-project/xen-api | dbsync_master.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/e8c3575316226ac6324e94aa4f9e040a662e279a/ocaml/xapi/dbsync_master.ml | ocaml | *
* @group Main Loop and Start-up
Synchronising code which is specific to the master
create pool record (if master and not one already there)
Resets the current operations of all Halted VMs
All VMs should have their scheduled_to_be_resident_on field cleared
We cannot do this in xapi_db_upgrade, because that ... |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
86dc3b66c7e51349bcce4eaa149133570ce3c4a127a02c19f7d359282a27c30e | racket/redex | let-poly-2.rkt | #lang racket/base
(require redex/benchmark
"util.rkt"
redex/reduction-semantics)
(provide (all-defined-out))
(define the-error "the classic polymorphic let + references bug")
(define-rewrite bug2
([(where N_2 (subst N x v))
(where y ,(variable-not-in (term N_2) 'l))
(tc-down Γ ((λ y N_2) ... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-benchmark/redex/benchmark/models/let-poly/let-poly-2.rkt | racket | #lang racket/base
(require redex/benchmark
"util.rkt"
redex/reduction-semantics)
(provide (all-defined-out))
(define the-error "the classic polymorphic let + references bug")
(define-rewrite bug2
([(where N_2 (subst N x v))
(where y ,(variable-not-in (term N_2) 'l))
(tc-down Γ ((λ y N_2) ... | |
4a13f8aa6e5d06b7a7375f40bae2e9bd1e95f0d6464806c1cfc200ca470f720c | yariv/twoorl | twoorl_ita.erl | This file is part of Twoorl .
%%
%% Twoorl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
%% (at your option) any later version.
%%
%% Twoorl is distributed in the ho... | null | https://raw.githubusercontent.com/yariv/twoorl/77b6bea2e29283d09a95d8db131b916e16d2960b/src/bundles/twoorl_ita.erl | erlang |
Twoorl is free software: you can redistribute it and/or modify
(at your option) any later version.
Twoorl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License f... | This file is part of Twoorl .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
along with . If not , see < / > .
-module(twoorl_ita).
-export([bundle/1]... |
bd041b8c2604406224c969e9ab86fb707fecae85a61ab713579f21416acaf2d8 | prg-titech/baccaml | jit_tracer_util.ml | open Std
open MinCaml
open Asm
open Jit_util
open Jit_env
let value_of_id_t reg id_t = reg.(int_of_id_t id_t) |> value_of
let filter ~reds args =
List.filter (fun arg -> List.mem (String.get_name arg) reds) args
;;
let rec inline_fun (reg : reg) argr fundef k =
let { args; body } = fundef in
let argt, body = R... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/jit/jit_tracer_util.ml | ocaml | open Std
open MinCaml
open Asm
open Jit_util
open Jit_env
let value_of_id_t reg id_t = reg.(int_of_id_t id_t) |> value_of
let filter ~reds args =
List.filter (fun arg -> List.mem (String.get_name arg) reds) args
;;
let rec inline_fun (reg : reg) argr fundef k =
let { args; body } = fundef in
let argt, body = R... | |
61b277ca51942e0b64ecfbc981de718eb8df84ffb0d1907f19314722c8ba272d | batterseapower/supercompilation-by-evaluation | Syntax.hs | # LANGUAGE PatternGuards , ViewPatterns , TypeSynonymInstances , FlexibleInstances #
module Core.Syntax where
import Name
import Utilities
type Var = Name
type DataCon = String
data PrimOp = Add | Subtract | Multiply | Divide | Modulo | Equal | LessThan | LessThanEqual
deriving (Eq, Ord, Show)
data Al... | null | https://raw.githubusercontent.com/batterseapower/supercompilation-by-evaluation/daeb3e12ca8319a5144dd48a763cf7e7825a1999/Core/Syntax.hs | haskell | Unfortunately, this nicer pretty-printing doesn't work for general (TermF term):
Lambda x e -> pPrintPrecLam level prec (x:xs) e' | # LANGUAGE PatternGuards , ViewPatterns , TypeSynonymInstances , FlexibleInstances #
module Core.Syntax where
import Name
import Utilities
type Var = Name
type DataCon = String
data PrimOp = Add | Subtract | Multiply | Divide | Modulo | Equal | LessThan | LessThanEqual
deriving (Eq, Ord, Show)
data Al... |
bd833e3d1c490bbb60a56f404532f80d4db17257eb3fc4d8bd700e7bae95798a | CommonDoc/common-doc | split.lisp | (defpackage split-paragraphs-example
(:use :cl :common-doc)
(:import-from :common-doc.split-paragraphs
:split-paragraphs))
(in-package :split-paragraphs-example)
(defvar *document* (make-content
(list
(make-text
(format nil "Some text.~... | null | https://raw.githubusercontent.com/CommonDoc/common-doc/66cabe67241449a1c0e2cbdc955a60c9439869e6/docs/split.lisp | lisp | content-node
text-node
"Some text.
Some "
bold
text-node
"bold text"
text-node
".
Other text."
content-node
paragraph
text-node
"Some text."
paragraph
text-node
"Some "
bold
text-node
"bold text"
text-node
"."
paragra... | (defpackage split-paragraphs-example
(:use :cl :common-doc)
(:import-from :common-doc.split-paragraphs
:split-paragraphs))
(in-package :split-paragraphs-example)
(defvar *document* (make-content
(list
(make-text
(format nil "Some text.~... |
e3f256de7a70e6ce8b15cc9e840d4e90b9b8aa2e6ee833f64bef0f32a3301f89 | mhuebert/re-view | menu.cljs | (ns re-view.material.components.menu
(:require [re-view.core :as v]
[re-view.material.mdc :as mdc]
[re-view.material.util :as util]
["@material/menu/simple/foundation" :as foundation]
["@material/menu/util" :refer [getTransformPropertyName]]
[re-view.mate... | null | https://raw.githubusercontent.com/mhuebert/re-view/ba38cd09b78b3c6db6a2983f3e2cf1bd6294564f/material/src/re_view/material/components/menu.cljs | clojure | (ns re-view.material.components.menu
(:require [re-view.core :as v]
[re-view.material.mdc :as mdc]
[re-view.material.util :as util]
["@material/menu/simple/foundation" :as foundation]
["@material/menu/util" :refer [getTransformPropertyName]]
[re-view.mate... | |
ae3b2fc7b91e2db184e8c077cef7e6ef409f1138587ca6f932f3ade7a670fd8f | witan-org/witan | keys.mli | (*************************************************************************)
This file is part of Witan .
(* *)
Copyright ( C ) 2017
CEA ( Commi... | null | https://raw.githubusercontent.com/witan-org/witan/d26f9f810fc34bf44daccb91f71ad3258eb62037/src/stdlib/keys.mli | ocaml | ***********************************************************************
alternatives)
Automatique)
... | This file is part of Witan .
Copyright ( C ) 2017
CEA ( Commissariat à l'énergie atomique et aux énergies
( Institut National de Recherche en Informatique et en
CNRS ( Centre nation... |
6f26022d58501798922c5645bf6cc890436bff00adef3c09aa5f1724fe53b091 | jeapostrophe/exp | room-assign.rkt | #lang racket/base
(require racket/pretty
racket/list
racket/match
csv-reading
raart)
(define inventory
(hash "110-C-C" 1
"120-L-T" 2
"120-L-C" 4
"120-C-C" 1
"120-R-T" 5
"140-C-C" 3
"140-C-T" 1
"140-R-C" 4
"150-C-T" 6
... | null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/room-assign.rkt | racket | ; 2 on site , but 315 allocated to Holly
" " # ; " " " " " " " " " " " " ) )
Problem Instance
Run problem
Render Solution | #lang racket/base
(require racket/pretty
racket/list
racket/match
csv-reading
raart)
(define inventory
(hash "110-C-C" 1
"120-L-T" 2
"120-L-C" 4
"120-C-C" 1
"120-R-T" 5
"140-C-C" 3
"140-C-T" 1
"140-R-C" 4
"150-C-T" 6
... |
7f80eba1379ded17a4b300316f89b5262e80674e1383422e1dbe30fa6e086e41 | jonasseglare/geex | core_test.clj | (ns geex.core-test
(:import [geex SeedParameters Mode])
(:require [clojure.test :refer :all]
[geex.core.defs :as defs]
[geex.core :refer :all :as jcore]
[geex.core.seed :as seed]
[geex.core.defs :as defs]
[geex.core.datatypes :as datatypes]
[bl... | null | https://raw.githubusercontent.com/jonasseglare/geex/f1a48c14c983c054c91fb221b91f42de5fa8eee0/test/geex/core_test.clj | clojure | Check that wrapping takes place
counter
product | (ns geex.core-test
(:import [geex SeedParameters Mode])
(:require [clojure.test :refer :all]
[geex.core.defs :as defs]
[geex.core :refer :all :as jcore]
[geex.core.seed :as seed]
[geex.core.defs :as defs]
[geex.core.datatypes :as datatypes]
[bl... |
2aa2c11159dab819586a3cd99bbca246bdbc84b21b66bca40c6e87c051a7fa4e | TakaiKinoko/Cornell_CS3110_OCaml | myStack.ml | * Because ' a stack is abstract in the Stack module type , no client of this data structure will be able to discern whether stacks are being implemented with the built - in list type or the custom one we just used .
module type Stack_verbose = sig
type 'a stack
val empty : 'a stack
val is_empty : 'a s... | null | https://raw.githubusercontent.com/TakaiKinoko/Cornell_CS3110_OCaml/0a830bc50a5e39f010074dc289161426294cad1d/Chap5_Modules/02functional_data_structure/myStack.ml | ocaml | * rewrite the above module type in a less verbose way
* another implementation of stack using algebraic data types | * Because ' a stack is abstract in the Stack module type , no client of this data structure will be able to discern whether stacks are being implemented with the built - in list type or the custom one we just used .
module type Stack_verbose = sig
type 'a stack
val empty : 'a stack
val is_empty : 'a s... |
6cf7e988636ab3ff531681a93c1294e5127d121446b4f7bef620e97ca83f372e | tenpureto/tenpureto | Templater.hs | module Tenpureto.Templater where
import Polysemy
import Polysemy.Resource
import Control.Monad
import Data.Attoparsec.Text
import Data.ByteString ( ByteString )
import Data.Foldable
import Data.Functor
import Data.List
impo... | null | https://raw.githubusercontent.com/tenpureto/tenpureto/886df860200e1a6f44ce07c24a5e7597009f71ef/src/Tenpureto/Templater.hs | haskell | module Tenpureto.Templater where
import Polysemy
import Polysemy.Resource
import Control.Monad
import Data.Attoparsec.Text
import Data.ByteString ( ByteString )
import Data.Foldable
import Data.Functor
import Data.List
impo... | |
e9140058685a8d25ba0045f9b4f414dc9122b882243f14ef50bdc2a2bba4b495 | saltysystems/enet | enet_peer.erl | -module(enet_peer).
-behaviour(gen_statem).
-include("enet_peer.hrl").
-include("enet_commands.hrl").
-include("enet_protocol.hrl").
%% API
-export([
start_link/2,
disconnect/1,
disconnect_now/1,
channels/1,
channel/2,
recv_incoming_packet/4,
send_command/2,
get_connect_id/1,
get_m... | null | https://raw.githubusercontent.com/saltysystems/enet/83995f0dd808b969f1b68b89f6609518342639ca/src/enet_peer.erl | erlang | API
gen_statem callbacks
gen_statem state functions
==============================================================
Connection handshake
==============================================================
state client server state
(init) *
| connect
... | -module(enet_peer).
-behaviour(gen_statem).
-include("enet_peer.hrl").
-include("enet_commands.hrl").
-include("enet_protocol.hrl").
-export([
start_link/2,
disconnect/1,
disconnect_now/1,
channels/1,
channel/2,
recv_incoming_packet/4,
send_command/2,
get_connect_id/1,
get_mtu/1,
... |
24cb24edf36c0f9ee2cc14234de7cef220b300eec284686b7fe859d808dd4017 | tek/proteome | Replace.hs | module Proteome.Grep.Replace where
import qualified Data.List.NonEmpty as NonEmpty (toList)
import qualified Data.Text as Text
import Lens.Micro.Extras (view)
import Path (parseAbsFile)
import Prelude hiding (group)
import Ribosome (
Buffer,
Handler,
Rpc,
RpcError,
Scratch,
ScratchId (ScratchId),
Scratch... | null | https://raw.githubusercontent.com/tek/proteome/6c43ed6093c25564da4bfe6deaae7547a0e552f6/packages/proteome/lib/Proteome/Grep/Replace.hs | haskell | If the deleted line was surrounded by blank lines or buffer edges, there will be extraneous whitespace.
Then do the same for the last line.
Finally, check if both the preceding and current line are empty. | module Proteome.Grep.Replace where
import qualified Data.List.NonEmpty as NonEmpty (toList)
import qualified Data.Text as Text
import Lens.Micro.Extras (view)
import Path (parseAbsFile)
import Prelude hiding (group)
import Ribosome (
Buffer,
Handler,
Rpc,
RpcError,
Scratch,
ScratchId (ScratchId),
Scratch... |
ae4b87ba5f717a3c76c7749f8d25a7c8e4cb1623fcb71feac9ac16c8f947c0c3 | janestreet/memtrace_viewer | location.mli | open! Core
open Memtrace_viewer_common
type t [@@immediate]
val allocator : t
val toplevel : t
_ required by [ Substring_heavy_hitters ]
include Comparable.S with type t := t
include Hashable.S with type t := t
include Sexpable.S with type t := t
module Code : sig
type t = Memtrace.Trace.Location_code.t [@@derivi... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer/46439f8bd16e77c5aa38632c9c4aa53175121d4d/server/src/location.mli | ocaml | open! Core
open Memtrace_viewer_common
type t [@@immediate]
val allocator : t
val toplevel : t
_ required by [ Substring_heavy_hitters ]
include Comparable.S with type t := t
include Hashable.S with type t := t
include Sexpable.S with type t := t
module Code : sig
type t = Memtrace.Trace.Location_code.t [@@derivi... | |
359090f0aa4e55000e5e23837cd01c9e9abbe43070aa219d865043614c8435d0 | ocurrent/ocurrent | current_git.ml | open Current.Syntax
open Lwt.Infix
let src = Logs.Src.create "current.git" ~doc:"OCurrent git plugin"
module Log = (val Logs.src_log src : Logs.LOG)
module Commit_id = Commit_id
module Commit = Commit
let ( >>!= ) x f =
x >>= function
| Ok y -> f y
| Error _ as e -> Lwt.return e
module Fetch = struct
type t... | null | https://raw.githubusercontent.com/ocurrent/ocurrent/06f66d31cf545a8436405616521f45d699942501/plugins/git/current_git.ml | ocaml | Ensure we have a local clone of the repository.
Fetch the commit (if missing).
Check we got the commit we wanted.
Get any submodules too.
"sync" is needed to handle repositories moving.
"deinit" is needed to handle submodules being removed.
Note:
This could cause trouble if we cancel ... | open Current.Syntax
open Lwt.Infix
let src = Logs.Src.create "current.git" ~doc:"OCurrent git plugin"
module Log = (val Logs.src_log src : Logs.LOG)
module Commit_id = Commit_id
module Commit = Commit
let ( >>!= ) x f =
x >>= function
| Ok y -> f y
| Error _ as e -> Lwt.return e
module Fetch = struct
type t... |
a1adabd1cdf8830e9503d773a81171e0956c72fdbb5ccd56870f226ee430f663 | mirage/ocaml-git | git_paf.ml | open Lwt.Infix
let src = Logs.Src.create "git.paf"
module Log = (val Logs.src_log src : Logs.LOG)
let git_paf_scheme = Mimic.make ~name:"git-paf-scheme"
let git_paf_port = Mimic.make ~name:"git-paf-port"
let git_paf_hostname = Mimic.make ~name:"git-paf-hostname"
let with_uri uri ctx =
let scheme =
match Uri.s... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/src/git-paf/git_paf.ml | ocaml | open Lwt.Infix
let src = Logs.Src.create "git.paf"
module Log = (val Logs.src_log src : Logs.LOG)
let git_paf_scheme = Mimic.make ~name:"git-paf-scheme"
let git_paf_port = Mimic.make ~name:"git-paf-port"
let git_paf_hostname = Mimic.make ~name:"git-paf-hostname"
let with_uri uri ctx =
let scheme =
match Uri.s... | |
6deb9808640113207d084e31dc5e3a199023a7d0d07a2621755e8cc40f17ed14 | fogfish/serverless | serverless_lambda.erl | %%
Copyright ( C ) 2018
%%
%% This file may be modified and distributed under the terms
of the MIT license . See the LICENSE file for details .
%%
%%
-module(serverless_lambda).
-behaviour(pipe).
-compile({parse_transform, category}).
-export([
start_link/1,
init/1,
free/2,
handle/3,
lifecycle/... | null | https://raw.githubusercontent.com/fogfish/serverless/c804e510e9c473941b1b457ba175f537f1939f39/src/serverless_lambda.erl | erlang |
This file may be modified and distributed under the terms
-----------------------------------------------------------------------------
factory
-----------------------------------------------------------------------------
socket options (so) are mandatory
tune HTTP timeouts so that runtime api would not fail... | Copyright ( C ) 2018
of the MIT license . See the LICENSE file for details .
-module(serverless_lambda).
-behaviour(pipe).
-compile({parse_transform, category}).
-export([
start_link/1,
init/1,
free/2,
handle/3,
lifecycle/2
]).
-define(PROTOCOL, "http://").
-define(VERSION, "/2018-06-01").
st... |
1441173cc65f8f4c09e686a47a3d934a48ec7e88f3b34262298794257fc6c695 | carlohamalainen/ghc-imported-from | Hiding.hs | Hiding.hs
module Hiding where
import Data.List hiding (map)
import System.Environment (getArgs)
import qualified Safe
m = map (+1) [1, 2, 3]
h = head [1, 2, 3]
h' = Safe.headMay []
| null | https://raw.githubusercontent.com/carlohamalainen/ghc-imported-from/ac28f1c26644791abd698c55b00ce663ccbd861d/test/data/Hiding.hs | haskell | Hiding.hs
module Hiding where
import Data.List hiding (map)
import System.Environment (getArgs)
import qualified Safe
m = map (+1) [1, 2, 3]
h = head [1, 2, 3]
h' = Safe.headMay []
| |
98789cd6af54ece143e9a88007b9ee63e91e0fefcb86bb65923a7a6f34dff007 | jmorag/open-strings | NoFoundation.hs | # LANGUAGE CPP #
module Import.NoFoundation (
module Import,
getCSRF,
) where
import ClassyPrelude.Yesod as Import
import Model as Import
import Settings as Import
import Settings.StaticFiles as Import
import Yesod.Auth as Import
import Yesod.Core.Types as Import (loggerSet)
import Yesod.Default.Config2 as Import... | null | https://raw.githubusercontent.com/jmorag/open-strings/a9deff3c6ce36d588e47a237d47f191e195faa56/src/Import/NoFoundation.hs | haskell | # LANGUAGE CPP #
module Import.NoFoundation (
module Import,
getCSRF,
) where
import ClassyPrelude.Yesod as Import
import Model as Import
import Settings as Import
import Settings.StaticFiles as Import
import Yesod.Auth as Import
import Yesod.Core.Types as Import (loggerSet)
import Yesod.Default.Config2 as Import... | |
2136b37b06ed18bea99944d8f0291d853025d9b3ac6857d807fc784c49f90385 | ymilky/franzy-admin | partition_tests.clj | (ns franzy.admin.partition-tests
(:require [midje.sweet :refer :all]
[franzy.admin.schema :as fas]
[franzy.admin.topics :as topics]
[franzy.admin.partitions :refer :all]
[franzy.admin.core-test :as core-test]
[schema.core :as s]
[franzy.common.mo... | null | https://raw.githubusercontent.com/ymilky/franzy-admin/94588c5ce1b50f4a61b2fb4a4ec4d47568b83287/test/franzy/admin/partition_tests.clj | clojure | ex:
[{:topic "brogrammers", :partition 0}
{:topic "cheetah-shirts", :partition 0}]
ex: [1001 1002 1003]
TODO: more tests...
ex:
{:controller-epoch 1,
:leader-and-isr
{:topic "strange-itches", :partition 0}
{:controller-epoch 1,
:leader-and-isr
TODO: more tests...a lot more
ex: /brokers/topics/middle-management-... | (ns franzy.admin.partition-tests
(:require [midje.sweet :refer :all]
[franzy.admin.schema :as fas]
[franzy.admin.topics :as topics]
[franzy.admin.partitions :refer :all]
[franzy.admin.core-test :as core-test]
[schema.core :as s]
[franzy.common.mo... |
db23cf5fe394c9ce1504864cab5cadc4aab7d0e274c6aac01b4ae269747345d8 | ocaml/ocaml | compmisc.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
Fabr... | null | https://raw.githubusercontent.com/ocaml/ocaml/113c2e54504fbac6d6965eaf37df1267c627a466/driver/compmisc.ml | ocaml | ************************************************************************
OCaml
... | Fabrice Le Fessant , EPI Gallium , INRIA Paris - Rocquencourt
Copyright 2013 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
let auto_include find_in_dir fn =
if !Clflags.no_std_include then
raise Not_found
el... |
de9fac74498401f479708ded781344121faf298138ba075645956d40721cced9 | PLSysSec/lio | Instances.hs | {-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
{-# LANGUAGE RankNTypes #-}
-- | Instances for "QuickCheck"\'s 'Arbitrary' class.
module LIO.Instances (
A(..), B(..), C(..), D(..), DCAct... | null | https://raw.githubusercontent.com/PLSysSec/lio/622a3e7bc86a3b42ab4ce8be954064a5f142247a/quickcheck-lio-instances/LIO/Instances.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
| Instances for "QuickCheck"\'s 'Arbitrary' class.
| Exception type
| Exception type
| Exception type
| Exception type
| Exception type that will /never/ be thrown
| General 'DC' action
random dc actions | # LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
module LIO.Instances (
A(..), B(..), C(..), D(..), DCAction(..)
, DoNotThrow(..)
) where
import Data.Typeable
import Data.IORef
import Control.Concurrent.MVar
import Test.QuickCheck hiding (label)
import Te... |
5c4c66b2d6bc632fbe1f8ff18a4906d1dc916274448c4f13b1d2f8779b30fa69 | joelburget/lvca | Store.ml | open Base
open Lvca_syntax
open Lvca_util
module Content_store = struct
(** Mapping from hash to content *)
type t = (string, Nominal.Term.t) Hashtbl.t
let singleton : t = Hashtbl.create (module String)
let find = Hashtbl.find singleton
end
module Tag_store = struct
(** Mapping from tag to hash *)
type t... | null | https://raw.githubusercontent.com/joelburget/lvca/f8a3b8e294f564d1fc9836af63e6169b26ca0234/pages/Store.ml | ocaml | * Mapping from hash to content
* Mapping from tag to hash | open Base
open Lvca_syntax
open Lvca_util
module Content_store = struct
type t = (string, Nominal.Term.t) Hashtbl.t
let singleton : t = Hashtbl.create (module String)
let find = Hashtbl.find singleton
end
module Tag_store = struct
type t = (string, string) Hashtbl.t
let singleton : t = Hashtbl.create (mod... |
8eba520828dcfee67e2763ed17ce8b673a250e1429bc68f8f55bd4fb99cb1d26 | collegevine/firebase | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens.Lens
import Control.Monad
import Control.Monad.Except
import Control.Monad.Reader
import Data.Aeson
import Database.Firebase
import Network.HTTP.Nano
import System.Environment
type TestM = ReaderT TestEnv (ExceptT HttpError IO)
data TestEnv = ... | null | https://raw.githubusercontent.com/collegevine/firebase/4cf78ef769749b13d1b853c37c1672fa5e489b69/test/Main.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import Control.Lens.Lens
import Control.Monad
import Control.Monad.Except
import Control.Monad.Reader
import Data.Aeson
import Database.Firebase
import Network.HTTP.Nano
import System.Environment
type TestM = ReaderT TestEnv (ExceptT HttpError IO)
data TestEnv = TestEnv {
testFB :: Firebase,
... |
58abcbe33eb4e523da056a54fdfdafb3f6d994f4beeae81638882ecee00795f4 | informatimago/lisp | test-stub-nvt.lisp | (defpackage "COM.INFORMATIMAGO.CLEXT.TELNET.TEST.STUB-NVT"
(:use "COMMON-LISP"
"COM.INFORMATIMAGO.COMMON-LISP.TELNET")
(:export "STUB-NVT"))
(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.TEST.STUB-NVT")
(defclass stub-nvt ()
((urgent-mode-p :initform nil
:accessor urgent-mode-p
... | null | https://raw.githubusercontent.com/informatimago/lisp/246c79b6b1b888a8fb60bb7201238523ea09347d/clext/telnet/test-stub-nvt.lisp | lisp | ;; option control:
(:documentation "Whether the option is currently enabled,
OPTION-NAME: a keyword or fixnum denoting the option.
WHO: (member nil :us :him)."))
(:documentation "Whether the option is currently being negotiated,
OPTION-NAME: a keyword or fixnum denoting the option.
WHO: (... | (defpackage "COM.INFORMATIMAGO.CLEXT.TELNET.TEST.STUB-NVT"
(:use "COMMON-LISP"
"COM.INFORMATIMAGO.COMMON-LISP.TELNET")
(:export "STUB-NVT"))
(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.TEST.STUB-NVT")
(defclass stub-nvt ()
((urgent-mode-p :initform nil
:accessor urgent-mode-p
... |
7432a56b738a520d787d14ed0a7129bf2e0589a268afbc230989eb57b234503c | aconchillo/guile-oauth | request.scm |
( oauth request ) --- OAuth 1.0 implementation .
Copyright ( C ) 2013 - 2022 Aleix Conchillo Flaque < >
;;
;; This file is part of guile-oauth.
;;
;; guile-oauth is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fo... | null | https://raw.githubusercontent.com/aconchillo/guile-oauth/a40a1641fd9e29bf78ec1bbd32535894c6edb513/oauth/oauth1/request.scm | scheme |
This file is part of guile-oauth.
guile-oauth is free software: you can redistribute it and/or modify
either version 3 of the License , or
(at your option) any later version.
guile-oauth is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTA... |
( oauth request ) --- OAuth 1.0 implementation .
Copyright ( C ) 2013 - 2022 Aleix Conchillo Flaque < >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
OAuth 1.0 module for
(define-module (oauth oauth1 request)
... |
aeab3eb8d77fb3c54825c7b0d0a6f4a41f5e90d60e304f3a38ad12cb5bb36dc9 | florentc/youbrick | Splittable.hs | |
Module : Tui . Splittable
Description : List instance of Splittable
Copyright : ( c ) , 2021
License : GPL-3.0 - or - later
Splittable ( Brick typeclass ) instance for lists ( to use in Brick list widgets ) .
Module : Tui.Splittable
Description : List instance of Splittable
Copyrigh... | null | https://raw.githubusercontent.com/florentc/youbrick/0b0dae7c94773df904b9d6c9172d503d65e86281/src/Tui/Splittable.hs | haskell | |
Module : Tui . Splittable
Description : List instance of Splittable
Copyright : ( c ) , 2021
License : GPL-3.0 - or - later
Splittable ( Brick typeclass ) instance for lists ( to use in Brick list widgets ) .
Module : Tui.Splittable
Description : List instance of Splittable
Copyrigh... | |
6b847ce8de47328c515cbb86d7e518ff51a1793967f2696e4e44091150e0d29b | joinr/datasetcomp | core.clj | (ns datasetcomp.core
(:require [spork.util.table :as tbl]
[tech.ml.dataset.csv :as tech]
[datasetcomp.tablesaw :as tablesaw]
[clj-memory-meter.core :as mm]))
(def the-data (atom nil))
;;atypical def usage, this is for cleaning up resources.
(defn clean! []
(do (reset! the-data n... | null | https://raw.githubusercontent.com/joinr/datasetcomp/cf792da5e603e62b0529984646263731232dba55/src/datasetcomp/core.clj | clojure | atypical def usage, this is for cleaning up resources.
Monkey patched a couple of things into spork and tech
comparative testing...
available at
To get a sense of file traversal, on my machine, just counting lines naively
via line-seq is almost 2x as slow as using reducers or other seq-avoiding
methods.
datasetcomp.... | (ns datasetcomp.core
(:require [spork.util.table :as tbl]
[tech.ml.dataset.csv :as tech]
[datasetcomp.tablesaw :as tablesaw]
[clj-memory-meter.core :as mm]))
(def the-data (atom nil))
(defn clean! []
(do (reset! the-data nil) (System/gc)))
(defmacro timed-build [name & expr]
... |
2b38ced8cdc7d46c88f211c6ddb87a485768c9a2d1d798723bbb6f30b4aff360 | keera-studios/haskell-titan | Comm.hs | -- | Communication bridges between the debugger running locally attached
to a Yampa application and the debugging GUI running remotely on
-- your machine.
--
Copyright : ( C ) Keera Studios Ltd , 2018
-- License : GPL-3
Maintainer :
module FRP.Titan.Debug.Comm
( ExternalBridge(..)
, getAllMe... | null | https://raw.githubusercontent.com/keera-studios/haskell-titan/958ddd2b468af00db46004a683c1c7aebe81526c/titan-debug-yampa/src/FRP/Titan/Debug/Comm.hs | haskell | | Communication bridges between the debugger running locally attached
your machine.
License : GPL-3
| Configuration layer to communicate the FRP app and the debugging GUI.
^ Print log messages
^ Send a message to the debugger using the sync channel.
^ Send a message to the debugger using the async channel... | to a Yampa application and the debugging GUI running remotely on
Copyright : ( C ) Keera Studios Ltd , 2018
Maintainer :
module FRP.Titan.Debug.Comm
( ExternalBridge(..)
, getAllMessages
)
where
data ExternalBridge = ExternalBridge
}
getAllMessages :: ExternalBridge -> IO [String]
getAll... |
4aac62e14fb484d14b352cd584e541d4228980a2030a08f8dade79b837048074 | A1kmm/proofsweeper | IdrisGen.hs | module IdrisGen (saveIdrisGame) where
import GameModel
import qualified Data.Map as M
import Data.Maybe
isKnown :: (Coord, CellStatus) -> Bool
isKnown (_, CellStatus CellKnown _) = True
isKnown _ = False
genMineFact :: M.Map Coord Int -> (Coord, CellStatus) -> String
genMineFact _ (Coord x y, CellStatus _ CellMine) =... | null | https://raw.githubusercontent.com/A1kmm/proofsweeper/a09a367d81ae8254874c41087b13c98e04e25941/game-engine/src/IdrisGen.hs | haskell | Generated source - do not edit!\n\
This contains the axioms for the current state of the game.\n\ | module IdrisGen (saveIdrisGame) where
import GameModel
import qualified Data.Map as M
import Data.Maybe
isKnown :: (Coord, CellStatus) -> Bool
isKnown (_, CellStatus CellKnown _) = True
isKnown _ = False
genMineFact :: M.Map Coord Int -> (Coord, CellStatus) -> String
genMineFact _ (Coord x y, CellStatus _ CellMine) =... |
a422764479873eca7813daba9cefbb3633255284d35537d9cd60eafd47130eae | sir4ur0n/blog | Application.hs | -- | This is the top-level application.
--
-- Once started, you can toy around with the HTTP API as such:
--
-- * Load users from (in-memory) database: @curl :8081/users@
-- * Insert a valid user: @curl -H 'Content-Type: application/json' :8081/users -d '{"name":"John Doe", "age":27, "email":""}'@
-- * Insert an invali... | null | https://raw.githubusercontent.com/sir4ur0n/blog/789d695ae266f953952fb19f1b85098d588bd793/code-examples/src/PolysemyFullExample/Application.hs | haskell | | This is the top-level application.
Once started, you can toy around with the HTTP API as such:
* Load users from (in-memory) database: @curl :8081/users@
* Insert a valid user: @curl -H 'Content-Type: application/json' :8081/users -d '{"name":"John Doe", "age":27, "email":""}'@
* Insert an invalid user: @curl ... | module PolysemyFullExample.Application where
import Control.Monad.IO.Class (liftIO)
import Database.SQLite.Simple (Connection, close, open)
import qualified Network.Wai.Handler.Warp as Warp
import PolysemyFullExample.Controller
import Polysemy
import PolysemyFullExample.Effect.Database
import PolysemyFullExample.Effec... |
56844e7966cd844331f574d69464ecdfe3638f0793437775b9de50712e35dcd8 | huangjs/cl | zunk1.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l ,... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/src/numerical/slatec/zunk1.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rt... |
e8c7f4d8d70291d23dcfc4dc5d5b13980f474aa89456e139ab27fb3b56ed0ff3 | HunterYIboHu/htdp2-solution | ex338-create-dir-and-check-many.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex338-create-dir-and-check-many) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter4/Section20-Incremental-Refinement/ex338-create-dir-and-check-many.rkt | racket | about the language level of this file in a form that our tools can easily process.
data difinitions
#:extra-constructor-name make-dir)
name : symbol?
(struct file (name size content)
#:extra-constructor-name make-file)
name : symbol?
size : integer?
constants
functions
Dir -> Number
produces the num... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex338-create-dir-and-check-many) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(require htdp/dir)
( struct... |
0df8afcca7df352691c1c02a416759c2ef039c61c9d4be799efb1acf9f075c0c | serokell/ariadne | Actions.hs | module Ariadne.Wallet.Cardano.Kernel.Actions
( WalletAction(..)
, WalletActionInterp(..)
, forkWalletWorker
, walletWorker
, interp
, interpList
, WalletWorkerState
, isInitialState
, hasPendingFork
, isValidState
) where
import Control.Concu... | null | https://raw.githubusercontent.com/serokell/ariadne/5f49ee53b6bbaf332cb6f110c75f7b971acdd452/ariadne/cardano/src/Ariadne/Wallet/Cardano/Kernel/Actions.hs | haskell | ------------------------------------------------------------------------------
Workers and helpers for performing wallet state updates
------------------------------------------------------------------------------
| Actions that can be invoked on a wallet, via a worker.
Workers may not respond directly to each ac... | module Ariadne.Wallet.Cardano.Kernel.Actions
( WalletAction(..)
, WalletActionInterp(..)
, forkWalletWorker
, walletWorker
, interp
, interpList
, WalletWorkerState
, isInitialState
, hasPendingFork
, isValidState
) where
import Control.Concu... |
8f1ba5632c3879beebe2c7faed076cf05872589c6ec6f1dfc3f9bc9b9d87a896 | aharisu/Gauche-CV | load.scm | (use cv)
(let* ([img (cv-cast <iplimage> (cv-load "image.xml"))])
(cv-show-image "src" img)
(cv-wait-key 0))
| null | https://raw.githubusercontent.com/aharisu/Gauche-CV/5e4c51501431c72270765121ea4d92693f11d60b/sample/load.scm | scheme | (use cv)
(let* ([img (cv-cast <iplimage> (cv-load "image.xml"))])
(cv-show-image "src" img)
(cv-wait-key 0))
| |
7fbb17fd27328221b6afc9c70d99e28e45acd505f308cafa777c348fa3d72f8f | joshvera/effects | Tests.hs | # LANGUAGE TypeApplications #
module Main where
import Control.Monad.Effect
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Tests.Coroutine
import Tests.Exception
import Tests.Fresh
import Tests.NonDet
import Tests.Reader
import Tests.State
import Tests.StateRW
import qualified Data.Li... | null | https://raw.githubusercontent.com/joshvera/effects/b2693454131dc7c00d2cf45bea69c17b986f0ea5/tests/Tests.hs | haskell | ------------------------------------------------------------------------------
Pure Tests --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Coroutine Tests --
------------------------------------------------... | # LANGUAGE TypeApplications #
module Main where
import Control.Monad.Effect
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Tests.Coroutine
import Tests.Exception
import Tests.Fresh
import Tests.NonDet
import Tests.Reader
import Tests.State
import Tests.StateRW
import qualified Data.Li... |
96d078ae58b99698f95ef9ebf02e581a6732b6b8d88fa6cf387c655feec77eea | camllight/camllight | order.ml | (*********************** Recursive Path Ordering ****************************)
#open "terms";;
type ordering = Greater | Equal | NotGE;;
let ge_ord order pair = match order pair with NotGE -> false | _ -> true
and gt_ord order pair = match order pair with Greater -> true | _ -> false
and eq_ord order pair = match or... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/windows/examples/kb/order.ml | ocaml | ********************** Recursive Path Ordering ***************************
multiset extension of order
lexicographic extension of order
recursive path ordering |
#open "terms";;
type ordering = Greater | Equal | NotGE;;
let ge_ord order pair = match order pair with NotGE -> false | _ -> true
and gt_ord order pair = match order pair with Greater -> true | _ -> false
and eq_ord order pair = match order pair with Equal -> true | _ -> false
;;
let rem_eq equiv = remrec where re... |
1afbd72106e82548b17e354de3a0b54784cda5a9be8252e016b2f1bbc4e17621 | dwayne/eopl3 | ex1.29.rkt | #lang racket
(define (sort loi)
(define (insert x sorted-loi)
(if (null? sorted-loi)
(list x)
(if (<= x (car sorted-loi))
(cons x sorted-loi)
(cons (car sorted-loi)
(insert x (cdr sorted-loi))))))
(if (null? loi)
'()
(insert (car loi) (sort ... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/01-ch1/racket/ex1.29.rkt | racket | #lang racket
(define (sort loi)
(define (insert x sorted-loi)
(if (null? sorted-loi)
(list x)
(if (<= x (car sorted-loi))
(cons x sorted-loi)
(cons (car sorted-loi)
(insert x (cdr sorted-loi))))))
(if (null? loi)
'()
(insert (car loi) (sort ... | |
d89f9d4158ce767dcaea3737ce97cbf0e6d66065a299ee9ee68d706fefb18131 | askvortsov1/hardcaml-mips | alu.ml | open Hardcaml
open Hardcaml.Signal
module I = struct
type 'a t = {
arg_a : 'a; [@bits 32]
arg_b : 'a; [@bits 32]
alu_control : 'a; [@bits (width Control_unit.Alu_ops.default)]
}
[@@deriving sexp_of, hardcaml]
end
module O = struct
type 'a t = { result : 'a [@bits 32] } [@@deriving sexp_of, hardcam... | null | https://raw.githubusercontent.com/askvortsov1/hardcaml-mips/584c25803cd6967be50acd0a6a3f3f9289e8b100/lib/instruction_execute/alu.ml | ocaml | open Hardcaml
open Hardcaml.Signal
module I = struct
type 'a t = {
arg_a : 'a; [@bits 32]
arg_b : 'a; [@bits 32]
alu_control : 'a; [@bits (width Control_unit.Alu_ops.default)]
}
[@@deriving sexp_of, hardcaml]
end
module O = struct
type 'a t = { result : 'a [@bits 32] } [@@deriving sexp_of, hardcam... | |
bc7851d68509d2748a51df5392de39c9e68e7c7db7169a29fd808bdd3d5a27cc | RefactoringTools/HaRe | TestUtils.hs | module TestUtils
( compareFiles
, parsedFileGhc
, parsedFileGhcCd
, parseSourceFileTest
, runLogTestGhc
, runTestGhc
, runRefactGhcState
, runRefactGhcStateLog
, initialState
, initialLogOnState
, showAnnDataFromState
, showAnnDataItemF... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/TestUtils.hs | haskell | ---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
logm $ "parsedFileGhc:fileName" ++ ... | module TestUtils
( compareFiles
, parsedFileGhc
, parsedFileGhcCd
, parseSourceFileTest
, runLogTestGhc
, runTestGhc
, runRefactGhcState
, runRefactGhcStateLog
, initialState
, initialLogOnState
, showAnnDataFromState
, showAnnDataItemF... |
475bd8cc022f6ad80cdd5f9cca7a5b86b18c96585158257165b441657bb6741b | google/codeworld | Workspace.hs | # LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
# LANGUAGE ScopedTypeVariables #
Copyright 2020 The CodeWorld Authors . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the Lice... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/funblocks-client/src/Blockly/Workspace.hs | haskell | - FFI
TODO Maybe use a list of properties ? | # LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
# LANGUAGE ScopedTypeVariables #
Copyright 2020 The CodeWorld Authors . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the Lice... |
85b3eb557a4547a54368e732effeb0e589fb5b37aff3d6a805abc0ee4bad578c | michiakig/LispInSmallPieces | chap9c.scm | $ I d : chap9c.scm , v 4.6 2006/11/27 queinnec Exp $
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is part of the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
;;; Newest version ma... | null | https://raw.githubusercontent.com/michiakig/LispInSmallPieces/0a2762d539a5f4c7488fffe95722790ac475c2ea/src/chap9c.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is part of the files that accompany the book:
Newest version may be retrieved from:
Check the README file before using this file.
(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
Variables are not Programs! ... | $ I d : chap9c.scm , v 4.6 2006/11/27 queinnec Exp $
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz
A low - level macro system offering hygien .
(define-class Variable... |
984b8cefd78c93f1d0e0828e8a12a4020161a4911ba6aa48b8a1f9d6b0d8c5b1 | karamellpelle/grid | Merge.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/designer/source/Main/GLFW/Merge.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Main.GLFW.Merge
(
mainMerge,
) wher... |
ec98e8aab2f78d31544de97d3150e24ffbbda1d9cee10b2e3669ae6036141aab | Glue42/gateway-modules | util.cljc | (ns gateway.domains.activity.util
(:require [gateway.basic-auth.core :as basic]
[gateway.auth.core :as auth]
[gateway.domains.global.core :as global]
[clojure.core.async :as a]))
(defn ->auth []
{:default :basic
:available {:basic (basic/authenticator {})}})
(defn stop-aut... | null | https://raw.githubusercontent.com/Glue42/gateway-modules/be48a132134b5f9f41fd6a6067800da6be5e6eca/activity-domain/test/gateway/domains/activity/util.cljc | clojure | (ns gateway.domains.activity.util
(:require [gateway.basic-auth.core :as basic]
[gateway.auth.core :as auth]
[gateway.domains.global.core :as global]
[clojure.core.async :as a]))
(defn ->auth []
{:default :basic
:available {:basic (basic/authenticator {})}})
(defn stop-aut... | |
cce825dfbc2892ddb53ddff08b10e9a95f5151770891bc8340a21ba4c3d8707a | dnadales/sandbox | CookingClasses.hs | # LANGUAGE DefaultSignatures #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE RankNTypes #-}
-- | Examples taken from
module CookingClasses where
import Data.Proxy
import Data.Text (Text)
import GHC.Generics
data Pie = Pie
{ filling :: Filling
, topping :: Maybe Topping
}... | null | https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/scrapping-expressions-boilerplate/src/CookingClasses.hs | haskell | # LANGUAGE RankNTypes #
| Examples taken from
* The problem
Enumerate all the types of pies we can make.
The code below does not work, and I'm don't know why, even after reading
-type-in-ghc-generics.
class Menu a where
menu :: a -> [Item]
menu _ = gmenu (Proxy :: Proxy a)
gmenu _ = gopts (Prox... | # LANGUAGE DefaultSignatures #
# LANGUAGE DeriveGeneric #
module CookingClasses where
import Data.Proxy
import Data.Text (Text)
import GHC.Generics
data Pie = Pie
{ filling :: Filling
, topping :: Maybe Topping
} deriving (Show, Generic)
data Filling = Apple | Cherry | Pu... |
7165c51faee3f68ba527e05476dac0af18a5553c1bb0adc1578cb5dc16167b67 | rtoy/ansi-cl-tests | clrhash.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Fri Nov 28 09:33:40 2003
Contains : Tests of CLRHASH
(in-package :cl-test)
(deftest clrhash.1
(let ((table (make-hash-table)))
(setf (gethash 'a table) 'b)
(values
(hash-table-count table)
(equalt (multiple-value-list (clrhash table))
... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/clrhash.lsp | lisp | -*- Mode: Lisp -*-
| Author :
Created : Fri Nov 28 09:33:40 2003
Contains : Tests of CLRHASH
(in-package :cl-test)
(deftest clrhash.1
(let ((table (make-hash-table)))
(setf (gethash 'a table) 'b)
(values
(hash-table-count table)
(equalt (multiple-value-list (clrhash table))
(list table))
... |
eba7324f73ec052972c263e27ffec68484247c3d0c0d1df1148d8cd44f8834af | hackwaly/ocamlearlybird | symbols.ml | *
* Copyright ( C ) 2021
*
* 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 version .
*
* Th... | null | https://raw.githubusercontent.com/hackwaly/ocamlearlybird/165174e3cc749ba416ec7ebfb4b521e5fac744db/src/debugger/core/symbols/symbols.ml | ocaml | *
* Copyright ( C ) 2021
*
* 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 version .
*
* Th... | |
b0b83cf7eded7b07612418f24c72ef4040f18a3244bc28bec74380a48d5c7985 | keigoi/ocaml-mpst-light | ppx_linocaml.ml | TODO : replace " failwith " with proper error - handling
open Migrate_parsetree
open Ast_408
open Asttypes
open Longident
open Parsetree
open Ast_helper
let may_tuple ?loc tup = function
| [] -> None
| [x] -> Some x
| l -> Some (tup ?loc ?attrs:None l)
FIXME
let lid ?(loc = !default_loc) s = Location.mkloc... | null | https://raw.githubusercontent.com/keigoi/ocaml-mpst-light/099658369798b9588cb744ee0b95d09ff6e50d9f/packages/linocaml-light/ppx/ppx_linocaml.ml | ocaml | *
* The main function converting lens-patterns
#tconst
_
x
'a'..'z'
constructor without payloads
polymorphic variant constructor without payloads
`A (None)
`A P (Some P)
[| P1; ...; Pn |]
(P : T)
P as 'a
pexp_loc_stack | TODO : replace " failwith " with proper error - handling
open Migrate_parsetree
open Ast_408
open Asttypes
open Longident
open Parsetree
open Ast_helper
let may_tuple ?loc tup = function
| [] -> None
| [x] -> Some x
| l -> Some (tup ?loc ?attrs:None l)
FIXME
let lid ?(loc = !default_loc) s = Location.mkloc... |
3188d835a630588b0f9e7a1641e9e476ddc6f244f21c90ef028df4e42718cdd6 | kuberlog/holon | init.lisp | (ql:quickload :inferior-shell)
(ql:quickload :cl-store)
(ql:quickload :parachute)
(ql:quickload :postmodern)
(defpackage :holon.task
(:use :cl :postmodern :holon)
(:export :select :complete :deselect :add-task :tasks :*selected-task*))
(require :parachute)
(in-package :holon.task)
(defun run-all-package-tests ()... | null | https://raw.githubusercontent.com/kuberlog/holon/6e84ab2a662f60aaa551a2ed6f5d45a85bd025b3/lisp/task/init.lisp | lisp | (ql:quickload :inferior-shell)
(ql:quickload :cl-store)
(ql:quickload :parachute)
(ql:quickload :postmodern)
(defpackage :holon.task
(:use :cl :postmodern :holon)
(:export :select :complete :deselect :add-task :tasks :*selected-task*))
(require :parachute)
(in-package :holon.task)
(defun run-all-package-tests ()... | |
3df26eb707b086f3557643717fedebabe19db5afd5aea9c34cbfcfb33c75b5d5 | hexlet-codebattle/battle_asserts | garden_help.clj | (ns battle-asserts.issues.garden-help
(:require [clojure.test.check.generators :as gen]))
(def level :medium)
(def tags ["collections" "math"])
(def description
{:en "Yaroslav helps his grandmother plant carrots in a single-line seedbed where a carrot can be planted at each
integer coordinate along the line. H... | null | https://raw.githubusercontent.com/hexlet-codebattle/battle_asserts/608577f9fc947de1a7acdbe6e05254ef5b6de934/src/battle_asserts/issues/garden_help.clj | clojure | (ns battle-asserts.issues.garden-help
(:require [clojure.test.check.generators :as gen]))
(def level :medium)
(def tags ["collections" "math"])
(def description
{:en "Yaroslav helps his grandmother plant carrots in a single-line seedbed where a carrot can be planted at each
integer coordinate along the line. H... | |
782a1a30973c3a96c639d43a11097b90f892871cdcf2031af9be2556cf67154b | Decentralized-Pictures/T4L3NT | accuser.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2020 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/tezt/lib_tezos/accuser.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2020 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
5f96df509be071095b5c8a0159b28eb0e4235a7b0a53af037247982eddc49b62 | mbj/stratosphere | InferenceExecutionConfigProperty.hs | module Stratosphere.SageMaker.Model.InferenceExecutionConfigProperty (
InferenceExecutionConfigProperty(..),
mkInferenceExecutionConfigProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProper... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/Model/InferenceExecutionConfigProperty.hs | haskell | module Stratosphere.SageMaker.Model.InferenceExecutionConfigProperty (
InferenceExecutionConfigProperty(..),
mkInferenceExecutionConfigProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProper... | |
92a9cd58f9e2bdf75c8c0b3645a55a50dc7aa91b02a01cc757db413f37e83a45 | ghc/ghc | Simplify.hs | # LANGUAGE CPP #
module GHC.Core.Opt.Simplify
( SimplifyExprOpts(..), SimplifyOpts(..)
, simplifyExpr, simplifyPgm
) where
import GHC.Prelude
import GHC.Driver.Flags
import GHC.Core
import GHC.Core.Rules
import GHC.Core.Ppr ( pprCoreBindings, pprCoreExpr )
import GHC.Core.Opt.OccurAnal ( occurAnalysePgm, ... | null | https://raw.githubusercontent.com/ghc/ghc/3d55d8ab51ece43c51055c43c9e7aba77cce46c0/compiler/GHC/Core/Opt/Simplify.hs | haskell |
************************************************************************
* *
Gentle simplification
* *
**********************************************************************... | # LANGUAGE CPP #
module GHC.Core.Opt.Simplify
( SimplifyExprOpts(..), SimplifyOpts(..)
, simplifyExpr, simplifyPgm
) where
import GHC.Prelude
import GHC.Driver.Flags
import GHC.Core
import GHC.Core.Rules
import GHC.Core.Ppr ( pprCoreBindings, pprCoreExpr )
import GHC.Core.Opt.OccurAnal ( occurAnalysePgm, ... |
d486260567437ceb3b882daab129b0e243f4dbfb1eefa41b8d30efcdec53b05d | anmonteiro/aemette | routes.cljs | (ns {{name}}.routes
(:require [cljs.core.async :as async]
[secretary.core :as secretary :refer-macros [defroute]]))
(defn- send-nav! [nav-chan nav-target args]
(async/put! nav-chan [nav-target args]))
(defn define-general-routes! [nav-chan]
(defroute root-path "/" []
(send-nav! nav-chan :landing... | null | https://raw.githubusercontent.com/anmonteiro/aemette/c49983e71154db4b4a9c4f751d4413682647f5a5/src/leiningen/new/aemette/routes.cljs | clojure | (ns {{name}}.routes
(:require [cljs.core.async :as async]
[secretary.core :as secretary :refer-macros [defroute]]))
(defn- send-nav! [nav-chan nav-target args]
(async/put! nav-chan [nav-target args]))
(defn define-general-routes! [nav-chan]
(defroute root-path "/" []
(send-nav! nav-chan :landing... | |
1986035c112ee39a8a99163ff0d656831d19e927f1538ae0de8e4cbb93a83b98 | rowangithub/DOrder | zip.ml | let rec zip xs ys =
match xs with
| [] -> (match ys with
| [] -> []
| y::ys -> assert false)
| x::xs -> (match ys with
| [] -> assert false
| y::ys -> (x, y) :: (zip xs ys))
let rec zip xs ys =
match ( xs , ys ) with
| ( [ ] , [ ] ) - > [ ]
| ( x::xs , y::ys ) - > ( x , y ) : : ( zip xs ys... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/dml/zip.ml | ocaml | let rec zip xs ys =
match xs with
| [] -> (match ys with
| [] -> []
| y::ys -> assert false)
| x::xs -> (match ys with
| [] -> assert false
| y::ys -> (x, y) :: (zip xs ys))
let rec zip xs ys =
match ( xs , ys ) with
| ( [ ] , [ ] ) - > [ ]
| ( x::xs , y::ys ) - > ( x , y ) : : ( zip xs ys... | |
d01ff08699e27e23a5a37e93fa0cf1d2983a260171dae42000246263f83e5999 | quil-lang/sbcl-librarian | python-bindings.lisp | (in-package #:sbcl-librarian)
(defun python-function-definition (name result-type typed-lambda-list &key (datap t)
function-prefix
error-map
... | null | https://raw.githubusercontent.com/quil-lang/sbcl-librarian/77aef19d6a49711d5426c619887cf717d7508ff7/src/python-bindings.lisp | lisp | TODO: is this right? | (in-package #:sbcl-librarian)
(defun python-function-definition (name result-type typed-lambda-list &key (datap t)
function-prefix
error-map
... |
8e3aab7437154ee187bcd3b9d45dd59751946c743b2d99bd169cdf9ae6542600 | bpiel/guildsman | dom.cljs | (ns reagent.dom
(:require [cljsjs.react.dom]
[reagent.impl.util :as util]
[reagent.impl.template :as tmpl]
[reagent.impl.batching :as batch]
[reagent.ratom :as ratom]
[reagent.debug :refer-macros [dbg]]
[reagent.interop :refer-macros [$ $!]]))
(... | null | https://raw.githubusercontent.com/bpiel/guildsman/59c9a7459de19525cfc54112f02127e0777a00ce/resources/public/js/compiled/out/reagent/dom.cljs | clojure | (ns reagent.dom
(:require [cljsjs.react.dom]
[reagent.impl.util :as util]
[reagent.impl.template :as tmpl]
[reagent.impl.batching :as batch]
[reagent.ratom :as ratom]
[reagent.debug :refer-macros [dbg]]
[reagent.interop :refer-macros [$ $!]]))
(... | |
f06cee7e29a3acaa5ad21f7ff9afa4c03b63dbcb7618ab6aa70d3c2a2ade39c4 | mzp/coq-ide-for-ios | decl_proof_instr.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/tactics/decl_proof_instr.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
start a proof
closing gaps
mark... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : decl_proof_instr.ml... |
57135591f5056eb2808215b85718053cb7ab89970e9180a6ef9322bfe0cb5aa2 | informatica-unica/lip | letarithexpr.ml | open LetarithexprLib.Main
(* wrapping results for testing *)
type wexprval = exprval option
let string_of_wval = function
Some v -> string_of_val v
| _ -> "Error"
let weval e = try Some (eval e)
with _ -> None
let tests = [
("if true then true else false and false",Bool true);
("if true then false e... | null | https://raw.githubusercontent.com/informatica-unica/lip/f3f0ab2297943957c7dd0534895f2367097043dc/expr/letarithexpr/test/letarithexpr.ml | ocaml | wrapping results for testing
*********************************************************************
Test big-step semantics
*********************************************************************
*********************************************************************
Test small-step semantics
*************************... | open LetarithexprLib.Main
type wexprval = exprval option
let string_of_wval = function
Some v -> string_of_val v
| _ -> "Error"
let weval e = try Some (eval e)
with _ -> None
let tests = [
("if true then true else false and false",Bool true);
("if true then false else false or true",Bool false);
(... |
ed2dce04abfe7eeef34cf3aad97b8a365beb844166cd02fc2aa2b97fee9f52bd | danhper/evm-analyzer | reentrantCall.ml | open! Core
type t = {
alice: String.t;
bob: String.t;
alice_amount: BigInt.t;
bob_amount: BigInt.t;
alice_calls: Int.t;
bob_calls: Int.t;
}
let bigint_tuple_comparator = Tuple2.comparator BigInt.comparator BigInt.comparator
let get_reentrants db =
let calls = FactDb.query5 db FactDb.Relations.reentra... | null | https://raw.githubusercontent.com/danhper/evm-analyzer/9fb1cf6dc743c2f779973b2f0892047ebbd4e5fd/src/reentrantCall.ml | ocaml | open! Core
type t = {
alice: String.t;
bob: String.t;
alice_amount: BigInt.t;
bob_amount: BigInt.t;
alice_calls: Int.t;
bob_calls: Int.t;
}
let bigint_tuple_comparator = Tuple2.comparator BigInt.comparator BigInt.comparator
let get_reentrants db =
let calls = FactDb.query5 db FactDb.Relations.reentra... | |
7a85110da66b47fe0d40bfd35ec7f07e025fc9d11d9391fd1c9a70a749c350a7 | threatgrid/asami | store.cljc | (ns ^{:doc "The implements the Block storage version of a Graph/Database/Connection"
:author "Paula Gearon"}
asami.durable.store
(:require [asami.storage :as storage :refer [ConnectionType DatabaseType UpdateData]]
[asami.graph :as graph]
[asami.internal :as i :refer [now instant? lo... | null | https://raw.githubusercontent.com/threatgrid/asami/0d5d2d9276b99cc34d44388ff4373328a10aa30d/src/asami/durable/store.cljc | clojure | the tree root for the data pool,
the internal node counter
check that the database isn't empty
look for a since point by timestamp
if at or after the final timestamp, then nil
If it's at or after the time of the latest database, then return nil
multithreaded environments require exclusive writing for the graph
... | (ns ^{:doc "The implements the Block storage version of a Graph/Database/Connection"
:author "Paula Gearon"}
asami.durable.store
(:require [asami.storage :as storage :refer [ConnectionType DatabaseType UpdateData]]
[asami.graph :as graph]
[asami.internal :as i :refer [now instant? lo... |
0ab53dec224a27d5a36587b9662c0f914e196d730cf4d8de47704427a6028465 | karlhof26/gimp-scheme | alexios-photoframe_02.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Photo Frame script for GIMP 2.10.18
Original author :
;
; Tags: decor, frame
;
; Author statement:
;
; This is a rather simple script to produce a photographic frame
; around an image. This resembles a simplistic full-frame print: ... | null | https://raw.githubusercontent.com/karlhof26/gimp-scheme/dd2b42b5070d921a7c749c37181dc0461a073f05/alexios-photoframe_02.scm | scheme |
The GIMP -- an image manipulation program
Tags: decor, frame
Author statement:
This is a rather simple script to produce a photographic frame
around an image. This resembles a simplistic full-frame print: a
thin black frame outlines the photograph itself, with thicker white
borders around frame and pictur... | Copyright ( C ) 1995 and
Photo Frame script for GIMP 2.10.18
Original author :
Written on top of ( ) Fuzzy
Distributed by Gimp FX Foundry project
Revision 2.2 2020/03/06 09:04:22 karlhof26
Revision 2.1 2005/01/02 20:22:22 alexios
Fixed stupid sanity check bug that manifests in GIMP... |
a97c6df12a8eb671210a84c8e417b1f9480fadeb10d09bd04e0ba58a1408ddcf | nikivazou/liquid-meta | Narrowing.hs | module Lemmata.Narrowing where
import Syntax
import Propositions
import Environments
@ hastype : : g1 : Env - > g2 : Env - > x : Var - > sx : Type - > tx : Type - > t : Type - > e : Expr
- > Prop ( )
- > Prop ( HasType ( eAppend g1 ( EBind x ) ) e t )
- > Pro... | null | https://raw.githubusercontent.com/nikivazou/liquid-meta/c3e9f85529ab6d1135ca886bfb2808737e134f22/src/Lemmata/Narrowing.hs | haskell | module Lemmata.Narrowing where
import Syntax
import Propositions
import Environments
@ hastype : : g1 : Env - > g2 : Env - > x : Var - > sx : Type - > tx : Type - > t : Type - > e : Expr
- > Prop ( )
- > Prop ( HasType ( eAppend g1 ( EBind x ) ) e t )
- > Pro... | |
ced8c4a806ab6c2545c5d97d7391e66d07c54f1339b69350fe3d8bd8ecf2cb96 | gafiatulin/codewars | MakeAcronym.hs | -- Make acronym
--
module MakeAcronym where
import Data.Char (toUpper)
toAcronym :: String -> String
toAcronym = map (toUpper . head) . words
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/MakeAcronym.hs | haskell | Make acronym
|
module MakeAcronym where
import Data.Char (toUpper)
toAcronym :: String -> String
toAcronym = map (toUpper . head) . words
|
2b2d40cf3475e11f85c34dadc5ed5f7770a7ec298fc53e4e1a46f1ec629e7533 | RBornat/jape | cache.mli |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... | null | https://raw.githubusercontent.com/RBornat/jape/afe9f207e89e965636b43ef8fad38fd1f69737ae/distrib/camlengine/cache.mli | ocaml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... | |
4a073f2a493f70b1405adde771f9a56c9aa6c9faa4365cf5ba393f8be6d44ccc | imitator-model-checker/imitator | Options.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine ,... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/Options.ml | ocaml | **********************************************************
External modules
**********************************************************
**********************************************************
Internal modules
**********************************************************
**********************************************... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine ,... |
adca9bbb3fd75b8a446d1dbeceb0324e566f7368375e03fdd4ddb8882ec2d080 | tlehman/sicp-exercises | ex-2.19.scm | Exercise 2.19 : Consider the change - counting program of Section
; 1.2.2. It would be nice to be able to easily change the currency
; used by the program, so that we could compute the number of ways to
change a British pound , for example ( or a Bitcoin ) . As the program
; is written, the knowledge of the currenc... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-2.19.scm | scheme | 1.2.2. It would be nice to be able to easily change the currency
used by the program, so that we could compute the number of ways to
is written, the knowledge of the currency is distributed partly into
to be used for making change.
list of values of the coins to use rather than an integer specifying
which coins ... | Exercise 2.19 : Consider the change - counting program of Section
change a British pound , for example ( or a Bitcoin ) . As the program
the procedure count - change ( which knows that there are five kinds of
U.S. coins ) . It would be nicer to be able to supply a list of coins
We want to rewrite the procedur... |
c25c8377dd66f072edf5949b7a629e5a6e5501a77a04cbb5e15b3b0a549a9377 | clash-lang/clash-compiler | Reset.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeInType #-}
# OPTIONS_GHC -Wno - orphans #
module Clash.Tests.Reset where
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.TH
import Clash.Explicit.Prelude
-- Testing with explicit declaration of the Low... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/7734a872bf48fc329e51eae33a68c59bb1d900ab/clash-prelude/tests/Clash/Tests/Reset.hs | haskell | # LANGUAGE TypeInType #
Testing with explicit declaration of the Low type alias
| Same as 'case_onePeriodGlitch' but on a domain with active low resets | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - orphans #
module Clash.Tests.Reset where
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.TH
import Clash.Explicit.Prelude
type Low = ("Low" :: Domain)
createDomain vSystem{vName="Low", vResetPolari... |
98a6680710b30fd752681823ebe394fdd3274de75212c8d212f46db392dd9d61 | ocamllabs/ocaml-modular-implicits | t170-envacc2.ml | open Lib;;
let x = 5 in
let y = 2 in
let f _ = ignore x; y in
if f 0 <> 2 then raise Not_found
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 16
11 ENVACC1
12 CONST0
13 ENVACC2
14 RETURN 1
16 CONSTINT 5
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t170-envacc2.ml | ocaml | open Lib;;
let x = 5 in
let y = 2 in
let f _ = ignore x; y in
if f 0 <> 2 then raise Not_found
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 16
11 ENVACC1
12 CONST0
13 ENVACC2
14 RETURN 1
16 CONSTINT 5
... | |
27cdd4ec239759b2cbf9bfa38a62cbf87741d97cf4a8a064abc17063d8d1018f | cruxlang/crux | Project.hs | {-# LANGUAGE ScopedTypeVariables, TupleSections #-}
module Crux.Project
( runJS
, runJSWithResult
, ProjectOptions(..)
, buildProject
, buildProjectAndRunTests
, createProjectTemplate
) where
import qualified Crux.Error as Error
import qualified Crux.Gen as Gen
import qualified Crux.JSBack... | null | https://raw.githubusercontent.com/cruxlang/crux/883f642d15fb85ce17d9c485ee91158d9e826a2f/Crux/Project.hs | haskell | # LANGUAGE ScopedTypeVariables, TupleSections #
Prints stdout and stderr, returns Left exitCode on failure, Right () on success.
TODO: just inherit stdout and stderr
TODO: actually track this
liftIO $ putStrLn $ "buildTarget: " <> show tcSourceDir <> " " <> show tcMainModule
TODO: should we track outputs in TrackI... |
module Crux.Project
( runJS
, runJSWithResult
, ProjectOptions(..)
, buildProject
, buildProjectAndRunTests
, createProjectTemplate
) where
import qualified Crux.Error as Error
import qualified Crux.Gen as Gen
import qualified Crux.JSBackend as JSBackend
import Crux.Module
import Crux.Prel... |
f0e49737e4c46d68f445296f06a9b0ecc03b2324f50c65717eff690703506d8e | haskell-servant/servant | ClientSpec.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
module Servant.Auth.ClientSpec (spec) where
import Crypto.JOSE (JWK,
KeyMaterialGenParam (OctGenParam),
genJWK)
import Data.Aeson ... | null | https://raw.githubusercontent.com/haskell-servant/servant/bd9e4b10900d04bb5a24bcbb8ab2f7246fcd15c7/servant-auth/servant-auth-client/test/Servant/Auth/ClientSpec.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveAnyClass #
----------------------------------------------------------------------------
}}}
----------------------------------------------------------------------------
* API and Server {{{
}}}
----------------------------------------------------------------------------
... | module Servant.Auth.ClientSpec (spec) where
import Crypto.JOSE (JWK,
KeyMaterialGenParam (OctGenParam),
genJWK)
import Data.Aeson (FromJSON (..), ToJSON (..))
import qualified Data.ByteS... |
61b239a3adaa69ffa27b0d08155019763f96304a0ee34674dabdd4b8f9f5448b | herd/herdtools7 | filesystem_test.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/internal/lib/tests/filesystem_test.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
f4aa6a6242403f7fb4e52c509effb5a4befeabfd5aa41bf8af2669aba293ab20 | ocaml/ocaml-re | posix.ml |
RE - A regular expression library
Copyright ( C ) 2001
email :
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 , with
linking exception ; either version ... | null | https://raw.githubusercontent.com/ocaml/ocaml-re/09c2745a2d8d1517b3d597396e82e122903b0017/lib/posix.ml | ocaml | XXX |
RE - A regular expression library
Copyright ( C ) 2001
email :
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 , with
linking exception ; either version ... |
a2aa8ecb5fc515a285ebc4d1404332bc8b878ff00c5360c221f11e989b879aec | zkincaid/srk | interpretation.mli | open Syntax
exception Divide_by_zero
type 'a value = [`Real of QQ.t | `Bool of bool | `Fun of ('a, typ_fo) expr ]
* An interpretation is a mapping from symbols to values . Interpretations
are a collection of concrete bindings ( explicit ( symbol , value ) pairs )
combined with an optional abstract bind... | null | https://raw.githubusercontent.com/zkincaid/srk/4809f2b697c02d9e020e4de2c0b11ff4a0c59f7f/src/interpretation.mli | ocaml | * Wrap a function mapping symbols to values in an interpretation. Calls to
this function are cached. Symbols belonging to the optional symbol list
argument are pre-cached.
* Enumerate the concrete bindings in an interpretation.
* Replace constant symbols by their interpretations within an expression. A
... | open Syntax
exception Divide_by_zero
type 'a value = [`Real of QQ.t | `Bool of bool | `Fun of ('a, typ_fo) expr ]
* An interpretation is a mapping from symbols to values . Interpretations
are a collection of concrete bindings ( explicit ( symbol , value ) pairs )
combined with an optional abstract bind... |
c1d7689c6e09e05977ce1d2c49c3de89618dcba464e519beda798124945948fb | racket/games | slidey-main.rkt | #lang racket
(require "slidey.rkt")
(provide game@)
(define game@ (unit (import) (export) (start-game)))
| null | https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/slidey/slidey-main.rkt | racket | #lang racket
(require "slidey.rkt")
(provide game@)
(define game@ (unit (import) (export) (start-game)))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.