_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 |
|---|---|---|---|---|---|---|---|---|
a5a8505a3c260510cce650cda8265898c4bad5296e60941da435164a4873487e | Gbury/ocaml-memgraph | example.ml |
type location = {
file : string;
start_line : int;
start_column : int;
stop_line : int;
stop_column : int;
}
type namespace =
| Var
| Type
| Term
type id = {
ns : namespace;
name : string;
}
type builtin =
| True | False
| And | Or | Not
type binder =
| Forall | Exists
type descr =
| S... | null | https://raw.githubusercontent.com/Gbury/ocaml-memgraph/017f41ef8439144c5071ece0de9c80266589efb2/examples/ast/conj/example.ml | ocaml |
type location = {
file : string;
start_line : int;
start_column : int;
stop_line : int;
stop_column : int;
}
type namespace =
| Var
| Type
| Term
type id = {
ns : namespace;
name : string;
}
type builtin =
| True | False
| And | Or | Not
type binder =
| Forall | Exists
type descr =
| S... | |
8b3d2d4df439a1812fcc3610bd233c044d8a1823e6421ca6dbe23ce966df40c9 | onedata/op-worker | file_meta_posthooks_behaviour.erl | %%%-------------------------------------------------------------------
@author
( C ) 2023 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Behaviour of a module, that is usi... | null | https://raw.githubusercontent.com/onedata/op-worker/ee1ba1d11be77805e51d52a551da24bf5e060748/src/modules/datastore/models/file/metadata/file_meta_posthooks_behaviour.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Behaviour of a module, that is using file meta posthooks.
@end
-------------------------------------------------------------------
=======================================... | @author
( C ) 2023 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(file_meta_posthooks_behaviour).
-author("Michal Stanisz").
-callback encode_file_meta_posthook_args(file_meta_posthooks:function_name(), [term()]) ->
file_meta_posthooks:encoded_args()... |
a4c2e2d81b84d84d0a665ffdc32e1638d6100a7b4e959fccbf0b9d253f094f93 | duo-lang/duo-lang | Types.hs | module Parser.Types
( -- Kind Parser
monoKindP
, polyKindP
, evalOrderP
Type Parsers
, typeSchemeP
, typP
, typAtomP
, xtorDeclP
, xtorSignatureP
, returnP
, combineXtors
) where
import Text.Megaparsec hiding (State)
import Data.List.NonEmpty (NonEmpty((:|)))
import Parser.Common
import P... | null | https://raw.githubusercontent.com/duo-lang/duo-lang/926c8e843687ee408027c21483aa2369b4cd0580/duo-lang-parser/src/Parser/Types.hs | haskell | Kind Parser
-------------------------------------------------------------------------------
Parsing of linear contexts
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Nominal Types
------------------------... | module Parser.Types
monoKindP
, polyKindP
, evalOrderP
Type Parsers
, typeSchemeP
, typP
, typAtomP
, xtorDeclP
, xtorSignatureP
, returnP
, combineXtors
) where
import Text.Megaparsec hiding (State)
import Data.List.NonEmpty (NonEmpty((:|)))
import Parser.Common
import Parser.Definition
im... |
9b009c239c59c83172e9509f538f9b9bc52f334c567117a71a78622568c4d06b | Innf107/polaris | driver.mli |
val try_update_model : filename:string -> Lexing.lexbuf -> Diagnostic.t list * Model.t option
| null | https://raw.githubusercontent.com/Innf107/polaris/d273b97fa607dd4c70a17a07abd230a921e3817c/polarislsp/driver.mli | ocaml |
val try_update_model : filename:string -> Lexing.lexbuf -> Diagnostic.t list * Model.t option
| |
df9dca314559890aff05ad2a1715b6fc5f064f66b5eadb2592b1dfe82a9ec5b4 | ulfsauer0815/ghmm | Util.hs | -- | General utility functions.
module Util
( eitherToMaybe
, maybeToEither
, fromRight
) where
-- | 'Either' to 'Maybe' discarding the 'Left' value.
eitherToMaybe :: Either b a -> Maybe a
eitherToMaybe = either (const Nothing) Just
-- | 'Maybe' to 'Either', providing the possible 'Left' value.
maybeToEither ... | null | https://raw.githubusercontent.com/ulfsauer0815/ghmm/fc81948316156c67f6af9fe08a8a49472e9a42b8/src/Util.hs | haskell | | General utility functions.
| 'Either' to 'Maybe' discarding the 'Left' value.
| 'Maybe' to 'Either', providing the possible 'Left' value.
| Return the 'Right' value or crash. | module Util
( eitherToMaybe
, maybeToEither
, fromRight
) where
eitherToMaybe :: Either b a -> Maybe a
eitherToMaybe = either (const Nothing) Just
maybeToEither :: b -> Maybe a -> Either b a
maybeToEither _ (Just a) = Right a
maybeToEither d Nothing = Left d
fromRight :: Either b a -> a
fromRight (Right e) ... |
19e864bb1e06160446b7e3e134b3fc78fda83f863a7a25f9fc760d986efca29c | xavierchow/metabase-couchbase-driver | couchbase.clj | (ns metabase.driver.couchbase
"Couchbase driver, since it's nosql database which doesn't 1-to-1 map to the db/table like relational db,
here is the mapping releationship: `database` -> `couchbase bucket`, `table` -> `document with certian _type`"
(:require [clojure.tools.logging :as log]
[metabase.d... | null | https://raw.githubusercontent.com/xavierchow/metabase-couchbase-driver/c76f8fb2252a17446e3c8408342e4e4f3df866e3/src/metabase/driver/couchbase.clj | clojure | (ns metabase.driver.couchbase
"Couchbase driver, since it's nosql database which doesn't 1-to-1 map to the db/table like relational db,
here is the mapping releationship: `database` -> `couchbase bucket`, `table` -> `document with certian _type`"
(:require [clojure.tools.logging :as log]
[metabase.d... | |
75f6c67a5dd9f9217db0b15927a50f15701907dc883924299ecae7dab6291f6c | peterschwarz/clj-gpio | watch.clj | (require 'cljs.build.api)
(cljs.build.api/watch
(cljs.build.api/inputs "src/main/clojure" "src/dev/clojure")
{:main 'gpio.dev
:output-to "target/out/dev.js"
:output-dir "target/out"
:target :nodejs })
| null | https://raw.githubusercontent.com/peterschwarz/clj-gpio/88fedec2605f6ff6713bfca382a9451538e99fe2/scripts/watch.clj | clojure | (require 'cljs.build.api)
(cljs.build.api/watch
(cljs.build.api/inputs "src/main/clojure" "src/dev/clojure")
{:main 'gpio.dev
:output-to "target/out/dev.js"
:output-dir "target/out"
:target :nodejs })
| |
7b2aa11bf700de8a2bffdedfc23eacddbb4ba9c98edd9a7057166451cc911c85 | liqula/react-hs | Flux.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE LambdaCase #
# LANGUAGE MagicHash #
# LANGUA... | null | https://raw.githubusercontent.com/liqula/react-hs/204c96ee3514b5ddec65378d37872266b05e8954/react-hs/src/React/Flux.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE EmptyDataDecls #
# LANGUAGE OverloadedStrings #
| A binding to < React> based on the
< Flux> design. The flux design pushes state
and complicated logic out of the view, allowing the rendering functions and event handlers to be
__Prerequisites__: This module assumes you are fam... | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE LambdaCase #
# LANGUAGE MagicHash #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE S... |
2123e670c9277eb8e0e098995829b62ab656a684212a9d28235017cb1c2a6a48 | Ptival/chick | Eliminator.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - name - shadowing #
module Inductive.Eliminator
( addRecursiveMotive,
mkEliminatorName,
mkCase,
mkEliminatorRawType,
mkEliminatorType,
motive,
unpackConstructors,
)
where
import Data.Default (Default)
import Data.Maybe (fromMayb... | null | https://raw.githubusercontent.com/Ptival/chick/a5ce39a842ff72348f1c9cea303997d5300163e2/backend/lib/Inductive/Eliminator.hs | haskell | # LANGUAGE OverloadedStrings #
we peel from the outermost application
when ran out of indices, peel parameters
if the term is `inductiveName` fully-applied, replace it with an
instantiation of the motive
quantify over constructor parameters, adding recursive hypotheses
can be used as a Variable or as a Var Term
... | # OPTIONS_GHC -fno - warn - name - shadowing #
module Inductive.Eliminator
( addRecursiveMotive,
mkEliminatorName,
mkCase,
mkEliminatorRawType,
mkEliminatorType,
motive,
unpackConstructors,
)
where
import Data.Default (Default)
import Data.Maybe (fromMaybe)
import Data.String (IsString)
im... |
6ff6d981fb4667a551759e3afa009ee5330528e1e7f768e9dd8466f4e5fc0d3b | Psi-Prod/Mehari | file.ml | let not_found = Mehari.(response not_found "")
let response_document ?mime path =
try
let chunk_size = 16384 in
let body =
Mehari.stream (fun consume ->
Eio.Path.with_open_in path (fun flow ->
let buf = Eio.Buf_read.of_flow flow ~max_size:max_int in
let n = ref 0 i... | null | https://raw.githubusercontent.com/Psi-Prod/Mehari/e57202510dd43fa1ce75695cf1ab8f8caa49f0f0/mehari-eio/file.ml | ocaml | let not_found = Mehari.(response not_found "")
let response_document ?mime path =
try
let chunk_size = 16384 in
let body =
Mehari.stream (fun consume ->
Eio.Path.with_open_in path (fun flow ->
let buf = Eio.Buf_read.of_flow flow ~max_size:max_int in
let n = ref 0 i... | |
68d38e01267edc39630b011efcd69b1cddfa08e6636389b1e9710ffd6bed2665 | lamdu/lamdu-calculus | Identifier.hs | -- | This module defines the 'Identifier' type and is meant to be
-- cheaply importable without creaeting import cycles.
# LANGUAGE NoImplicitPrelude , DeriveGeneric , GeneralizedNewtypeDeriving , DerivingStrategies #
module Lamdu.Calc.Identifier
(
-- * Identifier type
Identifier(..)
-- * Hex represen... | null | https://raw.githubusercontent.com/lamdu/lamdu-calculus/7f4189c69056366a7f36245bab0e155f8329728d/src/Lamdu/Calc/Identifier.hs | haskell | | This module defines the 'Identifier' type and is meant to be
cheaply importable without creaeting import cycles.
* Identifier type
* Hex representation of identifier bytes
** Laws
|
> identFromHex . identHex == Right
| A low-level identifier data-type. This is used to identify
variables, type variables, tags... | # LANGUAGE NoImplicitPrelude , DeriveGeneric , GeneralizedNewtypeDeriving , DerivingStrategies #
module Lamdu.Calc.Identifier
(
Identifier(..)
, identHex, identFromHex
) where
import qualified Data.ByteString.Base16 as Hex
import qualified Data.ByteString.Char8 as BS
import qualified Data.Char as Ch... |
264145a887b2565156587cbd308789a6b386d812175c4765bf92a6f7616089e3 | hipsleek/hipsleek | frac.ml | #include "xdebug.cppo"
(* type frac = int * int *)
(* type frac = bool option * (int * int) *)
type frac = bool option * Ratio.ratio
(* let string_of_frac (num, den) = *)
(* (string_of_int num) ^ "/" ^ (string_of_int den) *)
let eq_frac ( n1 , d1 ) ( n2 , d2 ) =
(* (n1 * d2) == (n2 * d1) *)
let less_eq_fra... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/frac.ml | ocaml | type frac = int * int
type frac = bool option * (int * int)
let string_of_frac (num, den) =
(string_of_int num) ^ "/" ^ (string_of_int den)
(n1 * d2) == (n2 * d1)
(n1 * d2) <= (n2 *d1)
need to normalize
let isFull (n,d) = n=d
let isZero (n,d) = n=0 | #include "xdebug.cppo"
type frac = bool option * Ratio.ratio
let eq_frac ( n1 , d1 ) ( n2 , d2 ) =
let less_eq_frac ( n1,d1 ) ( n2,d2 ) =
let subtract ( n1,d1 ) ( n2,d2 ) =
( ( n1*d2 - n2*d1),(d1*d2 ) )
let subtract = Ratio.sub_ratio
;;
let eq_frac (_,r1) (_,r2) =
Ratio.eq_ratio r1 r2
let less_eq_... |
eb26446f910879285dac9b5131754d4306a993b831bf931c0aaab0ef339d1d1c | nvim-treesitter/nvim-treesitter | injections.scm | ((predicate
name: (identifier) @_name
parameters: (parameters (string) @regex))
(#match? @_name "^#?(not-)?(match|vim-match|lua-match)$"))
(comment) @comment
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/67f08570152792c6a4f0815e71a0093ad97f2725/queries/query/injections.scm | scheme | ((predicate
name: (identifier) @_name
parameters: (parameters (string) @regex))
(#match? @_name "^#?(not-)?(match|vim-match|lua-match)$"))
(comment) @comment
| |
0b4f2c65c1a32716ab131c5c4cca3bd35f94bd4f5cd57c2fca46c6b0ad5b15ed | mirage/mirage-net-xen | shared_page_pool.ml |
* Copyright ( c ) 2015
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DIS... | null | https://raw.githubusercontent.com/mirage/mirage-net-xen/52d0109fa9117271551b7757d2d2413b57591ebb/lib/shared_page_pool.ml | ocaml | Fires when free list becomes non-empty
Wake anyone who's still waiting for free pages |
* Copyright ( c ) 2015
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DIS... |
8a1d0491807d35b1a4cc21fbca9cf423dc32d6f980111a42fd2a7bd4ba5b64be | stumpwm/stumpwm | head.lisp | Copyright ( C ) 2003 - 2008
;;
This file is part of stumpwm .
;;
stumpwm is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 , or ( at your option )
;; any later version.
stumpwm is ... | null | https://raw.githubusercontent.com/stumpwm/stumpwm/f22c7d59196e8ccd715b4fee5ce551a7af5fbb03/head.lisp | lisp |
you can redistribute it and/or modify
either version 2 , or ( at your option )
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
along with this software; see the file COPY... | Copyright ( C ) 2003 - 2008
This file is part of stumpwm .
it under the terms of the GNU General Public License as published by
stumpwm is distributed in the hope that it will be useful ,
You should have received a copy of the GNU General Public License
(in-package #:stumpwm)
(export '(current-head))
... |
4ec39a317173a9008f3f43d86baba69b6c58e07602d8cd10b40b7e9a08e6bec5 | mcapodici/badlanguage | Util.hs | module Parser.Util (mapLeft) where
mapLeft :: (a -> b) -> Either a c -> Either b c
mapLeft f (Left x) = Left $ f x
mapLeft _ (Right x) = Right x
| null | https://raw.githubusercontent.com/mcapodici/badlanguage/dcf4662907671a9eb00ba5c0be98de9e81c7d8da/src/Parser/Util.hs | haskell | module Parser.Util (mapLeft) where
mapLeft :: (a -> b) -> Either a c -> Either b c
mapLeft f (Left x) = Left $ f x
mapLeft _ (Right x) = Right x
| |
c17fe9f49d938ddeb20e82b99da373d362ef24fb2aa298d4d573b8b23fb2c82e | stackbuilders/rollbar-haskell | ClientSpec.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
module Rollbar.ClientSpec
( spec
) where
import qualified Data.Aeson.KeyMap as KM
import Control.Monad.Reader
import Data.Aeson
import Data.Text
import Data.Yaml.Config
import Roll... | null | https://raw.githubusercontent.com/stackbuilders/rollbar-haskell/4ed679e34a1ddf5859f4f44414744d1012ab5eaa/rollbar-client/test/Rollbar/ClientSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
module Rollbar.ClientSpec
( spec
) where
import qualified Data.Aeson.KeyMap as KM
import Control.Monad.Reader
import Data.Aeson
import Data.Text
import Data.Yaml.Config
import Rollbar.Client
import Test.Hspec
data ... |
af3623fe582539ca3d1c3d4434dbdb44020bea2404fb01caea9c5a339016515f | yurug/ocaml4.04.0-copatterns | paper.ml | (* Benchmarks. *)
let bench f = Unix.(
let start = Unix.gettimeofday () in
let y = f () in
let stop = Unix.gettimeofday () in
(y, stop -. start)
)
* The cotype stream with two observations : Head and Tail .
type 'a !stream = {
Head : 'a;
Tail : 'a !stream;
}
let rec ( ** ) f n =
if n = 0 the... | null | https://raw.githubusercontent.com/yurug/ocaml4.04.0-copatterns/b3ec6a3cc203bd2cde3b618546d29e10f1102323/playground/paper.ml | ocaml | Benchmarks.
* Fibonacci examples.
* - Without memoization.
* -- With memoization.
* Simple example of nested copattern matching.
* An indexed codatatype for fair bistream.
* Game of life and zippers.
Version 1
Benchs. |
let bench f = Unix.(
let start = Unix.gettimeofday () in
let y = f () in
let stop = Unix.gettimeofday () in
(y, stop -. start)
)
* The cotype stream with two observations : Head and Tail .
type 'a !stream = {
Head : 'a;
Tail : 'a !stream;
}
let rec ( ** ) f n =
if n = 0 then fun x -> x
els... |
28d9a1278d0cdcc5b80ad65ff5384efa2e8dfcc991b87df030d92b03bdd6963f | nuvla/api-server | credential_api_key_lifecycle_test.clj | (ns sixsq.nuvla.server.resources.credential-api-key-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest is use-fixtures]]
[environ.core :as env]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/test/sixsq/nuvla/server/resources/credential_api_key_lifecycle_test.clj | clojure | admin/user query should succeed but be empty (no credentials created yet)
anonymous credential collection query should not succeed
creating a new credential without reference will fail for all types of users
expect 400 because href can not be accessed
create a credential as a normal user
resource id and the uri (... | (ns sixsq.nuvla.server.resources.credential-api-key-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest is use-fixtures]]
[environ.core :as env]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server... |
657903b48ee89427bac21b9a4a6deaef83bbafa2facff9ba6f9f474189e784e6 | coq/coq | proof_diffs_test.ml | open OUnit
open Utest
open Pp_diff
open Proof_diffs
(* Needed to be able to set through goptions *)
let () =
let open Names in
Lib.start_compilation DirPath.dummy (ModPath.MPfile DirPath.dummy)
let tokenize_string = Proof_diffs.tokenize_string
let diff_pp = diff_pp ~tokenize_string
let diff_str = diff_str ~tokeni... | null | https://raw.githubusercontent.com/coq/coq/29e1b3766875e0ba33a00f8ea42b85cb361609f5/test-suite/unit-tests/printing/proof_diffs_test.ml | ocaml | Needed to be able to set through goptions
todo: OCaml: why can't the body of the test function be given in the add_test line?
checks background is present and correct
todo: awaiting a change in the lexer to return the quotes of the string token
a : uint
b : int car ->
b : car
a : uint int
DIFFS
b :... | open OUnit
open Utest
open Pp_diff
open Proof_diffs
let () =
let open Names in
Lib.start_compilation DirPath.dummy (ModPath.MPfile DirPath.dummy)
let tokenize_string = Proof_diffs.tokenize_string
let diff_pp = diff_pp ~tokenize_string
let diff_str = diff_str ~tokenize_string
let tests = ref []
let add_test name ... |
8d4ca873125de1f64dc39e7a984270fd0a9b6d7ea3839f988915d7af5605d0d9 | devaspot/brace | jxat_implicit_do.erl | -module(jxat_implicit_do).
-export([given/3, 'when'/3, then/3]).
-include_lib("eunit/include/eunit.hrl").
given([a,module,that,has,an,anonymous,function], _State, _) ->
Source = <<"(ns jxat-implicit-do-test
(require io))
(defn t1 ()
(let* (a 1)
... | null | https://raw.githubusercontent.com/devaspot/brace/8494573efef63f4b2f39dd36e8c651a487223f20/test/jxat_implicit_do.erl | erlang | -module(jxat_implicit_do).
-export([given/3, 'when'/3, then/3]).
-include_lib("eunit/include/eunit.hrl").
given([a,module,that,has,an,anonymous,function], _State, _) ->
Source = <<"(ns jxat-implicit-do-test
(require io))
(defn t1 ()
(let* (a 1)
... | |
2172abb6f738f5da6b59d02d699d1e3745857af7513afaf814187ea83335b627 | jlongster/schemeray | runtime-types-support.scm |
(define *type-field-table* (make-table))
(define *last-record-type-id* 0)
| null | https://raw.githubusercontent.com/jlongster/schemeray/0ea0f1596cbafa05e541131fd64d482c79dd4173/ports/prescheme/runtime-types-support.scm | scheme |
(define *type-field-table* (make-table))
(define *last-record-type-id* 0)
| |
4f814e23342422c0c2d9622d7b9b0e12b54cb8f59d8ad5526664fcc616144f2a | ocaml-flambda/ocaml-jst | filename.mli | # 1 "filename.mli"
(**************************************************************************)
(* *)
(* OCaml *)
(* ... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/5bf2820278c58f6715dcfaf6fa61e09a9b0d8db3/stdlib/filename.mli | ocaml | ************************************************************************
OCaml
... | # 1 "filename.mli"
, projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open! Stdlib
val current_dir_name : string
val parent_dir_name : string
val dir_se... |
0ab6f7730ddc86424993017ae40406ab5c25df1a212b981a0a7caf6c5cee6749 | tommaisey/aeon | sin.help.scm | ;; (u:sin a)
Sine .
(let* ((a (line kr (- pi) pi 1 remove-synth))
(b (sub (fdiv (u:sin a) (/ pi 2)) 1))
(f (mul-add b 900 1600)))
(audition
(out 0 (mul (sin-osc ar f 0) 0.1))))
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/unary-ops/sin.help.scm | scheme | (u:sin a) |
Sine .
(let* ((a (line kr (- pi) pi 1 remove-synth))
(b (sub (fdiv (u:sin a) (/ pi 2)) 1))
(f (mul-add b 900 1600)))
(audition
(out 0 (mul (sin-osc ar f 0) 0.1))))
|
01da601c7d67f9e1ff40877e7bb22f4f4c17ed6e1b3dec7b3cd8977cf1626bb5 | CSCfi/rems | test_handler.clj | (ns ^:integration rems.test-handler
(:require [clojure.test :refer :all]
[mount.core :as mount]
[rems.api.testing :refer [api-fixture read-ok-body]]
[rems.common.git :as git]
[rems.config :refer [env]]
[rems.handler :refer :all]
[ring.mock.reques... | null | https://raw.githubusercontent.com/CSCfi/rems/730651880b6f9ef3047bb700972f0dea06075d32/test/clj/rems/test_handler.clj | clojure | we shouldn't need the db here, but there is no handler-without-db
fixture at the moment
check that we didn't get e.g. the fallback HTML | (ns ^:integration rems.test-handler
(:require [clojure.test :refer :all]
[mount.core :as mount]
[rems.api.testing :refer [api-fixture read-ok-body]]
[rems.common.git :as git]
[rems.config :refer [env]]
[rems.handler :refer :all]
[ring.mock.reques... |
6812343311cb73d7686ec875abaf4211382718c04a41ecc35b2f4affa4213fcb | yetanalytics/xapipe | main.clj | (ns com.yetanalytics.xapipe.main
(:require [clojure.spec.alpha :as s]
[clojure.tools.logging :as log]
[com.yetanalytics.xapipe.cli :as cli]
[com.yetanalytics.xapipe.cli.options :as opts]
[com.yetanalytics.xapipe.job :as job]
[com.yetanalytics.xapipe.job.json... | null | https://raw.githubusercontent.com/yetanalytics/xapipe/c2c0a41590138a2a8c7bfedc46fd6e02dae4b263/src/cli/com/yetanalytics/xapipe/main.clj | clojure | If job-id arg is set, we make sure they match
Found in storage
If the user has requested force resume we clear
Json is provided
New from options!
Check job for validity!
Check job for Errors! | (ns com.yetanalytics.xapipe.main
(:require [clojure.spec.alpha :as s]
[clojure.tools.logging :as log]
[com.yetanalytics.xapipe.cli :as cli]
[com.yetanalytics.xapipe.cli.options :as opts]
[com.yetanalytics.xapipe.job :as job]
[com.yetanalytics.xapipe.job.json... |
bd9bf23e1ff890dd6c262cc47fc3c5740cdb825f41b24db2d49022d0f9b8d4d5 | ghc/packages-dph | Elems.hs | # LANGUAGE CPP , NoMonomorphismRestriction #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Stream.Elems
( streamElemsFromVector
, streamElemsFromVectors
, streamElemsFromVectorsVSegd)
where
import Data.Array.Parallel.Unlifted.Stream.Ixs
import Data.Vector.Fusion.Bundle.Monadic ... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-seq/Data/Array/Parallel/Unlifted/Stream/Elems.hs | haskell | | Take a stream of indices,
look them up from a vector,
and produce a stream of elements.
# INLINE_INNER mkStep' #
| Take a stream of chunk and chunk element indices,
look them up from some vectors,
and produce a stream of elements.
# INLINE_INNER mkStep' #
| Take a stream of virtual segment ids ... | # LANGUAGE CPP , NoMonomorphismRestriction #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Stream.Elems
( streamElemsFromVector
, streamElemsFromVectors
, streamElemsFromVectorsVSegd)
where
import Data.Array.Parallel.Unlifted.Stream.Ixs
import Data.Vector.Fusion.Bundle.Monadic ... |
3f92ac8427e08ba027bf64287f28d783361e541ef156ffdad9b70de080128c2d | triffon/fp-2021-22 | 01.introduction.rkt | #lang racket
; REPL
; read evaluate print loop
(+ 12.1 15 2 13)
; (<функция> <арг1> <арг2> ... <арг-н>)
(define a (+ 3 2))
(define b (+ a 2))
; immutability
; environment - среда
a = > 5
b = > 7
(+ a b)
(define (add2 x)
(+ x 2)
)
(add2 9)
( if < условие > < израз , ако условието е вярно > < израз за инач... | null | https://raw.githubusercontent.com/triffon/fp-2021-22/beb9f5cfedfa2124fab797ecd92dbe7ac53e4474/exercises/7/class/01.introduction.rkt | racket | REPL
read evaluate print loop
(<функция> <арг1> <арг2> ... <арг-н>)
immutability
environment - среда
short circuit
{
}
factorial n = n * factorial (n - 1)
fib n = fib (n - 1) + fib (n - 2)
(fib 5) | #lang racket
(+ 12.1 15 2 13)
(define a (+ 3 2))
(define b (+ a 2))
a = > 5
b = > 7
(+ a b)
(define (add2 x)
(+ x 2)
)
(add2 9)
( if < условие > < израз , ако условието е вярно > < израз за иначе ( else ) > )
( if # t ( display " less than 5 " ) ( p 2 ) )
(define (p x)
(p x)
)
while ( a < 5 )
(de... |
059dea4309f2e204388949c921ac15ebb5e6bf651efd582db712ba44d9c464df | babashka/sci | doseq_macro.cljc | (ns sci.impl.doseq-macro
{:no-doc true}
(:require [sci.impl.utils :refer [allowed-loop allowed-recur]]))
;; based on the source of clojure.core/doseq
(defn assert-args [seq-exprs _body-exprs]
(when-not (vector? seq-exprs)
(throw (new #?(:clj IllegalArgumentException :cljs js/Error)
"doseq re... | null | https://raw.githubusercontent.com/babashka/sci/c5be5aaf7b0b166b39e92a0fbe812c87d1aa2d7e/src/sci/impl/doseq_macro.cljc | clojure | based on the source of clojure.core/doseq | (ns sci.impl.doseq-macro
{:no-doc true}
(:require [sci.impl.utils :refer [allowed-loop allowed-recur]]))
(defn assert-args [seq-exprs _body-exprs]
(when-not (vector? seq-exprs)
(throw (new #?(:clj IllegalArgumentException :cljs js/Error)
"doseq requires a vector for its binding")))
(when-n... |
4f321338b7a079c046481c4adda8ed4aede2da528b891a0ab0f7d9c144fd6671 | Verites/verigraph | Base.hs | {-# LANGUAGE OverloadedStrings #-}
module Logic.Ctl.Base
( Expr(..)
, PathQuantified(..)
, StateQuantified(..)
) where
import Data.Text.Prettyprint.Doc
-- | CTL expressions
data Expr
= Literal Bool
| Atom String
| Not Expr
| And Expr Expr
| Or Expr Expr
| Implies Expr Expr
| Equiv Exp... | null | https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/src/library/Logic/Ctl/Base.hs | haskell | # LANGUAGE OverloadedStrings #
| CTL expressions | module Logic.Ctl.Base
( Expr(..)
, PathQuantified(..)
, StateQuantified(..)
) where
import Data.Text.Prettyprint.Doc
data Expr
= Literal Bool
| Atom String
| Not Expr
| And Expr Expr
| Or Expr Expr
| Implies Expr Expr
| Equiv Expr Expr
| Temporal (PathQuantified Expr)
deriving (Eq... |
215855575ac8b827e234214ba0438d30ebcc029c9fa4cdf524ca0405f09a2b74 | acieroid/overscore | knn.clj | ;;; Classify symbols (described by a segment of an image) using
;;; k-Nearest-Neighbours algorithm
(ns overscore.recognition.classification.knn
(:use overscore.recognition.segmentation.segment
overscore.recognition.classification.training
overscore.recognition.classification.hausdorff
overscor... | null | https://raw.githubusercontent.com/acieroid/overscore/71649b37c415482b6c4ab150290ef0719649d359/src/overscore/recognition/classification/knn.clj | clojure | Classify symbols (described by a segment of an image) using
k-Nearest-Neighbours algorithm
No neighbour (should not happen if the training set is not empty)
Return the most frequent class within the neighbours | (ns overscore.recognition.classification.knn
(:use overscore.recognition.segmentation.segment
overscore.recognition.classification.training
overscore.recognition.classification.hausdorff
overscore.recognition.classification.euclidian)
(:import java.awt.image.BufferedImage))
(defn k-min
"R... |
8c1b05977f0ae46419c831bdcac25bd8d1508a879e70642c02039b190bf93004 | Mesabloo/nihil | Kind.hs | # LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
module Nihil.TypeChecking.Rules.Unification.Kind
() where
import Nihil.TypeChecking.Unification
import Nihil.TypeChecking.Core
import Nihil.TypeChecking.Substitution
import Nihil.TypeChecking.Errors.Infinite (infin... | null | https://raw.githubusercontent.com/Mesabloo/nihil/3821052ca5691a6492b23bd8a46bfe70567d374f/src/typechecker/Nihil/TypeChecking/Rules/Unification/Kind.hs | haskell | # LANGUAGE TypeSynonymInstances #
| Tries to bind a kind variable to a kind (checking for infinite kinds). | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Nihil.TypeChecking.Rules.Unification.Kind
() where
import Nihil.TypeChecking.Unification
import Nihil.TypeChecking.Core
import Nihil.TypeChecking.Substitution
import Nihil.TypeChecking.Errors.Infinite (infiniteKind)
import Nihil.TypeChecking.Err... |
47721c01f8925cb29001ac226f91983f0b9c722d4217f0db5bea0babab8fddae | exercism/scheme | test.scm | (load "test-util.ss")
(define (matches? result expected)
(let ([get-count (if (hashtable? result)
(lambda (word) (hashtable-ref result word 0))
(lambda (word)
(cond [(assoc word result) => cdr] [else 0])))])
(and (= (length expected)
... | null | https://raw.githubusercontent.com/exercism/scheme/2064dd5e5d5a03a06417d28c33c5349bec97dad7/exercises/practice/word-count/test.scm | scheme | (load "test-util.ss")
(define (matches? result expected)
(let ([get-count (if (hashtable? result)
(lambda (word) (hashtable-ref result word 0))
(lambda (word)
(cond [(assoc word result) => cdr] [else 0])))])
(and (= (length expected)
... | |
edb381fe1de2d4dd357ed06a7625410e55b5e09d0ec66a6df0ec2670e8a7d8b2 | Mayvenn/storefront | flash.cljc | (ns storefront.components.flash
(:require [storefront.component :as component :refer [defcomponent]]
[storefront.components.svg :as svg]
[storefront.components.ui :as ui]
[storefront.keypaths :as keypaths]))
(defn success-img []
(svg/circled-check {:class "stroke-p-color"
... | null | https://raw.githubusercontent.com/Mayvenn/storefront/dc3a28dd389513a4795731a547570fefbebf0158/src-cljc/storefront/components/flash.cljc | clojure | (ns storefront.components.flash
(:require [storefront.component :as component :refer [defcomponent]]
[storefront.components.svg :as svg]
[storefront.components.ui :as ui]
[storefront.keypaths :as keypaths]))
(defn success-img []
(svg/circled-check {:class "stroke-p-color"
... | |
a2b708baa18c93919c5473cbf9f8665bad374de429c1b76c75e0e5ba1810f959 | zkincaid/srk | srkZ3.mli | * Interface to { { : } Z3 } SMT solver
open Syntax
open Interpretation
type z3_context = Z3.context
type z3_expr = Z3.Expr.expr
type z3_func_decl = Z3.FuncDecl.func_decl
type 'a open_expr = [
| `Real of QQ.t
| `App of z3_func_decl * 'a list
| `Var of int * typ_fo
| `Add of 'a list
| `Mul of 'a list
| `Bi... | null | https://raw.githubusercontent.com/zkincaid/srk/4809f2b697c02d9e020e4de2c0b11ff4a0c59f7f/src/srkZ3.mli | ocaml | * Convert a Z3 expression into a term. Raises [Invalid_argument] on
failure.
* Convert a Z3 expression into a formula. Raises [Invalid_argument] on
failure.
* Convert a Z3 expression into an expression. Raises [Invalid_argument] on
failure.
* Compute a model of a solver's context. The model is abstra... | * Interface to { { : } Z3 } SMT solver
open Syntax
open Interpretation
type z3_context = Z3.context
type z3_expr = Z3.Expr.expr
type z3_func_decl = Z3.FuncDecl.func_decl
type 'a open_expr = [
| `Real of QQ.t
| `App of z3_func_decl * 'a list
| `Var of int * typ_fo
| `Add of 'a list
| `Mul of 'a list
| `Bi... |
9931d869ac4e7e014cd717dc6b30475367c3667986098ee411bca9da2748e069 | ryukzak/nitta | OptimizeAccum.hs | -- All extensions should be enabled explicitly due to doctest in this module.
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE ImportQualifiedPost #
# LANGUAGE LambdaCase #
# LAN... | null | https://raw.githubusercontent.com/ryukzak/nitta/1e1e571fd73b2cb9bea4e5781bf658e7edd264c0/src/NITTA/Model/Problems/Refactor/OptimizeAccum.hs | haskell | All extensions should be enabled explicitly due to doctest in this module.
# LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
| Function takes algorithm in 'DataFlowGraph' and return list of 'Refactor' that can be done
| Function takes 'OptimizeAccum' and modify 'DataFlowGraph'
| Create Map String (HistoryTree (F v x)... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE ImportQualifiedPost #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
|
Module : NITTA.Model . Problems . Refa... |
8ad94a8cf42b6cd05d618b463cdbc36d5362f7ae7972625f19ca019cc03401c2 | spawnfest/eep49ers | epp_dodger.erl | %% =====================================================================
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
%% not use this file except in compliance with the License. You may obtain
%% a copy of the License at <-2.0>
%%
%% Unless required by applicable law or agreed to in w... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/syntax_tools/src/epp_dodger.erl | erlang | =====================================================================
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.... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
distributed under the License is distributed on an " AS IS " BASIS ,
General Public License ( the " LGPL " ) as published by the Free Software
Foundation ; either version 2.1 , or ( at your option ) any later version .
either the Ap... |
d64c2fb2730efef0b69862ef361256428174b506886943300bfd852a093ee0a3 | ormf/cm | stoh.lisp | ;;; **********************************************************************
Copyright ( C ) 2006
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the Lisp Lesser Gnu Public License .
See for the text of this agreement .
;;; ***************************************... | null | https://raw.githubusercontent.com/ormf/cm/26843eec009bd6c214992a8e67c49fffa16d9530/etc/contrib/stoh.lisp | lisp | **********************************************************************
This program is free software; you can redistribute it and/or
**********************************************************************
$Revision$
(sal "load \"~/404A/sal/test.sal\"")
}
}
}
}
}
}
}
}
}
\">Download source: ")
\ " alt=\"Val... | Copyright ( C ) 2006
modify it under the terms of the Lisp Lesser Gnu Public License .
See for the text of this agreement .
$ Date$
(in-package cm)
(defmacro getchar (x s)
`(progn (setq ,x (read-char ,s nil ':eof))
(if (eq ,x ':eof) (return-from :read ':eof))))
(defun begspan (out type)
(format out ... |
62cd2f1dfde08abb106304517aff10192b0985d2c777e9f6a89da51c82607e52 | gga/json-path | json_path.clj | (ns json-path
[:require [json-path.parser :as parser]
[json-path.match :as m]
[json-path.walker :as walker]])
(defn query [path object]
(walker/walk (parser/parse-path path) {:root (m/root object)}))
(defn at-path [path object]
(walker/map# :value (query path object)))
| null | https://raw.githubusercontent.com/gga/json-path/bfb1e78433b0b56c175b7334c489fe10b2b8fc92/src/json_path.clj | clojure | (ns json-path
[:require [json-path.parser :as parser]
[json-path.match :as m]
[json-path.walker :as walker]])
(defn query [path object]
(walker/walk (parser/parse-path path) {:root (m/root object)}))
(defn at-path [path object]
(walker/map# :value (query path object)))
| |
2053ac709015489c4b37c322024a15ed3138eb33d8bd16750476204e521c6317 | owlbarn/light_actor | actor_sys_unix.ml |
* Light Actor - Parallel & Distributed Engine of Owl System
* Copyright ( c ) 2016 - 2019 < >
* Light Actor - Parallel & Distributed Engine of Owl System
* Copyright (c) 2016-2019 Liang Wang <>
*)
let sleep = Lwt_unix.sleep
| null | https://raw.githubusercontent.com/owlbarn/light_actor/d5ca76db0a58c61cd0ba019be458dada3ce9c36a/src/unix/actor_sys_unix.ml | ocaml |
* Light Actor - Parallel & Distributed Engine of Owl System
* Copyright ( c ) 2016 - 2019 < >
* Light Actor - Parallel & Distributed Engine of Owl System
* Copyright (c) 2016-2019 Liang Wang <>
*)
let sleep = Lwt_unix.sleep
| |
03fa069fc835e6af107851d9f337e25b0f58c5f2e5f072a8b5e31a7a974a95f0 | dedbox/racket-template | scopes.rkt | Copyright 2020 < >
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, software
distributed under t... | null | https://raw.githubusercontent.com/dedbox/racket-template/7e8cd438cdc168b74b1a23721d3410be330de209/tests/scopes.rkt | racket |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2020 < >
distributed under the License is distributed on an " AS IS " BASIS ,
#lang racket/base
(require template (for-syntax racket/base template))
(module+ test
(require racket/function
rackunit
rackunit/text-ui
(for-syntax racket/base
rack... |
c35b5180d14c0f4035e7b5a7320ff88cab0369d3b259aaca5b0487f5ed217909 | informatimago/lisp | bset.lisp | -*- coding : utf-8 -*-
;;;;****************************************************************************
FILE : bset.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
;;;; See defpackage documentation string.
;;;;
< PJB > ... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/common-lisp/cesarum/bset.lisp | lisp | ****************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
See defpackage documentation string.
This is not as lispy as could be (we may want to have sets
of random lisp objects, notably symbols), but it's optim... | -*- coding : utf-8 -*-
FILE : bset.lisp
USER - INTERFACE :
< PJB > < >
MODIFICATIONS
2004 - 02 - 18 < PJB > Created .
AGPL3
Copyright 2004 - 2016
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , eithe... |
94003c8747eccbb998f5e3d9f0ff9ea6f2c27a54d15f158200c27f278ba4488d | raviksharma/bartosz-basics-of-haskell | ex1.hs | -- Ex 1. Define join for Maybe (don't be surprised how simple it is):
join :: Maybe (Maybe a) -> Maybe a
join Nothing = Nothing
join (Just mb) = mb
test1, test2, test3 :: Maybe (Maybe String)
test1 = Nothing
test2 = Just Nothing
test3 = Just (Just "a little something")
main = do
print $ join test1
print $ jo... | null | https://raw.githubusercontent.com/raviksharma/bartosz-basics-of-haskell/86d40d831f61415ef0022bff7fe7060ae6a23701/12-the-list-monad/ex1.hs | haskell | Ex 1. Define join for Maybe (don't be surprised how simple it is): |
join :: Maybe (Maybe a) -> Maybe a
join Nothing = Nothing
join (Just mb) = mb
test1, test2, test3 :: Maybe (Maybe String)
test1 = Nothing
test2 = Just Nothing
test3 = Just (Just "a little something")
main = do
print $ join test1
print $ join test2
print $ join test3
|
04ee50d24aef658eb184bdb45ea506190e766873e717c5717317055b19f8ecd4 | google/orthotope | Dynamic.hs | Copyright 2020 Google LLC
--
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- -2.0
--
-- Unless required by applicable law or agreed to in writing, software
distributed un... | null | https://raw.githubusercontent.com/google/orthotope/8b11f152670ecbb34c6bd4055ee022484e3cbfbe/Data/Array/Internal/Dynamic.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2020 Google LLC
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# OPTIONS_GHC -Wno - orphans #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiPar... |
eb38aad70b319a9480c2c8cb75e0caf3846f6625497dce6a1afec9e7fa9f9233 | CyberCat-Institute/open-game-engine | ArrowTest.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module ArrowTest where
import GHC.Real
import Data.Bool
import Data.List
import Data.Bifunctor
import Test.Hspec as Spec
import Test.QuickCheck
import Language.Haskell.TH.... | null | https://raw.githubusercontent.com/CyberCat-Institute/open-game-engine/86031c42bf13178554c21cd7ab9e9d18f1ca6963/tests/ArrowTest.hs | haskell | main :: IO ()
main = do
hspec $ parallel $ do
describe "testing quasiquoted AST" $ parallel $ do
ref <- Spec.runIO $ TH.runQ $ (Just . THS.compileBlock <$> convertLines simple)
it "should parse the same freeOpenGame" $ do
parseLambdaAsOpenGame rangeTest
it "should be the same b... | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module ArrowTest where
import GHC.Real
import Data.Bool
import Data.List
import Data.Bifunctor
import Test.Hspec as Spec
import Test.QuickCheck
import Language.Haskell.TH.... |
906bb4d0bc887ac277e7ef942effba935f817b3863a3884b6b1dc870b4294685 | ygmpkk/house | Lazy.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.STRef.Lazy
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portability : non-porta... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/base/Data/STRef/Lazy.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.STRef.Lazy
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (requires non-portable module ST)
Mutable references in the lazy S... | Copyright : ( c ) The University of Glasgow 2001
module Data.STRef.Lazy (
* STRefs
abstract , instance
) where
import Control.Monad.ST.Lazy
import qualified Data.STRef as ST
newSTRef :: a -> ST s (ST.STRef s a)
readSTRef :: ST.STRef s a -> ST s a
writeSTRef :: ST.STRef s a -> a -> ST s ()
modifySTR... |
5e7f50e173809e94ef9109f323f205e258425c5a93870cd5a8d8096307c777d6 | dongcarl/guix | ipfs.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2018 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the Lice... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/tests/ipfs.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2018 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (test-ipfs)
#:use-module (guix ipfs)
#:use-module ((guix utils) #:select (call-with-temporary-d... |
d0643269431b083632ae4f4591265d7bd1ef201387500861f7daeb8656225c64 | fdopen/uwt | t_unix.ml | open OUnit2
open Lwt.Infix
open Common
let is_http x =
if x.Unix.s_port <> 80 then
false
else
match String.lowercase x.Unix.s_name with
| "http" | "www" -> true
| _ -> false
type 'a t =
| Exn of exn
| Result of 'a
let runix f a =
try
Result(f a)
with
| exn -> Exn exn
let ruwt (t:'a... | null | https://raw.githubusercontent.com/fdopen/uwt/44276aa6755b92eddc9ad58662a968afad243e8b/test/t_unix.ml | ocaml | open OUnit2
open Lwt.Infix
open Common
let is_http x =
if x.Unix.s_port <> 80 then
false
else
match String.lowercase x.Unix.s_name with
| "http" | "www" -> true
| _ -> false
type 'a t =
| Exn of exn
| Result of 'a
let runix f a =
try
Result(f a)
with
| exn -> Exn exn
let ruwt (t:'a... | |
6bc566f9f8bc8cbd7f55d3017e7d87c3d9dbfd6fb2b43a5f16abbd21e9141eb0 | samsergey/formica | tacit-tests.rkt | #lang racket/base
(require "../tacit.rkt"
"../rewrite.rkt"
"test-utils.rkt"
rackunit)
(define/c (m f)
(/. (cons h t) --> (cons (f h) (m f t))
'() x ... --> (? (andmap null? x)) '()
l1 ... --> (cons (apply f (m car l1))
(apply m f (m cdr l1)))))
(tes... | null | https://raw.githubusercontent.com/samsergey/formica/b4410b4b6da63ecb15b4c25080951a7ba4d90d2c/tests/tacit-tests.rkt | racket | #lang racket/base
(require "../tacit.rkt"
"../rewrite.rkt"
"test-utils.rkt"
rackunit)
(define/c (m f)
(/. (cons h t) --> (cons (f h) (m f t))
'() x ... --> (? (andmap null? x)) '()
l1 ... --> (cons (apply f (m car l1))
(apply m f (m cdr l1)))))
(tes... | |
7416d72abff48b4e0e32ad15ee5d4f3d1d305125c09988a46843c66300fc40f3 | zkincaid/duet | solve.ml | module S = Set
open Core
open Srk
open Ai
open CfgIr
module Pack = Afg.Pack
include Log.Make(struct let name = "solve" end)
(** Number of times a widening vertex can be evaluated before widening is
applied *)
let widening_limit = ref 1
(** Graph signature for the solve functors *)
module type G = sig
type t
... | null | https://raw.githubusercontent.com/zkincaid/duet/eb3dbfe6c51d5e1a11cb39ab8f70584aaaa309f9/duet/solve.ml | ocaml | * Number of times a widening vertex can be evaluated before widening is
applied
* Graph signature for the solve functors
solve implementation
Don't compute output until input is printed - it gives us better
traces.
todo: build vertex enum more efficiently
override default do_analysis
* Full error r... | module S = Set
open Core
open Srk
open Ai
open CfgIr
module Pack = Afg.Pack
include Log.Make(struct let name = "solve" end)
let widening_limit = ref 1
module type G = sig
type t
module V : Graph.Sig.VERTEX
module E : Graph.Sig.EDGE with type vertex = V.t
val iter_vertex : (V.t -> unit) -> t -> unit
val it... |
4d947823a9f8d59db586f1b9d6aa95687ec00821fb12c3951a4547a008f09d92 | facebook/infer | HashNormalizer.ml |
* Copyright ( c ) Facebook , Inc. and its 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) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/c16e1ccebeed0220b1aeefc338cd2f273b0a8fe9/infer/src/istd/HashNormalizer.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its 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) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
c12c00f5078cfa8ce661c1bb43b18d06130883d7e061f34e02094ecf08ff1ddf | obsidiansystems/gargoyle | gargoyle-psql.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.List
import System.Environment
import System.Exit
import Gargoyle.PostgreSQL
main :: IO ()
main = do
args <- getArgs
case args of
[dbPath] -> psqlLocal defaultPostgres "psql" dbPath Nothing
_ -> do
pname <- getProgName
putStrLn ... | null | https://raw.githubusercontent.com/obsidiansystems/gargoyle/df0068f9572c1371bed7aa416af84d462c3574c0/gargoyle-postgresql/src-bin/gargoyle-psql.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import Data.List
import System.Environment
import System.Exit
import Gargoyle.PostgreSQL
main :: IO ()
main = do
args <- getArgs
case args of
[dbPath] -> psqlLocal defaultPostgres "psql" dbPath Nothing
_ -> do
pname <- getProgName
putStrLn $ intercalate " "
[ "USAGE:... |
cc6eb69a663db414858f9876559a53df84d6df7562796d31b00db5f0162b0cf2 | nixeagle/nisp | empty-package.lisp | ;;;; Handle the creation, and deletion of empty packages.
;;; Contained here is lisp that creates a totally empty package with
;;; nothing in it by a given name, or by a unique name. Additionally a
;;; few macros are exported to handle the basic use cases with clean
;;; syntax.
;;;
;;; This by itself does not ensure sa... | null | https://raw.githubusercontent.com/nixeagle/nisp/680b40b3b9ea4c33db0455ac73cbe3756afdbb1e/safe/empty-package.lisp | lisp | Handle the creation, and deletion of empty packages.
Contained here is lisp that creates a totally empty package with
nothing in it by a given name, or by a unique name. Additionally a
few macros are exported to handle the basic use cases with clean
syntax.
This by itself does not ensure safety of foreign code
... | include giving each ' user ' their own namespace so experiments by one
(in-package :nisp-empty-package)
(deftestsuite root-suite () ())
(defun make-empty-package (name)
"Create an empty package called NAME.
This is just a wrapper around (make-package) with extra arguments to
ensure the generated package really ... |
144d2fb2cb2055997918ad2220945c8afd99841d93470ac8dfcf6b8db89b7019 | AbstractMachinesLab/caramel | hashtbl.ml | module type S = Hashtbl_intf.S
module Make (H : sig
include Hashable.S
val to_dyn : t -> Dyn.t
end) =
struct
include MoreLabels.Hashtbl.Make (H)
let[@ocaml.warning "-32"] add = `Use_set
let find = find_opt
let find_exn t key =
match find_opt t key with
| Some v -> v
| None -> Code_error.rai... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/vendor/stdune/hashtbl.ml | ocaml | module type S = Hashtbl_intf.S
module Make (H : sig
include Hashable.S
val to_dyn : t -> Dyn.t
end) =
struct
include MoreLabels.Hashtbl.Make (H)
let[@ocaml.warning "-32"] add = `Use_set
let find = find_opt
let find_exn t key =
match find_opt t key with
| Some v -> v
| None -> Code_error.rai... | |
2ab599a1d4cf95023b781e5b039c6cf8723e63deae27ad77e5be832238810fec | polyfy/polylith | project_test.clj | (ns polylith.clj.core.workspace.project-test
(:require [clojure.test :refer :all]
[polylith.clj.core.workspace.project :as proj])
(:refer-clojure :exclude [bases]))
(def components [{:name "change"
:type "component"
:interface {:name "change"}
:inte... | null | https://raw.githubusercontent.com/polyfy/polylith/e3bc4556f5efa0346bd144dfe579a7a453a4464d/components/workspace/test/polylith/clj/core/workspace/project_test.clj | clojure | (ns polylith.clj.core.workspace.project-test
(:require [clojure.test :refer :all]
[polylith.clj.core.workspace.project :as proj])
(:refer-clojure :exclude [bases]))
(def components [{:name "change"
:type "component"
:interface {:name "change"}
:inte... | |
23bb034bad39cd2a9f8fd15c58c5f09d2c366e0f9845b8a9c8bc4d3f2a4e9ec6 | hhucn/decide3 | styles.cljc | (ns decide.ui.theming.styles)
(def hhu-blue "#006AB3")
(def primary hhu-blue)
(def sizing
[:body :html {:height "100%"}])
(def body
[:body {:background-color hhu-blue
:overflow-x "hidden"}])
(def splashscreen
[:#decide {:flex-direction "column"
:height "100%"
:display "flex"}... | null | https://raw.githubusercontent.com/hhucn/decide3/e27ea04033d94a0a61f8118a58050b86ed0f1327/src/main/decide/ui/theming/styles.cljc | clojure | (ns decide.ui.theming.styles)
(def hhu-blue "#006AB3")
(def primary hhu-blue)
(def sizing
[:body :html {:height "100%"}])
(def body
[:body {:background-color hhu-blue
:overflow-x "hidden"}])
(def splashscreen
[:#decide {:flex-direction "column"
:height "100%"
:display "flex"}... | |
75689a5b0d8758ef67c7acb9beaa6d580289ab3b70e99af97aef5b5b33e625cd | fakedata-haskell/fakedata | PearlJam.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.Music.PearlJam where
import Data.Text (Text)
import Faker (Fake(..))
import Faker.Provider.PearlJam
import Faker.TH
$(generateFakeField "pearl_jam" "musicians")
$(generateFakeField "pearl_jam" "albums")
$(generateFakeField "pearl_jam" "so... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Music/PearlJam.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Music.PearlJam where
import Data.Text (Text)
import Faker (Fake(..))
import Faker.Provider.PearlJam
import Faker.TH
$(generateFakeField "pearl_jam" "musicians")
$(generateFakeField "pearl_jam" "albums")
$(generateFakeField "pearl_jam" "songs")
|
a8c94ecda0181551705ff05b9ff98479278e180c8c65376b6fabeebe377c2184 | rems-project/lem | ast.ml | generated by Ott 0.31 from : lem.ott
type text = Ulib.Text.t
type l =
| Unknown
| Trans of bool (* do pretty-printing? *) * string * l option
| Range of Lexing.position * Lexing.position
exception Parse_error_locn of l * string
type ml_comment =
| Chars of Ulib.Text.t
| Comment of ml_comment list
ty... | null | https://raw.githubusercontent.com/rems-project/lem/a839114e468119d9ac0868d7dc53eae7f3cc3a6c/src/ast.ml | ocaml | do pretty-printing?
TODO: fix?
Variables
Variables
Location-annotated names
Remove infix status
Location-annotated infix names
Location-annotated type variables
Location-annotated numeric variables
Numerical expressions for specifying vector lengths and indexes
Location-annotated vector lengths
L... | generated by Ott 0.31 from : lem.ott
type text = Ulib.Text.t
type l =
| Unknown
| Range of Lexing.position * Lexing.position
exception Parse_error_locn of l * string
type ml_comment =
| Chars of Ulib.Text.t
| Comment of ml_comment list
type lex_skip =
| Com of ml_comment
| Ws of Ulib.Text.t
| Nl
... |
62e36e21ad32d847ada2eb7e157375bb412a0c1491acc65a743012e735bfef1c | jafingerhut/thalia | clojure.data.generators-0.1.2.clj | {"namespaces"
{"clojure.data.generators"
[{"ns" "clojure.data.generators",
"name" "reps",
"line" 31,
"column" 1,
"doc" "Returns sizer repetitions of f (or (f) if f is a fn).",
"tag" nil,
"source"
"(defn reps\n \"Returns sizer repetitions of f (or (f) if f is a fn).\"\n [sizer f]\n (let... | null | https://raw.githubusercontent.com/jafingerhut/thalia/20c98eec8168ff72c5b3965cc048b817d34a4583/doc/clojuredocs/clojure.data.generators-0.1.2.clj | clojure | {"namespaces"
{"clojure.data.generators"
[{"ns" "clojure.data.generators",
"name" "reps",
"line" 31,
"column" 1,
"doc" "Returns sizer repetitions of f (or (f) if f is a fn).",
"tag" nil,
"source"
"(defn reps\n \"Returns sizer repetitions of f (or (f) if f is a fn).\"\n [sizer f]\n (let... | |
2b6981cc295ba334784e532490f51ce6fab5bd59fa9c5798880a05ae3db98339 | RunOrg/RunOrg | link.ml | (* © 2014 RunOrg *)
open Std
let enc3 n =
let str = String.create 3 in
let n = str.[2] <- Char.base62_encode (n mod 62) ; n / 62 in
let n = str.[1] <- Char.base62_encode (n mod 62) ; n / 62 in
let () = str.[0] <- Char.base62_encode (n mod 62) in
str
let enc2 n =
let str = String.create 2 in
le... | null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/sentMailLib/link.ml | ocaml | © 2014 RunOrg
Link root
=========
Complete link
============= |
open Std
let enc3 n =
let str = String.create 3 in
let n = str.[2] <- Char.base62_encode (n mod 62) ; n / 62 in
let n = str.[1] <- Char.base62_encode (n mod 62) ; n / 62 in
let () = str.[0] <- Char.base62_encode (n mod 62) in
str
let enc2 n =
let str = String.create 2 in
let n = str.[1] <- C... |
8c1f659c74e7824a957a0162c28573b8d754d002842acca4a15524bfdac16ba4 | BinRoot/Haskell-Data-Analysis-Cookbook | Main.hs | -- ghc --make Main.hs
-- ./Main -o output.svg -w 400
# LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine (mainWith, B)
drawPath :: [(Double, Double)] -> Diagram B R2
drawPath vectors = fromOffsets . map r2 $ vectors
-- Diagramming a paht from a list of vectors
main = d... | null | https://raw.githubusercontent.com/BinRoot/Haskell-Data-Analysis-Cookbook/f8c46987d78f4a6c1828b353c5f906b9314c2ef9/Ch11/Code11_diag/Main.hs | haskell | ghc --make Main.hs
./Main -o output.svg -w 400
Diagramming a paht from a list of vectors |
# LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine (mainWith, B)
drawPath :: [(Double, Double)] -> Diagram B R2
drawPath vectors = fromOffsets . map r2 $ vectors
main = do
rawInput <- readFile "input.txt"
let vs = [ makeVector dir (read dist)
| [dir, di... |
7b604bcd836985a7aeb0252fd478fdfc8fb9f943a812b0bd17d991a769e2b269 | BranchTaken/Hemlock | cmp.mli | (** Comparison result. *)
type t =
| Lt (** Less than. *)
| Eq (** Equal. *)
| Gt (** Greater than. *)
include FormattableIntf.SMono with type t := t
val is_ge: t -> bool
(** [is_ge t] returns [true] if t is [Gt] or [Eq]; false otherwise. *)
val is_le: t -> bool
(** [is_le t] returns [true] if t is [Lt] or [Eq... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/61c3d1aa744b8976385aa4574e30b958e95d7f2d/bootstrap/src/basis/cmp.mli | ocaml | * Comparison result.
* Less than.
* Equal.
* Greater than.
* [is_ge t] returns [true] if t is [Gt] or [Eq]; false otherwise.
* [is_le t] returns [true] if t is [Lt] or [Eq]; false otherwise.
* [is_eq t] returns [true] if t is [Eq]; false otherwise.
* [is_gt t] returns [true] if t is [Gt]; false otherwise.
* [is... | type t =
include FormattableIntf.SMono with type t := t
val is_ge: t -> bool
val is_le: t -> bool
val is_eq: t -> bool
val is_gt: t -> bool
val is_lt: t -> bool
val is_ne: t -> bool
|
b5b0f5509882f293c44cd1c257307c54b30ff6348b1956517b3a585876f73e95 | haslab/HAAP | Modularity.hs |
HAAP : Haskell Automated Assessment Platform
This module extracts basic modularity metrics from Haskell code .
HAAP: Haskell Automated Assessment Platform
This module extracts basic modularity metrics from Haskell code.
-}
# LANGUAGE OverloadedStrings , DeriveGeneric #
module HAAP.Code.Analysis.Modularity w... | null | https://raw.githubusercontent.com/haslab/HAAP/5acf9efaf0e5f6cba1c2482e51bda703f405a86f/src/HAAP/Code/Analysis/Modularity.hs | haskell | average block size
total size |
HAAP : Haskell Automated Assessment Platform
This module extracts basic modularity metrics from Haskell code .
HAAP: Haskell Automated Assessment Platform
This module extracts basic modularity metrics from Haskell code.
-}
# LANGUAGE OverloadedStrings , DeriveGeneric #
module HAAP.Code.Analysis.Modularity w... |
9c1ff41ef4d171c87992616d8f6f3afa612a34b4b95ea81d93a13b1e42d726d1 | simmone/racket-simple-xlsx | merge-cells-test.rkt | #lang racket
(require rackunit/text-ui rackunit)
(require "../../../../main.rkt")
(require racket/runtime-path)
(define-runtime-path merge_cells_file "merge_cells.xlsx")
(define-runtime-path merge_cells_read_and_write_file "merge_cells_read_and_write.xlsx")
(define test-writer
(test-suite
"test-writer"
(te... | null | https://raw.githubusercontent.com/simmone/racket-simple-xlsx/e0ac3190b6700b0ee1dd80ed91a8f4318533d012/simple-xlsx/tests/write-and-read/style/merge-cells/merge-cells-test.rkt | racket | (void) | #lang racket
(require rackunit/text-ui rackunit)
(require "../../../../main.rkt")
(require racket/runtime-path)
(define-runtime-path merge_cells_file "merge_cells.xlsx")
(define-runtime-path merge_cells_read_and_write_file "merge_cells_read_and_write.xlsx")
(define test-writer
(test-suite
"test-writer"
(te... |
4413f24545efe3abf6c9b078ea464262f1fcd4096a30b1e800a8934445ff54b1 | argp/bap | batMutex.ml |
* BatMutex - Additional functions for ( C ) 1996 1996
* 2008
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* ve... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batMutex.ml | ocaml |
* BatMutex - Additional functions for ( C ) 1996 1996
* 2008
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* ve... | |
dffcfa0dd7257590381c9c8d5d11488de94a21dffd23acd41b672fd475355538 | khibino/haskell-relational-record | sqlsEq.hs | import Test.QuickCheck.Simple (Test, defaultMain)
import qualified Test.QuickCheck.Simple as QSimple
import Lex (eqProp, eqProp')
import Model
import Conflict (conflictB)
import qualified Conflict as B
import Control.Applicative ((<$>), (<*>))
import Data.Functor.ProductIsomorphic ((|$|), (|*|))
import Data.Int (Int3... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-query/test/sqlsEq.hs | haskell | Index of Nested Projections | import Test.QuickCheck.Simple (Test, defaultMain)
import qualified Test.QuickCheck.Simple as QSimple
import Lex (eqProp, eqProp')
import Model
import Conflict (conflictB)
import qualified Conflict as B
import Control.Applicative ((<$>), (<*>))
import Data.Functor.ProductIsomorphic ((|$|), (|*|))
import Data.Int (Int3... |
2e7909a1cea9ac1d0a845bcea6cbb27f9ac95b8e0cbeb6d3996eec32a6e015a5 | graninas/The-Amoeba-World | Facade.hs | module Amoeba.Middleware.GLFW.Facade (module GLFW, errorCallback, withEnvironment) where
import qualified Amoeba.Middleware.Tracing.Log as Log
import Amoeba.Middleware.Tracing.ErrorHandling
import Graphics.UI.GLFW as GLFW
import Control.Monad (when, unless)
errorCallback :: GLFW.ErrorCallback
errorCallback err msg =... | null | https://raw.githubusercontent.com/graninas/The-Amoeba-World/a147cd4dabf860bec8a6ae1c45c02b030916ddf4/src/Amoeba/Middleware/GLFW/Facade.hs | haskell | module Amoeba.Middleware.GLFW.Facade (module GLFW, errorCallback, withEnvironment) where
import qualified Amoeba.Middleware.Tracing.Log as Log
import Amoeba.Middleware.Tracing.ErrorHandling
import Graphics.UI.GLFW as GLFW
import Control.Monad (when, unless)
errorCallback :: GLFW.ErrorCallback
errorCallback err msg =... | |
873c206eeaa8050dc9e36aaf26479f101883c17e235dfc9fc1f820d1fd115b37 | fugue/fregot | Base64.hs | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Base64 - related builtins .
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portabili... | null | https://raw.githubusercontent.com/fugue/fregot/c3d87f37c43558761d5f6ac758d2f1a4117adb3e/lib/Fregot/Builtins/Base64.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Base64 - related builtins .
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portabili... |
fba6b3d514b28918ef2416180813c21f1f7cc44045960e8a542a66102ef246fe | HIPERFIT/accelerate-opencl | Monad.hs | module Data.Array.Accelerate.OpenCL.CodeGen.Monad where
import Control.Monad.State
import Language.C hiding (mkPtr)
import Language.C.Syntax
import Language.C.Quote.OpenCL
import Data.Array.Accelerate.OpenCL.CodeGen.Data
data SkelState = SkelState {
_definitions :: [Definition]
... | null | https://raw.githubusercontent.com/HIPERFIT/accelerate-opencl/7ec05ba9d4d5461ffcf952bed6d0dcc4b1915099/Data/Array/Accelerate/OpenCL/CodeGen/Monad.hs | haskell | Setters
Getters | module Data.Array.Accelerate.OpenCL.CodeGen.Monad where
import Control.Monad.State
import Language.C hiding (mkPtr)
import Language.C.Syntax
import Language.C.Quote.OpenCL
import Data.Array.Accelerate.OpenCL.CodeGen.Data
data SkelState = SkelState {
_definitions :: [Definition]
... |
8d5939cbaeed0b90a5f0afadbb8196b8a636becc5f48d6069371689eebd3b6d1 | graninas/Pragmatic-Type-Level-Design | Main.hs | module Main where
import CPrelude
import qualified Data.Map as Map
import qualified Data.Vector as V
import TCA1.Types
import TCA1.Automaton
import TCA1.GameOfLife
import TCA1.Arbitrary3S
import qualified TCA1.GameOfLife as GoL
import qualified TCA1.Arbitrary3S as A3S
mkBoard :: (Int, Int) -> cell -> Dim2Board cel... | null | https://raw.githubusercontent.com/graninas/Pragmatic-Type-Level-Design/1cbf0ac2cf773edda4f8883a916a23efb2ed507a/demo-apps/type-class-automaton1/src/Main.hs | haskell | module Main where
import CPrelude
import qualified Data.Map as Map
import qualified Data.Vector as V
import TCA1.Types
import TCA1.Automaton
import TCA1.GameOfLife
import TCA1.Arbitrary3S
import qualified TCA1.GameOfLife as GoL
import qualified TCA1.Arbitrary3S as A3S
mkBoard :: (Int, Int) -> cell -> Dim2Board cel... | |
3ed967a1abfb5e562cc0775b38ac64f9a964026ade0c44e81ec6dec0e702887a | jedimahdi/soltan | Char.hs | module Hokm.Data.Char
( module Data.Char
, isAlphaNumUnderscore
) where
import Data.Char
isAlphaNumUnderscore :: Char -> Bool
isAlphaNumUnderscore c = isAlphaNum c || c == '_'
| null | https://raw.githubusercontent.com/jedimahdi/soltan/bc2f9c040854420b8964ad011205d6a251872fe0/backend/hokm-prelude/src/Hokm/Data/Char.hs | haskell | module Hokm.Data.Char
( module Data.Char
, isAlphaNumUnderscore
) where
import Data.Char
isAlphaNumUnderscore :: Char -> Bool
isAlphaNumUnderscore c = isAlphaNum c || c == '_'
| |
0cdc47b1aab1da9294cb87949f1658d6e9cbed65bdcfd3d5d31c20614308f9ee | stuartsierra/lazytest | console.clj | (ns lazytest.runner.console
(:use lazytest.find
lazytest.suite
lazytest.test-case
lazytest.focus
lazytest.color)
(:import lazytest.ExpectationFailed))
(defn- run-test-case [tc]
(let [result (try-test-case tc)]
(if (:pass? result)
(print (colorize "." :green))
(print (colorize "F" :red)))
... | null | https://raw.githubusercontent.com/stuartsierra/lazytest/3b0f419ce3d6f259d2ab3cfde475fa491a4db23e/modules/lazytest/src/main/clojure/lazytest/runner/console.clj | clojure | (ns lazytest.runner.console
(:use lazytest.find
lazytest.suite
lazytest.test-case
lazytest.focus
lazytest.color)
(:import lazytest.ExpectationFailed))
(defn- run-test-case [tc]
(let [result (try-test-case tc)]
(if (:pass? result)
(print (colorize "." :green))
(print (colorize "F" :red)))
... | |
a15d4611f0e3d5e52e8d53199ebb4f7e6d23c2504fbe0ee8bbb499479e10b84a | noamz/linlam | Trivalent.hs | conversion between linear lambda terms and 3 - valent maps
module LinLam.Trivalent where
import Data.List
import Data.Maybe
import qualified Data.Set as Set
import qualified Math.Combinat.Permutations as P
import LinLam.Core
import LinLam.Cartes
import LinLam.Utils
import Debug.Trace
auxiliary function to conv... | null | https://raw.githubusercontent.com/noamz/linlam/8c733ab7f2cbe8e5b9cde85a1c351769a08a3d93/src/LinLam/Trivalent.hs | haskell | visited set
intrinsic representation of linear lambda terms as combinatorial maps
of a marked subterm c[t] and a direction up/down towards the root
compute the intrinsic combinatorial map associated to a linear lambda term
inductive computation of the genus | conversion between linear lambda terms and 3 - valent maps
module LinLam.Trivalent where
import Data.List
import Data.Maybe
import qualified Data.Set as Set
import qualified Math.Combinat.Permutations as P
import LinLam.Core
import LinLam.Cartes
import LinLam.Utils
import Debug.Trace
auxiliary function to conv... |
b24c4bbc1619975ae4f5079cd0e59bcf3dcdce887f68944e1dc87292f01133e7 | bodil/BODOL | prelude.clj | (ns bodol.prelude
(:require [bodol.parser :refer [parse]]))
(def prelude
(parse (slurp (clojure.java.io/resource "BODOL/prelude.bodol"))))
| null | https://raw.githubusercontent.com/bodil/BODOL/ed00ab59a91a19da4d70ff5488c90ffad04904c6/src/bodol/prelude.clj | clojure | (ns bodol.prelude
(:require [bodol.parser :refer [parse]]))
(def prelude
(parse (slurp (clojure.java.io/resource "BODOL/prelude.bodol"))))
| |
aa87f1be7fa766a28d529faca606274e324aa2ca6d7355810e6d45e160c7405d | ghcjs/ghcjs | overloadedlistsrun04.hs | # LANGUAGE OverloadedLists , TypeFamilies #
import qualified Data.Set as S
import GHC.Exts
main = do putStrLn (f [])
putStrLn (f [1,2])
putStrLn (f [2,0])
putStrLn (f [3,2])
putStrLn (f [2,7])
putStrLn (f [2,2])
putStrLn (f [1..7])
f ::... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/overloadedlists/overloadedlistsrun04.hs | haskell | # LANGUAGE OverloadedLists , TypeFamilies #
import qualified Data.Set as S
import GHC.Exts
main = do putStrLn (f [])
putStrLn (f [1,2])
putStrLn (f [2,0])
putStrLn (f [3,2])
putStrLn (f [2,7])
putStrLn (f [2,2])
putStrLn (f [1..7])
f ::... | |
4eecad07aa9c8f96ea4b30cd37ffaf76cca5bd08abcc51107ac3d3cef3d60da9 | static-analysis-engineering/codehawk | bCHPullData.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlibx86/bCHPullData.mli | ocaml | bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
5e15e6bc9007916d12ab8279eda653de51b744097d4a65677ea9f37b6b4560e6 | TaylanUB/scheme-bytestructures | ffi.scm | ffi.scm --- Convert bytestructure descriptors to / libffi types .
Copyright © 2016 < >
;; This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;; (at you... | null | https://raw.githubusercontent.com/TaylanUB/scheme-bytestructures/50697c55129be90cce6df1adf02228c4d4c42b0e/bytestructures/guile/ffi.scm | scheme | This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public L... | ffi.scm --- Convert bytestructure descriptors to / libffi types .
Copyright © 2016 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
This mod... |
dd07d5c6a351c01246d709a07c96eb9bfdc666ed046768ff5a24bb20b68c2b8a | iambrj/imin | interp-Cany.rkt | #lang racket
(require "utilities.rkt")
(require "interp-Rany-prime.rkt")
(require "interp-Cvar.rkt")
(require "interp-Cif.rkt")
(require "interp-Cvec.rkt")
(require "interp-Cfun.rkt")
(require "interp-Clambda.rkt")
(provide interp-Cany)
(define Cany-class (interp-Clambda-mixin
(interp-Cfun-mixin
... | null | https://raw.githubusercontent.com/iambrj/imin/baf9e829c2aa85b69a2e86bfba320969ddf05f95/interp-Cany.rkt | racket | #lang racket
(require "utilities.rkt")
(require "interp-Rany-prime.rkt")
(require "interp-Cvar.rkt")
(require "interp-Cif.rkt")
(require "interp-Cvec.rkt")
(require "interp-Cfun.rkt")
(require "interp-Clambda.rkt")
(provide interp-Cany)
(define Cany-class (interp-Clambda-mixin
(interp-Cfun-mixin
... | |
9c257e5e05fe233fc31faf1826b17ad73b4b0533a86e0f6333a6f4b411c624a7 | khibino/haskell-relational-record | Type.hs | -- |
Module : Database . Relational . . Type
Copyright : 2013 - 2019
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- This module defines core query type.
module Database.Relational.Monad.Type
( -- * Core query monad
QueryCore, extra... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-query/src/Database/Relational/Monad/Type.hs | haskell | |
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module defines core query type.
* Core query monad
| Core query monad type used from flat(not-aggregated) query and aggregated query.
| Extract 'QueryCore' computation. | Module : Database . Relational . . Type
Copyright : 2013 - 2019
module Database.Relational.Monad.Type
QueryCore, extractCore,
OrderedQuery,
) where
import Database.Relational.Internal.ContextType (Flat)
import Database.Relational.SqlSyntax (Duplication, JoinProduct)
import Data... |
6af86880d3f5032183143f7cefd35e529d46906d778ef59638bbeea221514cc3 | kmi/irs | load.lisp | Mode : Lisp ; Package :
File created in WebOnto
(in-package "OCML")
(def-ontology lhdl-domain :includes (wsmo)
:type :domain
:author "dave"
:namespace-uri "#"
:files ("lhdl-domain" "skyhooks")
:namespaces (("lhdl" lhdl-domain)))
| null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/apps/lhdl/ontologies/lhdl-domain/load.lisp | lisp | Package : |
File created in WebOnto
(in-package "OCML")
(def-ontology lhdl-domain :includes (wsmo)
:type :domain
:author "dave"
:namespace-uri "#"
:files ("lhdl-domain" "skyhooks")
:namespaces (("lhdl" lhdl-domain)))
|
8f00b52ff45d4b43dbdceed3452bbff6772c568e54b6b468d76e8d27b1740169 | Clojure2D/clojure2d-examples | scene.clj | (ns rt4.in-one-weekend.ch12b.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.in-one-weekend.ch12b.hittable :as hittable]
[rt4.in-one-weekend.ch12b.interval :as interval]
[rt4.in-one-weekend.ch12b.material :as material]
[rt4.common :as comm... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/in_one_weekend/ch12b/scene.clj | clojure | (ns rt4.in-one-weekend.ch12b.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.in-one-weekend.ch12b.hittable :as hittable]
[rt4.in-one-weekend.ch12b.interval :as interval]
[rt4.in-one-weekend.ch12b.material :as material]
[rt4.common :as comm... | |
4d32709279f2520851d22c138e9bee2303272177054684ebfc867f2465b7b549 | juxt/jinx | coercion_test.cljc | Copyright © 2019 , JUXT LTD .
(ns juxt.jinx.coercion-test
#?@(:clj [(:require
[juxt.jinx.alpha.validate :as validate]
[clojure.test :refer [deftest is are testing]])]
:cljs [(:require
[juxt.jinx.alpha.validate :as validate]
[cljs.test :refer-macros [defte... | null | https://raw.githubusercontent.com/juxt/jinx/48c889486e5606e39144043946063803ad6effa8/test/juxt/jinx/coercion_test.cljc | clojure | Copyright © 2019 , JUXT LTD .
(ns juxt.jinx.coercion-test
#?@(:clj [(:require
[juxt.jinx.alpha.validate :as validate]
[clojure.test :refer [deftest is are testing]])]
:cljs [(:require
[juxt.jinx.alpha.validate :as validate]
[cljs.test :refer-macros [defte... | |
ee8c08bdb5ea343facb9adbf903187a554473a43e0cff5d92442f6f81faa8c1f | rizo/snowflake-os | tulip.mli |
(* tulip 21140 network driver (found in virtual pc) *)
val init : unit -> unit
| null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/tulip.mli | ocaml | tulip 21140 network driver (found in virtual pc) |
val init : unit -> unit
|
59bfebb940d614563003f302c876ecc161f87a92b068419943b8790ee94159ab | thierry-martinez/redirect | redirect.ml | let read_and_close channel f =
match f () with
| result ->
close_in channel;
result
| exception exn ->
close_in_noerr channel;
raise exn
let write_and_close channel f =
match f () with
| result ->
close_out channel;
result
| exception exn ->
close_out_noerr channel... | null | https://raw.githubusercontent.com/thierry-martinez/redirect/9f0faf876a761f9238c40908af01eb86f2a684ad/redirect/redirect.ml | ocaml | let read_and_close channel f =
match f () with
| result ->
close_in channel;
result
| exception exn ->
close_in_noerr channel;
raise exn
let write_and_close channel f =
match f () with
| result ->
close_out channel;
result
| exception exn ->
close_out_noerr channel... | |
12ede652bdcee5ec03e11102b28feb25f7538b6ceaa1268fe3a6003187463aed | gren-lang/compiler | BackgroundWriter.hs | {-# LANGUAGE BangPatterns #-}
module BackgroundWriter
( Scope,
withScope,
writeBinary,
)
where
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar)
import Data.Binary qualified as Binary
import Data.Foldable (traverse_)
import File qualified
-... | null | https://raw.githubusercontent.com/gren-lang/compiler/49d5e5c5994a846d82c9518dcee06112c7630664/builder/src/BackgroundWriter.hs | haskell | # LANGUAGE BangPatterns #
BACKGROUND WRITER |
module BackgroundWriter
( Scope,
withScope,
writeBinary,
)
where
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar)
import Data.Binary qualified as Binary
import Data.Foldable (traverse_)
import File qualified
newtype Scope
= Scope (MVar ... |
872cea665600e60df01551ec9bbfd8d5c4e6d20a31d30e4923d690aac6e82ce7 | NuID/zk | lib.cljc | (ns nuid.zk.lib
(:require
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.walk :as walk]
[nuid.ident.cryptography :as ident.crypt]
[nuid.ident.elliptic :as ident.elliptic]
[nuid.ident.zk :as ident.zk]
[nuid.lib :as lib]
[nuid.spec.lib :as spec.lib]
[nuid.zk :as zk]
[nuid.zk.kni... | null | https://raw.githubusercontent.com/NuID/zk/97f2afb076a911a96c04547083acd5733852fcb6/src/nuid/zk/lib.cljc | clojure | (ns nuid.zk.lib
(:require
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.walk :as walk]
[nuid.ident.cryptography :as ident.crypt]
[nuid.ident.elliptic :as ident.elliptic]
[nuid.ident.zk :as ident.zk]
[nuid.lib :as lib]
[nuid.spec.lib :as spec.lib]
[nuid.zk :as zk]
[nuid.zk.kni... | |
cc5487579cad5e06d55f85c795f4f96c925a95115ddfb85a8c27064c8b196989 | ocaml-sf/learn-ocaml-corpus | solution.ml | let rec lookup_function n = function
[] -> invalid_arg "lookup_function"
| (op, f) :: rem ->
if n = op then f else lookup_function n rem
let add_function name op env = (name, op) :: env
let my_env = add_function "min" (fun x y -> if x < y then x else y) initial_env
let rec compute (env : env) op =
matc... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/mooc/week4/seq3/ex2/solution.ml | ocaml | let rec lookup_function n = function
[] -> invalid_arg "lookup_function"
| (op, f) :: rem ->
if n = op then f else lookup_function n rem
let add_function name op env = (name, op) :: env
let my_env = add_function "min" (fun x y -> if x < y then x else y) initial_env
let rec compute (env : env) op =
matc... | |
d89fc9cd301d6ebe072e81f23acbfb014d645762389ccba84fc383e6eb25872a | Frama-C/Frama-C-snapshot | listset.ml | (**************************************************************************)
(* *)
This file is part of WP plug - in of Frama - C.
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/qed/listset.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat a l'energie atomique et aux energies
Lesser General Public License as published by the Free Software
Foundation ,... |
0a0a0f23a3cdbc6fdc385523027e3bae4bc13d30c7dc016731291ea76b1b8b98 | savonet/ocaml-srt | srt.ml | open Ctypes
open Posix_socket
module Srt = Srt_stubs.Def (Srt_generated_stubs)
open Srt
module Srt_locked = Srt_stubs_locked.Def (Srt_generated_stubs_locked)
open Srt_locked
open Unsigned
exception Invalid_argument of string
exception Error of errno * string
type errno = Srt.errno
type transtype = Srt.transtype
type ... | null | https://raw.githubusercontent.com/savonet/ocaml-srt/6b325d501b6f66cffb076e77e40eef727198d459/src/srt.ml | ocaml | open Ctypes
open Posix_socket
module Srt = Srt_stubs.Def (Srt_generated_stubs)
open Srt
module Srt_locked = Srt_stubs_locked.Def (Srt_generated_stubs_locked)
open Srt_locked
open Unsigned
exception Invalid_argument of string
exception Error of errno * string
type errno = Srt.errno
type transtype = Srt.transtype
type ... | |
852fe42febf5dd4fef02385b877fbec5bf630d8c098ad292bd98c3013b09fa6d | sellout/haskerwaul | Left.hs | # language TypeApplications #
module Haskerwaul.Law.Identity.Left where
import Haskerwaul.Bifunctor
import Haskerwaul.Category.Monoidal
import Haskerwaul.Isomorphism
import Haskerwaul.Law
import Haskerwaul.Object
import Haskerwaul.Relation.Equality
leftIdentityLaw :: forall c t a. (MonoidalCategory c t, Ob c a)
... | null | https://raw.githubusercontent.com/sellout/haskerwaul/cf54bd7ce5bf4f3d1fd0d9d991dc733785b66a73/src/Haskerwaul/Law/Identity/Left.hs | haskell | # language TypeApplications #
module Haskerwaul.Law.Identity.Left where
import Haskerwaul.Bifunctor
import Haskerwaul.Category.Monoidal
import Haskerwaul.Isomorphism
import Haskerwaul.Law
import Haskerwaul.Object
import Haskerwaul.Relation.Equality
leftIdentityLaw :: forall c t a. (MonoidalCategory c t, Ob c a)
... | |
04606b0327f7dc246e7640998598e7af719d4d3a68831ed8931112a3a3c26e96 | mbj/stratosphere | AccessControlAttributeValueProperty.hs | module Stratosphere.SSO.InstanceAccessControlAttributeConfiguration.AccessControlAttributeValueProperty (
AccessControlAttributeValueProperty(..),
mkAccessControlAttributeValueProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Pr... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sso/gen/Stratosphere/SSO/InstanceAccessControlAttributeConfiguration/AccessControlAttributeValueProperty.hs | haskell | module Stratosphere.SSO.InstanceAccessControlAttributeConfiguration.AccessControlAttributeValueProperty (
AccessControlAttributeValueProperty(..),
mkAccessControlAttributeValueProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Pr... | |
9363812d96f899b64b3750fbf099a3c67545b553c16461c46e49983a011a641b | rowangithub/DOrder | datarepr.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/typing/datarepr.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : datarepr.ml 9331 2009 - 09 - ... |
04b44cb5b3f33ec6aed0f2ab5b45c4ada64b7409451848ba7440f40f07d60620 | jb55/vrscript-samples | tour.rkt | #lang racket/base
(require "vr.rkt")
; local mutable state for animations and transitions from server states
(define *swipe-anim-dir* 0.0) ; yaw degrees of view to place the swipe anim
(define *current-scene* -1) ; determine that the server has transitioned
(define *current-destination* -1)
; When the sce... | null | https://raw.githubusercontent.com/jb55/vrscript-samples/6682b1cffa83b56228382aa2cc5e2f520e7f8370/tour.rkt | racket | local mutable state for animations and transitions from server states
yaw degrees of view to place the swipe anim
determine that the server has transitioned
When the scene transitions, all the uri needed for the new scene will be fetched.
time when *current-scene* finished fetching data
---------------------------... | #lang racket/base
(require "vr.rkt")
(define *current-destination* -1)
(define *fetch-gather* #f)
(define *fetch-uri* '())
(define (ss-destination) (vector-ref *server-state* 0))
(define (ss-scene) (vector-ref *server-state* 1))
(define (ss-cmd-num) (vector-ref *server-state* ... |
bd66c462f14e03c0d92fe9d4413b9c231f4cec4e357e482146e44168f5e41b93 | janestreet/merlin-jst | variants.ml | type core = [ `A | `B ]
type more = [ core | `C ]
let x : more = `A
let y : core = `B
let () = match x with
| `C -> ()
| #core -> ()
| null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/tests/test-dirs/type-enclosing/variants.t/variants.ml | ocaml | type core = [ `A | `B ]
type more = [ core | `C ]
let x : more = `A
let y : core = `B
let () = match x with
| `C -> ()
| #core -> ()
| |
011c95406b46ee99ee94a7aaf8cf2534550dd160a5b8dfeebb0b8e4dc88eada6 | naproche/naproche | System.hs | -- |
Authors : ( 2021 )
--
System process support for Naproche : with and without Isabelle / PIDE .
{-# LANGUAGE OverloadedStrings #-}
module Naproche.System (
is_windows, bash_process
) where
import Data.Maybe (fromJust)
import System.IO qualified as IO
import System.IO.Temp qualified as Temp
import System... | null | https://raw.githubusercontent.com/naproche/naproche/6284a64b4b84eaa53dd0eb7ecb39737fb9135a0d/src/Naproche/System.hs | haskell | |
# LANGUAGE OverloadedStrings # | Authors : ( 2021 )
System process support for Naproche : with and without Isabelle / PIDE .
module Naproche.System (
is_windows, bash_process
) where
import Data.Maybe (fromJust)
import System.IO qualified as IO
import System.IO.Temp qualified as Temp
import System.Process qualified as Process
import System... |
3d3a8841fb9077f2360ab51b3117ef446104f6123e9993838c96fb96c063a138 | hiratara/Haskell-Nyumon-Sample | chap07-samples-7-10-3.hs | module Main(main) where
import Pipes
import qualified Pipes.Prelude as P
sample1 :: IO ()
sample1 = runEffect $ sampleProducer >-> P.map ("input : "++) >-> P.stdoutLn
sampleProducer :: Producer String IO ()
sampleProducer = do
yield "Hoge"
yield "Piyo"
yield "Fuga"
sample2 :: IO ()
sample2 = runEffect $ range... | null | https://raw.githubusercontent.com/hiratara/Haskell-Nyumon-Sample/ac52b741e3b96722f6fc104cfa84078e39f7a241/chap07-samples/chap07-samples-7-10-3.hs | haskell | Control.Monadで提供されているmapM_関数を利用して作成する
await関数でストリームの上流からデータを取得する
fizzBuzzして出力
ストリームデータの最後まで自分自身を呼び出す | module Main(main) where
import Pipes
import qualified Pipes.Prelude as P
sample1 :: IO ()
sample1 = runEffect $ sampleProducer >-> P.map ("input : "++) >-> P.stdoutLn
sampleProducer :: Producer String IO ()
sampleProducer = do
yield "Hoge"
yield "Piyo"
yield "Fuga"
sample2 :: IO ()
sample2 = runEffect $ range... |
2e71397cd94e38a6914cf6db3acf0d54f3b1817c7130f3c16dffbf8bbaca60c8 | hiroshi-unno/coar | invParser.ml | (* simple parser of fixpoint logic for debug *)
open Core
open Common.Ext
open Ast
open Ast.LogicOld
open Parsexp
module Sexp = Ppx_sexp_conv_lib.Sexp
type logic_type = Any | Lia | BV | Reals | Arrays
let sort_of_sexp = function
| Sexp.Atom "Int" -> T_int.SInt
| Sexp.Atom "Bool" -> T_bool.SBool
| Sexp.Atom "R... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/SyGuS/invParser.ml | ocaml | simple parser of fixpoint logic for debug
Assume that every input is integer
let lookup' key ls =
List.find_exn ls ~f:(fun (key', _) -> key=key')
|> fun (_, value) -> value
|
open Core
open Common.Ext
open Ast
open Ast.LogicOld
open Parsexp
module Sexp = Ppx_sexp_conv_lib.Sexp
type logic_type = Any | Lia | BV | Reals | Arrays
let sort_of_sexp = function
| Sexp.Atom "Int" -> T_int.SInt
| Sexp.Atom "Bool" -> T_bool.SBool
| Sexp.Atom "Real" -> T_real.SReal
| _ -> failwith "unimplem... |
4f7f488ec7d431155ec4c2cd9c5c8700a2c7ddc22dd26a13b11d48053172949c | masaomi-yamaguchi/synbit | RunTimeException.hs | module RunTimeException where
import Control.Exception (Exception, throw)
import Data.Typeable (Typeable)
data RunTimeException = RunTimeException String
deriving Typeable
instance Show RunTimeException where
show (RunTimeException str) = "Runtime Error: " ++ str
instance Exception RunTimeException
rtError ... | null | https://raw.githubusercontent.com/masaomi-yamaguchi/synbit/4553ae090dfcda4965a16b09130c1d6874b5a849/src/RunTimeException.hs | haskell | module RunTimeException where
import Control.Exception (Exception, throw)
import Data.Typeable (Typeable)
data RunTimeException = RunTimeException String
deriving Typeable
instance Show RunTimeException where
show (RunTimeException str) = "Runtime Error: " ++ str
instance Exception RunTimeException
rtError ... | |
54ed4453e4da8fa0847bcf60a9e31a1ccf584bcebc31adbce6a80b2ea20d98f1 | kuis-isle3sw/IoPLMaterials | main.ml | let debug = ref false
let dprint s = if !debug then (print_string (s ()) ; flush stdout)
let display_cfg = ref false
let optimize = ref false
let outfile = ref "-"
let initial_decls = []
let rec compile prompt ichan cont =
print_string prompt; flush stdout;
このmain.ml自体の説明(コンパイラの全体構成 ) ( 1章後半 )
Parsing ( 2章 ... | null | https://raw.githubusercontent.com/kuis-isle3sw/IoPLMaterials/fa328e92fdaaf6986394f832ef689689930647cd/misc/miniml-compiler/main.ml | ocaml | 制御フローグラフを表示
Output to stdout/file
continued...
==== main ==== | let debug = ref false
let dprint s = if !debug then (print_string (s ()) ; flush stdout)
let display_cfg = ref false
let optimize = ref false
let outfile = ref "-"
let initial_decls = []
let rec compile prompt ichan cont =
print_string prompt; flush stdout;
このmain.ml自体の説明(コンパイラの全体構成 ) ( 1章後半 )
Parsing ( 2章 ... |
64ae1a15e5e063b7b26fe8be2874fc963c3631d62c4a2866d94ea4968a91d039 | myaosato/clcm | link-image.lisp | (defpackage :clcm/inlines/link-image
(:use :cl
:clcm/utils
:clcm/inlines/parser
:clcm/inlines/emphasis)
(:export :scan-open-link
:scan-open-image
:scan-close-link-image))
(in-package :clcm/inlines/link-image)
;; API
(defun scan-open-link (parser)
(when (scan parser "... | null | https://raw.githubusercontent.com/myaosato/clcm/fd0390bedf00c5be3f5c2eb8176ff73bede797b0/src/inlines/link-image.lisp | lisp | API
() TODO make tag and push output queue
| (defpackage :clcm/inlines/link-image
(:use :cl
:clcm/utils
:clcm/inlines/parser
:clcm/inlines/emphasis)
(:export :scan-open-link
:scan-open-image
:scan-close-link-image))
(in-package :clcm/inlines/link-image)
(defun scan-open-link (parser)
(when (scan parser "^\\[")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.