_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 |
|---|---|---|---|---|---|---|---|---|
d1a10b754499c35f0fc62deef8705997e8b92b8ca197e5c56cb1c2476b1086aa | teawaterwire/web4th | onboarding.cljs | (ns app.actions.onboarding
(:require
[app.actions.entrypoint :as actions]))
(defn c-onboarding [state]
[:div.text-center
[:span.font-bold.text-xl "Welcome to a "
[:a.underline {:href "" :target "_blank"} "web4ᵗʰ"]
" app!"]
[:br]
[:div.text-left.mt-2
"You can say "
[:button {:class "t... | null | https://raw.githubusercontent.com/teawaterwire/web4th/95e6421657e6a352b685e609f0c4d8404f5f8cb1/src/app/actions/onboarding.cljs | clojure | (ns app.actions.onboarding
(:require
[app.actions.entrypoint :as actions]))
(defn c-onboarding [state]
[:div.text-center
[:span.font-bold.text-xl "Welcome to a "
[:a.underline {:href "" :target "_blank"} "web4ᵗʰ"]
" app!"]
[:br]
[:div.text-left.mt-2
"You can say "
[:button {:class "t... | |
ab5aa60289468de85b3149094656d4e54f7e8f6d702fc1bf07112f7567818806 | jacopoMauro/dm552 | Tic.hs | The simple version of Tic - tac - toe written in class Apr. 1st .
-- Note we did not expose our function in a module, nor make any IO to make it more interactive.
import Data.Array
import Data.Char
import Data.List
-- Typeclass for games, this is not necessary to make Tic work.
class Game g where
players :: g -> ... | null | https://raw.githubusercontent.com/jacopoMauro/dm552/06276d7e7139d9d20d25ab31481575bcc92c6540/previous_edition_material/2019/haskell/tictactoe/Tic.hs | haskell | Note we did not expose our function in a module, nor make any IO to make it more interactive.
Typeclass for games, this is not necessary to make Tic work.
The actual tic-tac-toe game object.
An alias for working with the board.
A player type.
The piece type, where None means no piece is in that position.
We did ... | The simple version of Tic - tac - toe written in class Apr. 1st .
import Data.Array
import Data.Char
import Data.List
class Game g where
players :: g -> [Player]
numPlayers :: g -> Int
numPlayers g = length $ players g
data Tic = Tic { board :: Board,
player :: Player} deriving ()
type Boa... |
f196947bc8e3c94ca682d06b34e2801de0ee141300655de0983ac095f60d7731 | callum-oakley/advent-of-code | 09.clj | (ns aoc.2016.09
(:require
[clojure.test :refer [deftest is]]))
(defn decompress [s]
(if-let [[_ prefix len mul suffix]
(re-matches #"([A-Z]*)\((\d+)x(\d+)\)(.*)" s)]
(let [len (read-string len)
mul (read-string mul)]
(str prefix
(apply str (repeat mul (subs suffix 0 len... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/da5233fc0fd3d3773d35ee747fd837c59c2b1c04/src/aoc/2016/09.clj | clojure | (ns aoc.2016.09
(:require
[clojure.test :refer [deftest is]]))
(defn decompress [s]
(if-let [[_ prefix len mul suffix]
(re-matches #"([A-Z]*)\((\d+)x(\d+)\)(.*)" s)]
(let [len (read-string len)
mul (read-string mul)]
(str prefix
(apply str (repeat mul (subs suffix 0 len... | |
f1e078661989e7e9d10155eb299effef7972211571bf09e9169d963f9bd99a51 | RBornat/jape | miscellaneous.mli |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... | null | https://raw.githubusercontent.com/RBornat/jape/d2f507023c8a227e6862f9e5a16bb16ddeda692c/distrib/camlengine/miscellaneous.mli | ocaml | whether to add context automatically to rule definitions
conjectures allowed in proofs
show 'goal' when printing proofs
whether to fold sequents in treedraw
number of lemmas during THIS proof
allows multiple hypothesis selections
resolution is a possibility in the current match
how to press-and-drag over... |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... |
10060d04da91963c6cff36060addd461835cdda79aabf63e93014ff282be6157 | sgbj/MaximaSharp | trans5.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The data in this file contains enhancments. ;;;;;
;;; ;;;;;
... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/trans5.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
The data in this file contains enhancments. ;;;;;
;;;;;
; ; ; ;
All rights reserved ;;;;;
; ;
but it evalua... |
(in-package :maxima)
(macsyma-module trans5)
these are TRANSLATE properies for the FSUBRS in >
LDISPLAY is one of the most beastly of all idiot
constructs . First of all it makes a variable name and sets it ,
x:10 , ) ) gives ( E1 ) F(10)= ...
LDISPLAY(X ) gives X=10 of course . Sometimes it evalu... |
74afc4b95802f119feef21cf45b4c0355e8ef854462e94fb15621a05bcadf441 | shayne-fletcher/zen | empty.ml | open Import
let mk_cmd cmd =
Cfg.cfg >>| fun {cli_exe} ->
sprintf "%s 2>&1 %s" cli_exe cmd
let init () =
mk_cmd {|del "S" > /dev/null|} >>=
Sys.command
let test path =
let cmd=
sprintf "add \"%s\" -fmt json \"[\\\"Structure\\\"]\"" path in
mk_cmd cmd >>=
Sys.command_exn
let tests () =
init () >>... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/command/empty.ml | ocaml | open Import
let mk_cmd cmd =
Cfg.cfg >>| fun {cli_exe} ->
sprintf "%s 2>&1 %s" cli_exe cmd
let init () =
mk_cmd {|del "S" > /dev/null|} >>=
Sys.command
let test path =
let cmd=
sprintf "add \"%s\" -fmt json \"[\\\"Structure\\\"]\"" path in
mk_cmd cmd >>=
Sys.command_exn
let tests () =
init () >>... | |
70d63ed4576a99ad645687d7f4fa58646c5201ff4be882cb8caeb8658fc99414 | lambdaclass/erlang-katana | ktn_os.erl | %% @doc Utility functions to run commands in the underlying OS.
-module(ktn_os).
-export([command/1, command/2]).
-type opts() :: #{log_fun => fun((iodata()) -> any()), timeout => integer()}.
-type exit_status() :: integer().
-spec command(iodata()) -> {exit_status(), string()}.
command(Cmd) ->
Opts = #{log_fun =>... | null | https://raw.githubusercontent.com/lambdaclass/erlang-katana/ebb6b1358c974b5e3b16f5e95422061385ae34ac/src/ktn_os.erl | erlang | @doc Utility functions to run commands in the underlying OS.
We insert a new line after the command, in case the command
contains a comment character. | -module(ktn_os).
-export([command/1, command/2]).
-type opts() :: #{log_fun => fun((iodata()) -> any()), timeout => integer()}.
-type exit_status() :: integer().
-spec command(iodata()) -> {exit_status(), string()}.
command(Cmd) ->
Opts = #{log_fun => fun error_logger:info_msg/1},
command(Cmd, Opts).
-spec comm... |
a8d8eedfb56262968760d7b4e0464569fda13d456b6d6d53c90aa413f73cd5ae | techascent/tech.ml | discrete_nb.clj | (ns tech.v3.libs.smile.discrete-nb
(:require [tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.libs.smile.nlp :as nlp]
[tech.v3.datatype.errors :as errors]
[tech.v3.ml :as ml])
(:import [smile.classification DiscreteNaiveBayes DiscreteNaiveBayes... | null | https://raw.githubusercontent.com/techascent/tech.ml/7f2cc506980a05f0f8c85f8b1ff0cde6b9451f54/src/tech/v3/libs/smile/discrete_nb.clj | clojure | (ns tech.v3.libs.smile.discrete-nb
(:require [tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.libs.smile.nlp :as nlp]
[tech.v3.datatype.errors :as errors]
[tech.v3.ml :as ml])
(:import [smile.classification DiscreteNaiveBayes DiscreteNaiveBayes... | |
75d6a8c97609216c7288632791ef0ad08f3c2f49cfd388de1672358deac09c5d | monadbobo/ocaml-core | cbuffer.mli | *
Circular buffers .
THIS LIBRARY WILL BE DELETED IN FAVOUR OF DEQUEUE AT SOME POINT IN THE FUTURE
Circular buffers.
THIS LIBRARY WILL BE DELETED IN FAVOUR OF DEQUEUE AT SOME POINT IN THE FUTURE
*)
type 'a t = {
mutable data : 'a array; (* base of circular buffer *)
first position at which ... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/cbuffer.mli | ocaml | base of circular buffer
number of elements in buffer
whether to refrain from shrinking the buffer
value used to pack into newly allocated arrays
*
double the size of the buffer
*
half the size of the buffer
* initialize Cbuffer from array | *
Circular buffers .
THIS LIBRARY WILL BE DELETED IN FAVOUR OF DEQUEUE AT SOME POINT IN THE FUTURE
Circular buffers.
THIS LIBRARY WILL BE DELETED IN FAVOUR OF DEQUEUE AT SOME POINT IN THE FUTURE
*)
type 'a t = {
first position at which data is found
} with sexp
val create : ?never_shrink:bool... |
9345f3b3771bb5300d7a774430ea33ee8f1014f4665fc2f32ac02f9b917d8c8e | jship/opentelemetry-haskell | Internal.hs | # LANGUAGE BlockArguments #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module OTel.Instrumentation.Persistent.Internal
( -- * Disclaimer
-- $disclaim... | null | https://raw.githubusercontent.com/jship/opentelemetry-haskell/468b7df49226bb6a478180300dab8d1a214c213f/otel-instrumentation-persistent/library/OTel/Instrumentation/Persistent/Internal.hs | haskell | # LANGUAGE OverloadedStrings #
* Disclaimer
$disclaimer
TODO: Automatically pull package version
isn't exported. Should upstream exporting it rather than inlining it here.
TODO: 'emptySqlBackendHooks' and 'setConnHooks' are exported from
@persistent@, but there is no means of setting the single function in
'SqlB... | # LANGUAGE BlockArguments #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module OTel.Instrumentation.Persistent.Internal
buildSqlPoolHooks
, sqlPoolHooks
, setNewAlterBackend
, setNe... |
db5349113c8799c68aac0d877ad05921231fe8ce5e5c8685de5585ed32264ba4 | tlaplus/tlapm | why3_interface.ml | Interface to Why3 .
Created by on
Copyright ( c ) 2013 INRIA and Microsoft Corporation
Created by Hernán Vanzetto on
Copyright (c) 2013 INRIA and Microsoft Corporation
*)
open Ext
open Property
open Expr.T
open Printf
open List
open Smtcommons
module B = Builtin
open Typ_t
module T = Typ_t
module ... | null | https://raw.githubusercontent.com/tlaplus/tlapm/158386319f5b6cd299f95385a216ade2b85c9f72/src/typesystem/why3_interface.ml | ocaml | open Why3
open Format
the [main] section of the config file
all the provers detected, from the config file
builds the environment from the [loadpath]
: Tm.term
Util.eprintf
"to_why: %a"
(print_prop ()) (opaque cx e);
| Apply ({core=Opaque id}, es) ->
| FcnApp (f, es) ->
| Dot (ex... | Interface to Why3 .
Created by on
Copyright ( c ) 2013 INRIA and Microsoft Corporation
Created by Hernán Vanzetto on
Copyright (c) 2013 INRIA and Microsoft Corporation
*)
open Ext
open Property
open Expr.T
open Printf
open List
open Smtcommons
module B = Builtin
open Typ_t
module T = Typ_t
module ... |
1844169344515616c2ad9f413c2499dbdc5c3a807cd8a001dd3c7f34a0fa561e | LeapYear/aeson-schemas | TH.hs | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Tests.UnwrapQQ.TH where
import Control.DeepSeq (deepseq)
import Language.Haskell.TH (appTypeE)
import Language.Haskell.TH.Quote (QuasiQuoter (..))
import Language.Haskell.TH.TestUtils (
MockedMode (..),
QMode (..),
QState (..),
... | null | https://raw.githubusercontent.com/LeapYear/aeson-schemas/7693390d8f84da6498470ec0a61768a871967abc/test/Tests/UnwrapQQ/TH.hs | haskell | Compile above schemas before these schemas
Compile above types before reifying | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Tests.UnwrapQQ.TH where
import Control.DeepSeq (deepseq)
import Language.Haskell.TH (appTypeE)
import Language.Haskell.TH.Quote (QuasiQuoter (..))
import Language.Haskell.TH.TestUtils (
MockedMode (..),
QMode (..),
QState (..),
... |
8e9f0453f610e520f57fbd5083a10328129b53e8d10d0327d22ef20b35893ddf | quux00/go-lightly | conc_prime_sieve.clj | (ns thornydev.go-lightly.primes.conc-prime-sieve
(:refer-clojure :exclude [take peek])
(:require [thornydev.go-lightly :refer :all]))
A Clojure implementation of the Concurrent Primary Sieve
;; example in Go, using the go-lightly library
Note : could not use a Lamina channel for this particular
impleme... | null | https://raw.githubusercontent.com/quux00/go-lightly/815052a72af678e8c84d7a9716c50f7008d8971e/go-lightly-examples/clj-examples/src/thornydev/go_lightly/primes/conc_prime_sieve.clj | clojure | example in Go, using the go-lightly library
which is unbounded and non-blocking
Based on Go implementation at:
| (ns thornydev.go-lightly.primes.conc-prime-sieve
(:refer-clojure :exclude [take peek])
(:require [thornydev.go-lightly :refer :all]))
A Clojure implementation of the Concurrent Primary Sieve
Note : could not use a Lamina channel for this particular
implementation , bcs it uses ConcurrentLinkedQueue ,
... |
f2fb9739be73816446c8a3c75ea17ec002f66e88009fc2408b1f5094d8913936 | mhuebert/chia | context.cljs | (ns chia-demo.views.context
(:require [chia.view :as v]
[chia.view.legacy :as legacy]
[chia.reactive :as r]))
(defn counter []
(let [{:keys [view/state]} r/*reader*]
(r/silently
(swap! state update :count (fnil inc 0)))
[:div (str "Renders:" (:count @state 0))]))
(defn clicks ... | null | https://raw.githubusercontent.com/mhuebert/chia/74ee3ee9f86efbdf81d8829ab4f0a44d619c73d3/website/src/chia_demo/views/context.cljs | clojure | (ns chia-demo.views.context
(:require [chia.view :as v]
[chia.view.legacy :as legacy]
[chia.reactive :as r]))
(defn counter []
(let [{:keys [view/state]} r/*reader*]
(r/silently
(swap! state update :count (fnil inc 0)))
[:div (str "Renders:" (:count @state 0))]))
(defn clicks ... | |
c144db336624b543333a732edf53d1f150020f2b1ebca92bd7217f51e1042e37 | bos/rwh | SupplyInstance.hs | # LANGUAGE FlexibleInstances , MultiParamTypeClasses ,
GeneralizedNewtypeDeriving #
GeneralizedNewtypeDeriving #-}
module SupplyInstance where
import SupplyClass
import RandomSupply
import Control.Monad (liftM)
{-- snippet Reader --}
newtype Reader e a = R { runReader :: e -> a }
{-- /snippet Reader --}
{... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch16/SupplyInstance.hs | haskell | - snippet Reader -
- /snippet Reader -
- snippet Monad -
- /snippet Monad -
- snippet ask -
- /snippet ask -
more concise:
- /snippet MySupply -
- snippet runMS -
- /snippet runMS -
- snippet xy -
- /snippet xy - | # LANGUAGE FlexibleInstances , MultiParamTypeClasses ,
GeneralizedNewtypeDeriving #
GeneralizedNewtypeDeriving #-}
module SupplyInstance where
import SupplyClass
import RandomSupply
import Control.Monad (liftM)
newtype Reader e a = R { runReader :: e -> a }
instance Monad (Reader e) where
return a = R... |
737d20a40998f1bff269b7d6e4ba122276411159c03f6708966e4cc657437e68 | melhadad/fuf | test3.lisp | ;;; -*- Mode:Lisp; Syntax:Common-Lisp; Package: FUG5 -*-
;;; -----------------------------------------------------------------------
;;; File: test3.l
;;; Description: Test RALT construct
Author :
Created : 21 May 1990
;;; Modified:
;;; Log file: ChangeLog
Package : FUG5
;;;... | null | https://raw.githubusercontent.com/melhadad/fuf/57bd0e31afc6aaa03b85f45f4c7195af701508b8/examples/test3.lisp | lisp | -*- Mode:Lisp; Syntax:Common-Lisp; Package: FUG5 -*-
-----------------------------------------------------------------------
File: test3.l
Description: Test RALT construct
Modified:
Log file: ChangeLog
----------------------------------------------------------------------- | Author :
Created : 21 May 1990
Package : FUG5
(in-package "FUG5")
(setf a '((x ((a 1)))))
(setf b0 '((y ((ralt TEST (1 2 3))))))
(setf b1 '((x ((a ((ralt TEST (1 2 3 4))))))))
(setf b2 '((x ((a ((ralt TEST (2 3 4 5))))))))
(setf c '((x ((a 1))) (y 2)))
(setf d0 '((x ((ralt TEST (((a 1)) (... |
6eb8ecdc890309093c02f2eaac4219ea30943f380dd0ca6d0fb3f80939ee5f7d | initc3/SaUCy | TypeTest.hs | module Unit.TypeTest (
test_types
) where
import Text.PrettyPrint.ANSI.Leijen
import Text.Printf
import Test.Tasty
import Test.Tasty.HUnit
import Language.ILC.Decl
import Language.ILC.Eval
import Language.ILC.Infer.Infer (inferExpr)
import Language.ILC.Parser.Toplevel
import Language.ILC.Type (emptyTyEnv)
test... | null | https://raw.githubusercontent.com/initc3/SaUCy/199154c1f488af4561e4bf1f7f5f3ef8876dfa6b/test/Unit/TypeTest.hs | haskell | , "let f () = nu (r, w) . let (v, r) = rd r in v"
, "∀ a . !(Unit) -o@R !(a)")
, "let f () = nu (r, w) . let (v, r) = rd r in r"
, "∀ a . !(Unit) -o@R Rd a")
, ( "simple write"
, "Unit ->@W Unit")
, ( "sequential write"
, "ill-typed")
, ( "match branches good"
, "Un... | module Unit.TypeTest (
test_types
) where
import Text.PrettyPrint.ANSI.Leijen
import Text.Printf
import Test.Tasty
import Test.Tasty.HUnit
import Language.ILC.Decl
import Language.ILC.Eval
import Language.ILC.Infer.Infer (inferExpr)
import Language.ILC.Parser.Toplevel
import Language.ILC.Type (emptyTyEnv)
test... |
fe56244995945ea97426f9c82f32fcfea6076b3212dc8bf2235cc0716d1e99e4 | daveho/catparty | cparser.cljc | ; -*- mode: clojure -*-
Cat Party - C parser in Clojure / ClojureScript
Copyright ( c ) 2016 - 2017 , < >
;;
This is free software distributed under the GNU Public License , version 3 ,
or any later version . See COPYING.txt for details .
(ns catparty.cparser
(:require [catparty.node :as node]
... | null | https://raw.githubusercontent.com/daveho/catparty/015fffd1c30ea1685d633184b0f157ec3aed5c7c/src/catparty/cparser.cljc | clojure | -*- mode: clojure -*-
Recursive descent parser for C.
Adapted from the v3 and v4 ANTLR C grammars:
-v4/blob/master/c/C.g4
Also useful, ISO C grammar with opt factored out (very helpful
for figuring out how to handle abstract vs. concrete
/~mckeeman/cs48/references/c.html
----------------------------... |
Cat Party - C parser in Clojure / ClojureScript
Copyright ( c ) 2016 - 2017 , < >
This is free software distributed under the GNU Public License , version 3 ,
or any later version . See COPYING.txt for details .
(ns catparty.cparser
(:require [catparty.node :as node]
[catparty.parser :as p... |
8faeb58b06670d64d35d05bd7a100c2e5d23b35e4ab1159226c4537a819096b3 | arcfide/chez-srfi | conftest.scm | ; CONFIDENCE TESTS FOR SRFI-27 "Sources of Random Bits"
; =====================================================
;
, 2002 .
;
; This file contains a small collection of checks for the
; implementation of SRFI-27. It is not meant to be complete
; or to test the actual properties of the underlying generator.
;... | null | https://raw.githubusercontent.com/arcfide/chez-srfi/96fb553b6ba0834747d5ccfc08c181aa8fd5f612/%253a27/conftest.scm | scheme | CONFIDENCE TESTS FOR SRFI-27 "Sources of Random Bits"
=====================================================
This file contains a small collection of checks for the
implementation of SRFI-27. It is not meant to be complete
or to test the actual properties of the underlying generator.
It is merely meant to... | , 2002 .
DIEHARD battery of tests for random number
running this file in Scheme 48 0.57 with SRFI-27 installed :
, open srfi-27 srfi-23 ascii
speed in Scheme 48 0.57 with SRFI-27 opened :
, time ( do ( ( k 0 ( + k 1 ) ) ) ( (= k 100000 ) ) ( random - integer 2 ) )
running this file in ... |
7a87990d3a70f0c6f3271d1720d058b922e0588cbd70b3b7837b196c2d3ee5fd | adaliu-gh/htdp | 432-442.rkt | ;;================================
432
(define MAX 100000000)
;; Posn -> Posn
(define (food-create p)
(local ((define new-food (make-posn (random MAX) (random MAX))))
(if (equal? new-food p)
(food-create p)
new-food)))
;;=============================
433
;; [X] [List-of X] N -> [List-of [L... | null | https://raw.githubusercontent.com/adaliu-gh/htdp/a0fca8af2ae8bdcef40d56f6f45021dd92df2995/25-30%20Generative%20Recursion/432-442.rkt | racket | ================================
Posn -> Posn
=============================
[X] [List-of X] N -> [List-of [List-of X]]
bundle every n items together
[X] [List-of X] N -> [List-of [List-of X]]
[List-of Any] N -> [List-of Any]
[List-of Any] N -> [List-of Any]
=======================
when in l, there are some numbe... | 432
(define MAX 100000000)
(define (food-create p)
(local ((define new-food (make-posn (random MAX) (random MAX))))
(if (equal? new-food p)
(food-create p)
new-food)))
433
(define (bundle-check alon n)
(cond
[(and (= n 0) (> (length alon) 0))
(error "wrong input")]
[else (bundl... |
99fb0bce43981782d964745136f1e0f9c1c1edfbfcca72775cc7b3a01f5bbe24 | facebook/infer | costModels.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/6693381318c30c5dccb543ffd12d5309759c5793/infer/src/cost/costModels.ml | ocaml | * O(|m|) where m is the given string and |.| is the length function
* O(|m|-|n|) where m is the given string and n is the index to start searching from
* O(|m|.|n|) where m and n are the given strings
C++ Cost Models
Java Cost Models
TODO: T72085946; take the cost of function into account |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
a403ba352a96bb270b3311239acf72d725852e39bc4e09e46e2c8417848c1281 | merijn/Belewitte | Platform.hs | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE Tem... | null | https://raw.githubusercontent.com/merijn/Belewitte/cab6010a2bc54acfc4f4b169c95799fe455799ef/benchmark-analysis/src/Schema/Platform.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE Undeci... |
c66b2e1bab6cac9e27066fb7cb65b49afd399fd4115b60b43a6613760ac73100 | vert-x/mod-lang-clojure | platform.clj | Copyright 2013 the original author or authors .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, ... | null | https://raw.githubusercontent.com/vert-x/mod-lang-clojure/dcf713460b8f46c08d0db6e7bf8537f1dd91f297/api/src/main/clojure/vertx/embed/platform.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing... | Copyright 2013 the original author or authors .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns vertx.embed.platform
"Functions for running Vert.x embedded with a platform manager."
(:require [clojure.string :as str]
[vertx.core :as core]
[vertx.utils :as util])... |
2e4aed14e00ca9011ddaa531ef2425c5b3046ead3c478bf8c25cba0bb580bd14 | logseq/logseq | marker_test.cljs | (ns frontend.util.marker-test
(:require [cljs.test :refer [are deftest]]
[frontend.util.marker :as marker]))
(deftest add-or-update-marker-markdown
(are [content marker expect] (= expect (marker/add-or-update-marker content :markdown marker))
"test content" "TODO" "TODO test content"
"\nxxx\n" ... | null | https://raw.githubusercontent.com/logseq/logseq/590ed9c302e29b63fced36de82cbb478d6ae3bec/src/test/frontend/util/marker_test.cljs | clojure | (ns frontend.util.marker-test
(:require [cljs.test :refer [are deftest]]
[frontend.util.marker :as marker]))
(deftest add-or-update-marker-markdown
(are [content marker expect] (= expect (marker/add-or-update-marker content :markdown marker))
"test content" "TODO" "TODO test content"
"\nxxx\n" ... | |
4db091cb9a302dc2420ac89c1cab448b78b5464f0b9bf2344faf95b450265a49 | qiao/sicp-solutions | 3.82.scm | (define (random-in-range low high)
(let ((range (- high low)))
(+ low (random range))))
(define (random-stream-in-range low high)
(let ((v (random-in-range low high)))
(cons-stream v
(random-stream-in-range low high))))
(define (estimate-integral p x1 x2 y1 y2)
(let* ((area (* (- x2 x1)... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter3/3.82.scm | scheme | (define (random-in-range low high)
(let ((range (- high low)))
(+ low (random range))))
(define (random-stream-in-range low high)
(let ((v (random-in-range low high)))
(cons-stream v
(random-stream-in-range low high))))
(define (estimate-integral p x1 x2 y1 y2)
(let* ((area (* (- x2 x1)... | |
ab580405bd86a83e011c99a1ddc489201750403559e78540a82624fd4e08dfa4 | fragnix/fragnix | System.PosixCompat.Time.hs | # LANGUAGE Haskell98 #
# LINE 1 " src / System / PosixCompat / Time.hs " #
# LANGUAGE CPP #
|
This module makes the operations exported by . . Time@
available on all platforms . On POSIX systems it re - exports operations from
@System . . Time@ , on other platf... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/System.PosixCompat.Time.hs | haskell | # LANGUAGE Haskell98 #
# LINE 1 " src / System / PosixCompat / Time.hs " #
# LANGUAGE CPP #
|
This module makes the operations exported by . . Time@
available on all platforms . On POSIX systems it re - exports operations from
@System . . Time@ , on other platf... | |
1c3694dd32e10451c7f9c31f3133901a072c4ebce8e95ccdc351e4259e50a3c5 | dgiot/dgiot | emqx_frame_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2018 - 2021 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/a6b816a094b1c9bd024ce40b8142375a0f0289d8/test/emqx_frame_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2018 - 2021 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_frame_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-include_lib("em... |
2fbfcf0ed56a6490163606bf6ff40a0b0b7ca2ebb383904fd34db155820b61e6 | ActaFi/cardano-staking-smart-contract | Withdraw.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
|
Module : Tests . Attacks . Withdraw
Description : A new off - chain code to test an attack the withdra... | null | https://raw.githubusercontent.com/ActaFi/cardano-staking-smart-contract/1548ba69b6cc6f2706668aee103e36c8c0bac19e/test/Tests/Attacks/Withdraw.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
^ Endpoints
Third-party libraries libraries.
Schema.
Off-chain code. | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
|
Module : Tests . Attacks . Withdraw
Description : A new off - chain code to test an attack the withdraw validator .
Copyright : P2P Solutions Ltd.
License : GPL-3
Maintainer :
Stability : dev... |
f5fa4d6d09aca3605a9d9151f2aa946487ce4deb723b2886755f6fae787d1f80 | benzap/fif | reader.cljc | (ns fif.stdlib.reader
(:require
[fif.stack-machine :as stack]
[fif.stack-machine.evaluators :as evaluators]
[fif.stack-machine.words :as words :refer [set-global-word-defn]]
[fif.def :as def
:refer [wrap-function-with-arity
wrap-procedure-with-arity]
:include-macros true]))
(defn rea... | null | https://raw.githubusercontent.com/benzap/fif/972adab8b86c016b04babea49d52198585172fe3/src/fif/stdlib/reader.cljc | clojure | (ns fif.stdlib.reader
(:require
[fif.stack-machine :as stack]
[fif.stack-machine.evaluators :as evaluators]
[fif.stack-machine.words :as words :refer [set-global-word-defn]]
[fif.def :as def
:refer [wrap-function-with-arity
wrap-procedure-with-arity]
:include-macros true]))
(defn rea... | |
ecda3c2e437eb91ae57fdede419b16a6188cad3b9137301d7f8b89d88ab0608e | ZHaskell/z-io | ResourceSpec.hs | # LANGUAGE ScopedTypeVariables #
module Z.IO.ResourceSpec where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Z.Data.PrimRef
import Z.IO.Resource as R
import Test.Hspec
import Test.HUnit
data WorkerExcepti... | null | https://raw.githubusercontent.com/ZHaskell/z-io/c460e306e54e239efe461e3b141eb0c1f871fd39/test/Z/IO/ResourceSpec.hs | haskell | Let's test again | # LANGUAGE ScopedTypeVariables #
module Z.IO.ResourceSpec where
import Control.Concurrent
import Control.Exception
import Control.Monad
import Z.Data.PrimRef
import Z.IO.Resource as R
import Test.Hspec
import Test.HUnit
data WorkerExcepti... |
2a0af56f0d2127d311c967f997090fa71db985236dda6c955309148391a13b83 | k0001/tisch | Main.hs | {-# LANGUAGE Arrows #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedLabels #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
-- | This module contains test and example code. The funny th... | null | https://raw.githubusercontent.com/k0001/tisch/4d3fc55f0b64f50dc8a59b371e855a22d22f0a79/tests/Main.hs | haskell | # LANGUAGE Arrows #
| This module contains test and example code. The funny thing is that,
as most of this library happens at the type level, these tests run
while compiling the library.
Just for typechecking
------------------------------------------------------------------------------
nothing to do here, the te... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedLabels #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
You might learn a thing or two reading the source code .
module Main where
import ... |
e0763f30d5713b8956d2484ca32ba7b122031db6d90179c8391a6b7902fc3325 | Gbury/archsat | ext_rewrite.ml | This file is free software , part of Archsat . See file " LICENSE " for more details .
(* Extension name *)
let name = "rwrt"
(* Module initialisation *)
(* ************************************************************************ *)
module C = Ext_eq.Class
module T = CCSet.Make(C)
module S = Set.Make(Expr.Term)
m... | null | https://raw.githubusercontent.com/Gbury/archsat/322fbefa4a58023ddafb3fa1a51f8199c25cde3d/src/core/ext_rewrite.ml | ocaml | Extension name
Module initialisation
************************************************************************
Statistics
************************************************************************
Plugin state
************************************************************************
Splitting rewrite rules
... | This file is free software , part of Archsat . See file " LICENSE " for more details .
let name = "rwrt"
module C = Ext_eq.Class
module T = CCSet.Make(C)
module S = Set.Make(Expr.Term)
module H = Hashtbl.Make(Expr.Term)
module M = Hashtbl.Make(Expr.Id.Const)
module F = CCHashtbl.Make(Expr.Formula)
let section = ... |
bd3419b6d774e8d6d92417ba216374dce53534d8758c9f0f874ae630f558aa8e | opencog/learn | pair-api.scm | ;
pair-api.scm
;
; Define an API object for accessing word pairs.
;
Copyright ( c ) 2013 , 2014 , 2017 Linas Vepstas
;
; ---------------------------------------------------------------------
; OVERVIEW
; --------
; The object below defines an API to access pairs of natural language
word - pairs , stored in the At... | null | https://raw.githubusercontent.com/opencog/learn/358c313e747e0fed30d2737732e7bd514e3c0874/scm/pair-count/pair-api.scm | scheme |
Define an API object for accessing word pairs.
---------------------------------------------------------------------
OVERVIEW
--------
The object below defines an API to access pairs of natural language
matrix of (left, right) word pairs. This provides exactly the API
needed for use with the `(use-modules (... | pair-api.scm
Copyright ( c ) 2013 , 2014 , 2017 Linas Vepstas
word - pairs , stored in the AtomSpace , as a rank-2 matrix , i.e. as a
The specific Atomese uses this structure :
" ANY "
WordNode " left - word "
WordNode " right - word "
PredicateNode " ... |
f8281ce364ce4af0349060049e7aa251cee16783879227ed8adf8b9de6182f4d | fxfactorial/ocaml-reactjs | ppx_reactjs.ml | open Ast_mapper
(* open Ast_helper *)
open
open Parsetree
open Longident
(* open Reactjs_high_level *)
let s = try Sys.getenv s with Not_found - > " "
let =
(* (\* Our getenv_mapper only overrides the handling of expressions in the default mapper. *\) *)
(* { default_mapper with *)
(* expr = ... | null | https://raw.githubusercontent.com/fxfactorial/ocaml-reactjs/908377849d813f55df9f14715b50d2bc45a8304a/src/ppx/ppx_reactjs.ml | ocaml | open Ast_helper
open Reactjs_high_level
(\* Our getenv_mapper only overrides the handling of expressions in the default mapper. *\)
{ default_mapper with
expr = fun mapper expr ->
match expr with
(\* Is this an extension node? *\)
| { pexp_desc =
begin match pstr with ... | open Ast_mapper
open
open Parsetree
open Longident
let s = try Sys.getenv s with Not_found - > " "
let =
( \ * Should have name " " . * \ )
Pexp_extension ( { txt = " elem " ; , pstr ) } - >
PStr [ { pstr_desc =
Pstr_eval ( { pexp_loc... |
6dd8f9cde80f89a634494bcb734d0cbf4c94cc68ae8073c8c16fa1c17d185562 | MinaProtocol/mina | wrap.mli | open Pickles_types
val wrap :
max_proofs_verified:'max_proofs_verified Pickles_types.Nat.t
-> (module Pickles_types.Hlist.Maxes.S
with type length = 'max_proofs_verified
and type ns = 'max_local_max_proofs_verifieds )
-> ('max_proofs_verified, 'max_local_max_proofs_verifieds) Requests.Wrap.t
... | null | https://raw.githubusercontent.com/MinaProtocol/mina/8403887a428f56e91bfdf4187c6b8dc260e5424a/src/lib/pickles/wrap.mli | ocaml | open Pickles_types
val wrap :
max_proofs_verified:'max_proofs_verified Pickles_types.Nat.t
-> (module Pickles_types.Hlist.Maxes.S
with type length = 'max_proofs_verified
and type ns = 'max_local_max_proofs_verifieds )
-> ('max_proofs_verified, 'max_local_max_proofs_verifieds) Requests.Wrap.t
... | |
a592cc09d817ceeddb55cae92f271d695181a5e591dd1a296d0c9a6da998cf39 | dyzsr/ocaml-selectml | distant_errors.ml | (* TEST
* expect
*)
(** The aim of this file is to keep track of programs that are "far" from being well-typed *)
(** Arity mismatch between structure and signature *)
module M : sig
type (_, _) t
val f : (_, _) t -> unit
end = struct
type _ t
let f _ = ()
end
[%%expect{|
Lines 9-12, characters 6-3:
9 |... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-misc/distant_errors.ml | ocaml | TEST
* expect
* The aim of this file is to keep track of programs that are "far" from being well-typed
* Arity mismatch between structure and signature |
module M : sig
type (_, _) t
val f : (_, _) t -> unit
end = struct
type _ t
let f _ = ()
end
[%%expect{|
Lines 9-12, characters 6-3:
9 | ......struct
10 | type _ t
11 | let f _ = ()
12 | end
Error: Signature mismatch:
Modules do not match:
sig type _ t val f : 'a -> unit end
is ... |
14c00be67a88fd4269af8cfe2cabdcfb5c22748b60b612062029424b22fd0c7f | jordanthayer/ocaml-search | tsp_george_algs.ml |
open Tsp_instances
open Tsp
open Tsp_algs
* *
let george_global_err wt p lim =
unwrap_results (Simple_estimatedf.george_global_err ~limit:lim
~wt:(Some wt)
(Tsp.make_initial p.dists p.symmetric)
Tsp.goal_p
(Tsp.make_expand p.dists p.symmetric)
(Tsp.make_hd p.dists p.symmetric))
let... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/tsp/tsp_george_algs.ml | ocaml |
open Tsp_instances
open Tsp
open Tsp_algs
* *
let george_global_err wt p lim =
unwrap_results (Simple_estimatedf.george_global_err ~limit:lim
~wt:(Some wt)
(Tsp.make_initial p.dists p.symmetric)
Tsp.goal_p
(Tsp.make_expand p.dists p.symmetric)
(Tsp.make_hd p.dists p.symmetric))
let... | |
1377ffcfd46557cf65c4936e0ed80a3586ef91b2e7e7008fc44db37857ec4e20 | pol-is/polisMath | conversation.clj | Copyright ( C ) 2012 - present , The Authors . This program is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . This program is distributed in the hope that it will be useful , but WITHOUT A... | null | https://raw.githubusercontent.com/pol-is/polisMath/dfe233e8c9207c2ce11e1379286ad0cf0f732067/src/polismath/math/conversation.clj | clojure | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU Affero General Public License for more details . You should have received a copy of the GNU Affero General Public License along with this program . If not , see < / > .
Starting to spec out our domain model here... |
(ns polismath.math.conversation
(:refer-clojure :exclude [* - + == /])
(:require
[polismath.utils :as utils]
[polismath.math.pca :as pca]
[polismath.math.clusters :as clusters]
[polismath.math.repness :as repness]
[polismath.math.named-matrix :as nm]
[clojure.core.matrix :as matrix]
[c... |
df09850ab6ac304b8bc2ffaaf52d689b46869696bae4d53f4866b004725e70f7 | informatimago/lisp | stumpwm.lisp | -*- coding : utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(load "loaders:clocc")
(load "port:shell")
(load "loaders:cclan")
(push "/usr/local/src/stumpwm/" asdf:*central-registry*)
(asdf:operate 'asdf:load-op 'stumpwm)
(stumpwm:stumpwm "" :display 1)
| null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/cl-loaders/stumpwm.lisp | lisp | -*- coding : utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(load "loaders:clocc")
(load "port:shell")
(load "loaders:cclan")
(push "/usr/local/src/stumpwm/" asdf:*central-registry*)
(asdf:operate 'asdf:load-op 'stumpwm)
(stumpwm:stumpwm "" :display 1)
| |
c2e97630f587ce91f31c9972a6c78d103c6cf0f499d844b649a8e3fd694df2f3 | dfinity/motoko | rts.mli | val wasm : string Lazy.t
val wasm_debug : string Lazy.t
| null | https://raw.githubusercontent.com/dfinity/motoko/399b8e8b0b47890388cd38ee0ace7638d9092b1a/src/rts/rts.mli | ocaml | val wasm : string Lazy.t
val wasm_debug : string Lazy.t
| |
f589a288eca9554fdec13d53bd77aa79dd660c3515283c42dd98993eda0716de | hatsugai/SyncStitch | col.ml | open Printf
exception ColError of string
module List =
struct
include List
let iteri2 f xs ys =
let rec loop i xs ys =
match xs, ys with
x::xs', y::ys' ->
f i x y; loop (i+1) xs' ys'
| _, _ -> ()
in loop 0 xs ys
let fold_lefti f acc xs =
let rec fo... | null | https://raw.githubusercontent.com/hatsugai/SyncStitch/cbf0d28aa77a6f4579233ff64227fd7150e300e0/src/col.ml | ocaml | open Printf
exception ColError of string
module List =
struct
include List
let iteri2 f xs ys =
let rec loop i xs ys =
match xs, ys with
x::xs', y::ys' ->
f i x y; loop (i+1) xs' ys'
| _, _ -> ()
in loop 0 xs ys
let fold_lefti f acc xs =
let rec fo... | |
9a18f04b606a867951b0047094159dbb03b7003b10a0402a1400337309b4baae | dgtized/shimmers | epicenter_of_impact.cljs | (ns shimmers.sketches.epicenter-of-impact
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.algorithm.random-points :as rp]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.math.deterministic-random :as dr]
[shimmers.math.equations... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/epicenter_of_impact.cljs | clojure | TODO: add canalization weight based on numer of children so initial impact is thicker
consider adding additional impacts after a delay
variable growth rates per line?
intersecting somewhere other than origin | (ns shimmers.sketches.epicenter-of-impact
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.algorithm.random-points :as rp]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.math.deterministic-random :as dr]
[shimmers.math.equations... |
e78dc58643f6b149a141b3f2b1ce756c8d33cdaff8855088513825361764dee7 | haskus/packages | Tuple.hs | # LANGUAGE DataKinds #
# LANGUAGE FunctionalDependencies #
# LANGUAGE KindSignatures #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE PolyKinds #
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGUAGE TypeOperators #
# LANGUAGE Ty... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-utils-data/src/lib/Haskus/Utils/Tuple.hs | haskell | | Tuple helpers
# COMPLETE Solo #
| Uncurry3
# INLINABLE uncurry3 #
| Uncurry4
# INLINABLE uncurry4 #
| Uncurry5
# INLINABLE uncurry5 #
| Uncurry6
# INLINABLE uncurry6 #
| Uncurry7
# INLINABLE uncurry7 #
| Take specialised for quadruple
| toList for quadruple
# INLINABLE fromTuple4 #
| Extract a tuple value st... | # LANGUAGE DataKinds #
# LANGUAGE FunctionalDependencies #
# LANGUAGE KindSignatures #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE PolyKinds #
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGUAGE TypeOperators #
# LANGUAGE Ty... |
b284e4467922c130018ff4d4dee6056818b1249dc3debac6b8acdf751fe8b85f | chessai/ring-buffers | Internal.hs | # language BangPatterns #
{-# language TupleSections #-}
{-# language TypeFamilies #-}
module RingBuffers.Internal
( RingBuffer(..)
, RingState(..)
, withRing
, new
, clear
, capacity
, filledLength
, latest
, unsafeLatest
, advance
, extend
, append
, foldMap
, toList
) where
import qua... | null | https://raw.githubusercontent.com/chessai/ring-buffers/d31bfadeaf4f7757b6be3b2ab479a484e3e6db68/src/RingBuffers/Internal.hs | haskell | # language TupleSections #
# language TypeFamilies #
# UNPACK #
^ Is the ring buffer full?
^ next entry to be written
# inlineable new #
# inline latest #
# inline advance #
# inlineable extend #
# inline foldMap # | # language BangPatterns #
module RingBuffers.Internal
( RingBuffer(..)
, RingState(..)
, withRing
, new
, clear
, capacity
, filledLength
, latest
, unsafeLatest
, advance
, extend
, append
, foldMap
, toList
) where
import qualified Data.Primitive.Contiguous as Contiguous
data RingBuff... |
81889592eabb8085b09759500944e01a53e10d8507d3c27630980536a9c00f62 | rizo/snowflake-os | cairo.ml | (**************************************************************************)
cairo - ocaml -- Objective Caml bindings for Cairo
Copyright © 2004 - 2005
(* *)
(* This code is free softwa... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/cairo/cairo.ml | ocaml | ************************************************************************
This code is free software and is licensed under the terms of the
************************************************************************
scaled fonts
surface
pa... | cairo - ocaml -- Objective Caml bindings for Cairo
Copyright © 2004 - 2005
GNU Lesser General Public License version 2.1 ( the " LGPL " ) .
type status =
SUCCESS
| NO_MEMORY
| INVALID_RESTORE
| INVALID_POP_GROUP
| NO_CURRENT_POINT... |
921ae0bc9f659c97be13e9200bea33f6dc6e0175bcd6336736900f44f1123a51 | jabber-at/ejabberd | ejabberd_logger.erl | %%%-------------------------------------------------------------------
%%% File : ejabberd_logger.erl
Author : < >
%%% Purpose : ejabberd logger wrapper
Created : 12 May 2013 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2013 - 2018 ProcessOne
%%%
%%% This program is free software; you can redistribute ... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/src/ejabberd_logger.erl | erlang | -------------------------------------------------------------------
File : ejabberd_logger.erl
Purpose : ejabberd logger wrapper
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 useful,
but ... | Author : < >
Created : 12 May 2013 by < >
ejabberd , Copyright ( C ) 2013 - 2018 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
... |
8a9aac568da0b23e2d21834b22cd3131ea618cb5a0cf08340ab02fa284c74c1d | ejgallego/coq-serapi | ser_typeclasses.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * INRIA , CNRS and contributors - Copyright 1999 - 2018
(* <O___,, * (see CREDITS file for the list of authors) *)
\VV/ * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/61d2a5c092c1918312b8a92f43a374639d1786f9/serlib/ser_typeclasses.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
<O___,, * (see CREDITS file for the list of authors)
// * This file is distributed under the terms of the
* (see LICENSE file for... | v * INRIA , CNRS and contributors - Copyright 1999 - 2018
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser General Public License Version 2.1
Copyright 2016 - 2018 MINES ParisT... |
78d3dde732c3f8a05a43c51c6a32d4bdacd36116ecec08735251c25c5aa31ade | mlemerre/l-lang | cpscheck.mli | Copyright 2012 .
This module perform various checks on invariants on the CPS data
structure . This is useful to checks that code transformation
functions do not mess ( too much ) with the data structures .
These invariants come the fact that there are redundant
information : for instance ,... | null | https://raw.githubusercontent.com/mlemerre/l-lang/88201e861c6cc30bb3b9510d7f55c681eded4085/src/cps/cpsbase/cpscheck.mli | ocaml | [one_expression t] checks that the elements in the [expression_]
of [t] point to [t].
This function recursively performs a complete check of
uplinks.
This module performs a complete check of occurrences.
This module provides predicates useful for error checking. They
return true if, and only if, [ex... | Copyright 2012 .
This module perform various checks on invariants on the CPS data
structure . This is useful to checks that code transformation
functions do not mess ( too much ) with the data structures .
These invariants come the fact that there are redundant
information : for instance ,... |
d4b39d4cb5cae68a67040c73a7e9b0290d68e2b3a9081d5b3aaaf1e80f94a671 | expipiplus1/vulkan | SamplerAddressMode.hs | {-# language CPP #-}
No documentation found for Chapter " SamplerAddressMode "
module Vulkan.Core10.Enums.SamplerAddressMode (SamplerAddressMode( SAMPLER_ADDRESS_MODE_REPEAT
, SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT
... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/src/Vulkan/Core10/Enums/SamplerAddressMode.hs | haskell | # language CPP #
| VkSamplerAddressMode - Specify behavior of sampling with texture
coordinates outside an image
= See Also
<-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
be used.
| 'SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT' specifies that the mirrored
repeat wrap mode will be used.
| 'SAMPLER_ADDR... | No documentation found for Chapter " SamplerAddressMode "
module Vulkan.Core10.Enums.SamplerAddressMode (SamplerAddressMode( SAMPLER_ADDRESS_MODE_REPEAT
, SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT
... |
bcb66e05c5a000c2d168eb490fbf73ffe9f98542f622c14c22f7b5fac508ae1d | etorreborre/registry | SmallExample.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - missing - signatures #
{-
This module tests the construction of some simple values
using a registry
-}
module Test.Data.Registry.SmallExample where
import Data.Registry
import Data.Text (splitOn)
impor... | null | https://raw.githubusercontent.com/etorreborre/registry/117e66b1bed3dda1901f406a5c8a7bd8a61e736e/test/Test/Data/Registry/SmallExample.hs | haskell |
This module tests the construction of some simple values
using a registry
| Components of the application
- a Logger
- an interface to S3
- a lines counter
- the top level application
| Create a registry for all constructors
| To create the application you call `make` for the `Application` ... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Data.Registry.SmallExample where
import Data.Registry
import Data.Text (splitOn)
import Protolude as P
import Test.Tasty.Extensions hiding (run)
newtype Logger = Logger
... |
bebc660d386eee7a6eeca7eb80357878e5654a72b9d22f10ef9a100a6778455e | PeterDWhite/Osker | Test24.hs | Copyright ( c ) , 2003
Copyright ( c ) OHSU , 2003
module Main where
--------------------------------------------------------------------
-- Test an unlifted execption throw
--------------------------------------------------------------------
--Haskell imports
import Monad
-- Test imports
import TestSupport
... | null | https://raw.githubusercontent.com/PeterDWhite/Osker/301e1185f7c08c62c2929171cc0469a159ea802f/Braid/Test24.hs | haskell | ------------------------------------------------------------------
Test an unlifted execption throw
------------------------------------------------------------------
Haskell imports
Test imports
This is not a lifted thread.
Should execute to the end, since there is no exception handler. | Copyright ( c ) , 2003
Copyright ( c ) OHSU , 2003
module Main where
import Monad
import TestSupport
Braid imports
import qualified BraidExternal as B
The hub of the level 1 braid
hubl1 :: Int -> B.Braid Gs Ls ()
hubl1 loops =
do { B.putStrLn ( "Test a lifted exception" )
; tid <- B.myThreadId
... |
19b0d14da1479ece9228ea06b13fd4ce73d2b9fb06ea3a700ba935a237ce430d | ragkousism/Guix-on-Hurd | iso-codes.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 < >
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/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/iso-codes.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 © 2013 < >
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 iso-codes)
#:use-module ((guix licenses) #:select (gpl2+)... |
c41e4713f162a9c19e73b1792cab1a8a4153a4fde4ceb8f94257ac6961adac6c | zack-bitcoin/MerkleTrie | cfg.erl | -module(cfg).
-compile(export_all).
-export_type([cfg/0,path/0,value/0,id/0,meta/0,hash_size/0]).
-record(cfg, { path
, value
, id
, meta
, hash_size
, mode
, empty_root
}).
-opaque cfg() :: #cfg{}.
-type path() :: pos_integer().
-type value() :: non_neg_integer().
-type id() :... | null | https://raw.githubusercontent.com/zack-bitcoin/MerkleTrie/2893945881349f6f409fe599564048c534b95c36/src/cfg.erl | erlang | -spec new(path(), value(), id(), meta(), hash_size()) -> cfg().
how many bytes to store the value.
how many bytes to store the meta data that isn't hashed into the merkle tree. | -module(cfg).
-compile(export_all).
-export_type([cfg/0,path/0,value/0,id/0,meta/0,hash_size/0]).
-record(cfg, { path
, value
, id
, meta
, hash_size
, mode
, empty_root
}).
-opaque cfg() :: #cfg{}.
-type path() :: pos_integer().
-type value() :: non_neg_integer().
-type id() :... |
05664e0422e3023492a88f5e452de32ae4f63a9059d1e90e1a06ee4f67b64b75 | tari3x/csec-modex | pilexer.ml | # 28 "pilexer.mll"
open Parsing_helper
open Piparser
let create_hashtable size init =
let tbl = Hashtbl.create size in
List.iter (fun (key,data) -> Hashtbl.add tbl key data) init;
tbl
(* Untyped front-end *)
let keyword_table =
create_hashtable 11
[ "data", DATA;
"param", PARAM;
"private", PRIVATE;
(* ... | null | https://raw.githubusercontent.com/tari3x/csec-modex/5ab2aa18ef308b4d18ac479e5ab14476328a6a50/deps/proverif1.84/src/pilexer.ml | ocaml | Untyped front-end
Common keywords | # 28 "pilexer.mll"
open Parsing_helper
open Piparser
let create_hashtable size init =
let tbl = Hashtbl.create size in
List.iter (fun (key,data) -> Hashtbl.add tbl key data) init;
tbl
let keyword_table =
create_hashtable 11
[ "data", DATA;
"param", PARAM;
"private", PRIVATE;
"new", NEW;
"out", OUT;... |
40c5a8975a9504388c42f9a57e55fcf8e571bd88b3b22f6d401026fba588ac44 | joergen7/cf_client | cf_client.erl | %% -*- erlang -*-
%%
%% cf_client: Cuneiform client implementation
%%
Copyright 2015 - 2019 < >
%%
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 requi... | null | https://raw.githubusercontent.com/joergen7/cf_client/ac00cecc6b7c48d25c4bd97c4ce7f7d9798ada93/src/cf_client.erl | erlang | -*- erlang -*-
cf_client: Cuneiform client implementation
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 impl... | Copyright 2015 - 2019 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2013 - 2020
-module( cf_client ).
-behaviour( application ).
-export( [start/0] ).
-export( [main/1] ).
-export( [start/2... |
1d8623684d7b4780ce5e7200bec959c3b783220d2431e65ab68a7998b90b1b4c | exercism/haskell | Tests.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
import Data.Foldable (for_)
import Data.String (fromString)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Acronym (abbreviate)
main :: IO ()
main = hspecWith ... | null | https://raw.githubusercontent.com/exercism/haskell/f81ee7dc338294b3dbefb7bd39fc193546fcec26/exercises/practice/acronym/test/Tests.hs | haskell | # LANGUAGE OverloadedStrings #
Although this case was removed in specification 1.1.0,
since it makes the problem more interesting. | # LANGUAGE RecordWildCards #
import Data.Foldable (for_)
import Data.String (fromString)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import Acronym (abbreviate)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = Tru... |
eb04183422ed4b2eb60b5d714f186f1561a046aa90e2e2a1aea1f6a84ae0df86 | processone/ejabberd | mod_push.erl | %%%----------------------------------------------------------------------
File :
Author : < >
%%% Purpose : Push Notifications (XEP-0357)
Created : 15 Jul 2017 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2017 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
mo... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/mod_push.erl | erlang | ----------------------------------------------------------------------
Purpose : Push Notifications (XEP-0357)
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 useful,
but WITHOUT ANY WARRANTY; ... | File :
Author : < >
Created : 15 Jul 2017 by < >
ejabberd , Copyright ( C ) 2017 - 2023 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 Licen... |
f18048007656e4bcb43bd8e3e5106bda6a08c26b76dfe6ef742f8ddabd137d4f | ocamllabs/ocaml-effects | topdirs.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-effects/36008b741adc201bf9b547545344507da603ae31/toplevel/topdirs.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
Toplevel directives
open Format
open... |
7fc61939dd5b62aa7adbf59f37afb21a47786f04c0f28c4fc4a3d142c8044b15 | mahsu/MariOCaml | particle.ml | open Actors
open Sprite
type part_params = {
sprite: Sprite.sprite;
rot: float;
lifetime: int;
}
type particle = {
params: part_params;
part_type: Actors.part_typ;
pos: Actors.xy;
vel: Actors.xy;
acc: Actors.xy;
mutable kill: bool;
mutable life: int;
}
Converts an x , y [ pair ] to an Actors... | null | https://raw.githubusercontent.com/mahsu/MariOCaml/d2359260895b77390648ca5ad126a897e639e7e4/particle.ml | ocaml | Function wrapper to assist in generating the template paramss for a
* particle.
Generate the template for a specific particle type | open Actors
open Sprite
type part_params = {
sprite: Sprite.sprite;
rot: float;
lifetime: int;
}
type particle = {
params: part_params;
part_type: Actors.part_typ;
pos: Actors.xy;
vel: Actors.xy;
acc: Actors.xy;
mutable kill: bool;
mutable life: int;
}
Converts an x , y [ pair ] to an Actors... |
7d897dea63b44afe6798f47ca8c5b6c8de3cc3c34a01e5dac5156be6aed0256f | K1D77A/lisp-pay | package.lisp | package.lisp
(defpackage #:lisp-pay/paypal
(:use #:cl #:lisp-pay)
(:nicknames #:paypal)
(:export #:*processor*
#:paypal-condition
#:token-issue
#:missing-token
#:missing-or-expired-token
#:unbound-token
#:expired-token
... | null | https://raw.githubusercontent.com/K1D77A/lisp-pay/1fe79da04539e50149154a870073abad03e7b2d6/src/paypal/package.lisp | lisp | webhook-verify | package.lisp
(defpackage #:lisp-pay/paypal
(:use #:cl #:lisp-pay)
(:nicknames #:paypal)
(:export #:*processor*
#:paypal-condition
#:token-issue
#:missing-token
#:missing-or-expired-token
#:unbound-token
#:expired-token
... |
4a01b05b76af9d0ad169b7accfc7c796ce15d757493b86c7dfcefcc7873b957e | dapphub/dapptools | Concrete.hs | {-# Language FlexibleInstances #-}
{-# Language StrictData #-}
module EVM.Concrete where
import Prelude hiding (Word)
import EVM.RLP
import EVM.Types
import Control.Lens ((^?), ix)
import Data.Bits (Bits (..), shiftL, shiftR)
import Data.ByteString (ByteString)
import Data.Maybe (fromMaybe)
import Dat... | null | https://raw.githubusercontent.com/dapphub/dapptools/6a40aabbc010af23d5c6f5dd207bd88af3c9ce8f/src/hevm/src/EVM/Concrete.hs | haskell | # Language FlexibleInstances #
# Language StrictData #
else if offset > BS.length bs
todo: this ^^ should work, investigate why it causes more GST fails
# SCC "readMemoryWord" #
# SCC "readMemoryWord32" #
We also use bit operations instead of modulo and multiply.
(This operation was significantly slow.) |
module EVM.Concrete where
import Prelude hiding (Word)
import EVM.RLP
import EVM.Types
import Control.Lens ((^?), ix)
import Data.Bits (Bits (..), shiftL, shiftR)
import Data.ByteString (ByteString)
import Data.Maybe (fromMaybe)
import Data.Word (Word8)
import qualified Data.ByteString as BS
w... |
cfb5de373ac7ada498d6028774176117b9b31bcc4c99ee080eb492ead7dafaba | EarnestResearch/honeycomb-haskell | Transport.hs | # LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Honeycomb.Transport
( newTransport,
withTransport,
)
where
import Control.Concurrent.STM.TBQueue (flushTBQueue, lengthTBQueue)
import Control.Monad (void)
import Data.Foldable (tra... | null | https://raw.githubusercontent.com/EarnestResearch/honeycomb-haskell/0cb643a637e1b23eecded845970e6a973f8385cf/honeycomb/src/Honeycomb/Transport.hs | haskell | # LANGUAGE OverloadedStrings #
[todo] use different parameters
[todo] think about whether this is a good idea
dropping response status
For simplicity, if this fails to send all messages due to max size limits,
it will keep trying until messages are sent
| Send all events and return event status to status channel... | # LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Honeycomb.Transport
( newTransport,
withTransport,
)
where
import Control.Concurrent.STM.TBQueue (flushTBQueue, lengthTBQueue)
import Control.Monad (void)
import Data.Foldable (traverse_)
import qualified Data.HashM... |
e0e202cfb030b092aae16a495814db03a6b36f133e24a949b9150fe0792217d6 | jackfirth/racket-expect | text.rkt | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[expect-regexp-match
(->* (regexp?)
((or/c (listof (or/c string? bytes? #f expectation?))
expectation?))
expectation?)]
[expect-string-contains? (-> string? expectation?)]
[struct (regexp-match-context con... | null | https://raw.githubusercontent.com/jackfirth/racket-expect/9530df30537ae05400b6a3add9619e5f697dca52/private/text.rkt | racket | not provided because calling expect-regexp-match with a default result-exp
is equivalent to calling this | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[expect-regexp-match
(->* (regexp?)
((or/c (listof (or/c string? bytes? #f expectation?))
expectation?))
expectation?)]
[expect-string-contains? (-> string? expectation?)]
[struct (regexp-match-context con... |
589cfb3d80a2105a8d632ea9282b3530b8b81d677f08c236f902c94324308cda | Arnhav-Datar/EffPPL | normal_sampling.ml | open Effppl.Infer
open Effppl.Print
let f1 () =
let* x1 = normal 1. 3. in
let* x2 = normal 1. 4. in
x1 +. x2
;;
if X ~ N(m1 , s1 ) and Y ~ N(m2 , s2 )
we know that the resulting distribution is also normal
furthermore the resulting distribution will have
mu = m1 + m2
and
s^2 = s1 ^ 2 + s2 ^ 2
... | null | https://raw.githubusercontent.com/Arnhav-Datar/EffPPL/df74e1f82a66933f3c10d92e038bc98daaeaab5b/lib/models/sampling/normal_sampling.ml | ocaml | open Effppl.Infer
open Effppl.Print
let f1 () =
let* x1 = normal 1. 3. in
let* x2 = normal 1. 4. in
x1 +. x2
;;
if X ~ N(m1 , s1 ) and Y ~ N(m2 , s2 )
we know that the resulting distribution is also normal
furthermore the resulting distribution will have
mu = m1 + m2
and
s^2 = s1 ^ 2 + s2 ^ 2
... | |
f6d5c037a0ae929a36258eed9955c58b70aa4ad8278326f9c9127451f96fe6b4 | cmpitg/clojure-swt-examples | swt_button_demo.clj | ;;; root/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet108.java
(ns main.swt-button-demo
(:import [org.eclipse.swt SWT]
[org.eclipse.swt.widgets Display Shell Button Text Label]
[org.eclipse.swt.layout RowData RowLayout]
[org.eclipse.swt.events SelectionAdapte... | null | https://raw.githubusercontent.com/cmpitg/clojure-swt-examples/e0575de72e0523f3cbbfdf3008e58b62c20cd1d4/src/main/swt_button_demo.clj | clojure | root/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet108.java |
(ns main.swt-button-demo
(:import [org.eclipse.swt SWT]
[org.eclipse.swt.widgets Display Shell Button Text Label]
[org.eclipse.swt.layout RowData RowLayout]
[org.eclipse.swt.events SelectionAdapter]
))
(defn gui-loop [display shell]
(when-not (. shell (isDisposed))
(if-not (. ... |
488664a62e623353d03f49cedf4f9ce250804cedb5e590514685ed5cc64ae8f5 | lspector/Clojush | vector_average.clj | ;; vector_average.clj
,
;;
Problem Source : ( / )
;;
Given a vector of floats with length in [ 1,50 ] , with each float in [ -1000,1000 ] ,
return the average of those floats . Results are rounded to 4 decimal places .
;;
input stack has 1 input vector of floats
(ns clojush.problems.software.vector-avera... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/problems/software/vector_average.clj | clojure | vector_average.clj
Atom generators
end constants
end input instructions
Define test cases
A list of data domains for the problem. Each domain is a vector containing
should be used as training and testing cases respectively. Each "set" of
inputs is either a list or a function that, when called, will create a
... | ,
Problem Source : ( / )
Given a vector of floats with length in [ 1,50 ] , with each float in [ -1000,1000 ] ,
return the average of those floats . Results are rounded to 4 decimal places .
input stack has 1 input vector of floats
(ns clojush.problems.software.vector-average
(:use clojush.pushgp.pushg... |
cee67e855a7e55f92e79155b5c556dee4bece4826905d2f9613da97db278f419 | mbj/mhs | CLI.hs | # LANGUAGE ApplicativeDo #
# LANGUAGE ExistentialQuantification #
module PGT.CLI (Command, parserInfo, run, runCommand) where
import Control.Applicative (Alternative(many))
import PGT
import PGT.Prelude
import PGT.Selector
import qualified Data.Vector as Vector
import qualified Options.Applicati... | null | https://raw.githubusercontent.com/mbj/mhs/e9af33d41ffd830ca7598dd5d8f5b1d1b8d72d1f/pgt/src/PGT/CLI.hs | haskell | # LANGUAGE ApplicativeDo #
# LANGUAGE ExistentialQuantification #
module PGT.CLI (Command, parserInfo, run, runCommand) where
import Control.Applicative (Alternative(many))
import PGT
import PGT.Prelude
import PGT.Selector
import qualified Data.Vector as Vector
import qualified Options.Applicati... | |
72d2f6d24fd69705e029f51da2e5734ba27dccd5a62daf71bead22f55726e918 | may-liu/qtalk | http_get_muc_history3.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(http_get_muc_history3).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("logger.hrl").
-include("http_req.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
catch ejb_monitor:monitor_count(... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/scripts/ejb_http_server/src/http_get_muc_history3.erl | erlang | Feel free to use, reuse and abuse the code in this file. | -module(http_get_muc_history3).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("logger.hrl").
-include("http_req.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
catch ejb_monitor:monitor_count(<<"http_get_muc_history_domain">>,1),
do_handle(Req, Sta... |
c71daa0bacbcf3b9307d46965c785a3ae6a7f72a06aefa09aa5a2edc28575bab | DSiSc/why3 | util.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/util/util.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
val const : 'a -> 'b -> 'a
val const2 : 'a -> 'b -> 'c -> 'a
val const3 : 'a -> 'b -> 'c -> 'd -> 'a
v... |
91dc267cd1d0efa74b8fc7da9a2d3a8430da8c7b1d426e7a262cddb3be1c7a77 | jarohen/clidget | handler.clj | (ns contacts.handler
(:require [ring.util.response :refer [response content-type]]
[compojure.core :refer [routes GET]]
[compojure.route :refer [resources]]
[compojure.handler :refer [api]]
[hiccup.page :refer [html5 include-css include-js]]
[frodo :refer [r... | null | https://raw.githubusercontent.com/jarohen/clidget/bd67082ad3819908e2d532151417cab436333ad0/contacts/src/clojure/contacts/handler.clj | clojure | (ns contacts.handler
(:require [ring.util.response :refer [response content-type]]
[compojure.core :refer [routes GET]]
[compojure.route :refer [resources]]
[compojure.handler :refer [api]]
[hiccup.page :refer [html5 include-css include-js]]
[frodo :refer [r... | |
02dc582ca8e919627d2dcab6dd35c1ac84068e8d85226b800938f16a47d8a48f | dongcarl/guix | key-mon.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
;;;
;;; 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 ; either version 3 of the Lice... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/packages/key-mon.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 < >
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 key-mon)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module... |
7f16cc0ff25e887e8ae1b9aa9f11742af42d669d66e1f1f1840350a5b9f92a18 | joelburget/lvca | Term_and_concrete.ml | open Base
open Common
open Lvca_provenance
open Lvca_syntax
open Lvca_util
open Brr
open Note
open Prelude
module Model = struct
type t =
{ input : string
; input_lang : lang
; result : (term, string) Result.t
; input_selected : Opt_range.t
; output_selected : Opt_range.t
}
let print { inp... | null | https://raw.githubusercontent.com/joelburget/lvca/f8a3b8e294f564d1fc9836af63e6169b26ca0234/pages/Term_and_concrete.ml | ocaml | open Base
open Common
open Lvca_provenance
open Lvca_syntax
open Lvca_util
open Brr
open Note
open Prelude
module Model = struct
type t =
{ input : string
; input_lang : lang
; result : (term, string) Result.t
; input_selected : Opt_range.t
; output_selected : Opt_range.t
}
let print { inp... | |
b130f3de247b90f11c162f2c71a4c1681f0079220aac19ee93ce847434ccc0fc | andrenth/srsly | log_lwt.mli | val debug : ('a, unit, string, unit Lwt.t) format4 -> 'a
val notice : ('a, unit, string, unit Lwt.t) format4 -> 'a
val info : ('a, unit, string, unit Lwt.t) format4 -> 'a
val warning : ('a, unit, string, unit Lwt.t) format4 -> 'a
val error : ('a, unit, string, unit Lwt.t) format4 -> 'a
| null | https://raw.githubusercontent.com/andrenth/srsly/fce92645781a6a6037512be4d35116ec53737b17/src/log_lwt.mli | ocaml | val debug : ('a, unit, string, unit Lwt.t) format4 -> 'a
val notice : ('a, unit, string, unit Lwt.t) format4 -> 'a
val info : ('a, unit, string, unit Lwt.t) format4 -> 'a
val warning : ('a, unit, string, unit Lwt.t) format4 -> 'a
val error : ('a, unit, string, unit Lwt.t) format4 -> 'a
| |
8326429b1099fd7c1849b19e14a95787369c8a757580c80acb43370ba8f1c634 | facebook/pyre-check | start.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/c03d27aceea9f2ed911a18a81615721614c32b31/source/code_navigation_server/start.ml | ocaml | TODO(T132410158) Add a module-level doc comment.
Initial response acknowledge the subscription
Block on reading the input channel so we could dispose the subscription immediately when it's
closed.
NOTE(grievejia): Another option is to close [input_channel] immediately, and clean up
subscription lat... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
16d3a1a87d5055bf180ab874ec928ecde8e25efa731d99d897c685932e924d4a | flosell/lambdacd | testcases.cljs | (ns lambdacd.testcases
(:require [reagent.core :as reagent :refer [atom]]
[lambdacd.ui-core :as ui-core]
[lambdacd.history :as history]
[cljs-time.format :as format]
[lambdacd.pipeline :as pipeline]
[cljs-time.core :as t]
[lambdacd.db :as db]
... | null | https://raw.githubusercontent.com/flosell/lambdacd/e9ba3cebb2d5f0070a2e0e1e08fc85fc99ee7135/visual-styleguide/src/cljs/lambdacd/testcases.cljs | clojure | (ns lambdacd.testcases
(:require [reagent.core :as reagent :refer [atom]]
[lambdacd.ui-core :as ui-core]
[lambdacd.history :as history]
[cljs-time.format :as format]
[lambdacd.pipeline :as pipeline]
[cljs-time.core :as t]
[lambdacd.db :as db]
... | |
018a5706ca35d2a08f7b856d7dc7cc20cfc13e02afdd2a252cb6fe5dc0c9d999 | tomjaguarpaw/haskell-opaleye | RunQuery.hs | # LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses #
module Opaleye.SQLite.Internal.RunQuery where
import Control.Applicative (Applicative, pure, (<$>), (<*>), liftA2)
import Database.SQLite.Simple.Internal (RowParser)
import Database.SQLite.Simple.FromField (FieldP... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/b7aacc07c6392654cae439fc3b997620c3aa7a87/opaleye-sqlite/src/Opaleye/SQLite/Internal/RunQuery.hs | haskell | @haskellType@. For example a value of type 'QueryRunnerColumn'
'T.PGText' 'String' encodes how to turn a 'PGText' result from the
This is *not* a Product Profunctor because it is the only way I
Nullable types at once.
We never actually
look at the columns
except to see its
"type" in the case
of a sum profunct... | # LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses #
module Opaleye.SQLite.Internal.RunQuery where
import Control.Applicative (Applicative, pure, (<$>), (<*>), liftA2)
import Database.SQLite.Simple.Internal (RowParser)
import Database.SQLite.Simple.FromField (FieldP... |
d808b2d3cd1aae3a0d64263b970a7df025b2342ab3ee04f2ae34278484719fe5 | keera-studios/keera-posture | Paths.hs | # LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
module Paths (getDataFileName) where
-- These imports are necessary only in Windows
#ifndef linux_HOST_OS
import System.Win32.Types
import System.Win32.Registry
import System.Environment
import Foreign.Ptr (castPtr)
import Foreign.Marshal.Alloc (allocaBytes)
imp... | null | https://raw.githubusercontent.com/keera-studios/keera-posture/9de5095a4a10c0cb54f6191f1a448e96645193ae/src/Paths.hs | haskell | These imports are necessary only in Windows
// parse a string from a registry value of certain type
// to make use of the registry values
The default program's key in the registry
This part is OS-dependent
myPutStrLn $ "Going to open " ++ res
return res | # LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
module Paths (getDataFileName) where
#ifndef linux_HOST_OS
import System.Win32.Types
import System.Win32.Registry
import System.Environment
import Foreign.Ptr (castPtr)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.C.String (peekCWString, withCWStrin... |
35f3c9520602eff2a5e6777df184ee44ba598d2d0c55eef715b19d35d48cd856 | namenu/advent-of-code | aoc_2021_test.clj | (ns namenu.aoc-2021-test
(:require [clojure.test :refer :all]
[namenu.aoc-2021 :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/namenu/advent-of-code/d0834af8d6ab46fcee2c7c8c078ee4ed5fa98596/2021/clojure/test/namenu/aoc_2021_test.clj | clojure | (ns namenu.aoc-2021-test
(:require [clojure.test :refer :all]
[namenu.aoc-2021 :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
15d66a0d5020b932755cdd2496495058ade5df97331bdd1ffabe57fedc8671f1 | AdaCore/why3 | lexer.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/4441127004d53cf2cb0f722fed4a930ccf040ee4/src/parser/lexer.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
val parse_term : Lexing.lexbuf -> Ptree.term
val parse_expr : Lexing.lexbuf -> Ptree.expr
val parse_decl ... |
46f90fdf1b092a5fd56e21180005927ba258fe45bc6e077c7b4153413e97573c | lazy-cat-io/metaverse | env.cljs | (ns metaverse.common.env
(:require
[cljs.reader :as reader]
[clojure.string :as str])
(:require-macros
[metaverse.common.utils.resource :as resource]))
(goog-define company-name "io.lazy-cat")
(goog-define product-name "metaverse")
(goog-define mode "production")
(goog-define logger-level "info")
(go... | null | https://raw.githubusercontent.com/lazy-cat-io/metaverse/2e5754967ac0e4219197da3ff6937b666d2d26fa/src/main/clojure/metaverse/common/env.cljs | clojure | (ns metaverse.common.env
(:require
[cljs.reader :as reader]
[clojure.string :as str])
(:require-macros
[metaverse.common.utils.resource :as resource]))
(goog-define company-name "io.lazy-cat")
(goog-define product-name "metaverse")
(goog-define mode "production")
(goog-define logger-level "info")
(go... | |
33f37431944c26822b1f33cb8bc9bce519f54fa2518f81fe5ce877d891136c36 | xtendo-org/chips | Chips.hs | -- chips-specific codes
module Chips where
import Paths_chips
import Data.Version
import qualified Data.SemVer as SV
import Data.List
import Data.ByteString (ByteString)
import qualified Data.ByteString.Builder as B
import Utility
chipsVer :: ByteString
chipsVer = toByteString $
mconcat $ intersperse "." $ map... | null | https://raw.githubusercontent.com/xtendo-org/chips/54846413660536a24d4a9c884b6a33c2d86ad256/src/Chips.hs | haskell | chips-specific codes | module Chips where
import Paths_chips
import Data.Version
import qualified Data.SemVer as SV
import Data.List
import Data.ByteString (ByteString)
import qualified Data.ByteString.Builder as B
import Utility
chipsVer :: ByteString
chipsVer = toByteString $
mconcat $ intersperse "." $ map B.intDec $ versionBranc... |
a77854bb8693814021c33b2a58412ff327d0af885617c408b3492d5905b2abb7 | facebookarchive/JSCaml | js_console.ml | *
* Copyright ( c ) 2013 - present , Facebook , Inc.
* All rights reserved .
*
* This source code is licensed under the BSD - style license found in the
* LICENSE file in the root directory of this source tree . An additional grant
* of patent rights can be found in the PATENTS file in the same direct... | null | https://raw.githubusercontent.com/facebookarchive/JSCaml/adf48cc4aa87e02b6a70765dc1e0904c4739804f/runtime/js_console.ml | ocaml | *
* Copyright ( c ) 2013 - present , Facebook , Inc.
* All rights reserved .
*
* This source code is licensed under the BSD - style license found in the
* LICENSE file in the root directory of this source tree . An additional grant
* of patent rights can be found in the PATENTS file in the same direct... | |
9e27eb4e0fe7809706eeb812ee1be7561a117dd68282076b5069edc8c082a0ce | mistupv/cauder-core | fwd_sem.erl | %%%-------------------------------------------------------------------
%%% @doc Some functions that implement the forward (reversible)
semantics for Erlang . These can be divided into functions to get
%%% the evaluation options and functions to perform the evaluation
%%% @end
%%%--------------------------------------... | null | https://raw.githubusercontent.com/mistupv/cauder-core/b676fccd1bbd629eb63f3cb5259f7a9a8c6da899/src/fwd_sem.erl | erlang | -------------------------------------------------------------------
@doc Some functions that implement the forward (reversible)
the evaluation options and functions to perform the evaluation
@end
-------------------------------------------------------------------
standard zip is used here (pretty-printer forces it)... | semantics for Erlang . These can be divided into functions to get
-module(fwd_sem).
-export([eval_step/2, eval_sched/2,
eval_opts/1, eval_procs_opts/1, eval_sched_opts/1]).
-include("cauder.hrl").
eval_seq(Env,Exp) ->
case is_list(Exp) of
true -> eval_list(Env,Exp);
false -> eval_seq_1(Env,Exp)
... |
b5a95d91d153f4cbb438aaf6c2a12adfe8b1d0e28f18f757c116e2c1973b26ca | maximedenes/native-coq | indfun_common.ml | open Names
open Pp
open Libnames
open Refiner
open Hiddentac
let mk_prefix pre id = id_of_string (pre^(string_of_id id))
let mk_rel_id = mk_prefix "R_"
let mk_correct_id id = Nameops.add_suffix (mk_rel_id id) "_correct"
let mk_complete_id id = Nameops.add_suffix (mk_rel_id id) "_complete"
let mk_equation_id id = Nameo... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/plugins/funind/indfun_common.ml | ocaml | ***************************************************************
Copy of the standart save mechanism but without the much too
slow reduction function
***************************************************************
********************
Has this function been defined using gener... | open Names
open Pp
open Libnames
open Refiner
open Hiddentac
let mk_prefix pre id = id_of_string (pre^(string_of_id id))
let mk_rel_id = mk_prefix "R_"
let mk_correct_id id = Nameops.add_suffix (mk_rel_id id) "_correct"
let mk_complete_id id = Nameops.add_suffix (mk_rel_id id) "_complete"
let mk_equation_id id = Nameo... |
7a2a37abe6e132ff3c5e09b9bdf4bb8fbb35c95eeb25e1017685e173dcefdd00 | rm-hull/project-euler | euler052.clj | EULER # 052
;; ==========
It can be seen that the number , 125874 , and its double , 251748 , contain
;; exactly the same digits, but in a different order.
;;
Find the smallest positive integer , x , such that 2x , 3x , 4x , 5x , and 6x ,
;; contain the same digits.
;;
(ns euler052
(:use [clojure.set]
... | null | https://raw.githubusercontent.com/rm-hull/project-euler/04e689e87a1844cfd83229bb4628051e3ac6a325/src/euler052.clj | clojure | ==========
exactly the same digits, but in a different order.
contain the same digits.
| EULER # 052
It can be seen that the number , 125874 , and its double , 251748 , contain
Find the smallest positive integer , x , such that 2x , 3x , 4x , 5x , and 6x ,
(ns euler052
(:use [clojure.set]
[util.combinatorics]
[util.misc]))
(defn multiples-of [n]
(iterate #(+ n %) n))
(defn chec... |
dcd452b02dab7c49bdd85ed79284380e9c872c814fecc428667f2f8014518c19 | elaforge/karya | PakhawajScore.hs | Copyright 2015
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
| TODO convert this to the " Derive . . " framework .
module Derive.C.India.PakhawajScore where
import Data.Text (Text)
import qualified Data.Text as Text
bats :: [Text]
bats =
... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Derive/C/India/PakhawajScore.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Copyright 2015
| TODO convert this to the " Derive . . " framework .
module Derive.C.India.PakhawajScore where
import Data.Text (Text)
import qualified Data.Text as Text
bats :: [Text]
bats =
[ Text.unlines
[ "ga di ge ne na ge tet te"
, "ga di ge ne na ge tet te"
, "ka ta ka ta ga di ga di"
... |
0de341e0e1d22bddf7644df90a2f5ecda3ea1561b6a00be87f5458700a72efd0 | flosell/lambdacd | dead_steps_marking_test.clj | (ns lambdacd.state.internal.dead-steps-marking-test
(:require [clojure.test :refer :all]
[lambdacd.state.internal.dead-steps-marking :refer :all]
[lambdacd.testsupport.data :refer [some-ctx-with]]))
(deftest mark-dead-steps-test
(testing "that active steps that don't show up in active build... | null | https://raw.githubusercontent.com/flosell/lambdacd/e9ba3cebb2d5f0070a2e0e1e08fc85fc99ee7135/test/clj/lambdacd/state/internal/dead_steps_marking_test.clj | clojure | (ns lambdacd.state.internal.dead-steps-marking-test
(:require [clojure.test :refer :all]
[lambdacd.state.internal.dead-steps-marking :refer :all]
[lambdacd.testsupport.data :refer [some-ctx-with]]))
(deftest mark-dead-steps-test
(testing "that active steps that don't show up in active build... | |
3928098a10b6d495dbec0a3c95ef148fee6a799c833ab804183afefddaeb2403 | Ptival/language-ocaml | Test.hs | module Language.OCaml.Parser.ConstrIdent.Test
( testStrings,
)
where
testStrings :: [String]
testStrings =
[ "A",
"Ab",
"AB",
"[]",
"false",
"true",
"A ",
"Ab ",
"AB ",
"[] ",
"false ",
"true "
]
| null | https://raw.githubusercontent.com/Ptival/language-ocaml/7b07fd3cc466bb2ad2cac4bfe3099505cb63a4f4/test/Language/OCaml/Parser/ConstrIdent/Test.hs | haskell | module Language.OCaml.Parser.ConstrIdent.Test
( testStrings,
)
where
testStrings :: [String]
testStrings =
[ "A",
"Ab",
"AB",
"[]",
"false",
"true",
"A ",
"Ab ",
"AB ",
"[] ",
"false ",
"true "
]
| |
c72980a377693725a97cec4f4d6d3f78dd1489ec3b18f4cc2b1b74eb9b3c79e5 | Otann/morse | handlers_test.clj | (ns morse.handlers-test
(:require [clojure.test :refer :all]
[morse.handlers :as h]))
(defn command-message [command]
{:text (str "/" command)
:chat {:id "bar"}})
(defn inline-query [query]
{:id 0
:from {:user_id 0}
:query query
:offset 0})
(defn callback-query [query]
{:id 0
:fr... | null | https://raw.githubusercontent.com/Otann/morse/bbb2efc6a8eb17603a56121fbe10e1592ce5d8ee/test/morse/handlers_test.clj | clojure | (ns morse.handlers-test
(:require [clojure.test :refer :all]
[morse.handlers :as h]))
(defn command-message [command]
{:text (str "/" command)
:chat {:id "bar"}})
(defn inline-query [query]
{:id 0
:from {:user_id 0}
:query query
:offset 0})
(defn callback-query [query]
{:id 0
:fr... | |
88b33aa6fd3bc8b3e60e2e980c518c415069964d6a7185d1ab4b9bc62e40496a | hemmi/coq2scala | classes.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/hemmi/coq2scala/d10f441c18146933a99bf2088116bd213ac3648d/coq-8.4pl2-old/toplevel/classes.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
* TODO: add subinstances
Decla... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Decl_kinds
op... |
768f8ca70f2ff579a87621e6776342f96e466c67fb248599d3deb29e96354ba1 | lispbuilder/lispbuilder | package.lisp | ;;;; lispbuilder-net
(in-package #:cl-user)
(defpackage #:lispbuilder-net
(:use #:cl #:cffi)
(:nicknames #:net)
(:documentation "The main package of `lispbuilder-net'."))
| null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-net/net/package.lisp | lisp | lispbuilder-net |
(in-package #:cl-user)
(defpackage #:lispbuilder-net
(:use #:cl #:cffi)
(:nicknames #:net)
(:documentation "The main package of `lispbuilder-net'."))
|
d1efe6170f78afd64551770af86b35e84f2d78d5628fd8f5045555817c857551 | nwtgck/platy-lang-haskell | TestUtils.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE NamedFieldPuns #
module Platy.TestUtils where
import Test.Hspec
import qualified Control.Monad as Monad
import qualified Data.ByteString as ByteString
import qualified Data.Text.Lazy.IO as TIO
import qualified System.IO.Temp as Temp
import qualified System.Process as Pro... | null | https://raw.githubusercontent.com/nwtgck/platy-lang-haskell/a8f84ab65207161b0cebd8378eb62863202723f9/test/Platy/TestUtils.hs | haskell | | Convert a module to executable and Run it and Get stdout
Generate object byte string
Create temp directory
Create empty obj file
Save obj to a file
Create empty executable file
Make executable file
Execute the program
(from: )
Get stdout
| Convert Program () => Program Ty => Module => Execute it => Stdout
... | # LANGUAGE QuasiQuotes #
# LANGUAGE NamedFieldPuns #
module Platy.TestUtils where
import Test.Hspec
import qualified Control.Monad as Monad
import qualified Data.ByteString as ByteString
import qualified Data.Text.Lazy.IO as TIO
import qualified System.IO.Temp as Temp
import qualified System.Process as Pro... |
6fc160ed5903bc048f27913a52a5a37b0d0fbea316c95fa439098fad46a16d79 | Decentralized-Pictures/T4L3NT | test_seed.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_112_Pt4FJEL6/lib_protocol/test/test_seed.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
0722914d791178eec22cec9a07b357c5e5cfb6f8e409945e0c1a3e0361afd329 | google/proto-lens | bootstrap.hs | -- Copyright 2016 Google Inc. All Rights Reserved.
--
-- 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
-- To regenerate the bootstrapping proto bindings:
-- $ runghc bootstrap.hs
-- Note: if this doesn't work, you may need to edit the ... | null | https://raw.githubusercontent.com/google/proto-lens/081815877430afc1db669ca5e4edde1558b5fd9d/bootstrap.hs | haskell | Copyright 2016 Google Inc. All Rights Reserved.
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
To regenerate the bootstrapping proto bindings:
$ runghc bootstrap.hs
Note: if this doesn't work, you may need to edit the "location" field ... |
import Control.Applicative ((<$>))
import System.FilePath ((</>))
import System.Process (callProcess, readProcess)
protoRoot :: String
protoRoot = "google/protobuf/src"
protoc :: String
protoc = "protoc"
bootstrapModuleRoot :: String
bootstrapModuleRoot = "proto-lens-protoc/app"
bootstrappingYaml :: FilePath
boots... |
d7bf4f8ecd6ec1967cf8aefee91175e7a7a390d6ff3684ecbcf4d53119294999 | erlang/otp | lists.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/4491005df9b6a5be6f3d0f6b8889ff17eed072f3/lib/stdlib/src/lists.erl | erlang |
%CopyrightBegin%
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 lan... | Copyright Ericsson AB 1996 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(lists).
-compile({no_auto_import,[max/2]}).
-compile({no_auto_import,[min/2]}).
-export([keyfind/3, keymemb... |
6b68964cd0e6400d5afceb589c27b5382a29510f7437edceadcdd05a29397830 | khibino/haskell-relational-record | IBMDB2.hs | -- |
-- Module : Database.Custom.IBMDB2
Copyright : 2019
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- This module provides custom APIs with appropriate configuration
for IBMDB2 .
module Database.Custom.IBMDB2 (
module Database.Relational,
rel... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-schemas/src/Database/Custom/IBMDB2.hs | haskell | |
Module : Database.Custom.IBMDB2
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module provides custom APIs with appropriate configuration
| From 'Relation' into typed 'Query' with suffix SQL words.
^ relation to finalize building
^ finalized query
| Make 'Ins... | Copyright : 2019
for IBMDB2 .
module Database.Custom.IBMDB2 (
module Database.Relational,
relationalQuery,
insertValue, insertValueNoPH, insertQuery,
update, updateNoPH,
delete, deleteNoPH,
) where
import Language.SQL.Keyword (Keyword)
import Database.Relational.Schema.IBMDB2.Config (config)
imp... |
43901f22b2b259a351891f5fb012314867ac05eadfed1d852d6174b675cb8ffa | TempusMUD/cl-tempus | graph.lisp | (in-package #:tempus)
(defstruct bfs-queue-element
room dir)
(defparameter +find-path-index-reset+ 255)
(defvar *find-path-index* +find-path-index-reset+)
(defvar *find-path-head* nil)
(defvar *find-path-tail* nil)
(defun mark (room)
(setf (find-path-index-of room) *find-path-index*))
(defun unmark (room)
(set... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/utilities/graph.lisp | lisp | return nil if not found
can't open here | (in-package #:tempus)
(defstruct bfs-queue-element
room dir)
(defparameter +find-path-index-reset+ 255)
(defvar *find-path-index* +find-path-index-reset+)
(defvar *find-path-head* nil)
(defvar *find-path-tail* nil)
(defun mark (room)
(setf (find-path-index-of room) *find-path-index*))
(defun unmark (room)
(set... |
303b22d516eead29af0df3b3a7eee4bda7d895971085d28d109dda83392b24be | siraben/haoc-2021 | day2.hs | import Control.Applicative
import Control.Monad
import Criterion.Main
import Data.Functor
import Data.List
import qualified Text.ParserCombinators.ReadP as P
data Dir = F Int | D Int | U Int deriving (Show, Eq)
Horizontal , depth
type Pos = (Int, Int)
move :: Pos -> Dir -> Pos
move (h, d) (F n) = (h + n, d)
move (... | null | https://raw.githubusercontent.com/siraben/haoc-2021/f0d1a59af37c741e8b09d311b3d8968ca47c8088/day2.hs | haskell | import Control.Applicative
import Control.Monad
import Criterion.Main
import Data.Functor
import Data.List
import qualified Text.ParserCombinators.ReadP as P
data Dir = F Int | D Int | U Int deriving (Show, Eq)
Horizontal , depth
type Pos = (Int, Int)
move :: Pos -> Dir -> Pos
move (h, d) (F n) = (h + n, d)
move (... | |
ad1d045a4d58f3c3ed00bf745aef58113999b99903f2d34d82fad6ca75412f9e | markandrus/twilio-haskell | AddressRequirement.hs | # LANGUAGE LambdaCase #
{-#LANGUAGE OverloadedStrings #-}
-------------------------------------------------------------------------------
-- |
-- Module : Twilio.AddressRequirement
Copyright : ( C ) 2017-
-- License : BSD-style (see the file LICENSE)
Maintainer : < >
-- Stability : pro... | null | https://raw.githubusercontent.com/markandrus/twilio-haskell/00704dc86dbf2117b855b1e2dcf8b6c0eff5bfbe/src/Twilio/Types/AddressRequirement.hs | haskell | #LANGUAGE OverloadedStrings #
-----------------------------------------------------------------------------
|
Module : Twilio.AddressRequirement
License : BSD-style (see the file LICENSE)
Stability : provisional
----------------------------------------------------------------------------- | # LANGUAGE LambdaCase #
Copyright : ( C ) 2017-
Maintainer : < >
module Twilio.Types.AddressRequirement where
import Control.Monad
import Data.Aeson
data AddressRequirement
= None
| Any
| Local
| Foreign
deriving (Bounded, Enum, Eq, Ord)
instance Read AddressRequirement where
readsPre... |
c0621d8d904a153334ca85a8a18f43bebbe41612095bba8d303e1b4bc5caa490 | janestreet/universe | step_function_node.mli | * A module internal to Incremental . Users should see { ! Incremental_intf } .
An [ ' a Step_function.t ] is a kind of DAG node that represents a function from
[ Time_ns.t ] to [ ' a ] with a finite number of steps . The steps are in nondecreasing
time order .
An ['a Step_function.t] is a ki... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/incremental/src/step_function_node.mli | ocaml | * A module internal to Incremental . Users should see { ! Incremental_intf } .
An [ ' a Step_function.t ] is a kind of DAG node that represents a function from
[ Time_ns.t ] to [ ' a ] with a finite number of steps . The steps are in nondecreasing
time order .
An ['a Step_function.t] is a ki... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.