_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 |
|---|---|---|---|---|---|---|---|---|
b197f845a17569f772a8c7ccbc6a1ba7a28bdf74108bf8352b511b642c56af7f | creswick/ihaskell-notebook | GHCJ.hs | module GHCJ
where
import Control.Monad.State
import GHC
import Bag (foldrBag, lengthBag)
import qualified Data.Aeson.Generic as AE
import qualified Data.ByteString.Lazy as BL (fromChunks, ByteString)
import qualified Data.ByteString.Base64 as B64
import qualified Data.ByteString.Char8 as C8
import Types
import Evalu... | null | https://raw.githubusercontent.com/creswick/ihaskell-notebook/91dfd756d408e5cddf9b53286bca702d731b09b7/ghcj/src/GHCJ.hs | haskell | module GHCJ
where
import Control.Monad.State
import GHC
import Bag (foldrBag, lengthBag)
import qualified Data.Aeson.Generic as AE
import qualified Data.ByteString.Lazy as BL (fromChunks, ByteString)
import qualified Data.ByteString.Base64 as B64
import qualified Data.ByteString.Char8 as C8
import Types
import Evalu... | |
16807f11307db19bf8dc1afe6ba8b813027c3cebc535123a1527a7f8883ac9c5 | yrashk/socket.io-erlang | socketio_transport_polling_tests.erl | -module(socketio_transport_polling_tests).
-include_lib("eunit/include/eunit.hrl").
transport_xhr_polling_test_() ->
socketio_transport_tests:transport_tests("xhr-polling").
transport_jsonp_polling_test_() ->
socketio_transport_tests:transport_tests("jsonp-polling").
| null | https://raw.githubusercontent.com/yrashk/socket.io-erlang/7a6c768a28cf18d58efd7abe0eb276a22dbc7974/test/socketio_transport_polling_tests.erl | erlang | -module(socketio_transport_polling_tests).
-include_lib("eunit/include/eunit.hrl").
transport_xhr_polling_test_() ->
socketio_transport_tests:transport_tests("xhr-polling").
transport_jsonp_polling_test_() ->
socketio_transport_tests:transport_tests("jsonp-polling").
| |
efee9c247fd506a7abdf59259471d62e8759cd36f50430d211ec7099ee7756b4 | iconnect/api-tools | Time.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
{-# OPTIONS_GHC -Wwarn=orphans #-}
module Data.API.Time
( printUTC
, parseUTC
, parseDay
, unsafeParseUTC
, unsafeParseDay
, parseUTC_old
) where
import Control.Monad
import qualified Data.Attoparsec.Text ... | null | https://raw.githubusercontent.com/iconnect/api-tools/3d7b4dfadf82c7cb859b515d033447bd1d8ef6c6/src/Data/API/Time.hs | haskell | # LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Wwarn=orphans #
(i.e. omitting any subseconds).
milliseconds and/or @Z@ timezone indicator may optionally be omitted).
| Parser for time zone indications such as @Z@, @ UTC@ or an explicit offset
timezone designator) are assumed to be UTC. If there is an explicit offs... | # LANGUAGE ScopedTypeVariables #
module Data.API.Time
( printUTC
, parseUTC
, parseDay
, unsafeParseUTC
, unsafeParseDay
, parseUTC_old
) where
import Control.Monad
import qualified Data.Attoparsec.Text as AP
import Data.Maybe
import Data.Scientific
i... |
61c9cf1eef6a710894159ec2eaf28bf917ae9e08ec6051b44aab305cf26d1cab | paurkedal/ocaml-caqti | caqti_type_sig.mli | Copyright ( C ) 2018 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | null | https://raw.githubusercontent.com/paurkedal/ocaml-caqti/ef6005524feed833ba477a9279286eccf7ff6eaa/caqti/lib/caqti_type_sig.mli | ocaml | * Signatures for {!Caqti_type}.
* Standard type descriptors.
* {3 Composite}
The following provides constructors for narrow tuple types; to describe
wider tuple types, use nested application.
* [option t] turns a set of fields encoded as [t] into a correspending set
of nullable fields. The encode... | Copyright ( C ) 2018 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... |
9930f3952a37d045b9aa777bce606812b416c28d4e2eff06584f19b1167f9c08 | Opetushallitus/ataru | answer.cljc | (ns ataru.fixtures.answer)
(def answer
{:form 866,
:lang "fi",
:answers
[{:key "address",
:value "katu",
:fieldType "textField",
:label {:fi "Katuosoite", :sv "Adress"}}
{:key "email",
:value "",
:fieldType "textF... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/test/cljc/unit/ataru/fixtures/answer.cljc | clojure | (ns ataru.fixtures.answer)
(def answer
{:form 866,
:lang "fi",
:answers
[{:key "address",
:value "katu",
:fieldType "textField",
:label {:fi "Katuosoite", :sv "Adress"}}
{:key "email",
:value "",
:fieldType "textF... | |
704b575b7fdfd6042197a4b6be0980c90203a18714eb0c89329917ff3f220711 | jimrthy/frereth | session_socket.cljs | (ns frereth.apps.shared.session-socket
"Wires everything together"
(:require
[cljs.core.async :as async]
[clojure.spec.alpha :as s]
[frereth.apps.shared.lamport :as lamport]
[frereth.apps.shared.serialization :as serial]
[frereth.apps.shared.session :as session]
[frereth.apps.shared.socket :as web... | null | https://raw.githubusercontent.com/jimrthy/frereth/e1c4a5c031355ff1ff3bb60741eb03dff2377e1d/apps/log-viewer/src/cljs/frereth/apps/shared/session_socket.cljs | clojure |
This is a bit redundant.
The ::worker/manager consists
::worker/workers.
Then again, we should probably
treat it as a black box here.
The duplication is really just
an implementation detail.
Implementation
Most of these should probably move into socket.
Since this ns is about coordinating those.
Q: What *i... | (ns frereth.apps.shared.session-socket
"Wires everything together"
(:require
[cljs.core.async :as async]
[clojure.spec.alpha :as s]
[frereth.apps.shared.lamport :as lamport]
[frereth.apps.shared.serialization :as serial]
[frereth.apps.shared.session :as session]
[frereth.apps.shared.socket :as web... |
3a3c6a019c1a36eba028ff058da5b1f1d0afd6678c47cd9c62124d2e603f9860 | maximedenes/native-coq | scheme.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/plugins/extraction/scheme.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
val scheme_descr : Miniml.lan... |
f061471977ea7f5239972117ec089b2ea3a6b116bfbcf6163527da652222c112 | roburio/udns | dns_certify.ml | open Dns
let dns_header rng =
let id = Randomconv.int16 rng in
(id, Packet.Flags.empty)
let letsencrypt_name name =
match Domain_name.(prepend_label (raw name) "_tcp") with
| Ok name' -> Domain_name.prepend_label name' "_letsencrypt"
| Error e -> Error e
type u_err = [ `Tsig of Dns_tsig.e | `Bad_reply of P... | null | https://raw.githubusercontent.com/roburio/udns/585c40933ac3d5eceb351f7edd3f45cf2615a9f8/certify/dns_certify.ml | ocaml | open Dns
let dns_header rng =
let id = Randomconv.int16 rng in
(id, Packet.Flags.empty)
let letsencrypt_name name =
match Domain_name.(prepend_label (raw name) "_tcp") with
| Ok name' -> Domain_name.prepend_label name' "_letsencrypt"
| Error e -> Error e
type u_err = [ `Tsig of Dns_tsig.e | `Bad_reply of P... | |
1bbf842057323b65d08426c7ef00e76ae4a7d7913bb6f72526fe4c1d68d6aef1 | huiyaozheng/Mirage-zmq | unikernel.ml | open Lwt.Infix
open Mirage_zmq
module Main (S: Mirage_stack_lwt.V4) = struct
let start s =
let context = Context.create_context () in
let module Socket = Socket_tcp (S) in
let socket = Socket.create_socket context PULL in
Socket.connect socket "127.0.0.1" 5556 s >>= fun () ->
... | null | https://raw.githubusercontent.com/huiyaozheng/Mirage-zmq/af288a3378a7c357bd5646a3abf4fd5ae777369b/test/PULL/unikernel/unikernel.ml | ocaml | open Lwt.Infix
open Mirage_zmq
module Main (S: Mirage_stack_lwt.V4) = struct
let start s =
let context = Context.create_context () in
let module Socket = Socket_tcp (S) in
let socket = Socket.create_socket context PULL in
Socket.connect socket "127.0.0.1" 5556 s >>= fun () ->
... | |
496afe431a56bf0822bfb50c19d4c22a925883cd649468ba2bca3e941ee7fa3c | yakaz/yamerl | ex_6.29_node_anchors.erl | -module('ex_6.29_node_anchors').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
59,
true,
[],
0,
60,
3,
... | null | https://raw.githubusercontent.com/yakaz/yamerl/0032607a7b27fa2b548fc9a02d7ae6b53469c0c5/test/parsing/ex_6.29_node_anchors.erl | erlang | -module('ex_6.29_node_anchors').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
59,
true,
[],
0,
60,
3,
... | |
ed396e4f14f0e6893b0710fafebe60d1d24c46749bf363bc687b57cf1d9568c7 | headwinds/reagent-reframe-material-ui | events.cljs | (ns example.demos.table.events
(:require [re-frame.core :as re]
[clojure.string :as str]
[example.utils.js :refer [log records-as-vec]]
[example.utils.http-fx :as http :refer [GET POST PATCH PUT set-location]]))
;; ---- HTTP REQUESTS ---------------------------------------------... | null | https://raw.githubusercontent.com/headwinds/reagent-reframe-material-ui/8a6fba82a026cfedca38491becac85751be9a9d4/src/example/demos/table/events.cljs | clojure | ---- HTTP REQUESTS ----------------------------------------------------------
---- SET DB ---------------------------------------------------------- | (ns example.demos.table.events
(:require [re-frame.core :as re]
[clojure.string :as str]
[example.utils.js :refer [log records-as-vec]]
[example.utils.http-fx :as http :refer [GET POST PATCH PUT set-location]]))
(re/reg-event-fx :get-people
[(when ^boolean goog.DEBUG re/deb... |
19230f66fb651f84d6efdde29a03d1f000173357d7f82ba5f7dc934671a84477 | fulcrologic/fulcro-spec | spec.cljc | (ns fulcro-spec.spec
(:require
[clojure.spec.alpha :as s]))
(defn conform! [spec x]
(let [rt (s/conform spec x)]
(when (s/invalid? rt)
(throw (ex-info (s/explain-str spec x)
(s/explain-data spec x))))
rt))
(s/def ::any (constantly true))
(defn regex? [x] (= (type x) (type #"")))
... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-spec/ef3fece4a2562590547fe12f27f135148fda65cf/src/main/fulcro_spec/spec.cljc | clojure | (ns fulcro-spec.spec
(:require
[clojure.spec.alpha :as s]))
(defn conform! [spec x]
(let [rt (s/conform spec x)]
(when (s/invalid? rt)
(throw (ex-info (s/explain-str spec x)
(s/explain-data spec x))))
rt))
(s/def ::any (constantly true))
(defn regex? [x] (= (type x) (type #"")))
... | |
0f1884382c1c3c5ccfc6a5982332bc597d912c86da1e9302010f094b01347f74 | shirok/Gauche | line-editor.scm | ;;
;; Sample of text.line-edit
;;
;; Just reads a line at a time and echoes back.
(use text.console)
(use text.line-edit)
(use gauche.listener :only (complete-sexp?))
(define (main args)
(let* ([con (guard (e [else (exit 1 (condition-message e))])
(make-default-console))]
[count 0]
... | null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/examples/line-editor.scm | scheme |
Sample of text.line-edit
Just reads a line at a time and echoes back. |
(use text.console)
(use text.line-edit)
(use gauche.listener :only (complete-sexp?))
(define (main args)
(let* ([con (guard (e [else (exit 1 (condition-message e))])
(make-default-console))]
[count 0]
[ctx (make <line-edit-context>
:console con
:pro... |
20dad8183ab908b5a223aa9013b8a818a7de5a3de36bd65907d6ab18c9c557ed | imandra-ai/catapult | basic.ml | module Tr = Catapult.Tracing
let spf = Printf.sprintf
let rec fake_trace depth =
if depth >= 3 then
()
else
Tr.with_ "step" @@ fun () ->
Thread.delay 0.1;
Printf.printf "fake (depth=%d)\n%!" depth;
fake_trace (depth + 1);
Thread.delay 0.2;
Tr.instant "iteration.done" ~args:[ "depth", `... | null | https://raw.githubusercontent.com/imandra-ai/catapult/4bc5444a8471c5d0d7cb9a376a5a895c0ab042e6/examples/file/basic.ml | ocaml | module Tr = Catapult.Tracing
let spf = Printf.sprintf
let rec fake_trace depth =
if depth >= 3 then
()
else
Tr.with_ "step" @@ fun () ->
Thread.delay 0.1;
Printf.printf "fake (depth=%d)\n%!" depth;
fake_trace (depth + 1);
Thread.delay 0.2;
Tr.instant "iteration.done" ~args:[ "depth", `... | |
78dc6e1f0fd5fae09262f05f3f57399eea4a9e4411d620bac93eeab1aefdbbdd | alexandergunnarson/quantum | cache.cljc | (ns quantum.core.cache
(:refer-clojure :exclude [memoize])
(:require
[quantum.untyped.core.cache :as u]
[quantum.untyped.core.vars :as uvar
:refer [defaliases]]))
(defaliases u
memoize* memoize #?(:clj defmemoized)
callable-times
init! clear!)
| null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/core/cache.cljc | clojure | (ns quantum.core.cache
(:refer-clojure :exclude [memoize])
(:require
[quantum.untyped.core.cache :as u]
[quantum.untyped.core.vars :as uvar
:refer [defaliases]]))
(defaliases u
memoize* memoize #?(:clj defmemoized)
callable-times
init! clear!)
| |
dc995019d910a0fcf1d5a158022397eb2cb82a36ae71c79d5021004bad51f85a | jlouis/etorrent_core | etorrent_ext.erl | -module(etorrent_ext).
-export([new/2,
extension_list/1,
handle_handshake_respond/2,
decode_msg/3,
encode_msg/3,
is_locally_supported/2]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-type ext_id() :: 1 .. 255.
-type ext_name() :: atom().
-type ext_mod_n... | null | https://raw.githubusercontent.com/jlouis/etorrent_core/7db7f4ef36c1d055812504f00df92c6a67c2e4af/src/etorrent_ext.erl | erlang | Local id => name as atom
Name as atom => remote id
======================================================================
Disable public-only extensions, if it is a private torrent.
Add them.
Generate <<"m">> block of the extension-handshake.
======================================================================... | -module(etorrent_ext).
-export([new/2,
extension_list/1,
handle_handshake_respond/2,
decode_msg/3,
encode_msg/3,
is_locally_supported/2]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-type ext_id() :: 1 .. 255.
-type ext_name() :: atom().
-type ext_mod_n... |
9db5f8466953cf5ec0cfe5bf24adc922161c81e4e41f444e87da21910e54b9d8 | spurious/sagittarius-scheme-mirror | slatex.scm | ;;; SLATEX -- Scheme to Latex processor.
;slatex.scm file generated using config.scm
;This file is compatible for the dialect other
( c ) , , 1991 , 1994
(define *op-sys* 'unix)
(define slatex.ormap
(lambda (f l)
(let loop ((l l)) (if (null? l) #f (or (f (car l)) (loop (cdr l)))))))
(define slatex.ormapcd... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/bench/gambit-benchmarks/slatex.scm | scheme | SLATEX -- Scheme to Latex processor.
slatex.scm file generated using config.scm
This file is compatible for the dialect other
)
)
)))))
)))
)
slatex.subjobname
slatex.subjobname
(newline)
(display "typesetting code")
(display 'done)
(newline)
(display ".")
(displ... |
( c ) , , 1991 , 1994
(define *op-sys* 'unix)
(define slatex.ormap
(lambda (f l)
(let loop ((l l)) (if (null? l) #f (or (f (car l)) (loop (cdr l)))))))
(define slatex.ormapcdr
(lambda (f l)
(let loop ((l l)) (if (null? l) #f (or (f l) (loop (cdr l)))))))
(define slatex.append!
(lambda (l1 l2)
... |
02ab8912891493a430e6dbdbdc9f639128d9ec0c447668d130e20730bf206871 | scicloj/clj-djl | optimizer.clj | (ns clj-djl.training.optimizer
(:import [ai.djl.training.optimizer Optimizer]))
(defn set-learning-rate-tracker [builder tracker]
(.setLearningRateTracker builder tracker))
(defn build [builder]
(.build builder))
(defn sgd
([]
(Optimizer/sgd))
([{:keys [tracker momentum weight-decay]}]
(cond-> (Opti... | null | https://raw.githubusercontent.com/scicloj/clj-djl/f089b10a22c869c0e643d456dc9bbad8233bd6ac/src/clj_djl/training/optimizer.clj | clojure | (ns clj-djl.training.optimizer
(:import [ai.djl.training.optimizer Optimizer]))
(defn set-learning-rate-tracker [builder tracker]
(.setLearningRateTracker builder tracker))
(defn build [builder]
(.build builder))
(defn sgd
([]
(Optimizer/sgd))
([{:keys [tracker momentum weight-decay]}]
(cond-> (Opti... | |
2e81f0d9525ea1ea69f18d71fd29da14f13207c6613c9f68bdd4acfb8b548124 | samirose/sicp-compiler-project | wasm-syntax.scm | (define-library (wasm-syntax)
(export wasm-definition-type wasm-definition-type?
wasm-elem-definition-func-index
wasm-const-value?
wasm-define-locals wasm-locals-definition? wasm-local-definitions-to-top
wasm-import-definition?)
(import (scheme base)
(lists)
... | null | https://raw.githubusercontent.com/samirose/sicp-compiler-project/d822e18bfd8088a3e9381c778511601ec0460b00/wasm-syntax.scm | scheme | (define-library (wasm-syntax)
(export wasm-definition-type wasm-definition-type?
wasm-elem-definition-func-index
wasm-const-value?
wasm-define-locals wasm-locals-definition? wasm-local-definitions-to-top
wasm-import-definition?)
(import (scheme base)
(lists)
... | |
72854ab463cc2664b0cd052e17fdc7ab595f82185aeb94d0ef6ca3d701f503ab | mirage/irmin | store.ml |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | null | https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/libirmin/store.ml | ocaml |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | |
0a3cc34f6f97cf4c1772b42a0377a35b5972a8358a37a6ae68c654e341db3e20 | rmloveland/scheme48-0.53 | scan-package.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; Scanning structures and processing package clauses.
; Utility for compile-structures (link/link.scm) and
; ensure-loaded (env/load-package.scm).
;
Returns a list of all packages reachable from STRUCTS that answer true to
; INCLUDE-THIS-PACKAGE?.
(defi... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/bcomp/scan-package.scm | scheme | Scanning structures and processing package clauses.
Utility for compile-structures (link/link.scm) and
ensure-loaded (env/load-package.scm).
INCLUDE-THIS-PACKAGE?.
Walk through PACKAGE's clauses to find the source code. The relevent
clauses are:
(file name ...)
(begin form ...)
(define-all-operators)
... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
Returns a list of all packages reachable from STRUCTS that answer true to
(define (collect-packages structs include-this-package?)
(let ((package-seen '())
(structure-seen '())
(packages '()))
(letrec ((recur
(lambda (structure)
(if (no... |
6daa8c224283049193a1cd168578a2ccf760dd57cd4de42c82bfcf7a6b00b52f | GaloisInc/language-sally | Sally.hs | -- |
Module : Language .
Description : Tools for building and pretty - printing programs
Copyright : ( c ) Galois Inc , 2020
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- |
module Language.Sally
( module Language.Sally.SExp,
module Language.Sally.Types,
)
where
im... | null | https://raw.githubusercontent.com/GaloisInc/language-sally/e269674830cbd83f6f0249d944d4bcdc5739b180/src/Language/Sally.hs | haskell | |
License : BSD3
Maintainer :
Stability : experimental
| | Module : Language .
Description : Tools for building and pretty - printing programs
Copyright : ( c ) Galois Inc , 2020
module Language.Sally
( module Language.Sally.SExp,
module Language.Sally.Types,
)
where
import Language.Sally.SExp
import Language.Sally.Types
|
7e79bb4ddb5de556fbd37fa5755addce95f59db271da5cfc92181f00c0c949d5 | mput/sicp-solutions | 2_64.rkt | #lang racket
Solution for exercise 2_64 .
(require rackunit "../solutions/2_63.rkt")
(provide list->tree)
(define (list->tree elements)
(car (partial-tree elements (length elements))))
(define (partial-tree elts n)
(if (= n 0)
(cons '() elts)
(let ((left-size (quotient (- n 1) 2)))
(let ((... | null | https://raw.githubusercontent.com/mput/sicp-solutions/fe12ad2b6f17c99978c8fe04b2495005986b8496/solutions/2_64.rkt | racket | #lang racket
Solution for exercise 2_64 .
(require rackunit "../solutions/2_63.rkt")
(provide list->tree)
(define (list->tree elements)
(car (partial-tree elements (length elements))))
(define (partial-tree elts n)
(if (= n 0)
(cons '() elts)
(let ((left-size (quotient (- n 1) 2)))
(let ((... | |
22b8502b48b51c9ba49ab1f13e6f8023ef56d47c03b100d1ac2d768e2072d754 | facebookarchive/duckling_old | time.clj | (
; Context map
Tuesday Feb 12 , 2013 at 4:30am is the " now " for the tests
{:reference-time (time/t -2 2013 2 12 4 30 0)}
"现在"
"此时"
"此刻"
"当前"
"現在"
"此時"
"當前"
(datetime 2013 2 12 4 30 00)
"今天"
(datetime 2013 2 12)
"昨天"
(datetime 2013 2 11)
"明天"
(datetime 2013 2 13)
"后天"
"後天"... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/zh/corpus/time.clj | clojure | Context map | (
Tuesday Feb 12 , 2013 at 4:30am is the " now " for the tests
{:reference-time (time/t -2 2013 2 12 4 30 0)}
"现在"
"此时"
"此刻"
"当前"
"現在"
"此時"
"當前"
(datetime 2013 2 12 4 30 00)
"今天"
(datetime 2013 2 12)
"昨天"
(datetime 2013 2 11)
"明天"
(datetime 2013 2 13)
"后天"
"後天"
(datetime 201... |
3bb37baf4c1ef7d8c6dff0d3eb6c4db0454aca155d6f50cb836362656822c3a1 | f-me/carma-public | Satisfaction.hs | # LANGUAGE TemplateHaskell #
module Carma.Model.Satisfaction where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Data.Model.TH
import Carma.Model.Types()
import Carma.Model.PgTypes()
data Satisfaction = Satisfaction
{ ident
:: PK Int Satisfaction "Удовлетворённость кли... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/carma-models/src/Carma/Model/Satisfaction.hs | haskell | # LANGUAGE TemplateHaskell #
module Carma.Model.Satisfaction where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Data.Model.TH
import Carma.Model.Types()
import Carma.Model.PgTypes()
data Satisfaction = Satisfaction
{ ident
:: PK Int Satisfaction "Удовлетворённость кли... | |
67f1a8e57409746015e0e6f64154e3a842e6109bb9c96b496490dcccb42e3ed4 | g000001/MacLISP-compat | DESCRIBE.lisp | ;;; DESCRI -*-LISP-*-
;;; ***************************************************************
* * * * * * * * * * * DECRIBE Function * * * * * * * * * * * * * * * * * * * * * * * * *
;;; ***************************************************************
* * ( C ) COPYRIGHT 1981 MASSACHUSETTS INSTITUTE... | null | https://raw.githubusercontent.com/g000001/MacLISP-compat/a147d09b98dca4d7c089424c3cbaf832d2fd857a/DESCRIBE.lisp | lisp | DESCRI -*-LISP-*-
***************************************************************
***************************************************************
****** THIS IS A READ-ONLY FILE! (ALL WRITES REVERSED) ********
***************************************************************
DESCRIBE -- Function... | * * * * * * * * * * * DECRIBE Function * * * * * * * * * * * * * * * * * * * * * * * * *
* * ( C ) COPYRIGHT 1981 MASSACHUSETTS INSTITUTE OF TECHNOLOGY * * *
(herald DESCRIBE /3)
(declare (setq USE-STRT7 'T MACROS () ))
(defun LISPDIR macro (x)
`(QUOTE ((LISP) ,(cadr x) #+Pdp10 FASL)))
(defun SUBLOAD... |
3d9be938c300dacab360cdf40b2f9eb2388b8ab408047150fb4841bff77a42c9 | McParen/croatoan | wresize.lisp | (in-package :de.anvi.croatoan)
(defun resize (window height width)
(let ((winptr (winptr window)))
(ncurses:wresize winptr height width)))
| null | https://raw.githubusercontent.com/McParen/croatoan/413e8855b78a2e408f90efc38e8485f880691684/src/wresize.lisp | lisp | (in-package :de.anvi.croatoan)
(defun resize (window height width)
(let ((winptr (winptr window)))
(ncurses:wresize winptr height width)))
| |
d71b04e597ea7da4d78b4b7c3aabf8a70ca483a558227875268f573f28e345d0 | srfoster/codespells | test-mod-lore.rkt | #lang at-exp racket
(require test-mod
codespells/lore)
(define-rune-collection-lore
#:name "A Cool Name for TestMod"
#:description
@md{
A cool intro about TestMod
}
#:rune-lores
(list)
#:preview-image preview.png)
| null | https://raw.githubusercontent.com/srfoster/codespells/82c99d81611288b9ae92e5e290951e2a69bec869/modding/test-mod-lore.rkt | racket | #lang at-exp racket
(require test-mod
codespells/lore)
(define-rune-collection-lore
#:name "A Cool Name for TestMod"
#:description
@md{
A cool intro about TestMod
}
#:rune-lores
(list)
#:preview-image preview.png)
| |
289d5e27a51f36ddfd4aced929e38c4b9922a82e0893f5ca7b30a6ba2d951949 | janestreet/universe | test.ml | module Monad_example = struct
module X : sig
type 'a t
module Let_syntax : sig
val return : 'a -> 'a t
module Let_syntax : sig
val return : 'a -> 'a t
val bind : 'a t -> f:('a -> 'b t) -> 'b t
val map : 'a t -> f:('a -> 'b) -> 'b t
val both : 'a t -> 'b t -> ('a *... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/ppx_let/test/test.ml | ocaml | {[
let _af a : _ X.t =
let%bind x = a in (* "Error: Unbound value Let_syntax.bind"
{[
let _af' a b c : _ X.t =
let%bind x = a and y = b and (u, v) = c in (* "Error: Unbound value Let_syntax.bind"
"Error: Unbound value Let_syntax.bind" | module Monad_example = struct
module X : sig
type 'a t
module Let_syntax : sig
val return : 'a -> 'a t
module Let_syntax : sig
val return : 'a -> 'a t
val bind : 'a t -> f:('a -> 'b t) -> 'b t
val map : 'a t -> f:('a -> 'b) -> 'b t
val both : 'a t -> 'b t -> ('a *... |
da9e04a92494867cc0b1183365c9cac42aeec058ea23a94e1b390943cf8feae3 | huangjs/cl | scs.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The data in this file contains enhancments. ;;;;;
;;; ;;;;;
... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/src/scs.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
The data in this file contains enhancments. ;;;;;
;;;;;
; ; ; ;
All rights reserved ;;;;;
; ;
|
(in-package :maxima)
(macsyma-module scs)
(defmfun $scsimp (expr &rest rules)
(scs expr (mapcar #'meqhk rules)))
(defun scs (x zrs)
(do ((flag t) (sz (conssize x)) (nx) (nsz))
((not flag) x)
(do ((l zrs (cdr l)))
((null l) (setq flag nil))
(setq nx (subscs 0 (car l) x) nsz (conssize nx))
... |
b60b226b550727aa08a45ea0660ef45d278daa78a1dbaf94cb853c7cba93db9b | Opetushallitus/ataru | repeater_checkbox_component.cljs | (ns ataru.virkailija.editor.components.repeater-checkbox-component
(:require [ataru.cljs-util :as util]
[re-frame.core :refer [subscribe dispatch]]))
(defn repeater-checkbox
[path initial-content]
(let [id (util/new-uuid)
checked? (-> initial-content :params :repeatabl... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/src/cljs/ataru/virkailija/editor/components/repeater_checkbox_component.cljs | clojure | (ns ataru.virkailija.editor.components.repeater-checkbox-component
(:require [ataru.cljs-util :as util]
[re-frame.core :refer [subscribe dispatch]]))
(defn repeater-checkbox
[path initial-content]
(let [id (util/new-uuid)
checked? (-> initial-content :params :repeatabl... | |
41e454815d9c339f6094089d6fd431f450da1f808bcb2c09f703318d5fe9661b | wdebeaum/DeepSemLex | suffer.lisp | ;;;;
;;;; W::suffer
;;;;
(define-words :pos W::V :TEMPL AGENT-FORMAL-XP-TEMPL
:words (
; )
(W::suffer
(wordfeats (W::morph (:forms (-vb) :past W::suffered :ing w::suffering)))
(SENSES
((meta-data :origin "verbnet-1.5" :entry-date 20051219 :change-date 20090511 :comments nil :vn ("admire-31.2") :wn ("suf... | null | https://raw.githubusercontent.com/wdebeaum/DeepSemLex/ce0e7523dd2b1ebd42b9e88ffbcfdb0fd339aaee/trips/src/LexiconManager/Data/new/suffer.lisp | lisp |
W::suffer
) |
(define-words :pos W::V :TEMPL AGENT-FORMAL-XP-TEMPL
:words (
(W::suffer
(wordfeats (W::morph (:forms (-vb) :past W::suffered :ing w::suffering)))
(SENSES
((meta-data :origin "verbnet-1.5" :entry-date 20051219 :change-date 20090511 :comments nil :vn ("admire-31.2") :wn ("suffer%2:29:00" "suffer%2:29:03" "... |
9928e2c82eab0d231f326ed98ed886eb106422c499928f5091cde88b3225eabc | racket/old-plt | getter-setter.scm | ;; This library is used by match.ss
(module getter-setter mzscheme
(provide getter setter)
(require "coupling-and-binding.scm"
"match-helper.ss"
"match-error.ss"
(lib "stx.ss" "syntax"))
(require-for-template
mzscheme
"coupling-and-binding.scm"
"match-helper.ss"
"mat... | null | https://raw.githubusercontent.com/racket/old-plt/a580d75deae2a0d2f3d8a93bc3c4f8f1f619b5b7/collects/mzlib/private/getter-setter.scm | scheme | This library is used by match.ss
!(function setter
(form (setter e ident let-bound) -> syntax)
(contract (syntax syntax list) -> syntax)
(example (setter (syntax (car x)) (syntax here) '())
->
(syntax (lambda (y) (set-car! x y)))))
This function takes an expr... |
(module getter-setter mzscheme
(provide getter setter)
(require "coupling-and-binding.scm"
"match-helper.ss"
"match-error.ss"
(lib "stx.ss" "syntax"))
(require-for-template
mzscheme
"coupling-and-binding.scm"
"match-helper.ss"
"match-error.ss"
(lib "stx.ss" "synta... |
5c08745025ff0d826ef77273f35f5b237745e2476b1b2f5fc9d07da14eaa1c5b | 8c6794b6/guile-tjit | x-graphs.scm | ;;; Graphs from racket benchmark.
;;; ==== std.ss ====
; (define-syntax assert
; (syntax-rules ()
; ((assert test info-rest ...)
; #f)))
;
; (define-syntax deny
; (syntax-rules ()
; ((deny test info-rest ...)
; #f)))
;
; (define-syntax when
; (syntax-rules ()
( ( wh... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/x-graphs.scm | scheme | Graphs from racket benchmark.
==== std.ss ====
(define-syntax assert
(syntax-rules ()
((assert test info-rest ...)
#f)))
(define-syntax deny
(syntax-rules ()
((deny test info-rest ...)
#f)))
(define-syntax when
(syntax-rules ()
(if test
... |
( ( when test e - first e - rest ... )
( ( unless test e - first e - rest ... )
Fold over list elements , associating to the left .
(define fold
(lambda (lst folder state)
'(assert (list? lst)
lst)
'(assert (procedure? folder)
folder)
(do ((lst ... |
5aea8844e6bd5d81430350a57c5f1916dc0bd02b89a21f599d8403049890813c | hstreamdb/hstream | ServerSql.hs | # LANGUAGE FlexibleInstances #
module HStream.Admin.Server.Command.ServerSql
( HStreamQuery
, newHStreamQuery
, serverSqlRepl
) where
import Control.Monad.IO.Class (liftIO)
import Data.Char (toLower, toUpper)
import Data.List (isPrefixOf)
im... | null | https://raw.githubusercontent.com/hstreamdb/hstream/efb859d3e9433c61ba72f35469612f5476b8be96/hstream-admin/server/HStream/Admin/Server/Command/ServerSql.hs | haskell | ----------------------------------------------------------------------------- | # LANGUAGE FlexibleInstances #
module HStream.Admin.Server.Command.ServerSql
( HStreamQuery
, newHStreamQuery
, serverSqlRepl
) where
import Control.Monad.IO.Class (liftIO)
import Data.Char (toLower, toUpper)
import Data.List (isPrefixOf)
im... |
cc9432f962358782584f94a1977a2627c5d3b4b499009512423f47360aaa1825 | Helium4Haskell/helium | AppSubterm2.hs | module AppSubterm2 where
f :: Int -> Int -> Int -> Int
f a b c = 2 * (2 * a + b) + c
main :: Int -> Int
main x = f 0 (x==1) x
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/typeerrors/Heuristics/AppSubterm2.hs | haskell | module AppSubterm2 where
f :: Int -> Int -> Int -> Int
f a b c = 2 * (2 * a + b) + c
main :: Int -> Int
main x = f 0 (x==1) x
| |
70ab1bd3d7a00e013ad9156415f52726d95483bf6994609b0e86b09cee2bb8bd | nuprl/gradual-typing-performance | search.rkt | (module search racket/base
(require "struct.rkt"
"basic.rkt"
syntax/modcode)
(provide find-racket-tag
(rename-out [find-racket-tag find-scheme-tag]))
(define module-info-cache (make-hasheq))
(define (module-path-index-rejoin mpi rel-to)
(let-values ([(name base) (module-p... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/scribble-lib/scribble/search.rkt | racket | The phase-level argument is used only when `stx/binding'
is an identifier.
Note: documentation keys currently don't distinguish different
phase definitions of an identifier from a source module.
That is, there's no way to document (define x ....) differently
from (define-for-syntax x ...). This isn't a problem i... | (module search racket/base
(require "struct.rkt"
"basic.rkt"
syntax/modcode)
(provide find-racket-tag
(rename-out [find-racket-tag find-scheme-tag]))
(define module-info-cache (make-hasheq))
(define (module-path-index-rejoin mpi rel-to)
(let-values ([(name base) (module-p... |
1313304369f1aef84f5ca8f707be84c73b10178523ae799bea1fac7e153f1888 | Yuras/pdf-toolbox | Stream.hs | {-# LANGUAGE OverloadedStrings #-}
module Test.Stream
(
spec
)
where
import Control.Monad
import qualified System.IO.Streams as Streams
import qualified System.IO.Streams.Attoparsec as Streams
import Pdf.Core.Stream
import Test.Hspec
spec :: Spec
spec = describe "Stream" $ do
describe "readStream" $ do
it ... | null | https://raw.githubusercontent.com/Yuras/pdf-toolbox/f1d20479fe6782bc293468ac05186e658216388b/core/test/Test/Stream.hs | haskell | # LANGUAGE OverloadedStrings # |
module Test.Stream
(
spec
)
where
import Control.Monad
import qualified System.IO.Streams as Streams
import qualified System.IO.Streams.Attoparsec as Streams
import Pdf.Core.Stream
import Test.Hspec
spec :: Spec
spec = describe "Stream" $ do
describe "readStream" $ do
it "should throw ParseException when i... |
94076c6f613db03a118ec76ef7e2aa363109bd5220a52eaea9e81f1d67ba8d1a | PacktWorkshops/The-Clojure-Workshop | repl.clj | (require '[clojure.test :as test :refer [is are deftest run-tests]])
(def supported-currencies #{"Dollar" "Japanese yen" "Euro" "Indian rupee" "British pound"})
(deftest exercise-203-test
(is (= "Dollar" (get supported-currencies "Dollar")))
(is (= nil (get supported-currencies "Swiss franc")))
(is (= true (con... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter02/tests/Exercise2.03/repl.clj | clojure | (require '[clojure.test :as test :refer [is are deftest run-tests]])
(def supported-currencies #{"Dollar" "Japanese yen" "Euro" "Indian rupee" "British pound"})
(deftest exercise-203-test
(is (= "Dollar" (get supported-currencies "Dollar")))
(is (= nil (get supported-currencies "Swiss franc")))
(is (= true (con... | |
2fc25db690a5ea66bcba4daf5f321c5604bd1b74d679baf2d3b38955cbc6780e | LastStar/showrum | events_test.cljs | (ns showrum.events-test
(:require-macros [cljs.test :refer [deftest testing is are]])
(:require [showrum.events :as sut]
[potok.core :as ptk]
[beicon.core :as rxt]
[cljs.test :as t :include-macros true]))
FIXME : get initial state from showrum.store
(defonce fixture
{:db/init
... | null | https://raw.githubusercontent.com/LastStar/showrum/fb73e9612e4525e32b6b936179d901be50019fb5/test/cljs/showrum/events_test.cljs | clojure | (ns showrum.events-test
(:require-macros [cljs.test :refer [deftest testing is are]])
(:require [showrum.events :as sut]
[potok.core :as ptk]
[beicon.core :as rxt]
[cljs.test :as t :include-macros true]))
FIXME : get initial state from showrum.store
(defonce fixture
{:db/init
... | |
78e3720fb9b324e5b3aff98a5d38e9b2833dcba24a9a5ea7c3a3f62f82667d12 | AndrasKovacs/flat-maybe | Flat.hs | # LANGUAGE MagicHash , PatternSynonyms , ViewPatterns ,
RoleAnnotations , UnboxedTuples , BangPatterns , KindSignatures ,
DeriveDataTypeable , ScopedTypeVariables #
RoleAnnotations, UnboxedTuples, BangPatterns, KindSignatures,
DeriveDataTypeable, ScopedTypeVariables #-}
module Data.Maybe.Flat (
May... | null | https://raw.githubusercontent.com/AndrasKovacs/flat-maybe/40952a5a8eb05ec4f9812433a32a8e0e7697a402/Data/Maybe/Flat.hs | haskell | # LANGUAGE MagicHash , PatternSynonyms , ViewPatterns ,
RoleAnnotations , UnboxedTuples , BangPatterns , KindSignatures ,
DeriveDataTypeable , ScopedTypeVariables #
RoleAnnotations, UnboxedTuples, BangPatterns, KindSignatures,
DeriveDataTypeable, ScopedTypeVariables #-}
module Data.Maybe.Flat (
May... | |
8b91533238afcec810428f468d861d8ca9e027b62c6bac9ce64c00f5efd3f06d | larandaA/hgraphs | MstSpec.hs | {-# LANGUAGE RankNTypes #-}
module Data.Graph.Abstract.Accessor.Algorithm.MstSpec (spec) where
import Control.Monad
import qualified Data.Graph.Abstract as GA
import qualified Data.Graph.Abstract.Accessor as GAA
import qualified Data.Graph.Abstract.Accessor.Algorithm.Mst as Mst
import qualified Data.Graph.Abs... | null | https://raw.githubusercontent.com/larandaA/hgraphs/322b5cdfafbae851b4251c907e2c81b82cf02d4a/test/Data/Graph/Abstract/Accessor/Algorithm/MstSpec.hs | haskell | # LANGUAGE RankNTypes # |
module Data.Graph.Abstract.Accessor.Algorithm.MstSpec (spec) where
import Control.Monad
import qualified Data.Graph.Abstract as GA
import qualified Data.Graph.Abstract.Accessor as GAA
import qualified Data.Graph.Abstract.Accessor.Algorithm.Mst as Mst
import qualified Data.Graph.Abstract.Builder as GAB
import ... |
12fa399d2976112d8a349d3581120efd2b721eff244e0fd3f0d49e2f9861a05a | gregr/dbKanren | shortest-path.rkt | #lang racket/base
(provide m.shortest-path)
(require "base.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Define program modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-dbk m.shortest-path
(link m.base)
(relation (edge source target distance)
indexes ((target source)))
;; Guard against cyclic data
(<<= (rea... | null | https://raw.githubusercontent.com/gregr/dbKanren/3a996bced9d638259e9389b2be2065d78ba63ee9/dbk/old/example/shortest-path.rkt | racket |
Define program modules
Guard against cyclic data
This relation will be infinitely large if edge describes a cyclic graph.
To support cyclic data, we can rewrite this to stratify across time steps,
stopping when there are no more improvements made during a single tick.
TODO: It might be possible to avoid stratif... | #lang racket/base
(provide m.shortest-path)
(require "base.rkt")
(define-dbk m.shortest-path
(link m.base)
(relation (edge source target distance)
indexes ((target source)))
(<<= (reachable s t) (edge s t _))
(<<= (reachable s t) (exist (mid)
(edge s mid _) (reachable mid t)))
... |
58c717de10031ed5722e176d2ad71d46bc3156f8e8b0e77a1ea0768e45c9dbf2 | bmeurer/ocamljit2 | obj.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/stdlib/obj.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 GNU Library General Public License , with
$ Id$
Operations on internal repre... |
223a7bfa3d41970cf15ca622220f1a20aaa342cdb897730237b23fd3dac45c10 | GaloisInc/LIMA | Threshold.hs | -- |
-- Module: Threshold
-- Description: Time integrated threshold functions
Copyright : ( c ) 2013 Lee Pike
--
Time integrated threshold functions typically used in condition monitoring .
module Language.LIMA.Common.Threshold
( boolThreshold
, doubleThreshold
) where
import Language.LIMA.Expressions
imp... | null | https://raw.githubusercontent.com/GaloisInc/LIMA/8006bb52b2fb5d3264fe55ef8c9b7c89ab7f4630/lima/src/Language/LIMA/Common/Threshold.hs | haskell | |
Module: Threshold
Description: Time integrated threshold functions
| Boolean thresholding over time. Output is set when internal counter hits
limit, and cleared when counter is 0.
| Integrating threshold. Output is set with integral reaches limit, and
cleared when integral reaches 0.
TODO: Figure out what ... | Copyright : ( c ) 2013 Lee Pike
Time integrated threshold functions typically used in condition monitoring .
module Language.LIMA.Common.Threshold
( boolThreshold
, doubleThreshold
) where
import Language.LIMA.Expressions
import Language.LIMA.Language
import Data.Int (Int32)
boolThreshold :: Name -> In... |
03700294fff7a824222b5366ed73d438dcfecadab962c635eac02d097ba140ab | ebresafegaga/tina | typecheck.ml | open Syntax
open Naming
module A = Ast
module T = Type
let report_expected_at ~expected ~got ~loc =
let msg =
Printf.sprintf "Expected a %s but got a %s at %s" (T.pp_ty expected)
(T.pp_ty got) (Loc.pp loc)
in
Errors.runtime msg
let report_error_at msg loc =
let msg = Printf.sprintf "%s at %s" msg (L... | null | https://raw.githubusercontent.com/ebresafegaga/tina/66fa8daa66c0c6e65260bbea3e8e2ddcc2f9d2d0/typing/typecheck.ml | ocaml | check that all labels of fields_ty is present in fields | open Syntax
open Naming
module A = Ast
module T = Type
let report_expected_at ~expected ~got ~loc =
let msg =
Printf.sprintf "Expected a %s but got a %s at %s" (T.pp_ty expected)
(T.pp_ty got) (Loc.pp loc)
in
Errors.runtime msg
let report_error_at msg loc =
let msg = Printf.sprintf "%s at %s" msg (L... |
64462621f6b30c4675e7313c8c547c34727a43e12b286bf2ca6c4234238a9320 | overtone/overtone | args.clj | (ns overtone.sc.machinery.server.args
(:use [overtone.sc.defaults]
[overtone.config store]
[overtone.helpers.system]
[clojure.java.shell])
(:require [clojure.string :as string]
[overtone.helpers.math :as math]
[overtone.helpers.string :refer [numeric?]]
[o... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/src/overtone/sc/machinery/server/args.clj | clojure | :mSharedControls is allowed to be nil | (ns overtone.sc.machinery.server.args
(:use [overtone.sc.defaults]
[overtone.config store]
[overtone.helpers.system]
[clojure.java.shell])
(:require [clojure.string :as string]
[overtone.helpers.math :as math]
[overtone.helpers.string :refer [numeric?]]
[o... |
53b5368dd4a22530c10e04fac56700e9a5aca57164231cdc79f7d2931438a4cd | roterski/syncrate-fulcro | seeds.clj | (ns app.database.seeds
(:require [app.auth.mutations :refer [create-user]]
[app.posts.mutations :refer [create-post]]
[app.posts.resolvers :as pr]
[talltale.core :as tt]
[clojure.string :as str]
[app.database.crux :refer [node get-entities]]))
(defn all-acc... | null | https://raw.githubusercontent.com/roterski/syncrate-fulcro/3fda40b12973e64c7ff976174498ec512b411323/src/main/app/database/seeds.clj | clojure | (ns app.database.seeds
(:require [app.auth.mutations :refer [create-user]]
[app.posts.mutations :refer [create-post]]
[app.posts.resolvers :as pr]
[talltale.core :as tt]
[clojure.string :as str]
[app.database.crux :refer [node get-entities]]))
(defn all-acc... | |
60c1a353fc3ba784bab88dbd9d2f68ac3d8c899807446ad939295b64f316f168 | sadiqj/ocaml-esp32 | t000.ml | (* empty file *)
*
0 ATOM0
1 SETGLOBAL T000
3 STOP
*
0 ATOM0
1 SETGLOBAL T000
3 STOP
**)
| null | https://raw.githubusercontent.com/sadiqj/ocaml-esp32/33aad4ca2becb9701eb90d779c1b1183aefeb578/testsuite/tests/tool-ocaml/t000.ml | ocaml | empty file |
*
0 ATOM0
1 SETGLOBAL T000
3 STOP
*
0 ATOM0
1 SETGLOBAL T000
3 STOP
**)
|
30d6c86304ffc7fe24f07580b33238976fe19ac1fcaf22f6656b87b3fc697e36 | mpelleau/AbSolute | boolean.ml | * This wrapper lifts the filtering and the satisfies function over
arithmetical predicates ( e1 < e2 ) to boolean formulas of the form ( p1 \/ p2 )
arithmetical predicates (e1 < e2) to boolean formulas of the form (p1 \/ p2) *)
open Signature
open Consistency
open Constraint
(** Boolean expressions abstract... | null | https://raw.githubusercontent.com/mpelleau/AbSolute/c45a485fba17ab281d8fe099e915e398fa300280/lib/domains/boolean/boolean.ml | ocaml | * Boolean expressions abstractions
filter on boolean formulae. It also computes a simplified boolean formulae
e.g: - false || c <=> c - true && c <=> c | * This wrapper lifts the filtering and the satisfies function over
arithmetical predicates ( e1 < e2 ) to boolean formulas of the form ( p1 \/ p2 )
arithmetical predicates (e1 < e2) to boolean formulas of the form (p1 \/ p2) *)
open Signature
open Consistency
open Constraint
module Make (Abs : Numeric) : Do... |
07c9e1a87d8ff4bea6d7d63365e3b9e49214cb022b81167efd5844d5681fe0e3 | skanev/playground | eopl.scm | (require eopl)
| null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/support/eopl.scm | scheme | (require eopl)
| |
859e8374fa8dd5f4f1169303edc49f54baf049a4717e2bb524d3dda42fe2c4bf | UBTECH-Walker/WalkerSimulationFor2020WAIC | cruiserSensorUpdate.lisp | ; Auto-generated. Do not edit!
(cl:in-package cruiser_msgs-msg)
;//! \htmlinclude cruiserSensorUpdate.msg.html
(cl:defclass <cruiserSensorUpdate> (roslisp-msg-protocol:ros-message)
((data1
:reader data1
:initarg :data1
:type cl:integer
:initform 0)
(data2
:reader data2
:initarg :data2
... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_16.04_v1.2_20200616/walker_install/share/common-lisp/ros/cruiser_msgs/msg/cruiserSensorUpdate.lisp | lisp | Auto-generated. Do not edit!
//! \htmlinclude cruiserSensorUpdate.msg.html |
(cl:in-package cruiser_msgs-msg)
(cl:defclass <cruiserSensorUpdate> (roslisp-msg-protocol:ros-message)
((data1
:reader data1
:initarg :data1
:type cl:integer
:initform 0)
(data2
:reader data2
:initarg :data2
:type cl:integer
:initform 0)
(data3
:reader data3
:initarg... |
3c78294d3f82d25cdd5beb36292bce2cd968a3dffe051d4bdca96d5e9fdfa881 | trainline/optimus | main.clj | Copyright ( c ) Trainline Limited , 2017 . All rights reserved .
See LICENSE.txt in the project root for license information
(ns optimus.loader.main
(:require [clojure.tools.cli :as cli]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.logging :as log]
... | null | https://raw.githubusercontent.com/trainline/optimus/caf4d065f40d5edef87eeb60d767b8379465501e/loader/src/optimus/loader/main.clj | clojure | Log level for startup.
;;
---==| C O N F I G |==---- ;;
;;
will be partitioned to the value set for this key.
batc... | Copyright ( c ) Trainline Limited , 2017 . All rights reserved .
See LICENSE.txt in the project root for license information
(ns optimus.loader.main
(:require [clojure.tools.cli :as cli]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.tools.logging :as log]
... |
4c2bf17f348200d755f6999e07d75dc30972eda2014fed8229195bb556647528 | braidchat/braid | link_extract.clj | (ns braid.embeds-website.link-extract
(:require
[clojure.core.memoize :as memo]
[clojure.string :as string]
[hickory.core :as h]
[hickory.select :as hs]
[org.httpkit.client :as http])
(:import
(java.net URL)
(java.net URLDecoder)))
(defn absolute-link
[url-base link]
(cond
(stri... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/embeds_website/link_extract.clj | clojure | (ns braid.embeds-website.link-extract
(:require
[clojure.core.memoize :as memo]
[clojure.string :as string]
[hickory.core :as h]
[hickory.select :as hs]
[org.httpkit.client :as http])
(:import
(java.net URL)
(java.net URLDecoder)))
(defn absolute-link
[url-base link]
(cond
(stri... | |
67523c515d26a98fabdbc1b2ef5c4cbf998fb60bc206c9b071f076bb54455d89 | MichaelDrogalis/dire | multiple_mutation_exception_selectors.clj | (ns dire.test.multiple-mutation-exception-selectors
(:require [midje.sweet :refer :all]
[dire.core :refer :all]))
(defn divider [a b]
(/ a b))
(with-handler! #'divider
"Catches divide by 0 and null exception errors."
[java.lang.ArithmeticException,
java.lang.NullPointerException]
(fn [e & arg... | null | https://raw.githubusercontent.com/MichaelDrogalis/dire/84b31cc30b1d30b74918c73928d4e148e80e494c/test/dire/test/multiple_mutation_exception_selectors.clj | clojure | (ns dire.test.multiple-mutation-exception-selectors
(:require [midje.sweet :refer :all]
[dire.core :refer :all]))
(defn divider [a b]
(/ a b))
(with-handler! #'divider
"Catches divide by 0 and null exception errors."
[java.lang.ArithmeticException,
java.lang.NullPointerException]
(fn [e & arg... | |
63466e00dc5d625c89fead814e2b11a155db30957f4e5f91aaa5ce5b29e321de | jsa-aerial/saite | tabops.cljs | (ns aerial.saite.tabops
(:require
[cljs.core.async
:as async
:refer (<! >! put! chan)
:refer-macros [go go-loop]]
[clojure.string :as cljstr]
[aerial.hanami.core
:as hmi
:refer [printchan user-msg
re-com-xref xform-recom
default-header-fn start
update-... | null | https://raw.githubusercontent.com/jsa-aerial/saite/335bb4844a77acf7d0bc051ec04e38b66aa4deaa/src/cljs/aerial/saite/tabops.cljs | clojure | com.rpl.specter.zipper
(setval [z/VECTOR-ZIP (z/find-first #(= "b" %)) z/INNER-LEFT] | (ns aerial.saite.tabops
(:require
[cljs.core.async
:as async
:refer (<! >! put! chan)
:refer-macros [go go-loop]]
[clojure.string :as cljstr]
[aerial.hanami.core
:as hmi
:refer [printchan user-msg
re-com-xref xform-recom
default-header-fn start
update-... |
bf619d15ef37bdfa621561ca3db207a94fde7e3a9472113734199178e6fba206 | Frama-C/Frama-C-snapshot | pool.mli | (**************************************************************************)
(* *)
This file is part of WP plug - in of Frama - C.
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/qed/pool.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat a l'energie atomique et aux energies
Lesser General Public License as published by the Free Software
Foundation ,... |
d32af328bc0e01835bdc0c217d8348de5c7abcc2374dc633e8e6653e7f656b15 | awslabs/s2n-bignum | edwards25519_epadd_alt.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/6c0e0852ab8c6577a92377d6836f8bfcb41f300d/arm/proofs/edwards25519_epadd_alt.ml | ocaml | =========================================================================
=========================================================================
*** print_literal_from_elf "arm/curve25519/edwards25519_epadd_alt.o";;
***
arm_MOV X19 X1
arm_MOV X20 X2
arm_ADDS X13 X13 X11
arm_ADDS X13 X13 X11
arm_ADDS X1... |
* 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
*)
Extended projective addition for .
n... |
964951112032ffcbac4bbacc7d5a144d4ad31eaec2b1d585c929489de0a5d829 | angavrilov/ecl-compute | rewrite.lisp | ;;; -*- mode:lisp; indent-tabs-mode: nil; -*-
(in-package fast-compute)
;;; Ordinary tree rewrite
(defun rewrite-rec-once (engine expr &key (map-recurse-func #'mapcar-save-old))
(labels ((recurse (expr)
(let* ((rec-res (if (atom expr)
expr
... | null | https://raw.githubusercontent.com/angavrilov/ecl-compute/466f0d287f8b6ab0e2b5c2ac03693ad4f4df6a3f/expr/rewrite.lisp | lisp | -*- mode:lisp; indent-tabs-mode: nil; -*-
Ordinary tree rewrite
Canonic tree rewrite
Rewrite pass declaration |
(in-package fast-compute)
(defun rewrite-rec-once (engine expr &key (map-recurse-func #'mapcar-save-old))
(labels ((recurse (expr)
(let* ((rec-res (if (atom expr)
expr
(funcall map-recurse-func #'recurse expr)))
(sub... |
8f2cf01bed617705e9217f37a3abc19735970b4bf5e09055314041436ce4b771 | rntz/moxy | demo.rkt | #lang racket
(require racket/stream)
(require "debug.rkt")
(require "env.rkt")
(require "lex.rkt")
(require "objects.rkt")
(require "parse-builtins.rkt")
(require "parse.rkt")
(require "pcomb.rkt")
(require (only-in "quasi.rkt" run))
(require "repl.rkt")
(require "runtime.rkt")
(require "tags.rkt")
(require "util.rkt... | null | https://raw.githubusercontent.com/rntz/moxy/18015aed1596ae55658be4ac9eb5cbb3debb1644/demo.rkt | racket | #lang racket
(require racket/stream)
(require "debug.rkt")
(require "env.rkt")
(require "lex.rkt")
(require "objects.rkt")
(require "parse-builtins.rkt")
(require "parse.rkt")
(require "pcomb.rkt")
(require (only-in "quasi.rkt" run))
(require "repl.rkt")
(require "runtime.rkt")
(require "tags.rkt")
(require "util.rkt... | |
e2047492fa911d5e9e52537aa6ff099841e93929b0ae9d0db236caa595cab72c | haskell/aeson | Typed.hs | # LANGUAGE NoImplicitPrelude #
module Typed (benchmark) where
import Bench
import qualified Typed.Generic as Generic
import qualified Typed.Manual as Manual
import qualified Typed.TH as TH
benchmark :: Benchmark
benchmark = bgroup "Twitter"
[ bgroup "encode"
[ Generic.benchmarks
, Manual... | null | https://raw.githubusercontent.com/haskell/aeson/78c2338c20d31ba5dd46036d10d6c4815c12185d/benchmarks/bench/Typed.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Typed (benchmark) where
import Bench
import qualified Typed.Generic as Generic
import qualified Typed.Manual as Manual
import qualified Typed.TH as TH
benchmark :: Benchmark
benchmark = bgroup "Twitter"
[ bgroup "encode"
[ Generic.benchmarks
, Manual... | |
c1c12c85d151428fe23f0126de97e65f53e65fb2b0708aa9f15b47eda80d8aa7 | simplex-chat/simplexmq | STM.hs | # LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
module Simplex.Messaging.Server.Env.STM where
import Control.Concurrent (ThreadId)
import Control.Monad.IO.Unlift
import Crypto.Random
import Data.ByteString.Char8 (ByteString)
import Data.List.NonEm... | null | https://raw.githubusercontent.com/simplex-chat/simplexmq/56eea29ec36ba723fda6ae27a18e03a4e5aad6e8/src/Simplex/Messaging/Server/Env/STM.hs | haskell | | set to False to prohibit creating new queues
| simple password that the clients need to pass in handshake to be able to create new queues
| time after which the socket with inactive client can be disconnected (without any messages or commands, incl. PING),
| file to log stats
| file to save and restore stats
| ... | # LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
module Simplex.Messaging.Server.Env.STM where
import Control.Concurrent (ThreadId)
import Control.Monad.IO.Unlift
import Crypto.Random
import Data.ByteString.Char8 (ByteString)
import Data.List.NonEm... |
f0e86c80951174032fe9f99b6e1e83112e606f6815429b64053aa625e759aa55 | CDSoft/pp | Version.hs | PP
Copyright ( C ) 2015 - 2023
This file is part of PP .
PP 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 version .
P... | null | https://raw.githubusercontent.com/CDSoft/pp/625e6a2ce449ffb905fb91a5f37090c417a0e82a/src/Version.hs | haskell | PP
Copyright ( C ) 2015 - 2023
This file is part of PP .
PP 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 version .
P... | |
0e1b7ac51fc034da06b1a5bfa467abd80fc57b02343873046271b2bdaeb2c81b | slepher/lenses | lens_test_SUITE.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2017 ,
%%% @doc
%%%
%%% @end
Created : 20 Oct 2017 by < >
%%%-------------------------------------------------------------------
-module(lens_test_SUITE).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl... | null | https://raw.githubusercontent.com/slepher/lenses/3f979746e2c570d4808cce7106ac8b2110eed5c1/test/lens_test_SUITE.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
--------------------------------------------------------------------
Info = [tuple()]
@end
--------------------------------------------------------------------
---------... | @author < >
( C ) 2017 ,
Created : 20 Oct 2017 by < >
-module(lens_test_SUITE).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").
@spec suite ( ) - > Info
suite() ->
[{timetrap,{seconds,30}}].
@spec init_per_suite(Config0 ) - >
Co... |
4be994c9f394f5ad9ab078d2094ece9a7d1f43855bf9c2fac0845f698230bdcd | EgorDm/fp-pacman | ScoreHolder.hs | module Game.Structure.ScoreHolder (
ScoreHolder(..),
incrementScore,
incrementDotsEaten,
decrementLife,
scoreholder
) where
import Constants
import Engine.Base
import Game.UI.Base
{- Data structures -}
-- | Holds scores for given game
data ScoreHolder = ScoreHolder {
score ::... | null | https://raw.githubusercontent.com/EgorDm/fp-pacman/19781c92c97641b0a01b8f1554f50f19ff6d3bf4/src/Game/Structure/ScoreHolder.hs | haskell | Data structures
| Holds scores for given game
TODO: do we need to store this per pacman mb? Needed for competitive not for rest
Classes
Instances
Functions
| Quick constructor for scoreholder
| Increments score by given amount | module Game.Structure.ScoreHolder (
ScoreHolder(..),
incrementScore,
incrementDotsEaten,
decrementLife,
scoreholder
) where
import Constants
import Engine.Base
import Game.UI.Base
data ScoreHolder = ScoreHolder {
dotsEaten :: Int,
lives :: Int
... |
c0a45931a2e49ebaf2a9d1b94178d70c95707004650a2c4f02cdb1417b24306b | tmfg/mmtis-national-access-point | transform.cljc | (ns ote.gtfs.transform
"Transform ote.db.transit datamodel maps to GTFS data"
(:require [camel-snake-kebab.core :as csk]
[ote.db.transit :as transit]
[ote.gtfs.spec :as gtfs-spec]
[ote.gtfs.parse :as gtfs-parse]
[ote.db.transport-operator :as t-operator]
[... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/1aba1c36aac7d6d55ee11accbf5a444e5f514f6c/ote/src/cljc/ote/gtfs/transform.cljc | clojure | NOTE: In case we have service calendars that have no rules, but only date additions, we'll use
service_id 0 everywhere by default.
services as there are rules, and distribute added/removed dates between them
Add stoptimes to enable adding them to stoptimes file. They are
removed later from this trip-txt vector
of... | (ns ote.gtfs.transform
"Transform ote.db.transit datamodel maps to GTFS data"
(:require [camel-snake-kebab.core :as csk]
[ote.db.transit :as transit]
[ote.gtfs.spec :as gtfs-spec]
[ote.gtfs.parse :as gtfs-parse]
[ote.db.transport-operator :as t-operator]
[... |
42257ec67e1249122575e309531a3892b32a87a90fb6e8e66b93bbf4d0329650 | jeffshrager/biobike | commands.lisp | ;;; -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
(in-package :wb)
;;; +=========================================================================+
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
;;; | |
;;; | Permission is hereby... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Webuser/commands.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and ass... |
(in-package :wb)
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject to ... |
0f2debc2b7864d6fc525a6d05210ef1ffd8cae27f8bdb15959d902fa4db993a7 | janestreet/vcaml | test_child_client.ml | open Core
open Async
open Import
open Vcaml
open Vcaml_test_helpers
(* [Child] clients are used by oneshot plugins. *)
let%expect_test "Simple test of [Child] client" =
Expect_test_helpers_async.with_temp_dir (fun tmp_dir ->
let socket = tmp_dir ^/ "socket" in
let%bind nvim =
(* There is some undocume... | null | https://raw.githubusercontent.com/janestreet/vcaml/64d205c2d6eee4a7e57abd2d452f5979dc6cd797/test/semantics/test_child_client.ml | ocaml | [Child] clients are used by oneshot plugins.
There is some undocumented internal limit for the socket length (it doesn't
appear in `:h limits`) so to ensure we create a socket we set the working dir
to [tmp_dir] and create the socket with a relative path. | open Core
open Async
open Import
open Vcaml
open Vcaml_test_helpers
let%expect_test "Simple test of [Child] client" =
Expect_test_helpers_async.with_temp_dir (fun tmp_dir ->
let socket = tmp_dir ^/ "socket" in
let%bind nvim =
Process.create_exn
()
~working_dir:tmp_dir
~prog:neo... |
c815f4213532546fe8e1d4d43e7110732d5439a1ab0f5b88f70ddd49f4678cb4 | oakes/tile-soup | properties.cljc | (ns tile-soup.properties
(:require [clojure.spec.alpha :as s]
[tile-soup.utils :as u]
[tile-soup.property :as property]))
(defmulti spec :tag)
(defmethod spec :property [_] ::property/property)
(defmethod spec :default [x]
(throw (ex-info (str (:tag x) " not supported in properties tags") {... | null | https://raw.githubusercontent.com/oakes/tile-soup/e2d495523af59322891f667859d39478d118a7c2/src/tile_soup/properties.cljc | clojure | (ns tile-soup.properties
(:require [clojure.spec.alpha :as s]
[tile-soup.utils :as u]
[tile-soup.property :as property]))
(defmulti spec :tag)
(defmethod spec :property [_] ::property/property)
(defmethod spec :default [x]
(throw (ex-info (str (:tag x) " not supported in properties tags") {... | |
ce5fbd9ec9abce6acf6b12e6aff79b826b4b3b378fc515e51f321575f83c23b9 | typelead/etlas | DList.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Compat.DList
Copyright : ( c ) 2015 - 2019
-- License : BSD3
--
Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- A very simple difference list.
module Distri... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Compat/DList.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Compat.DList
License : BSD3
Stability : experimental
Portability : portable
A very simple difference list.
| Difference list.
| Make 'DList' with containing single element. | Copyright : ( c ) 2015 - 2019
Maintainer :
module Distribution.Compat.DList (
DList,
runDList,
singleton,
snoc,
) where
import Prelude ()
import Distribution.Compat.Prelude
newtype DList a = DList ([a] -> [a])
runDList :: DList a -> [a]
runDList (DList run) = run []
singleton :: a ->... |
8503f0b2e4c692002bb3a1e1382cdf1af620edd7235210aaa0406acaec6812d7 | BillHallahan/G2 | HKTypeClass1.hs | module HKTypeClass1 where
class Extract m where
extract :: m a -> a
replace :: a -> m b -> m a
change :: (a -> b) -> m a -> m b
change f w =
let
x = extract w
in
replace (f x) w
data J a = J a
data E a b = E a b
instance Extract J where
extract (J x) = x
... | null | https://raw.githubusercontent.com/BillHallahan/G2/dfd377793dcccdc7126a9f4a65b58249673e8a70/tests/TestFiles/TypeClass/HKTypeClass1.hs | haskell | module HKTypeClass1 where
class Extract m where
extract :: m a -> a
replace :: a -> m b -> m a
change :: (a -> b) -> m a -> m b
change f w =
let
x = extract w
in
replace (f x) w
data J a = J a
data E a b = E a b
instance Extract J where
extract (J x) = x
... | |
31d5f84cc2fb444e0d26b5abe96c886b240fbf4be5d51380f7004abad7931bef | pentlandedge/s4607 | hrr_tests.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright 2016 Pentland Edge Ltd.
%%
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
%%
%% Un... | null | https://raw.githubusercontent.com/pentlandedge/s4607/b3cdae404ac5bd50419f33259dfa62af9d1a8d60/test/hrr_tests.erl | erlang |
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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Copyright 2016 Pentland Edge Ltd.
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(hrr_tests).
-include_lib("eunit/include/eunit.hrl").
hrr_test_() ->
[creation_checks(), encode_decode_chec... |
bd42214e7fafa7c2e2d5df821e3ebe936d8847388d9c64c3dd1fb6fd68741645 | ocaml/ocaml | test3.ml | (* TEST
include unix
modules = "test3_.c"
* libunix
** bytecode
** native
*)
(* Tests nested calls from C (main C) to OCaml (main OCaml) to C (caml_to_c) to
* OCaml (c_to_caml) to C (printf functions). A stack overflow and a heap
* overflow are triggered in c_to_caml. *)
let printf = Printf.printf
l... | null | https://raw.githubusercontent.com/ocaml/ocaml/0c249195f84fbc0ef475c1334594b53aaf5a3de7/testsuite/tests/callback/test3.ml | ocaml | TEST
include unix
modules = "test3_.c"
* libunix
** bytecode
** native
Tests nested calls from C (main C) to OCaml (main OCaml) to C (caml_to_c) to
* OCaml (c_to_caml) to C (printf functions). A stack overflow and a heap
* overflow are triggered in c_to_caml.
Stack overflow |
let printf = Printf.printf
let rec mk_list length acc =
if length < 1 then acc
else mk_list (length-1) ((length-1)::acc)
let rec sum n = if n = 0 then 0 else n + sum (n-1)
let c_to_caml () =
printf "[Caml] Enter c_to_caml\n%!";
Heap overflow
let l = mk_list 1000 [] in
Printf.printf "%d\n" (List.hd l);
... |
37051f71ea37f40fa0903371fbe032453c257c145e74796f7fd300d441686252 | xsc/claro | multi_test.clj | (ns claro.engine.multi-test
(:require [clojure.test.check :as tc]
[clojure.test.check
[clojure-test :refer [defspec]]
[generators :as gen]
[properties :as prop]]
[claro.test :as test]
[claro.engine
[multi :as multi]
[... | null | https://raw.githubusercontent.com/xsc/claro/16db75b7a775a14f3b656362e8ee4f65dd8b0d49/test/claro/engine/multi_test.clj | clojure | ## Tests | (ns claro.engine.multi-test
(:require [clojure.test.check :as tc]
[clojure.test.check
[clojure-test :refer [defspec]]
[generators :as gen]
[properties :as prop]]
[claro.test :as test]
[claro.engine
[multi :as multi]
[... |
8d7e9d118d021d51ed2697861156b25211373fa313174d2038301d6ace24cfd9 | SecPriv/webspec | debug.ml | (********************************************************************************)
Copyright ( c ) 2021
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* c... | null | https://raw.githubusercontent.com/SecPriv/webspec/9f500bd85400551d8bf0e117ac5aa57088f9bc20/compiler/src/debug.ml | ocaml | ******************************************************************************
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
th... | Copyright ( c ) 2021
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
LIABI... |
caa47165f6b34a07fba7f9d31a51bbe170be64aa2ea6b49bc48eb0959c0a80ef | ingolia-lab/RiboSeq | YassourUorf.hs | {-# LANGUAGE OverloadedStrings #-}
module Main
where
import Control.Applicative
import Control.Exception
import Control.Monad.Reader
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Maybe
import Numeric
import System.Console.CmdTheLine
import System.FilePath
import Sy... | null | https://raw.githubusercontent.com/ingolia-lab/RiboSeq/a14390cd95528910a258434c7b84c787f5e1d119/src/YassourUorf.hs | haskell | # LANGUAGE OverloadedStrings #
End position in transcript for /quantification/ of uORF |
module Main
where
import Control.Applicative
import Control.Exception
import Control.Monad.Reader
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Maybe
import Numeric
import System.Console.CmdTheLine
import System.FilePath
import System.IO
import qualified Data.Vect... |
7d98b4c8387dc098c2601bf01cc5605eed7f229cb511449fdab019330761c763 | erlangonrails/devdb | mochifmt_std.erl | @author < >
@copyright 2008 Mochi Media , Inc.
%% @doc Template module for a mochifmt formatter.
-module(mochifmt_std, []).
-author('').
-export([format/2, get_value/2, format_field/2, get_field/2, convert_field/2]).
format(Format, Args) ->
mochifmt:format(Format, Args, THIS).
get_field(Key, Args) ->
... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/riak-0.11.0/deps/mochiweb/src/mochifmt_std.erl | erlang | @doc Template module for a mochifmt formatter.
Tests
| @author < >
@copyright 2008 Mochi Media , Inc.
-module(mochifmt_std, []).
-author('').
-export([format/2, get_value/2, format_field/2, get_field/2, convert_field/2]).
format(Format, Args) ->
mochifmt:format(Format, Args, THIS).
get_field(Key, Args) ->
mochifmt:get_field(Key, Args, THIS).
convert_fie... |
ff2b05d340dec08bcded1210dec087398386e67df8db7e66bae5a799cc6c806b | panda-planner-dev/ipc2020-domains | p-18.lisp | (defproblem problem domain
(
(visible waypoint0 waypoint1)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint2)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint12)
(visible waypoint12 waypoint0)
(visible waypoint0 waypoint13)
(visible waypoint13 waypoint0)
(visible... | null | https://raw.githubusercontent.com/panda-planner-dev/ipc2020-domains/9adb54325d3df35907adc7115fcc65f0ce5953cc/partial-order/Rover/other/SHOP2/p-18.lisp | lisp | (defproblem problem domain
(
(visible waypoint0 waypoint1)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint2)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint12)
(visible waypoint12 waypoint0)
(visible waypoint0 waypoint13)
(visible waypoint13 waypoint0)
(visible... | |
108551766ab1ed6e9ecd405b07d153a373e8886f1fbed520c62a984e46ab596c | votinginfoproject/data-processor | transforms_test.clj | (ns vip.data-processor.validation.transforms-test
(:require [clojure.test :refer :all]
[vip.data-processor.test-helpers :refer :all]
[vip.data-processor.errors.process :as process]
[vip.data-processor.pipeline :as pipeline]
[vip.data-processor.validation.csv :as csv]
... | null | https://raw.githubusercontent.com/votinginfoproject/data-processor/b4baf334b3a6219d12125af8e8c1e3de93ba1dc9/test/vip/data_processor/validation/transforms_test.clj | clojure | (ns vip.data-processor.validation.transforms-test
(:require [clojure.test :refer :all]
[vip.data-processor.test-helpers :refer :all]
[vip.data-processor.errors.process :as process]
[vip.data-processor.pipeline :as pipeline]
[vip.data-processor.validation.csv :as csv]
... | |
97350c14bc06c005ec9371989eb19800ea3fc5e4aa2c4c228a8f4b1bb13e46e5 | fakedata-haskell/fakedata | Hipster.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.Hipster where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Hipster
import Faker.TH
$(generateFakeField "hipster" "words")
| null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Hipster.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Hipster where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Hipster
import Faker.TH
$(generateFakeField "hipster" "words")
|
d3b2c6f50a90424c33707b760e4ce6ed3c4652dd3fc3154ab351e81d89c49947 | haroldcarr/learn-haskell-coq-ml-etc | Lib.hs | # LANGUAGE NoImplicitPrelude #
module Lib where
import Protolude hiding (Product)
import Test.Hspec
-safe-dimensional-analysis-in-haskell
Type safe dimensional analysis in Haskell
July 16 , 2017
physical units as types
main idea : represent units of measure as function spaces
e.g. ,... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/phantoms/2017-07-dimensional-analysis-stephan-boyer/src/Lib.hs | haskell | ------------------------------------------------
------------------------------------------------
(phantom) types for base units
represent quantities with units
for base units
product a * b represented as a / b^-1:
synonym to make square units like m^2 easier to read:
all quantities have some numeric value
inst... | # LANGUAGE NoImplicitPrelude #
module Lib where
import Protolude hiding (Product)
import Test.Hspec
-safe-dimensional-analysis-in-haskell
Type safe dimensional analysis in Haskell
July 16 , 2017
physical units as types
main idea : represent units of measure as function spaces
e.g. ,... |
a0df178ff919fd72a8c504c20ff51f40ae21daea46a06e1c7d1c9ea5e666000f | W-Net-AI/LISP-CV | imgproc.lisp | ;;;; -*- mode: lisp; indent-tabs: nil -*-
;;;; imgproc.lisp
;;;; OpenCV bindings
;;;; Image Processing.
(in-package :lisp-cv)
Macros
static inline Scalar morphologyDefaultBorderValue ( ) { return Scalar::all(DBL_MAX ) ; }
;; Scalar* cv_create_morphologyDefaultBorderValue()
(defcfun ("cv_create... | null | https://raw.githubusercontent.com/W-Net-AI/LISP-CV/10d5c7c1a6fa026de488ca89a28e8a5c519ff8f2/imgproc.lisp | lisp | -*- mode: lisp; indent-tabs: nil -*-
imgproc.lisp
OpenCV bindings
Image Processing.
}
Scalar* cv_create_morphologyDefaultBorderValue()
}
Scalar* cv_create_morphologyDefaultBorderValue()
Image Filtering
Mat* cv_getStructuringElement(int shape, Size* ksize, Point* anchor)
Geometric Image Transforma... |
(in-package :lisp-cv)
Macros
(defcfun ("cv_create_morphologyDefaultBorderValue" morphology-default-border-value) scalar)
(defcfun ("cv_create_morphologyDefaultBorderValue" make-morphology-default-border-value) scalar)
void , OutputArray dst , int d , double sigmaColor , double sigma... |
0484756e29e24e55a6aed2f5f0182a716f6404b66b6a06e9ffb8572caab2092b | kitlang/kit | Definitions.hs | module Kit.Ast.Definitions (
module Kit.Ast.Definitions.ArgSpec,
module Kit.Ast.Definitions.Base,
module Kit.Ast.Definitions.EnumVariant,
module Kit.Ast.Definitions.FunctionDefinition,
module Kit.Ast.Definitions.RewriteRule,
module Kit.Ast.Definitions.TraitDefinition,
module Kit.Ast.Definitions.TraitImple... | null | https://raw.githubusercontent.com/kitlang/kit/2769a7a8e51fe4466c50439d1a1ebdad0fb79710/src/Kit/Ast/Definitions.hs | haskell | module Kit.Ast.Definitions (
module Kit.Ast.Definitions.ArgSpec,
module Kit.Ast.Definitions.Base,
module Kit.Ast.Definitions.EnumVariant,
module Kit.Ast.Definitions.FunctionDefinition,
module Kit.Ast.Definitions.RewriteRule,
module Kit.Ast.Definitions.TraitDefinition,
module Kit.Ast.Definitions.TraitImple... | |
d8f67472672cfc744ba66f7a2f0637768ec5ed985cbf400324a88cf2148bf69e | GlideAngle/flare-timing | AndoyerLambert.hs | # OPTIONS_GHC -fno - warn - partial - type - signatures #
module Published.Ellipsoid.AndoyerLambert (units, unitsR) where
import Test.Tasty (TestTree, testGroup)
import Data.UnitsOfMeasure (u, convert)
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.Units ()
import Flight.Units.DegMinSec (DMS(..), a... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/earth/test-suite/published/Published/Ellipsoid/AndoyerLambert.hs | haskell | TODO: Investigate why the Geodetic Survey inverse results often disagree
TODO: Investigate why the Geodetic Survey inverse results often disagree | # OPTIONS_GHC -fno - warn - partial - type - signatures #
module Published.Ellipsoid.AndoyerLambert (units, unitsR) where
import Test.Tasty (TestTree, testGroup)
import Data.UnitsOfMeasure (u, convert)
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.Units ()
import Flight.Units.DegMinSec (DMS(..), a... |
446a102ab66a4381f2c9bc7ef2658135c90c3b666281fb6ae849b6fd30d9497f | dnikolovv/practical-haskell | Lib.hs | {-# LANGUAGE OverloadedStrings #-}
module Lib
( -- * Synopsis
-- $synopsis
MappedText(..)
, demo
) where
import Data.String (IsString(..))
import Data.Text (Text, pack)
import qualified Data.Text as Text
newtype MappedText = MappedText
{ getMappedText :: (Char -> Char) -> Text
}
instance Semigroup ... | null | https://raw.githubusercontent.com/dnikolovv/practical-haskell/2858b604ddb9554987758b28b699ec4dbd70b102/abstracting-functions/src/Lib.hs | haskell | # LANGUAGE OverloadedStrings #
* Synopsis
$synopsis
| Demo that can be run in @ghci@:
> λ> demo id
> "functions always prevail!"
> λ> demo Data.Char.toUpper
> "FUNCTIONS ALWAYS PREVAIL!"
$synopsis
Often times, we need some data determined at runtime to drive our program's
behavior. When we need to thread co... | module Lib
MappedText(..)
, demo
) where
import Data.String (IsString(..))
import Data.Text (Text, pack)
import qualified Data.Text as Text
newtype MappedText = MappedText
{ getMappedText :: (Char -> Char) -> Text
}
instance Semigroup MappedText where
mt1 <> mt2 = MappedText $ \f -> getMappedText mt1 f... |
402339580ee2938fc09ae16edfdca7c3b3723a452595297edbb28e2f522cabf6 | mfoemmel/erlang-otp | ge_h.1.erl | -module(ge_h).
-vsn(1).
-behaviour(gen_event).
-export([get_events/1]).
-export([init/1, handle_event/2, handle_call/2, handle_info/2,
terminate/2, code_change/3]).
get_events(Mgr) ->
gen_event:call(Mgr, ge_h, get_events).
init(_) -> {ok, undefined}.
handle_event(Event, _LastEvent) ->
{ok, Event}.
han... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/sasl/doc/src/rel/ge_h.1.erl | erlang | -module(ge_h).
-vsn(1).
-behaviour(gen_event).
-export([get_events/1]).
-export([init/1, handle_event/2, handle_call/2, handle_info/2,
terminate/2, code_change/3]).
get_events(Mgr) ->
gen_event:call(Mgr, ge_h, get_events).
init(_) -> {ok, undefined}.
handle_event(Event, _LastEvent) ->
{ok, Event}.
han... | |
3a8dbe959df000e0cd89aa6db0b0072250c1cdeceac64b2a31ae3a113e383897 | hidaris/thinking-dumps | 2-11.rkt | #lang eopl
;;; A data-structure representation of environments
;;; Env = (empty-env) | (extend-env Var SchemeVal Env)
;;; Var = Sym
;;; empty-env : () -> Env
(define empty-env
(lambda ()'()))
extend - env : SchemeVal x Env - > Env
(define extend-env
(lambda (var val env)
(cons `(,var ,val) env)))
exte... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/eopl-solutions/chap2/2-11.rkt | racket | A data-structure representation of environments
Env = (empty-env) | (extend-env Var SchemeVal Env)
Var = Sym
empty-env : () -> Env
has-binding? : Env x Var -> Bool
apply-env : Env x Var -> SchemeVal | #lang eopl
(define empty-env
(lambda ()'()))
extend - env : SchemeVal x Env - > Env
(define extend-env
(lambda (var val env)
(cons `(,var ,val) env)))
extend - env * : Listof(Var ) x Listof(SchemeVal ) x Env - > Env
(define extend-env*
(lambda (varls valls env)
(cons (list varls valls)
... |
66b143ceb6a4599800ad01b88c0cd4f3c9b2ae31c0f17c69bc7722b73185fe98 | armedbear/abcl | abcl-asdf.lisp | The ABCL specific overrides in ASDF .
;;;;
Extensions to ASDF for use by ABCL
(require :asdf)
(in-package :asdf)
(defclass iri (component)
((schema :initform nil)
(authority :initform nil)
(path :initform nil)
(query :initform nil)
(fragment :initform nil)))
(defclass mvn (iri)
((group-id :ini... | null | https://raw.githubusercontent.com/armedbear/abcl/36a4b5994227d768882ff6458b3df9f79caac664/contrib/abcl-asdf/abcl-asdf.lisp | lisp |
We intercept compilation to ensure that load-op will succeed
A Maven URI has the form "mvn:group-id/artifact-id/version"
Sometimes people write "group-id:artifact-id:version" to refer to
serialized references to artifacts of this form.
Currently we "stuff" the group-id/artifact-id into the 'name' and
use the c... | The ABCL specific overrides in ASDF .
Extensions to ASDF for use by ABCL
(require :asdf)
(in-package :asdf)
(defclass iri (component)
((schema :initform nil)
(authority :initform nil)
(path :initform nil)
(query :initform nil)
(fragment :initform nil)))
(defclass mvn (iri)
((group-id :initarg ... |
1f400c4367d5572622bbb5f69211ffdf63b5afc90e6edb4e6d95e28635d6f3d0 | potocpav/vSLAM | Display.hs | # OPTIONS_GHC -Wall #
|
Module : Display
License : WTFPL
Maintainer : < >
This module provides a 3D simulation environment for the FastSLAM2 routine .
It simulates over the data supplied by the ' Playback ' module . It has got a
' main ' function and is standalone ( separate from the ' Ros... | null | https://raw.githubusercontent.com/potocpav/vSLAM/183415d0cbd4d938d17494a15cdffa24c29142ea/Display.hs | haskell | ^Averaged camera history
^Per-particle camera histories
| The complete simulation state.
| The main state update routine.
| Run the FastSLAM routine.
which is displayed on the screen by the not-gloss package.
| Draw the grid and the axes to give a visual clue of positions and depths.
The grid automatically move... | # OPTIONS_GHC -Wall #
|
Module : Display
License : WTFPL
Maintainer : < >
This module provides a 3D simulation environment for the FastSLAM2 routine .
It simulates over the data supplied by the ' Playback ' module . It has got a
' main ' function and is standalone ( separate from the ' Ros... |
d07175cfb385977c2a28b56631753aedbafe240ed795c376f359247e744d6c37 | Frozenlock/bacure | services.clj | (ns bacure.services
(:require [bacure.coerce :as c]
[bacure.coerce.service.confirmed]
[bacure.events :as events]
[bacure.local-device :as ld]
[bacure.state :as state]
[clojure.tools.logging :as log])
(:import [com.serotonin.bacnet4j ResponseConsumer]
... | null | https://raw.githubusercontent.com/Frozenlock/bacure/2d743492f7865d8c61313f4d73818c3d1ee462de/src/bacure/services.clj | clojure | bacnet4j introduced some kind of callbacks with the
request-sending mechanism. For simplicity sake, we use promises to
reconvert all this into normal synchronous operations; The
operations will block until the remote devices answer the
requests. The user can use parallel functions like `pmap' if he
wants to send ... | (ns bacure.services
(:require [bacure.coerce :as c]
[bacure.coerce.service.confirmed]
[bacure.events :as events]
[bacure.local-device :as ld]
[bacure.state :as state]
[clojure.tools.logging :as log])
(:import [com.serotonin.bacnet4j ResponseConsumer]
... |
6b1d0db45c0fc5ca4e44248a38737839bc50621214d8c61923e1f992838c6136 | saevarb/haskord | WebSocket.hs | module Haskord.WebSocket
( wsSource
, updateSeqNo
, startWriterThread
, reportRawParseErrors
) where
import Control.Monad.Reader
import qualified Data.ByteString.Lazy as B
import Network.WebSockets (Connection, WebSocketsData (..),
recei... | null | https://raw.githubusercontent.com/saevarb/haskord/d1bb07bcc4f3dbc29f2dfd3351ff9f16fc100c07/haskord-lib/src/Haskord/WebSocket.hs | haskell | module Haskord.WebSocket
( wsSource
, updateSeqNo
, startWriterThread
, reportRawParseErrors
) where
import Control.Monad.Reader
import qualified Data.ByteString.Lazy as B
import Network.WebSockets (Connection, WebSocketsData (..),
recei... | |
83b32cba909529746fabc8ef523a1bea61d6f2ac3f7ebb98ac93a5777389600a | anishathalye/knox | overapproximate.rkt | #lang racket/base
(require
"convenience.rkt"
"lens.rkt"
racket/match
(prefix-in @ rosette/safe))
(provide overapproximate)
(define (overapproximate view)
(if (join? view)
(join (map overapproximate (join-contents view)))
(overapproximate-term view)))
(define (any->datum s)
(if (identifier? s) (s... | null | https://raw.githubusercontent.com/anishathalye/knox/161cda3e5274cc69012830f477749954ddcf736d/rosutil/overapproximate.rkt | racket | do our best to generate a good name
give up | #lang racket/base
(require
"convenience.rkt"
"lens.rkt"
racket/match
(prefix-in @ rosette/safe))
(provide overapproximate)
(define (overapproximate view)
(if (join? view)
(join (map overapproximate (join-contents view)))
(overapproximate-term view)))
(define (any->datum s)
(if (identifier? s) (s... |
2fec81db2c6927150df39a5fd45a91def3962307dc4d7a0291b94b22334abc92 | katcipis/sicp | sqrt.rkt | #lang racket
(require "damp.rkt" "fixed-point.rkt")
(define (sqrt-base x next guess precision maxiter)
(fixed-point
(lambda (guess)
(+
guess
(abs (- (* guess guess) x))
))
next
guess
precision
maxiter
))
(define (sqrt-heron x)
(sqrt-base
x
(lambda (gu... | null | https://raw.githubusercontent.com/katcipis/sicp/d365de58e106d54f83d0ca236ea5ea666253da89/sqrt/sqrt.rkt | racket | #lang racket
(require "damp.rkt" "fixed-point.rkt")
(define (sqrt-base x next guess precision maxiter)
(fixed-point
(lambda (guess)
(+
guess
(abs (- (* guess guess) x))
))
next
guess
precision
maxiter
))
(define (sqrt-heron x)
(sqrt-base
x
(lambda (gu... | |
d6d97c3f52576a0586d498e2b4e3952a8cfa0304120a3d5c477dd7b6a257243c | haskell-github/github | Report.hs | {-# LANGUAGE OverloadedStrings #-}
module Report (
ReportedIssue (..),
Report (..),
prepareReport,
convertLabels
) where
import Text.Regex.Posix
import qualified Github.Issues as Github
data ReportedIssue = Issue {
riNumber :: Int,
riTitle :: String,
riHour :: Double
... | null | https://raw.githubusercontent.com/haskell-github/github/d9ac0c7ffbcc720a24d06f0a96ea4e3891316d1a/samples/Issues/IssueReport/Report.hs | haskell | # LANGUAGE OverloadedStrings # | module Report (
ReportedIssue (..),
Report (..),
prepareReport,
convertLabels
) where
import Text.Regex.Posix
import qualified Github.Issues as Github
data ReportedIssue = Issue {
riNumber :: Int,
riTitle :: String,
riHour :: Double
} deriving (Show)
data Report = R... |
0855d32dc0fca039f510e3f201992baae22e471a9254f19e0a9594cb3b161aaf | camlp5/camlp5 | test8.ml | type ('a,'b) t constraint 'a = 'b and ('a,'b) u = ('a,'b) t;;
| null | https://raw.githubusercontent.com/camlp5/camlp5/15e03f56f55b2856dafe7dd3ca232799069f5dda/testsuite/maquette/files-original/test8.ml | ocaml | type ('a,'b) t constraint 'a = 'b and ('a,'b) u = ('a,'b) t;;
| |
4837236260a4ab3fbda8af85cdc5addbda1de049dfdfdf25fa4ca3945a6fa143 | dwayne/eopl3 | interpreter.rkt | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
;; Expressed Values
num-val bool-val list-val
;; Interpreter
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/05-ch5/interpreters/racket/IMPLICIT-REFS-5.9/interpreter.rkt | racket | Expressed Values
Interpreter
FinalAnswer = ExpVal
Continuations
Cont x ExpVal -> FinalAnswer
Procedure ADT
Values
ExpVal = Int + Bool + Proc + List[EvalVal] | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
num-val bool-val list-val
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
'x (num-val 10)
... |
7c1cb9eaf39bbac8df81456a17b556baa4044f5ba905b134fefabd26510bfc52 | orionsbelt-battlegrounds/obb-rules | play.cljs | (ns obb-demo.views.play
(:require [obb-demo.state :as state]
[obb-rules.game :as game]
[obb-rules.game-progress :as game-progress]
[obb-rules.stash :as stash]
[obb-rules.serializer.writer :as writer]
[obb-demo.processor :as processor]
[obb-demo.v... | null | https://raw.githubusercontent.com/orionsbelt-battlegrounds/obb-rules/97fad6506eb81142f74f4722aca58b80d618bf45/src/obb_demo/views/play.cljs | clojure | (ns obb-demo.views.play
(:require [obb-demo.state :as state]
[obb-rules.game :as game]
[obb-rules.game-progress :as game-progress]
[obb-rules.stash :as stash]
[obb-rules.serializer.writer :as writer]
[obb-demo.processor :as processor]
[obb-demo.v... | |
3585e6e888123ff89d0a00575b27bc330758e2218eda5ee8bf3db20e278ab1dd | turquoise-hexagon/euler | solution.scm | (import
(chicken fixnum)
(euler))
(define (make-phi n)
(let ((acc (make-vector (fx+ n 1))))
(do ((i 0 (fx+ i 1))) ((fx> i n))
(vector-set! acc i i))
(for-each
(lambda (p)
(do ((m p (fx+ m p))) ((fx> m n))
(vector-set! acc m (fx- (vector-ref acc m) (fx/ (vector-ref acc m) p))... | null | https://raw.githubusercontent.com/turquoise-hexagon/euler/fa058f7c391e8c9fd79cd8c143b924fca763f3ef/src/spoilers/351/solution.scm | scheme | (import
(chicken fixnum)
(euler))
(define (make-phi n)
(let ((acc (make-vector (fx+ n 1))))
(do ((i 0 (fx+ i 1))) ((fx> i n))
(vector-set! acc i i))
(for-each
(lambda (p)
(do ((m p (fx+ m p))) ((fx> m n))
(vector-set! acc m (fx- (vector-ref acc m) (fx/ (vector-ref acc m) p))... | |
ff1de129cca5d1f22a47a0bbea8698469f52b96e60db1bf25522cd300aa8389a | travitch/foreign-inference | Output.hs | # LANGUAGE RankNTypes , ScopedTypeVariables #
# LANGUAGE ViewPatterns , DeriveGeneric , TemplateHaskell #
# LANGUAGE PatternGuards #
-- | This analysis identifies output parameters.
--
-- Output parameters are those pointer parameters whose target memory
-- is never read from, only written to. This implies that the va... | null | https://raw.githubusercontent.com/travitch/foreign-inference/9cc0f7c730f7cd19afbd00d890abbc7109391cc6/src/Foreign/Inference/Analysis/Output.hs | haskell | | This analysis identifies output parameters.
Output parameters are those pointer parameters whose target memory
is never read from, only written to. This implies that the value
at the target of the pointer at the time of a call is irrelevant.
Bindings can then automatically manage these parameters for
callers.... | # LANGUAGE RankNTypes , ScopedTypeVariables #
# LANGUAGE ViewPatterns , DeriveGeneric , TemplateHaskell #
# LANGUAGE PatternGuards #
bound ( LUB ) .
module Foreign.Inference.Analysis.Output (
OutputSummary,
identifyOutput,
outputSummaryToTestFormat
) where
import GHC.Generics ( Generic )
import Control.Arr... |
2e7180b654e0b8c7553ca32d2c5b11e4c9d3cff7cc5a411434d8bdcda96f1c6d | philnguyen/soft-contract | prims-08.rkt | #lang typed/racket/base
(provide prims-08@)
(require racket/match
racket/set
racket/contract
racket/splicing
typed/racket/unit
set-extras
"../utils/patterns.rkt"
"../ast/signatures.rkt"
"../runtime/signatures.rkt"
"../execution/signature... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/primitives/prims-08.rkt | racket |
[symbols
[vector-immutable/c
8.2 Function Contracts
| #lang typed/racket/base
(provide prims-08@)
(require racket/match
racket/set
racket/contract
racket/splicing
typed/racket/unit
set-extras
"../utils/patterns.rkt"
"../ast/signatures.rkt"
"../runtime/signatures.rkt"
"../execution/signature... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.