_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 |
|---|---|---|---|---|---|---|---|---|
c16f1e3c6e0717efc714625db4bb48cc50e9b890a327f7e7aa3d287fcd6cd8c5 | semmons99/clojure-euler | prob-045.clj | problem 045 ; ; ; ; ; ; ; ; ; ;
(use '[clojure.euler.helpers :only (triangles pentagonals hexagonals)])
(defn prob-045 []
(let [ts (apply sorted-set (take 100000 triangles))
ps (apply sorted-set (take 100000 pentagonals))]
(second (filter #(and (ts %) (ps %)) (rest hexagonals))))) | null | https://raw.githubusercontent.com/semmons99/clojure-euler/3480bc313b9df7f282dadf6e0b48d96230f1bfc1/prob-045.clj | clojure | ; ; ; ; ; ; ; ; ; | (use '[clojure.euler.helpers :only (triangles pentagonals hexagonals)])
(defn prob-045 []
(let [ts (apply sorted-set (take 100000 triangles))
ps (apply sorted-set (take 100000 pentagonals))]
(second (filter #(and (ts %) (ps %)) (rest hexagonals))))) |
c69d9658c210d70c142c03fc70332b113d0617f5d986793fe59e07b433fc9082 | tmaciejewski/see | see_db_storage_ets.erl | -module(see_db_storage_ets).
-behaviour(gen_server).
-include_lib("see_db_records.hrl").
-export([start/0,
stop/0,
update_url/3,
add_url/1,
get_unvisited/0,
set_unvisited/1,
get_page/1,
get_pages_from_index/1,
get_words/1,
get_page_count... | null | https://raw.githubusercontent.com/tmaciejewski/see/3838d06c291fe486a5b3634f1fedcd82336ed985/apps/db/src/see_db_storage_ets.erl | erlang | ------------------------------------------------------------- | -module(see_db_storage_ets).
-behaviour(gen_server).
-include_lib("see_db_records.hrl").
-export([start/0,
stop/0,
update_url/3,
add_url/1,
get_unvisited/0,
set_unvisited/1,
get_page/1,
get_pages_from_index/1,
get_words/1,
get_page_count... |
1ef4bc564b752f6077086f522bbd2b4efa7256dd4cff5580be19b5b85e6615fb | rowangithub/DOrder | spam1.ml | let rec loopb i j len limit bufsize =
if (i < len && j < limit) then (
let _ = assert (j >= 0) in
if (i + 1 < len) then (
assert(i+1<len);(*//1*)
assert(0<=i);(*//2//Interesting assert*)
if (Random.bool ()) then
(assert(i<len);(*//12*)
assert(0<=i);(*//Really really interesting*)
assert(j<b... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/splitter/spam1.ml | ocaml | //1
//2//Interesting assert
//12
//Really really interesting
//13
//14
// buffer[j] = msg[i];
//3
//4
// buffer[j] = msg[i];
//6
//7
//8 //Very intersting
//9
// buffer[j] = msg[i];
//11
/* OK */
// buffer[j] = '.';
//12
//Really really interesting
//13
//14
// buffer[j] = msg[i];
char buffer... | let rec loopb i j len limit bufsize =
if (i < len && j < limit) then (
let _ = assert (j >= 0) in
if (i + 1 < len) then (
if (Random.bool ()) then
let j = j+1 in
let i = i+1 in
loopb i j len limit bufsize)
else
//5 //Interesting Assert
assert(0<=j);
let j = j + 1 in
let i = i... |
943765f545ee75548a9ca7e48157c338925cde12138767101e2f34d37af98825 | clojure-interop/google-cloud-clients | SecurityCenterClient.clj | (ns com.google.cloud.securitycenter.v1beta1.SecurityCenterClient
"Service Description: V1 Beta APIs for Security Center service.
This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:
try (SecurityCenterClient sec... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.securitycenter/src/com/google/cloud/securitycenter/v1beta1/SecurityCenterClient.clj | clojure |
"
| (ns com.google.cloud.securitycenter.v1beta1.SecurityCenterClient
"Service Description: V1 Beta APIs for Security Center service.
This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:
try (SecurityCenterClient sec... |
9b0feb5eb81ad1644f78d2c3228863a129ee321ab1c47f0e153ac6195aef1253 | day8/de-dupe | bench.cljs | (ns de-dupe.test.core
(:require [de-dupe.core :as dd]))
(enable-console-print!)
(defn random-map
[]
(let [constant-list (doall (range 100))]
(into [] (take 100 (repeatedly (fn []
{:non-cached (rand-int 100)
:long-list constant-list}))))))
; (print (random-map)... | null | https://raw.githubusercontent.com/day8/de-dupe/932a03e1c12f8690ce753b2fe639719a7fe5072f/bench/de_dupe/bench.cljs | clojure | (print (random-map)) | (ns de-dupe.test.core
(:require [de-dupe.core :as dd]))
(enable-console-print!)
(defn random-map
[]
(let [constant-list (doall (range 100))]
(into [] (take 100 (repeatedly (fn []
{:non-cached (rand-int 100)
:long-list constant-list}))))))
(def large (doall (t... |
81de24f11009f81b02438e89db7838d83666b72cbdc8d4913f987e5bd47eb78d | conwaysgame/guile | gameoflife-test.scm | (use-modules
(srfi srfi-64)
((game-of-life) #:renamer (symbol-prefix-proc 'gol:)))
(test-begin "game_logic")
;still life:
(define loaf (gol:new-instance gol:game-of-life))
(gol:send 'setgrid! loaf (list (list 0 1 1 0)
(list 1 0 0 1)
(list 0 1 0 1)
... | null | https://raw.githubusercontent.com/conwaysgame/guile/49ceb01ed58248f0ff3155bc3ff40e9a495ed248/gameoflife-test.scm | scheme | still life:
oscillator:
pretty printing
loading from file | (use-modules
(srfi srfi-64)
((game-of-life) #:renamer (symbol-prefix-proc 'gol:)))
(test-begin "game_logic")
(define loaf (gol:new-instance gol:game-of-life))
(gol:send 'setgrid! loaf (list (list 0 1 1 0)
(list 1 0 0 1)
(list 0 1 0 1)
... |
9f6e2e56894fb43bac13fee807482c7f3c8b8e9db2d676d8ac34e6adb3e04d2a | simplex-chat/simplex-chat | M20220224_messages_fks.hs | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20220224_messages_fks where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220224_messages_fks :: Query
m20220224_messages_fks =
[sql|
ALTER TABLE messages ADD COLUMN connection_id INTEGER DEFAULT NULL REFERENCES connections ... | null | https://raw.githubusercontent.com/simplex-chat/simplex-chat/4b39de6c4fdec8d7795b2e7eb457b5661e77aa9b/src/Simplex/Chat/Migrations/M20220224_messages_fks.hs | haskell | # LANGUAGE QuasiQuotes #
module Simplex.Chat.Migrations.M20220224_messages_fks where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220224_messages_fks :: Query
m20220224_messages_fks =
[sql|
ALTER TABLE messages ADD COLUMN connection_id INTEGER DEFAULT NULL REFERENCES connections ... | |
27e392b1ebb8517c0dfc20064ced0557c62e1d6583ccfc7fecf5139986f999f6 | siclait/6.824-cljlabs-2020 | crash.clj | (ns map-reduce.plugin.crash
(:require
[clojure.string :as string]
[map-reduce.plugin :as plugin]))
(defn maybe-crash
[]
(let [max 1000
rr (rand-int max)]
(cond
(< rr 330) (System/exit 1)
(< rr 660) (let [max-ms (* 10 1000)
ms (rand-int max-ms)]
... | null | https://raw.githubusercontent.com/siclait/6.824-cljlabs-2020/0c7ad7ae07d7617b1eb7240080c65f1937ca8a2d/map-reduce/src/map_reduce/plugin/crash.clj | clojure | (ns map-reduce.plugin.crash
(:require
[clojure.string :as string]
[map-reduce.plugin :as plugin]))
(defn maybe-crash
[]
(let [max 1000
rr (rand-int max)]
(cond
(< rr 330) (System/exit 1)
(< rr 660) (let [max-ms (* 10 1000)
ms (rand-int max-ms)]
... | |
027ffc4db751130b5ac325603310864b10e7d4620cc5ec2626e7abfc0bfa7ebd | racket/typed-racket | sqrt.rkt | #;#;
#<<END
TR opt: sqrt.rkt 4:2 (sqrt x) -- unary float
END
""
#lang typed/scheme
#:optimize
#reader typed-racket-test/optimizer/reset-port
(: f (Nonnegative-Float -> Nonnegative-Float))
(define (f x)
(sqrt x))
| null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/optimizer/tests/sqrt.rkt | racket | #; | #<<END
TR opt: sqrt.rkt 4:2 (sqrt x) -- unary float
END
""
#lang typed/scheme
#:optimize
#reader typed-racket-test/optimizer/reset-port
(: f (Nonnegative-Float -> Nonnegative-Float))
(define (f x)
(sqrt x))
|
4d10fdccad2465466f8c3245638f520db48494f2f16bd5dab83e1f3a38821f19 | plumatic/grab-bag | messages.clj | (ns domain.messages
"Definitions for messages involving docs and shares that are passed between
services."
(:use plumbing.core)
(:require
[schema.core :as s]
[schema.utils :as schema-utils]
[plumbing.logging :as log]
[domain.docs :as docs]
[domain.docs.core :as docs-core]
[domain.docs.actions... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/domain/src/domain/messages.clj | clojure |
helpers for doc-hints
new-shares messages: doc-poller --> doc-poller (internal, plus persisted in URL cache)
possibly resolved.
used in both ways in different places.
fetch-doc-message: doc-poller --> doc-fetcher
doc-related messages used in index-master and api
doc-poller --> index-master --> api
doc-fetch... | (ns domain.messages
"Definitions for messages involving docs and shares that are passed between
services."
(:use plumbing.core)
(:require
[schema.core :as s]
[schema.utils :as schema-utils]
[plumbing.logging :as log]
[domain.docs :as docs]
[domain.docs.core :as docs-core]
[domain.docs.actions... |
0b22e5424d82cffc2d01973bcc7887e99ff5779e76857bb8c7071174bb9555f1 | NalaGinrut/artanis | parser.scm | ;;; (json parser) --- Guile JSON implementation.
Copyright ( C ) 2013 Flaque < >
;;
;; This file is part of guile-json.
;;
;; guile-json 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
... | null | https://raw.githubusercontent.com/NalaGinrut/artanis/3412d6eb5b46fde71b0965598ba085bacc2a6c12/artanis/third-party/json/upstream/parser.scm | scheme | (json parser) --- Guile JSON implementation.
This file is part of guile-json.
guile-json is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
guile-json is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the i... |
Copyright ( C ) 2013 Flaque < >
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02110 - 1301 USA
JSON module for
(define-module (artanis third-par... |
d58fa47036e932f7f70a81f7ff17b38eb2f340a932364164f4504f6401c026ab | lloda/guile-newra | print.scm | -*- mode : scheme ; coding : utf-8 -*-
( c ) 2017 - 2018 , 2021
; This library 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 versi... | null | https://raw.githubusercontent.com/lloda/guile-newra/80b75ef4e02029958a4e5f699e9cc16220c2f099/mod/newra/print.scm | scheme | coding : utf-8 -*-
This library is free software; you can redistribute it and/or modify it under
either version 3 of the License , or ( at your option ) any
later version.
Commentary:
printer. This module also provides a pretty-printer (ra-format).
Code:
print len of dead axes with 'd and of infinite axes with ... |
( c ) 2017 - 2018 , 2021
the terms of the GNU General Public License as published by the Free
Printer for ra objects . They start with # % instead of # , otherwise the syntax
is the same as for regular arrays . Loading this module installs the
(define-module (newra print)
#:export (ra-print-prefix ra-p... |
73d1b2a3ad9aed6d14ffd7a2569be2db3eb7d676128293b288dbeae8fc148e12 | eugeneia/athens | sosemanuk.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
sosemanuk.lisp - implementation of the Sosemanuk stream cipher
(in-package :crypto)
(defconst +sosemanuk-mul-a+
(make-array 256
:element-type '(unsigned-byte 32)
:initial-contents '(#x00000000 #xE19FCF13 #x6B973726 #x8A08F835
... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/ironclad-v0.40/src/ciphers/sosemanuk.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*- | sosemanuk.lisp - implementation of the Sosemanuk stream cipher
(in-package :crypto)
(defconst +sosemanuk-mul-a+
(make-array 256
:element-type '(unsigned-byte 32)
:initial-contents '(#x00000000 #xE19FCF13 #x6B973726 #x8A08F835
#xD6876E4C #x3718A15F #xB... |
a565b8d81346f8535a1666e8bb9759c5265d02ffc2e72d6157cdd4abaa1af5c1 | hugoduncan/makejack | jar.clj | (ns makejack.tasks.jar
(:require
[babashka.fs :as fs]
[clojure.tools.build.api :as b]
[makejack.defaults.api :as defaults]
[makejack.deps.api :as mj-deps]
[makejack.project-data.api :as project-data]
[makejack.verbose.api :as v]))
(defn jar
"Build a jar file"
[params]
(binding [b/*project-roo... | null | https://raw.githubusercontent.com/hugoduncan/makejack/29bd56233997bd1b9a2140e562f6364251b549a6/bases/tasks/src/makejack/tasks/jar.clj | clojure | (ns makejack.tasks.jar
(:require
[babashka.fs :as fs]
[clojure.tools.build.api :as b]
[makejack.defaults.api :as defaults]
[makejack.deps.api :as mj-deps]
[makejack.project-data.api :as project-data]
[makejack.verbose.api :as v]))
(defn jar
"Build a jar file"
[params]
(binding [b/*project-roo... | |
2e240eec5a44d4d27534067c5e188c1542e8cd93c9727a972d8de21ca92c3003 | helium/router | router_decoder_cayenne.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% == Cayenne Decoder ==
%%%
LPP = Low Power Payload
MyDevices Cayenne LPP Docs
%%% [/#lora-cayenne-low-power-payload]
%%% Test Vectors []
%%% #issuecomment-822964880
%%%
%%% `last' key is added to last map in collection for json templ... | null | https://raw.githubusercontent.com/helium/router/d0dc9aadfcb3042e9f8e81f5afa71ff34bd208b8/src/decoders/router_decoder_cayenne.erl | erlang | -------------------------------------------------------------------
@doc
== Cayenne Decoder ==
[/#lora-cayenne-low-power-payload]
Test Vectors []
#issuecomment-822964880
`last' key is added to last map in collection for json templating
@end
-------------------------------------------------------------------
'... | LPP = Low Power Payload
MyDevices Cayenne LPP Docs
-module(router_decoder_cayenne).
-export([decode/3]).
-define(DIGITAL_IN, 0).
-define(DIGITAL_OUT, 1).
-define(ANALOG_IN, 2).
-define(ANALOG_OUT, 3).
-define(GENERIC_SENSOR, 100).
-define(LUMINANCE, 101).
-define(PRESENCE, 102).
-define(TEMPERATURE, 103).
-define... |
b6866750d000988d2f1ff2af411972cd4a97aa2179e1b4371d8f9aabdedb799a | zachjs/sv2v | Expr.hs | # LANGUAGE PatternSynonyms #
sv2v
- Author : < >
- Initial Verilog AST Author : < >
-
- SystemVerilog expressions
- Author: Zachary Snow <>
- Initial Verilog AST Author: Tom Hawkins <>
-
- SystemVerilog expressions
-}
module Language.SystemVerilog.AST.Expr
( Expr (..)
, Range
, ... | null | https://raw.githubusercontent.com/zachjs/sv2v/ed09fe88cffa38f36372ff29b32e15cd463a7bfe/src/Language/SystemVerilog/AST/Expr.hs | haskell | # SOURCE # | # LANGUAGE PatternSynonyms #
sv2v
- Author : < >
- Initial Verilog AST Author : < >
-
- SystemVerilog expressions
- Author: Zachary Snow <>
- Initial Verilog AST Author: Tom Hawkins <>
-
- SystemVerilog expressions
-}
module Language.SystemVerilog.AST.Expr
( Expr (..)
, Range
, ... |
62439bd976bfdca12bbafcb4c13e5b93b50c2a4c48348ecf07d766847068be1d | moby/vpnkit | cstructs.mli |
* A subset of the Cstruct signature with type t = Cstruct.t list
This should be replaced with another parser , perhaps ?
This should be replaced with another parser, perhaps angstrom? *)
type t = Cstruct.t list
(** Data stored as a list of fragments *)
val to_string: t -> string
val shift: t -> int -> ... | null | https://raw.githubusercontent.com/moby/vpnkit/7bfcba6e59c1e5450b667a392bf56371faae58b2/src/cstructs/cstructs.mli | ocaml | * Data stored as a list of fragments
* Returns a contiguous Cstruct.t, which may or may not involve a copy. |
* A subset of the Cstruct signature with type t = Cstruct.t list
This should be replaced with another parser , perhaps ?
This should be replaced with another parser, perhaps angstrom? *)
type t = Cstruct.t list
val to_string: t -> string
val shift: t -> int -> t
val len: t -> int
val sub: t -> int ->... |
0ea557557283bb3a11df11a0f9682fc39a8df30140366b45e62d752b59bbcc9f | emqx/emqx | emqx_conf_cli.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 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/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_conf/src/emqx_conf_cli.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 ) 2020 - 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(emqx_conf_cli).
-export([
load/0,
admins/1,
unload/0
]).
-define(CMD, clust... |
9e4de07a65f6570350a4faa9eb5870ebee05f5fcf10e4ce0c2420faaa1fe3b00 | blindglobe/clocc | menu.lisp | -*- Mode : Lisp ; Package : USER ; ; Lowercase : T ; Syntax : Common - Lisp -*-
;;;----------------------------------------------------------------------------------+
;;; |
;;; TEXAS INSTRUMENTS INCORPORATED ... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/gui/clue/clue/examples/menu.lisp | lisp | Package : USER ; ; Lowercase : T ; Syntax : Common - Lisp -*-
----------------------------------------------------------------------------------+
|
TEXAS INSTRUMENTS INCORPORATED |
... |
P.O. BOX 149149 |
, TEXAS 78714 - 9149 |
Texas Instruments Incorporated provides this software " as is " without express or |
Source code for CLUE examples described in Explorer X Win... |
8e0e105486f5e828b3e357dca1d8d54f4bf4d46e3874f1d5ff95720f5bb29e8a | yrashk/erlang | ssh_connection_manager.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/yrashk/erlang/e1282325ed75e52a98d58f5bd9fb0fa27896173f/lib/ssh/src/ssh_connection_manager.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
requests e.i . the SSH Connection Protoco... |
1b8e079fe9bdbb6ddef3bbecd8bac125ec23fcd330926501cb0036197d926c4e | den1k/vimsical | transit.cljs | (ns vimsical.common.util.transit
(:require [cognitect.transit :as transit]))
;;
;; * Types
;;
(def sorted-map-write-handler
(transit/write-handler (constantly "sorted-map") (fn [x] (into {} x))))
(def sorted-map-read-handler
(transit/read-handler (fn [x] (into (sorted-map) x))))
;;
;; * Writer
;;
(def defaul... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/common/vimsical/common/util/transit.cljs | clojure |
* Types
* Writer
* Reader
/#!topic/clojurescript/_B52tadgUgw
* API
| (ns vimsical.common.util.transit
(:require [cognitect.transit :as transit]))
(def sorted-map-write-handler
(transit/write-handler (constantly "sorted-map") (fn [x] (into {} x))))
(def sorted-map-read-handler
(transit/read-handler (fn [x] (into (sorted-map) x))))
(def default-writer-opts
{:handlers {cljs.co... |
3695e4cbe1bd7662083a661c132e98924857e60f9895c9174b87a655999b23dc | UU-ComputerScience/uhc | Main.hs |
- This is a EHC modified version of th 3 ^ 8 benchmark of the nofib / imaginary
- Original code by to be compiled by EHC :
- This is a EHC modified version of th 3^8 benchmark of the nofib/imaginary
- Original code by Lennart Augustsson
- Changes to be compiled by EHC: John van Schie
-}
infix 8 ^^... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/nofib-jvschie/imaginary/exp3_8/Main.hs | haskell | Num instance
partain:sig |
- This is a EHC modified version of th 3 ^ 8 benchmark of the nofib / imaginary
- Original code by to be compiled by EHC :
- This is a EHC modified version of th 3^8 benchmark of the nofib/imaginary
- Original code by Lennart Augustsson
- Changes to be compiled by EHC: John van Schie
-}
infix 8 ^^... |
d794443b2f1d6e31adf460bb1ed45736e7b457341e4c9c6cfdf95fba5f6df2db | Kleidukos/Intrigue | Lexer.hs | module Intrigue.Lexer where
import Data.Text ( Text )
import Data.Void
import Text.Megaparsec
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L
type Parser = Parsec Void Text
skipLineComment :: Parser ()
skipLineComment = L.sk... | null | https://raw.githubusercontent.com/Kleidukos/Intrigue/d6cb7a0ee13c04b7ef0c8ca15ac5600da25100ff/src/Intrigue/Lexer.hs | haskell | module Intrigue.Lexer where
import Data.Text ( Text )
import Data.Void
import Text.Megaparsec
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L
type Parser = Parsec Void Text
skipLineComment :: Parser ()
skipLineComment = L.sk... | |
ccdd985155bfa2dbcf1e1ebd21b3b8b3996247cfa4f6ab47983ebf8f77d7804c | tweag/ormolu | associated-data.hs | # LANGUAGE TypeFamilies #
instance Foo Int where data Bar Int = IntBar Int Int
instance Foo Double where
newtype
Bar
Double
=
DoubleBar
Double
Double
instance Foo [a]
where
data Bar [a] =
ListBar [Bar a]
data Baz [a] =
L... | null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/instance/associated-data.hs | haskell | # LANGUAGE TypeFamilies #
instance Foo Int where data Bar Int = IntBar Int Int
instance Foo Double where
newtype
Bar
Double
=
DoubleBar
Double
Double
instance Foo [a]
where
data Bar [a] =
ListBar [Bar a]
data Baz [a] =
L... | |
4945991653d079fb3e9e692c5ae8b197dbd9955eb874d3ce71736934f9fb2c50 | shirok/Gauche | 173.scm | ;;;
;;; SRFI-173 hooks
;;;
(define-module srfi.173
(use gauche.hook)
(export make-hook hook? list->hook list->hook!
hook-add! hook-delete! hook-reset!
hook->list hook-run))
(select-module srfi.173)
;; The following procedures are the same as gauche.hook
make - hook hook ? hook->list
(de... | null | https://raw.githubusercontent.com/shirok/Gauche/e606bfe5a94b100d5807bca9c2bb95df94f60aa6/lib/srfi/173.scm | scheme |
SRFI-173 hooks
The following procedures are the same as gauche.hook |
(define-module srfi.173
(use gauche.hook)
(export make-hook hook? list->hook list->hook!
hook-add! hook-delete! hook-reset!
hook->list hook-run))
(select-module srfi.173)
make - hook hook ? hook->list
(define (hook-add! hook proc) (add-hook! hook proc))
(define (hook-delete! hook proc) ... |
d6818a130c242e00e8b23489b118836d46f73e255f8da6d483edd01e3028469b | aryx/xix | IO.ml |
* Copyright ( C ) 2003
*
* 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 2.1 of the License , or ( at your option ) any later version ,
* with th... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/lib_core/commons/IO.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
* Copyright ( C ) 2003
*
* 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 2.1 of the License , or ( at your option ) any later version ,
* with th... |
3fe2553e593a6482214388795521be3a7c74093ae0dd6ca5fa34fbef4b80ebea | haskell-works/hw-prim | ByteString.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE MultiWayIf #-}
# LANGUAGE ScopedTypeVariables #
module HaskellWorks.Data.ByteString
( chunkedBy
, ToByteString(..)
, ToByteStrings(..)
, mmap
, padded
, rechunk
, rechunkPadded
, resegment
, resegmentPadded
... | null | https://raw.githubusercontent.com/haskell-works/hw-prim/aff74834cd2d3fb0eb4994b24b2d1cdef1e3e673/src/HaskellWorks/Data/ByteString.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MultiWayIf #
| Chunk a @bs into list of smaller byte strings of no more than @n elements | # LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
module HaskellWorks.Data.ByteString
( chunkedBy
, ToByteString(..)
, ToByteStrings(..)
, mmap
, padded
, rechunk
, rechunkPadded
, resegment
, resegmentPadded
, hGetContentsChunkedBy
) where
import Control.Monad.ST
import Data.Wo... |
055bbebbad4c6c2a43f6a8745098d1fa7ff774544a3f12d5dca6255b75b91ee9 | yoriyuki/Camomile | absCe.mli | (** Collaiton Element, abstracted *)
Copyright ( C ) 2003
(* 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 2 of
the License , or ( at your option ) any late... | null | https://raw.githubusercontent.com/yoriyuki/Camomile/d7d8843c88fae774f513610f8e09a613778e64b3/Camomile/toolslib/absCe.mli | ocaml | * Collaiton Element, abstracted
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
may link, statically or dynamically, a "work that uses this library"
with a publicly distributed version of this library to produce an
executable fil... |
Copyright ( C ) 2003
as published by the Free Software Foundation ; either version 2 of
the License , or ( at your option ) any later version .
As a special exception to the GNU Library General Public License , you
additional requirements listed in clause 6 of the GNU Library General
we mean either the... |
28774ce4f0dff32b407886fef48922603616b2c3995b80481e5bc0f5f09f6169 | aeternity/aesophia | aeso_vm_decode.erl | %%%-------------------------------------------------------------------
( C ) 2017 , Aeternity Anstalt
%%% @doc Decoding fate data to AST
%%% @end
%%%-------------------------------------------------------------------
-module(aeso_vm_decode).
-export([ from_fate/2 ]).
-include_lib("aebytecode/include/aeb_fate_data... | null | https://raw.githubusercontent.com/aeternity/aesophia/a894876f56a818f6237259a7c48cbe6f4a4c01f8/src/aeso_vm_decode.erl | erlang | -------------------------------------------------------------------
@doc Decoding fate data to AST
@end
------------------------------------------------------------------- | ( C ) 2017 , Aeternity Anstalt
-module(aeso_vm_decode).
-export([ from_fate/2 ]).
-include_lib("aebytecode/include/aeb_fate_data.hrl").
-spec from_fate(aeso_syntax:type(), aeb_fate_data:fate_type()) -> aeso_syntax:expr().
from_fate({id, _, "address"}, ?FATE_ADDRESS(Bin)) -> {account_pubkey, [], Bin};
from_fate({... |
ca0774a0f30fe0333629d216bcd1f3690bfc6274cd470adb0fc013de6a0dd028 | caradoc-org/caradoc | file.mli | (*****************************************************************************)
(* Caradoc: a PDF parser and validator *)
Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
(* ... | null | https://raw.githubusercontent.com/caradoc-org/caradoc/100f53bc55ef682049e10fabf24869bc019dc6ce/src/file.mli | ocaml | ***************************************************************************
Caradoc: a PDF parser and validator
This program is free software; you can redistribute it and/or modify
... | Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have rece... |
eb120892ff3efa596fdd1fb6958f0737f2e676445ad64f77070d65af33aee562 | debasishg/hask | Id.hs | # OPTIONS_GHC -fno - warn - redundant - constraints #
# LANGUAGE AllowAmbiguousTypes #
-- | Contains safe 'Id' representation.
module Lib.Core.Id
( -- * Id
Id (..)
, AnyId
, castId
) where
import Data.Type.Equality (type (==))
-- | Wrapper for textual id. Contains phantom type... | null | https://raw.githubusercontent.com/debasishg/hask/1745ed50c8175cd035e8070c9cb988f4f5063653/h3layer/src/Lib/Core/Id.hs | haskell | | Contains safe 'Id' representation.
* Id
| Wrapper for textual id. Contains phantom type parameter for increased
type-safety.
| When we don't care about type of 'Id' but don't want to deal with type variables
| Unsafe cast of 'Id'. Implementation uses smart trick to enforce usage
always with @TypeApplications@. | # OPTIONS_GHC -fno - warn - redundant - constraints #
# LANGUAGE AllowAmbiguousTypes #
module Lib.Core.Id
Id (..)
, AnyId
, castId
) where
import Data.Type.Equality (type (==))
newtype Id a = Id { unId :: Text }
deriving stock (Show, Generic)
deriving newtype (Eq, Ord, Hashab... |
9a313e72760cdb1d856d3a4541b77ac002be7140a2f6147d1e16d129383f48ea | haskell-works/eta-kafka-client | Producer.hs | {-# LANGUAGE OverloadedStrings #-}
module Kafka.Producer
( module X
, KafkaProducer, JFuture, JRecordMetadata
, newProducer
, send
, closeProducer
, mkJProducerRecord
) where
import Java
import Java.Collections as J
import Control.Monad.IO.Class
import Data.Bif... | null | https://raw.githubusercontent.com/haskell-works/eta-kafka-client/d6f79e7b06e3ab16117150fac543c79413b16483/src/Kafka/Producer.hs | haskell | # LANGUAGE OverloadedStrings # | module Kafka.Producer
( module X
, KafkaProducer, JFuture, JRecordMetadata
, newProducer
, send
, closeProducer
, mkJProducerRecord
) where
import Java
import Java.Collections as J
import Control.Monad.IO.Class
import Data.Bifunctor
import Data.ByteSt... |
c34f3d2c12cd89fad0bbbd4b8a4046ee86e9a0b2016e3c76b9cf2e8f02b48469 | ndmitchell/profiterole | Type.hs | # LANGUAGE RecordWildCards #
module Type(
Val(..),
mergeVal,
valFromProfile
) where
import GHC.Prof
import Data.Maybe
import Data.Scientific
import Data.Tree
import qualified Data.Text as T
data Val = Val
{name :: String -- Name of this node
Time spent under this node
Time spent under this n... | null | https://raw.githubusercontent.com/ndmitchell/profiterole/984d915652948cd77d7c87216285c94a85d4304b/src/Type.hs | haskell | Name of this node
Number of times this node was called | # LANGUAGE RecordWildCards #
module Type(
Val(..),
mergeVal,
valFromProfile
) where
import GHC.Prof
import Data.Maybe
import Data.Scientific
import Data.Tree
import qualified Data.Text as T
data Val = Val
Time spent under this node
Time spent under this node excluding rerooted
Time spent in th... |
d336e5435add490b26b898927d6e43a01d65584fc0c86860e41664a0837e3f1d | mauricioszabo/atom-chlorine | state.cljs | (ns chlorine.state
(:require [reagent.core :as r]))
(def configs {:eval-mode
{:description "Should we evaluate Clojure or ClojureScript?"
:type [:prefer-clj :prefer-cljs :clj :cljs]
:default :prefer-clj}
:refresh-mode
{:description "Should we u... | null | https://raw.githubusercontent.com/mauricioszabo/atom-chlorine/86628b7b9cae7c1ae352abe0caefc6f960c37a3f/src/chlorine/state.cljs | clojure | (ns chlorine.state
(:require [reagent.core :as r]))
(def configs {:eval-mode
{:description "Should we evaluate Clojure or ClojureScript?"
:type [:prefer-clj :prefer-cljs :clj :cljs]
:default :prefer-clj}
:refresh-mode
{:description "Should we u... | |
76ca4a473f486a55c66c7cdbc9c61ce8f038f7389089590ab5ea1b706580ef85 | xsc/claro | resolver.cljc | (ns claro.engine.resolver
(:require [claro.runtime.impl :as impl]
[claro.data
[error :refer [error?]]
[protocols :as p]
[tree :refer [wrap-tree]]]))
;; ## Helpers
(defn- result-as-map
[batch result]
(if (map? result)
result
(zipmap batch result)))
(def... | null | https://raw.githubusercontent.com/xsc/claro/16db75b7a775a14f3b656362e8ee4f65dd8b0d49/src/claro/engine/resolver.cljc | clojure | ## Helpers
## Transformation | (ns claro.engine.resolver
(:require [claro.runtime.impl :as impl]
[claro.data
[error :refer [error?]]
[protocols :as p]
[tree :refer [wrap-tree]]]))
(defn- result-as-map
[batch result]
(if (map? result)
result
(zipmap batch result)))
(defn- map-kv
[f... |
a58c3bb38c66f06b6f68263ee6dbfcb9ad48ad87b521d8038e212a8d53a2588b | pbevin/cardelli | ParseSpec.hs | module ParseSpec where
import Test.Hspec
import Test.QuickCheck
import Parse
import ShowExpr
import ASTGen
import AST
import Debug.Trace
spec :: Spec
spec = do
describe "parseFun" $ do
it "parses an identifier" $ do
parseFun "x" `shouldBe` Var "x"
it "parses a number" $ do
parseFun "0" `shoul... | null | https://raw.githubusercontent.com/pbevin/cardelli/bf239351289d379796fa68c25bb6c56be0e67925/hs/test/ParseSpec.hs | haskell | module ParseSpec where
import Test.Hspec
import Test.QuickCheck
import Parse
import ShowExpr
import ASTGen
import AST
import Debug.Trace
spec :: Spec
spec = do
describe "parseFun" $ do
it "parses an identifier" $ do
parseFun "x" `shouldBe` Var "x"
it "parses a number" $ do
parseFun "0" `shoul... | |
e14c2d3537bf2717b96128c84b8d41732691e06e3a862fb2422772cf79648c44 | brendanhay/gogol | Get.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/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-shopping-content/gen/Gogol/ShoppingContent/Content/Orders/Get.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Resource
** Constructing a Request
| A resource alias for @content.orders.get@ method which the
| V1 error format.
| OAuth access token.
| The ID of the account that manages the order. This cannot be a multi-client accoun... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
de0382dc42d2deb811306a57404986c7874e5af1e135c8c2dd2bc1938005fe76 | sdiehl/paris-fp | Main.hs | module Main where
import Protolude
import qualified Entry
main :: IO ()
main = Entry.main
| null | https://raw.githubusercontent.com/sdiehl/paris-fp/d3ab8e0dde9035e17d755355d275ddc3c5bc57e7/exec/Main.hs | haskell | module Main where
import Protolude
import qualified Entry
main :: IO ()
main = Entry.main
| |
88f110970c1738af2335a65f2dd27148687e4e27442132d18461bdf3dc93248e | MarcKaufmann/congame | info.rkt | #lang info
(define collection "congame-pjb-studies")
(define deps '("base"
"component-lib"
"congame-core"
"congame-price-lists"
"forms-lib"
"gregor-lib"
"htdp-lib"
"koyo-lib"
"marionette-lib"
... | null | https://raw.githubusercontent.com/MarcKaufmann/congame/17edf790b5a9af0439d532f3af61dd60d10c8964/congame-pjb-studies/info.rkt | racket | #lang info
(define collection "congame-pjb-studies")
(define deps '("base"
"component-lib"
"congame-core"
"congame-price-lists"
"forms-lib"
"gregor-lib"
"htdp-lib"
"koyo-lib"
"marionette-lib"
... | |
399f7e683b8480ce4a37776d7686abd29442c29300c0193202415dffe6cd4988 | roman01la/cljs-rum-realworld-example-app | base.cljs | (ns conduit.components.base
(:require [rum.core :as rum]))
(rum/defc Icon
([icon] (Icon {} icon))
([{:keys [on-click]} icon]
[:i {:on-click on-click
:class (str "ion-" (name icon))}]))
(defn- btn-class [class type size outline?]
(str
class
" "
(case size
:L "btn-lg"
"btn... | null | https://raw.githubusercontent.com/roman01la/cljs-rum-realworld-example-app/962695bd391806a7066340461c3e02f2215fdc48/src/conduit/components/base.cljs | clojure | (ns conduit.components.base
(:require [rum.core :as rum]))
(rum/defc Icon
([icon] (Icon {} icon))
([{:keys [on-click]} icon]
[:i {:on-click on-click
:class (str "ion-" (name icon))}]))
(defn- btn-class [class type size outline?]
(str
class
" "
(case size
:L "btn-lg"
"btn... | |
6b93d67ee5b1f6bda41bf7bb0c1b5d38915b5bcfc6ce7abd33c676981bd60efe | samply/blaze | spec.clj | (ns blaze.fhir.spec.type.system.spec
(:require
[blaze.fhir.spec.type.system :as system]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]))
(s/def :system/date
(s/with-gen
system/date?
#(gen/fmap
(partial apply system/date)
(gen/tuple
(s/gen (s/int-in 1 10000))... | null | https://raw.githubusercontent.com/samply/blaze/693d07d8fbf9ac4e11af6684978e108bbd193780/modules/fhir-structure/src/blaze/fhir/spec/type/system/spec.clj | clojure | (ns blaze.fhir.spec.type.system.spec
(:require
[blaze.fhir.spec.type.system :as system]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]))
(s/def :system/date
(s/with-gen
system/date?
#(gen/fmap
(partial apply system/date)
(gen/tuple
(s/gen (s/int-in 1 10000))... | |
a8d2e11c329db8c710905b9c59c1532200ecc751eddda216b71cd605defee101 | jeromesimeon/Galax | code_tj_pathstack.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/code_selection/code/code_tj_pathstack.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : code_tj_pathstack.ml , v 1.6 2007/02/01 22:08:45 simeon Exp $
Module : Code_tj_pathstack
Description :
This is the code for the PathStack variant of the TwigJoin .
Description:
This is the code for the PathStac... |
2a5edc2dd75159f3ad4a970382a5f9e66b223879e4f1c9c60ffc2ff50e215474 | froggey/Mezzano | spy.lisp | ;;;; Spy
;;;;
into the internal state of the compositor .
(defpackage :mezzano.gui.spy
(:use :cl)
(:export #:spy #:spawn)
(:local-nicknames (:sync :mezzano.sync)
(:gui :mezzano.gui)
(:comp :mezzano.gui.compositor)
(:font :mezzano.gui.font)
... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/applications/spy.lisp | lisp | Spy
Spy on the compositor's event queue too, so we refresh
immediately when it gets an input or damage event. | into the internal state of the compositor .
(defpackage :mezzano.gui.spy
(:use :cl)
(:export #:spy #:spawn)
(:local-nicknames (:sync :mezzano.sync)
(:gui :mezzano.gui)
(:comp :mezzano.gui.compositor)
(:font :mezzano.gui.font)
(:wi... |
f3d04718248bef98e9226383e16f91930e0ae4dc74fa9f9dafe1835e82e50db2 | ddssff/refact-global-hse | LoadModule.hs | # LANGUAGE FlexibleInstances , PackageImports , ScopedTypeVariables , TemplateHaskell , TypeSynonymInstances #
module LoadModule
( loadModule
, loadModules
, Annot
) where
import Control.Lens (view)
import CPP (extensionsForHSEParser, GHCOpts, applyHashDefine, enabled, hashDefines)
import qualified CP... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/tests/expected/decl2/LoadModule.hs | haskell | | Load a list of modules and compute their global scoping info.
liftIO $ writeFile (path ++ ".cpp") processed
putStr processed
moduleText
putStrLn ("loaded " ++ prettyShow key)
| Turn of the locations flag. This means simple #if macros will not
affect the line numbers of the output text, so we can use the
coul... | # LANGUAGE FlexibleInstances , PackageImports , ScopedTypeVariables , TemplateHaskell , TypeSynonymInstances #
module LoadModule
( loadModule
, loadModules
, Annot
) where
import Control.Lens (view)
import CPP (extensionsForHSEParser, GHCOpts, applyHashDefine, enabled, hashDefines)
import qualified CP... |
8abcd86bb1d73556a826db275bcb597ae74537276261957362742bbb24f54f2b | wfnuser/sicp-solutions | e3-1.scm | (define (make-accumulator sum)
(lambda (step) (begin (set! sum (+ sum step)) sum))
)
(define A (make-accumulator 5))
(A 10)
(A 10) | null | https://raw.githubusercontent.com/wfnuser/sicp-solutions/2c94b28d8ee004dcbfe7311f866e5a346ee01d12/ch3/e3-1.scm | scheme | (define (make-accumulator sum)
(lambda (step) (begin (set! sum (+ sum step)) sum))
)
(define A (make-accumulator 5))
(A 10)
(A 10) | |
54cde2d640179472a7d51046bb7b4ac644b80b50bc641ff70ac821542cbc2ead | spurious/sagittarius-scheme-mirror | time-private.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; sagittarius/time-private.scm - private library of time related libraries
;;;
Copyright ( c ) 2010 - 2015 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following condi... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/ext/time/sagittarius/time-private.scm | scheme | coding : utf-8 ; -*-
sagittarius/time-private.scm - private library of time related libraries
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above c... | Copyright ( c ) 2010 - 2015 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library (sagittarius time-private)
(exp... |
8585ac2e1b02f1a03e2ab03090d8dd089bc09f20e8c026ceb71ae670a6ae949b | NicolasT/landlock-hs | Version.hs | module System.Landlock.Version
( Version (..),
version1,
version2,
version3,
)
where
-- | Representation of a Landlock ABI version as reported by the kernel.
newtype Version = Version
{ -- | Get the numerical version.
getVersion :: Word
}
deriving (Show, Eq, Ord)
All ABI versions supported... | null | https://raw.githubusercontent.com/NicolasT/landlock-hs/27d2d95478f8c85cfbf4025bb41d57d0e57d670f/landlock/internal/System/Landlock/Version.hs | haskell | | Representation of a Landlock ABI version as reported by the kernel.
| Get the numerical version. | module System.Landlock.Version
( Version (..),
version1,
version2,
version3,
)
where
newtype Version = Version
getVersion :: Word
}
deriving (Show, Eq, Ord)
All ABI versions supported by this library should be exposed as a value .
| ABI version 1 .
version1 :: Version
version1 = Version 1... |
5f74d3a9de5c0d4611a85965b8c3a41510eaf7cb696b2f82e35113e130859841 | ocaml-omake/omake | lm_map_sig.ml |
(************************************************************************
* Maps.
*)
module type OrderedType =
sig
type t
val compare : t -> t -> int
end
module type LmMapBase =
sig
type key
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val cardinal : 'a t -> int
val add : 'a t -> ke... | null | https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/libmojave/lm_map_sig.ml | ocaml | ***********************************************************************
* Maps.
* This is the backwards-compatible version.
***********************************************************************
* Tables
* The record of methods.
Debugging
* Creation functions.
printer
comparison function
appen... |
module type OrderedType =
sig
type t
val compare : t -> t -> int
end
module type LmMapBase =
sig
type key
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val cardinal : 'a t -> int
val add : 'a t -> key -> 'a -> 'a t
val find : 'a t -> key -> 'a
val remove : 'a t -> key -> 'a t
... |
c0d69997c70c0471c53ac20c04b1b38dc9cc12050bdbc017c2a9012edcab3065 | portkey-cloud/portkey | dev.clj | (ns dev
(:require [ring-app.handler :as handler]
[portkey.core :as pk]
[org.httpkit.server :as http]))
(defn start-local-server []
(http/run-server #'handler/app {:port 3000}))
(defn deploy-lambda []
(pk/mount-ring! #'handler/app :path "/greetings"))
| null | https://raw.githubusercontent.com/portkey-cloud/portkey/30c1e9170c5f6df85fc58d9c644a60cd1464a6d9/examples/ring-app/dev/dev.clj | clojure | (ns dev
(:require [ring-app.handler :as handler]
[portkey.core :as pk]
[org.httpkit.server :as http]))
(defn start-local-server []
(http/run-server #'handler/app {:port 3000}))
(defn deploy-lambda []
(pk/mount-ring! #'handler/app :path "/greetings"))
| |
ac366ab15aa3e1818f8c424162538ff67bf8ac375f41f58ce3ec97187d40b970 | sjl/euler | polydivisible-numbers.lisp | (defpackage :euler/4d/polydivisible-numbers #.euler:*use*)
(in-package :euler/4d/polydivisible-numbers)
(setf lparallel:*kernel* (lparallel:make-kernel 30))
(deftype radix ()
'(integer 2 64))
(deftype digit ()
'(integer 1 63))
(deftype digit-set ()
'(unsigned-byte 63))
(defun make-digits (radix)
(1- (expt ... | null | https://raw.githubusercontent.com/sjl/euler/29cd8242172a2d11128439bb99217a0a859057ed/src/4d/polydivisible-numbers.lisp | lisp | #'mapcan | (defpackage :euler/4d/polydivisible-numbers #.euler:*use*)
(in-package :euler/4d/polydivisible-numbers)
(setf lparallel:*kernel* (lparallel:make-kernel 30))
(deftype radix ()
'(integer 2 64))
(deftype digit ()
'(integer 1 63))
(deftype digit-set ()
'(unsigned-byte 63))
(defun make-digits (radix)
(1- (expt ... |
0f511f242c4e0669437c3607163b1b982ad2b16a10d1055678787bf7411d35b0 | jwiegley/notes | Bollu.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Bollu where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Control
import Control.Monad.Trans.Cont
import Data.Maybe
import Data.Monoid
import Debug.Trace
f... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Bollu.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes # |
module Bollu where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Control
import Control.Monad.Trans.Cont
import Data.Maybe
import Data.Monoid
import Debug.Trace
from :: (a -> b) -> a -> Cont r b
from f x = return (f x)
to ::... |
bdaf896f7dac25b41029f7d62c3a364cf54b2298976cfac619b6f1f4c1dc8aa3 | e-bigmoon/haskell-blog | Sharing_the_Manager.hs | #!/usr/bin/env stack
-- stack script --resolver lts-17.3
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent.Async (Concurrently (..))
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy as L
import Data.Foldable (sequenceA_)
import quali... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/appendix/ap4/Sharing_the_Manager.hs | haskell | stack script --resolver lts-17.3
# LANGUAGE OverloadedStrings #
Using bytestring-based output to avoid interleaving of string-based
output | #!/usr/bin/env stack
import Control.Concurrent.Async (Concurrently (..))
import qualified Data.ByteString.Char8 as S8
import qualified Data.ByteString.Lazy as L
import Data.Foldable (sequenceA_)
import qualified Data.Text as T
import Data.Text.Encoding... |
32e43fd270021ad9147b37090b2229de3d4230860453f7c78e1d3c8e2087ab99 | camllight/camllight | test_nats.ml | #open "test";;
#open "nat";;
#open "big_int";;
#open "int_misc";;
let ignore _ = ();;
Can compare nats less than 2**32
let equal_nat n1 n2 =
eq_nat n1 0 (num_digits_nat n1 0 1)
n2 0 (num_digits_nat n2 0 1);;
testing_function "num_digits_nat";;
test 0 eq (false,not true);;
test 1 eq (true,not false);;
t... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/libnum/test/test_nats.ml | ocaml | #open "test";;
#open "nat";;
#open "big_int";;
#open "int_misc";;
let ignore _ = ();;
Can compare nats less than 2**32
let equal_nat n1 n2 =
eq_nat n1 0 (num_digits_nat n1 0 1)
n2 0 (num_digits_nat n2 0 1);;
testing_function "num_digits_nat";;
test 0 eq (false,not true);;
test 1 eq (true,not false);;
t... | |
c93e495c488b7f4dff7e661ef58a66c457f9270e7a9bff332d1544f897fea98f | clojars/clojars-web | group_verification_test.clj | (ns clojars.integration.group-verification-test
(:require
[clj-http.client :as http]
[clojars.email :as email]
[clojars.integration.steps :refer [register-as]]
[clojars.test-helper :as help]
[clojure.test :refer [deftest is use-fixtures]]
[kerodon.core :as kerodon :refer [fill-in follow-redirect
... | null | https://raw.githubusercontent.com/clojars/clojars-web/b5107cb70934299e1b7e334c02b87a6c72fc037d/test/clojars/integration/group_verification_test.clj | clojure | (ns clojars.integration.group-verification-test
(:require
[clj-http.client :as http]
[clojars.email :as email]
[clojars.integration.steps :refer [register-as]]
[clojars.test-helper :as help]
[clojure.test :refer [deftest is use-fixtures]]
[kerodon.core :as kerodon :refer [fill-in follow-redirect
... | |
2a687e14bfe278476c9056cf0a385efba49ebcd3eb370f8ab8e8ccb30991504b | spechub/Hets | ExtendedParameter.hs | |
Module : ./CSL / ExtendedParameter.hs
Description : This module is for selecting the favoured EP representation
Copyright : ( c ) , DFKI Bremen 2010
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
This mod... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/CSL/ExtendedParameter.hs | haskell | import CSL.GeneralExtendedParameter | |
Module : ./CSL / ExtendedParameter.hs
Description : This module is for selecting the favoured EP representation
Copyright : ( c ) , DFKI Bremen 2010
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
This mod... |
a17bff18743096825fca27f9f93e56ff4430c966c83257205784c96241e12038 | y42/clj-druid | validations.clj | (ns clj-druid.validations
(:require [clj-druid.schemas.query :as sch]
[schema.core :as s]
[schema.coerce :as c]))
(defn validate-groupby
"Validate a druid groupBy query"
[query]
(s/validate sch/groupBy query))
(defn validate-search
"Validate a druid search query"
[query]
(s/va... | null | https://raw.githubusercontent.com/y42/clj-druid/37fc967f000dc63816610695a2b6c028b7b7d8b5/src/clj_druid/validations.clj | clojure | (ns clj-druid.validations
(:require [clj-druid.schemas.query :as sch]
[schema.core :as s]
[schema.coerce :as c]))
(defn validate-groupby
"Validate a druid groupBy query"
[query]
(s/validate sch/groupBy query))
(defn validate-search
"Validate a druid search query"
[query]
(s/va... | |
eb2228e725ddfb701a41deb08f4739e665012e5dad5ecf5127fd7087a27545e0 | scrintal/heroicons-reagent | document_arrow_down.cljs | (ns com.scrintal.heroicons.solid.document-arrow-down)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.625 1.5H9a3.75 3.75 0 013.75 3.75v1.875c0 1.036.84 1.875 1.875 1.87... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/document_arrow_down.cljs | clojure | (ns com.scrintal.heroicons.solid.document-arrow-down)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.625 1.5H9a3.75 3.75 0 013.75 3.75v1.875c0 1.036.84 1.875 1.875 1.87... | |
7e92903610c72f540af8a32c738fc76d495452b9984a4107c655031bf10371e2 | runtimeverification/haskell-backend | Subsort.hs | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Attribute.Subsort (
Subsort (..),
Subsorts (..),
subsortId,
subsortSymbol,
subsortAttribute,
) where
import GHC... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/src/Kore/Attribute/Subsort.hs | haskell | | The @subsort@ attribute.
| Kore identifier representing a @subsort@ attribute symbol. | |
Copyright : ( c ) Runtime Verification , 2018 - 2021
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2018-2021
License : BSD-3-Clause
-}
module Kore.Attribute.Subsort (
Subsort (..),
Subsorts (..),
subsortId,
subsortSymbol,
subsortAttribute,
) where
import GHC... |
cdf0f644413214d7af35f2bfacf724fe22a604c63cee81050a0d1bcb5839d81f | ghc/testsuite | ImpSafe01.hs | {-# LANGUAGE Safe #-}
# LANGUAGE NoImplicitPrelude #
module ImpSafe ( MyWord ) where
While Data . Word is safe it imports trustworthy
-- modules in base, hence base needs to be trusted.
-- Note: Worthwhile giving out better error messages for cases
-- like this if I can.
import Data.Word
type MyWord = Word
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/safeHaskell/check/pkg01/ImpSafe01.hs | haskell | # LANGUAGE Safe #
modules in base, hence base needs to be trusted.
Note: Worthwhile giving out better error messages for cases
like this if I can. | # LANGUAGE NoImplicitPrelude #
module ImpSafe ( MyWord ) where
While Data . Word is safe it imports trustworthy
import Data.Word
type MyWord = Word
|
44704c08a202213ecb01b7b80e242d2f2f1058295293f4532bac7659d382f111 | nikita-volkov/rebase | Reader.hs | module Rebase.Control.Monad.Trans.Reader
(
module Control.Monad.Trans.Reader
)
where
import Control.Monad.Trans.Reader
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Control/Monad/Trans/Reader.hs | haskell | module Rebase.Control.Monad.Trans.Reader
(
module Control.Monad.Trans.Reader
)
where
import Control.Monad.Trans.Reader
| |
6e6f89b5d8703e402abdde928d23c12a67ea38ac63d8af6c1002c06bd8771afb | Bertkiing/ErlangLearner | erlang_list_max.erl | -module(erlang_list_max).
-export([list_max/1]).
list_max([Head|Rest]) ->
list_max(Rest,Head).
list_max([],Res) ->
Res;
list_max([Head|Rest],Result_so_far) when Head>Result_so_far ->
list_max(Rest,Head);
list_max([Head|Rest],Result_so_far) ->
list_max(Rest,Result_so_far).
| null | https://raw.githubusercontent.com/Bertkiing/ErlangLearner/ce917684ee91e6d43864291f0e34050e7e004ca5/erlang%E5%88%97%E8%A1%A8%E9%83%A8%E5%88%86/erlang_list_max.erl | erlang | -module(erlang_list_max).
-export([list_max/1]).
list_max([Head|Rest]) ->
list_max(Rest,Head).
list_max([],Res) ->
Res;
list_max([Head|Rest],Result_so_far) when Head>Result_so_far ->
list_max(Rest,Head);
list_max([Head|Rest],Result_so_far) ->
list_max(Rest,Result_so_far).
| |
84c2ee43c87ee22f30b43d5e6b2dc7ef520984e5348bde0e410d58335dd948be | janegca/htdp2e | Exercise-255-n-inside-playground.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname Exercise-255-n-inside-playground) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/03-Abstractions/Exercise-255-n-inside-playground.rkt | racket | about the language level of this file in a form that our tools can easily process.
Develop n-inside-playground?, a function that generates a predicate that
list are within a WIDTH by HEIGHT rectangle.
Define random-posns/bad that satisfies n-inside-playground? and does not
live up to the expectations implied b... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname Exercise-255-n-inside-playground) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ... |
67f7bb0598365142ed2cabb07ed7c1cff83feb3a2017d525e411e6a36e550eb7 | aesiniath/publish | Utilities.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Utilities (
ensureDirectory,
ifNewer,
isNewer,
) where
import Chrono.Compat (convertToUTC)
import Control.Monad (when)
import Core.Program
import Core.System
import System.Directory (
createDirectoryIfMi... | null | https://raw.githubusercontent.com/aesiniath/publish/a2c0c8e339bc24d1c0f5fbef6f50a362de763508/src/Utilities.hs | haskell | # LANGUAGE OverloadedStrings #
Some source files live in subdirectories. Replicate that directory
structure in the temporary build space
|
If the source file is newer than the target file, then run an action. For
example, if you want to install a file but only do so if the file has been
rebuilt, then you could do... | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module Utilities (
ensureDirectory,
ifNewer,
isNewer,
) where
import Chrono.Compat (convertToUTC)
import Control.Monad (when)
import Core.Program
import Core.System
import System.Directory (
createDirectoryIfMissing,
doesDirectoryExist,
... |
7eae18da1ede966f6515786d932da3a3082945f2e29e3ace1c87c85b62c09323 | jspahrsummers/objective-clojure | compiler.clj | (ns objclj.compiler)
(defn -main [& args] nil)
| null | https://raw.githubusercontent.com/jspahrsummers/objective-clojure/3ef64a88b3a82cdc6ebb899bd409e387bfe79ca4/src/objclj/compiler.clj | clojure | (ns objclj.compiler)
(defn -main [& args] nil)
| |
a6cee55bdf9c22ee4b1fe886b4df99b9bc0948f86f7999af2e9dee1cdd6a7936 | tdrhq/fiveam-matchers | lists.lisp | (uiop:define-package :fiveam-matchers/lists
(:use #:cl
#:alexandria)
(:import-from #:fiveam-matchers/core
#:is-not
#:ensure-matcher
#:self-describing-list
#:describe-self
#:esc
#:describe-mismatch
... | null | https://raw.githubusercontent.com/tdrhq/fiveam-matchers/576d5d05150d5f75abd93e21a0683058c52cf44c/lists.lisp | lisp | (uiop:define-package :fiveam-matchers/lists
(:use #:cl
#:alexandria)
(:import-from #:fiveam-matchers/core
#:is-not
#:ensure-matcher
#:self-describing-list
#:describe-self
#:esc
#:describe-mismatch
... | |
1a8c0eeca30bb90da290dcb85aa62a4dcb6dbba4786d2b01c0d10a64810aa544 | SamirTalwar/advent-of-code | AOC_24_2.hs | import qualified Data.List as List
compartments = 4
main = do
weights <- map read <$> lines <$> getContents
let capacity = sum weights `div` compartments
let compartments = filter ((== capacity) . sum) $ distribute weights
let passengerCompartmentPackageCount = minimum $ map length compartments
let passenge... | null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/66bd9e31f078c9b81ece0264fb869e48964afa63/2015/AOC_24_2.hs | haskell | import qualified Data.List as List
compartments = 4
main = do
weights <- map read <$> lines <$> getContents
let capacity = sum weights `div` compartments
let compartments = filter ((== capacity) . sum) $ distribute weights
let passengerCompartmentPackageCount = minimum $ map length compartments
let passenge... | |
720c32f854803adc24b138de12a9acc16e5f64ca18e930db751741afa9c7b68d | clojure-interop/aws-api | AWSServiceMetrics.clj | (ns com.amazonaws.util.AWSServiceMetrics
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.util AWSServiceMetrics]))
(def HttpClientGetConnectionTime
"Enum Constant.
Time taken to get a connection by the http client library.
type: com.amazonaws.util.AWSServiceMetrics"
AWSServiceMet... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.util/src/com/amazonaws/util/AWSServiceMetrics.clj | clojure | (ns com.amazonaws.util.AWSServiceMetrics
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.util AWSServiceMetrics]))
(def HttpClientGetConnectionTime
"Enum Constant.
Time taken to get a connection by the http client library.
type: com.amazonaws.util.AWSServiceMetrics"
AWSServiceMet... | |
5691e97678bef0272e98c3c169d5959044350947465555ee394fb94317632e51 | eryx67/etracker | etracker_test.erl | -module(etracker_test).
-include_lib("eunit/include/eunit.hrl").
-include_lib("stdlib/include/ms_transform.hrl").
-include("../include/etracker.hrl").
-define(PEERS, test_peers).
-define(TRACKER_URL, ":8181").
-define(TRACKER_PEER, {{127, 0, 0, 1}, 8181}).
etracker_test_() ->
{setup,
fun start_apps/0,
... | null | https://raw.githubusercontent.com/eryx67/etracker/f41f5d2172d2a0cf5aeebcc7442c7523a9338340/test/etracker_test.erl | erlang | -module(etracker_test).
-include_lib("eunit/include/eunit.hrl").
-include_lib("stdlib/include/ms_transform.hrl").
-include("../include/etracker.hrl").
-define(PEERS, test_peers).
-define(TRACKER_URL, ":8181").
-define(TRACKER_PEER, {{127, 0, 0, 1}, 8181}).
etracker_test_() ->
{setup,
fun start_apps/0,
... | |
2cf53f09ca6661934cedf9013e7da8f0545165ac477403a914726dc514b68d38 | ocaml-community/zed | zed_input.ml |
* * ------------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of , an editor engine .
* zed_input.ml
* ------------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Zed, an editor engine.
*)
module type S = sig
type e... | null | https://raw.githubusercontent.com/ocaml-community/zed/3d1293205db625a5ea4d29cfe214d731c2596850/src/zed_input.ml | ocaml |
* * ------------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of , an editor engine .
* zed_input.ml
* ------------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Zed, an editor engine.
*)
module type S = sig
type e... | |
9a45811f2bd2e062128545fb9e85b057fdeaaae8636429e449e0702939d32913 | jaspervdj/advent-of-code | KnotHash.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
# LANGUAGE ScopedTypeVariables #
module AdventOfCode.KnotHash
( knotHash
, knotHashHex
, single
) where
import Control.Monad (foldM, forM_)
import Control.Mo... | null | https://raw.githubusercontent.com/jaspervdj/advent-of-code/bdc9628d1495d4e7fdbd9cea2739b929f733e751/lib/hs/AdventOfCode/KnotHash.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Run a single round. | # LANGUAGE ScopedTypeVariables #
module AdventOfCode.KnotHash
( knotHash
, knotHashHex
, single
) where
import Control.Monad (foldM, forM_)
import Control.Monad.ST (ST, runST)
import Data.Bits (xor)
import Data.Char ... |
775c6279e3628e44f38a8f18b7d6c967211c0455f5484384691a90ed28ad6277 | chchen/comet | types.rkt | #lang rosette/safe
(require "../config.rkt")
(define vect?
(bitvector vect-len))
(define (bool->vect b)
(bool->bitvector b vect-len))
(define false-vect
(bv 0 vect-len))
(define true-vect
(bv 1 vect-len))
(provide vect?
bool->vect
false-vect
true-vect)
| null | https://raw.githubusercontent.com/chchen/comet/005477b761f4d35c9fce175738f4dcbb805909e7/unity-synthesis/bool-bitvec/types.rkt | racket | #lang rosette/safe
(require "../config.rkt")
(define vect?
(bitvector vect-len))
(define (bool->vect b)
(bool->bitvector b vect-len))
(define false-vect
(bv 0 vect-len))
(define true-vect
(bv 1 vect-len))
(provide vect?
bool->vect
false-vect
true-vect)
| |
f9dc5a2cf851ea29552dcdcd2ec46a489094379fbd31fb8a0992d4f4400de797 | webcrank/webcrank.hs | ServerAPI.hs | module Webcrank.ServerAPI
( ServerAPI(..)
, ReqData
, newReqData
, HasReqData(reqData)
, ResourceData
, newResourceData
, HasResourceData(resourceData)
, LogData
, handleRequest
) where
import Webcrank.Internal.HandleRequest
import Webcrank.Internal.ReqData
import Webcrank.Internal.ResourceData
imp... | null | https://raw.githubusercontent.com/webcrank/webcrank.hs/c611a12ea129383823cc627405819537c31730e4/src/Webcrank/ServerAPI.hs | haskell | module Webcrank.ServerAPI
( ServerAPI(..)
, ReqData
, newReqData
, HasReqData(reqData)
, ResourceData
, newResourceData
, HasResourceData(resourceData)
, LogData
, handleRequest
) where
import Webcrank.Internal.HandleRequest
import Webcrank.Internal.ReqData
import Webcrank.Internal.ResourceData
imp... | |
7cfa8f9fffef1f7adf96d86f87b8edbcaad50f3daca1d4bb4d102b9b2e154b49 | semilin/layoup | RSNT-GY-tests.lisp |
(MAKE-LAYOUT :NAME "RSNT-GY-tests" :MATRIX (APPLY #'KEY-MATRIX 'NIL)
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/RSNT-GY-tests.lisp | lisp |
(MAKE-LAYOUT :NAME "RSNT-GY-tests" :MATRIX (APPLY #'KEY-MATRIX 'NIL)
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
8e3a7c5bbac0f483b533eeda7167f920a454b6e3a8be01afc3e2f1655975cf54 | cdepillabout/world-peace | Client.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
{-# LANGUA... | null | https://raw.githubusercontent.com/cdepillabout/world-peace/0596da67d792ccf9f0ddbe44b5ce71b38cbde020/example/Client.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
---------------------------------------
Clients generated by servant-client --
---------------------------------------
We generate the client functions just like normal. Note that when we use
'Envelope' type.
----... | # LANGUAGE DataKinds #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE Unde... |
49ee4f4f00f01908102714876b5458ab6c994293adeaf3e970acbd93334b9bb8 | chris-taylor/Classical-Mechanics | AD.hs | # LANGUAGE FlexibleContexts #
module AD ( dConst, dVar, diff, diff', diffs ) where
import Control.Applicative
------------------------------
-- Numeric Applicatives
------------------------------
instance Num b => Num (a -> b) where
fromInteger = pure . fromInteger
(+) = liftA2 (+)
(-) = liftA2 (-)
... | null | https://raw.githubusercontent.com/chris-taylor/Classical-Mechanics/a3f085733181833ccba3cf8d1985929e762a9bec/AD.hs | haskell | ----------------------------
Numeric Applicatives
----------------------------
----------------------------
Numeric Maybe
----------------------------
----------------------------
Automatic differentiation
---------------------------- | # LANGUAGE FlexibleContexts #
module AD ( dConst, dVar, diff, diff', diffs ) where
import Control.Applicative
instance Num b => Num (a -> b) where
fromInteger = pure . fromInteger
(+) = liftA2 (+)
(-) = liftA2 (-)
(*) = liftA2 (*)
negate = fmap negate
signum = fmap signum
abs = fmap a... |
cace31aff818d1de5ec663c8aa9d40b1decda3febeccea37efeddf8f89c09afa | S8A/htdp-exercises | ex340.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex340) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp") (... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex340.rkt | racket | about the language level of this file in a form that our tools can easily process.
Dir -> [List-of String]
lists the names of all files and directories in a given dir | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex340) (read-case-sensitive #t) (teachpacks ((lib "abstraction.rkt" "teachpack" "2htdp") (lib "dir.rkt" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal ... |
44f651a6c5d7cb5c93b17d21c7e053e91830ae3ddfd20e9234c63ae4c2aa397f | google/clojure-turtle | core.cljc | Copyright 2014 Google Inc. 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, software
... | null | https://raw.githubusercontent.com/google/clojure-turtle/8ce2b5d25199e9e8ad08d395b16e8445dff5d55b/src/cljc/clojure_turtle/core.cljc | 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 permis... | Copyright 2014 Google Inc. All Rights Reserved .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns clojure-turtle.core
(:refer-clojure :exclude [repeat])
#?(:clj
(:require [quil.core :as q])
:cljs
(:require [quil.core :as q :include-macros true]
[clojure-... |
021027bc986883b56783a8b00d7d3f42cc0fcc4b0611711003632dc0b443d1b0 | melange-re/melange | res_ast_debugger.ml | open Import
open Ast_406
module Doc = Res_doc
let printEngine = Res_driver.{
printImplementation = begin fun ~width:_ ~filename:_ ~comments:_ structure ->
Printast.implementation Format.std_formatter structure
end;
printInterface = begin fun ~width:_ ~filename:_ ~comments:_ signature ->
Printast.interfa... | null | https://raw.githubusercontent.com/melange-re/melange/d6f41989ec092eea5a623171fe5e54e17fde0d10/jscomp/napkin/res_ast_debugger.ml | ocaml | open Import
open Ast_406
module Doc = Res_doc
let printEngine = Res_driver.{
printImplementation = begin fun ~width:_ ~filename:_ ~comments:_ structure ->
Printast.implementation Format.std_formatter structure
end;
printInterface = begin fun ~width:_ ~filename:_ ~comments:_ signature ->
Printast.interfa... | |
d146e1839cf828a113ff310699759a4f95b4b7914794053fac1475c59e8c2484 | yfractal/chartkick | project.clj | (defproject chartkick "0.1.0"
:description "Create beautiful JavaScript charts with one line of Clojure"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/data.json "0.2.6"]])
| null | https://raw.githubusercontent.com/yfractal/chartkick/5e69dba4bb9c6afb3a3257c9fb14836a190658ed/project.clj | clojure | (defproject chartkick "0.1.0"
:description "Create beautiful JavaScript charts with one line of Clojure"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/data.json "0.2.6"]])
| |
10c5ba911bb52b4232b0591e437ffeb4b2218e53654010e78b7928e4d0e36b4c | meooow25/haccepted | AhoCorasickBench.hs | module AhoCorasickBench where
import Control.Monad
import qualified Data.ByteString.Char8 as C
import Criterion
import AhoCorasick
import Util ( RandStd, evalR, randLowerCaseString, sizedBench )
benchmark :: Benchmark
benchmark = bgroup "AhoCorasick"
Build the Aho - Corasick automaton from 20 a - z strings of len... | null | https://raw.githubusercontent.com/meooow25/haccepted/58398d849b6e68c3588b18997d9d39529829c396/bench/AhoCorasickBench.hs | haskell | length n.
length n. | module AhoCorasickBench where
import Control.Monad
import qualified Data.ByteString.Char8 as C
import Criterion
import AhoCorasick
import Util ( RandStd, evalR, randLowerCaseString, sizedBench )
benchmark :: Benchmark
benchmark = bgroup "AhoCorasick"
Build the Aho - Corasick automaton from 20 a - z strings of len... |
3d215cc223c7aa6fdfa0bed8756cb02de9384313d8b9e7bbe752db3aa40129b0 | ArthurGarnier/turtl-docker | launch.lisp | (pushnew "./" asdf:*central-registry* :test #'equal)
(load "start")
| null | https://raw.githubusercontent.com/ArthurGarnier/turtl-docker/2be6e7ed0007df069126a646b7ede411df3f4f63/launch.lisp | lisp | (pushnew "./" asdf:*central-registry* :test #'equal)
(load "start")
| |
f2bf6e55682770400a80f703a949706a7777872b5dee56900d9a6bdd7cd3a35d | plumatic/grab-bag | linear_test.clj | (ns classify.linear-test
(:use plumbing.core plumbing.test clojure.test)
(:require
[classify.learn :as learn]
[classify.linear :as linear]))
(def test-data
[[0 0 1]
[1 0 10]
[1 2 10]
[2 2 1]])
(deftest l2-evaluator-test
(is-= {:num-obs 22.0 :sum-xs 0.0 :sum-sq-xs 22.0}
(select-keys
... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/classify/test/classify/linear_test.clj | clojure | (ns classify.linear-test
(:use plumbing.core plumbing.test clojure.test)
(:require
[classify.learn :as learn]
[classify.linear :as linear]))
(def test-data
[[0 0 1]
[1 0 10]
[1 2 10]
[2 2 1]])
(deftest l2-evaluator-test
(is-= {:num-obs 22.0 :sum-xs 0.0 :sum-sq-xs 22.0}
(select-keys
... | |
9655fe7a69915fd15f2318007d474ee736b1e1b2d78e55a6fc70940742eeb506 | oakes/Dynadoc | project.clj | (defproject dynadoc/lein-dynadoc "1.7.5.1"
:description "A conveninent Dynadoc launcher for Leiningen projects"
:url ""
:license {:name "Public Domain"
:url ""}
:dependencies [[dynadoc "1.7.5"]
[leinjacker "0.4.3"]
[org.clojure/tools.cli "1.0.214"]]
:repositories ... | null | https://raw.githubusercontent.com/oakes/Dynadoc/eac412e3ffb3a03798220d2d4e1dc7d0f822effd/lein-dynadoc/project.clj | clojure | (defproject dynadoc/lein-dynadoc "1.7.5.1"
:description "A conveninent Dynadoc launcher for Leiningen projects"
:url ""
:license {:name "Public Domain"
:url ""}
:dependencies [[dynadoc "1.7.5"]
[leinjacker "0.4.3"]
[org.clojure/tools.cli "1.0.214"]]
:repositories ... | |
6bead766f3be418cbc79fa6b0a361630944e5dbbca95a0f20be3cb7e3c7de0df | technomancy/leiningen | sirius.clj | (ns leiningen.sirius)
(defn ^:pass-through-help sirius [project & args] args)
| null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/leiningen-core/test/leiningen/sirius.clj | clojure | (ns leiningen.sirius)
(defn ^:pass-through-help sirius [project & args] args)
| |
0889e85c55bb74f0ce30976984bce3a84112bb76b391566a5ac0c849c7dc31e0 | jarohen/yoyo | project.clj | (defproject yoyo-webapp/lein-template "0.0.6"
:description "A template to generate a yo-yo webapp project"
:url "-henderson/yoyo"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/templates/yoyo-webapp/project.clj | clojure | (defproject yoyo-webapp/lein-template "0.0.6"
:description "A template to generate a yo-yo webapp project"
:url "-henderson/yoyo"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| |
642f89590354f2afd013e3858750d08ca877da182c75720f92d31b13c83fac7c | lpw25/ecaml | value.ml | type value =
| Const of Const.t
| Tuple of value list
| Closure of closure
and result =
| Value of value
| Perform of Syntax.effect * value * closure
and closure = value -> result
let rec print v ppf =
match v with
| Const c -> Const.print c ppf
| Tuple vs -> Print.print ppf "(@[<hov>%t@])" (Print.se... | null | https://raw.githubusercontent.com/lpw25/ecaml/4588abb18436fb8a4983a353923ee667bf8c90a0/src/value.ml | ocaml | type value =
| Const of Const.t
| Tuple of value list
| Closure of closure
and result =
| Value of value
| Perform of Syntax.effect * value * closure
and closure = value -> result
let rec print v ppf =
match v with
| Const c -> Const.print c ppf
| Tuple vs -> Print.print ppf "(@[<hov>%t@])" (Print.se... | |
9ee2081fc1f0a431d5adbe24f7f704a1deca3d5299102876fd8e4db1eb9eeef6 | aria42/infer | measures.clj | (ns infer.measures
(:use clojure.contrib.math)
(:use clojure.contrib.map-utils)
(:use clojure.set)
(:use infer.core)
(:use infer.matrix)
(:use [infer.probability :only [gt lt binary]])
(:import org.apache.commons.math.stat.StatUtils)
(:import [org.apache.commons.math.stat.correlation
PearsonsCorrel... | null | https://raw.githubusercontent.com/aria42/infer/9849325a27770794b91415592a8706fd90777469/src/infer/measures.clj | clojure | TODO: finish gamma, kendall's-w and
look for old impl, or reimpliment.
(probability_theory)
:Statistical_dependence
TODO:
TODO: further work in mutivariate dependence
TODO: more research on spellchecking, string similarity
dcd is the meat of the calculation, the difference between the doncordant and disc... | (ns infer.measures
(:use clojure.contrib.math)
(:use clojure.contrib.map-utils)
(:use clojure.set)
(:use infer.core)
(:use infer.matrix)
(:use [infer.probability :only [gt lt binary]])
(:import org.apache.commons.math.stat.StatUtils)
(:import [org.apache.commons.math.stat.correlation
PearsonsCorrel... |
386dda2d35d2d62f0e6812c2487ada22703f9fba2898d04e8ce5fcd2ccf13ce1 | pykello/racket-visualization | memory-layout.rkt | #lang racket
(require metapict
racket/math
"../common.rkt")
;; Similar to -a-memory-layout-diagram-with-tikz
(define (memory-layout items)
(current-curly-brace-indent 1.5)
;; draw a bit
(define (draw-bit x0 color)
(brushcolor color (filldraw
(rectangle (pt x0 0) (p... | null | https://raw.githubusercontent.com/pykello/racket-visualization/7c4dccfd59123fcb7c144ad8ed89dffdc57290df/metapict-examples/software/memory-layout.rkt | racket | Similar to -a-memory-layout-diagram-with-tikz
draw a bit
how to draw a memory layout? | #lang racket
(require metapict
racket/math
"../common.rkt")
(define (memory-layout items)
(current-curly-brace-indent 1.5)
(define (draw-bit x0 color)
(brushcolor color (filldraw
(rectangle (pt x0 0) (pt (+ x0 1) 2)))))
draws n bit cells starting from with the gi... |
92895e16421686dac3dda70a33f543f34ebf650b1ec53cc511a79b3a4c33b545 | lpeterse/haskell-utc | Date.hs | module Data.UTC.Type.Date
( Date ()
) where
import Control.Monad.Catch
import Data.Ratio
import Data.UTC.Class.Epoch
import Data.UTC.Class.IsDate
import Data.UTC.Class.IsUnixTime
import Data.UTC.Internal
import Data.UTC.Type.Exception
| This type represents dates in the _ _ Gregorian Calendar _ _ .
--
-- *... | null | https://raw.githubusercontent.com/lpeterse/haskell-utc/e4502c08591e80d411129bb7c0414539f6302aaf/Data/UTC/Type/Date.hs | haskell |
* It can represent any date in the past and in the future by using
* The internal structure is not exposed to avoid the construction of invalid values.
Use 'Data.UTC.epoch' or a parser to construct values.
and is subject to change.
> > show (epoch :: Date) | module Data.UTC.Type.Date
( Date ()
) where
import Control.Monad.Catch
import Data.Ratio
import Data.UTC.Class.Epoch
import Data.UTC.Class.IsDate
import Data.UTC.Class.IsUnixTime
import Data.UTC.Internal
import Data.UTC.Type.Exception
| This type represents dates in the _ _ Gregorian Calendar _ _ .
' P... |
616cbd20962e48c62ee0cb713639004abc79f8e88601d4d29f3fec1c849c9789 | uwplse/oddity | debugger.clj | (ns oddity.debugger
(:require [aleph.http :as http]
[aleph.tcp :as tcp]
[manifold.stream :as s]
[manifold.deferred :as d]
[gloss.core :as gloss]
[gloss.io :as io]
[clojure.data.json :as json]
[clojure.core.async :refer [go >! <! chan]... | null | https://raw.githubusercontent.com/uwplse/oddity/81c1a6af203a0d8e71138a27655e3c4003357127/oddity/src/clj/oddity/debugger.clj | clojure | TODO: use pmap and disallow multiple nodes w/ same socket
take a message, and define a default value that tells us if the connection is closed
first, check if there even was a message, and then get a response on another thread
once we have a response, write it back to the client
if we were successful in our respon... | (ns oddity.debugger
(:require [aleph.http :as http]
[aleph.tcp :as tcp]
[manifold.stream :as s]
[manifold.deferred :as d]
[gloss.core :as gloss]
[gloss.io :as io]
[clojure.data.json :as json]
[clojure.core.async :refer [go >! <! chan]... |
c24f354ee61aa013d2aac39e79e66f29a43fc9e56fbef3c5233a14285d5eb33b | gnarroway/hato | websocket.clj | (ns hato.websocket
(:import (java.net.http WebSocket$Listener WebSocket$Builder HttpClient WebSocket)
(java.time Duration)
(java.net URI)
(java.util.concurrent CompletableFuture)
(java.nio ByteBuffer)
(java.util.function Function)))
(defn request->WebSocketListe... | null | https://raw.githubusercontent.com/gnarroway/hato/ef829066afdaf458dd0299609e20162e65d32380/src/hato/websocket.clj | clojure | (ns hato.websocket
(:import (java.net.http WebSocket$Listener WebSocket$Builder HttpClient WebSocket)
(java.time Duration)
(java.net URI)
(java.util.concurrent CompletableFuture)
(java.nio ByteBuffer)
(java.util.function Function)))
(defn request->WebSocketListe... | |
abb6d741619e3896cf1a1df357c1979383f13d6d6fbb0613d144585adb0c3308 | Frama-C/Frama-C-snapshot | sign_domain.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/domains/sign_domain.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
250dea5ce92b675d1a2f847b65439d26af0cd8f4000e37fc37b4f48d6c5eb029 | gentoo-haskell/hackport | EBuild.hs | |
Module : Portage . EBuild
License : GPL-3 +
Maintainer :
Functions and types related to interpreting and manipulating an ebuild ,
as understood by the Portage package manager .
Module : Portage.EBuild
License : GPL-3+
Maintainer :
Functions and types related to interpreting and ... | null | https://raw.githubusercontent.com/gentoo-haskell/hackport/558298950ed1e1f0c0b51f0595212a857fa373e4/src/Portage/EBuild.hs | haskell | might differ a bit (we mangle case)
^ Just 'myOldName' if the package name contains upper characters
^ raw block for src_prepare() contents
^ hints to ebuild writers/readers
on what hackport options were used to produce an ebuild
| Generate a minimal 'EBuild' template.
| Pretty-print an 'EBuild' as a 'String'.... | |
Module : Portage . EBuild
License : GPL-3 +
Maintainer :
Functions and types related to interpreting and manipulating an ebuild ,
as understood by the Portage package manager .
Module : Portage.EBuild
License : GPL-3+
Maintainer :
Functions and types related to interpreting and ... |
2c5a6f475301c09f658d7e26ee01567e68156874115172392503f6fa4d4d0f96 | thephoeron/quipper-language | Lifting.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE TemplateHaskell #
{-# LANGUAGE RankNTy... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Libraries/Template/Lifting.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# LANGUAGE RankNTypes #
Get the monad to build the lifting.
* Abstract syntax trees of a simplified language
\"where\" construct equi... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE TemplateHaskell #
| This module describes stripped - down Template Haskell abstract
syntax trees ( ASTs ) for a subset of Haskell .
module Libraries.Template.Lifting where
import Control.Monad.State
import qualified Data.M... |
9f5cf4d498a4d5bf3fb71e18925d82fdc8f0951317944b9063c0a142646c2c98 | haskell-effectful/tracing-effectful | Tracing.hs | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
module Effectful.Tracing
( -- * Effect
Tracing
, MonadTrace (..)
-- * Handlers
, runTrace
-- * Functions
, rootSpan
, childSpan
, clientSpan
, clientSpanWith
, serverSpan
, serverSpanWith
, producerSpanWith
, consumerS... | null | https://raw.githubusercontent.com/haskell-effectful/tracing-effectful/3a3204393d31a43c626e7c8bed9282f1e3071e20/src/Effectful/Tracing.hs | haskell | * Effect
* Handlers
* Functions
--------------------------------------
Orphan instance | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
module Effectful.Tracing
Tracing
, MonadTrace (..)
, runTrace
, rootSpan
, childSpan
, clientSpan
, clientSpanWith
, serverSpan
, serverSpanWith
, producerSpanWith
, consumerSpanWith
, tag
, annotate
, annotateAt
)
where... |
ccbdf184b708c44ca0355ca5a5f9910b8e0240176dfc40a5f804c8b2e3fa947c | qnikst/okasaki | ex_2_5a.hs | data Tree a = E | T (Tree a) a (Tree a)
deriving (Eq, Show)
mkTree :: (Ord a) => a -> Int -> Tree a
mkTree x 0 = E
mkTree x l = let n = mkTree x (l-1)
in T n x n
| null | https://raw.githubusercontent.com/qnikst/okasaki/f6f3c4211df16e4dde3a5cb4d6aaf19a68b99b0e/ch02/ex_2_5a.hs | haskell | data Tree a = E | T (Tree a) a (Tree a)
deriving (Eq, Show)
mkTree :: (Ord a) => a -> Int -> Tree a
mkTree x 0 = E
mkTree x l = let n = mkTree x (l-1)
in T n x n
| |
e78ac4de5eb9e8660e85de38a885f79ff685a854b8e11bb7346bc5ce57d6e05e | Gabriella439/servant-crud | Client.hs | {-# LANGUAGE OverloadedStrings #-}
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Either (runEitherT)
import Servant.Crud (API, DeleteFile, GetFile, PutFile)
import Servant.Client (BaseUrl(..), Client, Scheme(..), client)
import Servant (Proxy(..), (:<|>)(..))
import Turtle (argInt, options)
import... | null | https://raw.githubusercontent.com/Gabriella439/servant-crud/ce852827e9ea3d74a8ce18c8996feb577a770979/exec/Client.hs | haskell | # LANGUAGE OverloadedStrings #
| Example use of autogenerated `API` bindings
Note that you can use `servant` to bind to any web API, not just APIs
hosted by a `servant` server. For example, here is some code using
-translate/blob/master/src/Web/Google/Translate.hs
| Autogenerated API binding for the `PutFile` en... |
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans.Either (runEitherT)
import Servant.Crud (API, DeleteFile, GetFile, PutFile)
import Servant.Client (BaseUrl(..), Client, Scheme(..), client)
import Servant (Proxy(..), (:<|>)(..))
import Turtle (argInt, options)
import qualified Data.Text.IO as Text
ma... |
02c471bf6dc113564573f5966d158ec07e085915058aa45409d5a487facb4980 | Kalimehtar/gtk-cffi | accel-label.lisp | ;;;
;;; accel-label.lisp -- GtkAccelLabel
;;;
Copyright ( C ) 2012 , < >
;;;
(in-package :gtk-cffi)
(defclass accel-label (label)
())
(defcfun gtk-accel-label-new :pointer (text :string))
(defmethod gconstructor ((accel-label accel-label) &key text)
(gtk-accel-label-new text))
(defslots accel-label
acce... | null | https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gtk/accel-label.lisp | lisp |
accel-label.lisp -- GtkAccelLabel
| Copyright ( C ) 2012 , < >
(in-package :gtk-cffi)
(defclass accel-label (label)
())
(defcfun gtk-accel-label-new :pointer (text :string))
(defmethod gconstructor ((accel-label accel-label) &key text)
(gtk-accel-label-new text))
(defslots accel-label
accel-widget pobject)
(deffuns accel-label
(:set ac... |
1af0761149c1772155ec174fe488d0ebd26f2997333585d8d542fdcf382157d8 | AbstractMachinesLab/caramel | appendable_list.mli | (** Appendable lists: concatenation takes O(1) time, conversion to a list takes
O(n). *)
type 'a t
val empty : 'a t
val singleton : 'a -> 'a t
val ( @ ) : 'a t -> 'a t -> 'a t
val to_list : 'a t -> 'a list
| null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/vendor/stdune/appendable_list.mli | ocaml | * Appendable lists: concatenation takes O(1) time, conversion to a list takes
O(n). |
type 'a t
val empty : 'a t
val singleton : 'a -> 'a t
val ( @ ) : 'a t -> 'a t -> 'a t
val to_list : 'a t -> 'a list
|
728fe4912ed63e37503963955f4c0016debc4ed152b5b5009d14f77c394d5cda | jonsterling/dreamtt | Equate.ml | open Basis
open Syntax
open Effect
exception UnequalTypes
exception UnequalTerms
exception Impossible
exception Todo
open Monad.Notation (L)
let guard m =
let* thy = L.theory in
match Logic.consistency thy with
| `Inconsistent -> L.ret ()
| `Consistent -> m
let gfam_to_gtele gbase lfam env =
GTlCons (gbas... | null | https://raw.githubusercontent.com/jonsterling/dreamtt/aa30a57ca869e91a295e586773a892c6601b5ddb/core/Equate.ml | ocaml | open Basis
open Syntax
open Effect
exception UnequalTypes
exception UnequalTerms
exception Impossible
exception Todo
open Monad.Notation (L)
let guard m =
let* thy = L.theory in
match Logic.consistency thy with
| `Inconsistent -> L.ret ()
| `Consistent -> m
let gfam_to_gtele gbase lfam env =
GTlCons (gbas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.