_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 |
|---|---|---|---|---|---|---|---|---|
981ea75f8cfa6f6fa85bb49df5dc92e2f37166eb15606c1a53571d4a827020cc | nick8325/quickspec | Matrix.hs | -- A simple example testing arithmetic functions.
# LANGUAGE TupleSections , TypeSynonymInstances , FlexibleInstances #
import QuickSpec hiding (A)
import QuickSpec.Internal hiding (A)
import qualified QuickSpec.Internal.Haskell as Haskell
import Test.QuickCheck
import Twee.Pretty
import Control.Monad
import Data.Matri... | null | https://raw.githubusercontent.com/nick8325/quickspec/71171643e93c39d05840931dfda5949bb3a19f7e/examples/Matrix.hs | haskell | A simple example testing arithmetic functions.
compare = comparing show
arbitrary = sized arb
where
arb n =
frequency $
concat
| n > 0 ] ++
concat
[(n*5, (+) <$> arb2 <*> arb2),
(n*5, (*) <$> arb2 <*> arb2)]
| n > 0 ]
... | # LANGUAGE TupleSections , TypeSynonymInstances , FlexibleInstances #
import QuickSpec hiding (A)
import QuickSpec.Internal hiding (A)
import qualified QuickSpec.Internal.Haskell as Haskell
import Test.QuickCheck
import Twee.Pretty
import Control.Monad
import Data.Matrix
import Data.Ord
import Data.Either
import Data.V... |
128d4aa19071541a2819ff49abae9cb8ca853ded9478c7148983b114ff577104 | ekmett/coda | Pretty.hs | {-# language CPP #-}
# language TemplateHaskell #
{-# language DefaultSignatures #-}
module Console.Pretty
(
-- * options
FancyOptions(..)
, HasFancyOptions(..)
, parseFancyOptions
-- * pretty printing
, putFancy
, hPutFancy
-- * useful internals
, fcols
) where
import Control.Monad.IO.Class
i... | null | https://raw.githubusercontent.com/ekmett/coda/bca7e36ab00036f92d94eb86298712ab1dbf9b8d/src/console/Console/Pretty.hs | haskell | # language CPP #
# language DefaultSignatures #
* options
* pretty printing
* useful internals | # language TemplateHaskell #
module Console.Pretty
(
FancyOptions(..)
, HasFancyOptions(..)
, parseFancyOptions
, putFancy
, hPutFancy
, fcols
) where
import Control.Monad.IO.Class
import Control.Lens
import Data.Bool (bool)
import Data.Char (toLower)
import Data.Default.Class
import Data.Maybe (fro... |
7172bee945c1885b3cda0713c086d5a56150f6ba06ea746fabce1cee826c3642 | egison/egison-scheme | bench-unjoin.scm | (load "./egison.scm")
(print (match-all (iota 4000 1) (List Something)
((join xs ys) `(,xs ,ys))))
| null | https://raw.githubusercontent.com/egison/egison-scheme/49188f4bcf91199a9e1d5142851a48ed2eb916e1/benchmark/bench-unjoin.scm | scheme | (load "./egison.scm")
(print (match-all (iota 4000 1) (List Something)
((join xs ys) `(,xs ,ys))))
| |
97df8364ccc98df1a4ca1d9da2671c9a6ca0484425d3dd4620041eae267d5d74 | rigidus/rigidus.ru | fileseg.lisp | -*- Mode : Common - lisp ; Package : ytools ; : ytools ; -*-
(in-package :ytools)
(eval-when (:compile-toplevel :load-toplevel :execute :slurp-toplevel)
(export '(def-file-segment)))
;;; Let's keep this really low-level, part of YTFM
;;;; (depends-on %module/ ytools)
;;;;(depends-on (:at :read-time) %ytools/ bq... | null | https://raw.githubusercontent.com/rigidus/rigidus.ru/34fe088f5c3d22243b49cf97f376c8f3c1243dff/ytools/fileseg.lisp | lisp | Package : ytools ; : ytools ; -*-
Let's keep this really low-level, part of YTFM
(depends-on %module/ ytools)
(depends-on (:at :read-time) %ytools/ bq)
Chunk for the file containing this segment --
Function of no arguments such that calling it derives
the chunk --
(err-out "Calling chunk-with-name " name ... | (in-package :ytools)
(eval-when (:compile-toplevel :load-toplevel :execute :slurp-toplevel)
(export '(def-file-segment)))
(defclass File-segment-chunk (Chunk)
((name :initarg :name)
(containing-file :initarg :containing-file
:accessor File-segment-chunk-containing-file)
(content :initarg :content
... |
efc577cf372b80857cc3badb4bdb462fd4009ca36c7f2b97dad6ddd042626ca5 | haskell-servant/servant | BrokenSpec.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
# OPTIONS_GHC -freduction - depth=100 #
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Servant.BrokenSpec (spec) where
import Prelude ()
import Prelude... | null | https://raw.githubusercontent.com/haskell-servant/servant/29d2553e74785f696186e2e62cf973d13ac18833/servant-client/test/Servant/BrokenSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
* api for testing inconsistencies between client and server | # OPTIONS_GHC -freduction - depth=100 #
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Servant.BrokenSpec (spec) where
import Prelude ()
import Prelude.Compat
import Data.Monoid ()
import Data.Proxy
import qualified Netw... |
6d11dd01c1d7a35d32dce9de4d9417040fbbdd5300ef4ed0d5b5c43c1d6534ad | tfausak/patrol | SystemSdkInfo.hs | module Patrol.Type.SystemSdkInfo where
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Patrol.Extra.Aeson as Aeson
-- | <-payloads/types/#systemsdkinfo>
data SystemSdkInfo = SystemSdkInfo
{ sdkName :: Text.Text,
versionMajor :: Maybe Int,
versionMinor :: Maybe Int,
... | null | https://raw.githubusercontent.com/tfausak/patrol/1cae55b3840b328cda7de85ea424333fcab434cb/source/library/Patrol/Type/SystemSdkInfo.hs | haskell | | <-payloads/types/#systemsdkinfo> | module Patrol.Type.SystemSdkInfo where
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Patrol.Extra.Aeson as Aeson
data SystemSdkInfo = SystemSdkInfo
{ sdkName :: Text.Text,
versionMajor :: Maybe Int,
versionMinor :: Maybe Int,
versionPatchlevel :: Maybe Int
}
... |
967e99e6cdafea370f21ad2a46540c5e350717c9d4ed4235a256d7da844bd676 | johnyob/ppx-open | main.ml | module Foo = struct
let val1 = 1
module type S = sig
type z = Z
type _ s = S
type _ t =
| Zero : z t
| Succ : 'n t -> 'n s t
end
end
{%%open| Foo.(val1 as renamed1, module type S as Nat) |}
let () = print_endline (string_of_int renamed1)
module Nat_impl : Nat = struct
type z = Z
t... | null | https://raw.githubusercontent.com/johnyob/ppx-open/14e56f1a9f8d6df390387baf802ca13c66a306dc/bin/main.ml | ocaml | module Foo = struct
let val1 = 1
module type S = sig
type z = Z
type _ s = S
type _ t =
| Zero : z t
| Succ : 'n t -> 'n s t
end
end
{%%open| Foo.(val1 as renamed1, module type S as Nat) |}
let () = print_endline (string_of_int renamed1)
module Nat_impl : Nat = struct
type z = Z
t... | |
c05bff8ebd2c3313a5dd97ad12a8203a7be135ddba18d9dcdd0c95a875dd18e8 | evaporei/hisp | Tokenize.hs | module Tokenize
( tokenize
) where
-- adapted from: -in-haskell/
replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace _ _ [] = []
replace find repl s =
if take (length find) s == find
then repl ++ replace find repl (drop (length find) s)
else head s : replace find repl (tail s)
tokenize :: ... | null | https://raw.githubusercontent.com/evaporei/hisp/7020720f9ff78cb84822649babcb6c21a64c2cea/src/Tokenize.hs | haskell | adapted from: -in-haskell/ | module Tokenize
( tokenize
) where
replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace _ _ [] = []
replace find repl s =
if take (length find) s == find
then repl ++ replace find repl (drop (length find) s)
else head s : replace find repl (tail s)
tokenize :: String -> [String]
tokenize = ... |
95fadc5338ec42986b3edcd22611ee81d4c0c0bae6b1ceed1ea169262227bd52 | AndrasKovacs/ELTE-func-lang | Notes01.hs | # options_ghc -Wincomplete - patterns #
-- ghci, holes, gyakorló feladatok
funkc prog : ( , listák )
( amit fogunk : listakifejezések , numerikus típusok )
feladatmegoldás : , ossza meg a képernyőjét
ghci infok :
parancsok :
: l < fájl >
: r újratölt ( típuselle... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-2/gyak_1/Notes01.hs | haskell | ghci, holes, gyakorló feladatok
||--
||--
map' :: (t -> a) -> [t] -> [a]
operátor info ghci-ben:
:i (***)
(***) :: Int -> Int -> Int
Defined at ...
------------------------------------------------------------------------------
vagy Prelude-ből standard függvényt.
függvények
------------------------------------... | # options_ghc -Wincomplete - patterns #
funkc prog : ( , listák )
( amit fogunk : listakifejezések , numerikus típusok )
feladatmegoldás : , ossza meg a képernyőjét
ghci infok :
parancsok :
: l < fájl >
: r újratölt ( típusellenőrzés )
: t < kifejezés > me... |
3bb99df128de3311606da0e63d509fd74dad9f49405c86484b5c7c0575ae0c5c | hsyl20/haskus-system | Object.hs | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
-- | Object
module Haskus.System.Linux.Graphics.Object
( Object(..)
, ObjectType(..)
, ObjectNotFound
, getObjectPropertyCount
, getObjectProperties
, setObjectPrope... | null | https://raw.githubusercontent.com/hsyl20/haskus-system/2f389c6ecae5b0180b464ddef51e36f6e567d690/haskus-system/src/lib/Haskus/System/Linux/Graphics/Object.hs | haskell | | Object
| Get object's number of properties
| Return object properties
using an initial value we avoid a syscall in most cases.
check that we have allocated enough entries to store the properties
| Set an object property
| Set an object property | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
module Haskus.System.Linux.Graphics.Object
( Object(..)
, ObjectType(..)
, ObjectNotFound
, getObjectPropertyCount
, getObjectProperties
, setObjectProperty
, set... |
16a7a9018fe7a1bc1f5b9e46874e571929c697c4939dceceeae1c1a83430bd2b | TerrorJack/ghc-alter | Unique.hs | # LANGUAGE Trustworthy #
# LANGUAGE MagicHash #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Unique
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability ... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/Data/Unique.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Unique
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable
An abstract interface to a unique symbol generator.
-----------------... | # LANGUAGE Trustworthy #
# LANGUAGE MagicHash #
Copyright : ( c ) The University of Glasgow 2001
module Data.Unique (
Unique,
newUnique,
hashUnique
) where
import System.IO.Unsafe (unsafePerformIO)
import GHC.Base
import GHC.Num
import Data.IORef
newtype Unique = Unique Integer deriving (Eq,Ord)
... |
33ff519cebf97b12e507988412c76343ac2274f003b2901fc015474b67e6c180 | lolepezy/rpki-prover | SlurmSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module RPKI.SLURM.SlurmSpec where
import Control.Lens
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import ... | null | https://raw.githubusercontent.com/lolepezy/rpki-prover/11ec79415d5c1fcd7ad5f2f98c15309d4efeb1b2/test/src/RPKI/SLURM/SlurmSpec.hs | haskell | # LANGUAGE OverloadedStrings #
validate overlapping with itself | # LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module RPKI.SLURM.SlurmSpec where
import Control.Lens
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Test.Tasty
import qualified T... |
7f8a878c0d64f7a22b0f77a674c6516a9ec45c3ee9be0a9edae94b0dd1c19e3d | jordanthayer/ocaml-search | aest_histo.ml | *
@author jtd7
@since 2012 - 03 - 29
@author jtd7
@since 2012-03-29
*)
open Astar_est
let poly_features = Gest_histo.poly_features
let compute_poly = Gest_histo.compute_poly
let compute = Gest_histo.compute
let compute_all = Gest_histo.compute_all
let make_est degree init_d =
let max_ind ... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/progress_estimate/aest_histo.ml | ocaml | *
@author jtd7
@since 2012 - 03 - 29
@author jtd7
@since 2012-03-29
*)
open Astar_est
let poly_features = Gest_histo.poly_features
let compute_poly = Gest_histo.compute_poly
let compute = Gest_histo.compute
let compute_all = Gest_histo.compute_all
let make_est degree init_d =
let max_ind ... | |
0d0d61f1928c304667cf04c40222d64f479d9f0261004fce6e0af93ab80c113a | MLstate/opalang | surfaceAst.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/opalang/surfaceAst.ml | ocaml | *A name as parsed in the source
* Generate a unique hash for a name.
Usage: [hash name description].
TODO Move expand here
*
Internal data structures.
Not all of these data structures are visible in the concrete syntax.
For instance, the concrete syntax offers [text] (Unicode ropes)
instead of [s... |
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... |
ad58480cd8dbf7c8b7ba162a38eb72d979355dd805314255033455cbab9c8966 | seckcoder/course-compiler | uncover-types.rkt | #lang racket
(provide uncover-types uncover-types-define)
;; This file provides the uncover-types function which can be used to
;; recover type information for variables in the program body. This
;; function can be used to help simplify the complexity of
;; expose-allocation and uncover-call-live-roots. Expose-allocat... | null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/uncover-types.rkt | racket | This file provides the uncover-types function which can be used to
recover type information for variables in the program body. This
function can be used to help simplify the complexity of
expose-allocation and uncover-call-live-roots. Expose-allocation
needs the type of each allocated vector in order to correctly... | #lang racket
(provide uncover-types uncover-types-define)
(module+ test
(require "utilities.rkt")
(define test-prog1
'(program (foo bar baz bam)
(type Integer)
(assign foo (vector 777))
(assign bar (vector foo foo))
(assign _ (vector-set! foo 0 42))
... |
fc32e654af0e85abf292705374472ef7cb9bf45f1f82816d853ccfc6ec4d995f | alanzplus/EOPL | A-interpreter-test.rkt | #lang eopl
(require rackunit "A-interpreter.rkt")
(require rackunit/text-ui)
(define A-interpreter-test
(test-suite
"A-interpreter-test"
(check-equal?
(run "3")
(num-val 3))
(check-equal?
(run "if zero?(0) then -(1,3) else -(1,4)")
(num-val -2))
(check-equal?
(run "let ... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/interpreter/A-interpreter-test.rkt | racket | #lang eopl
(require rackunit "A-interpreter.rkt")
(require rackunit/text-ui)
(define A-interpreter-test
(test-suite
"A-interpreter-test"
(check-equal?
(run "3")
(num-val 3))
(check-equal?
(run "if zero?(0) then -(1,3) else -(1,4)")
(num-val -2))
(check-equal?
(run "let ... | |
8a7fda97ab58d923ce7025710514c4e82d73b56d3bbb93626ac74ac6f49a5234 | davidlazar/ocaml-semantics | if03.ml | if not (true || false) then (1+3) else (4-5+1)
| null | https://raw.githubusercontent.com/davidlazar/ocaml-semantics/6f302c6b9cced0407d501d70ad25c2d2aefbb77d/tests/unit/if03.ml | ocaml | if not (true || false) then (1+3) else (4-5+1)
| |
0faf8988901508db2b029a6be0e644326f48c7bbcd8826ca6dff682c82f9b858 | acl2/acl2 | nth2@useless-runes.lsp | (NTH2)
| null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/kestrel/bv-lists/.sys/nth2%40useless-runes.lsp | lisp | (NTH2)
| |
70cb13e31de113120ca26666284f5c06de3117c72aaaa02bf60abc2beddcaf46 | LonoCloud/arrows | vis.clj | generate a graphviz DOT file from an arrow expression
(ns arrows.vis
(:require [clojure.zip :as z]))
(defprotocol ArrowVis
(set-attr* [p kv-pairs])
(label [p lbl])
(op [p])
(sub-procs [p])
(args [p]))
(defn genkey []
(keyword (str (gensym "node_"))))
(defn subgraph? [dg]
(contains? dg :entry))
(de... | null | https://raw.githubusercontent.com/LonoCloud/arrows/2def9db48e684913d51da3065b010687041caf4f/src/arrows/vis.clj | clojure | TODO: refactor | generate a graphviz DOT file from an arrow expression
(ns arrows.vis
(:require [clojure.zip :as z]))
(defprotocol ArrowVis
(set-attr* [p kv-pairs])
(label [p lbl])
(op [p])
(sub-procs [p])
(args [p]))
(defn genkey []
(keyword (str (gensym "node_"))))
(defn subgraph? [dg]
(contains? dg :entry))
(de... |
610e6ac51396938d56b77022bc8fdcedbe6008b8b33850ce27cb7f553312a5c5 | galdor/erl-cbor | cbor_encoding.erl | Copyright ( c ) 2020 - 2021 < > .
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC... | null | https://raw.githubusercontent.com/galdor/erl-cbor/89175b6fbee77a92da4395356266fc732ec1cbca/src/cbor_encoding.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2020 - 2021 < > .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(cbor_encoding).
-export([encode/1]).
-spec enco... |
44bba588c1e3ababa5c575e713279b5911c24cc2bcb4e1eba584e52cd2fdbec6 | clojure-clutch/clutch | http_client.clj | (ns com.ashafa.clutch.http-client
(:require [clj-http.client :as http]
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.string :as str]
[com.ashafa.clutch.utils :as utils])
(:use [cemerick.url :only (url)]
[slingshot.slingshot :only (thr... | null | https://raw.githubusercontent.com/clojure-clutch/clutch/62d5ae95b975e3bd072d83b55dfea540cb7e19f8/src/com/ashafa/clutch/http_client.clj | clojure | TODO why are we dissoc'ing :rows here? | (ns com.ashafa.clutch.http-client
(:require [clj-http.client :as http]
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.string :as str]
[com.ashafa.clutch.utils :as utils])
(:use [cemerick.url :only (url)]
[slingshot.slingshot :only (thr... |
77a13cbb59779aa13b760db5e756f2d0294324dd3b2f659558da0a6523a97728 | heraldry/heraldicon | spec_util.cljs | (ns spec.heraldicon.spec-util
(:require
[cljs.spec.alpha :as s]
[clojure.string :as str])
(:require-macros [spec.heraldicon.spec-util]))
(defn key-in? [m]
(-> m keys set))
(def non-blank-string?
(s/and string? (complement str/blank?)))
(def pos-number?
(s/and number? (complement neg?)))
(defn- speci... | null | https://raw.githubusercontent.com/heraldry/heraldicon/19c9d10485bbc48e98ddee30092a246cccc986d2/src/spec/heraldicon/spec_util.cljs | clojure | (ns spec.heraldicon.spec-util
(:require
[cljs.spec.alpha :as s]
[clojure.string :as str])
(:require-macros [spec.heraldicon.spec-util]))
(defn key-in? [m]
(-> m keys set))
(def non-blank-string?
(s/and string? (complement str/blank?)))
(def pos-number?
(s/and number? (complement neg?)))
(defn- speci... | |
d14037289469cc0328f5e7077f8d252088da39b93198dc2cb696d39d8fb7aab2 | mbutterick/beautiful-racket | Xor.tst.rkt | #lang hdl-tst-demo
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Xor.tst
load Xor.hdl,
output-file Xor.out,
compare-to Xor.cmp,
output-list a%B3.1.3 b%B3.1.3 out%B3.1.3;
set a 0,
set b 0,
eval,
output;
s... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/hdl-demo/Xor.tst.rkt | racket | #lang hdl-tst-demo
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/01/Xor.tst
load Xor.hdl,
output-file Xor.out,
compare-to Xor.cmp,
set a 0,
set b 0,
eval,
set a 0,
set b 1,
eval,
set a 1,
set b 0,
eval,
s... | |
9c00a485498ded6720e49f3b31f951906a9c3887e562c6f7fc4adbae3b3fc62f | gethop-dev/hydrogen.duct-template | session.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
;; file, You can obtain one at /
{{=<< >>=}}
(ns <<namespace>>.client.session
(:require [clojure.spec.alpha :as s]
[re-frame.core :as rf]
[<<namespace>... | null | https://raw.githubusercontent.com/gethop-dev/hydrogen.duct-template/34d56aa499af1e673d9587b7da0cca2b126ff106/resources/session/keycloak/cljs/session.cljs | clojure | file, You can obtain one at /
functional way. When you create a keycloak object to interact with
it, it keeps a lot of internal state that it needs to perform
operations like login state, logout, token refreshment, etc. If we
create a new object with the same configuration settings, we don't
get any of that inter... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
{{=<< >>=}}
(ns <<namespace>>.client.session
(:require [clojure.spec.alpha :as s]
[re-frame.core :as rf]
[<<namespace>>.client.session.oidc-sso :as oid... |
f5505830a6c2f6cc13212b8c228b10208145b0af6a9f9038d37631ddfa5d8510 | takikawa/racket-ppa | install_name_tool.rkt | #lang racket/base
(require compiler/private/macfw)
(define args (current-command-line-arguments))
(unless (equal? (vector-length args) 4)
(error 'install_name_tool "expected 4 arguments"))
(unless (equal? (vector-ref args 0) "-change")
(error 'install_name_tool "expected `-change`"))
(define from (vector-ref args... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/src/mac/install_name_tool.rkt | racket | #lang racket/base
(require compiler/private/macfw)
(define args (current-command-line-arguments))
(unless (equal? (vector-length args) 4)
(error 'install_name_tool "expected 4 arguments"))
(unless (equal? (vector-ref args 0) "-change")
(error 'install_name_tool "expected `-change`"))
(define from (vector-ref args... | |
cc57bd5ca0430b6e66077d6fa8dd3fcdbb8cb6c8e18f3cc7a5ef1836ffe97a7f | sonian/carica | core.clj | (ns carica.core
(:require [carica.map :refer [merge-nested]]
[carica.middleware :as mw]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[clojure.tools.reader :as clj-reader]
[clojure.tools.reader.edn :as edn]
[clojure.walk :as walk]))
(... | null | https://raw.githubusercontent.com/sonian/carica/d91ad15f7478ef267bce7383fca5788fd9033a96/src/carica/core.clj | clojure | don't include vectorized maps
for backwards compatibility | (ns carica.core
(:require [carica.map :refer [merge-nested]]
[carica.middleware :as mw]
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[clojure.tools.reader :as clj-reader]
[clojure.tools.reader.edn :as edn]
[clojure.walk :as walk]))
(... |
c3c387e8b2ff2b53f3db67cdeb94d130ae8f17a4117c2a61c55cdee3df4a933c | GaloisInc/HaLVM | Common.hs | module Common where
import Communication.IVC
import Communication.Rendezvous
import Data.ByteString.Lazy(ByteString)
import Hypervisor.XenStore
leftSide :: XenStore -> IO (OutChannel ByteString)
rightSide :: XenStore -> IO (InChannel ByteString)
(leftSide, rightSide) = peerConnection "PeerTest" 1
| null | https://raw.githubusercontent.com/GaloisInc/HaLVM/3ec1d7e4b6bcb91304ba2bfe8ee280cb1699f24d/examples/IVC/ByteStringIVC/Common.hs | haskell | module Common where
import Communication.IVC
import Communication.Rendezvous
import Data.ByteString.Lazy(ByteString)
import Hypervisor.XenStore
leftSide :: XenStore -> IO (OutChannel ByteString)
rightSide :: XenStore -> IO (InChannel ByteString)
(leftSide, rightSide) = peerConnection "PeerTest" 1
| |
322af2b0e8de82b0be4c36c1e4396e38194dd58eed30895c6f31818410a3ac5c | links-lang/links | context.ml | Compiler ( functional ) context / state .
TODO localise environment within their associated compilation units .
type t =
TODO remove .
TODO remove .
value_environment: Value.env;
TODO remove .
TODO remove .
TODO remove .
TODO remove .
let empty_code = new SourceCode.source_code
let empty =
{ typ... | null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/context.ml | ocaml | Compiler ( functional ) context / state .
TODO localise environment within their associated compilation units .
type t =
TODO remove .
TODO remove .
value_environment: Value.env;
TODO remove .
TODO remove .
TODO remove .
TODO remove .
let empty_code = new SourceCode.source_code
let empty =
{ typ... | |
c38da3b13e4d35a727f4d7e6780686929b6591c0573d7c0e554f943228f1f993 | twosigma/Cook | reason.clj | ;;
Copyright ( c ) Two Sigma Open Source , LLC
;;
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... | null | https://raw.githubusercontent.com/twosigma/Cook/9e561b847827adf2a775220d1fc435d8089fc41d/scheduler/src/cook/mesos/reason.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permi... | Copyright ( c ) Two Sigma Open Source , LLC
distributed under the License is distributed on an " AS IS " BASIS ,
(ns cook.mesos.reason
(:require [clojure.tools.logging :as log]
[datomic.api :as d]))
(defn reason-code->reason-entity
[db reason-code]
(d/entity db [:reason/code reason-code]))
(defn... |
bf2616b2280da7a29ce70016e9cdb5a2b3b0474e89cd1b966d01e2d271d33a38 | omelkonian/AlgoRhythm | Harmony.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Grammar.Harmony
( HarmonyConfig (..), defHarmonyConfig
, harmony, interpret
, Degree (..), Modulation (..)
) where
import Grammar.Types
import Grammar.Utilities
import Music
-- | Terminal symbol that represents s... | null | https://raw.githubusercontent.com/omelkonian/AlgoRhythm/fdc1ccbae0b3d8a7635b24d37716123aba2d6c11/AlgoRhythm/src/Grammar/Harmony.hs | haskell | | Terminal symbol that represents scale degrees.
| Auxiliary wrapper for modulating keys.
| Custom grammar for harmonic structure.
Turn-arounds
| Expands modulations and intreprets degrees to chords.
| Configuration for harmony. | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Grammar.Harmony
( HarmonyConfig (..), defHarmonyConfig
, harmony, interpret
, Degree (..), Modulation (..)
) where
import Grammar.Types
import Grammar.Utilities
import Music
data Degree = I | II | III | IV | V | ... |
fdc15ff281089c89477d06edad4459b588f3f1997195c794f2816c55ee1bbd15 | chapmanb/bcbio.variation | background.clj | (ns bcbio.variation.utils.background
"Prepare annotated VCF files to use as background for variant calling and recalibration.
Batch variant calling and recalibration with GATK improves resulting calls. This
provides a ready to use set of calls to batch with a single sample using 1000 genomes data."
(:use [cloju... | null | https://raw.githubusercontent.com/chapmanb/bcbio.variation/c48834a6819e63dcccb5bc51540c7e19b212a019/src/bcbio/variation/utils/background.clj | clojure | (ns bcbio.variation.utils.background
"Prepare annotated VCF files to use as background for variant calling and recalibration.
Batch variant calling and recalibration with GATK improves resulting calls. This
provides a ready to use set of calls to batch with a single sample using 1000 genomes data."
(:use [cloju... | |
6facec640334c096769d98feb2d3c6072a0992ce67f069aa0ac6c2a001789d7e | godfat/sandbox | ffi-ruby.hs |
-- ghc -I/usr/local/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/usr/local/include/ruby-1.9.1 -lruby ffi-ruby.hs ruby.c
import Foreign.C
foreign import ccall safe ruby_init :: IO ()
foreign import ccall safe eval_to_int :: CString -> IO CInt
main = do
ruby_init
withCString "1 + 2 + 3" eval_to_int >>= putStrLn . ... | null | https://raw.githubusercontent.com/godfat/sandbox/eb6294238f92543339adfdfb4ba88586ba0e82b8/haskell/ffi-ruby/ffi-ruby.hs | haskell | ghc -I/usr/local/include/ruby-1.9.1/x86_64-darwin10.8.0 -I/usr/local/include/ruby-1.9.1 -lruby ffi-ruby.hs ruby.c |
import Foreign.C
foreign import ccall safe ruby_init :: IO ()
foreign import ccall safe eval_to_int :: CString -> IO CInt
main = do
ruby_init
withCString "1 + 2 + 3" eval_to_int >>= putStrLn . show
|
318ca2479006f1fd63ad44861206d8781a2d42d39dda60ba5769c1abba74c19a | hbr/albatross | support.ml | Copyright ( C ) < helmut dot brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as publ... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/alba1/support.ml | ocaml |
-----------------------------------------------------------------------------
Line and column info
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Syntax error function
----------------------------------... | Copyright ( C ) < helmut dot brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as publ... |
b5b44b5c9d8b0e627ef31e6dc2c193f778620be185be2c396a7d2c08406adf12 | runtimeverification/haskell-backend | SideCondition.hs | |
Copyright : ( c ) Runtime Verification , 2020 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2020-2021
License : BSD-3-Clause
-}
module Kore.Internal.SideCondition (
SideCondition, -- Constructor not exported on purpose
addAssumption,
addAssumptions,
assume... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/93a705112305a2d7e084e98dca93ec33e0d661d5/kore/src/Kore/Internal/SideCondition.hs | haskell | Constructor not exported on purpose
| Side condition used in the evaluation context.
It contains:
* a predicate assumed to be true
* a table of term replacements which is used when simplifying terms
* a set of terms which are assumed to be defined
* a set of terms with function application at the top which are known... | |
Copyright : ( c ) Runtime Verification , 2020 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2020-2021
License : BSD-3-Clause
-}
module Kore.Internal.SideCondition (
addAssumption,
addAssumptions,
assumeTrue,
constructReplacements,
fromConditionWithRepl... |
8eb6c7cfb8c8ed72d0a575539ab76951404011ff00965ca42351b1e81868805c | unison-code/unison | PrepareForEmission.hs | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/MachineIR/Transformations/PrepareForEmission.hs | haskell | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... | |
31ac5bb3afb811878194c7d2588f8672db2da0edf21aa768cfb0b0a649efbd01 | rizo/snowflake-os | freetype.ml |
a simplified interface to do basics of following C - code :
FT_GlyphSlot slot = face->glyph ; / * a small shortcut * /
FT_UInt glyph_index ;
int pen_x , pen_y , n ;
... initialize library ...
... create face object ...
... set character size ...
pen_x =... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/freetype/freetype.ml | ocaml | only values that we probably care about
type ft_face
type face = {
face : ft_face;
(*num_glyphs : int;
slot : glyph_slot; (* the glyph slot
external set_char_size : face -> int * int -> int * int -> unit
= "ml_freetype_charsize" |
a simplified interface to do basics of following C - code :
FT_GlyphSlot slot = face->glyph ; / * a small shortcut * /
FT_UInt glyph_index ;
int pen_x , pen_y , n ;
... initialize library ...
... create face object ...
... set character size ...
pen_x =... |
f723e59366e46f806529f3a8c98a051b4e9c578edea67144c55f5ad078b9285b | robert-strandh/Cluffer | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cluffer-standard-line
(:use #:common-lisp)
(:export
#:line
#:open-line
#:closed-line
#:left-sticky-cursor
#:right-sticky-cursor))
| null | https://raw.githubusercontent.com/robert-strandh/Cluffer/4aad29c276a58a593064e79972ee4d77cae0af4a/Standard-line/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cluffer-standard-line
(:use #:common-lisp)
(:export
#:line
#:open-line
#:closed-line
#:left-sticky-cursor
#:right-sticky-cursor))
| |
8f002f61208d60a2383746829ead749ddd3f8e7f26d720cac7b138eceb0e0fe6 | parapluu/Concuerror | search.erl | -module(search).
-export([bfs/4, worker/2]).
%% CAUTION: worker needs to be exported if it is to be called from the shell
-type state() :: _.
-type environment() :: _.
-type comp_state() :: _.
-type any_state() :: state() | comp_state().
-type decomp_key() :: _.
-type backstep() :: _.
-type imm_hashentry() :: {state(... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/advanced_tests/src/manolis/search.erl | erlang | CAUTION: worker needs to be exported if it is to be called from the shell
General Invocation
@doc Breadth-First Search. Searches breadth-first.
Hashtable functions
Compression functions
Utility functions
Serial Run
Parallel Run
There are still messages left in the message queue - we need to wait fo... | -module(search).
-export([bfs/4, worker/2]).
-type state() :: _.
-type environment() :: _.
-type comp_state() :: _.
-type any_state() :: state() | comp_state().
-type decomp_key() :: _.
-type backstep() :: _.
-type imm_hashentry() :: {state(),backstep()}.
-type imm_hashentry_S() :: {state()}.
-type any_imm_hashentry(... |
7f8424d1b8cd704793d32cecabec4cb15466a80b93f53cfe6da7a164fd4ff23d | wrengr/exact-combinatorics | BinomialBench.hs | {-# OPTIONS_GHC -Wall -fwarn-tabs #-}
----------------------------------------------------------------
-- 2021.10.17
-- |
Module : Math . Combinatorics . BinomialBench
Copyright : Copyright ( c ) 2011 - -2021 wren
License : BSD
-- Maintainer... | null | https://raw.githubusercontent.com/wrengr/exact-combinatorics/b58165df12fae0caecc68c3b27344cd69cef32c1/test/bench/Math/Combinatorics/BinomialBench.hs | haskell | # OPTIONS_GHC -Wall -fwarn-tabs #
--------------------------------------------------------------
2021.10.17
|
Maintainer :
Stability : experimental
Portability : Haskell98
--------------------------------------------------------------
---------------------... | Module : Math . Combinatorics . BinomialBench
Copyright : Copyright ( c ) 2011 - -2021 wren
License : BSD
module Math.Combinatorics.BinomialBench where
import Data.List (foldl')
import Math.Combinatorics.Primes (primes)
import Math.Combinatorics.Factorial (factorial_nai... |
505fc7b5a2e7b89c54afb146dcfe57585bd5508fcf60ae6c2075838cbcc8ad5c | janestreet/bonsai | import.ml | module Bonsai = Bonsai_web.Bonsai
include Virtual_dom
| null | https://raw.githubusercontent.com/janestreet/bonsai/c202b961f41e20e0b735c4e33c2bbac57a590941/web_ui/multi_select/test/import.ml | ocaml | module Bonsai = Bonsai_web.Bonsai
include Virtual_dom
| |
90356bd2ee4045d0746fc179bb06da359cfa7836b3b35d3c7439f583581b0b0e | poroh/ersip | ersip_sdp_time.erl | %%
Copyright ( c ) 2018 Dmitry Poroh
%% All rights reserved.
Distributed under the terms of the MIT License . See the LICENSE file .
%%
SDP time
%%
-module(ersip_sdp_time).
-export([start/1,
stop/1,
parse/1,
assemble/1
]).
-export_type([timings/0]).
%%%======================... | null | https://raw.githubusercontent.com/poroh/ersip/f1b0d3c5713fb063a6cc327ea493f06cff6a6e5e/src/sdp/ersip_sdp_time.erl | erlang |
All rights reserved.
===================================================================
Types
===================================================================
===================================================================
API
===================================================================
x74 " = " ... | Copyright ( c ) 2018 Dmitry Poroh
Distributed under the terms of the MIT License . See the LICENSE file .
SDP time
-module(ersip_sdp_time).
-export([start/1,
stop/1,
parse/1,
assemble/1
]).
-export_type([timings/0]).
-record(timings, {items :: nonempty_list(sess_item()),
... |
27ea3b1e588f968e4cc7044d8de976e652661c8553480a7a5f28f4fe959b4ff5 | haskell-tools/haskell-tools | InCaseRhs.hs | # LANGUAGE LambdaCase #
module InCaseRhs where
f x = case x of
[] -> \case {() -> ()} {-* LambdaCase *-}
xs -> \case {() -> ()} {-* LambdaCase *-}
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/test/ExtensionOrganizerTest/LambdaCaseTest/InCaseRhs.hs | haskell | * LambdaCase *
* LambdaCase * | # LANGUAGE LambdaCase #
module InCaseRhs where
f x = case x of
|
2b213262fdcc7c5fd376416bd16b74b882e203fa1032e6efce33a24ebad25d03 | p12nGH-zz/pipelineDSL | Verilog.hs | -- | Verilog code generation
module Hardware.PipelineDSL.Verilog (
toVerilog,
) where
import Data.List (intercalate)
import Data.Maybe (fromMaybe)
import Hardware.PipelineDSL.HW
mOpsSign Or = " | "
mOpsSign And = " & "
mOpsSign Sum = " + "
mOpsSign Mul = " * "
bOpsSign Sub = " - "
bOpsSign (Cmp Equal) = " == "
... | null | https://raw.githubusercontent.com/p12nGH-zz/pipelineDSL/56a5c182b318b05e6ec4c8e27767ed398d5bedd7/src/Hardware/PipelineDSL/Verilog.hs | haskell | | Verilog code generation | module Hardware.PipelineDSL.Verilog (
toVerilog,
) where
import Data.List (intercalate)
import Data.Maybe (fromMaybe)
import Hardware.PipelineDSL.HW
mOpsSign Or = " | "
mOpsSign And = " & "
mOpsSign Sum = " + "
mOpsSign Mul = " * "
bOpsSign Sub = " - "
bOpsSign (Cmp Equal) = " == "
bOpsSign (Cmp NotEqual) = " !... |
0ac264ebb4b0bd1209ca0de12f799cbe83fc725285e1be019865b1eed7e323df | anurudhp/CPHaskell | b.hs | {-# LANGUAGE Safe #-}
import safe Control.Arrow ((>>>))
import safe Data.List (dropWhileEnd)
main :: IO ()
main = interact $ lines >>> drop 1 >>> process >>> map show >>> unlines
process :: [String] -> [Int]
process [] = []
process (_ : x : xs) = solve x : process xs
solve :: [Char] -> Int
solve = length . filter (... | null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/codeforces/1433/b.hs | haskell | # LANGUAGE Safe # |
import safe Control.Arrow ((>>>))
import safe Data.List (dropWhileEnd)
main :: IO ()
main = interact $ lines >>> drop 1 >>> process >>> map show >>> unlines
process :: [String] -> [Int]
process [] = []
process (_ : x : xs) = solve x : process xs
solve :: [Char] -> Int
solve = length . filter (== '0') . dropWhileEnd... |
2467ac16fd149e4efc97b1cae6aa9abce1293f63e4e6aead7e84e8fbca7040bd | cjay/vulkyrie | Device.hs | {-# LANGUAGE Strict #-}
module Vulkyrie.Vulkan.Device
( pickPhysicalDevice
, isDeviceSuitable
, getMaxUsableSampleCount
, DevQueues (..)
, SwapchainSupportDetails (..)
, querySwapchainSupport
, checkDeviceExtensionSupport
, createGraphicsDevice
) where
import Con... | null | https://raw.githubusercontent.com/cjay/vulkyrie/7ec31181bd456c863da96743c216ff6610d3cd00/src/Vulkyrie/Vulkan/Device.hs | haskell | # LANGUAGE Strict #
let supportsImgArray = getField @"shaderSampledImageArrayDynamicIndexing" supportedFeatures == VK_TRUE
logInfo $ "device support for img array: " ++ show supportsImgArray
logInfo $ show limits
check physical device extensions
find an appropriate queue family
It's best for performance... | module Vulkyrie.Vulkan.Device
( pickPhysicalDevice
, isDeviceSuitable
, getMaxUsableSampleCount
, DevQueues (..)
, SwapchainSupportDetails (..)
, querySwapchainSupport
, checkDeviceExtensionSupport
, createGraphicsDevice
) where
import Control.Monad
import Data.B... |
f7cd5e98516727b6bfc3f72717b8136bf9be38d7fc0950a4f60c69de3016ed9b | broadinstitute/firecloud-ui | external_importer.cljs | (ns broadfcui.page.external-importer
(:require
[dmohs.react :as react]
[clojure.string :as string]
[broadfcui.common :as common]
[broadfcui.common.components :as comps]
[broadfcui.common.icons :as icons]
[broadfcui.common.links :as links]
[broadfcui.common.style :as style]
[broadfcui.component... | null | https://raw.githubusercontent.com/broadinstitute/firecloud-ui/8eb077bc137ead105db5665a8fa47a7523145633/src/cljs/main/broadfcui/page/external_importer.cljs | clojure | TODO: move these to configs | (ns broadfcui.page.external-importer
(:require
[dmohs.react :as react]
[clojure.string :as string]
[broadfcui.common :as common]
[broadfcui.common.components :as comps]
[broadfcui.common.icons :as icons]
[broadfcui.common.links :as links]
[broadfcui.common.style :as style]
[broadfcui.component... |
1b2ccc9076b5024c689d5b98c507cfb9517caff53c9a6ea67bf63d37a6de09aa | dmillett/clash | pivot.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/dmillett/clash/ea36a916ccfd9e1c61cb88ac6147b6a952f33dcf/src/clash/pivot.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns ^{:author "dmillett"} clash.pivot
(:require [clojure.core.reducers :as r]
[clojure.math.combinatorics :as cmb]
[clash.tools :as t]
[clojure.string :as s]) )
(defn- pivot-name
"Build a pivot name"
[value message]
(str message ... |
358d65ea5df4d611a6c2bc6bd491a7fbf0bc378c2aea080c7270ed1d124c9868 | matsen/pplacer | glvm.ml | open Ppatteries
type model_class = Gmix_model | Gcat_model
type init_params =
(* Gmix_model (model_name, empirical_freqs, opt_transitions, rates) *)
| Gmix_model_i of string * bool * float array option * float array
(* Gcat_model (model_name, empirical_freqs, transitions, rates, site_categories) *)
| Gcat_mod... | null | https://raw.githubusercontent.com/matsen/pplacer/f40a363e962cca7131f1f2d372262e0081ff1190/pplacer_src/glvm.ml | ocaml | Gmix_model (model_name, empirical_freqs, opt_transitions, rates)
Gcat_model (model_name, empirical_freqs, transitions, rates, site_categories) | open Ppatteries
type model_class = Gmix_model | Gcat_model
type init_params =
| Gmix_model_i of string * bool * float array option * float array
| Gcat_model_i of string * bool * float array option * float array * int array
module type Model =
sig
type t
type glv_t
val build: Alignment.t -> init_params -> ... |
e1f36acff8818d22b0d60b9ce6cdf4e5d3c591a7d99805a5fd510fe815dd15bf | mojombo/egitd | reg.erl | %% re4 => Upgrade to needed state, checking speed as we go
%% 0) fixed interval code and copying
1 ) upgrade to next_match_XXX ( + slight improvement )
2 ) put pos+char in global state arg ( no noticable difference )
3 ) get look - ahead character for proper eol ( - 5 - 10 % slower )
-module(... | null | https://raw.githubusercontent.com/mojombo/egitd/5309fe5f9a5908cd741f8dedf13790eea5d7528d/elibs/reg.erl | erlang | re4 => Upgrade to needed state, checking speed as we go
0) fixed interval code and copying
slower )
-compile([export_all]).
-define(TP(F,As), io:fwrite(F, As)).
-define(TP(F,As), begin {F,As}, ok end).
N.B. all types have the id in the same field and all types except
estate have the next state pointer in the ... | 1 ) upgrade to next_match_XXX ( + slight improvement )
2 ) put pos+char in global state arg ( no noticable difference )
-module(reg).
-export([parse/1,match/2,first_match/2,matches/2,sub/3,gsub/3,split/2]).
-export([smatch/2,first_smatch/2]).
-export([tt/2,loadf/1]).
-import(string, [substr/2,substr/3]... |
7e92ebb5e39f73e3107341637ced3118bca2d6cc4853b883647b57f4a961e387 | spotify/lyceum | core_test.clj | (ns lyceum.core-test
(:require [clojure.test :refer :all]
[lyceum.core :refer :all]
[lyceum.mock :refer :all]))
(deftest test-rules-for-all
(with-mocks
(binding-mocks
[(rules-for-ns (list :rules-for-ns-return))]
(rules-for-all :opts [:foo :bar])
(is-called rules-for-ns... | null | https://raw.githubusercontent.com/spotify/lyceum/3ff48939f2d68f9bc0b5d5be9bac74cc9e64b45f/test/lyceum/core_test.clj | clojure | (ns lyceum.core-test
(:require [clojure.test :refer :all]
[lyceum.core :refer :all]
[lyceum.mock :refer :all]))
(deftest test-rules-for-all
(with-mocks
(binding-mocks
[(rules-for-ns (list :rules-for-ns-return))]
(rules-for-all :opts [:foo :bar])
(is-called rules-for-ns... | |
0a28d44127db25f7f741f7f96e6f9990d3c47a2b1db94f045387fea603726a7d | LexiFi/menhir | InputFile.ml | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/src/InputFile.ml | 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... |
5da8cd1edddf5fef1efc916c3024bb438e174e6a30331d7ab55b30357d42f918 | danr/hipspec | Rotate.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Rotate where
import Prelude hiding ((++),length)
import HipSpec.Prelude
data List = Cons A List | Nil
deriving (Eq,Typeable,Ord)
data Nat = Z | S Nat deriving (Eq,Ord,Show,Typeable)
length :: List -> Nat
length Nil = Z
length (Cons _ xs) = S (length xs)
(++) :: ... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/testsuite/examples/Rotate.hs | haskell | # LANGUAGE DeriveDataTypeable #
T32 from productive use of failure | module Rotate where
import Prelude hiding ((++),length)
import HipSpec.Prelude
data List = Cons A List | Nil
deriving (Eq,Typeable,Ord)
data Nat = Z | S Nat deriving (Eq,Ord,Show,Typeable)
length :: List -> Nat
length Nil = Z
length (Cons _ xs) = S (length xs)
(++) :: List -> List -> List
Cons x xs ++ ys... |
9ef4c116d993d138445bd1ae180086b8d0ca4055a013d09b9f4c75112d7ba473 | beetleman/shadow-cljs-hooks | index_test.clj | (ns shadow-cljs-hooks.index-test
(:require [shadow-cljs-hooks.index :as sut]
[shadow-cljs-hooks.spec :as hooks.spec]
[shadow-cljs-hooks.test.util :as test.util]
[clojure.test :as t :refer [deftest]]
[clojure.test.check.properties :as prop]
[clojure.test.chec... | null | https://raw.githubusercontent.com/beetleman/shadow-cljs-hooks/1b0543124da8bc2dca04213bd3183ace14d2a1e1/test/shadow_cljs_hooks/index_test.clj | clojure | (ns shadow-cljs-hooks.index-test
(:require [shadow-cljs-hooks.index :as sut]
[shadow-cljs-hooks.spec :as hooks.spec]
[shadow-cljs-hooks.test.util :as test.util]
[clojure.test :as t :refer [deftest]]
[clojure.test.check.properties :as prop]
[clojure.test.chec... | |
4f5bf91592b35487020bbde406498c34dbe8c5f34ff43352c08f411fb0dc6556 | subtitle-master/subtitlemaster | gui.cljs | (ns smgui.gui
(:require [cljs.core.async :refer [chan put!]]))
(def nwgui (js/require "nw.gui"))
(def Menu (.-Menu nwgui))
(def Window (.-Window nwgui))
(defn setup-mac-menu []
(let [mb (Menu. #js {:type "menubar"})
win (.get Window)]
(.createMacBuiltin mb "Subtitle Master")
(set! (.-menu win) mb... | null | https://raw.githubusercontent.com/subtitle-master/subtitlemaster/d88c2fb007c6c3d4030fefbd4b7e3eafb0e797a9/src/cljs/smgui/gui.cljs | clojure | (ns smgui.gui
(:require [cljs.core.async :refer [chan put!]]))
(def nwgui (js/require "nw.gui"))
(def Menu (.-Menu nwgui))
(def Window (.-Window nwgui))
(defn setup-mac-menu []
(let [mb (Menu. #js {:type "menubar"})
win (.get Window)]
(.createMacBuiltin mb "Subtitle Master")
(set! (.-menu win) mb... | |
3f21a6637f3d9ec5b42ef869be01e409880c3788881b633ab42974ebe12e8411 | degree9/enterprise | spec.cljs | (ns degree9.twilio.fax.spec
(:require
[cljs.spec.alpha :as spec]))
; basic fax keys
(spec/def ::from string?)
(spec/def ::to string?)
(spec/def ::media-url (spec/nilable string?))
; extended fax keys
(spec/def ::url string?)
(spec/def ::media ::url)
(spec/def ::sid (spec/nilable string?))
(spec/def ::account-sid (... | null | https://raw.githubusercontent.com/degree9/enterprise/36e4f242c18b1dde54d5a15c668b17dc800c01ff/src/degree9/twilio/fax/spec.cljs | clojure | basic fax keys
extended fax keys
#fax-media-instance-resouce
-resource#fax-properties | (ns degree9.twilio.fax.spec
(:require
[cljs.spec.alpha :as spec]))
(spec/def ::from string?)
(spec/def ::to string?)
(spec/def ::media-url (spec/nilable string?))
(spec/def ::url string?)
(spec/def ::media ::url)
(spec/def ::sid (spec/nilable string?))
(spec/def ::account-sid (spec/nilable string?))
(spec/def ::qu... |
550a742fa00d3110fa5a93e50f4ce527467381609b0f2f5980516e9462bc20d9 | chunsj/TH | cs.lisp | (in-package :th)
(defgeneric of-lt (n v))
(defgeneric of-le (n v))
(defgeneric of-gt (n v))
(defgeneric of-ge (n v))
(defgeneric of-it (n min max))
(defgeneric of-ie (n min max))
(defgeneric of-ot (n min max))
(defgeneric of-oe (n min max))
(defmethod of-lt ((n number) v) (< n v))
(defmethod of-le ((n number) v) (<= ... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/pd/cs.lisp | lisp | (in-package :th)
(defgeneric of-lt (n v))
(defgeneric of-le (n v))
(defgeneric of-gt (n v))
(defgeneric of-ge (n v))
(defgeneric of-it (n min max))
(defgeneric of-ie (n min max))
(defgeneric of-ot (n min max))
(defgeneric of-oe (n min max))
(defmethod of-lt ((n number) v) (< n v))
(defmethod of-le ((n number) v) (<= ... | |
96badb7a4708004d1491df2b2cdd0753c348a0149b6826fed2268c54a309d7d1 | huangz1990/SICP-answers | 1-list-of-values-from-right-to-left.scm | 1-list-of-values-from-right-to-left.scm
(define (list-of-values exps env)
(if (no-operands? exps)
'()
(let ((rest-values (list-of-values (rest-operands exps) env)))
(cons (eval (first-operand exps) env)
rest-values))))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp4/code/1-list-of-values-from-right-to-left.scm | scheme | 1-list-of-values-from-right-to-left.scm
(define (list-of-values exps env)
(if (no-operands? exps)
'()
(let ((rest-values (list-of-values (rest-operands exps) env)))
(cons (eval (first-operand exps) env)
rest-values))))
| |
f2070f1a9b4fcc74adfdc000258e4fdf768b073ae1ac8f495efd4ba0cd729373 | MaartenFaddegon/Hoed | Core.hs | # LANGUAGE ExistentialQuantification , FlexibleInstances , GeneralizedNewtypeDeriving ,
MultiParamTypeClasses , TypeSynonymInstances , CPP , DeriveDataTypeable ,
DeriveGeneric , StandaloneDeriving #
MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable,
... | null | https://raw.githubusercontent.com/MaartenFaddegon/Hoed/8769d69e309928aab439b22bc3f3dbf5452acc77/examples/XMonad_changing_focus_duplicates_windows/XMonad/Core.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : not portable, uses cunning newtype deriving
The 'X' monad, a state monad transformer over 'IO', for the window
manager state, and support ... | # LANGUAGE ExistentialQuantification , FlexibleInstances , GeneralizedNewtypeDeriving ,
MultiParamTypeClasses , TypeSynonymInstances , CPP , DeriveDataTypeable ,
DeriveGeneric , StandaloneDeriving #
MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable,
... |
222a7fef919269de7c1de8023ad742cd5b1899c27d13c0f08a9bbfbda92dbc16 | Ericson2314/lighthouse | Strict.hs | {-# OPTIONS -fallow-undecidable-instances #-}
-----------------------------------------------------------------------------
-- |
Module : Control . . RWS.Strict
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
-- License : BSD-style (see... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/libraries/mtl/Control/Monad/RWS/Strict.hs | haskell | # OPTIONS -fallow-undecidable-instances #
---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (multi-param classes, functional dependencies)
Insp... | Module : Control . . RWS.Strict
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
Strict RWS Monad .
( < /~mpj/ > )
Advanced School of Functional Programming , 1995 .
module Control.Monad.RWS.Strict (
RWS(..),
... |
310334379f073da4ded0045161d9761f07a6e4de2c572f1ce49014642ebb7224 | polyfy/polylith | profile.clj | (ns polylith.clj.core.command.cmd-validator.profile
(:require [clojure.set :as set]
[clojure.string :as str]
[polylith.clj.core.util.interface.color :as color]))
(defn validate [{:keys [profile-to-settings active-profiles]} color-mode]
(let [existing (set (map first profile-to-settings))
... | null | https://raw.githubusercontent.com/polyfy/polylith/76936c752fb5b729c216b23d92c8a8d71cfdc92f/components/command/src/polylith/clj/core/command/cmd_validator/profile.clj | clojure | (ns polylith.clj.core.command.cmd-validator.profile
(:require [clojure.set :as set]
[clojure.string :as str]
[polylith.clj.core.util.interface.color :as color]))
(defn validate [{:keys [profile-to-settings active-profiles]} color-mode]
(let [existing (set (map first profile-to-settings))
... | |
bb1838c2e24f35f3dbf6fa80696f8c450cf039c197b2a757533929f44d8566ff | gas2serra/mcclim-desktop | listener.lisp | (in-package :desktop-user)
(register-application "listener" 'standard-mcclim-application
:pretty-name "Listener"
:icon nil
:home-page "-strandh/McCLIM"
:git-repo "-strandh/McCLIM.git"
:system-name "clim-listener")
| null | https://raw.githubusercontent.com/gas2serra/mcclim-desktop/f85d19c57d76322ae3c05f98ae43bfc8c0d0a554/dot-mcclim-desktop/apps/listener.lisp | lisp | (in-package :desktop-user)
(register-application "listener" 'standard-mcclim-application
:pretty-name "Listener"
:icon nil
:home-page "-strandh/McCLIM"
:git-repo "-strandh/McCLIM.git"
:system-name "clim-listener")
| |
63a80d1a0bb181e0c03e8030d56138113a179b1f631f03d140e68f89d8a79ec6 | McCLIM/McCLIM | pixmap.lisp | (in-package #:clim-clx)
;;; Pixmap
(defun %allocate-pixmap (drawable width height)
(let ((pixmap (xlib:create-pixmap :width width
:height height
:depth (xlib:drawable-depth drawable)
:drawable drawable)))
... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/13d7a96e805e859ae829d1005f9ba813e68c6a2e/Backends/CLX/pixmap.lisp | lisp | Pixmap
to round "in" for now. | (in-package #:clim-clx)
(defun %allocate-pixmap (drawable width height)
(let ((pixmap (xlib:create-pixmap :width width
:height height
:depth (xlib:drawable-depth drawable)
:drawable drawable)))
(let ((gco... |
24972b07d527224c407435191719c94dbabab3ac6acee64ae70f706efe5bc693 | klutometis/clrs | fibonacci-test.scm | (require-extension check)
(require '../20.2/section)
(require '../util/util)
(import section-20.2)
(import util)
(let ((h1 (make-fibonacci-heap #f 0))
(h2 (make-fibonacci-heap #f 0))
(n1 (make-fibonacci-node 1 'harro #f #f #f #f #f 0))
(n2 (make-fibonacci-node 2 'harro #f #f #f #f #f 0))
(n3 (ma... | null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/20.2/fibonacci-test.scm | scheme | (require-extension check)
(require '../20.2/section)
(require '../util/util)
(import section-20.2)
(import util)
(let ((h1 (make-fibonacci-heap #f 0))
(h2 (make-fibonacci-heap #f 0))
(n1 (make-fibonacci-node 1 'harro #f #f #f #f #f 0))
(n2 (make-fibonacci-node 2 'harro #f #f #f #f #f 0))
(n3 (ma... | |
486403c8e12b955f3430cb274b5b48090608c8bc88ce2c91fa161b1ed5ba24ee | roblaing/erlang-webapp-howto | prolog_query.erl | -module(prolog_query).
-export([client/0, pl_query/3]).
client() ->
{ok, Pid} = gun:open("localhost", 3031),
{ok, _} = gun:await_up(Pid),
StreamRef = gun:ws_upgrade(Pid, "/family"),
{upgrade, [<<"websocket">>], _} = gun:await(Pid, StreamRef),
Q1 = <<"findall(Parent, parent(Parent, bob), Parents)">>,
io:for... | null | https://raw.githubusercontent.com/roblaing/erlang-webapp-howto/e1731dfc4e2cfdfee88e982d67155b83acd5cc04/unit7/apps/unit7/src/prolog_query.erl | erlang | -module(prolog_query).
-export([client/0, pl_query/3]).
client() ->
{ok, Pid} = gun:open("localhost", 3031),
{ok, _} = gun:await_up(Pid),
StreamRef = gun:ws_upgrade(Pid, "/family"),
{upgrade, [<<"websocket">>], _} = gun:await(Pid, StreamRef),
Q1 = <<"findall(Parent, parent(Parent, bob), Parents)">>,
io:for... | |
feb5b4a94907e208039062c1e609debd0ad0114cc15072a6bdf73e86b2066231 | haskell-jp/slack-log | Duration.hs | {-# LANGUAGE OverloadedStrings #-}
module SlackLog.Duration where
import Control.Monad (when)
import qualified Data.Aeson as Json
import qualified Data.Text.Read as TR
import qualified Data.Time.Clock as C
newtype Duration = Duration { asNominalDiffTime :: C.NominalDiffTime }
deriving (Eq, Show)... | null | https://raw.githubusercontent.com/haskell-jp/slack-log/d9ebfe5f775e48c10306d1a7de9de5669b0ccab9/src/SlackLog/Duration.hs | haskell | # LANGUAGE OverloadedStrings # |
module SlackLog.Duration where
import Control.Monad (when)
import qualified Data.Aeson as Json
import qualified Data.Text.Read as TR
import qualified Data.Time.Clock as C
newtype Duration = Duration { asNominalDiffTime :: C.NominalDiffTime }
deriving (Eq, Show)
instance Json.FromJSON Duration w... |
89638b6c8512d8404ce6b6842c6d5302c582388b94ed826263cbec2d12c7ab21 | ayazhafiz/plts | vm_conv.ml | (** Translation to the compiler VM.
Stack representation of tuples (data):
...
t.last
...
t.0
=== < stack top
Stack representation of calls:
return_value
arg
<captures.last>
...
<captures.0>
fn_name
--- < stack top on call
old_pc
... | null | https://raw.githubusercontent.com/ayazhafiz/plts/618c11248c41766be0a62d560b53fa9ce40a0040/co_lc/vm_conv.ml | ocaml | * Translation to the compiler VM.
Stack representation of tuples (data):
...
t.last
...
t.0
=== < stack top
Stack representation of calls:
return_value
arg
<captures.last>
...
<captures.0>
fn_name
--- < stack top on call
old_pc
... |
open Vm_layout
open Symbol
module T = Ty_solve.T
module Ctx = struct
open Vm_op
type name = [ `FpOffset of int ]
type t = {
new_label : string -> label;
program :
( label,
(label * op list ref) list ref * Vm_debug.debug_frame ref )
Hashtbl.t;
mutable procs_stack : (label * symb... |
478ea7c21a5bd97dff4574a9cb2c2ae45f1d13a72d86f700b727b477780d69b7 | racket/images | deep-flomap-parameters.rkt | #lang typed/racket/base
(require (except-in "deep-flomap-untyped-parameters.rkt"
light-direction light-intensity ambient-intensity reflected-intensity
refractive-index ideal-reflectance ideal-transmission transmission-density
specular-reflectance specular-r... | null | https://raw.githubusercontent.com/racket/images/975f011d41aea2f1d83885cefe333d271b788a62/images-lib/images/private/deep-flomap-parameters.rkt | racket | lighting parameters
material parameters | #lang typed/racket/base
(require (except-in "deep-flomap-untyped-parameters.rkt"
light-direction light-intensity ambient-intensity reflected-intensity
refractive-index ideal-reflectance ideal-transmission transmission-density
specular-reflectance specular-r... |
ae01cabd74329b61ec08fc8731e3ded3d8e8b09d03533a0cdbac7b748d87d760 | dbuenzli/useri | useri_top.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/useri/4646a7b8f3c0d6ce34b1c3f789eebe56cb75b9d2/src/useri_top.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
db4c59e7277b02f4061ef59ad01ae90c5dca571f3497d6543d0385e30a0aa94a | rambler-digital-solutions/aioriak | riak_pb_ts_codec.erl | %%
riak_pb_ts_codec.erl : protocol buffer utility functions for Riak TS messages
%%
Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . ... | null | https://raw.githubusercontent.com/rambler-digital-solutions/aioriak/06eb8defb43555599f5bf273a8478de989fb7f14/riak_pb/src/riak_pb_ts_codec.erl | erlang |
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
---------------------------... | riak_pb_ts_codec.erl : protocol buffer utility functions for Riak TS messages
Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distri... |
c98f663e1e7cc9511a3d11b95b2846281f6ffc450f930da9e79688188fbdf0b6 | fpco/schoolofhaskell.com | BlobStorage.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE FlexibleContexts #
-- | A barebones api for Azure blob storage.
module Azure.BlobStorage
( storageEmulator
, blobStorageFromUrl
* commands
, getBlob
, getBlobBytes
, deleteBlob
, putBlob
, putBlobBytes
, listBlobs
, listBlo... | null | https://raw.githubusercontent.com/fpco/schoolofhaskell.com/15ec1a03cb9d593ee9c0d167dc522afe45ba4f8e/src/Azure/BlobStorage.hs | haskell | # LANGUAGE OverloadedStrings #
| A barebones api for Azure blob storage.
* Internal blob commands
| (used by 'putBlob' / 'putBlobBytes')
* Types
** Storage account access key
** Exceptions
TODO:
* Add a listBlob variant that doesn't have a maximum amount. This
requires using multiple requests, and using the m... | # LANGUAGE RecordWildCards #
# LANGUAGE FlexibleContexts #
module Azure.BlobStorage
( storageEmulator
, blobStorageFromUrl
* commands
, getBlob
, getBlobBytes
, deleteBlob
, putBlob
, putBlobBytes
, listBlobs
, listBlobsSource
, putBlock
, putBlockList
, BlobStorage (..)
, AccountName (..)... |
62c3cefcd787eda6f658c3cd00536207209e340e0431e989304018a407286f52 | symbiont-io/detsys-testkit | Json.hs | module Ltl.Json where
import qualified Data.Aeson as Aeson
import Data.Aeson.QQ.Simple
import qualified Data.HashMap.Strict as HashMap
import Data.List (sort)
import qualified Data.Maybe as Maybe
import Data.Text (Text)
import qualified Data.Text.Lazy as LazyText
import qualified Data.Text.Lazy.Encoding as TextEncodin... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/ltl/src/Ltl/Json.hs | haskell | or fail?
------------------------------------------------------------------------------
------------------------------------------------------------------------------
sort to make deterministic? | module Ltl.Json where
import qualified Data.Aeson as Aeson
import Data.Aeson.QQ.Simple
import qualified Data.HashMap.Strict as HashMap
import Data.List (sort)
import qualified Data.Maybe as Maybe
import Data.Text (Text)
import qualified Data.Text.Lazy as LazyText
import qualified Data.Text.Lazy.Encoding as TextEncodin... |
9bf5559b09063b7be3eab6ab59decf2a78af258f557ab8d99c16ba315d266be0 | pa-ba/compdata | EvalM.hs | # LANGUAGE TemplateHaskell , TypeOperators , MultiParamTypeClasses ,
FlexibleInstances , FlexibleContexts , UndecidableInstances , GADTs ,
ConstraintKinds #
FlexibleInstances, FlexibleContexts, UndecidableInstances, GADTs,
ConstraintKinds #-}
-----------------------------------------------------------------... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/examples/Examples/Multi/EvalM.hs | haskell | ------------------------------------------------------------------------------
|
Module : Examples.Multi.EvalM
License : BSD3
Stability : experimental
The example illustrates how to use generalised compositional data types to
implement a small expression language, with a sub language of values, an... | # LANGUAGE TemplateHaskell , TypeOperators , MultiParamTypeClasses ,
FlexibleInstances , FlexibleContexts , UndecidableInstances , GADTs ,
ConstraintKinds #
FlexibleInstances, FlexibleContexts, UndecidableInstances, GADTs,
ConstraintKinds #-}
Copyright : ( c ) 2011 ,
Maintainer : < >
P... |
272aa43e15a2503e1906ff2d16750c16818da7940c2803d6975a536f34bf23e3 | CGenie/ray-tracer | dumb.ml | For debugging a bug in Vg
*)
open Gg
open Vg
let scene () =
let boundary_box (pts) =
List.fold_left (fun acc (pt, _) -> Box2.add_pt acc pt) Box2.zero pts in
let dot (c: color) =
let circle = P.empty |> P.circle P2.o 0.05 in
I.const c |> I.cut circle in
let mark (pt, c) = (dot c) |> I.... | null | https://raw.githubusercontent.com/CGenie/ray-tracer/37a7918c38497fe5d9b52ba0795f209c1c06fa9b/02-tracing/lib/dumb.ml | ocaml | For debugging a bug in Vg
*)
open Gg
open Vg
let scene () =
let boundary_box (pts) =
List.fold_left (fun acc (pt, _) -> Box2.add_pt acc pt) Box2.zero pts in
let dot (c: color) =
let circle = P.empty |> P.circle P2.o 0.05 in
I.const c |> I.cut circle in
let mark (pt, c) = (dot c) |> I.... | |
b572edd13bc20d6fc16cfc578dfaef660bc9d95c3b064331ec241b6d13c44375 | orthecreedence/http-parse | multipart.lisp | (in-package :http-parse-test)
(test multipart-chunks
"Test multipart parsing (in a complicated chunking scenario)"
(let* ((content (file-contents (asdf:system-relative-pathname :http-parse "test/data/multipart.http")))
(content (subseq content (+ 4 (search #(13 10 13 10) content))))
(chunk1-sep (... | null | https://raw.githubusercontent.com/orthecreedence/http-parse/adf597b1576518df07b6af1a4990723a1e02ac01/test/multipart.lisp | lisp | (in-package :http-parse-test)
(test multipart-chunks
"Test multipart parsing (in a complicated chunking scenario)"
(let* ((content (file-contents (asdf:system-relative-pathname :http-parse "test/data/multipart.http")))
(content (subseq content (+ 4 (search #(13 10 13 10) content))))
(chunk1-sep (... | |
2e76246842de92f7147491441a0b31276cb934017e777336cfb97cbcd51d4dcc | pbrisbin/devsite | Application.hs | # OPTIONS_GHC -fno - warn - orphans #
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
import ... | null | https://raw.githubusercontent.com/pbrisbin/devsite/d12682cf9add9ac1f91abd51cb576f12ca7ca424/Application.hs | haskell | Import all relevant handler modules here.
Don't forget to add new modules to your cabal file!
comments there for more details.
This function allocates resources (such as a database connection pool),
place to put your migrate statements to have automatic database
Create the WAI application and apply middlewares
|... | # OPTIONS_GHC -fno - warn - orphans #
module Application
( makeApplication
, getApplicationDev
, makeFoundation
) where
import Import
import Settings
import Yesod.Auth
import Yesod.Default.Config
import Yesod.Default.Main
import Yesod.Default.Handlers
import Network.Wai.Middleware.RequestLogger
import ... |
f9e3b4704ce25f4ea247f200e052ac2ccfde50dae4d7edc6b5eb1bd30dbdc417 | imalooney/t3tr0s | util.cljs | (ns client.util
(:require
[clojure.string :refer [replace]]))
(defn js-log
"Log a JavaScript thing."
[js-thing]
(js/console.log js-thing))
(defn log
"Log a Clojure thing."
[clj-thing]
(js-log (pr-str clj-thing)))
TODO : replace this with goog.i18n . NumberFormat ?
;;
(defn format-number [n]
(r... | null | https://raw.githubusercontent.com/imalooney/t3tr0s/2f9529e7138a0bc3a8578aa89c9661fc89e81cc0/src/client/util.cljs | clojure | (ns client.util
(:require
[clojure.string :refer [replace]]))
(defn js-log
"Log a JavaScript thing."
[js-thing]
(js/console.log js-thing))
(defn log
"Log a Clojure thing."
[clj-thing]
(js-log (pr-str clj-thing)))
TODO : replace this with goog.i18n . NumberFormat ?
(defn format-number [n]
(repla... | |
a6a29d7133a30e3810485948ef5105ab8529941ec999b6296cfc696089851093 | xoken/xoken-node | Transaction.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TupleSections #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE... | null | https://raw.githubusercontent.com/xoken/xoken-node/8e1332d653140c099d3bb73427d5b64198e8a6c0/node/src/Network/Xoken/Node/Service/Transaction.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE BangPatterns #
MUST be False | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TupleSections #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Network.Xoken.Node.Service.Transaction where
import Arivi.P2P.MessageHa... |
e1eb430298e63be070acdd14da37ee62937d542d676af4f543dec52020220925 | wargrey/schema | message.rkt | #lang typed/racket/base
(provide (all-defined-out) exn->info)
(require typed/db/base)
(require "digitama/message.rkt")
(struct: msg:schema : Schema-Message ([level : Log-Level] [brief : String] [urgent : Any] [topic : Symbol]))
(struct: msg:schema:table : Schema-Table-Message msg:schema ([manipulation : Symbol] [ra... | null | https://raw.githubusercontent.com/wargrey/schema/4824a1fecea1dc557941b08f05a457da9f628f78/message.rkt | racket | #lang typed/racket/base
(provide (all-defined-out) exn->info)
(require typed/db/base)
(require "digitama/message.rkt")
(struct: msg:schema : Schema-Message ([level : Log-Level] [brief : String] [urgent : Any] [topic : Symbol]))
(struct: msg:schema:table : Schema-Table-Message msg:schema ([manipulation : Symbol] [ra... | |
6e2adc591eebc2659aad0c25cd56d84e1d1bb1eff49612a8b53777a8329902ef | racket/gui | version.rkt | #lang racket/base
(provide (all-defined-out))
Versioning information and other strings used in the WXME format
(define MRED-READER-STR #"#reader(lib\"read.ss\"\"wxme\")")
(define MRED-START-STR #"WXME")
(define MRED-FORMAT-STR #"01")
(define MRED-VERSION-STR #"11")
(define MRED-VERSION-RX #rx"^(?:0[1-9])|(?:1[0-1]... | null | https://raw.githubusercontent.com/racket/gui/1f2217b1169faac36d3d14819093c63e4254f19c/gui-lib/mred/private/wxme/version.rkt | racket | #lang racket/base
(provide (all-defined-out))
Versioning information and other strings used in the WXME format
(define MRED-READER-STR #"#reader(lib\"read.ss\"\"wxme\")")
(define MRED-START-STR #"WXME")
(define MRED-FORMAT-STR #"01")
(define MRED-VERSION-STR #"11")
(define MRED-VERSION-RX #rx"^(?:0[1-9])|(?:1[0-1]... | |
c989cbdbd6a2e2317edb0bae74e2ada542bad996b14ea0b3192b725f333060a0 | dmitryvk/sbcl-win32-threads | fixup.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright and release statements follow. Later modifications
;;;; to the software are in the public domain and are provided with
;;;; absol... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/pcl/fixup.lisp | lisp | more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and copying of this software and preparation of der... | This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation .
derivative works must comply with all applicabl... |
3803aeb045a4d3e226070c4e86f9ca50d5fd93fce9dc83ecb27259e34ada1dc6 | gowthamk/ocaml-irmin | iset_imp.ml | open Printf
open Lwt.Infix
open Irmin_unix
module type Config =
sig val root : string val shared : string val init : unit -> unit end
let from_just op msg =
match op with
| Some x -> x
| None -> failwith @@ (msg ^ ": Expected Some. Got None.")
module MakeVersioned(Config:Config)(Atom:Set_imp.ATOM) =
struct
module OM =... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/set/fs/iset_imp.ml | ocaml | let on_add = ref (fun k v -> printf "%s\n"
(Fmt.to_to_string K.pp k);
Lwt.return ())
* We momentarily override Lwt's bind and return so as to pass
* the tree around without making a mess.
* Momentarily overriding Lwt's b... | open Printf
open Lwt.Infix
open Irmin_unix
module type Config =
sig val root : string val shared : string val init : unit -> unit end
let from_just op msg =
match op with
| Some x -> x
| None -> failwith @@ (msg ^ ": Expected Some. Got None.")
module MakeVersioned(Config:Config)(Atom:Set_imp.ATOM) =
struct
module OM =... |
43b455d57cc13e7b77c145fb7c6eb0c9711a525a360b8986b76a942fc2c0b1f6 | davidlazar/ocaml-semantics | tuple02.ml | (2+3, not true, ((), 21/4))
| null | https://raw.githubusercontent.com/davidlazar/ocaml-semantics/6f302c6b9cced0407d501d70ad25c2d2aefbb77d/tests/unit/tuple02.ml | ocaml | (2+3, not true, ((), 21/4))
| |
b52cd4b6b7128ef25991fe46fd89367ee88a9ed9cac6fc2137367b0db8b1fde4 | lanl/APPFL | Transform.hs | # LANGUAGE
FlexibleInstances ,
TypeSynonymInstances ,
NamedFieldPuns #
FlexibleInstances,
TypeSynonymInstances,
NamedFieldPuns #-}
module MHS.Transform
(
setTypeSignatures,
renameIDs,
genFunctions,
simplifyExps,
boxNumLiterals,
simplifyPats,
simpleCase
) where
import Debug.Trace
import MHS.AST
imp... | null | https://raw.githubusercontent.com/lanl/APPFL/0f29f390d4735e863904348711a48b8f38ca5d03/codegen/MHS/Transform.hs | haskell | -------------------------------------------------------------------
Setting user-defined type signatures in definitions that have them.
Could be expanded to set a type for the expression (and sub expressions)
in the definition.
This also sets boxity (where applicable) in those types based on the data
definitions and bu... | # LANGUAGE
FlexibleInstances ,
TypeSynonymInstances ,
NamedFieldPuns #
FlexibleInstances,
TypeSynonymInstances,
NamedFieldPuns #-}
module MHS.Transform
(
setTypeSignatures,
renameIDs,
genFunctions,
simplifyExps,
boxNumLiterals,
simplifyPats,
simpleCase
) where
import Debug.Trace
import MHS.AST
imp... |
927bff6299d22fefa8770ae7ecd4564deaed12a57871f05fde45f5200bf56426 | janestreet/bonsai | resizer.mli | open! Core
open! Bonsai_web
open! Import
* This attribute , when added to a Vdom node adds the ability for that dom - node to be
clicked - and - dragged to change its parents width .
clicked-and-dragged to change its parents width. *)
val attr : Vdom.Attr.t
| null | https://raw.githubusercontent.com/janestreet/bonsai/4baeedc75bf73a0915e04dc02d8a49b78779e9b0/web_ui/element_size_hooks/src/resizer.mli | ocaml | open! Core
open! Bonsai_web
open! Import
* This attribute , when added to a Vdom node adds the ability for that dom - node to be
clicked - and - dragged to change its parents width .
clicked-and-dragged to change its parents width. *)
val attr : Vdom.Attr.t
| |
1f13c5b06c9f007f4b5f651c44669d681d2c7cca9b243410065041b1fe13efe5 | Lovesan/clave | frame-flags.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
Copyright ( C ) 2017 , < lovesan.ru at gmail.com >
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;; restriction, inclu... | null | https://raw.githubusercontent.com/Lovesan/clave/3b08ed4c4cb3fa885739355821f73bbfd75a2a7d/src/frame-flags.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do... |
Copyright ( C ) 2017 , < lovesan.ru at gmail.com >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KI... |
220e5e25db06da4cad73be2c7e6b1bc6f84cd551eaf025f6ba853e56b266b90e | bigmlcom/sketchy | bloom.clj | Copyright 2013 , 2014 , 2015 BigML
Licensed under the Apache License , Version 2.0
;; -2.0
(ns bigml.sketchy.bloom
"Functions for constructing a bloom filter.
"
(:refer-clojure :exclude [merge contains? into distinct])
(:import (java.lang Math))
(:require (bigml.sketchy [murmur :as murmur]
... | null | https://raw.githubusercontent.com/bigmlcom/sketchy/f06c6f29035f19bbbdaf86c582fed2722032d283/src/clj/bigml/sketchy/bloom.clj | clojure | -2.0 | Copyright 2013 , 2014 , 2015 BigML
Licensed under the Apache License , Version 2.0
(ns bigml.sketchy.bloom
"Functions for constructing a bloom filter.
"
(:refer-clojure :exclude [merge contains? into distinct])
(:import (java.lang Math))
(:require (bigml.sketchy [murmur :as murmur]
... |
4311b5321477d7a17863651247d21e9b95086cadb3800648c89e99b05538372c | bugczw/Introduction-to-Functional-Programming-in-OCaml | W6_S1_1.ml |
TYPE ABSTRACTION USING A SIGNATURE ( 20/20 points )
Encapsulate the type and values given in the template in a module named Exp .
To make e abstract , assign a signature to the module Exp that makes the type e abstract and publish the functions int , and add .
Given that interface , the only way to build a... | null | https://raw.githubusercontent.com/bugczw/Introduction-to-Functional-Programming-in-OCaml/13c4d1f92e7479f8eb10ea5d4c43a598b6676d0f/OCaml_MOOC_W6_ALL/Exercise/W6_S1_1.ml | ocaml |
TYPE ABSTRACTION USING A SIGNATURE ( 20/20 points )
Encapsulate the type and values given in the template in a module named Exp .
To make e abstract , assign a signature to the module Exp that makes the type e abstract and publish the functions int , and add .
Given that interface , the only way to build a... | |
f9e246364b9ec28969855148c901c96fe084b539cd60886b0bb28e9eae842df1 | gethop-dev/hop-cli | main.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
;; file, You can obtain one at /
{{=<< >>=}}
(ns <<project.name>>.api.main
(:require [integrant.core :as ig]
[malli.util :as mu]
[muuntaja.core :as m]
... | null | https://raw.githubusercontent.com/gethop-dev/hop-cli/41e7635eea4b413cbb3374733ec6370f04dcafa9/resources/bootstrap/profiles/core/app/src/%7B%7Bproject.files-name%7D%7D/api/main.clj | clojure | file, You can obtain one at /
swagger feature
query-params & form-params
content-negotiation
encoding response body
exception handling
decoding request body
coercing response bodys
coercing request parameters
multipart | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
{{=<< >>=}}
(ns <<project.name>>.api.main
(:require [integrant.core :as ig]
[malli.util :as mu]
[muuntaja.core :as m]
[reitit.coercion.mall... |
3eb33ed7bc791c613f8db17efb7032e6ed798ea6c534e10f47ac41bcc64a9088 | jeffshrager/biobike | packages.lisp | (in-package :cl-user)
(defpackage java
(:use)
(:export
:abstract
:boolean
:break
:byte
:case
:catch
:char
:class
:const
:continue
:default
:do
:double
:else
:extends
:final
:finally
:float
:for
:goto
:if
:implements
:import
:instanceof
:int... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/ThirdParty/monkeylib/foo/java/packages.lisp | lisp | (in-package :cl-user)
(defpackage java
(:use)
(:export
:abstract
:boolean
:break
:byte
:case
:catch
:char
:class
:const
:continue
:default
:do
:double
:else
:extends
:final
:finally
:float
:for
:goto
:if
:implements
:import
:instanceof
:int... | |
123fed33e0cd6f9102062f7d801d2253a3055eddb4aacc9e4365aa492b608814 | LeifAndersen/interactive-syntax-clojure | db.cljs | (ns interactive-syntax.db
(:require-macros
[interactive-syntax.slurp :refer [slurp]])
(:require [reagent.core :as r :refer [atom]]
[cljs.spec.alpha :as s]
[cognitect.transit :as t]
[alandipert.storage-atom :as storage :refer [local-storage]]
[interactive-syntax.uti... | null | https://raw.githubusercontent.com/LeifAndersen/interactive-syntax-clojure/3e3e05bb30004938a39d5061a15aaab0fb80ace5/src/interactive_syntax/db.cljs | clojure | -------------------------
Atom into datastructure
-------------------------
Pseudo function serialize
(-> (ocall isomorphic-git :init #js {:fs fs :dir git-root})
(.then cb)
(.catch (fn [e] (js/console.error e) (cb e))))
-------------------------
or false/null
:home - no dialog, home-screen
:new - new-fi... | (ns interactive-syntax.db
(:require-macros
[interactive-syntax.slurp :refer [slurp]])
(:require [reagent.core :as r :refer [atom]]
[cljs.spec.alpha :as s]
[cognitect.transit :as t]
[alandipert.storage-atom :as storage :refer [local-storage]]
[interactive-syntax.uti... |
6d4b3974de68a2028093e20ec44f2af0d1e5e58784619190333bb50cdf3cd296 | tcsprojects/pgsolver | smallprogress.ml | open Basics ;;
open Paritygame ;;
open Univsolve;;
open Tcsarray;;
open Tcsqueue;;
let ns_minarg arr f less = ns_fold (fun m i -> if less (f i) (f m) then i else m) (ns_some arr) arr;;
let ns_maxarg arr f less = ns_fold (fun m i -> if less (f m) (f i) then i else m) (ns_some arr) arr;;
let arr_minarg arr f less = Arr... | null | https://raw.githubusercontent.com/tcsprojects/pgsolver/b0c31a8b367c405baed961385ad645d52f648325/src/solvers/smallprogress.ml | ocaml | Returns true iff the spm equals top w.r.t. player
Returns true iff x <_pr y w.r.t. player
Calculates the progress measure update for both players at node vi | open Basics ;;
open Paritygame ;;
open Univsolve;;
open Tcsarray;;
open Tcsqueue;;
let ns_minarg arr f less = ns_fold (fun m i -> if less (f i) (f m) then i else m) (ns_some arr) arr;;
let ns_maxarg arr f less = ns_fold (fun m i -> if less (f m) (f i) then i else m) (ns_some arr) arr;;
let arr_minarg arr f less = Arr... |
3746763c044a9b5c25d3e4ca02e86069c1c4336180d3db2a25c9986b938e1a6f | reasonml-old/BetterErrors | type_UnboundValue_3.ml | let f ~a b = 5 + a
let eleven = f ~a 6
| null | https://raw.githubusercontent.com/reasonml-old/BetterErrors/d439b92bfe377689c38fded5d8aa2b151133f25d/tests/type_UnboundValue/type_UnboundValue_3.ml | ocaml | let f ~a b = 5 + a
let eleven = f ~a 6
| |
fc8b17a55cdbb9bd2ec4ea0ccb10b73572b69ec5cb60ab71caa878c3d26ab21e | flambard/cl-erlang-term | erlang-object-tests.lisp | (in-package :erlang-term-test)
(in-suite erlang-object)
(test erlang-binary
;; Binary to string
(is (string= "Test" (binary-to-string (string-to-binary "Test"))))
(is (string= "" (binary-to-string (binary))))
;; Binary to byte vector
(is (equalp #() (bytes (binary))))
(is (equalp #(1 2 3) (bytes (binary 1... | null | https://raw.githubusercontent.com/flambard/cl-erlang-term/8e4da084107c2a6a3778856fe554dc37e9bc46bb/test/erlang-object-tests.lisp | lisp | Binary to string
Binary to byte vector
Binary size
Matching binaries
Matching PIDs
Mismatch on node name
Mismatch on id
Mismatch on serial
Mismatch on creation
Matching refs
Mismatch on node name
Mismatch on id
Mismatch on creation
Tuple arity
Tuple size
Tuple elements vector
Matching tuples | (in-package :erlang-term-test)
(in-suite erlang-object)
(test erlang-binary
(is (string= "Test" (binary-to-string (string-to-binary "Test"))))
(is (string= "" (binary-to-string (binary))))
(is (equalp #() (bytes (binary))))
(is (equalp #(1 2 3) (bytes (binary 1 2 3))))
(is (equalp #(1 2 3) (bytes (bytes-to-... |
a8fc83913b4d36390176f235f3e76de9444d85bcc46fd5d8388e70cd37d8e294 | softwarelanguageslab/maf | R5RS_ad_list-5.scm | ; Changes:
* removed : 0
* added : 4
* swaps : 0
* negated predicates : 3
; * swapped branches: 0
* calls to i d fun : 2
(letrec ((create-list (lambda size
(let* ((list-size (if (null? size) 10 (car size)))
(content (make-vector list-size 0))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_ad_list-5.scm | scheme | Changes:
* swapped branches: 0 | * removed : 0
* added : 4
* swaps : 0
* negated predicates : 3
* calls to i d fun : 2
(letrec ((create-list (lambda size
(let* ((list-size (if (null? size) 10 (car size)))
(content (make-vector list-size 0))
(first 0)
... |
93c6093f1a4b297c371ad85854d841bfbc3c84ce8848a3225a2cdf24f95dc619 | ocaml-omake/omake | lm_position.ml |
let debug_pos =
Lm_debug.create_debug (**)
{ debug_name = "pos";
debug_description = "print verbose position information for debugging";
debug_value = false
}
let trace_pos =
Lm_debug.create_debug (**)
{ debug_name = "trace_pos";
debug_description = "print position trace for debuggin... | null | https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/libmojave/lm_position.ml | ocaml |
* We include the name of the module where
* the position is created. The value is a location,
* a raw value, or a value with another position.
This is the name of the module where the position info is created
* Get the source location for an exception.
* Print debugging info.
* Real... |
let debug_pos =
{ debug_name = "pos";
debug_description = "print verbose position information for debugging";
debug_value = false
}
let trace_pos =
{ debug_name = "trace_pos";
debug_description = "print position trace for debugging";
debug_value = false
}
% % MAGICBEGIN%%
t... |
2a69ab10eebaa29ab4f421aadfe2f8f2a7d2c9c562d4960694229bed6aeb395b | Ericson2314/lighthouse | Function.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.Function
Copyright : 2006
-- License : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- Simple combinators wo... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/libraries/base/Data/Function.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Function
License : BSD-style (see the LICENSE file in the distribution)
Maintainer :
Stability : experimental
Portability : portable
Simple combinators working solely on and with functions.
* Other co... | Copyright : 2006
module Data.Function
* " Prelude " re - exports
id, const, (.), flip, ($)
, fix
, on
) where
import Prelude
infixl 0 `on`
| @'fix ' f@ is the least fixed point of the function @f@ ,
fix :: (a -> a) -> a
fix f = let x = f x in x
Typical usage : @'Data . ' ( ' compare ' \`... |
7c2de68b9ddb26c801cf46977b176a5a917dadfb60d84c33b3e27ad6adda4798 | blarney-lang/blarney | Counter.hs | import Blarney
import Blarney.Recipe
import System.Environment
data Counter n =
Counter {
inc :: Action ()
, dec :: Action ()
, val :: Bit n
}
makeCounter :: KnownNat n => Module (Counter n)
makeCounter = do
State
count :: Reg (Bit n) <- makeReg 0
-- Wires
incWire :: Wire (Bit 1) <- makeWire 0
... | null | https://raw.githubusercontent.com/blarney-lang/blarney/e80a547b092462f1beb9378e6c806db679ff62b4/Examples/Counter/Counter.hs | haskell | Wires
Increment
Decrement
Top-level module
Simple test sequence | import Blarney
import Blarney.Recipe
import System.Environment
data Counter n =
Counter {
inc :: Action ()
, dec :: Action ()
, val :: Bit n
}
makeCounter :: KnownNat n => Module (Counter n)
makeCounter = do
State
count :: Reg (Bit n) <- makeReg 0
incWire :: Wire (Bit 1) <- makeWire 0
decWire :: ... |
dbb47370b5ede1fff2440d41d6784447b66b1447872da38388cfa23d90a19f55 | okuoku/nausicaa | test-unimplemented.sps | ;;;
Part of : / Scheme
;;;Contents: tests for the &unimplemented condition
Date : Mon Jan 5 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU General Public License as published by
the Free Sof... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/scheme/tests/test-unimplemented.sps | scheme |
Contents: tests for the &unimplemented condition
Abstract
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY ... | Part of : / Scheme
Date : Mon Jan 5 , 2009
Copyright ( c ) 2009 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
#!r6rs
(import (nausicaa)
(nausicaa checks))
(chec... |
3bcfb0952046940cc978f0be3af29e3ae627aa940b2258680f8fbaacf5a1bd96 | brownplt/LambdaS5 | ljs_syntax.ml | open Prelude
type oattr =
| Proto
| Klass
| Extensible
| Primval
| Code
let string_of_oattr oattr = match oattr with
| Proto -> "#proto"
| Klass -> "#class"
| Extensible -> "#extensible"
| Primval -> "#primval"
| Code -> "#code"
type pattr =
| Value
| Getter
| Setter
... | null | https://raw.githubusercontent.com/brownplt/LambdaS5/f0bf5c7baf1daa4ead4e398ba7d430bedb7de9cf/src/ljs/ljs_syntax.ml | ocaml | GetAttr (Pos.t, property, object, field name)
SetAttr (Pos.t, property, object, field name, new value)
Pos.t, left, right, args object
Pos.t, obj, field, new val, args
Pos.t, obj, field
* value bound must be an [ELambda]
* Catch block must be an [ELambda]
Pos.t, string to be evaled, env object
Some usefu... | open Prelude
type oattr =
| Proto
| Klass
| Extensible
| Primval
| Code
let string_of_oattr oattr = match oattr with
| Proto -> "#proto"
| Klass -> "#class"
| Extensible -> "#extensible"
| Primval -> "#primval"
| Code -> "#code"
type pattr =
| Value
| Getter
| Setter
... |
bfa4ced748b89c4a7d4f25f8edc8d51fc041fe1d02b7de041ab5fd68d7d906d6 | appleshan/cl-http | preliminary.lisp | -*- Mode : LISP ; Package : WWW - UTILS ; BASE : 10 ; Syntax : ANSI - Common - Lisp ; Default - Character - Style : ( : FIX : ROMAN : NORMAL);-*-
;;;
( c ) Copyright 1994 - 96 , 2003 ,
;;; All Rights Reserved.
;;;
;;;-------------------------------------------------------------------
;;;
;;; KEEPING TRA... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/server/preliminary.lisp | lisp | Package : WWW - UTILS ; BASE : 10 ; Syntax : ANSI - Common - Lisp ; Default - Character - Style : ( : FIX : ROMAN : NORMAL);-*-
All Rights Reserved.
-------------------------------------------------------------------
KEEPING TRACK OF PROCEDURES AND VARIABLES
rj, macro call
---------------------------------... | ( c ) Copyright 1994 - 96 , 2003 ,
(in-package :www-utils)
#+LispWorks
(defmacro note-editor-definition-parser (definer deftype)
#+(or LispWorks4.0 LispWorks4.1 LispWorks4.2)
`(let ((parsing-function (get ',deftype 'editor::section-parsing-function)))
(when parsing-function
(setf (get ',definer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.