_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 |
|---|---|---|---|---|---|---|---|---|
df1832a91c52e0b5d9dc31529121563e2c628b8e2fa8791b14ccc82a030fe91a | camllight/camllight | frx_font.mli | value version : string;;
value find : string -> string -> string -> int -> string;;
| null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk4/frx/frx_font.mli | ocaml | value version : string;;
value find : string -> string -> string -> int -> string;;
| |
6d009690dbbb5ae57bf6099db705376fe1ac59ee501d988ba1ee3cd7f951133f | joearms/adapter_pattern | mochiweb_adapter.erl | -module(mochiweb_adapter).
-compile(export_all).
start_link([{port,Port},{handler,F}]) ->
Z = mochiweb_http:start_link([{port, Port},
{loop, {?MODULE, handle_http, [F]}}
]),
ok.
handle_http(Req, F) ->
case (catch F({?MODULE, Req})) of
{'EXIT', Why} ->
io:format("EXIT:~p~n",[Why]);
X ->
... | null | https://raw.githubusercontent.com/joearms/adapter_pattern/f9cf77b6326daa47a4e401405d11953e2afc7547/mochiweb_adapter.erl | erlang | -module(mochiweb_adapter).
-compile(export_all).
start_link([{port,Port},{handler,F}]) ->
Z = mochiweb_http:start_link([{port, Port},
{loop, {?MODULE, handle_http, [F]}}
]),
ok.
handle_http(Req, F) ->
case (catch F({?MODULE, Req})) of
{'EXIT', Why} ->
io:format("EXIT:~p~n",[Why]);
X ->
... | |
9d2cb918656004ec035679ec2f76046bdcddd976529a2fcee8a3e90b7c747365 | billstclair/trubanc-lisp | testfuns.lisp | (in-package :crypto-tests)
(defun hex-string-to-byte-array (string &key (start 0) (end nil))
This function disappears from profiles if SBCL can inline the
;; POSITION call, so declare SPEED high enough to trigger that.
(declare (type string string) (optimize (speed 2)))
(let* ((end (or end (length string)))
... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/ironclad_0.26/testfuns.lisp | lisp | POSITION call, so declare SPEED high enough to trigger that.
test vector files
cipher testing
encryption mode consistency checking
digest testing routines
mac testing routines | (in-package :crypto-tests)
(defun hex-string-to-byte-array (string &key (start 0) (end nil))
This function disappears from profiles if SBCL can inline the
(declare (type string string) (optimize (speed 2)))
(let* ((end (or end (length string)))
(length (/ (- end start) 2))
(key (make-array leng... |
a667da5d217c2d8c7f93c4e20c8fd587224aed1d4ac56a61098a832165d12f8d | hellonico/origami-fun | take_one.clj | (ns opencv4.video.take-one
(:require
[opencv4.core :refer :all]
[opencv4.utils :as u]
[opencv4.video :refer :all]
))
(def capture (new-videocapture))
(.set capture CAP_PROP_FRAME_WIDTH 400)
(.set capture CAP_PROP_FRAME_HEIGHT 300)
;(.open capture 0)
(defn capture-one
([] (capture-one 1000 true))
... | null | https://raw.githubusercontent.com/hellonico/origami-fun/80117788530d942eaa9a80e2995b37409fa24889/test/opencv4/video/take_one.clj | clojure | (.open capture 0)
need some time or polling before the camera is ready
(.isOpened capture) | (ns opencv4.video.take-one
(:require
[opencv4.core :refer :all]
[opencv4.utils :as u]
[opencv4.video :refer :all]
))
(def capture (new-videocapture))
(.set capture CAP_PROP_FRAME_WIDTH 400)
(.set capture CAP_PROP_FRAME_HEIGHT 300)
(defn capture-one
([] (capture-one 1000 true))
([wait-ms open-clo... |
e8c27424529e0b8f56b442222b9cbf7085f603bff025ec6821109808ed8620d5 | GaloisInc/semmc | Strata.hs | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
| This is the main entry point to the stochastic synthesis ( SS )
--
-- Client code shou... | null | https://raw.githubusercontent.com/GaloisInc/semmc/3d9bc90f92a7f7ef59ff4943369dea9c0eb4b3ae/semmc-learning/src/SemMC/Stochastic/Strata.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
Client code should only need to import this module in order to run the
stochastic synthesis.
* Statistics
Goal: Have a basic setup function to establish the environment (e.g., parse the
base set and build a worklist). The caller should be able to pass that
environment t... | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
| This is the main entry point to the stochastic synthesis ( SS )
module SemMC.Stochastic.Strata (
SynEnv,
Config(..),
withInitialSta... |
3517cf16fd368ba2f5f02228e935207a6f78bf64186d9a567ba41993cec74d31 | johnwhitington/camlpdf | pdffun.ml | open Pdfutil
open Pdfio
(* Types *)
(* Postscript calculator functions. *)
type calculator =
| If of calculator list
| IfElse of calculator list * calculator list
| Bool of bool
| Float of float
| Int of int32
| Abs | Add | Atan | Ceiling | Cos | Cvi | Cvr
| Div | Exp | Floor | Idiv | Ln | Log | Mod
|... | null | https://raw.githubusercontent.com/johnwhitington/camlpdf/cee7dc2e3604d6e47a358584a14a2efebb31dc9d/pdffun.ml | ocaml | Types
Postscript calculator functions.
Sampled functions.
Interpolation functions.
Stitching functions.
Collect the above types into a single type.
Main type.
Printing functions
Build a string of a calculator function. For debug only, since could exceed
string length limit.
Print a function out for d... | open Pdfutil
open Pdfio
type calculator =
| If of calculator list
| IfElse of calculator list * calculator list
| Bool of bool
| Float of float
| Int of int32
| Abs | Add | Atan | Ceiling | Cos | Cvi | Cvr
| Div | Exp | Floor | Idiv | Ln | Log | Mod
| Mul | Neg | Round | Sin | Sqrt | Sub | Truncate
... |
28a9ba02217acd79fa75fed7bbef39fe7944350e41deac24194a3667f5c36bde | patricoferris/ocaml-multicore-monorepo | ptime_clock_top.ml | (* Module intentionally left empty *)
| null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/ptime/src-os/ptime_clock_top.ml | ocaml | Module intentionally left empty | |
776a6c28ff7539f6d01f0769bcae374b26328c1267c893a92f08d1905524c218 | llvm-hs/llvm-hs-examples | Arith.hs | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Main where
import Control.DeepSeq (NFData, force)... | null | https://raw.githubusercontent.com/llvm-hs/llvm-hs-examples/7308a4c063b17946aa55f18468ba63f62ac95b4a/arith/Arith.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
* Core expression type
| An expression will be any value of type @'Fix' 'ExprF'@, which
has as values arbitrarily nested applications of constructors from
'ExprF'. This is equivalent to just having an 'Expr type with... | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
module Main where
import Control.DeepSeq (NFData, force)
import Control.Exception
import Control.Monad
import Control.Monad.IO.Class
import Data.ByteString (ByteStr... |
8ecf74923635854960453546c22bddde0a46fad655a20c50c788daf63738b871 | pedestal/pedestal | service.clj | (ns chain-providers.service
(:require [io.pedestal.http :as http])
(:import (java.nio ByteBuffer)
(java.net InetSocketAddress)
(org.eclipse.jetty.server Request
Server)
(org.eclipse.jetty.server.handler AbstractHandler)
(javax.servlet.... | null | https://raw.githubusercontent.com/pedestal/pedestal/d20065013abf5d3793ae5301e18a2398707fa2a9/samples/chain-providers/src/chain_providers/service.clj | clojure | This is where you'd build a context and execute interceptors
This provider doesn't use a routing interceptor
etc.
When it is a function, that function is the server function
In the default template, this key is left blank to
get the default chain provider (the
servlet-interceptor).
Here we override it to a cu... | (ns chain-providers.service
(:require [io.pedestal.http :as http])
(:import (java.nio ByteBuffer)
(java.net InetSocketAddress)
(org.eclipse.jetty.server Request
Server)
(org.eclipse.jetty.server.handler AbstractHandler)
(javax.servlet.... |
13f280b6a33b1872e5025ecc889697d381444ce8a91c2a33ca7bff9c271c7ec0 | RisingFisan/Programacao-Funcional | Ficha05.hs | Exercicio 1
any' :: (a -> Bool) -> [a] -> Bool
any' f [] = False
any' f (h:t) = f h || any' f t
zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' f (a:as) (b:bs) = f a b : zipWith' f as bs
zipWith' _ _ _ = []
takeWhile' :: (a -> Bool) -> [a] -> [a]
takeWhile' _ [] = []
takeWhile' f (h:t) | f h = h : takeWhil... | null | https://raw.githubusercontent.com/RisingFisan/Programacao-Funcional/fb52a6f256a60e129d8a46e2aa0b36d86117155a/Fichas/Ficha05.hs | haskell | Exercicio 1
any' :: (a -> Bool) -> [a] -> Bool
any' f [] = False
any' f (h:t) = f h || any' f t
zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' f (a:as) (b:bs) = f a b : zipWith' f as bs
zipWith' _ _ _ = []
takeWhile' :: (a -> Bool) -> [a] -> [a]
takeWhile' _ [] = []
takeWhile' f (h:t) | f h = h : takeWhil... | |
152cb027800dfc3d28bf4ea2b172f722cf16905be0c19c262a52990465398acd | atgreen/lisp-openshift | ripemd-160.lisp | ;;;; ripemd-160.lisp -- the RIPEMD-160 digest function
(in-package :crypto)
(define-digest-registers (ripemd-160 :endian :little)
(a #x67452301)
(b #xefcdab89)
(c #x98badcfe)
(d #x10325476)
(e #xc3d2e1f0))
(defconst +pristine-ripemd-160-registers+ (initial-ripemd-160-regs))
(defun update-ripemd-160-block ... | null | https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/ironclad_0.30/src/digests/ripemd-160.lisp | lisp | ripemd-160.lisp -- the RIPEMD-160 digest function
Fill with 0 bit padding
Create new fully 0 padded block
Add 64bit message bit length
Flush last block
Done, remember digest for later calls |
(in-package :crypto)
(define-digest-registers (ripemd-160 :endian :little)
(a #x67452301)
(b #xefcdab89)
(c #x98badcfe)
(d #x10325476)
(e #xc3d2e1f0))
(defconst +pristine-ripemd-160-registers+ (initial-ripemd-160-regs))
(defun update-ripemd-160-block (regs block)
(declare (type ripemd-160-regs regs)
... |
eef349f3c8caec728e55ef62882955dd3da9b2b73b6b6dd5fcecfe308cdf115b | DogLooksGood/holdem | engine.clj | (ns poker.game.engine
"Implementations of game engine."
(:require
[poker.game.event-handler :as eh]
[poker.game.protocols :as p]
[poker.specs :as specs]
[clojure.spec.alpha :as s]
[clojure.tools.logging :as log]))
(def default-game-opts
{:sb 100,
:bb ... | null | https://raw.githubusercontent.com/DogLooksGood/holdem/fddc99c25b004647b5d4e5cbe56bdcb4e18ac9a0/src/clj/poker/game/engine.clj | clojure | game engine status
current button seat: integer
player-ids in this game: [player-id]
player data: player-id -> Player, check `poker.game.model/Player`
game options, check `default-game-opts`
game properties, contains `game/id` `game/title`
remain cards
bet for this street
next event dispatch to engine immediat... | (ns poker.game.engine
"Implementations of game engine."
(:require
[poker.game.event-handler :as eh]
[poker.game.protocols :as p]
[poker.specs :as specs]
[clojure.spec.alpha :as s]
[clojure.tools.logging :as log]))
(def default-game-opts
{:sb 100,
:bb ... |
8b4879db686290f4a43ed9132b3cf8b9123037dfd41d0241fc7cbb4511901e3b | ariesteam/aries | coastal_storm_protection.clj | Copyright 2010
;;;
This file is part of clj - span .
;;;
;;; clj-span is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation , either version 3 of the License ,
;;; or (at your option) any later version.
;;;
;;;... | null | https://raw.githubusercontent.com/ariesteam/aries/b3fafd4640f4e7950fff3791bc4ea4c06ee4dcdf/plugins/org.integratedmodelling.aries.core/bindings/clojure/clj_span/models/coastal_storm_protection.clj | clojure |
clj-span is free software: you can redistribute it and/or modify
or (at your option) any later version.
clj-span 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 Public Lic... | Copyright 2010
This file is part of clj - span .
it under the terms of the GNU General Public License as published
by the Free Software Foundation , either version 3 of the License ,
You should have received a copy of the GNU General Public License
along with clj - span . If not , see < / > .
Project... |
59d84417c9f42453cb7ed1fbdb3c8a5ff659355e1f83ad017c8f80de5cd6f4bd | Tim-ats-d/Laius | slide.mli | type t = TitleSlide | TocSlide of { heading : string } | Slide of slide
and slide = { title : string; text : Text.t list }
val title : t
val toc : heading:string -> t
val slide : title:string -> text:Text.t list -> t
val collect_header : t -> string option
val render : Context.t -> t -> LTerm_widget.box
| null | https://raw.githubusercontent.com/Tim-ats-d/Laius/feb8336fe72751b28fa574ed9e9d3d06c9e13843/src/slide.mli | ocaml | type t = TitleSlide | TocSlide of { heading : string } | Slide of slide
and slide = { title : string; text : Text.t list }
val title : t
val toc : heading:string -> t
val slide : title:string -> text:Text.t list -> t
val collect_header : t -> string option
val render : Context.t -> t -> LTerm_widget.box
| |
4525aa2802430ab3042d53d0eeb741751662fabbbc4d3a859a584de7ac8057a9 | digitallyinduced/ihp | RouterSupportSpec.hs | {-|
Module: Test.RouterSupportSpec
Tests for typed auto routing.
-}
# LANGUAGE AllowAmbiguousTypes #
module Test.RouterSupportSpec where
import qualified Prelude
import ClassyPrelude
import Test.Hspec
import IHP.Test.Mocking
import IHP.Prelude
import IHP.QueryBuilder
import IHP.Environment
import IHP.FrameworkConfig
... | null | https://raw.githubusercontent.com/digitallyinduced/ihp/452f98c04627223b9a2c4a1525f13fe14ae26aa3/Test/RouterSupportSpec.hs | haskell | |
Module: Test.RouterSupportSpec
Tests for typed auto routing.
| # LANGUAGE AllowAmbiguousTypes #
module Test.RouterSupportSpec where
import qualified Prelude
import ClassyPrelude
import Test.Hspec
import IHP.Test.Mocking
import IHP.Prelude
import IHP.QueryBuilder
import IHP.Environment
import IHP.FrameworkConfig
import IHP.HaskellSupport
import IHP.RouterSupport hiding (get)
impor... |
3c45c1485d9ad842d58122c5d8af673dd2ea218a1fed9b7edd33182d3ffdc497 | jyp/topics | SimplePolishPlusMonad.hs | Copyright ( c ) JP Bernardy 2008
| This is a re - implementation of the " Polish Parsers " in a clearer way . ( imho )
{-# OPTIONS -fglasgow-exts #-}
module SimplePolishPlusMonad (Process, Void, Parser (..),
runP, progress, evalR,
P) where
import Control.Applicative
import ... | null | https://raw.githubusercontent.com/jyp/topics/8442d82711a02ba1356fd4eca598d1368684fa69/Parsers/SimplePolishPlusMonad.hs | haskell | # OPTIONS -fglasgow-exts #
avoid failure
| Right-eval a fully defined process
| A parser. (This is actually a parsing process segment)
| Parse a symbol
This is the eof!
| A complete process
| Parse a symbol
This is the eof!
| Run a parser.
------------------------------------------------
Extra stuff
| Pre-co... | Copyright ( c ) JP Bernardy 2008
| This is a re - implementation of the " Polish Parsers " in a clearer way . ( imho )
module SimplePolishPlusMonad (Process, Void, Parser (..),
runP, progress, evalR,
P) where
import Control.Applicative
import Data.List hiding (map, minimumB... |
ec06d5806c27a1fb8e734633a787bad3e70f73f8abcdb99679b50a051e3b7205 | rescript-lang/rescript-compiler | ast_exp.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/frontend/ast_exp.ml | ocaml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | |
c715d70b83ac32bbc592bfa84d018de96892f5b78ac8c61b2bf4f515f01d9d16 | GaloisInc/ivory | Common.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE CPP #
--
Helpers for .
--
Copyright ( C ) 2014 , Galois , Inc.
-- All rights reserved.
--
module Ivory.Language.Syntax.Concrete.QQ.Common
( VarEnv()
, Insert()
, QStM()
, Area(..)
, Key()
... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory/src/Ivory/Language/Syntax/Concrete/QQ/Common.hs | haskell |
All rights reserved.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Expressions that are calls in the language.
Should only be called on parsed expressions that are function calls. Error
otherwise.
Exp... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE CPP #
Helpers for .
Copyright ( C ) 2014 , Galois , Inc.
module Ivory.Language.Syntax.Concrete.QQ.Common
( VarEnv()
, Insert()
, QStM()
, Area(..)
, Key()
, Call(..)
, TStmtM()
, get... |
20f4bc3e53f4638a1cc69ca85a8168717fb55a33d23a3ac831432f93f8cf383c | nonguix/nonguix | printers.scm | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2021 < >
Copyright © 2021 Kahka F
Copyright © 2021 < >
(define-module (nongnu packages printers)
#:use-module (gnu packages)
#:use-module (gnu packages cups)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (srfi ... | null | https://raw.githubusercontent.com/nonguix/nonguix/71252d2d9d1908a1f1b005d2025b0907d5d5c377/nongnu/packages/printers.scm | scheme | drvs need to be merged).
FIXME Use beginning-of-word in regexp.
Don't bail out while trying to create
/var/lib/hplip. We can safely change its value
here because it's hard-coded in the code anyway.
This is only used for installing the default config.
We don't use hal.
udev rules will be merged by base service.... | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2021 < >
Copyright © 2021 Kahka F
Copyright © 2021 < >
(define-module (nongnu packages printers)
#:use-module (gnu packages)
#:use-module (gnu packages cups)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (srfi ... |
ac128c0a1a506165b332011682cd0f30d5280a328f64f14b5edb285845335248 | aigarashi/copl-tools | keywords.ml | open Parser
let v = [
(* game-specific keywords *)
("evalto", EVALTO);
("minus", MINUS);
("times", MULT);
("plus", PLUS);
("is", IS);
("less", LESS);
("than", THAN);
("not", NOT);
(* ML1 expressions *)
("true", TRUE);
("false", FALSE);
("if", IF);
("then", THEN);
("else", ELSE);
... | null | https://raw.githubusercontent.com/aigarashi/copl-tools/3c4da117083a0870334c8eef270206b11060514e/checker/EvalNamelessML3/keywords.ml | ocaml | game-specific keywords
ML1 expressions
ML3 expressions
NamelessML3
for bindiers | open Parser
let v = [
("evalto", EVALTO);
("minus", MINUS);
("times", MULT);
("plus", PLUS);
("is", IS);
("less", LESS);
("than", THAN);
("not", NOT);
("true", TRUE);
("false", FALSE);
("if", IF);
("then", THEN);
("else", ELSE);
("*", AST);
("+", CROSS);
("-", HYPHEN);
("<", LT... |
24d3d336868fc02f4f0d837a4167182c324ae2accaf53daf9e88a749f83ba41d | ocaml/num | arith_status.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
, ... | null | https://raw.githubusercontent.com/ocaml/num/a635233b5c3da673e617de2cfe210fc869050e12/src/arith_status.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 Arith_flags;;
let get_error_when_null_denominator () =
!error_when_null_denominator_flag
and set_error_when... |
ddb24a1c372a5bf215872976e902d48f7493c540f3a11370436ea5b863134771 | SimulaVR/godot-haskell | Mutex.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Mutex
(Godot.Core.Mutex.lock, Godot.Core.Mutex.try_l... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/Mutex.hs | haskell | | Locks this @Mutex@, blocks until it is unlocked by the current owner.
| Locks this @Mutex@, blocks until it is unlocked by the current owner.
| Tries locking this @Mutex@, but does not block. Returns @OK@ on success, @ERR_BUSY@ otherwise.
| Tries locking this @Mutex@, but does not block. Returns @OK@ on success, ... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Mutex
(Godot.Core.Mutex.lock, Godot.Core.Mutex.try_l... |
26564d60756ab4b47ff95e18c5dc72098115897d99f34257fde8ed3d74ac531f | slepher/astranaut | astranaut_traverse.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2020 ,
%%% @doc
%%% traverse monad for {@link astranaut:map_m/3}
%%% @end
Created : 6 Jul 2020 by < >
%%%-------------------------------------------------------------------
-module(astranaut_traverse).
%%%========... | null | https://raw.githubusercontent.com/slepher/astranaut/ca05f6767515428df9440a0d680f3fe0e7bba89a/src/astranaut_traverse.erl | erlang | -------------------------------------------------------------------
@doc
traverse monad for {@link astranaut:map_m/3}
@end
-------------------------------------------------------------------
===================================================================
macros
==================================================... | @author < >
( C ) 2020 ,
Created : 6 Jul 2020 by < >
-module(astranaut_traverse).
-include("astranaut_struct_name.hrl").
-define(STATE_OK, astranaut_traverse_state_ok).
-define(STATE_FAIL, astranaut_traverse_state_fail).
-compile({no_auto_import, [error/1, get/0, put/1]}).
-export_type([struct/2]).
... |
a4465a442350c4da35c6638fb8fb318bdc56d83a60f444331b0d3056636e7344 | rd--/hsc3 | twoTube.help.hs | -- twoTube
let dly1 = 100
dly2 = 40
env = envelope [1,1,0] [(dly1 + dly2) / sampleRate,0.0] [EnvLin]
x = mouseX kr (-1) 1 Linear 0.2
y = mouseY kr 1 4 Linear 0.2
src = whiteNoiseId 'α' ar * envGen ar (impulse kr y 0) 1 0 1 DoNothing env
in X.twoTube ar src x 0.99 dly1 dly2 * 0.5
-- twoTube
let tr =... | null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/twoTube.help.hs | haskell | twoTube
twoTube | let dly1 = 100
dly2 = 40
env = envelope [1,1,0] [(dly1 + dly2) / sampleRate,0.0] [EnvLin]
x = mouseX kr (-1) 1 Linear 0.2
y = mouseY kr 1 4 Linear 0.2
src = whiteNoiseId 'α' ar * envGen ar (impulse kr y 0) 1 0 1 DoNothing env
in X.twoTube ar src x 0.99 dly1 dly2 * 0.5
let tr = impulse kr (mouseX kr... |
a20e323682dc82a79fe7c7b70e354c4577c03646e83a850f6c556796c3512772 | cryptosense/ocaml-mock | test_suite.ml | open OUnit2
module Core = struct
let suite =
"Core" >:::
[ "Name" >::
begin
fun ctxt ->
let name = "mock name" in
let mock = Mock.make ~name in
assert_equal
~ctxt
~cmp:[%eq: string]
~printer:[%show: string]
name
... | null | https://raw.githubusercontent.com/cryptosense/ocaml-mock/17c080a542d3b5b0c7a78d52e914ac49bf1475fe/tests/test_suite.ml | ocaml | open OUnit2
module Core = struct
let suite =
"Core" >:::
[ "Name" >::
begin
fun ctxt ->
let name = "mock name" in
let mock = Mock.make ~name in
assert_equal
~ctxt
~cmp:[%eq: string]
~printer:[%show: string]
name
... | |
d558b2b5bfe99d8cc71f1e28d44bb132f2504268f6e31b98fd5c0990d82249e8 | manuel-serrano/bigloo | signal.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / api / fthread / src / Llib / signal.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/fthread/src/Llib/signal.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Fair thread signal handling */
*===========================... | * serrano / prgm / project / bigloo / api / fthread / src / Llib / signal.scm * /
* Author : * /
* Creation : We d Feb 13 14:36:25 2002 * /
* Last change : Tue Nov 15 14:52:25 2011 ( serrano ) * /
* ... |
465f22982e509c3c3c5c7f4deec789e56e92c7aef6aac478575a5d6dc182c69a | AndrasKovacs/ELTE-func-lang | Notes04.hs | # options_ghc -Wincomplete - patterns #
# LANGUAGE InstanceSigs , ScopedTypeVariables , TypeApplications #
# LANGUAGE DeriveFunctor #
module Notes04 where
import Control.Monad (join, ap)
-- class Functor f => Applicative f where ...
-- class Applicative f => Monad f where
-- return :: a -> f a
-- (>>=) :: f a ->... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-2/gyak_4/Notes04.hs | haskell | class Functor f => Applicative f where ...
class Applicative f => Monad f where
return :: a -> f a
(>>=) :: f a -> (a -> f b) -> f b
(>>=) is read "bind".
data Maybe a = Nothing | Just a
Nothing ~ []
Just x ~ [x]
(a -> b) is the type of functions from a to b
(a -> Maybe b) is the type... | # options_ghc -Wincomplete - patterns #
# LANGUAGE InstanceSigs , ScopedTypeVariables , TypeApplications #
# LANGUAGE DeriveFunctor #
module Notes04 where
import Control.Monad (join, ap)
Functions related to the Monad instance for lists :
mapList :: (a -> b) -> [a] -> [b]
mapList f xs = [ f x | x <- xs ]
returnL... |
5776e6d28d15ba206ba47cd9bc4902c8de0146d51e550bd481363042d30603ac | DaveWM/nrepl-rebl | core.clj | (ns nrepl-rebl.core
(:require [cognitect.rebl :as rebl]))
Compatibility with the legacy tools.nrepl and the new nREPL 0.4.x .
(if (find-ns 'clojure.tools.nrepl)
(do (require
'[clojure.tools.nrepl.middleware :refer [set-descriptor!]]
'[clojure.tools.nrepl.transport :as transport]
'[clojur... | null | https://raw.githubusercontent.com/DaveWM/nrepl-rebl/adf3d4dd5b28cbe11e06e3c226a9b41e4e841703/src/nrepl_rebl/core.clj | clojure | (ns nrepl-rebl.core
(:require [cognitect.rebl :as rebl]))
Compatibility with the legacy tools.nrepl and the new nREPL 0.4.x .
(if (find-ns 'clojure.tools.nrepl)
(do (require
'[clojure.tools.nrepl.middleware :refer [set-descriptor!]]
'[clojure.tools.nrepl.transport :as transport]
'[clojur... | |
30229097ab0c1ca5b9fa74f3f009f3b2482cab1392df785776c8c1370323af44 | aycanirican/hweblib | Rfc2234.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
Module : Network . .
Copyright : Aycan iRiCAN 2010 - 2020
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- Augmented BNF for Syntax Specifications: ABNF
--
-- <>
module Network.Parser.Rfc2234 where
i... | null | https://raw.githubusercontent.com/aycanirican/hweblib/e0031eee26cb83f131ca2ccadf58456856b4c641/src/Network/Parser/Rfc2234.hs | haskell | # LANGUAGE OverloadedStrings #
|
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
Augmented BNF for Syntax Specifications: ABNF
<>
| Parse a Visible Character
| Parse a Space
| Parse a hex digit
| Parse a digit
| Parse a double quote
| Parse an ascii control charact... |
Module : Network . .
Copyright : Aycan iRiCAN 2010 - 2020
module Network.Parser.Rfc2234 where
import Control.Applicative (Alternative (many, (<|>)))
import Data.Attoparsec.ByteString
( Parser,
anyWord8,
count,
many',
satisfy,
try,
word8,
(<?>),
)
import Data.Functor... |
19d3f1e077a11dcdabdbb17e9577bb5a3afab6550036ed143c6d541f9f9281f4 | digitallyinduced/ihp-forum | Edit.hs | module Web.View.Users.Edit where
import Web.View.Prelude
data EditView = EditView { user :: User }
instance View EditView where
html EditView { .. } = [hsx|
<h1>Update Your Profile Information</h1>
{renderForm user}
|]
renderForm :: User -> Html
renderForm user = formFor user [hsx|
{textF... | null | https://raw.githubusercontent.com/digitallyinduced/ihp-forum/ac36ad4ab5dfe7b3aa85ea92d642aec12e4fa6ad/Web/View/Users/Edit.hs | haskell | module Web.View.Users.Edit where
import Web.View.Prelude
data EditView = EditView { user :: User }
instance View EditView where
html EditView { .. } = [hsx|
<h1>Update Your Profile Information</h1>
{renderForm user}
|]
renderForm :: User -> Html
renderForm user = formFor user [hsx|
{textF... | |
e0646035bf8107f405486a05907e5aa9973399d2178b80a65a21dee24817ef80 | discus-lang/ddc | Melt.hs | # LANGUAGE CPP #
module DDC.Core.Flow.Transform.Melt
( Info (..)
, meltModule )
where
import DDC.Core.Flow.Prim
import DDC.Core.Flow.Exp
import DDC.Core.Flow.Compounds
import DDC.Core.Module
import DDC.Core.Flow.Transform.Annotate
import DDC.Core.Flow.Transform.Deannotate
import Control.Monad.Writer.St... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core-flow/DDC/Core/Flow/Transform/Melt.hs | haskell | -----------------------------------------------------------------------------
| Contains binders of variables that have been melted.
| Construct an empty Info.
-----------------------------------------------------------------------------
| Melt compound data structures in a module.
----------------------------------... | # LANGUAGE CPP #
module DDC.Core.Flow.Transform.Melt
( Info (..)
, meltModule )
where
import DDC.Core.Flow.Prim
import DDC.Core.Flow.Exp
import DDC.Core.Flow.Compounds
import DDC.Core.Module
import DDC.Core.Flow.Transform.Annotate
import DDC.Core.Flow.Transform.Deannotate
import Control.Monad.Writer.St... |
8575191a7b5a353352b5f5da11b0dc8c4d09601797b98a7f109954e77ea7ef78 | RichiH/git-annex | Command.hs | git - annex command data types
-
- Copyright 2010 - 2016 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2010-2016 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Types.Command where
import Data.Ord
import Options.Applicative.Types (Parser)
i... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Types/Command.hs | haskell | b. The check stage runs checks, that error out if
- anything prevents the command from running.
c. The seek stage is passed input from the parser, looks through
- the repo to find things to act on (ie, new files to add), and
- runs commandAction to handle all necessary actions.
e. The perform stage is ... | git - annex command data types
-
- Copyright 2010 - 2016 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2010-2016 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Types.Command where
import Data.Ord
import Options.Applicative.Types (Parser)
i... |
51d9802d21522dffbb92b37957a0eaa9ee721419142077ca49338832b08e580f | nikita-volkov/bytestring-strict-builder | Main.hs | module Main where
import qualified ByteString.StrictBuilder as B
import qualified Data.ByteString as A
import Test.QuickCheck.Instances
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Prelude
main =
defaultMain $
testGroup "All tests" $
[ testProperty "Packing a list of bytes... | null | https://raw.githubusercontent.com/nikita-volkov/bytestring-strict-builder/485f5e152390f197891401860c2ee63feec45fd0/tests/Main.hs | haskell | module Main where
import qualified ByteString.StrictBuilder as B
import qualified Data.ByteString as A
import Test.QuickCheck.Instances
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import Prelude
main =
defaultMain $
testGroup "All tests" $
[ testProperty "Packing a list of bytes... | |
cbc375eca8f3f18cfd7a77d0a66352f0a2301e2ce1dbcc5bdf466566b98297d7 | input-output-hk/hydra | Abort.hs | # LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
-- | Mutation-based script validator tests for the abort transaction where a
-- 'healthyAbortTx' gets mutated by an arbitrary 'AbortMutation'.
module Hydra.Chain.Direct.Contract.Abort where
import Hydra.Cardano.Api
import Hydra.Prelude
... | null | https://raw.githubusercontent.com/input-output-hk/hydra/99fb8fee0a26d2dbf4f8cf630820b3cd6c002bad/hydra-node/test/Hydra/Chain/Direct/Contract/Abort.hs | haskell | | Mutation-based script validator tests for the abort transaction where a
'healthyAbortTx' gets mutated by an arbitrary 'AbortMutation'.
AbortTx
are optional
to test healthy abort txs with varied combinations of inital and commit
outputs
not collecting all inputs.
tested nontheless.
| Check an arbitrary key ... | # LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Hydra.Chain.Direct.Contract.Abort where
import Hydra.Cardano.Api
import Hydra.Prelude
import qualified Cardano.Api.UTxO as UTxO
import qualified Data.List as List
import qualified Data.Map as Map
import Data.Maybe (fromJust)
impo... |
b4de5efc8de74eda96cbd6cf5cd23d1384fdff29bddb3d554f93f387dfd6a323 | hbr/albatross | monad.mli | open Module_types
(** Minimal signature for a monad. *)
module type SIG_MIN =
sig
type _ t
val return: 'a -> 'a t
val (>>=): 'a t -> ('a -> 'b t) -> 'b t
end
(** Minimal signature for a monad with [map]. *)
module type SIG_WITH_MAP =
sig
include SIG_MIN
val map: ('a -> 'b) -> 'a t -> 'b t
... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/fmlib/basic/monad.mli | ocaml | * Minimal signature for a monad.
* Minimal signature for a monad with [map].
* Signature for the result monad.
* Identity monad
* Result monad | open Module_types
module type SIG_MIN =
sig
type _ t
val return: 'a -> 'a t
val (>>=): 'a t -> ('a -> 'b t) -> 'b t
end
module type SIG_WITH_MAP =
sig
include SIG_MIN
val map: ('a -> 'b) -> 'a t -> 'b t
end
module type RESULT =
sig
include MONAD
type error
val throw: erro... |
16b95bfab62df2b5ba4449f729891d49f6b5d8b3d47964d6e3ebe9ec8564d675 | kupl/LearnML | original.ml | let rec thereis a (l : 'a list) : bool =
match l with [] -> false | hd :: tl -> if a = hd then true else thereis a tl
let rec uniq (lst : 'c list) : 'b list =
match lst with
| [] -> []
| hd :: tl -> if thereis hd tl then uniq tl else hd :: uniq tl
let (_ : int list) = uniq [ 5; 6; 5; 4 ]
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/uniq/sub8/original.ml | ocaml | let rec thereis a (l : 'a list) : bool =
match l with [] -> false | hd :: tl -> if a = hd then true else thereis a tl
let rec uniq (lst : 'c list) : 'b list =
match lst with
| [] -> []
| hd :: tl -> if thereis hd tl then uniq tl else hd :: uniq tl
let (_ : int list) = uniq [ 5; 6; 5; 4 ]
| |
39f8236d8b98f5afb36676548ac18ea48b3f1385440d7db710e7b27bc2fee2be | spl/emgm | Enum.hs | # LANGUAGE FlexibleContexts #
-----------------------------------------------------------------------------
-- |
Module :
Copyright : ( c ) 2008 , 2009 Universiteit Utrecht
-- License : BSD3
--
Maintainer :
-----------------------------------------------------------------------------
mod... | null | https://raw.githubusercontent.com/spl/emgm/dc16c10137487d7eb97aa851a577be66b46070a2/tests/Enum.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Utility functions
------------------------------------------------... | # LANGUAGE FlexibleContexts #
Module :
Copyright : ( c ) 2008 , 2009 Universiteit Utrecht
Maintainer :
module Enum (tests) where
import Prelude hiding (Show, Enum)
import qualified Prelude as P (Show)
import Data.Generics (Data)
import Test.HUnit
import Base
import Generics.EMGM
import Gene... |
a5b3598c8afdcf7923a6abc0a44746700c5677b904a4dbed347e52ee8f1627cf | theosotr/buildfs | gradle_parser.mli |
* Copyright ( c ) 2018 - 2020
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , version 3 .
*
* This program is distributed in the hope that it will be useful , but
... | null | https://raw.githubusercontent.com/theosotr/buildfs/3cd287da0d1184934c1bcd28d301f2545196f44b/src/build/gradle_parser.mli | ocaml | * Checks if the given system call corresponds to a debug message
produced by Gradle.
* This function identifies and model the points where
the application of a certain Gradle task begins or ends.
In the context of Gradle, those points correspond to writes
a file descriptor greater than 100.
* This function... |
* Copyright ( c ) 2018 - 2020
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , version 3 .
*
* This program is distributed in the hope that it will be useful , but
... |
1658d3f24733593e7545d347ee15cc1f5e4eb4c858132b3e6134a774face4aa1 | zshipko/yurt | yurt_form.ml | open Lwt
open Yurt_request_ctx
open Cohttp_lwt_unix
exception Invalid_multipart_form
* URL encoded form
let urlencoded body : (string, string list) Hashtbl.t Lwt.t =
let dst = Hashtbl.create 16 in
Body.to_string body >|= Uri.query_of_encoded
>|= Lwt_list.iter_s (fun (k, v) ->
Lwt.return
(... | null | https://raw.githubusercontent.com/zshipko/yurt/b0baac0bc55740a361ae94181d5c0bb313e96f88/src/yurt_form.ml | ocaml | * Return true when the multipart object has a filename attribute
Output
Current multipart context
Body buffer
True when the parser is in a header section
Input lines
Boundary
The new buffer contains an extra "\r\n" that needs to be removed
End of header
Get attributes
In body | open Lwt
open Yurt_request_ctx
open Cohttp_lwt_unix
exception Invalid_multipart_form
* URL encoded form
let urlencoded body : (string, string list) Hashtbl.t Lwt.t =
let dst = Hashtbl.create 16 in
Body.to_string body >|= Uri.query_of_encoded
>|= Lwt_list.iter_s (fun (k, v) ->
Lwt.return
(... |
8e577390fbf02667db08828cea7dd29e7128a1bfa6d9623c2022ce079cc07fa0 | rems-project/lem | pset.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rems-project/lem/a839114e468119d9ac0868d7dc53eae7f3cc3a6c/ocaml-lib/pset.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Modified by 2010 - 10 - 28
$ I d... |
48fb62f8b29743feb22cc790a945a4dd7348cbbc830148cd4a01a6ad32de4eee | static-analysis-engineering/codehawk | bCHImmediate.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/dd2c3b9f84b4b5f3c88898505ee912e1e461e809/CodeHawk/CHB/bchlib/bCHImmediate.ml | ocaml | chutil
bchlib
============================================================= Predicates
============================================================= Converters
=========================================================== Transformers
======================================================== Pretty printing | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
575c5a56f79ab7a1f7415aafffcea2543fa4264024edbedb6d7db69b75bf2c4b | Drup/furl | furl_utils.ml |
module Seq = struct
include Seq
let of_list l =
let rec aux l () = match l with
| [] -> Seq.Nil
| x :: tail -> Seq.Cons (x, aux tail)
in
aux l
let to_rev_list gen =
fold_left (fun acc x -> x :: acc) [] gen
let to_list gen = List.rev (to_rev_list gen)
end
let map_snd f (x,y) = (x,... | null | https://raw.githubusercontent.com/Drup/furl/ed4b2909b4b5a586541f8112323fa1fe2778eaa1/src/furl_utils.ml | ocaml | * if [l' ∈ l] then [build_permutation offset count l l'] builds
a mapping: index in l => offset in l'.
Offsets are computed respecting [offset] and [count].
|
module Seq = struct
include Seq
let of_list l =
let rec aux l () = match l with
| [] -> Seq.Nil
| x :: tail -> Seq.Cons (x, aux tail)
in
aux l
let to_rev_list gen =
fold_left (fun acc x -> x :: acc) [] gen
let to_list gen = List.rev (to_rev_list gen)
end
let map_snd f (x,y) = (x,... |
d4442a2c8a73f7f9952b197a2d367bd32a0645c9b548cddf7391e0a8e2a297e6 | camlp5/pa_ppx_unique | test_unique.ml | (**pp -syntax camlp5o $(IMPORT_OCAMLCFLAGS) *)
(* test_unique.ml *)
type 'a id = 'a
and 'a option = 'a Option.t = None | Some of 'a
and term_id = term id
and term_option = term option
and term =
Ref of int
| Abs of term_id
| App of term * term
| Foo of term_option
[@@deriving unique { uniqified_module_name =... | null | https://raw.githubusercontent.com/camlp5/pa_ppx_unique/25e1d4b5acedd34176aa8426cc56ac25c3da0673/tests/test_unique.ml | ocaml | *pp -syntax camlp5o $(IMPORT_OCAMLCFLAGS)
test_unique.ml
; normal_module_name = LAM2
1..max_var
low
high
low
high |
type 'a id = 'a
and 'a option = 'a Option.t = None | Some of 'a
and term_id = term id
and term_option = term option
and term =
Ref of int
| Abs of term_id
| App of term * term
| Foo of term_option
[@@deriving unique { uniqified_module_name = LAMH
; normal_module_name = LAM
... |
15737081703c3fffaf0f51b27cda08d688b0b73e2f05a1cb8813bf5ca15b4c1d | ds-wizard/engine-backend | LocaleJM.hs | module Wizard.Api.Resource.Locale.LocaleJM where
import Data.Aeson
import Shared.Api.Resource.Organization.OrganizationSimpleJM ()
import Shared.Util.Aeson
import Wizard.Api.Resource.Locale.LocaleDTO
import Wizard.Api.Resource.Locale.LocaleStateJM ()
instance FromJSON LocaleDTO where
parseJSON = genericParseJSON j... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/0ec94a4b0545f2de8a4e59686a4376023719d5e7/engine-wizard/src/Wizard/Api/Resource/Locale/LocaleJM.hs | haskell | module Wizard.Api.Resource.Locale.LocaleJM where
import Data.Aeson
import Shared.Api.Resource.Organization.OrganizationSimpleJM ()
import Shared.Util.Aeson
import Wizard.Api.Resource.Locale.LocaleDTO
import Wizard.Api.Resource.Locale.LocaleStateJM ()
instance FromJSON LocaleDTO where
parseJSON = genericParseJSON j... | |
fc3bab8a9b8c1b0ba7fb31e2a56931b4cc049c7d7073b802c7523b413d960100 | ygmpkk/house | StdProcessAttribute.hs | -----------------------------------------------------------------------------
-- |
Module : StdProcessAttribute
Copyright : ( c ) 2002
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
StdProcessAttribute specifies which ProcessAttributes... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/ObjectIO/Graphics/UI/ObjectIO/StdProcessAttribute.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
each of the standard interactive processes. Basic comparison operations
and retrieval functions are also included.
-----------------------... | Module : StdProcessAttribute
Copyright : ( c ) 2002
StdProcessAttribute specifies which ProcessAttributes are valid for
module Graphics.UI.ObjectIO.StdProcessAttribute
( isProcessKindAttribute
, isProcessActivate, getProcessActivateFun
, isProcessClose, getProcessCloseFun
, isProcessDea... |
992ab73c9bd708aa9363cfd3a2c164cc66591fd15fd89aabfbfb6da3d994ee6b | bos/rwh | WC.hs | {-- snippet main --}
main = interact wordCount
where wordCount input = show (length (lines input)) ++ "\n"
{-- /snippet main --}
| null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch02/WC.hs | haskell | - snippet main -
- /snippet main - | main = interact wordCount
where wordCount input = show (length (lines input)) ++ "\n"
|
c6a8bfe90990d350d17c2066ef96e2ba838146c8319d8acb7923482f15599e60 | cucumber-attic/cucumber-jvm-clojure | belly.clj | (ns cucumber.runtime.clojure.belly)
(def cukes (ref (vector)))
(defn eat [num]
(dosync (alter cukes conj num)))
(defn last-meal []
(last @cukes))
| null | https://raw.githubusercontent.com/cucumber-attic/cucumber-jvm-clojure/2197be7a0b2663bb595c8f22c5b4003cd6332d0e/clojure/src/test/resources/cucumber/runtime/clojure/belly.clj | clojure | (ns cucumber.runtime.clojure.belly)
(def cukes (ref (vector)))
(defn eat [num]
(dosync (alter cukes conj num)))
(defn last-meal []
(last @cukes))
| |
1ae68eb26ac8d533da22f2d2cb34b0b2a0007277b8cf0db08824d69625eb63a1 | zcaudate/hara | match_test.clj | (ns hara.test.form.match-test
(:use hara.test)
(:require [hara.test.form.match :refer :all]))
^{:refer hara.test.form.match/match-base :added "3.0"}
(fact "determines whether a term matches with a filter"
(match-base {:tags #{:web}}
{:tags #{:web}}
false)
=> [true false false]
(ma... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/test/hara/test/form/match_test.clj | clojure | (ns hara.test.form.match-test
(:use hara.test)
(:require [hara.test.form.match :refer :all]))
^{:refer hara.test.form.match/match-base :added "3.0"}
(fact "determines whether a term matches with a filter"
(match-base {:tags #{:web}}
{:tags #{:web}}
false)
=> [true false false]
(ma... | |
9b0150320cf82427b3634d210806ee71b1f4a7b41b0eb2801895e4da05303753 | srdqty/talc-3.0 | sil.mli | (**********************************************************************)
( c ) , , ,
June 1998 , all rights reserved .
(**********************************************************************)
type tipe =
D_t | Int_t | String_t | Char_t | Indesc_t | Ou... | null | https://raw.githubusercontent.com/srdqty/talc-3.0/df83dd5ff0e2b189b13280ddae233d8277199350/scheme/sil.mli | ocaml | ********************************************************************
******************************************************************** | ( c ) , , ,
June 1998 , all rights reserved .
type tipe =
D_t | Int_t | String_t | Char_t | Indesc_t | Outdesc_t | Pair_t
| Fn_t of int
type coercion =
Int2D | String2D | Char2D | Indesc2D | Outdesc2D | Pair2D | Fn2D of int
| D2Int | D2Str... |
ff55b56bcd8e5e681be21d6af77505aa87f984a7a03f050c962feedffdb77f7c | clingen-data-model/genegraph | serialization.clj | (ns genegraph.annotate.serialization
(:require [genegraph.transform.types :as xform-types]
[genegraph.source.graphql.experimental-schema :as experimental-schema]))
(def add-graphql-params-interceptor
"Interceptor that adds graphql query information in key :graphql-params"
{:name ::add-graphql-params... | null | https://raw.githubusercontent.com/clingen-data-model/genegraph/baae07c26b8ac4913a47d93e2959a8de5b9d63c3/src/genegraph/annotate/serialization.clj | clojure | (ns genegraph.annotate.serialization
(:require [genegraph.transform.types :as xform-types]
[genegraph.source.graphql.experimental-schema :as experimental-schema]))
(def add-graphql-params-interceptor
"Interceptor that adds graphql query information in key :graphql-params"
{:name ::add-graphql-params... | |
60fff651e6765052067668ae487b73030dfc6b3c647f4531239ae4eb1edfb043 | hakaru-dev/hakaru | Syntax.hs | # LANGUAGE TypeFamilies , , FlexibleContexts , DataKinds #
{-# OPTIONS -W #-}
module Tests.Syntax(allTests) where
import Prelude hiding (Real)
import Language.Hakaru.Syntax (Hakaru(..),
Order(..), Base(..), ununit, and_, fst_, snd_, swap_, min_, max_,
Mochastic(..), Lambda(..), Integrate(..), bind_, li... | null | https://raw.githubusercontent.com/hakaru-dev/hakaru/94157c89ea136c3b654a85cce51f19351245a490/haskell/Tests/Syntax.hs | haskell | # OPTIONS -W #
"pair1fst/snd" ~: testSS [pair1fst, pair1snd] pair1same,
"transitionTest" ~: ignore $ transitionTest,
"testDistWithSample" ~: ignore $ do x <- testDistWithSample
mapM_ assertJust x,
"testdistLinregSimp" ~: testS distLinregSimp,
"gamalonDis" ~: testS gamalonDis
pai... | # LANGUAGE TypeFamilies , , FlexibleContexts , DataKinds #
module Tests.Syntax(allTests) where
import Prelude hiding (Real)
import Language.Hakaru.Syntax (Hakaru(..),
Order(..), Base(..), ununit, and_, fst_, snd_, swap_, min_, max_,
Mochastic(..), Lambda(..), Integrate(..), bind_, liftM, liftM2, factor... |
dae3e0bb5368f3646f758bd52f6325141bc20825ad2215adf35a7c6cbfe7c339 | ghc/packages-dph | UPSegd.hs | # LANGUAGE CPP #
#include "fusion-phases.h"
-- | Parallel segment descriptors.
--
-- See "Data.Array.Parallel.Unlifted" for how this works.
--
module Data.Array.Parallel.Unlifted.Parallel.UPSegd
( -- * Types
UPSegd(..)
, valid
-- * Constructors
, mkUPSegd, fromUSegd
... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-par/Data/Array/Parallel/Unlifted/Parallel/UPSegd.hs | haskell | | Parallel segment descriptors.
See "Data.Array.Parallel.Unlifted" for how this works.
* Types
* Constructors
* Projections
* Indices
* Replicate
* Segmented Folds
| A parallel segment descriptor holds a global (undistributed) segment
desciptor, as well as a distributed version. The distributed version
... | # LANGUAGE CPP #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Parallel.UPSegd
UPSegd(..)
, valid
, mkUPSegd, fromUSegd
, empty, singleton, fromLengths
, length
, takeUSegd
, takeDistributed
, takeLengths
, takeIndices
... |
623b262b1ebd9614f231add8bac33e962c4636bb470774032b813363c05eff31 | google/hrepl | QueryTest.hs | Copyright 2020 Google LLC
--
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- -2.0
--
-- Unless required by applicable law or agreed to in writing, software
distributed un... | null | https://raw.githubusercontent.com/google/hrepl/a1d55353b70244da26bd939ee2505961e5c14930/bazel/Bazel/QueryTest.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2020 Google LLC
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
module Main
( main,
)
where
import Bazel.Query
import Bazel.Name (parseLabel)
import GHC.Stack
import Test.Framework (defaultMain, Test, testG... |
750da5ec9bc699c815207043d035d34dfabcd4c2cec5f73fae149587c0637c4b | hiredman/clojurebot | example-config.clj | {:nick "clojurebotIII"
:irc {"irc.freenode.net" ["#clojurebot"]}
:database "/tmp/bot.db"
:threads 4
:cron [{:task hiredman.clojurebot.clojars/go
:rate 3600
:targets [[:irc "clojurebotIII" "irc.freenode.net" "#clojurebot"]]}
{:task clojurebot.github/commits
:rate 3000
:tar... | null | https://raw.githubusercontent.com/hiredman/clojurebot/1e8bde92f2dd45bb7928d4db17de8ec48557ead1/example-config.clj | clojure | {:nick "clojurebotIII"
:irc {"irc.freenode.net" ["#clojurebot"]}
:database "/tmp/bot.db"
:threads 4
:cron [{:task hiredman.clojurebot.clojars/go
:rate 3600
:targets [[:irc "clojurebotIII" "irc.freenode.net" "#clojurebot"]]}
{:task clojurebot.github/commits
:rate 3000
:tar... | |
49939c1ec500153eb678863212be6fbe1d1914beabbab95b86c83948c01b9ebe | gonimo/gonimo | Android.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecursiveDo #-}
# LANGUAGE ScopedTypeVariables #
import Android.HaskellActivity
import Control.Concurrent
import Control.Concurrent.MVar (putMVar)
import... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/front-android/app/Android.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE RecursiveDo #
setSearchIntent :: String -> JSM ()
setSearchIntent uri = do
let query = dropWhile (/= '?') uri
window <- DOM.currentWindowUnchecked
location <- Window.getLocation window | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
import Android.HaskellActivity
import Control.Concurrent
import Control.Concurrent.MVar (putMVar)
import Control.Lens
import Control.Monad
import Data.Default
import Data.Mono... |
df2988da4265ff211d53fa15a11a0a3895de807316fe8c037333b190316ea5b4 | AccelerateHS/accelerate | DotP.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
-- |
-- Module : Data.Array.Accelerate.Test.NoFib.Imaginary.DotP
Copyright : [ 2009 .. 2020 ] T... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate/63e53be22aef32cd0b3b6f108e637716a92b72dc/src/Data/Array/Accelerate/Test/NoFib/Imaginary/DotP.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
|
Module : Data.Array.Accelerate.Test.NoFib.Imaginary.DotP
License : BSD3
Stability : experimental
| # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
Copyright : [ 2009 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.Test.NoFib.Imaginary.DotP (
test_dotp
) where
import Prelude ... |
a513d88a6632a149c39d8e2a45ce37221e6f0fe63f8e1253b35eb0d3d559a06f | brendanhay/terrafomo | Provider.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
Module : . . Provider
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer :... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-scaleway/gen/Terrafomo/Scaleway/Provider.hs | haskell | This module is auto-generated.
|
Stability : auto-generated
^ @organization@
- (Required)
^ @region@
- (Optional)
The Scaleway API region to use.
^ @token@
- (Required)
^ The minimal/required arguments.
| The required arguments for 'newProvider'.
^ (Required)
^ (Required) |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# OPTIONS_GHC -fno - warn - unused - imports #
Module : . . Provider
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
Portability : n... |
bdba5e53831f98dbe0b8595724b048221b7bad3815c08236489a3eb108027f5d | jumarko/web-development-with-clojure | login.cljs | ;---
Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
; courses, books, articles, and the like. Contact us if you are in doubt.
; We make no guarantees that this code is fit fo... | null | https://raw.githubusercontent.com/jumarko/web-development-with-clojure/dfff6e40c76b64e9fcd440d80c7aa29809601b6b/code/picture-gallery-war/src/cljs/picture_gallery/components/login.cljs | clojure | ---
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
(ns picture-gallery.components.login
(:require [reagent.core :refer [atom]]
[reagent.session :as session]
... |
e3bd338efe97e635bd50a2995ba0fb5c1e24afac4002eb1eb2f234f12479f195 | dyoo/whalesong | nucleic2.rkt | #lang whalesong/base
(require (for-syntax racket/base))
; File: "nucleic2.scm"
;
Author : ( )
Last modification by Feeley : June 6 , 1994 .
Modified for R5RS Scheme by : 22 October 1996 .
Last modification by : 19 March 1999 .
;
; This program is a modified version of the program described in
;
, ... | null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/tests/more-tests/nucleic2.rkt | racket | File: "nucleic2.scm"
This program is a modified version of the program described in
Constraint Satisfaction Problems: an Application to Nucleic Acid 3D
Structure Determination. Lisp and Symbolic Computation 7(2/3),
The differences between this program and the original are described in
Functional Langu... | #lang whalesong/base
(require (for-syntax racket/base))
Author : ( )
Last modification by Feeley : June 6 , 1994 .
Modified for R5RS Scheme by : 22 October 1996 .
Last modification by : 19 March 1999 .
, , . Using Multilisp for Solving
231 - 246 , 1994 .
P.H. Hartel , , et al . B... |
8d2ef0b7713a19bd7838606135c897286da83cecaa736d559635b8660f280851 | falsetru/htdp | 27.2.3.scm | (define-struct rr (table costs) #:transparent)
(define (line->rr line) (make-rr (first line) (rest line)))
(define (file->list-of-checks afile)
(map line->rr
(file->list-of-lines afile)))
(define (select-lines afile nl-found rest-lines)
(cond
[(empty? afile) empty]
[else (cond
[(and (symbol? ... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/27/27.2.3.scm | scheme | (define-struct rr (table costs) #:transparent)
(define (line->rr line) (make-rr (first line) (rest line)))
(define (file->list-of-checks afile)
(map line->rr
(file->list-of-lines afile)))
(define (select-lines afile nl-found rest-lines)
(cond
[(empty? afile) empty]
[else (cond
[(and (symbol? ... | |
c9f54cd5f1eafb75a9e88c609ba521d4560ac60f3181f7442e5db28d8a8dd76c | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit.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 PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit
module StripeAPI.T... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit
| custom_mandate_url: A URL for custom mandate text
Constraints:
| interval_description: Description of the interval. Only required if the \'payment_schedu... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.A... |
941e5edef3619e2de63f17f5ba87b195274d569ea40df3a944aa671542df8058 | mariari/Misc-Lisp-Scripts | testing-server.lisp | (define-condition foo () ()
( :report (lambda (condition stream)
(princ "Stop FOOing around, numbskull!" stream))))
(error 'foo)
(defun bad-function ()
(error 'foo))
(handler-case ())
| null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/acecadc75fcbe15e6b97e084d179aacdbbde06a8/Books/LandOfLisp/Chapter%2013/testing-server.lisp | lisp | (define-condition foo () ()
( :report (lambda (condition stream)
(princ "Stop FOOing around, numbskull!" stream))))
(error 'foo)
(defun bad-function ()
(error 'foo))
(handler-case ())
| |
357a7002ebe0f20e5249834f8ddd64f9aea9bc83212f180ed84e80551e37b2fb | haskell-foundation/foundation | UArray.hs | -- |
Module : Basement . UArray
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
-- An unboxed array of primitive types
--
All the cells in the array are in one chunk of contiguous
-- memory.
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGU... | null | https://raw.githubusercontent.com/haskell-foundation/foundation/e7c3db3b29e4f1e406655f35cacfb35074b400b2/basement/Basement/UArray.hs | haskell | |
License : BSD-style
Stability : experimental
Portability : portable
An unboxed array of primitive types
memory.
# LANGUAGE Rank2Types #
* methods
* internal methods
* Creation
* accessors
* Functions
| Return the element at a specific index from an array.
If the index @n is out of bounds, an err... | Module : Basement . UArray
Maintainer : < >
All the cells in the array are in one chunk of contiguous
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Basement.UArray
( UArray(..)
, PrimTy... |
55c7a79f69152347178ac04b36df10f701dc3ec00920783648f70adff3a9028a | rodrigosetti/stamps | shape-composition-2.rkt | #lang s-exp stamps/lang
; Stamps Tutorial
; Shapes - composition
; Any shape you define with `(define-shape` is just like any other
; shape, you can compose these too, including recursively,
; and you can apply adjustmenst too:
(define-shape circles
(circle)
(circle [translate 1 0])
(circle [translate 1 1])
... | null | https://raw.githubusercontent.com/rodrigosetti/stamps/958938dd71fdaa64041ea13f1b491bda628bda9c/tutorial/shape-composition-2.rkt | racket | Stamps Tutorial
Shapes - composition
Any shape you define with `(define-shape` is just like any other
shape, you can compose these too, including recursively,
and you can apply adjustmenst too: | #lang s-exp stamps/lang
(define-shape circles
(circle)
(circle [translate 1 0])
(circle [translate 1 1])
(circle [translate 0 1]))
(define-shape outer
(circles)
(outer [translate 3 0]
[rotate -5]
[scale .95]))
(start-shape outer)
|
dcf59aab7b446b592578287a3f7d67979d3b608f5c020a3fd168c20d889af36b | triffon/fp-2019-20 | 02-start-high.rkt | #lang racket
TODO : talk about homework , my failure re HW , but still !
there is homework hopefully or worst case tomorrow !
TODO : talk about additional exercise , probably sunday
TODO : talk about FP and higher order functions
; *extremely* convenient, all you do is some form of these
(define (apply-twice... | null | https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/lab/exercises/02-start-high.rkt | racket | *extremely* convenient, all you do is some form of these
TODO: lambda for succ, explain lambda
TODO: talk about how define fn is sugar for lambda + define
show example
TODO: example for returning functions
EXERCISE: const
EXAMPLES:
EXERCISE: add-n
A function that takes a number n and returns a function that ta... | #lang racket
TODO : talk about homework , my failure re HW , but still !
there is homework hopefully or worst case tomorrow !
TODO : talk about additional exercise , probably sunday
TODO : talk about FP and higher order functions
(define (apply-twice f x) void)
(= = ( apply - twice succ 2 ) 4 )
(define apply... |
4086aeaa6e1b072c330bd3810ef8f96e7c70c53f7d8bf778fd7b6cb628bdf34f | mfoemmel/erlang-otp | ex_radioBox.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public Lic... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/examples/demo/ex_radioBox.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(ex_radioBox).
-behaviour(wx_object).
-e... |
4e4440bf9b1402dea88043480f6c4624cb67902eabd5ff2b8bf7e78e9c7455ab | conal/Fran | Font.hs | {- Font properties -}
Last modified Sat Sep 07 23:23:11 1996
module Font
(
Font(..),
Family(..),
: :
: :
: :
: :
: :
bold, -- :: Font -> Font
italic -- :: Font -> Font
) where
data Font
= Font
Family
... | null | https://raw.githubusercontent.com/conal/Fran/a113693cfab23f9ac9704cfee9c610c5edc13d9d/src/Font.hs | haskell | Font properties
:: Font -> Font
:: Font -> Font
bold or not
italics
Font operators, adding attributes
default
| Last modified Sat Sep 07 23:23:11 1996
module Font
(
Font(..),
Family(..),
: :
: :
: :
: :
: :
) where
data Font
= Font
Family
deriving Show
system :: Font
system = Font System False False
timesRoman :: Font
timesRoman = F... |
2a0cc564d57667276dfdeb6b299d4e49f43ea25fb8132089d1a1690f4d994ff8 | vincenthz/hs-asn1 | Internal.hs | -- |
-- Module : Data.ASN1.Internal
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : unknown
--
module Data.ASN1.Internal
( uintOfBytes
, intOfBytes
, bytesOfUInt
, bytesOfInt
, putVarEncodingIntegral
) where
import Data.Word
import Data.Bit... | null | https://raw.githubusercontent.com/vincenthz/hs-asn1/c017c03b0f71a3b45165468a1d1028a0ed7502c0/data/Data/ASN1/Internal.hs | haskell | |
Module : Data.ASN1.Internal
License : BSD-style
Stability : experimental
Portability : unknown
| uintOfBytes returns the number of bytes and the unsigned integer represented by the bytes | Maintainer : < >
module Data.ASN1.Internal
( uintOfBytes
, intOfBytes
, bytesOfUInt
, bytesOfInt
, putVarEncodingIntegral
) where
import Data.Word
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
uintOfBytes :: ByteString -> (Int, Integer)
uintO... |
08e0e06a9e5756d61212d9bff99f927bf3a56b631d744fed194ce483cdd21a71 | chaw/r7rs-libs | AD-test.sps | ;; Simple tests of AD for automatic differentiation
Examples from
(import (except (scheme base) + - * / expt square = < > <= >= zero? positive? negative? real?)
(autodiff AD)
(srfi 64)
(robin srfi64-utils))
(test-begin "autodiff-AD")
(test-equal 6 ((derivative-F (lambda (x) (* x x))) 3))
(... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/autodiff-tests/AD-test.sps | scheme | Simple tests of AD for automatic differentiation | Examples from
(import (except (scheme base) + - * / expt square = < > <= >= zero? positive? negative? real?)
(autodiff AD)
(srfi 64)
(robin srfi64-utils))
(test-begin "autodiff-AD")
(test-equal 6 ((derivative-F (lambda (x) (* x x))) 3))
(test-equal 13/18 ((derivative-F (lambda (x) (/ (* (+... |
66f3102f1e4665d3cd10b834304dae7753dcbc3560877b2f5e7b60e5f3753d53 | glguy/generic-traverse | Generic.hs | # LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE EmptyCase #
-- |
-- This module generates implementations of the 'traverse' operation which
make it possible for GHC to optimize away the " GHC.Generics " value
-- representation.
module Data.Traversable.Generic
(
-- * Generic operations
gener... | null | https://raw.githubusercontent.com/glguy/generic-traverse/1a878ec22e6a0c8626e03b4c29999779f6bc5ea1/src/Data/Traversable/Generic.hs | haskell | |
This module generates implementations of the 'traverse' operation which
representation.
* Generic operations
* Implementation details
for inlining as they need to inline across module boundaries
does figure it out, but it's better to be explicit about our
intention here than to rely on the optimizer any more ... | # LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE EmptyCase #
make it possible for GHC to optimize away the " GHC.Generics " value
module Data.Traversable.Generic
(
genericTraverse,
GTraversable(gtraverse)
) where
import Boggle
import GHC.Generics (Generic1, Rep1, to1, from1, (:*:)(..)... |
d7d39b7627a85fd9300a22b1d66d43d5f65768681a5102e28cf2ccf2080ead21 | janestreet/core_unix | nano_mutex.ml | open! Core
open! Import
let ok_exn = Or_error.ok_exn
(* A [Blocker.t] is an ordinary mutex and conditional variable used to implement blocking
when there is lock contention. *)
module Blocker : sig
type t [@@deriving sexp_of]
val create : unit -> t
val critical_section : t -> f:(unit -> 'a) -> 'a
val wait... | null | https://raw.githubusercontent.com/janestreet/core_unix/a051098a918b950e9d0a5da7248f1bbfb51388e5/nano_mutex/src/nano_mutex.ml | ocaml | A [Blocker.t] is an ordinary mutex and conditional variable used to implement blocking
when there is lock contention.
We keep a cache of unused blockers, since they are relatively costly to create, and
we should never need very many simultaneously. We should never need more blockers
than the number of ... | open! Core
open! Import
let ok_exn = Or_error.ok_exn
module Blocker : sig
type t [@@deriving sexp_of]
val create : unit -> t
val critical_section : t -> f:(unit -> 'a) -> 'a
val wait : t -> unit
val signal : t -> unit
val save_unused : t -> unit
end = struct
Our use of mutexes is always via [ Mutex.cri... |
553734efd6d6ebc9d46ea07a80d5c05ffc7cd6f0fd04dae9371a438db9fb33b9 | supki/liblastfm | UserSpec.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
module Json.UserSpec (spec) where
import Data.Aeson.Lens
import Lastfm
import Lastfm.User
import Test.Hspec
import SpecHelper
spec :: Spec
spec = do
it "getRecentStations" $
privately (getRecentStations <*> user "liblastfm" <* limit 10)
`shouldHaveJ... | null | https://raw.githubusercontent.com/supki/liblastfm/754be163c4ce14c9b4819f1359b5f95a0f91a29d/test/api/Json/UserSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
module Json.UserSpec (spec) where
import Data.Aeson.Lens
import Lastfm
import Lastfm.User
import Test.Hspec
import SpecHelper
spec :: Spec
spec = do
it "getRecentStations" $
privately (getRecentStations <*> user "liblastfm" <* limit 10)
`shouldHaveJson`
key "recentstations".key "... |
bb1f5ff4936d099ec6a23b7b86cf037de8cab0f0c2c71fed077a74ef3add83eb | cburgmer/buildviz | pipeline_runtime_test.clj | (ns buildviz.controllers.pipeline-runtime-test
(:require [buildviz.controllers.pipeline-runtime :as sut]
[buildviz.test-utils
:refer
[json-body json-get-request plain-get-request the-app]]
[clj-time
[coerce :as tc]
[core :as t]]
[... | null | https://raw.githubusercontent.com/cburgmer/buildviz/396f4f854e306acf08ac04b7a084dea9b2a606c6/test/buildviz/controllers/pipeline_runtime_test.clj | clojure | (ns buildviz.controllers.pipeline-runtime-test
(:require [buildviz.controllers.pipeline-runtime :as sut]
[buildviz.test-utils
:refer
[json-body json-get-request plain-get-request the-app]]
[clj-time
[coerce :as tc]
[core :as t]]
[... | |
838893b5d0d67fc66e91a1d88a9f52985fc33b5308db6478a3d1273df137e08e | gregr/icfp2017-artifact-auas7pp | challenge-6.scm | (load "mk/test-check.scm")
(load "evalo-optimized.scm")
(set! allow-incomplete-search? #t)
;; For your convenience, we've factored out the proof-checking evaluation goal.
(define proof?-evalo
(lambda (proof result)
(evalo
`(letrec ([member?
(lambda (x ls)
(cond
... | null | https://raw.githubusercontent.com/gregr/icfp2017-artifact-auas7pp/98de885bd1cb9eef53c8ac3d85720b56122ca541/src/challenge-6.scm | scheme | For your convenience, we've factored out the proof-checking evaluation goal.
The structure of a proof is: `(,conclusion ,assumptions . ,justification)
where:
`conclusion` is a term
`assumptions` is a list of terms
`justification` is: `(,rule-name ,sub-proofs)
prove C holds, given A, A => B, B => C
prove C holds... | (load "mk/test-check.scm")
(load "evalo-optimized.scm")
(set! allow-incomplete-search? #t)
(define proof?-evalo
(lambda (proof result)
(evalo
`(letrec ([member?
(lambda (x ls)
(cond
((null? ls) #f)
((equal? (car ls) x) #t)
... |
826f2fac1d587f8a8918b3dad92ece8907f9c82a88c80004820e924d82b9d7ce | helix-collective/hx-deploy-tool | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as LT;
import qualified Data.ByteString.Char8 as CBS
import qualified Data.ByteString.Lazy as LBS
import qualified Commands.LetsEncrypt as LE
import qualified Commands... | null | https://raw.githubusercontent.com/helix-collective/hx-deploy-tool/74ad135308157d54ba73818341e86ae91ba3c09e/src/Main.hs | haskell | # LANGUAGE OverloadedStrings #
| Load the config file and run the action
| Load the config file and run the action, writing log messages to the configured logfile
given environment variable, or from a prefix relative
default path.
show-slaves]\n\
retry]\n\
repeat n]\n\ | module Main where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Lazy as LT;
import qualified Data.ByteString.Char8 as CBS
import qualified Data.ByteString.Lazy as LBS
import qualified Commands.LetsEncrypt as LE
import qualified Commands.ProxyMode as P
import qualified Co... |
549acf52c604fef91844edffb1fa3ebf7453ca0888a8b4ee6ebf4928f2423902 | ThoughtWorksInc/stonecutter | delete_app.clj | (ns stonecutter.test.view.delete-app
(:require [midje.sweet :refer :all]
[stonecutter.routes :as r]
[net.cgrand.enlive-html :as html]
[stonecutter.test.view.test-helpers :as th]
[stonecutter.translation :as t]
[stonecutter.helper :as helper]
[sto... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/test/stonecutter/test/view/delete_app.clj | clojure | (ns stonecutter.test.view.delete-app
(:require [midje.sweet :refer :all]
[stonecutter.routes :as r]
[net.cgrand.enlive-html :as html]
[stonecutter.test.view.test-helpers :as th]
[stonecutter.translation :as t]
[stonecutter.helper :as helper]
[sto... | |
d5c0fe6813a439683800f3cc7bda257ce1358c30ba15dfc3011dd87c1baf9b6d | plaidfinch/myxine | TH.hs | # options_ghc -Wno - incomplete - uni - patterns #
| * Internal Template - Haskell for generating events
_ _ Note : _ _ This module is used exclusively to template the various event and
event interface data types used by this library . It is not intended for
external use , and may not follow the PVP... | null | https://raw.githubusercontent.com/plaidfinch/myxine/3f57767ee3059400eea5fd890f5d1b0b388a0632/clients/haskell/src/Myxine/Internal/TH.hs | haskell | doesn't guarantee stability of encoding. In particular, unit-like things
are currently serialized as [] and not {}, even if they are record-like.
This lets Maybe fields really be optional
| Make the @decodeEventProperties@ function
| Given an interface and a property for it, rename that property if necessary
| Ge... | # options_ghc -Wno - incomplete - uni - patterns #
| * Internal Template - Haskell for generating events
_ _ Note : _ _ This module is used exclusively to template the various event and
event interface data types used by this library . It is not intended for
external use , and may not follow the PVP... |
b0abcf78f6d84188cd2a7c018effd55e884af2b43c14edf4bbc5acebc231d4bd | ygrek/mldonkey | donkeyFiles.ml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/networks/donkey/donkeyFiles.ml | ocaml |
if c.client_bucket = 0 then
direct_client_send sock (
let module M = DonkeyProtoClient in
let module Q = M.CloseSlot in
M.CloseSlotReq Q.t)
let len_int = Int32.to_int len in
lprintf "send_client_block\n";
Is there a message to warn that a file is not shared... | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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
... |
4d5883519611ac57445f91e27ddb2a1aaed0e4c942b6f9c11cb6d87668a98ccb | let-def/lrgrep | Core.ml | (******************************************************************************)
(* *)
(* Fix *)
(* ... | null | https://raw.githubusercontent.com/let-def/lrgrep/29e64174dc9617bcd1871fd2e4fd712269568324/lib/fix/Core.ml | ocaml | ****************************************************************************
Fix
... | , Paris
. All rights reserved . This file is distributed under the
terms of the GNU Library General Public License version 2 , with a
open Sigs
module Make
(M : IMPERATIVE_MAPS)
(P : PROPERTY)
= struct
type variable =
M.key
type propert... |
b9b0517e79cfce3d765affed339ddd5d89c6dbd9444993481ac60b4b948574b2 | racket/web-server | add-ssd.rkt | #lang racket/base
(require web-server/servlet)
(provide (all-defined-out))
(define interface-version 'v1)
(define timeout +inf.0)
; request-number : str -> num
(define (request-number which-number)
(send/suspend/dispatch
(lambda (embed/url)
(response/xexpr
`(html (head (title "Enter a Number to Add"))
... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/default-web-root/htdocs/servlets/examples/add-ssd.rkt | racket | request-number : str -> num | #lang racket/base
(require web-server/servlet)
(provide (all-defined-out))
(define interface-version 'v1)
(define timeout +inf.0)
(define (request-number which-number)
(send/suspend/dispatch
(lambda (embed/url)
(response/xexpr
`(html (head (title "Enter a Number to Add"))
(body ([bgcolor "... |
3f42651e6c711e55d62147f28f9b00239e9ac70015e83c399700406226d286b3 | yeller/datomic-riemann-reporter | datomic_riemann_reporter.clj | (ns datomic-riemann-reporter
(:require [riemann.client :as riemann]
[clojure.string :as s]
[environ.core :as environ]))
(def ^:dynamic *client* nil)
(defn client []
(if *client*
*client*
(if (and (environ/env :riemann-host) (environ/env :riemann-port))
(let [initialized (riem... | null | https://raw.githubusercontent.com/yeller/datomic-riemann-reporter/a3970275a9349607b4080413ecc04caa38c3ecba/src/datomic_riemann_reporter.clj | clojure | (ns datomic-riemann-reporter
(:require [riemann.client :as riemann]
[clojure.string :as s]
[environ.core :as environ]))
(def ^:dynamic *client* nil)
(defn client []
(if *client*
*client*
(if (and (environ/env :riemann-host) (environ/env :riemann-port))
(let [initialized (riem... | |
59b9e953e364b5013fa0023686789a13dbab0ada246d7ce0092f03abb3c8b23f | pasqu4le/huffer | Decoder.hs | module Decoder (decode, content) where
import Shared
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Char8 as BLC
import System.FilePath
import System.Directory
import Data.Binary.Get
import Control.Monad
import Data.List
import Data.Word (Word8)
data HuffTree = Leaf Word8 | Node HuffTree... | null | https://raw.githubusercontent.com/pasqu4le/huffer/9f31c71a10f2c0fdf4b8454fc1df693c6a41f3f2/Decoder.hs | haskell | flag to be used in the future
helper function to get get an huffDecoder from a codebook
Functions that work with lists of bits (big-endian) | module Decoder (decode, content) where
import Shared
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Char8 as BLC
import System.FilePath
import System.Directory
import Data.Binary.Get
import Control.Monad
import Data.List
import Data.Word (Word8)
data HuffTree = Leaf Word8 | Node HuffTree... |
7497140a137db0f169d1e095c940d365d032e9bc21e65d1919f1eed34d366ebe | burkaydurdu/muggle | db.cljs | (ns muggle.db
(:require [re-frame.core :refer [reg-cofx]]))
(def default-db {:name "Muggle"})
(defn set-item!
"Set `key' in browser's localStorage to `val`."
[key val]
(.setItem (.-localStorage js/window) key (.stringify js/JSON (clj->js val))))
(defn get-item
"Returns value of `key' from browser's localSt... | null | https://raw.githubusercontent.com/burkaydurdu/muggle/8c457397305be6ea2848a2537669a700d0147997/src/muggle/db.cljs | clojure | (ns muggle.db
(:require [re-frame.core :refer [reg-cofx]]))
(def default-db {:name "Muggle"})
(defn set-item!
"Set `key' in browser's localStorage to `val`."
[key val]
(.setItem (.-localStorage js/window) key (.stringify js/JSON (clj->js val))))
(defn get-item
"Returns value of `key' from browser's localSt... | |
7b927facc1b77535c0123b44760db2db98c46672ef02c9783d594ec05bcd7acc | earl-ducaine/cl-garnet | gem-compiler.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : COMMON - LISP - USER ; Base : 10 -*-
The Garnet User Interface Development Environment .
;;;
;;; This code was written as part of the Garnet project at
Carnegie Mellon University , and has been placed in the public
domain . If you are using this code or a... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/bone-yard/gem-compiler.lisp | lisp | Syntax : Common - Lisp ; Package : COMMON - LISP - USER ; Base : 10 -*-
This code was written as part of the Garnet project at
please contact to be put on the mailing list.
Global default settings.
"gem"
"define-methods"
"x"
(let ((gfile (concatenate 'string "gem:" file)))
(garnet-compile gfil... |
The Garnet User Interface Development Environment .
Carnegie Mellon University , and has been placed in the public
domain . If you are using this code or any part of Garnet ,
(in-package "COMMON-LISP-USER")
(defvar *debug-gem-mode* nil)
(eval-when (:compile-toplevel :load-toplevel :execute)
(proclaim
... |
9af5ffd00e76fe1da12346cfef7296e67a592a65f023ce37479e89f0839c88eb | erlang/otp | syntax_tools_SUITE.erl | ` ` Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under the License is distribut... | null | https://raw.githubusercontent.com/erlang/otp/b10731176840745de6fb547d00511947927f13ba/lib/syntax_tools/test/syntax_tools_SUITE.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permi... | ` ` Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
The Initial Developer of the Original Code is Ericsson Utvecklings AB .
Portions created by Ericsson are Copyright 1999 ,
-module(syntax_tools_SUITE).
-include_lib("... |
8317c560d7e0d7955f2410dbd1a5889a348663c7293fdaa3fb29e05c9bf0099e | cky/guile | compile-psyntax.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
Copyright ( C ) 2009 , 2010 , 2011 , 2012 Free Software Foundation , Inc.
;;;
;;; 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
... | null | https://raw.githubusercontent.com/cky/guile/89ce9fb31b00f1f243fe6f2450db50372cc0b86d/module/ice-9/compile-psyntax.scm | scheme | coding : utf-8 ; -*-
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A P... | Copyright ( C ) 2009 , 2010 , 2011 , 2012 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(use-modules (language tree-il)... |
87333493f5db9d8e662a31cfa21fee8b6410d10eb0790c993851464c31b01b2b | erlang/otp | tftp_file.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2005 - 2023 . All Rights Reserved .
%%
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 applic... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/tftp/src/tftp_file.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific l... | Copyright Ericsson AB 2005 - 2023 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author : < >
Created : 24 May 2004 by < >
-module(tftp_file).
Interface
-behaviour(tftp).
-export(... |
c323e48f0f2566ed6cd80435c8e9af8933e2240459b07a8764c44ad0477cdf90 | expipiplus1/vulkan | Main.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLists #
{-# OPTIONS_GHC -Wno-name-shadowing #-}
module Main
( main
) where
import Control.Exception ( handle )
import Control.Lens.Getter
import Control.Monad.Extra ( unlessM
... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/examples/resize/Main.hs | haskell | # LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Wno-name-shadowing #
--------------------------------------------------------------
Main performs some one time initialization of the windowing system and
--------------------------------------------------------------
Start SDL
Create everything up to the device
Now al... | # LANGUAGE OverloadedLists #
module Main
( main
) where
import Control.Exception ( handle )
import Control.Lens.Getter
import Control.Monad.Extra ( unlessM
, when
)... |
870ee9bc522244803e7f6add2284305fe9fab96f959fb7aaf32ee4908ab17881 | mdunnio/coinbase-pro | Change.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module CoinbasePro.WebSocketFeed.Channel.Full.Change
( Change (..)
) where
import Data.Aeson.Casing (snakeCase)
import Data.Aeson.TH (defaultOptions, deriveJSON,
fieldLabelModifier)
i... | null | https://raw.githubusercontent.com/mdunnio/coinbase-pro/5d5fa95e66481a974786ef362a4ea55ba94c63a9/src/lib/CoinbasePro/WebSocketFeed/Channel/Full/Change.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module CoinbasePro.WebSocketFeed.Channel.Full.Change
( Change (..)
) where
import Data.Aeson.Casing (snakeCase)
import Data.Aeson.TH (defaultOptions, deriveJSON,
fieldLabelModifier)
import Data.Time.Clock (... |
b7f20aa2d80acebd8df22862efcd227580011d88e59c91b1d952095f7d68c4a0 | facebook/flow | test_hashtbl.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/70f5a040edbc07f0ebfb01bc6c535f7ff336cc43/src/hack_forked/test/unit/heap/test_hashtbl.ml | ocaml | If we reuse a previously used slot, the number of nonempty slots
* stays the same
Test basic garbage collection works
no memory is wasted
Removing an element does not decrease used heap size
Garbage collection should remove the space taken by the removed element |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
2fe8b088bc01243d0ebbabfcd17ee466680f87c7381c225aa0c4007cb1535831 | jez/calz | Flow.hs | module Calz.Layout.Flow (layoutFlow, layoutFlowDebug) where
import Control.Monad.Reader
import Data.Function ((&))
import Data.List (groupBy)
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.R... | null | https://raw.githubusercontent.com/jez/calz/dbaf27ec38df7bcdc8356ac400782226ffc61b0d/src/Calz/Layout/Flow.hs | haskell |
considered part of _that_ month, even if they technically belong to the
January
February
March
> ]
--- Only for debugging ------------------------------------------------------ | module Calz.Layout.Flow (layoutFlow, layoutFlowDebug) where
import Control.Monad.Reader
import Data.Function ((&))
import Data.List (groupBy)
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.R... |
d1c06b9bd7259d0ac552f50ffe10379bef80f3acb422fda4ad00ad839318efc4 | zelark/AoC-2020 | day_13.clj | (ns zelark.aoc-2020.day-13
(:require [clojure.java.io :as io]))
--- Day 13 : Shuttle Search ---
;;
(def input (slurp (io/resource "input_13.txt")))
(defn parse-input [input]
(->> (re-seq #"\d+" input)
(map #(Long/parseLong %))))
(defn parse-input-2 [input]
(->> (re-seq #"x|\d+" input)
(rest)
... | null | https://raw.githubusercontent.com/zelark/AoC-2020/5417c3514889eb02efc23f6be7d69e29fdfa0376/src/zelark/aoc_2020/day_13.clj | clojure | (ns zelark.aoc-2020.day-13
(:require [clojure.java.io :as io]))
--- Day 13 : Shuttle Search ---
(def input (slurp (io/resource "input_13.txt")))
(defn parse-input [input]
(->> (re-seq #"\d+" input)
(map #(Long/parseLong %))))
(defn parse-input-2 [input]
(->> (re-seq #"x|\d+" input)
(rest)
... | |
36c0816574e4f227e1aa60de8de44a9d6c19af4e8d3fa8f3a209f0beb57fed89 | PeterDWhite/Osker | DeviceId.hs | Copyright ( c ) , 2001 , 2002 , 2003
Copyright ( c ) OHSU , 2001 , 2002 , 2003
module DeviceId ( DeviceId (..) ) where
----------------------------------------------------------------------
-- Define the global device identifier
----------------------------------------------------------------------
data DeviceI... | null | https://raw.githubusercontent.com/PeterDWhite/Osker/301e1185f7c08c62c2929171cc0469a159ea802f/Kernel/Global/DeviceId.hs | haskell | --------------------------------------------------------------------
Define the global device identifier
-------------------------------------------------------------------- | Copyright ( c ) , 2001 , 2002 , 2003
Copyright ( c ) OHSU , 2001 , 2002 , 2003
module DeviceId ( DeviceId (..) ) where
data DeviceId
= TimerDeviceId
| StandardInOut
| FileSystemId
deriving (Eq, Ord, Enum, Show)
|
740abe958668b8524e7f08f6426c7587a872c15280709657ef047b2d982ffdda | brendanhay/amazonka | AccessEffect.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
Derived from AWS service... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workmail/gen/Amazonka/WorkMail/Types/AccessEffect.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Module : A... |
c7f533538606787be3bcb3257e9499a7d97ca3941c3edee408c9a1ff9cefe4dc | diku-dk/futhark | Bench.hs | -- | @futhark bench@
module Futhark.CLI.Bench (main) where
import Control.Arrow (first)
import Control.Exception
import Control.Monad
import Control.Monad.Except hiding (throwError)
import Data.ByteString.Char8 qualified as SBS
import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.Either
import Data.Function ... | null | https://raw.githubusercontent.com/diku-dk/futhark/48bea2cc8c62cae59b391ddba162cdc8f915bdd9/src/Futhark/CLI/Bench.hs | haskell | | @futhark bench@
We force line buffering to ensure that we produce running output.
Otherwise, CI tools and the like may believe we are hung and kill
us.
Try to avoid concurrency at both program and data set level.
Explicitly prefixing the current directory is necessary for
no path component.
Go to start of lin... | module Futhark.CLI.Bench (main) where
import Control.Arrow (first)
import Control.Exception
import Control.Monad
import Control.Monad.Except hiding (throwError)
import Data.ByteString.Char8 qualified as SBS
import Data.ByteString.Lazy.Char8 qualified as LBS
import Data.Either
import Data.Function ((&))
import Data.IOR... |
317bee622b38bda45f5b64f217d9bc9c8b31f26cca49ac0ff589949172743f6e | scymtym/utilities.print-items | protocol.lisp | ;;;; protocol.lisp --- Tests for protocol functions of the utilities.print-items system.
;;;;
Copyright ( C ) 2013 - 2022 Jan Moringen
;;;;
Author : < >
(cl:in-package #:utilities.print-items.test)
(in-suite utilities.print-items)
(defclass mock (print-items-mixin)
((a :initarg :a
:reader mock-a
... | null | https://raw.githubusercontent.com/scymtym/utilities.print-items/dd80d20883ce7f25335ae065bc38495bb9a66097/test/protocol.lisp | lisp | protocol.lisp --- Tests for protocol functions of the utilities.print-items system.
Prevent SBCL from eliminating the call.
Disabling
Overriding
Sorting | Copyright ( C ) 2013 - 2022 Jan Moringen
Author : < >
(cl:in-package #:utilities.print-items.test)
(in-suite utilities.print-items)
(defclass mock (print-items-mixin)
((a :initarg :a
:reader mock-a
:initform nil)
(b :initarg :b
:reader mock-b
:initform nil)))
(defmethod pri... |
82ca01119fabd34f5f9531914f525cc75d692c27ffd3dfec154714f8eb327bd5 | tonyg/racket-auxiliary-macro-context | test-auxiliary-macro-context2.rkt | #lang racket
(require "test-auxiliary-macro-context.rkt")
(define-test-expander zot
(lambda (stx)
(syntax-case stx ()
[(_) #'("bar" (quux) "bar")]
[_ #'("bar" (zot) "zot")]))
(syntax-rules ()
[(_) "i am a zot"]))
(module+ test
(require rackunit)
(check-equal? (list (quux) (zot)) (list "i ... | null | https://raw.githubusercontent.com/tonyg/racket-auxiliary-macro-context/14f55981ab57c14ed4f93e06f49093b8ea0d158d/auxiliary-macro-context/test/test-auxiliary-macro-context2.rkt | racket | #lang racket
(require "test-auxiliary-macro-context.rkt")
(define-test-expander zot
(lambda (stx)
(syntax-case stx ()
[(_) #'("bar" (quux) "bar")]
[_ #'("bar" (zot) "zot")]))
(syntax-rules ()
[(_) "i am a zot"]))
(module+ test
(require rackunit)
(check-equal? (list (quux) (zot)) (list "i ... | |
dad27cb3b5a0a9ea493f15f46829b210ff8e01e78397f1fd08ecbd0f0e62d831 | rizo/snowflake-os | nativeint.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/stdlib/nativeint.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : , v 1.11 2007 - 01 - 30 09:3... |
eddbd7ce6a58330c91c329cdc4c53cef384f29280c427a9f056a3a4ad9f3979a | dizzyd/retest | create_rt.erl | -module(create_rt).
-include_lib("eunit/include/eunit.hrl").
files() ->
[{create, "file1", file1()}].
run(Dir) ->
?assertMatch({ok, [{contents, "12345ABCDEF"}]},
file:consult(Dir ++ "/file1")),
ok.
file1() ->
"{contents, \"12345ABCDEF\"}.\n".
| null | https://raw.githubusercontent.com/dizzyd/retest/6b33038bd4df4aab1dc15bb59076512ba8fbb113/test/retest_SUITE_data/create/create_rt.erl | erlang | -module(create_rt).
-include_lib("eunit/include/eunit.hrl").
files() ->
[{create, "file1", file1()}].
run(Dir) ->
?assertMatch({ok, [{contents, "12345ABCDEF"}]},
file:consult(Dir ++ "/file1")),
ok.
file1() ->
"{contents, \"12345ABCDEF\"}.\n".
| |
e047a6afc8782b4e49ebc0cff228f761fdc6e920e93efe91b971caaa1dba0764 | htmfilho/minimily | document.clj | (ns minimily.documents.web.ui.document
(:require [hiccup.form :refer [form-to submit-button label text-field text-area
hidden-field]]
[minimily.web.ui.layout :refer [layout]]
[minimily.web.ui.bootstrap :refer :all]
... | null | https://raw.githubusercontent.com/htmfilho/minimily/69b7657cb24231d9837274f8cf232c87661ae994/src/minimily/documents/web/ui/document.clj | clojure | (ns minimily.documents.web.ui.document
(:require [hiccup.form :refer [form-to submit-button label text-field text-area
hidden-field]]
[minimily.web.ui.layout :refer [layout]]
[minimily.web.ui.bootstrap :refer :all]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.