_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 |
|---|---|---|---|---|---|---|---|---|
2da950eafc194d0126d80d7d6ca6ba14e38dc9274fae817bdd46f2bd8aec41a2 | alex-hhh/ActivityLog2 | al-workouts.rkt | #lang racket
al-worktouts.rkt -- library functions for creating FIT workouts
;; This file is part of ActivityLog2, an fitness activity tracker
Copyright ( C ) 2015 , 2018 < >
;;
;; This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as publ... | null | https://raw.githubusercontent.com/alex-hhh/ActivityLog2/36a4bb8af45db19cea02e982e22379acb18d0c49/etc/al-workouts.rkt | racket | This file is part of ActivityLog2, an fitness activity tracker
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR P... | #lang racket
al-worktouts.rkt -- library functions for creating FIT workouts
Copyright ( C ) 2015 , 2018 < >
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 )
(require "../rkt/fit-file/fit-file.rkt")
(req... |
b725e8243775ebbfda897ca72411132947fc7e1bbff2e63c3cba9dbd47d44d51 | plow-technologies/yesod-routes-metrics | Util.hs | module Yesod.Routes.Util where
import Data.Char (isUpper)
import Yesod.Routes.TH.Types
-- useful for testing and debugging
showResourceTree :: (Show a) => ResourceTree a -> String
showResourceTree (ResourceLeaf rl) =
"ResourceLeaf: " ++ show rl
showResourceTree (ResourceParent s co... | null | https://raw.githubusercontent.com/plow-technologies/yesod-routes-metrics/a499200b21d023f30238822c274e2f27c4dec1be/src/Yesod/Routes/Util.hs | haskell | useful for testing and debugging | module Yesod.Routes.Util where
import Data.Char (isUpper)
import Yesod.Routes.TH.Types
showResourceTree :: (Show a) => ResourceTree a -> String
showResourceTree (ResourceLeaf rl) =
"ResourceLeaf: " ++ show rl
showResourceTree (ResourceParent s co ps rts) =
"ResourceParent: " ++ ... |
deb420a7e60093caf213894f74b4bce37b071e465b8de977da843d9c912061e6 | melange-re/melange | gpr_1943_test.ml | let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y =
incr test_id ;
suites :=
(loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites
let f x =
x##_003,
x##_50,
x##_50x,
x##__50,
x##__50x,
x##_50x',
x##x'
(* x##_ *) (*TODO: should have a syn... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/gpr_1943_test.ml | ocaml | x##_
TODO: should have a syntax error | let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y =
incr test_id ;
suites :=
(loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites
let f x =
x##_003,
x##_50,
x##_50x,
x##__50,
x##__50x,
x##_50x',
x##x'
let v =
f [%obj{
_003 = 0;
... |
da65532805469348681732388c0e848e724104b39d9d745d07d0826ea780eb41 | input-output-hk/hydra | Type.hs | # LANGUAGE EmptyCase #
{-# LANGUAGE ExplicitForAll #-}
# LANGUAGE PolyKinds #
module Hydra.Network.Ouroboros.Type where
import Hydra.Prelude
import qualified Cardano.Binary as CBOR
import qualified Codec.CBOR.Read as CBOR
import GHC.Show (Show (show))
import Network.TypedProtocol (PeerHasAgency (ClientAgency), Proto... | null | https://raw.githubusercontent.com/input-output-hk/hydra/b73e2cb15e3b9dc68dd4302b03a5bb11b426e654/hydra-node/src/Hydra/Network/Ouroboros/Type.hs | haskell | # LANGUAGE ExplicitForAll #
It is used both as a type level tag for the protocol and as the kind of the
types of the states in the protocol state machine. That is @FireForget@ is a
The actual messages in our protocol.
Messages define the possible transitions between the protocol's state as defined
We have to exp... | # LANGUAGE EmptyCase #
# LANGUAGE PolyKinds #
module Hydra.Network.Ouroboros.Type where
import Hydra.Prelude
import qualified Cardano.Binary as CBOR
import qualified Codec.CBOR.Read as CBOR
import GHC.Show (Show (show))
import Network.TypedProtocol (PeerHasAgency (ClientAgency), Protocol (..))
import Network.TypedPr... |
1dfb3154c9fc65315d87cdb1be6b925bd8bf45d23648d17ecdb0c52fa1eb1892 | bsaleil/lc | paraffins.scm.scm | ;;------------------------------------------------------------------------------
Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst... | null | https://raw.githubusercontent.com/bsaleil/lc/ee7867fd2bdbbe88924300e10b14ea717ee6434b/tools/benchtimes/resultVMIL-lc-gsc-lc/LC5/paraffins.scm.scm | scheme | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Gabriel benchmarks
C benchmarks
Other benchmarks
PARAFFINS -- Compute how many ... | Macros
(##define-macro (def-macro form . body)
`(##define-macro ,form (let () ,@body)))
(def-macro (FLOATvector-const . lst) `',(list->vector lst))
(def-macro (FLOATvector? x) `(vector? ,x))
(def-macro (FLOATvector . lst) `(vector ,@lst))
(def-macro (FLOATmake-vector n . init) `(make-vector ,... |
16d2fe33facaba8773fe9c0fb51cbfcb10318014f34b59f8a4c20acacc515a1d | RedPRL/cooltt | Tactic.mli | open Basis
open CodeUnit
module S := Syntax
module D := Domain
module RM := RefineMonad
module type Tactic =
sig
type tac
val update_span : LexingUtil.span option -> tac -> tac
val whnf : tac -> tac
end
(* general types *)
module Tp :
sig
include Tactic
val rule : ?name:string -> S.tp RM.m -> tac
(** ... | null | https://raw.githubusercontent.com/RedPRL/cooltt/9e37da9d029531b715a2af1d58b5df6a5fe79447/src/core/Tactic.mli | ocaml | general types
* A "virtual type" is one that is only permitted to appear as the domain of a pi type
* Only succeeds for non-virtual types
* Virtual types allowed | open Basis
open CodeUnit
module S := Syntax
module D := Domain
module RM := RefineMonad
module type Tactic =
sig
type tac
val update_span : LexingUtil.span option -> tac -> tac
val whnf : tac -> tac
end
module Tp :
sig
include Tactic
val rule : ?name:string -> S.tp RM.m -> tac
val virtual_rule : ?name... |
76cc2c9030f94e85eee038f0ed78ccff0bee4f956231218b2e353e86b29c0bc4 | jship/monad-logger-aeson | MetadataNoThreadContextNo.hs | # LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
module TestCase.LogInfo.MetadataNoThreadContextNo
( testCase
) where
import Control.Monad.Logger.Aeson (Loc(..), LogLevel(..), LoggedMessage(..), logInfo)
import Data.Aeson.QQ.Simple (aesonQQ)
import Data.Time (UTCTime(..))
imp... | null | https://raw.githubusercontent.com/jship/monad-logger-aeson/218dd4a1fd9fd7f86514322dd529444a55001443/monad-logger-aeson/test-suite/TestCase/LogInfo/MetadataNoThreadContextNo.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NamedFieldPuns #
# LANGUAGE QuasiQuotes #
module TestCase.LogInfo.MetadataNoThreadContextNo
( testCase
) where
import Control.Monad.Logger.Aeson (Loc(..), LogLevel(..), LoggedMessage(..), logInfo)
import Data.Aeson.QQ.Simple (aesonQQ)
import Data.Time (UTCTime(..))
import TestCase (TestCase(..))
import ... |
68274362201da5759bd6c68fafb71918b84ed1e7ca1361fe0416d8fe334779a2 | seanomlor/programming-in-haskell | euclid.hs | euclid :: Int -> Int -> Int
euclid a b
| a == b = a
| a > b = euclid (a - b) b
| otherwise = euclid a (b - a)
| null | https://raw.githubusercontent.com/seanomlor/programming-in-haskell/e05142e6709eeba2e95cf86f376a32c9e629df88/06-recursive-functions/euclid.hs | haskell | euclid :: Int -> Int -> Int
euclid a b
| a == b = a
| a > b = euclid (a - b) b
| otherwise = euclid a (b - a)
| |
567a42a368f4fd542fa571e3c60f4d975609cd82c94ecb3fc475b322f9b91db9 | lemmaandrew/CodingBatHaskell | array667.hs | From
Given an array of ints , return the number of times that two 6 's are next to each
other in the array . Also count instances where the second " is actually a 7 .
Given an array of ints, return the number of times that two 6's are next to each
other in the array. Also count instances where the second \"6... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Warmup-2/array667.hs | haskell | From
Given an array of ints , return the number of times that two 6 's are next to each
other in the array . Also count instances where the second " is actually a 7 .
Given an array of ints, return the number of times that two 6's are next to each
other in the array. Also count instances where the second \"6... | |
99bbba49bef1a575a4f23a5c547863ae3315165aef238024b6458361cc43e2f1 | esl/MongooseIM | mod_vcard_rdbms.erl | %%%----------------------------------------------------------------------
%%% File : mod_vcard.erl
Author : < >
%%% Purpose : vCard support via RDBMS
Created : 2 Jan 2003 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2011 ProcessOne
%%%
%%% This program is free software; you can redistribute it... | null | https://raw.githubusercontent.com/esl/MongooseIM/64d10a08d8e4700027734ec49ce4c4014b41b34b/src/vcard/mod_vcard_rdbms.erl | erlang | ----------------------------------------------------------------------
File : mod_vcard.erl
Purpose : vCard support via RDBMS
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WIT... | Author : < >
Created : 2 Jan 2003 by < >
ejabberd , Copyright ( C ) 2002 - 2011 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
Found... |
0a2113d2553ab15f3b7f198d94b3e36b5a650394e603de61cb701ff1e70c5ada | remixlabs/wasicaml | t030_tailcall2.ml | (* This is supported: *)
let rec f2 b c =
b + c
and f1 a b c =
f2 (a*b) (a*c)
let () =
let x = f1 3 4 5 in
Testprint.int "x" x
| null | https://raw.githubusercontent.com/remixlabs/wasicaml/74ff72535aa8e49ab94a05d9c32c059ce264c1bb/test/t030_tailcall2.ml | ocaml | This is supported: |
let rec f2 b c =
b + c
and f1 a b c =
f2 (a*b) (a*c)
let () =
let x = f1 3 4 5 in
Testprint.int "x" x
|
7c7bb4e17ee614191ffab62d6d844d472dc7e1ba435fec215532c9f91c34d0d0 | igorhvr/bedlam | ascii.scm | (module ascii
(ascii->char char->ascii ascii-limit ascii-whitespaces)
(define ascii->char integer->char)
(define char->ascii char->integer)
(define ascii-limit 256)
(define ascii-whitespaces '(32 9 10 11 12 13))
)
| null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-contrib/pure-scheme/ssax/ascii.scm | scheme | (module ascii
(ascii->char char->ascii ascii-limit ascii-whitespaces)
(define ascii->char integer->char)
(define char->ascii char->integer)
(define ascii-limit 256)
(define ascii-whitespaces '(32 9 10 11 12 13))
)
| |
16813b68371087790f35903216632d056ffd836180c41a07f2c2d0d8a86c7574 | kayceesrk/Quelea | SimpleBrokerNameServiceTest.hs | # LANGUAGE ScopedTypeVariables #
import Quelea.NameService.SimpleBroker
import System.Environment
import System.Process
import Control.Monad
import Control.Concurrent (threadDelay)
data Kind = B | C | S | D deriving (Read, Show)
brokerFE :: Frontend
brokerFE = Frontend "tcp://*:5558"
brokerBE :: Backend
brokerBE =... | null | https://raw.githubusercontent.com/kayceesrk/Quelea/73db79a5d5513b9aeeb475867a67bacb6a5313d0/tests/UnitTests/SimpleBrokerNameServiceTest.hs | haskell | # LANGUAGE ScopedTypeVariables #
import Quelea.NameService.SimpleBroker
import System.Environment
import System.Process
import Control.Monad
import Control.Concurrent (threadDelay)
data Kind = B | C | S | D deriving (Read, Show)
brokerFE :: Frontend
brokerFE = Frontend "tcp://*:5558"
brokerBE :: Backend
brokerBE =... | |
16757781529826074ecbc43393453869dde1a92055d118345b18c90fbd035732 | benzap/fif | macro_test.cljc | (ns fif.stdlib.macro-test
(:require
[clojure.test :refer [deftest testing is are]]
[fif.stdlib.macro]
[fif-test.utils :refer [teval are-eq*]]))
(deftest test-macro-creation
(is (= '("start" true 3 1 "end")
(teval
macro some_value
true
if
nil drop ... | null | https://raw.githubusercontent.com/benzap/fif/972adab8b86c016b04babea49d52198585172fe3/test/fif/stdlib/macro_test.cljc | clojure | (ns fif.stdlib.macro-test
(:require
[clojure.test :refer [deftest testing is are]]
[fif.stdlib.macro]
[fif-test.utils :refer [teval are-eq*]]))
(deftest test-macro-creation
(is (= '("start" true 3 1 "end")
(teval
macro some_value
true
if
nil drop ... | |
88e14ac3b23e5ec34b0a244f2ec91b09ef9ac8c259bf39abc84c790b31b60ec7 | racket/draw | cairo.rkt | #lang racket/base
(require ffi/unsafe
ffi/unsafe/define
ffi/unsafe/alloc
"cairo-lib.rkt"
"../private/libs.rkt"
"../private/utils.rkt")
(define-ffi-definer define-cairo cairo-lib
#:provide provide-protected)
(provide _cairo_t
_cairo_surface_t
_cairo_pattern_t
... | null | https://raw.githubusercontent.com/racket/draw/09fa3e82805e9d7f386213bda6e05a50ff55cb56/draw-lib/racket/draw/unsafe/cairo.rkt | racket | Racket, because a drawing suface might be a PDF or SVG file
that is written through a callback to Racket. Consequently,
name, so the Pango binding can use the same lock:
could be "cairo-pango-lock"
Display*
Drawable
Visual*
width
height
not an allocator
Context
Transforms
Text
must be immobile
Paths
Pat... | #lang racket/base
(require ffi/unsafe
ffi/unsafe/define
ffi/unsafe/alloc
"cairo-lib.rkt"
"../private/libs.rkt"
"../private/utils.rkt")
(define-ffi-definer define-cairo cairo-lib
#:provide provide-protected)
(provide _cairo_t
_cairo_surface_t
_cairo_pattern_t
... |
2e5e7207d6c45c29100966d8cd5de3fb5214c20f6f76197368568e1893f78724 | shirok/Gauche | test-record.scm | (use gauche.uvector)
(use gauche.sequence)
(use gauche.test)
(test-start "records")
(use gauche.record)
(test-module 'gauche.record)
;;--------------------------------------------------------------------
(test-section "rtd")
(define rtd1 #f)
(define rtd2 #f)
(test* "make-rtd" #t
(begin (set! rtd1 (make-rtd '... | null | https://raw.githubusercontent.com/shirok/Gauche/e606bfe5a94b100d5807bca9c2bb95df94f60aa6/ext/gauche/test-record.scm | scheme | --------------------------------------------------------------------
--------------------------------------------------------------------
SRFI-99 example
--------------------------------------------------------------------
SRFI-9 compatibility
record with parents.
constructor arguments
-----------------------------... | (use gauche.uvector)
(use gauche.sequence)
(use gauche.test)
(test-start "records")
(use gauche.record)
(test-module 'gauche.record)
(test-section "rtd")
(define rtd1 #f)
(define rtd2 #f)
(test* "make-rtd" #t
(begin (set! rtd1 (make-rtd 'rtd1 #(a b (immutable c))))
(rtd? rtd1)))
(test* "make-r... |
b40d156ac6ea28697dbc4e2dd78c8af55271528fa3252ec8958726971efdc192 | deadpendency/deadpendency | CargoManifest.hs | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.Rust.CargoManifest
( CargoManifestInput (..),
ParsedCargoManifest (..),
parsedCargoManifestCodec,
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdentifier
import Common.Model.Dependency.Depe... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-determiner/src/DD/Effect/DetermineDependencies/Backend/LanguageFiles/Rust/CargoManifest.hs | haskell | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.Rust.CargoManifest
( CargoManifestInput (..),
ParsedCargoManifest (..),
parsedCargoManifestCodec,
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdentifier
import Common.Model.Dependency.Depe... | |
16270a764b38041537584c8e2011415a236c709a39b1efb536f3426747c64d7b | ArulselvanMadhavan/diffusers-ocaml | inpaint.ml | open Torch
let height = 512
let width = 512
let version = "0.0.1"
let prepare_mask_and_masked_image in_img_path mask_path =
let image = Torch_vision.Image.load_image in_img_path in
let image = Base.Or_error.ok_exn image in
let image = Tensor.squeeze image in
let image = Tensor.div_scalar image (Scalar.f 255.)... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/diffusers-ocaml/e0a8df2b648b6d6c2f2e536f531d1083375881bf/bin/inpaint.ml | ocaml | open Torch
let height = 512
let width = 512
let version = "0.0.1"
let prepare_mask_and_masked_image in_img_path mask_path =
let image = Torch_vision.Image.load_image in_img_path in
let image = Base.Or_error.ok_exn image in
let image = Tensor.squeeze image in
let image = Tensor.div_scalar image (Scalar.f 255.)... | |
933fea4da4877cefed1e9ac026cb5ff4e2c38cb4424f06697c8c804317fc2b26 | ivanjovanovic/sicp | e-2.49.scm | Exercise 2.49 . Use segments->painter to define the following
; primitive painters:
; a. The painter that draws the outline of the designated frame.
; b. The painter that draws an ``X'' by connecting opposite corners of the frame.
; c. The painter that draws a diamond shape by connecting the midpoints of the ... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/2.2/e-2.49.scm | scheme | primitive painters:
a. The painter that draws the outline of the designated frame.
b. The painter that draws an ``X'' by connecting opposite corners of the frame.
c. The painter that draws a diamond shape by connecting the midpoints of the sides of the frame.
d. The wave painter.
-----------------------------... | Exercise 2.49 . Use segments->painter to define the following
1 . of the frame
(define outline-painter
(define outline-segment-list
(list
(make-segment (make-vect 0 0) (make-vect 1 0))
(make-segment (make-vect 1 0) (make-vect 1 1))
(make-segment (make-vect 1 1) (make-vect 0 1))
... |
7c4024c5a8112bdd723205825d187334b7f209e2a989b584e614787d50ad26a6 | ostinelli/bisbino | misultin_http.erl | % ==========================================================================================================
MISULTIN - Http(s )
%
% >-|-|-(°>
%
Copyright ( C ) 2010 , < > , .
% All rights reserved.
%
Code portions from have been originally taken under BSD license from Trapexit at the address :
% <>
%
% B... | null | https://raw.githubusercontent.com/ostinelli/bisbino/eb722fbf174edbe4aac0acb48ab3be076f241860/src/misultin_http.erl | erlang | ==========================================================================================================
>-|-|-(°>
All rights reserved.
<>
BSD License
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redis... | MISULTIN - Http(s )
Copyright ( C ) 2010 , < > , .
Code portions from have been originally taken under BSD license from Trapexit at the address :
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS OR
PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE C... |
38ae5b490c4f5dc76f6499114d45749d36d4a8b2b08963b219ee3f3352196824 | monadbobo/ocaml-core | lazy_sequence.mli | open Core.Std
Essentially a lazy list , but with a few differences .
Unlike lazy lists , laziness is achieved using thunks , * without * memoization . While this
has some downsides , it has the benefit of preventing any problems with space leaks .
It 's safe to hold on to a very long lazy sequence ev... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/lazy_sequence.mli | ocaml | false once the end of the sequence is reached
returns None when the end of the sequence is reached
returns None when the end of the sequence is reached
Producing a lazy sequence -------------------------------------------------------
Nil
Cons
still lazy even if list is empty
type 'a referentially_transpa... | open Core.Std
Essentially a lazy list , but with a few differences .
Unlike lazy lists , laziness is achieved using thunks , * without * memoization . While this
has some downsides , it has the benefit of preventing any problems with space leaks .
It 's safe to hold on to a very long lazy sequence ev... |
9f186b6a1378cd48a6de71308a94b867ff6d6d2b8cca8498e7d01f41d879f70b | ninenines/cowboy | delay_hello_h.erl | %% This module sends a hello world response after a delay.
-module(delay_hello_h).
-export([init/2]).
init(Req, Delay) when is_integer(Delay) ->
init(Req, #{delay => Delay});
init(Req, Opts=#{delay := Delay}) ->
_ = case Opts of
#{notify_received := Pid} ->
Pid ! {request_received, maps:get(path, Req)};
_ -... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/delay_hello_h.erl | erlang | This module sends a hello world response after a delay. |
-module(delay_hello_h).
-export([init/2]).
init(Req, Delay) when is_integer(Delay) ->
init(Req, #{delay => Delay});
init(Req, Opts=#{delay := Delay}) ->
_ = case Opts of
#{notify_received := Pid} ->
Pid ! {request_received, maps:get(path, Req)};
_ ->
ok
end,
timer:sleep(Delay),
{ok, cowboy_req:reply(2... |
8be37f483a05aceb1348464d95b3a604ad11f2aca7662fb9f1e624b81aebfffd | jaspervdj/advent-of-code | 16.hs | # LANGUAGE BangPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
import Data.Char (chr, ord)
import Data.List (foldl')
import Data.Maybe (fromMaybe)
import qualified Data.Vector.Unboxed as VU
import qualified System.IO as IO
import ... | null | https://raw.githubusercontent.com/jaspervdj/advent-of-code/bdc9628d1495d4e7fdbd9cea2739b929f733e751/2017/16.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
import Data.Char (chr, ord)
import Data.List (foldl')
import Data.Maybe (fromMaybe)
import qualified Data.Vector.Unboxed as VU
import qualified System.IO as IO
import ... | |
99e62bbbf576d3c0a5bba0d08ea2d309c6dc99689130dc19debf2cf08ea54a19 | fishcakez/sbroker | sbetter.erl | %%-------------------------------------------------------------------
%%
Copyright ( c ) 2016 , < >
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% -2.0
... | null | https://raw.githubusercontent.com/fishcakez/sbroker/10f7e3970d0a296fbf08b1d1a94c88979a7deb5e/src/sbetter.erl | erlang | -------------------------------------------------------------------
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,
KIND, either express or implied. See the Lic... | Copyright ( c ) 2016 , < >
This file is provided to you under the Apache License ,
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
best of two random choices . It is designed for use with ` sbroker ' and
` sregulator ' processes using ... |
425ab303e5ff4e8bc4dfc9bcb2254be449b7ed2f1e9ebe1ae0d35ce00060aea2 | DrearyLisper/aoc-2022 | day10.ml | open Base
open Stdio
exception Exception of string
type command =
| Noop
| Addx of int
type cpu = {
clock : int;
x : int;
}
let parse lines =
let parse line =
match String.split ~on:' ' line with
| ["noop"] -> [Noop]
| ["addx"; x] -> [Noop; Addx (Int.of_string x)]
| _ -> raise @@ Exception... | null | https://raw.githubusercontent.com/DrearyLisper/aoc-2022/79820d80b88a76dd7dfd36e92f9f1ca275a60d2f/10/day10.ml | ocaml | dune exec --display quiet --no-print-directory ./day10.exe | open Base
open Stdio
exception Exception of string
type command =
| Noop
| Addx of int
type cpu = {
clock : int;
x : int;
}
let parse lines =
let parse line =
match String.split ~on:' ' line with
| ["noop"] -> [Noop]
| ["addx"; x] -> [Noop; Addx (Int.of_string x)]
| _ -> raise @@ Exception... |
b739b2c6becbcf1b9983bd9d46ce775a04ba0b11dd5a534cb6e74de32bcf4bf4 | leksah/leksah | Workspaces.hs | # LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
-----------------------------------------------------------------------------
--
Module : IDE.Workspace
Copyright : 2007 - 2011 ,
-- License : GPL
--
-- Maintainer :
-- Stability : provisional
-... | null | https://raw.githubusercontent.com/leksah/leksah/ec95f33af27fea09cba140d7cddd010935a2cf52/src-gtk/IDE/Gtk/Workspaces.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------
License : GPL
Maintainer :
Stability : provisional
Portability :
| Represents a workspace, a work unit, which can be composed of multiple packages
----------------------------------------------... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
Module : IDE.Workspace
Copyright : 2007 - 2011 ,
module IDE.Gtk.Workspaces (
workspaceNew
, projectNew
, workspaceOpen
, projectOpen
, workspaceTry
, workspaceOpenThis
, workspaceClose
, projectAddPackage
, workspacePack... |
f4df612bc3ea0d5abe8f5d69012c0a907815a739a7c24d6f0e8ab76a8713492e | pascutto/cachecache | main.ml | let () =
Random.self_init ();
let error = ref false in
(try Alcotest.run ~and_exit:false "LRU" Lru.suite
with Alcotest.Test_error -> error := true);
(try Alcotest.run ~and_exit:false "LFU" Lfu.suite
with Alcotest.Test_error -> error := true);
if !error then exit 1 else exit 0
| null | https://raw.githubusercontent.com/pascutto/cachecache/d239c20d3411383c0399674f1425acce73dbf95e/test/main.ml | ocaml | let () =
Random.self_init ();
let error = ref false in
(try Alcotest.run ~and_exit:false "LRU" Lru.suite
with Alcotest.Test_error -> error := true);
(try Alcotest.run ~and_exit:false "LFU" Lfu.suite
with Alcotest.Test_error -> error := true);
if !error then exit 1 else exit 0
| |
06b4c5636b1572a5590a09794d20434c71b7e462e76982a346d770f7a98f71b1 | dQuadrant/kuber | MarketPlaceWorkflow.hs | # LANGUAGE NumericUnderscores #
# LANGUAGE TypeApplications #
module Test.MarketPlaceWorkflow where
import Cardano.Kuber.Api
import Data.Functor ((<&>))
import Cardano.Kuber.Data.Parsers (parseSignKey)
import System.Environment (getEnv)
import qualified Data.Text as T
import Cardano.Api
import Cardano.Kuber.Util (skeyT... | null | https://raw.githubusercontent.com/dQuadrant/kuber/3e84138732170536685808ec9fbf657868b7ff93/test/Test/MarketPlaceWorkflow.hs | haskell | # LANGUAGE NumericUnderscores #
# LANGUAGE TypeApplications #
module Test.MarketPlaceWorkflow where
import Cardano.Kuber.Api
import Data.Functor ((<&>))
import Cardano.Kuber.Data.Parsers (parseSignKey)
import System.Environment (getEnv)
import qualified Data.Text as T
import Cardano.Api
import Cardano.Kuber.Util (skeyT... | |
f82dca4a5c30203e03450e9c77414268a9b30145a96e66dd0823e3fb33379948 | WormBase/wormbase_rest | motif.clj | (ns rest-api.classes.motif
(:require
[rest-api.classes.gene.widgets.external-links :as external-links]
[rest-api.classes.motif.widgets.overview :as overview]
[rest-api.classes.graphview.widget :as graphview]
[rest-api.routing :as routing]))
(routing/defroutes
{:entity-ns "motif"
:widget
{:ove... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/motif.clj | clojure | (ns rest-api.classes.motif
(:require
[rest-api.classes.gene.widgets.external-links :as external-links]
[rest-api.classes.motif.widgets.overview :as overview]
[rest-api.classes.graphview.widget :as graphview]
[rest-api.routing :as routing]))
(routing/defroutes
{:entity-ns "motif"
:widget
{:ove... | |
e85aaf4b635cb10954ff340bddf5bc2ce0a7cbfa51c93b3af3e013369e10f76d | haroldcarr/learn-haskell-coq-ml-etc | Lib.hs | {-# LANGUAGE OverloadedStrings #-}
module Lib where
import Data.Monoid
import qualified Network.Wai.Middleware.Cors as Cors
import Network.Wai.Middleware.RequestLogger
import Prelude
import Web.Scotty
main :: IO ()
main = scotty 3001 $ do
-- Add any WAI middleware, ... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/46db416c48873cd60cf51f8f5678908436e8d7ef/haskell/topic/web/htmx-with-scotty/src/Lib.hs | haskell | # LANGUAGE OverloadedStrings #
Add any WAI middleware, they are run top-down.
Parameter in query string. |
module Lib where
import Data.Monoid
import qualified Network.Wai.Middleware.Cors as Cors
import Network.Wai.Middleware.RequestLogger
import Prelude
import Web.Scotty
main :: IO ()
main = scotty 3001 $ do
middleware $ Cors.cors (const $ Just (Cors.simpleCorsResourceP... |
c0fb5c67e36bd1bea30cf3e65e46cdbbd12eea0c6af9afca827c9e6817259fc5 | fission-codes/fission | Class.hs | module Fission.CLI.Environment.Class (MonadEnvironment (..)) where
import Fission.Prelude
-- | A monad representing access to the configurable environment
class Monad m => MonadEnvironment m where
getGlobalPath :: m FilePath -- ^ Must be the absolute path
| null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-cli/library/Fission/CLI/Environment/Class.hs | haskell | | A monad representing access to the configurable environment
^ Must be the absolute path | module Fission.CLI.Environment.Class (MonadEnvironment (..)) where
import Fission.Prelude
class Monad m => MonadEnvironment m where
|
96da9eeda7adfb17782b66b198290b561679093ce2d0a2a61e853f792bd8a208 | dpiponi/Moodler | addknob.fails.hs | do
plane <- currentPlane
as <- selection
forM_ as $ \b -> do
bType <- getType b
case bType of
InType -> do
(x, y) <- location b
Just n <- name b
Just c <- getColour b
p <- getParent b
k <- knob' n (x,... | null | https://raw.githubusercontent.com/dpiponi/Moodler/a0c984c36abae52668d00f25eb3749e97e8936d3/Moodler/scripts/addknob.fails.hs | haskell | do
plane <- currentPlane
as <- selection
forM_ as $ \b -> do
bType <- getType b
case bType of
InType -> do
(x, y) <- location b
Just n <- name b
Just c <- getColour b
p <- getParent b
k <- knob' n (x,... | |
edaddde81f70a29003ed22752f5167b238acc163846861483b176b904abdf9ce | jyh/metaprl | tptp_lex.mli |
* This is the lexer for the TPTP library .
*
* ----------------------------------------------------------------
*
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment for OCaml and other languages .
*
* See the file do... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/tptp/tptp_lex.mli | ocaml |
* -*-
* Local Variables:
* Caml-master: "refiner"
* End:
* -*-
|
* This is the lexer for the TPTP library .
*
* ----------------------------------------------------------------
*
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment for OCaml and other languages .
*
* See the file do... |
046dd5dc2723927395c5ee4944a91c4b32c859379972d1f8967e324ca568c188 | racket/htdp | random-seed-works.rkt | #lang racket
;; testing the combination of random-seed and world programming
;; -----------------------------------------------------------------------------
(require 2htdp/universe 2htdp/image)
(define (main)
(random-seed 1324)
(big-bang
'()
#;
(on-tick (λ (l) (cons (random 100) l)) 1/100 30)
;; it... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/2htdp/tests/random-seed-works.rkt | racket | testing the combination of random-seed and world programming
-----------------------------------------------------------------------------
it fails mostly with just time but not always, strange
-----------------------------------------------------------------------------
disable in drdr | #lang racket
(require 2htdp/universe 2htdp/image)
(define (main)
(random-seed 1324)
(big-bang
'()
(on-tick (λ (l) (cons (random 100) l)) 1/100 30)
(to-draw (λ (l)
(text (if (> (length l) 3)
"ok"
(~a "press a again: " (- 2 (length l))))
222
*color)))
(on-key (λ... |
e686d53b11ec2ef3280373172de0c6eb3b0c3a6cdc1a7a074ea2ab0347dc11e4 | appleshan/cl-http | http-proxy-6-29.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : USER ; Base : 10 ; Patch - File : t -*-
Patch file for HTTP - PROXY version 6.29
;;; Reason: Remove function HTTP::PROXY-CACHE-VERIFY-ENTITY-VALIDITY: undefine.
;;; Function HTTP::PROXY-CACHE-VERIFY-ENTITY-VALIDITY:
;;; Add active-check-p argument in order to p... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/lispm/proxy/patch/http-proxy-6/http-proxy-6-29.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 ; Patch - File : t -*-
Reason: Remove function HTTP::PROXY-CACHE-VERIFY-ENTITY-VALIDITY: undefine.
Function HTTP::PROXY-CACHE-VERIFY-ENTITY-VALIDITY:
Add active-check-p argument in order to provide verify the existing of the entity in storage media.
Function (C... | Patch file for HTTP - PROXY version 6.29
while running on FUJI - VLM from FUJI:/usr / lib / symbolics / ComLink-39 - 8 - F - MIT-8 - 5.vlod
with Open Genera 2.0 , Genera 8.5 , Lock Simple 437.0 , Version Control 405.0 ,
Compare Merge 404.0 , VC Documentation 401.0 ,
Logical Pathnames Translation Files NEWEST ... |
ae640d64c8d9b2af25b73277e300a264073477850f03bc93440e78c2550b8c03 | ocaml-ppx/ppx | list.ml | include ListLabels
type 'a t = 'a list
let map ~f t = rev (rev_map ~f t)
let is_empty = function
| [] -> true
| _ -> false
let rec filter_map l ~f =
match l with
| [] -> []
| x :: l ->
match f x with
| None -> filter_map l ~f
| Some x -> x :: filter_map l ~f
let rec filter_opt l =
match l ... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/stdppx/list.ml | ocaml | include ListLabels
type 'a t = 'a list
let map ~f t = rev (rev_map ~f t)
let is_empty = function
| [] -> true
| _ -> false
let rec filter_map l ~f =
match l with
| [] -> []
| x :: l ->
match f x with
| None -> filter_map l ~f
| Some x -> x :: filter_map l ~f
let rec filter_opt l =
match l ... | |
65786acd3a93f60fb05eca2392eea9cad261201126613a396cfd2f2de377641c | gheber/kenzo | macros-test.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test -1-expt-n
(is (equal -1 (cat-7:-1-expt-n 5)))
(is (equal 1 (cat-7:-1-expt-n 6))))
(test -1-expt-n+1
(is (equal 1 (cat-7:-1-expt-n+1 5)))
(is (equal -1 (cat-7:-1-expt-n+1 6... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/test/kenzo-7/macros-test.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - * |
(in-package :kenzo-test-7)
(in-suite :kenzo-7)
(test -1-expt-n
(is (equal -1 (cat-7:-1-expt-n 5)))
(is (equal 1 (cat-7:-1-expt-n 6))))
(test -1-expt-n+1
(is (equal 1 (cat-7:-1-expt-n+1 5)))
(is (equal -1 (cat-7:-1-expt-n+1 6))))
(test -1-expt-n-1
(is (equal 1 (cat-7:-1-expt-n+1 5))... |
d9c9a13beff764e38977a4c448a2869f7e3d807bc2d074197f34ca0e0433d23d | tamarin-prover/tamarin-prover | Variants.hs | -- |
Copyright : ( c ) 2010 - 2012
-- License : GPL v3 (see LICENSE)
--
Maintainer : < >
--
-- Computing and checking the variants of a term.
module Term.Narrowing.Variants (
computeVariantsCheck
, module Term.Narrowing.Variants.Compute
, module Term.Narrowing.Variants.Check
) where
import T... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/c78c7afd3b93b52dd4d2884952ec0fc273832a0d/lib/term/src/Term/Narrowing/Variants.hs | haskell | |
License : GPL v3 (see LICENSE)
Computing and checking the variants of a term.
| @variantsListCheck ts@ computes all variants of @ts@ considered as a single term
without a bound or symmetry substitution. Before returning the result, it checks
if the set of variants is complete and minimal. If that is ... | Copyright : ( c ) 2010 - 2012
Maintainer : < >
module Term.Narrowing.Variants (
computeVariantsCheck
, module Term.Narrowing.Variants.Compute
, module Term.Narrowing.Variants.Check
) where
import Term.Narrowing.Variants.Compute
import Term.Narrowing.Variants.Check
import Term.Unification
import ... |
a0fa435aac2dee78f609b5668de64c49d1a3eed5de7b1050357d91b0ee81559f | jfeser/castor | schema_types.ml | open Core
open Ast
open Schema
let types (r : < resolved : Resolve.resolved ; .. > annot) =
schema r |> List.map ~f:Name.type_exn
let types_full ( r : < resolved : Resolve.resolved ; .. ) =
schema_full r | > List.map ~f :
let names_and_types (r : < resolved : Resolve.resolved ; .. > annot) =
schema r |>... | null | https://raw.githubusercontent.com/jfeser/castor/e9f394e9c0984300f71dc77b5a457ae4e4faa226/lib/schema_types.ml | ocaml | open Core
open Ast
open Schema
let types (r : < resolved : Resolve.resolved ; .. > annot) =
schema r |> List.map ~f:Name.type_exn
let types_full ( r : < resolved : Resolve.resolved ; .. ) =
schema_full r | > List.map ~f :
let names_and_types (r : < resolved : Resolve.resolved ; .. > annot) =
schema r |>... | |
cb38f9911db1040cc6c82f2a7fe67a9e9c382a3fa2e755f6a571b102af8c0958 | kirel/detexify-hs-backend | Strokes.hs | {-# LANGUAGE OverloadedStrings #-}
module JSON.Strokes where
import Data.Functor
import Control.Applicative
import Data.Aeson
import Strokes
import StrokeSample
toPoint a b = Point (a,b)
instance FromJSON Point where
parseJSON (Object v) = toPoint <$> v .: "x" <*> v .: "y"
instance ToJSON Point where
toJSON (Po... | null | https://raw.githubusercontent.com/kirel/detexify-hs-backend/555a97ff2484867ff4bb07c4269efc5f7d24800d/src/JSON/Strokes.hs | haskell | # LANGUAGE OverloadedStrings # | module JSON.Strokes where
import Data.Functor
import Control.Applicative
import Data.Aeson
import Strokes
import StrokeSample
toPoint a b = Point (a,b)
instance FromJSON Point where
parseJSON (Object v) = toPoint <$> v .: "x" <*> v .: "y"
instance ToJSON Point where
toJSON (Point (x,y)) =
object [ "x" .= x,... |
3a64ac46573799b4a335153f910c72efdfd4b5b801abb81cab0ca1ea91d5b0ec | input-output-hk/cardano-rest | Util.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Explorer.Web.Api.Legacy.Util
( blockPosixTime
, bsBase16Encode
, collapseTxGroup
, decodeTextAddress
, defaultPageSize
, divRoundUp
, genesisDistributionTxHash
, k
, runQuery
, textBase16Decode
, textShow
, toPageSize
, zipTxBr... | null | https://raw.githubusercontent.com/input-output-hk/cardano-rest/040b123b45af06060aae04479d92fada68820f12/explorer-api/src/Explorer/Web/Api/Legacy/Util.hs | haskell | # LANGUAGE OverloadedStrings #
| Attempt decoding an 'Address' using a Bech32 encoding.
| Attempt decoding a legacy 'Address' using a Base58 encoding. | # LANGUAGE LambdaCase #
module Explorer.Web.Api.Legacy.Util
( blockPosixTime
, bsBase16Encode
, collapseTxGroup
, decodeTextAddress
, defaultPageSize
, divRoundUp
, genesisDistributionTxHash
, k
, runQuery
, textBase16Decode
, textShow
, toPageSize
, zipTxBrief
, isRedeemAddress
) where
... |
3bb5e496517192cdf47f649bc0e6f2bffd9b49e2e945a3b6ea88d104a1d0d02f | iokasimov/pandora | Provision.hs | # OPTIONS_GHC -fno - warn - orphans #
module Pandora.Paradigm.Inventory.Some.Provision where
import Pandora.Core.Interpreted (Interpreted (Primary, run, unite, (<~)))
import Pandora.Pattern.Semigroupoid ((.))
import Pandora.Pattern.Category (identity, (<--), (<---), (<----))
import Pandora.Pattern.Functor.Covariant (C... | null | https://raw.githubusercontent.com/iokasimov/pandora/68662a508749f1cf02d0178679435a24f07dcaf2/Pandora/Paradigm/Inventory/Some/Provision.hs | haskell | ), (<---), (<----))
>), (%))
f . x
g . f
>) (:*:) (:*:) (Provision e) where
> ) < ~ ) . ( run < < -|- ) . ( run > ) < -|- )
>) (-->) (:*:) (:*:) (Provision e) where
\ _ - > run f One
\e -> (run % e) . f . x <-- e
point < -|- run x
Provision identity | # OPTIONS_GHC -fno - warn - orphans #
module Pandora.Paradigm.Inventory.Some.Provision where
import Pandora.Core.Interpreted (Interpreted (Primary, run, unite, (<~)))
import Pandora.Pattern.Semigroupoid ((.))
import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))
import Pandora.Pattern.Functor.Contravariant (Co... |
e0c672926bd5b4de4fc38bb0775b920222098f1172715c806cd0bfaaeae9ec13 | jlouis/combinatorrent | Timer.hs | -- | The timer module is responsible for timing in the project. With
-- the timer system, we can register timers in the future and then
-- we can get a tick triggered at the point in time where we need to
-- act. This allows us to postpone events into the future at a
-- designated time.
--
module Process.Timer
... | null | https://raw.githubusercontent.com/jlouis/combinatorrent/a8660bc29507f3774d79bd364b8b509cf5146282/src/Process/Timer.hs | haskell | | The timer module is responsible for timing in the project. With
the timer system, we can register timers in the future and then
we can get a tick triggered at the point in time where we need to
act. This allows us to postpone events into the future at a
designated time.
# SCC "Timer" # | module Process.Timer
( registerSTM
)
where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad.Trans
registerSTM :: MonadIO m => Int -> TChan a -> a -> m ThreadId
threadDelay (secs * 1000000)
atomically $ writeTChan c m
|
d7c5a82d5cf73d3524f34adeef6d1d6ada58f529a71a60283b13df42369346a6 | filipanselmo11/Lisp | 5.lisp | (defun operacoesAritmeticas()
(print "Digite o primeiro valor: ")
(setq v1 (read))
(print "Digite o segundo valor: ")
(setq v2 (read))
(setq soma(+ v1 v2))
(setq sub(- v1 v2))
(setq mult(* v1 v2))
(setq div(/ v1 v2))
(print "A lista resultante e: ")
(setq lista (list v1 v2 soma sub mult div))
(print lista... | null | https://raw.githubusercontent.com/filipanselmo11/Lisp/0395bbfa40280ad0d9a9eab3378d813ec89e195a/5.lisp | lisp | (defun operacoesAritmeticas()
(print "Digite o primeiro valor: ")
(setq v1 (read))
(print "Digite o segundo valor: ")
(setq v2 (read))
(setq soma(+ v1 v2))
(setq sub(- v1 v2))
(setq mult(* v1 v2))
(setq div(/ v1 v2))
(print "A lista resultante e: ")
(setq lista (list v1 v2 soma sub mult div))
(print lista... | |
f09780d1031ccee432ec5a71ca24a4529a25eb9465da038ff6af3d2d23724ad1 | serokell/importify | 20-IOQualifiedUnused.hs | module IOQualifiedUnused where
import qualified System.IO as IO (putStrLn)
main :: IO ()
main = pure ()
| null | https://raw.githubusercontent.com/serokell/importify/09f31d851b2152ae6ce880b81abc3554ade29f37/test/test-data/base%40basic/20-IOQualifiedUnused.hs | haskell | module IOQualifiedUnused where
import qualified System.IO as IO (putStrLn)
main :: IO ()
main = pure ()
| |
6de7ba15de4fb183b3a61a80d7b3fba56c1ef07e034536735501af8bd5386095 | mokus0/gamma | LanczosConstants.hs | -- This makes use of a not-yet-released matrix library. It could be rewritten
-- to use any of the existing ones on hackage, but I don't know of any of them
-- that support matrices over arbitrary types - they are all focused on
-- efficiently packing the matrices and/or calling foreign libraries
( BLAS / GSL / etc ... | null | https://raw.githubusercontent.com/mokus0/gamma/8c9bb99b9af1d2f3026bb7ed3899fdf2ff0113e7/extras/LanczosConstants.hs | haskell | This makes use of a not-yet-released matrix library. It could be rewritten
to use any of the existing ones on hackage, but I don't know of any of them
that support matrices over arbitrary types - they are all focused on
efficiently packing the matrices and/or calling foreign libraries
Complex Double/Float.
I a... | ( BLAS / GSL / etc . ) and do not support any types other than Double , Float , and
The algorithm implemented here is by , and is described in full
at ( as of 21 June 2010 ) .
module LanczosConstants where
import Math.Matrix
import Math.Matrix.Alias
cs g n = vectorToList (applyRat dbc f)
where
ap... |
5568e0d81f279846e2be31ce1bfc2b054724ded396f984001a4a432b4e32b88e | racket/htdp | info.rkt | #lang info
(define scribblings '(("test-engine.scrbl" () (tool-library))))
| null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-doc/test-engine/info.rkt | racket | #lang info
(define scribblings '(("test-engine.scrbl" () (tool-library))))
| |
6a72305713882b71ec306dd1675f511a6216b3d6c95f9cb2b5130c22227a4167 | GNOME/gimp-tiny-fu | mkbrush.scm | ; GIMP - The GNU Image Manipulation Program
Copyright ( C ) 1995 and
;
; Make-Brush - a script for the script-fu program
by < >
;
18 - Dec-2000 fixed to work with the new convention ( not inverted ) of
gbr saver ( )
;
; This program is free software: you can redistribute it and/or modify
... | null | https://raw.githubusercontent.com/GNOME/gimp-tiny-fu/a64d85eec23b997e535488d67f55b44395ba3f2e/scripts/mkbrush.scm | scheme | GIMP - The GNU Image Manipulation Program
Make-Brush - a script for the script-fu program
This program is free software: you can redistribute it and/or modify
either version 3 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT A... | Copyright ( C ) 1995 and
by < >
18 - Dec-2000 fixed to work with the new convention ( not inverted ) of
gbr saver ( )
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(define (script-fu-make-brush-re... |
48842ec487bb08187854af40638e9db54c1b015b00ebe4ab81a3407230a90d9e | well-typed/large-records | Show.hs | {-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Data.Record.Generic.Show (
gshowsPrec
) where
import Data.Record.Generic
import Data.List (intersperse)
import GHC.Show
import qualified Data.Record.Generic.Rep as Rep
| Generic definition of ' sho... | null | https://raw.githubusercontent.com/well-typed/large-records/fbc9d886094b7b40d6b89db72ff4c7fb59d5b903/large-generics/src/Data/Record/Generic/Show.hs | haskell | # LANGUAGE RecordWildCards #
Typical usage:
> instance Show T where
> showsPrec = gshowsPrec | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Data.Record.Generic.Show (
gshowsPrec
) where
import Data.Record.Generic
import Data.List (intersperse)
import GHC.Show
import qualified Data.Record.Generic.Rep as Rep
| Generic definition of ' showsPrec ' , compatible with the GHC ge... |
53e2d0086859b2abbe39732d70408b7d0816b2bd09143cf0abdd85291f2250f3 | aiya000/haskell-examples | Vect.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
import Data.Proxy (Proxy(..))
import GHC.TypeLits
data Vect (n :: Nat) a :: * where
Nil :: Vect 0 a
(:::) :: a -> Vect n a -> Vect (n + 1) a
infixr 7 :::
x... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Language/Haskell/Extension/Room/Vect.hs | haskell | # LANGUAGE GADTs #
HaskellではNatが値を持たないのでIntを使う
{output} | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
import Data.Proxy (Proxy(..))
import GHC.TypeLits
data Vect (n :: Nat) a :: * where
Nil :: Vect 0 a
(:::) :: a -> Vect n a -> Vect (n + 1) a
infixr 7 :::
xs :: Vect 5 Int
xs = 1 ... |
e0444b28fd11d26615a0b48d37559c28fb61b14491a05b67048fa1e2b6c412c8 | donaldsonjw/bigloo | bgl123.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / api / mpg123 / examples / bgl123.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/api/mpg123/examples/bgl123.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / api / mpg123 / examples / bgl123.scm * /
* Author : * /
* Creation : Fri Jun 24 16:20:46 2011 * /
* Last change : Mon Oct 24 15:31:33 2011 ( serrano ) * /
* Co... |
491479eba64340b9e8a7080bb5c907ecd6aeb29c94c63d613106ac1c4c57ccbe | 3b/3bgl-misc | basecode-projection.lisp | (in-package #:basecode)
;;; todo: adjust projection matrix when parameters are changed...
(defclass projection ()
to be updated by subclasses when updating GL projection matrix
;; for use by code that doesn't use fixed-function transforms
((projection-matrix :initform (sb-cga:identity-matrix)
... | null | https://raw.githubusercontent.com/3b/3bgl-misc/e3bf2781d603feb6b44e5c4ec20f06225648ffd9/basecode/basecode-projection.lisp | lisp | todo: adjust projection matrix when parameters are changed...
for use by code that doesn't use fixed-function transforms
fixed size ortho projection (ORTHO-PROJECTION-SCALE unit square
not really expecting these to be used, but might as well be there
in case someone tries...
:center by default
(gl:load-identity)... | (in-package #:basecode)
(defclass projection ()
to be updated by subclasses when updating GL projection matrix
((projection-matrix :initform (sb-cga:identity-matrix)
:reader projection-matrix)))
centered at 0,0,0 is scaled to fit in view area )
(defclass ortho-projection-fixed (projection... |
5a00c361d7b43d79fa2fe2832061c082f7c1b6070e447c599236272a62f195b6 | facebook/flow | commandConnect.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/52e59c7a9dea8556e7caf0be2b2c5c2e310b5b65/src/commands/commandConnect.ml | ocaml | Starts up a flow server by literally calling flow start
A featureful wrapper around CommandConnectSimple.connect_once. This
* function handles retries, timeouts, displaying messages during
* initialization, etc
Don't decrement retries -- the server is definitely not running,
* so the next time round will ... |
* 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... |
86960566f833df71c99658c772300fa1a614ec11b9e5869ff346f4ea3b57d863 | startalkIM/ejabberd | ejabberd_SUITE.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2002 - 2016 , ProcessOne
%%% @doc
%%%
%%% @end
Created : 2 Jun 2013 by < >
%%%-------------------------------------------------------------------
-module(ejabberd_SUITE).
-compile(export_all).
-import(suite, [init_... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/test/ejabberd_SUITE.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
We always need localhost for the generic no_db tests
Not a backend related group, do default init:
All backends enabled
Skipped backends that were not explicitely enab... | @author < >
( C ) 2002 - 2016 , ProcessOne
Created : 2 Jun 2013 by < >
-module(ejabberd_SUITE).
-compile(export_all).
-import(suite, [init_config/1, connect/1, disconnect/1,
recv/0, send/2, send_recv/2, my_jid/1, server_jid/1,
pubsub_jid/1, proxy_jid/1, muc_jid/1, muc_ro... |
5d24e68dd08d117f6960b70be62c8a47fcc290edb3527743f87b0e99fd0957c6 | inclojure-org/intermediate-clojure-workshop | lazy.clj | (ns workshop-app.handlers.lazy)
1 - Infinity
;; Simple example of range
(comment
(range 10))
;; What happens when range is unbounded
;; DON'T EVALUATE THIS
(comment
(range))
(comment
(take 10 (range))
(take 10 (map inc (range)))
(take 10 (filter even? (map inc (range)))))
2 - Maths
Let 's c... | null | https://raw.githubusercontent.com/inclojure-org/intermediate-clojure-workshop/3338a476aa815a587fa9e0b8b3804aa43492d15e/save-points/9/src/workshop_app/handlers/lazy.clj | clojure | Simple example of range
What happens when range is unbounded
DON'T EVALUATE THIS
a - approximation
n - Number
a = (a + n/a)/2
(f a0) = a1
(f a1) = a2
(f a2) = a3
(f a4) = a4
The algorithm is recursive
((f (f (f a0) a1) a2)..)
But it can also be thought of a sequence
[a0, f a0, f (f a0), f (f (f a0)), . . ... | (ns workshop-app.handlers.lazy)
1 - Infinity
(comment
(range 10))
(comment
(range))
(comment
(take 10 (range))
(take 10 (map inc (range)))
(take 10 (filter even? (map inc (range)))))
2 - Maths
Let 's calculate square roots by Newton - Raphson Square Roots method
( / ( + a ( / n a ) ) 2 )... |
072aac03e959418770d238182d94ee5e634e6b3b1d3b45f463d35a1e017f17c9 | davdar/maam | SumOfProdVal.hs | module Lang.Hask.SumOfProdVal where
import FP
import Lang.Hask.Semantics
import Literal
import DataCon
newtype SumOfProdVal ν lτ dτ = SumOfProdVal { unSumOfProdVal :: SumOfProd (ν lτ dτ) }
deriving (Eq, Ord, Buildable (ν lτ dτ), Bot, Join, JoinLattice, Meet, Neg, Pretty)
sumOfProdValConcretize :: (Ord b) => (ν lτ ... | null | https://raw.githubusercontent.com/davdar/maam/2cc3ff3511a7a4daadcd44c60c4b08862c01e183/src/Lang/Hask/SumOfProdVal.hs | haskell | module Lang.Hask.SumOfProdVal where
import FP
import Lang.Hask.Semantics
import Literal
import DataCon
newtype SumOfProdVal ν lτ dτ = SumOfProdVal { unSumOfProdVal :: SumOfProd (ν lτ dτ) }
deriving (Eq, Ord, Buildable (ν lτ dτ), Bot, Join, JoinLattice, Meet, Neg, Pretty)
sumOfProdValConcretize :: (Ord b) => (ν lτ ... | |
79c1429112c6593c4a3e49409365a7fc810398c3e987922c613219550922df5d | velveteer/crossed | generator.clj | (ns app.server.generator
(:require [app.server.clues :refer [random-clue-generator]]
[app.server.util :refer [generator->lazy-seq enumerate
first-index-of]]))
;; Dynamically bound generator function for fetching new clues from
;; functions in this file.
(def ^:dynamic... | null | https://raw.githubusercontent.com/velveteer/crossed/ebcd4260060bfb46ba1da4f722799239ad61d30c/src/app/server/generator.clj | clojure | Dynamically bound generator function for fetching new clues from
functions in this file.
empty space before it.
The last letter must have an
empty space after it.
Each letter must be on the grid.
It must either match an existing letter in the
grid, or have no conflicting letters on either
side.
If there is al... | (ns app.server.generator
(:require [app.server.clues :refer [random-clue-generator]]
[app.server.util :refer [generator->lazy-seq enumerate
first-index-of]]))
(def ^:dynamic *random-clue-generator* (fn [] nil))
(def grid-size 15)
(def word-count 100)
(def max-placemen... |
95f3279d00e09f6be5602f880f030b1b634d5c7fecc471e4894e6ee8805a7d70 | cstar/erldis | erldis_pool_sup.erl | -module(erldis_pool_sup).
-export([
start_link/1,
stop/0,
init/1,
add_pid/2,
get_pids/1,
get_random_pid/1
]).
%%
%% @doc Starts a supervisor that manages pools of Redis connections.
%%
%% ConnList is a list of {{Host, Port}, PoolSize} tuples.
%% PoolSize connections will be opened to each {Host, Port}.
%... | null | https://raw.githubusercontent.com/cstar/erldis/375260795e6a3de2600e297658f364deedbe6f1b/src/erldis_pool_sup.erl | erlang |
@doc Starts a supervisor that manages pools of Redis connections.
ConnList is a list of {{Host, Port}, PoolSize} tuples.
PoolSize connections will be opened to each {Host, Port}.
localhost:6380.
Create an ETS table to hold the list of child PIDs
Ensure the table is cleared
Start a supervisor to manage the ... | -module(erldis_pool_sup).
-export([
start_link/1,
stop/0,
init/1,
add_pid/2,
get_pids/1,
get_random_pid/1
]).
ConnList = [ { { " localhost " , 6379 } , 5 } , { { " localhost " , 6380 } , 5 } ] .
The above ConnList specifies 5 connections to localhost:6379 and 5 connections to
start_link(ConnList) ->
... |
fa49769bb753e90dcdfc74816622ba1c1aa43efbf87f2a6dd9a951497d89bfc8 | huangz1990/real-world-haskell-cn | exercise1-1.hs | safeHead :: [a] -> Maybe a
safeHead [] = Nothing
safeHead (x:_) = Just x
safeTail :: [a] -> Maybe [a]
safeTail [] = Nothing
safeTail (_:xs) = Just xs
safeLast :: [a] -> Maybe a
safeLast [] = Nothing
safeLast xs = Just (last xs)
safeInit :: [a] -> Maybe [a]
safeInit [] = Nothing
safeInit xs = Just (init xs) | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/exercise/ch4/exercise1-1.hs | haskell | safeHead :: [a] -> Maybe a
safeHead [] = Nothing
safeHead (x:_) = Just x
safeTail :: [a] -> Maybe [a]
safeTail [] = Nothing
safeTail (_:xs) = Just xs
safeLast :: [a] -> Maybe a
safeLast [] = Nothing
safeLast xs = Just (last xs)
safeInit :: [a] -> Maybe [a]
safeInit [] = Nothing
safeInit xs = Just (init xs) | |
097c0d63aa3fc9c4fc2c7002cd00c6eff139853036095674d934b3e7305c37ab | pjotrp/guix | polkit.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 < >
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Fr... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/polkit.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 < >
Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages polkit)
#:use-module ((guix li... |
e3c994ffbbd7de52413e4e7a42487928369946deaff8714ffd846ce7897b6245 | slyrus/abcl | cond.lisp | cond.lisp
;;;
Copyright ( C ) 2004
$ Id$
;;;
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
;;;
;;; This... | null | https://raw.githubusercontent.com/slyrus/abcl/881f733fdbf4b722865318a7d2abe2ff8fdad96e/src/org/armedbear/lisp/cond.lisp | lisp |
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details... | cond.lisp
Copyright ( C ) 2004
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA... |
56de9a369bc60eac8ed72b04bd4d4fa57a3169c42c25b1fac2646e782e004f1f | dorchard/effect-monad | CounterNat.hs | # LANGUAGE RebindableSyntax , TypeOperators , DataKinds , KindSignatures , GADTs ,
TypeFamilies , UndecidableInstances #
TypeFamilies, UndecidableInstances #-}
import Prelude hiding (Monad(..))
import Control.Effect
import Control.Effect.CounterNat
import GHC.TypeLits
import Debug.Trace
... | null | https://raw.githubusercontent.com/dorchard/effect-monad/5750ef8438f750e528002a0a4e255514cbf3150a/examples/CounterNat.hs | haskell | the 'one' function lifts a value to be counted once, e.g.
foo2 :: Counter (S Z) Int
This can be used for other cool things, like proving that 'map' has
linear complexity of 'map' at the type-level!
For this we need sized lists:
map' is then defined as follows | # LANGUAGE RebindableSyntax , TypeOperators , DataKinds , KindSignatures , GADTs ,
TypeFamilies , UndecidableInstances #
TypeFamilies, UndecidableInstances #-}
import Prelude hiding (Monad(..))
import Control.Effect
import Control.Effect.CounterNat
import GHC.TypeLits
import Debug.Trace
... |
b18208bf716d3d8a50a7513e1d5a643b343599c44317d5dcfd61fa3b2e2978b3 | digitallyinduced/ihp-blog-example-app | Main.hs | module Main where
import IHP.Prelude
import Config
import qualified IHP.Server
import IHP.RouterSupport
import IHP.FrameworkConfig
import Web.FrontController
import Web.Types
import IHP.Job.Types
instance FrontController RootApplication where
controllers = [
mountFrontController WebApplication
... | null | https://raw.githubusercontent.com/digitallyinduced/ihp-blog-example-app/a79824f2587701f537487d86d514b86dae9f6834/Main.hs | haskell | module Main where
import IHP.Prelude
import Config
import qualified IHP.Server
import IHP.RouterSupport
import IHP.FrameworkConfig
import Web.FrontController
import Web.Types
import IHP.Job.Types
instance FrontController RootApplication where
controllers = [
mountFrontController WebApplication
... | |
4ad28fca6aa49b96b396cdd2ae029d3d83ec48c59a31d7e06e599c1aeecd0769 | filecoin-project/orient | spec.lisp | (in-package filecoin.theory)
(defparameter *n* 16)
(defparameter *p* (random-perm *n*))
(defparameter *q* (random-perm *n*))
(defun show-perm (perm)
(list (perm-to-list (perm-identity (perm-size perm))) (perm-to-list perm)))
(defun node-list (&optional (n *n*))
(loop for i from 1 to n collect i))
(defun nodes (... | null | https://raw.githubusercontent.com/filecoin-project/orient/3a9ec7c41fd9f8ac5185c358ce908e5646ddffca/filecoin/spec.lisp | lisp | Org-mode output | (in-package filecoin.theory)
(defparameter *n* 16)
(defparameter *p* (random-perm *n*))
(defparameter *q* (random-perm *n*))
(defun show-perm (perm)
(list (perm-to-list (perm-identity (perm-size perm))) (perm-to-list perm)))
(defun node-list (&optional (n *n*))
(loop for i from 1 to n collect i))
(defun nodes (... |
5cf09f276b39a24f25005266228917181e108ff241698780035380cbad9381f8 | monadbobo/ocaml-core | core_queue.mli | * Core_queue is a wrapper around 's standard Queue module that
follows Core idioms and adds some functions .
Differences from the standard module :
[ enqueue ] replaces [ push ] , [ add ] , and takes the queue first .
[ dequeue ] replaces [ pop ] , [ take ] , takes the queue first , and re... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/core_queue.mli | ocaml | * [create ()] returns an empty queue.
* [enqueue t x] adds [x] to the end of [t].
* [dequeue t] returns [None] if [t] is empty, otherwise it removes and returns
the front of [t]
* [peek t] returns [None] if [t] is empty, otherwise it returns [Some x] where
[x] is the front of [t].
* [clear t] discards all el... | * Core_queue is a wrapper around 's standard Queue module that
follows Core idioms and adds some functions .
Differences from the standard module :
[ enqueue ] replaces [ push ] , [ add ] , and takes the queue first .
[ dequeue ] replaces [ pop ] , [ take ] , takes the queue first , and re... |
931883cb7693a6b4cc7bf1f91e97cf7d9161f75b86db1bfc7cc1f41b662c3105 | TyOverby/mono | app.ml | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
open Bonsai_chat_common
module Style =
[%css.raw
{|
html, body, .container {
height: 100vh;
margin:0;
padding:0;
width: 100vw;
}
.container {
max-width:800px;
width:50vw;
margin:0 auto;
display:flex;
... | null | https://raw.githubusercontent.com/TyOverby/mono/7666c0328d194bf9a569fb65babc0486f2aaa40d/vendor/janestreet-bonsai/examples/rpc_chat/client/app.ml | ocaml | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
open Bonsai_chat_common
module Style =
[%css.raw
{|
html, body, .container {
height: 100vh;
margin:0;
padding:0;
width: 100vw;
}
.container {
max-width:800px;
width:50vw;
margin:0 auto;
display:flex;
... | |
8974b400116b596f4259c9f270886e8ae83cdd309cdb17cd63a041024d044d78 | WorksHub/client | auth.cljc | (ns wh.components.auth
(:require [wh.components.icons :refer [icon]]
[wh.components.signin-buttons :as signin-button]
[wh.routes :as routes]
[wh.styles.register :as styles]
[wh.util :as util]))
(defn title [text]
[:div (util/smc styles/title) text])
(defn header [& ... | null | https://raw.githubusercontent.com/WorksHub/client/e1deca39e27d5ad69930e93a78b51aaafd4a18e7/common/src/wh/components/auth.cljc | clojure | (ns wh.components.auth
(:require [wh.components.icons :refer [icon]]
[wh.components.signin-buttons :as signin-button]
[wh.routes :as routes]
[wh.styles.register :as styles]
[wh.util :as util]))
(defn title [text]
[:div (util/smc styles/title) text])
(defn header [& ... | |
32777c29e2020182ece54a6a8bb38b684e6ed950ded79c31ea499e253233d0d3 | ewestern/geos | Base.hs | # LANGUAGE GeneralizedNewtypeDeriving , RankNTypes , FlexibleContexts , TypeSynonymInstances , UndecidableInstances , FlexibleInstances , MultiParamTypeClasses #
module Data.Geometry.Geos.Raw.Base
( Geos
, runGeos
, runGeosE
, runGeosM
, throwIfZero
, throwIfZero'
, throwIfNull
, throwIfNull'
, throw... | null | https://raw.githubusercontent.com/ewestern/geos/3568c3449efe180bd89959c9247d4667137662b6/src/Data/Geometry/Geos/Raw/Base.hs | haskell | | Geos is the core context for performing geometric calculations. It handles the foreign function interface as well as error handling. All underlying geos exceptions are represented by a String.
don't derive MonadIO to restrict user from performing arbitrary IO
| Unsafe function for performing a geos calculation. ... | # LANGUAGE GeneralizedNewtypeDeriving , RankNTypes , FlexibleContexts , TypeSynonymInstances , UndecidableInstances , FlexibleInstances , MultiParamTypeClasses #
module Data.Geometry.Geos.Raw.Base
( Geos
, runGeos
, runGeosE
, runGeosM
, throwIfZero
, throwIfZero'
, throwIfNull
, throwIfNull'
, throw... |
d9f9e416cb56ee05edda1197954672000441a29f8b7cf677a6fc437127f26d24 | shentufoundation/deepsea | Maps0.mli | open BinNums
open Coqlib
open Datatypes
open List0
open Specif
module PTree :
sig
type elt = positive
type 'a tree =
| Leaf
| Node of 'a tree * 'a option * 'a tree
type 'a t = 'a tree
val empty : 'a1 t
val get : positive -> 'a1 t -> 'a1 option
val set : positive -> 'a1 -> 'a1 t -> 'a1 t
val re... | null | https://raw.githubusercontent.com/shentufoundation/deepsea/970576a97c8992655ed2f173f576502d73b827e1/src/backend/extraction/Maps0.mli | ocaml | open BinNums
open Coqlib
open Datatypes
open List0
open Specif
module PTree :
sig
type elt = positive
type 'a tree =
| Leaf
| Node of 'a tree * 'a option * 'a tree
type 'a t = 'a tree
val empty : 'a1 t
val get : positive -> 'a1 t -> 'a1 option
val set : positive -> 'a1 -> 'a1 t -> 'a1 t
val re... | |
56ccd82bbf37c4685877b183b6ce83f04e0678087d1f04b548e345907e079758 | DalekBaldwin/macrodynamics | package.lisp | (in-package :cl-user)
(defpackage :macrodynamics/test
(:use :cl
:macrodynamics
:fiasco
:alexandria
:check-it))
(fiasco:defsuite
(fiasco-suites::macrodynamics/test :bind-to-package :macrodynamics/test
:in fiasco-suites::all-tests))
(in-packa... | null | https://raw.githubusercontent.com/DalekBaldwin/macrodynamics/1b4f683846b730e7dd3e04e9274a0fd71139344c/test/package.lisp | lisp | (in-package :cl-user)
(defpackage :macrodynamics/test
(:use :cl
:macrodynamics
:fiasco
:alexandria
:check-it))
(fiasco:defsuite
(fiasco-suites::macrodynamics/test :bind-to-package :macrodynamics/test
:in fiasco-suites::all-tests))
(in-packa... | |
94871cc43b52621379910c885fa75523b49d3b1308bae28405092bd4367d0448 | cloojure/tupelo | base64.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the Eclipse Public
; License 1.0 (-1.0.php) which can be found in the
; file epl-v10.html at the root of this distribution. By using this software in any
; fashion, you are agreeing to be bound by th... | null | https://raw.githubusercontent.com/cloojure/tupelo/4105fefbb1c4d1b2f06fa4993f9dd007e5e41e00/src/clj/tupelo/base64.clj | clojure | The use and distribution terms for this software are covered by the Eclipse Public
License 1.0 (-1.0.php) which can be found in the
file epl-v10.html at the root of this distribution. By using this software in any
fashion, you are agreeing to be bound by the terms of this license.
You must not remove th... | Copyright ( c ) . All rights reserved .
(ns tupelo.base64
"Convert to/from traditional base64 encoding."
(:use tupelo.core)
(:require
[schema.core :as s]
[tupelo.string :as str]
[tupelo.types :as types]
))
(def base64-chars
"A set of chars used for traditional base64 encoding (incl. padding... |
b37b83b86c32b21de169df0980ea7224d7809673f547a52981004004c4c10d8e | msakai/data-interval | TestInstances.hs | module TestInstances where
import Control.Monad
import Test.Tasty.QuickCheck
import Data.Interval
import Data.IntervalRelation
instance Arbitrary Boundary where
arbitrary = arbitraryBoundedEnum
instance Arbitrary r => Arbitrary (Extended r) where
arbitrary = frequency
[ (1, return NegInf)
, (1, return ... | null | https://raw.githubusercontent.com/msakai/data-interval/8c7596ff71fd2055b006c3bbf8c6765b00ebeabe/test/TestInstances.hs | haskell | module TestInstances where
import Control.Monad
import Test.Tasty.QuickCheck
import Data.Interval
import Data.IntervalRelation
instance Arbitrary Boundary where
arbitrary = arbitraryBoundedEnum
instance Arbitrary r => Arbitrary (Extended r) where
arbitrary = frequency
[ (1, return NegInf)
, (1, return ... | |
e4104a33af7f9da62cb902a2cbb643f3021dad16a99bcbaa4acfce7f4e49fb0f | mejgun/haskell-tdlib | BasicGroupFullInfo.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.BasicGroupFullInfo where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.BotCommands as BotCommands
import qualified TD.Data.ChatInviteLink as ChatInviteLink
import qualified TD.Data.ChatMember as ChatMember
import... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Data/BasicGroupFullInfo.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
| Contains full information about a basic group
| List of commands of bots in the group
| Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened
| True, if aggressive anti-spam check... |
module TD.Data.BasicGroupFullInfo where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.BotCommands as BotCommands
import qualified TD.Data.ChatInviteLink as ChatInviteLink
import qualified TD.Data.ChatMember as ChatMember
import qualified TD.Data.ChatPhoto as ChatPhot... |
9a6dd97bd85611dfdbb5fe5fc38174f9f56678ea011e3a44e75300130d816f6d | cchalmers/diagrams | Combinators.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamilies #
-----------------------------------------------------------------------------
-- |
-- Module : Diagrams.TwoD.Combinators
Copyright : ( c ) 2011 diagrams - lib... | null | https://raw.githubusercontent.com/cchalmers/diagrams/d091a3727817905eea8eeabc1e284105f618db21/src/Diagrams/TwoD/Combinators.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
---------------------------------------------------------------------------
|
Module : Diagrams.TwoD.Combinators
License : BSD-style (see LICENSE)
Maintainer :
----------------------------------------------------------------------... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2011 diagrams - lib team ( see LICENSE )
Diagram combinators specialized to two dimensions . For more general
combinators , see " Diagrams . Combinators " .
module Diagrams.TwoD.Combinators
(
(===), (|||)
, hc... |
c39db903e0bd309362a38764ea3d971511a11da2a53e12fb72c5b23c9bfeff5e | rems-project/cerberus | logicalConstraints.ml | module IT = IndexTerms
module BT = BaseTypes
module SymSet = Set.Make(Sym)
open Pp
type logical_constraint =
| T of IT.t
| Forall of (Sym.t * BT.t) * IT.t
[@@deriving eq, ord]
type t = logical_constraint
let equal = equal_logical_constraint
let compare = compare_logical_constraint
let pp = function
| T it... | null | https://raw.githubusercontent.com/rems-project/cerberus/965d4e46ae42e85141c2b32a647f11c6944493e3/backend/cn/logicalConstraints.ml | ocaml | module IT = IndexTerms
module BT = BaseTypes
module SymSet = Set.Make(Sym)
open Pp
type logical_constraint =
| T of IT.t
| Forall of (Sym.t * BT.t) * IT.t
[@@deriving eq, ord]
type t = logical_constraint
let equal = equal_logical_constraint
let compare = compare_logical_constraint
let pp = function
| T it... | |
213bdb5f7e13218bf75420b151aa668e1f059d551763d7fc5d22ec644cf5be3e | ocaml-ppx/ppx_deriving_protobuf | ppx_deriving_protobuf.cppo.ml | #define Rtag_patt(label, attrs, has_empty, args) \
{ \
prf_desc = Rtag({ txt = label }, has_empty, args); \
prf_attributes = attrs; \
}
#define Attribute_patt(loc_, txt_, payload) {attr_name = \
{txt = txt_; loc = loc_}; \
... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx_deriving_protobuf/5b602831d6df6e47412c96e93368d0068aeb6027/src/ppx_deriving_protobuf.cppo.ml | ocaml | Manufacture a structure just for this immediate
bool
int
int32
uint64
float
string
bytes
variant
nested
bare enum
immediate
poly
packed
always recognize packed fields
Annoying constructor corner case
Manufacture a structure just for this immediate
bool
int
int32
uint64
float
... | #define Rtag_patt(label, attrs, has_empty, args) \
{ \
prf_desc = Rtag({ txt = label }, has_empty, args); \
prf_attributes = attrs; \
}
#define Attribute_patt(loc_, txt_, payload) {attr_name = \
{txt = txt_; loc = loc_}; \
... |
1a59c0ea951fdd1fabc027bca11e55bb3677e488c8d82a7627fd8a25b98f2088 | glondu/belenios | election.ml | (**************************************************************************)
(* BELENIOS *)
(* *)
Copyright © 2012 - 2022
(* ... | null | https://raw.githubusercontent.com/glondu/belenios/a1f9e4cc8c9aa823f3d0f9ba1e21b8c700cd5522/src/lib/v1/election.ml | ocaml | ************************************************************************
BELENIOS
This program is free softw... | Copyright © 2012 - 2022
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
exemption that compiling , linking , and/or using OpenSSL is allowed .
You should have rece... |
dafe2da66cf3d7a6bdc506070b082021d75bfe70cdf5ae2a0d4c61abd6813f74 | Stratus3D/eflambe | eflambe_meck.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% Helper functions for mocking with meck in eflambe
%%% @end
%%%-------------------------------------------------------------------
-module(eflambe_meck).
%% API
-export([shim/4, unload/1]).
%%%==========================================... | null | https://raw.githubusercontent.com/Stratus3D/eflambe/b7faee2614505ef2ceda7a8904385673c45c0f53/src/eflambe_meck.erl | erlang | -------------------------------------------------------------------
@doc
Helper functions for mocking with meck in eflambe
@end
-------------------------------------------------------------------
API
===================================================================
API
===========================================... | -module(eflambe_meck).
-export([shim/4, unload/1]).
Takes a module , function , arity , and a shim function with an arity of 1
from the call to the original un - mocked function as a single argument .
-spec shim(atom(), atom(), integer(), fun()) -> ok | {error, already_mecked}.
shim(Module, Function, Arity, Shi... |
cdbc812aeaa09705e5f196daf8294cdce30907bdec6885f69d581986d7af1693 | fission-codes/fission | Error.hs | | File sync , IPFS - style
module Fission.CLI.Display.Error
( put
, put'
, putErrOr
) where
import qualified System.Console.ANSI as ANSI
import qualified Fission.Internal.UTF8 as UTF8
import Fission.Prelude
-- | Display a given error to the user and log an error to the debug log.
put :: (MonadI... | null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-cli/library/Fission/CLI/Display/Error.hs | haskell | | Display a given error to the user and log an error to the debug log.
| Display a generic error message to the user and log an error to the debug log. | | File sync , IPFS - style
module Fission.CLI.Display.Error
( put
, put'
, putErrOr
) where
import qualified System.Console.ANSI as ANSI
import qualified Fission.Internal.UTF8 as UTF8
import Fission.Prelude
put :: (MonadIO m, MonadLogger m, Show err) => err -> Text -> m ()
put err msg = do
lo... |
fbf6ed7cadf4e6a7473aa5708ba939754db8342a039879f5f6245cb317a257bc | Toxaris/pts | Term.hs | # LANGUAGE NoMonomorphismRestriction , DeriveFunctor , DeriveDataTypeable , StandaloneDeriving #
# LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleContexts , FlexibleInstances #
module PTS.Syntax.Term
( Term (..)
, AnnotatedTerm
, TermStructure (..)
, Structure (structure)
, structure'
, a... | null | https://raw.githubusercontent.com/Toxaris/pts/1700024f47bc9d28528b68fc815d2421f5d25b84/src-lib/PTS/Syntax/Term.hs | haskell | Syntax
counter :: IORef Tag
mkTerm :: TermStructure -> Term
mkTerm t = unsafePerformIO $ do
old <- readIORef counter
writeIORef counter (succ old)
return (MkTerm old t)
smart constructors | # LANGUAGE NoMonomorphismRestriction , DeriveFunctor , DeriveDataTypeable , StandaloneDeriving #
# LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleContexts , FlexibleInstances #
module PTS.Syntax.Term
( Term (..)
, AnnotatedTerm
, TermStructure (..)
, Structure (structure)
, structure'
, a... |
c326f50442601aee10af0365a032f2309ced90bb095a9b38f6733df6cad3d492 | michaelmelanson/cminus-compiler | LabelResolution.hs |
module Compiler.CodeGeneration.LabelResolution(resolveLabels) where
import Compiler.CodeGeneration.InstructionSet
import Compiler.CodeGeneration.LabelTable
resolveLabels instrs labels = map (resolveLabel labels) instrs
resolveLabel labels (JLT r (LabelRef a name)) = (JLT r (labelOffset labels name a)... | null | https://raw.githubusercontent.com/michaelmelanson/cminus-compiler/667d760d74fbb239335f1a5266006cf3baca4959/Compiler/CodeGeneration/LabelResolution.hs | haskell |
module Compiler.CodeGeneration.LabelResolution(resolveLabels) where
import Compiler.CodeGeneration.InstructionSet
import Compiler.CodeGeneration.LabelTable
resolveLabels instrs labels = map (resolveLabel labels) instrs
resolveLabel labels (JLT r (LabelRef a name)) = (JLT r (labelOffset labels name a)... | |
35f66f9f6f7ecc241a0269130d2ad93da059577d984a9bedf23d86b0be5b4bea | mzp/websocket-ocaml | wsHandler.mli | val handle : (Glob.t -> <send : Frame.t -> unit; read : Frame.t > -> unit) -> Handler.t
| null | https://raw.githubusercontent.com/mzp/websocket-ocaml/b584bd20dfe6d95f65bc6e1ba8838b1ecfa8ec0e/webSocket/wsHandler.mli | ocaml | val handle : (Glob.t -> <send : Frame.t -> unit; read : Frame.t > -> unit) -> Handler.t
| |
06209e6fe52e13d41ad2a21912dcafd368a817bf8eeca783413a235c28129dd0 | auser/alice | alice_app.erl | -module (alice_app).
-behaviour(application).
-export([start/2, stop/1]).
start(Type, Args) ->
= lists : map (
fun ( Var ) - > { ok , Value } = application : get_env(alice , Var ) , Value end ,
% [port]
% ),
alice_sup:start(Type, Args).
stop(State) ->
alice_sup:stop(State).
| null | https://raw.githubusercontent.com/auser/alice/e0f867071ede99f451d09053608bd6719c72d1c9/src/alice/alice_app.erl | erlang | [port]
), | -module (alice_app).
-behaviour(application).
-export([start/2, stop/1]).
start(Type, Args) ->
= lists : map (
fun ( Var ) - > { ok , Value } = application : get_env(alice , Var ) , Value end ,
alice_sup:start(Type, Args).
stop(State) ->
alice_sup:stop(State).
|
fb4590edd2c7b733f2bda716d37004afd217b438ac3126f51497b972f7b8ad24 | elaforge/karya | Integrate.hs | Copyright 2021
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
-- | Examples for integrating with external scores. This parses a file in
-- a simple format, but if there generator is in haskell it can also be
-- directly imported.
--
-- The easiest ... | null | https://raw.githubusercontent.com/elaforge/karya/a6638f16da9f018686023977c1292d6ce5095e28/Example/Integrate.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Examples for integrating with external scores. This parses a file in
a simple format, but if there generator is in haskell it can also be
directly imported.
The easiest way to call the functions in here ... | Copyright 2021
module Example.Integrate where
import qualified Data.Map as Map
import qualified Data.Text as Text
import qualified Data.Text.IO as Text.IO
import qualified System.FilePath as FilePath
import qualified Text.Read as Read
import qualified Cmd.Cmd as Cmd
import qualified Cmd.Create as Create
import q... |
8e5ff28f6b12eedf98719882c737d2b00b61c844a628797f0c229f6a552f2b4a | TyOverby/mono | accept_types.ml | { { { Copyright ( C ) 2012 , < >
Permission to use , copy , modify , and/or distribute this software for
any purpose with or without fee is hereby granted , provided that the
above copyright notice and this permission notice appear in all
copies .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTH... | null | https://raw.githubusercontent.com/TyOverby/mono/8d6b3484d5db63f2f5472c7367986ea30290764d/vendor/mirage-ocaml-cohttp/cohttp/src/accept_types.ml | ocaml | * Type definitions for the {!Accept} module | { { { Copyright ( C ) 2012 , < >
Permission to use , copy , modify , and/or distribute this software for
any purpose with or without fee is hereby granted , provided that the
above copyright notice and this permission notice appear in all
copies .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTH... |
559dae44cb1d95ebe4bbc326850074329b5fd68cd6d9f2b26ff4713ddf17fb47 | brendanhay/amazonka | DimensionMapping.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-timestream-query/gen/Amazonka/TimeStreamQuery/Types/DimensionMapping.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.TimeStreamQuery.Types.DimensionMapping
Stability : auto-generated
| This type is used to map column(s) from the query result to a dimension
in the destination table.
/See:/ 'newDimensionMapping' smart constructor.
| Column name fr... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Co... |
97fceb68a06ea877d23992ec738577cdf3cab3a873552ba7ec39f6f2adc8f8df | zotonic/zotonic | m_media.erl | @author < >
2009 - 2020
%% @doc Model for medium database
Copyright 2009 - 2020
%%
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... | null | https://raw.githubusercontent.com/zotonic/zotonic/ff5b781c412d62cb9fc9fc238efc1e45ada27261/apps/zotonic_core/src/models/m_media.erl | erlang | @doc Model for medium database
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 ... | @author < >
2009 - 2020
Copyright 2009 - 2020
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(m_media).
-author("Marc Worrell <").
-behaviour(zotonic_model).
-export([
m_get/3,
identify/2,
... |
33f9f501b3950c7e51990fc824648ab4d8255f8159f3b6a07c2a9b84a06ba927 | protz/mezzo | UntypedOCaml.ml | (*****************************************************************************)
(* Mezzo, a programming language based on permissions *)
Copyright ( C ) 2011 , 2012 and
(* *)
(* This program is free softwar... | null | https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/compiler/UntypedOCaml.ml | ocaml | ***************************************************************************
Mezzo, a programming language based on permissions
This program is free software: you can redistribute it and/or modify
(at your optio... | Copyright ( C ) 2011 , 2012 and
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
This is the definition of .
typ... |
8a2e83e1d52da4aff296e58f1e04932031a1079ce34380ab0c56cb2ef8889bfb | huangz1990/real-world-haskell-cn | buildmap.hs | -- file: ch13/buildmap.hs
import qualified Data.Map as Map
-- Functions to generate a Map that represents an association list
-- as a map
al = [(1, "one"), (2, "two"), (3, "three"), (4, "four")]
-- Create a map representation of 'al' by converting the association
list using Map.fromList
mapFromAL =
Map.fromLi... | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch13/buildmap.hs | haskell | file: ch13/buildmap.hs
Functions to generate a Map that represents an association list
as a map
Create a map representation of 'al' by converting the association
Create a map representation of 'al' by doing a fold
Manually create a map with the elements of 'al' in it | import qualified Data.Map as Map
al = [(1, "one"), (2, "two"), (3, "three"), (4, "four")]
list using Map.fromList
mapFromAL =
Map.fromList al
mapFold =
foldl (\map (k, v) -> Map.insert k v map) Map.empty al
mapManual =
Map.insert 2 "two" .
Map.insert 4 "four" .
Map.insert 1 "one" .
Map.i... |
635ecd0aef1978587216148a48842914853e676cfae1a7dfd277a2b3fb9c2d41 | DSiSc/why3 | Macrogen_decls.mli |
(* Input declarations *)
type 'n types =
| TypeVar of 'n
| DeclaredType of 'n
type 'n constructor =
| Var
| BCons of 'n * ( 'n * 'n types list) list * 'n types list
BCons ( C , [ t , u ; t2,u2 ] [ v1 ; v2 ; v3 ] :
C : [ x_t : u1 . [ : u2 . v1 v2 v3 ] ] .
x_{t } is bound at the right as a... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/examples/prover/macro_generator/Macrogen_decls.mli | ocaml | Input declarations
TypeAssumption (t,[v_1...v_n] : assume
type t using variables in types v_1...v_n.
Processed declarations.
Polymorphic common parameters
type declarations map.
real names.
Interrogators |
type 'n types =
| TypeVar of 'n
| DeclaredType of 'n
type 'n constructor =
| Var
| BCons of 'n * ( 'n * 'n types list) list * 'n types list
BCons ( C , [ t , u ; t2,u2 ] [ v1 ; v2 ; v3 ] :
C : [ x_t : u1 . [ : u2 . v1 v2 v3 ] ] .
x_{t } is bound at the right as a variable for declared ty... |
6307b43760819723e5a7347fd2f774b2ff010e387c7e7a158dd3e3bd6cde7592 | kazu-yamamoto/domain-auth | Verify.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.DomainAuth.DK.Verify (
verifyDK, prepareDK
) where
import Crypto.Hash
import Crypto.PubKey.RSA
import Crypto.PubKey.RSA.PKCS15
import Data.ByteString (ByteString)
import Data.ByteString.Builder (Builder)
import qualified Data.ByteString.Builder as BB
import qual... | null | https://raw.githubusercontent.com/kazu-yamamoto/domain-auth/d13145709a558145ac38e28e0b339c48b950b4e0/Network/DomainAuth/DK/Verify.hs | haskell | # LANGUAGE OverloadedStrings #
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
-------------------------------------------------------------- |
module Network.DomainAuth.DK.Verify (
verifyDK, prepareDK
) where
import Crypto.Hash
import Crypto.PubKey.RSA
import Crypto.PubKey.RSA.PKCS15
import Data.ByteString (ByteString)
import Data.ByteString.Builder (Builder)
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy as BL
im... |
426e4906d19c4545c75fc4e76fb7346dd2df7b392a85f0e69342cc02976a9532 | c-cube/qcheck | QCheck_base_runner.mli |
QCheck : Random testing for OCaml
copyright ( c ) 2013 - 2017 , , , ,
all rights reserved .
QCheck: Random testing for OCaml
copyright (c) 2013-2017, Guillaume Bury, Simon Cruanes, Vincent Hugot, Jan Midtgaard
all rights reserved.
*)
* { 1 Runners for Tests }
Once you built some tests using { ! ... | null | https://raw.githubusercontent.com/c-cube/qcheck/063c1d74795a24eb77fa661d218c4715382df566/src/runner/QCheck_base_runner.mli | ocaml | * Access the current random state
* Is the default mode verbose or quiet?
* Is the default mode to run long tests or nor?
* Change the {!random_state} by creating a new one, initialized with
the given seed.
* Change the value of [verbose ()]
* Change the value of [long_tests ()]
* The type of counter used to ... |
QCheck : Random testing for OCaml
copyright ( c ) 2013 - 2017 , , , ,
all rights reserved .
QCheck: Random testing for OCaml
copyright (c) 2013-2017, Guillaume Bury, Simon Cruanes, Vincent Hugot, Jan Midtgaard
all rights reserved.
*)
* { 1 Runners for Tests }
Once you built some tests using { ! ... |
0c07fcc80c4f51825eaf2afc7a8a17d6d3d822a32835d9fc22d59b931159c798 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PostCustomersCustomerBalanceTransactionsTransaction.hs | {-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the different functions to run the operation postCustomersCustomerBalanceTransa... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Operations/PostCustomersCustomerBalanceTransactionsTransaction.hs | haskell | # LANGUAGE ExplicitForAll #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the different functions to run the operation postCustomersCustomerBalanceTransactionsTransaction
| > POST /v1/customers/{customer}/balance_transactions/{transaction}
| Contains all available parameters of this operation (q... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Operations.PostCustomersCustomerBalanceTransactionsTransaction where
import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data... |
9ced87b677f6423c2795fd0342e7942a29df4a611c813bfd86f253af6cc6e987 | tsloughter/rebar3_tests | exometer_igor.erl | -module(exometer_igor).
-export([parse_transform/2]).
parse_transform(Forms, Opts) ->
IgorOpts = lists:append([Os || {attribute,_,compile,{igor,Os}} <- Forms]),
io:fwrite("IgorOpts = ~p~nOpts = ~p", [IgorOpts, Opts]),
Includes = [I || {i,I} <- Opts],
NewForms =
igor:parse_transform(
... | null | https://raw.githubusercontent.com/tsloughter/rebar3_tests/af19097d597b061a0fde5c58ce354a623ca05f38/ptrans_deporder/_checkouts/exometer_core/src/exometer_igor.erl | erlang | erl_syntax:revert/1 is horribly broken in R16B03. This transform
corrects | -module(exometer_igor).
-export([parse_transform/2]).
parse_transform(Forms, Opts) ->
IgorOpts = lists:append([Os || {attribute,_,compile,{igor,Os}} <- Forms]),
io:fwrite("IgorOpts = ~p~nOpts = ~p", [IgorOpts, Opts]),
Includes = [I || {i,I} <- Opts],
NewForms =
igor:parse_transform(
... |
300ced3d4d85529fe17c305904d13ab736fcfb1f1689c073608a22e4cf4f64c0 | kelamg/HtDP2e-workthrough | ex226.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex226) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decima... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Arbitrarily-Large-Data/ex226.rkt | racket | about the language level of this file in a form that our tools can easily process.
– '()
A Transition is a structure:
in reaction to keystrokes
equality predicate for states
returns true if both states are the same | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex226) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
An FSM is one of :
– ( cons Transition FSM )
(define... |
cac7b78ee5727409d407d04475db4475b7605c982a24a714ae6bac586e37298d | herd/herdtools7 | AArch64Arch_herd.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/bd83443f06b54d4c3dda8293297c8f8c70055cce/herd/AArch64Arch_herd.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2015 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
36e98cd371c3525bfc6b03eeecb6d4b9cb84a69fdac0e8ef2544384f731778de | simnalamburt/snucse.pl | ex2.ml | let sigma ((a, b, f): int * int * (int -> int)): int =
let sum = ref 0 in
for i = a to b do
sum := !sum + (f i)
done;
!sum
| null | https://raw.githubusercontent.com/simnalamburt/snucse.pl/a130f826c6f27224c88b0dd2e1588f35bccc9ebb/hw1/ex2.ml | ocaml | let sigma ((a, b, f): int * int * (int -> int)): int =
let sum = ref 0 in
for i = a to b do
sum := !sum + (f i)
done;
!sum
| |
d9a2d70f80c00649d1f4dce556601640f05a5cd46569f031c74818f8248d2a6c | esl/escalus | user_db_module_SUITE.erl | -module(user_db_module_SUITE).
-compile(export_all).
-include_lib("escalus/include/escalus.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(a(Condition), ?assert(Condition)).
-define(eq(A, B), ?assertEqual(A, B)).
-define(WHEN(Block), begin Block end).
-define(THEN(... | null | https://raw.githubusercontent.com/esl/escalus/ac5e813ac96c0cdb5d5ac738d63d992f5f948585/test/user_db_module_SUITE.erl | erlang | -module(user_db_module_SUITE).
-compile(export_all).
-include_lib("escalus/include/escalus.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(a(Condition), ?assert(Condition)).
-define(eq(A, B), ?assertEqual(A, B)).
-define(WHEN(Block), begin Block end).
-define(THEN(... | |
18435dd2eb46a26bd681e5882b5e9b41ac49e024072328e6be24be263806de12 | JunSuzukiJapan/cl-reex | combine-latest.lisp | (in-package :cl-user)
(defpackage cl-reex.operator.combine-latest
(:use :cl)
(:import-from :cl-reex.observer
:observer
:make-observer
:on-next
:on-error
:on-completed )
(:import-from :cl-reex.observable
:observable
:dispose
:is-active
:set-er... | null | https://raw.githubusercontent.com/JunSuzukiJapan/cl-reex/94928c7949c235b41902138d9e4a5654b92d67eb/src/operator/combine-latest.lisp | lisp | (slot-unbound 'operator-combine-latest op 'other-subscription) | (in-package :cl-user)
(defpackage cl-reex.operator.combine-latest
(:use :cl)
(:import-from :cl-reex.observer
:observer
:make-observer
:on-next
:on-error
:on-completed )
(:import-from :cl-reex.observable
:observable
:dispose
:is-active
:set-er... |
dfe3781ee97ba1b96dbbb11e3db3187cef0ce4694ca5cd7037eecd0522c788bf | ygrek/mldonkey | guiStatusBar.ml | Copyright 2004 b8_bavard ,
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
( at your option ) any l... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/gtk2/gui/guiStatusBar.ml | ocaml | ***********************************************************************
Global variables
********************************... | Copyright 2004 b8_bavard ,
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
( at your option ) any l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.