_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
8170d0912c77aa75a9fffc78de0d640c2ecff6fdcfb11eb4ceab73d2191025da
yav/haskell-lexer
Lexer.hs
module Language.Haskell.Lexer ( PosToken , Token(..) , lexerPass0 , lexerPass0' , lexerPass1 , rmSpace , layoutPre , module Language.Haskell.Lexer.Position ) where import Language.Haskell.Lexer.Lex(haskellLex) import Language.Haskell.Lexer.Utils import Language.Haskell.Lexer.Layout(layoutPre,PosToken...
null
https://raw.githubusercontent.com/yav/haskell-lexer/357df3d88fa6638703126ad6178380386944819e/Language/Haskell/Lexer.hs
haskell
| The function 'lexerPass1' handles the part of lexical analysis that can be done independently of the parser---the tokenization and the | Remove token that are not meaningful (e.g., white space and comments). | Tokenize and add position information. Preserves white space, and does not insert extra tokens due to ...
module Language.Haskell.Lexer ( PosToken , Token(..) , lexerPass0 , lexerPass0' , lexerPass1 , rmSpace , layoutPre , module Language.Haskell.Lexer.Position ) where import Language.Haskell.Lexer.Lex(haskellLex) import Language.Haskell.Lexer.Utils import Language.Haskell.Lexer.Layout(layoutPre,PosToken...
def8c2050a24d6105f32a0ad92b951da885caad39222f2341b563b458f1b13e2
vikram/lisplibraries
font-loader-interface.lisp
Copyright ( c ) 2006 , All Rights Reserved ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions...
null
https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/zpb-ttf-0.7/font-loader-interface.lisp
lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form ...
Copyright ( c ) 2006 , All Rights Reserved DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , Interface functions for creating , initializing , and closing a font - loader - interface.lisp , v 1.6 2006/03/23 22:20:35 xach Ex...
61fdc706b6a417ab03f7b9aeb7993c465b8d2afc76d2112028030a0e1a473de4
adacapo21/plutusPioneerProgram
Maybe.hs
module Week04.Maybe where import Text.Read (readMaybe) import Week04.Monad foo :: String -> String -> String -> Maybe Int -- YOU CAN RUN THIS IN REPL by typing: foo " 1 " " 2 " " 3 " 3 values to be a type of Integers Nothing -> Nothing -- FAILURE Just k -> case readMaybe y of ...
null
https://raw.githubusercontent.com/adacapo21/plutusPioneerProgram/2994d6fd8c01a54c15dd19783b898aca71831c5a/week04/src/Week04/Maybe.hs
haskell
YOU CAN RUN THIS IN REPL by typing: FAILURE If K int succeeds FAILURE If l int succeeds FAILURE if m int succeeds the above way is too Noisy in HASKELL a less NOISY WAY of of doing the completely same logic with above YOU CAN RUN below example IN REPL by typing: If k is an INT succeeds If l is an INT succee...
module Week04.Maybe where import Text.Read (readMaybe) import Week04.Monad foo " 1 " " 2 " " 3 " 3 values to be a type of Integers bindMaybe Nothing _ = Nothing bindMaybe (Just x) f = f x foo ' " 1 " " 2 " " 3 " foo' :: String -> String -> String -> Maybe Int foo '' " 1 " " 2 " " 3 "
6d530511480bfbf2e57e45f999a6e2bffb76150eaf6de68003c697cb61ca9f87
ocaml-sf/learnocaml-cpge-public
test2.ml
open Test_lib open Report let success msg = [Message ([Text msg], Success 1)] let fail msg = [Message ([Text msg], Failure)] (******************************************************) (* Some facilities to work with Binary Search Trees **) (******************************************************) let leaf x = Nod...
null
https://raw.githubusercontent.com/ocaml-sf/learnocaml-cpge-public/f903aaa78254c8397c8d138c13bb2976c1d9ef3d/exercises/bst/tests/test2.ml
ocaml
**************************************************** Some facilities to work with Binary Search Trees * **************************************************** ********************** Actual testing code * **********************
open Test_lib open Report let success msg = [Message ([Text msg], Success 1)] let fail msg = [Message ([Text msg], Failure)] let leaf x = Node (Empty, x, Empty) let rec repeat n f accu = if n = 0 then accu else repeat (n - 1) f (f accu) let rec insert x = function | Empty -> leaf x | (Node (l, y, r)) as...
a14df13678e6b28014154d132c1d6df5a33f2421ae01d4b35da76fa2d0f36555
imandra-ai/fix-engine
message.mli
type t = (string * string) list [@@deriving show] val checksum_string : string -> int val valid_checksum : t -> bool * Verifies the checksum ( sum of all bytes mod 256 ) of all bytes in the message up to the CheckSum<10 > entry . Returns true if the computed checksum is equal to the value of CheckSum<10 >...
null
https://raw.githubusercontent.com/imandra-ai/fix-engine/42f3c4f3ca432469969e89e461ca76b52c21f282/fix-engine/src-core-utils-msg/message.mli
ocaml
* A checksum in [[0..<256]]
type t = (string * string) list [@@deriving show] val checksum_string : string -> int val valid_checksum : t -> bool * Verifies the checksum ( sum of all bytes mod 256 ) of all bytes in the message up to the CheckSum<10 > entry . Returns true if the computed checksum is equal to the value of CheckSum<10 >...
b61c889086ea48cee8af9277f288e31fcc84d911c14c7d978e004676b1ee8aca
avsm/platform
core.mli
RE - A regular expression library Copyright ( C ) 2001 email : This library 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 , with linking exception ; either version ...
null
https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/re.1.9.0/lib/core.mli
ocaml
* Module [Re]: regular expressions commons * Regular expression * Compiled regular expression * Manipulate matching groups. * Information about groups in a match. * Raise [Not_found] if the group did not match * Raise [Not_found] if the group did not match * Return the start of the match. Raise [Not_found] if th...
RE - A regular expression library Copyright ( C ) 2001 email : This library 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 , with linking exception ; either version ...
e89a1cc739ef8b875e06ad22332d42c7ca1b2afc790a4cf10a92e8ac56b97a67
haskell/win32
HardLink.hs
# LANGUAGE CPP # | Module : System . Win32.HardLink Copyright : 2013 shelarcy License : BSD - style Maintainer : Stability : Provisional Portability : Non - portable ( Win32 API ) Handling hard link using Win32 API . [ NTFS only ] N...
null
https://raw.githubusercontent.com/haskell/win32/931497f7052f63cb5cfd4494a94e572c5c570642/System/Win32/WindowsString/HardLink.hs
haskell
| NOTE: createHardLink is /flipped arguments/ to provide compatibility for Unix. If you want to create hard link by Windows way, use 'createHardLink'' instead. ^ Target file path ^ Hard link name ^ Hard link name ^ Target file path
# LANGUAGE CPP # | Module : System . Win32.HardLink Copyright : 2013 shelarcy License : BSD - style Maintainer : Stability : Provisional Portability : Non - portable ( Win32 API ) Handling hard link using Win32 API . [ NTFS only ] N...
3136c54a9cd5abb426935bae4ffb2bc314e506d03ad20f305cce0c9e31780ee2
ghc/testsuite
tcfail212.hs
# LANGUAGE ConstraintKinds , MagicHash # module ShouldFail where import GHC.Exts -- If we turn on ConstraintKinds the typing rule for -- tuple types is generalised. This test checks that -- we get a reasonable error for unreasonable tuples. f :: (Maybe, Either Int) f = (Just 1, Left 1) g :: (Int#, Int#) g = (1#, 2#...
null
https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/tcfail212.hs
haskell
If we turn on ConstraintKinds the typing rule for tuple types is generalised. This test checks that we get a reasonable error for unreasonable tuples.
# LANGUAGE ConstraintKinds , MagicHash # module ShouldFail where import GHC.Exts f :: (Maybe, Either Int) f = (Just 1, Left 1) g :: (Int#, Int#) g = (1#, 2#)
33ae967d71e0cade39525b61ffe846fdfca8c2d28fd9ecdd4a644209cfae38e1
donaldsonjw/bigloo
glo_def.scm
;*=====================================================================*/ * serrano / prgm / project / bigloo / comptime / Ast / glo_def.scm * / ;* ------------------------------------------------------------- */ * Author : * / * Creation ...
null
https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/comptime/Ast/glo_def.scm
scheme
*=====================================================================*/ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ * This module implement the functions used to def (define) a */ * global variable (i.e. i...
* serrano / prgm / project / bigloo / comptime / Ast / glo_def.scm * / * Author : * / * Creation : Mon Jun 3 09:17:44 1996 * / * Last change : Sun Jun 15 10:26:28 2014 ( serrano ) * / (module ...
6c51de76db3a5cc11931b219507206fa8a53300fe08bc8ae2664c0fe75efba78
spurious/sagittarius-scheme-mirror
parser.scm
(import (rnrs) (text yaml parser) (text yaml nodes) (srfi :127) (srfi :39) (srfi :64)) (test-begin "YAML parser") (define (test-yaml-parser expected input) (test-equal input expected (map yaml-document->canonical-sexp (parse-yaml (open-string-input-port input)))) (test-equal input expected ...
null
https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/tests/text/yaml/parser.scm
scheme
extra comma mapping corner cases we support null scalar only on explicit document (differ from PyYAML) resolver tests float omap etc.
(import (rnrs) (text yaml parser) (text yaml nodes) (srfi :127) (srfi :39) (srfi :64)) (test-begin "YAML parser") (define (test-yaml-parser expected input) (test-equal input expected (map yaml-document->canonical-sexp (parse-yaml (open-string-input-port input)))) (test-equal input expected ...
22673a37ae934c222572e85c14e4d75f2bc63df0e0df075a2b60839907ae78e6
roddyyaga/opium-heroku-example
main.ml
open Opium let handler req = Printf.sprintf "Hello, %s!\n" (Router.param req "name") |> Response.of_plain_text |> Lwt.return let port = Sys.getenv_opt "PORT" |> Option.value ~default:"3000" |> int_of_string let () = Logs.set_reporter (Logs_fmt.reporter ()); Logs.set_level (Some Logs.Info) let () = App.e...
null
https://raw.githubusercontent.com/roddyyaga/opium-heroku-example/30e0a441944b6d030d16a6591ffc96513a37b2d3/bin/main.ml
ocaml
open Opium let handler req = Printf.sprintf "Hello, %s!\n" (Router.param req "name") |> Response.of_plain_text |> Lwt.return let port = Sys.getenv_opt "PORT" |> Option.value ~default:"3000" |> int_of_string let () = Logs.set_reporter (Logs_fmt.reporter ()); Logs.set_level (Some Logs.Info) let () = App.e...
f87eb3d3286076745dfef023ad22933bc99f8ac1656e875a06c48222dc7637e6
runeksvendsen/bitcoin-payment-channel
Value.hs
# LANGUAGE FlexibleInstances # module PaymentChannel.Internal.Class.Value where import PaymentChannel.Internal.Payment.Types import PaymentChannel.Internal.Payment import PaymentChannel.Internal.Receiver.Types import Bitcoin.Types class HasValue a where valueOf :: a -> BtcAmount instance HasValue SignedPayment ...
null
https://raw.githubusercontent.com/runeksvendsen/bitcoin-payment-channel/3d2ee56c027571d1a86092c317640e5eae7adde3/src/PaymentChannel/Internal/Class/Value.hs
haskell
# LANGUAGE FlexibleInstances # module PaymentChannel.Internal.Class.Value where import PaymentChannel.Internal.Payment.Types import PaymentChannel.Internal.Payment import PaymentChannel.Internal.Receiver.Types import Bitcoin.Types class HasValue a where valueOf :: a -> BtcAmount instance HasValue SignedPayment ...
eefbe06fa0e93fed996087bfa80f1e2cc0486ebd38b3a6e5b0e6d0a851be42ba
randomseed-io/phone-number
net_code.clj
(ns ^{:doc "Global network calling codes handling for phone-number." :author "Paweł Wilk" :added "8.12.4-0"} phone-number.net-code (:require [clojure.set] [phone-number.util :as util]) (:import [com.google.i18n.phonenumbers PhoneNumberUtil NumberPar...
null
https://raw.githubusercontent.com/randomseed-io/phone-number/99ac91d5b89f3bca44db4d03b5e27e0999760908/src/phone_number/net_code.clj
clojure
Supported Global Network Calling Codes
(ns ^{:doc "Global network calling codes handling for phone-number." :author "Paweł Wilk" :added "8.12.4-0"} phone-number.net-code (:require [clojure.set] [phone-number.util :as util]) (:import [com.google.i18n.phonenumbers PhoneNumberUtil NumberPar...
999ca6bac07e863168f33b5136b05997e6d56a1067f490402743cc2a82e89d5c
sigscale/snmp-collector
snmp_collector_rest_accepted_content.erl
%%% snmp_collector_rest_accepted_content.erl %%% vim: ts=3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2016 - 2019 SigScale Global Inc. %%% @end Licensed under the Apache License , Version 2.0 ( the " License " ) ; %%% you may not use this file except in compliance with the Licens...
null
https://raw.githubusercontent.com/sigscale/snmp-collector/cb6b95ed331abd6f258d8ea55bf34c57f2992444/src/snmp_collector_rest_accepted_content.erl
erlang
snmp_collector_rest_accepted_content.erl vim: ts=3 @end you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied...
2016 - 2019 SigScale Global Inc. Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(snmp_collector_rest_accepted_content). -copyright('Copyright (c) 2016 - 2019 SigScale Global Inc.'). -export([do/1]). -include_lib(...
fcb22c176926b94b5e51d3ee3789a63b512e61bcdef4a70026e93767e530acd4
zkincaid/duet
dg.ml
(** Sequential dependence graphs *) open Core module Pack = Var.Set module FS = Lattice.FunctionSpace.Make(Pack)(Lattice.LiftSubset(Def.Set)) module G = Afg.G module S = Afg.Pack let construct file pack uses = (* Map access paths to their reaching definitions *) (** Reaching definitions analysis *) let module...
null
https://raw.githubusercontent.com/zkincaid/duet/eb3dbfe6c51d5e1a11cb39ab8f70584aaaa309f9/duet/dg.ml
ocaml
* Sequential dependence graphs Map access paths to their reaching definitions * Reaching definitions analysis Add a vertex and its incoming edges to the G, and add v -> rd to rd_map add all the vertices of a cfg to the G * Simplify a dependence graph let split_vertex v = (* don't split asserts! reduc...
open Core module Pack = Var.Set module FS = Lattice.FunctionSpace.Make(Pack)(Lattice.LiftSubset(Def.Set)) module G = Afg.G module S = Afg.Pack let construct file pack uses = let module RDInterp = struct include FS let transfer def rd = begin match Def.assigned_var def with | Some v -> FS.up...
52a286a70dc04c60797c6ed3fb265ed3eb6de150e5c5b88d5de3b0fbf95e5d8a
basho/riak_test
rt_util.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2013 Basho Technologies , Inc. %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may obtain %% a copy of the Li...
null
https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/src/rt_util.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2013 Basho Technologies , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(rt_util). -include_lib(...
e3a8a2f3c6d33194231f25cd8b5402174481ae956760ec9c354ae9518e2e685a
GaloisInc/msf-haskell
Scan.hs
-- |Extended functionality to interact with nmap. These functions are n't exported directly by the Metasploit server , but rather work -- by calling db_nmap on the console. Compose namp parameters thusly: -- /db_nmap (tcpSynScan <> tcpConnectScan)/ # LANGUAGE DataKinds # # LANGUAGE KindSignatures # module MSF.Scan (...
null
https://raw.githubusercontent.com/GaloisInc/msf-haskell/76cee10771f9e9d10aa3301198e09f08bde907be/src/MSF/Scan.hs
haskell
|Extended functionality to interact with nmap. These functions by calling db_nmap on the console. Compose namp parameters thusly: /db_nmap (tcpSynScan <> tcpConnectScan)/ XXX don't export, this works in all contexts. ^ nmap options | Run an nmap scan. Use "MSF.Event" to handle callbacks like 'MSF.Event.onHost'. ...
are n't exported directly by the Metasploit server , but rather work # LANGUAGE DataKinds # # LANGUAGE KindSignatures # module MSF.Scan ( db_nmap , NmapOptions() , customScan , emptyScan , serviceVersionScan , tcpSynScan , pingScan , sctpInitScan , tcpConnectScan , udpScan , tcpNullScan , f...
91ed846e847bdfc94fda3f00e41bb8038ebc0638056c3406dcbb416e2d0449c7
rd--/hsc3
rLoopSet.help.hs
--- Concurrent loops at a signal buffer Create a set of concurrent loops at a signal buffer . This is the static and composed variant of RFreezer . There are five global inputs , the buffer and then : left , right , gain and increment . The first two are initialization rate , the second two control ra...
null
https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/rLoopSet.help.hs
haskell
- ----|----|-----------------------|----|--------------| ----|----|-----------------------|----|--------------|
Concurrent loops at a signal buffer Create a set of concurrent loops at a signal buffer . This is the static and composed variant of RFreezer . There are five global inputs , the buffer and then : left , right , gain and increment . The first two are initialization rate , the second two control rate . ...
47068275b21ed875a55b6f961f97eb4a3e21725a72613694c0f7de8b79f7ba4f
mirage/mirage
mirage_impl_tracing.mli
type tracing = Functoria.job val tracing : tracing Functoria.typ val mprof_trace : size:int -> unit -> tracing Functoria.impl
null
https://raw.githubusercontent.com/mirage/mirage/479e40ae6aa1efe18fb1cd199cec0d5ee1f46f26/lib/mirage/impl/mirage_impl_tracing.mli
ocaml
type tracing = Functoria.job val tracing : tracing Functoria.typ val mprof_trace : size:int -> unit -> tracing Functoria.impl
c6ad98f280c0996196ae2793f562c46ecd0587a6fad997fae578be964b4a342f
chenyukang/eopl
classes.scm
(module classes (lib "eopl.ss" "eopl") (require "store.scm") (require "lang.scm") ;; object interface (provide object object? new-object object->class-name object->fields) ;; method interface (provide method method? a-method find-method) ;; class interface (provide lookup-class initialize-class-en...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter9/classes/classes.scm
scheme
object interface method interface class interface objects ;;;;;;;;;;;;;;;; an object consists of a symbol denoting its class, and a list of references representing the managed storage for the all the fields. new-object : ClassName -> Obj methods and method environments ;;;;;;;;;;;;;;;; method environments ;;;...
(module classes (lib "eopl.ss" "eopl") (require "store.scm") (require "lang.scm") (provide object object? new-object object->class-name object->fields) (provide method method? a-method find-method) (provide lookup-class initialize-class-env!) (define identifier? symbol?) (define-datatype objec...
8eb00ce8a8acb571bdca23ffac1418230a9ff5ce9a623054b6d3214d43f24106
ocaml-batteries-team/batteries-included
batUref.ml
* Uref -- unifiable references * Copyright ( C ) 2011 Batteries Included Development Team * * This library is free software ; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation ; either * version 2.1 o...
null
https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/f143ef5ec583d87d538b8f06f06d046d64555e90/src/batUref.ml
ocaml
Implements union-find with ranks and path-compression we use ?sel instead of ?(sel=(fun x _y -> x)) because we want to be able to know whether a selection function was passed, for optimization purposes: when sel is the default (expected common case), we can take a short path in the (ur == vr) case. ...
* Uref -- unifiable references * Copyright ( C ) 2011 Batteries Included Development Team * * This library is free software ; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation ; either * version 2.1 o...
5ad5a6450317ae5600eef27e988bbc38cf40cf23c6069cb6b832bc9e8d3c1d83
lykahb/groundhog
monadIntegration.hs
# LANGUAGE FlexibleContexts # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # import Control.Applicative (Applicative) import Control.Monad (liftM) import Control.Monad.Base (MonadBase (liftBase)) import Control.Monad.Fail (MonadFail (..)) import Control.Monad.IO.Cl...
null
https://raw.githubusercontent.com/lykahb/groundhog/146691a828db39932c8212cd68f732d74589e488/examples/monadIntegration.hs
haskell
here can be web business logics -- This instance extracts connection from our application state
# LANGUAGE FlexibleContexts # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # import Control.Applicative (Applicative) import Control.Monad (liftM) import Control.Monad.Base (MonadBase (liftBase)) import Control.Monad.Fail (MonadFail (..)) import Control.Monad.IO.Cl...
6455cef1ec2a84f51d5ea1d55673b1cc95d7e8e7747e1ef863353be20d418900
carl-eastlund/dracula
dracula-state.rkt
#lang racket (require "../proof/proof.rkt" "../acl2/acl2.rkt" "../acl2/rep.rkt" "../private/hash.rkt" "proof-state.rkt") ;; ====================================================================== ;; ;; DATA DEFINITION ;; ;; ==========================================================...
null
https://raw.githubusercontent.com/carl-eastlund/dracula/a937f4b40463779246e3544e4021c53744a33847/drscheme/dracula-state.rkt
racket
====================================================================== DATA DEFINITION ====================================================================== A DraculaState is: (make-dracula-state Action ProofTable) An Action is either: - #f - (make-error-action String) - (make-normal-action String) - (...
#lang racket (require "../proof/proof.rkt" "../acl2/acl2.rkt" "../acl2/rep.rkt" "../private/hash.rkt" "proof-state.rkt") where names : ( ) (define-struct dracula-state (action table) #:prefab) (define-struct action (desc) #:prefab) (define-struct (error-action action) () #:pre...
8bbc864506a60fecac440455700509371461bfffc01d52a4f9c43ef63b650edf
tek/ribosome
Text.hs
-- |Combinators for 'Text'. module Ribosome.Text where import Data.Char (toUpper) import qualified Data.Text as Text |Escape a single quote Neovim - style by replacing it with two single quotes . escapeQuote :: Char -> Text escapeQuote = \case '\'' -> "''" a -> Text.singleton a |Escape all single quo...
null
https://raw.githubusercontent.com/tek/ribosome/a676b4f0085916777bfdacdcc761f82d933edb80/packages/ribosome/lib/Ribosome/Text.hs
haskell
|Combinators for 'Text'.
module Ribosome.Text where import Data.Char (toUpper) import qualified Data.Text as Text |Escape a single quote Neovim - style by replacing it with two single quotes . escapeQuote :: Char -> Text escapeQuote = \case '\'' -> "''" a -> Text.singleton a |Escape all single quotes Neovim - style by replac...
fcd1983954e2c5827efbe4eb54faebcb9a8986f92dbd6c7464e27cb4f9f545c0
int-index/ether
T3.hs
module Regression.T3 (test3) where import Ether import qualified Control.Monad.Reader as T import qualified Control.Monad.State as T import Test.Tasty import Test.Tasty.QuickCheck data RTag data STag testMTL :: (T.MonadReader Int m, T.MonadState Int m) => m Int testMTL = do b <- T.get a <- T.ask T.put (a + b...
null
https://raw.githubusercontent.com/int-index/ether/84c1d560da241c8111d1a3c98d9a896f0c62087b/test/Regression/T3.hs
haskell
module Regression.T3 (test3) where import Ether import qualified Control.Monad.Reader as T import qualified Control.Monad.State as T import Test.Tasty import Test.Tasty.QuickCheck data RTag data STag testMTL :: (T.MonadReader Int m, T.MonadState Int m) => m Int testMTL = do b <- T.get a <- T.ask T.put (a + b...
8453df59285e17da0907176d1deb381f0070ea6339b82661e1258b037c4a86dd
Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library
PortalSubscriptionUpdate.hs
{-# LANGUAGE MultiWayIf #-} CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . {-# LANGUAGE OverloadedStrings #-} | Contains the types generated from the schema PortalSubscriptionUpdate module StripeAPI.Types.PortalSubscriptionUpdate whe...
null
https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PortalSubscriptionUpdate.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # # SOURCE # | Defines the object schema located at @components.schemas.portal_subscription_update@ in the specification. | default_allowed_updates: The types of subscription updates that are supported for items listed in the \`products\` attribute. When empty, sub...
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . | Contains the types generated from the schema PortalSubscriptionUpdate module StripeAPI.Types.PortalSubscriptionUpdate where import qualified Control.Monad.Fail import qualified Data.A...
beb4c3854dbba5d0fc47ad7b90322d023c0dd9393af59c209ae9e099c7e780c2
ibabushkin/hapstone
StorableSpec.hs
module Internal.SystemZ.StorableSpec where import Foreign import Foreign.C.Types import Test.Hspec import Test.QuickCheck import Hapstone.Internal.SystemZ import Internal.SystemZ.Default -- | main spec spec :: Spec spec = describe "Hapstone.Internal.SysZ" $ do syszOpMemStructSpec csSysZOpSpec csSysZSpe...
null
https://raw.githubusercontent.com/ibabushkin/hapstone/4ac11f0a1e23e5a0f23351149c70bd541ddf5344/test/Internal/SystemZ/StorableSpec.hs
haskell
| main spec | SysZOpMemStruct spec
module Internal.SystemZ.StorableSpec where import Foreign import Foreign.C.Types import Test.Hspec import Test.QuickCheck import Hapstone.Internal.SystemZ import Internal.SystemZ.Default spec :: Spec spec = describe "Hapstone.Internal.SysZ" $ do syszOpMemStructSpec csSysZOpSpec csSysZSpec getSyszOpMem...
983cbe89b20f370f888b6e8bf2f7742edf4a5833ef6cd0026df62a7bda809d21
wlitwin/graphv
graphv_anim.mli
type repeat = Count of int | Infinite type direction = Forward | Mirror of direction | Backward type reason = Done | Canceled type anim module Ease = Ease val create : ?delay:float -> ?ease:Ease.t -> ?complete:(int -> reason -> unit) -> ?repeat:repeat -> ?repeat_delay:float -> ?direction:direc...
null
https://raw.githubusercontent.com/wlitwin/graphv/1416fe1daaedc411e8b54e5458d6005d2d3678b5/graphv_anim/lib/graphv_anim.mli
ocaml
type repeat = Count of int | Infinite type direction = Forward | Mirror of direction | Backward type reason = Done | Canceled type anim module Ease = Ease val create : ?delay:float -> ?ease:Ease.t -> ?complete:(int -> reason -> unit) -> ?repeat:repeat -> ?repeat_delay:float -> ?direction:direc...
77dcb6acf3a1b605c7943fb158166cfe862d94977a691e6e1e8601fbb5faa604
unclebob/AdventOfCode2022
project.clj
(defproject day14-regolith-reservoir "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :main day14-regolith-reservoir.core :dependencies [[org.clojure/clojure "1.8.0"]] :profiles {:dev {:dependencies [[speclj "3.3.2"]]}} ...
null
https://raw.githubusercontent.com/unclebob/AdventOfCode2022/fa2eccadeca7be72db4ed4193e349ad18d5d533b/day14-regolith-reservoir/project.clj
clojure
(defproject day14-regolith-reservoir "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :main day14-regolith-reservoir.core :dependencies [[org.clojure/clojure "1.8.0"]] :profiles {:dev {:dependencies [[speclj "3.3.2"]]}} ...
c3797eba983f4cd89d6234888d401b8c5540ba92bf14b8b058280178b2347cf0
Stratus3D/programming_erlang_exercises
md5_cache.erl
-module(md5_cache). -behaviour(gen_server). -export([start_link/0, get_md5/1]). -include_lib("kernel/include/file.hrl"). -define(SERVER, ?MODULE). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start_link() -> gen_server:start_link({local, ?SE...
null
https://raw.githubusercontent.com/Stratus3D/programming_erlang_exercises/e4fd01024812059d338facc20f551e7dff4dac7e/chapter_16/exercise_5/md5_cache.erl
erlang
gen_server callbacks Callbacks Compute MD5 hash Get the last modified date of the file Update the server state with the cached MD5 sum and return the sum to the caller Check if the last modified date has changed If it has changed update the hash Otherwise return the cached MD5 hash
-module(md5_cache). -behaviour(gen_server). -export([start_link/0, get_md5/1]). -include_lib("kernel/include/file.hrl"). -define(SERVER, ?MODULE). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], [])....
63c56cffc47ce4eea333a4a2b48e983844d4351bded60e11bbb39d1bf1d4d391
wenkokke/dep2con
Dep2Bin.hs
module Language.Conversion.Dep2Bin where import Data.List (sortBy) import Language.POS (POS (..), toXP) import qualified Language.Structure.Binary as Bin import qualified Language.Structure.Dependency as Dep import Language.Word (Word (..)) -- |Convert dependency structures to binar...
null
https://raw.githubusercontent.com/wenkokke/dep2con/cd6cc985a9dbedd6b2991a85197481804a2a0d95/src/Language/Conversion/Dep2Bin.hs
haskell
|Convert dependency structures to binary constituency structures, ensuring that only the minimal number of projections are made.
module Language.Conversion.Dep2Bin where import Data.List (sortBy) import Language.POS (POS (..), toXP) import qualified Language.Structure.Binary as Bin import qualified Language.Structure.Dependency as Dep import Language.Word (Word (..)) collinsToledo :: Dep.Tree -> Bin.Tree coll...
9917e63695c2cec5b0ec5c9fa616cd7acc09702db8e7908b36dace81d607849a
fpco/stackage-server
Types.hs
# LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # module Stackage.Database.Types ( SnapName(..) , isLts , isNightly , SnapshotBranch(..) , snapshotPrettyName , snapshotPrettyNameShort , CompilerP(..) , FlagNameP(..) , Stac...
null
https://raw.githubusercontent.com/fpco/stackage-server/b707b5a0d72c44a3134a305b628c3f0b28db2697/src/Stackage/Database/Types.hs
haskell
QUESTION: Potentially switch to `parsePackageIdentifierRevision`: return (PantryCabal pn v sha size) Issues with such switch: * Implementation below is faster Split package identifier foo-bar-0.1.2 into package name and version ^ Info of the package on this page ^ If the package is available on hackage, show it...
# LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # module Stackage.Database.Types ( SnapName(..) , isLts , isNightly , SnapshotBranch(..) , snapshotPrettyName , snapshotPrettyNameShort , CompilerP(..) , FlagNameP(..) , Stac...
29cab1970be6c8bc6451347898a17989f1ec8cc1cd1f6a5bfd7094ea28b89d24
whalliburton/academy
turtle-graphics.lisp
(in-package :academy) (defvar *turtle*) (defstruct turtle x y heading bitmap pen) (defmacro with-turtle ((&optional (bitmap '*bitmap*)) &body body) `(destructuring-bind (height width) (array-dimensions ,bitmap) (let ((*turtle* (make-turtle :x (floor width 2) :y (floor height 2) :heading 0 ...
null
https://raw.githubusercontent.com/whalliburton/academy/87a1a13ffbcd60d8553e42e647c59486c761e8cf/turtle-graphics.lisp
lisp
(in-package :academy) (defvar *turtle*) (defstruct turtle x y heading bitmap pen) (defmacro with-turtle ((&optional (bitmap '*bitmap*)) &body body) `(destructuring-bind (height width) (array-dimensions ,bitmap) (let ((*turtle* (make-turtle :x (floor width 2) :y (floor height 2) :heading 0 ...
6d834bee88992414d73b1496c90c65dc1053cea5d0d6b13210af777c3bac70e9
OCamlPro/ocp-build
buildOCPInterp.ml
(**************************************************************************) (* *) (* Typerex Tools *) (* *) Copyrigh...
null
https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/tools/ocp-build/lang-ocp/buildOCPInterp.ml
ocaml
************************************************************************ Typerex Tools ...
Copyright 2011 - 2017 OCamlPro SAS the GNU General Public License version 3 described in the file open OcpCompat open BuildValue.TYPES open BuildOCPTree module Eval(S: sig type context val filesubst : (string * env list) BuildSubst.t val define_package...
08ca9900af80b0d3579e948b4f61e39c28d6af05dd79d6216710a95d4f399fb5
Dasudian/DSDIN
dsdc_db.erl
-module(dsdc_db). -export([check_db/0, % called from setup hook assumes started called in dsdcore app start phase tables/1, % for e.g. test database setup clear_db/0, % mostly for test purposes persisted_valid_genesis_block/0 ...
null
https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdcore/src/dsdc_db.erl
erlang
called from setup hook for e.g. test database setup mostly for test purposes Mimicking the dsdc_persistence API used by dsdc_conductor_chain Location of chain transactions Only to be used from dsdc_tx_pool:init/1 MP trees backend API for finding transactions related to account key indexing callbacks - transac...
-module(dsdc_db). assumes started called in dsdcore app start phase persisted_valid_genesis_block/0 ]). -export([transaction/1, ensure_transaction/1, write/2, delete/2, read/2]). -export([has_block/1, write_block/1, write_block_state/4, ...
cfd5afa0dea899f24eb910b4ce57443463a89bba429f66111b5bf8931abe0d48
esl/MongooseIM
mongoose_wpool_cassandra.erl
-module(mongoose_wpool_cassandra). -behaviour(mongoose_wpool). -export([init/0]). -export([start/4]). -export([stop/2]). -ifdef(TEST). -export([prepare_cqerl_opts/1]). -endif. %% -------------------------------------------------------------- %% mongoose_wpool callbacks -spec init() -> ok. init() -> {ok, []} = ap...
null
https://raw.githubusercontent.com/esl/MongooseIM/65be9ea048cc2cd3f52abf3483246076fae08327/src/wpool/mongoose_wpool_cassandra.erl
erlang
-------------------------------------------------------------- mongoose_wpool callbacks -------------------------------------------------------------- always set make the config survive the restart of 'cqerl_cluster' in case of a network failure
-module(mongoose_wpool_cassandra). -behaviour(mongoose_wpool). -export([init/0]). -export([start/4]). -export([stop/2]). -ifdef(TEST). -export([prepare_cqerl_opts/1]). -endif. -spec init() -> ok. init() -> {ok, []} = application:ensure_all_started(cqerl), application:set_env(cqerl, maps, true). -spec start(...
07dacaa1f8137b62491aa071f95b3eaf81a9b9df6d00a6c0d34a5182b44ce049
tuura/centrifuge
Parser.hs
# LANGUAGE OverloadedStrings , TypeFamilies # module Centrifuge.GraphML.Parser (parseGraphML) where import qualified Data.ByteString as BS import qualified Text.XML.Hexml as XML import qualified Algebra.Graph.Class as C import qualified Algebra.Graph.HigherKinded.Class ...
null
https://raw.githubusercontent.com/tuura/centrifuge/a89a1c9d6b60832d85dde6f0b747c7b5c54b91f5/src/Centrifuge/GraphML/Parser.hs
haskell
retrieve xml root node partition graph's children into nodes ant the rest (edges) construct the resulting graph
# LANGUAGE OverloadedStrings , TypeFamilies # module Centrifuge.GraphML.Parser (parseGraphML) where import qualified Data.ByteString as BS import qualified Text.XML.Hexml as XML import qualified Algebra.Graph.Class as C import qualified Algebra.Graph.HigherKinded.Class ...
855719f27c30c23632947191690dc2902f1f542fbb8feda9b59ed2c3fd5e2804
input-output-hk/cardano-rt-view
Style.hs
module Cardano.RTView.GUI.CSS.Style ( ownCSS ) where import Prelude hiding ((**)) import Clay import qualified Clay.Media as M import Clay.Selector (selectorFromText) import Data.Text (pack, unpack) import qualified Data.Text.Lazy as TL import Cardano.RTView....
null
https://raw.githubusercontent.com/input-output-hk/cardano-rt-view/0ff669a5acc8d81a35aa5a924cbb79978d0999a8/src/Cardano/RTView/GUI/CSS/Style.hs
haskell
To avoid shifting "labels-values" on mobile screens (for Pane mode). | Convert class name as a constructor to 'Selector'.
module Cardano.RTView.GUI.CSS.Style ( ownCSS ) where import Prelude hiding ((**)) import Clay import qualified Clay.Media as M import Clay.Selector (selectorFromText) import Data.Text (pack, unpack) import qualified Data.Text.Lazy as TL import Cardano.RTView....
d9e677bfed683719d02c3cd2ac6649f0ba329096c6b598d8b6ba17440b2f258c
nervous-systems/fink-nottle
util.cljc
(ns fink-nottle.internal.util (:require [clojure.walk :as walk] [fink-nottle.internal.platform :as platform :refer [->int]])) (defn attr-val-out [x] (let [x (cond-> x (keyword? x) name)] (cond (string? x) [:string x] (number? x) [:number (str x)] (platform/by...
null
https://raw.githubusercontent.com/nervous-systems/fink-nottle/4fe25f2d89dc272e70b16742bca82455e3a43edb/src/fink_nottle/internal/util.cljc
clojure
(ns fink-nottle.internal.util (:require [clojure.walk :as walk] [fink-nottle.internal.platform :as platform :refer [->int]])) (defn attr-val-out [x] (let [x (cond-> x (keyword? x) name)] (cond (string? x) [:string x] (number? x) [:number (str x)] (platform/by...
44b40b30b5ceaac106f8bee2160850665546b3ae853f030d8e19c3406e2c6374
RunOrg/RunOrg
i.mli
(* © 2014 RunOrg *) include Id.PHANTOM module Assert : sig val server_admin : 'a id -> [`ServerAdmin] id val person : 'a id -> [`Person] id end
null
https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/tokenLib/i.mli
ocaml
© 2014 RunOrg
include Id.PHANTOM module Assert : sig val server_admin : 'a id -> [`ServerAdmin] id val person : 'a id -> [`Person] id end
6fa4de7804b83997955541eef83a1c0a4e20c4599d7a22c837cdd3283062f012
racket/racket7
tethered-installer.rkt
#lang racket/base (require setup/dirs racket/file compiler/embed launcher) (provide installer) (define (installer path coll user? no-main?) (unless (or user? no-main?) (do-installer #f (find-config-tethered-console-bin-dir))) (do-installer #t (find-addon-tethered-console-bin-dir))) ...
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/racket/private/tethered-installer.rkt
racket
#lang racket/base (require setup/dirs racket/file compiler/embed launcher) (provide installer) (define (installer path coll user? no-main?) (unless (or user? no-main?) (do-installer #f (find-config-tethered-console-bin-dir))) (do-installer #t (find-addon-tethered-console-bin-dir))) ...
7dce8aff63cdbd0a55ca9d646c8d4c79b06349be402bc115c279c54e9332ece8
AccelerateHS/accelerate
Complex.hs
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE FlexibleInstances # # LANGUAGE GADTs # {-# LANGUAGE MagicHash #-} # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE PatternSynonyms #-} # LANGUAGE RebindableSyntax # {-# LANGUAGE ScopedTy...
null
https://raw.githubusercontent.com/AccelerateHS/accelerate/63e53be22aef32cd0b3b6f108e637716a92b72dc/src/Data/Array/Accelerate/Data/Complex.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE FlexibleContexts # # LANGUAGE MagicHash # # LANGUAGE PatternSynonyms # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeSynonymInstances # | Module : Data.Array.Accelerate.Data.Complex License : BSD3 Stability : experimental Comple...
# LANGUAGE FlexibleInstances # # LANGUAGE GADTs # # LANGUAGE MultiParamTypeClasses # # LANGUAGE RebindableSyntax # # LANGUAGE TypeApplications # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # # LANGUAGE ViewPatterns # # OPTIONS_GHC -fno - warn - orpha...
e1cbc808a93d39f795c2e4fba28b2490288f7085f6db84553cee9606add4e6fe
cram2/cram
vector-mean.lisp
Regression test VECTOR - MEAN for GSLL , automatically generated ;; Copyright 2009 , 2011 Distributed under the terms of the GNU General Public License ;; ;; 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 So...
null
https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/vector-mean.lisp
lisp
This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Publi...
Regression test VECTOR - MEAN for GSLL , automatically generated Copyright 2009 , 2011 Distributed under the terms of the GNU General Public License it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have rec...
6921b00db134a5d1b8426583995baad211b4bbadd62fffb2bc237b1f6347d219
boris-ci/boris
Schema.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # module Test.IO.Boris.Http.Db.Schema where import Control.Monad.Morph (hoist, lift) import qualified Boris.Http.Db.Schema as Schema import Boris.Prelude import Hedgehog import System...
null
https://raw.githubusercontent.com/boris-ci/boris/c321187490afc889bf281442ac4ef9398b77b200/boris-http/test/Test/IO/Boris/Http/Db/Schema.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # module Test.IO.Boris.Http.Db.Schema where import Control.Monad.Morph (hoist, lift) import qualified Boris.Http.Db.Schema as Schema import Boris.Prelude import Hedgehog import System.IO (IO) import Test.IO....
c3471ae4033805e98dfa4e5864b5b8daa38334fcbdfe13eac84dacbf2f2e369a
grin-compiler/grin
BinaryIR.hs
# LANGUAGE LambdaCase , RecordWildCards , Strict # module AbstractInterpretation.BinaryIR (encodeAbstractProgram) where import Control.Monad.State import Data.Set (Set) import qualified Data.Set as Set import Data.Map (Map) import qualified Data.Map as Map import qualified Data.ByteString.Lazy as LBS import Data.ByteS...
null
https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/src/AbstractInterpretation/BinaryIR.hs
haskell
block size, data --------------------------------- start block id commands intsets
# LANGUAGE LambdaCase , RecordWildCards , Strict # module AbstractInterpretation.BinaryIR (encodeAbstractProgram) where import Control.Monad.State import Data.Set (Set) import qualified Data.Set as Set import Data.Map (Map) import qualified Data.Map as Map import qualified Data.ByteString.Lazy as LBS import Data.ByteS...
2ebbd7aa3d3779dbdede0364b52ecdcb00350e9da44c9e4bd91e9f5e28b51bee
kendroe/CoqRewriter
lex.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REWRITELIB * * lex.ml * ...
null
https://raw.githubusercontent.com/kendroe/CoqRewriter/ddf5dc2ea51105d5a2dc87c99f0d364cf2b8ebf5/plugin/src/lex.ml
ocaml
require "list.sml" ; require "getfile.sml" ; require "basis.__integer" ;
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REWRITELIB * * lex.ml * ...
a0746d0f0c6ac137ebe7f0c70d74967bd686123e0989badcc2ed9c171620c467
jwiegley/trade-journal
Closings.hs
# LANGUAGE BlockArguments # # LANGUAGE DataKinds # {-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # {-# LANGUAGE DeriveTraversable #-} # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} # LANGUAGE LambdaCase # {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} {-# ...
null
https://raw.githubusercontent.com/jwiegley/trade-journal/a482dbcbc3ff97267d99e340845bf738545b9236/src/Journal/Closings.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE DeriveTraversable # # LANGUAGE GADTs # # LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # instance Splittable (Amount 6) Position where howmuch = posLot . amount instance Splittable (Amount 6) Closing where howmuch = closingLot . amount open a ...
# LANGUAGE BlockArguments # # LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # # LANGUAGE TypeOperators # # LANGUAGE Unde...
62ae7425019c313243b5f80b54868630370d6663a1855d61984af6d72ab0f726
jellelicht/guix
ocaml.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2013 < > Copyright © 2014 , 2015 < > Copyright © 2015 < > Copyright © 2015 < > Copyright © 2016 < > Copyright © 2016 Jan Nieuwenhuizen < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistri...
null
https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/ocaml.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 © 2013 < > Copyright © 2014 , 2015 < > Copyright © 2015 < > Copyright © 2015 < > Copyright © 2016 < > Copyright © 2016 Jan Nieuwenhuizen < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License al...
2aa532054d5046b91c527795f298b2411ee148db75c90da65783f8f37724d8f5
tisnik/clojure-examples
project.clj
; ( C ) Copyright 2018 , 2020 , 2021 ; ; All rights reserved. This program and the accompanying materials ; are made available under the terms of the Eclipse Public License v1.0 ; which accompanies this distribution, and is available at -v10.html ; ; Contributors: ; (defproject cucumber+expect8 ...
null
https://raw.githubusercontent.com/tisnik/clojure-examples/78061b533c0755d0165002961334bbe98d994087/cucumber%2Bexpect8/project.clj
clojure
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors:
( C ) Copyright 2018 , 2020 , 2021 -v10.html (defproject cucumber+expect8 "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.10.1"] [expectations "2.0....
f8fa4351f41e68ed8b6148c2536e0b0b79c4a357d1b6784ce04dd0b190011025
MaskRay/OJHaskell
53.hs
prob53 n = loop 0 [1] 0 where loop m l ans | m > n = ans | otherwise = loop (m+1) (zipWith (+) (0:l) $ reverse (0:l)) (ans + length (filter (> 1000000) l)) main = print . prob53 $ 100
null
https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Project%20Euler/53.hs
haskell
prob53 n = loop 0 [1] 0 where loop m l ans | m > n = ans | otherwise = loop (m+1) (zipWith (+) (0:l) $ reverse (0:l)) (ans + length (filter (> 1000000) l)) main = print . prob53 $ 100
b4489deab2668161fbb35bb7481e2e48dd4f29b09b4aadb30fc2cf908b36494d
Bogdanp/koyo
cors.rkt
#lang racket/base (require koyo/cors koyo/testing rackunit web-server/http) (provide cors-tests) (define handler (wrap-cors (lambda (req) (response/xexpr #:headers (list (make-header #"X-Test" #"Custom")) '(h1 "Hello"))))) (define cors-tests (test-suite "cors" ...
null
https://raw.githubusercontent.com/Bogdanp/koyo/93f3fd06ee596a62bb0b286cb6290a800e911154/koyo-test/koyo/cors.rkt
racket
#lang racket/base (require koyo/cors koyo/testing rackunit web-server/http) (provide cors-tests) (define handler (wrap-cors (lambda (req) (response/xexpr #:headers (list (make-header #"X-Test" #"Custom")) '(h1 "Hello"))))) (define cors-tests (test-suite "cors" ...
e4d299f9b0a62b713535cde15a817ebf61cafcc27735e993f5885c6d552756a7
eigenhombre/clj-org
util_test.clj
(ns clj-org.util-test (:require [clojure.test :refer [are deftest is testing]] [clj-org.test-util :refer [should=]] [clj-org.util :refer :all])) (deftest vec*-test (are [inp expected] (is (= expected (apply vec* inp))) [:p ()] [:p] [:p (range 4)] [:p 0 1 2 3])) (defn- always ...
null
https://raw.githubusercontent.com/eigenhombre/clj-org/46a1ead7ec28e931ff489c1d0b2b47d3d4a479be/test/clj_org/util_test.clj
clojure
(ns clj-org.util-test (:require [clojure.test :refer [are deftest is testing]] [clj-org.test-util :refer [should=]] [clj-org.util :refer :all])) (deftest vec*-test (are [inp expected] (is (= expected (apply vec* inp))) [:p ()] [:p] [:p (range 4)] [:p 0 1 2 3])) (defn- always ...
45a8aef3de60cbb5b421e87a062ae1af3091b62acd3ebef659e83d60aeb6643e
andrejbauer/alg
cook.ml
(* A simple compiler from abstract syntax to the internal representation. *) type env = { const : (Theory.operation_name * Theory.operation) list ; unary : (Theory.operation_name * Theory.operation) list ; binary : (Theory.operation_name * Theory.operation) list ; predicates : (Theory.relation_name * Theory.re...
null
https://raw.githubusercontent.com/andrejbauer/alg/95715bb1bf93fcc534a8d6c7c96c8913dc03de0c/src/cook.ml
ocaml
A simple compiler from abstract syntax to the internal representation. The free variables of a term, without repetitions. The free variables of a formula, without repetitions. The depth of the formula is the maximum level of nesting of quantifiers.
type env = { const : (Theory.operation_name * Theory.operation) list ; unary : (Theory.operation_name * Theory.operation) list ; binary : (Theory.operation_name * Theory.operation) list ; predicates : (Theory.relation_name * Theory.relation) list ; relations : (Theory.relation_name * Theory.relation) list ; ...
db3c8cfb3a0c41dfa9c4750dbe68861d74d8d80aa9a2d3556fbbde9bdc813d08
Helium4Haskell/helium
RightSection.hs
module RightSection where test :: [Int] test = filter (False ==) [1..10]
null
https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/typeerrors/Examples/RightSection.hs
haskell
module RightSection where test :: [Int] test = filter (False ==) [1..10]
2788e065f815de586c14310dea04121445f08a4316d6e52bbdb2ab59e25aab7f
ocaml/merlin
includemod.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/ocaml/merlin/c447386d83522b26eb359d489eb6f5b7488203a5/src/ocaml/typing/includemod.ml
ocaml
************************************************************************ OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Misc open Typedtree open Types type symptom = | Value_descriptions of Ident.t * value_descriptio...
2aacc7821889560bc5a5a328d392d329ff46b6a1011d2a039a288fdc9ab61359
bjornbm/astro
Celestrak.hs
# LANGUAGE FlexibleContexts # module Astro.Celestrak where import Numeric.Units.Dimensional.Prelude import Astro.Time import Astro.Time.Interop import Data.Char (isSpace) import Data.Maybe (fromJust) import Data.Ratio import Data.List (isPrefixOf) import Data.Time import Data.Time.Clock.TAI import qualified Prelude a...
null
https://raw.githubusercontent.com/bjornbm/astro/f4fb2c4b739a0a8f68f51aa154285120d2230c30/src/Astro/Celestrak.hs
haskell
Celestrak ========= | Returns the UTC day that the epoch occurs on. The following are subject to extraction to a util module if they turn out to be useful elsewhere.
# LANGUAGE FlexibleContexts # module Astro.Celestrak where import Numeric.Units.Dimensional.Prelude import Astro.Time import Astro.Time.Interop import Data.Char (isSpace) import Data.Maybe (fromJust) import Data.Ratio import Data.List (isPrefixOf) import Data.Time import Data.Time.Clock.TAI import qualified Prelude a...
87c98f1f34155134518f14035e7662cb92f32fe70cfa06bcd330bc8dbeb905ef
AvisoNovate/rook
arg_resolvers.clj
(ns io.aviso.rook.arg-resolvers "Built-in implementations and support functions for argument resolver generators." {:added "0.2.2"}) (defn non-nil-arg-resolver "Returns an arg resolver that extracts a value nested in the context. The value must be non-nil, or an exception is thrown. sym : The symbol for ...
null
https://raw.githubusercontent.com/AvisoNovate/rook/a752ce97f39a5c52301dd1866195f463817a1ed7/src/io/aviso/rook/arg_resolvers.clj
clojure
identified in the exception. This catches the typical default cause where the meta value is true, typically meaning the ^:my-resolver format was used. In that situation, convert the symbol name to an unqualified keyword.
(ns io.aviso.rook.arg-resolvers "Built-in implementations and support functions for argument resolver generators." {:added "0.2.2"}) (defn non-nil-arg-resolver "Returns an arg resolver that extracts a value nested in the context. The value must be non-nil, or an exception is thrown. sym ks : a sequenc...
0a28017790202ba540cea12212fe83e5d410f668e83bf3010f4490080d8e58df
shiguredo/eryngii
conf.ml
open Core.Std let version = "0.1" let debug_mode = ref false let verbose_mode = ref false let debug f = if !debug_mode then printf ("# " ^^ f ^^ "\n") else Printf.ifprintf stderr f let verbose f = if !verbose_mode || !debug_mode then printf ("# " ^^ f ^^ "\n") else Printf.ifprintf stderr f ...
null
https://raw.githubusercontent.com/shiguredo/eryngii/6c70d9b28a45ed786c4847ee51bb03bfef35ac8d/conf.ml
ocaml
open Core.Std let version = "0.1" let debug_mode = ref false let verbose_mode = ref false let debug f = if !debug_mode then printf ("# " ^^ f ^^ "\n") else Printf.ifprintf stderr f let verbose f = if !verbose_mode || !debug_mode then printf ("# " ^^ f ^^ "\n") else Printf.ifprintf stderr f ...
8159bea3f713f5a10ecc497bbc78467477c8be30889f6e147a5d1ada5e29ca60
Liqwid-Labs/plutus-extra
Main.hs
{ - # LANGUAGE TemplateHaskell # - } module ( main ) where import qualified as GHC import PlutusCore . Data qualified as Data import PlutusTx . IsCoexistingData ( makeCoexistingIsData ) import PlutusTx . IsData . Class ( fromData , toData ) import PlutusTx . Prelude import Test . QuickCheck ( Proper...
null
https://raw.githubusercontent.com/Liqwid-Labs/plutus-extra/347dd304e9b580d1747439a888bfaa79f1c5a25e/plutus-extra/test/is-data-tagged/Main.hs
haskell
import Test.QuickCheck.Arbitrary (Arbitrary (arbitrary, shrink)) import Test.QuickCheck.Gen qualified as Gen import Test.QuickCheck.Instances.ByteString () import Test.Tasty.QuickCheck (QuickCheckTests (QuickCheckTests), testProperty) main :: Prelude.IO () main = defaultMain allTests where allTests :: Tes...
{ - # LANGUAGE TemplateHaskell # - } module ( main ) where import qualified as GHC import PlutusCore . Data qualified as Data import PlutusTx . IsCoexistingData ( makeCoexistingIsData ) import PlutusTx . IsData . Class ( fromData , toData ) import PlutusTx . Prelude import Test . QuickCheck ( Proper...
b631b8ee4710c727df778ef394dc954780456a30539776f740fca40d81f00787
Tim-ats-d/Indigobi
backend.ml
open Import module type S = sig val get : ?bypass:Gemini.Request.bypass -> url:string -> host:string -> port:int -> cert:Tls.Config.own_cert option -> float -> (Mime.t * string, [> Err.back | Gemini.Status.err ]) Lwt_result.t val cert_from_file : string -> (Tls.Config.own_cert opti...
null
https://raw.githubusercontent.com/Tim-ats-d/Indigobi/c936f8ad2e044cdce25ae631b86cdec818654696/src/backend.ml
ocaml
open Import module type S = sig val get : ?bypass:Gemini.Request.bypass -> url:string -> host:string -> port:int -> cert:Tls.Config.own_cert option -> float -> (Mime.t * string, [> Err.back | Gemini.Status.err ]) Lwt_result.t val cert_from_file : string -> (Tls.Config.own_cert opti...
5fa702e7afb5da427d18b436002ad8c9194687fe0ee560bafb30c1d4f18d74ab
ylgrgyq/resilience-for-clojure
interval_function_test.clj
(ns resilience.interval-function-test (:require [clojure.test :refer :all] [resilience.interval-function :refer :all]) (:import (java.util.concurrent ThreadLocalRandom) (io.github.resilience4j.core IntervalFunction))) (deftest test-default-interval-function (is (= 500 (.apply (default-inte...
null
https://raw.githubusercontent.com/ylgrgyq/resilience-for-clojure/7b0532d1c72d416020402c15eb5699143be4b7bf/test/resilience/interval_function_test.clj
clojure
(ns resilience.interval-function-test (:require [clojure.test :refer :all] [resilience.interval-function :refer :all]) (:import (java.util.concurrent ThreadLocalRandom) (io.github.resilience4j.core IntervalFunction))) (deftest test-default-interval-function (is (= 500 (.apply (default-inte...
61b3d165cc5241b284ecb2e12e4506a7d4d136286633a4ccf5e30d5ba910e1a7
tvh/hasql-migration
MigrationTest.hs
-- | -- Module : Database.PostgreSQL.Simple.MigrationTest Copyright : ( c ) 2016 < > , ( c ) 2014 < > -- -- License : BSD-style -- Maintainer : -- Stability : experimental Portability : GHC -- -- A collection of hasql-migration specifications. {-# LANGUAGE OverloadedStrings #...
null
https://raw.githubusercontent.com/tvh/hasql-migration/58c90f7c5c0e829708c35db9d2c8bc47e86621eb/test/Hasql/MigrationTest.hs
haskell
| Module : Database.PostgreSQL.Simple.MigrationTest License : BSD-style Maintainer : Stability : experimental A collection of hasql-migration specifications. # LANGUAGE OverloadedStrings #
Copyright : ( c ) 2016 < > , ( c ) 2014 < > Portability : GHC module Hasql.MigrationTest where import Hasql.Session (run, QueryError) import Hasql.Connection import qualified Hasql.Transaction as Tx import qualified Hasql.Tra...
bcd2d8e92a7ac28cd7df0c505fbec78519aff6a8011830881286367e5d47e177
nominolo/lambdachine
Gc03.hs
# LANGUAGE NoImplicitPrelude , MagicHash , BangPatterns # -- RUN: %bc_vm_chk CHECK : @Result@ IND - > GHC.Bool . True`con_info module Bc.Gc03 where import GHC.Prim import GHC.List import GHC.Types import GHC.Base -- Tests GCing of PAPs. # NOINLINE f # f :: Int# -> [Box] -> [Box] f 0# acc = acc f n acc = let !val...
null
https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/Gc03.hs
haskell
RUN: %bc_vm_chk Tests GCing of PAPs. Creates a PAP
# LANGUAGE NoImplicitPrelude , MagicHash , BangPatterns # CHECK : @Result@ IND - > GHC.Bool . True`con_info module Bc.Gc03 where import GHC.Prim import GHC.List import GHC.Types import GHC.Base # NOINLINE f # f :: Int# -> [Box] -> [Box] f 0# acc = acc f n acc = let !val = boxit n silly in let !acc' = val : acc...
42886aba66b510973f211d56a4eacc32a3f4faf8cb50ae94e329a1d8eefa9f1b
finnishtransportagency/harja
palaute.cljs
(ns harja.tiedot.palaute (:require [clojure.string :as string] [harja.ui.ikonit :as ikonit] [clojure.string :as str] [reagent.core :refer [atom]] [harja.tiedot.istunto :as istunto] [harja.asiakas.tapahtumat :as t] [harja.pvm :as pvm])) (def sahk...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/b170a01ade578034392716f8ba91f08cfe130809/src/cljs/harja/tiedot/palaute.cljs
clojure
(ns harja.tiedot.palaute (:require [clojure.string :as string] [harja.ui.ikonit :as ikonit] [clojure.string :as str] [reagent.core :refer [atom]] [harja.tiedot.istunto :as istunto] [harja.asiakas.tapahtumat :as t] [harja.pvm :as pvm])) (def sahk...
0a8163d262cddb7b38d29f9f7562a59fc5d9abdbf79d41ddbc52c07dfb52c560
susanemcg/pandoc-tufteLaTeX2GitBook
Org.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE GeneralizedNewtypeDeriving # Copyright ( C ) 2014 > 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 ...
null
https://raw.githubusercontent.com/susanemcg/pandoc-tufteLaTeX2GitBook/00c34b4299dd89c4e339e1cde006061918b559ab/pandoc-1.12.4.2/src/Text/Pandoc/Readers/Org.hs
haskell
# LANGUAGE OverloadedStrings # ^ Reader options ^ String to parse (assuming @'\n'@ line endings) | Org-mode parser state The version Text.Pandoc.Parsing cannot be used, as we need additional parts of the state saved and restored. Adaptions and specializations of parsing utilities parsing blocks Org Block...
# LANGUAGE GeneralizedNewtypeDeriving # Copyright ( C ) 2014 > 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 versio...
8e03d985257c69541fd08d53d0e559a3984c30c1de7c49b3834c3c6326c05bc5
SimulaVR/godot-haskell
NetworkedMultiplayerPeer.hs
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.NetworkedMultiplayerPeer (Godot.Core.NetworkedMultip...
null
https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/NetworkedMultiplayerPeer.hs
haskell
| Emitted when a connection attempt fails. | Emitted when a connection attempt succeeds. | Emitted by the server when a client connects. | Emitted by the server when a client disconnects. | Emitted by clients when the server disconnects. | Returns the ID of the @NetworkedMultiplayerPeer@ who sent the most recent ...
# LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving , TypeFamilies , TypeOperators , FlexibleContexts , DataKinds , MultiParamTypeClasses # TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, MultiParamTypeClasses #-} module Godot.Core.NetworkedMultiplayerPeer (Godot.Core.NetworkedMultip...
e84f67e6141665febc35315e3afbde1f8f6c18acb57d9e85b7f6017c2d56dc6d
Verites/verigraph
FindCospanCommuterTest.hs
module Data.TypedGraph.Morphism.FindMorphismSpec.FindCospanCommuterTest (findCospanCommuterTest) where import Abstract.Category import Abstract.Category.FindMorphism import Category.TypedGraph () import Data.Graphs import qualified Data.Graphs.Morphism ...
null
https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/tests/Data/TypedGraph/Morphism/FindMorphismSpec/FindCospanCommuterTest.hs
haskell
| Tests with only nodes | Tests with edges | Tests with loops | TypedGraphMorphism instances. Digraphs with only nodes | TypedGraphMorphism instances. Digraphs with only nodes | TypedGraphMorphism instances. Digraphs with loops | Graphs instances for tests | Digraphs with only nodes 1 [shape = circle]; } ...
module Data.TypedGraph.Morphism.FindMorphismSpec.FindCospanCommuterTest (findCospanCommuterTest) where import Abstract.Category import Abstract.Category.FindMorphism import Category.TypedGraph () import Data.Graphs import qualified Data.Graphs.Morphism ...
9b989a8df15c737bb24df35e3d70ec8666caa6cbe0ee66e99f763f8acc35156d
k16shikano/hpdft
Outlines.hs
{-# LANGUAGE OverloadedStrings #-} | Module : PDF.Outlines Description : Function to get /Outlines object Copyright : ( c ) , 2016 License : MIT Maintainer : Function to grub /Outlines in PDF trailer . It mainly provides texts for Table of Contents . Module : PDF.Outlines Descrip...
null
https://raw.githubusercontent.com/k16shikano/hpdft/20d5b0a89d144c72a56ec8b4adb1b7735e7cd66c/src/PDF/Outlines.hs
haskell
# LANGUAGE OverloadedStrings #
| Module : PDF.Outlines Description : Function to get /Outlines object Copyright : ( c ) , 2016 License : MIT Maintainer : Function to grub /Outlines in PDF trailer . It mainly provides texts for Table of Contents . Module : PDF.Outlines Description : Function to get /Outlines ob...
56d20ed939d32b005110fc4bbbea6f8691a1f473cf85661aff253a7567794d36
gedge-platform/gedge-platform
syslog_monitor.erl
%%%============================================================================= Copyright 2013 - 2017 , < > %%% %%% Permission to use, copy, modify, and/or distribute this software for any %%% purpose with or without fee is hereby granted, provided that the above %%% copyright notice and this permission notice ap...
null
https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/syslog/src/syslog_monitor.erl
erlang
============================================================================= Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. WITH REGARD TO THIS SOFTWA...
Copyright 2013 - 2017 , < > THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN -module(syslog_monitor). -behaviour(gen_server). -export([...
a762c40c1a6a351b47aed72aa62463ce040029434c1bd75105741113c6382c99
wdhowe/clojure-snippets
infinite_seqs.clj
;; Using infinite sequences. ; repeat - return a lazy infinite seq (println "Using repeat\n" (concat (take 3 (repeat "eckee")) ["pakang zoop boing!"])) ; repeatedly - call provided function lazily (as many times as needed) (println "\nGet random numbers with repeatedly\n" (take 5 (repeatedly (fn [] (rand-int 100)...
null
https://raw.githubusercontent.com/wdhowe/clojure-snippets/0c3247ce99a563312b549d03f080b8cf449b541d/seq_col_funcs/infinite_seqs.clj
clojure
Using infinite sequences. repeat - return a lazy infinite seq repeatedly - call provided function lazily (as many times as needed)
(println "Using repeat\n" (concat (take 3 (repeat "eckee")) ["pakang zoop boing!"])) (println "\nGet random numbers with repeatedly\n" (take 5 (repeatedly (fn [] (rand-int 100)))))
02428d1c7f217d9276c7ed0a1e7cf426bf387afa7b1a70390d356f4ad6b98ec7
nionita/Barbarossa
FileParams.hs
module Eval.FileParams ( makeEvalState, fileToState ) where import Data . ( isSpace ) import Data.List (tails, intersperse) import System.Directory import Struct.Status(EvalState) import Struct.Config import Eval.Eval (initEvalState) Opens a parameter file for eval , read it and create a...
null
https://raw.githubusercontent.com/nionita/Barbarossa/81032b17ac36dc01771cbcfaaae88c30e7661d7b/Eval/FileParams.hs
haskell
putStrLn $ "makeEvalState: " ++ show argfile config file as argument putStrLn $ "This is the file " ++ fn ++ ":" ++ fCont putStrLn $ "This is state: " ++ show ies This produces a list of config file names depending on program version and programm version suffix
module Eval.FileParams ( makeEvalState, fileToState ) where import Data . ( isSpace ) import Data.List (tails, intersperse) import System.Directory import Struct.Status(EvalState) import Struct.Config import Eval.Eval (initEvalState) Opens a parameter file for eval , read it and create a...
9b1517b889c57d229030fdd6bd5604342893e9059910491a4ef9504e724f9b35
takikawa/racket-ppa
front.rkt
#lang racket/base (require (prefix-in is: data/integer-set) racket/list syntax/stx "util.rkt" "stx.rkt" "re.rkt" "deriv.rkt") (provide build-lexer) (define-syntax time-label (syntax-rules () ((_ l e ...) (begin (prin...
null
https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/share/pkgs/parser-tools-lib/parser-tools/private-lex/front.rkt
racket
A table is either - (vector-of (union #f nat)) dfa->1d-table : dfa -> (same as build-lexer) char-table : (vector-of (union #f nat)) Each entry specifies a state to transition to. #f indicates no transition Fill the char-table vector dfa->actions : dfa -> (vector-of (union #f syntax-object)) The action for each...
#lang racket/base (require (prefix-in is: data/integer-set) racket/list syntax/stx "util.rkt" "stx.rkt" "re.rkt" "deriv.rkt") (provide build-lexer) (define-syntax time-label (syntax-rules () ((_ l e ...) (begin (prin...
2fa506fd2c620e78ede470d29b71014c1f6d58d3719775ddaba1e07db30dc82c
qkrgud55/ocamlmulti
io.ml
(* Test a file copy function *) let test msg funct f1 f2 = print_string msg; print_newline(); funct f1 f2; if Sys.command ("cmp " ^ f1 ^ " " ^ f2) = 0 then print_string "passed" else print_string "FAILED"; print_newline() (* File copy with constant-sized chunks *) let copy_file sz infile ofile = let ic...
null
https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/testsuite/tests/basic-io-2/io.ml
ocaml
Test a file copy function File copy with constant-sized chunks File copy with random-sized chunks File copy line per line Backward copy, with lots of seeks Create long lines of text The test
let test msg funct f1 f2 = print_string msg; print_newline(); funct f1 f2; if Sys.command ("cmp " ^ f1 ^ " " ^ f2) = 0 then print_string "passed" else print_string "FAILED"; print_newline() let copy_file sz infile ofile = let ic = open_in_bin infile in let oc = open_out_bin ofile in let buffer = St...
bcb698568885ae01ccdcd1e13de1c985487602f05405b344863a40f0793ba723
cndreisbach/clojure-web-dev-workshop
views.clj
(ns we-owe.views (:require [clojure.pprint :refer [pprint]] [we-owe.debts :refer [simplify balances]])) (defn- pstr [obj] (with-out-str (pprint obj))) (defn index-page [db] (let [debts (:debts @db)] (str "Balances:\n" (pstr (balances debts)) "\n\nAll debts: \n" (pstr (...
null
https://raw.githubusercontent.com/cndreisbach/clojure-web-dev-workshop/95d9fdf94b39f8a1e408b8bf75a81b92899ee7d9/code/02-compojure/src/we_owe/views.clj
clojure
(ns we-owe.views (:require [clojure.pprint :refer [pprint]] [we-owe.debts :refer [simplify balances]])) (defn- pstr [obj] (with-out-str (pprint obj))) (defn index-page [db] (let [debts (:debts @db)] (str "Balances:\n" (pstr (balances debts)) "\n\nAll debts: \n" (pstr (...
8cf601b29e297c87709f3b5cd162f3791592d98f8857d405c270e8ed28cc623a
ServiceNow/picard
Pets1.hs
{-# LANGUAGE OverloadedStrings #-} module Language.SQL.SpiderSQL.Pets1 where import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Language.SQL.SpiderSQL.TestItem (TestItem (..)) import Picard.Types (ColumnType (..), SQLSchema (..)) pets1Schema :: SQLSchema pets1Schema = let col...
null
https://raw.githubusercontent.com/ServiceNow/picard/6a252386bed6d4233f0f13f4562d8ae8608e7445/picard/tests/Language/SQL/SpiderSQL/Pets1.hs
haskell
# LANGUAGE OverloadedStrings #
module Language.SQL.SpiderSQL.Pets1 where import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Language.SQL.SpiderSQL.TestItem (TestItem (..)) import Picard.Types (ColumnType (..), SQLSchema (..)) pets1Schema :: SQLSchema pets1Schema = let columnNames = HashMap.fromList [("1", ...
9a60d0f09d2638c94b3b9df0a2644c3e971399535b993f9f5c355c490eb0025d
andrejbauer/kmeans
algorithms.ml
open Distances let rec select key k lst = match lst with | [] -> [] | x :: xs -> let ys, zs = List.partition (key x) xs in let l = List.length ys in if k < l then select key k ys else if k > l then (x::ys) @ (select key (k-...
null
https://raw.githubusercontent.com/andrejbauer/kmeans/9d4de9b6261b4e18ee486e36badbb8cc8ea3b224/alpha2/algorithms.ml
ocaml
open Distances let rec select key k lst = match lst with | [] -> [] | x :: xs -> let ys, zs = List.partition (key x) xs in let l = List.length ys in if k < l then select key k ys else if k > l then (x::ys) @ (select key (k-...
53dc3114a2e6904185bab3fb141a5a0be9b38557bca42f68496cad14cc2b79ef
Octachron/codept
a.ml
type t = Space
null
https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/tests/complex/alias_values/a.ml
ocaml
type t = Space
85eb0e3f3fd953aeef862e0e6d4fba9be7acb2a56598a560aceeb4cca04cc75e
fourmolu/fourmolu
default-signatures-simple-four-out.hs
module Main where -- | Something. class Foo a where -- | Foo foo :: a -> String default foo :: (Show a) => a -> String foo = show
null
https://raw.githubusercontent.com/fourmolu/fourmolu/f47860f01cb3cac3b973c5df6ecbae48bbb4c295/data/examples/declaration/class/default-signatures-simple-four-out.hs
haskell
| Something. | Foo
module Main where class Foo a where foo :: a -> String default foo :: (Show a) => a -> String foo = show
b057de9128b049cfb5c2467b88135bbb81eb5ee431e58bfa7067949d3fb2177c
nnichols/nature
core.cljc
(ns nature.core (:require [nature.initialization-operators :as io] [nature.population-operators :as po] [nature.monitors :as monitors])) (defn evolve "Create and evolve a population under the specified conditions until a termination criteria is reached `allele-set` is a collection of lega...
null
https://raw.githubusercontent.com/nnichols/nature/6cc1e9f0627b330245602773313b8c60630d3330/src/nature/core.cljc
clojure
(ns nature.core (:require [nature.initialization-operators :as io] [nature.population-operators :as po] [nature.monitors :as monitors])) (defn evolve "Create and evolve a population under the specified conditions until a termination criteria is reached `allele-set` is a collection of lega...
2af135e1aee8e5df4f1d1190d63d14ca23013d356e1988075681977e10aedfb3
smeruelo/mooc-ocaml
w5_6.1_mutable_lists.ml
type 'a xlist = { mutable pointer : 'a cell } and 'a cell = | Nil | List of 'a * 'a xlist ;; let nil () = { pointer = Nil } ;; let cons elt rest = { pointer = List (elt, rest) } ;; exception Empty_xlist ;; let head l = match l.pointer with | Nil -> raise Empty_xlist | List (hd, tl) -> hd let tail l...
null
https://raw.githubusercontent.com/smeruelo/mooc-ocaml/8e2efb1632ec9dd381489a08465d5341a6c727c9/week5/w5_6.1_mutable_lists.ml
ocaml
Using the provided functions
type 'a xlist = { mutable pointer : 'a cell } and 'a cell = | Nil | List of 'a * 'a xlist ;; let nil () = { pointer = Nil } ;; let cons elt rest = { pointer = List (elt, rest) } ;; exception Empty_xlist ;; let head l = match l.pointer with | Nil -> raise Empty_xlist | List (hd, tl) -> hd let tail l...
99c77f1d679405d4de567c31b53a9de95b2a7facd073ed247606bd7f8c9b9f4e
csabahruska/jhc-components
Numeric.hs
module Numeric(fromRat, showSigned, showIntAtBase, showInt, showOct, showHex, readSigned, readInt, readDec, readOct, readHex, floatToDigits, showEFloat, showFFloat, showGFloat, showFloat, readFloat, lexDigits) where...
null
https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/lib/jhc/Numeric.hs
haskell
This converts a rational to a floating. This should be used in the Fractional instances of Float and Double. Handle exceptional cases first . Conversion process : Scale the rational number by the RealFloat base until it lies in the range of the mantissa ( as used by decodeFloat / encodeFloat ) . Then roun...
module Numeric(fromRat, showSigned, showIntAtBase, showInt, showOct, showHex, readSigned, readInt, readDec, readOct, readHex, floatToDigits, showEFloat, showFFloat, showGFloat, showFloat, readFloat, lexDigits) where...
f30fcd098538d89aa9abedeb557218b5293ad2c7ed6630566aeff8807c769ecb
AbstractMachinesLab/rebar3_caramel
caramel_readme_app.erl
%%%------------------------------------------------------------------- %% @doc caramel_readme public API %% @end %%%------------------------------------------------------------------- -module(caramel_readme_app). -behaviour(application). -export([start/2, stop/1]). start(_StartType, _StartArgs) -> caramel_readm...
null
https://raw.githubusercontent.com/AbstractMachinesLab/rebar3_caramel/79370f504599d6bc040b8da02642c8f7fcd365cb/examples/caramel_readme/apps/caramel_readme/src/caramel_readme_app.erl
erlang
------------------------------------------------------------------- @doc caramel_readme public API @end ------------------------------------------------------------------- internal functions
-module(caramel_readme_app). -behaviour(application). -export([start/2, stop/1]). start(_StartType, _StartArgs) -> caramel_readme_sup:start_link(). stop(_State) -> ok.
72a0f46f98163f89fd13cc9d9202883a8b3ab705069034fa7d93806b614b5dab
reactiveml/rml
viewer_js.ml
Graph viewer * Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot * * 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 , ...
null
https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/js-of-ocaml/examples/graph_viewer/viewer_js.ml
ocaml
** We do not want to disable the default action on mouse down (here, keyboard focus) in this example. Firebug.console##time(Js.string "loading"); Firebug.console##timeEnd(Js.string "loading"); Firebug.console##time(Js.string "parsing"); Firebug.console##timeEnd(Js.string "parsing"); ...
Graph viewer * Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot * * 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 , ...
bf89ea9009cef50853e1c98ff3474daad35cda4535da41f4b7ae3bd0edaf4125
haskell-tools/haskell-tools
InCompStmt.hs
# LANGUAGE ParallelListComp # module InCompStmt where {-# ANN module "HLint: ignore Redundant list comprehension" #-} xs = [ [ (x,y) | x <- [1..10] | y <- [1..10] ] | z <- [1..10] ] {-* ParallelListComp *-} ys = [ z | z <- [ (x,y) | x <- [1..10] | y <- [1..10] ] ] {-* ParallelListComp *-} zs = [ [ (x,y) | x <- [1...
null
https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/test/ExtensionOrganizerTest/ParallelListCompTest/InCompStmt.hs
haskell
# ANN module "HLint: ignore Redundant list comprehension" # * ParallelListComp * * ParallelListComp * * ParallelListComp, ParallelListComp *
# LANGUAGE ParallelListComp # module InCompStmt where
1b67884ec3235a652f8ff79d81977ed8a2f5ba8f492c33d6d76131fdcae02072
wireapp/wire-server
Event_user.hs
# LANGUAGE OverloadedLists # -- This file is part of the Wire Server implementation. -- Copyright ( C ) 2022 Wire Swiss GmbH < > -- -- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , e...
null
https://raw.githubusercontent.com/wireapp/wire-server/9ab536b4c4915c9a0442c7643f8f78eb953a0217/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_user.hs
haskell
This file is part of the Wire Server implementation. This program is free software: you can redistribute it and/or modify it under later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTI...
# LANGUAGE OverloadedLists # Copyright ( C ) 2022 Wire Swiss GmbH < > the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any You should have received a copy of the GNU Affero General Public License along mo...
5bfc7b1211cc068ad939f935da26fd47c52c6b86156391ca747f15ff2ade5ca7
rabbitmq/rabbitmq-erlang-client
amqp_selective_consumer.erl
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. %% Copyright ( c ) 2011 - 2020 VMware , Inc. or its affiliates . All rights reserved . %% %% @doc This module is an implementation of the a...
null
https://raw.githubusercontent.com/rabbitmq/rabbitmq-erlang-client/2022e01c515d93ed1883e9e9e987be2e58fe15c9/src/amqp_selective_consumer.erl
erlang
@doc This module is an implementation of the amqp_gen_consumer opening AMQP channels. This is the default implementation selected by channel. <br/> <br/> The Consumer parameter for this implementation is {{@module}, []@}<br/> This consumer implementation keeps track of consumer tags and sends the subscription-...
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. Copyright ( c ) 2011 - 2020 VMware , Inc. or its affiliates . All rights reserved . behaviour and can be used as part of the Consumer par...
5ab4b34d18c50af9b53eb4bed3b3fc6e9fcabdde8f212fbff4bf2aaf92e9e8b2
aiya000/hs-character-cases
Cases.hs
{-# LANGUAGE ConstraintKinds #-} # LANGUAGE PatternSynonyms # # LANGUAGE QuasiQuotes # -- | Exposes naming cases. module Data.String.Cases where import Cases.Megaparsec import Data.Char.Cases import qualified Data.String as String import Data.Text.Prettyprint.Doc (Pretty(..)) import Language.Haskell.TH import Languag...
null
https://raw.githubusercontent.com/aiya000/hs-character-cases/3b6156310e7a68ee1ad514f8bc6f590c3c1000a3/src/Data/String/Cases.hs
haskell
# LANGUAGE ConstraintKinds # | Exposes naming cases. $setup >>> :set -XQuasiQuotes | >>> [pascalQ|Pascal|] | Non empty names ".+" | Makes a non empty string from String on the compile time. Also throws compile error if the empty string is passed. >>> [nonEmptyQ|x|] >>> [nonEmptyQ|foo|] >>> [nonEmptyQ|Ba...
# LANGUAGE PatternSynonyms # # LANGUAGE QuasiQuotes # module Data.String.Cases where import Cases.Megaparsec import Data.Char.Cases import qualified Data.String as String import Data.Text.Prettyprint.Doc (Pretty(..)) import Language.Haskell.TH import Language.Haskell.TH.Quote (QuasiQuoter(..)) import qualified Text.M...
701c4ff791658ecff442af7967c3089d499e0f7a0567dba35069900f886ce5a0
fccm/glMLite
stencil.ml
Copyright ( c ) , 1994 . ( c ) Copyright 1993 , Silicon Graphics , Inc. * ALL RIGHTS RESERVED * Permission to use , copy , modify , and distribute this software for * any purpose and without fee is hereby granted , provided that the above * copyright notice appear in all copies and that both the cop...
null
https://raw.githubusercontent.com/fccm/glMLite/c52cd806909581e49d9b660195576c8a932f6d33/RedBook-Samples/stencil.ml
ocaml
!!! NOTE !!! * * This demo is poorly written. The stencil buffer should be * redrawn in display(), not in the reshape() function. * The reason is if the window gets "damaged" then the stencil buffer * contents will be in an undefined state (reshape is not called when * a window is damaged and needs to be redraw...
Copyright ( c ) , 1994 . ( c ) Copyright 1993 , Silicon Graphics , Inc. * ALL RIGHTS RESERVED * Permission to use , copy , modify , and distribute this software for * any purpose and without fee is hereby granted , provided that the above * copyright notice appear in all copies and that both the cop...
4f92ad2866e219377721318b50bf3b3195d807c9e3973fbea03de9cfd3f2e57b
juspay/atlas
Main.hs
| Copyright 2022 Juspay Technologies Pvt Ltd 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 dis...
null
https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/mock-sms/server/Main.hs
haskell
| Copyright 2022 Juspay Technologies Pvt Ltd 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 dis...
e1a5ac65610f8037340394c4c74b04b5976322ed6928c8ddca4335f11c73e052
potapenko/playphraseme-site
delete_user.clj
(ns playphraseme.api.route-functions.user.delete-user (:require [playphraseme.api.queries.user.registered-user :as users] [ring.util.http-response :as respond])) (defn delete-user "Delete a user by ID" [id] (let [deleted-user (users/delete-registered-user! {:id id})] (if (not= 0 deleted-user) ...
null
https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/api/route_functions/user/delete_user.clj
clojure
(ns playphraseme.api.route-functions.user.delete-user (:require [playphraseme.api.queries.user.registered-user :as users] [ring.util.http-response :as respond])) (defn delete-user "Delete a user by ID" [id] (let [deleted-user (users/delete-registered-user! {:id id})] (if (not= 0 deleted-user) ...
bbb7319f7c616c70d25fa2266c9e6dd550e4b038cd52815aaf2525f7d75c2a82
shayan-najd/NativeMetaprogramming
T11824.hs
import Type main :: IO () main = return ()
null
https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/typecheck/T11824/T11824.hs
haskell
import Type main :: IO () main = return ()
1839d050a3473ffb93413b089d04d79134ec40d1b8fe82b693b53cbd64c6d440
nyu-acsys/drift
repeat4.ml
let succ sx = sx + 1 let rec repeat (rf: int -> int) rn = if rn = 0 then 0 else rf (repeat rf (rn - 1)) let main_p (n:int) = assert (repeat succ n = n) let main (w:unit) = let _ = main_p 15 in let _ = for i = 1 to 1000000 do main ( Random.int 1000 ) done for i = 1 to 1000000 do...
null
https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks_call/r_type/high/repeat4.ml
ocaml
let succ sx = sx + 1 let rec repeat (rf: int -> int) rn = if rn = 0 then 0 else rf (repeat rf (rn - 1)) let main_p (n:int) = assert (repeat succ n = n) let main (w:unit) = let _ = main_p 15 in let _ = for i = 1 to 1000000 do main ( Random.int 1000 ) done for i = 1 to 1000000 do...
d884e0a90789911e89c69072e88b1ae193f80e35e708afa5cfb2335551cf3e3e
avisi/rsync
core.clj
(ns avisi.rsync.core (:require [avisi.rsync.location :as l] [avisi.rsync.local-dir :as dir] [avisi.rsync.s3-bucket :as s3] [amazonica.aws.s3 :as aws-s3] [clojure.tools.logging :as log] [clojure.data :as data] [clojure.string :as str])) (defn con...
null
https://raw.githubusercontent.com/avisi/rsync/e8b6b440b6a51bf7001fa602d6dc367f13942699/src/avisi/rsync/core.clj
clojure
(ns avisi.rsync.core (:require [avisi.rsync.location :as l] [avisi.rsync.local-dir :as dir] [avisi.rsync.s3-bucket :as s3] [amazonica.aws.s3 :as aws-s3] [clojure.tools.logging :as log] [clojure.data :as data] [clojure.string :as str])) (defn con...
cbc5c1e0d293553100ca6a0720ddef29976da052a64b4637b9ece12e563de404
mzp/scheme-abc
link.ml
open Base open Swflib.AbcType let method_sigs n ms = List.map (fun m -> {m with method_sig= n + m.method_sig} ) ms let link a1 a2 = let ctx = {| int = (+) @@ List.length a1.cpool.int; uint = (+) @@ List.length a1.cpool.uint; double = (+) @@ List.length a1.cpool.double; string ...
null
https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/link/link.ml
ocaml
open Base open Swflib.AbcType let method_sigs n ms = List.map (fun m -> {m with method_sig= n + m.method_sig} ) ms let link a1 a2 = let ctx = {| int = (+) @@ List.length a1.cpool.int; uint = (+) @@ List.length a1.cpool.uint; double = (+) @@ List.length a1.cpool.double; string ...
f23fb1e4b2653ecc8f99fe9193930bdd06dae3abbff893c7c90efe6c0686a75c
klarna-incubator/bec
bec_project_t.erl
%%============================================================================== Type definition for the Project data structure %%============================================================================== -module(bec_project_t). %%============================================================================== %% ...
null
https://raw.githubusercontent.com/klarna-incubator/bec/b090bfbeeff298b4fc40e16a9da217f2ce404844/src/bec_project_t.erl
erlang
============================================================================== ============================================================================== ============================================================================== Exports ==========================================================================...
Type definition for the Project data structure -module(bec_project_t). -export([ from_map/1, to_map/1]). -include("bitbucket.hrl"). -type project() :: #{ }. -export_type([ project/0 ]). -spec from_map(map()) -> project(). from_map(#{}) -> #{}. -spec to_map(project()) -> map(). to_map(#{}) -> #{...
06c4b716d40e31660950f09b573068e00fddfe8bbf6c388b8f2fd3f9bb426558
tmcgilchrist/airship
Headers.hs
{-# LANGUAGE RankNTypes #-} module Airship.Headers ( addResponseHeader , modifyResponseHeaders ) where import Airship.Types (Webmachine, ResponseState(..)) import Control.Monad.State.Class (modify) import Network.HTTP.Types (ResponseHeaders, Header) -- | Applies the given function to the 'ResponseHeaders...
null
https://raw.githubusercontent.com/tmcgilchrist/airship/e946ac322f5f9ec0ceebcee593caacc9ea0b05ec/airship/src/Airship/Headers.hs
haskell
# LANGUAGE RankNTypes # | Applies the given function to the 'ResponseHeaders' present in this handlers 'ResponseState'.
module Airship.Headers ( addResponseHeader , modifyResponseHeaders ) where import Airship.Types (Webmachine, ResponseState(..)) import Control.Monad.State.Class (modify) import Network.HTTP.Types (ResponseHeaders, Header) modifyResponseHeaders :: Monad m => (ResponseHeaders -> ResponseHeaders) -> Webmach...
d53f2ce217d9ae9a0dbd426fafd338de2011699ee5f0f490b73c21de2129cb2f
logicmoo/wam_common_lisp
dlap.lisp
-*-Mode : LISP ; Package:(PCL LISP 1000 ) ; ; Syntax : Common - lisp -*- ;;; ;;; ************************************************************************* Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation . ;;; All rights reserved. ;;; ;;; Use and copying of this software and preparation of d...
null
https://raw.githubusercontent.com/logicmoo/wam_common_lisp/4396d9e26b050f68182d65c9a2d5a939557616dd/prolog/wam_cl/src/pcl/dlap.lisp
lisp
Package:(PCL LISP 1000 ) ; ; Syntax : Common - lisp -*- ************************************************************************* All rights reserved. Use and copying of this software and preparation of derivative works based upon this software are permitted. Any distribution of this States export control law...
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation . software or derivative works must comply with all applicable United This software is made available AS IS , and Xerox Corporation makes no CommonLoops Coordinator Xerox PARC 3333 Coyote Hill Rd . Palo Alto , CA 94304 ( o...
26bd6c6cc9223914609f24623fe473b6eeff87f6e99ef7557e16fc81ddddf7f4
input-output-hk/cardano-sl
BiSerialize.hs
{-# LANGUAGE DeriveAnyClass #-} # LANGUAGE TemplateHaskell # module Test.Pos.Binary.BiSerialize ( tests ) where import Universum import Hedgehog (Property) import qualified Hedgehog as H import Pos.Binary.Class (Cons (..), Field (..), cborError, deriveIndex...
null
https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/binary/test/Test/Pos/Binary/BiSerialize.hs
haskell
# LANGUAGE DeriveAnyClass # ------------------------------------------------------------------------------ Since `deriveSimpleBi` no longer works on sum types, we cannot do a simple comparison property between `deriveSimpleBi` and `deriveIndexedBi`. Instead, this module contains golden tests. The tests were generat...
# LANGUAGE TemplateHaskell # module Test.Pos.Binary.BiSerialize ( tests ) where import Universum import Hedgehog (Property) import qualified Hedgehog as H import Pos.Binary.Class (Cons (..), Field (..), cborError, deriveIndexedBi) import Test.Pos.B...
11e84b343a70522a45c4f5d7f6bad8e8f90a9201b088b5c7c54fdae3ff92e2fa
YouyouCong/ppl-summer-school-2022
everyone.ml
(* 単語の意味 *) let john = "john" ;; let mary = "mary" ;; let love obj sbj = "love(" ^ sbj ^ ", " ^ obj ^ ")" ;; let know obj sbj = "know(" ^ sbj ^ ", " ^ obj ^ ")" ;; let everyone x = ... ;; テスト loves everyone let test1 = reset (fun () -> love (everyone "x") john) = "forall x. love(john, x)" ;; knows everyone...
null
https://raw.githubusercontent.com/YouyouCong/ppl-summer-school-2022/876e70d40a1cb7f8b16fb4985fd6dccb50f48601/cong/exercise/everyone.ml
ocaml
単語の意味
let john = "john" ;; let mary = "mary" ;; let love obj sbj = "love(" ^ sbj ^ ", " ^ obj ^ ")" ;; let know obj sbj = "know(" ^ sbj ^ ", " ^ obj ^ ")" ;; let everyone x = ... ;; テスト loves everyone let test1 = reset (fun () -> love (everyone "x") john) = "forall x. love(john, x)" ;; knows everyone let test2 =...
023f314b3a5fd701f90a43209315e972db3a93e7a7ab774e399e59d22844226e
LeventErkok/sbv
IteTest.hs
----------------------------------------------------------------------------- -- | Module : TestSuite . Basics . IteTest Copyright : ( c ) -- License : BSD3 -- Maintainer: -- Stability : experimental -- Test various incarnations of laziness in ite ---------------------------------------------------------...
null
https://raw.githubusercontent.com/LeventErkok/sbv/0d791d9f4d1de6bd915b6d7d3f9a550385cb27a5/SBVTestSuite/TestSuite/Basics/IteTest.hs
haskell
--------------------------------------------------------------------------- | License : BSD3 Maintainer: Stability : experimental --------------------------------------------------------------------------- # OPTIONS_GHC -Wall -Werror # Test suite
Module : TestSuite . Basics . IteTest Copyright : ( c ) Test various incarnations of laziness in ite module TestSuite.Basics.IteTest(tests) where import Data.SBV.Internals (Result) import Utils.SBVTestFramework chk1 :: (SBool -> SBool -> SBool -> SBool) -> SWord8 -> SBool chk1 cond x = cond (x .== x) ...