_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
843e09fae7c6a5d00eff2ac02f843427f9b4efd29f3219a3233f6f777ed95ada
screenshotbot/screenshotbot-oss
core.lisp
;;;; Copyright 2018-Present Modern Interpreters Inc. ;;;; 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 /. (uiop:define-package :screenshotbot/slack/core (:use #:cl #:alexandria ...
null
https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/23b242c0a40c3da11efeb79a2ae6efb63fb8183a/src/screenshotbot/slack/core.lisp
lisp
Copyright 2018-Present Modern Interpreters Inc. forward decls index. Probably because of the inheritence. TODO: this is unnecessary, it's already available in base-audit-log.
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 /. (uiop:define-package :screenshotbot/slack/core (:use #:cl #:alexandria #:screenshotbot/user-api #:screenshotbot/model...
f47084d254b8fec6dee71a9271917be99790a63a375397e37076f1ef62dfc6ad
aptmcl/rosetta
materials.rkt
#lang racket/base (require (for-syntax racket/base)) (require racket/generic) (require (for-syntax racket/generic)) (require racket/file) (require racket/runtime-path) (require racket/system) (require racket/date) (require racket/list) (provide (all-defined-out)) (define-generics radiance (radiance-string radiance)...
null
https://raw.githubusercontent.com/aptmcl/rosetta/38aeafd730f93edaec7474106e84dae6d8bc1261/simulation/materials.rkt
racket
Some pre-defined materials
#lang racket/base (require (for-syntax racket/base)) (require racket/generic) (require (for-syntax racket/generic)) (require racket/file) (require racket/runtime-path) (require racket/system) (require racket/date) (require racket/list) (provide (all-defined-out)) (define-generics radiance (radiance-string radiance)...
a9df665437d8d79cd28e418de4a5fbf55eba7b54279dfe2b942aa886b1e81064
exoscale/coax
coax_test.cljc
(ns exoscale.coax-test #?(:cljs (:require-macros [cljs.test :refer [deftest testing is are]] [exoscale.coax :as sc])) (:require #?(:clj [clojure.test :refer [deftest testing is are]]) [clojure.spec.alpha :as s] [clojure.string :as str] [clojure.test.check :as tc] [clojure....
null
https://raw.githubusercontent.com/exoscale/coax/d053dc874f108eff567f8e2ef6b879567ffc6f57/test/exoscale/coax_test.cljc
clojure
(is (= (sc/coerce ::symbol-set "foo/bar") 'foo/bar)) The following tests can't work without using `eval`. We will avoid this (is (= (sc/coerce ::referenced-set ":a") :a)) (is (= (sc/coerce ::calculated-set ":foo") :foo)) (is (= (sc/coerce ::nilable-referenced-set ":a") :a)) (is (= (sc/coerce ::nilable-calculated-set "...
(ns exoscale.coax-test #?(:cljs (:require-macros [cljs.test :refer [deftest testing is are]] [exoscale.coax :as sc])) (:require #?(:clj [clojure.test :refer [deftest testing is are]]) [clojure.spec.alpha :as s] [clojure.string :as str] [clojure.test.check :as tc] [clojure....
63885b3e235a76f0b3e13e6d20f5474d6512d9ff44c060d1c39c12814045beab
eeng/shevek
shortcuts.cljs
(ns shevek.components.shortcuts (:require [reagent.core :as r])) (def keys-translation {13 :enter 27 :escape}) (defn- handle-keypressed [shortcuts-map e] (let [key (-> e .-which keys-translation) assigned-fn (shortcuts-map key) textarea? (-> e .-target .-tagName (= "TEXTAREA")) dropdo...
null
https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/components/shortcuts.cljs
clojure
Keep the enter default function on a textarea which adds a new line Only handle the shortcuts when the dropdown is not unfolded
(ns shevek.components.shortcuts (:require [reagent.core :as r])) (def keys-translation {13 :enter 27 :escape}) (defn- handle-keypressed [shortcuts-map e] (let [key (-> e .-which keys-translation) assigned-fn (shortcuts-map key) textarea? (-> e .-target .-tagName (= "TEXTAREA")) dropdo...
cc6178c5b683c6e37ae6f8eca2fa7e61404f58d5756d611c137a13543caab109
sky-big/RabbitMQ
rabbit_mgmt_wm_queue_get.erl
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 distributed on an " AS IS " %% basis, WITH...
null
https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-management/src/rabbit_mgmt_wm_queue_get.erl
erlang
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. -------------------------------------------------------------------- ---...
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 Software distributed under the License is distributed on an " AS IS " The Original Code is RabbitMQ Management Plugin . The Initial Developer of the Original Code...
393e9146aaf704e673826a758cf3bffc78044fcd895f4900eefd00caea076ea3
jjsimpso/gopher21
main.rkt
#lang racket/base (require racket/list) (require racket/string) (require racket/cmdline) (require "corpus.rkt") (require "gopher.rkt") (define gopher21-version "0.6.0") (define server-root (make-parameter "./")) (define server-port (make-parameter 70)) (define search-tree-path (make-parameter #f)) (define disk-cache...
null
https://raw.githubusercontent.com/jjsimpso/gopher21/145330de5a516943318875dfe928a5fa51b4d7fd/main.rkt
racket
#lang racket/base (require racket/list) (require racket/string) (require racket/cmdline) (require "corpus.rkt") (require "gopher.rkt") (define gopher21-version "0.6.0") (define server-root (make-parameter "./")) (define server-port (make-parameter 70)) (define search-tree-path (make-parameter #f)) (define disk-cache...
42b7cf043629a1d4e78a3216963ea6a9e7ca233aec17725608841e33e70b3e02
rescript-lang/rescript-compiler
ext_util.mli
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/5da6c88fb9237fbc4d61640187b82627690ccf39/jscomp/ext/ext_util.mli
ocaml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or * ( at your option ) any later...
1d1e0866551615be01056a91d271f97f0b38d0372e2abaf95ccdb84538d65917
LambdaHack/LambdaHack
Input.hs
-- | The type of definitions of key-command mappings to be used for the UI -- and shorthands for specifying command triples in the content files. module Game.LambdaHack.Client.UI.Content.Input ( InputContentRaw(..), InputContent(..), makeData , evalKeyDef , addCmdCategory, replaceDesc, moveItemTriple, repeatTripl...
null
https://raw.githubusercontent.com/LambdaHack/LambdaHack/a3cd114410471b6a48c4f4bb746308fd4ee002b4/engine-src/Game/LambdaHack/Client/UI/Content/Input.hs
haskell
| The type of definitions of key-command mappings to be used for the UI and shorthands for specifying command triples in the content files. * Internal operations | Key-command mappings to be specified in content and used for the UI. | Bindings and other information about human player commands. ^ binding of keys t...
module Game.LambdaHack.Client.UI.Content.Input ( InputContentRaw(..), InputContent(..), makeData , evalKeyDef , addCmdCategory, replaceDesc, moveItemTriple, repeatTriple, repeatLastTriple , mouseLMB, mouseMMB, mouseMMBMute, mouseRMB , goToCmd, runToAllCmd, autoexploreCmd, autoexplore25Cmd , aimFlingCmd, pro...
a4d3a2d769d5f1f95a4b8111eae70947dc591e4e86effd69675955bd6256bed1
kupl/LearnML
original.ml
type formula = | True | False | Not of formula | AndAlso of (formula * formula) | OrElse of (formula * formula) | Imply of (formula * formula) | Equal of (exp * exp) and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp) let rec eval (f : formula) : bool = match f with | True -> true | ...
null
https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/formula/sub32/original.ml
ocaml
type formula = | True | False | Not of formula | AndAlso of (formula * formula) | OrElse of (formula * formula) | Imply of (formula * formula) | Equal of (exp * exp) and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp) let rec eval (f : formula) : bool = match f with | True -> true | ...
949a2dd39a20fcb224ad7f4aefac1603982db665fc1358dee587173611d7f22e
rabbitmq/rabbitmq-trust-store
rabbit_trust_store_app.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 ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . %% -module(rabbit_trust_store_app). -behaviour(appli...
null
https://raw.githubusercontent.com/rabbitmq/rabbitmq-trust-store/b6a0cb779ae8d2efd58e66c9e291b54ab82322fa/src/rabbit_trust_store_app.erl
erlang
{requires, ...}, Only enter those options neccessary for this application. special handling of clients that present a chain rather than just a peer cert. This means the peer will automatically be validated.
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 ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved . -module(rabbit_trust_store_app). -behaviour(application...
62667d11626e730ca12c1871e00a19085aded57a9a1ac246b85f7514a004ab66
dag/all-about-monads
example21.hs
Author : Maintainer : < > Time - stamp : < Mon Aug 18 15:29:02 2003 > License : GPL Maintainer: Jeff Newbern <> Time-stamp: <Mon Aug 18 15:29:02 2003> License: GPL -} DESCRIPTION Example 21 - Lifting the IO monad through the Continuation monad using the ...
null
https://raw.githubusercontent.com/dag/all-about-monads/f5efbe7276a090cb1a3ce7ebb97ac28b1b13572e/examples/example21.hs
haskell
define "exit2"
Author : Maintainer : < > Time - stamp : < Mon Aug 18 15:29:02 2003 > License : GPL Maintainer: Jeff Newbern <> Time-stamp: <Mon Aug 18 15:29:02 2003> License: GPL -} DESCRIPTION Example 21 - Lifting the IO monad through the Continuation monad using the ...
a13c90e829092972d75065a8549ca0b19b70667eadd6147bdf8b688b3bfeda92
minoki/haskell-floating-point
Benchmark.hs
# LANGUAGE DataKinds # # LANGUAGE HexFloatLiterals # # LANGUAGE NumericUnderscores # # LANGUAGE ScopedTypeVariables # # OPTIONS_GHC -Wno - type - defaults # import Conversion import Data.Coerce import Data.Functor.Identity import Data.Int import Data.Proxy import ...
null
https://raw.githubusercontent.com/minoki/haskell-floating-point/7d7bb31bb2b07c637a5eaeda92fc622566e9b141/rounded-hw/benchmark/Benchmark.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE HexFloatLiterals # # LANGUAGE NumericUnderscores # # LANGUAGE ScopedTypeVariables # # OPTIONS_GHC -Wno - type - defaults # import Conversion import Data.Coerce import Data.Functor.Identity import Data.Int import Data.Proxy import ...
e77c3c99a6e83ef5ad6e6457abc105fbebd58b9f56d209e326887450c7167f96
pfdietz/ansi-test
butlast.lsp
;-*- Mode: Lisp -*- Author : Created : Sat Apr 19 22:41:14 2003 Contains : Tests of BUTLAST (deftest butlast.1 (let ((x (list 'a 'b 'c 'd 'e))) (let ((xcopy (make-scaffold-copy x))) (let ((result (butlast x 2))) (and (check-scaffold-copy x xcopy) result)))) ...
null
https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/cons/butlast.lsp
lisp
-*- Mode: Lisp -*- Error tests
Author : Created : Sat Apr 19 22:41:14 2003 Contains : Tests of BUTLAST (deftest butlast.1 (let ((x (list 'a 'b 'c 'd 'e))) (let ((xcopy (make-scaffold-copy x))) (let ((result (butlast x 2))) (and (check-scaffold-copy x xcopy) result)))) (a b c)) (deftest butla...
ff0014932e3f9bedf135350ef4174422086fe7c21006fecd91ff1ffd14189f4b
OCamlPro/optal
lp.ml
open Common_types type error = | Not_a_number | Unsolvable_problem of cmp * float | Not_a_linear_constraint of cmp exception Error of error type label = string type expr = (Expr.var*float) list type constr = { label : label option; expr : expr; bound_type : cmp; bound : float; } type bound = ...
null
https://raw.githubusercontent.com/OCamlPro/optal/852d269ad2698760e5130fb869bb8473f2dfd26c/src/lp.ml
ocaml
might change to accept quadratic objective functorize on the output ? **** recognize constraints that are variable bounds ***** | B of bound None -> drop annotations can only be kept on constraint This should not happen: normaly prevented by previous generate We do not convert to bounds now...
open Common_types type error = | Not_a_number | Unsolvable_problem of cmp * float | Not_a_linear_constraint of cmp exception Error of error type label = string type expr = (Expr.var*float) list type constr = { label : label option; expr : expr; bound_type : cmp; bound : float; } type bound = ...
3a4ea166a4badefc1c23a485ea54b5d7d8ebfbf37afc56941566ecddb310953d
cesquivias/rash
rash-lang.rkt
#lang racket/base (require syntax/readerr (prefix-in rash: "language.rkt")) (provide (rename-out [rash-read read] [rash-read-syntax read-syntax])) (define (rash-read in) (syntax->datum (rash-read-syntax #f in))) (define (rash-read-syntax src in) (define-values (start-line start-col...
null
https://raw.githubusercontent.com/cesquivias/rash/91e181b00e09ea44dd6cb89949e13712c73690fb/rash-lang.rkt
racket
#lang racket/base (require syntax/readerr (prefix-in rash: "language.rkt")) (provide (rename-out [rash-read read] [rash-read-syntax read-syntax])) (define (rash-read in) (syntax->datum (rash-read-syntax #f in))) (define (rash-read-syntax src in) (define-values (start-line start-col...
314c637dca731d3c04ec48d7687306da7c3519e4e1027013abf0f382cc2a44dc
ndmitchell/bake
MRU.hs
module General.MRU( MRU, empty, insert, lookup, delete, toList ) where import Prelude hiding (lookup) import qualified Data.Map as Map import qualified Data.IntMap as IntMap import Data.Tuple.Extra Basically a bimap where we can do minview on the second element data MRU k v = MRU Int -- usage index ...
null
https://raw.githubusercontent.com/ndmitchell/bake/967de648990e06fa1eb9a8fd629fcf155be5891f/src/General/MRU.hs
haskell
usage index when did I last use this thing what was used at which point
module General.MRU( MRU, empty, insert, lookup, delete, toList ) where import Prelude hiding (lookup) import qualified Data.Map as Map import qualified Data.IntMap as IntMap import Data.Tuple.Extra Basically a bimap where we can do minview on the second element data MRU k v = MRU empty :: MRU k v empty ...
4f6bd91f4e642aeab5544dc20a34658d027a607a2c313ef072e65f34c1b75931
mentat-collective/emmy
env_test.cljc
#_"SPDX-License-Identifier: GPL-3.0" (ns emmy.env-test (:refer-clojure :exclude [+ - * / zero? partial ref]) (:require [clojure.test :refer [is deftest testing]] [emmy.complex :as c] [emmy.env :as e :refer [+ * / partial ref complex ...
null
https://raw.githubusercontent.com/mentat-collective/emmy/90a1de10e78187c70d546c3cfd63c8d32b783bed/test/emmy/env_test.cljc
clojure
ClojureScript doesn't have refs.
#_"SPDX-License-Identifier: GPL-3.0" (ns emmy.env-test (:refer-clojure :exclude [+ - * / zero? partial ref]) (:require [clojure.test :refer [is deftest testing]] [emmy.complex :as c] [emmy.env :as e :refer [+ * / partial ref complex ...
f263b0b890446231e663959fbe1f90985c63eb28bc0a3ccc1156df8f9b34d057
mbutterick/typesetting
font-standard.rkt
#lang debug racket/base (require racket/class racket/string racket/match sugar/unstable/dict "core.rkt" "reference.rkt" fontland racket/runtime-path racket/list with-cache) (provide standard-font-name? make-standard-font) (define-runtime-path here ".") (struct sfont pdf-font (attributes glyph-wid...
null
https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/pitfall/pitfall/font-standard.rkt
racket
line looks like this: `key space value`. Possibly multiple lines with same key. line looks like this: WX 278 ; N exclam ; B 90 0 187 718 ;
#lang debug racket/base (require racket/class racket/string racket/match sugar/unstable/dict "core.rkt" "reference.rkt" fontland racket/runtime-path racket/list with-cache) (provide standard-font-name? make-standard-font) (define-runtime-path here ".") (struct sfont pdf-font (attributes glyph-wid...
8f4a579772104587333eb4e14e8a79e6a58381b2c7286abcc7af7222d9934d8a
thvnx/mlmpfr
initializationfunctions.ml
This file is part of mlmpfr . mlmpfr is free software : you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version . mlmpfr is distribut...
null
https://raw.githubusercontent.com/thvnx/mlmpfr/3311b0d3bfda2c9b6b9812f85fbc7c734e02a19a/testsuite/initializationfunctions.ml
ocaml
garbage collector full major
This file is part of mlmpfr . mlmpfr is free software : you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version . mlmpfr is distribut...
eb42b9f0f79535c831f4bf9b565181100aa0201c7d7d5ffd55e59c424f567222
lispnik/cl-http
sysdcl.lisp
-*- Syntax : Ansi - Common - Lisp ; Base : 10 ; Mode : lisp ; Package : common - lisp - user -*- ;;; Copyright 1994 - 97 , Christopher R Vincent & John C. Mallery . ;;; All rights reserved. ;;;------------------------------------------------------------------- ;;; ;;; SYSTEM DEFINITION CL-HTTP PROXY SERVICE ;;; (i...
null
https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/mcl/proxy/sysdcl.lisp
lisp
Base : 10 ; Mode : lisp ; Package : common - lisp - user -*- All rights reserved. ------------------------------------------------------------------- SYSTEM DEFINITION CL-HTTP PROXY SERVICE options are :load :compile :eval-load :compile-load-always, :compile-load Patches to MCL 4.1 client layer Client subst...
Copyright 1994 - 97 , Christopher R Vincent & John C. Mallery . (in-package :cl-user) This requires that the server be loaded first as there is considerable shared code . (define-system (cl-http-proxy) () MCL specific code "http:proxy;utils" "http:proxy;cache" "http:proxy;proxy...
5a37c72c6a1987d80a871ccaf77303fa0f14606280d6b2ae2ee2e117b6b91729
dwango/fialyzer
test_from_erlang.ml
open Base open Fialyzer open From_erlang open Obeam.Abstract_format let%expect_test "code_to_module" = let print code = Variable.reset_count(); code_to_module code |> Result.ok_exn |> [%sexp_of: Ast.module_] |> Expect_test_helpers_kernel.print_s in let line = 111 in (* simple module *) ...
null
https://raw.githubusercontent.com/dwango/fialyzer/3c4b4fc2dacf84008910135bfef16e4ce79f9c89/test/unit-test/test_from_erlang.ml
ocaml
simple module patterns in toplevel X {X, Y, Z} * fun (X) -> X end * fun F(X) -> F(X) end * fun (X, {Y, Z}) -> {X, Y, Z}; * (X, Y) -> {X, Y} * end * fun (x) -> y end * [1,2,3] 'い' 'ろ' 'は' input: A = B output: A = B input: A = B = C output: B = C, A = B ...
open Base open Fialyzer open From_erlang open Obeam.Abstract_format let%expect_test "code_to_module" = let print code = Variable.reset_count(); code_to_module code |> Result.ok_exn |> [%sexp_of: Ast.module_] |> Expect_test_helpers_kernel.print_s in let line = 111 in print (AbstractCode(Mo...
1adda4f82cffa90e23003c5dc03010cd1ed1cdf267c3918bc3699816c30466ec
mejgun/haskell-tdlib
User.hs
{-# LANGUAGE OverloadedStrings #-} -- | module TD.Data.User where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.EmojiStatus as EmojiStatus import qualified TD.Data.ProfilePhoto as ProfilePhoto import qualified TD.Data.UserStatus as UserStatus import qualified TD.Data...
null
https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Data/User.hs
haskell
# LANGUAGE OverloadedStrings # | | | Represents a user | True, if the user added the current bot to attachment menu; only available to bots | IETF language tag of the user's language; only available to bots | Type of the user | If false, the user is inaccessible, and the only information known about the user is ...
module TD.Data.User where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.EmojiStatus as EmojiStatus import qualified TD.Data.ProfilePhoto as ProfilePhoto import qualified TD.Data.UserStatus as UserStatus import qualified TD.Data.UserType as UserType import qualified T...
d7451476a19f545aa57e0e3df8132caa8c4be3f525bb310ff1fed57f6637d4a3
dschrempf/mcmc
Shuffle.hs
-- | Module : Mcmc . Internal . Shuffle -- Description : Shuffle a list Copyright : 2021 License : GPL-3.0 - or - later -- -- Maintainer : -- Stability : unstable -- Portability : portable -- Creation date : We d May 20 14:37:09 2020 . -- -- From . module Mcmc.Internal.Shuffle ( ...
null
https://raw.githubusercontent.com/dschrempf/mcmc/e9521050f4ed03672e99041bc6b861e3cdce7ddf/mcmc/src/Mcmc/Internal/Shuffle.hs
haskell
| Description : Shuffle a list Maintainer : Stability : unstable Portability : portable From . vectors. | Shuffle a vector. elements from @xs@, without replacement, and that @m@ times.
Module : Mcmc . Internal . Shuffle Copyright : 2021 License : GPL-3.0 - or - later Creation date : We d May 20 14:37:09 2020 . module Mcmc.Internal.Shuffle ( shuffle, ) where import Control.Monad import Control.Monad.ST import qualified Data.Vector as V import qualified Data.Vector.Mu...
2d32042aa0ba221174126b42aeb9e0203d83c797c27bd62097e4dc4ff7b4d10a
Frama-C/Frama-C-snapshot
stmtcompiler_test_rela.ml
test API of StmtCompiler for relational property verification [@@@ warning "-40"] [@@@ warning "-42"] open Wp open Factory open Sigs let run () = let setup : Factory.setup = { mheap = Hoare; mvar = Var; cint = Cint.Natural; ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/wp/tests/wp/stmtcompiler_test_rela.ml
ocaml
Seconde call
test API of StmtCompiler for relational property verification [@@@ warning "-40"] [@@@ warning "-42"] open Wp open Factory open Sigs let run () = let setup : Factory.setup = { mheap = Hoare; mvar = Var; cint = Cint.Natural; ...
25ba35a90b5f98610deb0ba63a84dc1505e53e42794e31ce2750c2bba2a8062f
documented/Clex
markdown.clj
(ns cljex.markdown) (defn markdown [doc] (let [md (new com.petebevin.markdown.MarkdownProcessor)] (str (.markdown md (read))) (.markdown md ())))
null
https://raw.githubusercontent.com/documented/Clex/3eeec8669cb7ae3898600a8ba472f150bba98d8d/src/cljex/markdown.clj
clojure
(ns cljex.markdown) (defn markdown [doc] (let [md (new com.petebevin.markdown.MarkdownProcessor)] (str (.markdown md (read))) (.markdown md ())))
b112306f18b8e90d76bad6a7c97197752f69d16b38b4117d100201dbdbb3de9f
seckcoder/course-compiler
reg_int_exp_compiler.rkt
#lang racket (require "register_allocator.rkt") (require "utilities.rkt") (compile reg-int-exp-passes)
null
https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/reg_int_exp_compiler.rkt
racket
#lang racket (require "register_allocator.rkt") (require "utilities.rkt") (compile reg-int-exp-passes)
5a988510c53ed81c80beb418d1e6122186d8c35ab06f7c234552e9c7a57dc8ac
chiroptical/thinking-with-types
Lib.hs
{-# LANGUAGE RankNTypes #-} module Lib where rank 0 five :: Int -> Int five = (+5) A broken rank 1 function -- applyToFive :: (a -> a) -> Int applyToFive f = f 5 A working rank 2 function applyToFive :: (forall a. a -> a) -> Int applyToFive f = f 5 -- foo :: forall r. ((forall a. a -> r) -> r) This type ...
null
https://raw.githubusercontent.com/chiroptical/thinking-with-types/781f90f1b08eb94ef3600c5b7da92dfaf9ea4285/Chapter6/src/Lib.hs
haskell
# LANGUAGE RankNTypes # applyToFive :: (a -> a) -> Int foo :: forall r. ((forall a. a -> r) -> r) -> it is called an impredicative type What is the rank of the following type signatures a -> b -> c is actually parsed a -> (b -> c) The types `a` and `forall r. (a -> r) -> r` are isomorphic the forall r. (a -> r) ...
module Lib where rank 0 five :: Int -> Int five = (+5) A broken rank 1 function applyToFive f = f 5 A working rank 2 function applyToFive :: (forall a. a -> a) -> Int applyToFive f = f 5 This type signature is impossible to implement in GHC a :: Int -> (forall a. a -> a) a = undefined rank 1 b :: (a...
be55866de6023cffed72101c82c10fa6e5eb7ec48f0c3078a17d177fff67b2f1
danilkolikov/dfl
Dependencies.hs
| Module : Compiler . Module . Dependencies Description : Builder of a dependency tree Copyright : ( c ) , 2019 License : MIT Builder of module 's dependency tree Module : Compiler.Module.Dependencies Description : Builder of a dependency tree Copyright : (c) Danil Kolik...
null
https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Compiler/Module/Dependencies.hs
haskell
| A type of the builder of dependencies | Resolves dependencies between modules Don't visit files twice Check file existence Read file and parse header Check module name Get dependencies Save and check all imported files | Gets name of a module
| Module : Compiler . Module . Dependencies Description : Builder of a dependency tree Copyright : ( c ) , 2019 License : MIT Builder of module 's dependency tree Module : Compiler.Module.Dependencies Description : Builder of a dependency tree Copyright : (c) Danil Kolik...
f9e733e0602db8b6222ebdf1725f94c33ba505040e623098c99b6e6e1c7b9a19
BillHallahan/G2
SimpleAnnot.hs
module SimpleAnnot where f :: Int -> Int f b = b + 1 @ simpleF : : x : { y : Int | y > 0 } @ simpleF :: Int -> Int simpleF x = f x {-@ simpleG :: { x:Int | x > 0} -> { y:Int | y > 0} @-} simpleG :: Int -> Int simpleG x = f x
null
https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/Liquid/SimpleAnnot.hs
haskell
@ simpleG :: { x:Int | x > 0} -> { y:Int | y > 0} @
module SimpleAnnot where f :: Int -> Int f b = b + 1 @ simpleF : : x : { y : Int | y > 0 } @ simpleF :: Int -> Int simpleF x = f x simpleG :: Int -> Int simpleG x = f x
8b8d228630592066780b3498411b07f657527924889c2c01319d227b9e017a05
exoscale/clojure-kubernetes-client
v1_config_map_node_config_source.clj
(ns clojure-kubernetes-client.specs.v1-config-map-node-config-source (:require [clojure.spec.alpha :as s] [spec-tools.data-spec :as ds] ) (:import (java.io File))) (declare v1-config-map-node-config-source-data v1-config-map-node-config-source) (def v1-config-map-node-config-source-data ...
null
https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_config_map_node_config_source.clj
clojure
(ns clojure-kubernetes-client.specs.v1-config-map-node-config-source (:require [clojure.spec.alpha :as s] [spec-tools.data-spec :as ds] ) (:import (java.io File))) (declare v1-config-map-node-config-source-data v1-config-map-node-config-source) (def v1-config-map-node-config-source-data ...
4fa6a9fb7d76d614d51b5035fbe7ae2e0b34ffbaf5c9e319194192f4cdc72662
leo-project/leofs
leo_storage_handler_directory_tests.erl
%%==================================================================== %% LeoStorage %% Copyright ( c ) 2012 - 2018 Rakuten , Inc. %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may obtain %% a co...
null
https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_storage/test/leo_storage_handler_directory_tests.erl
erlang
==================================================================== Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissi...
LeoStorage Copyright ( c ) 2012 - 2018 Rakuten , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(leo_storage_han...
5d62df57664f9d020e1274af83a44296a0f3c0f0a3b905fa73ce6a8d2cec418f
jtod/Hydra
TestSigState.hs
module HDL.Hydra.Testing.TestSigState where import Data.IORef import Data.List import Data.Maybe import Data.Typeable import Data.Data import Data.Generics import Generics.SYB import HDL.Hydra.Core.Lib import HDL.Hydra.Core.SigState ------------------------------------------------------------ -- Some h...
null
https://raw.githubusercontent.com/jtod/Hydra/6fa939f719741ccc323d94a333e88f356e5d8486/src/HDL/Hydra/Testing/TestSigState.hs
haskell
---------------------------------------------------------- Some helper functions for testing the SYB traversal ---------------------------------------------------------- -------------------------------------------------------------------- -------------------------------------------------------------------- put...
module HDL.Hydra.Testing.TestSigState where import Data.IORef import Data.List import Data.Maybe import Data.Typeable import Data.Data import Data.Generics import Generics.SYB import HDL.Hydra.Core.Lib import HDL.Hydra.Core.SigState need to fix node type doNode : : IO ( ) doN...
01300d4b9a00fb867685a004148b3057806c19061d1030f2927611d186678e5f
goblint/analyzer
equality_bench.ml
ocamlbuild -pkg benchmark equality_bench.native & & ./equality_bench.native open Benchmark Q : does the compiler actually try = = first for = or is it a good idea to always do ` a = = b || a = b ` instead of ` a = b ` ? let xs = [1;2;3;4;5] let f1 x = x = xs let f2 x = x == xs let f3 x = x == xs || x = xs let ...
null
https://raw.githubusercontent.com/goblint/analyzer/0668b5b44e483ae26a4edac32cd13dc7b0560fbb/bench/hashcons/equality_bench.ml
ocaml
ocamlbuild -pkg benchmark equality_bench.native & & ./equality_bench.native open Benchmark Q : does the compiler actually try = = first for = or is it a good idea to always do ` a = = b || a = b ` instead of ` a = b ` ? let xs = [1;2;3;4;5] let f1 x = x = xs let f2 x = x == xs let f3 x = x == xs || x = xs let ...
f20de575d10e301d89dfc5060c1b0be767824d97eefc6e0daed7d4d3e5ef8f43
klutometis/clrs
section.scm
(require-extension syntax-case (srfi 1)) (module section-2.1 (insertion-sort-general insertion-sort) (include "../2.1/insertion-sort.scm"))
null
https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/2.1/section.scm
scheme
(require-extension syntax-case (srfi 1)) (module section-2.1 (insertion-sort-general insertion-sort) (include "../2.1/insertion-sort.scm"))
0b20a2b1a006dafe9d4f10a03bb3fe13fd9223401d52f8e3803f28d1ea7f3bc9
imitator-model-checker/imitator
DiscreteExpressionConverter.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IMITATOR * * Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France ) * Université Paris 13 , LIPN , CNRS , France * Université de Lorraine ,...
null
https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/DiscreteExpressionConverter.ml
ocaml
Get typed expression Print Create fake variable_infos containing just initialized constants ------------------------------------------------------------ Convert a guard ------------------------------------------------------------ Type check guard let str_typed_nonlinear_constraints = List.map (string_of_t...
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IMITATOR * * Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France ) * Université Paris 13 , LIPN , CNRS , France * Université de Lorraine ,...
7011af966a34d70fa37f2b32dc3e8b5d648c4c28acc112396b2a2c5d5a87ae8d
cedlemo/OCaml-GI-ctypes-bindings-generator
Overlay.mli
open Ctypes type t val t_typ : t typ val create : unit -> Widget.t ptr val add_overlay : t -> Widget.t ptr -> unit val get_overlay_pass_through : t -> Widget.t ptr -> bool val reorder_overlay : t -> Widget.t ptr -> int32 -> unit val set_overlay_pass_through : t -> Widget.t ptr -> bool -> unit
null
https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Overlay.mli
ocaml
open Ctypes type t val t_typ : t typ val create : unit -> Widget.t ptr val add_overlay : t -> Widget.t ptr -> unit val get_overlay_pass_through : t -> Widget.t ptr -> bool val reorder_overlay : t -> Widget.t ptr -> int32 -> unit val set_overlay_pass_through : t -> Widget.t ptr -> bool -> unit
70b9550f505738d2d4b94cc5f40bbbe4d59bbd5a4e51545756527cb4b79d51ef
conreality/conreality
math.ml
(* This is free and unencumbered software released into the public domain. *) (* constants from /usr/include/math.h *) let e = 2.7182818284590452354 (* e *) let log2_e = 1.4426950408889634074 (* log_2 e *) let log10_e = 0.43429448190325182765 (* log_10 e *) log_e 2 log_e 10 ...
null
https://raw.githubusercontent.com/conreality/conreality/e03328ef1f0056b58e4ffe181a279a1dc776e094/src/consensus/prelude/math.ml
ocaml
This is free and unencumbered software released into the public domain. constants from /usr/include/math.h e log_2 e log_10 e pi/2 pi/4 1/pi sqrt(2) 1/sqrt(2) BISECT-IGNORE-BEGIN BISECT-IGNORE-END XXX: Do we need bounds-checking for x on some of these? BISECT-IGNORE-BEGIN BISECT-IGNORE-END BISECT-...
log_e 2 log_e 10 pi ( 4 . * . atan 1 . ) let exp x = Pervasives.exp x let expm1 x = Pervasives.expm1 x let sqrt x = Pervasives.sqrt x let log x = Pervasives.log x let log10 x = Pervasives.log10 x let log1p x = Pervasives.log1p x Trigonometric f...
56649d9a1643583e8342d6934ca04d0e285bfa75f94add3f23de5090e64373d7
haskellfoundation/error-message-index
Universe.hs
module Universe where greeting :: String greeting = "Hello, Universe!"
null
https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-69158/example/after/Universe.hs
haskell
module Universe where greeting :: String greeting = "Hello, Universe!"
7aa3d61a425ad3a20c1031f558a1f761d8259fd08d395a72626fe370ec49e01b
xtdb/core2
object_store.clj
(ns core2.object-store (:require [clojure.string :as str] [core2.util :as util] [juxt.clojars-mirrors.integrant.core :as ig] [clojure.spec.alpha :as s]) (:import java.io.Closeable java.nio.ByteBuffer [java.nio.file CopyOption Files FileSystems FileVisitOptio...
null
https://raw.githubusercontent.com/xtdb/core2/3adeb391ca4dd73a3f79faba8024289376597d23/core/src/main/clojure/core2/object_store.clj
clojure
(ns core2.object-store (:require [clojure.string :as str] [core2.util :as util] [juxt.clojars-mirrors.integrant.core :as ig] [clojure.spec.alpha :as s]) (:import java.io.Closeable java.nio.ByteBuffer [java.nio.file CopyOption Files FileSystems FileVisitOptio...
b185a1a768c4cf89f41123f3335135f3d29fe32c769412111c23f6a7ae492f6e
Ekdohibs/camlboot
loops.ml
let () = print_endline "nonempty while"; let x = ref 42 in while !x > 0 do show_int !x; x := !x / 2 done; print_newline () let () = print_endline "empty while"; while false do show_int 42 done; print_newline () let () = print_endline "nonempty for (up)"; for x = 0 to 10 do show_i...
null
https://raw.githubusercontent.com/Ekdohibs/camlboot/506280c6e0813e0e794988151a8e46be55373ebc/miniml/compiler/test/loops.ml
ocaml
let () = print_endline "nonempty while"; let x = ref 42 in while !x > 0 do show_int !x; x := !x / 2 done; print_newline () let () = print_endline "empty while"; while false do show_int 42 done; print_newline () let () = print_endline "nonempty for (up)"; for x = 0 to 10 do show_i...
4b3a512d03803994022396318a27b452b75021a8c01a251bf6bd0e3c6b4bb4be
sneerteam/sneer
conversations_test.clj
(ns sneer.conversations-test (:require [midje.sweet :refer :all] [clojure.core.async :refer [thread]] [rx.lang.clojure.core :as rx] [sneer.admin :refer [new-sneer-admin-over-db]] [sneer.commons :refer [dispose]] [sneer.tuple.space :as space] [sne...
null
https://raw.githubusercontent.com/sneerteam/sneer/b093c46321a5a42ae9418df427dbb237489b7bcb/core/src/test/clojure/sneer/conversations_test.clj
clojure
(ns sneer.conversations-test (:require [midje.sweet :refer :all] [clojure.core.async :refer [thread]] [rx.lang.clojure.core :as rx] [sneer.admin :refer [new-sneer-admin-over-db]] [sneer.commons :refer [dispose]] [sneer.tuple.space :as space] [sne...
515afd17ddf99f2b1e7f6fc5e4850035192dfb3b08388231a1074b2c9f7396fc
bittide/bittide-hardware
Switch.hs
SPDX - FileCopyrightText : 2022 Google LLC -- SPDX - License - Identifier : Apache-2.0 {-# OPTIONS_GHC -fconstraint-solver-iterations=5 #-} {-# LANGUAGE GADTs #-} # LANGUAGE NamedFieldPuns # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module Tests.Switch(switchGroup) where import Clash.Prelu...
null
https://raw.githubusercontent.com/bittide/bittide-hardware/b44dac8ee0fb14b0c6a94fcbe830fdd8d140bec4/bittide/tests/Tests/Switch.hs
haskell
# OPTIONS_GHC -fconstraint-solver-iterations=5 # # LANGUAGE GADTs # # LANGUAGE OverloadedStrings # This generator can generate a calendar entry for a switch given the amount of links. | This generator can generate a calendar for the bittide switch, knowing the amount of bytes and address width of the wishbone bus, ...
SPDX - FileCopyrightText : 2022 Google LLC SPDX - License - Identifier : Apache-2.0 # LANGUAGE NamedFieldPuns # # LANGUAGE RecordWildCards # module Tests.Switch(switchGroup) where import Clash.Prelude import Clash.Hedgehog.Sized.Index import Clash.Hedgehog.Sized.Vector import Clash.Sized.Vector ( unsafeFromLis...
7480893a0e74c977cbc9a95cec81f652ff87dba98019c3d985cfa78b90fc9a6d
jepsen-io/maelstrom
journal.clj
(ns maelstrom.net.journal "A network's journal is a mutable store for keeping track of the history of network operations. We're not aiming for precision here--there's lag time between what the network sees and what nodes actually do--so we use jepsen.util/linear-time as our order for events. A journal is log...
null
https://raw.githubusercontent.com/jepsen-io/maelstrom/50608759036ebd5da6b3d113a8df93734763f6a2/src/maelstrom/net/journal.clj
clojure
Normal shutdown Log so we know what's going on, because this is going to stall the rest of the test Close each writer Return local writer if we already have it Ah, we need to create a new writer. Pick a new stripe ID... Create a writer And record it Analysis default hash. Still in bounds Done
(ns maelstrom.net.journal "A network's journal is a mutable store for keeping track of the history of network operations. We're not aiming for precision here--there's lag time between what the network sees and what nodes actually do--so we use jepsen.util/linear-time as our order for events. A journal is log...
4bddab368d3dee53595495d839072cb1931d9fdb1b49b4d51dd553e15b31e0d0
bjornbm/dimensional
ReadmeExample.hs
# LANGUAGE NoImplicitPrelude # module ReadmeExample where import Numeric.Units.Dimensional.Prelude import Numeric.Units.Dimensional.NonSI (mile) leg :: Length Double leg = 1 *~ mile -- *~ combines a raw number and a unit to form a quantity speeds :: [Velocity Double] speeds = [60, 50, 40, 30] *~~ (kilo meter / hour...
null
https://raw.githubusercontent.com/bjornbm/dimensional/fb2d9d6c8351ad283ee75f1ae6bee8e8a0dfb28b/examples/ReadmeExample.hs
haskell
*~ combines a raw number and a unit to form a quantity *~~ does the same thing for a whole Functor at once We can use dimensional versions of ordinary functions like / and sum to combine quantities /~ lets us recover a raw number from a quantity and a unit in which it should be expressed
# LANGUAGE NoImplicitPrelude # module ReadmeExample where import Numeric.Units.Dimensional.Prelude import Numeric.Units.Dimensional.NonSI (mile) leg :: Length Double speeds :: [Velocity Double] speeds = [60, 50, 40, 30] *~~ (kilo meter / hour) Parentheses are required around unit expressions that are comingled wi...
231e03f16381c0ef96bb49c5399c817155225a2515631d0bd474af9a14a70ae0
chenyukang/eopl
subtyping.scm
(module subtyping (lib "eopl.ss" "eopl") (require "lang.scm") (require "static-data-structures.scm") (require "expand-type.scm") (require "renaming.scm") (provide <:-iface) ;; <:-iface : Iface * Iface * Tenv -> Bool Page : 289 , 323 (define <:-iface (lambda (iface1 iface2 tenv) ...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter8/full-system/subtyping.scm
scheme
<:-iface : Iface * Iface * Tenv -> Bool first we rename the param names to the same fresh name s1 <: s2 iff s1 has at least as much stuff as s2, and in the same order. We walk down s1 until we find a declaration that declares end of s1, then we fail. As we walk down s1, we record any type bindings in the t...
(module subtyping (lib "eopl.ss" "eopl") (require "lang.scm") (require "static-data-structures.scm") (require "expand-type.scm") (require "renaming.scm") (provide <:-iface) Page : 289 , 323 (define <:-iface (lambda (iface1 iface2 tenv) (cases interface iface1 (simple-i...
71341a068cb04c784df8dcbd5479a8f2d51e3d017184ea577d0b7a266b6d4a58
2600hz-archive/whistle
ts_onnet_sup.erl
%%%------------------------------------------------------------------- @author < > ( C ) 2011 , VoIP INC %%% @doc %%% Manage onnet calls %%% @end Created : 18 Jun 2011 by %%%------------------------------------------------------------------- -module(ts_onnet_sup). -behaviour(supervisor). %% API -export([s...
null
https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/whistle_apps/apps/trunkstore/src/ts_onnet_sup.erl
erlang
------------------------------------------------------------------- @doc Manage onnet calls @end ------------------------------------------------------------------- API Supervisor callbacks =================================================================== API functions ==========================================...
@author < > ( C ) 2011 , VoIP INC Created : 18 Jun 2011 by -module(ts_onnet_sup). -behaviour(supervisor). -export([start_link/0, start_handler/2, stop_handler/1]). -export([init/1]). -define(SERVER, ?MODULE). -define(CHILD(ID, Args), {ID, {ts_from_onnet, start_link, [Args]}, temporary, 2000, worker, [t...
1ea4688681ace8abf0f14aed568a22f1006e0ac0d0693846ff35cf1c541839ad
robert-strandh/Clump
condition-reporters-english.lisp
(cl:in-package #:clump-binary-tree) (defmethod acclimation:report-condition ((condition invalid-binary-tree) stream (language acclimation:english)) (format stream "A binary tree was expected,~@ but instead the following was found:~@ ~s" (tree condition))) (defmethod acclima...
null
https://raw.githubusercontent.com/robert-strandh/Clump/1ea4dbac1cb86713acff9ae58727dd187d21048a/Binary-tree/condition-reporters-english.lisp
lisp
(cl:in-package #:clump-binary-tree) (defmethod acclimation:report-condition ((condition invalid-binary-tree) stream (language acclimation:english)) (format stream "A binary tree was expected,~@ but instead the following was found:~@ ~s" (tree condition))) (defmethod acclima...
a1beaa95ca206f84ffcbb4cb17f1ed6ef2510ba879e4676270a92394f2f1b6a6
davide/erl_img
image_gif.erl
File : Author : < > %%% Description : GIF image processing Created : 5 Mar 2003 by < > -module(image_gif). -include("erl_img.hrl"). -include("api.hrl"). %% -define(debug, true). -include("dbg.hrl"). -import(lists, [reverse/1]). -define(APP_EXTENSION, 16#ff). -define(COM_EXTENSION, 16#fe). -d...
null
https://raw.githubusercontent.com/davide/erl_img/1651b345b72086fab2f8faa6a775fd182fdb8eb1/src/image_gif.erl
erlang
Description : GIF image processing -define(debug, true). $! $, $; of image Should version be configurable? The Grammar. <GIF Data Stream> ::= Header <Logical Screen> <Data>* Trailer <Data> ::= <Graphic Block> | <Special-Purpose Block> <Graphic Block> ::= [Gr...
File : Author : < > Created : 5 Mar 2003 by < > -module(image_gif). -include("erl_img.hrl"). -include("api.hrl"). -include("dbg.hrl"). -import(lists, [reverse/1]). -define(APP_EXTENSION, 16#ff). -define(COM_EXTENSION, 16#fe). -define(CTL_EXTENSION, 16#f9). -define(TXT_EXTENSION, 16#01). ...
2a5b020fb8b0fc4e2328307d267690da369368eddc29d3e88915f4724dfd55ff
gregr/ina
tagged.scm
((provide tagged-vector? tagged-vector?! case/import) (require test)) (define (import-apply i env) (apply (cdr i) (map (lambda (name) (cdr (or (assoc name env) (error '"missing argument:" name)))) (car i)))) (define (tagged-vector? tag ...
null
https://raw.githubusercontent.com/gregr/ina/5e0a5b7ec44c8c9575b22ce5c394f7a96b766545/nscheme/old/old-5/lib/tagged.scm
scheme
((provide tagged-vector? tagged-vector?! case/import) (require test)) (define (import-apply i env) (apply (cdr i) (map (lambda (name) (cdr (or (assoc name env) (error '"missing argument:" name)))) (car i)))) (define (tagged-vector? tag ...
16a3e6e2d10474605f851a5751e9260d7fba15b15445e67c05948f5a16bbdc0c
cl-axon/cl-aima
utilities.lisp
;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- File: utilities.lisp ;;;; Basic utility functions and macros, used throughout the code. ;;; The utilities are divided into control flow macros, list utilities , functions for 2 - dimensional points , numeric utilities , ;;; some trivial functions, utilities for strings, ...
null
https://raw.githubusercontent.com/cl-axon/cl-aima/1e6915fa9f3e5f2c6fd75952d674ebec53558d04/utilities/utilities.lisp
lisp
-*- Mode: Lisp; Syntax: Common-Lisp; -*- File: utilities.lisp Basic utility functions and macros, used throughout the code. The utilities are divided into control flow macros, list some trivial functions, utilities for strings, symbols and printing, a debugging tool, and a testing tool." Removed allegro package-l...
utilities , functions for 2 - dimensional points , numeric utilities , Control Flow Macros the LOOP from the 2nd edition of ' Common Lisp : the Language ' . (#+excl without-package-locks #-excl progn (defmacro while (test do &body body) "Execute body while the test is true." (assert (eq do 'do)) ...
e9cf80a7fcb8d70cc2fe628230b0d4ef150ed4095f189ab2cb337f508ed328bd
apinf/proxy42
proxy42_api_logger.erl
%% %% @doc %% core api for logger plug-ins -module(proxy42_api_logger). -export([message/2]). %% TODO: Add developer_id and user_id to log. -define(METADATA, [ incoming_ip , domain , method , path , request_id , api_id , developer_id , user_id , response_code ]). %% %% @doc %% transforms internal cont...
null
https://raw.githubusercontent.com/apinf/proxy42/01b483b711881391e8306bf64b83b4df9d0bc832/apps/proxy42_core/src/proxy42_api_logger.erl
erlang
@doc core api for logger plug-ins TODO: Add developer_id and user_id to log. @doc transforms internal context into logger report
-module(proxy42_api_logger). -export([message/2]). -define(METADATA, [ incoming_ip , domain , method , path , request_id , api_id , developer_id , user_id , response_code ]). -spec message(_, _) -> _. message(LogInfo, Request) -> [message_events(LogInfo) | message_metadata(Request)]. message_metadata...
3b44adf173d677523518662e24b45c847bb012ada75539321ddd9795f93f59bf
Twinside/Eq
Ascii2DGrapher.hs
-- | This module implement an ASCII Art graph plotter, -- using subdivision to provide good looking ascii graph. module Language.Eq.Renderer.Ascii2DGrapher( -- * Plotting configuration PlotConf( .. ) ,...
null
https://raw.githubusercontent.com/Twinside/Eq/60105372d55420735b722245db7021c239c812f4/Language/Eq/Renderer/Ascii2DGrapher.hs
haskell
| This module implement an ASCII Art graph plotter, using subdivision to provide good looking ascii graph. * Plotting configuration * Real ploting functions | Alias in case I want to change in the future. | (Begin, End), all inclusive | Translate a list of write on the x (width) axis with a given amount. Perfor...
module Language.Eq.Renderer.Ascii2DGrapher( PlotConf( .. ) , PlotingMode( .. ) , ScalingType( .. ) , Dimension( .. ) , defa...
ba66a139e203546483a1b787566845724a6347be13dc3d57bd366474dfb71027
buntine/MoonDweller
gameplay.cljs
(ns moon-dweller.gameplay (:require [moon-dweller.util :as u] [moon-dweller.text :as t] [moon-dweller.state :as s] [dommy.core :as dom :refer-macros [sel sel1]]) (:require-macros [macros.core :as mc]) (:use [clojure.string :only (join split)])) (declare object-details kill-pla...
null
https://raw.githubusercontent.com/buntine/MoonDweller/f5faf9b6da44f352681648128d82da44604a98e4/src-cljs/moon-dweller/gameplay.cljs
clojure
If we are taking credits, just add them to the players wallet. Functions to execute when player speaks to a given object. Functions to execute when player gives a particular X to a Y. Functions to execute when player eats particular objects. Functions to execute when player drinks particular objects. Functions to...
(ns moon-dweller.gameplay (:require [moon-dweller.util :as u] [moon-dweller.text :as t] [moon-dweller.state :as s] [dommy.core :as dom :refer-macros [sel sel1]]) (:require-macros [macros.core :as mc]) (:use [clojure.string :only (join split)])) (declare object-details kill-pla...
e855bed465194bc389673a027df67edbfba937c480e8cd9f2515fe4964bedde2
oliyh/martian
re_frame_test.cljs
(ns martian.re-frame-test (:require [martian.re-frame :as martian] [martian.core :as mc] [cljs.test :refer-macros [deftest testing is run-tests async]] [re-frame.core :as re-frame] [re-frame.db :as rdb] [day8.re-frame.test :as rf-test])) (def interceptors [...
null
https://raw.githubusercontent.com/oliyh/martian/b22618b462c58f6b786d582542d2bc02a1462927/re-frame/test/martian/re_frame_test.cljs
clojure
(ns martian.re-frame-test (:require [martian.re-frame :as martian] [martian.core :as mc] [cljs.test :refer-macros [deftest testing is run-tests async]] [re-frame.core :as re-frame] [re-frame.db :as rdb] [day8.re-frame.test :as rf-test])) (def interceptors [...
a5d90a649602a624c28bb1746c04fb0247deacd0beafd10662805dbfec3bf13d
byteally/webapi
Server.hs
| Module : WebApi . Server License : : experimental Provides the implementation of web api . Given a contract , an implementation of the web api can be provided by using ' WebApiServer ' and ' ApiHandler ' . ' WebApiServer ' has the information pertaining to web api as a whole . ' ApiHandler ' p...
null
https://raw.githubusercontent.com/byteally/webapi/07ef0a3b653119a854e331028ea16c4f94457bb7/webapi/src/WebApi/Server.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE ExplicitForAll # # LANGUAGE TypeOperators # * Implementation of Api * Wrapping and unwrapping a 'Tagged' * Routing * Compact Server | Creates a successful response from its components. It is assumed that 'HeaderOut' and...
| Module : WebApi . Server License : : experimental Provides the implementation of web api . Given a contract , an implementation of the web api can be provided by using ' WebApiServer ' and ' ApiHandler ' . ' WebApiServer ' has the information pertaining to web api as a whole . ' ApiHandler ' p...
24a48ffb2449fab4dc2b5d52770cd8342e8f9006a68e5badca80b7c7f64d27ab
finkel-lang/finkel
Loop.hs
;;; -*- mode: finkel -*- ;;; Starting REPL (:require Finkel.Core) (defmodule Finkel.Tool.Internal.Loop (export start-repl acquire-repl cleanup-repl) (import-when [:compile] ;; finkel-core (Finkel.Prelude)) (import ;; base (Control.Concurrent [ThreadId forkIO]) (Control.Concurrent.MVar [MVar newEm...
null
https://raw.githubusercontent.com/finkel-lang/finkel/74ce4bb779805ad2b141098e29c633523318fa3e/finkel-tool/src/Finkel/Tool/Internal/Loop.hs
haskell
;;; -*- mode: finkel -*- ;;; Starting REPL (:require Finkel.Core) (defmodule Finkel.Tool.Internal.Loop (export start-repl acquire-repl cleanup-repl) (import-when [:compile] ;; finkel-core (Finkel.Prelude)) (import ;; base (Control.Concurrent [ThreadId forkIO]) (Control.Concurrent.MVar [MVar newEm...
9a9aaa5b0453d22c38970ecc269d115247ea626e6940d3eea0e47aecc7d2c5dd
JacquesCarette/Drasil
Main.hs
-- | Performs IO actions to get file path information and then generate an updated website . module Main where import GHC.IO.Encoding import Language.Drasil.Generate (gen, DocSpec(DocSpec), DocType(Website), Format(..), docChoices) import Drasil.Website.Body (mkWebsite, printSetting, FolderLocation(..)) import Syst...
null
https://raw.githubusercontent.com/JacquesCarette/Drasil/485a146088ac9341efe0b9f46ae07b49e14c7f15/code/drasil-website/app/Main.hs
haskell
| Performs IO actions to get file path information | Collect environment variables, place them in 'FolderLocation', Require the Makefile (or deploy script as it will usually be) to feed locations for where to find certain files/groups of files in the staged deploy folder. Env variables relating to variables expose...
and then generate an updated website . module Main where import GHC.IO.Encoding import Language.Drasil.Generate (gen, DocSpec(DocSpec), DocType(Website), Format(..), docChoices) import Drasil.Website.Body (mkWebsite, printSetting, FolderLocation(..)) import System.Environment (getEnv, lookupEnv) import Data.Maybe (...
909552115f17dcc6d23afed8feaca5e74a17ca243ddf0502662fd526fa0a4114
aliaksandr-s/prototyping-with-clojure
core_test.cljs
(ns visitera.core-test (:require [cljs.test :refer-macros [is are deftest testing use-fixtures]] [pjstadig.humane-test-output] [reagent.core :as reagent :refer [atom]] [visitera.core :as rc])) (deftest test-home (is (= true true)))
null
https://raw.githubusercontent.com/aliaksandr-s/prototyping-with-clojure/e1f90bf66c315de1dfa72624895637f1c609c42e/app/chapter-07/start/visitera/test/cljs/visitera/core_test.cljs
clojure
(ns visitera.core-test (:require [cljs.test :refer-macros [is are deftest testing use-fixtures]] [pjstadig.humane-test-output] [reagent.core :as reagent :refer [atom]] [visitera.core :as rc])) (deftest test-home (is (= true true)))
8109b0e2ebb20a9f71fa73f26ce5a0e123cfff89bb0ba2afe33a29d0a2162f29
portkey-cloud/edn-to-cfn
work_spaces.clj
(ns portkey.cloudformation.work-spaces "AUTOGENERATED clojure.spec definitions" (:require [clojure.spec.alpha] [portkey.cloudformation])) (do (clojure.core/defmethod portkey.cloudformation/resource-type-spec :portkey.cloudformation.work-spaces/workspace [___19567__auto__] (clojure.spec.alpha/k...
null
https://raw.githubusercontent.com/portkey-cloud/edn-to-cfn/7a3d247d35b7c4988c9b55634d03a008b87a2449/src/portkey/cloudformation/work_spaces.clj
clojure
(ns portkey.cloudformation.work-spaces "AUTOGENERATED clojure.spec definitions" (:require [clojure.spec.alpha] [portkey.cloudformation])) (do (clojure.core/defmethod portkey.cloudformation/resource-type-spec :portkey.cloudformation.work-spaces/workspace [___19567__auto__] (clojure.spec.alpha/k...
cb0f48fbe80a13d91c342c67ffc8ba50831320d71cd6815596f720cfdeb79e5b
evrim/core-server
streams.lisp
Core Server : Web Application Server Copyright ( C ) 2006 - 2008 , Aycan iRiCAN ;; 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 , or ;; (at your opti...
null
https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/streams/streams.lisp
lisp
This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public L...
Core Server : Web Application Server Copyright ( C ) 2006 - 2008 , Aycan iRiCAN it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License (in-package :tr.g...
2818ce3148e66f1e4098ca5ea7753f1c2905add985c748a8275505189c3f7c5d
inhabitedtype/ocaml-aws
describeEngineDefaultParameters.ml
open Types open Aws type input = DescribeEngineDefaultParametersMessage.t type output = DescribeEngineDefaultParametersResult.t type error = Errors_internal.t let service = "rds" let signature_version = Request.V4 let to_http service region req = let uri = Uri.add_query_params (Uri.of_string (Aws.Util...
null
https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/describeEngineDefaultParameters.ml
ocaml
open Types open Aws type input = DescribeEngineDefaultParametersMessage.t type output = DescribeEngineDefaultParametersResult.t type error = Errors_internal.t let service = "rds" let signature_version = Request.V4 let to_http service region req = let uri = Uri.add_query_params (Uri.of_string (Aws.Util...
3330a6537314be3018dc0b491e764ab9c1becabc7f36a2c3313240a350e5a40b
tweag/servant-oauth2
Cookies.hs
# language ExplicitForAll # module Servant.OAuth2.Cookies where import "base" Control.Monad.IO.Class (MonadIO, liftIO) import "binary" Data.Binary qualified as Binary import "bytestring" Data.ByteString (ByteString) import "base64-bytestring" Data.ByteString.Base64.URL qualified as Base64 import "bytestring" Data.Byt...
null
https://raw.githubusercontent.com/tweag/servant-oauth2/b8a6e9189986167ef9f4ada1f93e673e9fdd305b/src/Servant/OAuth2/Cookies.hs
haskell
header. | Default name of our cookie. | An empty cookie; useful to set when logging out. | Set a cookie and then perform a redirection; typically used as part of just want to redirect back to the homepage. | Build a simple cookie provided you have a function that can convert the | Make a session cookie from...
# language ExplicitForAll # module Servant.OAuth2.Cookies where import "base" Control.Monad.IO.Class (MonadIO, liftIO) import "binary" Data.Binary qualified as Binary import "bytestring" Data.ByteString (ByteString) import "base64-bytestring" Data.ByteString.Base64.URL qualified as Base64 import "bytestring" Data.Byt...
4674f6eca741276d5671f0c0f05f79b59e235e303944b66690d8b22de67d9de4
thierry-martinez/refl
indexer.ml
module Make (T : Map.OrderedType) = struct module Map = Map.Make (T) type t = { count : int; map : int Map.t; } let of_fresh count = { count; map = Map.empty } let empty = of_fresh 0 let count indexer = indexer.count let to_map indexer = indexer.map let fresh indexer = let index ...
null
https://raw.githubusercontent.com/thierry-martinez/refl/64e7c86f25c47c29aeeaa581a751ef37e138a42f/ppx/indexer.ml
ocaml
module Make (T : Map.OrderedType) = struct module Map = Map.Make (T) type t = { count : int; map : int Map.t; } let of_fresh count = { count; map = Map.empty } let empty = of_fresh 0 let count indexer = indexer.count let to_map indexer = indexer.map let fresh indexer = let index ...
1f116a888968c578eaa7e84c49b2932965ea5b2e039dacde43767506c49a8274
mbj/stratosphere
ServerSideEncryptionRuleProperty.hs
module Stratosphere.S3.Bucket.ServerSideEncryptionRuleProperty ( module Exports, ServerSideEncryptionRuleProperty(..), mkServerSideEncryptionRuleProperty ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} St...
null
https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/s3/gen/Stratosphere/S3/Bucket/ServerSideEncryptionRuleProperty.hs
haskell
# SOURCE #
module Stratosphere.S3.Bucket.ServerSideEncryptionRuleProperty ( module Exports, ServerSideEncryptionRuleProperty(..), mkServerSideEncryptionRuleProperty ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import Stratosphere.Reso...
52da9eb9383eb3e2fe0353f6b13dd93308c62ff8c5b601b31d2963682e6a2996
fossas/fossa-cli
AdjacencyMapSpec.hs
module AdjacencyMapSpec (spec) where import Algebra.Graph.AdjacencyMap qualified as AM import Algebra.Graph.AdjacencyMap.Extra qualified as AME import Data.Set (Set) import Data.Set qualified as Set import Test.Hspec (Expectation, Spec, describe, it, shouldBe) 1 - > 2 3 - > 4 beforeTrivial :: AM.AdjacencyMap Int ...
null
https://raw.githubusercontent.com/fossas/fossa-cli/efc29b4f9c874e338f0b5a7d1c5b13cb9543156f/test/AdjacencyMapSpec.hs
haskell
\ /
module AdjacencyMapSpec (spec) where import Algebra.Graph.AdjacencyMap qualified as AM import Algebra.Graph.AdjacencyMap.Extra qualified as AME import Data.Set (Set) import Data.Set qualified as Set import Test.Hspec (Expectation, Spec, describe, it, shouldBe) 1 - > 2 3 - > 4 beforeTrivial :: AM.AdjacencyMap Int ...
fd9714f5e5d035a056a97db219b6244515dac0e4c1a0b9a1e4968cdfbfce19c8
dimitri/pgcharts
front-raw-query.lisp
(in-package #:pgcharts) ;;; ;;; Raw query allows to easily play around with a SQL query without having to actually prepare and setup all the jazz . ;;; (defun front-raw-query (&optional qid) "Return the HTML to display a query form." (destructuring-bind (&key q ((:d dbname-list))) (let ((dbname (hunc...
null
https://raw.githubusercontent.com/dimitri/pgcharts/9b9549c53cca77039e8aaca18bce939ecb2b6549/src/front-raw-query.lisp
lisp
Raw query allows to easily play around with a SQL query without having "))
(in-package #:pgcharts) to actually prepare and setup all the jazz . (defun front-raw-query (&optional qid) "Return the HTML to display a query form." (destructuring-bind (&key q ((:d dbname-list))) (let ((dbname (hunchentoot:post-parameter "dbname")) (qname (hunchentoot:post-paramet...
b670d940ac4b8576245e8f6cf16c16b6e013dd9d796cf657d29260c1b0ce2a62
lambdaisland/data-printers
deep_diff.cljc
(ns lambdaisland.data-printers.deep-diff #?(:clj (:require [lambdaisland.data-printers :refer [type-name]] [lambdaisland.deep-diff.printer :as ddiff-printer] [puget.printer :as puget]))) (defn register-deep-diff [type tag to-edn] #?(:clj (ddiff-printer/register-print-handler...
null
https://raw.githubusercontent.com/lambdaisland/data-printers/586bc6897f15367c19d5973dde58bd8463d043f2/src/lambdaisland/data_printers/deep_diff.cljc
clojure
(ns lambdaisland.data-printers.deep-diff #?(:clj (:require [lambdaisland.data-printers :refer [type-name]] [lambdaisland.deep-diff.printer :as ddiff-printer] [puget.printer :as puget]))) (defn register-deep-diff [type tag to-edn] #?(:clj (ddiff-printer/register-print-handler...
7347114fb7bd7ad576c512ec2e2c4c2a3a83a639090614a2a4d4716c36075cbb
ocsigen/ocaml-eliom
opaque_prim.ml
let f x = Sys.opaque_identity x let () = assert(f f == f); assert(Sys.opaque_identity 1 = 1); assert(Sys.opaque_identity 1. = 1.)
null
https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/basic-more/opaque_prim.ml
ocaml
let f x = Sys.opaque_identity x let () = assert(f f == f); assert(Sys.opaque_identity 1 = 1); assert(Sys.opaque_identity 1. = 1.)
c4f409bab12c20c75b237ded9fe1c604848975d7aa3d8792f629e2628bf36fbe
apache/couchdb-couch-replicator
couch_replicator_changes_reader.erl
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 distributed under the License is distributed on an " A...
null
https://raw.githubusercontent.com/apache/couchdb-couch-replicator/d00b981445c03622497088eb872059ab4f48b298/src/couch_replicator_changes_reader.erl
erlang
use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations...
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not distributed under the License is distributed on an " AS IS " BASIS , WITHOUT -module(couch_replicator_changes_reader). -export([start_link/4]). -export([read_changes/6]). -include_lib("couch/include/couch_db.hrl"). -include("couch...
2dcaf4ff52e5df3f9ed3efee27fc0068e29db72bb8a992c7265864c9ea1710e2
tsloughter/kuberl
kuberl_v1_self_subject_rules_review_spec.erl
-module(kuberl_v1_self_subject_rules_review_spec). -export([encode/1]). -export_type([kuberl_v1_self_subject_rules_review_spec/0]). -type kuberl_v1_self_subject_rules_review_spec() :: #{ 'namespace' => binary() }. encode(#{ 'namespace' := Namespace }) -> #{ 'namespace' => Namespace }.
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_self_subject_rules_review_spec.erl
erlang
-module(kuberl_v1_self_subject_rules_review_spec). -export([encode/1]). -export_type([kuberl_v1_self_subject_rules_review_spec/0]). -type kuberl_v1_self_subject_rules_review_spec() :: #{ 'namespace' => binary() }. encode(#{ 'namespace' := Namespace }) -> #{ 'namespace' => Namespace }.
ea0e7938ed2340a5ddd6df475b650e1ca7f6c01d4cb7a9289982594d8ffd8d01
erlang/erlide_kernel
dbg_debugged.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 1998 - 2018 . 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 applic...
null
https://raw.githubusercontent.com/erlang/erlide_kernel/071c7cea0dbd29516a08859d9ac89d072ba540e0/debugger/erlide_debugger_25/src/dbg_debugged.erl
erlang
%CopyrightBegin% 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 l...
Copyright Ericsson AB 1998 - 2018 . 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(dbg_debugged). -export([eval/3]). eval(Mod , , ) - > Value eval(Mod, Func, Args) -> Meta = dbg_iev...
994c3c51b0bb96757d8150143f2198f449891d08eccaf862131300c16c59f5b8
mstepniowski/project-euler
euler_024.clj
Solution to Project Euler problem 24 ;; ;; ;; A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1 , 2 , 3 and 4 . If ;; all of the permutations are listed numerically or alphabetically, ;; we call it lexicographic order. The lexicographic permutations o...
null
https://raw.githubusercontent.com/mstepniowski/project-euler/01d64aa46b21d96fc5291fdf216bf4bad8249029/src/com/stepniowski/euler_024.clj
clojure
A permutation is an ordered arrangement of objects. For example, all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of
Solution to Project Euler problem 24 3124 is one possible permutation of the digits 1 , 2 , 3 and 4 . If 0 , 1 and 2 are : 012 , 021 , 102 , 120 , 201 , 210 What is the millionth lexicographic permutation of the digits 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 and 9 ? (ns com.stepniowski.euler-024 (:use clojure.c...
b3c53606c2dbfdf769983e6571979e5d0939d4d88fc326ff19b9620bbb8c3306
kaizhang/SciFlow
Remote.hs
# LANGUAGE RecordWildCards # {-# LANGUAGE GADTs #-} module Control.Workflow.Main.Command.Remote (remote) where import Options.Applicative import Control.Workflow.Coordinator import Control.Workflow.Types import Control.Workflow.Utils (mkNodeId) import Data.Proxy (Proxy(..)) import Control.Workflow.Main.Typ...
null
https://raw.githubusercontent.com/kaizhang/SciFlow/c9d85008e9db598d2addc8fe999e1abad9147e1c/SciFlow-app/src/Control/Workflow/Main/Command/Remote.hs
haskell
# LANGUAGE GADTs #
# LANGUAGE RecordWildCards # module Control.Workflow.Main.Command.Remote (remote) where import Options.Applicative import Control.Workflow.Coordinator import Control.Workflow.Types import Control.Workflow.Utils (mkNodeId) import Data.Proxy (Proxy(..)) import Control.Workflow.Main.Types data Remote a where...
5c29bc532667f429c943c054f34f6e9f44bbd06bf1bc63e084d25ec4e87f69b3
offby1/rudybot
quotes.rkt
#lang racket (require racket/runtime-path) (define *the-channel* (make-channel)) (define-runtime-path quotes-file "quotes") (define *dealer* (thread (lambda () (let re-read () ;; Instead of, or in addition to, reading the quotes file ;; .. how about ;; SELECT * FROM log ;; JOIN...
null
https://raw.githubusercontent.com/offby1/rudybot/74773ce9c1224813ee963f4d5d8a7748197f6963/quotes.rkt
racket
Instead of, or in addition to, reading the quotes file .. how about SELECT * FROM log JOIN log_word_map ON log_word_map.log_id = log.rowid WHERE log_word_map.word = 'lets'
#lang racket (require racket/runtime-path) (define *the-channel* (make-channel)) (define-runtime-path quotes-file "quotes") (define *dealer* (thread (lambda () (let re-read () AND ( log.text ' [ lL]et?s * ' OR log.text ' [ lL]ets * ' ) (fprintf (current-error-port) "...
12c60137eb62c49a1593fb61d68f73d83f94bc0c087280014aca2f12001fb8c5
8c6794b6/guile-tjit
ir-struct.scm
ANF IR for structs and GOOPS Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation ; either version 3 of the License...
null
https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/trace/ir-struct.scm
scheme
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public either This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See...
ANF IR for structs and GOOPS Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc. 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 ...
fb07dbd391791804afd5ccded9efefc6ac1c5b9c5fcd3af7dc1a82fcd337bbba
janestreet/ppx_hash
override_example.ml
open Ppx_hash_lib.Std open Hash.Builtin module Barbins_example = struct module X = struct type t = int [@@deriving hash] end module Y = struct type y = int [@@deriving hash] end module Z = struct type t = int [@@deriving hash] end module Example = struct module T = struct type t ...
null
https://raw.githubusercontent.com/janestreet/ppx_hash/aa63fc9e022055b45ae3864f9598b0514b2c5feb/test/override_example.ml
ocaml
dont use state use state ensure overrides are typed correctly
open Ppx_hash_lib.Std open Hash.Builtin module Barbins_example = struct module X = struct type t = int [@@deriving hash] end module Y = struct type y = int [@@deriving hash] end module Z = struct type t = int [@@deriving hash] end module Example = struct module T = struct type t ...
093e2b7637bb329b396be41cbc1d8976e2de4329a764bfc48166940467b52ac4
pangloss/pure-conditioning
cl_example_test.clj
(ns cl-example-test (:require [clojure.test :as t] [pure-conditioning :refer [restart-with manage condition condition* restart restarts lazy-conditions error]])) from (declare determine-infinity reciprocal-of) (defn high-level-code [] [(manage [:on-zero-denominator (restart-with ...
null
https://raw.githubusercontent.com/pangloss/pure-conditioning/f605800bcbdf80a408c60d8e60bb6cd8222f17c6/test/cl_example_test.clj
clojure
-Situations-1990.html
(ns cl-example-test (:require [clojure.test :as t] [pure-conditioning :refer [restart-with manage condition condition* restart restarts lazy-conditions error]])) from (declare determine-infinity reciprocal-of) (defn high-level-code [] [(manage [:on-zero-denominator (restart-with ...
2e0d974f3f3aedcd54bbd5166e22917fe16708fd4af55607b96c10f1fa6b8076
dextroamphetamine/nuko
Infer.hs
module Nuko.Typer.Infer ( inferProgram ) where import Relude import Nuko.Tree (NoExt (NoExt), Program (..), Re, Tc) import Nuko.Typer.Env (MonadTyper) import Nuko.Typer.Infer.LetDecl (inferLetDecl, initLetDecl) import Nuko.Typer.Infer.TypeDecl (inferTypeDecl, initTypeDecl) inferProgram ...
null
https://raw.githubusercontent.com/dextroamphetamine/nuko/1b6f960eeeebbfcbfb5700279c39758f82e7df28/src/Nuko/Typer/Infer.hs
haskell
module Nuko.Typer.Infer ( inferProgram ) where import Relude import Nuko.Tree (NoExt (NoExt), Program (..), Re, Tc) import Nuko.Typer.Env (MonadTyper) import Nuko.Typer.Infer.LetDecl (inferLetDecl, initLetDecl) import Nuko.Typer.Infer.TypeDecl (inferTypeDecl, initTypeDecl) inferProgram ...
839dc23bdbd5c4d07d155c417af362fdf99aaf77bd1eeee69454ddd8b90a44bc
chetmurthy/poly-protobuf
ocaml_codegen_test.ml
(* TODO Resurect or Delete *) let ( ) = let r = Ocaml_types . ( { record_name = " test " ; fields = [ { mutable _ = false ; field_type = Int ; field_name = " v1 " ; type_qualifier = No_qualifier ; encoding = Regular_field ( { packed = false ; defaul...
null
https://raw.githubusercontent.com/chetmurthy/poly-protobuf/1f80774af6472fa30ee2fb10d0ef91905a13a144/tests/testdata/unit-tests/ocaml_codegen_test.ml
ocaml
TODO Resurect or Delete Make sure the mutable_ is respected in the OCaml codegen
let ( ) = let r = Ocaml_types . ( { record_name = " test " ; fields = [ { mutable _ = false ; field_type = Int ; field_name = " v1 " ; type_qualifier = No_qualifier ; encoding = Regular_field ( { packed = false ; default = None ; field_number = 1 ; ...
46654ffb3420e0aaa01ca3554d4f232ae01ea6c9919e847bb8f6655945db6359
coccinelle/coccinelle
comm_assoc.ml
* This file is part of Coccinelle , licensed under the terms of the GPL v2 . * See copyright.txt in the Coccinelle source code for more information . * The Coccinelle source code can be obtained at * This file is part of Coccinelle, licensed under the terms of the GPL v2. * See copyright.txt in the Cocci...
null
https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/parsing_cocci/comm_assoc.ml
ocaml
everything is context for sgrep
* This file is part of Coccinelle , licensed under the terms of the GPL v2 . * See copyright.txt in the Coccinelle source code for more information . * The Coccinelle source code can be obtained at * This file is part of Coccinelle, licensed under the terms of the GPL v2. * See copyright.txt in the Cocci...
4173e75a4537c5ef641a543d690d16535e1827e61b048bbbf2a9504d885d7c95
patricoferris/ocaml-multicore-monorepo
bikereg.ml
Copyright ( C ) 2014 - -2021 Petter A. Urkedal < > * * This library is free software ; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or ( at your * option ) any la...
null
https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/ocaml-caqti/tests/bikereg.ml
ocaml
This is an example of how to use Caqti directly in application code. * This way of defining typed wrappers around queries should also work for * code-generators. This is an example of a custom type, but it is experimental for now. The * alternative is to use plain tuples, as the other queries below, and covertin...
Copyright ( C ) 2014 - -2021 Petter A. Urkedal < > * * This library is free software ; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the License , or ( at your * option ) any la...
4a30d5522fbd8f6e9931b589b29e829da54f343d7eae25ed75c608df7fa8d907
racket/web-server
env.rkt
#lang racket (require web-server/servlet web-server/servlet-env) ; request-number : str -> num (define (request-number which-number) (string->number (extract-binding/single 'number (request-bindings (send/suspend (build-request-page which-number)))))) ; build-request-page : str -> str -> respons...
null
https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-test/tests/web-server/servlet-env/env.rkt
racket
request-number : str -> num build-request-page : str -> str -> response
#lang racket (require web-server/servlet web-server/servlet-env) (define (request-number which-number) (string->number (extract-binding/single 'number (request-bindings (send/suspend (build-request-page which-number)))))) (define (build-request-page which-number) (lambda (k-url) `(html (he...
c338fa7120c6cf658e40e50671ad59c8684a37ee275fb36d7b00d6b604bf702a
dmbaturin/otoml
common.ml
(* Errors *) exception Key_error of string exception Type_error of string exception Parse_error of ((int * int) option * string) exception Duplicate_key of string (* Convenience functions for throwing exceptions *) let key_error err = raise (Key_error err) let type_error err = raise (Type_error err) let duplicate_key...
null
https://raw.githubusercontent.com/dmbaturin/otoml/066ff0fceacd622d42012481e74982fdaa1f1ca0/src/lib/common.ml
ocaml
Errors Convenience functions for throwing exceptions
exception Key_error of string exception Type_error of string exception Parse_error of ((int * int) option * string) exception Duplicate_key of string let key_error err = raise (Key_error err) let type_error err = raise (Type_error err) let duplicate_key_error err = raise (Duplicate_key err)
05f43b858d72fd824d26cbf4505bd942d7fb29732843f3da9ca72972b5a46812
amnh/PCG
generate-tcm.hs
# LANGUAGE FlexibleContexts # {-# LANGUAGE GADTs #-} # OPTIONS_GHC -fno - warn - orphans # module Main where import Control.Arrow ((***)) import Control.Monad import Data.Foldable import Data.Foldable.Custom (sum') import Data.Key im...
null
https://raw.githubusercontent.com/amnh/PCG/3a1b6bdde273ed4dc09717623986e1144b006904/app/generate-tcm.hs
haskell
# LANGUAGE GADTs #
# LANGUAGE FlexibleContexts # # OPTIONS_GHC -fno - warn - orphans # module Main where import Control.Arrow ((***)) import Control.Monad import Data.Foldable import Data.Foldable.Custom (sum') import Data.Key import Data.Matrix.NotStup...
0eb7c3abe9f2daa27f0605c7752dca53886e563f2b8b04d10d8663605505f3c7
janestreet/core
debug.ml
open! Import module List = Base.List module String = Base.String let eprint message = Printf.eprintf "%s\n%!" message let eprint_s sexp = eprint (Sexp.to_string_hum sexp) let eprints message a sexp_of_a = eprint_s ([%sexp_of: string * a] (message, a)) let eprintf format = Printf.ksprintf eprint format let failwiths = ...
null
https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/debug.ml
ocaml
open! Import module List = Base.List module String = Base.String let eprint message = Printf.eprintf "%s\n%!" message let eprint_s sexp = eprint (Sexp.to_string_hum sexp) let eprints message a sexp_of_a = eprint_s ([%sexp_of: string * a] (message, a)) let eprintf format = Printf.ksprintf eprint format let failwiths = ...
6ee4c377f183e3d998a475929637602b2a9893ec25586964d08202c73a42e1a6
rbonichon/smtpp
pre_LA.mli
val pre_LA: Format.formatter -> Ast.script -> unit ;; * [ pp fmt ast ] pretty - prints a full SMT - LIB script onto a formatter
null
https://raw.githubusercontent.com/rbonichon/smtpp/57eb74bccbb0f30293ee058ded4b01baa1067756/src/pre_LA.mli
ocaml
val pre_LA: Format.formatter -> Ast.script -> unit ;; * [ pp fmt ast ] pretty - prints a full SMT - LIB script onto a formatter
f3406a54d5c2de62a1fcba74dd5a5ad2cae2c99fbe8f34a26b36f0e53fa55d94
BillHallahan/G2
Sets7.hs
{-@ LIQUID "--no-termination" @-} module InsertSortElems (insertSort) where import qualified Data.Set as S @ type ListS a S = { v:[a ] | listElts v = S } @ @ type ListEq a X = ListS a { listElts X } @ @ insert : : Int - > xs:[Int ] - > { VV : [ Int ] | ( Set_cup ( listElts xs ) ( Set_sng 0 ) = = listElts VV ) }...
null
https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/Liquid/Sets/Sets7.hs
haskell
@ LIQUID "--no-termination" @ @ insertSort :: xs:[Int] -> ListEq Int xs @
module InsertSortElems (insertSort) where import qualified Data.Set as S @ type ListS a S = { v:[a ] | listElts v = S } @ @ type ListEq a X = ListS a { listElts X } @ @ insert : : Int - > xs:[Int ] - > { VV : [ Int ] | ( Set_cup ( listElts xs ) ( Set_sng 0 ) = = listElts VV ) } @ insert :: Int -> [Int] -> [Int]...
528e105eef4e588d4c6a9bb287e8ba3ad47f7363e0615e0a3a91bfe9e1252485
ParkerICI/datomic-query-improver
datomic_query_improver.clj
(ns org.parkerici.datomic-query-improver (:require [clojure.set :as set])) (defn- ->map-form "Converts list form Datomic query into map form." [q-edn] (->> (partition-by #{:find :in :where :with} q-edn) (partition-all 2) (map (fn [[k v]] [(first k) (vec v)])) (into {}))) (d...
null
https://raw.githubusercontent.com/ParkerICI/datomic-query-improver/1c1ab184ff9b6e054fafe688034895e0d389c463/src/org/parkerici/datomic_query_improver.clj
clojure
Note: defaults to counting "0" for any attributes not included in stats
(ns org.parkerici.datomic-query-improver (:require [clojure.set :as set])) (defn- ->map-form "Converts list form Datomic query into map form." [q-edn] (->> (partition-by #{:find :in :where :with} q-edn) (partition-all 2) (map (fn [[k v]] [(first k) (vec v)])) (into {}))) (d...
6e46274a297c0f195956e8ec1a6f433d30cefbc372744d1640904ad420350845
conscell/hugs-android
QuickCheckPoly.hs
module QuickCheckPoly {-# DEPRECATED "This module has moved to Debug.QuickCheck.Poly" #-} (module Debug.QuickCheck.Poly) where import Debug.QuickCheck.Poly
null
https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/oldlib/QuickCheckPoly.hs
haskell
# DEPRECATED "This module has moved to Debug.QuickCheck.Poly" #
module QuickCheckPoly (module Debug.QuickCheck.Poly) where import Debug.QuickCheck.Poly
fbd5d60c6ec6ddec017834ca4781cf2b50890d65fcaebdb50d0d60e0f379fcb1
html/firephp
firephp-tests.lisp
(defpackage #:firephp-tests (:use :cl :hu.dwim.stefil) (:documentation "FirePHP protocol server implementation tests")) (in-package :firephp-tests) (defmacro with-replaced-function (fdef &rest body) (let ((oldf (gensym)) (result (gensym)) (name (car fdef)) (args (cadr fdef)) (...
null
https://raw.githubusercontent.com/html/firephp/9cec99ae7ee03d19967e0da9807cf01e3a045a3c/firephp-tests.lisp
lisp
<br\\/>#2 & quot;strings&quot;<br\\/>\"]| " ) <br\\/ > [ simple - string]<br\\/><br\\/>Element - type : CHARACTER < : 4 < br\\/>&quot;strings&quot;<br\\/ > [ simple - string]<br\\/><br\\/>Element - type : CHARACTER < : 7 < br\\/>\"]| " )
(defpackage #:firephp-tests (:use :cl :hu.dwim.stefil) (:documentation "FirePHP protocol server implementation tests")) (in-package :firephp-tests) (defmacro with-replaced-function (fdef &rest body) (let ((oldf (gensym)) (result (gensym)) (name (car fdef)) (args (cadr fdef)) (...
314097cad6fc094c7a4402f62b221c246b5a8d4d37bbbb28397f9de79b39017c
input-output-hk/plutus-apps
Simulator.hs
# LANGUAGE AllowAmbiguousTypes # {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE GADTs # # LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # {-# LANGUAGE NumericUnderscores #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} ...
null
https://raw.githubusercontent.com/input-output-hk/plutus-apps/e8688b8f86a92b285e7d93eb418ccc314ad41bf9/plutus-pab/src/Plutus/PAB/Simulator.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE NumericUnderscores # # LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # # LANGUAGE TypeOperators # * Run with user-defined contracts * Logging ** Agent actions ** Control actions * Querying the state ** Transaction ...
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE GADTs # # LANGUAGE LambdaCase # # LANGUAGE NamedFieldPuns # # LANGUAGE TemplateHaskell # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # A live , multi - threaded PAB simulator with agent - specific states and action...
08a364906f04cea5c3ab182e17a2a3d423877b25798841be5f76a9facb41ab68
nuvla/api-server
data.cljc
(ns sixsq.nuvla.server.resources.spec.data (:require [clojure.spec.alpha :as s] [sixsq.nuvla.server.resources.spec.core :as core] [sixsq.nuvla.server.util.spec :as su] [spec-tools.core :as st])) (s/def ::content-type (-> (st/spec ::core/nonblank-string) (assoc :name "content-type" ...
null
https://raw.githubusercontent.com/nuvla/api-server/0f8673bd9d37b7c2f107a02aa45d7e67ba224f4a/code/src/sixsq/nuvla/server/resources/spec/data.cljc
clojure
(ns sixsq.nuvla.server.resources.spec.data (:require [clojure.spec.alpha :as s] [sixsq.nuvla.server.resources.spec.core :as core] [sixsq.nuvla.server.util.spec :as su] [spec-tools.core :as st])) (s/def ::content-type (-> (st/spec ::core/nonblank-string) (assoc :name "content-type" ...
dbb772a9da4ce264b79b54a40f210f07216bd2987ba61ef077bde3e34a0d7e97
sebastiaanvisser/ghc-goals
Test3.hs
# LANGUAGE GADTs , KindSignatures , TypeFamilies , RankNTypes # , KindSignatures , TypeFamilies , RankNTypes #-} import Data.List goal0 :: a -> b goal0 = undefined goal1 = undefined goal2 = undefined goal3 = undefined goa...
null
https://raw.githubusercontent.com/sebastiaanvisser/ghc-goals/cf256c99c4b7e3b569bab3e6c10f0903a7c1eac4/tests/Test3.hs
haskell
# LANGUAGE GADTs , KindSignatures , TypeFamilies , RankNTypes # , KindSignatures , TypeFamilies , RankNTypes #-} import Data.List goal0 :: a -> b goal0 = undefined goal1 = undefined goal2 = undefined goal3 = undefined goa...
434505caf857923bcf00971aebaf20fa69036f425f168ab25d743f87cb5e31d1
areuu/ilcompiler
operations_pb.ml
[@@@ocaml.warning "-27-30-39"] type load_integer_mutable = { mutable value : int64; } let default_load_integer_mutable () : load_integer_mutable = { value = 0L; } type load_big_int_mutable = { mutable value : int64; } let default_load_big_int_mutable () : load_big_int_mutable = { value = 0L; } type load_fl...
null
https://raw.githubusercontent.com/areuu/ilcompiler/c6f0bc809fe165947b8c7004dc1ed94414038002/src/proto/operations_pb.ml
ocaml
[@@@ocaml.warning "-27-30-39"] type load_integer_mutable = { mutable value : int64; } let default_load_integer_mutable () : load_integer_mutable = { value = 0L; } type load_big_int_mutable = { mutable value : int64; } let default_load_big_int_mutable () : load_big_int_mutable = { value = 0L; } type load_fl...
2789d46b1898175c8f5c1fe8d7cc6ad3379e7729aa05c721a0a5ad699b401fa7
GaloisInc/pate
Widening.hs
# LANGUAGE DataKinds # {-# LANGUAGE GADTs #-} # LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeApplications # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # # LANGUA...
null
https://raw.githubusercontent.com/GaloisInc/pate/a48c447156d95686c308a6d5ec696464120e0970/src/Pate/Verification/Widening.hs
haskell
# LANGUAGE GADTs # # LANGUAGE MultiWayIf # # LANGUAGE RankNTypes # # LANGUAGE OverloadedStrings # | Generate a fresh abstract domain value for the given graph node. This should represent the most information we can ever possibly have (i.e., all values are equal) as it will only ever be weakend via widening. ...
# LANGUAGE DataKinds # # LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeApplications # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # # LANGUAGE PolyKinds # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # # L...
d64854e145e44129f408a7497633b14dd906b1d00fb183d5723c4d6b27742340
pkamenarsky/replica
Types.hs
{-# LANGUAGE OverloadedStrings #-} module Replica.VDOM.Types where import Data.Aeson ((.=)) import qualified Data.Aeson as A import qualified Data.Text as T import qualified Data.Map as M t :: T.Text -> T.Text t = id type HTML = [VDOM] ...
null
https://raw.githubusercontent.com/pkamenarsky/replica/f01bbfb77c9536a1ea6ab011fb38351d91cb0217/src/Replica/VDOM/Types.hs
haskell
# LANGUAGE OverloadedStrings # For details, see the documentation on the @namespaceURI@ argument
module Replica.VDOM.Types where import Data.Aeson ((.=)) import qualified Data.Aeson as A import qualified Data.Text as T import qualified Data.Map as M t :: T.Text -> T.Text t = id type HTML = [VDOM] | A namespace URI . to [ createEl...
7d5ffb5d8bddad458d4a9b2ead2b1282ae54a3d2c7ef43391f234e4055262677
reifyhealth/specmonstah
core.cljs
(ns specmonstah-demo.core (:require [reagent.core :as r] [re-frame.core :as rf] [re-frame.db :as rfdb] [integrant.core :as ig] [sweet-tooth.frontend.core.flow :as stcf] [sweet-tooth.frontend.load-all-handler-ns] [sweet-tooth.frontend...
null
https://raw.githubusercontent.com/reifyhealth/specmonstah/afe38e7a39149836c31719f7e36a7504c14dbb80/demo/src/specmonstah_demo/core.cljs
clojure
(ns specmonstah-demo.core (:require [reagent.core :as r] [re-frame.core :as rf] [re-frame.db :as rfdb] [integrant.core :as ig] [sweet-tooth.frontend.core.flow :as stcf] [sweet-tooth.frontend.load-all-handler-ns] [sweet-tooth.frontend...
84c680501058249d18c749c8a459e9a83b94735f3a1204836b850a7d39c3d9f2
sethfowler/pygmalion
JSON.hs
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} module Pygmalion.JSON ( sourceRecordsToJSON ) where import qualified Data.ByteString.UTF8 as B import Data.List import Text.JSON import Pygmalion.Core sourceRecordsToJSON :: [CommandInfo] -> String sourceRecordsToJSON cis = encodeStrict $ map (toJSObject . toKeyVa...
null
https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/src/Pygmalion/JSON.hs
haskell
# LANGUAGE OverloadedStrings, RecordWildCards #
module Pygmalion.JSON ( sourceRecordsToJSON ) where import qualified Data.ByteString.UTF8 as B import Data.List import Text.JSON import Pygmalion.Core sourceRecordsToJSON :: [CommandInfo] -> String sourceRecordsToJSON cis = encodeStrict $ map (toJSObject . toKeyValue) cis where toKeyValue CommandInfo {..} = ...
8ab3d8987d9dd6b691647ec4a44c3e355d11b9e8675e699fb6ebc3adc434dd00
bbc/haskell-workshop
C6HOF.hs
module C6HOF where Define a function that takes a function and two other arguments -- and applies the function to the other arguments unevaledF :: (a -> b -> c) -> a -> b -> c unevaledF f = f Apply the first argument to unevaledF -- (doesn't matter what it is, we're only interested in the partial application) -- ...
null
https://raw.githubusercontent.com/bbc/haskell-workshop/475b9bac04167665030d7863798ccd27dfd589d0/violeta/exercises/src/C6HOF.hs
haskell
and applies the function to the other arguments (doesn't matter what it is, we're only interested in the partial application) Fill in the type signatures The type of the composition operator (.) is (.) :: (b -> c) -> (a -> b) -> (a -> c) This is a function that takes a function from B to C, Use flip to creat...
module C6HOF where Define a function that takes a function and two other arguments unevaledF :: (a -> b -> c) -> a -> b -> c unevaledF f = f Apply the first argument to unevaledF partial1 :: Num a => a -> a -> a partial1 = unevaledF $ (+) Apply the next argument to partial1 partial2 :: Num a => a -> a partial2...
90326fccb4a91b861b2b9cac3e341b8a719ea420c37a5ae8584300d12f3eefae
nyu-acsys/drift
array_init.ml
let mk_array n i = if 0<=i && i<n then 0 else -1 let update i a x j = if j=i then x else a(j) let rec init i n a = if i>=n then a else init (i+1) n (update i a 1) let main (n(*-:{v:Int|true}*)) (i(*-:{v:Int|true}*)) = let x = init 0 n (mk_array n) in if 0<=i && i<n then assert (x i >=1) (* check that the ...
null
https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/high/array_init.ml
ocaml
-:{v:Int|true} -:{v:Int|true} check that the array has been initialized
let mk_array n i = if 0<=i && i<n then 0 else -1 let update i a x j = if j=i then x else a(j) let rec init i n a = if i>=n then a else init (i+1) n (update i a 1) let x = init 0 n (mk_array n) in if 0<=i && i<n then else ()