_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 |
|---|---|---|---|---|---|---|---|---|
4286b7b1f00f6f7529e116d65459dbe6380842103368d74e1b8b5f39e0a7e13e | sonowz/advent-of-code-haskell | Day24.hs | module Y2021.Day24 where
import qualified Data.Vector as V
import Lib.IO
import Lib.Types
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.Foldable1
import Relude.Extra.Map
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import qualified Relude.Unsafe as Unsafe
import System.Random
-- Note: this... | null | https://raw.githubusercontent.com/sonowz/advent-of-code-haskell/a3d9f4a5b065c296d019506603eba3ce4b398765/src/Y2021/Day24.hs | haskell | Note: this part requires analysis of input instructions to figure out the solution
Bottom, or leaf level push-pops are independent of other inputs,
while higher, or non-leaf level push-pops are dependent of its lower level inputs.
This solution utilizes properties mentioned above and uses a brute-force approach.
... | module Y2021.Day24 where
import qualified Data.Vector as V
import Lib.IO
import Lib.Types
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.Foldable1
import Relude.Extra.Map
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import qualified Relude.Unsafe as Unsafe
import System.Random
The program... |
d0df51ebfb2a94c24b1007289a064bf7c0a409ab622b03c49f4d226779991d82 | rd--/hsc3 | clipNoise.help.hs | -- clipNoise
clipNoiseId 'α' ar * 0.1
---- ; drawings
Sound.Sc3.Plot.plot_ugen1 0.01 (clipNoiseId 'α' ar)
| null | https://raw.githubusercontent.com/rd--/hsc3/024d45b6b5166e5cd3f0142fbf65aeb6ef642d46/Help/Ugen/clipNoise.help.hs | haskell | clipNoise
-- ; drawings | clipNoiseId 'α' ar * 0.1
Sound.Sc3.Plot.plot_ugen1 0.01 (clipNoiseId 'α' ar)
|
8701753723475d0ce1be499e0b4b32a1de0b3b13b2acb99070639f7b4a6ca61b | luqui/experiments | observable.hs | # LANGUAGE TypeOperators , ConstraintKinds , GADTs , RankNTypes , ScopedTypeVariables , , DeriveFunctor , DefaultSignatures , TypeFamilies , EmptyDataDecls , LambdaCase #
import Data.Void (Void, absurd)
import Data.Kind (Constraint)
data Ex f where
Ex :: f a -> Ex f
newtype (c := f) a = Cx (c a => f a)
type Ex... | null | https://raw.githubusercontent.com/luqui/experiments/c0b9153c41507afbfdeb2b32bfc65fd1ac83fb26/observable.hs | haskell | To make an existential datum, e.g. exists a. c a => (a,a), do it by
regular Ex. | # LANGUAGE TypeOperators , ConstraintKinds , GADTs , RankNTypes , ScopedTypeVariables , , DeriveFunctor , DefaultSignatures , TypeFamilies , EmptyDataDecls , LambdaCase #
import Data.Void (Void, absurd)
import Data.Kind (Constraint)
data Ex f where
Ex :: f a -> Ex f
newtype (c := f) a = Cx (c a => f a)
type Ex... |
611fbba44b1ceed9aa9fa03c9e7e42d8e8c916d3d0b40fd0df0d4f61a55bb1d3 | defaultxr/cl-patterns | conversions.lisp | ;;;; conversions.lisp - functionality to convert between different units.
(in-package #:cl-patterns)
;;; defconversion
(defvar *conversions* (make-hash-table)
"Hash table storing conversion function definitions and metadata.")
;; FIX: maybe separate out name into FROM and TO, so some conversions can be auto-gener... | null | https://raw.githubusercontent.com/defaultxr/cl-patterns/e4bcdcf1dff29dcdf83de79ade4412896753a027/src/conversions.lisp | lisp | conversions.lisp - functionality to convert between different units.
defconversion
FIX: maybe separate out name into FROM and TO, so some conversions can be auto-generated?
polarity
volume
duration
pitch
pitch units hierarchy:
- freq
- midinote - midi note number.
- root - scale root, given in 12ET... |
(in-package #:cl-patterns)
(defvar *conversions* (make-hash-table)
"Hash table storing conversion function definitions and metadata.")
(defmacro defconversion (name lambda-list &body body)
"Define a conversion, storing function definition information so it can be used later to define \"pseudo-ugens\" for synthe... |
20f67f6741df53788fe5fea5c16e5b6e1e5e3a9239a4d422dc42f4823e0553c1 | clojure-link/link | codec.clj | (ns link.codec
(:refer-clojure :exclude [byte float double])
(:require [link.util :as util]
[clojure.walk :refer [postwalk]])
(:import [java.util List])
(:import [io.netty.buffer ByteBuf Unpooled])
(:import [io.netty.channel
ChannelHandlerContext
ChannelPromise])
(:import... | null | https://raw.githubusercontent.com/clojure-link/link/2b6f6abe70edfade738c7391d38c5b509c798a40/src/link/codec.clj | clojure | macro to improve codec readability
little endian versions of multibyte primitive codecs
length prefix string
delimiter based string
length prefix string
delimiter based string
move readerIndex
body is nil if head is nil | (ns link.codec
(:refer-clojure :exclude [byte float double])
(:require [link.util :as util]
[clojure.walk :refer [postwalk]])
(:import [java.util List])
(:import [io.netty.buffer ByteBuf Unpooled])
(:import [io.netty.channel
ChannelHandlerContext
ChannelPromise])
(:import... |
ec72387291dc661e0db72822037d2b7fa9d33934997411659bf0ab8a416e5fb9 | bevuta/pepa | columns.cljs | (ns pepa.workflows.inbox.columns
(:require cljs.core.match
[clojure.string :as s]
[goog.string :as gstring]
[pepa.navigation :as nav])
(:require-macros [cljs.core.match.macros :refer [match]]))
(defprotocol ColumnSpec
(column-spec [col]))
(defn- parse-column-param [param]
{... | null | https://raw.githubusercontent.com/bevuta/pepa/0a9991de0fd1714515ca3def645aec30e21cd671/src-cljs/pepa/workflows/inbox/columns.cljs | clojure | Special case: If last column is 'new
document', insert before it | (ns pepa.workflows.inbox.columns
(:require cljs.core.match
[clojure.string :as s]
[goog.string :as gstring]
[pepa.navigation :as nav])
(:require-macros [cljs.core.match.macros :refer [match]]))
(defprotocol ColumnSpec
(column-spec [col]))
(defn- parse-column-param [param]
{... |
083a510f8c4000038f63ba2f1ededcfce2b569b20b8952a54573009db6744ed9 | ucsd-progsys/liquidhaskell | ExactGADT2.hs | {-@ LIQUID "--exact-data-con" @-}
# LANGUAGE GADTs #
module ExactGADT2 where
{-@ data Field typ where
FldX :: Field Int
FldY :: Field Int
@-}
data Field typ where
FldX :: Field Int
FldY :: Field Int
poogle = FldY
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/pos/ExactGADT2.hs | haskell | @ LIQUID "--exact-data-con" @
@ data Field typ where
FldX :: Field Int
FldY :: Field Int
@ |
# LANGUAGE GADTs #
module ExactGADT2 where
data Field typ where
FldX :: Field Int
FldY :: Field Int
poogle = FldY
|
4d9d95175ec127d798a4c6af923f0155cc3ecefd5a0c85bb0cf563101adc029c | lynaghk/hicada | interpreter.cljc | (ns hicada.interpreter
(:require #?(:cljs [goog.object :as object])
[clojure.string :as str]
[clojure.string :refer [blank? join]]
[hicada.normalize :as normalize]
hicada.input
[hicada.util :as util]))
(defprotocol IInterpreter
(interpret [this] "Interpre... | null | https://raw.githubusercontent.com/lynaghk/hicada/e6e2b45b162bb4ee3dc275020141c210d2299d55/src/hicada/interpreter.cljc | clojure | A hack to force input elements to always update itself immediately,
without waiting for requestAnimationFrame.
an element have changed. We detect this and render
element as-is, hoping that next onChange will
eventually come and bring our modifications anyways.
Ignoring this causes skipped letters in controlled
c... | (ns hicada.interpreter
(:require #?(:cljs [goog.object :as object])
[clojure.string :as str]
[clojure.string :refer [blank? join]]
[hicada.normalize :as normalize]
hicada.input
[hicada.util :as util]))
(defprotocol IInterpreter
(interpret [this] "Interpre... |
52dd7a1ea799d0263de47c0d6c5f0934eaf02f5346c62c07c8974446473a4600 | alpacaaa/quad-ci | Server.hs | module Server where
import qualified Codec.Serialise as Serialise
import Core
import qualified Data.Aeson as Aeson
import qualified Github
import qualified JobHandler
import qualified Network.HTTP.Types as HTTP.Types
import qualified Network.Wai.Middleware.Cors as Cors
import RIO
import qualified RIO.Map as Map
import... | null | https://raw.githubusercontent.com/alpacaaa/quad-ci/99175d3d0da5c03de22e3b20ae3b6ded79e40b57/src/Server.hs | haskell | module Server where
import qualified Codec.Serialise as Serialise
import Core
import qualified Data.Aeson as Aeson
import qualified Github
import qualified JobHandler
import qualified Network.HTTP.Types as HTTP.Types
import qualified Network.Wai.Middleware.Cors as Cors
import RIO
import qualified RIO.Map as Map
import... | |
e667c99ecb8e65621f52738b5b8abd2238216be7564d46f7ad57edf5f037c5f4 | footprintanalytics/footprint-web | pulse_card.clj | (ns metabase.models.pulse-card
(:require [metabase.models.serialization.base :as serdes.base]
[metabase.models.serialization.hash :as serdes.hash]
[metabase.models.serialization.util :as serdes.util]
[metabase.util :as u]
[metabase.util.schema :as su]
[schem... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/models/pulse_card.clj | clojure | ----------------------------------------------------- Serialization -------------------------------------------------
Depends on the Pulse, Card and (optional) dashboard card. | (ns metabase.models.pulse-card
(:require [metabase.models.serialization.base :as serdes.base]
[metabase.models.serialization.hash :as serdes.hash]
[metabase.models.serialization.util :as serdes.util]
[metabase.util :as u]
[metabase.util.schema :as su]
[schem... |
29e7d3fcb8a323e664c392b6ee31173d9d0cd03f5aaf422b7df5d72390131dc9 | refuge/cowdb | cowdb_util.erl | %%-*- mode: erlang -*-
%%
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
-module(cowdb_util).
-include("cowdb.hrl").
-include_lib("cbt/include/cbt.hrl").
-define(DEFAULT_COMPACT_LIMIT, 2... | null | https://raw.githubusercontent.com/refuge/cowdb/40d72119a59407c7dddc140443b518a90338e347/src/cowdb_util.erl | erlang | -*- mode: erlang -*-
@doc initialize the db
maybe sync the header
extract db info from the header
initial db record
@doc test if the db file should be synchronized or not depending on the
state
@doc write the db header
@doc commit the transaction on the disk.
write the header
@doc synchronous shutdown
@doc... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(cowdb_util).
-include("cowdb.hrl").
-include_lib("cbt/include/cbt.hrl").
-define(DEFAULT_COMPACT_LIMIT, 2048000).
-export([set_prope... |
a6a07466d9a2d5a6fb47ab10dcfc681f9c71a8d8a9f2dd4f0f1502197815f69b | marick/structural-typing | type.clj | (ns structural-typing.type
"Structural types, loosely inspired by Elm's way of looking at [records](-lang.org/learn/Records.elm).
"
(:use structural-typing.clojure.core)
(:require [structural-typing.assist.type-repo :as repo]
[structural-typing.guts.compile.compile :as compile]
[structural... | null | https://raw.githubusercontent.com/marick/structural-typing/9b44c303dcfd4a72c5b75ec7a1114687c809fba1/src/structural_typing/type.clj | clojure |
you can't feed it back
you can't feed it back
instead of: | (ns structural-typing.type
"Structural types, loosely inspired by Elm's way of looking at [records](-lang.org/learn/Records.elm).
"
(:use structural-typing.clojure.core)
(:require [structural-typing.assist.type-repo :as repo]
[structural-typing.guts.compile.compile :as compile]
[structural... |
52c547fc92813e382ba627ccddbba37b6ed280d5cca20fefa0d6738f86f45da1 | puppetlabs/trapperkeeper-metrics | metrics_service.clj | (ns puppetlabs.trapperkeeper.services.metrics.metrics-service
(:require [puppetlabs.trapperkeeper.core :as trapperkeeper]
[puppetlabs.trapperkeeper.services.authorization.authorization-service :as tk-auth]
[puppetlabs.trapperkeeper.services.protocols.metrics :as metrics]
[puppetlab... | null | https://raw.githubusercontent.com/puppetlabs/trapperkeeper-metrics/47f1534ebb75339eeb42e0de33fab0ec2f6cacdc/src/clj/puppetlabs/trapperkeeper/services/metrics/metrics_service.clj | clojure | registry settings can only be updated in the `init` phase of the lifecycle
NOTE: Normally, these route and server lookups would be done by
mount sub-paths at the moment (TK-420). So we explicitly compute | (ns puppetlabs.trapperkeeper.services.metrics.metrics-service
(:require [puppetlabs.trapperkeeper.core :as trapperkeeper]
[puppetlabs.trapperkeeper.services.authorization.authorization-service :as tk-auth]
[puppetlabs.trapperkeeper.services.protocols.metrics :as metrics]
[puppetlab... |
8fb9ae076f58209ae492522085f2bed2e146783e5c6d53692c7aa66bf4a08ebe | charlieg/Sparser | kill.lisp | -*- Package : co ; Base : 10 ; Syntax : Common - Lisp -*-
(in-package :co)
;;;
BBN Technologies
;;; A Division of BBN Corporation
;;; Copyright
;;; All Rights Reserved
1999
;;;
;;; This file contains the basic functions for killing a concept or a role
;;; or changing the name of a conc... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/lisp/sfl/kill.lisp | lisp | Base : 10 ; Syntax : Common - Lisp -*-
A Division of BBN Corporation
Copyright
All Rights Reserved
This file contains the basic functions for killing a concept or a role
or changing the name of a concept or a role.
Trying to figure out what needs to be recompleted and what doesn't in
the face ... | (in-package :co)
BBN Technologies
1999
almost solved in KREME in a slightly different context but one which is
NETWORK after changing the name of a concept or role or killing a
concept . Roles KILLED if there are any slots that use them
(defvar *concept-being-killed* nil)
(defun re... |
89ee93923ef4ffa00155f064ea151621650f5435af98ce2fa2f9820869d86e7e | haskell/wreq | OAuth1.hs | module Network.Wreq.Internal.OAuth1 (signRequest) where
import Network.HTTP.Client (Request(..))
import Web.Authenticate.OAuth ( signOAuth, newOAuth, oauthConsumerKey
, oauthConsumerSecret, newCredential)
import qualified Data.ByteString as S
signRequest :: S.ByteString -> S.ByteString -... | null | https://raw.githubusercontent.com/haskell/wreq/2da0070625a680d5af59e36c3ca253ef6a80aea9/Network/Wreq/Internal/OAuth1.hs | haskell | module Network.Wreq.Internal.OAuth1 (signRequest) where
import Network.HTTP.Client (Request(..))
import Web.Authenticate.OAuth ( signOAuth, newOAuth, oauthConsumerKey
, oauthConsumerSecret, newCredential)
import qualified Data.ByteString as S
signRequest :: S.ByteString -> S.ByteString -... | |
da8a5449b8b40717ba2e0de1ca1d07f4a6a92ffa9a59c8aac6f4327898c5b047 | MassD/pearls | rank_suffix.ml | let by_r1 (_, (r1,_)) = r1
let by_r2 (_, (_,r2)) = r2
let csort f n l =
let a = Array.make n [] in
List.iter (fun x -> let i = f x in a.(i) <- x::a.(i)) l;
Array.fold_right (fun x acc -> List.rev_append x acc) a []
let lsdradix_sort n l =
csort by_r2 n l |> csort by_r1 n
let update_ranks idxf rf a sorted_li ... | null | https://raw.githubusercontent.com/MassD/pearls/da73f49ffe61125c1def4f2b3ed339963318dbec/12_rank_suffixes/rank_suffix.ml | ocaml | let by_r1 (_, (r1,_)) = r1
let by_r2 (_, (_,r2)) = r2
let csort f n l =
let a = Array.make n [] in
List.iter (fun x -> let i = f x in a.(i) <- x::a.(i)) l;
Array.fold_right (fun x acc -> List.rev_append x acc) a []
let lsdradix_sort n l =
csort by_r2 n l |> csort by_r1 n
let update_ranks idxf rf a sorted_li ... | |
0375d0676eb92c2328cde54e41a3e298193965549a51c5bb0bd09fdb4f6d94f4 | tweag/asterius | drvrun006.hs | ! ! ! Show / Read deriving example given in the Haskell Report .
module Main(main) where
infix 4 :^:
data Tree a
= Leaf a | (Tree a) :^: (Tree a)
deriving (Show, Read)
val1 :: Tree Int
val1 = Leaf 2
val2 :: Tree Int
val2 = Leaf 2 :^: Leaf (-1)
main = do
print val1
print val2
print ((read (show val... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/deriving/drvrun006.hs | haskell | ! ! ! Show / Read deriving example given in the Haskell Report .
module Main(main) where
infix 4 :^:
data Tree a
= Leaf a | (Tree a) :^: (Tree a)
deriving (Show, Read)
val1 :: Tree Int
val1 = Leaf 2
val2 :: Tree Int
val2 = Leaf 2 :^: Leaf (-1)
main = do
print val1
print val2
print ((read (show val... | |
360c209f80bedff7f4b88ba1487e980b9366f8da268d0d67533865ebebbcabca | rizo/snowflake-os | bigarrayUtils.ml |
(* BigarrayUtils : Conversion between different array types *)
open Bigarray
(* this creates a copy of the data =/ *)
let of_string string =
let ba = Array1.create char c_layout (String.length string) in
for i = 0 to String.length string - 1 do
Array1.set ba i string.[i];
done;
ba
external chan... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/alac/bigarrayUtils.ml | ocaml | BigarrayUtils : Conversion between different array types
this creates a copy of the data =/ |
open Bigarray
let of_string string =
let ba = Array1.create char c_layout (String.length string) in
for i = 0 to String.length string - 1 do
Array1.set ba i string.[i];
done;
ba
external change_flags : ('a, 'b, c_layout) Array1.t -> ('c, 'd) kind -> int -> ('c, 'd, c_layout) Array1.t = "caml_ba_c... |
607f658405b2b0a8d43764f87835a9d88edf92a0ad747ef36a6f6b3e2eafd734 | csabahruska/jhc-components | Main.hs | module Main(main) where
import Control.Exception
import Data.Char
import System.Directory
import System.FilePath as FP
import System.IO
import qualified Data.ByteString.Lazy as LBS
import DataConstructors
import E.Main
import E.Program
import E.Rules
import E.Type
import FrontEnd.Class
import Grin.Main(compileToGrin)... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-app/src/Main.hs | haskell | set temporary directory
we are very careful to only delete cache files.
dump final version of various requested things
enter interactive mode | module Main(main) where
import Control.Exception
import Data.Char
import System.Directory
import System.FilePath as FP
import System.IO
import qualified Data.ByteString.Lazy as LBS
import DataConstructors
import E.Main
import E.Program
import E.Rules
import E.Type
import FrontEnd.Class
import Grin.Main(compileToGrin)... |
cc56b379a8bdb6f665eccec0745df3250c693a0a4f5c98c6f512e9462cec3088 | janegca/htdp2e | Exercise-032-ImageAreaFn.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-beginner-reader.ss" "lang")((modname Exercise-032-ImageAreaFn) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp")... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/01-FixedSizeData/Exercise-032-ImageAreaFn.rkt | racket | about the language level of this file in a form that our tools can easily process.
Design the function image-area, which counts the number of pixels in a given
image.
Image -> Number
return the number of pixels in the given image | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Exercise-032-ImageAreaFn) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (... |
1b3fdfe3ffa7d36a2e921f3ec5ca5d49de778d7fc3e885c33c440e33b9d05067 | fetburner/Coq2SML | proofview.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/proofs/proofview.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
The proofview datastructure is a pu... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Term
type proofview
... |
678808324b27094e66a0088c0e10b8cf8fdeecbc45c088ec8d5bebec71b6fe0a | ocaml-multicore/effects-examples | eratosthenes.ml | * Message - passing parallel prime number generation using Sieve of Eratosthenes *
open Effect
open Effect.Deep
(* A message is either a [Stop] signal or a [Candidate] prime number *)
type message = Stop | Candidate of int
let string_of_msg = function
| Stop -> "Stop"
| Candidate i -> Printf.sprintf "%d" i
(** P... | null | https://raw.githubusercontent.com/ocaml-multicore/effects-examples/4f07e1774b726eec0f6769da0a16b402582d37b5/eratosthenes.ml | ocaml | A message is either a [Stop] signal or a [Candidate] prime number
* Process primitives *
* Communication primitives *
* A mailbox is indexed by process ids (PIDs), each process has its own message queue *
* Communication handler *
* Process handler
Slightly modified version of sched.ml *
* The prime number genera... | * Message - passing parallel prime number generation using Sieve of Eratosthenes *
open Effect
open Effect.Deep
type message = Stop | Candidate of int
let string_of_msg = function
| Stop -> "Stop"
| Candidate i -> Printf.sprintf "%d" i
type pid = int
type _ Effect.t += Spawn : (pid -> unit) -> pid Effect.t
let ... |
e6ca6864510675e5eb7a5a4033b0a8768a3650ef9a636bafbb44f58b722b2d23 | liquidz/misaki | code.clj | (ns misaki.test.compiler.default.util.code
(:require
[misaki.compiler.default.config :refer :all]
[misaki.compiler.default.util.code :refer :all]
[misaki.tester :refer [set-base-dir! defcompilertest]]
[clojure [test :refer :all]
[string :as str]])
(:import... | null | https://raw.githubusercontent.com/liquidz/misaki/b8104e632058e3b3da4487513d10e666e5914ec9/test/misaki/test/compiler/default/util/code.clj | clojure | y = [:pre {:class "prettyprint"} "body"] | (ns misaki.test.compiler.default.util.code
(:require
[misaki.compiler.default.config :refer :all]
[misaki.compiler.default.util.code :refer :all]
[misaki.tester :refer [set-base-dir! defcompilertest]]
[clojure [test :refer :all]
[string :as str]])
(:import... |
f9051e9b732929636dd75f27e0cb935b72043880dfc08cc1d111e233e7710f22 | subtitle-master/subtitlemaster | main.cljs | (ns smgui.main
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [om.core :as om]
[om.dom :as dom]
[smgui.components :refer [external-link pd]]
[smgui.search :refer [render-search]]
[smgui.settings :as settings]
[smgui.organize :refe... | null | https://raw.githubusercontent.com/subtitle-master/subtitlemaster/d88c2fb007c6c3d4030fefbd4b7e3eafb0e797a9/src/cljs/smgui/main.cljs | clojure | (ns smgui.main
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [om.core :as om]
[om.dom :as dom]
[smgui.components :refer [external-link pd]]
[smgui.search :refer [render-search]]
[smgui.settings :as settings]
[smgui.organize :refe... | |
d78a626c1f953e383e4faf17b8f982f33f06be3df52e7738be09d7fe22fe85c0 | nurpax/sqlite-simple | Statement.hs | {-# LANGUAGE OverloadedStrings #-}
module Statement (
testBind
, testDoubleBind
, testPreparedStatements
, testPreparedStatementsColumnCount
) where
import Common
import Data.Maybe(fromJust)
import qualified Database.SQLite3 as Base
testBind :: TestEnv -> Test
testBind TestEnv{..} = TestCase $ do
exec... | null | https://raw.githubusercontent.com/nurpax/sqlite-simple/49390582cb090fc1ef95988dab9ecc8ebb32251b/test/Statement.hs | haskell | # LANGUAGE OverloadedStrings # |
module Statement (
testBind
, testDoubleBind
, testPreparedStatements
, testPreparedStatementsColumnCount
) where
import Common
import Data.Maybe(fromJust)
import qualified Database.SQLite3 as Base
testBind :: TestEnv -> Test
testBind TestEnv{..} = TestCase $ do
execute_ conn "CREATE TABLE test_bind (... |
c720b2907e279fa1ea77c225f782bd6bec7ae79b7ebdeeb795bd4fb58b03c744 | jtobin/deanie | BetaBernoulliRejection.hs |
module Main where
import Control.Monad
import Deanie
import Model.BetaBernoulli as Model
posterior :: Double -> Double -> Program Double
posterior a b =
grejection
(\xs ys -> count xs == count ys)
Model.observations (beta a b) bernoulli
where
count = length . filter id
main :: IO ()
main = do
... | null | https://raw.githubusercontent.com/jtobin/deanie/37045f82401d18a63be4d333cff9b9053b927d3a/test/BetaBernoulliRejection.hs | haskell |
module Main where
import Control.Monad
import Deanie
import Model.BetaBernoulli as Model
posterior :: Double -> Double -> Program Double
posterior a b =
grejection
(\xs ys -> count xs == count ys)
Model.observations (beta a b) bernoulli
where
count = length . filter id
main :: IO ()
main = do
... | |
058a9e0d4271343459df813ee866c4fa867b608a48cc7aeb48363303777ea759 | ghcjs/jsaddle-dom | WebGPURenderPipelineColorAttachmentDescriptor.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGPURenderPipelineColorAttachmentDescriptor
(setPixelFormat, getPixelFormat,
WebGPURenderPipelineColorAtt... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/WebGPURenderPipelineColorAttachmentDescriptor.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGPURenderPipelineColorAttachmentDescriptor
(setPixelFormat, getPixelFormat,
WebGPURenderPipelineColorAttachmentDescriptor(..),
gTypeWebGPURenderPipelineColorAttachmentDescriptor)
where
imp... |
21bf132c02ce829569348f4bb9a5e1591221b6c54ef6932b49efd9198effd4d9 | galdor/tungsten | concurrency-ccl.lisp | (in-package :system)
;;;
Mutexes
;;;
(deftype %mutex ()
'ccl:lock)
(defun %make-mutex (&key name)
(ccl:make-lock name))
(defun %acquire-mutex (mutex)
(ccl:grab-lock mutex))
(defun %maybe-acquire-mutex (mutex)
(ccl:try-lock mutex))
(defun %release-mutex (mutex)
(ccl:release-lock mutex))
(defmacro %wit... | null | https://raw.githubusercontent.com/galdor/tungsten/5d6e71fb89af32ab3994c5b2daf8b902a5447447/tungsten-system/src/concurrency-ccl.lisp | lisp |
Semaphores
Condition variables
supporting an implementation without built-in condition variables, but
there are not a lot of open source implementations left, and testing with
Condition variables are implemented with semaphores as described in
because the queue-based implementation requires wrapping thread... | (in-package :system)
Mutexes
(deftype %mutex ()
'ccl:lock)
(defun %make-mutex (&key name)
(ccl:make-lock name))
(defun %acquire-mutex (mutex)
(ccl:grab-lock mutex))
(defun %maybe-acquire-mutex (mutex)
(ccl:try-lock mutex))
(defun %release-mutex (mutex)
(ccl:release-lock mutex))
(defmacro %with-mutex ... |
4efaddfbdf00b3263f7abd5ceb2b421234b49d980c76414e727deac7335e0726 | bhaskara/programmable-reinforcement-learning | matlab.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
matlab.lisp
;; utilities for converting to and from matlab format
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package utils)
(defun matlab-write (filename... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/misc/matlab.lisp | lisp |
utilities for converting to and from matlab format
| matlab.lisp
(in-package utils)
(defun matlab-write (filename seq &optional overwrite)
"matlab-write F S &OPTIONAL (OVERWRITE NIL). Writes sequence S to file F in matlab-readable (ascii) form. If OVERWRITE is true, then overwrite F if it already exists."
(flet ((write-it (f)
(map nil
(lambda (x) (fo... |
9fd23910ecf51c44cb83001640300de89cb2305219bc21ff82649c6d45630044 | HumbleUI/HumbleUI | effects.clj | (ns examples.effects
(:require
[clojure.math :as math]
[io.github.humbleui.canvas :as canvas]
[io.github.humbleui.core :as core]
[io.github.humbleui.font :as font]
[io.github.humbleui.paint :as paint]
[io.github.humbleui.protocols :as protocols]
[io.github.humbleui.typeface :as typeface]
... | null | https://raw.githubusercontent.com/HumbleUI/HumbleUI/2e50a4338ef3b5379acae48f1e57baae0af407d2/dev/examples/effects.clj | clojure | (ns examples.effects
(:require
[clojure.math :as math]
[io.github.humbleui.canvas :as canvas]
[io.github.humbleui.core :as core]
[io.github.humbleui.font :as font]
[io.github.humbleui.paint :as paint]
[io.github.humbleui.protocols :as protocols]
[io.github.humbleui.typeface :as typeface]
... | |
34651fde0d0c52735fcc467968d5b298a6eecd8e631048bb421e0b5e573e0dec | CarlWright/NGerlguten | eg_mk_hyphen.erl | %%==========================================================================
Copyright ( C ) 2003
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
... | null | https://raw.githubusercontent.com/CarlWright/NGerlguten/3c87f2e3a44ae9069f9379933b99c0feb8262d66/lib/ngerlguten/src/eg_mk_hyphen.erl | erlang | ==========================================================================
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
following conditions:
The above cop... | Copyright ( C ) 2003
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to permit
persons to whom the Software is furnished to do so , subject to the
in all copies or substantial portions of the Software .
THE SOFTWAR... |
68b81a4975de291ff5be7bbbd5883342a1b626c3806d026c27f4e7f9791e0964 | nilenso/kulu-backend | pagination_test.clj | (ns kulu-backend.models.helpers.pagination-test
(:require [kulu-backend.models.helpers.pagination :refer :all]
[clojure.test :refer :all]))
(let [q {:select :foo :from :bar :order-by `(:date)}]
(deftest pagination
;;; TODO: Use to generate these tests
(testing "adds correct limit and offset en... | null | https://raw.githubusercontent.com/nilenso/kulu-backend/0b404f76643e77219432dcbffa681172a61e591b/test/kulu_backend/models/helpers/pagination_test.clj | clojure | TODO: Use to generate these tests | (ns kulu-backend.models.helpers.pagination-test
(:require [kulu-backend.models.helpers.pagination :refer :all]
[clojure.test :refer :all]))
(let [q {:select :foo :from :bar :order-by `(:date)}]
(deftest pagination
(testing "adds correct limit and offset entries into the given map"
(let [{:key... |
a6cef5bfe4ebc93220216b3945f28c7d587a0124bbe7972e0a205529a8ef0956 | mbj/stratosphere | FilterTagProperty.hs | module Stratosphere.S3Outposts.Bucket.FilterTagProperty (
FilterTagProperty(..), mkFilterTagProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FilterTagProper... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/s3outposts/gen/Stratosphere/S3Outposts/Bucket/FilterTagProperty.hs | haskell | module Stratosphere.S3Outposts.Bucket.FilterTagProperty (
FilterTagProperty(..), mkFilterTagProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data FilterTagProper... | |
870131eb61baeb10477181c6e033bd14fb89301fa4a22ab9db1510aef85089ec | coq/coq | tac2env.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/47b475839b8bd436ca1d9f5433ded94b7218f385/plugins/ltac2/tac2env.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
78211e6efa633230d4103815869f262d697d4dce9e332d51deef34f56c47a010 | ArulselvanMadhavan/haskell-first-principles | MaybeInstanceTests.hs | module MaybeInstanceTests where
import MaybeInstance
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
runTests :: IO ()
runTests = do
let trigger :: Optional (String, Int, [String])
trigger = undefined
trigger1 :: Option... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter21/test/MaybeInstanceTests.hs | haskell | module MaybeInstanceTests where
import MaybeInstance
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
runTests :: IO ()
runTests = do
let trigger :: Optional (String, Int, [String])
trigger = undefined
trigger1 :: Option... | |
beaa7607aac4a6ac30f642c8974acba22ac69d4be4825a6cfabc69425785278a | hraberg/deuce | casefiddle.clj | (ns deuce.emacs.casefiddle
(:use [deuce.emacs-lisp :only (defun defvar)])
(:require [clojure.core :as c]
[clojure.string :as s])
(:refer-clojure :exclude []))
(defun upcase-word (arg)
"Convert following word (or ARG words) to upper case, moving over.
With negative argument, convert previous words... | null | https://raw.githubusercontent.com/hraberg/deuce/9d507adb6c68c0f5c19ad79fa6ded9593c082575/src/deuce/emacs/casefiddle.clj | clojure | (ns deuce.emacs.casefiddle
(:use [deuce.emacs-lisp :only (defun defvar)])
(:require [clojure.core :as c]
[clojure.string :as s])
(:refer-clojure :exclude []))
(defun upcase-word (arg)
"Convert following word (or ARG words) to upper case, moving over.
With negative argument, convert previous words... | |
df0a812ef989675fa979590c4529154ddc3934d909e468390cf82d4aa5708617 | agocorona/TCache | indexQuery.hs | # LANGUAGE DeriveDataTypeable , FlexibleInstances , UndecidableInstances #
module Main where
import Data.TCache
import Data.TCache.IndexQuery
import Data.TCache.DefaultPersistence
import Data.ByteString.Lazy.Char8(pack,unpack)
import Data.Typeable
data Person= Person {pname :: String, age :: Int} deriving (Show, Read... | null | https://raw.githubusercontent.com/agocorona/TCache/72158de657f72c3b480cea1878b5cebfbfd65d13/demos/indexQuery.hs | haskell | # LANGUAGE DeriveDataTypeable , FlexibleInstances , UndecidableInstances #
module Main where
import Data.TCache
import Data.TCache.IndexQuery
import Data.TCache.DefaultPersistence
import Data.ByteString.Lazy.Char8(pack,unpack)
import Data.Typeable
data Person= Person {pname :: String, age :: Int} deriving (Show, Read... | |
948a39ffb7407cacc58ae7041405660dea1d56ee6dc467d386b40be9e4e140a3 | yogthos/migratus | edn.clj | (ns migratus.migration.edn
"Support for EDN migration files that specify clojure code migrations."
(:require
[clojure.edn :as edn]
[migratus.protocols :as proto]))
up - fn and down - fn here are actually vars ; invoking them as fns will deref
;; them and invoke the fn bound by the var.
(defrecord EdnMigr... | null | https://raw.githubusercontent.com/yogthos/migratus/1dff096ee877198d038e7c22241024dd41613f72/src/migratus/migration/edn.clj | clojure | invoking them as fns will deref
them and invoke the fn bound by the var.
validate on input to catch namespaced symbols/keywords, and on output
to catch strings that parse as a namespaced symbol e.g. "foo/bar" | (ns migratus.migration.edn
"Support for EDN migration files that specify clojure code migrations."
(:require
[clojure.edn :as edn]
[migratus.protocols :as proto]))
(defrecord EdnMigration [id name up-fn down-fn transaction? up-args down-args]
proto/Migration
(id [this] id)
(name [this] name)
(tx? [... |
3e5865cc23b2f35b3d9b2829a71156cb4d48a88abbf8ed6558f487c377471fbf | well-typed/large-records | R100.hs | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.Induction_Tree_Phantom.Sized.R100 where
import Data.Proxy
import Common.EmptyClass_Tree_P... | null | https://raw.githubusercontent.com/well-typed/large-records/c6c2b51af11e90f30822543d7ce4d1cb28cee294/large-records-benchmarks/bench/experiments/Experiment/Induction_Tree_Phantom/Sized/R100.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.Induction_Tree_Phantom.Sized.R100 where
import Data.Proxy
import Common.EmptyClass_Tree_Phantom
import Common.HListOfSize.HL100
requiresInstance :: ()
requiresInstance = requireEmptyClass (Proxy @ExampleFields)
|
b2a989ea75ca2fc8b986cca6acb6f834cc27ece1cbb0af42b0bf7f56b3ff0510 | reborg/clojure-essential-reference | 4.clj | (require '[clojure.string :refer [split lower-case]])
(defn freq-used-words [s]
< 1 >
< 2 >
(sort-by last >) ; <3>
< 4 >
(def war-and-peace "")
< 5 >
< 6 >
( [ " the " 34258 ] [ " and " 21396 ] [ " to " 16500 ] [ " of " 14904 ] [ " a " 10388 ] ) | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Collections/Generalpurpose/frequencies/4.clj | clojure | <3> | (require '[clojure.string :refer [split lower-case]])
(defn freq-used-words [s]
< 1 >
< 2 >
< 4 >
(def war-and-peace "")
< 5 >
< 6 >
( [ " the " 34258 ] [ " and " 21396 ] [ " to " 16500 ] [ " of " 14904 ] [ " a " 10388 ] ) |
21109268779441b197cb3a07eed319f639d1a91bb5aa40753e446016846e222a | funkywork/nightmare | interfaces.mli | MIT License
Copyright ( c ) 2023 funkywork
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... | null | https://raw.githubusercontent.com/funkywork/nightmare/d16b3cd3b6ce0a74056a89843528a55e39fc76b9/lib/js/interfaces.mli | ocaml | * Generalization of signatures in the manner of the method described in this
article: {{:-signatures} Generalised
signatures}.
* A Foldable Option describes how to build a complete interface for optional
values.
* the type held by the optional value
* [empty] is the empty case of the optional.
* [fill ... | MIT License
Copyright ( c ) 2023 funkywork
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... |
6ce81d63a6ac0b7b22738ab39a4ccbab6a2628d5fbc51525b62bfdbe47a2199c | haskellari/qc-instances | ByteString.hs | module Main where
import qualified Data.ByteString as BS
import System.IO (hPutStrLn, stderr)
import qualified Test.QuickCheck as QC
import Test.QuickCheck.Instances.ByteString ()
import qualified Test.QuickCheck.Monadic ... | null | https://raw.githubusercontent.com/haskellari/qc-instances/94ec49f96c9afd7d29880c22bedfbabe01ad30d5/bench/ByteString.hs | haskell | module Main where
import qualified Data.ByteString as BS
import System.IO (hPutStrLn, stderr)
import qualified Test.QuickCheck as QC
import Test.QuickCheck.Instances.ByteString ()
import qualified Test.QuickCheck.Monadic ... | |
7d8849499697d655aa77760f79d0a99f601ae2e10454ee9525c4fd60afdb1d1e | MinaProtocol/mina | vector.ml | open Core_kernel
module type Nat_intf = Nat.Intf
type z = Nat.z
type 'a s = 'a Nat.s
module T = struct
type ('a, _) t = [] : ('a, z) t | ( :: ) : 'a * ('a, 'n) t -> ('a, 'n s) t
end
include T
let unsingleton (type a) ([ x ] : (a, z s) t) : a = x
let rec iter : type a n. (a, n) t -> f:(a -> unit) -> unit =
fun... | null | https://raw.githubusercontent.com/MinaProtocol/mina/465aed0f9c71268e3ebd8428f07005d253a0bde1/src/lib/pickles_types/vector.ml | ocaml | TODO: Make more efficient | open Core_kernel
module type Nat_intf = Nat.Intf
type z = Nat.z
type 'a s = 'a Nat.s
module T = struct
type ('a, _) t = [] : ('a, z) t | ( :: ) : 'a * ('a, 'n) t -> ('a, 'n s) t
end
include T
let unsingleton (type a) ([ x ] : (a, z s) t) : a = x
let rec iter : type a n. (a, n) t -> f:(a -> unit) -> unit =
fun... |
5c3cf7ebb800289f8cee4936c00bcb655a9f5125adb597740ece82cf4414058a | charlieg/Sparser | vet-records.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1991 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
;;;
;;; File: "vet records"
Module : " interface;records : "
Version : June 1991
(in-package :sparser)
;;;--------------------------
... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/interface/records/vet-records.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "vet records"
--------------------------
globals between routines
--------------------------
-----------------------------------
globals use only within this file
-----------------------------------
-------------
entry point
-------------
... | copyright ( c ) 1991 Content Technologies Inc.
copyright ( c ) 1992 -- all rights reserved
Module : " interface;records : "
Version : June 1991
(in-package :sparser)
(defvar *vetted-records-in-article* nil
"initialized in Readout-pending-salient-objects and read by
After-analysis/article "... |
ab5df1a152d53a9c07750f7f8f5ca412e8b0eab8a2aacaa3fb0f42e7079691cf | michaxm/task-distribution | TaskDistribution.hs | |
Contains all node communication ( using ) . This includes distribution logic .
Contains all node communication (using Cloud Haskell). This includes distribution logic.
-}
module Control.Distributed.Task.Distribution.TaskDistribution (
startSlaveNode,
executeDistributed,
showSlaveNodes,
showSlaveNode... | null | https://raw.githubusercontent.com/michaxm/task-distribution/d0dee6a661390b7d1279389fa8c7b711309dab6a/src/Control/Distributed/Task/Distribution/TaskDistribution.hs | haskell | BEGIN bindings for node communication
This is the final building block of the slave task execution, calling TaskSpawning.processTasks.
TODO: have a node local config?
remotable ['slaveTask]
======>
not used for now, removed due to warnings as errors
slaveTask__tdict :: S.Static (PS.SerializableDict ())
slaveTas... | |
Contains all node communication ( using ) . This includes distribution logic .
Contains all node communication (using Cloud Haskell). This includes distribution logic.
-}
module Control.Distributed.Task.Distribution.TaskDistribution (
startSlaveNode,
executeDistributed,
showSlaveNodes,
showSlaveNode... |
879050a5ce1455f38266f7e8d85caaf258758309b0de0eec1681e1c13dfd4e31 | sbcl/sbcl | target-exception.lisp | ;;;; code for handling Win32 exceptions
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain a... | null | https://raw.githubusercontent.com/sbcl/sbcl/15870aab53d9440006d379a1b97b0f00b651f170/src/code/target-exception.lisp | lisp | code for handling Win32 exceptions
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
An awful lot of this stuff is stubbed out for now. We basically
only handle inbound exceptions (the local... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-WIN32")
signals ) , and we 're only picking off the sigsegv and sigfpe traps .
(defvar *exception-code... |
a3d397c0183ffd773871b4ce2749e45c07e3d51cfa95053316ac27bf84a80ea1 | typelead/eta | Expr.hs | module Eta.CodeGen.Expr where
import Eta.Core.CoreSyn
import Eta.Types.Type
import Eta.Types.TyCon
import Eta.BasicTypes.Id
import Eta.BasicTypes.VarEnv
import Eta.BasicTypes.SrcLoc
import Eta.Prelude.PrimOp
import Eta.StgSyn.StgSyn
import Eta.BasicTypes.DataCon
import Eta.Utils.Panic
import Eta.Utils.Util
import Eta.... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/compiler/Eta/CodeGen/Expr.hs | haskell | # SOURCE #
TODO: Optimize this to calculate the smallest type that can hold the target
TODO: Better type information for evaluate
TODO: Allow integer conversions?
TODO: Generate infinite loop here?
Take into account uses for unboxed tuples
Case-of-case expressions need special care
Since there can be multiple bi... | module Eta.CodeGen.Expr where
import Eta.Core.CoreSyn
import Eta.Types.Type
import Eta.Types.TyCon
import Eta.BasicTypes.Id
import Eta.BasicTypes.VarEnv
import Eta.BasicTypes.SrcLoc
import Eta.Prelude.PrimOp
import Eta.StgSyn.StgSyn
import Eta.BasicTypes.DataCon
import Eta.Utils.Panic
import Eta.Utils.Util
import Eta.... |
47a7df255b7509f8a9cf551689ceda97bdb86164eb6c77da34c3eb9d9a98837a | basho/riak_test | ts_simple_create_table_not_null_pk_fields.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 - 2016 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ts_simple_create_table_not_null_pk_fields.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 - 2016 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(ts_simple_create... |
87723af341b36ca24a0ab090f91016ac3e4648cb5172c5cb06f050d846dd7409 | dongcarl/guix | stb.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2018 < >
Copyright © 2020 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/packages/stb.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2018 < >
Copyright © 2020 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages stb)
#:use-module (guix packages)
#:use-module (guix ... |
2bd4841ae08814bdc29fcd6666cba6d4451efddd3196522140be840a2050f946 | den1k/vimsical | subgraph.cljc | (ns vimsical.frontend.util.subgraph
(:refer-clojure :exclude [remove])
(:require
[vimsical.subgraph :as sg]
[vimsical.subgraph.re-frame :as sg.re-frame]
[re-frame.core :as re-frame]
[re-frame.interop :as interop]))
;;
;; * Helpers
;;
(defn- entities? [db coll]
(boolean
(when (coll? coll)
(ev... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/util/subgraph.cljc | clojure |
* Helpers
* Add
* Remove
* Shorthand link syntax
* Re-frame x Mapgraph
| (ns vimsical.frontend.util.subgraph
(:refer-clojure :exclude [remove])
(:require
[vimsical.subgraph :as sg]
[vimsical.subgraph.re-frame :as sg.re-frame]
[re-frame.core :as re-frame]
[re-frame.interop :as interop]))
(defn- entities? [db coll]
(boolean
(when (coll? coll)
(every? (partial sg/en... |
9dd7417356dc2d9b2a11fe73e60da465dc9bbd9189252e8505ad6cccd883a627 | ghc/nofib | Main.hs | # LANGUAGE FlexibleContexts #
Inferred type for ' inner ' has a constraint ( MArray ( STUArray s ) Double m )
-- An alternative fix (better, but less faithful to backward perf comparison)
would be MonoLocalBinds
--
SG : I tried adding MonoLocalBinds here and it did n't change anything in
-- -ddump-simpl. `inner` ... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/imaginary/kahan/Main.hs | haskell | An alternative fix (better, but less faithful to backward perf comparison)
-ddump-simpl. `inner` is probably properly specialised now. I think this
comment can go?!
performance of tight loops involving unboxed arrays and floating
point arithmetic.
Floating point benchmarks have unstable output across platforms, ... | # LANGUAGE FlexibleContexts #
Inferred type for ' inner ' has a constraint ( MArray ( STUArray s ) Double m )
would be MonoLocalBinds
SG : I tried adding MonoLocalBinds here and it did n't change anything in
| Implementation of summation algorithm that tests
module Main (main) where
import Control.Monad.ST
i... |
318884df8947a0b10bd71f00d67dd82c7d61ac5cf9fc267672360c35bd5be94e | exoscale/clojure-kubernetes-client | authorization.clj | (ns clojure-kubernetes-client.api.authorization
(:require [clojure-kubernetes-client.core :refer [call-api check-required-params with-collection-format *api-context*]]
[clojure.spec.alpha :as s]
[spec-tools.core :as st]
[orchestra.core :refer [defn-spec]]
[clojure-kuber... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/api/authorization.clj | clojure | (ns clojure-kubernetes-client.api.authorization
(:require [clojure-kubernetes-client.core :refer [call-api check-required-params with-collection-format *api-context*]]
[clojure.spec.alpha :as s]
[spec-tools.core :as st]
[orchestra.core :refer [defn-spec]]
[clojure-kuber... | |
95c802a740512a3e96e924a2cd778f338a9938be2e1d35c64bb903c565b0312e | RefactoringTools/wrangler | refac_rename_function2.erl | %% @hidden
@private
-module(refac_rename_function2).
-behaviour(gen_refac_2).
-compile(export_all).
%% Include files
-include("wrangler.hrl").
%%%===================================================================
%% gen_refac callbacks
-export([input_par_prompts/0,select_focus/1,
check_pr... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/97e4bfd9ea9f7a9af38945a662ee1a3078e49af3/src/gen_refacs_2/refac_rename_function2.erl | erlang | @hidden
Include files
===================================================================
gen_refac callbacks
===================================================================
gen_refac callbacks
===================================================================
-------------------------------------------... | @private
-module(refac_rename_function2).
-behaviour(gen_refac_2).
-compile(export_all).
-include("wrangler.hrl").
-export([input_par_prompts/0,select_focus/1,
check_pre_cond/1, selective/0,
rule_def/1, rule_appl/1]).
@private
input_par_prompts ( ) - > [ string ( ) ]
in... |
22dfd51c9d5d3c71c408c48f4418a2b3432f5369c385e2dcb14c87c460b886d1 | byorgey/species | Rec.hs | # LANGUAGE DeriveDataTypeable
, CPP
, FlexibleInstances
, TypeFamilies
#
, CPP
, FlexibleInstances
, TypeFamilies
#-}
-- NOTE: this file is no longer part of the library; it's here only
-- for documentation/examples/hysterical raisins.
-- |... | null | https://raw.githubusercontent.com/byorgey/species/5f1d99095e41b860e2bfbc3ba034109a8101846f/Math/Combinatorics/Species/Rec.hs | haskell | NOTE: this file is no longer part of the library; it's here only
for documentation/examples/hysterical raisins.
| Some common recursively defined species.
Binary trees
| Code for binary trees with data at internal nodes.
| Type of binary trees with data at internal nodes.
| Type of partitions. | # LANGUAGE DeriveDataTypeable
, CPP
, FlexibleInstances
, TypeFamilies
#
, CPP
, FlexibleInstances
, TypeFamilies
#-}
module Math.Combinatorics.Species.TRec
(
BTreeC(..), BTree(..), bTree
) where
import NumericPrelu... |
448e76967338e5886941aa5c3a91b41bfdf55fb325274b9668b5f8cecacd33fd | ayazhafiz/plts | test.ml | open Talc
module TAL = OCamlTAL
module X86 = X86 (OCamlInt)
type testcase = {
name : string;
input : string;
output : string option;
pretty_f : string;
typecheck_f : string;
pretty_k : string;
pretty_c : string option;
pretty_h : string option;
pretty_a : string option;
pretty_tal : string option;
... | null | https://raw.githubusercontent.com/ayazhafiz/plts/725b7fd0d4bd65e15f12cc1fec80fa7402dec167/TAL/test.ml | ocaml | open Talc
module TAL = OCamlTAL
module X86 = X86 (OCamlInt)
type testcase = {
name : string;
input : string;
output : string option;
pretty_f : string;
typecheck_f : string;
pretty_k : string;
pretty_c : string option;
pretty_h : string option;
pretty_a : string option;
pretty_tal : string option;
... | |
58506b12e910384b9881dace49285a974a13400602592a80d4d0054fd760cb63 | fetburner/Coq2SML | configwin.ml | (*********************************************************************************)
Cameleon
(* *)
Copyright ( C ) 2005 Institut National de Recherche en Informatiqu... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/ide/utils/configwin.ml | ocaml | *******************************************************************************
en Automatique. All rights reserved.
... | Cameleon
Copyright ( C ) 2005 Institut National de Recherche en Informatique et
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation ; either version 2 of the ... |
b0426eb0847f9a268af5a33f8f12f2e2c052d819196b2819f9ef7be7d8fcc1c6 | jrm-code-project/LISP-Machine | qio.lisp | -*- Mode : LISP ; Package : SI ; Cold - load : T ; Base:8 ; Lowercase : T ; : ZL -*-
;;; LISP machine character level I/O stuff
* * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
; this file is rife with --- ... !!!
; character lossage
;(defconst stream-input-operations
' (: : listen :... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/io/qio.lisp | lisp | Package : SI ; Cold - load : T ; Base:8 ; Lowercase : T ; : ZL -*-
LISP machine character level I/O stuff
this file is rife with --- ... !!!
character lossage
(defconst stream-input-operations
(defconst stream-output-operations
Naming conventions:
Symbols whose names end in "-INPUT", "-OUTPUT", or "-IO" should... | * * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
' (: : listen : untyi : line - in : rubout - handler ) )
' (: tyo : force - output : finish : string - out : line - out : fresh - line : untyo - mark : ) )
to the binding of the symbol . After ( SETQ BAR ( MAKE - SYNO... |
91eaa14c6fbf133e2e50dbe1a43903e5b9e64df602baaccef079db0b0a297d77 | slyrus/cl-bio | rucksack.lisp | ;;; Rucksack
;;; Persistent storage for biological objects
;;;
Copyright ( c ) 2007 ( )
;;; 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 ... | null | https://raw.githubusercontent.com/slyrus/cl-bio/e6de2bc7f4accaa11466902407e43fae3184973f/rucksack/rucksack.lisp | lisp | Rucksack
Persistent storage for biological objects
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 list of co... | Copyright ( c ) 2007 ( )
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :bio-rucksack)
(defparameter *bio-rucksack*
(asdf:component-pathname
(reduce #'asdf:find-component
(list nil "cl-bio-ruc... |
0317dd429f9bae8a13a5df7222fddd6d9e71e73edf5ed6fa369a49c15128dbbb | sinistersnare/aams | term-compiler.rkt | #lang racket
;; This code compiles a simple language supporting delimited continuation
( via Dybvig et al 07 ) to a flat database of facts for ingestion into
;; a system like Datalog.
It also compiles effect handlers into DCs first , then compiles that .
;; e ::= ae | (newPrompt) | (pushPrompt e e)
| (... | null | https://raw.githubusercontent.com/sinistersnare/aams/b46ed88263e6976fd87bd50e0673eec833ec720f/src/racket/dybvig07/term-compiler.rkt | racket | This code compiles a simple language supporting delimited continuation
a system like Datalog.
e ::= ae | (newPrompt) | (pushPrompt e e)
| (call/handler ([x e] ...) e) | (perform e e e)
| (if e e e) | (e e ...)
ae ::= (λ (x ...) e) | #t | #f | num | x
num = the set of numbers.
x = the set of i... | #lang racket
( via Dybvig et al 07 ) to a flat database of facts for ingestion into
It also compiles effect handlers into DCs first , then compiles that .
| ( withSubCont e e ) | ( pushSubCont e e )
hacky but other option is .
(define cnt 0)
(define (++!)
(define old cnt)
(set! cnt (add1 cnt))... |
a056b5f4606cd2113bad89ef8d92fa65eea433487d121e4b7a43c0e21f5e1de1 | nikomatsakis/a-mir-formality | decl-to-clause.rkt | #lang racket
(require redex/reduction-semantics
"grammar.rkt"
"../logic/env.rkt"
"decl-to-clause/crate-decl.rkt"
"decl-to-clause/default-rules.rkt")
(provide decl-invariants
decl-clauses-for-predicate
)
(define-metafunction formality-decl
;; Part of the "hook" fo... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/decl/decl-to-clause.rkt | racket | Part of the "hook" for a formality-decl program:
Create the clauses for solving a given predicate
(right now the predicate is not used).
Part of the "hook" for a formality-decl program:
Create the invariants from a given program.
Return the clauses/hypothesis from multiple crates
clauses. This will eventually... | #lang racket
(require redex/reduction-semantics
"grammar.rkt"
"../logic/env.rkt"
"decl-to-clause/crate-decl.rkt"
"decl-to-clause/default-rules.rkt")
(provide decl-invariants
decl-clauses-for-predicate
)
(define-metafunction formality-decl
decl-clauses-for-predica... |
454df81063aee2f752716b86385fff3fccbe644e2eeede47a378c2ae9656e659 | aprell/miniml | expect.ml | open Miniml.Ast
open Miniml.Core
open Miniml.Optim
open Miniml.Typecheck
open Miniml.Utils
let print ast =
let _ = typecheck ast in
pprint_prog (optimize ast)
let () =
read_file (
match Sys.argv with
| [| _; filename |] -> filename
| _ -> failwith "Input file required"
)
|> parse
|> print
| null | https://raw.githubusercontent.com/aprell/miniml/0ed013541dadfcd041b84ff3007c994140f70e53/test/expect.ml | ocaml | open Miniml.Ast
open Miniml.Core
open Miniml.Optim
open Miniml.Typecheck
open Miniml.Utils
let print ast =
let _ = typecheck ast in
pprint_prog (optimize ast)
let () =
read_file (
match Sys.argv with
| [| _; filename |] -> filename
| _ -> failwith "Input file required"
)
|> parse
|> print
| |
b1bc83d7d4145655cf800327b0f87b947b0b27b2e5bd6bf6ef455e452eef53af | bollu/coremlir | repeated-incr-maybe.hs | | Check if GHC can worker / wrapper repeated case analysis .
-- ANSWER: Yes!
{-# LANGUAGE BangPatterns #-}
module RepeatedIncrMaybe(incrm3) where
incrm1 :: Maybe Int -> Maybe Int
incrm1 mx = case mx of Nothing -> Nothing; Just x -> Just (x+1)
incrm3 :: Maybe Int -> Maybe Int
incrm3 mx = incrm1 (incrm1(incrm1(mx)))
... | null | https://raw.githubusercontent.com/bollu/coremlir/7ab044051e62c54e8d3f94a38e3d1ecbf49fb2b0/ghc-benchmarks/repeated-incr-maybe.hs | haskell | ANSWER: Yes!
# LANGUAGE BangPatterns #
RHS size : { terms : 1 , types : 0 , coercions : 0 , joins : 0/0 }
Caf=NoCafRefs,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
RepeatedIncrMaybe.$trModule4 = "main"#
RHS size : { terms : 2 , types : 0 , coercions : 0 , joins : 0/0 }
Caf=NoCafRefs,
... | | Check if GHC can worker / wrapper repeated case analysis .
module RepeatedIncrMaybe(incrm3) where
incrm1 :: Maybe Int -> Maybe Int
incrm1 mx = case mx of Nothing -> Nothing; Just x -> Just (x+1)
incrm3 :: Maybe Int -> Maybe Int
incrm3 mx = incrm1 (incrm1(incrm1(mx)))
= = = = = = = = = = = = = = = = = = = = =... |
e9852e7dca5a24aeb50ce751cd4127d9a03eec17a82246137014fa46bdaeb562 | quchen/generative-art | Main.hs | module Main (main) where
import Control.Monad
import Graphics.Rendering.Cairo as C hiding (x, y)
import System.Random.MWC
import System.Random.MWC.Distributions
import Draw
import Geometry as G
import Geometry.Algorithms.PerlinNoise
import qualified Geomet... | null | https://raw.githubusercontent.com/quchen/generative-art/245bb2948642d5d7fdd538b5095c00ba3a9cbaa2/showcases/vector_fields/Main.hs | haskell | Higher values yield lower-frequency noise
2D vector potential, which in 2D is umm well a scalar potential.
Decrease exponent for more accurate results | module Main (main) where
import Control.Monad
import Graphics.Rendering.Cairo as C hiding (x, y)
import System.Random.MWC
import System.Random.MWC.Distributions
import Draw
import Geometry as G
import Geometry.Algorithms.PerlinNoise
import qualified Geomet... |
dcaa8f8a54f50a8eff845a17acccf0165d820ec7554268f5cd29bb9901b96cf8 | MaartenFaddegon/Hoed | Rot13.hs | A defective ROT13 implemenation .
import Data.Maybe
import Data.Char
import Debug.Hoed.Pure
main = printO (prop_rot13length "Abc")
-----------------------------------------------------------------------------
rot13 = observe "rot13" rot13'
normalize = observe "normalize" normalize'
rot13char = observe "rot13ch... | null | https://raw.githubusercontent.com/MaartenFaddegon/Hoed/8769d69e309928aab439b22bc3f3dbf5452acc77/examples/Rot13.hs | haskell | --------------------------------------------------------------------------- | A defective ROT13 implemenation .
import Data.Maybe
import Data.Char
import Debug.Hoed.Pure
main = printO (prop_rot13length "Abc")
rot13 = observe "rot13" rot13'
normalize = observe "normalize" normalize'
rot13char = observe "rot13char" rot13char'
rot13' = mapMaybe (\c -> rot13char (normalize c))
normalize' c... |
c2140c5025666751d8edbdfdecd35789a8bfa3dba3f30e69acc5fbdd92cf01c2 | pveber/biotk | ncbi_genome.ml | open Base
module Assembly_summary = struct
type t = {
assembly_accession : string ;
bioproject : string ;
biosample : string ;
wgs_master : string ;
refseq_category : string ;
taxid : string ;
species_taxid : string ;
organism_name : string ;
infraspecific_name : string ;
isol... | null | https://raw.githubusercontent.com/pveber/biotk/9e6fe7fc6fcda7fd91d4d637b66db5961a4a247e/lib/ncbi_genome.ml | ocaml | open Base
module Assembly_summary = struct
type t = {
assembly_accession : string ;
bioproject : string ;
biosample : string ;
wgs_master : string ;
refseq_category : string ;
taxid : string ;
species_taxid : string ;
organism_name : string ;
infraspecific_name : string ;
isol... | |
896c6d2bb274ca3c85383a57ecee16592c5b02d47f600ea94522242fc4f1c6ec | ocaml-sf/learn-ocaml-corpus | varset_empty.ml | (* ------------------------------------------------------------------------------ *)
(* Building formulae. *)
let var x =
FVar x
let falsity =
FConst false
let truth =
FConst true
let const sense =
if sense then truth else falsity
(* [FConst sense] would work too, but would allocate memory *)
let neg ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/sat/wrong/varset_empty.ml | ocaml | ------------------------------------------------------------------------------
Building formulae.
[FConst sense] would work too, but would allocate memory
------------------------------------------------------------------------------
Evaluating formulae.
We assume [n < Sys.word_size - 1].
-----------------... |
let var x =
FVar x
let falsity =
FConst false
let truth =
FConst true
let const sense =
if sense then truth else falsity
let neg f =
match f with
| FConst sense ->
const (not sense)
| FNeg f ->
f
| _ ->
FNeg f
let conn sense f1 f2 =
match f1, f2 with
| FConst sense', f
| f... |
9ba97de0e7f806df7ebac4f8a85acd70cfb1f56d3e87f02be7ceb26eac1342dc | m4b/rdr | X86Assembly.ml | type size = int
type operand =
int because index into registers 0 - 16
> = 0x8000000000000000 are negative
| Memory of int (* which register *)
| MemoryDisp of int * int64 (* which register and the displacement *)
SIB ? | MemorySib of int * int
type asm =
| Add of size * operand * operand
| null | https://raw.githubusercontent.com/m4b/rdr/2bf1f73fc317cd74f8c7cacd542889df729bd003/src/x86/X86Assembly.ml | ocaml | which register
which register and the displacement | type size = int
type operand =
int because index into registers 0 - 16
> = 0x8000000000000000 are negative
SIB ? | MemorySib of int * int
type asm =
| Add of size * operand * operand
|
e1a2392501e8e4726693651cc2f5bab3d969eb932eca96d52d05c95d31c64c2c | dradtke/Lisp-Text-Editor | impl-lispworks-condition-variables.lisp | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
Lispworks condition support is simulated , albeit via a lightweight wrapper over
;; its own polling-based wait primitive. Waiters register with the condition variable,
;; and use MP:process-wait which queries for permission to proceed at its o... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/bordeaux-threads-0.8.1/src/impl-lispworks-condition-variables.lisp | lisp | -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
its own polling-based wait primitive. Waiters register with the condition variable,
and use MP:process-wait which queries for permission to proceed at its own (usspecified) interval.
-445.htm
A wakeup callback (on notify) is provided to lighten t... |
Lispworks condition support is simulated , albeit via a lightweight wrapper over
Single - notification follows a first - in first - out ordering
Performance : With 1000 threads waiting on one condition - variable , the steady - state hit ( at least
as tested on a 3GHz Win32 box ) is noise - hovering at 0 % o... |
218493a8b2e9c881976916c182f503976c461f4be883c69c6f17f2f359769940 | jesperes/aoc_erlang | aoc2019_day12.erl | Advent of Code solution for 2019 day 12 .
Created : 2019 - 12 - 12T05:22:58 + 00:00
-module(aoc2019_day12).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2019/aoc2019_day12.erl | erlang | does not take into account the enormous amount of memory needed
to store all the states.
Key observation: since the coordinates are independent, we can detect
period of the entire system. | Advent of Code solution for 2019 day 12 .
Created : 2019 - 12 - 12T05:22:58 + 00:00
-module(aoc2019_day12).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
... |
a7f4ecd6de1e588473211913c78238becf6202867e59cf75663c43e9c7d7a15c | Frechmatz/cl-synthesizer | example-3.lisp | (defpackage :cl-synthesizer-modules-adsr-example-3
(:use :cl))
(in-package :cl-synthesizer-modules-adsr-example-3)
(defun example ()
"ADSR case study. Abort attack and then retrigger during release phase."
(let ((rack (cl-synthesizer:make-rack
:environment (cl-synthesizer:make-environment))))
(... | null | https://raw.githubusercontent.com/Frechmatz/cl-synthesizer/ba2e4003448829078187013f6723eb5c8ce8adbc/src/modules/adsr/example-3.lisp | lisp | (run-example) | (defpackage :cl-synthesizer-modules-adsr-example-3
(:use :cl))
(in-package :cl-synthesizer-modules-adsr-example-3)
(defun example ()
"ADSR case study. Abort attack and then retrigger during release phase."
(let ((rack (cl-synthesizer:make-rack
:environment (cl-synthesizer:make-environment))))
(... |
642293ce8f9de45d48deb52c63470eca16ec210ea08a4e4caf748274574999dc | brendanzab/language-garden | Main.ml | (** {0 Compiler CLI} *)
module TreeLang = Arith.TreeLang
module StackLang = Arith.StackLang
module AnfLang = Arith.AnfLang
module TreeToStack = Arith.TreeToStack
module TreeToAnf = Arith.TreeToAnf
(** {1 Helper functions} *)
let print_error (pos : Lexing.position) message =
Printf.eprintf "%s:%d:%d: %s\n"
p... | null | https://raw.githubusercontent.com/brendanzab/language-garden/1f7eb7afab6c1af2dd21515c80d22bd36a02119d/compile-arith/bin/Main.ml | ocaml | * {0 Compiler CLI}
* {1 Helper functions}
* {1 Main entrypoint} |
module TreeLang = Arith.TreeLang
module StackLang = Arith.StackLang
module AnfLang = Arith.AnfLang
module TreeToStack = Arith.TreeToStack
module TreeToAnf = Arith.TreeToAnf
let print_error (pos : Lexing.position) message =
Printf.eprintf "%s:%d:%d: %s\n"
pos.pos_fname
pos.pos_lnum
(pos.pos_cnum ... |
5bd10733576cca98cd7f2af58245d139e27e69c98bb7d33cbc6f62515f719cbb | lamdu/lamdu | Props.hs | # LANGUAGE FlexibleInstances , DefaultSignatures #
module Lamdu.Sugar.Props
( SugarExpr(..)
, varRefUnfinished
) where
import qualified Control.Lens as Lens
import Hyper
import Hyper.Recurse
import Lamdu.Sugar.Types
import Lamdu.Prelude
class HTraversable t => Sug... | null | https://raw.githubusercontent.com/lamdu/lamdu/acfdc94d989f7a0443ec0009ec8e06565ff7f96a/src/Lamdu/Sugar/Props.hs | haskell | Let expressions not allowed in light lambdas (would be anyOf if they were) | # LANGUAGE FlexibleInstances , DefaultSignatures #
module Lamdu.Sugar.Props
( SugarExpr(..)
, varRefUnfinished
) where
import qualified Control.Lens as Lens
import Hyper
import Hyper.Recurse
import Lamdu.Sugar.Types
import Lamdu.Prelude
class HTraversable t => Sug... |
b1329049c347a941d9eda2a4b32eb535b3c1fe34f985dd9bdafa1052291aaffb | ijvcms/chuanqi_dev | back_lib.erl | %%%-------------------------------------------------------------------
@author yubing
( C ) 2015 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 16 . 十二月 2015 11:46
%%%-------------------------------------------------------------------
-module(back_lib).
-include("cache.hrl").
-include("record.hrl").
-include("co... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/back/back_lib.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
根据玩家名字发送邮件
根据玩家id发送邮件
发送全副邮件 | @author yubing
( C ) 2015 , < COMPANY >
Created : 16 . 十二月 2015 11:46
-module(back_lib).
-include("cache.hrl").
-include("record.hrl").
-include("common.hrl").
-include("config.hrl").
-include("proto.hrl").
-include("language_config.hrl").
-export([send_mail_player_name/4,send_mail_player_id/4]).
send_mail_p... |
42686b9c1f177f420451669a8c1b5ab490204c3c95a28f0f187806cf8c9291fa | larcenists/larceny | kernel0.body.scm | Copyright ( C ) ( 2016 ) .
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;; restriction, including without limitation the rights to use,
;;; copy, modify, merge,... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/lib/SRFI/srfi/135/kernel0.body.scm | scheme |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
Software is furnished to do so, subject to the following
conditions... | Copyright ( C ) ( 2016 ) .
files ( the " Software " ) , to deal in the Software without
sell copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(define (complain na... |
da0bb18c455ed5b056ed912a885a9a88352edf56f0c818f1e4d636c0d942747f | vaclavsvejcar/headroom | Main.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
-- |
-- Module : Main
-- Description : Main application launcher
Copyright : ( c ) 2019 - 2022
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
-- Portability ... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/app/Main.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : Main
Description : Main application launcher
License : BSD-3-Clause
Maintainer :
Stability : experimental
Portability : POSIX
Code responsible for booting up the application and parsing command line
arguments. | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
Copyright : ( c ) 2019 - 2022
module Main where
import Headroom.Command (commandParser)
import Headroom.Command.Gen
( commandGen
, parseGenMode
)
import Headroom.Command.Init (commandInit)
import Headroom.Command.Ru... |
18191e708e650a9096ef20336a58d369c00d39b675140ca1c25c368dfd96a492 | yetanalytics/re-oidc | re_oidc.cljs | (ns com.yetanalytics.re-oidc
(:require [cljsjs.oidc-client :refer [UserManager Log WebStorageStateStore]]
[re-frame.core :as re-frame]
[clojure.spec.alpha :as s :include-macros true]
[com.yetanalytics.re-oidc.user :as user]
[com.yetanalytics.re-oidc.util :as u]))
;; OI... | null | https://raw.githubusercontent.com/yetanalytics/re-oidc/25087fdec7fe8f75f31a725023a6c77d270fc50b/src/lib/com/yetanalytics/re_oidc.cljs | clojure | OIDC lib logging can be enabled:
A (partial) spec for what re-oidc puts in the re-frame db
We set automaticSilentRenew to true and these are done for us
session monitoring requires an iframe
custom
custom
ensure any custom loaded callback is fired
TODO: Possibly more behavior on errors
"Public" API ;;;;;;;;;;... | (ns com.yetanalytics.re-oidc
(:require [cljsjs.oidc-client :refer [UserManager Log WebStorageStateStore]]
[re-frame.core :as re-frame]
[clojure.spec.alpha :as s :include-macros true]
[com.yetanalytics.re-oidc.user :as user]
[com.yetanalytics.re-oidc.util :as u]))
#_(s... |
e794682baad5e503b6b348c37e8acc99935289020e421d13ff193a38b6547611 | mejgun/haskell-tdlib | SetDatabaseEncryptionKey.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.SetDatabaseEncryptionKey where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain @new_en... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/SetDatabaseEncryptionKey.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain @new_encryption_key New encryption key
| |
module TD.Query.SetDatabaseEncryptionKey where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data SetDatabaseEncryptionKey = SetDatabaseEncryptionKey
new_encryption_key :: Maybe String
}
deriving (Eq)
instance Show SetDatabaseEncryptionKey where
show
... |
4a9ad2026fba2a7c076574f310c1e90054347590071c885501d898596c41ebb4 | marcoheisig/adventofcode | day-14.lisp | (defpackage :adventofcode-2020-day-14
(:use :cl))
(in-package :adventofcode-2020-day-14)
| null | https://raw.githubusercontent.com/marcoheisig/adventofcode/e96a0da17cd79f424af984ed2648b49ffdacb893/2020/day-14/day-14.lisp | lisp | (defpackage :adventofcode-2020-day-14
(:use :cl))
(in-package :adventofcode-2020-day-14)
| |
f5dc7711d6d6205a50d5bee2808eb1a07146edc99a6afe1430b44a9e0d82119e | exercism/racket | raindrops.rkt | #lang racket
(provide convert)
(define (convert number)
(error "Not implemented yet"))
| null | https://raw.githubusercontent.com/exercism/racket/ce7b72cfde0695588771031d6b69d8d1cb199038/exercises/practice/raindrops/raindrops.rkt | racket | #lang racket
(provide convert)
(define (convert number)
(error "Not implemented yet"))
| |
66854d94d5d3d1d9572a039481a479f369cdd4ac3465f0c8b73047e10003bf6f | lilactown/punk | frisk.cljs | (ns punk.ui.views.frisk
(:require [hx-frisk.view :as frisk]
[hx.react :as hx :refer [defnc]]
[hx.hooks :refer [<-state]]
[punk.ui.core :as punk-ui]))
(defnc View [{:keys [data on-next]}]
(let [state (<-state {:data-frisk nil})]
[:div {:style {:overflow "auto"}}
[frisk/R... | null | https://raw.githubusercontent.com/lilactown/punk/0c6e529429837c00958d41e09fd672f49778dedf/ui/src/punk/ui/views/frisk.cljs | clojure | (ns punk.ui.views.frisk
(:require [hx-frisk.view :as frisk]
[hx.react :as hx :refer [defnc]]
[hx.hooks :refer [<-state]]
[punk.ui.core :as punk-ui]))
(defnc View [{:keys [data on-next]}]
(let [state (<-state {:data-frisk nil})]
[:div {:style {:overflow "auto"}}
[frisk/R... | |
4dec4b9841a9c995c5c4c71598f661dbdbe654c972599f9bfd6cfc05d4d7d318 | ghollisjr/cl-ana | combinatorics.lisp | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
;;;;
This file is part of cl - ana .
;;;;
;;;; cl-ana is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the Li... | null | https://raw.githubusercontent.com/ghollisjr/cl-ana/42682dc8214e76b75aa07e3d807a321323b82839/math-functions/combinatorics.lisp | lisp |
cl-ana is free software: you can redistribute it and/or modify it
(at your option) any later version.
cl-ana is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License... | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
This file is part of cl - ana .
under the terms of the GNU 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 General Public License
... |
34b96cf7c2c6256c9cafa03298ee9d378a84494765f3a1cc68e5a150376fca7a | input-output-hk/cardano-wallet | Wallets.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.Integratio... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/7b0192110fe226f992bca6198b8ee83fa4a37f46/lib/wallet/integration/src/Test/Integration/Scenario/API/Byron/Wallets.hs | haskell | create
get
list
❌
✔️
✔️
✔️
✔️
✔️
❌
✔️
✔️
✔️
✔️
✔️
❌
✔️
✔️
✔️
✔️
✔️
❌
✔️
✔️
✔️
✔️
✔️
verify you can update name | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.Integratio... |
d4313f3aead893096be269530c5333e81ef44ca4844d7ecf602a451e25c1d40c | prl-julia/juliette-wa | wa-tests.rkt | #lang racket
(require redex)
(require "../core/wa-surface.rkt") ; import surface language
(require "../core/wa-full.rkt") ; import language semantics
(require "../wa-examples.rkt") ; import examples
(provide (all-defined-out)) ; export all definitions
(module+ test
(displayln "********** TESTS BEGIN")... | null | https://raw.githubusercontent.com/prl-julia/juliette-wa/1d1a2154e7b4e232ea2166fba485a3bf574ebd88/src/redex/tests/wa-tests.rkt | racket | import surface language
import language semantics
import examples
export all definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Surface Language Tests
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
==================================================
Types
=======================================... | #lang racket
(require redex)
(module+ test
(displayln "********** TESTS BEGIN")
(test-equal (term (get-supertype ,tInt)) tNum)
(test-equal (term (get-supertype ,tNum)) tTop)
(test-equal (term (get-supertype ,tBot)) tTop)
(test-equal (term (get-supertype ,tBool)) tTop)
(test-equal (judgment-h... |
f5cfe3add3feecf5e6401615776ab5720478dd299eacbe797913edfcbc469fcc | csabahruska/jhc-components | String.hs | -- module for things dealing with string constants needed by the compiler internally
# LANGUAGE NoImplicitPrelude , MagicHash #
# OPTIONS_JHC -fffi -funboxed - values #
module Jhc.String(
eqString,
eqUnpackedString,
unpackStringFoldr,
unpackString
)where
import Jhc.Type.Basic
import Jhc.Prim.Prim
... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/lib/jhc/Jhc/String.hs | haskell | module for things dealing with string constants needed by the compiler internally
# NOINLINE eqUnpacked # | # LANGUAGE NoImplicitPrelude , MagicHash #
# OPTIONS_JHC -fffi -funboxed - values #
module Jhc.String(
eqString,
eqUnpackedString,
unpackStringFoldr,
unpackString
)where
import Jhc.Type.Basic
import Jhc.Prim.Prim
# VCONSTRUCTOR unpackString #
# NOINLINE unpackString #
unpackString :: Addr__ -> [Ch... |
b8ad8d1d3550a721aab5931a26322f8237864bb806bcaf900d4f19e00ab25d39 | ocaml-multicore/parafuzz | lazy4.ml | (* TEST
ocamlopt_flags += " -O3 "
*)
let r = ref None
let f () =
match !r with
| Some l -> Lazy.force l
| None -> ()
let l = Lazy.from_fun f
let _ = r := Some l
let _ =
try Lazy.force l
with Lazy.Undefined -> print_endline "Undefined"
| null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/lazy/lazy4.ml | ocaml | TEST
ocamlopt_flags += " -O3 "
| let r = ref None
let f () =
match !r with
| Some l -> Lazy.force l
| None -> ()
let l = Lazy.from_fun f
let _ = r := Some l
let _ =
try Lazy.force l
with Lazy.Undefined -> print_endline "Undefined"
|
cf3a2a55e801977320b54b5568da57dad91c09a9aed34f3ee08d0ed6db399567 | thephoeron/quipper-language | Main.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE ... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Programs/QCLParser/Main.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# LANGUAGE TypeSynonymInstances #
----------------------------------------------------------------------
it into a Quipper circuit.
-... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
| This program reads an execution trace produced by QCL , and turns
module Programs.QCLParser.Main where
import Quipper hiding (cnot, Fo... |
3f4156c1697e26b9189fa299524879d66d12f56a7940a92d163eb92212d3ffff | ermine-language/ermine | Filesystem.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
--------------------------------------------------------------------
-- |
Copyright : ( c ) McGraw Hill Financial 2014
License : BSD2
Maintainer : <... | null | https://raw.githubusercontent.com/ermine-language/ermine/bd58949ab56311be9e0d2506a900f3d77652566b/src/Ermine/Loader/Filesystem.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE DeriveDataTypeable #
------------------------------------------------------------------
|
Stability : experimental
Portability: non-portable
------------------------------------------------------------------
| A 'Loader' that searches an area of the filesystem for modules... | # LANGUAGE DeriveGeneric #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleContexts #
Copyright : ( c ) McGraw Hill Financial 2014
License : BSD2
Maintainer : < >
module Ermine.Loader.Filesystem
( filesystemLoader
, LoadRefusal(..)
, explainLoadRefusal
, Freshness()
) where
import Control.Ap... |
5b47b8fc2f113a16f8ebd5ca6ec7acbe9579d536918ca82375fd19eaa37666d5 | xapix-io/axel-f | excel.cljc | (ns axel-f.excel
(:refer-clojure :exclude [compile])
(:require [axel-f.excel.base64 :as base64]
[axel-f.excel.hash :as hash]
[axel-f.excel.json :as json]
[axel-f.excel.search :as search]
[axel-f.excel.date :as date]
[axel-f.excel.jws :as jws]
[... | null | https://raw.githubusercontent.com/xapix-io/axel-f/ec8fca880033e0ae78a8d9f42538d4a71fba29bd/src/axel_f/excel.cljc | clojure | (ns axel-f.excel
(:refer-clojure :exclude [compile])
(:require [axel-f.excel.base64 :as base64]
[axel-f.excel.hash :as hash]
[axel-f.excel.json :as json]
[axel-f.excel.search :as search]
[axel-f.excel.date :as date]
[axel-f.excel.jws :as jws]
[... | |
7ca0ac920ca88527be2ae3241289745c0253566001c9b6531e538ff95ff123d1 | yallop/fomega | core.mli | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val eval : context -> term -> term
val typeof : context -> term -> ty
val kindof : context -> ty -> kind
val tyeqv : context -> ty -> ty -> bool
val simplifyty : context ->... | null | https://raw.githubusercontent.com/yallop/fomega/f0ba8efb4e40202203bc77652d2e768fdab9239c/src/core.mli | ocaml | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val eval : context -> term -> term
val typeof : context -> term -> ty
val kindof : context -> ty -> kind
val tyeqv : context -> ty -> ty -> bool
val simplifyty : context ->... | |
0876bed1016af4da48e5fbc18a7d9db60441aee38663cf0bf1ae8105b95bbafe | egraphdb/egraphdb | egraph_index_model.erl | %%%-------------------------------------------------------------------
@author neerajsharma
( C ) 2018 ,
%%% @doc
%%%
%%% @end
%%% %CopyrightBegin%
%%%
Copyright < > 2017 .
All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file excep... | null | https://raw.githubusercontent.com/egraphdb/egraphdb/41a0131be227f7f0a35ba0e2c1cb23d70cd86b03/models/egraph_index_model.erl | erlang | -------------------------------------------------------------------
@doc
@end
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIO... | @author neerajsharma
( C ) 2018 ,
Copyright < > 2017 .
All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(egraph_index_model).
validate/2, create/3, read/2, update/3, delete/2... |
d47a9c0a8cbdbabbeee1f974f94bd17096de6a5e03e6a6885d4c1bbe30beb9cb | uxbox/uxbox-backend | helpers.clj | (ns uxbox.tests.helpers
(:refer-clojure :exclude [await])
(:require [clj-http.client :as http]
[buddy.hashers :as hashers]
[buddy.core.codecs :as codecs]
[catacumba.serializers :as sz]
[mount.core :as mount]
[storages.core :as st]
[suricatta.co... | null | https://raw.githubusercontent.com/uxbox/uxbox-backend/036c42db8424be3ac34c38be80577ee279141681/test/uxbox/tests/helpers.clj | clojure | (ns uxbox.tests.helpers
(:refer-clojure :exclude [await])
(:require [clj-http.client :as http]
[buddy.hashers :as hashers]
[buddy.core.codecs :as codecs]
[catacumba.serializers :as sz]
[mount.core :as mount]
[storages.core :as st]
[suricatta.co... | |
8f431e86295ec5d05d4fcaea4708af9d875f7938bf8c2f71947578c8a77bed0d | trainline/optimus | kvstore_test.clj | Copyright ( c ) Trainline Limited , 2017 . All rights reserved .
See LICENSE.txt in the project root for license information
(ns optimus.service.backends.kvstore-test
(:require [midje.sweet :refer :all]
[optimus.service.test-util :refer [rand-str]]
[optimus.service.util :refer [deep-merge]... | null | https://raw.githubusercontent.com/trainline/optimus/caf4d065f40d5edef87eeb60d767b8379465501e/service/test/optimus/service/backends/kvstore_test.clj | clojure | Run the tests for InMemKV store | Copyright ( c ) Trainline Limited , 2017 . All rights reserved .
See LICENSE.txt in the project root for license information
(ns optimus.service.backends.kvstore-test
(:require [midje.sweet :refer :all]
[optimus.service.test-util :refer [rand-str]]
[optimus.service.util :refer [deep-merge]... |
cde10725e27167206338b4cdf66e62ea08cb15e4badb2e9342a2b6bfd04d8ea7 | mightybyte/hstyle | Tests.hs | {-# LANGUAGE OverloadedStrings #-}
module HStyle.Block.Tests
( tests
) where
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (Assertion, (@?=))
import qualified Data.Text as T
import HStyle.Block
tests :: Test
tests = testGroup "HStyle.Block.Tests"
... | null | https://raw.githubusercontent.com/mightybyte/hstyle/78e321ce9eac68f154f4d65288845a58d0d18857/tests/HStyle/Block/Tests.hs | haskell | # LANGUAGE OverloadedStrings # | module HStyle.Block.Tests
( tests
) where
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (Assertion, (@?=))
import qualified Data.Text as T
import HStyle.Block
tests :: Test
tests = testGroup "HStyle.Block.Tests"
[ testCase "subBlock_01" s... |
e9bfbf804205756dfc01ba396eb5d6e02bc1ff27a89ffd21a5a59c16ebe1ede2 | ekmett/coda | NFA.hs | # language GADTs #
# language OverloadedLists #
# language ViewPatterns #
module Automata.NFA
( NFA(..)
, reverse, reversed
, complement, complemented
, union
, intersection
, concat
, star
, shrink
, size
-- derivative parsing
, prefix, prefixes
, suffix, suffixes
, check
) where
import Co... | null | https://raw.githubusercontent.com/ekmett/coda/bca7e36ab00036f92d94eb86298712ab1dbf9b8d/src/automata/Automata/NFA.hs | haskell | derivative parsing
kleene star
reduce the number of states using knowledge about all possible eventual inputs
TODO: filter d w/ as to avoid bogus states?
------------------------------------------------------------------------------
derivative parsing
---------------------------------------------------------------... | # language GADTs #
# language OverloadedLists #
# language ViewPatterns #
module Automata.NFA
( NFA(..)
, reverse, reversed
, complement, complemented
, union
, intersection
, concat
, star
, shrink
, size
, prefix, prefixes
, suffix, suffixes
, check
) where
import Control.Lens hiding (rever... |
3bc5ddcca955dab2df9ff80ed6d195f1c822c24663dcb700aac55a1799840e4e | ocaml/ood | opam_user.ml |
type t =
{ name : string
; email : string option
; github_username : string
; avatar : string
}
let all =
[
{ name = {js|Xavier Leroy|js}
; email = None
; github_username = {js|xavierleroy|js}
; avatar = {js||js}
};
{ name = {js|Damien Doligez|js}
; email = None
; github_username = {js|... | null | https://raw.githubusercontent.com/ocaml/ood/1db6cce7578eb2f358ead43ff398ed91cfdc0dbc/src/ood/opam_user.ml | ocaml |
type t =
{ name : string
; email : string option
; github_username : string
; avatar : string
}
let all =
[
{ name = {js|Xavier Leroy|js}
; email = None
; github_username = {js|xavierleroy|js}
; avatar = {js||js}
};
{ name = {js|Damien Doligez|js}
; email = None
; github_username = {js|... | |
153d3bdf7d8296391a8c99423ecaab7c501aba05a65a984636b9c91240a97087 | justinmeiners/lisp-interpreter | vectors.scm | (define v #(1 2 3))
(vector-swap! v 0 2)
(assert (= 3 (vector-ref v 0)))
(assert (= 1 (vector-ref v 2)))
(define (vec-sorted? v op)
" if x and y are any two adjacent elements in the result ,
; where x precedes y, it is the case that (procedure y x) ==> #f"
; -7.4/doc-html/scheme_8.html#SEC72
(or (< (vector-leng... | null | https://raw.githubusercontent.com/justinmeiners/lisp-interpreter/b278e90258bdaba9fe68b87fd7ca8558277afcff/tests/code/vectors.scm | scheme | where x precedes y, it is the case that (procedure y x) ==> #f"
-7.4/doc-html/scheme_8.html#SEC72
Now test the sort function
Try other data types
Converting between lists and vectors
-scheme/documentation/stable/mit-scheme-ref/Construction-of-Vectors.html
Binary search
Issues parsing large vector | (define v #(1 2 3))
(vector-swap! v 0 2)
(assert (= 3 (vector-ref v 0)))
(assert (= 1 (vector-ref v 2)))
(define (vec-sorted? v op)
" if x and y are any two adjacent elements in the result ,
(or (< (vector-length v) 2)
(and (not (op (vector-ref v 1) (vector-ref v 0)))
(vec-sorted? (vector-tail v 1) op))))
... |
e132a169842c658499a15be9142656bb1ae652af4a3a36a9bd5ffb4389bb5e57 | bmeurer/ocamljit2 | envaux.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cr... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/debugger/envaux.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Objective Caml port by and
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 .
... |
3ff2a77e3cb20ef65a357c7b268b150c55e54b6d4e13e702b0afe664b6ff4db4 | emqx/ecql | ecql_sock.erl | %%%-----------------------------------------------------------------------------
Copyright ( c ) 2015 - 2016 < > . 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 So... | null | https://raw.githubusercontent.com/emqx/ecql/f29d05fb8bdf1167877ec07ef7f0950f6feeab95/src/ecql_sock.erl | erlang | -----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnishe... | Copyright ( c ) 2015 - 2016 < > . All Rights Reserved .
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY... |
abbc309fcd7a36a5c4fffe19fc2a90e44758a14017810b1dc5bee94a0e593741 | abcdw/rde | messaging.scm | ;;; rde --- Reproducible development environment.
;;;
Copyright © 2022 , 2023 < >
;;;
;;; This file is part of rde.
;;;
;;; rde is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the Lic... | null | https://raw.githubusercontent.com/abcdw/rde/5834beeb71dd5ee4d0170fb6b4139b78a513c986/src/rde/packages/messaging.scm | scheme | rde --- Reproducible development environment.
This file is part of rde.
rde is free software; you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
rde is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the im... | Copyright © 2022 , 2023 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(define-module (rde packages messaging)
#:use-module (gnu packages)
#:use-module (gnu packages messaging)
#:use-module (gnu packages compression... |
c4b1c33acb8718e9b4f4d405e62f33446e098891b9f1b73cf29ba8e0140573c1 | tadeuzagallo/verve-lang | TypeError.hs | module Typing.TypeError
( TypeError(..)
) where
import Prelude hiding (print)
import Typing.Kinds
import Typing.Types
import Util.Error
import Util.PrettyPrint
data TypeError
= UnknownVariable String
| UnknownType String
| UnknownInterface String
| ArityMismatch
| TypeArityMismatch
| InferenceFailure... | null | https://raw.githubusercontent.com/tadeuzagallo/verve-lang/c7db1f5d4bb399b6c2623dd2444a981b5aba1aa4/src/Typing/TypeError.hs | haskell | module Typing.TypeError
( TypeError(..)
) where
import Prelude hiding (print)
import Typing.Kinds
import Typing.Types
import Util.Error
import Util.PrettyPrint
data TypeError
= UnknownVariable String
| UnknownType String
| UnknownInterface String
| ArityMismatch
| TypeArityMismatch
| InferenceFailure... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.