_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 |
|---|---|---|---|---|---|---|---|---|
ca3bbe5e4a461285a434b3c03c10d3fb91d38743ef03f9bf40eeafce3cf68c32 | pokepay/cl-fluent-logger | broadcast.lisp | (defpackage #:cl-fluent-logger/logger/broadcast
(:use #:cl
#:cl-fluent-logger/logger/base)
(:export #:broadcast-logger
#:make-broadcast-logger))
(in-package #:cl-fluent-logger/logger/broadcast)
(defclass broadcast-logger (base-logger)
((children :initarg :children
:initform nil
... | null | https://raw.githubusercontent.com/pokepay/cl-fluent-logger/688e4fbf8762b9fa7c4d2f72fb524a9f1c3236ac/logger/broadcast.lisp | lisp | (defpackage #:cl-fluent-logger/logger/broadcast
(:use #:cl
#:cl-fluent-logger/logger/base)
(:export #:broadcast-logger
#:make-broadcast-logger))
(in-package #:cl-fluent-logger/logger/broadcast)
(defclass broadcast-logger (base-logger)
((children :initarg :children
:initform nil
... | |
bd0c723c9030649699a417613f192888dc623fc7d63cf2adfcbbd81482620f52 | play-co/hermes | gremlin.clj | (ns hermes.gremlin
(:import (com.tinkerpop.gremlin.java GremlinPipeline)))
(defn gremlin-eval [ob]
(if (instance? GremlinPipeline ob)
(seq (.toList ob))
ob))
(defmacro query [vertex & body]
`(gremlin-eval (.. (GremlinPipeline. ~vertex)
~@body)))
| null | https://raw.githubusercontent.com/play-co/hermes/9d203ec7b239e7800c89e6ee161486f35dabd110/src/hermes/gremlin.clj | clojure | (ns hermes.gremlin
(:import (com.tinkerpop.gremlin.java GremlinPipeline)))
(defn gremlin-eval [ob]
(if (instance? GremlinPipeline ob)
(seq (.toList ob))
ob))
(defmacro query [vertex & body]
`(gremlin-eval (.. (GremlinPipeline. ~vertex)
~@body)))
| |
2c64c4ab44a959f7a896b3ad89275fe09ba3c588336042c78e2e04c37aaa0466 | shentufoundation/deepsea | StmtExpressionless.ml | open AST
open Cop
open Ctypes
open Datatypes
open Globalenvs
open Integers
open LowValues
open MachineModel
type function_kind =
| Coq_normalFunction
| Coq_constructorFunction
type ret_type =
| Tvoid_method
| Tconstructor
| Tfun
| Tsome_method
type statement =
| Spush of (coq_val, label) sum
| Sdup of nat
| Ssload
|... | null | https://raw.githubusercontent.com/shentufoundation/deepsea/970576a97c8992655ed2f173f576502d73b827e1/src/backend/extraction/StmtExpressionless.ml | ocaml | singleton inductive, whose constructor was mkfunction
* val fn_code : coq_function -> code * | open AST
open Cop
open Ctypes
open Datatypes
open Globalenvs
open Integers
open LowValues
open MachineModel
type function_kind =
| Coq_normalFunction
| Coq_constructorFunction
type ret_type =
| Tvoid_method
| Tconstructor
| Tfun
| Tsome_method
type statement =
| Spush of (coq_val, label) sum
| Sdup of nat
| Ssload
|... |
c52c76e22b86143388027aaad33d314d23fabf9a2d3186520f978181b16691b7 | onyx-platform/onyx | ready_encoder.clj | (ns ^{:no-doc true} onyx.messaging.serializers.ready-encoder
(:require [onyx.messaging.serializers.helpers :refer [type->byte]])
(:import [org.agrona.concurrent UnsafeBuffer]))
(defprotocol PEncoder
(set-src-peer-id [this peer-id])
(offset [this])
(length [this])
(wrap-impl [this buf offset]))
(deftype En... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/messaging/serializers/ready_encoder.clj | clojure | (ns ^{:no-doc true} onyx.messaging.serializers.ready-encoder
(:require [onyx.messaging.serializers.helpers :refer [type->byte]])
(:import [org.agrona.concurrent UnsafeBuffer]))
(defprotocol PEncoder
(set-src-peer-id [this peer-id])
(offset [this])
(length [this])
(wrap-impl [this buf offset]))
(deftype En... | |
4a202cd0a7e53c58d411c911826d140ea0536d6b35324a925b2decfd1b86d5df | earl-ducaine/cl-garnet | accelerators.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : INTERACTORS ; Base : 10 -*-
;;*******************************************************************;;
The Garnet User Interface Development Environment . ; ;
;;*******************************************************************;;
;; This code was w... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/inter/accelerators.lisp | lisp | Syntax : Common - Lisp ; Package : INTERACTORS ; Base : 10 -*-
*******************************************************************;;
;
*******************************************************************;;
This code was written as part of the Garnet project at ;;
;
domain. ... |
This file contains the mouse and keyboard ACCELERATORS code
Designed and implemented by
: SHIFT - F1 - raise window
: SHIFT - F4 - zoom window
: SHIFT - F7 - destroy window
In interactors.lisp , the function " process - event " first checks the " first "
[ Note : these functions... |
5ed402aca29be65f83d5c4d70abefac1ebf6d44fe6945c6ee7c8ca25163524c2 | zcaudate-me/lein-repack | data.clj | (ns repack.util.data
(:use repack.util.array
clojure.core)) | null | https://raw.githubusercontent.com/zcaudate-me/lein-repack/1eb542d66a77f55c4b5625783027c31fd2dddfe5/example/repack.advance/src/clj/repack/util/data.clj | clojure | (ns repack.util.data
(:use repack.util.array
clojure.core)) | |
642a5a2cb34c0f265a6eb31d6c1bf5d4ef8b73beb9fb19b64e9a7da2d95347ed | mrmcc3/tailwind-clj | config.clj | (ns tailwind.config
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[meta-merge.core :as mm]))
(defn negate [m]
(reduce-kv #(assoc %1 (str "-" %2) (str "-" %3)) {} m))
(defn final [v f & args]
(if (:final (meta v)) v (apply f v args)))
(defn border-color-default [cfg]
(let [default (get-... | null | https://raw.githubusercontent.com/mrmcc3/tailwind-clj/4c5e25c2502bcc49a065e06f6919241686d11eab/src/tailwind/config.clj | clojure | (ns tailwind.config
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[meta-merge.core :as mm]))
(defn negate [m]
(reduce-kv #(assoc %1 (str "-" %2) (str "-" %3)) {} m))
(defn final [v f & args]
(if (:final (meta v)) v (apply f v args)))
(defn border-color-default [cfg]
(let [default (get-... | |
2096cc76a80de54bdb63ddea383a96b0cad8879a9efd7faa9553057d03d39146 | ulrikstrid/ocaml-oidc | Jwks.ml | open Helpers
let () = Mirage_crypto_rng_unix.initialize ()
let rsa = Mirage_crypto_pk.Rsa.generate ~bits:1024 ()
let jwk = Jose.Jwk.make_priv_rsa rsa
let jwks : Jose.Jwks.t =
{ keys = [Jose.Jwk.make_pub_rsa (rsa |> Mirage_crypto_pk.Rsa.pub_of_priv)] }
let header = Jose.Header.make_header jwk
let jwt_with_kid =
... | null | https://raw.githubusercontent.com/ulrikstrid/ocaml-oidc/281e7578c08f73c1c555b06b405ca31d16e041ca/test/Jwks.ml | ocaml | open Helpers
let () = Mirage_crypto_rng_unix.initialize ()
let rsa = Mirage_crypto_pk.Rsa.generate ~bits:1024 ()
let jwk = Jose.Jwk.make_priv_rsa rsa
let jwks : Jose.Jwks.t =
{ keys = [Jose.Jwk.make_pub_rsa (rsa |> Mirage_crypto_pk.Rsa.pub_of_priv)] }
let header = Jose.Header.make_header jwk
let jwt_with_kid =
... | |
1ca3cf8318bdd02aa29a243dd0fa6495845a59f0e4a7bcbed5e6fd4b37f91182 | re-xyr/avail | Internal.hs | | This module defines the ' M ' wrapper monad and the ' Eff ' phantom constraint . All safe functionalities in this
-- module are reexported in the "Avail" module, so you wouldn't need to import this module most of the times.
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE CPP #
# OPTIONS_HADDOCK not - h... | null | https://raw.githubusercontent.com/re-xyr/avail/1ecb0518f5e05a409213f6f1901423bd7b45786c/src/Avail/Internal.hs | haskell | module are reexported in the "Avail" module, so you wouldn't need to import this module most of the times.
In particular, 'M' is expected to be used on a __concrete__ monad instead of a /polymorphic/ one. This is
particularly good in terms of program performance, and generally means instead of writing this:
@
@
... | | This module defines the ' M ' wrapper monad and the ' Eff ' phantom constraint . All safe functionalities in this
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE CPP #
# OPTIONS_HADDOCK not - home #
module Avail.Internal where
import Control.Monad.Fix (MonadFix)
import Control.Mon... |
dbdd33869cdf887b9d300362d86cfc29953d344a81494f0f7fcad0f4eae7b6a8 | vikram/lisplibraries | address.lisp | ;;;; -*- lisp -*-
(in-package :it.bese.ucw-user)
(defentry-point "address.ucw" (:application *example-application*) ()
(call 'show-address :address (call 'get-address)))
(defclass address ()
((name :accessor name :initarg :name :initform "")
(email :accessor email :initarg :email :initform "")))
(defcomponen... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/ucw_dev/examples/address.lisp | lisp | -*- lisp -*- |
(in-package :it.bese.ucw-user)
(defentry-point "address.ucw" (:application *example-application*) ()
(call 'show-address :address (call 'get-address)))
(defclass address ()
((name :accessor name :initarg :name :initform "")
(email :accessor email :initarg :email :initform "")))
(defcomponent address-manipula... |
85b9a41ee5e67f224aa5c72be3e43e44987589b3905b03284769cd89a13d9a3f | REMath/mit_16.399 | cbexp.mli | (* cbexp.mli *)
open Abstract_Syntax
open Cvalues
open Cenv
(* evaluation of boolean operations *)
val c_bexp : bexp -> Cenv.t -> Cenv.t
| null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Collecting-Interpreter/cbexp.mli | ocaml | cbexp.mli
evaluation of boolean operations | open Abstract_Syntax
open Cvalues
open Cenv
val c_bexp : bexp -> Cenv.t -> Cenv.t
|
9e3dcd600ce71ec50284e7075e068e53c594e13372db6b68ebabd327b8c5940f | yetibot/core | yeti.clj | (ns yetibot.core.commands.yeti
(:require
[yetibot.core.hooks :refer [cmd-hook]]))
(defn self-cmd
"yeti # show known info about Yetibot"
[_]
"TODO")
(cmd-hook #"yeti"
#"self" self-cmd)
| null | https://raw.githubusercontent.com/yetibot/core/e35cc772622e91aec3ad7f411a99fff09acbd3f9/src/yetibot/core/commands/yeti.clj | clojure | (ns yetibot.core.commands.yeti
(:require
[yetibot.core.hooks :refer [cmd-hook]]))
(defn self-cmd
"yeti # show known info about Yetibot"
[_]
"TODO")
(cmd-hook #"yeti"
#"self" self-cmd)
| |
2a10ddfac6223fd8e89c01005bdb359a85c8dbf16232c5bd0bdb71ac41529228 | discoproject/odisco | protocol.mli | (** The Disco worker protocol. *)
(** Messages from Disco to worker. *)
type taskinfo = {
(* info from protocol *)
task_jobname : string;
task_jobfile : string;
task_stage : Pipeline.stage;
task_grouping : Pipeline.grouping;
task_group_label : Pipeline.label;
task_group_node : string option;
task_id ... | null | https://raw.githubusercontent.com/discoproject/odisco/1dda9b921625a7c6af442a33938279afdc2a8600/lib/protocol.mli | ocaml | * The Disco worker protocol.
* Messages from Disco to worker.
info from protocol
runtime state
* Messages from worker to Disco.
version
pid
size
* parse an index payload |
type taskinfo = {
task_jobname : string;
task_jobfile : string;
task_stage : Pipeline.stage;
task_grouping : Pipeline.grouping;
task_group_label : Pipeline.label;
task_group_node : string option;
task_id : int;
task_host : string;
task_master : string;
task_disco_port : int;
task_put_port : i... |
d97be94568f07b9a7af48c24a3d6139844afabe4bf02fcaed9b2f57aab544935 | well-typed-lightbulbs/ocaml-esp32 | escape_error.ml | (* TEST
* toplevel
*)
Nothing to see here , parse.ml dictates that these be printed as regular
" Syntax error " .
"Syntax error". *)
try foo () with ;;
(3 : );;
(3 :> );;
| null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/parse-errors/escape_error.ml | ocaml | TEST
* toplevel
|
Nothing to see here , parse.ml dictates that these be printed as regular
" Syntax error " .
"Syntax error". *)
try foo () with ;;
(3 : );;
(3 :> );;
|
94c440c7886d98aca74a51822a600476973ee959a1f58afdc4b6eef042600c41 | BillHallahan/G2 | Helpers.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
module G2.Liquid.Helpers ( MeasureSymbols (..)
, getGHCInfos
, funcSpecs
, getTySigs
, putTySigs
, getAssumedSigs
... | null | https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/src/G2/Liquid/Helpers.hs | haskell | # LANGUAGE BangPatterns #
| Interface with LH
The walk function takes lhDict arguments that are not correctly accounted for by mkStrict.
The arguments are not actually used, so, here, we fill them in with undefined. | # LANGUAGE CPP #
module G2.Liquid.Helpers ( MeasureSymbols (..)
, getGHCInfos
, funcSpecs
, getTySigs
, putTySigs
, getAssumedSigs
, putAssumed... |
c072e739e2e4c78401082d5f645eac8969d6ce8b93bc45f082b0c936c25de215 | bagucode/clj-native | test_lib.clj | (ns clj-native.test.test-lib
(:use [clj-native.direct :only [defclib loadlib typeof]]
[clj-native.structs :only [byref byval]]
[clj-native.callbacks :only [callback]]
[clojure.test]))
;; added test cases to help resolve an issue that was plaguing the Overtone project.
;; See discussion here: ... | null | https://raw.githubusercontent.com/bagucode/clj-native/31f3862c00cb5160360195c5c679553bcaf99e13/test/clj_native/test/test_lib.clj | clojure | added test cases to help resolve an issue that was plaguing the Overtone project.
See discussion here: =#!topic/overtone/wrlzi3dNhr0
Feel free to add new functions/tests as issues pop up.
This is trying to be a close match for
overtone/src/overtone/sc/machinery/server/native.clj:scsynth-get-buffer-data
which has ... | (ns clj-native.test.test-lib
(:use [clj-native.direct :only [defclib loadlib typeof]]
[clj-native.structs :only [byref byval]]
[clj-native.callbacks :only [callback]]
[clojure.test]))
(defclib test_lib
(:libname "test_lib")
(:structs
(n-buf
:n int
:buf void*)
(point
:x ... |
2f89c16269cf41089fec90da5111f95028828e03aee34f9201ebb3ef2f7efaf1 | g000001/MacLISP-compat | MLSUB.lisp | MLSUB -*-Mode : Lisp;Package : SI;Lowercase : T-*-
;;; *************************************************************************
* * * * * * * * * * * * MACLISP - ONLY SUBR 's used by * * * * * * * * * * * * * * * *
;;; *************************************************************************
* * (... | null | https://raw.githubusercontent.com/g000001/MacLISP-compat/a147d09b98dca4d7c089424c3cbaf832d2fd857a/MLSUB.lisp | lisp | Package : SI;Lowercase : T-*-
*************************************************************************
*************************************************************************
*************************************************************************
macros. Also has some "helper" functions needed by macro out... | * * * * * * * * * * * * MACLISP - ONLY SUBR 's used by * * * * * * * * * * * * * * * *
* * ( c ) Copyright 1981 Massachusetts Institute of Technology * * * * * * * * * * * * *
(herald MLSUB /17)
Contains the open - codings , as SUBRs , of some common
(include ((lisp) subload lsp))
(eval-when (compile)
(l... |
88ffeefaac04459299eedbcb279bad6199fe4495bf5d5e611e41aa96854c3368 | ocaml/opam | opamTypesBase.ml | (**************************************************************************)
(* *)
Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam/c53b1a83d73d05e0abd361f9bc8361dcd121b6e8/src/format/opamTypesBase.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
open OpamParserTypes.FullPos
open OpamTypes
include OpamCompat
let std_path_of_string = func... |
c79b6eb30bff2926825253123b5b1225b985b13ee599cedad68dfcce7c31310a | audreyt/interpolatedstring-perl6 | TestRewrite.hs | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Main where
import Text.InterpolatedString.Perl6
import Test.HUnit
import Data.ByteString.Char8 as BS(ByteString, pack)
import Data.Text as T(Text, pack)
-- the primary purpose of these tests is to ensure that
-- the Text and ByteString rewrite rules are firing, to a... | null | https://raw.githubusercontent.com/audreyt/interpolatedstring-perl6/81841be3828a5ed5bbe0c9aa4e3335e12befdd01/tests/TestRewrite.hs | haskell | the primary purpose of these tests is to ensure that
the Text and ByteString rewrite rules are firing, to avoid
needlessly converting string types | # LANGUAGE OverloadedStrings , QuasiQuotes #
module Main where
import Text.InterpolatedString.Perl6
import Test.HUnit
import Data.ByteString.Char8 as BS(ByteString, pack)
import Data.Text as T(Text, pack)
testByteString = assertBool "" $ [$qc|{"a" :: ByteString} {"b" :: ByteString}|]
== BS.pack ("a b... |
4601f1b44aeae24346a0f5856cb5e2c3f2823c0379dcc14d0616a3c4bea6e0fe | ThoughtWorksInc/DeepDarkFantasy | TestPoly.hs | module Main where
import DDF.Sam.Poly hiding (main)
import Control.Monad
import System.Exit (exitFailure)
main :: IO ()
main = do
x <- solve (const $ return ()) (const . const $ return ())
unless (x - 4 < 0.1) exitFailure
return ()
| null | https://raw.githubusercontent.com/ThoughtWorksInc/DeepDarkFantasy/4c569aefc03a2bcfb6113b65367201d30077f2b6/test/TestPoly.hs | haskell | module Main where
import DDF.Sam.Poly hiding (main)
import Control.Monad
import System.Exit (exitFailure)
main :: IO ()
main = do
x <- solve (const $ return ()) (const . const $ return ())
unless (x - 4 < 0.1) exitFailure
return ()
| |
0c99eee63010e371e88943d63d24f91ccf941be8acc9053754c6afd0dbbe6bbd | ocaml/merlin | a.ml | module T = struct
type t = X of int
end
module Y = struct
let y = T.X 1
end
let z = Y.y
let z2 = B.x
| null | https://raw.githubusercontent.com/ocaml/merlin/8f9dba1cc8885700145d6d1c33141ec0dc8544f5/tests/test-dirs/locate-type.t/a.ml | ocaml | module T = struct
type t = X of int
end
module Y = struct
let y = T.X 1
end
let z = Y.y
let z2 = B.x
| |
7172caa789ff59bfc82781199da5d51cc8b885b0d86ed48c7e05d086560f5e55 | returntocorp/semgrep | Rule_fetching.mli | (* input *)
type rules_source =
-e/-l/--replacement . In theory we could even parse the string to get
* a
* a XPattern.t *)
| Pattern of string * Xlang.t * string option (* replacement *)
(* --config. In theory we could even parse the string to get
* some Semgrep_dashdash_config.config_kind list *)
... | null | https://raw.githubusercontent.com/returntocorp/semgrep/855abad9ada6ea5fd72d437fd69ff2e5fa42c1f1/src/osemgrep/cli_scan/Rule_fetching.mli | ocaml | input
replacement
--config. In theory we could even parse the string to get
* some Semgrep_dashdash_config.config_kind list
output
None for remote files
[rules_from_rules_source] returns rules from --config or -e
* TODO: does it rewrite the rule_id?
internals
low-level API | type rules_source =
-e/-l/--replacement . In theory we could even parse the string to get
* a
* a XPattern.t *)
| Configs of Semgrep_dashdash_config.config_str list
TODO ? | ProjectUrl of Uri.t ? or just use for it ?
[@@deriving show]
type rules_and_origin = {
origin : origin;
rules : Rule.rules;
... |
cc933d7a8166b46b4806cb49128a8254d8ad56a67b4339eda217aa6b0cab4153 | rm-hull/project-euler | euler028.clj | EULER # 028
;; ==========
Starting with the number 1 and moving to the right in a clockwise
direction a 5 by 5 spiral is formed as follows :
;;
;; 21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
;; 17 16 15 14 13
;;
It can be verified that the sum of the numbers on the diago... | null | https://raw.githubusercontent.com/rm-hull/project-euler/04e689e87a1844cfd83229bb4628051e3ac6a325/src/euler028.clj | clojure | ==========
21 22 23 24 25
17 16 15 14 13
formed in the same way?)
| EULER # 028
Starting with the number 1 and moving to the right in a clockwise
direction a 5 by 5 spiral is formed as follows :
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
It can be verified that the sum of the numbers on the diagonals is 101 .
What is the sum of the numbers on the diagon... |
f2a88005f21871f4dec1ffe06f0340c13504b5d15da356efba4ab1a130f48da1 | mindreframer/clojure-stuff | 04_sets.clj | (ns koans.04-sets
(:require [koan-engine.core :refer :all]))
(meditations
"You can create a set by converting another collection"
(= #{3} (set __))
"Counting them is like counting other collections"
(= __ (count #{1 2 3}))
"Remember that a set is a *mathematical* set"
(= __ (set '(1 1 2 2 3 3 4 4 5 5))... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/functional-koans/clojure-koans/src/koans/04_sets.clj | clojure | (ns koans.04-sets
(:require [koan-engine.core :refer :all]))
(meditations
"You can create a set by converting another collection"
(= #{3} (set __))
"Counting them is like counting other collections"
(= __ (count #{1 2 3}))
"Remember that a set is a *mathematical* set"
(= __ (set '(1 1 2 2 3 3 4 4 5 5))... | |
80cdb66ee31edc58336cd7f08c097406188ac345e0254ac44137791e1173db98 | david-vanderson/warp | combined.rkt | #lang racket/base
(require racket/gui)
(require "defs.rkt"
"client.rkt"
"server.rkt")
(define b (box #f))
(thread (lambda ()
(start-server)))
(start-client PORT)
(yield 'wait)
| null | https://raw.githubusercontent.com/david-vanderson/warp/cdc1d0bd942780fb5360dc6a34a2a06cf9518408/combined.rkt | racket | #lang racket/base
(require racket/gui)
(require "defs.rkt"
"client.rkt"
"server.rkt")
(define b (box #f))
(thread (lambda ()
(start-server)))
(start-client PORT)
(yield 'wait)
| |
992854176757e7c82c0644f26b5c6fcd4f185e9dabda1bd82c0e722ff66e661e | oreillymedia/etudes-for-erlang | dates.erl | %% @author J D Eisenberg <>
%% @doc Functions for splitting a date into a list of
year - month - day and finding date .
2013 J D Eisenberg
%% @version 0.1
-module(dates).
-export([date_parts/1, julian/1, is_leap_year/1]).
@doc Takes a string in ISO date format ( yyyy - mm - dd ) and
%% returns a list of integ... | null | https://raw.githubusercontent.com/oreillymedia/etudes-for-erlang/07200372503a8819f9fcc2856f8cb82451be7b48/code/ch06-03/dates.erl | erlang | @author J D Eisenberg <>
@doc Functions for splitting a date into a list of
@version 0.1
returns a list of integers in form [year, month, day].
@doc Helper function that recursively accumulates the number of days
up to the specified date. | year - month - day and finding date .
2013 J D Eisenberg
-module(dates).
-export([date_parts/1, julian/1, is_leap_year/1]).
@doc Takes a string in ISO date format ( yyyy - mm - dd ) and
-spec(date_parts(string()) -> list(integer())).
date_parts(DateStr) ->
[YStr, MStr, DStr] = re:split(DateStr, "-", [{ret... |
25d4c4060d26d6a86b1ace82b8ddfb129d55ad55cecb8ae3c62a0c00fb7905d6 | lspitzner/brittany | Test214.hs | {-# language TypeFamilies #-}
module M where
data family F a
data instance F Int = D Int
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test214.hs | haskell | # language TypeFamilies # | module M where
data family F a
data instance F Int = D Int
|
b7b31f783b8d393f36d5eb9842583304258171d3420f39a7c3d344130cd98d87 | fogfish/hash | hash_pbkdf2.erl | %%
Copyright 2012 , All Rights Reserved
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing... | null | https://raw.githubusercontent.com/fogfish/hash/a1b9101189e115b4eabbe941639f3c626614e986/src/hash_pbkdf2.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language g... | Copyright 2012 , All Rights Reserved
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(hash_pbkdf2).
-export([pbkdf2/5]).
-compile({no_auto_import,[ceil/1]}).
pbkdf2(PRF, Pass, Salt, C, DkLen) ->
Init = c... |
ada0c2c7521bf3d7dc877b19029d02835766ea1bddf74487478bc91d76146033 | igorhvr/bedlam | quartz.scm | Code by - this is licensed under GNU GPL v2 .
(require-extension (lib iasylum/jcode))
(module iasylum/quartz
(; high level:
schedule-job-easier
; lower level:
create-scheduler
create-quartz-job-from-closure
create-quartz-cron-trigger
schedule-job)
(include "quartz/quartz-code.scm"))
| null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/quartz.scm | scheme | high level:
lower level: | Code by - this is licensed under GNU GPL v2 .
(require-extension (lib iasylum/jcode))
(module iasylum/quartz
schedule-job-easier
create-scheduler
create-quartz-job-from-closure
create-quartz-cron-trigger
schedule-job)
(include "quartz/quartz-code.scm"))
|
8c970886b44e0aefaac33751bb0c4a7af05ac46f4f7915693d1cb5fb9efcb707 | tcsprojects/ocaml-sat-solvers | zchaffwrapper.mli | open Satwrapper;;
open Zchaff;;
class zchaffSolverFactory: object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_instance: abstractSolver
end
| null | https://raw.githubusercontent.com/tcsprojects/ocaml-sat-solvers/2c36605fb3e38a1bee41e079031ab5b173794910/deprecated/zchaff/zchaffwrapper.mli | ocaml | open Satwrapper;;
open Zchaff;;
class zchaffSolverFactory: object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_instance: abstractSolver
end
| |
fa945f416960363ad07cdf4edb57428ca77dc2313de176305e5eab804e385fdd | containium/containium | project.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defproject containium.systems/core "0.1.0"
:description "Containium System Protocol and utility functions"
:url ""
:scm {:dir "../../"}
... | null | https://raw.githubusercontent.com/containium/containium/dede4098de928bed9ce8fccfc0a3891655ee162e/systems/core/project.clj | clojure | Set to true to prevent packaging with local changes. | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defproject containium.systems/core "0.1.0"
:description "Containium System Protocol and utility functions"
:url ""
:scm {:dir "../../"}
... |
54fe4e06779c2b83911a0301e656d700b800e7ffa25931272ce089e54d889e41 | dongcarl/guix | pam.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 , 2015 , 2016 , 2017 , 2019 , 2020 < >
;;;
;;; 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... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/system/pam.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 , 2015 , 2016 , 2017 , 2019 , 2020 < >
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 system pam)
#:use-module (guix records)
#:use-mo... |
5032a8874bda2ef8aff3fa4746de4edb7744b4f792bfd28148bfb801d1623726 | nanocaml/nanocaml | test_main.ml | open OUnit2
let () =
[
Parsing_tests.tt;
Lang_codegen_tests.tt;
Expand_tests.tt;
Pass_typeck_tests.tt;
Pass_codegen_tests.tt;
Docs_example.tt
]
|> test_list
|> run_test_tt_main
| null | https://raw.githubusercontent.com/nanocaml/nanocaml/c856268dc8986bd9fb739c8cd6b972052997a30c/test/test_main.ml | ocaml | open OUnit2
let () =
[
Parsing_tests.tt;
Lang_codegen_tests.tt;
Expand_tests.tt;
Pass_typeck_tests.tt;
Pass_codegen_tests.tt;
Docs_example.tt
]
|> test_list
|> run_test_tt_main
| |
472b8aea0066c1ba2f3ee531eec8ae68acab8743c6d16e2b167f24f785cd5353 | antono/guix-debian | python-build-system.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 < >
Copyright © 2013 < >
Copyright © 2013 < >
;;;
;;; 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 Fre... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/guix/build/python-build-system.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 < >
Copyright © 2013 < >
Copyright © 2013 < >
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 (guix build python-build-system)
#:use-module... |
30bbbd415d1b7751a07981bf5b97775b83bb14522e4d3ef1b8b4893a094c0897 | informatimago/lisp | make.lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(defvar *modules* '(common-lisp clext clmisc sbcl clisp susv3))
(defmacro define-implementation (name &key feature executable default-options
load-option
... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/tools/make.lisp | lisp | to quit once arguments processing is done
dumps an "; Exiting" message...
"-on-error" "debug" | (eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(defvar *modules* '(common-lisp clext clmisc sbcl clisp susv3))
(defmacro define-implementation (name &key feature executable default-options
load-option
... |
2ebce672781e45eefde12b112bd3ae9ac4507fb7705f5ec1fdfddef88bed04e7 | bobzhang/fan | compile_stream.mli |
* [ stream ] DDSL compiler , original 's stream extension
open Astf
type spat_comp =
| When of Locf.t * pat * exp option
| Match of Locf.t * pat * exp
| Str of Locf.t * pat
type sexp_comp =
| Trm of Locf.t * exp
| Ntr of Locf.t * exp
type stream_pat = (spat_comp * exp option)
type stream_pats = stream_pa... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/cold/compile_stream.mli | ocaml | val cparser_match : loc -> exp -> pat option -> stream_cases -> exp |
* [ stream ] DDSL compiler , original 's stream extension
open Astf
type spat_comp =
| When of Locf.t * pat * exp option
| Match of Locf.t * pat * exp
| Str of Locf.t * pat
type sexp_comp =
| Trm of Locf.t * exp
| Ntr of Locf.t * exp
type stream_pat = (spat_comp * exp option)
type stream_pats = stream_pa... |
f63641a1d9420cfb422b9036b3c8ddf725060c670fb018fc9434b44afdabab73 | WhatsApp/erlt | struct_mod03.erl | -file("dev_struct/src/struct_mod03.erlt", 1).
-module(struct_mod03).
-eqwalizer_unchecked([{index, 1}]).
-export([expr/0,
pattern/3,
guard/3,
field/1,
update/1,
index/1]).
-spec expr() -> {struct_mod02:foo(),
struct_mod02:bar()}.
expr() ->
{{'$#stru... | null | https://raw.githubusercontent.com/WhatsApp/erlt/616a4adc628ca8754112e659701e57f1cd7fecd1/tests/dev_struct/ir-spec/struct_mod03.erl | erlang | -file("dev_struct/src/struct_mod03.erlt", 1).
-module(struct_mod03).
-eqwalizer_unchecked([{index, 1}]).
-export([expr/0,
pattern/3,
guard/3,
field/1,
update/1,
index/1]).
-spec expr() -> {struct_mod02:foo(),
struct_mod02:bar()}.
expr() ->
{{'$#stru... | |
c4bb9dc3685b84547ce42dcfe5949bb534a8b3d2ee1b3573680d105f8aa693ae | mfikes/coal-mine | problem_51.cljc | (ns coal-mine.problem-51
(:require [coal-mine.checks :refer [defcheck-51] :rename {defcheck-51 defcheck}]
[clojure.test]))
(defcheck solution-12f0614e
[1 2 3 4 5])
(defcheck solution-1d566772
[ 1 2 3 4 5])
(defcheck solution-310469e3
'( 1 2 3 4 5 ))
(defcheck solution-41b1a75
;The :as keyword... | null | https://raw.githubusercontent.com/mfikes/coal-mine/0961d085b37f4e59489a8cf6a2b8fef0a698d8fb/src/coal_mine/problem_51.cljc | clojure | The :as keyword can be used to retain access to
the entire collection that is being destructured. | (ns coal-mine.problem-51
(:require [coal-mine.checks :refer [defcheck-51] :rename {defcheck-51 defcheck}]
[clojure.test]))
(defcheck solution-12f0614e
[1 2 3 4 5])
(defcheck solution-1d566772
[ 1 2 3 4 5])
(defcheck solution-310469e3
'( 1 2 3 4 5 ))
(defcheck solution-41b1a75
[1 2 3 4 5])
(d... |
348a2ac22d1696212f7fb65d33364884dcf2017b16d64fccd6fe3943ef7938c7 | emqx/mria | mria_schema.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/mria/2cec4de3ee718ddae22dc0dc75708103f29bb768/src/mria_schema.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mria_schema).
-behaviour(gen_server).
-export([ create_table/2
, subscribe_to_... |
1b2fa1f9b54852a6fea1950bbcd422ac27d5ffac17aafcf59067b3357ece0807 | Perry961002/SICP | exa2.2.1-list.scm | (define one-through-four (list 1 2 3 4))
(car one-through-four)
(cdr one-through-four)
(cons 0 one-through-four)
(cons one-through-four 5)
;----------------------------------------
;返回表的第n个项, scheme已经定义这个过程
(define (list-ref items n)
(cond ((null? items) (display "error: list is null"))
((= n 0) (car item... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/example/exa2.2.1-list.scm | scheme | ----------------------------------------
返回表的第n个项, scheme已经定义这个过程 | (define one-through-four (list 1 2 3 4))
(car one-through-four)
(cdr one-through-four)
(cons 0 one-through-four)
(cons one-through-four 5)
(define (list-ref items n)
(cond ((null? items) (display "error: list is null"))
((= n 0) (car items))
(else (list-ref (cdr items) (- n 1)))))
返回表的长度 , sche... |
e137ffac695079cf9457d217335798968923fa605c7f464b2711e8d4df570df8 | camsaul/toucan2 | after_update_test.clj | (ns toucan2.tools.after-update-test
(:require
[clojure.string :as str]
[clojure.test :refer :all]
[clojure.walk :as walk]
[toucan2.instance :as instance]
[toucan2.select :as select]
[toucan2.test :as test]
[toucan2.test.track-realized-columns :as test.track-realized]
[toucan2.tools.after-updat... | null | https://raw.githubusercontent.com/camsaul/toucan2/5204b34d46f5adb3e52b022218049abe9b336928/test/toucan2/tools/after_update_test.clj | clojure | trigger a DB-land error | (ns toucan2.tools.after-update-test
(:require
[clojure.string :as str]
[clojure.test :refer :all]
[clojure.walk :as walk]
[toucan2.instance :as instance]
[toucan2.select :as select]
[toucan2.test :as test]
[toucan2.test.track-realized-columns :as test.track-realized]
[toucan2.tools.after-updat... |
4c3fa2ecb3da4afc156363fd8e7580086d8ab2bab1fa44ad65690d8dae96827b | chiroptical/book-of-monads | Inspecting.hs | # LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
module Inspecting where
import RPNInFreer (Freer (..), RPNInstruction, IStack (..), push, pop)
data LastOp = Return | LastPop | LastPush Integer
class MonadIStack m where
pop' :: m Integer
push' :: Integer -> m ()
newtype WithCont... | null | https://raw.githubusercontent.com/chiroptical/book-of-monads/c2eff1c67a8958b28cfd2001d652f8b68e7c84df/chapter13/src/Inspecting.hs | haskell | Implement Functor and Applicative for ` WithContext LastOp m `
Exercise 13.20 - Convince yourself the above code works | # LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
module Inspecting where
import RPNInFreer (Freer (..), RPNInstruction, IStack (..), push, pop)
data LastOp = Return | LastPop | LastPush Integer
class MonadIStack m where
pop' :: m Integer
push' :: Integer -> m ()
newtype WithCont... |
c4bc5897e7b2160a4610925e17be642de02bdfb664cc7516c4ec0f901f3f80d1 | racket/racket7 | renumber.rkt | #lang racket/base
(define filename "stypes.h")
(define lines
(with-input-from-file filename
(lambda ()
(let loop ()
(let ([l (read-line)])
(if (eof-object? l)
null
(cons l (loop))))))))
(define n 0)
(with-output-to-file filename
#:exists 'truncate
(lambda ()
(for-each
(lam... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/racket/src/renumber.rkt | racket | #lang racket/base
(define filename "stypes.h")
(define lines
(with-input-from-file filename
(lambda ()
(let loop ()
(let ([l (read-line)])
(if (eof-object? l)
null
(cons l (loop))))))))
(define n 0)
(with-output-to-file filename
#:exists 'truncate
(lambda ()
(for-each
(lam... | |
c3df4be10754a33c61b8d5660f41f5c3b752004383809999a765224c8c29a905 | racket/rackunit | base.rkt | #lang racket/base
(require racket/contract/base
"check-info.rkt"
"location.rkt")
;; struct test :
(define-struct test ())
;; struct (rackunit-test-case test) : (U string #f) thunk
(define-struct (rackunit-test-case test) (name action) #:transparent)
struct ( rackunit - test - suite test ) : string... | null | https://raw.githubusercontent.com/racket/rackunit/478e1d07d5a8eb2a60aad4a0a050a115b752ba69/rackunit-lib/rackunit/private/base.rkt | racket | struct test :
struct (rackunit-test-case test) : (U string #f) thunk
struct exn:test exn:fail : ()
The exception throw by test failures
struct (exn:test:check struct:exn:test) : (list-of check-info)
The exception thrown to indicate a check has failed
Try to get a location from the stack.
struct (exn:test:che... | #lang racket/base
(require racket/contract/base
"check-info.rkt"
"location.rkt")
(define-struct test ())
(define-struct (rackunit-test-case test) (name action) #:transparent)
struct ( rackunit - test - suite test ) : string ( fdown fup fhere seed - > ( listof test - result ) ) thunk thunk
(define-s... |
84efa454770d05961aab5a479564a0393eb100d6cdc08280506ac12d8c74a28d | vbmithr/ocaml-libbitcoin | mnemonic.mli | type dict =
| English
| Spanish
| Japanese
| Chinese_simplified
| Chinese_traditional
val of_entropy : ?dict:dict -> string -> string list
val to_seed : ?passphrase:string -> string list -> string option
val to_seed_exn : ?passphrase:string -> string list -> string
| null | https://raw.githubusercontent.com/vbmithr/ocaml-libbitcoin/b93a5cca1d430c38dd822b45e47fc5132fb28ab9/src/mnemonic.mli | ocaml | type dict =
| English
| Spanish
| Japanese
| Chinese_simplified
| Chinese_traditional
val of_entropy : ?dict:dict -> string -> string list
val to_seed : ?passphrase:string -> string list -> string option
val to_seed_exn : ?passphrase:string -> string list -> string
| |
24a347851fdd11d64580fc18f31ee39d98a26c35955479f279129c3f63b0fc61 | jafingerhut/clojure-benchmarks | knucleotide.clj-14.clj | The Computer Language Benchmarks Game
;; /
contributed by
(ns knucleotide
(:gen-class))
(set! *warn-on-reflection* true)
(definterface ITallyCounter
(^int get_count [])
(inc_BANG_ []))
(deftype TallyCounter [^{:unsynchronized-mutable true :tag int} cnt]
ITallyCounter
(get-count [this] cnt)
... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/knucleotide/knucleotide.clj-14.clj | clojure | /
parallelism as specified by the parameter num-threads. Uses
my-lazy-map instead of map from core.clj, since that version of map
can use unwanted additional parallelism for chunked collections,
like ranges.
Return true when the line l is a FASTA description line
Return true when the line l is a FASTA descrip... | The Computer Language Benchmarks Game
contributed by
(ns knucleotide
(:gen-class))
(set! *warn-on-reflection* true)
(definterface ITallyCounter
(^int get_count [])
(inc_BANG_ []))
(deftype TallyCounter [^{:unsynchronized-mutable true :tag int} cnt]
ITallyCounter
(get-count [this] cnt)
(inc! [... |
62b29b071520b7eb008ca9b0915c0079ac42e9193e9d0c2346434bb9187a04f2 | BoeingX/haskell-programming-from-first-principles | FixingDividedBy.hs | module Recursion.ChapterExercises.FixingDividedBy where
data DividedResult = Result Integer | DividedByZero
deriving (Eq, Show)
div' :: Integer -> Integer -> DividedResult
div' _ 0 = DividedByZero
div' 0 _ = Result 0
div' x y
| x < 0 && y < 0 = div' (-x) (-y)
div' x y
| x < 0 = let Result z = div' (x + y) y
... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/src/Recursion/ChapterExercises/FixingDividedBy.hs | haskell | module Recursion.ChapterExercises.FixingDividedBy where
data DividedResult = Result Integer | DividedByZero
deriving (Eq, Show)
div' :: Integer -> Integer -> DividedResult
div' _ 0 = DividedByZero
div' 0 _ = Result 0
div' x y
| x < 0 && y < 0 = div' (-x) (-y)
div' x y
| x < 0 = let Result z = div' (x + y) y
... | |
bef9605e3cbb4d6eef470e444d06f68aaab2d68dc785896544f1de81a867c855 | OlivierSohn/hamazed | Show.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
module Imj.Game.Show
( showPlayerName
, getPlayerUIName'
, getPlayerUIName''
, welcome
) whe... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/6c2b20d839ede7b8651fb7b425cb27ea93808a4a/imj-game/src/Imj/Game/Show.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
module Imj.Game.Show
( showPlayerName
, getPlayerUIName'
, getPlayerUIName''
, welcome
) where
import Imj.Prelude
i... |
5d9f1f728b2910780f0934113a4961de8cd88903f2cc03042d28bd7c64254f57 | testedminds/edgewise | reader.clj | (in-ns 'edgewise.tgf)
(import '[java.io BufferedReader StringReader])
(require '[edgewise.core :refer :all])
(defn- line->vertex [g line]
(let [[x label] (rest (re-matches #"(\d+) (.+)$" line))]
(add-vertex g label {:_id (Integer. x)})))
(defn- line->edge [g line]
(let [[x y lbl] (rest (re-matches #"(\d+) (\d... | null | https://raw.githubusercontent.com/testedminds/edgewise/0fb64c718e6a8e70eda87b77677a6679770569d1/src/edgewise/tgf/reader.clj | clojure | Mutually recursive functions work well for this. | (in-ns 'edgewise.tgf)
(import '[java.io BufferedReader StringReader])
(require '[edgewise.core :refer :all])
(defn- line->vertex [g line]
(let [[x label] (rest (re-matches #"(\d+) (.+)$" line))]
(add-vertex g label {:_id (Integer. x)})))
(defn- line->edge [g line]
(let [[x y lbl] (rest (re-matches #"(\d+) (\d... |
bb947f7ba159c0cbcfb433fb6bd063860f3f7147467eb5ed7db0b3400d258684 | Gbury/dolmen | parse.ml |
(* This file is free software, part of dolmen. See file "LICENSE" formore information *)
(** Interface for Dolmen parsers. *)
module type S = sig
* { 2 Main interface }
type token
(** The type of token consumed by the parser. *)
type statement
(** The type of top-level declarations returned by the parser.... | null | https://raw.githubusercontent.com/Gbury/dolmen/58903349a3c422402f25ec479ce90d944f44f148/src/interface/parse.ml | ocaml | This file is free software, part of dolmen. See file "LICENSE" formore information
* Interface for Dolmen parsers.
* The type of token consumed by the parser.
* The type of top-level declarations returned by the parser.
* Exception raised by the parser when it encounters an error.
* A function that parses an enti... |
module type S = sig
* { 2 Main interface }
type token
type statement
exception Error of int
val file : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> statement list
val input : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> statement option
end
|
8fef6ca8a329ab26d49b2dc154da16474f8bc060c56fd61b4fa3e4794bfa580d | jordwalke/rehp | commonArg.ml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2014 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/compiler/commonArg.ml | ocaml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2014 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | |
bd6b45f5d63dcf2807056434666c1d9d4f9d92adfb6c1a20fbddf3cfdc6dc3fc | igstan/programming-in-haskell | higher-order-functions.hs | import Data.Char (chr, ord)
squaresOfEvens :: Integral a => [a] -> [a]
squaresOfEvens = map (^ 2) . filter even
all even [ 2,4,6,8 ]
-- True
all' :: (a -> Bool) -> [a] -> Bool
all' f = and . map f
any odd [ 2,4,6,8 ]
-- False
any' :: (a -> Bool) -> [a] -> Bool
any' f = or . map f
takeWhile' :: (a -> Bool) -> [a... | null | https://raw.githubusercontent.com/igstan/programming-in-haskell/6d5df9ff2e0ba7e1699fdc79caa943ef9937d2e5/higher-order-functions.hs | haskell | True
False
bin2int bits = sum [w * b | (w, b) <- zip weights bits]
bin2int bits = sum $ zipWith (*) weights bits | import Data.Char (chr, ord)
squaresOfEvens :: Integral a => [a] -> [a]
squaresOfEvens = map (^ 2) . filter even
all even [ 2,4,6,8 ]
all' :: (a -> Bool) -> [a] -> Bool
all' f = and . map f
any odd [ 2,4,6,8 ]
any' :: (a -> Bool) -> [a] -> Bool
any' f = or . map f
takeWhile' :: (a -> Bool) -> [a] -> [a]
takeWhil... |
0f52c87a1a77874f92069ff9dbb95c2b51fb5ff3ccefe7ae467466302f2fe9ba | RunOrg/RunOrg | request.mli | (* © 2013 RunOrg *)
open Std
(** An error that can occur while parsing a request. *)
type error =
| HeaderTooLong
| BodyTooLong
| SyntaxError of string
| NotImplemented of string
| Timeout
(** All the information required to send back a compatible CORS response:
- the extracted 'Origin:' header
- ... | null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/httpdLib/request.mli | ocaml | © 2013 RunOrg
* An error that can occur while parsing a request.
* All the information required to send back a compatible CORS response:
- the extracted 'Origin:' header
- a map of all headers in the request
* Parses a request. Attempts to determine the CORS context even if other aspects of
parsing fail... |
open Std
type error =
| HeaderTooLong
| BodyTooLong
| SyntaxError of string
| NotImplemented of string
| Timeout
type cors = string * (string, string) Map.t
type t = <
host : string ;
client_ip : IpAddress.t ;
path : string list ;
verb : [ `GET | `PUT | `POST | `DELETE | `OPTIONS ] ;
body : ... |
ab32b25cb3232413d083b54e622619891e63c083839748622981118c78e4c453 | skrah/minicaml | Symtable.mli |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
module Make :
functor... | null | https://raw.githubusercontent.com/skrah/minicaml/e5f5cad7fdbcfc11561f717042fae73fa743823f/Symtable.mli | ocaml |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
module Make :
functor... | |
4cb7de8bd0a766a144da352b3adf501afc9ec9b2c650161bc9bacadff6950795 | Millak/my-guix | minitube.scm | Copyright © 2022 Efraim < >
;;;
;;; This file is an addendum to 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 License , or ( at
;;; your option) any later v... | null | https://raw.githubusercontent.com/Millak/my-guix/508bdc01f794275a54130fb49765a1f779e02e76/dfsg/main/minitube.scm | scheme |
This file is an addendum to 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 warranty of
MERCHANTABILITY or FITNESS FOR A P... | Copyright © 2022 Efraim < >
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 (dfsg main minitube)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix ... |
19db706365ec0511bc5f463ae4885aae758b7536c5efba0dac3c847df6037622 | cbaggers/nineveh | docs.lisp | (in-package :nineveh.random)
(docs:define-docs
(defun rand
"
-- Arg --
seed :vec2
-- Purpose --
Returns a 'random' float.
-- Explaination --
Based on the fact that sin(<huge multiplier>*x)
modulates extremely quickly. So quickly that sampling the sin
function at every fragment location effectively gives y... | null | https://raw.githubusercontent.com/cbaggers/nineveh/0a10a84669cd9d1c584f54b9eab062986a5f1c47/random/docs.lisp | lisp | (in-package :nineveh.random)
(docs:define-docs
(defun rand
"
-- Arg --
seed :vec2
-- Purpose --
Returns a 'random' float.
-- Explaination --
Based on the fact that sin(<huge multiplier>*x)
modulates extremely quickly. So quickly that sampling the sin
function at every fragment location effectively gives y... | |
703c59e6c7bd8bf91df590d97083cd6207e906aed5bdc4816d4918a80485e575 | Naupio/pitcp | piweb_app.erl | %%%-------------------------------------------------------------------
%% @doc piweb public API
%% @end
%%%-------------------------------------------------------------------
-module(piweb_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%%=========================================... | null | https://raw.githubusercontent.com/Naupio/pitcp/59a7da3a8980695f8efdb3697b026ab0f42754cb/apps/piweb/src/piweb_app.erl | erlang | -------------------------------------------------------------------
@doc piweb public API
@end
-------------------------------------------------------------------
Application callbacks
====================================================================
API
==========================================================... |
-module(piweb_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
piweb_sup:start_link().
stop(_State) ->
ok.
Internal functions
|
38355337aeca0d84d57cdeadfd2277a9e5df749b4dfbcd0cfe7ab5067ba85719 | brendanhay/gogol | Product.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/8cbceeaaba36a3c08712b2e272606161500fbe91/lib/services/gogol-doubleclick-search/gen/Gogol/DoubleClickSearch/Internal/Product.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Availability
* Conversion
* CustomDimension
* CustomMetric
* Report
* ReportRequest
* ReportRequest_FiltersItem
* ReportRequest_TimeRange
* SavedColumn
* SavedColumnList
* UpdateAvailabilityRequest
* UpdateAvailability... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
3a7f54f36c661df7484543778e05f550cfacd96c6837f1a6f0ed153841f7b524 | goldfirere/thesis | Util.hs | -- |
-- Module : Data.Vector.Fusion.Util
Copyright : ( c ) Roman Leshchinskiy 2009
-- License : BSD-style
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
-- Fusion-related utility types
--
module Data.Vector.Fusion.Util (
Id(..), Box(..),
delay_inline, delayed_... | null | https://raw.githubusercontent.com/goldfirere/thesis/22f066bc26b1147530525aabb3df686416b3e4aa/cab/vector-0.10.12.3/Data/Vector/Fusion/Util.hs | haskell | |
Module : Data.Vector.Fusion.Util
License : BSD-style
Stability : experimental
Portability : portable
Fusion-related utility types
| Identity monad
| Box monad
| Delay inlining a function until late in the game (simplifier phase 0).
# INLINE [0] delay_inline #
| `min` inlined in phase 0
# INLI... | Copyright : ( c ) Roman Leshchinskiy 2009
Maintainer : < >
module Data.Vector.Fusion.Util (
Id(..), Box(..),
delay_inline, delayed_min
) where
import Control.Applicative
newtype Id a = Id { unId :: a }
instance Functor Id where
fmap f (Id x) = Id (f x)
instance Applicative Id where
pure = Id
... |
de8b9a36ee4654443113ea8142f6a27f9c1c586715008f2a35ee9b31927a1a69 | jonase/eq | pp.ml | open Easy_format
type colors =
Black
| Red
| Green
| Yellow
| Blue
| Magenta
| Cyan
| White
let color_code color =
match color with
Black -> 30
| Red -> 31
| Green -> 32
| Yellow -> 33
| Blue -> 34
| Magenta -> 35
| Cyan -> 36
| White -> 37
let wrap_color color string =
match color with
S... | null | https://raw.githubusercontent.com/jonase/eq/08bd514e78a026af077fa5a996d43f0d7ae89795/src/pp.ml | ocaml | open Easy_format
type colors =
Black
| Red
| Green
| Yellow
| Blue
| Magenta
| Cyan
| White
let color_code color =
match color with
Black -> 30
| Red -> 31
| Green -> 32
| Yellow -> 33
| Blue -> 34
| Magenta -> 35
| Cyan -> 36
| White -> 37
let wrap_color color string =
match color with
S... | |
afa7d3ebfcf270a6d3101c9f305aec26d6be4713b5d319670c5317ccd4149b95 | camllight/camllight | patch.ml | (* To relocate a block of object bytecode *)
#open "reloc";;
#open "symtable";;
let patch_short buff pos val =
set_nth_char buff pos (char_of_int val);
set_nth_char buff (succ pos) (char_of_int (lshift_right val 8))
;;
let patch_object buff offset =
do_list (function
Reloc_literal sc, pos ->
patch_sh... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/src/linker/patch.ml | ocaml | To relocate a block of object bytecode |
#open "reloc";;
#open "symtable";;
let patch_short buff pos val =
set_nth_char buff pos (char_of_int val);
set_nth_char buff (succ pos) (char_of_int (lshift_right val 8))
;;
let patch_object buff offset =
do_list (function
Reloc_literal sc, pos ->
patch_short buff (pos + offset) (get_slot_for_literal... |
f7f6001c0c41a536eed5130a04b2dcc303e78b7b704d879df738e7bf67f9e448 | kelsey-sorrels/robinson | add_all_crafting_items.clj | (require
'[robinson.itemgen :as ig]
'[robinson.monstergen :as mg]
'[robinson.crafting :as rcrafting])
(let [item-ids (->> ig/items
(filter
rcrafting/item-satisfies-any-recipe-clause?)
(map :item/id))
rat (mg/id->monster :rat)
rat-corpse (ig/gen-cor... | null | https://raw.githubusercontent.com/kelsey-sorrels/robinson/337fd2646882708331257d1f3db78a3074ccc67a/src/robinson_tools/snippets/add_all_crafting_items.clj | clojure | (require
'[robinson.itemgen :as ig]
'[robinson.monstergen :as mg]
'[robinson.crafting :as rcrafting])
(let [item-ids (->> ig/items
(filter
rcrafting/item-satisfies-any-recipe-clause?)
(map :item/id))
rat (mg/id->monster :rat)
rat-corpse (ig/gen-cor... | |
3a7d9938909f117e34162eb3c8fca2e9cbf8490d7e8b21253e6b4ddaea22db18 | skynet-gh/skylobby | resources.clj | (ns skylobby.main.resources
(:require
[clojure.tools.cli :as cli]
[skylobby.auto-resources :as auto-resources]
[skylobby.cli.util :as cu]
skylobby.core
[skylobby.task :as task]
[taoensso.timbre :as log]))
(set! *warn-on-reflection* true)
(def cli-options
[
[nil "--engine ENGINE" "Engi... | null | https://raw.githubusercontent.com/skynet-gh/skylobby/125c3e7542356220f8fc1032f4cc37f189571afe/graal/clj/skylobby/main/resources.clj | clojure | (ns skylobby.main.resources
(:require
[clojure.tools.cli :as cli]
[skylobby.auto-resources :as auto-resources]
[skylobby.cli.util :as cu]
skylobby.core
[skylobby.task :as task]
[taoensso.timbre :as log]))
(set! *warn-on-reflection* true)
(def cli-options
[
[nil "--engine ENGINE" "Engi... | |
9232214b51f77ecd000b837948d87ef37cfe31a57a4c8d83ea5d0e3cc8673645 | TrustInSoft/tis-interpreter | GuiPanel.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of WP plug - in of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/wp/GuiPanel.mli | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat a l'energie atomique et aux energies
Lesser General Public License as published by the Free Soft... |
1fdee10dba500d5147e10ad8b3d9a8253606d87b94a9bf98a38dd0422a4a464b | babashka/babashka | alg.cljc | (ns loom.test.alg
(:require [loom.graph :refer [graph weighted-graph digraph weighted-digraph nodes
successors remove-nodes add-nodes edges
add-edges]]
[loom.alg :refer [pre-traverse post-traverse pre-span topsort
... | null | https://raw.githubusercontent.com/babashka/babashka/cda02cd3a3b0fd745fe80b9349dedf06c6265916/test-resources/lib_tests/loom/test/alg.cljc | clojure | 's_algorithm
's_algorithm
Weighted directed graph with a negative-weight cycle
which is reachable from sources :a, :b, :d, and :e.
/~simhaweb/alg/lectures/module9/module9.html
Weighted directed graph with a non-negative-weight cycle,
simple directed "triangle" graph
graphs for mst
's_algorithm
TODO: flaky... | (ns loom.test.alg
(:require [loom.graph :refer [graph weighted-graph digraph weighted-digraph nodes
successors remove-nodes add-nodes edges
add-edges]]
[loom.alg :refer [pre-traverse post-traverse pre-span topsort
... |
c32dd90c8136391f23527b18c5d92f0d0e197ea81886538cf44aa4338fb6c27a | input-output-hk/rscoin-haskell | Updater.hs | -- | Regularly updates the state of the wallet.
module GUI.RSCoin.Updater (runUpdater) where
import Control.Concurrent (threadDelay)
import Control.Concurrent.STM.TBQueue (TBQueue, writeTBQueue)
import Control.Monad.STM (atomically)
import GUI.RSCoin.A... | null | https://raw.githubusercontent.com/input-output-hk/rscoin-haskell/109d8f6f226e9d0b360fcaac14c5a90da112a810/src/User/GUI/RSCoin/Updater.hs | haskell | | Regularly updates the state of the wallet.
| Regularly requests to perform Update action. |
module GUI.RSCoin.Updater (runUpdater) where
import Control.Concurrent (threadDelay)
import Control.Concurrent.STM.TBQueue (TBQueue, writeTBQueue)
import Control.Monad.STM (atomically)
import GUI.RSCoin.Action (Action (Update))
runUpdater... |
28a605159929334be0c16c33dc6d9b51b93013035aa8b243ad1618a8ed639912 | gabebw/croniker | Application.hs | # OPTIONS_GHC -fno - warn - orphans #
module Application
( getApplicationDev
, appMain
, develMain
, makeFoundation
, makeLogWare
-- * for DevelMain
, getApplicationRepl
, shutdownApp
-- * for GHCI
, handler
, db
, todaysProfilesTaskMain
, allProfilesTaskMain
) wh... | null | https://raw.githubusercontent.com/gabebw/croniker/89f081738c229a3302af3b0123fea208bccbda11/src/Application.hs | haskell | * for DevelMain
* for GHCI
Import all relevant handler modules here.
Don't forget to add new modules to your cabal file!
comments there for more details.
| This function allocates resources (such as a database connection pool),
performs initialization and returns a foundation datatype value. This is also
the pl... | # OPTIONS_GHC -fno - warn - orphans #
module Application
( getApplicationDev
, appMain
, develMain
, makeFoundation
, makeLogWare
, getApplicationRepl
, shutdownApp
, handler
, db
, todaysProfilesTaskMain
, allProfilesTaskMain
) where
import Control.Monad.Logger ... |
a7e51b4c7f11b46c953af271627e5d0e6433a4303949fd78df166a7e3c940ed8 | braidchat/braid | predicates.clj | (ns braid.chat.predicates
(:require
[datomic.api :as d]
[braid.chat.db.thread :as db.thread]))
;; *-exists?
(defn ^:private exists?
[db id-key entity-id]
(->> (d/q '[:find ?entity .
:in $ ?entity-id ?key
:where
[?entity ?key ?entity-id]]
db
... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/chat/predicates.clj | clojure | *-exists?
OTHER | (ns braid.chat.predicates
(:require
[datomic.api :as d]
[braid.chat.db.thread :as db.thread]))
(defn ^:private exists?
[db id-key entity-id]
(->> (d/q '[:find ?entity .
:in $ ?entity-id ?key
:where
[?entity ?key ?entity-id]]
db
entity-id
... |
cc30f5004c433987f9311ccb5147ba03b3c354d38a580e3d3089691dcea974f8 | wedesoft/aiscm | 2d_matching.scm | (use-modules (aiscm core))
(arr ((1 2) (3 4)) ((5 6) (7 8)))
;#<multiarray<int<8,unsigned>,3>>:
( ( ( 1 2 )
( 3 4 ) )
( ( 5 6 )
; (7 8)))
| null | https://raw.githubusercontent.com/wedesoft/aiscm/2c3db8d00cad6e042150714ada85da19cf4338ad/tests/integration/2d_matching.scm | scheme | #<multiarray<int<8,unsigned>,3>>:
(7 8))) | (use-modules (aiscm core))
(arr ((1 2) (3 4)) ((5 6) (7 8)))
( ( ( 1 2 )
( 3 4 ) )
( ( 5 6 )
|
a538795c939c501c12d6e09e0f4f1e5707ec57bdb0430107e74aab72e15d24cf | fizruk/rzk | Decl.hs | module Rzk.Syntax.Decl where
import Rzk.Syntax.Term
data Decl var = Decl
{ declName :: var
, declType :: Term var
, declBody :: Term var
}
| null | https://raw.githubusercontent.com/fizruk/rzk/502eb7655655d8fe1be8f4fa2561464141b01e2e/rzk/src/Rzk/Syntax/Decl.hs | haskell | module Rzk.Syntax.Decl where
import Rzk.Syntax.Term
data Decl var = Decl
{ declName :: var
, declType :: Term var
, declBody :: Term var
}
| |
1c9777c75c9de4312540f293ecaadfedec38947ce979385bdd6240a58bb38790 | ghc/ghc | Orphans.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE FlexibleInstances #
module Orphans where
import Data . Default
import GHC hiding (EpaComment)
-- ---------------------------------------------------------------------
class Default a where
def :: a
-- -------------------------------------------------------------... | null | https://raw.githubusercontent.com/ghc/ghc/14b2e3d3dda104c62c5abafd3353dd0315de71ad/utils/check-exact/Orphans.hs | haskell | ---------------------------------------------------------------------
--------------------------------------------------------------------- | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE FlexibleInstances #
module Orphans where
import Data . Default
import GHC hiding (EpaComment)
class Default a where
def :: a
Orphan Default instances . See
instance Default [a] where
def = []
instance Default NameAnn where
def = mempty
instance Default... |
a77b73bc3e789193c20b6f9939ca96866dd2fbfdda2f946f030b54ebb1dcb1f0 | open-company/open-company-web | ws_client_ids.cljs | (ns oc.web.utils.ws-client-ids)
(def change-client-id (atom nil))
(def interaction-client-id (atom nil))
(def notify-client-id (atom nil)) | null | https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/src/main/oc/web/utils/ws_client_ids.cljs | clojure | (ns oc.web.utils.ws-client-ids)
(def change-client-id (atom nil))
(def interaction-client-id (atom nil))
(def notify-client-id (atom nil)) | |
7d8bbbe0c89b911ff6deacdab85d2703d3dc20ab74859ca86688915c0071aa5c | stettberger/ispositive | IsPositive.hs | module Integer.IsPositive (
is_positive_integer
, is_not_positive_integer
) where
is_positive_integer x = 1 <= x && x == fromInteger (floor x)
is_not_positive_integer = not . is_positive_integer
| null | https://raw.githubusercontent.com/stettberger/ispositive/c9ce01c3ea7c505d5e9428f9746aead93c7abebd/src/Integer/IsPositive.hs | haskell | module Integer.IsPositive (
is_positive_integer
, is_not_positive_integer
) where
is_positive_integer x = 1 <= x && x == fromInteger (floor x)
is_not_positive_integer = not . is_positive_integer
| |
82636027b99ce5f4fd53d8cfb3124bc9ac5459738582731d0b8659f14abdd3db | ogaml/ogaml | graphs.ml | open OgamlUtils
let () =
Printf.printf "Beginning graph tests...\n%!"
module G = Graph.Make (struct
type t = int
let compare (i : int) (j : int) = compare i j
end)
let graph1 =
let open G in
empty
|> add ~cost:1. 1 2
|> add ~cost:2. 1 3
|> add ~cost:3. 1 4
|> add ~cost:2. 2 5
|> add ~cost:... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/tests/graphs.ml | ocaml | open OgamlUtils
let () =
Printf.printf "Beginning graph tests...\n%!"
module G = Graph.Make (struct
type t = int
let compare (i : int) (j : int) = compare i j
end)
let graph1 =
let open G in
empty
|> add ~cost:1. 1 2
|> add ~cost:2. 1 3
|> add ~cost:3. 1 4
|> add ~cost:2. 2 5
|> add ~cost:... | |
be767c1843d878f1e9ff584e711b3757fae4b779ce72ba29ec375ece8a367e24 | inria-parkas/sundialsml | nvector_pthreads.ml | open Sundials
type data = RealArray.t
type kind = [`Pthreads|Nvector_serial.kind]
type t = (data, kind) Nvector.t
(* Selectively enable and disable fused and array operations *)
external c_enablefusedops_pthreads : ('d, 'k) Nvector.t -> bool -> unit
= "sunml_nvec_pthreads_enablefusedops"
external... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/a72ebfc84b55470ed97fbb0b45d700deebfc1664/src/nvectors/nvector_pthreads.ml | ocaml | Selectively enable and disable fused and array operations
{{{
}}}
{{{
}}} | open Sundials
type data = RealArray.t
type kind = [`Pthreads|Nvector_serial.kind]
type t = (data, kind) Nvector.t
external c_enablefusedops_pthreads : ('d, 'k) Nvector.t -> bool -> unit
= "sunml_nvec_pthreads_enablefusedops"
external c_enablelinearcombination_pthreads : ('d, 'k) Nvecto... |
07107eaa5ebe1858ae97c48b4a0eda3ff089423a84875625826ebe43cc6143b9 | Phaetec/pogo-cruncher | rename.cljs | (ns cruncher.rename
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[ajax.core :refer [POST]]
[goog.dom :as gdom]
[cruncher.utils.views :as vlib]
[cruncher.utils.lib :as lib]
[cruncher.config :as config]
... | null | https://raw.githubusercontent.com/Phaetec/pogo-cruncher/a93bd16cc4d118d2ec57c2a641bd1b11be0d133d/frontend/src/cruncher/rename.cljs | clojure | (ns cruncher.rename
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[ajax.core :refer [POST]]
[goog.dom :as gdom]
[cruncher.utils.views :as vlib]
[cruncher.utils.lib :as lib]
[cruncher.config :as config]
... | |
5e454194e637babf2b793a909065a602b2c2026c6989f49c9fc7e21c83be983c | MaybeJustJames/zephyr | Options.hs | -- | `zephyr` command line option parser
--
module Command.Options
( Options (..)
, parseOptions
) where
import Data.List (intercalate)
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.Text as T
import Data.Traversable (for)
import qualified Language.PureS... | null | https://raw.githubusercontent.com/MaybeJustJames/zephyr/30b6d25813592123dd4dadc34b4df4eb0d150a0b/app/Command/Options.hs | haskell | | `zephyr` command line option parser
| @zephyr@ options
^ List of entry points.
^ Output directory, default: @dce-output@.
^ Verbose output.
^ Dead code eliminate foreign javascript module.
^ Print errors in `JSON` format; default 'False'.
^ Rewirite using an evaluation; it can reduce literal expressions; de... | module Command.Options
( Options (..)
, parseOptions
) where
import Data.List (intercalate)
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.Text as T
import Data.Traversable (for)
import qualified Language.PureScript as P
import Language.PureScr... |
5ffe24e09eb54ee9588e8f1a6710c01179eb4287f8e83225f12d92f989ff1cd1 | mainland/nikola | Main.hs | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
-- |
-- Module : Main
Copyright : ( c ) The President and Fellows of Harvard College 2009 - 2010
Copyright : ( c ) 2012
-- License : BSD-style
--
Maintainer : < >
-- Stability : experimental
-- Portability : no... | null | https://raw.githubusercontent.com/mainland/nikola/d86398888c0a76f8ad1556a269a708de9dd92644/examples/blackscholes/Main.hs | haskell | |
Module : Main
License : BSD-style
Stability : experimental
Portability : non-portable | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
Copyright : ( c ) The President and Fellows of Harvard College 2009 - 2010
Copyright : ( c ) 2012
Maintainer : < >
module Main where
import Prelude hiding (map, zipWith, zipWith3)
import qualified Control.Exception as ... |
098f6b48d171c78e042227fc93e247e802cd78c2fc1dfffd47c69768867d6a3e | eeng/mercurius | main.cljs | (ns mercurius.core.presentation.main
(:require [reagent.dom :as rd]
[re-frame.core :as re-frame :refer [dispatch-sync]]
[mercurius.core.presentation.util.reframe :refer [>evt]]
[mercurius.core.presentation.socket :as socket]
[mercurius.core.presentation.app :refer [app]... | null | https://raw.githubusercontent.com/eeng/mercurius/f83778ddde99aa13692e4fe2e70b2e9dc2fd70e9/src/mercurius/core/presentation/main.cljs | clojure | (ns mercurius.core.presentation.main
(:require [reagent.dom :as rd]
[re-frame.core :as re-frame :refer [dispatch-sync]]
[mercurius.core.presentation.util.reframe :refer [>evt]]
[mercurius.core.presentation.socket :as socket]
[mercurius.core.presentation.app :refer [app]... | |
fc5e8f3153bee362f5c60f673292708439f70d062a1887d9b4f04c983657b386 | hannesm/logs-syslog | logs_syslog_mirage.mli | * Logs reporter via syslog using MirageOS
Please read { ! Logs_syslog } first .
Please read {!Logs_syslog} first. *)
* UDP syslog
module Udp (C : Mirage_console.S) (CLOCK : Mirage_clock.PCLOCK) (STACK : Tcpip.Stack.V4V6) : sig
* [ create c udp ~hostname ip ~port ~truncate ( ) ] is [ reporter ] , which
... | null | https://raw.githubusercontent.com/hannesm/logs-syslog/aadb766b7b1e239d92b88765720fae6cdd75577f/src/mirage/logs_syslog_mirage.mli | ocaml | * TCP syslog | * Logs reporter via syslog using MirageOS
Please read { ! Logs_syslog } first .
Please read {!Logs_syslog} first. *)
* UDP syslog
module Udp (C : Mirage_console.S) (CLOCK : Mirage_clock.PCLOCK) (STACK : Tcpip.Stack.V4V6) : sig
* [ create c udp ~hostname ip ~port ~truncate ( ) ] is [ reporter ] , which
... |
f26fbb80d4a16a32cdf62553c86b43c672c783ad3ceed47d7524fab2b9a4f3d2 | e-bigmoon/haskell-blog | Override_proxy.hs | #!/usr/bin/env stack
-- stack script --resolver lts-17.3
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Lazy.Char8 as L8
import Network.HTTP.Simple
main :: IO ()
main = do
let request = setRequestProxy (Just (Proxy "127.0.0.1" 3128))
$ ""
response <- httpLBS reque... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/appendix/ap4/Override_proxy.hs | haskell | stack script --resolver lts-17.3
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
import qualified Data.ByteString.Lazy.Char8 as L8
import Network.HTTP.Simple
main :: IO ()
main = do
let request = setRequestProxy (Just (Proxy "127.0.0.1" 3128))
$ ""
response <- httpLBS request
putStrLn $ "The status code was: " ++
show (getR... |
4f7c02fd5faff79645c6aa8cea151feca63994f8ab4165bf7c7f3a232be0ec55 | cubicle-model-checker/cubicle | approx.ml | (**************************************************************************)
(* *)
Cubicle
(* *)
... | null | https://raw.githubusercontent.com/cubicle-model-checker/cubicle/04f045573093353447a5afc586b0b6ced7630acd/approx.ml | ocaml | ************************************************************************
... | Cubicle
Copyright ( C ) 2011 - 2014
and
Universite Paris - Sud 11
This file is distributed under the terms ... |
da7c74fa466ca05fd195eb00a3303e4234d3a5b1f62b525763efae0e6d6039d7 | static-analysis-engineering/codehawk | jCHExprFeatureExtraction.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : and
------------------------------------------------------------------------------
The MIT License ( MIT )
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchfeatures/jCHExprFeatureExtraction.mli | ocaml | chutil
jchpre | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : and
------------------------------------------------------------------------------
The MIT License ( MIT )
... |
75cf1127ff8575b5011ab7fed36bfd901fe68628ee640f0f6824fc1783e92298 | sharplispers/montezuma | bit-vector.lisp | (in-package #:montezuma)
;; There may be no reason not to use a standard bit-vector.
(defun make-bit-vector ()
(list 0))
(defun bit-set-p (bit-vector index)
(logbitp index (car bit-vector)))
(defun set-bit (bit-vector index)
(setf (ldb (byte 1 index) (car bit-vector)) 1))
(defun clear-bit (bit-vector index)
... | null | https://raw.githubusercontent.com/sharplispers/montezuma/ee2129eece7065760de4ebbaeffaadcb27644738/src/util/bit-vector.lisp | lisp | There may be no reason not to use a standard bit-vector. | (in-package #:montezuma)
(defun make-bit-vector ()
(list 0))
(defun bit-set-p (bit-vector index)
(logbitp index (car bit-vector)))
(defun set-bit (bit-vector index)
(setf (ldb (byte 1 index) (car bit-vector)) 1))
(defun clear-bit (bit-vector index)
(setf (ldb (byte 1 index) (car bit-vector)) 0))
(defun bi... |
7e6066ac610a5acb55df5630116ffadc7a08ca7b69745488b1afdc4a79e6d329 | jebberjeb/fsmviz | project.clj | (defproject demo-cljs "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0-beta4"]
[org.clojure/clojurescript "1.9.946"]
[... | null | https://raw.githubusercontent.com/jebberjeb/fsmviz/05c89fbc29f8bfe76eda74212a85cb2e30369d29/examples/demo-cljs/project.clj | clojure | The presence of a :figwheel configuration here
will cause figwheel to inject the figwheel client
into your build
:open-urls will pop open your application
started and compiled your application.
Comment this out once it no longer serves you.
-devtools
This next build is a compressed minified build for
productio... | (defproject demo-cljs "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0-beta4"]
[org.clojure/clojurescript "1.9.946"]
[... |
cf61ff92fd75fc9ea345225b616c1fe6834a7ac4a3bb257e64f969af3e8e9d8d | konn/dl-first-principle-tutorial | Main.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ApplicativeDo #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE Qu... | null | https://raw.githubusercontent.com/konn/dl-first-principle-tutorial/c00a37369c44b68736fa39d32a955fddd6844b38/app/circles/Main.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# OPTIONS_GHC -funbox-strict-fields # | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ApplicativeDo #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE RecordWildCards #
# ... |
549dc275730956df1ec21fa8c8b48b2dc590e75df4a7b1600709e15318b849c2 | nyu-acsys/drift | simple.ml |
let rec mapfilter (f:int->int list) (l:int list) = match l with
| [] -> []
| h::t ->
let r = mapfilter f t in
let x = f h in
match x with
| [] -> r
| z::e -> (z::r)
let pos y =
if 0 < y then
y::[]
else
[]
let main (u:unit(*-:{v:Unit | unit}*)) =
let xs = [1;2;1] in
let ys = mapfilter ... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/DOrder/list/simple.ml | ocaml | -:{v:Unit | unit}
v <= threshold_const
v >= threshold_const
v <= threshold_const
v >= threshold_const
else if Environment.mem_var env (Var.of_string "cur_v") then !licons_ref
var :: lst |
let rec mapfilter (f:int->int list) (l:int list) = match l with
| [] -> []
| h::t ->
let r = mapfilter f t in
let x = f h in
match x with
| [] -> r
| z::e -> (z::r)
let pos y =
if 0 < y then
y::[]
else
[]
let xs = [1;2;1] in
let ys = mapfilter pos xs in
assert(List.length ys = List.le... |
95c03ad8b09b7a1eb0eda1cea535115f6ceb5f9cc305483fa9ad606a12b0bf8b | amperity/lein-monolith | core.clj | (ns lib-c.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| null | https://raw.githubusercontent.com/amperity/lein-monolith/f7d476b3b746498d0d0539e090a1db33a6602280/example/libs/subdir/lib-c/src/lib_c/core.clj | clojure | (ns lib-c.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| |
270ee8b29a3565ba31340c14cff37551e7a0dfe074dd43a4e0eea0b66c8cbb90 | finos/metadata-tool | metadata.clj | ;
Copyright 2017 Fintech Open Source Foundation
SPDX - License - Identifier : Apache-2.0
;
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 applicab... | null | https://raw.githubusercontent.com/finos/metadata-tool/61a48a91411f39fc543992f72535fd7ba82959f1/src/metadata_tool/sources/metadata.clj | clojure |
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 pe... | Copyright 2017 Fintech Open Source Foundation
SPDX - License - Identifier : Apache-2.0
distributed under the License is distributed on an " AS IS " BASIS ,
(ns metadata-tool.sources.metadata
(:require [clojure.string :as str]
[clojure.tools.logging :as log]
[clojur... |
c316ac22140a3f3b9940bf5246c8efb294cb8ccf17523c4e032002e7c95e572d | Copilot-Language/copilot-libraries | PTLTL.hs | -- |
-- Module: PTLTL
-- Description: Past-Time Linear-Temporal Logic
Copyright : ( c ) 2011 National Institute of Aerospace / Galois , Inc.
--
Provides past - time linear - temporal logic ( ptLTL operators ) .
--
-- /Interface:/ See @Examples/PTLTLExamples.hs@ in the
-- < Copilot repository>.
--
You can embed a... | null | https://raw.githubusercontent.com/Copilot-Language/copilot-libraries/ae95ad91d5b135769871cb42056908bffba5a009/src/Copilot/Library/PTLTL.hs | haskell | |
Module: PTLTL
Description: Past-Time Linear-Temporal Logic
/Interface:/ See @Examples/PTLTLExamples.hs@ in the
< Copilot repository>.
the form:
@
operator stream
@
| Did @s@ hold in the previous period?
| Has @s@ always held (up to and including the current state)?
| Did @s@ hold at some time in th... | Copyright : ( c ) 2011 National Institute of Aerospace / Galois , Inc.
Provides past - time linear - temporal logic ( ptLTL operators ) .
You can embed a ptLTL specification within a Copilot specification using
# LANGUAGE NoImplicitPrelude #
module Copilot.Library.PTLTL
( since, alwaysBeen, eventuallyPrev, ... |
7f83dab0d64dbb4cd9bdaca31e8cb8dd9eef879dbed7e0adff308c8cbcd31b34 | 2600hz/kazoo | trunkstore_listener.erl | %%%-----------------------------------------------------------------------------
( C ) 2013 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/applications/trunkstore/src/trunkstore_listener.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
-----------------------------------------------------------------------------
By convention, we put the options here in macros, but not required.
=============================================================================
API... | ( C ) 2013 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(trunkstore_listener).
-behaviour(gen_listener).
-export([start_link/0]).
-export([init/1
,handle_... |
65273ffabc1792724bfd633f1e0aadd12fb79ffaa634299279ac68c0f0bbf25e | snmsts/cl-langserver | events-signal.lisp | (in-package :ls-base)
Signal driven IO
(defun install-sigio-handler (connection)
(add-sigio-handler (connection-socket-io connection)
(lambda () (process-io-interrupt connection)))
(handle-requests connection t))
(defvar *io-interupt-level* 0)
(defun process-io-interrupt (connection)
(l... | null | https://raw.githubusercontent.com/snmsts/cl-langserver/3b1246a5d0bd58459e7a64708f820bf718cf7175/src/helitage/events-signal.lisp | lisp | (in-package :ls-base)
Signal driven IO
(defun install-sigio-handler (connection)
(add-sigio-handler (connection-socket-io connection)
(lambda () (process-io-interrupt connection)))
(handle-requests connection t))
(defvar *io-interupt-level* 0)
(defun process-io-interrupt (connection)
(l... | |
a282327a0ea2e6a8c89e5270f2eb8d7b331b6d709f3ec13f649c968e7a146472 | kennknowles/aspcc | mod_aspcc.ml |
* Mod_caml based apache module to interpret ASP / VbScript pages in a 100 %
compatible way , including intrinsic objects and ADO
compatible way, including intrinsic objects and ADO *)
* The " real " intrinsic ASP objects are defined here , so that they can
interface with the apache API provided by Mod_caml
... | null | https://raw.githubusercontent.com/kennknowles/aspcc/951a91cc21e291b1d3c750bbbca7fa79209edd08/frontends/mod_aspcc.ml | ocaml | * The class of response objects
* Flag to indicate whether any output has been sent to the client
* If [have_output] is true, then it is illegal to change this
* Internal buffer
=================== properties =======================
* [Response.buffer] indicates whether output will be buffered
* [Response.buffer =... |
* Mod_caml based apache module to interpret ASP / VbScript pages in a 100 %
compatible way , including intrinsic objects and ADO
compatible way, including intrinsic objects and ADO *)
* The " real " intrinsic ASP objects are defined here , so that they can
interface with the apache API provided by Mod_caml
... |
e87c499c77549d0a844d71dfc48f16e7c8d4a99d507a9089af5ec4eb155b282e | haskell-servant/servant-swagger | TMap.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOper... | null | https://raw.githubusercontent.com/haskell-servant/servant-swagger/1909e44e965dca24cb1f5cee4b08c0781dfdbff6/src/Servant/Swagger/Internal/TypeLevel/TMap.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
$setup
>>> :set -XDataKinds
>>> :set -XFlexibleContexts
>>> :set -XGADTs
>>> :set -XRankNTypes
>>> :set -XScopedTypeVariables
>>> import D... | # LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE UndecidableInstances #
module Servant.Swagger.Internal.TypeLevel.TMap where
import Data.Proxy
import GHC.Exts (Constraint)
> > > import
... |
a998f9348767535e4ab8728cfe927bccb21cd0155a75c3cd3a83379e50c67809 | bos/stanford-cs240h | DB1.hs | {-# LANGUAGE Rank2Types #-}
module DB1 where
import DB
newtype DB c a = DB {
fromDB :: IO a
}
instance Monad (DB c) where
DB a >>= m = DB (a >>= \b -> fromDB (m b))
return a = DB (return a)
fail s = DB (fail s)
newtype SafeConn c = Safe Connection
withConnection :: Pool -> (forall c. S... | null | https://raw.githubusercontent.com/bos/stanford-cs240h/ef304e15ae74bb13bdcbb432b18519b9b24a1a14/notes/l7/DB1.hs | haskell | # LANGUAGE Rank2Types # |
module DB1 where
import DB
newtype DB c a = DB {
fromDB :: IO a
}
instance Monad (DB c) where
DB a >>= m = DB (a >>= \b -> fromDB (m b))
return a = DB (return a)
fail s = DB (fail s)
newtype SafeConn c = Safe Connection
withConnection :: Pool -> (forall c. SafeConn c -> DB c a) -> IO a... |
30e2ace8aaf898c62b36925d1288947b0a13f5f3ce2bda7a910e304ce8292a9b | aantron/luv | progress.ml | let () =
let progress = ref 0. in
let show_progress () =
Printf.printf "%i%%\n%!" (int_of_float (!progress *. 100.)) in
let notification =
Luv.Async.init (fun _ -> show_progress ()) |> Result.get_ok in
let rec do_work total n =
if n >= total then
()
else begin
Luv.Time.sleep 1000;
... | null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/example/progress.ml | ocaml | let () =
let progress = ref 0. in
let show_progress () =
Printf.printf "%i%%\n%!" (int_of_float (!progress *. 100.)) in
let notification =
Luv.Async.init (fun _ -> show_progress ()) |> Result.get_ok in
let rec do_work total n =
if n >= total then
()
else begin
Luv.Time.sleep 1000;
... | |
b1ad2bc0267d17d2305cb0835f0586ff7b21789bbdcf2d450e616cb2beef5279 | ocaml-ppx/ocamlformat | quoted_strings.ml | let foo = {%foo| foooooooooooooo |}
let foo = (* A *) ({%foo| foooooooooooooo |} (* B *) [@attr]) (* C *)
let foo = (* A *) {%foo sep| foooooooooooooo |sep}
let foo = {%foo| foooooooooooooo |} [@@attr]
let foo = {%foo| foooooooooooooo |} (* A *) [@@attr] (* B *)
let foo = ({%foo| foooooooooooooo |} [@attr]) [@@att... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/3d1c992240f7d30bcb8151285274f44619dae197/test/passing/tests/quoted_strings.ml | ocaml | A
B
C
A
A
B
A
B
A
B
A
B
A
B
A
Structures
Signatures
Multiline | let foo = {%foo| foooooooooooooo |}
let foo = {%foo| foooooooooooooo |} [@@attr]
let foo = ({%foo| foooooooooooooo |} [@attr]) [@@attr]
{%%foo| foooooooooooooo |}
{%%foo sep| foooooooooooooo |sep}
{%%M.foo| <hello>{x} |}
{%%M.foo bar| <hello>{|x|} |bar}
module type S = sig
{%%M.foo| <hello>{x} |}
{%... |
22518051b6c1f393902808067b5d7945b5332c532ec936390c65c747d5a90742 | foshardware/lsc | Logger.hs | Copyright 2018 - < >
SPDX - License - Identifier : GPL-3.0 - or - later
module LSC.Logger where
import Control.Concurrent
import Data.Time.Format
import Data.Time.LocalTime
import System.Console.Concurrent
import System.Console.Pretty
import System.IO
data LogLevel
= Silent
| Error
| Warning
| Info
... | null | https://raw.githubusercontent.com/foshardware/lsc/006c245a89b0a0056286205917438c7d031d04b9/src/LSC/Logger.hs | haskell | Copyright 2018 - < >
SPDX - License - Identifier : GPL-3.0 - or - later
module LSC.Logger where
import Control.Concurrent
import Data.Time.Format
import Data.Time.LocalTime
import System.Console.Concurrent
import System.Console.Pretty
import System.IO
data LogLevel
= Silent
| Error
| Warning
| Info
... | |
f06f7117bc80bd451f816d9776fbaa8bb8cae35a9844c0dbd8ad649c8028c0fb | promesante/hn-clj-pedestal-re-frame | db.cljs | (ns hn-clj-pedestal-re-frame.db)
(def default-db
{
; :name "re-frame"
:loading? false
:error false
:new-links []
:search-links []
:top-links []
:link {}
:count 0
; :new? false
})
| null | https://raw.githubusercontent.com/promesante/hn-clj-pedestal-re-frame/76b62dbbcc1c803c8e233809796eda75893cf7c9/src/cljs/hn_clj_pedestal_re_frame/db.cljs | clojure | :name "re-frame"
:new? false | (ns hn-clj-pedestal-re-frame.db)
(def default-db
{
:loading? false
:error false
:new-links []
:search-links []
:top-links []
:link {}
:count 0
})
|
0c6f45a6fa58fd6208cd7090f152cf324166bc058c041b5b7b21478ea3ab7081 | yzh44yzh/practical_erlang | url_parser_tests.erl | -module(url_parser_tests).
-include_lib("eunit/include/eunit.hrl").
parse_test_() ->
Tests = [
{<<"/">>,
{ok, #{protocol => <<"https">>,
domain => <<"erlangcentral.org">>,
path => [<<"books">>],
query => <<>>,
... | null | https://raw.githubusercontent.com/yzh44yzh/practical_erlang/c9eec8cf44e152bf50d9bc6d5cb87fee4764f609/15_error_processing/solution/test/url_parser_tests.erl | erlang | -module(url_parser_tests).
-include_lib("eunit/include/eunit.hrl").
parse_test_() ->
Tests = [
{<<"/">>,
{ok, #{protocol => <<"https">>,
domain => <<"erlangcentral.org">>,
path => [<<"books">>],
query => <<>>,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.