_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 |
|---|---|---|---|---|---|---|---|---|
af9f1dfd397012b9ba42f6db826e970a281ef32a94f81b3a0e5621a587d127b6 | conscell/hugs-android | Lazy.hs | -----------------------------------------------------------------------------
-- |
Module : Control . . ST.Lazy
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portability : non-... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/base/Control/Monad/ST/Lazy.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : non-portable (requires universal quantification for runST)
except that the monad delays evaluation of state oper... | Module : Control . . ST.Lazy
Copyright : ( c ) The University of Glasgow 2001
This module presents an identical interface to " Control . Monad . ST " ,
module Control.Monad.ST.Lazy (
ST,
runST,
fixST,
strictToLazyST, lazyToStrictST,
RealWorld,
stToIO,
unsafeInterleaveST,
unsafeIOToST
... |
f227e4ec9d3fe9c0c802b3f48afaac38f58835f10b60542da305886e897dd411 | wireapp/wire-server | Cassandra.hs | module Brig.Effects.BlacklistPhonePrefixStore.Cassandra
( interpretBlacklistPhonePrefixStoreToCassandra,
)
where
import Brig.Effects.BlacklistPhonePrefixStore
import Brig.Types.Common
import Cassandra
import Imports
import Polysemy
import Wire.API.User.Identity
interpretBlacklistPhonePrefixStoreToCassandra ::
f... | null | https://raw.githubusercontent.com/wireapp/wire-server/e084f131c4fec095ee62d703d7a21638d89cbf24/services/brig/src/Brig/Effects/BlacklistPhonePrefixStore/Cassandra.hs | haskell | ------------------------------------------------------------------------------
Excluded phone prefixes | module Brig.Effects.BlacklistPhonePrefixStore.Cassandra
( interpretBlacklistPhonePrefixStoreToCassandra,
)
where
import Brig.Effects.BlacklistPhonePrefixStore
import Brig.Types.Common
import Cassandra
import Imports
import Polysemy
import Wire.API.User.Identity
interpretBlacklistPhonePrefixStoreToCassandra ::
f... |
3e62df1f8a76a7d00a9c0fa1929e5b906d04727ec5336561a04b951beea8bebb | slyrus/mcclim-old | port.lisp | ;;; -*- Mode: Lisp; Package: CLIM-CLX; -*-
( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000,2001 by
;;; Iban Hatchondo ()
( )
( )
;;; This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Backends/CLX/port.lisp | lisp | -*- Mode: Lisp; Package: CLIM-CLX; -*-
Iban Hatchondo ()
This library is free software; you can redistribute it and/or
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPO... |
( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000,2001 by
( )
( )
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public License for more details .
You should have r... |
7be84796531e333fc45fcb1edb4c3b46d9c9dbd1925b939f7ea2081ddee4189a | clojure-emacs/refactor-nrepl | middleware.clj | (ns refactor-nrepl.middleware
(:require
[cider.nrepl.middleware.util.cljs :as cljs]
[clojure.stacktrace :refer [print-cause-trace]]
[clojure.walk :as walk]
[refactor-nrepl.config :as config]
[refactor-nrepl.core :as core]
[refactor-nrepl.ns.libspec-allowlist :as libspec-allowlist]
[refactor-nrepl... | null | https://raw.githubusercontent.com/clojure-emacs/refactor-nrepl/74dada947f0f2e1775719eb3d8c0a96b837e65f0/src/refactor_nrepl/middleware.clj | clojure | Compatibility with the legacy tools.nrepl.
It is not recommended to use the legacy tools.nrepl,
therefore it is guarded with a system property.
Specifically, we don't want to require it by chance.
To prevent the bencode serializer in nrepl blowing up we manually
convert certain data types.
See refactor-nrepl#180... | (ns refactor-nrepl.middleware
(:require
[cider.nrepl.middleware.util.cljs :as cljs]
[clojure.stacktrace :refer [print-cause-trace]]
[clojure.walk :as walk]
[refactor-nrepl.config :as config]
[refactor-nrepl.core :as core]
[refactor-nrepl.ns.libspec-allowlist :as libspec-allowlist]
[refactor-nrepl... |
a3fc05b6b9ade9e6602cf5c3ad807e333d779c7d8b15eecab68067abed0ba461 | Incubaid/baardskeerder | flog.mli |
* This file is part of Baardskeerder .
*
* Copyright ( C ) 2012 Incubaid BVBA
*
* Baardskeerder is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , o... | null | https://raw.githubusercontent.com/Incubaid/baardskeerder/3975cb7f0e92e1f35eeab17beeb906344e43dae0/src/flog.mli | ocaml |
* This file is part of Baardskeerder .
*
* Copyright ( C ) 2012 Incubaid BVBA
*
* Baardskeerder is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , o... | |
47f9378fd918321729db65293871575444f9a555899008e01b46f445afe5e0e9 | gar1t/lambdapad | lpad_json.erl | Copyright 2014 < >
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% -2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
distribute... | null | https://raw.githubusercontent.com/gar1t/lambdapad/483b67694723923a82fc699aa37d580d035bd420/src/lpad_json.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright 2014 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(lpad_json).
-behavior(lpad_data_loader).
-export([load/1, handle_data_spec/2]).
load(File) ->
handle_json_file(file:read_file(File), Fil... |
ce69bdb837272b0418c0351b60c55fa471cc2319a42a5c4b43abc0b320bc9732 | Shimuuar/fixed-vector | Fixed.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs ... | null | https://raw.githubusercontent.com/Shimuuar/fixed-vector/cf731f17dc276ab35b2012f777d3fd49fc7b45e2/fixed-vector/Data/Vector/Fixed.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveTraversable #
# LANGUAGE FlexibleContexts #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeOperators #
|
G... | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances ... |
d4e583342c10b2e5bfd31bf713bc1f2ddf50b63628bb2668f352f16fb8b7cccb | onedata/op-worker | atm_workflow_execution_finish_tests.erl | %%%-------------------------------------------------------------------
@author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Tests concerning successfully fini... | null | https://raw.githubusercontent.com/onedata/op-worker/2c347ac8c1a3f7f9723d4b1825bd915df0f49dde/test_distributed/suites/automation/execution/atm_workflow_execution_finish_tests.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Tests concerning successfully finished automation workflow execution.
@end
-------------------------------------------------------------------
===========================... | @author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(atm_workflow_execution_finish_tests).
-author("Bartosz Walkowicz").
-include("atm_workflow_execution_test.hrl").
-include("modules/automation/atm_execution.hrl").
-export([
finish_atm_... |
3a527101ef4db8a7cc96f5d4200b142cdced63dd142348903f24c5b6857d54e9 | jorinvo/letsdo.events | settings.clj | (ns lde.core.settings
(:require [buddy.core.codecs :refer [bytes->str bytes->hex str->bytes]]
[buddy.core.codecs.base64 :as base64]
[buddy.core.nonce :as nonce]
[lde.core.db :as db]))
(defn get-cookie-secret [ctx]
(db/tx ctx
(if-let [secret (db/get-key ctx :settings/coo... | null | https://raw.githubusercontent.com/jorinvo/letsdo.events/4cd2a5d401d37524c0bac265f48923ab5f91b220/src/lde/core/settings.clj | clojure | (ns lde.core.settings
(:require [buddy.core.codecs :refer [bytes->str bytes->hex str->bytes]]
[buddy.core.codecs.base64 :as base64]
[buddy.core.nonce :as nonce]
[lde.core.db :as db]))
(defn get-cookie-secret [ctx]
(db/tx ctx
(if-let [secret (db/get-key ctx :settings/coo... | |
f1c8e350f7620b746d537282feceb1b12d5caf7f3958ed4606dd3ece9756fa78 | adamrk/scheme2luac | Spec.hs | import Assembler
import CodeGenerator
import Test.Hspec
import Test.QuickCheck
import System.Process
import System.FilePath
import System.Exit
import System.Directory
import qualified Data.Map as M
import Data.List (nub, sort, groupBy)
import Data.Char (isAlpha)
endVal :: String -> String
endVal s = let ls = lines s
... | null | https://raw.githubusercontent.com/adamrk/scheme2luac/5e64008b57a574c0afce72513363a176c7dcf299/test/Spec.hs | haskell | import Assembler
import CodeGenerator
import Test.Hspec
import Test.QuickCheck
import System.Process
import System.FilePath
import System.Exit
import System.Directory
import qualified Data.Map as M
import Data.List (nub, sort, groupBy)
import Data.Char (isAlpha)
endVal :: String -> String
endVal s = let ls = lines s
... | |
87f0b5b7268c06b58342edf8b6cfc068ee85d7cc2edffbd070816aee4722e555 | qiao/sicp-solutions | 3.48.scm | If a process want to acquire a2 , then it must acquire a1 first ,
and two processes can not acquire a1 at the same time , therefore ,
;; the deadlock is avoided.
(define (make-account number balance)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance account))
... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter3/3.48.scm | scheme | the deadlock is avoided. | If a process want to acquire a2 , then it must acquire a1 first ,
and two processes can not acquire a1 at the same time , therefore ,
(define (make-account number balance)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance account))
balance)
"Ins... |
5a0f46e86305eb13dfaee885bf4fef48eb79b3dbbba0fb85ec14fcc3d8f7986b | mbutterick/aoc-racket | star1.rkt | 4144
165,1,255,31,87,52,24,113,0,91,148,254,158,2,73,153 | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2017/d10/star1.rkt | racket | 4144
165,1,255,31,87,52,24,113,0,91,148,254,158,2,73,153 | |
a70964363318298f42a71c504ad2c9f239f9afc33194aec2c5df3a29b748269b | screenshotbot/screenshotbot-oss | test-store.lisp | ;;;; Copyright 2018-Present Modern Interpreters Inc.
;;;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(uiop:define-package :util/tests/test-store
(:use #:cl
#:fiveam
... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/d05cdcf1f180de4c4dd3f5f8f81aaae727e2a99d/src/util/tests/test-store.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
bad test that modifies global state
Ensure absolute | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(uiop:define-package :util/tests/test-store
(:use #:cl
#:fiveam
#:alexandria)
(:import-from #:util/store
... |
5e84fd87df2d7440937e595c4e7fc2b7e15cc32f95d73874dbff78b759b42134 | naproche/naproche | Verify.hs | -- |
Authors : ( 2001 - 2008 ) ,
( 2017 - 2018 ) ,
( 2021 - 2022 )
--
--Main verification loop.
module SAD.Core.Verify (verifyRoot) where
import Data.IORef (readIORef)
import Data.Maybe (isJust)
import Control.Monad.Reader
import Data.Text.Lazy qualified as Text
import SAD.Core.Base
im... | null | https://raw.githubusercontent.com/naproche/naproche/6284a64b4b84eaa53dd0eb7ecb39737fb9135a0d/src/SAD/Core/Verify.hs | haskell | |
Main verification loop.
| verify proof text (document root)
computational reasoning
statistics and user communication
For low-level blocks we check definitions and fortify terms (by supplying evidence).
in what follows we prepare the current block to contribute to the context,
extract rules, definitions and co... | Authors : ( 2001 - 2008 ) ,
( 2017 - 2018 ) ,
( 2021 - 2022 )
module SAD.Core.Verify (verifyRoot) where
import Data.IORef (readIORef)
import Data.Maybe (isJust)
import Control.Monad.Reader
import Data.Text.Lazy qualified as Text
import SAD.Core.Base
import SAD.Core.Check (fillDef)
impo... |
c4eaeedb8d6ecd014722ab01dfb50b3cbe71c02713d7a13bb702559a3ab30139 | lspitzner/brittany | Test490.hs | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
func = do
abc <- foo
abc
return ()
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test490.hs | haskell | brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } | func = do
abc <- foo
abc
return ()
|
4272adae3220c03e4b4fa4d044875d100bf087348878056abddb59861db304d7 | clojupyter/clojupyter | log.clj | (ns clojupyter.log
(:require [clojupyter.kernel.config :as cfg]
[clojure.pprint :as pp]
[clojure.string :as str]
[io.simplect.compose :refer [def- c C p P]]
[taoensso.timbre :as timbre]))
(defmacro debug
[& args]
`(timbre/debug ~@args))
(defmacro info
[& args]
... | null | https://raw.githubusercontent.com/clojupyter/clojupyter/742d64f26b60945075298a9f8d46e457f79266d7/src/clojupyter/log.clj | clojure | (ns clojupyter.log
(:require [clojupyter.kernel.config :as cfg]
[clojure.pprint :as pp]
[clojure.string :as str]
[io.simplect.compose :refer [def- c C p P]]
[taoensso.timbre :as timbre]))
(defmacro debug
[& args]
`(timbre/debug ~@args))
(defmacro info
[& args]
... | |
33cc3fd4c79c0691fda34b5b7051da92e54b5a94d2f319cfa6a0f1c2899c4fcf | janestreet/krb | conn_type.mli | open! Core
* Levels of Kerberos protection on the connection , in order of increasing strength :
{ ul
[ Auth ] : The client is authenticated to the server , but all information is sent in
plaintext afterward }
{ li [ Safe ] : The client is authenticated . Afterward all information is sent i... | null | https://raw.githubusercontent.com/janestreet/krb/e3f1bfde3610a742e4f5421321e5bd27f6987fc5/src/conn_type.mli | ocaml | * Find the strongest connection type supported by [us] and [peer], if any | open! Core
* Levels of Kerberos protection on the connection , in order of increasing strength :
{ ul
[ Auth ] : The client is authenticated to the server , but all information is sent in
plaintext afterward }
{ li [ Safe ] : The client is authenticated . Afterward all information is sent i... |
76c839e781ace61d8ebfdf56d089e285b13eb63ee9f2312499820a509a33b9ed | ptal/AbSolute | schedulable_abstract_domain.ml | Copyright 2019
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... | null | https://raw.githubusercontent.com/ptal/AbSolute/469159d87e3a717499573c1e187e5cfa1b569829/src/transformers/event_loop/schedulable_abstract_domain.ml | ocaml | * [exec_task t task] executes the `task` inside the abstract domain `t`.
It maps to `true` if the task is entailed, `false` otherwise.
Precondition:
- The UID of the task corresponds to the one of the abstract element.
- The task ID was obtained through `drain_tasks`.
* [drain_tasks t] retu... | Copyright 2019
This program is free software ; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... |
797d80cab17a9c9a4c7373166a74f8dced054e426c1da93e9b729817682013e3 | mbenke/zpf2012 | App4g.hs | # LANGUAGE ExplicitForAll , RankNTypes #
{-# LANGUAGE GADTs #-} -- for syntax only
module App4g where
import Data.Char(isDigit,digitToInt)
import Applicative
import Monoid
data Steps a where
Step :: Steps a -> Steps a
Fail :: Steps a
Done :: a -> Steps a
deriving Show
noAlts :: Steps a
noAlts = Fail
... | null | https://raw.githubusercontent.com/mbenke/zpf2012/faad6468f9400059de1c0735e12a84a2fdf24bb4/Code/Parse2/App4g.hs | haskell | # LANGUAGE GADTs #
for syntax only
best x@(Step _) (Done _) = x -- prefer longer parse
best (Done _) x@(Step _) = x
ambiguity
parse :: Ph a -> String -> String -> Either () a
(a->b) -> (forall r. (a -> String -> Steps r)
-> String -> Steps r)
-> (forall r h. (b -> String -> Steps r)... | # LANGUAGE ExplicitForAll , RankNTypes #
module App4g where
import Data.Char(isDigit,digitToInt)
import Applicative
import Monoid
data Steps a where
Step :: Steps a -> Steps a
Fail :: Steps a
Done :: a -> Steps a
deriving Show
noAlts :: Steps a
noAlts = Fail
best :: Steps a -> Steps a -> Steps a
best... |
f2aca1decbf8190c81b1f749c8c3fad79b93c79d02985ca47809251a3b15c2b9 | thierry-martinez/stdcompat | stdLabels.mli | module Array :
sig
external length : 'a array -> int = "%array_length"
external get : 'a array -> int -> 'a = "%array_safe_get"
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
external make : int -> 'a -> 'a array = "caml_make_vect"
external create : int -> 'a -> 'a array = "caml_make_vect"
... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/4.03/stdLabels.mli | ocaml | module Array :
sig
external length : 'a array -> int = "%array_length"
external get : 'a array -> int -> 'a = "%array_safe_get"
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
external make : int -> 'a -> 'a array = "caml_make_vect"
external create : int -> 'a -> 'a array = "caml_make_vect"
... | |
3848a9b7e2fcb4193a0a84ce8dd037c85509573a1c7c9237430e8956eb5e5a37 | fccm/glMLite | morph3d.ml | $ I d : morph3d.ml , v 1.2 2005/10/17 11:27:04 garrigue Exp $
open LablGL
open StdLabels
open Printf
-
* morph3d.c - Shows 3D morphing objects ( TK Version )
*
* This program was inspired on a WindowsNT(R ) 's screen saver . It was written
* from scratch and it was not based on any other source code .
... | null | https://raw.githubusercontent.com/fccm/glMLite/c52cd806909581e49d9b660195576c8a932f6d33/LablGL/lablGL_samples/morph3d.ml | ocaml | Increasing this values produces better image quality, the price is speed.
Very low values produces erroneous/incorrect plotting
***********************************************************************
return
escape
"[RETURN] - Toggle smooth/flat shading\n";
not working ... ??? | $ I d : morph3d.ml , v 1.2 2005/10/17 11:27:04 garrigue Exp $
open LablGL
open StdLabels
open Printf
-
* morph3d.c - Shows 3D morphing objects ( TK Version )
*
* This program was inspired on a WindowsNT(R ) 's screen saver . It was written
* from scratch and it was not based on any other source code .
... |
3563f78262a31783164989d4eac6668bf89543c4a296c25f18dbd94133803f95 | ceramic/ceramic | misc.lisp | (in-package :cl-user)
(defpackage ceramic-test.misc
(:use :cl :fiveam)
(:export :misc))
(in-package :ceramic-test.misc)
(def-suite misc
:description "Miscellaneous tests.")
(in-suite misc)
(test runtime
(let ((ceramic.runtime:*releasep* t))
(is
(pathnamep (ceramic.runtime:executable-pathname)))
(... | null | https://raw.githubusercontent.com/ceramic/ceramic/5d81e2bd954440a6adebde31fac9c730a698c74b/t/misc.lisp | lisp | (in-package :cl-user)
(defpackage ceramic-test.misc
(:use :cl :fiveam)
(:export :misc))
(in-package :ceramic-test.misc)
(def-suite misc
:description "Miscellaneous tests.")
(in-suite misc)
(test runtime
(let ((ceramic.runtime:*releasep* t))
(is
(pathnamep (ceramic.runtime:executable-pathname)))
(... | |
b0164c1bac668d60b0611c1b9b36a6608c02255359c347ef40efc2e60516eb8f | input-output-hk/marlowe-cardano | ViaSerialise.hs | # LANGUAGE ImportQualifiedPost #
module Data.Aeson.ViaSerialise
where
import qualified Codec.CBOR.Write as CBOR.Write
import Codec.Serialise (Serialise, decode, deserialiseOrFail, encode)
import qualified Data.Aeson as Aeson
import Data.ByteString.Base16.Aeson as Base16.Aeson
import qualified Data.ByteString.Lazy a... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/78a3dbb1cd692146b7d1a32e1e66faed884f2432/libs/aeson-via-serialise/src/Data/Aeson/ViaSerialise.hs | haskell | # LANGUAGE ImportQualifiedPost #
module Data.Aeson.ViaSerialise
where
import qualified Codec.CBOR.Write as CBOR.Write
import Codec.Serialise (Serialise, decode, deserialiseOrFail, encode)
import qualified Data.Aeson as Aeson
import Data.ByteString.Base16.Aeson as Base16.Aeson
import qualified Data.ByteString.Lazy a... | |
c36629d7d84560b94091c8248e186b65913166d8840943361c64b1856313b321 | lambduli/minilog | Token.hs | module Token where
data Token = Atom String
| Var String
| If
| Comma
| Period
| Paren'Open
| Paren'Close
| Underscore
| Equal
| EOF
deriving (Eq, Show)
| null | https://raw.githubusercontent.com/lambduli/minilog/a1b9d7fabba0b38db4707295fe6ca3efa6785c57/src/Token.hs | haskell | module Token where
data Token = Atom String
| Var String
| If
| Comma
| Period
| Paren'Open
| Paren'Close
| Underscore
| Equal
| EOF
deriving (Eq, Show)
| |
168857a6d7dbf3a5c518970cbaa7475f5a1cb5a95d907a1c65d2edbd47c1536f | input-output-hk/cardano-base | Vectors.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Test.Crypto.Vector.Vectors
( defaultSKey,
defaultMessage,
signAndVerifyTestVectors,
wrongEcdsaVerKeyTestVector,
wrongSchnorrVerKeyTestVector,
wrongLengthMessageHashTestVectors,
ecdsaVerKeyAndSi... | null | https://raw.githubusercontent.com/input-output-hk/cardano-base/b403b76ba1f70df1a6c9f861591d9e2a332abb13/cardano-crypto-tests/src/Test/Crypto/Vector/Vectors.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
Wrong length message hash are used to test ecdsa toMessageHash function
Raw string verification key that is not on the curve should result in ver key parse failed
wrong verify message but right signature
right verify message but wrong signature
wrong verify me... | # LANGUAGE FlexibleContexts #
module Test.Crypto.Vector.Vectors
( defaultSKey,
defaultMessage,
signAndVerifyTestVectors,
wrongEcdsaVerKeyTestVector,
wrongSchnorrVerKeyTestVector,
wrongLengthMessageHashTestVectors,
ecdsaVerKeyAndSigVerifyTestVectors,
schnorrVerKeyAndSigVerifyTestVectors,
... |
9e705531192cbbc29df5a6d6e93895e5a033a187c6d63d1f036638cdad3eb47a | Helium4Haskell/Top | Classes.hs | -----------------------------------------------------------------------------
-- | License : GPL
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Type classes and the standard reduction instances. A part of the code
was taken from the paper " Typing Haskell in Haske... | null | https://raw.githubusercontent.com/Helium4Haskell/Top/5e900184d6b2ab6d7ce69945287d782252e5ea68/src/Top/Types/Classes.hs | haskell | ---------------------------------------------------------------------------
| License : GPL
Maintainer :
Stability : provisional
Portability : portable
Type classes and the standard reduction instances. A part of the code
-------------------------------------------------------------------... | was taken from the paper " Typing Haskell in Haskell " .
module Top.Types.Classes where
import Top.Types.Primitive
import Top.Types.Substitution
import Top.Types.Unification
import Top.Types.Synonym
import Top.Types.Qualification
import Control.Monad
import qualified Data.Map as M
type Predicates = [Predicate]
da... |
a447770b8bd4e83d540c1eb0ee77d6cae2eac60206692de07781203b495cb184 | nuttycom/aftok | PaymentsSpec.hs | {-# OPTIONS_GHC -Wwarn -fno-warn-orphans #-}
module Aftok.PaymentsSpec
( main,
spec,
)
where
import Test.Hspec
spec :: Spec
spec = do
describe "finding unbilled dates" $ do
pure ()
--it "returns the billing date in the presence of an expired payment request" $
-- forAll ((,) <$> genSatoshi <*> listOf... | null | https://raw.githubusercontent.com/nuttycom/aftok/54e7812859054a4b59fb802a1996ffb4de6c9bed/test/Aftok/PaymentsSpec.hs | haskell | # OPTIONS_GHC -Wwarn -fno-warn-orphans #
it "returns the billing date in the presence of an expired payment request" $
forAll ((,) <$> genSatoshi <*> listOf genBid) $
\(raiseAmount', bids) ->
WinningBids xs -> bidsTotal xs == raiseAmount' |
module Aftok.PaymentsSpec
( main,
spec,
)
where
import Test.Hspec
spec :: Spec
spec = do
describe "finding unbilled dates" $ do
pure ()
case ' raiseAmount ' bids of
InsufficientBids t - > t = = ( raiseAmount ' - bidsTotal bids )
main :: IO ()
main = hspec spec
|
69299ad023d3d326afcca0c69de01706801fde495d3a8add4dad55551db71cc4 | rafaeldelboni/nota | pagination.cljs | (ns nota.ui.posts.pagination
(:require [com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.data-fetch :as df]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.mutations :as m]
[com.fulcrologic.fulcro.routing.dynamic-routing :a... | null | https://raw.githubusercontent.com/rafaeldelboni/nota/9ef882bb493d1cec67b6232fd31d7dd69ff807b9/src/nota/ui/posts/pagination.cljs | clojure | (ns nota.ui.posts.pagination
(:require [com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.data-fetch :as df]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.mutations :as m]
[com.fulcrologic.fulcro.routing.dynamic-routing :a... | |
e421c91b064c581380da1b81a36d464667d59d223a129c6069d38c7c8dd3efa8 | input-output-hk/marlowe-cardano | Gen.hs | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Language.Marlowe.Runtime.Core.Gen
where
import Data.Foldable (Foldable(fold))
import qualified Language.Marlowe.Core.V1.Semantics as V1
import Language.Marlowe.Runtime.ChainSync.Gen ()
import Language.Marlowe.Runtime.Core.Api... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/3d7d6381baca1b827ffaa519f130c5ad17a5f318/marlowe-runtime/gen/Language/Marlowe/Runtime/Core/Gen.hs | haskell | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Language.Marlowe.Runtime.Core.Gen
where
import Data.Foldable (Foldable(fold))
import qualified Language.Marlowe.Core.V1.Semantics as V1
import Language.Marlowe.Runtime.ChainSync.Gen ()
import Language.Marlowe.Runtime.Core.Api... | |
dd9dd8d6636282c07cd352c2a1e7d5680adc39a7dd5c06e520b3eb65b58b6759 | racket/compatibility | defmacro.rkt | #lang racket/base
;; defmacro - for legacy macros only
(require (for-syntax racket/base syntax/stx))
(provide define-macro
defmacro)
(define-syntax define-macro
(lambda (stx)
(syntax-case stx ()
[(_ (name . args) proc0 proc ...)
(begin
(unless (identifier? (syntax name))
... | null | https://raw.githubusercontent.com/racket/compatibility/492030dac6f095045ce8a13dca75204dd5f34e32/compatibility-lib/compatibility/defmacro.rkt | racket | defmacro - for legacy macros only
helper submodule
defined as a submodule because swindle requires it
`dm-syntax->datum' is like syntax-object->datum, but it also
builds a hash table that maps generated data to original syntax
objects. The hash table can then be used with `dm-subst' to
replace each re-used, unm... | #lang racket/base
(require (for-syntax racket/base syntax/stx))
(provide define-macro
defmacro)
(define-syntax define-macro
(lambda (stx)
(syntax-case stx ()
[(_ (name . args) proc0 proc ...)
(begin
(unless (identifier? (syntax name))
(raise-syntax-error
#... |
4d3a3a34c0e3f224ad710d835704b7b89003bdad8114392d192092e767eb10c2 | alevy/postgresql-orm | migration.hs | {-# LANGUAGE OverloadedStrings #-}
import Database.PostgreSQL.Migrations
import Database.PostgreSQL.Simple
up :: Connection -> IO ()
up = migrate $
error "Not implemented"
down :: Connection -> IO ()
down = migrate $ do
error "Not implemented"
main :: IO ()
main = defaultMain up down
| null | https://raw.githubusercontent.com/alevy/postgresql-orm/9316db2f226c512036c2b72983020f6bdefd41bd/static/migration.hs | haskell | # LANGUAGE OverloadedStrings # | import Database.PostgreSQL.Migrations
import Database.PostgreSQL.Simple
up :: Connection -> IO ()
up = migrate $
error "Not implemented"
down :: Connection -> IO ()
down = migrate $ do
error "Not implemented"
main :: IO ()
main = defaultMain up down
|
07262b2a5e7bb5e386168f0610f5e914224351a8a4f596ca2c0ee181daf1d602 | alasconnect/auth0 | GetToken.hs | module Auth0.Authentication.GetToken where
--------------------------------------------------------------------------------
import Data.Aeson
import Data.Proxy
import Data.Text
import GHC.Generics
import Servant.API
import Servant.Client
--------------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/alasconnect/auth0/6e868552885729487e60a2dfe6073f485b505651/src/Auth0/Authentication/GetToken.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
POS... | module Auth0.Authentication.GetToken where
import Data.Aeson
import Data.Proxy
import Data.Text
import GHC.Generics
import Servant.API
import Servant.Client
import Auth0.Types
data GetTokenResponse
= GetTokenResponse
{ accessToken :: AccessToken
, refreshToken :: Maybe Text
, idToken :: Maybe Text
, t... |
88e14ccb451dbb5a15ec0e164b7ffc3fa91940b44d387a2aa8b62c55ea2c1329 | rethab/h-gpgme | KeyGenTest.hs | {-# LANGUAGE OverloadedStrings #-}
module KeyGenTest (tests) where
import Test.Tasty (TestTree)
import Test.Tasty.HUnit (testCase)
import Test.HUnit
import Text.Email.Validate
import System.FilePath ((</>))
import System.Directory ( removeDirectoryRecursive )
import System.IO ( hPutStr
... | null | https://raw.githubusercontent.com/rethab/h-gpgme/2067468bec84601a8f6fcdb79bd180a4713c0b3c/test/KeyGenTest.hs | haskell | # LANGUAGE OverloadedStrings #
For getting values from Either
Test parameter list generation for generating keys
G.defaultGenKeyParams
Cleanup temporary directory
Setup context
Setup generation parameters
Setup callback which writes to temporary file.
Run key generation
Make sure the file has some evidence of ... | module KeyGenTest (tests) where
import Test.Tasty (TestTree)
import Test.Tasty.HUnit (testCase)
import Test.HUnit
import Text.Email.Validate
import System.FilePath ((</>))
import System.Directory ( removeDirectoryRecursive )
import System.IO ( hPutStr
, hPutStrLn
... |
555f8bcd25257580c849f8aff6472dbf7e37a15c638183db6aabd284beda1c78 | LesBoloss-es/sorting | arrays.ml | open Genlib.Genarray
open Table
open Sorting_array
let spf = Format.sprintf
let usage_msg = spf "%s [OPTION ...]\n\nOPTION can be:" Sys.argv.(0)
let default_lengths = List.init 5 (fun i -> (i+ 1) * 30000)
let lengths = ref default_lengths
let set_lengths s =
s
|> String.split_on_char ','
|> List.map int_of_st... | null | https://raw.githubusercontent.com/LesBoloss-es/sorting/1ef7f02d06b4a3e51ac488ce69808921819ff17e/bench/arrays.ml | ocaml | open Genlib.Genarray
open Table
open Sorting_array
let spf = Format.sprintf
let usage_msg = spf "%s [OPTION ...]\n\nOPTION can be:" Sys.argv.(0)
let default_lengths = List.init 5 (fun i -> (i+ 1) * 30000)
let lengths = ref default_lengths
let set_lengths s =
s
|> String.split_on_char ','
|> List.map int_of_st... | |
d32aee3387abbf717a6e224f86672dbec7e7b004dc2f86cbd9cfd00ca8dd8c95 | puppetlabs/clj-http-client | sync_plaintext_test.clj | (ns puppetlabs.http.client.sync-plaintext-test
(:import (com.puppetlabs.http.client Sync RequestOptions SimpleRequestOptions
ResponseBodyType ClientOptions
HttpClientException)
(java.io ByteArrayInputStream InputStream)
... | null | https://raw.githubusercontent.com/puppetlabs/clj-http-client/93b0264446f5bf70a575912f574f9dec77a58bf8/test/puppetlabs/http/client/sync_plaintext_test.clj | clojure | (ns puppetlabs.http.client.sync-plaintext-test
(:import (com.puppetlabs.http.client Sync RequestOptions SimpleRequestOptions
ResponseBodyType ClientOptions
HttpClientException)
(java.io ByteArrayInputStream InputStream)
... | |
430cc11edd5a2c9fb4ead5bddce2e8ef232daec162c8dadeb52bc9052984c205 | na4zagin3/satyrographos | command_opam_install__doc.ml | module StdList = List
open Satyrographos_testlib
open TestLib
open Shexp_process
let satyristes =
{|
(version "0.0.2")
(library
(name "grcnum")
(version "0.2")
(sources
((package "grcnum.satyh" "./grcnum.satyh")
(font "grcnum-font.ttf" "./font.ttf")
(hash "fonts.satysfi-hash" "./fonts.satysfi-has... | null | https://raw.githubusercontent.com/na4zagin3/satyrographos/9dbccf05138510c977a67c859bbbb48755470c7f/test/testcases/command_opam_install__doc.ml | ocaml | module StdList = List
open Satyrographos_testlib
open TestLib
open Shexp_process
let satyristes =
{|
(version "0.0.2")
(library
(name "grcnum")
(version "0.2")
(sources
((package "grcnum.satyh" "./grcnum.satyh")
(font "grcnum-font.ttf" "./font.ttf")
(hash "fonts.satysfi-hash" "./fonts.satysfi-has... | |
13a7f6520a4c11304e608c2ea41ed8af450edcf2c99d252c80707c69ed515d38 | fortytools/holumbus | Index.hs | -- ----------------------------------------------------------------------------
|
Module : . Build . Crawl
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Indexer functions
... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/searchengine/source/Holumbus/Build/Index.hs | haskell | ----------------------------------------------------------------------------
-----------------------------------------------------------------------------
# OPTIONS -XFlexibleContexts #
-----------------------------------------------------------------------------
* Building indexes
* Indexer Configuration
import ... |
|
Module : . Build . Crawl
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Indexer functions
Module : Holumbus.Build.Crawl
Copyright : Copyright (C) 2008 Sebastian ... |
bb683723e1931151f2b20b429a5ea9ce0e9715f2d394b7f26d2b9c65825c4da8 | kpblc2000/KpblcLispLib | _kpblc-conv-value-color-to-int.lsp | (defun _kpblc-conv-value-color-to-int (color)
;|
* Ôóíêöèÿ ïðåîáðàçîâàíèÿ ïåðåäàííîãî çíà÷åíèÿ öâåòà â integer äëÿ
* óñòàíîâêè öâåòîâ.
* Ïàðàìåòðû âûçîâà:
îáðàáàòûâàåìûé öâåò . nil - > " "
|;
(cond ((not color) (_kpblc-conv-value-color-to-int "bylayer"))
... | null | https://raw.githubusercontent.com/kpblc2000/KpblcLispLib/49d1d9d29078b4167cc65dc881bea61b706c620d/lsp/conv/value/_kpblc-conv-value-color-to-int.lsp | lisp | |
_ end of cond
_ end of cond
_ end of defun
| (defun _kpblc-conv-value-color-to-int (color)
* Ôóíêöèÿ ïðåîáðàçîâàíèÿ ïåðåäàííîãî çíà÷åíèÿ öâåòà â integer äëÿ
* óñòàíîâêè öâåòîâ.
* Ïàðàìåòðû âûçîâà:
îáðàáàòûâàåìûé öâåò . nil - > " "
(cond ((not color) (_kpblc-conv-value-color-to-int "bylayer"))
((= (type color) 'str)
(cond ... |
74b49913c81590a12440f73bd66382cb9c37e4981e3de29be1ef668db319bb9f | flybot-sg/lasagna-pull | options.clj | ;;# Introduction to options
(ns options
(:require [sg.flybot.pullable :as pull]))
In addition to basic query , Lasagna - pull support pattern options , it is a decorator
;; on the key part of a pattern, let you fine tune the query.
;; An option is a pair, a keyword followed by its arguments.
;;## General options
;... | null | https://raw.githubusercontent.com/flybot-sg/lasagna-pull/fc7fe7defdbdec07730f87cbd72593cd59bd5ac2/notebook/options.clj | clojure | # Introduction to options
on the key part of a pattern, let you fine tune the query.
An option is a pair, a keyword followed by its arguments.
## General options
These options does not require a value in a specific type.
The easiest option is `:not-found`, it provides a default value if a value is not
found.
`:wh... | (ns options
(:require [sg.flybot.pullable :as pull]))
In addition to basic query , Lasagna - pull support pattern options , it is a decorator
# # # ` : not - found ` option
(-> (pull/run-query '{(:a :not-found 0) ?a} {:b 3}) (pull/lvar-val '?a))
# # # ` : when ` option
(def q (pull/query {(list :a :when odd?) ... |
c3cf844136c30911ea02d2b0ade1a7227409874b7712c1235a675eb4a596827f | elastic/eui-cljs | markdown_editor.cljs | (ns eui.markdown-editor
(:require ["@elastic/eui/lib/components/markdown_editor/markdown_editor.js" :as eui]))
(def EuiMarkdownEditor eui/EuiMarkdownEditor)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/markdown_editor.cljs | clojure | (ns eui.markdown-editor
(:require ["@elastic/eui/lib/components/markdown_editor/markdown_editor.js" :as eui]))
(def EuiMarkdownEditor eui/EuiMarkdownEditor)
| |
0b19c1a25d40a0370cd1e3e4ddc01a03579533775173933762660fc94a8140ff | exercism/clojure | project.clj | (defproject yacht "0.1.0-SNAPSHOT"
:description "yacht exercise."
:url ""
:dependencies [[org.clojure/clojure "1.10.0"]])
| null | https://raw.githubusercontent.com/exercism/clojure/0195fb9faef084ae4bce38d955d46be0c0322196/exercises/practice/yacht/project.clj | clojure | (defproject yacht "0.1.0-SNAPSHOT"
:description "yacht exercise."
:url ""
:dependencies [[org.clojure/clojure "1.10.0"]])
| |
42ea80e667291790ff7b24e1cccfe956f5bf536b93220b68daa14b240b4a332c | janestreet/sexp | utils.mli | open! Core
val simple_query : Syntax.Query.t -> Sexp.t -> Sexp.t list
(** [ get_fields sexp field ] searches for field recursively *)
val get_fields : Sexp.t -> string -> Sexp.t list
* [ get_one_field sexp field ] searches for field recursively and returns the value ,
or error if there is not exactly one resul... | null | https://raw.githubusercontent.com/janestreet/sexp/56e485b3cbf8a43e1a8d7647b0df31b27053febf/sexp_app/src/utils.mli | ocaml | * [ get_fields sexp field ] searches for field recursively
* [ get_immediate_fields sexp ] returns an association list of field names to
field values, or error if the sexp does not conform to the normal structure of an
ocaml record.
* [ to_record_sexp by_field ] converts an association list of field names to
... | open! Core
val simple_query : Syntax.Query.t -> Sexp.t -> Sexp.t list
val get_fields : Sexp.t -> string -> Sexp.t list
* [ get_one_field sexp field ] searches for field recursively and returns the value ,
or error if there is not exactly one result .
or error if there is not exactly one result. *)
val get_... |
3e1879d83c96ffd232e138fdf931205bc60d6a65b67170f2473a834a8302e05a | kovasb/gamma | insert_declarations.cljs | (ns gamma.compiler.insert-declarations
(:use [gamma.ast :only [id? gen-term-id]]
[gamma.compiler.common :only [get-element map-path assoc-in-location assoc-elements]]
[gamma.compiler.core :only [transform]])
)
(defn walk [db pre]
(transform
db
(fn walk-fn [db path]
[(pre db path)... | null | https://raw.githubusercontent.com/kovasb/gamma/3c9edcfdfc392103b0e78edba3ca930a60746fd1/src/gamma/compiler/insert_declarations.cljs | clojure | (ns gamma.compiler.insert-declarations
(:use [gamma.ast :only [id? gen-term-id]]
[gamma.compiler.common :only [get-element map-path assoc-in-location assoc-elements]]
[gamma.compiler.core :only [transform]])
)
(defn walk [db pre]
(transform
db
(fn walk-fn [db path]
[(pre db path)... | |
66b097caf7e6e22d604f28f6dec4cccdc3af67144c385ed277d3ea81915da857 | awslabs/s2n-bignum | bignum_add.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/bignum_add.ml | ocaml | =========================================================================
Addition of bignums.
=========================================================================
XOR (% r10) (% r10)
SUB (% rdi) (% rdx)
INC (% rdx)
TEST (% r8) (% r8)
INC (% r10) ... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
* * * print_literal_from_elf " x86 / generic / " ; ;
* * *
***... |
a937dbbae282a9f4f3766c5d7f434ee4adc5900c71b10234aff14c4540bd2caf | mbj/stratosphere | ServerSideEncryptionConfigurationProperty.hs | module Stratosphere.Wisdom.KnowledgeBase.ServerSideEncryptionConfigurationProperty (
ServerSideEncryptionConfigurationProperty(..),
mkServerSideEncryptionConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
im... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wisdom/gen/Stratosphere/Wisdom/KnowledgeBase/ServerSideEncryptionConfigurationProperty.hs | haskell | module Stratosphere.Wisdom.KnowledgeBase.ServerSideEncryptionConfigurationProperty (
ServerSideEncryptionConfigurationProperty(..),
mkServerSideEncryptionConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
im... | |
49df157447a9fcfa406e78c048904d044d9f1bb96858add568a1dd516deb5018 | OCamlPro/numcaml | floats.ml | open Tests
open Numcaml
let test_add () =
let x = $(1.4 + 2) in
let y = $(3.4) in
"values match" @? (x=y)
let test_mul () =
let x = $(1.3+2*3.1) in
let y = Math.Float (1.3 +. 2. *. 3.1) in
"value match" @? (x=y)
let suite = [
"float_add" >:: test_add;
"float_mul" >:: test_mul;
]
| null | https://raw.githubusercontent.com/OCamlPro/numcaml/5c12b3aa62b09670ba7712006b5aa0254b8bdea3/tests/floats.ml | ocaml | open Tests
open Numcaml
let test_add () =
let x = $(1.4 + 2) in
let y = $(3.4) in
"values match" @? (x=y)
let test_mul () =
let x = $(1.3+2*3.1) in
let y = Math.Float (1.3 +. 2. *. 3.1) in
"value match" @? (x=y)
let suite = [
"float_add" >:: test_add;
"float_mul" >:: test_mul;
]
| |
55dec322a461d07d9e39c6952a58e460994ad7bd5c238f48848ff7cd8f782c6d | ericclack/racket-examples | stars2.rkt | #lang racket
Version 2 , in 3D
(require 2htdp/universe 2htdp/image)
(require "util.rkt")
;; Screen size
(define WIDTH 600)
(define HEIGHT 600)
;; - to + of this value for new stars
(define MAX-STAR-XY 25000)
(define MAX-STARS 100)
(define TICK-RATE 1/25)
(define ACCEL 1)
(define START-Z 100)
;; ----------------... | null | https://raw.githubusercontent.com/ericclack/racket-examples/ee858daac3577ead0c8463b9701a8653220039de/stars2.rkt | racket | Screen size
- to + of this value for new stars
-----------------------------------------------------------
-----------------------------------------------------------
(start-space) | #lang racket
Version 2 , in 3D
(require 2htdp/universe 2htdp/image)
(require "util.rkt")
(define WIDTH 600)
(define HEIGHT 600)
(define MAX-STAR-XY 25000)
(define MAX-STARS 100)
(define TICK-RATE 1/25)
(define ACCEL 1)
(define START-Z 100)
(struct starfield (stars) #:transparent)
(struct astar (x y z) #:transp... |
af2901d274bf49b6044ef301f2db477541b513e25285afc304760a05b90c17ff | billstclair/trubanc-lisp | tests.lisp | ; -*- mode: lisp -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Test code for Trubanc client and server
;;;
(in-package :trubanc-test)
(defvar *test-pathname*
(or *load-pathname* "~/loom/web/trubanc/lisp/src/tests.lisp"))
(defparameter *www-dir*
(directory-namestring (merge-pat... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/src/tests.lisp | lisp | -*- mode: lisp -*-
Make sure bill has enough tokens
Make sure bill has enough tokens
Make sure bill has enough tokens
Test with goldgrams as a fee
Test with goldgrams as a fee with storage fees
Test $MINT-TOKENS permission
Test multiple grants
Test circular grants
Test MINT-COUPON permission
Test ADD-ASSE... |
Test code for Trubanc client and server
(in-package :trubanc-test)
(defvar *test-pathname*
(or *load-pathname* "~/loom/web/trubanc/lisp/src/tests.lisp"))
(defparameter *www-dir*
(directory-namestring (merge-pathnames "../www/" *test-pathname*)))
(defun make-test-state (db-dir &rest rest &key dont-erase passp... |
b0738c44768af6a8f43cb44f9f1ab3456c6b65f32ca87b177644676081165ed3 | defndaines/meiro | hunt_and_kill_test.clj | (ns meiro.hunt-and-kill-test
(:require [clojure.test :refer [deftest testing is]]
[meiro.core :as meiro]
[meiro.hunt-and-kill :as hunt-and-kill]))
(deftest create-test
(testing "Ensure all cells are linked."
(is (every? #(not-any? empty? %)
(hunt-and-kill/create (meiro/i... | null | https://raw.githubusercontent.com/defndaines/meiro/f91d4dee2842c056a162c861baf8b71bb4fb140c/test/meiro/hunt_and_kill_test.clj | clojure | (ns meiro.hunt-and-kill-test
(:require [clojure.test :refer [deftest testing is]]
[meiro.core :as meiro]
[meiro.hunt-and-kill :as hunt-and-kill]))
(deftest create-test
(testing "Ensure all cells are linked."
(is (every? #(not-any? empty? %)
(hunt-and-kill/create (meiro/i... | |
fac63a94bb08bc0034b46b076023bb2f3397b4ed8f8c652499098875e230ea2a | kupl/LearnML | patch.ml | type nat = ZERO | SUCC of nat
let rec natadd (n1 : nat) (n2 : nat) : nat =
match n1 with
| ZERO -> n2
| SUCC a -> if a = ZERO then SUCC n2 else SUCC (natadd a n2)
let rec natmul (n1 : nat) (n2 : nat) : nat =
if n1 = ZERO then ZERO
else match n1 with ZERO -> ZERO | SUCC __s11 -> natadd n2 (natmul n2 __s11)
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/nat/sub13/patch.ml | ocaml | type nat = ZERO | SUCC of nat
let rec natadd (n1 : nat) (n2 : nat) : nat =
match n1 with
| ZERO -> n2
| SUCC a -> if a = ZERO then SUCC n2 else SUCC (natadd a n2)
let rec natmul (n1 : nat) (n2 : nat) : nat =
if n1 = ZERO then ZERO
else match n1 with ZERO -> ZERO | SUCC __s11 -> natadd n2 (natmul n2 __s11)
| |
395207c419f6d5d49a1ea4f0a505c9da627bf2c7d7c3e91bad36ca9047c0c1a9 | ds-wizard/engine-backend | Components.hs | module Shared.Database.Migration.Development.Component.Data.Components where
import Shared.Model.Component.Component
import Shared.Util.Date
mailComponent :: Component
mailComponent =
Component
{ name = "Mail Component"
, version = "1.0.0"
, builtAt = dt' 2018 1 21
, createdAt = dt' 2018 1 21
, ... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/b87f6d481205dd7f0f00fd770145f8ee5c4be193/engine-shared/src/Shared/Database/Migration/Development/Component/Data/Components.hs | haskell | module Shared.Database.Migration.Development.Component.Data.Components where
import Shared.Model.Component.Component
import Shared.Util.Date
mailComponent :: Component
mailComponent =
Component
{ name = "Mail Component"
, version = "1.0.0"
, builtAt = dt' 2018 1 21
, createdAt = dt' 2018 1 21
, ... | |
6f0d0e07de3fd334bc36b88e620eb6ab22b0cca9c998e73402054b32fccefdbf | sheyll/mediabus | RawSpec.hs | module Data.MediaBus.Media.Audio.RawSpec (spec) where
import Control.Lens
import Control.Monad (forM)
import Data.Data (Proxy (Proxy))
import Data.MediaBus
import Foreign (Storable (peekByteOff, pokeByteOff, sizeOf), allocaArray)
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = do
describe "Raw Sample C... | null | https://raw.githubusercontent.com/sheyll/mediabus/9432a32a01808385ef88e4fad2b59620d27285bc/specs/Data/MediaBus/Media/Audio/RawSpec.hs | haskell | try to map over the sample
try to map over the sample | module Data.MediaBus.Media.Audio.RawSpec (spec) where
import Control.Lens
import Control.Monad (forM)
import Data.Data (Proxy (Proxy))
import Data.MediaBus
import Foreign (Storable (peekByteOff, pokeByteOff, sizeOf), allocaArray)
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = do
describe "Raw Sample C... |
6c65ae6cd16bddcc93500b501807db02792ae07b3660173697d275595d68e704 | macalimlim/programming-in-haskell | Scratch.hs | module Scratch where
import Prelude hiding ((&&), (||))
f :: (a -> a) -> a
f g = undefined
remove :: Int -> [a] -> [a]
remove n xs = take n xs ++ drop (n + 1) xs
funct :: Int -> [a] -> [a]
funct x xs = take (x + 1) xs ++ drop x xs
e3 x = x * 2
e4 (x, y) = x
e6 x y = x * y
e10 (x, y) = [x, y]
e11 :: (... | null | https://raw.githubusercontent.com/macalimlim/programming-in-haskell/47d7d9b92c3d79eeedc1123e6eb690f96fa8a4fc/Scratch.hs | haskell | module Scratch where
import Prelude hiding ((&&), (||))
f :: (a -> a) -> a
f g = undefined
remove :: Int -> [a] -> [a]
remove n xs = take n xs ++ drop (n + 1) xs
funct :: Int -> [a] -> [a]
funct x xs = take (x + 1) xs ++ drop x xs
e3 x = x * 2
e4 (x, y) = x
e6 x y = x * y
e10 (x, y) = [x, y]
e11 :: (... | |
9831659c9aeefef942f84c25da546ffcd7cd82f8e71f664aa9f043552cee1114 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | SubscriptionScheduleAddInvoiceItem.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
| Contains the types generated from the schema SubscriptionScheduleAddInvoiceItem
module StripeAPI.Types.SubscriptionSchedu... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/SubscriptionScheduleAddInvoiceItem.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
# SOURCE #
# SOURCE #
# SOURCE #
| Defines the object schema located at @components.schemas.subscription_schedule_add_invoice_item@ in the specification.
An Add Invoice Item describes the prices and quantities that will be added as pending invoice items when ent... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
| Contains the types generated from the schema SubscriptionScheduleAddInvoiceItem
module StripeAPI.Types.SubscriptionScheduleAddInvoiceItem where
import qualified Control.Monad.Fail
imp... |
c7634468caa0b112f1deed5a5402ca7cdd5a7da3b78cf80ebac4804963dd3b12 | technomancy/leiningen | search.clj | (ns leiningen.search
"Search Central and Clojars for published artifacts."
(:require [clojure.string :as string]
[clojure.xml :as xml]
[leiningen.core.project :as project]
[leiningen.core.main :as main])
(:import (java.net URLEncoder)
(javax.xml.parsers SAXParser)
... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/src/leiningen/search.clj | clojure | replace clojure.xml version with one that doesn't do illegal access | (ns leiningen.search
"Search Central and Clojars for published artifacts."
(:require [clojure.string :as string]
[clojure.xml :as xml]
[leiningen.core.project :as project]
[leiningen.core.main :as main])
(:import (java.net URLEncoder)
(javax.xml.parsers SAXParser)
... |
81e93a5da2285a3644975552714b529b8d7065fc34261dda4dcbc05ccde2114b | PacktWorkshops/The-Clojure-Workshop | core_test.cljs | (ns hello-drag-and-drop.core-test
(:require
[cljs.test :refer-macros [deftest is testing]]
[hello-drag-and-drop.core])) | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter09/Exercise9.09/hello-drag-and-drop/test/hello_drag_and_drop/core_test.cljs | clojure | (ns hello-drag-and-drop.core-test
(:require
[cljs.test :refer-macros [deftest is testing]]
[hello-drag-and-drop.core])) | |
2af18865bfcc4d2e3d17262557c8f4c28a117a92cb830c0c4908c77f22edc121 | abs/connection_pool | psql_pool.erl | %
( c ) Rdio 2011
%
-module(psql_pool).
-export([initialize/2, close/1, num_connections/0,
spec/1, spec/2]).
num_connections() -> 15.
spec(Module, {Name, Details}) ->
{connection_pool:get_proc_name({Module, Name}),
{connection_pool, start_link, [{Module, Name}, Details]},
permanent, 2000,... | null | https://raw.githubusercontent.com/abs/connection_pool/cf864a647b322d636a79550c60957828885ef2d5/src/psql_pool.erl | erlang | ( c ) Rdio 2011
-module(psql_pool).
-export([initialize/2, close/1, num_connections/0,
spec/1, spec/2]).
num_connections() -> 15.
spec(Module, {Name, Details}) ->
{connection_pool:get_proc_name({Module, Name}),
{connection_pool, start_link, [{Module, Name}, Details]},
permanent, 2000, wor... | |
ca4efea1479bd830aff9ff6189db82411d2c58988c2780f9a92d331f20e5e854 | thi-ng/demos | utils.clj | (ns ws-bra-1.utils
(:require
[thi.ng.math.core :as m]
[thi.ng.geom.core :as g]
[thi.ng.geom.vector :as v :refer [vec2 vec3]]
[thi.ng.geom.matrix :as mat]
[thi.ng.geom.circle :refer [circle]]
[thi.ng.geom.polygon :refer [polygon2]]
[thi.ng.geom.line :as l]
[thi.ng.geom.bezier :as b]
[thi.ng.... | null | https://raw.githubusercontent.com/thi-ng/demos/048cd131099a7db29be56b965c053908acad4166/ws-bra-1/src/ws_bra_1/utils.clj | clojure | (ns ws-bra-1.utils
(:require
[thi.ng.math.core :as m]
[thi.ng.geom.core :as g]
[thi.ng.geom.vector :as v :refer [vec2 vec3]]
[thi.ng.geom.matrix :as mat]
[thi.ng.geom.circle :refer [circle]]
[thi.ng.geom.polygon :refer [polygon2]]
[thi.ng.geom.line :as l]
[thi.ng.geom.bezier :as b]
[thi.ng.... | |
9f551cda3e7f69ace0f260b33873b3a5d345a2a8e74664a6319c6078245ba109 | bobzhang/fan | parse_plc.ml |
let list_of_list_option = fun
| Some l -> l
| None -> []
let term_list _loc ts e =
List.fold_right
(fun t c ->
(Comp (Names.cons,[t;c],_loc) : Ast_plc.term)) ts
(match e with
| Some t -> t
| None -> Comp (Names.nil,[],_loc))
let group_rs = ref Compile_plc.group_rs;;
let unwrap_rule_or_ma... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/thirdparty/plc/parse_plc.ml | ocaml |
let list_of_list_option = fun
| Some l -> l
| None -> []
let term_list _loc ts e =
List.fold_right
(fun t c ->
(Comp (Names.cons,[t;c],_loc) : Ast_plc.term)) ts
(match e with
| Some t -> t
| None -> Comp (Names.nil,[],_loc))
let group_rs = ref Compile_plc.group_rs;;
let unwrap_rule_or_ma... | |
cdf552109c179509f3a9d85a5132321de94895bfd521954f6b671f5d1aa7c730 | Helium4Haskell/helium | NonDerivableEq.hs | data X = X (Int -> Int) deriving (Eq, Show)
data Y = Y Ordering deriving Eq
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/staticerrors/NonDerivableEq.hs | haskell | data X = X (Int -> Int) deriving (Eq, Show)
data Y = Y Ordering deriving Eq
| |
3ef57a7ab99b41776583dda2fbec217de3d0ee30217e0d56dbe1180f1f11ad5b | dradtke/Lisp-Text-Editor | pattern.lisp | (in-package :cl-cairo2)
(defclass pattern (cairo-object)
())
(defmethod lowlevel-destroy ((pattern pattern))
(cairo_pattern_destroy (get-pointer pattern)))
(defmethod lowlevel-status ((pattern pattern))
(lookup-cairo-enum (cairo_pattern_status (get-pointer pattern)) table-status))
(defmacro define-create-p... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/cl-cairo2-20120208-git/src/pattern.lisp | lisp | See CREATE-CONTEXT for why (lowlevel-destroy object) cannot be used here
See CREATE-CONTEXT for why (lowlevel-destroy object) cannot be used here
(with-unique-names (pattern-name pointer-name)
`(defun ,(prepend-intern "pattern-" name) ,(cons pattern-name args)
(with-alive-object (,pattern-name ,pointer-name)... | (in-package :cl-cairo2)
(defclass pattern (cairo-object)
())
(defmethod lowlevel-destroy ((pattern pattern))
(cairo_pattern_destroy (get-pointer pattern)))
(defmethod lowlevel-status ((pattern pattern))
(lookup-cairo-enum (cairo_pattern_status (get-pointer pattern)) table-status))
(defmacro define-create-p... |
fa2f6acc17d7a00712588fde65f7b10e7d866f15dc9ce8353182143b429ce80a | saltysystems/overworld | ow_dl_handler.erl | -module(ow_dl_handler).
-behaviour(cowboy_handler).
-export([init/2]).
init(Req, State) ->
#{peer := {IP, _Port}} = Req,
logger:info("Got a request for API package from ~p", [IP]),
% Compile the latest code
ClientAPI = ow_binding:print(),
Apps = ow_protocol:registered_apps(),
ProtoFiles = prot... | null | https://raw.githubusercontent.com/saltysystems/overworld/8bbf48d3033c22fa5c8e1f2323996a7a1153b160/src/ow_dl_handler.erl | erlang | Compile the latest code
return the path of the proto file for the given application
Very hard-coded and rudimentary. | -module(ow_dl_handler).
-behaviour(cowboy_handler).
-export([init/2]).
init(Req, State) ->
#{peer := {IP, _Port}} = Req,
logger:info("Got a request for API package from ~p", [IP]),
ClientAPI = ow_binding:print(),
Apps = ow_protocol:registered_apps(),
ProtoFiles = protofiles(Apps),
{ok, {"file"... |
00bc49f0dac98aacd0de224c9aa584b73914e5504f9438a17e20893423fa7961 | KULeuven-CS/CPL | 1.22.rkt | #lang eopl
(require rackunit)
; ex 1.22
(define filter-in
(lambda (pred lst)
(if (null? lst)
'()
(if (pred (car lst))
(cons (car lst) (filter-in pred (cdr lst)))
(filter-in pred (cdr lst))))))
(check-equal? (filter-in number? '(a 2 (1 3) b 7)) '(2 7))
(check-equal? (filter... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter1/1.22.rkt | racket | ex 1.22 | #lang eopl
(require rackunit)
(define filter-in
(lambda (pred lst)
(if (null? lst)
'()
(if (pred (car lst))
(cons (car lst) (filter-in pred (cdr lst)))
(filter-in pred (cdr lst))))))
(check-equal? (filter-in number? '(a 2 (1 3) b 7)) '(2 7))
(check-equal? (filter-in symbol... |
f8b0507213a77fcb2b9a94c5df554236f32be40c613d708899dd57fdad5b6a64 | gsakkas/rite | 3529.ml |
let rec listReverse l =
match l with | [] -> [] | _::tl -> (listReverse tl) + tl;;
fix
let rec l = match l with | [ ] - > [ ] | _ : : tl - > ; ;
let rec listReverse l = match l with | [] -> [] | _::tl -> listReverse tl;;
*)
changed spans
( 3,38)-(3,59 )
AppG [ VarG ]
(3,38)-(3,59)
listRev... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14_min/3529.ml | ocaml |
let rec listReverse l =
match l with | [] -> [] | _::tl -> (listReverse tl) + tl;;
fix
let rec l = match l with | [ ] - > [ ] | _ : : tl - > ; ;
let rec listReverse l = match l with | [] -> [] | _::tl -> listReverse tl;;
*)
changed spans
( 3,38)-(3,59 )
AppG [ VarG ]
(3,38)-(3,59)
listRev... | |
677fffa2ca4d49f16fa3c4a495e42f56d6b119c10d5ca561bd7d2572a8165b0a | Tclv/HaskellBook | intermission04.hs | data Mood = Blah | Woot deriving Show
changeMood :: Mood -> Mood
changeMood Blah = Woot
changeMood _ = Blah
| null | https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch4/intermission04.hs | haskell | data Mood = Blah | Woot deriving Show
changeMood :: Mood -> Mood
changeMood Blah = Woot
changeMood _ = Blah
| |
b328c0bf428859e449c83213cc82bdc15bc6c335a4aca391a40b179c0acc9431 | nd/bird | 3.4.2.hs | -- x = (x div y) * y + x mod y
-- x mod y = x - (x div y) * y
-- if x > 0:
x div y < 0 and x div y > = x div ( abs y ) ( because we use floor ) = > ( x div y ) * y > = x = > x - ( x div y ) * y < = 0 = > x mod y < = 0
-- if x = 0:
x mod y = 0 - ( 0 div y ) * y = 0
-- if x < 0:
x div y > 0 and ( abs ( x div y ) * ... | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch03/3.4.2.hs | haskell | x = (x div y) * y + x mod y
x mod y = x - (x div y) * y
if x > 0:
if x = 0:
if x < 0: | x div y < 0 and x div y > = x div ( abs y ) ( because we use floor ) = > ( x div y ) * y > = x = > x - ( x div y ) * y < = 0 = > x mod y < = 0
x mod y = 0 - ( 0 div y ) * y = 0
x div y > 0 and ( abs ( x div y ) * y ) > = ( abs x ) ( because we use floor ) = > ( since ( x div y ) * y < 0 ) x - ( x div y ) * y < = ... |
7e65bc426936fe3f0bcf63719844f9720d27c52ba4ee0382e528123e61c1ffb0 | metosin/compojure-api | dates.clj | (ns examples.dates
(:require [compojure.api.sweet :refer :all]
[schema.core :as s]
[ring.util.http-response :refer :all])
(:import (java.util Date)
(org.joda.time LocalDate DateTime)))
(s/defschema Dates {:date Date
:date-time DateTime
:loc... | null | https://raw.githubusercontent.com/metosin/compojure-api/5c88f32fe56cdb6fcdb3cc506bb956943fcd8c17/examples/thingie/src/examples/dates.clj | clojure | (ns examples.dates
(:require [compojure.api.sweet :refer :all]
[schema.core :as s]
[ring.util.http-response :refer :all])
(:import (java.util Date)
(org.joda.time LocalDate DateTime)))
(s/defschema Dates {:date Date
:date-time DateTime
:loc... | |
ad9cbbcd03228f2e2b974054a8f8cfbc6c01328a8dcb35eed512aafda4a4a9f2 | bgamari/bayes-stack | RunSampler.hs | module RunSampler ( SamplerModel (..)
, SamplerOpts (..), samplerOpts
, runSampler
, createSweeps
) where
import Options.Applicative
import Data.Monoid ((<>))
import System.FilePath.Posix ((</>))
import Syst... | null | https://raw.githubusercontent.com/bgamari/bayes-stack/020df7bb7263104fdea254e57d6c7daf7806da3e/network-topic-models/RunSampler.hs | haskell | module RunSampler ( SamplerModel (..)
, SamplerOpts (..), samplerOpts
, runSampler
, createSweeps
) where
import Options.Applicative
import Data.Monoid ((<>))
import System.FilePath.Posix ((</>))
import Syst... | |
0d3af98758075ad91f79e442af0c40b015e46e3dd76c6fe2796aa21db1c818e1 | input-output-hk/cardano-rest | Types.hs | module Cardano.TxSubmit.CLI.Types
( ConfigFile (..)
, GenesisFile (..)
, SocketPath (..)
, TxSubmitNodeParams (..)
) where
import Cardano.Api.Protocol
( Protocol (..) )
import Cardano.Api.Typed
( NetworkId (..) )
import Cardano.Rest.Types
( WebserverConfig )
-- | The product type of all command ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-rest/040b123b45af06060aae04479d92fada68820f12/submit-api/src/Cardano/TxSubmit/CLI/Types.hs | haskell | | The product type of all command line arguments | module Cardano.TxSubmit.CLI.Types
( ConfigFile (..)
, GenesisFile (..)
, SocketPath (..)
, TxSubmitNodeParams (..)
) where
import Cardano.Api.Protocol
( Protocol (..) )
import Cardano.Api.Typed
( NetworkId (..) )
import Cardano.Rest.Types
( WebserverConfig )
data TxSubmitNodeParams = TxSubmitNod... |
723d09f2664e644b8f9c486a6e8b5a0c4dab68a0b81e9697f640b73ad71bfb85 | brendanhay/gogol | Get.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-storage/gen/Gogol/Storage/Buckets/Get.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Returns metadata for the specified bucket.
/See:/ </ Cloud Storage JSON API Reference> for @storage.buckets.get@.
* Resource
** Constructing a Request
'StorageBucketsGet' request conforms to.
| Returns metadata for the speci... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
e480452de7450e5b48572e864540e0652abbac2686ff4c162de826ef7d4d5c55 | jgertm/lang | lexer.clj | (ns lang.parser.lexer
(:require [blancas.kern.core :refer :all]
[blancas.kern.lexer :as lexer]))
(def ^:private identifier-start
(<|> letter (one-of* "*&^%$!_-+=<>?/")))
(def ^:private identifier-next
(<|> alpha-num (one-of* "*&^%$!_-+=<>?")))
(let [parsers
(lexer/make-parsers
(merge ... | null | https://raw.githubusercontent.com/jgertm/lang/cdd8b08cb23bfa07938b28f917971ee7e4927668/src/lang/parser/lexer.clj | clojure | (def identifier (:identifier parsers))
(def field (:field parsers)) | (ns lang.parser.lexer
(:require [blancas.kern.core :refer :all]
[blancas.kern.lexer :as lexer]))
(def ^:private identifier-start
(<|> letter (one-of* "*&^%$!_-+=<>?/")))
(def ^:private identifier-next
(<|> alpha-num (one-of* "*&^%$!_-+=<>?")))
(let [parsers
(lexer/make-parsers
(merge ... |
aad8ab2980910175bfce223a7f45dfb7c8b7065ad230f2413b3fd3f5a2c6031c | spurious/chibi-scheme-mirror | chibi-prelude.scm |
(import (chibi time) (scheme cxr) (srfi 33) (srfi 39))
(define (timeval->milliseconds tv)
(quotient (+ (* 1000000 (timeval-seconds tv)) (timeval-microseconds tv))
1000))
(define (time* thunk)
(call-with-output-string
(lambda (out)
(let* ((start (car (get-time-of-day)))
(result ... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/benchmarks/gabriel/chibi-prelude.scm | scheme |
(import (chibi time) (scheme cxr) (srfi 33) (srfi 39))
(define (timeval->milliseconds tv)
(quotient (+ (* 1000000 (timeval-seconds tv)) (timeval-microseconds tv))
1000))
(define (time* thunk)
(call-with-output-string
(lambda (out)
(let* ((start (car (get-time-of-day)))
(result ... | |
97d13c801367269c256c0b79ad66e2d4370f6f2e444141bc54978c05af5f6cc1 | disconcision/fructure | code-beauty-shot-partial-mockup.rkt | #lang racket
(provide mode:navigate)
#;(define (mode:navigate key state)
; navigation major mode
(define-from state
stx mode transforms messages)
(define update
(curry hash-set* state))
(match key
["down"
(update
'stx
(match stx
; move cursor ▹... | null | https://raw.githubusercontent.com/disconcision/fructure/d434086052eab3c450f631b7b14dcbf9358f45b7/archive/code-beauty-shot-partial-mockup.rkt | racket | (define (mode:navigate key state)
navigation major mode
move cursor ▹ down to closest contained handle ⊃
move cursor ▹ up to closest containing handle ⊃
move ▹ right in a preorder traversal of handles ⊃
if there's a ⊃ under ▹
and ▹ it
otherwise gather the ⊃s in the context of ▹
and move ▹ rightwards therein
mo... | #lang racket
(provide mode:navigate)
(define-from state
stx mode transforms messages)
(define update
(curry hash-set* state))
(match key
["down"
(update
'stx
(match stx
[(⋱ c⋱ (/ ▹ a/
(⋱ d⋱ (/ ⊃ b/ b))))
(⋱ c⋱ (... |
4cc60fd7178ce13b4905d6fd95c5bf26dfb180dc06c30074110cf097120831fe | commercialhaskell/stack | Spec.hs | import Lib
main :: IO ()
main = pure ()
| null | https://raw.githubusercontent.com/commercialhaskell/stack/b846eae85d9f30d28d7a4fa33fea139e7d1420c7/test/integration/tests/multi-test/files/test-2/Spec.hs | haskell | import Lib
main :: IO ()
main = pure ()
| |
23d95804fac6d535854df19aad6b6229a00003428869d08472cdecc047e012d7 | haskell-repa/repa | Vector.hs | {-# LANGUAGE PackageImports, FlexibleContexts #-}
-- | Read and write vectors as ASCII text files.
--
-- The file format is like:
--
-- @
-- VECTOR -- header
100 -- length of vector
1.23 1.56 1.23 ... -- data , separated by whitespace
-- ....
-- ... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-io/Data/Array/Repa/IO/Vector.hs | haskell | # LANGUAGE PackageImports, FlexibleContexts #
| Read and write vectors as ASCII text files.
The file format is like:
@
VECTOR -- header
length of vector
data , separated by whitespace
....
@
| Read a vector from a text file.
* WARNING: This is implemented fairly naively, ... | module Data.Array.Repa.IO.Vector
( readVectorFromTextFile
, writeVectorToTextFile)
where
import Data.Array.Repa as A
import Data.Array.Repa.Repr.Unboxed as A
import Data.Array.Repa.IO.Internals.Text
import Data.List as L
import Prelude ... |
32f1350cb1ed9ff79a32b02096dc3a838f5a3bb795e35cbed0b7c214c22b2c34 | james-iohk/plutus-scripts | CheckSameInlineDatumAtMultipleInputs.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE RankNTyp... | null | https://raw.githubusercontent.com/james-iohk/plutus-scripts/d504776f14be3d127837702068e5b5c3a1b935eb/src/CheckSameInlineDatumAtMultipleInputs.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
Redeemer
The validator script
... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module CheckSameInlineDatumAtMultipleInputs
( printRedeemer,
s... |
3ce599e720ecfb4d9cd83cd6eaee8c82ab2f9be27fe07aed8c360adc8da9f16d | larcenists/larceny | bibfreq2.scm | ;;; find the most frequently referenced word in the bible.
( Nov 2007 )
modified by ( Nov 2007 )
to use symbol - hash instead of eq ?
(import (scheme base)
(scheme read)
(scheme write)
(scheme time)
(scheme file)
(scheme list)
(scheme char)
(scheme... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Benchmarking/R7RS/src/bibfreq2.scm | scheme | find the most frequently referenced word in the bible. | ( Nov 2007 )
modified by ( Nov 2007 )
to use symbol - hash instead of eq ?
(import (scheme base)
(scheme read)
(scheme write)
(scheme time)
(scheme file)
(scheme list)
(scheme char)
(scheme sort)
(except (scheme hash-table)
... |
bb1ecfd84c710f89fbfa35904ef2c9889891e5e22e8778601e2817efeec689d3 | tomgstevensphd/Common-Lisp-Utilities-in-Lispworks | U-file&buffers.lisp | ;;********************** U-file&buffers.lisp *************************
;;
;;
* * * ALSO SEE : U - BUFFERS.LISP
U - files&buffers - Frames.lisp
U - LW - editor
GET - FILE - LINES
2020
ddd
(defun get-file-lines (pathname start-line-n &... | null | https://raw.githubusercontent.com/tomgstevensphd/Common-Lisp-Utilities-in-Lispworks/a937e4f5f0ecc2430ac50560b14e87ec3b56ea37/U-file%26buffers.lisp | lisp | ********************** U-file&buffers.lisp *************************
(line)
read the file lines
end let,loop, with
end let,get-file-lines
TEST
(get-file-lines "C:\\3-TS\\LISP PROJECTS TS\\CogSys-Model\\cs-memory-test.lisp" 5 11)
"(defparameter *memtest-list2"
end let,loop,with
end let,count-file-lines
TE... | * * * ALSO SEE : U - BUFFERS.LISP
U - files&buffers - Frames.lisp
U - LW - editor
GET - FILE - LINES
2020
ddd
(defun get-file-lines (pathname start-line-n &optional end-line-n
&key mark-at-lines-start m... |
d7657a51f1f60ea9370f09b5dc70d2dccd1fe96b1791366624f6015ecdcf7692 | jyh/metaprl | nuprl_nat_extra.ml | extends Ma_tree_1
open Dtactic
interactive nuprl_id_increasing :
[wf] sequent { <H> >- '"k" in "nat"[]{} } -->
sequent { <H> >- "increasing"[]{"lambda"[]{"i".'"i"};'"k"} }
interactive nuprl_increasing_implies :
[wf] sequent { <H> >- '"k" in "nat"[]{} } -->
[wf] sequent { <H>;"x": "int_seg"[]{"numb... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/mesa/nuprl_nat_extra.ml | ocaml | *** display forms *** | extends Ma_tree_1
open Dtactic
interactive nuprl_id_increasing :
[wf] sequent { <H> >- '"k" in "nat"[]{} } -->
sequent { <H> >- "increasing"[]{"lambda"[]{"i".'"i"};'"k"} }
interactive nuprl_increasing_implies :
[wf] sequent { <H> >- '"k" in "nat"[]{} } -->
[wf] sequent { <H>;"x": "int_seg"[]{"numb... |
f7ef3b61b23064670b66c4dcd57f8f50e430c2f4fd8447cfe3f60ae94d01f645 | unisonweb/unison | Operations.hs | module U.Codebase.Sqlite.Operations
( -- * branches
saveRootBranch,
loadRootCausalHash,
expectRootCausalHash,
expectRootCausal,
expectRootBranchHash,
loadCausalHashAtPath,
expectCausalHashAtPath,
saveBranch,
loadCausalBranchByCausalHash,
expectCausalBranchByCausalHash,
expe... | null | https://raw.githubusercontent.com/unisonweb/unison/649215726982e20b45952f514ad20def213c86ea/codebase2/codebase-sqlite/U/Codebase/Sqlite/Operations.hs | haskell | * branches
* terms
* decls
* terms/decls
* patches
* test for stuff in codebase
* watch expression cache
* indexes
** nearest common ancestor
** prefix index
** dependents index
** type index
** type mentions index
** name lookup index
* reflog
* low-level stuff
* somewhat unexpectedly unused definitio... | module U.Codebase.Sqlite.Operations
saveRootBranch,
loadRootCausalHash,
expectRootCausalHash,
expectRootCausal,
expectRootBranchHash,
loadCausalHashAtPath,
expectCausalHashAtPath,
saveBranch,
loadCausalBranchByCausalHash,
expectCausalBranchByCausalHash,
expectBranchByBranchHa... |
d368b6fa4138965eb8f1cdc804ed42e7c710314dbe39891e2d62cab055eb8242 | lambe-lang/nethra | pass.ml | module Impl = struct
type _ input = string
type _ output = Nethra_toy_cst.Binding.t list
type _ error = Nethra_syntax_source.Location.t * string
let run input =
let open Preface_stdlib.Result in
let open Nethra_syntax_parser in
let open Nethra_syntax_source in
let module Parsec = Parsers.Parsec... | null | https://raw.githubusercontent.com/lambe-lang/nethra/2ac839aa086a683d8e15abfa2f042b53875af36b/lib/nethra/toy/system/t01_parser/pass.ml | ocaml | module Impl = struct
type _ input = string
type _ output = Nethra_toy_cst.Binding.t list
type _ error = Nethra_syntax_source.Location.t * string
let run input =
let open Preface_stdlib.Result in
let open Nethra_syntax_parser in
let open Nethra_syntax_source in
let module Parsec = Parsers.Parsec... | |
3422ea5a617d0dbf84e5294c02e5b557ff5549e1f20935ad19f03f345d711436 | sdiehl/write-you-a-haskell | Eval.hs | module Eval where
import Syntax
import Data.Maybe
import Data.Functor
isNum :: Expr -> Bool
isNum Zero = True
isNum (Succ t) = isNum t
isNum _ = False
isVal :: Expr -> Bool
isVal Tr = True
isVal Fl = True
isVal t | isNum t = True
isVal _ = False
eval' :: Expr -> Maybe Expr
eval' x = case x of
IsZero Z... | null | https://raw.githubusercontent.com/sdiehl/write-you-a-haskell/ae73485e045ef38f50846b62bd91777a9943d1f7/chapter3/calc/Eval.hs | haskell | term is "stuck" | module Eval where
import Syntax
import Data.Maybe
import Data.Functor
isNum :: Expr -> Bool
isNum Zero = True
isNum (Succ t) = isNum t
isNum _ = False
isVal :: Expr -> Bool
isVal Tr = True
isVal Fl = True
isVal t | isNum t = True
isVal _ = False
eval' :: Expr -> Maybe Expr
eval' x = case x of
IsZero Z... |
40dda1295a6359165a2cd5a2d4d8091cc832d3b5464b2173ecfe4d756d462ac9 | mirage/ethernet | ethernet.mli |
* Copyright ( c ) 2010 - 2019 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVID... | null | https://raw.githubusercontent.com/mirage/ethernet/0a69cc5cb3ff14fc008c956c6af39371a44f5b3c/src/ethernet.mli | ocaml | * Ethernet protocols.
* [pp_proto ppf proto] pretty-prints the ethernet protocol [proto] on [ppf].
* The type of an Ethernet packet.
* [sizeof_ethernet] is the byte size of the ethernet header.
* [of_cstruct buffer] attempts to decode the buffer as ethernet packet. It
may result an error if the buffer is too ... |
* Copyright ( c ) 2010 - 2019 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVID... |
99a6996129d48bb483f026bf3a6aa636fd856c2f7d1b59ebbe9fff2a2218d560 | chetmurthy/poly-protobuf | test07_ml.ml | module T = Test07_types
module Pb = Test07_pb
module Pp = Test07_pp
let decode_ref_data () = {
T.value = 1l;
T.left = T.Node {T.value = 2l; T.left = T.Empty 0l ; T.right = T.Empty 0l};
T.right = T.Node {T.value = 3l; T.left = T.Empty 0l ; T.right = T.Empty 0l};
}
let () =
let mode = Test_util.parse... | null | https://raw.githubusercontent.com/chetmurthy/poly-protobuf/1f80774af6472fa30ee2fb10d0ef91905a13a144/tests/testdata/integration-tests/test07_ml.ml | ocaml | module T = Test07_types
module Pb = Test07_pb
module Pp = Test07_pp
let decode_ref_data () = {
T.value = 1l;
T.left = T.Node {T.value = 2l; T.left = T.Empty 0l ; T.right = T.Empty 0l};
T.right = T.Node {T.value = 3l; T.left = T.Empty 0l ; T.right = T.Empty 0l};
}
let () =
let mode = Test_util.parse... | |
af514524e06443a9a23d9a13dc4ffe4dd88f3b0093a8a2fea9b5cf4ee182c02c | braidchat/braid | group.clj | (ns braid.chat.db.group
(:require
[clojure.edn :as edn]
[datomic.api :as d]
[braid.core.server.db :as db]
[braid.chat.db.common :refer [create-entity-txn db->group db->user db->tag group-pull-pattern user-pull-pattern]]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as user]))
(defn g... | null | https://raw.githubusercontent.com/braidchat/braid/545fd58fe586cc7350101e95e82bdfb5b129878b/src/braid/chat/db/group.clj | clojure | Transactions
unsubscribe from threads
remove mentions
remove group from custom sort order | (ns braid.chat.db.group
(:require
[clojure.edn :as edn]
[datomic.api :as d]
[braid.core.server.db :as db]
[braid.chat.db.common :refer [create-entity-txn db->group db->user db->tag group-pull-pattern user-pull-pattern]]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as user]))
(defn g... |
833eca14ac6673c5e9db173a26c123da8cd2832fb78e1e8f7e16ea06ff33be88 | alavrik/piqi | main.ml |
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in ... | null | https://raw.githubusercontent.com/alavrik/piqi/bcea4d44997966198dc295df0609591fa787b1d2/src/main.ml | ocaml | interfaces for defining sub-command
subcommand -- skip argv[0]
called by Piqi_run
don't do anything in interactive (toplevel) mode
include commonly used functions in the module's namespace |
Copyright 2009 , 2010 , 2011 , 2012 , 2013 , 2014
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in ... |
b453933796d9c22a4506a15cb6d707c26bcd67a0a2c593948baeea93e34a5ebf | pjotrp/guix | cross-base.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 , 2015 < >
Copyright © 2014 , 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free So... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/cross-base.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2014 , 2015 < >
Copyright © 2014 , 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages cross-base)
#:use-module (guix lice... |
acac6d2226fe2a9d2fc77e324b9e28968fb9c84b6d84c5caf6dc14a35c76af5a | zalky/runway | core.clj | (ns runway.core
(:require [axle.core :as watch]
[beckon :as sig]
[cinch.core :as util]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.cli :as cli]
[clojure.tools.namespace.dependency :as deps]
... | null | https://raw.githubusercontent.com/zalky/runway/343f2b6d6b1808f623939d9e537ab2d3272f87e8/src/runway/core.clj | clojure | not prevent this var from being thrown out by c.t.n. If this
namespace gets reloaded, the system will get in an unrecoverable
state since we forget where to find the root system
component. This should never be a problem in projects that use
this library, only when developing on this namespace directly.
Global sys... | (ns runway.core
(:require [axle.core :as watch]
[beckon :as sig]
[cinch.core :as util]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.cli :as cli]
[clojure.tools.namespace.dependency :as deps]
... |
5ef9a52de7d7d4d1aa369c8040524c9b223108e4a7fd51fd307c756538d6943e | erlang/rebar3 | rebar_prv_release.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
-module(rebar_prv_release).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include_lib("providers/include/providers.hrl").
-include("rebar.hrl").
-define(PROVIDER, release).
-define(DEPS, [compil... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/rebar_prv_release.erl | erlang | ex: ts=4 sw=4 et
===================================================================
Public API
=================================================================== | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
-module(rebar_prv_release).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-include_lib("providers/include/providers.hrl").
-include("rebar.hrl").
-define(PROVIDER, release).
-define(DEPS, [compile]).
-spec init(re... |
80fe517222c38e5c571db6c61217ab59cd16c6b6665e6b992b8fac4c1d2bbe5f | GoNZooo/gotyno-hs | generics.hs | {-# LANGUAGE StrictData #-}
# LANGUAGE TemplateHaskell #
module GotynoOutput.Generics where
import Data.Aeson (FromJSON (..), ToJSON (..))
import qualified Data.Aeson as JSON
import GHC.Generics (Generic)
import qualified Gotyno.Helpers as Helpers
import Qtility
import qualified GotynoOutput.Basic as Basic
import qu... | null | https://raw.githubusercontent.com/GoNZooo/gotyno-hs/722f1856e9d55d5f43ccb0938c5933472f9eef07/test/reference-output/generics.hs | haskell | # LANGUAGE StrictData # | # LANGUAGE TemplateHaskell #
module GotynoOutput.Generics where
import Data.Aeson (FromJSON (..), ToJSON (..))
import qualified Data.Aeson as JSON
import GHC.Generics (Generic)
import qualified Gotyno.Helpers as Helpers
import Qtility
import qualified GotynoOutput.Basic as Basic
import qualified GotynoOutput.HasGene... |
0dfcaad71d2df4f2bed9c351d995bf50ff1f21ec005448aab1013d61827fe558 | camlp5/camlp5 | pa_sexp.ml | (* camlp5r *)
pa_sexp.ml , v
Copyright ( c ) INRIA 2007 - 2017
open Asttools;
open MLast;
open Pcaml;
value sexp_eoi = Grammar.Entry.create gram "sexp_eoi";
value sexp_atom a = Sexp.Atom a ;
value sexp_nil = Sexp.Nil ;
value sexp_cons e1 e2 = Sexp.Cons e1 e2 ;
EXTEND
GLOBAL: sexp_eoi;
sexp: [
[
a... | null | https://raw.githubusercontent.com/camlp5/camlp5/15e03f56f55b2856dafe7dd3ca232799069f5dda/tutorials/sexp_example/pa_sexp.ml | ocaml | camlp5r | pa_sexp.ml , v
Copyright ( c ) INRIA 2007 - 2017
open Asttools;
open MLast;
open Pcaml;
value sexp_eoi = Grammar.Entry.create gram "sexp_eoi";
value sexp_atom a = Sexp.Atom a ;
value sexp_nil = Sexp.Nil ;
value sexp_cons e1 e2 = Sexp.Cons e1 e2 ;
EXTEND
GLOBAL: sexp_eoi;
sexp: [
[
a = atom -> sex... |
dadf7814c3761b6c2d5d17977a5300abce11b9a1654f53b72a81695ef3a271c0 | sile/h264 | bit-stream.lisp | (in-package :h264.bit-stream)
(defstruct bit-stream
(source t :type stream)
(octets t :type list)
(pos t :type (integer 1 8)))
(defun make-input-stream (source)
(make-bit-stream :source source
:octets '()
:pos 8))
(defmacro with-input-stream ((in source) &body body)
... | null | https://raw.githubusercontent.com/sile/h264/93d48582a36c79e734f9933a5103e1b1505b6742/bit-stream/bit-stream.lisp | lisp | XXX: 不正確 | (in-package :h264.bit-stream)
(defstruct bit-stream
(source t :type stream)
(octets t :type list)
(pos t :type (integer 1 8)))
(defun make-input-stream (source)
(make-bit-stream :source source
:octets '()
:pos 8))
(defmacro with-input-stream ((in source) &body body)
... |
b15e0d04930785fe1fe9224ea8d8f1feb7dc9b0786eeaaa5bda120fc7c25a0e4 | namin/biohacker | suspend.lisp | ;; -*- Mode: Lisp; -*-
;;;; Candidate generation via constraint suspension
Last edited : 1/29/93 , by KDF
Copyright ( c ) 1993 , , Northwestern University ,
and , the Xerox Corporation .
;;; All rights reserved.
;;; See the file legal.txt for a paragraph stating scope of permission
;;; and disclaimer of ... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/tcon/suspend.lisp | lisp | -*- Mode: Lisp; -*-
Candidate generation via constraint suspension
All rights reserved.
See the file legal.txt for a paragraph stating scope of permission
and disclaimer of warranty. The above copyright notice and that
paragraph must be included in any separate copy of this file.
Candidate generation algorithm
... |
Last edited : 1/29/93 , by KDF
Copyright ( c ) 1993 , , Northwestern University ,
and , the Xerox Corporation .
(in-package :COMMON-LISP-USER)
(defun generate-candidates (*tcon* inputs outputs
&optional (debugging? nil)
&aux diffs candidates
hypotheses ... |
69f468e88f755d75ca2d30c85b0740d70eaeb4ad9c374359fcdb18b67f96a754 | ermine/sulci | en_time.ml | let expand_time_proc _cause years months days hours minutes seconds =
(if years = 0 then "" else
Printf.sprintf "%d %s " years
(match years with
| 1 -> "year"
| _ -> "years")) ^
(if months = 0 then "" else
Printf.sprintf "%d %s " months
(match months with
| 1 ... | null | https://raw.githubusercontent.com/ermine/sulci/3ee4bd609b01e2093a6d37bf74579728d0a93b70/lang/en_time.ml | ocaml | let expand_time_proc _cause years months days hours minutes seconds =
(if years = 0 then "" else
Printf.sprintf "%d %s " years
(match years with
| 1 -> "year"
| _ -> "years")) ^
(if months = 0 then "" else
Printf.sprintf "%d %s " months
(match months with
| 1 ... | |
938417ff077fa12320fbfbd4938b1ac240a29c094eaa2c17e2eef0ba7176da7e | agda/agda | Position.hs | # LANGUAGE TemplateHaskell #
module Internal.Syntax.Position ( tests ) where
import Agda.Syntax.Position
import Agda.Syntax.TopLevelModuleName
import Agda.Utils.FileName
import qualified Agda.Utils.Maybe.Strict as Strict
import Agda.Utils.List ( distinct )
import qualified Agda.Utils.List1 as List1
import Agda.Utils.... | null | https://raw.githubusercontent.com/agda/agda/c859b5e8737a006b559723a1048bba10806bda2d/test/Internal/Syntax/Position.hs | haskell | ----------------------------------------------------------------------
Test suite
| The positions corresponding to the interval. The positions do not
refer to characters, but to the positions between characters, with
| The positions corresponding to the range, including the
end-points.
| Constructs the least inte... | # LANGUAGE TemplateHaskell #
module Internal.Syntax.Position ( tests ) where
import Agda.Syntax.Position
import Agda.Syntax.TopLevelModuleName
import Agda.Utils.FileName
import qualified Agda.Utils.Maybe.Strict as Strict
import Agda.Utils.List ( distinct )
import qualified Agda.Utils.List1 as List1
import Agda.Utils.... |
147ddc282a8d1651f171a8f391e18fa4cc79b62c0b25f1cfd43c070036d6dbb4 | sheepduke/silver-brain | concept-map.lisp | (in-package silver-brain-tests.service)
(setup
(config:set-profile :test)
(db:setup))
(teardown
(db::delete-file))
(defun setup-test ()
"Setup for each test."
)
| null | https://raw.githubusercontent.com/sheepduke/silver-brain/9d088bcd30948decc174f3569e2ad7bc0b3b50c1/backend/tests/service/concept-map.lisp | lisp | (in-package silver-brain-tests.service)
(setup
(config:set-profile :test)
(db:setup))
(teardown
(db::delete-file))
(defun setup-test ()
"Setup for each test."
)
| |
25c7ee0cb6d8d63fa0da97830a629b908159dd04cc87734827076f77a60795ba | clojure-interop/google-cloud-clients | HttpResourceManagerRpc.clj | (ns com.google.cloud.resourcemanager.spi.v1beta1.HttpResourceManagerRpc
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.resourcemanager.spi.v1beta1 HttpResourceManagerRpc]))
(defn ->http-resource-manager-rpc
"Constructor.
options - `com.google.cloud.resourcemanager.ResourceManagerO... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.resourcemanager/src/com/google/cloud/resourcemanager/spi/v1beta1/HttpResourceManagerRpc.clj | clojure | (ns com.google.cloud.resourcemanager.spi.v1beta1.HttpResourceManagerRpc
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.resourcemanager.spi.v1beta1 HttpResourceManagerRpc]))
(defn ->http-resource-manager-rpc
"Constructor.
options - `com.google.cloud.resourcemanager.ResourceManagerO... | |
e8cb974ffc294cf27ffc15cac34a0cab950d6fcc040e6572131fe6432ab64151 | fukamachi/clozure-cl | apropos-window.lisp | ;;;-*-Mode: LISP; Package: GUI -*-
;;;
Copyright ( C ) 2007 Clozure Associates
(in-package "GUI")
(defclass package-combo-box (ns:ns-combo-box)
((packages :initform nil))
(:metaclass ns:+ns-object))
;;; This is a premature optimization. Instead of calling LIST-ALL-PACKAGES
;;; so frequently, just get a fres... | null | https://raw.githubusercontent.com/fukamachi/clozure-cl/4b0c69452386ae57b08984ed815d9b50b4bcc8a2/cocoa-ide/apropos-window.lisp | lisp | -*-Mode: LISP; Package: GUI -*-
This is a premature optimization. Instead of calling LIST-ALL-PACKAGES
so frequently, just get a fresh copy when the user clicks in the
combo box.
search all packages
Data source methods for package combo box
Table view delegate methods | Copyright ( C ) 2007 Clozure Associates
(in-package "GUI")
(defclass package-combo-box (ns:ns-combo-box)
((packages :initform nil))
(:metaclass ns:+ns-object))
(objc:defmethod (#/becomeFirstResponder :<BOOL>) ((self package-combo-box))
(with-slots (packages) self
(setf packages (coerce (list-all-packag... |
6848c262c1db07184f78a50efc7fe89ff8edacd061d2f72d241f8c0e10957404 | cpeikert/Lol | SimpleCycRepBenches.hs | |
Module : Crypto . Lol . Benchmarks . SimpleCycRepBenches
Description : Benchmarks for the ' CycRep ' interface , without benchmark harness .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX... | null | https://raw.githubusercontent.com/cpeikert/Lol/4416ac4f03b0bff08cb1115c72a45eed1fa48ec3/lol/Crypto/Lol/Benchmarks/SimpleCycRepBenches.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
x1 :: CycRep t P m (r, r) <- getRandom
let x1' = toDec x1
(Right x2) :: CycRepPC t m (r, r) <- getRandom
bench "unzipPow" $ nf unzipPow x1,
bench "unzipDec" $ n... | |
Module : Crypto . Lol . Benchmarks . SimpleCycRepBenches
Description : Benchmarks for the ' CycRep ' interface , without benchmark harness .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX... |
5c3b5f50bdcbf17b9c98d4d7b57878ee6f661bd76397faa08598bb7d01a7497c | racket/htdp | htdp-beginner.rkt | ;; Implements the Beginner Scheme language, at least in terms of the
;; forms and procedures. The reader-level aspects of the language
;; (e.g., case-sensitivity) are not implemented here.
#lang scheme/base
(require mzlib/etc
mzlib/list
syntax/docprovide
"private/rewrite-error-message.rkt"
... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-lib/lang/htdp-beginner.rkt | racket | Implements the Beginner Scheme language, at least in terms of the
forms and procedures. The reader-level aspects of the language
(e.g., case-sensitivity) are not implemented here.
Implements the forms:
syntax:
cons-of
Property
check-property for-all ==> expect expect-within expect-member-of expect-range
pro... |
#lang scheme/base
(require mzlib/etc
mzlib/list
syntax/docprovide
"private/rewrite-error-message.rkt"
(for-syntax "private/rewrite-error-message.rkt")
(for-syntax scheme/base))
(require "private/provide-and-scribble.rkt")
(require "private/teach.rkt"
"private/te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.