_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 |
|---|---|---|---|---|---|---|---|---|
3ca13d19ce890ada36c43ef6ab883216074d0e9e366c00791e141f1a1f95329f | MaartenFaddegon/Hoed | Core.hs | # LANGUAGE ExistentialQuantification , FlexibleInstances , GeneralizedNewtypeDeriving ,
MultiParamTypeClasses , TypeSynonymInstances , CPP , DeriveDataTypeable ,
DeriveGeneric , StandaloneDeriving #
MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable,
... | null | https://raw.githubusercontent.com/MaartenFaddegon/Hoed/8769d69e309928aab439b22bc3f3dbf5452acc77/tests/Prop/t3/XMonad/Core.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : not portable, uses cunning newtype deriving
The 'X' monad, a state monad transformer over 'IO', for the window
manager state, and support ... | # LANGUAGE ExistentialQuantification , FlexibleInstances , GeneralizedNewtypeDeriving ,
MultiParamTypeClasses , TypeSynonymInstances , CPP , DeriveDataTypeable ,
DeriveGeneric , StandaloneDeriving #
MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable,
... |
1809ca78c4fec4734572189fca182d774fa2a19054d534a04a4312d2a8b7a804 | facebook/duckling | Rules.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Duckling.AmountOfM... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/AmountOfMoney/TR/Rules.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
# LANGUAGE LambdaCase #
module Duckling.AmountOfMoney.TR.Rules
( rules
) where
import Data.String (fromString)
import Prelude
import Duckling.AmountOfMoney.Helpers
import Duckling.AmountOfMoney.Types (Currency(..), AmountOfMoneyData (..))
import Duckling.Dimen... |
09cbfb6ad37c15e9bdeaf74462f71ef4ba972e2ebf9a4285abc227d055c25732 | skanev/playground | 08.scm | SICP exercise 1.08
;
Newton 's method for cube roots is based on the fact that if y is an
; approximation to the cube root of x, then a better approximation is given by
; the value:
;
x / y² + 2y
; ─────────
3
;
; Use this formula to implement a cube-root procedure analogous to the
square - root procedure... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/08.scm | scheme |
approximation to the cube root of x, then a better approximation is given by
the value:
─────────
Use this formula to implement a cube-root procedure analogous to the
cube-root procedures). | SICP exercise 1.08
Newton 's method for cube roots is based on the fact that if y is an
x / y² + 2y
3
square - root procedure . ( In section 1.3.4 we will see how to implement
Newton 's method in general as an abstraction of these square - root and
(define (cube-root x)
(cube-root-iter 1.0 x))
(defi... |
970763960472830914f4f6b3a32a7e3c709c765ecf31b83b2c0ccd974d07ba1b | reactiveml/rml | parse_ident.ml | (**********************************************************************)
(* *)
(* ReactiveML *)
(* *)
(* ... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/compiler/parsing/parse_ident.ml | ocaml | ********************************************************************
ReactiveML
... | Copyright 2002 , 2007 . All rights reserved .
version 1.0 .
- theme SPI , Laboratoire d'Informatique de Paris 6 ( 2002 - 2005 )
- Verimag , CNRS Grenoble ( 2005 - 2006 )
- projet , ( 2006 - 2007 ) ... |
e993f707b492e7cd16e5105045f51b3dd1a724aa5270b45af4462bd4f50a708a | shonfeder/um-abt | abt_gen.ml | Copyright ( c ) 2021 Shon Feder
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 , ... | null | https://raw.githubusercontent.com/shonfeder/um-abt/2b3860b8f9217b04e7cb0645ede7726988c3735b/test/abt_gen.ml | ocaml | Copyright ( c ) 2021 Shon Feder
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 , ... | |
5321b4ebdf4f640110fdb423e17cd28b4c4a86db1dc36df9e1150513d9fa87b0 | mikesol/plzwrk | JSEnv.hs | module Web.Framework.Plzwrk.JSEnv
( JSEnv(..)
, RequestInit(..)
, FetchBody(..)
)
where
import Data.ByteString.Internal ( ByteString )
import qualified Data.HashMap.Strict as HM
-- | A data class holding functions that operate on opaque
JavaScript types , parameterized by @jsval@. When possi... | null | https://raw.githubusercontent.com/mikesol/plzwrk/5d37095652a12ae7d64c1c474c81321892c77dee/src/Web/Framework/Plzwrk/JSEnv.hs | haskell | | A data class holding functions that operate on opaque
the real names of browser functions like 'addEventListener'
and 'appendChild' are used.
JSEnv is currently implemented as data instead of as
a typeclass because it is unclear what type of additional
retain the state of @jsval@ objects, whereas when part of
... | module Web.Framework.Plzwrk.JSEnv
( JSEnv(..)
, RequestInit(..)
, FetchBody(..)
)
where
import Data.ByteString.Internal ( ByteString )
import qualified Data.HashMap.Strict as HM
JavaScript types , parameterized by @jsval@. When possible ,
monadic transformer around IO would be most appropr... |
73036951c163d42fba8bade713c2cddc41fade94ef7e2a9ec072de7b4a2126e0 | CSVdB/pinky | Sigmoid.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DataKinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Pinky.Layers.Sigmoid where
import Import
import Pinky.Core
import Pinky.CreateRandom
data Sigmoid =
Si... | null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky/src/Pinky/Layers/Sigmoid.hs | haskell | The derivative of the sigmoid function is
we can store this in the Tape and | # LANGUAGE DeriveGeneric #
# LANGUAGE DataKinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Pinky.Layers.Sigmoid where
import Import
import Pinky.Core
import Pinky.CreateRandom
data Sigmoid =
Si... |
aec0dd8835dabb1cf7b95fc4888f507dfe29d6cef0cb1969efc8b715d8608ccb | aantron/bisect_ppx | exclusions.mli | This file is part of Bisect_ppx , released under the MIT license . See
LICENSE.md for details , or visit
.
LICENSE.md for details, or visit
. *)
(** This stateful module contains the information about exluded toplevel
declarations. *)
val add : string -> unit
(** Adds a list of comma-separat... | null | https://raw.githubusercontent.com/aantron/bisect_ppx/21b037f5ae968499bc0c37805d351f58b211a6e4/src/ppx/exclusions.mli | ocaml | * This stateful module contains the information about exluded toplevel
declarations.
* Adds a list of comma-separated elements to excluded list.
* Adds a filename pattern to the list of files to exclude.
* Adds exclusions from the passed file to excluded list.
Raises [Sys_error] if an i/o error occurs, [Exc... | This file is part of Bisect_ppx , released under the MIT license . See
LICENSE.md for details , or visit
.
LICENSE.md for details, or visit
. *)
val add : string -> unit
val add_file : string -> unit
val add_from_file : string -> unit
val contains_value : string -> string -> bool
val contain... |
4303718d4542cb47e9f3cbdbb9dc75d96ad09abba4e24d45a2cf9742d6f94312 | emina/rosette | bvlib.rkt | #lang racket
(require
(only-in racket/splicing splicing-let)
"bitvector.rkt" "merge.rkt" "safe.rkt" "term.rkt" "bool.rkt" "forall.rkt" "lift.rkt"
(only-in "real.rkt" @integer? @> @>= @=)
(only-in "numerics.rkt" extreme))
(provide bit lsb msb bvzero? bvadd1 bvsub1
bvsmin bvsmax bvumin bvumax
... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/rosette/base/core/bvlib.rkt | racket | x and y must be bitvectors (not unions) of the same length. | #lang racket
(require
(only-in racket/splicing splicing-let)
"bitvector.rkt" "merge.rkt" "safe.rkt" "term.rkt" "bool.rkt" "forall.rkt" "lift.rkt"
(only-in "real.rkt" @integer? @> @>= @=)
(only-in "numerics.rkt" extreme))
(provide bit lsb msb bvzero? bvadd1 bvsub1
bvsmin bvsmax bvumin bvumax
... |
662e11e9e6aa87c0ba169f5ac3af1b868920754f58e71f2052e4e16b853d73e1 | rubenbarroso/EOPL | 1_11.scm | In this exercise we take the role of an optimizing compiler . We are to carry out an inlining for two
;mutually recursive procedures.
;These are the original procedures:
(define subst
(lambda (new old slist)
(if (null? slist)
'()
(cons
(subst-in-symbol-expression new old (car slist))
... | null | https://raw.githubusercontent.com/rubenbarroso/EOPL/f9b3c03c2fcbaddf64694ee3243d54be95bfe31d/src/chapter1/1_11.scm | scheme | mutually recursive procedures.
These are the original procedures:
Inlining subst-in-symbol-expression inside subst, we have:
If we expand the application of the lambda expression, substituting new by new,
old by old, and se by (car slist) in its body:
A quick verification that everything is still working as expected:
(... | In this exercise we take the role of an optimizing compiler . We are to carry out an inlining for two
(define subst
(lambda (new old slist)
(if (null? slist)
'()
(cons
(subst-in-symbol-expression new old (car slist))
(subst new old (cdr slist))))))
(define subst-in-symbol-exp... |
de2ce6eed3ca6eee713951ed38713f430d190e53e0221a4fc49b3f31df1812b5 | janestreet/incr_dom | app.ml | open! Core
open Incr_dom
open Js_of_ocaml
open Incr.Let_syntax
module Model = struct
type t =
{ default_prevented : bool
; propagation_stopped : bool
; outer_click_count : int
; outer_keydown_count : int
}
[@@deriving sexp, fields, compare]
let cutoff t1 t2 = compare t1 t2 = 0
let create ... | null | https://raw.githubusercontent.com/janestreet/incr_dom/7aaba451cf76dc493e218d738c6391882b55ef1b/example/event_propagation/app.ml | ocaml | open! Core
open Incr_dom
open Js_of_ocaml
open Incr.Let_syntax
module Model = struct
type t =
{ default_prevented : bool
; propagation_stopped : bool
; outer_click_count : int
; outer_keydown_count : int
}
[@@deriving sexp, fields, compare]
let cutoff t1 t2 = compare t1 t2 = 0
let create ... | |
4ed65f197d5e21a9e577f61d6cb85e4b95078100b5dc97c9dae15cbbf7e69cb0 | glguy/advent | 05.hs | # LANGUAGE QuasiQuotes #
|
Module : Main
Description : Day 5 solution
Copyright : ( c ) , 2019
License : ISC
Maintainer :
< >
This task expands the virtual machine defined in day 2
adding jumps , conditionals , inputs , and outputs .
This solution works with the following passes... | null | https://raw.githubusercontent.com/glguy/advent/7ab9f9e47208fd5720e36bac33fee2b78d4ec50b/solutions/src/2019/05.hs | haskell | | >>> :main | # LANGUAGE QuasiQuotes #
|
Module : Main
Description : Day 5 solution
Copyright : ( c ) , 2019
License : ISC
Maintainer :
< >
This task expands the virtual machine defined in day 2
adding jumps , conditionals , inputs , and outputs .
This solution works with the following passes... |
0d841d60564f372c65d27645fefe1173918b01be1de974e1f391160f4c84fd0e | nubank/clj-github-app | token_manager.clj | (ns clj-github-app.token-manager
(:require [clj-http.client :as http]
[clojure.core.cache :as cache]
[org.bovinegenius.exploding-fish :as uri]
[ring.util.codec :as codec])
(:import (clojure.core.cache CacheProtocol)
(com.auth0.jwt JWT)
(com.auth0.jwt.algorit... | null | https://raw.githubusercontent.com/nubank/clj-github-app/354281c4a4e023e3babb81dcf88d46a35a654b78/src/clj_github_app/token_manager.clj | clojure | See make-token-manager function below
Only private key given (only for signing, not for verifying) | (ns clj-github-app.token-manager
(:require [clj-http.client :as http]
[clojure.core.cache :as cache]
[org.bovinegenius.exploding-fish :as uri]
[ring.util.codec :as codec])
(:import (clojure.core.cache CacheProtocol)
(com.auth0.jwt JWT)
(com.auth0.jwt.algorit... |
b345ceba40932e4637e18076a8e61bf6c70bcc6b3ea60bcd4a011c1f57c6eaa8 | qiao/sicp-solutions | 2.41.scm | (define nil '())
(define (enumerate-interval low high)
(if (> low high)
nil
(cons low (enumerate-interval (+ low 1) high))))
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (flatmap proc s... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter2/2.41.scm | scheme | (define nil '())
(define (enumerate-interval low high)
(if (> low high)
nil
(cons low (enumerate-interval (+ low 1) high))))
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (flatmap proc s... | |
42eb07a9973317f353b883c045196ef8e48b415e7668b71219f71c095b19a70d | kappelmann/engaging-large-scale-functional-programming | Util.hs | module Competition.Util where
import Competition.Types (Board, Field, Player, Pos, Size)
import Control.Monad (liftM2, forM)
import Data.List (unfoldr)
import Data.Array.IO
import System.Random (randomRIO)
-- create and new board of a given size
makeBoard :: Size -> Board
makeBoard (h, w) = replicate h $ replicate w ... | null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/80e8a732c38691ff4e602e0cf77ff2eefb486284/resources/game_tournament_framework/backend/tournament-runner/src/Competition/Util.hs | haskell | create and new board of a given size
pretty print a board as a grid of numbers,
which represent the number of orbs in a cell,
players are are marked by ascii-escape sequences
ascii escape sequences for coloring the board
VARIOUS UTILITY FUNCTIONS
perform action f on the the field v for player p
unless the new ... | module Competition.Util where
import Competition.Types (Board, Field, Player, Pos, Size)
import Control.Monad (liftM2, forM)
import Data.List (unfoldr)
import Data.Array.IO
import System.Random (randomRIO)
makeBoard :: Size -> Board
makeBoard (h, w) = replicate h $ replicate w 0
player 1 is red , and player -1 is ... |
4d0a64c9c50f260993a0410661fc6827326b4e74f035cf9a90724ea8f5999dc0 | icicle-lang/disorder.hs-ambiata | Property.hs | # LANGUAGE TemplateHaskell #
module Test.Disorder.Core.Property where
import Data.AEq (AEq)
import qualified Data.AEq as AEQ
import Data.Functor
import Data.List (delete)
import Data.Text (Text)
import ... | null | https://raw.githubusercontent.com/icicle-lang/disorder.hs-ambiata/0068d9a0dd9aea45e772fb664cf4e7e71636dbe5/disorder-core/test/Test/Disorder/Core/Property.hs | haskell | |
@p .^. neg p@ | # LANGUAGE TemplateHaskell #
module Test.Disorder.Core.Property where
import Data.AEq (AEq)
import qualified Data.AEq as AEQ
import Data.Functor
import Data.List (delete)
import Data.Text (Text)
import ... |
a6579e2604c86fa0aeb0404907db2b7c444fa8a45fdcb0d9e46f8bd6b317bf7c | AccelerateHS/accelerate-examples | DotP.hs | # LANGUAGE ParallelListComp #
module DotP where
import Random
import System.Random.MWC
import Data.Array.Unboxed
import Data.Array.Accelerate as Acc
import Prelude as P
-- Dot product
-- -----------
dotpAcc :: Vector Float -> Vector Float -> Acc (Scalar Float)
dotpAcc xs ys
= let
xs' = use xs... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/tests/simple/DotP.hs | haskell | Dot product
-----------
Main
----
| # LANGUAGE ParallelListComp #
module DotP where
import Random
import System.Random.MWC
import Data.Array.Unboxed
import Data.Array.Accelerate as Acc
import Prelude as P
dotpAcc :: Vector Float -> Vector Float -> Acc (Scalar Float)
dotpAcc xs ys
= let
xs' = use xs
ys' = use ys
in
... |
99a3a79ee7ed4aab32051fdd55711a03027d07090c97bf0a84c2d584ccf6d86b | WorksHub/client | core.cljs | (ns wh.company.core
(:require [cljs.loader :as loader]
[re-frame.core :refer [dispatch-sync reg-event-db]]
[wh.common.user :as user-common]
[wh.company.applications.views :as applications]
[wh.company.candidate.db :as candidate-db]
[wh.company.candidate.even... | null | https://raw.githubusercontent.com/WorksHub/client/59d9415b1347d1f23175121706c698fb4ca90e19/client/src/wh/company/core.cljs | clojure | load stripe js | (ns wh.company.core
(:require [cljs.loader :as loader]
[re-frame.core :refer [dispatch-sync reg-event-db]]
[wh.common.user :as user-common]
[wh.company.applications.views :as applications]
[wh.company.candidate.db :as candidate-db]
[wh.company.candidate.even... |
b57f8654617b06165603050f8add2a6d2561cc2e7a7e5f1f24d4d1f77f57c490 | dparis/gen-phzr | render_texture.cljs | (ns phzr.impl.accessors.render-texture)
(def render-texture-get-properties
{:base-texture "baseTexture"
:crop "crop"
:frame "frame"
:game "game"
:height "height"
:is-tiling "isTiling"
:key "key"
:no-frame "noFrame"
:renderer "renderer"
:requires-re-tint "requiresReTint"
:requires-update... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/impl/accessors/render_texture.cljs | clojure | (ns phzr.impl.accessors.render-texture)
(def render-texture-get-properties
{:base-texture "baseTexture"
:crop "crop"
:frame "frame"
:game "game"
:height "height"
:is-tiling "isTiling"
:key "key"
:no-frame "noFrame"
:renderer "renderer"
:requires-re-tint "requiresReTint"
:requires-update... | |
9e9b61c1d358768ec9db23db7b21ed99c1d4fbee224f7eef6e5b9f00e0bd3668 | abcdw/ironhide | core.cljc | (ns ironhide.core
(:require [com.rpl.specter :as sp]
#?(:cljs [orchestra-cljs.spec.test :as stest]
:clj [orchestra.spec.test :as stest])
[clojure.spec.alpha :as s]
[clojure.string :as cstr]))
;; =======================================================================... | null | https://raw.githubusercontent.com/abcdw/ironhide/f55b69b356b61c1bf9c0ae122e7e14578efbd731/src/ironhide/core.cljc | clojure | =============================================================================
specs
=============================================================================
=============================================================================
sights
TODO: move to specter
============================================... | (ns ironhide.core
(:require [com.rpl.specter :as sp]
#?(:cljs [orchestra-cljs.spec.test :as stest]
:clj [orchestra.spec.test :as stest])
[clojure.spec.alpha :as s]
[clojure.string :as cstr]))
(defn- ih? [x]
(and (keyword? x)
(= "ih" (namespace x))))
(defn... |
007aaad458cc2c512f5a73fcf31269eb76a3d0f620f8fd242b0acf79cc6f3d8f | alexandergunnarson/quantum | utils.cljc | (ns quantum.core.io.utils
(:require
[com.stuartsierra.component :as component]
#?(:clj [clojure.java.io :as io])
[quantum.core.convert :as conv
:refer [->name]]
[quantum.core.collections :as coll
:refer [kw-map]]
... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/core/io/utils.cljc | clojure | ===== DEPENDENCIES =====
exists?
===== EXTENSIONS =====
Files.probeContentType(path)
This works only if File is declared
This works only if File is declared
This works only if File is declared
([^file? x]
(map->ByteEntity {:type (get-type x) :name (get-name x)})))) | (ns quantum.core.io.utils
(:require
[com.stuartsierra.component :as component]
#?(:clj [clojure.java.io :as io])
[quantum.core.convert :as conv
:refer [->name]]
[quantum.core.collections :as coll
:refer [kw-map]]
... |
e27690a472707b60cb528f10b0c6c35b14034eeaa79f268b21afbb1fb14c58b3 | rbuchmann/samak | core.cljc | (ns samak.core
(:require [samak.builtins :as builtins]
[samak.caravan :as c]
[samak.stdlib :as std]
#?(:cljs [samak.ui_stdlib :as uistd])
#?(:cljs [samak.layout :as layout])))
(def ui-mock-symbols
{'pipes/ui :noop
'pipes/m... | null | https://raw.githubusercontent.com/rbuchmann/samak/ab98d1a180ee02c6cd784962b3c03e473a6d481b/ui_src/samak/core.cljc | clojure | (ns samak.core
(:require [samak.builtins :as builtins]
[samak.caravan :as c]
[samak.stdlib :as std]
#?(:cljs [samak.ui_stdlib :as uistd])
#?(:cljs [samak.layout :as layout])))
(def ui-mock-symbols
{'pipes/ui :noop
'pipes/m... | |
e0854cd0aa108a45f879d00c131e00105ba8a91141e81178867aabfa8950ccb4 | janestreet/core_kernel | composition_infix.ml | let ( >> ) f g x = g (f x)
let ( << ) f g x = f (g x)
| null | https://raw.githubusercontent.com/janestreet/core_kernel/5d5af9a4a7c412c1d92d0e0f1d169511e7888e5e/composition_infix/src/composition_infix.ml | ocaml | let ( >> ) f g x = g (f x)
let ( << ) f g x = f (g x)
| |
efc4af2c7cd63721b2c2d24ecc61b3b2eda89000c2d6fdc533a9dd73835ec6e1 | andrewthad/sockets | Hybrid.hs | # language BangPatterns #
# language DataKinds #
module Socket.Stream.Interruptible.Hybrid
( sendMutableBytesUnmanagedBytes
) where
import Control.Concurrent.STM (TVar)
import Data.Bytes.Types (MutableBytes,UnmanagedBytes)
import GHC.Exts (RealWorld)
import Socket (Interruptibility(Interruptible))
import Socket.S... | null | https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/src/Socket/Stream/Interruptible/Hybrid.hs | haskell | ^ Interrupt. On 'True', give up and return @'Left' 'SendInterrupted'@.
^ Connection | # language BangPatterns #
# language DataKinds #
module Socket.Stream.Interruptible.Hybrid
( sendMutableBytesUnmanagedBytes
) where
import Control.Concurrent.STM (TVar)
import Data.Bytes.Types (MutableBytes,UnmanagedBytes)
import GHC.Exts (RealWorld)
import Socket (Interruptibility(Interruptible))
import Socket.S... |
6b7b60be058baceae3ab01c5aa29612cbb7643d54a2735de80eba788e25ba299 | mgsloan/instance-templates | Enumerable.hs | # LANGUAGE TemplateHaskell , ConstraintKinds , ScopedTypeVariables , FlexibleInstances , FlexibleContexts #
From lattices library
module Enumerable where
import Language.Haskell.InstanceTemplates
import Language.Haskell.TH.Syntax -- This is just for prettier -ddump-splices
-- | Finitely enumerable things
class ... | null | https://raw.githubusercontent.com/mgsloan/instance-templates/734f3fe838f194b613a270c2e1eb9502b73840a6/tests/lattice/Enumerable.hs | haskell | This is just for prettier -ddump-splices
| Finitely enumerable things | # LANGUAGE TemplateHaskell , ConstraintKinds , ScopedTypeVariables , FlexibleInstances , FlexibleContexts #
From lattices library
module Enumerable where
import Language.Haskell.InstanceTemplates
class Enumerable a where
universe :: [a]
type BoundedUniverse a = (Enum a, Bounded a, Enumerable a)
$(mkTempla... |
70dc08f36d8804c09c292904895163b2976a7fc5e916e42461af6b7fa19e61e7 | csw/lc2k-scheme | ir.rkt | #lang racket
(require racket/trace)
(require "types.rkt")
(require "environ.rkt")
(require "lc2k.rkt")
(require "util.rkt")
(provide gen-ir ir-dest ir-sources register-num label-cleanup)
(define (reg-ref n)
(list 'register n))
(define reg0 (reg-ref 0))
(define/match (register-num r)
[((list 'register n)) n])
... | null | https://raw.githubusercontent.com/csw/lc2k-scheme/54c3372f67c8b9cd9d155d843871dd99c3ea288a/ir.rkt | racket |
(gen-sequence conditions init-continue targets): return a code
list for a list of conditional expressions.
conditions: list of conditional expressions.
targets: a function which, given the following label in sequence,
and false branch targets. For (and ...) these should be
(following false-label);... | #lang racket
(require racket/trace)
(require "types.rkt")
(require "environ.rkt")
(require "lc2k.rkt")
(require "util.rkt")
(provide gen-ir ir-dest ir-sources register-num label-cleanup)
(define (reg-ref n)
(list 'register n))
(define reg0 (reg-ref 0))
(define/match (register-num r)
[((list 'register n)) n])
... |
7200e02565b51e3100074bef6f6a586fa825af4e6db521d0ce6fb62fca039fae | haskell-effectful/effectful | UnliftTests.hs | module UnliftTests (unliftTests) where
import Control.Exception
import Test.Tasty
import Test.Tasty.HUnit
import qualified UnliftIO.Async as A
import Effectful
import qualified Utils as U
unliftTests :: TestTree
unliftTests = testGroup "Unlift"
[ testCase "Strategy stays the same in a new thread" test_threadStrate... | null | https://raw.githubusercontent.com/haskell-effectful/effectful/fa5ab274c8e5f0f9e537538cb8526f2b71f336b1/effectful/tests/UnliftTests.hs | haskell | --------------------------------------
Helpers | module UnliftTests (unliftTests) where
import Control.Exception
import Test.Tasty
import Test.Tasty.HUnit
import qualified UnliftIO.Async as A
import Effectful
import qualified Utils as U
unliftTests :: TestTree
unliftTests = testGroup "Unlift"
[ testCase "Strategy stays the same in a new thread" test_threadStrate... |
76c9b55e0002387ef2c8f252e0dbca6d365af91cf50b57c5a8abd8c91e6906ec | TrustInSoft/tis-kernel | options.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/callgraph/options.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
66b2c17d05809ad29482c253e56caa0dc30ae1fdeeba3831ef26827e71411d46 | racket/rhombus-prototype | pattern-variable.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre
shrubbery/print
"srcloc.rkt")
syntax/parse/pre
"parse.rkt"
"expression.rkt"
"binding.rkt"
(submod "syntax-class-primitive.rkt" for-quasiquote)
... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/b05f8a1515cf01c6b431f820c2a7f62b2b9532a8/rhombus/private/pattern-variable.rkt | racket | complain if a repetition field is not being used as such, but
don't complain if a field is not found, because maybe the dot is | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre
shrubbery/print
"srcloc.rkt")
syntax/parse/pre
"parse.rkt"
"expression.rkt"
"binding.rkt"
(submod "syntax-class-primitive.rkt" for-quasiquote)
... |
5e74a774c00da5367b7cb99749d8bd14c1e405091d4bf04c2188ef3a40e68884 | dgtized/shimmers | color_mapping.cljs | (ns shimmers.sketches.color-mapping
(:require
[shimmers.common.svg :as csvg]
[shimmers.common.ui.controls :as ctrl]
[shimmers.math.deterministic-random :as dr]
[shimmers.sketch :as sketch :include-macros true]
[shimmers.view.sketch :as view-sketch]
[thi.ng.geom.rect :as rect]
[thi.ng.geom.vector ... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/color_mapping.cljs | clojure | (ns shimmers.sketches.color-mapping
(:require
[shimmers.common.svg :as csvg]
[shimmers.common.ui.controls :as ctrl]
[shimmers.math.deterministic-random :as dr]
[shimmers.sketch :as sketch :include-macros true]
[shimmers.view.sketch :as view-sketch]
[thi.ng.geom.rect :as rect]
[thi.ng.geom.vector ... | |
4e0e6a5294304109b49a6827a6d1bec23a33d3eb9282739b4f4adcc60ce2bbd7 | deadtrickster/prometheus.cl | test-metrics.lisp | (in-package #:prometheus.pushgateway.test)
(define-constant +expected-metrics-text+ "# TYPE requests_counter counter
# HELP requests_counter Hunchentoot requires counter
requests_counter{type=\"post\"} 12
requests_counter{type=\"get\"} 5
# TYPE total_memory gauge
# HELP total_memory SBCL total memory
total_memory 566
... | null | https://raw.githubusercontent.com/deadtrickster/prometheus.cl/60572b793135e8ab5a857d47cc1a5fe0af3a2d53/t/pushgateway/test-metrics.lisp | lisp | (in-package #:prometheus.pushgateway.test)
(define-constant +expected-metrics-text+ "# TYPE requests_counter counter
# HELP requests_counter Hunchentoot requires counter
requests_counter{type=\"post\"} 12
requests_counter{type=\"get\"} 5
# TYPE total_memory gauge
# HELP total_memory SBCL total memory
total_memory 566
... | |
15d4a30567c514f10e803fae8aa9eabc02029e839aa1e49e810b29c0b5447de9 | input-output-hk/project-icarus-importer | Global.hs | | Logic of local data processing in Update System .
module Pos.Update.Logic.Global
( UpdateBlock
, usApplyBlocks
, usCanCreateBlock
, usRollbackBlocks
, usVerifyBlocks
) where
import Universum
import Control.Monad.Except (MonadError, runExceptT)
import... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/update/Pos/Update/Logic/Global.hs | haskell | --------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Constraints
--------------------------------------------------------------------------
-------... | | Logic of local data processing in Update System .
module Pos.Update.Logic.Global
( UpdateBlock
, usApplyBlocks
, usCanCreateBlock
, usRollbackBlocks
, usVerifyBlocks
) where
import Universum
import Control.Monad.Except (MonadError, runExceptT)
import... |
38dd9a43b7e61068d200893e628ba2762d271267ed87fb3f67ea6553bc65d28e | gheber/kenzo | run-kenzo-test.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
(DECLAIM (OPTIMIZE (speed 3) (space 0) (debug 3)))
(require 'asdf)
(asdf:operate 'asdf:load-op :kenzo-test)
(fiveam:run! :kenzo-7)
(fiveam:run! :kenzo-8)
(fiveam:run! :kenzo-9)
#+(or ecl ccl) (quit)
#+sbcl(sb-ext:exit)
| null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/run-kenzo-test.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - * |
(DECLAIM (OPTIMIZE (speed 3) (space 0) (debug 3)))
(require 'asdf)
(asdf:operate 'asdf:load-op :kenzo-test)
(fiveam:run! :kenzo-7)
(fiveam:run! :kenzo-8)
(fiveam:run! :kenzo-9)
#+(or ecl ccl) (quit)
#+sbcl(sb-ext:exit)
|
0d9dd7331d2574c241994e054c76d4526865955f80204907ea06fc6465bfc6e5 | byorgey/diagrams-play | Harriss.hs | spiral .
Rectangle
+ -----------------+
| |
1 | |
| |
| |
+ -----------------+
p
divides into 2 rectangles + square , both rectangles are similar to original :
+ ------+----------+
| ... | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/Harriss.hs | haskell | ---------------+
---------------+
----+----------+
--------|
----+----------+
---------------+
---------------+
----+----------+
--------|
----+----------+
Fixed recursion depth
Pick recursion depth based on desired pixel accuracy | spiral .
Rectangle
| |
1 | |
| |
| |
p
divides into 2 rectangles + square , both rectangles are similar to original :
| | r2 |
1 | r1 | |
| | square |
... |
b2db26281a8857bd0c5b90b3561596c9203b88048d0914a8f47d5990afe07e5a | galdor/tungsten | package.lisp | (defpackage :text-test
(:use :cl :test)
(:export))
| null | https://raw.githubusercontent.com/galdor/tungsten/5d6e71fb89af32ab3994c5b2daf8b902a5447447/tungsten-text/t/package.lisp | lisp | (defpackage :text-test
(:use :cl :test)
(:export))
| |
e13918c401f1d856a72e7f110a7dbd6e9bee4d6f91824619586db4cb5003f6fe | haskell-suite/haskell-src-exts | SpecializeInstance.hs | instance Sized a => Sized (Digit a) where
{-# SPECIALIZE instance Sized (Digit (Elem a)) #-}
{-# SPECIALIZE instance Sized (Digit (Node a)) #-}
size xs = foldl (\ i x -> i + size x) 0 xs
| null | https://raw.githubusercontent.com/haskell-suite/haskell-src-exts/84a4930e0e5c051b7d9efd20ef7c822d5fc1c33b/tests/examples/SpecializeInstance.hs | haskell | # SPECIALIZE instance Sized (Digit (Elem a)) #
# SPECIALIZE instance Sized (Digit (Node a)) # | instance Sized a => Sized (Digit a) where
size xs = foldl (\ i x -> i + size x) 0 xs
|
c2428e3ea3df68a72b0c7fc8995198e41c32e991a647cf9069791dbca2c879a2 | rudymatela/speculate | Utils.hs | -- |
-- Module : Test.Speculate.Utils
Copyright : ( c ) 2016 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
--
-- This module is part of Speculate.
--
-- Exports utility functions of all utils sub-modules.
--
This is not intended to be used by users of Speculate ... | null | https://raw.githubusercontent.com/rudymatela/speculate/8ec39747d03033db4349d554467d4b78bb72935d/src/Test/Speculate/Utils.hs | haskell | |
Module : Test.Speculate.Utils
This module is part of Speculate.
Exports utility functions of all utils sub-modules.
Speculate itself. Expect symbols exported here to come and go with every
minor version. | Copyright : ( c ) 2016 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
This is not intended to be used by users of Speculate , only by modules of
module Test.Speculate.Utils
( module Test.Speculate.Utils.Misc
, module Test.Speculate.Utils.PrettyPrint
, module Tes... |
cd17973b319085d134d9f8662c202686698b7c5b62b3b741d0e736aed82df16d | jacekschae/learn-datomic-course-files | middleware.clj | (ns cheffy.middleware
(:require [ring.middleware.jwt :as jwt]
[ring.util.response :as rr]
[datomic.client.api :as d]))
(def wrap-env
{:name ::env
:description "Middleware for injecting env into request"
:compile (fn [{:keys [env] :as _route-data} _route-opts]
(fn [handle... | null | https://raw.githubusercontent.com/jacekschae/learn-datomic-course-files/302113bc462e8d744af356165f2c44ce3b57836f/increments/26-update-recipe/src/main/cheffy/middleware.clj | clojure | FIXME: recipe-db/find-recipe-by-id
FIXME: conversation | (ns cheffy.middleware
(:require [ring.middleware.jwt :as jwt]
[ring.util.response :as rr]
[datomic.client.api :as d]))
(def wrap-env
{:name ::env
:description "Middleware for injecting env into request"
:compile (fn [{:keys [env] :as _route-data} _route-opts]
(fn [handle... |
24933d4f1d8465780088729796c24b867b74de68fa3aef236a1f4bb677c9010b | lispbuilder/lispbuilder | package.lisp | ;;;; lispbuilder-openrm-base
(in-package #:cl-user)
(defpackage #:lispbuilder-openrm-base
(:use #:cl #:cffi)
(:nicknames #:rm-base)
(:documentation "The main package of `lispbuilder-openrm-base'.")
(:import-from #:lispbuilder-openrm-cffi
lispbuilder-openrm-cffi::r
lispbuilder-openrm-cffi::g
lispbuilder-... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-openrm/base/package.lisp | lisp | lispbuilder-openrm-base
utils.lisp |
(in-package #:cl-user)
(defpackage #:lispbuilder-openrm-base
(:use #:cl #:cffi)
(:nicknames #:rm-base)
(:documentation "The main package of `lispbuilder-openrm-base'.")
(:import-from #:lispbuilder-openrm-cffi
lispbuilder-openrm-cffi::r
lispbuilder-openrm-cffi::g
lispbuilder-openrm-cffi::b
lispbuilder-... |
f5170cf4f1f359ec2a2822d57d240bda2b82fb5f208e008f75c54353298f737f | jepsen-io/etcd | nemesis.clj | (ns jepsen.etcd.nemesis
"Nemeses for etcd"
(:require [clojure.pprint :refer [pprint]]
[clojure.tools.logging :refer [info warn]]
[jepsen [control :as c]
[nemesis :as n]
[generator :as gen]
[net :as net]
[util :as... | null | https://raw.githubusercontent.com/jepsen-io/etcd/127de3e52f72e368a3866487c97f6c8293cc3b8b/src/jepsen/etcd/nemesis.clj | clojure | It's possible for the cluster to get stuck in a
way that can't be grown--for instance, with
permanently blank member names.
Possible types of faults and types of files to mess with | (ns jepsen.etcd.nemesis
"Nemeses for etcd"
(:require [clojure.pprint :refer [pprint]]
[clojure.tools.logging :refer [info warn]]
[jepsen [control :as c]
[nemesis :as n]
[generator :as gen]
[net :as net]
[util :as... |
e0591ca71b55f5f20e47a0cc298711764321eb79c7d66092d619c220b57cf605 | ofmooseandmen/jord | Transformations.hs | module Transformations
( Transformation(..)
, parser
, generator
) where
import Data.List (intercalate, partition)
import Data.Maybe (isJust)
import Text.ParserCombinators.ReadP (ReadP, skipSpaces, string)
import qualified Generator as G
import qualified Parsers as P
data Params =
Params [Double]... | null | https://raw.githubusercontent.com/ofmooseandmen/jord/9acd8d9aec817ce05de6ed1d78e025437e1193bf/gen/Transformations.hs | haskell | module Transformations
( Transformation(..)
, parser
, generator
) where
import Data.List (intercalate, partition)
import Data.Maybe (isJust)
import Text.ParserCombinators.ReadP (ReadP, skipSpaces, string)
import qualified Generator as G
import qualified Parsers as P
data Params =
Params [Double]... | |
5d39d1559f6b1a510ead3637c1eb0337c9e0ca8b1f70cd0c150482d56b3139fd | gebi/jungerl | edit_mod.erl | %%%----------------------------------------------------------------------
%%% File : edit_mod.erl
Author : < >
%%% Purpose : Module loader
Created : 28 Apr 2001 by < >
%%%----------------------------------------------------------------------
-module(edit_mod).
-author('').
-export([init/0, require/1, l... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ermacs/src/edit_mod.erl | erlang | ----------------------------------------------------------------------
File : edit_mod.erl
Purpose : Module loader
----------------------------------------------------------------------
not initialised
already initialised | Author : < >
Created : 28 Apr 2001 by < >
-module(edit_mod).
-author('').
-export([init/0, require/1, load/1]).
init() ->
ets:new(?MODULE, [set, named_table, public]),
ok.
require(Mod) ->
case ets:lookup(?MODULE, Mod) of
case load(Mod) of
ok ->
ok;
{error, Reason} ->
{er... |
4a102a15d74127afa5cb6b9a0c916a92f88f51893c340fd85504e60920fd4bc0 | atlas-engineer/nyxt | prompter-source.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :prompter)
;; TODO: Use methods instead of slots? Probably no, because we must be able to
;; handle anonymous sources / prompters.
;; TODO: Memoize `suggestion' computation?
;; TODO: User classes? Probably use... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/7c6f78fd1733a842caf5eb105122c6515ec50754/libraries/prompter/prompter-source.lisp | lisp | TODO: Use methods instead of slots? Probably no, because we must be able to
handle anonymous sources / prompters.
TODO: Memoize `suggestion' computation?
TODO: User classes? Probably useful mostly for `source' since
they may be defined globally. Conversely, `prompter' is mostly used
locally.
TODO: Performance... | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :prompter)
(deftype function-symbol ()
`(and symbol (satisfies fboundp)))
TODO : Inspired by Nyxt . Move to serapeum ?
"Run body while capturing all conditions and echoing them as a warning.
The warni... |
30bf427c2ec34142e9f959019990587f81a858f4fe2b7c89f34a591b79c1f009 | mfikes/fifth-postulate | ns154.cljs | (ns fifth-postulate.ns154)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns154.cljs | clojure | (ns fifth-postulate.ns154)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
b6bd1b38f10e64f9eb463cdd8413a3bc248d7431d0f04fde7a5ed9d011a54b81 | DrakeAxelrod/functional-programming | RunGame.hs | module RunGame where
import Data.Char
import System.Random
import Cards
-- | The interface to the students' implementation.
data Interface = Interface
{ iFullDeck :: Hand
, iValue :: Hand -> Integer
, iDisplay :: Hand -> String
, iGameOver :: Hand -> Bool
, iWinner :: Hand -> Hand -> Player
, iDraw ... | null | https://raw.githubusercontent.com/DrakeAxelrod/functional-programming/9888822f0824c9568026a61da6beaeeecced518c/lab2/RunGame.hs | haskell | | The interface to the students' implementation.
| A type of players.
| Runs a game given an implementation of the interface.
| Play until the guest player is bust or chooses to stop.
| Display the bank's final score and the winner. | module RunGame where
import Data.Char
import System.Random
import Cards
data Interface = Interface
{ iFullDeck :: Hand
, iValue :: Hand -> Integer
, iDisplay :: Hand -> String
, iGameOver :: Hand -> Bool
, iWinner :: Hand -> Hand -> Player
, iDraw :: Hand -> Hand -> (Hand, Hand)
, iPlayBank ::... |
e2ffbdc4e998968fb446217296e3f7d74e2f7cf36d2da8295656e5735267123c | bsless/clj-fast | core.clj | Copyright ( c ) . All rights reserved .
;;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;;; which can be found in the file epl-v10.html at the root of this distribution.
;;; By using this software in any fashion, you are agreeing to be bound by
;;; t... | null | https://raw.githubusercontent.com/bsless/clj-fast/dd6b58684246fc173ca1319b972218468620bed2/src/clj_fast/clojure/core.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
red... | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns clj-fast.clojure.core
(:refer-clojure
:exclude
[get nth assoc get-in merge assoc-in update-in select-keys memoize destructure let fn loop defn defn- subseq rsubseq])
(:require
[clojure.core :as core]
[clj-fast.uti... |
b359d8fb5423fe668cfeea6a6786d22a06a7c946f92817db9bfb6ae8d87e0b64 | igorhvr/bedlam | seen.scm | (define seen-table (make-hashtable))
(define (sseen? moves pos)
(cond [(null? moves) 0]
[(null? (node-parent moves)) 0]
[(equal? (node-pos moves) pos)
(+ 1 (sseen? (node-parent moves) pos))]
[else (sseen? (node-parent moves) pos)]))
(define (seen? id x y)
(let ((seenworld (hash... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-contrib/icfp/seen.scm | scheme | (define seen-table (make-hashtable))
(define (sseen? moves pos)
(cond [(null? moves) 0]
[(null? (node-parent moves)) 0]
[(equal? (node-pos moves) pos)
(+ 1 (sseen? (node-parent moves) pos))]
[else (sseen? (node-parent moves) pos)]))
(define (seen? id x y)
(let ((seenworld (hash... | |
5a66ee75fd5f271a52bc91b92ba2b8d0afee789bc154d5267cfc1378060699d0 | hasura/graphql-data-specification | SchemaGenerator.hs | module Main where
import DDL qualified
import Data.Aeson qualified as Json
import Data.HashMap.Strict qualified as Map
import Data.Text (Text)
import Data.Text.Lazy qualified as Text
import Data.Text.Lazy.Builder qualified as Text
import GHC.Generics (Generic)
import Language.GraphQL.Draft.Printer qualified as GraphQL... | null | https://raw.githubusercontent.com/hasura/graphql-data-specification/b82b899a7d015c810a571d31322619aff2154b81/tooling/app/SchemaGenerator.hs | haskell | module Main where
import DDL qualified
import Data.Aeson qualified as Json
import Data.HashMap.Strict qualified as Map
import Data.Text (Text)
import Data.Text.Lazy qualified as Text
import Data.Text.Lazy.Builder qualified as Text
import GHC.Generics (Generic)
import Language.GraphQL.Draft.Printer qualified as GraphQL... | |
217e085db705ee7f2e0e3404e874eef25b0c9f2671d11ce1a8e40b8066cbb982 | THISISDINOSAUR/Anatomy | basoTheropod.rkt | #lang anatomy
//baso-theropod based on Herrerasaurus ischiguanlastensis
//"The classic achaidc theropod"
Parameters = {
test: 0.2 > < 1.8 = 0.43
}
//hips start
illium = [0,0], [-115, -24], [-81, 89], [40, 135], [90, 111], [100, 75], [28, 48], [84, 14]
pubis = [-22, -4], [-53, -26], [-156, -30], [-204, -2], [-209, ... | null | https://raw.githubusercontent.com/THISISDINOSAUR/Anatomy/883aa140c41cd375575a2944bda79608c660935b/anatomyFiles/basoTheropod.rkt | racket | #lang anatomy
//baso-theropod based on Herrerasaurus ischiguanlastensis
//"The classic achaidc theropod"
Parameters = {
test: 0.2 > < 1.8 = 0.43
}
//hips start
illium = [0,0], [-115, -24], [-81, 89], [40, 135], [90, 111], [100, 75], [28, 48], [84, 14]
pubis = [-22, -4], [-53, -26], [-156, -30], [-204, -2], [-209, ... | |
c54c8207c04f1cd60eb32b5e7ecb11dbe7243d28ee9b04b78768b3335c3bbc29 | jlollis/sicp-solutions | ch4-leval.scm | #lang sicp
;;;;LAZY EVALUATOR FROM SECTION 4.2 OF
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;;Matches code in ch4.scm
;;;; Also includes enlarged primitive-procedures list
;;;;This file can be loaded into Scheme as a whole.
;;;;**NOTE**This file loads the metacircular evaluator of
sections 4.1.1 - ... | null | https://raw.githubusercontent.com/jlollis/sicp-solutions/7b03befcfe82e26a7fb28d94bc99292bc484f9dd/Supplemental%20Materials/code%20from%20SICP/ch4/ch4-leval.scm | scheme | LAZY EVALUATOR FROM SECTION 4.2 OF
STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
Matches code in ch4.scm
Also includes enlarged primitive-procedures list
This file can be loaded into Scheme as a whole.
**NOTE**This file loads the metacircular evaluator of
environment representation, etc.
You may need to chang... | #lang sicp
sections 4.1.1 - 4.1.4 , since it uses the expression representation ,
the two lines at the end of the file ch4-mceval.scm
To run without memoization , reload the first version of force - it below
Note : It is loaded first so that the section 4.2 definition
of eval overrides the definition ... |
7052eb8cd067dfe9e687ed7c83b5321edaa04d5a5e8a130d5e7baae4500ac97f | CodyReichert/qi | strings.lisp | (in-package :alexandria)
(deftype string-designator ()
"A string designator type. A string designator is either a string, a symbol,
or a character."
`(or symbol string character))
| null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/alexandria-latest/strings.lisp | lisp | (in-package :alexandria)
(deftype string-designator ()
"A string designator type. A string designator is either a string, a symbol,
or a character."
`(or symbol string character))
| |
5489026fb7f122f317b6254c79f5c3ea348ccf3080fd5378e81c1ee47f85ec35 | racket/errortrace | cross-phase.rkt | #lang racket/base
(provide cross-phase-tests)
(define (cross-phase-tests)
Check that errortrace is ok with ` ( # % declare # : cross - phase - persistent ) `
(let ()
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(dynamic-require 'errortrace #f)
(eval '(module cross-p... | null | https://raw.githubusercontent.com/racket/errortrace/914f26aa07f97b4aaecea41f5881ac442df93a42/errortrace-test/tests/errortrace/cross-phase.rkt | racket | #lang racket/base
(provide cross-phase-tests)
(define (cross-phase-tests)
Check that errortrace is ok with ` ( # % declare # : cross - phase - persistent ) `
(let ()
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(dynamic-require 'errortrace #f)
(eval '(module cross-p... | |
2c46e2db73b0cecffc81ce941f66e7ef0220a9c45fec674abd7996329bfea44e | atdixon/me.untethr.nostr-relay | e_or_p_based.clj | (ns me.untethr.nostr.query.e-or-p-based
(:require [clojure.string :as str]))
(defn e#-tags-only-single-query-str0
[cols-str num-e#-tags use-since?]
(format
(str
"select %s from e_tags"
" where tagged_event_id in %s and source_event_deleted_ = 0"
(when use-since?
" and source_event_c... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-relay/f02c644d8c09dc41703b4ce9e99e1e4a30fda8e9/src/me/untethr/nostr/query/e_or_p_based.clj | clojure | deterministic queries are nice for log processing and we may like to leverage
deterministic queries are nice for log processing and we may like to leverage
--
deterministic queries are nice for log processing and we may like to leverage
deterministic queries are nice for log processing and we may like to leverage | (ns me.untethr.nostr.query.e-or-p-based
(:require [clojure.string :as str]))
(defn e#-tags-only-single-query-str0
[cols-str num-e#-tags use-since?]
(format
(str
"select %s from e_tags"
" where tagged_event_id in %s and source_event_deleted_ = 0"
(when use-since?
" and source_event_c... |
d439fdc402e9c2b1241b79c6085d43b3752874948c7a848f7a3f2f4ac1b620c3 | Sheinxy/Advent2022 | day_13.hs | module Main where
import Data.Char
import Data.List
data Packet = Number Int | List [Packet] deriving (Show, Read, Eq)
instance Ord Packet where
compare (Number x) (Number y) = compare x y
compare (Number x) y = compare (List [Number x]) y
compare x (Number y) = compare ... | null | https://raw.githubusercontent.com/Sheinxy/Advent2022/4c3f0afb66bcb9d4bffe5a28e30911daaa846288/Day_13/day_13.hs | haskell | module Main where
import Data.Char
import Data.List
data Packet = Number Int | List [Packet] deriving (Show, Read, Eq)
instance Ord Packet where
compare (Number x) (Number y) = compare x y
compare (Number x) y = compare (List [Number x]) y
compare x (Number y) = compare ... | |
dfa20572c676cd16bd527e350883c0c3d102fe69acfae58897f2787f26e622c2 | damballa/abracad | model_test.clj | (ns abracad.avro.model-test
(:require [clojure.test :refer :all]
[abracad.avro :as avro])
(:import [org.apache.avro Schema]
[abracad.avro ClojureData]))
(defn ac-compare
[x y ^Schema schema]
(.compare (ClojureData/get) x y schema))
(deftest test-compare-bytes
(let [schema (avro/parse-... | null | https://raw.githubusercontent.com/damballa/abracad/5c16564a86b6c83ddc17b3ac5aba5f69798ec269/test/abracad/avro/model_test.clj | clojure | (ns abracad.avro.model-test
(:require [clojure.test :refer :all]
[abracad.avro :as avro])
(:import [org.apache.avro Schema]
[abracad.avro ClojureData]))
(defn ac-compare
[x y ^Schema schema]
(.compare (ClojureData/get) x y schema))
(deftest test-compare-bytes
(let [schema (avro/parse-... | |
4610268cd4df1250b3747c856d12e275ef39beb2a8f64f7a1cfe584ffbbb9a4b | svenpanne/EOPL3 | exercise-1-14.rkt | #lang eopl
; ------------------------------------------------------------------------------
Exercise 1.14
;
1 ) Induction base n = 0 : partial - vector - sum returns ( vector - ref v 0 ) = v(0 ) ,
which exists because 0 < length(v ) , and sum from i = 0 to 0 of v(i ) = v(0 ) .
2 ) Induction step n > 0 : Assu... | null | https://raw.githubusercontent.com/svenpanne/EOPL3/3fc14c4dbb1c53a37bd67399eba34cea8f8234cc/chapter1/exercise-1-14.rkt | racket | ------------------------------------------------------------------------------
partial-vector-sum returns v(n) + sum from i = 0 to n-1 of v(i), which
equals sum from i = 0 to n of v(i). | #lang eopl
Exercise 1.14
1 ) Induction base n = 0 : partial - vector - sum returns ( vector - ref v 0 ) = v(0 ) ,
which exists because 0 < length(v ) , and sum from i = 0 to 0 of v(i ) = v(0 ) .
2 ) Induction step n > 0 : Assume that partial - vector - sum is correct for n.
|
45a33a5cf49a469bad1ef4d1d3610580166f6c6593ffdb9d840d92a64faccd98 | keigoi/caramel-mpst | core.erl | Source code generated with Caramel .
-module(core).
-export_type([result/2]).
-type result(Ok, Err) :: {ok, Ok}
| {error, Err}
.
| null | https://raw.githubusercontent.com/keigoi/caramel-mpst/20551cdcc20c9a64e42bb5bd8ba313bd5952b6b7/stdlib/core.erl | erlang | Source code generated with Caramel .
-module(core).
-export_type([result/2]).
-type result(Ok, Err) :: {ok, Ok}
| {error, Err}
.
| |
17b303d99adb613a12a3a76d049bd12d03fe3cb9f8a047e913fd77bae7764963 | dgiot/dgiot | dgiot_device_app.erl | -module(dgiot_device_app).
-emqx_plugin(?MODULE).
-behaviour(application).
-include("dgiot_device.hrl").
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
{ok, Sup} = dgiot_device_sup:start_link(),
dgiot_protocol:start(),
start_hook(),
{ok, Sup}.
stop(_State) ->
stop_hook(),
ok... | null | https://raw.githubusercontent.com/dgiot/dgiot/a6b816a094b1c9bd024ce40b8142375a0f0289d8/apps/dgiot_device/src/dgiot_device_app.erl | erlang | -module(dgiot_device_app).
-emqx_plugin(?MODULE).
-behaviour(application).
-include("dgiot_device.hrl").
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
{ok, Sup} = dgiot_device_sup:start_link(),
dgiot_protocol:start(),
start_hook(),
{ok, Sup}.
stop(_State) ->
stop_hook(),
ok... | |
71fb770f1e68a0392a7bc8e554814eeb59a84c69b0a867f29f5a97344b847a70 | yoriyuki/Camomile | dune_gen.ml | let locales =
Sys.readdir "."
|> Array.to_list
|> List.filter (fun f -> Filename.check_suffix f ".txt")
|> List.map Filename.chop_extension
|> List.sort compare
let file locale = Printf.sprintf "(%s.mar as locales/%s.mar)" locale locale
let rule locale = Printf.sprintf {|
(rule
(targets %s.mar)
(deps (... | null | https://raw.githubusercontent.com/yoriyuki/Camomile/d7d8843c88fae774f513610f8e09a613778e64b3/Camomile/locales/dune_gen.ml | ocaml | let locales =
Sys.readdir "."
|> Array.to_list
|> List.filter (fun f -> Filename.check_suffix f ".txt")
|> List.map Filename.chop_extension
|> List.sort compare
let file locale = Printf.sprintf "(%s.mar as locales/%s.mar)" locale locale
let rule locale = Printf.sprintf {|
(rule
(targets %s.mar)
(deps (... | |
f32314397f1ba4c6970b011e2e288cbf9e9d157a96ac20014eee598404855647 | IBM/probzelus | normalize.ml |
* Copyright 2018 - 2020 IBM Corporation
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writin... | null | https://raw.githubusercontent.com/IBM/probzelus/3bdd60e3c4010452239bfe7bc79165802e5d941b/probzelus/inference/normalize.ml | ocaml | * [histogram_of_array l] create a histogram from an array of values.
XXX TODO: look if we can share marshaling with copy XXX
* [normalize values] creates a distribution corresponding to the
array of values [values].
(probabilities,
Distribution.Dist_support
* [resample copy size probabilities states] resam... |
* Copyright 2018 - 2020 IBM Corporation
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writin... |
3ec723fe94d1efd9f2b5717e75773c1b447167266a201d40dc9e96b25d596dee | venantius/pyro | printer.clj | (ns pyro.printer
(:require [clj-stacktrace.repl :as repl]
[clojure.repl]
[clojure.stacktrace :as st]
[pyro.source :as source]
[pyro.stacktrace :as stacktrace]
[pyro.stacktrace.element :as element])
(:import [clojure.lang RT]))
(defonce options (atom nil))... | null | https://raw.githubusercontent.com/venantius/pyro/8f71aa054f7d54d38be090c3a78b4843e4e6b0ca/src/pyro/printer.clj | clojure | REPL
the variable bindings. | (ns pyro.printer
(:require [clj-stacktrace.repl :as repl]
[clojure.repl]
[clojure.stacktrace :as st]
[pyro.source :as source]
[pyro.stacktrace :as stacktrace]
[pyro.stacktrace.element :as element])
(:import [clojure.lang RT]))
(defonce options (atom nil))... |
cf018e5ff25600d8afa5a511a789ca19d2153567b1b31fa160be99b9a4cf256a | v-kolesnikov/sicp | 2_76.clj | (ns sicp.chapter02.2-76)
| null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/src/sicp/chapter02/2_76.clj | clojure | (ns sicp.chapter02.2-76)
| |
7927689c6cd8dc9b3320c04a6e979032bb8d7f1f830b37940e7045e5a107a578 | kpreid/e-on-cl | float.lisp | Copyright 2005 - 2009 , under the terms of the MIT X license
found at ................
(in-package :e.elib)
;;; --- Vtables ---
(def-vtable float
(:|__printOn| (this (tw +the-text-writer-guard+))
(e. tw |print|
(with-standard-io-syntax
(let ((*read-default-float-format* 'double-float)
fo... | null | https://raw.githubusercontent.com/kpreid/e-on-cl/f93d188051c66db0ad4ff150bd73b838f7bc25ed/lisp/float.lisp | lisp | --- Vtables ---
--- Float parser ---
cl-yacc executes the action forms a little too soon
XXX this constructs a possibly-big rational before converting to float
eval-when
returns digits structure
returns integer exponent
returns digits structure (integer value and number of digits)
--- Float maker --- | Copyright 2005 - 2009 , under the terms of the MIT X license
found at ................
(in-package :e.elib)
(def-vtable float
(:|__printOn| (this (tw +the-text-writer-guard+))
(e. tw |print|
(with-standard-io-syntax
(let ((*read-default-float-format* 'double-float)
for clisp
(p... |
c60b901f4c3f19bf4fc5ccda1ea33f321bdb264c2ac6f98d7d3ca56ad35d69ef | polyfy/polylith | project_table.clj | (ns polylith.clj.core.workspace.text-table.project-table
(:require [clojure.set :as set]
[polylith.clj.core.common.interface :as common]
[polylith.clj.core.path-finder.interface.extract :as extract]
[polylith.clj.core.path-finder.interface.status :as status]
[polylith.c... | null | https://raw.githubusercontent.com/polyfy/polylith/adb8617af2df33361e9eb5715693b5c8a08e0b43/components/workspace/src/polylith/clj/core/workspace/text_table/project_table.clj | clojure | (ns polylith.clj.core.workspace.text-table.project-table
(:require [clojure.set :as set]
[polylith.clj.core.common.interface :as common]
[polylith.clj.core.path-finder.interface.extract :as extract]
[polylith.clj.core.path-finder.interface.status :as status]
[polylith.c... | |
9c2623e93d44ce90d8a31ab505c1743ed555ac65b4fe2ab779575339f7df5b57 | NorfairKing/cursor | Tree.hs | # LANGUAGE TypeFamilies #
module Cursor.Simple.Tree
( TreeCursor,
TreeAbove (..),
singletonTreeCursor,
makeTreeCursor,
TC.makeNodeTreeCursor,
makeTreeCursorWithSelection,
rebuildTreeCursor,
TC.drawTreeCursor,
mapTreeCursor,
TC.treeCursorAboveL,
TC.treeCursorCurrentL,
TC.tr... | null | https://raw.githubusercontent.com/NorfairKing/cursor/ff27e78281430c298a25a7805c9c61ca1e69f4c5/cursor/src/Cursor/Simple/Tree.hs | haskell | | Go back and down as far as necessary to find a previous element on a level below
| Go up as far as necessary to find a next element on a level above and forward
Note: This will fail if there is a next node on the same level or any node below the current node | # LANGUAGE TypeFamilies #
module Cursor.Simple.Tree
( TreeCursor,
TreeAbove (..),
singletonTreeCursor,
makeTreeCursor,
TC.makeNodeTreeCursor,
makeTreeCursorWithSelection,
rebuildTreeCursor,
TC.drawTreeCursor,
mapTreeCursor,
TC.treeCursorAboveL,
TC.treeCursorCurrentL,
TC.tr... |
1e80a55f824c2225b9a4320302b803dda3e0ada65ee9c4ffe7e33ddbda11e19d | eamsden/Animas | AFRPTestsCommon.hs | $ I d : AFRPTestsCommon.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... | null | https://raw.githubusercontent.com/eamsden/Animas/2404d1de20982a337109fc6032cb77b022514f9d/tests/AFRPTestsCommon.hs | haskell | ----------------------------------------------------------------------------
Rough equality with instances
----------------------------------------------------------------------------
Rough equality. Only intended to be good enough for test cases in this
module.
A relative measure should be used.
A relative measur... | $ I d : AFRPTestsCommon.hs , v 1.2 2003/11/10 21:28:58 antony Exp $
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... |
b6f63b32b3125d9caea196f9b56639fb92797b3b1511d866473bf777355f7724 | zotonic/z_stdlib | z_string.erl | -*- coding : utf-8 ; Mode : erlang ; tab - width : 4 ; c - basic - offset : 4 ; indent - tabs - mode : nil -*-
ex : set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding = utf-8 :
coding : utf-8
@author < >
2009 - 2020
%% @doc String related functions
@todo Check valid chars for filenames ... | null | https://raw.githubusercontent.com/zotonic/z_stdlib/91a4c3aec85fe50218037906f5ce043eb7c97a0f/src/z_string.erl | erlang | @doc String related functions
Kangxi Radicals: Range 2F00-2FDF
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or i... | -*- coding : utf-8 ; Mode : erlang ; tab - width : 4 ; c - basic - offset : 4 ; indent - tabs - mode : nil -*-
ex : set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding = utf-8 :
coding : utf-8
@author < >
2009 - 2020
@todo Check valid chars for filenames , allow chinese , japanese , etc ... |
d438c2d4155ffb9896f16872e6190614c3ca6f0cb2b51c3c4874d54dc7a182d8 | w01fe/Clojure-traits | example.clj | (ns example
(:require [w01fe.traits :as traits]))
(defprotocol Counter
(inc! [c x] "Increment count and return old value"))
(traits/deftrait SimpleCounter [inc] [count-atom (atom inc)] []
Counter
(inc! [c x] (let [old @count-atom] (swap! count-atom + x) old)))
(defprotocol Multiplier
(mul! [c x] "Multiply ... | null | https://raw.githubusercontent.com/w01fe/Clojure-traits/bea500be69e839beac27bf214cb4b48aea59cc99/src/example.clj | clojure | #'user/x | (ns example
(:require [w01fe.traits :as traits]))
(defprotocol Counter
(inc! [c x] "Increment count and return old value"))
(traits/deftrait SimpleCounter [inc] [count-atom (atom inc)] []
Counter
(inc! [c x] (let [old @count-atom] (swap! count-atom + x) old)))
(defprotocol Multiplier
(mul! [c x] "Multiply ... |
382489312efd30ae955adc324fb402160e15b88d353e58def87ff9eadfb28c31 | mnxn/vscode_jsoo | vscode.mli | open Interop
module Disposable : sig
type t = private (* class *) Ojs.t
val from : (t list[@js.variadic]) -> t [@@js.global]
val make : dispose:(unit -> unit) -> t [@@js.new "vscode.Disposable"]
val dispose : t -> unit [@@js.call]
end [@js.scope "vscode.Disposable"]
module Command : sig
type t = private ... | null | https://raw.githubusercontent.com/mnxn/vscode_jsoo/b34c9444ebbabc7757dd8545b90929d4a20ec352/vscode.mli | ocaml | class
interface
class
class
interface
class
class
interface
interface
class extends
interface
interface
interface
class
class
interface
interface
interface
interface
class
interface
interface
interface
interface
interface
interface
interface
interface
interface
i... | open Interop
module Disposable : sig
val from : (t list[@js.variadic]) -> t [@@js.global]
val make : dispose:(unit -> unit) -> t [@@js.new "vscode.Disposable"]
val dispose : t -> unit [@@js.call]
end [@js.scope "vscode.Disposable"]
module Command : sig
val title : t -> string [@@js.get]
val command : t... |
641110283c38fe2c31620711bd9db9b91797ab970d559e925bdf96dca4bbab6b | cabol/oauth2_mnesia_backend | oauth2_example_util.erl | -module(oauth2_example_util).
%% API
-export([keyfind/2, keyfind/3]).
-export([enc_json/1, dec_json/1]).
-export([handle_exception/3]).
%% Types
-type tuplist() :: [{any(), any()}].
-type json() :: #{} | [#{}] | binary() | number() | boolean() | null.
%%%===========================================================... | null | https://raw.githubusercontent.com/cabol/oauth2_mnesia_backend/9127536f43a6f076ef5cd5458eb052c685ef0e89/examples/oauth2_example/src/oauth2_example_util.erl | erlang | API
Types
===================================================================
API
===================================================================
@doc Calls keyfind/3 with Default = undefined.
compares equal to Key. Returns Tuple's value if such a tuple is
=================================================... | -module(oauth2_example_util).
-export([keyfind/2, keyfind/3]).
-export([enc_json/1, dec_json/1]).
-export([handle_exception/3]).
-type tuplist() :: [{any(), any()}].
-type json() :: #{} | [#{}] | binary() | number() | boolean() | null.
-spec keyfind(any(), tuplist()) -> any().
keyfind(Key, TupleList) ->
keyfin... |
cf02bc61af30f79bbebb18230fe728f6ba92919b401e6e31529b5c497287f28b | andrewberls/predis | server_test.clj | (ns predis.server-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
(clojure.test.check
[clojure-test :refer [defspec]]
[generators :as gen]
[properties :as prop])
[taoensso.carmine :as carmine]
(predis
... | null | https://raw.githubusercontent.com/andrewberls/predis/9479323a757dc73ee5101c4904b6bd7ef742aed6/test/predis/server_test.clj | clojure | (ns predis.server-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
(clojure.test.check
[clojure-test :refer [defspec]]
[generators :as gen]
[properties :as prop])
[taoensso.carmine :as carmine]
(predis
... | |
ac6c75e62e9b5deb30074945ebb1a66c9394f45095f83b7d22ddb194b5721629 | rrnewton/haskell-lockfree | Reference.hs | # LANGUAGE TypeFamilies , CPP , BangPatterns #
|
A strawman implementation of concurrent Dequeues . This
implementation is so simple that it also makes a good reference
implementation for debugging .
The queue representation is simply an IORef containing a Data . Sequence .
Also see " Data . Co... | null | https://raw.githubusercontent.com/rrnewton/haskell-lockfree/87122157cbbc96954fcc575b4b110003d3e5c2f8/abstract-deque/Data/Concurrent/Deque/Reference.hs | haskell | Toggle these and compare performance:
# UNPACK #
Here we are very strict to avoid stack leaks.
-- This simplistic version simply spins:
popR q = do x <- tryPopR q
case x of
Nothing -> popR q
Just x -> return x
popL q = do x <- tryPopL q
case x of
... | # LANGUAGE TypeFamilies , CPP , BangPatterns #
|
A strawman implementation of concurrent Dequeues . This
implementation is so simple that it also makes a good reference
implementation for debugging .
The queue representation is simply an IORef containing a Data . Sequence .
Also see " Data . Co... |
a5737076ad05fcadac038d2fd63961dd3e48f08ca75106c432871e23a91d72b0 | hopv/MoCHi | quadruple.ml | open Util
*
let make x1 x2 x3 x4 = (x1, x2, x3, x4)
let of_list [x1; x2; x3; x4] = (x1, x2, x3, x4)
let list_of (x1, x2, x3, x4) = [x1; x2; x3; x4]
let fst (x1, x2, x3, x4) = x1
let snd (x1, x2, x3, x4) = x2
let trd (x1, x2, x3, x4) = x3
let fth (x1, x2, x3, x4) = x4
let get12 (x1, x2, x3, x4) = (x1, x2)
let get1... | null | https://raw.githubusercontent.com/hopv/MoCHi/b0ac0d626d64b1e3c779d8e98cb232121cc3196a/fpat/quadruple.ml | ocaml | open Util
*
let make x1 x2 x3 x4 = (x1, x2, x3, x4)
let of_list [x1; x2; x3; x4] = (x1, x2, x3, x4)
let list_of (x1, x2, x3, x4) = [x1; x2; x3; x4]
let fst (x1, x2, x3, x4) = x1
let snd (x1, x2, x3, x4) = x2
let trd (x1, x2, x3, x4) = x3
let fth (x1, x2, x3, x4) = x4
let get12 (x1, x2, x3, x4) = (x1, x2)
let get1... | |
b3045b744c486b595b0fea9787d64d243ada6e92bc704f12e949af5f73e8990a | Beluga-lang/Beluga | ord.mli | (** Totally ordered types. *)
(** Module type for totally ordered types. *)
module type ORD = sig
(** The type of elements to compare. *)
type t
(** [compare a b] compares [a] and [b] for ordering.
- [compare a b < 0] if [a] precedes [b] (denoted [a < b]),
- [compare a b = 0] if [a] is equal to [b]... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/a79833e99cf40befc56a5f09a64c82ee65c81ab0/src/support/ord.mli | ocaml | * Totally ordered types.
* Module type for totally ordered types.
* The type of elements to compare.
* [compare a b] compares [a] and [b] for ordering.
- [compare a b < 0] if [a] precedes [b] (denoted [a < b]),
- [compare a b = 0] if [a] is equal to [b] (denoted [a = b]),
- [compare a b > 0] if [a... |
module type ORD = sig
type t
val compare : t -> t -> int
val ( < ) : t -> t -> bool
val ( <= ) : t -> t -> bool
val ( > ) : t -> t -> bool
val ( >= ) : t -> t -> bool
val max : t -> t -> t
val min : t -> t -> t
include Eq.EQ with type t := t
end
* Functor building an implementation of { ! }... |
092b88924a153b8b7ea763e511c462d9a0dc25aaa37f60f77c3c6c0fc2a84d4a | glguy/5puzzle | Domino.hs | module Main where
import Ersatz
import SparseMap
import Select
import Booleans
import Data.List ((\\))
import Prelude hiding ((&&), (||), or, not)
import System.Environment
import Diagrams.Prelude (Diagram, lw, translate, square, ultraThick, scale, fromVertices, mkSizeSpec)
import Diagrams.Backend.SVG (B, renderSVG... | null | https://raw.githubusercontent.com/glguy/5puzzle/4d86cf9fad3ec3f70c57a167417adea6a3f9f30b/Domino.hs | haskell | row column
----------------------------------------------------------------------
Piece representation
----------------------------------------------------------------------
coordinates covered by piece
----------------------------------------------------------------------
Board locations and piece possibilities
--... | module Main where
import Ersatz
import SparseMap
import Select
import Booleans
import Data.List ((\\))
import Prelude hiding ((&&), (||), or, not)
import System.Environment
import Diagrams.Prelude (Diagram, lw, translate, square, ultraThick, scale, fromVertices, mkSizeSpec)
import Diagrams.Backend.SVG (B, renderSVG... |
b8bdd3841a1ab5fb57064f03cfd2cb307e95018d8792bdf22ed1aa8f2820549a | nuprl/gradual-typing-performance | htdp-intermediate-reader.rkt | (module htdp-intermediate-reader mzscheme
(require "htdp-reader.ss")
(provide (rename -read-syntax read-syntax)
(rename -read read))
(define -read-syntax (make-read-syntax '(lib "htdp-intermediate.ss" "lang")))
(define -read (make-read '(lib "htdp-intermediate.ss" "lang"))))
| null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/htdp-lib/lang/htdp-intermediate-reader.rkt | racket | (module htdp-intermediate-reader mzscheme
(require "htdp-reader.ss")
(provide (rename -read-syntax read-syntax)
(rename -read read))
(define -read-syntax (make-read-syntax '(lib "htdp-intermediate.ss" "lang")))
(define -read (make-read '(lib "htdp-intermediate.ss" "lang"))))
| |
48a708018111c6afa20f17d8ef1ced20f82aa70c76307d9d59845f834aebd06d | lspitzner/exference | FunctionDecl.hs | # LANGUAGE PatternGuards #
module Language.Haskell.Exference.FunctionDecl
( HsFunctionDecl
, RatedHsFunctionDecl
, declToBinding
)
where
import Language.Haskell.Exference.Core.FunctionBinding
import Language.Haskell.Exference.Core.Types
import Language.Haskell.Exference.Core.TypeUtils
import Language.Haskel... | null | https://raw.githubusercontent.com/lspitzner/exference/d8a336f8b9df905e54173339f78ba892daa3f688/src/Language/Haskell/Exference/FunctionDecl.hs | haskell | name, rating, type | # LANGUAGE PatternGuards #
module Language.Haskell.Exference.FunctionDecl
( HsFunctionDecl
, RatedHsFunctionDecl
, declToBinding
)
where
import Language.Haskell.Exference.Core.FunctionBinding
import Language.Haskell.Exference.Core.Types
import Language.Haskell.Exference.Core.TypeUtils
import Language.Haskel... |
382a9463f9729ebb78c0fd46828f0b887361921b884a6bb10666b187c017a562 | facebook/infer | annotations.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/abf564942dee42011fbfc7311df4fb623a5410c8/infer/src/absint/annotations.ml | ocaml | * Annotations.
* [annot_ends_with annot ann_name] returns true if the class name of [annot], without the package,
is equal to [ann_name]
here, [class_name] ends with [ann_name] but it could be that it's just a suffix
of the last dot-component of [class_name], eg [class_name="x.y.z.a.bcd"] and
[ann_name... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
02f9943a6232f7d2ec5f4b58c57db80d49c46c20c9cc4d5a063b3f7ecc9f0742 | gethop-dev/hop-cli | dictionaries.cljc | 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 /
{{=<< >>=}}
(ns <<project.name>>.shared.localization.dictionaries
(:require [<<project.name>>.shared.localization.dictionaries.en :as dictiona... | null | https://raw.githubusercontent.com/gethop-dev/hop-cli/c7b848915ff268aa41ff9a61a62c614f58ecbeb9/resources/bootstrap/profiles/frontend/app/src/%7B%7Bproject.files-name%7D%7D/shared/localization/dictionaries.cljc | clojure | file, You can obtain one at / | 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
{{=<< >>=}}
(ns <<project.name>>.shared.localization.dictionaries
(:require [<<project.name>>.shared.localization.dictionaries.en :as dictionaries.en]))
(def dictionaries
{... |
f3c8bdd0d0d9be8f0261211805bd1c33ba882838ff1fd42446778416a268b8ef | itsrainingmani/learn-clojure-in-public | 4clojure-medium.clj | (ns foreclj-medium
(:gen-class)
(:require
[clojure.repl :as repl]))
No . 43 Reverse Interleave
;; Write a function which reverses the interleave process into x number of subsequences.
(fn [s n]
(map
(fn [i] (map #(nth % i) (partition n n s)))
(range n)))
No . 44 Rotate Sequence
;; Write a funct... | null | https://raw.githubusercontent.com/itsrainingmani/learn-clojure-in-public/a02477e6a4129a12c66734cfa35f2b0e07d03792/code/katas/4clojure-medium.clj | clojure | Write a function which reverses the interleave process into x number of subsequences.
Write a function which can rotate a sequence in either direction.
=> (:c :a :b)
Write a function which takes a sequence consisting of items with different types and splits them up into a set of homogeneous sub-sequences. The inter... | (ns foreclj-medium
(:gen-class)
(:require
[clojure.repl :as repl]))
No . 43 Reverse Interleave
(fn [s n]
(map
(fn [i] (map #(nth % i) (partition n n s)))
(range n)))
No . 44 Rotate Sequence
(defn seq-rotate
[n s]
(let [m (mod n (count s))]
(->> s
(split-at m)
reverse
... |
a006a860dd6f6d88ebcd185fea1350ccd895a4e4d26a8c204d4b5c7306178e81 | fragnix/fragnix | Control.Exception.Base.hs | {-# LINE 1 "Control.Exception.Base.hs" #-}
# LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , MagicHash #
# LANGUAGE StandaloneDeriving #
-----------------------------------------------------------------------------
-- |
-- Module : Control.Exception.Base
Copyright : ( c ) The University of Glasgow 2... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/builtins/base/Control.Exception.Base.hs | haskell | # LINE 1 "Control.Exception.Base.hs" #
---------------------------------------------------------------------------
|
Module : Control.Exception.Base
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (extended exceptions)
... | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , MagicHash #
# LANGUAGE StandaloneDeriving #
Copyright : ( c ) The University of Glasgow 2001
module Control.Exception.Base (
SomeException(..),
Exception(..),
IOException,
ArithException(..),
ArrayException(..),
... |
d9a56e80889309647acb9176de95e7a4c1682b3ad3014e02c8205bbe6e2dc704 | korya/efuns | longident.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/ocamlsrc/compat/2.04/include/longident.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : longident.mli , v 1.1 2000/05... |
52cb35a1f303fd963669701ef4c484751d0fdd9aa346cc7fa8472b10eecbbc16 | GlideAngle/flare-timing | Double.hs | # OPTIONS_GHC -fno - warn - orphans #
module Flight.Mask.Distance.Double () where
import Prelude hiding (span)
import Data.Time.Clock (UTCTime)
import Data.List (inits)
import Data.UnitsOfMeasure ((-:), u)
import Flight.Units ()
import Flight.Clip (FlyCut(..), FlyClipping(..))
import Flight.Distance (PathDistance(..... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/34873946be9b93c37048ed118ef5b4649c71d630/lang-haskell/mask/library/Flight/Mask/Distance/Double.hs | haskell | ^ Nothing indicates no such task or a task with no zones.
NOTE: A ghci session using inits & tails.
[[],[1],[1,2],[1,2,3],[1,2,3,4]]
[[1,2,3,4],[2,3,4],[3,4],[4],[]]
[[1],[1,2],[1,2,3],[1,2,3,4]]
^ Nothing indicates no such task or a task with no zones.
^ Nothing indicates no such task or a task with no zones... | # OPTIONS_GHC -fno - warn - orphans #
module Flight.Mask.Distance.Double () where
import Prelude hiding (span)
import Data.Time.Clock (UTCTime)
import Data.List (inits)
import Data.UnitsOfMeasure ((-:), u)
import Flight.Units ()
import Flight.Clip (FlyCut(..), FlyClipping(..))
import Flight.Distance (PathDistance(..... |
33b7fcd76f466d9bcf481d03a4ec1fafdb10f1ac86925a24dc18f8c06d58a140 | ml4tp/tcoq | merge.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/plugins/funind/merge.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Merging of induction principles.
*... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Globnames
open Tactics
... |
443aebeb3a896803bd01329f73d8945c99f7fd92589f0acc2e61d26b1380012d | cyga/real-world-haskell | C.hs | file : ch25 / C.hs
mean :: [Double] -> Double
mean xs = s / fromIntegral n
where
(n, s) = foldl' k (0, 0) xs
k (n, s) x = (n+1, s+x)
| null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch25/C.hs | haskell | file : ch25 / C.hs
mean :: [Double] -> Double
mean xs = s / fromIntegral n
where
(n, s) = foldl' k (0, 0) xs
k (n, s) x = (n+1, s+x)
| |
9aa17e5a8da2949ca54bf5af0a0df1fbb4775c1d1a139fdc59cb1dc3d4baca90 | robert-strandh/SICL | ensure-class-using-class.lisp | (cl:in-package #:sicl-clos)
;;; For the specification of this generic function, see
;;; -MOP/ensure-class-using-class.html
(defgeneric ensure-class-using-class
(class
name
&rest keys
&key
direct-default-initargs
direct-slots
direct-superclasses
metaclass
&allow-oth... | null | https://raw.githubusercontent.com/robert-strandh/SICL/b40680a635b6d2a443565e6c1aaadb538e6f54a7/Code/CLOS/ensure-class-using-class.lisp | lisp | For the specification of this generic function, see
-MOP/ensure-class-using-class.html
ENSURE-CLASS is called from code resulting from the macroexpansion
from user code. This means that we have to be careful about
default values of initialization arguments.
options given proper defaults. If the class already e... | (cl:in-package #:sicl-clos)
(defgeneric ensure-class-using-class
(class
name
&rest keys
&key
direct-default-initargs
direct-slots
direct-superclasses
metaclass
&allow-other-keys))
of a macro call to , but it can also be called directly
When is used , it is i... |
d8c7434e936eeca2d6e51e3a00a0714182778140b4a9b19cd906dfc064e32025 | pgj/mirage-kfreebsd | udp.mli |
* Copyright ( c ) 2010 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/pgj/mirage-kfreebsd/0ff5b2cd7ab0975e3f2ee1bd89f8e5dbf028b102/packages/mirage-net/lib/udp.mli | ocaml |
* Copyright ( c ) 2010 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
f209bf3a848771e2696be2d967c6345156e4e1102198d36667a1021b459bab37 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PostIssuingDisputesDisputeSubmit.hs | {-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the different functions to run the operation postIssuingDisputesDisputeSubmit
m... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Operations/PostIssuingDisputesDisputeSubmit.hs | haskell | # LANGUAGE ExplicitForAll #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the different functions to run the operation postIssuingDisputesDisputeSubmit
| > POST /v1/issuing/disputes/{dispute}/submit
\<p>Submits an Issuing \<code>Dispute\<\/code> to the card network. Stripe validates that all evi... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Operations.PostIssuingDisputesDisputeSubmit where
import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
import quali... |
9c33b8f26eec405286333291b2b20a774b357b3d1adda056e83004e652ddd4b4 | open-telemetry/opentelemetry-erlang | otel_observable_counter.erl | %%%------------------------------------------------------------------------
Copyright 2019 , OpenTelemetry Authors
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unl... | null | https://raw.githubusercontent.com/open-telemetry/opentelemetry-erlang/0c52e7136170e06c91d5b842340d657e1bda9669/apps/opentelemetry_api_experimental/src/otel_observable_counter.erl | erlang | ------------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o... | Copyright 2019 , OpenTelemetry Authors
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(otel_observable_counter).
-export([create/5]).
create(Meter, Name, Callback, CallbackArgs, Opts) ->
otel_meter:create_obse... |
ef4bb299334d2195fe38d9e94e22d1402ad2ef95db32f8865de54e1eac5e35f2 | archaelus/erms | esvc_voucher.erl | %%%-------------------------------------------------------------------
@copyright Catalyst IT Ltd ( )
%%%
@author < >
%% @version {@vsn}, {@date} {@time}
%% @doc Voucher parsing code for adding vouchers to 018 SMS messages.
%% @end
%%%-------------------------------------------------------------------
-module(e... | null | https://raw.githubusercontent.com/archaelus/erms/5dbe5e79516a16e461e7a2a345dd80fbf92ef6fa/src/esvc_voucher.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
@doc Voucher parsing code for adding vouchers to 018 SMS messages.
@end
-------------------------------------------------------------------
API
====================================================================
... | @copyright Catalyst IT Ltd ( )
@author < >
-module(esvc_voucher).
-include_lib("eunit/include/eunit.hrl").
-include_lib("logging.hrl").
-include_lib("mnesia_model.hrl").
-include_lib("esvc_voucher.hrl").
-export([process_mt/2]).
-export([process_campaign/3]).
, Options ) - > term ( )
# msg { }
@... |
f169a4ed6aca32a98eef7b8086312b4a000cc21bbe1f0ba4f177dfaa2d5a18c8 | nasa/Common-Metadata-Repository | permission_check_test.clj | (ns cmr.access-control.int-test.permission-check-test
"Tests the access control permission check routes."
(:require
[cheshire.core :as json]
[clj-http.client :as client]
[clj-time.core :as t]
[clojure.string :as string]
[clojure.test :refer :all]
[cmr.access-control.int-test.fixtures :as fixtures]... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/be667586b339415aa68dd91209d80ab565a4d5e9/access-control-app/int-test/cmr/access_control/int_test/permission_check_test.clj | clojure | Provider target and provider not both present
helper for easily creating a group, returns concept id
then create a group that contains our user, so we can find collections that grant access to this user
create some collections
local helpers to make the body of the test cleaner
invalid revision-id
collection with... | (ns cmr.access-control.int-test.permission-check-test
"Tests the access control permission check routes."
(:require
[cheshire.core :as json]
[clj-http.client :as client]
[clj-time.core :as t]
[clojure.string :as string]
[clojure.test :refer :all]
[cmr.access-control.int-test.fixtures :as fixtures]... |
9202d0f1a6c98d117affe428422d7f0a461cb21d36438bfc786a4f9be277dec2 | replomancer/Swordfight | rules_test.clj | (ns swordfight.rules-test
(:require [midje.sweet :refer [facts fact contains just truthy falsey]]
[swordfight.board :refer [white black ->board
white-pawn black-pawn white-queen
white-king black-knight]]
[swordfight.ru... | null | https://raw.githubusercontent.com/replomancer/Swordfight/4ac956d0c9076792774dd05db3f258a8c713c49c/test/swordfight/rules_test.clj | clojure | "How many moves are generated. Compare against known values."
TODO:
- Improve the test speed | (ns swordfight.rules-test
(:require [midje.sweet :refer [facts fact contains just truthy falsey]]
[swordfight.board :refer [white black ->board
white-pawn black-pawn white-queen
white-king black-knight]]
[swordfight.ru... |
cb9fd2d17f8ecff27081bf2ff1ea86ecb921b86ba2e577f758b97816aea51d49 | PacktWorkshops/The-Clojure-Workshop | core.clj | (ns books-app.core
(:require [books-app.utils :as utils])
(:import [java.util Scanner])
(:gen-class))
(def input (Scanner. System/in))
(def ^:const orders-file "orders.edn")
(def ^:const books {:2019 {:clojure {:title "Hands-On Reactive Programming with Clojure" :price 20}
:go {... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter09/Activity9.01/books-app/src/books_app/core.clj | clojure | (ns books-app.core
(:require [books-app.utils :as utils])
(:import [java.util Scanner])
(:gen-class))
(def input (Scanner. System/in))
(def ^:const orders-file "orders.edn")
(def ^:const books {:2019 {:clojure {:title "Hands-On Reactive Programming with Clojure" :price 20}
:go {... | |
50d73d17c52ff0225e71406917e0f109eea4dbf6a31d4bb69e1d845b0dde488d | jaspervdj/advent-of-code | 08.hs | module Main where
import AdventOfCode.Main (pureMain)
import qualified AdventOfCode.NanoParser as P
import Control.Applicative (many)
import Control.Monad (forM, guard)
import Data.Char (toUpper)
import Data.Foldable (foldl')... | null | https://raw.githubusercontent.com/jaspervdj/advent-of-code/93258c0ba8c72c8c8b2efa79410eb6e6017db201/2021/08.hs | haskell | | Original configuration
Count how many times a segment occurs in all patterns, grouped by size.
These counts must match for equivalent patterns from the display and
the input. | module Main where
import AdventOfCode.Main (pureMain)
import qualified AdventOfCode.NanoParser as P
import Control.Applicative (many)
import Control.Monad (forM, guard)
import Data.Char (toUpper)
import Data.Foldable (foldl')... |
cfc0b33dd026bed1a10893533a060668bbcbe5a8ede27f51717f9d32d21b2c16 | tolysz/prepare-ghcjs | Typed.hs | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import qualified Typed.Generic as Generic
import qualified Typed.Manual as Manual
import qualified Typed.TH as TH
main :: IO ()
main = defaultMain [
Generic.benchmarks
, Manual.benchmarks
, TH.benchmarks
]
| null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts8/aeson/benchmarks/Typed.hs | haskell | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import qualified Typed.Generic as Generic
import qualified Typed.Manual as Manual
import qualified Typed.TH as TH
main :: IO ()
main = defaultMain [
Generic.benchmarks
, Manual.benchmarks
, TH.benchmarks
]
| |
0c8c43901e82b903d9c5e0c6afd5f5ba9fb2e384a7d21c131d7496f61a88cf08 | larrychristensen/orcpub | party.clj | (ns orcpub.dnd.e5.party
(:require [clojure.spec.alpha :as spec]))
(spec/def ::name string?)
(spec/def ::character-id int?)
(spec/def ::character-ids (spec/coll-of ::character-id))
(spec/def ::party (spec/keys :req [::name ::character-ids]))
| null | https://raw.githubusercontent.com/larrychristensen/orcpub/e83995857f7e64af1798009a45a0b03abcd3a4be/src/cljc/orcpub/dnd/e5/party.clj | clojure | (ns orcpub.dnd.e5.party
(:require [clojure.spec.alpha :as spec]))
(spec/def ::name string?)
(spec/def ::character-id int?)
(spec/def ::character-ids (spec/coll-of ::character-id))
(spec/def ::party (spec/keys :req [::name ::character-ids]))
| |
bd616f0b274e5c37c0999e3960fe0ac1b800acd69dd295f6c461f49b35a97a5f | anton-k/processing-for-haskell | Data.hs | | We can use ordinary data types , like floats , booleans and strings .
module Graphics.Proc.Lib.Data(
module X
) where
import Graphics.Proc.Lib.Data.Conversion as X
| null | https://raw.githubusercontent.com/anton-k/processing-for-haskell/7f99414f3c266135b6a2848978fcb572fd7b67b1/src/Graphics/Proc/Lib/Data.hs | haskell | | We can use ordinary data types , like floats , booleans and strings .
module Graphics.Proc.Lib.Data(
module X
) where
import Graphics.Proc.Lib.Data.Conversion as X
| |
34fada84aed4e711c3cd906eeb027a6b4d9d557143cad39bf186cff166e2fa66 | tommaisey/aeon | context.scm | ;; -*- geiser-scheme-implementation: chez-*-
(library (context)
(export
context?
make-context
make-empty-context
context-event
context-events-next
context-events-prev
context-arc
context-chain
context-start
context-end
context-now
context-insert
context-with-events
... | null | https://raw.githubusercontent.com/tommaisey/aeon/12e8ff92bd5efed2923aecf974fa12d39835abc6/libs/context.scm | scheme | -*- geiser-scheme-implementation: chez-*-
---------------------------------------------
A context represents an arc of time, the events inside that arc, and
- events-next contains the current 'cursor' event and the following events.
- events-prev contains the previous events in reverse order.
Iteration consists ... | (library (context)
(export
context?
make-context
make-empty-context
context-event
context-events-next
context-events-prev
context-arc
context-chain
context-start
context-end
context-now
context-insert
context-with-events
context-replace-event
context-with-ar... |
2df687d18a0a515e2a7981cfde8bca7b9bca50d7a7ed010cd5b7bbdfae229cac | kosmikus/multirec | SingleUse.hs | {-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE GADTs #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
module SingleUse where
import Generics.MultiRec.Base
import Single
-- * Instantiating the librar... | null | https://raw.githubusercontent.com/kosmikus/multirec/10ea901f0e1067bbe3632b1fab34103c83eeff0f/examples/SingleUse.hs | haskell | # LANGUAGE EmptyDataDecls #
# LANGUAGE TypeOperators #
* Instantiating the library for Logic
** Index type
** Constructors
** Functor encoding
** 'El' instance
** 'Fam' instance | # LANGUAGE GADTs #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module SingleUse where
import Generics.MultiRec.Base
import Single
data LogicF :: * -> * where
Logic :: LogicF Logic
data Var
instance Constructor Var where conName ... |
1e65c04800553ad60461de4ac25ecb25bc691c0122c5ca4d313176110675cef2 | mikera/core.matrix | ndarray_magic.clj | (ns clojure.core.matrix.impl.ndarray-magic
(:refer-clojure :exclude [vector?])
(:require [clojure.walk :as w]
[clojure.core.matrix.implementations :as imp]
[clojure.core.matrix.utils :as u]
[clojure.core.matrix.macros :refer :all]))
(set! *warn-on-reflection* true)
(defn init
... | null | https://raw.githubusercontent.com/mikera/core.matrix/0a35f6e3d6d2335cb56f6f3e5744bfa1dd0390aa/src/main/clojure/clojure/core/matrix/impl/ndarray_magic.clj | clojure | skip if not defined in type table | (ns clojure.core.matrix.impl.ndarray-magic
(:refer-clojure :exclude [vector?])
(:require [clojure.walk :as w]
[clojure.core.matrix.implementations :as imp]
[clojure.core.matrix.utils :as u]
[clojure.core.matrix.macros :refer :all]))
(set! *warn-on-reflection* true)
(defn init
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.