_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 |
|---|---|---|---|---|---|---|---|---|
a38722afa65fcf780cb03ce6ca70c20c603c6aa841ecc36002ad643adc6cfbc0 | runtimeverification/haskell-backend | Imports.hs | module Test.Kore.Validate.DefinitionVerifier.Imports (
test_imports,
) where
import Kore.Attribute.Symbol qualified as Attribute
import Kore.Error
import Kore.IndexedModule.Error (
noSort,
)
import Kore.Internal.Alias qualified as Internal
import Kore.Internal.ApplicationSorts
import Kore.Internal.Symbol qual... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/test/Test/Kore/Validate/DefinitionVerifier/Imports.hs | haskell | N.B., this is not related to the used sort. | module Test.Kore.Validate.DefinitionVerifier.Imports (
test_imports,
) where
import Kore.Attribute.Symbol qualified as Attribute
import Kore.Error
import Kore.IndexedModule.Error (
noSort,
)
import Kore.Internal.Alias qualified as Internal
import Kore.Internal.ApplicationSorts
import Kore.Internal.Symbol qual... |
285cbb52cfd2ab537ab0d4acf18a8ab67e572ecee8ee5518bc9b5ba375c4db9c | didierverna/clon | context.lisp | ;;; context.lisp --- Context management
Copyright ( C ) 2010 - 2012 , 2015 , 2017 , 2020 , 2021
Author : < >
This file is part of .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and t... | null | https://raw.githubusercontent.com/didierverna/clon/dc4b0e2c4f654d5c99c1140b4d3cabb9c15e769c/core/src/context.lisp | lisp | context.lisp --- Context management
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHA... |
Copyright ( C ) 2010 - 2012 , 2015 , 2017 , 2020 , 2021
Author : < >
This file is part of .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS... |
32a9332834dd42ae10d73e8cf7816742f1972555df731fe1b035f22d1d11e505 | PEZ/rich4clojure | problem_143.clj | (ns rich4clojure.easy.problem-143
(:require [hyperfiddle.rcf :refer [tests]]))
;; = dot product =
;; By 4Clojure user: bloop
;; Difficulty: Easy
Tags : [ seqs math ]
;;
Create a function that computes the dot product of two
;; sequences. You may assume that the vectors will have
;; the same length.
(def __ :te... | null | https://raw.githubusercontent.com/PEZ/rich4clojure/2ccfac041840e9b1550f0a69b9becbdb03f9525b/src/rich4clojure/easy/problem_143.clj | clojure | = dot product =
By 4Clojure user: bloop
Difficulty: Easy
sequences. You may assume that the vectors will have
the same length.
Share your solution, and/or check how others did it:
| (ns rich4clojure.easy.problem-143
(:require [hyperfiddle.rcf :refer [tests]]))
Tags : [ seqs math ]
Create a function that computes the dot product of two
(def __ :tests-will-fail)
(comment
)
(tests
0 := (__ [0 1 0] [1 0 0])
3 := (__ [1 1 1] [1 1 1])
32 := (__ [1 2 3] [4 5 6])
256 := (__ [2 5 6] ... |
8baa34a7d6994b8022c3241da632c113e1ec8450a08898b21e8884df55ef160e | fdopen/ppx_cstubs | marshal_types.ml | This file is part of ppx_cstubs ( )
* Copyright ( c ) 2018 - 2019 fdopen
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version... | null | https://raw.githubusercontent.com/fdopen/ppx_cstubs/5d5ce9b7cf45d87bb71c046a76d30c17ec6075e5/src/internal/marshal_types.ml | ocaml | external xyz : .... = "c_name"
external prim_name : ..... | This file is part of ppx_cstubs ( )
* Copyright ( c ) 2018 - 2019 fdopen
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version... |
8b91411ef9a990ce41400f774a7e9e81c9ffec2da0991356283d5c6d42e21e37 | sinasamavati/leptus | leptus_http2.erl | Copyright ( c ) 2013 - 2015 Sina Samavati < >
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%% to use, copy, modify, me... | null | https://raw.githubusercontent.com/sinasamavati/leptus/e0d9bd2270dfa85bd5922e0a5c2d0289d2dc0ef9/test/leptus_http_SUITE_data/leptus_http2.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice ... | Copyright ( c ) 2013 - 2015 Sina Samavati < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY ... |
f45b6d876f4a032633ebede33f939ac7af6eda81e3b51682b3a22ffae724d674 | takikawa/racket-ppa | construct.rkt | Smart constructors and better names for markup
#lang racket/base
(require racket/contract
(only-in simple-tree-text-markup/data markup? record-dc-datum?))
(provide
(contract-out
(srcloc-markup (srcloc? markup? . -> . markup?))
(framed-markup (markup? . -> . markup?))
(image-markup (any/c markup? . -> ... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/d336bb10e3e0ec3a20020e9ade9e77d2f6f80b6d/share/pkgs/simple-tree-text-markup-lib/simple-tree-text-markup/construct.rkt | racket | flatten out nested markup elements, merge adjacent strings | Smart constructors and better names for markup
#lang racket/base
(require racket/contract
(only-in simple-tree-text-markup/data markup? record-dc-datum?))
(provide
(contract-out
(srcloc-markup (srcloc? markup? . -> . markup?))
(framed-markup (markup? . -> . markup?))
(image-markup (any/c markup? . -> ... |
56ffd0fb9a6a83080999de1ef69017f663f0d4ea90d48d50cfba78e292849ab2 | haskell/HTTP | Proxy.hs | # LANGUAGE CPP #
-----------------------------------------------------------------------------
-- |
Module : Network .
-- Copyright : See LICENSE file
License : BSD
--
-- Maintainer : Ganesh Sittampalam <>
-- Stability : experimental
-- Portability : non-portable (not tested)
--
-- Handling... | null | https://raw.githubusercontent.com/haskell/HTTP/3e9af54c867769275d7bf50c88bcd037cde6132a/Network/HTTP/Proxy.hs | haskell | ---------------------------------------------------------------------------
|
Copyright : See LICENSE file
Maintainer : Ganesh Sittampalam <>
Stability : experimental
Portability : non-portable (not tested)
Handling proxy server settings and their resolution.
------------------------------------------... | # LANGUAGE CPP #
Module : Network .
License : BSD
module Network.HTTP.Proxy
( Proxy(..)
) where
# if ! defined(WIN32 ) & & defined(mingw32_HOST_OS )
# define WIN32 1
# endif
#if !defined(WIN32) && defined(mingw32_HOST_OS)
#define WIN32 1
#endif
-}
import Control.Monad ( when,... |
015a488fde85742c3064fe3b04c45cbcb71ddedc5a376b6c3808bb1b871b09f6 | seckcoder/course-compiler | r1a_4.rkt | (let ([a 1])
(let ([b 1])
(let ([c 1])
(let ([d 1])
(let ([e 1])
(let ([f 1])
(let ([g 1])
(let ([h 1])
(let ([i 1])
(let ([j 1])
(let ([k 1])
(let ([l 1])
(let ([m... | null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/student-tests/r1a_4.rkt | racket | (let ([a 1])
(let ([b 1])
(let ([c 1])
(let ([d 1])
(let ([e 1])
(let ([f 1])
(let ([g 1])
(let ([h 1])
(let ([i 1])
(let ([j 1])
(let ([k 1])
(let ([l 1])
(let ([m... | |
adfcad2d6f0a9e45a6337f896051cbc94a5a1f0ecc2e515af2be95539af473c0 | realworldocaml/book | setup.defaults.ml | let library_path = []
let roots : string option Install.Section.Paths.Roots.t =
{ lib_root = None
; man = None
; doc_root = None
; etc_root = None
; share_root = None
; bin = None
; sbin = None
; libexec_root = None
}
| null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_rules/setup.defaults.ml | ocaml | let library_path = []
let roots : string option Install.Section.Paths.Roots.t =
{ lib_root = None
; man = None
; doc_root = None
; etc_root = None
; share_root = None
; bin = None
; sbin = None
; libexec_root = None
}
| |
a891452c9e49aeab7008031848ceca0e1535532457281f7bc90f743311807cc8 | SNePS/SNePS2 | lexicon-2.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
;;; Version: $Id: lexicon-2.lisp,v
;;; This file is part of SNePS.
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Buff... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/nlint/lexicon-2.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
Version: $Id: lexicon-2.lisp,v
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 go... |
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
$ 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 express
The Original Code is... |
3a9bd6f3f006dc2e86a1456dab88ef5b1596d30d800725f32f5ccac600d9f4fd | jasonstolaruk/CurryMUD | Gods.hs | module Mud.Misc.Gods where
import Mud.Data.Misc
import Mud.Data.State.MudData
import Mud.Util.Misc
import qualified Data.Set as S (Set, filter, fromList, toList)
godSet :: S.Set God
godSet = S.fromList [ God Aule GodOfWealth . Just $ (Male, Dwarf ) -- Son of Drogo a... | null | https://raw.githubusercontent.com/jasonstolaruk/CurryMUD/f9775fb3ede08610f33f27bb1fb5fc0565e98266/lib/Mud/Misc/Gods.hs | haskell | Son of Drogo and Celoriel.
Daughter of Drogo and Celoriel.
Wife of Drogo.
Husband of Celoriel.
Daughter of Drogo and Celoriel. | module Mud.Misc.Gods where
import Mud.Data.Misc
import Mud.Data.State.MudData
import Mud.Util.Misc
import qualified Data.Set as S (Set, filter, fromList, toList)
godSet :: S.Set God
Daughter of Murgorhd and Iminye .
, God Itulvatar GodOfLight Nothing
... |
76da1a51b701bf3261092113cbf4a29814a3a65507b69e7173f8046f7ae3e4b9 | helpshift/gulfstream | project.clj | (defproject helpshift/gulfstream "0.2.1"
:description "graphing library wrapper built on top of graphstream"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[garden "1.2.5"]
[net.sourceforge.cssparser/c... | null | https://raw.githubusercontent.com/helpshift/gulfstream/f5e3f4159a9335bcf73ccbb750e0e6b17bde8773/project.clj | clojure | (defproject helpshift/gulfstream "0.2.1"
:description "graphing library wrapper built on top of graphstream"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[garden "1.2.5"]
[net.sourceforge.cssparser/c... | |
5d3aee03e78fc1b01f37bb447a9294dac5c604ff5aa3aae8b2db5eddf62b8872 | v-kolesnikov/sicp | 1_22_test.clj | (ns sicp.chapter01.1-22-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-22 :refer :all]
[sicp.common :refer [avg]]))
(deftest test-search-for-primes
(let [searched-primes
(map #(search-for-primes % 3) [1000 10000 100000 1000000 ... | null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/test/sicp/chapter01/1_22_test.clj | clojure | (ns sicp.chapter01.1-22-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-22 :refer :all]
[sicp.common :refer [avg]]))
(deftest test-search-for-primes
(let [searched-primes
(map #(search-for-primes % 3) [1000 10000 100000 1000000 ... | |
87559bab6ad7312c226e0adcd3d2229beb756c198a1da9fe29efee84e196e9ac | nyu-acsys/drift | a-copy-print.ml | (*
USED: PLDI2011 as a-cppr
USED: PEPM2013 as a-cppr
*)
let make_array n i = assert (0 <= i && i < n); 0
let update (i:int) (n:int) des x : int -> int =
des i;
let a j = if i=j then x else des j in a
let print_int (n:int) = ()
let f (m:int) src des =
let rec bcopy (m:int) src des i =
if i >= m then
des... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/high/a-copy-print.ml | ocaml |
USED: PLDI2011 as a-cppr
USED: PEPM2013 as a-cppr
-:{v:Int|true} |
let make_array n i = assert (0 <= i && i < n); 0
let update (i:int) (n:int) des x : int -> int =
des i;
let a j = if i=j then x else des j in a
let print_int (n:int) = ()
let f (m:int) src des =
let rec bcopy (m:int) src des i =
if i >= m then
des
else
let des = update i m des (src i) in
... |
f4a23f54c406d664b2b96f7f293a126c6c13a1f6a077a50367341694ae699099 | geneweb/geneweb | name.ml | Copyright ( c ) 1998 - 2007 INRIA
(* La liste des caractères interdits *)
let forbidden_char = [ ':'; '@'; '#'; '='; '$' ]
Name.lower
let unaccent_utf_8 lower s i =
let fns =
if lower then fun n s -> (String.lowercase_ascii s, n) else fun n s -> (s, n)
in
let fnc =
if lower then fun n c -> (String.... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/util/name.ml | ocaml | La liste des caractères interdits
Name.abbrev
List of abbreviations. If abbreviation is mapped to [Some s] should be remplaced by
[s]. If mapped to None, it should be removed from name.
Checks if the word starting at [i] in [s] is [p].
Name.abbrev: suppress lowercase particles, shorten "saint" into "st"
N... | Copyright ( c ) 1998 - 2007 INRIA
let forbidden_char = [ ':'; '@'; '#'; '='; '$' ]
Name.lower
let unaccent_utf_8 lower s i =
let fns =
if lower then fun n s -> (String.lowercase_ascii s, n) else fun n s -> (s, n)
in
let fnc =
if lower then fun n c -> (String.make 1 @@ Char.lowercase_ascii c, n)
... |
17b6dd271b3f27d4a1cb5791d4c1e268891b5117845f8204cec4fbc3b133fd87 | atzedijkstra/chr | Core.hs | # LANGUAGE ConstraintKinds , MultiParamTypeClasses , FlexibleInstances , FunctionalDependencies , UndecidableInstances , ExistentialQuantification , ScopedTypeVariables , StandaloneDeriving , GeneralizedNewtypeDeriving , TemplateHaskell , NoMonomorphismRestriction #
----------------------------------------------------... | null | https://raw.githubusercontent.com/atzedijkstra/chr/035027514f0956cbb2889c7fafb272160ba33b4d/chr-core/src/CHR/Types/Core.hs | haskell | -----------------------------------------------------------------------------------------
- Constraint Handling Rules
-----------------------------------------------------------------------------------------
.Strict
-----------------------------------------------------------------------------------------
- Name <-> Va... | # LANGUAGE ConstraintKinds , MultiParamTypeClasses , FlexibleInstances , FunctionalDependencies , UndecidableInstances , ExistentialQuantification , ScopedTypeVariables , StandaloneDeriving , GeneralizedNewtypeDeriving , TemplateHaskell , NoMonomorphismRestriction #
module CHR.Types.Core
( IsConstraint(..)
, Cons... |
d246c0f6a295e0e36256b2dbf493c2f4f3806de74699fdb1b7471c09282c2410 | BranchTaken/Hemlock | test_conversion.ml | open! Basis.Rudiments
open! Basis
open I32
let test () =
let rec fn = function
| [] -> ()
| x :: xs' -> begin
let i = x in
let t = trunc_of_sint i in
let i' = extend_to_sint t in
let t' = trunc_of_sint i' in
File.Fmt.stdout
|> Fmt.fmt "trunc_of_sint "
|... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/i32/test_conversion.ml | ocaml | open! Basis.Rudiments
open! Basis
open I32
let test () =
let rec fn = function
| [] -> ()
| x :: xs' -> begin
let i = x in
let t = trunc_of_sint i in
let i' = extend_to_sint t in
let t' = trunc_of_sint i' in
File.Fmt.stdout
|> Fmt.fmt "trunc_of_sint "
|... | |
76fe8b4a818b37a06c771dfde94a35677198688c4cb66c7cb4be4347aeb79efe | opencog/pln | simple-implication.scm | ;; Define simple implications to test implication instantiation rules
(ImplicationScopeLink (stv 1 1)
(TypedVariableLink
(VariableNode "$X")
(TypeNode "ConceptNode"))
(EvaluationLink (stv 0.2 0.9)
(PredicateNode "P")
(VariableNode "$X"))
(EvaluationLink
(PredicateNode "Q")
... | null | https://raw.githubusercontent.com/opencog/pln/52dc099e21393892cf5529fef687a69682436b2d/tests/pln/rules/simple-implication.scm | scheme | Define simple implications to test implication instantiation rules
This one is to test the implication instantiation rule when the
precondition cannot be satisfied
This one is to test implicant distribution |
(ImplicationScopeLink (stv 1 1)
(TypedVariableLink
(VariableNode "$X")
(TypeNode "ConceptNode"))
(EvaluationLink (stv 0.2 0.9)
(PredicateNode "P")
(VariableNode "$X"))
(EvaluationLink
(PredicateNode "Q")
(VariableNode "$X")))
(EvaluationLink (stv 1 1)
(PredicateNode "P"... |
800c6679a57e1fb84f5d406aa7fd503d4704fb87d7f16a5bc74ef64c69aa4839 | fujita-y/ypsilon | takl.scm | TAKL -- The TAKeuchi function using lists as counters .
(define (listn n)
(if (= n 0)
'()
(cons n (listn (- n 1)))))
(define l18 (listn 18))
(define l12 (listn 12))
(define l6 (listn 6))
(define (mas x y z)
(if (not (shorterp y x))
z
(mas (mas (cdr x) y z)
(mas (cdr y) z x)
... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/50f1fdc499d1cbd77879ab376d4a394adf347b76/bench/gambit-benchmarks/takl.scm | scheme | TAKL -- The TAKeuchi function using lists as counters .
(define (listn n)
(if (= n 0)
'()
(cons n (listn (- n 1)))))
(define l18 (listn 18))
(define l12 (listn 12))
(define l6 (listn 6))
(define (mas x y z)
(if (not (shorterp y x))
z
(mas (mas (cdr x) y z)
(mas (cdr y) z x)
... | |
82023e221119946bf39067fdba062fb6f47f062f9997cc18c8849ea588257b67 | igorhvr/bedlam | scamacr.scm | ;;; "scamacr.scm" syntax-case macros for Scheme constructs
Copyright ( C ) 1992
;;;
;;; Permission to copy this software, in whole or in part, to use this
;;; software for any lawful purpose, and to redistribute this software
;;; is granted subject to the restriction that all copies made of this
;;; software must ... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/scamacr.scm | scheme | "scamacr.scm" syntax-case macros for Scheme constructs
Permission to copy this software, in whole or in part, to use this
software for any lawful purpose, and to redistribute this software
is granted subject to the restriction that all copies made of this
software must include this copyright notice in full. This... | Copyright ( C ) 1992
is provided AS IS , with NO WARRANTY , EITHER EXPRESS OR IMPLIED ,
NATURE WHATSOEVER .
Written by
92/06/18
(define-syntax with-syntax
(lambda (x)
(syntax-case x ()
((_ () e1 e2 ...)
(syntax (begin e1 e2 ...)))
((_ ((out in)) e1 e2 ..... |
3522b7fc0dbe1b457f2d1953c95f6908aa7a7fdbeb1f53efd9c3489e8083ec1c | basvandijk/threads | Thread.hs | # LANGUAGE CPP , NoImplicitPrelude , RankNTypes , ImpredicativeTypes #
#if __GLASGOW_HASKELL__ >= 701
# LANGUAGE Trustworthy #
#endif
--------------------------------------------------------------------------------
-- |
-- Module : Control.Concurrent.Thread
Copyright : ( c ) 2010 - 2012
-- License :... | null | https://raw.githubusercontent.com/basvandijk/threads/b51a750a11fe568f5388993d53449ee9b9049e2c/Control/Concurrent/Thread.hs | haskell | ------------------------------------------------------------------------------
|
Module : Control.Concurrent.Thread
License : BSD3 (see the file LICENSE)
Standard threads extended with the ability to /wait/ for their return value.
we suggest:
@
import qualified Control.Concurrent.Thread as Thread ( ...... | # LANGUAGE CPP , NoImplicitPrelude , RankNTypes , ImpredicativeTypes #
#if __GLASGOW_HASKELL__ >= 701
# LANGUAGE Trustworthy #
#endif
Copyright : ( c ) 2010 - 2012
Maintainer : < >
, < >
This module exports equivalently named functions from @Control . Concurrent@
( and @GHC.Conc@... |
36aeaac643a2e009195c8895176c8479453d35cd18737908d874968bf6b74953 | alekras/erl.mqtt.server | session.erl | %%
Copyright ( C ) 2015 - 2022 by ( )
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
... | null | https://raw.githubusercontent.com/alekras/erl.mqtt.server/d05919cfc7bfdb7a252eb97a58da67f6a3c48138/apps/mqtt_server/test/session.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright ( C ) 2015 - 2022 by ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@since 2016 - 09 - 29
2015 - 2022
@author < > [ / ]
-module(session).
-include_lib("stdlib/include/assert.hrl").
-include_... |
850353e560a3b3737d3c97cf5376f16a9cb75d1f5eb4a3bc830ebfa8f51df745 | NorfairKing/tickler | PostLoginSpec.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
module Tickler.Server.Handler.PostLoginSpec (spec) where
import Network.HTTP.Types as HTTP
import Servant.API (HList (..), Headers (..))
import TestImport hiding (HList (..))
import Tickler.Client
import Tic... | null | https://raw.githubusercontent.com/NorfairKing/tickler/1b0c05dc1d32847596bd3ffe4f93d094e1f6382a/tickler-server-gen/test/Tickler/Server/Handler/PostLoginSpec.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Tickler.Server.Handler.PostLoginSpec (spec) where
import Network.HTTP.Types as HTTP
import Servant.API (HList (..), Headers (..))
import TestImport hiding (HList (..))
import Tickler.Client
import Tickler.Server.TestUtils
spec :: Spec
spec = withTicklerServ... |
eb3be97fdb0cc44c793337492b0212ab4f94a12ff01258bd063ad5cb584d6849 | dyoo/whalesong | parameters.rkt | #lang typed/racket/base
(require "compiler/expression-structs.rkt"
"compiler/lexical-structs.rkt"
"compiler/arity-structs.rkt"
"sets.rkt"
racket/path
racket/port)
(require/typed "logger.rkt"
[log-warning (String -> Void)])
(provide current-defined-name
... | null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/parameters.rkt | racket | Turn this one so that js-assembler/package generates a file per module, as
opposed to trying to bundle them all together.
Turns on caching of compiled programs, so that repeated compilations
will reuse existing work.
Turns on ie legacy support; includes excanvas and other helper libraries
to smooth out compatibil... | #lang typed/racket/base
(require "compiler/expression-structs.rkt"
"compiler/lexical-structs.rkt"
"compiler/arity-structs.rkt"
"sets.rkt"
racket/path
racket/port)
(require/typed "logger.rkt"
[log-warning (String -> Void)])
(provide current-defined-name
... |
51bb1455f847d0d06dd0c40b8f93e875ca1bb88268fc5111e953e6d526706a80 | teamwalnut/graphql-ppx | list_inputs.ml | open Test_shared
module MyQuery =
[%graphql
{|
query ($arg: ListsInput!) {
listsInput(arg: $arg)
}
|}]
type qt = MyQuery.t
let pp formatter (obj : qt) =
Format.fprintf formatter "< listsInput = @[%s@] >" obj.listsInput
let equal (a : qt) (b : qt) = a.listsInput = b.listsInput
let allows_none_in_lists_of_... | null | https://raw.githubusercontent.com/teamwalnut/graphql-ppx/8276452ebe8d89a748b6b267afc94161650ab620/tests_native/list_inputs.ml | ocaml | open Test_shared
module MyQuery =
[%graphql
{|
query ($arg: ListsInput!) {
listsInput(arg: $arg)
}
|}]
type qt = MyQuery.t
let pp formatter (obj : qt) =
Format.fprintf formatter "< listsInput = @[%s@] >" obj.listsInput
let equal (a : qt) (b : qt) = a.listsInput = b.listsInput
let allows_none_in_lists_of_... | |
a0269f457a64d0b25c80b6316475fa2077b0eff51177425b21644e01ab3cce56 | ndmitchell/catch | Predicate2.hs |
{- |
For details see </~ndm/projects/libraries.php>
The idea behind this library is that the simplification of the predicate is
handled automatically using the 'PredLit' instance.
-}
module Data.Predicate2(
-- * Core Type Declarations
Pred, Reduction(..), PredLit(..), PredLitNot(..),
-- *... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/proposition/Unused/Predicate2.hs | haskell | |
For details see </~ndm/projects/libraries.php>
The idea behind this library is that the simplification of the predicate is
handled automatically using the 'PredLit' instance.
* Core Type Declarations
* Predicate Creation
* Extract and Test
* Show
* Play
* Debugging options
only to be used fo... |
module Data.Predicate2(
Pred, Reduction(..), PredLit(..), PredLitNot(..),
predTrue, predFalse, predLit, predAnd, predOr, predNot, predBool,
isFalse, isTrue,
showPred, showPredBy,
mapPredLit, allPredLit, mapPredLitM
) where
import Data.List
import Data.Maybe
import Control.Monad
import quali... |
5f7882913de715e1d1d7a72afd22db849ffa2bf8c0108d1e355d03b030f0d7a6 | sbtourist/clamq | project.clj | (defproject clamq/clamq-rabbitmq "0.5-SNAPSHOT"
:description "Clojure APIs for Message Queues"
:dependencies [[clamq/clamq-core "0.5-SNAPSHOT"]
[org.slf4j/slf4j-api "1.6.1"]
[org.springframework.amqp/spring-rabbit "1.0.0.RELEASE"]]
:dev-dependencies [
[org.slf4j/slf4j-... | null | https://raw.githubusercontent.com/sbtourist/clamq/34a6bbcb7a2a431ea629aa5cfbc687ef31f860f2/clamq-rabbitmq/project.clj | clojure | (defproject clamq/clamq-rabbitmq "0.5-SNAPSHOT"
:description "Clojure APIs for Message Queues"
:dependencies [[clamq/clamq-core "0.5-SNAPSHOT"]
[org.slf4j/slf4j-api "1.6.1"]
[org.springframework.amqp/spring-rabbit "1.0.0.RELEASE"]]
:dev-dependencies [
[org.slf4j/slf4j-... | |
fa6699b99665db90c252e9b33ee6280dac4385e9ba4d54dbb8148323f70517ac | ktakashi/sagittarius-scheme | ecdh.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; crypto/key/ecdh.scm - ECDH and ECCDH
;;;
Copyright ( c ) 2017 . All rights reserved .
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
1 . Redis... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/ec4aa18461cbbbf8fb13376cb85eaf01ce7fb998/ext/crypto/crypto/ecdh.scm | scheme | coding : utf-8 ; -*-
crypto/key/ecdh.scm - ECDH and ECCDH
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions an... | Copyright ( c ) 2017 . All rights reserved .
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
... |
34a8801352ccbd06f0ce2ae120ee4e5226546a6a82d4fd8a38009881225b1bf4 | lasp-lang/lasp | lasp_client_server_advertisement_counter_SUITE.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2016 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the ... | null | https://raw.githubusercontent.com/lasp-lang/lasp/1701c8af77e193738dfc4ef4a5a703d205da41a1/test/lasp_client_server_advertisement_counter_SUITE.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2016 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(lasp_client_server_ad... |
d4b9c98850e746f513a21db93f1ea3563da50fd4742c33c70051d7bd9c31327a | stuarthalloway/programming-clojure | expectorate.clj | (ns examples.expectorate
(:import (java.io FileOutputStream OutputStreamWriter BufferedWriter)))
(defn expectorate [dst content]
(with-open [writer (-> dst
FileOutputStream.
OutputStreamWriter.
BufferedWriter.)]
(.write writer (str cont... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/src/examples/expectorate.clj | clojure | (ns examples.expectorate
(:import (java.io FileOutputStream OutputStreamWriter BufferedWriter)))
(defn expectorate [dst content]
(with-open [writer (-> dst
FileOutputStream.
OutputStreamWriter.
BufferedWriter.)]
(.write writer (str cont... | |
443c1eca4f33b9a6a5949085bcbf9690d671029e409097bb423178d1246438cd | DKurilo/hackerrank | Main.hs | import Control.Monad
import Data.List (minimumBy)
import Debug.Trace (trace)
import System.IO
rocks :: Int
rocks = 30
letters :: Int
letters = 27
data Op = GoRight | GoLeft | Prev | Next | Take | Loop Program
instance Show Op where
show GoRight = ">"
show GoLeft = "<"
show Prev = "-"
show Next = "+"
show ... | null | https://raw.githubusercontent.com/DKurilo/hackerrank/bb6a69775a4a03c784fc678de54ded5ef6eb5d30/codingame/brain-fork/src/Main.hs | haskell | DO NOT REMOVE
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
hPutStrLn stderr "Debug messages..."
Write action to stdout | import Control.Monad
import Data.List (minimumBy)
import Debug.Trace (trace)
import System.IO
rocks :: Int
rocks = 30
letters :: Int
letters = 27
data Op = GoRight | GoLeft | Prev | Next | Take | Loop Program
instance Show Op where
show GoRight = ">"
show GoLeft = "<"
show Prev = "-"
show Next = "+"
show ... |
bec481c971761e1da3bca75460a7dcfb77ceef7cdff7e226de3f695de47c92b9 | databrary/databrary | ConfigTest.hs | {-# LANGUAGE OverloadedStrings #-}
module Store.ConfigTest
where
import Data.Aeson hiding (Value)
import qualified Data.ByteString as BS
import Data.Monoid ((<>))
import qualified Data.Text as T
-- import Test.Tasty
import Test.Tasty.HUnit
import Store.Config
-- example usage; TODO: replace guts with data.yaml
unit_... | null | https://raw.githubusercontent.com/databrary/databrary/685f3c625b960268f5d9b04e3d7c6146bea5afda/test/Store/ConfigTest.hs | haskell | # LANGUAGE OverloadedStrings #
import Test.Tasty
example usage; TODO: replace guts with data.yaml | module Store.ConfigTest
where
import Data.Aeson hiding (Value)
import qualified Data.ByteString as BS
import Data.Monoid ((<>))
import qualified Data.Text as T
import Test.Tasty.HUnit
import Store.Config
unit_Config_examples :: Assertion
unit_Config_examples = do
pathKey (Path ["k1", "k2"]) @?= "k1.k2"
encod... |
2d705487faa9bc6a04bc62c8cc0df1f00e5bdb1c0a0f21d70a9a361096b50321 | basho/riak_shell | connection_EXT.erl | %% -------------------------------------------------------------------
%%
%% connection management extension for riak_shell
%%
Copyright ( c ) 2007 - 2016 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this... | null | https://raw.githubusercontent.com/basho/riak_shell/afc4b7c04925f8accaa5b32ee0253d8c0ddc5000/src/connection_EXT.erl | erlang | -------------------------------------------------------------------
connection management extension for riak_shell
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the Licen... | Copyright ( c ) 2007 - 2016 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-... |
7d8c732fe5de98a027eaa994d65fe9820b6775f9671058c59d1c11eefa8a2f07 | master/ejabberd | ejabberd_update.erl | %%%-------------------------------------------------------------------
File :
Author : < >
%%% Purpose : ejabberd code updater
Created : 27 Jan 2006 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2012 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it ... | null | https://raw.githubusercontent.com/master/ejabberd/9c31874d5a9d1852ece1b8ae70dd4b7e5eef7cf7/src/ejabberd_update.erl | erlang | -------------------------------------------------------------------
Purpose : ejabberd code updater
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without eve... | File :
Author : < >
Created : 27 Jan 2006 by < >
ejabberd , Copyright ( C ) 2002 - 2012 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public Li... |
6d8b6c4b4a6d23902e9dda7ee49fa969c4f73d0d5eb213ff9ac948a2ded5e718 | gowthamk/ocaml-irmin | iheap_leftlist.ml | open Printf
open Lwt.Infix
open Irmin_unix
module type Config =
sig val root : string val shared : string val init : unit -> unit end
let from_just op msg =
match op with
| Some x -> x
| None -> failwith @@ (msg ^ ": Expected Some. Got None.")
module MakeVersioned(Config:Config)(Atom:Heap_leftlist.ATOM) =
struct
modul... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/heap_leftist/mem/iheap_leftlist.ml | ocaml | printf "%s\n"
(Fmt.to_to_string K.pp k); | open Printf
open Lwt.Infix
open Irmin_unix
module type Config =
sig val root : string val shared : string val init : unit -> unit end
let from_just op msg =
match op with
| Some x -> x
| None -> failwith @@ (msg ^ ": Expected Some. Got None.")
module MakeVersioned(Config:Config)(Atom:Heap_leftlist.ATOM) =
struct
modul... |
34236221cd1f26e96430bf92a2b09f61c13740dbfd1a330db519661d15e9eedd | Dexterminator/clj-templates | server.clj | (ns clj-templates.server
(:require [integrant.core :as ig]
[environ.core :refer [env]]
[ring.adapter.jetty :refer [run-jetty]]))
(defmethod ig/init-key :server/jetty [_ {:keys [handler opts]}]
(run-jetty handler (assoc opts :port (Integer/parseInt (env :port)))))
(defmethod ig/halt-key! :s... | null | https://raw.githubusercontent.com/Dexterminator/clj-templates/705e652fece2455257e5008c12c712bb9f7802d1/src/clj/clj_templates/server.clj | clojure | (ns clj-templates.server
(:require [integrant.core :as ig]
[environ.core :refer [env]]
[ring.adapter.jetty :refer [run-jetty]]))
(defmethod ig/init-key :server/jetty [_ {:keys [handler opts]}]
(run-jetty handler (assoc opts :port (Integer/parseInt (env :port)))))
(defmethod ig/halt-key! :s... | |
e3768e0cf6ff1c001597247cd23b08d5a02501486fd28fd2e694e3954a12987a | helmutkian/cl-react | example.lisp | (defun ajax (&key (type "GET") (cache t) url data success error)
(chain $
(ajax (create :url url
:type type
:cache cache
:data-type "json"
:data data
:success success
:error error))))
(define-class comment-box
(:load-comments-from-server
(lambda (... | null | https://raw.githubusercontent.com/helmutkian/cl-react/f6c2af7cbd4ad70e3cba6c7e6f9ef789d73bca2b/example.lisp | lisp | (defun ajax (&key (type "GET") (cache t) url data success error)
(chain $
(ajax (create :url url
:type type
:cache cache
:data-type "json"
:data data
:success success
:error error))))
(define-class comment-box
(:load-comments-from-server
(lambda (... | |
62eee70e523497c3035d13428fda2d74b55c3ed6c4eb74a7411648655b4a67a5 | eamsden/Animas | AFRPTestsCOC.hs | $ I d : AFRPTestsCOC.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... | null | https://raw.githubusercontent.com/eamsden/Animas/2404d1de20982a337109fc6032cb77b022514f9d/tests/AFRPTestsCOC.hs | haskell | ----------------------------------------------------------------------------
Test cases for collection-oriented combinators
---------------------------------------------------------------------------- | $ I d : AFRPTestsCOC.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... |
6ceeae22db451d99bb0e4717324895206f19fd73ce5f010b9797880ad0ed8dc6 | spectrum-finance/cardano-dex-contracts | Deposit.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module ErgoDex.Contracts.Proxy.Deposit where
import PlutusLedgerApi.V1.Crypto (PubKeyHash)
import PlutusLedgerApi.V1.Value
import qualified PlutusTx
import PlutusTx.Builtins
data DepositConfig = DepositConfig
{ poolNft :: AssetClass
, tokenA :: ... | null | https://raw.githubusercontent.com/spectrum-finance/cardano-dex-contracts/87bdbc26dbe9ae5f6c59e608d728330f8166f19c/cardano-dex-contracts-onchain/ErgoDex/Contracts/Proxy/Deposit.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module ErgoDex.Contracts.Proxy.Deposit where
import PlutusLedgerApi.V1.Crypto (PubKeyHash)
import PlutusLedgerApi.V1.Value
import qualified PlutusTx
import PlutusTx.Builtins
data DepositConfig = DepositConfig
{ poolNft :: AssetClass
, tokenA :: ... | |
89ae75a2023ad45cd0a98a3102b62e642fc9843fd8ea2026b0a3d8696597d5d2 | TomerAberbach/programming-in-haskell-exercises | 2-and-3.hs | grid :: Int -> Int -> [(Int, Int)]
grid m n = [(x, y) | x <- [0..m], y <- [0..n]]
square :: Int -> [(Int, Int)]
square n = [(x, y) | (x, y) <- grid n n, x /= y]
| null | https://raw.githubusercontent.com/TomerAberbach/programming-in-haskell-exercises/a66830529ebc9c4d84d0e4c6e0ad58041b46bc32/parts/1/chapters/5/2-and-3.hs | haskell | grid :: Int -> Int -> [(Int, Int)]
grid m n = [(x, y) | x <- [0..m], y <- [0..n]]
square :: Int -> [(Int, Int)]
square n = [(x, y) | (x, y) <- grid n n, x /= y]
| |
a6af74469b93e383023bf828ba98be072991b179fbd70def8e635879dc1d5e33 | kpblc2000/KpblcLispLib | _kpblc-get-objectid-for-field.lsp | (defun _kpblc-get-objectid-for-field (obj / str)
;|
* Ïîëó÷åíèå ñòðîêîâîãî ïðåäñòàâëåíèÿ îáúåêòà äëÿ èñïîëüçîâàíèÿ â ïîëÿõ. Ðàáîòàåò òîëüêî â òåêóùåì äîêóìåíòå
* Ïàðàìåòðû âûçîâà:
óêàçàòåëü íà
* Ïðèìåðû âûçîâà:
(_kpblc-get-objectid-for-field (car (entsel)))
|;
... | null | https://raw.githubusercontent.com/kpblc2000/KpblcLispLib/49d1d9d29078b4167cc65dc881bea61b706c620d/lsp/get/objectid/_kpblc-get-objectid-for-field.lsp | lisp | |
_ end of and
_ end of if
_ end of defun
| (defun _kpblc-get-objectid-for-field (obj / str)
* Ïîëó÷åíèå ñòðîêîâîãî ïðåäñòàâëåíèÿ îáúåêòà äëÿ èñïîëüçîâàíèÿ â ïîëÿõ. Ðàáîòàåò òîëüêî â òåêóùåì äîêóìåíòå
* Ïàðàìåòðû âûçîâà:
óêàçàòåëü íà
* Ïðèìåðû âûçîâà:
(_kpblc-get-objectid-for-field (car (entsel)))
(if (and (setq obj (_kpblc-conv-ent-to-ename... |
09b562795db2d10b802116eb39b1abe4c6cb1fc6207152b24c8c813ffe30c886 | takeoutweight/clojure-scheme | keyword_other.cljs | (ns cljs.keyword-other)
(defn foo [a b]
(+ a b))
| null | https://raw.githubusercontent.com/takeoutweight/clojure-scheme/6121de1690a6a52c7dbbe7fa722aaf3ddd4920dd/test/cljs/cljs/keyword_other.cljs | clojure | (ns cljs.keyword-other)
(defn foo [a b]
(+ a b))
| |
9da2fbb6dbd4a9f577de5620a209c82aec202a343bbb95d1c479180c9c80ed51 | buildsome/buildsome | ScanFileUpwards.hs | module Lib.ScanFileUpwards (scanFileUpwards) where
import Control.Monad (when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except
import Data.Foldable (traverse_)
import Lib.FilePath (FilePath, (</>))
import qualified Lib.FilePath as FilePath
impo... | null | https://raw.githubusercontent.com/buildsome/buildsome/479b92bb74a474a5f0c3292b79202cc850bd8653/src/Lib/ScanFileUpwards.hs | haskell | NOTE: Excludes root (which is probably fine)
Use EitherT with Left short-circuiting when found, and Right
falling through to the end of the loop: | module Lib.ScanFileUpwards (scanFileUpwards) where
import Control.Monad (when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except
import Data.Foldable (traverse_)
import Lib.FilePath (FilePath, (</>))
import qualified Lib.FilePath as FilePath
impo... |
cdd3ebc63ae30e3f41b288c497864dd83b91a089c429d67acd300d7c64e01a10 | shentufoundation/deepsea | Integers.ml | open BinInt
open BinNums
open BinPos
open Coqlib
open Datatypes
open List0
open Specif
open Zpower
type comparison =
| Ceq
| Cne
| Clt
| Cle
| Cgt
| Cge
module type WORDSIZE =
sig
val wordsize : nat
end
module Make =
functor (WS:WORDSIZE) ->
struct
* val wordsize : *
let wordsize =
WS.wordsize
(** v... | null | https://raw.githubusercontent.com/shentufoundation/deepsea/970576a97c8992655ed2f173f576502d73b827e1/src/backend/extraction/Integers.ml | ocaml | * val zwordsize : coq_Z *
* val modulus : coq_Z *
* val max_unsigned : coq_Z *
* val max_signed : coq_Z *
* val min_signed : coq_Z *
singleton inductive, whose constructor was mkint
* val coq_P_mod_two_p : positive -> nat -> coq_Z *
* val coq_Z_mod_modulus : coq_Z -> coq_Z *
* val one : int *
* val mone : int *
* val... | open BinInt
open BinNums
open BinPos
open Coqlib
open Datatypes
open List0
open Specif
open Zpower
type comparison =
| Ceq
| Cne
| Clt
| Cle
| Cgt
| Cge
module type WORDSIZE =
sig
val wordsize : nat
end
module Make =
functor (WS:WORDSIZE) ->
struct
* val wordsize : *
let wordsize =
WS.wordsize
let ... |
7b48aa804201b2276a8b19a79144ea831c5a46895cacb26bb785d201ff2a3ec6 | johnwhitington/ocamli | example03.ml | let rec take n l =
if n = 0 then [] else
match l with
h::t -> h :: take (n - 1) t
let rec drop n l =
if n = 0 then l else
match l with
h::t -> drop (n - 1) t
let rec length x =
match x with
[] -> 0
| _::t -> 1 + length t
let rec merge x y =
match x, y with
[], l... | null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/OCaml%20from%20the%20Very%20Beginning/Chapter%205/example03.ml | ocaml | let rec take n l =
if n = 0 then [] else
match l with
h::t -> h :: take (n - 1) t
let rec drop n l =
if n = 0 then l else
match l with
h::t -> drop (n - 1) t
let rec length x =
match x with
[] -> 0
| _::t -> 1 + length t
let rec merge x y =
match x, y with
[], l... | |
f1bee4da49189d50af94075cb64916d7bd0e6c37eda45a461748cd8c0c8641f4 | cyverse-archive/DiscoveryEnvironmentBackend | thread_context.clj | (ns service-logging.thread-context
(:import [org.slf4j MDC]))
(defn set-context!
"set-context! puts the data from the context-map into the current thread's
context."
[context-map]
(if (map? context-map)
(doall (map (fn [[k# v#]] (MDC/put (name k#) (str v#))) context-map))))
(defn clear-context!
"clear... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/libs/service-logging/src/service_logging/thread_context.clj | clojure | With thanks to -example-logback-integration/ | (ns service-logging.thread-context
(:import [org.slf4j MDC]))
(defn set-context!
"set-context! puts the data from the context-map into the current thread's
context."
[context-map]
(if (map? context-map)
(doall (map (fn [[k# v#]] (MDC/put (name k#) (str v#))) context-map))))
(defn clear-context!
"clear... |
45c6f01e5e8601f2f5b848d02acb8ee07e4f6496b780460e343640c6d94250a3 | boris-ci/boris | Arbitrary.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module Test.Boris.Queue.Arbitrary where
import Boris.Core.Data
import Boris.Queue
import P
import Test.Boris.Core.Arbitrary ()
import Test.Q... | null | https://raw.githubusercontent.com/boris-ci/boris/c321187490afc889bf281442ac4ef9398b77b200/boris-queue/test/Test/Boris/Queue/Arbitrary.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Boris.Queue.Arbitrary where
import Boris.Core.Data
import Boris.Queue
import P
import Test.Boris.Core.Arbitrary ()
import Test.QuickCheck
import Test.QuickCheck.Instances ()
... |
efdcd0e2ce669498764d4c846dee653f5f485ee9b2b979cbf370052fdafb9fb6 | vernemq/vernemq | vmq_storage_engine_leveldb.erl | Copyright 2019 Octavo Labs AG Zurich Switzerland ( )
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing... | null | https://raw.githubusercontent.com/vernemq/vernemq/eb1a262035af47e90d9edf07f36c1b1503557c1f/apps/vmq_generic_msg_store/src/engines/vmq_storage_engine_leveldb.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2019 Octavo Labs AG Zurich Switzerland ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vmq_storage_engine_leveldb).
-export([open/2, close/1, write/2, read/2, fold/3, fold/4]).
-record(state, {
... |
c3c8fe0d3667fec8d58c56c1b1efd9c328a3348f45589440d291e815fc9c5efe | sebashack/servantRestfulAPI | API.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOper... | null | https://raw.githubusercontent.com/sebashack/servantRestfulAPI/e625535d196acefaff4f5bf03108816be668fe4d/libs/Domains/BookingDomain/Reservation/API.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
| # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE ScopedTypeVariables #
module Domains.BookingDomain.Reservation.API
(
ReservationAPI
) where
import Domai... |
298f123909b5fe9b18a8805d4aa1aa2ff67d98954066d72b30328eb2d9244710 | well-typed/visualize-cbn | Main.hs | module Main (main) where
import Control.Monad
import CBN.Options
import CBN.Parser
import CBN.Trace
import CBN.Trace.HeapGraph as Trace.HeapGraph
import CBN.Trace.JavaScript as Trace.JavaScript
import CBN.Trace.Textual as Trace.Textual
import CBN.Trace.Graph as Trace.Graph
main :: IO ()
main = do
Opti... | null | https://raw.githubusercontent.com/well-typed/visualize-cbn/499a8bc806ce03ce6d1bc12df1ea6e6df7768817/src/Main.hs | haskell | module Main (main) where
import Control.Monad
import CBN.Options
import CBN.Parser
import CBN.Trace
import CBN.Trace.HeapGraph as Trace.HeapGraph
import CBN.Trace.JavaScript as Trace.JavaScript
import CBN.Trace.Textual as Trace.Textual
import CBN.Trace.Graph as Trace.Graph
main :: IO ()
main = do
Opti... | |
9b9bedf2002d7062a6d9d56523fe470bd0a14d12c30500d655dc5bf730681b17 | byteally/dbrecord | Types.hs | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE TypeFamilies , DataKinds , DeriveGeneric , FlexibleInstances , FlexibleContexts , ScopedTypeVariables , DeriveFunctor , GeneralizedNewtypeDeriving , MultiParamTypeClasses , UndecidableInstances #
module DBRecord.MSSQL.Internal.Types where
import qualified DBRecord.Internal.Typ... | null | https://raw.githubusercontent.com/byteally/dbrecord/991efe9a293532ee9242b3e9a26434cf16f5b2a0/dbrecord-mssql-odbc/src/DBRecord/MSSQL/Internal/Types.hs | haskell | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE TypeFamilies , DataKinds , DeriveGeneric , FlexibleInstances , FlexibleContexts , ScopedTypeVariables , DeriveFunctor , GeneralizedNewtypeDeriving , MultiParamTypeClasses , UndecidableInstances #
module DBRecord.MSSQL.Internal.Types where
import qualified DBRecord.Internal.Typ... | |
8c388936c28b7f4ada40050b6fa14a7e6a37d0b77fe6736719aa7faeb94275f6 | KaroshiBee/weevil | dap_raise_error_response_tests.ml | include Utilities.Testing_utils
module Js = Data_encoding.Json
module Res = Dap.Response
module Ev = Dap.Event
module TestState = Dap_state.T ()
module Raise_error =
Dap_handlers.Raise_error.Make
(struct
type enum = Dap_commands.error
type contents = Dap.Data.ErrorResponse_body.t
type presen... | null | https://raw.githubusercontent.com/KaroshiBee/weevil/1b166ba053062498c1ec05c885e04fba4ae7d831/lib/dapper/tests/dap_expect_tests/dap_raise_error_response_tests.ml | ocaml | include Utilities.Testing_utils
module Js = Data_encoding.Json
module Res = Dap.Response
module Ev = Dap.Event
module TestState = Dap_state.T ()
module Raise_error =
Dap_handlers.Raise_error.Make
(struct
type enum = Dap_commands.error
type contents = Dap.Data.ErrorResponse_body.t
type presen... | |
96f4ffdbbde3b5f941b2c3e458f66a6471f9fcac7997f05b61202f69294cd2d6 | erlang/erlide_kernel | erlide_tools_app.erl | -module(erlide_tools_app).
-export([
init/0
]).
init() ->
io:format("Start tools app~n"),
ok.
| null | https://raw.githubusercontent.com/erlang/erlide_kernel/763a7fe47213f374b59862fd5a17d5dcc2811c7b/common/apps/erlide_tools/src/erlide_tools_app.erl | erlang | -module(erlide_tools_app).
-export([
init/0
]).
init() ->
io:format("Start tools app~n"),
ok.
| |
966cd5fff72f94f949c428756ab347b8836a2c094aafbe78fe72efca6b4f0169 | TerrorJack/ghc-alter | num005.hs | -- Exercising Numeric.readSigned a bit
--
module Main(main) where
import Numeric
main =
let
ls = ["3489348394032498320438240938403","0","-1","1","34323","2L","012","0x23","3243ab"]
present str f ls =
sequence (map (\ v -> putStr ('\n':str ++
' ': v ++
... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/tests/Numeric/num005.hs | haskell | Exercising Numeric.readSigned a bit
| module Main(main) where
import Numeric
main =
let
ls = ["3489348394032498320438240938403","0","-1","1","34323","2L","012","0x23","3243ab"]
present str f ls =
sequence (map (\ v -> putStr ('\n':str ++
' ': v ++
" = " ++
... |
9ed3d32b66abe88f6720e93908097d7e7f643338cf195ddae9bcc24bf1c2c612 | onaio/hatti | macros.clj | (ns hatti.macros)
(defmacro read-file
"Takes a filename, and returns contents as string, at compile time. Used for
ClojureScript tests to read fixtures."
[filename]
(slurp filename))
| null | https://raw.githubusercontent.com/onaio/hatti/7dc23c1c60b9fc46e1ff5b023eb6c794ebd04773/test/hatti/macros.clj | clojure | (ns hatti.macros)
(defmacro read-file
"Takes a filename, and returns contents as string, at compile time. Used for
ClojureScript tests to read fixtures."
[filename]
(slurp filename))
| |
775f2494f1bc17a5aa2ee54ba276ebc657963b74e49f8ff4820016c75f57a634 | bgusach/exercises-htdp2e | ex-184.rkt | #lang htdp/bsl+
(require test-engine/racket-tests)
(check-expect
(list (string=? "a" "b") #false)
(list #false #false)
)
(check-expect
(list (+ 10 20) (* 10 20) (/ 10 20))
(list 30 200 1/2)
)
(check-expect
(list "dana" "jane" "mary" "laura")
; ...??
(list "dana" "jane" "mary" "laura")
)
(te... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/2-arbitrarily-large-data/ex-184.rkt | racket | ...?? | #lang htdp/bsl+
(require test-engine/racket-tests)
(check-expect
(list (string=? "a" "b") #false)
(list #false #false)
)
(check-expect
(list (+ 10 20) (* 10 20) (/ 10 20))
(list 30 200 1/2)
)
(check-expect
(list "dana" "jane" "mary" "laura")
(list "dana" "jane" "mary" "laura")
)
(test)
|
e91082178ab2282dc8b7771bb2543993a1712294572734453690108feaa17aa8 | pharaun/hsnsq | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : Network .
Description : Protocol Parser layer for the NSQ client library .
Module : Network.NSQ.Parser
Description : Protocol Parser layer for the NSQ client library.
-}
module Network.NSQ.Parser
( message
, decode
, encode
) where
import ... | null | https://raw.githubusercontent.com/pharaun/hsnsq/f0072e40382e3669a4ffae37354d9947077ccbd2/src/Network/NSQ/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
| Decode the 'ByteString' to an 'Message'
| Convert various nsq messages into useful 'Message' types
TODO: Better FrameType
TODO: do sanity check such as checking that the size is of a minimal
size, then parsing the frameType, then the remainder (fail "messg")
| Parse the low level ... | |
Module : Network .
Description : Protocol Parser layer for the NSQ client library .
Module : Network.NSQ.Parser
Description : Protocol Parser layer for the NSQ client library.
-}
module Network.NSQ.Parser
( message
, decode
, encode
) where
import Data.Word
import Data.Monoid
import... |
82d44034f2d605dba3ca3bc96eb95182ad56f3dd27411c0aaa25ad71860fc322 | callum-oakley/advent-of-code | 02.clj | (ns aoc.2021.02
(:require
[clojure.test :refer [deftest is]]))
(defn parse [s]
(->> s (re-seq #"\w+") (map read-string) (partition 2)))
This covers parts 1 and 2 : for part-1 treat aim as depth and ignore dep
(defn dive [commands]
(reduce (fn [[hor aim dep] [op x]]
(case op
forwar... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/3cf44bcb8c57693639630f95f29d4abf49a6f0e4/src/aoc/2021/02.clj | clojure | (ns aoc.2021.02
(:require
[clojure.test :refer [deftest is]]))
(defn parse [s]
(->> s (re-seq #"\w+") (map read-string) (partition 2)))
This covers parts 1 and 2 : for part-1 treat aim as depth and ignore dep
(defn dive [commands]
(reduce (fn [[hor aim dep] [op x]]
(case op
forwar... | |
f64398714b56b83e2476bc9e08c460d9f551b2b5ccbbdffd0c594fb3d02d09a1 | mhuebert/maria | animation_quickstart.cljs | (ns maria.curriculum.animation-quickstart
{:description "Get a running start at making basic animations using the Shapes library."}
(:require [cells.api :refer :all]
[shapes.core :refer :all]))
;; # Animations Quick-Start
;; This is a quick-start guide for drawing animations. The goal of this document... | null | https://raw.githubusercontent.com/mhuebert/maria/9fc2e26ed7df16e82841e0127a56ae36fafa4e63/editor2/src/main/maria/curriculum/animation_quickstart.cljs | clojure | # Animations Quick-Start
This is a quick-start guide for drawing animations. The goal of this document is to equip you with templates to give you a running start at making basic animations. From there you can do many fun and complex things.
For a full explanation of how the techniques in this guide work, see the [Ce... | (ns maria.curriculum.animation-quickstart
{:description "Get a running start at making basic animations using the Shapes library."}
(:require [cells.api :refer :all]
[shapes.core :refer :all]))
# # # ` cell ` and ` interval `
We use ` interval ` inside a ` cell ` to make animations that repeat... |
10ca3f2f6336f87bd87e665467ad90fbdf5d3d29e5ba8cb7fbb787d2d48d3f8b | erlangonrails/devdb | reloader.erl | 2007 Mochi Media , Inc.
@author < >
%%
@doc Erlang module for automatically reloading modified modules
%% during development.
-module(reloader).
-author("Matthew Dempsky <>").
-include_lib("kernel/include/file.hrl").
-behaviour(gen_server).
-export([start/0, start_link/0]).
-export([stop/0]).
-export([init... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak-0.11.0/deps/mochiweb/src/reloader.erl | erlang |
during development.
External API
@doc Start the reloader.
@doc Start the reloader.
@doc Stop the reloader.
gen_server callbacks
@doc gen_server init, opens the server in an initial state.
@doc gen_server callback.
@doc gen_server callback.
@doc gen_server callback.
@doc gen_server termination callback.
@do... | 2007 Mochi Media , Inc.
@author < >
@doc Erlang module for automatically reloading modified modules
-module(reloader).
-author("Matthew Dempsky <>").
-include_lib("kernel/include/file.hrl").
-behaviour(gen_server).
-export([start/0, start_link/0]).
-export([stop/0]).
-export([init/1, handle_call/3, handle_... |
73fdb7b3131b9f98cd50ae83c5b47e09b5a841d50a77542be53b5a3f5c721b29 | zeromq/chumak | chumak_protocol.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%% @doc Parser of ZeroMQ protocol
%%
This module was created to make responsibility of decode and make a buffer of ZeroMQ wire protocol ,
%% ... | null | https://raw.githubusercontent.com/zeromq/chumak/e705fa6db05dc3f4801f5cc71eb18b0e60f7ba35/src/chumak_protocol.erl | erlang | @doc Parser of ZeroMQ protocol
the client of this module needs to announce that more bytes were been received by peer.
the state of decoder
number of the major version
number of the minor version
the structure responsible to decode incoming bytes
the state of decoder
the bytes received or sent
decode fail re... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
This module was created to make responsibility of decode and make a buffer of ZeroMQ wire protocol ,
-module(chumak_protocol).
-include("chu... |
5801e49d62d2156bd5eca75c53fc14468acec0ab357bc4ea1b532f46e0d85b40 | district0x/cljs-ipfs-http-client | pubsub.cljs | (ns cljs-ipfs-api.pubsub
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[pubsub.subscribe [topic options handler callback]]
[pubsub.unsubscribe [topic handler]]
[pubsub.publish [topic data ca... | null | https://raw.githubusercontent.com/district0x/cljs-ipfs-http-client/2352396430fb1ca179054845b956184c871ceedd/src/cljs_ipfs_api/pubsub.cljs | clojure | (ns cljs-ipfs-api.pubsub
(:require [cljs-ipfs-api.core :refer-macros [defsignatures]]
[cljs-ipfs-api.utils :refer [wrap-callback api-call js->cljkk cljkk->js]]))
(defsignatures
[[pubsub.subscribe [topic options handler callback]]
[pubsub.unsubscribe [topic handler]]
[pubsub.publish [topic data ca... | |
a92ddbf3cd51dda3ed8b9582c400e492439f7b8aa517d124fc5444d7b280cd3c | maitria/avi | normal.clj | (ns avi.mode.normal
(:require [packthread.core :refer :all]
[avi.beep :as beep]
[avi.brackets :as brackets]
[avi.edit-context :as ec]
[avi.editor :as e]
[avi.events :as ev]
[avi.layout.panes :as p]
[avi.mode command-line insert]
[a... | null | https://raw.githubusercontent.com/maitria/avi/c641e9e32af4300ea7273a41e86b4f47d0f2c092/src/avi/mode/normal.clj | clojure | It's not the "0" motion if we have a count (it's
part of the count). | (ns avi.mode.normal
(:require [packthread.core :refer :all]
[avi.beep :as beep]
[avi.brackets :as brackets]
[avi.edit-context :as ec]
[avi.editor :as e]
[avi.events :as ev]
[avi.layout.panes :as p]
[avi.mode command-line insert]
[a... |
e429f6cb142618f8e70ee288894bc0b263898409358efae2d588e219c100797e | javalib-team/sawja | jPrintPlugin.ml |
* This file is part of SAWJA
* Copyright ( c)2011 ( INRIA )
*
* 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 3 of
* the License , or ( at your option ) a... | null | https://raw.githubusercontent.com/javalib-team/sawja/da39f9c1c4fc52a1a1a6350be0e39789812b6c00/src/jPrintPlugin.ml | ocaml | Tags and attributes
* It could be a variable identifier, field name, class name,
etc. Only use the shortest name possible (no package name
before class name, no class name before a field name, etc.).
| NullLiteral
| StringLiteral of string
| TypeLiteral of identifier
| OtherLiteral of float
Ot... |
* This file is part of SAWJA
* Copyright ( c)2011 ( INRIA )
*
* 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 3 of
* the License , or ( at your option ) a... |
a511b19f3ff17f60412632b82652308895200de76428fde28357863843c3224f | roburio/dnsvizor | unikernel.ml | module Main (R : Mirage_random.S) (P : Mirage_clock.PCLOCK)
(M : Mirage_clock.MCLOCK)
(Time : Mirage_time.S) (S : Tcpip.Stack.V4V6) = struct
module Stub = Dns_stub_mirage.Make(R)(Time)(P)(M)(S)
let start () () () () s =
let stub_t =
let nameservers =
Option.map (fun ns -> [ ns ]) (Key_ge... | null | https://raw.githubusercontent.com/roburio/dnsvizor/6c31f0adaad69c3342affcd836b44e0a5746db5f/dns-only/unikernel.ml | ocaml | setup stub forwarding state and IP listeners: | module Main (R : Mirage_random.S) (P : Mirage_clock.PCLOCK)
(M : Mirage_clock.MCLOCK)
(Time : Mirage_time.S) (S : Tcpip.Stack.V4V6) = struct
module Stub = Dns_stub_mirage.Make(R)(Time)(P)(M)(S)
let start () () () () s =
let stub_t =
let nameservers =
Option.map (fun ns -> [ ns ]) (Key_ge... |
268c918069b35b8ac1464727f80679cd20b1b71eef1eb015306e1069d0cc5757 | tolitius/grete | streams.clj | (ns grete.streams
(:require [clojure.string :as s]
[grete.tools :as t]
[jsonista.core :as json])
(:import [clojure.lang Reflector]
[java.util Properties]
[org.apache.kafka.common.serialization Serde
Serdes]
[o... | null | https://raw.githubusercontent.com/tolitius/grete/b76c308060fad1e4eac252e0e89eb98852d4adec/src/grete/streams.clj | clojure | config
:client-id-config "augment-plan-snooper"
:bootstrap-servers-config "localhost:9092"
:default-key-serde-class-config (-> (k/string-serde) .getClass .getName)
:default-value-serde-class-config (-> (k/string-serde) .getClass .getName)
core
serializers / deserializers
directing flow
->fn kafka stream wr... | (ns grete.streams
(:require [clojure.string :as s]
[grete.tools :as t]
[jsonista.core :as json])
(:import [clojure.lang Reflector]
[java.util Properties]
[org.apache.kafka.common.serialization Serde
Serdes]
[o... |
35eaf052f4a06b7254f7b7c0af00b5495f687bdc2db7c5afac203654d4791d47 | jafingerhut/thalia | doc.clj | (ns thalia.doc
(:require [clojure.pprint :as pp]
[clojure.java.io :as io]
[clojure.set :as set]
[thalia.utils :refer [iprintf read-safely]]))
(defn- append-doc! [v additional-docstring]
(let [m (meta v)
;; Save the original doc string if we have not done so earlier
... | null | https://raw.githubusercontent.com/jafingerhut/thalia/20c98eec8168ff72c5b3965cc048b817d34a4583/src/thalia/doc.clj | clojure | Save the original doc string if we have not done so earlier
TBD: Find somewhere appropriate to describe the behavior of
keywords looking themselves up in collections via (:keyword coll)
syntax.
TBD: Is there a 'standard' way to check for libraries other
than clojure.core what version is loaded? | (ns thalia.doc
(:require [clojure.pprint :as pp]
[clojure.java.io :as io]
[clojure.set :as set]
[thalia.utils :refer [iprintf read-safely]]))
(defn- append-doc! [v additional-docstring]
(let [m (meta v)
m (if (contains? m :thalia/original-doc)
m
... |
7644aebcebe196b5e6f06168c323b37fdfcfe582d7b3cf6cea02815aa543c0c2 | weavejester/lein-auto | project.clj | (defproject lein-auto "0.1.3"
:description "Leiningen plugin that executes tasks when files are modified"
:url "-auto"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[hawk "0.2.11"]
[medley "1.0.0"]])
| null | https://raw.githubusercontent.com/weavejester/lein-auto/218ddef2894b42ad91434350fac38652a7d35e13/project.clj | clojure | (defproject lein-auto "0.1.3"
:description "Leiningen plugin that executes tasks when files are modified"
:url "-auto"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[hawk "0.2.11"]
[medley "1.0.0"]])
| |
f9d2870d1466475737eb0282f6121cbe0c322f58f063f1f46402d38e8bbc7f9d | rjray/advent-2020-clojure | day25.clj | (ns advent-of-code.day25
(:require [clojure.string :as str]))
(defn- get-input [func input]
(->> input
str/split-lines
func))
(defn- parse-data [lines]
[(read-string (first lines)) (read-string (last lines))])
(defn- iteration [value subjnum]
(rem (* value subjnum) 20201227))
(defn- find-loops... | null | https://raw.githubusercontent.com/rjray/advent-2020-clojure/631b36545ae1efdebd11ca3dd4dca032346e8601/src/advent_of_code/day25.clj | clojure | (ns advent-of-code.day25
(:require [clojure.string :as str]))
(defn- get-input [func input]
(->> input
str/split-lines
func))
(defn- parse-data [lines]
[(read-string (first lines)) (read-string (last lines))])
(defn- iteration [value subjnum]
(rem (* value subjnum) 20201227))
(defn- find-loops... | |
f6e6c83086eab414e450f773160f1c215cc0033e2b69e4f746c9ef730a6df3a6 | langston-barrett/CoverTranslator | Newtype.hs | Test for Core2Agda
module Newtype where
newtype L a = L [a] -- produces currently a "typeOfBind" error
data LL a = LL [ a ] -- this works
| null | https://raw.githubusercontent.com/langston-barrett/CoverTranslator/4172bef9f4eede7e45dc002a70bf8c6dd9a56b5c/src/test/Newtype.hs | haskell | produces currently a "typeOfBind" error
this works | Test for Core2Agda
module Newtype where
|
ad6419b6ef66aef066584b7f3ea8739a548c07a22c1aa476b65f3d0a7c44af59 | 8c6794b6/guile-tjit | message.scm | ;;; User interface messages
Copyright ( C ) 2009 , 2010 , 2011 , 2012 Free Software Foundation , Inc.
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the Li... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/system/base/message.scm | scheme | User interface messages
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library 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 ... |
Copyright ( C ) 2009 , 2010 , 2011 , 2012 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(define-module (system base ... |
2a12d4fc555c152052c5fa53eb76e7b0caca0f676f15064c6cff95854d9353c5 | carotene/carotene | carotene_broker_sup.erl | -module(carotene_broker_sup).
-behaviour(supervisor).
%% API
-export([start_link/0, get_broker/0]).
%% Supervisor callbacks
-export([init/1]).
%% ===================================================================
%% API functions
%% ===================================================================
start_link() ... | null | https://raw.githubusercontent.com/carotene/carotene/963ecad344ec1c318c173ad828a5af3c000ddbfc/src/carotene_broker_sup.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
================================================... | -module(carotene_broker_sup).
-behaviour(supervisor).
-export([start_link/0, get_broker/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
case read_broker_config() of
undefined -> {ok, { {one_for_one, 5, 10}, []}};
BrokerModule -> {o... |
4f921b697a223e394aa4ffe521013d0d15b9dafeaf8b4ac7fb0da54db7357818 | coord-e/mlml | bytes.ml | external of_string : string -> bytes = "_mlml_shallow_copy"
external to_string : bytes -> string = "_mlml_shallow_copy"
external copy : bytes -> bytes = "_mlml_shallow_copy"
external create : int -> bytes = "_mlml_create_string"
external length : bytes -> int = "_mlml_length_string"
external _get : bytes * int -> char ... | null | https://raw.githubusercontent.com/coord-e/mlml/ec34b1fe8766901fab6842b790267f32b77a2861/stdlib/bytes.ml | ocaml | external of_string : string -> bytes = "_mlml_shallow_copy"
external to_string : bytes -> string = "_mlml_shallow_copy"
external copy : bytes -> bytes = "_mlml_shallow_copy"
external create : int -> bytes = "_mlml_create_string"
external length : bytes -> int = "_mlml_length_string"
external _get : bytes * int -> char ... | |
2e8b6b3e62ee1b470e77a9c0112d96de8fb64751cd79badc8fc84feee0533b21 | ndmitchell/catch | Main.hs |
module Main where
import Yhc.Core
import System.FilePath hiding (normalise)
import System.Environment
import System.Directory
import System.IO
import Data.Proposition
import Control.Monad
import Prepare
import Propagate
import Req
import Backward
import Template
main = do
xs <- getArgs
mapM_ exec xs
... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/inspect/Main.hs | haskell |
module Main where
import Yhc.Core
import System.FilePath hiding (normalise)
import System.Environment
import System.Directory
import System.IO
import Data.Proposition
import Control.Monad
import Prepare
import Propagate
import Req
import Backward
import Template
main = do
xs <- getArgs
mapM_ exec xs
... | |
748d865631c272aadb041a0264f71452d8913db1172cd081f3990d4360bf8604 | CoNarrative/precept | rules_debug.cljc | (ns precept.rules-debug
#?(:cljs (:require-macros [precept.dsl :refer [<- entity]]))
(:require [clara.rules.accumulators :as acc]
[clara.rules :as cr]
[precept.core :as core]
[precept.spec.sub :as sub]
[precept.spec.rulegen :as rulegen]
[prec... | null | https://raw.githubusercontent.com/CoNarrative/precept/6078286cae641b924a2bffca4ecba19dcc304dde/test/cljc/precept/rules_debug.cljc | clojure | (declare app-session)
@state/rules
(core/matching-consequences
(reset! state/rules {})
(rule check-conflicting-insert-logical
[?fact <- [?e :entry/title]]
=>
(println "This should produce a conflict" (into [] (vals ?fact)))
(rule check-conflicting-insert-unconditional-on-top-of-insert-logical
[?fact <- [?e :en... | (ns precept.rules-debug
#?(:cljs (:require-macros [precept.dsl :refer [<- entity]]))
(:require [clara.rules.accumulators :as acc]
[clara.rules :as cr]
[precept.core :as core]
[precept.spec.sub :as sub]
[precept.spec.rulegen :as rulegen]
[prec... |
d831b0f08b18c01b6ef2f9cbc3140ff362134ac1a912fc88e13df72fd0748f24 | tmfg/mmtis-national-access-point | service_type.cljs | (ns ote.views.transport-service.service-type
"Select type for transport service"
(:require [cljs-react-material-ui.reagent :as ui]
[cljs-react-material-ui.icons :as ic]
[reagent.core :as r]
[ote.db.transport-service :as t-service]
[ote.db.transport-operator :as t-oper... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/src/cljs/ote/views/transport_service/service_type.cljs | clojure | Create order for service type selection dropdown | (ns ote.views.transport-service.service-type
"Select type for transport service"
(:require [cljs-react-material-ui.reagent :as ui]
[cljs-react-material-ui.icons :as ic]
[reagent.core :as r]
[ote.db.transport-service :as t-service]
[ote.db.transport-operator :as t-oper... |
830b660c339ad6cd0c18b64e2d0e096dce6c5b48b9f32bc65bc60c1c0d724563 | lijunsong/pollen-rock | watch-handler.rkt | #lang racket
(require json)
(require web-server/http/request-structs)
(require "../http-util.rkt")
(require "../logger.rkt")
(require "fs-watch.rkt")
(provide watch-handler do-watch)
;;;; POST /watch/$path
(define/contract (watch-answer errno mtime)
(-> integer? integer? jsexpr?)
;; make mutable hash because fs ... | null | https://raw.githubusercontent.com/lijunsong/pollen-rock/8107c7c1a1ca1e5ab125650f38002683b15b22c9/pollen-rock/handlers/watch-handler.rkt | racket | POST /watch/$path
make mutable hash because fs evt needs to mutate the hash table
in callback function.
Http long polling issue may have impact.
when the file is changed, update and return this ans.
test watch-handler | #lang racket
(require json)
(require web-server/http/request-structs)
(require "../http-util.rkt")
(require "../logger.rkt")
(require "fs-watch.rkt")
(provide watch-handler do-watch)
(define/contract (watch-answer errno mtime)
(-> integer? integer? jsexpr?)
(make-hash `((errno . ,errno)
(mtime . ,... |
9e9c656cc133db31fee5c496526bd95f0b3930fa32c8650279c115c7c2320c51 | erlang/otp | shell.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2023 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/stdlib/src/shell.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2023 . 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(shell).
-export([start/0, start/1, start/2, server/1, server/2, history/1, results/1]).
-export([get_state/0... |
747562a3b26fde3504f97a0d2a1600f14e189e103c8f53429eccc583d9ab79f1 | dinosaure/bob | stream.ml | Copyright ( c ) 2020 >
Copyright ( c ) 2022 < >
Permission to use , copy , modify , and distribute this software for any
purpose with or without fee is hereby granted , provided that the above
copyright notice and this permission notice appear in all copies .
THE SOFTWARE IS PROVIDED... | null | https://raw.githubusercontent.com/dinosaure/bob/210dce2f3f7bfe1b15472a7d09544b4afbac8ca6/lib/stream.ml | ocaml | Composition
Basics
Input & Output | Copyright ( c ) 2020 >
Copyright ( c ) 2022 < >
Permission to use , copy , modify , and distribute this software for any
purpose with or without fee is hereby granted , provided that the above
copyright notice and this permission notice appear in all copies .
THE SOFTWARE IS PROVIDED... |
56f3097b13b4a1ac3311c15187b32959a2d1d97e9d9b880f1f31363a1de7ce16 | mistupv/cauder | purchase.erl | FASE 2014 example
-module(purchase).
-export([main/0, asynchAnd/2, checkCredit/2, checkAddress/1, checkItem/1]).
main() ->
Pid = spawn(?MODULE, asynchAnd, [2, self()]),
spawn(?MODULE, checkCredit, [15, Pid]),
spawn(?MODULE, checkAddress, [Pid]),
spawn(?MODULE, checkItem, [Pid]),
receive
tr... | null | https://raw.githubusercontent.com/mistupv/cauder/ff4955cca4b0aa6ae9d682e9f0532be188a5cc16/case-studies/purchase/purchase.erl | erlang | FASE 2014 example
-module(purchase).
-export([main/0, asynchAnd/2, checkCredit/2, checkAddress/1, checkItem/1]).
main() ->
Pid = spawn(?MODULE, asynchAnd, [2, self()]),
spawn(?MODULE, checkCredit, [15, Pid]),
spawn(?MODULE, checkAddress, [Pid]),
spawn(?MODULE, checkItem, [Pid]),
receive
tr... | |
4e4620855368aac32f022ca5ad73fd764ddc18dec314ca4f7ce3b02e970335b3 | derbear/steal | periodicpayment.rkt | #lang racket
(provide periodicpayment)
(provide periodicpayment-doc)
(provide periodicpayment-escrow)
(provide periodicpayment-escrow-doc)
(define periodicpayment-core
'(and (= (txn TypeEnum) 1)
(< (txn Fee) (int TMPL_FEE))
(= (% (txn FirstValid) (int TMPL_PERIOD)) 0)
(= (txn LastValid) (+ (... | null | https://raw.githubusercontent.com/derbear/steal/afd746a574728dd04c76a5538449caa6f6876d99/examples/periodicpayment.rkt | racket | #lang racket
(provide periodicpayment)
(provide periodicpayment-doc)
(provide periodicpayment-escrow)
(provide periodicpayment-escrow-doc)
(define periodicpayment-core
'(and (= (txn TypeEnum) 1)
(< (txn Fee) (int TMPL_FEE))
(= (% (txn FirstValid) (int TMPL_PERIOD)) 0)
(= (txn LastValid) (+ (... | |
d1a14eca834decc711d1d5ee01395fadd8b99bf7431009eba313e87d5e584749 | lambdaisland/kaocha | core_ext.clj | (ns kaocha.core-ext
"Core language extensions"
(:require [kaocha.platform :as platform])
(:refer-clojure :exclude [symbol])
(:import (java.util.regex Pattern)))
(defn regex? [x]
(instance? Pattern x))
(defn exception? [x]
(instance? java.lang.Exception x))
(defn error? [x]
(instance? java.lang.Error x)... | null | https://raw.githubusercontent.com/lambdaisland/kaocha/9ac9406e4a2ab8c5dc3a0edb84038d277818de37/src/kaocha/core_ext.clj | clojure | (ns kaocha.core-ext
"Core language extensions"
(:require [kaocha.platform :as platform])
(:refer-clojure :exclude [symbol])
(:import (java.util.regex Pattern)))
(defn regex? [x]
(instance? Pattern x))
(defn exception? [x]
(instance? java.lang.Exception x))
(defn error? [x]
(instance? java.lang.Error x)... | |
e72fefb36816527dce68b99471907c4af382193b3c3cfafc04cf5ce0742e6c7e | SimulaVR/godot-haskell | AnimationNodeTimeSeek.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.AnimationNodeTimeSeek () where
import Data.Coerce
import Fo... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/AnimationNodeTimeSeek.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.AnimationNodeTimeSeek () where
import Data.Coerce
import Fo... | |
8b4ddea249bb2048cb00802bf31909e2b0778f70d1774e365eb8e79cc9e226d3 | avsm/mirage-duniverse | spawn.mli | (** Mini spawn library *)
(** Note: on Unix, spawn uses vfork by default. It has been tested,
but if you believe this is causing a problem in your application,
you can change this default at runtime by setting the environment
variable [SPAWN_USE_FORK]. *)
module Working_dir : sig
type t =
| Path of ... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/spawn/src/spawn.mli | ocaml | * Mini spawn library
* Note: on Unix, spawn uses vfork by default. It has been tested,
but if you believe this is causing a problem in your application,
you can change this default at runtime by setting the environment
variable [SPAWN_USE_FORK].
* Path in the filesystem
* Inherit the working directory of... |
module Working_dir : sig
type t =
* File descriptor pointing to a directory .
Not supported on Windows .
Not supported on Windows. *)
end
module Unix_backend : sig
type t =
| Fork
| Vfork
val default : t
end
module Env : sig
type t
... |
95f179b0eb7f152000b417eaaac71d624a7f24c96dac763572cf603f49339e87 | SNePS/SNePS2 | wordize.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : ENGLEX ; Base : 10 -*-
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : wordize.lisp , v 1.2 2013/08/28 19:07:24 shapiro Exp $
;; This file is part of SNePS.
$ BEGIN LICENSE$
The contents of this file... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/nlint/englex/wordize.lisp | lisp | Syntax : Common - Lisp ; Package : ENGLEX ; 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 limitation... |
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
Version : $ I d : wordize.lisp , v 1.2 2013/08/28 19:07:24 shapiro Exp $
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " b... |
effbb8330c2c1fa2996c92fff7fa8f4f1a448156d198807cdcadc924273d095e | haskell-compat/base-compat | Batteries.hs | {-# LANGUAGE PackageImports #-}
# OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
| Reexports " Data . Functor . . Compat "
-- from a globally unique namespace.
module Data.Functor.Contravariant.Compat.Repl.Batteries (
module Data.Functor.Contravariant.Compat
) where
import "this" Data.F... | null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Data/Functor/Contravariant/Compat/Repl/Batteries.hs | haskell | # LANGUAGE PackageImports #
from a globally unique namespace. | # OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
| Reexports " Data . Functor . . Compat "
module Data.Functor.Contravariant.Compat.Repl.Batteries (
module Data.Functor.Contravariant.Compat
) where
import "this" Data.Functor.Contravariant.Compat
|
1bf4c0f385f655cc0fb4b8ebefb5347822f5c48841b64b889845c5cd7cb05ab7 | VisionsGlobalEmpowerment/webchange | views.cljs | (ns webchange.ui.components.card.views
(:require
[reagent.core :as r]
[webchange.ui.components.available-values :as available-values]
[webchange.ui.components.button.views :refer [button]]
[webchange.ui.components.card.background :as background]
[webchange.ui.components.icon.views :refer [navigati... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/2b14cfa0b116034312a382763e6aebd67e2f25a7/src/cljs/webchange/ui/components/card/views.cljs | clojure | (ns webchange.ui.components.card.views
(:require
[reagent.core :as r]
[webchange.ui.components.available-values :as available-values]
[webchange.ui.components.button.views :refer [button]]
[webchange.ui.components.card.background :as background]
[webchange.ui.components.icon.views :refer [navigati... | |
bfad479d1d5c3bd127f7574b330d95fd1bda8317aa3af3263f1a1f3939d18118 | adomokos/haskell-katas | Ex42_FaMoreApplicativesSpec.hs | module Ex42_FaMoreApplicativesSpec
( spec
) where
import Control.Applicative
import Test.Hspec
main :: IO ()
main = hspec spec
You can think of functions as boxes , that contain their
eventual result .
Applicative law : pure f < * > x = fmap f x
In conclusion , applicative functors are n... | null | https://raw.githubusercontent.com/adomokos/haskell-katas/be06d23192e6aca4297814455247fc74814ccbf1/test/Ex42_FaMoreApplicativesSpec.hs | haskell | Implement this function
sequenceA' :: (Applicative f) => [f a] -> f [a]
combined <- (___ <$> return "hello" <*> return ___)
newtype ZipList a = ZipList { getZipList :: [a] } | module Ex42_FaMoreApplicativesSpec
( spec
) where
import Control.Applicative
import Test.Hspec
main :: IO ()
main = hspec spec
You can think of functions as boxes , that contain their
eventual result .
Applicative law : pure f < * > x = fmap f x
In conclusion , applicative functors are n... |
697325786c58ff75fb02be4cb74f2d160d025751d2b09ad42e20008db8495002 | ndmitchell/supero | integrate.hs | module Main (integrate1D, main) where
import System
integrate1D :: Double -> Double -> (Double->Double) -> Double
integrate1D l u f =
let d = (u-l)/8.0 in
d * sum
((f l)*0.5 :
f (l+d) :
f (l+(2.0*d)) :
f (l+(3.0*d)) :
f (l+(4.0*d)) :
f (u-(3.0*d)) :
f (u... | null | https://raw.githubusercontent.com/ndmitchell/supero/a8b16ea90862e2c021bb139d7a7e9a83700b43b2/supero3/samples/nofib/integrate.hs | haskell | type signature required for compilers lacking the monomorphism restriction | module Main (integrate1D, main) where
import System
integrate1D :: Double -> Double -> (Double->Double) -> Double
integrate1D l u f =
let d = (u-l)/8.0 in
d * sum
((f l)*0.5 :
f (l+d) :
f (l+(2.0*d)) :
f (l+(3.0*d)) :
f (l+(4.0*d)) :
f (u-(3.0*d)) :
f (u... |
b50077c1bf160ca45b7def952a340decdb1b13b1f3f3bb4f0ca0e5817ec3bf46 | phadej/saison | Result.hs | {-# LANGUAGE RankNTypes #-}
module Saison.Decoding.Result where
-- | /TODO/ I'm not sure this is the type we want.
--
-- Maybe we want bundle input into this, and make this class
" Profunctor - y " .
--
newtype Result e k a = Result
{ unResult :: forall r. (e -> r) -> (a -> k -> r) -> r }
instance Functor (Resu... | null | https://raw.githubusercontent.com/phadej/saison/991d1244b97dadb35adabdf217eb3d5fe2d310fc/src/Saison/Decoding/Result.hs | haskell | # LANGUAGE RankNTypes #
| /TODO/ I'm not sure this is the type we want.
Maybe we want bundle input into this, and make this class
| module Saison.Decoding.Result where
" Profunctor - y " .
newtype Result e k a = Result
{ unResult :: forall r. (e -> r) -> (a -> k -> r) -> r }
instance Functor (Result e k) where
fmap h (Result k) = Result $ \g f -> k g $ \x -> f (h x)
pureResult :: a -> k -> Result e k a
pureResult x k = Result $ \_ f ->... |
6501956a45092e58dda67a07b7671743f96131e4893477c276e086d47db82994 | channable/alfred-margaret | Automaton.hs | -- Alfred-Margaret: Fast Aho-Corasick string searching
Copyright 2019 Channable
--
Licensed under the 3 - clause BSD license , see the LICENSE file in the
-- repository root.
{-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# ... | null | https://raw.githubusercontent.com/channable/alfred-margaret/be96f07bb74c5aa65ce01d664de5d98badbee307/src/Data/Text/BoyerMooreCI/Automaton.hs | haskell | Alfred-Margaret: Fast Aho-Corasick string searching
repository root.
# LANGUAGE BangPatterns #
# LANGUAGE DeriveAnyClass #
-igm.univ-mlv.fr/~lecroq/string/node14.html#SECTION00140
-search_algorithm
This is case insensitive variant of the algorithm which, unlike the case
sensitive variant, has to be aware of the... | Copyright 2019 Channable
Licensed under the 3 - clause BSD license , see the LICENSE file in the
# LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
| An efficient implementation of the Boyer - Moore string search algorithm .
modul... |
e77ce57e3ee13df652dd92c318a7e49ab5e0fa01a97802ed9a367c1ad34d0920 | mirage/mirage-nat | mirage_nat_lru.ml | TODO : types should be more complex and allow for entries mapping
networks and port ranges ( with logic disallowing many : many mappings ) , e.g.
type One = port
type Many = port list
type mapping = [ One * One , One * Many , Many * One ]
Doing this will cause us to need a real parser .
... | null | https://raw.githubusercontent.com/mirage/mirage-nat/ca43415d503b4178135f1df4ecde5e27b5444aa1/lib/mirage_nat_lru.ml | ocaml | cases that should result in a valid mapping:
neither side is already mapped
TODO: this is not quite right if all mappings already exist, because it's possible that
the lookups are part of differing pairs -- this situation is pathological, but possible | TODO : types should be more complex and allow for entries mapping
networks and port ranges ( with logic disallowing many : many mappings ) , e.g.
type One = port
type Many = port list
type mapping = [ One * One , One * Many , Many * One ]
Doing this will cause us to need a real parser .
... |
31d4ff67e4c7deeb0ae6ef885288b0e24ee7ea6532683ca7d3281c94f742ffd5 | CodyReichert/qi | tf-cmucl.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-cmucl.lisp --- CMUCL implementation of trivial-features.
;;;
Copyright ( C ) 2007 ,
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to d... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/trivial-features-latest/src/tf-cmucl.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
tf-cmucl.lisp --- CMUCL implementation of trivial-features.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publ... | Copyright ( C ) 2007 ,
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package :cl-user)
... |
e1461a98b6b48c3b771dc716ad678350a98ca6a24204df868d3313f623879bfb | NorfairKing/smos | Archive.hs | module Smos.Archive (smosArchive) where
import Control.Monad.Logger
import Smos.Archive.Commands
import Smos.Archive.Env
import Smos.Archive.OptParse
smosArchive :: IO ()
smosArchive = do
Instructions dispatch settings <- getInstructions
runStderrLoggingT $
filterLogger (\_ ll -> ll >= setLogLevel settings) $... | null | https://raw.githubusercontent.com/NorfairKing/smos/489f5b510c9a30a3c79fef0a0d1a796464705923/smos-archive/src/Smos/Archive.hs | haskell | module Smos.Archive (smosArchive) where
import Control.Monad.Logger
import Smos.Archive.Commands
import Smos.Archive.Env
import Smos.Archive.OptParse
smosArchive :: IO ()
smosArchive = do
Instructions dispatch settings <- getInstructions
runStderrLoggingT $
filterLogger (\_ ll -> ll >= setLogLevel settings) $... | |
1dbc261669a33a03104301dc320a906fd589047d84295331fc630989fce9a129 | tebeka/popen | project.clj | (defproject popen "0.3.1"
:description "popen (subprocess) library for Clojure"
:url ""
:dependencies [[org.clojure/clojure "1.8.0"]])
| null | https://raw.githubusercontent.com/tebeka/popen/91cc8b16426e2db025c361888a8b9322e37808d9/project.clj | clojure | (defproject popen "0.3.1"
:description "popen (subprocess) library for Clojure"
:url ""
:dependencies [[org.clojure/clojure "1.8.0"]])
| |
7c11df97799b44e6fac5e6fe09130ab30e00956f764bba60c1c80fb13a9c16af | igorhvr/bedlam | root.scm | " root.scm " 's and Laguerre 's methods for finding roots .
Copyright ( C ) 1996 , 1997
;
;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 . Any copy made o... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/root.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.
in full.
this software will be error-free, and I am under no obligation to
provide any services, by way of maintenan... | " root.scm " 's and Laguerre 's methods for finding roots .
Copyright ( C ) 1996 , 1997
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
(require 'logical)
... |
c0d744ccd451f4675c1f27e11485827ac03f5fe10ca3c69755f4d003af6d5ecd | shayan-najd/NativeMetaprogramming | CompilerDebugging.hs | module Options.CompilerDebugging where
import Types
compilerDebuggingOptions :: [Flag]
compilerDebuggingOptions =
[ flag { flagName = "-dcore-lint"
, flagDescription = "Turn on internal sanity checking"
, flagType = DynamicFlag
}
, flag { flagName = "-ddump-to-file"
, flagDescr... | null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/utils/mkUserGuidePart/Options/CompilerDebugging.hs | haskell | module Options.CompilerDebugging where
import Types
compilerDebuggingOptions :: [Flag]
compilerDebuggingOptions =
[ flag { flagName = "-dcore-lint"
, flagDescription = "Turn on internal sanity checking"
, flagType = DynamicFlag
}
, flag { flagName = "-ddump-to-file"
, flagDescr... | |
356c9a61ae50cb87c9a2e7aa86c99522333352f6bb7066f9b23793cbb108fc9d | quchen/generative-art | Main.hs | module Main (main) where
import Control.Monad
import Data.Coerce
import Data.List
import qualified Data.Vector as V
import Graphics.Rendering.Cairo as C hiding (height, width, x, y)
import Options.Applicative
import System.Random.MWC (in... | null | https://raw.githubusercontent.com/quchen/generative-art/245bb2948642d5d7fdd538b5095c00ba3a9cbaa2/penplotting/FlowLines/Main.hs | haskell | Higher values yield lower-frequency noise
2D vector potential, which in 2D is umm well a scalar potential.
Decrease exponent for more accurate results | module Main (main) where
import Control.Monad
import Data.Coerce
import Data.List
import qualified Data.Vector as V
import Graphics.Rendering.Cairo as C hiding (height, width, x, y)
import Options.Applicative
import System.Random.MWC (in... |
8a644e76f0a5e15287db528ff37528b32da2ebe4ef58035085b7b353bed39884 | hipsleek/hipsleek | predicate.ml | #include "xdebug.cppo"
open VarGen
open Globals
open Gen
module DD = Debug
module Err = Error
module I = Iast
module CA = Cast
module CP = Cpure
module CPP = Cpure_pred
module CF = Cformula
module MCP = Mcpure
module CEQ = Checkeq
module TP = Tpdispatcher
let pure_relation_name_of_heap_pred (CP.SpecVar (_, hp, p)... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/predicate.ml | ocaml | let rec helper f=
match f with
| CF.Base fb ->
CF.formula_base_heap = nh;
}
| CF.Exists _ ->
CF.add_quantifiers qvars nf
| CF.Or orf ->
let nf2 = helper orf.CF.formula_or_f2 in
in
helper f0
let pos = CP.pos_of_formula... | #include "xdebug.cppo"
open VarGen
open Globals
open Gen
module DD = Debug
module Err = Error
module I = Iast
module CA = Cast
module CP = Cpure
module CPP = Cpure_pred
module CF = Cformula
module MCP = Mcpure
module CEQ = Checkeq
module TP = Tpdispatcher
let pure_relation_name_of_heap_pred (CP.SpecVar (_, hp, p)... |
0241ba1c7af5a2d8fe336d6f41c73773f568016fd82b7e7cc87024705054914d | sanjoy/Snippets | Overflow.hs | {-# LANGUAGE RankNTypes, NegativeLiterals #-}
import Data.Int
import Data.Word
import Data.Bits
import Data.Maybe
import Data.List
import qualified Data.Set as S
-- import Test.QuickCheck
sext :: Int8 -> Int16
sext i = fromIntegral i
zext :: Int8 -> Int16
zext i = let w = fromIntegral i :: Word8
in fromInteg... | null | https://raw.githubusercontent.com/sanjoy/Snippets/76dcbff1da333b010662d42d0d235f614a882b87/Overflow.hs | haskell | # LANGUAGE RankNTypes, NegativeLiterals #
import Test.QuickCheck
(lo, hi)
-
w8 :: Int8 -> Bool
mi = if x + 1 < x then x + 1 else x
in (ma - mi) /
main = print $ filter w8 allInt8
w10_full :: (Int8, Int8, Int8) -> Bool | import Data.Int
import Data.Word
import Data.Bits
import Data.Maybe
import Data.List
import qualified Data.Set as S
sext :: Int8 -> Int16
sext i = fromIntegral i
zext :: Int8 -> Int16
zext i = let w = fromIntegral i :: Word8
in fromIntegral w
udiv8 :: Int8 -> Int8 -> Int8
udiv8 a b = let result = ((fromInte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.