_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
41ac892376c2f0f8d3acd7f97adbd890a515260e10327becd365cfd41c251b09
BekaValentine/SimpleFP-v2
Type.hs
{-# OPTIONS -Wall #-} # LANGUAGE DeriveFoldable # # LANGUAGE DeriveFunctor # # LANGUAGE FlexibleInstances # # LANGUAGE TypeFamilies # {-# LANGUAGE TypeSynonymInstances #-} -- | The types of the simply typed lambda calculus w/ non-parametric user defined types ( eg , ) . module Simple.Core.Type where import...
null
https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Simple/Core/Type.hs
haskell
# OPTIONS -Wall # # LANGUAGE TypeSynonymInstances # | The types of the simply typed lambda calculus w/ non-parametric user | Types can be type constructors, functions, or meta-variables. Variables are also not used in this setting, but we address them anyway. | Everything can be de-parenthesized everywhere, except ...
# LANGUAGE DeriveFoldable # # LANGUAGE DeriveFunctor # # LANGUAGE FlexibleInstances # # LANGUAGE TypeFamilies # defined types ( eg , ) . module Simple.Core.Type where import Utils.ABT import Utils.Pretty Meta - variable types are used for type checking with unification . data TypeF r = TyCon St...
273b41ff3ee38886f658a4846a0e14549de8d0c249fda9e56e48d26f8d2173e0
cl-stream/cl-stream
buffered-io-stream.lisp
;; ;; cl-stream - Stream classes for Common Lisp ;; ;; Copyright 2017,2018 Thomas de Grivel <> ;; ;; Permission to use, copy, modify, and distribute this software for any ;; purpose with or without fee is hereby granted, provided that the above ;; copyright notice and this permission notice appear in all copies....
null
https://raw.githubusercontent.com/cl-stream/cl-stream/8c4888591cd4ef9062c6c066326acef1415460f1/buffered-io-stream.lisp
lisp
cl-stream - Stream classes for Common Lisp Copyright 2017,2018 Thomas de Grivel <> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. WITH REGARD ...
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN (in-package :cl-stream) (defmethod stream-copy ((in buffered-input-stream) ...
fd9fea8c4876d985326c1a5e80c0dc831f762819f6f2b3bee943ad58c73b41bb
ryszard/clsql
time.lisp
-*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Base : 10 -*- ;;;; ************************************************************************* ;;;; $ Id$ ;;;; ;;;; A variety of structures and function for creating and ;;;; manipulating dates, times, durations and intervals for CLSQL . ;;;; ;;;; This file was orig...
null
https://raw.githubusercontent.com/ryszard/clsql/9aafcb72bd7ca1d7e908938b6a5319753b3371d9/sql/time.lisp
lisp
Syntax : ANSI - Common - Lisp ; Base : 10 -*- ************************************************************************* A variety of structures and function for creating and manipulating dates, times, durations and intervals for This file was originally part of ODCL and is Copyright (c) 2002 - (), also known ...
$ Id$ CLSQL . 2003 onShore Development , Inc. CLSQL users are granted the rights to distribute and use this software as governed by the terms of the Lisp Lesser GNU Public License (in-package #:clsql-sys) Months (defvar *month-keywords* '(:january :february :march :april :may :june :july :august :septe...
0c51355fdfce476d26b3e514139fe46702c471b801898b2ceaaf7901e039f21e
dvingo/dv.fulcro-template
db.clj
(ns {{namespace}}.task.db (:require [{{namespace}}.task.model :as task] [dv.xtdb-util :as xu] [taoensso.timbre :as log])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; DB API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn get-ta...
null
https://raw.githubusercontent.com/dvingo/dv.fulcro-template/8f76adad941422950a3d7340455561974853932b/resources/clj/new/dv.fulcro_template/src/main/app/task/db.clj
clojure
DB API
(ns {{namespace}}.task.db (:require [{{namespace}}.task.model :as task] [dv.xtdb-util :as xu] [taoensso.timbre :as log])) (defn get-task [xtdb-node id] (select-keys (xu/domain-entity xtdb-node id) task/db-task-keys)) (defn get-all-tasks [xtdb-node] (xu/q xtdb-node '[:find [(pull ?t [*])] :where [[?t ...
b2146eb11418bddde6a2ad735e0fc5cc59081af16180b1a98d6b802b386a3287
well-typed/optics
Optics.hs
-- | -- Module: Data.Sequence.Optics Description : Optics for working with ' Seq 's . -- This module defines optics for constructing and manipulating finite ' Seq 's . -- module Data.Sequence.Optics ( viewL, viewR , sliced, slicedTo, slicedFrom , seqOf ) where import Data.Sequence (Seq, ViewL (..), ViewR ...
null
https://raw.githubusercontent.com/well-typed/optics/7cc3f9c334cdf69feaf10f58b11d3dbe2f98812c/optics-core/src/Data/Sequence/Optics.hs
haskell
| Module: Data.Sequence.Optics * Sequence isomorphisms @'viewl' m ≡ m 'Optics.Operators.^.' 'viewL'@ >>> Seq.fromList [1,2,3] ^. viewL >>> Seq.empty ^. viewL >>> EmptyL ^. re viewL fromList [] fromList [1,2,3] | A 'Seq' is isomorphic to a 'ViewR' >>> Seq.fromList [1,2,3] ^. viewR fromList [1,2] :>...
Description : Optics for working with ' Seq 's . This module defines optics for constructing and manipulating finite ' Seq 's . module Data.Sequence.Optics ( viewL, viewR , sliced, slicedTo, slicedFrom , seqOf ) where import Data.Sequence (Seq, ViewL (..), ViewR (..), (><)) import qualified Data.Sequence a...
5fccf9a64e8e58c6fe3b54d4e4f7815bb05df591d541f8c50cd39c4f0be0c6c6
tschady/advent-of-code
d07.clj
(ns aoc.2021.d07 (:require [aoc.file-util :as f] [aoc.math-util :as m])) (def input (sort (f/read-ints "2021/d07.txt"))) ;; ^:blog Like many of these AOC problems , a HOF is a clean way to separate part-1 and ;; part-2 formulas. (defn ^:blog total-fuel "Returns the total fuel used by all the crabs ...
null
https://raw.githubusercontent.com/tschady/advent-of-code/eef58af6dfbbed0fec0275e09debd42a3c293374/src/aoc/2021/d07.clj
clojure
^:blog part-2 formulas. ^:blog ^:blog Then I found /[this beauty]
(ns aoc.2021.d07 (:require [aoc.file-util :as f] [aoc.math-util :as m])) (def input (sort (f/read-ints "2021/d07.txt"))) Like many of these AOC problems , a HOF is a clean way to separate part-1 and (defn ^:blog total-fuel "Returns the total fuel used by all the crabs at locations `locs` to reach p...
65898283bb57f0d0cac55b11bbe7e0e4a1d73d03363026cf5edb7727e817b275
hauleth/erlang-systemd
mock_supervisor.erl
-module(mock_supervisor). -behaviour(supervisor). -export([ start_link/1, init/1 ]). start_link(Children) -> supervisor:start_link(?MODULE, Children). init(Children) -> {ok, {#{strategy => one_for_one}, Children}}.
null
https://raw.githubusercontent.com/hauleth/erlang-systemd/9342d3654981044a3fcbf67fef7fc41cd855b946/test/mock_supervisor.erl
erlang
-module(mock_supervisor). -behaviour(supervisor). -export([ start_link/1, init/1 ]). start_link(Children) -> supervisor:start_link(?MODULE, Children). init(Children) -> {ok, {#{strategy => one_for_one}, Children}}.
b0309b6c264a408a66f3f3ca8cb31ecc4e9ccfc3df482228c685385b7ef3ae46
ocaml-batteries-team/batteries-included
batIO.ml
* BatIO - Abstract input / output * Copyright ( C ) 2003 * 2008 ( contributor ) * * 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 * ver...
null
https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/d471e24712dd1c0adb90db6894c1c721078b3934/src/batIO.ml
ocaml
* [close_at_end input e] returns an enumeration which behaves as [e] and has the secondary effect of closing [input] once everything has been read. ; flush out -:) negative number FIX HERE positive number * The number of chars to read at once Arbitrary size. next byte to read place to write new data...
* BatIO - Abstract input / output * Copyright ( C ) 2003 * 2008 ( contributor ) * * 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 * ver...
3c052346599b4f6fcc9396c6aa32e4c296ba25db01a0fdf9307103ffb89840f5
BumblebeeBat/FlyingFox
backup.erl
-module(backup). -export([hash/0, backup/0, backup_files/0, read/2, read_size/1, files/0]). files() -> [constants:blocks(), constants:block_pointers(), constants:accounts(), constants:all_secrets(), constants:d_accounts(), constants:channels(), constants:d_channels(), constants:entropy()]. backup_files() -> tl(tl(file...
null
https://raw.githubusercontent.com/BumblebeeBat/FlyingFox/0fa039cd2394b08b1a85559f9392086c6be47fa6/src/consensus/tree/backup.erl
erlang
-module(backup). -export([hash/0, backup/0, backup_files/0, read/2, read_size/1, files/0]). files() -> [constants:blocks(), constants:block_pointers(), constants:accounts(), constants:all_secrets(), constants:d_accounts(), constants:channels(), constants:d_channels(), constants:entropy()]. backup_files() -> tl(tl(file...
8d2dde90705cf2392a1a82b186e14aee4ca762cf8b8908b2b046cbfa679aba2e
jaoswald/cl-comfy-arm
arm-opcodes.lisp
-*- mode : Lisp ; Package : ( " ARM " " CL " ) ; Syntax : ANSI - Common - Lisp ; -*- ;;; ;;; arm-opcodes.lisp ;;; (cl:defpackage "ARM" (:use "CL") (:export "R0" "R1" "R2" "R3" "R4" "R5" "R6" "R7" "R8" "R9" "R10" "R11" "R12" "R13" "R14" "R15" "FP" ; alias for R11 "IP" ; alias for R12 "SP" ; alias f...
null
https://raw.githubusercontent.com/jaoswald/cl-comfy-arm/ffb0d743ba0703f09cc78ec0a1e06f25a031881e/arm-opcodes.lisp
lisp
Package : ( " ARM " " CL " ) ; Syntax : ANSI - Common - Lisp ; -*- arm-opcodes.lisp alias for R11 alias for R12 alias for R13 alias for R14 alias for R15 relative: have relative address in instruction word B: does not use link register note offset 0 is load/store rd [rn] etc. shift = 0, shift_imm =...
(cl:defpackage "ARM" (:use "CL") (:export "R0" "R1" "R2" "R3" "R4" "R5" "R6" "R7" "R8" "R9" "R10" "R11" "R12" "R13" "R14" "R15" "EQ" "NE" "CS" "HS" "CC" "LO" "MI" "PL" "VS" "VC" "HI" "LS" "GE" "LT" "GT" "LE" "AL" "S" "LSL" "LSR" "ASR" "ROR" "RRX" "#" "!" "^" "MVN" "MOV" "ORR" "CMN" "BIC" "C...
d3428d02c321d6adbb254acaff158379b35b1b2db69e231cbeef42215da28324
alpheccar/HPDF
Setup.hs
module Main where import Distribution.Simple( defaultMain ) main = defaultMain
null
https://raw.githubusercontent.com/alpheccar/HPDF/5a901376470b549b2354cdd8013e655f7ac19e0b/Setup.hs
haskell
module Main where import Distribution.Simple( defaultMain ) main = defaultMain
2d159a8ace0e7704f94d0f48851d9faee4794baa6b6bb7766cb0486d4b316a50
mzp/coq-ide-for-ios
nat_syntax.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/coq-8.2pl2/plugins/syntax/nat_syntax.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** i i ********************************...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $ I d : nat_syntax.ml 13323...
7e7d7c86dbc87c3137b5544f5b94372b978d0ad43e7a7e0683295fc91dfdf3cb
avsm/platform
svg_sigs.mli
TyXML * * Copyright ( C ) 2011 , * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of the License , or ( at you...
null
https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/tyxml.4.3.0/lib/svg_sigs.mli
ocaml
* SVG signatures for the functorial interface. * A complete SVG document. * A nullary element is an element that doesn't have any children. * Various information about SVG, such as the doctype, ... * {3 Uri} * @deprecated Use a_href * @deprecated Use CSS white-space * @deprecated Use a child title element XXX:...
TyXML * * Copyright ( C ) 2011 , * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , with linking exception ; * either version 2.1 of the License , or ( at you...
c1e5b0f9d3d4e7313f774cd9c96a8e4a811eb2d2ca230ac9d3e2a3208a244fbb
hhucn/decide3
server_main.clj
(ns decide.server-main (:require decide.server-components.http-server decide.server-components.nrepl decide.features.notifications.notifier [mount.core :as mount]) (:gen-class)) This is a separate file for the uberjar only . We control the server in dev mode from src / dev / user.clj (defn -main ...
null
https://raw.githubusercontent.com/hhucn/decide3/e27ea04033d94a0a61f8118a58050b86ed0f1327/src/main/decide/server_main.clj
clojure
(ns decide.server-main (:require decide.server-components.http-server decide.server-components.nrepl decide.features.notifications.notifier [mount.core :as mount]) (:gen-class)) This is a separate file for the uberjar only . We control the server in dev mode from src / dev / user.clj (defn -main ...
9cf31e4339476d3ae03422729953c9cdfa0ce3707df45ed480d02333843ee3f0
janestreet/base_quickcheck
bigarray_helpers.mli
open! Base (** Helpers for working with Bigarrays. These are not in [Base] because it's rare to work with bigarrays other than bigstring. We can move them into a separate library if there is demand. *) module Layout : sig type 'a t = 'a Bigarray.layout (** [offset t] is the index of the lowest-numbered ...
null
https://raw.githubusercontent.com/janestreet/base_quickcheck/b3dc5bda5084253f62362293977e451a6c4257de/src/bigarray_helpers.mli
ocaml
* Helpers for working with Bigarrays. These are not in [Base] because it's rare to work with bigarrays other than bigstring. We can move them into a separate library if there is demand. * [offset t] is the index of the lowest-numbered element. * The output matches the layout of the input.
open! Base module Layout : sig type 'a t = 'a Bigarray.layout val offset : _ t -> int end module Array1 : sig type ('elt, 'pack, 'layout) t = ('elt, 'pack, 'layout) Bigarray.Array1.t [@@deriving sexp_of] val init : ('elt, 'pack) Bigarray.kind -> 'layout Bigarray.layout -> int -> f:(int -...
ef59b993c47cb8bae845782afd9b1335df640048053fa8504b374220e7e079e8
lemmaandrew/CodingBatHaskell
sumHeights.hs
From We have an array of heights , representing the altitude along a walking trail . Given start / end indexes into the array , return the sum of the changes for a walk beginning at the start index and ending at the end index . For example , with the heights { 5 , 3 , 6 , 7 , 2 } and start=2 , end=4 yields a...
null
https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/AP-1/sumHeights.hs
haskell
From We have an array of heights , representing the altitude along a walking trail . Given start / end indexes into the array , return the sum of the changes for a walk beginning at the start index and ending at the end index . For example , with the heights { 5 , 3 , 6 , 7 , 2 } and start=2 , end=4 yields a...
205eecc1965443bda414c86116098d9e1befcb01d47ebf51c6035254728f76a7
stacksmith/cl-fm
package.lisp
package.lisp (defpackage #:cl-fm (:use :gtk :gdk :gdk-pixbuf :gobject :glib :gio :pango :cairo :cffi :eli :common-lisp :cl))
null
https://raw.githubusercontent.com/stacksmith/cl-fm/554a23251b129b9c554e7756302c266d63a60478/package.lisp
lisp
package.lisp (defpackage #:cl-fm (:use :gtk :gdk :gdk-pixbuf :gobject :glib :gio :pango :cairo :cffi :eli :common-lisp :cl))
0b501262e3743ac95ae63177cd0b37e5ba2d33d4c169e7f70ec7edc7842c4cb3
Bodigrim/smallcheck
Drivers.hs
-------------------------------------------------------------------- -- | Module : Test . SmallCheck . Drivers Copyright : ( c ) et al . -- License : BSD3 -- Maintainer: Roman Cheplyaka <> -- -- You should only need this module if you wish to create your own way to run SmallCheck tests -------------------...
null
https://raw.githubusercontent.com/Bodigrim/smallcheck/62ad0f7823dbe3d1589437b12b13084d437ae81e/Test/SmallCheck/Drivers.hs
haskell
------------------------------------------------------------------ | License : BSD3 Maintainer: Roman Cheplyaka <> You should only need this module if you wish to create your own way to ------------------------------------------------------------------ # LANGUAGE Safe # | A simple driver that runs the test in t...
Module : Test . SmallCheck . Drivers Copyright : ( c ) et al . run SmallCheck tests # LANGUAGE CPP # # LANGUAGE FlexibleContexts # #if __GLASGOW_HASKELL__ >= 704 #endif module Test.SmallCheck.Drivers ( smallCheck, smallCheckM, smallCheckWithHook, test, ppFailure, PropertyFailure(..), PropertySucce...
0b3556c9784f656e8a9845fef2eff65b0187c6af6685cd79cc484329b1007898
polyvios/locksmith
lockutil.ml
* * Copyright ( c ) 2004 - 2007 , * Polyvios Pratikakis < > * < > * < > * All rights reserved . * * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are * met : * * 1...
null
https://raw.githubusercontent.com/polyvios/locksmith/3a9d60ed9c801d65fbb79e9aa6e7dec68f6289e3/src/lockutil.ml
ocaml
*************************************************************************** find the function definition of variable "name" in file f Changes all call sites of function f_old, to rather call function f_new * instead. f_new and f_old must have the same signature.
* * Copyright ( c ) 2004 - 2007 , * Polyvios Pratikakis < > * < > * < > * All rights reserved . * * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are * met : * * 1...
de71735ce7c2ee4450616d1e5b478544ef15510418e2e7f45fdb34c44ac00f61
lasp-lang/lasp-bench
lasp_bench_config.erl
%% ------------------------------------------------------------------- %% %% lasp_bench: Benchmarking Suite %% Copyright ( c ) 2009 - 2010 Basho Techonologies %% 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 ...
null
https://raw.githubusercontent.com/lasp-lang/lasp-bench/d9b3e78d64ea4709ca10ec062c7fc969c1c503d4/src/lasp_bench_config.erl
erlang
------------------------------------------------------------------- lasp_bench: Benchmarking Suite 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 spec...
Copyright ( c ) 2009 - 2010 Basho Techonologies 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(lasp_bench_config). -be...
f5cc9484db1e102a5282de471b17f7603b42fde29d3be693e1d10086afad200f
informatimago/commands
hexbin.lisp
-*- mode : lisp ; coding : utf-8 -*- (defun main (arguments) (declare (ignore arguments)) (setf *read-base* 16.) (loop :with buffer = (make-array 8 :element-type '(unsigned-byte 8) :fill-pointer 0 :adjustable t) :for byte = (read *standard-input* nil nil) :while byte :do (vector-push-extend ...
null
https://raw.githubusercontent.com/informatimago/commands/65d0d6385269f3e210aed4943aefdbb5372706b9/sources/commands/hexbin.lisp
lisp
coding : utf-8 -*- THE END ;;;;
(defun main (arguments) (declare (ignore arguments)) (setf *read-base* 16.) (loop :with buffer = (make-array 8 :element-type '(unsigned-byte 8) :fill-pointer 0 :adjustable t) :for byte = (read *standard-input* nil nil) :while byte :do (vector-push-extend byte buffer (* 2 (length buffer))) ...
1b7bb8c8c9b6a838635ad223e6256e988ca939490fc54ed5b90f18bf31a58796
kafka4beam/brod
brod_producer_buffer_SUITE.erl
%%% Copyright ( c ) 2015 - 2021 Klarna Bank AB ( publ ) %%% 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...
null
https://raw.githubusercontent.com/kafka4beam/brod/cd089458aaa6f2d4fff9cc5235ef40cbb8d395b6/test/brod_producer_buffer_SUITE.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language g...
Copyright ( c ) 2015 - 2021 Klarna Bank AB ( publ ) Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @private -module(brod_producer_buffer_SUITE). -export([ init_per_suite/1 , end_per_suite/1 , init...
e2119a8e7ceab41cb2729818716cd9977b2ee6d6123463900fb3e788e686aa8c
GaloisInc/daedalus
Parser.hs
{-# Language TemplateHaskell #-} {-# Language ScopedTypeVariables #-} {-# Language DataKinds #-} # Language MultiParamTypeClasses # {-# Language OverloadedStrings #-} {-# Language KindSignatures #-} {-# Language TypeApplications #-} module Parser where import Data.Vector(Vector) import Data.ByteString(ByteString) impo...
null
https://raw.githubusercontent.com/GaloisInc/daedalus/e85a9cbf794e3b9207c974d6db9cc93d562b6fb3/formats/pdf/arlington-pdf-model/app/Parser.hs
haskell
# Language TemplateHaskell # # Language ScopedTypeVariables # # Language DataKinds # # Language OverloadedStrings # # Language KindSignatures # # Language TypeApplications #
# Language MultiParamTypeClasses # module Parser where import Data.Vector(Vector) import Data.ByteString(ByteString) import qualified Data.ByteString.Char8 as BS8 import Data.Map(Map) import Data.Text(Text) import System.FilePath(takeFileName, dropExtension) import Data.List(isPrefixOf,isSuffixOf) import Daedalus.RTS...
9812d5d7d29d492c36b6727af2e925ec67e1f8b929fb30719e91f19b3b3cb292
fluree/db
memory.cljc
(ns fluree.db.conn.memory (:require [clojure.core.async :as async :refer [go]] [fluree.db.storage.core :as storage] [fluree.db.index :as index] [fluree.db.util.core :as util] [fluree.db.util.log :as log :include-macros true] #?(:clj [fluree.db.full-text :as ...
null
https://raw.githubusercontent.com/fluree/db/6a7211bcd195cc718eb6eb9e415111013a39edaf/src/fluree/db/conn/memory.cljc
clojure
Memory Connection object default new ledger indexer TODO - push into state machine all root index nodes will be empty
(ns fluree.db.conn.memory (:require [clojure.core.async :as async :refer [go]] [fluree.db.storage.core :as storage] [fluree.db.index :as index] [fluree.db.util.core :as util] [fluree.db.util.log :as log :include-macros true] #?(:clj [fluree.db.full-text :as ...
8ec9cdaf97c270b9e4e4fb62d5ae3cfc4c989b8b62d60b365ea9ff2e49ef154e
input-output-hk/cardano-wallet
Demo.hs
-- | Demonstration of the light mode module Demo where import Control.Monad ( forM_ ) import Control.Monad.IO.Class ( MonadIO (..) ) import Data.List ( nub ) import Data.Set ( Set ) import Data.Text ( Text ) import Data.Time.Clock import Light.ReadBlocks import Light.Types import Say ( say, say...
null
https://raw.githubusercontent.com/input-output-hk/cardano-wallet/7b541e0b11fdd69b30d94104dbd5fa633ff1d5c3/prototypes/light-mode-test/src/Demo.hs
haskell
| Demonstration of the light mode ---------------------------------------------------------------------------- Main ----------------------------------------------------------------------------- | Run a 'BlockfrostClient' action using the hardcoded API token. | Test of the main 'discoverTransactions' function. l...
module Demo where import Control.Monad ( forM_ ) import Control.Monad.IO.Class ( MonadIO (..) ) import Data.List ( nub ) import Data.Set ( Set ) import Data.Text ( Text ) import Data.Time.Clock import Light.ReadBlocks import Light.Types import Say ( say, sayString ) import qualified Data.Set a...
998992cafee4829cb11b6b102aaf892e06803a0b8a08df653e32879f344837cc
hiroshi-unno/coar
arith_exp-e.ml
external nondet_bool : unit -> bool = "unknown" [@@@rtype "nondet_bool::unit -> bool"] external nondet_int : int -> int = "unknown" [@@@rtype "nondet_int::(x:int) -> {r:int | 0 <= r && r < x}"] type exp = Const of int | Add of exp * exp let rec eval e = match e with Const n -> n | Add(e1,e2) -> eval e1 +...
null
https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/benchmarks/OCaml/safety/tacas2015/arith_exp-e.ml
ocaml
external nondet_bool : unit -> bool = "unknown" [@@@rtype "nondet_bool::unit -> bool"] external nondet_int : int -> int = "unknown" [@@@rtype "nondet_int::(x:int) -> {r:int | 0 <= r && r < x}"] type exp = Const of int | Add of exp * exp let rec eval e = match e with Const n -> n | Add(e1,e2) -> eval e1 +...
9f440cbf4aa326c0402e2dad28cab184fd75621ddd403a911d929153cb5f5fca
wertercatt/mrifk
Mrifk_objects.hs
Mrifk , a decompiler for Glulx story files . Copyright 2004 . 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 2 of the License , or ( at your option ) any late...
null
https://raw.githubusercontent.com/wertercatt/mrifk/48687e5b6881cf41d4828cca2ec5dec1c5f4cad3/Mrifk_objects.hs
haskell
we already verified this is 0x70 when searching for the object table
Mrifk , a decompiler for Glulx story files . Copyright 2004 . 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 2 of the License , or ( at your option ) any late...
56bb0727ee7d2a2bcc7183210c02a5c2e5b76ef0a30e39f569175b39af30b937
facebook/infer
objcInterface_decl.ml
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/facebook/infer/432243b21f4990c3071ba0b3ee2a472a215be1c6/infer/src/clang/objcInterface_decl.ml
ocaml
* In this module an ObjC interface declaration or implementation is processed. The class * is saved in the tenv as a struct with the corresponding fields, potential superclass and * list of defined methods ObjectiveC doesn't have a notion of static or class fields. So, in this module we translate a class into a s...
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
a58e84dd227d4ab71b0eeec46adbe010553a17514b0687f78fa966e8971600e9
awalterschulze/the-little-typer-exercises
chapter5-4-sort-list.rkt
#lang pie Define a function called sort - which takes one ( List ) argument and evaluates to a ( List ) consisting of the elements from the list ;; argument sorted in ascending order. return 1 for less than and 0 for greater than (claim < (-> Nat Nat Nat)) (define < (lambda (x) (rec-Nat x (the ...
null
https://raw.githubusercontent.com/awalterschulze/the-little-typer-exercises/91cad6c6d5c1733562aa952d8ca515addb2b301d/chapter5-4-sort-list.rkt
racket
argument sorted in ascending order.
#lang pie Define a function called sort - which takes one ( List ) argument and evaluates to a ( List ) consisting of the elements from the list return 1 for less than and 0 for greater than (claim < (-> Nat Nat Nat)) (define < (lambda (x) (rec-Nat x (the (-> Nat Nat) (lambda (_) 1)) (lam...
57f82891765373d0fb4f46465988f8c6a878cc3c530791945fe3d05a0defa915
imandra-ai/ocaml-gcloud
stackdriver_errors.ml
module Scopes = struct let stackdriver_integration = "-integration" end [@@@warning "-39"] type service_context = { service : string ; version : string ; resource_type : string option [@key "resourceType"] [@default None] } [@@deriving yojson] type http_request_context = { method_ : string [@key "met...
null
https://raw.githubusercontent.com/imandra-ai/ocaml-gcloud/8d8b0f69d4b9099fef97804bdd84bed2b2bf7c51/src/stackdriver_errors.ml
ocaml
Must be non-empty if no stackdriver-parseable stack trace in report_request.message Must be set if no stackdriver-parseable stack trace in report_request.message
module Scopes = struct let stackdriver_integration = "-integration" end [@@@warning "-39"] type service_context = { service : string ; version : string ; resource_type : string option [@key "resourceType"] [@default None] } [@@deriving yojson] type http_request_context = { method_ : string [@key "met...
0c4c31d360c3e77b3109edc55413470560092516a299bfa438520b563cced6da
aconchillo/guile-oauth
client.scm
( oauth client ) --- Guile OAuth 1.0 implementation . Copyright ( C ) 2013 - 2022 Aleix Conchillo Flaque < > ;; ;; This file is part of guile-oauth. ;; ;; guile-oauth is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software...
null
https://raw.githubusercontent.com/aconchillo/guile-oauth/a40a1641fd9e29bf78ec1bbd32535894c6edb513/oauth/oauth1/client.scm
scheme
This file is part of guile-oauth. guile-oauth is free software: you can redistribute it and/or modify either version 3 of the License , or (at your option) any later version. guile-oauth is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA...
( oauth client ) --- Guile OAuth 1.0 implementation . Copyright ( C ) 2013 - 2022 Aleix Conchillo Flaque < > it under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License OAuth 1.0 module for (define-module (oauth oauth1 client) ...
7d9de36946fa94c57241d5892028f29701f311645da5df942ded879cf8c2e93e
hgoes/vvt
Realization.hs
# LANGUAGE TypeFamilies , MultiParamTypeClasses , FlexibleContexts , ScopedTypeVariables # module Realization where import Args import PartialArgs import Language.SMTLib2 import Language.SMTLib2.Internals.Embed import Language.SMTLib2.Internals.Monad (embedSMT) import qualified Language.SMTLib2.Internals.Backend as B...
null
https://raw.githubusercontent.com/hgoes/vvt/dd2809753d7e5059d9103ea578f36afa8294cd84/Realization.hs
haskell
renderPartialState :: t -> Partial (State t) -> String renderPartialInput :: t -> Partial (Input t) -> String | Returns a list of suggested predicates and a boolean indicating whether they are guaranteed to be unique ^ Dump collected states to a file?
# LANGUAGE TypeFamilies , MultiParamTypeClasses , FlexibleContexts , ScopedTypeVariables # module Realization where import Args import PartialArgs import Language.SMTLib2 import Language.SMTLib2.Internals.Embed import Language.SMTLib2.Internals.Monad (embedSMT) import qualified Language.SMTLib2.Internals.Backend as B...
042b36834bc7f20efee852d5cd600300bbc8fbe028075fef6b52e5bc930657f1
Kalimehtar/gtk-cffi
tree-model-filter.lisp
(in-package :gtk-cffi) (defclass tree-model-filter (g-object tree-model) ((model :accessor model :initarg :model))) (defcfun "gtk_tree_model_filter_new" :pointer (model pobject) (path pobject)) (defmethod gconstructor ((tree-model-filter tree-model-filter) &key model path &allow-other-keys...
null
https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gtk/tree-model-filter.lisp
lisp
(in-package :gtk-cffi) (defclass tree-model-filter (g-object tree-model) ((model :accessor model :initarg :model))) (defcfun "gtk_tree_model_filter_new" :pointer (model pobject) (path pobject)) (defmethod gconstructor ((tree-model-filter tree-model-filter) &key model path &allow-other-keys...
72c6c8d95fa4ec31e140acd7204143db2cdb25586f188ea8118d8aed4d864d40
earl-ducaine/cl-garnet
ps-multifont.lisp
-*- Mode : LISP ; Syntax : Common - Lisp ; Package : OPAL ; Base : 10 -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; The Garnet User Interface Development Environment . ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This code was written ...
null
https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/ps/ps-multifont.lisp
lisp
Syntax : Common - Lisp ; Package : OPAL ; Base : 10 -*- ; ; This code was written as part of the Garnet project at ;;; ; ; ; ; please contact to be put on the mailing list. ;;; This file contains functions for the multifont-text object used to Change Log: (format t "[0 0 0] ") Should we just ...
PS - Multifont generate PostScript files with the PS module . - text functions written by 08/20/93 - Added colors and marks to multifont text . 09/15/93 - Added printing of objects in multifont text 06/23/92 - Only print cursor when : visible is T 04/21/92 : ps - object message to 's cursor...
0441691c158240b419570b40ebdee4c4e204568311e6410870999193d471203b
pablomarx/Thomas
class.scm
* Copyright 1992 Digital Equipment Corporation ;* All Rights Reserved ;* ;* Permission to use, copy, and modify this software and its documentation is ;* hereby granted only under the following terms and conditions. Both the ;* above copyright notice and this permission notice mus...
null
https://raw.githubusercontent.com/pablomarx/Thomas/c8ab3f6fa92a9a39667fe37dfe060b651affb18e/src/class.scm
scheme
* All Rights Reserved * * Permission to use, copy, and modify this software and its documentation is * hereby granted only under the following terms and conditions. Both the * above copyright notice and this permission notice must appear in all copies * of the software, derivative works or modi...
* Copyright 1992 Digital Equipment Corporation * and hereby grant back to Digital a non - exclusive , unrestricted , royalty - free * their best efforts to return to Digital any such changes , enhancements or * extensions that they make and inform Digital of noteworthy uses of this * software . Correspo...
59d9d44bf6df3238f1b19149b3082c51f759851d11e97579317fa1b33ca547e4
RefactoringTools/HaRe
LayoutIn2.hs
module LayoutIn2 where --Layout rule applies after 'where','let','do' and 'of' --In this Example: rename 'list' to 'ls'. silly :: [Int] -> Int silly list = case list of (1:xs) -> 1 --There is a comment (2:xs) | x < 10 -> 4 where x = last xs ...
null
https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/Renaming/LayoutIn2.hs
haskell
Layout rule applies after 'where','let','do' and 'of' In this Example: rename 'list' to 'ls'. There is a comment
module LayoutIn2 where silly :: [Int] -> Int silly list = case list of (1:xs) -> 1 (2:xs) | x < 10 -> 4 where x = last xs otherwise -> 12
e6bff0d0ea30fb008774d2794fac0ee9bb2647cf2e3fdbc11bebc951dde82f76
billstclair/trubanc-lisp
stream.lisp
-*- Mode : LISP ; Syntax : COMMON - LISP ; Package : FLEXI - STREAMS ; Base : 10 -*- $ Header : /usr / local / cvsrep / flexi - streams / stream.lisp , v 1.61 2008/05/19 22:32:56 edi Exp $ Copyright ( c ) 2005 - 2008 , Dr. . All rights reserved . ;;; Redistribution and use in source and binary forms, with o...
null
https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/flexi-streams-1.0.7/stream.lisp
lisp
Syntax : COMMON - LISP ; Package : FLEXI - STREAMS ; Base : 10 -*- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions a...
$ Header : /usr / local / cvsrep / flexi - streams / stream.lisp , v 1.61 2008/05/19 22:32:56 edi Exp $ Copyright ( c ) 2005 - 2008 , Dr. . All rights reserved . DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , (in-p...
cfbd22a9e5254cb88dc7c24dc47abc46b702b8e51ed693297735bb811f9e2d01
scull7/bs-sql-common
SqlCommon_callback.ml
module type Queryable = SqlCommon_queryable.Queryable module Exn = SqlCommon_exn module Sql = SqlCommon_sql module Make (Driver: Queryable) = struct module Exn_response = Exn.Invalid.Response module Select = struct let raw db ?params ~sql cb = Driver.execute db sql params (fun res -> match res w...
null
https://raw.githubusercontent.com/scull7/bs-sql-common/803c82d7438e94a55c67951358ee2077521c9341/src/SqlCommon_callback.ml
ocaml
module type Queryable = SqlCommon_queryable.Queryable module Exn = SqlCommon_exn module Sql = SqlCommon_sql module Make (Driver: Queryable) = struct module Exn_response = Exn.Invalid.Response module Select = struct let raw db ?params ~sql cb = Driver.execute db sql params (fun res -> match res w...
895fbcc90d44fb3d3008d2823968f7373b8711fcc90c8171cb3421911e9797d4
vikram/lisplibraries
layout.lisp
(in-package :weblocks-demo-popover) (defun initial-page (k) "Initial page is so simple we can just define a function to render it and use it as a widget. Since it will be used in a continuation flow, it accepts K - the continuation parameter." (with-html (:div :style "text-align: center; margin-top: 25em;" ...
null
https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/contrib/yarek/examples/weblocks-demo-popover/src/layout.lisp
lisp
(in-package :weblocks-demo-popover) (defun initial-page (k) "Initial page is so simple we can just define a function to render it and use it as a widget. Since it will be used in a continuation flow, it accepts K - the continuation parameter." (with-html (:div :style "text-align: center; margin-top: 25em;" ...
50d863b5670d99a791427d2377d81fc73e3f05924f5dee3ea2857104836a2931
SVMBrown/bb-guestbook
server.clj
(ns server (:require [org.httpkit.server :as http] [clojure.core.match :refer [match]] [clojure.string :as str] [selmer.parser :as parser] [babashka.pods :as pods])) (pods/load-pod 'org.babashka/go-sqlite3 "0.0.1") (require '[pod.babashka.go-sqlite3 :as sqlite]) (def db "guestbook.db") (defn execute...
null
https://raw.githubusercontent.com/SVMBrown/bb-guestbook/648f378fcd9e2627b2f7cf16f48720f9d90b4881/src/server.clj
clojure
(ns server (:require [org.httpkit.server :as http] [clojure.core.match :refer [match]] [clojure.string :as str] [selmer.parser :as parser] [babashka.pods :as pods])) (pods/load-pod 'org.babashka/go-sqlite3 "0.0.1") (require '[pod.babashka.go-sqlite3 :as sqlite]) (def db "guestbook.db") (defn execute...
fa8cf4645b983ccc067fe6be52da1206711e63d5d241546cceceaadd2fcf718d
bgusach/exercises-htdp2e
ex-176.rkt
#lang htdp/bsl # # # Constants # # # Data Definitions # # # Functions ; Matrix -> Matrix Transpose the given matrix along the diagonal ; Sorry, it's too annoying to use (cons ...), and htpd/bsl seems to accept (list ...) (define wor1 (list 11 21)) (define wor2 (list 12 22)) (define tam1 (list wor1 wor2)) (d...
null
https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/ex-176.rkt
racket
Matrix -> Matrix Sorry, it's too annoying to use (cons ...), and htpd/bsl seems to accept (list ...) Matrix -> List-of-numbers Matrix -> Matrix
#lang htdp/bsl # # # Constants # # # Data Definitions # # # Functions Transpose the given matrix along the diagonal (define wor1 (list 11 21)) (define wor2 (list 12 22)) (define tam1 (list wor1 wor2)) (define mat1 (list (list 11 12) (list 21 22))) (check-expect (transpose mat1) tam1) (define mat2 (list (lis...
cbcf995a232837a7a60ef774e47830031af95795bc903e03df4910963a5b9398
manavpatnaik/haskell
21_number_status.hs
numberStatus :: Int -> String numberStatus a | a > 0 = "Positive" | a < 0 = "Negative" | otherwise = "0" main = do print(numberStatus 1) print(numberStatus (-1)) print(numberStatus 0)
null
https://raw.githubusercontent.com/manavpatnaik/haskell/af45c3eb5c3461aa77cf25610dfcb3b41c7f7ef9/practice-set-1-basics/21_number_status.hs
haskell
numberStatus :: Int -> String numberStatus a | a > 0 = "Positive" | a < 0 = "Negative" | otherwise = "0" main = do print(numberStatus 1) print(numberStatus (-1)) print(numberStatus 0)
a1d802daac024766e5fb92fc9e85b7a339e094ddd6cb0ab0b7a6fe81f94dff57
lambe-lang/nethra
hypothesis.mli
val render : ?_term_render:(Format.formatter -> 'a Nethra_lang_ast.Term.t -> unit) -> Format.formatter -> 'a Nethra_lang_ast.Hypothesis.t -> unit
null
https://raw.githubusercontent.com/lambe-lang/nethra/ba62c0e395e304c7f2b9ceb92495b81ccc141410/lib/nethra/lang/render/hypothesis.mli
ocaml
val render : ?_term_render:(Format.formatter -> 'a Nethra_lang_ast.Term.t -> unit) -> Format.formatter -> 'a Nethra_lang_ast.Hypothesis.t -> unit
933e570df0a4685636f3128b5dc61b50a751a06c5b329d9b7d492f0c7aca8f85
zotonic/zotonic
filter_nthtail.erl
@author < > 2010 %% @doc 'nthtail' filter, return nth tail of a list Copyright 2010 %% 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 require...
null
https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_base/src/filters/filter_nthtail.erl
erlang
@doc 'nthtail' filter, return nth tail of a list 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 th...
@author < > 2010 Copyright 2010 Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(filter_nthtail). -export([nthtail/3]). nthtail(In, N, Context) -> try L = z_template_compiler_runtime:to_li...
ca1210898f906ff0533321f874b9cf441de7e03dbb081437111773cc9e2c93e1
finnishtransportagency/harja
xml_skeemat.clj
(ns harja.palvelin.integraatiot.api.tyokalut.xml-skeemat) (def +sahkoposti-liite-kutsu+ "xsd/sahkoposti/sahkoposti-liite.xsd") (def +sahkoposti-kutsu+ "xsd/sahkoposti/sahkoposti.xsd") (def +sahkoposti-vastaus+ "xsd/sahkoposti/sahkoposti.xsd") (def +sampo-kutsu+ "xsd/sampo/inbound/Sampo2Harja.xsd") (def +sampo-vastaus+...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/37a496f4df7594d04f19601c30acf623186283af/src/clj/harja/palvelin/integraatiot/api/tyokalut/xml_skeemat.clj
clojure
(ns harja.palvelin.integraatiot.api.tyokalut.xml-skeemat) (def +sahkoposti-liite-kutsu+ "xsd/sahkoposti/sahkoposti-liite.xsd") (def +sahkoposti-kutsu+ "xsd/sahkoposti/sahkoposti.xsd") (def +sahkoposti-vastaus+ "xsd/sahkoposti/sahkoposti.xsd") (def +sampo-kutsu+ "xsd/sampo/inbound/Sampo2Harja.xsd") (def +sampo-vastaus+...
83f3b0d7e20bbc1587f73760f87b79d7fb3d4413da4040b7b1ac43510fbf30c7
objectionary/try-phi
TH.hs
{-# LANGUAGE DeriveDataTypeable #-} # LANGUAGE DuplicateRecordFields # # LANGUAGE GeneralizedNewtypeDeriving # module TH (newOptions, MyResponse (..), MyRequest (..), GraphTab (..), TabId (..), TextTabs (..), GetResponse (..)) where import Data.Aeson (Options (constructorTagModifier), defaultOptions) import Data.Aeso...
null
https://raw.githubusercontent.com/objectionary/try-phi/5ef371b5e3677fbd2ae5f8d2881216386fbea2fa/back/src/TH.hs
haskell
# LANGUAGE DeriveDataTypeable # CBN with graph
# LANGUAGE DuplicateRecordFields # # LANGUAGE GeneralizedNewtypeDeriving # module TH (newOptions, MyResponse (..), MyRequest (..), GraphTab (..), TabId (..), TextTabs (..), GetResponse (..)) where import Data.Aeson (Options (constructorTagModifier), defaultOptions) import Data.Aeson.Types import Data.Data (Data (toCo...
133a721741d4f8adf4ee0278c34a2d4d18c53f07a6241f1b5c1fb5c1f2db6fad
unclebob/spacewar
ship.cljc
(ns spacewar.game-logic.ship (:require [spacewar.geometry :as geo] [spacewar.vector :as vector] [spacewar.util :as util :refer [handle-event]] [spacewar.game-logic.config :as glc] [spacewar.game-logic.world :as world] [spacewar.game-logic.bases :as bases] [clojure.spec.alpha :as s])) (s/d...
null
https://raw.githubusercontent.com/unclebob/spacewar/45741b33d8a9e097129a168b1ddb6d7de1ec7264/src/spacewar/game_logic/ship.cljc
clojure
(ns spacewar.game-logic.ship (:require [spacewar.geometry :as geo] [spacewar.vector :as vector] [spacewar.util :as util :refer [handle-event]] [spacewar.game-logic.config :as glc] [spacewar.game-logic.world :as world] [spacewar.game-logic.bases :as bases] [clojure.spec.alpha :as s])) (s/d...
da5b405ebe693d50afdfde730fc943fcf4c6d2cb4ecb106b9990186897a68a46
choener/ADPfusion
Backtrack.hs
-- | Wrap forward tables in such a way as to allow backtracking via -- algebras. module ADPfusion.Core.SynVar.Backtrack where import Data.Vector.Fusion.Stream.Monadic (Stream) import ADPfusion.Core.SynVar.TableWrap -- | -- TODO this should go into @ADPfusion . Table . , more than just -- tabulated syntactic v...
null
https://raw.githubusercontent.com/choener/ADPfusion/fcbbf05d0f438883928077e3d8a7f1cbf8c2e58d/ADPfusion/Core/SynVar/Backtrack.hs
haskell
| Wrap forward tables in such a way as to allow backtracking via algebras. | tabulated syntactic vars are going to use it. @mB@ so as to be able to extract forward results in the backtracking phase.
module ADPfusion.Core.SynVar.Backtrack where import Data.Vector.Fusion.Stream.Monadic (Stream) import ADPfusion.Core.SynVar.TableWrap TODO this should go into @ADPfusion . Table . , more than just NOTE You probably need to give the @monad morphism@ between @mF@ and class GenBacktrackTable t (mF :: * -> *) ...
34a2578ce7e7947948065909f6c5a8a950add070ad19a69505800bb092816603
ocaml-ppx/ocamlformat
unit_extensions.ml
(** ocaml language extensions (-ocaml/manual021.html) *) (* other integer literals *) let i = 12l + 0l let i = 12L + 0l let i = 12n + 0n (* range patterns *) let f = function | 'a'..'z' -> e1 | 'A'..'Z' | '0'..'9' -> e2 (* local modules *) let f = let module M = F(st...
null
https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/3d1c992240f7d30bcb8151285274f44619dae197/test/failing/tests/unit_extensions.ml
ocaml
* ocaml language extensions (-ocaml/manual021.html) other integer literals range patterns local modules recursive modules private types local opens record shortcuts locally abstract types module type of signature substitution class overriding
let i = 12l + 0l let i = 12L + 0l let i = 12n + 0n let f = function | 'a'..'z' -> e1 | 'A'..'Z' | '0'..'9' -> e2 let f = let module M = F(struct end) in M.f x module rec M : S = struct ;; end and M1 : S1 = struct ;; end type t = private X of string | Y t...
9c1c1145ed577d97309ad6dad888f6473b198ecb61b37a519bdca333ed13e11b
Bodigrim/arithmoi
Pentagonal.hs
-- | Module : Math . . Recurrences . Pentagonal Copyright : ( c ) 2018 Licence : MIT Maintainer : < > -- -- Values of <(number_theory)#Partition_function partition function>. -- # LANGUAGE PostfixOperators # # LANGUAGE TypeApplications # module Math.NumberTheory.Recurrences.Pentagonal ...
null
https://raw.githubusercontent.com/Bodigrim/arithmoi/979f3a8f02de17ea7e52392320d3e81f16bb6d32/Math/NumberTheory/Recurrences/Pentagonal.hs
haskell
| Values of <(number_theory)#Partition_function partition function>. | Infinite list of generalized pentagonal numbers. Example: [0,1,2,5,7,12,15,22,26,35] and @p(k) = 0@ for a negative integer @k@. Uses a @Chimera@ from the @chimera@ package to memoize previous results. >>> :set -XDataKinds >>> import Da...
Module : Math . . Recurrences . Pentagonal Copyright : ( c ) 2018 Licence : MIT Maintainer : < > # LANGUAGE PostfixOperators # # LANGUAGE TypeApplications # module Math.NumberTheory.Recurrences.Pentagonal ( partition ) where import qualified Data.Chimera as Ch import Data.List.Inf...
5f87986fcc2d72a713077e54b81684cd4ad5452377629b35843878bd8c17163c
google/proto-lens
disc_test.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # module Main where import Data.Discrimination (Sort, runSort, sorting1) import Data.Int (Int32) import Data.List (sortBy) import Lens.Family2 (Lens', (&), (^.), (.~)) import Test.HUnit ((@=?), Assertion) import Test.Framework (testGroup, defaultMain) i...
null
https://raw.githubusercontent.com/google/proto-lens/d62a7aa67d47ded3ab2e4ba00226e9daff7ed1c5/proto-lens-discrimination/tests/disc_test.hs
haskell
# LANGUAGE OverloadedStrings # @x <? y $ c@ asserts that the 'Sort' c considers x to be less than y. Spot-check a few primitive types. Message fields. Entries for the same key are compared by their value. Data.Map has no Arbitrary instance.
# LANGUAGE ScopedTypeVariables # module Main where import Data.Discrimination (Sort, runSort, sorting1) import Data.Int (Int32) import Data.List (sortBy) import Lens.Family2 (Lens', (&), (^.), (.~)) import Test.HUnit ((@=?), Assertion) import Test.Framework (testGroup, defaultMain) import Test.Framework.Providers.API ...
f7c8d655327498634527959b82822163ccc0223d151eca514a004ffab1ab6c3d
henryw374/cljc.java-time
temporal_accessor.clj
(ns cljc.java-time.temporal.temporal-accessor (:refer-clojure :exclude [abs get range format min max next name resolve short]) (:require [cljc.java-time.extn.calendar-awareness]) (:import [java.time.temporal TemporalAccessor])) (clojure.core/defn get {:arglists (quote (["java.time.temporal.TemporalAccessor" "java.time....
null
https://raw.githubusercontent.com/henryw374/cljc.java-time/2e47e8104bc2ec7f68a01bf751a7b9a2dee391b4/src/cljc/java_time/temporal/temporal_accessor.clj
clojure
(ns cljc.java-time.temporal.temporal-accessor (:refer-clojure :exclude [abs get range format min max next name resolve short]) (:require [cljc.java-time.extn.calendar-awareness]) (:import [java.time.temporal TemporalAccessor])) (clojure.core/defn get {:arglists (quote (["java.time.temporal.TemporalAccessor" "java.time....
611b5cad9607f4569fcb4796e83c6cd4499c8a5c8d3ef478ebed26c3d3d8d502
spurious/snd-mirror
table.scm
(define (no-dashes-or-cr str) (do ((len (length str)) (newstr "") (last-ch #\-) (i 0 (+ i 1))) ((= i (- len 1)) newstr) (let ((ch (string-ref str i))) (if (and (or (not (char=? ch #\-)) (char-alphabetic? last-ch)) (not (char=? ch #\newline))) (set! newstr (...
null
https://raw.githubusercontent.com/spurious/snd-mirror/8e7a643c840592797c29384ffe07c87ba5c0a3eb/tools/table.scm
scheme
(define (no-dashes-or-cr str) (do ((len (length str)) (newstr "") (last-ch #\-) (i 0 (+ i 1))) ((= i (- len 1)) newstr) (let ((ch (string-ref str i))) (if (and (or (not (char=? ch #\-)) (char-alphabetic? last-ch)) (not (char=? ch #\newline))) (set! newstr (...
282bcf059b72890befa0613c737e8aa136dc34b33a9f9607790bdb608a6e31f1
dumbs/2010-m1s1-compilation
test.lisp
ls (load "main") (run-tests)
null
https://raw.githubusercontent.com/dumbs/2010-m1s1-compilation/1aa5c903587d977f1fe0b680c60d09934b72b4e5/lisp/test.lisp
lisp
ls (load "main") (run-tests)
226c48557946c9d9f6f45036acbba19f9898ba9ee96757678511ebad8d19a336
cse-bristol/110-thermos-ui
config.clj
This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021 Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details . (ns thermos-backend.config (:require [clojure.edn :as edn] [clojure.java.io :as io] [clojure.string :as str] ...
null
https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/src/thermos_backend/config.clj
clojure
This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021 Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details . (ns thermos-backend.config (:require [clojure.edn :as edn] [clojure.java.io :as io] [clojure.string :as str] ...
75e917cb9f579114f854f0c7ce6ee52edcc7dc4aa8aa8b74b95ba00286991207
themetaschemer/malt
D-extend.rkt
#lang racket (require "B-tensor-basics.ss") (require "C-tensor-ops.ss") ;;—————————————————–—————————————————–—————————————————– Unary Pointwise extension ;;—————————————————–—————————————————–—————————————————– (define ext1 (λ (f n) (λ (t) (cond ((of-rank? n t) (f t)) (else (tmap (ext1...
null
https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/learner/tensors/D-extend.rkt
racket
—————————————————–—————————————————–—————————————————– —————————————————–—————————————————–—————————————————– —————————————————–—————————————————–—————————————————– Binary Pointwise extension —————————————————–—————————————————–—————————————————– Slight variation from the book, to add error checking
#lang racket (require "B-tensor-basics.ss") (require "C-tensor-ops.ss") Unary Pointwise extension (define ext1 (λ (f n) (λ (t) (cond ((of-rank? n t) (f t)) (else (tmap (ext1 f n) t)))))) (define ext2 (λ (f n m) (λ (t u) (cond ((of-ranks? n t m u) (f t u)) (...
5d0141d2f4acc5e66eec88d00821444259fee9155f4b0fa5970aa7eee8d7e3df
theleoborges/imminent
future.clj
(ns imminent.future (:refer-clojure :exclude [map filter future future-call promise sequence reduce await]) (:require [clojure.core :as clj] [imminent.protocols :refer :all] [imminent.util.monad :as m] [imminent.util.functor :as f] [imminent.executors :as executors...
null
https://raw.githubusercontent.com/theleoborges/imminent/9429072dc2b46d2e23cb64992e40faa682c7eb47/src/imminent/future.clj
clojure
Future utility functions Convenience aliases of monadic combinators
(ns imminent.future (:refer-clojure :exclude [map filter future future-call promise sequence reduce await]) (:require [clojure.core :as clj] [imminent.protocols :refer :all] [imminent.util.monad :as m] [imminent.util.functor :as f] [imminent.executors :as executors...
fd74bff9ecee1b3822f01e9edc0670129b0c1900bbce49bfca5bffddcb264394
WorksHub/client
tag.cljc
(ns wh.graphql.tag (:require [wh.graphql-cache :as cache :refer [reg-query]]) (#?(:clj :require :cljs :require-macros) [wh.graphql-macros :refer [deffragment defquery def-query-template def-query-from-template]])) (defquery create-tag-mutation {:venia/operation {:operation/type :mutation ...
null
https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/common/src/wh/graphql/tag.cljc
clojure
(ns wh.graphql.tag (:require [wh.graphql-cache :as cache :refer [reg-query]]) (#?(:clj :require :cljs :require-macros) [wh.graphql-macros :refer [deffragment defquery def-query-template def-query-from-template]])) (defquery create-tag-mutation {:venia/operation {:operation/type :mutation ...
554a468ec9ebafbbb9d0819d0db5443a9217a857a939160f020639a10d4bb7aa
bobeff/playground
019.rkt
Exercise 19 . Define the function string - insert , which consumes a string str ; plus a number i and inserts "_" at the ith position of str. Assume i is a ; number between 0 and the length of the given string (inclusive). #lang racket (require rackunit) (define (string-insert str i) (string-append (substring st...
null
https://raw.githubusercontent.com/bobeff/playground/7072dbd7e0acd690749abe1498dd5f247cc21637/htdp-second-edition/exercises/019.rkt
racket
plus a number i and inserts "_" at the ith position of str. Assume i is a number between 0 and the length of the given string (inclusive).
Exercise 19 . Define the function string - insert , which consumes a string str #lang racket (require rackunit) (define (string-insert str i) (string-append (substring str 0 i) "_" (substring str i (string-length str)))) (check-equal? (string-insert "HelloWorld" 5) "Hello_World") (check-equal? (string-insert "H...
e79d3ff0b213382e4cdb19109bc45f2900ad9485cf9f9b5bf880e8e5db38256c
reborg/clojure-essential-reference
2.clj
< 1 > #object["java.io.OutputStreamWriter@36dfbdaf"] < 2 > hello ; <3> < 4 > user=>
null
https://raw.githubusercontent.com/reborg/clojure-essential-reference/9a3eb82024c8e5fbe17412af541c2cd30820c92e/DynamicVariablesintheStandardLibrary/*in*%2C*out*and*err*/2.clj
clojure
<3>
< 1 > #object["java.io.OutputStreamWriter@36dfbdaf"] < 2 > < 4 > user=>
ef8a7e7a4e740a0067ea123a72416f5d6ee50e21c48c3e31b9eb7a6f1deb3c74
transient-haskell/transient-stack
EVars.hs
{-# LANGUAGE DeriveDataTypeable #-} module Transient.EVars where import Transient.Internals import Data.Typeable import Control.Applicative import Control.Concurrent.STM import Control.Monad.State data EVar a= EVar (TChan (StreamData a)) deriving Typeable | creates an EVar . -- Evars are event vars . ` w...
null
https://raw.githubusercontent.com/transient-haskell/transient-stack/dde6f6613a946d57bb70879a5c0e7e5a73a91dbe/transient/src/Transient/EVars.hs
haskell
# LANGUAGE DeriveDataTypeable # (the code that is after them). It is like the publish-subscribe pattern but without inversion of control, since a readEVar can be inserted at any place in the Transient flow. Now the continuations are executed in parallel. see -subscribe-variables-transient-effects-v | delet...
module Transient.EVars where import Transient.Internals import Data.Typeable import Control.Applicative import Control.Concurrent.STM import Control.Monad.State data EVar a= EVar (TChan (StreamData a)) deriving Typeable | creates an EVar . Evars are event vars . ` writeEVar ` trigger the execution of all...
de8593992c265a81a9ea9fad98213dcc8fcf453c1e8089a0e9ac96b2689d1050
2600hz-archive/whistle
hangups_deps.erl
@author < > ( C ) 2010 - 2011 , VoIP INC %%% @doc Ensure that the relatively-installed dependencies are on the code %%% loading path, and locate resources relative %%% to this application's path. %%% %%% @end Created : 8 Nov 2010 by < > -module(hangups_deps). -author('author <>'). -export([en...
null
https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/whistle_apps/apps/hangups/src/hangups_deps.erl
erlang
@doc Ensure that the relatively-installed dependencies are on the code loading path, and locate resources relative to this application's path. @end @doc List of project dependencies on the path. @doc Find new siblings paths relative to Module that aren't already on the code path. @doc Ensure tha...
@author < > ( C ) 2010 - 2011 , VoIP INC Created : 8 Nov 2010 by < > -module(hangups_deps). -author('author <>'). -export([ensure/0, ensure/1]). -export([get_base_dir/0, get_base_dir/1]). -export([local_path/1, local_path/2]). -export([deps_on_path/0, new_siblings/1]). ( ) - > [ ProjNameAndVers ] ...
ba4f742a43cafd5b82ba22c9b1a00c703ebdf8f937768b2d53c5430f5c5b2b13
racket/racket7
wrap-modbeg.rkt
A # % module - begin that wraps each module - level expression with ;; given form: (module modbeg '#%kernel (#%require (for-syntax '#%kernel)) (#%provide (for-syntax make-wrapping-module-begin)) (begin-for-syntax (define-values (make-wrapping-module-begin) (case-lambda [(wrapper) (make-wrappi...
null
https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/syntax/wrap-modbeg.rkt
racket
given form: `begin' is special... splice `begin' no need to splice Also check for calls to `void':
A # % module - begin that wraps each module - level expression with (module modbeg '#%kernel (#%require (for-syntax '#%kernel)) (#%provide (for-syntax make-wrapping-module-begin)) (begin-for-syntax (define-values (make-wrapping-module-begin) (case-lambda [(wrapper) (make-wrapping-module-begin ...
13bd0b070f6c1349467806e0214aaf86b3421a01f873245e6dcb380da0e41de9
cram2/cram
rayleigh.lisp
Rayleigh distribution , Sat Sep 30 2006 Time - stamp : < 2010 - 01 - 17 10:31:48EST rayleigh.lisp > ;; Copyright 2006 , 2007 , 2008 , 2009 Distributed under the terms of the GNU General Public License ;; ;; This program is free software: you can redistribute it and/or modify it under the terms of the G...
null
https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/random/rayleigh.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 Publi...
Rayleigh distribution , Sat Sep 30 2006 Time - stamp : < 2010 - 01 - 17 10:31:48EST rayleigh.lisp > Copyright 2006 , 2007 , 2008 , 2009 Distributed under the terms of the GNU General Public License it under the terms of the GNU General Public License as published by the Free Software Foundation , eit...
604e0ecab4c058c584b1c3be09acaeacc8d63cda8d9c752792ca579646f67c00
LightAndLight/closure
LL.hs
{-# language FlexibleContexts #-} {-# language TupleSections #-} module LL ( Ty(..), ANF.LocalName(..), FunName(..) , AExpL(..), CExpL(..), Decl(..), Prog(..) , lambdaLift ) where import Control.Monad.Writer (MonadWriter, runWriterT, tell) import Control.Monad.State (MonadState, evalState, get, put) import Dat...
null
https://raw.githubusercontent.com/LightAndLight/closure/fc7545d7764d9f1b63f65bbe4d2a2ace35eeaba2/src/LL.hs
haskell
# language FlexibleContexts # # language TupleSections # | and a formal parameter
module LL ( Ty(..), ANF.LocalName(..), FunName(..) , AExpL(..), CExpL(..), Decl(..), Prog(..) , lambdaLift ) where import Control.Monad.Writer (MonadWriter, runWriterT, tell) import Control.Monad.State (MonadState, evalState, get, put) import Data.Word (Word32) import Closure (Ty(..)) import qualified ANF da...
6c0df2d5e1f5824cab3abf0b03e368e1c41bce1ed66e9a21949554a2877edb28
atlas-engineer/ndebug
stream.lisp
SPDX - FileCopyrightText : Atlas Engineer LLC SPDX - License - Identifier : BSD-3 - Clause (in-package #:ndebug) (defclass debugger-input-stream (trivial-gray-streams:fundamental-character-input-stream) ((input-fn :initarg :input-fn :accessor input-fn :documentation "The one-shot funct...
null
https://raw.githubusercontent.com/atlas-engineer/ndebug/cb3e9af61a5a7755d879db7ddd95cee78470c2a9/stream.lisp
lisp
SPDX - FileCopyrightText : Atlas Engineer LLC SPDX - License - Identifier : BSD-3 - Clause (in-package #:ndebug) (defclass debugger-input-stream (trivial-gray-streams:fundamental-character-input-stream) ((input-fn :initarg :input-fn :accessor input-fn :documentation "The one-shot funct...
846e8798f469c4d80430bb45c52dc8ee97ed17356e9112c3ff2e24f2d634d289
mpickering/ghcide-reflex
Outline.hs
# LANGUAGE CPP # # LANGUAGE DuplicateRecordFields # # LANGUAGE PartialTypeSignatures # # LANGUAGE FlexibleContexts # {-# LANGUAGE GADTs #-} #include "ghc-api-version.h" module Development.IDE.LSP.Outline ( outlineRule ) where import qualified Language.Haskell.LSP.Core as LSP import Language.Haskell....
null
https://raw.githubusercontent.com/mpickering/ghcide-reflex/67ddebf0c1d4728e850057b9bd7c6852c0d96350/src/Development/IDE/LSP/Outline.hs
haskell
# LANGUAGE GADTs # _ltop is 0 0 0 0 | Wrap the Document imports into a hierarchical outline for a better overview of symbols in scope. If there are no imports, then no hierarchy will be created. safe because if we have no ranges then we don't take this branch
# LANGUAGE CPP # # LANGUAGE DuplicateRecordFields # # LANGUAGE PartialTypeSignatures # # LANGUAGE FlexibleContexts # #include "ghc-api-version.h" module Development.IDE.LSP.Outline ( outlineRule ) where import qualified Language.Haskell.LSP.Core as LSP import Language.Haskell.LSP.Messages import ...
adb221f6440c60cca4d0eabbdd6589dafe4c410996caa2ddb12d1a7a68c24a90
cabol/erlbus
ebus_handler_SUITE.erl
-module(ebus_handler_SUITE). %% Common Test -export([ all/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2 ]). %% Tests -export([t_handler/1, t_callback_handler/1]). %% Others -export([my_callback/2]). -define(TAB, ebus_test). %%%==============================================...
null
https://raw.githubusercontent.com/cabol/erlbus/050cb728ef09a0ad51c9297281602e362b5e233d/test/ebus_handler_SUITE.erl
erlang
Common Test Tests Others =================================================================== Common Test =================================================================== =================================================================== Exported Tests Functions =================================================...
-module(ebus_handler_SUITE). -export([ all/0, init_per_suite/1, end_per_suite/1, init_per_testcase/2, end_per_testcase/2 ]). -export([t_handler/1, t_callback_handler/1]). -export([my_callback/2]). -define(TAB, ebus_test). all() -> [t_handler, t_callback_handler]. init_per_suite(Config) -> ebus:start(...
76247ad1a49a9188274322525602f462fd478ba06d1cf2cd84c45bb6fa42f061
vinted/kafka-elasticsearch-tool
impact_test.clj
(ns replay.impact-test (:require [clojure.test :refer [deftest is testing]] [replay.impact :as impact])) (deftest url-transformations (let [uri "/index-name/_search?preference=7c5fe2d7-d313-4362-a62f-4c1e10e999fd"] (is (= "/_search" (impact/prepare-endpoint uri)))) (testing "msearch case" (le...
null
https://raw.githubusercontent.com/vinted/kafka-elasticsearch-tool/fc84164b8d9ee97da01aed4ab21a3cd1ae6b10ec/test/replay/impact_test.clj
clojure
(ns replay.impact-test (:require [clojure.test :refer [deftest is testing]] [replay.impact :as impact])) (deftest url-transformations (let [uri "/index-name/_search?preference=7c5fe2d7-d313-4362-a62f-4c1e10e999fd"] (is (= "/_search" (impact/prepare-endpoint uri)))) (testing "msearch case" (le...
68f5c314562f8cc63509e8df0bd346485f7a88f2eef8ad1dfd853f36116a7fe4
clojure-emacs/sayid
shelf.clj
(ns com.billpiel.sayid.shelf (:require [com.billpiel.sayid.util.other :as util])) (defn save! [item shelf slot-kw mk-ex-msg-fn] (let [item' @item slot (slot-kw item')] (if (symbol? slot) (util/def-ns-var shelf slot item') (throw (Exception. (mk-ex-msg-fn slot)))...
null
https://raw.githubusercontent.com/clojure-emacs/sayid/27f35778de9509067716a7bed14306787334a589/src/com/billpiel/sayid/shelf.clj
clojure
(ns com.billpiel.sayid.shelf (:require [com.billpiel.sayid.util.other :as util])) (defn save! [item shelf slot-kw mk-ex-msg-fn] (let [item' @item slot (slot-kw item')] (if (symbol? slot) (util/def-ns-var shelf slot item') (throw (Exception. (mk-ex-msg-fn slot)))...
1aa2e668563812a10adfc2ffc4bbc02833d3872c7a13a530e055281173bb88c8
incanter/incanter
svg_tests.clj
(ns incanter-svg.svg-tests (:use [incanter.svg]) (:use [clojure.test]))
null
https://raw.githubusercontent.com/incanter/incanter/e0a03aac237fcc60587278a36bd2e76266fc6356/modules/incanter-svg/test/incanter_svg/svg_tests.clj
clojure
(ns incanter-svg.svg-tests (:use [incanter.svg]) (:use [clojure.test]))
35354064b01fee8008ee8ad197fc49b8e3d0e61cc10aed299ca95a995464d464
zwizwa/erl_tools
task_queue.erl
-module(task_queue). -export([handle/2]). %% A mixin task queue for serializing operations. This does not need initialization . It will use the key ' task_queue ' in the State %% dictionary. %% About mixins: sometimes it is easier to just compose handler %% functions that keep some state in the main process dict...
null
https://raw.githubusercontent.com/zwizwa/erl_tools/07645992e968c1456c9d0212f380afd1ffce4c1f/src/task_queue.erl
erlang
A mixin task queue for serializing operations. This does not need dictionary. About mixins: sometimes it is easier to just compose handler functions that keep some state in the main process dictionary, as opposed to using separate objects with message protocol and process management. Use the sequential nature o...
-module(task_queue). -export([handle/2]). initialization . It will use the key ' task_queue ' in the State This was originally written to make : need/1 sequential , as handle({_Pid, {task, _Task}}=PT, State) -> Hub = self(), Queue = maps:get(task_queue, State, []), case Queue of [] -> ...
2102c45e4e2a330017d62bdc4b0d12063209ad90bd21b7148fb1095ab866585c
ndpar/erlang
life.erl
-module(life). -export([neighbours/1, next_step/1]). neighbours({X, Y}) -> [{X + DX, Y + DY} || DX <- [-1, 0, 1], DY <- [-1, 0, 1], {DX, DY} =/= {0, 0}]. next_step(Cells) -> Nbs = lists:flatmap(fun neighbours/1, sets:to_list(Cells)), NewCells = [C || {C, N} <- maps:to_list(core:frequencies(Nbs)), ...
null
https://raw.githubusercontent.com/ndpar/erlang/e215841a1d370e0fc5eb6b9ff40ea7ae78fc8763/src/life.erl
erlang
Unit tests
-module(life). -export([neighbours/1, next_step/1]). neighbours({X, Y}) -> [{X + DX, Y + DY} || DX <- [-1, 0, 1], DY <- [-1, 0, 1], {DX, DY} =/= {0, 0}]. next_step(Cells) -> Nbs = lists:flatmap(fun neighbours/1, sets:to_list(Cells)), NewCells = [C || {C, N} <- maps:to_list(core:frequencies(Nbs)), ...
569551ff4968eec021e0091fb256ca8e54af055327e7572a899b556e10184de2
chenyukang/eopl
type-structures.scm
(define-datatype type-environment type-environment? (empty-tenv) (extend-tenv (bvar symbol?) (bval type?) (saved-tenv type-environment?)) (extend-tenv-with-module (name symbol?) (interface interface?) (saved-tenv type-environment?)) (extend-tenv-with-type (t-name symbol?) (t-type type?)...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch8/base/type-structures.scm
scheme
invariant: this must always be expanded procedures for looking things up tenvs ;;;;;;;;;;;;;;;; lookup or die this is not right, because it doesn't distinguish between type and variable declarations. Exercise: fix this so that it raises an error if t-name is declared in a val-decl. this is not right, because it...
(define-datatype type-environment type-environment? (empty-tenv) (extend-tenv (bvar symbol?) (bval type?) (saved-tenv type-environment?)) (extend-tenv-with-module (name symbol?) (interface interface?) (saved-tenv type-environment?)) (extend-tenv-with-type (t-name symbol?) (saved-tenv ty...
7ebc9e795960f47053d96ed45b56269e69a94a947250e4af863d78b4c81ca689
NalaGinrut/guile-lua-rebirth
compile-tree-il.scm
;; Copyright (C) 2013,2014,2016,2017,2018 " Mu Lei " known as " NalaGinrut " < > ;; This file 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/NalaGinrut/guile-lua-rebirth/ca52e0f481d3b1702810b822c7d316b18456d13e/language/lua/compile-tree-il.scm
scheme
Copyright (C) 2013,2014,2016,2017,2018 This file is free software: you can redistribute it and/or modify (at your option) any later version. This file 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...
" Mu Lei " known as " NalaGinrut " < > 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 (define-module (language lua compile-tree-il) #:use-modu...
f8ee664dfa414608f2b85c6d23014ec2882b33b41f54760cea40367ccf540e4b
cirodrig/triolet
Identifier.hs
# LANGUAGE TemplateHaskell # # OPTIONS_GHC -no - auto # module Common.Identifier (Ident, Idents, IdentSupply, toIdent, fromIdent, newIdentSupply, newIdentSupplyAfter ) where import Control.DeepSeq import Data.Ix import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH.Syntax ...
null
https://raw.githubusercontent.com/cirodrig/triolet/e515a1dc0d6b3e546320eac7b71fb36cea5b53d0/src/program/Common/Identifier.hs
haskell
| An identifier is an integer that is used as a unique \"name\" for an | Start enumerating identifiers from 0 | Start enumerating identifiers after the given identifier
# LANGUAGE TemplateHaskell # # OPTIONS_GHC -no - auto # module Common.Identifier (Ident, Idents, IdentSupply, toIdent, fromIdent, newIdentSupply, newIdentSupplyAfter ) where import Control.DeepSeq import Data.Ix import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH.Syntax ...
523ba5f46407f1014a6b7d1fb21f917eba79be9c0ec63760bf97a46109243748
ipfs-shipyard/cube
cluster_test.clj
(ns cube.cluster-test (:require [cube.cluster :as cluster] [clojure.spec.alpha :as s]) (:use clojure.test)) (def example-res '({:cid "QmAUeoxg6D9fYnfwXrVmVmkTm4QhTDTjyoE6ZfKtdGFSLm", :peer_map {:QmBbwt9jwWg4q7YMLkG7De2B9MaE7iYZjvV1eWJs4byEvK ...
null
https://raw.githubusercontent.com/ipfs-shipyard/cube/bd835a35a5273c744cbc415425ffbdb0990901e6/test/cube/cluster_test.clj
clojure
Makes sure that whatever way the response is from ipfs-cluster, we make it into the same order
(ns cube.cluster-test (:require [cube.cluster :as cluster] [clojure.spec.alpha :as s]) (:use clojure.test)) (def example-res '({:cid "QmAUeoxg6D9fYnfwXrVmVmkTm4QhTDTjyoE6ZfKtdGFSLm", :peer_map {:QmBbwt9jwWg4q7YMLkG7De2B9MaE7iYZjvV1eWJs4byEvK ...
45f7147bf31ea2b26e6e05c403a9a70aea5f55b2c3101d60619a53850b6e264e
hstreamdb/hstream
stats.hs
{-# LANGUAGE BangPatterns #-} module Main where import Control.Monad import Criterion.Main import Data.IORef import HStream.Stats import HStream.Utils (runConc) -- | To run the benchmark: -- -- > cabal run -- common-bench-stats --output bench.html --regress allocat...
null
https://raw.githubusercontent.com/hstreamdb/hstream/2d57ea42fdba2af19330e1ba06ef30235f5e6a6f/common/stats/bench/stats.hs
haskell
# LANGUAGE BangPatterns # | To run the benchmark: > cabal run -- common-bench-stats --output bench.html --regress allocated:iters --regress numGcs:iters +RTS -T
module Main where import Control.Monad import Criterion.Main import Data.IORef import HStream.Stats import HStream.Utils (runConc) main :: IO () main = defaultMain [ bgroup "counter" [ bench "IORef" $ nfIO (runIORef 100000) , bench "Sta...
804a30c03ff5d26dc2c7d634d3fb5ff8bcc15236e40972b55cfb7b8c1080d43e
dongcarl/guix
android.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2012 < > Copyright © 2015 Kai - Chung Yan < > Copyright © 2016 , 2020 < > Copyright © 2017 < > Copyright © 2017 < > Copyright © 2017 < > Copyright © 2018 , 2019 , 2020 < > Copyright © 2018 < > Copyright © 2019 ,...
null
https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/packages/android.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2012 < > Copyright © 2015 Kai - Chung Yan < > Copyright © 2016 , 2020 < > Copyright © 2017 < > Copyright © 2017 < > Copyright © 2017 < > Copyright © 2018 , 2019 , 2020 < > Copyright © 2018 < > Copyright © 2019 , 2020 < > Copyright © 2019 < > Copyright © 20...
55f96d6cf2993ddab63d02a41a07bf7282960eababd8fbec434d87a95f1631e6
clj-commons/cljss
perf.cljs
(ns example.perf (:require-macros [cljss.core]) (:require [cljss.core :as css :refer-macros [defstyles]] [rum.core :as rum] [goog.dom :as gdom])) (defstyles button [font-size] {:color "#fff" :background-color "rgb(0, 0, 255)" :border-radius "5px" :padding "...
null
https://raw.githubusercontent.com/clj-commons/cljss/d2856688cf650babe518c798cf20e6bdb4227bb7/example/src/example/perf.cljs
clojure
(ns example.perf (:require-macros [cljss.core]) (:require [cljss.core :as css :refer-macros [defstyles]] [rum.core :as rum] [goog.dom :as gdom])) (defstyles button [font-size] {:color "#fff" :background-color "rgb(0, 0, 255)" :border-radius "5px" :padding "...
6555f174bd9d2c18d9569e4e6698a952a4c9af87433eb038f8660867b16db574
mentat-collective/emmy
bianchi_test.cljc
#_"SPDX-License-Identifier: GPL-3.0" (ns emmy.fdg.bianchi-test (:refer-clojure :exclude [+ - * /]) (:require [clojure.test :refer [is deftest testing use-fixtures]] [emmy.env :as e :refer [+ -]] [emmy.simplify :refer [hermetic-simplify-fixture]] [emmy.value :as v])) (use-fixtur...
null
https://raw.githubusercontent.com/mentat-collective/emmy/535b237a8e3fd7067b9c0ade8b2a4b3419f9f132/test/emmy/fdg/bianchi_test.cljc
clojure
Feel free to run these with different coordinate systems! The chart below With a (torsion-free) symmetric connection: +----------+--------------+--------------+ +----------+--------------+--------------+ +----------+--------------+--------------+ +----------+--------------+--------------+ +----------+--------...
#_"SPDX-License-Identifier: GPL-3.0" (ns emmy.fdg.bianchi-test (:refer-clojure :exclude [+ - * /]) (:require [clojure.test :refer [is deftest testing use-fixtures]] [emmy.env :as e :refer [+ -]] [emmy.simplify :refer [hermetic-simplify-fixture]] [emmy.value :as v])) (use-fixtur...
0d0bf158b645af95451344efa022a1094a81677f147b2462f8e1333a5a15012a
sarabander/p2pu-sicp
2.14.scm
;; Depends on some preceding exercises ;; From the book (define (par1 r1 r2) (div-interval (mul-interval r1 r2) (add-interval r1 r2))) (define (par2 r1 r2) (let ((one (make-interval 1 1))) (div-interval one (add-interval (div-interval one r1) (div-interval one r2))))) ;; ---------------- (define o...
null
https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.1/2.14.scm
scheme
Depends on some preceding exercises From the book ---------------- Experiments with interval arithmetic 0.0699 (dividing adds the uncertainties) 0.0699 (multiplying adds them too) (taking reciprocal preserves the uncertainty) (uncertainty in adding is a bit more than the average of the tolerances) (uncertainty...
(define (par1 r1 r2) (div-interval (mul-interval r1 r2) (add-interval r1 r2))) (define (par2 r1 r2) (let ((one (make-interval 1 1))) (div-interval one (add-interval (div-interval one r1) (div-interval one r2))))) (define one (make-interval 1 1)) A couple of resistors with 2 % and 5 % tolerance ...
56f3391269278af47f38f7d7c9d939a245fe2c596967de23e37f23dafcac6428
TrustInSoft/tis-kernel
options.mli
(**************************************************************************) (* *) This file is part of . (* *) is a fork of Frama - C. Al...
null
https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/rte/options.mli
ocaml
************************************************************************ ...
This file is part of . is a fork of Frama - C. All the differences are : Copyright ( C ) 2016 - 2017 is released under GPLv2 This file is part of Frama - C. Copyright ( C ) 2007 - 2015 ...
e7c568bd6582c5ffd6bd684edf61bcd458cf22405e54e8a511cb58d349d337f9
sunng87/diehard
bulkhead.clj
(ns diehard.bulkhead (:import [java.util.concurrent Semaphore TimeUnit])) (def ^{:const true :no-doc true} allowed-bulkhead-option-keys #{:concurrency}) (defprotocol IBulkhead (acquire! [_] [this timeout-ms]) (release! [_])) (defrecord Bulkhead [semaphore] IBulkhead (acquire! [_] (.acquire ^Semaphore s...
null
https://raw.githubusercontent.com/sunng87/diehard/09cbb4877123f5699a26c674bb0cef6d240d5f72/src/diehard/bulkhead.clj
clojure
(ns diehard.bulkhead (:import [java.util.concurrent Semaphore TimeUnit])) (def ^{:const true :no-doc true} allowed-bulkhead-option-keys #{:concurrency}) (defprotocol IBulkhead (acquire! [_] [this timeout-ms]) (release! [_])) (defrecord Bulkhead [semaphore] IBulkhead (acquire! [_] (.acquire ^Semaphore s...
617e34803af3ea0253526e6e36579430f103ae33d3f3d832d036fe6e260a8a28
Jobhdez/scheme-to-c
desugaring-tests.lisp
(in-package #:manifold-tests) (deftest test-desugar-var () "Test if desugaring VARs work." (is (equalp (desugar (manifold-scheme::parse-exp 'x)) (manifold-scheme:make-var :v 'x)))) (deftest test-desugar-int () "Test if INTs get desugared." (is (equalp (desugar (manifold-scheme:parse-exp 3)) (man...
null
https://raw.githubusercontent.com/Jobhdez/scheme-to-c/2fc18fee47068c0d2d99ea81aa0d96d3fbd21ca4/tests/desugaring-tests.lisp
lisp
(in-package #:manifold-tests) (deftest test-desugar-var () "Test if desugaring VARs work." (is (equalp (desugar (manifold-scheme::parse-exp 'x)) (manifold-scheme:make-var :v 'x)))) (deftest test-desugar-int () "Test if INTs get desugared." (is (equalp (desugar (manifold-scheme:parse-exp 3)) (man...
3b381c704ec6b785e2368fe0732e0d941aa4c5fb311f7c34621a973d92cf24e2
nspin/hs-arm
I.hs
# LANGUAGE AllowAmbiguousTypes # {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE FunctionalDependencies # # LANGUAGE GeneralizedNe...
null
https://raw.githubusercontent.com/nspin/hs-arm/8f10870a4afbbba010e78bd98e452ba67adc34e0/harm/harm-types/src/Harm/Types/I.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE DataKinds # # LANGUAGE DeriveDataTypeable # # LANGUAGE MagicHash # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # These parameterized types are is provisional.
# LANGUAGE AllowAmbiguousTypes # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE FunctionalDependencies # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE KindSignatures # # LANGUAGE MultiParamTypeClasses # # LANGUAGE ScopedTypeVariables ...
a3c605b92bd5b2b0547c41c4862f9daae4bd45417624c0f9eb83277f52582bf1
libguestfs/virt-v2v
create_libvirt_xml.ml
virt - v2v * Copyright ( C ) 2009 - 2020 Red Hat Inc. * * 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 2 of the License , or * ( at your option ) any later ...
null
https://raw.githubusercontent.com/libguestfs/virt-v2v/e4a7f08c406a588d6034242ce14c5efc832cb476/output/create_libvirt_xml.ml
ocaml
The main body of the libvirt XML document. We have the machine features of the guest when it was on the * source hypervisor (source.s_features). We have the set of * hypervisor features supported by the target (target_features). * Combine these into a final list of features. Make sure we don't add any...
virt - v2v * Copyright ( C ) 2009 - 2020 Red Hat Inc. * * 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 2 of the License , or * ( at your option ) any later ...
ac48627e3eb6ae81d55c8d46756af89aa69ce3fb395c047dcb3586a7d35e7ec4
mirage/ocaml-git
hxd_cmdliner.ml
let run_fmt = function | Some v -> Hxd.Fmt.set_style_renderer Format.std_formatter v | None -> () let notzen = Array.make 256 `None let notzen = for i = 0 to 31 do notzen.(i) <- `Style (`Fg, `bit24 (0xaf, 0xd7, 0xff)) done; for i = 48 to 57 do notzen.(i) <- `Style (`Fg, `bit24 (0xaf, 0xdf, 0x77)) ...
null
https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/bin/carton/hxd_cmdliner.ml
ocaml
let run_fmt = function | Some v -> Hxd.Fmt.set_style_renderer Format.std_formatter v | None -> () let notzen = Array.make 256 `None let notzen = for i = 0 to 31 do notzen.(i) <- `Style (`Fg, `bit24 (0xaf, 0xd7, 0xff)) done; for i = 48 to 57 do notzen.(i) <- `Style (`Fg, `bit24 (0xaf, 0xdf, 0x77)) ...
f5bd470092b2e5d68f138c2dcc56e02a9d652c31b4a1759cbf9e0c32c722daf2
danielholmes/wolf3d-haskell
Dummy.hs
module Wolf3D.Debug.Dummy (dummyWorld) where import Wolf3D.WorldData import Wolf3D.World import Wolf3D.Hero import Wolf3D.DataHelpers dummyWorld :: World dummyWorld = createWorld GreyCeiling wm hero [] where wm = visualListToWallMap [[Just Blue1, Just Blue1, Just Grey1, Just Blue1, Just Blue1], ...
null
https://raw.githubusercontent.com/danielholmes/wolf3d-haskell/de934f657f1fb4351591448bb4e25aaa4923571f/src/Wolf3D/Debug/Dummy.hs
haskell
module Wolf3D.Debug.Dummy (dummyWorld) where import Wolf3D.WorldData import Wolf3D.World import Wolf3D.Hero import Wolf3D.DataHelpers dummyWorld :: World dummyWorld = createWorld GreyCeiling wm hero [] where wm = visualListToWallMap [[Just Blue1, Just Blue1, Just Grey1, Just Blue1, Just Blue1], ...
73786e2c9a13fa3231f5d364b000a00eb153bb361a5ee20932a80923a0e8af27
CryptoKami/cryptokami-core
Txp.hs
-- | Reexport of Pos.Client.Txp.* modules. # OPTIONS_GHC -F -pgmF autoexporter #
null
https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/client/src/Pos/Client/Txp.hs
haskell
| Reexport of Pos.Client.Txp.* modules.
# OPTIONS_GHC -F -pgmF autoexporter #
a9342e7ad99deaf52d7b5d8cd02a2ba9d7da73468466dc65029a4a536575eea6
processone/ejabberd-contrib
mod_irc.erl
%%%---------------------------------------------------------------------- %%% File : mod_irc.erl Author : < > %%% Purpose : IRC transport Created : 15 Feb 2003 by < > %%% %%% ejabberd , Copyright ( C ) 2002 - 2020 ProcessOne %%% %%% This program is free software; you can redistribute it and/or mod...
null
https://raw.githubusercontent.com/processone/ejabberd-contrib/a95e657a210a3de39040b7e3f43b02375bcf3869/mod_irc/src/mod_irc.erl
erlang
---------------------------------------------------------------------- File : mod_irc.erl Purpose : IRC transport This program is free software; you can redistribute it and/or License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WAR...
Author : < > Created : 15 Feb 2003 by < > ejabberd , Copyright ( C ) 2002 - 2020 ProcessOne modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the You should have received a copy of the GNU General Public License along ...
c740b6bd0c6b2ed6101b51d5f5b75393b0aa77b5feee570b6d14221fc62078e7
silkapp/json-schema
Validate.hs
# LANGUAGE GeneralizedNewtypeDeriving , ScopedTypeVariables # GeneralizedNewtypeDeriving , ScopedTypeVariables #-} module Data.JSON.Schema.Validate ( isValid , validate , ValidationError (..) , ErrorType (..) ) where import Prelude.Compat import Control.Monad.Compat import Control.Mona...
null
https://raw.githubusercontent.com/silkapp/json-schema/a71d441601f902a44eb983ceac721e32c1b393f9/src/Data/JSON/Schema/Validate.hs
haskell
| Validates a value against a schema returning errors. | Predicate version of 'validate'. ^ The Path to the property where the error occured, empty if the error is on the top level. ^ General type error. ^ Number out of bounds. ^ String or Array out of bounds. ^ Expected and actual tuple length. ^ A required fi...
# LANGUAGE GeneralizedNewtypeDeriving , ScopedTypeVariables # GeneralizedNewtypeDeriving , ScopedTypeVariables #-} module Data.JSON.Schema.Validate ( isValid , validate , ValidationError (..) , ErrorType (..) ) where import Prelude.Compat import Control.Monad.Compat import Control.Mona...
6fc8c73f8f1bb77f91c9a76d9cd9bf93749e8f69910c52a72a157ebd491830d4
brendanhay/gogol
DetectLanguage.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # {-# LANGUAGE St...
null
https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-translate/gen/Gogol/Translate/Projects/DetectLanguage.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated Detects the language of text within a request. /See:/ < Cloud Translation API Reference> for @translate.projects.detectLanguage@. * Resource ** Constructing a Request | A resource alias for @translate.projects.detectLanguage@...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators...
7de86770cf19a3e209b2cb36280b230242cfd9700d67bbe61e93101547f5c3dd
returntocorp/semgrep
Parse_rule.mli
Parse a rule file , either in YAML or JSON ( or even JSONNET ) format * depending on the filename extension . * * The parser accepts invalid rules , skips them , and returns them in * the list of errors . * This will not raise Rule . Err ( Rule . InvalidRule ... ) exceptions . * * However , this ...
null
https://raw.githubusercontent.com/returntocorp/semgrep/9a9f7dd6c09327a3e5d8bb9d941abe82a632d63b/src/parsing/Parse_rule.mli
ocaml
Parse a rule file , either in YAML or JSON ( or even JSONNET ) format * depending on the filename extension . * * The parser accepts invalid rules , skips them , and returns them in * the list of errors . * This will not raise Rule . Err ( Rule . InvalidRule ... ) exceptions . * * However , this ...
9862cc35d1b6e7dac3441a2dac20e9d4730254036846e8c9ae204bfdd88b808a
erlyaws/yaws
yaws_log.erl
%%---------------------------------------------------------------------- %%% File : yaws_log.erl Author : < > %%% Purpose : Created : 26 Jan 2002 by < > %%%---------------------------------------------------------------------- -module(yaws_log). -author(''). -include_lib("kernel/include/file.hrl"). -inc...
null
https://raw.githubusercontent.com/erlyaws/yaws/c268abdcb03455e02baf1f1ac02f1ae9fcc431cb/src/yaws_log.erl
erlang
---------------------------------------------------------------------- File : yaws_log.erl Purpose : ---------------------------------------------------------------------- External exports gen_server callbacks API ---------------------------------------------------------------------- API ----------------------...
Author : < > Created : 26 Jan 2002 by < > -module(yaws_log). -author(''). -include_lib("kernel/include/file.hrl"). -include_lib("kernel/include/inet.hrl"). -behaviour(gen_server). -export([start_link/0, reopen_logs/0]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, ...
8219e3cc6b27d4d8f5bd407044b6dbf13a973bb037892d367c9127ce5caa39f6
albertoruiz/easyVision
Bootstrap.hs
module Vision.Bootstrap( -- * Rotations initRots, refineRots, makeEcs, solveEcs, coordsRot, fixRot, -- * Centers -- unRotEpi, coeffCent, solveCams, estimatePointsCenters ) where import Util.Rotation import Vision.Epipolar import Util.Misc(vec,Mat,Vec,degree,arrayOf,unionSort) im...
null
https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/geometry/src/Vision/Bootstrap.hs
haskell
* Rotations * Centers unRotEpi, coeffCent, -------------------------------------------------------------------- best fit of rotations in tangent space ^ residuals -------------------------------------------------------------------- linear estimation of camera centers from known rotations ^ Rotations | create fu...
module Vision.Bootstrap( initRots, refineRots, makeEcs, solveEcs, coordsRot, fixRot, solveCams, estimatePointsCenters ) where import Util.Rotation import Vision.Epipolar import Util.Misc(vec,Mat,Vec,degree,arrayOf,unionSort) import Util.Debug(debug,impossible) import Util.Graph(kruskal,path...
b5e301725d59312d532db44e2e394e092dbb65e30d19acd4fc08b2ea7737c02b
polysemy-research/polysemy
IO.hs
# LANGUAGE AllowAmbiguousTypes # -- | Description: Compatibility with 'MonadIO' module Polysemy.IO ( -- * Interpretations embedToMonadIO ) where import Control.Monad.IO.Class import Polysemy import Polysemy.Embed ------------------------------------------------------------------------------ -- | The 'MonadI...
null
https://raw.githubusercontent.com/polysemy-research/polysemy/10a1336f32438c2d308313f8ad55ac736145390f/src/Polysemy/IO.hs
haskell
| Description: Compatibility with 'MonadIO' * Interpretations ---------------------------------------------------------------------------- | The 'MonadIO' class is conceptually an interpretation of 'IO' to some other monad. This function reifies that intuition, by transforming an 'IO' effect into some other 'Monad...
# LANGUAGE AllowAmbiguousTypes # module Polysemy.IO embedToMonadIO ) where import Control.Monad.IO.Class import Polysemy import Polysemy.Embed @since 1.0.0.0 embedToMonadIO :: forall m r a . ( MonadIO m , Member (Embed m) r ) => Sem (Embed IO ': r) a -> Sem r a embedToMonadIO ...
64a5988bff617ac8744ee2da691f03e684ead83a444175c440c467ce17cf8136
ashinn/chibi-scheme
pretty.scm
;; pretty.scm -- pretty printing format combinator Copyright ( c ) 2006 - 2020 . All rights reserved . ;; BSD-style license: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; utilities (define (take* ls n) ; handles dotted lists and n > length (cond ((zero? n) '()) ((pair?...
null
https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/lib/srfi/166/pretty.scm
scheme
pretty.scm -- pretty printing format combinator BSD-style license: utilities handles dotted lists and n > length may return the dot Modify output to accumulate to an output string port, and escape immediately with failure if we exceed the column width. fitted successfully style all on separate lines the ...
Copyright ( c ) 2006 - 2020 . All rights reserved . (cond ((zero? n) '()) ((pair? ls) (cons (car ls) (take* (cdr ls) (- n 1)))) (else '()))) (cond ((zero? n) ls) ((pair? ls) (drop* (cdr ls) (- n 1))) (else ls))) (define (make-space n) (make-string n #\space)) (define (make-...
ccd6baa77f3903e4ed0b59e93f4c169254dd9ce21d7b211ff1627121bbd5334f
ucsd-progsys/dsolve
bdd.ml
DSOLVE -bare -dontgenmlq Binary Decision Diagrams , adapted from code by let myfail s = print_string s; assert false type bdd = Zero of int | One of int | Node of int * int * bdd * bdd let skip (x:bdd) = () let tag = function | Zero t -> t | One t -> t | Node (t,_,_,...
null
https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/postests/bdd.ml
ocaml
COMPLEX VERSION sum of the bucket sizes max ratio totsize/table length SLICE SLICE: add_index t hnode index; v1 > v2
DSOLVE -bare -dontgenmlq Binary Decision Diagrams , adapted from code by let myfail s = print_string s; assert false type bdd = Zero of int | One of int | Node of int * int * bdd * bdd let skip (x:bdd) = () let tag = function | Zero t -> t | One t -> t | Node (t,_,_,...
73b16eb4328198bcec2122af81a99bc536c8aa3145b1dc09ba0a58baa4da9ae0
clj-kondo/configs
nippy.clj
(ns clj-kondo.nippy) (defmacro extend-freeze [type type-id [x out] & body] `(let [~'_ ~type-id] (extend-type ~type taoensso.nippy/IFreezable1 (~'-freeze-without-meta! [~x ~out] ~@body)))) (defmacro extend-thaw [type-id [in] & body] `(let [~in 1 ~'_ ~type-id] ...
null
https://raw.githubusercontent.com/clj-kondo/configs/50a1c4eedd15167acda134a4cdac5df8c94b8983/configs/com.taoensso/nippy/resources/clj-kondo.exports/clj-kondo/nippy/clj_kondo/nippy.clj
clojure
(ns clj-kondo.nippy) (defmacro extend-freeze [type type-id [x out] & body] `(let [~'_ ~type-id] (extend-type ~type taoensso.nippy/IFreezable1 (~'-freeze-without-meta! [~x ~out] ~@body)))) (defmacro extend-thaw [type-id [in] & body] `(let [~in 1 ~'_ ~type-id] ...