_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 |
|---|---|---|---|---|---|---|---|---|
04c0d86b609a217ab427d9666e72a40c3ffed109c630112cbeacda75c309f788 | ralexstokes/stoken | block.clj | (ns io.stokes.block
(:require [io.stokes.hash :as hash]
[clojure.set :as set]
[clj-time.core :as time]
[clj-time.coerce :as coerce]
[io.stokes.transaction :as transaction])
(:refer-clojure :exclude [hash]))
(def default-halving-frequency
"how many blocks occur sinc... | null | https://raw.githubusercontent.com/ralexstokes/stoken/b88adb36ffa1e9f3099925634eb1f98beb986442/src/io/stokes/block.clj | clojure | milliseconds
find the best chain in a given block tree | (ns io.stokes.block
(:require [io.stokes.hash :as hash]
[clojure.set :as set]
[clj-time.core :as time]
[clj-time.coerce :as coerce]
[io.stokes.transaction :as transaction])
(:refer-clojure :exclude [hash]))
(def default-halving-frequency
"how many blocks occur sinc... |
c80ea9b7b0df7189bcee27c8dd16e767535296f1795c94dcc9324ba935a76648 | bhauman/advent-of-clojure | day17.clj | (ns advent-2015.day17)
(def prob17 [43 3 4 10 21 44 4 6 47 41 34 17 17 44 36 31 46 9 27 38])
(def p [20, 15, 10, 5, 5])
(def find-combos
(memoize
(fn [target items]
(if (zero? 0)
[[]]
(mapcat
(fn [[x & xs]]
(map #(cons x %)
(find-combos (- target x) xs)))
... | null | https://raw.githubusercontent.com/bhauman/advent-of-clojure/856763baf45bf7bf452ffd304dc1b89f9bc879a6/src/advent-2015/day17.clj | clojure | find the minimum number of containers
find the number of ways that the can be used | (ns advent-2015.day17)
(def prob17 [43 3 4 10 21 44 4 6 47 41 34 17 17 44 36 31 46 9 27 38])
(def p [20, 15, 10, 5, 5])
(def find-combos
(memoize
(fn [target items]
(if (zero? 0)
[[]]
(mapcat
(fn [[x & xs]]
(map #(cons x %)
(find-combos (- target x) xs)))
... |
70aa141e3b0ee94dfa7cd54a0f42048292f2bd2065090a162d1ec2f01743222d | MinaProtocol/mina | nat.mli | * Representation of naturals for
* { 1 Type definitions }
(** [z] is uninhabited *)
type z = Z of z
type 'a s = Z | S of 'a
type _ t = Z : z t | S : 'n t -> 'n s t
type 'a nat = 'a t
type e = T : 'n nat -> e
(** {1 Modules} *)
module type Intf = sig
type n
val n : n t
end
module Adds : sig
type ('a, 'b... | null | https://raw.githubusercontent.com/MinaProtocol/mina/c824be7d80db1d290e0d48cbc920182d07de0330/src/lib/pickles_types/nat.mli | ocaml | * [z] is uninhabited
* {1 Modules} | * Representation of naturals for
* { 1 Type definitions }
type z = Z of z
type 'a s = Z | S of 'a
type _ t = Z : z t | S : 'n t -> 'n s t
type 'a nat = 'a t
type e = T : 'n nat -> e
module type Intf = sig
type n
val n : n t
end
module Adds : sig
type ('a, 'b, 'c) t =
| Z : (z, 'n, 'n) t
| S : (... |
9f03d3a5b577fc063f6cbc6a7d98f93daade86408f2cb04ebb79f0204e3ea0e8 | Clojure2D/clojure2d-examples | camera.clj | (ns rt4.the-next-week.ch05b.camera
(:require [rt4.the-next-week.ch05b.ray :as ray]
[fastmath.vector :as v]
[fastmath.core :as m]
[rt4.common :as common]
[fastmath.random :as r])
(:import [fastmath.vector Vec2]))
(set! *warn-on-reflection* true)
(set! *unchecked-... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05b/camera.clj | clojure | (ns rt4.the-next-week.ch05b.camera
(:require [rt4.the-next-week.ch05b.ray :as ray]
[fastmath.vector :as v]
[fastmath.core :as m]
[rt4.common :as common]
[fastmath.random :as r])
(:import [fastmath.vector Vec2]))
(set! *warn-on-reflection* true)
(set! *unchecked-... | |
b960016dcfe2cc69a054a1956b8a5687838a3fd38ae3c931b74de9a7fe248d75 | kuribas/cubicbezier | Outline.hs | -- | Offsetting bezier curves and stroking curves.
module Geom2D.CubicBezier.Outline
(bezierOffset, bezierOffsetPoint)
where
import Geom2D
import Geom2D.CubicBezier.Basic
import Geom2D.CubicBezier.Approximate
offsetPoint :: (Floating a) => a -> Point a -> Point a -> Point a
offsetPoint dist start tange... | null | https://raw.githubusercontent.com/kuribas/cubicbezier/52da0941ba1deb33c06a2edcfa279bace0e44075/Geom2D/CubicBezier/Outline.hs | haskell | | Offsetting bezier curves and stroking curves.
| Calculate an offset path from the bezier curve to within
tolerance. If the distance is positive offset to the left,
otherwise to the right. A smaller tolerance may require more bezier
curves in the path to approximate the offset curve
^ The curve
^ Offset distan... |
module Geom2D.CubicBezier.Outline
(bezierOffset, bezierOffsetPoint)
where
import Geom2D
import Geom2D.CubicBezier.Basic
import Geom2D.CubicBezier.Approximate
offsetPoint :: (Floating a) => a -> Point a -> Point a -> Point a
offsetPoint dist start tangent =
start ^+^ (rotate90L $* dist *^ normVector t... |
676424a4eda5b99b5fe5caed105fee5efa515f0c6e05c1d8095762609a824cef | haskell-webgear/webgear | Status.hs | # OPTIONS_GHC -Wno - orphans #
| OpenApi implementation of ' Status ' trait .
module WebGear.OpenApi.Trait.Status where
import qualified Network.HTTP.Types as HTTP
import WebGear.Core.Response (Response)
import WebGear.Core.Trait (Linked, Set, setTrait)
import WebGear.Core.Trait.Status (Status (..))
import WebGear.... | null | https://raw.githubusercontent.com/haskell-webgear/webgear/52e90e28d81e4ce6d7c8e63b3f9769f6629b031f/webgear-openapi/src/WebGear/OpenApi/Trait/Status.hs | haskell | # OPTIONS_GHC -Wno - orphans #
| OpenApi implementation of ' Status ' trait .
module WebGear.OpenApi.Trait.Status where
import qualified Network.HTTP.Types as HTTP
import WebGear.Core.Response (Response)
import WebGear.Core.Trait (Linked, Set, setTrait)
import WebGear.Core.Trait.Status (Status (..))
import WebGear.... | |
b125e80db53f577a92e6ed2c61bb4bbf35f64550298c9c668cfb067c9401bff6 | tov/dssl2 | class-posn.rkt | #lang dssl2
# A Posn that can move vertically but is fixed horizontally.
class Posn:
let x_: num?
let y_: num?
def __init__(foo, x, y):
foo.x_ = x
foo.y_ = y
def x(self): self.x_
def _x!(it, nx): it.x_ = nx # private!
def y!(self, ny): self.y_ = ny
def y(bees): bees.y_
... | null | https://raw.githubusercontent.com/tov/dssl2/105d18069465781bd9b87466f8336d5ce9e9a0f3/test/dssl2/class-posn.rkt | racket | #lang dssl2
# A Posn that can move vertically but is fixed horizontally.
class Posn:
let x_: num?
let y_: num?
def __init__(foo, x, y):
foo.x_ = x
foo.y_ = y
def x(self): self.x_
def _x!(it, nx): it.x_ = nx # private!
def y!(self, ny): self.y_ = ny
def y(bees): bees.y_
... | |
b4099fd371df3fb3f90a1842022fadba6295887588548f0d56dda2949dd61c62 | flora-pm/flora-server | Component.hs | # LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
module Flora.Model.Package.Component
( ComponentId (..)
, PackageComponent (..)
, ComponentType (..)
, CanonicalComponent (..)
, ComponentCondition (..)
, ComponentMetadata (..)
, deterministicComponentId
)
where
import Crypto.Hash.MD5 qualified as... | null | https://raw.githubusercontent.com/flora-pm/flora-server/c214c0b5d5db71a8330eb69326284be5a4d5e858/src/core/Flora/Model/Package/Component.hs | haskell | | Data Access Object used to serialise to the DB | # LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
module Flora.Model.Package.Component
( ComponentId (..)
, PackageComponent (..)
, ComponentType (..)
, CanonicalComponent (..)
, ComponentCondition (..)
, ComponentMetadata (..)
, deterministicComponentId
)
where
import Crypto.Hash.MD5 qualified as... |
9f753b26206a7b8d643d06d4819bd0e7f7c6d6973415548eba6e09ebe587967b | g-andrade/fake_lager | lager_msg.erl | -module(lager_msg).
-include("lager.hrl").
%%-------------------------------------------------------------------
%% Function Exports
%%-------------------------------------------------------------------
-export([new/4, new/5]).
-export([message/1]).
-export([timestamp/1]).
-export([datetime/1]).
-export([severity/1]... | null | https://raw.githubusercontent.com/g-andrade/fake_lager/ba71fd26e2415a28840162b52555e2599936acf4/src/lager_msg.erl | erlang | -------------------------------------------------------------------
Function Exports
-------------------------------------------------------------------
-------------------------------------------------------------------
-------------------------------------------------------------------
------------------------------... | -module(lager_msg).
-include("lager.hrl").
-export([new/4, new/5]).
-export([message/1]).
-export([timestamp/1]).
-export([datetime/1]).
-export([severity/1]).
-export([severity_as_int/1]).
-export([metadata/1]).
-export([destinations/1]).
-ignore_xref(datetime/1).
-ignore_xref(destinations/1).
-ignore_xref(message... |
74aadfbb71bacf872f04214049fd143b93a1e2d5a0f29bd2ddad7561e889b23f | aiya000/haskell-examples | DeclareFunction.hs | # LANGUAGE TemplateHaskell #
module DeclareFunction where
import Language.Haskell.TH (Q, DecsQ, Dec(FunD), Clause(Clause), Pat(VarP, WildP), Exp(VarE, LitE), Body(NormalB), Lit(IntegerL), mkName)
-- | Create a function simply
declareFunc :: Q [Dec]
declareFunc = do
let id' = mkName "id'" -- the name of the functi... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Language/Haskell/TH/DeclareFunction.hs | haskell | | Create a function simply
the name of the function
the name of "id'"'s an argument
| The const function in the compile time | # LANGUAGE TemplateHaskell #
module DeclareFunction where
import Language.Haskell.TH (Q, DecsQ, Dec(FunD), Clause(Clause), Pat(VarP, WildP), Exp(VarE, LitE), Body(NormalB), Lit(IntegerL), mkName)
declareFunc :: Q [Dec]
declareFunc = do
return [FunD id' [Clause [VarP x] (NormalB $ VarE x) []]]
DecsQ is a type ... |
38376fe90e1925906e27003320243479ba98c0f6364c4d0f979d13235b5f27fa | alphaHeavy/consul-haskell | Import.hs | -- | TODO: Document module
module Import
( module Control.Concurrent
, module Control.Monad.IO.Class
, module Control.Retry
ByteString
ByteString . Lazy
Hashmap . Strict
--, module T -- Text
, module TR -- Text.Read
, module Data.Word
, module V -- Vector
, module Network.Consul.Internal
, modul... | null | https://raw.githubusercontent.com/alphaHeavy/consul-haskell/ca39b39df7ad327b0c97536145aa658d46028a9f/src/Import.hs | haskell | | TODO: Document module
, module T -- Text
Text.Read
Vector
(method, Manager, responseBody)
functions and data types
Data.Aeson
Data.Text
Data.Maybe
Data.Monoid
Network.Socket
UnliftIO
( concat )
(method, Manager, responseBody) | module Import
( module Control.Concurrent
, module Control.Monad.IO.Class
, module Control.Retry
ByteString
ByteString . Lazy
Hashmap . Strict
, module Data.Word
, module Network.Consul.Internal
, module Network.Consul.Types
, module Network.HTTP.Types
Control . Monad
, forever
, Value(..)
... |
9f30084cc05528757777e3930a49a461649010ed0b0e457549f58f758d8cf30a | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
main = cabalTest $ do
tmpdir <- fmap testTmpDir getTestEnv
cabal "v2-sdist" ["--list-only", "--output-directory", tmpdir, "t7028"]
| null | https://raw.githubusercontent.com/haskell/cabal/d2bff20fae387cffef4425820b6c1975f1821188/cabal-testsuite/PackageTests/SDist/T7028/cabal.test.hs | haskell | import Test.Cabal.Prelude
main = cabalTest $ do
tmpdir <- fmap testTmpDir getTestEnv
cabal "v2-sdist" ["--list-only", "--output-directory", tmpdir, "t7028"]
| |
ca5b05d0a1f3311511858c8a92716f33d5b2b23acf6a0e13c4cebc1d01889233 | spell-music/csound-expression | Cab.hs | module Csound.Typed.Gui.Cab(
Cab, CabProp, Col(..), cabbage,
-- * Widgets
button, filebutton, infobutton, checkbox, combobox, csoundoutput, encoder, gentable,
hrange, vrange, form, groupbox, image, keyboard, label, hslider, vslider,
rslider, soundfiler, signaldisplay, textbox, texteditor, xypad,
... | null | https://raw.githubusercontent.com/spell-music/csound-expression/29c1611172153347b16d0b6b133e4db61a7218d5/csound-expression-typed/src/Csound/Typed/Gui/Cab.hs | haskell | * Widgets
* Properties | module Csound.Typed.Gui.Cab(
Cab, CabProp, Col(..), cabbage,
button, filebutton, infobutton, checkbox, combobox, csoundoutput, encoder, gentable,
hrange, vrange, form, groupbox, image, keyboard, label, hslider, vslider,
rslider, soundfiler, signaldisplay, textbox, texteditor, xypad,
bounds, chann... |
f141f3402a9242c7ac628994ed1283a4999f80cc314e0590472eeafa21d28020 | madnificent/SEXML | cl-attribs.lisp | cl-attribs.lisp
(in-package #:cl-attribs)
(defun pairup-list (list)
"returns a list containing lists with length of 2, made from the original list"
(loop
with results = nil
with counter = 0
while (<= counter (- (length list) 2))
do
(push (list (nth counter list) (nth (1+ counter) list... | null | https://raw.githubusercontent.com/madnificent/SEXML/c4db46adb60674e81273adbaac7b5f54dd79a438/contrib/sexml-objects/cl-attribs/cl-attribs.lisp | lisp | cl-attribs.lisp
(in-package #:cl-attribs)
(defun pairup-list (list)
"returns a list containing lists with length of 2, made from the original list"
(loop
with results = nil
with counter = 0
while (<= counter (- (length list) 2))
do
(push (list (nth counter list) (nth (1+ counter) list... | |
762e65b469c8cead5285c649230d6b8486878bfe223371eded3641ed163468de | raffy2010/grand-slam | video_thumbnail.cljs | (ns ui.component.video-thumbnail
(:require [cljs.core.match :refer-macros [match]]
[cljs-react-material-ui.reagent :as ui]
[cljs-react-material-ui.icons :as ic]
[ui.ffmpeg :refer [preview-src]]
[ui.state :refer [active-files]]))
(defn- handle-video-move
"video move handle... | null | https://raw.githubusercontent.com/raffy2010/grand-slam/752984d606f4e201b305c6ac931dd0d03a12f4b4/ui_src/ui/component/video_thumbnail.cljs | clojure | (ns ui.component.video-thumbnail
(:require [cljs.core.match :refer-macros [match]]
[cljs-react-material-ui.reagent :as ui]
[cljs-react-material-ui.icons :as ic]
[ui.ffmpeg :refer [preview-src]]
[ui.state :refer [active-files]]))
(defn- handle-video-move
"video move handle... | |
a1e08fc0279a185c1382ae2af178a97d6b322fed5ed04fc1ce73cfb1b08a3689 | apache/couchdb-rebar | test_SUITE.erl | -module(test_SUITE).
-export([all/0, simple_test/1, app_config_file_test/1]).
-include_lib("ct.hrl").
all() ->
[simple_test,
app_config_file_test].
simple_test(Config) ->
io:format("Test: ~p\n" [Config]).
app_config_file_test(_Config) ->
application:start(a1),
{ok, bar} = application:get_env(a... | null | https://raw.githubusercontent.com/apache/couchdb-rebar/8578221c20d0caa3deb724e5622a924045ffa8bf/inttest/ct_make_fails/test_SUITE.erl | erlang | -module(test_SUITE).
-export([all/0, simple_test/1, app_config_file_test/1]).
-include_lib("ct.hrl").
all() ->
[simple_test,
app_config_file_test].
simple_test(Config) ->
io:format("Test: ~p\n" [Config]).
app_config_file_test(_Config) ->
application:start(a1),
{ok, bar} = application:get_env(a... | |
1c32242ad8a12c9f83ff50b54fa2c424032c344bed65f069f888b7ac170da30b | kolmodin/spdy | Utils.hs | module Network.SPDY.Utils where
import Control.Monad hiding (join)
import Data.Char
import Data.List
import Numeric
import Data.Word
import qualified Data.ByteString.Lazy as L
w2c :: Word8 -> Char
w2c = chr . fromIntegral
printHexBS :: L.ByteString -> IO ()
printHexBS = printHex . map w2c . L.unpack
printHex :: S... | null | https://raw.githubusercontent.com/kolmodin/spdy/e81cb708695e2f08426a2fe8f2dc30de89e7a6db/Network/SPDY/Utils.hs | haskell | module Network.SPDY.Utils where
import Control.Monad hiding (join)
import Data.Char
import Data.List
import Numeric
import Data.Word
import qualified Data.ByteString.Lazy as L
w2c :: Word8 -> Char
w2c = chr . fromIntegral
printHexBS :: L.ByteString -> IO ()
printHexBS = printHex . map w2c . L.unpack
printHex :: S... | |
09fafbde89c23cce9913f3b9dca423ba4bbddb7dfeb37eaccff3561358b0df02 | iu-parfunc/HSBencher | Main.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
-- |
-- Seeded from code by:
Copyright : [ 2014 ]
module Main where
-- Friends:
import HSBencher
import HSBencher.Internal.Config (augmen... | null | https://raw.githubusercontent.com/iu-parfunc/HSBencher/76782b75b3a4b276c45a2c159e0b4cb6bd8a2360/hsbencher-fusion/CSVUploader/Main.hs | haskell | # LANGUAGE OverloadedStrings #
|
Seeded from code by:
Friends:
Standard:
--------------------------------------------------------------------------------------------------
----------------------------------------------------------
Gather info about the benchmark platform:
----------------------------------------... | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
Copyright : [ 2014 ]
module Main where
import HSBencher
import HSBencher.Internal.Config (augmentResultWithConfig, getConfig)
import HSBencher.Backend.Fusion
import Network.G... |
95378533a80c6bfca6db1264798420ffa1b1031b5ad06e8b5e0c101a55f20a93 | theodormoroianu/SecondYearCourses | HaskellChurch_20210415163652.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163652.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always chooses the first alternativ... |
4345e76c3e7d8eddb8bce32a6ef87d698565569edebcef22d3c441e2a18b3a1a | dmillett/political-canvas | constituent.clj | (ns political-canvas.shared.example.constituent
(:require [political-canvas.shared.example.ward :as local]))
;;
; A mock list of consituents for local/regional/federal districts
;
(def mock_constituents
[{:id 1
:name "Joe Plumber"
:aliases []
:districts [local/ward1]
:contact {[:address {} :email ... | null | https://raw.githubusercontent.com/dmillett/political-canvas/ec59a065b832277ec06f80e67977eee196a6a194/src/political_canvas/shared/example/constituent.clj | clojure |
A mock list of consituents for local/regional/federal districts
because districs can change (boo?), people move
mostly unused, track warnings from forum moderators | (ns political-canvas.shared.example.constituent
(:require [political-canvas.shared.example.ward :as local]))
(def mock_constituents
[{:id 1
:name "Joe Plumber"
:aliases []
:districts [local/ward1]
:affiliations [{}]
},
{:id 2
:name "Maryann Perez"
:aliases []
:districts [local/w... |
b425e559072c8046770c0d1ef66ceaf67f3618ebb9424c69c0a549a3a26d4085 | cxphoe/SICP-solutions | 4.04.rkt | (define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%204-Metalinguistic%20Abstraction/1.The%20Meta-cycle%20Evaluator/4.04.rkt | racket | and: (and <predicate1> <predicate2> ... <predicaten>)
or: (or <predicate1> <predicate2> ... <predicaten>) | (define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
... |
1f4e9bd0eed2e2482dde8451c7bff42318436307acfeb01b0e502e0b50a6759c | 40ants/reblocks-text-editor | html.lisp | (uiop:define-package #:reblocks-text-editor/typed-pieces/html
(:use #:cl)
(:import-from #:reblocks-text-editor/typed-pieces/base
#:typed-piece))
(in-package #:reblocks-text-editor/typed-pieces/html)
(defclass html-piece (typed-piece)
())
(defun make-html-piece (string caret)
(check-type stri... | null | https://raw.githubusercontent.com/40ants/reblocks-text-editor/b80a3fd75a527c7be8615c19ba4d6e2951c9d3e4/src/typed-pieces/html.lisp | lisp | (uiop:define-package #:reblocks-text-editor/typed-pieces/html
(:use #:cl)
(:import-from #:reblocks-text-editor/typed-pieces/base
#:typed-piece))
(in-package #:reblocks-text-editor/typed-pieces/html)
(defclass html-piece (typed-piece)
())
(defun make-html-piece (string caret)
(check-type stri... | |
5d6dc97e43eda693032d367c753fe77eff457ece1fedba54e3ee04d99b2a26a3 | LesBoloss-es/sorting | arrays.ml | open Genlib.Genarray
open Sorting_array
let test_gen ~prep ~cmp ~sort ~gen ~nb ~len =
let rec aux = function
| 0 -> ()
| n ->
let t = prep (gen len) in
let t' = Array.copy t in
Array.stable_sort cmp t';
sort cmp t;
if t <> t' then failwith "test_gen";
aux (n-1)
in
aux ... | null | https://raw.githubusercontent.com/LesBoloss-es/sorting/40702b8ff99ac001261af424bd7e0834e2a26bf1/tests/arrays.ml | ocaml | open Genlib.Genarray
open Sorting_array
let test_gen ~prep ~cmp ~sort ~gen ~nb ~len =
let rec aux = function
| 0 -> ()
| n ->
let t = prep (gen len) in
let t' = Array.copy t in
Array.stable_sort cmp t';
sort cmp t;
if t <> t' then failwith "test_gen";
aux (n-1)
in
aux ... | |
7b0806108014e17a68ae696ec8afc73f6d0b9c74960e1b6dedf83d627419da7e | LexiFi/landmarks | mapper.ml | This file is released under the terms of an MIT - like license .
(* See the attached LICENSE file. *)
Copyright 2016 by LexiFi .
let default_auto, default_remove, default_threads =
match Sys.getenv "OCAML_LANDMARKS" with
| excepti... | null | https://raw.githubusercontent.com/LexiFi/landmarks/0c1162ecaf1360d0b183cd7229907f50a98567d3/ppx/mapper.ml | ocaml | See the attached LICENSE file.
Remove landmark attribute: | This file is released under the terms of an MIT - like license .
Copyright 2016 by LexiFi .
let default_auto, default_remove, default_threads =
match Sys.getenv "OCAML_LANDMARKS" with
| exception Not_found -> false, false, false
| env ->
let opts = String.s... |
e9d5ebd69bcccc58c002356c21891c4f7f7fb1b07ff956b25fc01901e023995a | d-cent/objective8 | launch.clj | (ns dev-helpers.launch
(:require [org.httpkit.server :as server]
[clojure.tools.logging :as log]
[dev-helpers.profiling :as profiling]
[objective8.core :as core]
[objective8.config :as config]
[objective8.back-end.storage.database :as db]))
;; Launching / r... | null | https://raw.githubusercontent.com/d-cent/objective8/db8344ba4425ca0b38a31c99a3b282d7c8ddaef0/dev/dev_helpers/launch.clj | clojure | Launching / relaunching / loading | (ns dev-helpers.launch
(:require [org.httpkit.server :as server]
[clojure.tools.logging :as log]
[dev-helpers.profiling :as profiling]
[objective8.core :as core]
[objective8.config :as config]
[objective8.back-end.storage.database :as db]))
(defonce the-sys... |
f3ec027871bfae3164b6b239382aae10383ec345ac31bbb4238a0a76539ca3db | typedclojure/typedclojure | deprecated_wrapper_macros.clj | (in-ns 'clojure.core.typed)
(defmacro ^:deprecated doseq
"DEPRECATED: Use clojure.core/doseq.
Like clojure.core/doseq with optional annotations.
:let option uses clojure.core.typed/let
eg.
(doseq [a :- (U nil AnyInteger) [1 nil 2 3]
:when a]
(inc a))"
[seq-exprs & body]
(@#'core/ass... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/c7be1ddb61eb27c524078da6c3673a3dd246c26d/typed/clj.runtime/src/clojure/core/typed/deprecated_wrapper_macros.clj | clojure | change [a :- b c] to [[a :- b] c]
for options (:let, :while etc)
normalise seq-exprs to be flat pairs
typed let
k is [k :- k-ann]
core.typed thinks chunk- could be nil here
~k (.nth ~chunk- ~i-)
change [a :- b c] to [[a :- b] c]
for options (:let, :while etc)
normalise seq-exprs to be flat pairs
typed let
ann-fo... | (in-ns 'clojure.core.typed)
(defmacro ^:deprecated doseq
"DEPRECATED: Use clojure.core/doseq.
Like clojure.core/doseq with optional annotations.
:let option uses clojure.core.typed/let
eg.
(doseq [a :- (U nil AnyInteger) [1 nil 2 3]
:when a]
(inc a))"
[seq-exprs & body]
(@#'core/ass... |
8f3c1ada77b23e143cf334f00ac923a34e8a763904547c22bcb060dec52ba69d | liangjingyang/everrank | everrank_handler.erl |
-module(everrank_handler).
-export([
init/3,
handle/2,
terminate/3
]).
-include("everrank.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
case catch do_handle(Req, State) of
{ok, Req2} ->
ok;
{error, Req2, Reason} -... | null | https://raw.githubusercontent.com/liangjingyang/everrank/d4d2b86680117304f0ce98c1da5dd71728cc7d02/src/everrank_handler.erl | erlang | ===================================================================
TODO:transaction
TODO:transaction
[] ->
[#t_fd{friendList = FDList2}] ->
remove_dup_fd2(FDList, FDList2, [])
end.
remove_dup_fd2([FSnsId|FDList], FDList2, FDList3) ->
case lists:keymember(FSnsId, #t_fdl.snsId, FDList2) of
true ->
remove_dup_fd2(FDList,... |
-module(everrank_handler).
-export([
init/3,
handle/2,
terminate/3
]).
-include("everrank.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
case catch do_handle(Req, State) of
{ok, Req2} ->
ok;
{error, Req2, Reason} -... |
bff2129a5dc9155de0fe3919ee78abfbc5f53ef5dd8b2b5bc5d42fda9b5d74d3 | art-w/unicorn | algebra.ml | open Optic
open Type
type 'a t = 'a Type.t
let empty : type a. a t = W ((), (), Eq.unit, fun x -> x, Dag.empty ())
let ( & ) (W (c0, s0, _, w0)) (W (c1, s1, _, w1)) =
W
( (None, c0, c1)
, (s0, s1)
, Eq.create ()
, fun ((x, (s0, s1), (cache, c0, c1)) as input) ->
match cache with
| S... | null | https://raw.githubusercontent.com/art-w/unicorn/efdc6b0848af8a6bb718aeb95f6d87e8b05e38a6/jsoo/algebra.ml | ocaml | ****************************************************************************** | open Optic
open Type
type 'a t = 'a Type.t
let empty : type a. a t = W ((), (), Eq.unit, fun x -> x, Dag.empty ())
let ( & ) (W (c0, s0, _, w0)) (W (c1, s1, _, w1)) =
W
( (None, c0, c1)
, (s0, s1)
, Eq.create ()
, fun ((x, (s0, s1), (cache, c0, c1)) as input) ->
match cache with
| S... |
5144680f20be8d4efc33cb9ae52b618119debc831038ae8c6fe730121942bc8e | hiroshi-unno/coar | envs.ml | open Core
let cgen_config = ref {
Ast.Rtype.depend_on_func_args = false;
Ast.Rtype.depend_on_unit_args = false;
Ast.Rtype.instantiate_svars_to_int = false;
Ast.Rtype.gen_ref_pred_for_fun_types = false;
Ast.Rtype.gen_type_temp_for_constrs = false;
Ast.Rtype.never_fail = false;
Ast.Rtype.can_... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/RCaml/envs.ml | ocaml | open Core
let cgen_config = ref {
Ast.Rtype.depend_on_func_args = false;
Ast.Rtype.depend_on_unit_args = false;
Ast.Rtype.instantiate_svars_to_int = false;
Ast.Rtype.gen_ref_pred_for_fun_types = false;
Ast.Rtype.gen_type_temp_for_constrs = false;
Ast.Rtype.never_fail = false;
Ast.Rtype.can_... | |
661255ccd3d51f49d9e170ebe19c947c2d5f25a412f7e23228aff620863793d1 | vivid-inc/ash-ra-template | project.clj | (defproject art-sample--simple "0"
Add the - art Leiningen plugin :
:plugins [[net.vivid-inc/lein-art "0.6.1"]]
; Render .art templates
:art {:templates "templates"
:output-dir "target"})
| null | https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/examples/simple/project.clj | clojure | Render .art templates | (defproject art-sample--simple "0"
Add the - art Leiningen plugin :
:plugins [[net.vivid-inc/lein-art "0.6.1"]]
:art {:templates "templates"
:output-dir "target"})
|
727850a3136670d9495d48a11866acdcca79fb1c6f62bf598e1cf1c864fcae4c | rowangithub/DOrder | typecore.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/typing/typecore.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 : typecore.mli 10417 2010 - 05 ... |
24a1e9b70b3f940e58c47f0048c575c1614a1c8ed083af22926b22d0fd2505eb | dimitri/pgloader | command-fixed.lisp | ;;;
;;; LOAD FIXED COLUMNS FILE
;;;
;;; That has lots in common with CSV, so we share a fair amount of parsing
;;; rules with the CSV case.
;;;
(in-package #:pgloader.parser)
(defrule option-fixed-header (and kw-fixed kw-header)
(:constant (cons :header t)))
(defrule hex-number (and "0x" (+ (hexdigit-char-p charac... | null | https://raw.githubusercontent.com/dimitri/pgloader/3047c9afe141763e9e7ec05b7f2a6aa97cf06801/src/parsers/command-fixed.lisp | lisp |
LOAD FIXED COLUMNS FILE
That has lots in common with CSV, so we share a fair amount of parsing
rules with the CSV case.
|
(in-package #:pgloader.parser)
(defrule option-fixed-header (and kw-fixed kw-header)
(:constant (cons :header t)))
(defrule hex-number (and "0x" (+ (hexdigit-char-p character)))
(:lambda (hex)
(bind (((_ digits) hex))
(parse-integer (text digits) :radix 16))))
(defrule dec-number (+ (digit-char-p char... |
0632e90d838fe593c2a1b73f156d3e0376b0e08c4d3d00cf83ef2abf7c59746b | serokell/haskell-with-utf8 | Utf8.hs | SPDX - FileCopyrightText : 2020 >
-
- SPDX - License - Identifier : MPL-2.0
-
- SPDX-License-Identifier: MPL-2.0
-}
-- | "Data.Text.Lazy.IO" for the modern world.
--
-- Wrappers around simple file reading/writing functions from the
@text@ package that reset the handle encoding to UTF-8 .
module Data... | null | https://raw.githubusercontent.com/serokell/haskell-with-utf8/63b26842bec2da71f4b822d2dff14640e63a63e5/lib/Data/Text/Lazy/IO/Utf8.hs | haskell | | "Data.Text.Lazy.IO" for the modern world.
Wrappers around simple file reading/writing functions from the
of the current locale.
of the current locale. | SPDX - FileCopyrightText : 2020 >
-
- SPDX - License - Identifier : MPL-2.0
-
- SPDX-License-Identifier: MPL-2.0
-}
@text@ package that reset the handle encoding to UTF-8 .
module Data.Text.Lazy.IO.Utf8
( readFile
, writeFile
) where
import Prelude hiding (readFile, writeFile)
import Control... |
3ad905557c5d3fb043423c875509a4beb33057512447b5387eba3ff2f1073df7 | meamy/feynman | Swaps.hs | module Feynman.Optimization.Swaps (pushSwaps) where
import Data.Map (Map, (!))
import qualified Data.Map as Map
import Feynman.Core
-- Permutations on /a/
data Permutation a = Permutation !(Map a a) !(Map a a) deriving (Eq, Ord, Show)
identity :: Permutation a
identity = Permutation Map.empty Map.empty
fLookup :: ... | null | https://raw.githubusercontent.com/meamy/feynman/6487c3e90b3c3a56e3b309436663d8bf4cbf4422/src/Feynman/Optimization/Swaps.hs | haskell | Permutations on /a/
Hoist swaps out of code. Useful mainly so that T-par doesn't
have to worry about clever orderings itself | module Feynman.Optimization.Swaps (pushSwaps) where
import Data.Map (Map, (!))
import qualified Data.Map as Map
import Feynman.Core
data Permutation a = Permutation !(Map a a) !(Map a a) deriving (Eq, Ord, Show)
identity :: Permutation a
identity = Permutation Map.empty Map.empty
fLookup :: Ord a => a -> Permutati... |
66bee0d2ca74bf0fd3e78b3104dfb7b9adf88712388086fcb58b1774b00271b5 | rabbitmq/ra-kv-store | util.clj | (ns jepsen.util
"Kitchen sink"
(:require [clojure.tools.logging :refer [info]]
[clojure.core.reducers :as r]
[clojure.string :as str]
[clojure.pprint :refer [pprint]]
[clojure.walk :as walk]
[clojure.java.io :as io]
[clj-time.core :as time]
... | null | https://raw.githubusercontent.com/rabbitmq/ra-kv-store/faf36863bb3822ef4dcd99de5635007273d35997/jepsen/jepsen/src/jepsen/util.clj | clojure | (->> (org.apache.log4j.LogManager/getCurrentLoggers)
(java.util.Collections/list)
(cons (org.apache.log4j.LogManager/getRootLogger))))
`(let [loggers# (all-loggers)
(try
(doseq [l# loggers#]
~@body
(finally
loggers#
levels#))))))
... | (ns jepsen.util
"Kitchen sink"
(:require [clojure.tools.logging :refer [info]]
[clojure.core.reducers :as r]
[clojure.string :as str]
[clojure.pprint :refer [pprint]]
[clojure.walk :as walk]
[clojure.java.io :as io]
[clj-time.core :as time]
... |
2eb3ae3d06bee70ae58c83ea237ccd4e8d326dda2c70c18d5fab03f67e15b4e2 | ldgrp/uptop | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import App
import Auth
import Brick.BChan
import Brick.Main
import qualified Brick.Widgets.List as L
import Control.Concurrent
import Control.Monad
import Data.HashMap.Strict
import qualified Data.Text as T
import qualified Data.Vector as Vec
import Graphics.Vty
im... | null | https://raw.githubusercontent.com/ldgrp/uptop/53001b39793df4be48c9c3aed9454be0fc178434/up-top/src/Main.hs | haskell | # LANGUAGE OverloadedStrings #
Read the token environment variable
Either we have a working token, or the user has exited early.
Thread for handling requests |
module Main where
import App
import Auth
import Brick.BChan
import Brick.Main
import qualified Brick.Widgets.List as L
import Control.Concurrent
import Control.Monad
import Data.HashMap.Strict
import qualified Data.Text as T
import qualified Data.Vector as Vec
import Graphics.Vty
import Servant.Client
import System.E... |
d30371e642b311fb57b0c69438c5581880205dc07928c8cd645a39d9b0451d26 | fpco/schoolofhaskell.com | EditTutorial.hs | module Handler.EditTutorial where
import Import
import Handler.EditGroup (slugField)
import Text.Markdown (markdown)
import Data.Time (addUTCTime)
data Meta = Meta
{ metaTitle :: Title
, metaDesc :: Textarea
, metaSlug :: TutorialName
, metaEnv :: MaybeEnv
}
data MaybeEnv = DefaultEnv | Env GhcE... | null | https://raw.githubusercontent.com/fpco/schoolofhaskell.com/15ec1a03cb9d593ee9c0d167dc522afe45ba4f8e/src/Handler/EditTutorial.hs | haskell | | Save the given tutorial owned by the given user.
We want to allow for empty content, but not missing content. | module Handler.EditTutorial where
import Import
import Handler.EditGroup (slugField)
import Text.Markdown (markdown)
import Data.Time (addUTCTime)
data Meta = Meta
{ metaTitle :: Title
, metaDesc :: Textarea
, metaSlug :: TutorialName
, metaEnv :: MaybeEnv
}
data MaybeEnv = DefaultEnv | Env GhcE... |
728bd88ffa194a9a01e9a773579962ff4fd442d0eb38290d73762aa922ad595d | RefactoringTools/HaRe | WhereIn8.hs | module LiftOneLevel.WhereIn8 where
lift ' ' one level up .
g y = f + 345
where
f = y + b
where
b=17
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/LiftOneLevel/WhereIn8.hs | haskell | module LiftOneLevel.WhereIn8 where
lift ' ' one level up .
g y = f + 345
where
f = y + b
where
b=17
| |
7d926756c28b17145ac2c30075c9e242a303acb952af592ab55340ad3f01b42f | ocaml-multicore/ocaml-effects-tutorial | echo_async.ml | open Printf
module type Aio = sig
type 'a promise
(** Type of promises *)
val async : (unit -> 'a) -> 'a promise
(** [async f] runs [f] concurrently *)
val await : 'a promise -> 'a
(** [await p] returns the result of the promise. *)
val yield : unit -> unit
(** yields control to another task *)
val ... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-effects-tutorial/998376931b7fdaed5d54cb96b39b301b993ba995/sources/echo_async.ml | ocaml | * Type of promises
* [async f] runs [f] concurrently
* [await p] returns the result of the promise.
* yields control to another task
* Runs the scheduler
******************
tasks blocked on reads
tasks blocked on writes
runnable tasks available
no runnable tasks, and no blocked tasks => we're done.
no run... | open Printf
module type Aio = sig
type 'a promise
val async : (unit -> 'a) -> 'a promise
val await : 'a promise -> 'a
val yield : unit -> unit
val accept : Unix.file_descr -> Unix.file_descr * Unix.sockaddr
val recv : Unix.file_descr -> bytes -> int -> int -> Unix.msg_flag list -> int
val send : Uni... |
ea91238beb7d4c40e4b07b32dac9ba59ab5e3e8f55451e87aecfab7dc32f4a29 | janestreet/universe | compare_core.mli | open! Core
open! Import
include module type of struct
include Patdiff_kernel.Compare_core
end
include Patdiff_kernel.Compare_core.S
val diff_files
: Configuration.t
-> prev_file:string
-> next_file:string
-> [ `Different | `Same ]
val diff_dirs
: Configuration.t
-> prev_dir:string
-> next_dir:stri... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/patdiff/lib/src/compare_core.mli | ocaml | open! Core
open! Import
include module type of struct
include Patdiff_kernel.Compare_core
end
include Patdiff_kernel.Compare_core.S
val diff_files
: Configuration.t
-> prev_file:string
-> next_file:string
-> [ `Different | `Same ]
val diff_dirs
: Configuration.t
-> prev_dir:string
-> next_dir:stri... | |
d8ce272959ec48fd4ad17a38b83f1282e8cf54c841428aa47c137b008b2e114b | dbuenzli/rresult | rresult.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The rresult programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (... | null | https://raw.githubusercontent.com/dbuenzli/rresult/5324558067a391bf8827ee76d413399887030c2f/src/rresult.mli | ocaml | * The type for results.
* [(>>|)] is {!R.(>>|)}.
* Result value combinators.
* The type for results.
* [ok v] is [Ok v].
* [error e] is [Error e].
* [reword_error reword r] is:
{ul
{- [r] if [r = Ok v]}
{- [Error (reword e)] if [r = Error e]}}
* [get_ok r] is [v] if [r = Ok v] and raises [Inval... | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The rresult programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (... |
255f9e4dbbcd96ee7e0e8f7f311c3b5204f186164ef9956a2ffd435f6539981c | klarna/snabbkaffe | asciiart.erl | Copyright 2019 - 2020 Klarna Bank AB
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/klarna/snabbkaffe/2bdf6e842c825ca935b34884528f51158dd31e6e/src/asciiart.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2019 - 2020 Klarna Bank AB
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(asciiart).
-export([ init/0
, dimensions/1
, render/1
, char/3
, char/2
, line/4
... |
c69e186fa51e4ed2e40e971e7192aa8ce55240d5f9758e984f1cda1e05888e1b | iskandr/parakeet-retired | CSE.ml | (* pp: -parser o pa_macro.cmo *)
open Type
open Base
open TypedSSA
open SSA_Transform
(* expressions without side effects *)
let is_safe_exp expNode = match expNode.exp with
| PrimApp _ | Arr _ | Values _ -> true
| _ -> false (* assume function calls unsafe by default *)
module CSE_Rules = struct
type contex... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/SSA/Optimizations/CSE.ml | ocaml | pp: -parser o pa_macro.cmo
expressions without side effects
assume function calls unsafe by default
leave simple constants alone |
open Type
open Base
open TypedSSA
open SSA_Transform
let is_safe_exp expNode = match expNode.exp with
| PrimApp _ | Arr _ | Values _ -> true
module CSE_Rules = struct
type context = (exp, value) Hashtbl.t
let init _ = Hashtbl.create 127
let finalize _ _ = NoChange
let dir = Forward
let stmt env stmtNo... |
1e53ff35528e0c9fc691e0c091fb302c12c3dcf5994061e0714caa89c5920042 | tobbebex/GPipe-Core | Buffer.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE Arrows , TypeFamilies , ScopedTypeVariables ,
FlexibleContexts , FlexibleInstances , TypeSynonymInstances #
FlexibleContexts, FlexibleInstances , TypeSynonymInstances #-}
module Graphics.GPipe.Internal.Buffer
(
BufferFormat(..),
BufferColor,
Buffer(),
ToBuf... | null | https://raw.githubusercontent.com/tobbebex/GPipe-Core/4607e2c31d5beec30f2a918ab8ad48472ca236b7/GPipe-Core/src/Graphics/GPipe/Internal/Buffer.hs | haskell | | The class that constraints which types can live in a buffer.
| An arrow action that turns a value from it's host representation to it's buffer representation. Use 'toBuffer' from
lazily, so ensure you use
@proc ~pattern -> do ...@
| Retrieve the number of elements in a buffer.
| The arrow type for 'toBuffe... | # LANGUAGE PatternSynonyms #
# LANGUAGE Arrows , TypeFamilies , ScopedTypeVariables ,
FlexibleContexts , FlexibleInstances , TypeSynonymInstances #
FlexibleContexts, FlexibleInstances , TypeSynonymInstances #-}
module Graphics.GPipe.Internal.Buffer
(
BufferFormat(..),
BufferColor,
Buffer(),
ToBuf... |
a0cdeb751fcb2ca488577289d7b6c505eac9419be91acf058bb38edc8d762ce3 | asmala/clj-simple-form | giddyup.clj | (ns clj-simple-form.giddyup
"Scope functions for Hiccup interoperability. Requiring this namespace sets
the form HTML functions to the contents of `giddyup.forms`."
(:use [clj-simple-form.util :only [set-html-fns!]])
(:require [giddyup.forms]
[clj-simple-form.form-scope :as form-scope]
[... | null | https://raw.githubusercontent.com/asmala/clj-simple-form/b1c566b1f0fe532639b15832b557f1608598a0a2/clj-simple-form-giddyup/src/clj_simple_form/giddyup.clj | clojure | (ns clj-simple-form.giddyup
"Scope functions for Hiccup interoperability. Requiring this namespace sets
the form HTML functions to the contents of `giddyup.forms`."
(:use [clj-simple-form.util :only [set-html-fns!]])
(:require [giddyup.forms]
[clj-simple-form.form-scope :as form-scope]
[... | |
49007581386b5df231ae4e5492fd92d00480424a9f5c741a025d3dfa2c4d3fee | mtnygard/simulant-example | db.clj | (ns example-ui.db
"Datomic bootstrap and Datomic + Pedestal interceptor"
(:require [environ.core :refer [env]]
[datomic.api :as d]
[io.pedestal.interceptor :refer [interceptor]]
[environ.core :refer [env]]))
(defonce uri (env :datomic-uri (str "datomic:mem://" (d/squuid))))
(de... | null | https://raw.githubusercontent.com/mtnygard/simulant-example/dcb76b2eda47dfb6be10a2077ade319873eacce1/example-ui/src/clj/example_ui/db.clj | clojure | (ns example-ui.db
"Datomic bootstrap and Datomic + Pedestal interceptor"
(:require [environ.core :refer [env]]
[datomic.api :as d]
[io.pedestal.interceptor :refer [interceptor]]
[environ.core :refer [env]]))
(defonce uri (env :datomic-uri (str "datomic:mem://" (d/squuid))))
(de... | |
19c156d3c5c460bd12dcc45000fd0f760b2be27aed86df24ba2294821792dcc7 | piotr-yuxuan/dove | project.clj | (defproject com.github.piotr-yuxuan/dove (-> "./resources/dove.version" slurp .trim)
:description "Recursively infer clojure spec from any (nested) org.apache.avro.Schema"
:url "-yuxuan/dove"
:license {:name "European Union Public License 1.2 or later"
:url "-text-eupl-12"
:distribution :r... | null | https://raw.githubusercontent.com/piotr-yuxuan/dove/94b6769e747dfc5639b5972a023c26b6d7488a0f/project.clj | clojure | (defproject com.github.piotr-yuxuan/dove (-> "./resources/dove.version" slurp .trim)
:description "Recursively infer clojure spec from any (nested) org.apache.avro.Schema"
:url "-yuxuan/dove"
:license {:name "European Union Public License 1.2 or later"
:url "-text-eupl-12"
:distribution :r... | |
37386583cc0a9cc0af041610937041d8649ea618d94acfe65045dc914851a936 | brandonbloom/wabt-clj | xref.clj | (ns wabt-clj.xref
(:use [wabt-clj.util])
(:require [wabt-clj.values :refer [id? index?]]
[wabt-clj.inst :as inst]))
(def ^:dynamic *module*)
(defn resolve-id [section id]
{:pre [(keyword? section)]}
(or (get-in *module* [section :env id])
(fail (str id " undefined in " section) {:section sec... | null | https://raw.githubusercontent.com/brandonbloom/wabt-clj/45b80fb05fc49d52ab117a699e9c56582a7078b3/src/wabt_clj/xref.clj | clojure | name->index.
index->label. | (ns wabt-clj.xref
(:use [wabt-clj.util])
(:require [wabt-clj.values :refer [id? index?]]
[wabt-clj.inst :as inst]))
(def ^:dynamic *module*)
(defn resolve-id [section id]
{:pre [(keyword? section)]}
(or (get-in *module* [section :env id])
(fail (str id " undefined in " section) {:section sec... |
8709fa536609ee8d8901eb4472dd9a843f25d5d9d5a2ac8c7654036ac2e04f8a | byorgey/BlogLiterately | NewMediaObject.hs | import Network.XmlRpc.Client (remote)
import Network.XmlRpc.Internals (Value(..), toValue)
import Data.Char (toLower)
import System.FilePath (takeFileName, takeExtension)
import qualified Data.ByteString.Char8 as B
import Data.Functor ... | null | https://raw.githubusercontent.com/byorgey/BlogLiterately/fbc8dc238c7e5bc570bef4d0c1dd9cf2f92de72a/test/NewMediaObject.hs | haskell | note: same successes + failures with wp.uploadFile in place of
Create the required struct representing the image. | import Network.XmlRpc.Client (remote)
import Network.XmlRpc.Internals (Value(..), toValue)
import Data.Char (toLower)
import System.FilePath (takeFileName, takeExtension)
import qualified Data.ByteString.Char8 as B
import Data.Functor ... |
c148c74aeea321f079390e81ab871b12bfdc50bb649c018dfebfffb1abd1da12 | clojure-interop/aws-api | project.clj | (defproject clojure-interop/com.amazonaws.services.serverlessapplicationrepository "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.serverlessapplicationrepository"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.serverlessapplicationrepository/project.clj | clojure | (defproject clojure-interop/com.amazonaws.services.serverlessapplicationrepository "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.serverlessapplicationrepository"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org... | |
662e006269236813e57c8be7545d9dbfb11614a06c5ac953d1d275a5642066dc | simonmar/parconc-examples | crc32_acc.hs | import Data.Word
import Data.Bits
import Data.Char
import Debug.Trace
import Data.Array.Accelerate hiding (fromIntegral, shiftR, map, zipWith, unzip, replicate)
import qualified Data.Array.Accelerate as A
import Data.Array.Accelerate.Interpreter
import CRC32
crc32_one :: Acc (Vector Word32) -> Exp Word32 -> Exp Word... | null | https://raw.githubusercontent.com/simonmar/parconc-examples/840a3f508f9bb6e03961e1b90311a1edd945adba/crc32/crc32_acc.hs | haskell | import Data.Word
import Data.Bits
import Data.Char
import Debug.Trace
import Data.Array.Accelerate hiding (fromIntegral, shiftR, map, zipWith, unzip, replicate)
import qualified Data.Array.Accelerate as A
import Data.Array.Accelerate.Interpreter
import CRC32
crc32_one :: Acc (Vector Word32) -> Exp Word32 -> Exp Word... | |
93437e6a4ff55683dcdb4b55da405c7440553dc63a02359cc45ef72483c44b93 | sigscale/snmp-collector | snmp_collector_get_sup.erl | %%% snmp_collector_get_sup.erl
%%% vim: ts=3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2016 - 2019 SigScale Global Inc.
%%% @end
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may... | null | https://raw.githubusercontent.com/sigscale/snmp-collector/cb6b95ed331abd6f258d8ea55bf34c57f2992444/src/snmp_collector_get_sup.erl | erlang | snmp_collector_get_sup.erl
vim: ts=3
@end
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Lic... | 2016 - 2019 SigScale Global Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(snmp_collector_get_sup).
-copyright('Copyright (c) 2016 - 2019 SigScale Global Inc.').
-behaviour(supervisor).
-export([init/1]).
... |
4ccdfe9385c410fc7aeb5128fb07a0abea5e8499461d49ccbfa654a8459d9bf4 | onedata/op-worker | api_test_utils.erl | %%%-------------------------------------------------------------------
@author
( C ) 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Utility functions used in API test... | null | https://raw.githubusercontent.com/onedata/op-worker/e0f8d666ff664a558050d1fc8f0e33f939a18030/test_distributed/utils/api/api_test_utils.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Utility functions used in API tests.
@end
-------------------------------------------------------------------
<<"file">> | <<"dir">>
====================================... | @author
( C ) 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(api_test_utils).
-author("Bartosz Walkowicz").
-include("api_test_runner.hrl").
-include("api_file_test_utils.hrl").
-include("modules/dataset/dataset.hrl").
-include("modules/fslogic/file_... |
7cf570a1b1f14e551f8bfcfea2f634ee31067965eab83589774eaf5c25a6366b | jafingerhut/cljol | jdk8_and_earlier.clj | (ns cljol.jdk8-and-earlier
(:import (java.lang.reflect Field)))
(set! *warn-on-reflection* true)
(defn obj-field-value [obj ^Field fld _inaccessible-field-val-sentinel]
(. fld setAccessible true)
(.get fld obj))
| null | https://raw.githubusercontent.com/jafingerhut/cljol/2b0eb2b6ec3197434ede3adbd0a13d4b53c06dd0/src/clj/cljol/jdk8_and_earlier.clj | clojure | (ns cljol.jdk8-and-earlier
(:import (java.lang.reflect Field)))
(set! *warn-on-reflection* true)
(defn obj-field-value [obj ^Field fld _inaccessible-field-val-sentinel]
(. fld setAccessible true)
(.get fld obj))
| |
19e8e59168055fb7065c3dc36d18f06c4ba22185fb43e5b700881a85502bd140 | bjpop/blip | Scope.hs | {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, RecordWildCards, PatternGuards #-}
-----------------------------------------------------------------------------
-- |
-- Module : Blip.Compiler.Scope
Copyright : ( c ) 2012 , 2013 , 2014
-- License : BSD-style
-- Maintainer :
-- Stability : expe... | null | https://raw.githubusercontent.com/bjpop/blip/3d9105a44d1afb7bd007da3742fb19dc69372e10/blipcompiler/src/Blip/Compiler/Scope.hs | haskell | # LANGUAGE TypeSynonymInstances, FlexibleInstances, RecordWildCards, PatternGuards #
---------------------------------------------------------------------------
|
Module : Blip.Compiler.Scope
License : BSD-style
Maintainer :
Stability : experimental
A variable can be:
explicit global
implici... |
Copyright : ( c ) 2012 , 2013 , 2014
Portability : ghc
Cellvars are :
Cellvars are used to implement closures such that modifications to the
module Blip.Compiler.Scope
(topScope, renderScope)
where
import Blip.Compiler.Types
( Identifier, VarSet, LocalScope (..)
, NestedScope (..), Sco... |
ce89dd4f175b49eafa5224a91993dfe927e5ef71808981cef2160521d9f54897 | apibot-org/apibot | projects.clj | (ns apibot.routes.projects
(:require
[apibot.db.projects :as db.projects]
[apibot.schemas :refer [Project]]
[cats.monad.exception :as exception]
[compojure.api.sweet :refer [defapi context GET PUT DELETE]]
[ring.util.http-response :as response :refer [ok]]
[schema.core :as s]))
(defapi api-pr... | null | https://raw.githubusercontent.com/apibot-org/apibot/26c77c688980549a8deceeeb39f01108be016435/src/clj/apibot/routes/projects.clj | clojure | (ns apibot.routes.projects
(:require
[apibot.db.projects :as db.projects]
[apibot.schemas :refer [Project]]
[cats.monad.exception :as exception]
[compojure.api.sweet :refer [defapi context GET PUT DELETE]]
[ring.util.http-response :as response :refer [ok]]
[schema.core :as s]))
(defapi api-pr... | |
ab3976220fa9720a3156ca8baa3ee1fb49227cdec6365ed51596493566e2b905 | igorhvr/bedlam | test.scm |
(with-output-to-string
(lambda ()
(for-each (lambda (n)
(display n))
ls))))
| null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-cvs/test.scm | scheme |
(with-output-to-string
(lambda ()
(for-each (lambda (n)
(display n))
ls))))
| |
73f2f9b1b107099a0417362b4d9edd48901c39d8739b238af1bd460cab396c6c | inconvergent/cl-grph | run.lisp |
(defpackage #:grph-tests (:use #:cl #:prove) (:export #:run-tests))
(setf prove:*enable-colors* nil)
(in-package #:grph-tests)
#+:grph-parallel (setf lparallel:*kernel* (lparallel:make-kernel 4))
; (defun compile-or-fail (f)
( format t " ~%compiling : ~a~% " ( grph::mkstr f ) )
; (with-open-stream (*standard... | null | https://raw.githubusercontent.com/inconvergent/cl-grph/d46e921b32bcff0545ab2932238bb7c81594bd89/test/run.lisp | lisp | (defun compile-or-fail (f)
(with-open-stream (*standard-output* (make-broadcast-stream))
(compile-file f)))
(compile-or-fail f) |
(defpackage #:grph-tests (:use #:cl #:prove) (:export #:run-tests))
(setf prove:*enable-colors* nil)
(in-package #:grph-tests)
#+:grph-parallel (setf lparallel:*kernel* (lparallel:make-kernel 4))
( format t " ~%compiling : ~a~% " ( grph::mkstr f ) )
(defun -run-tests (files)
(loop with fails = 0
for ... |
5594d82e5ec9ee2b7821bc021798863a17b3913f9c9d76163007b8cf7bcc364f | cabol/west | west_lib.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of ... | null | https://raw.githubusercontent.com/cabol/west/c3c31dff9ad727ce9b82dde6eb690f7b11cd4d24/src/west_lib.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@author < >
( C... |
e35e429207a9e5c8b59a91145725a9cd2feabb5d4d9fcd7896a214b06d6080f9 | sellout/LOOM | structures.lisp | (loom.internals:defpackage structures
(:use #:cl.data-and-control-flow #:loom.internals)
(:export #:defstruct
#:copy-structure)
(:import-from #:cl #:defstruct))
(cl:in-package #:loom.structures)
(make-generic copy-structure (structure))
| null | https://raw.githubusercontent.com/sellout/LOOM/b34b0590e82a8ba41ca1e58a8a825dd889285c1d/src/structures.lisp | lisp | (loom.internals:defpackage structures
(:use #:cl.data-and-control-flow #:loom.internals)
(:export #:defstruct
#:copy-structure)
(:import-from #:cl #:defstruct))
(cl:in-package #:loom.structures)
(make-generic copy-structure (structure))
| |
89a0bb11cd6f6ba9d473ae4c1ee9fb40f7841daafb01f7269a55b68cdec317fa | eeng/shevek | helpers.cljs | (ns shevek.pages.designer.helpers
(:require [shevek.reflow.core :refer [dispatch] :refer-macros [defevh]]
[shevek.reflow.db :as db]
[shevek.components.popup :refer [tooltip]]
[shevek.components.refresh :refer [debounce-auto-refresh!]]
[shevek.lib.string :refer [regex-es... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/pages/designer/helpers.cljs | clojure | We change the report only after results arrived so the visualization doesn't rerender until that moment
Components | (ns shevek.pages.designer.helpers
(:require [shevek.reflow.core :refer [dispatch] :refer-macros [defevh]]
[shevek.reflow.db :as db]
[shevek.components.popup :refer [tooltip]]
[shevek.components.refresh :refer [debounce-auto-refresh!]]
[shevek.lib.string :refer [regex-es... |
e982d2d57a8f2db1c56e34d4844eda1e4deda73a39863408ad58e6307130292c | shayne-fletcher/zen | print_tree.ml | (* A type of non-empty trees of strings. *)
type tree = [
|`Node of string * tree list
]
;;
(* [print_tree tree] prints a rendering of [tree]. *)
let rec print_tree
?(pad : (string * string)= ("", ""))
(tree : tree) : unit =
let pd, pc = pad in
match tree with
| `Node (tag, cs) ->
Prin... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/print_tree/print_tree.ml | ocaml | A type of non-empty trees of strings.
[print_tree tree] prints a rendering of [tree].
An example tree.
Print the example tree. | type tree = [
|`Node of string * tree list
]
;;
let rec print_tree
?(pad : (string * string)= ("", ""))
(tree : tree) : unit =
let pd, pc = pad in
match tree with
| `Node (tag, cs) ->
Printf.printf "%s%s\n" pd tag;
let n = List.length cs - 1 in
List.iteri (
fun i c -... |
3a18a9b73241254f73904e595ac536993a7247c8d3ef0bd27605a6052d073e9f | marcusm/startrek-clojure | utils.clj | (ns startrek.utils
(:require [clojure.data.generators :as gen])
(:require [clojure.math.numeric-tower :as math]))
;; global constants
(def dim 8)
;; sector map values
(def enterprise-id 1)
(def klingon-id 2)
(def base-id 3)
(def star-id 4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/marcusm/startrek-clojure/65ef7811d134b634faa478c71b3a9db5e4f4b57a/src/startrek/utils.clj | clojure | global constants
sector map values
Wraps the random distribution methods so I can swap them out when testing.
randomness wrappers
Some common math functions needed in several places.
Functions used to extract or change shape of map data.
Functions used for indexing
Common test methods
Functions used... | (ns startrek.utils
(:require [clojure.data.generators :as gen])
(:require [clojure.math.numeric-tower :as math]))
(def dim 8)
(def enterprise-id 1)
(def klingon-id 2)
(def base-id 3)
(def star-id 4)
(declare gen-idx gen-idx gen-double gen-uniform)
(defn gen-idx [] (gen/uniform 1 (+ 1 ... |
a1152b524469d51bedfd38280f67e750d920a6dffc9e2fc0e6bf829dcaff67de | LBacchiani/session-subtyping-tool | RandomTypes.hs | module RandomTypes where
-- This is an ad-hoc tool to generate random session types
-- will be made user-enabled soon.
import Data.List (nub)
import Control.Applicative ((<$>))
import Control.Monad (liftM, liftM2, replicateM)
import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Gen
import Test.QuickCheck
import... | null | https://raw.githubusercontent.com/LBacchiani/session-subtyping-tool/268d716fafae3c4b50899a8f2ce29233ae8beb32/session-type-utilities/session-subtyping-algorithms/synchronous-subtyping/RandomTypes.hs | haskell | This is an ad-hoc tool to generate random session types
will be made user-enabled soon.
DEBUG
, if (null vars || flag)
then Choice dir pairs
, if null available
then End
main :: IO ()
main = do
putStrLn "Done"
| module RandomTypes where
import Data.List (nub)
import Control.Applicative ((<$>))
import Control.Monad (liftM, liftM2, replicateM)
import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Gen
import Test.QuickCheck
import System.Random (getStdGen, StdGen)
import Control.Monad.Zip (mzip)
import Data.Time (UTCTime,... |
a082679cab1382472afbd5ef06dc78a44bc96f0414cb99e5347313161965b6af | kumarshantanu/asphalt | test_connpool.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 LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the ... | null | https://raw.githubusercontent.com/kumarshantanu/asphalt/1a6a890ec05d038b204764c5b0fb5357476f41f1/test-connpool/dbcp/asphalt/test_connpool.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file LICENSE 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 ... | Copyright ( c ) . All rights reserved .
(ns asphalt.test-connpool
"DataSource maker for Apache DBCP 1.x JDBC connection pool."
(:require
[clj-dbcp.core :as dbcp]))
(defn make-datasource
[{:keys [classname
jdbc-url
username
password]
:as config}]
(dbcp/make-data... |
62f3854a681b2f11760949e01f66cbf4b18bda61631ad8c5e7d661fc4369f842 | nervous-systems/eulalie | creds.cljc | (ns eulalie.creds
(:require [eulalie.util :as util]
[eulalie.instance-data :as instance-data]
[eulalie.platform.time :as platform.time]
[glossop.core :as g
#? (:clj :refer :cljs :refer-macros) [go-catching <?]]))
(defn env []
(let [secret-key (util/env! "AWS_SECRET_... | null | https://raw.githubusercontent.com/nervous-systems/eulalie/ee435987278f5ed628f576700b716d9d0bc17c61/src/eulalie/creds.cljc | clojure | immediate I/O, so we just assume the credentials will expire
So this is pretty wasteful - there could be large numbers of
concurrent requests, all with the same expired credentials - they
should all be waiting on a single request | (ns eulalie.creds
(:require [eulalie.util :as util]
[eulalie.instance-data :as instance-data]
[eulalie.platform.time :as platform.time]
[glossop.core :as g
#? (:clj :refer :cljs :refer-macros) [go-catching <?]]))
(defn env []
(let [secret-key (util/env! "AWS_SECRET_... |
56bb40842572bd0eaf63c8d484679df6d2e8aaabca0bba5e18ca1209173b6086 | fossas/fossa-cli | MockDockerEngineApi.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE UndecidableInstances #
module Test.MockDockerEngineApi (
ApiExpectation,
DockerEngineApiMockC,
MockApi (..),
MockApiC (runMockApiC),
alwaysReturns,
assertAllSatisfied,
fails,
runMockApi,
runApiWithMock,
) where
import Control.Algebra (Algebra (..), Has, send, type (... | null | https://raw.githubusercontent.com/fossas/fossa-cli/6603f238a34198f8c2b9825b69dd585a58331300/test/Test/MockDockerEngineApi.hs | haskell | # LANGUAGE GADTs #
| An expectation of an API call made up of the request and response. | # LANGUAGE UndecidableInstances #
module Test.MockDockerEngineApi (
ApiExpectation,
DockerEngineApiMockC,
MockApi (..),
MockApiC (runMockApiC),
alwaysReturns,
assertAllSatisfied,
fails,
runMockApi,
runApiWithMock,
) where
import Control.Algebra (Algebra (..), Has, send, type (:+:) (..))
import Contr... |
0d69a060314170cf5843810acb21842fda0f8adec5b32a2dcd7324c8892d21c8 | static-analysis-engineering/codehawk | cHCilFunDeclarations.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk C Analyzer Parser using CIL
Author : ------------------------------------------------------------------------------
The MIT License ( MIT... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/d2e83cef7430defdc4cf30fc1495fe4ff64d9f9d/CodeHawk/CHC/cchcil/cHCilFunDeclarations.mli | ocaml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk C Analyzer Parser using CIL
Author : ------------------------------------------------------------------------------
The MIT License ( MIT... | |
3c3fc71abc7febfbd783dfe1d7ad6e338e7dc359a2ab36d42ec57c6e545ced19 | prestancedesign/pingcrm-clojure | top_header.cljs | (ns pingcrm.shared.top-header
(:require ["@inertiajs/inertia-react" :refer [InertiaLink]]
[pingcrm.shared.logo :refer [logo]]
[pingcrm.shared.menu :refer [main-menu]]
[reagent.core :as r]))
(defn top-header []
(let [opened? (r/atom false)
on-click #(reset! opened? false)... | null | https://raw.githubusercontent.com/prestancedesign/pingcrm-clojure/12f938f81a4b4010e8b66e87634fe631152cb18d/src/cljs/pingcrm/shared/top_header.cljs | clojure | (ns pingcrm.shared.top-header
(:require ["@inertiajs/inertia-react" :refer [InertiaLink]]
[pingcrm.shared.logo :refer [logo]]
[pingcrm.shared.menu :refer [main-menu]]
[reagent.core :as r]))
(defn top-header []
(let [opened? (r/atom false)
on-click #(reset! opened? false)... | |
e4dd8d9204dbd1c1d6df352efea7e04d89e176295fb3769330046bb6fc0c36fe | rescript-lang/rescript-compiler | ast_uncurry_gen.mli | Copyright ( C ) 2020- Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version ... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/eb07cb50b6e6ba2bf26ce667d4e3c638a24b35c4/jscomp/frontend/ast_uncurry_gen.mli | ocaml | async | Copyright ( C ) 2020- Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version ... |
04d8ff3e9de95c868a4fd4c0f4b525456d903e1975fdc5c65fc56d3671862017 | simoncourtenage/quanthas | Settings.hs |
Copyright ( C ) 2010 , ( )
This file is part of QuantHas , an open - source Haskell implementation
of the QuantLib library for quantitative finance .
is free software : you can redistribute it and/or modify it
under the terms of the QuantHas license . You should have receiv... | null | https://raw.githubusercontent.com/simoncourtenage/quanthas/6e0b2cc9a60bb7d1709f98ed10d09aa6c071c8dd/src/QuantHas/Settings.hs | haskell |
Copyright ( C ) 2010 , ( )
This file is part of QuantHas , an open - source Haskell implementation
of the QuantLib library for quantitative finance .
is free software : you can redistribute it and/or modify it
under the terms of the QuantHas license . You should have receiv... | |
86b32e5b90b17153a35f2247989d1af8dee55b2d8313d3cf1ee12ad3d24a4f1f | travelping/ergw | proxy_lib_SUITE.erl | Copyright 2018 , Travelping GmbH < >
%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(proxy_lib_SUITE)... | null | https://raw.githubusercontent.com/travelping/ergw/b577328c8bbdc4959b45c321338971ed242bb822/apps/ergw_core/test/proxy_lib_SUITE.erl | erlang | This program is free software; you can redistribute it and/or
A/AAAA record alternatives
===================================================================
Common Test callbacks
===================================================================
===================================================================
T... | Copyright 2018 , Travelping GmbH < >
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(proxy_lib_SUITE).
-compile([export_all, nowarn_export_all]).
-include_lib("comm... |
5236b42f2d5b84baea61182656f12093b169916990e22aed38ba08a90636291e | HaskellForCats/HaskellForCats | reTurnRightAroundIo.hs | ---------------- reTurnRightAroundIo ----------------
-- works but is stylistically poor!
main :: IO ()
main = do
line1 <- getLine
line2 <- getLine
lines <- return (line1 ++ " " ++ line2)
putStrLn lines
| null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/IO/reTurnRightAroundIo.hs | haskell | -------------- reTurnRightAroundIo ----------------
works but is stylistically poor! |
main :: IO ()
main = do
line1 <- getLine
line2 <- getLine
lines <- return (line1 ++ " " ++ line2)
putStrLn lines
|
fae303de9a712ff71bd1fd2bdccaabcb57acdac367911544d4f6cfbd03421535 | well-typed/large-records | R030.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
{-# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #-}
module Experiment.ToJSON.Sized.R030 where
import Data.Aeson (Value)
import Data.Recor... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/large-anon/Experiment/ToJSON/Sized/R030.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings #
# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin # | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.ToJSON.Sized.R030 where
import Data.Aeson (Value)
import Data.Record.Generic.JSON (gtoJSON)
import Common.RowOfSize.Row030
import Data.Record.Anon.Simple (Record)
recToJSON :: Record ExampleRow -> Value
recToJSON = gtoJSON |
e47813d13133de875fde5858b7ef149328656296371019d2f5a5fb7e0ccb516d | patoline/patoline | test_offset.ml |
Copyright Florian Hatat , , ,
Pierre - Etienne Meunier , , 2012 .
This file is part of Patoline .
Patoline is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of th... | null | https://raw.githubusercontent.com/patoline/patoline/3dcd41fdff64895d795d4a78baa27d572b161081/typography/test_offset.ml | ocaml |
Copyright Florian Hatat , , ,
Pierre - Etienne Meunier , , 2012 .
This file is part of Patoline .
Patoline is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of th... | |
6b6b55b033ac3c2e7012e8b001fc777ecc55197e80c8301a4f9be7c20e9a91d1 | sonowz/advent-of-code-haskell | Day06.hs | import Control.Monad
import Data.Function
import Data.List
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map.Lazy (Map)
import qualified Data.Map.Lazy as Map
type Point = (Int, Int)
type Border = (Int, Int, Int, Int)
_x = fst
_y = snd
manhattanD (x1, y1) (x2, y2) = (abs $ x1 - x2) + (abs $ y1 -... | null | https://raw.githubusercontent.com/sonowz/advent-of-code-haskell/6cec825c5172bbec687aab510e43832e6f2c0372/Y2018/Day06.hs | haskell | 3x size of original border | import Control.Monad
import Data.Function
import Data.List
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map.Lazy (Map)
import qualified Data.Map.Lazy as Map
type Point = (Int, Int)
type Border = (Int, Int, Int, Int)
_x = fst
_y = snd
manhattanD (x1, y1) (x2, y2) = (abs $ x1 - x2) + (abs $ y1 -... |
99652e413867b84403c8a0895a18303cd1b74a0e92079e7331444e5d14e56377 | parsifal-47/socketpool | tcp_echo.erl | -module(tcp_echo).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _Args) ->
{ok, erlang:spawn(socketpool, start_listener,
[5555, 100, fun(_State, Bin) -> {ok, Bin} end, fun() -> ok end])}.
stop(_State) -> ok. | null | https://raw.githubusercontent.com/parsifal-47/socketpool/f4f2130b61ad902dc0c619d50e0a102222e5206b/examples/tcp_echo/src/tcp_echo.erl | erlang | -module(tcp_echo).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _Args) ->
{ok, erlang:spawn(socketpool, start_listener,
[5555, 100, fun(_State, Bin) -> {ok, Bin} end, fun() -> ok end])}.
stop(_State) -> ok. | |
5d35d8b9d3167f23fc13014f395a9a00b5348b5929ab7e5996080fdb195637e6 | macourtney/Dark-Exchange | trade.clj | (ns darkexchange.model.trade
(:require [clj-record.boot :as clj-record-boot]
[clojure.contrib.logging :as logging]
[darkexchange.model.identity :as identity-model]
[darkexchange.model.offer :as offer]
[darkexchange.model.terms :as terms]
[darkexchange.model.... | null | https://raw.githubusercontent.com/macourtney/Dark-Exchange/1654d05cda0c81585da7b8e64f9ea3e2944b27f1/src/darkexchange/model/trade.clj | clojure | (ns darkexchange.model.trade
(:require [clj-record.boot :as clj-record-boot]
[clojure.contrib.logging :as logging]
[darkexchange.model.identity :as identity-model]
[darkexchange.model.offer :as offer]
[darkexchange.model.terms :as terms]
[darkexchange.model.... | |
9b8e35ebba2f178cc86b1fd51c5fd74d2f2f625e64263a1e0e6db160d66b333b | lettier/webviewhs | how-do-i-communicate-with-haskell-from-javascript.hs |
webviewhs
( C ) 2018
lettier.com
webviewhs
(C) 2018 David Lettier
lettier.com
-}
# LANGUAGE
OverloadedStrings
, DeriveGeneric
, QuasiQuotes
#
OverloadedStrings
, DeriveGeneric
, QuasiQuotes
#-}
import GHC.Generics
import Control.Monad
import Data.Text
import Data.Text.Enc... | null | https://raw.githubusercontent.com/lettier/webviewhs/21ddd4b4872b2e7eb50c9735e70cfbdedf2c6c1a/examples/how-do-i-communicate-with-haskell-from-javascript.hs | haskell | This function runs before the loop.
This function runs after the loop.
This function runs every window loop.
Return True to continue the loop or False to exit the loop.
runJavaScript returns either True on success or False on failure. |
webviewhs
( C ) 2018
lettier.com
webviewhs
(C) 2018 David Lettier
lettier.com
-}
# LANGUAGE
OverloadedStrings
, DeriveGeneric
, QuasiQuotes
#
OverloadedStrings
, DeriveGeneric
, QuasiQuotes
#-}
import GHC.Generics
import Control.Monad
import Data.Text
import Data.Text.Enc... |
11ccc97e75c5a810bc8944aa6426beeeb55593573e45dbeccddb7655cf82a1cf | NelosG/fp-tests | TAnnotated.hs | # LANGUAGE StandaloneDeriving #
module Test.TAnnotated
( propAnnotated
) where
import HW2.T1 (Annotated (..), mapAnnotated)
import HW2.T2 (distAnnotated, wrapAnnotated)
import Hedgehog (Gen)
import Test.Common (allProps, genString)
import Test.Tasty (TestTree)
deriving instance ((Show a, Show e)) => Show (Annota... | null | https://raw.githubusercontent.com/NelosG/fp-tests/7e2af5c3c3279c2045662faaff8e5f895af6af6a/hw2/test/T2/Test/TAnnotated.hs | haskell | # LANGUAGE StandaloneDeriving #
module Test.TAnnotated
( propAnnotated
) where
import HW2.T1 (Annotated (..), mapAnnotated)
import HW2.T2 (distAnnotated, wrapAnnotated)
import Hedgehog (Gen)
import Test.Common (allProps, genString)
import Test.Tasty (TestTree)
deriving instance ((Show a, Show e)) => Show (Annota... | |
a6ab0f68a68a395b3385a30b194be505396028af7cfad0b37ae3e931235be70a | fulcrologic/semantic-ui-wrapper | ui_step_content.cljc | (ns com.fulcrologic.semantic-ui.elements.step.ui-step-content
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$StepContent" :as StepContent])))
(def ui-step-content
"A step can contain a content.
Props:
- as (elementType): An element type to render as (str... | null | https://raw.githubusercontent.com/fulcrologic/semantic-ui-wrapper/7bd53f445bc4ca7e052c69596dc089282671df6c/src/main/com/fulcrologic/semantic_ui/elements/step/ui_step_content.cljc | clojure | (ns com.fulcrologic.semantic-ui.elements.step.ui-step-content
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$StepContent" :as StepContent])))
(def ui-step-content
"A step can contain a content.
Props:
- as (elementType): An element type to render as (str... | |
3f20d34044957a30d8f6732b0f7aa6535caaed96a7672ef044fb5f9315107621 | appleshan/cl-http | undefmethod.lisp | (in-package "USER")
;;;
CLOS debugging utilities - OBC
;;;
(defun method-possible-qualifiers (qualifiers)
(let ((basicquals '(:before :after :around)))
(if (member qualifiers basicquals)
(list qualifiers)
(and (consp qualifiers)
(let ((qualifier (first qualifiers)))
(or (and (symbolp qualifie... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/acl/obc/server/undefmethod.lisp | lisp |
Here an interesting exercise: how to find
| (in-package "USER")
CLOS debugging utilities - OBC
(defun method-possible-qualifiers (qualifiers)
(let ((basicquals '(:before :after :around)))
(if (member qualifiers basicquals)
(list qualifiers)
(and (consp qualifiers)
(let ((qualifier (first qualifiers)))
(or (and (symbolp qualifier)
... |
cb454157ed0ad9b7b19f9b9867857502990c171793b96c6c1d062a9fde618049 | kazu-yamamoto/http3 | Decode.hs | # LANGUAGE BinaryLiterals #
module Network.QPACK.HeaderBlock.Decode where
import Control.Concurrent.STM
import qualified Data.ByteString.Char8 as BS8
import Data.CaseInsensitive
import Network.ByteOrder
import Network.HPACK (TokenHeader, HeaderTable, HeaderList)
import Network.HPACK.Internal
import Network.HPACK.Toke... | null | https://raw.githubusercontent.com/kazu-yamamoto/http3/93b2b18a3b92b313129b91b6cafefd8f228215db/Network/QPACK/HeaderBlock/Decode.hs | haskell | 4.5.2. Indexed Field Line | # LANGUAGE BinaryLiterals #
module Network.QPACK.HeaderBlock.Decode where
import Control.Concurrent.STM
import qualified Data.ByteString.Char8 as BS8
import Data.CaseInsensitive
import Network.ByteOrder
import Network.HPACK (TokenHeader, HeaderTable, HeaderList)
import Network.HPACK.Internal
import Network.HPACK.Toke... |
815f718085d3f2e40c8649471f3a95adab1f59f1ba64707251b7a83b1fdbea17 | processone/ejabberd-contrib | mod_push_offline_opt.erl | -module(mod_push_offline_opt).
-export([host/1]).
-spec host(gen_mod:opts() | global | binary()) -> binary().
host(Opts) when is_map(Opts) ->
gen_mod:get_opt(host, Opts);
host(Host) ->
gen_mod:get_module_opt(Host, mod_push_offline, host).
| null | https://raw.githubusercontent.com/processone/ejabberd-contrib/bad48b0d6afeabe8f98550919138984328e89ef5/mod_push_offline/src/mod_push_offline_opt.erl | erlang | -module(mod_push_offline_opt).
-export([host/1]).
-spec host(gen_mod:opts() | global | binary()) -> binary().
host(Opts) when is_map(Opts) ->
gen_mod:get_opt(host, Opts);
host(Host) ->
gen_mod:get_module_opt(Host, mod_push_offline, host).
| |
1ea64bd46f0c7254836888792b0d1e8b45834cbc5e465e00bc40853e9980d0c9 | johnwhitington/haskell-from-the-very-beginning-exercises | Examples.hs | p :: (Num a, Num b) => (a, b)
p = (1, 4)
q :: Num a => (a, Char)
q = (1, '1')
fst' :: (a, b) -> a
fst' (x, _) = x
snd' :: (a, b) -> b
snd' (_, y) = y
census :: (Num a, Num b) => [(a, b)]
census = [(1, 4), (2, 2), (3, 2), (4, 3), (5, 1), (6, 2)]
lookup' :: Eq a => a -> [(a, b)] -> Maybe b
lookup' k' [] =... | null | https://raw.githubusercontent.com/johnwhitington/haskell-from-the-very-beginning-exercises/18bda69bf8a0233feb6f023c6a2219b7c20e9fa1/examples/Chapter8/Examples.hs | haskell | p :: (Num a, Num b) => (a, b)
p = (1, 4)
q :: Num a => (a, Char)
q = (1, '1')
fst' :: (a, b) -> a
fst' (x, _) = x
snd' :: (a, b) -> b
snd' (_, y) = y
census :: (Num a, Num b) => [(a, b)]
census = [(1, 4), (2, 2), (3, 2), (4, 3), (5, 1), (6, 2)]
lookup' :: Eq a => a -> [(a, b)] -> Maybe b
lookup' k' [] =... | |
9ee6975dccddc129b505422bac66d0047e4a5884d746042f90620bca0a7067f7 | dimitaruzunov/fp-2018 | binary-tree.scm | (define (tree? t)
(or (null? t)
(and (list? t)
(= (length t) 3)
(tree? (cadr t))
(tree? (caddr t)))))
(define (make-tree root left right)
(list root left right))
(define root car)
(define left cadr)
(define right caddr)
(define empty? null?)
(define (leaf? tree)
(and (not... | null | https://raw.githubusercontent.com/dimitaruzunov/fp-2018/f75f0cd009cc7f41ce55a5ec71fb4b8eadafc4eb/exercises/06/binary-tree.scm | scheme | (define (tree? t)
(or (null? t)
(and (list? t)
(= (length t) 3)
(tree? (cadr t))
(tree? (caddr t)))))
(define (make-tree root left right)
(list root left right))
(define root car)
(define left cadr)
(define right caddr)
(define empty? null?)
(define (leaf? tree)
(and (not... | |
bb070935dded4fac2757ff9607439a5ac033ab5798e98ca7087f00424d6e07dd | Lupino/haskell-periodic | periodic-run.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Main
( main
) where
import Control.Concurrent (forkIO, killThread)
import Control.DeepSeq (rnf)
import Control.Monad (unless, void, when)
import Control.Monad.IO.Class ... | null | https://raw.githubusercontent.com/Lupino/haskell-periodic/d685e806caf3bb54575fc5cb1ca5a3bf1e98969c/periodic-client-exe/app/periodic-run.hs | haskell | # LANGUAGE OverloadedStrings #
| Fork a thread while doing something else, but kill it if there's an
exception.
This is important in the cases above because we want to kill the thread
that is holding the Handle lock, because when we clean up the process we
try to close that handle, which could otherwise deadlock.... | # LANGUAGE RecordWildCards #
module Main
( main
) where
import Control.Concurrent (forkIO, killThread)
import Control.DeepSeq (rnf)
import Control.Monad (unless, void, when)
import Control.Monad.IO.Class (liftIO)
import qualified Data.... |
0fbef6b395f3aef08358ad997e7f108428e40a493221e2e624a21950bae38801 | haskoin/haskoin-core | Keys.hs | |
Module : Haskoin . Test . Keys
Copyright : No rights reserved
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Module : Haskoin.Test.Keys
Copyright : No rights reserved
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
-}
... | null | https://raw.githubusercontent.com/haskoin/haskoin-core/d49455a27735dbe636453e870cf4e8720fb3a80a/src/Haskoin/Util/Arbitrary/Keys.hs | haskell | | Arbitrary private key with arbitrary compressed flag.
| Arbitrary keypair, both either compressed or not.
| Arbitrary extended private key.
| Arbitrary extended public key with its corresponding private key.
Custom derivations
| Arbitrary derivation index with last bit unset.
| Arbitrary BIP-32 path index. Ca... | |
Module : Haskoin . Test . Keys
Copyright : No rights reserved
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Module : Haskoin.Test.Keys
Copyright : No rights reserved
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
-}
... |
508cc6701e120fc6821a6742ec62d4aad863d2d6960f01de3c8ff489dd9e86f1 | egonSchiele/chips | Chips.hs | module Chips (
module Chips.Types
,module Chips.Core
,module Chips.Utils
,module Chips.Imports
,module Chips.UserInput
,module Chips.Globals
,module Chips.GameState
,module Chips.Enemies
,module Chips.Position
,module Chips.CurrentTile
,module Chips.Move
) where
import Chip... | null | https://raw.githubusercontent.com/egonSchiele/chips/14bb957f9ad42fa05c5edc56e50b90fcde461a77/src/Chips.hs | haskell | module Chips (
module Chips.Types
,module Chips.Core
,module Chips.Utils
,module Chips.Imports
,module Chips.UserInput
,module Chips.Globals
,module Chips.GameState
,module Chips.Enemies
,module Chips.Position
,module Chips.CurrentTile
,module Chips.Move
) where
import Chip... | |
bbe6342cb2746398795b6b61452f429a03de43031e4e808cf77c96fc38678eec | alda-lang/alda-core | repeats_test.clj | (ns alda.lisp.repeats-test
(:require [clojure.test :refer :all]
[alda.lisp :refer :all]))
(deftest repeats-test
(testing "alternate endings/numbered repeats"
(is (= [[(alda.lisp/note (alda.lisp/pitch :c))
(alda.lisp/note (alda.lisp/pitch :d))]
[(alda.lisp/note ... | null | https://raw.githubusercontent.com/alda-lang/alda-core/4c92eb4fe363485193c58b77b1ec8e36c8866fb5/test/alda/lisp/repeats_test.clj | clojure | (ns alda.lisp.repeats-test
(:require [clojure.test :refer :all]
[alda.lisp :refer :all]))
(deftest repeats-test
(testing "alternate endings/numbered repeats"
(is (= [[(alda.lisp/note (alda.lisp/pitch :c))
(alda.lisp/note (alda.lisp/pitch :d))]
[(alda.lisp/note ... | |
a8f10ce1c985076ecadf7e9df666b5dd70d650c20c94f8412bc61a3ea92c5927 | originrose/cortex | tensor_operations_test.clj | (ns ^:gpu cortex.compute.cuda.tensor-operations-test
(:require [cortex.verify.tensor.operations :as verify-tensor-operations]
[cortex.compute.verify.utils
:refer [def-double-float-test
def-all-dtype-test
*datatype*
def-int-long-te... | null | https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/test/clj/cortex/compute/cuda/tensor_operations_test.clj | clojure | (ns ^:gpu cortex.compute.cuda.tensor-operations-test
(:require [cortex.verify.tensor.operations :as verify-tensor-operations]
[cortex.compute.verify.utils
:refer [def-double-float-test
def-all-dtype-test
*datatype*
def-int-long-te... | |
70d159669cc6781d300f0410248c7378e5ff47bf1976b4a4710a121c74c436b9 | mindreframer/clojure-stuff | 06_functions.clj | (ns koans.06-functions
(:require [koan-engine.core :refer :all]))
(defn multiply-by-ten [n]
(* 10 n))
(defn square [n] (* n n))
(meditations
"Calling a function is like giving it a hug with parentheses"
(= __ (square 9))
"Functions are usually defined before they are used"
(= __ (multiply-by-ten 2))
... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/functional-koans/clojure-koans/src/koans/06_functions.clj | clojure | (ns koans.06-functions
(:require [koan-engine.core :refer :all]))
(defn multiply-by-ten [n]
(* 10 n))
(defn square [n] (* n n))
(meditations
"Calling a function is like giving it a hug with parentheses"
(= __ (square 9))
"Functions are usually defined before they are used"
(= __ (multiply-by-ten 2))
... | |
ef196212ae1373f856596c870ae0b9de6af9e8b23792874f1032220a4710fd6d | macourtney/Dark-Exchange | wants_panel.clj | (ns darkexchange.controller.offer.wants-panel
(:require [darkexchange.controller.widgets.currency-combobox :as currency-combobox]
[darkexchange.controller.widgets.payment-type-combobox :as payment-type-combobox]
[seesaw.core :as seesaw-core])
(:import [java.math BigDecimal]))
(defn find-i-w... | null | https://raw.githubusercontent.com/macourtney/Dark-Exchange/1654d05cda0c81585da7b8e64f9ea3e2944b27f1/src/darkexchange/controller/offer/wants_panel.clj | clojure | (ns darkexchange.controller.offer.wants-panel
(:require [darkexchange.controller.widgets.currency-combobox :as currency-combobox]
[darkexchange.controller.widgets.payment-type-combobox :as payment-type-combobox]
[seesaw.core :as seesaw-core])
(:import [java.math BigDecimal]))
(defn find-i-w... | |
9a1fa4f0a554a88ff0783a52bafe5352d25c310d8ecf4af73f517c60e47f5256 | PaulRivier/kiwi | Server.hs | {-# LANGUAGE OverloadedStrings #-}
module Kiwi.Server
( kiwiServer
) where
import Control.Concurrent (forkIO)
import Control.Monad.Reader
import Data.IORef (newIORef, readIORef, atomicWriteIORef)
import Data.List (stripPrefix, isInfixOf)
import Data . Mayb... | null | https://raw.githubusercontent.com/PaulRivier/kiwi/c89bd5b7586939f4491d56f3d842c731047c5830/src/Kiwi/Server.hs | haskell | # LANGUAGE OverloadedStrings #
import Data.Text (Text, intercalate)
import qualified Data.Text as T
import qualified Network.Wai as WAI
gets :: (AppState -> a) -> ServerM a
gets f = ask >>= return . f
servePage p
tags <- param "tags"
meta <- param "meta"
keys <- param "keys"
let pagesRootDir... |
module Kiwi.Server
( kiwiServer
) where
import Control.Concurrent (forkIO)
import Control.Monad.Reader
import Data.IORef (newIORef, readIORef, atomicWriteIORef)
import Data.List (stripPrefix, isInfixOf)
import Data . Maybe ( )
import qualified Data.Map.St... |
5a7f6f976fc6616de0fbdc405fb785fa8afc6130d26f81a4e0d9ae8c03265f74 | agentm/project-m36 | Deriving.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
| Newtypes for deriving instances with customization using
-- @DerivingVia@.
--
-- Inspired by
-- [Dhall.Deriving](-1.33.1/docs/Dhall-Derivin... | null | https://raw.githubusercontent.com/agentm/project-m36/57a75b35e84bebf0945db6dae53350fda83f24b6/src/lib/ProjectM36/Tupleable/Deriving.hs | haskell | @DerivingVia@.
Inspired by
[Dhall.Deriving](-1.33.1/docs/Dhall-Deriving.html)
required extensions:
* DerivingVia
* DataKinds (for types that take a string argument)
* Type-level Options
* Type-level 'T.Text' -> 'T.Text' Functions
* Composition
* Re-Exports
with customization.
The @tag@ type variable... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
| Newtypes for deriving instances with customization using
which in turn was inspired by blog post
[ Mirror Mirror : Reflection and En... |
07c7ec2f7356ba8c9a7ea3ed649f1e5a3d9395bc805c9d78ebc2c94e82640a9b | spell-music/csound-expression | AbletonLinkOpcodes.hs | module Csound.Typed.Opcode.AbletonLinkOpcodes (
link_beat_force, link_beat_get, link_beat_request, link_create, ableton_link_enable, link_is_enabled, link_metro, link_peers, link_tempo_get, link_tempo_set) where
import Control.Monad.Trans.Class
import Csound.Dynamic
import Csound.Typed
--
-- |
... | null | https://raw.githubusercontent.com/spell-music/csound-expression/29c1611172153347b16d0b6b133e4db61a7218d5/csound-expression-opcodes/src/Csound/Typed/Opcode/AbletonLinkOpcodes.hs | haskell |
|
csound doc: <>
|
Returns the beat, phase with respect to the local quantum, and current time for the session.
csound doc: <>
|
csound doc: <>
|
> i_peer link_create [i_bpm]
csound doc: <>
|
> ableton_link_enable i_peer [, k_enable]
csound doc: <>
|
> k_is_enabled link_is_e... | module Csound.Typed.Opcode.AbletonLinkOpcodes (
link_beat_force, link_beat_get, link_beat_request, link_create, ableton_link_enable, link_is_enabled, link_metro, link_peers, link_tempo_get, link_tempo_set) where
import Control.Monad.Trans.Class
import Csound.Dynamic
import Csound.Typed
Forces th... |
1ac3bc97f4a928a2aaa6da2e2452db1e5b54d51612fd3dcc340bb38b0ffd604b | JPMoresmau/dbIDE | Parser.hs | # LANGUAGE PatternGuards #
-- | Parses the output from GHCi
A lot of this work is Copyright 2014 . See < >
module Language.Haskell.Ghci.Parser
( parseShowModules
, parseLoad
)
where
import System.FilePath
import Data.Char
import Data.List
import Language.Haskell.Ghci.Types
-- | Parse messages from show... | null | https://raw.githubusercontent.com/JPMoresmau/dbIDE/dae37edf67fbe55660e7e22c9c5356d0ada47c61/ghci-lib/src/Language/Haskell/Ghci/Parser.hs | haskell | | Parses the output from GHCi
| Parse messages from show modules command
| Parse messages given on reload | # LANGUAGE PatternGuards #
A lot of this work is Copyright 2014 . See < >
module Language.Haskell.Ghci.Parser
( parseShowModules
, parseLoad
)
where
import System.FilePath
import Data.Char
import Data.List
import Language.Haskell.Ghci.Types
parseShowModules :: [String] -> [(String, FilePath)]
parseShow... |
edbcfe25431bcc9b66d2414c585969ea323b18ba5ed9f822a2de0f1f3df2acbd | aeternity/aeternity | aest_community_fork_SUITE.erl | -module(aest_community_fork_SUITE).
%=== EXPORTS ===================================================================
% Common Test exports
-export([all/0]).
-export([init_per_suite/1]).
-export([init_per_testcase/2]).
-export([end_per_testcase/2]).
-export([end_per_suite/1]).
% Test cases
-export([fork_chain/1, fork... | null | https://raw.githubusercontent.com/aeternity/aeternity/2b193881c42d86ed3ad360bae264cd8e0defa003/system_test/common/aest_community_fork_SUITE.erl | erlang | === EXPORTS ===================================================================
Common Test exports
Test cases
=== INCLUDES ==================================================================
=== COMMON TEST FUNCTIONS =====================================================
Some parameters depend on the speed and capaci... | -module(aest_community_fork_SUITE).
-export([all/0]).
-export([init_per_suite/1]).
-export([init_per_testcase/2]).
-export([end_per_testcase/2]).
-export([end_per_suite/1]).
-export([fork_chain/1, fork_sync/1]).
-import(aest_nodes, [
setup_nodes/2,
start_node/2,
stop_node/3,
wait_for_value/4,
wa... |
0ac26aae2ec3ab0234519376ac19b4d67a02a15a297001eaa6e37b8c51cb7c89 | hopv/homusat | HFS.mli | (* Hierarchical Function System *)
type simple_type =
| Prop
| Arrow of simple_type * simple_type
val string_of_simple_type : simple_type -> string
(* Formulas without fixed-point operators and lambda abstractions *)
type formula =
(* | Var of Id.t *)
(* Bare variables are expressed as empty applicat... | null | https://raw.githubusercontent.com/hopv/homusat/cc05711a3f9d45b253b83ad09a2d0288115cc4f4/HFS.mli | ocaml | Hierarchical Function System
Formulas without fixed-point operators and lambda abstractions
| Var of Id.t
Bare variables are expressed as empty applications
Fixed-point operators
Functions in HFS
HFS |
type simple_type =
| Prop
| Arrow of simple_type * simple_type
val string_of_simple_type : simple_type -> string
type formula =
| Or of formula list
| And of formula list
| Box of LTS.label * formula
| Diamond of LTS.label * formula
| App of Id.t * (formula list)
val string_of_formula : ... |
12729d1dd262045d75f6ac4a37d669b7adcc89b2e3b4880ba3c6d8998c9dcc8b | amuletml/amulet | Let.hs | # LANGUAGE FlexibleContexts , TypeFamilies , TupleSections #
module Syntax.Let where
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Graph
import Control.Lens
import Syntax.Var
import Syntax
import GHC.Exts (IsList(..))
depOrder :: Ord (Var p)
=> [Binding p]
-> [SCC... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Syntax/Let.hs | haskell | # LANGUAGE FlexibleContexts , TypeFamilies , TupleSections #
module Syntax.Let where
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Graph
import Control.Lens
import Syntax.Var
import Syntax
import GHC.Exts (IsList(..))
depOrder :: Ord (Var p)
=> [Binding p]
-> [SCC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.