_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
3b95734944b3a89d2f0ca48b22f01d48f44c60fa3691c57f6b0b7071031b8b80
teamwalnut/graphql-ppx
graphql_ppx_runtime.ml
let assign_typename : Js.Json.t -> string -> Js.Json.t = [%raw {| (obj, typename) => { obj.__typename = typename; return obj } |}] [%%private let clone = (fun a -> Obj.magic (Js.Obj.assign (Obj.magic (Js.Obj.empty ())) (Obj.magic a)) : 'a Js.Dict.t -> 'a Js.Dict.t)] let rec deepMerge (json1 : Js.Json.t) ...
null
https://raw.githubusercontent.com/teamwalnut/graphql-ppx/538560ebde64870f88a3c620d03b4af11da82263/rescript-runtime/graphql_ppx_runtime.ml
ocaml
let assign_typename : Js.Json.t -> string -> Js.Json.t = [%raw {| (obj, typename) => { obj.__typename = typename; return obj } |}] [%%private let clone = (fun a -> Obj.magic (Js.Obj.assign (Obj.magic (Js.Obj.empty ())) (Obj.magic a)) : 'a Js.Dict.t -> 'a Js.Dict.t)] let rec deepMerge (json1 : Js.Json.t) ...
ce535416c1ac2f975a97ad9ad009498ab96ef9a6e7cd42d87843bee2a4db9bec
2600hz/kazoo
ts_callflow.erl
%%%----------------------------------------------------------------------------- ( C ) 2011 - 2020 , 2600Hz %%% @doc Common functionality for onnet and offnet call handling @author %%% This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distribu...
null
https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/applications/trunkstore/src/ts_callflow.erl
erlang
----------------------------------------------------------------------------- @doc Common functionality for onnet and offnet call handling @end ----------------------------------------------------------------------------- data access functions send failure code to Call --------------------------------------------...
( C ) 2011 - 2020 , 2600Hz @author This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. -module(ts_callflow). -export([init/2 ,start_amqp/2 ,cleanup_amqp/1 ,send_par...
a474ec0e9f64609ec2a07a2aa0fd478f9366d200ea3eb3199110c42b618ddb1b
ivarref/double-trouble
readme_md.clj
(ns com.github.ivarref.readme-md) (require '[com.github.ivarref.double-trouble :as dt]) (require '[datomic.api :as d]) (def conn (let [uri (str "datomic:mem-example")] (d/delete-database uri) (d/create-database uri) (d/connect uri))) ; Setup: @(d/transact conn dt/schema) (def exa...
null
https://raw.githubusercontent.com/ivarref/double-trouble/a715f55a077d59d7acc1437a3255ddae663a19e4/test/com/github/ivarref/readme_md.clj
clojure
Setup: Add sample data: Sample payload: Initial commit using :dt/cas is fine: => {:db-before datomic.db.Db@a108c315 :db-after datomic.db.Db@260c18eb :transacted? true} Notice the key :transacted? with value true => {:db-before datomic.db.Db@d06fccb2 :db-after datomic.db.Db@d06fccb1 :transacte...
(ns com.github.ivarref.readme-md) (require '[com.github.ivarref.double-trouble :as dt]) (require '[datomic.api :as d]) (def conn (let [uri (str "datomic:mem-example")] (d/delete-database uri) (d/create-database uri) (d/connect uri))) @(d/transact conn dt/schema) (def example-sche...
2c51e8add719e426547f293a9f7374e54d02c65f469511cd28627e095f6affb5
input-output-hk/qeditas
ctregraft.ml
Copyright ( c ) 2015 The Qeditas developers Distributed under the MIT software license , see the accompanying file COPYING or -license.php . file COPYING or -license.php. *) open Ser open Hash open Assets open Tx open Ctre type cgraft = (hashval * ctree) list let rec cgraft_valid g = match g with | [...
null
https://raw.githubusercontent.com/input-output-hk/qeditas/f4871bd20833cd08a215f9d5fc9df2d362cba410/src/ctregraft.ml
ocaml
** leave this implicit ** ** At this point we are necessarily at a leaf. However, if the full hlist is not here, then it will not be fully supported. Not checking since we assume c supported before calling this. **
Copyright ( c ) 2015 The Qeditas developers Distributed under the MIT software license , see the accompanying file COPYING or -license.php . file COPYING or -license.php. *) open Ser open Hash open Assets open Tx open Ctre type cgraft = (hashval * ctree) list let rec cgraft_valid g = match g with | [...
f9571a413cb8f41bfd5946869dd75a6da3432aa686c745d7a79455e69fa32cf3
aeolus-project/zephyrus
data_common_linked_list.mli
(****************************************************************************) (* *) This file is part of Zephyrus . (* *) Z...
null
https://raw.githubusercontent.com/aeolus-project/zephyrus/0b52de4038bbab724e6a9628430165a7f09f77ae/src/datatypes/common/data_common_linked_list.mli
ocaml
************************************************************************** (at your option) any later version. ...
This file is part of Zephyrus . Zephyrus 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 Zephyru...
eed692a955409ade41483e2bdc1d20034cd10598feb83798e84df096fcc70578
ghcjs/ghcjs-dom
DataCue.hs
# LANGUAGE PatternSynonyms # # LANGUAGE ForeignFunctionInterface # # LANGUAGE JavaScriptFFI # -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} module GHCJS.DOM.JSFFI.Generated.DataCue (js_newDataCue, newDataCue, js_newDataCue', newDataCue', js_setData, se...
null
https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/DataCue.hs
haskell
For HasCallStack compatibility # LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | <-US/docs/Web/API/WebKitDataCue Mozilla WebKitDataCue documentation> | <-US/docs/Web/API/WebKitDataCue Mozilla WebKitDataCue documentation> | <-US/docs/Web/API/WebKitDataCue.data Mozilla WebKitDataCue.data documentation>...
# LANGUAGE PatternSynonyms # # LANGUAGE ForeignFunctionInterface # # LANGUAGE JavaScriptFFI # module GHCJS.DOM.JSFFI.Generated.DataCue (js_newDataCue, newDataCue, js_newDataCue', newDataCue', js_setData, setData, js_getData, getData, js_setValue, setValue, js_getValue, getValue, js_getType, getTy...
6801403732a2c05556fd43607ef9f0aaf825dcbf6d8c2aa36dd03d4c45ab6f63
GaloisInc/saw-script
Panic.hs
# LANGUAGE Trustworthy # # LANGUAGE TemplateHaskell # module Verifier.SAW.Simulator.What4.Panic ( panic ) where import Panic hiding (panic) import qualified Panic data SAWCoreWhat4 = SAWCoreWhat4 panic :: HasCallStack => String -> [String] -> a panic = Panic.panic SAWCoreWhat4 instance PanicComponent SAWCoreWh...
null
https://raw.githubusercontent.com/GaloisInc/saw-script/fdb8987f09999439833d5cb573f69197bdf2cb7f/saw-core-what4/src/Verifier/SAW/Simulator/What4/Panic.hs
haskell
# LANGUAGE Trustworthy # # LANGUAGE TemplateHaskell # module Verifier.SAW.Simulator.What4.Panic ( panic ) where import Panic hiding (panic) import qualified Panic data SAWCoreWhat4 = SAWCoreWhat4 panic :: HasCallStack => String -> [String] -> a panic = Panic.panic SAWCoreWhat4 instance PanicComponent SAWCoreWh...
0ff80a7e89293ea8c50c4127f8a357a2ee4d32d81e59434ff79dd028ec354b14
mokus0/junkbox
FreeTriangularMesh.hs
module Math.FreeTriangularMesh where import Math.Angle import Data.Map import Data.Vector data Pt = Pt { x, y :: !Double } deriving (Eq, Show) data Basis = Basis { e0, e1 :: !Pt } deriving (Eq, Show) data Triangle = Triangle !Pt !Pt !Pt deriving (Eq, Show) data EdgeID = EdgeID { triangleId :...
null
https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Math/FreeTriangularMesh.hs
haskell
every triangle has its own internal geometry. There is no global geometry except whatever arises from the triangles and the way they connect. if there is a link, it is a reference to another triangle edge and a flag indicating whether orientation is reversed. A turtle has a location and velocity, as well as a wor...
module Math.FreeTriangularMesh where import Math.Angle import Data.Map import Data.Vector data Pt = Pt { x, y :: !Double } deriving (Eq, Show) data Basis = Basis { e0, e1 :: !Pt } deriving (Eq, Show) data Triangle = Triangle !Pt !Pt !Pt deriving (Eq, Show) data EdgeID = EdgeID { triangleId :...
69ad59c9aeb6f26da869693e90f2e926c9929856995b3de84335b419c332b182
tezos/tezos-mirror
sc_rollup_client.mli
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2021 Nomadic Labs < > Copyright ( c ) 2023 ...
null
https://raw.githubusercontent.com/tezos/tezos-mirror/e5ca6c3e274939f1206426962aa4c02e1a1d5319/tezt/lib_tezos/sc_rollup_client.mli
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2021 Nomadic Labs < > Copyright ( c ) 2023 TriliTech < > 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 " , WITHOU...
38c3b463caf49f72d6f19d63f4271ed7190572d7ea39f8714ae6fe5b6500a032
dada-lang/dada-model
grammar.rkt
#lang racket (require redex data/order "util.rkt") (provide (all-defined-out)) (define-language dada (program ((named-class-definition ...) (named-method-definition ...))) (named-class-definition (c class-definition)) (class-definition (class generic-decls class-field-decls)) (named-method-definition (m method...
null
https://raw.githubusercontent.com/dada-lang/dada-model/8978cd0346480686005e971a8d6e83ced65af265/racket/grammar.rkt
racket
local variable generic parameter name (of any kind: type/lease) method name field name class name Useful metafunction to assert that something is true -- if it is false, you'll get an error. defined? any True for all values. Useful for testing whether a metafunction like `place-ty` can successfully execute ...
#lang racket (require redex data/order "util.rkt") (provide (all-defined-out)) (define-language dada (program ((named-class-definition ...) (named-method-definition ...))) (named-class-definition (c class-definition)) (class-definition (class generic-decls class-field-decls)) (named-method-definition (m method...
7e456db04e45fe586786384f73ce10656d2588d8448a8dbdf63e809ee51c12f9
riverford/objection
util.cljc
(ns objection.util #?(:clj (:import (clojure.lang IDeref)))) #?(:clj (deftype IdentityBox [x] IDeref (deref [this] x) Object (equals [this o] (and (instance? IdentityBox o) (identical? x (.-x ^IdentityBox o)))) (hashCode [this] (System/identityHashCode nil))) :cljs ...
null
https://raw.githubusercontent.com/riverford/objection/d803f9b1a259c3d39f44327d7c3a3c00f30f8621/src/objection/util.cljc
clojure
(ns objection.util #?(:clj (:import (clojure.lang IDeref)))) #?(:clj (deftype IdentityBox [x] IDeref (deref [this] x) Object (equals [this o] (and (instance? IdentityBox o) (identical? x (.-x ^IdentityBox o)))) (hashCode [this] (System/identityHashCode nil))) :cljs ...
0767cdfbe300557153dfd8e4fd561906f763e66102a573f09e084940d3891035
tomfaulhaber/autodoc
contrib.clj
(import (java.io File)) (defn ! [& args] (let [args (into {} (map vec (partition 2 args))) project (:project args) file-prefix (.getAbsolutePath (File. (str "../autodoc-work-area/" project))) root (str file-prefix "/src/")] [(:project args) (merge {:file-prefix file-prefix, ...
null
https://raw.githubusercontent.com/tomfaulhaber/autodoc/56fbcd80fc7e0bb292c44722c16b76261af43239/params/contrib.clj
clojure
(! :project "test.benchmark" :name "Benchmark suite")
(import (java.io File)) (defn ! [& args] (let [args (into {} (map vec (partition 2 args))) project (:project args) file-prefix (.getAbsolutePath (File. (str "../autodoc-work-area/" project))) root (str file-prefix "/src/")] [(:project args) (merge {:file-prefix file-prefix, ...
9a9a1228ef3ea773075a2b2478c04873b104c47f73d58eb35a1ec25b5b1acfa0
camlp5/camlp5
eg_quotations.ml
(* camlp5o *) (* eg_sexp.ml,v *) Copyright ( c ) INRIA 2007 - 2017 open Fmt ;; let loc = Ploc.dummy ;; let one = <:expr< 1 >> ;; let nil = <:sexp< () >> ;; let rec pp pps = function <:sexp< () >> -> Fmt.(pf pps "()") | <:sexp< ( $exp:a$ . $exp:b$ ) >> -> Fmt.(pf pps "(%a . %a)" pp a pp b) | <:sexp< $atom:a...
null
https://raw.githubusercontent.com/camlp5/camlp5/15e03f56f55b2856dafe7dd3ca232799069f5dda/tutorials/eg_sexp_example/eg_quotations.ml
ocaml
camlp5o eg_sexp.ml,v
Copyright ( c ) INRIA 2007 - 2017 open Fmt ;; let loc = Ploc.dummy ;; let one = <:expr< 1 >> ;; let nil = <:sexp< () >> ;; let rec pp pps = function <:sexp< () >> -> Fmt.(pf pps "()") | <:sexp< ( $exp:a$ . $exp:b$ ) >> -> Fmt.(pf pps "(%a . %a)" pp a pp b) | <:sexp< $atom:a$ >> -> Fmt.(pf pps "%a" string a...
43556864efcc72609f0370c2d8fdd499ff816b9fa631882e9ac2e4d965929a31
contentjon/chai-latte
add.cljs
(ns latte.add (:require [kit.core :as kit])) (def chai (if (kit/module-system?) (js/require "chai") js/chai)) (def assertions (aget chai "Assertion")) (defn method [k & args] (let [args (apply hash-map args) assertion (:assertion args (constantly false)) expected (:expected args (...
null
https://raw.githubusercontent.com/contentjon/chai-latte/aff304ae397ceea72513d3da4812b2bd20ca11ac/src/latte/add.cljs
clojure
(ns latte.add (:require [kit.core :as kit])) (def chai (if (kit/module-system?) (js/require "chai") js/chai)) (def assertions (aget chai "Assertion")) (defn method [k & args] (let [args (apply hash-map args) assertion (:assertion args (constantly false)) expected (:expected args (...
56a25324bbf5f6292295d928c1504eef516bcaa0bb07d0e8b94f5aba2b7057ac
potapenko/playphraseme-site
core.clj
(ns playphraseme.core (:gen-class) (:require [cider.nrepl :refer [cider-nrepl-handler]] [clojure.tools.cli :refer [parse-opts]] [clojure.tools.logging :as log] [luminus.http-server :as http] [luminus.repl-server :as repl] [mount.core :as mount] ...
null
https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/core.clj
clojure
(ns playphraseme.core (:gen-class) (:require [cider.nrepl :refer [cider-nrepl-handler]] [clojure.tools.cli :refer [parse-opts]] [clojure.tools.logging :as log] [luminus.http-server :as http] [luminus.repl-server :as repl] [mount.core :as mount] ...
d6d23132dd0d4246c411a568612dd9e128f1a5fef8c956a6344bf407dbcb501d
macourtney/Conjure
application.clj
(ns views.layouts.application (:use conjure.view.base) (:require [com.reasonr.scriptjure :as scriptjure] [views.layouts.templates.breadcrumbs :as breadcrumbs] [views.layouts.templates.header :as header] [views.layouts.templates.links-sidebar :as links-sidebar] [views....
null
https://raw.githubusercontent.com/macourtney/Conjure/1d6cb22d321ea75af3a6abe2a5bc140ad36e20d1/conjure_scaffold/test/views/layouts/application.clj
clojure
Main Header Main menu (tabs) Example RSS feeds --> [:p { :id "rss" } [:strong "RSS:"] [:a { :href "#" } "articles"] " / " [:a { :href "#" } "comments"]] [:hr { :class "noscreen" }] Breadcrumbs Example Article: [:div { :class "article" } [:h2 [:span [:a { :href "#" } "This is my best article"]]] [:p class="inf...
(ns views.layouts.application (:use conjure.view.base) (:require [com.reasonr.scriptjure :as scriptjure] [views.layouts.templates.breadcrumbs :as breadcrumbs] [views.layouts.templates.header :as header] [views.layouts.templates.links-sidebar :as links-sidebar] [views....
b2f4dee012f195131b16ac751afeed3b7ece1e331d79d0d61b64cde435f55fe2
Pistos/gimp-outline-text
pistos-outline-text.scm
(script-fu-register "script-fu-outline-text" "Outline Text" ;menu label "Outlines text with a feathered outline using the current background colour. Version 1.2.0" ;description "Pistos" ;author "Copyright 2016-2020, Pistos" ;copyright notic...
null
https://raw.githubusercontent.com/Pistos/gimp-outline-text/e07382f205962858b3b87026861dc48b48f1e173/pistos-outline-text.scm
scheme
menu label description author copyright notice date created image type that the script works on "Input image" "Input layer" "Size of outline (in pixels):" "Opacity of new layer (in percent):" separate window
(script-fu-register "script-fu-outline-text" ) (script-fu-menu-register "script-fu-outline-text" "<Image>/Filters/Light and Shadow") (define (script-fu-outline-text image layer outlineSize layerOpacity) (gimp-progress-init (string-append "Outlining text on layer '" (car (gimp-item-get-name layer))...
90e768e3b894caedafdb2c940963989a70a04e76949f1d014e096224eb42a182
input-output-hk/marlowe-cardano
Sofr.hs
# LANGUAGE DataKinds # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # # LANGUAGE TypeOperators # module Network.Oracle.Sofr ( ReferenceRate(..) , ReferenceRates(..) , SofrApi , fetchSofrBasisPoints , getReferenceRates , getSofrBasisPoints , nyfrbEnv , sofrApi ) where import Data...
null
https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/3c65414ea55ac58d12ea974fa40c4f0deb4cc0a6/marlowe-apps/oracle/Network/Oracle/Sofr.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE DataKinds # # LANGUAGE RecordWildCards # # LANGUAGE TypeOperators # module Network.Oracle.Sofr ( ReferenceRate(..) , ReferenceRates(..) , SofrApi , fetchSofrBasisPoints , getReferenceRates , getSofrBasisPoints , nyfrbEnv , sofrApi ) where import Data.Aeson (FromJSON(parseJSON), withOb...
8743ac32784cb1c6ef71b6f88c678b1022ca25401849f0e1fdc6f2a89b7c5a21
janestreet/core
fn.mli
open! Import include module type of struct include Base.Fn end include module type of struct include Deprecate_pipe_bang end
null
https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/fn.mli
ocaml
open! Import include module type of struct include Base.Fn end include module type of struct include Deprecate_pipe_bang end
ed8ab2053ea5ec195a17e428df11c7389d6f49b5e574cb8de16ff039c156dbd4
esl/MongooseIM
mod_mam_utils.erl
%%%------------------------------------------------------------------- @author Michael < > ( C ) 2013 , Uvarov Michael @doc General functions for MAM . %%% @end %%%------------------------------------------------------------------- -module(mod_mam_utils). Time -export([maybe_microseconds/1]). UID -export(...
null
https://raw.githubusercontent.com/esl/MongooseIM/f39a88637c8ce8420dbd0ae58f6c9ec8df077c29/src/mam/mod_mam_utils.erl
erlang
------------------------------------------------------------------- @end ------------------------------------------------------------------- XML Forms Text search Other Ejabberd Shared logic -define(MAM_INLINE_UTILS, true). ---------------------------------------------------------------------- Datetime types ...
@author Michael < > ( C ) 2013 , Uvarov Michael @doc General functions for MAM . -module(mod_mam_utils). Time -export([maybe_microseconds/1]). UID -export([get_or_generate_mam_id/1, generate_message_id/1, encode_compact_uuid/2, decode_compact_uuid/1, mess_id_to_external...
b70d5b5ad0a22576c53a0eebc971de1ac41a5a87d0221e8aba75e8d9f278bf8c
ldnclj/Coloured-Balls
tasks.clj
(use 'cake 'cake.core '[cake.project :only [reload!]] '[bake.find-namespaces :only [find-namespaces-in-dir]]) (import '[java.io File]) (deftask midje "Run midje and clojure.test tests" (bake (:use [bake.core :only [with-context]]) (:require [clojure test string]) [namespaces (concat (find-namespaces-in...
null
https://raw.githubusercontent.com/ldnclj/Coloured-Balls/065eaab19c1b00a17bdc66e4c515f73a7bccd19a/tasks.clj
clojure
This turns off "Testing ...." lines, which I hate, especially when there's no failure output. Stashed clojure.test output
(use 'cake 'cake.core '[cake.project :only [reload!]] '[bake.find-namespaces :only [find-namespaces-in-dir]]) (import '[java.io File]) (deftask midje "Run midje and clojure.test tests" (bake (:use [bake.core :only [with-context]]) (:require [clojure test string]) [namespaces (concat (find-namespaces-in...
65e5dfefb1d4090a49f25d6beb074de088bbf3b509059783a6b0023d136cefdf
tensorflow/haskell
MiscTest.hs
Copyright 2016 TensorFlow authors . -- Licensed under the Apache License , Version 2.0 ( the " License " ) ; -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- -2.0 -- -- Unless required by applicable law or agreed to in writing, software distr...
null
https://raw.githubusercontent.com/tensorflow/haskell/d088e30b80f1508281e400975bec9d14b431a22c/tensorflow-ops/tests/MiscTest.hs
haskell
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing perm...
Copyright 2016 TensorFlow authors . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , # LANGUAGE OverloadedLists # module Main where import Control.Monad.IO.Class (liftIO) import Data.Int (Int32) import Test.Framework (def...
96f484fe91d33a276d4b7c7c2d8ee6dacdb5129f450b47ca9b814eede4d92e62
uw-unsat/serval
arithmetic-immediate.rkt
#lang racket/base (require "lib.rkt") (define tests (test-suite+ "Arithmetic (immediate)" (arm64-case* [choose-sf choose-sh choose-imm12 choose-reg choose-reg] add-immediate adds-immediate sub-immediate subs-immediate) )) (module+ test (time (run-tests tests)))
null
https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/test/arm64/arithmetic-immediate.rkt
racket
#lang racket/base (require "lib.rkt") (define tests (test-suite+ "Arithmetic (immediate)" (arm64-case* [choose-sf choose-sh choose-imm12 choose-reg choose-reg] add-immediate adds-immediate sub-immediate subs-immediate) )) (module+ test (time (run-tests tests)))
6abfd1a2924627414c2d74ebc09eef371246f25a2d621f19526d28a8f15f0419
binaryage/cljs-oops
spec.clj
(ns oops.spec "Some helper utils for clojure.spec.") clojurescript related question , I ’m working on a library which uses clojure.spec to describe a data structure using ` s/ * ` , the data structure can be used statically during compilation in macros , or during runtime in cljs . ; all is nice and shiny on clj...
null
https://raw.githubusercontent.com/binaryage/cljs-oops/a2b48d59047c28decb0d6334e2debbf21848e29c/src/lib/oops/spec.clj
clojure
all is nice and shiny on clj side[1], but on cljs side, I want native js arrays to be treated as collections f to walk native js arrays the same way as cljs vectors.
(ns oops.spec "Some helper utils for clojure.spec.") clojurescript related question , I ’m working on a library which uses clojure.spec to describe a data structure using ` s/ * ` , the data structure can be used statically during compilation in macros , or during runtime in cljs . or the purpose of speccing ,...
50391e9e07a254ac5f76a7d940d617e20950e5138078e1960fb7152dd5f6d245
artyom-poptsov/guile-deck
state.scm
(use-modules (srfi srfi-64) (srfi srfi-26) (oop goops) (deck core types state) (deck core types matrix-id)) (test-begin "state") (test-equal "alist->state" (make <state> #:account-data 1 #:device-lists 2 #:device-one-time-...
null
https://raw.githubusercontent.com/artyom-poptsov/guile-deck/d0e535541c00ef1ebfef4c8429df572423331e12/tests/state.scm
scheme
(use-modules (srfi srfi-64) (srfi srfi-26) (oop goops) (deck core types state) (deck core types matrix-id)) (test-begin "state") (test-equal "alist->state" (make <state> #:account-data 1 #:device-lists 2 #:device-one-time-...
bc7a739f92a60648fa95c1ee965da1e41002fb22fa981b3558193b223768cca4
open-company/open-company-web
add_comment.cljs
(ns oc.web.components.ui.add-comment (:require [rum.core :as rum] [dommy.core :refer-macros (sel1)] [cuerdas.core :as string] [org.martinklepsch.derivatives :as drv] [oc.web.dispatcher :as dis] [oc.web.lib.utils :as utils] [oc.web.utils.ui :as uu...
null
https://raw.githubusercontent.com/open-company/open-company-web/0aede9fcb8e5ebeaf3a1b896e4995e9b0514c70c/src/main/oc/web/components/ui/add_comment.cljs
clojure
Add commnet handling (defn- fix-selection [s] (let [el (add-comment-field s) sel (dom-utils/textarea-save-selection)] (= (.-anchorTarget sel) el) (au/empty-body? (.-innerHTML el))) (.removeAllRanges sel) (when (and @(::collapsed s) ua/safari?) ( utils /...
(ns oc.web.components.ui.add-comment (:require [rum.core :as rum] [dommy.core :refer-macros (sel1)] [cuerdas.core :as string] [org.martinklepsch.derivatives :as drv] [oc.web.dispatcher :as dis] [oc.web.lib.utils :as utils] [oc.web.utils.ui :as uu...
4c120a24dbe32f88d5e767609f8a861e53991afb23eac829a7450c68f5325f8e
williamleferrand/accretio
ys_log.ml
* Accretio is an API , a sandbox and a runtime for social playbooks * * Copyright ( C ) 2015 * * 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 o...
null
https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/client/ys_log.ml
ocaml
* Accretio is an API , a sandbox and a runtime for social playbooks * * Copyright ( C ) 2015 * * 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 o...
476442a296c06123147cb54ef2ce10d70509d75ab83cfdd36844b27065502e83
bobzhang/ocaml-book
tcpdump.ml
./tcpdump test.pcap * libpcap endianness is determined at runtime . ./tcpdump test.pcap * libpcap endianness is determined at runtime. *) open Printf (* Determine the endianness (at runtime) from the magic number. *) let endian_of = function | 0xa1b2c3d4_l -> Bitstring.BigEndian | 0xd4c3b2a1...
null
https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/library/code/bitstring/tcpdump.ml
ocaml
Determine the endianness (at runtime) from the magic number. magic number version timezone correction (secs) always 0 apparently data link layer type let libpcap_packet e file_header bits = bitmatch bits with pkt_data : Int32.to_int incl_len*8 : bitstring; rest : -1 : bitstring } -> ...
./tcpdump test.pcap * libpcap endianness is determined at runtime . ./tcpdump test.pcap * libpcap endianness is determined at runtime. *) open Printf let endian_of = function | 0xa1b2c3d4_l -> Bitstring.BigEndian | 0xd4c3b2a1_l -> Bitstring.LittleEndian | _ -> assert false let libpcap_...
3e376ebb3ee0bd0eb2ad432fef521c7126b042fb18a72139f81e5d2586a0b97f
Frama-C/Frama-C-snapshot
add_global.ml
open Cil_types let emitter = Emitter.create "Fancy" [ Emitter.Global_annot ] ~correctness:[] ~tuning:[] class vis prj = object(self) inherit Visitor.frama_c_copy prj method! vglob_aux g = match g with | GFun ({ svar = { vname = "main" }},_) -> let ax = Daxiomatic ("MyAxiomatic"...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/tests/spec/add_global.ml
ocaml
open Cil_types let emitter = Emitter.create "Fancy" [ Emitter.Global_annot ] ~correctness:[] ~tuning:[] class vis prj = object(self) inherit Visitor.frama_c_copy prj method! vglob_aux g = match g with | GFun ({ svar = { vname = "main" }},_) -> let ax = Daxiomatic ("MyAxiomatic"...
4df6a5aa692d5aab9d7aa17bc2fa26c42982e77b5162fcb5699e0d1b216f7ab9
fpco/ide-backend
GhcShim78.hs
# LANGUAGE TypeSynonymInstances , FlexibleInstances , ScopedTypeVariables , StandaloneDeriving , MultiParamTypeClasses , GADTs # # OPTIONS_GHC -fno - warn - unused - do - bind -fno - warn - orphans # module GhcShim.GhcShim78 ( -- * Pretty-printing showSDoc , pretty , prettyM , prettyType , prettyTypeM ...
null
https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend-server/GhcShim/GhcShim78.hs
haskell
* Pretty-printing * Errors * Time * Setup * Folding * Operations on types * Re-exports ----------------------------------------------------------------------------- Pretty-printing ----------------------------------------------------------------------------- ----------------------------------------------------...
# LANGUAGE TypeSynonymInstances , FlexibleInstances , ScopedTypeVariables , StandaloneDeriving , MultiParamTypeClasses , GADTs # # OPTIONS_GHC -fno - warn - unused - do - bind -fno - warn - orphans # module GhcShim.GhcShim78 showSDoc , pretty , prettyM , prettyType , prettyTypeM , sourceErrorSpan * ,...
90160eb5fd246e8a787da1e323ceea3a24bdd341a24933af7b186688ab3e7e34
ndmitchell/shake
Network.hs
# LANGUAGE CPP # -- | The network operations available module Development.Shake.Internal.History.Network( Conn, connect, post ) where #ifdef NETWORK import Network.HTTP import Network.URI import Data.List import Data.Maybe #endif import qualified Data.ByteString.Lazy as LBS newtype Conn = Conn String conn...
null
https://raw.githubusercontent.com/ndmitchell/shake/99c5a7a4dc1d5a069b13ed5c1bc8e4bc7f13f4a6/src/Development/Shake/Internal/History/Network.hs
haskell
| The network operations available
# LANGUAGE CPP # module Development.Shake.Internal.History.Network( Conn, connect, post ) where #ifdef NETWORK import Network.HTTP import Network.URI import Data.List import Data.Maybe #endif import qualified Data.ByteString.Lazy as LBS newtype Conn = Conn String connect :: String -> Maybe (IO Conn) post ...
985b41bd4b8ab59716538ecd76c078611c93baac18a5f6c5eee73d8731168448
casperschipper/ocaml-cisp
cisp6.ml
open Cisp open Midi open Seq (* this maps midi input msg to an output msg (raw midi) *) let midiInputTestFun input = (* this translates input into boolean trigger *) let secs s = s * 44100 in let inputTrigger = map (fun midiMsg -> match midiMsg with NoteOn (_, _, _) -> true | _ -> false) ...
null
https://raw.githubusercontent.com/casperschipper/ocaml-cisp/954e4b71dca0d0af0786395d727b7a7cde5568a7/examples/cisp_backup/basic/cisp6.ml
ocaml
this maps midi input msg to an output msg (raw midi) this translates input into boolean trigger a metre boolean mask that triggers notes or rests in the pattern dummy event apply metre to default event, use Silence as filler the sq state var Slightly troublesome, this looks like a pure function (a -> b) bu...
open Cisp open Midi open Seq let midiInputTestFun input = let secs s = s * 44100 in let inputTrigger = map (fun midiMsg -> match midiMsg with NoteOn (_, _, _) -> true | _ -> false) input in let pitchPattern = boundedWalk 40 (transpose ([st 2; ch [|2; 2; 2; 2; 2; 1|]; st 14] |>...
a93febf60af89a251b692eeea7d0444c14fb551fb63bed3d39c5f8af3802d687
tomfaulhaber/cl-format
base.clj
Copyright ( c ) , Dec 2008 . All rights reserved . ; The use and distribution terms for this software are covered by the ; Eclipse Public License 1.0 (-1.0.php) ; which can be found in the file epl-v10.html at the root of this distribution. ; By using this software in any fashion, you are agreeing to be b...
null
https://raw.githubusercontent.com/tomfaulhaber/cl-format/5b8d89951c33dfc81fdb7e717084b2debc802d30/com/infolace/format/test/base.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove ...
Copyright ( c ) , Dec 2008 . All rights reserved . (ns com.infolace.format.test.base (:refer-clojure :exclude [format]) (:use unit-test com.infolace.format)) (def format cl-format) TODO tests for ~A , ~D , etc . TODO add tests for ~F , etc . : 0.0 , 9.9999 with rounding , 9.9999E99 with rounding (simp...
76860aeb4bf3478a38c4b9ed4698b2ac4efbe1212be83917e0df909f27f540e4
informatimago/lisp
rib.lisp
-*- coding : utf-8 -*- ;;;;**************************************************************************** FILE : rib.lisp ;;;;LANGUAGE: Common-Lisp ;;;;SYSTEM: Common-Lisp USER - INTERFACE : ;;;;DESCRIPTION ;;;; ;;;; See defpackage documentation string. ;;;; < PJB > ...
null
https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/common-lisp/bank/rib.lisp
lisp
**************************************************************************** LANGUAGE: Common-Lisp SYSTEM: Common-Lisp DESCRIPTION See defpackage documentation string. LEGAL This program is free software: you can redistribute it and/or modify (at your option) any later version. ...
-*- coding : utf-8 -*- FILE : rib.lisp USER - INTERFACE : < PJB > < > MODIFICATIONS 2008 - 05 - 12 < PJB > Added setters ( setf bank - code ) , etc . 2004 - 08 - 28 < PJB > Converted from C++ . 1994 - 12 - 28 < PJB > Creation . AGPL3 Copyright 1994 - 2016 ...
f63c9be29751d43ad8fa263a5b25015bddc92db87dd608d50e42649ccaa768be
3b/learnopengl
textures-combined.lisp
;;;; shader code (defpackage textures-combined/shaders (:use #:3bgl-glsl/cl) ;; shadow POSITION so we don't conflict with the default definition of CL : POSITION as ( input position : vec4 : location 0 ) (:shadow position)) (in-package textures-combined/shaders) (input position :vec3 :location 0) ;; if we want...
null
https://raw.githubusercontent.com/3b/learnopengl/30f910895ef336ac5ff0b4cc676af506413bb953/factored/textures-combined.lisp
lisp
shader code shadow POSITION so we don't conflict with the default definition if we want to use the same name for different things in different stages, we need to specify which we mean. If a stage isn't specified, the same definition will be included in any stage that uses the variable. back to normal lisp code ...
(defpackage textures-combined/shaders (:use #:3bgl-glsl/cl) of CL : POSITION as ( input position : vec4 : location 0 ) (:shadow position)) (in-package textures-combined/shaders) (input position :vec3 :location 0) (input color :vec3 :location 1 :stage :vertex) (input tex-coord :vec2 :location 2) (output our-color...
35b7f93a5f9f9a4f640d151cf2c5bed32b04a79d6335d2d3aa68ab33b52501a1
LennMars/algorithms_in_OCaml
main.ml
open Util open Graph module G = UndirectedGraph exception Found let dijkstra s t g = let dists = Array.make (G.size g) infinity and preds = Array.make (G.size g) None and are_fixed = Array.make (G.size g) false in let filter_unfixed = List.filter (fun n -> not are_fixed.(n)) in dists.(0) <- 0.; are_fixed.(0...
null
https://raw.githubusercontent.com/LennMars/algorithms_in_OCaml/f7fb8ca9f497883d86be3167bfc98a4a28ac73c9/dijkstra/main.ml
ocaml
open Util open Graph module G = UndirectedGraph exception Found let dijkstra s t g = let dists = Array.make (G.size g) infinity and preds = Array.make (G.size g) None and are_fixed = Array.make (G.size g) false in let filter_unfixed = List.filter (fun n -> not are_fixed.(n)) in dists.(0) <- 0.; are_fixed.(0...
d513f691daf47bef1db934d6178b958f7777f1feba0049d7b7d21dbba31d51db
parapluu/Concuerror
sleeping_races_8.erl
-module(sleeping_races_8). -export([sleeping_races_8/0, sleeping_races_8/1]). -export([scenarios/0]). scenarios() -> [{?MODULE, inf, dpor}]. sleeping_races_8() -> sleeping_races_8(4). sleeping_races_8(N) -> ets:new(table, [public, named_table]), lists:foreach(fun(X) -> ets:insert(table, {X, 0}...
null
https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/dpor_tests/src/sleeping_races_8.erl
erlang
-module(sleeping_races_8). -export([sleeping_races_8/0, sleeping_races_8/1]). -export([scenarios/0]). scenarios() -> [{?MODULE, inf, dpor}]. sleeping_races_8() -> sleeping_races_8(4). sleeping_races_8(N) -> ets:new(table, [public, named_table]), lists:foreach(fun(X) -> ets:insert(table, {X, 0}...
df94dfd5bd51fc68126756e8b8cf8746339b1deb814fc8afcff60cf515538046
blancas/eisen
project.clj
(defproject org.blancas/eisen "0.2.0" :description "A Language for Programmable Applications" :license {:name "Eclipse Public License" :url "-v10.html"} :url "" :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/core.match "0.2.0-alpha12"] [org.blancas/kern "0.7.0"] [org.blancas/morph "0.3....
null
https://raw.githubusercontent.com/blancas/eisen/ec44756b5653c108647215cb56f2fa01a71fd0f0/project.clj
clojure
(defproject org.blancas/eisen "0.2.0" :description "A Language for Programmable Applications" :license {:name "Eclipse Public License" :url "-v10.html"} :url "" :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/core.match "0.2.0-alpha12"] [org.blancas/kern "0.7.0"] [org.blancas/morph "0.3....
3a52ecc973abe2a40d6cd9bd54268264f95a2f051c1c0baa70532e107973c47c
aeolus-project/zephyrus
string_of.ml
(****************************************************************************) (* *) This file is part of Zephyrus . (* *) Z...
null
https://raw.githubusercontent.com/aeolus-project/zephyrus/0b52de4038bbab724e6a9628430165a7f09f77ae/src/output/string_of.ml
ocaml
************************************************************************** (at your option) any later version. ...
This file is part of Zephyrus . Zephyrus 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 Zephyru...
c62a2bb6fac1b6610acacd6f3fd1c054ff8931b866528dbc9a8c24bd05b27972
clojure/clojurescript
transpile_tests.clj
Copyright ( c ) . All rights reserved . ;; The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( -1.0.php ) ;; which can be found in the file epl-v10.html at the root of this distribution. ;; By using this software in any fashion, you are agreeing to be bound by ;; the t...
null
https://raw.githubusercontent.com/clojure/clojurescript/a4673b880756531ac5690f7b4721ad76c0810327/src/test/clojure/cljs/transpile_tests.clj
clojure
The use and distribution terms for this software are covered by the which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
Copyright ( c ) . All rights reserved . Eclipse Public License 1.0 ( -1.0.php ) (ns cljs.transpile-tests (:require [cljs.closure :as closure :refer [closure-transpile]] [clojure.java.io :as io] [clojure.test :refer [deftest is run-tests]])) (deftest test-transpile-lang-in-lang-out (l...
ab46a72edb57a91372f0a9e08fa4a98bd8a9e14e15f25de4e7d5831f2547d503
Yuppiechef/cqrs-server
kafka.clj
(ns cqrs-server.kafka (:require [clj-kafka.core :as k] [clj-kafka.producer :as kp] [clj-kafka.consumer.zk :as zk])) ;; TODO: needs to be updated with the new setup... (defn config [brokers zkaddress & {:keys [encoder partitioner] :or {encoder "kafka.serializer.DefaultEncoder" partitioner ...
null
https://raw.githubusercontent.com/Yuppiechef/cqrs-server/57621f52e8f4a9de9f2e06fff16b4b918a81228a/src/cqrs_server/kafka.clj
clojure
TODO: needs to be updated with the new setup...
(ns cqrs-server.kafka (:require [clj-kafka.core :as k] [clj-kafka.producer :as kp] [clj-kafka.consumer.zk :as zk])) (defn config [brokers zkaddress & {:keys [encoder partitioner] :or {encoder "kafka.serializer.DefaultEncoder" partitioner "kafka.producer.DefaultPartitioner"}} ] (let [con...
ba5a10c21a435c1b1e62be049b00880ba7bc863a8609d5d41140b30f805291ba
mikera/orculje
text.clj
(ns mikera.orculje.text (:use [mikera.cljutils error]) (:require [mikera.cljutils.find :as find]) (:use mikera.orculje.core) (:import [org.atteo.evo.inflector English])) (def name-hints {:number "Number of items, used to show plutrality" :is-quantity "Used to falg a quanitifiable substance, e.g. 'water'" ...
null
https://raw.githubusercontent.com/mikera/orculje/4c7f9af78f9a8744e1ab3aef3ded151306883083/src/main/clojure/mikera/orculje/text.clj
clojure
(println (str "merge:" t)) (println context)
(ns mikera.orculje.text (:use [mikera.cljutils error]) (:require [mikera.cljutils.find :as find]) (:use mikera.orculje.core) (:import [org.atteo.evo.inflector English])) (def name-hints {:number "Number of items, used to show plutrality" :is-quantity "Used to falg a quanitifiable substance, e.g. 'water'" ...
1ba109a5878daf29a8dfb83ab380e312ac548a8f9c12792057e4aa73c7bcec50
restyled-io/restyler
Delimited.hs
module Restyler.Delimited ( Delimiters(..) , restyleDelimited -- * Exported for testing , DelimitedPath(..) , DelimitedPathPart(..) , DelimitedMeta(..) , delimit , undelimit ) where import Restyler.Prelude import Data.Aeson import Data.Aeson.Casing import qualified Data.Text as T ...
null
https://raw.githubusercontent.com/restyled-io/restyler/3da7d1cb62ec078c03794d4a2c5fbeb5c26fd005/src/Restyler/Delimited.hs
haskell
* Exported for testing | Restyle delimited content within paths using the given function | Split a File into separate files of the content between delimiters Given a @foo.rb@ containing text with delimiters, create - @foo.rb.0@ - @foo.rb.1@ - @foo.rb.2@ - @foo.rb.n@ Where each file contains the content befo...
module Restyler.Delimited ( Delimiters(..) , restyleDelimited , DelimitedPath(..) , DelimitedPathPart(..) , DelimitedMeta(..) , delimit , undelimit ) where import Restyler.Prelude import Data.Aeson import Data.Aeson.Casing import qualified Data.Text as T import Restyler.App.Class impo...
d4eff293bd2a6027a80edc6f548153c58c109796d3bee677ca6d99ce18248cb8
rabbitmq/rabbitmq-tracing
rabbit_tracing_wm_file.erl
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. %% Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . %% -module(rabbit_tracing_wm_file). -export([init/2,...
null
https://raw.githubusercontent.com/rabbitmq/rabbitmq-tracing/85af9285bef54c1689757b3161035b21389dca2d/src/rabbit_tracing_wm_file.erl
erlang
--------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . -module(rabbit_tracing_wm_file). -export([init/2, resou...
7b0f9e543c67965a8b17ef09a15c550859b03ef89607acf0d0e1a5d56771325a
alavrik/piqi
piqi.ml
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014 , 2015 , 2017 , 2018 Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compliance with the License . You may obtain a copy of the License at -2.0 Unless required by applicable...
null
https://raw.githubusercontent.com/alavrik/piqi/bcea4d44997966198dc295df0609591fa787b1d2/piqilib/piqi.ml
ocaml
start in boot_mode by default, it will be switched off later (see below) resolved "typedef" type definition * Will be appropriately initialized during boot stage (see below) loaded in boot () -- see below NOTE: create an empty idtable just to make invocations below work; none of * the plugins actually requir...
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014 , 2015 , 2017 , 2018 Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compliance with the License . You may obtain a copy of the License at -2.0 Unless required by applicable...
c7b4d72e73646af571fc3618e40fdcd880827d66a70e997534555c8e3df27804
xmonad/xmonad-contrib
Rescreen.hs
# LANGUAGE LambdaCase # {-# LANGUAGE MultiWayIf #-} # LANGUAGE RecordWildCards # -- | -- Module : XMonad.Hooks.Rescreen -- Description : Custom hooks for screen (xrandr) configuration changes. Copyright : ( c ) 2021 > -- License : BSD3 Maintainer : < > -- -- Custom hooks for screen (xran...
null
https://raw.githubusercontent.com/xmonad/xmonad-contrib/8693654bdd5250437f18c208cc41fd55813bd2da/XMonad/Hooks/Rescreen.hs
haskell
# LANGUAGE MultiWayIf # | Module : XMonad.Hooks.Rescreen Description : Custom hooks for screen (xrandr) configuration changes. License : BSD3 Custom hooks for screen (xrandr) configuration changes. * Usage $usage $usage This module provides a replacement for the screen configuration change handl...
# LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # Copyright : ( c ) 2021 > Maintainer : < > module XMonad.Hooks.Rescreen ( addAfterRescreenHook, addRandrChangeHook, RescreenConfig(..), rescreenHook, ) where import Graphics.X11.Xrandr import XMonad import XMonad.Prelude import...
5aadaeb501d74539c8caa0422fdd1ffbe8a92753298e3998616e762b9bd76f68
haskellfoundation/error-message-index
Main.hs
{-# LANGUAGE GADTs TemplateHaskell #-} module Main where main = print "Please look at the LANGUAGE pragmas!"
null
https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-68686/example1/before/Main.hs
haskell
# LANGUAGE GADTs TemplateHaskell #
module Main where main = print "Please look at the LANGUAGE pragmas!"
f6ccefe0f67afcfb25d6e6dda36fb7d30627e09ff101670d1d82b4d4ae170aec
zenhack/mule
memoize.ml
let memoize f = let tbl = Caml.Hashtbl.create 10 in fun x -> match Caml.Hashtbl.find_opt tbl x with | Some y -> y | None -> let y = f x in Caml.Hashtbl.add tbl x y; y
null
https://raw.githubusercontent.com/zenhack/mule/f3e23342906d834abb9659c72a67c1405c936a00/src/mule/lib/memoize.ml
ocaml
let memoize f = let tbl = Caml.Hashtbl.create 10 in fun x -> match Caml.Hashtbl.find_opt tbl x with | Some y -> y | None -> let y = f x in Caml.Hashtbl.add tbl x y; y
b539faf8ed0458f56b104402b8dfc177d67c037091f24f61beda868d87cb9167
stepcut/plugins
Main.hs
import System.Plugins main = do loadPackage "posix" unloadPackage "posix" loadPackage "posix"
null
https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/testsuite/load/unloadpkg/Main.hs
haskell
import System.Plugins main = do loadPackage "posix" unloadPackage "posix" loadPackage "posix"
9c6d002ee4ad71bee4f7e9a58849a6438f0e958d0eb212c8b78de93ed97f8202
OCamlPro/alt-ergo
fmSimplexIneqs.ml
(******************************************************************************) (* *) Alt - Ergo : The SMT Solver For Software Verification Copyright ( C ) 2013 - 2018 (* ...
null
https://raw.githubusercontent.com/OCamlPro/alt-ergo/291523151417f4cd112744d740b58ab1e8a630b4/src/plugins/fm-simplex/fmSimplexIneqs.ml
ocaml
**************************************************************************** This file is distributed under the terms of the license indicated in the ...
Alt - Ergo : The SMT Solver For Software Verification Copyright ( C ) 2013 - 2018 open AltErgoLib open Format open Options module Q = Numbers.Q module Container : Inequalities.Container_SIG = struct module Make (P : Polynome.T with type r = S...
f179214071e5b07255711a94e38b2d0e8abd3946b64d96af0ec347094e8a32d9
NorfairKing/intray
AuthRSpec.hs
{-# LANGUAGE OverloadedStrings #-} module Intray.Web.Server.Handler.AuthRSpec where import Intray.Data (parseUsername) import Intray.Web.Server.Foundation import Intray.Web.Server.TestUtils import Network.HTTP.Types import Test.Syd.Yesod import TestImport # ANN module ( " HLint : ignore Reduce duplication " : : Stri...
null
https://raw.githubusercontent.com/NorfairKing/intray/476e22e6b04c1322df4822e8f6f2f10fb35115d6/intray-web-server/test/Intray/Web/Server/Handler/AuthRSpec.hs
haskell
# LANGUAGE OverloadedStrings #
module Intray.Web.Server.Handler.AuthRSpec where import Intray.Data (parseUsername) import Intray.Web.Server.Foundation import Intray.Web.Server.TestUtils import Network.HTTP.Types import Test.Syd.Yesod import TestImport # ANN module ( " HLint : ignore Reduce duplication " : : String ) # spec :: Spec spec = intra...
4aef3ba91a3ee1f7b6536e133b2397e7070379fa9d3810975654cc2a9cde04c1
rsharifnasab/my-learning
GreetIfCool1.hs
module GreetIfCool1 where greetIfCool :: String -> IO() greetIfCool coolness = if cool then putStrLn "khube" else putStrLn "khub bash khob" where cool = coolness == "ok"
null
https://raw.githubusercontent.com/rsharifnasab/my-learning/8555583a772c96e334e3fdace5a295a21c31ea8b/haskell/4-dataTypes/GreetIfCool1.hs
haskell
module GreetIfCool1 where greetIfCool :: String -> IO() greetIfCool coolness = if cool then putStrLn "khube" else putStrLn "khub bash khob" where cool = coolness == "ok"
2ec8374399e84b1f1a75e068014b43b410505888554b02627b7444cc48aedf32
jspahrsummers/RxHaskell
Operators.hs
{-# LANGUAGE Safe #-} # LANGUAGE ScopedTypeVariables # module Signal.Operators ( doEvent , doNext , doError , doCompleted , finally , materialize , dematerialize ...
null
https://raw.githubusercontent.com/jspahrsummers/RxHaskell/19550bb692a6a6e56314fe3aebb1303a22e577ed/Signal/Operators.hs
haskell
# LANGUAGE Safe # | Turns any 'Foldable' into a signal. | The inverse of 'materialize'. | Filters the values of a signal according to a predicate. | Runs a side-effecting action whenever the signal sends an event. | Runs a side-effecting action whenever the signal sends a value. | Runs a side-effecting action whe...
# LANGUAGE ScopedTypeVariables # module Signal.Operators ( doEvent , doNext , doError , doCompleted , finally , materialize , dematerialize , fromFolda...
2745e7c639fc9f018377a0026d59dbbd3cae2f74c611d97aeb70274b5df258fb
fmancinelli/lein-lesscss
lesscss.clj
Leiningen Less CSS compile task . Copyright 2012 < > ;; ;; Contributors: > ;; ;; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or ;; (at your op...
null
https://raw.githubusercontent.com/fmancinelli/lein-lesscss/af4b1a6b261e750225eb6f3736bb6db13bb39853/src/leiningen/lesscss.clj
clojure
Contributors: This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GN...
Leiningen Less CSS compile task . Copyright 2012 < > > 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 (ns leiningen.lesscss (:use [leiningen...
403908d543681bc42b66acdf242996f5e7feca337dadbff1ad07fa70fa22b069
clj-kafka/franzy
schema.clj
(ns franzy.admin.schema (:require [schema.core :as s] [franzy.common.schema :as fs] [franzy.common.models.schema :as fms])) TODO : implement any schema not in Franzy - Common used for admin ;;TODO: all these schemas need heavy tweaking and stricter definitions, but this is a start (def Repl...
null
https://raw.githubusercontent.com/clj-kafka/franzy/6c2e2e65ad137d2bcbc04ff6e671f97ea8c0e380/admin/src/franzy/admin/schema.clj
clojure
TODO: all these schemas need heavy tweaking and stricter definitions, but this is a start <-- TODO: Be more specific here.
(ns franzy.admin.schema (:require [schema.core :as s] [franzy.common.schema :as fs] [franzy.common.models.schema :as fms])) TODO : implement any schema not in Franzy - Common used for admin (def ReplicaAssignments [fs/SPosInt]) (def Endpoint "Schema for a Kafka endpoint." {(s/require...
c32aaa8d6cdbde787a120e5ee18280561a880a7c57fb3a5b5f525f8dd41d7328
marigold-dev/mankavar
ppx_abstract.ml
module P = Ppxlib module A = P.Ast_builder.Default let ($$) f x = f x let rec get_default_name : P.core_type -> string = fun ty -> let self = get_default_name in let rec from_ident : P.longident -> string = fun ident -> let self = from_ident in match ident with | Lident x -> x | Lapply (a , b) -> ...
null
https://raw.githubusercontent.com/marigold-dev/mankavar/2a384efc359799b6cf37504fc6f2e6019a5feabc/vendors/ppx-abstract/ppx_abstract.ml
ocaml
module P = Ppxlib module A = P.Ast_builder.Default let ($$) f x = f x let rec get_default_name : P.core_type -> string = fun ty -> let self = get_default_name in let rec from_ident : P.longident -> string = fun ident -> let self = from_ident in match ident with | Lident x -> x | Lapply (a , b) -> ...
5d7e8d7dbd30dde603e05ed5077f0590d1454f4096bcfc34490a7c98e8d4d9f3
fakedata-haskell/fakedata
Artist.hs
# LANGUAGE TemplateHaskell # {-# LANGUAGE OverloadedStrings #-} module Faker.Artist where import Data.Text (Text) import Faker (Fake(..)) import Faker.Provider.Artist import Faker.TH $(generateFakeField "artist" "names")
null
https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Artist.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell # module Faker.Artist where import Data.Text (Text) import Faker (Fake(..)) import Faker.Provider.Artist import Faker.TH $(generateFakeField "artist" "names")
58fe25e5f2d54deecea09af9a6886850bb702daba9f1c8dfc15cb844cef46215
paf31/dicom-haskell-library
VR.hs
----------------------------------------------------------------------------- -- -- Module : Data.DICOM.VR Copyright : Copyright ( c ) DICOM Grid 2015 -- License : GPL-3 -- -- Maintainer : -- Stability : experimental -- Portability : -- -----------------------------------------------------------...
null
https://raw.githubusercontent.com/paf31/dicom-haskell-library/c3266869b55f2007e0b9476a5e70fcecfcd6f0a4/src/Data/DICOM/VR.hs
haskell
--------------------------------------------------------------------------- Module : Data.DICOM.VR License : GPL-3 Maintainer : Stability : experimental Portability : ---------------------------------------------------------------------------
Copyright : Copyright ( c ) DICOM Grid 2015 module Data.DICOM.VR ( VR(..) , isStringVR ) where import Prelude hiding (LT) import Safe import Data.Binary data VR = AE | AS | AT | CS | DA | DS | DT | FL | FD | IS | LO | LT | OB | OF | OW | PN | SH | SL | SQ | SS ...
1181427268fd618e061b05c3a5dcc93377acd6dd294253811945bb1e0ddc655c
scrintal/heroicons-reagent
clipboard.cljs
(ns com.scrintal.heroicons.solid.clipboard) (defn render [] [:svg {:xmlns "" :viewBox "0 0 24 24" :fill "currentColor" :aria-hidden "true"} [:path {:fillRule "evenodd" :d "M10.5 3A1.501 1.501 0 009 4.5h6A1.5 1.5 0 0013.5 3h-3zm-2.693.178A3 3 0 0110.5 1...
null
https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/clipboard.cljs
clojure
(ns com.scrintal.heroicons.solid.clipboard) (defn render [] [:svg {:xmlns "" :viewBox "0 0 24 24" :fill "currentColor" :aria-hidden "true"} [:path {:fillRule "evenodd" :d "M10.5 3A1.501 1.501 0 009 4.5h6A1.5 1.5 0 0013.5 3h-3zm-2.693.178A3 3 0 0110.5 1...
0b7cdef0213c877dc9d98902ab33cf540130efed4b1d31927b598f561fd3e011
talex5/cuekeeper
ck_merge.ml
Copyright ( C ) 2015 , the README file for details . * See the README file for details. *) open Ck_utils open Lwt.Infix module Make(Git : Git_storage_s.S) (R : Ck_rev.S with type commit = Git.Commit.t) = struct open R.Node.Types let ok x = Lwt.return (`Ok x) type 'a patch = [ `Add of 'a | `Rem...
null
https://raw.githubusercontent.com/talex5/cuekeeper/ef8c97637627cf90902a0be50c8d39eadacc88b3/lib/ck_merge.ml
ocaml
[diff_k base v] is a map with an entry for every changed node in base or v, saying how it changed. [diff ~base_rev v] is a diff from [base_rev] to [v]. If [base_rev] isn't given * then we assume it was empty and only generate [`Add] patches. * [merge_k k ~their_changes ~our_changes stage] updates [stage], which ...
Copyright ( C ) 2015 , the README file for details . * See the README file for details. *) open Ck_utils open Lwt.Infix module Make(Git : Git_storage_s.S) (R : Ck_rev.S with type commit = Git.Commit.t) = struct open R.Node.Types let ok x = Lwt.return (`Ok x) type 'a patch = [ `Add of 'a | `Rem...
09838092e5e61c9fa87a56c2423ca581d562be95de9c62ad622597aeb56a1f74
brendanhay/gogol
Reauthorize.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # {-# LANGUAGE St...
null
https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-tagmanager/gen/Gogol/TagManager/Accounts/Containers/Environments/Reauthorize.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated /See:/ <-manager Tag Manager API Reference> for @tagmanager.accounts.containers.environments.reauthorize@. * Resource ** Constructing a Request | A resource alias for @tagmanager.accounts.containers.environments.reauthorize@ m...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators...
4e9b832c5d8895546d9509f89af50278086e958b9dc55b3f7491b5d1f02ea1d4
ssor/erlangDemos
reg_port_mng.erl
%gen_server template -module(reg_port_mng). -behaviour(gen_server). -export([init/1,handle_call/3,handle_cast/2,handle_info/2, terminate/2,code_change/3]). -export([add_port/1, delete_port/1, start_link/0, send_data/2, get_lease_time/1, set_lease_time/2]). -record(state,{}). %%%%===============================...
null
https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/rfid_event_generator/src/reg_port_mng.erl
erlang
gen_server template ========================================================================================================= io:format("Created Child Pid is ~p~n",[Pid]) =========================================================================================================
-module(reg_port_mng). -behaviour(gen_server). -export([init/1,handle_call/3,handle_cast/2,handle_info/2, terminate/2,code_change/3]). -export([add_port/1, delete_port/1, start_link/0, send_data/2, get_lease_time/1, set_lease_time/2]). -record(state,{}). add_port(UdpPort) -> case reg_store:lookup(UdpPort) of ...
20a6e0322913889023e9f9192a72e66fd0ded8d26ec2ee4c42bb93a83f30a96f
BekaValentine/SimpleFP-v2
Unification.hs
{-# OPTIONS -Wall #-} # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE TypeSynonymInstances #-} # LANGUAGE UndecidableInstances # -- | This module defines unification of dependent types. module Dependent.Unification.Unification where import Utils.ABT ...
null
https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Dependent/Unification/Unification.hs
haskell
# OPTIONS -Wall # # LANGUAGE TypeSynonymInstances # | This module defines unification of dependent types. | Equating terms by trivial structural equations. | Equating case motives as a special helper for the main 'equate' method. Equating clauses as a special helper for the main 'equate' method.
# LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE UndecidableInstances # module Dependent.Unification.Unification where import Utils.ABT import Utils.Elaborator import Utils.Pretty import Utils.Telescope import Utils.Unifier import Dependent.Core.Term im...
ce5c17793ab6f821fbfea520e63aabafea2ca8255c5e548b1cbb9e6547037bd5
pirapira/coq2rust
cooking.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/kernel/cooking.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** This module implements kernel-level...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Created by out of V6.3 ...
34376e5412da772ec5d983dc0eb93f6057e5665724dd0c391768fc7e9b3b7855
tezos-commons/baseDAO
FlushTransferProposal.hs
SPDX - FileCopyrightText : 2021 Tezos Commons SPDX - License - Identifier : LicenseRef - MIT - TC module Test.Ligo.RegistryDAO.Tests.FlushTransferProposal ( flushTransferProposal ) where import Prelude import Test.Tasty (TestTree, testGroup) import Lorentz as L hiding (Contract, assert, div) import Lorentz....
null
https://raw.githubusercontent.com/tezos-commons/baseDAO/01eedff3e222945815816fd5e2a1623040a75388/haskell/test/Test/Ligo/RegistryDAO/Tests/FlushTransferProposal.hs
haskell
Advance one voting period to a proposing stage. Advance one voting period to a voting stage. Advance one voting period to a proposing stage. Advance one voting period to a proposing stage. Advance one voting period to a voting stage. Advance one voting period to a proposing stage. Actual transfer governance tok...
SPDX - FileCopyrightText : 2021 Tezos Commons SPDX - License - Identifier : LicenseRef - MIT - TC module Test.Ligo.RegistryDAO.Tests.FlushTransferProposal ( flushTransferProposal ) where import Prelude import Test.Tasty (TestTree, testGroup) import Lorentz as L hiding (Contract, assert, div) import Lorentz....
75decffa193a9427d5fa4140093d8dbfb9a308822bf00292507d771344f82dec
yogthos/memory-hole
core.clj
(ns memory-hole.core (:require [memory-hole.handler :as handler] [luminus.repl-server :as repl] [luminus.http-server :as http] [luminus-migrations.core :as migrations] [memory-hole.config :refer [env]] [clojure.tools.cli :refer [parse-opts]] [clo...
null
https://raw.githubusercontent.com/yogthos/memory-hole/925e399b0002d59998d10bd6f54ff3464a4b4ddb/src/clj/memory_hole/core.clj
clojure
(ns memory-hole.core (:require [memory-hole.handler :as handler] [luminus.repl-server :as repl] [luminus.http-server :as http] [luminus-migrations.core :as migrations] [memory-hole.config :refer [env]] [clojure.tools.cli :refer [parse-opts]] [clo...
501dd5c4cea0c324747a3fbaa95880343803df39870a03fac5148a55ab767f58
gonimo/gonimo
Impl.hs
# LANGUAGE RecordWildCards # | Module : . Client . Account . Impl Description : Account specific data is served by this module . Copyright : ( c ) , 2018 At the moment this is only about managing of claimed invitations . Module : Gonimo.Client.Account.Impl Description : Account specific data ...
null
https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/front/src/Gonimo/Client/Account/Impl.hs
haskell
* Interface * Types * Creation | Our dependencies | Example datatype fulfilling 'HasModelConfig'. | For subscribing important commands. We subscribe important commands to ensure they will be delivered even on connection problems. | Commands going to the server. | Configurations we provide for the model a...
# LANGUAGE RecordWildCards # | Module : . Client . Account . Impl Description : Account specific data is served by this module . Copyright : ( c ) , 2018 At the moment this is only about managing of claimed invitations . Module : Gonimo.Client.Account.Impl Description : Account specific data ...
527dfcee92aa5bc484e2ae5d73a8d0cbd12f66bcf31337fbeb324c5815a1624f
ocaml-omake/omake
lm_glob.mli
open Lm_lexer . type glob_option = | GlobNoBraces (* Do not perform csh-style brace expansion *) | GlobNoTilde (* Do not perform tilde-expansion *) | GlobNoEscape (* The \ character does not escape special characters *) | GlobNoCheck (* If an expansion fails, return the expa...
null
https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/front/lm_glob.mli
ocaml
Do not perform csh-style brace expansion Do not perform tilde-expansion The \ character does not escape special characters If an expansion fails, return the expansion literally If an expansion fails, it expands to nothing Allow wildcards to match filenames with a leading . Return only non-directories in th...
open Lm_lexer . type glob_option = Home directory for ~ expansion type glob_options val create_options : glob_option list -> glob_options val default_glob_options : glob_options * The initial home directory for tilde expansion . * The globber does its best to figure this out . * The initial home d...
3816cac3c28acb22cd9efa1ccabc9c3bddf2520f53f76386e78494869c551d0d
travitch/haggle
Digraph.hs
{-# LANGUAGE BangPatterns #-} # LANGUAGE TypeFamilies # -- | This graph implementation is a directed (multi-)graph that only tracks -- successors. This encoding is very compact. It is a multi-graph because it -- allows parallel edges between vertices. If you require only simple graphs, -- careful edge insertion is r...
null
https://raw.githubusercontent.com/travitch/haggle/2e95b6d71a62bd7243702424de494f95f5249e1f/src/Data/Graph/Haggle/Digraph.hs
haskell
# LANGUAGE BangPatterns # | This graph implementation is a directed (multi-)graph that only tracks successors. This encoding is very compact. It is a multi-graph because it allows parallel edges between vertices. If you require only simple graphs, careful edge insertion is required (or another graph type might b...
# LANGUAGE TypeFamilies # module Data.Graph.Haggle.Digraph ( MDigraph, Digraph, newMDigraph, newSizedMDigraph ) where import qualified Control.DeepSeq as DS import Control.Monad ( when ) import qualified Control.Monad.Primitive as P import qualified Control.Monad.Ref as R import qualified Data.Vector.Unboxed...
6da857b9747787d7ef32d6a4c376ef019ab1cb404a8bf04f0b32196b50b19c2b
haskellfoundation/error-message-index
Main.hs
module Main where main :: IO () main = do let enum = [5 .. 1] print enum
null
https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-10190/bigger-start/before/Main.hs
haskell
module Main where main :: IO () main = do let enum = [5 .. 1] print enum
86a3c952a1ebcd19a96cb221de43db847e542e9a1de5f1ed4e75437e41d2f670
glguy/advent
01.hs
{-# Language QuasiQuotes, ImportQualifiedPost #-} | Module : Main Description : Day 1 solution Copyright : ( c ) , 2018 License : ISC Maintainer : < > Day 1 gives us a list of differences to sum up . We compute the sum of these differences , and we search for duplicates in the part...
null
https://raw.githubusercontent.com/glguy/advent/6763583760755ee4a1b6890626d06fafd58673dc/solutions/src/2018/01.hs
haskell
# Language QuasiQuotes, ImportQualifiedPost # | Print the answers to the problem. >>> :main 137041 that repeats when we cycle the list of differences. >>> part2 [1,-1] >>> part2 [-6,3,8,5,-6] >>> part2 [7,7,-2,-7,-4]
| Module : Main Description : Day 1 solution Copyright : ( c ) , 2018 License : ISC Maintainer : < > Day 1 gives us a list of differences to sum up . We compute the sum of these differences , and we search for duplicates in the partial sums of the differences list . Module ...
5ffed27c24fb82dc565bd07e7c5d32c351aac3173ea64b52ddfd689ec936ce6d
rpav/cl-xcb-xlib
display.lisp
(in-package :xcb.clx) ;; Threading (defvar *display* nil) (defstruct display-msg return-channel fn) (defun display-thread-loop (display) (let ((*display* display) (channel (%display-send-channel display))) (loop while *display* do (let ((msg (recvmsg channel))) (handler-case ...
null
https://raw.githubusercontent.com/rpav/cl-xcb-xlib/1b00c44d4723b3a8334f36e731906d4679341c0e/src/clx/display.lisp
lisp
Threading special case of CLOSE-DISPLAY DISPLAY type DISPLAY-P is implicit for DEFSTRUCT DISPLAY FIXME? McCLIM apparently uses this FIXME? FIXME .. more should be done here? 2.5 Closing the Display
(in-package :xcb.clx) (defvar *display* nil) (defstruct display-msg return-channel fn) (defun display-thread-loop (display) (let ((*display* display) (channel (%display-send-channel display))) (loop while *display* do (let ((msg (recvmsg channel))) (handler-case (sendmsg (d...
91c07d27c96609783d4b44e120d44e11ab66504114f8d8295f8f6b71371172a2
links-lang/links
query.ml
open Utility open CommonTypes module Q = QueryLang let (++) = Q.append_env let internal_error message = Errors.internal_error ~filename:"query/query.ml" ~message let rec tail_of_t : Q.t -> Q.t = fun v -> let tt = tail_of_t in match v with | Q.For (_, _gs, _os, Q.Singleton (Q.Record fields)) -> Q.Recor...
null
https://raw.githubusercontent.com/links-lang/links/1745f2f1aec9e8dcff6df1c50215e3e117dd21b2/core/query/query.ml
ocaml
Debug.print ("v: "^string_of_t v); we don't attempt to freshen closure bindings Var (x, ts) simple optimisations optimisation NOTE: We are relying on peculiarities of the way we manage the environment in order to avoid having to augment it with the generator binding...
open Utility open CommonTypes module Q = QueryLang let (++) = Q.append_env let internal_error message = Errors.internal_error ~filename:"query/query.ml" ~message let rec tail_of_t : Q.t -> Q.t = fun v -> let tt = tail_of_t in match v with | Q.For (_, _gs, _os, Q.Singleton (Q.Record fields)) -> Q.Recor...
c2eddbec1c909bf5d4c70edaa4808bfd0c843bceb80cba0d33bff95f8b016f9a
potetm/tire-iron
cljs_macros.clj
(ns com.potetm.tire-iron.cljs-macros) (defmacro foo-tha-foo [] `(js/console.log "FOO THA FOO!"))
null
https://raw.githubusercontent.com/potetm/tire-iron/f26e3f68c137ea10e42645ea2977e9c755558b08/src/dev/clj/com/potetm/tire_iron/cljs_macros.clj
clojure
(ns com.potetm.tire-iron.cljs-macros) (defmacro foo-tha-foo [] `(js/console.log "FOO THA FOO!"))
dca4de0b86d55881869e8587b1f2f04d4443d6398581638abcfe9bd50e5f4413
MercuryTechnologies/ghc-specter
Driver.hs
module GHCSpecter.Driver ( webServer, ) where import Concur.Core (Widget, liftSTM, unsafeBlockingIO) import Control.Applicative ((<|>)) import Control.Concurrent.STM ( TChan, atomically, newTChanIO, newTVarIO, readTChan, writeTChan, ) import Control.Lens ((.~), (^.)) import Control.Monad.Extra (loopM) i...
null
https://raw.githubusercontent.com/MercuryTechnologies/ghc-specter/d911e610e0ee0fb43497dad9e762fec2abbf9e08/daemon/src/GHCSpecter/Driver.hs
haskell
NOTE: server state: shared across the session ui state: per web view. control: per web view A single step of the outer loop (See Note [Control Loops]). UI comm channel last event
module GHCSpecter.Driver ( webServer, ) where import Concur.Core (Widget, liftSTM, unsafeBlockingIO) import Control.Applicative ((<|>)) import Control.Concurrent.STM ( TChan, atomically, newTChanIO, newTVarIO, readTChan, writeTChan, ) import Control.Lens ((.~), (^.)) import Control.Monad.Extra (loopM) i...
f5cb810bd8793292eec01811a418405b4236c50c160c5b1f082da0ea7cf5becf
drapanjanas/pneumatic-tubes
ui.cljs
(ns group-chat-app.ios.ui (:require [reagent.core :as r :refer [atom]] [re-frame.core :refer [subscribe dispatch dispatch-sync]] [group-chat-app.ios.styles :as s])) (def ReactNative (js/require "react-native")) (def text (r/adapt-react-class (.-Text ReactNative))) (def button (r/adapt-react-...
null
https://raw.githubusercontent.com/drapanjanas/pneumatic-tubes/ea3834ea04e06cd2d4a03da333461a474c0475f5/examples/group-chat-app/src/group_chat_app/ios/ui.cljs
clojure
(ns group-chat-app.ios.ui (:require [reagent.core :as r :refer [atom]] [re-frame.core :refer [subscribe dispatch dispatch-sync]] [group-chat-app.ios.styles :as s])) (def ReactNative (js/require "react-native")) (def text (r/adapt-react-class (.-Text ReactNative))) (def button (r/adapt-react-...
9d04aa59b82cf4639b61d18b8efacc8f3c89fd6c5b1d8ff88f78026221f201d1
mzp/coq-ruby
formula.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/firstorder/formula.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** exception Is_atom of constr
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $ I d : formula.mli 5920 ...
457cdbe1d5043013a915f857fe5a160228cc4bfc97afea30fa5212225d265515
arttuka/reagent-material-ui
spatial_audio_sharp.cljs
(ns reagent-mui.icons.spatial-audio-sharp "Imports @mui/icons-material/SpatialAudioSharp as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def spatial-audio-sharp...
null
https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/spatial_audio_sharp.cljs
clojure
(ns reagent-mui.icons.spatial-audio-sharp "Imports @mui/icons-material/SpatialAudioSharp as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def spatial-audio-sharp...
59e71a89b7130954e843331ad1af612771aca102680cd59330049c185474a7c9
RichiH/git-annex
Auth.hs
P2P authtokens - - Copyright 2016 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2016 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module P2P.Auth where import Annex.Common import Creds import P2P.Address import Utility.AuthToken import Utility.T...
null
https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/P2P/Auth.hs
haskell
| Load authtokens that are accepted by this repository. GIT_ANNEX_P2P_AUTHTOKEN overrides. We can omit the port and just use the onion address for the creds file, because any given tor hidden service runs on a single port and has a unique onion address.
P2P authtokens - - Copyright 2016 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2016 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} module P2P.Auth where import Annex.Common import Creds import P2P.Address import Utility.AuthToken import Utility.T...
214ef3cba27fd4be60a3cfcadfaf3b0aad4db1e044570d7bd05b8e72792b54f2
yogthos/krueger
core.cljs
(ns krueger.core (:require [cljsjs.semantic-ui-react :as ui] [kee-frame.core :as kf] [krueger.ajax :refer [load-interceptors!]] [krueger.auth] [krueger.common :as common] [krueger.components.auth :as auth] [krueger.components.navbar :refer [navbar]] #_[krueger.feeds :as feeds] [kru...
null
https://raw.githubusercontent.com/yogthos/krueger/782e1f8ab358867102b907c5a80e56ee6bc6ff82/src/cljs/krueger/core.cljs
clojure
(ns krueger.core (:require [cljsjs.semantic-ui-react :as ui] [kee-frame.core :as kf] [krueger.ajax :refer [load-interceptors!]] [krueger.auth] [krueger.common :as common] [krueger.components.auth :as auth] [krueger.components.navbar :refer [navbar]] #_[krueger.feeds :as feeds] [kru...
268d8f93ccea30bbc6e7d8d7e9c5090b53405795120e0ec504958688342bbc2b
abengoa/clj-stripe
customers.clj
Copyright ( c ) 2011 . All rights reserved . ; The use and distribution terms for this software are covered by the ; Eclipse Public License 1.0 (-1.0.php) ; which can be found in the file epl-v10.html at the root of this distribution. ; By using this software in any fashion, you are agreeing to be bound b...
null
https://raw.githubusercontent.com/abengoa/clj-stripe/d4870d6ea57140d23385878bcf7faea21cf90da8/src/clj_stripe/customers.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove ...
Copyright ( c ) 2011 . All rights reserved . (ns clj-stripe.customers "Functions for Stripe Customers API" (:use clj-stripe.common) (:require [clj-stripe.util :as util])) (defn email "Creates the data representation of a customer's email address." [e] {"email" e}) (defn create-customer "Cr...
a4794a8f8193fdb9309005fab06927ce0c1aad2c9c7aed1f0e2511347d1bcd71
mattmundell/nightshade
tty-stream.lisp
;;; Some stuff to make streams that write out to terminal hunks. ;;; ;;; This code is VERY similar to that in Pane-Stream.Lisp. The biggest ( if only ) difference is in TTY - HUNK - STREAM - NEWLINE . (in-package "EDI") ;;;; Constants (defconstant tty-hunk-width-limit 200) ;;;; Structures ;;; Tty-Hunk strea...
null
https://raw.githubusercontent.com/mattmundell/nightshade/d8abd7bd3424b95b70bed599e0cfe033e15299e0/src/ed/tty-stream.lisp
lisp
Some stuff to make streams that write out to terminal hunks. This code is VERY similar to that in Pane-Stream.Lisp. The biggest Constants Structures Tty-Hunk streams are inherently buffered by line. Tty-hunk-output-stream methods makes the current line wrap, or if the character is a newline, then out the buf...
( if only ) difference is in TTY - HUNK - STREAM - NEWLINE . (in-package "EDI") (defconstant tty-hunk-width-limit 200) (defstruct (stream-hunk (:print-function %print-device-hunk) (:include tty-hunk)) (width 0 :type fixnum) (point-x 0 :type fixnum) (point-y 0 :type fixnum) (buffer "" :type simple...
847cb39a5761ba29d54dbad588298cb46301bdd5a707b7218f1e9efbf7a6c1ec
ice1000/learn
remove-last-char.hs
module Haskell.Codewars.RemoveChar where removeChar :: String -> String removeChar (_ : str) = init str
null
https://raw.githubusercontent.com/ice1000/learn/4ce5ea1897c97f7b5b3aee46ccd994e3613a58dd/Haskell/CW-Kata/remove-last-char.hs
haskell
module Haskell.Codewars.RemoveChar where removeChar :: String -> String removeChar (_ : str) = init str
116590da36ac3b7943a963d8f61d2b98a3359c2ac506eea0a3f760a612d98ec1
AndrewMagerman/wizard-book-study
lazy-eval-no-memo.rkt
#lang racket (require (rename-in racket/base [apply apply-in-underlying-scheme] [eval eval-in-underlying-scheme]) "mutable.rkt" "table.rkt") (provide (all-defined-out) ;; :TODO define explicitly which procedures are provided (all-from-out "mutable.r...
null
https://raw.githubusercontent.com/AndrewMagerman/wizard-book-study/015f64f1cf86e90b2a6ac4e47ca902fcb6c63e0d/missing_files/week_15/files_from_barry_allisson/wizard-book-solutions-master-ch04-lib/ch04/lib/lazy-eval-no-memo.rkt
racket
:TODO define explicitly which procedures are provided changed changed Procedure arguments Lazy values it's value is kept and the environment it was created in can be discarded delayed values access to the environment they are created in thunks Quoted data Conditionals Sequences Assignments and definition...
#lang racket (require (rename-in racket/base [apply apply-in-underlying-scheme] [eval eval-in-underlying-scheme]) "mutable.rkt" "table.rkt") (all-from-out "mutable.rkt") (all-from-out "table.rkt")) (define (eval exp env) (cond ((self-eval...
c1689a673c428856e8723697ef52bcd0136c105a1cb89aae04caed74648b9f61
dgiot/dgiot
emqx_acl_test_mod.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2017 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy o...
null
https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/test/emqx_acl_test_mod.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2017 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(emqx_acl_test_mod). -export([ init/1 , check_acl/2 , description/0 ...
02110fa586099824313b6872ad5d629c4ff5ee12a954bccaf8eb324002552662
dktr0/estuary
Sequencer.hs
# LANGUAGE RecursiveDo , OverloadedStrings # module Estuary.Widgets.Sequencer where import Reflex import Reflex.Dom import GHCJS.DOM.EventM import Control.Monad import Data.Map.Strict as M import Data.Text (Text) import qualified Data.Text as T import Safe.Foldable (maximumMay) import Text.Read (readMaybe) import Est...
null
https://raw.githubusercontent.com/dktr0/estuary/b3370cf925231be927a2d53b0f195c0c008ff751/client/src/Estuary/Widgets/Sequencer.hs
haskell
for deleted rows Dynamic t (Map Int (Dynamic t ((Text,[Bool]),Event t ()))) Dynamic t (Map Int ((Text,[Bool]),Event t ())) Event t (Map Int ()) *** TODO should rework the above since some of the above management is unnecessary with Editor approach Event returned is a message to delete that row Dyn (Map Int Bool)
# LANGUAGE RecursiveDo , OverloadedStrings # module Estuary.Widgets.Sequencer where import Reflex import Reflex.Dom import GHCJS.DOM.EventM import Control.Monad import Data.Map.Strict as M import Data.Text (Text) import qualified Data.Text as T import Safe.Foldable (maximumMay) import Text.Read (readMaybe) import Est...
a8a431bfc15e37a1646eb9a212c994c70318538a356a60a96fadee70b6c89a7e
brendanhay/terrafomo
Types.hs
-- This module was auto-generated. If it is modified, it will not be overwritten. -- | Module : . MySQL.Types Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Maintainer : < brendan.g.hay+ > -- Stability : auto-generated Portability : non - portable ( GHC exten...
null
https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-mysql/src/Terrafomo/MySQL/Types.hs
haskell
This module was auto-generated. If it is modified, it will not be overwritten. | Stability : auto-generated import Formatting (Format, (%))
Module : . MySQL.Types Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Maintainer : < brendan.g.hay+ > Portability : non - portable ( GHC extensions ) module Terrafomo.MySQL.Types where import Data . Text ( Text ) import Terrafomo import Terrafomo . My...
0aa7b1b89ac55b09c344d161ff69e6427536b8d27d43820581dc13bbfb44a84d
pcostanza/mop-features
slot-methods.lisp
(defclass test-class (standard-class) ()) (defmethod validate-superclass ((class test-class) (superclass standard-class)) t) (defclass test-object () ((slot :initform 5 :accessor a-slot)) (:metaclass test-class)) (mapc #'acknowledge-function '("SLOT-VALUE-USING-CLASS" "SLO...
null
https://raw.githubusercontent.com/pcostanza/mop-features/a967752c885285b74473b940103f8cb2872aced8/tests/slot-methods.lisp
lisp
(defclass test-class (standard-class) ()) (defmethod validate-superclass ((class test-class) (superclass standard-class)) t) (defclass test-object () ((slot :initform 5 :accessor a-slot)) (:metaclass test-class)) (mapc #'acknowledge-function '("SLOT-VALUE-USING-CLASS" "SLO...
fd19dcc89cfc44668792660208cb821c12b59078eada17fb7bd1c3098432d7b4
janestreet/async_kernel
monad_sequence.ml
(** [Monad_sequence.S] is a generic interface specifying functions that deal with a container and a monad. It is specialized to the [Deferred] monad and used with various containers in modules [Deferred.Array], [Deferred.List], [Deferred.Queue], and [Deferred.Sequence]. The [Monad_sequence.how] type speci...
null
https://raw.githubusercontent.com/janestreet/async_kernel/765ab511573166377eb3ed76ff069d6a4bdfb399/src/monad_sequence.ml
ocaml
* [Monad_sequence.S] is a generic interface specifying functions that deal with a container and a monad. It is specialized to the [Deferred] monad and used with various containers in modules [Deferred.Array], [Deferred.List], [Deferred.Queue], and [Deferred.Sequence]. The [Monad_sequence.how] type specifi...
open! Core open! Import type how = * like [ ` Max_concurrent_jobs Int.max_value ] | `Sequential * [ ` Sequential ] is often but not always the same as [ ` Max_concurrent_jobs 1 ] ( for example , they differ in the [ Or_error ] monad ) . (for example, they differ in the [Or_error] monad). *) | `Max_c...
455acebbaef9720dd5d04efc48cd02b23455a427ea1f2151cc632d8333611f6e
mirage/ocaml-git
store.mli
* Copyright ( c ) 2013 - 2017 < > * and < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVID...
null
https://raw.githubusercontent.com/mirage/ocaml-git/37f9d992ab8dfbf9089956b1b3f54c543978458d/src/git/store.mli
ocaml
open / single_write / close open / single_read / close unlink readdir / closedir * [close_pack_files t] closes all {!type:Mj.fd}. {b NOTE}: Any subsequent use of the [t] has undefined behavior! This function should be registered with [at_exit] to clean pending file-descriptors.
* Copyright ( c ) 2013 - 2017 < > * and < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVID...
47b8b4c333fe209ac8fb6a50b892a479df625b55b0378925d947bec878707373
soegaard/sketching
radial-gradient.rkt
#lang sketching (require racket/math) ; -docs/blob/master/content/examples/Basics/Color/RadialGradient/RadialGradient.pde Radial Gradient . Draws a series of concentric circles to create a gradient from one color to another . (define dim 1) (define (setup) (size 640 360) (:= dim (/ width 2)) (background...
null
https://raw.githubusercontent.com/soegaard/sketching/94e114ac6e92ede3b85481df755b673be24b226e/sketching-doc/sketching-doc/manual-examples/basics/color/radial-gradient.rkt
racket
-docs/blob/master/content/examples/Basics/Color/RadialGradient/RadialGradient.pde
#lang sketching (require racket/math) Radial Gradient . Draws a series of concentric circles to create a gradient from one color to another . (define dim 1) (define (setup) (size 640 360) (:= dim (/ width 2)) (background 0) (color-mode 'hsb 360 100 100) (no-stroke) (ellipse-mode 'radius) (backgrou...
32f2ff7911e5a709f9ac104fb28cdb2c5140ca2fcd2c95f947707b2f5d9f2fe6
philnguyen/soft-contract
maze2.rkt
#lang racket/base (require soft-contract/fake-contract) ;; Like "maze.sch", but avoids `set-car!' and `set-cdr!' by using ;; vectors for mutable records. MAZE -- Constructs a maze on a hexagonal grid , written by . ;------------------------------------------------------------------------------ ; Was file "rand...
null
https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/termination/r5rs-ish/maze2.rkt
racket
Like "maze.sch", but avoids `set-car!' and `set-cdr!' by using vectors for mutable records. ------------------------------------------------------------------------------ Was file "rand.scm". Minimal Standard Random Number Generator poker test (define (random n) (slop (modulo M n))) (let loop ((r ...
#lang racket/base (require soft-contract/fake-contract) MAZE -- Constructs a maze on a hexagonal grid , written by . Park & Miller , CACM 31(10 ) , Oct 1988 , 32 bit integer version . better constants , as proposed by Park . By Rehacked by Olin 4/1995 . One - armed ifs removed by 5/5/2010 (def...
1b711f0f629e01887ba4fee157a6ebbaabeda77d4ea4bfd50ee5fd844d5caf1f
jepsen-io/scylla
cas_register.clj
(ns scylla.cas-register "Linearizable, single-register operations backed by lightweight transactions." (:require [clojure [pprint :refer :all]] [clojure.tools.logging :refer [info]] [jepsen [client :as client] [checker :as checker] [generator ...
null
https://raw.githubusercontent.com/jepsen-io/scylla/a9aed0cb2d5e51301d4b354e29bfa5df5fad3752/src/scylla/cas_register.clj
clojure
Great, we're done Didn't exist, back off to insert
(ns scylla.cas-register "Linearizable, single-register operations backed by lightweight transactions." (:require [clojure [pprint :refer :all]] [clojure.tools.logging :refer [info]] [jepsen [client :as client] [checker :as checker] [generator ...
f6e242666e6627145f21544340dce04c5d3988c652f99f607b8c457483a59b81
hiratara/Haskell-Nyumon-Sample
chap05-samples-5-4-2-exSafeDiv.hs
module Main(main) where -- exSafeDiv.hs import qualified Control.Monad.Trans.Except as EX safeDiv :: Integer -> Integer -> EX.Except String Integer safeDiv k n | n == 0 = EX.throwE $ "Illegal division by zero. k:" ++ show k | otherwise = return (k `div` n) calc :: Integer -> Either String Integer calc...
null
https://raw.githubusercontent.com/hiratara/Haskell-Nyumon-Sample/ac52b741e3b96722f6fc104cfa84078e39f7a241/chap05-samples/chap05-samples-5-4-2-exSafeDiv.hs
haskell
exSafeDiv.hs
module Main(main) where import qualified Control.Monad.Trans.Except as EX safeDiv :: Integer -> Integer -> EX.Except String Integer safeDiv k n | n == 0 = EX.throwE $ "Illegal division by zero. k:" ++ show k | otherwise = return (k `div` n) calc :: Integer -> Either String Integer calc n = EX.runExcep...
65cb47a7572f9d01f11dc463903e6aadff72d9594b0e1eb9ec4f425a3cce1d14
cljfx/cljfx
shape.clj
(ns cljfx.fx.shape "Part of a public API" (:require [cljfx.composite :as composite] [cljfx.coerce :as coerce] [cljfx.lifecycle :as lifecycle] [cljfx.fx.node :as fx.node]) (:import [javafx.scene.shape Shape StrokeLineCap StrokeLineJoin StrokeType])) (set! *warn-on-reflection* t...
null
https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/src/cljfx/fx/shape.clj
clojure
(ns cljfx.fx.shape "Part of a public API" (:require [cljfx.composite :as composite] [cljfx.coerce :as coerce] [cljfx.lifecycle :as lifecycle] [cljfx.fx.node :as fx.node]) (:import [javafx.scene.shape Shape StrokeLineCap StrokeLineJoin StrokeType])) (set! *warn-on-reflection* t...
61dfff2d54f8ba41b6950f5d05c85aee16be44479c70d7771233f532ca3ae8ad
Guest0x0/pruning-tutor
MetaContext.ml
open Syntax module MetaMap = Map.Make(Int) let meta_count = ref 0 let metas : Value.meta_info MetaMap.t ref = ref (MetaMap.empty) let reset () = meta_count := 0; metas := MetaMap.empty let fresh_meta () = let m = !meta_count in incr meta_count; metas := MetaMap.add m Value.Free !metas; ...
null
https://raw.githubusercontent.com/Guest0x0/pruning-tutor/8c9d1d1b414175ca4803b8d7f9679f3e0a690f22/untyped-meta/MetaContext.ml
ocaml
open Syntax module MetaMap = Map.Make(Int) let meta_count = ref 0 let metas : Value.meta_info MetaMap.t ref = ref (MetaMap.empty) let reset () = meta_count := 0; metas := MetaMap.empty let fresh_meta () = let m = !meta_count in incr meta_count; metas := MetaMap.add m Value.Free !metas; ...
46771e1bfcce52280d1077a6e57e238d705af2243e0c30c6b00b50d0e2473c67
haskell-rewriting/term-rewriting
Parse.hs
-- This file is part of the 'term-rewriting' library. It is licensed under an MIT license . See the accompanying ' LICENSE ' file for details . -- Authors : # LANGUAGE FlexibleContexts # module Data.Rewriting.Substitution.Parse ( fromString, parse, parseIO ) where import Data.Rewriting.Utils.Parse (...
null
https://raw.githubusercontent.com/haskell-rewriting/term-rewriting/d01ee419f9fd3c2011d37b6417326a9373d5ee9c/src/Data/Rewriting/Substitution/Parse.hs
haskell
This file is part of the 'term-rewriting' library. It is licensed
under an MIT license . See the accompanying ' LICENSE ' file for details . Authors : # LANGUAGE FlexibleContexts # module Data.Rewriting.Substitution.Parse ( fromString, parse, parseIO ) where import Data.Rewriting.Utils.Parse (ident, lex, par) import Prelude hiding (lex) import qualified Data.Map a...
18145404fe73dc36187e243e4f9ecd8b966e96bfe36d8722746edcd71c4e0c82
sullyj3/buttplug-hs-core
Spec.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE DeriveGeneric # # LANGUAGE QuasiQuotes # # LANGUAGE BlockArguments # import Text.RawString.QQ import GHC.Generics import qualified Data.Map.Strict as Map import Test.Hspec import Test.Hspec.QuickCheck ( prop ) import ...
null
https://raw.githubusercontent.com/sullyj3/buttplug-hs-core/4d9a414fbfbf372d2cb28ee3fa2207d59071e972/test/Spec.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE DeriveGeneric # # LANGUAGE QuasiQuotes # # LANGUAGE BlockArguments # import Text.RawString.QQ import GHC.Generics import qualified Data.Map.Strict as Map import Test.Hspec import Test.Hspec.QuickCheck ( prop ) import Test.QuickCheck import ...
29dbfc80c2b2f1efe59f5f8e43b347f54c0fb190f0b811114c9081e506c0ba9e
jakemcc/sicp-study
ex2_62.clj
Exercise 2.62 ; Give an O(n) implementation of union-set ; representing sets as ordered lists (use 'clojure.test) (defn union-set [s1 s2] (cond (empty? s1) s2 (empty? s2) s1 :else (let [x1 (first s1) x2 (first s2)] (cond (= x1 x2) (cons x1 (union-set (rest s1) (rest...
null
https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section2.3/ex2_62.clj
clojure
Give an O(n) implementation of union-set representing sets as ordered lists
Exercise 2.62 (use 'clojure.test) (defn union-set [s1 s2] (cond (empty? s1) s2 (empty? s2) s1 :else (let [x1 (first s1) x2 (first s2)] (cond (= x1 x2) (cons x1 (union-set (rest s1) (rest s2))) (< x1 x2) (cons x1 (union-set (rest s1) s2)) ...
2566a7c0c77d074eeb0cbc3fa572bdb6eb1a13261a30db537bdfda9121eed94c
helium/miner
miner_keys.erl
-module(miner_keys). -include_lib("public_key/include/public_key.hrl"). -export([key_config/0, key_proplist_to_uri/1, key_uri_to_proplist/1, keys/0, keys/1, libp2p_to_gateway_key/1, print_keys/1]). -type key_configuration() :: {ecc, proplists:proplist()} | {file,...
null
https://raw.githubusercontent.com/helium/miner/fadfdf74ece9d3c515c03725d1c1c0f0e7c51abd/src/miner_keys.erl
erlang
signing and ecdh functions from either a file (for non-hardware NOTE: Do NOT call this after miner has started since this function will attempt to communicate directly with the ECC. Use only as part of startup or other miner-free scripts. The signing and ecdh functions will use an actual worker against a named p...
-module(miner_keys). -include_lib("public_key/include/public_key.hrl"). -export([key_config/0, key_proplist_to_uri/1, key_uri_to_proplist/1, keys/0, keys/1, libp2p_to_gateway_key/1, print_keys/1]). -type key_configuration() :: {ecc, proplists:proplist()} | {file,...