_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 |
|---|---|---|---|---|---|---|---|---|
ab36788dcc58cdf11434a24f5f99135a88ebf70e65193ba5cb9df93241bd6fbd | bmeurer/ocamljit2 | tata.mli | (* a comment *)
val tata : string
| null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/ocamlbuild/test/test2/tata.mli | ocaml | a comment | val tata : string
|
0baa009cef6f694ecc6aecffd721a73b79ad5e12dabd6e9f9d2b899b0da6cdb7 | rasheedja/PropaFP | Smt.hs | # LANGUAGE TupleSections #
# LANGUAGE LambdaCase #
# LANGUAGE LambdaCase #
module PropaFP.Parsers.Smt where
import MixedTypesNumPrelude hiding (unzip)
import qualified Prelude as P
import System.IO.Unsafe
import PropaFP.Expression
import qualified PropaFP.Parsers.Lisp.Parser as LP
import qualified PropaFP.Parsers.Li... | null | https://raw.githubusercontent.com/rasheedja/PropaFP/c7680a48c9524768ac113ab5ca0e179dc2f315c6/src/PropaFP/Parsers/Smt.hs | haskell | |Find assertions in a parsed expression
Assertions are Application types with the operator being a Variable equal to "assert"
Assertions only have one 'operands'
findAssertions ((LD.Application (LD.Variable var) [operands]) : expressions) = operands : findAssertions expressions
|Find function declarations in a par... | # LANGUAGE TupleSections #
# LANGUAGE LambdaCase #
# LANGUAGE LambdaCase #
module PropaFP.Parsers.Smt where
import MixedTypesNumPrelude hiding (unzip)
import qualified Prelude as P
import System.IO.Unsafe
import PropaFP.Expression
import qualified PropaFP.Parsers.Lisp.Parser as LP
import qualified PropaFP.Parsers.Li... |
cfacc590687acda44b3a320f9c197c5a8506ce121a911ec2791030ba178b9e76 | arrdem/oxcart | hello.clj | (ns test.hello)
(defn -main []
(. (. System out)
(println "Hello, World!"))
(. System (exit (int 0))))
| null | https://raw.githubusercontent.com/arrdem/oxcart/38c3247dabe904b3c067385a7d64c5f4f65ccc09/src/bench/clojure/test/hello.clj | clojure | (ns test.hello)
(defn -main []
(. (. System out)
(println "Hello, World!"))
(. System (exit (int 0))))
| |
41eec8a6b1463f00b69a41813ecef5b20f184286344f41f7f76332cc44c4f118 | Opetushallitus/ataru | harkinnanvaraisuus_filter_spec.clj | (ns ataru.applications.harkinnanvaraisuus.harkinnanvaraisuus-filter-spec
(:require [speclj.core :refer [it describe tags should=]]
[ataru.applications.harkinnanvaraisuus.harkinnanvaraisuus-filter :as hf]))
(def harkinnanvaraisuus-only-filters
{:filters {:harkinnanvaraisuus {:only-harkinnanvaraiset true... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/88addd3a5604564ac4d636f4f0321f465ce0a5b7/spec/ataru/applications/harkinnanvaraisuus/harkinnanvaraisuus_filter_spec.clj | clojure | (ns ataru.applications.harkinnanvaraisuus.harkinnanvaraisuus-filter-spec
(:require [speclj.core :refer [it describe tags should=]]
[ataru.applications.harkinnanvaraisuus.harkinnanvaraisuus-filter :as hf]))
(def harkinnanvaraisuus-only-filters
{:filters {:harkinnanvaraisuus {:only-harkinnanvaraiset true... | |
0558abaa2f6f3faf7741f7db7607bb9ce9288d9c7ffda8f4866a2115509856a5 | microsoft/SLAyer | Graph.ml | Copyright ( c ) Microsoft Corporation . All rights reserved .
(** Mutable edge- and vertex-labelled multi-graphs *)
open Library
module L = (val Log.std Config.vGraph : Log.LOG)
(*============================================================================
Graph
==========... | null | https://raw.githubusercontent.com/microsoft/SLAyer/6f46f6999c18f415bc368b43b5ba3eb54f0b1c04/src/Graph.ml | ocaml | * Mutable edge- and vertex-labelled multi-graphs
============================================================================
Graph
============================================================================
vertices of graphs are represented by pairs of an index and a
la... | Copyright ( c ) Microsoft Corporation . All rights reserved .
open Library
module L = (val Log.std Config.vGraph : Log.LOG)
include Graph_sig
module Make
(Index: sig
type t
val compare: t -> t -> int
val equal: t -> t -> bool
val hash: t -> int
val fmt : t formatter
end)
(Ver... |
e648d140faaab3a966c0674a4771c287459d7252a0ba7c4d7531d6448eaf4f99 | periodic/HilbertRTree | Internal.hs | module Data.HRTree.Internal where
import Data.HRTree.Geometry
import Data.HRTree.Hilbert
import Data.Word
import qualified Data.List as L (insert, unfoldr)
-- | Capacity constants. TODO: Make these tunable.
nodeCapacity = 4
leafCapacity = 4
splitOrder = 1
-- | Type alias for the type we're going to use as a key.
ty... | null | https://raw.githubusercontent.com/periodic/HilbertRTree/a90ef17578a201153bd13a41582184808cc1947a/Data/HRTree/Internal.hs | haskell | | Capacity constants. TODO: Make these tunable.
| Type alias for the type we're going to use as a key.
| Individual records of an internal node.
Instances for the node-records.
| Individual records of a leaf node.
Instances for leaf-records
| The RTree type, which is really just a node, either an internal node ... | module Data.HRTree.Internal where
import Data.HRTree.Geometry
import Data.HRTree.Hilbert
import Data.Word
import qualified Data.List as L (insert, unfoldr)
nodeCapacity = 4
leafCapacity = 4
splitOrder = 1
type Key = Word32
data (SpatiallyBounded a) => NodeRecord a =
NR { nrMbr :: BoundingBox
, nrKey ... |
d12e26bac645423dbbcd23732c48c4b09d247ef5d87d5dfa5b31ba8a25e274f5 | kelamg/HtDP2e-workthrough | ex349.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex349) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Intertwined-Data/ex349.rkt | racket | about the language level of this file in a form that our tools can easily process.
An Atom is one of:
– Number
– String
– Symbol
– '()
Any -> Boolean
produces true if x is of atomic
S-expr -> BSL-expr
S-expr -> BSL-expr
Atom -> BSL-expr | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex349) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define-struct add (left right))
(define-struct mul (l... |
006b8e52595df4d333a60c289ada34f8e0b546809154bc0ebd00a4748846a250 | herd/herdtools7 | channel_test.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/internal/lib/tests/channel_test.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
15d305b3901c98bb9072e214a0c7e6ac229dfa6f13eb72cb8c2e1d68c6d8a51e | basho/sidejob | sidejob_resource_stats.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may ob... | null | https://raw.githubusercontent.com/basho/sidejob/1c377578c0956e91ebbb98a798c5d4b6d0959c99/src/sidejob_resource_stats.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(... |
e4ceae113c5cd81243285e9b555c6cc06f8c3938ce42763289cd32af60760b8c | ghcjs/jsaddle-dom | OESVertexArrayObject.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.OESVertexArrayObject
(createVertexArrayOES, createVertexArrayOES_, deleteVertexArrayOES,
isVertexArrayOES, ... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/OESVertexArrayObject.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.OESVertexArrayObject
(createVertexArrayOES, createVertexArrayOES_, deleteVertexArrayOES,
isVertexArrayOES, isVertexArrayOES_, bindVertexArrayOES,
pattern VERTEX_ARRAY_BINDING_OES, OESVertexArrayObje... |
28121c8654d36abb6ee72c77220e0de211aeda71d5384bbe50acecb8fda3dc8b | sru-systems/protobuf-simple | WireTag.hs | -- |
Module : Data . ProtoBuf . WireTag
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
--
WireTag type and functions .
module Data.ProtoBuf.WireTag
( WireTag(..)
, fromWireTag
, toWireTag
) where
import Data.Bits ((.|.))
import Data.ProtoBuf.FieldNumb... | null | https://raw.githubusercontent.com/sru-systems/protobuf-simple/8d19dfc68466c1ce69e9d3af6e75df16fffd32cc/src/Data/ProtoBuf/WireTag.hs | haskell | |
| Type to represent a wire tag. | Module : Data . ProtoBuf . WireTag
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
WireTag type and functions .
module Data.ProtoBuf.WireTag
( WireTag(..)
, fromWireTag
, toWireTag
) where
import Data.Bits ((.|.))
import Data.ProtoBuf.FieldNumber (from... |
1ad1af84e03138e7e8798800ab46700d666f376692846a831daffaf67388994f | lolepezy/rpki-prover | TestTypes.hs | module RPKI.TestTypes where
import RPKI.Config
testConfig :: Config
testConfig = defaultConfig | null | https://raw.githubusercontent.com/lolepezy/rpki-prover/17b4381a57eee3772ea1299cf387562f2e5ad477/test/src/RPKI/TestTypes.hs | haskell | module RPKI.TestTypes where
import RPKI.Config
testConfig :: Config
testConfig = defaultConfig | |
61f4a60bed17b467d6af3cc76fb2bd2c8d6523e2371a08721a7370fff6f37dbb | xnning/haskell-programming-from-first-principles | Addition.hs | module Addition where
import Test.Hspec
import Test.QuickCheck
prop_additionGreater :: Int -> Bool
prop_additionGreater x = x + 1 > x
runQc :: IO ()
runQc = quickCheck prop_additionGreater
main :: IO ()
main = hspec $ do
describe "Addition" $ do
it "1 + 1 is greater than 1" $ do
property $ \x -> x + 1 >... | null | https://raw.githubusercontent.com/xnning/haskell-programming-from-first-principles/0c49f799cfb6bf2dc05fa1265af3887b795dc5a0/projs/test/Addition.hs | haskell | module Addition where
import Test.Hspec
import Test.QuickCheck
prop_additionGreater :: Int -> Bool
prop_additionGreater x = x + 1 > x
runQc :: IO ()
runQc = quickCheck prop_additionGreater
main :: IO ()
main = hspec $ do
describe "Addition" $ do
it "1 + 1 is greater than 1" $ do
property $ \x -> x + 1 >... | |
89c628b6f1fbf31f16f9a75c75dbce913169b76351ead239a00931800b15f7f3 | BekaValentine/SimpleFP-v2 | Evaluation.hs | {-# OPTIONS -Wall #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
-- | This module defines how to evaluate terms in the dependently typed lambda
-- calculus.
module Quasiquote.Core.Evaluation where
import Control.Monad.Excep... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Quasiquote/Core/Evaluation.hs | haskell | # OPTIONS -Wall #
# LANGUAGE TypeSynonymInstances #
| This module defines how to evaluate terms in the dependently typed lambda
calculus.
| Because a case expression can be evaluated under a binder, it's necessary
to determine when a match failure is real or illusory. For example, if we
more than just did the matc... | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Quasiquote.Core.Evaluation where
import Control.Monad.Except
import Utils.ABT
import Utils.Env
import Utils.Eval
import Utils.Names
import Utils.Pretty
import Utils.Telescope
import Quasiquote.Core.Term
... |
09eda807dacdae326675998cf0b78a44646a5a5d040bf0721e3c9aed4a7d2da0 | oakes/edna | core.clj | (ns edna.core
(:require [alda.lisp]
[alda.sound :as sound]
[edna.parse :as parse]
[clojure.string :as str]
[alda.lisp.score :as als]
[alda.lisp.events :as ale]
[alda.lisp.attributes :as ala]
[alda.lisp.model.duration :as almd]
... | null | https://raw.githubusercontent.com/oakes/edna/ca1928cd4190047aec486d2bcdc54d8d5a8bbf06/src/edna/core.clj | clojure | if the octave has a + or -, treat it as a relative octave change
if the octave is just a number, treat it as an absolute octave change
if there is no octave in the note, use the existing octave
from org.bitbucket.daveyarwood/fluid-r3
from org.clojars.oakes/meico | (ns edna.core
(:require [alda.lisp]
[alda.sound :as sound]
[edna.parse :as parse]
[clojure.string :as str]
[alda.lisp.score :as als]
[alda.lisp.events :as ale]
[alda.lisp.attributes :as ala]
[alda.lisp.model.duration :as almd]
... |
cc7d6be10ab48cab1b4afef0396515434194eb462db80b568b3df7b77f892a76 | aryx/lfs | motif.ml | (** PROSITE-like patterns in sequence, whose elements come from a sub-logic. *)
module type PARAM =
sig
val toks_match : Syntax.t_list (** Syntaxtic representation of the 'match' prefix symbol. *)
val toks_begin : Syntax.t_list (** Syntactic representation of the 'begin' symbol. *)
val toks_end : Synta... | null | https://raw.githubusercontent.com/aryx/lfs/b931530c7132b77dfaf3c99d452dc044fce37589/logfun/src/motif.ml | ocaml | * PROSITE-like patterns in sequence, whose elements come from a sub-logic.
* Syntaxtic representation of the 'match' prefix symbol.
* Syntactic representation of the 'begin' symbol.
* Syntactic representation of the 'end' symbol.
* Syntactic representation of the element separator symbol.
* Syntactic representatio... |
module type PARAM =
sig
* Condition to be verified on gaps / links in motifs : the 1st/3rd argument respectively tells whether the left / right element is begin / end .
end
module Make (Param : PARAM) (A : Logic.T) =
A.gen must satisfy : A.gen(f , , _ ) = { x } , and A.gen(f , g , A.gen(f , ) ) is empty
struc... |
d5e738999c4383d829912b7a3d4e0652d3b266841f0c1ec692b0dc3166df2e05 | keyvanakbary/marko | components.cljs | (ns marko.components
(:require
[reagent.core :as r]
["easymde" :as easymde]))
(def id-counter (atom 0))
(defn- generate-id []
(swap! id-counter inc)
(str "editor-" @id-counter))
(defn editor [{:keys [id value options on-change]
:or {id (generate-id)}}]
(let [!key-change (atom false)
... | null | https://raw.githubusercontent.com/keyvanakbary/marko/392602803795d7a5ab4dc8242c1625aca9b0cc20/src/marko/components.cljs | clojure | (ns marko.components
(:require
[reagent.core :as r]
["easymde" :as easymde]))
(def id-counter (atom 0))
(defn- generate-id []
(swap! id-counter inc)
(str "editor-" @id-counter))
(defn editor [{:keys [id value options on-change]
:or {id (generate-id)}}]
(let [!key-change (atom false)
... | |
bb94805958e06daeb6dc64580bb37e8f14b16cf0f06350df9276f2c2ce00802b | protolude/protolude | List.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE Safe #-}
module Protolude.List
( head,
ordNub,
sortOn,
list,
product,
sum,
groupBy,
)
where
import Control.Applicative (pure)
import Data.Foldable (Foldable, foldl', foldr)
import Data.Function ((.))
import Data.Functor (fmap)
import Data.List (g... | null | https://raw.githubusercontent.com/protolude/protolude/e613ed4dd20b7b860fca326e11269af2104a196e/src/Protolude/List.hs | haskell | # LANGUAGE Safe #
O(n * log n) | # LANGUAGE NoImplicitPrelude #
module Protolude.List
( head,
ordNub,
sortOn,
list,
product,
sum,
groupBy,
)
where
import Control.Applicative (pure)
import Data.Foldable (Foldable, foldl', foldr)
import Data.Function ((.))
import Data.Functor (fmap)
import Data.List (groupBy, sortBy)
import... |
d4e6a712b8ca539a774ddcd6909e90f9f1a8a26fe79ebce71cd8df27b25272af | solita/laundry | xlsx_test.clj | (ns laundry.xlsx-test
(:require
[clojure.java.io :as io]
[clojure.test :refer :all]
[laundry.test.fixture :as fixture]
[peridot.multipart]
[ring.mock.request :as mock]
[ring.util.request]))
(deftest ^:integration api-xlsx
(let [app (fixture/get-app)
file (io/file (io/resource "test.xls"))... | null | https://raw.githubusercontent.com/solita/laundry/4e1fe96ebae19cde14c3ba5396929ba1578b7715/test/laundry/xlsx_test.clj | clojure | (ns laundry.xlsx-test
(:require
[clojure.java.io :as io]
[clojure.test :refer :all]
[laundry.test.fixture :as fixture]
[peridot.multipart]
[ring.mock.request :as mock]
[ring.util.request]))
(deftest ^:integration api-xlsx
(let [app (fixture/get-app)
file (io/file (io/resource "test.xls"))... | |
14f452e1d808605c3b7d75569b42b1cf92774afad129d1ffe0146e9c239559cc | hexlet-basics/exercises-clojure | test.clj | (ns about-state-test
(:require [test-helper :refer [assert-solution]]
[index :refer [transit]]))
(assert-solution
[[(atom 100) (atom 50) 20] [(atom 10) (atom 100) 10] [(atom 50) (atom 30) 50]]
[[80 70] [0 110] [0 80]]
transit)
| null | https://raw.githubusercontent.com/hexlet-basics/exercises-clojure/ede14102d01f9ef736e0af811cd92f5b22a83bc2/modules/45-state/10-about-state/test.clj | clojure | (ns about-state-test
(:require [test-helper :refer [assert-solution]]
[index :refer [transit]]))
(assert-solution
[[(atom 100) (atom 50) 20] [(atom 10) (atom 100) 10] [(atom 50) (atom 30) 50]]
[[80 70] [0 110] [0 80]]
transit)
| |
3548df7817bef0ace2f01c83c3a2742f91664307821ec50b5d74f0632b60483e | bfontaine/grape | models_test.clj | (ns grape.impl.models-test
(:require [clojure.test :refer :all]
[grape.impl.models :as m]
[grape.impl.parsing :as p]))
(deftest tree-node?-test
(are [x] (m/tree-node? x)
(list :keyword "foo")
(list :list (list :keyword "x") (list :symbol "y"))
(list :whitesp... | null | https://raw.githubusercontent.com/bfontaine/grape/51d741943595f55fd51c34b0213037ca484a1bfb/test/grape/impl/models_test.clj | clojure | (ns grape.impl.models-test
(:require [clojure.test :refer :all]
[grape.impl.models :as m]
[grape.impl.parsing :as p]))
(deftest tree-node?-test
(are [x] (m/tree-node? x)
(list :keyword "foo")
(list :list (list :keyword "x") (list :symbol "y"))
(list :whitesp... | |
79884bdceee1adb38b25fe99197466a1a28bc0807dc4cb02f373fb0c3f86a357 | diku-dk/futhark | Lambdas.hs | module Futhark.Internalise.Lambdas
( InternaliseLambda,
internaliseFoldLambda,
internalisePartitionLambda,
)
where
import Futhark.IR.SOACS as I
import Futhark.Internalise.AccurateSizes
import Futhark.Internalise.Monad
import Language.Futhark as E
-- | A function for internalising lambdas.
type Internalise... | null | https://raw.githubusercontent.com/diku-dk/futhark/98e4a75e4de7042afe030837084764bbf3c6c66e/src/Futhark/Internalise/Lambdas.hs | haskell | | A function for internalising lambdas.
The result of the body must have the exact same shape as the
initial accumulator. | module Futhark.Internalise.Lambdas
( InternaliseLambda,
internaliseFoldLambda,
internalisePartitionLambda,
)
where
import Futhark.IR.SOACS as I
import Futhark.Internalise.AccurateSizes
import Futhark.Internalise.Monad
import Language.Futhark as E
type InternaliseLambda =
E.Exp -> [I.Type] -> Internalise... |
6d3d6a4d2bf9f722ef6e27756330c107f86ae400b942ee7aa8536ee704fb1c13 | exoscale/clojure-kubernetes-client | v1_lifecycle.clj | (ns clojure-kubernetes-client.specs.v1-lifecycle
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-handler :refer :all]
[clojure-kubernetes-client.specs.v1-handler :refer :all]
)
(:import (java.io File)))
(declare... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_lifecycle.clj | clojure | (ns clojure-kubernetes-client.specs.v1-lifecycle
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-handler :refer :all]
[clojure-kubernetes-client.specs.v1-handler :refer :all]
)
(:import (java.io File)))
(declare... | |
3eb4eac0fa956c75353d256926032fc7827b4b5151d16d2831d43e25c016e164 | namin/inc | tests-2.8-req.scm |
(add-tests-with-string-output "symbols"
[(symbol? 'foo) => "#t\n"]
[(symbol? '()) => "#f\n"]
[(symbol? "") => "#f\n"]
[(symbol? '(1 2)) => "#f\n"]
[(symbol? '#()) => "#f\n"]
[(symbol? (lambda (x) x)) => "#f\n"]
[(symbol? 'foo) => "#t\n"]
[(string? 'foo) => "#f\n"]
[(pair? 'foo) => "#f\n"]
[(vector? 'foo) => ... | null | https://raw.githubusercontent.com/namin/inc/3f683935e290848485f8d4d165a4f727f6658d1d/src/tests-2.8-req.scm | scheme |
(add-tests-with-string-output "symbols"
[(symbol? 'foo) => "#t\n"]
[(symbol? '()) => "#f\n"]
[(symbol? "") => "#f\n"]
[(symbol? '(1 2)) => "#f\n"]
[(symbol? '#()) => "#f\n"]
[(symbol? (lambda (x) x)) => "#f\n"]
[(symbol? 'foo) => "#t\n"]
[(string? 'foo) => "#f\n"]
[(pair? 'foo) => "#f\n"]
[(vector? 'foo) => ... | |
eee510ace605043b5302c6eb6dd735cd621711f1d4ea9c5745096b4b1357d0ee | jepsen-io/jepsen | version_divergence.clj | (ns jepsen.crate.version-divergence
"Writes a series of unique integer values to a table whilst causing network
partitions and healing the network every 2 minutes.
We will verify that each _version of a given row identifies a single value."
(:refer-clojure :exclude [test])
(:require [jepsen [core :a... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/a75d5a50dd5fa8d639a622c124bf61253460b754/crate/src/jepsen/crate/version_divergence.clj | clojure | Everyone's gotta block until we've made the table.
Back off a bit | (ns jepsen.crate.version-divergence
"Writes a series of unique integer values to a table whilst causing network
partitions and healing the network every 2 minutes.
We will verify that each _version of a given row identifies a single value."
(:refer-clojure :exclude [test])
(:require [jepsen [core :a... |
38038496dd04e568892d101e67ce56c4028d8b5a27b126f99ef640a28475486a | haskell-repa/repa | IO.hs |
module Data.Repa.Flow.Generic.IO
( -- * Buckets
module Data.Repa.Flow.IO.Bucket
-- * Sourcing
, sourceBytes
, sourceChars
, sourceChunks
, sourceRecords
, sourceLinesFormat
, sourceLinesFormatFromLazyByteString
-- * Sinking
... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-flow/Data/Repa/Flow/Generic/IO.hs | haskell | * Buckets
* Sourcing
* Sinking
* Sieving
* Tables |
module Data.Repa.Flow.Generic.IO
module Data.Repa.Flow.IO.Bucket
, sourceBytes
, sourceChars
, sourceChunks
, sourceRecords
, sourceLinesFormat
, sourceLinesFormatFromLazyByteString
, sinkBytes
, sinkChars
, sinkLines
, sieve... |
5dc1475d6272a3d923500b7aa6e87143534c831cbdc8358f9a095e089800243e | ekmett/ekmett.github.com | Algebra.hs | -----------------------------------------------------------------------------
-- |
-- Module : Control.Functor.Algebra
Copyright : ( C ) 2008
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable (rank-2 polymorphism)... | null | https://raw.githubusercontent.com/ekmett/ekmett.github.com/8d3abab5b66db631e148e1d046d18909bece5893/haskell/category-extras/_darcs/pristine/src/Control/Functor/Algebra.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Functor.Algebra
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable (rank-2 polymorphism)
variants
------------------------------------------------------------... | Copyright : ( C ) 2008
Maintainer : < >
Algebras , Coalgebras , Bialgebras , and Dialgebras and their ( co)monadic
module Control.Functor.Algebra
( Dialgebra, GDialgebra
, Bialgebra, GBialgebra
, Algebra, GAlgebra
, Coalgebra, GCoalgebra
, Trialgebra
, liftAlgebra
, liftCoalgebra
, liftDial... |
bebaeb06e5795f283d5856fbddd162d09f85dd544624842595c874531e3671ca | seltzer1717/just-maven-clojure-archetype | core.clj | (ns com.example.sample.core)
(defn reverso [input]
(->> input reverse (apply str))) | null | https://raw.githubusercontent.com/seltzer1717/just-maven-clojure-archetype/ae748b97ffc3ae4f89f9367a6296298e1b6b09f5/src/test/resources/projects/basic/child/reference/src/main/clojure/com/example/sample/core.clj | clojure | (ns com.example.sample.core)
(defn reverso [input]
(->> input reverse (apply str))) | |
52bdfd8f4ddd966779181ba509a5e3c212af74f02b8db4569036877c82eeb87d | ghc/ghc | Arity07.hs | module F7 where
f7f = \x -> x
f7g = \z -> \y -> z+y
f7 = f7f f7g 2 3
| null | https://raw.githubusercontent.com/ghc/ghc/37cfe3c0f4fb16189bbe3bb735f758cd6e3d9157/testsuite/tests/arityanal/should_compile/Arity07.hs | haskell | module F7 where
f7f = \x -> x
f7g = \z -> \y -> z+y
f7 = f7f f7g 2 3
| |
061ad1780882f97fdf5634f24d439cb5e7f89a037ca654adcacaaba8f6edef8b | circuithub/rel8 | HKD.hs | # language AllowAmbiguousTypes #
# language DataKinds #
{-# language FlexibleContexts #-}
# language FlexibleInstances #
# language MultiParamTypeClasses #
# language RankNTypes #
{-# language ScopedTypeVariables #-}
# language StandaloneKindSignatures #
# language TypeApplications #
{-# language TypeFamilies #-}
{-# l... | null | https://raw.githubusercontent.com/circuithub/rel8/2a25126e214c1171c3d0c2d12d5a14ca831a266c/src/Rel8/Table/HKD.hs | haskell | # language FlexibleContexts #
# language ScopedTypeVariables #
# language TypeFamilies #
# language UndecidableInstances #
base
rel8 | # language AllowAmbiguousTypes #
# language DataKinds #
# language FlexibleInstances #
# language MultiParamTypeClasses #
# language RankNTypes #
# language StandaloneKindSignatures #
# language TypeApplications #
# language UndecidableSuperClasses #
module Rel8.Table.HKD
( HKD( HKD )
, HKDable
, BuildableHKD
... |
a8f4e4d49596f60ffa8c6c56cdd2bd1b4b29b86913b73d051b817969d09e6f38 | wireless-net/erlang-nommu | slave.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2013 . 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/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/src/slave.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 - 2013 . 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(slave).
debug printouts are done... |
29c012504fcc7928324ee21d3c42049f15189eb368b329befebea80fcba67c44 | seagreen/ian | Megaparsec.hs | | Notes on megaparsec .
module Scratch.Megaparsec where
-- parser-combinators (-combinators):
--
" Lightweight package providing commonly useful parser combinators . "
--
Control . Monad . Combinators . NonEmpty :
--
" The module provides more efficient versions of the combinators from Control . Applic... | null | https://raw.githubusercontent.com/seagreen/ian/f245fb68d94299f0e3e12744e9d1549447ad529a/haskell/src/Scratch/Megaparsec.hs | haskell | parser-combinators (-combinators):
The Applicative @some@, exported by Control.Applicative and Control.Applicative.Combinators.
It has the most descriptive type signatures and greater than or equal performance
| megaparsec exports both @parse@ and @runParser@ (which mean the same thing).
We hide @parse@ ... | | Notes on megaparsec .
module Scratch.Megaparsec where
" Lightweight package providing commonly useful parser combinators . "
Control . Monad . Combinators . NonEmpty :
" The module provides more efficient versions of the combinators from Control . Applicative . Combinators defined in terms of Monad a... |
1317f525f3a9c3cb1e3a064c82d1bd96c27d76894f8b169d22233feee2ad0079 | bolducp/SICP | 01.05.scm | Exercise 1.5 .
has invented a test to determine whether the interpreter he is faced with is using
applicative - order evaluation or normal - order evaluation . He defines the following two procedures :
;; (define (p) (p))
;; (define (test x y)
;; (if (= x 0)
0
;; y))
;; Then he evaluates t... | null | https://raw.githubusercontent.com/bolducp/SICP/871babe9296b84b2b9648a02f9202752d21ebf93/exercises/chapter_01/1.1_exercises/01.05.scm | scheme | (define (p) (p))
(define (test x y)
(if (= x 0)
y))
Then he evaluates the expression
What behavior will he observe with an interpreter that uses normal-order evaluation?
Explain your answer. (Assume that the evaluation rule for the special form if is the same
whether the interpreter is using normal o... | Exercise 1.5 .
has invented a test to determine whether the interpreter he is faced with is using
applicative - order evaluation or normal - order evaluation . He defines the following two procedures :
0
( test 0 ( p ) )
What behavior will observe with an interpreter that uses applicative -... |
aa67b1a4711a3bd873a18151271fbfee87bc139bbf7082871202ef5b63f17aa1 | langston-barrett/CoverTranslator | Add.hs | module Add where
import Property
data Nat = Zero | Succ Nat
add x Zero = x
add x (Succ y) = Succ (add x y)
The following variant is trickier to prove ( at least one case ) ...
-- add x (Succ y) = add (Succ x) y
Backwards axioms , should be pasted into the generated otter files ...
Not needed since we have ... | null | https://raw.githubusercontent.com/langston-barrett/CoverTranslator/4172bef9f4eede7e45dc002a70bf8c6dd9a56b5c/examples/add/Add.hs | haskell | add x (Succ y) = add (Succ x) y
P(x, y) = add x y = add y x.
<=> Induction on y.
/\
P(0, 0)
/\
/\
/\
<= We can skip type information.
P(0, 0)
/\
forall x. P(x, 0) -> P(Succ x, 0)
/\
forall y. P(0, y) -> P(0, Succ y)
/\
This step is identical to the previous one, assuming symmetric
equality.
... | module Add where
import Property
data Nat = Zero | Succ Nat
add x Zero = x
add x (Succ y) = Succ (add x y)
The following variant is trickier to prove ( at least one case ) ...
Backwards axioms , should be pasted into the generated otter files ...
Not needed since we have restricted ourselves to total value... |
c0d889cb4fd8b3b678c3c458ca393cd509034af8e8104f328c73e80510e4ca55 | grin-compiler/ghc-wpc-sample-programs | Syntax.hs |
module Agda.Auto.Syntax where
import Data.IORef
import qualified Data.Set as Set
import Agda.Syntax.Common (Hiding)
import Agda.Auto.NarrowingSearch
import Agda.Utils.Impossible
-- | Unique identifiers for variable occurrences in unification.
type UId o = Metavar (Exp o) (RefInfo o)
data HintMode = HMNormal
... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/Auto/Syntax.hs | haskell | | Unique identifiers for variable occurrences in unification.
"_≡_"
"begin_"
"_≡⟨_⟩_"
"_∎"
"sym"
"cong"
| The concrete instance of the 'blk' parameter in 'Metavar'.
I.e., the information passed to the search control.
(to make cost of using module parameters correspond to that of hints).
^ Size of typing ... |
module Agda.Auto.Syntax where
import Data.IORef
import qualified Data.Set as Set
import Agda.Syntax.Common (Hiding)
import Agda.Auto.NarrowingSearch
import Agda.Utils.Impossible
type UId o = Metavar (Exp o) (RefInfo o)
data HintMode = HMNormal
| HMRecCall
data EqReasoningConsts o = EqReasoningConst... |
2e5a90b62c293bb65fc40d1c740c496c5f054a46d22ec9ea69e7e1d668f85ad4 | sunng87/slacker | common.clj | (ns slacker.common
(:require [trptcolin.versioneer.core :as ver]))
(def
^{:doc "Debug flag. This flag can be override by binding if you like to see some debug output."
:dynamic true}
*debug* false)
(def
^{:doc "Timeout for synchronouse call."
:dynamic true}
*timeout* 10000)
(def
^{:doc "Initial Kr... | null | https://raw.githubusercontent.com/sunng87/slacker/60e5372782bed6fc58cb8ba55951516a6b971513/src/slacker/common.clj | clojure | (ns slacker.common
(:require [trptcolin.versioneer.core :as ver]))
(def
^{:doc "Debug flag. This flag can be override by binding if you like to see some debug output."
:dynamic true}
*debug* false)
(def
^{:doc "Timeout for synchronouse call."
:dynamic true}
*timeout* 10000)
(def
^{:doc "Initial Kr... | |
34faf69fbae79b3f393a5ee7d0d9958e7cd2dd6524a0aa421883d6241eb0b8a6 | epgsql/epgsql | epgsql_cmd_batch.erl | %% @doc Execute multiple extended queries in a single network round-trip
%%
There are 2 kinds of interface :
%% <ol>
%% <li>To execute multiple queries, each with it's own `statement()'</li>
%% <li>To execute multiple queries, but by binding different parameters to the
%% same `statement()'</li>
%% </ol>
%% ```
%%... | null | https://raw.githubusercontent.com/epgsql/epgsql/f811a09926892dbd1359afe44a9bfa8f6907b322/src/commands/epgsql_cmd_batch.erl | erlang | @doc Execute multiple extended queries in a single network round-trip
<ol>
<li>To execute multiple queries, each with it's own `statement()'</li>
<li>To execute multiple queries, but by binding different parameters to the
same `statement()'</li>
</ol>
```
> {Bind
> Execute
< CommandComplete}*
> Sync
<... | There are 2 kinds of interface :
< BindComplete
< DataRow *
-module(epgsql_cmd_batch).
-behaviour(epgsql_command).
-export([init/1, execute/2, handle_message/4]).
-export_type([arguments/0, response/0]).
-include("epgsql.hrl").
-include("protocol.hrl").
-record(batch,
{batch :: [ [epgsql:bind_param... |
d45545e5b69c3d80dc1d32617c6c6148cf5421f339a714b6260bb2d1e066f298 | mihaiolteanu/zbucium | packages.lisp | (defpackage :zbucium
(:use :cl :plump :lquery :alexandria :generators
:bt :lastfm :youtube :lyrics)
(:import-from :drakma :http-request)
(:import-from :bordeaux-threads :make-thread)
(:import-from :bordeaux-threads :join-thread)
(:shadowing-import-from :yason :parse)
(:import-from :local-time :times... | null | https://raw.githubusercontent.com/mihaiolteanu/zbucium/5b0135f5c586088ae40183b0d7661fec5eb47791/packages.lisp | lisp | (defpackage :zbucium
(:use :cl :plump :lquery :alexandria :generators
:bt :lastfm :youtube :lyrics)
(:import-from :drakma :http-request)
(:import-from :bordeaux-threads :make-thread)
(:import-from :bordeaux-threads :join-thread)
(:shadowing-import-from :yason :parse)
(:import-from :local-time :times... | |
4714b9560e3c1bd643e838edf189e95c50794686ebd7011bb3328a54d7b46553 | janestreet/memtrace_viewer_with_deps | raw.ml | open Base
open Js_of_ocaml
open Gen_js_api
module Native_node : sig
type t = Dom_html.element Js.t
val t_of_js : Ojs.t -> t
val t_to_js : t -> Ojs.t
end = struct
type t = Dom_html.element Js.t
let t_of_js x = Stdlib.Obj.magic x
let t_to_js x = Stdlib.Obj.magic x
end
module Attrs : sig
type t = private... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/virtual_dom/src/raw.ml | ocaml | here is how we throw away type information. Our good old friend Obj.magic,
but constrained a little bit
The [update] method of [obj] is only called by virtual-dom after it has checked
that the [id]s of [prev] and [obj] are "===" equal. Thus [same_witness_exn] will
never raise.
| open Base
open Js_of_ocaml
open Gen_js_api
module Native_node : sig
type t = Dom_html.element Js.t
val t_of_js : Ojs.t -> t
val t_to_js : t -> Ojs.t
end = struct
type t = Dom_html.element Js.t
let t_of_js x = Stdlib.Obj.magic x
let t_to_js x = Stdlib.Obj.magic x
end
module Attrs : sig
type t = private... |
6dcef8b3e97ebe5adcac1954dd90c94a3a687e8e1be67d79eec83b2da0da9e1a | filipesilva/roam-to-csv | main.cljc | (ns roam-to-csv.main
(:require [roam-to-csv.compat :as compat]
[roam-to-csv.athens :as athens]
[roam-to-csv.roam :as roam]
[clojure.string :as str]
[clojure.edn :as edn]
[clojure.tools.cli :as cli]
[clojure.pprint :as pprint]
[datascr... | null | https://raw.githubusercontent.com/filipesilva/roam-to-csv/4fead192df5ce9baff5003e0135d46c4b8fec638/src/roam_to_csv/main.cljc | clojure | Needed for standalone jar to invoke with java
TODO:
--query-file
--query-params
Tools.cli provides a :summary key that can be used for printing:
Read the file as a Datascript database
Simple and extra query
Custom query for uids+blocks | (ns roam-to-csv.main
(:require [roam-to-csv.compat :as compat]
[roam-to-csv.athens :as athens]
[roam-to-csv.roam :as roam]
[clojure.string :as str]
[clojure.edn :as edn]
[clojure.tools.cli :as cli]
[clojure.pprint :as pprint]
[datascr... |
5bcdc1761b3939008ba2b4f26f7fce35cd27ebf81395e8ae1473e30ce94ac53f | yminer/libml | initVisitor.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... | null | https://raw.githubusercontent.com/yminer/libml/1475dd87c2c16983366fab62124e8bbfbbf2161b/src/nn/init/initVisitor.ml | ocaml | *
The abstract initialisation visitor.
Instances of derived classes are supposed to initialize various kinds of
neural networks.
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... |
8c0f6e205f57c34f0cfc2d62b78901eee312455b80fc4b3c6b1f29337e989b63 | oakes/Nightcode | start.clj | (ns {{name}}.start
(:require [{{name}}.{{core-name}} :as c]
[{{name}}.music :as m]
[play-cljc.gl.core :as pc])
(:import [org.lwjgl.glfw GLFW Callbacks
GLFWCursorPosCallbackI GLFWKeyCallbackI GLFWMouseButtonCallbackI
GLFWCharCallbackI GLFWFramebufferSizeCallbackI]
... | null | https://raw.githubusercontent.com/oakes/Nightcode/2e112c59cddc5fdec96059a08912c73b880f9ae8/resources/leiningen/new/play_cljc/start.clj | clojure | uncomment this to hear music when the game begins!
(play-music!) | (ns {{name}}.start
(:require [{{name}}.{{core-name}} :as c]
[{{name}}.music :as m]
[play-cljc.gl.core :as pc])
(:import [org.lwjgl.glfw GLFW Callbacks
GLFWCursorPosCallbackI GLFWKeyCallbackI GLFWMouseButtonCallbackI
GLFWCharCallbackI GLFWFramebufferSizeCallbackI]
... |
70b786985dcdf5283eb5fd549ebc3065bac30645d982870c712c3b6f55d6daba | input-output-hk/goblins | Core.hs | {-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE LambdaCase #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Scope... | null | https://raw.githubusercontent.com/input-output-hk/goblins/cde90a2b27f79187ca8310b6549331e59595e7ba/src/Test/Goblin/Core.hs | haskell | # LANGUAGE DefaultSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE RankNTypes #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
| The core typeclasses and associated methods of goblins.
| The state we carry as we perform goblins actions... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.Goblin.Core
( module Test.Goblin.Core
, (<$$>)
, (<**>)
) where
import Control.Monad (replicateM)
import Control.Monad.Trans.State.Strict (State)
import Data.Type... |
35f5d6981119da0b1739a93528b64661090f5f66ef34403e206f3dddb851d64c | thephoeron/baphomet | generic-interface.lisp | Copyright ( c ) 2022 , " the Phoeron " < >
Released under the MIT License . See baphomet / LICENSE for more information .
(in-package :common-lisp/generic-interface)
(defgeneric instancep (instance)
(:documentation ""))
(defgeneric new (instance &rest args &key &allow-other-keys)
(:documentation ""))
(d... | null | https://raw.githubusercontent.com/thephoeron/baphomet/5ac1e33b5e8bac07be1ac6f9028e21b05f1205e0/type-packages/generic-interface.lisp | lisp | Copyright ( c ) 2022 , " the Phoeron " < >
Released under the MIT License . See baphomet / LICENSE for more information .
(in-package :common-lisp/generic-interface)
(defgeneric instancep (instance)
(:documentation ""))
(defgeneric new (instance &rest args &key &allow-other-keys)
(:documentation ""))
(d... | |
b0b52c8afa5e68f467d051498bab61673b61e6f355902a5ca816dcf898cb84ad | typelead/eta | T4310.hs | # LANGUAGE TypeFamilies , RankNTypes , ScopedTypeVariables , KindSignatures #
module T4310 where
import GHC.ST
type family Mutable a :: * -> * -> *
data New v a = New (forall s. ST s (Mutable v s a))
create :: (forall s. ST s (Mutable v s a)) -> New v a
create = New
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T4310.hs | haskell | # LANGUAGE TypeFamilies , RankNTypes , ScopedTypeVariables , KindSignatures #
module T4310 where
import GHC.ST
type family Mutable a :: * -> * -> *
data New v a = New (forall s. ST s (Mutable v s a))
create :: (forall s. ST s (Mutable v s a)) -> New v a
create = New
| |
a1408d450caf3569195062c9b7cc277ca702363fd64683646fa059de8319557b | faylang/fay | HidePreludeImport_Import.hs | module HidePreludeImport_Import where
last :: Double
last = 1
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/HidePreludeImport_Import.hs | haskell | module HidePreludeImport_Import where
last :: Double
last = 1
| |
b63be5e3fdac043378b39083fc7f48a0744a252632f7bb6cedc21558ef465cc5 | mirage/ocaml-cohttp | lwt_unix_server_new.ml | open Lwt.Syntax
module Context = Cohttp_server_lwt_unix.Context
module Body = Cohttp_server_lwt_unix.Body
let text = String.make 2053 'a'
let server_callback ctx =
Lwt.join
[
Context.discard_body ctx;
Context.respond ctx (Http.Response.make ()) (Body.string text);
]
let main () =
let* _server... | null | https://raw.githubusercontent.com/mirage/ocaml-cohttp/c4e7da95a44e072f1e43e6b3605f599c29002ed5/cohttp-bench/lwt_unix_server_new.ml | ocaml | open Lwt.Syntax
module Context = Cohttp_server_lwt_unix.Context
module Body = Cohttp_server_lwt_unix.Body
let text = String.make 2053 'a'
let server_callback ctx =
Lwt.join
[
Context.discard_body ctx;
Context.respond ctx (Http.Response.make ()) (Body.string text);
]
let main () =
let* _server... | |
e2cf470f8ec6ac9f93711c656f1b6b89c3406502aefd1fb4c387b7715b4bb181 | mstksg/inCode | todo-cmd.hs | -- | -a-todo-gui-application-with-auto-on
--
-- You probably will also need the actual application logic, at
-- -samples/auto/Todo.hs
--
-- Recommended to run with cabal sandboxes:
--
-- $ cabal sandbox init
-- $ cabal install auto
$ cabal exec
--
module Main (main) where
import Control.Auto
import Control.Auto.I... | null | https://raw.githubusercontent.com/mstksg/inCode/e1f80a3dfd83eaa2b817dc922fd7f331cd1ece8a/code-samples/auto/todo-cmd.hs | haskell | | -a-todo-gui-application-with-auto-on
You probably will also need the actual application logic, at
-samples/auto/Todo.hs
Recommended to run with cabal sandboxes:
$ cabal sandbox init
$ cabal install auto
| Parse a string input.
one that runs forever
default output value on bad command
run `formatTodo ... | $ cabal exec
module Main (main) where
import Control.Auto
import Control.Auto.Interval
import Control.Monad
import Data.IntMap (IntMap)
import Data.Maybe
import Prelude hiding ((.), id)
import Text.Read
import Todo
import qualified Data.IntMap as IM
parseInp :: String -> Maybe TodoInp
parseInp = ... |
fd2d4da9ac6ab75f341a51dd2acc2d8e11675fbc3e588b546fa5c4cd14ed0278 | uwplse/oddity | routes.clj | (ns oddity.routes
(:require [compojure.core :refer [GET routes]]
[compojure.route :refer [not-found resources]]
[hiccup.page :refer [include-js include-css html5]]
[config.core :refer [env]]
[oddity.config :refer [client-config]]))
(def mount-target
[:div#app
[:h3... | null | https://raw.githubusercontent.com/uwplse/oddity/81c1a6af203a0d8e71138a27655e3c4003357127/oddity/src/clj/oddity/routes.clj | clojure | (ns oddity.routes
(:require [compojure.core :refer [GET routes]]
[compojure.route :refer [not-found resources]]
[hiccup.page :refer [include-js include-css html5]]
[config.core :refer [env]]
[oddity.config :refer [client-config]]))
(def mount-target
[:div#app
[:h3... | |
776b444feaae4539f3e5c5d5bbc363454e6bf4d88ff9662ac249dd9714dfac37 | daveyarwood/music-theory | chord.cljc | (ns music-theory.chord
(:require [clojure.string :as str]
[music-theory.note :refer (->note interval+ interval-)]
[music-theory.util :refer (error parse-int)]))
(def ^:private chord-intervals
{"" [:M3 :m3] ; major
"M" [:M3 :m3]
"maj" [:M3 :m3]... | null | https://raw.githubusercontent.com/daveyarwood/music-theory/c58beb9fa6d290900afeff78ee4f86c875e393d7/src/music_theory/chord.cljc | clojure | major
minor
diminished
augmented
=> nil" | (ns music-theory.chord
(:require [clojure.string :as str]
[music-theory.note :refer (->note interval+ interval-)]
[music-theory.util :refer (error parse-int)]))
(def ^:private chord-intervals
"M" [:M3 :m3]
"maj" [:M3 :m3]
"min" [:m3 :M3]
"°" [:m3 :m3]... |
a8a244dddaa921fd313d1ad8ddab3e8274bd2ad56a8a18cd5018f82343a8da06 | gvannest/piscine_OCaml | life.ml | type phosphate = string
type deoxyribose = string
type nucleobase = A | T | C | G | U | None
type nucleotide = {
phosphate : phosphate ;
deoxyribose : deoxyribose ;
nucleobase : nucleobase
}
type helix = nucleotide list
let generate_nucleotide c =
{
phosphate = "phosphate" ;
deoxyribo... | null | https://raw.githubusercontent.com/gvannest/piscine_OCaml/2533c6152cfb46c637d48a6d0718f7c7262b3ba6/d02/ex08/life.ml | ocaml | ----------------- ex06 -----------------
----------------- ex07 -----------------
----------------- ex08 ----------------- | type phosphate = string
type deoxyribose = string
type nucleobase = A | T | C | G | U | None
type nucleotide = {
phosphate : phosphate ;
deoxyribose : deoxyribose ;
nucleobase : nucleobase
}
type helix = nucleotide list
let generate_nucleotide c =
{
phosphate = "phosphate" ;
deoxyribo... |
ecdd55f865be591850e550df434ea2cffac0d427d16c8a019d132774b25054c4 | nineties-retro/sps | bootstrap-scm.scm | ;
Loads all the required files that make up the Pre - Scheme to GNU C compiler
; into scm and runs the compiler on the file pre-scheme-compiler.scm.
;
(load "scm/sps-if.scm")
(load "scm/sps-assert.scm")
(load "scm/sps-byte-vector.scm")
(load "sps-byte-vector.scm")
(load "scm/sps-strings-scm.scm")
;;(load "scm/sps-str... | null | https://raw.githubusercontent.com/nineties-retro/sps/bf15b415f4cdf5d6d69ae2f39c250db2090c0817/bootstrap-scm.scm | scheme |
into scm and runs the compiler on the file pre-scheme-compiler.scm.
(load "scm/sps-strings-sps.scm")
(load "sps/sps-word.scm")
(load "sps/sps-compat.scm")
(load "sps/sps-io.scm")
(load "sps/sps-mem.scm")
(load "sps/sps-mem-fsp.scm")
(load "sps/sps-mem-sp.scm")
(define *sp-alloc* (sps:mem:pool:alloc sps:mem:sp:ops))
... | Loads all the required files that make up the Pre - Scheme to GNU C compiler
(load "scm/sps-if.scm")
(load "scm/sps-assert.scm")
(load "scm/sps-byte-vector.scm")
(load "sps-byte-vector.scm")
(load "scm/sps-strings-scm.scm")
(load "scm/sps-word.scm")
(load "scm/sps-compat.scm")
(load "scm/sps-io.scm")
(load "scm/sps... |
e6ec0c74159dcc668ba2ee1bf2f9cc6cc3fea26a5fdf8f93951ffd140cc74dda | daypack-dev/daypack-lib | time_slots.ml | open Int64_utils
exception Time_slots_are_not_sorted
exception Time_slots_are_not_disjoint
module Check = struct
let check_if_valid (time_slots : Time_slot.t Seq.t) : Time_slot.t Seq.t =
Seq.map Time_slot.Check.check_if_valid time_slots
let check_if_not_empty (time_slots : Time_slot.t Seq.t) : Time_slot.t S... | null | https://raw.githubusercontent.com/daypack-dev/daypack-lib/63fa5d85007eca73aa6c51874a839636dd0403d3/src/time_slots.ml | ocaml | cannot be merged, add time slot being carried to the sequence
entire time slot is after start, do nothing
time slot spans across the start mark, split time slot
time slot is before start mark, move to next time slot
entire time slot is after end_exc mark, drop everything
time slot spans across the end_exc ma... | open Int64_utils
exception Time_slots_are_not_sorted
exception Time_slots_are_not_disjoint
module Check = struct
let check_if_valid (time_slots : Time_slot.t Seq.t) : Time_slot.t Seq.t =
Seq.map Time_slot.Check.check_if_valid time_slots
let check_if_not_empty (time_slots : Time_slot.t Seq.t) : Time_slot.t S... |
ddbe0059be82949a275ee92a2d64c94485795c19f84b24b987a426c555790e4d | umd-cmsc330/cmsc330spring22 | disc5_sol.ml | (* Typing Practice *)
1) let f x y = x + y
int -> int -> int
2) let f x y = [x; y]
'a -> 'a -> 'a list
3)
let f a =
if a then 1 else "hi"
INVALID - Can't have two different return types
4)
let f a b =
if a then 0 else b
bool -> int -> int
5)
let f a b c =
let d = "hi" ^ a ^ b ^ c in
... | null | https://raw.githubusercontent.com/umd-cmsc330/cmsc330spring22/38f025e4eaf567c6802c6ade3936e4e0f994092a/discussions/d5_typing/disc5_sol.ml | ocaml | Typing Practice
Creating functions
Records and New Types |
1) let f x y = x + y
int -> int -> int
2) let f x y = [x; y]
'a -> 'a -> 'a list
3)
let f a =
if a then 1 else "hi"
INVALID - Can't have two different return types
4)
let f a b =
if a then 0 else b
bool -> int -> int
5)
let f a b c =
let d = "hi" ^ a ^ b ^ c in
d == "hello"
String -... |
fc38e68403338726835171d1c0af0f88ef9042ddc6804bda9d0327dc38f1ab2f | yzh44yzh/practical_erlang | short_link_test.erl | -module(short_link_test).
-include_lib("eunit/include/eunit.hrl").
%%% module API
create_short_test() ->
State1 = short_link:init(),
{Short1, State2} = short_link:create_short("", State1),
{Short2, State3} = short_link:create_short("", State2),
{Short3, State4} = short_link:create_short("", State3),... | null | https://raw.githubusercontent.com/yzh44yzh/practical_erlang/c9eec8cf44e152bf50d9bc6d5cb87fee4764f609/05_kv/solution/short_link_test.erl | erlang | module API | -module(short_link_test).
-include_lib("eunit/include/eunit.hrl").
create_short_test() ->
State1 = short_link:init(),
{Short1, State2} = short_link:create_short("", State1),
{Short2, State3} = short_link:create_short("", State2),
{Short3, State4} = short_link:create_short("", State3),
{Short4, S... |
5a5bb891a872ed69dada8cb43735f96d56882c3d0bc627d4b41258511f5b4a28 | erszcz/learning | ets_iter_sup.erl | -module(ets_iter_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ==========================================================... | null | https://raw.githubusercontent.com/erszcz/learning/b21c58a09598e2aa5fa8a6909a80c81dc6be1601/erlang-ets-iter/src/ets_iter_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API functions
===================================================================
===================================================================
Supervisor callback... | -module(ets_iter_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, { {one_for_one, 5, 10}, [?CHILD(ets_iter_worker... |
8a979e27a0f282f3aad964fdd8de37fb1d5d7cd8d8b37bf53fb715b723d54862 | AccelerateHS/accelerate-llvm | Match.hs | # LANGUAGE GADTs #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_HADDOCK hide #-}
-- |
Module : Data . Array . Accelerate . LLVM.Analysis . Match
Copyright : [ 2016 .. 2020 ] The Accelerate Team
-- License : BSD3
--
Maintainer : < >
-- Stabilit... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-llvm/cf081587fecec23a19f68bfbd31334166868405e/accelerate-llvm/icebox/Data/Array/Accelerate/LLVM/Analysis/Match.hs | haskell | # LANGUAGE TypeOperators #
# OPTIONS_HADDOCK hide #
|
License : BSD3
Stability : experimental
Match reified shape types
| # LANGUAGE GADTs #
# LANGUAGE ScopedTypeVariables #
Module : Data . Array . Accelerate . LLVM.Analysis . Match
Copyright : [ 2016 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.LLVM.Analysis.Match (
mo... |
9da6124d0190432ec52007094ba344ce7d9410bf9451a04a8f31aae356b37c13 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - 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.
module Duckling.Time.ES.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Time/ES/Tests.hs | haskell | 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. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Time.ES.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Testing.Asserts
import Duckling.Time.ES.Corpus
tests :: TestTree
tests = testGroup "ES Tests"
[ makeCorpusTest [S... |
1252a89347eb0b4df4f9d3599325aa25be9545abb9a8e948850c01d84cc68a33 | gfour/gic | ntak.hs | shuffle h x y z n =
if n `mod` 3 == 0 then
ntak shuffle h (n+3) (x-1) y z
else if n `mod` 3 == 1 then
ntak shuffle h (n+2) (y-1) z x
else
ntak shuffle h (n+1) (z-1) x y
ntak f h n x y z =
if x <= y then
h x y z
else
ntak f h n (f h x y z n)
(f h x y z (n+1)... | null | https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/Examples/Num/ntak.hs | haskell | shuffle h x y z n =
if n `mod` 3 == 0 then
ntak shuffle h (n+3) (x-1) y z
else if n `mod` 3 == 1 then
ntak shuffle h (n+2) (y-1) z x
else
ntak shuffle h (n+1) (z-1) x y
ntak f h n x y z =
if x <= y then
h x y z
else
ntak f h n (f h x y z n)
(f h x y z (n+1)... | |
239c0d101074f9e16ae52dc7ef0e06d06f26009efbb9cd2ebf8e814b1a9231e2 | ds-wizard/engine-backend | Detail_Documents_Preview_GET.hs | module Wizard.Api.Handler.Questionnaire.Detail_Documents_Preview_GET where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Shared.Model.Error.Error
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.TemporaryFile.TemporaryFileDTO
import Wizard.Api.Resource.... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/c6f40dc565c19d4b6672c5583d9cdc17c0549246/engine-wizard/src/Wizard/Api/Handler/Questionnaire/Detail_Documents_Preview_GET.hs | haskell | module Wizard.Api.Handler.Questionnaire.Detail_Documents_Preview_GET where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Shared.Model.Error.Error
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.TemporaryFile.TemporaryFileDTO
import Wizard.Api.Resource.... | |
fb51a7edaa03b0ea869fce190529e2207e883fbd3e71e026b67d841dbfced070 | ladderlife/cambo | utils.cljc | (ns cambo.utils)
#?(:clj
(defn- cljs-env? [env]
(boolean (:ns env))))
#?(:clj
(defmacro if-cljs
"Return `then` if we are generating cljs code and `else` for Clojure code."
[then else]
(if (cljs-env? &env) then else)))
| null | https://raw.githubusercontent.com/ladderlife/cambo/73b01aee04dc6a8b573783118c43c4d0508a4138/src/cambo/utils.cljc | clojure | (ns cambo.utils)
#?(:clj
(defn- cljs-env? [env]
(boolean (:ns env))))
#?(:clj
(defmacro if-cljs
"Return `then` if we are generating cljs code and `else` for Clojure code."
[then else]
(if (cljs-env? &env) then else)))
| |
0034ced3e3d51cc991facc0ce2e2037c574491e25c74893cd0404631dce67f00 | webyrd/n-grams-for-synthesis | srfi-3-reference.scm | ;;; Scheme Underground list-set library -*- Scheme -*-
;;;
Copyright ( c ) 1998 by . You may do as you please with
;;; this code as long as you do not remove this copyright notice or
;;; hold me liable for its use. Please send bug reports to .
;;; -Olin
;;; SRFI DRAFT -- SRFI DRAFT -- SRFI DRAFT -- SRFI DRA... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-3/srfi-3-reference.scm | scheme | Scheme Underground list-set library -*- Scheme -*-
this code as long as you do not remove this copyright notice or
hold me liable for its use. Please send bug reports to .
-Olin
SRFI DRAFT -- SRFI DRAFT -- SRFI DRAFT -- SRFI DRAFT -- SRFI DRAFT
production code, you've got obsolete, bad source -- go find t... | Copyright ( c ) 1998 by . You may do as you please with
This is * draft * code for a SRFI proposal . If you see this notice in
lset - union = list1 ...
lset - xor = list1 ...
lset - diff+intersection = list1 list2 ...
intersection { , q , v } { , ! } : ...
list - difference { , q , v } { , ! } : .... |
bf40ef32ecc1ac2b3fa7bb28c02cd520346afa883cf3cff4c15df6ae2a4acaa1 | plumatic/dommy | utils.clj | (ns dommy.utils
(:require
[clojure.string :as str]))
(defn as-str
"Coerces strings and keywords to strings, while preserving namespace of
namespaced keywords"
[s]
(if (keyword? s)
(str (some-> (namespace s) (str "/")) (name s))
s))
(defn constant? [data]
(some #(% data) [number? keyword? strin... | null | https://raw.githubusercontent.com/plumatic/dommy/ba5a6f31bc185c32c851e052091f315114ead088/src/dommy/utils.clj | clojure | (ns dommy.utils
(:require
[clojure.string :as str]))
(defn as-str
"Coerces strings and keywords to strings, while preserving namespace of
namespaced keywords"
[s]
(if (keyword? s)
(str (some-> (namespace s) (str "/")) (name s))
s))
(defn constant? [data]
(some #(% data) [number? keyword? strin... | |
0162b111d5b08a8ebcc40623b299895d98c7db370e51bc9931093a7759e88a91 | iamFIREcracker/adventofcode | day11.lisp | (defpackage :aoc/2018/11 #.cl-user::*aoc-use*)
(in-package :aoc/2018/11)
(defun power-level (x y serial-number)
(let ((rack-id (+ x 10)))
(->< rack-id
(* >< y)
(+ >< serial-number)
(* >< rack-id)
(mod (floor >< 100) 10)
(- >< 5))))
(defun power-grid (size serial-number)
(let* ((g... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/c395df5e15657f0b9be6ec555e68dc777b0eb7ab/src/2018/day11.lisp | lisp | (defpackage :aoc/2018/11 #.cl-user::*aoc-use*)
(in-package :aoc/2018/11)
(defun power-level (x y serial-number)
(let ((rack-id (+ x 10)))
(->< rack-id
(* >< y)
(+ >< serial-number)
(* >< rack-id)
(mod (floor >< 100) 10)
(- >< 5))))
(defun power-grid (size serial-number)
(let* ((g... | |
fd5a3785a5a8124db545c0e851481f18cd27bd4887e38dacbf7871ba40e3734a | TensorWrench/lager_extras | lager_json_formatter.erl | % Copyright 2012 Tensor Wrench LLC. All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
%
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions an... | null | https://raw.githubusercontent.com/TensorWrench/lager_extras/74f15872b0562302b3cd08280c072ec5e6a03a88/src/lager_json_formatter.erl | erlang | Copyright 2012 Tensor Wrench LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the fol... |
* Neither the name of TensorWrench , LLC nor the names of its
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVIC... |
b0e7b4c6056f8ee53e6f717d4eed4d4ec1fb5c72c803d3da6d5a8e59d4b8506e | smallmelon/sdzmmo | lib_pet.erl | %%%--------------------------------------
%%% @Module : lib_pet
@Author : shebiao
%%% @Email :
@Created : 2010.07.03
%%% @Description : 宠物信息
%%%--------------------------------------
-module(lib_pet).
-include("common.hrl").
-include("record.hrl").
-compile(export_all).
%%======================... | null | https://raw.githubusercontent.com/smallmelon/sdzmmo/254ff430481de474527c0e96202c63fb0d2c29d2/src/lib/lib_pet.erl | erlang | --------------------------------------
@Module : lib_pet
@Email :
@Description : 宠物信息
--------------------------------------
=========================================================================
SQL定义
=========================================================================
------------------------... | @Author : shebiao
@Created : 2010.07.03
-module(lib_pet).
-include("common.hrl").
-include("record.hrl").
-compile(export_all).
-define(SQL_PLAYER_UPDATE_DEDUCT_GOLD, "update player set gold = gold-~p where id = ~p").
-define(SQL_PLAYER_UPDATE_EXTENT_QUE, "update player set gold = gold-~... |
e341ef71a6a9334096778a3e1c975948e38ef1e8ec1e2d8e01350155ccd0ed69 | inhabitedtype/ocaml-aws | restoreDBInstanceToPointInTime.mli | open Types
type input = RestoreDBInstanceToPointInTimeMessage.t
type output = RestoreDBInstanceToPointInTimeResult.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/restoreDBInstanceToPointInTime.mli | ocaml | open Types
type input = RestoreDBInstanceToPointInTimeMessage.t
type output = RestoreDBInstanceToPointInTimeResult.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| |
c01eb541df8e0e1393492e631602c9dee3187c096699f7fe50939d3fa2879f8b | diagrams/diagrams-cairo | Explode.hs | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
u = vrule 1 # reflectY
r = hrule 1
tr = mconcat [u, u, r, u, r, r, r, u]
ps = explodeTrail origin tr
d = strokeT tr
# lc red
# centerXY
d2 = ps
# map assignColor
# map (\(p,c) -> lc c . stroke $ ... | null | https://raw.githubusercontent.com/diagrams/diagrams-cairo/533e4f4f18f961543bb1d78493c750dec45fd4a3/test/Explode.hs | haskell | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
u = vrule 1 # reflectY
r = hrule 1
tr = mconcat [u, u, r, u, r, r, r, u]
ps = explodeTrail origin tr
d = strokeT tr
# lc red
# centerXY
d2 = ps
# map assignColor
# map (\(p,c) -> lc c . stroke $ ... | |
f17bcbbb2149a7aa22fe71f773ae873ff785021c1c3c06f61f9f6bed94791c3b | froggey/Mezzano | float.lisp | ;;;; Floating point numbers
(in-package :mezzano.internals)
;;; Short-Floats
(defun %integer-as-short-float (value)
(check-type value (unsigned-byte 16))
(let ((result (mezzano.runtime::%allocate-object
sys.int::+object-tag-short-float+ 0 1 nil)))
(setf (%object-ref-unsigned-byte-16 result 0... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/system/numbers/float.lisp | lisp | Floating point numbers
Short-Floats
see
float_to_half_fast3_rtne
just works.
resulting mantissa is odd
take the bits!
half_to_float
exponent mask after shift
exponent/mantissa bits
just the exponent
exponent adjust
handle exponent special cases
extra exp adjust
Zero/Denormal?
extra exp adjust
renormal... |
(in-package :mezzano.internals)
(defun %integer-as-short-float (value)
(check-type value (unsigned-byte 16))
(let ((result (mezzano.runtime::%allocate-object
sys.int::+object-tag-short-float+ 0 1 nil)))
(setf (%object-ref-unsigned-byte-16 result 0) value)
result))
(defun %short-float-as... |
3a12da9e817bc8d00eb99c85ad97f02d2636a5d3f9dbf6bb8be679285f0d967c | futurice/haskell-mega-repo | HoursMock.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
module Futurice.App.H... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/hours-api/src/Futurice/App/HoursMock.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
same as in real! | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
module Futurice.App.HoursMock (defaultMain) where
import Futurice.Prelude
import Futurice.Servant
import Prelude ()
import Servant
import Futurice.App.HoursApi.API
import Futu... |
3d682c96d130a0d4d2d449f8faef591d3493956d24dac1f5dbeb27a500840f6e | d-plaindoux/transept | transept_stream.mli | (** The [Transept_streams] provides an implementation on top of elements list
and on top of a parser. In addition [Iterator] can be derived from these
streams. *)
module Via_list = List.Via_list
(** Define stream construction from elements list source. *)
module Via_parser = Parser.Make
(** Define stream cons... | null | https://raw.githubusercontent.com/d-plaindoux/transept/8567803721f6c3f5d876131b15cb301cb5b084a4/lib/transept_stream/transept_stream.mli | ocaml | * The [Transept_streams] provides an implementation on top of elements list
and on top of a parser. In addition [Iterator] can be derived from these
streams.
* Define stream construction from elements list source.
* Define stream construction from parser.
* Define iterator generator/ |
module Via_list = List.Via_list
module Via_parser = Parser.Make
module Iterator = Iterator.Make
|
61a2c5025d573689a2c99ef91d11ccc86241c7adbb0c8d6913625935c4a32f71 | sjl/cl-nrepl | evaluation.lisp | (in-package :nrepl)
(defvar *last-trace* nil)
(define-condition evaluation-error (error)
((text :initarg :text :reader text)
(orig :initarg :orig :reader orig)
(data :initarg :data :reader data :initform ())))
(defclass evaluator ()
((standard-input :initarg :in :reader in)
(standard-output :initarg :ou... | null | https://raw.githubusercontent.com/sjl/cl-nrepl/20a71458344a721d605c349b92268879bdfc98a1/src/evaluation.lisp | lisp | if we hit an error, get the stack trace before reraising. if we | (in-package :nrepl)
(defvar *last-trace* nil)
(define-condition evaluation-error (error)
((text :initarg :text :reader text)
(orig :initarg :orig :reader orig)
(data :initarg :data :reader data :initform ())))
(defclass evaluator ()
((standard-input :initarg :in :reader in)
(standard-output :initarg :ou... |
94db01618ce6e46be05d6f31b08622aef8cde9909f4d74cb8e24b6d8507d32db | synduce/Synduce | mul.ml | type 'a tree =
| TNil
| TNode of 'a * 'a tree * 'a tree
type 'a list =
| LNil
| Cons of 'a * 'a list
type 'a ptree =
| PNil
| PNode of 'a * 'a ptree list
let rec target = function
| PNil -> 1
| PNode (a, l) -> [%synt join] a (prod l)
and prod = function
| LNil -> 1
| Cons (hd, tl) -> [%synt j2] ... | null | https://raw.githubusercontent.com/synduce/Synduce/11e9eb1d420113ae85ec63399dd493034c51a354/benchmarks/ptree/mul.ml | ocaml | type 'a tree =
| TNil
| TNode of 'a * 'a tree * 'a tree
type 'a list =
| LNil
| Cons of 'a * 'a list
type 'a ptree =
| PNil
| PNode of 'a * 'a ptree list
let rec target = function
| PNil -> 1
| PNode (a, l) -> [%synt join] a (prod l)
and prod = function
| LNil -> 1
| Cons (hd, tl) -> [%synt j2] ... | |
9e11f783104cfdbd9e2699ce21158d46b1244883c7da46713323f031b8194b4b | Helium4Haskell/helium | Lambda1.hs |
main :: Bool -> ()
main = \True -> ()
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/staticwarnings/Lambda1.hs | haskell |
main :: Bool -> ()
main = \True -> ()
| |
0a22b26a5c9d01f28827d6375c6742e538cfc67ef4ff3effd6913360556cb15e | puppetlabs/clj-i18n | overlapping-packages.clj | ;; This is a sample of the locales.clj file that the current version fo the
;; Makefile generates.
It is used by the tests in core_test.clj .
{
:locales #{"es"}
alt3rnate3.i18n has the same length as , dexample.i18n . * overlaps with multi-package-es.clj
:packages ["example.i18n.another_package" "example" "ex... | null | https://raw.githubusercontent.com/puppetlabs/clj-i18n/3f56f2b2be40aacd2dae09f32d5e6f97a12c363b/dev-resources/test-locales/overlapping-packages.clj | clojure | This is a sample of the locales.clj file that the current version fo the
Makefile generates. | It is used by the tests in core_test.clj .
{
:locales #{"es"}
alt3rnate3.i18n has the same length as , dexample.i18n . * overlaps with multi-package-es.clj
:packages ["example.i18n.another_package" "example" "example.i18n.another_package" "alt3rnat3.i18n"]
:bundle "overlapped_package.i18n.Messages"
}
|
aa78ea9bc839258120a201a58642159788f51d5bf097a0825da42e92ddf17843 | avsm/mirage-duniverse | handshake_server.mli | open State
val hello_request : handshake_state -> handshake_return eff
val handle_change_cipher_spec : server_handshake_state -> handshake_state -> Cstruct.t -> handshake_return eff
val handle_handshake : server_handshake_state -> handshake_state -> Cstruct.t -> handshake_return eff
| null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/tls/lib/handshake_server.mli | ocaml | open State
val hello_request : handshake_state -> handshake_return eff
val handle_change_cipher_spec : server_handshake_state -> handshake_state -> Cstruct.t -> handshake_return eff
val handle_handshake : server_handshake_state -> handshake_state -> Cstruct.t -> handshake_return eff
| |
610acfde51af9d910749a74abb762dae3e8a1492d18f2e898f6b4c39e6c55281 | haskell/wreq | JsonResponse.hs | -- Examples of handling for JSON responses
--
-- This library provides several ways to handle JSON responses
# LANGUAGE DeriveGeneric , OverloadedStrings , ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - unused - binds #
import Control.Lens ((&), (^.), (^?), (.~))
import Data.Aeson (FromJSON)
import Data.Aeson.Lens... | null | https://raw.githubusercontent.com/haskell/wreq/2da0070625a680d5af59e36c3ca253ef6a80aea9/examples/JsonResponse.hs | haskell | Examples of handling for JSON responses
This library provides several ways to handle JSON responses
from httpbin.org.
We expect this to succeed.
The fact that we want a GetBody here will be inferred by our use
of the "headers" accessor function.
The response we expect here is valid JSON, but cannot be converted... |
# LANGUAGE DeriveGeneric , OverloadedStrings , ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - unused - binds #
import Control.Lens ((&), (^.), (^?), (.~))
import Data.Aeson (FromJSON)
import Data.Aeson.Lens (key)
import Data.Map (Map)
import Data.Text (Text)
import GHC.Generics (Generic)
import qualified Control.E... |
94f03fd192ecf300b04d0b798c36a8b419819442b0c8bac330a7e6e977a5e551 | KULeuven-CS/CPL | IMPLICITREFS-CONT.rkt | #lang eopl
(require "syntax.rkt")
(provide (all-defined-out))
Semantics
;;; an expressed value is either a number, or a boolean.
(define-datatype expval expval?
(num-val
(value number?))
(bool-val
(boolean boolean?))
(proc-val
(proc proc?)))
(define expval->string
(lambda (v)
(cases expval v
... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter5/5.9%20IMPLICITREFS-CONT/IMPLICITREFS-CONT.rkt | racket | an expressed value is either a number, or a boolean.
proc? : SchemeVal -> Bool
procedure : Var * Exp * Env -> Proc
expval->num : ExpVal -> Int
expval->bool : ExpVal -> Bool
expval->proc : ExpVal -> Proc
Environments
init-env : () -> Env
(init-env) builds an environment in which i is bound to the
Continuations... | #lang eopl
(require "syntax.rkt")
(provide (all-defined-out))
Semantics
(define-datatype expval expval?
(num-val
(value number?))
(bool-val
(boolean boolean?))
(proc-val
(proc proc?)))
(define expval->string
(lambda (v)
(cases expval v
(num-val (num) (string-append "Number: " (number->st... |
bee90f5b7b190e45889007946ad77a3a9bae68d9cbd250a060ada395a47f30e1 | semilin/layoup | adept.lisp |
(MAKE-LAYOUT :NAME "adept" :MATRIX (APPLY #'KEY-MATRIX 'NIL) :SHIFT-MATRIX NIL
:KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/adept.lisp | lisp |
(MAKE-LAYOUT :NAME "adept" :MATRIX (APPLY #'KEY-MATRIX 'NIL) :SHIFT-MATRIX NIL
:KEYBOARD NIL) | |
fb56ce67c0f55d1271977f0f684e2505c4d3a789ed58be599a15dbe39ccbd1a8 | fossas/fossa-cli | DumpBinaries.hs | module App.Fossa.DumpBinaries (
dumpSubCommand,
) where
import App.Fossa.Config.DumpBinaries (
DumpBinsConfig (..),
DumpBinsOpts,
mkSubCommand,
)
import App.Fossa.EmbeddedBinary (allBins, dumpEmbeddedBinary)
import App.Fossa.Subcommand (SubCommand)
import Control.Effect.Lift (Has, Lift)
import Data.Foldable (... | null | https://raw.githubusercontent.com/fossas/fossa-cli/756a76f02f53f28cfc05e799aa6d474cc8da2d20/src/App/Fossa/DumpBinaries.hs | haskell | module App.Fossa.DumpBinaries (
dumpSubCommand,
) where
import App.Fossa.Config.DumpBinaries (
DumpBinsConfig (..),
DumpBinsOpts,
mkSubCommand,
)
import App.Fossa.EmbeddedBinary (allBins, dumpEmbeddedBinary)
import App.Fossa.Subcommand (SubCommand)
import Control.Effect.Lift (Has, Lift)
import Data.Foldable (... | |
447cb88623c31b3b5411c0ef41dec31bebb144b37ea689de4db15ac7cb40b049 | racket/math | flonum-search.rkt | #lang typed/racket/base
(require "flonum-constants.rkt"
"flonum-functions.rkt"
"flonum-bits.rkt")
(provide find-least-flonum flfind-least-integer)
(define +inf-ordinal (flonum->ordinal +inf.0))
(: find-least-flonum (case-> ((Flonum -> Any) Flonum -> (U Flonum #f))
((Fl... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/flonum/flonum-search.rkt | racket | Finds the least integer k such that (pred? k) is #t, given optional bounds and an optional
initial estimate. If the predicate is not monotone in the bounds, the result of this function is
indeterminate, and depends in an unspecified way on the initial estimate.
Make sure the initial estimate is in-bounds
Find an i... | #lang typed/racket/base
(require "flonum-constants.rkt"
"flonum-functions.rkt"
"flonum-bits.rkt")
(provide find-least-flonum flfind-least-integer)
(define +inf-ordinal (flonum->ordinal +inf.0))
(: find-least-flonum (case-> ((Flonum -> Any) Flonum -> (U Flonum #f))
((Fl... |
bab048981bd3be712f799d102a89bd820bbf493085f2025beabe914721584e81 | vyos/vyconf | vylist_test.ml | open OUnit2
open Vylist
(* Searching for an element that is in the list gives Some that_element *)
let test_find_existent test_ctxt =
let xs = [1; 2; 3; 4] in
assert_equal (find (fun x -> x = 3) xs) (Some 3)
(* Searching for an element that is not in the list gives None *)
let test_find_nonexistent test_ctxt ... | null | https://raw.githubusercontent.com/vyos/vyconf/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/test/vylist_test.ml | ocaml | Searching for an element that is in the list gives Some that_element
Searching for an element that is not in the list gives None
Removing an element that exists in the list makes a list without that element
Trying to remove an element that is not in the list doesn't change the list
Replacing an element works
... | open OUnit2
open Vylist
let test_find_existent test_ctxt =
let xs = [1; 2; 3; 4] in
assert_equal (find (fun x -> x = 3) xs) (Some 3)
let test_find_nonexistent test_ctxt =
let xs = [1; 2; 4] in
assert_equal (find (fun x -> x = 3) xs) None
let test_remove_existent test_ctct =
let xs = [1; 2; 3; 4] ... |
1476b775f384e36b11fb1ad26d039751abdf3cdc85d43c6c093b4f7ee494b3ba | syntax-objects/syntax-parse-example | multi-check-true-test.rkt | #lang racket/base
(module+ test
(require rackunit syntax-parse-example/multi-check-true/multi-check-true)
(multi-check-true
#t
(and #true #true)
(or #false #true)
(= 4 (+ 2 2)))
)
| null | https://raw.githubusercontent.com/syntax-objects/syntax-parse-example/0675ce0717369afcde284202ec7df661d7af35aa/multi-check-true/multi-check-true-test.rkt | racket | #lang racket/base
(module+ test
(require rackunit syntax-parse-example/multi-check-true/multi-check-true)
(multi-check-true
#t
(and #true #true)
(or #false #true)
(= 4 (+ 2 2)))
)
| |
b7a20f6d59bab66a3db4aa5c336c3bc97e7e46571dd1c65da5e5d18865369cd7 | askvortsov1/hardcaml-mips | test_memory.ml | open Hardcaml
open Hardcaml_waveterm
open Mips.Memory
module Simulator = Cyclesim.With_interface (I) (O)
type test_input = {
write_enable : string;
write_data : string;
data_address : string;
}
let testbench () =
let scope = Scope.create ~flatten_design:true () in
let sim = Simulator.create (circuit_impl sc... | null | https://raw.githubusercontent.com/askvortsov1/hardcaml-mips/c94e0a8907ba4214f05e615a8e1407acc1777f15/test/io/test_memory.ml | ocaml | Memory should be 0 since everything has been disabled so far | open Hardcaml
open Hardcaml_waveterm
open Mips.Memory
module Simulator = Cyclesim.With_interface (I) (O)
type test_input = {
write_enable : string;
write_data : string;
data_address : string;
}
let testbench () =
let scope = Scope.create ~flatten_design:true () in
let sim = Simulator.create (circuit_impl sc... |
edd972b190212aa277af9f72c6839b1228c0876626e7cbc05fb62f4ff29b795f | fission-codes/fission | Types.hs | module Fission.Web.Server.MonadDB.Types (Transaction) where
import Database.Persist.Sql
import RIO
type Transaction m = ReaderT SqlBackend m
| null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-web-server/library/Fission/Web/Server/MonadDB/Types.hs | haskell | module Fission.Web.Server.MonadDB.Types (Transaction) where
import Database.Persist.Sql
import RIO
type Transaction m = ReaderT SqlBackend m
| |
762ea46a7acff6efec874d8b4ab4683e1038af0946074c66f07b5bc2f8d0256f | odis-labs/helix | Ppx.ml | Based on -re/melange/pull/396/files
module OCaml_Location = Location
open Ppxlib
module Helper = Ppxlib.Ast_helper
let pr fmt = Format.kasprintf (fun x -> prerr_endline x) fmt
module Builder = struct
Ast_builder . Default assigns attributes to be the empty .
This wrapper re - exports all used fns with attr... | null | https://raw.githubusercontent.com/odis-labs/helix/05d59aa6c13621275c31953a3515ee8843508f9e/src/helix-ppx/Ppx.ml | ocaml | []
_::_
not a list, XXX: is this possible?
~l
no children provided? Place a placeholder list
TODO: some line number might still be wrong
text/int/float
[@JSX] div(~children=[a]), coming from <div> a </div>
[|moreelem_fsHere|]
[@JSX] div(~children=value), <div> ...(value) </div>
[|moreelem_fsHere|] ... | Based on -re/melange/pull/396/files
module OCaml_Location = Location
open Ppxlib
module Helper = Ppxlib.Ast_helper
let pr fmt = Format.kasprintf (fun x -> prerr_endline x) fmt
module Builder = struct
Ast_builder . Default assigns attributes to be the empty .
This wrapper re - exports all used fns with attr... |
14b90923be10e27d5685213fbcdb7328f9acf4f0bbfea17c914f629b8df71e87 | dasuxullebt/uxul-world | game-object.lisp | Copyright 2009 - 2011
(in-package :uxul-world)
;; Define a class for the Standard Game-Object which has a draw-Method
;; which will be called at every frame, and a Collision-Box, and has a
unique ( x , y)-Coordinate with translations for both the
;; Object and the collision-box
We changed the api , and adde... | null | https://raw.githubusercontent.com/dasuxullebt/uxul-world/f05e44b099e5976411b3ef1f980ec616bd221425/game-object.lisp | lisp | Define a class for the Standard Game-Object which has a draw-Method
which will be called at every frame, and a Collision-Box, and has a
Object and the collision-box
explains some documentation about it)
:type boolean
:type boolean
:type boolean
(sdl:draw-rectangle-* (+ (x obj) *current-translation-... | Copyright 2009 - 2011
(in-package :uxul-world)
unique ( x , y)-Coordinate with translations for both the
We changed the api , and added stuff from Collision - Rectangle ( which
(defclass game-object (xy-coordinates)
((width :initarg :width
:initform 0
:accessor width
:type fixnum
:documentati... |
0bba285c3a4c9329f14e613413177489576b4d547113fa979e0623c97d0d7f54 | escherize/bengine | app.cljs | (ns ^:figwheel-always bengine.app
(:require
[bengine.core :as core]
[cljs.nodejs :as node]
[mount.core :as mount]))
(enable-console-print!)
(mount/in-cljc-mode)
(cljs.nodejs/enable-util-print!)
(.on js/process "uncaughtException" #(js/console.error %))
(set! *main-cli-fn* core/main)
| null | https://raw.githubusercontent.com/escherize/bengine/ed9ae4adc31b47e9d4c330f03f697cc8bc74aa8e/env/dev/bengine/app.cljs | clojure | (ns ^:figwheel-always bengine.app
(:require
[bengine.core :as core]
[cljs.nodejs :as node]
[mount.core :as mount]))
(enable-console-print!)
(mount/in-cljc-mode)
(cljs.nodejs/enable-util-print!)
(.on js/process "uncaughtException" #(js/console.error %))
(set! *main-cli-fn* core/main)
| |
2da9b9d6741c4789c4bbb5c49b0c1c23ad873ee89096a6cece29b82435540c74 | linyinfeng/myml | Typing.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
module Myml.Typing
( NewVar (..),
TypingEnv,
Inference,
InferenceState (..),
MonadUnify,
MonadInference,
newVar,
runInference,
runInfer... | null | https://raw.githubusercontent.com/linyinfeng/myml/1220a1474784eebce9ff95f46a3ff0a5f756e9a7/src/Myml/Typing.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE RankNTypes #
main infer function
instantiate and generalize
unify
describe
union = unionWith const
instantiate mu type in scheme
this step replace all Presents only appear in covariant location to a fresh variable
check kind conflicts
record extend and update
match valu... | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
module Myml.Typing
( NewVar (..),
TypingEnv,
Inference,
InferenceState (..),
MonadUnify,
MonadInference,
newVar,
runInference,
runInferenceT,
infer,
instantiate,
instantiateType,
i... |
52d00d54e3c3b5238ccd04bb4e3a6389462470df9a076592882ade8ce494a6d6 | marick/structural-typing | predicate_defining.clj | (ns structural-typing.assist.predicate-defining
"Helpers for defining custom predicates. See `structural-typing.preds` for examples of use."
(:use structural-typing.clojure.core)
(:require [structural-typing.assist.oopsie :as oopsie]
[structural-typing.assist.format :as format]
[structural... | null | https://raw.githubusercontent.com/marick/structural-typing/9b44c303dcfd4a72c5b75ec7a1114687c809fba1/src/structural_typing/assist/predicate_defining.clj | clojure | (ns structural-typing.assist.predicate-defining
"Helpers for defining custom predicates. See `structural-typing.preds` for examples of use."
(:use structural-typing.clojure.core)
(:require [structural-typing.assist.oopsie :as oopsie]
[structural-typing.assist.format :as format]
[structural... | |
8b937d10a1f3d695256e93b1e29e46812663f56bd4b61ca9f78d395fe6d88ad5 | kind2-mc/kind2 | lustreExpr.ml | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... | null | https://raw.githubusercontent.com/kind2-mc/kind2/85f11c69378681d5c8b4294308e23024f348d10d/src/lustre/lustreExpr.ml | ocaml | Abbreviations
Exceptions
A Lustre expression is a term
Lift of [Term.is_true].
A Lustre type is a type
Lustre expression for the initial state
Lustre expression after initial state
Type of expression
Keep the type here instead of reading from expr_init or
expr_step, otherwise we need to get bo... | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... |
0cca168883585a3e211c95fd29b9c0d746246a8a8e8fbf3c946d3bfe1dd27eac | RDTK/generator | aspects.lisp | aspects.lisp --- Aspect extensions used in the module .
;;;;
Copyright ( C ) 2018 - 2022 Jan Moringen
;;;;
Author : < >
(cl:in-package #:build-generator.deployment.build)
(defun step-name (aspect)
(format nil "~{~A~^.~}" (reverse (model:ancestor-names aspect))))
(defmethod aspects::step-constraints ((asp... | null | https://raw.githubusercontent.com/RDTK/generator/8d9e6e47776f2ccb7b5ed934337d2db50ecbe2f5/src/deployment/build/aspects.lisp | lisp |
Apply aspects, respecting declared ordering. Translate builder
ordering constraints into step dependencies.
Methods on `extend!' add entries to `*step-constraints*' and
call (add-step STEP OUTPUT).
Individual aspect classes | aspects.lisp --- Aspect extensions used in the module .
Copyright ( C ) 2018 - 2022 Jan Moringen
Author : < >
(cl:in-package #:build-generator.deployment.build)
(defun step-name (aspect)
(format nil "~{~A~^.~}" (reverse (model:ancestor-names aspect))))
(defmethod aspects::step-constraints ((aspect aspect... |
574273f14f69ad177d9e89f3a3c187b39c07f555568c582b01bae765516f6cc1 | helins/mprop.cljc | mprop.cljc | 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 /.
(ns helins.mprop
"Multiplexing `test.check` property and tracking failure.
See README for overview."
{:author "Adam Helinski"}
... | null | https://raw.githubusercontent.com/helins/mprop.cljc/1d7d7e1e06bc2c45e6dc82c0ab83ebbd7e8271fc/src/main/helins/mprop.cljc | clojure | Defining tests
Used by [[check]], must be kept public. | 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 /.
(ns helins.mprop
"Multiplexing `test.check` property and tracking failure.
See README for overview."
{:author "Adam Helinski"}
... |
cee7316b637eefa4d29edaeaf7abc9a3b26c74517575178c02e99fc0676fdb76 | metosin/testit | facts_example.clj | (ns example.facts-example
(:require [clojure.test :refer :all]
[testit.core :refer :all]))
(deftest group-multiple-assertions
(facts "simple match tests"
(+ 1 2) => 3
(* 21 2) => 42
(+ 623 714) => 1337))
| null | https://raw.githubusercontent.com/metosin/testit/85c9cfc9629f44d13e9b16fe25175235ae1e39e1/examples/example/facts_example.clj | clojure | (ns example.facts-example
(:require [clojure.test :refer :all]
[testit.core :refer :all]))
(deftest group-multiple-assertions
(facts "simple match tests"
(+ 1 2) => 3
(* 21 2) => 42
(+ 623 714) => 1337))
| |
c0e7354f25487dc7c02d9eff8e251ef74cbff7d5ecfa03036096dad012ffcad4 | mpickering/apply-refact | Default43.hs | no = elem 1 [] : [] | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Default43.hs | haskell | no = elem 1 [] : [] | |
3acc3e79f71011dbcc8db9f65080079b7c6d51c7384b758383914875bda24ab1 | phuhl/linux_notification_center | Glade.hs | {-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
module NotificationCenter.Glade where
import Data.String.Here.Uninterpolated (hereFile)
glade =
[hereFile|notification_center.glade|]
| null | https://raw.githubusercontent.com/phuhl/linux_notification_center/640ce0fc05a68f2c28be3d9f27fe73516d4332f9/src/NotificationCenter/Glade.hs | haskell | # LANGUAGE QuasiQuotes, OverloadedStrings # |
module NotificationCenter.Glade where
import Data.String.Here.Uninterpolated (hereFile)
glade =
[hereFile|notification_center.glade|]
|
a2568a70cba3085623e86c720a9d4e6055b3368bae9cc3838cc2957ec5f58243 | jumarko/web-development-with-clojure | layout.clj | ;---
Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
; courses, books, articles, and the like. Contact us if you are in doubt.
; We make no guarantees that this code is fit fo... | null | https://raw.githubusercontent.com/jumarko/web-development-with-clojure/dfff6e40c76b64e9fcd440d80c7aa29809601b6b/code/picture-gallery-colors/src/clj/picture_gallery/layout.clj | clojure | ---
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
(ns picture-gallery.layout
(:require [selmer.parser :as parser]
[selmer.filters :as filters]
[markdow... |
5a9ac96f75b0742950130d17faadff7d80de1c42c74e67a8764236225b6651e1 | erlang-ls/erlang_ls | code_navigation.erl | -module(code_navigation).
-behaviour(behaviour_a).
-wildattribute(a).
-export([ function_a/0, function_b/0, function_g/1, function_j/0, 'PascalCaseFunction'/1, function_mb/0 ]).
%% behaviour_a callbacks
-export([ callback_a/0 ]).
-export_type([ type_a/0 ]).
-import(code_navigation_extra, [ do/1 ]).
-include("transiti... | null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/4ad07492c2f577da4a1fbd79877036f820d9e2c3/apps/els_lsp/priv/code_navigation/src/code_navigation.erl | erlang | behaviour_a callbacks
@doc Such a wonderful function.
atom highlighting and completion includes record fields
quoted atoms
[#1052] ?MODULE macro as record name | -module(code_navigation).
-behaviour(behaviour_a).
-wildattribute(a).
-export([ function_a/0, function_b/0, function_g/1, function_j/0, 'PascalCaseFunction'/1, function_mb/0 ]).
-export([ callback_a/0 ]).
-export_type([ type_a/0 ]).
-import(code_navigation_extra, [ do/1 ]).
-include("transitive.hrl").
-include("code_... |
73cf6f211b093b6282105337ef41a8f62bbfad0af3e69c67971738c2adee2c84 | manuel-serrano/hop | reflect.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / hopscript / reflect.scm * /
;* ------------------------------------------------------------- */
* Author : * /
;* Creation :... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/hopscript/reflect.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* Creation : Wed Dec 5 22:00:24 2018 */
* ------------------------------------------------------------- */
* -----------------------... | * serrano / prgm / project / hop / hop / hopscript / reflect.scm * /
* Author : * /
* Last change : Sun Mar 1 11:17:27 2020 ( serrano ) * /
* Copyright : 2018 - 20 * /
* Native Bigloo ... |
8b01a43ba1f9895ec943dab52e1b7beda49dd125ab9c1e2b6154d412845356e9 | albertoruiz/easyVision | roiclass.hs | -- detection of rois based on examples labeled by roisel
$ ./roiclass ' newvideo -benchmark ' test etc .
import EasyVision
import Graphics.UI.GLUT hiding (histogram)
import Control.Monad(when)
import System.Environment(getArgs)
import Numeric.LinearAlgebra
import Classifier
import Data.List(maximumBy)
import Util.M... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/old/tutorial/roiclass.hs | haskell | detection of rois based on examples labeled by roisel
shQuality test classifier | $ ./roiclass ' newvideo -benchmark ' test etc .
import EasyVision
import Graphics.UI.GLUT hiding (histogram)
import Control.Monad(when)
import System.Environment(getArgs)
import Numeric.LinearAlgebra
import Classifier
import Data.List(maximumBy)
import Util.Misc(vec)
import Util.Probability(evidence)
import Util
g... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.