_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 |
|---|---|---|---|---|---|---|---|---|
ce1bca7d24aee2c7c5e62cbe516b55d936957d8a2b51ee844b00be358c3dc399 | qkrgud55/ocamlmulti | listLabels.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, Kyot... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/stdlib/listLabels.ml | ocaml | *********************************************************************
OCaml
... | , Kyoto University RIMS
Copyright 2001 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : listLabels.ml 11156 2011 - 07 - 27... |
4b1102f7c8ca422c98d93149d18e2d6d73a65ee59f6b1dd9ad800f4759e94d3c | bollu/coremlir | Reconstruct.hs | # LANGUAGE RecordWildCards #
module GhcDump.Reconstruct (reconModule) where
import Data.Foldable
import Data.Bifunctor
import Prelude hiding (readFile)
import Data.Hashable
import qualified Data.HashMap.Lazy as HM
import GhcDump.Ast
newtype BinderMap = BinderMap (HM.HashMap BinderId Binder)
instance Hashable Binde... | null | https://raw.githubusercontent.com/bollu/coremlir/7ab044051e62c54e8d3f94a38e3d1ecbf49fb2b0/reading/reference-ghc-dump/ghc-dump-util/src/GhcDump/Reconstruct.hs | haskell | "recon" == "reconstruct" | # LANGUAGE RecordWildCards #
module GhcDump.Reconstruct (reconModule) where
import Data.Foldable
import Data.Bifunctor
import Prelude hiding (readFile)
import Data.Hashable
import qualified Data.HashMap.Lazy as HM
import GhcDump.Ast
newtype BinderMap = BinderMap (HM.HashMap BinderId Binder)
instance Hashable Binde... |
16e939e4be7e6caddb82b969cb9141c5fd0f2db0dff3844a5c41f6577f7a9cd7 | OCamlPro/typerex-lint | web_errors.ml | (**************************************************************************)
(* *)
(* OCamlPro Typerex *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/tools/ocp-lint-web/src/web_errors.ml | ocaml | ************************************************************************
OCamlPro Typerex
This file is distributed ... | Copyright OCamlPro 2011 - 2016 . All rights reserved .
( GNU General Public Licence version 3.0 ) .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
NONINFRINGEMENT . IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE... |
68b4d1a320e6a3a3e0118ae4d337f73605b31936816d19310fefa9e7b8672238 | HuwCampbell/orc-haskell | Type.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Orc.Type where
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Hedgehog.Corpus as Corpus
import Orc.Pr... | null | https://raw.githubusercontent.com/HuwCampbell/orc-haskell/259649bc5fa5c6d8bd850fdad0517af6c028e00e/test/Test/Orc/Type.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Orc.Type where
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Hedgehog.Corpus as Corpus
import Orc.Prelude
import Orc.... |
d5a7493dd670b037423a18a4f09e2eb7d3f8d89e078f0e56ed71fc469aa419d1 | naoiwata/sicp | q2.83.scm | ;; @author naoiwata
SICP Chapter2
question 2.83
; utility settings -------------------------------------------------
(define (apply-generic op . args)
(let
((type-tags (map type-tag args)))
(define (do-coerce x type)
(let
((coercion (get-coercion (type-tag x) type)))
(and coercion... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/q2.83.scm | scheme | @author naoiwata
utility settings -------------------------------------------------
put and get procedures -------------------------------------------
type tags
table for coercion
ordinary procedure -----------------------------------------------
integer procedure -----------------------------------------------
... | SICP Chapter2
question 2.83
(define (apply-generic op . args)
(let
((type-tags (map type-tag args)))
(define (do-coerce x type)
(let
((coercion (get-coercion (type-tag x) type)))
(and coercion (coercion x))))
(define (find-proc-coerceds op args types)
(if (null? types)
... |
5058b5fa146041a17ab2abad99d248f87382d96be022ac45eedbd8d739cdb0cb | aprell/compiler-potpourri | loop.mli | open Cfg
type back_edge = Node.t * Node.t
type t = {
head : Node.t;
tail : Node.t;
nodes : NodeSet.t;
}
val back_edges : Cfg.t -> back_edge list
val find : back_edge -> t
val print : t -> unit
module NestingForest : sig
type t
val create : Cfg.t -> t
val output_dot : ?filename:string -> t -> unit
end
| null | https://raw.githubusercontent.com/aprell/compiler-potpourri/a668b71f392abf1810a1f33f362a1d96bc5eebce/control_flow/analysis/loop.mli | ocaml | open Cfg
type back_edge = Node.t * Node.t
type t = {
head : Node.t;
tail : Node.t;
nodes : NodeSet.t;
}
val back_edges : Cfg.t -> back_edge list
val find : back_edge -> t
val print : t -> unit
module NestingForest : sig
type t
val create : Cfg.t -> t
val output_dot : ?filename:string -> t -> unit
end
| |
1000cc7f1f27fa516f34416173a8f2eab02ca88d6c6b37555d4294328f848f88 | jacius/lispbuilder | globals.lisp |
(in-package #:sdl-gfx-bin)
(defvar *dll-path* (make-pathname
:host (pathname-host #.(or *compile-file-truename*
*load-truename*))
:directory (pathname-directory #.(or *compile-file-truename*
... | null | https://raw.githubusercontent.com/jacius/lispbuilder/e693651b95f6818e3cab70f0074af9f9511584c3/lispbuilder-sdl-gfx/bin/globals.lisp | lisp |
(in-package #:sdl-gfx-bin)
(defvar *dll-path* (make-pathname
:host (pathname-host #.(or *compile-file-truename*
*load-truename*))
:directory (pathname-directory #.(or *compile-file-truename*
... | |
ea3611d03e01250cbebd45aa093bccd196c92f294395824e3dfb04396f6f5555 | ocaml-toml/To.ml | utils.ml | open OUnit
let assert_table_equal expected testing =
OUnit.assert_equal
~cmp:(fun x y -> Toml.Compare.table x y == 0)
~printer:(fun x ->
let buf = Buffer.create 42 in
Toml.Printer.table (Format.formatter_of_buffer buf) x;
Buffer.contents buf )
expected testing
let force_opt opt =
mat... | null | https://raw.githubusercontent.com/ocaml-toml/To.ml/215922367a2783af22e12e08bd8182e4cd149be0/tests/utils.ml | ocaml | open OUnit
let assert_table_equal expected testing =
OUnit.assert_equal
~cmp:(fun x y -> Toml.Compare.table x y == 0)
~printer:(fun x ->
let buf = Buffer.create 42 in
Toml.Printer.table (Format.formatter_of_buffer buf) x;
Buffer.contents buf )
expected testing
let force_opt opt =
mat... | |
82673231a8ec32850f6ef1849cc931816842d14f43930a364c44e55d1dd60668 | mcorbin/tour-of-clojure | cond.clj | ;; matching clause
(println (cond
(= 1 2) "1 == 2 ?!"
(= 1 1) "1 == 1"))
;; default value
(println (cond
(= 1 2) "1 == 2 ?!"
(= 1 3) "1 == 3 ?!"
:default "A default value"))
;; no matching clause, return nil
(println (cond
(= 1 2) "1 == 2 ?!"
... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/resources/public/pages/code/cond.clj | clojure | matching clause
default value
no matching clause, return nil | (println (cond
(= 1 2) "1 == 2 ?!"
(= 1 1) "1 == 1"))
(println (cond
(= 1 2) "1 == 2 ?!"
(= 1 3) "1 == 3 ?!"
:default "A default value"))
(println (cond
(= 1 2) "1 == 2 ?!"
(= 1 3) "1 == 3 ?!"))
|
05aead05409705534aba32120743f35120289ce2d6d2f6b7840be997ff31a2b9 | clojure-interop/aws-api | AbstractAmazonRoute53ResolverAsync.clj | (ns com.amazonaws.services.route53resolver.AbstractAmazonRoute53ResolverAsync
"Abstract implementation of AmazonRoute53ResolverAsync. Convenient method forms pass through to the
corresponding overload that takes a request object and an AsyncHandler, which throws an
UnsupportedOperationException."
(:refer-clojur... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.route53resolver/src/com/amazonaws/services/route53resolver/AbstractAmazonRoute53ResolverAsync.clj | clojure | (ns com.amazonaws.services.route53resolver.AbstractAmazonRoute53ResolverAsync
"Abstract implementation of AmazonRoute53ResolverAsync. Convenient method forms pass through to the
corresponding overload that takes a request object and an AsyncHandler, which throws an
UnsupportedOperationException."
(:refer-clojur... | |
847a333bf829b4b27320a26421a707848471143b2cb349fe0b5a78011872aaea | robert-strandh/SICL | sin-cos.lisp | (cl:in-package #:sicl-arithmetic)
;;; This code is highly experimental, and I am not sure that it will
;;; be any better than other techniques. Also, some of the
;;; computations made here are much better done on the binary
;;; representation of the floating-point numbers.
;;; The basic idea is as follows. We use t... | null | https://raw.githubusercontent.com/robert-strandh/SICL/397723bf1ed904f51e4afe6dec9b249ca150f1c5/Code/Arithmetic/sin-cos.lisp | lisp | This code is highly experimental, and I am not sure that it will
be any better than other techniques. Also, some of the
computations made here are much better done on the binary
representation of the floating-point numbers.
The basic idea is as follows. We use the well known identity:
X is called the BASE ANGLE... | (cl:in-package #:sicl-arithmetic)
(= ( SIN ( + X Y ) ( + ( * ( SIN X ) ( COS Y ) ) ( * ( COS X ) ( SIN Y ) ) ) ) )
integer is a power of 2 , so in our case , the base angle is a
multiple of 1/128 of a radian . The base angle can be determined
( SIN X ) and ( COS X ) are kept in two tables that are relative... |
43de1a49bc0f67a2525a4fda16d05e74ca3c549fafda13561114ae25471e2452 | Liqwid-Labs/liqwid-plutarch-extra | TraversableProp.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ImpredicativeTypes #-}
# LANGUAGE TypeApplications #
module TraversableProp (tests) where
import Plutarch.Api.V1.Maybe (PMaybeData)
import Plutarch.Extra.Functor (PSubcategory)
import Plutarch.Extra.Identity (PIdentity (PIdentity))
import Plutarch.Extra.Traversable (PTrav... | null | https://raw.githubusercontent.com/Liqwid-Labs/liqwid-plutarch-extra/c2878080dce5b15ace47c98dfd071acf994e1ed4/test/TraversableProp.hs | haskell | # LANGUAGE ImpredicativeTypes #
Properties
because 'fromPFun' checks for lambda(function generation) which will
break down when given ambiguous type variable like 't' in this case.
prevent the error.
Alternatively, we can ensure that 't' is not a lambda by giving
> PBool ) ~ False ` .
> PBool) | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TypeApplications #
module TraversableProp (tests) where
import Plutarch.Api.V1.Maybe (PMaybeData)
import Plutarch.Extra.Functor (PSubcategory)
import Plutarch.Extra.Identity (PIdentity (PIdentity))
import Plutarch.Extra.Traversable (PTraversable, ptraverse)
import Plutarch.... |
f088d615d8689c5cbfe4f47efeccf26f35862c4a06d889d96886e93050449ec5 | nurpax/snaplet-sqlite-simple | Main.hs | {-# LANGUAGE CPP #-}
# LANGUAGE TemplateHaskell #
module Main where
------------------------------------------------------------------------------
import Control.Exception (SomeException, try)
import qualified Data.Text as T
import Snap.Http.Server
import Snap.Snaplet
import ... | null | https://raw.githubusercontent.com/nurpax/snaplet-sqlite-simple/f19f0ff9018f3886544901bdacda133a42bc2476/example/src/Main.hs | haskell | # LANGUAGE CPP #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| This is the entry point for this web server application. It supports
easily switching between interpreting source and running statica... | # LANGUAGE TemplateHaskell #
module Main where
import Control.Exception (SomeException, try)
import qualified Data.Text as T
import Snap.Http.Server
import Snap.Snaplet
import Snap.Snaplet.Config
import Snap.Core
import System.IO
import Site
#ifde... |
da1fc18c2a9f6784618b7a12997876d1d334b61c037fa0722658d3bc9400e680 | deepakjois/hs-logo | IO.hs | module Logo.Builtins.IO (ioBuiltins) where
import qualified Data.Map as M
import Control.Applicative ((<$>))
import Control.Monad.Trans (lift, liftIO)
import System.Random (randomIO)
import Logo.Types
turtleIO :: IO a -> LogoEvaluator a
turtleIO = lift . liftIO
pr, random :: [LogoToken] -> LogoEvaluator LogoToken... | null | https://raw.githubusercontent.com/deepakjois/hs-logo/888a65bfc40de463bd8dd9fe28aac729a3b803bd/src/Logo/Builtins/IO.hs | haskell | module Logo.Builtins.IO (ioBuiltins) where
import qualified Data.Map as M
import Control.Applicative ((<$>))
import Control.Monad.Trans (lift, liftIO)
import System.Random (randomIO)
import Logo.Types
turtleIO :: IO a -> LogoEvaluator a
turtleIO = lift . liftIO
pr, random :: [LogoToken] -> LogoEvaluator LogoToken... | |
2334dd306e36039969db393d0cff4deacb038f90bc02975f31e5426d49b97c14 | tonsky/Clojure-Sublimed | exception.clj | (ns clojure-sublimed.exception
(:require
[clojure.string :as str])
(:import
[clojure.lang Compiler Compiler$CompilerException ExceptionInfo LispReader$ReaderException]
[java.io Writer]))
(def ^:dynamic *print-quota*
1024)
(defn- to-char-array ^chars [x]
(cond
(string? x) (.toCharArray ^String... | null | https://raw.githubusercontent.com/tonsky/Clojure-Sublimed/ebdb09498fac078d8030461cb55c6c830a38cc6c/src_clojure/clojure_sublimed/exception.clj | clojure | modified from nrepl.middleware.print/with-quota-writer | (ns clojure-sublimed.exception
(:require
[clojure.string :as str])
(:import
[clojure.lang Compiler Compiler$CompilerException ExceptionInfo LispReader$ReaderException]
[java.io Writer]))
(def ^:dynamic *print-quota*
1024)
(defn- to-char-array ^chars [x]
(cond
(string? x) (.toCharArray ^String... |
cd25c0b7311333ca64a9457c614524ee8be8a7387bc877dc814a29d1f40b9bae | mjambon/caml2html | output_latex.ml | $ Id$
Copyright 2002 - 2004 Copyright 2004 , 2010
This file is distributed under the terms of the GNU Public License
Copyright 2002-2004 Sébastien Ailleret
Copyright 2004, 2010 Martin Jambon
This file is distributed under the terms of the GNU Public License
*)
This module p... | null | https://raw.githubusercontent.com/mjambon/caml2html/297a7d2695896a2de8110d2acd4d64c85eb29805/output_latex.ml | ocaml | $ Id$
Copyright 2002 - 2004 Copyright 2004 , 2010
This file is distributed under the terms of the GNU Public License
Copyright 2002-2004 Sébastien Ailleret
Copyright 2004, 2010 Martin Jambon
This file is distributed under the terms of the GNU Public License
*)
This module p... | |
05f7b733f704b147e505a943ba4c05124dc81d567913b7f11cdefc0adbbfd7b5 | WormBase/wormbase_rest | interaction.clj | (ns rest-api.classes.interaction
(:require
[rest-api.classes.gene.widgets.external-links :as external-links]
[rest-api.classes.interaction.widgets.overview :as overview]
[rest-api.classes.interaction.widgets.references :as references]
[rest-api.classes.interaction.widgets.interactions :as interactions... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/interaction.clj | clojure | (ns rest-api.classes.interaction
(:require
[rest-api.classes.gene.widgets.external-links :as external-links]
[rest-api.classes.interaction.widgets.overview :as overview]
[rest-api.classes.interaction.widgets.references :as references]
[rest-api.classes.interaction.widgets.interactions :as interactions... | |
2c97e523934d7c4f8c6349afe7966f1b6590f0408551a0a7e03aa2195aa90fea | 3b/3bil | ffi.lisp | (in-package :avm2-compiler)
(defmacro declare-swf-class (class-name (&optional super) &body _ &key ((:swf-name class-swf-name)) constants properties methods)
"declare an external class to be accessed through ffi"
(declare (ignore _))
;(format t "props = ~a ~%" properties)
( format t " name = ~s ~s eql=~s ~% ... | null | https://raw.githubusercontent.com/3b/3bil/c852181848bedf476373e901869ca29471f926ee/compile/ffi.lisp | lisp | (format t "props = ~a ~%" properties)
using the old player-classes.lisp stuff for super for now, so
ignoring it...
store class name
store constants
store properties
store methods
(%call-property object property args) -> value
find the object
calculate args
call it
(%get-property object property) -> value
fi... | (in-package :avm2-compiler)
(defmacro declare-swf-class (class-name (&optional super) &body _ &key ((:swf-name class-swf-name)) constants properties methods)
"declare an external class to be accessed through ffi"
(declare (ignore _))
( format t " name = ~s ~s eql=~s ~% " name ( car ( last ( car properties ) ) ... |
c4ec1b5b0d56eef6130fdf134575986582d348333bebbc596e854ed8c14d4dc8 | hannesm/conex | conex_private.mli | (** Private key operations and handling *)
open Conex_utils
(** The private key module type *)
module type S = sig
open Conex_resource
(** The type of a private key *)
type t
(** [ids ()] is the list of all available private keys. *)
val ids : unit -> identifier list
type r_err = [ `Decode of string | ... | null | https://raw.githubusercontent.com/hannesm/conex/24547cd746915431c72ee7e929d39208f65f4100/src/conex_private.mli | ocaml | * Private key operations and handling
* The private key module type
* The type of a private key
* [ids ()] is the list of all available private keys.
* [read id] is either [Ok priv], the private key corresponding to [id], or
an [Error].
* [bits t] is the number of bits of the private key [t].
* [created t]... |
open Conex_utils
module type S = sig
open Conex_resource
type t
val ids : unit -> identifier list
type r_err = [ `Decode of string | `Read of string | `None | `Multiple of string list ]
val pp_r_err : r_err fmt
val read : (float -> Conex_resource.timestamp option) -> identifier -> (t, r_err) result
... |
114854e7e8c66acea4d208d55992e95faf93d1c835dea2e260da78ff2c0657d9 | ahungry/pseudo | items.lisp |
;; Pseudo - A pseudo 3d multiplayer roguelike
Copyright ( C ) 2013
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;; (at your option) any l... | null | https://raw.githubusercontent.com/ahungry/pseudo/a3e6329313e334941f211a991e5853bbe6d247f1/items.lisp | lisp | Pseudo - A pseudo 3d multiplayer roguelike
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PART... |
Copyright ( C ) 2013
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License
(in-package #:pseudo)
(defparameter *owned-items* (make-hash-table))
... |
69c9d1b11bf250b9b4d7b7c95e8d7d967f93cfe94acd6c29363ed24db4f2f05c | Drup/tree_layout | utils.mli |
* Copyright ( c ) 2015 < >
*
* 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 " AND THE AU... | null | https://raw.githubusercontent.com/Drup/tree_layout/19977cf7ab825e9495e133cf1cc14999125be1c7/tests/utils.mli | ocaml | * Simple rose trees that fullfill most signatures with the right complexity.
* Randomly generate a tree with [n] nodes. |
* Copyright ( c ) 2015 < >
*
* 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 " AND THE AU... |
890717193aa269b10a138fd372b324dcbabe8ff8bba5744b711a06011ff1b6c9 | fulcrologic/datomic-cloud-backup | cloning_test.clj | (ns com.fulcrologic.datomic-cloud-backup.cloning-test
(:require
[datomic.client.api :as d]
[com.fulcrologic.datomic-cloud-backup.ram-stores :refer [new-ram-store]]
[com.fulcrologic.datomic-cloud-backup.protocols :as dcbp]
[com.fulcrologic.datomic-cloud-backup.cloning :as cloning]
[com.fulcrologic.... | null | https://raw.githubusercontent.com/fulcrologic/datomic-cloud-backup/61b078401296d1419ac7192b1cc83389a684ff3f/src/test/com/fulcrologic/datomic_cloud_backup/cloning_test.clj | clojure | Hack to make sure IDs don't align internally, so that less likely to get false success
NOTE: The strings for attributes are because we are not doing the actual restore,
so it cannot find the original IDs
The rest of the time we do what we are asked
Retry should get the rest, an complain about the duplicates
Load ... | (ns com.fulcrologic.datomic-cloud-backup.cloning-test
(:require
[datomic.client.api :as d]
[com.fulcrologic.datomic-cloud-backup.ram-stores :refer [new-ram-store]]
[com.fulcrologic.datomic-cloud-backup.protocols :as dcbp]
[com.fulcrologic.datomic-cloud-backup.cloning :as cloning]
[com.fulcrologic.... |
7bbb1006f7e80bac95a28ed654bc0fad9bc47799fc966d8e1d8346a40862a60d | wargrey/schema | fixed-row.rkt | #lang typed/racket/base
(require "csv.rkt")
(require racket/logging)
(define fixed-row.csv : Path-String (#%csv))
csv::rfc
(displayln '===================================================================)
(displayln 'read-port)
(parameterize ([port-count-lines-enabled #true])
((inst with-logging-to-port (Listof (... | null | https://raw.githubusercontent.com/wargrey/schema/4824a1fecea1dc557941b08f05a457da9f628f78/tamer/csv/reader/fixed-row.rkt | racket | #lang typed/racket/base
(require "csv.rkt")
(require racket/logging)
(define fixed-row.csv : Path-String (#%csv))
csv::rfc
(displayln '===================================================================)
(displayln 'read-port)
(parameterize ([port-count-lines-enabled #true])
((inst with-logging-to-port (Listof (... | |
a097c6161415d0a3b9c64f8689961b547b4fc68a635232bf112c9aa9f6c028d9 | clojure/clojurescript | inspect.clj | Copyright ( c ) , , Rich Hickey & 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 ... | null | https://raw.githubusercontent.com/clojure/clojurescript/e30e26dbd221b5d7c4bbc567d10d0c3c01cf5f98/src/main/clojure/cljs/vendor/clojure/tools/reader/impl/inspect.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 ) , , Rich Hickey & contributors .
(ns cljs.vendor.clojure.tools.reader.impl.inspect)
(declare inspect*)
(defn- inspect*-col [truncate col start end]
(let [n (count col)
l (if truncate 0 (min 10 n))
elements (map (partial inspect* true) (take l col))
content (apply str... |
c020772e9849b62fe079997992e21805582625dfdbca88a8f32490e86ff2a403 | ocsigen/tyxml | xml_wrap.ml | TyXML
*
* Copyright ( C ) 2013 < drupyog+ >
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or... | null | https://raw.githubusercontent.com/ocsigen/tyxml/8551b673857fdc1defebe7c502ffcb920f04009e/lib/xml_wrap.ml | ocaml | TyXML
*
* Copyright ( C ) 2013 < drupyog+ >
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or... | |
48ddb1468cbebb6effea69fbdb92c455ff90781c407514209f17acadc1943f0b | burgerdev/ocaml-rfc7748 | zfield.ml |
module Zp(P: sig val p: Z.t end): Curve.Field with type t = Z.t = struct
type t = Z.t
include P
let zero = Z.zero
let one = Z.one
let ( + ) x y = Z.erem (Z.add x y) p
let ( * ) x y = Z.erem (Z.mul x y) p
let double x = x + x
let square x = x * x
let invert x = Z.invert x p
let ( / ) x y = x *... | null | https://raw.githubusercontent.com/burgerdev/ocaml-rfc7748/ed034213ff02cd55870ae1387e91deebc9838eb4/src/zfield.ml | ocaml |
module Zp(P: sig val p: Z.t end): Curve.Field with type t = Z.t = struct
type t = Z.t
include P
let zero = Z.zero
let one = Z.one
let ( + ) x y = Z.erem (Z.add x y) p
let ( * ) x y = Z.erem (Z.mul x y) p
let double x = x + x
let square x = x * x
let invert x = Z.invert x p
let ( / ) x y = x *... | |
a6a3257c2c07e98a88bfd725882c95a101803476c09d916ec44002762c98f2c1 | reactiveml/rml | deriving_Json.mli | Js_of_ocaml
*
* Copyright 2010 .
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/js-of-ocaml/lib/deriving_json/deriving_Json.mli | ocaml | * The type of JSON parser/printer for value of type ['a].
* [from_string Json.t<ty> s] safely unmarshall the JSON [s] into an
OCaml value of type [ty]. Throws [Failure] if the received value
isn't the javascript representation of a value of type [ty].
* The signature of the JSON class.
*/*
*/*
* Deriver | Js_of_ocaml
*
* Copyright 2010 .
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... |
e933a6a348a9b9f33dfea846b4a86df22cafd242f313dc91cca48d0349b06399 | facebook/duckling | Helpers.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
module Duckling.Volume.Helpers
( isSimpleVolume
, isUnitOnly
, volume
, uni... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Volume/Helpers.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
-----------------------------------------------------------------
Patterns
-----------------------------------------------------------------
Produ... | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Volume.Helpers
( isSimpleVolume
, isUnitOnly
, volume
, unitOnly
, valueOnly
, withUnit
, withValue
, withInterval
, withMin
, withMax
) where
import Data.Text (Text)
import Prelude
import Duckling.Dimensions.Types
import Duc... |
d6a8a6eddafac03544110b360ed32a6d8bf907380c9350ed29f043eddace5fcf | flora-pm/flora-server | Runner.hs | module FloraJobs.Runner where
import Control.Concurrent (forkIO)
import Control.Exception
import Control.Monad
import Control.Monad.IO.Class
import Data.Aeson (Result (..), fromJSON, toJSON)
import Data.Function
import Data.Set qualified as Set
import Data.Text.Display
import Data.Text.Lazy.Encoding qualified as TL
im... | null | https://raw.githubusercontent.com/flora-pm/flora-server/94d9f3feec577a4f3e4cb394739d61f619458b53/src/jobs-worker/FloraJobs/Runner.hs | haskell | If the CHANGELOG simply doesn't exist, we skip it by marking the job as successful.
If the README simply doesn't exist, we skip it by marking the job as successful.
If the upload time simply doesn't exist, we skip it by marking the job as successful.
| This job fetches the deprecation list and inserts the appropria... | module FloraJobs.Runner where
import Control.Concurrent (forkIO)
import Control.Exception
import Control.Monad
import Control.Monad.IO.Class
import Data.Aeson (Result (..), fromJSON, toJSON)
import Data.Function
import Data.Set qualified as Set
import Data.Text.Display
import Data.Text.Lazy.Encoding qualified as TL
im... |
2f44a6239dce029a4236c55c7214b88cbf66e9cfb3d8da7523a06212546940f0 | gretay-js/ocamlfdo | loc.mli | open Core
type rel =
{ id : int; (** Unique id of the containing function symbol *)
offset : int (** Offset from the start of the function *)
}
[@@deriving compare, sexp, hash, equal, bin_io]
type t =
{ rel : rel option;
dbg : int option (** debug info: linearid *)
}
[@@deriving sexp, compare, equa... | null | https://raw.githubusercontent.com/gretay-js/ocamlfdo/5866fe9c2bfea03bc7efb033cc7b91a3a25cf520/src/loc.mli | ocaml | * Unique id of the containing function symbol
* Offset from the start of the function
* debug info: linearid | open Core
type rel =
}
[@@deriving compare, sexp, hash, equal, bin_io]
type t =
{ rel : rel option;
}
[@@deriving sexp, compare, equal, bin_io]
val merge : t -> t -> t
val rename : t -> old2new:int Int.Table.t -> t
|
63ba8010ff36a77d755e8d766d145442534141e7d66f5b473013cecccc36210b | target/row-types | Aeson.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Row.Aeson
--
This module adds orphan instances f... | null | https://raw.githubusercontent.com/target/row-types/0d6dc8a3d9a53a8f9a0783bb300e4d1e27b8c8cd/src/aeson/Data/Row/Aeson.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------
|
Module : Data.Row.Aeson
--------------------------------------------------------------------------- | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
This module adds orphan instances for ' Rec ' and ' Var ' .
module Data.Row.Aeson () where
import Data.Aeson
import Data.Aeson.Encoding (pairStr)
import Data... |
0bf5d44a0116b7e1afae9bb8d892f5984a7582684dfc802804029b6f8805029a | sgbj/MaximaSharp | dger.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/blas/dger.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
91ad5377922ad9888f5cc1722802fb05f078d672c37b4c9bde282934e8e2f456 | scrintal/heroicons-reagent | globe_americas.cljs | (ns com.scrintal.heroicons.outline.globe-americas)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/globe_americas.cljs | clojure | (ns com.scrintal.heroicons.outline.globe-americas)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | |
b0e5f6e85c0bfa474c0c2fae548a68845fe48f0f67750eec89cf604877855ce6 | OctaviPascual/cis194-IntroductionToHaskell | Party.hs | # OPTIONS_GHC -Wall -fno - warn - orphans #
module Party where
import Data.List
import Data.Monoid
import Data.Tree
import Employee
-------------------------------- Exercise 1 ----------------------------------
-- Adds an employee to the guest list ignoring constraints
glCons :: Employee -> GuestList -> GuestList
... | null | https://raw.githubusercontent.com/OctaviPascual/cis194-IntroductionToHaskell/771c9c72d10744dd6593a7478698de640106bb90/homework-08/Party.hs | haskell | ------------------------------ Exercise 1 ----------------------------------
Adds an employee to the guest list ignoring constraints
Returns the guest list which has the higher fun score
------------------------------ Exercise 2 ----------------------------------
Fold a Tree from the leaves to the root
-------------... | # OPTIONS_GHC -Wall -fno - warn - orphans #
module Party where
import Data.List
import Data.Monoid
import Data.Tree
import Employee
glCons :: Employee -> GuestList -> GuestList
glCons x (GL xs f) = GL (x:xs) (f + empFun x)
instance Monoid GuestList where
mempty = GL [] 0
GL xs f1 `mappend... |
594c2587a0d71462257a5723a694836eac7e39c5928ff070838ed5d4db0ef0a3 | GillianPlatform/Gillian | WSpec.ml | open VisitorUtils
type t = {
pre : WLAssert.t;
post : WLAssert.t;
variant : WLExpr.t option;
existentials : (string * string list) option;
spid : int;
fname : string;
(* name of the function *)
fparams : string list;
(* parameters of the function *)
sploc : CodeLoc.t;
}
let get_id spec = spec.spid... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/44bb96738ef5a64e2a2a5f8abbeb16fa103ee808/wisl/lib/syntax/WSpec.ml | ocaml | name of the function
parameters of the function | open VisitorUtils
type t = {
pre : WLAssert.t;
post : WLAssert.t;
variant : WLExpr.t option;
existentials : (string * string list) option;
spid : int;
fname : string;
fparams : string list;
sploc : CodeLoc.t;
}
let get_id spec = spec.spid
let get_pre spec = spec.pre
let get_post spec = spec.post
let g... |
0b7e12bab7b3472fed64033a38dc3369b9e2569f53e01d3fcca9a7d36b4e611e | OCamlPro/typerex-lint | plugin_parsing.raw_syntax.5.ml | let x = (1)
| null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/tools/ocp-lint-doc/examples/plugin_parsing.raw_syntax.5.ml | ocaml | let x = (1)
| |
05e2fb0f343affb4b09506fee818fd70aa3327a4399887d60d8fa37785a7a3a7 | monadbobo/ocaml-core | extended_unix.ml | open Core.Std
open Unix
external raw_fork_exec :
stdin : File_descr.t
-> stdout : File_descr.t
-> stderr : File_descr.t
-> ?working_dir : string
-> ?setuid : int
-> ?setgid : int
-> ?env : (string) array
-> string
-> string array
-> Pid.t
= "extended_ml_spawn_bc" "extended_ml_spawn"
module Env ... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/extended_unix.ml | ocaml | * file system block size
* fragment size
* size of fs in frsize units
* # free blocks
* # free blocks for non-root
* # inodes
* # free inodes
* # free inodes for non-root
* file system ID
* mount flags
* maximum filename length
* get file system statistics
* get load averages | open Core.Std
open Unix
external raw_fork_exec :
stdin : File_descr.t
-> stdout : File_descr.t
-> stderr : File_descr.t
-> ?working_dir : string
-> ?setuid : int
-> ?setgid : int
-> ?env : (string) array
-> string
-> string array
-> Pid.t
= "extended_ml_spawn_bc" "extended_ml_spawn"
module Env ... |
520a9aac97f0c8a40ee3f2cb31e61da32dd72d5d8464d622d0d142353e53e2a0 | froggey/Mezzano | build-pci-ids.lisp | ;;;; Load pci.ids from pciids.sourceforge.net and generate
;;;; a reasonably efficient representation.
;;;; BUILD-PCI-IDS generates:
pci - ids : # ( { vendor - id vendor - name devices } )
;;;; devices: #({device-id device-name subsystems})
;;;; subsystems: #({subsystem-id subsystem-name})
vendor - id : ( unsigned... | null | https://raw.githubusercontent.com/froggey/Mezzano/087be4fa325619f61b2e6864277aaf83c4d1d80d/tools/cold-generator2/build-pci-ids.lisp | lisp | Load pci.ids from pciids.sourceforge.net and generate
a reasonably efficient representation.
BUILD-PCI-IDS generates:
devices: #({device-id device-name subsystems})
subsystems: #({subsystem-id subsystem-name})
vendor-name: string
device-name: string
subsystem-name: string
The subsystem-id is constructed by shi... |
pci - ids : # ( { vendor - id vendor - name devices } )
vendor - id : ( unsigned - byte 16 )
device - id : ( unsigned - byte 16 )
subsystem - id : ( unsigned - byte 32 )
left by 16 bits and ORing it with the subsystem device i d.
(defpackage :mezzano.cold-generator.build-pci-ids
(:export :build-pci-ids)
... |
c0544b198626f85e5effdc3122bc023d428463b80b66cfc52d570bca1e5e73fc | Helium4Haskell/Top | Select.hs | # LANGUAGE UndecidableInstances , MultiParamTypeClasses , KindSignatures ,
FunctionalDependencies , FlexibleInstances #
FunctionalDependencies, FlexibleInstances #-}
-----------------------------------------------------------------------------
-- | License : GPL
--
-- Maintainer : ... | null | https://raw.githubusercontent.com/Helium4Haskell/Top/5e900184d6b2ab6d7ce69945287d782252e5ea68/src/Top/Monad/Select.hs | haskell | ---------------------------------------------------------------------------
| License : GPL
Maintainer :
Stability : provisional
Portability : non-portable (requires extensions)
---------------------------------------------------------------------------
--------------------------------------... | # LANGUAGE UndecidableInstances , MultiParamTypeClasses , KindSignatures ,
FunctionalDependencies , FlexibleInstances #
FunctionalDependencies, FlexibleInstances #-}
module Top.Monad.Select
( module Top.Monad.Select
, module Control.Monad.State
) where
import Top.Util.Embedding
imp... |
367d504f6959c871378c40288aef5d6a0c16adcc72c23b048341d44b73f88a1b | janestreet/ecaml | directory.ml | open! Core
open! Import
open! Ecaml_filename
let make_directory = Funcall.Wrap.("make-directory" <: Filename.t @-> bool @-> return nil)
let create ?(parents = false) dirname = make_directory dirname parents
let delete_directory =
Funcall.Wrap.("delete-directory" <: Filename.t @-> bool @-> return nil)
;;
let delete... | null | https://raw.githubusercontent.com/janestreet/ecaml/7c16e5720ee1da04e0757cf185a074debf9088df/src/directory.ml | ocaml | open! Core
open! Import
open! Ecaml_filename
let make_directory = Funcall.Wrap.("make-directory" <: Filename.t @-> bool @-> return nil)
let create ?(parents = false) dirname = make_directory dirname parents
let delete_directory =
Funcall.Wrap.("delete-directory" <: Filename.t @-> bool @-> return nil)
;;
let delete... | |
f7185bdbbb5568d524fdfe9601c1fda3bc92207cd7b80efdd399b9cde59128b1 | google/lisp-koans | asserts.lisp | Copyright 2013 Google Inc.
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable law or agreed to in writing, software
distrib... | null | https://raw.githubusercontent.com/google/lisp-koans/df5e58dc88429ef0ff202d0b45c21ce572144ba8/koans-solved/asserts.lisp | lisp |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2013 Google Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
╭ ╮ ╭ ╮ ///////
╭ ┳ ┳ ╮ ╭ ┳ ┳ ┳ ╮ ╭ ╮
╭ ╮ ╰ ╯ ┫ ╭ ╮ ╭ ╮ ╭ ╮ ┫ ━ ━ ┫
... |
6766b5d65d962e5e7ff99758da96f028c565dd12cdb6eedba055629edf56d8c1 | goldfirere/video-resources | FinSafe.hs | # LANGUAGE StandaloneKindSignatures #
# LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
module FinSafe (
Fin(..),
finToInt, intToFin, unsafeIntToFin,
freshFin
) where
import NatSafe
import SNatSafe
import Data.Kind
import Data.Maybe (fromJust)
-- | Natural numbers less than some bound
type Fin :: Nat -> Type
da... | null | https://raw.githubusercontent.com/goldfirere/video-resources/9263c69a49c49b96fa3e555d5576b47470df08d9/2021-10-06-patsyns4/FinSafe.hs | haskell | # LANGUAGE GADTs #
| Natural numbers less than some bound
| Convert a 'Fin' to an 'Int'
| Convert an 'Int' to a 'Fin'. Returns 'Nothing' if the
desired 'Fin' cannot represent the 'Int'
^ The desired index of the 'Fin'
| Convert an 'Int' to a 'Fin', where the caller must
guarantee that the conversion succeeds.
^... | # LANGUAGE StandaloneKindSignatures #
# LANGUAGE DataKinds #
module FinSafe (
Fin(..),
finToInt, intToFin, unsafeIntToFin,
freshFin
) where
import NatSafe
import SNatSafe
import Data.Kind
import Data.Maybe (fromJust)
type Fin :: Nat -> Type
data Fin n where
FZero :: Fin (Succ n)
FSucc :: Fin n -> Fin (S... |
6e38627aa4496d4edbef946fd7933522493321b33bb296f3c51b734ecafd04f0 | ferd/calcalc | calcalc_astro.erl | -module(calcalc_astro).
-import(calcalc_math, [floor/1, ceil/1, amod/2, mod/2, poly/2]).
-import(math, [pi/0]).
-compile({no_auto_import,[ceil/1, floor/1]}).
-compile(export_all).
-compile({inline, [deg/1, mt/1, hr/1, angle/3]}).
-type angle() :: number().
-type meters() :: number().
-type hours() :: number().
-type m... | null | https://raw.githubusercontent.com/ferd/calcalc/d16eec3512d7b4402b1ddde82128f2483e955e98/src/calcalc_astro.erl | erlang |
% %
DATE %%%
at or after T
Solar Calendars %%%
Month Calculations %%%
as per errata
Rates corrected from the errata
month,s since RD 0 until j2000
From errata
% %
and `false == west'.
Holidays and special times %%%
move to another place or something
UTILS %%%
meters
degrees
returns X suc... | -module(calcalc_astro).
-import(calcalc_math, [floor/1, ceil/1, amod/2, mod/2, poly/2]).
-import(math, [pi/0]).
-compile({no_auto_import,[ceil/1, floor/1]}).
-compile(export_all).
-compile({inline, [deg/1, mt/1, hr/1, angle/3]}).
-type angle() :: number().
-type meters() :: number().
-type hours() :: number().
-type m... |
99fa5baccbfab950c65330ffd636b80604370a0133b24420d101bc5d3a56110b | philnguyen/soft-contract | literals-as-contracts.rkt | #lang racket
(define c1 "♥")
(define c2 "♦")
(define c3 "♣")
(define c4 "♠")
(define c (or/c c1 c2 c3 c4))
(define (f x) x)
(provide
(contract-out
[f (c . -> . c)]))
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/issues/literals-as-contracts.rkt | racket | #lang racket
(define c1 "♥")
(define c2 "♦")
(define c3 "♣")
(define c4 "♠")
(define c (or/c c1 c2 c3 c4))
(define (f x) x)
(provide
(contract-out
[f (c . -> . c)]))
| |
b04fddc0e857e2c75e41352c465647f1126201811747b5d155949d1c53c517b1 | diagrams/diagrams-lib | Boehm.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
-----------------------------------------------------------------------------
-- |
Module : Diagrams . CubicSpline . Boehm
Copyright : ( c ) 2015 diagrams - lib team ( see LICENSE )
-- License : BSD-style (see LICENSE)
-- Maintainer : ... | null | https://raw.githubusercontent.com/diagrams/diagrams-lib/6f66ce6bd5aed81d8a1330c143ea012724dbac3c/src/Diagrams/CubicSpline/Boehm.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see LICENSE)
Maintainer :
See
</~455/bs.pdf>
<-DEC/SRC-RR-19.pdf>
---------------------------------------------------------------------------
| @affineCombo a b t x y@ computes an affine combin... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
Module : Diagrams . CubicSpline . Boehm
Copyright : ( c ) 2015 diagrams - lib team ( see LICENSE )
Boehm 's algorithm for converting a cubic B - spline into a sequence
of curves .
* , /An Introduction to B - Spline Curves/ ,
... |
3eec27f657645ff0bb78f1f721c70b8ca8d69fe065306ab335d5de54c92fda8f | shirok/Gauche | 185.scm | ;;;
;;; SRFI-185 - Linear adjustable-length strings
;;;
Copyright ( c ) 2020 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must retain ... | null | https://raw.githubusercontent.com/shirok/Gauche/e606bfe5a94b100d5807bca9c2bb95df94f60aa6/lib/srfi/185.scm | scheme |
SRFI-185 - Linear adjustable-length strings
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the foll... | Copyright ( c ) 2020 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
In Gauche , string bodies are immutable an... |
9f900b16980f3d7213f0a62ddd56f5e2d2a9f4cec085e813cc6a79b19d895ee3 | crategus/cl-cffi-gtk | gdk.display.lisp | ;;; ----------------------------------------------------------------------------
;;; gdk.display.lisp
;;;
The documentation of this file is taken from the 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GDK library .
;;; See <>. The API documentation of the Lisp binding is
availa... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gdk/gdk.display.lisp | lisp | ----------------------------------------------------------------------------
gdk.display.lisp
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at your optio... | The documentation of this file is taken from the 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GDK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of the
... |
ea11a1de5117435a3cbb65a864dc6c8fcae2cda1d53157a69e918edf4e5b58c9 | binaryage/chromex | webrtc_logging_private.cljs | (ns chromex.app.webrtc-logging-private (:require-macros [chromex.app.webrtc-logging-private :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn set-meta-data* [config request security-ori... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps_private/chromex/app/webrtc_logging_private.cljs | clojure | (ns chromex.app.webrtc-logging-private (:require-macros [chromex.app.webrtc-logging-private :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn set-meta-data* [config request security-ori... | |
4a8ac51676df1b52760cf9461b94f37aac52b16db370faa70932dfa87959b45b | tensor5/flAccurateRip | Setup.hs | import Distribution.Simple
main :: IO ()
main = defaultMain
| null | https://raw.githubusercontent.com/tensor5/flAccurateRip/551f75b1682ffecd87a2c6c4fd45b2b69aaac99c/Setup.hs | haskell | import Distribution.Simple
main :: IO ()
main = defaultMain
| |
c454f6ed4d3d53f8ca9d07cd8d859c288e3bb3e6d1e688ed84dda3bd7d4b2aaa | BumblebeeBat/PinkFairy | block_tree.erl | -module(block_tree).
%We need to remember a list of all the merkle roots we care about so that we can garbage collect the trie
%maybe it should be a ram map between the hash of a block and it's location on the hard drive. But, that makes deleting blocks annoying.
%We could make each block a seperate file on the hard ... | null | https://raw.githubusercontent.com/BumblebeeBat/PinkFairy/33d595d735d6b1119732984e894ed6aea2b6cb6a/src/block_tree.erl | erlang | We need to remember a list of all the merkle roots we care about so that we can garbage collect the trie
maybe it should be a ram map between the hash of a block and it's location on the hard drive. But, that makes deleting blocks annoying.
We could make each block a seperate file on the hard drive. then deleting would... | -module(block_tree).
Maybe this should all be in ram , and we only remember the 100 or so most recent blocks of < 5 megabytes each .
-export([absorb/2, read/1, test/0]).
absorb(Block, PrevBlock) ->
true = block:check(Block, PrevBlock),
save(Block).
read(Hash) ->
BF = binary_to_file(Hash),
Z = db:re... |
c64fc9cc3258d965449d23068fae84ba8ef231412695f5e5a605f0559b3f53e2 | nasa/Common-Metadata-Repository | granule_concept_retrieval_test.clj | (ns cmr.system-int-test.search.granule-concept-retrieval-test
"Integration test for granule retrieval via the /concepts/:concept-id and
/concepts/:concept-id/:revision-id endpoints."
(:require
[cheshire.core :as json]
[clj-time.format :as f]
[clojure.string :as str]
[clojure.test :refer :all]
[cmr.... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/13c47ccfebbbe2745c16220b6e41bfdc0ed286b6/system-int-test/test/cmr/system_int_test/search/granule_concept_retrieval_test.clj | clojure | remove default added by parser
remove default added by parser
Grant permissions before creating data.
All collections in PROV1 granted to registered users.
NOTE - most of the following bindings could be ignored with _, but they are assigned
to vars to make it easier to see what is being ingested.
Ingest a collec... | (ns cmr.system-int-test.search.granule-concept-retrieval-test
"Integration test for granule retrieval via the /concepts/:concept-id and
/concepts/:concept-id/:revision-id endpoints."
(:require
[cheshire.core :as json]
[clj-time.format :as f]
[clojure.string :as str]
[clojure.test :refer :all]
[cmr.... |
85fd3df570ff0c86705e2decefe1a5f0eaf7f23ef1ab24b3dc8b657a7e33622c | martijnbastiaan/sprockell | DemoDebug.hs | # LANGUAGE RecordWildCards #
import Sprockell.System
Note that it never prints " First shared memaddr equals 5 " : all sprockells
-- are terminated before the shared memory gets a chance to write it.
prog :: [Instruction]
prog = [
Const 78 RegA
, Const 10 RegB
, Const 5 RegC
,... | null | https://raw.githubusercontent.com/martijnbastiaan/sprockell/503c91b85f2ff1a6d3293a6691ea9799a7693bf2/src/DemoDebug.hs | haskell | are terminated before the shared memory gets a chance to write it.
write to stdout using explicit address
or using the alias
then the shared memory has time to handle all the writes.
And the debug message will be printed. | # LANGUAGE RecordWildCards #
import Sprockell.System
Note that it never prints " First shared memaddr equals 5 " : all sprockells
prog :: [Instruction]
prog = [
Const 78 RegA
, Const 10 RegB
, Const 5 RegC
, Write RegC (Addr 0)
If we add some Nop 's to delay the EndProg
, No... |
e930b66a53ab3d4d83e41ff2fc352dfaad67aaee3925428bd7ff80c730cdb789 | Copilot-Language/copilot | BoyerMoore.hs | # LANGUAGE RebindableSyntax #
# LANGUAGE ScopedTypeVariables #
module BoyerMoore where
import Copilot.Language hiding (length)
import Copilot.Theorem
import Copilot.Theorem.Prover.Z3
import Copilot.Core.Type
import Prelude ()
import Control.Monad (forM_)
import Data.String (fromString)
import qualified Prelude... | null | https://raw.githubusercontent.com/Copilot-Language/copilot/17a9b45eea4e95a465d6e773c6fbcf9bf810b6cc/copilot-theorem/examples/BoyerMoore.hs | haskell | | Initial value for a given type.
Does not support structs or arrays. | # LANGUAGE RebindableSyntax #
# LANGUAGE ScopedTypeVariables #
module BoyerMoore where
import Copilot.Language hiding (length)
import Copilot.Theorem
import Copilot.Theorem.Prover.Z3
import Copilot.Core.Type
import Prelude ()
import Control.Monad (forM_)
import Data.String (fromString)
import qualified Prelude... |
0b839c49daad663a13e6c482c620936bc47d620997223ddee263a6e20c1bbc33 | finnishtransportagency/harja | valitavoitteet_test.clj | (ns harja.palvelin.palvelut.valitavoitteet-test
(:require [clojure.test :refer :all]
[taoensso.timbre :as log]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.valitavoitteet :refer :all]
[harja.testi :refer :all]
[com.stuartsi... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/c57d742beaff2bef7b30318819f07d4a13423404/test/clj/harja/palvelin/palvelut/valitavoitteet_test.clj | clojure | (log/debug vastaus)
Määrä lisääntyi oikein
Tiedot tallentuivat oikein
VT1 tallentui oikein
VT2 tallentui oikein
Päivitys toimii
VT1 päivittyi oikein
Uudet valtakunnalliset lisätty ok
"))))
Ei muokatut välitavoitteet päivittyivät myös urakkaan
Muokatut välitavoitteet eivät päivittyneet
"))))
R.I.P valtakunnall... | (ns harja.palvelin.palvelut.valitavoitteet-test
(:require [clojure.test :refer :all]
[taoensso.timbre :as log]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.valitavoitteet :refer :all]
[harja.testi :refer :all]
[com.stuartsi... |
f2fd5cf7b8306324d926cddc2f8a3f886321e1d85da7f7715b452794803028d2 | commercialhaskell/stack | TargetSpec.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Stack.Build.TargetSpec
( main
, spec
) where
import qualified Data.Text as T
import Distribution.Types.PackageName (mkPackageName)
import Distribution.Version (mkVersion)
import Stack.Build.Target
im... | null | https://raw.githubusercontent.com/commercialhaskell/stack/bd3ea5e4a5411bb8f08f7e63a61d45ff701764d6/src/test/Stack/Build/TargetSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module Stack.Build.TargetSpec
( main
, spec
) where
import qualified Data.Text as T
import Distribution.Types.PackageName (mkPackageName)
import Distribution.Version (mkVersion)
import Stack.Build.Target
import Stack.Prelude
import... |
08c98a4a52076cdfacd3bbe2b36e04721a1c7304b36ea3e58cbfcb1caa91d6b6 | appleshan/cl-http | cl-http-70-185.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : USER ; Base : 10 ; Patch - File : t -*-
Patch file for CL - HTTP version 70.185
Reason : Function HTTP::PARSE - COMMA - SEPARATED - QUALITY - PAIRS : default to 1.0 .
Written by JCMa , 11/13/03 22:38:58
while running on FUJI - VLM from FUJI:/usr / lib / s... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/lispm/server/patch/cl-http-70/cl-http-70-185.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 ; Patch - File : t -*-
Inc. R7100),
DOMAIN - FIXES.LISP.33 ) ,
MAILBOX - FORMAT.LISP.24 ) ,
MAILER - FIXES.LISP.15 ) ,
Patch TCP hang on close when client drops connection. (from HTTP:LISPM;SERVER;TCP-PATCH-HANG-ON-CLOSE.LISP.10),
FORMAT.LISP.20 ) ,
STATICE - PATCH... | Patch file for CL - HTTP version 70.185
Reason : Function HTTP::PARSE - COMMA - SEPARATED - QUALITY - PAIRS : default to 1.0 .
Written by JCMa , 11/13/03 22:38:58
while running on FUJI - VLM from FUJI:/usr / lib / symbolics / ComLink-39 - 8 - F - MIT-8 - 5 - inc1.vlod
with Open Genera 2.0 , Genera 8.5 , Loc... |
d4d8ed1a292d0fddd287407653ab7d63fd4e0b0e57f1be90ae69d3523a29c36a | janestreet/base | bytes_tr.ml | open! Import0.Int_replace_polymorphic_compare
module Bytes = Bytes0
module String = String0
Construct a byte string of length 256 , mapping every input character code to
its corresponding output character .
Benchmarks indicate that this is faster than the lambda ( including cost of
this function ) , ... | null | https://raw.githubusercontent.com/janestreet/base/8ea6adb415ebc27fec97e1ae34b9a3d5483eb3f0/src/bytes_tr.ml | ocaml | open! Import0.Int_replace_polymorphic_compare
module Bytes = Bytes0
module String = String0
Construct a byte string of length 256 , mapping every input character code to
its corresponding output character .
Benchmarks indicate that this is faster than the lambda ( including cost of
this function ) , ... | |
b2b4c53d488005fd50021a04ccf0b9822b8164419b9508df904a02f9a5502f9d | xvw/preface | state.ml | module Over (State : Preface_specs.Types.T0) = struct
include Preface_make.State.Over_monad (Identity.Monad) (State)
let exec_identity m s = Identity.extract (exec m s)
let eval_identity m s = Identity.extract (eval m s)
let run_identity m s = Identity.extract (run m s)
module Functor = Preface_make.State.F... | null | https://raw.githubusercontent.com/xvw/preface/89af07e80f2e7458a1381ec22aa85036b68e6e8a/lib/preface_stdlib/state.ml | ocaml | module Over (State : Preface_specs.Types.T0) = struct
include Preface_make.State.Over_monad (Identity.Monad) (State)
let exec_identity m s = Identity.extract (exec m s)
let eval_identity m s = Identity.extract (eval m s)
let run_identity m s = Identity.extract (run m s)
module Functor = Preface_make.State.F... | |
e20ba85b7eafa771112977f1ee39beaa6f98e0830075cb7ab98e2cebc24e493a | danr/hipspec | Iterate.hs | module Iterate where
import Prelude (fmap,undefined,error,Eq,Ord)
import HipSpec.Prelude
import Test.QuickSpec.Signature hiding (total)
import List
id :: A -> A
id x = x
(.) :: (A -> A) -> (A -> A) -> A -> A
(f . g) x = f (g x)
ind :: List -> List
ind Nil = Nil
ind (Cons x xs) = Cons x (ind xs)
map f Nil ... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/examples/old-examples/Iterate.hs | haskell | module Iterate where
import Prelude (fmap,undefined,error,Eq,Ord)
import HipSpec.Prelude
import Test.QuickSpec.Signature hiding (total)
import List
id :: A -> A
id x = x
(.) :: (A -> A) -> (A -> A) -> A -> A
(f . g) x = f (g x)
ind :: List -> List
ind Nil = Nil
ind (Cons x xs) = Cons x (ind xs)
map f Nil ... | |
9b5a0a5bca9ee64cab8c9b039b35c57ef6732f7c7ca8b29bab0b85271fa9dcc4 | anishathalye/knox | result.rkt | #lang rosette/safe
(provide (struct-out result))
;; ideal functionality functions are curried, and have type
;; `args ... -> state -> result`
;;
;; For example, a lockbox's store op could be defined as
;; `(define ((store value) state) ...)`, returning a result
(struct result (value state)
#:transparent)
| null | https://raw.githubusercontent.com/anishathalye/knox/161cda3e5274cc69012830f477749954ddcf736d/knox/result.rkt | racket | ideal functionality functions are curried, and have type
`args ... -> state -> result`
For example, a lockbox's store op could be defined as
`(define ((store value) state) ...)`, returning a result | #lang rosette/safe
(provide (struct-out result))
(struct result (value state)
#:transparent)
|
6f6417821560493e09eace1aefba1b488596f7c1c41449215c1af891fc8f53e8 | TaylanUB/scheme-srfis | 51.upstream.scm | Copyright ( C ) ( 2004 ) . All Rights Reserved .
;;; Permission is hereby granted, free of charge, to any person obtaining a copy
;;; of this software and associated documentation files (the "Software"), to
deal in the Software without restriction , including without limitation the
;;; rights to use, copy, modif... | null | https://raw.githubusercontent.com/TaylanUB/scheme-srfis/2d2b306e7a20a7155f639001a02b0870d5a3d3f7/srfi/51.upstream.scm | scheme | Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
furnished to do so, subject to the following conditions:
The above copyright notice and t... | Copyright ( C ) ( 2004 ) . All Rights Reserved .
deal in the Software without restriction , including without limitation the
sell 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 WARRAN... |
1fa1332312fed1655394dad1586ac79c9224af7b5352480f5f7c6477221f842f | per-gron/blackhole | hygiene.scm | ;;; -------------------------------------------------------------- ;;;
;;; ;;;
;;; Hygienic macro subsystem ;;;
;;; ;;;
;;; -----------------------... | null | https://raw.githubusercontent.com/per-gron/blackhole/3f78eb726f85a6b8bddf757e6f28c785bc70e53d/src/hygiene.scm | scheme | -------------------------------------------------------------- ;;;
;;;
Hygienic macro subsystem ;;;
;;;
--------------------------------------... |
Utilities
Takes an expression of the form ( ( mname . ) . )
and transforms it into ( ( lambda arglist ) )
(define (expr*:transform-to-lambda expr #!optional (lmb 'lambda))
(let* ((code (expr*:value expr))
(code-car (expr*:value (car code))))
(if (pair? code-car)
`(,(with-expr* code-ca... |
3099778999116e8b2e2c886c91411aba2b0a22bba1fabebe6fe1b929661ef8aa | zouppen/hackbus | Modbus.hs | {-# LANGUAGE RecordWildCards, TupleSections #-}
module System.Hardware.Modbus
( B.Parity(..)
, B.ModbusException
, B.newRTU
, B.connect
, Master
, getStats
, runMaster
, readInputBits
, writeBit
, writeRegister
, writeBitRegister
, waitFailure
) where
import Control.Concurrent
import Control.... | null | https://raw.githubusercontent.com/zouppen/hackbus/38b6eac7ca1fdbef07dc36386f34be3e80a9ef0e/src/System/Hardware/Modbus.hs | haskell | # LANGUAGE RecordWildCards, TupleSections #
|Retry given number of times and return the result and the number
of retries left.
Public parts
0x02 (read input status).
single coil)
register).
|Read statistics
|Return when failure occurs | module System.Hardware.Modbus
( B.Parity(..)
, B.ModbusException
, B.newRTU
, B.connect
, Master
, getStats
, runMaster
, readInputBits
, writeBit
, writeRegister
, writeBitRegister
, waitFailure
) where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception (catch, ... |
e90b3acbc1d561e6dbb73f1f153ed2d37b1d9d175ea3abefced74ffc226ee2dd | williamleferrand/accretio | ys_mixpanel.ml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/client/ys_mixpanel.ml | ocaml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | |
df8af8535a75b82afcba73803faf7e1e9a8894a72a890a3dfa68bd74818a3448 | ocaml/ocaml-lsp | ocaml_lsp_server.ml | open Import
module Version = Version
module Diagnostics = Diagnostics
module Diff = Diff
open Fiber.O
let make_error = Jsonrpc.Response.Error.make
let not_supported () =
Jsonrpc.Response.Error.raise
(make_error ~code:InternalError ~message:"Request not supported yet!" ())
let view_metrics_command_name = "ocaml... | null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/a9f3d1c211493d4c7c23721a81796db299630c82/ocaml-lsp-server/src/ocaml_lsp_server.ml | ocaml | using the default kind as we are lacking info to make a difference
between assignment and usage. | open Import
module Version = Version
module Diagnostics = Diagnostics
module Diff = Diff
open Fiber.O
let make_error = Jsonrpc.Response.Error.make
let not_supported () =
Jsonrpc.Response.Error.raise
(make_error ~code:InternalError ~message:"Request not supported yet!" ())
let view_metrics_command_name = "ocaml... |
cb8e2eb19d0e31132a55bb0be0c66f9dfd2a20748dd432fe9a500b320b835cdf | returntocorp/semgrep | Pattern_from_Code.mli |
* The pattern_from_code feature allows users to highlight code and
* autogenerate patterns that match
*
* There are three parts to pattern - from - code : taking a range and turning it
* into an AST , taking an AST and modifying parts to make it a pattern ,
* and taking a pattern ’s AST and outputting... | null | https://raw.githubusercontent.com/returntocorp/semgrep/70af5900482dd15fcce9b8508bd387f7355a531d/src/experiments/synthesizing/Pattern_from_Code.mli | ocaml | limited to expressions for now |
* The pattern_from_code feature allows users to highlight code and
* autogenerate patterns that match
*
* There are three parts to pattern - from - code : taking a range and turning it
* into an AST , taking an AST and modifying parts to make it a pattern ,
* and taking a pattern ’s AST and outputting... |
67e2ba1f8ba78a30a596ef28309c971053a6be5ea948a13fbbdaed2eebcb1d29 | amnh/poy5 | genomeCS.mli | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2011 , , , Ward Wheeler
and the American Museum of Natural History .
(* *)
(* This program is free softwa... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/genomeCS.mli | ocaml |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This progra... | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2011 , , , Ward Wheeler
and the American Museum of Natural History .
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... |
4f60c092aa0e3478ef852af5c15fbcb2be824d1adbda1eed8d70ea62d4e1bd8a | jasonrudolph/one-rep-max | repl.clj | (ns one.repmax.repl
"The starting namespace for the project. This is the namespace that
users will land in when they start a Clojure REPL. It exists to
provide convenience functions like 'go' and 'dev-server'."
(:use [cljs.repl.browser :only (repl-env)])
(:require [cljs.repl]
[one.repmax.dev-serve... | null | https://raw.githubusercontent.com/jasonrudolph/one-rep-max/8bdc8eccd4f36cf91b0dd57b0a378efb1b24f7a3/src/app/clj/one/repmax/repl.clj | clojure | (ns one.repmax.repl
"The starting namespace for the project. This is the namespace that
users will land in when they start a Clojure REPL. It exists to
provide convenience functions like 'go' and 'dev-server'."
(:use [cljs.repl.browser :only (repl-env)])
(:require [cljs.repl]
[one.repmax.dev-serve... | |
8570a84dfb86d19d01315526b2f57f22085e55cca73fb00681f1da53f4acffac | gafiatulin/codewars | Penta.hs | -- Figurate Numbers #1 - Pentagonal Number
module Codewars.G964.Penta (pNum, gpNum, spNum) where
import Control.Arrow ((&&&))
f :: (Int -> [Int]) -> Int -> Bool
f g = uncurry (&&) . (uncurry (==) . (floor . ff &&& ceiling . ff) &&& any ((== 5) . (`mod` 6)) . g . floor . ff)
ff :: Int -> Float
ff = sqrt . succ . (... | null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/6%20kyu/Penta.hs | haskell | Figurate Numbers #1 - Pentagonal Number |
module Codewars.G964.Penta (pNum, gpNum, spNum) where
import Control.Arrow ((&&&))
f :: (Int -> [Int]) -> Int -> Bool
f g = uncurry (&&) . (uncurry (==) . (floor . ff &&& ceiling . ff) &&& any ((== 5) . (`mod` 6)) . g . floor . ff)
ff :: Int -> Float
ff = sqrt . succ . (*24) . fromIntegral
pNum :: Int -> Bool
pN... |
c02999e0de67e6ca17ce83e028bcc472e0f94604d7de356adb8a0ce498f25577 | S8A/htdp-exercises | ex313.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex313) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp")))... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex313.rkt | racket | about the language level of this file in a form that our tools can easily process.
Oldest Generation:
Middle Generation:
Youngest Generation:
Q: Explain why this function fails one of its tests.
A: Because at no point does the function actually check if
an ancestor's eyes are blue, it just recursively calls its... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex313) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "abstraction.rk... |
d5cee859c71195924f31994771c5968eac2e87d59b9820dde30635d5afc0d617 | alanz/ghc-exactprint | Exp.hs | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
module Data.Array.Accelerate.Utility.Lift.Exp (
Unlift,
Unlifted,
Tuple,
unlift,
modify,
modify2,
modify3,
modify4,
Exp(Exp), expr, atom,
unliftPair,
unliftTriple,
unliftQuadruple,
asExp,
mapFst,... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc88/Exp.hs | haskell | # DEPRECATED atom "use expr instead" #
| for compatibility with accelerate-utility-0.0 | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
module Data.Array.Accelerate.Utility.Lift.Exp (
Unlift,
Unlifted,
Tuple,
unlift,
modify,
modify2,
modify3,
modify4,
Exp(Exp), expr, atom,
unliftPair,
unliftTriple,
unliftQuadruple,
asExp,
mapFst,... |
f4aa65f2b7d400d7604a3e4dac868c1a12283b5e1e03ae10ae138e0ffa0a4f4e | Elzair/nazghul | trigrave-entry.scm | ;; ----------------------------------------------------------------------------
;; trigrave-entry.scm
;;
;; This file defines the on-entry procedure executed whenever the player enters
;; Trigrave. The purpose of this procedure is to ensure the inn doors are all
;; re-locked when the player enter. This procedure may be... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.001/trigrave-entry.scm | scheme | ----------------------------------------------------------------------------
trigrave-entry.scm
This file defines the on-entry procedure executed whenever the player enters
Trigrave. The purpose of this procedure is to ensure the inn doors are all
re-locked when the player enter. This procedure may be extended to... |
(define (trigrave-entry kplace kplayer)
(send-signal nil (eval 'trigrave-inn-room-1-door) 'lock)
(send-signal nil (eval 'trigrave-inn-room-2-door) 'lock)
(send-signal nil (eval 'trigrave-inn-room-3-door) 'lock)
(send-signal nil (eval 'trigrave-inn-room-4-door) 'lock)
#t)
|
c536d62641fdb2217d2dcb2f92a9f391da0beeb248630a485512f74f7688aecf | fortytools/holumbus | SimpleDMapReduceIO.hs | -- ----------------------------------------------------------------------------
|
Module : Examples2.SimpleMR.SimpleDMapReduce
Copyright : Copyright ( C ) 2009
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Module ... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/mapreduce/Examples2/Pi/Pi_2/source/Holumbus/MapReduce/Examples/SimpleDMapReduceIO.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
the options
actionConfig
---------------------------------------------------------------------------------------------------------
The simple client fucntion... | |
Module : Examples2.SimpleMR.SimpleDMapReduce
Copyright : Copyright ( C ) 2009
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Module : Examples2.SimpleMR.SimpleDMapReduce
Copyright : Copyright (C) 2009 Sebasti... |
8aa4ce0ec931e6182882c9cd91d7557e77eb3a48b9fc81a2635ce07988344767 | robert-strandh/Second-Climacs | prog1-etc.lisp | (cl:in-package #:second-climacs-syntax-common-lisp)
(define-indentation-automaton compute-prog1-indentations
(tagbody
(next)
;; The current wad is the operator.
(maybe-assign-indentation 1 4)
(next)
The current wad ought to be the first form to be indented a
;; bit more.
(maybe-assign... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/f2c8536dc6e308a90b09f29cf60d422dbd031d6c/Code/Syntax/Common-Lisp/Indentation/prog1-etc.lisp | lisp | The current wad is the operator.
bit more.
We should now be among the remaining forms. | (cl:in-package #:second-climacs-syntax-common-lisp)
(define-indentation-automaton compute-prog1-indentations
(tagbody
(next)
(maybe-assign-indentation 1 4)
(next)
The current wad ought to be the first form to be indented a
(maybe-assign-indentation 4 2)
(compute-form-indentation current-wa... |
ac1802da25a41965df20ebcf08fc3bafba9c963df556be2a295c362279288fa2 | namenu/advent-of-code | day11.clj | (ns aoc.year2022.day11
(:require [aoc.math :refer [divisible? lcm]]))
(def monkeys [{:items [79 98]
:operation #(* % 19)
:test #(if (divisible? % 23) 2 3)
:inspected 0}
{:items [54 65 75 74]
:operation #(+ % 6)
:tes... | null | https://raw.githubusercontent.com/namenu/advent-of-code/db55d187fe7681033ebce3d0b3918f3845343758/2022/clojure/src/aoc/year2022/day11.clj | clojure | pt1
=> 54752
pt2 | (ns aoc.year2022.day11
(:require [aoc.math :refer [divisible? lcm]]))
(def monkeys [{:items [79 98]
:operation #(* % 19)
:test #(if (divisible? % 23) 2 3)
:inspected 0}
{:items [54 65 75 74]
:operation #(+ % 6)
:tes... |
4b94bffeb41b2ceeef3dd5b7fc806e295c1afe17ff6d717a1a020f5e05abc5df | Frechmatz/cl-threadpool | list-to-array.lisp | (in-package :cl-threadpool-test)
(defun list-to-array (l)
(let ((a (make-array (length l))) (index 0))
(dolist (item l)
(setf (elt a index) item)
(setf index (+ 1 index)))
a))
| null | https://raw.githubusercontent.com/Frechmatz/cl-threadpool/86ef8a6b3d6a28ce41f25362c1c2db804d3ca605/test/util/list-to-array.lisp | lisp | (in-package :cl-threadpool-test)
(defun list-to-array (l)
(let ((a (make-array (length l))) (index 0))
(dolist (item l)
(setf (elt a index) item)
(setf index (+ 1 index)))
a))
| |
eb5e2ab307922edc33075e9524fb4682eb4c9a2e6540ecb17d035119934da3d2 | OpenC2-org/ocas | init_handler.erl | @author
( C ) 2017 , sFractal Consulting LLC
%%%
-module(init_handler).
-author("Duncan Sparrell").
-license("Apache 2.0").
%%%-------------------------------------------------------------------
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without
%%% modification,... | null | https://raw.githubusercontent.com/OpenC2-org/ocas/c15132d9f37b1e0e29884456a520557c25b22f38/apps/ocas/src/init_handler.erl | erlang |
-------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this... | @author
( C ) 2017 , sFractal Consulting LLC
-module(init_handler).
-author("Duncan Sparrell").
-license("Apache 2.0").
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT N... |
a7c3f8261d280881a38eaa1a97e60df36d723bf4adc9b88799735364501d1d13 | haskell-effectful/effectful | TimeoutTests.hs | module TimeoutTests (timeoutTests) where
import Control.Concurrent (threadDelay)
import Test.Tasty
import Test.Tasty.HUnit
import Effectful
import Effectful.Timeout
import qualified Utils as U
timeoutTests :: TestTree
timeoutTests = testGroup "Timeout"
[ testCase "return before timeout" test_returnBeforeTimeout
... | null | https://raw.githubusercontent.com/haskell-effectful/effectful/cc25dc9ef4d06c8df391ede07642d3bbfbab6aca/effectful/tests/TimeoutTests.hs | haskell | module TimeoutTests (timeoutTests) where
import Control.Concurrent (threadDelay)
import Test.Tasty
import Test.Tasty.HUnit
import Effectful
import Effectful.Timeout
import qualified Utils as U
timeoutTests :: TestTree
timeoutTests = testGroup "Timeout"
[ testCase "return before timeout" test_returnBeforeTimeout
... | |
da5c72b3040398f1adb63770927a33edfafaa9ee1f6b87569fa0b3dcc46bfc67 | tezos-commons/baseDAO | Permit.hs | SPDX - FileCopyrightText : 2021 Tezos Commons
SPDX - License - Identifier : LicenseRef - MIT - TC
module SMT.Model.BaseDAO.Permit
( verifyPermitProtectedVote
) where
import Universum
import Control.Monad.Except (throwError)
import Lorentz hiding (cast, checkSignature, get, not)
import Morley.Tezos.Address (Imp... | null | https://raw.githubusercontent.com/tezos-commons/baseDAO/c8cc03362b64e8f27432ec70cdb4c0df82abff35/haskell/test/SMT/Model/BaseDAO/Permit.hs | haskell | if there is no permit to check, return the votingParam and the sender
if there is a permit, check that its correct
verify that the received permit is correctly signed
update the stored permit counter
return the voteParam with the permit sender | SPDX - FileCopyrightText : 2021 Tezos Commons
SPDX - License - Identifier : LicenseRef - MIT - TC
module SMT.Model.BaseDAO.Permit
( verifyPermitProtectedVote
) where
import Universum
import Control.Monad.Except (throwError)
import Lorentz hiding (cast, checkSignature, get, not)
import Morley.Tezos.Address (Imp... |
f837be728f95c95a00ba4e72caaaecb6b80ae5d2a515335859e272e54d5b3ef4 | CodyReichert/qi | numbers.lisp | (in-package :alexandria)
(declaim (inline clamp))
(defun clamp (number min max)
"Clamps the NUMBER into [min, max] range. Returns MIN if NUMBER is lesser then
MIN and MAX if NUMBER is greater then MAX, otherwise returns NUMBER."
(if (< number min)
min
(if (> number max)
max
number))... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/alexandria-latest/numbers.lisp | lisp | 2.0
Factorial
small numbers this is larger, and vice versa. Ideally instead of a
constant we would have RANGE-FAST-TO-MULTIPLY-DIRECTLY-P.
(load-time-value (find-good-direct-multiplication-limit)) instead.
We use a a bit of cleverness here:
and once it does that all further multiplications will be with bignu... | (in-package :alexandria)
(declaim (inline clamp))
(defun clamp (number min max)
"Clamps the NUMBER into [min, max] range. Returns MIN if NUMBER is lesser then
MIN and MAX if NUMBER is greater then MAX, otherwise returns NUMBER."
(if (< number min)
min
(if (> number max)
max
number))... |
50484361bbcbff3bd3939e285387197188c5d8b606da3a2c2d90d2f324b03f61 | gas2serra/mcclim-desktop | kirc.lisp | (in-package :desktop-user)
(register-application "kirc" 'standard-mcclim-application
:pretty-name "Kirk"
:icon nil
:home-page ""
:git-repo ""
:system-name "kirc")
| null | https://raw.githubusercontent.com/gas2serra/mcclim-desktop/f85d19c57d76322ae3c05f98ae43bfc8c0d0a554/dot-mcclim-desktop/apps/kirc.lisp | lisp | (in-package :desktop-user)
(register-application "kirc" 'standard-mcclim-application
:pretty-name "Kirk"
:icon nil
:home-page ""
:git-repo ""
:system-name "kirc")
| |
98edab52a7724909cdd49761cba3c38eec672e72efeb4c45dd88ec9b214db7c4 | emhoracek/smooch | Common.hs | {-# LANGUAGE OverloadedStrings #-}
module Common (fnTests, HspecFn) where
import Control.Lens ((^.))
import Control.Monad (void)
import Data.Pool (withResource)
import qualified Database.PostgreSQL.Simple as PG
import System.Environme... | null | https://raw.githubusercontent.com/emhoracek/smooch/d08ceb7fc65e17c06fd6fc1d3b77fb2f9605cf87/app/tests/Common.hs | haskell | # LANGUAGE OverloadedStrings #
how to set up the context
list of middleware
clean up what to do after tests are over
run the tests! |
module Common (fnTests, HspecFn) where
import Control.Lens ((^.))
import Control.Monad (void)
import Data.Pool (withResource)
import qualified Database.PostgreSQL.Simple as PG
import System.Environment (setEnv)
import ... |
ee1f1550d2fb9ebb9d64f5bb38e9156a0cf45caec830be61985b2b674f53a889 | sneeuwballen/zipperposition | Multiset.ml |
This file is free software , part of Logtk . See file " license " for more details .
* { 5 Generic multisets }
module type S = Multiset_intf.S
module Make(E : Map.OrderedType) = struct
type elt = E.t
module M = CCMap.Make(E)
type t = Z.t M.t (* map element -> multiplicity *)
let empty = M.empty
let ... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/4a3290cbc9a9ca0d8bd46f5db709a9e866920312/src/core/Multiset.ml | ocaml | map element -> multiplicity
list, sorted by increasing key
remove from both sides
keep some at right
keep some at left
can't be equal?
remove terms of [m2] that are dominated by [x1]
all [x1] exhausted
[x1] is not dominated
remove x1
remove [x2]
remove both
keep both
keep both
remove [x2]
... |
This file is free software , part of Logtk . See file " license " for more details .
* { 5 Generic multisets }
module type S = Multiset_intf.S
module Make(E : Map.OrderedType) = struct
type elt = E.t
module M = CCMap.Make(E)
let empty = M.empty
let size = M.cardinal
let cardinal m = M.fold (fun _ n... |
0cd825616766b3939e3dbbbfd011302e6a1e1a726861862dddf31d18b1a2c8cd | MaskRay/OJHaskell | Consecutive strings.hs | module Codewars.G964.Longestconsec where
import Data.Function
import Data.List
longestConsec :: [String] -> Int -> String
longestConsec ss k =
if length ss >= k
then concat . take k . snd $ minimumBy (compare `on` fst) cs
else ""
where
ls = scanl (+) 0 $ map length ss
cs = zipWith3 (\x y s -> (x-y,s)) ... | null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Codewars/Consecutive%20strings.hs | haskell | module Codewars.G964.Longestconsec where
import Data.Function
import Data.List
longestConsec :: [String] -> Int -> String
longestConsec ss k =
if length ss >= k
then concat . take k . snd $ minimumBy (compare `on` fst) cs
else ""
where
ls = scanl (+) 0 $ map length ss
cs = zipWith3 (\x y s -> (x-y,s)) ... | |
35d71d55554dc3298abed98c0f01620b8ad86f504cf4d6f5f75e60f4796104bb | AdRoll/rebar3_format | task.erl | -module(task).
-vsn(1.0).
-opaque task_spec() :: {Name :: atom(), mfa()}.
-type reason() :: string() | binary().
-export_type([task_spec/0]).
-export([name/1, mfa/1]).
%% @doc Stops the given task.
-callback stop(Name :: atom()) -> ok | {error, reason()}.
%% @doc Starts the specified task.
-callback start(task_sp... | null | https://raw.githubusercontent.com/AdRoll/rebar3_format/5ffb11341796173317ae094d4e165b85fad6aa19/test_app/after/src/otp_samples/task.erl | erlang | @doc Stops the given task.
@doc Starts the specified task. | -module(task).
-vsn(1.0).
-opaque task_spec() :: {Name :: atom(), mfa()}.
-type reason() :: string() | binary().
-export_type([task_spec/0]).
-export([name/1, mfa/1]).
-callback stop(Name :: atom()) -> ok | {error, reason()}.
-callback start(task_spec()) -> any().
-spec name(Spec :: task_spec()) -> atom().
name(... |
403cd29e3c7279a4ba052cd90a4d7d4c3123339af2284c68ffbbc45ddddccd98 | wireless-net/erlang-nommu | wx_obj_test.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2011 - 2013 . 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 Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/test/wx_obj_test.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 limitatio... | Copyright Ericsson AB 2011 - 2013 . 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(wx_obj_test).
-include_lib("wx/incl... |
43f556a262edf3fd05f107cc3f8e87cc9f85ec3d8f14b6c6a91960908d871dc7 | druids/hugsql-adapter-case | adapters.clj | (ns hugsql-adapter-case.adapters
(:require
[camel-snake-kebab.core :refer [->kebab-case ->snake_case ->camelCase]]
[hugsql.adapter :as adapter]
[hugsql.adapter.clojure-java-jdbc :refer [hugsql-adapter-clojure-java-jdbc]]))
(deftype CaseAdapter [case-fn jdbc-adapter]
adapter/HugsqlAdapter
(execute [... | null | https://raw.githubusercontent.com/druids/hugsql-adapter-case/817fdebeaff57934e2af6c22290e80b1aba720e3/src/hugsql_adapter_case/adapters.clj | clojure | (ns hugsql-adapter-case.adapters
(:require
[camel-snake-kebab.core :refer [->kebab-case ->snake_case ->camelCase]]
[hugsql.adapter :as adapter]
[hugsql.adapter.clojure-java-jdbc :refer [hugsql-adapter-clojure-java-jdbc]]))
(deftype CaseAdapter [case-fn jdbc-adapter]
adapter/HugsqlAdapter
(execute [... | |
c9faa17d98589c99203515d30c02b541e4a780a72a7b6a87ab79b9d7f391bdf8 | otto-de/leinsync | program_test.clj | (ns leiningen.leinsync.program-test
(:require [clojure.test :refer :all]
[leiningen.leinsync.utils :as u]
[leiningen.leinsync.project-reader :as pr]
[leiningen.sync :as s]))
(deftest ^:unit test-split-string
(is (= ["project1" "project2" "project3"]
(u/split "project1,p... | null | https://raw.githubusercontent.com/otto-de/leinsync/744bab6d59cf2a17a2c9f613f75410a9bc6d7152/test/leiningen/leinsync/program_test.clj | clojure | (ns leiningen.leinsync.program-test
(:require [clojure.test :refer :all]
[leiningen.leinsync.utils :as u]
[leiningen.leinsync.project-reader :as pr]
[leiningen.sync :as s]))
(deftest ^:unit test-split-string
(is (= ["project1" "project2" "project3"]
(u/split "project1,p... | |
3bc643efcfcd65c6bc5e5d78aad0bb9a8652bbe639fd6a23db69a0587eb2ce64 | swarmpit/swarmpit | form_deployment_placement.cljs | (ns swarmpit.component.service.form-deployment-placement
(:require [material.components :as comp]
[swarmpit.component.state :as state]
[swarmpit.ajax :as ajax]
[swarmpit.routes :as routes]
[rum.core :as rum]))
(enable-console-print!)
(def form-value-cursor (into state... | null | https://raw.githubusercontent.com/swarmpit/swarmpit/38ffbe08e717d8620bf433c99f2e85a9e5984c32/src/cljs/swarmpit/component/service/form_deployment_placement.cljs | clojure | (ns swarmpit.component.service.form-deployment-placement
(:require [material.components :as comp]
[swarmpit.component.state :as state]
[swarmpit.ajax :as ajax]
[swarmpit.routes :as routes]
[rum.core :as rum]))
(enable-console-print!)
(def form-value-cursor (into state... | |
2ee07e5c11e28f58e4294a268c99bc2a4e4a76b21be9f13ac51a4475dad8e93e | kappelmann/eidi2_repetitorium_tum | ListTests.ml | open Lists
open NativeList
let e = empty
let e = add 4 e
let e = add 1990 e
let e = add 10000 e |> add 10000
let expected = 25021994
let res = fold (fun a b -> a+b) 25000000 e
let b = res=expected
let _ = if b then print_string "Congratulations, you finished your NativeList. Now try your MyList collection.\n" else fai... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/2016/recursive_types/exercises/ListTests.ml | ocaml | open Lists
open NativeList
let e = empty
let e = add 4 e
let e = add 1990 e
let e = add 10000 e |> add 10000
let expected = 25021994
let res = fold (fun a b -> a+b) 25000000 e
let b = res=expected
let _ = if b then print_string "Congratulations, you finished your NativeList. Now try your MyList collection.\n" else fai... | |
090379f14a783e22b38f8e3f76b755f566cd9548d1f986d64af41021ffeab983 | dbuenzli/webs | webs_websocket.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The webs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/webs/4770e78330bd04f507db759e0a9f210b72eeef82/src/webs_websocket.ml | ocaml | Start
For each block
Fill w
Loop
Update
Headers
Handshake
Upgrading | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The webs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... |
2f3f079a1591853508d3845637613a4701a76fbe9de1d8232eea92b72303e972 | herd/herdtools7 | ocamlString_test.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/internal/lib/tests/ocamlString_test.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
388ebfdbc38a7d11d48e9f0d89ba25c2dd1f66f3646c95056ba4ff8946a13f4f | OCamlPro/operf-micro | fft.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/OCamlPro/operf-micro/d5d2bf2068204b889321b0c5a7bc0d079c0fca80/share/operf-micro/benchmarks/fft/fft.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
let pi = 3.14159265358979323846
let tp... |
fa981291520ac81021557356a49d4b0f9e7e39cad44489708bbf8cb5725ef8e7 | ucsd-progsys/liquidhaskell | Elim_ex_list.hs | {-@ LIQUID "--expect-any-error" @-}
# LANGUAGE QuasiQuotes #
module Elim_ex_list (prop) where
import LiquidHaskell
import Prelude hiding (head)
--------------------------------------------------------------------------
[lq| prop :: a -> Even |]
prop _ = (head ys) - 1
where
ys = Cons 1 (Cons 2 (Cons 5 Nil))
-... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/neg/Elim_ex_list.hs | haskell | @ LIQUID "--expect-any-error" @
------------------------------------------------------------------------
------------------------------------------------------------------------ |
# LANGUAGE QuasiQuotes #
module Elim_ex_list (prop) where
import LiquidHaskell
import Prelude hiding (head)
[lq| prop :: a -> Even |]
prop _ = (head ys) - 1
where
ys = Cons 1 (Cons 2 (Cons 5 Nil))
[lq| type Even = {v:Int | v mod 2 == 0 } |]
data List a = Nil | Cons a (List a)
head :: List a -> a
head (Co... |
4bc256361a2bc17b01680382863bde7cdfad8801db0d7b602c32746047a46dd4 | footprintanalytics/footprint-web | card.clj | (ns metabase.models.card
"Underlying DB model for what is now most commonly referred to as a 'Question' in most user-facing situations. Card
is a historical name, but is the same thing; both terms are used interchangeably in the backend codebase."
(:require [clojure.set :as set]
[clojure.tools.logging... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/models/card.clj | clojure | both terms are used interchangeably in the backend codebase."
-------------------------------------------------- Hydration --------------------------------------------------
There's more hydration in the shared metabase.moderation namespace, but it needs to be required:
---------------------------------------------... | (ns metabase.models.card
"Underlying DB model for what is now most commonly referred to as a 'Question' in most user-facing situations. Card
(:require [clojure.set :as set]
[clojure.tools.logging :as log]
[medley.core :as m]
[metabase.mbql.normalize :as mbql.normalize]
... |
5e8a88b5996646f95f7f120267c6c59e096c114307330a6d5678e027b834328e | BinaryAnalysisPlatform/bap | primus_promiscuous_main.ml | open Core_kernel[@@warning "-D"]
open Bap.Std
open Monads.Std
open Bap_primus.Std
open Format
include Self()
let package = "bap"
In a general case a block is terminated by a sequence of jumps :
{ v
when C1 jmp D1
when C2 jmp D2
...
when v }
The IR requires the followi... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/cbdf732d46c8e38df79d9942fc49bcb97915c657/plugins/primus_promiscuous/primus_promiscuous_main.ml | ocaml | open Core_kernel[@@warning "-D"]
open Bap.Std
open Monads.Std
open Bap_primus.Std
open Format
include Self()
let package = "bap"
In a general case a block is terminated by a sequence of jumps :
{ v
when C1 jmp D1
when C2 jmp D2
...
when v }
The IR requires the followi... | |
2b7bc45285006c2e89c4bf5c7cad19711ac7aa2491d04a1dbd567d4185f470b9 | wireless-net/erlang-nommu | sys.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2013 . 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/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/src/sys.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 1996 - 2013 . 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(sys).
-export([suspend/1, suspend/... |
a8ddd64027d103d19310332b7eb874458d826ce2a08bd3dd5913c3d1a2f41d6a | srid/ema | Verification.hs | # LANGUAGE UndecidableInstances #
module Ema.Route.Generic.Verification (
type VerifyModels,
type VerifyRoutes,
) where
import Data.Generics.Product.Any (HasAny)
import GHC.TypeLits
| @VerifyModels model routeModels lookups@ verifies the given @model@ to ensure that there
exists a valid instance for the giv... | null | https://raw.githubusercontent.com/srid/ema/39013719e69f60088c153f861df584ed16bd826d/ema-generics/src/Ema/Route/Generic/Verification.hs | haskell | This checks the simple case that (the model ~ the submodel),
because it doesn't necessarily have to have a generic instance in this case.
structure statically to verify that the correct submodel exists.
Inconsistent lengths
Subroute rep is unit (REVIEW: this case not strictly necessary anymore; should it be remove... | # LANGUAGE UndecidableInstances #
module Ema.Route.Generic.Verification (
type VerifyModels,
type VerifyRoutes,
) where
import Data.Generics.Product.Any (HasAny)
import GHC.TypeLits
| @VerifyModels model routeModels lookups@ verifies the given @model@ to ensure that there
exists a valid instance for the giv... |
1a4731e4d134410ac83948177a9cedc9a613f13a538fa2c79f9af0c46574b735 | xu-hao/QueryArrow | Plugin.hs | # LANGUAGE FlexibleContexts , MultiParamTypeClasses , FlexibleInstances , OverloadedStrings , GADTs , ExistentialQuantification , ForeignFunctionInterface #
module QueryArrow.FFI.C.Plugin where
import QueryArrow.Syntax.Term
import QueryArrow.Syntax.Utils
import QueryArrow.DB.DB
import QueryArrow.QueryPlan
import Quer... | null | https://raw.githubusercontent.com/xu-hao/QueryArrow/4dd5b8a22c8ed2d24818de5b8bcaa9abc456ef0d/QueryArrow-ffi-c/src/QueryArrow/FFI/C/Plugin.hs | haskell | "resc_name" ">" _data_resc_name
foreign export ccall hs_command :: StablePtr (Session) -> Ptr CString -> CInt -> CString -> Ptr CString -> Ptr CString -> CInt -> Ptr (Ptr (Ptr CString)) -> IO Int
hs_command :: StablePtr (Session) -> Ptr CString -> CInt -> CString -> Ptr CString -> Ptr CString -> CInt -> Ptr (Ptr (Pt... | # LANGUAGE FlexibleContexts , MultiParamTypeClasses , FlexibleInstances , OverloadedStrings , GADTs , ExistentialQuantification , ForeignFunctionInterface #
module QueryArrow.FFI.C.Plugin where
import QueryArrow.Syntax.Term
import QueryArrow.Syntax.Utils
import QueryArrow.DB.DB
import QueryArrow.QueryPlan
import Quer... |
ad58f020d5858f8da44c431574d33e95e03cd451ead0ce476ee1e4e938578ccc | jlouis/enacl | enacl.erl | %%% @doc Module enacl implements bindings to the NaCl/libsodium crypto-library
< p > This module implements NIF bindings to the library known as NaCl ( pronounced " salt " ) .
The NaCl library provides a sane cryptographic interface to the world in an attempt to
%%% make it harder to abuse and misuse cryptographic ... | null | https://raw.githubusercontent.com/jlouis/enacl/20b230d693ba4c0053ab044be5442fdb6e6b61f0/src/enacl.erl | erlang | @doc Module enacl implements bindings to the NaCl/libsodium crypto-library
make it harder to abuse and misuse cryptographic primitives.</p>
about a primitive, always consult the underlying documentation.</p>
restrict ourselves to the portion of the code base which is overlapping.</p>
<p><b>Warning:</b> It is neces... | < p > This module implements NIF bindings to the library known as NaCl ( pronounced " salt " ) .
The NaCl library provides a sane cryptographic interface to the world in an attempt to
< p > This module implements an Erlang - idiomatic API to the underlying library . If in doubt
< p > There are two libraries in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.