_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 |
|---|---|---|---|---|---|---|---|---|
8c5db3e0fa0aee9eba53f6fee40497574f05f592f3ff6c035cd68258505fee48 | rmculpepper/gamble | lazy-tree.rkt | Copyright ( c ) 2014
Released under the terms of the 2 - clause BSD license .
;; See the file COPYRIGHT for details.
#lang racket/base
(require (rename-in racket/match [match-define defmatch])
racket/class
markparam
"../interfaces.rkt"
(only-in "../context.rkt" OBS-mark)
... | null | https://raw.githubusercontent.com/rmculpepper/gamble/a5231e2eb3dc0721eedc63a77ee6d9333846323e/gamble/private/enumerate/lazy-tree.rkt | racket | See the file COPYRIGHT for details.
== mem ==
For mem, have an activation-specific store that gets rewound after
each ERP choice exploration. (cf logic continuations, or store
continuations?)
Use mark-parameter to store the memotable. (See notes on parameters
(sigh... it's complicated).
What should it mean f... | Copyright ( c ) 2014
Released under the terms of the 2 - clause BSD license .
#lang racket/base
(require (rename-in racket/match [match-define defmatch])
racket/class
markparam
"../interfaces.rkt"
(only-in "../context.rkt" OBS-mark)
"../dist.rkt")
(provide (struct-out... |
9cfafff926f181c19dd01abab72a114e8da6bc76c416b65c04c281f0cb7f32c7 | awslabs/s2n-bignum | bignum_digitsize.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/bignum_digitsize.ml | ocaml | =========================================================================
Size in digits of a bignum.
=========================================================================
*** print_literal_from_elf "x86/generic/bignum_digitsize.o";;
***
XOR (% rax) (% rax)
TE... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_digitsize_mc = define_assert_from_elf "bignum_digitsize... |
92fd9143db3ea2e518745b03bdb7fcfb11851cb3671deddf0b5faf47b733e759 | uw-unsat/serval-sosp19 | spec.rkt | #lang rosette/safe
(require
serval/lib/core
serval/lib/unittest
"state.rkt"
(only-in racket/base struct-copy)
(prefix-in riscv: serval/riscv/objdump)
(prefix-in certikos: "generated/monitors/certikos.map.rkt")
(prefix-in certikos: "generated/monitors/certikos/verif/asm-offsets.rkt")
)
(provide (all-defi... | null | https://raw.githubusercontent.com/uw-unsat/serval-sosp19/175c42660fad84b44e4c9f6f723fd3c9450d65d4/monitors/certikos/verif/spec.rkt | racket | child memory region
memset pages for the child process
update page ownership | #lang rosette/safe
(require
serval/lib/core
serval/lib/unittest
"state.rkt"
(only-in racket/base struct-copy)
(prefix-in riscv: serval/riscv/objdump)
(prefix-in certikos: "generated/monitors/certikos.map.rkt")
(prefix-in certikos: "generated/monitors/certikos/verif/asm-offsets.rkt")
)
(provide (all-defi... |
a008f354b4c1b079830bc50cadd22aca4a51eb338c6961f90d818c643a6ef3e4 | camlp5/camlp5 | pconfig.ml | let ast_impl_magic_number = "Caml1999M022"
let ast_intf_magic_number = "Caml1999N022"
| null | https://raw.githubusercontent.com/camlp5/camlp5/15e03f56f55b2856dafe7dd3ca232799069f5dda/ocaml_stuff/4.06.1/utils/pconfig.ml | ocaml | let ast_impl_magic_number = "Caml1999M022"
let ast_intf_magic_number = "Caml1999N022"
| |
c5159ea5b5b51a3713de222d738e4f51db5eee32aea5179f9355e37ee2789f0c | input-output-hk/plutus-apps | TBMQueue.hs | module Control.Concurrent.STM.TBMQueue
( TBMQueue
, newTBMQueue
, newTBMQueueIO
, writeTBMQueue
, isFullTBMQueue
, flushTBMQueue
, sizeTBMQueue
) where
import Control.Concurrent.STM (STM, retry)
import Control.Concurrent.STM.TQueue (TQueue, flushTQueue, newTQueue, newTQueueIO, writeTQueue)
import Contr... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/e985be93674cd9c45e8c379011e14b2200227258/plutus-chain-index/src/Control/Concurrent/STM/TBMQueue.hs | haskell | # UNPACK #
Current size
Measure function
| 'IO' version of 'newTBMQueue'.
function never retries.
| Returns current size of the queue. | module Control.Concurrent.STM.TBMQueue
( TBMQueue
, newTBMQueue
, newTBMQueueIO
, writeTBMQueue
, isFullTBMQueue
, flushTBMQueue
, sizeTBMQueue
) where
import Control.Concurrent.STM (STM, retry)
import Control.Concurrent.STM.TQueue (TQueue, flushTQueue, newTQueue, newTQueueIO, writeTQueue)
import Contr... |
d95e767f5713cf16a851ec431ffea2f8a5c1d135b8acea6b70ca1f52d28a213c | mzp/min-caml | emit.ml | open Asm
external gethi : float -> int32 = "gethi"
external getlo : float -> int32 = "getlo"
let stackset = ref S.empty (* すでにSaveされた変数の集合 (caml2html: emit_stackset) *)
( caml2html : emit_stackmap )
let save x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap) then
stackmap := !stackmap @ [x]
l... | null | https://raw.githubusercontent.com/mzp/min-caml/cf1180792a2a0bc895ba17a0052e3b6f4a74e444/arch/x86/emit.ml | ocaml | すでにSaveされた変数の集合 (caml2html: emit_stackset)
関数呼び出しのために引数を並べ替える(register shuffling) (caml2html: emit_shuffle)
remove identical moves
find acyclic moves
no acyclic moves; resolve a cyclic move
末尾かどうかを表すデータ型 (caml2html: emit_dest)
命令列のアセンブリ生成 (caml2html: emit_g)
各命令のアセンブリ生成 (caml2html: emit_gprime)
[XXX] u... | open Asm
external gethi : float -> int32 = "gethi"
external getlo : float -> int32 = "getlo"
( caml2html : emit_stackmap )
let save x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap) then
stackmap := !stackmap @ [x]
let savef x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap... |
a740a38e3f88705aabab05cb0155c96a777f6b579c4846234c84fbf4d28c30ee | epicallan/hreq | Internal.hs | -- | This module provides functions that take API endpoint types and transform them into
-- HTTP Response outputs.
--
# LANGUAGE AllowAmbiguousTypes #
module Hreq.Core.Client.Internal where
import Control.Monad.Except
import Data.Proxy
import Hreq.Core.API
import Hreq.Core.Client.ClientError
import Hreq.Core.Client.H... | null | https://raw.githubusercontent.com/epicallan/hreq/f12fcb9b9dd1ad903c6b36a8cf850edb213d4792/hreq-core/src/Hreq/Core/Client/Internal.hs | haskell | | This module provides functions that take API endpoint types and transform them into
HTTP Response outputs.
HTTP network request.
| Used to make generic HTTP requests
| Used to make HTTP requests. Uses visible type-applications for API type specification.
Example
| 'HasStreamingClient' type constrain... | # LANGUAGE AllowAmbiguousTypes #
module Hreq.Core.Client.Internal where
import Control.Monad.Except
import Data.Proxy
import Hreq.Core.API
import Hreq.Core.Client.ClientError
import Hreq.Core.Client.HasRequest
import Hreq.Core.Client.HasResponse
import Hreq.Core.Client.Request
import Hreq.Core.Client.RunClient
| '... |
72614ada1e67c9bec4b8b68375ddca46e3a48e6488c024400f7ae0cb4c8c4fd7 | TrustInSoft/tis-interpreter | logic_const.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/ast_queries/logic_const.mli | ocaml | ************************************************************************
alternatives)
Automatique) ... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
( Institut National de Recherche en Informatique et en ... |
45eb3d75d64658e52981696f35f651924c317c80980b77c1682543d92844da57 | alaricsp/chicken-scheme | osx-deploy-bundle.scm | ;;;; osx-deploy-bundle.scm
;
; Use like this:
;
% csc < your - application - main - module > -prologue osx-deploy-bundle.scm -framework CoreFoundation
(use posix easyffi)
#>
#include <CoreFoundation/CoreFoundation.h>
<#
(foreign-parse/declare #<<EOF
static char *get_bundle_path()
{
CFBundleRef bundle = CFBundle... | null | https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/misc/osx-deploy-bundle.scm | scheme | osx-deploy-bundle.scm
Use like this:
| % csc < your - application - main - module > -prologue osx-deploy-bundle.scm -framework CoreFoundation
(use posix easyffi)
#>
#include <CoreFoundation/CoreFoundation.h>
<#
(foreign-parse/declare #<<EOF
static char *get_bundle_path()
{
}
EOF
)
(let ((application-path (get_bundle_path)))
(assert application-p... |
81b3db011fc9aa02ba245876395e2533a1136ce328c3d9ae490824461a9ea298 | grin-compiler/ghc-wpc-sample-programs | List.hs | -- | Utility functions for lists.
module Agda.Utils.List where
import Control.Arrow (first, second)
import Data.Array (Array, array, listArray)
import qualified Data.Array as Array
import Data.Functor ((<$>))
import Data.Function
import qualified Data.List as List
import Data.Maybe
import qualified Data.Map as Map
i... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/Utils/List.hs | haskell | | Utility functions for lists.
-------------------------------------------------------------------------
* Variants of list case, cons, head, tail, init, last
-------------------------------------------------------------------------
| Append a single element at the end.
| Case distinction for lists, with list las... |
module Agda.Utils.List where
import Control.Arrow (first, second)
import Data.Array (Array, array, listArray)
import qualified Data.Array as Array
import Data.Functor ((<$>))
import Data.Function
import qualified Data.List as List
import Data.Maybe
import qualified Data.Map as Map
import qualified Data.Set as Set
i... |
8e8a749b098ac2d5830aa32553cddbefb1e0b7a6dbf90940a9faa44ac8bde740 | kitnil/dotfiles | wigust.scm | (use-modules (guix profiles)
(gnu packages emacs)
(wigust packages databases)
(wigust packages admin)
(wigust packages documentation)
(wigust packages dotfiles)
(wigust packages emacs)
(wigust packages games)
(wigust... | null | https://raw.githubusercontent.com/kitnil/dotfiles/55000d4f42db1e81be47ef31c72d746763670370/dotfiles/manifests/wigust.scm | scheme | emacs-dashboard-with-agenda-reverse
Define searches on websites
Evaluate to different Repls
Fetch a list of stars from GitHub user
gns3 requirement
SQL pager
telegram-without-materialdecoration | (use-modules (guix profiles)
(gnu packages emacs)
(wigust packages databases)
(wigust packages admin)
(wigust packages documentation)
(wigust packages dotfiles)
(wigust packages emacs)
(wigust packages games)
(wigust... |
c7df6d734a27a1c80a9858ea06af055d56d6a4b80d809fb60b629127af8d4a06 | jlouis/graphql-erlang | validation_SUITE.erl | -module(validation_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([suite/0, all/0, groups/0, init_per_suite/1, end_per_suite/1,
init_per_group/2, end_per_group/2,
init_per_testcase/2, end_per_testcase/2]).
-export([v_5_1_1_1/1,
v_5_1_2_1/1,
v_5_2_1/1,
v_5_2_3/... | null | https://raw.githubusercontent.com/jlouis/graphql-erlang/4fd356294c2acea42a024366bc5a64661e4862d7/test/validation_SUITE.erl | erlang | Since we have not yet solved fragment expansion correctly, this
query doesn't work. But once fragment expansion is solved, then
we should expect a true return here over a false one. | -module(validation_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([suite/0, all/0, groups/0, init_per_suite/1, end_per_suite/1,
init_per_group/2, end_per_group/2,
init_per_testcase/2, end_per_testcase/2]).
-export([v_5_1_1_1/1,
v_5_1_2_1/1,
v_5_2_1/1,
v_5_2_3/... |
5b5be0b6724b2c3d30fb0cb202bce310cc1660ac6ded68b5c76a80705da4b4f3 | andrenth/ocaml-mariadb | util.ml | let flip f = fun x y -> f y x
let char_ptr_buffer_of_string s =
let open Ctypes in
let len = String.length s in
let buf = allocate_n char ~count:(len + 1) in
for i = 0 to len - 1 do
let p = buf +@ i in
p <-@ s.[i]
done;
(buf +@ len) <-@ '\000';
buf
let char_ptr_opt_buffer_of_string = function
... | null | https://raw.githubusercontent.com/andrenth/ocaml-mariadb/3ae20e7d58b30b75e47ad3f34b94bb32df2666b1/lib/util.ml | ocaml | let flip f = fun x y -> f y x
let char_ptr_buffer_of_string s =
let open Ctypes in
let len = String.length s in
let buf = allocate_n char ~count:(len + 1) in
for i = 0 to len - 1 do
let p = buf +@ i in
p <-@ s.[i]
done;
(buf +@ len) <-@ '\000';
buf
let char_ptr_opt_buffer_of_string = function
... | |
38695138a9d1dd45cd642bbe2c99282672d642976939bda9bb0124f1c5bf227c | thiago-negri/DuDuHoX | Game.hs | module DuDuHoX.Game where
data MoveDirection =
MoveUp |
MoveDown |
MoveLeft |
MoveRight
data GameInput =
Movement MoveDirection |
Quit
| null | https://raw.githubusercontent.com/thiago-negri/DuDuHoX/34942751c807ce69cd20d1a1a6fde4d6520460a4/src/DuDuHoX/Game.hs | haskell | module DuDuHoX.Game where
data MoveDirection =
MoveUp |
MoveDown |
MoveLeft |
MoveRight
data GameInput =
Movement MoveDirection |
Quit
| |
b934eda9f42e6e88c9c32d7aece062f07837b9d345718df0d24deed8decc76e1 | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
Issue 7124
-- when we sdist, error should tell which package caused the failure
main :: IO ()
main = cabalTest $ do
tmpdir <- fmap testTmpDir getTestEnv
fails $ cabal "v2-sdist" ["--output-directory", tmpdir, "all"]
| null | https://raw.githubusercontent.com/haskell/cabal/d2bff20fae387cffef4425820b6c1975f1821188/cabal-testsuite/PackageTests/SDist/T7124/cabal.test.hs | haskell | when we sdist, error should tell which package caused the failure | import Test.Cabal.Prelude
Issue 7124
main :: IO ()
main = cabalTest $ do
tmpdir <- fmap testTmpDir getTestEnv
fails $ cabal "v2-sdist" ["--output-directory", tmpdir, "all"]
|
52234bc879c87a81621a5e29855e915640fd85c64d01e75e23f840debb00b628 | GaloisInc/ivory | Area.hs | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ExistentialQuantification #
# OPTIONS_GHC -fno - warn - orphans #
module Ivory.Language.Area where
import Ivory.Language.Proxy
import Ivory.Language.Type
import qualified Ivory.Language.Syntax as I
import GHC.TypeLits (Nat... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory/src/Ivory/Language/Area.hs | haskell | Memory Areas ----------------------------------------------------------------
| Type proxies for @Area@s.
| The kind of memory-area types.
^ This is lifting for a *-kinded type
| Guard the inhabitants of the Area type, as not all *s are Ivory *s. | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ExistentialQuantification #
# OPTIONS_GHC -fno - warn - orphans #
module Ivory.Language.Area where
import Ivory.Language.Proxy
import Ivory.Language.Type
import qualified Ivory.Language.Syntax as I
import GHC.TypeLits (Nat... |
c06a198d4889c4220c9ea5acfdf0423eed4d49ecc12486010334eac83a898333 | NorfairKing/dekking | Plugin.hs | module Dekking.Plugin (plugin) where
import Control.Monad.Reader
import Control.Monad.Writer.Strict
import Data.List (isPrefixOf, stripPrefix)
import Data.Maybe (mapMaybe)
import Dekking.Coverable
import Dekking.SourceAdapter
import GHC
import qualified GHC.Data.EnumSet as EnumSet
import GHC.Driver.Plugins
import GHC.... | null | https://raw.githubusercontent.com/NorfairKing/dekking/3d3989e38584aff844cc22032bbc8a61fc53f465/dekking-plugin/src/Dekking/Plugin.hs | haskell | See [ref:-XImpredicativeTypes]
Turn off safe haskell, because we don't care about it for a coverage report.
Turn off inferring safe haskell, because we don't care about it for a coverage report.
Turn off all warnings, because the resulting source may cause warnings.
[tag:-XImpredicativeTypes]
In order to perform... | module Dekking.Plugin (plugin) where
import Control.Monad.Reader
import Control.Monad.Writer.Strict
import Data.List (isPrefixOf, stripPrefix)
import Data.Maybe (mapMaybe)
import Dekking.Coverable
import Dekking.SourceAdapter
import GHC
import qualified GHC.Data.EnumSet as EnumSet
import GHC.Driver.Plugins
import GHC.... |
1f9156502704e6b5f4078862314b7c420d4c4b13628b119a8c5e6946e224bc27 | re-path/studio | animate_transform.cljs | (ns repath.studio.tools.animate-transform
(:require [repath.studio.tools.base :as tools]))
(derive :animateTransform ::tools/animation)
(defmethod tools/properties :animateTransform [] {:description "The animateTransform element animates a transformation attribute on its target element, thereby allowing animations ... | null | https://raw.githubusercontent.com/re-path/studio/0841056ef12689cffb226a99a9dfe58d7f2c4778/src/repath/studio/tools/animate_transform.cljs | clojure | (ns repath.studio.tools.animate-transform
(:require [repath.studio.tools.base :as tools]))
(derive :animateTransform ::tools/animation)
(defmethod tools/properties :animateTransform [] {:description "The animateTransform element animates a transformation attribute on its target element, thereby allowing animations ... | |
137b5d2479339324b212f57fcd596caeb3b3942dee4dae85caa11bdd691619cb | Octachron/codept | c.ml | module B = B
| null | https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/ocamlbuild/src/c.ml | ocaml | module B = B
| |
bf17344ae8d1f1a8615b72667f9d467bb46666b67b2b8be7b98a18b484df2f6c | BinaryAnalysisPlatform/bap | baptop.ml | let main () =
UTop.require ["bap.top"];
UTop_main.main ()
let () =
try main () with
Symtable.Error err ->
Format.eprintf "Internal error: %a@." Symtable.report_error err;
exit 1
| null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/cbdf732d46c8e38df79d9942fc49bcb97915c657/src/baptop.ml | ocaml | let main () =
UTop.require ["bap.top"];
UTop_main.main ()
let () =
try main () with
Symtable.Error err ->
Format.eprintf "Internal error: %a@." Symtable.report_error err;
exit 1
| |
6acc45aa61499a15a2a2bd9c5c2c785fed11cbaad80f8aedd364fe6155d07d3a | EasyCrypt/easycrypt | ecHiNotations.mli | (* -------------------------------------------------------------------- *)
open EcSymbols
open EcParsetree
open EcLocation
open EcDecl
open EcEnv
(* -------------------------------------------------------------------- *)
type nterror =
| NTE_Typing of EcTyping.tyerror
| NTE_TyNotClosed
| NTE_DupIdent
| NTE_Unkn... | null | https://raw.githubusercontent.com/EasyCrypt/easycrypt/f87695472e70c313ef2966e20979b1afcc2e543e/src/ecHiNotations.mli | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
-------------------------------------------------------------------- | open EcSymbols
open EcParsetree
open EcLocation
open EcDecl
open EcEnv
type nterror =
| NTE_Typing of EcTyping.tyerror
| NTE_TyNotClosed
| NTE_DupIdent
| NTE_UnknownBinder of symbol
| NTE_AbbrevIsVar
exception NotationError of EcLocation.t * EcEnv.env * nterror
val nterror : EcLocation.t -> env -> nterror -> ... |
38d93fd48b7938255fc2ede9cabd1d77f50ad466798168f1cdf82058d1ee07b9 | clojure-interop/google-cloud-clients | VideoIntelligenceServiceSettings$Builder.clj | (ns com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings$Builder
"Builder for VideoIntelligenceServiceSettings."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.videointelligence.v1beta1 VideoIntelligenceServiceSettings$Builder]))
(defn get-stub-settings-builder... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.videointelligence/src/com/google/cloud/videointelligence/v1beta1/VideoIntelligenceServiceSettings%24Builder.clj | clojure | (ns com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings$Builder
"Builder for VideoIntelligenceServiceSettings."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.videointelligence.v1beta1 VideoIntelligenceServiceSettings$Builder]))
(defn get-stub-settings-builder... | |
2784ee3d7176e44c9e50a8206b30b4ff11877bd19bff14f37598eebc13a833db | amperity/envoy | types_test.clj | (ns envoy.types-test
(:require
[clojure.test :refer [are deftest is testing]]
[envoy.types :as types]))
(deftest type-parsing
(testing "edge cases"
(is (nil? (types/parse :foo nil))
"nil values are not parsed")
(is (thrown-with-msg?
RuntimeException #"Cannot parse non-string valu... | null | https://raw.githubusercontent.com/amperity/envoy/898ff9262b7a7bff9d666041974b97986faee471/test/envoy/types_test.clj | clojure | (ns envoy.types-test
(:require
[clojure.test :refer [are deftest is testing]]
[envoy.types :as types]))
(deftest type-parsing
(testing "edge cases"
(is (nil? (types/parse :foo nil))
"nil values are not parsed")
(is (thrown-with-msg?
RuntimeException #"Cannot parse non-string valu... | |
0acaed73cc5f1614cf0f44e2c00c4a8ee6646327f00fcce6daddd26f1ce16723 | JAremko/spacetools | interface.clj | (ns spacetools.contributors.interface)
;; add your function signatures here...
(defn add-two [x])
| null | https://raw.githubusercontent.com/JAremko/spacetools/d047e99689918b5a4ad483022f35802b2015af5f/interfaces/src/spacetools/contributors/interface.clj | clojure | add your function signatures here... | (ns spacetools.contributors.interface)
(defn add-two [x])
|
bafb01fda0d6ca757e73921715cb207c9899f52909ab71ed794f7060ded7070f | theam/aws-lambda-haskell-runtime | Lib.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
module Lib where
import Aws.Lamb... | null | https://raw.githubusercontent.com/theam/aws-lambda-haskell-runtime/0031c3eea919d0b1505dde5aa24fd31436a49503/examples/wai-app/src/Lib.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
The actual handler.
You can access your custom application config using the `customContext` IORef.
This application config will be preserved while the L... | # LANGUAGE DeriveGeneric #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Lib where
import Aws.Lambda
import Aws.Lambda.Wai
import Control.Exception (try)
import Control.Monad.Except (ExceptT (..))
import Data.Aeson
import Data.IORef (modifyIORef, readIORef)
import Data.Text as T
imp... |
33319ef31a6781497db428cd553eff3f24ccdc832b323a85c5f42b7a8a0d2a9b | rafaeldelboni/nota | data.cljs | (ns nota.application.data
(:require [cljs.core.async :as async]
[cljs.core.async.interop :refer-macros [<p!]]
[cljs.reader :as reader]
[clojure.string :as str]
[nota.routing :as routing]
[shadow.resource :as rc]))
(def data (reader/read-string (rc/inline ".... | null | https://raw.githubusercontent.com/rafaeldelboni/nota/bc9226cd0ca9e06497e2bcda370918d578f7f105/src/nota/application/data.cljs | clojure | (ns nota.application.data
(:require [cljs.core.async :as async]
[cljs.core.async.interop :refer-macros [<p!]]
[cljs.reader :as reader]
[clojure.string :as str]
[nota.routing :as routing]
[shadow.resource :as rc]))
(def data (reader/read-string (rc/inline ".... | |
e94947ad123ea585400f1b2dc1dbbd96f0d07aa680f5d31db1ca310aca164cb5 | kmi/irs | load.lisp | Mode : Lisp ; Package :
The Open University
(in-package "OCML")
(eval-when (eval load)
(ensure-ontology exchange-rate-provider-ontology method
))
(def-ontology generic-currency-converter
:includes (exchange-rate-provider-ontology)
:author "enrico"
:allowed-editors ("john")
:type :m... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/publisher/services/generic-currency-converter/load.lisp | lisp | Package : |
The Open University
(in-package "OCML")
(eval-when (eval load)
(ensure-ontology exchange-rate-provider-ontology method
))
(def-ontology generic-currency-converter
:includes (exchange-rate-provider-ontology)
:author "enrico"
:allowed-editors ("john")
:type :method)
|
7a0a2235cc2b005ce012886a2e3772a0479290744dcd4644b45d636f40a4d49a | ates/netspire-core | mod_rpc.erl | -module(mod_rpc).
-behaviour(gen_module).
-behaviour(gen_server).
%% API
-export([start_link/1]).
%% gen_module callbacks
-export([start/1, stop/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3]).
-include("../netspire.hrl").
-record(st... | null | https://raw.githubusercontent.com/ates/netspire-core/746c0f254aa6f2669040d954096b4a95ae58b3ce/src/modules/mod_rpc.erl | erlang | API
gen_module callbacks
gen_server callbacks | -module(mod_rpc).
-behaviour(gen_module).
-behaviour(gen_server).
-export([start_link/1]).
-export([start/1, stop/0]).
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3]).
-include("../netspire.hrl").
-record(state, {socket}).
start(Options) ->
?INFO_MSG("Start... |
3da4194c4aa36dc1f7e44898c639039ba9a2d6d6d3b8f7dc833d88a0229b0282 | mirage/ocaml-uri | uri_services_raw.ml | let search_string keys k =
let rec loop keys k low high =
if low > high then (-1)
else begin
let mid = (high + low) / 2 in
let diff = String.compare k keys.(mid) in
if diff < 0 then loop keys k low (mid - 1)
else if diff > 0 then loop keys k (mid + 1) high
else mid
end
in l... | null | https://raw.githubusercontent.com/mirage/ocaml-uri/b4a8375d9352d29ff495d35fc309609fad74631a/etc/uri_services_raw.ml | ocaml | let search_string keys k =
let rec loop keys k low high =
if low > high then (-1)
else begin
let mid = (high + low) / 2 in
let diff = String.compare k keys.(mid) in
if diff < 0 then loop keys k low (mid - 1)
else if diff > 0 then loop keys k (mid + 1) high
else mid
end
in l... | |
7e2a1bf5a3004268e8860c8c76d1b691a9f2883b8e6cefd63f44bc3dc083164d | AntidoteDB/gingko | default_gen_server_behaviour.erl | %%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing,
software distributed under the Lic... | null | https://raw.githubusercontent.com/AntidoteDB/gingko/a965979aefb2868abcd0b3bf5ed1b5e4f9fdd163/src/default_gen_server_behaviour.erl | erlang |
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either expressed or implied. See the License for the
specific language governing permissions and limitations
under the License.
Description and complete Li... | This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(default_gen_server_behaviour).
-author("Kevin Bartik <>").
-export([ini... |
1014f2cfa5d5afd62627526024a332fe9cf7b27abbca0bb5fbe19ffe69dc3e69 | cartazio/tlaps | worklist.ml |
* worklist.ml --- work lists
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* worklist.ml --- work lists
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 28687 $";;
module Dq = Deque
type 'a wl = { add : 'a -> unit ;
next : un... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/util/worklist.ml | ocaml |
* worklist.ml --- work lists
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* worklist.ml --- work lists
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 28687 $";;
module Dq = Deque
type 'a wl = { add : 'a -> unit ;
next : un... | |
77c17e19bc592728f8d8ed5b5649b79b6a68ed1aeda5f017eda4a41a86706dbe | jayrbolton/coursework | NonEmpty.hs | {-# LANGUAGE EmptyDataDecls
, ExistentialQuantification
, ScopedTypeVariables
, NoMonomorphismRestriction
#-}
module MAlonzo.Data.List.NonEmpty where
import qualified Unsafe.Coerce
import qualified MAlonzo.Category.Monad
import qualified MAlonzo.Category.Monad.Indexed
import qualified... | null | https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computability_and_formal_languages/project__/agda/MAlonzo/Data/List/NonEmpty.hs | haskell | # LANGUAGE EmptyDataDecls
, ExistentialQuantification
, ScopedTypeVariables
, NoMonomorphismRestriction
# | module MAlonzo.Data.List.NonEmpty where
import qualified Unsafe.Coerce
import qualified MAlonzo.Category.Monad
import qualified MAlonzo.Category.Monad.Indexed
import qualified MAlonzo.Data.Function
import qualified MAlonzo.Data.List
import qualified MAlonzo.Data.Nat
import qualified MAlonzo.Data.Product
import qualifie... |
17c58b8ec836d5f167ad873cc23f261a400af6f92dc47ba8e3aee9a546ee9d63 | AntidoteDB/gingko | gingko_cache_server.erl | %%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing,
software distributed under the Lic... | null | https://raw.githubusercontent.com/AntidoteDB/gingko/a965979aefb2868abcd0b3bf5ed1b5e4f9fdd163/src/gingko_cache_server.erl | erlang |
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either expressed or implied. See the License for the
specific language governing permissions and limitations
under the License.
Description and complete Li... | This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(gingko_cache_server).
-author("Kevin Bartik <>").
-behaviour(gen_server)... |
087505bcdc3fa27f7001e33f843f78d9cfbaa68bdd02ca26580511849e43f1f1 | chaw/r7rs-libs | des-test.sps | Copyright © 2009 , 2010 , 2011 < >
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , including without limitation
;; the rights to use, copy, modify, merge, publis... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/weinholt-tests/des-test.sps | scheme | Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following conditions:
The above copyright notice... | Copyright © 2009 , 2010 , 2011 < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EX... |
32e44069a0034d71a30a7b1e61a0a95772f78efcb2ded301771e1744085c71da | nyampass/appollo | users.clj | (ns appollo.users
(use conceit.commons
conceit.commons.mongodb)
(require [appollo
[cursor :as cursor]
[conversion :as conversion]
[services :as services]]
[mongoika :as mongo]))
(defn- user-from-mongo-data [mongo-data]
(merge {:id (str (:_id mongo-data))}
... | null | https://raw.githubusercontent.com/nyampass/appollo/50275285c26a2c4fa8f8209a7b6a14aafead86b9/src/appollo/users.clj | clojure | (ns appollo.users
(use conceit.commons
conceit.commons.mongodb)
(require [appollo
[cursor :as cursor]
[conversion :as conversion]
[services :as services]]
[mongoika :as mongo]))
(defn- user-from-mongo-data [mongo-data]
(merge {:id (str (:_id mongo-data))}
... | |
b33edda183ea310917d835e32d335d1dc9f8cfb3ecc7952eb55b78c80e1f80d0 | JustusAdam/schedule-planner | TUDresden.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TupleSections #
# LANGUAGE UnicodeSyntax #
module SchedulePlanner.Scraper.TUDresden (scrapeTuDresden) where
import Control.Applicative ((<|>))
import Control.Applicative.Unicode
import Contro... | null | https://raw.githubusercontent.com/JustusAdam/schedule-planner/ba501c4c8332b5e11379fb500d867fdc8082d482/src/SchedulePlanner/Scraper/TUDresden.hs | haskell | # LANGUAGE OverloadedStrings #
grabTableRegex :: Regex
trRegex :: Regex
aRegex :: Regex
brRegex :: Regex | # LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE UnicodeSyntax #
module SchedulePlanner.Scraper.TUDresden (scrapeTuDresden) where
import Control.Applicative ((<|>))
import Control.Applicative.Unicode
import Control.Arrow (second, (&&... |
38a92794898e3c9c1610a45154efe0a174e2553efb070408edd2be8dcc2e4fb2 | Decentralized-Pictures/T4L3NT | environment_context.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/d78a26396860cadf8650900e51b93d30ec83923d/src/lib_protocol_environment/environment_context.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
327e4eb213bc286d344b9faaee92d95ce7bc30855c76fe18da9cf88a286b213b | AvisoNovate/logging | setup.clj | (ns io.aviso.logging.setup
"Enables pretty exception reporting in the REPL and/or console, and sets up pretty exception logging
when using clojure.tools.logging. Also installs an default uncaught exception handler, and initializes
logging correlation id."
(:require [io.aviso.logging.correlation]
[io.avi... | null | https://raw.githubusercontent.com/AvisoNovate/logging/e88b6ea98420cc2cad8c7df87b00848f6d8c527e/src/io/aviso/logging/setup.clj | clojure | (ns io.aviso.logging.setup
"Enables pretty exception reporting in the REPL and/or console, and sets up pretty exception logging
when using clojure.tools.logging. Also installs an default uncaught exception handler, and initializes
logging correlation id."
(:require [io.aviso.logging.correlation]
[io.avi... | |
353df5d1f779f6d11ac9a690f36cae60482bbb992a5ff293c18c18591d9fbd84 | Kappa-Dev/KappaTools | translation_in_natural_language.ml | *
* translation_in_natural_language.ml
* openkappa
* , projet Abstraction / Antique , INRIA Paris - Rocquencourt
*
* Creation : 2016
* Last modification : Time - stamp : < Dec 22 2018 >
* *
* Signature for prepreprocessing language ckappa
*
* Copyright 2010,2011,2012,2013,2014 Institut N... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/KaSa_rep/reachability_analysis/translation_in_natural_language.ml | ocaml | **************************************************************************
TODO: bdu_ex
**************************************************************************
OK if the agent
has no sites
*****************************************************************... | *
* translation_in_natural_language.ml
* openkappa
* , projet Abstraction / Antique , INRIA Paris - Rocquencourt
*
* Creation : 2016
* Last modification : Time - stamp : < Dec 22 2018 >
* *
* Signature for prepreprocessing language ckappa
*
* Copyright 2010,2011,2012,2013,2014 Institut N... |
21cd1e7c6cddf21eb2680ce814895659a0dc763615606432dd20f61e1bf66d73 | srdqty/talc-3.0 | main.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/srdqty/talc-3.0/df83dd5ff0e2b189b13280ddae233d8277199350/apps/cyclone/tools/lex/main.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 : main.ml , v 1.1 2000/09/13 04... |
fc441701ca7357201de02cf2069f8cbd15b7b94fb4c3577f8787d3086d580cda | aantron/luv | send_signal.ml | let () =
let child =
Luv.Process.spawn "sleep" ["sleep"; "10"] |> Result.get_ok in
ignore (Luv.Process.kill child Luv.Signal.sigkill);
ignore (Luv.Loop.run () : bool)
| null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/example/send_signal.ml | ocaml | let () =
let child =
Luv.Process.spawn "sleep" ["sleep"; "10"] |> Result.get_ok in
ignore (Luv.Process.kill child Luv.Signal.sigkill);
ignore (Luv.Loop.run () : bool)
| |
ef837b7b60d719728c0d63ef11f70c82996ecf279f888a9401e41417521829bd | basho/riak_dt | riak_dt_vclock.erl | %% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except... | null | https://raw.githubusercontent.com/basho/riak_dt/52ef3b2166731cf4ac44ef54262761f5aef6d559/src/riak_dt_vclock.erl | erlang | -------------------------------------------------------------------
riak_core: Core Riak Application
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
sp... | Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
2e1f618923587af4bac1c0a94ff19eb5d7430ff25ca266c4443ee5111a564d35 | blak3mill3r/noah | impl.clj | (ns noah.impl
"Gross namespace with funkadelic macro to make wrappers."
(:require
[camel-snake-kebab.core :refer [->kebab-case]]
[noah.fn-wrap :as fn-wrap]
[noah.transformer]
[noah.javanation :refer [conversion-fn]]
[clojure.reflect :as ref]
[clojure.string :as str])
(:import
[org.apache.kafk... | null | https://raw.githubusercontent.com/blak3mill3r/noah/b6f4fc380c4af7ca4440e0e27fb92efcdeda8310/src/noah/impl.clj | clojure |
* Implementation of `(defwrappers)` macro
first we define a hierarchy for the wrapper multimethod dispatch
multimethod dispatch will take care of finding the matching signature on the
right target class
can automate using java reflection? ... why was this even necessary?
Implementation details
this is the multi... | (ns noah.impl
"Gross namespace with funkadelic macro to make wrappers."
(:require
[camel-snake-kebab.core :refer [->kebab-case]]
[noah.fn-wrap :as fn-wrap]
[noah.transformer]
[noah.javanation :refer [conversion-fn]]
[clojure.reflect :as ref]
[clojure.string :as str])
(:import
[org.apache.kafk... |
948b4f842ec26dcfb3ef8dc7ad34c47e623dfb55e31977c14cca2eadcf053c4c | bracevac/corrl | Core.hs | -----------------------------------------------------------------------------
Copyright 2012 Microsoft Corporation .
--
-- This is free software; you can redistribute it and/or modify it under the
terms of the Apache License , Version 2.0 . A copy of the License can be
found in the file " license.txt " a... | null | https://raw.githubusercontent.com/bracevac/corrl/416cd107087ac070a6bcabf8e7937211b6f415bb/koka/src/Core/Core.hs | haskell | ---------------------------------------------------------------------------
This is free software; you can redistribute it and/or modify it under the
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Data struc... | Copyright 2012 Microsoft Corporation .
terms of the Apache License , Version 2.0 . A copy of the License can be
found in the file " license.txt " at the root of this distribution .
System F - like core language .
-}
Core(..)
, Imports, Import(..)
... |
77a717aa5e7b7ce8bd5e2ca93ecc64e09c1d99e112c53ee13bf49fa38efc7015 | nodew/haskell-realworld-example | Comment.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE StandaloneDeriving #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DuplicateRecordFields #
module Conduit.Db.Schema.Comment where
import RIO
import Rel8
import Rel8.Expr.Time
import Data.Time
import Data.UUID
import Conduit.C... | null | https://raw.githubusercontent.com/nodew/haskell-realworld-example/8fd5939105044239ca70ce2081ca4fa99710ac5f/src/Conduit/Db/Schema/Comment.hs | haskell | # LANGUAGE DeriveAnyClass # | # LANGUAGE DerivingStrategies #
# LANGUAGE StandaloneDeriving #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE DuplicateRecordFields #
module Conduit.Db.Schema.Comment where
import RIO
import Rel8
import Rel8.Expr.Time
import Data.Time
import Data.UUID
import Conduit.Core.User
import Conduit.Core.Art... |
3f0f4f9893a95ff82c12751643ed715456ad90cceb893c3c3998f9ae09caab02 | svenpanne/EOPL3 | exercise-3-17.rkt | #lang eopl
; ------------------------------------------------------------------------------
Exercise 3.17
See : exercise 3.16
; ------------------------------------------------------------------------------
Scanner and parser specification
(define scanner-spec
'((whitespace (whitespace) skip)
(comment ("... | null | https://raw.githubusercontent.com/svenpanne/EOPL3/3fc14c4dbb1c53a37bd67399eba34cea8f8234cc/chapter3/exercise-3-17.rkt | racket | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Debugging helpers for scanner and parser
-------------------------------------... | #lang eopl
Exercise 3.17
See : exercise 3.16
Scanner and parser specification
(define scanner-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(number (digit (arbno digit)) number)
(number ("-" digit (arbno digit)) number)
(nullary-op ("emptylist") string)
... |
b7a535f38d8348d5e805e4e6d4a0773748fd8520504be250233f7651b076dc66 | CryptoKami/cryptokami-core | Generator.hs | -- | Generators of arbitrary data.
# OPTIONS_GHC -F -pgmF autoexporter #
| null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/generator/src/Pos/Generator.hs | haskell | | Generators of arbitrary data. |
# OPTIONS_GHC -F -pgmF autoexporter #
|
6ad12f777e30729cbf1851837341044b8dea378fb900ba07fbd4c0fe9e6e60f4 | jordanthayer/ocaml-search | grid_rev_heuristics.ml | Contains all reversed heuristics for the grid domain
Jordan April 8
Jordan April 8
*)
open Grid
(* Life *)
let life_eight_cost_dist_rev w =
let costs = int_costs w
and h = height w in
let get_cost_dist =
(fun n (gx,gy) ->
* admissible for 8 - way actions ( and therefore also 4 - way )
le... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/grid/grid_rev_heuristics.ml | ocaml | Life
path might go above higher point
amount by which we will go above
path stays between points
path might go above higher point
amount by which we will go above
path stays between points
must equalize y, either at start or end
can either go straight over or up and over
must equalize y, either at st... | Contains all reversed heuristics for the grid domain
Jordan April 8
Jordan April 8
*)
open Grid
let life_eight_cost_dist_rev w =
let costs = int_costs w
and h = height w in
let get_cost_dist =
(fun n (gx,gy) ->
* admissible for 8 - way actions ( and therefore also 4 - way )
let x, y = n.... |
80fcd50f01b732b09ba759f9c76f52a9de719b788ef5c4a44e170b403c5215dc | macchiato-framework/examples | project.clj | (defproject guestbook "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:dependencies [[bidi "2.0.14"]
[com.taoensso/timbre "4.7.4"]
[hiccups "0.3.0"]
[macchiato/core "0.1.2"]
[macchiato/env "0.0.3"]
[macchiato/sql "0.0.... | null | https://raw.githubusercontent.com/macchiato-framework/examples/946bdf1a04f5ef787fc83affdcbf6603bbf29b5c/guestbook-ws/project.clj | clojure | (defproject guestbook "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:dependencies [[bidi "2.0.14"]
[com.taoensso/timbre "4.7.4"]
[hiccups "0.3.0"]
[macchiato/core "0.1.2"]
[macchiato/env "0.0.3"]
[macchiato/sql "0.0.... | |
c1f2f0656d9347b267fbd10463c53e9028889e3e5ac6b47dfc80ce2066f27989 | c-cube/ocaml-containers | CCArray.mli | (* This file is free software, part of containers. See file "license" for more details. *)
(** Array utils *)
type 'a iter = ('a -> unit) -> unit
* Fast internal iterator .
@since 2.8
@since 2.8 *)
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/1d08a05c443bfe099746995d7505930fad36d9fc/src/core/CCArray.mli | ocaml | This file is free software, part of containers. See file "license" for more details.
* Array utils
* {2 Arrays}
* [empty] is the empty array, physically equal to [[||]].
* [equal eq a1 a2] is [true] if the lengths of [a1] and [a2] are the same
and if their corresponding elements test equal, using [eq].
* [com... |
type 'a iter = ('a -> unit) -> unit
* Fast internal iterator .
@since 2.8
@since 2.8 *)
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Random.State.t -> 'a
type 'a printer = Format.formatter -> 'a -> unit
[@@@ifge 4.8]
include module t... |
bdfb657dedfd9a2e019a4c64f3b10920b800d959a6c402d4f95a45eb1f88f76b | arunisaac/ccwl | graphviz.scm | ;;; ccwl --- Concise Common Workflow Language
Copyright © 2021 Arun Isaac < >
;;;
This file is part of ccwl .
;;;
;;; ccwl 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 ... | null | https://raw.githubusercontent.com/arunisaac/ccwl/51c12b7e58685b70e7cfd9612dac403cf9ee845c/ccwl/graphviz.scm | scheme | ccwl --- Concise Common Workflow Language
ccwl is free software: you can redistribute it and/or modify it
(at your option) any later version.
ccwl 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 PURPOS... | Copyright © 2021 Arun Isaac < >
This file is part of ccwl .
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
along with ccwl . If not , see < / > .
Th... |
62f49ec8e49f4b8cfecbbff508a3e5809082350b1db3239ede82d355053fcdfd | antono/guix-debian | services.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 < >
;;;
;;; 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 t... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/services.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 © 2013 , 2014 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu services)
#:use-module (guix records)
#:export (service?
service
... |
74ba3523304ef09c55fc6516984db5a7e19e97d1862c16e924fd8f2609e8b37d | yogthos/krueger | client_routes.cljc | (ns krueger.client-routes)
(def routes
[["/" :home]
["/admin" :admin]
["/comments" :comments]
["/messages" :messages]
["/post/:id" :post]
["/posts/new" :submit-post]
["/profile" :profile]
["/submit" :submit]]) | null | https://raw.githubusercontent.com/yogthos/krueger/782e1f8ab358867102b907c5a80e56ee6bc6ff82/src/cljc/krueger/client_routes.cljc | clojure | (ns krueger.client-routes)
(def routes
[["/" :home]
["/admin" :admin]
["/comments" :comments]
["/messages" :messages]
["/post/:id" :post]
["/posts/new" :submit-post]
["/profile" :profile]
["/submit" :submit]]) | |
165a8c176c677adf04076bdb92f8a85aa6b6014d02325a934aaf96de708a1981 | pveber/bistro | execution_env.mli | open Bistro_internals
type insert =
| Path of Workflow.path
| Path_list of {
elts : Workflow.path list ;
sep : string ;
quote : char option ;
}
| String of string
val compare_insert : insert -> insert -> int
type t = {
db : Db.t ;
allowed_containers : [`Docker | `Singularity] list ;
... | null | https://raw.githubusercontent.com/pveber/bistro/da0ebc969c8c5ca091905366875cbf8366622280/lib/engine/execution_env.mli | ocaml | host all execution
expected path for the target
temp dir for the process | open Bistro_internals
type insert =
| Path of Workflow.path
| Path_list of {
elts : Workflow.path list ;
sep : string ;
quote : char option ;
}
| String of string
val compare_insert : insert -> insert -> int
type t = {
db : Db.t ;
allowed_containers : [`Docker | `Singularity] list ;
... |
cb65ceed8b2d41d438ce412a56a10b89667ceb06234aae2421cdde98ade1ab72 | brownplt/lambda-py | python-lexical-printer.rkt | #lang plai-typed/untyped
(require "python-lexical-syntax.rkt")
(require [typed-in racket (pretty-write : ('a -> void))])
(define (s-map f expr) : boolean (begin (map f expr) false))
(define (comma-separate [es : (listof LexExpr)]) : boolean
(cond
[(empty? es) false]
[(empty? (rest es)) (begin (lexexpr-print-h... | null | https://raw.githubusercontent.com/brownplt/lambda-py/c3ee39502c8953d36b886e5a203f2eb51d2f495b/base/python-lexical-printer.rkt | racket | (define default-color "\033[1;37m")
(display "\033[1;35m")
(display default-color)
(display "\033[22;33mHello world!\033[1;35m")
control structures
(display starting-tab)
(display "#in a sequence\n")
the top level seq
primitive literals
exceptions and exception handling
loops
pass & assert
classes and object... | #lang plai-typed/untyped
(require "python-lexical-syntax.rkt")
(require [typed-in racket (pretty-write : ('a -> void))])
(define (s-map f expr) : boolean (begin (map f expr) false))
(define (comma-separate [es : (listof LexExpr)]) : boolean
(cond
[(empty? es) false]
[(empty? (rest es)) (begin (lexexpr-print-h... |
a3869f0d26c7b2580908aae2462a0e7abdfee11a1deb804d247f4c2e85a28652 | cbaggers/glsl-spec | package.lisp | ;; glsl-symbols
(UIOP/PACKAGE:DEFINE-PACKAGE #:GLSL-SYMBOLS.TYPES (:USE #:CL)
(:EXPORT :ATOMIC-UINT :BOOL :BUFFER-IMAGE :BVEC2
:BVEC3 :BVEC4 :DEPTH-RANGE-PARAMETERS :DMAT2
:DMAT2X2 :DMAT2X3 :DMAT2X4 :DMAT3 :DMAT3X2
... | null | https://raw.githubusercontent.com/cbaggers/glsl-spec/f04476f7da89355ae6856b33283c60ba95c6555d/symbols/package.lisp | lisp | glsl-symbols |
(UIOP/PACKAGE:DEFINE-PACKAGE #:GLSL-SYMBOLS.TYPES (:USE #:CL)
(:EXPORT :ATOMIC-UINT :BOOL :BUFFER-IMAGE :BVEC2
:BVEC3 :BVEC4 :DEPTH-RANGE-PARAMETERS :DMAT2
:DMAT2X2 :DMAT2X3 :DMAT2X4 :DMAT3 :DMAT3X2
:... |
b6e05db5a4591b8d0dbc167fccc41813dc10fe6671e0539b5f2814106fc793f8 | pigworker/Syrup | Scp.hs | ------------------------------------------------------------------------------
----- -----
--- -----
----- -----
-------------------------... | null | https://raw.githubusercontent.com/pigworker/Syrup/d59e3a9b65274075f14f19b48746182a773bafc5/SRC/Scp.hs | haskell | ----------------------------------------------------------------------------
--- -----
- -----
--- -----
---------------------------------... |
# LANGUAGE TypeFamilies #
# LANGUAGE KindSignatures #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE GeneralizedNewtypeDeriving #
module Syrup.SRC.Scp where
import Control.Monad
import Data.Bifunctor
import Data.Char
import Data.List
import D... |
aa713c78489ae5e90f24cd513f710f53e3575c273c4646fbeafee58ea82d72d0 | AppsFlyer/ketu | log.clj | (ns ketu.util.log
(:import (org.slf4j Logger)))
(defmacro error
([logger s] `(.error ~logger ~s))
([logger s x] `(.error ~logger ~s ~x))
([logger s x y] `(.error ~logger ~s ~x ~y))
([logger s x y & zs]
`(.error ^Logger ~logger ~s
^"[Ljava.lang.Object;" (into-array Object ~(into [x y] zs)))))
... | null | https://raw.githubusercontent.com/AppsFlyer/ketu/deadce66cb72a0b272ce4397808aba09c1702392/src/ketu/util/log.clj | clojure | (ns ketu.util.log
(:import (org.slf4j Logger)))
(defmacro error
([logger s] `(.error ~logger ~s))
([logger s x] `(.error ~logger ~s ~x))
([logger s x y] `(.error ~logger ~s ~x ~y))
([logger s x y & zs]
`(.error ^Logger ~logger ~s
^"[Ljava.lang.Object;" (into-array Object ~(into [x y] zs)))))
... | |
6a3eb94dc9717bf5209b7183ce48edf556dea704c65ecd44f8a091cd82dd1e42 | metabase/metabase | redshift.clj | (ns metabase.driver.redshift
"Amazon Redshift Driver."
(:require
[cheshire.core :as json]
[clojure.java.jdbc :as jdbc]
[java-time :as t]
[metabase.driver :as driver]
[metabase.driver.common :as driver.common]
[metabase.driver.sql-jdbc.common :as sql-jdbc.common]
[metabase.driver.sql-jdbc.connec... | null | https://raw.githubusercontent.com/metabase/metabase/9ac7f26ed92ea0dff3474c0f887040549d2d85ad/modules/drivers/redshift/src/metabase/driver/redshift.clj | clojure | +----------------------------------------------------------------------------------------------------------------+
| metabase.driver impls |
+--------------------------------------------------------------------------------------... | (ns metabase.driver.redshift
"Amazon Redshift Driver."
(:require
[cheshire.core :as json]
[clojure.java.jdbc :as jdbc]
[java-time :as t]
[metabase.driver :as driver]
[metabase.driver.common :as driver.common]
[metabase.driver.sql-jdbc.common :as sql-jdbc.common]
[metabase.driver.sql-jdbc.connec... |
e59b00e51c5ec751c66ac3680fb11dcd6fa54b4bc395cd9f722f99ab86fe3591 | azimuth-project/applied-category-theory-course | posetFunctionality.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE StandaloneDeriving #
# LANGUAGE DataKinds , TypeFamilies , TypeOperators #
# LANGUAGE UndecidableInstances #
module PosetFunctionality where
import qualified Math.Combinatorics.Poset as PS
import qualified Math.Combinat.Partitions.Set as SetPart
import qualified Data.Set as Set
getS... | null | https://raw.githubusercontent.com/azimuth-project/applied-category-theory-course/ebf86821f420b1935dfd63c8f5a3cca2df24dde2/src/posetFunctionality.hs | haskell | # LANGUAGE GADTs #
biggerThanAll p z xs tells if z is greater than or equal to all x from xs
given the list of upperBounds, an element z of this list may be not a good candidate for least upper bound
make the list of upperBounds and then filter away the candidates that are too big
flip everything upside down
assume ... | # LANGUAGE StandaloneDeriving #
# LANGUAGE DataKinds , TypeFamilies , TypeOperators #
# LANGUAGE UndecidableInstances #
module PosetFunctionality where
import qualified Math.Combinatorics.Poset as PS
import qualified Math.Combinat.Partitions.Set as SetPart
import qualified Data.Set as Set
getSet :: PS.Poset t1 -> [t... |
cf8418e68e5844140c1a12eef37f1cfd8d7df0fee46ea06a39f66715b136b93f | REMath/mit_16.399 | red-Parity-Intervals12.ml | red-Parity-Intervals12.ml
avalues.ml of Parity
\gamma(BOT ) = { _ O_(a ) }
\gamma(ODD ) = { 2n+1\in[min_int , max_int ] | n\in Z } U { _ O_(a ) }
) = { 2n\in[min_int , max_int ] | n\in Z } U { _ O_(a ) }
\gamma(TOP ) = [ min_int , max_int ] U { _ O_(a),_O_(... | null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Non-Relational/05-Prod-Red/red-Parity-Intervals12.ml | ocaml | avalues.ml of Intervals
gamma (a,b) = [a,b] U {_O_(a), _O_(i)} when min_int <= a <= b <= max_int
= {_O_(a), _O_(i)} when a = max_int > min_int = b
reduction of parity and intervals | red-Parity-Intervals12.ml
avalues.ml of Parity
\gamma(BOT ) = { _ O_(a ) }
\gamma(ODD ) = { 2n+1\in[min_int , max_int ] | n\in Z } U { _ O_(a ) }
) = { 2n\in[min_int , max_int ] | n\in Z } U { _ O_(a ) }
\gamma(TOP ) = [ min_int , max_int ] U { _ O_(a),_O_(... |
bb209713953d7cd5faed67db954a5d9207a6a00dcf72ee61a6ecf342027bf4c0 | zalora/aws-ec2 | GetConsoleOutput.hs | # LANGUAGE TemplateHaskell
, MultiParamTypeClasses
, TypeFamilies
, RecordWildCards
, DeriveGeneric
#
, MultiParamTypeClasses
, TypeFamilies
, RecordWildCards
, DeriveGeneric
#-}
module Aws.Ec2.Comma... | null | https://raw.githubusercontent.com/zalora/aws-ec2/60b7ad4464edf3c69da8c2f023db4ba2fa7ffc48/src/Aws/Ec2/Commands/GetConsoleOutput.hs | haskell | # LANGUAGE TemplateHaskell
, MultiParamTypeClasses
, TypeFamilies
, RecordWildCards
, DeriveGeneric
#
, MultiParamTypeClasses
, TypeFamilies
, RecordWildCards
, DeriveGeneric
#-}
module Aws.Ec2.Comma... | |
fb8d38681edc3df74192d68c1a34139b796d2fd6920f696527c37e5e7f199833 | plasma-umass/compsci631 | Xinterp_util_tests.ml | open Xinterp_util
let%TEST "array creation" =
from_string "array(10,true)" = MkArray (Const (Int 10), Const (Bool true))
let%TEST "array indexing" =
from_string "arr[1][2]" = GetArray (GetArray (Id "arr", Const (Int 1)), Const (Int 2))
let%TEST "array update" =
from_string "... | null | https://raw.githubusercontent.com/plasma-umass/compsci631/d71d866460cac0659f31276cfb79afedc211481a/tests/Xinterp_util_tests.ml | ocaml | open Xinterp_util
let%TEST "array creation" =
from_string "array(10,true)" = MkArray (Const (Int 10), Const (Bool true))
let%TEST "array indexing" =
from_string "arr[1][2]" = GetArray (GetArray (Id "arr", Const (Int 1)), Const (Int 2))
let%TEST "array update" =
from_string "... | |
22096c20a572321b44072b3b76cbabbd27583d529cfe27a322f76b8e6475591d | tonsky/Clojure-Sublimed | forms.clj | ; simple expr
(+ 1 2)
(+ 1 2)
(str 1 '\newline 2)
"xxx\nyyy\"zzz\\aaa\t"
; long value
(range 300)
(range 1 100)
; complex value
(bean "abc")
#{1 2 3 4 5 6 7 8 9 {:a 1 :bbb 234 :cc 5} 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 {:a 6 :bbb 789 :cc 10} 41 42 43 44 45 46 4... | null | https://raw.githubusercontent.com/tonsky/Clojure-Sublimed/ed04ef0b30271beb67563e6ba33131abf13dfb0a/test_repl/forms.clj | clojure | simple expr
long value
complex value
delayed eval
infinite sequence
print
print to stderr
print in background
throw exception
truncating
lookups
top-level forms
comment forms
malformed expr
namespace | (+ 1 2)
(+ 1 2)
(str 1 '\newline 2)
"xxx\nyyy\"zzz\\aaa\t"
(range 300)
(range 1 100)
(bean "abc")
#{1 2 3 4 5 6 7 8 9 {:a 1 :bbb 234 :cc 5} 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 {:a 6 :bbb 789 :cc 10} 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61... |
2244cc4b6be5d4dee0b6924785436b596814253fda0335677fa25a60ea84dc1f | arttuka/reagent-material-ui | blinds_closed_rounded.cljs | (ns reagent-mui.icons.blinds-closed-rounded
"Imports @mui/icons-material/BlindsClosedRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def blinds-closed-r... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/blinds_closed_rounded.cljs | clojure | (ns reagent-mui.icons.blinds-closed-rounded
"Imports @mui/icons-material/BlindsClosedRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def blinds-closed-r... | |
4ef85c5f574c01ad8c00aea5fdfc2c75a4551a1b158612614b267182e7ed9513 | mfikes/fifth-postulate | ns496.cljs | (ns fifth-postulate.ns496)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns496.cljs | clojure | (ns fifth-postulate.ns496)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
54864575f1352df59a181a8f9f767de4cafbc5483e9d63b1220b62ba0ca5d463 | quintype/ringo | Internal.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE GADTs #-}
module Ringo.Generator.Internal where
import qualified Data.Map as Map
import qualified Data.Text as Text
import Database.HsSqlPpp.Syntax (ScalarExpr)
import Data.List (find)
import Data.Monoid ((<>))
im... | null | https://raw.githubusercontent.com/quintype/ringo/3faf4ff82e1f3a53175ad813849c2e9047930d7f/src/Ringo/Generator/Internal.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs # | # LANGUAGE RecordWildCards #
module Ringo.Generator.Internal where
import qualified Data.Map as Map
import qualified Data.Text as Text
import Database.HsSqlPpp.Syntax (ScalarExpr)
import Data.List (find)
import Data.Monoid ((<>))
import Data.Text (Text)
import Ringo.Extract... |
82ef18a8325419121e488ded1654ed9a80c694bcd4c866190b527d74d8b99a32 | ivanjovanovic/sicp | e-5.20.scm | Exercise 5.20 . Draw the box - and - pointer representation and the
memory - vector representation ( as in figure 5.14 ) of the list structure
; produced by
(define x (cons 1 2))
(define y (list x x))
; with the free pointer initially p1. What is the final value of free ?
; What pointers represent the values of... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/5.3/e-5.20.scm | scheme | produced by
with the free pointer initially p1. What is the final value of free ?
What pointers represent the values of x and y ?
------------------------------------------------------------
There is a PNG drawing of the memory layout for the creation of these
I start counting from 0 and at the end free register... | Exercise 5.20 . Draw the box - and - pointer representation and the
memory - vector representation ( as in figure 5.14 ) of the list structure
(define x (cons 1 2))
(define y (list x x))
two objects x and y.
the fourth place in the array which is indexed with the number 3 .
|
99026cc05ca4aa9510420cbd2ee9fd9488d0297f2f55fa9bd2726c07cdca2ac9 | Frama-C/Frama-C-snapshot | recursion.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/engine/recursion.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
3d7dd2f8a9dec7e7cd8fb7f576ee293518b7e402d293244699c83836413ca40a | turtl/core-cl | drakma.lisp | ;; setup ASDF
(require :asdf)
(let ((cur-dir (truename *default-pathname-defaults*)))
(setf asdf:*central-registry* (list cur-dir (truename "./app/asdf/registry/") (truename "./app/")))
(setf asdf::*user-cache* (list (merge-pathnames #p"app/asdf/" cur-dir) "cache" :IMPLEMENTATION)))
;; setup sockets. we really don'... | null | https://raw.githubusercontent.com/turtl/core-cl/8fdfaaf918f731318e734eaa7adcd083494f44b8/test/drakma.lisp | lisp | setup ASDF
setup sockets. we really don't need the full socket lib though since all comm
sb-bsd-sockets package exists.
(require :sockets)
load main libraries/initialize
-----------------------------------------------------------------------------
start the app
---------------------------------------------------... | (require :asdf)
(let ((cur-dir (truename *default-pathname-defaults*)))
(setf asdf:*central-registry* (list cur-dir (truename "./app/asdf/registry/") (truename "./app/")))
(setf asdf::*user-cache* (list (merge-pathnames #p"app/asdf/" cur-dir) "cache" :IMPLEMENTATION)))
goes through cl - async , but we do need to ... |
027048eb9b957cb3e14b36c22a864468ba27aa99f7d4d18c413798f3b5c11138 | siilisolutions/hedge | validation.clj | (ns boot-hedge.common.validation
(:require [clojure.spec.alpha :as spec]))
; no whitespace matcher
(spec/def ::no-ws (spec/and
string?
#(not (nil? (re-matches #"^\S*$" %)))))
; cron expression simple validation
(spec/def ::cron #(= 5 (-> (clojure.string/split % #" ") count... | null | https://raw.githubusercontent.com/siilisolutions/hedge/c856b232f3057530921a1e186371647317819f16/boot/src/boot_hedge/common/validation.clj | clojure | no whitespace matcher
cron expression simple validation
authorization for azure
the handler referenced
queue name referenced in trigger config
name of azure cosmosdb collection
type of input / output
key is the reference in inputs and outputs the handler receives
different trigger / handler types
The main ... | (ns boot-hedge.common.validation
(:require [clojure.spec.alpha :as spec]))
(spec/def ::no-ws (spec/and
string?
#(not (nil? (re-matches #"^\S*$" %)))))
(spec/def ::cron #(= 5 (-> (clojure.string/split % #" ") count)))
(spec/def ::authorization #{:anonymous :function :admin... |
cd3e1b59d64950f94714fd662cbcdb6fb1135f2448c9be70f3b0081ec359c438 | sicmutils/sicmutils | ratio_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.ratio-test
(:require [clojure.test :refer [is deftest testing]]
[clojure.test.check.generators :as gen]
#?(:cljs [cljs.reader :refer [read-string]])
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[same :re... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/f181f153f1432e9648206f903282e7cb4cdd9644/test/sicmutils/ratio_test.cljc | clojure | Rational numbers form a field! | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.ratio-test
(:require [clojure.test :refer [is deftest testing]]
[clojure.test.check.generators :as gen]
#?(:cljs [cljs.reader :refer [read-string]])
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[same :re... |
89d41e83470acd897feac5d7fd9969e8fefeca72f1d34767327fabe46c70b946 | runtimeverification/haskell-backend | Parser.hs | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
This is a parser for the Kore language . Sample usage :
@
import Kore . Parser
import Kore . . ParserUtils ( parseOnly )
import System . Environment ( getArgs )
main : : IO ( )
main = do
... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/src/Kore/Parser.hs | haskell | or --
or --
or --
or --
| Filename used for error messages
| Filename used for error messages | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
This is a parser for the Kore language . Sample usage :
@
import Kore . Parser
import Kore . . ParserUtils ( parseOnly )
import System . Environment ( getArgs )
main : : IO ( )
main = do
... |
6b4a38d0bd6464e24c2d7ad2abb550f5edc4da243244a97357a0bf9ace73200d | dada-lang/dada-model | info.rkt | #lang info
(define build-deps '("sexp-diff"))
| null | https://raw.githubusercontent.com/dada-lang/dada-model/a3e8b262654a98979a7ff8dc04460c4a43f22cf6/info.rkt | racket | #lang info
(define build-deps '("sexp-diff"))
| |
99d8f5a811745e8f2c355fa823d62f5185f9a539385c1c80463d4013af1a72df | silviucpp/tls_bench | ssl_client.erl | -module(ssl_client).
-include("tls_bench.hrl").
-export([benchmark/5]).
-ifdef(check_data_valid).
check(Data) ->
Data = <<0:(byte_size(Data))/little-signed-integer-unit:8>>,
ok.
-define(CHECK_DATA(Data), check(Data)).
-else.
-define(CHECK_DATA(Data), ok).
-endif.
benchmark(ClientMod, Port, ConcurrentConnect... | null | https://raw.githubusercontent.com/silviucpp/tls_bench/b68047e9a0bee5eef31c675c88af9e5d681799e3/src/benchmarks/ssl_client.erl | erlang | -module(ssl_client).
-include("tls_bench.hrl").
-export([benchmark/5]).
-ifdef(check_data_valid).
check(Data) ->
Data = <<0:(byte_size(Data))/little-signed-integer-unit:8>>,
ok.
-define(CHECK_DATA(Data), check(Data)).
-else.
-define(CHECK_DATA(Data), ok).
-endif.
benchmark(ClientMod, Port, ConcurrentConnect... | |
971d3bccb882a49df9d9a42d2fb70031286615bc83df70f522e58139c5e44eb9 | marick/suchwow | f_ns.clj | (ns such.f-ns (:require [such.ns :as subject])
(:use midje.sweet)
(:require [such.vars :as var]))
(facts "about `with-scratch-namespace`"
(fact "typical use"
(subject/with-scratch-namespace scratch.ns
(intern 'scratch.ns 'foo 3)
(var/root-value (ns-resolve 'scratch.ns 'foo)) => 3)
(find-ns '... | null | https://raw.githubusercontent.com/marick/suchwow/111cd4aa21ee23552742701bfe52e593b65fb0f8/test/such/f_ns.clj | clojure | deleted.
as before | (ns such.f-ns (:require [such.ns :as subject])
(:use midje.sweet)
(:require [such.vars :as var]))
(facts "about `with-scratch-namespace`"
(fact "typical use"
(subject/with-scratch-namespace scratch.ns
(intern 'scratch.ns 'foo 3)
(var/root-value (ns-resolve 'scratch.ns 'foo)) => 3)
(find-ns '... |
a0fbe7dd4ceee7bb36bfe3af0af690dacb39b04443665d43aeea8ae77c99aceb | haskell-tools/haskell-tools | FirstSingle_res.hs | module Refactor.DollarApp.FirstSingle where
import Refactor.DollarApp.Defs
x = f $ g 1 | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/experimental-refactorings/examples/Refactor/DollarApp/FirstSingle_res.hs | haskell | module Refactor.DollarApp.FirstSingle where
import Refactor.DollarApp.Defs
x = f $ g 1 | |
47d3b60f89f31ac39fda98d13392447a5415ad8a4d4fd68de09d287fa9f6678f | MichaelXavier/cron | Describe.hs | {-# LANGUAGE ViewPatterns #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE CPP #-}
--------------------------------------------------------------------
-- |
Module : System . Cron . Describe
Description : Turn a cron schedule into a human - readable string
Copyright : ( c ) 2016
License ... | null | https://raw.githubusercontent.com/MichaelXavier/cron/4e0db74b626ba10279c1761834cfa9814642e595/src/System/Cron/Describe.hs | haskell | # LANGUAGE ViewPatterns #
# LANGUAGE CPP #
------------------------------------------------------------------
|
Portability: portable
>
> main :: IO ()
> main = do
> print $ describe defaultOpts cs1
>
------------------------------------------------------------------
* Options handling
* De... | # LANGUAGE RecordWildCards #
Module : System . Cron . Describe
Description : Turn a cron schedule into a human - readable string
Copyright : ( c ) 2016
License : MIT
Maintainer : < >
> import System . Cron
> let Right cs1 = parseCronSchedule " * /2 * 3 * 4,5,6 "
> let Right cs2 ... |
b7d010db029322ddb74410da42c00bf9ac2fd79a209a83a6c526b825e7c22766 | spechub/Hets | hana.hs | |
Module : $ Id$
Description : a test driver for analysis
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : non - portable
test the programatica parser and ( HatAna ) analysi... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/Haskell/hana.hs | haskell | |
Module : $ Id$
Description : a test driver for analysis
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : non - portable
test the programatica parser and ( HatAna ) analysi... | |
972cc08cb860ff22ee72f4758f3d139206114aa05a6039598fa98c2ad5e83795 | clj-commons/vizdeps | vizdeps.clj | (ns leiningen.vizdeps
"Graphviz visualization of project dependencies."
(:require
[com.walmartlabs.vizdeps.common :as common
:refer [gen-node-id]]
[com.stuartsierra.dependency :as dep]
[leiningen.core.main :as main]
[dorothy.core :as d]
[leiningen.core.classpath :as classpath]
[leininge... | null | https://raw.githubusercontent.com/clj-commons/vizdeps/dadf0b8f69926c20df9472c4313056917bdd17b6/src/leiningen/vizdeps.clj | clojure | If the artifact is excluded, the dependency graph will
not contain the artifact.
Start with a new node for the artifact
When using managed dependencies, the version (from :dependencies) may be nil,
so subtitute the version from the resolved dependency in that case.
Has the artifact already been added?
Find the d... | (ns leiningen.vizdeps
"Graphviz visualization of project dependencies."
(:require
[com.walmartlabs.vizdeps.common :as common
:refer [gen-node-id]]
[com.stuartsierra.dependency :as dep]
[leiningen.core.main :as main]
[dorothy.core :as d]
[leiningen.core.classpath :as classpath]
[leininge... |
2cb3cae6b5cd17f46226a944580ce831284dfc67facd60a08c7a3bd74aba98d5 | clojupyter/clojupyter | shutdown.clj | (ns clojupyter.shutdown
"Implements Clojupter for shutting down: All threads monitor a special channel to which a shutdown
token is sent when Clojupyter is to terminate."
(:require [clojupyter.log :as log]
[clojupyter.util :as u]
[clojupyter.util-actions :as u!]
[clojure.core.a... | null | https://raw.githubusercontent.com/clojupyter/clojupyter/b54b30b5efa115937b7a85e708a7402bd9efa0ab/src/clojupyter/shutdown.clj | clojure | (ns clojupyter.shutdown
"Implements Clojupter for shutting down: All threads monitor a special channel to which a shutdown
token is sent when Clojupyter is to terminate."
(:require [clojupyter.log :as log]
[clojupyter.util :as u]
[clojupyter.util-actions :as u!]
[clojure.core.a... | |
f213281e21df3ac453934582bff1358441cbeed7e86acc2df65854519e773268 | spechub/Hets | LocIdReference.hs | # LANGUAGE CPP , TypeFamilies , DeriveDataTypeable #
module PGIP.GraphQL.Result.LocIdReference where
import Data.Data
newtype LocIdReference = LocIdReference { locId :: String
} deriving (Show, Typeable, Data)
| null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/PGIP/GraphQL/Result/LocIdReference.hs | haskell | # LANGUAGE CPP , TypeFamilies , DeriveDataTypeable #
module PGIP.GraphQL.Result.LocIdReference where
import Data.Data
newtype LocIdReference = LocIdReference { locId :: String
} deriving (Show, Typeable, Data)
| |
66b7328e6cff8ab12d0eb98e8e59553f685e4354c440aaf3c04c56f758af37b2 | friemen/domaintypes | core_test.clj | (ns domaintypes.core-test
(:use [domaintypes.core]
[clojure.test]))
;; Sample domain types and a record definition
(defsimpletype km-distance "Non-negative distance in KM" number? (partial <= 0))
(defsimpletype required-string "A mandatory text of any length > 0" string? #(> (count %) 0))
(defcomplextype T... | null | https://raw.githubusercontent.com/friemen/domaintypes/5f53a2fab6f06e5937b10883bea3ebf9556dec4d/core/test/domaintypes/core_test.clj | clojure | Sample domain types and a record definition
Tests | (ns domaintypes.core-test
(:use [domaintypes.core]
[clojure.test]))
(defsimpletype km-distance "Non-negative distance in KM" number? (partial <= 0))
(defsimpletype required-string "A mandatory text of any length > 0" string? #(> (count %) 0))
(defcomplextype Trip [dist {:dt km-distance}
... |
0f893e4d6d907205d80ec6d2989ca5d1edb2c9359bb499e0d513744a6b64b636 | janestreet/accessor_base | accessor_info.ml | open! Base
open! Import
let lazy_t =
[%accessor Accessor.isomorphism ~get:(fun info -> lazy info) ~construct:Info.of_lazy_t]
;;
| null | https://raw.githubusercontent.com/janestreet/accessor_base/8384c29a37e557168ae8a43b2a5a531f0ffc16e4/src/accessor_info.ml | ocaml | open! Base
open! Import
let lazy_t =
[%accessor Accessor.isomorphism ~get:(fun info -> lazy info) ~construct:Info.of_lazy_t]
;;
| |
8110e0ce186fca24d1e9b4a0aedf937fead89dce8716f863fb1e4481715a0350 | monadic-xyz/ipfs | Main.hs | # LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Monad (unless)
import qualified Crypto.Hash as C
import System.Exit (exitFailure)
import System.IO (BufferMode(..), hSetBuffering, stderr, stdout)
import qualified Codec.Serialise as CBOR
import Codec.Seriali... | null | https://raw.githubusercontent.com/monadic-xyz/ipfs/b56c0af905e371c231d52f86f2586d473941afec/multihash-serialise/test/properties/Main.hs | haskell | # LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Monad (unless)
import qualified Crypto.Hash as C
import System.Exit (exitFailure)
import System.IO (BufferMode(..), hSetBuffering, stderr, stdout)
import qualified Codec.Serialise as CBOR
import Codec.Seriali... | |
13eb6e1b7ba3b4e60eeadd61319617b4b5fe243f1b68d0a11c5f34b4112d765b | sdiehl/cooking-generics | Test.hs | module Test where
data PlatonicSolid
= Tetrahedron
| Cube
| Octahedron
| Dodecahedron
| Icosahedron
data Person = Person
{ firstName :: String
, lastName :: String
, age :: Int
, height :: Float
, phoneNumber :: String
, flavor :: String
} derivin... | null | https://raw.githubusercontent.com/sdiehl/cooking-generics/b1c2183fbbf1a1a7b27f3e807037bc2712671fa8/Test.hs | haskell | module Test where
data PlatonicSolid
= Tetrahedron
| Cube
| Octahedron
| Dodecahedron
| Icosahedron
data Person = Person
{ firstName :: String
, lastName :: String
, age :: Int
, height :: Float
, phoneNumber :: String
, flavor :: String
} derivin... | |
1d4866bbf2b5441a925411454a97ca6a6d9669af7c4fcba66b8ee9b8b58f0d0d | albertoruiz/easyVision | Types.hs | -----------------------------------------------------------------------------
|
Module : Image . Types
Copyright : ( c ) 2006 - 13
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Module : Image.Types
Copyright : (c) Alberto Ruiz 2006-13... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/base/src/Image/Types.hs | haskell | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
| ROI (upper row) (lower row) (leftmost column) (rightmost column)
| Trasformation from pixels to normalized points, with x from +1 to -1 (for a right handed 3D refer... | |
Module : Image . Types
Copyright : ( c ) 2006 - 13
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Module : Image.Types
Copyright : (c) Alberto Ruiz 2006-13
License : GPL
Maintainer : Alberto Ruiz (aruiz at um dot es)
Stabilit... |
a9d6bb1fa0e6f2220a2edfbfade942045979c45a5ed13aacc6fbf268e77fe54e | buntine/Simply-Scheme-Exercises | 8-10.scm | Write a predicate true - for - all ? that takes two arguments , a predicate proce-
; dure and a sentence. It should return #t if the predicate argument returns true for every
; word in the sentence.
;
; > (true-for-all? even? ’(2 4 6 8))
; #T
;
; > (true-for-all? even? ’(2 6 3 4))
; #F
(define (true-for-all? pred se... | null | https://raw.githubusercontent.com/buntine/Simply-Scheme-Exercises/c6cbf0bd60d6385b506b8df94c348ac5edc7f646/08-higher-order-functions/8-10.scm | scheme | dure and a sentence. It should return #t if the predicate argument returns true for every
word in the sentence.
> (true-for-all? even? ’(2 4 6 8))
#T
> (true-for-all? even? ’(2 6 3 4))
#F | Write a predicate true - for - all ? that takes two arguments , a predicate proce-
(define (true-for-all? pred sent)
(= (count sent) (count (keep pred sent))))
|
054580055fd318ddbe59cd97e58c08826ec424ac383a34648d0dd7996a043505 | tommaisey/aeon | fb-sine-n.help.scm | ;; See fb-sine-c
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/chaos/fb-sine-n.help.scm | scheme | See fb-sine-c | |
e0be25c29b4bca7bcd244267ae2a7efb6284e0d9e44d6ac8bb7da2be3895db2f | RBornat/jape | reason.mli |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | null | https://raw.githubusercontent.com/RBornat/jape/afe9f207e89e965636b43ef8fad38fd1f69737ae/distrib/camlengine/reason.mli | ocaml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | |
e1dae99ea7c990c8c615b0b3c90c47d13dfbf147d5bf1f746b5aaa492f6b5970 | Tatsuki-I/Vihs | HiddenChar.hs | -- copied from
# LANGUAGE ForeignFunctionInterface , CPP #
module HiddenChar.HiddenChar
(getHiddenChar
)where
import Data.Char
import Foreign.C.Types
import System.IO
getHiddenChar :: IO Char
#if defined(__GLASGOW_HASKELL__) && ( defined(VERSION_Win32) || defined(VERSION_Win64) )
getHiddenChar = fmap (chr.fromEnu... | null | https://raw.githubusercontent.com/Tatsuki-I/Vihs/18543d0e2d2970d28a72674d5c502384bb41d98d/src/HiddenChar/HiddenChar.hs | haskell | copied from
copied from -read-input-character-from-console-immediately-not-after-newline |
# LANGUAGE ForeignFunctionInterface , CPP #
module HiddenChar.HiddenChar
(getHiddenChar
)where
import Data.Char
import Foreign.C.Types
import System.IO
getHiddenChar :: IO Char
#if defined(__GLASGOW_HASKELL__) && ( defined(VERSION_Win32) || defined(VERSION_Win64) )
getHiddenChar = fmap (chr.fromEnum) c_getch
forei... |
414923d4ea4912ed3817c4cd3934896de7d220cf3cbe43ac976f1dab40213bb7 | JoeKennedy/fantasy | Admin.hs | module Handler.Admin where
import Import
import Handler.Admin.Record
import qualified Data.List as L (init, last)
import qualified Database.Persist.Sql as S (fromSqlKey)
import Text.Blaze (toMarkup, Markup)
import Text.Hamlet (hamletFile)
import T... | null | https://raw.githubusercontent.com/JoeKennedy/fantasy/eb9dc9bf6074be5c5ca951e323c6497676424dda/Handler/Admin.hs | haskell | ----------
Fields --
----------
-----------
Layouts --
-----------
-----------------
Common Routes --
-----------------
need to use a Key type here...
TODO - Somehow account for all associations? Maybe it won't be as simple as this
this method afterwards. Maybe pass a list of associations deleted to add to
the m... | module Handler.Admin where
import Import
import Handler.Admin.Record
import qualified Data.List as L (init, last)
import qualified Database.Persist.Sql as S (fromSqlKey)
import Text.Blaze (toMarkup, Markup)
import Text.Hamlet (hamletFile)
import T... |
c20a5f187e642378604639850b0c2446aa0223bd727d77429c6b5ffa839350f2 | zotonic/zotonic | filter_rand.erl | @author < >
2010
%% @doc 'rand' filter, return a random number
Copyright 2010
%%
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 a... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_base/src/filters/filter_rand.erl | erlang | @doc 'rand' filter, return a random number
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 Lice... | @author < >
2010
Copyright 2010
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(filter_rand).
-export([rand/1, rand/2]).
rand(_Context) ->
z_ids:number().
rand(Max, Context) when is_binary(Max) ->
... |
8c7e05528afb19e06c11619459da5fad8206b30f752bf048d7cd2570e92069bf | jlouis/combinatorrent | TestInstance.hs | -- Define a set of test instances of common types
Portions of this code is taken from " Real World Haskell "
module TestInstance
()
where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import Test.QuickCheck
# LANGUAGE CPP #
#if MIN_VERSION_random(1,0,1)
-- random>=1.0.1 is... | null | https://raw.githubusercontent.com/jlouis/combinatorrent/a8660bc29507f3774d79bd364b8b509cf5146282/src/TestInstance.hs | haskell | Define a set of test instances of common types
random>=1.0.1 is exporting these instances, so don't need to redefine it | Portions of this code is taken from " Real World Haskell "
module TestInstance
()
where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import Test.QuickCheck
# LANGUAGE CPP #
#if MIN_VERSION_random(1,0,1)
#else
import Data.Word
import System.Random
integralRandomR :: (In... |
7df3278c1a00bc73fbac7bda5a7fffae60f3ba92b09ef1e4c213170a5c550b95 | input-output-hk/plutus-apps | TokenAccount.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DerivingVia #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeAp... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/79a5ff180a5c52da743ef8a21612c2f9ba2f7f6e/plutus-use-cases/src/Plutus/Contracts/TokenAccount.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DerivingVia #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
Whoever owns the token can spend the outputs locked by the contract.
* Contract functionality
* En... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
| implementation of an account that can be unlocked with a token .
( A suitable token can be created with the ' . Contracts . Currency '
contract , ... |
548d400b11b4b3ff3a6bcbc5dd78dafa8237facba488b2bcd6a2229806c1489b | openbadgefactory/salava | async.clj | (ns salava.metabadge.async
(:require [clojure.tools.logging :as log]
[clojure.string :as string]
[clojure.pprint :refer [pprint]]
[salava.metabadge.metabadge :as m]))
(defn subscribe [ctx]
{:new-pending-badge (fn [data] (m/pending-metabadge? ctx data (:id data)))})
| null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/clj/salava/metabadge/async.clj | clojure | (ns salava.metabadge.async
(:require [clojure.tools.logging :as log]
[clojure.string :as string]
[clojure.pprint :refer [pprint]]
[salava.metabadge.metabadge :as m]))
(defn subscribe [ctx]
{:new-pending-badge (fn [data] (m/pending-metabadge? ctx data (:id data)))})
| |
3b770f3e3b964d061ef35ef6e4caeb29f0ac0fb9e0aed74f0adda8a66815d6c2 | BumblebeeBat/PinkFairy | pink_fairy_sup.erl | -module(pink_fairy_sup).
-behaviour(supervisor).
, start_http/0 ] ) .
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link(Amount) -> supervisor:start_link({local, ?MODULE}, ?MODULE, [Amount]).
-define(keys , [ keys , accounts , channels , block_dump , block_pointers , block_finalit... | null | https://raw.githubusercontent.com/BumblebeeBat/PinkFairy/33d595d735d6b1119732984e894ed6aea2b6cb6a/src/pink_fairy_sup.erl | erlang | exit(keys, kill). | -module(pink_fairy_sup).
-behaviour(supervisor).
, start_http/0 ] ) .
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link(Amount) -> supervisor:start_link({local, ?MODULE}, ?MODULE, [Amount]).
-define(keys , [ keys , accounts , channels , block_dump , block_pointers , block_finalit... |
f8e0406e08de5d6f434546987282faa7ff9760b1d6df9f9467a9ebebdd845ba6 | johnlawrenceaspden/hobby-code | monads8.clj | ;;Monads are generalizations of let. They are to do with binding names to values.
;;Consider
(let [a 2
b (inc a)]
(* a b))
;;Which might also be written:
((fn [a]
((fn [b]
(* a b))
(inc a)))
2)
We have a problem reading the second definition , which we can tidy up using
(defn bind [value fu... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/monads8.clj | clojure | Monads are generalizations of let. They are to do with binding names to values.
Consider
Which might also be written:
So now we can write
This is more readable, since the values are now near their names.
So now our monad is as easy to use as let.
What sort of problems can we use a generalization of let on?
fine
so th... |
(let [a 2
b (inc a)]
(* a b))
((fn [a]
((fn [b]
(* a b))
(inc a)))
2)
We have a problem reading the second definition , which we can tidy up using
(defn bind [value function]
(function value))
(bind 2 (fn [a]
(bind (inc a) (fn [b]
(* a b)))))
(defmacro do-monad [b... |
07d06893b3d438e2db43b8638cb2cc3e39d78fd3ea2cd992a5fbbf56140aac1f | EduardoRFS/esy-mirage-kernel | Unikernel.ml | open Lwt.Infix
module Hello(Time:Mirage_time.S) =
struct
let start _time =
let rec loop =
function
| 0 -> Lwt.return_unit
| n ->
(Logs.info (fun f -> f "hello");
(Time.sleep_ns (Duration.of_sec 1)) >>=
((fun () -> loop (n - 1)))) in
loo... | null | https://raw.githubusercontent.com/EduardoRFS/esy-mirage-kernel/c37d9d9427122f267060a978de22a17437608e4f/Unikernel.ml | ocaml | open Lwt.Infix
module Hello(Time:Mirage_time.S) =
struct
let start _time =
let rec loop =
function
| 0 -> Lwt.return_unit
| n ->
(Logs.info (fun f -> f "hello");
(Time.sleep_ns (Duration.of_sec 1)) >>=
((fun () -> loop (n - 1)))) in
loo... | |
e3764d7ecccda87f24e57ba5436aa06f8bec55b0239ae8b7eb599b564b4832a0 | jeapostrophe/racket-cheat | racket-cheat.rkt | #lang racket/base
(require racket/list
racket/match
racket/runtime-path
scribble/core
scribble/base
scribble/html-properties)
(struct *section (which label groups))
(struct *group (label rows))
(struct *row (label content))
(define how-many-sections (box 0))
(define rsecti... | null | https://raw.githubusercontent.com/jeapostrophe/racket-cheat/6e79a13b9e24969a87c8a1c191d38ee4f4c55cf9/racket-cheat.rkt | racket | #lang racket/base
(require racket/list
racket/match
racket/runtime-path
scribble/core
scribble/base
scribble/html-properties)
(struct *section (which label groups))
(struct *group (label rows))
(struct *row (label content))
(define how-many-sections (box 0))
(define rsecti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.