_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 |
|---|---|---|---|---|---|---|---|---|
ed20bf0d1593b13671884471daf706abfb5510e9820c384e8732a07f098ceeef | genenetwork/guix-bioinformatics | genenetwork.scm | ;; Bioinformatics module
(define-module (gn packages genenetwork)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system cargo)
#:use-module (guix build-system gn... | null | https://raw.githubusercontent.com/genenetwork/guix-bioinformatics/9e1e668e4f9f9e2b595620fda831da0525db4095/gn/packages/genenetwork.scm | scheme | Bioinformatics module
no 'setup.py test' really!
right now. Please keep it until we migrate to Python3 fully!
Test results vary based on the machine running them.
propagated for development purposes
probably superfluous
("r-phewas" ,r-phewas)
("genenetwork2-files-small" ,genenetwork2-files-small)
("pylmm-gn2" ... |
(define-module (gn packages genenetwork)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system cargo)
#:use-module (guix build-system gnu)
#:use-module (guix b... |
4a39d2c03a40d75082580210cf7f78a6cc44624bdae1f1046c0c547a722852b0 | phylogeography/spread | events.cljs | (ns shared.events
(:require [re-frame.core :refer [reg-event-db]]
[shared.subs]
[shared.utils :refer [map-map-vals]]))
(reg-event-db
:collapsible-tabs/toggle
(fn [db [_ tab-id]]
(println "Toggling" tab-id)
(let [tab-new-state (not (get-in db [:ui.collapsible-tabs/tabs tab-id]))
... | null | https://raw.githubusercontent.com/phylogeography/spread/56f3500e6d83e0ebd50041dc336ffa0697d7baf8/src/cljs/shared/events.cljs | clojure | this is so we don't overflow vertical space. | (ns shared.events
(:require [re-frame.core :refer [reg-event-db]]
[shared.subs]
[shared.utils :refer [map-map-vals]]))
(reg-event-db
:collapsible-tabs/toggle
(fn [db [_ tab-id]]
(println "Toggling" tab-id)
(let [tab-new-state (not (get-in db [:ui.collapsible-tabs/tabs tab-id]))
... |
4faff6589b81a3250c7297ac7e5126c9758b7c1253668c42662f7b8ef8ec6643 | quil/quil | state.cljc | (ns quil.snippets.state
(:require #?(:clj [quil.snippets.macro :refer [defsnippet]])
[quil.core :as q :include-macros true]
quil.snippets.all-snippets-internal)
#?(:cljs
(:use-macros [quil.snippets.macro :only [defsnippet]])))
(defsnippet set-state-state
["set-state!" "state"]
{:se... | null | https://raw.githubusercontent.com/quil/quil/1f214e712d834ede311fdc652eafe9cc0232c96e/src/cljc/quil/snippets/state.cljc | clojure | (ns quil.snippets.state
(:require #?(:clj [quil.snippets.macro :refer [defsnippet]])
[quil.core :as q :include-macros true]
quil.snippets.all-snippets-internal)
#?(:cljs
(:use-macros [quil.snippets.macro :only [defsnippet]])))
(defsnippet set-state-state
["set-state!" "state"]
{:se... | |
bdcf80bf6ec9fa47641159e338856035b50824a1501e6e81bbfa4ad9ad126fdf | lipas-liikuntapaikat/lipas | effects.cljs | (ns lipas.ui.effects
(:require
[re-frame.core :as re-frame]
[lipas.ui.routes :as routes]
["zipcelx$default" :as zipcelx]
["file-saver" :as filesaver]))
(re-frame/reg-fx
::reset-scroll!
(fn [_]
(js/window.scrollTo 0 0)))
(re-frame/reg-fx
::download-excel!
(fn [config]
(zipcelx (clj->js config... | null | https://raw.githubusercontent.com/lipas-liikuntapaikat/lipas/779934b723ec1e0cf52d6a7778b0b7e9f5d15c6b/webapp/src/cljs/lipas/ui/effects.cljs | clojure | (ns lipas.ui.effects
(:require
[re-frame.core :as re-frame]
[lipas.ui.routes :as routes]
["zipcelx$default" :as zipcelx]
["file-saver" :as filesaver]))
(re-frame/reg-fx
::reset-scroll!
(fn [_]
(js/window.scrollTo 0 0)))
(re-frame/reg-fx
::download-excel!
(fn [config]
(zipcelx (clj->js config... | |
d8097630c5c8876ecc67a44fde36bbb75ce34633679e3e3ab98e0fbc31061885 | avsm/ocaml-orm-sqlite | variant_nested.ml | TYPE_CONV_PATH "Variant_nested"
type n =
| Non of int64
| NTwo
| Nthree of string
| Nfour of x
and x =
| XONE
| Xtwo of n
| Xthree of int
and t = {
foo: x;
bar: n;
xyz: char;
} with orm
open OUnit
open Test_utils
let t1 = {foo = XONE; bar = Nfour (Xthree 34); xyz = 'a' }
let t2 = {foo = Xtwo (Nfo... | null | https://raw.githubusercontent.com/avsm/ocaml-orm-sqlite/0c41dee6e254abd75706edcb785f657bfe55d08b/lib_test/variant_nested.ml | ocaml | TYPE_CONV_PATH "Variant_nested"
type n =
| Non of int64
| NTwo
| Nthree of string
| Nfour of x
and x =
| XONE
| Xtwo of n
| Xthree of int
and t = {
foo: x;
bar: n;
xyz: char;
} with orm
open OUnit
open Test_utils
let t1 = {foo = XONE; bar = Nfour (Xthree 34); xyz = 'a' }
let t2 = {foo = Xtwo (Nfo... | |
418fd87751fffd9c94bd8f9c40c9d5a6805bd50b74e7337cb8488447e71745af | ocaml-ppx/ppx | attr.mli | (** Attribute hygiene *)
(** This module provides hygiene for attributes. The goal is to report misuses of
attributes to the user as soon as possible so that no mistyped attribute get silently
ignored. *)
open! Import
type ('context, 'payload) t
* Type of declared attribute .
The [ ' context ] type pa... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/src/attr.mli | ocaml | * Attribute hygiene
* This module provides hygiene for attributes. The goal is to report misuses of
attributes to the user as soon as possible so that no mistyped attribute get silently
ignored.
* Same as [declare] but the callback receives the location of the name of the
attribute.
* Gets the associated... |
open! Import
type ('context, 'payload) t
* Type of declared attribute .
The [ ' context ] type parameter describes where the attribute is expected and the
[ ' payload ] one what its payload should contain .
The ['context] type parameter describes where the attribute is expected and the
['payloa... |
5a00c3f2ca2701c538a53c930822c17fd38f0e6de448dec50010d2fec8fd44ae | emqx/emqx | emqx_authz_redis.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 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/emqx/emqx/394e8ab6a463580f02480e52cfbd876456cd2297/apps/emqx_authz/src/emqx_authz_redis.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 ) 2020 - 2023 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_authz_redis).
-include("emqx_authz.hrl").
-include_lib("emqx/include/emqx.hrl").
-... |
e2fe353a71d2e9ba798ffbbbabbc2578e159cbcbe0829e7a7fb64896fd1246d0 | mbutterick/aoc-racket | lang.rkt | #lang br/quicklang ;;
(provide read-syntax
(rename-out [mb #%module-begin]))
(define (read-syntax path port)
(strip-bindings
(let ([lines (string-split (port->string port) "\n")])
#`(module mod "lang.rkt"
#,(car lines)
#,@(for/list ([args (in-list (map string-split (cdr lines)))])... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2016/day21/lang.rkt | racket | (provide read-syntax
(rename-out [mb #%module-begin]))
(define (read-syntax path port)
(strip-bindings
(let ([lines (string-split (port->string port) "\n")])
#`(module mod "lang.rkt"
#,(car lines)
#,@(for/list ([args (in-list (map string-split (cdr lines)))])
`(inst ,... | |
a53d3f234e88986570060cc511745d2052b032893afbc74f2ebdaf88953ea276 | ferdinand-beyer/init | system_test.clj | (ns init.system-test
(:require [clojure.test :refer [deftest is testing]]
[init.config :as config]
[init.graph :as graph]
[init.errors :as errors]
[init.test-support.helpers :refer [thrown ex-info?]]
[init.system :as system]))
(def config
(-> {}
(co... | null | https://raw.githubusercontent.com/ferdinand-beyer/init/1c36af689cff6353e97534dd29961b3e5ad15fe0/test/init/system_test.clj | clojure | (ns init.system-test
(:require [clojure.test :refer [deftest is testing]]
[init.config :as config]
[init.graph :as graph]
[init.errors :as errors]
[init.test-support.helpers :refer [thrown ex-info?]]
[init.system :as system]))
(def config
(-> {}
(co... | |
3c609176d2eb236c0d6113655b0decea6de2607df60a0652b934f634b28f5b20 | lexi-lambda/eff | Reader.hs | module Control.Effect.Reader
( Reader(..)
, ask
, local
, runReader
) where
import Control.Effect.Base
| The @'Reader ' r@ effect provides access to a global environment of type @r@.
--
-- Handlers should obey the law @/f/ '<$>' 'ask'@ ≡ @'local' /f/ 'ask'@.
data Reader r :: Effect where
Ask :: Reader r... | null | https://raw.githubusercontent.com/lexi-lambda/eff/8c4df4bf54faf22456354be18095b14825be5e85/eff/src/Control/Effect/Reader.hs | haskell |
Handlers should obey the law @/f/ '<$>' 'ask'@ ≡ @'local' /f/ 'ask'@.
| Retrieves a value from the environment.
| Runs a subcomputation in an environment modified by the given function. | module Control.Effect.Reader
( Reader(..)
, ask
, local
, runReader
) where
import Control.Effect.Base
| The @'Reader ' r@ effect provides access to a global environment of type @r@.
data Reader r :: Effect where
Ask :: Reader r m r
Local :: (r1 -> r2) -> Eff (Reader r2 ': effs) a -> Reader r1 (Eff ef... |
09222f4133b2c0dfa8ce832205d6ac9fc97e5eab17494626e8945dadb59bcacb | nominolo/lambdachine | List.hs | # LANGUAGE NoImplicitPrelude , BangPatterns , CPP , MagicHash #
-----------------------------------------------------------------------------
-- |
-- Module : Data.List
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/libraries/base/Data/List.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.List
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : stable
Portability : portable
---------------------------------------------------------------------------
* Bas... | # LANGUAGE NoImplicitPrelude , BangPatterns , CPP , MagicHash #
Copyright : ( c ) The University of Glasgow 2001
Operations on lists .
module Data.List
(
: : ( a ) = > [ a ] - > a
: : ( a ) = > [ a ] - > a
: : ( a ) = > [ a ] - > a
: : ( a ) = > [ a ] - > a
, ... |
6f9c1a77fc757a9fadb0d32ad445053cca6529225ac29431465455965b793235 | maranget/hevea | colscan.mli | (***********************************************************************)
(* *)
(* HEVEA *)
(* *)
, projet , INRIA R... | null | https://raw.githubusercontent.com/maranget/hevea/226eac8c506f82a600d453492fbc1b9784dd865f/colscan.mli | ocaml | *********************************************************************
HEVEA
... | , projet , INRIA Rocquencourt
Copyright 2001 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
$ I d : colscan.mli , v 1.5 2001 - 05 - 25 12:37:20 maranget Exp $
exception Error of string
val one : Lexi... |
16eef4eace90408cf150503a96d9ff0ec02e2b3c8ddb83f10710b43329cc42f9 | janestreet/memtrace_viewer_with_deps | nice.ml | Based on -hull/loose-labels , which is based on " Nice numbers for
graph labels " in Graphics Gems , vol . 1 , modified to generate labels * inside * the given
bounds rather than outside them
graph labels" in Graphics Gems, vol. 1, modified to generate labels *inside* the given
bounds rather than outs... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/client/nice.ml | ocaml | Based on -hull/loose-labels , which is based on " Nice numbers for
graph labels " in Graphics Gems , vol . 1 , modified to generate labels * inside * the given
bounds rather than outside them
graph labels" in Graphics Gems, vol. 1, modified to generate labels *inside* the given
bounds rather than outs... | |
d91e1b58071d53164d48f96b84798a24ca175825bd89219ca6762b2aface7d70 | nasa/Common-Metadata-Repository | static.clj | (ns cmr.common-app.static
"This namespace contains helpers for generating and returning static
documentation pages for an application. This usually includes API
Documentation, Site Routes & Web Resources Documentation, and other web
resources that would take too long to generate at request time. It is
intende... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/a7ee1fd2a2c730e572739b92bdd7bd6c32924d8b/common-app-lib/src/cmr/common_app/static.clj | clojure | In namespace definition
In your routes
Utility Functions & Constants
Routing Setup
Static HTML resources, typically API documentation which needs endpoint URLs replaced.
Other values also need to be replaced since they are only known at run time, such as
the configured Generics to be documented.
Without a t... | (ns cmr.common-app.static
"This namespace contains helpers for generating and returning static
documentation pages for an application. This usually includes API
Documentation, Site Routes & Web Resources Documentation, and other web
resources that would take too long to generate at request time. It is
intende... |
06838f976bb7f48f2870770b694aecc9bf63d8369761db9b9b67a48535e3365b | ghilesZ/picasso | canvas.ko.ml | let build _render =
raise (Tools.BackendError "lablgtk2 not found on your system")
| null | https://raw.githubusercontent.com/ghilesZ/picasso/520e5dbfa12ad6e7db5f1c5eb40c18812ff099f3/src/backends/gtk/canvas.ko.ml | ocaml | let build _render =
raise (Tools.BackendError "lablgtk2 not found on your system")
| |
095abc7e020af289d314003497ab272796325abe4bbf59f65837b155b7e3d2eb | footprintanalytics/footprint-web | js_svg.clj | (ns metabase.pulse.render.js-svg
"Functions to render charts as svg strings by using graal's js engine. A bundle is built by `yarn build-static-viz`
which has charting library. This namespace has some wrapper functions to invoke those functions. Interop is very
strange, as the jvm datastructures, not just seriali... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/pulse/render/js_svg.clj | clojure | the bundle path goes through webpack. Changes require a `yarn build-static-viz`
the interface file does not go through webpack. Feel free to quickly change as needed and then re-require this
namespace to redef the `context`.
todo is this thread safe? Should we have a resource pool on top of this? Or create them fre... | (ns metabase.pulse.render.js-svg
"Functions to render charts as svg strings by using graal's js engine. A bundle is built by `yarn build-static-viz`
which has charting library. This namespace has some wrapper functions to invoke those functions. Interop is very
strange, as the jvm datastructures, not just seriali... |
6942f2ed740a0d1fa3a15c730e8a7d91de0178e745d76a21abe55c13d20178ae | metabase/metabase | bigquery_cloud_sdk_test.clj | (ns metabase.driver.bigquery-cloud-sdk-test
(:require
[clojure.core.async :as a]
[clojure.string :as str]
[clojure.test :refer :all]
[metabase.db.metadata-queries :as metadata-queries]
[metabase.driver :as driver]
[metabase.driver.bigquery-cloud-sdk :as bigquery]
[metabase.driver.bigquery-cloud-s... | null | https://raw.githubusercontent.com/metabase/metabase/7e3048bf73f6cb7527579446166d054292166163/modules/drivers/bigquery-cloud-sdk/test/metabase/driver/bigquery_cloud_sdk_test.clj | clojure | we don't care how many pages it took to load this dataset above. it will be a large
number because we're just tracking the number of times `get-query-results` gets invoked.
the `(sort-by)` above will cause the entire resultset to be realized, so
this only works if the timeout has been temporarily set to 0 (see abov... | (ns metabase.driver.bigquery-cloud-sdk-test
(:require
[clojure.core.async :as a]
[clojure.string :as str]
[clojure.test :refer :all]
[metabase.db.metadata-queries :as metadata-queries]
[metabase.driver :as driver]
[metabase.driver.bigquery-cloud-sdk :as bigquery]
[metabase.driver.bigquery-cloud-s... |
727fea18f617b743a40eb729f3b3524e6028a4dfddb490a898148f47e5c1bb31 | theodormoroianu/SecondYearCourses | HaskellChurchMonad_20210415122822.hs | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
An instance to show as regular Booleans
instance Show (CBool Bool) where
show b = show $ cIf b True False
The boolean constant true always chooses the first alternative
cTrue ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurchMonad_20210415122822.hs | haskell | The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply it on them.
A natural nu... | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
An instance to show as regular Booleans
instance Show (CBool Bool) where
show b = show $ cIf b True False
The boolean constant true always chooses the first alternative
cTrue ... |
da9f97a5eef9d565cb5866f680927b55259ec066d7e4ef0cb64fb9f4e8942c14 | robert-strandh/SICL | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-register-allocation
(:use #:common-lisp)
(:local-nicknames (#:arr #:sicl-register-arrangement)
(#:x86-64 #:sicl-x86-64-registers))
(:export #:do-register-allocation #:adapt-instruction))
| null | https://raw.githubusercontent.com/robert-strandh/SICL/bd3ec8f991d9455541d1629a3c672ae3d46dc16d/Code/Compiler/MIR-to-LIR/Register-allocation/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-register-allocation
(:use #:common-lisp)
(:local-nicknames (#:arr #:sicl-register-arrangement)
(#:x86-64 #:sicl-x86-64-registers))
(:export #:do-register-allocation #:adapt-instruction))
| |
bb5ddac25a1d2b45f1b9504aaa24cb75f725e4a03aa03425e8a82b1fde934814 | sgbj/MaximaSharp | trstlp.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.222 2010/10/08 03:05:30 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/cobyla/lisp/trstlp.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.222 2010/10/08 03:05:30 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rtoy Exp $ "
" ... |
33c06b155ede408102832c9735bec8277872db6eee01dc7516f607c832e8327e | ThatGeoGuy/chicken-miniKanren | absento-closure-tests.scm | (test-group "absento-clojure tests"
(test "absento 'closure-1a"
(run* (q) (absento 'closure q) (== q 'closure))
'())
(test "absento 'closure-1b"
(run* (q) (== q 'closure) (absento 'closure q))
'())
(test "absento 'closure-2a"
(run* (q) (fresh (a d) (== q 'closure) (absent... | null | https://raw.githubusercontent.com/ThatGeoGuy/chicken-miniKanren/4371396a8cb5798cd4d8a6ea42ba2587b2a77ed9/tests/absento-closure-tests.scm | scheme | (test "absento 'closure-3a"
(test "absento 'closure-3b" | (test-group "absento-clojure tests"
(test "absento 'closure-1a"
(run* (q) (absento 'closure q) (== q 'closure))
'())
(test "absento 'closure-1b"
(run* (q) (== q 'closure) (absento 'closure q))
'())
(test "absento 'closure-2a"
(run* (q) (fresh (a d) (== q 'closure) (absent... |
46c32c80e5fb3439728f2e7f9d14d4647386376e3514580d7169fcd7b351c89e | bsaleil/lc | ack.scm.scm | ;;------------------------------------------------------------------------------
Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst... | null | https://raw.githubusercontent.com/bsaleil/lc/ee7867fd2bdbbe88924300e10b14ea717ee6434b/tools/benchtimes/resultVMIL-lc-gsc-lc/LCnaive/ack.scm.scm | scheme | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Gabriel benchmarks
C benchmarks
Other benchmarks | Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst) `(vector ,@lst))
(def-macro (FLOATmake-vector n . init) `(make-vector ,... |
7ca47436b4c5e6c9d0785addd915dba6d4470b035f9e403970b17ac3950f505a | jarcane/heresy | random.rkt | #lang racket
(require racket/unsafe/ops
racket/generator)
(provide timer
randomize
rnd)
(define fxxor unsafe-fxxor)
(define fxrshift unsafe-fxrshift)
(define fxlshift unsafe-fxlshift)
(define fx* unsafe-fx*)
; timer
; a special internal variable that returns the current time in ms
(define... | null | https://raw.githubusercontent.com/jarcane/heresy/a736b69178dffa2ef97f5eb5204f3e06840088c2/private/random.rkt | racket | timer
a special internal variable that returns the current time in ms
(randomize [seed])
returns a new pseudorandom number generator function
method is the xorshift* algorithm
if seed is not provided, defaults to the current time in ms | #lang racket
(require racket/unsafe/ops
racket/generator)
(provide timer
randomize
rnd)
(define fxxor unsafe-fxxor)
(define fxrshift unsafe-fxrshift)
(define fxlshift unsafe-fxlshift)
(define fx* unsafe-fx*)
(define-syntax timer
(syntax-id-rules (timer) (timer (current-milliseconds))))
... |
f9816446b5f1b8ea38309ad0a7d8008f72896d63d5715449fd66483d0c8e0cbe | derekmcloughlin/pearls | chap12c.hs | import Data.Array
testData :: [Int]
testData = [51, 38, 29, 51, 63, 38]
ranking1 :: [Int]
ranking1 = [3, 1, 3, 0, 1]
ranking2 :: [Int]
ranking2 = [2, 0, 3, 4, 0]
(<<) :: Ord a => [a] -> [a] -> [Int]
xs << ys = rank (zip xs ys)
shiftBy :: Int -> [Int] -> [Int]
shiftBy k rs = map (+k) (drop k rs) ++ [k-1, k-2 .. 0]... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap12/chap12c.hs | haskell | import Data.Array
testData :: [Int]
testData = [51, 38, 29, 51, 63, 38]
ranking1 :: [Int]
ranking1 = [3, 1, 3, 0, 1]
ranking2 :: [Int]
ranking2 = [2, 0, 3, 4, 0]
(<<) :: Ord a => [a] -> [a] -> [Int]
xs << ys = rank (zip xs ys)
shiftBy :: Int -> [Int] -> [Int]
shiftBy k rs = map (+k) (drop k rs) ++ [k-1, k-2 .. 0]... | |
0c059327dbdeab344dac9347474b4df0c6dce8d722288efff5d47ea263d7ef2b | kakao/hbase-region-inspector | impl.clj | (ns hbase-region-inspector.hbase.impl
(:require [clojure.set :as set]
[hbase-region-inspector.util :as util]
[hbase-region-inspector.hbase.base :as base])
(:import org.apache.hadoop.hbase.client.HConnectionManager
org.apache.hadoop.hbase.client.HTable
org.apache.hadoop.... | null | https://raw.githubusercontent.com/kakao/hbase-region-inspector/333c4bddd4ed85cdc8b3d90138f2d1d0f32e275d/src/hbase-cdh4/hbase_region_inspector/hbase/impl.clj | clojure | -0.94.15-cdh4.7.1/apidocs/index.html
To start futures right away
Reverse key-value pairs and group by servers
Server -> region name -> region info
HServerLoad
byte[] -> RegionLoad
And we do not want to build maps with partial info | (ns hbase-region-inspector.hbase.impl
(:require [clojure.set :as set]
[hbase-region-inspector.util :as util]
[hbase-region-inspector.hbase.base :as base])
(:import org.apache.hadoop.hbase.client.HConnectionManager
org.apache.hadoop.hbase.client.HTable
org.apache.hadoop.... |
e114c0bcb197a10a6dfc1cf72ec80647ec6a2bff186921928c81a9ae2591156d | titola/incudine | polynomial.lisp | Copyright ( c ) 2013 - 2018
;;;
;;; 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 2 of the License , or
;;; (at your option) any later version.
;;;
;;; This program is distri... | null | https://raw.githubusercontent.com/titola/incudine/325174a54a540f4daa67bcbb29780073c35b7b80/src/gen/polynomial.lisp | lisp |
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(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... | Copyright ( c ) 2013 - 2018
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA
(in-package :incudine.gen)
(defun polynomial (coefficients &k... |
8b5491a3f0291280bb6af2c3419554d6f02f9f29be5472c7f148fab4835e1d6c | soarlab/FPTaylor | config.ml | (* ========================================================================== *)
: A Tool for Rigorous Estimation of Round - off Errors
(* *)
Author : , University of Utah
(* ... | null | https://raw.githubusercontent.com/soarlab/FPTaylor/efbbc83970fe3c9f4cb33fafbbe1050dd18749cd/config.ml | ocaml | ==========================================================================
==========================================================================
General par... | : A Tool for Rigorous Estimation of Round - off Errors
Author : , University of Utah
This file is distributed under the terms of the MIT license
let param_table = Hashtbl.create 100
let short_names = Hashtbl.create 100
let input_files_ref = ref... |
c6b006d85ff3cf57fc70affe3d672f402834a143b1e86f55a9cf6587ba7cc165 | DimaSamoz/mezzo | Transform.hs |
-----------------------------------------------------------------------------
-- |
-- Module : Mezzo.Render.Transform
-- Description : Score-level transformations
Copyright : ( c )
License : MIT
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- Functions and... | null | https://raw.githubusercontent.com/DimaSamoz/mezzo/13365da8907a714e34540f7a1d99898b67816cc9/src/Mezzo/Render/Transform.hs | haskell | ---------------------------------------------------------------------------
|
Module : Mezzo.Render.Transform
Description : Score-level transformations
Maintainer :
Stability : experimental
Portability : portable
Functions and combinators for transforming Scores. Allows for more flexibility,
but... |
Copyright : ( c )
License : MIT
module Mezzo.Render.Transform
(transpose, delay, (><), (+++), flatten, reprise, cascade, scale, volta)
where
import Mezzo.Render.Score
import Mezzo.Render.MIDI
import Codec.Midi hiding (key, Key)
import qualified Codec.Midi as CM (key, Key)
import Prelude hi... |
0a887a0d17fb6708d5dfcfad9ecf5b4a54a2d0a2f36cabe296ae1012e41bb6fd | CryptoKami/cryptokami-core | Options.hs | -- | Custom JSON serialisation options
module Pos.Wallet.Aeson.Options
( customOptions
, customOptionsWithTag
) where
import Universum
import Data.Aeson.TH (Options (..), SumEncoding (..), defaultOptions, defaultTaggedObject)
Let 's use something similar to this options one day
cus... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/wallet/src/Pos/Wallet/Aeson/Options.hs | haskell | | Custom JSON serialisation options
avoid encoding to plain string for enumeration types
allows to make newtypes trasparent for serialization |
module Pos.Wallet.Aeson.Options
( customOptions
, customOptionsWithTag
) where
import Universum
import Data.Aeson.TH (Options (..), SumEncoding (..), defaultOptions, defaultTaggedObject)
Let 's use something similar to this options one day
customOptions :: Options
customOptions =
... |
c938a59b9e04c46ac5d7dee358a93c742e5b2022272a3c44ff7ac97703b019ee | kupl/LearnML | patch.ml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (var : string)) : aexp =
match exp with
| Const a -> Const 0
| Var str -> if str = var then Const 1 else Const 0
| Power (str, a) ->
if str = var then Times [... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/diff/sub111/patch.ml | ocaml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((exp : aexp), (var : string)) : aexp =
match exp with
| Const a -> Const 0
| Var str -> if str = var then Const 1 else Const 0
| Power (str, a) ->
if str = var then Times [... | |
aaf002b7a8b9b2a0b85ee659a8f5e790a08dfa39123634e34aff689e6dd77375 | byorgey/diagrams-play | Issue37.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE NoMonomorphismRestriction #
{-# LANGUAGE TypeFamilies #-}
import Diagrams.Backend.Rasterific.CmdLine
import Diagrams.Prelude
main = defaultMain d
b = hcat' (with & sep .~ 0.2) [circle 1, mempty, mempty, mempty, circle 1]
d = b <> squ... | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/Issue37.hs | haskell | # LANGUAGE TypeFamilies # | # LANGUAGE FlexibleContexts #
# LANGUAGE NoMonomorphismRestriction #
import Diagrams.Backend.Rasterific.CmdLine
import Diagrams.Prelude
main = defaultMain d
b = hcat' (with & sep .~ 0.2) [circle 1, mempty, mempty, mempty, circle 1]
d = b <> square 1
b = mempty ||| circle 1
d = b < ... |
458ddef75e8ac13e240a3dbb5629483cdbd8290e7bf947a6eb1cb51c3095d8af | sru-systems/protobuf-simple | MessageDesc.hs | -- |
Module : Parser .
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
--
-- Message Descriptor type and functions.
module Parser.MessageDesc
( MessageDesc
, new
, getName
, addField
, addFields
, getFields
, addMessageDesc
, addMessageDes... | null | https://raw.githubusercontent.com/sru-systems/protobuf-simple/ee0f26b6a8588ed9f105bc9ee72c38943133ed4d/src/Parser/MessageDesc.hs | haskell | |
Message Descriptor type and functions. | Module : Parser .
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
module Parser.MessageDesc
( MessageDesc
, new
, getName
, addField
, addFields
, getFields
, addMessageDesc
, addMessageDescs
, getMessageDescs
, addEnumDesc
, a... |
8ccad0fe0fc0cd0eab4253b71078c569d0c4558344298bfb72b952bc2df0622d | ermine-language/ermine | Var.hs | # OPTIONS_GHC -fno - warn - missing - signatures #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleContexts #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE LiberalTypeSynonyms #
# LANGUAGE ScopedTypeVariables #
module Var where
import Control.Applicative
import Control.Monad
import Control.L... | null | https://raw.githubusercontent.com/ermine-language/ermine/bd58949ab56311be9e0d2506a900f3d77652566b/tests/properties/Var.hs | haskell | # LANGUAGE Rank2Types # | # OPTIONS_GHC -fno - warn - missing - signatures #
# LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleContexts #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE LiberalTypeSynonyms #
# LANGUAGE ScopedTypeVariables #
module Var where
import Control.Applicative
import Control.Monad
import Control.Lens
import Data.Binary
impor... |
bbc1cf9682a6ae4d593744d5bb1284435c2e8d7c000387e0f89d9f0d2a40e1d8 | runtimeverification/haskell-backend | SortInjection.hs | |
Module : . Attribute . SortInjection
Description : Sort injection symbol attribute
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Maintainer :
Module : Kore.Attribute.SortInjection
Description : Sort injection symbol attribute
Copyright : (c) Runti... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/src/Kore/Attribute/SortInjection.hs | haskell | | @SortInjection@ represents the @sortInjection@ attribute for symbols.
| Kore identifier representing the @sortInjection@ attribute symbol.
| Kore symbol representing the @sortInjection@ attribute.
| Kore pattern representing the @sortInjection@ attribute. | |
Module : . Attribute . SortInjection
Description : Sort injection symbol attribute
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Maintainer :
Module : Kore.Attribute.SortInjection
Description : Sort injection symbol attribute
Copyright : (c) Runti... |
885d5cf84688e41add8d1bf4e444a762faa3f3168c4e2d5e500a10c7c6a2368c | digital-asset/ghc | T13610.hs | # LANGUAGE MagicHash #
module T13610 where
import GHC.Prim
import GHC.Types
main = do
let primDouble = 0.42## :: Double#
let double = 0.42 :: Double
IO (\s -> mkWeakNoFinalizer# double () s)
| null | https://raw.githubusercontent.com/digital-asset/ghc/323dc6fcb127f77c08423873efc0a088c071440a/testsuite/tests/typecheck/should_fail/T13610.hs | haskell | # LANGUAGE MagicHash #
module T13610 where
import GHC.Prim
import GHC.Types
main = do
let primDouble = 0.42## :: Double#
let double = 0.42 :: Double
IO (\s -> mkWeakNoFinalizer# double () s)
| |
70be77856fa0fba91117f485e85cae5a6bb98ca37d039e952835641e80fb64b2 | basho/rebar | rebar_require_vsn.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2009 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this softw... | null | https://raw.githubusercontent.com/basho/rebar/cd55176009df794f506771fd574de9303ff2a42e/src/rebar_require_vsn.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2009 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the... |
f29dd72570efc355317c93dad4190d3cb77525d5edfb4bb5f453246fcdd43f6f | fbellomi/crossclj | ast.clj | Copyright ( c ) , Rich Hickey & contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be b... | null | https://raw.githubusercontent.com/fbellomi/crossclj/7630270ebe9ea3df89fe3d877b2571e6eae1062b/src/cloned/clojure/tools/analyzer/ast.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 ) , Rich Hickey & contributors .
(ns cloned.clojure.tools.analyzer.ast
"Utilities for AST walking/updating"
(:refer-clojure :exclude [unreduced])
(:require [cloned.clojure.tools.analyzer.utils :refer [into! rseqv mapv']]))
(defn cycling
"Combine the given passes in a single pass that will ... |
b6ac3dcdc4b1796a01ef8397e58e9a347b5c5f0908b7282e00775743256f7d40 | asivitz/Hickory | PostProcessing.hs | {-# LANGUAGE PatternSynonyms, DuplicateRecordFields #-}
# LANGUAGE QuasiQuotes , DerivingStrategies #
# LANGUAGE DataKinds , DeriveGeneric , , , OverloadedLabels #
module Hickory.Vulkan.PostProcessing where
import Acquire.Acquire (Acquire)
import Data.Generics.Labels ()
import Hickory.Vulkan.Material (withMaterial,... | null | https://raw.githubusercontent.com/asivitz/Hickory/2295504d3ba82054cc8b68db441b8e9f256ee5fa/core/Hickory/Vulkan/PostProcessing.hs | haskell | # LANGUAGE PatternSynonyms, DuplicateRecordFields # | # LANGUAGE QuasiQuotes , DerivingStrategies #
# LANGUAGE DataKinds , DeriveGeneric , , , OverloadedLabels #
module Hickory.Vulkan.PostProcessing where
import Acquire.Acquire (Acquire)
import Data.Generics.Labels ()
import Hickory.Vulkan.Material (withMaterial, pipelineDefaults)
import Hickory.Vulkan.Framing (Framed... |
05b57e6040a071ba671cba2b3eb8e1fb3152501be43439345f32cef02362fc56 | mzp/coq-ruby | csdpcert.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/micromega/csdpcert.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
: A reflexive tactic usin... |
9e05a342ef3c37874ae857b5c17dfdac27caf0ccd5589a058c9188054512a896 | caisah/sicp-exercises-and-examples | withdraw.scm | (define (make-withdraw balance)
(lambda (amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds")))
(define withdraw (make-withdraw 100))
(withdraw 10)
| null | https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/3.2.3-frames_as_the_repository_of_local_state/withdraw.scm | scheme | (define (make-withdraw balance)
(lambda (amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds")))
(define withdraw (make-withdraw 100))
(withdraw 10)
| |
6d45d4824d7fa4d7ef708887dc67a22a43ae47f4a4d6a0a2d8bb86c5f24d0269 | camllight/camllight | hashtbl.ml | (* Hash tables *)
#open "exc";;
#open "int";;
#open "eq";;
#open "fvect";;
(* We do dynamic hashing, and resize the table and rehash the elements
when buckets become too long. *)
type ('a, 'b) t =
{ mutable max_len: int; (* max length of a bucket *)
mutable data: ('a, 'b) bucketlist vect ... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/src/lib/hashtbl.ml | ocaml | Hash tables
We do dynamic hashing, and resize the table and rehash the elements
when buckets become too long.
max length of a bucket
the buckets
preserve original order of elements |
#open "exc";;
#open "int";;
#open "eq";;
#open "fvect";;
type ('a, 'b) t =
and ('a, 'b) bucketlist =
Empty
| Cons of 'a * 'b * ('a, 'b) bucketlist
;;
let new initial_size =
if initial_size <= 0 then invalid_arg "hashtbl__new" else
{ max_len = 3; data = make_vect initial_size Empty }
;;
let clear h =
for... |
5bc0e41ded6abdad5272fe04a9cabe3f7f0e09c07ac654219eabcb42fa57538e | biocaml/phylogenetics | phylogenetic_tree.mli | (** Module for phylogenetic trees. *)
(** {5 Types} *)
(** Type for evolutionary trees: binary trees
whose edges are labelled with lengths (floats)
and whose leaves are labelled with sequence indexes (strings)*)
type t =
| Node of {meta:metadata; left:branch; right:branch}
| Leaf of {meta:metadata; index:... | null | https://raw.githubusercontent.com/biocaml/phylogenetics/b58dee1fb3419666cee3e368b37b3b375976a9b7/lib/phylogenetic_tree.mli | ocaml | * Module for phylogenetic trees.
* {5 Types}
* Type for evolutionary trees: binary trees
whose edges are labelled with lengths (floats)
and whose leaves are labelled with sequence indexes (strings) |
type t =
| Node of {meta:metadata; left:branch; right:branch}
| Leaf of {meta:metadata; index:Sigs.index}
and branch = float * t
and metadata = {id:int; routing_no:int}
* { 5 Creation / Conversion }
val of_preorder: string -> t
val of_newick: string -> t
val of_newick_file: string -> t
val make_random: int ... |
0ca1005b993a8bddedd2953d434a695d8cab7086765b35daa990db305e1405a7 | haskell/c2hs | State.hs | Compiler Toolkit : compiler state management
--
Author :
Created : 2 November 95
--
Copyright ( c ) [ 1995 .. 1999 ]
--
-- This file 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 ; eith... | null | https://raw.githubusercontent.com/haskell/c2hs/bb7079f4bf3ca4af00f6178d05a8da9238ddff7c/src/Control/State.hs | haskell |
This file is free software; you can redistribute it and/or modify
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Publ... | Compiler Toolkit : compiler state management
Author :
Created : 2 November 95
Copyright ( c ) [ 1995 .. 1999 ]
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
language : 98
readCST, writ... |
9d63657ebedf6fbd3c7266856fd6bc1cd1c9077f26d116a5e2b55b39dc9de8a3 | static-analysis-engineering/codehawk | jCHXClassInvariants.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchstac/jCHXClassInvariants.ml | ocaml | chutil
jchlib
jchpre
jchsys | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... |
98ba40998f2f10e81cfa53a0387a89441c412f369c6dca782ef9e32ddba59c38 | Stand-In-Language/stand-in-language | SerializerBench.hs | # LANGUAGE StandaloneDeriving #
module Main where
import Control.DeepSeq
import Data.Char
import qualified Data.Vector.Storable as S
import Foreign.Marshal.Alloc
import Criterion.Main
import Criterion.Measurement
import Criterion.Types
import ... | null | https://raw.githubusercontent.com/Stand-In-Language/stand-in-language/8182260961bbc794f6910abbfb7d2426cabfa34d/bench/SerializerBench.hs | haskell | # LANGUAGE StandaloneDeriving #
module Main where
import Control.DeepSeq
import Data.Char
import qualified Data.Vector.Storable as S
import Foreign.Marshal.Alloc
import Criterion.Main
import Criterion.Measurement
import Criterion.Types
import ... | |
01446b21cb3bfde9d3f430d2ba810315175d765acb85e095f3f6c84dc2a86e1a | bazqux/bazqux-urweb | JSON.hs | {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
-- |
-- Module: Network.Riak.JSON
Copyright : ( c ) 2011 MailRank , Inc.
License : Apache
Maintainer : < > , < >
-- Stability: experimental
-- Portability: portable
--
-- This module allows storage and retrieval of JSON-encode... | null | https://raw.githubusercontent.com/bazqux/bazqux-urweb/bf2d5a65b5b286348c131e91b6e57df9e8045c3f/crawler/Lib/riak-0.7.2.0/src/Network/Riak/JSON.hs | haskell | # LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #
|
Module: Network.Riak.JSON
Stability: experimental
Portability: portable
This module allows storage and retrieval of JSON-encoded data.
The functions in this module do not perform any conflict resolution.
^ Unwrap a 'JSON'-wrapped value.
| Wr... |
Copyright : ( c ) 2011 MailRank , Inc.
License : Apache
Maintainer : < > , < >
module Network.Riak.JSON
(
JSON
, json
, plain
, get
, getMany
, put
, put_
, putMany
, putMany_
) where
import Control.Arrow (first)
import Data.Aeson.Types (FromJSON(..... |
8019ef40924a93dab83286898571d59f8c3a233e80c89d0d941efdb3a6ed6ddd | dparis/gen-phzr | keyboard.cljs | (ns phzr.keyboard
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser])
(:refer-clojure :exclude [update]))
(defn ->Keyboard
"The Keyboard class monitors keyboard input and dispatches keyboard events.
_Be aware_ that many keyboards... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/keyboard.cljs | clojure | ` | (ns phzr.keyboard
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser])
(:refer-clojure :exclude [update]))
(defn ->Keyboard
"The Keyboard class monitors keyboard input and dispatches keyboard events.
_Be aware_ that many keyboards... |
4403eda802a7950bf1ffff5f9fd73a2d8529c72c39d5c90e3e4be35c43dbbd7b | TDacik/Deadlock | trace_utils_test.ml | open Unit_tests_top
open Trace_utils
open Callstack
let cs1 =
Callstack.push_thread_entry thread1
|> Callstack.push_action stmt1 "a1"
let cs2 =
Callstack.push_thread_entry thread2
|> Callstack.push_call stmt2 fn1
|> Callstack.push_action stmt1 "a1"
let cs2' = [Action (stmt1, "a1")]
let cs3 =
Callstack... | null | https://raw.githubusercontent.com/TDacik/Deadlock/1b9965c04416885678b5ba7712960412193fd8e1/src/unit_tests/utils/trace_utils_test.ml | ocaml | ==== Unit tests ==== | open Unit_tests_top
open Trace_utils
open Callstack
let cs1 =
Callstack.push_thread_entry thread1
|> Callstack.push_action stmt1 "a1"
let cs2 =
Callstack.push_thread_entry thread2
|> Callstack.push_call stmt2 fn1
|> Callstack.push_action stmt1 "a1"
let cs2' = [Action (stmt1, "a1")]
let cs3 =
Callstack... |
8ae11db2674e3b25788b77d5c5bf4a034f536737be8850bd503ee15b88e7a4ef | slindley/effect-handlers | HANSEI.hs | # LANGUAGE TypeFamilies , RankNTypes ,
MultiParamTypeClasses , FlexibleInstances , GADTs ,
OverlappingInstances , UndecidableInstances , QuasiQuotes ,
FlexibleContexts , ConstraintKinds #
MultiParamTypeClasses, FlexibleInstances, GADTs,
OverlappingInstances, UndecidableInstances, QuasiQuotes,
... | null | https://raw.githubusercontent.com/slindley/effect-handlers/39d0d09582d198dd6210177a0896db55d92529f4/Examples/HANSEI.hs | haskell | deriving Show
dist' :: [(Prob, a)] -> P' a
dist' [] = failure
dist' l =
do
i <- dice (map fst l)
return $ snd (l !! i)
In a monadic setting we must make boolean short circuit evaluation
explicit
type Q' a = forall h.(DistFail h, h `PolyHandles` Stop a) => Comp h a
what's this for?
clause Rand k ... | # LANGUAGE TypeFamilies , RankNTypes ,
MultiParamTypeClasses , FlexibleInstances , GADTs ,
OverlappingInstances , UndecidableInstances , QuasiQuotes ,
FlexibleContexts , ConstraintKinds #
MultiParamTypeClasses, FlexibleInstances, GADTs,
OverlappingInstances, UndecidableInstances, QuasiQuotes,
... |
94001946d51bd2432534a34a88429308ad6d356d6b201fafa4d52067f07a5fe2 | lixiangqi/medic | find-path-medic.rkt | #lang medic
(layer left-path
(in #:module "find-path.rkt"
[at (if left-p _ _) [on-entry (log "left branch: ~a, ~a" (cadr t) left-p)]]))
(layer right-path
(in #:module "find-path.rkt"
[at (if right-p _ _) [on-entry (log "right branch: ~a, ~a" (caddr t) right-p)]]))
| null | https://raw.githubusercontent.com/lixiangqi/medic/0920090d3c77d6873b8481841622a5f2d13a732c/demos/find-path/find-path-medic.rkt | racket | #lang medic
(layer left-path
(in #:module "find-path.rkt"
[at (if left-p _ _) [on-entry (log "left branch: ~a, ~a" (cadr t) left-p)]]))
(layer right-path
(in #:module "find-path.rkt"
[at (if right-p _ _) [on-entry (log "right branch: ~a, ~a" (caddr t) right-p)]]))
| |
469fae6bcc745700d4a77253670212c538fc5784d9f0005ba40634860097b5ff | commercialhaskell/rio | Unsafe.hs | -- | Unoxed @Vector@ unsafe functions. These perform no bounds
-- checking, and may cause segmentation faults etc.! Import as:
--
> import qualified RIO.Vector . Unoxed . Unsafe as VU '
module RIO.Vector.Unboxed.Unsafe
(
-- * Accessors
-- ** Indexing
Data.Vector.Unboxed.unsafeIndex
, Data.Vector.Unboxe... | null | https://raw.githubusercontent.com/commercialhaskell/rio/4eba306d37a60a20f0bed27f40afc23a7c892c40/rio/src/RIO/Vector/Unboxed/Unsafe.hs | haskell | | Unoxed @Vector@ unsafe functions. These perform no bounds
checking, and may cause segmentation faults etc.! Import as:
* Accessors
** Indexing
** Monadic indexing
** Extracting subvectors
* Modifying vectors
** Bulk updates
** Accumulations
** Permutations
* Conversions
** Mutable vectors | > import qualified RIO.Vector . Unoxed . Unsafe as VU '
module RIO.Vector.Unboxed.Unsafe
(
Data.Vector.Unboxed.unsafeIndex
, Data.Vector.Unboxed.unsafeHead
, Data.Vector.Unboxed.unsafeLast
, Data.Vector.Unboxed.unsafeIndexM
, Data.Vector.Unboxed.unsafeHeadM
, Data.Vector.Unboxed.unsafeLastM
, Data... |
6554865892ed33ac638b4bba28f0f3ced936f0f4a3917dfeffcaf30e01a7ebce | cddr/edn-avro | edn_avro_test.clj | (ns cddr.edn-avro-test
(:require
[clojure.test :refer :all]
[cddr.edn-avro :as ea])
(:import
(org.apache.avro.generic GenericData$Record)
(io.confluent.kafka.serializers KafkaAvroSerializer KafkaAvroDeserializer)
(io.confluent.kafka.schemaregistry.client MockSchemaRegistryClient)))
(deftest test-kaf... | null | https://raw.githubusercontent.com/cddr/edn-avro/819006b058c2d0dcb8a497174985159ec679b30b/test/cddr/edn_avro_test.clj | clojure | (ns cddr.edn-avro-test
(:require
[clojure.test :refer :all]
[cddr.edn-avro :as ea])
(:import
(org.apache.avro.generic GenericData$Record)
(io.confluent.kafka.serializers KafkaAvroSerializer KafkaAvroDeserializer)
(io.confluent.kafka.schemaregistry.client MockSchemaRegistryClient)))
(deftest test-kaf... | |
6420326cc2ca810c9a456748944e2e7b954543745c3a314c396a9bf3b9b08428 | ruricolist/core-lisp | core-lisp.lisp | (in-package :core-lisp)
(cl:defun get-alias (name namespace env)
(cl:or (cl:cadr (cl:assoc name (macroexpand namespace env)))
(get name namespace)))
(cl:defun eget-alias (name namespace kind env)
(cl:or (cl:cadr (cl:assoc name (macroexpand namespace env)))
(get name namespace)
(cl:error... | null | https://raw.githubusercontent.com/ruricolist/core-lisp/1ea73b65a7de8abb608c253134b1b8e617018063/core-lisp.lisp | lisp | Use the compile-time version if the form is constant.
(declare (dynamic-extent initargs)) | (in-package :core-lisp)
(cl:defun get-alias (name namespace env)
(cl:or (cl:cadr (cl:assoc name (macroexpand namespace env)))
(get name namespace)))
(cl:defun eget-alias (name namespace kind env)
(cl:or (cl:cadr (cl:assoc name (macroexpand namespace env)))
(get name namespace)
(cl:error... |
2d67603dd903b9772834dad1f3463fa7a1b64db76496c811a1e12d3edb79c2c4 | jamesdabbs/pi-base.hs | Space.hs | module Model.Space
( spaceTraitMap
, spaceTraits
, spaceUnknownProperties
, spaceDelete
) where
import Import
import qualified Data.Set as S
import qualified Data.Map as M
import Model.Revision
spaceTraitMap :: SpaceId -> Set PropertyId -> Handler (TraitMap PropertyId)
spaceTraitMap sid ps = do
ets <- runDB $ sel... | null | https://raw.githubusercontent.com/jamesdabbs/pi-base.hs/1c7cb1f87c6525bd4844842b3f9442634f8dccd3/Model/Space.hs | haskell | module Model.Space
( spaceTraitMap
, spaceTraits
, spaceUnknownProperties
, spaceDelete
) where
import Import
import qualified Data.Set as S
import qualified Data.Map as M
import Model.Revision
spaceTraitMap :: SpaceId -> Set PropertyId -> Handler (TraitMap PropertyId)
spaceTraitMap sid ps = do
ets <- runDB $ sel... | |
8720f1b33d5a38211525eae292ce879c0f4415fac27f3151a84658d96338b461 | SAP-archive/bosh-kubernetes-cpi-release | State.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module CPI.Kubernetes.Resource.Stub.State(
KubeState(..)
, ResourceMap
, HasPods(..)
, HasSecrets(..)
, HasServices(..)
, HasPVCs(..)
, emptyKube
, StubCon... | null | https://raw.githubusercontent.com/SAP-archive/bosh-kubernetes-cpi-release/3166a74e118e75bbdedb01cff72cbe52968eee62/src/bosh-kubernetes-cpi/src/CPI/Kubernetes/Resource/Stub/State.hs | haskell | # LANGUAGE FlexibleContexts # | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module CPI.Kubernetes.Resource.Stub.State(
KubeState(..)
, ResourceMap
, HasPods(..)
, HasSecrets(..)
, HasServices(..)
, HasPVCs(..)
, emptyKube
, StubConfig(..)
, HasImages(..)
, emptyStub... |
1c549ad7b7463b73e183cd6bcc30d3aadee14530ce570f7113fc09ea5a75df2a | geophf/1HaskellADay | Solution.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2020.M11.D20.Solution where
-
Okay , so we created folders , and , hypothetically , we can even create sub-
folders , if we wished , but , today , instead of building on this folder-
skeleton , we 're going to focus on just one country and its airbases .
Which count... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2020/M11/D20/Solution.hs | haskell | # LANGUAGE OverloadedStrings #
}
for Country capitals
for Down
-
>>> A.loadBases (A.workingDir ++ A.file)
>>> let bases = A.byICAO it
-
}
--- AND NOW! To the mapping-on-a-globe-work!
}
} |
module Y2020.M11.D20.Solution where
-
Okay , so we created folders , and , hypothetically , we can even create sub-
folders , if we wished , but , today , instead of building on this folder-
skeleton , we 're going to focus on just one country and its airbases .
Which country ?
Let 's find out .
Today ... |
dfc179f1aeae922554b5b95da48ccec4d6e99b2be1b8e53535e0791cba902911 | steshaw/PLAR | combining.ml | (* ========================================================================= *)
(* Nelson-Oppen combined decision procedure. *)
(* *)
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
(* =... | null | https://raw.githubusercontent.com/steshaw/PLAR/c143b097d1028963f4c1d24f45a1a56c8b65b838/combining.ml | ocaml | =========================================================================
Nelson-Oppen combined decision procedure.
=========================================================================
---------------... | Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
let real_lang =
let fn = ["-",1; "+",2; "-",2; "*",2; "^",2]
and pr = ["<=",2; "<",2; ">=",2; ">",2] in
(fun (s,n) -> n = 0 & is_numeral(Fn(s,[])) or mem (s,n) fn),
(fun sn -> mem sn pr),
(fun fm -> real_qelim(generalize fm) = True)... |
13820dffa03b817560d5e6dc855307839cc83673990b216be6e0d12600f42652 | OCADml/OSCADml | debug.ml | open OCADml
let show_path2 f path =
Scad.union (List.mapi (fun i p -> Scad.translate (V3.of_v2 p) (f i)) path)
let show_path3 f path = Scad.union (List.mapi (fun i p -> Scad.translate p (f i)) path)
let[@inline] show_mesh f mesh = show_path3 f @@ Mesh.points mesh
| null | https://raw.githubusercontent.com/OCADml/OSCADml/8bbee42973aeeee0998d172de438fa21d3bbeda8/lib/debug.ml | ocaml | open OCADml
let show_path2 f path =
Scad.union (List.mapi (fun i p -> Scad.translate (V3.of_v2 p) (f i)) path)
let show_path3 f path = Scad.union (List.mapi (fun i p -> Scad.translate p (f i)) path)
let[@inline] show_mesh f mesh = show_path3 f @@ Mesh.points mesh
| |
a8f04899a44e2ea9b33a5276ae3a381299310a163336fa745610a103413ac4a7 | dradtke/Lisp-Text-Editor | subclass.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; gtype.lisp --- GType functions
;;;
Copyright ( C ) 2007 , < >
;;;
(in-package #:g-object-cffi)
(defcstruct g-type-info
"GTypeInfo"
(class-size :uint16)
(base-init :pointer) ; GBaseInitFunc
(base-finalize :pointer) ; GBaseFinalizeFunc
(class-init... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/gtk-cffi-20120208-cvs/g-object/subclass.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
gtype.lisp --- GType functions
GBaseInitFunc
GBaseFinalizeFunc
GClassInitFunc
GClassFinalizeFunc
== null
GTypeValueTable* == null
GInterfaceFinalizeFunc | Copyright ( C ) 2007 , < >
(in-package #:g-object-cffi)
(defcstruct g-type-info
"GTypeInfo"
(class-size :uint16)
(instance-size :uint16)
(n-preallocs :uint16)
GInstanceInitFunc
(defcenum g-type-flags
"GTypeFlags"
(:abstract 16)
:value-abstract)
(defcfun g-type-register-static g-type
... |
477b1654909ac60de071c7274ab1e593476a872ce2bc531a1b74b2244b7e70c9 | prg-titech/Kani-CUDA | mulmat.rkt | #lang rosette
(require "../../lang.rkt")
(provide mulmat)
(define (mulmat A B C SIZE file)
(:= int bdimx (block-dim 0))
(:= int BLOCKSIZE (*/LS (block-dim 0) (block-dim 1)))
(:= int row (+/LS (*/LS (block-dim 1) (block-idx 1)) (thread-idx 1)))
(:= int col (+/LS (*/LS (block-dim 0) (block-idx 0)) (thread-idx ... | null | https://raw.githubusercontent.com/prg-titech/Kani-CUDA/e97c4bede43a5fc4031a7d2cfc32d71b01ac26c4/Emulator/Examples/Matrixmultiply/mulmat.rkt | racket | (:shared int Bs[BLOCKSIZE])
desired: trow * bdimx + k | #lang rosette
(require "../../lang.rkt")
(provide mulmat)
(define (mulmat A B C SIZE file)
(:= int bdimx (block-dim 0))
(:= int BLOCKSIZE (*/LS (block-dim 0) (block-dim 1)))
(:= int row (+/LS (*/LS (block-dim 1) (block-idx 1)) (thread-idx 1)))
(:= int col (+/LS (*/LS (block-dim 0) (block-idx 0)) (thread-idx ... |
6768efaea89a415a3d4b559fa6c7a31c4a0bced3513f40c938ac63cb14bb83b2 | kappelmann/engaging-large-scale-functional-programming | Types.hs | module Types where
-- type definitions
type EName = String
type Name = EName -- change as you like
data Polarity = Pos | Neg
deriving Eq
data ELiteral = Literal Polarity EName
deriving Eq
type Literal = ELiteral -- change as you like
type EClause = [ELiteral]
type Clause = EClause -- change as you like
type EConj... | null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/c3fd53e1ca7f36a79b0f808c83aae87270e84999/resources/resolution/solution/src/Types.hs | haskell | type definitions
change as you like
change as you like
change as you like
change as you like
change as you like
change as you like
change as you like
change as you like
change as you like
change as you like
adapt the following if you changed the internal data types above | module Types where
type EName = String
data Polarity = Pos | Neg
deriving Eq
data ELiteral = Literal Polarity EName
deriving Eq
type EClause = [ELiteral]
type EConjForm = [EClause]
type Key = Int
type EKeyClause = (Key, EClause)
type EKeyConjForm = [EKeyClause]
data EResolve = Resolve EName Key Key
deriving (... |
51e510deb6a2f1639f1624a6ca575b5bace53e23715dafb201e62b2e88639b3a | ajnsit/wai-routes | Main.hs | module Main where
A demonstration of using only " unrouted " handlers , without any TH
Requires no GHC extensions
Requires no Template Haskell or quasiquotes
Can not have a Master Site argument
Requires no Routing code
To see a more complex example of mixing unrouted and routed handlers , see ... | null | https://raw.githubusercontent.com/ajnsit/wai-routes/4d6b240af57a95353373ddba81c4905db0234459/examples/unrouted/src/Main.hs | haskell | Run the application
Global state
We create a global vault key to store the counter
This key is only created once when the application starts
Run the app
Handlers (like routes) are cascaded
global processing (such as incrementing the counter on every request)
Increment the global counter
Insert the key in the... | module Main where
A demonstration of using only " unrouted " handlers , without any TH
Requires no GHC extensions
Requires no Template Haskell or quasiquotes
Can not have a Master Site argument
Requires no Routing code
To see a more complex example of mixing unrouted and routed handlers , see ... |
e09a30946dd4cd1b37cac0330d04d66c9bb95b48783699ade8b5d81cfcd967e5 | awolven/cl-vulkan | macros.lisp | Copyright 2019 , 2020
;;
;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
;; without limitation the rights to use, copy, modify, merge, publish,
d... | null | https://raw.githubusercontent.com/awolven/cl-vulkan/5d4744025c25a7aae4c455e53efc74c95a10d4e3/src/macros.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS OR IMPLIE... | Copyright 2019 , 2020
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Software .
THE ... |
af90317901ff68260c4096382896563b7070ef173eb1233e79c1a0142c746141 | angavrilov/cl-linux-debug | fields.lisp | ;;; -*- mode: Lisp; indent-tabs-mode: nil; -*-
(in-package :cl-linux-debug.data-info)
;; Access generics
(defparameter *in-@-funcall* nil)
(defgeneric @ (obj key) ; lvalue
(:method ((obj function) key)
(let ((*in-@-funcall* t))
(funcall obj key)))
(:method ((obj list) key) (assert nil))
(:method (ob... | null | https://raw.githubusercontent.com/angavrilov/cl-linux-debug/879da2dcd14918bb8ffab003e934f4b01fba12ff/data-info/fields.lisp | lisp | -*- mode: Lisp; indent-tabs-mode: nil; -*-
Access generics
lvalue
rvalue
Save readtable
Symbol management
Running eval for every identifier turns out to be very slow
Types
Reader
.name
[...]
error
fallback |
(in-package :cl-linux-debug.data-info)
(defparameter *in-@-funcall* nil)
(:method ((obj function) key)
(let ((*in-@-funcall* t))
(funcall obj key)))
(:method ((obj list) key) (assert nil))
(:method (obj (key list)) (assert nil))
(:method :around ((obj list) key)
(mapcan (lambda (x) (ensure-lis... |
5d43e7cab241aa3e609f55dd7f8abbc1cf0ed5a26aecb8b6611d30e812330803 | lspitzner/exference | Foldable.hs | module Data.Foldable where
class Foldable t where
fold :: Data.Monoid.Monoid m => t m -> m
foldMap :: Data.Monoid.Monoid m => (a -> m) -> t a -> m
foldr :: (a -> b -> b) -> b -> t a -> b
foldl :: (b -> a -> b) -> b -> t a -> b
asum :: (Foldable t, Control.Applicative.Alternative f)
=> t (f a)
-> f... | null | https://raw.githubusercontent.com/lspitzner/exference/d8a336f8b9df905e54173339f78ba892daa3f688/environment/Foldable.hs | haskell | instance Foldable (Proxy *) | module Data.Foldable where
class Foldable t where
fold :: Data.Monoid.Monoid m => t m -> m
foldMap :: Data.Monoid.Monoid m => (a -> m) -> t a -> m
foldr :: (a -> b -> b) -> b -> t a -> b
foldl :: (b -> a -> b) -> b -> t a -> b
asum :: (Foldable t, Control.Applicative.Alternative f)
=> t (f a)
-> f... |
20e5a24a20a8b5ebecf5d0ad8f3ba9ccf1487e58dcd9f858088839b5a4eef7e3 | dbuenzli/ptime | testing.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 The ptime programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c)... | null | https://raw.githubusercontent.com/dbuenzli/ptime/119855a330424914fdccce82e5bf7b111e64bab8/test/testing.ml | ocaml | Value equality and pretty printing
Pretty printers
bof...
Assertion counters
Logging
Testing scopes
Passing and failing tests
Checking values
Tracing and checking function applications.
Gathers information about the application
fail_count checkpoint when the app starts | ---------------------------------------------------------------------------
Copyright ( c ) 2015 The ptime programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c)... |
6579f35816175be262d2a96b55acfb3f6c3f551c2b152867066c37c5d0cb82fd | awakesecurity/spectacle | Day.hs | # LANGUAGE TupleSections #
{-# OPTIONS_HADDOCK show-extensions #-}
-- |
-- Module : Control.Applicative.Day
Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see LICENSE
--
-- Stability : stable
Portability : non - portable ( GHC extensions )
--
Cayley applic... | null | https://raw.githubusercontent.com/awakesecurity/spectacle/430680c28b26dabb50f466948180eb59ba72fc8e/src/Control/Applicative/Day.hs | haskell | # OPTIONS_HADDOCK show-extensions #
|
Module : Control.Applicative.Day
Stability : stable
=== References
@since 1.0.0
---------------------------------------------------------------------------------------------------------------------
| Cayley applicative transformer.
@since 1.0.0
| Wrap any @'... | # LANGUAGE TupleSections #
Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see LICENSE
Portability : non - portable ( GHC extensions )
Cayley applicative transformer .
1 . " A Queue for Effectful Breadth - First Traversals "
< >
2 . " Notions of Comp... |
5fbf8f4f2f12abf22488d3068b2e2e866a92858054f7a99c93d9953cc6f5146d | sgbj/MaximaSharp | dspr.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/blas/dspr.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
bd24c1f00edebd33c9d074d916a3f2ba61d052959970897fd394d06aae232bf0 | astynax/hemmet | FileTree.hs | module Hemmet.FileTree
( FileTreeBackend
, FileTreeRunner
, fileTree
, bashScript
, treeLike
) where
import Data.Text as T
import Hemmet.Backend
import Hemmet.Runner
import Hemmet.FileTree.Rendering
import Hemmet.FileTree.Template
import Hemmet.FileTree.Transformation
import Hemmet.FileTree.Tree
type Fi... | null | https://raw.githubusercontent.com/astynax/hemmet/0ee76cc4ffca5726f8a70ab78ae8473232b96ee3/src/Hemmet/FileTree.hs | haskell | module Hemmet.FileTree
( FileTreeBackend
, FileTreeRunner
, fileTree
, bashScript
, treeLike
) where
import Data.Text as T
import Hemmet.Backend
import Hemmet.Runner
import Hemmet.FileTree.Rendering
import Hemmet.FileTree.Template
import Hemmet.FileTree.Transformation
import Hemmet.FileTree.Tree
type Fi... | |
62006c03f362048c621475e61432483cc0b7d53eeae21e0a6b887de7f7df27c6 | HaskellForCats/HaskellForCats | 3_b_quickCheckt.hs | module Jan24 where
import Test.QuickCheck
- EXTRA LIST COMPREHENSION ------------------------
note that i connects and continues in the second list generator .
[ ( i , j ) | i < - [ 1 .. 3 ] , j < -[i .. 3 ] ]
=
[ ( i , j ) | j < - [ 1 .. 3 ] ] + +
[ ( 2,j ) | j < - [ 2 .. 3 ] ] + +
[ ( 3,j ) | ... | null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/30MinHaskell/z_notes/3_b_quickCheckt.hs | haskell | ----------------------
------------------------------------------
adding a filter
-----------------------------------------
----------------------------------------
FORMAL DEFINITION FOR LIST COMPREHENSION
----------------------------------------
empty
---------------------------------------
HERE IT IS AS ... | module Jan24 where
import Test.QuickCheck
note that i connects and continues in the second list generator .
[ ( i , j ) | i < - [ 1 .. 3 ] , j < -[i .. 3 ] ]
=
[ ( i , j ) | j < - [ 1 .. 3 ] ] + +
[ ( 2,j ) | j < - [ 2 .. 3 ] ] + +
[ ( 3,j ) | j < - [ 3 .. 3 ] ] + +
=
[ ( 1,1),(1,2),(1,3 ) ... |
661c50907a924cae6e73c184378e93b3cd9db4b5c8b58d68f4a6da15a9d7d3ec | onaio/vega-viewer | grouped_stacked_chart.cljs | (ns vega-viewer.components.grouped-stacked-chart
(:require [om.core :as om :include-macros true]
[sablono.core :refer-macros [html]]
[vega-viewer.components.vega-viewer :refer [vega-viewer]]
[vega-viewer.vega.specs.grouped-stacked-chart
:refer [generate-grouped-stacked... | null | https://raw.githubusercontent.com/onaio/vega-viewer/591c310131d2b662d96aef21546a718fcc0752a8/src/vega_viewer/components/grouped_stacked_chart.cljs | clojure | (ns vega-viewer.components.grouped-stacked-chart
(:require [om.core :as om :include-macros true]
[sablono.core :refer-macros [html]]
[vega-viewer.components.vega-viewer :refer [vega-viewer]]
[vega-viewer.vega.specs.grouped-stacked-chart
:refer [generate-grouped-stacked... | |
8b7f18a70d04e7906b0b3ed8dad4dda210f892430bd7c36092bea7fcf2d9aa77 | mbj/stratosphere | Agreement.hs | module Stratosphere.Transfer.Agreement (
Agreement(..), mkAgreement
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Agreement
= Agreement ... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/transfer/gen/Stratosphere/Transfer/Agreement.hs | haskell | module Stratosphere.Transfer.Agreement (
Agreement(..), mkAgreement
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Agreement
= Agreement ... | |
962ad1f8284fcb91d885ac0316c739b88ff7971c2476e43edc83539c8373d9eb | pirapira/coq2rust | ppextend.mli | (************************************************************************)
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/interp/ppextend.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Dealing with precedences | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
* { 6 Pretty - print... |
78fc69be800c2514c374fed54687ba0d5eefb9ab367757e4f527399acfed60ce | cstar/erldis | erldis_sync_client.erl | %% @doc This is a gen_server very similar to erldis_client, but it does
%% synchronous calls instead of async pipelining. Does so by keeping a queue
of From pids in State.calls , then calls gen_server : reply when it receives
%% handle_info({tcp, ...). Therefore, it must get commands on handle_call
%% instead of hand... | null | https://raw.githubusercontent.com/cstar/erldis/375260795e6a3de2600e297658f364deedbe6f1b/src/erldis_sync_client.erl | erlang | @doc This is a gen_server very similar to erldis_client, but it does
synchronous calls instead of async pipelining. Does so by keeping a queue
handle_info({tcp, ...). Therefore, it must get commands on handle_call
instead of handle_cast, which requires direct command sending instead of
using the API in erldis.
@... | of From pids in State.calls , then calls gen_server : reply when it receives
@author < >
-module(erldis_sync_client).
-behaviour(gen_server).
-include("erldis.hrl").
-export([scall/2, scall/3, call/2, call/3, stop/1, transact/1, transact/2, select/2, info/1, sr_scall/2, sr_scall/3]).
-export([connect/0, conn... |
9836820ab1ba36e9aeb2e866d1efd2597a867627f3cdc8e3472d964c36562d1f | rems-project/cerberus | logicalPredicates.ml | module Loc = Locations
module IT = IndexTerms
module BT = BaseTypes
module AT = ArgumentTypes
module LAT = LogicalArgumentTypes
open IndexTerms
open Subst
open Pp
module SymSet = Set.Make(Sym)
module SymMap = Map.Make(Sym)
module Body = struct
type t =
| Case of IT.t * (Sym.t * t) list
| Let of (Sym.t ... | null | https://raw.githubusercontent.com/rems-project/cerberus/965d4e46ae42e85141c2b32a647f11c6944493e3/backend/cn/logicalPredicates.ml | ocaml | adapting earlier compilePredicates.ml code for this
TODO: there's a potential blowup due to `it` being repeated.
If the predicate is supposed to get used in a quantified form,
one of the arguments has to be the index/quantified
variable. For now at least.
(\* Check for cycles in the logical predica... | module Loc = Locations
module IT = IndexTerms
module BT = BaseTypes
module AT = ArgumentTypes
module LAT = LogicalArgumentTypes
open IndexTerms
open Subst
open Pp
module SymSet = Set.Make(Sym)
module SymMap = Map.Make(Sym)
module Body = struct
type t =
| Case of IT.t * (Sym.t * t) list
| Let of (Sym.t ... |
f1c6f54dacb4e18f69584c530cabbc0ef346e8918c6cff37fce0bdb3f31a7460 | racket/images | effects-tests.rkt | #lang racket/gui
(require racket/math
images/gui
images/flomap
images/logos)
(module test racket/base)
(define frame-delay 1/30)
(define size 256)
(define blur 8)
(define frame-num 10)
(define end-frame-quality 90)
(define mid-frame-quality 35)
(define background-fm (make-flomap* size si... | null | https://raw.githubusercontent.com/racket/images/975f011d41aea2f1d83885cefe333d271b788a62/images-test/images/tests/effects-tests.rkt | racket | #lang racket/gui
(require racket/math
images/gui
images/flomap
images/logos)
(module test racket/base)
(define frame-delay 1/30)
(define size 256)
(define blur 8)
(define frame-num 10)
(define end-frame-quality 90)
(define mid-frame-quality 35)
(define background-fm (make-flomap* size si... | |
5e19f772271c751d469bc185efba48446b03e1080bdfb28aecf3c67d991d533e | puppetlabs/puppetdb | inventory.clj | (ns puppetlabs.puppetdb.integration.inventory
(:require [clojure.test :refer :all]
[puppetlabs.puppetdb.integration.fixtures :as int]
[puppetlabs.puppetdb.cheshire :as json]
[me.raynes.fs :as fs]))
(def structured-data
{"foo" [1 2 3]
"bar" {"f" [3.14 2.71]
"*" "**"
... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/test/puppetlabs/puppetdb/integration/inventory.clj | clojure | (ns puppetlabs.puppetdb.integration.inventory
(:require [clojure.test :refer :all]
[puppetlabs.puppetdb.integration.fixtures :as int]
[puppetlabs.puppetdb.cheshire :as json]
[me.raynes.fs :as fs]))
(def structured-data
{"foo" [1 2 3]
"bar" {"f" [3.14 2.71]
"*" "**"
... | |
ccd375c8ba814aef02d96f55569c4ec7ffea9c4eab4935a41c686571ed02d3ef | mbj/stratosphere | Association.hs | module Stratosphere.SSM.Association (
module Exports, Association(..), mkAssociation
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SSM.Association.InstanceAssociationOutputLocationProperty as Expor... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/ssm/gen/Stratosphere/SSM/Association.hs | haskell | # SOURCE #
# SOURCE # | module Stratosphere.SSM.Association (
module Exports, Association(..), mkAssociation
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Association
= Association {ap... |
c0a5dec628514c5e2fef5a15eea63631562f07bde0ef58dfc3e8c24d1f101677 | rems-project/cerberus | tags.mli | val set_tagDefs: (Symbol.sym, Ctype.tag_definition) Pmap.map -> unit
val tagDefs: unit -> (Symbol.sym, Ctype.tag_definition) Pmap.map
val reset_tagDefs: unit -> unit
| null | https://raw.githubusercontent.com/rems-project/cerberus/124c93f10cb4c235f6396adec82ebf9563daeb7e/ocaml_frontend/tags.mli | ocaml | val set_tagDefs: (Symbol.sym, Ctype.tag_definition) Pmap.map -> unit
val tagDefs: unit -> (Symbol.sym, Ctype.tag_definition) Pmap.map
val reset_tagDefs: unit -> unit
| |
9b5c3e6e3ff117a575428960ddd21981ff428fe50b888152b082eea8a760b11b | vikram/lisplibraries | request-handler.lisp |
(in-package :weblocks-test)
;;; testing handle-client-request
(deftest handle-client-request-0
(with-request :get nil
(setf (slot-value *request* 'hunchentoot::script-name) "/hello/world/bar.txt")
(multiple-value-bind (res err)
(ignore-errors
(handle-client-request))
res))
nil)
(defwebapp ... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/test/request-handler.lisp | lisp | testing handle-client-request
unbind init-user-session to make sure root-composite persists
fake user clicking on "modify"
handle another request, this time AJAX (make sure form is drawn)
</span><span class='object'>Employee</span></h1>~
~
~
'>~
</span>~
~
</em></span></span>~
</span></span>~
' />~
' />~
make su... |
(in-package :weblocks-test)
(deftest handle-client-request-0
(with-request :get nil
(setf (slot-value *request* 'hunchentoot::script-name) "/hello/world/bar.txt")
(multiple-value-bind (res err)
(ignore-errors
(handle-client-request))
res))
nil)
(defwebapp hcr-hello-webapp
:init-user-sess... |
726110c760c9e27263118d82803e2c3a20d4d0def0c0ea2a861944a1cddd2319 | spawnfest/eep49ers | complex1.erl | -module(complex1).
-export([start/1, stop/0, init/1]).
-export([foo/1, bar/1]).
start(ExtPrg) ->
spawn(?MODULE, init, [ExtPrg]).
stop() ->
complex ! stop.
foo(X) ->
call_port({foo, X}).
bar(Y) ->
call_port({bar, Y}).
call_port(Msg) ->
complex ! {call, self(), Msg},
receive
{complex, Result} ... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/system/doc/tutorial/complex1.erl | erlang | -module(complex1).
-export([start/1, stop/0, init/1]).
-export([foo/1, bar/1]).
start(ExtPrg) ->
spawn(?MODULE, init, [ExtPrg]).
stop() ->
complex ! stop.
foo(X) ->
call_port({foo, X}).
bar(Y) ->
call_port({bar, Y}).
call_port(Msg) ->
complex ! {call, self(), Msg},
receive
{complex, Result} ... | |
754e6c2971442cf3188de07633e736028e48a225b7d26dec046f8c37f8ed1267 | nvkv/slackingbird | markup.clj | (ns slackingbird.slack.markup
(:require [clojure.string :as str]
[clojure.core.reducers :as r]))
(defn markdownize
"This function is a nightmare"
[string]
(if (nil? string)
""
(let [str (as-> string x (str/replace x "_" "\\_")
(str/replace x #"<([^|\s]+?)>" "$1"... | null | https://raw.githubusercontent.com/nvkv/slackingbird/195eccf1eb22be6379dfa06fef7e18845607ca1e/src/slackingbird/slack/markup.clj | clojure | (ns slackingbird.slack.markup
(:require [clojure.string :as str]
[clojure.core.reducers :as r]))
(defn markdownize
"This function is a nightmare"
[string]
(if (nil? string)
""
(let [str (as-> string x (str/replace x "_" "\\_")
(str/replace x #"<([^|\s]+?)>" "$1"... | |
ca072fc51386ae07edf426c222ef6ce38edc32d6c8738b4d882fb57ae74156db | awslabs/quivela | ETMSmall.hs | Copyright 2018 Amazon.com , Inc. or its affiliates . All Rights Reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE QuasiQuotes #
import Prelude
import Quivela
import qualified System.Exit as E
program =
prove'
emptyVerifyEnv
([prog'|
method MacI(mac) {
new (const mac=mac,tg=0) {
... | null | https://raw.githubusercontent.com/awslabs/quivela/c58a883c9387c18b51a83ede60fbb131357173e8/examples/ETMSmall.hs | haskell | Hint [d]: | Copyright 2018 Amazon.com , Inc. or its affiliates . All Rights Reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE QuasiQuotes #
import Prelude
import Quivela
import qualified System.Exit as E
program =
prove'
emptyVerifyEnv
([prog'|
method MacI(mac) {
new (const mac=mac,tg=0) {
... |
19bdf64c93a7f6c2cd948ab769c740f3489fc1c7c2afd05c292396c714584a59 | joearms/elib1 | elib1_org2latex.erl | -module( elib1_org2latex).
-compile(export_all).
-import(lists, [reverse/1, reverse/2]).
batch([X]) ->
io:format("formatting~p~n",[X]),
start(atom_to_list(X)),
init:stop().
start(In) ->
Out = filename:rootname(In) ++ ".tex",
L = elib1_misc:file2lines(In),
{Mode, L1} = find_mode(L, []),
%% ... | null | https://raw.githubusercontent.com/joearms/elib1/d617d0ec70a058ef102749eadf51c024444c28d9/src/elib1_org2latex.erl | erlang | elib1_misc:dump("test", L),
convert to latex | -module( elib1_org2latex).
-compile(export_all).
-import(lists, [reverse/1, reverse/2]).
batch([X]) ->
io:format("formatting~p~n",[X]),
start(atom_to_list(X)),
init:stop().
start(In) ->
Out = filename:rootname(In) ++ ".tex",
L = elib1_misc:file2lines(In),
{Mode, L1} = find_mode(L, []),
O =... |
c2d3db181352f04af85eb7c3a2e7ac6d8d05f6ac8f1e288373c976eaf683350b | clojure-interop/google-cloud-clients | BucketInfo$LifecycleRule$LifecycleCondition.clj | (ns com.google.cloud.storage.BucketInfo$LifecycleRule$LifecycleCondition
"Condition for a Lifecycle rule, specifies under what criteria an Action should be executed."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.storage BucketInfo$LifecycleRule$LifecycleCondition]))
(defn *new-buil... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.storage/src/com/google/cloud/storage/BucketInfo%24LifecycleRule%24LifecycleCondition.clj | clojure | (ns com.google.cloud.storage.BucketInfo$LifecycleRule$LifecycleCondition
"Condition for a Lifecycle rule, specifies under what criteria an Action should be executed."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.storage BucketInfo$LifecycleRule$LifecycleCondition]))
(defn *new-buil... | |
8fdc7245de915eb9a467cbc9d67e195fc2750186cd65a8752f1e0fa6c8898196 | runtimeverification/haskell-backend | IO.hs | |
Module : Kore . Builtin . IO
Description : Built - in I / O ( limited support )
Copyright : ( c ) Runtime Verification , 2018 - 2022
License : BSD-3 - Clause
Maintainer :
This module is intended to be imported qualified , to avoid collision with other
builtin modules .
@
imp... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/78738f36f7e56a637b2217808a188313c3ffc3a2/kore/src/Kore/Builtin/IO.hs | haskell | |
Module : Kore . Builtin . IO
Description : Built - in I / O ( limited support )
Copyright : ( c ) Runtime Verification , 2018 - 2022
License : BSD-3 - Clause
Maintainer :
This module is intended to be imported qualified , to avoid collision with other
builtin modules .
@
imp... | |
bb93d13d0e8eb96f9786336bf6ed44986365ec03fc2d323a7172bc69f9362405 | scmlab/gcl | IntervalMap.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
module Server.IntervalMap
( IntervalMap
, singleton
, toList
, fromList
, insert
, lookup
, split
, Scope
, M
, runM
, Collect... | null | https://raw.githubusercontent.com/scmlab/gcl/3d3aefb513ce6d3821265d77b6f3f0ffba0f4c66/src/Server/IntervalMap.hs | haskell | # LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
and the element's Int acting as the ending offset
Instances for debugging
------------------------------------------------------------------------------
Construction
----------------------------------------... | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
module Server.IntervalMap
( IntervalMap
, singleton
, toList
, fromList
, insert
, lookup
, split
, Scope
, M
, runM
, Collect(..)
, lookupScopes
, localScop... |
894424b0a7f8ada5f0d4fc1405f9a7f750a7a9e70f8d805199afd90485e0f69a | informatimago/lisp | hquery.lisp | ;;;;**************************************************************************
FILE : hquery.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
;;;; This packages exports utility routines for web applications.
;;;;
< PJB > ... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/common-lisp/http/hquery.lisp | lisp | **************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
This packages exports utility routines for web applications.
LEGAL
This program is free software: you can redistribute it and/or modify
(at your option) ... | FILE : hquery.lisp
USER - INTERFACE :
< PJB > < >
MODIFICATIONS
2007 - 05 - 30 < PJB > Created .
AGPL3
Copyright 2007 - 2016
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the Lice... |
307051f5510f4552f0afe9768d02d6be56cd5fec330330e5214c7b0d9d49bf5a | parapluu/Concuerror | ets_dependencies_deeper_2.erl | -module(ets_dependencies_deeper_2).
-export([ets_dependencies_deeper_2/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
ets_dependencies_deeper_2() ->
Parent = self(),
ets:new(table, [public, named_table]),
ets:insert(table, {x, 0}),
ets:insert(table, {y, 0}),
T1 =
spaw... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/dpor_tests/src/ets_dependencies_deeper_2.erl | erlang | -module(ets_dependencies_deeper_2).
-export([ets_dependencies_deeper_2/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
ets_dependencies_deeper_2() ->
Parent = self(),
ets:new(table, [public, named_table]),
ets:insert(table, {x, 0}),
ets:insert(table, {y, 0}),
T1 =
spaw... | |
15529d5f7d3684d8080c3b64e7c3923426530d613ba8e00da4aeef211362e100 | Makell-Digital/servant-persistent-template | AuthenticationSpec.hs | # LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module AuthenticationSpec where
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Utf8
import Test.QuickCheck.Gen.Unsafe (promote)
import qualified Authentication.Domain.Commands.SignUpUser as SignUp
import Authentication.Domain.Quer... | null | https://raw.githubusercontent.com/Makell-Digital/servant-persistent-template/b299edb81b9335ce12c5c01aa9ab3059faff15e1/test/AuthenticationSpec.hs | haskell | Login process generators
SignUp process generators | # LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module AuthenticationSpec where
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Utf8
import Test.QuickCheck.Gen.Unsafe (promote)
import qualified Authentication.Domain.Commands.SignUpUser as SignUp
import Authentication.Domain.Quer... |
a4ae47e10d1cbfcd40987beeeadae4a8580b126c9af0b1c2202691f5d0c01c68 | ocaml-sf/learn-ocaml-corpus | get0.ml | let rec get : 'a . int -> 'a seq -> 'a =
fun i xs ->
match xs with
| Nil ->
assert false (* cannot happen; [i] is within bounds *)
| One (x, xs) ->
if i = 1 then (* wrong *)
x
else
get (i - 1) (Zero xs)
| Zero xs ->
let (x0, x1) = get (i / 2) xs in
... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/random_access_lists/wrong/get0.ml | ocaml | cannot happen; [i] is within bounds
wrong | let rec get : 'a . int -> 'a seq -> 'a =
fun i xs ->
match xs with
| Nil ->
| One (x, xs) ->
x
else
get (i - 1) (Zero xs)
| Zero xs ->
let (x0, x1) = get (i / 2) xs in
if i mod 2 = 0 then x0 else x1
|
ba6393ee5783cd85d3e3659636d6e9cf099ad75e457af704055a265fcb4da30b | vert-x/mod-lang-clojure | udp-group-listener.clj | Copyright 2013 the original author or authors .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/vert-x/mod-lang-clojure/dcf713460b8f46c08d0db6e7bf8537f1dd91f297/examples/udp/udp-group-listener.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright 2013 the original author or authors .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns example.udp.udp-group-listener
(:require [vertx.core :as vertx]
[vertx.datagram :as udp]))
(-> (udp/socket)
(udp/on-data
(fn [packet]
(println (format "Received gr... |
268ecab2204b77e521f10a950dbb3b6ccb814de219b415ab0d8175468b7fabd0 | grin-compiler/ghc-wpc-sample-programs | CSV.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
|
Module : Text . Pandoc . Readers . RST
Copyright : Copyright ( C ) 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable
Conversion ... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc/Readers/CSV.hs | haskell | # LANGUAGE FlexibleContexts #
^ Reader options
^ Text to parse (assuming @'\n'@ line endings) |
# LANGUAGE ScopedTypeVariables #
|
Module : Text . Pandoc . Readers . RST
Copyright : Copyright ( C ) 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable
Conversion from CSV to a ' Pandoc ' table .
... |
94a584511d46337aae630c8501fa2bb8128dd62d00a4776f3dd72aecd859b769 | minad/paripari | Lens.hs | {-# LANGUAGE Rank2Types #-}
module Text.PariPari.Lens (
posLine
, posCol
, reportLine
, reportCol
, reportFile
, reportErrors
, ecErrors
, ecContext
, optMaxContexts
, optMaxErrorsPerContext
, optMaxLabelsPerContext
) where
import Text.PariPari.Internal.Class
import Text.PariPari.Internal.Reporte... | null | https://raw.githubusercontent.com/minad/paripari/23ec127bd2cfc28b84af918e91c2e5bb8ac889a4/src/Text/PariPari/Lens.hs | haskell | # LANGUAGE Rank2Types #
# INLINE posCol # | module Text.PariPari.Lens (
posLine
, posCol
, reportLine
, reportCol
, reportFile
, reportErrors
, ecErrors
, ecContext
, optMaxContexts
, optMaxErrorsPerContext
, optMaxLabelsPerContext
) where
import Text.PariPari.Internal.Class
import Text.PariPari.Internal.Reporter
type Lens a b = forall f ... |
459e182bf45d9fff3b3b17ed598c15b8e4d78c790d1f99f813df3f281065fad1 | launchdarkly/haskell-server-sdk | Context.hs | # LANGUAGE BlockArguments #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ViewPatterns #
-- |
-- Context is a collection of attributes that can be referenced in flag
-- evaluations and analytics events.
--
-- To create a Context of a single kind, such as a user, you may use
-- 'makeContext'.
--
To create an LDContext with ... | null | https://raw.githubusercontent.com/launchdarkly/haskell-server-sdk/b8642084591733e620dfc5c1598409be7cc40a63/src/LaunchDarkly/Server/Context.hs | haskell | |
Context is a collection of attributes that can be referenced in flag
evaluations and analytics events.
To create a Context of a single kind, such as a user, you may use
'makeContext'.
Additional properties can be set on a single-kind context using the set
methods found in this module.
Each method will alw... | # LANGUAGE BlockArguments #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ViewPatterns #
To create an LDContext with multiple kinds , use ' makeMultiContext ' .
associated errors by calling ' isValid ' and ' ' .
module LaunchDarkly.Server.Context
( Context
, makeContext
, makeMultiContext
, withName
... |
b466da612b9fac3f7ebfd43feaa7790f060665ada4a8b7c706c7c41660af07a2 | robrix/sequoia | Product.hs | module Sequoia.Bifunctor.Product
( -- * Product type
type (×)(..)
-- * Construction
, inP
-- * Elimination
, runP
, exPl
, exPr
) where
import Control.Applicative (liftA2)
import Data.Bifoldable
import Data.Bifunctor
import Data.Bitraversable
-- Product type
newtype a × b = P { getP :: forall t . (a -> b -> t)... | null | https://raw.githubusercontent.com/robrix/sequoia/665f362bd942d1d20fd511a541cc68fbe0f1ad58/src/Sequoia/Bifunctor/Product.hs | haskell | * Product type
* Construction
* Elimination
Product type
Construction
Elimination | module Sequoia.Bifunctor.Product
type (×)(..)
, inP
, runP
, exPl
, exPr
) where
import Control.Applicative (liftA2)
import Data.Bifoldable
import Data.Bifunctor
import Data.Bitraversable
newtype a × b = P { getP :: forall t . (a -> b -> t) -> t }
deriving (Functor)
infixr 7 ×
instance Bifoldable (×) where
b... |
db31bce5429eba5b271e03fc3b54f33da2b7ead10e403396c539c93c4bcb1d22 | logseq/logseq | git.cljs | (ns electron.git
(:require ["dugite" :refer [GitProcess]]
[goog.object :as gobj]
[electron.state :as state]
[electron.utils :as utils]
[electron.logger :as logger]
[promesa.core :as p]
[clojure.string :as string]
["fs-extra" :as fs]
... | null | https://raw.githubusercontent.com/logseq/logseq/29da7386cbaf6e13ed6616490a03ded3cf09155c/src/electron/electron/git.cljs | clojure | git log -100 --oneline -p ~/Desktop/org/pages/contents.org
TODO: why this happen? | (ns electron.git
(:require ["dugite" :refer [GitProcess]]
[goog.object :as gobj]
[electron.state :as state]
[electron.utils :as utils]
[electron.logger :as logger]
[promesa.core :as p]
[clojure.string :as string]
["fs-extra" :as fs]
... |
86b56efef37e6440cba1f2a9553e04629bf989a34957c34812f5ff977ee18667 | lambe-lang/nethra | t04_bindings.ml | open Common
open Nethra.Syntax.Source
open Nethra.Syntax.Parser
open Nethra.Toy.Parser
let parser_signature () =
let open Bindings.Impl (Parsec) in
let result =
response render_bindings
@@ bindings
@@ Parsec.source (Utils.chars_of_string "sig a : b -> c")
and expected = (Some "sig a : b -> c", true) ... | null | https://raw.githubusercontent.com/lambe-lang/nethra/8d9e584e08ad5850eb8d66006d57c78ebac66564/test/nethra/toy/s01_parser/t04_bindings.ml | ocaml | open Common
open Nethra.Syntax.Source
open Nethra.Syntax.Parser
open Nethra.Toy.Parser
let parser_signature () =
let open Bindings.Impl (Parsec) in
let result =
response render_bindings
@@ bindings
@@ Parsec.source (Utils.chars_of_string "sig a : b -> c")
and expected = (Some "sig a : b -> c", true) ... | |
8bbc408e15231bdaee98c5309fc09288bc671521db057a482e8817b0bb5e0346 | ucsd-progsys/nate | arith_flags.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Crista... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/num/arith_flags.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : arith_flags.mli , v 1.5 2001/12/07 13:4... |
2c8f8033a6b21be5142493abea8ce69726821352284f9cc09db1f17d31180857 | lucasvreis/org-mode-hs | Helpers.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
-- |
module Tests.Helpers
( module Tests.Helpers,
module Test.Tasty,
)
where
import Data.Algorithm.DiffContext (getContextDiff, prettyContextDiff)
import O... | null | https://raw.githubusercontent.com/lucasvreis/org-mode-hs/8eed3910638f379d55114995e0bc75a5915c4e98/org-parser/test/Tests/Helpers.hs | haskell | |
| This class is mainly used for the tests cases.
@Parsed m a@ is the "monad-stripped" version of parse
tree with which we can compare in the test cases. | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Tests.Helpers
( module Tests.Helpers,
module Test.Tasty,
)
where
import Data.Algorithm.DiffContext (getContextDiff, prettyContextDiff)
import Org.Bu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.