_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 |
|---|---|---|---|---|---|---|---|---|
4fadb2e23d1bffc44a3be3dacda79fb9527b1da6bb7970c061268cc8b7e7baec | haskellari/qc-instances | CustomPrelude.hs | -- | Custom prelude.
--
-- We don't need much, and we don't care about precise types
( Monad or Applicative constraints , e.g. )
-- So this is simple approach.
--
module Test.QuickCheck.Instances.CustomPrelude (
module Export,
) where
import Control.Applicative as Export (Applicative (pure, (<*>)), (<$>))
import... | null | https://raw.githubusercontent.com/haskellari/qc-instances/94ec49f96c9afd7d29880c22bedfbabe01ad30d5/src/Test/QuickCheck/Instances/CustomPrelude.hs | haskell | | Custom prelude.
We don't need much, and we don't care about precise types
So this is simple approach.
lists
numbers
errors | ( Monad or Applicative constraints , e.g. )
module Test.QuickCheck.Instances.CustomPrelude (
module Export,
) where
import Control.Applicative as Export (Applicative (pure, (<*>)), (<$>))
import Data.Traversable as Export (Traversable (..))
import Prelude as Export
(Bounded (..), Either (..... |
8a02445e6d70b728b7bcbfdc48ba7f43617f4b36cbbeae5bca9d1392f18a99cd | hammerlab/biokepi | sambamba.ml | open Biokepi_run_environment
open Common
module Remove = Workflow_utilities.Remove
module Filter = struct
type t = [
`String of string
]
let of_string s =
`String s
let to_string f =
match f with
| `String s -> s
module Defaults = struct
let only_split_reads =
of_string "cigar =... | null | https://raw.githubusercontent.com/hammerlab/biokepi/d64eb2c891b41bda3444445cd2adf4e3251725d4/src/bfx_tools/sambamba.ml | ocaml | Filter language syntax at
-view%5D-Filter-expression-syntax | open Biokepi_run_environment
open Common
module Remove = Workflow_utilities.Remove
module Filter = struct
type t = [
`String of string
]
let of_string s =
`String s
let to_string f =
match f with
| `String s -> s
module Defaults = struct
let only_split_reads =
of_string "cigar =... |
781eb6d8a17a56bad0f7591085575fb3e687b54cf38c1cca2df47f7c11489d68 | antifuchs/cl-beanstalk | package.lisp | (defpackage :beanstalk
(:use)
(:export #:with-beanstalk-connection #:quit #:connect #:disconnect
;; Conditions:
#:beanstalk-error #:bad-reply #:beanstalkd-out-of-memory #:buried-job #:beanstalkd-draining
#:beanstalkd-internal-error #:bad-message-format #:expected-crlf #:unknown-comm... | null | https://raw.githubusercontent.com/antifuchs/cl-beanstalk/7b925a769d6e61fbcf0c122400146123f18e55cc/package.lisp | lisp | Conditions: | (defpackage :beanstalk
(:use)
(:export #:with-beanstalk-connection #:quit #:connect #:disconnect
#:beanstalk-error #:bad-reply #:beanstalkd-out-of-memory #:buried-job #:beanstalkd-draining
#:beanstalkd-internal-error #:bad-message-format #:expected-crlf #:unknown-command
#:deadline-... |
41eebb62ef7a63acf61344a4889a8b48a92d436694a271d75d7116d63ec7b5a1 | davidlazar/ocaml-semantics | fun02.ml | (fun x -> x - x) (-42)
| null | https://raw.githubusercontent.com/davidlazar/ocaml-semantics/6f302c6b9cced0407d501d70ad25c2d2aefbb77d/tests/unit/fun02.ml | ocaml | (fun x -> x - x) (-42)
| |
4aa9681b7b429800b573a6cbfa7a7cda99428046b21aca191ccdea0b0295d099 | evancz/elm-project-survey | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Prelude hiding (lines)
import qualified Control.Monad as M
import Data.Aeson ((.=))
import qualified Data.Aeson as Json
import Data.Binary (get, put)
import qualified Data.Binary as Binary
import qualified Data.ByteString.Lazy as LBS
import qualified ... | null | https://raw.githubusercontent.com/evancz/elm-project-survey/ccd96187ca1e1ddee26a491cdc480337bc944302/2-process/src/Main.hs | haskell | # LANGUAGE OverloadedStrings #
MAIN
Create a directory called logs/ that contains all of the build.log files
submitted to -project-survey/issues
This code generates a file called results.json that has all the data in
RESULTS
JSON | module Main (main) where
import Prelude hiding (lines)
import qualified Control.Monad as M
import Data.Aeson ((.=))
import qualified Data.Aeson as Json
import Data.Binary (get, put)
import qualified Data.Binary as Binary
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Map as Map
import qualified Sy... |
805741f29175fb472f332961c143f5105dfe01a7de464272f3605e7a1eff731f | cryptosense/enumerators | enumerator.ml | type 'a t =
{
size : Beint.t;
nth : Beint.t -> 'a;
shape : string; (* how the enumerator was created, useful for debugging *)
depth : int (* number of composed functions to create values, useful for debugging *)
}
exception Out_of_bounds
let nth s i =
let i = Beint.of_int64 i in
if Beint.lt i ... | null | https://raw.githubusercontent.com/cryptosense/enumerators/0ba393e993a3a1574453395a5a424a3bccda522c/src/enumerator.ml | ocaml | how the enumerator was created, useful for debugging
number of composed functions to create values, useful for debugging
* [range a b] produces an enumerator for the integers between [a] and [b] included. If
[b < a], the enumerator is empty.
optimization
optimization
optimization
Return an equivalent s... | type 'a t =
{
size : Beint.t;
nth : Beint.t -> 'a;
}
exception Out_of_bounds
let nth s i =
let i = Beint.of_int64 i in
if Beint.lt i s.size && Beint.(le zero i)
then s.nth i
else raise Out_of_bounds
let is_empty s =
Beint.equal Beint.zero s.size
let size s =
Beint.to_int64 s.size
let size_i... |
3a3d9f8df25bcafbaf78b68370e58c77174b2a99b0f722074a263dd2c7c6c241 | achirkin/vulkan | ProcessVkXml.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE Strict #-}
module ProcessVkXml
( processVkXmlFile
, generateVkSource
, processVulkanHFile
) where
import Control.Monad (unless)
import Control.Monad.Trans.Resource
import D... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/genvulkan/src/ProcessVkXml.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE Strict #
^ path to vk.xml
^ output directory for saving generated sources
^ path to cabal file to generate
^ input file vulkan.h from submodule
^ outout file vulkan.h in includes | module ProcessVkXml
( processVkXmlFile
, generateVkSource
, processVulkanHFile
) where
import Control.Monad (unless)
import Control.Monad.Trans.Resource
import Data.Conduit
import Data.Conduit.Binary (sourceFile)
import Data.Semigroup
im... |
aa355175044702fe3c11e6478c4f51752fa4b3a90f9aa661b221f0834a662cc8 | EFanZh/EOPL-Exercises | exercise-4.26.rkt | #lang eopl
;; Exercise 4.26 [★★★] Extend the solution to the preceding exercise so that procedures declared in a single block
;; aremutually recursive. Consider restricting the language so that the variable declarations in a block are followed by
;; the procedure declarations.
;; Grammar.
(define the-lexical-spec
... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-4.26.rkt | racket | Exercise 4.26 [★★★] Extend the solution to the preceding exercise so that procedures declared in a single block
aremutually recursive. Consider restricting the language so that the variable declarations in a block are followed by
the procedure declarations.
Grammar.
Data structures.
Environments.
Store.
Interpr... | #lang eopl
(define the-lexical-spec
'([whitespace (whitespace) skip]
[comment ("%" (arbno (not #\newline))) skip]
[identifier (letter (arbno (or letter digit "_" "-" "?"))) symbol]
[number (digit (arbno digit)) number]
[number ("-" digit (arbno digit)) number]))
(define the-grammar
'([program (s... |
630b2d5ca034d3337537ec3dd1770ef5a6e7a0f9dda18d0200ab473ed022f781 | RyanGlScott/code-page | CodePage.hs | # LANGUAGE CPP #
# LANGUAGE NamedFieldPuns #
|
Module : System . IO.CodePage
Copyright : ( C ) 2016 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : Portable
Exports functions which adjust code pages on Windows , and do nothi... | null | https://raw.githubusercontent.com/RyanGlScott/code-page/2638c61104eb54615db604ffde00ffb76132c9ae/src/System/IO/CodePage.hs | haskell | * Adjusting 'CodePage's
* Notable 'CodePage's
* 'Options'
** Record fields of 'Options'
** 'NonWindowsBehavior'
** Constructing 'NonWindowsBehavior'
| Sets the code page for an action to UTF-32LE as necessary.
| Sets the code page for an action to UTF-32BE as necessary.
| Sets the code page for an action as ne... | # LANGUAGE CPP #
# LANGUAGE NamedFieldPuns #
|
Module : System . IO.CodePage
Copyright : ( C ) 2016 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : Portable
Exports functions which adjust code pages on Windows , and do nothi... |
5d9a8c1d85bffe17ea92104712a348c51f4cb0e386865eb253e3e090e8c72058 | fhur/gabo | core.clj | (ns gabo.core
(:require [gabo.util :refer :all]
[gabo.lexer :refer :all]))
(defn- unexpected-token-exception
[token]
(new IllegalArgumentException
(str "Unexpected token " token)))
;; execute define-is-token-funcs to actually define the given functions:
;; is-literal, is-symbol, etc.
(define-... | null | https://raw.githubusercontent.com/fhur/gabo/41563e04a131ce33aadd575f20a87acfecdbdc09/src/gabo/core.clj | clojure | execute define-is-token-funcs to actually define the given functions:
is-literal, is-symbol, etc.
recursive call will go through this branch. | (ns gabo.core
(:require [gabo.util :refer :all]
[gabo.lexer :refer :all]))
(defn- unexpected-token-exception
[token]
(new IllegalArgumentException
(str "Unexpected token " token)))
(define-is-token-funcs :literal :symbol :iter-init :iter-end :iter)
(defn- find-iter-sub-list
"Returns all to... |
11cba4a1c437984e3cf93419d674e4d3c1d2ec0b9e29f1391fc8b3453c6eab49 | YoshikuniJujo/funpaala | hpt.hs | type Human = (String, Int)
age :: Human -> String
age (n, a) = n ++ " is " ++ show a ++ " years old."
masuo :: Human
masuo = ("Masuo", 32)
type Product = (String, Int)
price :: Product -> String
price (n, p) = n ++ " is " ++ show p ++ " yen."
smartphone :: Product
smartphone = ("Smartphone", 99000)
| null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/21_adt/hpt.hs | haskell | type Human = (String, Int)
age :: Human -> String
age (n, a) = n ++ " is " ++ show a ++ " years old."
masuo :: Human
masuo = ("Masuo", 32)
type Product = (String, Int)
price :: Product -> String
price (n, p) = n ++ " is " ++ show p ++ " yen."
smartphone :: Product
smartphone = ("Smartphone", 99000)
| |
aa12625d081604faf892af8ba4d5cfeb76b63f6ef0635910d1267b2d988da80f | gregnwosu/haskellbook | exercises.hs | module Exercises where
replaceThe :: String -> String
replaceThe [] = []
replaceThe ('t':'h':'e':xs) = 'a':replaceThe xs
replaceThe (x:xs) = x:replaceThe xs
notThe :: String -> Maybe String
notThe [] = Just []
notThe ('t':'h':'e':xs) = Nothing
notThe (x:xs) = (:) <$> Just x <*> notThe xs
vowels = "aeiou"
countTheBe... | null | https://raw.githubusercontent.com/gregnwosu/haskellbook/b21fb6772e58f07cff334d9c551d0477ec856897/chapter12/exercises.hs | haskell | module Exercises where
replaceThe :: String -> String
replaceThe [] = []
replaceThe ('t':'h':'e':xs) = 'a':replaceThe xs
replaceThe (x:xs) = x:replaceThe xs
notThe :: String -> Maybe String
notThe [] = Just []
notThe ('t':'h':'e':xs) = Nothing
notThe (x:xs) = (:) <$> Just x <*> notThe xs
vowels = "aeiou"
countTheBe... | |
a59b1048241d05535936002aecfdfadf4b9ab5ad2b0f78e645f036b0780606b2 | ranjitjhala/haddock-annot | UserHooks.hs | -----------------------------------------------------------------------------
-- |
Module : Distribution . Simple . UserHooks
Copyright : 2003 - 2005
--
-- Maintainer :
-- Portability : portable
--
-- This defines the API that @Setup.hs@ scripts can use to customise the way
the build works . Th... | null | https://raw.githubusercontent.com/ranjitjhala/haddock-annot/ffaa182b17c3047887ff43dbe358c246011903f6/Cabal-1.10.1.1/Distribution/Simple/UserHooks.hs | haskell | ---------------------------------------------------------------------------
|
Maintainer :
Portability : portable
This defines the API that @Setup.hs@ scripts can use to customise the way
build systems are defined in "Distribution.Simple". The 'UserHooks' is a big
itself. There are few other miscellaneous h... | Module : Distribution . Simple . UserHooks
Copyright : 2003 - 2005
the build works . This module just defines the ' UserHooks ' type . The
predefined sets of hooks that implement the @Simple@ , @Make@ and @Configure@
record of functions . There are 3 for each action , a pre , post and the actio... |
60445f50c582a5cb3fa9b411033b3c6bdffe5497695d63e748afaab3fda1f7ab | james-iohk/plutus-scripts | EcdsaSecp256k1LoopValidator.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
mo... | null | https://raw.githubusercontent.com/james-iohk/plutus-scripts/337462973f2debf7c3d5da748ee1564f69d53187/src/EcdsaSecp256k1LoopValidator.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
# INLINEABLE mkValidator # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module EcdsaSecp256k1LoopValidator (writeSerialisedScript) where
import Cardano.Api (PlutusScript, PlutusScriptV2,
... |
7be8ebf4c8ea5c51daec0444968be1147bbacfaf0a347b26faeb5c5d51b24030 | racket/rackunit | format-test.rkt | #lang racket/base
(require racket/function
racket/port
racket/list
racket/pretty
rackunit
rackunit/private/check-info
(submod rackunit/private/format for-test))
(define-check (check-output expected thnk)
(define actual (with-output-to-string thnk))
(with-check... | null | https://raw.githubusercontent.com/racket/rackunit/b6f59fdc857d2236a4465dc68296cb70813968b1/rackunit-test/tests/rackunit/format-test.rkt | racket | #lang racket/base
(require racket/function
racket/port
racket/list
racket/pretty
rackunit
rackunit/private/check-info
(submod rackunit/private/format for-test))
(define-check (check-output expected thnk)
(define actual (with-output-to-string thnk))
(with-check... | |
5f2a05ee64261746dc50ae0ab90dfa8d3221aa3e218973e87caa90299d38782c | dyoo/whalesong | m.rkt | #lang s-exp "../../lang/base.rkt"
(require "m2.rkt"
"m3.rkt") | null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/tests/older-tests/require-test/m.rkt | racket | #lang s-exp "../../lang/base.rkt"
(require "m2.rkt"
"m3.rkt") | |
fde52d8fdd631a9bb22c6d38376eb8293cfcc4f8937dc0b32f2a143c779b7158 | eareese/htdp-exercises | 059-rocket-mockups.rkt | #lang htdp/bsl
(require 2htdp/image)
; physical constants
(define HEIGHT 300)
(define WIDTH 100)
(define YDELTA 3)
; graphical constants
(define BACKG (empty-scene WIDTH HEIGHT))
(define ROCKET (rectangle 5 30 "solid" "blue"))
(define ROCKET-CENTER (/ (image-height ROCKET) 2))
(define ROCKET-X 10)
; given 0, rocket... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part01-fixed-size-data/059/059-rocket-mockups.rkt | racket | physical constants
graphical constants
given 0, rocket should be on the ground | #lang htdp/bsl
(require 2htdp/image)
(define HEIGHT 300)
(define WIDTH 100)
(define YDELTA 3)
(define BACKG (empty-scene WIDTH HEIGHT))
(define ROCKET (rectangle 5 30 "solid" "blue"))
(define ROCKET-CENTER (/ (image-height ROCKET) 2))
(define ROCKET-X 10)
(place-image ROCKET ROCKET-X (- (- HEIGHT 0) ROCKET-CENTER) ... |
5183cdd1795286a39f3ccf8b6b7da44370200fcf4718fe07fd435e4467ddce26 | GaloisInc/LIMA | Gcd.hs | -- |
-- Module: Gcd
Description : Example design which computes GCD ( greatest - common divisor )
Copyright : ( c ) 2013 Lee Pike
--
module Language.LIMA.C.Example.Gcd
( compileExample
, example
) where
import Language.LIMA
import Language.LIMA.C
| Invoke the LIMA compiler
compileExample :: IO ()
comp... | null | https://raw.githubusercontent.com/GaloisInc/LIMA/8006bb52b2fb5d3264fe55ef8c9b7c89ab7f4630/lima-c/src/Language/LIMA/C/Example/Gcd.hs | haskell | |
Module: Gcd
| An example design that computes the greatest common divisor.
External reference to value A.
External reference to value B.
The external running flag.
A rule to modify A.
A rule to modify B.
A rule to clear the running flag. | Description : Example design which computes GCD ( greatest - common divisor )
Copyright : ( c ) 2013 Lee Pike
module Language.LIMA.C.Example.Gcd
( compileExample
, example
) where
import Language.LIMA
import Language.LIMA.C
| Invoke the LIMA compiler
compileExample :: IO ()
compileExample = do
r <- ... |
019b075c9628612c0d4d3baf3f7e6f95f0ef75546eef7f4d0848ef3b356169e0 | ArulselvanMadhavan/haskell-first-principles | Ex26_12_1.hs | module Ex26_12_1 where
--Read this - -readert-maybe-or-maybet-reader
main :: IO ()
main = putStrLn "-readert-maybe-or-maybet-reader"
| null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter26/src/Ex26_12_1.hs | haskell | Read this - -readert-maybe-or-maybet-reader | module Ex26_12_1 where
main :: IO ()
main = putStrLn "-readert-maybe-or-maybet-reader"
|
77dbbdecef942d21860f79e33689163c548d95ef3adbf0c38ab3f8c628f4d3be | iu-parfunc/lvars | Sparks.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module Control.Par.Scheds.Sparks
( Par
, runPar
, runParPoly
) where
import Control.Monad (void)
import Sys... | null | https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/par-schedulers/Control/Par/Scheds/Sparks.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE RankNTypes #
# LANGUAGE TypeFamilies # |
module Control.Par.Scheds.Sparks
( Par
, runPar
, runParPoly
) where
import Control.Monad (void)
import System.IO.Unsafe (unsafePerformIO)
import Control.Par.Class
import qualified Control.Par.Class.Unsafe as PC
import Control.Pa... |
1bb864af0947dcfebcde1240722b6c5b4b903fc399e9755e63acec25c42ef236 | effectfully-ou/sketches | UnliftIO.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE RankNTypes #-}
module UnliftIO where
import SomeAction
import Control.Concurrent
import Control.Monad.Except
import Cont... | null | https://raw.githubusercontent.com/effectfully-ou/sketches/27e112618840a461376973e9594ad37bf5aa243a/generalizing-unliftio/src/UnliftIO.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DerivingStrategies #
# LANGUAGE RankNTypes # | # LANGUAGE GeneralizedNewtypeDeriving #
module UnliftIO where
import SomeAction
import Control.Concurrent
import Control.Monad.Except
import Control.Monad.Morph
import Control.Monad.Trans.Reader
class MonadIO m => MonadUnliftIO m where
withRunInIO :: ((forall a.... |
9d43db2c0a44345ae5d68e858e8975dea15673cb1073aa8d7ac1ae5133c3bdd8 | autolwe/autolwe | Test_Solve_Fq.ml | open Norm
open Type
open Expr
open DeducField
open OUnit
let vx = Vsym.mk "x" mk_Fq
let vy = Vsym.mk "y" mk_Fq
let vz = Vsym.mk "z" mk_Fq
let vu = Vsym.mk "u" mk_Fq
let vv = Vsym.mk "v" mk_Fq
let vw = Vsym.mk "w" mk_Fq
let vhh = Vsym.mk "hh" mk_Fq
let (x,y,z) = (mk_V vx, mk_V vy, mk_V vz)
let (u,v,w) = (mk_V vu, mk_V ... | null | https://raw.githubusercontent.com/autolwe/autolwe/3452c3dae06fc8e9815d94133fdeb8f3b8315f32/src/Test/Test_Solve_Fq.ml | ocaml | x -> y*z + x
y -> x*z + y*v + u - w*y*z
y -> x*u + y*v - w*y*u - w*y2*u*hh + z*u*hh + y2*v*hh | open Norm
open Type
open Expr
open DeducField
open OUnit
let vx = Vsym.mk "x" mk_Fq
let vy = Vsym.mk "y" mk_Fq
let vz = Vsym.mk "z" mk_Fq
let vu = Vsym.mk "u" mk_Fq
let vv = Vsym.mk "v" mk_Fq
let vw = Vsym.mk "w" mk_Fq
let vhh = Vsym.mk "hh" mk_Fq
let (x,y,z) = (mk_V vx, mk_V vy, mk_V vz)
let (u,v,w) = (mk_V vu, mk_V ... |
90fc6ae46c88a6ef00b9e2363dde120c1d9eb9a8d2a869dc451a52aac57377f1 | ucsd-progsys/mist | linearAccess.hs |
type Linear size e1 e2 t a = Reader [ t ] a
pure as forall t , a. size : Nat ~ > e1
~ > x : a
- > Linear size e1 e2 t { v : a | v = x }
pure x = pure x
( > > =) as forall t , a , b. size : Nat ~ > e1 ~ > e2 ~ > e3
~ > Linear size e1 e2 t a
- > ( a - > Linear size e2 e3 t b )
- > Linear si... | null | https://raw.githubusercontent.com/ucsd-progsys/mist/0a9345e73dc53ff8e8adb8bed78d0e3e0cdc6af0/tests/Tests/Integration/todo/linearAccess.hs | haskell |
type Linear size e1 e2 t a = Reader [ t ] a
pure as forall t , a. size : Nat ~ > e1
~ > x : a
- > Linear size e1 e2 t { v : a | v = x }
pure x = pure x
( > > =) as forall t , a , b. size : Nat ~ > e1 ~ > e2 ~ > e3
~ > Linear size e1 e2 t a
- > ( a - > Linear size e2 e3 t b )
- > Linear si... | |
72de2043e522e65dc0cd7ccf4364eeff368a320599ea1e8ef281d9c694a34721 | fulcrologic/fulcro-inspect | main.cljs | (ns fulcro.inspect.electron.background.main
(:require
["electron" :as electron]
["path" :as path]
["electron-settings" :as settings]
["url" :as url]
[goog.functions :as g.fns]
[fulcro.inspect.electron.background.server :as server]))
(defn get-setting [k default] (or (.get settings k) default)... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-inspect/a03b61cbd95384c0f03aa936368bcf5cf573fa32/src/electron/fulcro/inspect/electron/background/main.cljs | clojure | (ns fulcro.inspect.electron.background.main
(:require
["electron" :as electron]
["path" :as path]
["electron-settings" :as settings]
["url" :as url]
[goog.functions :as g.fns]
[fulcro.inspect.electron.background.server :as server]))
(defn get-setting [k default] (or (.get settings k) default)... | |
c5ecb39db577829ddd88a6107349da4853be3b5275d4846f2d3746bc12769c79 | mbj/stratosphere | ActionProperty.hs | module Stratosphere.WAFRegional.WebACL.ActionProperty (
ActionProperty(..), mkActionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ActionProperty
= Acti... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafregional/gen/Stratosphere/WAFRegional/WebACL/ActionProperty.hs | haskell | module Stratosphere.WAFRegional.WebACL.ActionProperty (
ActionProperty(..), mkActionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ActionProperty
= Acti... | |
07fc37dfaff45b599ee0a08f41e0f34f238c91bada72e1b46d2e13dfd11def3e | coq/coq | invfun.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/05e22aef122aed5564d879cbca6aa59f32afe220/plugins/funind/invfun.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
318f96f8a7345697d8792cb5c29de4c182b78d999cf97209a15a7073e0625328 | BekaValentine/SimpleFP-v2 | TypeChecking.hs | {-# OPTIONS -Wall #-}
-- | A unification-based type checker.
module Require.Unification.TypeChecking where
import Utils.ABT
import Utils.Elaborator
import Utils.Eval
import Utils.Names
import Utils.Plicity
import Utils.Pretty
import Utils.Unifier
import Utils.Telescope
import Utils.Vars
import Require.Core.Con... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Require/Unification/TypeChecking.hs | haskell | # OPTIONS -Wall #
| A unification-based type checker.
| In the dependently typed variant, it's useful to have a type for normal
terms. While this type won't actually be representationally different, we
can use it to help ensure we're using normal forms in places where we want
them, such as the type arguments to ch... |
module Require.Unification.TypeChecking where
import Utils.ABT
import Utils.Elaborator
import Utils.Eval
import Utils.Names
import Utils.Plicity
import Utils.Pretty
import Utils.Unifier
import Utils.Telescope
import Utils.Vars
import Require.Core.ConSig
import Require.Core.Evaluation ()
import Require.Core.Ter... |
b3ddf86eaa8de5ead7c766e52d283f4643a2d6af937cbbfd73dc37434007c87c | jsarracino/spyder | Parser.hs | module Language.Spyder.Parser.Parser (
expr
, stmt
, prog
, block
, relDeclP
, relP
, comp
, spaced
, typ
, dataDeclP
, mainCompP
, derivCompP
, loopP
, elifP
, condP
, relPrev
, specTerm
) where
import Text.Parsec
import Text.Parsec.Expr
import qualified Text.Parsec.Token as Tok
im... | null | https://raw.githubusercontent.com/jsarracino/spyder/a2f6d08eb2a3907d31a89ae3d942b50aaba96a88/Language/Spyder/Parser/Parser.hs | haskell | import
relIndex = do {
pref <- liftM Spec.RelVar ident;
rhs <- many1 $ brackets relexpr;
} | module Language.Spyder.Parser.Parser (
expr
, stmt
, prog
, block
, relDeclP
, relP
, comp
, spaced
, typ
, dataDeclP
, mainCompP
, derivCompP
, loopP
, elifP
, condP
, relPrev
, specTerm
) where
import Text.Parsec
import Text.Parsec.Expr
import qualified Text.Parsec.Token as Tok
im... |
6e5b302e34641de5bb152df72edecc85ec3e0f53ab0a13c30714561728fa151a | hgoes/smtlib2 | Type.hs | module Language.SMTLib2.Internals.Type where
import Language.SMTLib2.Internals.Type.Nat
import Language.SMTLib2.Internals.Type.List (List(..))
import qualified Language.SMTLib2.Internals.Type.List as List
import Data.Proxy
import Data.Typeable
import Numeric
import Data.List (genericLength,genericReplicate)
import Da... | null | https://raw.githubusercontent.com/hgoes/smtlib2/c35747f2a5a9ec88dc7b1db41a5aab6e98c0458d/Language/SMTLib2/Internals/Type.hs | haskell | It is only used in promoted form, for a concrete representation see 'Repr'.
| Get the data type from a value
| How many polymorphic parameters does this datatype have
| The name of the datatype. Must be unique.
| Get all of the constructors of this datatype
| Get the name of a constructor
| Test if a value is ... | module Language.SMTLib2.Internals.Type where
import Language.SMTLib2.Internals.Type.Nat
import Language.SMTLib2.Internals.Type.List (List(..))
import qualified Language.SMTLib2.Internals.Type.List as List
import Data.Proxy
import Data.Typeable
import Numeric
import Data.List (genericLength,genericReplicate)
import Da... |
6542d5576947d92a01a48bb35106723f09d24bc32d2fb731dbdedaa2fa1c3dd4 | fission-codes/fission | Types.hs | module Fission.Web.Server.AWS.Zone.Types (ZoneID (..)) where
import Data.Swagger as Swagger
import Database.Persist.Sql
import Servant.API
import Fission.Prelude
import Fission.Error.NotFound.Types
| Type safety wrapper for a Route53 zone ID
newtyp... | null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-web-server/library/Fission/Web/Server/AWS/Zone/Types.hs | haskell | module Fission.Web.Server.AWS.Zone.Types (ZoneID (..)) where
import Data.Swagger as Swagger
import Database.Persist.Sql
import Servant.API
import Fission.Prelude
import Fission.Error.NotFound.Types
| Type safety wrapper for a Route53 zone ID
newtyp... | |
c0d668fd3cd67b7bc6eec3727cc04a999bbc7111a3903488e14408f4d6fdc389 | Clojure2D/clojure2d-examples | material.clj | (ns rt4.the-next-week.ch07b.material
(:require [rt4.common :as common]
[rt4.the-next-week.ch07b.ray :as ray]
[rt4.the-next-week.ch07b.texture :as texture]
[fastmath.vector :as v]
[fastmath.core :as m]
[fastmath.random :as r])
(:import [fastmath.vector Vec3... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch07b/material.clj | clojure | (ns rt4.the-next-week.ch07b.material
(:require [rt4.common :as common]
[rt4.the-next-week.ch07b.ray :as ray]
[rt4.the-next-week.ch07b.texture :as texture]
[fastmath.vector :as v]
[fastmath.core :as m]
[fastmath.random :as r])
(:import [fastmath.vector Vec3... | |
b91f60df4c5b1b4c90e0f3e81a96b450cc75de5d06ee5a534198825e312544f1 | orionsbelt-battlegrounds/obb-rules | rotate.cljc | (ns obb-rules.actions.rotate
(:require [obb-rules.game :as game]
[obb-rules.simplifier :as simplify]
[obb-rules.result :as result]
[obb-rules.board :as board]
[obb-rules.element :as element]))
(defn- rotate-restrictions
"Checks for invalid scenarios"
[player board ... | null | https://raw.githubusercontent.com/orionsbelt-battlegrounds/obb-rules/97fad6506eb81142f74f4722aca58b80d618bf45/src/obb_rules/actions/rotate.cljc | clojure | (ns obb-rules.actions.rotate
(:require [obb-rules.game :as game]
[obb-rules.simplifier :as simplify]
[obb-rules.result :as result]
[obb-rules.board :as board]
[obb-rules.element :as element]))
(defn- rotate-restrictions
"Checks for invalid scenarios"
[player board ... | |
34dc69c7fa4b5631a9cc6d5913eba9b4fc50f16b28596750388592537ae6b01b | karimarttila/clojure | prop.clj | (ns simpleserver.util.prop
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[environ.core :as environ]
[clojure.pprint :as pp]))
(def config
"Global configuration as atom (which is read from property file)."
(atom nil))
... | null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/clj-ring-cljs-reagent-demo/simple-server/src/simpleserver/util/prop.clj | clojure | (ns simpleserver.util.prop
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[environ.core :as environ]
[clojure.pprint :as pp]))
(def config
"Global configuration as atom (which is read from property file)."
(atom nil))
... | |
fe82a506eb2361f59b442ad5dce7b634c42214d3dac19d15c5644ad4cea95911 | motemen/jusk | JSDate.hs | {-
JSDate.hs
Dateオブジェクト
/~oz-07ams/prog/ecma262r3/15-9_Date_Objects.html
-}
module JSDate where
import Control.Monad
import System.Time
import DataTypes
import Internal
-- Date.prototype
prototypeObject :: Value
prototypeObject =
nullObject {
objPropMap = nativeFuncPropMap [
(... | null | https://raw.githubusercontent.com/motemen/jusk/4975915b8550aa09c452fb89dcad7bfcb1037c39/src/JSDate.hs | haskell |
JSDate.hs
Dateオブジェクト
/~oz-07ams/prog/ecma262r3/15-9_Date_Objects.html
Date.prototype
Date()
new Date()
Date.prototype.toString
Date.prototype.valueOf
Date.prototype.getTime |
module JSDate where
import Control.Monad
import System.Time
import DataTypes
import Internal
prototypeObject :: Value
prototypeObject =
nullObject {
objPropMap = nativeFuncPropMap [
("constructor", constructor, 7),
("toString", toStringMethod, 0),
("v... |
c79d6adaebbf015dff662cec8b79e61da8bf5f34fc5ba64f96ebc1e3d07245ae | LaurentMazare/ocaml-wasmtime | linker.ml | open! Base
module W = Wasmtime.Wrappers
let linking1_wat =
{|
(module
(import "linking2" "double" (func $double (param i32) (result i32)))
(import "linking2" "log" (func $log (param i32 i32)))
(import "linking2" "memory" (memory 1))
(import "linking2" "memory_offset" (global $offset i32))
(func (export "r... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-wasmtime/49d3e35676d79d6573600fa4e9ff7460106341e3/tests/linker.ml | ocaml | open! Base
module W = Wasmtime.Wrappers
let linking1_wat =
{|
(module
(import "linking2" "double" (func $double (param i32) (result i32)))
(import "linking2" "log" (func $log (param i32 i32)))
(import "linking2" "memory" (memory 1))
(import "linking2" "memory_offset" (global $offset i32))
(func (export "r... | |
d7f724352cf9bfcdcfdffa769aa4c8b81f754d9289d3d39ff77a5d2ddebb30d0 | ghcjs/ghcjs-dom | SVGZoomAndPan.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.SVGZoomAndPan
(pattern SVG_ZOOMANDPAN_UNKNOWN, pattern SVG_ZOOMANDPAN_DISABLE,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGZoomAndPan.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.SVGZoomAndPan
(pattern SVG_ZOOMANDPAN_UNKNOWN, pattern SVG_ZOOMANDPAN_DISABLE,
pattern SVG_ZOOMANDPAN_MAGNIFY, js_setZoomAndPan, setZoomAndPan,
js_getZoomAndPan, getZoomA... |
ca3b08720b3682e62fdcacc52a0cb5052a315ac08a5b001c37c1d8e0b12dcc0b | anmonteiro/ocaml-mongodb | header.ml | type t =
{ message_len : int32
; request_id : int32
; response_to : int32
; op : Operation.t
}
let create_header body_len request_id response_to op =
{ message_len = Int32.of_int (body_len + (4 * 4))
; request_id
; response_to
; op
}
let create_request_header body_len req... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-mongodb/535ae1b003b9c8a3844b92a78d2123881f2d404b/src/header.ml | ocaml | type t =
{ message_len : int32
; request_id : int32
; response_to : int32
; op : Operation.t
}
let create_header body_len request_id response_to op =
{ message_len = Int32.of_int (body_len + (4 * 4))
; request_id
; response_to
; op
}
let create_request_header body_len req... | |
74b84f6ed51d2f3082f571c6393326693d56e27408e9a7687b2f9a720fe8c174 | Quid2/flat | Endian.hs |
{-# LANGUAGE NoMonomorphismRestriction, ExtendedDefaultRules#-}
module DocTest.Flat.Endian where
import qualified DocTest
import Test.Tasty(TestTree,testGroup)
import Flat.Endian
import Numeric (showHex)
tests :: IO TestTree
tests = testGroup "Flat.Endian" <$> sequence [ DocTest.test "src/Data/Flat/Endian.hs:36" ["T... | null | https://raw.githubusercontent.com/Quid2/flat/95e5d7488451e43062ca84d5376b3adcc465f1cd/test/DocTest/Data/Flat/Endian.hs | haskell | # LANGUAGE NoMonomorphismRestriction, ExtendedDefaultRules# |
module DocTest.Flat.Endian where
import qualified DocTest
import Test.Tasty(TestTree,testGroup)
import Flat.Endian
import Numeric (showHex)
tests :: IO TestTree
tests = testGroup "Flat.Endian" <$> sequence [ DocTest.test "src/Data/Flat/Endian.hs:36" ["True"] (DocTest.asPrint( toBE64 0xF0F1F2F3F4F5F6F7 == if isBigEnd... |
f12b3ab8be2054d090ca5127f814acd644c005f1785c5147a966e803faf646d5 | facebook/duckling | Corpus.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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Numeral.TR.Corpus
( corpus ) where
import Prelude
imp... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Numeral/TR/Corpus.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.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Numeral.TR.Corpus
( corpus ) where
import Prelude
import Data.String
import Duckling.Locale
import Duckling.Numeral.Types
import Duckling.Resolve
import Duckling.Testing.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale TR Nothin... |
fa185448f8aa9d20cda7ca3acfec7f7f7870a18f3914e2def7701ec21687db56 | Herzult/vindinium-starter-haskell | Types.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Vindinium.Types
( Vindinium
, runVindinium
, asks
, Settings (..)
, Key (..)
, Bot
, State (..)
, GameId (..)
, Game (..)
, HeroId (..)
, Hero (..)
, Board (..)
, Tile (... | null | https://raw.githubusercontent.com/Herzult/vindinium-starter-haskell/48b108f6913133794ab5bfcdc52eba6a48ed537f/src/Vindinium/Types.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
module Vindinium.Types
( Vindinium
, runVindinium
, asks
, Settings (..)
, Key (..)
, Bot
, State (..)
, GameId (..)
, Game (..)
, HeroId (..)
, Hero (..)
, Board (..)
, Tile (... | |
be3f76a02049f0b99ba17af8ff3e88b85bf26a830585cd5104e21ba8c0b85f1f | TouK/re-cms | core.cljs | (ns re-cms.core
(:require [reagent.core :as reagent]
[re-frame.core :as re-frame]
[re-cms.handlers]
[re-cms.subs]
[re-cms.views :as views]
[re-cms.config :as config]))
(when config/debug?
(println "dev mode"))
(defn mount-root [elem]
(reage... | null | https://raw.githubusercontent.com/TouK/re-cms/98b54e79c349b5db7f8b3a6d30348c23bbe65a2e/src/cljs/re_cms/core.cljs | clojure | (ns re-cms.core
(:require [reagent.core :as reagent]
[re-frame.core :as re-frame]
[re-cms.handlers]
[re-cms.subs]
[re-cms.views :as views]
[re-cms.config :as config]))
(when config/debug?
(println "dev mode"))
(defn mount-root [elem]
(reage... | |
891d815952327c8739f9da55299c7ded970c2bf00c7bac5420908836cc8e8bf8 | phylogeography/spread | subs.cljs | (ns shared.subs
(:require [re-frame.core :refer [reg-sub]]))
(reg-sub
:collapsible-tabs/tabs
(fn [db _]
(:ui.collapsible-tabs/tabs db)))
(reg-sub
:collapsible-tabs/open?
:<- [:collapsible-tabs/tabs]
(fn [tabs [_ tab-id]]
(get tabs tab-id)))
| null | https://raw.githubusercontent.com/phylogeography/spread/56f3500e6d83e0ebd50041dc336ffa0697d7baf8/src/cljs/shared/subs.cljs | clojure | (ns shared.subs
(:require [re-frame.core :refer [reg-sub]]))
(reg-sub
:collapsible-tabs/tabs
(fn [db _]
(:ui.collapsible-tabs/tabs db)))
(reg-sub
:collapsible-tabs/open?
:<- [:collapsible-tabs/tabs]
(fn [tabs [_ tab-id]]
(get tabs tab-id)))
| |
ccca354e43b6fd8495037e35c91334c5113b66fa63a8aa9ee2e277733a59b638 | lambe-lang/nethra | t00_tests.ml | let () =
Alcotest.(
run "Type checker Test"
[
T02_equivalence.cases
; T03_checker_basic.cases
; T04_checker_function.cases
; T05_checker_pair.cases
; T06_checker_sum.cases
; T07_checker_mu.cases
; T08_checker_hole.cases
; T09_infer_basic.cases
; T10_in... | null | https://raw.githubusercontent.com/lambe-lang/nethra/42e04f741264c01de60e2a6ff890c117d01b55fa/test/nethra/lang/system/s03_typer/t00_tests.ml | ocaml | let () =
Alcotest.(
run "Type checker Test"
[
T02_equivalence.cases
; T03_checker_basic.cases
; T04_checker_function.cases
; T05_checker_pair.cases
; T06_checker_sum.cases
; T07_checker_mu.cases
; T08_checker_hole.cases
; T09_infer_basic.cases
; T10_in... | |
94b89d705b8558d4b01ac447f562c33c2f2a269a6e3cc99954cb1d3dbea6402f | city41/mario-review | crop_tool.cljs | (ns daisy.client.tools.crop-tool
(:require [daisy.client.canvas-util :as util]))
(defn- crop-frame [ctx frame x y sw sh dw dh]
(let [source-img-data (.createImageData ctx sw sh)
source-data (.-data source-img-data)]
(.set source-data frame)
(.putImageData ctx source-img-data 0 0)
(let [dest-img... | null | https://raw.githubusercontent.com/city41/mario-review/1b6ebfff88ad778a52865a062204cabb8deed0f9/cropping-app/src/client/crop_tool.cljs | clojure | fixes a large memory leak | (ns daisy.client.tools.crop-tool
(:require [daisy.client.canvas-util :as util]))
(defn- crop-frame [ctx frame x y sw sh dw dh]
(let [source-img-data (.createImageData ctx sw sh)
source-data (.-data source-img-data)]
(.set source-data frame)
(.putImageData ctx source-img-data 0 0)
(let [dest-img... |
7595309325bdb12319e2c3d4c676346b09c8dcff606afb03628b6bbad6ffc8a5 | rbkmoney/cds | cds_ident_doc_client.erl | -module(cds_ident_doc_client).
%% Identity document operations
-export([get_ident_doc/2]).
-export([put_ident_doc/2]).
%%
%% Internal Types
%%
-type result() :: cds_woody_client:result().
-type ident_doc() :: identdocstore_identity_document_storage_thrift:'IdentityDocument'().
%%
%% API
%%
-spec get_ident_doc(cds:... | null | https://raw.githubusercontent.com/rbkmoney/cds/6e6541c99d34b0633775f0c5304f5008e6b2aaf3/apps/cds/test/cds_ident_doc_client.erl | erlang | Identity document operations
Internal Types
API
| -module(cds_ident_doc_client).
-export([get_ident_doc/2]).
-export([put_ident_doc/2]).
-type result() :: cds_woody_client:result().
-type ident_doc() :: identdocstore_identity_document_storage_thrift:'IdentityDocument'().
-spec get_ident_doc(cds:token(), woody:url()) -> result().
get_ident_doc(Token, RootUrl) ->
... |
3498e53483aca493bca0d806ae0151565f3bcfb5598ec7d828ffedd3b98538dc | khotyn/4clojure-answer | 112-sequs-horribilis.clj | (fn [max-sum coll]
(letfn [(step [coll current-sum max-sum]
(if (seq coll)
(let [head (first coll)]
(if (coll? head)
(let [sub (step head current-sum max-sum)
next-sum (+ current-sum (reduce + (flatten sub)))]
(if ... | null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/112-sequs-horribilis.clj | clojure | (fn [max-sum coll]
(letfn [(step [coll current-sum max-sum]
(if (seq coll)
(let [head (first coll)]
(if (coll? head)
(let [sub (step head current-sum max-sum)
next-sum (+ current-sum (reduce + (flatten sub)))]
(if ... | |
0ca5f530a7bb7b80f52c4e2abadd400d6340bbe4a63ae2cf0058a370a793c3fc | LeiWangHoward/Common-Lisp-Playground | map-color.lisp | (in-package #:ddr-tests)
(defparameter *map-color-kb*
'(
(color red)
(color blue)
(color green)
(color yellow)
(-> (all-different ?c1 ?c2 ?c3 ?c4) (all-different ?c1 ?c2 ?c3)
(all-different ?c1 ?c2 ?c4) (all-different ?c1 ?c3 ?c4)
(all-different ?c2 ?c3 ?c4))
(-> (all-differen... | null | https://raw.githubusercontent.com/LeiWangHoward/Common-Lisp-Playground/4130232954f1bbf8aa003d856ccb2ab382da0534/DDR/map-color.lisp | lisp | (in-package #:ddr-tests)
(defparameter *map-color-kb*
'(
(color red)
(color blue)
(color green)
(color yellow)
(-> (all-different ?c1 ?c2 ?c3 ?c4) (all-different ?c1 ?c2 ?c3)
(all-different ?c1 ?c2 ?c4) (all-different ?c1 ?c3 ?c4)
(all-different ?c2 ?c3 ?c4))
(-> (all-differen... | |
141b0248dc311a9dcfe45361c639fab9df048f966faab14d5ed58536ac071f6e | gulige/neuroevo | gstk_menu.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applic... | null | https://raw.githubusercontent.com/gulige/neuroevo/09e67928c2417f2b27ec6522acc82f8b3c844949/apps/gs/src/gstk_menu.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific l... | Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(gstk_menu).
-compile([{nowarn_deprecated_function,{gs,error,2}}]).
activebg Color
disabledfg Col... |
d6cb3d8efb0eff5581e02bb80f2c9466cf596fae522a3821c1a4d8301d87cf51 | runtimeverification/haskell-backend | With.hs | module Test.Kore.With (
With (..),
Attribute (..),
OpaqueSet (..),
VariableElement (..),
) where
import Control.Lens qualified as Lens
import Data.Generics.Product (
field,
)
import Data.HashMap.Strict qualified as HashMap
import Data.HashSet qualified as HashSet
import Data.List qualified as List... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/fae73ac06cc9bcf8e24b0bdd2f07069610277d58/kore/test/Test/Kore/With.hs | haskell | VariableElement
user intended for a de-normalized internalSet
this simulates the reordering of the elements
which happens during AC normalization | module Test.Kore.With (
With (..),
Attribute (..),
OpaqueSet (..),
VariableElement (..),
) where
import Control.Lens qualified as Lens
import Data.Generics.Product (
field,
)
import Data.HashMap.Strict qualified as HashMap
import Data.HashSet qualified as HashSet
import Data.List qualified as List... |
c1a96e2d5c8bd81b092db73f94da77d593e864d8b4c8a14f030f2fdd0fab6076 | thattommyhall/offline-4clojure | p143.clj | ;; dot product - Easy
Create a function that computes the < a href=" / wiki / Dot_product#Definition">dot product</a > of two sequences . You may assume that the vectors will have the same length .
;; tags - seqs:math
;; restricted -
(ns offline-4clojure.p143
(:use clojure.test))
(def __
;; your solution here
)
... | null | https://raw.githubusercontent.com/thattommyhall/offline-4clojure/73e32fc6687816aea3c514767cef3916176589ab/src/offline_4clojure/p143.clj | clojure | dot product - Easy
tags - seqs:math
restricted -
your solution here | Create a function that computes the < a href=" / wiki / Dot_product#Definition">dot product</a > of two sequences . You may assume that the vectors will have the same length .
(ns offline-4clojure.p143
(:use clojure.test))
(def __
)
(defn -main []
(are [soln] soln
(= 0 (__ [0 1 0] [1 0 0]))
(= 3 (__ [1 1 1] [1 ... |
caec128de76bdbb770a034ef995335d6386bae0ec95fa5169663a608c9c26f6b | haskell-works/hw-prim | AsVector64nsSpec.hs | # OPTIONS_GHC -fno - warn - incomplete - patterns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module HaskellWorks.Data.Vector.AsVector64nsSpec
( spec
) where
import HaskellWorks.Data.Vector.AsVector64
import HaskellWorks.Data.Vector.AsVector64ns
import HaskellWorks.Hspec.Hedgehog
impor... | null | https://raw.githubusercontent.com/haskell-works/hw-prim/aff74834cd2d3fb0eb4994b24b2d1cdef1e3e673/test/HaskellWorks/Data/Vector/AsVector64nsSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - incomplete - patterns #
# LANGUAGE ScopedTypeVariables #
module HaskellWorks.Data.Vector.AsVector64nsSpec
( spec
) where
import HaskellWorks.Data.Vector.AsVector64
import HaskellWorks.Data.Vector.AsVector64ns
import HaskellWorks.Hspec.Hedgehog
import Hedgehog
import Test.Hspec
import ... |
603aafa5024ecd32993e483cba46e3d9ecc63ca0dbfb222f992f09c30a7b600e | baskeboler/cljs-karaoke-client | audio.cljs | (ns cljs-karaoke.subs.audio
(:require [re-frame.core :as rf]))
(rf/reg-sub
::audio-data
(fn [db _]
(:audio-data db)))
(defn reg-audio-data-sub [sub-name attr-name]
(rf/reg-sub
sub-name
:<- [::audio-data]
(fn [data _]
(get data attr-name))))
(reg-audio-data-sub ::feedback-reduction? :feedback-r... | null | https://raw.githubusercontent.com/baskeboler/cljs-karaoke-client/bb6512435eaa436d35034886be99213625847ee0/src/main/cljs_karaoke/subs/audio.cljs | clojure | (rf/reg-sub
::song-stream
(fn [db _]
(:song-stream db)) | (ns cljs-karaoke.subs.audio
(:require [re-frame.core :as rf]))
(rf/reg-sub
::audio-data
(fn [db _]
(:audio-data db)))
(defn reg-audio-data-sub [sub-name attr-name]
(rf/reg-sub
sub-name
:<- [::audio-data]
(fn [data _]
(get data attr-name))))
(reg-audio-data-sub ::feedback-reduction? :feedback-r... |
4fdafb919d0840b8445fd830a9f31bb2eaf9cf390e8fccbf18ce25bfdb27d8a1 | janestreet/ppx_type_directed_value | type_directed_command.ml | (* $MDX part-begin=of_applicative *)
open Ppx_type_directed_value_runtime
include Converters.Of_applicative (Core.Command.Param)
(* $MDX part-end *)
| null | https://raw.githubusercontent.com/janestreet/ppx_type_directed_value/f85693cc6d0ad8a9bc3bad55fed22a3d78e1fcaf/examples/type_directed_command.ml | ocaml | $MDX part-begin=of_applicative
$MDX part-end | open Ppx_type_directed_value_runtime
include Converters.Of_applicative (Core.Command.Param)
|
4da9ac611d3a8ab54c0f1758f660785ae47d3ee38fce7f2c864cfd12d04fb8a5 | Netflix/PigPen | parquet_test.clj | ;;
;;
Copyright 2014 - 2015 Netflix , Inc.
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to ... | null | https://raw.githubusercontent.com/Netflix/PigPen/18d461d9b2ee6c1bb7eee7324889d32757fc7513/pigpen-parquet/src/test/clojure/pigpen/local/parquet_test.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the speci... | Copyright 2014 - 2015 Netflix , Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns pigpen.local.parquet-test
(:require [clojure.test :refer :all]
[pigpen.local.test-harness :refer [local-harness]]
[pigpen.functional-suite :refer [def-functional-tests]]
... |
c74f2de2bb313eb43294f8c8f9462a41831322746830347f0caa2a57eb4e1285 | ont-app/igraph-jena | core.clj | (ns ont-app.igraph-jena.core
{
:clj-kondo/config '{:linters {:unresolved-symbol {:level :off}
:unresolved-namespace {:level :off}
}}
}
(:require
[clojure.java.io :as io]
[ont-app.igraph.core :as igraph :refer [IGraph
... | null | https://raw.githubusercontent.com/ont-app/igraph-jena/b6ce294bd4b9c9d2db96df227b54b9e961cf43df/src/ont_app/igraph_jena/core.clj | clojure | TODO: Eplore the trade-offs this way vs. (binding [rdf/query-template-defaults query-template-defaults]
else it's some other kinda literal
else it's a regular uri...
else it's a literal
(.execSelect qe))
else this is not transit data
else it's some other error
todo: is there a more efficient way to do this?
els... | (ns ont-app.igraph-jena.core
{
:clj-kondo/config '{:linters {:unresolved-symbol {:level :off}
:unresolved-namespace {:level :off}
}}
}
(:require
[clojure.java.io :as io]
[ont-app.igraph.core :as igraph :refer [IGraph
... |
551d5c708f87f3961130cc9670fa117fa0d5553aaef9adfdcd8cde05fb0f1acc | lachenmayer/arrowsmith | CrawlPackage.hs | # LANGUAGE FlexibleContexts #
module CrawlPackage where
import Control.Arrow (second)
import Control.Monad.Error (MonadError, MonadIO, catchError, liftIO, throwError)
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory)
... | null | https://raw.githubusercontent.com/lachenmayer/arrowsmith/34b6bdeddddb2d8b9c6f41002e87ec65ce8a701a/elm-make/src/CrawlPackage.hs | haskell | STATE and ENVIRONMENT
DEPTH FIRST SEARCH
FIND LOCAL FILE PATH
FOREIGN MODULES -- which ones are available, who exposes them?
ERROR MESSAGES | # LANGUAGE FlexibleContexts #
module CrawlPackage where
import Control.Arrow (second)
import Control.Monad.Error (MonadError, MonadIO, catchError, liftIO, throwError)
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory)
... |
71685b2a91c9a04b7c5aef7352bc055f245d27656aa4c4c983b62828a7d08dea | lowasser/TrieMap | Utils.hs | # LANGUAGE TemplateHaskell #
module Data.TrieMap.Representation.TH.Utils where
import Language.Haskell.TH
import Language.Haskell.TH.ExpandSyns
decompose :: Type -> (Type, [Type])
decompose (tyfun `AppT` ty) = case decompose tyfun of
(tyfun, tys) -> (tyfun, tys ++ [ty])
decompose ty = (ty, [])
decompose' :: Type ->... | null | https://raw.githubusercontent.com/lowasser/TrieMap/1ab52b8d83469974a629f2aa577a85de3f9e867a/Data/TrieMap/Representation/TH/Utils.hs | haskell | # LANGUAGE TemplateHaskell #
module Data.TrieMap.Representation.TH.Utils where
import Language.Haskell.TH
import Language.Haskell.TH.ExpandSyns
decompose :: Type -> (Type, [Type])
decompose (tyfun `AppT` ty) = case decompose tyfun of
(tyfun, tys) -> (tyfun, tys ++ [ty])
decompose ty = (ty, [])
decompose' :: Type ->... | |
24ad8563887149289c41304792fe7529455e6b55d43c82df8accdcd1ff56949b | aws-beam/aws-erlang | aws_managedblockchain.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc
%%
Amazon Managed Blockchain is a fully managed service for creating and
%% managing blockchain networks using open-source frameworks.
%%
%% Blockchain allows you to build applications where multiple parties can
%% secur... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/ab253bb501fc2e39d4ff902d0f0672a6c68a3a57/src/aws_managedblockchain.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc
managing blockchain networks using open-source frameworks.
Blockchain allows you to build applications where multiple parties can
securely and transparently run transactions and share data without the
need for a trusted, central authority.
open-source frameworks... | See -beam/aws-codegen for more details .
Amazon Managed Blockchain is a fully managed service for creating and
Managed Blockchain supports the Hyperledger Fabric and Ethereum
of one framework and not the other . For example , actions related to
Hyperledger Fabric network members such as ` CreateMember ' and
... |
db0985987ce27bd899a553efbbc32663edcd3cb769468f878c2757b2233bf628 | codinuum/volt | logger.ml |
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... | null | https://raw.githubusercontent.com/codinuum/volt/546207693ef102a2f02c85af935f64a8f16882e6/src/library/logger.ml | ocaml |
Printf.fprintf stderr "check_level: \"%s\" %s\n" name (Level.to_string level);
|
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... |
8c3bd8d82a885e1f2f262ec85cabdcd09ed9044ef90caa261ca9d5adfc6d87a4 | jeffshrager/biobike | reload-gene.lisp | -*- Package : bio ; mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
(in-package :bio)
;;; +=========================================================================+
| Copyright ( c ) 2011 JP Massar |
;;; | ... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/seedorgs/reload-gene.lisp | lisp | mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and as... |
(in-package :bio)
| Copyright ( c ) 2011 JP Massar |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished ... |
40ba56a50b15745e92e2cd3fd5301be49a36ca02fb541c6f66ae9948bfcaac8c | MLstate/opalang | imp_Common.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/qmljsimp/imp_Common.ml | ocaml | depends
alias
shorthand
--
contains all the calls to the runtime (except the bsl which is called with
* bypasses)
a very conservative approximation of which expressions do observable side
* effects
**************************************************************************
******************************... |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
e7d11f3bf308d1e2cd2e8856cff1d105fcf1a5b624e994336f5208f615898dfe | skanev/playground | 17.scm | SICP exercise 2.17
;
; Define a procedure last-pair that returns the list that contains only the last
; element of a given (nonempty) list:
;
( list - pair ( list 23 72 149 34 ) )
( 34 )
(define (last-pair items)
(if (null? (cdr items))
items
(last-pair (cdr items))))
| null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/17.scm | scheme |
Define a procedure last-pair that returns the list that contains only the last
element of a given (nonempty) list:
| SICP exercise 2.17
( list - pair ( list 23 72 149 34 ) )
( 34 )
(define (last-pair items)
(if (null? (cdr items))
items
(last-pair (cdr items))))
|
d8d42b17534070ccfa4a1b5edaeaade36f9d8418cb5beeb612af4f5021dd18a3 | danidiaz/really-small-backpack-example | Main.hs | module Main where
import Intermediate (barAsString, myIdFunc)
main :: IO ()
main = do
print $ myIdFunc 3
putStrLn $ barAsString
| null | https://raw.githubusercontent.com/danidiaz/really-small-backpack-example/b5828e4ef35abea5630f9b3f5ec0e99ff9240a5e/lesson9-template-haskell/Main.hs | haskell | module Main where
import Intermediate (barAsString, myIdFunc)
main :: IO ()
main = do
print $ myIdFunc 3
putStrLn $ barAsString
| |
7d9ffcbed087758aa32580043068e506e72fd1bcaa8f20d19753c16b052dcaef | LexiFi/menhir | action.mli | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/src/action.mli | ocaml | ****************************************************************************
file LICEN... |
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU General Public License version 2 , as... |
ca7f256a2905a8dc8ec3d4d3e1d1fae650c31ef98f4906f7c5f2f0df49ae0af6 | tcsprojects/mlsolver | lmmcvaliditygame.ml | open Tcsautomata;;
open Tcsautohelper;;
open Tcsautotransform;;
open Tcstransitionsys;;
open Tcsgames;;
open Tcsset;;
open Tcslist;;
open Tcsarray;;
open Tcstiming;;
open Tcsbasedata;;
open Tcsmessage;;
open Tcslmmcformula;;
open Lmmcthreadnba;;
open Validitygamesregistry;;
type 'a state =
TT
| NT of int list
... | null | https://raw.githubusercontent.com/tcsprojects/mlsolver/fdd1d7550aa57a42886160ae1e8336c1111b7d94/src/automata/lmmc/lmmcvaliditygame.ml | ocaml | variables, branching
modalities
propositions
automaton | open Tcsautomata;;
open Tcsautohelper;;
open Tcsautotransform;;
open Tcstransitionsys;;
open Tcsgames;;
open Tcsset;;
open Tcslist;;
open Tcsarray;;
open Tcstiming;;
open Tcsbasedata;;
open Tcsmessage;;
open Tcslmmcformula;;
open Lmmcthreadnba;;
open Validitygamesregistry;;
type 'a state =
TT
| NT of int list
t... |
0effad88d71d198199b0dd4cd09651a8009a0ad6ad986b5b388dd3bae6c5a95e | tjammer/raylib-ocaml | shaders_mesh_instanced.ml | open Raylib
open Rlights
let width = 800
let height = 450
let count = 10000
let main () =
set_config_flags [ ConfigFlags.Msaa_4x_hint; ConfigFlags.Window_resizable ];
init_window width height "raylib [shaders] example - rlgl mesh instanced";
let position = Vector3.create 125.0 125.0 125.0 in
let target = Vec... | null | https://raw.githubusercontent.com/tjammer/raylib-ocaml/76955c30d0a776138daeb93bfc73b104aefc6f6d/examples/shaders/shaders_mesh_instanced.ml | ocaml | draw_mesh_instanced takes a ptr. CArrays can be instantly cast to/from ptrs
Get the locs array and assign the locations of the variables. This is necessary for the draw_mesh_instanced call.
* Curiously, draw_mesh works without setting these. | open Raylib
open Rlights
let width = 800
let height = 450
let count = 10000
let main () =
set_config_flags [ ConfigFlags.Msaa_4x_hint; ConfigFlags.Window_resizable ];
init_window width height "raylib [shaders] example - rlgl mesh instanced";
let position = Vector3.create 125.0 125.0 125.0 in
let target = Vec... |
eaef58d59fb423e828d4629f7b740ab4abf63b6297c82ee7970908d38b984147 | johnwhitington/ocamli | tinyocamlrw.mli | * Raised by [ of_real_ocaml ] if the program can not be represented in tiny ocaml .
exception UnknownNode of string
val realops : bool ref
* Convert real ocaml to tiny ocaml , raising [ UnknownNode ] if not possible for
the given program
the given program *)
val of_real_ocaml : Tinyocaml.env -> Parsetree.structure ... | null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/tinyocamlrw.mli | ocaml | Quick & nasty for top level. Removes the outside struct, returns env, removes let _ = of final. | * Raised by [ of_real_ocaml ] if the program can not be represented in tiny ocaml .
exception UnknownNode of string
val realops : bool ref
* Convert real ocaml to tiny ocaml , raising [ UnknownNode ] if not possible for
the given program
the given program *)
val of_real_ocaml : Tinyocaml.env -> Parsetree.structure ... |
7ed9d8c11c3203837dba7d57f6dc0e4f9a7ce24997ee23c368e2fdc39ee9ee08 | retrogradeorbit/cloud-fighter | user.clj | (ns user
(:require
[figwheel-sidecar.repl-api :as f]))
user is a namespace that the Clojure runtime looks for and
;; loads if its available
;; You can place helper functions in here. This is great for starting
;; and stopping your webserver and other development services
The definitions in here will be avai... | null | https://raw.githubusercontent.com/retrogradeorbit/cloud-fighter/4c4d30fc2d9b14ce4c73f3d252be519daaa09d51/dev/user.clj | clojure | loads if its available
You can place helper functions in here. This is great for starting
and stopping your webserver and other development services
You have to ensure that the libraries you :require are listed in your dependencies
Once you start down this path
you will probably want to look at
tools.namespace
... | (ns user
(:require
[figwheel-sidecar.repl-api :as f]))
user is a namespace that the Clojure runtime looks for and
The definitions in here will be available if you run " repl " or launch a
Clojure repl some other way
(defn fig-start
"This starts the figwheel server and watch based auto-compiler."
... |
f751ffd605b0b388ed3f74c106a387f337870dbcc626906d20509baac50b7e91 | markus-git/co-feldspar | Compile.hs | # language GADTs #
{-# language TypeOperators #-}
# language FlexibleContexts #
{-# language ScopedTypeVariables #-}
{-# language ConstraintKinds #-}
{-# language TypeSynonymInstances #-}
# language FlexibleInstances #
# language MultiParamTypeClasses #
# language QuasiQuotes #
module Feldspar... | null | https://raw.githubusercontent.com/markus-git/co-feldspar/bf598c803d41e03ed894bbcb490da855cce9250e/src/Feldspar/Software/Compile.hs | haskell | # language TypeOperators #
# language ScopedTypeVariables #
# language ConstraintKinds #
# language TypeSynonymInstances #
syntactic.
operational-higher.
imperative-edsl.
hardware-edsl
language-c-quote
hmm!
debug.
------------------------------------------------------------------------------
* Software co... | # language GADTs #
# language FlexibleContexts #
# language FlexibleInstances #
# language MultiParamTypeClasses #
# language QuasiQuotes #
module Feldspar.Software.Compile where
import Feldspar.Representation
import Feldspar.Software.Primitive
import Feldspar.Software.Primitive.Backend
import Feld... |
df9b8b28de0cd5048e5d60d0ae6cd4dfdb365e6d4acd5f8be94a2e1e587291c5 | zenspider/schemers | exercise.1.20.scm | #lang racket/base
Exercise 1.20 :
;; The process that a procedure generates is of course dependent on
;; the rules used by the interpreter. As an example, consider the
;; iterative `gcd' procedure given above. Suppose we were to interpret
;; this procedure using normal-order evaluation, as discussed in
section * ... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_1/exercise.1.20.scm | scheme | The process that a procedure generates is of course dependent on
the rules used by the interpreter. As an example, consider the
iterative `gcd' procedure given above. Suppose we were to interpret
this procedure using normal-order evaluation, as discussed in
method (for normal order), illustrate the process generat... | #lang racket/base
Exercise 1.20 :
section * Note 1 - 1 - 5 : : . ( The normal - order - evaluation rule for ` if '
is described in * Note Exercise 1 - 5 : : . ) Using the substitution
actually performed in the normal - order evaluation of ` ( gcd 206
40 ) ' ? In the applicative - order evaluation ?
(define... |
a7959c94cf54b76085c3edc48704bbed319893d7bddabeffb02b84781111b198 | rtoy/ansi-cl-tests | cosh.lsp | ;-*- Mode: Lisp -*-
Author :
Created : We d Feb 11 06:54:15 2004
;;;; Contains: Tests of COSH
(in-package :cl-test)
(deftest cosh.1
(let ((result (cosh 0)))
(or (eqlt result 1)
(eqlt result 1.0)))
t)
(deftest cosh.2
(loop for type in '(short-float single-float double-float long-float... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/cosh.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of COSH
Add accuracy tests here
Error tests | Author :
Created : We d Feb 11 06:54:15 2004
(in-package :cl-test)
(deftest cosh.1
(let ((result (cosh 0)))
(or (eqlt result 1)
(eqlt result 1.0)))
t)
(deftest cosh.2
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
for one ... |
0b686c7c1f4101f687358c1a88059799625c98ea2954ff1598f3bce717872eab | ssadler/zeno | Synchronous.hs | # LANGUAGE KindSignatures #
-- | Zeno uses a consensus algorithm, but it is stateless, it doesn't write any data
-- to disk. So, at any point it can pick up the current state from external blockchains
-- without syncing blocks. The synchronous process performs notarisations back and forth
between two chains in... | null | https://raw.githubusercontent.com/ssadler/zeno/9f715d7104a7b7b00dee9fe35275fb217532fdb6/src/Zeno/Notariser/Synchronous.hs | haskell | | Zeno uses a consensus algorithm, but it is stateless, it doesn't write any data
to disk. So, at any point it can pick up the current state from external blockchains
without syncing blocks. The synchronous process performs notarisations back and forth
------------------------------------------------------------... | # LANGUAGE KindSignatures #
between two chains in a synchronous manner .
module Zeno.Notariser.Synchronous where
import Data.Bits
import Control.Monad.Skeleton
import Network.Komodo
import Zeno.Consensus.Types
import Zeno.Console
import Zeno.Notariser.EthGateway
import Zeno.Notariser.Types
import Zeno.Notaris... |
64ee78a9885be6bfc63077c2d6a159d82f1f62065125f195606be68f5030bf57 | cyverse-archive/DiscoveryEnvironmentBackend | listing.clj | (ns metadactyl.routes.domain.analysis.listing
(:use [common-swagger-api.schema :only [describe]]
[metadactyl.routes.params :only [ResultsTotalParam]]
[schema.core :only [defschema optional-key Any Int Bool]])
(:import [java.util UUID]))
(def Timestamp (describe String "A timestamp in milliseconds s... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/metadactyl-clj/src/metadactyl/routes/domain/analysis/listing.clj | clojure | (ns metadactyl.routes.domain.analysis.listing
(:use [common-swagger-api.schema :only [describe]]
[metadactyl.routes.params :only [ResultsTotalParam]]
[schema.core :only [defschema optional-key Any Int Bool]])
(:import [java.util UUID]))
(def Timestamp (describe String "A timestamp in milliseconds s... | |
208992af4900aafe17efc8e3da7db183a0f9a7a2380d2e097021aaa7c3531eac | piotr-yuxuan/slava | config.clj | (ns piotr-yuxuan.slava.config
"FIXME add cljdoc"
(:require [piotr-yuxuan.slava.decode :as decode]
[piotr-yuxuan.slava.encode :as encode]
[camel-snake-kebab.core :as csk])
(:import (org.apache.avro.generic GenericData$EnumSymbol GenericData$Record)
(org.apache.avro.util Utf8)
... | null | https://raw.githubusercontent.com/piotr-yuxuan/slava/e894f6a8797577cfb7c2c48097fedd3c74946dd8/src/piotr_yuxuan/slava/config.clj | clojure | It's important to have all of them to resolve unions and further decode any nested datum when there is a need.
Union type can't be a concrete type.
It's important to have all of them to resolve unions and further encode any nested datum when there is a need.
Union type can't be a concrete type.
Explicit example of... | (ns piotr-yuxuan.slava.config
"FIXME add cljdoc"
(:require [piotr-yuxuan.slava.decode :as decode]
[piotr-yuxuan.slava.encode :as encode]
[camel-snake-kebab.core :as csk])
(:import (org.apache.avro.generic GenericData$EnumSymbol GenericData$Record)
(org.apache.avro.util Utf8)
... |
2c1119810aaaed6e8f581e28af5ebfd78645753fcb7ba32dc781ff06e01c2c26 | thlack/surfs | spec.clj | (ns ^:no-doc thlack.surfs.blocks.components.spec
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[thlack.surfs.blocks.spec :as blocks.spec]
[thlack.surfs.blocks.spec.actions :as actions]
[thlack.surfs.blocks.spec.context :as context]
[t... | null | https://raw.githubusercontent.com/thlack/surfs/e03d137d6d43c4b73a45a71984cf084d2904c4b0/src/thlack/surfs/blocks/components/spec.clj | clojure | [:actions]
[:section]
[:context]
[:header]
[:image]
[:input] | (ns ^:no-doc thlack.surfs.blocks.components.spec
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[thlack.surfs.blocks.spec :as blocks.spec]
[thlack.surfs.blocks.spec.actions :as actions]
[thlack.surfs.blocks.spec.context :as context]
[t... |
57436ae01e507f0a45fda53d830e5425a8d71279d5e03153b22852b3b5c549dd | brendanhay/amazonka | TimeSeriesServiceStatistics.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-xray/gen/Amazonka/XRay/Types/TimeSeriesServiceStatistics.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
| A list of TimeSeriesStatistic structures.
| The response time histogram for the selected entities.
| The forecasted high and low fault count values.
| Timestamp of the window for which statistics are aggregated.
|
Create a ... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Mo... |
b29bf4acd2e6f12b97ab522f99b4e8071cbd03905a0f2cdf1d8e250dc246b5d5 | mcorbin/tour-of-clojure | fn_map_second.clj | ;; add value in nested maps
(println (assoc-in
{:foo {:bar {:hello "hello"}}}
[:foo :bar :goodbye] "goodbye") "\n")
;; get a value in nested maps
(println (get-in
{:foo {:bar {:hello 1}}}
[:foo :bar :hello]) "\n")
;; update value in nested maps
(println (update-in
{:f... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/resources/public/pages/code/fn_map_second.clj | clojure | add value in nested maps
get a value in nested maps
update value in nested maps
select keys in a map | (println (assoc-in
{:foo {:bar {:hello "hello"}}}
[:foo :bar :goodbye] "goodbye") "\n")
(println (get-in
{:foo {:bar {:hello 1}}}
[:foo :bar :hello]) "\n")
(println (update-in
{:foo {:bar {:hello 1}}}
[:foo :bar :hello]
inc) "\n")
(println (select... |
649c39522e4453c4caefe2089d9d85c21b2ca8451a03b2d14ef571e57fed95bb | disteph/cdsat | Eq.ml | open Top
module Known = struct
let known =
let open Symbols in
function
| Eq _
| NEq _
-> true
| _ -> false
end
include Generic.Make(Known)
| null | https://raw.githubusercontent.com/disteph/cdsat/1b569f3eae59802148f4274186746a9ed3e667ed/src/kernel/kernel.mld/termstructures.mld/VarSet.mld/Eq.ml | ocaml | open Top
module Known = struct
let known =
let open Symbols in
function
| Eq _
| NEq _
-> true
| _ -> false
end
include Generic.Make(Known)
| |
b6add00e0a09bd6ad094c7ee8555447654242520ca60d99e203a2bb40b154617 | raviksharma/bartosz-basics-of-haskell | cat.hs | Implement function cat that concatenates two lists .
cat :: [a] -> [a] -> [a]
cat [] j = j
cat (i : rest) j = i : cat rest j
main = putStrLn $ cat "Hello " "World!"
| null | https://raw.githubusercontent.com/raviksharma/bartosz-basics-of-haskell/86d40d831f61415ef0022bff7fe7060ae6a23701/06-tokenizer-function-types/cat.hs | haskell | Implement function cat that concatenates two lists .
cat :: [a] -> [a] -> [a]
cat [] j = j
cat (i : rest) j = i : cat rest j
main = putStrLn $ cat "Hello " "World!"
| |
2c51ad0b0bee2de6788727ae2509c793746583d2299c5f8461c829f77ef8e5a5 | gedge-platform/gedge-platform | prometheus_text_format.erl | %% @doc
%%
Serializes Prometheus registry using the latest
%% [text format]().
%%
%% Example output:
%% <pre>
%% # TYPE http_request_duration_milliseconds histogram
%% # HELP http_request_duration_milliseconds Http Request execution time
%% http_request_duration_milliseconds_bucket{method="post",le="100"} 0
... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/prometheus/src/formats/prometheus_text_format.erl | erlang | @doc
[text format]().
Example output:
<pre>
# TYPE http_request_duration_milliseconds histogram
# HELP http_request_duration_milliseconds Http Request execution time
http_request_duration_milliseconds_bucket{method="post",le="100"} 0
http_request_duration_milliseconds_sum{method="post"} 4350
</pre>
... | Serializes Prometheus registry using the latest
http_request_duration_milliseconds_bucket{method="post",le="300 " } 1
http_request_duration_milliseconds_bucket{method="post",le="500 " } 3
http_request_duration_milliseconds_bucket{method="post",le="750 " } 4
http_request_duration_milliseconds_bucket{me... |
c1f12867c06e697d17ca70e45cf46e923015d5bf63c8a6e4c196d99d9d0189f2 | tommaisey/aeon | snippets.scm | ;; A bit of sawtooth inspiration
(let ([prog (over 8 [I III VI V])])
(pattern fake-inspiration
;; bass
(syn "saw-grain" (euc 16 13)
(to: :octave -2
:amp 0.15
:cutoff (sine 8 0.3 0.55)
:pan (over 1/4 [0.45 0.55])
:scd prog)
(legato)
... | null | https://raw.githubusercontent.com/tommaisey/aeon/12e8ff92bd5efed2923aecf974fa12d39835abc6/examples/snippets.scm | scheme | A bit of sawtooth inspiration
bass
melody
A little drum groove
A nice fluttery synth | (let ([prog (over 8 [I III VI V])])
(pattern fake-inspiration
(syn "saw-grain" (euc 16 13)
(to: :octave -2
:amp 0.15
:cutoff (sine 8 0.3 0.55)
:pan (over 1/4 [0.45 0.55])
:scd prog)
(legato)
(to* :sustain 3))
(syn "saw-grain" ... |
78e9302cde3cc0505eb9603011450e4a97391115e3c15be2146269aa3df33c2f | chiroptical/book-of-monads | Reader.hs | module Reader where
-- Terminology below is a reminder to self
newtype Reader r a =
-- ^ is called a "type constructor"
Reader
-- ^ is called a "data constructor"
{ runReader :: r -> a
-- ^ is called a "field"
}
instance Functor (Reader r) where
fmap f (Reader ra) = Reader $ f . ra
instanc... | null | https://raw.githubusercontent.com/chiroptical/book-of-monads/c2eff1c67a8958b28cfd2001d652f8b68e7c84df/chapter6/src/Reader.hs | haskell | Terminology below is a reminder to self
^ is called a "type constructor"
^ is called a "data constructor"
^ is called a "field"
handle :: Config -> Request -> Response
Refactor the above with the Reader Monad
Think of `cfg` as being threaded through the computation
handle :: Request -> Reader Con... | module Reader where
newtype Reader r a =
Reader
{ runReader :: r -> a
}
instance Functor (Reader r) where
fmap f (Reader ra) = Reader $ f . ra
instance Applicative (Reader r) where
pure = Reader . const
Reader rab <*> Reader ra = Reader $ \r -> rab r $ ra r
instance Monad (Reader r) where
return =... |
8bf603b664a7891a5e8535aa93225bbda39d83a3b072a479c8be8beddb0f2025 | xsc/kithara | project.clj | (defproject kithara "0.1.9-SNAPSHOT"
:description "A Clojure Library for Reliable RabbitMQ Consumers."
:url ""
:license {:name "MIT License"
:url ""
:year 2016
:key "mit"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/tools.loggi... | null | https://raw.githubusercontent.com/xsc/kithara/3394a9e9ef5e6e605637a74e070c7d24bfaf19cc/project.clj | clojure | (defproject kithara "0.1.9-SNAPSHOT"
:description "A Clojure Library for Reliable RabbitMQ Consumers."
:url ""
:license {:name "MIT License"
:url ""
:year 2016
:key "mit"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/tools.loggi... | |
fe57945586cd108a65536152d26530fc16dd77332053d0be8becd2d7e8fb8956 | ocaml-gospel/gospel | t29.mli | (**************************************************************************)
(* *)
GOSPEL -- A Specification Language for OCaml
(* *)
Copyright ( ... | null | https://raw.githubusercontent.com/ocaml-gospel/gospel/79841c510baeb396d9a695ae33b290899188380b/test/negative/t29.mli | ocaml | ************************************************************************
(as described in file LICE... | GOSPEL -- A Specification Language for OCaml
Copyright ( c ) 2018- The VOCaL Project
This software is free software , distributed under the MIT license
exception E of float list
val f : 'a -> 'a
@ x = f y
raises E l - > match l with
... |
42f1095a8d879d4adad9349679228f6d44439d14174e1d878876d76ff3de5128 | mistupv/cauder | dining_philo_dist.erl | -module(dining_philo_dist).
-export([main/0, waiter/0, fork/1, philo/2]).
main() ->
spawn_nodes(5),
io:format("Nodes: ~p~n", [nodes()]),
erlang:spawn(?MODULE, waiter, []).
spawn_nodes(0) ->
ok;
spawn_nodes(N) ->
slave:start('mac', string:concat("philo", integer_to_list(N))),
spawn_nodes(N - 1)... | null | https://raw.githubusercontent.com/mistupv/cauder/ff4955cca4b0aa6ae9d682e9f0532be188a5cc16/examples/distributed/dining_philo_dist.erl | erlang | Correct version
Buggy version | -module(dining_philo_dist).
-export([main/0, waiter/0, fork/1, philo/2]).
main() ->
spawn_nodes(5),
io:format("Nodes: ~p~n", [nodes()]),
erlang:spawn(?MODULE, waiter, []).
spawn_nodes(0) ->
ok;
spawn_nodes(N) ->
slave:start('mac', string:concat("philo", integer_to_list(N))),
spawn_nodes(N - 1)... |
821ea401cc6745d9366e96a5cb51d84205e001441f66c166d5b4285b1dd2fb69 | philnguyen/soft-contract | data-adaptor.rkt | #lang racket
(module sub racket/base
(require racket/contract
"data.rkt")
(provide
(contract-out
(struct posn ([x real?])))))
(require 'sub)
(define x 42)
(provide
[struct-out posn]
(contract-out ; make sure it's reached
[x string?]))
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/issues/struct-out-twice/data-adaptor.rkt | racket | make sure it's reached | #lang racket
(module sub racket/base
(require racket/contract
"data.rkt")
(provide
(contract-out
(struct posn ([x real?])))))
(require 'sub)
(define x 42)
(provide
[struct-out posn]
[x string?]))
|
75627ad690e168ffb7eb3a0be37ab89f2384f96ffbd6bb68c13ef6a26df03c3e | FPtje/miso-isomorphic-example | Main.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
module Main where
import qualified Common
import Data.Proxy
import qualified Lucid as L
import qualified... | null | https://raw.githubusercontent.com/FPtje/miso-isomorphic-example/f14d9d40cd66d6e663c38b3798bcc8d3fe8ab2cf/server/Main.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
Alternative type:
Servant.Server (ToServerRoutes Common.Home HtmlPage Common.Action)
Alternative type:
Servant.Server (ToServerRoutes Common.Flipped HtmlPage Common.Action)
Renders the /flipped p... | # LANGUAGE TypeApplications #
module Main where
import qualified Common
import Data.Proxy
import qualified Lucid as L
import qualified Lucid.Base as L
import qualified Network.HTTP.Types as HTTP
import qualified Network.Wa... |
f4e59617e0167b824b2683c6f7feafcea219b309cd878331ceaa4a4762f73807 | hugoduncan/oldmj | bump.clj | (ns makejack.tools.bump
"Bump version"
(:require [clojure.edn :as edn]
[clojure.string :as str]
[makejack.api.core :as makejack]
[makejack.api.filesystem :as filesystem]
[makejack.api.path :as path]
[makejack.api.tool :as tool]
[makejack.api.ut... | null | https://raw.githubusercontent.com/hugoduncan/oldmj/0a97488be7457baed01d2d9dd0ea6df4383832ab/tools/src/makejack/tools/bump.clj | clojure | (ns makejack.tools.bump
"Bump version"
(:require [clojure.edn :as edn]
[clojure.string :as str]
[makejack.api.core :as makejack]
[makejack.api.filesystem :as filesystem]
[makejack.api.path :as path]
[makejack.api.tool :as tool]
[makejack.api.ut... | |
d38929a03d13b773ee8001b07491f31da1d2c938ae8125cd2c858b3ad6097451 | blindglobe/clocc | sysdef.lisp | (in-package :user)
(eval-when (load eval)
(unless (find-package :mk)
(load "library:defsystem"))
)
(defparameter *here* (make-pathname
:directory (pathname-directory *load-truename*)))
#+pcl
(progn
(pushnew 'compile pcl::*defclass-times*)
(pushnew 'compile pcl::*defgeneric-times*))
(defvar *clx-directo... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/gui/clue/sysdef.lisp | lisp | Ensure VALUES is a legal declaration
Don't warn about botched values decls
This is now in current sources
Define packages
Modify xlib:create-window
pointer documentation window support
pw adds
The "guts"
Resource and type conversion
Gray stipple patterns
Standard cursor names
Event handling
Support for wi... | (in-package :user)
(eval-when (load eval)
(unless (find-package :mk)
(load "library:defsystem"))
)
(defparameter *here* (make-pathname
:directory (pathname-directory *load-truename*)))
#+pcl
(progn
(pushnew 'compile pcl::*defclass-times*)
(pushnew 'compile pcl::*defgeneric-times*))
(defvar *clx-directo... |
4d8c4ce19a01ba3765e701b4fcbbbe8aa877f5343b47733ffebd1703a9458af2 | Spivoxity/obc-3 | info.ml |
* info.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006 - -2016 J. M. Spivey
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . ... | null | https://raw.githubusercontent.com/Spivoxity/obc-3/9e5094df8382ac5dd25ff08768277be6bd71a4ae/debugger/info.ml | ocaml |
* info.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006 - -2016 J. M. Spivey
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . ... | |
c9ecaa16e84801b3a30382ea624e2dabbbcc3e2b20cd8679b74cb911a62d99dd | reagent-project/reagent-template | core_test.cljs | (ns {{project-ns}}.core-test
(:require
[cljs.test :refer-macros [is are deftest testing use-fixtures]]
[reagent.core :as reagent :refer [atom]]
[reagent.dom :as rdom]
[{{project-ns}}.core :as rc]))
(def isClient (not (nil? (try (.-document js/window)
(catch js/Object e nil)... | null | https://raw.githubusercontent.com/reagent-project/reagent-template/c769c6806540a9faafec36c27b07a1c86ae5eff7/resources/leiningen/new/reagent/test/cljs/reagent/core_test.cljs | clojure | (ns {{project-ns}}.core-test
(:require
[cljs.test :refer-macros [is are deftest testing use-fixtures]]
[reagent.core :as reagent :refer [atom]]
[reagent.dom :as rdom]
[{{project-ns}}.core :as rc]))
(def isClient (not (nil? (try (.-document js/window)
(catch js/Object e nil)... | |
fb44faeb326f3a344b40403092889478aec5efba6ed2b6a1446d438bb404fe90 | facebookincubator/hsthrift | MD5Test.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
module MD5Test (main) where
import Test.HUnit
import TestRunner
import Util.MD5
tests :: Test
tests = TestList
[ TestLabel "md5Test" $ TestCase $
assertEqual "md5Test" (md5 "wibble") "50eccc6e2b0d307d5e8a40fb296f6171" ]
main :: IO ()
main = testRunner ... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/d3ff75d487e9d0c2904d18327373b603456e7a01/common/util/tests/MD5Test.hs | haskell | Copyright ( c ) Facebook , Inc. and its affiliates .
module MD5Test (main) where
import Test.HUnit
import TestRunner
import Util.MD5
tests :: Test
tests = TestList
[ TestLabel "md5Test" $ TestCase $
assertEqual "md5Test" (md5 "wibble") "50eccc6e2b0d307d5e8a40fb296f6171" ]
main :: IO ()
main = testRunner ... | |
87bb0bde21ebc5d1e4f8e1730b595951dc166721894ad0f61763d6be89b4f75f | TiltMeSenpai/Discord.hs | language.hs | {-# LANGUAGE OverloadedStrings, RecordWildCards #-}
import Network.Discord
import Pipes
import Data.Text
import Control.Monad.IO.Class
main = runBot (Bot "TOKEN") $ do
with ReadyEvent $ \_ -> do
liftIO $ putStr "Hello, World!"
with MessageCreateEvent $ \msg@Message{messageAuthor=User{userIsBot=bot}} -> do
... | null | https://raw.githubusercontent.com/TiltMeSenpai/Discord.hs/91f688f03813982bbf7c37d048bd7bcc08671d8e/examples/language.hs | haskell | # LANGUAGE OverloadedStrings, RecordWildCards # | import Network.Discord
import Pipes
import Data.Text
import Control.Monad.IO.Class
main = runBot (Bot "TOKEN") $ do
with ReadyEvent $ \_ -> do
liftIO $ putStr "Hello, World!"
with MessageCreateEvent $ \msg@Message{messageAuthor=User{userIsBot=bot}} -> do
liftIO $ print msg
unless bot $
fetch' $ C... |
2fbc8793b396c70c6b5f6d0940e7178ac2a2e31b85e6573030cfe3431529c75f | softlab-ntua/bencherl | api_json_dht_raw.erl | 2012 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distribut... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/scalaris/src/json/api_json_dht_raw.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2012 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(api_json_dht_raw).
-author('').
-vsn('$Id$').
-export([handler/2]).
for :
-export([range_read/2]).
-include("s... |
d144046a2b3abaa345cf1ada950a17a46dc604111d133c6772f494d6440119f2 | ndmitchell/uniplate | Typeable.hs | # LANGUAGE CPP , FlexibleInstances , FlexibleContexts , UndecidableInstances , MultiParamTypeClasses #
# OPTIONS_GHC -Wno - orphans -Wno - simplifiable - class - constraints #
module Uniplate.Typeable where
import Data.Generics.Uniplate.Typeable
#include "CommonInc.hs"
toMap = id
fromMap = id
instance (Ord a, Typeabl... | null | https://raw.githubusercontent.com/ndmitchell/uniplate/7d3039606d7a083f6d77f9f960c919668788de91/Uniplate/Typeable.hs | haskell | GENERATED | # LANGUAGE CPP , FlexibleInstances , FlexibleContexts , UndecidableInstances , MultiParamTypeClasses #
# OPTIONS_GHC -Wno - orphans -Wno - simplifiable - class - constraints #
module Uniplate.Typeable where
import Data.Generics.Uniplate.Typeable
#include "CommonInc.hs"
toMap = id
fromMap = id
instance (Ord a, Typeabl... |
eed45da14b14494ec43d0ee95f06144bb3a345f0c6eb51948bc0549db3487118 | afronski/bferl | bferl_vm_thread.erl | -module(bferl_vm_thread).
-behaviour(gen_server).
-include("../include/virtual_machine_definitions.hrl").
-export([ start_link/1 ]).
-export([ init/1,
handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3 ]).
enable_flags({debug, true}, State) -> State#{ "Debug" => true }... | null | https://raw.githubusercontent.com/afronski/bferl/18d3482c71cdb0e39bde090d436245a2a9531f49/src/bferl_vm_thread.erl | erlang | -module(bferl_vm_thread).
-behaviour(gen_server).
-include("../include/virtual_machine_definitions.hrl").
-export([ start_link/1 ]).
-export([ init/1,
handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3 ]).
enable_flags({debug, true}, State) -> State#{ "Debug" => true }... | |
79eb793dc5c7baa0e6ba0585d568e0d311c9aa4a2d431f451f5bd16ac4561e23 | paramander/mollie-api-haskell | API.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PartialTypeSignatures #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
module Mollie.API
... | null | https://raw.githubusercontent.com/paramander/mollie-api-haskell/4bd8386a7682abd5007b291fe72649e4cf41a7b0/src/Mollie/API.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE RankNTypes #
# LANGUAGE TypeOperators #
import qualified Paths_mollie_api_haskell as Self | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE TypeFamilies #
module Mollie.API
( MollieServantAPI
, MollieAPI
, HalJSON
, chargebackClient
, customerClient
, mandateClient
, methodClient
, paymentClient
... |
5e79f947ecfac0b20b5898e1fc4c490a20e0741844abee376e988e410f50fadd | zk/nsfw | mongo_test.clj | (ns nsfw.mongo-test
(:use [nsfw.mongo :as mon] :reload)
(:use [clojure.test]))
(deftest test-parse-username
(is (= "foo" (parse-username (java.net.URI. ":"))))
(is (= nil (parse-username (java.net.URI. "")))))
(deftest test-parse-password
(is (= "bar" (parse-password (java.net.URI. ":"))))
(is (= nil ... | null | https://raw.githubusercontent.com/zk/nsfw/ea07ba20cc5453b34a56b34c9d8738bf9bf8e92f/test/clj/nsfw/mongo_test.clj | clojure | (ns nsfw.mongo-test
(:use [nsfw.mongo :as mon] :reload)
(:use [clojure.test]))
(deftest test-parse-username
(is (= "foo" (parse-username (java.net.URI. ":"))))
(is (= nil (parse-username (java.net.URI. "")))))
(deftest test-parse-password
(is (= "bar" (parse-password (java.net.URI. ":"))))
(is (= nil ... | |
7049cc1969b04f4138d77ab1205916cce4eaadc2934d0af995fe601679aadd7e | daveliepmann/vdquil | figure8.clj | , Chapter 4 ( Time Series ) , figure 8 :
;; Continuously drawn time series using vertices
Converted from Processing to Quil as an exercise by
(ns vdquil.chapter4.figure8
(:use [quil.core]
[vdquil.util]
[vdquil.chapter4.ch4data]))
(def current-column (atom 0))
(defn get-current-column
"... | null | https://raw.githubusercontent.com/daveliepmann/vdquil/f40788ff7634870a9a5f1dc4ca3df8543beaf00b/src/vdquil/chapter4/figure8.clj | clojure | Continuously drawn time series using vertices
Draw year labels
Use thin, gray lines to draw the grid
Draw volume labels
Since we're not drawing the minor ticks, we would ideally
Commented out--the minor tick marks are too visually distracting
; Draw minor tick
Draw major tick mark
Center vertically
Align the ... | , Chapter 4 ( Time Series ) , figure 8 :
Converted from Processing to Quil as an exercise by
(ns vdquil.chapter4.figure8
(:use [quil.core]
[vdquil.util]
[vdquil.chapter4.ch4data]))
(def current-column (atom 0))
(defn get-current-column
"Key handling function `switch-data-set` increment... |
282171d10f0a81cc833d7e9abb69f4287be6ad3c7fad2a4025bd5272ce1989fb | gregtatcam/imaplet-lwt | maildir_read.ml | open Lwt
open Re
open Irmin_unix
open Sexplib
open Sexplib.Conv
open Imaplet
open Commands
exception InvalidCommand
let re = Re_posix.compile_pat "^([0-9]+) (.+)$"
let re_read = Re_posix.compile_pat "^read ([0-9]+|\\*)$"
let re_fetch = Re_posix.compile_pat "^([^ ]+) fetch 1:([^ ]+)"
let re_login = Re_posix.compile_p... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/test/maildir_read.ml | ocaml | open Lwt
open Re
open Irmin_unix
open Sexplib
open Sexplib.Conv
open Imaplet
open Commands
exception InvalidCommand
let re = Re_posix.compile_pat "^([0-9]+) (.+)$"
let re_read = Re_posix.compile_pat "^read ([0-9]+|\\*)$"
let re_fetch = Re_posix.compile_pat "^([^ ]+) fetch 1:([^ ]+)"
let re_login = Re_posix.compile_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.