_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 |
|---|---|---|---|---|---|---|---|---|
e303a706fee25b2f2cd44ea81b4395aa8c160afa1ae63513d2fa04579d2d1393 | Eonblast/Scalaxis | comm_server.erl | 2008 - 2011 Zuse Institute Berlin
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
di... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/src/comm_layer/comm_server.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2008 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@doc : CommLayer : Management of comm_connection processes .
@author < >
@author < >
-module(comm_server).
-author('').
-a... |
ea40aab31e1e921488af6bf5ce29c77dd77f2b5b8f8930a1df850a99f5841868 | ahrefs/atd | encode.ml | type 'a t = 'a -> Json.t
let make f = f
let encode f x = f x
let bool b = `Bool b
let char c = `String (String.make 1 c)
let string s = `String s
let unit () = `Null
let float f = `Float f
let int i = `Int i
let list f xs = `List (List.map f xs)
let array f xs = `List (Array.to_list (Array.map f xs))
let int32 s =... | null | https://raw.githubusercontent.com/ahrefs/atd/9a3cb984a695563c04b41cdd7a1ce9454eb40e1c/atdgen-codec-runtime/src/encode.ml | ocaml | type 'a t = 'a -> Json.t
let make f = f
let encode f x = f x
let bool b = `Bool b
let char c = `String (String.make 1 c)
let string s = `String s
let unit () = `Null
let float f = `Float f
let int i = `Int i
let list f xs = `List (List.map f xs)
let array f xs = `List (Array.to_list (Array.map f xs))
let int32 s =... | |
28896e89cbd260f960f178c479333c05729ac4d1559ac968bb226356b9362511 | GlideAngle/flare-timing | Arrival.hs | module Flight.Gap.Place.Arrival (ArrivalPlacing(..)) where
import GHC.Generics (Generic)
import Control.Applicative (empty)
import qualified Data.Text as T
import Data.Aeson (Value(..), ToJSON(..), FromJSON(..))
| A 1 - based rank of the pilot arrival at goal , 1st in is 1 , 2nd is 2 etc .
data ArrivalPlacing
=... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/gap-allot/library/Flight/Gap/Place/Arrival.hs | haskell | ^ The nth place
^ This placing shared with n other pilots | module Flight.Gap.Place.Arrival (ArrivalPlacing(..)) where
import GHC.Generics (Generic)
import Control.Applicative (empty)
import qualified Data.Text as T
import Data.Aeson (Value(..), ToJSON(..), FromJSON(..))
| A 1 - based rank of the pilot arrival at goal , 1st in is 1 , 2nd is 2 etc .
data ArrivalPlacing
d... |
183c2eeec4ee953cf3e860ab668fb1cb32a4dea28d777df2a16d1c733103d425 | aryx/xix | resolve_labels5.ml | Copyright 2015 , 2016 , see copyright.txt
open Common
open Ast_asm5
see how little processing 5a actually does
let resolve ps =
let pc = ref 0 in
let h = Hashtbl.create 101 in
first pass , process the label definitions , populate h
ps |> List.iter (fun (p, line) ->
(match p with
| LabelDef lbl ... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/assembler/resolve_labels5.ml | ocaml | better to check duplicate here than via lexing tricks
no incr pc; share pc if multiple labels at same place
filter but modify also by side effect p
no need to keep the labels in the object file
no pc increment here
less: could keep label info also for debugging purpose? | Copyright 2015 , 2016 , see copyright.txt
open Common
open Ast_asm5
see how little processing 5a actually does
let resolve ps =
let pc = ref 0 in
let h = Hashtbl.create 101 in
first pass , process the label definitions , populate h
ps |> List.iter (fun (p, line) ->
(match p with
| LabelDef lbl ... |
0caa2ff8b4684a6070627ea13a38df7417d3f084ac7d139f6241631e1d1ac42f | camlp4/camlp4 | Camlp4AutoPrinter.ml | (****************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/camlp4/camlp4/9b3314ea63288decb857239bd94f0c3342136844/camlp4/Camlp4Printers/Camlp4AutoPrinter.ml | ocaml | **************************************************************************
OCaml
... | Copyright 2006 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 the special
Authors :
* - : initial version
* - Nicolas Pouillard: initial version
... |
3fe401413ed2e7f689692d56ba71f3e1ff3ec0f89af5dc88490a84c22b55ca8a | monadfix/ormolu-live | TysWiredIn.hs |
( c ) The GRASP Project , Glasgow University , 1994 - 1998
\section[TysWiredIn]{Wired - in knowledge about { \em non - primitive } types }
(c) The GRASP Project, Glasgow University, 1994-1998
\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
-}
# LANGUAGE CPP #
{-# LANGUAGE OverloadedStr... | null | https://raw.githubusercontent.com/monadfix/ormolu-live/d8ae72ef168b98a8d179d642f70352c88b3ac226/ghc-lib-parser-8.10.1.20200412/compiler/prelude/TysWiredIn.hs | haskell | # LANGUAGE OverloadedStrings #
* Helper functions defined here
This is used in TcTypeNats to define the
built-in functions for evaluation.
* All wired in things
* Bool
* Ordering
* Boxing primitive types
* Double
* Float
* Int
* Word
* Word8
* List
* Maybe
** Constraint tuples
* Any
* Recovery TyCon
*... |
( c ) The GRASP Project , Glasgow University , 1994 - 1998
\section[TysWiredIn]{Wired - in knowledge about { \em non - primitive } types }
(c) The GRASP Project, Glasgow University, 1994-1998
\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
-}
# LANGUAGE CPP #
| This module is about ... |
2666bea58502c3c6454c5d4b6b05dd48b661d6bafe39b78b2fa5308df3021860 | links-lang/links | sugarConstructors.ml | open CommonTypes
open Operators
open SourceCode
open SourceCode.WithPos
open Sugartypes
open Utility
(* Import module signatures. *)
module type Pos = SugarConstructorsIntf.Pos
module type SugarConstructorsSig = SugarConstructorsIntf.SugarConstructorsSig
(* Actual implementation of smart constructors... | null | https://raw.githubusercontent.com/links-lang/links/5434779a4d296a58d7ca824c9cfda03804a77d4e/core/sugarConstructors.ml | ocaml | Import module signatures.
Actual implementation of smart constructors as a functor on a Pos module.
* Convenient aliases for functions operating on positions.
* Attach a dummy position to a node.
* Generation of fresh type variables.
* Helper data types and functions for passing arguments to smart
construc... | open CommonTypes
open Operators
open SourceCode
open SourceCode.WithPos
open Sugartypes
open Utility
module type Pos = SugarConstructorsIntf.Pos
module type SugarConstructorsSig = SugarConstructorsIntf.SugarConstructorsSig
module SugarConstructors (Position : Pos)
: (SugarConstructorsSig with ... |
a0acd1b7b73c665f5b769300641508138a2c8b5bbcaa0d2c2f7aef5763fa6aa2 | ocaml-community/lambda-term | lTerm_toplevel_impl.ml | open LTerm_geom
open LTerm_key
class t = LTerm_widget_base_impl.t
About focus ; widgets may specify an optional target widget in each direction .
The focus specification is intepreted in two ways based on can_focus .
can_focus = true
If the currently focussed widget has a focus specification in ... | null | https://raw.githubusercontent.com/ocaml-community/lambda-term/bcb949e420d97c1aac67f93a95d25aca5ac2cb8d/src/lTerm_toplevel_impl.ml | ocaml | If the currently focused widget has a focus specification for
the given direction jump directly to that widget
Otherwise project a line in the appropriate direction until we hit a widget.
note; this allows widget=focused, if specified
root focused coord
root focused coord
root focused coord
root foc... | open LTerm_geom
open LTerm_key
class t = LTerm_widget_base_impl.t
About focus ; widgets may specify an optional target widget in each direction .
The focus specification is intepreted in two ways based on can_focus .
can_focus = true
If the currently focussed widget has a focus specification in ... |
a3a3e80dc7574cabb246231b0a30b7ef29d148ed239dbfe539214ca4857cd2ae | egonSchiele/actionkid | Core.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module ActionKid.Core where
import ActionKid.Globals
import ActionKid.Internal
import ActionKid.Types
import ActionKid.Utils
import Control.Applicative
import Control.Concurrent
import C... | null | https://raw.githubusercontent.com/egonSchiele/actionkid/a1f1ca4efafb5a692dfd12b6c3a2fd74e8888fb0/src/ActionKid/Core.hs | haskell | | (Currently disabled) Given a path to an audio file, plays the file.
audioFormat = Mix.AudioS16LSB
anyChannel = (-1)
forkOS $ do
-- Don't ask why this is needed. If it isn't there, somehow
-- this audio thread blocks all other execution, and you can't
-- do anything else. But intr... | # LANGUAGE FlexibleInstances #
# LANGUAGE TemplateHaskell #
module ActionKid.Core where
import ActionKid.Globals
import ActionKid.Internal
import ActionKid.Types
import ActionKid.Utils
import Control.Applicative
import Control.Concurrent
import C... |
e4a4a3c1d59a7d62b6077e5d437ec8f613409656a37243eaf2fb995ecb9fe561 | haskell/haskell-language-server | AddArgFromLet.hs | foo :: Bool -> Int
foo True =
let bar = new_def
in bar
foo False = 1 | null | https://raw.githubusercontent.com/haskell/haskell-language-server/68d353f1ed42f3643bdb6043244b491030cc3e99/plugins/hls-refactor-plugin/test/data/golden/add-arg/AddArgFromLet.hs | haskell | foo :: Bool -> Int
foo True =
let bar = new_def
in bar
foo False = 1 | |
d39c5ba4733b16e79e5694debe137a8653b2b66553e0d9965936cd9599e57eac | opencog/learn | learn.scm | ;
; Language learning module.
Wraps up the assorted tools and scripts into one module .
;
(define-module (opencog learn))
; The files are loaded in pipeline order.
; In general, the later files depend on definitions contained
; in the earlier files.
(include-from-path "opencog/learn/common.scm")
(include-from-path "... | null | https://raw.githubusercontent.com/opencog/learn/3b8e63a602e591f2fded69aee27f285378c9b649/scm/learn.scm | scheme |
Language learning module.
The files are loaded in pipeline order.
In general, the later files depend on definitions contained
in the earlier files.
pair stuff.
parsing stuff
classification stuff | Wraps up the assorted tools and scripts into one module .
(define-module (opencog learn))
(include-from-path "opencog/learn/common.scm")
(include-from-path "opencog/learn/utilities.scm")
(include-from-path "opencog/learn/waiter.scm")
(include-from-path "opencog/learn/pair-api.scm")
(include-from-path "opencog/learn... |
12b5b6b29c7d66793b9fb77d0a9d9f0008bba1f9eccc8d1ad997bb1e6848469e | travelping/ergw | ergw_sx_node_sup.erl | Copyright 2018 , Travelping GmbH < >
%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(ergw_sx_node_sup... | null | https://raw.githubusercontent.com/travelping/ergw/1b6cc3ee89eea4cf9df1d7de612744f0a850dfd9/apps/ergw_core/src/ergw_sx_node_sup.erl | erlang | This program is free software; you can redistribute it and/or
API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervi... | Copyright 2018 , Travelping GmbH < >
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(ergw_sx_node_sup).
-behaviour(supervisor).
-export([start_link/0, new/5]).
-ig... |
fb61b8010e86dc8101dbfc4d63a967d7f4b5f0db8aab59d0668eb6571c38b09d | mbenelli/klio | kws-cgi.scm | kws-cgi.scm - Klio web server cgi test .
;;
Copyright ( c ) 2011 by < >
All Rights Reserved .
;(include "../../klio/prelude.scm")
;(include "../../klio/http.scm")
;(include "../../klio/kws.scm")
;(include "../../klio/cgi.scm")
( include " ~~lib / gambit#.scm " )
(##namespace ("http#" current-request request... | null | https://raw.githubusercontent.com/mbenelli/klio/33c11700d6080de44a22a27a5147f97899583f6e/tests/kws-test/kws-cgi.scm | scheme |
(include "../../klio/prelude.scm")
(include "../../klio/http.scm")
(include "../../klio/kws.scm")
(include "../../klio/cgi.scm")
server-root: "." | kws-cgi.scm - Klio web server cgi test .
Copyright ( c ) 2011 by < >
All Rights Reserved .
( include " ~~lib / gambit#.scm " )
(##namespace ("http#" current-request request-uri uri-path reply))
(##namespace ("kws#" get-static kws *server-root*))
(##namespace ("cgi#" cgi-path run-cgi))
(define (cgi? p)
(m... |
f181999205ab012dd24d107c1d4b894a4b7c0e6aad00c4ac18c2e24b41bc2954 | jberryman/simple-actors | TreeExample.hs | module TreeExample
where
import Control.Concurrent.Actors
import Control.Applicative
import Control.Concurrent.MVar
import Control.Concurrent.Chan.Split
import Control.Concurrent(forkIO)
{-
- We build a sort of living binary tree or dynamic sorting network from Actors.
- The formulation is not too different ... | null | https://raw.githubusercontent.com/jberryman/simple-actors/e224c3e8e4e13cb2a63344c13d99079f9b19faaa/TreeExample.hs | haskell |
- We build a sort of living binary tree or dynamic sorting network from Actors.
- The formulation is not too different from what we would get using flat data
- types
---
-- TODO: Benchmark this and see how this compares w/ case expr cascade:
---
the actor equivalent of a Nil leaf node:
signal Int is not pre... | module TreeExample
where
import Control.Concurrent.Actors
import Control.Applicative
import Control.Concurrent.MVar
import Control.Concurrent.Chan.Split
import Control.Concurrent(forkIO)
nil :: Behavior Operation
nil = Receive $ do
(Query _ var) <- received
else , StreamQuery received
(Str... |
fa1d37d7052c92bc35546320aed4f0c81478ccb842094127e8d14c88f3457817 | MrEbbinghaus/fulcro-material-ui-wrapper | toggle_button.cljc | (ns ^:deprecated material-ui.lab.toggle-button
(:require
[material-ui.inputs.toggle-button :as inputs.toggle-button]))
(def ^:deprecated button inputs.toggle-button/button)
(def ^:deprecated button-group inputs.toggle-button/button-group) | null | https://raw.githubusercontent.com/MrEbbinghaus/fulcro-material-ui-wrapper/058f1dd4b85542914f92f48a4010ea9ad497e48f/src/material_ui/lab/toggle_button.cljc | clojure | (ns ^:deprecated material-ui.lab.toggle-button
(:require
[material-ui.inputs.toggle-button :as inputs.toggle-button]))
(def ^:deprecated button inputs.toggle-button/button)
(def ^:deprecated button-group inputs.toggle-button/button-group) | |
db48029e37cfeaf50524a6e79602da88f391bffba1744cfbab48550439020b61 | ronwalf/HTN-Translation | genBlocks.hs | {-# LANGUAGE
FlexibleContexts,
OverlappingInstances,
ParallelListComp,
RankNTypes,
ScopedTypeVariables
#-}
{-# OPTIONS_GHC
-fcontext-stack=30
-Wall
#-}
module Main where
import Data.List
import System.Environment
import System.Random
import Test.QuickCheck
import Text.Printf
import Planning.P... | null | https://raw.githubusercontent.com/ronwalf/HTN-Translation/dfe39a9444c944e2efd48306e122a17d6c0f2d89/examples/blocksworld/genBlocks.hs | haskell | # LANGUAGE
FlexibleContexts,
OverlappingInstances,
ParallelListComp,
RankNTypes,
ScopedTypeVariables
#
# OPTIONS_GHC
-fcontext-stack=30
-Wall
#
Constants for adding stack predicates and items.
Should be something other than a double list for efficiency...
Randomly permute a list
generate ra... | module Main where
import Data.List
import System.Environment
import System.Random
import Test.QuickCheck
import Text.Printf
import Planning.PDDL.PDDL3_0
import HTNTranslation . Translation
stackArity :: Int
stackArity = 1
stackSize :: Int
stackSize = 3
extensions :: [[Integer]]
extensions =
map snd $ iterate... |
2901441e5402f44c9943a19718184f6f96984f86e83ddf39a7b709b2c4111833 | rtoal/ple | new_operators.hs | import Control.Monad (guard)
(<-*->) :: Int -> Int -> Int
(<-*->) x y = 2 * x + y
(>*<) :: Int -> Int -> Int
(>*<) x y = 2 * x + y
infix 8 <-*-> -- binds tighter than multiplication
infix 2 >*< -- binds looser than multiplication
main = do
8 * ( 2 * 3 + 5 )
2*(8 * 3 ) + 5
| null | https://raw.githubusercontent.com/rtoal/ple/b24cab4de2beca6970833a09d05af6ef96ec3921/haskell/new_operators.hs | haskell | binds tighter than multiplication
binds looser than multiplication | import Control.Monad (guard)
(<-*->) :: Int -> Int -> Int
(<-*->) x y = 2 * x + y
(>*<) :: Int -> Int -> Int
(>*<) x y = 2 * x + y
main = do
8 * ( 2 * 3 + 5 )
2*(8 * 3 ) + 5
|
b58fa957cc631d20c2c4c0e389e906317d2cca7fc62f170f0dc8ab8a2c387703 | travelping/tetrapak | tetrapak_shell_extension.erl | -module(tetrapak_shell_extension).
-compile([export_all]).
-import(io, [format/1]).
-define(STD_PARAMS, [{return_trace}, {exception_trace}]).
help() ->
shell_default:help(),
format("** tetrapak extended commands **~n"),
format("l() -- reloads changed modules\n"),
format("start() -- start... | null | https://raw.githubusercontent.com/travelping/tetrapak/48033a25d7f10ad2f60a7436d97fc27b285bc714/src/tetrapak_shell_extension.erl | erlang | --------------------------------------------------------------------------------------------------
-- helpers | -module(tetrapak_shell_extension).
-compile([export_all]).
-import(io, [format/1]).
-define(STD_PARAMS, [{return_trace}, {exception_trace}]).
help() ->
shell_default:help(),
format("** tetrapak extended commands **~n"),
format("l() -- reloads changed modules\n"),
format("start() -- start... |
e3793deace9c9f116d75ad8314081343418ba29c7c3cdcf0f4d53520fdd11bdb | herd/herdtools7 | PPCLexer.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/lib/PPCLexer.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... |
1ad6bb9fe9310f40f89dffa13d0359f3cc4aa0ad347505f0a77761459bce5b43 | takikawa/racket-ppa | zo-marshal.rkt | #lang racket/base
(require compiler/zo-structs
racket/port
racket/vector
racket/match
racket/contract
racket/local
racket/list
racket/dict
racket/function
racket/pretty
racket/path
racket/set
racket/extflonum
... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/share/pkgs/zo-lib/compiler/zo-marshal.rkt | racket | linklet directory:
single linklet bundle:
Write the compiled form header
Write the version:
bytestring encodings of the bundles and bundle names
Write order must correspond to a pre-order traversal
of the tree, so sort
Write count:
Size of btree:
Add offsets to bundle-bytess:
Write out btree or compute offse... | #lang racket/base
(require compiler/zo-structs
racket/port
racket/vector
racket/match
racket/contract
racket/local
racket/list
racket/dict
racket/function
racket/pretty
racket/path
racket/set
racket/extflonum
... |
a0dc37b199631e92120efbc22b2e973748e412fbb27eec8edba74ff83751b0b0 | tilk/yieldfsm | FoldInit.hs | |
Copyright : ( C ) 2022 : BSD2 ( see the file LICENSE )
Maintainer : < >
This module defines the initial call folding optimization .
Copyright : (C) 2022 Marek Materzok
License : BSD2 (see the file LICENSE)
Maintainer : Marek Materzok <>
This module defines the initial call folding ... | null | https://raw.githubusercontent.com/tilk/yieldfsm/bf86708eab22faec90c63cb15b0ac94c7005724b/src/FSM/Process/FoldInit.hs | haskell | |
Copyright : ( C ) 2022 : BSD2 ( see the file LICENSE )
Maintainer : < >
This module defines the initial call folding optimization .
Copyright : (C) 2022 Marek Materzok
License : BSD2 (see the file LICENSE)
Maintainer : Marek Materzok <>
This module defines the initial call folding ... | |
8714b32b6081899c80d06f8a5797da59d8636a59d62fe935fd638142716c8229 | chaw/r7rs-libs | examples.sps | Examples from Schelog documentation to test and illustrate
(import (scheme base)
(rebottled schelog)
(slib format))
(define %knows
(%rel ()
(('Odysseus 'TeX))
(('Odysseus 'Scheme))
(('Odysseus 'Prolog))
(('Odysseus 'Penelope))
(('Penelope 'TeX))
(('P... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/rebottled-examples/examples.sps | scheme | -----------------------------
puzzle.scm
that successively solves each clue and query, which are expressed
solve_puzzle(Clues, Queries, Solution)
:- solve(Clues), solve(Queries).
solve(()).
evaluate (solve-puzzle %puzzle) to get the solution to
%puzzle. Here %puzzle is a relation that is defi... | Examples from Schelog documentation to test and illustrate
(import (scheme base)
(rebottled schelog)
(slib format))
(define %knows
(%rel ()
(('Odysseus 'TeX))
(('Odysseus 'Scheme))
(('Odysseus 'Prolog))
(('Odysseus 'Penelope))
(('Penelope 'TeX))
(('P... |
cc7c5bff7c342e15f4f210fe5cf38efecd997fac0e48f7a37da4750beae3d74f | diffusionkinetics/open | TestParFoldl.hs | {-# LANGUAGE StandaloneDeriving #-}
import Control.Parallel.Foldl
import Control.Applicative
import Numeric.Datasets.Iris
import Numeric.Datasets.BostonHousing
import Numeric.Datasets
import qualified Data.Map.Strict as Map
irisApply :: Fold Double Double -> Fold Iris Iris
irisApply f = Iris <$> premap sepalLengt... | null | https://raw.githubusercontent.com/diffusionkinetics/open/673d9a4a099abd9035ccc21e37d8e614a45a1901/parfoldl/TestParFoldl.hs | haskell | # LANGUAGE StandaloneDeriving # |
import Control.Parallel.Foldl
import Control.Applicative
import Numeric.Datasets.Iris
import Numeric.Datasets.BostonHousing
import Numeric.Datasets
import qualified Data.Map.Strict as Map
irisApply :: Fold Double Double -> Fold Iris Iris
irisApply f = Iris <$> premap sepalLength f
<*> premap sepalW... |
bd0f02ddaf2738e7ea52beb6ad24ee7ecdb1d6e710cf9bf30fdc673b1c65b602 | michalkonecny/aern2 | Fourier.hs | # LANGUAGE Arrows , FlexibleContexts , TypeOperators , TypeFamilies , ConstraintKinds , ScopedTypeVariables #
module BenchTasks.Fourier where
import MixedTypesNumPrelude
import Text.Printf
import Control.Arrow
import AERN2.Utils.Arrows
import qualified Data.Map as Map
import qualified Data.Sequence as SQ
import GHC.... | null | https://raw.githubusercontent.com/michalkonecny/aern2/ac9beb0ec333709b9d33317df5c9e8876d253db2/aern2-real/attic/bench/BenchTasks/Fourier.hs | haskell | taskFFTWithHookA ::
=>
(Integer -> String -> c `to` Maybe c) ->
Integer -> () `to` Maybe [c]
taskFFTWithHookA hookA k =
proc () ->
do
mxR <- mapWithIndexA reg -< x
let Just xR = sequence mxR
ditfft2AHook hookA n -< xR
where
reg i = hookA 0 ("x" ++ show i)
x = [ convertExactly ... | # LANGUAGE Arrows , FlexibleContexts , TypeOperators , TypeFamilies , ConstraintKinds , ScopedTypeVariables #
module BenchTasks.Fourier where
import MixedTypesNumPrelude
import Text.Printf
import Control.Arrow
import AERN2.Utils.Arrows
import qualified Data.Map as Map
import qualified Data.Sequence as SQ
import GHC.... |
91051aca37df81563ec8b8334e7eebbd8fb123b8df2362d5090a19cec87ab805 | cljdoc/cljdoc | shell.clj | (ns helper.shell
(:require [babashka.tasks :as tasks]
[clojure.pprint :as pprint]
[lread.status-line :as status]))
(def default-opts {:error-fn
(fn die-on-error [{{:keys [exit cmd]} :proc}]
(status/die exit
"shell exited... | null | https://raw.githubusercontent.com/cljdoc/cljdoc/390404a4907beb3b6c311b96b4455131d33a7e63/script/helper/shell.clj | clojure | (ns helper.shell
(:require [babashka.tasks :as tasks]
[clojure.pprint :as pprint]
[lread.status-line :as status]))
(def default-opts {:error-fn
(fn die-on-error [{{:keys [exit cmd]} :proc}]
(status/die exit
"shell exited... | |
ca420e612bcc3cb5626b4e3380c485220a1521fb3e4debb528e4e81e7013491d | input-output-hk/ouroboros-network | ImmutableDB.hs | module Ouroboros.Consensus.Storage.ImmutableDB (module X) where
import Ouroboros.Consensus.Storage.ImmutableDB.API as X
import Ouroboros.Consensus.Storage.ImmutableDB.Chunks as X
import Ouroboros.Consensus.Storage.ImmutableDB.Impl as X
| null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/Storage/ImmutableDB.hs | haskell | module Ouroboros.Consensus.Storage.ImmutableDB (module X) where
import Ouroboros.Consensus.Storage.ImmutableDB.API as X
import Ouroboros.Consensus.Storage.ImmutableDB.Chunks as X
import Ouroboros.Consensus.Storage.ImmutableDB.Impl as X
| |
95f9febdea3177b301f39ed85cf981af9f56485f59233434385ff961702dbe00 | stephenpascoe/hs-arrow | Lib.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ImplicitPrelude #
# LANGUAGE FunctionalDependencies #
# LANGUAGE ExistentialQuantification #
module Lib
(
) where
import Prelude hiding (length)
import qualified GI.Arrow as ARR
import Control.Monad.IO.Class
import GHC.Int (Int8, Int16, Int32, Int64)
import GHC.... | null | https://raw.githubusercontent.com/stephenpascoe/hs-arrow/86c7c452a8626b1d69a3cffd277078d455823271/src/Lib.hs | haskell | | Cast an array if possible
TODO : Other IsArrowArray instances
TODO : No c_glib equivilent. Implement with foldr or similar
TODO : Date types
TODO : Lists
TODO : Structs
TODO : what about splitAt 0? Maybe we need empty array | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ImplicitPrelude #
# LANGUAGE FunctionalDependencies #
# LANGUAGE ExistentialQuantification #
module Lib
(
) where
import Prelude hiding (length)
import qualified GI.Arrow as ARR
import Control.Monad.IO.Class
import GHC.Int (Int8, Int16, Int32, Int64)
import GHC.... |
6cb66576c7362b78b50472056f6440cf5e328a22f8ebc25bd7b68d6661091f08 | input-output-hk/ouroboros-network | Socket.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# OPT... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/a3de4116840c7fa07bda02d3e6f678cd1f9c2be4/ouroboros-network-framework/test/Test/Ouroboros/Network/Socket.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
The list of all tests
activeMuxTracer = _verboseTracer -- Dump log messages to stdout.
|
Allow to run a singly req-resp protocol.
Properties
| Send and receive over IPv6
| Verify that an initiator and a respond... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - orphans #
module Test.Ouroboros.Network.Socket (tests) where
import Data.Bifold... |
515fc2a3d0d533970c33a0e65478b81a3ca126d1ee333bdcc29822d33b1ff3d2 | cdsmith/explainable-predicates | FlowMatcher.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| An implementation of bipartite matching using the Ford - Fulkerson algorithm .
module Test.Predicates.Internal.FlowMatcher where
import Control.Monad (forM_, when)
import Control.Monad.ST (ST)
import Data.Array.IArray (Array, assocs, elems)
import Dat... | null | https://raw.githubusercontent.com/cdsmith/explainable-predicates/9483b867b3682db2789495e71ee3fb9b4fd56d45/src/Test/Predicates/Internal/FlowMatcher.hs | haskell | $setup
>>> :set -Wno-type-defaults
given the compatibility function.
elements.
| # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| An implementation of bipartite matching using the Ford - Fulkerson algorithm .
module Test.Predicates.Internal.FlowMatcher where
import Control.Monad (forM_, when)
import Control.Monad.ST (ST)
import Data.Array.IArray (Array, assocs, elems)
import Dat... |
73961ffe68340a27ba066e32a92745996cccd6f033d864eb2d5ef725d1751090 | korya/efuns | configurator.ml | open Xtypes
open Options
open WX_text
open Stdconfig
open Gwml
open WX_types
open WX_filesel
let wx_display = new WX_display.t ""
let _ =
wx_display#broken (fun _ -> ())
let wx_root = new WX_root.t wx_display 0
let maxlen = 30
let last_focus = ref (new WX_ledit.t wx_root#container "" [])
let min_width = 5... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/gwml/configurator.ml | ocaml | open Xtypes
open Options
open WX_text
open Stdconfig
open Gwml
open WX_types
open WX_filesel
let wx_display = new WX_display.t ""
let _ =
wx_display#broken (fun _ -> ())
let wx_root = new WX_root.t wx_display 0
let maxlen = 30
let last_focus = ref (new WX_ledit.t wx_root#container "" [])
let min_width = 5... | |
819a3c453d86a4469886bd8879543d41c446554d65960452657b28b3829e1290 | apinf/proxy42 | proxy42_plugin_storage.erl | -module(proxy42_plugin_storage).
-compile(export_all).
insert(Tab, Entry) ->
mnesia:transaction(
fun()->
mnesia:write(Tab, Entry, write)
end).
update(Tab, Key, UpdateFn) when is_function(UpdateFn) ->
mnesia:transaction(
fun()->
Entry = ?MODULE:get(Tab,Key),
NewEntry = apply... | null | https://raw.githubusercontent.com/apinf/proxy42/01b483b711881391e8306bf64b83b4df9d0bc832/apps/proxy42_core/src/proxy42_plugin_storage.erl | erlang | -module(proxy42_plugin_storage).
-compile(export_all).
insert(Tab, Entry) ->
mnesia:transaction(
fun()->
mnesia:write(Tab, Entry, write)
end).
update(Tab, Key, UpdateFn) when is_function(UpdateFn) ->
mnesia:transaction(
fun()->
Entry = ?MODULE:get(Tab,Key),
NewEntry = apply... | |
603b6b3da9b3a80cb5c879655ffa1c4162469c11ef7fac962365f75ca0c16491 | janestreet/ecaml | vector.ml | open! Core
open! Import
module Q = struct
include Q
let vconcat = "vconcat" |> Symbol.intern
end
include Value.Make_subtype (struct
let name = "vector"
let here = [%here]
let is_in_subtype = Value.is_vector
end)
let make_vector = Funcall.Wrap.("make-vector" <: int @-> value @-> return t)
let creat... | null | https://raw.githubusercontent.com/janestreet/ecaml/7c16e5720ee1da04e0757cf185a074debf9088df/src/vector.ml | ocaml | open! Core
open! Import
module Q = struct
include Q
let vconcat = "vconcat" |> Symbol.intern
end
include Value.Make_subtype (struct
let name = "vector"
let here = [%here]
let is_in_subtype = Value.is_vector
end)
let make_vector = Funcall.Wrap.("make-vector" <: int @-> value @-> return t)
let creat... | |
e34e7c2adb18f127698ee8f1a2f4297cfff8a9feaa7414011326aed3cbed4396 | input-output-hk/cardano-wallet | UTxOIndex.hs | -- |
Copyright : © 2018 - 2021 IOHK
-- License: Apache-2.0
--
-- Provides the 'UTxOIndex' type, which indexes a UTxO set by asset identifier.
--
-- The index makes it possible to efficiently compute the subset of a UTxO set
-- containing a particular asset, or to select just a single UTxO containing a
-- particular a... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/157a6d5f977f4600373596b7cfa9700138e8e140/lib/primitive/lib/Cardano/Wallet/Primitive/Types/UTxOIndex.hs | haskell | |
License: Apache-2.0
Provides the 'UTxOIndex' type, which indexes a UTxO set by asset identifier.
The index makes it possible to efficiently compute the subset of a UTxO set
containing a particular asset, or to select just a single UTxO containing a
particular asset, without having to search linearly through t... | Copyright : © 2018 - 2021 IOHK
module Cardano.Wallet.Primitive.Types.UTxOIndex
(
UTxOIndex
, empty
, singleton
, fromMap
, fromSequence
, toList
, toMap
, fold
, insert
, insertMany
, delete
, deleteMany
, filter
, partition
, assets
, balanc... |
c567301069800292c11176579efde6d1b56822167060b76421efb185648a472d | digital-asset/ghc | thunk.hs | # LANGUAGE UnboxedTuples #
# NOINLINE f #
f :: (# #) -> [Int]
f (# #) = [ 1 .. ]
main :: IO ()
main = print (sum (take 10 (f (# #))))
| null | https://raw.githubusercontent.com/digital-asset/ghc/323dc6fcb127f77c08423873efc0a088c071440a/testsuite/tests/unboxedsums/thunk.hs | haskell | # LANGUAGE UnboxedTuples #
# NOINLINE f #
f :: (# #) -> [Int]
f (# #) = [ 1 .. ]
main :: IO ()
main = print (sum (take 10 (f (# #))))
| |
42374ece7fc708e980d8ce618c72930bd354b88411512dff5c905a08b93bdd8f | imrehg/ypsilon | vruler.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk vruler)
(export gtk_vruler_get_type
gtk_vruler_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(cond (on-linux... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/vruler.scm | scheme | [end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk vruler)
(export gtk_vruler_get_type
gtk_vruler_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(cond (on-linux... |
b2f44217df773804f742d12222ea6f182eb3ebed32431bb136b796e3b2fea133 | pascal-knodel/haskell-craft | E'5'22.hs | --
--
--
-----------------
Exercise 5.22 .
-----------------
--
--
--
module E'5'22 where
onSeparateLines :: [String] -> String
onSeparateLines xs
= [ c | x <- xs, c <- (x ++ "\n")]
GHCi >
putStr ( onSeparateLines [ " Three " , " Two " , " One " ] )
putStr ( onSeparateLines [ "Three" , "Two" , "One" ... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'5'22.hs | haskell |
---------------
---------------
| Exercise 5.22 .
module E'5'22 where
onSeparateLines :: [String] -> String
onSeparateLines xs
= [ c | x <- xs, c <- (x ++ "\n")]
GHCi >
putStr ( onSeparateLines [ " Three " , " Two " , " One " ] )
putStr ( onSeparateLines [ "Three" , "Two" , "One" ] )
-}
Three
Two
One
|
9fc9c68ada21ebeb7ef4bdebe94dfa38ee66887dab3c86b149d11eb5adfdc005 | futurice/haskell-mega-repo | Eval.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
module Slack.Eval where
import Data.Aeson (eitherDecode, encode, object, parseJSON, (.=))
import Data.Aeson.Types (parseMaybe)
import Futurice.Prelude
import Prelude ()
import Slack.Request
import Slack.Types
import qualified Data.Aeson.Lens... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/slack-client/src/Slack/Eval.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | module Slack.Eval where
import Data.Aeson (eitherDecode, encode, object, parseJSON, (.=))
import Data.Aeson.Types (parseMaybe)
import Futurice.Prelude
import Prelude ()
import Slack.Request
import Slack.Types
import qualified Data.Aeson.Lens as L
import qualified Data.Text as T
import qualified N... |
fb70171be3fcb31af72519d19d5e0bf99fb4de10c7e196442840d9df56611837 | dongcarl/guix | stackage.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2017 < >
Copyright © 2018 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/guix/scripts/import/stackage.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2017 < >
Copyright © 2018 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (guix scripts import stackage)
#:use-module (guix ui)
#:use-module (g... |
788e90b953ddf703b2281123edb1cf5afc34a00a8c0956f8a3c1c30d2037f74d | prg-titech/baccaml | simple5.ml | ;;
let rec interp bytecode pc a =
jit_dispatch (pc = 6) bytecode a;
let instr = bytecode.(pc) in
if instr = 0
then (* ADD *)
interp bytecode (pc + 1) (a + 1)
else if instr = 1
then (* SUB *)
interp bytecode (pc + 1) (a - 1)
else if instr = 2
then (
(* CALL *)
let t1 = bytecode.(pc + 1) i... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/test/interp_example/simple5.ml | ocaml | ADD
SUB
CALL
RETURN
PRINT_A
OTHERS | ;;
let rec interp bytecode pc a =
jit_dispatch (pc = 6) bytecode a;
let instr = bytecode.(pc) in
if instr = 0
interp bytecode (pc + 1) (a + 1)
else if instr = 1
interp bytecode (pc + 1) (a - 1)
else if instr = 2
then (
let t1 = bytecode.(pc + 1) in
let v = interp bytecode t1 a in
let t2 ... |
7c70835d59ba6977bd8504c752eff86cbce9412ac499b9fa880b2ca7ef69d34e | davidlazar/ocaml-semantics | let01.ml | let x = 0 in x
| null | https://raw.githubusercontent.com/davidlazar/ocaml-semantics/6f302c6b9cced0407d501d70ad25c2d2aefbb77d/tests/unit/let01.ml | ocaml | let x = 0 in x
| |
08f4be7b66b4f098b0b0728eb51805880774e0b3d846a5bfd1e010a0771b7da7 | nibbula/yew | free.lisp | ;;;
;;; free.lisp - Show free memory.
;;;
(defpackage :free
(:documentation "Show free memory.")
(:use :cl :dlib :opsys :dlib-misc :table :grout)
(:export
#:*bar-char*
#:describe-free-memory
#:get-free
#:memory-total
#:memory-free
#:memory-shared
#:memory-buffer
#:memory-cached
#:memor... | null | https://raw.githubusercontent.com/nibbula/yew/98bd8f5c3b6e80be3684ba555a9aea6b6dc7c16f/los/free.lisp | lisp |
free.lisp - Show free memory.
for comparing to linux free
(processes (nos:get-system-info :processes))
(total-high-memory (nos:get-system-info :total-high-memory))
(free-high-memory (nos:get-system-info :free-high-memory))
(memory-reclaimable m)
(defparameter *bar-char* (code-char #x2588)) ; █
... |
(defpackage :free
(:documentation "Show free memory.")
(:use :cl :dlib :opsys :dlib-misc :table :grout)
(:export
#:*bar-char*
#:describe-free-memory
#:get-free
#:memory-total
#:memory-free
#:memory-shared
#:memory-buffer
#:memory-cached
#:memory-reclaimable
#:memory-avail
#:memor... |
0cf111bc6a3c7de3ac961b9502c032d1c678d1140d6e8051ca77820d03bed8be | tsloughter/kuberl | kuberl_v1beta1_lease_list.erl | -module(kuberl_v1beta1_lease_list).
-export([encode/1]).
-export_type([kuberl_v1beta1_lease_list/0]).
-type kuberl_v1beta1_lease_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#{ 'apiVersio... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_lease_list.erl | erlang | -module(kuberl_v1beta1_lease_list).
-export([encode/1]).
-export_type([kuberl_v1beta1_lease_list/0]).
-type kuberl_v1beta1_lease_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#{ 'apiVersio... | |
48c705e86974900036f1f13af64d093ac96bb684dd3c5ab34fd6e4217a3fe641 | aib/Project-Euler | euler59.hs | import Control.Monad
import Data.Bits
import Data.Char
import Data.List
import Data.Ord
import qualified Data.Set as Set
import Common
import Data.List.Split
keys = sequence ((take 3 . repeat) ['a'..'z'])
decrypt key ciphertext = zipWith xor ((concat . repeat) key) ciphertext
decodeNums nums key = map chr (decrypt ... | null | https://raw.githubusercontent.com/aib/Project-Euler/a01a142d360f3a30fcea69ab29d4d198160ee921/euler59.hs | haskell | mapM_ print $ map (\k -> (k, score wordList (decodeNums cipher k))) keys
print $ (decodeNums cipher (fst bestKey)) | import Control.Monad
import Data.Bits
import Data.Char
import Data.List
import Data.Ord
import qualified Data.Set as Set
import Common
import Data.List.Split
keys = sequence ((take 3 . repeat) ['a'..'z'])
decrypt key ciphertext = zipWith xor ((concat . repeat) key) ciphertext
decodeNums nums key = map chr (decrypt ... |
12caef448a6626ab97a0027c91bd296cc127041840e40306ccb236d21f88ffbb | synduce/Synduce | first.ml | (* The type of non-empty concat-lists *)
type clist = Single of int | Concat of clist * clist
(* The type of non-empty lists *)
type list = Elt of int | Cons of int * list
let rec spec = function Elt a -> a | Cons (hd, tl) -> hd
let rec target t = h t
and h = function Single a -> [%synt f_0] a | Concat (x, y) -> [%... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/list/first.ml | ocaml | The type of non-empty concat-lists
The type of non-empty lists | type clist = Single of int | Concat of clist * clist
type list = Elt of int | Cons of int * list
let rec spec = function Elt a -> a | Cons (hd, tl) -> hd
let rec target t = h t
and h = function Single a -> [%synt f_0] a | Concat (x, y) -> [%synt odot] (h x) (h y)
let rec repr l = c l
and c = function Single a -> ... |
33383590125ad3652a91ba7221ea199674e042b9abc3847fe21e08373a6008c1 | tmfg/mmtis-national-access-point | zip.cljc | (ns ote.util.zip
"Generate and read zip files."
#?@(:cljs [(:require [cljsjs.jszip]
[cljsjs.filesaverjs])]
:clj [(:require [clojure.java.io :as io])
(:import (java.util.zip ZipOutputStream ZipEntry ZipInputStream))]))
(defn write-zip
"Write a zip file. Content is a sequen... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/src/cljc/ote/util/zip.cljc | clojure | (ns ote.util.zip
"Generate and read zip files."
#?@(:cljs [(:require [cljsjs.jszip]
[cljsjs.filesaverjs])]
:clj [(:require [clojure.java.io :as io])
(:import (java.util.zip ZipOutputStream ZipEntry ZipInputStream))]))
(defn write-zip
"Write a zip file. Content is a sequen... | |
4f75916fd33e2b1dfe3fec4261309342196dd4f08161b697057a519bef690450 | GaloisInc/curl | Debug.hs | --------------------------------------------------------------------
-- |
-- Module : Network.Curl.Debug
Copyright : ( c ) Galois , Inc. 2008 - 2009
-- License : BSD3
--
-- Maintainer: Sigbjorn Finne <>
-- Stability : provisional
-- Portability:
--
-- Debug hooks
module Network.Curl.Debug (debug) where
import ... | null | https://raw.githubusercontent.com/GaloisInc/curl/185c5370fc5ee7bd6b5e75d9a90033932b4afe71/Network/Curl/Debug.hs | haskell | ------------------------------------------------------------------
|
Module : Network.Curl.Debug
License : BSD3
Maintainer: Sigbjorn Finne <>
Stability : provisional
Portability:
Debug hooks | Copyright : ( c ) Galois , Inc. 2008 - 2009
module Network.Curl.Debug (debug) where
import System.IO
debugging :: Bool
debugging = False
debug :: String -> IO ()
debug msg
| debugging = putStrLn ("DEBUG: " ++ msg) >> hFlush stdout
| otherwise = return ()
|
83b3e46836fe938c7b21388a5b3d5dce54e031be5953b72a3145213e41f4c8a8 | stylefruits/rib | rib_conn_killer_sup.erl | -module(rib_conn_killer_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ===================================================... | null | https://raw.githubusercontent.com/stylefruits/rib/12db75ac93eea8a432d61afb098d9b0410adbe7b/src/rib_conn_killer_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API functions
===================================================================
===================================================================
Supervisor callback... | -module(rib_conn_killer_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, { {one_for_one, 5, 10}, [?CHILD(rib_conn... |
37689ec2013688b86857ec02a766c2862f7b889cea564260483d76a5ab8e4b79 | rescript-lang/rescript-compiler | bsb_ninja_check.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/bsb/bsb_ninja_check.mli | ocaml | * We assume that it is a clean repo
* check if [build.ninja] should be regenerated | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the... |
44e92a4a2bbc26aadccc85cd8560312bcb83cf8506623a3d1da4620bde4045b5 | contivero/hasmin | Gradient.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TupleSections #
-----------------------------------------------------------------------------
-- |
Module : Hasmin . . Value
Copyright : ( c ) 2017
-- License : BSD3
-- Stability : experimental
-- Portability : unknown
--
Parsers for CSS \<gradient ... | null | https://raw.githubusercontent.com/contivero/hasmin/2a7604159b51e69c5e9c564dce53cb3ab09ae22b/src/Hasmin/Parser/Gradient.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Portability : unknown
---------------------------------------------------------------------------
do nothing
: [<angle>|to <side-or-corner> ,]? <color-stop> ... | # LANGUAGE TupleSections #
Module : Hasmin . . Value
Copyright : ( c ) 2017
Parsers for CSS \<gradient > values .
module Hasmin.Parser.Gradient where
import Control.Applicative ((<|>), many, optional)
import Data.Functor (($>))
import Text.Parser.Permutation ((<|?>), (<$$>), (<$?>), (<||>), permute)... |
386bf339bf3104c5915f6ba3d1581417be4c0b1b1207f58360474637be927276 | coccinelle/herodotos | sql_update.ml | exception Malformed of string
let s2s s = "'"^Str.global_replace (Str.regexp_string "'") "''" s^"'"
let get_correlation_id = "last_value(correlation_idx)"
let get_new_correlation_id = "nextval('correlation_idx')"
let filter_annot org : bool =
let Ast_org.Org(l, _, _, _, _) = org in
l = max_int
-- describe ... | null | https://raw.githubusercontent.com/coccinelle/herodotos/5da230a18962ca445ed2368bc21abe0a8402e00f/herodotos/database/sql_update.ml | ocaml |
create sequence correlation_idx;
-- describe a set of correlated reports
create table correlations (
correlation_id int primary key,
report_error_name VarChar(256) not null,
status VarChar(256) not null,
reason_phrase VarChar(256), -- annotation
data_source ... | exception Malformed of string
let s2s s = "'"^Str.global_replace (Str.regexp_string "'") "''" s^"'"
let get_correlation_id = "last_value(correlation_idx)"
let get_new_correlation_id = "nextval('correlation_idx')"
let filter_annot org : bool =
let Ast_org.Org(l, _, _, _, _) = org in
l = max_int
-- describe ... |
7c6d3598add81bb6b0f98d4e9935ebe624f92b9665d0d30cefbe5cde22618233 | jellelicht/guix | slang.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Fr... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/slang.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages slang)
#:use-module (guix pack... |
4e93a968ebe6d49b07f44cdb26736a02fd5899a5cae86dc86612e0d571ba64a2 | macourtney/drift | args.clj | (ns drift.args)
(defn split-args
"split an arglist using a matcher fn : returns
[args-before-match, args-including-and-after-match]"
[args matcher]
(split-with #(not (matcher %)) args))
(defn remove-opt
"given a matched option and whatever is after it in the arg list, remove the option
and return [{opt-... | null | https://raw.githubusercontent.com/macourtney/drift/b5cf735ab41ff2c95b0b1d9cf990faa342353171/src/drift/args.clj | clojure | (ns drift.args)
(defn split-args
"split an arglist using a matcher fn : returns
[args-before-match, args-including-and-after-match]"
[args matcher]
(split-with #(not (matcher %)) args))
(defn remove-opt
"given a matched option and whatever is after it in the arg list, remove the option
and return [{opt-... | |
22d2fa1e57525912eae2df3b434f2b5f457aae145b2250594d6115b7fd137507 | marigold-dev/mankavar | tendermint_test.ml | let () =
Printexc.record_backtrace true ;
Alcotest.run "DAS" [
Simple_tests.tests ;
] | null | https://raw.githubusercontent.com/marigold-dev/mankavar/110d1659feec9ebd99cf2f76d7699f48483010ca/src/consensus/test/state/tendermint_test.ml | ocaml | let () =
Printexc.record_backtrace true ;
Alcotest.run "DAS" [
Simple_tests.tests ;
] | |
d549e51c56c7fc66d9b71522a60e65304972017b5f94bfef1a124f9b1a69c5bf | zcaudate/hara | encode.clj | (ns hara.core.base.encode
(:import (java.util Base64)))
(def +hex-array+ [\0 \1 \2 \3 \4 \5 \6 \7 \8 \9 \a \b \c \d \e \f])
(defn hex-chars
"turns a byte into two chars
(hex-chars 255)
=> [\\f \\f]
(hex-chars 42)
=> [\2 \\a]"
{:added "3.0"}
[b]
(let [v (bit-and b 0xFF)]
[(+hex-array+ (bi... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/core/base/encode.clj | clojure | (ns hara.core.base.encode
(:import (java.util Base64)))
(def +hex-array+ [\0 \1 \2 \3 \4 \5 \6 \7 \8 \9 \a \b \c \d \e \f])
(defn hex-chars
"turns a byte into two chars
(hex-chars 255)
=> [\\f \\f]
(hex-chars 42)
=> [\2 \\a]"
{:added "3.0"}
[b]
(let [v (bit-and b 0xFF)]
[(+hex-array+ (bi... | |
b3e5a54b33571fe0bcdf89007e9c3f633033811ad32d6774d40e2b05b4d80050 | kyleburton/sandbox | canvas.cljs | (ns game-of-life.canvas
(:require
re-frame.db))
(def cell-size 10)
(def line-size 1)
(defn draw-cell [ctx yy xx]
(let [cell-size 10
yy (+ yy (* cell-size yy))
xx (+ xx (* cell-size xx))]
(.rect ctx yy xx cell-size cell-size)))
(comment
(let [canvas (.getElementById js/docu... | null | https://raw.githubusercontent.com/kyleburton/sandbox/f0721337e8814a7a9db693a70855e010b2f0eadf/examples/clojure/game-of-life/src/game_of_life/canvas.cljs | clojure | (ns game-of-life.canvas
(:require
re-frame.db))
(def cell-size 10)
(def line-size 1)
(defn draw-cell [ctx yy xx]
(let [cell-size 10
yy (+ yy (* cell-size yy))
xx (+ xx (* cell-size xx))]
(.rect ctx yy xx cell-size cell-size)))
(comment
(let [canvas (.getElementById js/docu... | |
a1319ef66d9bca5c66ba3e93808686243f35e852cd053071c38843a92820677f | samply/blaze | update_test.clj | (ns blaze.interaction.update-test
"Specifications relevant for the FHIR update interaction:
#update
#ops"
(:require
[blaze.anomaly-spec]
[blaze.db.api-stub
:refer [create-mem-node-system with-system-data]]
[blaze.executors :as ex]
[blaze.fhir.response.create-spec]
[blaze.fhir.spec.t... | null | https://raw.githubusercontent.com/samply/blaze/948eee38021467fa343c522a644a7fd4b24b6467/modules/interaction/test/blaze/interaction/update_test.clj | clojure | (ns blaze.interaction.update-test
"Specifications relevant for the FHIR update interaction:
#update
#ops"
(:require
[blaze.anomaly-spec]
[blaze.db.api-stub
:refer [create-mem-node-system with-system-data]]
[blaze.executors :as ex]
[blaze.fhir.response.create-spec]
[blaze.fhir.spec.t... | |
071ad257cb4810b454d5a87f260db879a00da465ea45c22beae0dbcb8b877f43 | tonsky/advent-of-code | day16.clj | (ns advent-of-code.year2018.day16
(:require
[clojure.string :as str]))
(defn parse-example [example]
(let [[b0 b1 b2 b3 op a b c a0 a1 a2 a3]
(->> example
(re-find #"Before: \[(\d+), (\d+), (\d+), (\d+)\]\n(\d+) (\d+) (\d+) (\d+)\nAfter:\s*\[(\d+), (\d+), (\d+), (\d+)\]")
(next)
... | null | https://raw.githubusercontent.com/tonsky/advent-of-code/fc12b0eafe7dfa80c77c2806f5efdef4bb94a974/src/advent_of_code/year2018/day16.clj | clojure | (ns advent-of-code.year2018.day16
(:require
[clojure.string :as str]))
(defn parse-example [example]
(let [[b0 b1 b2 b3 op a b c a0 a1 a2 a3]
(->> example
(re-find #"Before: \[(\d+), (\d+), (\d+), (\d+)\]\n(\d+) (\d+) (\d+) (\d+)\nAfter:\s*\[(\d+), (\d+), (\d+), (\d+)\]")
(next)
... | |
75e1f5947ba39b323e8f28f2a56929469ae469ba93de0643305daff634c1fac7 | philoskim/debux | lab.cljs | (ns examples.lab
(:require [debux.cs.core :as d :refer-macros [clog clogn dbg dbgn
dbgt clogt break] ]))
(transduce (dbgt (filter even?))
conj (range 5))
(transduce (dbgt (comp (map inc) (filter even?)))
conj (range 5))
(transduce (clogt (filte... | null | https://raw.githubusercontent.com/philoskim/debux/586a2d0fed01d9694fac95a8b569d58e76d2c841/examples/src/cljs/examples/lab.cljs | clojure | (ns examples.lab
(:require [debux.cs.core :as d :refer-macros [clog clogn dbg dbgn
dbgt clogt break] ]))
(transduce (dbgt (filter even?))
conj (range 5))
(transduce (dbgt (comp (map inc) (filter even?)))
conj (range 5))
(transduce (clogt (filte... | |
e2d3d92f0de199c40d8b79440146b13ee15cc739c0602b4f14db69a6ae16cf15 | AccelerateHS/accelerate | Map.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MonoLocalBinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
-- |
-- Module : Data.Array.A... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate/63e53be22aef32cd0b3b6f108e637716a92b72dc/src/Data/Array/Accelerate/Test/NoFib/Prelude/Map.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
# LANGUAGE TypeOperators #
|
Module : Data.Array.Accelerate.Test.NoFib.Prelude.Map
License : BSD3
Stability : experimental
conversions
answers for extremely large... | # LANGUAGE MonoLocalBinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
Copyright : [ 2009 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.Test.NoFib.Prelude.Map (
test_map
) where
import Data.B... |
3995b413d7a2494c39157c2c3ef636c46f799055d6c43e34de0653a7f01620b7 | maximedenes/native-coq | check_stat.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/checker/check_stat.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Errors
open Util... |
5468f4ffede80080b1dfb3a24778dc35b9b135ede65f8eb310d4a1f5af2f9f0a | pascutto/cachecache | dllist.ml | type 'a t = {
cap : int;
witness : 'a;
mutable free : int;
contents : 'a array;
prev : int array;
next : int array;
}
type 'a l = {
mutable first : int;
mutable last : int;
mutable size : int;
t : 'a t;
}
type 'a c = int
let create cap witness =
{
cap;
witness;
free = 0;
content... | null | https://raw.githubusercontent.com/pascutto/cachecache/36efb3cfb66198c6aaf155334db42220f264d97a/src/dllist.ml | ocaml | type 'a t = {
cap : int;
witness : 'a;
mutable free : int;
contents : 'a array;
prev : int array;
next : int array;
}
type 'a l = {
mutable first : int;
mutable last : int;
mutable size : int;
t : 'a t;
}
type 'a c = int
let create cap witness =
{
cap;
witness;
free = 0;
content... | |
7ec852b6a6f36a774837b7a7dfb246f8cd055833f8ea68eadc727656a3da8ffa | MastodonC/kixi.hecuba | migrate.clj | (ns migrate
(:require [qbits.hayt :as hayt]
[kixi.hecuba.storage.db :as db]
[kixi.hecuba.data.measurements :as measurements]
[kixi.hecuba.data.sensors :as sensors]
[kixi.hecuba.time :as time]
[clojure.tools.logging :as log]
[clj-time.core :as t]
... | null | https://raw.githubusercontent.com/MastodonC/kixi.hecuba/467400bbe670e74420a2711f7d49e869ab2b3e21/dev/migrate.clj | clojure | don't have to do anything when location is stringified json
where setting documents column to a new list throws an error "extraneous input 'documents' expecting K_WHERE" :
UPDATE entities SET documents = ['{"token":"683f2d71c33af03e6d77f8bac1bfdff97c34076a","privacy":"Public","file_size":18025,"id":1557,"name":"SAP... | (ns migrate
(:require [qbits.hayt :as hayt]
[kixi.hecuba.storage.db :as db]
[kixi.hecuba.data.measurements :as measurements]
[kixi.hecuba.data.sensors :as sensors]
[kixi.hecuba.time :as time]
[clojure.tools.logging :as log]
[clj-time.core :as t]
... |
a916fdf4597b705f74196339a000247c189915535daefc2b66b486751b633373 | rd--/hsc3 | jmcc-sidereal-time.hs | sidereal time ( jmcc ) # 9 ; texture = overlap,4,4,6,inf
let p = 15
i = let y _ = klankSpec_mce (X.expRandN p 100 6000) (mceConst p 1) (X.randN p 2 6)
in mceFill 2 y
f = xLine kr (expRand 40 300) (expRand 40 300) 12 DoNothing
t = let e = lfNoise2 kr (rand 0 8)
in lfPulse ar f 0 (rand 0.1 0... | null | https://raw.githubusercontent.com/rd--/hsc3/d026af0481298418ffbce68953e5babcf6b87cbe/Help/Graph/jmcc-sidereal-time.hs | haskell | sidereal time ( jmcc ) # 9 ; texture = overlap,4,4,6,inf
let p = 15
i = let y _ = klankSpec_mce (X.expRandN p 100 6000) (mceConst p 1) (X.randN p 2 6)
in mceFill 2 y
f = xLine kr (expRand 40 300) (expRand 40 300) 12 DoNothing
t = let e = lfNoise2 kr (rand 0 8)
in lfPulse ar f 0 (rand 0.1 0... | |
8ea07489b14a4c0d56c4130d4ba38d8243890fde2a95aee712eb9cb8f83aa7db | TrustInSoft/tis-kernel | frontc.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/kernel_internals/typing/frontc.ml | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
Copyright ( C ) 2001 - 2003
< > ... |
ff72b6e4e489937b33d2dc6224385b70e72c18f3739e3a428e33e2d325eba4ad | barrucadu/quickie | Brainfuck.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE MultiWayIf #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE ViewPatterns #
-- | The Quickie Brainfuck parser and compiler.
module Language.Brainfuck where
import qualified Control.Concurrent as C
import Control.Exception (try)
import Co... | null | https://raw.githubusercontent.com/barrucadu/quickie/6acf20adbc0d1a0f6810e8940ba69ecbffbc725f/lib/Language/Brainfuck.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MultiWayIf #
| The Quickie Brainfuck parser and compiler.
-----------------------------------------------------------------------------
* Quickie IR
bits:
Well-formed instructions are those constructed by the pattern
synonyms. Any other instruction is ill-formed and may lead... | # LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE ViewPatterns #
module Language.Brainfuck where
import qualified Control.Concurrent as C
import Control.Exception (try)
import Control.Monad (void)
import Data.Bits ((.|.), (.&.), unsafeShiftL, unsafeShiftR)
import qualified ... |
508e668e86013710d0b5b56aa0ef04745cbb3f367c5164b5b3d36726a5017d28 | kloimhardt/werkbank | la_habra.cljs | (ns abc.la-habra
(:require [reagent.core :as reagent :refer [atom]]
[clojure.string :as string :refer [split-lines split join]]
[ui.helpers :refer [cos sin style url val-cyc]]
[ui.shapes :as shapes :refer [tri square pent hex hept oct
b1 b2... | null | https://raw.githubusercontent.com/kloimhardt/werkbank/df66274eb978d060a043b8429b29d0f36c4a2e89/src/abc/la_habra.cljs | clojure | hides heads up display for performance
------------------------ SETTINGS ---------------------
----------- ANIMATIONS ----------------
syntax reminder
(make-frames!
"NAME"
[frames]
(make-body "ATTRIBUTE" [values]))
(trans x y)
(nth-frame num FRAME)
(even-frame FRAME)
(odd-frame FRAME)
"fade-in-out" ... | (ns abc.la-habra
(:require [reagent.core :as reagent :refer [atom]]
[clojure.string :as string :refer [split-lines split join]]
[ui.helpers :refer [cos sin style url val-cyc]]
[ui.shapes :as shapes :refer [tri square pent hex hept oct
b1 b2... |
e77d3261cb28092249f5cce1343f8f80f610dbed2316947ffb02d404b71dcecf | hanazuki/miniml | test_syntax.ml | open OUnit
open Assertion
open Utils
let _ =
"syntax" >::: [
"comment" >::: [
TestCase (fun _ -> assert_type "unit" "(* com *) () (* ment *)");
TestCase (fun _ -> assert_type "unit" "(* (* nested *) comment *) ()");
TestCase (fun _ -> assert_lexfail "(* (* unmatched *) comment ((()");
Tes... | null | https://raw.githubusercontent.com/hanazuki/miniml/012f268b4d3bb91d234eaa941b0e7bf58a0dd7cc/test/test_syntax.ml | ocaml | open OUnit
open Assertion
open Utils
let _ =
"syntax" >::: [
"comment" >::: [
TestCase (fun _ -> assert_type "unit" "(* com *) () (* ment *)");
TestCase (fun _ -> assert_type "unit" "(* (* nested *) comment *) ()");
TestCase (fun _ -> assert_lexfail "(* (* unmatched *) comment ((()");
Tes... | |
a746b2c2bfeadbccdc49a49dd7f3780f4bd019d2edd12950311da74a3a5f501e | Frechmatz/cl-synthesizer | packages.lisp | (defpackage :cl-synthesizer-test
(:use :cl :lisp-unit ))
| null | https://raw.githubusercontent.com/Frechmatz/cl-synthesizer/ba2e4003448829078187013f6723eb5c8ce8adbc/test/packages.lisp | lisp | (defpackage :cl-synthesizer-test
(:use :cl :lisp-unit ))
| |
0ce0069352bcbd3b6602d35fb9eb6e65b247bc0817ef2a9b073ac29b95371e95 | janestreet/ppx_css | css_jane.mli | open! Core
type 'a with_loc = 'a * Location.t
module rec Dimension : sig
type t =
| Length
| Angle
| Time
| Frequency
[@@deriving sexp_of]
end
and Component_value : sig
type t =
| Paren_block of t with_loc list
| Bracket_block of t with_loc list
| Percentage of string
| Ident of... | null | https://raw.githubusercontent.com/janestreet/ppx_css/3baeb2a2d9787bec88942a2cefbead6a257ef5a1/css_jane/src/css_jane.mli | ocaml | open! Core
type 'a with_loc = 'a * Location.t
module rec Dimension : sig
type t =
| Length
| Angle
| Time
| Frequency
[@@deriving sexp_of]
end
and Component_value : sig
type t =
| Paren_block of t with_loc list
| Bracket_block of t with_loc list
| Percentage of string
| Ident of... | |
2b5b030963acc040b66c81adfd20b020d00154098c7809c8181bc8a59179c61a | FlowerWrong/mblog | escript.erl | %% ---
Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/escript-4.1/escript.erl | erlang | ---
Copyrights apply to this code. It may not be used to create training material,
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
---
compliance with the License. You should have received ... | Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS... |
12e99ae5f640b0a94d914de7e66fe84ec8d879198068f7de5cef577f4d02cb3a | richhickey/sdb | itunes-to-sdb.clj | Stick your iTunes database in sdb
;note, the commands in this script are meant to be run interactively in the REPL
(use 'clojure.contrib.pprint)
(use 'org.clojure.sdb)
;get logging to calm down, else noisy at REPL
(org.apache.log4j.PropertyConfigurator/configure
(doto (java.util.Properties.)
(.setProperty "lo... | null | https://raw.githubusercontent.com/richhickey/sdb/973fbd31952cfa5b71a4e0ed5b59a6f9b27c5000/src/examples/itunes-to-sdb.clj | clojure | note, the commands in this script are meant to be run interactively in the REPL
get logging to calm down, else noisy at REPL
(create-domain client "test") | Stick your iTunes database in sdb
(use 'clojure.contrib.pprint)
(use 'org.clojure.sdb)
(org.apache.log4j.PropertyConfigurator/configure
(doto (java.util.Properties.)
(.setProperty "log4j.rootLogger" "WARN")
(.setProperty "log4j.logger.com.amazonaws.sdb" "WARN")
(.setProperty "log4j.logger.httpclient" "W... |
4976861f67fcca3a612c6deab45550b22a5190d1efa20e986c3c5c6f5ff65889 | ludwigpacifici/saumon | environment.mli | (** An environment represents bindings between a variable and its value. It's scope aware (delimited with "\{ ... \}"). *)
type t
val empty : unit -> t
(** Create an empty environment. *)
val is_empty : t -> bool
(** Check if the environment is empty, i.e. no variable declared. *)
val define : env:t -> id:string -> ... | null | https://raw.githubusercontent.com/ludwigpacifici/saumon/e8a05216ffae5a58ce3ceed5ae3e989b81930ed5/lib/environment.mli | ocaml | * An environment represents bindings between a variable and its value. It's scope aware (delimited with "\{ ... \}").
* Create an empty environment.
* Check if the environment is empty, i.e. no variable declared.
* Define a variable. Shadowing is allowed. It follows what Scheme does.
* Assign a variable. Shadowing ... | type t
val empty : unit -> t
val is_empty : t -> bool
val define : env:t -> id:string -> Value.t -> t
val assign : env:t -> id:string -> Value.t -> t option
val contains : env:t -> id:string -> bool
val get : env:t -> id:string -> Value.t option
val push_scope : env:t -> t
val pop_scope : env:t -> (t * t) optio... |
6dd43b97a4a025c7f2c7c288ca5e2106f67750f2a319f2380c34e5b07d21103b | haskell/cabal | cabal.test.hs | 2022 - 09 - 20 , issue # 8487
--
import Test.Cabal.Prelude
main = cabalTest $ do
cabalG [ "--config-file", "config.file" ] "build" [ "test" ]
| null | https://raw.githubusercontent.com/haskell/cabal/a5106bed5a197e9f670a0949f803e714ad4ef403/cabal-testsuite/PackageTests/ConfigFile/T8487/cabal.test.hs | haskell | 2022 - 09 - 20 , issue # 8487
import Test.Cabal.Prelude
main = cabalTest $ do
cabalG [ "--config-file", "config.file" ] "build" [ "test" ]
| |
c0b7024865a95e8c94507b37c2ef4ed447f88aee60ff741c15d79987e3486fde | chenyukang/eopl | 03.scm | (load "../libs/init.scm")
(display (scan&parse "-(55, -(x, 11))"))
| null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch3/03.scm | scheme | (load "../libs/init.scm")
(display (scan&parse "-(55, -(x, 11))"))
| |
b80fe5e1740ad5280ae10527cae03818cea08684843fb9866c198f3a62a03a17 | fragnix/fragnix | Data.Vector.Fusion.Bundle.Size.hs | {-# LANGUAGE Haskell2010 #-}
# LINE 1 " Data / Vector / Fusion / Bundle / Size.hs " #
-- |
-- Module : Data.Vector.Fusion.Bundle.Size
Copyright : ( c ) Roman Leshchinskiy 2008 - 2010
-- License : BSD-style
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
-- Size hints ... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/Data.Vector.Fusion.Bundle.Size.hs | haskell | # LANGUAGE Haskell2010 #
|
Module : Data.Vector.Fusion.Bundle.Size
License : BSD-style
Stability : experimental
Portability : portable
Size hints for streams.
| Size hint
^ Exact size
^ Upper bound on the size
^ Unknown size
Note: we assume m and n are >= 0.
# INLINE smaller #
| Convert a size... | # LINE 1 " Data / Vector / Fusion / Bundle / Size.hs " #
Copyright : ( c ) Roman Leshchinskiy 2008 - 2010
Maintainer : < >
module Data.Vector.Fusion.Bundle.Size (
Size(..), clampedSubtract, smaller, larger, toMax, upperBound, lowerBound
) where
import Data.Vector.Fusion.Util ( delay_inline )
de... |
759688ebc60441305243d05d3ca8b9e90765c3abd2795b3e048b9ed97ff72a11 | tbsschroeder/clojure-webshop-app | articles.clj | (ns metro.components.db.articles
(:require [korma.core :as kc]))
(kc/defentity article
(kc/table :articles)
(kc/entity-fields :id :title :description :category :image :count))
(defn drop-table! []
(kc/exec-raw "DROP TABLE IF EXISTS articles"))
(defn clear-table! []
(kc/delete article))
(defn add! [title d... | null | https://raw.githubusercontent.com/tbsschroeder/clojure-webshop-app/acedaceae794b8c9bd0805356880169e19a66b86/src/metro/components/db/articles.clj | clojure | not working right now
(kc/select article (kc/fields :count) (kc/where {:id id}))) | (ns metro.components.db.articles
(:require [korma.core :as kc]))
(kc/defentity article
(kc/table :articles)
(kc/entity-fields :id :title :description :category :image :count))
(defn drop-table! []
(kc/exec-raw "DROP TABLE IF EXISTS articles"))
(defn clear-table! []
(kc/delete article))
(defn add! [title d... |
ca26c7dfd7d2a3eeea0578d4e7441e973d75ea950c081086d4e50e718b4fa5a7 | themetaschemer/malt | G-velocity.rkt | #lang racket
;; Extended operators are non-dualized
(require "../base-no-duals.rkt")
(require "D-gradient-descent.ss")
(require "E-gd-common.ss")
Velocity / Momentum
(define velocity-i
(λ (p)
(list p (zeroes p))))
(define velocity-d
(λ (pa)
(ref pa 0)))
(define velocity-u
(λ (pa g)
(let ((v (-... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/malted/G-velocity.rkt | racket | Extended operators are non-dualized | #lang racket
(require "../base-no-duals.rkt")
(require "D-gradient-descent.ss")
(require "E-gd-common.ss")
Velocity / Momentum
(define velocity-i
(λ (p)
(list p (zeroes p))))
(define velocity-d
(λ (pa)
(ref pa 0)))
(define velocity-u
(λ (pa g)
(let ((v (- (* mu (ref pa 1)) (* alpha g))))
... |
5906c110d2a084ff7bf083b89288bc15f0c2f0e84af5550ed0b5148a8a296b50 | icicle-lang/zebra-ambiata | Merge.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
module Zebra.Foreign.Merge (
CMergeMany(..)
, mergeEntityPair
, mergeManyInit
, mergeManyPush
, mergeManyPop
, mergeManyClone
) where
import Anemone.Foreign.Mempool ... | null | https://raw.githubusercontent.com/icicle-lang/zebra-ambiata/394ee5f98b4805df2c76abb52cdaad9fd7825f81/zebra-core/src/Zebra/Foreign/Merge.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
module Zebra.Foreign.Merge (
CMergeMany(..)
, mergeEntityPair
, mergeManyInit
, mergeManyPush
, mergeManyPop
, mergeManyClone
) where
import Anemone.Foreign.Mempool ... | |
0fbc572b30e4485ecbcde60f5b1b80e64ddf973dfc13b18094c74973418516d8 | cau-placc/ghc-language-plugin | CreateSyntax.hs | {-# LANGUAGE TemplateHaskellQuotes #-}
# LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeApplications #
|
Module : Plugin . Trans . CreateSyntax
Description : Helper functions to create parts of GHC 's AST
Copyright : ( c )... | null | https://raw.githubusercontent.com/cau-placc/ghc-language-plugin/c89c3bd6f409d4e28e3492320940d337fefb38ba/src/Plugin/Trans/CreateSyntax.hs | haskell | # LANGUAGE TemplateHaskellQuotes #
# LANGUAGE ScopedTypeVariables #
| Create the lambda functions used to lift value constructors.
Look at their lifting for details.
list of types is empty -> apply the collected variables.
Use the given wrapper for the constructor.
Apply all variables in reverse to the construct... | # LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
# LANGUAGE TypeApplications #
|
Module : Plugin . Trans . CreateSyntax
Description : Helper functions to create parts of GHC 's AST
Copyright : ( c ) ( 2020 - 2023 )
Maintainer :
This module contains a lot of differ... |
2ff0effa48dba4271032ee7ec4ebc1dbfbb9a35589070bde6b1e6b7cdcd33f01 | coq/coq | vernacextend.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/29eac1001ac649422e62e851fec7cb8fd33ead8d/vernac/vernacextend.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
519dce550909cec70418ef23fd14abc2a754d4d515e322947116504def3b7cfd | xldenis/ill | Syntax.hs | # LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE InstanceSigs #
{-# LANGUAGE PatternSynonyms, StandaloneDeriving #-}
module Thrill.Syntax
( module X
, module Thrill.Syntax
, Cofree(..)
, pr... | null | https://raw.githubusercontent.com/xldenis/ill/46bb41bf5c82cd6fc4ad6d0d8d33cda9e87a671c/src/Thrill/Syntax.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PatternSynonyms, StandaloneDeriving #
type ParsedModule = Module (Decl Name SourceSpan)
Spooky partial function. Use only when invariant holds | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE InstanceSigs #
module Thrill.Syntax
( module X
, module Thrill.Syntax
, Cofree(..)
, pretty
, extract
, unwrap
) where
import Thrill.Prelude
import Control.Comonad.Cofree
import Control.Comonad
import Control.Lens.TH
imp... |
f3052e4821fd6ae88bd9e6a4ca7036060a4b7a61061ba75c9a1cbbc6b9bd6c28 | janestreet/hardcaml_circuits | mul.mli | * / Dadda tree multipliers .
The / Dadda tree has three steps :
1 . Multiply ( that is - AND ) each bit of one of the arguments , by each bit of the
other , yielding n^2 results . Depending on position of the multiplied bits , the wires
carry different weights , for example wire of bit car... | null | https://raw.githubusercontent.com/janestreet/hardcaml_circuits/a2c2d1ea3e6957c3cda4767d519e94c20f1172b2/src/mul.mli | ocaml | * / Dadda tree multipliers .
The / Dadda tree has three steps :
1 . Multiply ( that is - AND ) each bit of one of the arguments , by each bit of the
other , yielding n^2 results . Depending on position of the multiplied bits , the wires
carry different weights , for example wire of bit car... | |
5fde28db6063f7362e6421c41cbe1d14c23423ea682bde770658c49deb77782f | lspitzner/brittany | Test462.hs | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
import qualified Data.List as L
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test462.hs | haskell | brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft } | import qualified Data.List as L
|
20104c9e17c93a348f249dd793e530d682154b96298b7c8c1c41eeebd15139c6 | dmitryvk/sbcl-win32-threads | rotate-byte.lisp | (in-package "SB-ROTATE-BYTE")
(defun rotate-byte (count bytespec integer)
"Rotates a field of bits within INTEGER; specifically, returns an
integer that contains the bits of INTEGER rotated COUNT times
leftwards within the byte specified by BYTESPEC, and elsewhere
contains the bits of INTEGER."
(rotate-byte count ... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/contrib/sb-rotate-byte/rotate-byte.lisp | lisp | specifically, returns an
inhibit transforms | (in-package "SB-ROTATE-BYTE")
(defun rotate-byte (count bytespec integer)
integer that contains the bits of INTEGER rotated COUNT times
leftwards within the byte specified by BYTESPEC, and elsewhere
contains the bits of INTEGER."
(rotate-byte count bytespec integer))
(defun %rotate-byte (count size pos integer)
(... |
c4fec61d548c60ad8263ac5461f79d99ca31fbe433e6e6fbbeb8865cad0c3fb6 | foreverbell/project-euler-solutions | 491.hs |
import Control.Monad.ST
import Control.Monad (forM_, when)
import Data.Array
import Data.Array.ST
maskBound :: Int
maskBound = (3^10) - 1
encode :: [Int] -> Int
encode x = foldl helper 0 (zip x [3^i | i <- [0 .. 9]]) where
helper accum (bit, pow) = accum + bit * pow
decode :: Int -> [Int]
decode x = helper x 10... | null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/491.hs | haskell |
import Control.Monad.ST
import Control.Monad (forM_, when)
import Data.Array
import Data.Array.ST
maskBound :: Int
maskBound = (3^10) - 1
encode :: [Int] -> Int
encode x = foldl helper 0 (zip x [3^i | i <- [0 .. 9]]) where
helper accum (bit, pow) = accum + bit * pow
decode :: Int -> [Int]
decode x = helper x 10... | |
4aadc0ca5b8ddabfd2a05da60d80eec849b2721c3f25f279653ee4aeec7d7632 | project-oak/hafnium-verification | Procedures.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/backend/Procedures.mli | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
e47e03c46aeaa29f5982f84999fb06cdb35ab11c1b099fc8c30eb02d8050c39c | racket/typed-racket | gh-issue-764.rkt | #lang typed/racket
(ann (= 0 +nan.0) False)
(ann (= +nan.0 0) False)
(ann (= 0 +0.0) True)
(ann (= +0.0 0) True)
(ann (= 0 -0.0) True)
(ann (= -0.0 0) True)
(ann (= -0.0 +0.0) True)
; This was always ok:
(ann (= 1 +nan.0) False)
(ann (= 0 1) False)
(ann (= 1 0) False)
| null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/succeed/gh-issue-764.rkt | racket | This was always ok: | #lang typed/racket
(ann (= 0 +nan.0) False)
(ann (= +nan.0 0) False)
(ann (= 0 +0.0) True)
(ann (= +0.0 0) True)
(ann (= 0 -0.0) True)
(ann (= -0.0 0) True)
(ann (= -0.0 +0.0) True)
(ann (= 1 +nan.0) False)
(ann (= 0 1) False)
(ann (= 1 0) False)
|
38bb1a302ebc0385638fa7ce3dfec38822bf176f7e5e8d0eff4c9176aaea8933 | dnaeon/cl-ssh-keys | ecdsa-nistp256.lisp | Copyright ( c ) 2020 Nikolov < >
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
1 . Redistributions of source code must retain the above copyright
;; notice, this list of co... | null | https://raw.githubusercontent.com/dnaeon/cl-ssh-keys/544f2631f07d7b94de498aabded1267358b49268/src/ecdsa-nistp256.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer
in this position and unchanged.
notice, this list of conditions and the fo... | Copyright ( c ) 2020 Nikolov < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S ) ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES... |
1df96212317e30ee7ccac9adae73a503e9d5b73b733598461cbc999182b96040 | cl21/cl21 | repl.lisp | (in-package :cl-user)
(defpackage cl21.core.repl
(:use :cl)
(:import-from :repl-utilities
:doc
:readme
:summary)
(:export :-
:+
:++
:+++
:*
:**
:***
:/
://
:///
... | null | https://raw.githubusercontent.com/cl21/cl21/c36644f3b6ea4975174c8ce72de43a4524dd0696/src/core/repl.lisp | lisp | (in-package :cl-user)
(defpackage cl21.core.repl
(:use :cl)
(:import-from :repl-utilities
:doc
:readme
:summary)
(:export :-
:+
:++
:+++
:*
:**
:***
:/
://
:///
... | |
666211cc43c3667952cf37199b43ec1b888caa6fb837f8f2369a73ea14b234ec | charlieg/Sparser | loader.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
Copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved
$ Id:$
;;; File: "loader"
;;; Module: "grammar/model/sl/checkpoint/
version : September 2009
Initiated 4/7/09 , updated through 8/13/09 . added post - processing
(in-pac... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/model/sl/checkpoint/loader.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
File: "loader"
Module: "grammar/model/sl/checkpoint/ | Copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved
$ Id:$
version : September 2009
Initiated 4/7/09 , updated through 8/13/09 . added post - processing
(in-package :sparser)
(when *call-signs*
(gload "ckpt;vocabulary")
(gload "ckpt;adjectives")
(gload "ckpt;rules")
(gload "ckpt;post-proc... |
5a9626e3b5b1f83787f89d1b01b3e175790a76b8f2b03e210bbfcb3cd45aad95 | chetmurthy/ensemble | proto.mli | (**************************************************************)
(* PROTO.MLI *)
Author : , 11/96
(* see also appl/property.mli *)
(**************************************************************)
open Trans
(**************************************************************)
type id (* stack *)
type l (* layer... | null | https://raw.githubusercontent.com/chetmurthy/ensemble/8266a89e68be24a4aaa5d594662e211eeaa6dc89/ensemble/server/type/proto.mli | ocaml | ************************************************************
PROTO.MLI
see also appl/property.mli
************************************************************
************************************************************
stack
layer
************************************************************
*******************... | Author : , 11/96
open Trans
val string_of_id : id -> string
val id_of_string : string -> id
val layers_of_id : id -> l list
val string_of_l : l -> name
val l_of_string : name -> l
|
23ada1443221580236bdb57ded020bfd33da4314fe1435ac971a9bd10e1cb5a1 | BoeingX/haskell-programming-from-first-principles | LanguageExercises.hs | module AlgebraicDataTypes.ChapterExercises.LanguageExercises where
import Data.Char
capitalizeWord :: String -> String
capitalizeWord "" = ""
capitalizeWord (c:cs) = toUpper c : cs
capitalizeParagraph :: String -> String
capitalizeParagraph "" = ""
capitalizeParagraph cs = capitalizeWord p1 ++ punct ++ capitalizePar... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/src/AlgebraicDataTypes/ChapterExercises/LanguageExercises.hs | haskell | module AlgebraicDataTypes.ChapterExercises.LanguageExercises where
import Data.Char
capitalizeWord :: String -> String
capitalizeWord "" = ""
capitalizeWord (c:cs) = toUpper c : cs
capitalizeParagraph :: String -> String
capitalizeParagraph "" = ""
capitalizeParagraph cs = capitalizeWord p1 ++ punct ++ capitalizePar... | |
da23972ccd046ad7654cfebd04f13dac359aa9caab3275858f324104ab356682 | lambdabot/lambdabot | Spell.hs | # LANGUAGE PatternGuards #
Copyright ( c ) 2004 - 6
GPL version 2 or later ( see )
--
-- | Interface to /aspell/, an open source spelling checker, from a
suggestion by . Requires you to install aspell .
module Lambdabot.Plugin.Reference.Spell (spellPlugin) where
import Lambdabot.Config.Reference
import La... | null | https://raw.githubusercontent.com/lambdabot/lambdabot/de01f362c7a8fc6f85c37e604168dcccb1283a0e/lambdabot-reference-plugins/src/Lambdabot/Plugin/Reference/Spell.hs | haskell |
| Interface to /aspell/, an open source spelling checker, from a
output.
| Return a list of possible spellings for a word
'String' is a word to check the spelling of.
Parse the output of aspell (would probably work for ispell too)
drop header
no header for some reason
Grammar is:
OK ::= ... | # LANGUAGE PatternGuards #
Copyright ( c ) 2004 - 6
GPL version 2 or later ( see )
suggestion by . Requires you to install aspell .
module Lambdabot.Plugin.Reference.Spell (spellPlugin) where
import Lambdabot.Config.Reference
import Lambdabot.Plugin
import Lambdabot.Util
import Control.Monad.Trans
import... |
e175b03161373f5821a8ebd9f5810b489c4b840103b7f47c724df89ad0b173f8 | na4zagin3/satyrographos | buildScript_0_0_2.ml | open Core
open BuildScript_prim
let recursively f base_dir src acc =
let base_src = FilePath.concat base_dir src in
FileUtil.(find Is_file base_src (fun acc path ->
let dst = FilePath.make_relative base_src path in
let src_path = FilePath.make_relative base_dir path in
f dst src_path acc
)) acc
let... | null | https://raw.githubusercontent.com/na4zagin3/satyrographos/9dbccf05138510c977a67c859bbbb48755470c7f/src/buildScript_0_0_2.ml | ocaml | for future extension
sources: source list [@sexp.omit_nil];
sources: source sexp_list;
for future extension | open Core
open BuildScript_prim
let recursively f base_dir src acc =
let base_src = FilePath.concat base_dir src in
FileUtil.(find Is_file base_src (fun acc path ->
let dst = FilePath.make_relative base_src path in
let src_path = FilePath.make_relative base_dir path in
f dst src_path acc
)) acc
let... |
3072372db8400f55160473cb4e0bb39e9300437856528d2ac0317f0746a1cfcc | ninenines/cowboy | set_options_h.erl | %% This module sets options dynamically and performs
%% some related relevant operation for testing the change.
-module(set_options_h).
-export([init/2]).
init(Req, State) ->
set_options(cowboy_req:binding(key, Req), Req, State).
set_options(<<"chunked_false">>, Req0, State) ->
cowboy_req:cast({set_options, #{chu... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/set_options_h.erl | erlang | This module sets options dynamically and performs
some related relevant operation for testing the change. |
-module(set_options_h).
-export([init/2]).
init(Req, State) ->
set_options(cowboy_req:binding(key, Req), Req, State).
set_options(<<"chunked_false">>, Req0, State) ->
cowboy_req:cast({set_options, #{chunked => false}}, Req0),
Req = cowboy_req:stream_reply(200, Req0),
cowboy_req:stream_body(<<0:8000000>>, fin, R... |
9c1aee7554496605b2d972cc1e391952f6ddfa4f4f44f5ef9d6a8422ff12ff41 | djblue/portal | spec.cljc | (ns ^:no-doc portal.spec
(:require [clojure.spec.alpha :as s]
[portal.colors :as c]))
(s/def ::options (s/keys :opt [::c/theme]))
(defn assert-options [options]
(let [options (select-keys options [::c/theme])
parsed (s/conform ::options options)]
(when (= parsed ::s/invalid)
(throw ... | null | https://raw.githubusercontent.com/djblue/portal/1ee145277b572e572bc3fd88ad0553c9cc15d7be/src/portal/spec.cljc | clojure | (ns ^:no-doc portal.spec
(:require [clojure.spec.alpha :as s]
[portal.colors :as c]))
(s/def ::options (s/keys :opt [::c/theme]))
(defn assert-options [options]
(let [options (select-keys options [::c/theme])
parsed (s/conform ::options options)]
(when (= parsed ::s/invalid)
(throw ... | |
fb3e6bdb913b2f04a3eaf20f0bd0f9b9467e86ecba81296f09db786cf5601eca | mirage/ocaml-git | unikernel.ml | open Lwt.Infix
module Make
(Store : Git.S)
(_ : sig end) =
struct
module Sync = Git.Mem.Sync (Store)
let author () =
{ Git.User.name= "Romain Calascibetta"
; email= ""
; date=
let ptime = Ptime.unsafe_of_d_ps (Pclock.now_d_ps ()) in
let tz = match Pclock.current_tz_offset_s () with... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/unikernel/empty-commit/unikernel.ml | ocaml | open Lwt.Infix
module Make
(Store : Git.S)
(_ : sig end) =
struct
module Sync = Git.Mem.Sync (Store)
let author () =
{ Git.User.name= "Romain Calascibetta"
; email= ""
; date=
let ptime = Ptime.unsafe_of_d_ps (Pclock.now_d_ps ()) in
let tz = match Pclock.current_tz_offset_s () with... | |
5a50a7b9c7dad29ea3dd98bc3d7ec4886c0c4aa03ff7c9e59944199dd454c13e | litaocheng/erl-test | record.erl | -module(record).
-export([set/1, set2/1]).
-record(r, {
k1,
k2,
k3
}).
set(#r{k1 = K1, k2 = K2, k3 = K3}) ->
{ok, K1, K2, K3}.
set2(R) ->
{ok, R#r.k1, R#r.k2, R#r.k3}.
| null | https://raw.githubusercontent.com/litaocheng/erl-test/893679fccb1c16dda45d40d2b9e12d78db991b8a/record/record.erl | erlang | -module(record).
-export([set/1, set2/1]).
-record(r, {
k1,
k2,
k3
}).
set(#r{k1 = K1, k2 = K2, k3 = K3}) ->
{ok, K1, K2, K3}.
set2(R) ->
{ok, R#r.k1, R#r.k2, R#r.k3}.
| |
03fce7395c01b86c928919a476fcf97e991798ab8b2beaed106b90d445a836cb | FreeProving/free-compiler | CompletePatternPass.hs | -- | This module contains a compiler pass that checks if all function
-- declarations have complete pattern matching. A pattern is complete if there
is exactly one case alternative for each constructor of the corresponding
-- type.
--
-- = Examples
--
= = Example 1
--
-- The module consisting of the fol... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Pass/CompletePatternPass.hs | haskell | | This module contains a compiler pass that checks if all function
declarations have complete pattern matching. A pattern is complete if there
type.
= Examples
The module consisting of the following declarations
> data Maybe a = Just a | Nothing
>
> fromJust :: Maybe a -> a
> fromJust @a (x... | is exactly one case alternative for each constructor of the corresponding
= = Example 1
alternative for the constructor
= = Example 2
> redundant : : Just Bool - > Just
> redundant ( on : : Just Bool ) = case ( on : : Just ) of {
should not pass the check because the @case@ expression has... |
81b12c0d9acd5c7b497bbd59eb2060d82b025015aa2238745b01055d508dd43e | GaloisInc/renovate | Panic.hs | # LANGUAGE TemplateHaskell #
module Renovate.Arch.X86_64.Panic (
P.panic,
RenovatePanic(..)
) where
import qualified Panic as P
data RenovatePanic = X86_64ISA
deriving (Show)
instance P.PanicComponent RenovatePanic where
panicComponentName pc = "Renovate[" ++ show pc ++ "]"
panicComponentIssues _ = ""
... | null | https://raw.githubusercontent.com/GaloisInc/renovate/df24c65c45ea95588c08e3d36a40cfd0ad90f8d9/renovate-x86/src/Renovate/Arch/X86_64/Panic.hs | haskell | # LANGUAGE TemplateHaskell #
module Renovate.Arch.X86_64.Panic (
P.panic,
RenovatePanic(..)
) where
import qualified Panic as P
data RenovatePanic = X86_64ISA
deriving (Show)
instance P.PanicComponent RenovatePanic where
panicComponentName pc = "Renovate[" ++ show pc ++ "]"
panicComponentIssues _ = ""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.