_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 |
|---|---|---|---|---|---|---|---|---|
75400084b120f792ba591555fb1edde6658dcff35ece6068be50ec6d51a897ad | stylefruits/rib | rib_slurp.erl | -module(rib_slurp).
-export([slurp_response/1]).
%% API
slurp_response({_, _, ""}) ->
undefined;
slurp_response({{_, _, _}, Headers, Body}) ->
Decoded = case content_encoding(Headers) of
<<"gzip">> -> zlib:gunzip(Body);
_ -> Body
end,
case hd(binary:split... | null | https://raw.githubusercontent.com/stylefruits/rib/12db75ac93eea8a432d61afb098d9b0410adbe7b/src/rib_slurp.erl | erlang | API
Implementation | -module(rib_slurp).
-export([slurp_response/1]).
slurp_response({_, _, ""}) ->
undefined;
slurp_response({{_, _, _}, Headers, Body}) ->
Decoded = case content_encoding(Headers) of
<<"gzip">> -> zlib:gunzip(Body);
_ -> Body
end,
case hd(binary:split(conten... |
7acd9078252a5306e300ad47940cb5f905282985e6e948edbcc7f30cfa2c2c43 | jrheard/voke | attack.cljs | (ns voke.system.attack
(:require [cljs.spec :as s]
[voke.clock :refer [now]]
[voke.entity :refer [projectile]]
[voke.state :refer [add-entity!]]
[voke.util :refer [bound-between]]))
(def maximum-entity-velocity-shot-speed-contribution 2)
(def things-all-projectiles-co... | null | https://raw.githubusercontent.com/jrheard/voke/15b272955d214ce0c531fb2b8d645feb217255c2/src/voke/system/attack.cljs | clojure | (Hopefully) the closest thing to a `(fire-missiles!)` call I'll ever write
System definition | (ns voke.system.attack
(:require [cljs.spec :as s]
[voke.clock :refer [now]]
[voke.entity :refer [projectile]]
[voke.state :refer [add-entity!]]
[voke.util :refer [bound-between]]))
(def maximum-entity-velocity-shot-speed-contribution 2)
(def things-all-projectiles-co... |
903b45d0aba32cf73de3c827f7557b63e260d6d24addcd23be52ed0e460d73aa | kaznum/programming_in_ocaml_exercise | makeset.ml | (* 問題文は IntSetと比較せよ、なっているが、だいぶ構造が違うので、MyIntSetが正しいのでは?*)
module = Set . Make (
struct
type t = int
let compare i j = i - j
end ) ; ;
open IntSet ; ;
let s1 = add 2 ( add 1 empty )
and s2 = add 1 ( add 3 empty ) ; ;
( mem 1 s1 , mem 2 s1 , mem 3 s1 ) ; ;
let s3 = inter s1 s2 in
( mem... | null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex11.1/makeset.ml | ocaml | 問題文は IntSetと比較せよ、なっているが、だいぶ構造が違うので、MyIntSetが正しいのでは?
IntSet' の内部で使用されるシグニチャのOrder.tの部分がOrderedInt'.tに置き換えられる。
しかし、以下の実行結果のとおり、OrderedInt'.tをintとして認識できない。
(OrderedType.tが隠蔽されているため、OrderedInt'.tも隠蔽されてしまう)
IntSet'' の内部で使用されるシグニチャのOrder.tの部分がOrderedInt''.tに置き換えられる |
module = Set . Make (
struct
type t = int
let compare i j = i - j
end ) ; ;
open IntSet ; ;
let s1 = add 2 ( add 1 empty )
and s2 = add 1 ( add 3 empty ) ; ;
( mem 1 s1 , mem 2 s1 , mem 3 s1 ) ; ;
let s3 = inter s1 s2 in
( mem 1 s3 , mem 2 s3 , mem 3 s3 ) ; ;
module IntSet = Set.M... |
e93650059f859331011553217b0066d552438777aceb297ab8ffd57b6e5bbdf6 | TaylanUB/scheme-srfis | 95.upstream.scm | ;;; "sort.scm" Defines: sorted?, merge, merge!, sort, sort!
Author : ( based on Prolog code by D.H.D.Warren )
Copyright ( C ) 2006 . All Rights Reserved .
;;; 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/TaylanUB/scheme-srfis/2d2b306e7a20a7155f639001a02b0870d5a3d3f7/srfi/95.upstream.scm | scheme | "sort.scm" Defines: sorted?, merge, merge!, sort, sort!
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
furnished to do so, subject to th... | Author : ( based on Prolog code by D.H.D.Warren )
Copyright ( C ) 2006 . All Rights Reserved .
deal in the Software without restriction , including without limitation the
sell copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
... |
1eb588f60dcfae0f4108ef06aaf8dbc2d97d5cd39ede07b2101e383337e3e509 | DaMSL/K3 | Annotations.hs | # LANGUAGE TupleSections , ScopedTypeVariables , FlexibleContexts , ConstraintKinds , DataKinds , TemplateHaskell #
{-|
This module contains functions for annotation types.
-}
module Language.K3.TypeSystem.Annotations
( freshenAnnotation
, instantiateAnnotation
, concatAnnTypes
, concatAnnBodies
, depolarize
, readA... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Annotations.hs | haskell | |
This module contains functions for annotation types.
|Freshens an annotation type. All variables appearing within the annotation
type are replaced by fresh equivalents. The provided @UID@ should identify
the node which caused this freshening operation. The result contains both
the freshened type as well ... | # LANGUAGE TupleSections , ScopedTypeVariables , FlexibleContexts , ConstraintKinds , DataKinds , TemplateHaskell #
module Language.K3.TypeSystem.Annotations
( freshenAnnotation
, instantiateAnnotation
, concatAnnTypes
, concatAnnBodies
, depolarize
, readAnnotationSpecialParameters
, depolarizeOrError
, module Langua... |
0b395330c616d6709338ea4da96375a8044cc48dafec3664c67567e5997434c9 | ucsd-progsys/dsolve | reltuple.ml | let test pr =
match pr with
| (a, b) ->
assert(a < b)
let x = 1
let y = 2
let p = (x, y)
let _ = test p
| null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/reltuple.ml | ocaml | let test pr =
match pr with
| (a, b) ->
assert(a < b)
let x = 1
let y = 2
let p = (x, y)
let _ = test p
| |
9b4c16f0d220f6fd5cb59c2481c7a6cbc6783d76b5b72685d547533cf224547f | haskell/containers | SetOperations-IntSet.hs | module Main where
import Data.IntSet as C
import SetOperations
main = benchmark fromList True [("union", C.union), ("difference", C.difference), ("intersection", C.intersection)]
| null | https://raw.githubusercontent.com/haskell/containers/7fb91ca53b1aca7c077b36a0c1f8f785d177da34/containers-tests/benchmarks/SetOperations/SetOperations-IntSet.hs | haskell | module Main where
import Data.IntSet as C
import SetOperations
main = benchmark fromList True [("union", C.union), ("difference", C.difference), ("intersection", C.intersection)]
| |
f2e82d123cc2e13f0ebe6ea2377deb08f7492d272c2b3cdda45d42001ebd19e5 | KarolS/HaskellChess | Main.hs | #include "common.h"
module Main (main) where
import Chess
import Ai
import IterDeep
import Data.Word
import Data.Array.Base
import Data.Maybe
import Control.Monad hiding (forM_)
import System.IO
import UCI
import Utils
import Control.Concurrent
import Data.IORef
import Uci2Chess
import Data.List
import Data.Foldable h... | null | https://raw.githubusercontent.com/KarolS/HaskellChess/db1b41c4858159dc6487d1a063810bdbc270ee87/src/Main.hs | haskell | #include "common.h"
module Main (main) where
import Chess
import Ai
import IterDeep
import Data.Word
import Data.Array.Base
import Data.Maybe
import Control.Monad hiding (forM_)
import System.IO
import UCI
import Utils
import Control.Concurrent
import Data.IORef
import Uci2Chess
import Data.List
import Data.Foldable h... | |
3c5911786ac27023eb78104d3ced8066ba9c9f2486317a228848efc2ba76ce40 | BitGameEN/bitgamex | gproc_dist.erl | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/gproc/src/gproc_dist.erl | erlang | compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved via the world wide web at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
u... | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Initial Developer of the Original Code is Ericsson Utvecklings AB .
Portions created by Eri... |
027ef92d278ea06696294da90ee356db9b043d65fa8da1b9ff0cca77d28757a5 | hanshuebner/vlm | imacjosh.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : ALPHA - AXP - INTERNALS ; Base : 10 ; Lowercase : T -*-
(in-package "ALPHA-AXP-INTERNALS")
Macros in support of AI instructions . These are mostly in ifunjosh.as
(defmacro get-structure-stack-pointer (to)
`((LDQ ,to PROCESSORSTATE_BAR2 (ivory))))
(defmac... | null | https://raw.githubusercontent.com/hanshuebner/vlm/20510ddc98b52252a406012a50a4d3bbd1b75dd0/alpha-emulator/imacjosh.lisp | lisp | Syntax : Common - Lisp ; Package : ALPHA - AXP - INTERNALS ; Base : 10 ; Lowercase : T -*-
bind-location (location data)
unless choice-pointer < location <= stackpointer
or structure-stack-choice-pointer < location <= structure-stackpointer
read(location %memory-scavenge) => X (the old contents of location)
... |
(in-package "ALPHA-AXP-INTERNALS")
Macros in support of AI instructions . These are mostly in ifunjosh.as
(defmacro get-structure-stack-pointer (to)
`((LDQ ,to PROCESSORSTATE_BAR2 (ivory))))
(defmacro set-structure-stack-pointer (to)
`((STQ ,to PROCESSORSTATE_BAR2 (ivory))))
(defmacro get-structure-stack-... |
8000043f672b5648d11b4f3cac212dca911211eddd183335e6a5482c803b4c2c | evturn/haskellbook | 17.05-lookups.hs | import Data.List (elemIndex)
Use the following terms to make the expressions :
1 . ` pure `
2 . ` < $ > `
3 . ` < * > `
--
-----------------------------------------------------------------------------
1 .
added :: Maybe Integer
added = pure (+3) <*> (lookup 3 $ zip [1, 2, 3] [4, 5, 6])
----------... | null | https://raw.githubusercontent.com/evturn/haskellbook/3d310d0ddd4221ffc5b9fd7ec6476b2a0731274a/17/17.05-lookups.hs | haskell |
---------------------------------------------------------------------------
---------------------------------------------------------------------------
---------------------------------------------------------------------------
--------------------------------------------------------------------------- | import Data.List (elemIndex)
Use the following terms to make the expressions :
1 . ` pure `
2 . ` < $ > `
3 . ` < * > `
1 .
added :: Maybe Integer
added = pure (+3) <*> (lookup 3 $ zip [1, 2, 3] [4, 5, 6])
2 .
y :: Maybe Integer
y = lookup 2 $ zip [1, 2, 3] [4, 5, 6]
z :: Maybe Integer
z = loo... |
7b07f832d189214dc7ba015a206183a1f96598c973c621db9f3ee66a819e6fdf | schemeorg-community/index.scheme.org | gerbil.scm | (
;; r7rs small
((scheme base) . #t)
((scheme case-lambda) . #t)
((scheme complex) . #t)
((scheme char) . #t)
((scheme cxr) . #t)
((scheme eval) . #t)
((scheme file) . #t)
((scheme inexact) . #t)
((scheme lazy) . #t)
((scheme load) . #t)
((scheme process-context) . #t)
((scheme r5rs) . #t)
(... | null | https://raw.githubusercontent.com/schemeorg-community/index.scheme.org/32e1afcfe423a158ac8ce014f5c0b8399d12a1ea/filters/gerbil.scm | scheme | r7rs small
r7rs large red
r7rs large tangerine
| (
((scheme base) . #t)
((scheme case-lambda) . #t)
((scheme complex) . #t)
((scheme char) . #t)
((scheme cxr) . #t)
((scheme eval) . #t)
((scheme file) . #t)
((scheme inexact) . #t)
((scheme lazy) . #t)
((scheme load) . #t)
((scheme process-context) . #t)
((scheme r5rs) . #t)
((scheme read) . ... |
a51d46472938ea228521bc18d72383da1f54f6f69b5cfb405a77cf2d2948adea | falsetru/htdp | 27.1.1.scm | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-advanced-reader.ss" "lang")((modname 27.1.1) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/27/27.1.1.scm | scheme | about the language level of this file in a form that our tools can easily process. | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-advanced-reader.ss" "lang")((modname 27.1.1) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ((lib "draw.ss" "teachpack" "htdp")))))
... |
919354032d88c695de20122c789e945ab91f72609b25227dcab7fa40bb3f54e1 | bmeurer/ocamljit2 | recvalues.ml | (* Recursive value definitions *)
let _ =
let rec x = 1 :: x in
if match x with
1 :: x' -> x == x'
| _ -> false
then print_string "Test 1: passed\n"
else print_string "Test 1: FAILED\n";
let one = 1 in
let rec y = (one, one+1) :: y in
if match y with
(1,2) :: y' -> y == y'
| _ -... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/testsuite/tests/basic/recvalues.ml | ocaml | Recursive value definitions
Trash the minor generation |
let _ =
let rec x = 1 :: x in
if match x with
1 :: x' -> x == x'
| _ -> false
then print_string "Test 1: passed\n"
else print_string "Test 1: FAILED\n";
let one = 1 in
let rec y = (one, one+1) :: y in
if match y with
(1,2) :: y' -> y == y'
| _ -> false
then print_string "Test ... |
7ffa54c60dec52a0395d9ab2f230b6b1ce48a68df22fb18786549b3ae3bd5803 | stoeffel/elmi-to-json | Task.hs | {-# LANGUAGE Rank2Types #-}
module Reporting.Task
( Task,
run,
throw,
mapError,
--
io,
mio,
eio,
)
where
-- TASKS
newtype Task x a
= Task
( forall result. (a -> IO result) -> (x -> IO result) -> IO result
)
run :: Task x a -> IO (Either x a)
run (Task task) =
task (re... | null | https://raw.githubusercontent.com/stoeffel/elmi-to-json/ae40d1aa1e3d6878f2af514e611d44890e7abc1e/types-from-compiler/Reporting/Task.hs | haskell | # LANGUAGE Rank2Types #
TASKS
IO
INSTANCES
# INLINE (<*>) #
# INLINE (>>=) # |
module Reporting.Task
( Task,
run,
throw,
mapError,
io,
mio,
eio,
)
where
newtype Task x a
= Task
( forall result. (a -> IO result) -> (x -> IO result) -> IO result
)
run :: Task x a -> IO (Either x a)
run (Task task) =
task (return . Right) (return . Left)
throw :: x ->... |
1f75fe734f7a4085db4410cdd1b3511ff53d857d449d9687bc1fde168e896341 | Beluga-lang/Beluga | apply.ml | module type APPLY = sig
type 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val ( <&> ) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val ( <& ) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val ( &> ) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) ... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/4d1c1bd917daac43c304c527b155c12dba76391a/src/support/apply.ml | ocaml | module type APPLY = sig
type 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val ( <&> ) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val ( <& ) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val ( &> ) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) ... | |
c6d6e6ab476e43bc371aec09e915cf86602fe4b372adfe8816badae86c2e743b | javgh/bridgewalker | ResetPAS.hs | {-# LANGUAGE OverloadedStrings #-}
module Tools.CreateDB where
import Control.Monad
import Database.PostgreSQL.Simple
import Data.Serialize
import qualified Data.ByteString as B
import qualified Data.ByteString.Base64 as B64
import PendingActionsTracker
myConnectInfo :: B.ByteString
myConnectInfo = "dbname=bridgewa... | null | https://raw.githubusercontent.com/javgh/bridgewalker/ec5a62e6ebf36e52b98996a00a7d6042cc22ead7/src/Tools/ResetPAS.hs | haskell | # LANGUAGE OverloadedStrings # | module Tools.CreateDB where
import Control.Monad
import Database.PostgreSQL.Simple
import Data.Serialize
import qualified Data.ByteString as B
import qualified Data.ByteString.Base64 as B64
import PendingActionsTracker
myConnectInfo :: B.ByteString
myConnectInfo = "dbname=bridgewalker"
resetPendingActionsState :: ... |
c4bd18deab288c433ea3f296e9503c4e822845579010be5dab8090ef661bfa59 | joelburget/easytest | Internal.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE Rank2Types #
-- |
-- Module : EasyTest.Internal
Copyright : ( c ) , 2018 - 2019
License : MIT
-- Maintainer :
-- Stability : experimental
--
-- This module defines the core internals and interface of easytest.
m... | null | https://raw.githubusercontent.com/joelburget/easytest/4f39e8897dd6df6bd5733cf8337a1fff1209c0ca/src/EasyTest/Internal.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : EasyTest.Internal
Maintainer :
Stability : experimental
This module defines the core internals and interface of easytest.
* Structuring tests
* Assertions for unit tests
* Running tests
* Bracketed tests (requiring setup / teardown)
* Internal
* Hedgehog re... | # LANGUAGE LambdaCase #
# LANGUAGE Rank2Types #
Copyright : ( c ) , 2018 - 2019
License : MIT
module EasyTest.Internal
(
tests
, scope
, skip
, example
, unitTest
, property
, propertyWith
, matches
, doesn'tMatch
, pending
, crash
, run
, runOnly
, rerun
... |
8fb611ba9af2ce8fe52c9bcae086da07c698453b623d9a2fd2db0fec78872fcf | arttuka/reagent-material-ui | badge.cljs | (ns reagent-mui.material.badge
"Imports @mui/material/Badge as a Reagent component.
Original documentation is at -ui/api/badge/ ."
(:require [reagent.core :as r]
["@mui/material/Badge" :as MuiBadge]))
(def badge (r/adapt-react-class (.-default MuiBadge)))
| null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/core/reagent_mui/material/badge.cljs | clojure | (ns reagent-mui.material.badge
"Imports @mui/material/Badge as a Reagent component.
Original documentation is at -ui/api/badge/ ."
(:require [reagent.core :as r]
["@mui/material/Badge" :as MuiBadge]))
(def badge (r/adapt-react-class (.-default MuiBadge)))
| |
9402b4b0cc561ddbd244307a1105c036c48f36fe1cbed7405d2d5c2a872774b5 | zkincaid/duet | worklist.ml | (** Round-robin worklist *)
module MakeRR (S : Set.OrderedType) : sig
type t
val empty : t
val add : S.t -> t -> t
val singleton : S.t -> t
val pick : t -> (S.t * t) option
val fix : (S.t -> t) -> t -> unit
val cat : t -> t -> t
end = struct
module Set = Set.Make(S)
type t = { front : S.t list;
... | null | https://raw.githubusercontent.com/zkincaid/duet/eb3dbfe6c51d5e1a11cb39ab8f70584aaaa309f9/duet/worklist.ml | ocaml | * Round-robin worklist | module MakeRR (S : Set.OrderedType) : sig
type t
val empty : t
val add : S.t -> t -> t
val singleton : S.t -> t
val pick : t -> (S.t * t) option
val fix : (S.t -> t) -> t -> unit
val cat : t -> t -> t
end = struct
module Set = Set.Make(S)
type t = { front : S.t list;
back : S.t list;
... |
69315c1b93243b044cd1ac3a5eaed035cd6a4827712bb3d9774475b273566ddd | oakmac/snowflake-css | filesystem_helpers.cljs | (ns snowflake-css.lib.filesystem-helpers
(:require
["fs-plus" :as fs]
["glob" :as glob]
[clojure.set :as set]
[taoensso.timbre :as timbre]))
(defn file-exists? [filename]
(.isFileSync fs filename))
(defn read-file-sync! [filename]
(.readFileSync fs filename "utf8"))
(defn write-file-sync! [file... | null | https://raw.githubusercontent.com/oakmac/snowflake-css/e6e19c6a9e4686e0abccdf3bd0d1b1866eb6ee5a/src-cljs/snowflake_css/lib/filesystem_helpers.cljs | clojure | (ns snowflake-css.lib.filesystem-helpers
(:require
["fs-plus" :as fs]
["glob" :as glob]
[clojure.set :as set]
[taoensso.timbre :as timbre]))
(defn file-exists? [filename]
(.isFileSync fs filename))
(defn read-file-sync! [filename]
(.readFileSync fs filename "utf8"))
(defn write-file-sync! [file... | |
e6fd7bb567235bf5b8fb7e60fcc41fe918c3f848be02f47e90432be7c742585e | Atry/Control.Dsl | Yield.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE RebindableSyntax #
# LANGUAGE TypeOperators #
|
Description : Generators
This module contains the ' Yield ' data type and related ' Dsl ' instances .
The ' Yield ' data type can be used to create generators , ... | null | https://raw.githubusercontent.com/Atry/Control.Dsl/f19da265c8ea537af95e448e6107fa503d5363c2/src/Control/Dsl/Yield.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE RebindableSyntax #
# LANGUAGE TypeOperators #
|
Description : Generators
This module contains the ' Yield ' data type and related ' Dsl ' instances .
The ' Yield ' data type can be used to create generators ,
similar to the @yield... |
0d20802713aef2e654e6414865264bf050456d5d7fe093240931579cb217f8ce | luc-tielen/eclair-lang | Literal.hs | module Eclair.Common.Literal
( Literal(..)
) where
import Prettyprinter (Pretty (pretty))
data Literal
= LNumber Word32
| LString Text
deriving (Eq, Show)
instance Pretty Literal where
pretty = \case
LNumber x -> pretty x
LString x -> pretty x
| null | https://raw.githubusercontent.com/luc-tielen/eclair-lang/ffdca3f8768002105d5dae9c2d7b2e5baee8ff4e/lib/Eclair/Common/Literal.hs | haskell | module Eclair.Common.Literal
( Literal(..)
) where
import Prettyprinter (Pretty (pretty))
data Literal
= LNumber Word32
| LString Text
deriving (Eq, Show)
instance Pretty Literal where
pretty = \case
LNumber x -> pretty x
LString x -> pretty x
| |
50bd3e95cd547d96ca84a35583dbcc8db02782e168e633ef9ffb2e14455a8804 | travisbrady/flajolet | sbitmap_stdin.ml | open Core.Std
open Printf
let test_stdin () =
let sb = Sbitmap.create 1_000_000 0.03 42 in
let lines = In_channel.input_lines stdin in
let words = List.concat_map lines ~f:(fun x -> String.split x ~on:' ') in
List.iter words ~f:(fun x -> Sbitmap.add sb x);
let card = Sbitmap.estimate sb in
le... | null | https://raw.githubusercontent.com/travisbrady/flajolet/a6c530bf1dd73b9fa8b7185d84a5e20458a3d8af/examples/sbitmap_stdin.ml | ocaml | open Core.Std
open Printf
let test_stdin () =
let sb = Sbitmap.create 1_000_000 0.03 42 in
let lines = In_channel.input_lines stdin in
let words = List.concat_map lines ~f:(fun x -> String.split x ~on:' ') in
List.iter words ~f:(fun x -> Sbitmap.add sb x);
let card = Sbitmap.estimate sb in
le... | |
1b2a68b53a2dc6dfc547099e70a3f8a321d672e081f14ab4da9cbd4af42bd99d | 1Computer1/myriad | Myriad.hs | module Myriad
( runMyriadServer
) where
import Control.Monad.Logger (runStdoutLoggingT)
import Data.String.Conversions
import Network.Wai.Handler.Warp
import Optics
import Myriad.Core
import Myriad.Docker
import Myriad.Server
runMyriadServer :: FilePath -> FilePath -> IO ()
runMyriadServer configPath lang... | null | https://raw.githubusercontent.com/1Computer1/myriad/659846222796ed3e62a653e4d4dc74daf845d8f4/src/Myriad.hs | haskell | module Myriad
( runMyriadServer
) where
import Control.Monad.Logger (runStdoutLoggingT)
import Data.String.Conversions
import Network.Wai.Handler.Warp
import Optics
import Myriad.Core
import Myriad.Docker
import Myriad.Server
runMyriadServer :: FilePath -> FilePath -> IO ()
runMyriadServer configPath lang... | |
23a85057cb251f873bf9989e3fe7cd99779c694679758df1a965d8682802db93 | techascent/tech.ml.dataset | nippy.clj | (ns taoensso.nippy)
(defmacro extend-freeze
[dt _kwd argvec & code]
(let [[buf-var out-var] argvec]
`(let [~buf-var 1
~out-var 2]
(type ~dt)
~@code)))
(defmacro extend-thaw
[_kwd argvec & code]
(let [invar (first argvec)]
`(let [~invar 1]
~@code)))
| null | https://raw.githubusercontent.com/techascent/tech.ml.dataset/f9b3666b394d8b6f80924696b02b0f8176e96a96/.clj-kondo/cnuernber/dtype-next/taoensso/nippy.clj | clojure | (ns taoensso.nippy)
(defmacro extend-freeze
[dt _kwd argvec & code]
(let [[buf-var out-var] argvec]
`(let [~buf-var 1
~out-var 2]
(type ~dt)
~@code)))
(defmacro extend-thaw
[_kwd argvec & code]
(let [invar (first argvec)]
`(let [~invar 1]
~@code)))
| |
52b5483703391e39e9e99f558cba7c913dfe2c96221572d13576d7f158f9d5d2 | kmi/irs | compat.lisp | Copyright ® 2009 The Open University
Dummy definitions for things that are available only on Lispworks
;;; AND required at compile time.
(eval-when (:compile-toplevel :load-toplevel)
(defmacro fake-func (name)
`(defun ,name (&rest rest)
(declare (ignore rest))
(error "Fake function ‘~A’ called... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/src/webonto/compat.lisp | lisp | AND required at compile time. | Copyright ® 2009 The Open University
Dummy definitions for things that are available only on Lispworks
(eval-when (:compile-toplevel :load-toplevel)
(defmacro fake-func (name)
`(defun ,name (&rest rest)
(declare (ignore rest))
(error "Fake function ‘~A’ called." ',name)))
(defmacro fake-macr... |
8a2a72d72149932672ea82ff45dc74e4cc8a059961d7541813dccb4166e78f3a | REPROSEC/dolev-yao-star | Vale_Inline_X64_Fsqr_inline.ml | open Prims
type uint64 = FStar_UInt64.t
let as_t : 'a . 'a -> 'a = fun x -> x
let as_normal_t : 'a . 'a -> 'a = fun x -> x
type b64 = (unit, unit) Vale_Interop_Base.buf_t
let (t64_mod : Vale_Interop_Base.td) =
Vale_Interop_Base.TD_Buffer
(Vale_Arch_HeapTypes_s.TUInt64, Vale_Arch_HeapTypes_s.TUInt64,
Vale_In... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Vale_Inline_X64_Fsqr_inline.ml | ocaml | open Prims
type uint64 = FStar_UInt64.t
let as_t : 'a . 'a -> 'a = fun x -> x
let as_normal_t : 'a . 'a -> 'a = fun x -> x
type b64 = (unit, unit) Vale_Interop_Base.buf_t
let (t64_mod : Vale_Interop_Base.td) =
Vale_Interop_Base.TD_Buffer
(Vale_Arch_HeapTypes_s.TUInt64, Vale_Arch_HeapTypes_s.TUInt64,
Vale_In... | |
19c6ff65a7af709eef3211de641ed6117d90eb75c886fee4b1f92b6273a737ce | UU-ComputerScience/shuffle | Shuffle.hs | -------------------------------------------------------------------------
-- Main
-------------------------------------------------------------------------
module UHC.Shuffle (
shuffleMain,
shuffleCompile,
getDeps,
FPathWithAlias,
Opts,
defaultOpts,
parseOpts ) where
import qualified Data.Set as ... | null | https://raw.githubusercontent.com/UU-ComputerScience/shuffle/435b19f1e13af07c4c0e4fd30ebf6a7c1e2e6979/src/UHC/Shuffle.hs | haskell | -----------------------------------------------------------------------
Main
-----------------------------------------------------------------------
-----------------------------------------------------------------------
main
-----------------------------------------------------------------------
from options
share... |
module UHC.Shuffle (
shuffleMain,
shuffleCompile,
getDeps,
FPathWithAlias,
Opts,
defaultOpts,
parseOpts ) where
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Map(Map)
import Data.Set(Set)
import System.Exit
import System.Envi... |
8e72c9ec8658a853d4aaee52a04a8490940d6379895865ce9021fe78cda19fbb | manavpatnaik/haskell | 1_max.hs | Basically all functions in take only 1 parameter
So all functions that need 2 params are curried
Currying is basically returning a function from a function
-- Takes a num and returns a function
maxNums :: (Ord a) => a -> (a -> a)
maxNums a b
| a > b = a
| otherwise = b
main = do
print(maxNums 2 4... | null | https://raw.githubusercontent.com/manavpatnaik/haskell/ff781bc6bdbf790f649a71e228e44ea41d1c4805/curried_functions/1_max.hs | haskell | Takes a num and returns a function | Basically all functions in take only 1 parameter
So all functions that need 2 params are curried
Currying is basically returning a function from a function
maxNums :: (Ord a) => a -> (a -> a)
maxNums a b
| a > b = a
| otherwise = b
main = do
print(maxNums 2 4)
print(maxNums 2 5) |
465fbca886a27a58ab737d36037e721e360fa8c1bf6173226d55900aed15bf71 | semilin/layoup | Vitrimak.lisp |
(MAKE-LAYOUT :NAME "Vitrimak" :MATRIX
(APPLY #'KEY-MATRIX '("tkvumiajbr" "wx/fpdgq,s" "h.'colnzye"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/Vitrimak.lisp | lisp |
(MAKE-LAYOUT :NAME "Vitrimak" :MATRIX
(APPLY #'KEY-MATRIX '("tkvumiajbr" "wx/fpdgq,s" "h.'colnzye"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
630e0cbe0714a8f83db27bea2bee644d08183b2b0856d1a1dcd77a4a2d7a9df2 | noinia/hgeometry | Minimal.hs | # LANGUAGE OverloadedStrings #
# LANGUAGE UndecidableInstances #
module App.Minimal where
import Control.Concurrent (threadDelay)
import Control.Monad (forM, guard, void)
import Control.Monad.Reader (MonadReader (..), runReaderT)
import Reflex
import Re... | null | https://raw.githubusercontent.com/noinia/hgeometry/a6abecb1ce4a7fd96b25cc1a5c65cd4257ecde7a/hgeometry-interactive/src/App/Minimal.hs | haskell | ------------------------------------------------------------------------------
| An axis aligned bounding box.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Convert a mouse button motion to color.
-------... | # LANGUAGE OverloadedStrings #
# LANGUAGE UndecidableInstances #
module App.Minimal where
import Control.Concurrent (threadDelay)
import Control.Monad (forM, guard, void)
import Control.Monad.Reader (MonadReader (..), runReaderT)
import Reflex
import Re... |
a13cb886ddf463e663bf8292bbcbbe7f24eb6c21e6c56f2e13941d0c36631b4b | ninenines/farwest_demo | fwd_system_r.erl | Copyright ( c ) 2019 , < >
-module(fwd_system_r).
-export([describe/0]).
-export([locate/1]).
-export([links/1]).
-export([get/1]).
-export([to_representation/3]).
describe() -> #{
uri => "/",
media_types => #{
html => ["text/html"],
bed => ["application/x-bed"]
},
operations => #{
get => #{output => ... | null | https://raw.githubusercontent.com/ninenines/farwest_demo/a95e70b78ebc4c5e3aea75a87bedd9f85b002c7c/src/fwd_system_r.erl | erlang | All bytes.
ms.
bytes.
bytes. | Copyright ( c ) 2019 , < >
-module(fwd_system_r).
-export([describe/0]).
-export([locate/1]).
-export([links/1]).
-export([get/1]).
-export([to_representation/3]).
describe() -> #{
uri => "/",
media_types => #{
html => ["text/html"],
bed => ["application/x-bed"]
},
operations => #{
get => #{output => ... |
7707f9687c782723447fdf1f22628e03638fe1161dfd1d90985df0d9675f8d80 | sebferre/sparklis | ontology.ml |
Copyright 2013 , IRISA , Université de Rennes 1 ,
This file is part of Sparklis .
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 requ... | null | https://raw.githubusercontent.com/sebferre/sparklis/b1b4266f55a9eaccc828dd9e5088fa197aae194c/ontology.ml | ocaml | ontological relations
default void hierarchy
SPARQL-based relations
some endpoints do not include ?image when no binding at all (in OPTIONAL)
recording absence of image
SPARQL-based relation, computed at once
SPARQL vars
to avoid lengthy queries
SPARQL vars
SPARQL-based relation, retrieving data from... |
Copyright 2013 , IRISA , Université de Rennes 1 ,
This file is part of Sparklis .
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 requ... |
3dcc2618120f3c9a574b12b39a767f63f84d8092726291160fe9f749812aba2d | acarrico/wayland-protocol | errno.rkt | #lang typed/racket/base
(provide (struct-out errno)
Errno
get-errno)
(require/typed ffi/unsafe
(saved-errno (-> Integer)))
(require/typed wayland-0/generated/libc
(strerror (-> Integer String)))
(struct errno
((errno : Integer)
(errstr : String))
#:type-name Errno
#:transparent)
(: g... | null | https://raw.githubusercontent.com/acarrico/wayland-protocol/7270ae8f420c8062466c230e7cf3fe5331fe9fbd/typed/wayland-0/errno.rkt | racket | #lang typed/racket/base
(provide (struct-out errno)
Errno
get-errno)
(require/typed ffi/unsafe
(saved-errno (-> Integer)))
(require/typed wayland-0/generated/libc
(strerror (-> Integer String)))
(struct errno
((errno : Integer)
(errstr : String))
#:type-name Errno
#:transparent)
(: g... | |
ac58119c34e389f7f714dc1858315d4cc9f4e1a970d20ab4bd8e2825c5313f6f | GregorySchwartz/too-many-cells | Types.hs | TooManyCells . Differential . Types
Collects the differental types used in the program .
Gregory W. Schwartz
Collects the differental types used in the program.
-}
{-# LANGUAGE StrictData #-}
module TooManyCells.Differential.Types where
-- Remote
import BirchBeer.Types
import qualified Data.Graph.Induct... | null | https://raw.githubusercontent.com/GregorySchwartz/too-many-cells/358391c358006e8728beb57c3947fef91ce8ca66/src/TooManyCells/Differential/Types.hs | haskell | # LANGUAGE StrictData #
Remote
Local
Basic | TooManyCells . Differential . Types
Collects the differental types used in the program .
Gregory W. Schwartz
Collects the differental types used in the program.
-}
module TooManyCells.Differential.Types where
import BirchBeer.Types
import qualified Data.Graph.Inductive as G
import qualified Data.Set as ... |
fccf79dbad76cb9c45244a97d2352a0475ba53d87f20100638ad7d7a5dc263d4 | ocaml/ocamlbuild | internal.ml | #use "internal_test_header.ml";;
let () = test "BasicNativeTree"
~options:[`no_ocamlfind]
~description:"Output tree for native compilation"
~requirements:ocamlopt_available
~tree:[T.f "dummy.ml"]
~matching:[M.Exact
(_build
(M.lf
["_digests";
... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/03ad846e21f9a2eac149204c9745b52f1dc800f5/testsuite/internal.ml | ocaml | using ocamlc would fail
will make hygiene fail if must_ignore/ is checked
will make hygiene fail if must_ignore/ is checked
will make hygiene fail if must_ignore/ is checked
if the plugin were executed we'd get "foo" in failing_msg
we check that the target is *not* built | #use "internal_test_header.ml";;
let () = test "BasicNativeTree"
~options:[`no_ocamlfind]
~description:"Output tree for native compilation"
~requirements:ocamlopt_available
~tree:[T.f "dummy.ml"]
~matching:[M.Exact
(_build
(M.lf
["_digests";
... |
f4d8a00674d6d5ee2423c7be3ab088af5858fd3a75460bb2a9d821d17afa9a44 | hkoktay/the-little-schemer | chapter10.scm | Chapter 10 : What Is the Value of All of This ?
;;
;; An [entry] is a
;; - [pairof [set] list]
;;
;; A [table] is a
- [ listof entry ]
;;
;; A [closure] is
;; - (list non-primitive (list [table] list any))
(load "test-check.scm")
;; atom?: any -> boolean
(define atom?
(lambda (x)
(and (not (pair? x)) (not (... | null | https://raw.githubusercontent.com/hkoktay/the-little-schemer/007e25153a4721a0cd6007c83cc8ce1305f6cf2a/chapter10.scm | scheme |
An [entry] is a
- [pairof [set] list]
A [table] is a
A [closure] is
- (list non-primitive (list [table] list any))
atom?: any -> boolean
add1: number -> number
build: [s-exp] [s-exp] -> [pair]
new-entry: [s-exp] [s-exp] -> [pair]
lookup-in-entry-help: symbol [set] list fun -> any | void
lookup-in-entry: s... | Chapter 10 : What Is the Value of All of This ?
- [ listof entry ]
(load "test-check.scm")
(define atom?
(lambda (x)
(and (not (pair? x)) (not (null? x)))))
(define add1
(lambda (n)
(+ n 1)))
first : [ pair ] - > [ s - exp ]
Page 119
(define first
(lambda (p)
(car p)))
(test "first"
... |
5406868202ebd0c2e9f7fa32d746eb8173290ba6ab4d453cee8bbbc012fea578 | FBoisson/Camllight | frx_font.ml | #open "tk";;
#open "support";;
let version = "$Id: frx_font.ml,v 1.3 1996/05/24 15:21:44 rouaix Exp $"
;;
* Finding fonts . Inspired by code in by .
* Possibly bogus because some families use " i " for italic where others
* use " o " .
* wght : bold , medium
* slant : i , o , r
* pxlsz : 8 , 10 ... | null | https://raw.githubusercontent.com/FBoisson/Camllight/2e6d5ec31f93ec53d11232b7b2498adc719a8b13/contrib/camltk4/frx/frx_font.ml | ocaml | #open "tk";;
#open "support";;
let version = "$Id: frx_font.ml,v 1.3 1996/05/24 15:21:44 rouaix Exp $"
;;
* Finding fonts . Inspired by code in by .
* Possibly bogus because some families use " i " for italic where others
* use " o " .
* wght : bold , medium
* slant : i , o , r
* pxlsz : 8 , 10 ... | |
28697ccd8f2307decec99e39b8e5e618219c0b4c7cc3adf339e33997e3d01cad | exercism/babashka | beer_song_test.clj | (ns beer-song-test
(:require [clojure.test :refer [deftest is]]
beer-song))
(def verse-8
(str "8 bottles of beer on the wall, 8 bottles of beer.\n"
"Take one down and pass it around, 7 bottles of beer on the wall.\n"))
(def verse-2
(str "2 bottles of beer on the wall, 2 bottles of beer.\n"
... | null | https://raw.githubusercontent.com/exercism/babashka/707356c52e08490e66cb1b2e63e4f4439d91cf08/exercises/practice/beer-song/test/beer_song_test.clj | clojure | (ns beer-song-test
(:require [clojure.test :refer [deftest is]]
beer-song))
(def verse-8
(str "8 bottles of beer on the wall, 8 bottles of beer.\n"
"Take one down and pass it around, 7 bottles of beer on the wall.\n"))
(def verse-2
(str "2 bottles of beer on the wall, 2 bottles of beer.\n"
... | |
4b2bb6a006bafb21c4a1c9bdf11296f2e1d3cb40520c97697b8f504df9ecdd15 | facebook/flow | flow_ast_differ_test.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/3087a6613a614e5a08f1fe2a7cb2b65edd07fff8/src/parser_utils/__tests__/flow_ast_differ_test.ml | ocaml | if self_closing changed from true to false, construct a closing element
TODO: add test for RegExp case?
Extract columns from the locs
It is mandatory to insert the parens here
"This is sentence one."
use an unrelated mapper to ensure enums are not affected
use an unrelated mapper to ensure enums are not affe... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
265ee84620de439ae186a71be7fad92451c25d0df745dbc5ed1fa7ae28ae5076 | ztellman/penumbra | project.clj | (defproject penumbra "0.6.1"
:description "An idiomatic wrapper for OpenGL"
:dependencies [[slick-util "1.0.0"]
[cantor "0.3.0"]
[org.clojure/clojure "1.8.0"]
[org.clojure/math.combinatorics "0.1.3"]
; [org.clojure/clojure-contrib "1.2.0"]
... | null | https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/project.clj | clojure | [org.clojure/clojure-contrib "1.2.0"]
:dev-dependencies [[swank-clojure "1.3.0"]] | (defproject penumbra "0.6.1"
:description "An idiomatic wrapper for OpenGL"
:dependencies [[slick-util "1.0.0"]
[cantor "0.3.0"]
[org.clojure/clojure "1.8.0"]
[org.clojure/math.combinatorics "0.1.3"]
[org.clojars.charles-stain/lwjgl "3.0"]
... |
4f982db5842dcfd3719126cbcd9290a1779bacfb9b2d230669041069a8ffa029 | binaryage/cljs-oops | core.clj | (ns oops.core
"Public macros to be consumed via core.cljs."
(:require [clojure.spec.alpha :as s]
[oops.codegen :refer [gen-oget gen-oset gen-ocall gen-oapply]]
[oops.compiler :refer [with-compiler-context! with-suppressed-reporting!]]))
; -- core macros -------------------------------------... | null | https://raw.githubusercontent.com/binaryage/cljs-oops/a2b48d59047c28decb0d6334e2debbf21848e29c/src/lib/oops/core.clj | clojure | -- core macros ------------------------------------------------------------------------------------------------------------
-- convenience macros -----------------------------------------------------------------------------------------------------
-- convenience g-macros ---------------------------------------------... | (ns oops.core
"Public macros to be consumed via core.cljs."
(:require [clojure.spec.alpha :as s]
[oops.codegen :refer [gen-oget gen-oset gen-ocall gen-oapply]]
[oops.compiler :refer [with-compiler-context! with-suppressed-reporting!]]))
(defmacro oget [obj & selector]
(with-compiler-cont... |
164c0c1a645b11bc7fc8238a63f9bcf955daa6b5ad429a61bb233316adf4f067 | hercules-ci/hercules-ci-agent | DerivationInput.hs | {-# LANGUAGE DeriveAnyClass #-}
module Hercules.API.Build.DerivationInfo.DerivationInput where
import Hercules.API.Derivation (DerivationStatus)
import Hercules.API.Prelude
data DerivationInput = DerivationInput
{ derivationStatus :: DerivationStatus,
derivationPath :: Text,
outputName :: Text,
outputP... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/216a1d178d57471b05f60bf3e21ce46d3fdc5f94/hercules-ci-api/src/Hercules/API/Build/DerivationInfo/DerivationInput.hs | haskell | # LANGUAGE DeriveAnyClass # |
module Hercules.API.Build.DerivationInfo.DerivationInput where
import Hercules.API.Derivation (DerivationStatus)
import Hercules.API.Prelude
data DerivationInput = DerivationInput
{ derivationStatus :: DerivationStatus,
derivationPath :: Text,
outputName :: Text,
outputPath :: Text
}
deriving (Gene... |
0a4de5a39cde6938edec0193aaf9582974c88f40fc5a9a6766c5ac0f893445dc | Opetushallitus/aipal | eraajo.clj | Copyright ( c ) 2013 The Finnish National Board of Education - Opetushallitus
;;
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
of the EUPL ( the " Licence " ) ;
;;
;; You may not use this work except... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/aipal/src/clj/aipal/infra/eraajo.clj | clojure |
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: /
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | Copyright ( c ) 2013 The Finnish National Board of Education - Opetushallitus
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
European Union Public Licence for more details .
(ns aipal.infra.eraajo
... |
ceb1da856bd6d1dc1ef9780d6d295c90e4d7f6c0dbfe6997fc94fd5be901b97e | Kappa-Dev/KappaTools | graphs.mli | type node
val node_of_int: int -> node
val int_of_node : node -> int
module NodeMap: SetMap.Map with type elt = node
module Nodearray :
Int_storage.Storage
with type key = node
and type dimension = int
type ('node_label,'edge_label) graph
val create:
Remanent_parameters_sig.parameters ->
Exception.m... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/KaSa_rep/more_datastructures/graphs.mli | ocaml | type node
val node_of_int: int -> node
val int_of_node : node -> int
module NodeMap: SetMap.Map with type elt = node
module Nodearray :
Int_storage.Storage
with type key = node
and type dimension = int
type ('node_label,'edge_label) graph
val create:
Remanent_parameters_sig.parameters ->
Exception.m... | |
abd2e38de731f4348e2fee969ed10a18f48666a947a7e05a7f48bf762b716c2e | mekispeter/haskell2019spring | haskell_hw5.hs | f1 :: (Eq a) => [a] -> Bool
f1 a = minimum (zipWith (==) a (reverse a))
f2 :: [String] -> Char -> String
f2 a b = foldl1 (c b) a where c b d e = d++b:e
f3 :: Int -> Integer
f3 a = (filter b [1..]) !! a where
b c = all d [1..c-1] where d e = gcd c e == 1
f4 :: Integer -> [Integer]
f4 a = if a == 0 then [1] else zi... | null | https://raw.githubusercontent.com/mekispeter/haskell2019spring/18fa81092cdc7a15c8ef92a2eff8274dfe79d00d/homeworks/haskell_hw5.hs | haskell | f1 :: (Eq a) => [a] -> Bool
f1 a = minimum (zipWith (==) a (reverse a))
f2 :: [String] -> Char -> String
f2 a b = foldl1 (c b) a where c b d e = d++b:e
f3 :: Int -> Integer
f3 a = (filter b [1..]) !! a where
b c = all d [1..c-1] where d e = gcd c e == 1
f4 :: Integer -> [Integer]
f4 a = if a == 0 then [1] else zi... | |
b81687cf51f4b67181e007faceba26528aacb82abdc717c542d31488a5ad6727 | chetmurthy/ensemble | actual.ml | (**************************************************************)
ACTUAL.ML
Author : , 11/96
Designed with
(* Ohad Rodeh: Converted from Old to New application interface, 11/2001. *)
(**************************************************************)
(* BUGS:
* Orders members in views lexicographicly
*)
(**... | null | https://raw.githubusercontent.com/chetmurthy/ensemble/8266a89e68be24a4aaa5d594662e211eeaa6dc89/ensemble/server/groupd/actual.ml | ocaml | ************************************************************
Ohad Rodeh: Converted from Old to New application interface, 11/2001.
************************************************************
BUGS:
* Orders members in views lexicographicly
************************************************************
*********... | ACTUAL.ML
Author : , 11/96
Designed with
open Trans
open Util
open View
open Mutil
open Appl_intf open New
let name = Trace.file "ACTUAL"
let failwith s = Trace.make_failwith name s
let log = Trace.log name
let list_split4 l =
List.fold_left (fun (la,lb,lc,ld) (a,b,c,d) ->
(a::la,b::lb,c::lc,d::ld)
)... |
41b8bfd21022c1f763355cf63d35f4508792c36f48e5a607982aeed581c30b9f | eait-itig/rdpproxy | ui_fsm.erl | %%
%% rdpproxy
%% remote desktop proxy
%%
Copyright 2012 - 2019 < >
The University of Queensland
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
1 . Redistributions of source code ... | null | https://raw.githubusercontent.com/eait-itig/rdpproxy/722129b5684834dc97531b20f92aa47727d19629/src/ui_fsm.erl | erlang |
rdpproxy
remote desktop proxy
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the followi... | Copyright 2012 - 2019 < >
The University of Queensland
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CON... |
a076977e173ae299a30ae2f9ce7baa27fd3f662006828ff7b18818a7412308c6 | ghcjs/ghcjs-dom | SourceBufferList.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.SourceBufferList
(js_item, item, item_, js_getLength, getLength, addsourcebuffer,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SourceBufferList.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/SourceBufferList.length Mozilla SourceBufferList.length documentation> | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.SourceBufferList
(js_item, item, item_, js_getLength, getLength, addsourcebuffer,
removesourcebuffer, SourceBufferList(..), gTypeSourceBufferList)
where
import Prelude ((.... |
9bb5f068c1b2d7dd1314a69e6d8f99df3c622953bc5ac089d017beb502604d76 | uim/uim | annotation-dict.scm | ;;; annotation-dict.scm: dict functions for uim
;;;
Copyright ( c ) 2010 - 2013 uim Project
;;;
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
1 . Redistributions of source code ... | null | https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/scm/annotation-dict.scm | scheme | annotation-dict.scm: dict functions for uim
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions an... | Copyright ( c ) 2010 - 2013 uim Project
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of authors nor the names of its contributors
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTOR... |
cf1d383f7cc4ccd6e6c23202722b533e3256c3d2b8dab6c160f318d6a4f7f5e7 | khibino/haskell-relational-record | Instances.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
-- |
-- Module : Database.Record.Instances
Copyright : 2013
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- Single col... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/persistable-record/src/Database/Record/Instances.hs | haskell | |
Module : Database.Record.Instances
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
Single column instances for example to load schema of system catalogs. | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
Copyright : 2013
module Database.Record.Instances () where
import Data.Int (Int8, Int16, Int32, Int64)
import Database.Record.InternalTH (knownWidthIntType)
import Database.Recor... |
a9aaa2c3e140357ca69ce985586263c12f1b351ab2bceda2582769854c0dad19 | songyahui/AlgebraicEffect | load_path.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/songyahui/AlgebraicEffect/27688952b598a101a27523be796e8011d70b02de/parsing/load_path.mli | ocaml | ************************************************************************
OCaml
... | , Jane Street Europe
Copyright 2018 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
val add_dir : string -> unit
val remove_dir : string -> unit
val reset : unit -> unit
val init : string ... |
f93f4c38220f03832730508f02d54fd6c1d8dbe8f72c6350c30c4b3ac3bdc3e3 | sharetribe/harmony | api.clj | (ns harmony.health.api
(:require [io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.interceptor :refer [interceptor]]
[io.pedestal.http :as http]
[io.pedestal.http.route :as route]
[schema.core :as s]
[pedestal-api.core :as api]
[ring... | null | https://raw.githubusercontent.com/sharetribe/harmony/756d1388e11a62773c83d0276da4c4f1d942ea91/src/harmony/health/api.clj | clojure | ERROR
TODO Error status
Make ELB healthcheck response from _status.json by stripping response body
Implementation of ELB healthcheck might diverge from _status.json in the future | (ns harmony.health.api
(:require [io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.interceptor :refer [interceptor]]
[io.pedestal.http :as http]
[io.pedestal.http.route :as route]
[schema.core :as s]
[pedestal-api.core :as api]
[ring... |
70a17931de6a09e0510e3c0ae5eed95204085f47f68e43b85373473ecd222ba0 | igrishaev/farseer | jetty.clj | (ns farseer.spec.jetty
(:require
[clojure.string :as str]
[clojure.spec.alpha :as s]))
(s/def :jetty/port pos-int?)
(s/def :jetty/join? boolean?)
(s/def ::config
(s/keys :req [:jetty/port
:jetty/join?]))
| null | https://raw.githubusercontent.com/igrishaev/farseer/b3be93aaa6ca5d917664a06373a880a675206f32/farseer-jetty/src/farseer/spec/jetty.clj | clojure | (ns farseer.spec.jetty
(:require
[clojure.string :as str]
[clojure.spec.alpha :as s]))
(s/def :jetty/port pos-int?)
(s/def :jetty/join? boolean?)
(s/def ::config
(s/keys :req [:jetty/port
:jetty/join?]))
| |
6d4179127653f26c8221bfcddd9b962aead2fb263bf0dc8d319ea411a9cfeae4 | wrengr/unification-fd | tutorial1.hs | {-# LANGUAGE DeriveFunctor
, DeriveFoldable
, DeriveTraversable
#-}
{-# OPTIONS_GHC -Wall -fwarn-tabs
-fno-warn-deprecations
-fno-warn-missing-signatures
-fno-warn-unused-do-bind
#-}
import Data.List.Extras.Pair (pairWith)
import Data.Foldable
import Data.Traversable
i... | null | https://raw.githubusercontent.com/wrengr/unification-fd/16301b1630a3a75168da0dd7d744c91dfaf007cc/test/tutorial/tutorial1.hs | haskell | # LANGUAGE DeriveFunctor
, DeriveFoldable
, DeriveTraversable
#
# OPTIONS_GHC -Wall -fwarn-tabs
-fno-warn-deprecations
-fno-warn-missing-signatures
-fno-warn-unused-do-bind
#
--------------------------------------------------------------
---------------------------------... |
import Data.List.Extras.Pair (pairWith)
import Data.Foldable
import Data.Traversable
import Control.Applicative
import Control.Monad.Error (ErrorT(..), runErrorT)
import Control.Monad.Identity (Identity(..))
import Control.Monad.Logic (Logic(), runLogic)
import Control.Monad.Trans (MonadTrans(lift))
import C... |
4b23f8b787e0246142abe87baa580991c2bbbdfa36f12c15660b52ecfbe60743 | zotonic/webzmachine | webmachine_perf_logger.erl | @author < >
@author < >
2007 - 2008 Basho Technologies
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable ... | null | https://raw.githubusercontent.com/zotonic/webzmachine/fe0075257e264fa28ba4112603794a48a78d8405/src/webmachine_perf_logger.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
limitations under the License.
Seek b... | @author < >
@author < >
2007 - 2008 Basho Technologies
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
See the License for the specific language governing permissions and
-module(webmachine_perf_logge... |
54e3c196f923f10f8ed5bb9a3de4cd6167002e9a38b90766497b9f8421c99857 | yuriy-chumak/ol | occlusion_query.scm | ; ===========================================================================
ARB_occlusion_query ( included in OpenGL 1.5 )
;
;
;
; Version
;
; Overview
;
(define-library (OpenGL ARB occlusion_query)
; ---------------------------------------------------------------------------
; Dep... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/83dd03d311339763682eab02cbe0c1321daa25bc/libraries/OpenGL/ARB/occlusion_query.scm | scheme | ===========================================================================
Version
Overview
---------------------------------------------------------------------------
Dependencies
---------------------------------------------------------------------------
-------------------------------------------------... | ARB_occlusion_query ( included in OpenGL 1.5 )
(define-library (OpenGL ARB occlusion_query)
(import (scheme core) (OpenGL platform))
(export ARB_occlusion_query
)
(begin
(define ARB_occlusion_query (gl:QueryExtension "GL_ARB_occlusion_query"))
))
|
7fbd3c2e70a8044ec37c24a2c8f5be3b5063bad79f8b0eb247115e6bf48f93a2 | hexagonal-sun/hchess | Piece.hs | module Piece (
PieceKind(..),
promotionKinds,
allKinds,
Piece(..),
switch,
Colour(..)
) where
import Data.Bits(shiftR, shiftL, (.&.))
data PieceKind = Pawn | Rook | Bishop | Knight | Queen | King
deriving(Ord ,Eq, Show, Enum)
promotionKinds :: [PieceKind]
promotionKinds = [Rook, Bishop, Knight, Queen]
... | null | https://raw.githubusercontent.com/hexagonal-sun/hchess/34f3be163e04553f34d82d10efedf6bbd25135c1/src/Piece.hs | haskell | module Piece (
PieceKind(..),
promotionKinds,
allKinds,
Piece(..),
switch,
Colour(..)
) where
import Data.Bits(shiftR, shiftL, (.&.))
data PieceKind = Pawn | Rook | Bishop | Knight | Queen | King
deriving(Ord ,Eq, Show, Enum)
promotionKinds :: [PieceKind]
promotionKinds = [Rook, Bishop, Knight, Queen]
... | |
b0f7d804a13c1a7abe5d9c0c7d74c4f9629a1a00ff52cb725789e4929f3a9bbb | nokia/web-assembly-self-certifying-compilation-framework | type_inference.ml | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
Do type inference on WASM instructions .
* The main purpose of this is t... | null | https://raw.githubusercontent.com/nokia/web-assembly-self-certifying-compilation-framework/8c31df0bd7d2d94cfbc22089944f5cabb3a61158/src/validator/syntax/type_inference.ml | ocaml | Some defaults
Let's implement a simple stack-based type simulator
Some lookups
Control flow instructions
S.from_list wtys
S.from_list wtys
S.from_list wtys
S.empty_stack
S.empty_stack
Recall that in WASM 1.0 semantics, there is at most one r... | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
Do type inference on WASM instructions .
* The main purpose of this is t... |
69670181199aeb5612f7348e68cbb3bc3c04187e7ac5153ee8561ff708a4dade | jjtolton/TheDevilsInterop | playground.clj | (ns metal-interop.playground
(:require [metal-interop.core :as metal]
[camel-snake-kebab.core :as csk]
[metal-interop.ffi :as ffi]
[tech.v3.datatype.ffi :as dt-ffi]))
(comment
(ffi/register-methods!)
(clojure.data.json/read-str
(dt-ffi/c->string
(metal/return-wrapper
... | null | https://raw.githubusercontent.com/jjtolton/TheDevilsInterop/fb43752de9daaa77ff6f191ead43b7763d171b41/src/metal_interop/playground.clj | clojure | (ns metal-interop.playground
(:require [metal-interop.core :as metal]
[camel-snake-kebab.core :as csk]
[metal-interop.ffi :as ffi]
[tech.v3.datatype.ffi :as dt-ffi]))
(comment
(ffi/register-methods!)
(clojure.data.json/read-str
(dt-ffi/c->string
(metal/return-wrapper
... | |
d4d6a94e0b9126052e3230f1f3703e0ce9d3dab5c56fb5a677104891b6253cb6 | clojure/clojurescript | project.clj | (defproject org.clojure/clojurescript "0.0-SNAPSHOT"
:description "ClojureScript compiler and core runtime library"
:parent [org.clojure/pom.contrib "0.1.2"]
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true" "-Xmx512m" ... | null | https://raw.githubusercontent.com/clojure/clojurescript/e30e26dbd221b5d7c4bbc567d10d0c3c01cf5f98/project.clj | clojure | (defproject org.clojure/clojurescript "0.0-SNAPSHOT"
:description "ClojureScript compiler and core runtime library"
:parent [org.clojure/pom.contrib "0.1.2"]
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true" "-Xmx512m" ... | |
2b1763f9559b19e3366da555e2157b739540060e3716d2f3a4d364e6c1faa578 | joelburget/lvca | Source_range.mli | type t =
{ source : string
; range : Range.t
}
type Stdlib.Format.stag += Stag of t
val mk : string -> int -> int -> t
(** Pretty-print this range. *)
val pp : t Fmt.t
(** Extend this range to include the given position *)
val extend_to : t -> int -> t
* Append two ranges . This creates a new range spanning ... | null | https://raw.githubusercontent.com/joelburget/lvca/c3fa56e5acc91be0179973f0c013473847374ae9/provenance/Source_range.mli | ocaml | * Pretty-print this range.
* Extend this range to include the given position
* For testing only: used to enable outputting of the [Stag] semantic tag. | type t =
{ source : string
; range : Range.t
}
type Stdlib.Format.stag += Stag of t
val mk : string -> int -> int -> t
val pp : t Fmt.t
val extend_to : t -> int -> t
* Append two ranges . This creates a new range spanning from the earlier start to the
later finish .
later finish. *)
val union : t -... |
baa2826a1e2cdb4b6394ca6dfc64ecbecd14511099c6438948c8ca30d8194971 | slegrand45/mysql_protocol | test_benchmark.ml | let count_sql = ref 0
let acc_time = ref 0.0
let reset_stats () =
let () = count_sql := 0 in
let () = acc_time := 0.0 in
()
let stats_to_string () =
let avg = !acc_time /. (float_of_int !count_sql) in
let s = Printf.sprintf "%d sql requests in %f seconds (average : one request in %f seconds)" !count_sql !... | null | https://raw.githubusercontent.com/slegrand45/mysql_protocol/eb28d33dfbee7b12f88a7f798c2dbb40e1fb1bb0/test/test_benchmark.ml | ocaml | msg | let count_sql = ref 0
let acc_time = ref 0.0
let reset_stats () =
let () = count_sql := 0 in
let () = acc_time := 0.0 in
()
let stats_to_string () =
let avg = !acc_time /. (float_of_int !count_sql) in
let s = Printf.sprintf "%d sql requests in %f seconds (average : one request in %f seconds)" !count_sql !... |
859bd56ef152f2377ac691aace28bb41240c66c002a565d3349dc4fd7329e481 | bufferswap/ViralityEngine | filesystem.lisp | (in-package #:vutils)
(defmacro with-file-input ((stream path) &body body)
"Open the file at location `PATH` as input and perform `BODY`."
`(with-open-file (,stream
,path
:direction :input
:if-does-not-exist :error)
,@body))
(defmacro with-file-outp... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/support/vutils/src/filesystem.lisp | lisp | (in-package #:vutils)
(defmacro with-file-input ((stream path) &body body)
"Open the file at location `PATH` as input and perform `BODY`."
`(with-open-file (,stream
,path
:direction :input
:if-does-not-exist :error)
,@body))
(defmacro with-file-outp... | |
b935a0aa49df07cb066f97b7a3d3e98bdf01bf0bccb46c0ede19ef4b6d1e107c | AdaCore/why3 | cakeml.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/4441127004d53cf2cb0f722fed4a930ccf040ee4/src/extract/cakeml.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
open Format
open Ident
open Pp
open Ity
open Term
open Expr
open Ty
open Theory
open Pmodule
open Pdecl
ope... |
5368b2e65d4513f51233a8199b4a726bcef254e7c55543a477091fd077f2eecd | SPY/haskell-wasm | Test.hs | {-# LANGUAGE OverloadedStrings #-}
module Main (
main
) where
import Test.Tasty
import Test.Tasty.HUnit
import qualified System.Directory as Directory
import qualified Data.ByteString.Lazy as LBS
import qualified Language.Wasm as Wasm
import qualified Language.Wasm.Script as Script
import qualified Data.List as L... | null | https://raw.githubusercontent.com/SPY/haskell-wasm/54c3cfd69784ad618be8f759368545deb36b7db9/tests/Test.hs | haskell | # LANGUAGE OverloadedStrings #
let files = ["const.wast"] | module Main (
main
) where
import Test.Tasty
import Test.Tasty.HUnit
import qualified System.Directory as Directory
import qualified Data.ByteString.Lazy as LBS
import qualified Language.Wasm as Wasm
import qualified Language.Wasm.Script as Script
import qualified Data.List as List
main :: IO ()
main = do
file... |
3f5955fe6b6357b6e0b8d3de4652a2a47cceba1c30e3a6da919bc7dbecf8587d | fp-works/2019-winter-Haskell-school | SExpr.hs | module SExpr where
import AParser
import Control.Applicative
import Data.Char (isAlpha, isAlphaNum, isSpace)
------------------------------------------------------------
1 . Parsing repetitions
------------------------------------------------------------
zeroOrMore :: Parse... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week11/zehua/src/SExpr.hs | haskell | ----------------------------------------------------------
----------------------------------------------------------
use `<|> pure []` to stop whenever we could not match further
making it free of ` p ` using Applicative Functor :D
making it free of `p` using Applicative Functor :D
--------------------------------... | module SExpr where
import AParser
import Control.Applicative
import Data.Char (isAlpha, isAlphaNum, isSpace)
1 . Parsing repetitions
zeroOrMore :: Parser a -> Parser [a]
zeroOrMore p = (:) <$> p <*> zeroOrMore p <|> pure []
zeroOrMore p = pp
where
pp = Parser p0... |
484c4466690a90be0432ef7d370c227a9dcab223e1ff61f229d30a6c7bef04e7 | ruricolist/FXML | package.lisp | ;;;; package.lisp -- Paketdefinition
;;;;
This file is part of the FXML parser , released under Lisp - LGPL .
;;;; See file COPYING for details.
(in-package :cl-user)
(defpackage :fxml
(:use :cl :fxml.runes :fxml.runes-encoding :split-sequence)
(:import-from #:named-readtables #:in-readtable)
(:import-from #:... | null | https://raw.githubusercontent.com/ruricolist/FXML/a0e73bb48ef03adea94a55986cc27f522074c8e1/xml/package.lisp | lisp | package.lisp -- Paketdefinition
See file COPYING for details.
meta
xstreams
xstream controller protocol | This file is part of the FXML parser , released under Lisp - LGPL .
(in-package :cl-user)
(defpackage :fxml
(:use :cl :fxml.runes :fxml.runes-encoding :split-sequence)
(:import-from #:named-readtables #:in-readtable)
(:import-from #:alexandria #:compose #:curry #:rcurry #:setp)
(:import-from #:serapeum
... |
314cc8f1d04be0b56eb4dbb6bae1ffa674b84390d02110967b653e82d89ed841 | default-kramer/plisqin | core.rkt | #lang racket
(provide typed<%> typed? get-type assign-type
type? define-types type-supertypes)
; Runtime representation of a type
; contract-proc : procedure?
; id : symbol?
; supertypes : (listof type?)
(struct type (contract-proc id supertypes flattened-supertypes)
#:property prop:procedure... | null | https://raw.githubusercontent.com/default-kramer/plisqin/26421c7c42656c873c4e0a4fc7f48c0a3ed7770f/plisqin-lib/private2/types/lib/core.rkt | racket | Runtime representation of a type
contract-proc : procedure?
id : symbol?
supertypes : (listof type?)
An object that can have a type assigned to it
(-> this (or/c #f type?))
(-> this type? new-this) | #lang racket
(provide typed<%> typed? get-type assign-type
type? define-types type-supertypes)
(struct type (contract-proc id supertypes flattened-supertypes)
#:property prop:procedure 0
#:property prop:custom-print-quotable 'never
#:methods gen:custom-write
[(define (write-proc me port mode)
(w... |
e1a74538f4b82778f1572af58db08e2793d6d136078001341439a90798ba914d | fulcrologic/semantic-ui-wrapper | ui_comment.cljc | (ns com.fulcrologic.semantic-ui.views.comment.ui-comment
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Comment" :as Comment])))
(def ui-comment
"A comment displays user feedback to site content.
Props:
- as (elementType): An element type to render as (s... | null | https://raw.githubusercontent.com/fulcrologic/semantic-ui-wrapper/7bd53f445bc4ca7e052c69596dc089282671df6c/src/main/com/fulcrologic/semantic_ui/views/comment/ui_comment.cljc | clojure | (ns com.fulcrologic.semantic-ui.views.comment.ui-comment
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Comment" :as Comment])))
(def ui-comment
"A comment displays user feedback to site content.
Props:
- as (elementType): An element type to render as (s... | |
eee38859dc5d6e0e4a1f63b0f5ff39f42eb51f98ff527850709892c6fce7fbbb | gvolpe/haskell-book-exercises | exercises.hs | import Control.Applicative
import Data.Monoid
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data List a = Nil | Cons a (List a) deriving (Eq, Show)
take' :: Int -> List a -> List a
take' n Nil = Nil
take' 1 (Cons x _) = Cons x Nil
take' n (Cons x xs) = Cons x $ take' (... | null | https://raw.githubusercontent.com/gvolpe/haskell-book-exercises/5c1b9d8dc729ee5a90c8709b9c889cbacb30a2cb/chapter17/exercises.hs | haskell | ZipList Applicative
Validation Applicative
same as Sum/Either
This is different
More exercises: Write Applicative instances
Tests | import Control.Applicative
import Data.Monoid
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data List a = Nil | Cons a (List a) deriving (Eq, Show)
take' :: Int -> List a -> List a
take' n Nil = Nil
take' 1 (Cons x _) = Cons x Nil
take' n (Cons x xs) = Cons x $ take' (... |
91ff3959b101dd956bc3e9e7aea3889a0b9fd9935a90acab0a9a1998410adbac | bufferswap/ViralityEngine | kernel.lisp | (in-package #:virality)
;;;; Implementation of datatype KERNEL
;;;; A KERNEL is the base of an ACTOR or COMPONENT type. It it used for bookeeping
;;;; those objects, of which there may be MANY in a game.
;; NOTE: This ensures that all kernels have a core so we don't have to go
;; through the context to get it all ov... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/kernel/kernel.lisp | lisp | Implementation of datatype KERNEL
A KERNEL is the base of an ACTOR or COMPONENT type. It it used for bookeeping
those objects, of which there may be MANY in a game.
NOTE: This ensures that all kernels have a core so we don't have to go
through the context to get it all over the codebase.
Query table management
P... | (in-package #:virality)
(defmethod initialize-instance :after ((instance kernel) &key)
(setf (slot-value instance '%core) (core (context instance))))
(u:define-printer (kernel stream)
(format stream "~a" (display-id kernel)))
(defun register-kernel-uuid (kernel)
(u:if-let ((table (kernels-by-uuid (tables (c... |
80d53b4869cdb9f13d7fd934145660502c4a212755078c48d77640823a77baf6 | yzh44yzh/erma | empty_tests.erl | -module(empty_tests).
-include("erma.hrl").
-include_lib("eunit/include/eunit.hrl").
empty_test_() ->
test_utils:generate(
[{
%%
{select, ["id", "username"], "users", [{where, []}]},
%%
<<"SELECT id, username FROM users">>
},
{
%%
{select, ... | null | https://raw.githubusercontent.com/yzh44yzh/erma/454f127fcf6df0407de2f357f40a1d57f016d694/test/empty_tests.erl | erlang | -module(empty_tests).
-include("erma.hrl").
-include_lib("eunit/include/eunit.hrl").
empty_test_() ->
test_utils:generate(
[{
{select, ["id", "username"], "users", [{where, []}]},
<<"SELECT id, username FROM users">>
},
{
{select, ["id", "username"], <<"users">>, [{w... | |
59aa18b55f0b3237bc1516bf768f80b1ae6f4bde7e8e8bedb52aac8b5b35a202 | mankyKitty/fantastic-waddle | GOLCube.hs | {-# LANGUAGE OverloadedStrings #-}
module WebGL.Shaders.GOLCube
( golCubeFragSrc
, golCubeVertSrc
) where
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Semigroup ((<>))
import WebGL.Types (FragSrc (..), VertSrc (..))
setFloatPrecision :: Text... | null | https://raw.githubusercontent.com/mankyKitty/fantastic-waddle/680ca473bf7141c63528195ae23cb799b2fb0eac/frontend/src/WebGL/Shaders/GOLCube.hs | haskell | # LANGUAGE OverloadedStrings # | module WebGL.Shaders.GOLCube
( golCubeFragSrc
, golCubeVertSrc
) where
import Data.Text (Text)
import qualified Data.Text as Text
import Data.Semigroup ((<>))
import WebGL.Types (FragSrc (..), VertSrc (..))
setFloatPrecision :: Text
setFloatPrecision = Text.unlines
... |
bcc7e347db5162b73e7923e1b2178cb969fc74d989d05c1c2887614225b000e9 | tolysz/prepare-ghcjs | GHCi.hs | # LANGUAGE NoImplicitPrelude #
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.GHCi
Copyright : ( c ) The University of Glasgow 2012
-- License : see libraries/base/LICENSE
--
-- Maintainer :
-- Stability : internal... | null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts8/base-pure/GHC/GHCi.hs | haskell | # OPTIONS_HADDOCK hide #
---------------------------------------------------------------------------
|
Module : GHC.GHCi
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
The GHCi Monad lifting interface.
EXPERIMENTAL! DON'T USE.
-----------------------------------------... | # LANGUAGE NoImplicitPrelude #
Copyright : ( c ) The University of Glasgow 2012
Portability : non - portable ( GHC Extensions )
GHCiSandboxIO(..), NoIO()
) where
import GHC.Base (IO(), Monad, Functor(fmap), Applicative(..), (>>=), id, (.), ap)
m into the IO monad . ( e.g state monads )
clas... |
5bd07b8e23aa3971393ba333cb8a8e0bfea56537c2536b1fac571417d3c30e2a | zotonic/zotonic | mod_auth2fa.erl | @author < >
2019
@doc Add 2FA TOTP authentication
Copyright 2010 - 2019
%%
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 appli... | null | https://raw.githubusercontent.com/zotonic/zotonic/5c5d5e341b09c5f47576ca0390a0d8fc02c77845/apps/zotonic_mod_auth2fa/src/mod_auth2fa.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | @author < >
2019
@doc Add 2FA TOTP authentication
Copyright 2010 - 2019
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mod_auth2fa).
-author("Marc Worrell <>").
-mod_title("Two-Factor authenticatio... |
6080d9d8715a33ac3b4ae2df2037bba7384cb91e938b99a88ba283e3b7c1f8c8 | tendant/clj-telemetry | tracing.clj | (ns telemetry.tracing
(:require [clojure.walk :as walk])
(:import [io.opentelemetry.sdk.trace SdkTracerProvider]
[io.opentelemetry.api OpenTelemetry]
[io.opentelemetry.sdk OpenTelemetrySdk]
[io.opentelemetry.context.propagation ContextPropagators]
[io.opentelemetry.api.tr... | null | https://raw.githubusercontent.com/tendant/clj-telemetry/1cadf232399921d5819855fffb4247be0109374c/src/telemetry/tracing.clj | clojure | (ns telemetry.tracing
(:require [clojure.walk :as walk])
(:import [io.opentelemetry.sdk.trace SdkTracerProvider]
[io.opentelemetry.api OpenTelemetry]
[io.opentelemetry.sdk OpenTelemetrySdk]
[io.opentelemetry.context.propagation ContextPropagators]
[io.opentelemetry.api.tr... | |
a1e7115d3fdfca3ebe6fcd34c1cf7089b10d5cc61b87b4d35e68d7d043cde512 | zenhack/haskell-capnp | Pure.hs | # LANGUAGE DataKinds #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
-- TODO(cleanup): the raw/pure split no longer exists, so this module path doesn't
-- make a lot of sense anymore; reorganize.
module Module.Capnp.Untyped.Pure (pureUntypedTests) where
import Capnp (msgToRa... | null | https://raw.githubusercontent.com/zenhack/haskell-capnp/6cf9fae35189a3668f2740d64c634675ec5fbdec/tests/Module/Capnp/Untyped/Pure.hs | haskell | # LANGUAGE OverloadedStrings #
TODO(cleanup): the raw/pure split no longer exists, so this module path doesn't
make a lot of sense anymore; reorganize. | # LANGUAGE DataKinds #
# LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
module Module.Capnp.Untyped.Pure (pureUntypedTests) where
import Capnp (msgToRaw, parse)
import Capnp.Basics
import Capnp.TraversalLimit (runLimitT)
import qualified Data.Vector as V
import GHC.Float (castDoubleToWord64)
import Test.Hspec
im... |
55e0ebc441f19d55cc0ec92e4b86ab41554ece853c1ad1a30dd78d5c92627d00 | mentat-collective/emmy | fold.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.algebra.fold
"Namespace implementing various aggregation functions using the `fold`
abstraction and combinators for generating new folds from fold primitives.
Contains a number of algorithms for [compensated
summation]() of
floating-point numbers."
(:refer-clo... | null | https://raw.githubusercontent.com/mentat-collective/emmy/90a1de10e78187c70d546c3cfd63c8d32b783bed/src/emmy/algebra/fold.cljc | clojure |
A [fold]((higher-order_function)) is a
combination of:
- some initial value into which you want to aggregate
- a combining function of type (accumulator, x) => accumulator, capable
of "folding" each element `x` in some sequence of `xs` into the
accumulating state
- a "present" function that converts the ac... | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.algebra.fold
"Namespace implementing various aggregation functions using the `fold`
abstraction and combinators for generating new folds from fold primitives.
Contains a number of algorithms for [compensated
summation]() of
floating-point numbers."
(:refer-clo... |
3a0dcf9d8b23e691862fdc4dd98456768f5de1fcae8904c46e6a5ebb280376a8 | isovector/ld52 | Importer.hs | {-# LANGUAGE OverloadedStrings #-}
module Engine.Importer where
import Control.DeepSeq (force)
import Control.Lens hiding (Level)
import Control.Monad.Except
import Data.Either (partitionEithers)
import Data.Generics.Labels ()
import qualified Data.Map as M
import ... | null | https://raw.githubusercontent.com/isovector/ld52/60e39b1dc325216622f35e12c0f9a9152350163d/src/Engine/Importer.hs | haskell | # LANGUAGE OverloadedStrings #
# SOURCE #
(traceFX "spawning: " id $ e ^. #__identifier)
Add a little bonus so we don't have weird culling on the edges |
module Engine.Importer where
import Control.DeepSeq (force)
import Control.Lens hiding (Level)
import Control.Monad.Except
import Data.Either (partitionEithers)
import Data.Generics.Labels ()
import qualified Data.Map as M
import Data.Maybe (catMaybes, maybe... |
42f95b8963ec2617afbf094af438d0afcdd1efd924e7b871a55eb35e421a527e | solarbit/pool | sbt_codec.erl | Copyright 2016 solarbit.cc < >
% See LICENSE
-module(sbt_codec).
-include("solarbit.hrl").
-include_lib("bitcoin/include/bitcoin.hrl").
-include_lib("bitcoin/include/bitcoin_script.hrl").
-export([encode/2, decode/2, coinbase/1]).
-compile(export_all).
decode(Key, <<?SBT_MAGIC:32, Version:4/binary, Number:32/lit... | null | https://raw.githubusercontent.com/solarbit/pool/5576f1b71a469dfa2fcb6b5766667402eacc3860/lib/solarbit/src/sbt_codec.erl | erlang | See LICENSE | Copyright 2016 solarbit.cc < >
-module(sbt_codec).
-include("solarbit.hrl").
-include_lib("bitcoin/include/bitcoin.hrl").
-include_lib("bitcoin/include/bitcoin_script.hrl").
-export([encode/2, decode/2, coinbase/1]).
-compile(export_all).
decode(Key, <<?SBT_MAGIC:32, Version:4/binary, Number:32/little, Type:4/bi... |
9053e0ac960d15798d59d918183f48e83e8801469d6b900e4d86d403659c38bf | owlbarn/owl_ode | native.ml |
* OWL - OCaml Scientific and Engineering Computing
* OWL - ODE - Ordinary Differential Equation Solvers
*
* Copyright ( c ) 2019 >
* Copyright ( c ) 2019 < >
* OWL - OCaml Scientific and Engineering Computing
* OWL-ODE - Ordinary Differential Equation Solvers
*
* Copyright (c) 2019 Ta-Chu... | null | https://raw.githubusercontent.com/owlbarn/owl_ode/5d934fbff87eea9f060d6c949bf78467024d8791/src/ode/native/native.ml | ocaml |
* OWL - OCaml Scientific and Engineering Computing
* OWL - ODE - Ordinary Differential Equation Solvers
*
* Copyright ( c ) 2019 >
* Copyright ( c ) 2019 < >
* OWL - OCaml Scientific and Engineering Computing
* OWL-ODE - Ordinary Differential Equation Solvers
*
* Copyright (c) 2019 Ta-Chu... | |
0318a246b9e0e73ffd4bc8522fbb81ecc02f3340eb4b3c9c72024217e90da5c7 | iamFIREcracker/adventofcode | day17.lisp | (defpackage :aoc/2016/17 #.cl-user::*aoc-use*)
(in-package :aoc/2016/17)
(defparameter *nhood* '(#C(0 1) #C(0 -1) #C(-1 0) #C(1 0)))
(defparameter *steps* "UDLR")
(defun door-states (seed path)
(let* ((string (format nil "~A~A" seed path))
(bytes (md5:md5sum-string string))
(result (make-array 4 :... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/c271de872505388086583f00283cb213c16a355b/src/2016/day17.lisp | lisp | (defpackage :aoc/2016/17 #.cl-user::*aoc-use*)
(in-package :aoc/2016/17)
(defparameter *nhood* '(#C(0 1) #C(0 -1) #C(-1 0) #C(1 0)))
(defparameter *steps* "UDLR")
(defun door-states (seed path)
(let* ((string (format nil "~A~A" seed path))
(bytes (md5:md5sum-string string))
(result (make-array 4 :... | |
849cc3ac8ed973b239bfaa0cbd51767d2f8118be209cf1580a4a4fd19bc1b80c | xxyzz/SICP | Exercise_3_75.rkt | #lang racket/base
(require racket/stream)
(define (stream-map proc . argstreams)
(if (stream-empty? (car argstreams))
empty-stream
(stream-cons
(apply proc (map stream-first argstreams))
(apply stream-map
(cons proc (map stream-rest argstreams))))))
(define (sign-change-detec... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/3_Modularity_Objects_and_State/3.5_Streams/Exercise_3_75.rkt | racket | '(0 0 0 0 0 0) | #lang racket/base
(require racket/stream)
(define (stream-map proc . argstreams)
(if (stream-empty? (car argstreams))
empty-stream
(stream-cons
(apply proc (map stream-first argstreams))
(apply stream-map
(cons proc (map stream-rest argstreams))))))
(define (sign-change-detec... |
e6d439e881c39a82e0de6ab41ceab853a343fee08c0616e57ca3bacbaca06cff | sbcl/sbcl | interrupt-consing.impure.lisp | #-sb-thread (invoke-restart 'run-tests::skip-file)
(use-package "SB-THREAD")
(defun alloc-stuff () (copy-list '(1 2 3 4 5)))
(with-test (:name (:interrupt-thread :interrupt-consing-child)
:broken-on :win32)
(let* ((thread (make-thread (lambda () (loop (alloc-stuff)))))
(killer (make-thre... | null | https://raw.githubusercontent.com/sbcl/sbcl/dd911e00794a976aa590f5c458a9c3ae4d0bb6fa/tests/interrupt-consing.impure.lisp | lisp | x86oid-only, see internal commentary.
pseudo-atomic atomicity | #-sb-thread (invoke-restart 'run-tests::skip-file)
(use-package "SB-THREAD")
(defun alloc-stuff () (copy-list '(1 2 3 4 5)))
(with-test (:name (:interrupt-thread :interrupt-consing-child)
:broken-on :win32)
(let* ((thread (make-thread (lambda () (loop (alloc-stuff)))))
(killer (make-thre... |
ede5053a091d2f5dbc04b8de91cf768780808a233b10911c951485dfd6dc1aba | redbadger/karma-tracker | languages.cljs | (ns karma-tracker-ui.views.languages
(:require [re-frame.core :as re-frame]
[karma-tracker-ui.views.bar-chart :as bar-chart]))
(defn language [{:keys [name count]} bar-scale]
[:div.language
[:div.bar-chart__label
name
[:span.bar-chart__value count]]
[:div.bar-chart__bar-container
[:sp... | null | https://raw.githubusercontent.com/redbadger/karma-tracker/c5375f32f4cd0386f6bb1560d979b79bceea19e2/ui/src/cljs/karma_tracker_ui/views/languages.cljs | clojure | (ns karma-tracker-ui.views.languages
(:require [re-frame.core :as re-frame]
[karma-tracker-ui.views.bar-chart :as bar-chart]))
(defn language [{:keys [name count]} bar-scale]
[:div.language
[:div.bar-chart__label
name
[:span.bar-chart__value count]]
[:div.bar-chart__bar-container
[:sp... | |
8ac0221af8096df60073af2d576f50e87a46e5b1d35b6110b89d441cd5d8b5ce | pavankumarbn/DroneGUIROS | _package_Navdata.lisp | (cl:in-package ardrone_autonomy-msg)
(cl:export '(HEADER-VAL
HEADER
BATTERYPERCENT-VAL
BATTERYPERCENT
STATE-VAL
STATE
MAGX-VAL
MAGX
MAGY-VAL
MAGY
MAGZ-VAL
MAGZ
PRESSURE-VAL
PRESSURE
... | null | https://raw.githubusercontent.com/pavankumarbn/DroneGUIROS/745320d73035bc50ac4fea2699e22586e10be800/devel/share/common-lisp/ros/ardrone_autonomy/msg/_package_Navdata.lisp | lisp | (cl:in-package ardrone_autonomy-msg)
(cl:export '(HEADER-VAL
HEADER
BATTERYPERCENT-VAL
BATTERYPERCENT
STATE-VAL
STATE
MAGX-VAL
MAGX
MAGY-VAL
MAGY
MAGZ-VAL
MAGZ
PRESSURE-VAL
PRESSURE
... | |
1b9b7599c67b6b708362f0c7791a263216c184b5ea76a23e33726f48bc9809cd | BinaryAnalysisPlatform/bap | test_image.ml | open Core_kernel[@@warning "-D"]
open OUnit2
open Or_error
open Word_size
open Bap.Std
[@@@warning "-D"]
open Backend
let ident = Int64.of_int
let create_addr = function
| `r32 -> Addr.of_int64 ~width:32
| `r64 -> Addr.of_int64 ~width:64
let create_segment
?(name=".test")
?(addr=0)
?(perm=(Or (R,X))... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib_test/bap_image/test_image.ml | ocaml | open Core_kernel[@@warning "-D"]
open OUnit2
open Or_error
open Word_size
open Bap.Std
[@@@warning "-D"]
open Backend
let ident = Int64.of_int
let create_addr = function
| `r32 -> Addr.of_int64 ~width:32
| `r64 -> Addr.of_int64 ~width:64
let create_segment
?(name=".test")
?(addr=0)
?(perm=(Or (R,X))... | |
9ff9e7c274d432be660b8cbdc48e0c29b79534228c9a0169e616e5fb70b37bc7 | grin-compiler/ghc-wpc-sample-programs | Map.hs | # LANGUAGE CPP #
module Map (
Map,
member, lookup, findWithDefault,
empty,
insert, insertWith,
delete,
union, unionWith, unions,
mapWithKey,
elems,
fromList, fromListWith,
toAscList
) where
#if __GLASGOW_HASKELL__ >= 603
import Data.Map
import Prelude ()
#else
import Data.FiniteMap
import... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/alex-3.2.5/src/Map.hs | haskell | # LANGUAGE CPP #
module Map (
Map,
member, lookup, findWithDefault,
empty,
insert, insertWith,
delete,
union, unionWith, unions,
mapWithKey,
elems,
fromList, fromListWith,
toAscList
) where
#if __GLASGOW_HASKELL__ >= 603
import Data.Map
import Prelude ()
#else
import Data.FiniteMap
import... | |
0c1db5244e4fadcc311b0d8f61fd9271b1c2080ff903c61f852d2bebc76a4c8c | erlang/erlide_kernel | erlide_scan_model_tests.erl | @author jakob
-module(erlide_scan_model_tests).
%%
%% Include files
%%
-include_lib("eunit/include/eunit.hrl").
-include("erlide_token.hrl").
%%
%% Exported Functions
%%
%%
%% API Functions
%%
scanner_test_() ->
[?_assertEqual({[#token{kind = atom, line = 0, offset = 0,length = 1, value = a, text="a"},
... | null | https://raw.githubusercontent.com/erlang/erlide_kernel/763a7fe47213f374b59862fd5a17d5dcc2811c7b/ide/apps/erlide_ide_core/test/erlide_scan_model_tests.erl | erlang |
Include files
Exported Functions
API Functions
Local Functions
| @author jakob
-module(erlide_scan_model_tests).
-include_lib("eunit/include/eunit.hrl").
-include("erlide_token.hrl").
scanner_test_() ->
[?_assertEqual({[#token{kind = atom, line = 0, offset = 0,length = 1, value = a, text="a"},
#token{kind = '(', line = 0, offset = 1, length = 1, text... |
60877154844ff875676503baf821babbd6b850acec313cf0879c634505fe319a | alphagov/govuk-guix | bundler.scm | (define-module (gds packages utils bundler)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (guix monads)
#:use-module (guix records)
#:use-module (guix gexp)
#:use-module (guix grafts)
#:use-module (guix packages)
#:use-module ... | null | https://raw.githubusercontent.com/alphagov/govuk-guix/dea8c26d2ae882d0278be5c745e23abb25d4a4e2/gds/packages/utils/bundler.scm | scheme | "Compile" FILE by adding it to the store.
Select (guix …) and (gnu …) modules, except (guix config).
for reset-timestamps
Pass through the original location
Update package expression EXPR, replacing occurrences of | (define-module (gds packages utils bundler)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (guix monads)
#:use-module (guix records)
#:use-module (guix gexp)
#:use-module (guix grafts)
#:use-module (guix packages)
#:use-module ... |
87c883c18c2649095e78a887d6da97f8bcd2115100419a24b94c0a56ff477bff | patrickt/effects-benchmarks | StatefulExcept.hs | # LANGUAGE TypeApplications #
module Fused.StatefulExcept where
import Control.Carrier.State.Strict as State
import Control.Carrier.Error.Either
import Data.Functor.Identity
type StateM = StateC Int (ErrorC String Identity)
get :: StateM Int
get = State.get @Int
put :: Int -> StateM ()
put = State.put @Int
throw ... | null | https://raw.githubusercontent.com/patrickt/effects-benchmarks/3416436ae9a6de9f2fe9e7a3662c8af5a0be615d/instances/Fused/StatefulExcept.hs | haskell | # LANGUAGE TypeApplications #
module Fused.StatefulExcept where
import Control.Carrier.State.Strict as State
import Control.Carrier.Error.Either
import Data.Functor.Identity
type StateM = StateC Int (ErrorC String Identity)
get :: StateM Int
get = State.get @Int
put :: Int -> StateM ()
put = State.put @Int
throw ... | |
13d5ec3acda9b4e87a6d1deb3ae08ba6682f515d4aead553dd887886bed944e5 | xapi-project/xen-api | datamodel_types.mli | module Date : sig
include module type of Xapi_stdext_date.Date
val iso8601_of_rpc : Rpc.t -> Xapi_stdext_date.Date.iso8601
val rpc_of_iso8601 : Xapi_stdext_date.Date.iso8601 -> Rpc.t
end
val oss_since_303 : string option
val rel_george : string
val rel_orlando : string
val rel_orlando_update_1 : string
val... | null | https://raw.githubusercontent.com/xapi-project/xen-api/4ec6be956b1181619e12b5cd14c70973ef85cb4d/ocaml/idl/datamodel_types.mli | ocaml | * Types of object fields. Accessor functions are generated for each field
automatically according to its type and qualifiers.
* Implicitly static: set in constructor and updatable through API
* Specified in constructor; no autogenerated setter in XenAPI.
* Initial value is a default; no autogenerated setter in X... | module Date : sig
include module type of Xapi_stdext_date.Date
val iso8601_of_rpc : Rpc.t -> Xapi_stdext_date.Date.iso8601
val rpc_of_iso8601 : Xapi_stdext_date.Date.iso8601 -> Rpc.t
end
val oss_since_303 : string option
val rel_george : string
val rel_orlando : string
val rel_orlando_update_1 : string
val... |
44a1ab9301cdc8260e6aa1194370924315279589a035166d60b89e1bc4995ba4 | politrons/Dive_into_Haskell | MaybeFunctions.hs | module MaybeFunctions where
import Data.Char
import Data.List
| Maybe is just like Optional or Option from Scala and Java .
-- With Maybe we define the type [Maybe] follow by the type [T] that it will contain.
| In case we want to fill a Maybe with data we just need to add [ Just ] as Some in Scala just before t... | null | https://raw.githubusercontent.com/politrons/Dive_into_Haskell/fd9dec14b87aecba0b3561385c1d75cf969546a4/src/features/MaybeFunctions.hs | haskell | With Maybe we define the type [Maybe] follow by the type [T] that it will contain.
| The pure way to extract the value from a Maybe is using patter matching,
to find an element in the list. | module MaybeFunctions where
import Data.Char
import Data.List
| Maybe is just like Optional or Option from Scala and Java .
| In case we want to fill a Maybe with data we just need to add [ Just ] as Some in Scala just before the data " Hello effect "
someValue = Just "Hello effect" :: Maybe String
| In case ... |
09d0535ff66e5648f19fdf26bbbb4289b892ec6910e377b612bf3e25fbd9490d | 0install/0install | element.ml | Copyright ( C ) 2014 , the README file for details , or visit .
* See the README file for details, or visit .
*)
* Type - safe access to the XML formats .
* See :
* -spec.html
* -spec.html
* See:
* -spec.html
* -spec.html *)
open Support
open Support.Common
open General
open Constants
module... | null | https://raw.githubusercontent.com/0install/0install/22eebdbe51a9f46cda29eed3e9e02e37e36b2d18/src/zeroinstall/element.ml | ocaml | * Create a map from interface URI to <selection> elements. | Copyright ( C ) 2014 , the README file for details , or visit .
* See the README file for details, or visit .
*)
* Type - safe access to the XML formats .
* See :
* -spec.html
* -spec.html
* See:
* -spec.html
* -spec.html *)
open Support
open Support.Common
open General
open Constants
module... |
ba4ca78c6db13f38debc9b14e15c6b696cf7c788796f71a48efa603be3fa573c | yogthos/krueger | email.clj | (ns krueger.email
(:require
[krueger.config :refer [env]]
[postal.core :as email]
[hiccup.core :as html]
[selmer.parser :as parser]))
(defn send-registration [to token]
(let [{:keys [host user pass port domain ssl]} (:email env)]
(email/send-message
{:host host
:user user
:p... | null | https://raw.githubusercontent.com/yogthos/krueger/782e1f8ab358867102b907c5a80e56ee6bc6ff82/src/clj/krueger/email.clj | clojure | (ns krueger.email
(:require
[krueger.config :refer [env]]
[postal.core :as email]
[hiccup.core :as html]
[selmer.parser :as parser]))
(defn send-registration [to token]
(let [{:keys [host user pass port domain ssl]} (:email env)]
(email/send-message
{:host host
:user user
:p... | |
ddb2b903ec0c57522b5ce094005c2ab799db29c8513962f3004caa9cadd83b7f | ChrisPenner/comonads-by-example | Builder.hs | module Comonads.Traced.Builder where
import Comonads.Traced
import Control.Comonad
import Data.Monoid
import Data.Function ((&))
import qualified Data.Map as M
newBuilder :: Traced [String] String
newBuilder = traced concat
append :: String -> Traced [String] String -> String
append s = trace [s]
logMsg :: Traced [... | null | https://raw.githubusercontent.com/ChrisPenner/comonads-by-example/1d7626f759e59ac8019322612ed6d7ff00da75c9/src/Comonads/Traced/Builder.hs | haskell | Uh Oh!
λ> logMsg newBuilder
"worldhello "
msg: balance not sufficient | module Comonads.Traced.Builder where
import Comonads.Traced
import Control.Comonad
import Data.Monoid
import Data.Function ((&))
import qualified Data.Map as M
newBuilder :: Traced [String] String
newBuilder = traced concat
append :: String -> Traced [String] String -> String
append s = trace [s]
logMsg :: Traced [... |
7067cb5aa43aafca0e5f8d9952c432654ce462cd2eacb16d099cfbfb74bcc513 | technomancy/leiningen | foo.clj | (ns sample-ordered-aot.foo)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/test_projects/sample-ordered-aot/src/sample_ordered_aot/foo.clj | clojure | (ns sample-ordered-aot.foo)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| |
fd147991254e7732a6402dad6bb9cdb9c7300da6f0f14a5938b4c2bb16a9ef9f | cocreature/reactand | StackSet.hs | # LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE RecordWildCards #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
module StackSet
( TreeZipper(..)
, StackSet(..)
, Workspace(..)
, Screen(..)
, deleteFromStackSet
, viewWorkspace
, focusUp
, ... | null | https://raw.githubusercontent.com/cocreature/reactand/0da87c0ed8e01882b4d59f93b86726c34e4d8fa0/src/StackSet.hs | haskell | # LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE RecordWildCards #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
module StackSet
( TreeZipper(..)
, StackSet(..)
, Workspace(..)
, Screen(..)
, deleteFromStackSet
, viewWorkspace
, focusUp
, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.