_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 |
|---|---|---|---|---|---|---|---|---|
a5d190d5cf27178e458e49836883392a95d6790e842233e8898a28ef1f2eb883 | schemeorg-community/index.scheme.org | srfi.16.scm | (((name . "case-lambda")
(signature syntax-rules () ((_ clause ...) procedure?))
(subsigs
(clause (pattern (formals body)))
(formals
(pattern
(variable1 ...)
variable
(variable1 ... variable_n . variable_n+1))))
(desc . "A CASE-LAMBDA expression evaluates to a procedure that accepts a var... | null | https://raw.githubusercontent.com/schemeorg-community/index.scheme.org/32e1afcfe423a158ac8ce014f5c0b8399d12a1ea/types/srfi.16.scm | scheme | (((name . "case-lambda")
(signature syntax-rules () ((_ clause ...) procedure?))
(subsigs
(clause (pattern (formals body)))
(formals
(pattern
(variable1 ...)
variable
(variable1 ... variable_n . variable_n+1))))
(desc . "A CASE-LAMBDA expression evaluates to a procedure that accepts a var... | |
128cfa0f9897f587d567cb7e5367b9d806c5f503bdb8a284664219063a411f90 | ranjitjhala/sprite-lang | Constraints.hs | -- | This module has the kit needed to do constraint generation:
namely , @Env@ironments , @SrcCstr@ manipulation , and @subst@itution .
{-# LANGUAGE OverloadedStrings #-}
module Language.Sprite.L3.Constraints
( -- * Constraints
cTrue, cAnd, cHead, cAll
-- * Substitutions
, subst, substImm
... | null | https://raw.githubusercontent.com/ranjitjhala/sprite-lang/bebfa8a8de6d558853145cbed8c511daa9bda3c7/src/Language/Sprite/L3/Constraints.hs | haskell | | This module has the kit needed to do constraint generation:
# LANGUAGE OverloadedStrings #
* Constraints
* Substitutions
* Conversions
* Environments
* Constraint Generation Monad
------------------------------------------------------------------------------
| Constraints ----------------------------------... | namely , @Env@ironments , @SrcCstr@ manipulation , and @subst@itution .
module Language.Sprite.L3.Constraints
cTrue, cAnd, cHead, cAll
, subst, substImm
, predRType, baseSort
, Env, empEnv, getEnv, extEnv, grdSym, envSorts
, CG, run, failWith, freshK
) where
import qualified Data.Maybe ... |
ac2fd5003724e64ebb4e6bafbad35145d3149997d7b8aa4262bf953bde822409 | synduce/Synduce | contains.ml |
let xi_0 v6 a = v6 = a ? 1 : 0
let xi_1 b7 c7 x7 = x7
let xi_2 y7 z7 w7 = y7 = z7 ? 1 : w7
let rec g =
function Leaf(a) -> xi_0 x a
| Node(a, l, r) -> x < a ? xi_1 x a (g l) : xi_2 x a (g r)
| null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/test/output_sample/contains.ml | ocaml |
let xi_0 v6 a = v6 = a ? 1 : 0
let xi_1 b7 c7 x7 = x7
let xi_2 y7 z7 w7 = y7 = z7 ? 1 : w7
let rec g =
function Leaf(a) -> xi_0 x a
| Node(a, l, r) -> x < a ? xi_1 x a (g l) : xi_2 x a (g r)
| |
53be62c57727fec5eefee695407b1cd4d3df3e4a15b1f6c1af6cb6c1783ff7ab | vbedegi/re-alm | core.cljs | (ns datastore.core
(:require-macros [cljs.core.match :refer [match]])
(:require [cljs.core.match :as m]
[re-alm.core :as ra]
[re-alm.io.datastore :as ds]))
(def names ["Bob" "Alice" "Foo" "Bar"])
(def messages ["hello" "hi" "yo"])
(defn make-indexed [coll]
(map-indexed (fn [idx item] [i... | null | https://raw.githubusercontent.com/vbedegi/re-alm/73fdb86b2cb92bec16865be44b101361e7e84115/examples/datastore/src/datastore/core.cljs | clojure | ----------------------------------------------
----------------------------------------------
---------------------------------------------- | (ns datastore.core
(:require-macros [cljs.core.match :refer [match]])
(:require [cljs.core.match :as m]
[re-alm.core :as ra]
[re-alm.io.datastore :as ds]))
(def names ["Bob" "Alice" "Foo" "Bar"])
(def messages ["hello" "hi" "yo"])
(defn make-indexed [coll]
(map-indexed (fn [idx item] [i... |
2f9abb17ece42f65c120ae8797cebbf334f8f4164b88477bf7c27e25cc3377d1 | scalaris-team/scalaris | gossip_vivaldi_SUITE.erl | 2010 - 2015 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
di... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/test/gossip_vivaldi_SUITE.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2010 - 2015 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(gossip_vivaldi_SUITE).
-author('').
-vsn('$Id$').
-compile(export_all).
-include("scalaris.hrl").
-include... |
9ad3d6fc054b8109feb40bdbd1e75582b69ab5b580dcea3ea7b4bfaa4b511cf3 | graninas/Andromeda | UI.hs | module Andromeda.Types.UI ( module X ) where
import Andromeda.Types.UI.GraphTransition as X
| null | https://raw.githubusercontent.com/graninas/Andromeda/6b56052bca64fc6f55a28f8001dd775a744b95bf/src/Andromeda/Types/UI.hs | haskell | module Andromeda.Types.UI ( module X ) where
import Andromeda.Types.UI.GraphTransition as X
| |
9ad6c56c864d51298ed9ca5ec02e7953a070b081dda5c4fe4267b1c45aba1c49 | chrisa/acts_as_encrypted | encserver_deps.erl | @author author < >
YYYY author .
%% @doc Ensure that the relatively-installed dependencies are on the code
%% loading path, and locate resources relative
%% to this application's path.
-module(encserver_deps).
-author('author <>').
-export([ensure/0, ensure/1]).
-export([get_base_dir/0, get_base_dir/... | null | https://raw.githubusercontent.com/chrisa/acts_as_encrypted/587558a31876dfbbc47d7ab2070782fd3d9395d7/server/src/encserver_deps.erl | erlang | @doc Ensure that the relatively-installed dependencies are on the code
loading path, and locate resources relative
to this application's path.
@doc List of project dependencies on the path.
@doc Find new siblings paths relative to Module that aren't already on the
code path.
@doc Ensure that all e... | @author author < >
YYYY author .
-module(encserver_deps).
-author('author <>').
-export([ensure/0, ensure/1]).
-export([get_base_dir/0, get_base_dir/1]).
-export([local_path/1, local_path/2]).
-export([deps_on_path/0, new_siblings/1]).
( ) - > [ ProjNameAndVers ]
deps_on_path() ->
F = fun (X, Acc) ->
... |
4e9883038770df58b3bbf0dffdfdeda96edc2e932e2b14aacd657c20f4681860 | bbc/haskell-workshop | C3TypesAndTypeclasses.hs | module C3TypesAndTypeclasses where
-- last, length, and take are all from the standard library, Prelude
You can find out the type in ghci with " : t last " , but attempt to answer first
-- What is the type of last?
-- last :: [a] -> a
-- What is the type of length?
-- length :: Foldable t => t a -> Int
-- What is... | null | https://raw.githubusercontent.com/bbc/haskell-workshop/475b9bac04167665030d7863798ccd27dfd589d0/ptaylour/exercises/src/C3TypesAndTypeclasses.hs | haskell | last, length, and take are all from the standard library, Prelude
What is the type of last?
last :: [a] -> a
What is the type of length?
length :: Foldable t => t a -> Int
What is the type of take?
take :: Int -> [a] -> [a]
myConcat :: [a] -> [a] -> [a]
Can you use type classes to constrain the polymorphic typ... | module C3TypesAndTypeclasses where
You can find out the type in ghci with " : t last " , but attempt to answer first
WHat is the type of myConcat ?
myConcat a b = a ++ b
mul : : a = > a - > a - > a
mul a b = a * b
hasShowableInside :: Show a => [a] -> Bool
hasShowableInside xs = null xs
hasNumbersIns... |
119c04976e7ed47f05f7509361840ef78d4fadcefebb9c9a006239c8195c4ec8 | haskus/packages | Number.hs | -- | Numbers
module Haskus.Number
( module X
)
where
import Haskus.Number.BitNat as X
import Haskus.Number.NaturalRange as X
| null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-binary/src/lib/Haskus/Number.hs | haskell | | Numbers | module Haskus.Number
( module X
)
where
import Haskus.Number.BitNat as X
import Haskus.Number.NaturalRange as X
|
5832cef834fc9cff9227041ac2edecb6a8b9b9ffc9f82fbf6429f57b9573d269 | vyzo/gerbil | optimize__0.scm | (declare (block) (standard-bindings) (extended-bindings))
(begin
(define gxc#optimizer-info-init!
(lambda ()
(if (gxc#current-compile-optimizer-info)
'#!void
(gxc#current-compile-optimizer-info
(let ((__obj49414 (make-object gxc#optimizer-info::t '2)))
(gxc#optimi... | null | https://raw.githubusercontent.com/vyzo/gerbil/17fbcb95a8302c0de3f88380be1a3eb6fe891b95/src/bootstrap/gerbil/compiler/optimize__0.scm | scheme | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... | (declare (block) (standard-bindings) (extended-bindings))
(begin
(define gxc#optimizer-info-init!
(lambda ()
(if (gxc#current-compile-optimizer-info)
'#!void
(gxc#current-compile-optimizer-info
(let ((__obj49414 (make-object gxc#optimizer-info::t '2)))
(gxc#optimi... |
aca610ae368b4f86f470e3c86d6db068619766662ad9df40f1f053d0e69b521a | discus-lang/ddc | Kernel.hs |
module DDC.Core.Flow.Transform.Schedule.Kernel
( scheduleKernel
, Error (..)
, Lifting (..))
where
import DDC.Core.Flow.Transform.Schedule.Nest
import DDC.Core.Flow.Transform.Schedule.Error
import DDC.Core.Flow.Transform.Schedule.Lifting
import DDC.Core.Flow.Transform.Schedule.Bas... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core-flow/DDC/Core/Flow/Transform/Schedule/Kernel.hs | haskell | | Schedule a process kernel into a procedure.
A process kernel is a process with the following restricitions:
- The process kernel scheduler can produce code for
map, reduce, fill, gather, scatter
But not
fold -- use reduce instead.
create -- use fill instead.
pack -- we don't support... |
module DDC.Core.Flow.Transform.Schedule.Kernel
( scheduleKernel
, Error (..)
, Lifting (..))
where
import DDC.Core.Flow.Transform.Schedule.Nest
import DDC.Core.Flow.Transform.Schedule.Error
import DDC.Core.Flow.Transform.Schedule.Lifting
import DDC.Core.Flow.Transform.Schedule.Bas... |
0dda36c8bada121b277f2b48c5e3f8e23b6dd430970d806abe9ee3adbb2bedff | miniKanren/simple-miniKanren | mkdefs.scm | (load "mk.scm")
(define-syntax run1 (syntax-rules () ((_ (x) g0 g ...) (run 1 (x) g0 g ...))))
(define-syntax run2 (syntax-rules () ((_ (x) g0 g ...) (run 2 (x) g0 g ...))))
(define-syntax run3 (syntax-rules () ((_ (x) g0 g ...) (run 3 (x) g0 g ...))))
(define-syntax run4 (syntax-rules () ((_ (x) g0 g ...) (run 4 (x) ... | null | https://raw.githubusercontent.com/miniKanren/simple-miniKanren/c0a41cffc2d164b113427c927ebd272c992ffd4c/mkdefs.scm | scheme | (load "mk.scm")
(define-syntax run1 (syntax-rules () ((_ (x) g0 g ...) (run 1 (x) g0 g ...))))
(define-syntax run2 (syntax-rules () ((_ (x) g0 g ...) (run 2 (x) g0 g ...))))
(define-syntax run3 (syntax-rules () ((_ (x) g0 g ...) (run 3 (x) g0 g ...))))
(define-syntax run4 (syntax-rules () ((_ (x) g0 g ...) (run 4 (x) ... | |
545112a6504fc4596c9ad54024127b1371820059980fb0d63fc76b06a008b4f3 | MarcKaufmann/congame | abstract-pjb-pilot.rkt | #lang racket/base
(define abstract-pjb-pilot-study
(make-abstract-study
"pjb-pilot-study"
#:requires '()
#:provides '(rest-treatment completion-code)
#:failure-handler (lambda (s reason)
(put 'fail-status reason)
(eprintf "failed at ~e with reason ~e~n" s rea... | null | https://raw.githubusercontent.com/MarcKaufmann/congame/edd20c52027fb2d323d225fe32fab461ca62e880/trying-stuff-out/abstract-pjb-pilot.rkt | racket | abstract-study ; takes parameters practice-tasks, tutorial-fee, and price-lists
starts and runs the-study
Abstract/Model: information/parameters needed for running abstract study (simulation for data only)
Human: display information regarding payments
Bot: stuff needed for running the implementation: `continue`
H... | #lang racket/base
(define abstract-pjb-pilot-study
(make-abstract-study
"pjb-pilot-study"
#:requires '()
#:provides '(rest-treatment completion-code)
#:failure-handler (lambda (s reason)
(put 'fail-status reason)
(eprintf "failed at ~e with reason ~e~n" s rea... |
709c7e543d4e1a8cb00b0a28e8c9e9b9717f0759ed0008ab8ce2e0e8d94c158d | bpoweski/athena-tools | lambda_test.clj | (ns athena.lambda-test
(:require [athena.lambda :refer :all]
[clojure.test :refer :all]
[clojure.java.io :as io]))
(deftest env-test
(is (= {:orc-schema "struct<x:decimal(12,2)>"} (env {"ORC_SCHEMA" "struct<x:decimal(12,2)>"})))
(is (= {:orc-schema "struct<x:decimal(12,2)>"} (env {"ORC_S... | null | https://raw.githubusercontent.com/bpoweski/athena-tools/9b54e4a49815d97b94b1031ca37097822f6b8460/test/athena/lambda_test.clj | clojure | (ns athena.lambda-test
(:require [athena.lambda :refer :all]
[clojure.test :refer :all]
[clojure.java.io :as io]))
(deftest env-test
(is (= {:orc-schema "struct<x:decimal(12,2)>"} (env {"ORC_SCHEMA" "struct<x:decimal(12,2)>"})))
(is (= {:orc-schema "struct<x:decimal(12,2)>"} (env {"ORC_S... | |
2c5b9796ed9d62c3d00908929dbfc66a7ee8b2813facf9378eeaaddb97729711 | GaloisInc/http-server | Utils.hs | --------------------------------------------------------------------------------
-- |
-- Module : Network.HTTP.Server.Utils
Copyright : ( c ) Galois , Inc. 2007 , 2008
-- License : BSD3
--
-- Maintainer :
-- Stability : provisional
-- Portability :
--
module Network.HTTP.Server.Utils where
import Ne... | null | https://raw.githubusercontent.com/GaloisInc/http-server/cab63f4d3578db8dd1dce5b6ac5464e9bfa70a3d/Network/HTTP/Server/Utils.hs | haskell | ------------------------------------------------------------------------------
|
Module : Network.HTTP.Server.Utils
License : BSD3
Maintainer :
Stability : provisional
Portability :
XXX: Are the words in the correct order?
according to documentation
of Network.accept, "When
be set to the path o... | Copyright : ( c ) Galois , Inc. 2007 , 2008
module Network.HTTP.Server.Utils where
import Network.Socket
import Data.Word
import Data.Bits
#ifdef _OS_UNIX
import Numeric
#endif
byte :: (Bits a, Integral a) => a -> Int -> Word8
byte w n = fromIntegral (w `shiftR` (n * 8))
word :: (Bits a, Integral a) => a -> In... |
89eaa04290b99d9bb593979e3470589db583fa92de846e38b596ea7ccffa09f0 | wiredsister/OpenTransplant | main.ml |
let () = Printf.printf "Hello, World" | null | https://raw.githubusercontent.com/wiredsister/OpenTransplant/d7b37038361c3c350363041448478fc8327aeda8/opentransplant/OpenTransplant/bin/main.ml | ocaml |
let () = Printf.printf "Hello, World" | |
97881f9922d7cf5c85793d12607c72df3036acf1ee2c98858597117366d7a2f0 | kupl/FixML | sub3.ml | let rec sigma : (int -> int) -> int -> int -> int
=fun f a b ->
if a > b then 1
else (f a ) * sigma f(a+1) b;;
| null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/sigma/sigma1/submissions/sub3.ml | ocaml | let rec sigma : (int -> int) -> int -> int -> int
=fun f a b ->
if a > b then 1
else (f a ) * sigma f(a+1) b;;
| |
f4f28ab27bae399ffe07c86ff6e386b6f47b46b9ca1cb4ae78845cc48b30884e | whily/yalo | abi.lisp | ;;;; -*- Mode: Lisp -*-
;;;; Author:
< >
;;;; Description:
x86 - 64 calling convention based on System V AMD64 ABI .
;;;;
;;;; Summary in
;;;; #System_V_AMD64_ABI
Basically , the first 6 integer or pointer arguments are
passed in RDI , RSI , RDX , RCX , R8 , and R9 , and rest are push... | null | https://raw.githubusercontent.com/whily/yalo/be0ed108e7b4393ddcf506517b3bd3ddff4d20ce/cc/abi.lisp | lisp | -*- Mode: Lisp -*-
Author:
Description:
Summary in
#System_V_AMD64_ABI
restore their original values before returning control to the
caller. All other registers must be saved by the caller if it
wishes to preserve their values.
References:
[1] -tools/x86-psABI/wiki/x86-64-psABI-1.0.p... | < >
x86 - 64 calling convention based on System V AMD64 ABI .
Basically , the first 6 integer or pointer arguments are
passed in RDI , RSI , RDX , RCX , R8 , and R9 , and rest are pushed
on stack . Return values are stored in RAX , and RDX if needed .
If callees wants to use RBX ,... |
922521ffbd532fbe718f363fc168a5591080fe177fae5e9d1e85b54874e791eb | benoitc/cbt | cbt_btree_copy_tests.erl | -module(cbt_btree_copy_tests).
-include_lib("include/cbt.hrl").
-include("cbt_tests.hrl").
setup_copy(_) ->
ReduceFun = fun(reduce, KVs) ->
length(KVs);
(rereduce, Reds) ->
lists:sum(Reds)
end,
OriginalFileName = ?tempfile(),
CopyFileName = OriginalFileName ++ ".copy"... | null | https://raw.githubusercontent.com/benoitc/cbt/49b99e56f406f918739adde152e8a4908e755521/test/cbt_btree_copy_tests.erl | erlang | check copy
check copy | -module(cbt_btree_copy_tests).
-include_lib("include/cbt.hrl").
-include("cbt_tests.hrl").
setup_copy(_) ->
ReduceFun = fun(reduce, KVs) ->
length(KVs);
(rereduce, Reds) ->
lists:sum(Reds)
end,
OriginalFileName = ?tempfile(),
CopyFileName = OriginalFileName ++ ".copy"... |
8879b727fc9b47167e9043e10b549fab77822c6b2c1bd69274cf34c4fe704f48 | RolfRolles/PandemicML | IDAGUI.ml | type 'a chooser =
{ columns: (int * string) array;
describe: ('a -> string list);
elements: 'a array;
del: ('a chooser -> int -> int32) option;
ins: ('a chooser -> unit) option;
edit: ('a chooser -> int -> unit) option;
enter: ('a chooser -> int -> unit) option;
destroy: ('a chooser -> u... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/IDA/IDAGUI.ml | ocaml | ' | type 'a chooser =
{ columns: (int * string) array;
describe: ('a -> string list);
elements: 'a array;
del: ('a chooser -> int -> int32) option;
ins: ('a chooser -> unit) option;
edit: ('a chooser -> int -> unit) option;
enter: ('a chooser -> int -> unit) option;
destroy: ('a chooser -> u... |
df147b3445e3ba15bfc88d79d314351770fd51e35d05f9229bbe71d6f4093fea | matterhorn-chat/mattermost-api | GetChannels.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - name - shadowing #
-- Note: See LocalConfig.hs to configure example for your server
module Main (main) where
import Text.Show.Pretty ( pPrint )
import qualified Data.HashMap.Strict as HM
import qualified Data.Text as T
import Network.Con... | null | https://raw.githubusercontent.com/matterhorn-chat/mattermost-api/cd337d5129930e82401e4eaed1c7fa03eb2bc62c/examples/GetChannels.hs | haskell | # LANGUAGE OverloadedStrings #
Note: See LocalConfig.hs to configure example for your server
You will need to define a function:
getConfig :: IO Config | # OPTIONS_GHC -fno - warn - name - shadowing #
module Main (main) where
import Text.Show.Pretty ( pPrint )
import qualified Data.HashMap.Strict as HM
import qualified Data.Text as T
import Network.Connection
import Data.Foldable
import Control.Monad ( when, join )
import ... |
506aaf4faf7bdcdf8f696e3b5d2f143d95c0576817d531b59e3b2d39307d9e3f | pouriya/cfg | cfg_filter_test.erl | -module(cfg_filter_test).
-behaviour(cfg_filter).
-export([config_filters/0]).
config_filters() ->
[{key, atom, default_value}].
| null | https://raw.githubusercontent.com/pouriya/cfg/b03eb73549e2fa11b88f91db73f700d7e6ef4617/test/cfg_filter_test.erl | erlang | -module(cfg_filter_test).
-behaviour(cfg_filter).
-export([config_filters/0]).
config_filters() ->
[{key, atom, default_value}].
| |
f6ec5046d5e2d53388c03fa08e12d91a9c47e70a1eca162a8c31ff0d38886792 | reflex-frp/reflex-examples | Chess.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecursiveDo #
# LANGUAGE TemplateHaskell #
# LANGUAGE LambdaCase #
# LANGUAGE TypeApplications #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DataKi... | null | https://raw.githubusercontent.com/reflex-frp/reflex-examples/3095b12bbfc9745669b64c572f9e9d69f98b1b71/common/src/Common/Examples/Chess.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE RankNTypes #
# LANGUAGE DataKinds #
or frontend code. The purpose of this repo is to demonstrate
as an exemplary implementation of chess, just an example of
Among other things, it does not enforce all the rules of castlin... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecursiveDo #
# LANGUAGE TemplateHaskell #
# LANGUAGE LambdaCase #
# LANGUAGE TypeApplications #
| This implements the game rules of chess , without any Reflex
Reflex , not to demonstrate chess , so this is not intended
... |
05d2d42d77d5a2eecfce0508f9ce1f21950af849b950bf2536a9f793f58b1dc5 | dpom/nlp-tools | spec.clj | (ns nlptools.spec
(:require
[clojure.spec.alpha :as s]
[nlpcore.spec :as nsp]))
(s/def :nlptools/tokenizer map?)
| null | https://raw.githubusercontent.com/dpom/nlp-tools/f513442e0ff993bba9daf1f5aff9582c61367324/src/nlptools/spec.clj | clojure | (ns nlptools.spec
(:require
[clojure.spec.alpha :as s]
[nlpcore.spec :as nsp]))
(s/def :nlptools/tokenizer map?)
| |
5aba19f068b8c63ff80e8ff311a5a230f6797feaaf2e50e13256db815ec480fc | PacktPublishing/Haskell-High-Performance-Programming | io-streams.hs | -- file: io-streams.hs
import Data.IORef (newIORef, readIORef, writeIORef)
import Control.Monad.IO.Class (liftIO)
import System.IO.Streams (Generator, InputStream, OutputStream)
import qualified System.IO.Streams as S
import System.Random (randomIO)
randomInputStreamRef :: Int ... | null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter06/io-streams.hs | haskell | file: io-streams.hs |
import Data.IORef (newIORef, readIORef, writeIORef)
import Control.Monad.IO.Class (liftIO)
import System.IO.Streams (Generator, InputStream, OutputStream)
import qualified System.IO.Streams as S
import System.Random (randomIO)
randomInputStreamRef :: Int -> IO (InputStream Doub... |
2e4a65aee97591fdaf68307be174c7d2fe3d3175c2dd170090f299b9fe7dd7f3 | softwarelanguageslab/maf | R5RS_gambit_sumloop-2.scm | ; Changes:
* removed : 1
* added : 0
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((sum 0)
(tail-rec-aux (lambda (i n)
(if (< i n)
(begin
(set! sum (+ sum 1))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_gambit_sumloop-2.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 1
* added : 0
* swaps : 0
* calls to i d fun : 1
(letrec ((sum 0)
(tail-rec-aux (lambda (i n)
(if (< i n)
(begin
(set! sum (+ sum 1))
(tail-rec-aux (+ i 1) n))
... |
f9e9dc05745fabee2febaa8cc752352f16c52e72285af2c636c9a0d716bd95d5 | haskell-beam/beam | chinookdmlsqlite.hs | # LANGUAGE MultiParamTypeClasses #
-- ! BUILD_COMMAND: runhaskell --ghc-arg=-fglasgow-exts -XTypeFamilies -XOverloadedStrings -XPartialTypeSignatures -XTypeApplications -fno-warn-partial-type-signatures
-- ! BUILD_DIR: beam-sqlite/examples/
module Main where
import Prelude hiding (lookup)
import Database.Beam
import... | null | https://raw.githubusercontent.com/haskell-beam/beam/3dc9f47b081384c99b45f3b4264f419ebc6d7b09/docs/beam-templates/chinookdmlsqlite.hs | haskell | ! BUILD_COMMAND: runhaskell --ghc-arg=-fglasgow-exts -XTypeFamilies -XOverloadedStrings -XPartialTypeSignatures -XTypeApplications -fno-warn-partial-type-signatures
! BUILD_DIR: beam-sqlite/examples/ | # LANGUAGE MultiParamTypeClasses #
module Main where
import Prelude hiding (lookup)
import Database.Beam
import Database.Beam.Backend.Types
import Database.Beam.Sqlite
import Database.SQLite.Simple
import Control.Monad
import Control.Exception
import Data.IORef
import Data.Int
import Chinook.Schema
data BeamDone... |
949487436666529564a3a491324d473f5cae2c9c4bd0cfc1ef234e91b8557a7c | Abhiroop/okasaki | Queue.hs | module Queue where
import Prelude hiding (head)
data Queue a = Queue [a] [a] deriving Show
empty :: Queue a
empty = Queue [] []
isEmpty :: Queue a -> Bool
isEmpty (Queue [] []) = True
isEmpty _ = False
(>>|) :: a -> Queue a -> Queue a
(>>|) x (Queue front rear) = Queue front (x:rear)
head :: Queue a -> Maybe a
he... | null | https://raw.githubusercontent.com/Abhiroop/okasaki/b4e8b6261cf9c44b7b273116be3da6efde76232d/src/Queue.hs | haskell | module Queue where
import Prelude hiding (head)
data Queue a = Queue [a] [a] deriving Show
empty :: Queue a
empty = Queue [] []
isEmpty :: Queue a -> Bool
isEmpty (Queue [] []) = True
isEmpty _ = False
(>>|) :: a -> Queue a -> Queue a
(>>|) x (Queue front rear) = Queue front (x:rear)
head :: Queue a -> Maybe a
he... | |
35cbbd7d42bb0f3764d3a801a903ea368f8cd251abfa32748a03a37d84a911fa | candera/khordr | khordr.clj | (ns khordr
(:refer-clojure :exclude [key send])
(:require [khordr.platform.common :as com]
[khordr.logging :as log]
[khordr.filter :as f]
[khordr.handler :as h]
[khordr.effect :as e]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Behaviors
;;
;; A behavior is a m... | null | https://raw.githubusercontent.com/candera/khordr/cd9ad9df3dc6692b583b844244260b5b619745f7/src/clj/khordr.clj | clojure |
Behaviors
A behavior is a map with keys `:match` and `:handler`. The :match
dictates how the handler is selected. If it is a map, it can have
the keys `:key` and/or `:direction` which must match the keyevent
map that is passed in. If the value for :key or :direction is a
set, any value from the set matches.
... | (ns khordr
(:refer-clojure :exclude [key send])
(:require [khordr.platform.common :as com]
[khordr.logging :as log]
[khordr.filter :as f]
[khordr.handler :as h]
[khordr.effect :as e]))
Clojure record or a package - qualified Java class ( support for Java
(defn map... |
f63f4e8e5e08522b543fde9930842e2fbf7d4ad0ea2720e7dc876fd03e202a07 | Mzk-Levi/texts | Show.hs | {-# LANGUAGE TemplateHaskell, FlexibleInstances, IncoherentInstances,
ScopedTypeVariables, UndecidableInstances #-}
--------------------------------------------------------------------------------
-- |
Module : Data . Comp . . Derive . Show
Copyright : ( c ) 2011 ,
-- License : BSD3
Maint... | null | https://raw.githubusercontent.com/Mzk-Levi/texts/34916d6531af9bc39e50b596247ac2017d8cfdc3/compdata-param-master/src/Data/Comp/Param/Derive/Show.hs | haskell | # LANGUAGE TemplateHaskell, FlexibleInstances, IncoherentInstances,
ScopedTypeVariables, UndecidableInstances #
------------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Automatically derive instances of @ShowD@.
----------------------------... | Module : Data . Comp . . Derive . Show
Copyright : ( c ) 2011 ,
Maintainer : < >
Portability : non - portable ( GHC Extensions )
module Data.Comp.Param.Derive.Show
(
ShowD(..),
makeShowD
) where
import Data.Comp.Derive.Utils
import Data.Comp.Param.FreshM hiding (Nam... |
42061fcff00fb15806b627484790e076fe64a825c2d8ee291ef1d0f51a19c1cd | dchelimsky/sicp-exercises | ex-2.28.scm | #lang scheme
(require rackunit)
(provide fringe)
; Write a procedure fringe that takes as argument a tree (represented as a list) and returns a list whose elements are all the leaves of the tree arranged in left-to-right order. For example,
(define x (list (list 1 2) (list 3 4)))
(define (fringe x)
(cond ((null?... | null | https://raw.githubusercontent.com/dchelimsky/sicp-exercises/55c804e3775b87a490e05f8337fc59bc7ce07f28/chapter-2/ex-2.28.scm | scheme | Write a procedure fringe that takes as argument a tree (represented as a list) and returns a list whose elements are all the leaves of the tree arranged in left-to-right order. For example, | #lang scheme
(require rackunit)
(provide fringe)
(define x (list (list 1 2) (list 3 4)))
(define (fringe x)
(cond ((null? x) null)
(else
(append
(if (pair? (car x)) (fringe (car x)) (list (car x)))
(fringe (cdr x))))))
(check-equal? (fringe x) (list 1 2 3 4))
(check-equal? ... |
d2aaa29567391f6ee70ccc6290e5afcb711b25df2f673cdee3ce85f58f2c09ed | imdea-software/leap | TslkSolver.mli |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/solvers/theory/TslkSolver.mli | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
79d65b961bbe6ba65742d8f459fbb81128ff736c2b3f3121c6ebff1e1eb2f0bb | TrustInSoft/tis-kernel | pdg_parameters.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/pdg/pdg_parameters.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
8100d69b9155368bf0444503668602772194a05340988bf4cac148484274b2df | haskell-repa/repa | FFT.hs | {-# LANGUAGE BangPatterns #-}
| A version of FFT using unboxed vectors .
module FFT
( Mode(..)
, fft2d
, fft)
where
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import Data.Vector (Vector)
import Data.Complex
import Debug.Trace
data Mode
= Forward
| Reverse
| Inverse
deriv... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-examples/examples/FFT/HighPass2d/src-vector/FFT.hs | haskell | # LANGUAGE BangPatterns #
| Compute the 2D fft of a complex matrix.
| Transpose a matrix expressed as a vector of vectors in to
a single flat vector that contains all the elements.
width
height
# INLINE transpose #
| Compute the Discrete Fourier Transform (DFT) of a complex vector.
Compute a twiddle factor.
... |
| A version of FFT using unboxed vectors .
module FFT
( Mode(..)
, fft2d
, fft)
where
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import Data.Vector (Vector)
import Data.Complex
import Debug.Trace
data Mode
= Forward
| Reverse
| Inverse
deriving (Show, Eq)
# INLINE signO... |
213c3c55d36f7cc36c35183cdadd5b5dbb3e7747f89180e4767f61a1739e2128 | TrustInSoft/tis-interpreter | Occurrence.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/occurrence/Occurrence.mli | 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... |
59b30d1eac4e80763666422c82b3ec337ac8bc19e40bfcf44a34b275855d036b | borgeby/jarl | core.cljc | (ns jarl.core
(:require [clojure.string :as str]
[clojure.tools.cli :as cli]
[jarl.bundle :as bundle]
[jarl.logging :as logging]
[jarl.encoding.json :as json]
[jarl.io :as jio]
[jarl.parser :as parser]
[jarl.eval :as evaluator]
... | null | https://raw.githubusercontent.com/borgeby/jarl/3783e3a383aadb74a123a6accc72d290451c9be5/core/src/main/cljc/jarl/core.cljc | clojure | (ns jarl.core
(:require [clojure.string :as str]
[clojure.tools.cli :as cli]
[jarl.bundle :as bundle]
[jarl.logging :as logging]
[jarl.encoding.json :as json]
[jarl.io :as jio]
[jarl.parser :as parser]
[jarl.eval :as evaluator]
... | |
b29d35926be15f5199ac65342af74899be62e91801547608a8631693ed4679f0 | cndreisbach/clojure-web-dev-workshop | views.clj | (ns we-owe.views
(:require [clojure.pprint :refer [pprint]]
[clojure.walk :refer [keywordize-keys]]
[clojure.java.io :as io]
[we-owe.debts :as debts :refer [valid-debt? all-users]]
[ring.util.response :refer [redirect-after-post]]
[hiccup.core :r... | null | https://raw.githubusercontent.com/cndreisbach/clojure-web-dev-workshop/95d9fdf94b39f8a1e408b8bf75a81b92899ee7d9/code/05-liberator/src/we_owe/views.clj | clojure | (ns we-owe.views
(:require [clojure.pprint :refer [pprint]]
[clojure.walk :refer [keywordize-keys]]
[clojure.java.io :as io]
[we-owe.debts :as debts :refer [valid-debt? all-users]]
[ring.util.response :refer [redirect-after-post]]
[hiccup.core :r... | |
934c2a91a4f72da0fa94d68071ba7a0d920da650fe73123299d5c8004128a249 | BU-CS320/Fall-2018 | Lang3Test.hs | module Lang3Test where
import Test.Tasty (testGroup)
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
import Test.Tasty.QuickCheck
for State
import Lang3(Ast(AstInt ,Id , Plus, Assign , Separator), eval)
import StateMonad
unitTests =
testGroup
"Lang3Test"
[instructorTests
-- TODO: your t... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/assignments/week8/hw/tests/Lang3Test.hs | haskell | TODO: your tests here!!!
TODO: your tests here!!!
TODO: Many, many more example test cases (every simple thing, many normal things, some extreame things)
TODO: add a generator, can then test more advanced language properties
TODO: you should always be able to parse show (when the var names aren't too bad) | module Lang3Test where
import Test.Tasty (testGroup)
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
import Test.Tasty.QuickCheck
for State
import Lang3(Ast(AstInt ,Id , Plus, Assign , Separator), eval)
import StateMonad
unitTests =
testGroup
"Lang3Test"
[instructorTests
]
instructorTests... |
42793365c7046b838485fd2398bc6d1d357882c2a2b4a05fa9e4c59956a8fec1 | tomjaguarpaw/haskell-opaleye | Aggregate.hs | module Opaleye.SQLite.Internal.Aggregate where
import Control.Applicative (Applicative, pure, (<*>))
import qualified Data.Profunctor as P
import qualified Data.Profunctor.Product as PP
import qualified Opaleye.SQLite.Internal.PackMap as PM
import qualified Opaleye.SQLite.Internal.PrimQuery as PQ
import qu... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/b7aacc07c6392654cae439fc3b997620c3aa7a87/opaleye-sqlite/src/Opaleye/SQLite/Internal/Aggregate.hs | haskell | { Boilerplate instances
} | module Opaleye.SQLite.Internal.Aggregate where
import Control.Applicative (Applicative, pure, (<*>))
import qualified Data.Profunctor as P
import qualified Data.Profunctor.Product as PP
import qualified Opaleye.SQLite.Internal.PackMap as PM
import qualified Opaleye.SQLite.Internal.PrimQuery as PQ
import qu... |
d590ce885041574d5fa0e94ec58ba61264e85473f79a6105d477234a79c7d924 | tautologico/opfp | tikz2img.ml |
tikz2img.ml
Converte imagens em TikZ para uma imagem
tikz2img.ml
Converte imagens em TikZ para uma imagem
*)
* Codigo inicial ( prologo )
let prologo =
"\\documentclass[a4paper]{article}
\\usepackage[T1]{fontenc}
\\usepackage[brazil]{babel}
\\usepackage[latin1]{inputenc}
\\usepackage{cmbright}
\\us... | null | https://raw.githubusercontent.com/tautologico/opfp/74ef9ed97b0ab6b78c147c3edf7e0b69f2acf9d1/tikz2img/tikz2img.ml | ocaml |
tikz2img.ml
Converte imagens em TikZ para uma imagem
tikz2img.ml
Converte imagens em TikZ para uma imagem
*)
* Codigo inicial ( prologo )
let prologo =
"\\documentclass[a4paper]{article}
\\usepackage[T1]{fontenc}
\\usepackage[brazil]{babel}
\\usepackage[latin1]{inputenc}
\\usepackage{cmbright}
\\us... | |
e83adca39f6266b336ad7734d0b512a3381c2483fc1649508f10d808e1c22f32 | AbstractMachinesLab/caramel | config.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/src/ocaml/utils/407/config.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Local_store.Compiler
let version = Sys.ocaml_version
let flambda = false
let exec_magic_number ... |
628e357c0f658ce469cfc261b1a5c89ac538f1191d190a2f248b65fe56ae277e | EveryTian/Haskell-Codewars | Tests.hs | # LANGUAGE RecordWildCards #
import Data.Foldable (for_)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import OCR (convert)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs = describe "con... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/db01bcb289d6497582566479f7cbdbc8657335d8/exercism/ocr-numbers/test/Tests.hs | haskell | b8f9788184b77668682bfebb02a89c58cdd5ee80 | # LANGUAGE RecordWildCards #
import Data.Foldable (for_)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import OCR (convert)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs = describe "con... |
6ffb4f1243862518da9556b29b9e5db6e827143374861ee7d3a912ca6e7a00c4 | ml4tp/tcoq | coercion.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/pretyping/coercion.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* [inh_app_fun resolve_tc env isevar... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Evd
open Names
open Term... |
a08858d4a1ffae0bbbe02351bf80ec550acc1325201e816a66083142d11fd7c5 | ddssff/cabal-debian | Debianize.hs | -- | [/QUICK START:/]
--
You can either run - debian@ , or
-- for more power and flexibility you can put a @Debianize.hs@ script in
-- the package's @debian@ subdirectory.
--
-- To see what your debianization would produce, or how it differs
-- from the debianization already present:
--
> % cabal - debian -n
--
--... | null | https://raw.githubusercontent.com/ddssff/cabal-debian/763270aed987f870762e660f243451e9a34e1325/src/Debian/Debianize.hs | haskell | | [/QUICK START:/]
for more power and flexibility you can put a @Debianize.hs@ script in
the package's @debian@ subdirectory.
To see what your debianization would produce, or how it differs
from the debianization already present:
This is equivalent to the library call
To actually create the debianization a... | You can either run - debian@ , or
> % cabal - debian -n
> % ghc -e ' System . Environment.withArgs [ " -n " ] $ Debian . Debianize.performDebianization Debian . Debianize.debianDefaults '
> % ghc -e ' Debian . Debianize.performDebianization Debian . Debianize.debianDefaults '
> % sudo
> import Control .... |
541739253181ed51680e0e92ab985ce97a62ff328c6021b9ad0b9c4e6f3533fa | froggey/Mezzano | environment.lisp | 25 . Environment
(in-package :mezzano.internals)
(defvar *site-info* nil
"Site information, returned by SHORT- and LONG-SITE-NAME.
A list of two elements, the short & long name." )
(defvar *machine-info* nil "Value returned by MACHINE-INSTANCE.")
25.1.2 Debugging Utilities .
(defgeneric documentation (object... | null | https://raw.githubusercontent.com/froggey/Mezzano/63c59afcb31c11a11f24eef886c9a7a583f7e4e6/system/environment.lisp | lisp | DOCUMENTATION on function objects.
FUNCTION-DOCUMENTATION is the fundamental function that
retrieves documentation from the various kinds of functions.
DOCUMENTATION on function names.
DOCUMENTATION on compiler macros.
DOCUMENTATION on method combinations.
DOCUMENTATION on methods.
DOCUMENTATION on packages.
D... | 25 . Environment
(in-package :mezzano.internals)
(defvar *site-info* nil
"Site information, returned by SHORT- and LONG-SITE-NAME.
A list of two elements, the short & long name." )
(defvar *machine-info* nil "Value returned by MACHINE-INSTANCE.")
25.1.2 Debugging Utilities .
(defgeneric documentation (object... |
85c8354d128d4ec618aa4efe2f884e79662300d15d0aa51459a7d9f6498a858e | danielmiladinov/joy-of-clojure | macros_controlling_symbolic_resolution_time.clj | ;; Using macros to control symbolic resolution time
;; ---------------------------------------------------------------------------------------------------------------------
;; Whereas functions accept and return values that are meaningful to an application at runtime, macros accept and return
;; code forms that are mea... | null | https://raw.githubusercontent.com/danielmiladinov/joy-of-clojure/cad7d1851e153beb12a2cd536eb467be12cb7a73/src/joy-of-clojure/chapter8/macros_controlling_symbolic_resolution_time.clj | clojure | Using macros to control symbolic resolution time
---------------------------------------------------------------------------------------------------------------------
Whereas functions accept and return values that are meaningful to an application at runtime, macros accept and return
code forms that are meaningful ... | (defmacro resolution [] `x)
Viewing the expansion of this macro is illuminating in understanding how Clojure macros resolve symbols :
(macroexpand '(resolution))
The expansion of the macro resolves the namespace of the syntax - quoted symbol x. This behavior is useful in Clojure
you want in Clojure :
(def x 9)
... |
a7450f8ced1aed558a6edb2e81cf46f9e7dde4968927f415a2c21a3d38455a69 | xtendo-org/rawfilepath | Basic.hs | module RawFilePath.Process.Basic where
-- base modules
import RawFilePath.Import hiding (ClosedHandle)
-- local modules
import RawFilePath.Process.Common
import RawFilePath.Process.Internal
import RawFilePath.Process.Posix
-- | Start a new sub-process with the given configuration.
startProcess
:: (StreamType s... | null | https://raw.githubusercontent.com/xtendo-org/rawfilepath/3b06a3283e77b1b17d6eb415a242ab688c61141e/src/RawFilePath/Process/Basic.hs | haskell | base modules
local modules
| Start a new sub-process with the given configuration.
| Stop a sub-process. For now it simply calls 'terminateProcess' and then
'waitForProcess'.
| Wait (block) for a sub-process to exit and obtain its exit code.
causing an exception to be thrown.
Cf. , and
for further discussion
... | module RawFilePath.Process.Basic where
import RawFilePath.Import hiding (ClosedHandle)
import RawFilePath.Process.Common
import RawFilePath.Process.Internal
import RawFilePath.Process.Posix
startProcess
:: (StreamType stdin, StreamType stdout, StreamType stderr)
=> ProcessConf stdin stdout stderr
-> IO... |
f0b43b1f243467cf93c6a2d544cbb87fbc4fcc32d073acc9f86d542cee1082f1 | hidaris/thinking-dumps | ast.rkt | #lang typed/racket
(provide (all-defined-out))
Expression
(define-type Expression
(U Const Diff IsZero If Var Let Minus Proc App LetProc))
(struct Const
([n : Real])
#:transparent)
(struct Diff
([n1 : Expression]
[n2 : Expression])
#:transparent)
(struct IsZero
([n : Expression])
#:transparent)
... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/eopl-solutions/chap3/3-22/ast.rkt | racket | Value | #lang typed/racket
(provide (all-defined-out))
Expression
(define-type Expression
(U Const Diff IsZero If Var Let Minus Proc App LetProc))
(struct Const
([n : Real])
#:transparent)
(struct Diff
([n1 : Expression]
[n2 : Expression])
#:transparent)
(struct IsZero
([n : Expression])
#:transparent)
... |
c91781f245484123a7447cc9e3450e8c9f0e9df1cc47e5f9346066a272f164ad | haskellari/qc-instances | Natural.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# OPTIONS_GHC -fno - warn - orphans #
module Test.QuickCheck.Instances.Natural () where
import Prelude ()
import Numeric.Natural (Natural)
import Test.QuickCheck
(Arbitrary (..), CoArbitrary (..), arbitrarySizedNatural,
coarbitraryIntegral, s... | null | https://raw.githubusercontent.com/haskellari/qc-instances/94ec49f96c9afd7d29880c22bedfbabe01ad30d5/src/Test/QuickCheck/Instances/Natural.hs | haskell | -----------------------------------------------------------------------------
nats
----------------------------------------------------------------------------- | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# OPTIONS_GHC -fno - warn - orphans #
module Test.QuickCheck.Instances.Natural () where
import Prelude ()
import Numeric.Natural (Natural)
import Test.QuickCheck
(Arbitrary (..), CoArbitrary (..), arbitrarySizedNatural,
coarbitraryIntegral, s... |
c771392eb5b305a81ec7b8d2b8596bf572a6eb5eb1c1892343a5ecbf85ac9fc6 | herbelin/coq-hh | sign.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/kernel/sign.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* {6 Signatures of ordered named dec... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
type n... |
d729eef464a300609d9ed9c50173c528f468726af645b7335b25db42ef5e0943 | haskell-mafia/boris | Repository.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Boris.Http.Repository (
ConfigError (..)
, pick
, list
, renderConfigError
) where
import Boris.Core.Data
import Boris.Http.Data
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Morp... | null | https://raw.githubusercontent.com/haskell-mafia/boris/fb670071600e8b2d8dbb9191fcf6bf8488f83f5a/boris-http/src/Boris/Http/Repository.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module Boris.Http.Repository (
ConfigError (..)
, pick
, list
, renderConfigError
) where
import Boris.Core.Data
import Boris.Http.Data
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Morph (hoist)
import Control.... |
500e87d278e04c391f40206f9844506ca7372ed194838c0afa8415fcc37fda29 | fukamachi/wsock | wsock.lisp | (in-package :cl-user)
(defpackage wsock-test
(:use :cl
:wsock
:prove))
(in-package :wsock-test)
;; NOTE: To run this test file, execute `(asdf:test-system :wsock)' in your Lisp.
(plan nil)
;; blah blah blah.
(finalize)
| null | https://raw.githubusercontent.com/fukamachi/wsock/ec26cfd34fd2fbbb6eb750374023eff8672b6164/t/wsock.lisp | lisp | NOTE: To run this test file, execute `(asdf:test-system :wsock)' in your Lisp.
blah blah blah. | (in-package :cl-user)
(defpackage wsock-test
(:use :cl
:wsock
:prove))
(in-package :wsock-test)
(plan nil)
(finalize)
|
c7a62ec6af9307f8c8db7c9463596be39dadc248188445983801e8df0f005b2c | yigitozkavci/parquet-hs | PageHeader.hs | module Parquet.Types.PageHeader
( -- * Type definitions
DataPageHeader (..),
DictionaryPageHeader (..),
PageHeader (..),
-- * Internal type definitions
IndexPageHeader (..),
-- * Unused type definitions
DataPageHeaderV2 (..),
)
where
---------------------------------------------------... | null | https://raw.githubusercontent.com/yigitozkavci/parquet-hs/eb5904c066092966a8a291dcdbd06088fe329586/src/Parquet/Types/PageHeader.hs | haskell | * Type definitions
* Internal type definitions
* Unused type definitions
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------... | module Parquet.Types.PageHeader
DataPageHeader (..),
DictionaryPageHeader (..),
PageHeader (..),
IndexPageHeader (..),
DataPageHeaderV2 (..),
)
where
import Parquet.Prelude
import Parquet.Types.Enums
import Parquet.Types.Primitives
import Pinch
data DataPageHeader = DataPageHeader
{ _DataPa... |
e7c581f97bf3ad20638af70d3528cb56380680c7ab20fc2da1c2771c731cd678 | jeromesimeon/Galax | factorize_top.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/factorization/factorize_top.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : , v 1.4 2007/02/01 22:08:46 simeon Exp $
open Xquery_core_ast
open Typing_context
val factorize_statement : static_context -> acstatement -> acstatement
val factorize_prolog : static_context -> acprolog -> static_context * ac... |
68b7fb189611319c83a67c7a7ac6c25fa1099e0c82d786bc8c7fdfa3d85ea576 | mekispeter/haskell2019spring | Natural.hs | module Natural where
data Natural = Zero | Succ Natural deriving (Eq, Ord)
instance Enum Natural where
fromEnum Zero = 0
fromEnum (Succ n) = succ $ fromEnum n
toEnum 0 = Zero
toEnum n = Succ $ toEnum (n-1)
instance Show Natural where
show n = show $ fromEnum n
readN :: Str... | null | https://raw.githubusercontent.com/mekispeter/haskell2019spring/18fa81092cdc7a15c8ef92a2eff8274dfe79d00d/src/Natural.hs | haskell | module Natural where
data Natural = Zero | Succ Natural deriving (Eq, Ord)
instance Enum Natural where
fromEnum Zero = 0
fromEnum (Succ n) = succ $ fromEnum n
toEnum 0 = Zero
toEnum n = Succ $ toEnum (n-1)
instance Show Natural where
show n = show $ fromEnum n
readN :: Str... | |
10fc258e8c8dd64391c10a9b324cc4482e8564b291e3e153d8435d4825807df6 | mpardalos/Kima | Kima.hs | module Kima (
module K
) where
import Kima.Desugar as K
import Kima.Syntax as K
import Kima.Interpreter as K
| null | https://raw.githubusercontent.com/mpardalos/Kima/2d9bfb44d873795108789910c4b374059786c0e4/src/Kima.hs | haskell | module Kima (
module K
) where
import Kima.Desugar as K
import Kima.Syntax as K
import Kima.Interpreter as K
| |
258a47f570e8e2be239854a757bdcebd3ae8e8fffd8d8b2647d72f6a122d0528 | georepl/georepl | shapes_factory.clj | (ns georepl.shapes-factory
(:require [clojure.core.match :refer [match]]
[georepl.shapes :as shapes]
[georepl.elements :as elements]
[georepl.mathlib :as math]))
;; functions which are identical for all shapes
;;
(defn- current-strategy [this]
(first (drop-while #(not (:highlig... | null | https://raw.githubusercontent.com/georepl/georepl/1502ae04bbc3cab757000714008ccecc4e9e571b/src/georepl/shapes_factory.clj | clojure | functions which are identical for all shapes
shape-specific functions
point factory
circle factory
arc factory
:elem (assoc arc :p-start p :p-ref p)
:elem (assoc arc :p-start p :p-ref p)
... | (ns georepl.shapes-factory
(:require [clojure.core.match :refer [match]]
[georepl.shapes :as shapes]
[georepl.elements :as elements]
[georepl.mathlib :as math]))
(defn- current-strategy [this]
(first (drop-while #(not (:highlight %))(:strategies this))))
(defn- change-strategy... |
11ee6f0781c283264406e4eadba357f2d6ee8eb72ade580525d2c0697560e057 | erlang/otp | iplt_SUITE.erl | -module(iplt_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/assert.hrl").
-include_lib("dialyzer/src/dialyzer.hrl").
-include("dialyzer_test_constants.hrl").
-export([suite/0, all/0,
init_per_testcase/2,
end_per_testcase/2,
beam_tests/1,
local_fun_... | null | https://raw.githubusercontent.com/erlang/otp/f0a17925822ee88dc2df5db39031705d143c7848/lib/dialyzer/test/iplt_SUITE.erl | erlang | happens to be in the default user cache when they start
We change the $HOME of the emulator to run this test
If a behaviour module contains an non-exported function with the same name
as one of the behaviour's callbacks, the callback info was inadvertently
@doc This function is here just to avoid the 'unused' warn... | -module(iplt_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/assert.hrl").
-include_lib("dialyzer/src/dialyzer.hrl").
-include("dialyzer_test_constants.hrl").
-export([suite/0, all/0,
init_per_testcase/2,
end_per_testcase/2,
beam_tests/1,
local_fun_... |
bf2b18ab615e50d5de1f54ca70859699fd85758422931acf2abebff00a44bed3 | obsidiansystems/rhyolite | Beam.hs | {-# Language DeriveAnyClass #-}
{-# Language DeriveGeneric #-}
{-# Language FlexibleInstances #-}
{-# Language FunctionalDependencies #-}
{-# Language KindSignatures #-}
{-# Language RankNTypes #-}
{-# Language StandaloneDeriving #-}
{-# Language TemplateHaskell #-}
|
Description : Models the interface to a work queu... | null | https://raw.githubusercontent.com/obsidiansystems/rhyolite/0b7938367c79343bc5089dd4b0a840cb7d800996/beam/task/types/src/Rhyolite/Task/Beam.hs | haskell | # Language DeriveAnyClass #
# Language DeriveGeneric #
# Language FlexibleInstances #
# Language FunctionalDependencies #
# Language KindSignatures #
# Language RankNTypes #
# Language StandaloneDeriving #
# Language TemplateHaskell #
and record back the results after processing them.
^ A user-supplied predicate for... | |
Description : Models the interface to a work queue that is stored in a database table .
The ' Task ' type in this module describes how to interact with a ' Table ' that tracks tasks that can be checked out and processed by workers in a distributed but serializable fashion . In this model tasks are not locked by ... |
99b171ae4883edd9ae3257b2e313d0e993b758ac917eed12e3b1d34d9d686fcb | cffi/cffi | utils.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; utils.lisp --- Various utilities.
;;;
Copyright ( C ) 2005 - 2008 , loliveira(@)common - lisp.net >
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software... | null | https://raw.githubusercontent.com/cffi/cffi/8629618e9bb0dfc750d01fc4990404c78ab41705/src/utils.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
utils.lisp --- Various utilities.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicens... | Copyright ( C ) 2005 - 2008 , loliveira(@)common - lisp.net >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY ... |
dbf9f72f6db05fa1704e3fe26324c2db586d36ce8a054e6bdc429c6b2ca87c28 | andelf/erlang-proxy | proxy_client_srv.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2013 ,
%%% @doc
%%%
%%% @end
Created : 8 Apr 2013 by < >
%%%-------------------------------------------------------------------
-module(proxy_client_srv).
-behaviour(gen_server).
%% API
-export([start_link/0]).
... | null | https://raw.githubusercontent.com/andelf/erlang-proxy/d3c6d7ba8825ba7fd438bef5d1e41aa5eae5d872/apps/proxy_client/src/proxy_client_srv.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
sock: client's local socket server
===================================================================
API
===================================... | @author < >
( C ) 2013 ,
Created : 8 Apr 2013 by < >
-module(proxy_client_srv).
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-define(RETRY_TIMES, 2).
-record(state, {... |
e4aeff81db6adb44591da617ad3012922d68b5351423168f72e199df1b88d6b8 | racket/racket7 | fixnum-flonum.rkt | #lang racket/base
(require "config.rkt"
"error.rkt"
"whitespace.rkt"
"location.rkt"
"special.rkt"
"symbol-or-number.rkt")
(provide read-fixnum
read-flonum)
(define (read-fixnum read-one init-c in config)
(define c (read-char/skip-whitespace-and-comments init-c r... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/read/fixnum-flonum.rkt | racket | ---------------------------------------- | #lang racket/base
(require "config.rkt"
"error.rkt"
"whitespace.rkt"
"location.rkt"
"special.rkt"
"symbol-or-number.rkt")
(provide read-fixnum
read-flonum)
(define (read-fixnum read-one init-c in config)
(define c (read-char/skip-whitespace-and-comments init-c r... |
5f22b656e4329833374495de599d846ed087e05f2ffa09ca12b9b35b5d4f266a | e-bigmoon/haskell-blog | Example06.hs | #!/usr/bin/env stack
{- stack repl --resolver lts-15.4
--package shakespeare
--package text
-}
# LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
import Data.Text (Text)
import qualified Data.Text.Lazy.IO as TLIO
import Text.Lucius ... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/ch04/Example06.hs | haskell | stack repl --resolver lts-15.4
--package shakespeare
--package text
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
# LANGUAGE CPP #
# LANGUAGE TemplateHaskell #
import Data.Text (Text)
import qualified Data.Text.Lazy.IO as TLIO
import Text.Lucius (CssUrl, luciusFile, luciusFileReload,
renderCss)
data MyRoute = Home | Time |... |
5b8aada362484d4e740149982953cb80d46b982f73235efb22a7a3352ebbfe9f | aristidb/aws | SetIdentityDkimEnabled.hs | module Aws.Ses.Commands.SetIdentityDkimEnabled
( SetIdentityDkimEnabled(..)
, SetIdentityDkimEnabledResponse(..)
) where
import Aws.Core
import Aws.Ses.Core
import Data.Text (Text)
import Data.Text.Encoding as T
import Data.Typeable
-- | Change wh... | null | https://raw.githubusercontent.com/aristidb/aws/a99113ed7768f9758346052c0d8939b66c6efa87/Aws/Ses/Commands/SetIdentityDkimEnabled.hs | haskell | | Change whether bounces and complaints for the given identity will be
DKIM signed.
| ServiceConfiguration: 'SesConfiguration' | module Aws.Ses.Commands.SetIdentityDkimEnabled
( SetIdentityDkimEnabled(..)
, SetIdentityDkimEnabledResponse(..)
) where
import Aws.Core
import Aws.Ses.Core
import Data.Text (Text)
import Data.Text.Encoding as T
import Data.Typeable
data SetIdenti... |
9d2e0c1c5b383e8eddfd9982be515572a9013feb0aab96dcc8174ae1d0612172 | Misterio77/aoc2022 | Main.hs | module Main where
import Data.Char (digitToInt)
import Data.List.Split (splitOneOf)
-- Check whether the lists intercept
intersects :: Eq a => ([a], [a]) -> Bool
intersects (range1, range2) = any (`elem` range1) range2
-- Check whether one of the lists fully contains the other
contains :: Eq a => ([a], [a]) -> Bool
... | null | https://raw.githubusercontent.com/Misterio77/aoc2022/eec09d01ba1e0fa921a737d5a2eb81dd602fadfd/src/day4/Main.hs | haskell | Check whether the lists intercept
Check whether one of the lists fully contains the other
Part 1 | module Main where
import Data.Char (digitToInt)
import Data.List.Split (splitOneOf)
intersects :: Eq a => ([a], [a]) -> Bool
intersects (range1, range2) = any (`elem` range1) range2
contains :: Eq a => ([a], [a]) -> Bool
contains (range1, range2) = all (`elem` range1) range2 || all (`elem` range2) range1
rangesFrom... |
38397673d670c72d2baec815c89c980eaef67197fe691135c435755a377f232f | s-expressionists/Cleavir | test-def-use-chains.lisp | (cl:in-package #:cleavir-def-use-chains-test)
(defun nodes-used-by-definition (graph node var)
(let ((result '()))
(cleavir-graph:with-graph (graph)
(labels ((inputp (node var)
(cleavir-graph:do-inputs (in node nil)
(when (eq in var) (return t))))
(outputp... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/e0293780d356a9d563af9abf9317019f608b4e1d/Def-use-chains/test-def-use-chains.lisp | lisp | use nodes mentioned in it are precisely the nodes that can be
reached by the definition.
Next check that for every definition, there is a def-use-chain
definition. | (cl:in-package #:cleavir-def-use-chains-test)
(defun nodes-used-by-definition (graph node var)
(let ((result '()))
(cleavir-graph:with-graph (graph)
(labels ((inputp (node var)
(cleavir-graph:do-inputs (in node nil)
(when (eq in var) (return t))))
(outputp... |
889348031513d86e9509f708da375a27c218d6adab7c773e15a168233fb7330c | facebookarchive/JSCaml | js_cnv.ml | *
* Copyright ( c ) 2013 - present , Facebook , Inc.
* All rights reserved .
*
* This source code is licensed under the BSD - style license found in the
* LICENSE file in the root directory of this source tree . An additional grant
* of patent rights can be found in the PATENTS file in the same direct... | null | https://raw.githubusercontent.com/facebookarchive/JSCaml/adf48cc4aa87e02b6a70765dc1e0904c4739804f/runtime/js_cnv.ml | ocaml | *
* Copyright ( c ) 2013 - present , Facebook , Inc.
* All rights reserved .
*
* This source code is licensed under the BSD - style license found in the
* LICENSE file in the root directory of this source tree . An additional grant
* of patent rights can be found in the PATENTS file in the same direct... | |
b7251666a56a1112025d87f7f528d7d5c35cd74f29955b6b323993749654d109 | hraberg/deuce | buffer.clj | (ns deuce.emacs.buffer
(:use [deuce.emacs-lisp :only (defun defvar)])
(:require [clojure.core :as c]
[clojure.string :as s]
[clojure.java.io :as io]
[flatland.ordered.map :as ordered-map]
[deuce.emacs.alloc :as alloc]
[deuce.emacs.data :as data]
... | null | https://raw.githubusercontent.com/hraberg/deuce/9d507adb6c68c0f5c19ad79fa6ded9593c082575/src/deuce/emacs/buffer.clj | clojure |
a value of nil means don't show any vertical scroll bars.
their accuracy is
it should only affect their performance.")
older changes follow newer.
if negative, point was at the end.
otherwise, the characters from the vector are delivered
also, when saving the buffer
The eternal battle of how to repres... | (ns deuce.emacs.buffer
(:use [deuce.emacs-lisp :only (defun defvar)])
(:require [clojure.core :as c]
[clojure.string :as s]
[clojure.java.io :as io]
[flatland.ordered.map :as ordered-map]
[deuce.emacs.alloc :as alloc]
[deuce.emacs.data :as data]
... |
a81e280c772ab46d5ca142bca1603eeaa61d073aba31728188398076545c9757 | ghc/packages-base | Exception.hs | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , DeriveDataTypeable , MagicHash ,
ExistentialQuantification #
ExistentialQuantification #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK hide #-}
-------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/ghc/packages-base/52c0b09036c36f1ed928663abb2f295fd36a88bb/GHC/IO/Exception.hs | haskell | # OPTIONS_GHC -funbox-strict-fields #
# OPTIONS_HADDOCK hide #
---------------------------------------------------------------------------
|
Module : GHC.IO.Exception
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
Portability : non-portable
----------------------------... | # LANGUAGE Trustworthy #
# LANGUAGE NoImplicitPrelude , DeriveDataTypeable , MagicHash ,
ExistentialQuantification #
ExistentialQuantification #-}
Copyright : ( c ) The University of Glasgow , 2009
IO - related Exception types and functions
module GHC.IO.Exception (
BlockedIndef... |
c6f05a647c27e3b192aef492d58b85da0be9e98fef69f57dfac31d627a917441 | ds-wizard/engine-backend | UserService.hs | module Wizard.Service.User.UserService where
import Control.Monad (forM_, when)
import Control.Monad.Except (catchError, throwError)
import Control.Monad.Reader (asks, liftIO)
import qualified Crypto.PasswordStore as PasswordStore
import Data.ByteString.Char8 as BS
import Data.Maybe (fromMaybe)
import Data.Time
import... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Service/User/UserService.hs | haskell | --------------------------------
PRIVATE
-------------------------------- | module Wizard.Service.User.UserService where
import Control.Monad (forM_, when)
import Control.Monad.Except (catchError, throwError)
import Control.Monad.Reader (asks, liftIO)
import qualified Crypto.PasswordStore as PasswordStore
import Data.ByteString.Char8 as BS
import Data.Maybe (fromMaybe)
import Data.Time
import... |
649ad8f416e3cbedd6016db89ef91c7884be73191e0b0f249d8e560c4bba8b45 | ucsd-progsys/liquidhaskell | RegexpDerivative.hs | -- | -of-regular-expression-matching-in-scheme-with-derivatives/
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
{-@ infixr ++ @-}
{-# LANGUAGE GADTs #-}
module RegexpDerivative where
import Language.Haskell.Liquid.ProofCombinators (pleUnfold)
import Prelude hiding ((++))
------------------... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/cc3d72a36032944675bd91e4bf269add1beb6d4b/tests/ple/pos/RegexpDerivative.hs | haskell | | -of-regular-expression-matching-in-scheme-with-derivatives/
@ LIQUID "--reflection" @
@ LIQUID "--ple" @
@ infixr ++ @
# LANGUAGE GADTs #
-----------------------------------------------------------------
| Regular Expressions
-----------------------------------------------------------------
@ dat... |
module RegexpDerivative where
import Language.Haskell.Liquid.ProofCombinators (pleUnfold)
import Prelude hiding ((++))
data RE a
= None
| Empty
| Char a
| Cat (RE a) (RE a)
| Alt (RE a) (RE a)
| Star (RE a)
reSize :: RE a -> Int
reSize None = 0
reSize Empty = 0
reSize (Char _) = 0
r... |
fc88632a6ff8865b76c03e3ff9854179f60aea1945067c4351662a10834ff57c | tonsky/datascript | validation.cljc | (ns datascript.test.validation
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datascript.core :as d]
[datascript.test.core :as tdc]))
#?(:cljs
(def Throwable js/Error))
(deftest test-with-valida... | null | https://raw.githubusercontent.com/tonsky/datascript/55af41d6d7d18f12358957a056a6cd1bb484fee7/test/datascript/test/validation.cljc | clojure | (ns datascript.test.validation
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datascript.core :as d]
[datascript.test.core :as tdc]))
#?(:cljs
(def Throwable js/Error))
(deftest test-with-valida... | |
d24d31878e297bbe6e28b8255df917e4bf191177caba0880b791c812109959b6 | NorfairKing/the-notes | Terms.hs | module Cryptography.SystemAlgebra.DiscreteSystems.Terms where
import Notes
import Cryptography.SystemAlgebra.AbstractSystems.Terms
makeDefs
[ "source"
, "beacon"
, "deterministic discrete system"
, "synchronous parallel composition"
, "asynchronous parallel composition"
, ... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Cryptography/SystemAlgebra/DiscreteSystems/Terms.hs | haskell | | N-system
| N-systems
| N-probabilistic system
| N-probabilistic systems
| N-deterministic system
| N-deterministic systems
| X,Y-system
| X,Y-systems
| Y-source
| Y,X-environment
| Deterministic environment for X,Y-system
| Probabillistic environment for X,Y-system
| ((U,V), (X, Y)) converter
| Y-beacon | module Cryptography.SystemAlgebra.DiscreteSystems.Terms where
import Notes
import Cryptography.SystemAlgebra.AbstractSystems.Terms
makeDefs
[ "source"
, "beacon"
, "deterministic discrete system"
, "synchronous parallel composition"
, "asynchronous parallel composition"
, ... |
542480f74568b56b18be49ebea6e39ee0607f045a2b157b7a1df06c579dd605f | nervous-systems/kvlt | websocket.clj | (ns ^:no-doc kvlt.platform.websocket
(:require [aleph.http :as http]
[clojure.core.async :as async]
[kvlt.platform.util :refer [exception->map]]
[kvlt.util :as util]
[kvlt.websocket :refer [format-incoming format-outgoing]]
[manifold.deferred :as deferred]
... | null | https://raw.githubusercontent.com/nervous-systems/kvlt/26fe43eb9de6d7cc7ad8a466953fa0ffe09889ca/src/kvlt/platform/websocket.clj | clojure | (ns ^:no-doc kvlt.platform.websocket
(:require [aleph.http :as http]
[clojure.core.async :as async]
[kvlt.platform.util :refer [exception->map]]
[kvlt.util :as util]
[kvlt.websocket :refer [format-incoming format-outgoing]]
[manifold.deferred :as deferred]
... | |
67f0f6fb3d91f57ecb8102af7c0357a636fe2c5ff0fcaf6f8ed1db991d84edb8 | PolyB/kvm | Cpu.hs | # LANGUAGE TypeApplications #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module System.Linux.Kvm.KvmM.Cpu
(
*
module System.Lin... | null | https://raw.githubusercontent.com/PolyB/kvm/a0431d6558906ec90376864ac665a27978a6a671/src/System/Linux/Kvm/KvmM/Cpu.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE RankNTypes #
* Cpu Monad
* Cpu Actions
* Cpu Properties
| Continue the Vm, calls /KVM_RUN/ behind and update the 'CpuT' monad with the new informations
| Create a CPU and run it inside a 'CpuT' 'MonadTransformer'
TODO : modify if multiple cpus is needed
| Returns the exit... | # LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module System.Linux.Kvm.KvmM.Cpu
(
*
module System.Linux.Kvm.IoCtl.Types.Regs
,module System.Linux.Kvm.IoCtl.Type... |
aee337295a81053ec740dd2a5fd611c7dc87be560579df535a44e8efb7d2e2b5 | clj-commons/citrus | cursor.cljs | (ns citrus.cursor)
(deftype ReduceCursor [ref path reducer meta]
Object
(equiv [this other]
(-equiv this other))
IAtom
IMeta
(-meta [_] meta)
IEquiv
(-equiv [this other]
(identical? this other))
IDeref
(-deref [_]
(-> (-deref ref)
(get-in path)
(reducer)))
IWatchabl... | null | https://raw.githubusercontent.com/clj-commons/citrus/9c0b1441ab466237415fc8ec2b03307d3541694e/src/citrus/cursor.cljs | clojure | (ns citrus.cursor)
(deftype ReduceCursor [ref path reducer meta]
Object
(equiv [this other]
(-equiv this other))
IAtom
IMeta
(-meta [_] meta)
IEquiv
(-equiv [this other]
(identical? this other))
IDeref
(-deref [_]
(-> (-deref ref)
(get-in path)
(reducer)))
IWatchabl... | |
3868f2d3c7a86a4a54137645ae12b455eb80498b0c33507ceb3ccfd42ee20018 | dtgoitia/civil-autolisp | 0 - Function library.lsp | (vl-load-com)
(defun _Set_Line ( pa pb )
; pa - Line initial point
; pb - Line final point
(entmakex
(list
(cons 0 "LINE") ; Element type: line
(cons 10 pa) ; Object primary point: line initial point
(cons 11 ... | null | https://raw.githubusercontent.com/dtgoitia/civil-autolisp/72d68139d372c84014d160f8e4918f062356349f/0%20-%20Function%20library.lsp | lisp | pa - Line initial point
pb - Line final point
Element type: line
Object primary point: line initial point
Line final point
Line color
Line type: dashed, if possible
Line type scale
v0.2 - 2016.04.10 - Linetype style check.
pc - Circle center point
rd - Circle radius
Element type: circle
Object primary poin... | (vl-load-com)
(defun _Set_Line ( pa pb )
(entmakex
(list
)
)
v0.1 - 2016.03.21 - Translate into English
v0.0 - 2016.03.18 - First issue
Author :
Last revision : 2016.04.10
)
(defun _Reference_Circle ( pc rd )
(entmakex
(list
Circle radius
)
)
v0.1 - 2016.03.21 - Translate into Engl... |
c8bd314d9d3686c87ab1ebba03fa2d9213aab9e8f67bb3d3a1b0e4351f7c4690 | zyrolasting/racket-koans | iterations.rkt | #lang racket
(require rackunit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Iterations with side-effects
(define mutable '())
(define sequences (list
'(#\a #\b #\c)
#(#\a #\b #\c)
"abc"
))
;; `for` iterates over sequences, and sequences are a supertype of many other ty... | null | https://raw.githubusercontent.com/zyrolasting/racket-koans/09acc058244ed88d7addd434677426cd8580bb3c/koans/iterations.rkt | racket |
Iterations with side-effects
`for` iterates over sequences, and sequences are a supertype of many other types,
making it flexible for writing loops for many purposes.
-lang.org/reference/sequences.html
`for` forms support stepping through multiple sequences, stopping
for* is a shorthand for nesting loops.
You c... | #lang racket
(require rackunit)
(define mutable '())
(define sequences (list
'(#\a #\b #\c)
#(#\a #\b #\c)
"abc"
))
(for ([seq sequences]) "?")
(check-equal? mutable '(#\c #\b #\a #\c #\b #\a #\c #\b #\a))
at the end of the first seqeunce to run out of elements .
(define char-int-display-strings '())
(fo... |
c75797feeabe6201749e26b6e0d3e733f5308c0ed1d1bbb74f4990e113d1e777 | bomberstudios/mtasc | bitSet.ml |
* Bitset - Efficient bit sets
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option )... | null | https://raw.githubusercontent.com/bomberstudios/mtasc/d7c2441310248776aa89d60f9c8f98d539bfe8de/src/extlib-dev/bitSet.ml | ocaml | value used to round up index
number of shifts
Find highest set element or raise Not_found
0-y -> -1
x-y
MSBs differ, we need to scan arrays until we find a
difference
Note: rest of the array is handled automatically correct, since we
took a copy of the bigger set. |
* Bitset - Efficient bit sets
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option )... |
f6a7cb8081b2d93f135f7020d7644af025f05d0f01a89fcf3b05ba972fe4d8c6 | privet-kitty/cl-competitive | range-tree.lisp | (defpackage :cp/range-tree
(:use :cl)
(:export #:make-range-tree #:rt-count #:rt-fold #:rt-update #:rt-set)
(:documentation
"Provides 2D range tree over an arbitrary commutative monoid.
build: O(nlog(n))
query: O(log^2(n))
Reference:
/~taoju/cse546/lectures/Lecture21_rangequery_2d.pdf"))
(in-package :cp/rang... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/b3114180889cd2af322a2f8a3edce1d95ba8f53d/module/range-tree.lisp | lisp | TODO: map all the points in a given rectangle
TODO: k-dimensional range tree
Merging w.r.t. Y-axis in O(n) time:
I use only #'< here for abstraction in the future
assert POINTS is sorted
TODO: do this only when safety > 0
then they are regarded as the
then they are regarded as the negative or | (defpackage :cp/range-tree
(:use :cl)
(:export #:make-range-tree #:rt-count #:rt-fold #:rt-update #:rt-set)
(:documentation
"Provides 2D range tree over an arbitrary commutative monoid.
build: O(nlog(n))
query: O(log^2(n))
Reference:
/~taoju/cse546/lectures/Lecture21_rangequery_2d.pdf"))
(in-package :cp/rang... |
995e9e4676c87c531bb6237c51656ee46622714e7d8ced46859871160ba18acf | cram2/cram | matrix-standard-deviation-with-mean.lisp | Regression test MATRIX - STANDARD - DEVIATION - WITH - MEAN for GSLL , automatically generated
;;
Copyright 2009 , 2011
Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/matrix-standard-deviation-with-mean.lisp | lisp |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Publi... | Regression test MATRIX - STANDARD - DEVIATION - WITH - MEAN for GSLL , automatically generated
Copyright 2009 , 2011
Distributed under the terms of the GNU General Public License
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the Lice... |
6730eddb99b168d460db87f5030fb824428279183fbe6545be68e5553fa943a9 | well-typed/large-records | EmptyClass_List.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE KindSignatures #
{-# LANGUAGE TypeOperators #-}
module Common.EmptyClass_List (
EmptyClass
, requireEmptyClass
) where
import Data.Proxy
import Data.Kind
class EmptyClass (xs :: [Type]) where
instance EmptyClass '[]
instance EmptyClass xs => EmptyClass (x ': xs)
... | null | https://raw.githubusercontent.com/well-typed/large-records/c6c2b51af11e90f30822543d7ce4d1cb28cee294/large-records-benchmarks/bench/experiments/Common/EmptyClass_List.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators # | # LANGUAGE KindSignatures #
module Common.EmptyClass_List (
EmptyClass
, requireEmptyClass
) where
import Data.Proxy
import Data.Kind
class EmptyClass (xs :: [Type]) where
instance EmptyClass '[]
instance EmptyClass xs => EmptyClass (x ': xs)
# NOINLINE requireEmptyClass #
requireEmptyClass :: EmptyClass x... |
9974de130c48c6dcc0b7d59576a3b56bb9c6c4dcc9cc4c6d645b4f755d743b1f | sethfowler/pygmalion | Request.hs | # LANGUAGE DeriveGeneric #
module Pygmalion.Database.Request
( DBUpdate (..)
, DBRequest (..)
, DBUpdateChan
, DBQueryChan
, newDBUpdateChan
, pushUpdate
, popUpdates
, isEmptyUpdateChan
) where
import Control.Applicative
import Control.Concurrent.STM
import Data.Serialize
import Data.Vector
import GHC.Generics
impo... | null | https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/src/Pygmalion/Database/Request.hs | haskell | type DBUpdateChan = LenChan (Vector DBUpdate) | # LANGUAGE DeriveGeneric #
module Pygmalion.Database.Request
( DBUpdate (..)
, DBRequest (..)
, DBUpdateChan
, DBQueryChan
, newDBUpdateChan
, pushUpdate
, popUpdates
, isEmptyUpdateChan
) where
import Control.Applicative
import Control.Concurrent.STM
import Data.Serialize
import Data.Vector
import GHC.Generics
impo... |
27b499f0be3ad687d6877bc8fb331bda011a07df8a9ccc1f45ed5ab04d982a23 | jetseven/sicp | basebot.scm | Project 1 , 6.001 , Spring 2005
;;; idea is to simulate a baseball robot
;; imagine hitting a ball with an initial velocity of v
;; at an angle alpha from the horizontal, at a height h
;; we would like to know how far the ball travels.
as a first step , we can just model this with simple physics
;; s... | null | https://raw.githubusercontent.com/jetseven/sicp/0998f4ec0967dde950dab11741d5433f8ea69ea6/projects/basebot.scm | scheme | idea is to simulate a baseball robot
imagine hitting a ball with an initial velocity of v
at an angle alpha from the horizontal, at a height h
we would like to know how far the ball travels.
so the equations of motion for the ball have a vertical and a
horizontal component
the vertical component is gover... | Project 1 , 6.001 , Spring 2005
as a first step , we can just model this with simple physics
where g is the gravitational constant of 9.8 m / s^2
First , we want to know when the ball hits the ground
note that there are two solutions , only one makes sense physically
(define square
... |
2965ee3e6dd70ca7bfa11665ac2d13b6bf33f61526097dceb48e3ca66e82efa6 | philnguyen/soft-contract | l-zipmap.rkt | #lang racket
(provide/contract
[main (->i ([n integer?]) (res (n) (and/c integer? (=/c n))))])
(define (zip x y)
(cond
[(and (= x 0) (= y 0)) x]
[(and (not (= x 0)) (not (= y 0))) (+ 1 (zip (- x 1) (- y 1)))]
[else (add1 "fail")]))
(define (map x)
(if (= x 0) x (+ 1 (map (- x 1)))))
(define (main n... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/mochi/l-zipmap.rkt | racket | #lang racket
(provide/contract
[main (->i ([n integer?]) (res (n) (and/c integer? (=/c n))))])
(define (zip x y)
(cond
[(and (= x 0) (= y 0)) x]
[(and (not (= x 0)) (not (= y 0))) (+ 1 (zip (- x 1) (- y 1)))]
[else (add1 "fail")]))
(define (map x)
(if (= x 0) x (+ 1 (map (- x 1)))))
(define (main n... | |
ad36ce44b25f7cd4c72e385c754501ce086c5ebf58e597eb3d974d365265e2f3 | metosin/jsonista | core.clj | (ns jsonista.core
"JSON encoding and decoding based on Jackson Databind.
Encoding example:
(require '[jsonista.core :as json])
(json/write-value-as-string {:hello 1})
;; => \"{\\\"hello\\\":1}\"
Decoding example:
(def +data+ (json/write-value-as-string {:foo \"bar\"}))
(json/read... | null | https://raw.githubusercontent.com/metosin/jsonista/51212e44284773a9a645b2a9c1c4ec12de458aac/src/clj/jsonista/core.clj | clojure | => \"{\\\"hello\\\":1}\"
=> {\"foo\" \"bar\"}
=> \"\\\"java.awt.Color[r=1,g=2,b=3]\\\"\"
public api
| (ns jsonista.core
"JSON encoding and decoding based on Jackson Databind.
Encoding example:
(require '[jsonista.core :as json])
(json/write-value-as-string {:hello 1})
Decoding example:
(def +data+ (json/write-value-as-string {:foo \"bar\"}))
(json/read-value +data+)
## Configuration... |
0d480fe1c28ca3b603127574b9fb86ce7ef699bd9bdeaf6cb452fd6e155f8194 | theam/haskell-do | Materialize.hs |
- Copyright ( c ) 2017 The Agile Monkeys S.L. < >
-
- Licensed under the Apache License , Version 2.0 ( the " License " ) ;
- you may not use this file except in compliance with the License .
- You may obtain a copy of the License at
-
- -2.0
-
- Unless required by applicable law or agr... | null | https://raw.githubusercontent.com/theam/haskell-do/f339e57859d308437a72800bda08f96d0de12982/src/ghcjs-specific/Foreign/Materialize.hs | haskell |
- Copyright ( c ) 2017 The Agile Monkeys S.L. < >
-
- Licensed under the Apache License , Version 2.0 ( the " License " ) ;
- you may not use this file except in compliance with the License .
- You may obtain a copy of the License at
-
- -2.0
-
- Unless required by applicable law or agr... | |
965daaffee8a90b555b3fed31db13a7decdc7b6122d91f5c44df80f3ad3c4fc1 | bhaskara/programmable-reinforcement-learning | robust-q-learning.lisp | (defpackage robust-q-learning
(:use common-lisp
expl-policy
fn-approx
sampling
utils)
(:export robust-q))
(in-package robust-q-learning)
(defconstant *env-reset-max* 100)
(defun robust-q (env num-steps hist-length discount eta-fn &key (samples nil))
"robust-q ENV NUM-STEPS HIST-LENGTH DIS... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/learning/robust-q-learning.lisp | lisp | (defpackage robust-q-learning
(:use common-lisp
expl-policy
fn-approx
sampling
utils)
(:export robust-q))
(in-package robust-q-learning)
(defconstant *env-reset-max* 100)
(defun robust-q (env num-steps hist-length discount eta-fn &key (samples nil))
"robust-q ENV NUM-STEPS HIST-LENGTH DIS... | |
d91b5811b6be2ae6d9e35fff16432a953f501a4302d2e5661eaf9ca7914ed3dc | clojurewerkz/statistiker | naive_bayes_test.clj | (ns clojurewerkz.statistiker.classification.naive-bayes-test
(:require [clojure.test :refer :all]
[clojurewerkz.statistiker.classification.naive-bayes :refer :all]))
(def test-item [6 130 8])
(def classification-data {:male [[6 180 12]
[5.92 190 11]
... | null | https://raw.githubusercontent.com/clojurewerkz/statistiker/f056f68c975cf3d6e0f1c8212aef9114d4eb657c/test/clj/clojurewerkz/statistiker/classification/naive_bayes_test.clj | clojure | (ns clojurewerkz.statistiker.classification.naive-bayes-test
(:require [clojure.test :refer :all]
[clojurewerkz.statistiker.classification.naive-bayes :refer :all]))
(def test-item [6 130 8])
(def classification-data {:male [[6 180 12]
[5.92 190 11]
... | |
c650a251f5e2f57a2f11044d6789baedb35032539ff56f5008a4d3d0333f01cb | zinid/delimcc | bench_nondet.ml |
A benchmark of shift / reset : 's representing non - determinism monads
The benchmark is taken from Sec 6.1 of
, : Final Shift for Call / cc : Direct
Implementation of Shift and Reset , ICFP'02 , pp . 271 - 282 .
-pu.informatik.uni-tuebingen.de/users/sperber/papers/shift-reset-direct.pdf ... | null | https://raw.githubusercontent.com/zinid/delimcc/93ffd621051858e9fefdbeffd86a6112063a436a/bench_nondet.ml | ocaml | Small language with non-determinism: just like the one in our DSL-WC paper
Benchmark cases
Real benchmark cases
Non-determinism monad as a list of successes
time taken to optimize and deforest
have to fix the answer-type for amb
Direct-style non-determinism
Direct-style non-determinism with call/cc:
Run... |
A benchmark of shift / reset : 's representing non - determinism monads
The benchmark is taken from Sec 6.1 of
, : Final Shift for Call / cc : Direct
Implementation of Shift and Reset , ICFP'02 , pp . 271 - 282 .
-pu.informatik.uni-tuebingen.de/users/sperber/papers/shift-reset-direct.pdf ... |
f9599287bf4383fa68f9715e1d280f1ac3c3f92b700fa8b390a169b885aa0a1b | BitGameEN/bitgamex | run_data.erl | %%%--------------------------------------
%%% @Module : run_data
%%% @Description: run数据层公共操作
%%% 事务的覆盖范围是某进程开始调用trans_begin到调用trans_end之间的该进程内部执行的逻辑
%%%--------------------------------------
-module(run_data).
% 逻辑调用接口
-export([trans_begin/0, trans_commit/0, trans_rollback/0, trans_set_commit_function/1, trans_set_p... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/lib/run_data.erl | erlang | --------------------------------------
@Module : run_data
@Description: run数据层公共操作
事务的覆盖范围是某进程开始调用trans_begin到调用trans_end之间的该进程内部执行的逻辑
--------------------------------------
逻辑调用接口
run_xxx模块调用
该接口设置的函数将在事务提交之前执行,如果产生异常,将会回滚 | -module(run_data).
-export([trans_begin/0, trans_commit/0, trans_rollback/0, trans_set_commit_function/1, trans_set_pre_commit_function/1, trans_set_post_commit_function/1, trans_set_rollback_function/1]).
-export([in_trans/0, trans_get/2, trans_set/5, trans_del/4]).
-export([lookup_one/3]).
-export([db_write/2, db_w... |
0fa9b8a05dadcca7ff10b8234ff5c30a8b6c8aa422c3819eb9ee42d2f191f9c8 | finnishtransportagency/harja | materiaalikirjasto.cljs | (ns harja.tiedot.urakka.pot2.materiaalikirjasto
"UI controlleri pot2 materiaalikirjastolle"
(:require [reagent.core :refer [atom] :as r]
[cljs.core.async :refer [<!]]
[clojure.string :as str]
[harja.loki :refer [log tarkkaile!]]
[tuck.core :refer [process-event] :as t... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/c02df7e75c7a098a008c2595573b8738d3f9b8b4/src/cljs/harja/tiedot/urakka/pot2/materiaalikirjasto.cljs | clojure | Massat | (ns harja.tiedot.urakka.pot2.materiaalikirjasto
"UI controlleri pot2 materiaalikirjastolle"
(:require [reagent.core :refer [atom] :as r]
[cljs.core.async :refer [<!]]
[clojure.string :as str]
[harja.loki :refer [log tarkkaile!]]
[tuck.core :refer [process-event] :as t... |
f929995c75bf3aea0708da943f5af1764b3c48feb8204e8d46e80800136138a9 | ring-clojure/ring-accept | accept_test.clj | (ns ring.middleware.accept-test
(:use clojure.test
ring.middleware.accept))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/ring-clojure/ring-accept/e478fac6da8d330972029e8c33809b8dc0fdd39c/test/ring/middleware/accept_test.clj | clojure | (ns ring.middleware.accept-test
(:use clojure.test
ring.middleware.accept))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
423fa3ba6bea6d1e146127e46071ea33ea49370363d90612fa94a56eea43a380 | torkve/melange-seawar | main.ml | let _ =
let game = Game.init_game () in
if not game#is_ai then
QmlContext.run_with_QQmlApplicationEngine Sys.argv (Gui.player game) "gui.qml"
else
Ai.ai game
;;
| null | https://raw.githubusercontent.com/torkve/melange-seawar/e1633ef088a2dbf893536a7ba2fa8a72eac198ec/main.ml | ocaml | let _ =
let game = Game.init_game () in
if not game#is_ai then
QmlContext.run_with_QQmlApplicationEngine Sys.argv (Gui.player game) "gui.qml"
else
Ai.ai game
;;
| |
cb97ba04ca13f66b6689de4d5875a6e927459d289316676ba768c45c376affcc | tali713/mit-scheme | structures2.scm | ;;; -*- Scheme -*-
;;; More structures. With all this macro expansion, the compiler runs
out of space if they are all in one file .
(scc-define-structure Application%
UIObjInternals
%child-windows ; Locked list of all children
%%%code%%% ; Asynchronous code to be
; execut... | null | https://raw.githubusercontent.com/tali713/mit-scheme/6c703a838081fe2418bc0dbfe003bdb429d8c479/src/swat/scheme/structures2.scm | scheme | -*- Scheme -*-
More structures. With all this macro expansion, the compiler runs
Locked list of all children
Asynchronous code to be
executed when data arrives
from the display connection
Map from children of the interactor -- things it manages --
at the end of the file and maintain the correspondence
between... |
out of space if they are all in one file .
(scc-define-structure Application%
UIObjInternals
application-name
A SCXL - wrapped display
TKMainWindow
context)
(scc-define-structure Interactor%
UIObjInternals
handlers
to Sensitive - Surface data structures . These are implemented
(sensitive-surfac... |
c8722728a1859231d8a80f142aca48f7b08257278b55866733ca4de6145e349b | casperschipper/ocaml-cisp | tablepathsplitnew.ml |
let n_channels = 16
let () = Random.init 3
let readFile () =
let snd = Sndfile.read "/Users/casperschipper/Music/Null/12_channel_thunder.wav" in
let snd_n_channels = Sndfile.n_channels snd in
let array = Sndfile.to_seq snd 0 |> Cisp.drop (44100 * 0) |> Cisp.take (44100 * 1) |> Array.of_seq in
let n_samps... | null | https://raw.githubusercontent.com/casperschipper/ocaml-cisp/571ffb8e508c5427d01e407ba5e91ff2a4604f40/examples/tablepathsplitnew.ml | ocaml | Cisp.rangei 0 n_channels |> Seq.map (Sndfile.to_seq snd) |> List.of_seq |
let n_channels = 16
let () = Random.init 3
let readFile () =
let snd = Sndfile.read "/Users/casperschipper/Music/Null/12_channel_thunder.wav" in
let snd_n_channels = Sndfile.n_channels snd in
let array = Sndfile.to_seq snd 0 |> Cisp.drop (44100 * 0) |> Cisp.take (44100 * 1) |> Array.of_seq in
let n_samps... |
3c6f4b5d97b9a13686f801b0c4cfbb11901b8824162ecd6ad124d7b331008dc0 | cdepillabout/termonad | XML.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Termonad.XML where
import Termonad.Prelude
import Data.Default (def)
import Data.FileEmbed (embedFile)
import Text.XML (renderText)
import Text.XML.QQ (Document, xmlRaw)
-- TODO: A number of widgets have different places where a child can be added
-- (e.g... | null | https://raw.githubusercontent.com/cdepillabout/termonad/d0f8c9a1dc082aa3c2a56ed668914a2abeea86d3/src/Termonad/XML.hs | haskell | TODO: A number of widgets have different places where a child can be added
(e.g. tabs vs. page content in notebooks). This can be reflected in a UI
definition by specifying the “type” attribute on a <child> The possible
values for the “type” attribute are described in the sections describing the
widget-specific po... | # LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Termonad.XML where
import Termonad.Prelude
import Data.Default (def)
import Data.FileEmbed (embedFile)
import Text.XML (renderText)
import Text.XML.QQ (Document, xmlRaw)
interfaceDoc :: Document
interfaceDoc =
[xmlRaw|
<?xml version="1.0" encoding=... |
5a13b1cb593d95545669a10a9da529afb4694625f224e562cb455b51272304b4 | gojek/ziggurat | streams.clj | (ns ziggurat.streams
(:require [clojure.tools.logging :as log]
[mount.core :as mount :refer [defstate]]
[ziggurat.channel :as chl]
[ziggurat.config :refer [build-streams-config-properties get-in-config ziggurat-config]]
[ziggurat.header-transformer :as header-transforme... | null | https://raw.githubusercontent.com/gojek/ziggurat/baaee634fec3c60c12858c10ced8575797ebd555/src/ziggurat/streams.clj | clojure | (ns ziggurat.streams
(:require [clojure.tools.logging :as log]
[mount.core :as mount :refer [defstate]]
[ziggurat.channel :as chl]
[ziggurat.config :refer [build-streams-config-properties get-in-config ziggurat-config]]
[ziggurat.header-transformer :as header-transforme... | |
86cdfc6154f00ffec4ab4d4fad7e4da32ee6e2525fb2ea018caeb5964abeb49f | leo-zz-shuu/mfc | Combinator.hs | {-# LANGUAGE OverloadedStrings #-}
module Macaf.Scanner.Combinator where
import Control.Monad (void)
import Data.Char ()
import Data.String.Conversions ()
import Data.Text (Text)
import qualified Data.Text as T
... | null | https://raw.githubusercontent.com/leo-zz-shuu/mfc/4a9762727b87d079a914d2c5cd411a2e04a1982f/src/Macaf/Scanner/Combinator.hs | haskell | # LANGUAGE OverloadedStrings #
list of reserved keywords |
module Macaf.Scanner.Combinator where
import Control.Monad (void)
import Data.Char ()
import Data.String.Conversions ()
import Data.Text (Text)
import qualified Data.Text as T
import Data.Void ... |
99cda4a6b9bfc815b1b9fe54ac7092e9b49ee3eda7d3c47f81cb37f492188262 | ghc/packages-dph | Basics.hs | # LANGUAGE CPP #
#include "fusion-phases.h"
-- | Basic operations on parallel unlifted arrays.
module Data.Array.Parallel.Unlifted.Parallel.Basics
( emptyUP
, replicateUP
, repeatUP
, lengthUP
, nullUP
, interleaveUP
, indexedUP)
where
import Data.Array.Parallel... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-par/Data/Array/Parallel/Unlifted/Parallel/Basics.hs | haskell | | Basic operations on parallel unlifted arrays.
| O(1). Construct an empty array.
# INLINE_UP emptyUP #
| Yield an array where all elements contain the same value
| Repeat an array the given number of times.
# INLINE_UP repeatUP #
| O(1). Take the length of an array.
# INLINE_UP lengthUP #
| O(1). Test whether th... | # LANGUAGE CPP #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Parallel.Basics
( emptyUP
, replicateUP
, repeatUP
, lengthUP
, nullUP
, interleaveUP
, indexedUP)
where
import Data.Array.Parallel.Unlifted.Sequential.Vector as Seq
import Data.Arra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.