_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 |
|---|---|---|---|---|---|---|---|---|
4cf1f9e32a81ad4bb428bc97f0d00f197a03a4a9c0ff02a4235cd48c68678728 | avsm/ocaml-orm-sqlite | foreign_tuple.ml | TYPE_CONV_PATH "Foreign_tuple"
type t = {
foo: string;
bar: int64;
} and x = {
first: (string * int64 * t);
second: t;
third: int;
} with orm
open OUnit
open Test_utils
let s = { foo="f1"; bar=59L }
let x = { first=("first",3434L,s); second=s; third=99 }
let name = "foreign_tuple.db"
let test_init () =
... | null | https://raw.githubusercontent.com/avsm/ocaml-orm-sqlite/0c41dee6e254abd75706edcb785f657bfe55d08b/lib_test/foreign_tuple.ml | ocaml | TYPE_CONV_PATH "Foreign_tuple"
type t = {
foo: string;
bar: int64;
} and x = {
first: (string * int64 * t);
second: t;
third: int;
} with orm
open OUnit
open Test_utils
let s = { foo="f1"; bar=59L }
let x = { first=("first",3434L,s); second=s; third=99 }
let name = "foreign_tuple.db"
let test_init () =
... | |
c46455e27fb520c26ce8868df24e3e6be8e94255915bde76c1a6ade880ff6a54 | district0x/district-ui-router | project.clj | (defproject district0x/district-ui-router "1.0.9-SNAPSHOT"
:description "district UI module for URI routing"
:url "-ui-router"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.597"]
... | null | https://raw.githubusercontent.com/district0x/district-ui-router/211d1346c1ed9b2e8cc5d956e0a9130591f289d7/project.clj | clojure | (defproject district0x/district-ui-router "1.0.9-SNAPSHOT"
:description "district UI module for URI routing"
:url "-ui-router"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.597"]
... | |
c917740e14df83b1d331ec210a1f37015cdccbe88f418fa3267658b933fbb31a | ciderpunx/57-exercises-for-programmers | P40FilterRecSpec.hs | module P40FilterRecSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P40FilterRec hiding (main)
import qualified Data.Map as M
import Data.Time.Clock
import Data.Time.Calendar
testData :: M.Map String [String]
testData =
M.fromList [ ("Johnson", ["John", "Manager", "20... | null | https://raw.githubusercontent.com/ciderpunx/57-exercises-for-programmers/25958ab80cc3edc29756d3bddd2d89815fd390bf/test/P40FilterRecSpec.hs | haskell | module P40FilterRecSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P40FilterRec hiding (main)
import qualified Data.Map as M
import Data.Time.Clock
import Data.Time.Calendar
testData :: M.Map String [String]
testData =
M.fromList [ ("Johnson", ["John", "Manager", "20... | |
7753a818a1671b6c6c9eeb08945918d794260743dc1b06656d87232dd20c587e | Workiva/eva | program.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/src/eva/query/datalog/program.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.query.datalog.program
(:require [eva.query.datalog.protocols :as p]
[clojure.core.unify :as u]
[eva.error :refer [insist]]))
(defn- subst-in-gen
"We have three datastructures... |
58fdb3261006bd0a56f1d76719ded0331da736412ea4485fd765a15b74565b2a | ejconlon/analyze | Analyze.hs | -- | See "Analyze.RFrame".
module Analyze
( module X
) where
import Analyze.Common as X
import Analyze.Conversions as X
import Analyze.Csv as X
import Analyze.Datasets as X
import Analyze.Decoding as X
import Analyze.Html as X
import Analyze.Ops as X
import Analyze.RFrame as X
import Analyze.Values as X
| null | https://raw.githubusercontent.com/ejconlon/analyze/b38eef0b735c01504980a155187517992a77f1f6/src/Analyze.hs | haskell | | See "Analyze.RFrame". | module Analyze
( module X
) where
import Analyze.Common as X
import Analyze.Conversions as X
import Analyze.Csv as X
import Analyze.Datasets as X
import Analyze.Decoding as X
import Analyze.Html as X
import Analyze.Ops as X
import Analyze.RFrame as X
import Analyze.Values as X
|
59d6e1d9e84bd02aa1894d68947ae0d1678a3fe0cb1a6221f8fd1d53b94bde87 | akabe/ocaml-numerical-analysis | kmeans.ml | * kmeans.ml --- K - means clustering
[ MIT License ] Copyright ( C ) 2015
[MIT License] Copyright (C) 2015 Akinori ABE
*)
open Format
module Array = struct
include Array
let iter2 f x y = iteri (fun i xi -> f xi y.(i)) x
let foldi f init x =
snd (fold_left (fun (i, acc) xi -> (i+1, f i acc... | null | https://raw.githubusercontent.com/akabe/ocaml-numerical-analysis/7dfe3b17d675fb73406a8e11ec0000b3489c5df5/k-means/kmeans.ml | ocaml | * [kmeans k xs] performs [k]-means clustering algorithm for data set [xs].
@return [(means, cs)] where [means] is an array of mean vectors, and [cs] is
an array such that the [i]-th element is the class number of [xs.(i)].
the dimension of a sample
Compute the mean of each class
sum += xi
Update class a... | * kmeans.ml --- K - means clustering
[ MIT License ] Copyright ( C ) 2015
[MIT License] Copyright (C) 2015 Akinori ABE
*)
open Format
module Array = struct
include Array
let iter2 f x y = iteri (fun i xi -> f xi y.(i)) x
let foldi f init x =
snd (fold_left (fun (i, acc) xi -> (i+1, f i acc... |
95068b9f0e4d8e9b9584a177ae2a677578b7b8fb90af13d159d719f79cb998b9 | beamparticle/beamparticle | memstore.erl | -module(memstore).
-export([init/0, create/3, read/2, update/3, delete/2]).
init() -> [].
create(K, V, []) -> [{K, V}];
create(K, V, [{K, _}|T]) -> [{K, V}|T];
create(K, V, [H|T]) -> [H|create(K, V, T)].
read(_, []) -> {error, not_found};
read(K, [{K, V}|_]) -> {ok, V};
read(K, [_|T]) -> read(K, T).
update(K, V, []... | null | https://raw.githubusercontent.com/beamparticle/beamparticle/65dcea1569d06b331b08cd9f8018ece4b176b690/backends/memstore.erl | erlang | -module(memstore).
-export([init/0, create/3, read/2, update/3, delete/2]).
init() -> [].
create(K, V, []) -> [{K, V}];
create(K, V, [{K, _}|T]) -> [{K, V}|T];
create(K, V, [H|T]) -> [H|create(K, V, T)].
read(_, []) -> {error, not_found};
read(K, [{K, V}|_]) -> {ok, V};
read(K, [_|T]) -> read(K, T).
update(K, V, []... | |
c5f3fb05755751de1a7511dbe13d0d2c49753c6ee11a61d0e1665b08c84d4a9f | gonimo/gonimo | Auth.hs | |
Module : . Client . Auth
Description : User facing Auth API
Copyright : ( c ) , 2018
Module : Gonimo.Client.Auth
Description : User facing Auth API
Copyright : (c) Robert Klotzner, 2018
-}
module Gonimo.Client.Auth where
import Gonimo.Client.Prelude
import qualified Gonimo.Sock... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/front/src/Gonimo/Client/Auth.hs | haskell | | Our Authentication data, if available.
| Authenticate sucessful. Connection is fully established.
You should wait for this event before sending server requests that require authentication.
TODO: Now redundant, because of isOnline.
| True if we are currently online (have a connection and are authenticated).
A... | |
Module : . Client . Auth
Description : User facing Auth API
Copyright : ( c ) , 2018
Module : Gonimo.Client.Auth
Description : User facing Auth API
Copyright : (c) Robert Klotzner, 2018
-}
module Gonimo.Client.Auth where
import Gonimo.Client.Prelude
import qualified Gonimo.Sock... |
90caa7260c18dbb1b7a8551b765928d67d96a9180145024574c95a4120be79c6 | static-analysis-engineering/codehawk | bCHELFSegment.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlibelf/bCHELFSegment.mli | ocaml | chutil
bchlib
bchlibelf | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
13f9a79e9ac9b247b612317e9bb227a61195dd58eb7525f40df646e441cccaa2 | danieljharvey/mimsa | MimsaHandler.hs | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
module Server.MimsaHandler
( runMimsaHandlerT,
throwMim... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/7931b803a9f7e71ff47dc9afa7dc6bceaeb238ee/server/server/Server/MimsaHandler.hs | haskell | magic version of handler that allows throwing of custom errors
from -servant/servant/blob/c1105899f47d5537c1bdc8c86bee3523bdf05282/doc/cookbook/uverb/UVerb.lhs
underlying monad's instance.
| This combinator runs 'MimsaHandlerT'. It applies 'respond' internally, so the handler
may use the usual 'return'.
| Short-c... | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
module Server.MimsaHandler
( runMimsaHandlerT,
throwMim... |
139f88856126a9bc11d3068636e14d9e0cacbde9c6e0489a84e3a0540d999b88 | contivero/hasmin | PercentageLength.hs | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
-----------------------------------------------------------------------------
-- |
-- Module : Hasmin.Types.PercentageLength
Copyright : ( c ) 2017
-- License : BSD3
-- Stability : experimental
-- Portability : non-portable
--
--------------------... | null | https://raw.githubusercontent.com/contivero/hasmin/2a7604159b51e69c5e9c564dce53cb3ab09ae22b/src/Hasmin/Types/PercentageLength.hs | haskell | ---------------------------------------------------------------------------
|
Module : Hasmin.Types.PercentageLength
License : BSD3
Stability : experimental
Portability : non-portable
---------------------------------------------------------------------------
| CSS <length-percentage> data type, i.e.:... | # LANGUAGE FlexibleInstances , TypeSynonymInstances #
Copyright : ( c ) 2017
module Hasmin.Types.PercentageLength
( PercentageLength
, isZero
, isNonZeroPercentage
, minifyPL
) where
import Control.Monad.Reader (Reader)
import Hasmin.Class
import Hasmin.Config
import Hasmin.Types.Dimension... |
2c1fcb19dc535f82fb402f2052f3fd59183b866961a0f007e5a58f373e873faf | Enecuum/Node | TstScenarios.hs | module Enecuum.Samples.Assets.TstScenarios (
module X
) where
import Enecuum.Samples.Assets.Nodes.Client as X
import Enecuum.Samples.Assets.Nodes.TstNodes.GenPoA.Config as X
import Enecuum.Samples.Assets.Nodes.TstNodes.GenPoA.Node as X
import Enec... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Samples/Assets/TstScenarios.hs | haskell | module Enecuum.Samples.Assets.TstScenarios (
module X
) where
import Enecuum.Samples.Assets.Nodes.Client as X
import Enecuum.Samples.Assets.Nodes.TstNodes.GenPoA.Config as X
import Enecuum.Samples.Assets.Nodes.TstNodes.GenPoA.Node as X
import Enec... | |
9968c8e6f03b1b5702e36e29c090625001d31ba882ea3740d3cce8bd0f6caec4 | originrose/think.image | patch.clj | (ns think.image.patch
(:require [think.image.core]
[think.image.image :as image]
[mikera.image.core :as mi]
[mikera.image.protocols :as protos]
[think.image.pixel :as pixel]
[think.image.image-util :as image-util]
[clojure.core.matrix :as mat]
... | null | https://raw.githubusercontent.com/originrose/think.image/0179d104d5fa74977890942858b44e1349457514/src/clj/think/image/patch.clj | clojure | Cutoff for if something is considered in the mask or not. | (ns think.image.patch
(:require [think.image.core]
[think.image.image :as image]
[mikera.image.core :as mi]
[mikera.image.protocols :as protos]
[think.image.pixel :as pixel]
[think.image.image-util :as image-util]
[clojure.core.matrix :as mat]
... |
bdb0260fef7f2ba6c675a5c41f740c35c043e367ea53c8742106dad41b3ac399 | egison/egison | Maxima.hs | |
Module : Language . . PrettyMath . Maxima
Licence : MIT
Module : Language.Egison.PrettyMath.Maxima
Licence : MIT
-}
module Language.Egison.PrettyMath.Maxima
( showMathExpr
) where
import Language.Egison.PrettyMath.AST
showMathExpr :: MathExpr -> String
showMathExpr (Atom ... | null | https://raw.githubusercontent.com/egison/egison/df4e47f7c8adfe90d9bf408459772a6cb4e71b70/hs-src/Language/Egison/PrettyMath/Maxima.hs | haskell | |
Module : Language . . PrettyMath . Maxima
Licence : MIT
Module : Language.Egison.PrettyMath.Maxima
Licence : MIT
-}
module Language.Egison.PrettyMath.Maxima
( showMathExpr
) where
import Language.Egison.PrettyMath.AST
showMathExpr :: MathExpr -> String
showMathExpr (Atom ... | |
cf9cb88d2866c4807cfabdc2ba73a4902a15b727fe2bbb0bbbf98c3f96ef4bbf | NoRedInk/haskell-libraries | Connection.hs | module Postgres.Connection (connection, connectionIO, SingleOrPool (..), Connection (..)) where
import qualified Control.Exception.Safe as Exception
import qualified Data.Acquire
import qualified Data.Pool
import qualified Data.Text.Encoding
import Database.PostgreSQL.Typed
( PGConnection,
PGDatabase (PGDatabase... | null | https://raw.githubusercontent.com/NoRedInk/haskell-libraries/7af1e05549e09d519b08ab49dff956b5a97d4f7e/nri-postgresql/src/Postgres/Connection.hs | haskell | | A connection to Postgres. You need this for making Postgres queries.
| A database connection type.
Defining our own type makes it easier to change it in the future, without
having to fix compilation errors all over the codebase.
| By default a connection pool is passed around. It will:
- Create new connec... | module Postgres.Connection (connection, connectionIO, SingleOrPool (..), Connection (..)) where
import qualified Control.Exception.Safe as Exception
import qualified Data.Acquire
import qualified Data.Pool
import qualified Data.Text.Encoding
import Database.PostgreSQL.Typed
( PGConnection,
PGDatabase (PGDatabase... |
4734aecbcd3005d9ad454ae12f6c44d2862b895ada71f6c0f81f82d979fe68ac | stan-dev/stanc3 | Lower_functions.ml | open Core_kernel
open Middle
open Lower_expr
open Lower_stmt
open Cpp
* Detect if argument requires C++ template
let is_data_matrix_or_not_int_type = function
| UnsizedType.DataOnly, _, ut -> UnsizedType.is_eigen_type ut
| _, _, t when UnsizedType.is_int_type t -> false
| _ -> true
* Print template arguments fo... | null | https://raw.githubusercontent.com/stan-dev/stanc3/1c5a68d3453903e1f0fd4f332cbed12e7231e63c/src/stan_math_backend/Lower_functions.ml | ocaml | * Pretty-prints a function's return-type, taking into account templated argument
promotion.
*
Prints boilerplate at start of function. Body of function wrapped in a `try` block.
Side effecting, collates functor structs
Testing code | open Core_kernel
open Middle
open Lower_expr
open Lower_stmt
open Cpp
* Detect if argument requires C++ template
let is_data_matrix_or_not_int_type = function
| UnsizedType.DataOnly, _, ut -> UnsizedType.is_eigen_type ut
| _, _, t when UnsizedType.is_int_type t -> false
| _ -> true
* Print template arguments fo... |
9c383fffb0ca3cda156a713b7be1bdf69b88e4fe920ea6df58e3dce8d7cec62e | digikar99/numericals | package.lisp | (defpackage :sbcl-numericals
(:use)
(:export
;; configuration
:*array-element-type*
:*automatically-upgrade-array-element-type*
:*automatically-convert-lists-to-arrays*
;; utilities
:with-simd-operations
;; unoptimized array-operations
:asarray
:array-like-p
AVX2 based array operatio... | null | https://raw.githubusercontent.com/digikar99/numericals/4f82b74e32b054f65110ee62ba080603c92ac103/sbcl-numericals/src/package.lisp | lisp | configuration
utilities
unoptimized array-operations | (defpackage :sbcl-numericals
(:use)
(:export
:*array-element-type*
:*automatically-upgrade-array-element-type*
:*automatically-convert-lists-to-arrays*
:with-simd-operations
:asarray
:array-like-p
AVX2 based array operations
:s-
:s+
:s*
:s/
:d-
:d+
:d*
:d/
:ddot
... |
4c540d4314689d612118f09c43360f645b9de911df8b865719c6e140fc7c866d | achirkin/qua-kit | Service.hs | -----------------------------------------------------------------------------
-- |
Module : . . Service
Copyright : ( c )
License : MIT
--
Maintainer : < >
-- Stability : experimental
--
-- This module is responsible for managing all services:
-- register, unregister, process... | null | https://raw.githubusercontent.com/achirkin/qua-kit/9f859e2078d5f059fb87b2f6baabcde7170d4e95/apps/hs/helen/src/Helen/Core/Service.hs | haskell | ---------------------------------------------------------------------------
|
Stability : experimental
This module is responsible for managing all services:
register, unregister, process message.
TODO: When any client disconnects, I need to send cancel messages to all
nonBlocking pending services.
... | Module : . . Service
Copyright : ( c )
License : MIT
Maintainer : < >
module Helen.Core.Service
( defServiceManager
, processMessage
, registerService, unregisterService
) where
import Control.Arrow ((&&&))
import qualified Control.Lens as... |
6c239c9848ae179fc224b67171014d9b8fbd3eeebdff51b338c32561b84724c3 | slyrus/mcclim-old | lisp-button.lisp | ;;; -*- Mode: Lisp; Package: beagle; -*-
( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000,2001 by
;;; Iban Hatchondo ()
( )
( )
( c ) copyright 2003 , 2004 by
( )
;;; This library is free software; you can redistribute it and/or
modify it ... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Backends/beagle/native/lisp-button.lisp | lisp | -*- Mode: Lisp; Package: beagle; -*-
Iban Hatchondo ()
This library is free software; you can redistribute it and/or
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE... |
( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000,2001 by
( )
( )
( c ) copyright 2003 , 2004 by
( )
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General ... |
9126c4c42e48ee29792cb91edbc72f96c3a1bc8ac0dc2826ff229eb70b25f2ce | serokell/ariadne | Knit.hs | module Knit
( module X
) where
import NType as X
import Knit.Argument as X
import Knit.Autocompletion as X
import Knit.Core as X
import Knit.DisplayError as X
import Knit.Eval as X
import Knit.FormattedExprExt as X
import Knit.Inflate as X
import Knit.Name as X
import Knit.Parser as X
import Knit.ParseT... | null | https://raw.githubusercontent.com/serokell/ariadne/5f49ee53b6bbaf332cb6f110c75f7b971acdd452/knit/src/Knit.hs | haskell | module Knit
( module X
) where
import NType as X
import Knit.Argument as X
import Knit.Autocompletion as X
import Knit.Core as X
import Knit.DisplayError as X
import Knit.Eval as X
import Knit.FormattedExprExt as X
import Knit.Inflate as X
import Knit.Name as X
import Knit.Parser as X
import Knit.ParseT... | |
3fa314340cbf05d7e54bc83d691c66d4f17ea6b994e07ce62dcd88574f3b54c4 | janestreet/krb | test_mode_protocol.ml | open! Core
open! Async
include Test_mode_protocol_intf
module Header = struct
type t = Protocol_version_header.t [@@deriving bin_io]
let v1 =
Protocol_version_header.create_exn
()
~protocol:Krb_test_mode
~supported_versions:[ 1 ]
;;
end
module Syn = struct
type t = Principal.Stable.Name... | null | https://raw.githubusercontent.com/janestreet/krb/c4f65f0b57c81f8ab6a77417e30105f4c16916a9/src/test_mode_protocol.ml | ocaml | open! Core
open! Async
include Test_mode_protocol_intf
module Header = struct
type t = Protocol_version_header.t [@@deriving bin_io]
let v1 =
Protocol_version_header.create_exn
()
~protocol:Krb_test_mode
~supported_versions:[ 1 ]
;;
end
module Syn = struct
type t = Principal.Stable.Name... | |
0f742f53fd175feae52d9f6e034134d4dc4aae4fd37ed817178bc03b6b9ff5ce | robert-strandh/SICL | arrangement.lisp | (cl:in-package #:sicl-register-allocation)
(defvar *input-arrangements*)
(defun input-arrangement-p (instruction)
(nth-value 1 (gethash instruction *input-arrangements*)))
(defun input-arrangement (instruction)
(multiple-value-bind (value value-p)
(gethash instruction *input-arrangements*)
(assert valu... | null | https://raw.githubusercontent.com/robert-strandh/SICL/bd3ec8f991d9455541d1629a3c672ae3d46dc16d/Code/Compiler/MIR-to-LIR/Register-allocation/arrangement.lisp | lisp | (cl:in-package #:sicl-register-allocation)
(defvar *input-arrangements*)
(defun input-arrangement-p (instruction)
(nth-value 1 (gethash instruction *input-arrangements*)))
(defun input-arrangement (instruction)
(multiple-value-bind (value value-p)
(gethash instruction *input-arrangements*)
(assert valu... | |
70bbaf69dd4429a63ce58791a278b051f8f553a22fe5c39db55b1ada721f9e5e | goldfirere/singletons | Singletons.hs | # LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
-----------------------------------------------------------------------------
-- |
Module : Control . Monad . Singletons
Copyright : ( C ) 2018
-- License ... | null | https://raw.githubusercontent.com/goldfirere/singletons/00dc8865f080f2ca347ed44c68cd37c99b7a277b/singletons-base/src/Control/Monad/Singletons.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see LICENSE)
Stability : experimental
Portability : non-portable
Defines the promoted and singled versions of the 'Monad' type class.
-----------------------------------------------------------------------... | # LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
Module : Control . Monad . Singletons
Copyright : ( C ) 2018
Maintainer :
module Control.Monad.Singletons (
PFunctor(Fmap), SFunctor(sFmap),
PMo... |
870e8d34781db98b0ad2730d394dc0da5f6710811f857469d6f697c17c8ab8ba | lambdabot/lambdabot | Fresh.hs | -- | Haskell project name generation
-- semi-joke
module Lambdabot.Plugin.Misc.Fresh (freshPlugin) where
import Lambdabot.Plugin
import Control.Monad.Trans
import Data.Char
type Fresh = ModuleT Integer LB
freshPlugin :: Module Integer
freshPlugin = newModule
{ moduleDefState = return 0
, moduleSerialize = J... | null | https://raw.githubusercontent.com/lambdabot/lambdabot/de01f362c7a8fc6f85c37e604168dcccb1283a0e/lambdabot-misc-plugins/src/Lambdabot/Plugin/Misc/Fresh.hs | haskell | | Haskell project name generation
semi-joke | module Lambdabot.Plugin.Misc.Fresh (freshPlugin) where
import Lambdabot.Plugin
import Control.Monad.Trans
import Data.Char
type Fresh = ModuleT Integer LB
freshPlugin :: Module Integer
freshPlugin = newModule
{ moduleDefState = return 0
, moduleSerialize = Just stdSerial
, moduleCmds = return
... |
c3e301af75f2dd1fdce8555b9328d31eab05127cfe48c60e5b43d284a7ba7cb7 | ghc/ghc | T22840A.hs | module T22840A where
data T = MkT !(Maybe Bool)
disp :: T -> String
disp (MkT b) =
case b of
Nothing -> "Nothing"
Just _ -> "Just"
| null | https://raw.githubusercontent.com/ghc/ghc/3b019a7ac8fc9059cc3213f6f95a2daef97ca442/testsuite/tests/simplStg/should_compile/T22840A.hs | haskell | module T22840A where
data T = MkT !(Maybe Bool)
disp :: T -> String
disp (MkT b) =
case b of
Nothing -> "Nothing"
Just _ -> "Just"
| |
53e8815c53426abaf0abddfdcfbcc9e1a2c938b148812e4ee2e8e34e81d7f1d6 | OCamlPro/ocaml-solidity | solidity_ast.mli | (**************************************************************************)
(* *)
Copyright ( c ) 2021 OCamlPro & Origin Labs
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/ocaml-solidity/b628fd0200f648eb8bca73fe81efd9cec820e26f/src/solidity-common/solidity_ast.mli | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2021 OCamlPro & Origin Labs
Public License version 2.1 , with the special exception on linking
open Solidity_common
type ident = Ident.t node
type longident = relative LongIdent.t node
type program = {
program_modules : module_ list;
program_modules_by_id ... |
02f5ce5d03f461350c848535d2f08cca7775b42ed08ea5ec52793fa01f758f57 | parapluu/Concuerror | depend_6_5.erl | -module(depend_6_5).
-export([result/0, procs/0, run/1]).
result() -> io:format("12").
procs() -> io:format("4").
run(Procs) ->
[S] = io_lib:format("~p",[Procs]),
initial(),
run_aux(S),
block().
run_aux([]) -> ok;
run_aux([P|R]) ->
spawn(fun() -> proc(P) end),
run_aux(R).
block() ->
re... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/resources/perm_tests/src/depend_6_5.erl | erlang | -module(depend_6_5).
-export([result/0, procs/0, run/1]).
result() -> io:format("12").
procs() -> io:format("4").
run(Procs) ->
[S] = io_lib:format("~p",[Procs]),
initial(),
run_aux(S),
block().
run_aux([]) -> ok;
run_aux([P|R]) ->
spawn(fun() -> proc(P) end),
run_aux(R).
block() ->
re... | |
b7bca056a24749b6d93ec9b13c7910cb6f7ae390f505f20ace2c1e8d3cc7fff1 | anmonteiro/ocaml-cpuinfo | test_cpuinfo.ml | let () = Format.eprintf "#cpu: %d@." (Cpuinfo.cores ())
| null | https://raw.githubusercontent.com/anmonteiro/ocaml-cpuinfo/816311ef5ad15b846157ef61e68d6a0b28a1aaf7/test/test_cpuinfo.ml | ocaml | let () = Format.eprintf "#cpu: %d@." (Cpuinfo.cores ())
| |
31ca0bca2bd0ed87791c0906dfb4c6c3388758b1c5b2e5528c75cc55808936c3 | pallet/pallet | phase_test.clj | (ns pallet.phase-test
(:require
[clojure.test :refer :all]
[pallet.api :refer [plan-fn]]
[pallet.common.logging.logutils :refer [logging-threshold-fixture]]
[pallet.core.session :refer [session with-session]]
[pallet.phase
:refer [all-phases-for-phase
post-phase-name
pre-pha... | null | https://raw.githubusercontent.com/pallet/pallet/30226008d243c1072dcfa1f27150173d6d71c36d/test/pallet/phase_test.clj | clojure | These are failing due to the side effects of the state-checking-t
being bypassed by the (= lr expr) optimisation in monad-expr in
c.algo.monads
(deftest plan-fn-test
(letfn [(id [s] [nil s])]
(is (thrown-with-msg?
clojure.lang.ExceptionInfo #"in phase session"
(is (= [nil (test-session)] ((p... | (ns pallet.phase-test
(:require
[clojure.test :refer :all]
[pallet.api :refer [plan-fn]]
[pallet.common.logging.logutils :refer [logging-threshold-fixture]]
[pallet.core.session :refer [session with-session]]
[pallet.phase
:refer [all-phases-for-phase
post-phase-name
pre-pha... |
b89978e697ca49a713391bba90f8f3414febd82583d62d729de7695c6555b128 | skanev/playground | 82.scm | SICP exercise 2.82
;
; Show how the generalize apply-generic to handle coercion in the general case
of multiple arguments . One strategy is to attempt to coerce all the
arguments to the type of the first argument , then to the type of the second
; argument, and so on. Give an example of a situation where this str... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/82.scm | scheme |
Show how the generalize apply-generic to handle coercion in the general case
argument, and so on. Give an example of a situation where this strategy (and
(Hint: consider the case where there are some suitable mixed-type operations
present in the table that will not be tried.)
infrastructure. We shall not use real... | SICP exercise 2.82
of multiple arguments . One strategy is to attempt to coerce all the
arguments to the type of the first argument , then to the type of the second
likewise the two - argument version given above ) is not sufficiently general .
We want to test this . So first , we are going to implement all ... |
2431c65980a5640fb434fae70dc1062b723aaf93ca5d9bfaa5628d327c9566ee | didierverna/clon | constants.lisp | ;;; constants.lisp --- CFFI operating system interface
Copyright ( C ) 2010 - 2012 , 2015
Author : < >
This file is part of .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this pe... | null | https://raw.githubusercontent.com/didierverna/clon/8d431d288ef2488c7c4fa8d14a61ebe9362cdaff/termio/cffi/constants.lisp | lisp | constants.lisp --- CFFI operating system interface
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRAN... |
Copyright ( C ) 2010 - 2012 , 2015
Author : < >
This file is part of .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
... |
8c2e9f6b593e472cba6d0c9ecd11d0e1f4210dd79e604382570f1c87e1442024 | tfausak/strive | Authentication.hs | -- | </>
module Strive.Actions.Authentication
( buildAuthorizeUrl,
exchangeToken,
deauthorize,
)
where
import Data.ByteString.Char8 (unpack)
import Network.HTTP.Types (Query, renderQuery, toQuery)
import Strive.Aliases
( ApplicationId,
ApplicationSecret,
AuthorizationCode,
RedirectUri,
Re... | null | https://raw.githubusercontent.com/tfausak/strive/8bd61df4b2723301273b11589c5f237b42e934dc/source/library/Strive/Actions/Authentication.hs | haskell | | </>
| </#get-authorize>
| </#post-token>
| </#deauthorize> | module Strive.Actions.Authentication
( buildAuthorizeUrl,
exchangeToken,
deauthorize,
)
where
import Data.ByteString.Char8 (unpack)
import Network.HTTP.Types (Query, renderQuery, toQuery)
import Strive.Aliases
( ApplicationId,
ApplicationSecret,
AuthorizationCode,
RedirectUri,
Result,
)... |
570d2b50c38701e65c119795eef67eabcb8c596e07d712f32736a0c141f311f9 | heroku/ranch_proxy_protocol | ranch_proxy_protocol_test_protocol.erl | -module(ranch_proxy_protocol_test_protocol).
-export([start_link/4,
init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, Opts) ->
ok = ranch:accept_ack(Ref),
Tester = proplists:get_value... | null | https://raw.githubusercontent.com/heroku/ranch_proxy_protocol/59046e5e40f8c573c5b15ae0358e78bd8b211ab6/test/ranch_proxy_protocol_test_protocol.erl | erlang | -module(ranch_proxy_protocol_test_protocol).
-export([start_link/4,
init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, Opts) ->
ok = ranch:accept_ack(Ref),
Tester = proplists:get_value... | |
1f465151a450c81b1c73dfef699d00d121c1077315586d7c770f7d889752e8e3 | ninenines/gun | cookie_set_h.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(cookie_set_h).
-export([init/2]).
init(Req0, State) ->
SetCookieList = set_cookie_list(Req0),
Req = cowboy_req:set_resp_header(<<"set-cookie">>, SetCookieList, Req0),
{ok, cowboy_req:reply(204, Req), State}.
-define(HOST, "web-platform.test").
... | null | https://raw.githubusercontent.com/ninenines/gun/180ce23aba863d94c17ee0667cad1ed916f56da1/test/handlers/cookie_set_h.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(cookie_set_h).
-export([init/2]).
init(Req0, State) ->
SetCookieList = set_cookie_list(Req0),
Req = cowboy_req:set_resp_header(<<"set-cookie">>, SetCookieList, Req0),
{ok, cowboy_req:reply(204, Req), State}.
-define(HOST, "web-platform.test").
set_cookie_list(#{qs := <<"domain_with_and_without_leading_p... |
07789607368ac444aced2b1ac9f3cc29e159c837cd48c568932d4904c5861c42 | erlymon/erlymon | em_http_api_users_handler.erl | %%%-------------------------------------------------------------------
@author
( C ) 2015 , < >
%%% @doc
Erlymon is an open source GPS tracking system for various GPS tracking devices .
%%%
Copyright ( C ) 2015 , < > .
%%%
This file is part of Erlymon .
%%%
Erlymon is free software : yo... | null | https://raw.githubusercontent.com/erlymon/erlymon/2250619783d6da1e33a502911a8fa52ce016c094/apps/erlymon/src/em_http/handlers/em_http_api_users_handler.erl | erlang | -------------------------------------------------------------------
@doc
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see </>.
@end
-------------------------------------------------------... | @author
( C ) 2015 , < >
Erlymon is an open source GPS tracking system for various GPS tracking devices .
Copyright ( C ) 2015 , < > .
This file is part of Erlymon .
Erlymon is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Publ... |
05ea18fe9552eade90fa8c7669c925be9c809f559d311054354f060fa2e28b1e | haskell-opengl/OpenGLRaw | Types.hs | # LANGUAGE CPP #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.Types
Copyright : ( c ) 2009 - 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-- All types from the whole OpenGL ... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/Types.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.Types
License : BSD3
Stability : stable
Portability : portable
All types from the whole OpenGL registry.
------------------------------------------------------------------------------
* Types f... | # LANGUAGE CPP #
Copyright : ( c ) 2009 - 2019
Maintainer : < >
module Graphics.GL.Types (
GLboolean,
GLbyte,
GLubyte,
GLchar,
GLshort,
GLushort,
GLint,
GLuint,
GLfixed,
GLint64,
GLuint64,
GLsizei,
GLenum,
GLintptr,
GLsizeiptr,
GLsync,
GLbitfield,
GLhalf,
GLfloat... |
c1076f3d0eddf8beaaa38a8f74b6fea81c17e778ef4a37dde1fa9491e68f3dce | replikativ/datahike | migrate_test.clj | (ns datahike.test.migrate-test
(:require [clojure.test :refer :all]
[datahike.api :as d]
[datahike.datom :as datom]
[datahike.migrate :as m]
[datahike.test.utils :as utils]))
(def tx-data [[:db/add 1 :db/cardinality :db.cardinality/one 536870913 true]
[:d... | null | https://raw.githubusercontent.com/replikativ/datahike/6c1468fd833ed8079b482fe934ae08f1ca2dda3c/test/datahike/test/migrate_test.clj | clojure | (ns datahike.test.migrate-test
(:require [clojure.test :refer :all]
[datahike.api :as d]
[datahike.datom :as datom]
[datahike.migrate :as m]
[datahike.test.utils :as utils]))
(def tx-data [[:db/add 1 :db/cardinality :db.cardinality/one 536870913 true]
[:d... | |
398bd69ec0c40f2aa7ebbc8cf3b543213f0285a85cebd0e5c7d9d3fd84158cc6 | ds-wizard/engine-backend | Locale.hs | module Shared.Database.Mapping.Locale.Locale where
import Database.PostgreSQL.Simple
import Shared.Model.Locale.Locale
instance ToRow Locale
instance FromRow Locale
| null | https://raw.githubusercontent.com/ds-wizard/engine-backend/0ec94a4b0545f2de8a4e59686a4376023719d5e7/engine-shared/src/Shared/Database/Mapping/Locale/Locale.hs | haskell | module Shared.Database.Mapping.Locale.Locale where
import Database.PostgreSQL.Simple
import Shared.Model.Locale.Locale
instance ToRow Locale
instance FromRow Locale
| |
bb0f06fd2aa9a6e7c236d1d436d920fed3d399c0663b2d0f9090310044031452 | redbadger/karma-tracker | config.cljs | (ns karma-tracker-ui.config)
(def debug? ^boolean
js/goog.DEBUG)
(goog-define api-url ":8000/api")
| null | https://raw.githubusercontent.com/redbadger/karma-tracker/c5375f32f4cd0386f6bb1560d979b79bceea19e2/ui/src/cljs/karma_tracker_ui/config.cljs | clojure | (ns karma-tracker-ui.config)
(def debug? ^boolean
js/goog.DEBUG)
(goog-define api-url ":8000/api")
| |
fec28eb2fdb1dfc45d65acc106c0fb02c1c907022c47c0b0d26d608f8aca5361 | circuithub/rel8 | Maybe.hs | # language GADTs #
# language LambdaCase #
# language NamedFieldPuns #
module Rel8.Query.Maybe
( optional
, catMaybeTable
, traverseMaybeTable
)
where
-- base
import Prelude
-- comonad
import Control.Comonad ( extract )
-- opaleye
import qualified Opaleye.Internal.MaybeFields as Opaleye
-- rel8
import Rel8... | null | https://raw.githubusercontent.com/circuithub/rel8/f47423ec17c36f441bab4c0cbb2036dc8aecacbd/src/Rel8/Query/Maybe.hs | haskell | base
comonad
opaleye
rel8
This operation can be used to "undo" the effect of 'optional', which
operationally is like turning a @LEFT JOIN@ back into a full @JOIN@. You
| Extend an optional query with another query. This is useful if you want
to step through multiple @LEFT JOINs@.
Note that @traverseMaybeT... | # language GADTs #
# language LambdaCase #
# language NamedFieldPuns #
module Rel8.Query.Maybe
( optional
, catMaybeTable
, traverseMaybeTable
)
where
import Prelude
import Control.Comonad ( extract )
import qualified Opaleye.Internal.MaybeFields as Opaleye
import Rel8.Expr ( Expr )
import Rel8.Expr.Eq ( (... |
73643189e1a22e0efd6ba29dbb3cb6463fe75e9b168e3c0dd4ad8ae4993f98a6 | protojure/lib | hello.clj | ;;;----------------------------------------------------------------------------------
;;; Generated by protoc-gen-clojure. DO NOT EDIT
;;;
;;; Message Implementation of package com.sttgts.omnia.hello
;;;----------------------------------------------------------------------------------
(ns example.hello
(:require [pr... | null | https://raw.githubusercontent.com/protojure/lib/5b0b986d55455739ed18842557fbec9d6fd3ead5/test/test/example/hello.clj | clojure | ----------------------------------------------------------------------------------
Generated by protoc-gen-clojure. DO NOT EDIT
Message Implementation of package com.sttgts.omnia.hello
----------------------------------------------------------------------------------
------------------------------------------------... | (ns example.hello
(:require [protojure.protobuf.protocol :as pb]
[protojure.protobuf.serdes.core :refer :all]
[protojure.protobuf.serdes.complex :refer :all]
[protojure.protobuf.serdes.utils :refer [tag-map]]
[protojure.protobuf.serdes.stream :as stream]
[cl... |
78171cf4a0fbda343090cf0a7709507a90d7b099f2dccb4d82634d28b7dcceb0 | metaocaml/ber-metaocaml | t130-vectlength.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Array.length [| 1; 2 |] <> 2 then raise Not_found;;
*
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t130-vectlength.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Array.length [| 1; 2 |] <> 2 then raise Not_found;;
*
... | |
e52001ed25184bbf0edfe8cca951fdda1c0fb4a8cdadb8409cc2cd8cfe489f7f | deadtrickster/prometheus-cowboy | prometheus_cowboy2_app.erl | @private
-module(prometheus_cowboy2_app).
%% API.
-export([start/0]).
%% API.
start() ->
prometheus_http_impl:setup(),
Routes = [
{'_', [
{"/metrics/[:registry]", prometheus_cowboy2_handler, []},
{"/qwe", qwe_handler, []}
]}
],
Di... | null | https://raw.githubusercontent.com/deadtrickster/prometheus-cowboy/24a29e2f0b096f739587a526bc927a951c44b862/test/cowboy2/prometheus_cowboy2_app.erl | erlang | API.
API. | @private
-module(prometheus_cowboy2_app).
-export([start/0]).
start() ->
prometheus_http_impl:setup(),
Routes = [
{'_', [
{"/metrics/[:registry]", prometheus_cowboy2_handler, []},
{"/qwe", qwe_handler, []}
]}
],
Dispatch = cowboy_... |
b51079777ddf7f33c3429fc56c773af22b3c82a0d2e54bdb8b55926540802498 | egonSchiele/salty | ToPhp.hs | module ToPhp where
import Types
import Print
import Data.List (intercalate)
import Utils (isConstant, join, stripNewline)
initToPhp body = join "\n" $ map toPhp (init body)
stripNewlineToPhp (WithNewLine salty) = toPhp salty
stripNewlineToPhp salty = toPhp salty
simpleVarName :: VariableName -> String
simpleVarName x... | null | https://raw.githubusercontent.com/egonSchiele/salty/7cb31f35ef0c9d63777d7499174884d7a4054dbb/src/ToPhp.hs | haskell | this is a hack -- it's the same as the statement above just w the WithNewLine added.
toPhp (Operation x@(Variable _ _) Equals (WithNewLine (HigherOrderFunctionCall obj callName func accVar))) = toPhp $ HigherOrderFunctionCall obj callName func (varName x)
functions called without an object (bare)
builtin bare funct... | module ToPhp where
import Types
import Print
import Data.List (intercalate)
import Utils (isConstant, join, stripNewline)
initToPhp body = join "\n" $ map toPhp (init body)
stripNewlineToPhp (WithNewLine salty) = toPhp salty
stripNewlineToPhp salty = toPhp salty
simpleVarName :: VariableName -> String
simpleVarName x... |
b95c690c2ccfc94150b014625c10864d1e0e39102090bdaa2b1824ecdb6a44f0 | jarohen/advent-of-code | day23.clj | (ns advent-of-code.day23
(:require [instaparse.core :as i :refer [defparser]]
[clojure.java.io :as io]
[clojure.string :as str]))
(defparser parser
"<Insns> = (<'\n'>? Insn)*
<Insn> = set | sub | mul | jnz
set = <'set '> reg <' '> val
sub = <'sub '> reg <' '> val
mul = <'mul '> ... | null | https://raw.githubusercontent.com/jarohen/advent-of-code/3fa1d87a539fb9163b05b732973bbd415dd21312/2017/src/advent_of_code/day23.clj | clojure | (ns advent-of-code.day23
(:require [instaparse.core :as i :refer [defparser]]
[clojure.java.io :as io]
[clojure.string :as str]))
(defparser parser
"<Insns> = (<'\n'>? Insn)*
<Insn> = set | sub | mul | jnz
set = <'set '> reg <' '> val
sub = <'sub '> reg <' '> val
mul = <'mul '> ... | |
ade8d4a9953bbd651e1d06ce38049e3379ed84a8f67203c3609e69dd15ed385a | dparis/gen-phzr | lock_constraint.cljs | (ns phzr.physics.p2.lock-constraint
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->LockConstraint
"Locks the relative position between two bodies.
Parameters:
* world (Phaser.Physics.P2) - A reference to the P2 Wo... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/physics/p2/lock_constraint.cljs | clojure | (ns phzr.physics.p2.lock-constraint
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->LockConstraint
"Locks the relative position between two bodies.
Parameters:
* world (Phaser.Physics.P2) - A reference to the P2 Wo... | |
63e58ada5baef18dbeedcca4f27bf563f6550cf27b5ee3df01386beb39dc258a | amnh/poy5 | grappa.ml |
read file of format :
* > S1
* 1 2 3 4 5
* > S2
* 1 -3 -2 4 5
* ...
* S1 and S2 are the taxon names always start with a >
* numbers are the traits
* >S1
* 1 2 3 4 5
* >S2
* 1 -3 -2 4 5
* ...
* S1 and S2 are the taxon names always start with a >
... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/grappa/grappa.ml | ocaml | takes a genome and the number of genes and print it
takes a genome and the number of genes and print it
for the distance returned, now this function also deals with multichromosome
genomeX, genomeY, genomeZ, number of genes in each genome, circular/or not,
* output the median of X, Y and Z
(int32, Bigarra... |
read file of format :
* > S1
* 1 2 3 4 5
* > S2
* 1 -3 -2 4 5
* ...
* S1 and S2 are the taxon names always start with a >
* numbers are the traits
* >S1
* 1 2 3 4 5
* >S2
* 1 -3 -2 4 5
* ...
* S1 and S2 are the taxon names always start with a >
... |
b37c4f19e7a1c00e8069b68b8cdd6fbcb899b96645eb2025f0a74d97df7ddc57 | c-cube/olinq | OLinq.mli |
This file is free software , part of OLinq . See file " license " for more details .
* { 1 LINQ - like operations on collections }
The purpose is to provide powerful combinators to express iteration ,
transformation and combination of collections of items .
Functions and operations are assumed t... | null | https://raw.githubusercontent.com/c-cube/olinq/58e495f419e396b63d7391571cd0c40749c6c821/src/OLinq.mli | ocaml | some helpers
* {2 Polymorphic Maps}
* Empty collection
* Query that just returns the elements of the list
* [range i j] goes from [i] up to [j] included
* Synonym to {!range}
* Query that returns the elements of the given sequence.
* Traverse the characters of the string
* [of_map m] yields each binding of [m]... |
This file is free software , part of OLinq . See file " license " for more details .
* { 1 LINQ - like operations on collections }
The purpose is to provide powerful combinators to express iteration ,
transformation and combination of collections of items .
Functions and operations are assumed t... |
77d14c44156b8977466d0fc94c44e6fd1dfdbd8801efba85c32a598563497ae8 | solatis/haskell-network-anonymous-i2p | Error.hs | {-# LANGUAGE DeriveDataTypeable #-}
-- | I2P error types, inspired by System.IO.Error
module Network.Anonymous.I2P.Error where
import Data.Typeable (Typeable)
import Control.Monad.IO.Class
import Control.Exception (throwIO)
import Control.Exception.Base (Exception)
-- | Error type used
type I2PError = I2PExcept... | null | https://raw.githubusercontent.com/solatis/haskell-network-anonymous-i2p/57681eedc06ed349f3ac011ada221c567c91739a/src/Network/Anonymous/I2P/Error.hs | haskell | # LANGUAGE DeriveDataTypeable #
| I2P error types, inspired by System.IO.Error
| Error type used
| Exception that we use to throw. It is the only type of exception
we throw, and the type of error is embedded within the exception.
^ Our error type
| Derives our I2P exception from the standard exception, which op... |
module Network.Anonymous.I2P.Error where
import Data.Typeable (Typeable)
import Control.Monad.IO.Class
import Control.Exception (throwIO)
import Control.Exception.Base (Exception)
type I2PError = I2PException
data I2PException = I2PError {
} deriving (Show, Eq, Typeable)
instance Exception I2PException
dat... |
c7edaf94c5562510c6550aba51eae7b1ad75e9cbc0ff10213796c5537cee01e9 | ghcjs/ghcjs | arr002.hs | -- !!! Array creation, (index,value) list with duplicates.
--
Haskell library report 1.3 ( and earlier ) specifies
-- that `array' values created with lists containing dups,
-- are undefined ( _|_ ).
--
-- GHC-2.02 (and earlier) does not flag this as such, the
-- last (index,value) is instead used.
--
-- The report ... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/array/arr002.hs | haskell | !!! Array creation, (index,value) list with duplicates.
that `array' values created with lists containing dups,
are undefined ( _|_ ).
GHC-2.02 (and earlier) does not flag this as such, the
last (index,value) is instead used.
The report also specifies `array' is spine strict in
the (index,value) list argumen... | Haskell library report 1.3 ( and earlier ) specifies
import Data.Array
main =
let a1 = array (1,3) (zip (1:[1..3]) ['a'..'d']) in
print (a1!1) >>
print a1 >>
print (a1!1)
|
823b01586f2667ed729210083998fd45e9c348c2d9b778ab8d551f6749b1fc79 | adomokos/haskell-katas | Ex17_HofsFunctionCompositionSpec.hs | module Solutions.Ex17_HofsFunctionCompositionSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
addSquareSum :: Int
addSquareSum =
let oddSquares = filter odd $ map (^ 2) [1 ..]
belowLimit = takeWhile (< 10000) oddSquares
in sum belowLimit
spec :: Spec
spec = do
describe "Functio... | null | https://raw.githubusercontent.com/adomokos/haskell-katas/be06d23192e6aca4297814455247fc74814ccbf1/test/Solutions/Ex17_HofsFunctionCompositionSpec.hs | haskell | use function composition
take the abs value of items and negate them
get the tail of the arrays, sum them and negate it
A more readable version | module Solutions.Ex17_HofsFunctionCompositionSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
addSquareSum :: Int
addSquareSum =
let oddSquares = filter odd $ map (^ 2) [1 ..]
belowLimit = takeWhile (< 10000) oddSquares
in sum belowLimit
spec :: Spec
spec = do
describe "Functio... |
1d41e91497b2c9f661a9d733a80e7fd4811a04b59e0e4a83b87829e23615b973 | freizl/dive-into-haskell | exe2.hs | data Term = Var Var | Lam Var Term | App Term Term
data Var = V String
test1 = (App (App (App (App (App (Var (V "a")) (Var (V "b")))
(Var (V "c")))
(Var (V "d")))
(Var (V "e")))
(Var (V "f")))
test2 = (App (App (Var (V "g")) (Var (V... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/lambda-viewer/exe2.hs | haskell | show (App t1 t2) = show t1 ++ " " ++ show t2 | data Term = Var Var | Lam Var Term | App Term Term
data Var = V String
test1 = (App (App (App (App (App (Var (V "a")) (Var (V "b")))
(Var (V "c")))
(Var (V "d")))
(Var (V "e")))
(Var (V "f")))
test2 = (App (App (Var (V "g")) (Var (V... |
fa5b987e96a64e4e025adbcccd281da69a96c68564e4c0ca082f06adc046c58e | funcool/catacumba | executor.clj | Copyright ( c ) 2015 - 2016 < >
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
1 . Redistributions of source code must retain the above copyright
;; notice, this list of condi... | null | https://raw.githubusercontent.com/funcool/catacumba/a493843176ee8defa2f3c6afa23c720f495d9341/src/clojure/catacumba/impl/executor.clj | clojure | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
document... | Copyright ( c ) 2015 - 2016 < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCL... |
8ed81244dfcfe147d1c27325ea9b5ccc1f0079fe9863917a2426a6d2cbe9575a | BinaryAnalysisPlatform/bap | bap_primus_info.mli | open Bap_knowledge
type t
val create : ?long:(unit -> string) -> ?desc:string ->
Knowledge.Name.t -> t
val name : t -> Knowledge.Name.t
val desc : t -> string
val long : t -> string
val pp : Format.formatter -> t -> unit
val normalize_text : string -> string
| null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/52f7f66164aea22653f7eb9f6af8fc5a398fc6a1/lib/bap_primus/bap_primus_info.mli | ocaml | open Bap_knowledge
type t
val create : ?long:(unit -> string) -> ?desc:string ->
Knowledge.Name.t -> t
val name : t -> Knowledge.Name.t
val desc : t -> string
val long : t -> string
val pp : Format.formatter -> t -> unit
val normalize_text : string -> string
| |
ce0d788a14fcfc947bdb4a8f3b7cabcfc063a3114532c50f2db6514f0bb911ab | input-output-hk/cardano-sl | CborSpec.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
{-# LANGUAGE GADTs #-}
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - orphans #
| Test . Pos . . CborSpec specification
module Test.Pos.Crypto.CborSpec
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/crypto/test/Test/Pos/Crypto/CborSpec.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - orphans #
| Test . Pos . . CborSpec specification
module Test.Pos.Crypto.CborSpec
( spec
) where
import ... |
fa10ba1646085d114ca4be65375487e81236ab1f5c655dfaec8216f1138800a2 | planetfederal/signal | database.clj | Copyright 2016 - 2018 Boundless ,
;;
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
distribute... | null | https://raw.githubusercontent.com/planetfederal/signal/e3eae56c753f0a56614ba8522278057ab2358c96/src/signal/components/database.clj | clojure |
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 permiss... | Copyright 2016 - 2018 Boundless ,
distributed under the License is distributed on an " AS IS " BASIS ,
(ns signal.components.database
(:require [clojure.data.json :as json]
[clojure.tools.logging :as log]
[clojure.set :refer [rename-keys]]
[buddy.hashers :as hashers]
... |
527f95350bc0e6569e8e10d4fa4d54e5b4c8a294f83d5b20523e2c184a904777 | clojerl/clojerl | clj_test_utils.erl | -module(clj_test_utils).
-include("clj_test_utils.hrl").
-export([ all/1
, all/2
, init_per_suite/1
, relative_path/1
, wait_for/2
, wait_for/3
]).
-spec all(module()) -> [atom()].
all(Module) -> all(Module, []).
-spec all(module(), [atom()]) -> [atom()].
all(Module, ... | null | https://raw.githubusercontent.com/clojerl/clojerl/aa35847ca64e1c66224867ca4c31ca6de95bc898/test/clj_test_utils.erl | erlang | -module(clj_test_utils).
-include("clj_test_utils.hrl").
-export([ all/1
, all/2
, init_per_suite/1
, relative_path/1
, wait_for/2
, wait_for/3
]).
-spec all(module()) -> [atom()].
all(Module) -> all(Module, []).
-spec all(module(), [atom()]) -> [atom()].
all(Module, ... | |
40edb01e55b5b27e6ff076a121a947bf2dc6c85353068c15430d746d046cafe3 | alexdong/ansi-common-lisp-exercises | pcl.lisp | (defun report-result (result form)
(format t "~:[FAIL~;pass~] ... ~a~%" result form))
(defmacro check (&body forms)
`(progn
,@(loop for f in forms collect `(report-result ,f ',f))))
| null | https://raw.githubusercontent.com/alexdong/ansi-common-lisp-exercises/03b05a23027d62e8724177b2c56dd58065c1f18f/pcl.lisp | lisp | (defun report-result (result form)
(format t "~:[FAIL~;pass~] ... ~a~%" result form))
(defmacro check (&body forms)
`(progn
,@(loop for f in forms collect `(report-result ,f ',f))))
| |
74305ae8bfa95f71df90a66e40516c24e6472b97df1f969f3cac543139014566 | plewto/Cadejo | data.clj | (println "--> masa data")
(ns cadejo.instruments.masa.data
(:use [cadejo.instruments.masa.program
:only [save-program masa bank]]))
(save-program 0 "Barrows"
(masa :harmonics [0.500 1.500 1.000 2.000 3.000 4.000 5.000 6.000 8.000]
:registration [ 7 5 2 5 1 6 7 ... | null | https://raw.githubusercontent.com/plewto/Cadejo/2a98610ce1f5fe01dce5f28d986a38c86677fd67/src/cadejo/instruments/masa/data.clj | clojure | (println "--> masa data")
(ns cadejo.instruments.masa.data
(:use [cadejo.instruments.masa.program
:only [save-program masa bank]]))
(save-program 0 "Barrows"
(masa :harmonics [0.500 1.500 1.000 2.000 3.000 4.000 5.000 6.000 8.000]
:registration [ 7 5 2 5 1 6 7 ... | |
ecc75f5d8e51fa3ccb6fd401fb3dc2dc99a5a6aa84603d7a31422c8c6a7cac5a | spurious/sagittarius-scheme-mirror | yaml.scm | (import (rnrs)
(text yaml)
(srfi :13)
(srfi :64))
(test-begin "YAML")
(test-equal '(#(("foo" . "bar")
("boo" 1 2 3 4)))
(yaml-read (open-string-input-port "
%YAML 1.2
---
foo: bar
boo:
- 1
- 2
- 3
- 4")))
(test-equal "%YAML 1.2\n---\nfoo: bar\nboo: \n - 1\n - 2\n - 3\n - 4\n...\n"
(let-values (((o... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/tests/text/yaml.scm | scheme | (import (rnrs)
(text yaml)
(srfi :13)
(srfi :64))
(test-begin "YAML")
(test-equal '(#(("foo" . "bar")
("boo" 1 2 3 4)))
(yaml-read (open-string-input-port "
%YAML 1.2
---
foo: bar
boo:
- 1
- 2
- 3
- 4")))
(test-equal "%YAML 1.2\n---\nfoo: bar\nboo: \n - 1\n - 2\n - 3\n - 4\n...\n"
(let-values (((o... | |
255b047e1de8be3f7e3c2e165974568d6fa4a95518c536ed3b42648174d6520a | input-output-hk/cardano-sl | Utxo.hs | -- | Utxo functionality re-exports.
module Pos.Chain.Txp.Toil.Utxo
( module Pos.Chain.Txp.Toil.Utxo.Functions
, module Pos.Chain.Txp.Toil.Utxo.Util
) where
import Pos.Chain.Txp.Toil.Utxo.Functions
import Pos.Chain.Txp.Toil.Utxo.Util
| null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/src/Pos/Chain/Txp/Toil/Utxo.hs | haskell | | Utxo functionality re-exports. |
module Pos.Chain.Txp.Toil.Utxo
( module Pos.Chain.Txp.Toil.Utxo.Functions
, module Pos.Chain.Txp.Toil.Utxo.Util
) where
import Pos.Chain.Txp.Toil.Utxo.Functions
import Pos.Chain.Txp.Toil.Utxo.Util
|
9288a1f602d5462dd401603b1bc49ae9371272a98c3dd07f00fdf9dc45588ead | awakesecurity/hocker | Types.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Docker.Image.Types
Copyright : ( C ) 2016 A... | null | https://raw.githubusercontent.com/awakesecurity/hocker/43d8e6cb8e8974f9e54e44e7b30ef48df7bb76aa/src/Data/Docker/Image/Types.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------
|
Module : Data.Docker.Image.Types
License : Apache-2.0
Stability : stable
--------------------------------------------------------------------------
| Metadata needed for constructing a docker ... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
Copyright : ( C ) 2016 Awake Networks
Maintainer : Awake Networks < >
module Data.Docker.Image.Types where
import qualified Crypto.Hash as Hash
import ... |
5e01ae013cc3945fa5e67043cbcaf45d815ff0418844a84224dac4b28010902d | pink-gorilla/goldly | core.cljs | (ns goldly.service.core
(:require
[taoensso.timbre :refer-macros [trace debug debugf info infof warnf error errorf]]
[cljs.core.async :refer [>! chan close! put!] :refer-macros [go]]
[modular.ws.core :refer [send!]]
[frontend.notifications.core :as n]
[goldly.service.result :refer [update-atom-where]])... | null | https://raw.githubusercontent.com/pink-gorilla/goldly/9589dc51c8fe894319e9eededdc1c965c3314491/service/src/goldly/service/core.cljs | clojure | run with callback
run with core-async channel
_ = event-type ;goldly/service
separate because was throwing exceptions
run to atom
_ = event-type | (ns goldly.service.core
(:require
[taoensso.timbre :refer-macros [trace debug debugf info infof warnf error errorf]]
[cljs.core.async :refer [>! chan close! put!] :refer-macros [go]]
[modular.ws.core :refer [send!]]
[frontend.notifications.core :as n]
[goldly.service.result :refer [update-atom-where]])... |
e7111ebd3a7386e65431fec9e7ca7cbde0c02e6dadeb86f25e43c9349b422f25 | fukamachi/rove | main.lisp | (defpackage :rove/tests/main
(:use :cl))
(in-package :rove/tests/main)
(rove:deftest example-test
42)
(defun testing-returns-the-body-result ()
(let ((expected 300)
(actual (rove:testing "hello" 100 200 300)))
(assert (equal expected actual))))
(defun run-test-returns-the-body-result ()
(let ((ex... | null | https://raw.githubusercontent.com/fukamachi/rove/6a5dfcdced42879a4eff2a529e7e8ce492fadf41/tests/main.lisp | lisp | (defpackage :rove/tests/main
(:use :cl))
(in-package :rove/tests/main)
(rove:deftest example-test
42)
(defun testing-returns-the-body-result ()
(let ((expected 300)
(actual (rove:testing "hello" 100 200 300)))
(assert (equal expected actual))))
(defun run-test-returns-the-body-result ()
(let ((ex... | |
95f719398ac473832d68ec3720267f644c07b304c8cc70a415c5a6b279a67fb6 | viebel/klipse-app | utils.cljs | (ns klipse.utils
(:require-macros
[gadjett.core :refer [dbg]]
[cljs.core.async.macros :refer [go go-loop]])
(:require
[cljs.reader :refer [read-string]]
[clojure.walk :refer [keywordize-keys]]
[cljs-http.client :as http]
[cljs.core.async :refer [timeout <! chan put!]]
[cemerick.url :refer [url]... | null | https://raw.githubusercontent.com/viebel/klipse-app/46809aaf4dd9bc89aae3bd81110125f81cbd11a4/src/klipse/utils.cljs | clojure | a function that will execute `func` after a while if the counter is 0
a function that executes `func` immediately
this is the trick to make `eval` work in the global scope: -eval-what-are-the-options/ | (ns klipse.utils
(:require-macros
[gadjett.core :refer [dbg]]
[cljs.core.async.macros :refer [go go-loop]])
(:require
[cljs.reader :refer [read-string]]
[clojure.walk :refer [keywordize-keys]]
[cljs-http.client :as http]
[cljs.core.async :refer [timeout <! chan put!]]
[cemerick.url :refer [url]... |
5ea5df80ffcc05cfe0ed76b266129e122380a9c007d21f5d2ff77c6d08ff9d49 | bvaugon/obytelib | crcs.ml | (*************************************************************************)
(* *)
(* OByteLib *)
(* *)
... | null | https://raw.githubusercontent.com/bvaugon/obytelib/1b5de4e010ff2be6ab4e38c394ca5b669d6d33ef/src/crcs.ml | ocaml | ***********************************************************************
OByteLib
... |
This file is distributed under the terms of the CeCILL license .
type entry = string * Digest.t option
type t = entry list
let empty = []
let print oc crcs =
let pp_entry (name, hash) =
Printf.fprintf oc "%s %s\n" (match hash with Some h ->... |
54b15cce7bcb76d26a16368ccf8e219f2f4acb040163145f6daf7d4a46b641ae | adetokunbo/tmp-proc | Schema.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedSt... | null | https://raw.githubusercontent.com/adetokunbo/tmp-proc/0bb91505f24084ae488af274459fa49c87912033/tmp-proc-example/src/TmpProc/Example2/Schema.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DerivingStrategies #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances # | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
|
Copyright : ( c ) 2020 - 20... |
4a74c376891e3c885e54f16cb3ed7d7b938e7e723ce5416ec7b4c4224078a96a | chiroptical/thinking-with-types | Main.hs | module Main where
import Lib
main :: IO ()
main = putStrLn "hello world"
| null | https://raw.githubusercontent.com/chiroptical/thinking-with-types/781f90f1b08eb94ef3600c5b7da92dfaf9ea4285/Chapter7/app/Main.hs | haskell | module Main where
import Lib
main :: IO ()
main = putStrLn "hello world"
| |
ddad267225ae7d748129ffe6b270a7ab266755e692002d716724ecee6f3fe641 | frodwith/cl-urbit | nock.lisp | (defpackage #:urbit/nock/nock
(:use #:cl #:urbit/nock/math #:urbit/nock/axis
#:urbit/nock/common #:urbit/nock/cord
#:urbit/nock/jets #:urbit/nock/equality
#:urbit/nock/ideal #:urbit/nock/world
#:urbit/nock/data #:urbit/nock/data/core
#:urbit/nock/data/slimcell #:urbit/nock/data... | null | https://raw.githubusercontent.com/frodwith/cl-urbit/65af924ee58c4c974056f369158bbc1401308fea/nock/nock.lisp | lisp | helpers
compiler proper -- converts ideals to familiar looking lisp,
i.e. #<ICELL [0 0]> becomes (@0 0).
improper formula shapes become +crash+.
nock operators implemented as macros
hint macros
get the effect of establishing a new "toplevel" by dynamically binding to nil
make a function that caches the speed of... | (defpackage #:urbit/nock/nock
(:use #:cl #:urbit/nock/math #:urbit/nock/axis
#:urbit/nock/common #:urbit/nock/cord
#:urbit/nock/jets #:urbit/nock/equality
#:urbit/nock/ideal #:urbit/nock/world
#:urbit/nock/data #:urbit/nock/data/core
#:urbit/nock/data/slimcell #:urbit/nock/data... |
ee430dbf02bf1586801ae0f35ed22816250e1b5db8ab84f8c690907163505bd3 | tmattio/js-bindings | vscode_languageclient_protocol_code_lens.mli | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es5
(* import * as code from 'vscode'; *)
module ProtocolCodeLens : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val get_data : t -> any [@@js.get "data"]
val set_data : t -> any -> unit [@@js.se... | null | https://raw.githubusercontent.com/tmattio/js-bindings/ca3bd6a12db519c8de7f41b303f14cf70cfd4c5f/lib/vscode-languageclient/vscode_languageclient_protocol_code_lens.mli | ocaml | import * as code from 'vscode';
TODO: Move me | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es5
module ProtocolCodeLens : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val get_data : t -> any [@@js.get "data"]
val set_data : t -> any -> unit [@@js.set "data"]
val create : range:Code.R... |
a87854341ce1716b6fb1a5370fa51822cd8f799030325baa72058e31d8f44f48 | rjohnsondev/haskellshop | Products.hs | {-# LANGUAGE OverloadedStrings #-}
module Render.Products where
import Application
import Control.Monad.Trans
import Snap.Snaplet
import Data.Scientific
import qualified Heist.Compiled as C
import qualified Data.Text as DT
import qualified Data.Text.Encoding as DTE
import qualified ShopData.Product as P
import FormUt... | null | https://raw.githubusercontent.com/rjohnsondev/haskellshop/645f9e40b9843fc987d37a0ee58460929ef50aae/src/Render/Products.hs | haskell | # LANGUAGE OverloadedStrings #
would be better done in SQL, but without dynamic query creation it's
verbose.
selected min
actual min |
module Render.Products where
import Application
import Control.Monad.Trans
import Snap.Snaplet
import Data.Scientific
import qualified Heist.Compiled as C
import qualified Data.Text as DT
import qualified Data.Text.Encoding as DTE
import qualified ShopData.Product as P
import FormUtil
import Heist
import HeistUtil
m... |
8f6d9c07a8f4257b9450bc521a71282f556fa089951d472e5d51dec379c271a1 | elm-lang/elm-repl | Loop.hs | module Loop (loop) where
import Control.Monad.Trans (lift)
import System.Console.Haskeline
( InputT, MonadException, Settings, getInputLine
, handleInterrupt, runInputT, withInterrupt
)
import System.Exit (ExitCode(ExitSuccess))
import qualified Environment as Env
import qualified Eval
import qualified Read
l... | null | https://raw.githubusercontent.com/elm-lang/elm-repl/cc258c37636e04b6f3d4a4840881910f5effe119/src/Loop.hs | haskell | module Loop (loop) where
import Control.Monad.Trans (lift)
import System.Console.Haskeline
( InputT, MonadException, Settings, getInputLine
, handleInterrupt, runInputT, withInterrupt
)
import System.Exit (ExitCode(ExitSuccess))
import qualified Environment as Env
import qualified Eval
import qualified Read
l... | |
0d5ce097345fd0375936b15bff50409a57b779bf2170d3a54e9ef48d75933cd6 | Helium4Haskell/helium | SelectConstraintSolver.hs | # LANGUAGE UndecidableInstances #
| Module : SelectConstraintSolver
License : GPL
Maintainer :
Stability : experimental
Portability : portable
Select the type constraint solver of your own liking
License : GPL
Maintainer :
Stability ... | null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/src/Helium/StaticAnalysis/Inferencers/SelectConstraintSolver.hs | haskell | spread type constraints or not (i.e., map some type constraints to a
corresponding node in the constraint tree)
spreading is enabled by default
choose your treewalk to flatten the constraint tree
the default treewalk is TreeWalkInorderTopLastPost (similar to 'W')
split the constraints that come from an explicit... | # LANGUAGE UndecidableInstances #
| Module : SelectConstraintSolver
License : GPL
Maintainer :
Stability : experimental
Portability : portable
Select the type constraint solver of your own liking
License : GPL
Maintainer :
Stability ... |
a78de59104565a4285b342ddf95683bec4220b0b0fddbb3634485ca26ff9eaad | jimcrayne/jhc | Bounds.hs | module Main where
import Data.Int
main :: IO ()
main = do print (minBound :: Int8)
print (maxBound :: Int8)
print (minBound :: Int16)
print (maxBound :: Int16)
print (minBound :: Int32)
print (maxBound :: Int32)
print (minBound :: Int64)
print (max... | null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/2_language/Bounds.hs | haskell | module Main where
import Data.Int
main :: IO ()
main = do print (minBound :: Int8)
print (maxBound :: Int8)
print (minBound :: Int16)
print (maxBound :: Int16)
print (minBound :: Int32)
print (maxBound :: Int32)
print (minBound :: Int64)
print (max... | |
fd3474a5d6df0824f70f1b946eb63673f334f1f62e6d16427f7b103ea643e85c | soegaard/pyffi | python-string.rkt | #lang racket/base
(provide (all-defined-out))
(require "structs.rkt"
"python-c-api.rkt"
"python-environment.rkt"
"python-operators.rkt"
"python-slice.rkt"
"python-types.rkt")
(require racket/format)
(require (for-syntax racket/base syntax/parse racket/syntax))
;;;
;;; S... | null | https://raw.githubusercontent.com/soegaard/pyffi/d5742f0a7371868892c6c6461618c75e2eb4a615/pyffi-lib/pyffi/python-string.rkt | racket |
Strings (Unicode Objects)
Todo: should this return a Racket character instead?
alternative
(define (pystring-slice x slice) | #lang racket/base
(provide (all-defined-out))
(require "structs.rkt"
"python-c-api.rkt"
"python-environment.rkt"
"python-operators.rkt"
"python-slice.rkt"
"python-types.rkt")
(require racket/format)
(require (for-syntax racket/base syntax/parse racket/syntax))
(define ... |
70d28becadfbd8d5159574a30d1841e27dccaecb0d70c85beba366adf16aad82 | Gabriella439/Haskell-Pipes-Parse-Library | Tutorial.hs | # OPTIONS_GHC -fno - warn - unused - imports #
| @pipes - parse@ builds upon @pipes@ to add several missing features necessary
to implement ' Parser 's :
* End - of - input detection , so that ' 's can react to an exhausted input
stream
* Leftovers support , which simplifies several parsin... | null | https://raw.githubusercontent.com/Gabriella439/Haskell-Pipes-Parse-Library/2a8187c79af9693d97d1de25a57b3193243f6dee/src/Pipes/Parse/Tutorial.hs | haskell | * Overview
$overview
$parsers
* Lenses
$lenses
* Getters
$getters
* Building Lenses
$buildlenses
* Conclusion
$conclusion
or : drawTwo = liftM2 ( , ) draw draw
Feed a ' Producer ' to a ' ' , returning the result and leftovers
Feed a ' Producer ' to a ' ' , returning only the result
Feed a ' Producer... | # OPTIONS_GHC -fno - warn - unused - imports #
| @pipes - parse@ builds upon @pipes@ to add several missing features necessary
to implement ' Parser 's :
* End - of - input detection , so that ' 's can react to an exhausted input
stream
* Leftovers support , which simplifies several parsin... |
12ea3e9867539272e2ba53e29cf7e95a13d2cc0c42d201727c5fecc12b5045bd | tnelson/Forge | pardinus.rkt | #lang forge/core
(set-verbosity 10)
(sig A)
(sig AA #:one #:extends A)
(sig B)
(relation r (A B))
(run my-run
#:preds [(= (join AA r) B)]
#:backend pardinus)
(define result (forge:get-result my-run))
(display my-run)
(define t (tree:get-value (tree:get-child result 'next)))
(run my-run2
#:preds [(= ... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/example/forge-core/pardinus.rkt | racket | #lang forge/core
(set-verbosity 10)
(sig A)
(sig AA #:one #:extends A)
(sig B)
(relation r (A B))
(run my-run
#:preds [(= (join AA r) B)]
#:backend pardinus)
(define result (forge:get-result my-run))
(display my-run)
(define t (tree:get-value (tree:get-child result 'next)))
(run my-run2
#:preds [(= ... | |
898df6a8daadcedff0890c7f7307dd60f974734c0a50600fb98eedc78c4f8ce3 | weblocks-framework/weblocks | dual-password.lisp | NB :
needs request-parameter-for-presentation.diff applied to Weblocks
(in-package :weblocks)
(export '(dual-password-presentation dual-password-parser))
(defclass dual-password-presentation (text-presentation input-presentation)
((max-length :initform *max-password-length*)
(clear-text-p :accessor dual-pas... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/contrib/lpolzer/dual-password.lisp | lisp |
XXX min-length < length < max-length | NB :
needs request-parameter-for-presentation.diff applied to Weblocks
(in-package :weblocks)
(export '(dual-password-presentation dual-password-parser))
(defclass dual-password-presentation (text-presentation input-presentation)
((max-length :initform *max-password-length*)
(clear-text-p :accessor dual-pas... |
c5ba6f0632d5a37c1c54f005e445fcffd810729d95931841d9b3d457563f5c7c | zippy/anansi | auth.cljs | (ns ss.auth
(:require
[clojure.string :as string]
[goog.ui.Dialog :as dialog]
[goog.ui.Prompt :as prompt]
[ss.debug :as debug]
[ss.utils :as u]
[ss.state :as s]
[ss.dom-helpers :as d]
[ss.streamscapes :as sss]
[ss.ss-utils :as ssu]
[ss.ceptr :as ceptr]
[ss.ui :as ui]
[ss.contact :a... | null | https://raw.githubusercontent.com/zippy/anansi/881aa279e5e7836f3002fc2ef7623f2ee1860c9a/public/ss/src/auth.cljs | clojure | create the default streamscapes channel for this user
as well as a default from identity | (ns ss.auth
(:require
[clojure.string :as string]
[goog.ui.Dialog :as dialog]
[goog.ui.Prompt :as prompt]
[ss.debug :as debug]
[ss.utils :as u]
[ss.state :as s]
[ss.dom-helpers :as d]
[ss.streamscapes :as sss]
[ss.ss-utils :as ssu]
[ss.ceptr :as ceptr]
[ss.ui :as ui]
[ss.contact :a... |
e27d807bac58a332c8da086053798194fc3d523b483713e5a3025ee1669a4845 | lem-project/lem | hooks.lisp | (in-package :lem-base)
(defgeneric run-hooks (hooks &rest args))
(defmethod run-hooks ((hooks list) &rest args)
(dolist (hook hooks)
(apply (car hook) args)))
(defmacro add-hook (place callback &optional (weight 0))
(let ((_callback (gensym)))
`(let ((,_callback ,callback))
(unless (member ,_callb... | null | https://raw.githubusercontent.com/lem-project/lem/3b9b92690b48710135a946b1d3754f64d2bfdaf1/src/base/hooks.lisp | lisp | (in-package :lem-base)
(defgeneric run-hooks (hooks &rest args))
(defmethod run-hooks ((hooks list) &rest args)
(dolist (hook hooks)
(apply (car hook) args)))
(defmacro add-hook (place callback &optional (weight 0))
(let ((_callback (gensym)))
`(let ((,_callback ,callback))
(unless (member ,_callb... | |
306c2e325f906a0ec25afbb1c6ce47979d9dd3b374bddf05e88773f02dc507e6 | simingwang/emqx-plugin-kafkav5 | hex_api_auth.erl | %% @doc
%% Hex HTTP API - Authentication.
-module(hex_api_auth).
-export([test/2]).
%% @doc
%% Test an auth key against a given domain and resource.
%%
%% Examples:
%%
%% ```
1 # { domain = > < < " repository " > > , resource = > < < " gustafson_motors " > > } .
2 > hex_api_auth : test_key(hex_core : default_co... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/plugins/hex_core/src/hex_api_auth.erl | erlang | @doc
Hex HTTP API - Authentication.
@doc
Test an auth key against a given domain and resource.
Examples:
```
{ok,{204, ..., nil}}
'''
@end | -module(hex_api_auth).
-export([test/2]).
1 # { domain = > < < " repository " > > , resource = > < < " gustafson_motors " > > } .
2 > hex_api_auth : test_key(hex_core : default_config ( ) , Params ) .
-spec test(hex_core:config(), map()) -> hex_api:response().
test(Config, #{domain := Domain, resource := Resour... |
543e9b331398dc43c7384e0261eed76f2661491c74227d166a54b2e75b2ee7b1 | biegunka/biegunka | OK2.hs | -- |
-- Basic sanity check
--
Checks you have script with Sources inside many namespaces
module Main where
import Control.Biegunka
import Control.Biegunka.Source.Git
main :: IO ()
main = do
biegunka id run $ do
namespace "main" $
git (url ":ghc/ghc" . path "ghc") pass
namespace "other" $
git... | null | https://raw.githubusercontent.com/biegunka/biegunka/74fc93326d5f29761125d7047d5418899fa2469d/test/typecheck/should_compile/OK2.hs | haskell | |
Basic sanity check
| Checks you have script with Sources inside many namespaces
module Main where
import Control.Biegunka
import Control.Biegunka.Source.Git
main :: IO ()
main = do
biegunka id run $ do
namespace "main" $
git (url ":ghc/ghc" . path "ghc") pass
namespace "other" $
git (url ":ghc/testsuite" . path ... |
a2524c477882591420b8aae7a84fa9cd6015c234d10c65ed59ac0d4c7e312926 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | GetIssuingSettlementsSettlement.hs | {-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the different functions to run the operation getIssuingSettlementsSettlement
mo... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Operations/GetIssuingSettlementsSettlement.hs | haskell | # LANGUAGE ExplicitForAll #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the different functions to run the operation getIssuingSettlementsSettlement
| > GET /v1/issuing/settlements/{settlement}
| Contains all available parameters of this operation (query and path parameters)
| Monadic computa... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Operations.GetIssuingSettlementsSettlement where
import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
import qualif... |
8bd3df7ade992786acf3ee8941686784c9a8e4b507949c88ae865f986c0cc595 | KULeuven-CS/CPL | EXPLICIT-REFS.rkt | #lang eopl
(require "syntax.rkt")
(require "store.rkt")
(provide (all-defined-out))
Semantics
(define-datatype expval expval?
(num-val
(value number?))
(bool-val
(boolean boolean?))
(proc-val
(proc proc?))
(ref-val
(ref reference?)))
;; proc? : SchemeVal -> Bool
;; procedure : Var * Exp *... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter4/EXPLICIT-REFS/EXPLICIT-REFS.rkt | racket | proc? : SchemeVal -> Bool
procedure : Var * Exp * Env -> Proc
expval->num : ExpVal -> Int
expval->bool : ExpVal -> Bool
expval->proc : ExpVal -> Proc
Environments
location : Sym * Listof(Sym) -> Maybe(Int)
else (location sym syms) = #f
init-env : () -> Env
(init-env) builds an environment in which i is boun... | #lang eopl
(require "syntax.rkt")
(require "store.rkt")
(provide (all-defined-out))
Semantics
(define-datatype expval expval?
(num-val
(value number?))
(bool-val
(boolean boolean?))
(proc-val
(proc proc?))
(ref-val
(ref reference?)))
(define-datatype proc proc?
(procedure
(var symb... |
db32e1c792c88bc9c5eab7505f56dfab9de304ffc6b5108c66ed6460612ce5e1 | braidchat/braid | cache.clj | (ns braid.base.server.cache
(:require
[braid.base.conf :as conf]
[taoensso.carmine :as car]))
; same as conf in handler, but w/e
(def redis-conn (delay
{:pool {}
:spec {:uri (conf/config :redis-uri)}}))
(def redis? (delay (conf/config :redis-uri)))
(def dev-cache
"Cache... | null | https://raw.githubusercontent.com/braidchat/braid/4c107cca8f44a7824b604e492f3328308a138779/src/braid/base/server/cache.clj | clojure | same as conf in handler, but w/e | (ns braid.base.server.cache
(:require
[braid.base.conf :as conf]
[taoensso.carmine :as car]))
(def redis-conn (delay
{:pool {}
:spec {:uri (conf/config :redis-uri)}}))
(def redis? (delay (conf/config :redis-uri)))
(def dev-cache
"Cache used in place of redis when runnin... |
aac4b7f84a735090c97e4d73af5f16f503b294fd840f103f0986fa896cc9e7fd | weyrick/roadsend-php | php-time.scm | ;; ***** BEGIN LICENSE BLOCK *****
Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
;;
;; 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 2.... | null | https://raw.githubusercontent.com/weyrick/roadsend-php/d6301a897b1a02d7a85bdb915bea91d0991eb158/runtime/ext/standard/php-time.scm | scheme | ***** BEGIN LICENSE BLOCK *****
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 2.1
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
of the License , or ( at your option ) any later version .
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 51 Franklin Street , Fifth... |
fc3c18bf0d88ba45ff7ec0d14d576936ccfa6083743c661c86549097cbda612d | hawk/lux | lux_args.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright 2012 - 2022 Tail - f Systems AB
%%
%% See the file "LICENSE" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-mo... | null | https://raw.githubusercontent.com/hawk/lux/3327e350be3290320beea794bfa21676a88a5073/src/lux_args.erl | erlang |
See the file "LICENSE" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Usage
alias
alias
All options in the specs are returned and they keep that order.
boolean - no value, return opposite of default
boolean - got name=true
boolean - got name=false
bool... | Copyright 2012 - 2022 Tail - f Systems AB
-module(lux_args).
-export([
usage/1,
specs/0,
getopts/3,
translate_opts/1
]).
-include("lux.hrl").
-define(FILES, "--").
-spec specs() -> [spec()].
specs() ->
[
{"-h", ["--help=usage"]},
{"-r", ... |
87c971191f55f9a90020e28b1225b5d574ce73eddd13f9ca1df7976bbb132109 | LightAndLight/sized-hkts | Codegen.hs | # language BangPatterns #
{-# language FlexibleContexts #-}
{-# language OverloadedLists, OverloadedStrings #-}
{-# language ScopedTypeVariables #-}
# language TemplateHaskell #
# language TypeApplications #
# language ViewPatterns #
module Codegen
( Code
, Key(..)
, emptyCode
, codeKinds
, codeDatatypeCtors
... | null | https://raw.githubusercontent.com/LightAndLight/sized-hkts/d12fedb34e7ea82be66f200e9ecf7fcf611cce53/src/Codegen.hs | haskell | # language FlexibleContexts #
# language OverloadedLists, OverloadedStrings #
# language ScopedTypeVariables #
let key = (IR.OFunction, name, ts)
let key = (IR.OConstructor, name, ts)
constraints_inst = IR.bindConstraint inst <$> _constraints | # language BangPatterns #
# language TemplateHaskell #
# language TypeApplications #
# language ViewPatterns #
module Codegen
( Code
, Key(..)
, emptyCode
, codeKinds
, codeDatatypeCtors
, codeDeclarations
, codeGlobalTheory
, genFunction
, genExpr
, genDecls
)
where
import Bound.Var (unvar)
impo... |
d6008abd3c8e91ef429af8a5885574a8c273f61a27a2a700980ee9febd4f2105 | haskell-tls/hs-tls | Types.hs | -- |
-- Module : Network.TLS.Crypto.Types
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : unknown
--
module Network.TLS.Crypto.Types where
data Group = P256 | P384 | P521 | X25519 | X448
| FFDHE2048 | FFDHE3072 | FFDHE4096 | FFDHE6144 | FFDHE8192
... | null | https://raw.githubusercontent.com/haskell-tls/hs-tls/31e95f40b75b541c9817b6b56c363e74c2f3b57d/core/Network/TLS/Crypto/Types.hs | haskell | |
Module : Network.TLS.Crypto.Types
License : BSD-style
Stability : experimental
Portability : unknown
Key-exchange signature algorithm, in close relation to ciphers
(before TLS 1.3). | Maintainer : < >
module Network.TLS.Crypto.Types where
data Group = P256 | P384 | P521 | X25519 | X448
| FFDHE2048 | FFDHE3072 | FFDHE4096 | FFDHE6144 | FFDHE8192
deriving (Eq, Show)
availableFFGroups :: [Group]
availableFFGroups = [FFDHE2048,FFDHE3072,FFDHE4096,FFDHE6144,FFDHE8192]
avai... |
30b16ec7dac2f2cd56af28796dd05dd2daddcb7b52618624ec34f5eac3dee7aa | atgreen/lisp-openshift | mixin.lisp | #+xcvb (module (:depends-on ("package")))
(in-package :trivial-gray-streams)
(defclass trivial-gray-stream-mixin () ())
(defgeneric stream-read-sequence
(stream sequence start end &key &allow-other-keys))
(defgeneric stream-write-sequence
(stream sequence start end &key &allow-other-keys))
(defgeneric strea... | null | https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/trivial-gray-streams-20110522-cvs/mixin.lisp | lisp | Implementations should provide this default method, I believe, but
at least sbcl and allegro don't.
stream-read-sequence, stream-write-sequence
Even despite the stream-read/write-sequence are present in newer
methods too.
Example: if fundamental-binary-input-stream comes in the
class precedence list of your use... | #+xcvb (module (:depends-on ("package")))
(in-package :trivial-gray-streams)
(defclass trivial-gray-stream-mixin () ())
(defgeneric stream-read-sequence
(stream sequence start end &key &allow-other-keys))
(defgeneric stream-write-sequence
(stream sequence start end &key &allow-other-keys))
(defgeneric strea... |
1571bc65d4e28b44735e4dd41fba03963bf912d965b6ad134be449b706543e6e | aantron/luv | TLS.mli | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
* Thread - local storage .
See { { : #thread-local-storage }
{ i Thread - local storage } } in .
The interface is currently written in terms of [ nativeint ] , th... | null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/src/TLS.mli | ocaml | * Retrieves the value at a TLS key.
Binds {{:#c.uv_key_get}
[uv_key_get]}. See
{{:-pages/man3/pthread_getspecific.3p.html}
[pthread_getspecific(3p)]}.
* Sets the value at a TLS key.
Binds {{:#c.uv_key_set}
[uv_key_set]}. See
{{:-pages/man3/pthread_setspecific.3p.html}
[pthread_setspec... | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
* Thread - local storage .
See { { : #thread-local-storage }
{ i Thread - local storage } } in .
The interface is currently written in terms of [ nativeint ] , th... |
c58e00f1d082cb2b170b9463f3fb77ab99b1983c24a3567d3b6aaa4ab588507e | litxio/ptghci | Parser.hs | # LANGUAGE PatternGuards , ViewPatterns , TupleSections , NoOverloadedLists #
Copyright 2014 - 2018 .
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of s... | null | https://raw.githubusercontent.com/litxio/ptghci/bbb3c5fdf2e73a557864b6b1e26833fffb34fc84/src/Language/Haskell/Ghcid/Parser.hs | haskell | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* ... | # LANGUAGE PatternGuards , ViewPatterns , TupleSections , NoOverloadedLists #
Copyright 2014 - 2018 .
* Neither the name of nor the names of other
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUEN... |
5d2e3529df91af69de378df9ff717bdd7ac9b7fac5ee09817d4f3f5edc4d4527 | farr/mcmc-ocaml | harmonic_evidence.ml | (* harmonic_evidence.ml: Harmonic mean evidence estimator. *)
Copyright ( C ) 2011 Will < >
(* 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 3 of the License , or
(* (at... | null | https://raw.githubusercontent.com/farr/mcmc-ocaml/56e46b8539cb8d6fada2cb09810363adf18f4c60/bin/harmonic_evidence.ml | ocaml | harmonic_evidence.ml: Harmonic mean evidence estimator.
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FI... | Copyright ( C ) 2011 Will < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
open Printf
module Ev = Evidence.Make(struct
type params = float arra... |
89af9b424bef969bf31c8b2019cfc7055b2c9f8097b45d449dc5292bc7bc6ddf | upenn-cis1xx/camelot | utils.ml | module Astutils = Astutils
module IOUtils = Ioutils
| null | https://raw.githubusercontent.com/upenn-cis1xx/camelot/2d7e8db8abb8c1ad8187bfeb94499fe1746bb664/lib/utils/utils.ml | ocaml | module Astutils = Astutils
module IOUtils = Ioutils
| |
63c1eb1f87c1209cbe5977488abc860c6c0b6e128ca089627048c587dcfc1d3f | footprintanalytics/footprint-web | mbql_query_impl.clj | (ns metabase.test.data.mbql-query-impl
"Internal implementation of `data/$ids` and `data/mbql-query` and related macros."
(:require [clojure.string :as str]
[clojure.test :refer :all]
[clojure.walk :as walk]
[metabase.models.field :refer [Field]]
[toucan.db :as db]))
... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/test/data/mbql_query_impl.clj | clojure | recursively parse the destination field, then add `:source-field` to it.
$ = wrapped Field ID
* = Field Literal
& = Field qualified by JOIN ALIAS
`!unit.<field> = datetime field
$$ = table ID. | (ns metabase.test.data.mbql-query-impl
"Internal implementation of `data/$ids` and `data/mbql-query` and related macros."
(:require [clojure.string :as str]
[clojure.test :refer :all]
[clojure.walk :as walk]
[metabase.models.field :refer [Field]]
[toucan.db :as db]))
... |
7c339e4a3d2e47819650a0b7beb46a05ce63db72de12956a529a2c9390f5b364 | gfngfn/Sesterl | testIdentifierScheme.ml |
module SnakeCase = struct
type t = {
message : string;
input : string;
expects : (string list) option;
}
let test (r : t) () =
let actual =
IdentifierScheme.from_snake_case r.input |> Option.map (fun x -> x.IdentifierScheme.fragments)
in
Alcotest.(check (option (list string))) r... | null | https://raw.githubusercontent.com/gfngfn/Sesterl/6a64539cdda062048986d0056a710d1790bb69e1/test/testIdentifierScheme.ml | ocaml |
module SnakeCase = struct
type t = {
message : string;
input : string;
expects : (string list) option;
}
let test (r : t) () =
let actual =
IdentifierScheme.from_snake_case r.input |> Option.map (fun x -> x.IdentifierScheme.fragments)
in
Alcotest.(check (option (list string))) r... | |
275a41ca32594a88b67070c9de3f0fad4a1a74db37a86ac51c2d833383c6c023 | cj1128/sicp-review | 2.35.scm | (load "accumulate.scm")
(define (count-leaves tree)
(accumulate +
0
(map
(lambda (sub-tree)
(if (pair? sub-tree)
(count-leaves sub-tree)
1))
tree)))
(define t '(((1 2) 3) 4 (5 6)))
(display (co... | null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-2/2.2/2.35.scm | scheme | (load "accumulate.scm")
(define (count-leaves tree)
(accumulate +
0
(map
(lambda (sub-tree)
(if (pair? sub-tree)
(count-leaves sub-tree)
1))
tree)))
(define t '(((1 2) 3) 4 (5 6)))
(display (co... | |
95da2565575ad49d7ba451adc261c09348b79ef195230bf78c22d4bcbe162f1a | restyled-io/restyled.io | Admin.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wno - missing - local - signatures #
module Restyled.Handlers.Admin
( getAdminR
, getAdminStatsReposR
, getAdminStatsJobsR
) where
import Restyled.Prelude.Esqueleto
import Data.List (elemIndex)
import Formatting (format)
import Form... | null | https://raw.githubusercontent.com/restyled-io/restyled.io/e3208b62dfea0916b9760cf8dd73abc7c5f080bb/src/Restyled/Handlers/Admin.hs | haskell | brittany-disable-next-binding
brittany-disable-next-binding
N.B. we're using @^.@ on the @jobs@ even though it's an @OUTER JOIN@ and so
it could be nullable. It's safe because we don't return any
much easier to work with (e.g. for 'withinTimeRange')
| # LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wno - missing - local - signatures #
module Restyled.Handlers.Admin
( getAdminR
, getAdminStatsReposR
, getAdminStatsJobsR
) where
import Restyled.Prelude.Esqueleto
import Data.List (elemIndex)
import Formatting (format)
import Form... |
26c2028f890970119ac7c7770330e98e29fb962c68e7045e92ebb50c75db5854 | ocaml/ocaml | tophooks.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml/ocaml/6a7a7b36fa2b6f4c4f3d210c8ecaff6faa094adf/toplevel/native/tophooks.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Native toplevel dynamic loading interface
open Config
open Misc
open Topcommon
type[@warning "-37"] r... |
bafa270e5867e9e976973dbb0ebfd46160cc1ff9d47d4d95a7d09dd87136914d | basho/riak_search | riak_indexed_doc.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
%%
%% -------------------------------------------------------------------
-module(riak_indexed_doc).
-export([
new/4,
index/1, id/1,
idx_doc_bucket/1,
... | null | https://raw.githubusercontent.com/basho/riak_search/79c034350f37706a1db42ffca8f6449d4cce99e1/src/riak_indexed_doc.erl | erlang | -------------------------------------------------------------------
-------------------------------------------------------------------
Create a new indexed doc
from previously analyzed results.
Get some values.
that field.
Don't re-analyze an already analyzed idx doc.
Extract fields, get schema...
into term... | Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
-module(riak_indexed_doc).
-export([
new/4,
index/1, id/1,
idx_doc_bucket/1,
fields/1, fields/2,
regular_fields/1, regular_fields/2,
inline_fields/1, inline_fields/2,
props/1, add_prop/3, set_props/2, clear_pro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.