_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 |
|---|---|---|---|---|---|---|---|---|
ce45352ee884effb6f7bc0fe8581633f19f3ab068ed036256273aaa87b1fed6c | discus-lang/ddc | Call.hs |
module DDC.Core.Discus.Transform.Curry.Call
(makeCall)
where
import DDC.Core.Discus.Transform.Curry.CallSuper
import DDC.Core.Discus.Transform.Curry.CallThunk
import DDC.Core.Discus.Transform.Curry.Callable
import DDC.Core.Discus.Transform.Curry.Error
import DDC.Core.Discus.Prim
import DDC.Core.Exp
import DDC.... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core-discus/DDC/Core/Discus/Transform/Curry/Call.hs | haskell | | Call a thing, depending on what it is.
Decide how to call the functional thing, depending on
whether its a super, foreign imports, or thunk.
^ Types and arities of functions in the environment.
^ Name of function to call.
^ Type of function to call.
^ Eliminators for function call.
Call of a local or impo... |
module DDC.Core.Discus.Transform.Curry.Call
(makeCall)
where
import DDC.Core.Discus.Transform.Curry.CallSuper
import DDC.Core.Discus.Transform.Curry.CallThunk
import DDC.Core.Discus.Transform.Curry.Callable
import DDC.Core.Discus.Transform.Curry.Error
import DDC.Core.Discus.Prim
import DDC.Core.Exp
import DDC.... |
ab581fbc30d2f57c2e73ae8159721a68363bb129cc1ab8a25a944abfb09ea707 | PEZ/rich4clojure | problem_022.clj | (ns rich4clojure.easy.problem-022
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Count a Sequence =
By 4Clojure user :
;; Difficulty: Easy
Tags : [ seqs core - functions ]
;;
;; Write a function which returns the total number of
;; elements in a sequence.
(def restricted [count])
(def __ :tests-will-fail)... | null | https://raw.githubusercontent.com/PEZ/rich4clojure/28ea575ede8677f3a97437a646cdb3376a28ebc9/src/rich4clojure/easy/problem_022.clj | clojure | = Count a Sequence =
Difficulty: Easy
Write a function which returns the total number of
elements in a sequence.
Share your solution, and/or check how others did it:
| (ns rich4clojure.easy.problem-022
(:require [hyperfiddle.rcf :refer [tests]]))
By 4Clojure user :
Tags : [ seqs core - functions ]
(def restricted [count])
(def __ :tests-will-fail)
(comment
)
(tests
(__ '(1 2 3 3 1)) := 5
(__ "Hello World") := 11
(__ [[1 2] [3 4] [5 6]]) := 3
(__ '(13)) := 1
... |
84f17141b890e9cc9f8765e454f74315883a0e3ed1fb80428234f3aab375ea98 | ekmett/rounded | Interval.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE PolyKinds #
module Numeric.Rounded.Interval where
import Control.Applicative
import Numeric.Rounded
import Data.Coerce
import Data.Typeable
import GHC.Generics
import Prelude hiding (elem, notEl... | null | https://raw.githubusercontent.com/ekmett/rounded/c468acd3933c9fdcbb1bb66c53ab203f1ea41f0a/src/Numeric/Rounded/Interval.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
TODO: take from mpfr
| lift a monotone increasing function over a given interval
-- | lift a monotone decreasing function over a given interval
| create a non-empty interval or fail
| The whole real number line
>>> whole
-Infinity ... Infinity
| An empty... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE PolyKinds #
module Numeric.Rounded.Interval where
import Control.Applicative
import Numeric.Rounded
import Data.Coerce
import Data.Typeable
import GHC.Generics
import Prelude hiding (elem, notElem)
data Interval p
= I (Rounded TowardNegInf p) (Rounded Tow... |
8b71f9bbd4b45752fab9bc54b8bf57f22c59d32869a55988222fe0b1ebf296f6 | OCamlPro/digodoc | meta.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2020 OCamlPro SAS & Origin Labs SAS
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/digodoc/cfd164f91ed3f15a8a48b18bcb6875ba5e0681a2/src/digodoc_lib/meta.ml | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2020 OCamlPro SAS & Origin Labs SAS
Public License version 2.1 , with the special exception on linking
open EzCompat
open Type
open Meta_file.Types
let rec create ?meta_parent state ~meta_name ~meta_file ~meta_opam
~meta_dir =
if StringMap.mem meta_name state.met... |
07c043b3bdf6160c12dfb01be4452a43cfcbc470a36d35f88dcfadaede3c3480 | LeventErkok/sbv | Instances.hs | -----------------------------------------------------------------------------
-- |
-- Module : BenchSuite.Optimization.Instance
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Helper file to provide common orphaned instances for Optimization benchmarks
... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/SBVBenchSuite/BenchSuite/Optimization/Instances.hs | haskell | ---------------------------------------------------------------------------
|
Module : BenchSuite.Optimization.Instance
License : BSD3
Maintainer:
Stability : experimental
Helper file to provide common orphaned instances for Optimization benchmarks
----------------------------------------------------------... | Copyright : ( c )
# OPTIONS_GHC -Wall -Werror -fno - warn - orphans #
module BenchSuite.Optimization.Instances where
import Data.SBV
import Control.DeepSeq
instance NFData OptimizeResult where rnf x = seq x ()
|
87ccd4a52dd5ab63d6b9103786139615f38ef50ad0eae9a30f5f65b30f4fc00e | camlp5/camlp5 | versdep.ml | (* camlp5r pa_macro.cmo *)
(* versdep.ml,v *)
Copyright ( c ) INRIA 2007 - 2017
open Parsetree;
open Longident;
open Asttypes;
type choice 'a 'b =
[ Left of 'a
| Right of 'b ]
;
value option_map f x =
match x with
| Some x -> Some (f x)
| None -> None
end
;
value mustSome symbol = fun [
Some x -> x
|... | null | https://raw.githubusercontent.com/camlp5/camlp5/9e8155f8ae5a584bbb4ad96d10d6fec63ed8204c/lib/versdep.ml | ocaml | camlp5r pa_macro.cmo
versdep.ml,v
floating attributes
extension nodes
floating attributes
extension nodes
... [@@id1] [@@id2] | Copyright ( c ) INRIA 2007 - 2017
open Parsetree;
open Longident;
open Asttypes;
type choice 'a 'b =
[ Left of 'a
| Right of 'b ]
;
value option_map f x =
match x with
| Some x -> Some (f x)
| None -> None
end
;
value mustSome symbol = fun [
Some x -> x
| None -> failwith ("Some: "^symbol)
]
;
value... |
835d81e64addbc84866b8a9f53d3bfb53f7eab6497cba942e77886ac02e82aa4 | pouriya/director | director_test_utils.erl | %%%-------------------------------------------------------------------
@author
( C ) 2018 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 31 . Jan 2018 6:21 PM
%%%-------------------------------------------------------------------
-module(director_test_utils).
-author("pouriya").
%% API
-export([make_return/4
... | null | https://raw.githubusercontent.com/pouriya/director/919c30db18c83330290fba9e68de330000978674/test/director_test_utils.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API | @author
( C ) 2018 , < COMPANY >
Created : 31 . Jan 2018 6:21 PM
-module(director_test_utils).
-author("pouriya").
-export([make_return/4
,handle_return/3
,flush_handle_returns/0]).
make_return(Pid, Mod, Func, Args) ->
Ref = erlang:make_ref(),
Pid ! {handle_return, erlang:self(), Ref... |
0ebbc68b1128e7141f4357168598a79394b927b5f4f57b714f577aa50cf317ad | conscell/hugs-android | Trace.hs | -----------------------------------------------------------------------------
-- |
-- Module : Debug.Trace
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
--... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/base/Debug/Trace.hs | haskell | ---------------------------------------------------------------------------
|
Module : Debug.Trace
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
The 'trace' function.
----------------------------------------------------... | Copyright : ( c ) The University of Glasgow 2001
module Debug.Trace (
) where
import Prelude
import System.IO.Unsafe
import System.IO (hPutStrLn,stderr)
| ' putTraceMsg ' function outputs the trace message from IO monad .
from Windows GUI application then the output will be directed to the Windows
... |
1584fc002607a30dcd5854e8e2c04e0aa0481c4fa2f17cd4a6ef96607994d422 | inaka/cowboy_swagger | example.erl | -module(example).
-export([start/0]).
-export([start/2]).
-export([stop/0]).
-export([stop/1]).
-export([start_phase/3]).
%% application
%% @doc Starts the application
-spec start() -> {ok, [atom()]}.
start() ->
application:ensure_all_started(example).
%% @doc Stops the application
-spec stop() -> ok.
stop() ->
... | null | https://raw.githubusercontent.com/inaka/cowboy_swagger/500bf6a6ad73c2fb29c980f26c7deb07e610fbf4/test/example.erl | erlang | application
@doc Starts the application
@doc Stops the application
behaviour | -module(example).
-export([start/0]).
-export([start/2]).
-export([stop/0]).
-export([stop/1]).
-export([start_phase/3]).
-spec start() -> {ok, [atom()]}.
start() ->
application:ensure_all_started(example).
-spec stop() -> ok.
stop() ->
application:stop(example).
@private
-spec start(normal, [any()]) -> {ok, ... |
b0d3150ac568b0dcb543f8ac26741b819ef0f127e33db1feadae7a0332a85c5f | intermine/bluegenes | effects.cljs | (ns bluegenes.effects
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :as rf :refer [dispatch reg-fx reg-cofx]]
[cljs.core.async :as async :refer [<! close! put!]]
[cljs-http.client :as http]
[cognitect.transit :as t]
[bluegenes... | null | https://raw.githubusercontent.com/intermine/bluegenes/81a6e0d0bd580890b28ffeff019f6ef4a827cf89/src/cljs/bluegenes/effects.cljs | clojure | Cofx and fx which you use from event handlers to read/write to localStorage.
Specifying `nil` as value removes the key instead.
Examples (we do not endorse storing your cats in localStorage)
Interceptor and effect to set the title of the web page.
See bottom of namespace for effect registrations and examples on h... | (ns bluegenes.effects
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :as rf :refer [dispatch reg-fx reg-cofx]]
[cljs.core.async :as async :refer [<! close! put!]]
[cljs-http.client :as http]
[cognitect.transit :as t]
[bluegenes... |
ce51517b312e8e1bd0d6d969f04afe9c9c4aaba4594cd9473fe1734036ab49d1 | faylang/fay | Double4.hs | module Double4 where
main :: Fay ()
main = print 1
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/Double4.hs | haskell | module Double4 where
main :: Fay ()
main = print 1
| |
108b6087fcf89529c38cc0e79029191d9bc5260d1fcbe0371ba026be36879a95 | ananthakumaran/eopl | simple_module_lang.clj | (ns eopl.core.simple-module-lang
(:use eopl.core.define-datatype)
(:use eopl.core.env)
(:use eopl.core.simple-module-lang-parser)
(:use eopl.core.feature)
(:use clojure.test))
;; env extension
(defn extend-env-with-module [env name val]
(conj env [name (->Module name val env)]))
(defn lookup-module [env... | null | https://raw.githubusercontent.com/ananthakumaran/eopl/876d6c2e44865e2c89a05a683d99a289c71f1487/src/eopl/core/simple_module_lang.clj | clojure | env extension | (ns eopl.core.simple-module-lang
(:use eopl.core.define-datatype)
(:use eopl.core.env)
(:use eopl.core.simple-module-lang-parser)
(:use eopl.core.feature)
(:use clojure.test))
(defn extend-env-with-module [env name val]
(conj env [name (->Module name val env)]))
(defn lookup-module [env m-name]
(let [... |
ae3cfd276f13208a6f97af56c41457fda82bd4acf72ab7902ab5e19f38f1c6c7 | OCamlPro/ez_api | ezCoXhr.ml | (**************************************************************************)
(* *)
Copyright 2018 - 2022 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/request/js/coxhr/ezCoXhr.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2018 - 2022 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
open Lwt.Infix
open EzRequest
module Base = EzCohttp_base.Make(Cohttp_lwt_jsoo.Client)
module Interface = struct
let get ?meth ?headers ?msg url f =
Lwt.async @... |
df6aab9db6f78b06effc1d0ca48d86d3be2c24614d23f1bf5ce28a2119548ed5 | mariari/Misc-Lisp-Scripts | chapter1.lisp | (defun our-remove-if (fn lst)
(if (null lst)
nil
(if (funcall fn (car lst))
(our-remove-if fn (cdr lst))
(cons (car lst) (our-remove-if fn (cdr lst))))))
(defun list+ (lst n)
(mapcar (lambda (x) (+ x n))
lst))
(let ((counter 0))
(defun new-id ()
(incf counter))
(... | null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/acecadc75fcbe15e6b97e084d179aacdbbde06a8/Books/OnLisp/chapter1.lisp | lisp | Now time to initialize it
Normal behavior
overloaded
New behavior
Using labels to recursively find stuff with mapcar
Testing out our new function
Cheating how compiles work
Works the same as | (defun our-remove-if (fn lst)
(if (null lst)
nil
(if (funcall fn (car lst))
(our-remove-if fn (cdr lst))
(cons (car lst) (our-remove-if fn (cdr lst))))))
(defun list+ (lst n)
(mapcar (lambda (x) (+ x n))
lst))
(let ((counter 0))
(defun new-id ()
(incf counter))
(... |
ec755185886e38abf7ed7029bbd1fbf236b32f8d0eca46e33b09cea4cd3f1a92 | freizl/dive-into-haskell | Controller.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE QuasiQuotes #
module Controller
( withHelloyesod
, withDevelApp
) where
import Helloyesod
import Settings
import Yesod.Helpers.Static
import Yesod.Helpers.Aut... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/codes/web/yesod/helloyesod/Controller.hs | haskell | # LANGUAGE OverloadedStrings #
Import all relevant handler modules here.
the comments there for more details.
very rarely need to modify this.
This function allocates resources (such as a database connection pool),
place to put your migrate statements to have automatic database | # LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE QuasiQuotes #
module Controller
( withHelloyesod
, withDevelApp
) where
import Helloyesod
import Settings
import Yesod.Helpers.Static
import Yesod.Helpers.Auth
import Database.Persist.GenericSq... |
2db5418ada154871ccb49814c737e947ffbc0e41b1efa1d3c9695d722476797f | input-output-hk/cardano-wallet | Transactions.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSection... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/8af073b9c6975aba4351cda2d967cd51a5d5430c/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/Transactions.hs | haskell | # LANGUAGE RankNTypes #
Attempt #1:
Attempt to create a transaction with a non-zero quantity of lovelace
that is significantly below the minimum required by the ledger.
This attempt should fail with an error that states the minimum
required amount.
Attempt to create a transaction with a quantity of lovelace e... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplicati... |
2b4ae872e51545a23bfeb1805214bf05ae83e28e819e80b37cd09c28a1ca49c7 | janestreet/merlin-jst | subst.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/980b574405617fa0dfb0b79a84a66536b46cd71b/upstream/ocaml_413/typing/subst.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Types
type t
Substitutions are used to translate a type from one context to
another . ... |
8a4a4b5c34ad2a4ca916bf013ac6aabf2463227707d31fdeb0cb05956e814f9f | DaMSL/K3 | Common.hs | # LANGUAGE ViewPatterns #
-- | Common tools for code generation.
module Language.K3.Codegen.Common (
annotationComboId,
annotationComboIdT,
annotationComboIdE,
annotationComboIdL,
recordSignature,
signature
) where
import Control.Arrow ((&&&))
import Language.K3.Core.Common
import Language.... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Codegen/Common.hs | haskell | | Common tools for code generation.
Annotation identifiers.
Record Identifiers | # LANGUAGE ViewPatterns #
module Language.K3.Codegen.Common (
annotationComboId,
annotationComboIdT,
annotationComboIdE,
annotationComboIdL,
recordSignature,
signature
) where
import Control.Arrow ((&&&))
import Language.K3.Core.Common
import Language.K3.Core.Annotation (K3, tag, children)
... |
f89e3fc96941eea5abd056664396627c06811e73442bed721890e193af0a2d22 | lfkdsk/SICP-Magical-Book | gate.rkt |
; 算数逻辑非
(define (logical-not s)
(cond ((= s 0) 1)
((= s 1) 0)
(else (error " Invalid signal " s))))
; 算数逻辑与
(define (logical-and a b)
(if (and (= a 1) (= b 1))
1
0))
逻辑或
(define (logical-or a b)
(if (or (= a 1) (= b 1))
1
0))
; 与门 给两个线路都绑上一个监控器
当某个值变化的时候 会重新计... | null | https://raw.githubusercontent.com/lfkdsk/SICP-Magical-Book/4f4d4822ed27834ded7c782d9874c73a6d3378d0/code/simula/gate.rkt | racket | 算数逻辑非
算数逻辑与
与门 给两个线路都绑上一个监控器
或门
反门 |
(define (logical-not s)
(cond ((= s 0) 1)
((= s 1) 0)
(else (error " Invalid signal " s))))
(define (logical-and a b)
(if (and (= a 1) (= b 1))
1
0))
逻辑或
(define (logical-or a b)
(if (or (= a 1) (= b 1))
1
0))
当某个值变化的时候 会重新计算 new - value 设置到输出端口
(define (and-... |
53c39045c5012ccdc21432b31ab0aa300275262e449b3b43fb62bdcdca5dd19c | rob7hunter/leftparen | leftparen.scm | #lang scheme/base
(require scheme/match
(planet untyped/dispatch:2:=1/dispatch)
(planet jaymccarthy/with-bindings:1:=2/with-bindings)
web-server/servlet-env
web-server/dispatchers/dispatch
web-server/configuration/responders
"util.scm"
"settings.scm"
... | null | https://raw.githubusercontent.com/rob7hunter/leftparen/169c896bda989b6a049fe49253a04d6f8b62402b/leftparen.scm | scheme | the work of others:
web server
core web help
web forms
feeds
records and the data repository
closures
sessions
response
js
html, pages, includes, etc
settings
users
time
computation
profiler
task queues
facebook
then it really just means that dispatch
failed to find an appropriate URL match, so we
... | #lang scheme/base
(require scheme/match
(planet untyped/dispatch:2:=1/dispatch)
(planet jaymccarthy/with-bindings:1:=2/with-bindings)
web-server/servlet-env
web-server/dispatchers/dispatch
web-server/configuration/responders
"util.scm"
"settings.scm"
... |
9337d9e93f19ebc3361e648125a2857b08fc1543dcbb8c792a0c5ea2e7d655bd | yakaz/yamerl | block_mapping_noeol.erl | -module('block_mapping_noeol').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[{io_blocksize, 1}],
<<>>,
24,
true,
[],
0,
... | null | https://raw.githubusercontent.com/yakaz/yamerl/0032607a7b27fa2b548fc9a02d7ae6b53469c0c5/test/parsing/block_mapping_noeol.erl | erlang | -module('block_mapping_noeol').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[{io_blocksize, 1}],
<<>>,
24,
true,
[],
0,
... | |
a1602044247e7688d9aeb8ffe49a9d17b2d42d061d14d5946e6426dada9b746b | opencog/learn | connector-balance-bidonor.scm | ;
; connector-balance-bidonor.scm
; Unit test for merging of Connectors - detailed balance.
;
Same as connector-balance.scm , except that one of the connectors
gets counts from two donor sources .
;
Created Dec 2021
(use-modules (srfi srfi-1))
(use-modules (opencog) (opencog matrix))
(use-modules (opencog nlp))
... | null | https://raw.githubusercontent.com/opencog/learn/e00a803620491a7df4fc0d6b3dda2879a9dcb8cb/tests/merge/connector-balance-bidonor.scm | scheme |
connector-balance-bidonor.scm
Unit test for merging of Connectors - detailed balance.
---------------------------------------------------------------
This diagram explains what is being tested here:
(a, gh) + (b, gh) -> ({ab}, gh)
source, potentially throwing off the counts.
Load some data
Define matr... | Same as connector-balance.scm , except that one of the connectors
gets counts from two donor sources .
Created Dec 2021
(use-modules (srfi srfi-1))
(use-modules (opencog) (opencog matrix))
(use-modules (opencog nlp))
(use-modules (opencog learn))
(use-modules (opencog test-runner))
(use-modules (srfi srfi-64))
... |
b78d511f349042ecf0a27fc392d3ddae1e2b3af473324f28951878f069fe6abd | olsner/sedition | TaggedRegex.hs | -- Convert parsed regexes with groups (all groups are numbered/capturing) into
regexes with explicit tag numbers . Tag 0 and 1 are the start / end of the
-- whole match.
module TaggedRegex where
import Control.Monad.Trans.State.Strict
import Data . ByteString . Char8 ( ByteString )
import qualified Data.ByteStri... | null | https://raw.githubusercontent.com/olsner/sedition/ead2a56f90e470669f0ab05f6878c6e54b9c3e26/TaggedRegex.hs | haskell | Convert parsed regexes with groups (all groups are numbered/capturing) into
whole match.
import Data.Set (Set)
import qualified Data.Set as S
import Debug.Trace
Wouldn't be too much work to translate in TNFA and have distinct types...
Could optimize or regularize more stuff here, but regrouping and reordering
d... | regexes with explicit tag numbers . Tag 0 and 1 are the start / end of the
module TaggedRegex where
import Control.Monad.Trans.State.Strict
import Data . ByteString . Char8 ( ByteString )
import qualified Data.ByteString.Char8 as C
import Data.List (intercalate)
import Data.Map (Map)
import qualified Data.Map as... |
eb92c27694d8072ec58d291b48a0c14df927214cfbb1bd8bb71bf9d9344a6cad | phile314/tasty-silver | test.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
import Control.Concurrent.MVar
import Control.Exception as E ( catch, SomeException )
Prelude of GHC 7.4 also has @catch@ , so we disambiguate with E.catch
import Control.Monad ( unless )
import Control.Monad.IO.Class ( lif... | null | https://raw.githubusercontent.com/phile314/tasty-silver/b9e7b543752dec8b38f0f50bb68fbfbd1cdd626f/tests/test.hs | haskell | # LANGUAGE OverloadedStrings #
@testGolden@ always fails, would need @--accept@ mode.
testGolden :
match
match
match
match
let io = defaultMain tree
unless success $ putStr out
testGolden :: TestTree
testGolden =
goldenTest1
(return $ Just "golden value")
(return "actual value")
(DiffText No... | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
import Control.Concurrent.MVar
import Control.Exception as E ( catch, SomeException )
Prelude of GHC 7.4 also has @catch@ , so we disambiguate with E.catch
import Control.Monad ( unless )
import Control.Monad.IO.Class ( liftIO )
import Data.List (sort)
#if ... |
0c87981e6437947ccd21bca302ca531cbcb23576f08b97adcd911da71302c329 | yogthos/yuggoth | config.clj | (ns yuggoth.config
(:use clojure.java.io
yuggoth.db.schema
yuggoth.locales
environ.core)
(:import java.io.File
java.sql.DriverManager
org.postgresql.ds.PGPoolingDataSource))
(defonce blog-config (atom nil))
(defonce db (atom nil))
(defonce configured? (atom nil))
(def... | null | https://raw.githubusercontent.com/yogthos/yuggoth/901541c5809fb1e77c249f26a3aa5df894c88242/src/yuggoth/config.clj | clojure | (ns yuggoth.config
(:use clojure.java.io
yuggoth.db.schema
yuggoth.locales
environ.core)
(:import java.io.File
java.sql.DriverManager
org.postgresql.ds.PGPoolingDataSource))
(defonce blog-config (atom nil))
(defonce db (atom nil))
(defonce configured? (atom nil))
(def... | |
9a7d5e5bd8fdb313166f0ce001aa17850a3d4915d2c79f8fb9b252f342302992 | tejasbubane/haskell-book-code | catch-all.hs | module CatchAll where
import Control.Exception
SomeException catches all exceptions that have instance of Exception typeclass
canICatch :: Exception e => e -> IO (Either SomeException ())
canICatch e =
try $ throwIO e
-- Run in ghci
| null | https://raw.githubusercontent.com/tejasbubane/haskell-book-code/deaac8ab4db0ae8692d0278826528bb8a746ed82/ch-30/catch-all.hs | haskell | Run in ghci | module CatchAll where
import Control.Exception
SomeException catches all exceptions that have instance of Exception typeclass
canICatch :: Exception e => e -> IO (Either SomeException ())
canICatch e =
try $ throwIO e
|
4ee9bdd16b87662b2eaed478bdd1e22ca77409ecafa216d6e7a783887da96b5e | processone/ejabberd-contrib | mod_s2s_log.erl | %%%----------------------------------------------------------------------
%%% File : mod_s2s_log.erl
Author : < >
%%% Purpose : Log all s2s connections in a file
Created : 14 Mar 2008 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2020 ProcessOne
%%%
%%% This program is free software; you can re... | null | https://raw.githubusercontent.com/processone/ejabberd-contrib/e76b0877d6281e9e23984bd5e946bf43091875b8/mod_s2s_log/src/mod_s2s_log.erl | erlang | ----------------------------------------------------------------------
File : mod_s2s_log.erl
Purpose : Log all s2s connections in a file
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be usef... | Author : < >
Created : 14 Mar 2008 by < >
ejabberd , Copyright ( C ) 2002 - 2020 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
d71586cfab1cd1531273dd3f8cc9f9a684eef3ab5516d3dd85bc892f7fffe00c | NorfairKing/smos | Server.hs | module Smos.Server where
import Smos.Server.OptParse
import Smos.Server.Serve
smosServer :: IO ()
smosServer = do
settings <- getSettings
serveSmosServer settings
| null | https://raw.githubusercontent.com/NorfairKing/smos/82707699b446bc431f5233e5dc18c7ec3dd679fd/smos-server/src/Smos/Server.hs | haskell | module Smos.Server where
import Smos.Server.OptParse
import Smos.Server.Serve
smosServer :: IO ()
smosServer = do
settings <- getSettings
serveSmosServer settings
| |
7b4bd82971c7d467c3855c902065917714cd6b638f77cc3f1fb59af1848f79a8 | charJe/funds | heap-empty-p.lisp | ;;;;
Copyright 2007
;;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; -2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
distr... | null | https://raw.githubusercontent.com/charJe/funds/bdc40045d08a36a6e81bd33ffffa752d99b08e60/src/heap/heap-empty-p.lisp | lisp |
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 2007
distributed under the License is distributed on an " AS IS " BASIS ,
(in-package :funds)
(defun heap-empty-p (heap)
"Whether the given heap has any elements."
(tree-empty-p heap))
|
d9d0cbf35b7efa663d78d5e086a91ee2ffca2a03fe9c9b3a9aa201a00f249cb4 | broadinstitute/wfl | workloads.clj | (ns wfl.tools.workloads
(:require [clojure.string :as str]
[wfl.api.workloads]
[wfl.auth :as auth]
[wfl.environment :as env]
[wfl.jdbc :as jdbc]
[wfl.module.aou :as ao... | null | https://raw.githubusercontent.com/broadinstitute/wfl/ca30908a6b62aa3ea8e5e15c3b410263d0173ee9/api/test/wfl/tools/workloads.clj | clojure | From warp.git ExampleCramToUnmappedBams.plumbing.json
| (ns wfl.tools.workloads
(:require [clojure.string :as str]
[wfl.api.workloads]
[wfl.auth :as auth]
[wfl.environment :as env]
[wfl.jdbc :as jdbc]
[wfl.module.aou :as ao... |
3ed11e899fc8e75002fedea0c31713637177704a90820d1fb075d841ef5672b0 | Cumulus/Cumulus | errors.mli |
Copyright ( c ) 2012
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 , dis... | null | https://raw.githubusercontent.com/Cumulus/Cumulus/3b6de05d76c57d528e052aa382f98e40354cf581/src/base/errors.mli | ocaml |
Copyright ( c ) 2012
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 , dis... | |
34e4de52ecc277d6e84c7765c02906e44d24eeafa6797fd5226c273229f5905b | sfwc/erlang-transducers | transducers_tests.erl | -module(transducers_tests).
-import(transducers, [compose/2, drop_while/1, filter/1, list/2, map/1]).
-include_lib("eunit/include/eunit.hrl").
transducer_test_() -> [
[?_assertEqual([1, 2, 3], list(fun (X) -> X end, [1, 2, 3]))],
[?_assertEqual([4, 5],
list(filter(fun (X) -> X > 3 end), [1, 2, ... | null | https://raw.githubusercontent.com/sfwc/erlang-transducers/786bfab55009e4f7fd0252c608d41200b3011b60/test/transducers_tests.erl | erlang | -module(transducers_tests).
-import(transducers, [compose/2, drop_while/1, filter/1, list/2, map/1]).
-include_lib("eunit/include/eunit.hrl").
transducer_test_() -> [
[?_assertEqual([1, 2, 3], list(fun (X) -> X end, [1, 2, 3]))],
[?_assertEqual([4, 5],
list(filter(fun (X) -> X > 3 end), [1, 2, ... | |
335d5fbbdb6c39e8e0c363988e946add427274c93cc40c76a5f204bb29b58605 | UU-ComputerScience/uhc | Term.hs | module Term
(VarId, Term (Var, Abs, App, Let), readsId)
where
import Parse
import Shows
type VarId = String
data Term = Var VarId
| Abs VarId Term
| App Term Term
| Let VarId Term Term
instance Show Term where
showsPrec d = showsTerm d
instance Read Term ... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/benchmark/nofib/real/infer/Term.hs | haskell | ELSE | module Term
(VarId, Term (Var, Abs, App, Let), readsId)
where
import Parse
import Shows
type VarId = String
data Term = Var VarId
| Abs VarId Term
| App Term Term
| Let VarId Term Term
instance Show Term where
showsPrec d = showsTerm d
instance Read Term ... |
a5deffa39a511c0c290b65712eaa3a48b84420d2c099b3abd4a246df103d1607 | tiensonqin/lymchat-exp | login.cljs | (ns lymchat.shared.scene.login
(:require
[reagent.core :as r]
[re-frame.core :refer [subscribe dispatch]]
[lymchat.styles :refer [styles]]
[lymchat.shared.ui :refer [text view image touchable-highlight icon-button colors status-bar dimensions Image gradient] :as ui]
[lymchat.shared.login :as login]
... | null | https://raw.githubusercontent.com/tiensonqin/lymchat-exp/425a0738b11632119be08b5a59f12244f5df1575/src/lymchat/shared/scene/login.cljs | clojure | (ns lymchat.shared.scene.login
(:require
[reagent.core :as r]
[re-frame.core :refer [subscribe dispatch]]
[lymchat.styles :refer [styles]]
[lymchat.shared.ui :refer [text view image touchable-highlight icon-button colors status-bar dimensions Image gradient] :as ui]
[lymchat.shared.login :as login]
... | |
ed5682b3c9d41cf5df9f2246ca60ace7a9cc9da31777058b29164f7c98d734f1 | ssadler/zeno | Errors.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module Network.Ethereum.Errors
( Err(..)
, ErrClass(..)
, allErrorClasses
, errMsg
, errStr
, otherErr
) where
import Data.Aeson
import Data.Text
import GHC.Generics
data Err = Err Value
deriving (Eq, Generic, Show)
instance ToJSON Err ... | null | https://raw.githubusercontent.com/ssadler/zeno/9f715d7104a7b7b00dee9fe35275fb217532fdb6/src/Network/Ethereum/Errors.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
module Network.Ethereum.Errors
( Err(..)
, ErrClass(..)
, allErrorClasses
, errMsg
, errStr
, otherErr
) where
import Data.Aeson
import Data.Text
import GHC.Generics
data Err = Err Value
deriving (Eq, Generic, Show)
instance ToJSON Err where
toJSON (Err val) = val
da... |
b6ba838de31fa61b9f4c57c7a644cd83b2f134984b055df25e1f78e6490b2591 | SquidDev/illuaminate | linter.mli | (** The base type for linters, and the information they produce. *)
open IlluaminateCore
module Fixer : sig
(** A fixer for a problematic node. This should map a term of some type, to an equivalent
no-problematic term. *)
type 'a t = private
| Nothing : 'a t (** This node has no fixer. *)
| One : (... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/7a6e4bf56f01e81a47c743cb452791c2168ccbda/src/lint/linter.mli | ocaml | * The base type for linters, and the information they produce.
* A fixer for a problematic node. This should map a term of some type, to an equivalent
no-problematic term.
* This node has no fixer.
* This node can be fixed by replacing it with a single equivalent node. If the node cannot
be fixed, ... |
open IlluaminateCore
module Fixer : sig
type 'a t = private
| One : ('a -> ('a, string) result) -> 'a t
| Block : (Syntax.stmt -> (Syntax.stmt list, string) result) -> Syntax.stmt t
val none : 'a t
* Construct a fixer which replaces it with an equivalent node . See { ! One } .
val fix : ('a -> ('a, st... |
cc90eb5b30f083b939acc26a6e7e8a542022107c26d7ae34ae997d5f34214b08 | err0r500/realworld-app-simple-haskell | Spec.hs | # OPTIONS_GHC -F #
Just a helper file in order to let hspec discover all specs in this folder and subfolders
| null | https://raw.githubusercontent.com/err0r500/realworld-app-simple-haskell/20ec982256ec890f0c77b572eccef987cd3799bf/test/Spec.hs | haskell | # OPTIONS_GHC -F #
Just a helper file in order to let hspec discover all specs in this folder and subfolders
| |
b26c82139d6da3fd356025cb6cf199c600d547b7b1157cdc7d036cc2373103e7 | clojure/core.typed | binding.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/src/clojure/core/typed/checker/check/binding.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns clojure.core.typed.checker.check.binding
(:require [clojure.core.typed.util-vars :as vs]
[clojure.core.typed.checker.utils :as u]))
(defn check-binding
[check {:keys [init] :as expr} expected]
(let [cinit (binding [vs/*current-expr* init]
... |
bf42de9b4ee4c44db0fe6ac97f6830c7e546b718ad28b57451251c54038508c3 | xtdb/xtdb | user_after_free_segfault_test.clj | (ns xtdb.user-after-free-segfault-test
(:require [clojure.test :as t]
[xtdb.api :as xt]
[xtdb.io :as xio]))
(defn- kv-node-opts [kv-module]
{:xtdb/index-store
{:kv-store {:xtdb/module kv-module,
:db-dir (xio/create-tmpdir "idx")}},
:xtdb/document-store
{:kv-store {:x... | null | https://raw.githubusercontent.com/xtdb/xtdb/8e8d25065b39900e95910261ebfa1a085dbf446c/test/test/xtdb/user_after_free_segfault_test.clj | clojure | (ns xtdb.user-after-free-segfault-test
(:require [clojure.test :as t]
[xtdb.api :as xt]
[xtdb.io :as xio]))
(defn- kv-node-opts [kv-module]
{:xtdb/index-store
{:kv-store {:xtdb/module kv-module,
:db-dir (xio/create-tmpdir "idx")}},
:xtdb/document-store
{:kv-store {:x... | |
552269304cc76bbb6ade0662945efcdaeec5935fd44fc20caefa00b8bf654e45 | Bogdanp/racket-gui-easy | 7GUI-2-temperature.rkt | #lang racket/base
(require racket/format
racket/gui/easy
racket/gui/easy/operator)
(define (F->C f) (* (- f 32) 5/9))
(define (C->F c) (+ (* c 9/5) 32))
(define/obs @background #f)
(define/obs @tempC 26)
(define/obs @tempF (@tempC . ~> . C->F))
(define (temp label @value [convert values])
(hpane... | null | https://raw.githubusercontent.com/Bogdanp/racket-gui-easy/cc815d191099b788849914a9b7cc569360004727/examples/7GUI-2-temperature.rkt | racket | #lang racket/base
(require racket/format
racket/gui/easy
racket/gui/easy/operator)
(define (F->C f) (* (- f 32) 5/9))
(define (C->F c) (+ (* c 9/5) 32))
(define/obs @background #f)
(define/obs @tempC 26)
(define/obs @tempF (@tempC . ~> . C->F))
(define (temp label @value [convert values])
(hpane... | |
60b6dc092f6feeee21a486c2faca6d36683608332ed956c0879523e3ef6d9682 | jaspervdj/hakyll | Tests.hs | --------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Web.Template.Context.Tests
( tests
) where
--------------------------------------------------------------------------------
import Test.Tasty (TestTree, ... | null | https://raw.githubusercontent.com/jaspervdj/hakyll/af9e29b5456c105dc948bc46c93e989a650b5ed1/tests/Hakyll/Web/Template/Context/Tests.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----------------------------------------------------... | module Hakyll.Web.Template.Context.Tests
( tests
) where
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, testCase, (@=?))
import Hakyll.Core.Compiler
import Hakyll.Core.Identifier
import Hakyll.Core.Pro... |
817d76356bb53dac1cddd3ce915da9f7bcbd3cd1fd2fd6f243abca4ed4a3c636 | uhc/uhc | PreludeEHC8.hs |
infixl 6 +, -
infix 4 ==
data Bool = False | True
foreign import ccall primSubInt :: Int -> Int -> Int
foreign import ccall primEqInt :: Int -> Int -> Bool
foreign import ccall primAddInt :: Int -> Int -> Int
(+) = primAddInt
(-) = primSubInt
(==) = primEqInt
| null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/text/llvm/code/PreludeEHC8.hs | haskell |
infixl 6 +, -
infix 4 ==
data Bool = False | True
foreign import ccall primSubInt :: Int -> Int -> Int
foreign import ccall primEqInt :: Int -> Int -> Bool
foreign import ccall primAddInt :: Int -> Int -> Int
(+) = primAddInt
(-) = primSubInt
(==) = primEqInt
| |
e9016dec0a63c0a6f988c3bac481864e418320f96d5686036b47c89067c37ce7 | erlyvideo/publisher | video_frame.erl | @author < > [ ]
2011
%%% @doc Erlyvideo video_frame issues
@reference See < a href=" " target="_top"></a > for more information
%%% @end
%%%
%%% This file is part of erlmedia.
%%%
%%% erlmedia is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pu... | null | https://raw.githubusercontent.com/erlyvideo/publisher/5bb2dfa6477c46160dc5fafcc030fc3f5340ec80/apps/erlmedia/src/video_frame.erl | erlang | @doc Erlyvideo video_frame issues
@end
This file is part of erlmedia.
erlmedia is free software: you can redistribute it and/or modify
(at your option) any later version.
erlmedia is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANT... | @author < > [ ]
2011
@reference See < a href=" " target="_top"></a > for more information
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License... |
0b736b547de151cff61883536cd8e8d1cf3ac281895873045bec80de3face5ad | sile/logi | logi_builtin_sink_composite.erl | 2014 - 2016 < >
%%
%% @doc A built-in composite sink
%%
%% == NOTE ==
%% This module is provided for debuging/testing purposes only.
%%
%% @end
-module(logi_builtin_sink_composite).
-behaviour(gen_server).
%%--------------------------------------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/sile/logi/1022fbc238a7d18765fe864a7174958142160ee8/src/logi_builtin_sink_composite.erl | erlang |
@doc A built-in composite sink
== NOTE ==
This module is provided for debuging/testing purposes only.
@end
----------------------------------------------------------------------------------------------------------------------
Exported API
-------------------------------------------------------------------------... | 2014 - 2016 < >
-module(logi_builtin_sink_composite).
-behaviour(gen_server).
-export([new/2]).
-export([get_children/1]).
-export([set_active_writer/2]).
-export([unset_active_writer/1]).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
... |
db67bec22cec9d1da7b42070e07445464c452ae6bcf741a9defb15fbad3a034a | haskell-tools/haskell-tools | SemanticTraversal.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE TemplateHaskellQuotes #-}
-- | Generating instances for traversal on semantic information
module Language.Haskell.Tools.AST.TH.SemanticTraversal where
import Control.Monad (Monad(..), mapM, replicateM)
import Language.Haskell.TH.Ppr (pprint)
import Language.Haskell.TH.Syntax
impor... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/ast/Language/Haskell/Tools/AST/TH/SemanticTraversal.hs | haskell | # LANGUAGE TemplateHaskellQuotes #
| Generating instances for traversal on semantic information
| Generate the instances for semantic information
| Creates a clause for a constructor, the needed context is also generated
| Creates an expression for the body of a smartTrav clause
using the matches created for param... | # LANGUAGE LambdaCase #
module Language.Haskell.Tools.AST.TH.SemanticTraversal where
import Control.Monad (Monad(..), mapM, replicateM)
import Language.Haskell.TH.Ppr (pprint)
import Language.Haskell.TH.Syntax
import Language.Haskell.Tools.AST.Ann (SemanticTraversal(..))
deriveSemanticTraversal :: Name -> Q [Dec]
de... |
cf52d0e74ae374b75fe3939841ca64dbf9ea20f2d661982aded62217ce6b3888 | theangelperalta/cl-objc | circle-view.lisp | This example has been translated from one provided by Apple in the
;;; default XCode SDK
(in-package "CL-OBJC-EXAMPLES")
(import-framework "Foundation" t)
(defun make-range (location length)
(slet ((range ns-range))
(setf (ns-range-location range) location
(ns-range-length range) length)
range))
(def... | null | https://raw.githubusercontent.com/theangelperalta/cl-objc/6daf2edf6d922e7ee1acaf259ea5510b16580379/examples/circle-view.lisp | lisp | default XCode SDK | This example has been translated from one provided by Apple in the
(in-package "CL-OBJC-EXAMPLES")
(import-framework "Foundation" t)
(defun make-range (location length)
(slet ((range ns-range))
(setf (ns-range-location range) location
(ns-range-length range) length)
range))
(defun make-point (x y)
... |
2fe7fb8182a97c585f17753ab3091e9e85b0dfca8fdaf2327cd1a696c1820120 | S8A/htdp-exercises | ex087.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex087) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex087.rkt | racket | about the language level of this file in a form that our tools can easily process.
An Editor is a structure:
interpretation (make-editor s i) describes an editor
whose visible text is s with the cursor displayed before
index i (i is in the interval 0 to (string-length s), inclusive)
Editor -> String
returns the ... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex087) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t ... |
ac2ccca4398393060890bf2c37abec7cca91c7404e1fbd6cfe9b4e7cf5637187 | slyrus/cl-bio | sequence-test.lisp |
(in-package :bio-test)
(plan 10)
;; DNA Sequences
(is
(let ((test-seq (make-instance 'adjustable-dna-sequence :initial-contents "GAATTC")))
(residues-string test-seq))
"GAATTC")
(is-error
(let ((test-seq (make-instance 'adjustable-dna-sequence :initial-contents "U")))
(residues-string test-seq))
sequenc... | null | https://raw.githubusercontent.com/slyrus/cl-bio/e6de2bc7f4accaa11466902407e43fae3184973f/test/sequence-test.lisp | lisp | DNA Sequences
RNA Sequences
Amino Acid Sequences |
(in-package :bio-test)
(plan 10)
(is
(let ((test-seq (make-instance 'adjustable-dna-sequence :initial-contents "GAATTC")))
(residues-string test-seq))
"GAATTC")
(is-error
(let ((test-seq (make-instance 'adjustable-dna-sequence :initial-contents "U")))
(residues-string test-seq))
sequence-encoding-error)... |
acf6dffc0f702c54dd8940eafdf1f10ffc69ae86bc6cc7eae7d9a50b2cfe6ece | beerendlauwers/hakyll-extra | Directories.hs | {-# LANGUAGE OverloadedStrings #-}
module Hakyll.Translation.Examples.Directories where
import Hakyll
import Hakyll.Translation.Format.Metadata (createTranslationContextFromMetaData)
import Hakyll.Core.Identifier.Pattern.Extra (fillPattern)
import Data.Monoid ((<>))
import ... | null | https://raw.githubusercontent.com/beerendlauwers/hakyll-extra/cc4741a9781412108926ac2d7cf70f52a5ee68a3/src/Hakyll/Translation/Examples/Directories.hs | haskell | # LANGUAGE OverloadedStrings #
| Some example languages.
| An example that illustrates how to use the translation functionality in "Hakyll.Translation.Format.Metadata".
Note that we don't route these anywhere, we just want them to be known so they can be loaded later on.
From here on in, we generate the files for e... | module Hakyll.Translation.Examples.Directories where
import Hakyll
import Hakyll.Translation.Format.Metadata (createTranslationContextFromMetaData)
import Hakyll.Core.Identifier.Pattern.Extra (fillPattern)
import Data.Monoid ((<>))
import Control.Monad (forM_)... |
f4988557c3cc15565721e80b525cdac1c2eab936768cb0072ba68c65edc7a151 | brendanhay/amazonka | AdditionalResources.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-wellarchitected/gen/Amazonka/WellArchitected/Types/AdditionalResources.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WellArchitected.Types.AdditionalResources
Stability : auto-generated
| The choice level additional resources.
/See:/ 'newAdditionalResources' smart constructor.
| The URLs for additional resources, either helpful resources or
| Ty... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Co... |
8fd918be4a9e33d00b34db40b9af072b1b0420d5d7922818b788456c161675a5 | onaio/hatti | project.clj | (defn js-dir
"Prefix with full JavaScript directory."
[path]
(str "resources/public/js/lib/" path))
(defproject onaio/hatti "0.4.7-225-SNAPSHOT"
:description "A cljs dataview from your friends at Ona.io"
:license "Apache 2, see LICENSE"
:url ""
Core libraries
[org.clojure/clojure "1.8.0"... | null | https://raw.githubusercontent.com/onaio/hatti/7dc23c1c60b9fc46e1ff5b023eb6c794ebd04773/project.clj | clojure | For charts
JS
For client
For testing | (defn js-dir
"Prefix with full JavaScript directory."
[path]
(str "resources/public/js/lib/" path))
(defproject onaio/hatti "0.4.7-225-SNAPSHOT"
:description "A cljs dataview from your friends at Ona.io"
:license "Apache 2, see LICENSE"
:url ""
Core libraries
[org.clojure/clojure "1.8.0"... |
ad962cfb26fee1926339a35a29805eccea30d6b292733bec1b57354047856238 | daypack-dev/daypack-lib | sched_req_id_map_utils.ml | include Map_utils.Make (Sched_req_id_map)
| null | https://raw.githubusercontent.com/daypack-dev/daypack-lib/63fa5d85007eca73aa6c51874a839636dd0403d3/src/sched_req_id_map_utils.ml | ocaml | include Map_utils.Make (Sched_req_id_map)
| |
7091ad604e83af752717184643bdbcc0ee5a5bc5a349dd20081e4dbca5ec9da1 | andrei-dubovik/centrality | mailbox.lisp | Copyright ( c ) 2020 < >
A thin wrapper around SBCL mailbox
;; (I could not find any widely used library)
Also a thin wrapper around SBCL queue
TODO : either program explicitly for SBCL or or think about fallbacks
(in-package :centrality)
#+sbcl
(defmacro make-mailbox ()
`(sb-concurrency:make-mailbox))... | null | https://raw.githubusercontent.com/andrei-dubovik/centrality/b2f86bc045fe3712b543ae28843127781ffee80f/src/mailbox.lisp | lisp | (I could not find any widely used library) | Copyright ( c ) 2020 < >
A thin wrapper around SBCL mailbox
Also a thin wrapper around SBCL queue
TODO : either program explicitly for SBCL or or think about fallbacks
(in-package :centrality)
#+sbcl
(defmacro make-mailbox ()
`(sb-concurrency:make-mailbox))
#+sbcl
(defmacro recv-msg (mailbox)
`(sb-c... |
655f559f9469f5f7cd1feff1754d1301cac4ae7f6bdc738a2b02385765b2f0fc | CryptoKami/cryptokami-core | KnownPeers.hs | {-# LANGUAGE RankNTypes #-}
module Pos.KnownPeers (
MonadKnownPeers(..)
, MonadFormatPeers(..)
) where
import Control.Monad.Trans.Class
import Formatting (Format)
import Network.Broadcast.OutboundQueue (Peers)
import Pos.Communication.Types.Protocol (NodeId)
import ... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/KnownPeers.hs | haskell | # LANGUAGE RankNTypes #
# OVERLAPPABLE #
| For debugging: return formatted list of peers, if available
# OVERLAPPABLE # |
module Pos.KnownPeers (
MonadKnownPeers(..)
, MonadFormatPeers(..)
) where
import Control.Monad.Trans.Class
import Formatting (Format)
import Network.Broadcast.OutboundQueue (Peers)
import Pos.Communication.Types.Protocol (NodeId)
import Pos.Network.Types (Buc... |
dcd8fc15581a855651625a5458df1ebe8fd9e14788d83f74152e8261adecc227 | ndmitchell/nsis | Sugar.hs | {-# LANGUAGE OverloadedStrings, EmptyDataDecls, ScopedTypeVariables, TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances , GeneralizedNewtypeDeriving , DeriveDataTypeable #
Bits.popCount only introduced in 7.6
Applicative and Monoid required < 7.9
module Development.NSIS.Sugar(
Compressor(..), HKEY(..), Mess... | null | https://raw.githubusercontent.com/ndmitchell/nsis/4c174fa51dca97d34ee32e50fcf932aae779d8a6/src/Development/NSIS/Sugar.hs | haskell | # LANGUAGE OverloadedStrings, EmptyDataDecls, ScopedTypeVariables, TypeSynonymInstances #
-------------------------------------------------------------------
nearest scope is here
| Monad in which installers are defined. A useful command to start with is 'section'.
| A 'Value', only used by 'Exp', which can be produ... | # LANGUAGE FlexibleInstances , GeneralizedNewtypeDeriving , DeriveDataTypeable #
Bits.popCount only introduced in 7.6
Applicative and Monoid required < 7.9
module Development.NSIS.Sugar(
Compressor(..), HKEY(..), MessageBoxType(..), Page(..), Level(..), Visibility(..), FileMode(..), SectionFlag(..),
ShowWi... |
fe4347c88197bbd9ebfb0923c2ecc22237449ac071efd6a77cf854f165483ce7 | TrustInSoft/tis-interpreter | loop.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/analysis/loop.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
1f919b09bdad354862441a04dce81c42cb1f1fe888f8c3849f55d6dc03cf2e86 | kelamg/HtDP2e-workthrough | ex457.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex457) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Generative-Recursion/ex457.rkt | racket | about the language level of this file in a form that our tools can easily process.
Number -> N
computes how many months it takes to double a given
amount of money at a given interest rate in % | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex457) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define eps 0.001)
(define msg "r is not \"small\"")
... |
39ab842c546a96bcd5c4790f138300254623ed79e4f101e23cb800ef3ff590a1 | erlware/episcina | episcina.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2013 ,
%%% @doc
%%% Provides the main interface to the system
%%% @end
%%%-------------------------------------------------------------------
-module(episcina).
-export([start_pools/1, start_pool/5, start_pool/1,
... | null | https://raw.githubusercontent.com/erlware/episcina/596889c75f52f443bd6f29ce84aded6806c6fa89/src/episcina.erl | erlang | -------------------------------------------------------------------
@doc
Provides the main interface to the system
@end
-------------------------------------------------------------------
===================================================================
Types
======================================================... | @author < >
( C ) 2013 ,
-module(episcina).
-export([start_pools/1, start_pool/5, start_pool/1,
stop/1,
get_connection/1, get_connection/2,
return_connection/2]).
-export_type([name/0,
connection/0,
connect_fun/0,
close_fun/0]).
-type nam... |
75b0650050b2c9c2aa93d9768f51553fc173b5bfc21e998b3b081bd94dbaad37 | kitlang/kit | TypeMatch.hs | module Kit.Compiler.Typers.TypeExpression.TypeMatch (typeMatch) where
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.List
import Data.Maybe
import Kit.Ast
import Kit.Compiler.Binding
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.Scope
import Kit.Compil... | null | https://raw.githubusercontent.com/kitlang/kit/2769a7a8e51fe4466c50439d1a1ebdad0fb79710/src/Kit/Compiler/Typers/TypeExpression/TypeMatch.hs | haskell | module Kit.Compiler.Typers.TypeExpression.TypeMatch (typeMatch) where
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.List
import Data.Maybe
import Kit.Ast
import Kit.Compiler.Binding
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.Scope
import Kit.Compil... | |
c23f42b56e1e725ceceee717ddc8102424a82c8c111efc5bc805819af00a449f | kblake/erlang-chat-demo | wf_handler.erl | -module (wf_handler).
-include_lib ("wf.hrl").
-export ([
call/2,
call/3,
call_readonly/2,
call_readonly/3,
set_handler/2
]).
% Helper function to call a function within a handler.
% Returns ok or {ok, Value}.
call(Name, FunctionName) -> call(Name, FunctionName, []).
% Helper function to call a... | null | https://raw.githubusercontent.com/kblake/erlang-chat-demo/6fd2fce12f2e059e25a24c9a84169b088710edaf/apps/nitrogen/src/lib/wf_handler.erl | erlang | Helper function to call a function within a handler.
Returns ok or {ok, Value}.
Helper function to call a function within a handler.
Returns ok or {ok, Value}.
Get the handler and state from the context. Then, call
Update the context with the new state.
Get the handler and state from the context. Then, call
Get... | -module (wf_handler).
-include_lib ("wf.hrl").
-export ([
call/2,
call/3,
call_readonly/2,
call_readonly/3,
set_handler/2
]).
call(Name, FunctionName) -> call(Name, FunctionName, []).
call(Name, FunctionName, Args) ->
the function , passing in the and State .
#handler_context { module=Mo... |
38291b8ba06ae50863f5bb4d2c988150eeee55fc930a694b8361f8c0d10fea86 | tek/ribosome | Report.hs | -- |Data structures related to logging and notifying the user
module Ribosome.Host.Data.Report where
import qualified Data.Text as Text
import Exon (exon)
import Fcf (Pure1, type (@@))
import Fcf.Class.Functor (FMap)
import Polysemy.Log (Severity (Error))
import Prelude hiding (tag)
import Text.Show (showParen, showsP... | null | https://raw.githubusercontent.com/tek/ribosome/94d953ed84ce9734bb61759a2078f1a7eedc7a49/packages/host/lib/Ribosome/Host/Data/Report.hs | haskell | |Data structures related to logging and notifying the user
|The provenance of a report, for use in logs.
Also contains the 'Severity' of the report, or minimum log level, which determines whether the report should be
warnings, none for infomrational errors).
The log message may span multiple lines.
|The report... | module Ribosome.Host.Data.Report where
import qualified Data.Text as Text
import Exon (exon)
import Fcf (Pure1, type (@@))
import Fcf.Class.Functor (FMap)
import Polysemy.Log (Severity (Error))
import Prelude hiding (tag)
import Text.Show (showParen, showsPrec)
newtype ReportContext =
ReportContext { unReportContex... |
cc3e640e619e906b8326e4f966c222b3db07d6679aeea3d6eed177966d1556e4 | ThoughtWorksInc/stonecutter | register_form.cljs | (ns stonecutter.js.controller.register-form
(:require [stonecutter.js.dom.register-form :as rfd]
[stonecutter.js.dom.common :as dom]
[stonecutter.validation :as v]
[stonecutter.js.controller.client_translations :as ct]))
(def default-state {:registration-first-name {:value nil :er... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/src-cljs/stonecutter/js/controller/register_form.cljs | clojure | (ns stonecutter.js.controller.register-form
(:require [stonecutter.js.dom.register-form :as rfd]
[stonecutter.js.dom.common :as dom]
[stonecutter.validation :as v]
[stonecutter.js.controller.client_translations :as ct]))
(def default-state {:registration-first-name {:value nil :er... | |
64be1750f9e56d82fec4324a54a8682471f0d9257263bb986b9351ae4377740c | scheme/scsh | syscall-support.scm | (import-dynamic-externals "=scshexternal/syscalls")
(define (byte-vector->string bytev)
(os-string->string (byte-vector->os-string bytev)))
(define-syntax define/vector-args
(syntax-rules ()
((define/vector-args new raw (string-arg ...) arg ...)
(define (new string-arg ... arg ...)
(raw (string->o... | null | https://raw.githubusercontent.com/scheme/scsh/114432435e4eadd54334df6b37fcae505079b49f/scheme/syscall-support.scm | scheme | (import-dynamic-externals "=scshexternal/syscalls")
(define (byte-vector->string bytev)
(os-string->string (byte-vector->os-string bytev)))
(define-syntax define/vector-args
(syntax-rules ()
((define/vector-args new raw (string-arg ...) arg ...)
(define (new string-arg ... arg ...)
(raw (string->o... | |
c73775a7474764b38351ca348f015795b681ebd1cb766980948095fafd600722 | manuel-serrano/bigloo | parseargs.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / bglpkg / parseargs.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/bglpkg/parseargs.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / bglpkg / parseargs.scm * /
* Author : * /
* Creation : Fri Nov 12 13:32:52 2004 * /
* Last change : Fri Nov 29 21:11:58 2013 ( serrano ) * /
* Copyri... |
222781797858809867f5444e01e6f851de0757ed8029f7be12d545c97282949c | lnostdal/SymbolicWeb | link.clj | (in-ns 'symbolicweb.core)
(defn mk-Link
" URL-MAPPERS: {(vm-sync-from-url ..) (vm ..) ...}
M: :SCROLL-TO-TOP?, :ON-CLICK-FN, :EVENT-STOP-PROPAGATION?"
(^WidgetBase [url-mappers]
(mk-Link url-mappers nil (mk-bte)))
(^WidgetBase [url-mappers widget-or-m]
(if (= WidgetBase (class widget-or-m))
(mk... | null | https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/link.clj | clojure | (in-ns 'symbolicweb.core)
(defn mk-Link
" URL-MAPPERS: {(vm-sync-from-url ..) (vm ..) ...}
M: :SCROLL-TO-TOP?, :ON-CLICK-FN, :EVENT-STOP-PROPAGATION?"
(^WidgetBase [url-mappers]
(mk-Link url-mappers nil (mk-bte)))
(^WidgetBase [url-mappers widget-or-m]
(if (= WidgetBase (class widget-or-m))
(mk... | |
19400727194ed0f793b6c7294459dba2632ed3f230440115119f732feeedc420 | vaibhavsagar/experiments | ObjectTy.hs | module Dotnet.System.ObjectTy (Dotnet.Object(..)) where
import qualified Dotnet
--data Object_ a
--type Object a = Dotnet.Object (Object_ a)
| null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/dotnet/lib/Dotnet/System/ObjectTy.hs | haskell | data Object_ a
type Object a = Dotnet.Object (Object_ a) | module Dotnet.System.ObjectTy (Dotnet.Object(..)) where
import qualified Dotnet
|
46bde723c629282636af8a7b643934de73788f73ffbc2a60fe252efd0099c6a3 | OCamlPro/typerex-lldb | LLDBOCamlLocids.ml | (**************************************************************************)
(* *)
(* OCamlPro TypeRex *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/typerex-lldb/3be12b69f30127bbf8a5dd483a6bfbbd6045ba0e/tools/ocp-lldb/LLDBOCamlLocids.ml | ocaml | ************************************************************************
OCamlPro TypeRex
This file is distributed ... | Copyright OCamlPro 2011 - 2016 . All rights reserved .
( GNU Public Licence version 3.0 ) .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
NONINFRINGEMENT . IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE... |
9014a78f9d5c9676029dc88ecff8b0d4e72353f8bda4a72395a03f33e36487a4 | xapi-project/message-switch | channel_test.ml |
* Copyright ( C ) 2011 - 2013 Citrix Inc
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file... | null | https://raw.githubusercontent.com/xapi-project/message-switch/1d0d1aa45c01eba144ac2826d0d88bb663e33101/xapi-idl/lib_test/channel_test.ml | ocaml | dup stdout, check /proc/pid/fd
background fd closing
background fd closing |
* Copyright ( C ) 2011 - 2013 Citrix Inc
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file... |
71d093bf4325682d37a2a031a0f429303bcb04632d305e20a1fcf81a4b9b88bb | PLTools/GT | eval.ml | open GT
@type expr =
| Abs of string * expr
| App of expr * expr
| Var of string
| Binop of string * expr * expr
| Let of string * expr * expr
| Seq of expr * expr
| Assn of string * expr
with eval, show
@type state = (string * int) list with show
let lookup st x = List.assoc st x
let update st x z = (x... | null | https://raw.githubusercontent.com/PLTools/GT/62d1a424a3336f2317ba67e447a9ff09d179b583/papers/OCAML-2018/eval.ml | ocaml | open GT
@type expr =
| Abs of string * expr
| App of expr * expr
| Var of string
| Binop of string * expr * expr
| Let of string * expr * expr
| Seq of expr * expr
| Assn of string * expr
with eval, show
@type state = (string * int) list with show
let lookup st x = List.assoc st x
let update st x z = (x... | |
8002bcd0c7833228c73f7bfac96e1561671bd20de84df5c2d08a04a347b8defb | google-research/dex-lang | Serialize.hs | Copyright 2019 Google LLC
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- -source/licenses/bsd
module Serialize (HasPtrs (..), takePtrSnapshot, restorePtrSnapshot) where
import Prelude hiding (pi, abs)
import Control.Monad
import qualified Data.Byte... | null | https://raw.githubusercontent.com/google-research/dex-lang/d7f5dbc1ce656f7fc9916ab60fcbd84b63b5cffd/src/lib/Serialize.hs | haskell |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
-source/licenses/bsd
# SCC takePtrSnapshot #
this is safe because we don't modify srcPtr's memory or let it escape
=== instances === | Copyright 2019 Google LLC
module Serialize (HasPtrs (..), takePtrSnapshot, restorePtrSnapshot) where
import Prelude hiding (pi, abs)
import Control.Monad
import qualified Data.ByteString as BS
import Data.ByteString.Internal (memcpy)
import Data.ByteString.Unsafe (unsafeUseAsCString)
import Data.Int
import Data.Sto... |
f93a933f0d964a1e9e1724d6f025125d1de491d4df9ba8beafa19565bf65d8b7 | glguy/advent | 11.hs | |
Module : Main
Description : Day 13 solution
Copyright : ( c ) , 2015
License : ISC
Maintainer :
< >
Module : Main
Description : Day 13 solution
Copyright : (c) Eric Mertens, 2015
License : ISC
Maintainer :
<>
-}
module Main where
import Advent.Input (getInputLines)
... | null | https://raw.githubusercontent.com/glguy/advent/7fbe59ff60695fed4caa57abe2f65bf59ea9b132/solutions/src/2015/11.hs | haskell | | Compute the list of valid passwords starting from a given one.
Note: This process works on reversed passwords with the rules
easier to write.
| Check that a string satisfies the descending and duplicate letter rules.
| Test that a string has at least @count@ non-overlapping double, adjacent
letters.
^ pairs se... | |
Module : Main
Description : Day 13 solution
Copyright : ( c ) , 2015
License : ISC
Maintainer :
< >
Module : Main
Description : Day 13 solution
Copyright : (c) Eric Mertens, 2015
License : ISC
Maintainer :
<>
-}
module Main where
import Advent.Input (getInputLines)
... |
bbb989aa5d8077aa17a0d004ffc674c6bff502c76a49df9c6958b2584d6c67a0 | mzp/coq-ide-for-ios | hashcons.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/lib/hashcons.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Hash consing of datastructures
Th... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : hashcons.ml 13323 2... |
d6b7a69bc6e2d1ed23e05094580b6667368e139320b0fa2e5fd22b85c426331e | acgollapalli/dataworks | app_db.clj | (ns dataworks.db.app-db
(:require
[clojure.java.io :as io]
[dataworks.utils.common :refer :all]
[crux.api :as crux]
[tick.alpha.api :as tick]
[mount.core :refer [defstate]]))
(defstate internal-kafka-settings
:start
(try
(-> "config.edn"
slurp
read-string
:dev/kafk... | null | https://raw.githubusercontent.com/acgollapalli/dataworks/df8b48d66b762d1d5566306debe89081675913bd/src/dataworks/db/app_db.clj | clojure | "Get a dependency graph for a function. (not used by app anymore)"
[function]
(query {:find '[d1 d2]
[d1 :stored-function/dependencies d2]]
:args [{'d0 function}]
:rules '[[(depends d1 d2)
[d1 :stored-function/dependencies d2]]
[(depend... | (ns dataworks.db.app-db
(:require
[clojure.java.io :as io]
[dataworks.utils.common :refer :all]
[crux.api :as crux]
[tick.alpha.api :as tick]
[mount.core :refer [defstate]]))
(defstate internal-kafka-settings
:start
(try
(-> "config.edn"
slurp
read-string
:dev/kafk... |
99e49d614aebb1a6f226844b4b178e92eeb2feb7534659aafdc87f587568c331 | kim/opentracing | OpenTracing.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
module Network.Wai.Middleware.OpenTracing
( TracedApplication
, OperationName
, opentracing
, withOperationName
, defaultOperationName
)
where
impor... | null | https://raw.githubusercontent.com/kim/opentracing/403941014080a921c3b2aab0fd7d7ebfe15d7d92/opentracing-wai/Network/Wai/Middleware/OpenTracing.hs | haskell | # LANGUAGE FlexibleContexts #
Expanded:
@
@
| The operation name is, basically, the name of the span.
This is typically determined from the request in some way, see
'defaultOperationName'.
@since 0.2.0
This uses the 'defaultOperationName'.
| Customise the tracing middleware with an 'OperationName'.
... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
module Network.Wai.Middleware.OpenTracing
( TracedApplication
, OperationName
, opentracing
, withOperationName
, defaultOperationName
)
where
import Control.Lens (ov... |
a7d5547481910a7234b6747a40ef9c2ce6aaa2de01a420b04599a173ef528cf3 | alesaccoia/festival_flinger | cmu_us_clb_tokenizer.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
Carnegie Mellon University ; ; ;
and and ; ; ;
Copyright ( c ) 1998 - 2000 ... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/lib/voices/us/cmu_us_clb_cg/festvox/cmu_us_clb_tokenizer.scm | scheme |
;;;
; ;
; ;
; ;
; ;
;;;
Permission is hereby granted, free of charge, to use and distribute ;;;
this software and its documentation without restriction, including ;;;
withou... | Tokenizer for US English ( standard in festival distribution )
None required for English
(define (cmu_us_clb::token_to_words token name)
"(cmu_us_clb::token_to_words token name)
Specific token to word rules for the voice cmu_us_clb. Returns a list
of words that expand given token with name."
(cond
(engli... |
4476b4e576640ac3648831fdf109d51b65f17177b285b0199fab310750eeebd8 | KoenvdBerg/csv-validator | packages.lisp | (in-package :asdf-user)
(defpackage :csv-validator-tests
(:use :common-lisp
:fiveam
:csv-validator))
(in-package :csv-validator-tests)
| null | https://raw.githubusercontent.com/KoenvdBerg/csv-validator/a3f56d30ea9241dc4a8943c2073a199cf488bfcc/tests/packages.lisp | lisp | (in-package :asdf-user)
(defpackage :csv-validator-tests
(:use :common-lisp
:fiveam
:csv-validator))
(in-package :csv-validator-tests)
| |
adae072f3029508b7655104d2de9886bacfd712c234ca867f1f2bcba64601705 | lemenkov/erlrtpproxy | rtpproxy_rtp_handling_rfc1918_test.erl | %%%----------------------------------------------------------------------
Copyright ( c ) 2012 < >
%%%
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without modification,
%%% are permitted provided that the following conditions are met:
%%%
%%% * Redistributions of sou... | null | https://raw.githubusercontent.com/lemenkov/erlrtpproxy/47b0bb92f6cf9dbc012ea6f1bb757d07ea06734d/test/rtpproxy_rtp_handling_rfc1918_test.erl | erlang | ----------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
... | Copyright ( c ) 2012 < >
DISCLAIMED . IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
ANY THEORY OF LIABILITY , WHETHER IN CONTRAC... |
f555c41da5895d286bd76d906aeac78d264ff98c6d5f0209af2e375a2d058ec2 | privet-kitty/cl-competitive | binom-mod-prime.lisp | (defpackage :cp/test/binom-mod-prime
(:use :cl :fiveam :cp/binom-mod-prime :cp/mod-binomial :cp/static-mod)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/binom-mod-prime)
(in-suite base-suite)
(test binom
(is (= 0 (binom -1 1)))
(is (= 0 (binom 1 -2)))
(is (= 0 (binom 1 3)))
(is (= 1 (bin... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/cd7240b26c5522f69ecbe8302809f3694586964e/module/test/binom-mod-prime.lisp | lisp | (defpackage :cp/test/binom-mod-prime
(:use :cl :fiveam :cp/binom-mod-prime :cp/mod-binomial :cp/static-mod)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/binom-mod-prime)
(in-suite base-suite)
(test binom
(is (= 0 (binom -1 1)))
(is (= 0 (binom 1 -2)))
(is (= 0 (binom 1 3)))
(is (= 1 (bin... | |
fe05239679f56ced0cfccf39426762be31e5df75c394aed8a844a451f1cd5b93 | eugeneia/athens | explain.lisp | (in-package :conspack)
;; Debugging
(defvar *explain-eof* nil)
(defmacro explaining-errors (&body body)
`(handler-case
(unless *explain-eof*
(progn ,@body))
(invalid-header (c) (list 'invalid-header
(conspack-error-value c)
(consp... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/cl-conspack-20170403-git/src/explain.lisp | lisp | Debugging | (in-package :conspack)
(defvar *explain-eof* nil)
(defmacro explaining-errors (&body body)
`(handler-case
(unless *explain-eof*
(progn ,@body))
(invalid-header (c) (list 'invalid-header
(conspack-error-value c)
(conspack-error-reaso... |
23357ffd93bdbe8d3969f2176c822f4ccc1f4b5bfb6012cdc16aaba94d6fde9a | votinginfoproject/data-processor | precinct_test.clj | (ns vip.data-processor.validation.db.v3-0.precinct-test
(:require [vip.data-processor.validation.db.v3-0.precinct :refer :all]
[vip.data-processor.test-helpers :refer :all]
[clojure.test :refer :all]
[vip.data-processor.validation.csv :as csv]
[vip.data-processor.valida... | null | https://raw.githubusercontent.com/votinginfoproject/data-processor/b4baf334b3a6219d12125af8e8c1e3de93ba1dc9/test/vip/data_processor/validation/db/v3_0/precinct_test.clj | clojure | (ns vip.data-processor.validation.db.v3-0.precinct-test
(:require [vip.data-processor.validation.db.v3-0.precinct :refer :all]
[vip.data-processor.test-helpers :refer :all]
[clojure.test :refer :all]
[vip.data-processor.validation.csv :as csv]
[vip.data-processor.valida... | |
874ec442c2f7a08c7eedf5519ebd495aa9c1e476c67c537cb4e35deff8314587 | jackfirth/point-free | fixpoint.rkt | #lang racket
(require rackunit)
(provide until-fixpoint
fixpoint?)
(define (until-fixpoint f)
(define (fixpoint-f v)
(let ([fv (f v)])
(if (eq? fv v)
fv
(fixpoint-f fv))))
fixpoint-f)
(module+ test
(define (f x)
(if (zero? (modulo x 3))
x
(sub1 x)))
... | null | https://raw.githubusercontent.com/jackfirth/point-free/d294a342466d5071dd2c8f16ba9e50f9006b54af/point-free/fixpoint.rkt | racket | #lang racket
(require rackunit)
(provide until-fixpoint
fixpoint?)
(define (until-fixpoint f)
(define (fixpoint-f v)
(let ([fv (f v)])
(if (eq? fv v)
fv
(fixpoint-f fv))))
fixpoint-f)
(module+ test
(define (f x)
(if (zero? (modulo x 3))
x
(sub1 x)))
... | |
b5fb93560811d7a6ea812a23a0064e2865cf578f40821c962a8371a61c80ad69 | csabahruska/jhc-components | IO.hs | # OPTIONS_JHC -fno - prelude -fffi -funboxed - values #
module Prelude.IO(
IO(),
ioError,
catch,
runExpr,
FilePath(),
putStr,
putStrLn,
print,
getLine,
getContents,
readFile,
interact,
writeFile,
appendFile,
putChar,
runExpr,
getChar,
userError
... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/lib/jhc/Prelude/IO.hs | haskell | # RULES "putStr/++" forall xs ys . putStr (xs ++ ys) = putStr xs >> putStr ys #
| The 'interact' function takes a function of type @String->String@
as its argument. The entire input from the standard input device is
passed to this function as its argument, and the resulting string is
output on the standard ou... | # OPTIONS_JHC -fno - prelude -fffi -funboxed - values #
module Prelude.IO(
IO(),
ioError,
catch,
runExpr,
FilePath(),
putStr,
putStrLn,
print,
getLine,
getContents,
readFile,
interact,
writeFile,
appendFile,
putChar,
runExpr,
getChar,
userError
... |
7d705303100c40c0aa33d7ff1b6d1ce932ca234c9be4d07b54658e12b08b7304 | mikera/core.matrix | calling_benchmark.clj | (ns clojure.core.matrix.calling-benchmark
(:require [criterium.core :as c])
(:import [clojure.core.matrix ClassPair]))
;; benchmark for a few different calling conventions
(set! *unchecked-math* true)
;; (set! *warn-on-reflection* true)
;; an array to mutate: gives methods something to do with a side effect
(def... | null | https://raw.githubusercontent.com/mikera/core.matrix/0a35f6e3d6d2335cb56f6f3e5744bfa1dd0390aa/src/test/clojure/clojure/core/matrix/calling_benchmark.clj | clojure | benchmark for a few different calling conventions
(set! *warn-on-reflection* true)
an array to mutate: gives methods something to do with a side effect
extend PExtendedOperation to MyType *after* it is defined
so we can determine extra overhead of extending
classes with an optimised hashCode etc. This speeds up m... | (ns clojure.core.matrix.calling-benchmark
(:require [criterium.core :as c])
(:import [clojure.core.matrix ClassPair]))
(set! *unchecked-math* true)
(def arr (long-array 1))
Java interface
(definterface IInterface
(interfaceCall [i])
(interfaceCallPrim [^long i]))
Protocol
(defprotocol POperation
(pro... |
acf9386c7079acb70c90c0595592391723897d755f367871d4ac22ffb46cbe3e | deech/fltkhs-demos | make-tree.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Graphics.UI.FLTK.LowLevel.FL as FL
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.FLTKHS
import Control.Monad
main :: IO ()
main = do
win' <- windowNew (Size (Width 500) (Height 500)) Nothing (Just "FLTK Tree Window")
... | null | https://raw.githubusercontent.com/deech/fltkhs-demos/64ed6dfd281d309535ea94d6396c0260395b37d0/src/Examples/make-tree.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import qualified Graphics.UI.FLTK.LowLevel.FL as FL
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.FLTKHS
import Control.Monad
main :: IO ()
main = do
win' <- windowNew (Size (Width 500) (Height 500)) Nothing (Just "FLTK Tree Window")
begin win'
tree' <- treeNew (toR... |
576cf0cf43c42e49abd42e0cdaa95a71a82f90fdc859be28280502ff4e79cb3e | Chris00/ocaml-cairo | setsourcegradient.ml | (* This file is part of the tutorial
/
*)
let () =
let surface = Cairo.Image.create Cairo.Image.ARGB32 ~w:120 ~h:120 in
let cr = Cairo.create surface in
Examples are in 1.0 x 1.0 coordinate space
Cairo.scale cr 120. 120.;
(* Drawing code goes here *)
let radpat = Cairo.Pattern.create_radial ~x0:0.25 ~y... | null | https://raw.githubusercontent.com/Chris00/ocaml-cairo/202674a8d0c533b689ceacdb523ca167611e1b4c/examples/setsourcegradient.ml | ocaml | This file is part of the tutorial
/
Drawing code goes here
Write output |
let () =
let surface = Cairo.Image.create Cairo.Image.ARGB32 ~w:120 ~h:120 in
let cr = Cairo.create surface in
Examples are in 1.0 x 1.0 coordinate space
Cairo.scale cr 120. 120.;
let radpat = Cairo.Pattern.create_radial ~x0:0.25 ~y0:0.25 ~r0:0.1
~x1:0.5 ~y1:0.5 ... |
78351cb8573fb0f9cd81286a9d32ef148d464511afda91a9c0352cb0bcd2aebe | parsonsmatt/gear-tracker | Prelude.hs | module Spec.GT.Prelude
( module GT.Prelude
, module Test.Hspec.Expectations.Lifted
, module Test.Hspec
) where
import GT.Prelude
import Test.Hspec hiding
( shouldBe
, shouldContain
, shouldEndWith
, shouldMatchList
, shouldNotBe
, shouldNotContain
, shou... | null | https://raw.githubusercontent.com/parsonsmatt/gear-tracker/b7a597b32322e8938192a443572e6735219ce8ff/test/Spec/GT/Prelude.hs | haskell | module Spec.GT.Prelude
( module GT.Prelude
, module Test.Hspec.Expectations.Lifted
, module Test.Hspec
) where
import GT.Prelude
import Test.Hspec hiding
( shouldBe
, shouldContain
, shouldEndWith
, shouldMatchList
, shouldNotBe
, shouldNotContain
, shou... | |
24387610b9ee35b6809e802f04ac2a6a2700c42e90e263aeb123264457fad13b | mrphlip/aoc | 02.hs | # OPTIONS_GHC -Wno - tabs #
import Data.List
import qualified Text.ParserCombinators.ReadP as P
import Control.Exception
import Utils
data Password = Password Integer Integer Char String deriving Eq
getInput :: IO [Password]
getInput = do
dat <- readFile "02.txt"
return $ map parseInputLine $ lines dat
parseInputL... | null | https://raw.githubusercontent.com/mrphlip/aoc/06395681eb6b50b838cd4561b2e0aa772aca570a/2020/02.hs | haskell | # OPTIONS_GHC -Wno - tabs #
import Data.List
import qualified Text.ParserCombinators.ReadP as P
import Control.Exception
import Utils
data Password = Password Integer Integer Char String deriving Eq
getInput :: IO [Password]
getInput = do
dat <- readFile "02.txt"
return $ map parseInputLine $ lines dat
parseInputL... | |
fe10a23f5f9013d60188394c93cdf66a0457a0bea280be309aa0da59f0145a4c | janestreet/core | deriving_hash_intf.ml | open! Import
module type S = sig
type t [@@deriving hash]
end
module type Deriving_hash = sig
module Of_deriving_hash
(Repr : S) (M : sig
type t
val to_repr : t -> Repr.t
end) : S with type t := M.t
end
| null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/deriving_hash_intf.ml | ocaml | open! Import
module type S = sig
type t [@@deriving hash]
end
module type Deriving_hash = sig
module Of_deriving_hash
(Repr : S) (M : sig
type t
val to_repr : t -> Repr.t
end) : S with type t := M.t
end
| |
43302e43887de23d315257a02bae29294af231e2780cd19638c4cf520b3737f7 | david-vanderson/warp | sandbox.rkt | #lang racket/base
(require racket/gui)
(require "defs.rkt"
"client.rkt"
"server.rkt")
(define b (box #f))
(thread (lambda ()
(start-server #:spacebox b)))
(start-client PORT #:ip "127.0.0.1" #:name "Alice" #:spacebox b)
( start - client PORT # : ip " 127.0.0.1 " # : name " "
; ... | null | https://raw.githubusercontent.com/david-vanderson/warp/cdc1d0bd942780fb5360dc6a34a2a06cf9518408/sandbox.rkt | racket | #:new-eventspace? #t) | #lang racket/base
(require racket/gui)
(require "defs.rkt"
"client.rkt"
"server.rkt")
(define b (box #f))
(thread (lambda ()
(start-server #:spacebox b)))
(start-client PORT #:ip "127.0.0.1" #:name "Alice" #:spacebox b)
( start - client PORT # : ip " 127.0.0.1 " # : name " "
(yield 'w... |
7c305a47c5737fcacf7938fc64c202a9cf99f21c9c3ef44cd16091d813a6d363 | Kakadu/fp2022 | parser.mli | * Copyright 2022 - 2023 , and contributors
* SPDX - License - Identifier : LGPL-3.0 - or - later
Parser analyzes and executes commands based on the ouput of the tokenizer
open Type
exception Malformed of string
exception Empty
(* partition the line into commands and get rid of ";" *)
val parse : database -> st... | null | https://raw.githubusercontent.com/Kakadu/fp2022/0eb49bf60d173287607678159465c425cdf699be/SQLyd/lib/parser.mli | ocaml | partition the line into commands and get rid of ";"
parse a create database command to send to controller_create to create a table
saves proposed table as csv files
exposed helper to test, starting below, comment out when deploy
Evaluate AND relationships
Evaluate OR relationships | * Copyright 2022 - 2023 , and contributors
* SPDX - License - Identifier : LGPL-3.0 - or - later
Parser analyzes and executes commands based on the ouput of the tokenizer
open Type
exception Malformed of string
exception Empty
val parse : database -> string -> database
parse one command and call the appropr... |
967ad3eb523310652a38750acd7d3c0fbff61b517b54b3a12fe8b3aaac16623d | ff-notes/ron | Event.hs | # LANGUAGE BinaryLiterals #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
module RON.Event (
CalendarTime (..),
Event (..),
Time (..),
TimeVariety (... | null | https://raw.githubusercontent.com/ff-notes/ron/0df2b7985996ecc498808ea7247d0d8de471da4f/ron/lib/RON/Event.hs | haskell | | Calendar format. See .
# COMPLETE Calendar, Logical, Epoch, Unknown #
| Replica id assignment style
| Replica identifier.
| Generic Lamport time event.
If you want comparable events, use specific 'EpochEvent'.
| Get current replica id
| Get sequential timestamps.
Laws:
t <- getEvents n
(t !! i) == head t + ... | # LANGUAGE BinaryLiterals #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
module RON.Event (
CalendarTime (..),
Event (..),
Time (..),
TimeVariety (... |
9043161e7e1f54c22e740e6c8343d50d5db62f247aa49e5f15cff2d1c6506030 | joearms/erlmediaserver | root_device.erl | %% Author: ua
Created : Apr 20 , 2010
%% Description: TODO: Add description to root_device
-module(root_device).
-behaviour(gen_server).
%%
%% Include files
%%
-include_lib("eunit/include/eunit.hrl").
-include("../include/upnp.hrl").
%%
%% Exported Functions
%%
-export([get_ip/0, get_port/0, get_services/0, get_des... | null | https://raw.githubusercontent.com/joearms/erlmediaserver/35ef0d8300c50a273ee0122ccce65973af4c3a73/src/root_device.erl | erlang | Author: ua
Description: TODO: Add description to root_device
Include files
Exported Functions
gen_server callbacks
====================================================================
Server functions
====================================================================
--------------------------------------... | Created : Apr 20 , 2010
-module(root_device).
-behaviour(gen_server).
-include_lib("eunit/include/eunit.hrl").
-include("../include/upnp.hrl").
-export([get_ip/0, get_port/0, get_services/0, get_description_uri/0, get_uuid/0, get_os/0, createRootdevice/0]).
-export([get_ip_as_string/0, get_ip_port/0, get_os_info/0,... |
d04d69e4156e429ac3c56fcad84b72799e2b1f7b56d726b4970cf67c4331fa51 | cldm/cldm | interval.lisp | (in-package :cldm)
(defstruct (interval (:print-function print-interval))
from
to
(from-type :closed)
(to-type :closed))
(defun print-interval (interval stream depth)
(declare (ignore depth))
(format stream "~A~A, ~A~A"
(ecase (interval-from-type interval)
(:closed "[")
(:opened "("))
(int... | null | https://raw.githubusercontent.com/cldm/cldm/899f1a92d52245ef0fc84d073ac35c4b0d2e9609/src/interval.lisp | lisp | make an empty interval
else | (in-package :cldm)
(defstruct (interval (:print-function print-interval))
from
to
(from-type :closed)
(to-type :closed))
(defun print-interval (interval stream depth)
(declare (ignore depth))
(format stream "~A~A, ~A~A"
(ecase (interval-from-type interval)
(:closed "[")
(:opened "("))
(int... |
831b5d0b5d565fb4aa5376cc095d0fee076f6a58bf1a5cd2adaacc7c21aabc77 | anmonteiro/aemette | aemette.clj | (ns leiningen.new.aemette
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main]))
(def render (renderer "aemette"))
(def valid-opts ["+next"])
(defn get-unsupported-opts [opts]
(clojure.set/difference (set opts) (set valid-opts)))
(defn valid-opts?... | null | https://raw.githubusercontent.com/anmonteiro/aemette/c49983e71154db4b4a9c4f751d4413682647f5a5/src/leiningen/new/aemette.clj | clojure | (ns leiningen.new.aemette
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main]))
(def render (renderer "aemette"))
(def valid-opts ["+next"])
(defn get-unsupported-opts [opts]
(clojure.set/difference (set opts) (set valid-opts)))
(defn valid-opts?... | |
998bbdd5d817c981df5936b5e184294a1287dc3cc8c482cf686539206f7611b4 | ocsigen/obrowser | syntax_js.ml | open Js ;;
open Html ;;
open Syntax_common ;;
(* syntax colouring parameters *)
let sty_comments = "color:#808000; font-style:italic;"
and sty_string = "color:darkviolet"
and sty_paren = [| "background-color:#FF0000; color:white" (* too much '</m>' *);
"color:#008000" ; "color:#C0C000" ; "color:#C05600" ;
... | null | https://raw.githubusercontent.com/ocsigen/obrowser/977c09029ea1e4fde4fb0bf92b4d893835bd9504/tutorial/syntax_js.ml | ocaml | syntax colouring parameters
too much '</m>' | open Js ;;
open Html ;;
open Syntax_common ;;
let sty_comments = "color:#808000; font-style:italic;"
and sty_string = "color:darkviolet"
"color:#008000" ; "color:#C0C000" ; "color:#C05600" ;
"color:#C00000" ; "color:#800080" ; "color:#0000C0" ;
"color:#008080" |]
and sty_odd_line = "background-... |
5727dae0801a1bc42ee86d109b0742e7f717dfc9dcb2c22c61d575537a70c5a7 | ds-wizard/engine-backend | List_DELETE.hs | module Wizard.Api.Handler.DocumentTemplate.List_DELETE where
import Data.Maybe (catMaybes)
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Model.Context.BaseContext
import Wizard.Service.DocumentTemplate.DocumentTemplateServic... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/DocumentTemplate/List_DELETE.hs | haskell | module Wizard.Api.Handler.DocumentTemplate.List_DELETE where
import Data.Maybe (catMaybes)
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Model.Context.BaseContext
import Wizard.Service.DocumentTemplate.DocumentTemplateServic... | |
bf26e44a59ade82b22df1ff501874b8f5322804b6394b10419f1e1c7f4cd7788 | WhatsApp/eqwalizer | tuple_union.erl | -module(tuple_union).
-compile([export_all, nowarn_export_all]).
-type t1() ::
{msg, ok | err, arg}.
-type t2() ::
{msg, ok, arg} | {msg, err, arg}.
-spec test_01(t1 ()) -> t2().
test_01(X) -> X.
% More complex with several incompatible tuples
-type t3() ::
{msg, ok, arg} | {msg, err} | {foo, ok, ar... | null | https://raw.githubusercontent.com/WhatsApp/eqwalizer/9935940d71ef65c7bf7a9dfad77d89c0006c288e/eqwalizer/test_projects/check/src/tuple_union.erl | erlang | More complex with several incompatible tuples
We do not handle doubly-factorisable unions
Aliases
Recursive types | -module(tuple_union).
-compile([export_all, nowarn_export_all]).
-type t1() ::
{msg, ok | err, arg}.
-type t2() ::
{msg, ok, arg} | {msg, err, arg}.
-spec test_01(t1 ()) -> t2().
test_01(X) -> X.
-type t3() ::
{msg, ok, arg} | {msg, err} | {foo, ok, argfoo} | {msg, err, arg}.
-spec test_02(t1 ()) -... |
f866bf4b7817057d414317c6cfb8d656854326c04780891cfd25604c0964b17c | antalsz/choose-your-own-derivative | Choose.hs | # LANGUAGE DeriveGeneric , LambdaCase ,
TypeOperators , TypeFamilies , FlexibleInstances , UndecidableInstances ,
EmptyCase , ScopedTypeVariables , RankNTypes , ConstraintKinds , GADTs ,
DataKinds , PolyKinds , PartialTypeSignatures , TypeApplications , RecursiveDo ,
... | null | https://raw.githubusercontent.com/antalsz/choose-your-own-derivative/29897118314da416023977b317971ba4f840a5eb/src/Choose.hs | haskell | # OPTIONS_GHC -Wall -Wcompat -fno-warn-unticked-promoted-constructors #
------------------------------------------------------------------------------
Choosable Type Class --------------------------------------------------------
------------------------------------------------------------------------------
-----------... | # LANGUAGE DeriveGeneric , LambdaCase ,
TypeOperators , TypeFamilies , FlexibleInstances , UndecidableInstances ,
EmptyCase , ScopedTypeVariables , RankNTypes , ConstraintKinds , GADTs ,
DataKinds , PolyKinds , PartialTypeSignatures , TypeApplications , RecursiveDo ,
... |
5b49826337d8c4d62066fb338b8f58bc25f9ca4c8ade3f465ca43e370c896eea | jonase/eastwood | consumer4.clj | (ns testcases.unusednsimport.consumer4
;; This require is needed to properly import the record below
(:require [testcases.unusednsimport.defrecord])
(:import (testcases.unusednsimport.defrecord A)))
;; Exercises metadata:
(defn ^A sample []
;; return nil (and not `(A.)` so that we are certain that only metadat... | null | https://raw.githubusercontent.com/jonase/eastwood/c5b7d9f8ad8f8b38dc7138d853cc65f6987d6058/cases/testcases/unusednsimport/consumer4.clj | clojure | This require is needed to properly import the record below
Exercises metadata:
return nil (and not `(A.)` so that we are certain that only metadata is being exercised) | (ns testcases.unusednsimport.consumer4
(:require [testcases.unusednsimport.defrecord])
(:import (testcases.unusednsimport.defrecord A)))
(defn ^A sample []
nil)
|
2e60e12dfda5331a2e5050fe65fc61b6b36b6f121289a617c1281110abaef6ed | jellelicht/guix | pumpio.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/pumpio.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages pumpio)
#:use-module (guix licenses)
#:use-module (guix... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.