_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 |
|---|---|---|---|---|---|---|---|---|
61d46abfc309a188a9221304985b6f62de718059bab7cc46398b14c061994e17 | namenu/advent-of-code | day04_test.clj | (ns aoc.year2018.day04-test
(:require [clojure.test :refer [deftest is]]
[aoc.year2018.day04 :refer [part1 part2]]
[aoc.util :refer [input-lines]]))
(deftest test-day4-sample
(let [input ["[1518-11-01 00:00] Guard #10 begins shift"
"[1518-11-01 00:05] falls asleep"
... | null | https://raw.githubusercontent.com/namenu/advent-of-code/83f8cf05931f814dab76696bf46fec1bb1276fac/2018/clojure/test/aoc/year2018/day04_test.clj | clojure | (ns aoc.year2018.day04-test
(:require [clojure.test :refer [deftest is]]
[aoc.year2018.day04 :refer [part1 part2]]
[aoc.util :refer [input-lines]]))
(deftest test-day4-sample
(let [input ["[1518-11-01 00:00] Guard #10 begins shift"
"[1518-11-01 00:05] falls asleep"
... | |
5d15f360d22d38651ba4e0bda6e298eaa4429be7c006b65014727ee925f85c76 | composewell/streamly | Channel.hs | -- |
Module : Streamly . Internal . Data . Fold . Concurrent . Channel
Copyright : ( c ) 2022 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
module Streamly.Internal.Data.Fold.Concurrent.Channel
(
-- * Channel
Channe... | null | https://raw.githubusercontent.com/composewell/streamly/c2f79142411383e14d8c7db0f2456775549925f0/src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
* Channel
* Configuration
* Fold operations
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
| Evaluate the fold asynchronously in a w... | Module : Streamly . Internal . Data . Fold . Concurrent . Channel
Copyright : ( c ) 2022 Composewell Technologies
Portability : GHC
module Streamly.Internal.Data.Fold.Concurrent.Channel
(
Channel
, Config
, maxBuffer
, inspect
, parEval
)
where
import Control.Concurrent ... |
7974455d449197fd5b848500f7906fffd064fa7bdcf11cf17d641f036e4ed107 | jakemcc/sicp-study | exercise1.8.clj | exercise 1.8
(defn diff-between [first second]
(Math/abs (- first second)))
(defn good-enough? [first second]
(< (diff-between first second) (* 0.001 second)))
(defn square [x] (* x x))
(defn improve [guess x]
(/ (+ (/ x (square guess)) (* 2.0 guess)) 3))
(defn cube-root [x]
(let [cube-root-iter (fn [prev-gu... | null | https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section1.1/exercise1.8.clj | clojure | Do it using (loop) | exercise 1.8
(defn diff-between [first second]
(Math/abs (- first second)))
(defn good-enough? [first second]
(< (diff-between first second) (* 0.001 second)))
(defn square [x] (* x x))
(defn improve [guess x]
(/ (+ (/ x (square guess)) (* 2.0 guess)) 3))
(defn cube-root [x]
(let [cube-root-iter (fn [prev-gu... |
dd1ec8008a810f06d07e402965edbefb8ec16fea6f9dea7561c03f72f96b4c09 | nikita-volkov/rebase | Lift.hs | module Rebase.Control.Applicative.Lift
(
module Control.Applicative.Lift
)
where
import Control.Applicative.Lift
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Control/Applicative/Lift.hs | haskell | module Rebase.Control.Applicative.Lift
(
module Control.Applicative.Lift
)
where
import Control.Applicative.Lift
| |
2410a334afbcffb985d5c075298492c5e96f7b5e00125260a076a2ce4c4c289a | openbadgefactory/salava | data.clj | (ns salava.user.data
(:require
[yesql.core :refer [defqueries]]
[salava.user.db :as u]
[salava.badge.main :as b]
[salava.page.main :as p]
[salava.file.db :as f]
[salava.social.db :as so]
[salava.location.db :as loc]
[salava.core.helper :refer [dump]]
[salava.core.util :as util]
... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/clj/salava/user/data.clj | clojure | :events events
(process-markdown (:criteria s) (:id s) "Selfie badges")]"\n"] | (ns salava.user.data
(:require
[yesql.core :refer [defqueries]]
[salava.user.db :as u]
[salava.badge.main :as b]
[salava.page.main :as p]
[salava.file.db :as f]
[salava.social.db :as so]
[salava.location.db :as loc]
[salava.core.helper :refer [dump]]
[salava.core.util :as util]
... |
1ddc3a7e038e547bcbe067bf3b2c4b854fbb6157cc7dee7f777e60d7386d0cfc | ucsd-progsys/liquidhaskell | T1288.hs | {-@ LIQUID "--expect-any-error" @-}
module T1288 where
{-@ measure foo @-}
foo :: () -> Int
foo _ = 10
@ : : { v : Int | v = 100 } @
blub = foo ()
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/neg/T1288.hs | haskell | @ LIQUID "--expect-any-error" @
@ measure foo @ | module T1288 where
foo :: () -> Int
foo _ = 10
@ : : { v : Int | v = 100 } @
blub = foo ()
|
3f3a7daa6b677b6d9ac67ed70b8c33c86bc003907d14fc76af209dcd0b098bc5 | jkvor/emysql | honeybee.erl | -module(honeybee).
-behavior(emysql_worker).
-export([init/1, process/1]).
-export([get_by_bid/1, get_by_type/1, get_all/0, create/1, update_type/2]).
-export([cajole_bee/1]).
-record(bee, {name, type, size}).
init(_) ->
erlang:register(honeybee1, self()),
Prepares = [
{bees_by_bid, <<"select * from ... | null | https://raw.githubusercontent.com/jkvor/emysql/6f72bc729200024f5940a2c11f15afd2af6f3d11/t/honeybee.erl | erlang | -module(honeybee).
-behavior(emysql_worker).
-export([init/1, process/1]).
-export([get_by_bid/1, get_by_type/1, get_all/0, create/1, update_type/2]).
-export([cajole_bee/1]).
-record(bee, {name, type, size}).
init(_) ->
erlang:register(honeybee1, self()),
Prepares = [
{bees_by_bid, <<"select * from ... | |
6358fa7852d2cb98fa3adc0341afe8b995a90a2743997746e2747fb843680a18 | CryptoKami/cryptokami-core | Model.hs | -- | Distributed Hash Table for peer discovery.
# OPTIONS_GHC -F -pgmF autoexporter #
| null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/DHT/Model.hs | haskell | | Distributed Hash Table for peer discovery. |
# OPTIONS_GHC -F -pgmF autoexporter #
|
e1d090545df2754fd5ffcca02f71e77e0411850c32283d64f07f967abdcbe921 | bcambel/oss.io | test_utils.clj | (ns hsm.test-utils
(:use midje.sweet)
(:require [hsm.utils :refer :all]))
(tabular
(fact "Domain name resolution"
(domain-of {:headers { "host" ?host }} ) => ?result )
?host ?result
"dev.pythonhackers.com" ["dev" "pythonhackers" "com"]
"pythonhackers.com" ["pythonhackers" "com"]
"www.clojurehackers... | null | https://raw.githubusercontent.com/bcambel/oss.io/cddb8b8ba4610084bc2f3c78c7837cdec87a8c76/test/hsm/test_utils.clj | clojure | Well Token fetcher always returns the same ID for right now! Very effective!! :) | (ns hsm.test-utils
(:use midje.sweet)
(:require [hsm.utils :refer :all]))
(tabular
(fact "Domain name resolution"
(domain-of {:headers { "host" ?host }} ) => ?result )
?host ?result
"dev.pythonhackers.com" ["dev" "pythonhackers" "com"]
"pythonhackers.com" ["pythonhackers" "com"]
"www.clojurehackers... |
3857b9cb12d8fa298ee9e303602c320aac02d3762b5915baf1e29f9a38da578b | fulcrologic/video-series | session.clj | (ns app.model.session
(:require
[com.wsscode.pathom.connect :as pc]
[com.fulcrologic.fulcro.server.api-middleware :refer [augment-response]]
[taoensso.timbre :as log]))
(def users (atom {1 {:user/id 1
:user/email ""
:user/password "letmein"}}))
(pc/defr... | null | https://raw.githubusercontent.com/fulcrologic/video-series/817969602a31aee5fbf546b35893d73f93f1d78c/src/app/model/session.clj | clojure | (ns app.model.session
(:require
[com.wsscode.pathom.connect :as pc]
[com.fulcrologic.fulcro.server.api-middleware :refer [augment-response]]
[taoensso.timbre :as log]))
(def users (atom {1 {:user/id 1
:user/email ""
:user/password "letmein"}}))
(pc/defr... | |
731985bcd8e53021d6782bc5f1f2917c4d657360362fabb7933731352b46b4f6 | avatar29A/hs-aitubots-api | Media.hs | {-# LANGUAGE OverloadedStrings #-}
module Aitu.Bot.Types.Media (Media (..)) where
import Data.Aeson
import Data.Text
data Media = Media {
mediaType :: Text
, mediaFileId :: Maybe Text
} deriving (Show)
instance FromJSON Media where
parseJSON (Object v) =
Media <$> v .: "type"
<... | null | https://raw.githubusercontent.com/avatar29A/hs-aitubots-api/9cc3fd1e4e9e81491628741a6bbb68afbb85704e/src/Aitu/Bot/Types/Media.hs | haskell | # LANGUAGE OverloadedStrings # |
module Aitu.Bot.Types.Media (Media (..)) where
import Data.Aeson
import Data.Text
data Media = Media {
mediaType :: Text
, mediaFileId :: Maybe Text
} deriving (Show)
instance FromJSON Media where
parseJSON (Object v) =
Media <$> v .: "type"
<*> v .: "fileId" |
661cb690db094804941ee9318360c50115d541895b9730475a51316c69b10898 | threatgrid/ctim | actor_test.clj | (ns ctim.generators.actor-test
(:require [clj-momo.test-helpers.core :as mth]
[clojure.test :refer [use-fixtures]]
[clojure.test.check.clojure-test :refer [defspec]]
[ctim.schemas.actor :as actor]
[ctim.test-helpers
[core :as th]
[properties :a... | null | https://raw.githubusercontent.com/threatgrid/ctim/2ecae70682e69495cc3a12fd58a474d4ea57ae9c/test/ctim/generators/actor_test.clj | clojure | Actor
New Actor | (ns ctim.generators.actor-test
(:require [clj-momo.test-helpers.core :as mth]
[clojure.test :refer [use-fixtures]]
[clojure.test.check.clojure-test :refer [defspec]]
[ctim.schemas.actor :as actor]
[ctim.test-helpers
[core :as th]
[properties :a... |
1f93e55dbbeb4c47746e868005eaaaf9e62e32a840bed67d715c11afa9c5be4e | static-analysis-engineering/codehawk | jCHSplitArray.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchsys/jCHSplitArray.mli | ocaml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... | |
6176bebf006f80803534cf22c9ae4e5f8883658dc00ad867be8dc35942778620 | maximedenes/native-coq | declarations.ml | open Errors
open Util
open Names
open Term
open Validate
Bytecode
type values
type reloc_table
type to_patch_substituted
(*Retroknowledge *)
type action
type retroknowledge
type engagement = ImpredicativeSet
let val_eng = val_enum "eng" 1
type polymorphic_arity = {
poly_param_levels : Univ.universe option list;... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/checker/declarations.ml | ocaml | Retroknowledge
* Substitutions, code imported from kernel/mod_subst
's like subst
* Inlining level of parameters at functor applications.
This is ignored by the checker.
* A constant can have no body (axiom/parameter), or a
transparent body, or an opaque one
New: younger hyp at top
Rtree.Param
Rtree.... | open Errors
open Util
open Names
open Term
open Validate
Bytecode
type values
type reloc_table
type to_patch_substituted
type action
type retroknowledge
type engagement = ImpredicativeSet
let val_eng = val_enum "eng" 1
type polymorphic_arity = {
poly_param_levels : Univ.universe option list;
poly_level : Univ... |
ee661e282a64c797ae8348355c42030b0207571dbd0cb91ac12efcb28b118070 | marcoheisig/Typo | data-and-control-flow.lisp | (in-package #:typo.vm)
(define-fnrecord apply (function arg &rest more-args)
(:specializer
(assert-wrapper-type function function-designator)
(let ((tail (if (null more-args)
arg
(car (last more-args)))))
(ntype-subtypecase (wrapper-ntype tail)
((not list) (abo... | null | https://raw.githubusercontent.com/marcoheisig/Typo/303e21c38b1773f7d6f87eeb7f03617c286c4a44/code/vm/data-and-control-flow.lisp | lisp | We give up here, because we cannot determine the number of values
returned by APPLY.
| (in-package #:typo.vm)
(define-fnrecord apply (function arg &rest more-args)
(:specializer
(assert-wrapper-type function function-designator)
(let ((tail (if (null more-args)
arg
(car (last more-args)))))
(ntype-subtypecase (wrapper-ntype tail)
((not list) (abo... |
95f75639a7d2ad650d441acbbf5954f22d94debd0e2efc620663b5dd931cddd3 | larcenists/larceny | 16inv4.scm | (bits 16)
(text
(alt (if (inv (alt (nop)
z!
(inv (nop))
ge!))
(inv (nop))
(nop))
(nop)))
00000000 90 nop
00000001 EB08 short 0xb
00000003 7406 jz 0xb
00000005 90 nop
00000006 7D03 jnl 0xb
00... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/tests/prims16/16inv4.scm | scheme | (bits 16)
(text
(alt (if (inv (alt (nop)
z!
(inv (nop))
ge!))
(inv (nop))
(nop))
(nop)))
00000000 90 nop
00000001 EB08 short 0xb
00000003 7406 jz 0xb
00000005 90 nop
00000006 7D03 jnl 0xb
00... | |
727d73359e2d25e5a5deafb5ca95712b10f799ea628c8f0a3f9bda54782101bb | codecrafters-io/build-your-own-grep | Parser.hs | module Parser (parse, astToMatcher, AST(..)) where
import qualified Text.Megaparsec as M
import Text.Megaparsec.Char (char, digitChar)
import Data.Void (Void)
import Data.Maybe (fromMaybe, isNothing)
import RegEx (M, posLit, negLit, emptyStrM, digitM, digitInverseM, alphaNumM, alphaNumInverseM, anyCharM, orM, andM, co... | null | https://raw.githubusercontent.com/codecrafters-io/build-your-own-grep/085a70404357c4abf11ff7c039cdf13181349e3c/solutions/haskell/07-start_of_string_anchor/code/src/Parser.hs | haskell | | Inverts an AST Char
The regex parser starts here
I had to adjust a few rules to support better parsing | module Parser (parse, astToMatcher, AST(..)) where
import qualified Text.Megaparsec as M
import Text.Megaparsec.Char (char, digitChar)
import Data.Void (Void)
import Data.Maybe (fromMaybe, isNothing)
import RegEx (M, posLit, negLit, emptyStrM, digitM, digitInverseM, alphaNumM, alphaNumInverseM, anyCharM, orM, andM, co... |
19041572ae447139562df4622850127636f211be2878b420b4331b2b6becc68a | ajhc/ajhc | T2497.hs | # OPTIONS_GHC -fwarn - unused - binds #
module ShouldCompile() where
Trac # 2497 ; test should compile without language
-- pragmas to swith on the forall
{-# RULES "id" forall (x :: a). id x = x #-}
Trac # 2213 ; eq should not be reported as unused
eq,beq :: Eq a => a -> a -> Bool
eq = (==) -- Used... | null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/regress/tests/1_typecheck/2_pass/ghc/T2497.hs | haskell | pragmas to swith on the forall
# RULES "id" forall (x :: a). id x = x #
Used
Unused | # OPTIONS_GHC -fwarn - unused - binds #
module ShouldCompile() where
Trac # 2497 ; test should compile without language
Trac # 2213 ; eq should not be reported as unused
eq,beq :: Eq a => a -> a -> Bool
# RULES
" rule 1 " forall x y. x = = y = y ` eq ` x
#
"rule 1" forall x y. x == y = y `eq` x... |
0766acfdeacc509bf589817b84d88151f18e3d7c4a609f8f0a285b07d7f0dd1e | sanette/oplot | surf3d.ml | Three 3D views .
open Oplot.Plt
let a = axis 0. 0.
let fx u v = 0.3 +. ((1. +. (0.5 *. cos u)) *. cos v)
let fy u v = 0.2 +. ((1. +. (0.5 *. cos u)) *. sin v)
let fz u _ = 0.5 *. sin u
let s = surf3d_plot ~wire:true ~width:10 ~height:50 fx fy fz 0. 0. 3. 6.29
let set_wire po wire =
match po with
| Surf3d ((fx,... | null | https://raw.githubusercontent.com/sanette/oplot/facce7233787bc81f14acc261e210c0ae243a123/bin/surf3d.ml | ocaml | Three 3D views .
open Oplot.Plt
let a = axis 0. 0.
let fx u v = 0.3 +. ((1. +. (0.5 *. cos u)) *. cos v)
let fy u v = 0.2 +. ((1. +. (0.5 *. cos u)) *. sin v)
let fz u _ = 0.5 *. sin u
let s = surf3d_plot ~wire:true ~width:10 ~height:50 fx fy fz 0. 0. 3. 6.29
let set_wire po wire =
match po with
| Surf3d ((fx,... | |
ad5cef1f4de445fb651b799727e2575d3b2b64d3aa64f4aa2eb1ec0579c874aa | riverford/durable-ref | cheshire.clj | (ns riverford.durable-ref.format.json.cheshire
(:require [cheshire.core :as cheshire]
[riverford.durable-ref.core :as dref]
[clojure.java.io :as io])
(:import (java.io ByteArrayOutputStream)
(java.util.zip GZIPOutputStream GZIPInputStream)))
(defmethod dref/serialize "json"
[ob... | null | https://raw.githubusercontent.com/riverford/durable-ref/f18402c07549079fd3a1c8d2595f893a055851de/src/riverford/durable_ref/format/json/cheshire.clj | clojure | (ns riverford.durable-ref.format.json.cheshire
(:require [cheshire.core :as cheshire]
[riverford.durable-ref.core :as dref]
[clojure.java.io :as io])
(:import (java.io ByteArrayOutputStream)
(java.util.zip GZIPOutputStream GZIPInputStream)))
(defmethod dref/serialize "json"
[ob... | |
de5f8871746dfdbb3764012e1b248aab79d986b782cb8452f3d7db522df87cea | MinaProtocol/mina | plonk_constraint_system.ml | (* TODO: remove these openings *)
open Sponge
open Unsigned.Size_t
TODO : open Core here instead of opening it multiple times below
module Kimchi_gate_type = struct
to allow deriving sexp
type t = Kimchi_types.gate_type =
| Zero
| Generic
| Poseidon
| CompleteAdd
| VarBaseMul
| EndoMul
... | null | https://raw.githubusercontent.com/MinaProtocol/mina/a4e030878c166014f8731c356b48ce362abd6f90/src/lib/crypto/kimchi_backend/common/plonk_constraint_system.ml | ocaml | TODO: remove these openings
* A gate interface, parameterized by a field.
* A row indexing in a constraint system.
* A position represents the position of a cell in the constraint system.
* A position is a row and a column.
* Generates a full row of positions that each points to itself.
* Given a number of colum... | open Sponge
open Unsigned.Size_t
TODO : open Core here instead of opening it multiple times below
module Kimchi_gate_type = struct
to allow deriving sexp
type t = Kimchi_types.gate_type =
| Zero
| Generic
| Poseidon
| CompleteAdd
| VarBaseMul
| EndoMul
| EndoMulScalar
| Lookup
... |
cafd45381ef6a57e8d576070ec1fbf3b0f3058e57338a2b340678b973ed67e5a | DKurilo/hackerrank | Main.hs | import Control.Monad
import Data.Bifunctor (bimap)
import Data.List (foldl', intercalate)
import Data.Set (Set (..))
import qualified Data.Set as S
import System.IO
data Coord = Coord {cX :: Int, cY :: Int} deriving (Eq, Ord)
data Direction = N | S | E | W deriving (Show)
charToDirection :: Char -> Direction
charToD... | null | https://raw.githubusercontent.com/DKurilo/hackerrank/5951bdfecca6ca2601dd7a1515fc5587531686f8/codingame/bouncing-barry/src/Main.hs | haskell | DO NOT REMOVE
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
hPutStrLn stderr "Debug messages..."
Write answer to stdout | import Control.Monad
import Data.Bifunctor (bimap)
import Data.List (foldl', intercalate)
import Data.Set (Set (..))
import qualified Data.Set as S
import System.IO
data Coord = Coord {cX :: Int, cY :: Int} deriving (Eq, Ord)
data Direction = N | S | E | W deriving (Show)
charToDirection :: Char -> Direction
charToD... |
114dd24268c0241f7b1f16d0bb669bb6c3879c0b25df72c5d675cca9b0800ad1 | marigold-dev/deku | output.mli | type t = { module_ : string; constants : (int * Values.t) array }
val make :
string ->
(int * Values.t) array ->
(t, [ `Invalid_module | `Module_validation_error ]) result
| null | https://raw.githubusercontent.com/marigold-dev/deku/a26f31e0560ad12fd86cf7fa4667bb147247c7ef/deku-c/tunac/lib/output.mli | ocaml | type t = { module_ : string; constants : (int * Values.t) array }
val make :
string ->
(int * Values.t) array ->
(t, [ `Invalid_module | `Module_validation_error ]) result
| |
a50b19143687e18b390525dfcd59805553052541516ca48c86eb00b8277a0c22 | johnridesabike/acutis | debugAst.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2022 .
(* *)
This Source Code For... | null | https://raw.githubusercontent.com/johnridesabike/acutis/19f04e5b65cdc8910eaa2cdee5ad7ef110484b47/lib/debugAst.ml | ocaml | ************************************************************************
****************************... | Copyright ( c ) 2022 .
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
module F = Format
open Ast
let equal_pair eq_a eq_b (... |
719c0e6db2b070d28f8b90868366cba4f6be7416a0518bf674d6073af749ac01 | haskell-repa/repa | BiMap.hs |
module Data.Repa.Store.Prim.BiMap
( BiMap
, connectWithSep
-- * Conversions
, keysFwd
, keysRev
-- * Loading
, loadRev
, loadFwd
-- * Refection
, reflect
, reflectFwd
, reflectRev)
where
import Data.IORef
import Data.Rep... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-store/Data/Repa/Store/Prim/BiMap.hs | haskell | * Conversions
* Loading
* Refection
| Bi-directional map backed by a flat text file which defines the mapping.
^ Path to the external map.
^ Field separator for file.
^ Demand-loaded mapping for the forward direction.
^ Demand-loaded mapping for the reverse direction.
| Connect an external bidirectional map.
... |
module Data.Repa.Store.Prim.BiMap
( BiMap
, connectWithSep
, keysFwd
, keysRev
, loadRev
, loadFwd
, reflect
, reflectFwd
, reflectRev)
where
import Data.IORef
import Data.Repa.Convert
import Data.Text (Text)
impo... |
db68802d88b9aac1d5a098f3350988ce2e08eb83da27c5dd18c8207acceb831b | TerrorJack/ghc-alter | Integer.hs | # LANGUAGE CPP #
# LANGUAGE MagicHash #
# LANGUAGE NoImplicitPrelude #
#include "MachDeps.h"
-- |
-- Module : GHC.Integer.Type
Copyright : ( c ) 2014
-- License : BSD3
--
Maintainer :
-- Stability : provisional
Portability : non - portable ( GHC Extensions )
--
-- The 'Integer' type... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/integer-gmp/src/GHC/Integer.hs | haskell | |
Module : GHC.Integer.Type
License : BSD3
Stability : provisional
The 'Integer' type.
operations.
* Conversion to other integral types
* Arithmetic operations
* Comparison predicates
** 'Int#'-boolean valued versions of comparison predicates
| These operations return @0#@ and @1#@ instead ... | # LANGUAGE CPP #
# LANGUAGE MagicHash #
# LANGUAGE NoImplicitPrelude #
#include "MachDeps.h"
Copyright : ( c ) 2014
Maintainer :
Portability : non - portable ( GHC Extensions )
This module exposes the /portable/ ' Integer ' API . See
" GHC.Integer . GMP.Internals " for the @integer - gmp@-s... |
fa3ad84abfec7bee14e861dc61990938eef7e4543cc7bca3151323f38245e9e5 | interline/erlang-thrift | thrift_http_transport.erl | %%
Licensed to the Apache Software Foundation ( ASF ) under one
%% or more contributor license agreements. See the NOTICE file
%% distributed with this work for additional information
%% regarding copyright ownership. The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
%% "License"); you ... | null | https://raw.githubusercontent.com/interline/erlang-thrift/1e0c2d2e529119d18614c16d35f7117469c26099/src/thrift_http_transport.erl | erlang |
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
"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 require... | Licensed to the Apache Software Foundation ( ASF ) under one
to you under the Apache License , Version 2.0 ( the
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(thrift_http_transport).
-behaviour(thrift_transport).
-export([new/2, ... |
7b8980b7c58de781078d73e73c2a067192096782a8932686ddfed8d711917814 | kelamg/HtDP2e-workthrough | ex23.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex23) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Fixed-size-Data/ex23.rkt | racket | about the language level of this file in a form that our tools can easily process.
run with stepper | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex23) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define (string-first-2 s)
(substring s 0 1))
(string-first-2 "h... |
31336733a93a724ddf7995810867106bae04df44d561b996edfe5209daeda43a | roglo/mlrogue | init.ml | $ I d : init.ml , v 1.64 2013/01/29 14:00:23 deraugla Exp $
#use "rogue.def";
open Rfield;
open Rogue;
open Printf;
open Translate;
value syllabes =
[| "blech"; "foo"; "barf"; "rech"; "bar"; "quo"; "bloto"; "woh"; "caca";
"blorp"; "erp"; "festr"; "rot"; "slie"; "snorf"; "iky"; "yuky"; "ooze";
"ah"; "ba... | null | https://raw.githubusercontent.com/roglo/mlrogue/b73238bbbc8cd88c83579c3b72772a8c418020e5/init.ml | ocaml | True | $ I d : init.ml , v 1.64 2013/01/29 14:00:23 deraugla Exp $
#use "rogue.def";
open Rfield;
open Rogue;
open Printf;
open Translate;
value syllabes =
[| "blech"; "foo"; "barf"; "rech"; "bar"; "quo"; "bloto"; "woh"; "caca";
"blorp"; "erp"; "festr"; "rot"; "slie"; "snorf"; "iky"; "yuky"; "ooze";
"ah"; "ba... |
7c47757184cf46748fea2bf00a1ae9082751eac443262760729b2309f00330e5 | turquoise-hexagon/euler | solution.scm | (import
(euler)
(srfi 1))
(define (diagonals n)
`(,(+ (* 4 n n) (* 4 n) 1)
,(+ (* 4 n n) (* 2 n) 1)
,(- (* 4 n n) (* 2 n) -1)
,(+ (* 4 n n) 1)))
(define (solve)
(let loop ((i 1) (primes 0) (total 1))
(let ((primes (+ primes (count prime? (diagonals i)))) (total (+ total 4)))
(if (> 1/1... | null | https://raw.githubusercontent.com/turquoise-hexagon/euler/592c5f4f45fe8e8b82102be9fe11b3b1134d98fc/src/058/solution.scm | scheme | (import
(euler)
(srfi 1))
(define (diagonals n)
`(,(+ (* 4 n n) (* 4 n) 1)
,(+ (* 4 n n) (* 2 n) 1)
,(- (* 4 n n) (* 2 n) -1)
,(+ (* 4 n n) 1)))
(define (solve)
(let loop ((i 1) (primes 0) (total 1))
(let ((primes (+ primes (count prime? (diagonals i)))) (total (+ total 4)))
(if (> 1/1... | |
eecd1455e483eaa2f27ce05cf585cb48f24edf0fc535b588aece73d703e3cb35 | mitchellwrosen/hspolls | Response.hs | module Hp.GitHub.Response
( GitHubResponse(..)
) where
import Hp.GitHub.ErrorResponse (GitHubErrorResponse)
import Data.Aeson (FromJSON(..), Value)
import Data.Aeson.Types (Parser)
data GitHubResponse a
= GitHubResponseError GitHubErrorResponse
| GitHubResponseSuccess a
deriving stock (Show)
instan... | null | https://raw.githubusercontent.com/mitchellwrosen/hspolls/22efea743194ade091f7daa112a2d9ce985a4500/src/Hp/GitHub/Response.hs | haskell | module Hp.GitHub.Response
( GitHubResponse(..)
) where
import Hp.GitHub.ErrorResponse (GitHubErrorResponse)
import Data.Aeson (FromJSON(..), Value)
import Data.Aeson.Types (Parser)
data GitHubResponse a
= GitHubResponseError GitHubErrorResponse
| GitHubResponseSuccess a
deriving stock (Show)
instan... | |
3beee4bcaf08e96686ca68de3c5559149573a814a1207255c1e58eff53aecdf1 | futurice/haskell-mega-repo | Ctx.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TemplateHaskell #-}
module Futurice.App.Proxy.Ctx where
import Futurice.Postgres
import Futurice.Prelude
import Futurice.Services (Service (..))
import Prelude ()
import Futurice.App.Proxy.Endpoint (HasClientBaseurl (..), Has... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/proxy-app/src/Futurice/App/Proxy/Ctx.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
Base URLS
-----------------------------------------------------------------------------
Instances
----------------------------------------------------------------------------- | # LANGUAGE MultiParamTypeClasses #
module Futurice.App.Proxy.Ctx where
import Futurice.Postgres
import Futurice.Prelude
import Futurice.Services (Service (..))
import Prelude ()
import Futurice.App.Proxy.Endpoint (HasClientBaseurl (..), HasHttpManager (..))
import Futurice.App.Proxy.Config
| Context type , holds h... |
ce74d8f24535daeee943ac2bf6114b837eac44799e27d65ffabcd71ee23fcc6d | cl-axon/cl-aima | shopping.lisp | ;;; File: shopping.lisp -*- Mode: Lisp; Syntax: Common-Lisp; -*-
The Shopping World :
;;; Warning! This code has not yet been tested or debugged!
(defparameter *page250-supermarket*
'((at edge wall)
(at (1 1) (sign :words (exit)))
(at (and (2 2) (6 2)) shopper)
(at (and (3 2) (7 2)) cashi... | null | https://raw.githubusercontent.com/cl-axon/cl-aima/1e6915fa9f3e5f2c6fd75952d674ebec53558d04/logic/environments/shopping.lisp | lisp | File: shopping.lisp -*- Mode: Lisp; Syntax: Common-Lisp; -*-
Warning! This code has not yet been tested or debugged!
The rest of the store is temporarily out of stock ...
New Structures
Some have a camera to zoom in and out at a location
Percepts
Zoom out |
The Shopping World :
(defparameter *page250-supermarket*
'((at edge wall)
(at (1 1) (sign :words (exit)))
(at (and (2 2) (6 2)) shopper)
(at (and (3 2) (7 2)) cashier-stand)
(at (and (4 2) (8 2) (4 7)) cashier)
(at (2 4) (sign :words (Aisle 1 Vegetables)))
(at (2 5) (-15... |
5c22d520f5d6ec90025291f29f400ade96dba21186dcfeb33e5b50fdab3e386d | facebook/flow | scope_builder_sig.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/flow/5625ae0ebfda43fc9ca076f5b8b7289a7be5cea0/src/analysis/scope_builder_sig.ml | ocaml |
* 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... | |
b91e6a9666e2863ade535c67781acfc78ab4317fa31d67f9966d208499c7915d | wdebeaum/step | tests.lisp | ;;
;;
;; test suite for lf-public and kr-public functions
;;
(print (list
; ;; lf-parent
; (mapcar (lambda (in out) (equal out (funcall 'lf-parent in)))
; '(lf_move lf_thing lf_equipment lf_grade-modifier lf_adsf) '(lf_motion lf_any-sem lf_manufactured-object lf_modifier nil))
; ;; lf-parent
(mapcar (lambda (in... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/OntologyManager/tests.lisp | lisp |
test suite for lf-public and kr-public functions
;; lf-parent
(mapcar (lambda (in out) (equal out (funcall 'lf-parent in)))
'(lf_move lf_thing lf_equipment lf_grade-modifier lf_adsf) '(lf_motion lf_any-sem lf_manufactured-object lf_modifier nil))
;; lf-parent
;; lf-subtype
(mapcar (lambda (sub super out) (eq... |
(print (list
(mapcar (lambda (in out) (equal out (funcall 'get-parent in)))
'(lf_move lf_thing lf_equipment lf_grade-modifier lf_adsf) '(lf_motion lf_any-sem lf_manufactured-object lf_modifier nil))
' ( lf_situation - root lf_body - process lf_qmodifier ) ' ( lf_body - process lf_situation - root lf_modifie... |
f9c30812703d8293176d5a3659253a891c06f8ed82ad009febbaa11467563098 | sampou-org/pfad | bench18.hs | module Main where
import Code18
main :: IO ()
main = do
{ putStr "bfsolve puzzle1 : " >> print (bfsolve puzzle1)
; putStr "bfsolve puzzle2 : " >> print (bfsolve puzzle2)
; putStr "bfsolve puzzle3 : " >> print (bfsolve puzzle3)
; putStr "bfsolve puzzle4 : " >> print (bfsolve puzzle4)
; putStr "psolve puzzle... | null | https://raw.githubusercontent.com/sampou-org/pfad/3c2e0847bea9eac80672e1fbccb86ca5a6b09415/Code/bench18.hs | haskell | module Main where
import Code18
main :: IO ()
main = do
{ putStr "bfsolve puzzle1 : " >> print (bfsolve puzzle1)
; putStr "bfsolve puzzle2 : " >> print (bfsolve puzzle2)
; putStr "bfsolve puzzle3 : " >> print (bfsolve puzzle3)
; putStr "bfsolve puzzle4 : " >> print (bfsolve puzzle4)
; putStr "psolve puzzle... | |
9124de225e791b13c634bbcf814627a55481bb0754286aa26598593bddaf44bf | ocamllabs/ocaml-modular-implicits | pr6513_ok.ml | module type PR6513 = sig
module type S = sig type u end
module type T = sig
type 'a wrap
type uri
end
module Make: functor (Html5 : T with type 'a wrap = 'a) ->
S with type u = < foo : Html5.uri >
end
Requires -package tyxml
module type PR6513_orig = sig
module type S =
sig
type t
t... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/typing-modules-bugs/pr6513_ok.ml | ocaml | module type PR6513 = sig
module type S = sig type u end
module type T = sig
type 'a wrap
type uri
end
module Make: functor (Html5 : T with type 'a wrap = 'a) ->
S with type u = < foo : Html5.uri >
end
Requires -package tyxml
module type PR6513_orig = sig
module type S =
sig
type t
t... | |
73d29f160e1e19b32d92b2309d29174ac730f2e064a2b5062cc80403ecc60e90 | jonase/eastwood | defn_reflection_warning.clj | (ns eastwood.test.outside-test-paths.defn-reflection-warning)
(defn foo [x]
(.fooasdlfjk x))
| null | https://raw.githubusercontent.com/jonase/eastwood/a515efe22c9ce3c84d73d800e23ae7ebbda4a78a/test-resources/eastwood/test/outside_test_paths/defn_reflection_warning.clj | clojure | (ns eastwood.test.outside-test-paths.defn-reflection-warning)
(defn foo [x]
(.fooasdlfjk x))
| |
47bae4e3df569cf52ab71f9d80abbdb7f47e216435bdd90c7630a12fc611fbc5 | JustusAdam/language-haskell | T0073.hs | SYNTAX TEST " source.haskell " " Visible type application "
function =
let l = [] @[( Int, f [ Bool ] )] in
-- ^ meta.type-application.haskell
^^^ storage.type.haskell
-- ^ variable.other.generic-type.haskell
let x = "Hello" @String in
-- ^... | null | https://raw.githubusercontent.com/JustusAdam/language-haskell/c9ee1b3ee166c44db9ce350920ba502fcc868245/test/tickets/T0073.hs | haskell | ^ meta.type-application.haskell
^ variable.other.generic-type.haskell
^ meta.type-application.haskell
^ - meta.type-application.haskell
^^^^ constant.other.haskell
^ meta.type-application.haskell
^ variable.other.generic-ty... | SYNTAX TEST " source.haskell " " Visible type application "
function =
let l = [] @[( Int, f [ Bool ] )] in
^^^ storage.type.haskell
let x = "Hello" @String in
^^^^^^ storage.type.haskell
let c@(Some pattern) = undefined in
let g = f @( g ([]) -> String ) in
... |
3cb49031feadb1f16e89e517b2522081662fadc566e562c68d3da1708a3e7358 | google/codeworld | Widget.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
# LANGUAGE ParallelListComp #
# LANGUAGE PatternGuards #
# LANGUAGE RebindableSyntax #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
-- | A very simple Graphical User Interface (GUI) for user interaction with
-- buttons, checkboxes, slide... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/codeworld-base/src/Extras/Widget.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports #
| A very simple Graphical User Interface (GUI) for user interaction with
buttons, checkboxes, sliders and a few others.
$intro
* Widgets
* Convenience functions
* Examples
------------------------------------------------------------------------------
$in... | # LANGUAGE ParallelListComp #
# LANGUAGE PatternGuards #
# LANGUAGE RebindableSyntax #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
module Extras.Widget
guiDrawingOf,
guiActivityOf,
Widget,
toggle,
button,
slider,
randomBox,
timer,
counter,
withConversion,
s... |
3ce45ed585b09391d2da5855db2294b07d3906058ff92a517e2370e430813886 | rmloveland/scheme48-0.53 | expand.scm | Copyright ( c ) 1994 by . See file COPYING .
Expanding using the Scheme 48 expander .
(define (scan-packages packages)
(let ((definitions
(fold (lambda (package definitions)
(let ((cenv (package->environment package)))
(fold (lambda (form definitions)
(let ((node (expand-form form cenv))... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/prescheme/expand.scm | scheme | Copyright ( c ) 1994 by . See file COPYING .
Expanding using the Scheme 48 expander .
(define (scan-packages packages)
(let ((definitions
(fold (lambda (package definitions)
(let ((cenv (package->environment package)))
(fold (lambda (form definitions)
(let ((node (expand-form form cenv))... | |
adea3d4475423bfeffcc00b5a739f857e0b06369f29ccad924f0c78cba93e1e5 | AlacrisIO/legicash-facts | assembly.ml | open Legilogic_lib
open Lib
open Signing
(* In the future, segments can be nested, and
offset would be relative to a subsegment of a segment,
to be fully resolved when the segment size is finalized.
(Also, a non-embedded front-end syntax.)
For now, everything is fixed size and we don't compute
label of... | null | https://raw.githubusercontent.com/AlacrisIO/legicash-facts/5d3663bade68c09bed47b3f58fa12580f38fdb46/src/legilogic_ethereum/assembly.ml | ocaml | In the future, segments can be nested, and
offset would be relative to a subsegment of a segment,
to be fully resolved when the segment size is finalized.
(Also, a non-embedded front-end syntax.)
For now, everything is fixed size and we don't compute
label offsets much less optimize segment layout:
... | open Legilogic_lib
open Lib
open Signing
type offset = int [@@deriving show, yojson, rlp]
24576 , limit set by EIP 170 -170.md
let max_segment_size = 0x6000
TODO : use pure functional arrays ?
module Segment = struct
type state =
| Bytes of Bytes.t
| Buffer of Butter.t
| Concat of Segment... |
395f00a0f826d9ed5c3e5c7172edbf1299d4d6b285f1f3fac4283adb06cbf732 | duanebester/clunk | buffered_message_socket.cljc | (ns com.clunk.buffered-message-socket
(:require [clojure.core.match :as m]
[clojure.core.async :as async]
[com.clunk.message-socket :as ms]))
(defrecord BufferedMessageSocket [buffered-socket in-ch out-ch])
(def status-map (atom {}))
(defn handle-backend-message [message]
(println "Backen... | null | https://raw.githubusercontent.com/duanebester/clunk/86c50a32230e055ba3b0dd1e34f31e05a32cab20/src/com/clunk/buffered_message_socket.cljc | clojure | (ns com.clunk.buffered-message-socket
(:require [clojure.core.match :as m]
[clojure.core.async :as async]
[com.clunk.message-socket :as ms]))
(defrecord BufferedMessageSocket [buffered-socket in-ch out-ch])
(def status-map (atom {}))
(defn handle-backend-message [message]
(println "Backen... | |
d1c8d411925d3fc6e0a01e62d5529e337efe1ca5d5d6091c6e5659214e9994cf | helium/erlang-libp2p | libp2p_config.erl | -module(libp2p_config).
-export([get_opt/2, get_opt/3,
base_dir/1, swarm_dir/2,
insert_pid/4, lookup_pid/3, lookup_pids/2, remove_pid/2, remove_pid/3, gc_pids/1,
session/0, insert_session/3, insert_session/4, lookup_session/2, lookup_session/3, remove_session/2,
lookup_sessions/1, l... | null | https://raw.githubusercontent.com/helium/erlang-libp2p/3d81f62ba1c036e417237fb4e9e1ac6cddd8d3f2/src/libp2p_config.erl | erlang | this should sort before all other keys
Global config
make continuations safe while deleting
so we don't need to explicitly find them beforehand
indicate we're done doing a destructive iteration
we know we can always delete this and add the pid to our set of
pids to be deleted
Transports
Listeners
TODO... | -module(libp2p_config).
-export([get_opt/2, get_opt/3,
base_dir/1, swarm_dir/2,
insert_pid/4, lookup_pid/3, lookup_pids/2, remove_pid/2, remove_pid/3, gc_pids/1,
session/0, insert_session/3, insert_session/4, lookup_session/2, lookup_session/3, remove_session/2,
lookup_sessions/1, l... |
9936e7166c4745ca2203e73413155810f8943439bcd61b5cc4e15b4824a46176 | hammerlab/prohlatype | fastq.ml |
module Sset = Set.Make (struct type t = string [@@deriving ord] end)
open Core_kernel
let to_stop = function
| None -> fun _ -> false
| Some n -> fun r -> r >= n
(* read header -> display, stop *)
let to_filter = function
| [] -> fun _ -> true, false
| lst ->
let s = ref (Sset.of_list lst) in
... | null | https://raw.githubusercontent.com/hammerlab/prohlatype/3acaf7154f93675fc729971d4c76c2b133e90ce6/src/lib/fastq.ml | ocaml | read header -> display, stop
Avoid circular dep
Note that 'filt' discards reads that it is searching for;
* we should call this only for the unpaired reads!
Avoid circular dep |
module Sset = Set.Make (struct type t = string [@@deriving ord] end)
open Core_kernel
let to_stop = function
| None -> fun _ -> false
| Some n -> fun r -> r >= n
let to_filter = function
| [] -> fun _ -> true, false
| lst ->
let s = ref (Sset.of_list lst) in
begin fun el ->
if Sset.... |
9781080aaec3cd7401870f42db2c9e84e67518b9644da0669f1d51ca01e2fe11 | ghc/nofib | Main.hs | --
The Computer Language Benchmarks Game
-- /
--
contributed by ( with some bits taken from
-- version), v1.2
{-# LANGUAGE BangPatterns #-}
import Text.Printf
import Data.ByteString.Internal
import qualified Data.ByteString.Char8 as S
import Control.Applicative
import Control.Monad
import Control.Concurre... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/shootout/k-nucleotide/Main.hs | haskell |
/
version), v1.2
# LANGUAGE BangPatterns #
Drop in replacement for sequence
array fusion!
---- Hash table implementation ----------------------------------------------
Note: Hash tables are not generally used in functional languages, so there
requires a hash table. This is why I have implemented the hash t... | The Computer Language Benchmarks Game
contributed by ( with some bits taken from
import Text.Printf
import Data.ByteString.Internal
import qualified Data.ByteString.Char8 as S
import Control.Applicative
import Control.Monad
import Control.Concurrent
import Foreign.Storable
import Foreign.Marshal.Alloc
import ... |
b0df241c2bd4589e151d13599225f2e1ff8107cbad2cfacfdb30b16bb1e02c2a | kunstmusik/pink | demo_node.clj | (ns pink.demo.demo-node
(:require [pink.engine :refer :all]
[pink.event :refer :all]
[pink.instruments.horn :refer :all]
[pink.util :refer [mul try-func]]
[pink.oscillators :refer :all]
[pink.envelopes :refer [env]]
[pink.node :refer :all]
... | null | https://raw.githubusercontent.com/kunstmusik/pink/7d37764b6a036a68a4619c93546fa3887f9951a7/src/demo/pink/demo/demo_node.clj | clojure | (require '[pink.noise :refer :all])
(engine-add-afunc e (white-noise))
(node-add-func root-node s)
(node-remove-func root-node s) | (ns pink.demo.demo-node
(:require [pink.engine :refer :all]
[pink.event :refer :all]
[pink.instruments.horn :refer :all]
[pink.util :refer [mul try-func]]
[pink.oscillators :refer :all]
[pink.envelopes :refer [env]]
[pink.node :refer :all]
... |
c483a907788a06ef0e768fcfc6004567fea71c7cafd1804dda85a5cb9ed0c631 | rizo/snowflake-os | std.mli |
* Std - Additional functions
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option ) ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/extlib/std.mli | ocaml | * Additional functions.
* creates a string from a char.
* the identity function.
* returns an unique identifier every time it is called.
* reprensent a runtime value as a string.
* finally [fend f x] calls [f x] and then [fend()] even if [f x] raised
an exception. |
* Std - Additional functions
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option ) ... |
aada04db42c9067ef31337491b4d8a5611cb9f4519afe1796248d41f1635a26e | brendanhay/amazonka | UserAccessLoggingSettings.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workspaces-web/gen/Amazonka/WorkSpacesWeb/Types/UserAccessLoggingSettings.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WorkSpacesWeb.Types.UserAccessLoggingSettings
Stability : auto-generated
| A user access logging settings resource that can be associated with a
web portal.
/See:/ 'newUserAccessLoggingSettings' smart constructor.
| A list of web ... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Co... |
205933fc4b2793bf5954739f9fd96a9bd83cafacbc3ab6d71a149a03d9b12437 | project-oak/hafnium-verification | Ident.mli |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* 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) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/IR/Ident.mli | ocaml | * Identifiers: program variables and logical variables
* Program and logical variables.
* Equality for identifiers.
* Names used to replace strings.
* Equality for names.
* Kind of identifiers.
* Equality for kind.
* Set for identifiers.
* Hash table with ident as key.
* Map with ident as key.
* Get the curre... |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* 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) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
4c6b69f94e458b6c6a004e477be1d1277edfa0c1bf5bef8051333c7212f4e1db | berberman/arch-hs | Main.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Main (main) where
import Args
import Control.Monad (unless)
import qualified Data.Map as Map
import Diff
import Distribution.ArchHs.Core (subsumeGHCVersion)
import Distribution.ArchHs.Exception
import Distribution.ArchHs.Internal.... | null | https://raw.githubusercontent.com/berberman/arch-hs/ae56e926c6a8d24b580a81b2a4d49cd01ec19b5a/diff/Main.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
# LANGUAGE RecordWildCards #
module Main (main) where
import Args
import Control.Monad (unless)
import qualified Data.Map as Map
import Diff
import Distribution.ArchHs.Core (subsumeGHCVersion)
import Distribution.ArchHs.Exception
import Distribution.ArchHs.Internal.Prelude
import Distribution.ArchHs.... |
2e81fa0e2cac4ba00b9775382f649bb184d687e4f54cfe846bdead7f6060a3c8 | DaMSL/K3 | Data.hs | {-|
A module defining basic data structures for the type manifestation process.
-}
module Language.K3.TypeSystem.Manifestation.Data
( BoundDictionary(..)
, BoundType(..)
, DelayedOperationTag(..) -- TODO: remove entirely?
, getBoundTypeName
, getBoundDefaultType
, getConcreteUVarBounds
, getConcreteQVarBounds
, get... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Manifestation/Data.hs | haskell | |
A module defining basic data structures for the type manifestation process.
TODO: remove entirely?
* Bound dictionaries
* Bound types
|A data type representing a bounding direction.
TODO: remove this structure?
|An enumeration identifying the delayed operations over groups of types which
are used during ma... |
module Language.K3.TypeSystem.Manifestation.Data
( BoundDictionary(..)
, BoundType(..)
, getBoundTypeName
, getBoundDefaultType
, getConcreteUVarBounds
, getConcreteQVarBounds
, getConcreteQVarQualifiers
, getQualifierOperation
, getDualBoundType
, getTyVarOp
) where
import qualified Data.Map as Map
import Data.Map ... |
8741591d664196efc9122fa08ac062875661adb36ddc02be1d5c97ec6b9a9857 | GaloisInc/semmc | Template.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE KindSignatures #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE UndecidableInstances #
module SemMC.Template (
RecoverOperandFn(..),
TemplatedOperandFn,
TemplatedOperand(..),
TemplatableOperand(..)
) where
import Data.Kind ( Type )
import ... | null | https://raw.githubusercontent.com/GaloisInc/semmc/4dc4439720b3b0de8812a68f8156dc89da76da57/semmc/src/SemMC/Template.hs | haskell | # LANGUAGE RankNTypes #
| A function that allows you to recover the concrete value of a templated
operand given a concrete evaluation function, typically provided as the model
given a symbolic expression builder and a mapping from machine location to
templated operand and a way to recover a concrete operand.
The ... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE KindSignatures #
# LANGUAGE UndecidableInstances #
module SemMC.Template (
RecoverOperandFn(..),
TemplatedOperandFn,
TemplatedOperand(..),
TemplatableOperand(..)
) where
import Data.Kind ( Type )
import Data.Parameterized.Cla... |
7d74abd35fec09d149941b12839ef27a6489366dd914b6a2a3fd80483659cc46 | mozilla/medusa | changesets_test.clj | (ns medusa.changesets-test
(:require [clojure.test :refer :all]
[clj.medusa.changesets :refer [bounding-buildids]]))
(deftest test-bounding-buildids
(testing "when there is only one buildid for the day"
(is (= (bounding-buildids "2017-08-02" "mozilla-central") ["20170802100302" "20170802100302"])))... | null | https://raw.githubusercontent.com/mozilla/medusa/213e712af2d7bb5580ba97d7770c1db140d457ee/test/medusa/changesets_test.clj | clojure | (ns medusa.changesets-test
(:require [clojure.test :refer :all]
[clj.medusa.changesets :refer [bounding-buildids]]))
(deftest test-bounding-buildids
(testing "when there is only one buildid for the day"
(is (= (bounding-buildids "2017-08-02" "mozilla-central") ["20170802100302" "20170802100302"])))... | |
557613e5d4603177d6e168d8838a521638b751aa071b1311e9801a129502d6b3 | roman/Haskell-Reactive-Extensions | ZipTest.hs | module Rx.Observable.ZipTest (tests) where
import Rx.Scheduler (newThread, schedule)
import qualified Rx.Observable as Rx
import Test.HUnit (assertEqual, assertFailure)
import Test.Hspec (Spec, describe, it)
tests :: Spec
tests =
describe "Rx.Observable.zipWith" $
it "is thread safe" $ do
let size = 1000... | null | https://raw.githubusercontent.com/roman/Haskell-Reactive-Extensions/0faddbb671be7f169eeadbe6163e8d0b2be229fb/rx-core/test/Rx/Observable/ZipTest.hs | haskell | module Rx.Observable.ZipTest (tests) where
import Rx.Scheduler (newThread, schedule)
import qualified Rx.Observable as Rx
import Test.HUnit (assertEqual, assertFailure)
import Test.Hspec (Spec, describe, it)
tests :: Spec
tests =
describe "Rx.Observable.zipWith" $
it "is thread safe" $ do
let size = 1000... | |
8b3b7857761d0b9cc190be3affdaa51888cc33f26562eac5e9f46c3f707a744d | prg-titech/baccaml | min_caml.ml | open MinCaml
open Jit
let output_file = ref None
let run_typ = ref `Emit
let jit_typ = ref `Not_specified
let need_interp_wo_hints = ref `No
let id x = x
let emit_interp_wo_hints p =
let open Asm in
let open Jit_elim_hints in
match !need_interp_wo_hints with
| `Yes ->
(match !jit_typ with
| `Not_speci... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/bin/min_caml.ml | ocaml | open MinCaml
open Jit
let output_file = ref None
let run_typ = ref `Emit
let jit_typ = ref `Not_specified
let need_interp_wo_hints = ref `No
let id x = x
let emit_interp_wo_hints p =
let open Asm in
let open Jit_elim_hints in
match !need_interp_wo_hints with
| `Yes ->
(match !jit_typ with
| `Not_speci... | |
2c186a25338584a1a4fe212e36c5e1d40240e38ce45a2a54fbd32600cb1687e2 | mirage/cowabloga | bootstrap.mli |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/cowabloga/2c256a92258f012c095bb72edcb639ad2fe164b3/lib/bootstrap.mli | ocaml |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
d794d459d3effadcb27f2ab484a1c44732e80edb0f24e9e42cb171b02b7a611e | replikativ/superv.async | build.clj | (ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[borkdude.gh-release-artifact :as gh]
[deps-deploy.deps-deploy :as dd])
(:import [clojure.lang ExceptionInfo]))
(def org "replikativ")
(def lib 'io.replikativ/superv.async)
(def current-commit (b/git-proc... | null | https://raw.githubusercontent.com/replikativ/superv.async/9d336c89ed286ec02698ebea722cdd009a9ea2ca/build.clj | clojure | (ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[borkdude.gh-release-artifact :as gh]
[deps-deploy.deps-deploy :as dd])
(:import [clojure.lang ExceptionInfo]))
(def org "replikativ")
(def lib 'io.replikativ/superv.async)
(def current-commit (b/git-proc... | |
2acbf973de498e626e38c8c1e986e7a54d4d2cccb1b79249cab8328a6f1cdeb5 | REMath/mit_16.399 | variables.mli | (* variables.mli *)
open Symbol_Table
type variable = Symbol_Table.variable
val number_of_variables : unit -> int
val for_all_variables : (variable -> 'a) -> unit
val print_variable : variable -> unit
val map_variables : (variable -> unit) -> (variable -> unit) -> unit
val string_of_variable : variable -> string
| null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Generic-FW-BW-REL-Abstract-Interpreter/variables.mli | ocaml | variables.mli | open Symbol_Table
type variable = Symbol_Table.variable
val number_of_variables : unit -> int
val for_all_variables : (variable -> 'a) -> unit
val print_variable : variable -> unit
val map_variables : (variable -> unit) -> (variable -> unit) -> unit
val string_of_variable : variable -> string
|
cc2d09f3892f395a99c3cc01c500af6108e04ee014d7c8e03705dd04f92e8d78 | soulomoon/SICP | Exercise4.27.scm | Exercise 4.27 : Suppose we type in the following definitions to the lazy evaluator :
; (define count 0)
( define ( i d x ) ( set ! count ( + count 1 ) ) x )
; Give the missing values in the following sequence of interactions, and explain your answers.242
; (define w (id (id 10)))
; ; ; L - Eval input :
; count... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter4/Exercise4.27.scm | scheme | (define count 0)
Give the missing values in the following sequence of interactions, and explain your answers.242
(define w (id (id 10)))
; ; L - Eval input :
count
; ; L - Eval value :
⟨response⟩
; ; L - Eval input :
w
; ; L - Eval value :
⟨response⟩
; ; L - Eval input :
count
; ; L - Eval value :
⟨respo... | Exercise 4.27 : Suppose we type in the following definitions to the lazy evaluator :
( define ( i d x ) ( set ! count ( + count 1 ) ) x )
(define count 0)
(define (id x) (set! count (+ count 1)) x)
L - Eval input :
count
L - Eval value :
1
L - Eval input :
w
L - Eval value :
10
L - Eval inpu... |
f4784b57b99f0ca565e27c1cb44699c1343fc1726a622064c574c50a519029a7 | OCamlPro/ez_api | ezReq_lwt.ml | (**************************************************************************)
(* *)
Copyright 2018 - 2022 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/request/unix/curl/multi/ezReq_lwt.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2018 - 2022 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
include EzCurl_multi
|
87556142582eaf3425b23d9b873097d67a3870129c2a86a81cbf7bbe70a439eb | JKTKops/ProtoHaskell | Panic.hs | module Control.Panic where
import Control.Exception
import System.Environment (getProgName)
import System.IO.Unsafe (unsafePerformIO)
import Paths_ProtoHaskell (version)
| These are exceptions that we will never catch . If one of these happens ,
-- the compiler is crashing.
data PhcException
= Panic String
... | null | https://raw.githubusercontent.com/JKTKops/ProtoHaskell/437c37d7bd6d862008f86d7e8045c7a60b12b532/src/Control/Panic.hs | haskell | the compiler is crashing. | module Control.Panic where
import Control.Exception
import System.Environment (getProgName)
import System.IO.Unsafe (unsafePerformIO)
import Paths_ProtoHaskell (version)
| These are exceptions that we will never catch . If one of these happens ,
data PhcException
= Panic String
| Sorry String
instance E... |
b31457f23ace48e788b2fc08f954aa6bfab411ffc83569a0c9cbc14cf1572a31 | hyperfiddle/electric | compiler4.cljc | (ns dustin.compiler4
(:require [minitest :refer [tests]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Normalize AST, implicit fmap, no bind, unify branches ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn normalize
"Expands an all points in a given form
`(normalize '{plu... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2021/compiler4.cljc | clojure |
Normalize AST, implicit fmap, no bind, unify branches ;;
fmap | (ns dustin.compiler4
(:require [minitest :refer [tests]]))
(defn normalize
"Expands an all points in a given form
`(normalize '{plus (lambda a b (+ a b))} '(plus 1 2))`
:= `(+ 1 2)`
"
([registry form]
(normalize registry form {}))
([registry form env]
(if (seq? form)
(let [[f & args] form]
... |
70e2d90d6654d3fa4c1a6d05d6d05105dfb66ca6a7f09e1b0e76ee3729548b13 | achirkin/vulkan | Parser.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE Strict #-}
module VkXml.Parser
( ... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/genvulkan/src/VkXml/Parser.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE Strict #
* Error reporing
| Location of parsing in the xml file
| A constraint to allow parsing with exception throwing
| Show a meaningful message with error location
if parsing xml file has failed.
|... | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module VkXml.Parser
( ParseLoc (..), defParseLoc
, VkXmlParseException (..)
, VkXmlParser
, runAttrParser
, parseWithLoc
, parseFailed
, await... |
ec35fb818ced7979b23e9bf28ef32d38d29afed1d7aa7fb916a975476f5cfd90 | lukeg101/lplzoo | Mu.hs | module Mu where
import Data.Map as M
import Data.Set as S
import Control.Monad (guard)
-- Mu, of the form C or 'T -> T' or a mix of both
data T
= TVar Char
| Bottom
| TArr T T
deriving (Eq, Ord)
--equivalence of types compares the binary trees of each type
--we leave strict propositional equality, that is ... | null | https://raw.githubusercontent.com/lukeg101/lplzoo/463ca93f22f018ee07bdc18d84b3b0c966d51766/Mu/Mu.hs | haskell | Mu, of the form C or 'T -> T' or a mix of both
equivalence of types compares the binary trees of each type
we leave strict propositional equality, that is A=A since this language
adheres to the proofs-as-programs paradigm
Simple show instance
variables are numbers as it's easier for renaming
Abstractions carry the ... | module Mu where
import Data.Map as M
import Data.Set as S
import Control.Monad (guard)
data T
= TVar Char
| Bottom
| TArr T T
deriving (Eq, Ord)
instance Show T where
show Bottom = "\x22a5"
show (TVar x) = x:""
show (TArr a b) = paren (isArr a) (show a) ++ "->" ++ show b
paren :: Bool -> Stri... |
5fb2b8ea457232c126c85c1b4e1c83e95ea49c948e87c04ba741912044a3eda6 | typelead/intellij-eta | Layout00004.hs | module Layout00004 where
f x = x
where start = SrcLoc {
srcFilename = parseFilename mode,
srcLine = 1
} | null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/test/resources/fixtures/eta/sources/Layout00004.hs | haskell | module Layout00004 where
f x = x
where start = SrcLoc {
srcFilename = parseFilename mode,
srcLine = 1
} | |
375897fc0ade9afc0c3f50545ae95ef6e5a1d6bdae37712fd4da571cbfb213a7 | xxyzz/SICP | Exercise_2_21.rkt | #lang racket/base
(define (square x) (* x x))
(define (square-list items)
(if (null? items)
null
(cons (square (car itmes)) (square-list (cdr itmes)))))
(define (square-list items)
(map square items))
(square-list (list 1 2 3 4))
; '(1 4 9 16)
| null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/2_Building_Abstractions_with_Data/2.2_Hierarchical_Data_and_the_Closure_Property/Exercise_2_21.rkt | racket | '(1 4 9 16) | #lang racket/base
(define (square x) (* x x))
(define (square-list items)
(if (null? items)
null
(cons (square (car itmes)) (square-list (cdr itmes)))))
(define (square-list items)
(map square items))
(square-list (list 1 2 3 4))
|
e432d560b4e9e2a88ee52e749ef03f99e8cf3f4c9edb0093d082136728d66620 | SoftwareFoundationGroupAtKyotoU/VeriCUDA | vctrans.ml |
# use " topfind " ; ;
# directory " /home / kozima/.opam/4.01.0 / lib / menhirLib " ; ;
# load " menhirLib.cmo " ; ;
# require " why3 " ; ;
# require " cil " ; ;
#use "topfind";;
#directory "/home/kozima/.opam/4.01.0/lib/menhirLib";;
#load "menhirLib.cmo";;
#require "why3";;
#require "cil";;
*)
o... | null | https://raw.githubusercontent.com/SoftwareFoundationGroupAtKyotoU/VeriCUDA/8c62058af5362cb1bd6c86121d9b8742e31706f2/vctrans.ml | ocaml | decompose only when there is no trigger
* ---------------- eliminating quantifiers
Try to find the value of [vs] if it is unique in [t].
* If the value is found, returns a pair [t'] and [Some s]
* where [s] is the value, and [t'] is [t(vs:=s)].
t1 - t2 = s * x + p (= 0)
* ==> x = -s * p
* ------... |
# use " topfind " ; ;
# directory " /home / kozima/.opam/4.01.0 / lib / menhirLib " ; ;
# load " menhirLib.cmo " ; ;
# require " why3 " ; ;
# require " cil " ; ;
#use "topfind";;
#directory "/home/kozima/.opam/4.01.0/lib/menhirLib";;
#load "menhirLib.cmo";;
#require "why3";;
#require "cil";;
*)
o... |
6090e8e7b29d6e71f4624e6813c38f6253085864808fd2d1ce0a9632559619c8 | nd/sicp | 4.36.scm | (define (a-pythagorean-triples low)
(let ((i (an-integer-starting-from low)))
(let ((j (an-integer-starting-from i)))
(let ((k (an-integer-between j (+ (* i i) (* j j)))))
(require (= (+ (* i i) (* j j)) (* k k)))
(list i j k)))))
| null | https://raw.githubusercontent.com/nd/sicp/d8587a0403d95af7c7bcf59b812f98c4f8550afd/ch04/4.36.scm | scheme | (define (a-pythagorean-triples low)
(let ((i (an-integer-starting-from low)))
(let ((j (an-integer-starting-from i)))
(let ((k (an-integer-between j (+ (* i i) (* j j)))))
(require (= (+ (* i i) (* j j)) (* k k)))
(list i j k)))))
| |
d73b22a86257a294ebac3774731c98b6fe21871669116ac07090d0910084f75d | dinosaure/dinoscheme | synthesis.mli | module Et: Map.S with type key = string
val eval: Type.schema Et.t -> Lambda.t -> Type.kind
| null | https://raw.githubusercontent.com/dinosaure/dinoscheme/6bc4f2f0376585f0900ab4bf8e049edd06fa3d74/dinc/synthesis.mli | ocaml | module Et: Map.S with type key = string
val eval: Type.schema Et.t -> Lambda.t -> Type.kind
| |
a74526c405f590f373e82a13c6058078fec0656bd8019bf69361ebe9dc9b5136 | uzh/guardian | article.ml | module Make (P : Guard.Persistence_s) = struct
module User = User.MakeActor (P)
(* pretend that all these fields aren't publically visible *)
type t =
{ mutable title : string
; mutable content : string
; mutable author : User.t
; uuid : Guardian.Uuid.Target.t
}
[@@deriving show]
type ki... | null | https://raw.githubusercontent.com/uzh/guardian/37d790f1c87270faf1ab23da7d62666e1a477d92/test/article.ml | ocaml | pretend that all these fields aren't publically visible | module Make (P : Guard.Persistence_s) = struct
module User = User.MakeActor (P)
type t =
{ mutable title : string
; mutable content : string
; mutable author : User.t
; uuid : Guardian.Uuid.Target.t
}
[@@deriving show]
type kind = [ `Article ]
let make ?id title content author =
let... |
abed7b986abf28237a0f97353449b17a12e51a0bd5341885a860d3f041428c2f | ItsMeijers/Lambdabox | Http.hs | # LANGUAGE OverloadedStrings , NamedFieldPuns #
module Binance.Internal.Trade.Http
( trade
, testTrade
, currentOpenOrders
, allOrders
, queryOrderOnId
, queryOrderOnClientId
, cancelOrderOnId
, cancelOrderOnClientId
) where
import Lambdabox.Box
import Binance.Internal.Trade.Types
... | null | https://raw.githubusercontent.com/ItsMeijers/Lambdabox/c19a8ae7d37b9f8ab5054d558fe788a5d4483092/src/Binance/Internal/Trade/Http.hs | haskell | TODO TEST ALL THIS FUNCTIONS CAREFULLY!!!!!
| Test trade is like a trade but the actual binance order does not get
send to the matching engine. The Binance Unit tag is needed due to the
with a typical haskel ()
| Prepares the trade for sending for both the trade and testTrade function.
record values ... | # LANGUAGE OverloadedStrings , NamedFieldPuns #
module Binance.Internal.Trade.Http
( trade
, testTrade
, currentOpenOrders
, allOrders
, queryOrderOnId
, queryOrderOnClientId
, cancelOrderOnId
, cancelOrderOnClientId
) where
import Lambdabox.Box
import Binance.Internal.Trade.Types
... |
317bbf2610ca10806ba0d0c85b07d01284e8c73de60da9dc7206ba8ec8d592f8 | 8l/asif | Syntax.hs | module Language.FOmega.Test.Syntax where
import Language.FOmega.Syntax
import Language.FOmega.Parse (parseExpr)
import Prelude hiding (pi)
import Test.Framework (testGroup)
import Test.Framework.Providers.HUnit
import Test.HUnit
import Control.Applicative
fromJust (Just x) = x
fromJust Nothing = error "fromJust: No... | null | https://raw.githubusercontent.com/8l/asif/3a0b0909e71a2e19e0773b3c77eadfa753751b41/tests/Language/FOmega/Test/Syntax.hs | haskell | module Language.FOmega.Test.Syntax where
import Language.FOmega.Syntax
import Language.FOmega.Parse (parseExpr)
import Prelude hiding (pi)
import Test.Framework (testGroup)
import Test.Framework.Providers.HUnit
import Test.HUnit
import Control.Applicative
fromJust (Just x) = x
fromJust Nothing = error "fromJust: No... | |
f4ae6c238bc49249e8ee6741d24169fcdd92676f7d41c6743179c0ba31ec5d76 | jackfirth/racket-expect | check.rkt | #lang racket/base
(require arguments
expect
(submod "base.rkt" for-sugar))
(define (rx-or-pred->exp p)
(if (regexp? p)
(expect-struct exn [exn-message (expect-regexp-match p)])
(expect-pred p)))
(define-expect-checks
[(check-eq? a b) a (expect-eq? b)]
[(check-eqv? a b) a (expect-e... | null | https://raw.githubusercontent.com/jackfirth/racket-expect/9530df30537ae05400b6a3add9619e5f697dca52/private/rackunit/check.rkt | racket | #lang racket/base
(require arguments
expect
(submod "base.rkt" for-sugar))
(define (rx-or-pred->exp p)
(if (regexp? p)
(expect-struct exn [exn-message (expect-regexp-match p)])
(expect-pred p)))
(define-expect-checks
[(check-eq? a b) a (expect-eq? b)]
[(check-eqv? a b) a (expect-e... | |
5c07b78ba153c9fcb292bf3b68f1584c0e03edf3c9ab738213e7d29a426569d0 | ailisp/Graphic-Forms | graphics-classes.lisp | (in-package :graphic-forms.uitoolkit.graphics)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defstruct color
(red 0)
(green 0)
(blue 0))
(defstruct font-data
(char-set 0)
(face-name "")
(point-size 10)
(style nil))
(defstruct font-metrics
(ascent 0)
... | null | https://raw.githubusercontent.com/ailisp/Graphic-Forms/1e0723d07e1e4e02b8ae375db8f3d65d1b444f11/src/uitoolkit/graphics/graphics-classes.lisp | lisp | (in-package :graphic-forms.uitoolkit.graphics)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defstruct color
(red 0)
(green 0)
(blue 0))
(defstruct font-data
(char-set 0)
(face-name "")
(point-size 10)
(style nil))
(defstruct font-metrics
(ascent 0)
... | |
4d7bef66f447eeb9cbddcc96423a07a6f2674601e9b9673080e1f5fdfe3293b2 | janestreet/accessor_base | int_tests.ml | open! Core
open! Import
let%test_unit "negated" =
Accessor_test_helpers.isomorphism
(module Int)
(module Int)
(module Unit)
(fun () -> Accessor.Int.negated)
;;
let%test_unit "added" =
Accessor_test_helpers.isomorphism
(module Int)
(module Int)
(module Int)
Accessor.Int.added
;;
le... | null | https://raw.githubusercontent.com/janestreet/accessor_base/8384c29a37e557168ae8a43b2a5a531f0ffc16e4/test/fast/int_tests.ml | ocaml | open! Core
open! Import
let%test_unit "negated" =
Accessor_test_helpers.isomorphism
(module Int)
(module Int)
(module Unit)
(fun () -> Accessor.Int.negated)
;;
let%test_unit "added" =
Accessor_test_helpers.isomorphism
(module Int)
(module Int)
(module Int)
Accessor.Int.added
;;
le... | |
4d18c9acef5ec6fe45bbee3c4e86cef838615eaa5c4ca43d1eca36ef5a64c3e8 | richmit/mjrcalc | use-dft.lisp | ;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;; @file use-dft.lisp
@author < >
@brief DFT and ... | null | https://raw.githubusercontent.com/richmit/mjrcalc/96f66d030034754e7d3421688ff201f4f1db4833/use-dft.lisp | lisp | -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
@file use-dft.lisp
@std Common Lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
and/or other materials provided w... | @author < >
@brief DFT and inverse DFT.@EOL
@parblock
Copyright ( c ) 1996,1997,2008,2010,2013,2015 , < > All rights reserved .
1 . Redistributions of source code must retain the above copyright notice , this list of conditions , and the following disclaimer .
2 . Redistributions in b... |
c2962ad12266601276373e16b52e8440af9cfb4cd01042ff20534eb9198e6c25 | bnoordhuis/chicken-core | scrutiny-tests.scm | ;;;; scrutiny-tests.scm
(define (a)
(define (b)
(define (c)
(let ((x (+ 3 4)))
(if x 1 2))))) ; expected boolean but got number in conditional
(define (foo x)
(if x ; branches return differing number of results
(values 1 2)
(values 1 2 (+ (+ (+ (+ 3)))))))
(let ((bar +))
(bar 3 'a... | null | https://raw.githubusercontent.com/bnoordhuis/chicken-core/56d30e3be095b6abe1bddcfe10505fa726a43bb5/tests/scrutiny-tests.scm | scheme | scrutiny-tests.scm
expected boolean but got number in conditional
branches return differing number of results
expected number, got symbol
expected procedure, got fixnum
this should *not* signal a warning:
same case, but nested
should not warn (local)
should not warn (self-call)
not in tail position
should wa... |
(define (a)
(define (b)
(define (c)
(let ((x (+ 3 4)))
(define (foo x)
(values 1 2)
(values 1 2 (+ (+ (+ (+ 3)))))))
(let ((bar +))
expected 1 argument , got 0
expected 1 result , got 2
expected 1 result , got 0
(let ((x 100))
expected 2 numbers , but got symbols
33 does not m... |
d1f62be3ddaf49cf779c8075c2809cdfc4d3d7f08a2cb576dbdefa3e689fb942 | nextjournal/viewers | expo.clj | (ns nextjournal.view.expo
(:require [clojure.java.io :as io]
[clojure.string :as str]))
(defmacro view-source [name]
(let [lines (-> "nextjournal/view/expo.cljs"
io/resource
slurp
(str/split #"\n"))]
`[nextjournal.viewer/inspect
{:nextjour... | null | https://raw.githubusercontent.com/nextjournal/viewers/1a8e3300601780dccb18d5548f7d35b31b7934f9/modules/view/src/nextjournal/view/expo.clj | clojure | (ns nextjournal.view.expo
(:require [clojure.java.io :as io]
[clojure.string :as str]))
(defmacro view-source [name]
(let [lines (-> "nextjournal/view/expo.cljs"
io/resource
slurp
(str/split #"\n"))]
`[nextjournal.viewer/inspect
{:nextjour... | |
7221eefefd43b69992c11acbb2c888ee5bb41621141c7a75dc5227216ff2ac9c | wilkerlucio/js-data-interop | js_proxy_test.cljs | (ns com.wsscode.js-interop.js-proxy-test
(:require
[clojure.test :refer [deftest is are run-tests testing]]
[com.wsscode.js-interop.js-proxy :as jsp]
[goog.object :as gobj]))
(defn js= [a b]
(= (js/JSON.stringify a)
(js/JSON.stringify b)))
(deftest map-proxy-test
(testing "get"
(is (= (gobj... | null | https://raw.githubusercontent.com/wilkerlucio/js-data-interop/92632c4d8de8ab648e4fe2cf367ebc2193239739/test/com/wsscode/js_interop/js_proxy_test.cljs | clojure | only keyword keys are accessible, numbers are not | (ns com.wsscode.js-interop.js-proxy-test
(:require
[clojure.test :refer [deftest is are run-tests testing]]
[com.wsscode.js-interop.js-proxy :as jsp]
[goog.object :as gobj]))
(defn js= [a b]
(= (js/JSON.stringify a)
(js/JSON.stringify b)))
(deftest map-proxy-test
(testing "get"
(is (= (gobj... |
3a28886dafbd3b950c21ed0b68d217d8b7c0018d8cc97fb9c5a85da66dfb1c28 | WormBase/wormbase_rest | core.clj | (ns rest-api.classes.variation.core
(:require
[clojure.string :as str]
[pseudoace.utils :as pace-utils]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(def ^{:private true} molecular-change-effects
{:molecular-change/missense "Missense"
:molecular-change/nonsense "Nonsense"
:molecular-chan... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/b18dde4771f4e24f140b78f5a173c153688d6921/src/rest_api/classes/variation/core.clj | clojure | (ns rest-api.classes.variation.core
(:require
[clojure.string :as str]
[pseudoace.utils :as pace-utils]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(def ^{:private true} molecular-change-effects
{:molecular-change/missense "Missense"
:molecular-change/nonsense "Nonsense"
:molecular-chan... | |
627e661e4d2b9f1d13aac238ea52e791b4d519a846484db26d9baebc6344404f | kennyjwilli/s3-mvn-upload | build.clj | (ns build
"sorted-multiset's build script.
clojure -T:build ci
clojure -T:build deploy
Run tests via:
clojure -X:test
For more information, run:
clojure -A:deps -T:build help/doc"
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def... | null | https://raw.githubusercontent.com/kennyjwilli/s3-mvn-upload/d5ae45a69b205a5d6a38fb1641756203b7e00c17/build.clj | clojure | (ns build
"sorted-multiset's build script.
clojure -T:build ci
clojure -T:build deploy
Run tests via:
clojure -X:test
For more information, run:
clojure -A:deps -T:build help/doc"
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def... | |
04bf13592f9408f786f8e61cb39f19fa7c9f16a18bd5de5166e81686d11e2d47 | gersh/erlang-rtmp | rtmp_socket.erl | @author < > [ ]
2009
%%% @doc RTMP socket module.
%%% Designed to look like rtmp mode of usual TCP socket. If you have used {packet, http}, you will
%%% find many common behaviours.
%%%
%%% When working on server side, you should accept Socket::port() with:
%%% <pre><code>
%%% {ok, RTMP} = rtm... | null | https://raw.githubusercontent.com/gersh/erlang-rtmp/57157fb3be20278af19c87232f99aa9a83041d18/src/rtmp_socket.erl | erlang | @doc RTMP socket module.
Designed to look like rtmp mode of usual TCP socket. If you have used {packet, http}, you will
find many common behaviours.
When working on server side, you should accept Socket::port() with:
<pre><code>
{ok, RTMP} = rtmp_socket:accept(Socket).
receive
rtmp_socket:setopts(R... | @author < > [ ]
2009
{ rtmp , RTMP , connected } - >
{ rtmp , RTMP , disconnect , Statistics } - >
{ rtmp , RTMP , # rtmp_message { } = Message } - >
to crash whole your server with OOM killer .
Copyright ( c ) 2009
in the Software without restriction , including without limita... |
65cc13d81e580073d8ada87e3cb7cc22ed73cdf9f2d37114abb784abb0ce69f4 | 8c6794b6/haskell-sc-scratch | SerializeExt.hs | # LANGUAGE NoMonomorphismRestriction #
------------------------------------------------------------------------------
-- |
-- Module : $Header$
CopyRight : ( c ) 8c6794b6
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : non-portable
--
-- Lecture: <-final/course/SerializeExt.... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Oleg/TTF/SerializeExt.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : non-portable
Lecture: <-final/course/SerializeExt.hs>
| # LANGUAGE NoMonomorphismRestriction #
CopyRight : ( c ) 8c6794b6
Maintainer :
module SerializeExt where
import Intro2
import ExtF
import Serialize (Tree(..))
import qualified Serialize as S
instance MulSYM Tree where
mul e1 e2 = Node "Mul" [e1,e2]
tfm1_tree = S.toTree tfm1
tfm2_tree = S.toTree tfm2
fro... |
b5c05fb7a5aae88f5301a945d351241405ef39f882784c036db7eb652d0e9431 | achirkin/vulkan | VK_AMD_draw_indirect_count.hs | # OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_HADDOCK not - home #
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LA... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_AMD_draw_indirect_count.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE MagicHash #
# LANGUAGE PatternSynonyms #
# LANGUAGE Strict #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
|
supported: @vulkan@
contact: @Daniel Rakos @dra... | # OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_HADDOCK not - home #
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
module Graphics.Vulkan.Ext.VK_AMD_draw_indirect_count
* Vulkan extension : @VK_AMD_draw_indirect_count@
author :
VkCmdDrawIndirectCountAMD, pattern VkCmdDrawIndi... |
58caa9311b8c9d76018a9f1d916761959bf0d0b60470c492b4b02de22a40bf5b | input-output-hk/cardano-prelude | Canonical.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NumDecimals #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-prelude/94b37483937cfb7c07d69a708c950a090bb9670f/cardano-prelude/src/Cardano/Prelude/Json/Canonical.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
| For backwards compatibility we convert this to microseconds | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NumDecimals #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
| Instances used in the canonical JSON encoding of ` GenesisD... |
d12217ae35c3581fd31675108229e358653a1214e27d0dbe5760b18bac65c28d | yurtsiv/mooncake | Eval.hs | module Interpreter.Eval where
import Data.Char (ord)
import qualified Data.Map.Strict as Map
import Interpreter.Utils
import Interpreter.Types
import qualified Parser.AST as AST
startEvaluation :: AST.Expression -> Either String Result
startEvaluation expr = do
(res, _) <- evaluate expr Map.empty
return res
eva... | null | https://raw.githubusercontent.com/yurtsiv/mooncake/5527188d4f9430178d1438d41ac09883c11d0bbc/src/Interpreter/Eval.hs | haskell | TODO: compare all primitive types | module Interpreter.Eval where
import Data.Char (ord)
import qualified Data.Map.Strict as Map
import Interpreter.Utils
import Interpreter.Types
import qualified Parser.AST as AST
startEvaluation :: AST.Expression -> Either String Result
startEvaluation expr = do
(res, _) <- evaluate expr Map.empty
return res
eva... |
3c15e72813849a9b82e80d8ae21571c97a636083022f385043aa877bcac0ba75 | KingMob/TrueGrit | retry.clj | (ns net.modulolotus.truegrit.retry
"Implements retries, which call a fn again when it fails (up to a limit).
See "
(:require [clojure.tools.logging.readable :as log]
[net.modulolotus.truegrit.util :as util])
(:import (io.github.resilience4j.retry Retry RetryConfig)))
(def ^:dynamic *default-confi... | null | https://raw.githubusercontent.com/KingMob/TrueGrit/e852f417899eb876c3b3200fac27ecee1975c50f/src/net/modulolotus/truegrit/retry.clj | clojure | wait-duration and interval-function conflict
By placing interval-function after wait-duration, it has precedence
Do not try this with cond-> because onEvent returns null | (ns net.modulolotus.truegrit.retry
"Implements retries, which call a fn again when it fails (up to a limit).
See "
(:require [clojure.tools.logging.readable :as log]
[net.modulolotus.truegrit.util :as util])
(:import (io.github.resilience4j.retry Retry RetryConfig)))
(def ^:dynamic *default-confi... |
ec31d42fcb5a8be4d8526d926579ecd80525d0555fe0933c526bceee239436cd | ZHaskell/stdio | SystemTimer.hs | module Main where
import Control.Concurrent.STM
import Control.Concurrent
import Control.Monad
import GHC.Event
main :: IO ()
main = do
r <- newTVarIO 0 :: IO (TVar Int)
tm <- getSystemTimerManager
replicateM 100000 . forkIO $ do
forM_ [1..10] $ \ i -> do
registerTimeout tm (i*10000... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/bench/timers/SystemTimer.hs | haskell | module Main where
import Control.Concurrent.STM
import Control.Concurrent
import Control.Monad
import GHC.Event
main :: IO ()
main = do
r <- newTVarIO 0 :: IO (TVar Int)
tm <- getSystemTimerManager
replicateM 100000 . forkIO $ do
forM_ [1..10] $ \ i -> do
registerTimeout tm (i*10000... | |
012b11360210403c718238ec4a04cd0adb9122dbe969bda5db0795975d645a7e | cedlemo/OCaml-GI-ctypes-bindings-generator | Recent_sort_type.mli | open Ctypes
type t = None | Mru | Lru | Custom
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Recent_sort_type.mli | ocaml | open Ctypes
type t = None | Mru | Lru | Custom
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| |
d7d0b0ebcad7dba31cd56cfc3ec2f64d636ac453554977fd424ce2090e3896de | fossas/fossa-cli | GopkgLock.hs | # LANGUAGE RecordWildCards #
module Strategy.Go.GopkgLock (
analyze',
GoLock (..),
Project (..),
buildGraph,
golockCodec,
) where
import Control.Effect.Diagnostics
import Data.Foldable (traverse_)
import Data.Functor (void)
import Data.Text (Text)
import DepTypes
import Diag.Common (
MissingDeepDeps (Miss... | null | https://raw.githubusercontent.com/fossas/fossa-cli/b55bf16db5ffdbad15d40b84e8f1a47c90047e9c/src/Strategy/Go/GopkgLock.hs | haskell | label location when it exists | # LANGUAGE RecordWildCards #
module Strategy.Go.GopkgLock (
analyze',
GoLock (..),
Project (..),
buildGraph,
golockCodec,
) where
import Control.Effect.Diagnostics
import Data.Foldable (traverse_)
import Data.Functor (void)
import Data.Text (Text)
import DepTypes
import Diag.Common (
MissingDeepDeps (Miss... |
8eaeea920d7b0ceb803edb5cd92b40eb61718d545977775f4055a536f89b12bf | argp/bap | nonnegative.mli | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
(* ... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocamlgraph/src/nonnegative.mli | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
open Sig... |
a5ab8712df78b90187e0d1e11687125ac485658f505dba116172738e0a980b90 | j-mie6/ParsleyHaskell | Test.hs | # LANGUAGE TemplateHaskell , UnboxedTuples , ScopedTypeVariables #
module Parsley.Char.Test where
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
import qualified Parsley.Char.Parsers as Parsers
import Prelude hiding ((*>))
import Parsley ((*>))
import Parsley.Char (char, item)
tests :: TestTree
tests = te... | null | https://raw.githubusercontent.com/j-mie6/ParsleyHaskell/045ab78ed7af0cbb52cf8b42b6aeef5dd7f91ab2/parsley/test/Parsley/Char/Test.hs | haskell | # LANGUAGE TemplateHaskell , UnboxedTuples , ScopedTypeVariables #
module Parsley.Char.Test where
import Test.Tasty
import Test.Tasty.HUnit
import TestUtils
import qualified Parsley.Char.Parsers as Parsers
import Prelude hiding ((*>))
import Parsley ((*>))
import Parsley.Char (char, item)
tests :: TestTree
tests = te... | |
b2f5906c9116b313b0cb5c3cf6cc10da51f4900a03a1f06716edb5081e534c5c | jepsen-io/jepsen | txn.clj | (ns tidb.txn
"Client for transactional workloads."
(:require [clojure.tools.logging :refer [info]]
[jepsen [client :as client]
[generator :as gen]]
[tidb.sql :as c :refer :all]))
(defn table-name
"Takes an integer and constructs a table name."
[i]
(str "txn" i))
(... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/a75d5a50dd5fa8d639a622c124bf61253460b754/tidb/src/tidb/txn.clj | clojure | use-txn? false] | (ns tidb.txn
"Client for transactional workloads."
(:require [clojure.tools.logging :refer [info]]
[jepsen [client :as client]
[generator :as gen]]
[tidb.sql :as c :refer :all]))
(defn table-name
"Takes an integer and constructs a table name."
[i]
(str "txn" i))
(... |
ba66bc446611f7db96b093e5b539b9b905bc1901a46fccdff2e80e43aaec1f33 | well-typed-lightbulbs/ocaml-esp32 | ranged_intf.ml | module type S = sig
module Endpoint : Range_intf.Endpoint_intf
module Range : Range_intf.S with type Endpoint.t = Endpoint.t
end
| null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/typing-misc/ranged_intf.ml | ocaml | module type S = sig
module Endpoint : Range_intf.Endpoint_intf
module Range : Range_intf.S with type Endpoint.t = Endpoint.t
end
| |
8a0b1be2600b048a6d4876491628a2b42f6b7d7e39a99ef49e97bcc393005a8c | mfoemmel/erlang-otp | snmpa_mib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/snmp/src/agent/snmpa_mib.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(snmpa_mib).
This module impleme... |
79d4d7532b0d0d263ff11a961c7ba4e463ee2eb01bb8fb783c4009b512cace27 | DSTOQ/haskell-stellar-sdk | ParserSpec.hs | module Stellar.Core.Key.ParserSpec where
import qualified Data.Text as T
import Hedgehog.Extended
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Protolude
import Stellar.Core.Types.Key
import Stellar.Gens
run... | null | https://raw.githubusercontent.com/DSTOQ/haskell-stellar-sdk/82a76c2f951a2aaabdc38092fdc89044b278c53d/tests/test/Stellar/Core/Key/ParserSpec.hs | haskell | module Stellar.Core.Key.ParserSpec where
import qualified Data.Text as T
import Hedgehog.Extended
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Protolude
import Stellar.Core.Types.Key
import Stellar.Gens
run... | |
3884a835e2520abec528ac2ea72a1d53d784463cf2eec981e532ca7247b5044b | ygrek/mldonkey | tests.ml |
open Printf
let pr fmt = ksprintf print_endline fmt
let test ?n ?s f =
try
f ()
with
exn ->
let msg = match s,n with
| Some s, Some n -> sprintf " %d %S" n s
| Some s, None -> sprintf " %S" s
| None, Some n -> sprintf " %d" n
| None, None -> ""
in
pr "Test%s fai... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/tools/tests.ml | ocaml | let _ = Ip.addr_of_string "dchub" in |
open Printf
let pr fmt = ksprintf print_endline fmt
let test ?n ?s f =
try
f ()
with
exn ->
let msg = match s,n with
| Some s, Some n -> sprintf " %d %S" n s
| Some s, None -> sprintf " %S" s
| None, Some n -> sprintf " %d" n
| None, None -> ""
in
pr "Test%s fai... |
720a45f6c96495845a16fbc535ddedbde3b9d041daddc3179ed3c9d3220b728a | hjwylde/werewolf | Quit.hs | |
Module : Werewolf . Command . Quit
Description : Handler for the quit subcommand .
Copyright : ( c ) , 2016
License : :
Handler for the quit subcommand .
Module : Werewolf.Command.Quit
Description : Handler for the quit subcommand.
Copyright : (c) Henry J. Wylde, 2016
Lice... | null | https://raw.githubusercontent.com/hjwylde/werewolf/d22a941120a282127fc3e2db52e7c86b5d238344/app/Werewolf/Command/Quit.hs | haskell | * Handle | |
Module : Werewolf . Command . Quit
Description : Handler for the quit subcommand .
Copyright : ( c ) , 2016
License : :
Handler for the quit subcommand .
Module : Werewolf.Command.Quit
Description : Handler for the quit subcommand.
Copyright : (c) Henry J. Wylde, 2016
Lice... |
710af026911c80e7c35b1949687715d4780f28ff9887748e0b892fe6a9c5a0ed | uw-unsat/jitsynth | tostr.rkt | #lang rosette
(require "../common/case-hex.rkt")
(require "../common/instructions.rkt")
(require (only-in "../common/debug.rkt" [debugln common:debugln]))
(provide tostr-instr)
(provide tostr-instrs)
(define DEBUG #f)
(define (debugln x)
(if DEBUG (common:debugln x) void))
(define (tostr-func func3 func7)
(cas... | null | https://raw.githubusercontent.com/uw-unsat/jitsynth/69529e18d4a8d4dace884bfde91aa26b549523fa/riscv/tostr.rkt | racket | NOTE: The result is sign extended always
assume this is 0 | #lang rosette
(require "../common/case-hex.rkt")
(require "../common/instructions.rkt")
(require (only-in "../common/debug.rkt" [debugln common:debugln]))
(provide tostr-instr)
(provide tostr-instrs)
(define DEBUG #f)
(define (debugln x)
(if DEBUG (common:debugln x) void))
(define (tostr-func func3 func7)
(cas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.