_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 |
|---|---|---|---|---|---|---|---|---|
7c0a525c7c03eb4e38c41a6bc2c297c8089365fd87f67f8f51cba6a79059834a | sethfowler/pygmalion | Spec.hs | import Control.Concurrent
import System.Directory
import Test.Hspec
import Pygmalion.Test (defShouldBe, defsShouldBe, index, line,
runPygmalionTest, Test(..), test, withPygd)
import ForwardDeclarations
import Macros
import TemplateFunctions
import VirtualMethods
import VirtualMethodsInStructs
i... | null | https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/tests/Spec.hs | haskell | libclang bug
wrong def -- bug
no def -- libclang bug
wrong def -- libclang bug
Functions returning values or pointers.
Function pointers to functions returning values or pointers.
Function references to functions returning values or pointers.
Methods on instances returning values or pointers.
Methods on p... | import Control.Concurrent
import System.Directory
import Test.Hspec
import Pygmalion.Test (defShouldBe, defsShouldBe, index, line,
runPygmalionTest, Test(..), test, withPygd)
import ForwardDeclarations
import Macros
import TemplateFunctions
import VirtualMethods
import VirtualMethodsInStructs
i... |
1d1e70b6b0659a97c410894c0ca49b6921e9fd07851cbc575c1da9993e3e1d17 | Jarzka/stylefy | hoverbox.cljs | (ns stylefy.examples.rum.hoverbox
(:require [rum.core :as rum]
[garden.stylesheet :refer [at-media]]
[stylefy.core :as stylefy :refer [use-style use-sub-style]]))
(def mobile-media-query {:max-width "550px"})
(def hoverbox-style
{:width "500px"
:height "200px"
:padding "33px"
:mar... | null | https://raw.githubusercontent.com/Jarzka/stylefy/332af0c666a4fee1a0bf4419e8e0e4fd69685eb8/examples/rum/src/cljs/stylefy/examples/rum/hoverbox.cljs | clojure | Manual mode is a powerful way to define styles for child components when you absolutely need to write
custom CSS selectors. However, great power comes with a great responsibility. | (ns stylefy.examples.rum.hoverbox
(:require [rum.core :as rum]
[garden.stylesheet :refer [at-media]]
[stylefy.core :as stylefy :refer [use-style use-sub-style]]))
(def mobile-media-query {:max-width "550px"})
(def hoverbox-style
{:width "500px"
:height "200px"
:padding "33px"
:mar... |
2ef28438ea96fd149b0253b661db13b7e72bf13da709be3e4d8d876b83c24a5c | seth/pooler | pooler_pool_sup.erl | -module(pooler_pool_sup).
-behaviour(supervisor).
-export([start_link/1, init/1,
pool_sup_name/1,
member_sup_name/1,
build_member_sup_name/1]).
-include("pooler.hrl").
start_link(#pool{} = Pool) ->
SupName = pool_sup_name(Pool),
supervisor:start_link({local, SupName}, ?MODULE, Poo... | null | https://raw.githubusercontent.com/seth/pooler/9c28fb479f9329e2a1644565a632bc222780f1b7/src/pooler_pool_sup.erl | erlang | -module(pooler_pool_sup).
-behaviour(supervisor).
-export([start_link/1, init/1,
pool_sup_name/1,
member_sup_name/1,
build_member_sup_name/1]).
-include("pooler.hrl").
start_link(#pool{} = Pool) ->
SupName = pool_sup_name(Pool),
supervisor:start_link({local, SupName}, ?MODULE, Poo... | |
4a1660b5c6bf93f8d445b4bcb75927ce7c3e61fa60d642251b2fc4c7ace3937f | carlosavieira/self-study | 03.hs | elementAt :: (Num b, Eq b) => [a] -> b -> a
elementAt [] _ = error "Element out of range"
elementAt (x:xs) 1 = x
elementAt (x:xs) y = elementAt xs (y-1) | null | https://raw.githubusercontent.com/carlosavieira/self-study/c7f998875f34a9d3623ade6deb75980affad2047/programming/Haskell/99%20problems/solutions/03.hs | haskell | elementAt :: (Num b, Eq b) => [a] -> b -> a
elementAt [] _ = error "Element out of range"
elementAt (x:xs) 1 = x
elementAt (x:xs) y = elementAt xs (y-1) | |
851d9330bcaf9aaa55ff4f9925f87f22cd81988d9fccbda217463f60af7dd3e0 | erleans/erleans | erleans_provider.erl | %%%----------------------------------------------------------------------------
Copyright 2019 . All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% ... | null | https://raw.githubusercontent.com/erleans/erleans/7d640d84654b45a27399ca258406c31005d600df/src/erleans_provider.erl | erlang | ----------------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ... | Copyright 2019 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(erleans_provider).
-export([start_link/2]).
-callback start_link(ProviderName :: atom(), Args :: list()) -> {ok, pid()}.
-c... |
71e468dacb768b68a13845ba93891994e40673f5dbc97c98683e11473b5cd7e4 | slyrus/abcl | collect.lisp | ;;; collect.lisp
;;;
Copyright ( C ) 2003
$ Id$
;;;
;;; 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 Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
;;;
;;;... | null | https://raw.githubusercontent.com/slyrus/abcl/881f733fdbf4b722865318a7d2abe2ff8fdad96e/src/org/armedbear/lisp/collect.lisp | lisp | collect.lisp
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License fo... | Copyright ( C ) 2003
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
(in-pack... |
21438a93c0679a9bc2b90c34e5fa972dddfd5e58ccf5141b0bc1c7418db51a2e | SNePS/SNePS2 | brachet-setup.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : , v
;;; This file is part of SNePS.
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Buffalo Publi... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/demo/sneps/brachet-dist/brachet-setup.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
This file is part of SNePS.
you may
not use this file except in compliance with the License. You
may obtain a copy of the License at
. edu/sneps/Downloads/ubpl.pdf.
or implied. See the License for the specific language gov
erning rights and limitations ... |
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : , v
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " basis , WITHOUT WARRANTY OF ANY KIND , either exp... |
060d2828a4a6ee2aaef924b1a4767cc81f7aa74fd177a1ee5f7f421cae15ca55 | lambdaisland/cljbox2d | template.cljc | (ns lambdaisland.cljbox2d.demo.template
"Basic structure to start with"
(:require [lambdaisland.cljbox2d :as b]
[lambdaisland.cljbox2d.quil :as bq]
[quil.core :as q :include-macros true]))
Create the world , we 'll set gravity - y to 10 so things fall down
(def world (b/world 0 10))
Qu... | null | https://raw.githubusercontent.com/lambdaisland/cljbox2d/7ad44434b8c0892d810acaac76584a43f1297240/src/lambdaisland/cljbox2d/demo/template.cljc | clojure | A static body that is basically just a straight line, so
we have a "floor" for objects to rest on
Set the viewport, x, y, and scale
Progress the physics animation
Clear the screen
Set drawing parameters
"Draw" the world. This loops over all the things in the world and draws
a :draw function on an entity to cust... | (ns lambdaisland.cljbox2d.demo.template
"Basic structure to start with"
(:require [lambdaisland.cljbox2d :as b]
[lambdaisland.cljbox2d.quil :as bq]
[quil.core :as q :include-macros true]))
Create the world , we 'll set gravity - y to 10 so things fall down
(def world (b/world 0 10))
Qu... |
3c78de948380db5cee84f23676a1cf32fb3833be4506b958d4571d68e48eda5b | typedclojure/typedclojure | malli_type_providers_test.clj | (ns typed-example.malli-type-providers-test
(:require [typed.clojure :as t]
[clojure.test :refer [deftest is]]))
(deftest check-ns-tests
(is (t/check-ns-clj 'typed-example.malli-type-providers))
#_(is (t/check-ns-cljs 'typed-example.malli-type-providers))
(is (t/check-ns-clj 'typed-example.malli-ex... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/f0d2506f4c982b745fb36cf61e25d4bd4cf92b76/example-projects/malli-type-providers/test/typed_example/malli_type_providers_test.clj | clojure | (ns typed-example.malli-type-providers-test
(:require [typed.clojure :as t]
[clojure.test :refer [deftest is]]))
(deftest check-ns-tests
(is (t/check-ns-clj 'typed-example.malli-type-providers))
#_(is (t/check-ns-cljs 'typed-example.malli-type-providers))
(is (t/check-ns-clj 'typed-example.malli-ex... | |
2039660e8b57fa7bf7036ca846d70e4a8fa9aef7f325318d2520f7b379e38135 | Liqwid-Labs/liqwid-libs | Main.hs | {-# LANGUAGE ImpredicativeTypes #-}
module Main (main) where
import GHC.IO.Encoding (setLocaleEncoding, utf8)
import Test.Tasty (defaultMain, testGroup)
import FunctorProp qualified
import NumericProp qualified
import OrdProp qualified
import TraversableProp qualified
import ValueProp qualified
main :: IO ()
main =... | null | https://raw.githubusercontent.com/Liqwid-Labs/liqwid-libs/0898f8fdeeeacf3dd3a0e693711a2cfadcdc6629/liqwid-plutarch-extra/test/Main.hs | haskell | # LANGUAGE ImpredicativeTypes # |
module Main (main) where
import GHC.IO.Encoding (setLocaleEncoding, utf8)
import Test.Tasty (defaultMain, testGroup)
import FunctorProp qualified
import NumericProp qualified
import OrdProp qualified
import TraversableProp qualified
import ValueProp qualified
main :: IO ()
main = do
setLocaleEncoding utf8
defau... |
8f0402a8690346d922f4bc88a8425bf22e67768aa1ddfe02d37b7851327a08d6 | 40ants/reblocks | dependencies.lisp | (uiop:define-package #:reblocks/dependencies
(:use #:cl)
(:import-from #:cl-ppcre)
(:import-from #:cl-fad)
(:import-from #:parenscript)
(:import-from #:routes)
(:import-from #:puri)
(:import-from #:serapeum
#:defvar-unbound)
(:import-from #:log)
(:import-from #:reblocks/utils/misc
... | null | https://raw.githubusercontent.com/40ants/reblocks/99986524e61ac90fa73e05b15d07310bbd378dea/src/dependencies.lisp | lisp | Just a dependency
TODO: seems this slot does not used:
For cached dependencies remote and local urls are different
to make life easier, we'll render a comment with original
dependency's URL.
CSS
Each dependency should have an url.
And now we will bind a route to dependency and vice-versa.
Each dependency shoul... | (uiop:define-package #:reblocks/dependencies
(:use #:cl)
(:import-from #:cl-ppcre)
(:import-from #:cl-fad)
(:import-from #:parenscript)
(:import-from #:routes)
(:import-from #:puri)
(:import-from #:serapeum
#:defvar-unbound)
(:import-from #:log)
(:import-from #:reblocks/utils/misc
... |
d29952a549d4c67b98a295bef32e4c4b5a8e3813fee42d97bed755472b1daddc | rtoy/ansi-cl-tests | delete-package.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Apr 25 08:01:58 1998
;;;; Contains: Tests of DELETE-PACKAGE
(in-package :cl-test)
(declaim (optimize (safety 3)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; delete-package
;; check return value of delete-package, and check
;; that package-name is nil on the ... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/delete-package.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of DELETE-PACKAGE
delete-package
check return value of delete-package, and check
that package-name is nil on the deleted package object
Check that deletion of different package designators works
PFD 10/14/02 -- These tests are broken again. I suspect
some sort of intera... | Author :
Created : Sat Apr 25 08:01:58 1998
(in-package :cl-test)
(declaim (optimize (safety 3)))
(deftest delete-package.1
(progn
(safely-delete-package :test1)
(let ((p (make-package :test1 :use nil)))
(list
(notnot (delete-package :test1))
(notnot (packagep p))
(pack... |
04ce8b498b89ea6600f4744f74435853d6ab0bd8c43c469006c8321f533dc7fd | atlas-engineer/nyxt | password.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt/tests)
(define-test toggle-password-mode ()
(let ((buffer (make-instance 'modable-buffer)))
(with-current-buffer buffer
(assert-true (enable-modes* 'nyxt/password-mode:password-mode buffer))
... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/65a9aa568b16c109281fa403a7c045b3b6d87025/tests/offline/mode/password.lisp | lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt/tests)
(define-test toggle-password-mode ()
(let ((buffer (make-instance 'modable-buffer)))
(with-current-buffer buffer
(assert-true (enable-modes* 'nyxt/password-mode:password-mode buffer))
... | |
5e2fbd53c5d5aeb51c8b24c5bfe861e3d2664b4702fa8a5b2832cd06d255d85b | chris-taylor/aima-haskell | Students.hs | module AI.Learning.Example.Students where
import qualified Data.Map as M
import AI.Learning.DecisionTree
data Student = Student {
firstLastYear :: Bool,
male :: Bool,
worksHard :: Bool,
drinks :: Bool,
firstThisYear :: Bool } deriving (Eq,Ord,Show)
students = [richard,alan,alison,jeff,gail,simon]... | null | https://raw.githubusercontent.com/chris-taylor/aima-haskell/538dcfe82a57a623e45174e911ce68974d8aa839/src/AI/Learning/Example/Students.hs | haskell | |Attributes. | module AI.Learning.Example.Students where
import qualified Data.Map as M
import AI.Learning.DecisionTree
data Student = Student {
firstLastYear :: Bool,
male :: Bool,
worksHard :: Bool,
drinks :: Bool,
firstThisYear :: Bool } deriving (Eq,Ord,Show)
students = [richard,alan,alison,jeff,gail,simon]... |
05d1464e10a367364d659f1ec29f9ea5067dc62911b930dca06879249b03beeb | leon-gondelman/ocaml2lang | lock.ml | TODO : check if already added to Dune
( library
( name aneris_lib )
( libraries ocaml-compiler-libs.common threads ) )
(library
(name aneris_lib)
(libraries ocaml-compiler-libs.common threads)) *)
let[@builtin] newlock = fun () -> Mutex.create ()
let[@builtin] try_acquire = fun l ... | null | https://raw.githubusercontent.com/leon-gondelman/ocaml2lang/f94f02d35b537623b7e4da812d33eb6c29cc9214/tmp/ml_sources/lock.ml | ocaml | TODO : check if already added to Dune
( library
( name aneris_lib )
( libraries ocaml-compiler-libs.common threads ) )
(library
(name aneris_lib)
(libraries ocaml-compiler-libs.common threads)) *)
let[@builtin] newlock = fun () -> Mutex.create ()
let[@builtin] try_acquire = fun l ... | |
b38762bd9ff9efaa534ebe7ce6a19d10082b4d614caf674fe3ecc0e7dd0e8e10 | static-analysis-engineering/codehawk | tCHBchlibGenerator.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/a6cbbdc2da7f171e0879fb94fe707bb00c9293c6/CodeHawk/CHT/CHB_tests/bchlib_tests/tbchlib/tCHBchlibGenerator.mli | ocaml | bchlib
tchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... |
8c672e35011a6063baa1df314152ac94275c5664d6a4349e48a3a4e8b917589a | tamarit/edd | sum_digits.erl | -module(sum_digits).
-compile(export_all).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
sum_digits(N) ->
sum_digits(N,10).
sum_digits(N,B) ->
sum_digits(N,B,0).
sum_digits(0,_,Acc) ->
Acc;
sum_digits(N,B,Acc) when N < B ->
%Acc+N; %RIGHT
Acc; %WRONG
sum... | null | https://raw.githubusercontent.com/tamarit/edd/867f287efe951bec6a8213743a218b86e4f5bbf7/examples/Unified_Framework/sum_digits/no_tests/sum_digits.erl | erlang | Acc+N; %RIGHT
WRONG | -module(sum_digits).
-compile(export_all).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
sum_digits(N) ->
sum_digits(N,10).
sum_digits(N,B) ->
sum_digits(N,B,0).
sum_digits(0,_,Acc) ->
Acc;
sum_digits(N,B,Acc) when N < B ->
sum_digits(N,B,Acc) ->
sum_digits(... |
059bb9722d58d100e4745baa790b31fce8b3bee53fb93e136b6f8db8ff5fc2fb | kazu-yamamoto/hhp | LintSpec.hs | module LintSpec where
import Data.List.Extra
import Test.Hspec
import Hhp
spec :: Spec
spec = do
describe "lintSyntax" $ do
it "check syntax with HLint" $ do
res <- lintSyntax defaultOptions "test/data/hlint.hs"
-- hlint displays additional line infomation
since unknown version ... | null | https://raw.githubusercontent.com/kazu-yamamoto/hhp/de82b0cc54bd4e2433e2b74ce3198fa972293ee2/test/LintSpec.hs | haskell | hlint displays additional line infomation | module LintSpec where
import Data.List.Extra
import Test.Hspec
import Hhp
spec :: Spec
spec = do
describe "lintSyntax" $ do
it "check syntax with HLint" $ do
res <- lintSyntax defaultOptions "test/data/hlint.hs"
since unknown version (: 5:16 - 26 :)
replace "16-26" "16" res `sho... |
d4474e7e6b769b6db85ffe61868372b3b7b3299742c013eeee014f249353213d | isovector/talks | TalkNotes.hs | # LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - inline - rule - shadowing #
# OPTIONS_GHC -Wno - missing - methods #
# OPTIONS_GHC -Wno - orphans #
{-# OPTIONS_GHC -Wno-typed-holes #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -fdefer-typed-holes #-}
modu... | null | https://raw.githubusercontent.com/isovector/talks/95c82908731c3ed7b0e97ef46430d9693b51bc62/quadtrees/TalkNotes.hs | haskell | # OPTIONS_GHC -Wno-typed-holes #
# OPTIONS_GHC -Wno-unused-imports #
# OPTIONS_GHC -fdefer-typed-holes #
for symmetry, we should also add
what laws?
this doesn't actually do bounds checking :)
maybe we can patch it like this
get (fill r a q) p = if contains r p then Just a else get q p
... | # LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - inline - rule - shadowing #
# OPTIONS_GHC -Wno - missing - methods #
# OPTIONS_GHC -Wno - orphans #
module TalkNotes where
import Data.Monoid
import Data.Maybe (isJust)
data QT a
instance Functor QT
instance Semigroup a => Semigroup (QT a)
i... |
9093c94b71f44da781363e0b5fcc06df499e0126efad1554f7b4696c837dd04c | p-swift/projure | core_test.clj | (ns clojure-prolog.core-test
(:require [clojure.test :refer :all]
[clojure-prolog.core :refer :all]
[clojure-prolog.unify :refer :all]))
(defn gen-prolog
"Generate Prolog code from the clauses for a symbol/arity."
[symbol arity]
(gen-predicate symbol arity (clauses-with-arity (get-claus... | null | https://raw.githubusercontent.com/p-swift/projure/b3777d068d6c13e3d419a5f591fd2dba720d0a9f/src/test/clojure_prolog/core_test.clj | clojure | ******************** likes/2 ******************************
generate the right code
who does sandy like?
******************** member/2 *******************************
******************** lispp/1 *************************
*********************** Quicksort ***********************
************************ Zebra Pu... | (ns clojure-prolog.core-test
(:require [clojure.test :refer :all]
[clojure-prolog.core :refer :all]
[clojure-prolog.unify :refer :all]))
(defn gen-prolog
"Generate Prolog code from the clauses for a symbol/arity."
[symbol arity]
(gen-predicate symbol arity (clauses-with-arity (get-claus... |
7c23d34dd4d4442cf76973e0556e73c9f0eaf2ba5bfb1486f1066b0034252fdd | mnasoft/math | appr.lisp | ;;;; tests/approximation-tests.lisp
(in-package #:math/tests)
(def-suite appr
:description "Мастер-набор тестов по решению СЛАУ (систем линейных
плгебраических уравнений."
:in all)
(in-suite appr)
(def-test approximation-make-least-squares-matrix-test ()
"Пример использования: (test-matr-mnk)"
(let* ((m1
... | null | https://raw.githubusercontent.com/mnasoft/math/dca9f4212c800b418aa7ed4422fbe5ac7001bf35/src/tests/appr.lisp | lisp | tests/approximation-tests.lisp |
(in-package #:math/tests)
(def-suite appr
:description "Мастер-набор тестов по решению СЛАУ (систем линейных
плгебраических уравнений."
:in all)
(in-suite appr)
(def-test approximation-make-least-squares-matrix-test ()
"Пример использования: (test-matr-mnk)"
(let* ((m1
(make-instance
... |
c4d6762bf83c69f9a4f744b50d96539de95b060ece243d93d5912ba6a28cceac | helium/router | router_device_channels_worker_SUITE.erl | -module(router_device_channels_worker_SUITE).
-export([
all/0,
init_per_testcase/2,
end_per_testcase/2
]).
-export([
refresh_channels_test/1,
crashing_http_channel_test/1,
late_packet_test/1,
join_sent_to_integration_test/1,
join_sent_to_integration_with_decoder_test/1,
downlink_cl... | null | https://raw.githubusercontent.com/helium/router/2a9fc72e07b913015f9bcd29df83f23b2505d683/test/router_device_channels_worker_SUITE.erl | erlang | --------------------------------------------------------------------
COMMON TEST CALLBACK FUNCTIONS
--------------------------------------------------------------------
--------------------------------------------------------------------
@doc
Running tests for this suite
@end
-------------------------------------... | -module(router_device_channels_worker_SUITE).
-export([
all/0,
init_per_testcase/2,
end_per_testcase/2
]).
-export([
refresh_channels_test/1,
crashing_http_channel_test/1,
late_packet_test/1,
join_sent_to_integration_test/1,
join_sent_to_integration_with_decoder_test/1,
downlink_cl... |
7c120de393b7bdbfd332d8d66851bd36f2acb7d5f32b11bf70261211ed0364e5 | haskell-works/cabal-cache | GhcPkg.hs | # LANGUAGE TypeApplications #
module HaskellWorks.CabalCache.GhcPkg
( system,
runGhcPkg,
testAvailability,
recache,
init,
) where
import Prelude hiding (init)
import Control.Lens ((^.))
import Data.Generics.Product.Any (HasAny(the))
import System.Exit ... | null | https://raw.githubusercontent.com/haskell-works/cabal-cache/66116b2d50e18292c0a1d2b34901595396440fcb/src/HaskellWorks/CabalCache/GhcPkg.hs | haskell | TODO Better error handling | # LANGUAGE TypeApplications #
module HaskellWorks.CabalCache.GhcPkg
( system,
runGhcPkg,
testAvailability,
recache,
init,
) where
import Prelude hiding (init)
import Control.Lens ((^.))
import Data.Generics.Product.Any (HasAny(the))
import System.Exit ... |
512e9debfe4b26c904bede1bd0059f5bc3d1956b654dda205dd5570e5c557d71 | gebi/jungerl | smux_fake_peer.erl | %% Implements a (fake) SMUX peer.
-module(smux_fake_peer).
-compile(export_all).
-define(ID, [1,2,3,4]).
-include("TEST-MIB.hrl").
-include("../src/snmp_smux.hrl").
-include_lib("snmp/include/snmp_types.hrl").
start() ->
start({127,0,0,1}, 1999, "secret").
-record(state, {sock}).
start(Ip, Port, Secret) ->
... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/snmp_ext/test/smux_fake_peer.erl | erlang | Implements a (fake) SMUX peer. |
-module(smux_fake_peer).
-compile(export_all).
-define(ID, [1,2,3,4]).
-include("TEST-MIB.hrl").
-include("../src/snmp_smux.hrl").
-include_lib("snmp/include/snmp_types.hrl").
start() ->
start({127,0,0,1}, 1999, "secret").
-record(state, {sock}).
start(Ip, Port, Secret) ->
{ok, Sock} = gen_tcp:connect(I... |
785cd457a584f805ad40e54d53f7a104fe5e57a46a5922ff4de4e52099eb705c | AccelerationNet/clsql-helper | set-slot-value-using-class.lisp | (defpackage :clsql-helper-slot-coercer-test
(:use :cl :clsql-helper :lisp-unit2 :iter)
(:shadow :run-tests))
(in-package :clsql-helper-slot-coercer-test)
(cl-interpol:enable-interpol-syntax)
(defun run-tests ()
(let* ((*package* (find-package :clsql-helper-slot-coercer-test)))
(lisp-unit2:run-tests
:na... | null | https://raw.githubusercontent.com/AccelerationNet/clsql-helper/846b67a26906da5ea2cff790a36a4cb2f496a528/tests/set-slot-value-using-class.lisp | lisp | (defpackage :clsql-helper-slot-coercer-test
(:use :cl :clsql-helper :lisp-unit2 :iter)
(:shadow :run-tests))
(in-package :clsql-helper-slot-coercer-test)
(cl-interpol:enable-interpol-syntax)
(defun run-tests ()
(let* ((*package* (find-package :clsql-helper-slot-coercer-test)))
(lisp-unit2:run-tests
:na... | |
22735e7c52b081d3cc2412d5f3916984ae159741048585c8b9360156aa92bf70 | logseq/logseq | datetime.cljs | (ns frontend.components.datetime
(:require [cljs-time.core :as t]
[clojure.string :as string]
[frontend.commands :as commands]
[frontend.components.svg :as svg]
[frontend.date :as date]
[frontend.handler.editor :as editor-handler]
[frontend.handl... | null | https://raw.githubusercontent.com/logseq/logseq/b78c689458953dbbcf8fd93f09523508aa9040a1/src/main/frontend/components/datetime.cljs | clojure | deadline-or-schedule? is handled in on-submit, not here
similar to page reference | (ns frontend.components.datetime
(:require [cljs-time.core :as t]
[clojure.string :as string]
[frontend.commands :as commands]
[frontend.components.svg :as svg]
[frontend.date :as date]
[frontend.handler.editor :as editor-handler]
[frontend.handl... |
8b686f8273fca5bc54afb580112671ececa429e90911e04d087224e4be1154df | clj-easy/graalvm-clojure | main.clj | (ns simple.main
(:require [com.brunobonacci.sophia :as sph])
(:gen-class))
(defn -main []
(let [env (sph/sophia
{;; where to store the files on disk
:sophia.path "/tmp/sophia-test"
;; which logical databases to create
:dbs ["accounts", {:name "transaction... | null | https://raw.githubusercontent.com/clj-easy/graalvm-clojure/5de155ad4f95d5dac97aac1ab3d118400e7d186f/clj-sophia/src/simple/main.clj | clojure | where to store the files on disk
which logical databases to create | (ns simple.main
(:require [com.brunobonacci.sophia :as sph])
(:gen-class))
(defn -main []
(let [env (sph/sophia
:sophia.path "/tmp/sophia-test"
:dbs ["accounts", {:name "transactions"}]})]
(prn "SET" (sph/set-value! env "accounts" "user1" "John"))
(prn "GET" (sph/get-value... |
6a59b2c98e59c5502fc1e6963714d6f546778197cf8c1dfe072bb6b36a7adeae | elaforge/karya | Graphs_test.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Util.Graphs_test where
import qualified Data.Array.IArray as IArray
import qualified Data.Graph as Graph
import qualified Data.List as List
import qualified Util.Graphs as Graphs
... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/Util/Graphs_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
finally a place I could use quickcheck...
x x
2 0
array [(0,[]), (1,[0]),(2,[1]) 2 -> 1 -> 0
array [(0,[2]),(1,[]), (2,[1]) 0 -> 2 -> 1 | Copyright 2013
module Util.Graphs_test where
import qualified Data.Array.IArray as IArray
import qualified Data.Graph as Graph
import qualified Data.List as List
import qualified Util.Graphs as Graphs
import Util.Graphs (build)
import Global
import Util.Test
test_toggle_edge :: Te... |
31aa6ffcbf3a17a67f7fa5c8142b45a1fe01f3325f307962fad7f6cf94ca7cc2 | camllight/camllight | client.ml | #open "sys";;
#open "unix";;
exception Finished;;
let retransmit input output =
let buffer = create_string 4096 in
try
while true do
match read input buffer 0 4096 with
0 -> raise Finished
| n -> write output buffer 0 n
done
with Finished ->
()
;;
let main () =
let server_name... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/libunix/Examples/client.ml | ocaml | #open "sys";;
#open "unix";;
exception Finished;;
let retransmit input output =
let buffer = create_string 4096 in
try
while true do
match read input buffer 0 4096 with
0 -> raise Finished
| n -> write output buffer 0 n
done
with Finished ->
()
;;
let main () =
let server_name... | |
e27f8d2bfe16a60810049d9fdb8e1869e648f269a318376fc16b9293edea4265 | haskell-effectful/effectful | MVar.hs | -- | Lifted "Control.Concurrent.MVar".
module Effectful.Concurrent.MVar
( -- * Effect
Concurrent
-- ** Handlers
, runConcurrent
-- * MVar
, MVar
, newEmptyMVar
, newMVar
, takeMVar
, putMVar
, readMVar
, swapMVar
, tryTakeMVar
, tryPutMVar
, isEmptyMVar
, withMVar
, withMVarMas... | null | https://raw.githubusercontent.com/haskell-effectful/effectful/f7f82c149e7b4e67c3638e854a84d1c9695c0baa/effectful/src/Effectful/Concurrent/MVar.hs | haskell | | Lifted "Control.Concurrent.MVar".
* Effect
** Handlers
* MVar
| Lifted 'M.newEmptyMVar'.
| Lifted 'M.newMVar'.
| Lifted 'M.takeMVar'.
| Lifted 'M.readMVar'.
| Lifted 'M.tryPutMVar'.
| Lifted 'M.isEmptyMVar'.
| Lifted 'M.tryReadMVar'.
| Lifted 'M.withMVar'.
| Lifted 'M.withMVarMasked'.
| Lifted 'M.modify... | module Effectful.Concurrent.MVar
Concurrent
, runConcurrent
, MVar
, newEmptyMVar
, newMVar
, takeMVar
, putMVar
, readMVar
, swapMVar
, tryTakeMVar
, tryPutMVar
, isEmptyMVar
, withMVar
, withMVarMasked
, modifyMVar
, modifyMVar_
, modifyMVarMasked
, modifyMVarMasked_
, tryRea... |
9b017e486cfa1237b6bd03f26dda599cc4303017003ec08f9186b5484dcf20cc | fgalassi/cs61a-sp11 | suit-strategy.scm | (load "higher-order")
(define (suit-strategy suit has-suit-strategy hasnt-suit-strategy)
(lambda (hand dealer-card)
(if (suit-in-hand? suit hand)
(has-suit-strategy hand dealer-card)
(hasnt-suit-strategy hand dealer-card))))
(define (suit? suit)
(lambda (card) (equal? (last card) suit)))
(define ... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/projects/blackjack/joker/suit-strategy.scm | scheme | (load "higher-order")
(define (suit-strategy suit has-suit-strategy hasnt-suit-strategy)
(lambda (hand dealer-card)
(if (suit-in-hand? suit hand)
(has-suit-strategy hand dealer-card)
(hasnt-suit-strategy hand dealer-card))))
(define (suit? suit)
(lambda (card) (equal? (last card) suit)))
(define ... | |
1158cbe606dd1f7123b56185d50245c986e569fd1fd42d779ff80c06cf2f00a2 | axelarge/advent-of-code | day03.clj | (ns advent-of-code.y2019.day03
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]))
(def input (get-input 2019 3))
(defn parse-move [[_ dir d]]
[(keyword dir) (parse-int d)])
(defn parse-line [line]
(->> line
(re-seq #"([RLUD])(\d+)")
(map parse-move)))
(defn par... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2019/day03.clj | clojure | (ns advent-of-code.y2019.day03
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]))
(def input (get-input 2019 3))
(defn parse-move [[_ dir d]]
[(keyword dir) (parse-int d)])
(defn parse-line [line]
(->> line
(re-seq #"([RLUD])(\d+)")
(map parse-move)))
(defn par... | |
233ef4f8dab844f0a1e2045655c6fdc2fc2c545b8a83c24962b2a4d99438f2df | janestreet/learn-ocaml-workshop | game_state.mli | open! Base
(** A [t] represents the current state of the game. *)
type t =
| In_progress
| Game_over of string (* The string is the reason the game ended. *)
| Win
[@@deriving sexp_of]
(** [to_string] pretty-prints the current game state into a string. *)
val to_string : t -> string
| null | https://raw.githubusercontent.com/janestreet/learn-ocaml-workshop/1ba9576b48b48a892644eb20c201c2c4aa643c32/03-snake/lib/game_state.mli | ocaml | * A [t] represents the current state of the game.
The string is the reason the game ended.
* [to_string] pretty-prints the current game state into a string. | open! Base
type t =
| In_progress
| Win
[@@deriving sexp_of]
val to_string : t -> string
|
18b16d331efd620f2a7e8c3b73ee4fd8e999bf7920f1d350aa3c6879680c166d | pingles/bandit | project.clj | (defproject bandit/bandit-simulate "0.2.1-SNAPSHOT"
:description "Multi-armed bandit simulation"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[bandit/bandit-core "0.2.1-SNAPSHOT"]
[org.clojure/clojure "1.6.0"]
[org.clojure/math.n... | null | https://raw.githubusercontent.com/pingles/bandit/795666f3938e28f389691094bb1e07e4202290f6/bandit-simulate/project.clj | clojure | (defproject bandit/bandit-simulate "0.2.1-SNAPSHOT"
:description "Multi-armed bandit simulation"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[bandit/bandit-core "0.2.1-SNAPSHOT"]
[org.clojure/clojure "1.6.0"]
[org.clojure/math.n... | |
43a2199c63c9e187f9efaf5e1d651f2f84202a3215e12cc8d71ef09175afc8b3 | imitator-model-checker/imitator | AlgoBCCoverDistributed.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : Classical Beh... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/AlgoBCCoverDistributed.ml | ocaml | **********************************************************
**********************************************************
Modules
**********************************************************
**********************************************************
**********************************************************
***************... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : Classical Beh... |
a6279a007379a337456bd014ce97ffcafd130865feb7f333a8a42f96bf767249 | Ledest/otpbp | otpbp_sets.erl | -module(otpbp_sets).
-ifndef(HAVE_sets__is_empty_1).
OTP 21.0
-export([is_empty/1]).
-endif.
-ifndef(HAVE_sets__is_empty_1).
is_empty(S) -> sets:size(S) =:= 0.
-endif.
| null | https://raw.githubusercontent.com/Ledest/otpbp/f93923239b33cc05500733027e6e775090ac80ad/src/otpbp_sets.erl | erlang | -module(otpbp_sets).
-ifndef(HAVE_sets__is_empty_1).
OTP 21.0
-export([is_empty/1]).
-endif.
-ifndef(HAVE_sets__is_empty_1).
is_empty(S) -> sets:size(S) =:= 0.
-endif.
| |
9fe68a8cdb24e1f6c41afb3fa6d0044ccc3129e637f73d8e314288e5fba13947 | mirage/qubes-mirage-firewall | firewall.mli | Copyright ( C ) 2015 , < >
See the README file for details .
See the README file for details. *)
(** Classify IP packets, apply rules and send as appropriate. *)
val ipv4_from_netvm : Router.t -> Nat_packet.t -> unit Lwt.t
(** Handle a packet from the outside world (this module will validate the source I... | null | https://raw.githubusercontent.com/mirage/qubes-mirage-firewall/47562749b2d2c62f7c5fb47df23502666d326ae3/firewall.mli | ocaml | * Classify IP packets, apply rules and send as appropriate.
* Handle a packet from the outside world (this module will validate the source IP).
TODO the function type is a workaround, rework the module dependencies / functors to get rid of it
* Handle a packet from a client. Caller must check the source IP matches ... | Copyright ( C ) 2015 , < >
See the README file for details .
See the README file for details. *)
val ipv4_from_netvm : Router.t -> Nat_packet.t -> unit Lwt.t
val ipv4_from_client : ([ `host ] Domain_name.t -> (int32 * Ipaddr.V4.Set.t, [> `Msg of string ]) result Lwt.t) ->
Ipaddr.V4.t list -> Router.t ... |
70ff2b2af590ab2e85f67286a470b10f66fa96667bd32ed637c18cebc86ae7aa | ocaml-flambda/ocaml-jst | w53_mli.mli | (* TEST
flags = "-w +A-60-70"
* setup-ocamlc.byte-build-env
** ocamlc.byte
compile_only = "true"
*** check-ocamlc.byte-output
*)
(* Just ensure that we're running the check on mli files too *)
val a1 : int [@deprecated] (* rejected *)
val a2 : int [@@deprecated] (* accepted *)
| null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/549d75742504bb3df218cc8bcc1abf3e9ddd3217/testsuite/tests/warnings/w53_mli.mli | ocaml | TEST
flags = "-w +A-60-70"
* setup-ocamlc.byte-build-env
** ocamlc.byte
compile_only = "true"
*** check-ocamlc.byte-output
Just ensure that we're running the check on mli files too
rejected
accepted | |
fa57bf94d5873a5495dbe57bfaa5cb8b2af17d1e624947ea8f950dc86e61085a | linoscope/okasaki-book-ocaml | test_insertion_sort.ml | open Base
open Stdio
open Okasaki_book
let print_stream s =
s
|> Stream.to_list
|> List.sexp_of_t Int.sexp_of_t
|> Sexp.to_string
|> print_endline
let%expect_test "sort" =
let s = Stream.of_list [8; 2; 4; 1; 3; 7; 9; 6; 5] |> Insertion_sort.f in
s |> print_stream;
[%expect {| (1 2 3 4 5 6 7 8 9) |}]... | null | https://raw.githubusercontent.com/linoscope/okasaki-book-ocaml/77eb3aaa7113e1b175fbe3c7253f8e4954acd5e9/test/ch4/test_insertion_sort.ml | ocaml | open Base
open Stdio
open Okasaki_book
let print_stream s =
s
|> Stream.to_list
|> List.sexp_of_t Int.sexp_of_t
|> Sexp.to_string
|> print_endline
let%expect_test "sort" =
let s = Stream.of_list [8; 2; 4; 1; 3; 7; 9; 6; 5] |> Insertion_sort.f in
s |> print_stream;
[%expect {| (1 2 3 4 5 6 7 8 9) |}]... | |
3af65a35f50a5c96ba1ae8f9b835db598160065453d79af0b5be0d0c25f5cf5a | patoline/patotex | LatexAst_helper.ml | SPDX - License - Identifier : GPL-3.0
(** Utility functions *)
open Latex
(** {1 Handling locations in source file} *)
type loc = Location.t
let default_loc = ref Location.none
let with_default_loc loc f =
let backup_loc = !default_loc in
default_loc := loc;
let res = f () in
default_loc := backup_loc;
... | null | https://raw.githubusercontent.com/patoline/patotex/6023951964cca08be1548672ce69cc8f62e5cdaf/LatexAst_helper.ml | ocaml | * Utility functions
* {1 Handling locations in source file}
* {1 Helper functions for building syntax trees} | SPDX - License - Identifier : GPL-3.0
open Latex
type loc = Location.t
let default_loc = ref Location.none
let with_default_loc loc f =
let backup_loc = !default_loc in
default_loc := loc;
let res = f () in
default_loc := backup_loc;
res
let mkloc = Location.mkloc
let txt loc = loc.Location.txt
modul... |
93dcbc71f62606b3ef32f0237c60927cf9576ed0bcccc48711b7c779aebc032d | zadean/xqerl | xqerl_context.erl | Copyright ( c ) 2017 - 2020 .
SPDX - FileCopyrightText : 2022
%
SPDX - License - Identifier : Apache-2.0
@doc The Static and Dynamic context values .
%% NOTE: This module needs cleaning up!! also a conceptual overworking.
%% The static and dynamic phases need to be clearly separated. (who sets ... | null | https://raw.githubusercontent.com/zadean/xqerl/06c651ec832d0ac2b77bef92c1b4ab14d8da8883/src/xqerl_context.erl | erlang |
NOTE: This module needs cleaning up!! also a conceptual overworking.
The static and dynamic phases need to be clearly separated. (who sets what? when and where?)
-export([remove_key/1]).
-export([get_context_item/2]).
-export([set_context_position/2]).
-export([get_variable_values/1]).
-export([get_variable... | Copyright ( c ) 2017 - 2020 .
SPDX - FileCopyrightText : 2022
SPDX - License - Identifier : Apache-2.0
@doc The Static and Dynamic context values .
-module(xqerl_context).
-export([merge/2]).
-export([get_db/1]).
-export([init/1]).
-export([init/0]).
-export([destroy/1]).
-export([static_namespa... |
e268c03eceac1f0ac896e22e2697aa91aa72c566fd7f0feff726d61ea2238cf3 | glguy/advent | 21.hs | # Language ImportQualifiedPost , QuasiQuotes , MonadComprehensions , GeneralisedNewtypeDeriving #
|
Module : Main
Description : Day 21 solution
Copyright : ( c ) , 2021
License : ISC
Maintainer :
< >
Play a game on a simple game of play players on a circular board with
9 spaces . T... | null | https://raw.githubusercontent.com/glguy/advent/e5ce19a76bf62a4f243ae589e2b6f32ba7d66d77/solutions/src/2021/21.hs | haskell | | >>> :main
| Count the maximum number of ways a player can win in the most given
^ player 1's starting location
[0,0,4608,249542,3219454,24905476,77993473,62172638,8678745,53217]
>>> toLoses (wins 8)
^ live games ((location, score), ways)
^ wins and next turn's live games
>>> rolls
fromList [(3,1),(4,... | # Language ImportQualifiedPost , QuasiQuotes , MonadComprehensions , GeneralisedNewtypeDeriving #
|
Module : Main
Description : Day 21 solution
Copyright : ( c ) , 2021
License : ISC
Maintainer :
< >
Play a game on a simple game of play players on a circular board with
9 spaces . T... |
ec580b9bafcf1ec7a8ce577b7760425bc97b1c6c5016956939d014fa19f98f4f | froggey/Mezzano | buffers.lisp | Copyright ( c ) 2019 ( )
This code is licensed under the MIT license .
;;======================================================================
;;
;; This file provides a buffer management service for USB drivers. It
;; provides (1-dimensional) arrays with the proper length and type,
but are backed by wired m... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/drivers/usb/buffers.lisp | lisp | ======================================================================
This file provides a buffer management service for USB drivers. It
provides (1-dimensional) arrays with the proper length and type,
alignment requirements of the host controller.
The implmenetation uses internal array manipulation routines to
... | Copyright ( c ) 2019 ( )
This code is licensed under the MIT license .
but are backed by wired memory provided by the HCD . The reason the
HCD provides the wired memory is because only the HCD knows
force the array to have the right type ( unsigned - byte 8 , 16 or 32 )
Internal to this file , buf refer... |
5f6adf821454fedbe3982d79689dd0ed4a5ac8e1a2f0bffde6ff10f3ae2f939a | exercism/erlang | nucleotide_count_tests.erl | Generated with ' v0.2.0 '
%% Revision 1 of the exercises generator was used
%% -specifications/raw/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/nucleotide-count/canonical-data.json
%% This file is automatically generated from the exercises canonical data.
-module(nucleotide_count_tests).
-include_lib("erl_ex... | null | https://raw.githubusercontent.com/exercism/erlang/57ac2707dae643682950715e74eb271f732e2100/exercises/practice/nucleotide-count/test/nucleotide_count_tests.erl | erlang | Revision 1 of the exercises generator was used
-specifications/raw/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/nucleotide-count/canonical-data.json
This file is automatically generated from the exercises canonical data. | Generated with ' v0.2.0 '
-module(nucleotide_count_tests).
-include_lib("erl_exercism/include/exercism.hrl").
-include_lib("eunit/include/eunit.hrl").
'1_empty_strand_test_'() ->
Strand = [],
[{"empty strand, all",
?_assertEqual(lists:sort([{"A", 0}, {"C", 0}, {"G", 0},
{"T", 0}]),
list... |
168c1405b5e26934f811547191e37c4dd46581076101051a105456c6337c4aca | byorgey/AoC | 25.hs | #!/usr/bin/env stack
-- stack --resolver lts-19.28 script --package containers --package split
import Control.Applicative
import Control.Arrow ((>>>))
import Data.List
main = interact $ lines >>> solve
fromSNAFU :: String -> Int
fromSNAFU = foldl' (\n d -> 5*n + snafu2Int d) 0
sn... | null | https://raw.githubusercontent.com/byorgey/AoC/3c641535027a3d43eacf848c1a189072c2a2f44a/2022/25/25.hs | haskell | stack --resolver lts-19.28 script --package containers --package split | #!/usr/bin/env stack
import Control.Applicative
import Control.Arrow ((>>>))
import Data.List
main = interact $ lines >>> solve
fromSNAFU :: String -> Int
fromSNAFU = foldl' (\n d -> 5*n + snafu2Int d) 0
snafu2Int :: Char -> Int
snafu2Int '-' = -1
snafu2Int '=' = -2
snafu2Int d ... |
0400784a9ccb4a0155625292adaa02fbb1e604790540cc11e5690f30364bb33b | jonathan-laurent/KaFlow | grid.mli | (** "Musical notation" representation of traces. *)
type concrete_agent = Instantiation.concrete
type concrete_site = concrete_agent Instantiation.site
type internal_state = Instantiation.internal_state
type concrete_binding_state = Free | Bound of concrete_site
* { 6 Variables and constraints }
type 'a var =
|... | null | https://raw.githubusercontent.com/jonathan-laurent/KaFlow/e81cfbe4f270b9f0c94b7002b02dd5be61041ab8/src/grid.mli | ocaml | * "Musical notation" representation of traces. |
type concrete_agent = Instantiation.concrete
type concrete_site = concrete_agent Instantiation.site
type internal_state = Instantiation.internal_state
type concrete_binding_state = Free | Bound of concrete_site
* { 6 Variables and constraints }
type 'a var =
| Internal_state : concrete_site -> internal_state ... |
ff0c0000de6fa22553139d114c4ee3de0ca209cd9dc3ebf330fdea2408b62414 | MinaProtocol/mina | zkapp_command_logic.ml | module Local_state = struct
module V1 = struct
type ( 'stack_frame
, 'call_stack
, 'token_id
, 'signed_amount
, 'ledger
, 'bool
, 'comm
, 'length
, 'failure_status_tbl )
t =
{ stack_frame : 'stack_frame
; call_stack : 'ca... | null | https://raw.githubusercontent.com/MinaProtocol/mina/f7f6700332bdfca77d9f3303e9cf3bc25f997e09/src/lib/mina_wire_types/mina_transaction_logic/zkapp_command_logic.ml | ocaml | module Local_state = struct
module V1 = struct
type ( 'stack_frame
, 'call_stack
, 'token_id
, 'signed_amount
, 'ledger
, 'bool
, 'comm
, 'length
, 'failure_status_tbl )
t =
{ stack_frame : 'stack_frame
; call_stack : 'ca... | |
b0821fba7cd0dfd76b5a192a77718c2c47b7d1c6ec9e981d41f68f1760b23406 | johnelse/ocaml-irc-client | irc_client_unix.mli | include Irc_client.CLIENT
with type 'a Io.t = 'a
and type Io.inet_addr = Unix.inet_addr
and type Io.config = unit
| null | https://raw.githubusercontent.com/johnelse/ocaml-irc-client/b256ba5102bda4be2361c10e8280e3f78c4f3df8/src/unix/irc_client_unix.mli | ocaml | include Irc_client.CLIENT
with type 'a Io.t = 'a
and type Io.inet_addr = Unix.inet_addr
and type Io.config = unit
| |
bfe457eb88db01ef9341444dc47fa0113fdd6c0df6d4f4a08ab0bd3348584f7a | AndrasKovacs/ELTE-func-lang | Interpreter2.hs | module Interpreter2 where
import Control.Monad.Trans
import Control.Monad.State
import Control.Monad.Except
import Control.Monad.Identity
import Data.Map (Map(..))
import qualified Data.Map as Map
import Syntax
data RTVal = RTLit Lit
deriving (Eq, Ord, Show)
type Eval a = StateT (Map Var RTVal) (ExceptT String ... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-1/While/Interpreter2.hs | haskell | module Interpreter2 where
import Control.Monad.Trans
import Control.Monad.State
import Control.Monad.Except
import Control.Monad.Identity
import Data.Map (Map(..))
import qualified Data.Map as Map
import Syntax
data RTVal = RTLit Lit
deriving (Eq, Ord, Show)
type Eval a = StateT (Map Var RTVal) (ExceptT String ... | |
43e3ed271743f2bbd67dd270dbc84aca536b9ec9b746e73ccd90b148da3412d1 | waddlaw/TAPL | C2.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
import Data.Function hiding ((.))
import Data.Kind
import P... | null | https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/memo/ch24/C2.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
λ> c.sendInc.sendInc.sendGet
data Methods SubCounter a where
{ state' :: a
, methods' :: Methods SubCounter a
= M1 { get :: a -> Int
, inc :: a -> a
}
, methodsFF :: Methods FlipFlop a
} -> FlipFlop
instance Class FlipFlop ... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
import Data.Function hiding ((.))
import Data.Kind
import Prelude hiding ((.))
(.) :: a -> (a -> b) -> b
(.) ... |
3cf65fbab351e2e1de312238e7243b3ccf6919cae2a8881308813014ba49fbaf | yetibot/core | render.clj | (ns yetibot.core.commands.render
(:require [clojure.string :as string]
[selmer.filters :refer [add-filter!]]
[selmer.parser :refer [render]]
selmer.util
[taoensso.timbre :refer [info]]
[yetibot.core.hooks :refer [cmd-hook]]
[yetibot.core.interpre... | null | https://raw.githubusercontent.com/yetibot/core/e35cc772622e91aec3ad7f411a99fff09acbd3f9/src/yetibot/core/commands/render.clj | clojure | alternatively, we could install a filter to unescape:
remove piped args
(debug e) | (ns yetibot.core.commands.render
(:require [clojure.string :as string]
[selmer.filters :refer [add-filter!]]
[selmer.parser :refer [render]]
selmer.util
[taoensso.timbre :refer [info]]
[yetibot.core.hooks :refer [cmd-hook]]
[yetibot.core.interpre... |
161e3096f829ce66c17a3681318232aaf20125881f5b54f99ef4cb728f8b8a0d | javier-paris/erlang-tcpip | syn_rcvd.erl | %%%-------------------------------------------------------------------
%%% File : syn_rcvd.erl
Author : < >
Description : Received connection state
%%%
Created : 3 Sep 2004 by < >
%%%
%%%
erlang - tcpip , Copyright ( C ) 2004 Javier Paris
%%%
Licensed under the Apache License , Version 2.0 ( ... | null | https://raw.githubusercontent.com/javier-paris/erlang-tcpip/708b57fa37176980cddfd8605867426368d33ed1/src/syn_rcvd.erl | erlang | -------------------------------------------------------------------
File : syn_rcvd.erl
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... | Author : < >
Description : Received connection state
Created : 3 Sep 2004 by < >
erlang - tcpip , Copyright ( C ) 2004 Javier Paris
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(syn_rcvd).
-e... |
8aa6f1abc99623ea737e6e8d0058889d6b14a4fa6b607847f8c4e38450d54286 | ConsumerDataStandardsAustralia/validation-prototype | Coproduct.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeOperators #-}
-- | Taken wholesale from Data types a la carte.
module Data.Functor.Coproduct where
data ((f :: * -> *) :+: (g :: * -> *)) e = Inl (f e... | null | https://raw.githubusercontent.com/ConsumerDataStandardsAustralia/validation-prototype/ff63338b77339ee49fa3e0be5bb9d7f74e50c28b/consumer-data-au-lambdabank/src/Data/Functor/Coproduct.hs | haskell | # LANGUAGE TypeOperators #
| Taken wholesale from Data types a la carte.
# OVERLAPPING #
# OVERLAPPABLE # | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
module Data.Functor.Coproduct where
data ((f :: * -> *) :+: (g :: * -> *)) e = Inl (f e) | Inr (g e)
deriving (Functor)
infixr 6 :+:
class (Functor f, Functor g) => f :<: g... |
5ba8d4d135bb57f23e129bf9a4d3436b4acdb92a69d8da24473184ef20d5b5dc | tweag/HaskellR | Class.hs | -- |
Copyright : ( C ) 2013 Amgen , Inc.
--
# LANGUAGE TypeFamilies #
# LANGUAGE DefaultSignatures #
module Control.Monad.R.Class
( MonadR(..)
, Region
, acquireSome
) where
import Control.Memory.Region
import Foreign.R
import Control.Applicative
import Control.Monad.Catch (MonadCatch, MonadMask)
import Co... | null | https://raw.githubusercontent.com/tweag/HaskellR/e6b4ba0ddea32975df644fa1f9581881575ee7dc/inline-r/src/Control/Monad/R/Class.hs | haskell | |
| The class of R interaction monads. For safety, in compiled code we normally
normally use the 'IO' monad directly (by means of a 'MonadR' instance for
'IO', imported only in GHCi).
| Lift an 'IO' action.
| Acquire ownership in the current region of the given object. This means
that the liveness of the object... | Copyright : ( C ) 2013 Amgen , Inc.
# LANGUAGE TypeFamilies #
# LANGUAGE DefaultSignatures #
module Control.Monad.R.Class
( MonadR(..)
, Region
, acquireSome
) where
import Control.Memory.Region
import Foreign.R
import Control.Applicative
import Control.Monad.Catch (MonadCatch, MonadMask)
import Control.Mo... |
8659670158950f4a995b24dfe934bf80859ad3ff236c0c8a0eaa4d82704ac7d7 | DavidAlphaFox/RabbitMQ | amqp_connection_sup.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/rabbitmq-erlang-client/src/amqp_connection_sup.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
@priv... |
449fcb9d8f7cda825681e0678bbfebdc0fc29faf44bd4cd2227ae8d322af102b | RyanGlScott/text-show | Classes.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
#if __GLASGOW_HASKELL__ >= 806
{-# LANGUAGE QuantifiedConstraints #-}
#endif
|
Module : TextShow . Classes
Copyright : ( C ) 2014 ... | null | https://raw.githubusercontent.com/RyanGlScott/text-show/97cab517e510c599d31dd4e9962254bcad7f4f15/src/TextShow/Classes.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings #
# LANGUAGE QuantifiedConstraints #
-----------------------------------------------------------------------------
| Conversion of values to @Text@. Because there are both strict and lazy @Text@
efficient intermediate form that can be ... | # LANGUAGE CPP #
# LANGUAGE StandaloneDeriving #
#if __GLASGOW_HASKELL__ >= 806
#endif
|
Module : TextShow . Classes
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
... |
d5cbfcd325a3b704375c3e44fe682294d31d5cec9cb209f13f16784fe4c1fe98 | stedolan/mlsub | types.ml | open Typector
open Variance
open Exp
(* Lattice of types as coproduct *)
let rec ty_add p ts = ts
|> List.filter (function
| TZero p' when p = p' -> false
| _ -> true)
|> function
| [] -> TZero p
| [t] -> t
| (t :: ts) -> TAdd (p, t, ty_add p ts)
module TypeLat = struct
type 'a t =
| ... | null | https://raw.githubusercontent.com/stedolan/mlsub/b425c8da91f45ea59780756950871b80a18ddfc2/types.ml | ocaml | Lattice of types as coproduct
must be a type alias
nonempty list, never includes type aliases
FIXME: parsing recursive types needs more testing
guardedness check
dump structural constraints
dump dataflow constraints
FIXME: deterministic? ID-dependent?
fprintf err_formatter "best biclique: %d\n%!" n;
... | open Typector
open Variance
open Exp
let rec ty_add p ts = ts
|> List.filter (function
| TZero p' when p = p' -> false
| _ -> true)
|> function
| [] -> TZero p
| [t] -> t
| (t :: ts) -> TAdd (p, t, ty_add p ts)
module TypeLat = struct
type 'a t =
| LZero
let lift t =
if get_sta... |
e73186a60f7d0e2d3413479d45e4a59cca590acf91ca818100a4a0fc27e56c2f | knupfer/type-of-html | Convert.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleInstances #
# LANGUAGE BangPatterns #
{-# LANGUAGE MagicHash #-}
module Html.Convert
( Converted(..)
, Convert(..)
) where
import Html.Type.Internal
import Data.Word
import Data.Proxy
import Data.String
import ... | null | https://raw.githubusercontent.com/knupfer/type-of-html/503d526d224be3fbc36089f0f674087407d81a9d/src/Html/Convert.hs | haskell | # LANGUAGE MagicHash #
| This is already very efficient .
Wrap the Strings in Raw if you do n't want to escape them .
| This is already very efficient.
Wrap the Strings in Raw if you don't want to escape them.
# INLINE [0] stringConv # | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleInstances #
# LANGUAGE BangPatterns #
module Html.Convert
( Converted(..)
, Convert(..)
) where
import Html.Type.Internal
import Data.Word
import Data.Proxy
import Data.String
import Data.Char (ord)
import Data.Double.Conversio... |
2cd61c9b5aa83af9e04ab94d8015e9f8db7eb3871e102ef8c5d8fba02db8e25f | jxa/resque-clojure | helper.clj | (ns resque-clojure.test.helper
(:use [clojure.java.shell :only [sh]])
(:require [clojure.string :as string]
[resque-clojure.redis :as redis]
[resque-clojure.core :as core]))
(def ^:dynamic *config*
{'pidfile "/tmp/resque-clojure-redis.pid"
'daemonize "yes"
'port "6380"
'logfile "... | null | https://raw.githubusercontent.com/jxa/resque-clojure/bc7dae6ce16b8b3ecaa58ddf622242c7ee6fedc6/test/resque_clojure/test/helper.clj | clojure | wait for redis to start | (ns resque-clojure.test.helper
(:use [clojure.java.shell :only [sh]])
(:require [clojure.string :as string]
[resque-clojure.redis :as redis]
[resque-clojure.core :as core]))
(def ^:dynamic *config*
{'pidfile "/tmp/resque-clojure-redis.pid"
'daemonize "yes"
'port "6380"
'logfile "... |
45ce853737c8bdd78967d05adb0b7cb1f7e221caf70c683282f790dce922e38d | dmitryvk/sbcl-win32-threads | cell.lisp | ;;;; the VM definition of various primitive memory access VOPs for the
;;;; Alpha
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public doma... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/compiler/alpha/cell.lisp | lisp | the VM definition of various primitive memory access VOPs for the
Alpha
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
data object ref/set stuff
symbol hacking VOPs
The compiler likes to... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!VM")
(define-vop (slot)
(:args (object :scs (descriptor-reg)))
(:info name offset lowtag)
(:ignore n... |
edb5037c9875a67e823c1001fc5363114b5de3f9542565ba8b40b3c77d8e4c55 | dm3/sicp | all.clj | ;; ## Tests
;;
;; Runs tests for all of the exercises.
(ns all
(:use [clojure.contrib.find-namespaces :only (find-namespaces-on-classpath)])
(:use clojure.test))
;; Our situation is a little bit different from an ordinary project where each
;; separate namespace might get associated with a separate test file. In o... | null | https://raw.githubusercontent.com/dm3/sicp/14f0361cbd0cce817d93e38dcc895f3e845515b1/src/test/clojure/all.clj | clojure | ## Tests
Runs tests for all of the exercises.
Our situation is a little bit different from an ordinary project where each
separate namespace might get associated with a separate test file. In our
case tests are *inside* of the actual sources.
we'll dynamically `require` namespaces which interest us to be picked ... | (ns all
(:use [clojure.contrib.find-namespaces :only (find-namespaces-on-classpath)])
(:use clojure.test))
Guided by [ / requiring - all - possible - namespaces.html ) ,
(doseq [n (find-namespaces-on-classpath)]
(when (. (str n) startsWith "e")
(try
(require n)
(catch Exception e (println (s... |
2e48dfe460a178fa3719a133ce74be86350e2d176a83dfc110e596caaedf832d | well-typed/large-records | R070.hs | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.ConstraintFamily_Shallow.Sized.R070 where
import Data.Proxy
import Bench.HList
import Exp... | null | https://raw.githubusercontent.com/well-typed/large-records/551f265845fbe56346988a6b484dca40ef380609/large-records-benchmarks/bench/experiments/Experiment/ConstraintFamily_Shallow/Sized/R070.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.ConstraintFamily_Shallow.Sized.R070 where
import Data.Proxy
import Bench.HList
import Experiment.ConstraintFamily_Shallow
import Common.HListOfSize.HL070
satisfyCF :: ()
satisfyCF = withCF (Proxy @(HList ExampleF... |
f582b11ee35908908d214d65c7901e164840e3c1b759b76b689663ca931e766b | district0x/cljs-ipfs-http-client | bootstrap.cljs | (ns cljs-ipfs-api.bootstrap
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[bootstrap.list]
[bootstrap.add]
[bootstrap.rm]])
| null | https://raw.githubusercontent.com/district0x/cljs-ipfs-http-client/2352396430fb1ca179054845b956184c871ceedd/src/cljs_ipfs_api/bootstrap.cljs | clojure | (ns cljs-ipfs-api.bootstrap
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[bootstrap.list]
[bootstrap.add]
[bootstrap.rm]])
| |
ba9cbe98c1c4ad333d1bf66c8554a4be3b5d3547bbd5540940093f60b8798ac3 | 8c6794b6/haskell-sc-scratch | CB2.hs | {-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveFunctor #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstab... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Oleg/TTF/CB2.hs | haskell | # LANGUAGE EmptyDataDecls # | # LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DeriveFunctor #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portabl... |
a72345e6e451647c637447ddb5f3e3b1f16d4712c1ad6312f6fb0ff4d63a9cb6 | thepower/tpnode | maphash.erl | -module(maphash).
%% API
-export([hash/1, hash/2, map2binary/2]).
hash(Map) ->
Hasher =
fun(Bin) when is_binary(Bin) ->
crypto:hash(sha256, Bin)
end,
hash(Map, Hasher).
hash(Map, Hasher) ->
Hasher(map2binary(Map,[])).
map2binary(Map,Path) when is_map(Map) ->
Keys = lists:sort(maps:keys(Map)),
... | null | https://raw.githubusercontent.com/thepower/tpnode/8eb38eb7f6def0edcd12c63ff77cce1866dcdf4d/apps/tpnode/src/maphash.erl | erlang | API | -module(maphash).
-export([hash/1, hash/2, map2binary/2]).
hash(Map) ->
Hasher =
fun(Bin) when is_binary(Bin) ->
crypto:hash(sha256, Bin)
end,
hash(Map, Hasher).
hash(Map, Hasher) ->
Hasher(map2binary(Map,[])).
map2binary(Map,Path) when is_map(Map) ->
Keys = lists:sort(maps:keys(Map)),
Conve... |
119b3e30d124ac817239e9a1a608857a1285ddbe43f3750309534a5233fef23f | larrychristensen/orcpub | options_test.clj | (ns orcpub.dnd.e5.options-test
(:require [clojure.test :refer [is deftest testing]]
[clojure.spec.alpha :as spec]
[clojure.data :refer [diff]]
[orcpub.dnd.e5.options :as opt]
[orcpub.entity :as entity]))
(deftest test-total-slots
(is (= {1 2} (opt/total-slots 3 3)))
... | null | https://raw.githubusercontent.com/larrychristensen/orcpub/e83995857f7e64af1798009a45a0b03abcd3a4be/test/cljc/orcpub/dnd/e5/options_test.clj | clojure | (ns orcpub.dnd.e5.options-test
(:require [clojure.test :refer [is deftest testing]]
[clojure.spec.alpha :as spec]
[clojure.data :refer [diff]]
[orcpub.dnd.e5.options :as opt]
[orcpub.entity :as entity]))
(deftest test-total-slots
(is (= {1 2} (opt/total-slots 3 3)))
... | |
cb030eac54640c8d705b1963cbc3b7ce7eb6d09cd895357aeb7355d0d1dbdb99 | ghcjs/ghcjs-dom | ClipboardEvent.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.ClipboardEvent
(js_newClipboardEvent, newClipboardEvent, js_getClipboardData,
g... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/ClipboardEvent.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.ClipboardEvent
(js_newClipboardEvent, newClipboardEvent, js_getClipboardData,
getClipboardData, getClipboardDataUnsafe,
getClipboardDataUnchecked, ClipboardEvent(..), gTy... |
c47c111e9b05f522847443fdb476465a13533afa6367277ab3135790d238cbb9 | NorfairKing/smos | Username.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE ExistentialQuantification #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
module Smos.API.Username
( Username (..),
usernameString,
parseUsername,
parse... | null | https://raw.githubusercontent.com/NorfairKing/smos/489f5b510c9a30a3c79fef0a0d1a796464705923/smos-api/src/Smos/API/Username.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE ExistentialQuantification #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Smos.API.Username
( Username (..),
usernameString,
parseUsername,
parseUsernameWithError,
validUsernam... |
695397dfd2c95ec3c98df03ed0a7dc3794775a72193d641786d9b329e588fa8b | YoshikuniJujo/test_haskell | PhysicalDevice.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Khr.Surface.PhysicalDevice (
getSupport, getFormats, getCapabilities, getPresentModes ) where
import Gpu.Vulkan.Khr.Enum
import Gpu.Vulkan.Khr.Surface.Type
import qualified Gpu.Vulkan.PhysicalDevice as PhysicalDevice
import qualified Gpu.Vulkan.QueueFamily.... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/3331c59da96fe96955ec1771b2776d6a0a1ff02a/themes/gui/vulkan/try-my-vulkan-snd/src/Gpu/Vulkan/Khr/Surface/PhysicalDevice.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Khr.Surface.PhysicalDevice (
getSupport, getFormats, getCapabilities, getPresentModes ) where
import Gpu.Vulkan.Khr.Enum
import Gpu.Vulkan.Khr.Surface.Type
import qualified Gpu.Vulkan.PhysicalDevice as PhysicalDevice
import qualified Gpu.Vulkan.QueueFamily.... | |
68654fb7d8198b5bcd272c785acf5c5956d51015fc5297a92befa1116dc97829 | SumitPadhiyar/confuzz | lwt_fmt.ml | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
type formatter = {
commit : unit -> unit Lwt.t ;
fmt : Format.formatter ;
}
let write_pending ppft = ppft.commit ()
let flush ppft = Format.pp_print_flush ppft.fm... | null | https://raw.githubusercontent.com/SumitPadhiyar/confuzz/7d6b2af51d7135025f9ed1e013a9ae0940f3663e/src/unix/lwt_fmt.ml | ocaml | * Stream formatter
* Channel formatter
* Printing functions | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
type formatter = {
commit : unit -> unit Lwt.t ;
fmt : Format.formatter ;
}
let write_pending ppft = ppft.commit ()
let flush ppft = Format.pp_print_flush ppft.fm... |
6fa55dae63f780e0b050e39005ca713f123040c8ad5f658e412890eb16d656d2 | ghc/testsuite | tcfail206.hs | # LANGUAGE TupleSections , UnboxedTuples #
module ShouldCompile where
a :: Bool -> (Int, Bool)
a = ( , True)
b :: Int -> Bool -> (Int, Bool)
b = (1, )
c :: a -> (a, Bool)
c = (True || False, )
d :: Bool -> (#Int, Bool#)
d = (# , True#)
e :: Int -> Bool -> (#Int, Bool#)
e = (#1, #)
f :: a -> (#a, Bool#)
f = (#True... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/tcfail206.hs | haskell | # LANGUAGE TupleSections , UnboxedTuples #
module ShouldCompile where
a :: Bool -> (Int, Bool)
a = ( , True)
b :: Int -> Bool -> (Int, Bool)
b = (1, )
c :: a -> (a, Bool)
c = (True || False, )
d :: Bool -> (#Int, Bool#)
d = (# , True#)
e :: Int -> Bool -> (#Int, Bool#)
e = (#1, #)
f :: a -> (#a, Bool#)
f = (#True... | |
af4608803323b7bb3181d8d1f6695384d8be524baf218d4effb41bdeec4b6adb | naproche/naproche | Block.hs | -- |
Authors : ( 2001 - 2008 ) ,
( 2017 - 2018 )
--
-- TODO: Add description.
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE GADTs #-}
module SAD.Data.Text.Block (
ProofText(..),
Block(..),
makeBlock,
position,
declaredNames,
text,
Section(..),
showForm,
formulate,
compose,
needsProo... | null | https://raw.githubusercontent.com/naproche/naproche/6284a64b4b84eaa53dd0eb7ecb39737fb9135a0d/src/SAD/Data/Text/Block.hs | haskell | |
TODO: Add description.
# LANGUAGE GADTs #
Composition
form the formula image of a whole block
In this case, we give the formula 'exists x_1,...,x_n . (formulate block) ^ f'.
Otherwise, we give the formula 'forall x_1,...,x_n . (formulate block) => f'.
necessity of proof as derived from the block type
which... | Authors : ( 2001 - 2008 ) ,
( 2017 - 2018 )
# LANGUAGE NamedFieldPuns #
module SAD.Data.Text.Block (
ProofText(..),
Block(..),
makeBlock,
position,
declaredNames,
text,
Section(..),
showForm,
formulate,
compose,
needsProof,
isTopLevel,
file,
parseErrors,
canDeclare
) wh... |
3b48df53122c7575fac6041b0a91a9b2ed9e82cb3bc88347ddd72b5eb26b7018 | yallop/ocaml-asp | json_unstaged_combinator_parser.ml |
* Copyright ( c ) 2018 and
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2018 Neelakantan Krishnaswami and Jeremy Yallop
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*... | null | https://raw.githubusercontent.com/yallop/ocaml-asp/a092f17ea55d427c63414899e39a8fe80b30db14/benchmarks/json/json_unstaged_combinator_parser.ml | ocaml |
* Copyright ( c ) 2018 and
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2018 Neelakantan Krishnaswami and Jeremy Yallop
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*... | |
0ad3b61e4034623bed7f7ef828b008a80dc9ef18a5a040d213ff6b6a5a55cb11 | hasktorch/hasktorch | Model.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Model where
import Control.Monad.Indexed (IxPointed (ireturn), (>>>... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/cf0ed1aba9c41123ba46f7c0788a4df10fbfe1ef/experimental/gradually-typed/examples/neural-interpreter/Model.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Model where
import Control.Monad.Indexed (IxPointed (ireturn), (>>>... | |
ee1ecb196ef3be34c8d33b6313041089388066b7b1d99fc6f0e3856ff1efa8dc | ndmitchell/catch | Lexer.hs | -- #hide
-----------------------------------------------------------------------------
-- |
Module : Language . .
Copyright : ( c ) The GHC Team , 1997 - 2000
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portability : port... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/src/Haskell/Lexer.hs | haskell | #hide
---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
---------------------------------------------------------------------------
ToDo: Use a lexica... | Module : Language . .
Copyright : ( c ) The GHC Team , 1997 - 2000
for Haskell .
ToDo : Introduce different tokens for decimal , octal and hexadecimal ( ? )
ToDo : FloatTok should have three parts ( integer part , fraction , exponent ) ( ? )
module Haskell.Lexer (Token(..), lexer) where
imp... |
c200e0f9a7e563607f1fd3059452dfc6c6ba6df1a7abf8ff8813ccae53d8ce10 | jyh/metaprl | itt_rbtree.ml | doc <:doc<
@module[Itt_rbtree]
This is a theory of red-black trees.
>>
extends Itt_sortedtree
extends Itt_bintree
extends Itt_relation_str
extends Itt_set_str
extends Itt_record
extends Itt_logic
extends Itt_bisect
extends Itt_tunion
extends Itt_nat
extends Itt_labels
doc docoff
open Lm_debug
open Lm_printf
... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/itt/applications/datatypes/itt_rbtree.ml | ocaml | Son of a red parent is black, son of a black parent may have any color
Red-black tree with a black root
Red-black tree with an arbitary root
if t=emptree
if t=tree(self)
if a<data
if a=data
if a>data
== ==
== induction ==
== balance == | doc <:doc<
@module[Itt_rbtree]
This is a theory of red-black trees.
>>
extends Itt_sortedtree
extends Itt_bintree
extends Itt_relation_str
extends Itt_set_str
extends Itt_record
extends Itt_logic
extends Itt_bisect
extends Itt_tunion
extends Itt_nat
extends Itt_labels
doc docoff
open Lm_debug
open Lm_printf
... |
72aec1c7022053e0ee6fbfff1f822487d297e81ca683a70d53d2bd78d2dc3eb2 | LuisThiamNye/chic | paint.clj | (ns chic.paint
(:require
[chic.util :as util]
[better-cond.core :refer [cond] :rename {cond cond+}]
[clj-commons.primitive-math :as prim]
[clojure.math :as math]
[io.github.humbleui.paint :as huipaint])
(:import
(io.github.humbleui.skija Paint PaintMode)))
(defn -fix-b [n]
(if (> n 127)
(-... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/paint.clj | clojure | (ns chic.paint
(:require
[chic.util :as util]
[better-cond.core :refer [cond] :rename {cond cond+}]
[clj-commons.primitive-math :as prim]
[clojure.math :as math]
[io.github.humbleui.paint :as huipaint])
(:import
(io.github.humbleui.skija Paint PaintMode)))
(defn -fix-b [n]
(if (> n 127)
(-... | |
7061956312364b76268fd978f99486277be9cb6c373f9be16af6e769212ca8a3 | apibot-org/apibot | layout.clj | (ns apibot.layout
(:require [selmer.parser :as parser]
[selmer.filters :as filters]
[markdown.core :refer [md-to-html-string]]
[ring.util.http-response :as response :refer [content-type ok]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.middlewa... | null | https://raw.githubusercontent.com/apibot-org/apibot/26c77c688980549a8deceeeb39f01108be016435/src/clj/apibot/layout.clj | clojure | (ns apibot.layout
(:require [selmer.parser :as parser]
[selmer.filters :as filters]
[markdown.core :refer [md-to-html-string]]
[ring.util.http-response :as response :refer [content-type ok]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.middlewa... | |
879c1a466daf86f58f092a74828d2b69eed790f38226766aa663925d54445f15 | yetibot/yetibot | csv.clj | (ns yetibot.test.commands.csv
(:require
[clojure.data.csv :as csv]
[midje.sweet :refer [fact =>]]
[yetibot.commands.csv :refer [csv-cmd csv-data->maps csv-parse-cmd]]))
(def sample-csv
"foo,bar,baz
A,1,x
B,2,y
C,3,z")
(fact
"csv parsing results in maps with columns as keyword keys"
(-> sample-csv
... | null | https://raw.githubusercontent.com/yetibot/yetibot/2fb5c1182b1a53ab0e433d6bab2775ebd43367de/test/yetibot/test/commands/csv.clj | clojure | (ns yetibot.test.commands.csv
(:require
[clojure.data.csv :as csv]
[midje.sweet :refer [fact =>]]
[yetibot.commands.csv :refer [csv-cmd csv-data->maps csv-parse-cmd]]))
(def sample-csv
"foo,bar,baz
A,1,x
B,2,y
C,3,z")
(fact
"csv parsing results in maps with columns as keyword keys"
(-> sample-csv
... | |
cfb7c1282b727c60c9f7354c33be292ac7fe97539f8317f79a24c56dc7223307 | nuprl/gradual-typing-performance | insert-large-letters.rkt | #lang typed/racket
(require typed/racket/gui
typed/framework
string-constants)
(provide insert-large-letters)
(: insert-large-letters (String Char (Instance Text:Basic<%>) (Instance Frame%) -> Void))
(define (insert-large-letters comment-prefix comment-character edit parent)
(let ([str (make-larg... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/insert-large-letters.rkt | racket | CHANGE - get-face can return #f
(make-large-letters-dialog ";" #\; #f) | #lang typed/racket
(require typed/racket/gui
typed/framework
string-constants)
(provide insert-large-letters)
(: insert-large-letters (String Char (Instance Text:Basic<%>) (Instance Frame%) -> Void))
(define (insert-large-letters comment-prefix comment-character edit parent)
(let ([str (make-larg... |
ef9b2d57909af7869323fda5d8d4332fe5858358f8a214a48a13b005e9ca8a95 | gfredericks/test.chuck | runner.cljs | (ns com.gfredericks.test.chuck.runner
(:require [doo.runner :refer-macros [doo-tests]]
[com.gfredericks.test.chuck.generators-test]
[com.gfredericks.test.chuck.properties-test]
[com.gfredericks.test.chuck.clojure-test-test]
[com.gfredericks.test.chuck.clojure-test-outpu... | null | https://raw.githubusercontent.com/gfredericks/test.chuck/12452504675cffb3a98cfa28674bd26c27d5b9ac/test/com/gfredericks/test/chuck/runner.cljs | clojure | (ns com.gfredericks.test.chuck.runner
(:require [doo.runner :refer-macros [doo-tests]]
[com.gfredericks.test.chuck.generators-test]
[com.gfredericks.test.chuck.properties-test]
[com.gfredericks.test.chuck.clojure-test-test]
[com.gfredericks.test.chuck.clojure-test-outpu... | |
0a32059e754358fb33b467567f3b90da7c4faa41687aad508e0a7442331c1003 | tov/dssl2 | vec-huh.rkt | #lang dssl2
assert vec?([2])
assert not vec?('2')
| null | https://raw.githubusercontent.com/tov/dssl2/105d18069465781bd9b87466f8336d5ce9e9a0f3/test/dssl2/vec-huh.rkt | racket | #lang dssl2
assert vec?([2])
assert not vec?('2')
| |
68e6ca600f8fab8d465f7ffeb5778df4ddc8a88ea488e0a9511f0691e356efb0 | techascent/tvm-clj | testing.clj | (ns tvm-clj.impl.fns.testing
(:require [tvm-clj.impl.tvm-ns-fns :as tvm-ns-fns]))
(tvm-ns-fns/export-tvm-functions "testing") | null | https://raw.githubusercontent.com/techascent/tvm-clj/1088845bd613b4ba14b00381ffe3cdbd3d8b639e/src/tvm_clj/impl/fns/testing.clj | clojure | (ns tvm-clj.impl.fns.testing
(:require [tvm-clj.impl.tvm-ns-fns :as tvm-ns-fns]))
(tvm-ns-fns/export-tvm-functions "testing") | |
39d60390d5f34b38cf9b4de0a1b060a5df0b69475d5563dbac746c8ad212f78f | jeffshrager/biobike | seed-soap-queries.lisp | -*- Package : bio ; mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
(in-package :bio)
;;; +=========================================================================+
| Copyright ( c ) 2009 JP Massar
;;; | |
;;; | Permission is hereby g... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/seedorgs/seed-soap-queries.lisp | lisp | mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and as... |
(in-package :bio)
| Copyright ( c ) 2009 JP Massar
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject to |
| in all copies o... |
7a28c998e535688b2c71e471b57bffae6554280b1145ad043959e31b6a822272 | erlio/vmq_plugin | vmq_plugin_SUITE.erl | -module(vmq_plugin_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([init_per_testcase/2, end_per_testcase/2,
init_per_suite/1,
all/0]).
-export([an_empty_config_file/1,
app_hook_without_proplist/1,
load_plugin_config_file/1,
bad_plugin_does_not_get_saved/1,
... | null | https://raw.githubusercontent.com/erlio/vmq_plugin/a4da95452f9363489c1fc5e2f753438e1d7b0b34/test/vmq_plugin_SUITE.erl | erlang | lager:set_loglevel(lager_console_backend, debug),
Tests
Expect that no new plugins has been written to file.
Expect that the bad plugin has not been written to file.
`vmq_plugin` is an application, so we can cheat and use that as
a plugin.
Expect that the bad plugin has not been written to file.
Enabling a modul... | -module(vmq_plugin_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([init_per_testcase/2, end_per_testcase/2,
init_per_suite/1,
all/0]).
-export([an_empty_config_file/1,
app_hook_without_proplist/1,
load_plugin_config_file/1,
bad_plugin_does_not_get_saved/1,
... |
9c9192c8d5507d5969a006191d1e2e2d9eba8d42aea873e143f3993c4ca5ac03 | ros/roslisp | aserve.lisp | ;;;; -*- mode: lisp -*-
;;;;
$ I d : aserve.lisp , v 1.1.1.1 2004/06/09 09:02:39 scaekenberghe Exp $
;;;;
This file implements XML - RPC client and server networking based
;;;; on (Portable) AllegroServe (see /
;;;; or /), which you have
to install first .
;;;;
Copyright ( C ) 2002 , 2004 .
;;;;
;;;; You are... | null | https://raw.githubusercontent.com/ros/roslisp/559355a8d695e34e6dedae071a9af2c065411687/s-xml-rpc/src/aserve.lisp | lisp | -*- mode: lisp -*-
on (Portable) AllegroServe (see /
or /), which you have
You are granted the rights to distribute and use this software
(), also known as the LLGPL. | $ I d : aserve.lisp , v 1.1.1.1 2004/06/09 09:02:39 scaekenberghe Exp $
This file implements XML - RPC client and server networking based
to install first .
Copyright ( C ) 2002 , 2004 .
as governed by the terms of the Lisp Lesser GNU Public License
(defpackage xml-rpc-aserve
(:use common-lisp net.aserv... |
7835112e06447dfc2eeb9670c4668f0bcc73b041941f330f73c31146db3714b1 | alvatar/spheres | integer.scm | ! ! ! Byte integer conversions
.author , 2003
.author , 2015
Copyright ( C ) 2003
;;
;; Permission to copy ; this software, to modify it, to redistribute it,
;; to distribute modified versions, and to use it for any purpose is
;; granted, subject to the following restrictions and understandings.
;;
1 .... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/dataenc/integer.scm | scheme |
Permission to copy ; this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
this software must include ; this copyright notice
in full.
this software will be error-free, and I am under... | ! ! ! Byte integer conversions
.author , 2003
.author , 2015
Copyright ( C ) 2003
2 . I have made no warranty or representation that the operation of
Converts the first n bytes of big - endian array to an integer .
( u8vector->integer ( bytes 0 0 0 15 ) -4 )
= = > 15
( u8vector->... |
f42566f402af5e65bbcee4ba50669693a050002430948bbe98fc11f1255fb8a2 | dramforever/finlog | Node.hs | module Finlog.IR.Node where
import Data.Hashable
import Data.Kind
import Finlog.Framework.DAG
import Finlog.Framework.Graph
import Finlog.Utils.Unique
newtype YieldId = YieldId Unique
deriving newtype (Eq, Ord, Hashable)
instance Show YieldId where
show (YieldId uniq) = "[yield]" ++ show uniq
freshYieldId :... | null | https://raw.githubusercontent.com/dramforever/finlog/ca642dfa7ea89b131ab13b6b267fabf317e12d9c/src/Finlog/IR/Node.hs | haskell | module Finlog.IR.Node where
import Data.Hashable
import Data.Kind
import Finlog.Framework.DAG
import Finlog.Framework.Graph
import Finlog.Utils.Unique
newtype YieldId = YieldId Unique
deriving newtype (Eq, Ord, Hashable)
instance Show YieldId where
show (YieldId uniq) = "[yield]" ++ show uniq
freshYieldId :... | |
7fbe8868040283c8d5295fdebe346b90c238ad9eb9c25ea7ea124a22853e817a | haskell/cabal | A.hs | module A where
import D
foo = d
| null | https://raw.githubusercontent.com/haskell/cabal/c66a1260f86c9c2f16dc319604f766fd8f756045/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/src/A.hs | haskell | module A where
import D
foo = d
| |
0fe873e681aa05b547b85075f2e3d65555ae9d90bf582b87ea93f3f8ce9dcb9d | stuarthalloway/programming-clojure | project.clj | START : clojurebreaker - project
(defproject clojurebreaker "0.1.0-SNAPSHOT"
:description "Clojurebreaker game for Programming Clojure 2nd Edition"
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/math.combinatorics "0.0.1"]
[org.c... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/clojurebreaker/project.clj | clojure | END: clojurebreaker-project | START : clojurebreaker - project
(defproject clojurebreaker "0.1.0-SNAPSHOT"
:description "Clojurebreaker game for Programming Clojure 2nd Edition"
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/math.combinatorics "0.0.1"]
[org.c... |
c5cd194d3615c03c8a07d6bed3d02360bae447548f4c51cc846f2224506a8845 | cardmagic/lucash | test-base.scm | ;;; Basic functions for the scsh-test-suite
Author : 2001
;; --- The list to store the tests ---
(define *test-list* '())
;; --- add-test! ------------------------------------------------
;; This is the main function to add a test to the test-suite
;; name - a symbol naming the test uniquely
;; group - a symbo... | null | https://raw.githubusercontent.com/cardmagic/lucash/0452d410430d12140c14948f7f583624f819cdad/reference/scsh-0.6.6/scsh/test/test-base.scm | scheme | Basic functions for the scsh-test-suite
--- The list to store the tests ---
--- add-test! ------------------------------------------------
This is the main function to add a test to the test-suite
name - a symbol naming the test uniquely
group - a symbol for the group of this test
proc - the function that doe... | Author : 2001
(define *test-list* '())
(define (add-test! name group proc . args)
(let ((test (make-testdt name group proc args)))
(let ((other (filter (lambda (test)
(equal? (testdt-name test)
name))
*test-list*)))
(for-each (lambda (test)
(set! *test-list* (delete! test *test-... |
3c118dacfec515930602729ce406961374ea469182bcd9ec2b26aa14c445acd7 | sweet-tooth-clojure/describe | describe.cljc | (ns sweet-tooth.describe
(:require [loom.graph :as lg]
[loom.alg :as la]
[loom.attr :as lat]
[loom.derived :as ld]
[clojure.spec.alpha :as s]
[clojure.walk :as walk]
[clojure.string :as str])
(:refer-clojure :exclude [empty not=])
#?(:cljs (:... | null | https://raw.githubusercontent.com/sweet-tooth-clojure/describe/e1e1cd02c1bbeaeb8537370e092ab75f4d4e5d2d/src/sweet_tooth/describe.cljc | clojure | ::ignore is used for control flow to allow rules to
indicate that the subgraph should not be applied, but the
current rule's description shouldn't be aded
-----------------
Perform description
-----------------
ignore indicates that the rule doesn't have a
description, but that its subgraph shouldn't be
applie... | (ns sweet-tooth.describe
(:require [loom.graph :as lg]
[loom.alg :as la]
[loom.attr :as lat]
[loom.derived :as ld]
[clojure.spec.alpha :as s]
[clojure.walk :as walk]
[clojure.string :as str])
(:refer-clojure :exclude [empty not=])
#?(:cljs (:... |
ab1a9d41a01e7dcddeee9ee4e299f6e9892031e23dbaf8e35d9de26c62519f4a | input-output-hk/cardano-wallet | Windows.hs | -- |
Copyright : © 2018 - 2020 IOHK
-- License: Apache-2.0
-- Portability: Windows
--
module Cardano.Startup.Windows
( installSignalHandlers
, setDefaultFilePermissions
, restrictFileMode
, killProcess
) where
import Prelude
import System.Process
( Pid )
-- | Stub function for windows.
ins... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/4dd33e7842f5cf3d33ffdfde35a3398504cc7dc0/lib/launcher/src/Cardano/Startup/Windows.hs | haskell | |
License: Apache-2.0
Portability: Windows
| Stub function for windows.
| Stub function for windows.
| Stub function for windows.
| Stub function for windows. Under windows, the default behaviour of
'terminateProcess' is to kill, so this isn't needed. | Copyright : © 2018 - 2020 IOHK
module Cardano.Startup.Windows
( installSignalHandlers
, setDefaultFilePermissions
, restrictFileMode
, killProcess
) where
import Prelude
import System.Process
( Pid )
installSignalHandlers :: IO () -> IO ()
installSignalHandlers _ = pure ()
setDefaultFileP... |
3a6a99a56d5007a3da3235d47b2d1efd0d9c6d97641dc72b106bc56e26bf1740 | ChrisPenner/Candor | Types.hs | # LANGUAGE InstanceSigs #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
module Types where
import RIO
import Data.Set as S
import Data.List as L
import AST
import GHC.Exts (IsList(..))
import qualified Data.Map as M
data TypeConst
= IntT
| StringT
| BoolT
| BinderT
deriving (Show, Eq)
... | null | https://raw.githubusercontent.com/ChrisPenner/Candor/7003da63cdcf63ee5864bab639a987bb43a4003e/src/Types.hs | haskell | Things like Int, (), etc
List of types
Forall FreeTypes
deriving (Show, Eq)
pretty (Forall quantifieds m) =
"∀ " <> (L.intercalate " " $ S.toList quantifieds) <> ". " <> pretty m
instance Sub Polytype where
sub subst@(Substitutions s) (Forall free t) = Forall leftOver (sub subst t)
where | # LANGUAGE InstanceSigs #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
module Types where
import RIO
import Data.Set as S
import Data.List as L
import AST
import GHC.Exts (IsList(..))
import qualified Data.Map as M
data TypeConst
= IntT
| StringT
| BoolT
| BinderT
deriving (Show, Eq)
... |
9bc31ab6b2ab171c519a5e48b0db30150722f264671e75a150f3f1419bab1ea3 | ocaml/odoc | shadowed.mli | (** Reference to a shadowed module. References should be resolved after the
whole signature has been added to the scope. *)
type t
module M : sig
(** . *)
* Should resolve to [ M.t ] : { { ! t } Before - shadowed } .
Of course , it 's possible to reference { ! Shadowed.t } .
Of course, it's pos... | null | https://raw.githubusercontent.com/ocaml/odoc/d67202d9d95f58840d80de42ae91198d3543b3d0/test/xref2/references_scope.t/shadowed.mli | ocaml | * Reference to a shadowed module. References should be resolved after the
whole signature has been added to the scope.
* .
* Should resolve to [M.t]: {{!t} After-shadowed}
* [val] and [external] both define a value.
Should resolve to [N.f]: {!f}
Should resolve to [Shadowed.f]: {!Shadowed.f} |
type t
module M : sig
* Should resolve to [ M.t ] : { { ! t } Before - shadowed } .
Of course , it 's possible to reference { ! Shadowed.t } .
Of course, it's possible to reference {!Shadowed.t}. *)
type t
end
external f : int -> int = "%identity"
module N : sig
val f : int -> int
end
|
76a60ed57903ce22ac7bc08b4b471ef0ecca4e3523f940fadbf2b3f7f303fe94 | spurious/sagittarius-scheme-mirror | eager-comprehensions.scm | -*- mode : scheme ; coding : utf-8 ; -*-
eager - comprehensions ported for Sagittarius by
#!nobacktrace
#!core
originally from Gauche
; <PLAINTEXT>
; Eager Comprehensions in [outer..inner|expr]-Convention
; ======================================================
;
, Eindhoven , The Netherlands , Feb-2003 .
;... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/srfi/%253a42/eager-comprehensions.scm | scheme | coding : utf-8 ; -*-
<PLAINTEXT>
Eager Comprehensions in [outer..inner|expr]-Convention
======================================================
Scheme R5RS (incl. macros), SRFI-23 (error).
,open srfi-23
,load ec.scm
; File > Open ... "ec.scm", click Execute
(require 'macro) (require 'record)
(l... | eager - comprehensions ported for Sagittarius by
#!nobacktrace
#!core
originally from Gauche
, Eindhoven , The Netherlands , Feb-2003 .
Loading the implementation into Scheme48 0.57 :
Loading the implementation into PLT / DrScheme 202 :
Loading the implementation into SCM 5d7 :
(library (srfi :42 eager... |
58b14461cd482d1d18490116db5a8fadb2864fa992ea960710bd9d063ff7b981 | avsm/mirage-duniverse | out_channel.ml | open! Base
open! Import
type t = Caml.out_channel
let equal (t1 : t) t2 = phys_equal t1 t2
let seek = Caml.LargeFile.seek_out
let pos = Caml.LargeFile.pos_out
let length = Caml.LargeFile.out_channel_length
let stdout = Caml.stdout
let stderr = Caml.stderr
let sexp_of_t t =
if phys_equal t stderr
then Sexp... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/stdio/src/out_channel.ml | ocaml | open! Base
open! Import
type t = Caml.out_channel
let equal (t1 : t) t2 = phys_equal t1 t2
let seek = Caml.LargeFile.seek_out
let pos = Caml.LargeFile.pos_out
let length = Caml.LargeFile.out_channel_length
let stdout = Caml.stdout
let stderr = Caml.stderr
let sexp_of_t t =
if phys_equal t stderr
then Sexp... | |
bfd7ab66642e47e5b3526df81f3f86180b9f23e8f05acbee65dea62daac7aa0e | BU-CS320/Fall-2018 | Main.hs | module Main where
import Greeting
import Test.Tasty (defaultMain, testGroup)
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
main = defaultMain unitTests
unitTests =
testGroup
"greetingTest"
[greetingTest, identTest]
-- an empty greeting is no good
greetingTest =
testCase ... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/assignments/week1/lab1/tests/Main.hs | haskell | an empty greeting is no good
test that ident works
| module Main where
import Greeting
import Test.Tasty (defaultMain, testGroup)
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
main = defaultMain unitTests
unitTests =
testGroup
"greetingTest"
[greetingTest, identTest]
greetingTest =
testCase "the greeting should not be empty... |
e4edda40fef197b1becee371910b916e57f418495ad201d42fa7f97effbd5eca | ocaml-ppx/ppxlib | test.ml | open Ppxlib;;
Expansion_helpers.mangle (Prefix "pre") "foo";;
[%%expect{|
- : string = "pre_foo"
|}]
Expansion_helpers.mangle (Suffix "suf") "foo";;
[%%expect{|
- : string = "foo_suf"
|}]
Expansion_helpers.mangle (PrefixSuffix ("pre", "suf")) "foo";;
[%%expect{|
- : string = "pre_foo_suf"
|}]
Expansion_helpers.mang... | null | https://raw.githubusercontent.com/ocaml-ppx/ppxlib/bddb50645455b386bea99121903afae8d7c119b2/test/expansion_helpers/mangle/test.ml | ocaml | open Ppxlib;;
Expansion_helpers.mangle (Prefix "pre") "foo";;
[%%expect{|
- : string = "pre_foo"
|}]
Expansion_helpers.mangle (Suffix "suf") "foo";;
[%%expect{|
- : string = "foo_suf"
|}]
Expansion_helpers.mangle (PrefixSuffix ("pre", "suf")) "foo";;
[%%expect{|
- : string = "pre_foo_suf"
|}]
Expansion_helpers.mang... | |
8fba25eafb44917a9eb363e2f0d28509036ba45e9a5ea4a16f0433b2da1535e1 | youscape/ebt | ebt_condition.erl | %%%-------------------------------------------------------------------
@author zyuyou
( C ) 2015 ,
@doc 条件节点
%%%
%%% @end
%%%-------------------------------------------------------------------
-module(ebt_condition).
-ebt_extend(ebt_node).
-include("ebt.hrl").
-include("ebt_transform.hrl").
%% API
-export... | null | https://raw.githubusercontent.com/youscape/ebt/546121bdfa24cb8cbd64ff4f842fd42ec7d50189/src/ebt_condition.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
API
API
====================================================================
behaviour callback
====================================================================
条件验证(验证是... | @author zyuyou
( C ) 2015 ,
@doc 条件节点
-module(ebt_condition).
-ebt_extend(ebt_node).
-include("ebt.hrl").
-include("ebt_transform.hrl").
-export([tick/1]).
-compile([export_all]).
-callback do_check(Node :: ebt_node()) -> boolean().
tick(#ebt_node{mod = Mod} = Node) ->
case Mod:do_check(Node) of
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.