_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 |
|---|---|---|---|---|---|---|---|---|
af1c0166800fde261165a124ad4609c98bd9ee581257a9eb597d139514ee7b6f | logicmoo/logicmoo_nlu | subsumes.lsp | ;;; % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% Example code from the book " Natural Language Processing in LISP " %
% published by %
% Copyright ( c ) 1989 , . %
;;; % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %... | null | https://raw.githubusercontent.com/logicmoo/logicmoo_nlu/c066897f55b3ff45aa9155ebcf799fda9741bf74/ext/nlp_book/lisp/subsumes.lsp | lisp | % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
This function attempts to construct a substitution which
This is put in var_map. var_map is used to hold values for
substitutions that can be made for these variable... | % Example code from the book " Natural Language Processing in LISP " %
% published by %
% Copyright ( c ) 1989 , . %
subsumes.lsp [ Chapter 7 ] subsumption for dags
does the first subsume the second ?
when applied to the first structure gives the second... |
51655bf8c64e5734038b9b3184d2ba43c30571b2f250e13f5872f2e68eecd978 | agda/agda | SparseMatrix.hs | # LANGUAGE TemplateHaskell #
module Internal.Termination.SparseMatrix
( matrix
, tests
) where
import Agda.Termination.Semiring (HasZero(..), Semiring)
import qualified Agda.Termination.Semiring as Semiring
import Agda.Termination.SparseMatrix
import Agda.Utils.Functor
import Agda.Utils.Tuple
import Data.Array... | null | https://raw.githubusercontent.com/agda/agda/4f3899c597792fa4455e0f8134dfd63bc89b1c07/test/Internal/Termination/SparseMatrix.hs | haskell | ----------------------------------------------------------------------
* Generators, properties and tests
----------------------------------------------------------------------
** Size
----------------------------------------------------------------------
| Size invariant: dimensions are non-negative.
** Matrix ind... | # LANGUAGE TemplateHaskell #
module Internal.Termination.SparseMatrix
( matrix
, tests
) where
import Agda.Termination.Semiring (HasZero(..), Semiring)
import qualified Agda.Termination.Semiring as Semiring
import Agda.Termination.SparseMatrix
import Agda.Utils.Functor
import Agda.Utils.Tuple
import Data.Array... |
9c4a737eef7cc1fe2fd0c35ce6fa6b5809417a03db7ca15e5735b0ac56b83cc9 | incanter/incanter | cubic_spline_tests.clj | (ns incanter.interp.cubic-spline-tests
(:use incanter.core)
(:require [clojure.test :refer :all]
[incanter.interp
[cubic-spline :refer :all]
[test-common :refer :all]]))
(deftest compliance-test
(doseq [impl [:clatrix :ndarray :persistent-vector :vectorz]]
(set-current-i... | null | https://raw.githubusercontent.com/incanter/incanter/e0a03aac237fcc60587278a36bd2e76266fc6356/modules/incanter-core/test/incanter/interp/cubic_spline_tests.clj | clojure | (ns incanter.interp.cubic-spline-tests
(:use incanter.core)
(:require [clojure.test :refer :all]
[incanter.interp
[cubic-spline :refer :all]
[test-common :refer :all]]))
(deftest compliance-test
(doseq [impl [:clatrix :ndarray :persistent-vector :vectorz]]
(set-current-i... | |
e2f5eeca69191051388977aa311a3eecb49477823f39cee7240fc5759c76149c | homegrownlabs/sim-template | actions.clj | (ns {{namespace}}.actions
"Support for actions, incl. logging success or failure to the action log."
(:require [simulant.sim :as sim]
[simulant.util :refer [e solo only]]
[datomic.api :as d]
[cheshire.core :as json]))
(defmacro timed
"Evaluate expression, returning a pair of [... | null | https://raw.githubusercontent.com/homegrownlabs/sim-template/2ddba7c1a3c2a17aff1e1ed30bada941bcb938a3/src/leiningen/new/sim_test/src/actions.clj | clojure | (ns {{namespace}}.actions
"Support for actions, incl. logging success or failure to the action log."
(:require [simulant.sim :as sim]
[simulant.util :refer [e solo only]]
[datomic.api :as d]
[cheshire.core :as json]))
(defmacro timed
"Evaluate expression, returning a pair of [... | |
8bd1b304bb10b0fdfb21fdfb1d7ca9ae5118a78568f23fe240675116ca950537 | vydd/sketch | pen.lisp | ;;;; pen.lisp
(in-package #:sketch)
;;; ____ _____ _ _
;;; | _ \| ____| \ | |
;;; | |_) | _| | \| |
| _ _ /| |___| |\ |
|_| |_____|_| \_|
(defstruct pen
(fill nil)
(stroke nil)
(weight 1)
(curve-steps 100))
(defmacro with-pen (pen &body body)
(alexandria:once-only (pen)
`(alexandria:... | null | https://raw.githubusercontent.com/vydd/sketch/1a2e4bba865d5083889c68f8755ef6c0e2a7d5a2/src/pen.lisp | lisp | pen.lisp
____ _____ _ _
| _ \| ____| \ | |
| |_) | _| | \| | |
(in-package #:sketch)
| _ _ /| |___| |\ |
|_| |_____|_| \_|
(defstruct pen
(fill nil)
(stroke nil)
(weight 1)
(curve-steps 100))
(defmacro with-pen (pen &body body)
(alexandria:once-only (pen)
`(alexandria:with-gensyms (previous-pen)
(progn
(setf previous-pen (env-pen *env*)... |
a13bfa01869daab320a34eee6d4e17ee209d2c7f2ea6e153919fddd21c3d5357 | ocaml/dune | promotion.mli | open Import
val group : unit Cmd.t
val promote : unit Cmd.t
| null | https://raw.githubusercontent.com/ocaml/dune/3eaf83cd678009c586a0a506bc4755a3896be0f8/bin/promotion.mli | ocaml | open Import
val group : unit Cmd.t
val promote : unit Cmd.t
| |
d63afcf70e53e0482f55efa9db2596c76aff35bca268c3b29d2963c9e58746db | ollef/sixty | Hydrated.hs | # LANGUAGE BlockArguments #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedRecordDot #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoFieldSelectors #
module Error.Hydrated where
import qualified Core.Pretty as Pretty
import Data.Coerce
import Data.Persi... | null | https://raw.githubusercontent.com/ollef/sixty/5d630ca6fde91da5a691dc7cd195f5cbf6491eb0/src/Error/Hydrated.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------- | # LANGUAGE BlockArguments #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedRecordDot #
# LANGUAGE NoFieldSelectors #
module Error.Hydrated where
import qualified Core.Pretty as Pretty
import Data.Coerce
import Data.Persist
import qualified Data.Text as Text
import qualified Data.Text.Un... |
c1a069850142e7870299e22f70cace934673cb8a030adbc2ce87f71340fbd903 | ghcjs/jsaddle-dom | SVGPointList.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGPointList
(clear, initialize, initialize_, getItem, getItem_,
insertItemBefore, insertItemBefore_, repla... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/SVGPointList.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/SVGPointList.numberOfItems Mozilla SVGPointList.numberOfItems documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGPointList
(clear, initialize, initialize_, getItem, getItem_,
insertItemBefore, insertItemBefore_, replaceItem, replaceItem_,
removeItem, removeItem_, appendItem, appendItem_, getNumberOfItems,
... |
5f8b36d6e45c2d5e1f78aecde3906907b53a60b82da34bb3e4a466813ced75fb | tnelson/FlowLog | Flowlog_Types.ml | (****************************************************************)
(* Most type definitions and a few helpers *)
(* Includes both AST-level and program-level types *)
(****************************************************************)
open Printf
open ExtList.List
open NetCore_Types
... | null | https://raw.githubusercontent.com/tnelson/FlowLog/8be5051a4b3fa05c6299cdfa70f6a3def3893cf1/interpreter/Flowlog_Types.ml | ocaml | **************************************************************
Most type definitions and a few helpers
Includes both AST-level and program-level types
**************************************************************
*********************************************
**********************... |
open Printf
open ExtList.List
open NetCore_Types
Formula types are shared by AST and program
type term =
| TConst of string
| TVar of string
| TField of string * string;;
type formula =
| FTrue
| FFalse
| FEquals of term * term... |
979b73c14373a4a03c65d3e2eaf708a7acac4342519f83f967b3e4aeda743d57 | Clozure/ccl-tests | remove-method.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun May 11 19:53:37 2003
;;;; Contains: Tests of REMOVE-METHOD
(in-package :cl-test)
(defparameter *remove-meth-gf-01*
(defgeneric remove-meth-gf-01 (x)))
(defparameter *remove-meth-gf-01-method-t*
(defmethod remove-meth-gf-01 ((x t)) x))
(defparameter *remo... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/remove-method.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of REMOVE-METHOD
remove method must not signal an error if the method
does not belong to the generic function
Add, then remove, a method
Remove in the other order
Adding and removing auxiliary methods
Must add tests for nonstandard method combinations | Author :
Created : Sun May 11 19:53:37 2003
(in-package :cl-test)
(defparameter *remove-meth-gf-01*
(defgeneric remove-meth-gf-01 (x)))
(defparameter *remove-meth-gf-01-method-t*
(defmethod remove-meth-gf-01 ((x t)) x))
(defparameter *remove-meth-gf-02*
(defgeneric remove-meth-gf-02 (x)))
(defpara... |
1dadc2ec539ac847da8c8b7cdec7dae0ed38cd3be6c30138d4725993d8041de4 | retro/keechma-next-realworld-app | api.cljs | (ns app.api
(:require [keechma.next.toolbox.ajax :refer [GET POST DELETE PUT]]
[app.settings :as settings]
[promesa.core :as p]))
(def default-request-config
{:response-format :json
:keywords? true
:format :json})
(defn add-auth-header [req-params jwt]
(if jwt
(assoc-in req-par... | null | https://raw.githubusercontent.com/retro/keechma-next-realworld-app/47a14f4f3f6d56be229cd82f7806d7397e559ebe/classes/production/realworld-2/app/api.cljs | clojure | (ns app.api
(:require [keechma.next.toolbox.ajax :refer [GET POST DELETE PUT]]
[app.settings :as settings]
[promesa.core :as p]))
(def default-request-config
{:response-format :json
:keywords? true
:format :json})
(defn add-auth-header [req-params jwt]
(if jwt
(assoc-in req-par... | |
2bc66fc140adc1028dd283494bb58dfbe850ce114bb8425adfd8fe56dedafab9 | bellissimogiorno/nominal | UntypedLambda.hs | |
Module :
Description : Syntax and reductions of the untyped lambda - calculus using the Nominal package
Copyright : ( c ) , 2020
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
Untyped lambda - calculus : syntax , substitution , nominal - style rec... | null | https://raw.githubusercontent.com/bellissimogiorno/nominal/ab3306ee349dc481d2e2e6d103d90ffdd14ccaa9/src/Language/Nominal/Examples/UntypedLambda.hs | haskell | to derive ' Swappable '
to derive ' Data '
to derive 'Swappable'
to derive 'Data'
| Variables are string-labelled names
| Terms of the untyped lambda-calculus
^ Variable
^ Application
^ Lambda, using abstraction-type
, Show)
| helper for building lambda-abstractions
| Substitution. Capture-avoidan... | |
Module :
Description : Syntax and reductions of the untyped lambda - calculus using the Nominal package
Copyright : ( c ) , 2020
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
Untyped lambda - calculus : syntax , substitution , nominal - style rec... |
4029442068070ce15d318108b3cba195151d7c18806bba08ad3eaa23a0bf247b | Copilot-Language/copilot | Analyze.hs | Copyright © 2011 National Institute of Aerospace / Galois , Inc.
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE GADTs #
{-# LANGUAGE Safe #-}
# LANGUAGE ScopedTypeVariables #
-- | Copilot specification sanity check.
module Copilot.Language.Analyze
( AnalyzeException (..)
, analyz... | null | https://raw.githubusercontent.com/Copilot-Language/copilot/17a9b45eea4e95a465d6e773c6fbcf9bf810b6cc/copilot-language/src/Copilot/Language/Analyze.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE Safe #
| Copilot specification sanity check.
| Exceptions or kinds of errors in Copilot specifications that the analysis
implemented is able to detect.
| Show instance that prints a detailed message for each kind of exception.
| 'Exception' instance so we ... | Copyright © 2011 National Institute of Aerospace / Galois , Inc.
# LANGUAGE GADTs #
# LANGUAGE ScopedTypeVariables #
module Copilot.Language.Analyze
( AnalyzeException (..)
, analyze
) where
import Copilot.Core (DropIdx)
import qualified Copilot.Core as C
import Copilot.Language.Stream (Strea... |
baf5aa2302926e609aae865bb5d5e3a21ae52073a5996726b6b5e2a9ea6767c0 | dinosaure/tuyau | tuyau_mirage_tcp.mli | type ('stack, 'ip) endpoint =
{ stack : 'stack
; keepalive : Mirage_protocols.Keepalive.t option
; nodelay : bool
; ip : 'ip
; port : int }
type 'stack configuration =
{ stack : 'stack
; keepalive : Mirage_protocols.Keepalive.t option
; nodelay : bool
; port : int }
module Make (StackV4 : Mirage_sta... | null | https://raw.githubusercontent.com/dinosaure/tuyau/8ed849805153f5dfad6c045782e3d20ef06cd9b6/mirage/tuyau_mirage_tcp.mli | ocaml | type ('stack, 'ip) endpoint =
{ stack : 'stack
; keepalive : Mirage_protocols.Keepalive.t option
; nodelay : bool
; ip : 'ip
; port : int }
type 'stack configuration =
{ stack : 'stack
; keepalive : Mirage_protocols.Keepalive.t option
; nodelay : bool
; port : int }
module Make (StackV4 : Mirage_sta... | |
ac3dc9d2aa8336336c68a4da2a0c4cd3080b7013202dab684dd8718b10831f3c | mlabs-haskell/ogmios-datum-cache | Error.hs | module Api.Error (
throwJsonError,
JsonError (JsonError),
) where
import Control.Monad.Catch (MonadThrow, throwM)
import Data.Aeson (ToJSON (toJSON), encode, object, (.=))
import Data.String (IsString)
import Data.Text (Text)
import Network.HTTP.Types (hContentType)
import Servant (
ServerError,
errBody,
err... | null | https://raw.githubusercontent.com/mlabs-haskell/ogmios-datum-cache/f7c748ef240b83ca1f1415d5cb7dd8f87400a426/src/Api/Error.hs | haskell | fourmolu is broken :(
ORMOLU_DISABLE | module Api.Error (
throwJsonError,
JsonError (JsonError),
) where
import Control.Monad.Catch (MonadThrow, throwM)
import Data.Aeson (ToJSON (toJSON), encode, object, (.=))
import Data.String (IsString)
import Data.Text (Text)
import Network.HTTP.Types (hContentType)
import Servant (
ServerError,
errBody,
err... |
f5afc215632a9f5ee3a0475447a797f6ab956c3ff642a9186f4a0bee607bcfc3 | spechub/Hets | Print.hs | |
Module : ./THF / Print.hs
Description : Seveal Pretty instances .
Copyright : ( c ) , DFKI Bremen 2011
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
Pretty instances some data structures of As , Sign and ... | null | https://raw.githubusercontent.com/spechub/Hets/bbaa9dd2d2e5eb1f2fd3ec6c799a6dde7dee6da2/THF/Print.hs | haskell | -----------------------------------------------------------------------------
Some pretty instances for datastructures defined in Cons and Sign and
other print methods
-----------------------------------------------------------------------------
print the signature, with axioms and the proof goal
print a Named Sent... | |
Module : ./THF / Print.hs
Description : Seveal Pretty instances .
Copyright : ( c ) , DFKI Bremen 2011
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
Pretty instances some data structures of As , Sign and ... |
5964f9708aeb2c3270f352afc9fbe640265daff6ef5097acfcf5200ec2c8e663 | mlabs-haskell/plutus-pioneer-program | Model.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE NumericUnderscores #-}
# LANGUAGE Overloa... | null | https://raw.githubusercontent.com/mlabs-haskell/plutus-pioneer-program/b50b196d57dc35559b7526fe17b49dd2ba4790bc/code/week08/test/Spec/Model.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
has ... | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Spec.Model
( tests
, test
, TSModel (..)
) where
import Control.Lens ... |
9fe3912ed201d2c3ca246a4227be5869e923ff4769609d382650843c3732fe6c | ocaml-multicore/ocaml-tsan | test_caml_runparams.ml | (* TEST
include runtime_events
ocamlrunparam += ",e=4"
*)
(* We set the ring buffer size smaller and witness that we do indeed
lose events. *)
open Runtime_events
let lost_any_events = ref false
let lost_events _domain_id num =
if num > 0 then
lost_any_events := true
let () =
start ();
let cu... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/lib-runtime-events/test_caml_runparams.ml | ocaml | TEST
include runtime_events
ocamlrunparam += ",e=4"
We set the ring buffer size smaller and witness that we do indeed
lose events. |
open Runtime_events
let lost_any_events = ref false
let lost_events _domain_id num =
if num > 0 then
lost_any_events := true
let () =
start ();
let cursor = create_cursor None in
let callbacks = Callbacks.create ~lost_events ()
in
for epoch = 1 to 20 do
Gc.full_major ()
d... |
a349f451ef38c7922c08ea353c095aee2bf80bc71332ed1cc35736e3bedb8090 | onyx-platform/learn-onyx | challenge_6_1_test.clj | (ns workshop.jobs.challenge-6-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-6-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
In the previous challenge , we used the aggreg... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/test/workshop/jobs/challenge_6_1_test.clj | clojure | buffer all segments in memory. It's more common to maintain
a running, compounded aggregate. In this challenge, your
of coordindating job completion, we reused all of the atom
and promise code from the previous example. Make sure you understand
how that works so you'll have a smooth learning experience
with the r... | (ns workshop.jobs.challenge-6-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-6-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
In the previous challenge , we used the aggreg... |
41d1775bb09d6e0ebbbeb37a7564ea20b4d76eb02012ff7694dbe1b80d29c2b9 | well-typed/recover-rtti | Classify.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE PatternSynonyms #-}
# LANGUAGE QuantifiedConstraints #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTy... | null | https://raw.githubusercontent.com/well-typed/recover-rtti/c9409621188d0209919c2297a2012341607a4b0b/src/Debug/RecoverRTTI/Classify.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE PatternSynonyms #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeOperators #
* Classification
* User-defined types
* Showing values
-----------------... | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -fno - warn - orph... |
dfc846c539a7636e52820666e1c551e0c0d99fe098b6d31276e86d98157d58b6 | chiroptical/optics-by-example | Lib.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TemplateHaskell #
module Lib where
import Control.Lens
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Control.Monad.Trans.State
import Data.Foldable
import qualified Data.Map as M
import Text.Printf
newtype Use... | null | https://raw.githubusercontent.com/chiroptical/optics-by-example/3ee33546ee18c3a6f5510eec17a69d34e750198e/chapter13/src/Lib.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TemplateHaskell #
module Lib where
import Control.Lens
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Control.Monad.Trans.State
import Data.Foldable
import qualified Data.Map as M
import Text.Printf
newtype Use... | |
4e9cf9d7e4129bbe7c78dc83b172badf33faa474decde0037de358aa6df7fe96 | biegunka/biegunka | IO.hs | module Control.Biegunka.Execute.IO
( compareContents
, hash
, prepareDestination
) where
import Control.Exception (handleJust)
import Control.Monad (guard, void)
import Control.Monad.Trans.Resource (runResourceT)
import qualified Crypto.Hash as Hash
import Data.Conduit
i... | null | https://raw.githubusercontent.com/biegunka/biegunka/74fc93326d5f29761125d7047d5418899fa2469d/src/Control/Biegunka/Execute/IO.hs | haskell | # ANN module "HLint: ignore Use const" #
if both files exist and are readable but differ, and @Nothing@ if both files
exist, are readable and their contents are the same.
^ source
^ destination, may not exist
`src` is a new `dst`
| Create a directory for a file with a given filepath to reside in and
unlink the f... | module Control.Biegunka.Execute.IO
( compareContents
, hash
, prepareDestination
) where
import Control.Exception (handleJust)
import Control.Monad (guard, void)
import Control.Monad.Trans.Resource (runResourceT)
import qualified Crypto.Hash as Hash
import Data.Conduit
i... |
9452c071ee5d07bfa100500cb999026059d506c0b30301b85235dac614cd1847 | xxyzz/SICP | Exercise_3_16.rkt | #lang racket/base
(define (count-pairs x)
(if (not (mpair? x))
0
(+ (count-pairs (mcar x))
(count-pairs (mcdr x))
1)))
(define (last-pair x)
(if (null? (mcdr x)) x (last-pair (mcdr x))))
(count-pairs (mcons 'a (mcons 'b (mcons 'c null))))
3
(define count-4-list (mcons 'a (mcons '... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/3_Modularity_Objects_and_State/3.3_Modeling_with_Mutable_Data/Exercise_3_16.rkt | racket | 🚫 is null
__________
| |
| v
⬛⬛->⬛⬛->⬛🚫
| |
b c
1 + (1 + 1 + 1) + (1 + 1 + 1)
____
| |
| v
⬛⬛->⬛⬛->⬛🚫
| ^ |
| | c
-----
infinite loop
_
| |
v |
⬛⬛->⬛⬛->⬛⬛ | #lang racket/base
(define (count-pairs x)
(if (not (mpair? x))
0
(+ (count-pairs (mcar x))
(count-pairs (mcdr x))
1)))
(define (last-pair x)
(if (null? (mcdr x)) x (last-pair (mcdr x))))
(count-pairs (mcons 'a (mcons 'b (mcons 'c null))))
3
(define count-4-list (mcons 'a (mcons '... |
f38ae7bb7f8177a3e868fd6fa0f3d8bf3b7f0b5b4e2619906e252ffcd448da7b | VERIMAG-Polyhedra/VPL | EqSet_t.ml | open Vpl
module Cs = Cstr.Rat
let factory : Cs.t Factory.t = {
Factory.name = "Cstr";
Factory.top = (Cs.mk Cstr_type.Eq [] Scalar.Rat.z);
Factory.triv = (fun cmp n -> Cs.mk cmp [] n);
Factory.add = Cs.add;
Factory.mul = Cs.mulc;
Factory.to_le = (fun c -> {c with Cs.typ = Cstr_type.Le});
Factory.merge = (fun c1... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/test/core/EqSet_t.ml | ocaml | XXX: This function does not do any check on the inputs.
EqSet.filter
XXX: check that all is fine when adding multiple equalities
implementation detail
EqSet.subst
EqSet.tryDefs
EqSet.trySubstM
(* EqSet.joinSetup
EqSet.rename
joinSetupTs; | open Vpl
module Cs = Cstr.Rat
let factory : Cs.t Factory.t = {
Factory.name = "Cstr";
Factory.top = (Cs.mk Cstr_type.Eq [] Scalar.Rat.z);
Factory.triv = (fun cmp n -> Cs.mk cmp [] n);
Factory.add = Cs.add;
Factory.mul = Cs.mulc;
Factory.to_le = (fun c -> {c with Cs.typ = Cstr_type.Le});
Factory.merge = (fun c1... |
2ed499db84a0ca0d284169bc56162e68e356c5a32cba25c3fa985b0489f47a8e | hammerlab/ketrew | client.mli | (**************************************************************************)
Copyright 2014 , 2015 :
< > ,
< > ,
Arun < > ,
< > ... | null | https://raw.githubusercontent.com/hammerlab/ketrew/8940d48fbe174709f076b7130974ecd0ed831d58/src/lib/client.mli | ocaml | ************************************************************************
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | Copyright 2014 , 2015 :
< > ,
< > ,
Arun < > ,
< >
Licensed under the Apache License , Version 2.0 ( the " Licen... |
6e08a67397fb6948cd643419df7c3e88485e46a3e9146a5c4a5e1a120fe9aadd | bzliu94/cs61a_fa07 | query_modified.scm | ;;;;QUERY SYSTEM FROM SECTION 4.4.4 OF
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;;Matches code in ch4.scm
;;;;Includes:
-- supporting code from 4.1 , chapter 3 , and instructor 's manual
-- data base from Section 4.4.1 -- see microshaft - data - base below
;;;;This file can be loaded into Scheme... | null | https://raw.githubusercontent.com/bzliu94/cs61a_fa07/12a62689f149ef035a36b326351928928f6e7b5d/02%20-%20labs/lab15/query_modified.scm | scheme | QUERY SYSTEM FROM SECTION 4.4.4 OF
STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
Matches code in ch4.scm
Includes:
This file can be loaded into Scheme as a whole.
In order to run the query system, the Scheme must support streams.
Instead use initialize-data-base (from manual), supplied in this file.
SECTION 4.4.4.... |
-- supporting code from 4.1 , chapter 3 , and instructor 's manual
-- data base from Section 4.4.1 -- see microshaft - data - base below
NB . PUT 's are commented out and no top - level table is set up .
The Driver Loop and Instantiation
(define input-prompt ";;; Query input:")
(define output-prompt ";;; Qu... |
c1dae2924185b13a64910cf6a30be5162717c0ec714b63ae8fef3a6a5e0138c5 | DaMSL/K3 | Imperative.hs | # LANGUAGE LambdaCase #
# LANGUAGE ViewPatterns #
# LANGUAGE TypeFamilies #
| Imperative code generation for K3 .
This module provides functions which perform the first stage tree transformation to the
-- imperative embedding. Stringification to a target language must be done subsequently.
module Language.K3.Codeg... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Codegen/Imperative.hs | haskell | imperative embedding. Stringification to a target language must be done subsequently.
* Transformation Types
* Transformation Actions
* Tree Forms
| Add a new showable variable | # LANGUAGE LambdaCase #
# LANGUAGE ViewPatterns #
# LANGUAGE TypeFamilies #
| Imperative code generation for K3 .
This module provides functions which perform the first stage tree transformation to the
module Language.K3.Codegen.Imperative (
ImperativeE,
ImperativeS(..),
ImperativeM,
runImperative... |
404f5d3dbf240549115f48e3994a5175343169b6a631c6e373f3819210c87c74 | solbloch/stumpwm-configs | battery.lisp | (in-package :stumpwm)
(defun battery-list ()
(remove-if-not #'(lambda (supply)
(search "BAT" (namestring supply)))
(uiop:subdirectories "/sys/class/power_supply/")))
(defun battery-alist (battery)
(with-open-file (stream (str:concat (namestring battery) "uevent"))
(loop f... | null | https://raw.githubusercontent.com/solbloch/stumpwm-configs/687118d5202e3e3c8317ba1ba8404034a5bca667/battery.lisp | lisp | (in-package :stumpwm)
(defun battery-list ()
(remove-if-not #'(lambda (supply)
(search "BAT" (namestring supply)))
(uiop:subdirectories "/sys/class/power_supply/")))
(defun battery-alist (battery)
(with-open-file (stream (str:concat (namestring battery) "uevent"))
(loop f... | |
df06eca719c531d84873a5e244975e79d25d5797ea9ace9fa336690866530f95 | well-typed/lens-sop | Named.hs | module Generics.SOP.Lens.Named (
* total lens , abstracted over target
LensName
, NamedLens(..)
, get
, modify
, set
-- * Generic construction
, gnamedLenses
) where
import Generics.SOP
import Generics.SOP.Lens (GLens)
import qualified Generics.SOP.Lens as GLens
{-------------------------------... | null | https://raw.githubusercontent.com/well-typed/lens-sop/7ec872f5e7ece02b366c5deae21327153bdc7360/src/Generics/SOP/Lens/Named.hs | haskell | * Generic construction
------------------------------------------------------------------------------
Wrapper around Data.Label
------------------------------------------------------------------------------
| Total abstract lens
----------------------------------------------------------------------------
---------... | module Generics.SOP.Lens.Named (
* total lens , abstracted over target
LensName
, NamedLens(..)
, get
, modify
, set
, gnamedLenses
) where
import Generics.SOP
import Generics.SOP.Lens (GLens)
import qualified Generics.SOP.Lens as GLens
type LensName = String
data NamedLens a ctxt = forall b. ctx... |
ba859bcae2d241f6999ccfe64c34a649349b598de360258bc9e923395bf3a6a6 | MinaProtocol/mina | ledger_hash.ml | open Core_kernel
open Mina_base_import
open Snark_params
open Snarky_backendless
open Tick
open Let_syntax
let merge_var ~height h1 h2 =
Random_oracle.Checked.hash ~init:(Hash_prefix.merkle_tree height) [| h1; h2 |]
module Merkle_tree =
Snarky_backendless.Merkle_tree.Checked
(Tick)
(struct
type valu... | null | https://raw.githubusercontent.com/MinaProtocol/mina/774ee06e0aa9472f9eb8f71f346c13b7e283af4b/src/lib/mina_base/ledger_hash.ml | ocaml | End boilerplate
[modify_account t aid ~filter ~f] implements the following spec:
- finds an account [account] in [t] for [aid] at path [addr] where [filter
account] holds.
note that the account is not guaranteed to have identifier [aid]; it might
be a new account created to satisfy this request... | open Core_kernel
open Mina_base_import
open Snark_params
open Snarky_backendless
open Tick
open Let_syntax
let merge_var ~height h1 h2 =
Random_oracle.Checked.hash ~init:(Hash_prefix.merkle_tree height) [| h1; h2 |]
module Merkle_tree =
Snarky_backendless.Merkle_tree.Checked
(Tick)
(struct
type valu... |
862e38ddb989f6f8fff9d4b1b18e717c2cdd7e27bdec333d93607de39f62ae20 | BoeingX/haskell-programming-from-first-principles | ConstantExerciseSpec.hs | module Applicative.ApplicativeInUse.ConstantExerciseSpec where
import Data.Monoid (Sum (..))
import Test.Hspec
import Applicative.ApplicativeInUse.ConstantExercise
spec :: Spec
spec = do
describe "Test Constant implementation" $ do
it "Constant (Sum 1) <*> Constant (Sum 2) should equal Constant (Sum 3)" $... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/test/Applicative/ApplicativeInUse/ConstantExerciseSpec.hs | haskell | module Applicative.ApplicativeInUse.ConstantExerciseSpec where
import Data.Monoid (Sum (..))
import Test.Hspec
import Applicative.ApplicativeInUse.ConstantExercise
spec :: Spec
spec = do
describe "Test Constant implementation" $ do
it "Constant (Sum 1) <*> Constant (Sum 2) should equal Constant (Sum 3)" $... | |
12d56b8e92eb6772fe01bf567e8ab1d567686a3f6ca5d18728fb94b47ada7044 | ezrakilty/narc | Pretty.hs | module Database.Narc.SQL.Pretty where
import Database.Narc.Pretty
import Database.Narc.SQL
import Database.Narc.Util (mapstrcat)
instance Pretty Query where
pretty (Select{rslt=flds, tabs=tabs, cond=cond}) =
"select " ++ mapstrcat ", " (\(alias, expr) ->
pretty e... | null | https://raw.githubusercontent.com/ezrakilty/narc/76310e6ac528fe038d8bdd4aa78fa8c555501fad/Database/Narc/SQL/Pretty.hs | haskell | module Database.Narc.SQL.Pretty where
import Database.Narc.Pretty
import Database.Narc.SQL
import Database.Narc.Util (mapstrcat)
instance Pretty Query where
pretty (Select{rslt=flds, tabs=tabs, cond=cond}) =
"select " ++ mapstrcat ", " (\(alias, expr) ->
pretty e... | |
18b8075e17c3335530b9cf0ceffc376c4c2529655ed4f2f6864df00a4e559a8d | replikativ/hitchhiker-tree | testing.cljc | (ns hitchhiker.tree.backend.testing
(:require
[hitchhiker.tree.utils.async :as ha]
[hitchhiker.tree.node :as n]
[hitchhiker.tree.node.testing :as tn]
[hitchhiker.tree :as tree]
[hitchhiker.tree.backend :as b]))
(defrecord TestingBackend []
b/IBackend
(-new-session [_] (atom {:writes 0}))
(-ancho... | null | https://raw.githubusercontent.com/replikativ/hitchhiker-tree/9279fb75a581717e7b52a9d3f4c5e2e537458372/test/hitchhiker/tree/backend/testing.cljc | clojure | (ns hitchhiker.tree.backend.testing
(:require
[hitchhiker.tree.utils.async :as ha]
[hitchhiker.tree.node :as n]
[hitchhiker.tree.node.testing :as tn]
[hitchhiker.tree :as tree]
[hitchhiker.tree.backend :as b]))
(defrecord TestingBackend []
b/IBackend
(-new-session [_] (atom {:writes 0}))
(-ancho... | |
b3b6753591928b83d1dbc0215787e20127d8130805af9428eb107cdfa3b8e492 | hidaris/thinking-dumps | 07-friends_and_relations.rkt | #lang racket/base
(define atom?
(lambda (a)
(and (not (null? a)) (not (pair? a)))))
(define eqan?
(lambda (a1 a2)
(cond
((and (number? a1) (number? a2))
(= a1 a2))
((or (number? a1) (number? a2))
#f)
(else (eq? a1 a2)))))
(define eqlist?
(lambda (l1 l2)
(cond
((and (... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/the-little-series/the-little-schemer/07-friends_and_relations.rkt | racket | #lang racket/base
(define atom?
(lambda (a)
(and (not (null? a)) (not (pair? a)))))
(define eqan?
(lambda (a1 a2)
(cond
((and (number? a1) (number? a2))
(= a1 a2))
((or (number? a1) (number? a2))
#f)
(else (eq? a1 a2)))))
(define eqlist?
(lambda (l1 l2)
(cond
((and (... | |
cf39524495c383313fc05d1eeddfbfe1d93610e21a6b17a07d6a28f538afc333 | pva701/Haskell-Practices | Task3.hs | # LANGUAGE LambdaCase #
module Task3
( main3
) where
import Prelude
import Control.Monad (forM_, liftM2)
import Data.Array.IO (IOArray, getElems, newListArray, readArray, writeArray)
import Data.List (intercalate)
import Data.IORef (newIORef, readIORef, writeIORef)
selectionSort :: [Int] -> IO [Int]
selectionSo... | null | https://raw.githubusercontent.com/pva701/Haskell-Practices/71b9241cf92c757fa793fd0c0c053af77e68205d/lecture6-practice/src/Task3.hs | haskell | # LANGUAGE LambdaCase #
module Task3
( main3
) where
import Prelude
import Control.Monad (forM_, liftM2)
import Data.Array.IO (IOArray, getElems, newListArray, readArray, writeArray)
import Data.List (intercalate)
import Data.IORef (newIORef, readIORef, writeIORef)
selectionSort :: [Int] -> IO [Int]
selectionSo... | |
c4be4064412d3384327ed61f8d5e8555fd4333e8c91bb9b56ea468c1014953f1 | komadori/HsQML | MayGen.hs | module Graphics.QML.Test.MayGen where
import Test.QuickCheck.Gen
import Control.Applicative
import Data.Maybe
I wanted so badly to write a Monad instance for MayGen , but actually
-- Applicative captures the legal operations perfectly.
newtype MayGen a = MayGen {mayGen :: Maybe (Gen a)}
instance Functor MayGen wh... | null | https://raw.githubusercontent.com/komadori/HsQML/f57cffe4e3595bdf743bdbe6f44bf45a4001d35f/test/Graphics/QML/Test/MayGen.hs | haskell | Applicative captures the legal operations perfectly. | module Graphics.QML.Test.MayGen where
import Test.QuickCheck.Gen
import Control.Applicative
import Data.Maybe
I wanted so badly to write a Monad instance for MayGen , but actually
newtype MayGen a = MayGen {mayGen :: Maybe (Gen a)}
instance Functor MayGen where
fmap f (MayGen v) = MayGen $ (fmap . fmap) f v
... |
c7b56422e75b8857b44f029c1df1a309130c37a87d18338e6705145645fdf81d | WorksHub/client | fragments.cljc | (ns wh.graphql.fragments
(#?(:clj :require :cljs :require-macros)
[wh.graphql-macros :refer [deffragment]]))
;; Jobs
(deffragment jobCardFields :Job
[:id :slug :title :tagline [:tags :fragment/tagFields] :published :userScore
:roleType :sponsorshipOffered :remote :companyId :lastModified
[:company [:nam... | null | https://raw.githubusercontent.com/WorksHub/client/428afde8ac6dc20ae00972d5fc79880a8c4a92e1/common/src/wh/graphql/fragments.cljc | clojure | Jobs
Company
Issues
Articles/Blogs | (ns wh.graphql.fragments
(#?(:clj :require :cljs :require-macros)
[wh.graphql-macros :refer [deffragment]]))
(deffragment jobCardFields :Job
[:id :slug :title :tagline [:tags :fragment/tagFields] :published :userScore
:roleType :sponsorshipOffered :remote :companyId :lastModified
[:company [:name :slug ... |
53da7657c377aef88f0aeea8cf3a8b39515921bae8174480a6beed40a5b23121 | mirage/encore | encore.ml | module Lavoisier = Lavoisier
module Either = Either
module Bij = Bij
let always x _ = x
type 'a t =
| Product : 'a t * 'b t -> ('a * 'b) t
| Map : ('a, 'b) Bij.t * 'a t -> 'b t
| Either : 'a t * 'a t -> 'a t
| Fix : ('a t -> 'a t) -> 'a t
| Symbol : char t
| IgnR : 'a t * unit t -> 'a t
| IgnL : unit t ... | null | https://raw.githubusercontent.com/mirage/encore/55d8377c9fd3cb8f71cfe16d90aede0487a214cc/lib/encore.ml | ocaml | module Lavoisier = Lavoisier
module Either = Either
module Bij = Bij
let always x _ = x
type 'a t =
| Product : 'a t * 'b t -> ('a * 'b) t
| Map : ('a, 'b) Bij.t * 'a t -> 'b t
| Either : 'a t * 'a t -> 'a t
| Fix : ('a t -> 'a t) -> 'a t
| Symbol : char t
| IgnR : 'a t * unit t -> 'a t
| IgnL : unit t ... | |
d88e1a67697d082555921cba3b77e89acf28b306e6876a8b37d180bc69d3b278 | brabster/dynamodb-expressions | core_test.clj | (ns dynamodb-expression.core-test
(:require [clojure.test :refer [deftest use-fixtures is are testing]]
[dynamodb-expression.core :as dx]
[dynamodb-expression.grammar-test :as g]))
(defn strip-newlines [s] (clojure.string/replace s #"\n" ""))
(use-fixtures :each
(fn [f]
(let [cnt (atom... | null | https://raw.githubusercontent.com/brabster/dynamodb-expressions/8ca5ca758485fa272cec6e836e71279cd08b0104/test/dynamodb_expression/core_test.clj | clojure | (ns dynamodb-expression.core-test
(:require [clojure.test :refer [deftest use-fixtures is are testing]]
[dynamodb-expression.core :as dx]
[dynamodb-expression.grammar-test :as g]))
(defn strip-newlines [s] (clojure.string/replace s #"\n" ""))
(use-fixtures :each
(fn [f]
(let [cnt (atom... | |
082bfd271ccc741fab4523cc474452ddf33829e388198ce01264fbaa2075dc5e | morphismtech/squeal | Type.hs | |
Module : Squeal . PostgreSQL.Expression
Description : type expressions
Copyright : ( c ) , 2019
Maintainer :
Stability : experimental
type expressions
Module: Squeal.PostgreSQL.Expression
Description: type expressions
Copyright: (c) Eitan Chatav, 2019
Maintainer:
Stability: experimental
type expre... | null | https://raw.githubusercontent.com/morphismtech/squeal/599ebb9a0036ac7e5627be980a2a8de1a38ea4f0/squeal-postgresql/src/Squeal/PostgreSQL/Expression/Type.hs | haskell | * Type Cast
* Type Expression
* Column Type
* Type Inference
$setup
>>> import Squeal.PostgreSQL
When a `cast` is applied to an `Expression` of a known type, it
represents a run-time type conversion. The cast will succeed only if a
suitable type conversion operation has been defined.
| >>> printSQL $ true & ... | |
Module : Squeal . PostgreSQL.Expression
Description : type expressions
Copyright : ( c ) , 2019
Maintainer :
Stability : experimental
type expressions
Module: Squeal.PostgreSQL.Expression
Description: type expressions
Copyright: (c) Eitan Chatav, 2019
Maintainer:
Stability: experimental
type expre... |
ce77936b22b4e4ec22f8e29053f20a3f7fa07d15682c04b2d7ef8c90d3f54b01 | hendry19901990/erlang-ipfs-http-client | jsone.erl | %%% @doc JSON decoding/encoding module
%%% @end
%%%
Copyright ( c ) 2017 ,
%%%
%%% The MIT License
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including ... | null | https://raw.githubusercontent.com/hendry19901990/erlang-ipfs-http-client/f7e18cabe2901d64733027622677bbaea89f1587/src/jsone.erl | erlang | @doc JSON decoding/encoding module
@end
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subje... | Copyright ( c ) 2017 ,
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LI... |
f55cb64b82823df020356d74b888c2f26f4fc7120ddace5598c6bb2446d37c09 | kyleburton/sandbox | compojure.clj | (ns com.github.kyleburton.sandbox.compojure
(:use compojure))
(defn resource-link [lnk]
(format "%s?%s" lnk (.getTime (java.util.Date.))))
(defmacro mresource-link [lnk]
(format "%s?%s" lnk (.getTime (java.util.Date.))))
(defn template-page [request title & body]
(let [title (str "Compojure App - " title)]
... | null | https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/clojure-utils/kburton-clojure-utils/src/main/clj/com/github/kyleburton/sandbox/compojure.clj | clojure |
// separate
execute the next form to run the server
execute to stop the server | (ns com.github.kyleburton.sandbox.compojure
(:use compojure))
(defn resource-link [lnk]
(format "%s?%s" lnk (.getTime (java.util.Date.))))
(defmacro mresource-link [lnk]
(format "%s?%s" lnk (.getTime (java.util.Date.))))
(defn template-page [request title & body]
(let [title (str "Compojure App - " title)]
... |
321f66932ca023da6b35c7418775e9f70b3fe3ea9363baf31849f1449270d92a | opencog/pln | icl.scm | ;; Contain the main inference control meta-learning experiment loop
;; Load utils
(load "icl-parameters.scm")
(load "icl-utilities.scm")
(load "mk-history.scm")
(load "mk-control-rules.scm")
(load "mine-control-rules.scm")
;; Set the random seed of the experiment
(cog-randgen-set-seed! 1)
;; Set loggers levels
(cog-... | null | https://raw.githubusercontent.com/opencog/pln/52dc099e21393892cf5529fef687a69682436b2d/examples/pln/inference-control-meta-learning/icl.scm | scheme | Contain the main inference control meta-learning experiment loop
Load utils
Set the random seed of the experiment
Set loggers levels
Set loggers stdout
(cog-logger-set-stdout! #t)
(ure-logger-set-stdout! #t)
Set loggers sync (for debugging)
Clear and reload the kb and rb
Generate targets
Run all iterations
... |
(load "icl-parameters.scm")
(load "icl-utilities.scm")
(load "mk-history.scm")
(load "mk-control-rules.scm")
(load "mine-control-rules.scm")
(cog-randgen-set-seed! 1)
(cog-logger-set-level! "info")
(icl-logger-set-level! "info")
(ure-logger-set-level! "info")
(icl-logger-set-stdout! #t)
(cog-logger-set-sync! #t)
(... |
b607a38c15801a72646aeb7c15fc2c4f6eda53942638b6434d89e24f7ecc57de | ghc/testsuite | TcCoercibleFail3.hs | # LANGUAGE RoleAnnotations , RankNTypes , ScopedTypeVariables #
import GHC.Prim (coerce, Coercible)
newtype List a = List [a]
data T f = T (f Int)
newtype NT1 a = NT1 (a -> Int)
newtype NT2 a = NT2 (a -> Int)
foo :: T NT1 -> T NT2
foo = coerce
main = return ()
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/TcCoercibleFail3.hs | haskell | # LANGUAGE RoleAnnotations , RankNTypes , ScopedTypeVariables #
import GHC.Prim (coerce, Coercible)
newtype List a = List [a]
data T f = T (f Int)
newtype NT1 a = NT1 (a -> Int)
newtype NT2 a = NT2 (a -> Int)
foo :: T NT1 -> T NT2
foo = coerce
main = return ()
| |
ce65b87703b7ca04d7734db29938a72fc5cb10161105ed0ae16e558d74299a1c | jorgetavares/core-gp | evaluation.lisp | (in-package #:core-gp)
;;;
;;; classes
;;;
;;
;; fitness values
(defclass fitness ()
((raw-score
:initarg :raw-score :initform nil
:accessor raw-score
:documentation "Value obtained from the evaluation function.")
(fitness-score
:accessor fitness-score
:documentation "Scaled value of raw-sco... | null | https://raw.githubusercontent.com/jorgetavares/core-gp/90ec1c4599a19c5a911be1f703f78d5108aee160/src/evaluation.lisp | lisp |
classes
fitness values
methods
fitness values
genome
individual
population
scaling functions
| (in-package #:core-gp)
(defclass fitness ()
((raw-score
:initarg :raw-score :initform nil
:accessor raw-score
:documentation "Value obtained from the evaluation function.")
(fitness-score
:accessor fitness-score
:documentation "Scaled value of raw-score.")))
(defmethod initialize-instance :... |
818888599d836d858d80f28dc8aacb3060a8deecd10cd5fd3523c68b84d2bc75 | KaroshiBee/weevil | mdb_traced_interpreter.mli | open Mdb_import.Tez
type t
type cfg_t
(* old cfg *)
val make_log :
Ctxt.context ->
Tezos_micheline.Micheline_parser.location ->
('a * 's) ->
('a, 's) Prot.Script_typed_ir.stack_ty ->
cfg_t
(* old cfg *)
val unparsing_mode :
Prot.Script_ir_unparser.unparsing_mode
(* old cfg *)
TODO why err.tzresult ?
... | null | https://raw.githubusercontent.com/KaroshiBee/weevil/8565bf833db5114654495b361db5a4d53879e48b/bin/weevil_mdb_015/src/mdb_traced_interpreter.mli | ocaml | old cfg
old cfg
old cfg
old cfg
old cfg
old interp.trace_interp | open Mdb_import.Tez
type t
type cfg_t
val make_log :
Ctxt.context ->
Tezos_micheline.Micheline_parser.location ->
('a * 's) ->
('a, 's) Prot.Script_typed_ir.stack_ty ->
cfg_t
val unparsing_mode :
Prot.Script_ir_unparser.unparsing_mode
TODO why err.tzresult ?
val unparse_stack :
cfg_t ->
(Ctxt.Scr... |
31cddaeb5267e5d7c4e98d3f16736e1867c7232ba545131e2a7a93fc7c79f768 | boxer-project/boxer-sunrise | loader-tests.lisp | (in-package :boxer-sunrise-test)
(plan nil)
(let ((boxer::*supress-graphics-recording?* t)
(boxer::*draw-status-line* nil)
(henri-sun-v5 (merge-pathnames "data/boxfiles-v5/henri-sun-v5.box"
(make-pathname :directory (pathname-directory *load-truename*)))))
;; Ensu... | null | https://raw.githubusercontent.com/boxer-project/boxer-sunrise/922bd8d476ed4780b98476a93916d34d0f61c90c/tests/loader-tests.lisp | lisp | Ensure this is the actual original bits, and has never been resaved
and updated/fixed as part of the save process. | (in-package :boxer-sunrise-test)
(plan nil)
(let ((boxer::*supress-graphics-recording?* t)
(boxer::*draw-status-line* nil)
(henri-sun-v5 (merge-pathnames "data/boxfiles-v5/henri-sun-v5.box"
(make-pathname :directory (pathname-directory *load-truename*)))))
(is "24... |
46f9dc6d3913901535293ee83a9aeff93f04d04f99c6df42e81c4914e7f1decf | jfeser/L2 | library.mli | open Core
type t =
{ exprs: (string * Expr.t) list
; expr_ctx: Expr.t String.Map.t
; value_ctx: Value.t String.Map.t
; exprvalue_ctx: ExprValue.t String.Map.t
; type_ctx: Infer.Type.t String.Map.t
; builtins: Expr.Op.t list }
val empty : t
val from_channel_exn : file:string -> In_channel.t -> t
val from... | null | https://raw.githubusercontent.com/jfeser/L2/a66659c7d75f75788c48a17b531045fb3d5f8351/lib/library.mli | ocaml | open Core
type t =
{ exprs: (string * Expr.t) list
; expr_ctx: Expr.t String.Map.t
; value_ctx: Value.t String.Map.t
; exprvalue_ctx: ExprValue.t String.Map.t
; type_ctx: Infer.Type.t String.Map.t
; builtins: Expr.Op.t list }
val empty : t
val from_channel_exn : file:string -> In_channel.t -> t
val from... | |
504797739e0f4b357ca388cd03c7651a444486be08c6eb6f65be9d005dd42cff | lexi-lambda/clojure-fuzzy-urls | lens.clj | (ns fuzzy-urls.lens
(:require [fuzzy-urls.url :refer :all]))
(declare fuzzy-equal?)
(defrecord UrlLens [scheme-fn user-fn host-fn port-fn path-fn query-fn fragment-fn]
; lenses are applicable
clojure.lang.IFn
; they're also auto-curried for use in filter and similar functions
(invoke [this a] (fn [b] (this ... | null | https://raw.githubusercontent.com/lexi-lambda/clojure-fuzzy-urls/4a4cd81476d016634cedb3073ab201f8cbc0b606/src/fuzzy_urls/lens.clj | clojure | lenses are applicable
they're also auto-curried for use in filter and similar functions
this is required for implementing IFn properly
General lenses and lens constructors
-----------------------------------------------------------------------------
get all the sets that contain a...
...then check if any of them... | (ns fuzzy-urls.lens
(:require [fuzzy-urls.url :refer :all]))
(declare fuzzy-equal?)
(defrecord UrlLens [scheme-fn user-fn host-fn port-fn path-fn query-fn fragment-fn]
clojure.lang.IFn
(invoke [this a] (fn [b] (this a b)))
(invoke [this a b] (fuzzy-equal? this a b))
(applyTo [this args] (clojure.lang.AFn/ap... |
ba7cfb9034aa216ed68f8127dd97bafb772095a325848ca3e66ad426ada97b5c | axolotl-lang/axolotl | FunctionDef.hs | module Analyser.Analysers.FunctionDef where
import Analyser.Util
( AnalyserResult,
Def (Argument, Function, IncompleteFunction),
Env,
getTypeOfExpr,
hUnion,
hUnion',
isFnCall,
makeLeft,
)
import Control.Monad.State
( MonadIO (liftIO),
MonadState (get),
StateT (runStateT),
... | null | https://raw.githubusercontent.com/axolotl-lang/axolotl/4ce1b95827fac791dbe6e30fe48d3aa3c3740cae/src/Analyser/Analysers/FunctionDef.hs | haskell | name :: Text -> the name of the function
lookup name in global defs (gd)
to the definitions previously made (global definitions -- fst env)
which essentially is Function but without the body, since we
don't need it here. At the end, this will be replaced by the
recursive calls wi... | module Analyser.Analysers.FunctionDef where
import Analyser.Util
( AnalyserResult,
Def (Argument, Function, IncompleteFunction),
Env,
getTypeOfExpr,
hUnion,
hUnion',
isFnCall,
makeLeft,
)
import Control.Monad.State
( MonadIO (liftIO),
MonadState (get),
StateT (runStateT),
... |
19d1adb4ddaed7bf3ca595bdc9205206775de488e0d0e0b6b41e7bc3a1affb67 | exercism/ocaml | test.ml | open Base
open OUnit2
open Robot_name
let assert_matches_spec name =
let is_valid_letter ch = Char.('A' <= ch && ch <= 'Z') in
let is_valid_digit ch = Char.('0' <= ch && ch <= '9') in
assert_equal ~printer:Int.to_string 5 (String.length name);
assert_bool ("First character must be from A to Z") (is_valid_lette... | null | https://raw.githubusercontent.com/exercism/ocaml/bfd6121f757817865a34db06c3188b5e0ccab518/exercises/practice/robot-name/test.ml | ocaml | ; unique_name_tests | open Base
open OUnit2
open Robot_name
let assert_matches_spec name =
let is_valid_letter ch = Char.('A' <= ch && ch <= 'Z') in
let is_valid_digit ch = Char.('0' <= ch && ch <= '9') in
assert_equal ~printer:Int.to_string 5 (String.length name);
assert_bool ("First character must be from A to Z") (is_valid_lette... |
7ba2a064e5e0face96041b1c4af367eceaa5756864ada663e5a26324d01ca773 | lehins/primal | Bench.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - orphans #
module Main (main) where
import GHC.Exts
import Data.Proxy
import Data.Typeable
import Criterion.Main
import Primal.Memory.Bytes
imp... | null | https://raw.githubusercontent.com/lehins/primal/c620bfd4f2a6475f1c12183fbe8138cf29ab1dad/primal-memory/bench/Bench.hs | haskell | # LANGUAGE BangPatterns # | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - orphans #
module Main (main) where
import GHC.Exts
import Data.Proxy
import Data.Typeable
import Criterion.Main
import Primal.Memory.Bytes
import Primal.Memory.Ptr
import q... |
ca4c7517f2cc75ebbb5e658a8cd21a190433c3f8bee613eac5e1780ecaa90ec5 | Vonmo/eapa | eapa_int_SUITE.erl | -module(eapa_int_SUITE).
-compile(export_all).
-import(ct_helper, [config/2]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
all() ->
[
{group, int}
].
groups() ->
[
{int,
[parallel, shuffle],
[float_to_bigint,
add, add_prec1, add_prec2,
... | null | https://raw.githubusercontent.com/Vonmo/eapa/7c577851e3598c8c524999b89c89f9267e769e24/test/eapa_int_SUITE.erl | erlang | =============================================================================
init
=============================================================================
=============================================================================
end
=======================================================================... | -module(eapa_int_SUITE).
-compile(export_all).
-import(ct_helper, [config/2]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
all() ->
[
{group, int}
].
groups() ->
[
{int,
[parallel, shuffle],
[float_to_bigint,
add, add_prec1, add_prec2,
... |
7f071a05793150ee9f6d6b7e5f72239a415c03785410a21adae52e720073a93e | ekmett/algebra | Euclidean.hs | module Numeric.Domain.Euclidean (Euclidean(..), euclid, prs, chineseRemainder) where
import Numeric.Additive.Group
import Numeric.Algebra.Class
import Numeric.Algebra.Unital
import Numeric.Decidable.Zero
import Numeric.Domain.Internal
import Prelude (otherwise)
import qualified Prelude as P
prs :: Eucl... | null | https://raw.githubusercontent.com/ekmett/algebra/12dd33e848f406dd53d19b69b4f14c93ba6e352b/src/Numeric/Domain/Euclidean.hs | haskell | module Numeric.Domain.Euclidean (Euclidean(..), euclid, prs, chineseRemainder) where
import Numeric.Additive.Group
import Numeric.Algebra.Class
import Numeric.Algebra.Unital
import Numeric.Decidable.Zero
import Numeric.Domain.Internal
import Prelude (otherwise)
import qualified Prelude as P
prs :: Eucl... | |
54aa537501b0bb97d6e371d51077299da936ebfb058c640416b8a9df422ce0d4 | RyanGlScott/text-show-instances | PosixSpec.hs | # LANGUAGE CPP #
|
Module : Spec . System . PosixSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for data types in the @unix@ library .
Module: Spec.System.PosixSpec
Copyri... | null | https://raw.githubusercontent.com/RyanGlScott/text-show-instances/0b12ef75935eb68b44fc6528ffaba88079df6679/tests/Spec/System/PosixSpec.hs | haskell | # LANGUAGE CPP #
|
Module : Spec . System . PosixSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for data types in the @unix@ library .
Module: Spec.System.PosixSpec
Copyri... | |
bed7374a22ef303ccc5c43781bbb063303cb78ec61433dbbde94543a6b784c2c | sacerdot/MiniErlangBlockchain | miner_act.erl | -module(miner_act).
-export([start_M_act/2]).
-import(utils, [sleep/1]).
%! ---- Behavior di Miner Act -----
compute(PidRoot, PidBlock) ->
PidBlock ! {minerReady, self()},
mi metto in attesa di un nuovo set di transazioni da inserire nel blocco
receive
{createBlock, ID_blocco_prev, Transactions} ->
... | null | https://raw.githubusercontent.com/sacerdot/MiniErlangBlockchain/46713c579204994a528d2e642c8f7c0670c2a832/CaputoConteducaLazazzera-Node/actors/miner_act.erl | erlang | ! ---- Behavior di Miner Act -----
io:format("-> [~p] Sto minando il BLOCCO: ~p~n",[PidRoot,Transactions]), | -module(miner_act).
-export([start_M_act/2]).
-import(utils, [sleep/1]).
compute(PidRoot, PidBlock) ->
PidBlock ! {minerReady, self()},
mi metto in attesa di un nuovo set di transazioni da inserire nel blocco
receive
{createBlock, ID_blocco_prev, Transactions} ->
Solution = proof_of_work:solve({ID_b... |
5c37873c601c1f3fc6a5268fbed58695b7678472eb49e2484c562db1e58798e9 | spechub/Hets | Sign.hs | {-# LANGUAGE DeriveDataTypeable #-}
|
Module : ./NeSyPatterns / Sign.hs
Description : Signatures for syntax for neural - symbolic patterns
Copyright : ( c ) , Uni Magdeburg 2022
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portabili... | null | https://raw.githubusercontent.com/spechub/Hets/fc26b4947bf52be6baf7819a75d7e7f127e290dd/NeSyPatterns/Sign.hs | haskell | # LANGUAGE DeriveDataTypeable #
Signatures6
pretty printing
is a signature ok?
adds an edge to the given signature
adds an edge and its nodes to the given signature
union of signatures
empty signature
is subsignature?
Difference of Signatures
Union for Logic.Logic
extracts the ids of all nodes of a signature... | |
Module : ./NeSyPatterns / Sign.hs
Description : Signatures for syntax for neural - symbolic patterns
Copyright : ( c ) , Uni Magdeburg 2022
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
Definition of sig... |
2e2ae1b924b7ce63e42ba1c7ab9d71737830caae9e7a91c0a722b74b553810fd | UU-ComputerScience/uhc | Word.hs | # LANGUAGE NoImplicitPrelude , CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
# EXCLUDE_IF_TARGET js #
{-# EXCLUDE_IF_TARGET cr #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-sty... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/ehclib/uhcbase/Data/Word.hs | haskell | # EXCLUDE_IF_TARGET cr #
---------------------------------------------------------------------------
|
Module : Data.Word
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
Unsigned integer types.
--------------------------... | # LANGUAGE NoImplicitPrelude , CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
# EXCLUDE_IF_TARGET js #
Copyright : ( c ) The University of Glasgow 2001
module Data.Word
(
Word,
Word8, Word16, Word32, Word64,
) where
#ifdef __GLASGOW_HASKELL__
import GHC.Word
#endif
#ifdef __UHC__
impo... |
454a3dbe6f7c02405dfe1c66db0c5e6935f88494dfb61cbe2b44bf96966690eb | ulisesmac/Horarios-FC-UNAM | networking.cljs | (ns horarios-fc.networking
(:require [re-frame.core :as rf]))
(def domain "")
(defn http-request! [{:keys [method url on-success on-failure]}]
(-> (js/fetch url #js{:method (name method)})
(.then (fn [response]
(.text response)))
(.then (fn [text]
(on-success text)
... | null | https://raw.githubusercontent.com/ulisesmac/Horarios-FC-UNAM/dc203e0b424346f8540bbefd99e5d30572be389f/src/horarios_fc/networking.cljs | clojure | (ns horarios-fc.networking
(:require [re-frame.core :as rf]))
(def domain "")
(defn http-request! [{:keys [method url on-success on-failure]}]
(-> (js/fetch url #js{:method (name method)})
(.then (fn [response]
(.text response)))
(.then (fn [text]
(on-success text)
... | |
53f2b968165286d64792361123c4e6ac455a6d41631b6453124e827afe686a87 | spurious/sagittarius-scheme-mirror | %3a129.scm | (import (except (rnrs) string-titlecase)
(srfi :129)
(srfi :64))
(test-begin "SRFI 129 titlecase")
;; values are from SRFI-129 sample implementation tests
(test-assert (char-title-case? #\x01C5))
(test-assert (char-title-case? #\x1FFC))
(test-assert (not (char-title-case? #\Z)))
(test-assert (not (char-title-case? ... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/tests/srfi/%253a129.scm | scheme | values are from SRFI-129 sample implementation tests | (import (except (rnrs) string-titlecase)
(srfi :129)
(srfi :64))
(test-begin "SRFI 129 titlecase")
(test-assert (char-title-case? #\x01C5))
(test-assert (char-title-case? #\x1FFC))
(test-assert (not (char-title-case? #\Z)))
(test-assert (not (char-title-case? #\z)))
(test-equal #\x01C5 (char-titlecase #\x01C4))
(t... |
3a4dff8a6decadaea7130c48ef4b039d112d8b48c44e53ab2ce3577cd8beff42 | bcambel/oss.io | utils.clj | (ns hsm.utils
"Utility functions.
TODO:
- Separate HTTP related helpers into separate namespace
- Write proper extensive tests which would make it easier to understand
and would be pretty much self documenting."
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[taoensso.timbre :as log... | null | https://raw.githubusercontent.com/bcambel/oss.io/cddb8b8ba4610084bc2f3c78c7837cdec87a8c76/src/clj/hsm/utils.clj | clojure | implement a multi-method for different types
TODO: must be placed into a config file.
(log/debug (get-in request [:headers "x-auth-token"]))
Following functions borrowed+modified slightly from
| (ns hsm.utils
"Utility functions.
TODO:
- Separate HTTP related helpers into separate namespace
- Write proper extensive tests which would make it easier to understand
and would be pretty much self documenting."
(:require
[clojure.java.io :as io]
[clojure.string :as str]
[taoensso.timbre :as log... |
ac076f59e082c0fddea0351b12c48d360632a130c5399c8fb3520024096df79f | abailly/aws-lambda-haskell | Lambda.hs | {-# LANGUAGE OverloadedStrings #-}
module AWS.Lambda where
import Control.Lens
import Control.Monad.Catch
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.AWS
import Control.Monad.Trans.Resource
import qualified Data.ByteString.Lazy as LB... | null | https://raw.githubusercontent.com/abailly/aws-lambda-haskell/df9afb7498500c2282515752f905a6e05bba9658/AWS/Lambda.hs | haskell | # LANGUAGE OverloadedStrings #
| Default role to use for creating function
TODO: parameterize | module AWS.Lambda where
import Control.Lens
import Control.Monad.Catch
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.AWS
import Control.Monad.Trans.Resource
import qualified Data.ByteString.Lazy as LBS
import Data.Text ... |
e3629988aaf4c2ed8876c0d50235094bcad231beb313e177f137e4ad31dcefed | samply/blaze | resource_cache_spec.clj | (ns blaze.db.resource-cache-spec
(:require
[blaze.async.comp-spec]
[blaze.db.resource-cache.spec]
[blaze.db.resource-store.spec]))
| null | https://raw.githubusercontent.com/samply/blaze/e84c106b5ca235600c20ba74fe8a2295eb18f350/modules/db/test/blaze/db/resource_cache_spec.clj | clojure | (ns blaze.db.resource-cache-spec
(:require
[blaze.async.comp-spec]
[blaze.db.resource-cache.spec]
[blaze.db.resource-store.spec]))
| |
5450b1668e686c3f2545a062a41237e524a280e1bea37206d49c22a757bc84b8 | ntoronto/pict3d | pict3d-combinators.rkt | #lang racket/base
(require racket/contract
typed/untyped-utils
(rename-in "typed-pict3d-combinators.rkt"
[bend typed-bend]
[bend-smooth typed-bend-smooth]
[bend-pict3d typed-bend-pict3d])
"pict3d-struct.rkt"
"user... | null | https://raw.githubusercontent.com/ntoronto/pict3d/09283c9d930c63b6a6a3f2caa43e029222091bdb/pict3d/private/gui/pict3d-combinators.rkt | racket | #lang racket/base
(require racket/contract
typed/untyped-utils
(rename-in "typed-pict3d-combinators.rkt"
[bend typed-bend]
[bend-smooth typed-bend-smooth]
[bend-pict3d typed-bend-pict3d])
"pict3d-struct.rkt"
"user... | |
c01f613ac546401d81287f96d8da31948a48cd6951194e12ed49279fb29f1085 | lspector/Clojush | majority.clj | ;; majority.clj
an example problem for clojush , a Push / PushGP system written in Clojure
, , 2011 .
(ns clojush.problems.synthetic.majority
(:use [clojush.pushgp.pushgp]
[clojush.pushstate]
[clojush.random]
[clojush.interpreter]
[clojure.math.numeric-tower]))
;;;;;;;;;;;;
;;... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/problems/synthetic/majority.clj | clojure | majority.clj
The "majority" problem: have fewer negative complements than respective positive integers
| an example problem for clojush , a Push / PushGP system written in Clojure
, , 2011 .
(ns clojush.problems.synthetic.majority
(:use [clojush.pushgp.pushgp]
[clojush.pushstate]
[clojush.random]
[clojush.interpreter]
[clojure.math.numeric-tower]))
(defonce global-problem-size (... |
15c049ffbfb7889c84eb508a9550c722a794aaaa51c4e15f44abafc9990d79fe | dmitryvk/sbcl-win32-threads | alloc.lisp | ;;;; allocation VOPs for the PPC
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/compiler/ppc/alloc.lisp | lisp | allocation VOPs for the PPC
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
LIST and LIST*
Special purpose inline allocators.
pseudo-atomic, because oring in other-pointer-lowtag just adds... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!VM")
(define-vop (list-or-list*)
(:args (things :more t))
(:temporary (:scs (descriptor-reg) :type list... |
98fe5a7eeb7d7d00553f2c6662b15aa7db7571d14a7976f557f50cad1ed482f8 | pouriya/cfg | cfg_reader_env.erl | %%% ----------------------------------------------------------------------------
@author < >
%%% @hidden
%% -----------------------------------------------------------------------------
-module(cfg_reader_env).
-behaviour(cfg_reader).
-author('').
%% -----------------------------------------------------------------... | null | https://raw.githubusercontent.com/pouriya/cfg/b03eb73549e2fa11b88f91db73f700d7e6ef4617/src/readers/cfg_reader_env.erl | erlang | ----------------------------------------------------------------------------
@hidden
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Exports:
'config_reader' callback:
-------------------------------------... | @author < >
-module(cfg_reader_env).
-behaviour(cfg_reader).
-author('').
-export([read_config/1]).
read_config(App) when erlang:is_atom(App) ->
{ok, application:get_all_env(App)};
read_config({App, Key}) when erlang:is_atom(App) andalso erlang:is_atom(Key) ->
case application:get_env(App, Key) of
... |
d45b0eae857a6f1b64dc67ae1be0ec2d9578757f0c0017d6d8c86409f5825371 | Decentralized-Pictures/T4L3NT | block.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_012_Psithaca/lib_protocol/test/helpers/block.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c ) 2020 Metastate AG < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " ,... |
903f31225e0371737dd17a0786a530bc336593da0f8772edbe3f07ea89fcf89f | airalab/hs-web3 | TransactionSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.Ethereum.Test.TransactionSpec where
import Crypto.Ecdsa.Utils (importKey)
import Crypto.Ethereum.Signature (signTransaction)
import Data.ByteArray.HexString (HexString)
import Network.Ethereum.Api.Types (Call (... | null | https://raw.githubusercontent.com/airalab/hs-web3/e6719ae384d2371a342f03afa3634921f4a8cd37/packages/ethereum/tests/Network/Ethereum/Test/TransactionSpec.hs | haskell | # LANGUAGE OverloadedStrings #
using same example as in this blog post:
/@codetractio/walkthrough-of-an-ethereum-improvement-proposal-eip-6fda3966d171 | module Network.Ethereum.Test.TransactionSpec where
import Crypto.Ecdsa.Utils (importKey)
import Crypto.Ethereum.Signature (signTransaction)
import Data.ByteArray.HexString (HexString)
import Network.Ethereum.Api.Types (Call (..))
import Network.Ether... |
35c81c86db1266b6e6dfe68e9ee82a3b999753fed8d99a67e35bd2b0f7a1cce5 | junjihashimoto/hspec-server | NetworkStatus.hs | module Test.Hspec.Server.NetworkStatus (
NetworkStatus
, reachable
, host
, hostWithPort
) where
import System.Exit
import Control.Monad.IO.Class
import Test.Hspec.Server.Core
import Test.Hspec.Server.Util
import qualified Data.Set as S
type NetworkStatus = S.Set NetworkStatus'
data NetworkStatus' =
Reachable
... | null | https://raw.githubusercontent.com/junjihashimoto/hspec-server/473058fa4ca17abbe110d9f273d3c6726d5f1365/Test/Hspec/Server/NetworkStatus.hs | haskell | module Test.Hspec.Server.NetworkStatus (
NetworkStatus
, reachable
, host
, hostWithPort
) where
import System.Exit
import Control.Monad.IO.Class
import Test.Hspec.Server.Core
import Test.Hspec.Server.Util
import qualified Data.Set as S
type NetworkStatus = S.Set NetworkStatus'
data NetworkStatus' =
Reachable
... | |
6429d77b85c2182354a0bc2666faa8f6d44c8ffe6f498b25e4ba05e4adea8164 | gas2serra/mcclim-desktop | clim-debugger.lisp | (in-package :desktop-user)
(register-application "clim-debugger" 'standard-mcclim-debugger-application
:pretty-name "Clim Debugger"
:icon nil
:menu-p nil
:requires-args-p t
:home-page ""
:git-repo ""
:system-name "clim-debugger")
| null | https://raw.githubusercontent.com/gas2serra/mcclim-desktop/f85d19c57d76322ae3c05f98ae43bfc8c0d0a554/dot-mcclim-desktop/apps/clim-debugger.lisp | lisp | (in-package :desktop-user)
(register-application "clim-debugger" 'standard-mcclim-debugger-application
:pretty-name "Clim Debugger"
:icon nil
:menu-p nil
:requires-args-p t
:home-page ""
:git-repo ""
:system-name "clim-debugger")
| |
d5ce72a304f3a15d8ceb76f2c0f171876c5d57e78eeda51bd812d01917228ef2 | brownplt/LambdaS5 | ljs_eval.ml | open Prelude
module S = Ljs_syntax
open Format
open Ljs
open Ljs_values
open Ljs_delta
open Ljs_pretty
open Ljs_pretty_value
open Unix
open SpiderMonkey
open Exprjs_to_ljs
open Js_to_exprjs
open Str
type answer = Answer of S.exp list * value * env list * store
let bool b = match b with
| true -> True
| false -> ... | null | https://raw.githubusercontent.com/brownplt/LambdaS5/f0bf5c7baf1daa4ead4e398ba7d430bedb7de9cf/src/ljs/ljs_eval.ml | ocaml | S.Writable true -> false when configurable is false
Updating values only checks writable
If we had a data property, update it to an accessor
Accessors can update their getter and setter properties
An accessor can be changed into a data property
enumerable and configurable need configurable=true
8.12.4, las... | open Prelude
module S = Ljs_syntax
open Format
open Ljs
open Ljs_values
open Ljs_delta
open Ljs_pretty
open Ljs_pretty_value
open Unix
open SpiderMonkey
open Exprjs_to_ljs
open Js_to_exprjs
open Str
type answer = Answer of S.exp list * value * env list * store
let bool b = match b with
| true -> True
| false -> ... |
5ea65e72a0100e64be30a38b7cf89fa51cbcfca228648944f39e33571520961d | melange-re/melange | int32.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/stdlib-412/stdlib_modules/int32.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Module [ Int32 ] : 32 - bit integers
external neg : int32 -> int32 = "%int32_neg"
external add : int32... |
1df16f472ec9cfe979f861c0e9c803cb8c5aae7834902a164f078c16306352b9 | SnootyMonkey/posthere.io | results.clj | (ns posthere.results
"Show the saved requests for a particular URL UUID."
(:require [clojure.string :as s]
[net.cgrand.enlive-html :as enl :refer (content html-snippet deftemplate)]
[ring.util.response :refer (response header)]
[cheshire.core :refer (generate-string)]
... | null | https://raw.githubusercontent.com/SnootyMonkey/posthere.io/698b46c917d7f74a5fb06c13beae49ded1ca1705/src/posthere/results.clj | clojure | insert the config'd doorbell.io app key
unhide the results div if we DO have some results
unhide the API hints div if we DO have some results and it's not the examples
keep the empty-results div only if we DON'T have any results
append a blank string (do nothing), otherwise returning nil wipes it out
http-kit in ... | (ns posthere.results
"Show the saved requests for a particular URL UUID."
(:require [clojure.string :as s]
[net.cgrand.enlive-html :as enl :refer (content html-snippet deftemplate)]
[ring.util.response :refer (response header)]
[cheshire.core :refer (generate-string)]
... |
7bc70962938e1a15aa95378fe2a652ec2c57ec938882ed4a55949df98c5c8e5d | maybevoid/casimir | Free.hs | module Casimir.Free
( EffCoOp (..)
, FreeOps (..)
, CoOpHandler (..)
, FreeEff (..)
, FreeHandler (..)
, NoCoOp
, UnionCoOp (..)
, ChurchMonad (..)
, FreeMonad (..)
, GenericCoOpHandler (..)
, ContextualHandler (..)
, freeLiftEff
, coopHandlerToPipeline
, genericCoOpHandlerToPipeline
, con... | null | https://raw.githubusercontent.com/maybevoid/casimir/ebbfa403739d6f258e6ac6793549006a0e8bff42/casimir/src/lib/Casimir/Free.hs | haskell | module Casimir.Free
( EffCoOp (..)
, FreeOps (..)
, CoOpHandler (..)
, FreeEff (..)
, FreeHandler (..)
, NoCoOp
, UnionCoOp (..)
, ChurchMonad (..)
, FreeMonad (..)
, GenericCoOpHandler (..)
, ContextualHandler (..)
, freeLiftEff
, coopHandlerToPipeline
, genericCoOpHandlerToPipeline
, con... | |
4ad8cd3adf06e981a2838932d85ef9cbc7cdc41ea4b87ea989bcf0b7ab16870c | zchn/ethereum-analyzer | Foreach.hs | module Ethereum.Analyzer.Solidity.Foreach
( statementsOf
, expressionsOf
) where
import Protolude
import Data.List (concatMap)
import Ethereum.Analyzer.Solidity.Simple
statementsOf :: Contract -> [Statement]
statementsOf = _sOf
class HasStatements a where
_sOf :: a -> [Statement]
instance HasStatements Con... | null | https://raw.githubusercontent.com/zchn/ethereum-analyzer/f2a60d8b451358971f1e3b1a61658f5741c4c099/ethereum-analyzer/src/Ethereum/Analyzer/Solidity/Foreach.hs | haskell | module Ethereum.Analyzer.Solidity.Foreach
( statementsOf
, expressionsOf
) where
import Protolude
import Data.List (concatMap)
import Ethereum.Analyzer.Solidity.Simple
statementsOf :: Contract -> [Statement]
statementsOf = _sOf
class HasStatements a where
_sOf :: a -> [Statement]
instance HasStatements Con... | |
9f180c8a3d38025cf92985cc141ca4cfc5b5eaf335c047108d07d9475dd21fcc | ocaml-gospel/gospel | redundant2.mli | type t = A | B of t
val f : t -> int
(*@ y = f x
ensures match x with
| A -> false
| B (B _) -> false
| B (B A) -> false
| _ -> true *)
{ gospel_expected|
[ 125 ] File " redundant2.mli " , line 5 , characters 12 - 103 :
5 | ............ match x with
6 | | A - > fal... | null | https://raw.githubusercontent.com/ocaml-gospel/gospel/79841c510baeb396d9a695ae33b290899188380b/test/patterns/negative/redundant2.mli | ocaml | @ y = f x
ensures match x with
| A -> false
| B (B _) -> false
| B (B A) -> false
| _ -> true | type t = A | B of t
val f : t -> int
{ gospel_expected|
[ 125 ] File " redundant2.mli " , line 5 , characters 12 - 103 :
5 | ............ match x with
6 | | A - > false
7 | | B ( B _ ) - > false
8 | | B ( B A ) - > false
9 | | _ - > true... |
ae40fa9adb5ec59379e57d0a0504f9378eae8ab9d419cb2821f374bb0a701133 | lukaszcz/coinduction | cStmt.ml | (* Statement translation -- implementation *)
Read first :
#inductive-definitions ,
kernel / entries.ml , kernel / constr.mli
#inductive-definitions,
kernel/entries.ml, kernel/constr.mli *)
open CUtils
open CPred
open Names
type coarg =
ATerm of EConstr.t
| AEx of int (* a variable bound by an... | null | https://raw.githubusercontent.com/lukaszcz/coinduction/b7437fe155a45f93042a5788dc62512534172dcd/src/cStmt.ml | ocaml | Statement translation -- implementation
a variable bound by an existential -- Rel index
type
body
copred index 0-based
and-like inductive type
exists-like inductive type
variable name
type
body
TODO: check if existential variables do not occur in `x'
m - the total number of coinductive predicates... | Read first :
#inductive-definitions ,
kernel / entries.ml , kernel / constr.mli
#inductive-definitions,
kernel/entries.ml, kernel/constr.mli *)
open CUtils
open CPred
open Names
type coarg =
ATerm of EConstr.t
type stmt =
let map_fold_stmt (f : int -> 'a -> stmt -> 'a * stmt) acc stmt =
let ... |
59b09bc4b8f7f26bcffa5c2f5c6a0fc02fcc09fbf4a0504ce7f7cddcde1d9841 | serokell/log-warper | Wlog.hs | -- |
-- Module : System.Wlog
Copyright : ( c ) , 2016
-- License : GPL-3 (see the file LICENSE)
Maintainer : >
-- Stability : experimental
Portability : POSIX , GHC
--
-- Logging functionality. This module is wrapper over
-- < hslogger>,
-- which allows to keep logger name in monadic context.
... | null | https://raw.githubusercontent.com/serokell/log-warper/a6dd74a1085e8c6d94a4aefc2a036efe30f6cde5/src/System/Wlog.hs | haskell | |
Module : System.Wlog
License : GPL-3 (see the file LICENSE)
Stability : experimental
Logging functionality. This module is wrapper over
< hslogger>,
which allows to keep logger name in monadic context.
Messages are colored depending on used serverity. | Copyright : ( c ) , 2016
Maintainer : >
Portability : POSIX , GHC
module System.Wlog
( module System.Wlog.CanLog
, module System.Wlog.Concurrent
, module System.Wlog.Exception
, module System.Wlog.FileUtils
, module System.Wlog.HasLoggerName
, module System.Wlog... |
142047ab1d4cd33b886adeea0462370125637339cc70214f7516ccad4e73d10a | ocaml/obi | gitlab.ml | Copyright ( c ) 2018 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 PROVIDED " AS IS... | null | https://raw.githubusercontent.com/ocaml/obi/68a93c27a2076dfa0e1634a4da16826ddc47455d/src/obi-gitlab/gitlab.ml | ocaml | Generate aliases for OCaml releases and distros | Copyright ( c ) 2018 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 PROVIDED " AS IS... |
114f2a932731cabd4091a49dbdbf738317f6aaa5f3d021beb34ddc2e14d6e459 | kadena-io/digraph | Test.hs | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
-- |
-- Module: Data.DiGraph.Test
Copyright : Copyright © 2019 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
-- Stability: experimental
--
module Data.DiGraph.Test
(
-- * Test Properties
propert... | null | https://raw.githubusercontent.com/kadena-io/digraph/c31c35d0270b8da16815cb7e6f5a09e3fc012bd8/test/Data/DiGraph/Test.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module: Data.DiGraph.Test
Stability: experimental
* Test Properties
internal modules
-------------------------------------------------------------------------- --
Test Properties
| Test Properties.
| # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
Copyright : Copyright © 2019 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
module Data.DiGraph.Test
(
properties
) where
import Data.Bifunctor
import Data.Hashable
import Numeric.Natural
import Test.QuickCheck
import Data.Di... |
b1756b7b68fe276efc6c9f3818f180d399e5e7a67863bdfc52e1721328cf661a | metaocaml/ber-metaocaml | t01bad.ml | TEST
flags = " -w a "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = " -w a "
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
(* Bad (t = t) *)
module rec A : sig typ... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/typing-recmod/t01bad.ml | ocaml | Bad (t = t) | TEST
flags = " -w a "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = " -w a "
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
module rec A : sig type t = A.t end = st... |
12438cf38f7ebef0a27c176ede83ac2f30ec9f1809c6a16360d2874bade85464 | codecov/codecov-racket | codecov.rkt | #lang racket/base
(provide generate-codecov-coverage)
(require "private/codecov.rkt")
| null | https://raw.githubusercontent.com/codecov/codecov-racket/50388b36071d54b2beffc0cfd8ad17cad940f7a8/cover/codecov.rkt | racket | #lang racket/base
(provide generate-codecov-coverage)
(require "private/codecov.rkt")
| |
81a52b4d26a0aacac6dc07280a957ea5366a3c409ccb41c9b91766e76b106e72 | clojure/core.typed | check_below.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/src/clojure/core/typed/checker/check_below.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns clojure.core.typed.checker.check-below
(:require [clojure.core.typed :as t]
[clojure.core.typed.checker.type-rep :as r]
[clojure.core.typed.checker.type-ctors :as c]
[clojure.core.typed.checker.filter-rep :as fl]
[clojure... |
e60bc8277e71476040a9ffdc98dd26526b0eed5b35f4078c4c21655527cb7b2d | BumblebeeBat/FlyingFox | serve.erl | -module(serve).
-export([start/0, start/1, pw/0, pw/1]).
start() -> start(port:check()).
start(Port) ->
io:fwrite("start server\n"),
D_internal = [
{'_', [
{"/:file", main_handler, []},
{"/", internal_handler, []}
]}
],
D = [
{'_', [
{"/:file", external_handler, []},
{"/", handler,... | null | https://raw.githubusercontent.com/BumblebeeBat/FlyingFox/0fa039cd2394b08b1a85559f9392086c6be47fa6/src/networking/serve.erl | erlang | -module(serve).
-export([start/0, start/1, pw/0, pw/1]).
start() -> start(port:check()).
start(Port) ->
io:fwrite("start server\n"),
D_internal = [
{'_', [
{"/:file", main_handler, []},
{"/", internal_handler, []}
]}
],
D = [
{'_', [
{"/:file", external_handler, []},
{"/", handler,... | |
e7a898f9f21196dddbe2c39f0b564fa0e7b02abb1853790b107b35863f66fbf7 | dongcarl/guix | cpan.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2016 < >
Copyright © 2020 < >
;;;
;;; 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 Fre... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/tests/cpan.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 © 2015 < >
Copyright © 2016 < >
Copyright © 2020 < >
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 (test-cpan)
#:use-module (guix import cpan)
... |
7cb0159f955477e445b9c6c5c2337d6da8838fcfab59cee08172d25e2a155153 | MaskRay/99-problems-ocaml | 20.ml | let rec remove_at xs n = match xs with
| [] -> []
| h::t -> if n == 1 then t else h :: remove_at t (n-1)
| null | https://raw.githubusercontent.com/MaskRay/99-problems-ocaml/652604f13ba7a73eee06d359b4db549b49ec9bb3/11-20/20.ml | ocaml | let rec remove_at xs n = match xs with
| [] -> []
| h::t -> if n == 1 then t else h :: remove_at t (n-1)
| |
6047387227457132a844ed0b70b420fa9b8cd79f406baac8f91b04f491d88f1f | basho/riak_cs | riak_cs_stats.erl | %% ---------------------------------------------------------------------
%%
Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . Y... | null | https://raw.githubusercontent.com/basho/riak_cs/c0c1012d1c9c691c74c8c5d9f69d388f5047bcd2/src/riak_cs_stats.erl | erlang | ---------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permiss... | Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
aab551903280f9d71eb5f0e1a3965ceef9481f3c2bd2bd073a4b11690c825696 | kcsongor/typelevel-prelude | Reader.hs | module Type.Control.Monad.Reader
( Reader(..)
, RunReader
) where
import Type.Prelude
data Reader r a = MkReader (r ~> a)
type family RunReader (f :: Reader r a) :: r ~> a where
RunReader ('MkReader f) = f
instance Functor (Reader r) where
type instance Fmap f ('MkReader g) = 'MkReader (f . g)
instance A... | null | https://raw.githubusercontent.com/kcsongor/typelevel-prelude/ed16e52c4547e9d3e9611403228d586f6d03ef55/src/Type/Control/Monad/Reader.hs | haskell | module Type.Control.Monad.Reader
( Reader(..)
, RunReader
) where
import Type.Prelude
data Reader r a = MkReader (r ~> a)
type family RunReader (f :: Reader r a) :: r ~> a where
RunReader ('MkReader f) = f
instance Functor (Reader r) where
type instance Fmap f ('MkReader g) = 'MkReader (f . g)
instance A... | |
d69481ac32bcd268354c9a112855c8d959ecbfd36216e99023340c47d79eff28 | RedPRL/kado | Graph.ml | module type Vertex =
sig
type t
val compare : t -> t -> int
val initial : t (* if you pretent the graph is a category *)
val terminal : t
end
module type S =
sig
type key
type t
val empty : t
val test : key -> key -> t -> bool
val union : key -> key -> t -> t
val test_and_union : key -> key -> t ... | null | https://raw.githubusercontent.com/RedPRL/kado/f18418bcd0123ce906cb513b18f4cd282ff14b8e/src/Graph.ml | ocaml | if you pretent the graph is a category
a map from vertices to their reachable vertices | module type Vertex =
sig
type t
val compare : t -> t -> int
val terminal : t
end
module type S =
sig
type key
type t
val empty : t
val test : key -> key -> t -> bool
val union : key -> key -> t -> t
val test_and_union : key -> key -> t -> bool * t
val merge : t -> t -> t
end
module Make (V : Ve... |
4e29b98a85bf64adfe60d4f954302c45eb47109d8cfd0f02f617f475ebca6821 | fukamachi/lack | dbi.lisp | (in-package :cl-user)
(defpackage t.lack.session.store.dbi
(:use :cl
:lack
:lack.test
:lack.session.store.dbi
:dbi
:prove))
(in-package :t.lack.session.store.dbi)
(plan 4)
(defvar *test-db* (asdf:system-relative-pathname :lack "data/test.db"))
(when (probe-file *test-db*)
(... | null | https://raw.githubusercontent.com/fukamachi/lack/1f155216aeea36291b325c519f041e469262a399/t/session/store/dbi.lisp | lisp |
record-timestamps t | (in-package :cl-user)
(defpackage t.lack.session.store.dbi
(:use :cl
:lack
:lack.test
:lack.session.store.dbi
:dbi
:prove))
(in-package :t.lack.session.store.dbi)
(plan 4)
(defvar *test-db* (asdf:system-relative-pathname :lack "data/test.db"))
(when (probe-file *test-db*)
(... |
5c909f3f5cb13fa38570b0a67d725a891c69f70eba24abf36c182d4ef018b30e | jeapostrophe/mode-lambda | main.rkt | #lang racket/base
(require racket/match
racket/contract/base
(except-in ffi/unsafe ->)
file/gunzip
racket/file
mode-lambda/color
"core.rkt")
(define (sprite-idx csd spr)
(hash-ref (compiled-sprite-db-spr->idx csd) spr #f))
(define (palette-idx csd pal)
(hash-re... | null | https://raw.githubusercontent.com/jeapostrophe/mode-lambda/64b5ae81f457ded7664458cd9935ce7d3ebfc449/mode-lambda/main.rkt | racket | #lang racket/base
(require racket/match
racket/contract/base
(except-in ffi/unsafe ->)
file/gunzip
racket/file
mode-lambda/color
"core.rkt")
(define (sprite-idx csd spr)
(hash-ref (compiled-sprite-db-spr->idx csd) spr #f))
(define (palette-idx csd pal)
(hash-re... | |
ecc4cfef17cf4a912a891425cfb38f529e8a9587551749170eec04882567e7f1 | haskell-works/hw-koans | Eq.hs | module Koan.Eq where
import Prelude hiding (elem, filter)
enrolled :: Bool
enrolled = False
-- Introduction to generics
filterInt :: (Int -> Bool) -> [Int] -> [Int]
filterInt p (x:xs) = if p x then x:filterInt p xs else filterInt p xs
filterInt _ [] = []
filterChar :: (Char -> Bool) -> [Char] -> [Char]
filterC... | null | https://raw.githubusercontent.com/haskell-works/hw-koans/a807e72513d91ddf1c8aa445371b94bb169f22fd/solution/Koan/Eq.hs | haskell | Introduction to generics
Using the Eq typeclass | module Koan.Eq where
import Prelude hiding (elem, filter)
enrolled :: Bool
enrolled = False
filterInt :: (Int -> Bool) -> [Int] -> [Int]
filterInt p (x:xs) = if p x then x:filterInt p xs else filterInt p xs
filterInt _ [] = []
filterChar :: (Char -> Bool) -> [Char] -> [Char]
filterChar p (x:xs) = if p x then x... |
65de57c8c4db66d4b6fddf0dd46f0acdbafa571f3a6b78db5d154640a45a97aa | haskell-mafia/mismi | Arbitrary.hs | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Mismi.Kernel.Arbitrary where
import Mismi.Kernel.Data
import Test.QuickCheck
import Test.QuickCheck.Instances ()
instance Arbitrary MismiRegion where
arbitrary =
arbitraryBoundedEnum
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-kernel/test/Test/Mismi/Kernel/Arbitrary.hs | haskell | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Mismi.Kernel.Arbitrary where
import Mismi.Kernel.Data
import Test.QuickCheck
import Test.QuickCheck.Instances ()
instance Arbitrary MismiRegion where
arbitrary =
arbitraryBoundedEnum
| |
00ded890a38e18902e29c3e744ccd9ef5a77ba2594a44a73cb98da3883b5b13f | mfoemmel/erlang-otp | wxGauge.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxGauge.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxGauge).
-include("wxe.hrl").
-e... |
156a52e67f5f2886d017f3bc395ea12dcfcbe8902edf48595b8e7bace2d190e8 | vdaas/vald-client-clj | stream_get_object.clj | (ns vald-client-clj.command.stream-get-object
(:require
[clojure.tools.cli :as cli]
[clojure.string :as string]
[clojure.edn :as edn]
[vald-client-clj.core :as vald]
[vald-client-clj.util :as util]))
(def cli-options
[["-h" "--help" :id :help?]
["-j" "--json" "read and write as json"
:id :jso... | null | https://raw.githubusercontent.com/vdaas/vald-client-clj/a26bfb6229bd2582d282023beee7f4dc2fabea46/cmd/vald_client_clj/command/stream_get_object.clj | clojure | (ns vald-client-clj.command.stream-get-object
(:require
[clojure.tools.cli :as cli]
[clojure.string :as string]
[clojure.edn :as edn]
[vald-client-clj.core :as vald]
[vald-client-clj.util :as util]))
(def cli-options
[["-h" "--help" :id :help?]
["-j" "--json" "read and write as json"
:id :jso... | |
e03fe1e85e6921980a84c3728aac1db98fece99b1c6a839876e82bce8d6e14a8 | ptal/AbSolute | sat_interpretation.mli | 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/domains/sat/sat_interpretation.mli | ocaml | * See [Interpretation.to_tqformula] | 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... |
e54465d117326b0be282f34a2b385ab5be86c492a21e53c019f5c8203c4c731d | inhabitedtype/ocaml-aws | deregisterManagedInstance.ml | open Types
open Aws
type input = DeregisterManagedInstanceRequest.t
type output = unit
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service ... | null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/3bc554af7ae7ef9e2dcea44a1b72c9e687435fa9/libraries/ssm/lib/deregisterManagedInstance.ml | ocaml | open Types
open Aws
type input = DeregisterManagedInstanceRequest.t
type output = unit
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service ... | |
e8aed99abf230c41d3d4a89fe707fdd7db1ee3c99fd6b0ac7f928bb1016f3aec | mrkkrp/ghc-syntax-highlighter | Forall.hs | x :: forall a. a
x = undefined
| null | https://raw.githubusercontent.com/mrkkrp/ghc-syntax-highlighter/201eebf10b96f1c382669c69cc1a1cefb07cc897/data/Forall.hs | haskell | x :: forall a. a
x = undefined
| |
c4241c20b45d59342d12d455e74c87eb7dd0020c47a191ced5514b8dcc89eecb | Element84/clj-gdal | repl-session.clj | (gdal/init)
(def data-dir "test/data/l8")
(def scene-id "LC80290302015263LGN00")
(def tiff-file (format "%s/%s/%s_B2.TIF" data-dir scene-id scene-id))
(def tiff-data (gdal/open tiff-file))
(dataset/get-size tiff-data)
(dataset/count-bands tiff-data)
(def band-data (dataset/get-band tiff-data 1))
(band/get-checksum ba... | null | https://raw.githubusercontent.com/Element84/clj-gdal/7e3ded6935d8b06c49e90be911ca9648b5a84205/examples/repl-session.clj | clojure | (gdal/init)
(def data-dir "test/data/l8")
(def scene-id "LC80290302015263LGN00")
(def tiff-file (format "%s/%s/%s_B2.TIF" data-dir scene-id scene-id))
(def tiff-data (gdal/open tiff-file))
(dataset/get-size tiff-data)
(dataset/count-bands tiff-data)
(def band-data (dataset/get-band tiff-data 1))
(band/get-checksum ba... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.