_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
dc0d1b3360eb74058aeac150ae7c0a38da256f065d5f2b813f14c053b2e3b4b1
suhailshergill/extensible-effects
Test.hs
# LANGUAGE FlexibleContexts , NoMonomorphismRestriction # # LANGUAGE TypeOperators , DataKinds # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # module Control.Eff.Writer.Strict.Test (testGroups) where import Test.HUnit hiding (State) import Control.Eff import Control.Eff.Writer.Strict import Utils imp...
null
https://raw.githubusercontent.com/suhailshergill/extensible-effects/249073ccc26f0c49b4bb72cc577d75ef19635f06/test/Control/Eff/Writer/Strict/Test.hs
haskell
# LANGUAGE FlexibleContexts , NoMonomorphismRestriction # # LANGUAGE TypeOperators , DataKinds # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # module Control.Eff.Writer.Strict.Test (testGroups) where import Test.HUnit hiding (State) import Control.Eff import Control.Eff.Writer.Strict import Utils imp...
f4124b7c5e87a1d81b34fdb74c99444905241ecf44ea2e61af02064698fc315f
BumblebeeBat/FlyingFox
to_channel_tx.erl
-module(to_channel_tx).%used to create a channel, or increase the amount of money in it. -export([next_top/2,doit/7,tc_increases/1,to_channel/4,create_channel/5,create_channel2/6,my_side/1,min_ratio/2,test/0,grow_ratio/2,is_tc/1,id/1]). -record(tc, {acc1 = 0, acc2 = 1, nonce = 0, bal1 = 0, bal2 = 0, consensus_flag = <<...
null
https://raw.githubusercontent.com/BumblebeeBat/FlyingFox/0fa039cd2394b08b1a85559f9392086c6be47fa6/src/consensus/txs/to_channel_tx.erl
erlang
used to create a channel, or increase the amount of money in it. half_them(Tx) -> case keys:id() of A1 -> B; A2 -> (not B) end. When creating a new channel, you don't choose your own ID for the new channel. It will be selected for you by next available. The channel has a minimum possible balance. If so, t...
-export([next_top/2,doit/7,tc_increases/1,to_channel/4,create_channel/5,create_channel2/6,my_side/1,min_ratio/2,test/0,grow_ratio/2,is_tc/1,id/1]). -record(tc, {acc1 = 0, acc2 = 1, nonce = 0, bal1 = 0, bal2 = 0, consensus_flag = <<"delegated_1">>, fee = 0, id = -1, increment = 0}). is_tc(X) -> is_record(X, tc). id(X) -...
7da17fa120f91517edf2435cc30a0833bf7a9755e0b0eda1ac4b2dfa901e38e9
openbadgefactory/salava
core.clj
(ns salava.oembed.core (:require [clojure.tools.logging :as log] [clojure.string :as string] [yesql.core :refer [defqueries]] [salava.core.util :as u])) (defqueries "sql/oembed/queries.sql") (def iframe "<iframe frameborder=\"0\" scrolling=\"no\" src=\"%s/badge/info/%d/embed\" ...
null
https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/clj/salava/oembed/core.clj
clojure
(ns salava.oembed.core (:require [clojure.tools.logging :as log] [clojure.string :as string] [yesql.core :refer [defqueries]] [salava.core.util :as u])) (defqueries "sql/oembed/queries.sql") (def iframe "<iframe frameborder=\"0\" scrolling=\"no\" src=\"%s/badge/info/%d/embed\" ...
e689720eb69d44b604c5184d51adbc508bf495942db1c163ca5bb875195d1b95
Opetushallitus/ataru
virkailija_mass_review_view.cljs
(ns ataru.virkailija.application.mass-review.virkailija-mass-review-view (:require [ataru.application.review-states :as review-states] [ataru.virkailija.application.view.virkailija-application-icons :as icons] [reagent.core :as r] [re-frame.core :refer [subscribe dispatch]])) (defn- selected-or-defau...
null
https://raw.githubusercontent.com/Opetushallitus/ataru/e573c5f1251b413d46337098c902dd9a99bfb3c2/src/cljs/ataru/virkailija/application/mass_review/virkailija_mass_review_view.cljs
clojure
(ns ataru.virkailija.application.mass-review.virkailija-mass-review-view (:require [ataru.application.review-states :as review-states] [ataru.virkailija.application.view.virkailija-application-icons :as icons] [reagent.core :as r] [re-frame.core :refer [subscribe dispatch]])) (defn- selected-or-defau...
cbbef2608f25b219d2e9ee6394743b6814d8fcea77d92df79ad394ab11f88688
donaldsonjw/bigloo
rsa.scm
;*=====================================================================*/ * Author : * / * Copyright : 2009 - 11 / ;* ------------------------------------------------------------- */ * Message encryption and decryption based on the RSA asymmetric ...
null
https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/api/crypto/src/Llib/rsa.scm
scheme
*=====================================================================*/ * ------------------------------------------------------------- */ * cipher. */ *=====================================================================*/ ===========================...
* Author : * / * Copyright : 2009 - 11 / * Message encryption and decryption based on the RSA asymmetric * / This implementation is based on RFC 3447 , PKCS # 1 v2.1 We have not implemented multi - prime RSA . (module __crypto-rsa (import ...
4c0d14de5f43d39a9696b75a4f6e6327ae9ec200cf29c592d4605cc6831a8a3d
Clojure2D/clojure2d-examples
interval.clj
(ns rt4.the-next-week.ch04a.interval (:refer-clojure :exclude [empty size]) (:require [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol IntervalProto (contains [interval x]) ;; a <= x <= b ;; introduced due to the bug in th...
null
https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch04a/interval.clj
clojure
a <= x <= b introduced due to the bug in the book (in the time of writing this code), a < x <= b can't name it size
(ns rt4.the-next-week.ch04a.interval (:refer-clojure :exclude [empty size]) (:require [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol IntervalProto (contains- [interval x]) (clamp [interval x]) (expand [interval delta])...
ba1a9a7b05920c3d35f8a144486e2ae3815fe26587c793d194004b2dfa50acff
huangz1990/SICP-answers
p34-fast-prime.scm
;;; p34-fast-prime.scm (load "p34-expmod.scm") (define (fermat-test n) (define (try-it a) (= (expmod a n n) a)) (try-it (+ 1 (random (- n 1))))) (define (fast-prime? n times) (cond ((= times 0) true) ((fermat-test n) (fast-prime? n (- times 1))) (else ...
null
https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/p34-fast-prime.scm
scheme
p34-fast-prime.scm
(load "p34-expmod.scm") (define (fermat-test n) (define (try-it a) (= (expmod a n n) a)) (try-it (+ 1 (random (- n 1))))) (define (fast-prime? n times) (cond ((= times 0) true) ((fermat-test n) (fast-prime? n (- times 1))) (else false)))
ec8415ecfc7c473ff317e0db4647d4c0268c8a980c226efe1d02d668ea4e2314
rusterlium/rebar3_cargo
rebar3_cargo_SUITE.erl
-module(rebar3_cargo_SUITE). -compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). all() -> [ test_test_nif_app, test_test_port_app, test_fails_compile, test_fails_test, test_release_debug ]. test_apps() -> [ "test_nif_app"...
null
https://raw.githubusercontent.com/rusterlium/rebar3_cargo/ba4344f2ff8edcd7182d4a3e33c8625f001c6464/ct/rebar3_cargo_SUITE.erl
erlang
Get plugin source directory For all test apps... test that rust compile failure causes rebar3 compile failure. test that rust test failure causes rebar3 test failure. check debug vs release builds
-module(rebar3_cargo_SUITE). -compile([export_all, nowarn_export_all]). -include_lib("common_test/include/ct.hrl"). all() -> [ test_test_nif_app, test_test_port_app, test_fails_compile, test_fails_test, test_release_debug ]. test_apps() -> [ "test_nif_app"...
0b1c5491ac984c5cf10e40449efb7cf7d5508710989789dc046f6defda44e327
Octachron/tensority
ma.ml
open Tensority open Shape open Multidim_array let m = init_sh [253s; 253s] Shape.( function [k; l] -> Nat.to_int k + Nat.to_int l) let t = [%array 4 [ [1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]; [1, 2; 8, 9], [9, 1; 2, 3], [19, 12; 14, 17] ] ] let mat = t.!( 1j, 1j, All, All ) let ...
null
https://raw.githubusercontent.com/Octachron/tensority/c5739cf6a97bd69ee582bc9758b74f14be6f7557/examples/ma.ml
ocaml
open Tensority open Shape open Multidim_array let m = init_sh [253s; 253s] Shape.( function [k; l] -> Nat.to_int k + Nat.to_int l) let t = [%array 4 [ [1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]; [1, 2; 8, 9], [9, 1; 2, 3], [19, 12; 14, 17] ] ] let mat = t.!( 1j, 1j, All, All ) let ...
71bf8a02934fa1f3af0efd61300257445a3e0121d4effab8faa1dd9946bb1db9
dolphin-emu/codesearch-ui
project.clj
(defproject org.dolphin-emu/codesearch-ui "0.0.1" :description "Browser UI for a Kythe xrefs server. Decorates files with anchors for cross-references and node information" :url "" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-2371" :exclusions [or...
null
https://raw.githubusercontent.com/dolphin-emu/codesearch-ui/abbe9fad5d40b740bd63f7711e02c2f666f50991/client/project.clj
clojure
(defproject org.dolphin-emu/codesearch-ui "0.0.1" :description "Browser UI for a Kythe xrefs server. Decorates files with anchors for cross-references and node information" :url "" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-2371" :exclusions [or...
ebfac80b7319427835720856c350819cd313bb2508a5c21f066322d12da1ba2d
cse-bristol/110-thermos-ui
map_import_components.cljc
This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021 Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details . (ns thermos-pages.map-import-components (:require [thermos-pages.common :refer [fn-js] :refer-macros [fn-js]] [clojure.string :a...
null
https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/729c0a279dba40b6d1a49bc485c968569741e915/src/thermos_pages/map_import_components.cljc
clojure
yech upload all the files here we really want to know whether the region drawn is huge with differently named fields, or same named fields. urgh yuck :geometry :files ;; values need their :files bit removing because :files are not but it already went. this is [[file column]] then we press go and wait ages
This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021 Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details . (ns thermos-pages.map-import-components (:require [thermos-pages.common :refer [fn-js] :refer-macros [fn-js]] [clojure.string :a...
02d695ee2245fc12e782541520cfc8bdad6381088af9eda8417fba3fe29aac08
patrikja/AFPcourse
Shallow_Instances.hs
module Problem1.Shallow_Instances where import Problem1.Shallow instance Show a => Show (V a) where show = show . toList
null
https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/exam/2010-03/Problem1/Shallow_Instances.hs
haskell
module Problem1.Shallow_Instances where import Problem1.Shallow instance Show a => Show (V a) where show = show . toList
21b636e6935f1f26b00125a9c4ce273731b27ed5d066a1d2ceae0e9c70ceef52
juspay/atlas
RegistrationToken.hs
| Copyright 2022 Juspay Technologies Pvt 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 Unless required by applicable law or agreed to in writing , software dis...
null
https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/app-backend/src/Storage/Queries/RegistrationToken.hs
haskell
| Copyright 2022 Juspay Technologies Pvt 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 Unless required by applicable law or agreed to in writing , software dis...
cf5165cf47459763c6d67e0127b1eed22d7b8b0e46ea51b558ee8db17abd776d
josefs/Gradualizer
list_tail.erl
-module(list_tail). -compile([export_all, nowarn_export_all]). %% Improper list in type inference - currently considered a type error atom_tail() -> [ 1 | list_to_atom("banana")].
null
https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/known_problems/should_pass/list_tail.erl
erlang
Improper list in type inference - currently considered a type error
-module(list_tail). -compile([export_all, nowarn_export_all]). atom_tail() -> [ 1 | list_to_atom("banana")].
03e43385478afc020b8b791416ee7d22d9915a8918e071b490511a60a3c75760
footprintanalytics/footprint-web
png.clj
(ns metabase.pulse.render.png "Logic for rendering HTML to a PNG. Ported by @tlrobinson from -4.10/src/main/java/org/fit/cssbox/demo/ImageRenderer.java with subsequent code simplification and cleanup by @camsaul CSSBox JavaDoc is here: " (:require [clojure.tools.logging :as log] [hiccup.core :...
null
https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/pulse/render/png.clj
clojure
(ns metabase.pulse.render.png "Logic for rendering HTML to a PNG. Ported by @tlrobinson from -4.10/src/main/java/org/fit/cssbox/demo/ImageRenderer.java with subsequent code simplification and cleanup by @camsaul CSSBox JavaDoc is here: " (:require [clojure.tools.logging :as log] [hiccup.core :...
b450dc33de7c00dd8c3a87bc7a855de7cf9b0bd16b28560fe64d60e1d0004f33
db48x/xe2
player.lisp
(in-package :cons-game) ;;; List body segments (defcell segment (tile :initform "segment") (item-tile :initform nil :documentation "When non-nil, superimpose this tile.") (description :initform "List snake body segment.") (direction :initform nil :documentation "When non-nil, move once in this direction.") ...
null
https://raw.githubusercontent.com/db48x/xe2/7896fcc69f5c6e28eaf6f6abb7966d6663370a66/cons/player.lisp
lisp
List body segments Agent: the player [set-prompt *form* agent]
(in-package :cons-game) (defcell segment (tile :initform "segment") (item-tile :initform nil :documentation "When non-nil, superimpose this tile.") (description :initform "List snake body segment.") (direction :initform nil :documentation "When non-nil, move once in this direction.") (last-direction :initf...
534d31992e92210e1f4354c67e40abbb98e943088e3cdc0bb5181b86349e134b
deadpendency/deadpendency
Main.hs
module Main ( main, ) where import EP.TheMain (theMain) main :: IO () main = theMain
null
https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/error-processor/app/Main.hs
haskell
module Main ( main, ) where import EP.TheMain (theMain) main :: IO () main = theMain
068557d7bebfbe19107e3f7f6b75a9e9f8dc1db1f3127f865e8aa079db147f2d
CmdrDats/igoki
robot.clj
(ns igoki.ui.robot (:require [seesaw.core :as s] [seesaw.color :as sc] [igoki.litequil :as lq] [igoki.util :as util] [igoki.integration.robot :as i.robot] [igoki.camera :as camera] [seesaw.mig :as sm]) (:import (java.awt.event MouseEvent) (javax.swing JFrame) (java.awt Rectan...
null
https://raw.githubusercontent.com/CmdrDats/igoki/a9ae0946dc27cb077ed7e8c59a7c18d0efb2148f/src/igoki/ui/robot.clj
clojure
Yes, creating duplicate objects. Mutation sucks. A hill I'll die on. Only move if the other is _also_ move, else it's non-standard behaviour Yes, creating duplicate objects. Mutation sucks. A hill I'll die on. Only move if the other is _also_ move, else it's non-standard behaviour Only shift bounds if we've not ma...
(ns igoki.ui.robot (:require [seesaw.core :as s] [seesaw.color :as sc] [igoki.litequil :as lq] [igoki.util :as util] [igoki.integration.robot :as i.robot] [igoki.camera :as camera] [seesaw.mig :as sm]) (:import (java.awt.event MouseEvent) (javax.swing JFrame) (java.awt Rectan...
9c684e57bb928f4db8a246265e9c74180b443bac296f9a202fe14f7d1e719766
mpickering/eventlog-live
EKG.hs
{-# LANGUAGE RecordWildCards, OverloadedStrings #-} module GHC.Eventlog.Counters.EKG ( registerCounters, ) where import GHC.Eventlog.Counters import Data.Text (Text) import Data.Int (Int64) import Control.Concurrent.STM (atomically, readTVar, STM) import qualified System.Metrics as EKG -- | Register some metrics...
null
https://raw.githubusercontent.com/mpickering/eventlog-live/2ec4d0ef56ca6c8eb275c5bdae9c98f9221e685d/eventlog-counters-ekg/src/GHC/Eventlog/Counters/EKG.hs
haskell
# LANGUAGE RecordWildCards, OverloadedStrings # | Register some metrics from 'Counters'. === Registered counters [@eventlog.time@] TBW [@eventlog.heapSize@] TBW [@eventlog.heapLive@] TBW === Registered gauges ----------------------------------------------------------------------------- Helpers -------------...
module GHC.Eventlog.Counters.EKG ( registerCounters, ) where import GHC.Eventlog.Counters import Data.Text (Text) import Data.Int (Int64) import Control.Concurrent.STM (atomically, readTVar, STM) import qualified System.Metrics as EKG [ @eventlog.heapAlloc@ ] TBW [ @eventlog.totalThreads@ ] TBW registerCount...
e38df14b5426fbe76567097da7c25412596d76069acadef1648c3ab4d57cf8db
falgon/htcc
Var.hs
# LANGUAGE BangPatterns , OverloadedStrings , ScopedTypeVariables , TupleSections # TupleSections #-} | Module : Htcc . . Parsing . Global . Var Description : The C languge parser and AST constructor Copyright : ( c ) roki , 2019 License : MIT Maintainer : Stabi...
null
https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/Parser/Parsing/Global/Var.hs
haskell
# SOURCE # | \[ \] for initializing for non initializing
# LANGUAGE BangPatterns , OverloadedStrings , ScopedTypeVariables , TupleSections # TupleSections #-} | Module : Htcc . . Parsing . Global . Var Description : The C languge parser and AST constructor Copyright : ( c ) roki , 2019 License : MIT Maintainer : Stabi...
d51071534f993cfef93f98e6be22f0c949a7cd1130d70e30e861d0736f3f9184
jellelicht/guix
gcrypt.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2013 , 2014 , 2015 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version...
null
https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/guix/gcrypt.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2013 , 2014 , 2015 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-module (guix gcrypt) #:use-module (guix config) #:use-module (system foreign) #:export...
84aac5278487288381d2cbdb344b8608ea1cbb771d2e99c95d7b45b5f03d6747
rpav/spatial-trees
package.lisp
(in-package :cl-user) (defpackage :spatial-trees (:use :cl) (:shadow :delete :search) (:export :delete :insert :search :bounding-rectangle :make-spatial-tree)) (defpackage :spatial-trees-protocol (:use :cl :spatial-trees) (:shadowing-import-from :spatial-trees :delete :search) (:export ;; in...
null
https://raw.githubusercontent.com/rpav/spatial-trees/81fdad0a0bf109c80a53cc96eca2e093823400ba/package.lisp
lisp
interface definitions protocol functions protocol classes
(in-package :cl-user) (defpackage :spatial-trees (:use :cl) (:shadow :delete :search) (:export :delete :insert :search :bounding-rectangle :make-spatial-tree)) (defpackage :spatial-trees-protocol (:use :cl :spatial-trees) (:shadowing-import-from :spatial-trees :delete :search) (:export :dele...
c19ea6b9560eca0d354c4977876675da1fa2d6144d838788d87446b2705efba2
satori-com/mzbench
mzb_api_ec2_plugin.erl
-module(mzb_api_ec2_plugin). -export([start/2, create_cluster/3, destroy_cluster/1]). -include_lib("erlcloud/include/erlcloud.hrl"). -include_lib("erlcloud/include/erlcloud_aws.hrl"). -include_lib("erlcloud/include/erlcloud_ec2.hrl"). -define(POLL_INTERVAL, 2000). -define(MAX_POLL_COUNT, 150). % ===================...
null
https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/server/src/mzb_api_ec2_plugin.erl
erlang
=========================================================== Public API =========================================================== try to get ip addresses for allocated hosts -spec destroy_cluster({#{config:=[any()], _=>_}, [term()]}) -> ok.
-module(mzb_api_ec2_plugin). -export([start/2, create_cluster/3, destroy_cluster/1]). -include_lib("erlcloud/include/erlcloud.hrl"). -include_lib("erlcloud/include/erlcloud_aws.hrl"). -include_lib("erlcloud/include/erlcloud_ec2.hrl"). -define(POLL_INTERVAL, 2000). -define(MAX_POLL_COUNT, 150). start(_Name, Opts) -...
39bbd36994443117efce37a101fd53c8538d1cf7cf8fa13f95da505b96e8b10c
saltysystems/gdminus
gdminus_int.erl
%%%-------------------------------------------------------------------------- ( C ) 2021 , %%% @doc GDMinus Interpreter. This package facilitates interoperability between Godot and Erlang by implementing a subset of the GDScript scripting language as an Erlang %%% module. A subset of the GDScript standar...
null
https://raw.githubusercontent.com/saltysystems/gdminus/6472337349e9a497bf5f880bf22c9acea4c1177c/src/gdminus_int.erl
erlang
-------------------------------------------------------------------------- @doc GDMinus Interpreter. module. A subset of the GDScript standard library has been made available @end -------------------------------------------------------------------------- ------------------- state through every function. ========...
( C ) 2021 , This package facilitates interoperability between Godot and Erlang by implementing a subset of the GDScript scripting language as an Erlang as well . Users may additionally define their own functions in Erlang and make them available to GDMinus programs . This source code is made ...
5cc4c21dad31b55959473a122ad7cfa1f9aa480ea1632b151ff78cc8c4b66d06
kawasima/back-channeling
chat_app.clj
(ns back-channeling.endpoint.chat-app (:require [clojure.edn :as edn] [clojure.tools.logging :as log] [ring.util.response :refer [resource-response content-type header redirect]] [liberator.dev] [environ.core :refer [env]] [hiccup.page :refer [include-js]] ...
null
https://raw.githubusercontent.com/kawasima/back-channeling/05d06278cedc35e4e7866384c2903d3c903a19fc/src/clj/back_channeling/endpoint/chat_app.clj
clojure
(ns back-channeling.endpoint.chat-app (:require [clojure.edn :as edn] [clojure.tools.logging :as log] [ring.util.response :refer [resource-response content-type header redirect]] [liberator.dev] [environ.core :refer [env]] [hiccup.page :refer [include-js]] ...
bc409c1bb0588619615054563f6e51081ce2bae05c687f53415b77cae3fc684e
perkss/clojure-kafka-examples
kstream_avro_join_test.clj
(ns kafka-streams-example.kstream-avro-join-test (:require [clojure.test :refer :all]) (:require [kafka-streams-example.kstream-avro-join :as sut] [kafka-streams-example.test-support :as support]) (:import (org.apache.kafka.streams TopologyTestDriver Topology KeyValue) (io.confluent.kafka.s...
null
https://raw.githubusercontent.com/perkss/clojure-kafka-examples/2c1e3d62b768c0c6919ab36b0f05f469b322f3e6/kafka-streams-example/test/kafka_streams_example/kstream_avro_join_test.clj
clojure
(ns kafka-streams-example.kstream-avro-join-test (:require [clojure.test :refer :all]) (:require [kafka-streams-example.kstream-avro-join :as sut] [kafka-streams-example.test-support :as support]) (:import (org.apache.kafka.streams TopologyTestDriver Topology KeyValue) (io.confluent.kafka.s...
e27506930b0dedb41052e3a5361ccecd061be77a63fe54d9d69be42ff4ca0bac
korya/efuns
xsync.mli
(***********************************************************************) (* *) xlib for (* *) Fabrice Le Fessant , projet Para / SOR , INRIA Rocq...
null
https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/xlib/xsync.mli
ocaml
********************************************************************* ...
xlib for Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt Copyright 1998 Institut National de Recherche en Informatique et Automatique . Distributed only by permission . val clearArea : Xtypes.display -> Xtypes.window ->...
6465b1c374ac51813184ecae99761f75eb7e20d97024090131daf7a1b431b188
aiya000/haskell-examples
compose.hs
import Control.Lens import Data.Map.Lazy (Map) import Data.Void (Void) import qualified Data.Map.Lazy as M xs :: Either Void (Int, Map Char Bool, String) xs = Right ( 10 , M.fromList [ ('a', False) , ('b', True) , ('c', False) ] ...
null
https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Control/Lens/Prism/compose.hs
haskell
import Control.Lens import Data.Map.Lazy (Map) import Data.Void (Void) import qualified Data.Map.Lazy as M xs :: Either Void (Int, Map Char Bool, String) xs = Right ( 10 , M.fromList [ ('a', False) , ('b', True) , ('c', False) ] ...
b08e21ae742ae86edc5ecd30a87cbd516bf95c59164802f7ed4f25b66b434acc
yesodweb/wai
AutoUpdate.hs
# LANGUAGE CPP # -- | In a multithreaded environment, running actions on a regularly scheduled -- background thread can dramatically improve performance. -- For example, web servers need to return the current time with each HTTP response. -- For a high-volume server, it's much faster for a dedicated thread to run every...
null
https://raw.githubusercontent.com/yesodweb/wai/91d23612297d73387e00f8623636c8ca29162efb/auto-update/Control/AutoUpdate.hs
haskell
| In a multithreaded environment, running actions on a regularly scheduled background thread can dramatically improve performance. For example, web servers need to return the current time with each HTTP response. For a high-volume server, it's much faster for a dedicated thread to run every request to make its own...
# LANGUAGE CPP # second , and write the current time to a shared ' IORef ' , than it is for each second , that approach will result in /more/ calls to ' getCurrentTime ' than necessary , and worse , kills idle GC . import " Control . AutoUpdate " mkAutoUpdate ' ' defaultUpdateSettings ' module Control.Aut...
00c07822310ed993bee218c0d663eff2d8aa5d71010a26abc103350253d311ee
blockapps/eth-pruner
Types.hs
# OPTIONS_GHC -fno - warn - orphans # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # {-# LANGUAGE OverloadedStrings #-} module Prune.Types where import Data.Binary import qualified Data.ByteString ...
null
https://raw.githubusercontent.com/blockapps/eth-pruner/513fcc884c93974a29b380ca80669dc0aebec125/src/Prune/Types.hs
haskell
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -fno - warn - orphans # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # module Prune.Types where import Data.Binary import qualified Data.ByteString as B import Data.Time im...
a8988ffbb2c8a9c7e68f0b7f5b6099e9a5d949f37f19edd227ef76d9461358c5
circuithub/haskell-gerber
Format.hs
module Gerber.Format where data Format = Format { integerPositions :: !Int , decimalPositions :: !Int } deriving ( Eq, Show )
null
https://raw.githubusercontent.com/circuithub/haskell-gerber/c1ef0273e9dcf98d731a63ffc6aeb1b4c884bd8d/gerber/lib/Gerber/Format.hs
haskell
module Gerber.Format where data Format = Format { integerPositions :: !Int , decimalPositions :: !Int } deriving ( Eq, Show )
cb89882c46ed58ec67e0ceb4484bbe2363d71bf16d5d7cdda0f19faa4937ae5c
facebook/duckling
Rules.hs
Copyright ( c ) 2016 - present , Facebook , Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.Z...
null
https://raw.githubusercontent.com/facebook/duckling/c6a48a1d0678a389f86d17db2676e1a289e355ce/Duckling/Numeral/ZH/Rules.hs
haskell
All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. # LANGUAGE GADTs # # LANGUAGE OverloadedStrings #
Copyright ( c ) 2016 - present , Facebook , Inc. # LANGUAGE LambdaCase # module Duckling.Numeral.ZH.Rules ( rules ) where import Data.Maybe import Data.String import Data.Text (Text) import Prelude import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Duckling.Dimensions.T...
bff052fd56f27ec4e52b06f2fe27088ebd5dc5e0408e985e915b625a6ad4f347
mbg/hoop
QuasiQuoters.hs
module Language.Hoop.QuasiQuoters where import Language.Haskell.TH import Language.Haskell.TH.Quote import Language.Hoop.Parsers import Language.Hoop.CodeGen state = QuasiQuoter { quoteExp = undefined, quotePat = undefined, quoteType = undefined, quoteDec = stateParser } stateParser :: String -> ...
null
https://raw.githubusercontent.com/mbg/hoop/98a53bb1db66b06f9b5d3e5242eed336f908ad18/src/Language/Hoop/QuasiQuoters.hs
haskell
module Language.Hoop.QuasiQuoters where import Language.Haskell.TH import Language.Haskell.TH.Quote import Language.Hoop.Parsers import Language.Hoop.CodeGen state = QuasiQuoter { quoteExp = undefined, quotePat = undefined, quoteType = undefined, quoteDec = stateParser } stateParser :: String -> ...
7de4e1313b62b175b147e466b1640099f4de37f0eadacb30f9a5666cc78fac5e
unison-code/uni-instr-sel
ConstraintBuilder.hs
| Copyright : Copyright ( c ) 2012 - 2017 , < > License : BSD3 ( see the LICENSE file ) Maintainer : Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <> License : BSD3 (see the LICENSE file) Maintainer : -} Main authors : < > Main authors: Gabriel Hjort ...
null
https://raw.githubusercontent.com/unison-code/uni-instr-sel/2edb2f3399ea43e75f33706261bd6b93bedc6762/hlib/instr-sel/Language/InstrSel/Constraints/ConstraintBuilder.hs
haskell
----------- Functions ----------- | Creates constraints using 'mkFallThroughConstraints' and adds these (if | Creates constraints for enforcing a fall-through from a match to a block. ^ A block node. | Replaces every occurrance of a node ID in the given constraint with another node ID. ^ Node ID to replace. ^ N...
| Copyright : Copyright ( c ) 2012 - 2017 , < > License : BSD3 ( see the LICENSE file ) Maintainer : Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <> License : BSD3 (see the LICENSE file) Maintainer : -} Main authors : < > Main authors: Gabriel Hjort ...
880704e4ab750ecf2c1ec5a12aee5ff7bf6305ea15ffc56756e9c4772d1d3194
spurious/chibi-scheme-mirror
weak-tests.scm
(import (chibi weak) (chibi ast) (only (chibi test) test-begin test test-end)) (test-begin "weak pointers") (test "preserved key and value" '("key1" "value1" #f) (let ((key (string-append "key" "1")) (value (string-append "value" "1"))) (let ((eph (make-ephemeron key value))) (gc) (list key...
null
https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/tests/weak-tests.scm
scheme
disabled - we support weak keys, but not proper ephemerons
(import (chibi weak) (chibi ast) (only (chibi test) test-begin test test-end)) (test-begin "weak pointers") (test "preserved key and value" '("key1" "value1" #f) (let ((key (string-append "key" "1")) (value (string-append "value" "1"))) (let ((eph (make-ephemeron key value))) (gc) (list key...
66b1c73403871326db52ad7ebab5c05e62013176c9efd3e74da73ade861f6825
malcolmstill/ulubis
syscall.lisp
(defpackage :syscall (:use :common-lisp :cffi) (:export poll poll-return-event with-pollfds pollin pollpri pollout pollerr pollhup pollnval ioctl)) (in-package :syscall) (defconstant pollin 1) (defconstant pollpri 2) (defconstant pollout 4) (defconstant pollerr 8) (defconstant pollh...
null
https://raw.githubusercontent.com/malcolmstill/ulubis/23c89ccd5589930e66025487c31531f49218bb76/syscall.lisp
lisp
(defpackage :syscall (:use :common-lisp :cffi) (:export poll poll-return-event with-pollfds pollin pollpri pollout pollerr pollhup pollnval ioctl)) (in-package :syscall) (defconstant pollin 1) (defconstant pollpri 2) (defconstant pollout 4) (defconstant pollerr 8) (defconstant pollh...
b7f8600ac11b6516e47c801f5f9016d6be299c09e2f3cb7911832d73cea5f79a
input-output-hk/cardano-benchmarking
Core.hs
HLINT ignore " Reduce duplication " HLINT ignore " Use uncurry " # LANGUAGE ExistentialQuantification # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} # LANGUAGE LambdaCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE NumericUnderscores # # LANGUAGE ScopedTypeVariables # {-# LANGUAGE RankNTypes #-} -- # L...
null
https://raw.githubusercontent.com/input-output-hk/cardano-benchmarking/6eca6bb3da9b54239d4d96b671f198634798b518/cardano-tx-generator/src/Cardano/Benchmarking/Script/Core.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # --------------------------------------------------TODO : Constant 1 ??? This is for dirty hacking and testing and quick-fixes. Its a function that can be called from the JSON scripts and for which the JSON encoding is "reserved".
HLINT ignore " Reduce duplication " HLINT ignore " Use uncurry " # LANGUAGE ExistentialQuantification # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE NumericUnderscores # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # # LANGUAGE TypeFamilies # #...
597c3d4b3b78a81439978c7af33b570c8ef9a5257bb80476e564b17ab4e7d024
scalaris-team/scalaris
xml_appender.erl
-module(xml_appender). -behaviour(gen_event). -include("../include/log4erl.hrl"). -include_lib("kernel/include/file.hrl"). -import(log4erl_utils, [to_list/1, to_atom/1, to_int/1]). %% gen_event callbacks -export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]). -d...
null
https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/contrib/log4erl/src/xml_appender.erl
erlang
gen_event callbacks where Name is the name of the element or attribute Format is the format of the value ====================================== gen_event callback functions ====================================== Check Rot >= 0 Start xml ====================================== internal callback functions...
-module(xml_appender). -behaviour(gen_event). -include("../include/log4erl.hrl"). -include_lib("kernel/include/file.hrl"). -import(log4erl_utils, [to_list/1, to_atom/1, to_int/1]). -export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]). -define(DEFAULT_XMLSPEC, [...
e85cd5246eec8a273ef4869b90e0b27d05b070542fe829b8c7f85b88ec7315e7
well-typed-lightbulbs/ocaml-esp32
ref.ml
(* TEST *) (* Test construction of cyclic values where the cycles pass through references *) type t = { mutable next : t; mutable inst : n ref } and n = T of t let rec d = { next = d; inst = ref (T d) } let f t1 t2 = let rec self = ref init and init () = t1 (function () -> self := t2; t2 ()) in fun () -> !...
null
https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/letrec-compilation/ref.ml
ocaml
TEST Test construction of cyclic values where the cycles pass through references
type t = { mutable next : t; mutable inst : n ref } and n = T of t let rec d = { next = d; inst = ref (T d) } let f t1 t2 = let rec self = ref init and init () = t1 (function () -> self := t2; t2 ()) in fun () -> !self () ;;
fc6dfd7dfb5510d45c969f30dc229c9f0d1bb77ceeb7993cde5a8a68b30082e4
jafingerhut/thalia
clojure.data.csv-0.1.2.clj
{"namespaces" {"clojure.data.csv" [{"ns" "clojure.data.csv", "name" "read-csv", "line" 83, "column" 1, "doc" "Reads CSV-data from input (String or java.io.Reader) into a lazy\n sequence of vectors.\n\n Valid options are\n :separator (default \\,)\n :quote (default \\\")", "tag" nil...
null
https://raw.githubusercontent.com/jafingerhut/thalia/20c98eec8168ff72c5b3965cc048b817d34a4583/doc/clojuredocs/clojure.data.csv-0.1.2.clj
clojure
{"namespaces" {"clojure.data.csv" [{"ns" "clojure.data.csv", "name" "read-csv", "line" 83, "column" 1, "doc" "Reads CSV-data from input (String or java.io.Reader) into a lazy\n sequence of vectors.\n\n Valid options are\n :separator (default \\,)\n :quote (default \\\")", "tag" nil...
04459d27fe5c53f22229afe60b1e4925d8965e3984b45f1a1821e6da8d5a6b5c
yutopp/rill
sema_builtin.ml
open Sema_context open Type_sets let get_builtin_bool_type attr ctx : type_info_t = let ty = !(ctx.sc_tsets.ts_bool_type_holder) in assert (not @@ Type.is_undef ty); ty let get_builtin_int_type ~bits ~signed attr ctx : type_info_t = let ty = match bits with | 8 -> if signed then failwith "[IC...
null
https://raw.githubusercontent.com/yutopp/rill/375b67c03ab2087d0a2a833bd9e80f3e51e2694f/rillc/_migrating/sema_builtin.ml
ocaml
Type.Generator.update_attr_r ctx.sc_tsets.ts_type_gen ty attr
open Sema_context open Type_sets let get_builtin_bool_type attr ctx : type_info_t = let ty = !(ctx.sc_tsets.ts_bool_type_holder) in assert (not @@ Type.is_undef ty); ty let get_builtin_int_type ~bits ~signed attr ctx : type_info_t = let ty = match bits with | 8 -> if signed then failwith "[IC...
0ecde10a4b1ce9cfcad4dba7a9af84aea6383209cddb3dcdc472a48ad95c93b5
ftovagliari/ocamleditor
gtk_util.ml
OCamlEditor Copyright ( C ) 2010 - 2014 This file is part of OCamlEditor . OCamlEditor 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 y...
null
https://raw.githubusercontent.com/ftovagliari/ocamleditor/53284253cf7603b96051e7425e85a731f09abcd1/src/gtk_util.ml
ocaml
* window * window_tooltip * with_tag ~name:(create_mark_name "Gtk_util.with_tag") * increase_font_size * try_font
OCamlEditor Copyright ( C ) 2010 - 2014 This file is part of OCamlEditor . OCamlEditor 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 y...
86b0b00bbacd6e706a8def77456be5a11115f4eccc9418c0c00f189f2b7f137b
fulcrologic/fulcro-rad-tutorial
datomic.clj
(ns com.example.components.datomic (:require [com.fulcrologic.rad.database-adapters.datomic :as datomic] [mount.core :refer [defstate]] [com.example.model :refer [all-attributes]] [com.example.components.config :refer [config]])) (defstate ^{:on-reload :noop} datomic-connections :start (datomic/s...
null
https://raw.githubusercontent.com/fulcrologic/fulcro-rad-tutorial/809b8f8833363be7dc0c9a66307b1fa164da4d70/src/main/com/example/components/datomic.clj
clojure
(ns com.example.components.datomic (:require [com.fulcrologic.rad.database-adapters.datomic :as datomic] [mount.core :refer [defstate]] [com.example.model :refer [all-attributes]] [com.example.components.config :refer [config]])) (defstate ^{:on-reload :noop} datomic-connections :start (datomic/s...
bdb36e28657c8dedbe3f489829fdc1f2a5445595e1f6517312c50d309b4e2027
shaunlebron/parinfer
parinfer.cljs
(ns parinfer-site.parinfer) (defn major-version [] (aget js/window "parinfer" "version" "0")) (defn- convert-changed-line [e] {:line-no (aget e "lineNo") :line (aget e "line")}) (defn- convert-error [e] (when e {:name (aget e "name") :message (aget e "message") :line-no (aget e "lineNo") ...
null
https://raw.githubusercontent.com/shaunlebron/parinfer/6705c35adbabc90cc0af3bb4ddf3a60c390f93df/site/src/parinfer_site/parinfer.cljs
clojure
(ns parinfer-site.parinfer) (defn major-version [] (aget js/window "parinfer" "version" "0")) (defn- convert-changed-line [e] {:line-no (aget e "lineNo") :line (aget e "line")}) (defn- convert-error [e] (when e {:name (aget e "name") :message (aget e "message") :line-no (aget e "lineNo") ...
15ee6b7eecea1966aa6559938413e0f25d47d97d9c512196a05829307c156572
ucsd-progsys/dsolve
strmat-2.ml
datatype pattern with nat = Empty(0) (* empty string matches Empty *) " c " matches ( c ) | {i:nat,j:nat} Plus(i+j+1) of pattern(i) * pattern(j) (* cs matches Plus(p1, p2) if cs matches either p1 or p2 *) | {i:nat,j:nat} Times(i+j+1) of pattern(i) * pattern(j) (* cs matches Times(p1, p2) if a prefix of cs matc...
null
https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/xiog/DMLex/strmat-2.ml
ocaml
empty string matches Empty cs matches Plus(p1, p2) if cs matches either p1 or p2 cs matches Times(p1, p2) if a prefix of cs matches p1 and the rest matches p2 'length' computes the length of a list empty tuple <> is used since 'length' is not recursive in this case, k is used for backtracking 'explode...
datatype pattern with nat = " c " matches ( c ) | {i:nat,j:nat} Plus(i+j+1) of pattern(i) * pattern(j) | {i:nat,j:nat} Times(i+j+1) of pattern(i) * pattern(j) | {i:nat} Star(i+1) of pattern(i) cs matches Star(p ) if cs matches some , possibly 0 , copies of p fun('a) length (xs) = let fun len ([], n) ...
5407b928a8171135f1134628922bcc0095eb21c8add9efc6795f2f4870156c41
craigl64/clim-ccl
accept.lisp
-*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*- ;; See the file LICENSE for the full license governing this code. ;; (in-package :clim-internals) " Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . " (defun accept (type &rest...
null
https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/clim/accept.lisp
lisp
Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*- See the file LICENSE for the full license governing this code. Allow the arguments to be presentation type abbreviations If the user wants a default, but provided none, go get it from the history Massage the default Call...
(in-package :clim-internals) " Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . " (defun accept (type &rest accept-args &key (stream *standard-input*) (view (stream-default-view stream)) (default nil default-supplied-p) (default-type ty...
c8de7eae651887bcfeed2c1a700520714ef0584ad83100cc93daaf00cd70779c
softlab-ntua/bencherl
db_toke_SUITE.erl
2010 - 2011 Zuse Institute Berlin 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 di...
null
https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/scalaris/test/db_toke_SUITE.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language gov...
2010 - 2011 Zuse Institute Berlin Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @author < > @version $ I d : db_toke_SUITE.erl 1445 2011 - 02 - 23 11:34:29Z $ -module(db_toke_SUITE). -author(''). -vsn('$Id...
512743c2e903e23b67b75db889500a1ee4393459b5b1935c3d5ee61f55a19a33
replikativ/replikativ
core.cljc
(ns replikativ.core "Replication related pub-sub protocols." (:require [replikativ.crdt.materialize :refer [key->crdt get-crdt]] [replikativ.environ :refer [*id-fn*]] [replikativ.protocols :refer [-downstream -handshake]] [kabel.peer :refer [drain]] [konserve.core :as...
null
https://raw.githubusercontent.com/replikativ/replikativ/1533a7e43e46bfb70e8c8eb34dc5708e611a478d/src/replikativ/core.cljc
clojure
buffer for initial handshake backlog ensure that we have a copy in memory! and don't append something before we can update the in memory datastructure
(ns replikativ.core "Replication related pub-sub protocols." (:require [replikativ.crdt.materialize :refer [key->crdt get-crdt]] [replikativ.environ :refer [*id-fn*]] [replikativ.protocols :refer [-downstream -handshake]] [kabel.peer :refer [drain]] [konserve.core :as...
1a5071eac7ff88e39a6aa028caec7ac33ef98a211c11fb1c0739b361cb77e7f6
melange-re/melange
gpr_4491_test.ml
let f xs = let unused = match xs with | Some (l) -> Js.log "side effect"; [l; l] | None -> [1; 2] in Js.log2 "nothing to see here" xs
null
https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/gpr_4491_test.ml
ocaml
let f xs = let unused = match xs with | Some (l) -> Js.log "side effect"; [l; l] | None -> [1; 2] in Js.log2 "nothing to see here" xs
b407964776daac20873a82a0dc2f6f6fbbe19fa63ffe7dfbdef193cfe8906c2b
hyper-systems/ocaml-coap
Coap_server_lwt.mli
val start : ?addr:string -> ?port:int -> ((Coap_core.Message.t, Coap_core.error) result -> Coap_core.Message.t Lwt.t) -> unit Lwt.t
null
https://raw.githubusercontent.com/hyper-systems/ocaml-coap/8195715ded4b057b480b8d5f89324c18b4eb753b/coap-server-lwt/Coap_server_lwt.mli
ocaml
val start : ?addr:string -> ?port:int -> ((Coap_core.Message.t, Coap_core.error) result -> Coap_core.Message.t Lwt.t) -> unit Lwt.t
ccd085b5d818f8ffd34a42f48d0f5b5a516b223142e58ca238ff29e9473eda73
tomhanika/conexp-clj
util_test.clj
;; Copyright ⓒ the conexp-clj developers; all rights reserved. ;; The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( -1.0.php ) ;; which can be found in the file LICENSE at the root of this distribution. ;; By using this software in any fashion, you are agreeing to be bou...
null
https://raw.githubusercontent.com/tomhanika/conexp-clj/fba07534bdda65be55b6bfbbb4356e73fe145527/src/test/clojure/conexp/io/util_test.clj
clojure
Copyright ⓒ the conexp-clj developers; all rights reserved. The use and distribution terms for this software are covered by the which can be found in the file LICENSE at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not re...
Eclipse Public License 1.0 ( -1.0.php ) (ns conexp.io.util-test "Utilities for writing out-in tests for IO." (:use [conexp.base :only (illegal-argument)] [conexp.io.util :only (tmpfile)])) (defn out-in "Returns object, treates as type, read in from a file where it has previously written to. format ...
c4bd3d321f720fc0bae66c7bb7cd5627346f133d0fb3a4dec4a329f6f7ab26ad
mukul-rathi/bolt
pprint_past.ml
open Ast.Ast_types open Parsed_ast open Ast.Pprint_ast open Core let indent_space = " " let rec pprint_expr ppf ~indent expr = let print_expr = Fmt.pf ppf "%sExpr: %s@." indent in let new_indent = indent_space ^ indent in match expr with | Integer (_, i) -> print_expr (Fmt.str "Int:%d" i) | Boolean (_, b)...
null
https://raw.githubusercontent.com/mukul-rathi/bolt/1faf19d698852fdb6af2ee005a5f036ee1c76503/src/frontend/parsing/pprint_past.ml
ocaml
open Ast.Ast_types open Parsed_ast open Ast.Pprint_ast open Core let indent_space = " " let rec pprint_expr ppf ~indent expr = let print_expr = Fmt.pf ppf "%sExpr: %s@." indent in let new_indent = indent_space ^ indent in match expr with | Integer (_, i) -> print_expr (Fmt.str "Int:%d" i) | Boolean (_, b)...
7431c2a4088e9ba2aae23a5ee2f1ec2dfd3873c7c1d3ac51a147591351549807
tweag/ormolu
no-trailing-blank-line.hs
data Test = Test
null
https://raw.githubusercontent.com/tweag/ormolu/bec43c1098687415d1fe207ae5cd27173b9217bb/data/diff-tests/inputs/no-trailing-blank-line.hs
haskell
data Test = Test
4077298c9f9afca1504dfbf60ff97bcc99defa6b1212029b6feccd754d728576
synsem/texhs
Context.hs
---------------------------------------------------------------------- -- | Module : Text . TeX.Context Copyright : 2015 - 2017 , 2015 - 2016 Language Science Press . -- License : GPL-3 -- -- Maintainer : -- Stability : experimental Portability : GHC -- Types and fun...
null
https://raw.githubusercontent.com/synsem/texhs/9e2dce4ec8ae0b2c024e1883d9a93bab15f9a86f/src/Text/TeX/Context.hs
haskell
-------------------------------------------------------------------- | License : GPL-3 Maintainer : Stability : experimental -------------------------------------------------------------------- * Errors * Contexts ** Types ** Combinators ** Commands ** Groups ** Low-level parsers
Module : Text . TeX.Context Copyright : 2015 - 2017 , 2015 - 2016 Language Science Press . Portability : GHC Types and functions for traversing TeX structures module Text.TeX.Context TeXDocError(..) , ThrowsError , TeXContext , Context(..) * Parsers , Parser , ...
91882f5d75b2b38f92b90871d11222844bc67de28c8b53388b58bda7bdbd735d
alexandroid000/improv
CameraInfo.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} # LANGUAGE DeriveGeneric # # LANGUAGE TemplateHaskell # module Ros.Sensor_msgs.CameraInfo where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Internal.RosBinary...
null
https://raw.githubusercontent.com/alexandroid000/improv/ef0f4a6a5f99a9c7ff3d25f50529417aba9f757c/roshask/msgs/Sensor_msgs/Ros/Sensor_msgs/CameraInfo.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveGeneric # # LANGUAGE TemplateHaskell # module Ros.Sensor_msgs.CameraInfo where import qualified Prelude as P import Prelude ((.), (+), (*)) import qualified Data.Typeable as T import Control.Applicative import Ros.Internal.RosBinary import Ros.Internal.Msg.MsgInfo import qualified GHC.Generics as G imp...
aff5f1b37bd0e3184aab17ed98cc5dd13d79757afb2a897e974e7d6092dce9f7
snapframework/io-streams
Combinators.hs
-- | Generic stream manipulations {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} # LANGUAGE RankNTypes # module System.IO.Streams.Combinators ( -- * Folds inputFoldM , outputFoldM , fold , foldM , fold_ , foldM_ , any , all , maximum , minimum -- * Unfolds , unfoldM...
null
https://raw.githubusercontent.com/snapframework/io-streams/ae692fee732adea9fe843fb3efe0dd43a6993844/src/System/IO/Streams/Combinators.hs
haskell
| Generic stream manipulations # LANGUAGE BangPatterns # # LANGUAGE DeriveDataTypeable # * Folds * Unfolds * Maps * Filter * Takes and drops * Zip and unzip * Utility ---------------------------------------------------------------------------- --------------------------------------------------------------...
# LANGUAGE RankNTypes # module System.IO.Streams.Combinators inputFoldM , outputFoldM , fold , foldM , fold_ , foldM_ , any , all , maximum , minimum , unfoldM , map , mapM , mapM_ , mapMaybe , contramap , contramapM , contramapM_ , contramapMaybe , filter , filterM , filterOutput ...
d7bfdc05d1e3fa940931fd91ae659dae32093220a1f8433b77317e18a9ff86cd
eugenkiss/7guis-Clojure-Seesaw
timer.clj
(ns sevenguis.timer (:use [seesaw core border] sevenguis.core) (:require [seesaw.bind :as b])) (defn format-elapsed [elapsed] (str (-> (/ elapsed 10.0) Math/floor int) "." (mod elapsed 10) "s")) (defn processing [elapsed duration] (while true (when (< @elapsed @duration) (Thread/sleep 100) (s...
null
https://raw.githubusercontent.com/eugenkiss/7guis-Clojure-Seesaw/4ab08883ee0fbc6daa7e573d11b130b546189b67/src/sevenguis/timer.clj
clojure
(ns sevenguis.timer (:use [seesaw core border] sevenguis.core) (:require [seesaw.bind :as b])) (defn format-elapsed [elapsed] (str (-> (/ elapsed 10.0) Math/floor int) "." (mod elapsed 10) "s")) (defn processing [elapsed duration] (while true (when (< @elapsed @duration) (Thread/sleep 100) (s...
d240301f9719b11e45c06861f6075c7596f61960310d5c7a67ee26708b919433
thizanne/cormoran
concrete.ml
open Batteries open Util open Location module O = Operation module T = TypedAst module Ty = Types type state = { regs : (Sym.t * T.constant option) list list; mem : (Sym.t * T.constant option) list; buf : (Sym.t * T.constant option) list list; } module D = Set.Make (struct type t = state let compare = compare ...
null
https://raw.githubusercontent.com/thizanne/cormoran/46d13330ebd1c8224a0603fd473d8e6bed48bf53/src/domains/concrete.ml
ocaml
get_var v
open Batteries open Util open Location module O = Operation module T = TypedAst module Ty = Types type state = { regs : (Sym.t * T.constant option) list list; mem : (Sym.t * T.constant option) list; buf : (Sym.t * T.constant option) list list; } module D = Set.Make (struct type t = state let compare = compare ...
f7d6de73a602828fdb1bbb98d79afb662993a2dd9c293a818d6a760156728ade
herbelin/coq-hh
evar_refiner.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/proofs/evar_refiner.ml
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/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Util open Names open Ter...
d4b3b1cd8008e21b64d82a66f867798fc5400a3f64c31d77fec9861beed7fef5
mirage/pecu
test.ml
let pp_chr = Fmt.using (function '\032' .. '\126' as x -> x | _ -> '.') Fmt.char let pp_scalar : type buffer. get:(buffer -> int -> char) -> length:(buffer -> int) -> buffer Fmt.t = fun ~get ~length ppf b -> let l = length b in for i = 0 to l / 16 do Fmt.pf ppf "%08x: " (i * 16) ; let j = ref 0 in ...
null
https://raw.githubusercontent.com/mirage/pecu/ce3fbfdf7d3785356bcb80e3cef3aebb05298494/test/test.ml
ocaml
let pp_chr = Fmt.using (function '\032' .. '\126' as x -> x | _ -> '.') Fmt.char let pp_scalar : type buffer. get:(buffer -> int -> char) -> length:(buffer -> int) -> buffer Fmt.t = fun ~get ~length ppf b -> let l = length b in for i = 0 to l / 16 do Fmt.pf ppf "%08x: " (i * 16) ; let j = ref 0 in ...
81596d3b7d8d4d18ea3223231cf32821ae7b43d28660ff60b6a27fcd84e900a1
nomeata/gipeda
EmbeddedFiles.hs
# LANGUAGE TemplateHaskell , OverloadedStrings # module EmbeddedFiles where import Data.FileEmbed import qualified Data.ByteString.Char8 as BS import Data.Monoid import System.Directory import Data.Functor marker :: BS.ByteString marker = "Remove this line to prevent gipeda from overriding this file" indexHtmlFile :...
null
https://raw.githubusercontent.com/nomeata/gipeda/f3c8c52df24361c1a09bdfbdaefcd63b54fef0d8/src/EmbeddedFiles.hs
haskell
# LANGUAGE TemplateHaskell , OverloadedStrings # module EmbeddedFiles where import Data.FileEmbed import qualified Data.ByteString.Char8 as BS import Data.Monoid import System.Directory import Data.Functor marker :: BS.ByteString marker = "Remove this line to prevent gipeda from overriding this file" indexHtmlFile :...
d65d3768d6badf3243954a3f0ed37db3b1cf417c85bff828c6c577cca791e81f
ndmitchell/ghc-make
Root.hs
module Main(main) where import HsRec import LhsRec import Include import Lhs main = print "Root"
null
https://raw.githubusercontent.com/ndmitchell/ghc-make/5164c721efa38a02be33d340cc91f5c737c29156/tests/complex/Root.hs
haskell
module Main(main) where import HsRec import LhsRec import Include import Lhs main = print "Root"
a0fa60cdcf61d24ef6d156b0251bb614ae04415fb2a2166a732f734ec45743d1
naveensundarg/prover
constants.lisp
;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: snark -*- ;;; File: constants.lisp The contents of this file are subject to the Mozilla Public License ;;; Version 1.1 (the "License"); you may not use this file except in ;;; compliance with the License. You may obtain a copy of the License at ;;; / ;;; Software di...
null
https://raw.githubusercontent.com/naveensundarg/prover/812baf098d8bf77e4d634cef4d12de94dcd1e113/snark-20120808r02/src/constants.lisp
lisp
-*- Mode: Lisp; Syntax: Common-Lisp; Package: snark -*- File: constants.lisp Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at / basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific la...
The contents of this file are subject to the Mozilla Public License Software distributed under the License is distributed on an " AS IS " The Original Code is SNARK . The Initial Developer of the Original Code is SRI International . Portions created by the Initial Developer are Copyright ( C ) 1981 - 2012 . ...
d401ce0124e757b8daddba3f9b076ca9975f5464c7ab483a7dec4c01c508f9bd
jarofghosts/clojure-koans
18_datatypes.clj
(defrecord Nobel [prize]) (deftype Pulitzer [prize]) (defprotocol Award (present [this recipient])) (defrecord Oscar [category] Award (present [this recipient] (print (str "Congratulations on your " (:category this) " Oscar, " recipient "!")))) (deftype Razzi...
null
https://raw.githubusercontent.com/jarofghosts/clojure-koans/9bc2a46414f479021ff27ac8744d36dce507ad7f/18_datatypes.clj
clojure
(defrecord Nobel [prize]) (deftype Pulitzer [prize]) (defprotocol Award (present [this recipient])) (defrecord Oscar [category] Award (present [this recipient] (print (str "Congratulations on your " (:category this) " Oscar, " recipient "!")))) (deftype Razzi...
528fb00f1b2dfd544492414fe84793e737cc02a6660dc6092dcdb09ea33004c0
kit-clj/demo-guestbook
test_utils.clj
(ns londonclj.guestbook.test-utils (:require [londonclj.guestbook.core :as core] [integrant.repl.state :as state])) (defn system-state [] (or @core/system state/system)) (defn system-fixture [] (fn [f] (when (nil? (system-state)) (core/start-app {:opts {:profile :test}})) (f)))
null
https://raw.githubusercontent.com/kit-clj/demo-guestbook/61aab45a40f79751f0e80471ac2d8f5466b696df/test/clj/londonclj/guestbook/test_utils.clj
clojure
(ns londonclj.guestbook.test-utils (:require [londonclj.guestbook.core :as core] [integrant.repl.state :as state])) (defn system-state [] (or @core/system state/system)) (defn system-fixture [] (fn [f] (when (nil? (system-state)) (core/start-app {:opts {:profile :test}})) (f)))
462859360a61b2c7f92128570a9cc7ffbe8b64b2652078b7afa0e0220a0fd297
shop-planner/shop3
tracer.lisp
;;; Version : MPL 1.1 / GPL 2.0 / LGPL 2.1 ;;; The contents of this file are subject to the Mozilla Public License ;;; Version 1.1 (the "License"); you may not use this file except in ;;; compliance with the License. You may obtain a copy of the License at ;;; / ;;; Software distributed under the License is distr...
null
https://raw.githubusercontent.com/shop-planner/shop3/ba429cf91a575e88f28b7f0e89065de7b4d666a6/shop3/unification/tracer.lisp
lisp
Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at / basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Portions crea...
Version : MPL 1.1 / GPL 2.0 / LGPL 2.1 The contents of this file are subject to the Mozilla Public License Software distributed under the License is distributed on an " AS IS " The Original Code is SHOP2 . The Initial Developer of the Original Code is the University of Maryland . Portions created by the Ini...
d5a915fc787afee571ab3d3a5f56fdfa4a0ac9cb2677514c562bc2ab5769f960
gildor478/ounit
oUnitTest.ml
(**************************************************************************) The OUnit library (* *) Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman . Copyright...
null
https://raw.githubusercontent.com/gildor478/ounit/faf4936b17507406c7592186dcaa3f25c6fc138a/src/lib/ounit2/advanced/oUnitTest.ml
ocaml
************************************************************************ Permission is hereby grante...
The OUnit library Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman . Copyright ( C ) 2010 OCamlCore SARL Copyright ( C ) 2013 The package OUnit is cop...
db053bbb3adc5dfa5edf679527e6fcc828033b2f34e17997003d7675e5baeb67
cojna/iota
RangeUpdateRangeMaxSpec.hs
# LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # module Data.SegTree.RangeUpdateRangeMaxSpec where import Data.Monoid.LastMax import Data.Monoid.LastMaxSpec () import Data.SegTree.RangeUpdateRangeMax () import Data.Semigroup import Test.Prelude import Test.Prop.MonoidAction (monoidActionSpec) main :: I...
null
https://raw.githubusercontent.com/cojna/iota/a64e8c5e4dd4f92e5ed3fcd0413be94ef1108f9e/test/Data/SegTree/RangeUpdateRangeMaxSpec.hs
haskell
# LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # module Data.SegTree.RangeUpdateRangeMaxSpec where import Data.Monoid.LastMax import Data.Monoid.LastMaxSpec () import Data.SegTree.RangeUpdateRangeMax () import Data.Semigroup import Test.Prelude import Test.Prop.MonoidAction (monoidActionSpec) main :: I...
0a4a1e5871a5fdb8469ee386b9696fc61dd61e0a20f9a1b5a5efc87fda99c025
imitator-model-checker/imitator
PTA2Uppaal.mli
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IMITATOR * * Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France ) * Université Paris 13 , LIPN , CNRS , France * * Module description ...
null
https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/PTA2Uppaal.mli
ocaml
Convert a model into a string
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IMITATOR * * Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France ) * Université Paris 13 , LIPN , CNRS , France * * Module description ...
efbf4f385f7851f594a984f24164b44927b88fa97f5646176903ed8b546095be
mumuki/mulang
Runner.hs
# LANGUAGE DeriveGeneric # module Language.Mulang.Interpreter.Runner ( runTests, runTestsForDir, TestResult(..), TestStatus(..)) where import GHC.Generics import Control.Monad (forM) import Control.Exception (ErrorCall, catch) import Control.Monad.State.Strict import D...
null
https://raw.githubusercontent.com/mumuki/mulang/92684f687566b2adafb331eae5b5916e2d90709e/src/Language/Mulang/Interpreter/Runner.hs
haskell
# LANGUAGE DeriveGeneric # module Language.Mulang.Interpreter.Runner ( runTests, runTestsForDir, TestResult(..), TestStatus(..)) where import GHC.Generics import Control.Monad (forM) import Control.Exception (ErrorCall, catch) import Control.Monad.State.Strict import D...
4118c02fffcb2f2c8ad7b984b9493a0ab142d12b3c6eede9288659443964c067
dhleong/wish
string.cljs
(ns ^{:author "Daniel Leong" :doc "String util fns"} wish.util.string (:require [clojure.string :as str])) (defn includes-any-case? "Case-insensitive includes?" [s substr] ; NOTE: we could do this without generating strings, ; but the goog.string.caseInsensitiveContains doesn't ; bother with that s...
null
https://raw.githubusercontent.com/dhleong/wish/9036f9da3706bfcc1e4b4736558b6f7309f53b7b/src/cljs/wish/util/string.cljs
clojure
NOTE: we could do this without generating strings, but the goog.string.caseInsensitiveContains doesn't bother with that so... meh
(ns ^{:author "Daniel Leong" :doc "String util fns"} wish.util.string (:require [clojure.string :as str])) (defn includes-any-case? "Case-insensitive includes?" [s substr] (when (and s substr) (str/includes? (str/lower-case s) (str/lower-case substr)))) (defn last-char "Like (...
1a15879c8c6b6c9795a392af000bbd57cb7980e46a9d09eaa1a033044be64234
alexeispirit/AutoCAD-Utils
utils.lsp
;;; <LISPDOC> < SUBR>(utils - load)</SUBR > < DESC > Load lisp files in provided order . Add utils folder to your Support path</DESC > ;;; <RET>Nothing</RET> ;;; </LISPDOC> (defun utils-load (/) (setq *utils_load_order* (list "utils-regexp.lsp" "utils-string.lsp" "uti...
null
https://raw.githubusercontent.com/alexeispirit/AutoCAD-Utils/852ddebaa66ff4fb77be99317e6180d5b5dfcc49/utils/utils.lsp
lisp
<LISPDOC> <RET>Nothing</RET> </LISPDOC>
< SUBR>(utils - load)</SUBR > < DESC > Load lisp files in provided order . Add utils folder to your Support path</DESC > (defun utils-load (/) (setq *utils_load_order* (list "utils-regexp.lsp" "utils-string.lsp" "utils-list.lsp" "utils-system.lsp" "utils-file.lsp" ...
99ac8a5d54868b218eba7c880ebc894c95db34b478cbe94e8993da1de96ab4a3
phronmophobic/membrane-re-frame-example
subs.clj
(ns membrane-re-frame-example.subs (:require [re-frame.core :refer [reg-sub subscribe]])) ;; ------------------------------------------------------------------------------------- ;; Layer 2 ;; ;; See -frame/subscriptions/ ;; ;; Layer 2 query functions are "extractors". They take from `app-db` ;; and don't do any fur...
null
https://raw.githubusercontent.com/phronmophobic/membrane-re-frame-example/9015b3dc4cd441da4144b80aee22ad502b53476b/src/membrane_re_frame_example/subs.clj
clojure
------------------------------------------------------------------------------------- Layer 2 See -frame/subscriptions/ Layer 2 query functions are "extractors". They take from `app-db` and don't do any further computation on the extracted values. Any further usage: (subscribe [:showing]) db is the (map) va...
(ns membrane-re-frame-example.subs (:require [re-frame.core :refer [reg-sub subscribe]])) computation should happen in Layer 3 . Why ? It is an efficiency thing . Every Layer 2 subscription will rerun any time that ` app - db ` changes ( in any way ) . As a result , we want Layer 2 to be trivial . (reg-sub ...
e2ee64010721b88e8d2ddf77556b462889bef0a5e510abd59bb5e154b0f6f556
modular-macros/ocaml-macros
ocaml299to3.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/tools/ocaml299to3.ml
ocaml
************************************************************************ OCaml ...
, Kyoto University RIMS Copyright 1996 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Lexer299 let input_buffer = Buffer.create 16383 let input_function ic buf len = let len = input ic buf...
6f22df3aa1f2f4f2cd89f0c0f4bdf566dcdaf04febe5001205605eae9e8bd28c
bhauman/figwheel-main
project.clj
(defproject com.bhauman/figwheel-main "0.2.18" :description "Figwheel Main - Clojurescript tooling." :url "-main" :license {:name "Eclipse Public License - v 1.0" :url "-v10.html"} :scm {:name "git" :url "-main"} :dependencies [[org.clojure/clojure "1.10.0"] [org.clojure/clojurescript...
null
https://raw.githubusercontent.com/bhauman/figwheel-main/eea4d680ff30d958da01ffb3aa0c9af57250093f/project.clj
clojure
(defproject com.bhauman/figwheel-main "0.2.18" :description "Figwheel Main - Clojurescript tooling." :url "-main" :license {:name "Eclipse Public License - v 1.0" :url "-v10.html"} :scm {:name "git" :url "-main"} :dependencies [[org.clojure/clojure "1.10.0"] [org.clojure/clojurescript...
ba4e969994d0ab9818d78f639d7d336ab2eaa2a25f8470e88f65666ceed9957b
SHoltzen/dice
Compiler.ml
open Core open Wmc open VarState open CoreGrammar open Bdd let flip_id = ref 1 (** Result of compiling an expression *) type compiled_expr = { state: bddptr btree; z: bddptr; flips: bddptr List.t} type compiled_func = { args: (bddptr btree) List.t; body: compiled_expr; } type compile_context = { man: Bd...
null
https://raw.githubusercontent.com/SHoltzen/dice/0577a89ce08e49da069c242f6353e4d9c19b12f5/lib/Compiler.ml
ocaml
* Result of compiling an expression map from variable identifiers to names, for debugging map from variables to weights true if eager let evaluation map from variable identifiers to BDDs * generates a symbolic representation for a variable of the given type this value is a heuristic create a temp variable ...
open Core open Wmc open VarState open CoreGrammar open Bdd let flip_id = ref 1 type compiled_expr = { state: bddptr btree; z: bddptr; flips: bddptr List.t} type compiled_func = { args: (bddptr btree) List.t; body: compiled_expr; } type compile_context = { man: Bdd.manager; funcs: (String.t, compiled_f...
38665ccae212ec5b53fd6c5055280be68f68f1efcbd334029ac2d0b2b0a9c264
janestreet/merlin-jst
printtyped.ml
(**************************************************************************) (* *) (* OCaml *) (* *) (* ...
null
https://raw.githubusercontent.com/janestreet/merlin-jst/980b574405617fa0dfb0b79a84a66536b46cd71b/src/ocaml/typing/printtyped.ml
ocaml
************************************************************************ OCaml Fabrice L...
Copyright 1999 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Asttypes;; open Format;; open Lexing;; open Location;; open Typedtree;; let fmt_position f l = if l.pos_lnum = -1 then fprintf f "%s[%d]" l.pos_fname l.pos_cnum...
993a81f845d4d6e4f569f7c77c3e6bb789d61ed040371b093d24c4d54e4169fd
b0-system/brzo
a.ml
open Map module M : S = struct include Map.Make (struct type t = int let compare = compare end) end
null
https://raw.githubusercontent.com/b0-system/brzo/79d316a5024025a0112a8569a6335241b4620da8/examples/ocaml/attic/a.ml
ocaml
open Map module M : S = struct include Map.Make (struct type t = int let compare = compare end) end
9c1b69908f63e3de36703918ffd1558ccb32ded90dce7f46d6a3529dadb82898
exercism/haskell
Tests.hs
# OPTIONS_GHC -fno - warn - type - defaults # # LANGUAGE RecordWildCards # import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Binary (toDecimal) main :: IO () main = hspecWith defaultConfig {configFastFail...
null
https://raw.githubusercontent.com/exercism/haskell/2b98084efc7d5ab098975c462f7977ee19c2fd29/exercises/practice/binary/test/Tests.hs
haskell
Some descriptions mentioning "errors" where changed to avoid confusion.
# OPTIONS_GHC -fno - warn - type - defaults # # LANGUAGE RecordWildCards # import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Binary (toDecimal) main :: IO () main = hspecWith defaultConfig {configFastFail...
3c94abb5f3b00632d3c4e4a0544563acbadb1a756f054ffdba22769b71deff95
district0x/cljs-ipfs-api
core_test.cljs
(ns cljs-ipfs-api.core-test (:require [cljs.test :refer [deftest testing is async]] [cljs.test :as t] [taoensso.timbre :as timbre :refer-macros [log trace debug ...
null
https://raw.githubusercontent.com/district0x/cljs-ipfs-api/01c5e6943d3cc5e0e54d436a796e98dc8145b0ba/test/cljs/cljs_ipfs_api/core_test.cljs
clojure
(is (= (core/nil-patched-defns 'test ['data ['options] ['callback] ['quack] 'mordata]) nil)) (info (macroexpand '(core/defsignature [add files.add [data [options] [callback] [mordata]]]))) (is (= (macroexpand '(core/defsignature [add files.add [data [options] [callback] [mordata]]])) nil))
(ns cljs-ipfs-api.core-test (:require [cljs.test :refer [deftest testing is async]] [cljs.test :as t] [taoensso.timbre :as timbre :refer-macros [log trace debug ...
6424ad1603a1262fa6dda271af35b49ca366a789a91306cc879490c8c2fc5f07
sweirich/pi-forall
Syntax.hs
{- pi-forall language -} -- | The abstract syntax of the simple dependently typed language See comment at the top of ' Parser ' for the concrete syntax of this language module Syntax where import Data.Maybe (fromMaybe) import Data.Set (Set) import Data.Set qualified as Set import Data.Typeable (Typeable) import GHC...
null
https://raw.githubusercontent.com/sweirich/pi-forall/69419e84d0495336ca133c1c1298b88b57cd62fa/version3/src/Syntax.hs
haskell
pi-forall language | The abstract syntax of the simple dependently typed language --------------------------------------- * Names --------------------------------------- automatically generate free variable, substitution, and alpha-equality function. | module names --------------------------------------- * Core...
See comment at the top of ' Parser ' for the concrete syntax of this language module Syntax where import Data.Maybe (fromMaybe) import Data.Set (Set) import Data.Set qualified as Set import Data.Typeable (Typeable) import GHC.Generics (Generic,from) import Text.ParserCombinators.Parsec.Pos (SourcePos, initialPos, n...
a6547a87f3e888ec8077c482dcb367df61932287099211cfc0dcc62748a58ad7
baconpaul/composition-kit
tempo.clj
(ns composition-kit.music-lib.tempo) A Clock is a function from a logical concept of a beat to a physical concept of time . I abstract them with ;; so we can have multiple clocks with different functional behaviours. We have a few key operations we can do on a tempo clock . Define them as multimethods switched o...
null
https://raw.githubusercontent.com/baconpaul/composition-kit/fce0addb74a9c30ba06e051d3bca51c5a2b0ce6f/src/composition_kit/music_lib/tempo.clj
clojure
so we can have multiple clocks with different functional behaviours. beats since epoch. 0 Remember this is still a constant signature metronome so the measure-beat-to-beat is the same. The variability comes in the beat-to-time implementation a function of this clock + beats
(ns composition-kit.music-lib.tempo) A Clock is a function from a logical concept of a beat to a physical concept of time . I abstract them with We have a few key operations we can do on a tempo clock . Define them as multimethods switched on : (defmulti metronome? :clocktype) (defmethod metronome? :d...
c93376249b28166c9972d13a3f0688335a6370f1ffb4f5d571cb7f0e391686a7
akabe/ocaml-crf
crf_train.ml
--- A library for conditional random field ( CRF ) in OCaml Copyright ( C ) 2015 < > This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License , o...
null
https://raw.githubusercontent.com/akabe/ocaml-crf/ced26bcce559b1eda307f7a8961ac9e52905882f/lib/crf_train.ml
ocaml
Evaluate computation costs by the number of loops.
--- A library for conditional random field ( CRF ) in OCaml Copyright ( C ) 2015 < > This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License , o...
cbe06c89f2a87af9f54326dbe6cbf8b5267ca6aa977304dfe9175e48e23fa99c
mark-watson/loving-common-lisp
readline-test.lisp
(defun readline-test () "read a maximum of 1000 expresions from the file 'test.dat'" (with-open-file (input-stream "test.dat" :direction :input) (dotimes (i 1000) (let ((x (read-line input-stream nil nil))) (if (null x) (return)) ;; break out of the 'dotimes' loop (format t "next line in fi...
null
https://raw.githubusercontent.com/mark-watson/loving-common-lisp/32f6abf3d2e500baeffd15c085a502b03399a074/src/code_snippets_for_book/readline-test.lisp
lisp
break out of the 'dotimes' loop
(defun readline-test () "read a maximum of 1000 expresions from the file 'test.dat'" (with-open-file (input-stream "test.dat" :direction :input) (dotimes (i 1000) (let ((x (read-line input-stream nil nil))) (format t "next line in file: ~S~%" x)))))
bf985d2e83ce8a0afbc728e029bf503ced0fb600c59db3db36edf0fb9facdb30
atolab/apero-core
ordered.mli
module type Comparable = sig type t val compare : t -> t -> int val equal : t -> t -> bool end module Ordered : sig module type S = sig type t include Comparable with type t := t module Infix : sig val (=) : t -> t -> bool val (>) : t -> t -> bool val (>=) : t -> t ...
null
https://raw.githubusercontent.com/atolab/apero-core/6e8b9bb8383de641396463fb4e5685b7f135755c/lib/ordered.mli
ocaml
module type Comparable = sig type t val compare : t -> t -> int val equal : t -> t -> bool end module Ordered : sig module type S = sig type t include Comparable with type t := t module Infix : sig val (=) : t -> t -> bool val (>) : t -> t -> bool val (>=) : t -> t ...
a4c819d1142d3d98975abd8adaf224d82a6831cf7021d0689355ddcd9c99576c
bigmlcom/clj-bigml
prediction.clj
Copyright 2012 , 2016 , 2017 BigML Licensed under the Apache License , Version 2.0 ;; -2.0 (ns bigml.api.prediction "Offers functions specific for BigML predictions. " (:require (bigml.api [core :as api] [utils :as utils])) (:refer-clojure :exclude [list])) (defn create "Creat...
null
https://raw.githubusercontent.com/bigmlcom/clj-bigml/61579ad473d7e191ed06fb6338847dcb0a664497/src/bigml/api/prediction.clj
clojure
-2.0
Copyright 2012 , 2016 , 2017 BigML Licensed under the Apache License , Version 2.0 (ns bigml.api.prediction "Offers functions specific for BigML predictions. " (:require (bigml.api [core :as api] [utils :as utils])) (:refer-clojure :exclude [list])) (defn create "Creates a pre...
a0f54285e749c5fb7e0aec2144d4396a02c0aad3efeaf899204d804e6f1ebbb0
boris-ci/boris
ApiV1.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -fno - warn - missing - signatures # module Test.Boris.Representation.ApiV1 where import Boris.Core.Data.Build import Boris.Core.Data.Instance import ...
null
https://raw.githubusercontent.com/boris-ci/boris/c321187490afc889bf281442ac4ef9398b77b200/boris-representation/test/Test/Boris/Representation/ApiV1.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -fno - warn - missing - signatures # module Test.Boris.Representation.ApiV1 where import Boris.Core.Data.Build import Boris.Core.Data.Instance import Boris.Representation.ApiV1 impor...
1867fb5289be04fe8235ede4cfc722d1a496b604abda7982f748c0af95bbbce2
jacquev6/General
SortedMap.ml
module Tree = RedBlackTree module Poly = struct let cmp (x, _) (y, _) = Compare.Poly.compare x y let cmp_k x (y, _) = Compare.Poly.compare x y type ('a, 'b) t = ('a * 'b) Tree.t let empty = Tree.empty let is_empty = Tree.is_empty let size t = Tree.size t ~cmp let add t ~k ~v = Tree....
null
https://raw.githubusercontent.com/jacquev6/General/5237123668e939c0cb83aa3e1c4756473336bc7e/src/Implementation/SortedMap.ml
ocaml
module Tree = RedBlackTree module Poly = struct let cmp (x, _) (y, _) = Compare.Poly.compare x y let cmp_k x (y, _) = Compare.Poly.compare x y type ('a, 'b) t = ('a * 'b) Tree.t let empty = Tree.empty let is_empty = Tree.is_empty let size t = Tree.size t ~cmp let add t ~k ~v = Tree....
5af2104627a37737439d5061faac4e0953066eceb6e900199fbbf289ab806ec1
pascal-knodel/haskell-craft
E'4'22.hs
-- -- -- ----------------- Exercise 4.22 . ----------------- -- -- -- module E'4'22 where hasZeroReturn :: (Integer -> Integer) -> Integer -> Bool hasZeroReturn f n | n < 0 = error "The argument is not a natural number." | n == 0 = f n == 0 | otherwise = f n == 0 || hasZeroReturn f ( n - 1 ...
null
https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'4'22.hs
haskell
--------------- --------------- *** Exception: The argument is not a natural number. True *** Exception: The argument is not a natural number. False
Exercise 4.22 . module E'4'22 where hasZeroReturn :: (Integer -> Integer) -> Integer -> Bool hasZeroReturn f n | n < 0 = error "The argument is not a natural number." | n == 0 = f n == 0 | otherwise = f n == 0 || hasZeroReturn f ( n - 1 ) GHCi > : { let f : : Integer - > Integer...
1bb063cbf8a672fb48486439e9ca118993e6c348ecb577e12822eef4f9644d70
troy-west/devoxx-18
topology.clj
(ns devoxx.topology (:refer-clojure :exclude [partition]) (:require [clojure.string :as str] [clojure.tools.logging :as log] [troy-west.arche :as arche] [cheshire.core :as json] [clj-time.format :as time.format] [clj-time.coerce :as time.coerce]) (:impor...
null
https://raw.githubusercontent.com/troy-west/devoxx-18/1de00b01621c867a0e7096f7804f32f906a66566/src/devoxx/topology.clj
clojure
write a materialized view for every subject token found
(ns devoxx.topology (:refer-clojure :exclude [partition]) (:require [clojure.string :as str] [clojure.tools.logging :as log] [troy-west.arche :as arche] [cheshire.core :as json] [clj-time.format :as time.format] [clj-time.coerce :as time.coerce]) (:impor...
bed42d6669bbb0de292be6bbfe2aafcd970b335e7fe15447097142cf58197703
rabbitmq/khepri
khepri_utils.erl
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. %% Copyright © 2021 - 2023 VMware , Inc. or its affiliates . All rights reserved . %% %% @hidden -module(khepri_utils). -include_lib("std...
null
https://raw.githubusercontent.com/rabbitmq/khepri/3527362ad9f59cff36231eb4e7b34dc066aa0f50/src/khepri_utils.erl
erlang
@hidden khepri:get_root/1 is unexported when compiled without `-DTEST'. ------------------------------------------------------------------- Helpers to standalone function extraction. -------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. Copyright © 2021 - 2023 VMware , Inc. or its affiliates . All rights reserved . -module(khepri_utils). -include_lib("stdlib/include/asser...
ad70785ec40bbec4d684646b8ef3c6b5129e11d3f36ac9c511f490835220afed
Ledest/otpbp
pg.erl
%% %% Copyright WhatsApp Inc. and its affiliates . 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 a...
null
https://raw.githubusercontent.com/Ledest/otpbp/4fc36071f63a01ec6c9059659b021177de2c0a6b/src_ext/pg.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing pe...
Copyright WhatsApp Inc. and its affiliates . All rights reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @author < > Process Groups with eventually consistent membership . thus create/1 and delete/1 h...
d1809b987ca8fe70f7cf7cfbccef4b4e75ca289a4cfecb9114e952ee466df0f9
mejgun/haskell-tdlib
GetWebPagePreview.hs
{-# LANGUAGE OverloadedStrings #-} -- | module TD.Query.GetWebPagePreview where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.FormattedText as FormattedText import qualified Utils as U -- | Returns a web page preview by the text of the message . Do not call this f...
null
https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/GetWebPagePreview.hs
haskell
# LANGUAGE OverloadedStrings # | | |
module TD.Query.GetWebPagePreview where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.FormattedText as FormattedText import qualified Utils as U Returns a web page preview by the text of the message . Do not call this function too often . Returns a 404 error if th...
a7220e276e0ac14bdf749152b7055640b823f65a2b95d7a816e5699290e23abd
smuenzel/opile
symbol.ml
open! Core include Compiler_without_sexp.Symbol let sexp_of_t t = print Format.str_formatter t; Format.flush_str_formatter () |> [%sexp_of: string] module Set = struct include Compiler_without_sexp.Symbol.Set let sexp_of_t t = fold (fun key acc -> key :: acc) t [] |> [%sexp_of: t list] end module Map = s...
null
https://raw.githubusercontent.com/smuenzel/opile/190ca86df6440550d0fddf0222e16ba2e52bca64/compiler-with-sexp/symbol.ml
ocaml
open! Core include Compiler_without_sexp.Symbol let sexp_of_t t = print Format.str_formatter t; Format.flush_str_formatter () |> [%sexp_of: string] module Set = struct include Compiler_without_sexp.Symbol.Set let sexp_of_t t = fold (fun key acc -> key :: acc) t [] |> [%sexp_of: t list] end module Map = s...
4aee542a1c8109132d706d341c9851747873f51b6a0a93fccafce24519df26cf
aspiwack/peppermint-prover
Tactic.hs
# LANGUAGE KindSignatures # {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # -- | This module defines a generic type of tactics in the sense of proof -- assistants. This library is well-suited to give the backbone of a tactic -- system where you have a type of goals, proof obl...
null
https://raw.githubusercontent.com/aspiwack/peppermint-prover/203dbabcc6392a869fca7ae71320cac1a62ecc05/lensy-f/src/Control/Tactic.hs
haskell
# LANGUAGE RankNTypes # | This module defines a generic type of tactics in the sense of proof assistants. This library is well-suited to give the backbone of a tactic system where you have a type of goals, proof obligation, or generally something which needs to be /solved/; and you have a type of theorem, or solut...
# LANGUAGE KindSignatures # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeApplications # typically be a ' MonadPlus ' , even though the tactic combinators in this module ' Maybe ' and ' [ ] ' . With ' Maybe ' , the semantics of @a ` or ` b@ is : if @a@ succeeds then @a@ else Using ' [ ] ' adds backtracking ( ...
0a7b9dda99741b80583fa8831d217f0061ed37873ef9f4304fd8397faf224b0a
public-law/nevada-revised-statutes-parser
SubChapter.hs
module Models.SubChapter where import BasicPrelude import Data.Aeson ( ToJSON ) import GHC.Generics ( Generic ) import Models.Section import Models.SubSubChapter data SubChapter = SubChapter { name :: Text, childre...
null
https://raw.githubusercontent.com/public-law/nevada-revised-statutes-parser/88a886debdab6ce5bd6cf5819c846cec1ffb9220/src/Models/SubChapter.hs
haskell
module Models.SubChapter where import BasicPrelude import Data.Aeson ( ToJSON ) import GHC.Generics ( Generic ) import Models.Section import Models.SubSubChapter data SubChapter = SubChapter { name :: Text, childre...
248429bf48c621c75ff5c95bb4da04c7063bf1744d4e4dee357e3ae01e1ba13c
hidaris/thinking-dumps
util.rkt
#lang racket/base (provide define-lifted-metafunction) (require redex/reduction-semantics (for-syntax racket/base syntax/parse)) (define-syntax (define-lifted-metafunction stx) (syntax-parse stx #:datum-literals (-> :) [(_ lang:expr meta-fun:id : dom:id ...+ -> cod:id racket-fun:e...
null
https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/semantic/util.rkt
racket
#lang racket/base (provide define-lifted-metafunction) (require redex/reduction-semantics (for-syntax racket/base syntax/parse)) (define-syntax (define-lifted-metafunction stx) (syntax-parse stx #:datum-literals (-> :) [(_ lang:expr meta-fun:id : dom:id ...+ -> cod:id racket-fun:e...
5dfae5cd3c339b24d03fc3040796e86e4a9ad4fa70f03ec2364d95e050f15d4b
onyx-platform/onyx
system.clj
(ns onyx.system (:require [clojure.core.async :refer [chan close!]] [com.stuartsierra.component :as component] [taoensso.timbre :refer [fatal info]] [onyx.static.logging-configuration :as logging-config] [onyx.peer.virtual-peer :refer [virtual-peer]] [onyx.p...
null
https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/system.clj
clojure
(ns onyx.system (:require [clojure.core.async :refer [chan close!]] [com.stuartsierra.component :as component] [taoensso.timbre :refer [fatal info]] [onyx.static.logging-configuration :as logging-config] [onyx.peer.virtual-peer :refer [virtual-peer]] [onyx.p...
470ba0b444a3f0d1b7f071a17f44beead23a94ed41e3340070e79bbb954291b3
philnguyen/soft-contract
repeat.rkt
#lang racket (require soft-contract/fake-contract) (define (repeat f n s) (if (= n 0) s (f (repeat f (- n 1) s)))) (provide/contract [repeat (->i ([f (any/c . -> . any/c)] [n integer?] [s any/c]) (res (f n s) (λ (a) (implies (= n 0) (equal? a s)))))])
null
https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/mochi/repeat.rkt
racket
#lang racket (require soft-contract/fake-contract) (define (repeat f n s) (if (= n 0) s (f (repeat f (- n 1) s)))) (provide/contract [repeat (->i ([f (any/c . -> . any/c)] [n integer?] [s any/c]) (res (f n s) (λ (a) (implies (= n 0) (equal? a s)))))])
c8aa8e907ec79ba22fb1f3475fb38b53d87a71256442a8f59510e4b04038df7d
mokus0/junkbox
Category.hs
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} - ` ` Category '' - ( c ) 2008 - ``Category'' - (c) 2008 James Cook -} module TypeExperiments.Category where import Data.List class Category o a | a -> o where dom :: a -> o cod :: a -> o identity...
null
https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/TypeExperiments/Category.hs
haskell
# OPTIONS -fglasgow-exts -fallow-undecidable-instances # matrices as a category with Int objects (numbers of rows and columns) and multiplication as composition product category coproduct category endofunction category; general case not expressible here endofunctor category; general case not expressible here "+1...
- ` ` Category '' - ( c ) 2008 - ``Category'' - (c) 2008 James Cook -} module TypeExperiments.Category where import Data.List class Category o a | a -> o where dom :: a -> o cod :: a -> o identity :: o -> a compose :: a -> a -> a dot :: Num a => [a...