_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 |
|---|---|---|---|---|---|---|---|---|
c635404ed53484a46d10dfd7d085ea76cda8b29eba0a57f4a493fea9144a8717 | haskell/c2hs | Switches.hs | -- C -> Haskell Compiler: management of switches
--
Author :
Created : 6 March 99
--
Copyright ( c ) [ 1999 .. 2005 ]
--
-- This file 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 ; eithe... | null | https://raw.githubusercontent.com/haskell/c2hs/fbb4c2fa6ec5528aa068512f1b691298db420321/src/C2HS/Switches.hs | haskell | C -> Haskell Compiler: management of switches
This file is free software; you can redistribute it and/or modify
(at your option) any later version.
This file 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... | Author :
Created : 6 March 99
Copyright ( c ) [ 1999 .. 2005 ]
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
language : 98
* The options specify the options passed to the C preprocessor .
* The ... |
351426045531fa96080487da40831abbbd04d8c2e9bcfd7c5fc55048a85f4b19 | rohitjha/ProjectEuler | PE006.hs | main = putStrLn $ show $ abs $ (sum [ x*x | x <- [1..100] ]) - ((sum [ x | x <- [1..100] ]) ^ 2)
| null | https://raw.githubusercontent.com/rohitjha/ProjectEuler/2f0a46bb1547b06a373c30966bba7a001b932bf4/MPL/PE006.hs | haskell | main = putStrLn $ show $ abs $ (sum [ x*x | x <- [1..100] ]) - ((sum [ x | x <- [1..100] ]) ^ 2)
| |
ceafb81aa24857cebb76100fdf14487e5b1c35bacb89bad978c1091ed8bf6692 | ladderlife/autochrome | github.clj | (ns autochrome.github
(:require [clj-http.client :as http]
[clojure.java.io :as io]
[clojure.java.shell :as sh]
[clojure.string :as string]))
(def ^:dynamic *auth-token* nil)
(defn pr-request-params
[owner repo num]
(let [url (format "" owner repo num)]
(cond-> {:method :... | null | https://raw.githubusercontent.com/ladderlife/autochrome/d454e4450658b4799bfd939f2a84690921800806/src/autochrome/github.clj | clojure | fine to read the numbers we just regex'd out
need to apply patches in reverse because I don't know how to get the
local git stuff
[mode type sha path] | (ns autochrome.github
(:require [clj-http.client :as http]
[clojure.java.io :as io]
[clojure.java.shell :as sh]
[clojure.string :as string]))
(def ^:dynamic *auth-token* nil)
(defn pr-request-params
[owner repo num]
(let [url (format "" owner repo num)]
(cond-> {:method :... |
806eebb30b878ebc3dad196f1ba8c6f2a6dc259513a17af03c427fc036085ab6 | techascent/tech.parallel | for.clj | (ns tech.parallel.for
(:import [java.util.concurrent ForkJoinPool Callable Future ExecutorService]
[java.util ArrayDeque PriorityQueue Comparator]))
(set! *unchecked-math* :warn-on-boxed)
(set! *warn-on-reflection* true)
(defn indexed-map-reduce
"Given a function that takes exactly 2 arguments, a sta... | null | https://raw.githubusercontent.com/techascent/tech.parallel/3d25ebe0e7260a4ebcc9ae48167c6a0937212ddd/src/tech/parallel/for.clj | clojure | reduce-fn is called once.
Force start of execution with mapv
returns
really just indexed-map-reduce where the default reducer | (ns tech.parallel.for
(:import [java.util.concurrent ForkJoinPool Callable Future ExecutorService]
[java.util ArrayDeque PriorityQueue Comparator]))
(set! *unchecked-math* :warn-on-boxed)
(set! *warn-on-reflection* true)
(defn indexed-map-reduce
"Given a function that takes exactly 2 arguments, a sta... |
5b12a00a4a4e6b7b9651568cac436b71bcf6794d2579c01be32a334d26fbe115 | aistrate/Okasaki | Ex03_07.hs | # LANGUAGE FlexibleInstances , MultiParamTypeClasses #
module Ex03_07 (module Heap, ExplicitMin(..)) where
import Heap
data (Ord a, Heap h a) => ExplicitMin h a = E
| NE a (h a)
deriving (Eq, Show)
instance (Ord a, Heap h a) => He... | null | https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/MyCode/Ch03/Ex03_07.hs | haskell | # LANGUAGE FlexibleInstances , MultiParamTypeClasses #
module Ex03_07 (module Heap, ExplicitMin(..)) where
import Heap
data (Ord a, Heap h a) => ExplicitMin h a = E
| NE a (h a)
deriving (Eq, Show)
instance (Ord a, Heap h a) => He... | |
bc36a091b42491f51f7fe910cf351a9f52a538098a824b1aadd64dd9663faa98 | well-typed/large-records | R070.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.SR_ParseJSON.Sized.R070 where
import Data.Aeson
import Data.Aeson.Types (parseMaybe)
import Data.Maybe (fromJust)
import SuperRecord (Rec, recJsonPa... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/superrecord/Experiment/SR_ParseJSON/Sized/R070.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.SR_ParseJSON.Sized.R070 where
import Data.Aeson
import Data.Aeson.Types (parseMaybe)
import Data.Maybe (fromJust)
import SuperRecord (Rec, recJsonParser)
import Common.RowOfSize.Row070
recFromJSON :: Value -> Rec ExampleRow
recFromJSON = fromJu... |
a999b95128a0f0f722debda53db7a07d1484ceb31756924e035300408fe96900 | ryanpbrewster/haskell | P023.hs | module Problems.P023
( solve
) where
import Data.Array
-- 023.hs Uses a slightly different strategy than 023_first.hs
--
Instead of constructing all the possible sums first , then summing over the false elements , let 's
-- just check each element as we go. This way there are far fewer array operations.
--
Th... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Problems/P023.hs | haskell | 023.hs Uses a slightly different strategy than 023_first.hs
just check each element as we go. This way there are far fewer array operations.
k' (as n-k for k \in abundants) and see if any of them are abundant numbers | module Problems.P023
( solve
) where
import Data.Array
Instead of constructing all the possible sums first , then summing over the false elements , let 's
The memoization using the array speeds this up by a factor of ~45x
import qualified Util.Prime as Prime
solve :: String
solve = show solveProblem
bound =... |
abcd26cd860cc2d99399e88890f66af0e2ac9c05e278ecfee34f901e0e65a9d3 | bet365/soap | example_server.erl | %%
%% %CopyrightBegin%
%%
Copyright Hillside Technology Ltd. 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by ap... | null | https://raw.githubusercontent.com/bet365/soap/856b5c418d8d40a6b5bcbbe3fd390c6a0b8d4f18/doc/example_server.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Hillside Technology Ltd. 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
for service " contacts_service " and port " contacts_port "
using options : [ { service,"contacts_service... |
4eaeeff5367c6b063f41c1d920a4319c260a2d660ec9e340a1194917dc1eb365 | kit-ty-kate/labrys | ParseTreePrinter.mli | Copyright ( c ) 2013 - 2017 The Labrys developers .
(* See the LICENSE file at the top-level directory. *)
TODO : Replace external uses of dump_kind by PretypedTreePrinter.dump_kind
val dump_kind : ParseTree.kind -> Utils.PPrint.document
val dump : ParseTree.top list -> Utils.PPrint.document
| null | https://raw.githubusercontent.com/kit-ty-kate/labrys/e48b0cd5a757c9266bcde1dd976e8bb1c582f492/src/parsing/ParseTreePrinter.mli | ocaml | See the LICENSE file at the top-level directory. | Copyright ( c ) 2013 - 2017 The Labrys developers .
TODO : Replace external uses of dump_kind by PretypedTreePrinter.dump_kind
val dump_kind : ParseTree.kind -> Utils.PPrint.document
val dump : ParseTree.top list -> Utils.PPrint.document
|
a4ec32e7a4871e2f140e085860fbf22c8739444c65af05583e0734121455331a | avillega/generative-art | first_background.clj | (ns generative-artistry.first-background
(:require [quil.core :as q]
[generative-artistry.utils :refer :all]))
(defn draw-paper-feel []
(q/fill 0 0 50 0.1)
(q/no-stroke)
(dotimes [_ 500000]
(let [x (q/random 0 100)
y (q/random 0 100)]
(q/ellipse (w x) (h y) 2 2))))
(defn draw-b... | null | https://raw.githubusercontent.com/avillega/generative-art/cd3be0a40ff9a7972b875df0e9e8f6981e45ee40/src/generative_artistry/first_background.clj | clojure | (ns generative-artistry.first-background
(:require [quil.core :as q]
[generative-artistry.utils :refer :all]))
(defn draw-paper-feel []
(q/fill 0 0 50 0.1)
(q/no-stroke)
(dotimes [_ 500000]
(let [x (q/random 0 100)
y (q/random 0 100)]
(q/ellipse (w x) (h y) 2 2))))
(defn draw-b... | |
0931983c404d30445d80fa322b679b3ffcc9d2920b274b45f4fd16d2f3696888 | DavidAlphaFox/RabbitMQ | webmachine_sup.erl | @author < >
@author < >
2007 - 2008 Basho Technologies
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/webmachine-wrapper/webmachine-git/src/webmachine_sup.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
limitations under the License.
@doc S... | @author < >
@author < >
2007 - 2008 Basho Technologies
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
See the License for the specific language governing permissions and
-module(webmachine_sup).
-b... |
3455acb4cee217f2093fb0e76ba8e3d92cdc1ede1372790c5433ed5f673515d0 | noinia/hgeometry | Boundary.hs | --------------------------------------------------------------------------------
-- |
-- Module : Geometry.Boundary
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
--------------------------------------------------------------------------------
module Geometry.Boundary where... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Geometry/Boundary.hs | haskell | ------------------------------------------------------------------------------
|
Module : Geometry.Boundary
License : see the LICENSE file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| The bo... | Copyright : ( C )
Maintainer :
module Geometry.Boundary where
import Control.Lens (iso,Iso)
import Geometry.Properties
import Geometry.Transformation
newtype Boundary g = Boundary g
deriving (Show,Eq,Ord,Read,IsTransformable
,Functor,Foldable,Traversabl... |
a37207265a3e279f6278f3be5c5a5a1ae13f2eae38fbe619676d8ab9db0cabfc | tamarin-prover/tamarin-prover | Bind.hs | # LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses #
-- |
Copyright : ( c ) 2010 , 2011
-- License : GPL v3 (see LICENSE)
--
Maintainer : < >
Portability : GHC only
--
-- Shallow monad transformer for dealing with bindings.
--
module Control.Monad.Bind (
-- * Bindings
Bi... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/c78c7afd3b93b52dd4d2884952ec0fc273832a0d/lib/utils/src/Control/Monad/Bind.hs | haskell | |
License : GPL v3 (see LICENSE)
Shallow monad transformer for dealing with bindings.
* Bindings
* MonadBind class
* Bind monad
* Binding operations
----------------------------------------------------------------------------
Bindings
---------------------------------------------------------------------... | # LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses #
Copyright : ( c ) 2010 , 2011
Maintainer : < >
Portability : GHC only
module Control.Monad.Bind (
Bindings
, noBindings
, MonadBind
, Bind
, runBind
, evalBind
, execBind
* BindT monad transformer
, BindT ... |
f4911b846c5e32f86409021caaa60349e7297ce4ed41f1cdf0fbabb0daa64ff0 | B-Lang-org/bsc | ARemoveAssumps.hs | module ARemoveAssumps(aRemoveAssumps) where
import ASyntax
import ASyntaxUtil
import ErrorUtil(internalError)
import PPrint
-- XXX value method assumptions
aRemoveAssumps :: APackage -> APackage
aRemoveAssumps = mapARules removeAssumpRule
addAssumpPred :: AExpr -> AAction -> AAction
addAssumpPred p f@(AFCall { aact_... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/ARemoveAssumps.hs | haskell | XXX value method assumptions
XXX method calls are not allowed in assumptions | module ARemoveAssumps(aRemoveAssumps) where
import ASyntax
import ASyntaxUtil
import ErrorUtil(internalError)
import PPrint
aRemoveAssumps :: APackage -> APackage
aRemoveAssumps = mapARules removeAssumpRule
addAssumpPred :: AExpr -> AAction -> AAction
addAssumpPred p f@(AFCall { aact_args = (c:es) }) = f'
where f'... |
3f1f77393f6cca54b65c8cb9557a6a885b16bda5d5a00fd1cb90ea48dd07b075 | ucsd-progsys/liquidhaskell | Check.hs | # LANGUAGE LambdaCase #
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-@ LIQUID "--exact-data-cons" @-}
-- ple is necessary to reason about the evaluation of checkBindings
{-@ LIQUID "--ple" @-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.Stitch.LH.Check
C... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/benchmarks/stitch-lh/src/Language/Stitch/LH/Check.hs | haskell | # OPTIONS_GHC -Wno-unused-imports #
@ LIQUID "--exact-data-cons" @
ple is necessary to reason about the evaluation of checkBindings
@ LIQUID "--ple" @
---------------------------------------------------------------------------
|
Module : Language.Stitch.LH.Check
License : BSD-style (see LICENSE)
Stabili... | # LANGUAGE LambdaCase #
Copyright : ( C ) 2015
( C ) 2021
module Language.Stitch.LH.Check where
import Data.Map (Map)
import qualified Data.Map as Map
XXX : If we do n't import Data . Set , LH fails with : Unbound symbol Set_mem
import qualified Data.Set as Set
import Language.Haskell.L... |
3b965073ca3f61c7f47d05d593ee7caa5d756af9e20a032930da71610c15ed25 | qkrgud55/ocamlmulti | genlex.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, proje... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/stdlib_r/genlex.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : genlex.ml 11156 2011 - 07 - 2... |
97865de633dee8d9ad074faabb97bdbb3dee501a3fb8b74baee1d286cf93a216 | PrecursorApp/precursor | font_map.cljs | (ns frontend.utils.font-map)
(def class->unicode
{"fa-sitemap" \
"fa-facebook-square" \
"fa-volume-down" \
"fa-phone-square" \
"fa-facebook-f" \
"fa-car" \
"fa-shopping-cart" \
"fa-arrow-circle-o-up" \
"fa-repeat" \
"fa-slack" \
"fa-folder-open-o" \
"fa-cc-visa" \
"fa-... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src-cljs/frontend/utils/font_map.cljs | clojure | (ns frontend.utils.font-map)
(def class->unicode
{"fa-sitemap" \
"fa-facebook-square" \
"fa-volume-down" \
"fa-phone-square" \
"fa-facebook-f" \
"fa-car" \
"fa-shopping-cart" \
"fa-arrow-circle-o-up" \
"fa-repeat" \
"fa-slack" \
"fa-folder-open-o" \
"fa-cc-visa" \
"fa-... | |
f13c53ce42cf929c228412fbb7434a4f4c26213c72e4a9b48c121056a395e2fe | ucsd-progsys/dsolve | encrypt_ecb.ml |
let encrypt_ecb k (xl_msb,xl_lsb,xr_msb,xr_lsb) =
The 64 - bit element ( xl , xr ) is encrypted using key k with :
* - xl_lsb the LSB of xl
* - xl_msb the MSB of xl
* - xr_lsb the LSB of xr
* - xr_msb the MSB of xr
* Returns ( xl_msb ' , xl_lsb ' , xr_msb ' , xr_lsb ' ) .
* - xl_lsb ... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/encrypt_ecb.ml | ocaml |
let encrypt_ecb k (xl_msb,xl_lsb,xr_msb,xr_lsb) =
The 64 - bit element ( xl , xr ) is encrypted using key k with :
* - xl_lsb the LSB of xl
* - xl_msb the MSB of xl
* - xr_lsb the LSB of xr
* - xr_msb the MSB of xr
* Returns ( xl_msb ' , xl_lsb ' , xr_msb ' , xr_lsb ' ) .
* - xl_lsb ... | |
ecb723f4758b93ceddee59e7f6d6b1ebab40a262f134736b57867b9b5cd2a2ff | peti/funcmp | Tree.hs | |
Module : FMP.Tree
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : provi... | null | https://raw.githubusercontent.com/peti/funcmp/1f6713a273b57b8b60b19958420748daf65d35af/FMP/Tree.hs | haskell | --------------------------------------------------------
--------------------------------------------------------
--------------------------------------------------------
RH
Interne Baumstruktur.
Relative Plazierung der Punkte
Berechne Pfade aller Baumkanten
zweiten, usw. Listen konkateniert werden.
Design eines ... | |
Module : FMP.Tree
Copyright : ( c ) 2003 - 2010 ( c ) 2002 - 2003 ( c ) 2002 - 2003 Meik Hellmund
( c ) 1998 - 2002 ( c ) 1998 - 2002 Joachim Korittky
( c ) 1998 - 2002
License :
Maintainer :
Stability : provi... |
3fc7b83fff579e6230fdca77166f79277fb555deee4a98f1bde3eecbaefb04ad | pfdietz/ansi-test | nth.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Apr 19 22:33:23 2003
Contains : Tests of NTH
(deftest nth.1
(nth-1-body (loop for i from 1 to 2000 collect (* 4 i)))
0)
(deftest nth.2
(let ((x (loop for i from 1 to 2000 collect i)))
(loop
for i from 0 to 1999 do
(setf (nth i x) (- 1... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/cons/nth.lsp | lisp | -*- Mode: Lisp -*- | Author :
Created : Sat Apr 19 22:33:23 2003
Contains : Tests of NTH
(deftest nth.1
(nth-1-body (loop for i from 1 to 2000 collect (* 4 i)))
0)
(deftest nth.2
(let ((x (loop for i from 1 to 2000 collect i)))
(loop
for i from 0 to 1999 do
(setf (nth i x) (- 1999 i)))
(equalt x (... |
8a54f88310fd30627254931f90587e6f6ed21b05413c26a9f9c9b4f8119fbea9 | TrustInSoft/tis-interpreter | dominators.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/analysis/dominators.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
108635da71fa5cac85b81390f1228e06de57725d9dd7c2dacb7fd270cf440a3b | lowasser/TrieMap | Zippable.hs | {-# LANGUAGE TypeSynonymInstances #-}
module Data.TrieMap.OrdMap.Zippable () where
import Data.TrieMap.OrdMap.Base
instance Zippable (SNode k) where
empty = tip
clear (Empty _ path) = rebuild tip path
clear (Full _ path l r) = rebuild (l `glue` r) path
assign a (Empty k path) = rebuild (single k a) path
... | null | https://raw.githubusercontent.com/lowasser/TrieMap/1ab52b8d83469974a629f2aa577a85de3f9e867a/Data/TrieMap/OrdMap/Zippable.hs | haskell | # LANGUAGE TypeSynonymInstances # | module Data.TrieMap.OrdMap.Zippable () where
import Data.TrieMap.OrdMap.Base
instance Zippable (SNode k) where
empty = tip
clear (Empty _ path) = rebuild tip path
clear (Full _ path l r) = rebuild (l `glue` r) path
assign a (Empty k path) = rebuild (single k a) path
assign a (Full k path l r) = rebuild (... |
f8e8b91a33388a12eab3169a2d401dc73b2c3927b9b4cb1daf574067f1622e4b | jgdavey/clj-pgcopy | impl.clj | (ns clj-pgcopy.impl
(:require
[clj-pgcopy.protocols :as proto])
(:import
(java.io ByteArrayOutputStream DataOutputStream)
(java.net Inet4Address Inet6Address)
(java.nio ByteBuffer)
(java.time
Instant
LocalDate
LocalDateTime
OffsetDateTime
ZoneOffset
ZonedDateTime)
(java.uti... | null | https://raw.githubusercontent.com/jgdavey/clj-pgcopy/179b48144d92372cc2646dba60b52510db60cd8f/src/clj_pgcopy/impl.clj | clojure | text
int4
int4
int8
float8
numeric
boolean
interval
point
line
path
open/closed
number of points
point data
polygon
box
circle
uuid
inet
inet
null
dimensions (only 1 dimensional)
nullable values allowed
oid of collection elements
size
use PG default
These primitive array impls have to be adde... | (ns clj-pgcopy.impl
(:require
[clj-pgcopy.protocols :as proto])
(:import
(java.io ByteArrayOutputStream DataOutputStream)
(java.net Inet4Address Inet6Address)
(java.nio ByteBuffer)
(java.time
Instant
LocalDate
LocalDateTime
OffsetDateTime
ZoneOffset
ZonedDateTime)
(java.uti... |
5b4e668a1e43834666df7bb1fd27c4296ca1f1b253c2656cc2b0e090a93c5d7e | namin/inc | tests-1.9.2-req.scm | (add-tests-with-string-output "vectors"
[(vector? (make-vector 0)) => "#t\n"]
[(vector-length (make-vector 12)) => "12\n"]
[(vector? (cons 1 2)) => "#f\n"]
[(vector? 1287) => "#f\n"]
[(vector? ()) => "#f\n"]
[(vector? #t) => "#f\n"]
[(vector? #f) => "#f\n"]
[(pair? (make-vector 12)) => "#f\n"]
[(null?... | null | https://raw.githubusercontent.com/namin/inc/3f683935e290848485f8d4d165a4f727f6658d1d/src/tests-1.9.2-req.scm | scheme | (add-tests-with-string-output "vectors"
[(vector? (make-vector 0)) => "#t\n"]
[(vector-length (make-vector 12)) => "12\n"]
[(vector? (cons 1 2)) => "#f\n"]
[(vector? 1287) => "#f\n"]
[(vector? ()) => "#f\n"]
[(vector? #t) => "#f\n"]
[(vector? #f) => "#f\n"]
[(pair? (make-vector 12)) => "#f\n"]
[(null?... | |
15d8a8a9d9e8f4cb9ea39f930b8909e19bfaae16d597b7c8647f104ae50b2c39 | mit-pdos/mcqc | Templates.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Types.Templates where
import Types.Context
import CIR.Expr
import Data.Map
import Data.MonoTraversable
Make a CDef into a template form expected by cc
class Template a where
templatify :: Context CType -> a -> a
plug :: Int -> a -> a
ins... | null | https://raw.githubusercontent.com/mit-pdos/mcqc/85b5a65f1750ffb7c2336fa4c9266cc238aeeb5e/src/Types/Templates.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
module Types.Templates where
import Types.Context
import CIR.Expr
import Data.Map
import Data.MonoTraversable
Make a CDef into a template form expected by cc
class Template a where
templatify :: Context CType -> a -> a
plug :: Int -> a -> a
instance Template CDef where
templ... |
3f55017b5b47238343954b3c5a56443cee080b41ad2249be0b7c6d5c8b37b569 | jonludlam/focs-support | tree.ml | type 'a t = Lf | Br of 'a * 'a t * 'a t
let rec string_of (str_of_alpha : 'a -> string) : 'a t -> string = function
| Lf -> "Lf"
| Br(x,l,r) -> Printf.sprintf "Br(%s,%s,%s)" (str_of_alpha x) (string_of str_of_alpha l) (string_of str_of_alpha r)
let dot_escape =
let re = Re.(compile @@ char '"') in
fun oc ... | null | https://raw.githubusercontent.com/jonludlam/focs-support/1a7110741ad1997762f626885472e9d18a37b3b5/lib/tree.ml | ocaml | Allow HTML strings - put everything else in double-quotes, which is safe.
See | type 'a t = Lf | Br of 'a * 'a t * 'a t
let rec string_of (str_of_alpha : 'a -> string) : 'a t -> string = function
| Lf -> "Lf"
| Br(x,l,r) -> Printf.sprintf "Br(%s,%s,%s)" (str_of_alpha x) (string_of str_of_alpha l) (string_of str_of_alpha r)
let dot_escape =
let re = Re.(compile @@ char '"') in
fun oc ... |
ac51943a3e95bc58fea94e5575e494a0d55d26541d4e7b2c44026b5e21372f95 | SamB/coq | extract_env.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/contrib/extraction/extract_env.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i $Id$ i
s This module declares the ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Libnames
... |
fa3967e6a38d378bae482ea8a87b525dbc5999d874eae7f21ddaca33c98c8c9e | freizl/dive-into-haskell | FunctorLaw.hs | # LANGUAGE ScopedTypeVariables #
module FunctorLaw where
import Test.QuickCheck
functorIdentity :: (Functor f, Eq (f a)) => f a -> Bool
functorIdentity f = fmap id f == f
functorCompose :: (Eq (f c), Functor f) => (a -> b) -> (b -> c) -> f a -> Bool
functorCompose f g x =
(fmap g (fmap f x)) == (fmap (g . f) x)
... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/16/FunctorLaw.hs | haskell | -
* exercise
- | # LANGUAGE ScopedTypeVariables #
module FunctorLaw where
import Test.QuickCheck
functorIdentity :: (Functor f, Eq (f a)) => f a -> Bool
functorIdentity f = fmap id f == f
functorCompose :: (Eq (f c), Functor f) => (a -> b) -> (b -> c) -> f a -> Bool
functorCompose f g x =
(fmap g (fmap f x)) == (fmap (g . f) x)
... |
fcbc3f178c90951471c14716439fe1b6d31af9db9adeff34b305243e8df23654 | lingnand/VIMonad | Promote.hs | -----------------------------------------------------------------------------
-- |
Module : XMonad . Actions . Promote
Copyright : ( c ) 2007
-- License : BSD3-style (see LICENSE)
--
-- Maintainer :
-- Stability : unstable
-- Portability : unportable
--
Alternate promote function for xm... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Actions/Promote.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : unportable
Moves the focused window to the master pane. All other windows
retain their order. If focus is in the master, swap it with the... | Module : XMonad . Actions . Promote
Copyright : ( c ) 2007
Alternate promote function for xmonad .
module XMonad.Actions.Promote (
promote
) where
import XMonad
import XMonad.StackSet
> import XMonad . Actions . Promote
the... |
ce608a0be1dab2717bf5ddd912d0c98aba223cda1dfef535353f9689ca2a96f6 | ocsigen/js_of_ocaml | js_of_ocaml_compiler_dynlink.mli | Js_of_ocaml library
* /
* Copyright ( C ) 2022 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/8464de2751b2110acac2197e9a721c7e3849334a/compiler/lib-dynlink/js_of_ocaml_compiler_dynlink.mli | ocaml | * Deliberately empty | Js_of_ocaml library
* /
* Copyright ( C ) 2022 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the... |
41334b5ba65edc5adcac5d222345cb87c671b7dc57fab026c87c0273639acac9 | janestreet/incr_map | incr_map_collate.ml | open! Core
module Collate = Collate
module Collated = Collated
module Map_list = Incr_map_erase_key
module Store = Incr_memoize.Store
module Store_params = Incr_memoize.Store_params
module Compare = struct
type ('k, 'v, 'cmp) t =
| Unchanged
| Reversed
| Custom_by_value of { compare : 'v -> 'v -> int }
... | null | https://raw.githubusercontent.com/janestreet/incr_map/fe0db64862f027a826cf172e0a74a01d36ab50c7/collate/src/incr_map_collate.ml | ocaml | We implement "lazy eviction" here - we only allow ourselves to use a value from
deeper cache if its partial computations are present in the earlier layers.
E.g. if we evict some ordering "s" from [cache_sorted], we might still have
"s, f, r" in [cache_sorted_filtered_ranked], but we won't use it,... | open! Core
module Collate = Collate
module Collated = Collated
module Map_list = Incr_map_erase_key
module Store = Incr_memoize.Store
module Store_params = Incr_memoize.Store_params
module Compare = struct
type ('k, 'v, 'cmp) t =
| Unchanged
| Reversed
| Custom_by_value of { compare : 'v -> 'v -> int }
... |
7b4719729342a5a93daab56a914a1638f79a521aae744bceaf15268e51046773 | Opetushallitus/aipal | tiedote.clj | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
;;
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
of the EUPL ( the " Licence " ) ;
;;
;; You may not use this work except... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/aipal/src/clj/aipal/rest_api/tiedote.clj | clojure |
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: /
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 | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
European Union Public Licence for more details .
(ns aipal.rest-api.tiedot... |
968d954ad7a4f7b5e94975e54969686f64375f75eb265fda6843f5ac877be9ee | Liqwid-Labs/liqwid-plutarch-extra | IsData.hs | # LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
module Plutarch.Extra.IsData (
* PlutusTx ToData / FromData derive - wrappers
ProductIsData (..),
EnumIsData (..),
unProductIsData,
* Plutarch PIsData / PlutusType derive - wrappers
DerivePConstantViaDataList (..),
DerivePConstantViaEnum (..),
... | null | https://raw.githubusercontent.com/Liqwid-Labs/liqwid-plutarch-extra/79604ece6d24c1e5d6e11c02e88f9e7907a19399/src/Plutarch/Extra/IsData.hs | haskell | * Functions for PEnumData types
------------------------------------------------------------------------------
------------------------------------------------------------------------------
ProductIsData
|
Unsafe version of 'gProductFromBuiltinData'.
@since 1.1.0
| @since 1.1.0
| @since 1.1.0
| @since 1.1.0... | # LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
module Plutarch.Extra.IsData (
* PlutusTx ToData / FromData derive - wrappers
ProductIsData (..),
EnumIsData (..),
unProductIsData,
* Plutarch PIsData / PlutusType derive - wrappers
DerivePConstantViaDataList (..),
DerivePConstantViaEnum (..),
... |
4f1e170752b5980ae6ec6b1911e06c3eb68830a6c028e843cb093938604cab59 | progman1/genprintlib | mkgenprintval.ml | let _=
let v=Sys.ocaml_version in
if v < "4.03.0" then(
Unix.rename "genprintval.ml-2" "genprintval.ml";
)else
if v < "4.04.0" then(
Unix.rename "genprintval.ml-3" "genprintval.ml";
)else
if v < "4.05.0" then(
Unix.rename "genprintval.ml-4" "genprintval.ml";
)else
if v < "4.06.0" then(
U... | null | https://raw.githubusercontent.com/progman1/genprintlib/acc1e5cc46b9ce6191d0306f51337581c93ffe94/src/mkgenprintval.ml | ocaml | let _=
let v=Sys.ocaml_version in
if v < "4.03.0" then(
Unix.rename "genprintval.ml-2" "genprintval.ml";
)else
if v < "4.04.0" then(
Unix.rename "genprintval.ml-3" "genprintval.ml";
)else
if v < "4.05.0" then(
Unix.rename "genprintval.ml-4" "genprintval.ml";
)else
if v < "4.06.0" then(
U... | |
07ec4ea00e67060f7aedbddc9b2648ac999a3a667e74acbe6f4a98f88b58742e | xvw/muhokama | assoc.ml | module L = Preface_stdlib.List.Applicative.Traversable (Validate.Applicative)
let valid f = f Validate.valid
let unexpected_repr expected_representation () =
Error.(
to_validate @@ validation_unexpected_representation ~expected_representation)
;;
let missing_field field () = Error.(to_validate @@ field_missing... | null | https://raw.githubusercontent.com/xvw/muhokama/d628d05e2fc5af3fbf86d2177458336b647ece08/lib/common/assoc.ml | ocaml | module L = Preface_stdlib.List.Applicative.Traversable (Validate.Applicative)
let valid f = f Validate.valid
let unexpected_repr expected_representation () =
Error.(
to_validate @@ validation_unexpected_representation ~expected_representation)
;;
let missing_field field () = Error.(to_validate @@ field_missing... | |
5e901f9001a7a096aa91de6bd132bfaa6a7895fc83ac87761d0dd703857c3ec8 | rescript-association/genType | GenTypeMain.ml | module StringSet = Set.Make (String)
let cmtCheckAnnotations ~checkAnnotation inputCMT =
match inputCMT.Cmt_format.cmt_annots with
| Implementation structure ->
structure |> Annotation.structureCheckAnnotation ~checkAnnotation
| Interface signature ->
signature |> Annotation.signatureCheckAnnotation ~che... | null | https://raw.githubusercontent.com/rescript-association/genType/22b666a1004b5079c2a5f76d20e79a3b11c9e2dd/src/GenTypeMain.ml | ocaml | module StringSet = Set.Make (String)
let cmtCheckAnnotations ~checkAnnotation inputCMT =
match inputCMT.Cmt_format.cmt_annots with
| Implementation structure ->
structure |> Annotation.structureCheckAnnotation ~checkAnnotation
| Interface signature ->
signature |> Annotation.signatureCheckAnnotation ~che... | |
d1062b15c17585535a332ec09f7bffd8bbe0b58709f291ea964b6014c02c9294 | d-cent/objective8 | validations.clj | (ns objective8.integration.front-end.validations
(:require [midje.sweet :refer :all]
[peridot.core :as p]
[oauth.client :as oauth]
[objective8.front-end.api.http :as http-api]
[objective8.integration.integration-helpers :as ih]
[objective8.config :as config]... | null | https://raw.githubusercontent.com/d-cent/objective8/db8344ba4425ca0b38a31c99a3b282d7c8ddaef0/test/objective8/integration/front_end/validations.clj | clojure | Sign-in background
Test data background | (ns objective8.integration.front-end.validations
(:require [midje.sweet :refer :all]
[peridot.core :as p]
[oauth.client :as oauth]
[objective8.front-end.api.http :as http-api]
[objective8.integration.integration-helpers :as ih]
[objective8.config :as config]... |
2f22813321af003cc4e62eb6ecc14993b5b841494360385bd7daf44a0b7a2caf | gchrupala/morfette | Vector.hs | # LANGUAGE FlexibleContexts , BangPatterns #
module GramLab.Perceptron.Vector
( SparseVector
, DenseVector
, DenseVectorST
, for_
, plus_
, scale
, dot
, dot'
, unsafeDot
)
where
import Data.Array.ST
import Data.Array.Unboxed (UArray,bounds,(!))
import Control.Monad.ST
import ... | null | https://raw.githubusercontent.com/gchrupala/morfette/be40676c975d660bbb893953d354168506069862/src/GramLab/Perceptron/Vector.hs | haskell | # INLINE for_ #
# SPECIALIZE plus_ :: DenseVectorST s (Int,Int)
-> SparseVector Int Int -> ST s () #
# SPECIALIZE scale :: SparseVector Int Int
-> Float
-> SparseVector Int Int # | # LANGUAGE FlexibleContexts , BangPatterns #
module GramLab.Perceptron.Vector
( SparseVector
, DenseVector
, DenseVectorST
, for_
, plus_
, scale
, dot
, dot'
, unsafeDot
)
where
import Data.Array.ST
import Data.Array.Unboxed (UArray,bounds,(!))
import Control.Monad.ST
import ... |
bc3d5c7b4b928be354a958a2b7f385e17be05be98a02b13c34995da8918084fa | vincenthz/hs-crypto-cipher | DES.hs | -- |
-- Module : Crypto.Cipher.DES
-- License : BSD-style
Maintainer : < >
-- Stability : stable
-- Portability : good
--
module Crypto.Cipher.DES
( DES
) where
import Data.Byteable
import Data.Word
import Crypto.Cipher.Types
import Crypto.Cipher.DES.Primitive
import Crypto.Cipher.DES.Seriali... | null | https://raw.githubusercontent.com/vincenthz/hs-crypto-cipher/d12559572eb7df9e4497db40a729680481ad3124/cipher-des/Crypto/Cipher/DES.hs | haskell | |
Module : Crypto.Cipher.DES
License : BSD-style
Stability : stable
Portability : good
| DES Context | Maintainer : < >
module Crypto.Cipher.DES
( DES
) where
import Data.Byteable
import Data.Word
import Crypto.Cipher.Types
import Crypto.Cipher.DES.Primitive
import Crypto.Cipher.DES.Serialization
data DES = DES Word64
deriving (Eq)
instance Cipher DES where
cipherName _ = "DES"
cipherKey... |
c61bf26f86b4724eb2e127ecf7b094c73d8af2bd67545311fd39f07b1373f1be | wellposed/numerical | test.hs | import Test.Tasty
import Test . Tasty . QuickCheck as QC
import PropShape
import PropLayout
import Data.List
import Data.Ord
main = defaultMain tests
tests :: TestTree
[ layoutProperties , shapeProperties]-- [ properties , unitTests ]
--properties :: TestTree
--properties = testGroup "Properties" [scProps, qcProps]... | null | https://raw.githubusercontent.com/wellposed/numerical/6b458232760b20674487bd9f8442b0991ce59423/tests/test.hs | haskell | [ properties , unitTests ]
properties :: TestTree
properties = testGroup "Properties" [scProps, qcProps]
[ SC.testProperty "sort == sort . reverse" $
-- the following property does not hold
]
[ QC.testProperty "sort == sort . reverse" $
-- the following property does not hold
]
unitTests = testGroup "Unit ... | import Test.Tasty
import Test . Tasty . QuickCheck as QC
import PropShape
import PropLayout
import Data.List
import Data.Ord
main = defaultMain tests
tests :: TestTree
scProps = testGroup " ( checked by SmallCheck ) "
- > sort ( list : : [ Int ] ) = = sort ( reverse list )
, SC.testProperty " Fermat 's ... |
79c49a20278bf65cbfaf084f45ba1022991a064c594856e0f1c664fc68f818bc | racket/typed-racket | dungeon-main.rkt | #lang typed/racket/shallow
;; File should compile without unbound identifier errors
;;
;; Example of a bad error:
;; g486: undefined;
;; cannot reference an identifier before its definition
module : " /Users / / code / racket / fork / extra - pkgs / typed - racket / typed - racket - test / shallow / pass /... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/dungeon-main.rkt | racket | File should compile without unbound identifier errors
Example of a bad error:
g486: undefined;
cannot reference an identifier before its definition
-----------------------------------------------------------------------------
maps positions to cell constructors
(so that we can construct the room... | #lang typed/racket/shallow
module : " /Users / / code / racket / fork / extra - pkgs / typed - racket / typed - racket - test / shallow / pass / dungeon - main.rkt "
internal name :
(require
typed/racket/class
racket/match
)
(require/typed racket/set
(set-intersect (All (A) (-> (Listof A) (Listo... |
c262b69b20445b1f62f46ef01dca0911ab744d29084e3d27dd3e1589acb37b79 | GaloisInc/what4 | AppTheory.hs | ------------------------------------------------------------------------
-- |
Module : .
-- Description : Identifying the solver theory required by a core expression
Copyright : ( c ) Galois , Inc 2016 - 2020
-- License : BSD3
Maintainer : < >
-- Stability : provisional
---------------------... | null | https://raw.githubusercontent.com/GaloisInc/what4/79ad25c3a207503c8da36dd3ce9e8618f2704a60/what4/src/What4/Expr/AppTheory.hs | haskell | ----------------------------------------------------------------------
|
Description : Identifying the solver theory required by a core expression
License : BSD3
Stability : provisional
----------------------------------------------------------------------
# LANGUAGE GADTs #
| The theory that a symbol belong... | Module : .
Copyright : ( c ) Galois , Inc 2016 - 2020
Maintainer : < >
module What4.Expr.AppTheory
( AppTheory(..)
, quantTheory
, appTheory
, typeTheory
) where
import What4.Expr.App
import What4.BaseTypes
import qualified What4.SemiRing as SR
import qualified What... |
35bab563ccda0ac1c10f662cabb99dfe64b9f42bdbf8439d43ee567c9fe44931 | Incanus3/ExiL | setup.lisp | (in-package #:quicklisp)
(defun show-wrapped-list (words &key (indent 4) (margin 60))
(let ((*print-right-margin* margin)
(*print-pretty* t)
(*print-escape* nil)
(prefix (make-string indent :initial-element #\Space)))
(pprint-logical-block (nil words :per-line-prefix prefix)
(pprint-fill ... | null | https://raw.githubusercontent.com/Incanus3/ExiL/de0f7c37538cecb7032cc1f2aa070524b0bc048d/src/dependencies/quicklisp/setup.lisp | lisp | Only show package markers when compiling. Showing
them when loading shows a bunch of ASDF system
package noise.
just resignal | (in-package #:quicklisp)
(defun show-wrapped-list (words &key (indent 4) (margin 60))
(let ((*print-right-margin* margin)
(*print-pretty* t)
(*print-escape* nil)
(prefix (make-string indent :initial-element #\Space)))
(pprint-logical-block (nil words :per-line-prefix prefix)
(pprint-fill ... |
94183a45840f83d3eed7d3003429126dd54b3343a6ca6724708f7ff52a511989 | dakk/yallo-lang | bast.ml | (* this ast rep removes record, enum and tuples, translating them to pair / or *)
| null | https://raw.githubusercontent.com/dakk/yallo-lang/55a1b379306c9f113bd707e78b6e0c1be81bb7be/lib/intermediate/3_bast/bast.ml | ocaml | this ast rep removes record, enum and tuples, translating them to pair / or | |
a72dad6cd88c641a24b665a31f0792f9a3d2c46edf47da80bccfc7898f13b4fb | tiancaiamao/yasfs | infer.scm | (use matchable)
;; int
;; bool
;; (type -> type)
3
;; (var (apple : type) (orange))
;; (var ())
;; subst all occur v in t1 to t2 -- t1[v/t2]
(define (subst type1 tvar type2)
(match type1
['int 'int]
['bool 'bool]
[(a '-> b) `(,(subst a tvar type2) -> ,(subst b tvar type2))]
[(... | null | https://raw.githubusercontent.com/tiancaiamao/yasfs/c138b7bf9a16ee70b90e5d18bdd45c60cd8e2f44/infer.scm | scheme | int
bool
(type -> type)
(var (apple : type) (orange))
(var ())
subst all occur v in t1 to t2 -- t1[v/t2]
(subst 'int '1 'int)
(subst '3 '4 'int)
(occur? 3 '(int -> int))
(occur? 3 '(bool -> 3))
[((ver l1 ...) . (ver l1 ...))]
(unify 'int 'bool (empty-subst))
(unify 'int 'int (empty-subst))
(unify '(var (... | (use matchable)
3
(define (subst type1 tvar type2)
(match type1
['int 'int]
['bool 'bool]
[(a '-> b) `(,(subst a tvar type2) -> ,(subst b tvar type2))]
[('var l ...) `(var ,(subst-label-list l tvar type2))]
[('vec l ...) `(var ,(subst-label-list l tvar type2))]
... |
892815aa8315787e499f74e64692aaca157c17624fa2155bb4569a725f8cb05f | ocaml-ppx/ppx | ast_traverse.ml | open! Import
open Current_ast
class map = object
inherit Traverse_builtins.map
inherit Virtual.map
end
class iter = object
inherit Traverse_builtins.iter
inherit Virtual.iter
end
class ['acc] fold = object
inherit ['acc] Traverse_builtins.fold
inherit ['acc] Virtual.fold
end
class ['acc] fold_map = obje... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/src/ast_traverse.ml | ocaml | WAS:
method! structure_item_desc path x =
match x with
| Pstr_module mb -> super#structure_item_desc (enter mb.pmb_name.txt path) x
| _ -> super#structure_item_desc path x
Overriding [module_binding] seems to be OK because it does not catch
local module bindings because at the moment the... | open! Import
open Current_ast
class map = object
inherit Traverse_builtins.map
inherit Virtual.map
end
class iter = object
inherit Traverse_builtins.iter
inherit Virtual.iter
end
class ['acc] fold = object
inherit ['acc] Traverse_builtins.fold
inherit ['acc] Virtual.fold
end
class ['acc] fold_map = obje... |
abaf89f31f833c15c5d2c9a29474c6c344dd364f90bf05e2468fe7de486f6335 | karen/haskell-book | Cipher.hs | module Cipher where
import Data.Char
import Test.QuickCheck
data CipherType = Encrypt | Decrypt
deriving (Eq, Show)
caesar :: Int -> String -> String
caesar _ [] = []
caesar n x = caesarHelper n x Encrypt
unCaesar :: Int -> String -> String
unCaesar _ [] = []
unCaesar n x = caesarHelper n x Decrypt
caesarHelpe... | null | https://raw.githubusercontent.com/karen/haskell-book/90bb80ec3203fde68fc7fda1662d9fc8b509d179/src/ch29/Cipher.hs | haskell | module Cipher where
import Data.Char
import Test.QuickCheck
data CipherType = Encrypt | Decrypt
deriving (Eq, Show)
caesar :: Int -> String -> String
caesar _ [] = []
caesar n x = caesarHelper n x Encrypt
unCaesar :: Int -> String -> String
unCaesar _ [] = []
unCaesar n x = caesarHelper n x Decrypt
caesarHelpe... | |
6e1d1501719da5b48fd6bcac5d358b882fafc943ed853487c8296725400be9e3 | modular-macros/ocaml-macros | w51_bis.ml | let rec foldl op acc = function
[] -> acc
| x :: xs ->
try (foldl [@tailcall]) op (op x acc) xs
with Not_found -> assert false
| null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/warnings/w51_bis.ml | ocaml | let rec foldl op acc = function
[] -> acc
| x :: xs ->
try (foldl [@tailcall]) op (op x acc) xs
with Not_found -> assert false
| |
af66ac5b857d89c5220fcd1d51f799b3e35bf16cd5b5b6ffac1dfeb5759e5be7 | ericclack/clojure-wiki | db_nav.clj | (ns clojure-wiki.test.db-nav
(:require [clojure.test :refer :all]
[clojure.string :as s]
[clojure-wiki.models.db :as db]
[clojure-wiki.test.utils :as utils]))
Run this from test so that it uses the test environment
;; and database-url.
;; To Do:
;; -
(defn doc-prep-fixture [... | null | https://raw.githubusercontent.com/ericclack/clojure-wiki/61986386492338d139a233ee41a21a5bda5327d9/test/clj/clojure_wiki/test/db_nav.clj | clojure | and database-url.
To Do:
-
Set up code
The test
Tear down code
---------------------------------------------------- | (ns clojure-wiki.test.db-nav
(:require [clojure.test :refer :all]
[clojure.string :as s]
[clojure-wiki.models.db :as db]
[clojure-wiki.test.utils :as utils]))
Run this from test so that it uses the test environment
(defn doc-prep-fixture [f]
(utils/delete-if-exists! db/nav-... |
9d7ae3aa88a7fe1c778dc0115ca935fc59490744739e73e83a7632b360580cd7 | dbuenzli/rel | test_list.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The rel programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2... | null | https://raw.githubusercontent.com/dbuenzli/rel/6be328cc0186cec76739ee86ffa383804eb87ec0/test/test_list.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The rel programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2... | |
d4a9eaa94e2de0c5ea0bb117cccdd2ea0afe8fffa605c12ef5d24b07081ff082 | lafka/linedancer | linedancer_client_fsm.erl | -module(linedancer_client_fsm).
-behaviour(gen_fsm).
-export([start_link/1, set_socket/2]).
%% gen_fsm callbacks
-export([init/1, handle_event/3, handle_sync_event/4, handle_info/3,
terminate/3, code_change/4]).
-export([
'WAIT_FOR_SOCKET'/2,
'WAIT_FOR_DATA'/2
]).
-record(state, {socket :: gen_tcp:socket(), ... | null | https://raw.githubusercontent.com/lafka/linedancer/a05eb949b0fec72df7e4663f50871020d35056c0/src/linedancer_client_fsm.erl | erlang | gen_fsm callbacks
The client socket
Client IP addr | -module(linedancer_client_fsm).
-behaviour(gen_fsm).
-export([start_link/1, set_socket/2]).
-export([init/1, handle_event/3, handle_sync_event/4, handle_info/3,
terminate/3, code_change/4]).
-export([
'WAIT_FOR_SOCKET'/2,
'WAIT_FOR_DATA'/2
]).
fsm :: atom() | {atom(), atom()} | {global, te... |
ec6cae6710c411a985248b2dcf909b48b656d899a2653a6fd1466839757f20da | motoshira/lib_for_competitive_programming | counter.lisp | (defpackage counter
(:use #:cl)
(:nicknames #:ct)
(:export #:make-counter
#:inc!
#:dec!
#:query))
(in-package #:counter)
(defstruct (counter (:constructor make-counter (&key
(test #'eql)
... | null | https://raw.githubusercontent.com/motoshira/lib_for_competitive_programming/82ffbdddabe3906809e6996ac9caa9e54f9711d2/experimental/counter.lisp | lisp | (defpackage counter
(:use #:cl)
(:nicknames #:ct)
(:export #:make-counter
#:inc!
#:dec!
#:query))
(in-package #:counter)
(defstruct (counter (:constructor make-counter (&key
(test #'eql)
... | |
9d17c46c7a0331984942c723e860eb5722dbc7d92e133e76fa97603073b3b8b9 | samth/git-slice | filter.rkt | #lang racket
(require "git.rkt")
(provide go)
(define prune (path->string (collection-file-path "prune.rkt" "git-slice")))
(define commit (path->string (collection-file-path "commit.rkt" "git-slice")))
(define (go dest-dir tmp-dir dry-run? #:start-at [start-at #f] [counts #f])
(printf "\n# git-slice: filtering rele... | null | https://raw.githubusercontent.com/samth/git-slice/110b361425280e61abf8de99e5d41865afc5cddb/filter.rkt | racket | #lang racket
(require "git.rkt")
(provide go)
(define prune (path->string (collection-file-path "prune.rkt" "git-slice")))
(define commit (path->string (collection-file-path "commit.rkt" "git-slice")))
(define (go dest-dir tmp-dir dry-run? #:start-at [start-at #f] [counts #f])
(printf "\n# git-slice: filtering rele... | |
0caa7220f853379422574dfbbca56d3120e40873f44d0ee89756e85941b96522 | mirage/mirage-lambda | parsetree.ml |
* Copyright ( c ) 2018 < >
* and < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | null | https://raw.githubusercontent.com/mirage/mirage-lambda/a89b265b552f8b63ff725fc942f41a276fabb4f5/src/parsetree.ml | ocaml |
* Copyright ( c ) 2018 < >
* and < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | |
5244c26a790555ba8d55f742595b762c0d6b1504397cd52b6e44da065b7a39d8 | krohrer/caml-aesq | test.ml | #use "topfind"
#require "Aesq"
#require "Inspect"
open Aesq
open Inspect
let inspect x = Sexpr.dump x
let random_element arr =
fun () ->
let i = Random.int (Array.length arr) in
arr.(i)
let random_word =
random_element [|
"BORG";
"A";
"ZORG";
"FLOBNOCK";
"BERZ";
"FOO";
"FR... | null | https://raw.githubusercontent.com/krohrer/caml-aesq/4cdbd23c010ad3e8eb67ca6a86cdb6a9efafc9c6/test.ml | ocaml | Text.dump_raw stdout s1; | #use "topfind"
#require "Aesq"
#require "Inspect"
open Aesq
open Inspect
let inspect x = Sexpr.dump x
let random_element arr =
fun () ->
let i = Random.int (Array.length arr) in
arr.(i)
let random_word =
random_element [|
"BORG";
"A";
"ZORG";
"FLOBNOCK";
"BERZ";
"FOO";
"FR... |
70abae2afc32112ea1e2d39c014bcbcad0a669dd2c0acd72b08e771a0de7515b | pedestal/pedestal | service.clj | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; 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 ... | null | https://raw.githubusercontent.com/pedestal/pedestal/53bfe70143a22cdfd2f0d183023334a199c9e9a2/samples/template-server/src/template_server/service.clj | clojure | The use and distribution terms for this software are covered by the
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 this notice, or any other, from this software.
T... | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
Eclipse Public License 1.0 ( )
(ns template-server.service
(:require [io.pedestal.http :as http]
[io.pedestal.http.route :as route]
[ring.util.response :as ring-resp]
[clojure.java.io :as io]
... |
c383e5452f28a4de9bb2a51ae52af88c923d7c3a0b67d0869e7ae235a6fa356a | skanev/playground | 33.scm | SICP exercise 1.33
;
You can obtain an even more general version of accumulate ( exercise 1.32 ) by
; introducing the notion of a filter on the terms to be combined. That is,
; combine only those terms derived from values in the range that satisfy a
; specified condition. The resulting filtered-accumulate abstracti... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/33.scm | scheme |
introducing the notion of a filter on the terms to be combined. That is,
combine only those terms derived from values in the range that satisfy a
specified condition. The resulting filtered-accumulate abstraction takes the
argument that specifies the filter. Write filtered-accumulate as a procedure.
Show how to e... | SICP exercise 1.33
You can obtain an even more general version of accumulate ( exercise 1.32 ) by
same arguments as accumulate , together with an additional predicate of one
prime to n ( i.e. all positive integer i < n such that GCD(i , n ) = 1 ) .
(define (filtered-accumulate combiner null-value term a next ... |
2cb8a2aaf8cda29fa58a39d0f78c87053c1b4c7d57186095869dd06c5a3670b3 | facebookarchive/pfff | gpointer.ml | (**************************************************************************)
(* Lablgtk *)
(* *)
(* This program is free software; you can redistribute it *)
and/or ... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/external/ocamlgtk/src/gpointer.ml | ocaml | ************************************************************************
Lablgtk
This program is free software; you can redistribute it
comes with the library. ... | and/or modify it under the terms of the GNU Library General
Public License as published by the Free Software Foundation
version 2 , with the exception described in file COPYING which
GNU Library General Public License for more details .
You should have r... |
313c58a93a0dabf511a7e62f9c6eb81b98438afaf6781f82164cdc2a1e13adc7 | rowangithub/DOrder | w2.ml | let rec loop x n =
if (Random.bool ()) then
let x = x + 1 in
if (x >= n) then assert (x = n)
else loop x n
else loop x n
let main n =
let x = 0 in
if (n > 0) then
loop x n
else ()
let _ = main 2
let _ = main (-2) | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/ice/w2.ml | ocaml | let rec loop x n =
if (Random.bool ()) then
let x = x + 1 in
if (x >= n) then assert (x = n)
else loop x n
else loop x n
let main n =
let x = 0 in
if (n > 0) then
loop x n
else ()
let _ = main 2
let _ = main (-2) | |
5f80e6b8e27f764ea3fe84bf7488a36113c2f623b79004d28a2cace0a5ecaa7d | cloojure/tupelo | safe.cljc | 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/485680380b2d10727181b9c3dd198ab1e6299817/test/cljc/tst/tupelo/string/safe.cljc | clojure | (-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 this notice, or any other, from this
software.
sometimes this is required - not sure why | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse Public License 1.0
(ns tst.tupelo.string.safe
#?(:cljs (:require-macros
[tupelo.testy]
))
(:require
[tupelo.core :as t :refer [spy spyx spyxx spyx-pretty forv]... |
35dfbb9e9cf637af9e3e63d1dd6429c526fe7220459740918669f9407945e937 | input-output-hk/cardano-wallet | Transaction.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE StrictData #-}
-- |
Copyright : © 2018 - 2022 IOHK
-- License: Apache-2.0
mod... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/18bc22ad0932e4e8b1b6eafee5edf99ac57126af/lib/wallet/api/http/Cardano/Wallet/Api/Types/Transaction.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE StrictData #
|
License: Apache-2.0
| A helper type to reduce the amount of repetition.
| # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
Copyright : © 2018 - 2022 IOHK
module Cardano.Wallet.Api.Types.Transaction
( AddressAmount (..)
, ApiAssetMintBurn... |
54dccff467f0fd66e4339502a83e708bd3e376539d1c8b46af52a3a4b0572cf7 | beamparticle/beamparticle | beamparticle_javaparser.erl | %%% %CopyrightBegin%
%%%
Copyright < > 2017 .
All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% -2.0
%%%
%%% Unless required by applicable l... | null | https://raw.githubusercontent.com/beamparticle/beamparticle/65dcea1569d06b331b08cd9f8018ece4b176b690/src/beamparticle_javaparser.erl | erlang | %CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lang... | Copyright < > 2017 .
All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(beamparticle_javaparser).
-include("beamparticle_constants.hrl").
-export([
evaluate_java_expression/4,
get_e... |
82b8ebe3b8966ad5c966efe4b303f27c76756c4825e63f8ebb1d6ae4264b32dc | metaocaml/ber-metaocaml | t200-getfield0.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
a : int;
};;
if { a = 7 }.a <> 7 then raise Not_found... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t200-getfield0.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
a : int;
};;
if { a = 7 }.a <> 7 then raise Not_found... | |
d69d24190030384f052c6bea1b35a23e34df6b818ab2b54d19148fa04a22ef27 | neilprosser/mr-maestro | alarms.clj | (ns maestro.messages.alarms
(:require [amazonica.aws.cloudwatch :as cw]
[clojure.string :as str]
[maestro
[alarms :as alarms]
[aws :as aws]
[log :as log]
[responses :refer [error-with success]]
[util :as util]]))
(defn swap-poli... | null | https://raw.githubusercontent.com/neilprosser/mr-maestro/469790fd712262016729c1d83d4b4e11869237a2/src/maestro/messages/alarms.clj | clojure | (ns maestro.messages.alarms
(:require [amazonica.aws.cloudwatch :as cw]
[clojure.string :as str]
[maestro
[alarms :as alarms]
[aws :as aws]
[log :as log]
[responses :refer [error-with success]]
[util :as util]]))
(defn swap-poli... | |
5e3583a7a159dd16d36f72b6fb4b02bb3b82474dd85289474304bb7af4ce354e | openmusic-project/RQ | k-best-segment-quantification-automaton-with-tempo.lisp | (in-package :rq)
Functions to run the algorithm ( ie build a k - best structure ) on one segment
In this version , only 1 input and 1 table are created , and they take into account 1 tempo only ( such that the segment 's length is an integer multiple of the length of a beat )
(defun k-best-segment-quantify-auto... | null | https://raw.githubusercontent.com/openmusic-project/RQ/d6b1274a4462c1500dfc2edab81a4425a6dfcda7/src/algorithm/k-best-segment-quantification-automaton-with-tempo.lisp | lisp | if the segment is empty | (in-package :rq)
Functions to run the algorithm ( ie build a k - best structure ) on one segment
In this version , only 1 input and 1 table are created , and they take into account 1 tempo only ( such that the segment 's length is an integer multiple of the length of a beat )
(defun k-best-segment-quantify-auto... |
82a7e2f0880ca7b98d2db15f14f84534ad6d8ad3c7103ecd0238382cc88d5e10 | nomeata/incredible | Lint.hs | -- | This module is a linter for the input and output of our programs. This
-- means it checks properties that, if they fail, are a bug somewhere in the
-- program.
--
-- It should not be possible to trigger the linter via the usual interface (but
-- easily so via the debugging interface).
--
The existence of this mo... | null | https://raw.githubusercontent.com/nomeata/incredible/d18ada4ae7ce1c7ca268c050ee688b633a307c2e/logic/Lint.hs | haskell | | This module is a linter for the input and output of our programs. This
means it checks properties that, if they fail, are a bug somewhere in the
program.
It should not be possible to trigger the linter via the usual interface (but
easily so via the debugging interface).
| The existence of this module means that ’s type system is not perfect ...
The name " linter " comes from GHC , which also has that .
module Lint where
import qualified Data.Map as M
import Text.Printf
import Data.Tagged
import Types
type Lints = [String]
lint :: Context -> Proof -> Lints
lint logic proof = ... |
0f4296fea994956e61749344e939606717004fd3819440aaeb3891bb979c7773 | reasonml/reason | migrate_parsetree_500_414.ml | (**************************************************************************)
(* *)
(* OCaml Migrate Parsetree *)
(* *)
... | null | https://raw.githubusercontent.com/reasonml/reason/3f433821d93bdc8f85677d4ee5d276ff6551c777/src/vendored-omp/src/migrate_parsetree_500_414.ml | ocaml | ************************************************************************
OCaml Migrate Parsetree
... |
Copyright 2017 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
include Migrate_parsetree_500_414_migrate
$ open Printf
let fields = [
" attribute " ; " attribut... |
0ee1b8f1ef1d8cff75ab562ec8cb0dad02a5224a5cbdf60f94f20c22152c9fa9 | illiichi/orenolisp | layout_test.clj | (ns view.layout-test
(:require [clojure.test :refer [deftest testing is] :as t]
[orenolisp.model.editor :as ed]
[orenolisp.view.layout.layout :as l]
[orenolisp.view.layout.layout-decision :as layout-decision]
[orenolisp.model.conversion :as conv]))
(defn- bounds-p... | null | https://raw.githubusercontent.com/illiichi/orenolisp/7b085fb687dbe16b5cbe8c739238bbaf79156814/test/view/layout_test.clj | clojure | (ns view.layout-test
(:require [clojure.test :refer [deftest testing is] :as t]
[orenolisp.model.editor :as ed]
[orenolisp.view.layout.layout :as l]
[orenolisp.view.layout.layout-decision :as layout-decision]
[orenolisp.model.conversion :as conv]))
(defn- bounds-p... | |
84e71114e76ec0a896ec1bd88f92c73999d62249592498507f99f061f095e82c | bsansouci/reasonglexampleproject | liv.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bsansouci/reasonglexampleproject/4ecef2cdad3a1a157318d1d64dba7def92d8a924/vendor/camlimages/examples/liv/liv.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1999,2000,2001,2002,2001,2002
Institut National de Recherche en Informatique et en Automatique .
open Images
open OImages
let _ =
Bitmap.maximum_live : = 15000000 ; ( * 60 MB
let _ =
Bitmap.maximum_blo... |
e081c30e121a9f6e3f73fdd3aa2c2ba2a776d3342eb491e316362f43ec78d1cb | pqwy/notty | sierpinski.ml | Copyright ( c ) 2016 - 2017 . All rights reserved .
See LICENSE.md .
See LICENSE.md. *)
(**
* A classic example in combinatory graphics.
*
* Demonstrates interaction.
*)
open Notty
open Common
let () =
simpleterm ~s:1
~f:(fun s -> function
| `Key (`ASCII 'q', _) -> None
| `Key (`Arr... | null | https://raw.githubusercontent.com/pqwy/notty/389366c023396017aa21efcdbb07ade5ba0974c5/examples/sierpinski.ml | ocaml | *
* A classic example in combinatory graphics.
*
* Demonstrates interaction.
| Copyright ( c ) 2016 - 2017 . All rights reserved .
See LICENSE.md .
See LICENSE.md. *)
open Notty
open Common
let () =
simpleterm ~s:1
~f:(fun s -> function
| `Key (`ASCII 'q', _) -> None
| `Key (`Arrow a, _) ->
( match a with
| `Up | `Left -> Some (max 1 (s - 1))
... |
e18f69095b61105aa38a1037096daeb2ddd1866b2305322c7d6955e5b6752e70 | semmons99/clojure-euler | prob-031.clj | problem 031 ; ; ; ; ; ; ; ; ; ;
(defn make-change
([amt] (make-change amt [1 2 5 10 20 50 100 200]))
([amt coins]
(cond
(or (empty? coins) (< amt 0)) 0
(= 1 (count coins)) 1
:else (+ (make-change amt (butlast coins))
(make-change (- amt (last coins)) coins)))))
(defn prob-031 []
... | null | https://raw.githubusercontent.com/semmons99/clojure-euler/3480bc313b9df7f282dadf6e0b48d96230f1bfc1/prob-031.clj | clojure | ; ; ; ; ; ; ; ; ; | (defn make-change
([amt] (make-change amt [1 2 5 10 20 50 100 200]))
([amt coins]
(cond
(or (empty? coins) (< amt 0)) 0
(= 1 (count coins)) 1
:else (+ (make-change amt (butlast coins))
(make-change (- amt (last coins)) coins)))))
(defn prob-031 []
(make-change 200))
|
32c8f28478d74d0a18e6fd585e2f33af301fe1031c04c4ea4726e86857120a40 | tuura/pangraph | Ast.hs | module Pangraph.Pajek.Ast where
|
Module : Pangraph . Pajek . Ast
Description : Abstract syntax tree for pajek ( .net ) files
Module : Pangraph.Pajek.Ast
Description : Abstract syntax tree for pajek (.net) files
-}
data Pajek a = Graph (Maybe a) [Vertex a] [Edge] deriving (Show, Eq, Or... | null | https://raw.githubusercontent.com/tuura/pangraph/ca896f25e5b49e0f59b69367125d01a2aa42beb3/src/Pangraph/Pajek/Ast.hs | haskell | module Pangraph.Pajek.Ast where
|
Module : Pangraph . Pajek . Ast
Description : Abstract syntax tree for pajek ( .net ) files
Module : Pangraph.Pajek.Ast
Description : Abstract syntax tree for pajek (.net) files
-}
data Pajek a = Graph (Maybe a) [Vertex a] [Edge] deriving (Show, Eq, Or... | |
2c7c89c6d6402c6a44a81e964e417de16abd854cb4dd23e2db9c0e697a878c70 | stevenrobertson/cuburn-hs | Variations.hs | module Variations where
data Variation = Linear
| Spherical
| Handkerchief
| Ex
| Julia
| Eyefish
deriving (Eq, Ord, Show)
| null | https://raw.githubusercontent.com/stevenrobertson/cuburn-hs/dc7bae03a3137c37cd87b053fbe6c62667cdfb84/src/Variations.hs | haskell | module Variations where
data Variation = Linear
| Spherical
| Handkerchief
| Ex
| Julia
| Eyefish
deriving (Eq, Ord, Show)
| |
0073be1fb320104966fb3a335a6711bb1466db773142d16e262bee8834331f23 | expipiplus1/vulkan | XR_EXT_hp_mixed_reality_controller.hs | {-# language CPP #-}
-- | = Name
--
XR_EXT_hp_mixed_reality_controller - instance extension
--
-- = Specification
--
-- See
< #XR_EXT_hp_mixed_reality_controller XR_EXT_hp_mixed_reality_controller >
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
96
--
-- = Revision... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/openxr/src/OpenXR/Extensions/XR_EXT_hp_mixed_reality_controller.hs | haskell | # language CPP #
| = Name
= Specification
See
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
= See Also
No cross-references are available
= Document Notes
For more information, see the
This page is a generated d... | XR_EXT_hp_mixed_reality_controller - instance extension
< #XR_EXT_hp_mixed_reality_controller XR_EXT_hp_mixed_reality_controller >
96
1
- Requires OpenXR 1.0
< #XR_EXT_hp_mixed_reality_controller OpenXR Specification >
module OpenXR.Extensions.XR_EXT_hp_mixed_reality_controller ( EXT_hp_mixed_reality_... |
c20fcff3a6c4cb3a5ead1da28e7c385c523e03deecbb75c57624f9bc4b69a956 | emhoracek/smooch | Shell.hs | {-# LANGUAGE OverloadedStrings #-}
module Shell where
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except
import Data.Char (toLower)
import qualified Data.Text as T
import System.Directory (listDirectory, rena... | null | https://raw.githubusercontent.com/emhoracek/smooch/469ed9034b6ee2afbaa4c5a62c63be5ce73486d8/app/src/Shell.hs | haskell | # LANGUAGE OverloadedStrings # |
module Shell where
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Except
import Data.Char (toLower)
import qualified Data.Text as T
import System.Directory (listDirectory, renameFile)
import System.Pro... |
2c56c98f648f1b3c1289282cc7449d77c8c5b60e74bb203d1f5fdaae7207c40b | soegaard/bracket | qags.rkt | #lang typed/racket
(require "tagged-begin.rkt"
racket/flonum)
Search for TODO
;;;
;;; FORTRAN RUNTIME
;;;
(define epsilon
(let ()
(define (compute-machine-epsilon)
(let loop ([n 1.0])
(define new-n (fl/ n 2.0))
(cond
[(fl= 1.0 (fl+ 1.0 (fl/ new-n 2.0)))
new... | null | https://raw.githubusercontent.com/soegaard/bracket/3d0ace16cf0dbcee4952fd729796e4362e27faa0/numeric/qags.rkt | racket |
FORTRAN RUNTIME
QAGS estimates the integral of a function.
Discussion:
The routine calculates an approximation RESULT to a definite integral
I = integral of F over (A,B),
hopefully satisfying
Reference:
Parameters:
Input, external real F, the name of the function routine, of the ... | #lang typed/racket
(require "tagged-begin.rkt"
racket/flonum)
Search for TODO
(define epsilon
(let ()
(define (compute-machine-epsilon)
(let loop ([n 1.0])
(define new-n (fl/ n 2.0))
(cond
[(fl= 1.0 (fl+ 1.0 (fl/ new-n 2.0)))
new-n]
[else
... |
6d4949a5a8f47d723dc56ce079efc60408461f62c357bec38b209b7c654611d3 | joneshf/open-source | Environment.hs | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : . Item . Environment
Description : The environment from which this package is running .
Copyright : ( c ) , 2017
License : BSD3
Maintainer :
Stability : experimental
Module : Rollbar.Item.Environmen... | null | https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/packages/rollbar-hs/src/Rollbar/Item/Environment.hs | haskell | | Should be something meaningful to your program.
E.g. "development", "production", "staging" | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : . Item . Environment
Description : The environment from which this package is running .
Copyright : ( c ) , 2017
License : BSD3
Maintainer :
Stability : experimental
Module : Rollbar.Item.Environmen... |
cdf2e8c5be5653cfad3514893874f0f801e334acb183a340c86731507e4a7b9f | racket/eopl | cps-in-lang.rkt | #lang eopl
input language for the CPS converter .
(provide (all-defined-out))
;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))... | null | https://raw.githubusercontent.com/racket/eopl/43575d6e95dc34ca6e49b305180f696565e16e0f/tests/chapter6/cps-lang/cps-in-lang.rkt | racket | grammatical specification ;;;;;;;;;;;;;;;;
sllgen boilerplate ;;;;;;;;;;;;;;;; | #lang eopl
input language for the CPS converter .
(provide (all-defined-out))
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
symbol)
(number (digit (arbno digit)) number)
... |
4d87485a43b81ccd2f0a869fa768287771213e9b3241f68f79156e7671b440bc | mbal/swank-racket | server.rkt | #lang racket
(require
racket/tcp
"control.rkt"
"util.rkt")
(define listener (tcp-listen 4005 5 #t))
(displayln "Running racket-swank on port 4005")
(define (start-server)
(displayln "Waiting for the client to connect")
(define-values (i o) (tcp-accept listener))
(displayln "Client connection accepted!")... | null | https://raw.githubusercontent.com/mbal/swank-racket/8a2efd2737700a795f301ec8ab47e11734336076/server.rkt | racket | the main thread reads from the connection and puts data in the
control thread's mailbox. | #lang racket
(require
racket/tcp
"control.rkt"
"util.rkt")
(define listener (tcp-listen 4005 5 #t))
(displayln "Running racket-swank on port 4005")
(define (start-server)
(displayln "Waiting for the client to connect")
(define-values (i o) (tcp-accept listener))
(displayln "Client connection accepted!")... |
28ad550188fa13ac0c13f51ed3950d70dac6526f264e7f6d66044e3008be82e4 | ssor/erlangDemos | get_cmd_handler.erl | %% Feel free to use, reuse and abuse the code in this file.
%% @doc GET echo handler.
-module(get_cmd_handler).
-export([init/3]).
-export([handle/2]).
-export([terminate/2]).
% -include("http.hrl").
init(_Transport, Req, []) ->
{ok, Req, state}.
handle(Req, State) ->
io:format("get_cmd_handler handle post 1 -> ~... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/command_transfer/src/get_cmd_handler.erl | erlang | Feel free to use, reuse and abuse the code in this file.
@doc GET echo handler.
-include("http.hrl").
io:format("headers -> ~p~n", [Req#http_req.headers]),
io:format("body_length -> ~p~n", [Length]),
cowboy_http_req:reply(400, [], <<"Missing body.">>, Req);
Method not allowed. |
-module(get_cmd_handler).
-export([init/3]).
-export([handle/2]).
-export([terminate/2]).
init(_Transport, Req, []) ->
{ok, Req, state}.
handle(Req, State) ->
io:format("get_cmd_handler handle post 1 -> ~p~n", [Req]),
io:format("get_cmd_handler handle State 1 -> ~p~n", [State]),
{Method, Req2} = cowboy_http_req... |
316aaf49a6d97cc48ad68d118dad3d43e5f187aa4611403222641c81bd5c778d | emqx/emqx | emqx_authz_client_info.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_authz/src/emqx_authz_client_info.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_authz_client_info).
-include_lib("emqx/include/logger.hrl").
-behaviour(emqx_auth... |
b7f35060e90a75b160514feb0a3e33bb9134f23493899f9b8a3230751c74718e | clj-commons/aleph | websocket_test.clj | (ns aleph.websocket-test
(:require
[aleph.http :as http]
[aleph.http.core :as http-core]
[aleph.http.server :as http-server]
[aleph.netty :as netty]
[clj-commons.byte-streams :as bs]
[clojure.test :refer [deftest is testing]]
[clojure.tools.logging :as log]
[manifold.deferred :as d]
[manifo... | null | https://raw.githubusercontent.com/clj-commons/aleph/81f57e1191366a2e73d89e1878d93f20ce4b71a7/test/aleph/websocket_test.clj | clojure | `-1` means that no code was provided | (ns aleph.websocket-test
(:require
[aleph.http :as http]
[aleph.http.core :as http-core]
[aleph.http.server :as http-server]
[aleph.netty :as netty]
[clj-commons.byte-streams :as bs]
[clojure.test :refer [deftest is testing]]
[clojure.tools.logging :as log]
[manifold.deferred :as d]
[manifo... |
ea4258ece8a4b7f4a63bb130fdd85f7809188892891e1f4b0f07a0ec0bb2e49b | agda/agda | BiMap.hs | # LANGUAGE TemplateHaskell , UndecidableInstances #
module Internal.Utils.BiMap ( tests ) where
import Prelude hiding (null, lookup)
import qualified Prelude
import Data.Foldable (foldrM)
import qualified Data.List as List
import qualified Data.Map as Map
import Data.Maybe
import Data.Ord
import Agda.Utils.BiMap
im... | null | https://raw.githubusercontent.com/agda/agda/c6401a63e84caa495d74f4a5696b4628c306d5dc/test/Internal/Utils/BiMap.hs | haskell | ----------------------------------------------------------------------
* Types used for the tests below
----------------------------------------------------------------------
| A key type.
| A value type.
| An instance of the map type.
----------------------------------------------------------------------
* Genera... | # LANGUAGE TemplateHaskell , UndecidableInstances #
module Internal.Utils.BiMap ( tests ) where
import Prelude hiding (null, lookup)
import qualified Prelude
import Data.Foldable (foldrM)
import qualified Data.List as List
import qualified Data.Map as Map
import Data.Maybe
import Data.Ord
import Agda.Utils.BiMap
im... |
821b5ea1681f6beaba9da51046bb69e308ffa21375dac8411c6f1b0aa807d2cc | amnh/PCG | 3d-comparison.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Main (main) where
import Analysis.Parsimony.Dynamic.DirectOptimization
import Bio.Character.Encodable
import Data.Alphabet
import Data.Alphabet.IUPAC
import qualified Data.Bimap ... | null | https://raw.githubusercontent.com/amnh/PCG/3a1b6bdde273ed4dc09717623986e1144b006904/app/3d-comparison.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Main (main) where
import Analysis.Parsimony.Dynamic.DirectOptimization
import Bio.Character.Encodable
import Data.Alphabet
import Data.Alphabet.IUPAC
import qualified Data.Bimap ... | |
57e8b56247cd8a9e37416f3ad6cbd2d5d6ba3e766e3fa991da4bac07c37f3f07 | TyOverby/bonsai_example | global_state.ml | open! Core
open! Async
open Bonsai_chat_open_source_common
type t =
{ message_bus : (Message.t -> unit) Bus.Read_write.t
; messages : Message.t Queue.t Room.Table.t
}
let create () =
let message_bus =
Bus.create
[%here]
Arity1
~on_subscription_after_first_write:Allow
~on_callback_r... | null | https://raw.githubusercontent.com/TyOverby/bonsai_example/5c45bd1abb80299cd544369c8496673283913654/server/src/global_state.ml | ocaml | open! Core
open! Async
open Bonsai_chat_open_source_common
type t =
{ message_bus : (Message.t -> unit) Bus.Read_write.t
; messages : Message.t Queue.t Room.Table.t
}
let create () =
let message_bus =
Bus.create
[%here]
Arity1
~on_subscription_after_first_write:Allow
~on_callback_r... | |
a10d20592b3d3c6a6ab34910e3f45dd42788aa426d5725cdde7fa133834765fa | solita/mnt-teet | admin_commands.clj | (ns teet.admin.admin-commands
(:require [teet.db-api.core :as db-api :refer [defcommand]]
[teet.meta.meta-model :as meta-model]
[teet.user.user-db :as user-db]
[teet.user.user-model :as user-model]
[teet.user.user-spec :as user-spec]
[datomic.client.api :as ... | null | https://raw.githubusercontent.com/solita/mnt-teet/2dcdad70d4dcf33eef56650f8f6d3fa9f7756cec/app/backend/src/clj/teet/admin/admin_commands.clj | clojure | else
else
New user, no need to check
Maybe check that this is an actual user?
Maybe check that this is an actual user? | (ns teet.admin.admin-commands
(:require [teet.db-api.core :as db-api :refer [defcommand]]
[teet.meta.meta-model :as meta-model]
[teet.user.user-db :as user-db]
[teet.user.user-model :as user-model]
[teet.user.user-spec :as user-spec]
[datomic.client.api :as ... |
8856a1b64563854b03a4499a5394454d568aeabdcaa19ad1720af96d0ffc8210 | SKS-Keyserver/sks-keyserver | build.ml | (***********************************************************************)
(* build.ml - Executable: Builds up the key database from a multi-file *)
(* database dump. *)
(* Dump files are taken from the command-line. *)
(* ... | null | https://raw.githubusercontent.com/SKS-Keyserver/sks-keyserver/a4e5267d817cddbdfee13d07a7fb38a9b94b3eee/build.ml | ocaml | *********************************************************************
build.ml - Executable: Builds up the key database from a multi-file
database dump.
Dump files are taken from the command-line.
... | Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2011 , 2012 , 2013 and Contributors
This file is part of SKS . SKS is free software ; you can
Public License as published by the Free Software Foundation ; either
version 2 of the License , or... |
aa88c156dee0973b2aa6e4e80c73cc9ca52a08c6c2982d39940fe52af5e21761 | ocsigen/ocsigen-start | os_db.ppx.ml | Ocsigen - start
* -start
*
* Copyright ( C ) Université Paris Diderot , CNRS , INRIA , Be Sport .
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking e... | null | https://raw.githubusercontent.com/ocsigen/ocsigen-start/86b8ddf8c86cf688d87675b552a9e961887ee3cb/src/os_db.ppx.ml | ocaml | ***************************************************************************
We fail for non-validated e-mails,
because we don't want the user to log in with a non-validated
email address. For example if the sign-up form contains
a password field. | Ocsigen - start
* -start
*
* Copyright ( C ) Université Paris Diderot , CNRS , INRIA , Be Sport .
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking e... |
9826f9f76fdbdf6d6284a292f7c6345ef8f8643bb1316dd0c64ecc8ead6910de | dizengrong/erlang_game | client_socket.erl | @author dzR < >
%% @doc 处理与客户端的连接,接收数据并将消息路由出去
-module (client_socket).
-include("log.hrl").
-include("proto_login_pb.hrl").
-include("proto_map_pb.hrl").
-include ("gateway.hrl").
-include ("db_table_role.hrl").
-export([start_link/4, send_to_client/2, change_map/3]).
-behaviour(gen_server).
-export([init/1, han... | null | https://raw.githubusercontent.com/dizengrong/erlang_game/4598f97daa9ca5eecff292ac401dd8f903eea867/gerl/src/gateway/client_socket.erl | erlang | @doc 处理与客户端的连接,接收数据并将消息路由出去
| |
|没有角色 |
|----------> STATUS_REGISTER
注意状态数字从小到大表示了状态的递进
等待登陆
等待注册
等待进入开始游戏
等待第一次进入地图
已进入开始游戏了
表示ok的返回码
登陆验证账号没有注册
the ranch socket transport
玩家id
账号
玩家状态
所在地图进程信息:{注册名::MapRegName, 节点::MapNode}
ranch的回调方法
?INFO("Ref: ~p", [Ref]),
true = inet_db:... | @author dzR < >
-module (client_socket).
-include("log.hrl").
-include("proto_login_pb.hrl").
-include("proto_map_pb.hrl").
-include ("gateway.hrl").
-include ("db_table_role.hrl").
-export([start_link/4, send_to_client/2, change_map/3]).
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, hand... |
36ec6d0a7a6cf29a72ccbbf45c82d297fa836631edfabf6d5bdffc362cb428df | adomokos/haskell-katas | Ex52_MonadsBirdLandingSpec.hs | module Ex52_MonadsBirdLandingSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
type Birds = Int
type Pole = (Birds, Birds)
The rules for bird landing : the person keeps his balance if the
number of birds on the left side and the number of birds on the
right side of the pole i... | null | https://raw.githubusercontent.com/adomokos/haskell-katas/be06d23192e6aca4297814455247fc74814ccbf1/test/Ex52_MonadsBirdLandingSpec.hs | haskell | landLeft1 :: Birds -> Pole -> Pole
landRight1 :: Birds -> Pole -> Pole
Improved logic with checks | module Ex52_MonadsBirdLandingSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
type Birds = Int
type Pole = (Birds, Birds)
The rules for bird landing : the person keeps his balance if the
number of birds on the left side and the number of birds on the
right side of the pole i... |
6dd3425bc4f2ee3ab7c6e644e748d5d77b34985228892707c8f5f953672fcd8e | sordina/Haskell-Techniques | main.hs | import System.IO
import Control.Monad (liftM)
import Natural
f :: Natural Integer -> Integer
f = (* 10) . unNatural
prompt :: String -> IO ()
prompt s = putStr s >> hFlush stdout
main = do
prompt "Enter a Natural number: "
n <- liftM read getLine
putStrLn $ maybe "Supplied value is not Natural." (("Value * 10:... | null | https://raw.githubusercontent.com/sordina/Haskell-Techniques/dbc31eaf7c9730b7f976c79eb5d4ebb8e9fd1555/Construction-Validation/main.hs | haskell | import System.IO
import Control.Monad (liftM)
import Natural
f :: Natural Integer -> Integer
f = (* 10) . unNatural
prompt :: String -> IO ()
prompt s = putStr s >> hFlush stdout
main = do
prompt "Enter a Natural number: "
n <- liftM read getLine
putStrLn $ maybe "Supplied value is not Natural." (("Value * 10:... | |
c2ddced6982815819422512f6fa2590307e9d64392cb175e3b64514883aa56ba | Mathieu-Desrochers/Schemings | define-request.scm | (import-for-syntax srfi-1)
(import-for-syntax srfi-13)
(define-syntax define-request
(er-macro-transformer
(lambda (exp rename compare)
;; returns the scheme type of a field
(define (field-type->scheme-type field-type-info)
(let* ((field-type (list-ref field-type-info 0))
(fie... | null | https://raw.githubusercontent.com/Mathieu-Desrochers/Schemings/3df7c8f8589a1c9c4135a3ae4c1bab3244e6444c/sources/macros/define-request.scm | scheme | returns the scheme type of a field
validates a value field
validates a value list field
validates a subrequest field
validates a subrequest list field
parses a value field from a json node
parses a value list field from a json node
parses a subrequest field from a json node
parses a subrequest list field from ... | (import-for-syntax srfi-1)
(import-for-syntax srfi-13)
(define-syntax define-request
(er-macro-transformer
(lambda (exp rename compare)
(define (field-type->scheme-type field-type-info)
(let* ((field-type (list-ref field-type-info 0))
(field-required (or (eq? field-type 'boolean) (l... |
a0e89b79476b516afde516e444f9dd89ad2116b3c87e0101fc13ddbd7f78e715 | penpot/penpot | import.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.worker.import
(:refer-clojure :exclude [resolve])
(:require
["jszip" :as zip]
[app.common.da... | null | https://raw.githubusercontent.com/penpot/penpot/da517f2d3559c9e03c00fe4397e99ebee90088b8/frontend/src/app/worker/import.cljs | clojure |
Copyright (c) KALEIDOS INC
Upload changes batches size
We use merge to keep some information not stored in back-end
We store this data for post-processing after every shape has been
added
If the node is not an image just return the node
old-node => node with image
TODO: this should be merge-map, but we disable... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.worker.import
(:refer-clojure :exclude [resolve])
(:require
["jszip" :as zip]
[app.common.data :as d]
[app.common.file-bui... |
ed903af0bad42f5cdb11c325719c2f21e7ea5304f15beaf5138623066a6aafbe | DaveWM/nrepl-rebl | project.clj | (defproject nrepl-rebl "0.1.1"
:description "nrepl middleware for REBL"
:url "-rebl"
:license {:name "GPL V3"
:url "-3.0.en.html"}
:dependencies [[org.clojure/clojure "1.10.0-RC4" :scope "provided"]
[com.cognitect/rebl "0.9.108" :scope "provided"]
[nrepl "0.5.2" :sc... | null | https://raw.githubusercontent.com/DaveWM/nrepl-rebl/adf3d4dd5b28cbe11e06e3c226a9b41e4e841703/project.clj | clojure | (defproject nrepl-rebl "0.1.1"
:description "nrepl middleware for REBL"
:url "-rebl"
:license {:name "GPL V3"
:url "-3.0.en.html"}
:dependencies [[org.clojure/clojure "1.10.0-RC4" :scope "provided"]
[com.cognitect/rebl "0.9.108" :scope "provided"]
[nrepl "0.5.2" :sc... | |
64dd76445b1c20df6252762112e87947018f8ebca68fe520221efc203aefca33 | ocharles/zero-to-quake-3 | Device.hs | # language DataKinds #
# language TypeApplications #
module Vulkan.Device ( createDevice, getQueue ) where
-- base
import Control.Monad.IO.Class ( MonadIO, liftIO )
import qualified Foreign
-- managed
import Control.Monad.Managed ( MonadManaged )
-- vulkan-api
import Graphics.Vulkan.Marshal.Create ( (&*) )
import q... | null | https://raw.githubusercontent.com/ocharles/zero-to-quake-3/6fe4ef61955b8a816369cf70c0edd2cacfd911db/src/Vulkan/Device.hs | haskell | base
managed
vulkan-api | # language DataKinds #
# language TypeApplications #
module Vulkan.Device ( createDevice, getQueue ) where
import Control.Monad.IO.Class ( MonadIO, liftIO )
import qualified Foreign
import Control.Monad.Managed ( MonadManaged )
import Graphics.Vulkan.Marshal.Create ( (&*) )
import qualified Graphics.Vulkan as Vulka... |
e6b5d72a6d8f1404f9f926e4efb699df9c6f990fb94fc9974e5cdbc6f4e5b315 | spartango/CS153 | monadic.ml | Defines our Monadic Intermediate Form , conversion of to
* Monadic Form , and various optimizations on Monadic Form .
* Monadic Form, and various optimizations on Monadic Form. *)
module S = Scish_ast
open Monad
open Utility
exception TODO
exception IntAsFunction
exception EXTRA_CREDIT
let dce_enabl... | null | https://raw.githubusercontent.com/spartango/CS153/16faf133889f1b287cb95c1ea1245d76c1d8db49/ps6/monadic.ml | ocaml | Set value of x to the return value of the expression
used to generate fresh variables
naive var->var environments
same as let x = e2 in e1
a flag used to track when an optimization makes a reduction
naive 'a -> 'b option environments
operand propagation -- LetVal(x,Op w,e) --> e[w/x] -- just like notes.
... | Defines our Monadic Intermediate Form , conversion of to
* Monadic Form , and various optimizations on Monadic Form .
* Monadic Form, and various optimizations on Monadic Form. *)
module S = Scish_ast
open Monad
open Utility
exception TODO
exception IntAsFunction
exception EXTRA_CREDIT
let dce_enabl... |
2597a5397f962740eec202e6a1dac4395695230ce512c8d38bf9778138fe427f | lehins/Color | Rec470Spec.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Graphics.Color.Space.RGB.ITU.Rec470Spec (spec) where
import Graphics.Color.Space.Common
import Graphics.Color.Space.RGB.ITU.Rec470
instance (Elevator e, Random e) => Arbitrary (Color (BT470_525 ... | null | https://raw.githubusercontent.com/lehins/Color/8f17d4d17dc9b899af702f54b69d49f3a5752e7b/Color/tests/Graphics/Color/Space/RGB/ITU/Rec470Spec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Graphics.Color.Space.RGB.ITU.Rec470Spec (spec) where
import Graphics.Color.Space.Common
import Graphics.Color.Space.RGB.ITU.Rec470
instance (Elevator e, Random e) => Arbitrary (Color (BT470_525 ... | |
28683532f75b11383587616e569f99f3ef824c8d1bc969b4cad544218f3ff420 | ocaml-ppx/ocaml-migrate-parsetree | migrate_403_402.ml | (**************************************************************************)
(* *)
(* OCaml Migrate Parsetree *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-ppx/ocaml-migrate-parsetree/4a05cf7a00d84e5f827cc9ae9c75e5dc85126085/src/migrate_403_402.ml | ocaml | ************************************************************************
OCaml Migrate Parsetree
... |
, LexiFi
Copyright 2017 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module Def = Migrate_parsetree_def
module Fr... |
2a0ad945b6d280b489e760c9e89fbf46b0da56c5847121e3cd6b1f4b3c8fbb59 | haskell-repa/repa | Rank.hs |
module Internal.Rank
(rankInternal)
where
import Internal.Load
import Internal.Step
import External.Titles
import Page
import System.Directory
import Control.Monad
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as U
-- | Perform some iterations of the Pa... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-examples/examples/PageRank/src/Internal/Rank.hs | haskell | | Perform some iterations of the PageRank algorithm.
This is an internal version of the algorithm that loads the whole links
graph into memory before computing the rank.
^ Number of iterations to run.
^ Path to links file.
^ Path to titles file.
| Construct the initial ranks vector.
| Run several iterations... |
module Internal.Rank
(rankInternal)
where
import Internal.Load
import Internal.Step
import External.Titles
import Page
import System.Directory
import Control.Monad
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as U
rankInternal
-> IO ()
rankIn... |
db0f825000b6e754923fef28161684d94a9df1bf2b14512c04550880e82e9e62 | rd--/hsc3 | n_after.help.hs | Sound.Sc3.Lang.Help.viewServerHelp "/n_after"
| null | https://raw.githubusercontent.com/rd--/hsc3/024d45b6b5166e5cd3f0142fbf65aeb6ef642d46/Help/Server/n_after.help.hs | haskell | Sound.Sc3.Lang.Help.viewServerHelp "/n_after"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.