_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 |
|---|---|---|---|---|---|---|---|---|
a784f6453a5e6b3d16279dc0182cf1c53573f7f48de45ef398034ac94b3d1576 | manuel-serrano/bigloo | evaluate_types.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / runtime / Eval / evaluate_types.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/runtime/Eval/evaluate_types.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Private types of the lambda-based evaluator */
*===========================... | * serrano / prgm / project / bigloo / runtime / Eval / evaluate_types.scm * /
* Author : * /
* Creation : Tue Feb 8 16:37:05 2011 * /
* Last change : Sun Feb 10 09:52:31 2013 ( serrano ) * /
* Cop... |
2febb6bf1696dcf6bad33ab07aad42bce5249ac13c974189777727246de8514e | srdqty/talc-3.0 | compare.ml | let _ =
let img1 = Ppm.load Sys.argv.(1) in
let img2 = Ppm.load Sys.argv.(2) in
let w = Ppm.width img1 in
let h = Ppm.height img1 in
let s = ref 0 in
let d = ref 0 in
for j = 0 to h - 1 do
for i = 0 to w - 1 do
for k = 0 to 2 do
let v = abs (Ppm.get img1 i j k - Ppm.get img2 i j k) in
... | null | https://raw.githubusercontent.com/srdqty/talc-3.0/df83dd5ff0e2b189b13280ddae233d8277199350/apps/gml/plclub/src/compare.ml | ocaml | let _ =
let img1 = Ppm.load Sys.argv.(1) in
let img2 = Ppm.load Sys.argv.(2) in
let w = Ppm.width img1 in
let h = Ppm.height img1 in
let s = ref 0 in
let d = ref 0 in
for j = 0 to h - 1 do
for i = 0 to w - 1 do
for k = 0 to 2 do
let v = abs (Ppm.get img1 i j k - Ppm.get img2 i j k) in
... | |
4c9714086816c20f809ff7bce0960c917a13c2adebc5e6875a75da6f294768c8 | hachreak/swagger_routerl | swagger_routerl_emqtt_tests.erl | @author < >
( C ) 2016
%%%
%%% This software is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This software is dist... | null | https://raw.githubusercontent.com/hachreak/swagger_routerl/3005b789f8c09b58894b15fe31ee699630553338/test/swagger_routerl_emqtt_tests.erl | erlang |
This software is free software; you can redistribute it and/or
License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General... | @author < >
( C ) 2016
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
along with this software ; if not , write to the Free Software Foundation ,
Inc.... |
e8f88f6c954ac64dd746a76e24d4b69fa187712b6ad3fac39aea10effe76883e | igorhvr/bedlam | glob.scm | ;;; "glob.scm" String matching for filenames (a la BASH).
Copyright ( C ) 1998 .
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
1 . Any copy made of this... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/glob.scm | scheme | "glob.scm" String matching for filenames (a la BASH).
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-free, and I am under no ... | Copyright ( C ) 1998 .
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
(define (glob:pattern->tokens pat)
(cond
((string? pat)
(let loop ((i 0)
... |
f83497e1c4f099639465dfea118efbe4b0c41929616406691bd0462042a53d6a | y2q-actionman/cl-json-pointer | synonyms.lisp | (cl:defpackage #:cl-json-pointer/synonyms
(:nicknames :cljsp) ; I worry about name conflict...
(:documentation "Provide synonyms of cl-json-pointer package, for convenience.")
(:use :cl #:cl-json-pointer)
(:shadow #:get #:set #:delete #:remove)
(:export
#:json-pointer-error
#:parse #:get #:exists... | null | https://raw.githubusercontent.com/y2q-actionman/cl-json-pointer/5be6850ec5fa2cd31eb8b8ffe99f62554e698675/synonyms/synonyms.lisp | lisp | I worry about name conflict... | (cl:defpackage #:cl-json-pointer/synonyms
(:documentation "Provide synonyms of cl-json-pointer package, for convenience.")
(:use :cl #:cl-json-pointer)
(:shadow #:get #:set #:delete #:remove)
(:export
#:json-pointer-error
#:parse #:get #:exists-p #:set #:add #:delete #:remove #:update #:deletef))
(in-pac... |
134c7e5fce499a9b0f2222c1223d0379e61e4eb1e5bc605b016f875c040b5455 | spartango/CS153 | cish_eval.ml | An interpreter for Cish programs -- includes some rudimentary debugging
* support which you should feel free to augment ...
* support which you should feel free to augment...
*)
open Cish_ast
Cish values are either integers or functions
type value = Int_v of int | Fun_v of func
(* for debugging *)
let val... | null | https://raw.githubusercontent.com/spartango/CS153/16faf133889f1b287cb95c1ea1245d76c1d8db49/ps4/cish_eval.ml | ocaml | for debugging
set this flag to true to turn on diagnostics when evaluating
The state of the interpreter includes bindings for variables
* (varenv), a memory to hold heap-allocated values (memory),
* and an allocation pointer, pointing to the next available
* location in the memory. The memory and allocation ... | An interpreter for Cish programs -- includes some rudimentary debugging
* support which you should feel free to augment ...
* support which you should feel free to augment...
*)
open Cish_ast
Cish values are either integers or functions
type value = Int_v of int | Fun_v of func
let val2string = function
... |
3e4d459f6defbf74068a9d071d6a0df38b05b610309c492265a972e8be762163 | ghc/nofib | Dependancy.hs |
-- ==========================================================--
= = = Dependancy analyser dependancy.m ( 1 ) = = = --
-- ==========================================================--
module Dependancy where
import BaseDefs
import Utils
-- ==========================================================--
-... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/real/anna/Dependancy.hs | haskell | ==========================================================--
==========================================================--
==========================================================--
==========================================================--
==========================================================--
=====... |
module Dependancy where
import BaseDefs
import Utils
deBindersOf :: [(a,b)] -> [a]
deBindersOf defns = [name | (name, rhs) <- defns]
deValuesOf :: [(a,b)] -> [b]
deValuesOf defns = [rhs | (name, rhs) <- defns]
deFreeVars :: CExpr -> AnnExpr Naam (Set Naam)
deFreeVars (ENum k) = (utSetEmp... |
ea39c8b8a1ca2ce146d6c23acef515ab291f30f6ca21ccc829a04ed4a2e2e256 | frenetic-lang/netkat-automata | Frenetic_Decide_Repl.mli | val main : unit -> unit
| null | https://raw.githubusercontent.com/frenetic-lang/netkat-automata/a4c3809e40e7c2ce500182043a74131ac9c19579/src/Frenetic_Decide_Repl.mli | ocaml | val main : unit -> unit
| |
c45132d1ee7040554564b5c4cedf5a59ac402bc6264a0a14e1c4d12f86034248 | onedata/op-worker | data_constraints.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 - 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module handles operati... | null | https://raw.githubusercontent.com/onedata/op-worker/99b86a7229f6db6a694997bd5df4aa69e140e7ee/src/modules/fslogic/security/data_constraints.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
This module handles operations on data constraints (e.g. verifying
whether access to file should be allowed).
- allowed_paths - list of paths which are allowed (also ... | @author
( C ) 2019 - 2020 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
There are 3 types of constraints :
-module(data_constraints).
-author("Bartosz Walkowicz").
-include_lib("ctool/include/aai/caveats.hrl").
-include_lib("ctool/include/errors.hrl").
-includ... |
32c9b1a8bdbbe1c84be69a6979c45e52a3fa47c6cbd1f54adcb5b6d5ca626ed6 | minoki/haskell-floating-point | Common.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE NoImplicitPrelude #
module Numeric.Floating.IEEE.Internal.Rounding.Common where
import Control.Exception (assert)
import Data.Bits
import Data.Functor.Product
import Data.Int
import GHC.Float (expt)
imp... | null | https://raw.githubusercontent.com/minoki/haskell-floating-point/7d7bb31bb2b07c637a5eaeda92fc622566e9b141/fp-ieee/src/Numeric/Floating/IEEE/Internal/Rounding/Common.hs | haskell | # LANGUAGE BangPatterns #
^ negative (True -> negative, False -> positive)
^ parity (even -> toward-zero is even, odd -> toward-zero is odd)
^ negative (True -> negative, False -> positive)
^ parity (even -> toward-zero is even, odd -> toward-zero is odd)
^ the dividend @x@
^ base
^ the multiplicand @x@
^ base
... | # LANGUAGE DeriveFunctor #
# LANGUAGE NoImplicitPrelude #
module Numeric.Floating.IEEE.Internal.Rounding.Common where
import Control.Exception (assert)
import Data.Bits
import Data.Functor.Product
import Data.Int
import GHC.Float (expt)
import Math.NumberTheor... |
3cc00ce5eb0c860a137c0995871a9d41b01fcac5412271e0dbb7efa18a0c4491 | JeffreyBenjaminBrown/hode | Search.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Data.Rslt.Search where
import qualified Data.List as L
import Data.Maybe (isNothing, catMaybes)
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Data.Rslt
i... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/hode/79a54a6796fa01570cde6903b398675c42954e62/earlier-work/Rslt/ancient/Search.hs | haskell | ^ a variable, in the logic programming sense
| Positive `RQuery`s are things you can search for.
Non-positive `RQuery`s are too broad to search for.
`RQVar` is neither positive nor negative.
Will I need a recursive version?
isPositiveRQuery (RQHasInRole _ q) = isPositiveRQuery q
`fromM` = the result o... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Data.Rslt.Search where
import qualified Data.List as L
import Data.Maybe (isNothing, catMaybes)
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Data.Rslt
i... |
78e97f9dacbf44a47389ab6cc00376751e8a8a6ea08c703ab41b1b6dc403824c | shaunlebron/gh4st | viz.cljs | (ns gh4st.viz
(:require
[clojure.string :as string]
[gh4st.math :refer [add-pos
sub-pos
scale-dir
]]
[gh4st.ai :refer [tick-actor
actor-target]]
)
)
;;------------------------------------------------------... | null | https://raw.githubusercontent.com/shaunlebron/gh4st/e329f42f0d19ddeebcf85ca0e1efa03d9af22a56/src/gh4st/viz.cljs | clojure | ----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
stop if we are stuck in a position ... | (ns gh4st.viz
(:require
[clojure.string :as string]
[gh4st.math :refer [add-pos
sub-pos
scale-dir
]]
[gh4st.ai :refer [tick-actor
actor-target]]
)
)
Actor
(defn target-point
[[x y] name-]
[:circl... |
bf926eed790471478f7a1ac3e44d4e8f16954d8b00f5a87a36a9bea52cc85628 | jlouis/erlang-utp | utp_file_map.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 ,
%%% @doc
%%%
%%% @end
Created : 11 Aug 2011 by < >
%%%-------------------------------------------------------------------
-module(utp_file_map).
-behaviour(gen_server).
%% API
-export([start_link/1,
... | null | https://raw.githubusercontent.com/jlouis/erlang-utp/fa6cbb8831b06e7f507779dcd7a0e2e94bdbff1a/src/utp_file_map.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
===================================================================
@doc
Starts the server
@end
---------------------------------------------... | @author < >
( C ) 2011 ,
Created : 11 Aug 2011 by < >
-module(utp_file_map).
-behaviour(gen_server).
-export([start_link/1,
cmd/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-record(state, { file_map :: ... |
513be15f67038874a9fdf52da271fb7406b12e9fce917b66cabc0c2e03700352 | raimohanska/rump | Main.hs | {-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-}
module Main where
import qualified RumpServer as R
main :: IO ()
main = R.main
| null | https://raw.githubusercontent.com/raimohanska/rump/f64c95fe80bb37dedb3f55627c3450c878c66e80/src/Main.hs | haskell | # LANGUAGE OverloadedStrings, DeriveDataTypeable # | module Main where
import qualified RumpServer as R
main :: IO ()
main = R.main
|
1be77e6154f20637ebf968e08cee318bfcda1617b01586774f57c522b15a4b21 | plumatic/grab-bag | math.clj | (ns plumbing.math
(:use plumbing.core)
(:require
[plumbing.core-incubator :as pci])
(:import
[java.text DecimalFormat DecimalFormatSymbols]))
(set! *warn-on-reflection* true)
(defn ceil [x] (long (Math/ceil x)))
(defn floor [x] (long (Math/floor x)))
(defn approx-= [a b & [tolerance]]
(< (Math/abs (do... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/plumbing/src/plumbing/math.clj | clojure | (ns plumbing.math
(:use plumbing.core)
(:require
[plumbing.core-incubator :as pci])
(:import
[java.text DecimalFormat DecimalFormatSymbols]))
(set! *warn-on-reflection* true)
(defn ceil [x] (long (Math/ceil x)))
(defn floor [x] (long (Math/floor x)))
(defn approx-= [a b & [tolerance]]
(< (Math/abs (do... | |
34b0323dfc6727b660e1e82b5dcf06d1fb00ae84e841187d74f3240e91b0a947 | progman1/genprintlib | parser_aux.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/progman1/genprintlib/acc1e5cc46b9ce6191d0306f51337581c93ffe94/debugger/4.10.0/parser_aux.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
OCaml port by and
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type expression =
| E_result
type break_arg =
| BA_... |
d9e4f92ef5a0b2656d15b5076565e79ad547a62d8a987a9d3ef3837363209f4b | dcavar/schemeNLP | sequences2.scm | (vector 0.1 0.4 #\a "Hello" (vector 3 7 #\t) )
(define parameters (make-vector 4))
parameters
(vector? parameters)
(vector-set! parameters 3 #\a)
(vector-ref parameters 2)
(vector-ref parameters 3)
| null | https://raw.githubusercontent.com/dcavar/schemeNLP/daa0ddcc4fa67fe00dcf6054c4d30d11a00b2f7f/src/sequences2.scm | scheme | (vector 0.1 0.4 #\a "Hello" (vector 3 7 #\t) )
(define parameters (make-vector 4))
parameters
(vector? parameters)
(vector-set! parameters 3 #\a)
(vector-ref parameters 2)
(vector-ref parameters 3)
| |
bf800f2d667910bd4ee9f24ac8f79ea9a930834d6b366e2a2f08e7d864b60ac7 | squirrel-prover/squirrel-prover | utils.mli | (** Utility modules. *)
module Hashtbl : sig
include module type of Hashtbl
val to_list : ('a, 'b) t -> ('a * 'b) list
module Make2
(H1:HashedType)
(H2:HashedType) : S with type key = H1.t * H2.t
end
(*------------------------------------------------------------------*)
module List : sig
include... | null | https://raw.githubusercontent.com/squirrel-prover/squirrel-prover/b50eebf07debe8b39bd317c2c39046c0fa3ce60c/src/utils.mli | ocaml | * Utility modules.
------------------------------------------------------------------
* [init n f] returns the list containing the results of
[(f 0)],[(f 1)] ... [(f (n-1))].
* [diff a b] is [a] minus [b]'s elements
* [drop_right n l] returns [l] without the last [n] elements, or the empty list
if [l]... |
module Hashtbl : sig
include module type of Hashtbl
val to_list : ('a, 'b) t -> ('a * 'b) list
module Make2
(H1:HashedType)
(H2:HashedType) : S with type key = H1.t * H2.t
end
module List : sig
include module type of List
val init : int -> (int -> 'a) -> 'a list
val split3 : ('a * 'b * 'c... |
99e3933afa91faf5dc412484dd67d1a47ee727ae9520ecfb21b6512a69d2ccd5 | haskell-tools/haskell-tools | SectionInfix_res.hs | module Refactor.ExtractBinding.SectionInfix where
a = f 3
where f = ((1 + 2) +) | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/ExtractBinding/SectionInfix_res.hs | haskell | module Refactor.ExtractBinding.SectionInfix where
a = f 3
where f = ((1 + 2) +) | |
e59efd78c586b06df5008db31ae3bf67df538f03fe0591de2b41075f94b96855 | pkrumins/the-little-mler | 05-couples.ml |
* * Chapter 5 of The Little MLer :
* * Couples Are Magnificent , Too
* *
* * Code examples assembled by ( ) .
* * His blog is at -- good coders code , great reuse .
* *
* * Get yourself this wonderful book at Amazon :
** Chapter 5 of The Little MLer:
** Couples Are Magnificent, Too
**... | null | https://raw.githubusercontent.com/pkrumins/the-little-mler/369745c04daee42a52cf54f48f27cac8092b0f83/05-couples.ml | ocaml | Another pizza datatype
Fishes
Example of fish pizza
It's type is fish pizza
What's the type of rem_anchovy?
It's fish pizza -> fish pizza
Example of rem_anchovy
Topping(Lox, Topping(Tuna, Bottom))
Let's make rem_anchovy shorter
Test rem_anchovy2
Topping(Lox, Topping(Tuna, Bottom))
Let's re... |
* * Chapter 5 of The Little MLer :
* * Couples Are Magnificent , Too
* *
* * Code examples assembled by ( ) .
* * His blog is at -- good coders code , great reuse .
* *
* * Get yourself this wonderful book at Amazon :
** Chapter 5 of The Little MLer:
** Couples Are Magnificent, Too
**... |
cdea9b03032a3c225b399c6c371e8ad9dc5d2bdc1f8ab071c66a4463bcb0b9ad | facebook/pyre-check | taintTransformOperation.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/c10ec13a3520e0d09fc7c0547b1b668377666d5a/source/interprocedural_analyses/taint/taintTransformOperation.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
f36788212894b0468aca65cc07bbaac2ab3b58da9204decea05935744859b321 | mishun/tangles | CobordismMatrix.hs | # LANGUAGE FlexibleInstances , MultiWayIf , StandaloneDeriving , TypeFamilies , UndecidableInstances #
module Math.Topology.KnotTh.Algebra.Cobordism.CobordismMatrix
( CobordismMatrix
, numberOfRows
, numberOfCols
, isEmpty
, singleton
, (!)
, removeRow
, removeCol
, minor
, matri... | null | https://raw.githubusercontent.com/mishun/tangles/9af39dd48e3dcc5e3944f8d060c8769ff3d81d02/src/Math/Topology/KnotTh/Algebra/Cobordism/CobordismMatrix.hs | haskell | # INLINE (!) # | # LANGUAGE FlexibleInstances , MultiWayIf , StandaloneDeriving , TypeFamilies , UndecidableInstances #
module Math.Topology.KnotTh.Algebra.Cobordism.CobordismMatrix
( CobordismMatrix
, numberOfRows
, numberOfCols
, isEmpty
, singleton
, (!)
, removeRow
, removeCol
, minor
, matri... |
89dfad183b765e93f0c680395e69a69b157ece850ee5b4edaded5b5627eb50fb | IvanIvanov/haskell-lisp-interpreter | Parser.hs | module Interpreter.Parser
( tokenize
, parse
, parseSequence
, analyzeExpression
, analyzeExpressionSequence
) where
import Interpreter.DataTypes
-- Constants.
symbolCharacters :: String
symbolCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_!?-+*/%<>#"
numberCharacters :: String
numberCha... | null | https://raw.githubusercontent.com/IvanIvanov/haskell-lisp-interpreter/a5835c290f9f92eaaafa15b8ee5a0ae4b0c81bb7/src/Parser.hs | haskell | Constants.
a Lisp program into an abstract syntax tree. It performs lexical analysis on
a Lisp program into an abstract syntax tree. It takes the list of tokens
The newly built expression along with the remaining tokens are returned.
The Expressions that are returned are "primitive". They are entirely
comprised o... | module Interpreter.Parser
( tokenize
, parse
, parseSequence
, analyzeExpression
, analyzeExpressionSequence
) where
import Interpreter.DataTypes
symbolCharacters :: String
symbolCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_!?-+*/%<>#"
numberCharacters :: String
numberCharacters = "012... |
e4924842e76a2985ecdd51b9df5ebc86cbfc4fc9df460f49834747f665278078 | shayne-fletcher/zen | test_gt_tl_0.ml | #load "graph.cma" ;;
open Gt
module G = struct
include (Directed_graph.Make (Char) : Directed_graph.S with type node = Char.t)
let g : t = of_adjacency
[
'a', ['b'] ;
'b', ['e'; 'f'; 'c'] ;
'c', ['d'; 'g'] ;
'd', ['c'; 'h'] ;
'e', ['a'; 'f'] ;
'... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/gt/test_gt_tl_0.ml | ocaml | #load "graph.cma" ;;
open Gt
module G = struct
include (Directed_graph.Make (Char) : Directed_graph.S with type node = Char.t)
let g : t = of_adjacency
[
'a', ['b'] ;
'b', ['e'; 'f'; 'c'] ;
'c', ['d'; 'g'] ;
'd', ['c'; 'h'] ;
'e', ['a'; 'f'] ;
'... | |
5ff9bd9d198239714176838bc4df619e0b8db5a21510f4a7974ebf1b9beb23f2 | RDTK/generator | files.lisp | ;;;; files.lisp --- String-related utilities.
;;;;
Copyright ( C ) 2015 , 2016 , 2018 , 2019 Jan Moringen
;;;;
Author : < >
(cl:in-package #:build-generator.util)
;;; Namestrings
(defun safe-enough-namestring (pathname &optional defaults)
(let* ((safe-directory (substitute :up :back (pathname-directory path... | null | https://raw.githubusercontent.com/RDTK/generator/8d9e6e47776f2ccb7b5ed934337d2db50ecbe2f5/src/util/files.lisp | lisp | files.lisp --- String-related utilities.
Namestrings
Finding files | Copyright ( C ) 2015 , 2016 , 2018 , 2019 Jan Moringen
Author : < >
(cl:in-package #:build-generator.util)
(defun safe-enough-namestring (pathname &optional defaults)
(let* ((safe-directory (substitute :up :back (pathname-directory pathname)))
(safe-pathname (make-pathname :directory safe-director... |
d2b068efc563cc7afe16dde35f66b6b03ba8e5ad6c771ce3af5b51901d07a1a0 | lispyclouds/navi | core_test.clj | Copyright 2021-
;
Use of this source code is governed by an MIT - style
; license that can be found in the LICENSE file or at
; .
(ns navi.core-test
(:require [clojure.test :refer [deftest testing is]]
[navi.core :as core])
(:import [java.util Map LinkedHashMap]
[io.swagger.v3.oas.mode... | null | https://raw.githubusercontent.com/lispyclouds/navi/c6cd2cc6c318fcd74b53a1e69176a96dbf42990c/test/navi/core_test.clj | clojure |
license that can be found in the LICENSE file or at
. | Copyright 2021-
Use of this source code is governed by an MIT - style
(ns navi.core-test
(:require [clojure.test :refer [deftest testing is]]
[navi.core :as core])
(:import [java.util Map LinkedHashMap]
[io.swagger.v3.oas.models Operation PathItem]
[io.swagger.v3.oas.models.... |
2a67784320f78cdb94e56d0b50bb82606f6fd15d3ce86b73f426dbd6fa7eecb4 | wdebeaum/step | unlikely.lisp | ;;;;
;;;; W::unlikely
;;;;
(define-words :pos W::adj :templ CENTRAL-ADJ-TEMPL
:words (
(W::unlikely
(SENSES
((meta-data :origin calo :entry-date 20031223 :change-date nil :wn ("unlikely%5:00:00:implausible:00") :comments html-purchasing-corpus)
(EXAMPLE "He is unlikely to do this")
(lf-parent ont::... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/unlikely.lisp | lisp |
W::unlikely
it is unlikely that... |
(define-words :pos W::adj :templ CENTRAL-ADJ-TEMPL
:words (
(W::unlikely
(SENSES
((meta-data :origin calo :entry-date 20031223 :change-date nil :wn ("unlikely%5:00:00:implausible:00") :comments html-purchasing-corpus)
(EXAMPLE "He is unlikely to do this")
(lf-parent ont::not-likely-val)
(SEM (... |
403baf72facc5fe1c2f170379e3bb028cf2f1df80fdd93e2678ba34ddff21c37 | msszczep/pequod-cljs | dep1ex70.clj | version -lfs.github.com/spec/v1
oid sha256:f9e537a847a7dab10bc5d66d88f8c3014baf4728f87af9249460f86ba3634993
size 160898461
| null | https://media.githubusercontent.com/media/msszczep/pequod-cljs/986ad97fa39d5b83828c07daf80655460b27d2dd/src/clj/pequod_cljs/dep1ex70.clj | clojure | version -lfs.github.com/spec/v1
oid sha256:f9e537a847a7dab10bc5d66d88f8c3014baf4728f87af9249460f86ba3634993
size 160898461
| |
eeae30342c1718efb9ea43cbcac20c7499df0f2bf32ca3672523df74e772c62a | csabahruska/jhc-components | Inst.hs | # OPTIONS_GHC -cpp -fno - warn - unused - imports #
# LANGUAGE CPP #
#include "hs_src_config.h"
-- Useful instances that don't belong anywhere else.
module Util.Inst() where
import Control.Applicative
import Control.Monad.Identity(Identity(..))
import Data.Foldable(Foldable(..))
import Data.Monoid(Monoid(..))
import... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-common/src/Util/Inst.hs | haskell | Useful instances that don't belong anywhere else. | # OPTIONS_GHC -cpp -fno - warn - unused - imports #
# LANGUAGE CPP #
#include "hs_src_config.h"
module Util.Inst() where
import Control.Applicative
import Control.Monad.Identity(Identity(..))
import Data.Foldable(Foldable(..))
import Data.Monoid(Monoid(..))
import Data.Traversable(Traversable(..), foldMapDefault, fm... |
6cd0026c8cef7a671ad19209c306831ef16eee16a64e8bbce6795655efa2116d | glagoly/glagoly | view_index.erl | -module(view_index).
-export([event/1]).
-include_lib("nitro/include/nitro.hrl").
-include_lib("web.hrl").
event(init) ->
case usr:state() of
pers ->
nitro:redirect("feed.html");
_ ->
nitro:update(
cta_create,
#button{
id ... | null | https://raw.githubusercontent.com/glagoly/glagoly/1c66dfd83b070b177b0c6c53c278248f4a55c73b/src/view_index.erl | erlang | -module(view_index).
-export([event/1]).
-include_lib("nitro/include/nitro.hrl").
-include_lib("web.hrl").
event(init) ->
case usr:state() of
pers ->
nitro:redirect("feed.html");
_ ->
nitro:update(
cta_create,
#button{
id ... | |
d25e42a8597853603435e7eb9bea1e959f8ab5e46ce93da907d0dc31d70ae23d | uncomplicate/deep-diamond | tensor.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php) or later
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be boun... | null | https://raw.githubusercontent.com/uncomplicate/deep-diamond/41913bf930bad92f8341ad679459827ac61ebf93/src/clojure/uncomplicate/diamond/internal/dnnl/tensor.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php) or later
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not rem... | Copyright ( c ) . All rights reserved .
(ns uncomplicate.diamond.internal.dnnl.tensor
(:require [uncomplicate.commons
[core :refer [Releaseable release let-release with-release Info info Viewable view]]
[utils :refer [dragan-says-ex]]]
[uncomplicate.fluokitten
... |
12603b0bc271f87a8c45d74d88f1c2007c8d3b253f1054d535dd746b8f09aa17 | MLstate/opalang | main_utils.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/opa/main_utils.ml | ocaml | alphabetic order |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
0109f082d072098fede611731561f86913eaaa4889180626a31cb12c58a36b38 | herd/herdtools7 | matrix.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/e0b8ed1208d77a0b9917d1382801792f5bfbe703/tools/matrix.mli | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
dccc4c93d4a0bc2a1efe9b55e0f0ea7832bfd20fa33bc1b5c78337e6f03b76aa | weblocks-framework/weblocks | application.lisp |
(in-package :weblocks)
make SBCL use and verify type information for slots
(declaim (optimize (safety 3)))
(export '(defwebapp
weblocks-webapp
start-webapp
stop-webapp
restart-webapp
get-webapp
get-webapps-for-class
initialize-webapp
f... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/src/application.lisp | lisp | current bundling code is flaky
Make slot readers that will return nil if debug is on
Yet still retain the original values when debug is off
Slash-normalizing accessors
XXX multiple slashes?
abstraction macro
bypass the normalizing axr
only pass name when truly given
building webapp uris
webapp-scoped sess... |
(in-package :weblocks)
make SBCL use and verify type information for slots
(declaim (optimize (safety 3)))
(export '(defwebapp
weblocks-webapp
start-webapp
stop-webapp
restart-webapp
get-webapp
get-webapps-for-class
initialize-webapp
f... |
d3c08a239636248e471070e245870f0243834e0600b57d68eb4c315f2c89c96e | michalkonecny/aern2 | Roots.hs | module AERN2.Poly.Power.Roots
(
initialBernsteinCoefs,
bernsteinCoefs,
signVars,
reflect,
contract,
translate,
transform,
findRoots,
Terms
)
where
import MixedTypesNumPrelude
import Data.Map (Map)
import qualified Data.Map as Map
import qualified Prelude
import AERN2.MP.Ball hiding (iterateUntilAccurate)
import Data.M... | null | https://raw.githubusercontent.com/michalkonecny/aern2/1c8f12dfcb287bd8e3353802a94865d7c2c121ec/aern2-fun-univariate/src/AERN2/Poly/Power/Roots.hs | haskell | Input: Polynomial P and numbers l, r.
Note that m does not have to lie between l and r.
root finding algorithm:
TODO: if signVars == Nothing - recompute or give up? (currently giving up)
[(l,r)]
TODO: improve data structure to avoid redundant computations
TODO: find a better perturbation function
auxiliary func... | module AERN2.Poly.Power.Roots
(
initialBernsteinCoefs,
bernsteinCoefs,
signVars,
reflect,
contract,
translate,
transform,
findRoots,
Terms
)
where
import MixedTypesNumPrelude
import Data.Map (Map)
import qualified Data.Map as Map
import qualified Prelude
import AERN2.MP.Ball hiding (iterateUntilAccurate)
import Data.M... |
398ae64365a2765a3d480ca2f48b16aebd4bf944b9d20625d090998b96644244 | camllight/camllight | esbit.ml | type tampon = { mutable val: int; mutable nbits: int };;
let tampon = { val = 0; nbits = 0 };;
let initialise () = tampon.val <- 0; tampon.nbits <- 0;;
let écrire_bit sortie bit =
tampon.val <- tampon.val lor (bit lsl tampon.nbits);
tampon.nbits <- tampon.nbits + 1;
if tampon.nbits >= 8 then begin
output_char... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/windows/examples/compress/esbit.ml | ocaml | type tampon = { mutable val: int; mutable nbits: int };;
let tampon = { val = 0; nbits = 0 };;
let initialise () = tampon.val <- 0; tampon.nbits <- 0;;
let écrire_bit sortie bit =
tampon.val <- tampon.val lor (bit lsl tampon.nbits);
tampon.nbits <- tampon.nbits + 1;
if tampon.nbits >= 8 then begin
output_char... | |
b5d0dc31f1c7644e9e8e409ee3092c03a5cb08b284e29df27de90996123267e6 | clojure-interop/google-cloud-clients | WebRiskServiceV1Beta1Stub.clj | (ns com.google.cloud.webrisk.v1beta1.stub.WebRiskServiceV1Beta1Stub
"Base stub class for Web Risk API.
This class is for advanced usage and reflects the underlying API directly."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.webrisk.v1beta1.stub WebRiskServiceV1Beta1Stub]))
(defn... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.webrisk/src/com/google/cloud/webrisk/v1beta1/stub/WebRiskServiceV1Beta1Stub.clj | clojure | (ns com.google.cloud.webrisk.v1beta1.stub.WebRiskServiceV1Beta1Stub
"Base stub class for Web Risk API.
This class is for advanced usage and reflects the underlying API directly."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.webrisk.v1beta1.stub WebRiskServiceV1Beta1Stub]))
(defn... | |
09a0598d87c66436c1afd93ab69305a1936aa693c116eee2f167928e0203eb14 | lamdu/lamdu | GetField.hs | module Lamdu.Sugar.Convert.GetField
( convert, convertGetFieldParam
) where
import qualified Control.Lens as Lens
import qualified Lamdu.Calc.Lens as ExprLens
import qualified Lamdu.Calc.Term as V
import qualified Lamdu.Calc.Type as T
import qualified Lamdu.Expr.IRef as ExprIRef
import Lamdu.Sugar.Co... | null | https://raw.githubusercontent.com/lamdu/lamdu/8c4b60d42f980f3e03c7e88b01c4437e31cf1cb1/src/Lamdu/Sugar/Convert/GetField.hs | haskell | module Lamdu.Sugar.Convert.GetField
( convert, convertGetFieldParam
) where
import qualified Control.Lens as Lens
import qualified Lamdu.Calc.Lens as ExprLens
import qualified Lamdu.Calc.Term as V
import qualified Lamdu.Calc.Type as T
import qualified Lamdu.Expr.IRef as ExprIRef
import Lamdu.Sugar.Co... | |
6cffd3be562ef9bc42a5fceab2c4996a20f1e3356e633cbe554011abaebd7ed1 | sgbj/MaximaSharp | dnrm2.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/blas/dnrm2.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
a8de585bb190a89b97bef9fb295abe4479219af7bab766ac1b61bf38b0c52682 | ghuysmans/api-cohttp-lwt | mock.mli | module Make : functor () -> sig
val employees: (int, Api.Types.t) Hashtbl.t
val router: Api_cohttp_lwt_mock.Client.router
end
| null | https://raw.githubusercontent.com/ghuysmans/api-cohttp-lwt/4edfcb4d24deeeaca5786cb0e440fe295ef05b6f/demo/mock/mock.mli | ocaml | module Make : functor () -> sig
val employees: (int, Api.Types.t) Hashtbl.t
val router: Api_cohttp_lwt_mock.Client.router
end
| |
3b9da1f660f4dffc31f79b7d9366a7fece895af862bd5efd71673f196fa0195d | sdiehl/elliptic-curve | Montgomery.hs | module Test.Montgomery where
import Protolude
import qualified Data.Curve.Montgomery.Curve448 as Curve448
import qualified Data.Curve.Montgomery.Curve25519 as Curve25519
import qualified Data.Curve.Montgomery.Curve383187 as Curve383187
import qualified Data.Curve.Montgomery.M221 as M221
import qualified Da... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/test/Test/Montgomery.hs | haskell | module Test.Montgomery where
import Protolude
import qualified Data.Curve.Montgomery.Curve448 as Curve448
import qualified Data.Curve.Montgomery.Curve25519 as Curve25519
import qualified Data.Curve.Montgomery.Curve383187 as Curve383187
import qualified Data.Curve.Montgomery.M221 as M221
import qualified Da... | |
bf009d40c48b409388621860c18115a1701de46892cc0c6649441dc0111324cc | mgritter/aoc-lh | Main.hs | {-@ LIQUID "--max-case-expand=4" @-}
module Main (main) where
import LoadLines
import Data.String
import Data.Set
import Data.Maybe
import Control.Monad
import Data.Char
@ splitRucksack : : { r : String | ( len r ) mod 2 = 0 } - >
( { c1 : String | ( len c1 ) * 2 = len r } ,
{ c2 : String | ( len c2 )... | null | https://raw.githubusercontent.com/mgritter/aoc-lh/83e93212fb865d5478de1f07556def009cf12213/2022/day3/Main.hs | haskell | @ LIQUID "--max-case-expand=4" @
Why don't sets have a cardinality in the specfication? |
module Main (main) where
import LoadLines
import Data.String
import Data.Set
import Data.Maybe
import Control.Monad
import Data.Char
@ splitRucksack : : { r : String | ( len r ) mod 2 = 0 } - >
( { c1 : String | ( len c1 ) * 2 = len r } ,
{ c2 : String | ( len c2 ) * 2 = len r } ) @
({c1:String | (... |
13e014c8afb49135f7d691770db538231a7df40010875f304866396045099fda | semilin/layoup | (-_-).lisp |
(MAKE-LAYOUT :NAME "(-_-)" :MATRIX
(APPLY #'KEY-MATRIX '(";oe.lbkpfm" "iaqnx,htsg" "zju'rvywcd"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/(-_-).lisp | lisp |
(MAKE-LAYOUT :NAME "(-_-)" :MATRIX
(APPLY #'KEY-MATRIX '(";oe.lbkpfm" "iaqnx,htsg" "zju'rvywcd"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
97c6ccc2740755ca69f08017c10a1ed02b603000f2a75f405d9efe189f4f5955 | david-christiansen/pie-hs | Types.hs | # OPTIONS_GHC -fwarn - incomplete - patterns #
-- | Basic datatypes and operations on them that are used throughout
-- Pie.
module Pie.Types (
-- * Identifiers and atoms
Symbol(..), sym, pieKeywords,
-- * High-level expressions
Expr(..),
Expr'(..),
LocatedExpr(..),
OutExpr(..),
describeExpr,
-- ** So... | null | https://raw.githubusercontent.com/david-christiansen/pie-hs/57a72035c23b6bf0b12492decb77690fea9dfa11/src/Pie/Types.hs | haskell | | Basic datatypes and operations on them that are used throughout
Pie.
* Identifiers and atoms
* High-level expressions
** Source Locations
* Core expressions
* Values
* Top-level declarations
* Output from Pie
** Non-error output
** Error messages
* Utility data structures
| A backwards list that grows to... | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Pie.Types (
Symbol(..), sym, pieKeywords,
Expr(..),
Expr'(..),
LocatedExpr(..),
OutExpr(..),
describeExpr,
Pos(..),
Positioned(..),
Loc(..),
printLoc,
Located(..),
getLoc,
unLocate,
spanLocs,
Core(..),
Normal(..),
Value(..),
Env,... |
6968268da4fe88d11d0232feebcfdf5116fb4539c0ae3d8102af5847d911788d | sgbj/MaximaSharp | sregex.lisp | ;;;;
;;;; ~*~ sregex ~*~
;;;;
Maxima interface to pregexp.lisp ( portable regex parser , ( c ) , see copyright in pregexp.lisp )
;;;;
Version : 1.0 ( march 2008 )
Copyright : 2008
Licence :
;;;;
;; regex_match_pos("needle", "hay needle stack");
... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/stringproc/sregex.lisp | lisp |
~*~ sregex ~*~
regex_match_pos("needle", "hay needle stack");
regex_match("needle", "hay needle stack");
[needle]
regex_split("", "smithereens");
[s, m, i, t, h, e, r, e, e, n, s]
regex_spli... | Maxima interface to pregexp.lisp ( portable regex parser , ( c ) , see copyright in pregexp.lisp )
Version : 1.0 ( march 2008 )
Copyright : 2008
Licence :
[ [ 5 , 11 ] ]
for a small tutorial and more examples see
(in-package ... |
244102d079c1c311668b269758caf1b436704ed3496453ca22f1a15a6b622064 | avsm/melange | ssh_kex.ml |
* Copyright ( c ) 2004,2005 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED... | null | https://raw.githubusercontent.com/avsm/melange/e92240e6dc8a440cafa91488a1fc367e2ba57de1/lib/ssh/ssh_kex.ml | ocaml | clients version
servers version
servers last kexinit
servers host key
exchange value sent by client
response value sent by server
the shared secret
clients version string (no \r\n)
servers version string (no \r\n)
servers host key
minimal number of bits in group
preferred number ... |
* Copyright ( c ) 2004,2005 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED... |
5940fbb00b661c0ed51d0a20819d7d18c7b3b8beb34bf41e83b8edfa0481a1e4 | jwiegley/notes | logger.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE NoMonomorphismRestriction #
module Main where
import Control.Monad
import Control.Monad.Logger as Log
import Criterion
import Criterion.Main
import Data.Text as T
import Data.Text.... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/logger.hs | haskell | # LANGUAGE OverloadedStrings #
putStrLn $ stamp ++ " " ++ renderLevel lvl ++ " " | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE NoMonomorphismRestriction #
module Main where
import Control.Monad
import Control.Monad.Logger as Log
import Criterion
import Criterion.Main
import Data.Text as T
import Data.Text.Encoding as T
import Data.Time
impo... |
7b183c3a244dcf4aba15c9c154ce31f94c5ce32e04e8381cf5d5964f39527b16 | tamarin-prover/tamarin-prover | Utils.hs | -- |
Copyright : ( c ) 2012
-- License : GPL v3 (see LICENSE)
--
Maintainer : < >
--
-- Various utility functions for interacting with the user.
module Main.Utils (
-- * File handling
writeFileWithDirs
) where
import System.FilePath
import System.Directory
------------------------------... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/c78c7afd3b93b52dd4d2884952ec0fc273832a0d/src/Main/Utils.hs | haskell | |
License : GPL v3 (see LICENSE)
Various utility functions for interacting with the user.
* File handling
----------------------------------------------------------------------------
File Handling
----------------------------------------------------------------------------
| Write a file and ensure that its... | Copyright : ( c ) 2012
Maintainer : < >
module Main.Utils (
writeFileWithDirs
) where
import System.FilePath
import System.Directory
writeFileWithDirs :: FilePath -> String -> IO ()
writeFileWithDirs file output = do
createDirectoryIfMissing True (takeDirectory file)
writeFile file out... |
01626a612675979075e0cfb2d991e764490cb6cf4f6e33d344591535c63b4772 | blockfrost/blockfrost-haskell | Types.hs | -- | Client Types
# LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
module Blockfrost.Client.Types
( BlockfrostClient
, BlockfrostError (..)
, ClientConfig
, runBlockfrost
, apiClient
, api0Client
, commonClient
, cardanoClient
, ipfsClient
, nutLinkClient
, ... | null | https://raw.githubusercontent.com/blockfrost/blockfrost-haskell/418012b7dfc5c53c53b607891c0b4254cfbd522c/blockfrost-client/src/Blockfrost/Client/Types.hs | haskell | | Client Types
** Client runner
| Run @BlockfrostClientT@, using provided @Project@
| Helper
** Service clients | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
module Blockfrost.Client.Types
( BlockfrostClient
, BlockfrostError (..)
, ClientConfig
, runBlockfrost
, apiClient
, api0Client
, commonClient
, cardanoClient
, ipfsClient
, nutLinkClient
, Project (..)
, P... |
1d727b7502f77b068f058b54c74cb912165692aabd43c6125c8d738c186caab7 | xhtmlboi/yocaml | util.ml | let ( $ ) = ( @@ )
let consume_until c i s len =
let buffer = Buffer.create 1 in
let rec aux i =
if i >= len
then None
else if s.[i] = c
then (
let () = Buffer.add_char buffer s.[i] in
Some (succ i, buffer))
else (
let () = Buffer.add_char buffer s.[i] in
aux (succ i))
... | null | https://raw.githubusercontent.com/xhtmlboi/yocaml/04a5a868c1db4e325a24fbf59f850cd723829671/lib/yocaml/util.ml | ocaml | A very sad extractor. | let ( $ ) = ( @@ )
let consume_until c i s len =
let buffer = Buffer.create 1 in
let rec aux i =
if i >= len
then None
else if s.[i] = c
then (
let () = Buffer.add_char buffer s.[i] in
Some (succ i, buffer))
else (
let () = Buffer.add_char buffer s.[i] in
aux (succ i))
... |
60864e4f4d651e8a81d4cfaf1d4f7424b1a6bbf252e7361f60bab3a0e3f5b088 | fukamachi/caveman | db.lisp | (in-package :cl-user)
(defpackage <% @var name %>.db
(:use :cl)
(:import-from :<% @var name %>.config
:config)
(:import-from :datafly
:*connection*)
(:import-from :cl-dbi
:connect-cached)
(:export :connection-settings
:db
:with-connection))... | null | https://raw.githubusercontent.com/fukamachi/caveman/faa5f7e3b364fd7e7096af9a7bb06728b8d80441/v2/skeleton/src/db.lisp | lisp | (in-package :cl-user)
(defpackage <% @var name %>.db
(:use :cl)
(:import-from :<% @var name %>.config
:config)
(:import-from :datafly
:*connection*)
(:import-from :cl-dbi
:connect-cached)
(:export :connection-settings
:db
:with-connection))... | |
8345f8fa29e106d0e99506246c36953964f79c5d4f90030e547f57a1ca55f16f | NorfairKing/the-notes | Terms.hs | module Computability.Symbols.Terms where
import Notes
makeDefs [
"symbol"
, "alphabet"
, "string"
, "empty string"
, "reverse string"
, "concatenation"
]
| null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Computability/Symbols/Terms.hs | haskell | module Computability.Symbols.Terms where
import Notes
makeDefs [
"symbol"
, "alphabet"
, "string"
, "empty string"
, "reverse string"
, "concatenation"
]
| |
79107db3e0e58ce58a36e8728bb8d58b577dc45fc027f69fa580d122e4a53f67 | threatgrid/asami | reader.cljc | (ns ^{:doc "Reads structured data from a graph."
:author "Paula Gearon"}
asami.entities.reader
(:require [asami.entities.general :as general :refer [tg-ns KeyValue EntityMap GraphType]]
[zuko.node :as node]
[schema.core :as s :refer [=>]]
[clojure.string :as string]))
(... | null | https://raw.githubusercontent.com/threatgrid/asami/8524277cb1660cea41309a41688e89bbfff1e765/src/asami/entities/reader.cljc | clojure | No checking, but indicates a node in a graph
convert the data to a map
if the properties indicate a list, then process it
recursively build the list
INTERNAL PROPERTIES
find the entity by its ident. Some systems will make the id the entity id,
and the ident will be separate, so look for both. Also supporting loo... | (ns ^{:doc "Reads structured data from a graph."
:author "Paula Gearon"}
asami.entities.reader
(:require [asami.entities.general :as general :refer [tg-ns KeyValue EntityMap GraphType]]
[zuko.node :as node]
[schema.core :as s :refer [=>]]
[clojure.string :as string]))
(... |
c3ecb9e39c5b56cd40e70a17b3b172fb6cbb1060561bf7ad7876633ece2ca136 | learnhaskell-brisbane/learn | week8.hs | import qualified Data.Map as Map
-- Add value - int - 20 and 50.
data NoteType = TwentyNote | FiftyNote deriving (Ord, Eq)
-- Add value
data CoinType = FiveCoin | TenCoin | TwentyCoin | FiftyCoin deriving (Ord, Eq)
-- Add note above coin.
data CurrencyType = AUD | EUR | GBP deriving (Ord, Eq)
data Bundle = Bundle ... | null | https://raw.githubusercontent.com/learnhaskell-brisbane/learn/4b65a2aa8998a4087708aba5cb232c35c15ef6ce/chapter08/week8.hs | haskell | Add value - int - 20 and 50.
Add value
Add note above coin.
-our-own-types-and-typeclasses | import qualified Data.Map as Map
data NoteType = TwentyNote | FiftyNote deriving (Ord, Eq)
data CoinType = FiveCoin | TenCoin | TwentyCoin | FiftyCoin deriving (Ord, Eq)
data CurrencyType = AUD | EUR | GBP deriving (Ord, Eq)
data Bundle = Bundle { numberOfNotes :: Int
, noteType :: NoteType
} deriving (Show, ... |
bf66357e8c231fff7bda02f54fc2a4bce93c4ef89e4e008103453e93a0da7779 | vivid-inc/ash-ra-template | render_test.clj | ; Copyright 2020 Vivid Inc.
;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; -2.0
;
; Unless required by applicable law or agreed to in writing, software
distributed under the L... | null | https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/art/test/vivid/art/render/render_test.clj | clojure | Copyright 2020 Vivid Inc.
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 speci... | distributed under the License is distributed on an " AS IS " BASIS ,
(ns vivid.art.render.render-test
(:require
[clojure.test :refer :all]
[vivid.art :as art]))
(deftest plain-echo
(testing "Plain echo pass-through"
(are [expected template]
(= expected (art/render template))
"" ""
... |
21bb1c5837c2447278d539dae2e57838a2fdd64e503d023d03e0a126bcb6ddda | fragnix/fragnix | System.Posix.Process.Internals.hs | {-# LANGUAGE Haskell2010 #-}
# LINE 1 " System / Posix / Process / Internals.hs " #
# LANGUAGE CApiFFI #
# LANGUAGE Trustworthy #
module System.Posix.Process.Internals (
pPrPr_disableITimers, c_execvpe,
decipherWaitStatus, ProcessStatus(..) ) where
import Foreign
import Foreign.C
import System.Exit
impo... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/System.Posix.Process.Internals.hs | haskell | # LANGUAGE Haskell2010 #
| The exit status of a process
^ the process exited by calling
@exit()@ or returning from @main@
^ the process was terminated by a
dump was produced
^ the process was stopped by a signal
this function disables the itimer, which would otherwise cause confusing
signals to be sent to the ... | # LINE 1 " System / Posix / Process / Internals.hs " #
# LANGUAGE CApiFFI #
# LANGUAGE Trustworthy #
module System.Posix.Process.Internals (
pPrPr_disableITimers, c_execvpe,
decipherWaitStatus, ProcessStatus(..) ) where
import Foreign
import Foreign.C
import System.Exit
import System.IO.Error
import GHC... |
69f22bc5349b2603b4a59e0906d63a4e7b43a2c7dcde517da48897f1824aa028 | dmitryvk/sbcl-win32-threads | early-type.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no wa... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/early-type.lisp | lisp | more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
representations of types
A HAIRY-TYPE represents anything too weird to be described
reasonably or to be useful, such as NOT, SATISFIES, unkno... | This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!KERNEL")
(!begin-collecting-cold-init-forms)
(defstruct (hairy-type (:include ctype
... |
ad4cfe4a5b1eea8c950943aeeea78eec93b7d4ec127035849d877adde0a2bef6 | haskell-opengl/OpenGLRaw | PackedDepthStencil.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.PackedDepthStencil
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
--------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/NV/PackedDepthStencil.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.NV.PackedDepthStencil
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.NV.PackedDepthStencil (
glGetNVPackedDepthStencil,
gl_NV_packed_depth_stencil,
pattern GL_DEPTH_STENCIL_NV,
pattern GL_UNSIGNED_INT_24_8_NV
) where
import Graphics.GL.ExtensionPredicates
import Graphics.G... |
e026fcd913c3a4ccfd824baaa229de422aa844cb8c02c1edc1164b5dbe2e2838 | dextroamphetamine/nuko | Error.hs | module Nuko.Syntax.Error (
SyntaxError(..),
Case(..),
getErrorSite,
) where
import Relude
import Nuko.Report.Range (HasPosition (..), Pos, Range, Ranged (..),
oneColRange)
import Nuko.Report.Text (Annotation (..), Color (..), Mode (..),
... | null | https://raw.githubusercontent.com/dextroamphetamine/nuko/1b6f960eeeebbfcbfb5700279c39758f82e7df28/src/Nuko/Syntax/Error.hs | haskell | module Nuko.Syntax.Error (
SyntaxError(..),
Case(..),
getErrorSite,
) where
import Relude
import Nuko.Report.Range (HasPosition (..), Pos, Range, Ranged (..),
oneColRange)
import Nuko.Report.Text (Annotation (..), Color (..), Mode (..),
... | |
27515e47645277573d33b8ad78e060ed2e0265ccb56a49ad99977881e9174601 | thomasblanc/curry-flavor | translator.ml | (* This file provides a simple nested map over different datas *)
module String = String
module M = CurryMap.SafeFind
(CurryMap.Bind
(CurryMap.Nest ( String ) ( CurryMap.Make ( String ) ) ) (String) )
(struct type t = string let bottom = "" end)
open M
let en = "en"
let fr = "fr"
let translate_db :... | null | https://raw.githubusercontent.com/thomasblanc/curry-flavor/821c56e5485889570e0835627b43c47f5001cd43/examples/translator.ml | ocaml | This file provides a simple nested map over different datas |
module String = String
module M = CurryMap.SafeFind
(CurryMap.Bind
(CurryMap.Nest ( String ) ( CurryMap.Make ( String ) ) ) (String) )
(struct type t = string let bottom = "" end)
open M
let en = "en"
let fr = "fr"
let translate_db : t =
empty
|> add en "hello" "hello"
|> add fr "hello" "bonj... |
5c14fa5816ebea46607d5d4537dd6afcd61c9c632c38f446a8f6ba2e4f2dde30 | TrustInSoft/tis-interpreter | task.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/libraries/utils/task.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
b9eca738ea1c3ec876e01406e34341121c8bf721741a863342088d5d21de1a1d | softlab-ntua/bencherl | rhesus.erl | -module(rhesus).
-export([chaos_on/0, chaos_on/1, extract_pids/2]).
%%===============================================================================
%% CHAOS GENERATION LOGIC
%%===============================================================================
chaos_on() ->
{A1, A2, A3} = now(),
random:seed(A1,A2... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/IM/src/rhesus.erl | erlang | ===============================================================================
CHAOS GENERATION LOGIC
=============================================================================== | -module(rhesus).
-export([chaos_on/0, chaos_on/1, extract_pids/2]).
chaos_on() ->
{A1, A2, A3} = now(),
random:seed(A1,A2,A3),
Timer = (random:uniform(3595) + 5) * 1000,
io:format("A random process will be killed every ~p seconds.~n", [Timer div 1000]),
chaos_on(Timer, undefined).
chaos_on(Timer) ... |
8833ccf6c1e3bdc9482f6e92cc619889a6b17d0a3287c927db97e17acc315287 | larcenists/larceny | dderiv.scm | ;;; DDERIV -- Table-driven symbolic derivation.
;;; Returns the wrong answer for quotients.
;;; Fortunately these aren't used in the benchmark.
(import (scheme base)
(scheme read)
(scheme write)
(scheme time)
(scheme cxr)
(except (scheme hash-table)
string-hash ... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Benchmarking/R7RS/src/dderiv.scm | scheme | DDERIV -- Table-driven symbolic derivation.
Returns the wrong answer for quotients.
Fortunately these aren't used in the benchmark. |
(import (scheme base)
(scheme read)
(scheme write)
(scheme time)
(scheme cxr)
(except (scheme hash-table)
string-hash string-ci-hash)
(scheme comparator))
(define (lookup key table)
(let loop ((x table))
(if (null? x)
#f
(let ((pair ... |
8fc2221efe9145ebc4ed45b0af49b180b38a224d263b357eb89375d9b26b953f | mzp/coq-ide-for-ios | bigarray.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
and , INRI... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/ocaml-3.12.0/lib/ocaml/bigarray.mli | ocaml | *********************************************************************
Objective Caml
... | and , INRIA Rocquencourt
Copyright 2000 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : bigarray.mli 9153 2008 - 12 - 03 18:09:09Z ... |
f2a0bb0a25ff8c7d0d3f938cf23edf7b33dcfa05684168f3bc327b9e50057147 | sebsheep/elm2node | Utf8.hs | # OPTIONS_GHC -fno - warn - name - shadowing #
# LANGUAGE BangPatterns , FlexibleInstances , MagicHash , UnboxedTuples #
module Data.Utf8
( Utf8(..)
, isEmpty
, empty
, size
, contains
, startsWith
, startsWithChar
, endsWithWord8
, split
, join
--
, getUnder256
, putUnder256
--
, getVeryL... | null | https://raw.githubusercontent.com/sebsheep/elm2node/602a64f48e39edcdfa6d99793cc2827b677d650d/compiler/src/Data/Utf8.hs | haskell |
EMPTY
SIZE
CONTAINS
STARTS WITH
# INLINE startsWith #
STARTS WITH CHAR
ENDS WITH WORD
SPLIT
JOIN
COMPARE
FROM STRING
TO CHARS
TO BUILDER
PERF test if writing word-by-word is faster
BINARY
PRIMITIVES
# INLINE writeWordToPtr # | # OPTIONS_GHC -fno - warn - name - shadowing #
# LANGUAGE BangPatterns , FlexibleInstances , MagicHash , UnboxedTuples #
module Data.Utf8
( Utf8(..)
, isEmpty
, empty
, size
, contains
, startsWith
, startsWithChar
, endsWithWord8
, split
, join
, getUnder256
, putUnder256
, getVeryLong
, pu... |
0bf409a6b16afa4489d21414784634c3859b1e294ba3f81ea97205b7fcfc62e2 | MichaelDrogalis/dire | slingshot_handler_tests.clj | (ns dire.test.slingshot-handler-tests
(:require [midje.sweet :refer :all]
[dire.core :refer :all]
[slingshot.slingshot :refer :all]))
(defn test-function [arg]
(cond
(= arg "MAP") (throw+ {:type :custom-exception :message "MAP THROWN"})
(= arg "EXCEPTION") (throw+ (java.lang.IllegalAr... | null | https://raw.githubusercontent.com/MichaelDrogalis/dire/84b31cc30b1d30b74918c73928d4e148e80e494c/test/dire/test/slingshot_handler_tests.clj | clojure | Using slingshot selectors within with-handler
Test slingshot match against key-values vector
Test slingshot match against class name
Test slingshot match against predicate function
Test case where predicate function throws its own exception
Test supported selector types
Test case selector throws its own exceptio... | (ns dire.test.slingshot-handler-tests
(:require [midje.sweet :refer :all]
[dire.core :refer :all]
[slingshot.slingshot :refer :all]))
(defn test-function [arg]
(cond
(= arg "MAP") (throw+ {:type :custom-exception :message "MAP THROWN"})
(= arg "EXCEPTION") (throw+ (java.lang.IllegalAr... |
baf399a7efb85d21f851770b79f177f55c0ba0edb5e96352c1ff25a8e0009a62 | icicle-lang/zebra-ambiata | Storable.hs | # LANGUAGE NoImplicitPrelude #
module Zebra.X.Vector.Storable (
unsafeFromByteString
, unsafeToByteString
, module Storable
) where
import Data.ByteString.Internal (ByteString(..))
import Data.Word (Word8)
import X.Data.Vector.Storable as Storable
unsafeFromByteString :: Byte... | null | https://raw.githubusercontent.com/icicle-lang/zebra-ambiata/394ee5f98b4805df2c76abb52cdaad9fd7825f81/zebra-core/src/Zebra/X/Vector/Storable.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Zebra.X.Vector.Storable (
unsafeFromByteString
, unsafeToByteString
, module Storable
) where
import Data.ByteString.Internal (ByteString(..))
import Data.Word (Word8)
import X.Data.Vector.Storable as Storable
unsafeFromByteString :: Byte... | |
23cd8d764486fc372cbae8170635a145f49d7d1adf0359db6c4739e27fe3383e | cartazio/tlaps | builtin.mli |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
type builtin =
Logic
| TRUE
| FALSE
| Implies
| Equiv
| Conj
| Disj
| Neg
| Eq
| Neq
(* Sets *)
| STRING
| BOOLEAN
| SUBSET
| UNION
| DOMAIN
| Subseteq
| Mem
... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/builtin.mli | ocaml | Sets
modal
arithmetic
sequences
tlc
special |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
type builtin =
Logic
| TRUE
| FALSE
| Implies
| Equiv
| Conj
| Disj
| Neg
| Eq
| Neq
| STRING
| BOOLEAN
| SUBSET
| UNION
| DOMAIN
| Subseteq
| Mem
| Notmem
| S... |
afd56d6d6cd0421ba01332c16089329e2e05be3c7c700767e2daaace7e71d8f8 | ocaml-ppx/ocamlformat | exceptions.ml | exception EvalError of Error.t [@@deriving sexp]
exception Duplicate_found of (unit -> Base.Sexp.t) * string
exception Duplicate_found of ((unit -> Base.Sexp.t) -> string)
type t = Duplicate_found of (unit -> Base.Sexp.t) * string
type t = Duplicate_found : (unit -> Base.Sexp.t) * string -> t
type t = Duplicate_fo... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/aa673e27f6d7cbc882ab6109cfbcca2ba0864507/test/passing/tests/exceptions.ml | ocaml | exception EvalError of Error.t [@@deriving sexp]
exception Duplicate_found of (unit -> Base.Sexp.t) * string
exception Duplicate_found of ((unit -> Base.Sexp.t) -> string)
type t = Duplicate_found of (unit -> Base.Sexp.t) * string
type t = Duplicate_found : (unit -> Base.Sexp.t) * string -> t
type t = Duplicate_fo... | |
dad3303488bb38c6986a5a42ba480c567529454d89fda09118c62f9707da200c | ocaml-multicore/effects-examples | MVar_test.ml | module MVar = MVar.Make (Sched)
open MVar
open Printf
open Sched
let mv = create_empty ()
let fork f = Effect.perform @@ Fork f
let put x =
(printf "Before put: %s\n" x;
put x mv;
printf "After put: %s\n" x)
let get () =
let () = printf "Before get\n" in
let v = take mv in
let () = printf "After get: %... | null | https://raw.githubusercontent.com/ocaml-multicore/effects-examples/4f07e1774b726eec0f6769da0a16b402582d37b5/mvar/MVar_test.ml | ocaml | module MVar = MVar.Make (Sched)
open MVar
open Printf
open Sched
let mv = create_empty ()
let fork f = Effect.perform @@ Fork f
let put x =
(printf "Before put: %s\n" x;
put x mv;
printf "After put: %s\n" x)
let get () =
let () = printf "Before get\n" in
let v = take mv in
let () = printf "After get: %... | |
6b7fe209adf838c7b2432ef08f2f1d7bf3997c7ba0fa6798cd5adb8220558a50 | soegaard/metapict | metapost-manual.rkt | #lang racket
(require "../metapict.rkt")
Examples from the MetaPost Manual mpman.pdf
fig 41 p. 46
(let ()
(def p1 (curve (pt 0 0) (curl 0) .. (pt 5 -3) .. (curl 0) (pt 10 0)))
1 wave
(def p0 p2)
(for ([i (in-range 1 4)])
(set! p0 (curve-append p0 ((shifted (* i 20) 0) p2))))
(def waves... | null | https://raw.githubusercontent.com/soegaard/metapict/47ae265f73cbb92ff3e7bdd61e49f4af17597fdf/metapict/examples/metapost-manual.rkt | racket | (def fig-mpman-21 | #lang racket
(require "../metapict.rkt")
Examples from the MetaPost Manual mpman.pdf
fig 41 p. 46
(let ()
(def p1 (curve (pt 0 0) (curl 0) .. (pt 5 -3) .. (curl 0) (pt 10 0)))
1 wave
(def p0 p2)
(for ([i (in-range 1 4)])
(set! p0 (curve-append p0 ((shifted (* i 20) 0) p2))))
(def waves... |
889747ce2eaa95a25fed184242089132c57f456a411ac0c54f23ae99b436c4d1 | aantron/markup.ml | test_input.ml | This file is part of Markup.ml , released under the MIT license . See
LICENSE.md for details , or visit .
LICENSE.md for details, or visit . *)
open OUnit2
open Test_support
open Markup__Common
open Markup__Kstream
open Markup__Stream_io
open Markup__Encoding
open Markup__Input
let ok = wrong_k "failed"
... | null | https://raw.githubusercontent.com/aantron/markup.ml/420aaa3d38d90ed84d1d7157840f7df5f3b5b349/test/test_input.ml | ocaml | This file is part of Markup.ml , released under the MIT license . See
LICENSE.md for details , or visit .
LICENSE.md for details, or visit . *)
open OUnit2
open Test_support
open Markup__Common
open Markup__Kstream
open Markup__Stream_io
open Markup__Encoding
open Markup__Input
let ok = wrong_k "failed"
... | |
7b609f8366dbd3016007d3f216c8d076885e95e1464cfe31064c9138b948a055 | inguardians/kismapping | WebApp.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE BangPatterns #-}
module Kismapping.Output.WebApp
( outputWebApp
) where
import Codec.Picture
import Data.Aeson (ToJSON, (.=), object, pairs, toEncoding, toJSON)
import qualified Data.Byte... | null | https://raw.githubusercontent.com/inguardians/kismapping/98b8511cb60595db45f89746d4586bd9d3a60e6a/library/Kismapping/Output/WebApp.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE BangPatterns # | # LANGUAGE TemplateHaskell #
module Kismapping.Output.WebApp
( outputWebApp
) where
import Codec.Picture
import Data.Aeson (ToJSON, (.=), object, pairs, toEncoding, toJSON)
import qualified Data.ByteString.Lazy as Lazy
import qualified Data.ByteString as Strict
import qualified Data.ByteString.Search as ByteString... |
e76042d6f300ee6924c8e9f9082cadaf0e07ee3f40ef1347ccaaa1bf50908277 | earl-ducaine/cl-garnet | lapidary-objects.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : LAPIDARY ; Base : 10 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
The Garnet User Interface Development Environment . ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This code was writ... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/lapidary/lapidary-objects.lisp | lisp | Syntax : Common - Lisp ; Package : LAPIDARY ; Base : 10 -*-
; ;
This code was written as part of the Garnet project at ;;;
; ;
; ;
please contact to be put on the mailing list. ;;;
Package : LAPIDARY -*-
This file contains definitions of objects needed by lapidary
interactor for moving objects bet... |
(in-package "LAPIDARY")
(create-instance 'multi-win-interactor inter:move-grow-interactor
(:running-where T)
(:old-feedback NIL)
(:start-where nil)
(:waiting-priority inter:high-priority-level)
(:attach-point :where-hit)
(:running-action
#'(lambda (inter obj new-box)
(let ((old-f (g-value inter... |
74028efd7fe8e9a96435f4732a3da46e726301226889232bd5e84c70364687c7 | vouch-opensource/vouch-load-tests | sample_backend.clj | (ns com.example.sample-backend
(:require
[cheshire.core :as json]
[clojure.string :as string]
[reitit.ring :as ring]
[ring.middleware.params])
(:import
(java.util UUID)))
(def friend-requests (ref {}))
(def tokens (ref {}))
(def users (ref {}))
(defn- register-user
[request]
(let [{:keys [... | null | https://raw.githubusercontent.com/vouch-opensource/vouch-load-tests/ca0f81097e0b1952f34e1bc7902de4123306c175/dev/com/example/sample_backend.clj | clojure | (ns com.example.sample-backend
(:require
[cheshire.core :as json]
[clojure.string :as string]
[reitit.ring :as ring]
[ring.middleware.params])
(:import
(java.util UUID)))
(def friend-requests (ref {}))
(def tokens (ref {}))
(def users (ref {}))
(defn- register-user
[request]
(let [{:keys [... | |
c5f885991d5c35a6068bf07ec3387d35bfd79918c63774cd7e4706a4356a835e | ucsd-progsys/nate | type_decl4.ml | (*S*)
type 'a t = { x : 'a; y : 'a t list }
and x = int t
| null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/easyocaml-additional/exams/type_decl4.ml | ocaml | S |
type 'a t = { x : 'a; y : 'a t list }
and x = int t
|
c9683bce0131f81688184bf268a8b92a1f40e13279ba119b77acbd930bb6a96a | cac-t-u-s/om-sharp | menu.lisp | ;=========================================================================
OM API
Multiplatform API for OpenMusic
LispWorks Implementation
;=========================================================================
;
; This program is free software: you can redistribute it and/or modify
it under ... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/f87f7b43cb15cbe8eab9e41f5640331da6495fd6/src/api/om-api-LW/menu.lisp | lisp | =========================================================================
=========================================================================
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 i... | OM API
Multiplatform API for OpenMusic
LispWorks Implementation
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
Authors : ,
... |
411edef164edff9015c12bc605d3638a2333db1274bfe2bae8a9915fca77263d | cheopslab/cheops-logger | Json.hs | -- |
-- Top-level module for structured logging support. Structured logging provides messages in
-- a machine-readable format and passing an additional user data to the messages (context)
-- to the log messages, and tooling that allows keep track of the current context and attach
-- it to all the messages.
--
-- Short... | null | https://raw.githubusercontent.com/cheopslab/cheops-logger/105114ceea5f2a5be787d7a153809f3e40013b37/co-log-json/src/Colog/Json.hs | haskell | |
Top-level module for structured logging support. Structured logging provides messages in
a machine-readable format and passing an additional user data to the messages (context)
to the log messages, and tooling that allows keep track of the current context and attach
it to all the messages.
Short example:
@
... | logic : : LoggerEnv - > Int - > IO ( )
* @(1)@ pass initial context ( @ctx'@ : : ' LoggerEnv ' )
by using any effect handling approach , like ReaderT , MTL , various effects
module Colog.Json
LoggerEnv
, mkLogger
, emptyLogger
, unLogger
, ls
, showLS
, LogStr
, logDebug
, logNotice
, logI... |
eaca126457f79a44567095288b2bda62f3247ebc3673e45b21b2e6c22989eedb | openvstorage/alba | cli_proxy.ml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open Lwt.Infix
open Cmdliner
open Cli_common
open! Prelude
module Config = struct
type ... | null | https://raw.githubusercontent.com/openvstorage/alba/459bd459335138d6b282d332fcff53a1b4300c29/ocaml/src/cli_proxy.ml | ocaml | obsolete
obsolete |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open Lwt.Infix
open Cmdliner
open Cli_common
open! Prelude
module Config = struct
type ... |
7d8fa9475792c670effa6033897fc6b448dbdb955bb04e60700a1f4433e431e9 | fulcrologic/fulcro | multi_root_sample.cljs | (ns other-demos.multi-root-sample
(:require
[com.fulcrologic.fulcro.rendering.multiple-roots-renderer :as mroot]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.dom :as dom... | null | https://raw.githubusercontent.com/fulcrologic/fulcro/71ed79c650222567ac4a566513365a95f12657e3/src/todomvc/other_demos/multi_root_sample.cljs | clojure | Generate an ID to use with floating root
EACH child renders a floating root component | (ns other-demos.multi-root-sample
(:require
[com.fulcrologic.fulcro.rendering.multiple-roots-renderer :as mroot]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.fulcro.dom :as dom... |
9571129d9dbc7baf60f0f763871985ceaccc9d9a5b73571089cf9db7dc233afd | JHU-PL-Lab/jaylang | toploop_analysis.ml | open Batteries
open Jhupllib
open Jayil
open Ddpa
open Ast
open Toploop_analysis_types
open Toploop_ddpa_wrapper_types
open Toploop_utils
open Ddpa_abstract_ast
open Ddpa_graph
open Ddpa_utils
module Make (DDPA_wrapper : DDPA_wrapper) = struct
module DDPA_wrapper = DDPA_wrapper
let find_errors analysis =
let ... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/src/ddpa-toploop/toploop/toploop_analysis.ml | ocaml | There's nothing this body that can be inconsistent. | open Batteries
open Jhupllib
open Jayil
open Ddpa
open Ast
open Toploop_analysis_types
open Toploop_ddpa_wrapper_types
open Toploop_utils
open Ddpa_abstract_ast
open Ddpa_graph
open Ddpa_utils
module Make (DDPA_wrapper : DDPA_wrapper) = struct
module DDPA_wrapper = DDPA_wrapper
let find_errors analysis =
let ... |
823c3347021bf23b5ea830745b695c30e839f254259739948870ac7f0f7d9835 | open-company/open-company-web | about.clj | (ns oc.pages.about
(:require [oc.shared :as shared]))
(defn about
"About page. This is a copy of oc.web.components.about and
every change here should be reflected there and vice versa."
[options]
[:div.about-wrap.group
{:id "wrap"}
[:div.main.about
[:section.about-header
[:h3.about-copy-head... | null | https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/site/oc/pages/about.clj | clojure | <!-- main --> | (ns oc.pages.about
(:require [oc.shared :as shared]))
(defn about
"About page. This is a copy of oc.web.components.about and
every change here should be reflected there and vice versa."
[options]
[:div.about-wrap.group
{:id "wrap"}
[:div.main.about
[:section.about-header
[:h3.about-copy-head... |
2c9282cee737ca44de9df2f75a42002cd0bb68b07c209e65d661be32a354af83 | s-expressionists/Cleavir | optimize.lisp | (cl:in-package #:cleavir-compilation-policy)
;;; Given a normalized OPTIMIZE declaration specifier, get the
value of a quality , with return value like GETHASH .
(defun optimize-value (optimize quality)
(let ((a (assoc quality optimize)))
(if a
(values (second a) t)
(values nil nil))))
;;; Given an OPTIMIZ... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/e0293780d356a9d563af9abf9317019f608b4e1d/Compilation-policy/optimize.lisp | lisp | Given a normalized OPTIMIZE declaration specifier, get the
Given an OPTIMIZE declaration specifier in code, return a
normalized specification, so that (optimize space) becomes
known and have allowed values.
policies can also be provided directly
use a DOLIST instead of LOOP because it gets tricky with
all the ne... | (cl:in-package #:cleavir-compilation-policy)
value of a quality , with return value like GETHASH .
(defun optimize-value (optimize quality)
(let ((a (assoc quality optimize)))
(if a
(values (second a) t)
(values nil nil))))
( optimize ( space 3 ) ) . Additionally check that all qualities are
(defgeneric ... |
ddfab1607fc50b71a2ce1f8c4a40705676e3810942e61dae786439669d18c875 | brendanhay/gogol | Delete.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-logging/gen/Gogol/Logging/Projects/Logs/Delete.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
/See:/ </ Cloud Logging API Reference> for @logging.projects.logs.delete@.
* Resource
** Constructing a Request
| A resource alias for @logging.projects.logs.delete@ method which the
'LoggingProjectsLogsDelete' request confor... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
f8b08c04c7a1e56babca2951fdb392636fae349d0c378ee9e9a6b01a69fb3e31 | clojurecup2014/parade-route | pprint.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/clojurecup2014/parade-route/adb2e1ea202228e3da07902849dee08f0bb8d81c/Assets/Clojure/Internal/Plugins/clojure/test_clojure/pprint.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
(ns clojure.test-clojure.pprint
(:refer-clojure :exclude [format])
(:require [clojure.string :as str])
(:use [clojure.test :only (deftest is are run-tests)]
[clojure.test-helper :only [platform-newlines]]
clojure.test-clojure.pprint.test... |
6bd9e46e33d823a23457c072471616047b485e3fb71b7ca411af439c199c454d | charlesrosenbauer/Bzo-Compiler | HigherOrder.hs |
This is the bootstrapping compiler for the Bzo programming language .
Copyright ( C ) 2020
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 yo... | null | https://raw.githubusercontent.com/charlesrosenbauer/Bzo-Compiler/08aed007aaabaa676996b7c7be05baed42a12e64/src/HigherOrder.hs | haskell | An If/Else can sometimes be inconvenient |
This is the bootstrapping compiler for the Bzo programming language .
Copyright ( C ) 2020
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 yo... |
a84118c65860fea092f213c3f34e9610882cac11593e2ccb82e06cee602509d5 | silicon-gorge/radix | logging_test.clj | (ns radix.logging-test
(:require [midje.sweet :refer :all]
[radix.logging :refer :all]))
(fact-group
(fact "Middleware sets request attributes into MDC"
(let [request {:uri "/example"}
mdc (atom nil)
handler (fn [req] (reset! mdc (org.slf4j.MDC/getCopyOfContextMap)))... | null | https://raw.githubusercontent.com/silicon-gorge/radix/f32cd4204a9a69b47b7b0d5f1d13d2252c8b822b/test/radix/logging_test.clj | clojure | (ns radix.logging-test
(:require [midje.sweet :refer :all]
[radix.logging :refer :all]))
(fact-group
(fact "Middleware sets request attributes into MDC"
(let [request {:uri "/example"}
mdc (atom nil)
handler (fn [req] (reset! mdc (org.slf4j.MDC/getCopyOfContextMap)))... | |
e7343e5ef34db203c9a947d7cce0b5fb39261ef22fab6b909457664252f3ed50 | yetibot/core | config.clj | (ns yetibot.core.util.config
(:require
[clojure.java.io :refer [as-file make-parents]]
[taoensso.timbre :refer [color-str trace debug info warn error]]
[clojure.edn :as edn]
[clojure.spec.alpha :as s]
[expound.alpha :as expound]))
;; for human consumption
(defonce spec-by-path (atom {}))
(def de... | null | https://raw.githubusercontent.com/yetibot/core/e35cc772622e91aec3ad7f411a99fff09acbd3f9/src/yetibot/core/util/config.clj | clojure | for human consumption
store up all specs to build a complete spec-by-path representation as
a convenient reference
valid and found
invalid against spec
not found | (ns yetibot.core.util.config
(:require
[clojure.java.io :refer [as-file make-parents]]
[taoensso.timbre :refer [color-str trace debug info warn error]]
[clojure.edn :as edn]
[clojure.spec.alpha :as s]
[expound.alpha :as expound]))
(defonce spec-by-path (atom {}))
(def default-config {:yetibot {}... |
baef332a2f29b1acd73c869d4d153e97a021ce9f2bf19ba2865bf43033f229ca | BinaryAnalysisPlatform/bap | bap_disasm_brancher.ml | open Bap_core_theory
open Core_kernel[@@warning "-D"]
open Bap_types.Std
open Bap_image_std
open Monads.Std
open KB.Syntax
module Source = Bap_disasm_source
module Context = Source.Context
module Targets = Bap_disasm_target_factory
module Dis = Bap_disasm_basic
module Insn = Bap_disasm_insn
type edge = Bap_disasm_bl... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/bap_disasm/bap_disasm_brancher.ml | ocaml | open Bap_core_theory
open Core_kernel[@@warning "-D"]
open Bap_types.Std
open Bap_image_std
open Monads.Std
open KB.Syntax
module Source = Bap_disasm_source
module Context = Source.Context
module Targets = Bap_disasm_target_factory
module Dis = Bap_disasm_basic
module Insn = Bap_disasm_insn
type edge = Bap_disasm_bl... | |
586707bc6752ae105b5089a68664b1c9da9cbd6b025f9111d1472cbf6b555327 | deobald/jok | user.clj | (ns jukebox-web.models.user
(:require [corroborate.core :as co]
[jukebox-web.models.db :as db]
[jukebox-web.models.library :as library]
[jukebox-web.util.crypt :as crypt]
[jukebox-web.util.reserved-names :as reserved-names]
[jukebox-web.util.url :as url])
... | null | https://raw.githubusercontent.com/deobald/jok/e1b9373603ad7fcc3dbc7304cb8b88b8163e73bc/src/jukebox_web/models/user.clj | clojure | (ns jukebox-web.models.user
(:require [corroborate.core :as co]
[jukebox-web.models.db :as db]
[jukebox-web.models.library :as library]
[jukebox-web.util.crypt :as crypt]
[jukebox-web.util.reserved-names :as reserved-names]
[jukebox-web.util.url :as url])
... | |
517993ff896e34ba72dabbf1b95f54e5773ed3655770d891c89f3bfaa572b8cc | agda/agda | Three.hs | | Tools for 3 - way partitioning .
module Agda.Utils.Three where
| Enum type with 3 elements .
--
data Three
= One
| Two
| Three
deriving (Eq, Ord, Show, Bounded, Enum)
| Partition a list into 3 groups .
--
-- Preserves the relative order or elements.
--
partition3 :: (a -> Three) -> [a] -> ([a], [a]... | null | https://raw.githubusercontent.com/agda/agda/f8809e640ea7cd9332e70d7bff5e0a8457447511/src/full/Agda/Utils/Three.hs | haskell |
Preserves the relative order or elements.
Preserves the relative order or elements.
| | Tools for 3 - way partitioning .
module Agda.Utils.Three where
| Enum type with 3 elements .
data Three
= One
| Two
| Three
deriving (Eq, Ord, Show, Bounded, Enum)
| Partition a list into 3 groups .
partition3 :: (a -> Three) -> [a] -> ([a], [a], [a])
partition3 f = loop where
loop [] = ([], [... |
d4b94caa8951a3321327faa89339e137f8c6556bca59bc97396909428a9c5b0e | haskell/vector | FindIndexR.hs | module Algo.FindIndexR (findIndexR, findIndexR_naive, findIndexR_manual)
where
import Data.Vector.Unboxed (Vector)
import qualified Data.Vector.Generic as V
findIndexR :: (Double -> Bool, Vector Double) -> Maybe Int
{-# NOINLINE findIndexR #-}
findIndexR = uncurry V.findIndexR
findIndexR_naive :: (Double -> Bool, Ve... | null | https://raw.githubusercontent.com/haskell/vector/4c87e88f07aad166c6ae2ccb94fa539fbdd99a91/vector/benchmarks/Algo/FindIndexR.hs | haskell | # NOINLINE findIndexR # | module Algo.FindIndexR (findIndexR, findIndexR_naive, findIndexR_manual)
where
import Data.Vector.Unboxed (Vector)
import qualified Data.Vector.Generic as V
findIndexR :: (Double -> Bool, Vector Double) -> Maybe Int
findIndexR = uncurry V.findIndexR
findIndexR_naive :: (Double -> Bool, Vector Double) -> Maybe Int
# ... |
6db4103690bf305f077a7158d6722ccc4fbef3d23aa322257f96042fbccaed13 | giorgidze/YampaSynth | Main.hs | {-# LANGUAGE Arrows #-}
module Main where
import qualified SynthBasics as Synth
import qualified Data.Audio as Audio
import Player.Wav (play)
import FRP.Yampa
sciFi :: SF () Audio.Sample
sciFi = proc () -> do
und <- arr (*0.2) <<< Synth.oscSine 3.0 -< 0
swp <- arr (+1.0) <<< integral -< -0.25
audio <-... | null | https://raw.githubusercontent.com/giorgidze/YampaSynth/a262eeb735c80845868f905cbebde01ac47b9cfd/demo/Main.hs | haskell | # LANGUAGE Arrows # |
module Main where
import qualified SynthBasics as Synth
import qualified Data.Audio as Audio
import Player.Wav (play)
import FRP.Yampa
sciFi :: SF () Audio.Sample
sciFi = proc () -> do
und <- arr (*0.2) <<< Synth.oscSine 3.0 -< 0
swp <- arr (+1.0) <<< integral -< -0.25
audio <- Synth.oscSine 440 ... |
600e59b464075a137767ebffc0cbc18ed374e771f204af128d37817369b81924 | snowdriftcoop/snowdrift | TestImport.hs | module TestImport
( module TestImport
, module X
) where
import ClassyPrelude as X hiding (delete, deleteBy, Handler)
import Database.Persist as X hiding (get)
import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool)
import Database.Persist.Postgresql (pgConnStr, ConnectionString)
import Foundation as... | null | https://raw.githubusercontent.com/snowdriftcoop/snowdrift/91fd1b84fea5d9c4aa2c419d91d790d886b3d100/website/test/TestImport.hs | haskell | For htmlHasLink
| Run a query outside of a handler
Note: I can't drop all the tables because the migration happens in
'makeFoundation', but that's also the function that builds a usable
database pool out of the app settings. So, 'makeFoundation' would need
to be broken up to allow clearing before migration.
Se... | module TestImport
( module TestImport
, module X
) where
import ClassyPrelude as X hiding (delete, deleteBy, Handler)
import Database.Persist as X hiding (get)
import Database.Persist.Sql (SqlPersistM, runSqlPersistMPool)
import Database.Persist.Postgresql (pgConnStr, ConnectionString)
import Foundation as... |
4d882a464562bae352e9ee144627cb68b933d25b91a50ee2d8cc3ce640a0b54a | rowangithub/DOrder | 029_copyintro.ml | let rec copy x = if x=0 then x else 1 + copy (x-1)
let main n = assert (copy (copy n) = n) | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/029_copyintro.ml | ocaml | let rec copy x = if x=0 then x else 1 + copy (x-1)
let main n = assert (copy (copy n) = n) | |
f45c155b45598cd20b0c94c4a8bf82d9c66ff03ad18175b8f9932321ee714edb | gethop-dev/hop-cli | s3.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
;; file, You can obtain one at /
(ns hop-cli.bootstrap.profile.registry.object-storage.s3
(:require [hop-cli.bootstrap.profile.registry :as registry]
[hop-cli.boot... | null | https://raw.githubusercontent.com/gethop-dev/hop-cli/137d1076d4121ffcfcc271b865656936bab8c864/src/hop_cli/bootstrap/profile/registry/object_storage/s3.clj | clojure | file, You can obtain one at / | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
(ns hop-cli.bootstrap.profile.registry.object-storage.s3
(:require [hop-cli.bootstrap.profile.registry :as registry]
[hop-cli.bootstrap.util :as bp.util]))
(defn-... |
d1ae606fbeab0878218501ca5468ae4e7efd38086664d2c918a11ac1367cb2e2 | input-output-hk/cardano-benchmarking | Script.hs | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
module Cardano.Benchmarking.Script
( Script
, runScript
, parseScriptFile
)
where
import Prelude
import Control.Concurrent (threadDelay)
import Control.Monad
import Control.Monad.IO.Class
import Ouroboro... | null | https://raw.githubusercontent.com/input-output-hk/cardano-benchmarking/af05b42df27e2cc7305475cf5c4efa81e7f97540/cardano-tx-generator/src/Cardano/Benchmarking/Script.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
module Cardano.Benchmarking.Script
( Script
, runScript
, parseScriptFile
)
where
import Prelude
import Control.Concurrent (threadDelay)
import Control.Monad
import Control.Monad.IO.Class
import Ouroboro... | |
e80a9ffb67b6fb8662835916d5ca4de7e3c03a681a88931c53c09862f3e70581 | eslick/cl-stdutils | map.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 ; Package : utils -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: map.lisp
;;;; Purpose: Extensions and variations of the map operator
Programmer :
Date Sta... | null | https://raw.githubusercontent.com/eslick/cl-stdutils/4a4e5a4036b815318282da5dee2a22825369137b/src/map.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 ; Package : utils -*-
*************************************************************************
FILE IDENTIFICATION
Name: map.lisp
Purpose: Extensions and variations of the map operator
Accumulation
| Programmer :
Date Started : August 2004
(in-package :stdutils)
(eval-when (eval compile load)
(proclaim '(inline last1 single append1 conc1))
(proclaim '(optimize speed (safety 1) (debug 1))))
(defmacro-exported map-> (fn start test-fn succ-fn)
"A general map function to assemble a map operation o... |
663bd3355318ba10f7efbea3a23bd5154f50c8eb0f03b9b0058a2a52ca10dd5c | arttuka/reagent-material-ui | desktop_date_picker.cljs | (ns reagent-mui.x.desktop-date-picker
"Imports @mui/x-date-pickers/DesktopDatePicker as a Reagent component.
Original documentation is at -pickers/desktop-date-picker/ ."
(:require [reagent.core :as r]
["@mui/x-date-pickers/DesktopDatePicker" :as MuiDesktopDatePicker]))
(def desktop-date-picker (r/a... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/x/reagent_mui/x/desktop_date_picker.cljs | clojure | (ns reagent-mui.x.desktop-date-picker
"Imports @mui/x-date-pickers/DesktopDatePicker as a Reagent component.
Original documentation is at -pickers/desktop-date-picker/ ."
(:require [reagent.core :as r]
["@mui/x-date-pickers/DesktopDatePicker" :as MuiDesktopDatePicker]))
(def desktop-date-picker (r/a... | |
43bdc837df8a5eb3adcf76c3741208669ef4a4cc4a63f2bf99557c1f96a4b720 | GaloisInc/pads-haskell | MetaData.hs | # LANGUAGE NamedFieldPuns , RecordWildCards , FlexibleInstances , DeriveDataTypeable #
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* ... | null | https://raw.githubusercontent.com/GaloisInc/pads-haskell/ffa01030cd1c1edf5f50df53f3783ff28bf43c7e/Language/Pads/MetaData.hs | haskell |
Type class for Pads meta-data and generic operations on meta-data.
Base type library support
Need to add location information, etc. | # LANGUAGE NamedFieldPuns , RecordWildCards , FlexibleInstances , DeriveDataTypeable #
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.