_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 |
|---|---|---|---|---|---|---|---|---|
9314736dfb08c88d40e465918c3a8b6fc3da2d4701c0487afe46849be89227a6 | bobatkey/CS316-17 | NumberLines.hs | module Main where
import System.Environment
-- add line numbers to the beginning of each line
numberLines =
unlines . map (\(i,l) -> show i ++ ":" ++ l) . zip [1..] . lines
main :: IO ()
main = interact numberLines
-- do
-- args <- getArgs
-- case args of
-- [inputFile, outputFile] -> do
-- numbe... | null | https://raw.githubusercontent.com/bobatkey/CS316-17/36eb67c335cd0e6f5b7a4b8eafdea3cd4b715e0c/lectures/Lec18/NumberLines.hs | haskell | add line numbers to the beginning of each line
do
args <- getArgs
case args of
[inputFile, outputFile] -> do
numberLines <$> readFile inputFile >>= writeFile outputFile
_ -> do
prog <- getProgName
putStrLn ("Usage: " ++ prog ++ " <inputFile> <outputFile>") | module Main where
import System.Environment
numberLines =
unlines . map (\(i,l) -> show i ++ ":" ++ l) . zip [1..] . lines
main :: IO ()
main = interact numberLines
|
7bef210cfa412f72348c539a5af97b3ba9f65cc9f16bdf864e633319cb1f4183 | mfoemmel/erlang-otp | wxSlider.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxSlider.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxSlider).
-include("wxe.hrl").
-... |
cc6a4b3a78705185302871cd9cb676861a8f04f81c2f754db3feda0d0d500e90 | corecursive/sicp-study-group | ex02_27.scm | * Exercise 2.27 :* Modify your ` reverse ' procedure of * Note Exercise
2 - 18 : : to produce a ` deep - reverse ' procedure that takes a list as
;; argument and returns as its value the list with its elements
;; reversed and with all sublists deep-reversed as well.
;; Original reverse function
(de... | null | https://raw.githubusercontent.com/corecursive/sicp-study-group/853792c2f6aa52de7f35467b499062210e4433b4/plundaahl/exercises/ex02_27.scm | scheme | argument and returns as its value the list with its elements
reversed and with all sublists deep-reversed as well.
Original reverse function
Deep reverse
TESTS | * Exercise 2.27 :* Modify your ` reverse ' procedure of * Note Exercise
2 - 18 : : to produce a ` deep - reverse ' procedure that takes a list as
(define (reverse l)
(define (iter l acc)
(if (null? l)
acc
(iter (cdr l) (cons (car l) acc))))
(iter l '()))
(define (deep-reverse l)
(define (iter ... |
1919ce4643ca939e13ba5b3291b6491d4aae726551cc07c6b1238256bc6ed801 | fgalassi/cs61a-sp11 | higher-order.scm | (define (map func sent)
(if (empty? sent)
'()
(sentence (func (first sent)) (map func (butfirst sent)))))
(define (reduce total func sent)
(if (empty? sent)
total
(reduce (func total (first sent)) func (butfirst sent))))
(define (filter pred sent)
(if (empty? sent)
'()
(if (pred (first s... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/projects/blackjack/normal/higher-order.scm | scheme | (define (map func sent)
(if (empty? sent)
'()
(sentence (func (first sent)) (map func (butfirst sent)))))
(define (reduce total func sent)
(if (empty? sent)
total
(reduce (func total (first sent)) func (butfirst sent))))
(define (filter pred sent)
(if (empty? sent)
'()
(if (pred (first s... | |
ce551ec9fef3aa46b97ca96b38e2a0c01aeb1ad592a8dd2423ccd127ec1e0e9a | chef/mini_s3 | http_uri_.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2006 - 2018 . 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/chef/mini_s3/37568badf2a40c92742c5519e220829bc7a32a56/src/http_uri_.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 2006 - 2018 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
This is from chapter 3 , Syntax Components , of RFC 3986 :
The generic URI syntax consists of a hierarchical sequ... |
58b90366d39e3948625eb061dc3b8499fce08fa0ed954fdc346aa8aa7b2050b0 | melisgl/lassie | lsa.lisp | (in-package :lassie)
(deftype single-float-vector () '(simple-array single-float (*)))
(defclass lsa ()
((term-mapper
:initarg :term-mapper
:reader term-mapper
:documentation "A mapper over all documents in which a given term occurs.")
(document-mapper
:initarg :document-mapper
:reader docume... | null | https://raw.githubusercontent.com/melisgl/lassie/209b3435596090bc249a43ca7072a38f62a70d41/lsa.lisp | lisp | Features | (in-package :lassie)
(deftype single-float-vector () '(simple-array single-float (*)))
(defclass lsa ()
((term-mapper
:initarg :term-mapper
:reader term-mapper
:documentation "A mapper over all documents in which a given term occurs.")
(document-mapper
:initarg :document-mapper
:reader docume... |
38a1fd4f415c0b5c62ac42a8ad2acc2c99ccf19d4863cca44c9376e3d9deff9f | oliyh/lacinia-gen | core_test.cljc | (ns lacinia-gen.core-test
(:require #?(:clj [clojure.test :refer [deftest is testing]]
:cljs [cljs.test :refer [deftest is testing]])
[lacinia-gen.core :as lgen]
[clojure.test.check.generators :as g]
[clojure.test.check.generators :as gen]))
(defn- position? [positi... | null | https://raw.githubusercontent.com/oliyh/lacinia-gen/9bc2bfc906a05e7ed99653275e1e3ba3912c8d88/test/lacinia_gen/core_test.cljc | clojure | team has players and those players have a team, but no deeper | (ns lacinia-gen.core-test
(:require #?(:clj [clojure.test :refer [deftest is testing]]
:cljs [cljs.test :refer [deftest is testing]])
[lacinia-gen.core :as lgen]
[clojure.test.check.generators :as g]
[clojure.test.check.generators :as gen]))
(defn- position? [positi... |
a22bf6c2a40e7f115f7c5a1281ee53017adaf89034c23b197c8dc5e4695dd2ca | nikomatsakis/a-mir-formality | trait-item.rkt | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"../feature-gate.rkt"
"../../logic/env.rkt"
)
(provide trait-item-decl-rules
)
(define-metafunction formality-decl
;; Given the name of a trait and some item within that trait, Return a tuple of:
;;
;; *... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/decl/decl-to-clause/trait-item.rkt | racket | Given the name of a trait and some item within that trait, Return a tuple of:
* The clauses that hold in all crates due to this item
* The invariants that hold
For a method declared in a trait: currently no logical rules are created.
For an associated type declared in a trait, defines
(b) the where-clauses from... | #lang racket
(require redex/reduction-semantics
"../grammar.rkt"
"../feature-gate.rkt"
"../../logic/env.rkt"
)
(provide trait-item-decl-rules
)
(define-metafunction formality-decl
trait-item-decl-rules : CrateDecls CrateId (TraitId KindedVarIds_trait) TraitItem -> (Clause... |
fb9b8cbcda578f299d4101a19b47ca63e5fb8a58f90026fef85134393c97a080 | braintripping/lark | eval.cljs | (ns lark.eval
(:refer-clojure :exclude [eval])
(:require [cljs.js :as cljs]
[cljs.tools.reader :as r]
[cljs.tools.reader.reader-types :as rt]
[cljs.analyzer :as ana :refer [*cljs-warning-handlers*]]
[shadow.cljs.bootstrap.browser :as boot]
[clojure.string ... | null | https://raw.githubusercontent.com/braintripping/lark/95038a823068681c39453c46a309a3514cf48800/tools/src/lark/eval.cljs | clojure | note - not including `env` in warnings maps, because it is so large and can't be printed.
also unsure of memory implications.
| (ns lark.eval
(:refer-clojure :exclude [eval])
(:require [cljs.js :as cljs]
[cljs.tools.reader :as r]
[cljs.tools.reader.reader-types :as rt]
[cljs.analyzer :as ana :refer [*cljs-warning-handlers*]]
[shadow.cljs.bootstrap.browser :as boot]
[clojure.string ... |
0c037fa4cc68531d3e22ab7f5cfe19fa7abc80b9a79e9d8198f5358c10ef7e99 | gcv/cupboard | utils.clj | (ns cupboard.utils
(:require [clojure.java.io :as io])
(:import [org.joda.time DateTime LocalDate LocalTime LocalDateTime DateTimeZone])
(:import [java.io File IOException FileNotFoundException]
[java.text SimpleDateFormat ParseException]))
;;; -------------------------------------------------------... | null | https://raw.githubusercontent.com/gcv/cupboard/bd264e3051bafacd8b12602e02819585b563c464/src/cupboard/utils.clj | clojure | ----------------------------------------------------------------------
----------------------------------------------------------------------
when called just on a map of arguments
when called on a map passed through a &rest parameter
when called on a vector or list
keyword argument with a value counterpart
----... | (ns cupboard.utils
(:require [clojure.java.io :as io])
(:import [org.joda.time DateTime LocalDate LocalTime LocalDateTime DateTimeZone])
(:import [java.io File IOException FileNotFoundException]
[java.text SimpleDateFormat ParseException]))
plugging holes in Clojure
TODO : This should be replac... |
d9020f9d49970f5c57ad053ef817981c5107e86f0bfe9f90279db9813bd899d8 | marigold-dev/mankavar | test_regression.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Marigold < >
Copyright ( c ) 2021 ... | null | https://raw.githubusercontent.com/marigold-dev/mankavar/110d1659feec9ebd99cf2f76d7699f48483010ca/src/traced_storage/test/test_regression.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Marigold < >
Copyright ( c ) 2021 Nomadic Labs . < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ... |
b7081336962f52837032534a22f9cf50fba1adc74306e38c96762ccaf0426cf0 | racket/math | matrix.rkt | #lang racket/base
(require typed/untyped-utils)
(require "private/matrix/matrix-arithmetic.rkt"
"private/matrix/matrix-conversion.rkt"
"private/matrix/matrix-syntax.rkt"
"private/matrix/matrix-comprehension.rkt"
"private/matrix/matrix-types.rkt"
"private/matrix/matrix-2d.r... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/matrix.rkt | racket | "private/matrix/matrix-expt.rkt" ; all use require/untyped-contract
"private/matrix/matrix-kronecker.rkt" ; all use require/untyped-contract
"private/matrix/matrix-gauss-elim.rkt" ; all use require/untyped-contract
"private/matrix/matrix-qr.rkt" ; all use require/untyped-contract
"private/matrix/matrix-lu.rk... | #lang racket/base
(require typed/untyped-utils)
(require "private/matrix/matrix-arithmetic.rkt"
"private/matrix/matrix-conversion.rkt"
"private/matrix/matrix-syntax.rkt"
"private/matrix/matrix-comprehension.rkt"
"private/matrix/matrix-types.rkt"
"private/matrix/matrix-2d.r... |
3a21549648c5735ec556239a8ce2a72066854c615c74ec06a2793ba00e552950 | MercuryTechnologies/ghc-specter | Events.hs | module GHCSpecter.UI.ConcurReplica.DOM.Events (
onMouseMove,
onMouseDown,
onMouseUp,
) where
import Concur.Replica.DOM.Props (Prop (PropEvent), Props (Props))
import Data.Aeson qualified as A
import Data.Aeson.KeyMap qualified as A
import Data.Scientific (toRealFloat)
import Replica.VDOM.Types (DOMEvent (getDOME... | null | https://raw.githubusercontent.com/MercuryTechnologies/ghc-specter/d911e610e0ee0fb43497dad9e762fec2abbf9e08/daemon/src/GHCSpecter/UI/ConcurReplica/DOM/Events.hs | haskell | module GHCSpecter.UI.ConcurReplica.DOM.Events (
onMouseMove,
onMouseDown,
onMouseUp,
) where
import Concur.Replica.DOM.Props (Prop (PropEvent), Props (Props))
import Data.Aeson qualified as A
import Data.Aeson.KeyMap qualified as A
import Data.Scientific (toRealFloat)
import Replica.VDOM.Types (DOMEvent (getDOME... | |
c8973fe19ae352a6fc9e4f5009bcdd350bceb34f0f2e0aa9894d8cf66d72af92 | ad044/nmebious | db.lisp | (in-package #:nmebious)
(defun insert-post (data checksum type board ip-hash)
(query (:insert-rows-into 'post
:columns 'submission-date 'board 'type 'data 'ip-hash 'checksum
:values `((,(format-timestring nil (now))
,board
,type
... | null | https://raw.githubusercontent.com/ad044/nmebious/b6a55e458079f6ef3718f5bf171900eba7c2364a/src/db.lisp | lisp | (in-package #:nmebious)
(defun insert-post (data checksum type board ip-hash)
(query (:insert-rows-into 'post
:columns 'submission-date 'board 'type 'data 'ip-hash 'checksum
:values `((,(format-timestring nil (now))
,board
,type
... | |
093c18dac999852eea61609256c8b3d5b43c89f8aea5538c18c04257afd30088 | earl-ducaine/cl-garnet | schema-graph.lisp | (when (boundp 'win) (opal:destroy win))
(create-instance 'win inter:interactor-window
(:left 800) (:top 300)
(:height 490) (:width 380)
(:aggregate (create-instance 'agg opal:aggregate)))
(create-instance 'SCHEMA-GRAPH opal:aggregraph
(:children-function #'(lambda (source-node depth)
(if (> depth 1)
... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/doc/src/aggregadgets/garnet-code/schema-graph.lisp | lisp | (when (boundp 'win) (opal:destroy win))
(create-instance 'win inter:interactor-window
(:left 800) (:top 300)
(:height 490) (:width 380)
(:aggregate (create-instance 'agg opal:aggregate)))
(create-instance 'SCHEMA-GRAPH opal:aggregraph
(:children-function #'(lambda (source-node depth)
(if (> depth 1)
... | |
52240789ccdc5190ac1d1853858244764c11b6635547bd74dfb6bf666f2ad944 | roburio/ocaml-openpgp | public_key_encrypted_session_packet.mli | type t
TODO make private ?
open Rresult
val parse_packet : Cs.t -> (t, [> `Incomplete_packet | R.msg] )result
(** [parse_packet data] is the deserialized session packet contained in [data].
The parsed packet can be re-serialized using [serialize].
Note that the message itself (containing a symmetric key pa... | null | https://raw.githubusercontent.com/roburio/ocaml-openpgp/55459ad98a69f80789c79219c6d3be19ef6ef521/lib/public_key_encrypted_session_packet.mli | ocaml | * [parse_packet data] is the deserialized session packet contained in [data].
The parsed packet can be re-serialized using [serialize].
Note that the message itself (containing a symmetric key payload)
is NOT decrypted (see [decrypt]).
* [pp formatter pkt] is the pretty-printer for [t]
* [serialize sessio... | type t
TODO make private ?
open Rresult
val parse_packet : Cs.t -> (t, [> `Incomplete_packet | R.msg] )result
val pp : Format.formatter -> t -> unit
val serialize : t -> (Cs.t, [> R.msg] ) result
val hash : t -> (Cs.t -> unit) -> Types.openpgp_version ->
(unit, [> R.msg]) result
* [ hash pkt hash_cb openpgp_v... |
12b2a34ed7577a56d7d881045090622eaa13a35f4a4dba0277ecefc3c01d88f2 | mlcfp/zenacy-html | Entity.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
-- | Matches and extracts entities from byte strings.
module Zenacy.HTML.Internal.Entity
( entityMatch
, entityTrie
, entityData
) w... | null | https://raw.githubusercontent.com/mlcfp/zenacy-html/b4af86fecc6fbbe1c7501e2fa75e6aa28206ebcb/src/Zenacy/HTML/Internal/Entity.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Matches and extracts entities from byte strings.
| Searches for an entity match.
Returns a tuple with the prefix, its value, and the remaining string.
| A trie of the entity data with surrogates converted.
| Converts a surrogate pai... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Zenacy.HTML.Internal.Entity
( entityMatch
, entityTrie
, entityData
) where
import Zenacy.HTML.Internal.BS
import Zenacy.HTML.Internal.Char
import Data.Char
( chr
, ord
)
import qualified Data.Text as Text
( p... |
ccb9d122f224abf143f38c7def8902b2193f497f07b009279fc999b0bfadc9fe | brownplt/LambdaS5 | ljs_env.ml | open Prelude
open Ljs_syntax
open Lexing
type parsed_env = exp -> exp
let parse_env cin name : parsed_env =
let lexbuf = Lexing.from_channel cin in
try
(* Set the correct filename in lexbuf (for source-tracking). *)
lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = name };
... | null | https://raw.githubusercontent.com/brownplt/LambdaS5/f0bf5c7baf1daa4ead4e398ba7d430bedb7de9cf/src/ljs/ljs_env.ml | ocaml | Set the correct filename in lexbuf (for source-tracking). | open Prelude
open Ljs_syntax
open Lexing
type parsed_env = exp -> exp
let parse_env cin name : parsed_env =
let lexbuf = Lexing.from_channel cin in
try
lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with pos_fname = name };
Ljs_parser.env Ljs_lexer.token lexbuf
with
| Failure "lexi... |
4dc372fb11f9abe86a1ec4fe6d1c5004316f00cf4c6bdb7bcb03ecf5a7fd6903 | tcsprojects/ocaml-sat-solvers | preprocessor.mli | open Satwrapper;;
class preprocessorSolverFactory: solverFactory -> object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_timed_instance: Timing.timetable -> abstractSolver
method new_inst... | null | https://raw.githubusercontent.com/tcsprojects/ocaml-sat-solvers/2c36605fb3e38a1bee41e079031ab5b173794910/src/preprocessor/preprocessor.mli | ocaml | open Satwrapper;;
class preprocessorSolverFactory: solverFactory -> object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_timed_instance: Timing.timetable -> abstractSolver
method new_inst... | |
8ed4e65014625f3aaeeb1b8994a21af79b85e4a0a214611051acde4927436e9a | rd--/hsc3 | moogVCF.help.hs | -- moogVCF
let o = mix (lfSaw ar (mce2 120 180) 0 * 0.33)
cf = linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 180 8500
in X.moogVCF o cf 0.75
-- moogVCF
let o = pulse ar (mce2 40 121) (mce2 0.3 0.7)
cf = range 30 4200 (sinOsc kr (range 0.001 2.2 (lfNoise0Id 'α' kr 0.42)) 0)
in X.moogVCF o cf 0.8 * 0.25
| null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/moogVCF.help.hs | haskell | moogVCF
moogVCF | let o = mix (lfSaw ar (mce2 120 180) 0 * 0.33)
cf = linExp (lfCub kr 0.1 (0.5 * pi)) (-1) 1 180 8500
in X.moogVCF o cf 0.75
let o = pulse ar (mce2 40 121) (mce2 0.3 0.7)
cf = range 30 4200 (sinOsc kr (range 0.001 2.2 (lfNoise0Id 'α' kr 0.42)) 0)
in X.moogVCF o cf 0.8 * 0.25
|
f64049729e0242fc6fd3254224c7e05d9883ab4507b2d6cf3145df5287ceacae | rabbitmq/ra-kv-store | control_test.clj | (ns jepsen.control-test
(:require [jepsen.control :as c]
[clojure.test :refer :all]))
(deftest basic-test
(c/with-ssh {}
(c/on "n1"
(is (= (c/exec :whoami) "root")))))
| null | https://raw.githubusercontent.com/rabbitmq/ra-kv-store/faf36863bb3822ef4dcd99de5635007273d35997/jepsen/jepsen/test/jepsen/control_test.clj | clojure | (ns jepsen.control-test
(:require [jepsen.control :as c]
[clojure.test :refer :all]))
(deftest basic-test
(c/with-ssh {}
(c/on "n1"
(is (= (c/exec :whoami) "root")))))
| |
ecf4d16ba6727e7d6a4e4c791e1dd2d02a4e82c4312fb8b9358b0afbfc623d63 | helium/blockchain-core | blockchain_txn_mgr.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Blockchain Transaction Mgr ==
%% @end
%%%-------------------------------------------------------------------
-module(blockchain_txn_mgr).
-behavior(gen_server).
-include("blockchain.hrl").
-include("blockchain_vars.hrl").
-include_lib... | null | https://raw.githubusercontent.com/helium/blockchain-core/14eecaec37a33d8cff70025259177f2f58993879/src/transactions/blockchain_txn_mgr.erl | erlang | -------------------------------------------------------------------
@doc
== Blockchain Transaction Mgr ==
@end
-------------------------------------------------------------------
block interval at which we request updated queue details from our acceptors
------------------------------------------------------------... | -module(blockchain_txn_mgr).
-behavior(gen_server).
-include("blockchain.hrl").
-include("blockchain_vars.hrl").
-include_lib("helium_proto/include/blockchain_txn_handler_pb.hrl").
-define(TXN_CACHE, txn_cache).
-define(CACHE, general_cache).
-define(CUR_HEIGHT, cur_height).
30 mins
-define(UPDATE_TXN_TIMEOUT, 5).
... |
c28dbc758fabd99390359b60fcacf2e139e99a0996a05ea68118d477e64f5aeb | fukamachi/psychiq | concurrency.lisp | (in-package :cl-user)
(defpackage psychiq.util.concurrency
(:use #:cl)
(:export #:make-thread-safe-variable
#:get-value
#:reset-value))
(in-package :psychiq.util.concurrency)
(defstruct (thread-safe-variable
(:constructor make-thread-safe-variable
(initial-value &k... | null | https://raw.githubusercontent.com/fukamachi/psychiq/602fbb51d4c871de5909ec0c5a159652f4ae9ad3/src/util/concurrency.lisp | lisp | (in-package :cl-user)
(defpackage psychiq.util.concurrency
(:use #:cl)
(:export #:make-thread-safe-variable
#:get-value
#:reset-value))
(in-package :psychiq.util.concurrency)
(defstruct (thread-safe-variable
(:constructor make-thread-safe-variable
(initial-value &k... | |
2925e99a2e572048cf47e5cb95da50d98ae0ee4f3ed179cfb4033957c13a7c05 | xtdb/core2 | select_test.clj | (ns core2.operator.select-test
(:require [clojure.test :as t :refer [deftest]]
[core2.test-util :as tu]))
(t/use-fixtures :each tu/with-allocator)
(t/deftest test-select
(t/is (= [[{:a 12, :b 10}]
[{:a 100, :b 83}]]
(tu/query-ra [:select '(> a b)
[::tu/b... | null | https://raw.githubusercontent.com/xtdb/core2/3adeb391ca4dd73a3f79faba8024289376597d23/src/test/clojure/core2/operator/select_test.clj | clojure | (ns core2.operator.select-test
(:require [clojure.test :as t :refer [deftest]]
[core2.test-util :as tu]))
(t/use-fixtures :each tu/with-allocator)
(t/deftest test-select
(t/is (= [[{:a 12, :b 10}]
[{:a 100, :b 83}]]
(tu/query-ra [:select '(> a b)
[::tu/b... | |
57244b98855bbee3c92db60f9c52c7aafc78e66f3951b199a5d91dee7fa42a37 | haskell-CI/hackage-matrix-builder | Router.hs | # LANGUAGE ApplicativeDo #
# LANGUAGE CPP #
# LANGUAGE RecursiveDo #
# LANGUAGE StandaloneDeriving #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE MultiPar... | null | https://raw.githubusercontent.com/haskell-CI/hackage-matrix-builder/bb813e9e4cf0d08352f33004c00ede987f45da56/src-ui.v3/src/Router.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
Child widget | # LANGUAGE ApplicativeDo #
# LANGUAGE CPP #
# LANGUAGE RecursiveDo #
# LANGUAGE StandaloneDeriving #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE ... |
1fc4b319dd6dca3c9dd393fa5cf02d163686b40863f23247c2899bc98a632bb5 | fumieval/winery | Internal.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
------------------------------------------------... | null | https://raw.githubusercontent.com/fumieval/winery/a55aff79e9a936d11797a860378c42d0f944fa63/src/Codec/Winery/Internal.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
# LANGUAGE Rank2Types #
--------------------------------------------------------------------------
|
Module : Codec.Winery.Internal
License : BSD3
Stability : Experimental
----------------------------------------------------------------------... | # LANGUAGE DeriveFunctor #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2019
Maintainer : < >
Internal functions and datatypes
module Codec.Winery.Internal
( unsignedVarInt
... |
1538ad613ca803a687ff9adcebad8c8294b0846e626e14e63aaee43c12789a4e | rtrusso/scp | letrec.scm | (define (foo x)
(letrec ((a (list->string (list #\a #\b #\c)))
(foo-1 (lambda (y) (+ x y)))
(foo-2 (lambda (z) (+ (foo-1 z) 3)))
(foo-3 (lambda (w) (+ (foo-2 w) 4))))
(foo-3 9)))
(display (foo 17))
(newline)
| null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/tests/letrec.scm | scheme | (define (foo x)
(letrec ((a (list->string (list #\a #\b #\c)))
(foo-1 (lambda (y) (+ x y)))
(foo-2 (lambda (z) (+ (foo-1 z) 3)))
(foo-3 (lambda (w) (+ (foo-2 w) 4))))
(foo-3 9)))
(display (foo 17))
(newline)
| |
0be6a4077bba89e800811a92387fcd5944a8fe8884914ef2f7bc7e1481ef02eb | rmculpepper/webapi | atom-resource.rkt | Copyright 2012
Released under the terms of the LGPL version 3 or later .
;; See the file COPYRIGHT for details.
#lang racket/base
(require "private/has-atom.rkt")
(provide atom-resource<%>
atom-feed-resource<%>)
| null | https://raw.githubusercontent.com/rmculpepper/webapi/c1a172e360db667be49dcd81eba85f4a35b73a94/webapi/atom-resource.rkt | racket | See the file COPYRIGHT for details. | Copyright 2012
Released under the terms of the LGPL version 3 or later .
#lang racket/base
(require "private/has-atom.rkt")
(provide atom-resource<%>
atom-feed-resource<%>)
|
eb01178c1d74b7b77e56fd54c577e3a310c40156407797793ee46efee4bf738f | KMahoney/squee | Combinators.hs | module RangedParsec.Combinators
( skipSpace
, takeWhile
, takeWhile1
, excluding
, excludingSet
, sepBy
, sepBy1
, manyTill
, try
, matchSpan
, chain
) where
import Prelude hiding (takeWhile)
import Data.Char (isSpace)
import qualified Data.Set as S
import Control.Applicative
import Data.Text (... | null | https://raw.githubusercontent.com/KMahoney/squee/b2ebad2ec6f3c866398600793d0a231edc8c23e4/lib/ranged-parsec/src/RangedParsec/Combinators.hs | haskell | module RangedParsec.Combinators
( skipSpace
, takeWhile
, takeWhile1
, excluding
, excludingSet
, sepBy
, sepBy1
, manyTill
, try
, matchSpan
, chain
) where
import Prelude hiding (takeWhile)
import Data.Char (isSpace)
import qualified Data.Set as S
import Control.Applicative
import Data.Text (... | |
a43fe031e40cb5a24d07ef1544b0746f41a98dec40638556e5460244fdf93176 | luksamuk/cl-rest-server-example | db.lisp | (in-package #:rest-server.db)
(defparameter *db-username* "postgres"
"Username for accessing the database.")
(defparameter *db-dbname* "cl-rest"
"Name of the database in the RDBMS.")
(defparameter *db-pass* "docker"
"Password of the database in the RDBMS.
Consider replacing this by an environment variable.... | null | https://raw.githubusercontent.com/luksamuk/cl-rest-server-example/e48fc918c30ede66579afb693584b178c83ba683/src/db.lisp | lisp | (in-package #:rest-server.db)
(defparameter *db-username* "postgres"
"Username for accessing the database.")
(defparameter *db-dbname* "cl-rest"
"Name of the database in the RDBMS.")
(defparameter *db-pass* "docker"
"Password of the database in the RDBMS.
Consider replacing this by an environment variable.... | |
3909a23f521192b69e5ccc02bfdf55243a96decafa2a2e4213962af0de72325d | brendanhay/amazonka | WorkMail.hs | # OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - unused - imports #
Derived from AWS service descriptions , licensed under Apache 2.0 .
-- |
Module : Test . Amazonka . Gen.
Copyright : ( c ) 2013 - 2023
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workmail/test/Test/Amazonka/Gen/WorkMail.hs | haskell | |
Stability : auto-generated
Auto-generated: the actual test selection needs to be manually placed into
the top-level so that real test data can be incrementally added.
This commented snippet is what the entire set should look like:
fixtures :: TestTree
fixtures =
[ testGroup "request"
[ request... | # OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_GHC -fno - warn - unused - imports #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Module : Test . Amazonka . Gen.
Copyright : ( c ) 2013 - 2023
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay... |
c72e6fcf9d4d2221efe7653654967c016790c6655e0ecdb4b0aa1cbbaff6a33c | jeremykross/konstellate | style.clj | (ns konstellate.style
(:require
garden.selectors
[garden.core :as garden]
[garden.def :refer [defkeyframes]]
[konstellate.editor.style :as editor]
[konstellate.graffle.style :as graffle]
[konstellate.components.style :as components]))
(def shadow-color "rgba(46, 91, 255, 0.4)")
(def shadow "0... | null | https://raw.githubusercontent.com/jeremykross/konstellate/4801813469b78691d2e8024bd74ebd38468d27f8/src/konstellate/style.clj | clojure | (ns konstellate.style
(:require
garden.selectors
[garden.core :as garden]
[garden.def :refer [defkeyframes]]
[konstellate.editor.style :as editor]
[konstellate.graffle.style :as graffle]
[konstellate.components.style :as components]))
(def shadow-color "rgba(46, 91, 255, 0.4)")
(def shadow "0... | |
ad2eb84baf1304f9d959cd4f76cf81cdf779e84665c370cbf343b07cd585ef68 | kfish/const-math-ghc-plugin | arith008.hs | ! ! ! a random test from
( got this in mid-1993 ; do n't remember why . WDP 95/02 )
--
random_numbers :: (Int, Int, Int) -> [Float]
random_numbers (s1,s2,s3)
= map (snd . properFraction . combine) (iterate f (s1,s2,s3))
where
combine :: (Int,Int,Int) -> Float
combine (a,b,c) =
... | null | https://raw.githubusercontent.com/kfish/const-math-ghc-plugin/c1d269e0ddc72a782c73cca233ec9488f69112a9/tests/ghc-7.6/arith008.hs | haskell |
partain: changed to cvt spaces into newlines (easier to see bugs)
sof: define approp. version of showList to do this. | ! ! ! a random test from
( got this in mid-1993 ; do n't remember why . WDP 95/02 )
random_numbers :: (Int, Int, Int) -> [Float]
random_numbers (s1,s2,s3)
= map (snd . properFraction . combine) (iterate f (s1,s2,s3))
where
combine :: (Int,Int,Int) -> Float
combine (a,b,c) =
... |
3182b6327821f8a63c7e19628c8ca95d3caf89884999def9d51a4daeb4ac7589 | barrucadu/dejafu | Logger.hs | Modification ( to introduce bug ) of an example in Parallel and
Concurrent Programming in Haskell , chapter 7 .
module Examples.Logger where
import Control.Concurrent.Classy hiding (check)
import Data.Functor (void)
import Test.DejaFu hiding (MemType(..), ch... | null | https://raw.githubusercontent.com/barrucadu/dejafu/f805783398e2be60ebabb56fce9f23506b9d1879/dejafu-tests/lib/Examples/Logger.hs | haskell | ------------------------------------------------------------------------------
| Create a new logger with no internal log.
| Add a string to the log.
| Stop the logger and return the contents of the log.
| Race condition! Can you see where?
| Test that the result is always in the set of allowed values, and
doesn'... | Modification ( to introduce bug ) of an example in Parallel and
Concurrent Programming in Haskell , chapter 7 .
module Examples.Logger where
import Control.Concurrent.Classy hiding (check)
import Data.Functor (void)
import Test.DejaFu hiding (MemType(..), ch... |
e9a0a83e495bf17dd413edf58ddd3f2fe0267c71334ddb3f150fbe4c6d9ca580 | larcenists/larceny | label4.scm | ; local labels via brute force renaming
(! (begin (define my-gensym ; assuming eval allows non-expressions (eg define)
(let ((count 1))
(lambda ()
(let ((new (string->symbol (string-append
"_label"
(number->string count)))))
(set! count (+ count 1))
new))))
'void))
(macro m... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/tests/prims/label4.scm | scheme | local labels via brute force renaming
assuming eval allows non-expressions (eg define)
do the substitution manually,
instead of relying on a macro to do it,
because 'direcs' is a directive
and we want to be able use this in a nested context
foo:
_label1:
0000000A 83F800 cmp eax,byte +0x0 |
(let ((count 1))
(lambda ()
(let ((new (string->symbol (string-append
"_label"
(number->string count)))))
(set! count (+ count 1))
new))))
'void))
(macro my-local (lambda (name . body)
(define new-sym (my-gensym))
(define (deep-replace new old lst)
(cond ((pair... |
a0fd7fe4f59e6f4cd4c6587539d6537352c4ac4c0e206d9848b86cd23c3f80e9 | lazy-cat-io/metaverse | profile.cljs | (ns metaverse.renderer.pages.profile
(:require
[heroicons.outline :as icons.outline]
[re-frame.core :as rf]))
(def links
{:page/profile {:label "Profile"
:href :page/profile
:icon icons.outline/user-icon}
:page/profile.subs... | null | https://raw.githubusercontent.com/lazy-cat-io/metaverse/179b3cbd0de722a2926b6b27002d708a49157220/src/main/clojure/metaverse/renderer/pages/profile.cljs | clojure | (ns metaverse.renderer.pages.profile
(:require
[heroicons.outline :as icons.outline]
[re-frame.core :as rf]))
(def links
{:page/profile {:label "Profile"
:href :page/profile
:icon icons.outline/user-icon}
:page/profile.subs... | |
6a6339b4dc9cb0216adeeff6387f2126721ad97f11fe3932ff52e644f0956853 | fission-codes/fission | Param.hs | module Network.IPFS.Client.Param
( CID'
, IsRecursive
) where
import Servant.API
import Network.IPFS.CID.Types
type CID' = QueryParam' '[Required, Strict] "arg" CID
type IsRecursive = QueryFlag "recursive"
| null | https://raw.githubusercontent.com/fission-codes/fission/fb76d255f06ea73187c9b787bd207c3778e1b559/ipfs/library/Network/IPFS/Client/Param.hs | haskell | module Network.IPFS.Client.Param
( CID'
, IsRecursive
) where
import Servant.API
import Network.IPFS.CID.Types
type CID' = QueryParam' '[Required, Strict] "arg" CID
type IsRecursive = QueryFlag "recursive"
| |
f3a4e041841fdd6b498565010570c9cd0b5bbe2540faf3512332db8c19b4a1f3 | ghc/testsuite | tcrun010.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies #
-- !!! Functional dependencies
This one gave " zonkIdOcc : FunDep_a11w " in earlier days
module Main (main) where
data ERR a b = EOK a | ERR b deriving (Show)
data Error = No | Notatall deriving (Show, Eq)
class MonadErr m e | m -> e where
aertur... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_run/tcrun010.hs | haskell | !!! Functional dependencies | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies #
This one gave " zonkIdOcc : FunDep_a11w " in earlier days
module Main (main) where
data ERR a b = EOK a | ERR b deriving (Show)
data Error = No | Notatall deriving (Show, Eq)
class MonadErr m e | m -> e where
aerturn :: e -> m a
ar... |
047de924c70e2d598bf815214fa2d9d2efac0150c129c4706eb3f237a5f6c4df | melisgl/higgsml | test.lisp | (in-package :rumcajsz)
(defun test ())
| null | https://raw.githubusercontent.com/melisgl/higgsml/a49679354f1b1896ea6472a5f615e9bcdee65638/test/test.lisp | lisp | (in-package :rumcajsz)
(defun test ())
| |
680de39ab103995d3c58fb64568574abb86d8fd1db095a0874cf9e13d0586818 | imrehg/ypsilon | r5rs.scm | #!core
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (core r5rs)
(export (rename (inexact exact->inexact) (exact inexact->exact))
quotient
remainder
modulo
delay
... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/stdlib/core/r5rs.scm | scheme | [end] | #!core
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (core r5rs)
(export (rename (inexact exact->inexact) (exact inexact->exact))
quotient
remainder
modulo
delay
... |
5408afa4045880a531eb7723a67c8fdc62d34060edfcb7f5b9fb710b2fa5ecb9 | bnoordhuis/chicken-core | import-tests.scm | ;;;; import-tests.scm
(require-library (srfi 4))
(module m1 ()
(import scheme (only srfi-4 u8vector?)) u8vector?)
(print "expect warning ...")
(assert
(handle-exceptions ex #t
(eval '
(module m2 ()
(import scheme chicken (only (srfi 4) u8vector?))
s8vector?)) #f))
(module m3 ()
(import scheme (rename (srfi 4) ... | null | https://raw.githubusercontent.com/bnoordhuis/chicken-core/56d30e3be095b6abe1bddcfe10505fa726a43bb5/tests/import-tests.scm | scheme | import-tests.scm |
(require-library (srfi 4))
(module m1 ()
(import scheme (only srfi-4 u8vector?)) u8vector?)
(print "expect warning ...")
(assert
(handle-exceptions ex #t
(eval '
(module m2 ()
(import scheme chicken (only (srfi 4) u8vector?))
s8vector?)) #f))
(module m3 ()
(import scheme (rename (srfi 4) (u8vector? u8v?)))
u8... |
af185f2e002a5393754d17e00d2c009547d2fe365df56f01295d9277246de4b0 | ocsigen/html_of_wiki | paths.mli | val up : string
val here : string
(** Operator for [Filename.concat]. *)
val ( +/+ ) : string -> string -> string
* Concatenates the paths together in one single path
val path_of_list : string list -> string
(** Splits the given path in a list of basenames *)
val list_of_path : string -> string list
(** Returns the... | null | https://raw.githubusercontent.com/ocsigen/html_of_wiki/fb3af10cd2294a39e6e281abc92cb3b4fb75af2d/src/ohow/paths.mli | ocaml | * Operator for [Filename.concat].
* Splits the given path in a list of basenames
* Returns the absolute path of the given path (returns it if already absolute)
* [rewind dir file] returns the relative path to take to go back from file's
directory to dir directory. Example: [rewind "foo/" "foo/bar/f.txt"] =>
... | val up : string
val here : string
val ( +/+ ) : string -> string -> string
* Concatenates the paths together in one single path
val path_of_list : string list -> string
val list_of_path : string -> string list
val realpath : string -> string
* Checks whether two absolute path or two relative path are equal .
val p... |
5aad2248d650722893e76e8ca107488bbff5a23e05da68a9e51364764ad33a1c | futurice/haskell-mega-repo | BookInformation.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DerivingVia #-}
# LANGUAGE InstanceSigs #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Futurice.App.Library.Types.BookInformation where
import Database.PostgreSQL.... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/library-app/src/Futurice/App/Library/Types/BookInformation.hs | haskell | # LANGUAGE DerivingVia #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators # | # LANGUAGE DataKinds #
# LANGUAGE InstanceSigs #
# LANGUAGE TemplateHaskell #
module Futurice.App.Library.Types.BookInformation where
import Database.PostgreSQL.Simple.FromField
import Database.PostgreSQL.Simple.FromRow
import Database.PostgreSQL.Simple.ToField
import Futurice.App.Sisosota.Types ... |
07631856fa0c9a2913af0db221a8dc934bfce2ffbf24e690d7afe1dd11bb57ca | nuvla/api-server | user_username_password.clj | (ns sixsq.nuvla.server.resources.user-username-password
"
Provides the functions necessary to create a `user` resource from a username,
password, and other given information."
(:require
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.spec.user]
[sixsq.nuvla.server.resourc... | null | https://raw.githubusercontent.com/nuvla/api-server/7095076ae6eff4b8f21b17e7673886854ba90e2d/code/src/sixsq/nuvla/server/resources/user_username_password.clj | clojure |
multimethod for validation
transformation of template
create/update all related resources
| (ns sixsq.nuvla.server.resources.user-username-password
"
Provides the functions necessary to create a `user` resource from a username,
password, and other given information."
(:require
[sixsq.nuvla.server.resources.common.utils :as u]
[sixsq.nuvla.server.resources.spec.user]
[sixsq.nuvla.server.resourc... |
197d8abfe077a706662d004f7467c651ca45bebc6259808b4074d774283933d5 | bjorng/wings | auv_util.erl | %%
auv_util.erl --
%%
Some utilities used by the other AutoUV modules .
%%
Copyright ( c ) 2002 - 2011 ,
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%
%% $Id$
%%
-module(auv_util).
-export([maxmin/1]).
-... | null | https://raw.githubusercontent.com/bjorng/wings/dec64a500220359dbc552600af486be47c45d301/plugins_src/autouv/auv_util.erl | erlang |
See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
$Id$
I use normals here to detect direction of face and remove
faces with wrong direction.
Hard edges mark the cuts.
Use materials to mark different charts.
Yellow
Magenta
... | auv_util.erl --
Some utilities used by the other AutoUV modules .
Copyright ( c ) 2002 - 2011 ,
-module(auv_util).
-export([maxmin/1]).
-export([moveAndScale/5]).
-export([outer_edges/2,outer_edges/3]).
-export([number/1,number/2]).
-export([mark_segments/4,make_mat/1,seg_materials/0]).
-include_lib(... |
15d6fe54d2c3ac3e80930ac0692ee0aa21e784bcc3a29311d7a3bc922361d414 | zendesk/clj-headlights | input_output.clj | (ns clj-headlights.input-output
"Tools for pipeline data input and output"
(:require [clojure.string :as str]
[clj-headlights.pubsub :as pubsub]
[clj-headlights.pipeline :as df]
[cheshire.core :as json]
[clojure.string :as string]
[schema.core :as s]
... | null | https://raw.githubusercontent.com/zendesk/clj-headlights/095ab05337c1a35583776a74137041ba9d783383/src/clj_headlights/input_output.clj | clojure | this ns expects files prefixed with file://, but PartitionedFileSink does not | (ns clj-headlights.input-output
"Tools for pipeline data input and output"
(:require [clojure.string :as str]
[clj-headlights.pubsub :as pubsub]
[clj-headlights.pipeline :as df]
[cheshire.core :as json]
[clojure.string :as string]
[schema.core :as s]
... |
74ccb915396c62d1f9e42ba2de71409e1b73edee177eaa711f9b8cc33abe8bb0 | AndrasKovacs/ELTE-func-lang | Lesson07.hs | # options_ghc -Wincomplete - patterns #
# language InstanceSigs #
{-# language DeriveFunctor #-}
# language DeriveFoldable #
import Control.Monad
State
newtype State s a = State {runState :: s -> (a, s)} deriving Functor
instance Applicative (State s) where
pure = return
(<*>) = ap
instance Monad (State s)... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-2/gyak_2/Lesson07.hs | haskell | # language DeriveFunctor #
Tasks
Define a new stack operation that checks if a stack is empty!
Define a new stack operation that counts the number of stored elements!
Write a function that maps a function over a stack of elements, without
pattern matching, using only the stack operations!
Swap the elements of a ... | # options_ghc -Wincomplete - patterns #
# language InstanceSigs #
# language DeriveFoldable #
import Control.Monad
State
newtype State s a = State {runState :: s -> (a, s)} deriving Functor
instance Applicative (State s) where
pure = return
(<*>) = ap
instance Monad (State s) where
return :: a -> State s... |
07dfa7bb27f27b4207c67a782a8ec501aad5a1821b99c33f4b5f005ca4d78cc4 | patricoferris/ocaml-multicore-monorepo | cipher.ml | This file is part of Dream , released under the MIT license . See LICENSE.md
for details , or visit .
Copyright 2021
for details, or visit .
Copyright 2021 Anton Bachin *)
let secret_1 =
"abc"
let secret_2 =
"def"
let nonce_1 =
"abcdefghijkl"
let nonce_2 =
"opqrstuvwxyz"
let encryp... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/test/expect/server/cipher/cipher.ml | ocaml | This file is part of Dream , released under the MIT license . See LICENSE.md
for details , or visit .
Copyright 2021
for details, or visit .
Copyright 2021 Anton Bachin *)
let secret_1 =
"abc"
let secret_2 =
"def"
let nonce_1 =
"abcdefghijkl"
let nonce_2 =
"opqrstuvwxyz"
let encryp... | |
41015e665617be75afdadd57f651e9ac2113286f57c087af1d552a834bf0a179 | modular-macros/ocaml-macros | pr5673_ok.ml | module Classdef = struct
class virtual ['a, 'b, 'c] cl0 =
object
constraint 'c = < m : 'a -> 'b -> int; .. >
end
class virtual ['a, 'b] cl1 =
object
method virtual raise_trouble : int -> 'a
method virtual m : 'a -> 'b -> int
end
class virtual ['a, 'b] cl2 =
object
met... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/typing-poly-bugs/pr5673_ok.ml | ocaml | module Classdef = struct
class virtual ['a, 'b, 'c] cl0 =
object
constraint 'c = < m : 'a -> 'b -> int; .. >
end
class virtual ['a, 'b] cl1 =
object
method virtual raise_trouble : int -> 'a
method virtual m : 'a -> 'b -> int
end
class virtual ['a, 'b] cl2 =
object
met... | |
9ee39db189a3537ae28cd67c82a8e3baf43ede84ef8da8b0cb2403689b6e4e49 | exoscale/clojure-kubernetes-client | v1beta1_daemon_set_update_strategy.clj | (ns clojure-kubernetes-client.specs.v1beta1-daemon-set-update-strategy
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta1-rolling-update-daemon-set :refer :all]
)
(:import (java.io File)))
(declare v1beta1-daemon-set-upda... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1beta1_daemon_set_update_strategy.clj | clojure | (ns clojure-kubernetes-client.specs.v1beta1-daemon-set-update-strategy
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta1-rolling-update-daemon-set :refer :all]
)
(:import (java.io File)))
(declare v1beta1-daemon-set-upda... | |
45c16563c8f1889af95ea95a8ad6e36d3f90ac31b3f6ff1967c0c9142cf720ce | hasktorch/hasktorch | GEncoderOnly.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PartialTypeSignatures #
# LANGUAGE RecordWildCard... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/cf0ed1aba9c41123ba46f7c0788a4df10fbfe1ef/experimental/gradually-typed/src/Torch/GraduallyTyped/NN/Transformer/GEncoderOnly.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
| Data type that is used to represent whether the encoder-only transformer model has a scaled embedding.
| Generic encoder-only transformer model.
- @inputEmbedDim@: the dimension of the input embedding.
- @encoder@: a transformer encoder.
- @encoderEmbedding@: an... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Standalone... |
281e2285e1163b7a6d2aeac96fb6b164685a455557866a00744aba396536bf7f | merijn/Belewitte | BarPlot.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
module BarPlot
( BarPlotType(..)
, BarPlot(..)
, barPlot
) where
import Control.Monad (forM_)
import Control.Monad.Catch (handle)
... | null | https://raw.githubusercontent.com/merijn/Belewitte/566ad5b9a5a055578cf917d5a033b21314a9460f/benchmark-analysis/plot-src/BarPlot.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
module BarPlot
( BarPlotType(..)
, BarPlot(..)
, barPlot
) where
import Control.Monad (forM_)
import Control.Monad.Catch (handle)
import Data.Bifunctor (bimap, secon... |
ee898e4d80450992d84dd726c4bae74d5e9e843494a8ae6dae79023a9c7aecc0 | typeable/dom-parser | Main.hs | module Main where
import Control.Exception
import Control.Lens
import Control.Monad
import Data.Default
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.List.NonEmpty as NE
import Data.Monoid
import Data.Text (Text)
import Te... | null | https://raw.githubusercontent.com/typeable/dom-parser/7d556ba528bfa216e99714f8a0d4d00f452803a9/test/Main.hs | haskell | ^ Name of spec
^ Document to parse
^ Value checker, Nothing if all ok
^ Name of spec
^ Document to parse
^ Value parser should return
^ Name of spec
^ Expteced path in error | module Main where
import Control.Exception
import Control.Lens
import Control.Monad
import Data.Default
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.List.NonEmpty as NE
import Data.Monoid
import Data.Text (Text)
import Te... |
0f4194ef1654efb78da62454e8c25c9b42aacd31acc87edf1b4b7a0178d291b0 | tmattio/js-bindings | es2018_intl.mli | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem
[@@@ocaml.warning "-7-11-32-33-39"]
]
open Ts2ocaml_baselib
module Internal : sig
module AnonymousInterfaces : sig
type anonymous_interface_0 = [`anonymous_interface_0] intf
[@@js.custom { of_js=Obj.magic; to_js=Obj.magic }]
end
module Types : sig
... | null | https://raw.githubusercontent.com/tmattio/js-bindings/fe1d40a5b8cae157af85fa84ca482fb6b0ddf1e0/lib/es2018/_gen/es2018_intl.mli | ocaml | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem
[@@@ocaml.warning "-7-11-32-33-39"]
]
open Ts2ocaml_baselib
module Internal : sig
module AnonymousInterfaces : sig
type anonymous_interface_0 = [`anonymous_interface_0] intf
[@@js.custom { of_js=Obj.magic; to_js=Obj.magic }]
end
module Types : sig
... | |
5ede9a9a84a5b63e69d39984e00eed4337b96e651a9caa8dd9519903d89d889f | polyfy/polylith | exit_code.clj | (ns polylith.clj.core.command.exit-code)
(defn code [cmd {:keys [messages]} test-ok?]
(if (= "check" cmd)
(let [errors (filter #(= "error" (:type %)) messages)]
(condp = (count errors)
0 0
1 (-> errors first :code)
1))
(if test-ok?
0
1)))
| null | https://raw.githubusercontent.com/polyfy/polylith/35cc2b5e5721306bda6ccaaaf8e32b67b59af33a/components/command/src/polylith/clj/core/command/exit_code.clj | clojure | (ns polylith.clj.core.command.exit-code)
(defn code [cmd {:keys [messages]} test-ok?]
(if (= "check" cmd)
(let [errors (filter #(= "error" (:type %)) messages)]
(condp = (count errors)
0 0
1 (-> errors first :code)
1))
(if test-ok?
0
1)))
| |
ef8392ec5657946fc981065040a4cb8d203ca72b5e7887922bd93f5807b5e895 | input-output-hk/offchain-metadata-tools | Config.hs | module Config where
import Options.Applicative
import Cardano.Metadata.Store.Postgres.Config ( Opts, parseOpts )
opts :: ParserInfo Opts
opts =
info
( parseOpts )
( fullDesc
<> progDesc "Start the metadata web server"
<> header "metadata-server - a tool to serve off-chain metadata"
)
| null | https://raw.githubusercontent.com/input-output-hk/offchain-metadata-tools/794f08cedbf555e9d207bccc45c08abbcf98add9/metadata-server/src/Config.hs | haskell | module Config where
import Options.Applicative
import Cardano.Metadata.Store.Postgres.Config ( Opts, parseOpts )
opts :: ParserInfo Opts
opts =
info
( parseOpts )
( fullDesc
<> progDesc "Start the metadata web server"
<> header "metadata-server - a tool to serve off-chain metadata"
)
| |
463ab785f34e157b78b2f50afebff662f8c64e2d8795677b3ba11ba68bf739d5 | dktr0/MusicW | Synth.hs | module Sound.MusicW.Synth (
Synth(..),
playSynth,
playSynthNow,
nodeRefToNode,
synthDefToSynth,
synthDefToSynth_,
startSynth,
startSynthNow,
stopSynth,
stopSynthNow,
disconnectSynth,
restartSynth
) where
import Data.Foldable (find)
import Control.Monad (void)
import Control.Monad.IO.Class
im... | null | https://raw.githubusercontent.com/dktr0/MusicW/bc6ddf6306f7354a5b418496cc9e6853ece8bb53/src/Sound/MusicW/Synth.hs | haskell | TODO restarting a AudioBufferSourceNode needs to replace the buffers
connections to (deferred) destination
connections to ExternalNodeRef
*** Note: there is probably a bug connected to the definition of disconnectOnStop below:
it attaches an onended callback to a single source node from a list of nodes, which does... | module Sound.MusicW.Synth (
Synth(..),
playSynth,
playSynthNow,
nodeRefToNode,
synthDefToSynth,
synthDefToSynth_,
startSynth,
startSynthNow,
stopSynth,
stopSynthNow,
disconnectSynth,
restartSynth
) where
import Data.Foldable (find)
import Control.Monad (void)
import Control.Monad.IO.Class
im... |
a622e5a7ff41d8ce1cb842a48dc7bb23dc262560d7574b35c2194d085482d527 | scicloj/scicloj-data-science-handbook | 02_data_indexing_and_selection.clj | (ns scicloj.03-data-manipulation.02-data-indexing-and-selection
(:require [notespace.api :as notespace]
[notespace.kinds :as kind]
[clojure.java.io :as io]
[tablecloth.api :as tablecloth]
[tech.v3.dataset :as dataset]))
Notespace
^kind/hidden
(comment
;; Manually s... | null | https://raw.githubusercontent.com/scicloj/scicloj-data-science-handbook/a273216e774e6830918cdf991fbd7dd0bc3c675e/src/scicloj/03_data_manipulation/02_data_indexing_and_selection.clj | clojure | Manually start an empty notespace
Renders the notes and listens to file changes
Clear an existing notespace browser
Evaluating a whole notespace
generate static site
| :name | :area | :population |
|------------|-------:|------------:|
| Florida | 170312 | 19552860 |
| Illinois | 1499... | (ns scicloj.03-data-manipulation.02-data-indexing-and-selection
(:require [notespace.api :as notespace]
[notespace.kinds :as kind]
[clojure.java.io :as io]
[tablecloth.api :as tablecloth]
[tech.v3.dataset :as dataset]))
Notespace
^kind/hidden
(comment
(notespace/in... |
2c63b9539786aef9d01c2e94af9d9a133f2f5c8950bc61b323c50e37e5e05c36 | spurious/sagittarius-scheme-mirror | edit.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; win32/gui/edit - Win32 GUI edit control
;;;
Copyright ( c ) 2015 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Red... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/ext/ffi/win32/gui/edit.scm | scheme | coding : utf-8 ; -*-
win32/gui/edit - Win32 GUI edit control
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list ... | Copyright ( c ) 2015 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library (win32 gui edit)
(export <win32-edit>
... |
f0baba3f17e39115a7f511138c7633147a1f99de234a0526f7cd26bb767f2d9c | dhammikamare/Learn-OCaml | rotate.ml | Task : Define the function rotate x y theta that rotates a Cartesian point ( x , y ) about the origin by angle theta .
* To construct a pair of values as the result enclose them in parentheses , e.g. ( x , y ) .
*
* Author : | -marasinghe
* To construct a pair of values as the result enclose them in pa... | null | https://raw.githubusercontent.com/dhammikamare/Learn-OCaml/2d4e3da38ee86cd7477964ffb8756a8483260322/lab01%20Data%20Types%20and%20Functions/rotate.ml | ocaml | test
or
this code gives wrong results. if you found out what's wrong please share it with me :) | Task : Define the function rotate x y theta that rotates a Cartesian point ( x , y ) about the origin by angle theta .
* To construct a pair of values as the result enclose them in parentheses , e.g. ( x , y ) .
*
* Author : | -marasinghe
* To construct a pair of values as the result enclose them in pa... |
6cfb921ee1657e31c5e9216fbaf72863b7b62eb203a7b5e0be5236ff071db7f8 | ocsigen/ocsimore | common_sql.ml | (*-*-coding: utf-8;-*-*)
let (>>=) = Lwt.(>>=)
let lwt_map f l =
List.fold_right
(fun a l ->
f a >>= fun b ->
l >>= fun l ->
Lwt.return (b :: l))
l (Lwt.return [])
module PGOCaml = PGOCaml_generic.Make (struct include Lwt include Lwt_chan end)
let dbpool : (string, bool) Hashtbl.t PGO... | null | https://raw.githubusercontent.com/ocsigen/ocsimore/8eeaf043ed6f1f167a96cbdc5f72a5225d9516d5/src/announce/common_sql.ml | ocaml | -*-coding: utf-8;-*-
** |
let (>>=) = Lwt.(>>=)
let lwt_map f l =
List.fold_right
(fun a l ->
f a >>= fun b ->
l >>= fun l ->
Lwt.return (b :: l))
l (Lwt.return [])
module PGOCaml = PGOCaml_generic.Make (struct include Lwt include Lwt_chan end)
let dbpool : (string, bool) Hashtbl.t PGOCaml.t Lwt_pool.t =
Lwt... |
54717eadcfe73217e13e23bac04ed2c9c34c1a0d64ef219051f11f38ffcd5c78 | xmonad/xmonad-contrib | Email.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Email
Description : A prompt for sending quick , one - line emails , via GNU \'mail\ ' .
Copyright : ( c ) 2007
-- License : BSD-style (see LICENSE)
--
-- Maintainer : <>
-- Stability ... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/571d017b8259340971db1736eedc992a54e9022c/XMonad/Prompt/Email.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Prompt.Email
License : BSD-style (see LICENSE)
Maintainer : <>
Stability : stable
Portability : unportable
\'mail\' utility (which must be in your $PATH). This module is
intended mostly as an exampl... | Description : A prompt for sending quick , one - line emails , via GNU \'mail\ ' .
Copyright : ( c ) 2007
A prompt for sending quick , one - line emails , via the standard GNU
module XMonad.Prompt.Email (
emailPrompt
) where
import XMonad.Core
impo... |
c8c459a2e259490b30e3152ef9415f57de4f2e45d204c973289d3cebb991ef9f | lojic/LearningRacket | day09-1.rkt | #lang racket
(define (validate n lst)
(let ([ x (list-ref lst n) ])
(if (member x (map (curry apply +) (combinations (take lst n) 2))) #f x)))
(define (xmas n fname)
(let loop ([ lst (map string->number (file->lines fname)) ])
(or (validate n lst) (loop (cdr lst)))))
(module+ test
(require rackunit)
... | null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/advent-of-code-2020/day09-1.rkt | racket | #lang racket
(define (validate n lst)
(let ([ x (list-ref lst n) ])
(if (member x (map (curry apply +) (combinations (take lst n) 2))) #f x)))
(define (xmas n fname)
(let loop ([ lst (map string->number (file->lines fname)) ])
(or (validate n lst) (loop (cdr lst)))))
(module+ test
(require rackunit)
... | |
6041b536a371296719ca83ebba2f470c27139eb0dcc9e93b3de809c097ec93f6 | Bike/hominy | optimize.lisp | (in-package #:hominy)
(defun constant-type-p (type)
(and (typep type 'hominy/type:member)
(= (length (hominy/type:elements type)) 1)))
(defun constant-type-value (type)
(first (hominy/type:elements type)))
(defun constant-propagate-function (function)
(let ((module (hominy/ir:module function)))
(hom... | null | https://raw.githubusercontent.com/Bike/hominy/ee8bb886d26f9c04eadf978ddbf4141c687b0c74/flowc/optimize.lisp | lisp | ($sequence foo)
($sequence)
TODO: Self evaluating objects
constant "propagation" never actually adds information, as the actual
propagation is done by flow. so we do this last. | (in-package #:hominy)
(defun constant-type-p (type)
(and (typep type 'hominy/type:member)
(= (length (hominy/type:elements type)) 1)))
(defun constant-type-value (type)
(first (hominy/type:elements type)))
(defun constant-propagate-function (function)
(let ((module (hominy/ir:module function)))
(hom... |
6f9abf9cc628134120485a5b5e56da9396fa8afdd92f04928857bd2b63598652 | Decentralized-Pictures/T4L3NT | user_activated_upgrade.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/tezt/tests/user_activated_upgrade.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
1ea631faad3eb1a95f47d78c8e0af0b582241db256db96bd701c2d240a1af5e9 | reborg/clojure-essential-reference | 4.clj | (def clojure-javadoc
"/")
< 1 >
(ref {"clojure." clojure-javadoc})]
< 2 > | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/9a3eb82024c8e5fbe17412af541c2cd30820c92e/DynamicVariablesintheStandardLibrary/*feeling-lucky*%2C*local-javadocs*and*core-java-api*/4.clj | clojure | (def clojure-javadoc
"/")
< 1 >
(ref {"clojure." clojure-javadoc})]
< 2 > | |
37f00fe7076ba055f31a7afe39e2099ae549dc6a2917f6cda8337cf7ac208446 | sg2342/ocaml-rfc6287 | test_rfc6287.ml | open OUnit2
(* test vectors from "Appendix C. Test Vectors" of OCRA RFC *)
open Rfc6287
open Rresult
let key k =
let s = match k with
| `K20 -> "3132333435363738393031323334353637383930"
| `K32 -> "313233343536373839303132333435363738393031323" ^
"3343536373839303132"
| `K64 -> "313233343... | null | https://raw.githubusercontent.com/sg2342/ocaml-rfc6287/a32998fecd7b6109d88b79156b08d6d342fe714e/test/test_rfc6287.ml | ocaml | test vectors from "Appendix C. Test Vectors" of OCRA RFC | open OUnit2
open Rfc6287
open Rresult
let key k =
let s = match k with
| `K20 -> "3132333435363738393031323334353637383930"
| `K32 -> "313233343536373839303132333435363738393031323" ^
"3343536373839303132"
| `K64 -> "313233343536373839303132333435363738393031323" ^
"33435363... |
ffaef546a8a69fb277b20015f52f55c4d61c91060b06b841b7d12acd20e1e517 | racket/gui | actual-bigger.rkt | #lang racket/gui
(require "../aligned-editor-container.rkt" "../aligned-pasteboard.rkt"
"../snip-lib.rkt")
(define f (new frame% [label "test"] [width 200] [height 200]))
(define e (new text%))
(define c (new editor-canvas% [editor e] [parent f]))
(define vpb1 (new vertical-pasteboard%))
(define aes1 (new a... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mrlib/private/aligned-pasteboard/tests/actual-bigger.rkt | racket | #lang racket/gui
(require "../aligned-editor-container.rkt" "../aligned-pasteboard.rkt"
"../snip-lib.rkt")
(define f (new frame% [label "test"] [width 200] [height 200]))
(define e (new text%))
(define c (new editor-canvas% [editor e] [parent f]))
(define vpb1 (new vertical-pasteboard%))
(define aes1 (new a... | |
32f028b1bf45705d72e2812ba38b48d62f24335fd7fd5a12984e39be77d0d875 | lpeterse/haskell-terminal | MonadPrinter.hs | # LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module System.Terminal.MonadPrinter where
import Data.Text as T
import Prelude hiding (putChar)
| This class describes an environment that Unicode text can be printed to .
-- This might either be... | null | https://raw.githubusercontent.com/lpeterse/haskell-terminal/994602af65e7f038bc387139ec961248760fd6e6/src/System/Terminal/MonadPrinter.hs | haskell | This might either be file or a terminal.
* Instances shall implement the concept of lines and line width.
* Instances shall implement the concept of a carriage that can be
* It is assumed that the carriage automatically moves to the beginning
of the next line if the end of the current line is reac... | # LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module System.Terminal.MonadPrinter where
import Data.Text as T
import Prelude hiding (putChar)
| This class describes an environment that Unicode text can be printed to .
set to the beginni... |
e5466dd9c8a25bf22c18f0821582463b03e8e1c08a4fec2c75a17f6b463352a0 | imandra-ai/imandra-ros | tf_of_json.ml | open Json_utils;;
open Basic_types_of_json;;
open Ros_messages.Tf;;
let json_to_tfMessage_opt json =
jreq json "transforms" (jlist Geometry_msgs_of_json.json_to_transformStamped_opt) @@ fun transforms ->
Some {
transforms;
}
| null | https://raw.githubusercontent.com/imandra-ai/imandra-ros/e1380c267ee319dd4f86c4b54e0b270bc0738796/imandra_model/src-messages-pp/tf_of_json.ml | ocaml | open Json_utils;;
open Basic_types_of_json;;
open Ros_messages.Tf;;
let json_to_tfMessage_opt json =
jreq json "transforms" (jlist Geometry_msgs_of_json.json_to_transformStamped_opt) @@ fun transforms ->
Some {
transforms;
}
| |
404a0ac19d9c42c842800457843b2b1e40fe47e91a49f86f1bd2c650ec4dd18a | rjnw/sham | env.rkt | #lang racket
(provide (all-defined-out))
(struct sham-jit-env [senv ll-jit-env value-refs])
(struct sham-mcjit-env sham-jit-env [])
(struct sham-orc-env sham-jit-env [])
(struct sham-jit-value [uintptr rkt-value])
| null | https://raw.githubusercontent.com/rjnw/sham/6e0524b1eb01bcda83ae7a5be6339da4257c6781/sham-base/sham/jit/env.rkt | racket | #lang racket
(provide (all-defined-out))
(struct sham-jit-env [senv ll-jit-env value-refs])
(struct sham-mcjit-env sham-jit-env [])
(struct sham-orc-env sham-jit-env [])
(struct sham-jit-value [uintptr rkt-value])
| |
6a9a5eb46908c5a5097d5293c380518d59a67b1ee0e869e1f4a98a59f06930a4 | nd/bird | 1.4.6.hs | -- (*)x = (*x) -- true
-- (+)x = (x+) -- true
-- (-)x = (-x) -- false (-) x = g where g y = x - y
-- (-x) = g where g y = y - x | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch01/1.4.6.hs | haskell | (*)x = (*x) -- true
(+)x = (x+) -- true
(-)x = (-x) -- false (-) x = g where g y = x - y
(-x) = g where g y = y - x | |
d3598e1b4eaf91ab22f283a2f5a67f6e0601a8ee79612f1b8812c9ee192f6812 | mhuebert/chia | patterns.clj | (ns chia.db.patterns)
#_(defmacro capture-patterns
"Evaluates body, returning map with evaluation result and read patterns."
[& body]
`(binding [~'chia.db.patterns/*pattern-log* {}]
(let [{value# :value
tx-report# :tx-report} (~'chia.db.core/db-log (do ~@body))
patterns# ~... | null | https://raw.githubusercontent.com/mhuebert/chia/74ee3ee9f86efbdf81d8829ab4f0a44d619c73d3/db/src/chia/db/patterns.clj | clojure | (ns chia.db.patterns)
#_(defmacro capture-patterns
"Evaluates body, returning map with evaluation result and read patterns."
[& body]
`(binding [~'chia.db.patterns/*pattern-log* {}]
(let [{value# :value
tx-report# :tx-report} (~'chia.db.core/db-log (do ~@body))
patterns# ~... | |
1f5c8ec74c2ecc2977ee8acd60a486ad40833d3b5317b066d5443da13b8bbfff | mhuebert/re-db | viewers.cljc | (ns re-db.notebooks.tools.viewers
(:require [nextjournal.clerk #?(:clj :as :cljs :as-alias) clerk]))
;; TODO - put any necessary viewers in this ns
(defn add-viewers! []
) | null | https://raw.githubusercontent.com/mhuebert/re-db/0a1d0ad4557451c8943954b3b92e0cbc1e2fedab/src/notebooks/re_db/notebooks/tools/viewers.cljc | clojure | TODO - put any necessary viewers in this ns | (ns re-db.notebooks.tools.viewers
(:require [nextjournal.clerk #?(:clj :as :cljs :as-alias) clerk]))
(defn add-viewers! []
) |
88a44557673667dc6b447b8ff0c16ee0dd26cbe48b30cdffaf5a3b9d322a20d9 | racket/old-plt | coupling-and-binding.scm | ;; This library is used by match.ss
(define-values (couple-tests meta-couple subst-bindings)
(letrec
(
;;!(function couple-tests
;; (form (couple-tests test-list ks-func kf-func let-bound)
;; ->
;; ((list list) -> syntax))
;; (... | null | https://raw.githubusercontent.com/racket/old-plt/a580d75deae2a0d2f3d8a93bc3c4f8f1f619b5b7/collects/mzlib/private/plt-match/coupling-and-binding.scm | scheme | This library is used by match.ss
!(function couple-tests
(form (couple-tests test-list ks-func kf-func let-bound)
->
((list list) -> syntax))
(contract (list
((((list list) -> syntax) list) ->
((list list) -> syntax))
... |
(define-values (couple-tests meta-couple subst-bindings)
(letrec
(
(couple-tests
(lambda (test-list ks-func kf-func let-bound)
(if (null? test-list)
(ks-func (kf-func let-bound) let-bound)
(let ((cur-test (car test-list)))
(if (and (>= (test... |
a8d1fcd53634dc16e417bd4f33533b8c714a007a922d33fc27199c2e0e72a661 | dmitryvk/sbcl-win32-threads | vector.impure.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This software is in the public domain and is provided with
;;;;... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/tests/vector.impure.lisp | lisp | more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
some extra sanity checks | This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(cl:in-package "CL-USER")
test case from Utz - Uwe Haus
(defstruct some-struct
(a 0 :type integer))
(defun foo (m)
(declare (type (vector some-struct) m))
m)
(... |
213add8fb8216aaa8373f48b7fb4c9059baaf43285f244dfb0890fd9640dba8c | jonsterling/dreamtt | Core.mli | * { 1 Core language }
The representation of the core language is { i not } exposed . Instead , an
abstract type is provided of both core language types and core language
terms . Both terms and types support silent weakening : hence an element of
{ ! tp } or { ! tm } can be used in any scope .
... | null | https://raw.githubusercontent.com/jonsterling/dreamtt/aa30a57ca869e91a295e586773a892c6601b5ddb/core/Core.mli | ocaml | * The head of a type can be exposed in order to guide the elaborator. It is
(surprisingly) unnecessary to expose any more data of a type to the
elaborator.
* {1 Constructing well-typed terms}
* Every core language term carries has a unique type, and can hence be syn_rulethesized.
* The {i conversion rule} ap... | * { 1 Core language }
The representation of the core language is { i not } exposed . Instead , an
abstract type is provided of both core language types and core language
terms . Both terms and types support silent weakening : hence an element of
{ ! tp } or { ! tm } can be used in any scope .
... |
df0de7293cda9c6c6acde5fa4d5380dec8756bb9811f13c796b2ba6e9de394d1 | cloojure/tupelo | spec.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the Eclipse Public
; License 1.0 (-1.0.php) which can be found in the
; file epl-v10.html at the root of this distribution. By using this software in any
; fashion, you are agreeing to be bound by th... | null | https://raw.githubusercontent.com/cloojure/tupelo/dbb4b12fd6f379803a74a6bdcf54726597ec0fdf/test/clj/tst/tupelo/spec.clj | clojure | The use and distribution terms for this software are covered by the Eclipse Public
License 1.0 (-1.0.php) which can be found in the
file epl-v10.html at the root of this distribution. By using this software in any
fashion, you are agreeing to be bound by the terms of this license.
You must not remove th... | Copyright ( c ) . All rights reserved .
(ns tst.tupelo.spec
(:use tupelo.core tupelo.test)
(:require
[tupelo.core :as t] ))
(t/when-clojure-1-9-plus
(require
'[clojure.spec.alpha :as s]
'[clojure.spec.gen.alpha :as gen]
'[clojure.spec.test.alpha :as stest] )
(verify
(is (s/valid? ::t/... |
0592832f1d7d12aa136c06368dcd3ccf797bb4b0a2fb4f39fb00d8aeb459e299 | adamgundry/uom-plugin | Z.hs | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-}
# OPTIONS_GHC -fno - w... | null | https://raw.githubusercontent.com/adamgundry/uom-plugin/4091052c0369032aa8258a45e02d2c42bf2bcf46/uom-plugin/test-suite-units/Z.hs | haskell | # OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #
Inferring this type used to lead to unit equations with occur-check
failures, because it involves things like Pack (Unpack u) ~ u
The type signature is intentionally left off here to check that the
compiler can infer it.
z :: forall a (u :: Unit) (v :: Unit). (Fr... | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE QuasiQuotes #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Z (z, tests) where
... |
01239bab409103750db48357524fe83f11afbace9eb54cbffc0ddb38e05f000b | TheLortex/mirage-monorepo | ctypes.mli |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
* The core ctypes module .
... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ocaml-ctypes/src/ctypes/ctypes.mli | ocaml | * The type of pointer values. A value of type [('a, [`C]) pointer] contains
a C-compatible pointer, and a value of type [('a, [`OCaml]) pointer]
contains a pointer to a value that can be moved by OCaml runtime.
* The type of C-compatible pointer values. A value of type [t ptr] can be
used to read and writ... |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
* The core ctypes module .
... |
71940bdf435f650572dc9cbf322c8a0f188ef180af59175e09864ff458f614e2 | spechub/Hets | QBF.hs | |
Description : quantified Boolean logic
Copyright : ( c ) of Magdeburg
License : GPLv2 or higher , see LICENSE.txt
The " QBF " folder contains the skeleton of
an instance of " Logic . Logic " for quantified Boolean logic , see < > .
logic .
Description : quantified Boolean logic... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/QBF.hs | haskell | |
Description : quantified Boolean logic
Copyright : ( c ) of Magdeburg
License : GPLv2 or higher , see LICENSE.txt
The " QBF " folder contains the skeleton of
an instance of " Logic . Logic " for quantified Boolean logic , see < > .
logic .
Description : quantified Boolean logic... | |
67b1a833d56ff37a7553ca4e58614872e81029c743c064602a438794b85843c4 | facebook/pyre-check | fixpoint.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/10c375bea52db5d10b71cb5206fac7da9549eb0c/source/analysis/fixpoint.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
0585a39ed2794c9f46634155b9ce2bd58bb3727521bad705a324015f40b36e55 | takahisa/finale | parser_intf.ml |
* Copyright ( c ) 2017 - 2018 < > All rights reserved .
*
* 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 right... | null | https://raw.githubusercontent.com/takahisa/finale/8571cc152cc3d88be1d0be1c62112b4b960a9410/lib/parser_intf.ml | ocaml |
* Copyright ( c ) 2017 - 2018 < > All rights reserved .
*
* 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 right... | |
c89d7c39c65964159c8d9ad34f158f8d2031f8d41e8f0883faa47a87fed5befc | raviksharma/bartosz-basics-of-haskell | bindS.hs | data Operator = Plus | Minus
data Tree = UnaryNode Operator Tree
type SymTab = ()
-- show
type Evaluator a = SymTab -> (a, SymTab)
returnS :: a -> Evaluator a
returnS x = \symTab -> (x, symTab)
bindS :: Evaluator a
-> (a -> Evaluator b)
-> Evaluator b
bindS act k =
\symTab ->
let (x, symTab') ... | null | https://raw.githubusercontent.com/raviksharma/bartosz-basics-of-haskell/86d40d831f61415ef0022bff7fe7060ae6a23701/11-state-monad/bindS.hs | haskell | show | data Operator = Plus | Minus
data Tree = UnaryNode Operator Tree
type SymTab = ()
type Evaluator a = SymTab -> (a, SymTab)
returnS :: a -> Evaluator a
returnS x = \symTab -> (x, symTab)
bindS :: Evaluator a
-> (a -> Evaluator b)
-> Evaluator b
bindS act k =
\symTab ->
let (x, symTab') = act sy... |
31a47f0d3338bd8c881d69dd440f3883698e2c40b5a4f4019c42faaeb4c5f7d2 | RunOrg/RunOrg | sitesAPI.mli | (* © 2014 RunOrg *)
| null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/apiLib/sitesAPI.mli | ocaml | © 2014 RunOrg | |
d77f84ddf567261295d2ec9885c5583d94431efd7b0040d7af3303acafca9b3d | JHU-PL-Lab/jaylang | bcopy5.ml | let make_array n i = assert (0 <= i && i < n); 0
let update i n a x = a i; let a j = if i=j then x else a j in a
let rec bcopy_aux m src des i =
if i >= m
then ()
else bcopy_aux m src (update i m des (src i)) (i+1)
let main i n m =
let array1 = make_array n in
let array2 = make_array m in
if i=0 && n<=m t... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/benchmark/cases/mochi_origin/mochi/bcopy5.ml | ocaml | let make_array n i = assert (0 <= i && i < n); 0
let update i n a x = a i; let a j = if i=j then x else a j in a
let rec bcopy_aux m src des i =
if i >= m
then ()
else bcopy_aux m src (update i m des (src i)) (i+1)
let main i n m =
let array1 = make_array n in
let array2 = make_array m in
if i=0 && n<=m t... | |
c041ace921fc8b4fad9e67327a1bc443dad00704c38863ddfc2238c581216fef | eholk/elegant-weapons | print-c.scm | (library
(elegant-weapons print-c)
(export
indent-more
format-c
print-c
decl-fns
run-format
format-append
format-join
format-decl
format-stmt
format-expr
format-ident
format-type
format-args
format-call-args
format-arg
format-binop
format-relop
... | null | https://raw.githubusercontent.com/eholk/elegant-weapons/ce51432c614cdba5d2f12c7b5451af01095257a4/lib/elegant-weapons/print-c.scm | scheme | (display "Escaping string of length ")
(display (string-length s))
(newline) | (library
(elegant-weapons print-c)
(export
indent-more
format-c
print-c
decl-fns
run-format
format-append
format-join
format-decl
format-stmt
format-expr
format-ident
format-type
format-args
format-call-args
format-arg
format-binop
format-relop
... |
a865458fdfded18071b42abc20deacd7938016820a33309bae0a81f270898335 | kowainik/stan | Category.hs | |
Copyright : ( c ) 2020 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
_ _ Category _ _ — a type of ' . Inspection . Inspection ' .
Copyright: (c) 2020 Kowainik
SPDX-License-Identifier: MPL-2.0
Maintainer: Kowainik <>
__Category__ — a type of 'Stan.Inspection.Inspection'.
-}
module S... | null | https://raw.githubusercontent.com/kowainik/stan/da36eac741466fe6f46dc3e56fca7806f8b41816/src/Stan/Category.hs | haskell | * Data type
* Pretty printing
| A type of the inspection.
| Show 'Category' in a human-friendly format. | |
Copyright : ( c ) 2020 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
_ _ Category _ _ — a type of ' . Inspection . Inspection ' .
Copyright: (c) 2020 Kowainik
SPDX-License-Identifier: MPL-2.0
Maintainer: Kowainik <>
__Category__ — a type of 'Stan.Inspection.Inspection'.
-}
module S... |
82c2ee1fa12d508ad1dbddafb9e7894bbc16b8bb24cb9b566663c253d1149d41 | rjnw/sham | sham.rkt | #lang racket
(require sham/ir
sham/jit
sham/md
syntax/parse/define
(prefix-in ll- sham/llvm/ir))
(provide (all-defined-out))
(define bit-type i1)
(define primitive-true (ui1 1))
(define primitive-false (ui1 0))
(define test-function-type (ll-type-function #f ll-void))
(define (basi... | null | https://raw.githubusercontent.com/rjnw/sham/6e0524b1eb01bcda83ae7a5be6339da4257c6781/sham-examples/sham/cryptol/prelude/sham.rkt | racket | sequence
lazy sequences
length
ptr to internal values
starts at zero
(ll-type-pointer (ll-type-function ll-void* i64 #f (ll-type-pointer it))) ;; get value @ i, will force all values until i
; ptr to closure store of values
(define (lazy-seq-func-ptr s) (op-gep s (ui32 0) (ui32 3)))
(define (lazy-seq-clos-ptr ... | #lang racket
(require sham/ir
sham/jit
sham/md
syntax/parse/define
(prefix-in ll- sham/llvm/ir))
(provide (all-defined-out))
(define bit-type i1)
(define primitive-true (ui1 1))
(define primitive-false (ui1 0))
(define test-function-type (ll-type-function #f ll-void))
(define (basi... |
bee9d0c60f718230c58097e5f807e75eb38fcc78401471bb58dc5f11f1d75e2a | system-f/fp-course | AlternativeTest.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE NoImplicitPrelude #
module Test.AlternativeTest (
-- * Tests
test_Alternative
, optionalTest
, listTest
, parserTest
, manyTest
, someTest
, aconcatTest
-- * Runner
, test
) where
import Test.Framework (TestTree, testCase, te... | null | https://raw.githubusercontent.com/system-f/fp-course/73ab9a3192b621a7fe70e9ff523750aa2fc55732/src/Test/AlternativeTest.hs | haskell | * Tests
* Runner | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE NoImplicitPrelude #
module Test.AlternativeTest (
test_Alternative
, optionalTest
, listTest
, parserTest
, manyTest
, someTest
, aconcatTest
, test
) where
import Test.Framework (TestTree, testCase, testGroup, test, (@?=), testP... |
fe7d24c5a2055429dcbfa605c0aa3e07660c9062aacbe5ca42daefeac12dc45d | nikomatsakis/a-mir-formality | test-alias-subtyping.rkt | #lang racket
(require redex/reduction-semantics
"hook.rkt"
"../grammar.rkt"
"../user-ty.rkt"
"../../util.rkt"
"../../logic/instantiate.rkt"
)
(module+ test
(define-metafunction formality-ty
;; convenience for testing: write `(item T)` to reference the alias ... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/14c6a6946e9d2bd83d5fe4df8272be10ba65531d/racket-src/ty/test/test-alias-subtyping.rkt | racket | convenience for testing: write `(item T)` to reference the alias type `Item`
Just ignore well-formed rules, not interesting for testing subtyping
Define a trait `AlwaysImpl` that is implemented for all types
normalizes-to `Item<Vec<T>>` to `T`
not provable!
Given that `item(T) = i32` and `item(U) = i32`,
We cann... | #lang racket
(require redex/reduction-semantics
"hook.rkt"
"../grammar.rkt"
"../user-ty.rkt"
"../../util.rkt"
"../../logic/instantiate.rkt"
)
(module+ test
(define-metafunction formality-ty
item : UserTy -> AliasTy
[(item UserTy) (alias-ty Item ((user-t... |
8ec7d81f657f93941bf67cea4fc9a3e028215a2d89f567a998a4efab05712b3f | chef/chef-server | oc_chef_authz_SUITE.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
%% ex: ts=4 sw=4 et
@author < >
%%
Copyright 2013 - 2015 Chef , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compl... | null | https://raw.githubusercontent.com/chef/chef-server/6d31841ecd73d984d819244add7ad6ebac284323/src/oc_erchef/apps/oc_chef_authz/itest/oc_chef_authz_SUITE.erl | erlang | ex: ts=4 sw=4 et
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Note: this... | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
@author < >
Copyright 2013 - 2015 Chef , 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 i... |
9e9c02751d936aeb66c75f6c1a3b2f7fc54a089c3bf0f58eb9cad5dbbd70236f | agda/agda2hs | Test.hs | # LANGUAGE LambdaCase #
# LANGUAGE FlexibleInstances #
module Test where
import Numeric.Natural (Natural)
import Data.Monoid
data Exp v = Plus (Exp v) (Exp v)
| Lit Natural
| Var v
deriving (Show, Eq)
eval :: (a -> Natural) -> Exp a -> Natural
eval env (Plus a b) = eval env a +... | null | https://raw.githubusercontent.com/agda/agda2hs/d89cce7552998f8be0910934740cdc6e5b4b59dc/test/golden/Test.hs | haskell | comment
another comment
multi
line
comment
| # LANGUAGE LambdaCase #
# LANGUAGE FlexibleInstances #
module Test where
import Numeric.Natural (Natural)
import Data.Monoid
data Exp v = Plus (Exp v) (Exp v)
| Lit Natural
| Var v
deriving (Show, Eq)
eval :: (a -> Natural) -> Exp a -> Natural
eval env (Plus a b) = eval env a +... |
21f4b721d755c2d91e5d2145e1114784d06213942c0847701978764b3a1263ad | grin-compiler/ext-stg-interpreter-presentation-demos | RangedSet.hs | module Data.Ranged.RangedSet (
-- ** Ranged Set Type
RSet,
rSetRanges,
-- ** Ranged Set construction functions and their preconditions
makeRangedSet,
unsafeRangedSet,
validRangeList,
normaliseRangeList,
rSingleton,
rSetUnfold,
-- ** Predicates
rSetIsEmpty,
rSetIsFull,
(-?-), r... | null | https://raw.githubusercontent.com/grin-compiler/ext-stg-interpreter-presentation-demos/f4b1a3b3ab746146859a1512f910e9e62c62a0e6/demo-03-alex/alex-3.2.5/src/Data/Ranged/RangedSet.hs | haskell | ** Ranged Set Type
** Ranged Set construction functions and their preconditions
** Predicates
** Set Operations
** Useful Sets
| An RSet (for Ranged Set) is a list of ranges. The ranges must be sorted
and not overlap.
| Determine if the ranges in the list are both in order and non-overlapping.
| Rearrange and... | module Data.Ranged.RangedSet (
RSet,
rSetRanges,
makeRangedSet,
unsafeRangedSet,
validRangeList,
normaliseRangeList,
rSingleton,
rSetUnfold,
rSetIsEmpty,
rSetIsFull,
(-?-), rSetHas,
(-<=-), rSetIsSubset,
(-<-), rSetIsSubsetStrict,
(-\/-), rSetUnion,
(-/\-), rSetIntersectio... |
e4329b6fe5287161b191c4534ec11cfb101da6ffbc51cf98abf2f5ef331dbab7 | suhdonghwi/nuri | StmtSpec.hs | # LANGUAGE OverloadedLists #
module Nuri.Spec.Codegen.StmtSpec where
import qualified Data.Set.Ordered as S
import Haneul.Constant
import qualified Haneul.Instruction as Inst
import Nuri.Codegen.Stmt
import Nuri.Expr
import Nuri.Spec.Codegen.Util
import Nuri.Spec.Util
import Test.Hspec
spec :: Spec
spec = do
descr... | null | https://raw.githubusercontent.com/suhdonghwi/nuri/337550e3d50c290144df905ea3f189e9af6123c2/test/Nuri/Spec/Codegen/StmtSpec.hs | haskell | # LANGUAGE OverloadedLists #
module Nuri.Spec.Codegen.StmtSpec where
import qualified Data.Set.Ordered as S
import Haneul.Constant
import qualified Haneul.Instruction as Inst
import Nuri.Codegen.Stmt
import Nuri.Expr
import Nuri.Spec.Codegen.Util
import Nuri.Spec.Util
import Test.Hspec
spec :: Spec
spec = do
descr... | |
003747b96abdd94c6bf473cdd1fa8e6acddfdc2ec7f4515904545602c3990f35 | tolysz/ghcjs-stack | CopyFile.hs | # LANGUAGE CPP #
{-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.CopyFile (
copyFile,
copyFileChanged,
filesEqual,
copyOrdinaryFile,
copyExecutableFile,
setFileOrdinary,
setFileExecutable,
setDirOrdinary,
) where
import Distribution.Compat.Exception
import Distribution.Compat.Internal.TempFil... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/Cabal/Distribution/Compat/CopyFile.hs | haskell | # OPTIONS_HADDOCK hide #
file perms -rw-r--r--
file perms -rwxr-xr-x
| Copies a file to a new destination.
Often you should use `copyFileChanged` instead.
| Like `copyFile`, but does not touch the target if source and destination
are already byte-identical. This is recommended as it is useful for
time-stamp base... | # LANGUAGE CPP #
module Distribution.Compat.CopyFile (
copyFile,
copyFileChanged,
filesEqual,
copyOrdinaryFile,
copyExecutableFile,
setFileOrdinary,
setFileExecutable,
setDirOrdinary,
) where
import Distribution.Compat.Exception
import Distribution.Compat.Internal.TempFile
import Control.Monad
... |
4abb5768ee3add6c3d1e599a3ee9daeec5a6a585f3336b7ba489d301ee0411e4 | cachix/cachix | ByteString.hs | module Data.Conduit.ByteString where
import Conduit (MonadUnliftIO)
import qualified Data.ByteString as BS
import Data.ByteString.Internal (ByteString (PS), mallocByteString)
import Data.ByteString.Unsafe (unsafeIndex)
import Data.Conduit (ConduitT, await, yield, (.|))
import Foreign.ForeignPtr (ForeignPtr)
import For... | null | https://raw.githubusercontent.com/cachix/cachix/0dcbf2a6bb89b14248c955ab9d35bd6a3f8a4d42/cachix/src/Data/Conduit/ByteString.hs | haskell | # UNPACK # | module Data.Conduit.ByteString where
import Conduit (MonadUnliftIO)
import qualified Data.ByteString as BS
import Data.ByteString.Internal (ByteString (PS), mallocByteString)
import Data.ByteString.Unsafe (unsafeIndex)
import Data.Conduit (ConduitT, await, yield, (.|))
import Foreign.ForeignPtr (ForeignPtr)
import For... |
0552aacd8758661e95f076a202df2f7b0ad249245b6a201bbf2efef1939a08b4 | unison-code/uni-instr-sel | Generator.hs | |
Copyright : Copyright ( c ) 2012 - 2017 , < >
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <>
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Main authors:
Gabriel Hjort ... | null | https://raw.githubusercontent.com/unison-code/uni-instr-sel/2edb2f3399ea43e75f33706261bd6b93bedc6762/hlib/instr-sel/Language/InstrSel/TargetMachines/Generators/LLVM/Generator.hs | haskell | -----------
Functions
-----------
^ An error message or the generated target machine.
^ An error message or the generated instructions.
It is assumed that the value node for an immediate is
represented as a temporary here
It is assumed that the value node for an immediate is
represented as a temporary at this po... | |
Copyright : Copyright ( c ) 2012 - 2017 , < >
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <>
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Main authors:
Gabriel Hjort ... |
dea4627539246888b8eba6af128df8f229e6d93fc0c73a368b4aeb9192a0b1ee | cojna/iota | LogSpec.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE ViewPatterns #
module Math.Modulus.LogSpec (main, spec) where
import Math.Modulus (powMod)
import Math.Modulus.Log
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "logMod" $ do
it "logMod 3 27 998244353 = Just 3" $ do
logMod 3 ... | null | https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/test/Math/Modulus/LogSpec.hs | haskell | # LANGUAGE BangPatterns # | # LANGUAGE ViewPatterns #
module Math.Modulus.LogSpec (main, spec) where
import Math.Modulus (powMod)
import Math.Modulus.Log
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "logMod" $ do
it "logMod 3 27 998244353 = Just 3" $ do
logMod 3 27 998244353 `shouldBe` Just 3... |
fc7f0c3deca2fc33d61f07e7ededa16f981b13c70ece19b38b5eefa97a62859e | rtoy/ansi-cl-tests | maplist.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Apr 20 07:24:00 2003
Contains : Tests of MAPLIST
(in-package :cl-test)
(compile-and-load "cons-aux.lsp")
(deftest maplist.1
(maplist #'list nil)
nil)
(deftest maplist.2
(let* ((x (copy-list '(a b c)))
(xcopy (make-scaffold-copy x))
... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/maplist.lsp | lisp | -*- Mode: Lisp -*-
Error tests | Author :
Created : Sun Apr 20 07:24:00 2003
Contains : Tests of MAPLIST
(in-package :cl-test)
(compile-and-load "cons-aux.lsp")
(deftest maplist.1
(maplist #'list nil)
nil)
(deftest maplist.2
(let* ((x (copy-list '(a b c)))
(xcopy (make-scaffold-copy x))
(result (maplist #'ident... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.