_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
5db9fe499daa3934f5d57257f6af5cfa2f0595e707baf59d996cd55eb209c590
Decentralized-Pictures/T4L3NT
michelson_v1_gas.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > Copyright ( c...
null
https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_alpha/lib_protocol/michelson_v1_gas.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < > Copyright ( c ) 2019 - 2020 Nomadic Labs < > Copyright ( c ) 2020 Metastate AG < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit pers...
dae0a076bbb303b41c58bad035f44a88b6e100e00ca0670a871f46a10a2422c7
y-taka-23/time-machine
Cockpit.hs
module Control.Monad.TimeMachine.Cockpit ( -- * Destinations -- ** Absolute Destinations the, future -- ** Zoned Destinations , Hour, Minute, DayOfMonth, Month, Year , HalfDay, am, pm , jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec -- ** Reletive Destinations , minutes...
null
https://raw.githubusercontent.com/y-taka-23/time-machine/c82f15d51d12b800438aa74401f42d39e0c472fe/src/Control/Monad/TimeMachine/Cockpit.hs
haskell
* Destinations ** Absolute Destinations ** Zoned Destinations ** Reletive Destinations * Acceleration ** Absolute Acceleration ** Relative Acceleration which represents an unit of the interval. It represents the direction of a time travel, namely which of going forward or back. | An alias of @1 `days` later@...
module Control.Monad.TimeMachine.Cockpit ( the, future , Hour, Minute, DayOfMonth, Month, Year , HalfDay, am, pm , jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec , minutes, hours, days, weeks, months, years , Direction, later, ago , tomorrow, yesterday , at , TimeScaleU...
60ce3a739d703425896a07c24be0f87df43d4f010a829954dc052cdb56be4cef
fredrikt/yxa
local.erl
%%%------------------------------------------------------------------- %%% File : local.erl @author < > %%% @doc Interface to local functions hooking into lots of different parts of the various YXA applications . %%% @since 03 Jan 2006 by < > %%% @end %%%----------------------------...
null
https://raw.githubusercontent.com/fredrikt/yxa/85da46a999d083e6f00b5f156a634ca9be65645b/src/local.erl
erlang
------------------------------------------------------------------- File : local.erl @doc Interface to local functions hooking into lots of @end ------------------------------------------------------------------- -------------------------------------------------------------------- External exports --------...
@author < > different parts of the various YXA applications . @since 03 Jan 2006 by < > -module(local). -export([init/0 ]). -export([ url2mnesia_userlist/1, canonify_user/1, canonify_addresses/1 ]). -export([ lookup_homedomain_request/2, lookup_remote_request/2, lookupregex...
6525e2781d3f487aea3a5870a3ce3c062ae3dc080823bc51301198152b357db0
dustin/mqtt-hs
Topic.hs
| Module : Network . . Description : MQTT Topic types and utilities . Copyright : ( c ) , 2019 License : Stability : experimental Topic and topic related utiilities . Module : Network.MQTT.Topic. Description : MQTT Topic types and utilities. Copyright : (c) Dustin Salling...
null
https://raw.githubusercontent.com/dustin/mqtt-hs/0ed3802c017487e63bde0a0512ee7b9f585414e3/src/Network/MQTT/Topic.hs
haskell
# LANGUAGE OverloadedStrings # | split separates a `Filter` or `Topic` into its `/`-separated components. | An MQTT topic. | mkTopic creates a topic from a text representation of a valid filter. | An MQTT topic filter. | mkFilter creates a filter from a text representation of a valid filter. | match retu...
| Module : Network . . Description : MQTT Topic types and utilities . Copyright : ( c ) , 2019 License : Stability : experimental Topic and topic related utiilities . Module : Network.MQTT.Topic. Description : MQTT Topic types and utilities. Copyright : (c) Dustin Salling...
f0db2446238ffc0bf4e9be736e27f45d029e8b5a9bcbc5bb6f52b23d683ee217
libguestfs/virt-v2v
input_vddk.mli
virt - v2v * Copyright ( C ) 2009 - 2021 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/7691f8e853d21980aac3008237a55f6bc291581c/input/input_vddk.mli
ocaml
* Input from vCenter or ESXi over VDDK
virt - v2v * Copyright ( C ) 2009 - 2021 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 ...
fc7c33a6b812a9205c2b878494360ffb77e32d4e54b9f1291335c73907ead5f6
jrclogic/SMCDEL
RussianCards.hs
# LANGUAGE FlexibleInstances # module SMCDEL.Examples.RussianCards where import Control.Monad (replicateM) import Data.HasCacBDD hiding (Top,Bot) import Data.List ((\\),delete,intersect,nub,sort) import Data.Map.Strict (fromList) import SMCDEL.Internal.Help (powerset) import SMCDEL.Language import SMCDEL.Other.Plann...
null
https://raw.githubusercontent.com/jrclogic/SMCDEL/10bd5ba2f1f3cc85e4b0f23d5eddbb26f05df5bf/src/SMCDEL/Examples/RussianCards.hs
haskell
FIXME how to adapt the number of hands for larger n? these restrictions are only proven
# LANGUAGE FlexibleInstances # module SMCDEL.Examples.RussianCards where import Control.Monad (replicateM) import Data.HasCacBDD hiding (Top,Bot) import Data.List ((\\),delete,intersect,nub,sort) import Data.Map.Strict (fromList) import SMCDEL.Internal.Help (powerset) import SMCDEL.Language import SMCDEL.Other.Plann...
cc5f6ef8eaa4ec989d97c8d61ee4b918f9285513f2a7c4c273a4504b0c7e40d6
Fandoozle/AutoCAD
clearwipeouts.lsp
(vl-load-com) (defun c:ClearWipeouts (/ b o) ;;--- Tharwat 26.June.2013 ---;; (or doc (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) ) (vlax-for b (vla-get-blocks doc ) (if (and (eq :vlax-false (vla-get-isLayout b)) (eq :...
null
https://raw.githubusercontent.com/Fandoozle/AutoCAD/18480cd17c9b46718762c3155f2bca1be2e2e5e2/clearwipeouts.lsp
lisp
--- Tharwat 26.June.2013 ---;;
(vl-load-com) (defun c:ClearWipeouts (/ b o) (or doc (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) ) (vlax-for b (vla-get-blocks doc ) (if (and (eq :vlax-false (vla-get-isLayout b)) (eq :vlax-false (vla-get-isXref b)) ...
53621a9251eb3dfcffac96aeb26e65797669f63789b90bbffdfcc9c1cebfc393
Clozure/ccl
interp.lisp
-*- Log : hemlock.log ; Package : Hemlock - Internals -*- ;;; ;;; ********************************************************************** This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . ;;; #+CMU (ext:file-comment "$Header$")...
null
https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/cocoa-ide/hemlock/src/interp.lisp
lisp
Package : Hemlock - Internals -*- ********************************************************************** ********************************************************************** This file contains the routines which define hemlock commands and the command interpreter. Key Tables: A key table provides a w...
This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . #+CMU (ext:file-comment "$Header$") Written by and . (in-package :hemlock-internals) (defun %print-hcommand (obj stream depth) (declare (ignore depth)) (write-stri...
921b7eecb74791904ee2853da773d2cbb9248cfffaeab514b6167e87f7e1aad1
nasa/Common-Metadata-Repository
iso19115_2.clj
(ns cmr.umm-spec.umm-to-xml-mappings.iso19115-2 "Defines mappings from UMM records into ISO19115-2 XML." (:require [clojure.string :as string] [cmr.common.date-time-parser :as p] [cmr.common.util :as util] [cmr.common.xml.gen :refer :all] [cmr.umm-spec.date-util :as date-util] [cmr.umm-spec.iso-ke...
null
https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/371be298e3eb9b80041d1ac661d7cde85978012e/umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso19115_2.clj
clojure
Use a default value if none present in the UMM record
(ns cmr.umm-spec.umm-to-xml-mappings.iso19115-2 "Defines mappings from UMM records into ISO19115-2 XML." (:require [clojure.string :as string] [cmr.common.date-time-parser :as p] [cmr.common.util :as util] [cmr.common.xml.gen :refer :all] [cmr.umm-spec.date-util :as date-util] [cmr.umm-spec.iso-ke...
f4e911c51ed3dcf7eddd98d8f034f1268963d402a33f6fafd3e4a1235ad8ae9d
amnh/ocamion
bench.mli
(** {1 Bench} Benchmark a function against optimization methods. Currently this supports the multi-dimensional numerical optimization routines, thus this may change to unify with combinatorial functions. *) (** {2 Types} *) (** Define the columns to report data. The default columns are the name of the ...
null
https://raw.githubusercontent.com/amnh/ocamion/699c2471b7fdac12f061cf24b588f9eef5bf5cb8/lib/bench.mli
ocaml
* {1 Bench} Benchmark a function against optimization methods. Currently this supports the multi-dimensional numerical optimization routines, thus this may change to unify with combinatorial functions. * {2 Types} * Define the columns to report data. The default columns are the name of the method, sa...
type columns = [ `N | `Name | `Result_Mean | `Result_StdDev | `Time_Mean | `Time_StdDev | `Result_Skew | `Time_Skew | `Result_Kurt | `Time_Kurt | `Time_Var | `Result_Var | `Time_Min | `Time_Max | `Result_Min | `Result_Max ] * { 2 Benchmark Functions } val bench : d:int -> range:float * float ->...
2ead18eca5c654b0f51e4747894314f81dc0a02a76e1441a1f0c0118d1625338
konfig-xyz/rust-reason-parser
ConfigurationParser.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # module ConfigurationParser (makeConfig) where import Data.Bifunctor (first) import qualified Data.Map as M import Data.Maybe (mapMaybe) import qualified Data.Set as S import qualified Data.Text as ...
null
https://raw.githubusercontent.com/konfig-xyz/rust-reason-parser/71b7d79bca485e0c67835ec477dbf9760746385f/src/ConfigurationParser.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE ScopedTypeVariables # module ConfigurationParser (makeConfig) where import Data.Bifunctor (first) import qualified Data.Map as M import Data.Maybe (mapMaybe) import qualified Data.Set as S import qualified Data.Text as T import Data.Yaml.Config (...
cc64b190a23ee353f1f4d4193410505952054f8ed9175705210459f29b738a1f
google/btls
DigestTests.hs
Copyright 2017 Google LLC -- Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not -- use this file except in compliance with the License. You may obtain a copy of -- the License at -- -- -2.0 -- -- Unless required by applicable law or agreed to in writing, software distributed und...
null
https://raw.githubusercontent.com/google/btls/6de13194f15468b186fe62d089b3a7189795c704/tests/Data/DigestTests.hs
haskell
use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitati...
Copyright 2017 Google LLC Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not distributed under the License is distributed on an " AS IS " BASIS , WITHOUT module Data.DigestTests (tests) where import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit ((@?), testCase) import ...
a8e686a10ddc8ecc38767951d0bbe96c6d76d9de7819f5de7cbc5520bf64acd1
basho/machi
machi_proxy_flu1_client_test.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You...
null
https://raw.githubusercontent.com/basho/machi/e87bd59a9777d805b00f9e9981467eb28e28390c/test/machi_proxy_flu1_client_test.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved . 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 ...
2626552f4e5188c2a42638f5677d880073f9d8ae879727c5eb4b2a61f78617f2
ucsd-progsys/liquidhaskell
NewTypes.hs
{-@ LIQUID "--expect-any-error" @-} module NewTypes where newtype Foo a = Bar Int @ newtype Foo a = Bar { x : : } @ @ fromFoo : : Nat @ fromFoo :: Foo a -> Int fromFoo (Bar n) = n bar = Bar (-1)
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/datacon/neg/NewTypes.hs
haskell
@ LIQUID "--expect-any-error" @
module NewTypes where newtype Foo a = Bar Int @ newtype Foo a = Bar { x : : } @ @ fromFoo : : Nat @ fromFoo :: Foo a -> Int fromFoo (Bar n) = n bar = Bar (-1)
778653b443233207ad417db35b14bee888a032a73adfc3de680be14e55290fbc
manuel-serrano/bigloo
compile.scm
;*=====================================================================*/ * serrano / prgm / project / bigloo / / comptime / SawC / compile.scm * / ;* ------------------------------------------------------------- */ * Author : * / * Creation : ...
null
https://raw.githubusercontent.com/manuel-serrano/bigloo/1ae5b060fcfd05ad33440765b45add3a26ced5b4/comptime/SawC/compile.scm
scheme
*=====================================================================*/ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ * The `C generation' pass. */ *===========================...
* serrano / prgm / project / bigloo / / comptime / SawC / compile.scm * / * Author : * / * Creation : Tue Feb 21 08:37:48 1995 * / * Last change : Fri Jun 24 20:28:16 2022 ( serrano ) * / * Copyrigh...
2f77a22a067fe3245e03d6c5cc90060ee428a17794bf5a740c3fc326b5c6561f
ngorogiannis/cyclist
predsym.ml
open Lib open MParser module T = Strng module H = Hashcons.Make (T) let predtbl = H.create 997 module HT = struct type t = T.t Hashcons.hash_consed let parse st = (parse_ident |>> H.hashcons predtbl) st let of_string s = handle_reply (MParser.parse_string parse s ()) let to_string s = s.Hashcons.node le...
null
https://raw.githubusercontent.com/ngorogiannis/cyclist/c93a168d586b308ab2a2c730cd1b2375ab263167/src/seplog/predsym.ml
ocaml
open Lib open MParser module T = Strng module H = Hashcons.Make (T) let predtbl = H.create 997 module HT = struct type t = T.t Hashcons.hash_consed let parse st = (parse_ident |>> H.hashcons predtbl) st let of_string s = handle_reply (MParser.parse_string parse s ()) let to_string s = s.Hashcons.node le...
8857c7f1cfa92290c30c28f62ad37e8676f0c7fe2276348a0f51c7a9fb359d2c
racket/htdp
stop-when-bad-draw.rkt
The first three lines of this file were inserted by . They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-advanced-reader.ss" "lang")((modname stop-when-bad-draw) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeatin...
null
https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/2htdp/tests/stop-when-bad-draw.rkt
racket
about the language level of this file in a form that our tools can easily process.
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-advanced-reader.ss" "lang")((modname stop-when-bad-draw) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f () #f))) (require 2htdp/image) (require 2htdp/universe) (defi...
0bf47387dee9f38c07f346db3f3254bd153f0b591448011c8b281cfedb3c4766
odis-labs/helix
View.ml
module Js = Helix_js module Attr = Html.Attr module Node = Stdweb.Dom.Node module Element = Stdweb.Dom.Element module Comment = Stdweb.Dom.Comment module Document_fragment = Stdweb.Dom.Document_fragment module Document = Stdweb.Dom.Document module Html_element = Stdweb.Dom.Html_element let option_get option = match ...
null
https://raw.githubusercontent.com/odis-labs/helix/7106652712626b9c7fd21660b4d53cca1e915224/src/helix/View.ml
ocaml
Reactive rendering Anchor for the show node. Create initial html. Store reference to prev html. Temporary fragment for next node. Add anchor. Add initial html value. Subscribe to updates. Create next html. Remove prev node. Update prev. Insert next to fragment and the fragment to parent. Anchor...
module Js = Helix_js module Attr = Html.Attr module Node = Stdweb.Dom.Node module Element = Stdweb.Dom.Element module Comment = Stdweb.Dom.Comment module Document_fragment = Stdweb.Dom.Document_fragment module Document = Stdweb.Dom.Document module Html_element = Stdweb.Dom.Html_element let option_get option = match ...
3566969a1cec0dea6b1e5f61fd3b57dc53473628db79d58e4b018bff060f79fa
GNOME/aisleriot
thieves.scm
; Aisleriot - Thieves Copyright ( C ) 2001 < > < > ; ; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or ; (at your option) any lat...
null
https://raw.githubusercontent.com/GNOME/aisleriot/5b04e58ba5f8df8223a3830d2c61325527d52237/games/thieves.scm
scheme
Aisleriot - Thieves 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 th...
Copyright ( C ) 2001 < > < > 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 (use-modules (aisleriot interface) (aisleriot api)) ...
2225aabb280ca57e38736e10a1d6a391fb8fc5ae8c5375cc7338c4ddce20a79e
GaloisInc/what4
ProgramLoc.hs
----------------------------------------------------------------------- -- | Module : Description : Datatype for handling program locations Copyright : ( c ) Galois , Inc 2014 - 2020 -- License : BSD3 Maintainer : < > -- Stability : provisional -- -- This modu...
null
https://raw.githubusercontent.com/GaloisInc/what4/91200aa39565c156226cec6a9409a692e4022501/what4/src/What4/ProgramLoc.hs
haskell
--------------------------------------------------------------------- | License : BSD3 Stability : provisional This module primarily defines the `Position` datatype for handling program location data. A program location may refer either to a source file location (file name, line and column numbe...
Module : Description : Datatype for handling program locations Copyright : ( c ) Galois , Inc 2014 - 2020 Maintainer : < > # LANGUAGE CPP # # LANGUAGE DeriveFoldable # # LANGUAGE DeriveFunctor # module What4.ProgramLoc ( Position(..) , sourcePos , startOfFile , ppNoFi...
4fd933f2a3d79e64a5e66fd15a02c912a0b65b17cee29aa0382b838849478926
junjihashimoto/hspec-server
Util.hs
module Test.Hspec.Server.Util where import System.Exit import Control.Monad import Control.Monad.IO.Class import Data.Monoid import Text.Regex.Posix import Test.Hspec.Server.Core cmd :: ServerType dat => dat -> FilePath -> [String] -> String -> IO (ExitCode,String,String) cmd = stCmd type Patterns = [String] type Ar...
null
https://raw.githubusercontent.com/junjihashimoto/hspec-server/473058fa4ca17abbe110d9f273d3c6726d5f1365/Test/Hspec/Server/Util.hs
haskell
type TestedName = String
module Test.Hspec.Server.Util where import System.Exit import Control.Monad import Control.Monad.IO.Class import Data.Monoid import Text.Regex.Posix import Test.Hspec.Server.Core cmd :: ServerType dat => dat -> FilePath -> [String] -> String -> IO (ExitCode,String,String) cmd = stCmd type Patterns = [String] type Ar...
30dc3c47895aec28573ee3078bf0fb5bf5834ef1c7e0318a4e8dca079df0e022
zenspider/schemers
exercise.4.20.scm
#!/usr/bin/env csi -s (require rackunit) (require-library eval) (import eval) Exercise 4.20 ;; Because internal definitions look sequential but ;; are actually simultaneous, some people prefer to avoid them entirely , and use the special form ` letrec ' instead . ` Letrec ' ;; looks like `let', so it is not su...
null
https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.20.scm
scheme
Because internal definitions look sequential but are actually simultaneous, some people prefer to avoid them looks like `let', so it is not surprising that the variables it binds are bound simultaneously and have the same scope as each other. The sample procedure `f' above can be written without internal definit...
#!/usr/bin/env csi -s (require rackunit) (require-library eval) (import eval) Exercise 4.20 entirely , and use the special form ` letrec ' instead . ` Letrec ' ( ( ( < > < EXP_1 > ) ... ( < VAR_N > < EXP_N > ) ) ` even ? ' and ` odd ? ' in the example above , or the evaluation of 10 ( ( ( fa...
22283dab489d3480ab4b2ec0b93ee3944100b1831d0d7f4ed7f4006abac469a3
cicakhq/potato
misc-core.lisp
(in-package :potato.core) (declaim #.potato.common::*compile-decl*) (deftype byte-vector () '(vector (unsigned-byte 8) *)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Conditions. Perhaps these definitions belong in its own file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;...
null
https://raw.githubusercontent.com/cicakhq/potato/88b6c92dbbc80a6c9552435604f7b1ae6f2a4026/src/potato/misc-core.lisp
lisp
Conditions. Perhaps these definitions belong in its own file. Various random functions which have no better home ELSE: No external listen address set, use default
(in-package :potato.core) (declaim #.potato.common::*compile-decl*) (deftype byte-vector () '(vector (unsigned-byte 8) *)) (define-condition potato-error (error) ((message :type string :initarg :message :initform "Unknown message" :reader potato-error/message)) (:report (lamb...
9330035959db106d73120e47cfc3144b882a61f14e3c81d025ad67fa59254994
mindpool/gambit-termite
match.scm
(define-macro (match/action on-success on-fail datum . clauses) (let ((tmp (gensym)) (succ (gensym)) (fail (gensym))) `(let ((,tmp ,datum) (,succ (lambda () ,on-success)) ;; the thunk for success is lifted (,fail (lambda () ,on-fail))) ;; the thunk for failure is lifted ,(compile-pa...
null
https://raw.githubusercontent.com/mindpool/gambit-termite/391b75253cc3a5abd77dfc29392a72b2eca0d09e/match.scm
scheme
the thunk for success is lifted the thunk for failure is lifted
(define-macro (match/action on-success on-fail datum . clauses) (let ((tmp (gensym)) (succ (gensym)) (fail (gensym))) `(let ((,tmp ,datum) ,(compile-pattern-match `(,succ) `(,fail) clauses tmp)))) (define-macro (match datum . clauses) (let ((tmp (gensym)) (fail (gensym))) `(let* ((,tm...
c909fea9836d50af935ef1f26f754393eb97588ccd890525a0adf0963cef18c0
chenyukang/eopl
tests.scm
(module tests mzscheme (provide test-list) ;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;; (define test-list '( ;; simple arithmetic (positive-const "11" 11) (negative-const "-33" -33) (simple-arith-1 "-(44,33)" 11) ;; nested arithmetic (nested-arith-lef...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter3/proc-lang/ds-rep/tests.scm
scheme
tests ;;;;;;;;;;;;;;;; simple arithmetic nested arithmetic simple variables simple unbound variables simple conditionals test dynamic typechecking make sure that the test and both arms get evaluated properly. and make sure the other arm doesn't get evaluated. simple let check nested let and shad...
(module tests mzscheme (provide test-list) (define test-list '( (positive-const "11" 11) (negative-const "-33" -33) (simple-arith-1 "-(44,33)" 11) (nested-arith-left "-(-(44,33),22)" -11) (nested-arith-right "-(55, -(22,11))" 44) (test-var-1 "x"...
827d6e7a6918a9a892aef14d5fe6ffc879934f6d98d2a617a8aa045292783a52
NorfairKing/super-user-spark
Types.hs
# LANGUAGE CPP # # LANGUAGE DeriveGeneric # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module SuperUserSpark.Diagnose.Types where import Import hiding ((<>)) import Data.Aeson import Data.Hashable import Text.Printf import SuperUserSpark.Bake.Types import SuperUserSpark.Compiler.Types #if __GL...
null
https://raw.githubusercontent.com/NorfairKing/super-user-spark/3c286a52a0b81e083c0e6d39f6f2b02aa9bb9231/src/SuperUserSpark/Diagnose/Types.hs
haskell
# LANGUAGE OverloadedStrings # Could point to directory too.
# LANGUAGE CPP # # LANGUAGE DeriveGeneric # # LANGUAGE RecordWildCards # module SuperUserSpark.Diagnose.Types where import Import hiding ((<>)) import Data.Aeson import Data.Hashable import Text.Printf import SuperUserSpark.Bake.Types import SuperUserSpark.Compiler.Types #if __GLASGOW_HASKELL__ < 840 import Data.S...
aaea17ee5dd43ccf4f4c9c3fab81b2cf2b63e90f8a8f762193986872f5bb9a54
ChicagoBoss/tinymq
tinymq_test.erl
-module(tinymq_test). -export([run_tests/0]). run_tests() -> application:start(tinymq), Channel1 = "channel1", Ts1 = tinymq:now(Channel1), tinymq:push(Channel1, "Hello!"), Ts2 = tinymq:now(Channel1), {ok, _, ["Hello!"]} = tinymq:poll(Channel1, Ts1), {ok, _, []} = tinymq:poll(Channel1, Ts2...
null
https://raw.githubusercontent.com/ChicagoBoss/tinymq/12fc8472442a46bc7130847625a68be33f88f181/tests/tinymq_test.erl
erlang
-module(tinymq_test). -export([run_tests/0]). run_tests() -> application:start(tinymq), Channel1 = "channel1", Ts1 = tinymq:now(Channel1), tinymq:push(Channel1, "Hello!"), Ts2 = tinymq:now(Channel1), {ok, _, ["Hello!"]} = tinymq:poll(Channel1, Ts1), {ok, _, []} = tinymq:poll(Channel1, Ts2...
7def71217dcf73f690a493a898d09544aa3284bc31afda09ab82acacfd587aa4
AndrasKovacs/ELTE-func-lang
Notes08.hs
# LANGUAGE DeriveFunctor , , DeriveTraversable , MonadComprehensions # module Notes08 where import Data.Char import Data.List import Control.Applicative import Control.Monad ------------------------------------------------------------------------------- newtype Parser a = Parser { runParser :: String -> Maybe (a, ...
null
https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-1/gyak_3/Notes08.hs
haskell
----------------------------------------------------------------------------- ----------------------------------------------------------------------------- succeeds if the input string is empty, fails otherwise. The parser `satisfy p` succeeds if the input string starts with a character that satisfies the predica...
# LANGUAGE DeriveFunctor , , DeriveTraversable , MonadComprehensions # module Notes08 where import Data.Char import Data.List import Control.Applicative import Control.Monad newtype Parser a = Parser { runParser :: String -> Maybe (a, String) } instance Functor Parser where fmap f (Parser p) = Parser $ \s -> ca...
7cf182cb4bdb00ac517bf491b451f6a303fe1fd29183a0acaf3b1eef0261e383
cxphoe/SICP-solutions
3.69.rkt
(load "pairs.rkt") (define (triples S T U) (let ((ps (pairs T U))) (cons-stream (cons (stream-car S) (stream-car ps)) (interleave (stream-map (lambda (p) (cons (stream-car S) p)) (stream-cdr ps)) (triples (stream-cdr S) (stream-cdr T) (stream-cdr U)))))) (define (square-s...
null
https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%203-Modeling%20with%20Mutable%20Data/5.Stream/3.69.rkt
racket
(load "pairs.rkt") (define (triples S T U) (let ((ps (pairs T U))) (cons-stream (cons (stream-car S) (stream-car ps)) (interleave (stream-map (lambda (p) (cons (stream-car S) p)) (stream-cdr ps)) (triples (stream-cdr S) (stream-cdr T) (stream-cdr U)))))) (define (square-s...
7aaabf53abe54ce240264d40f4b256c3ce9a2a1cb9d8fce654ad25f1ef8aabf1
helvm/helma
AutoOptions.hs
module HelVM.HelMA.Automaton.API.AutoOptions where import HelVM.HelMA.Automaton.Types.CellType import HelVM.HelMA.Automaton.Types.IntCellType import HelVM.HelMA.Automaton.Types.RAMType import HelVM.HelMA.Automaton.Types.StackType -- | Types data AutoOptions = AutoOptions { ra...
null
https://raw.githubusercontent.com/helvm/helma/2ae31668ce11ded53daf01effe25047d5ce471cf/hs/src/HelVM/HelMA/Automaton/API/AutoOptions.hs
haskell
| Types
module HelVM.HelMA.Automaton.API.AutoOptions where import HelVM.HelMA.Automaton.Types.CellType import HelVM.HelMA.Automaton.Types.IntCellType import HelVM.HelMA.Automaton.Types.RAMType import HelVM.HelMA.Automaton.Types.StackType data AutoOptions = AutoOptions { ram :: !R...
8e2a0dc9df6dc69a60775322def861e616314f52e9bae8fb6cfa9d500e349a5d
anwarmamat/cmsc330fall20
disc3.ml
(* Part 1: Type inference *) let f1 a b = a + b;; let f2 a b = if a then b else a;; let f3 a b c = if (a +. b) == 0.0 then "Hi" else c;; Part 2 : Type definition let tf1 a = failwith "unimplemented" let tf2 a b c = failwith "unimplemented" let tf3 a b = failwith "unimplemented" Part 3 : Functions let conca...
null
https://raw.githubusercontent.com/anwarmamat/cmsc330fall20/1f185a757ad86c37587ec15d580ea0ff728d9472/disc3/src/disc3.ml
ocaml
Part 1: Type inference
let f1 a b = a + b;; let f2 a b = if a then b else a;; let f3 a b c = if (a +. b) == 0.0 then "Hi" else c;; Part 2 : Type definition let tf1 a = failwith "unimplemented" let tf2 a b c = failwith "unimplemented" let tf3 a b = failwith "unimplemented" Part 3 : Functions let concat str1 str2 = failwith "unimp...
05a1fb44ead250306f72dfc441ef0ef7b218141c301e2113ada3db940d24be9c
lndl/chesssimple
Color.hs
# LANGUAGE DeriveGeneric , DeriveAnyClass # module Chesssimple.Color (Color(Black, White), switch) where import Control.DeepSeq import GHC.Generics (Generic) data Color = White | Black deriving (Eq, Generic, NFData) instance Show Color where show Black = "-" show White = "+" switch :: Color -> Color switch B...
null
https://raw.githubusercontent.com/lndl/chesssimple/dec08b72d72bc9dee62a11486c8d2b5126de612a/Chesssimple/Color.hs
haskell
# LANGUAGE DeriveGeneric , DeriveAnyClass # module Chesssimple.Color (Color(Black, White), switch) where import Control.DeepSeq import GHC.Generics (Generic) data Color = White | Black deriving (Eq, Generic, NFData) instance Show Color where show Black = "-" show White = "+" switch :: Color -> Color switch B...
67e96363e7cbaf0404800483f62f0ee98ba11bc7e36bf159d9d7ee620fa5f79f
haskellari/edit-distance
SquareSTUArray.hs
# LANGUAGE PatternGuards , ScopedTypeVariables , BangPatterns , Trustworthy # module Text.EditDistance.SquareSTUArray ( levenshteinDistance, levenshteinDistanceWithLengths, restrictedDamerauLevenshteinDistance, restrictedDamerauLevenshteinDistanceWithLengths ) where import Text.EditDistance.EditCosts impo...
null
https://raw.githubusercontent.com/haskellari/edit-distance/5521afd4f4966a947499a16cfc7ce6d9e0a028ee/Text/EditDistance/SquareSTUArray.hs
haskell
Create string arrays Create array of costs. Say we index it by (i, j) where i is the column index and j the row index. Return an actual answer Create string arrays Create array of costs. Say we index it by (i, j) where i is the column index and j the row index. Return an actual answer
# LANGUAGE PatternGuards , ScopedTypeVariables , BangPatterns , Trustworthy # module Text.EditDistance.SquareSTUArray ( levenshteinDistance, levenshteinDistanceWithLengths, restrictedDamerauLevenshteinDistance, restrictedDamerauLevenshteinDistanceWithLengths ) where import Text.EditDistance.EditCosts impo...
aef66895fe2b177efbb54ea3395cfdf6eea594099df4a30e24775d1bf2d38e9b
BradWBeer/clinch
package.lisp
package.lisp Please see the licence.txt for the CLinch (defpackage #:clinch (:use #:cl) ;;(:shadow ) (:import-from :rtg-math.vectors :v!) (:export #:*uncollected* #:defevent #:*controllers* #:*haptic* #:*texture* #:*entity* ;; run in main (opengl) thread. Returns when done. #:! ...
null
https://raw.githubusercontent.com/BradWBeer/clinch/421de1e4844a5142e37cb06805bc2d9d13ba048f/package.lisp
lisp
(:shadow ) run in main (opengl) thread. Returns when done. run in main (opengl) thread but returns immediately. Make a vector from the arguments shortcut to reset an object shortcuts to reset node translation, rotation and scaling respectively. shortcuts to set or perform node translation, rotation and scaling re...
package.lisp Please see the licence.txt for the CLinch (defpackage #:clinch (:use #:cl) (:import-from :rtg-math.vectors :v!) (:export #:*uncollected* #:defevent #:*controllers* #:*haptic* #:*texture* #:*entity* #:! #:!! #:v! #:!0 #:!t0 #:!r0 #:!s0 #:!t ...
90710261d42efda7976af2bb70d6f9358bfc24761e97535d4659e74018aadaba
cljfx/cljfx
chart.clj
(ns cljfx.fx.chart "Part of a public API" (:require [cljfx.composite :as composite] [cljfx.coerce :as coerce] [cljfx.lifecycle :as lifecycle] [cljfx.fx.region :as fx.region]) (:import [javafx.scene.chart Chart] [javafx.geometry Side])) (set! *warn-on-reflection* tru...
null
https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/src/cljfx/fx/chart.clj
clojure
overrides definitions
(ns cljfx.fx.chart "Part of a public API" (:require [cljfx.composite :as composite] [cljfx.coerce :as coerce] [cljfx.lifecycle :as lifecycle] [cljfx.fx.region :as fx.region]) (:import [javafx.scene.chart Chart] [javafx.geometry Side])) (set! *warn-on-reflection* tru...
f291c66832e87da73adc27b12b6f9ab7f5731da116956a5762c636b6b5ae387a
marigold-dev/deku
print.ml
let instr oc width e = Sexpr.output oc width (Arrange.instr e) let func oc width f = Sexpr.output oc width (Arrange.func f) let module_ oc width m = Sexpr.output oc width (Arrange.module_ m) let script oc width mode s = List.iter (Sexpr.output oc width) (Arrange.script mode s)
null
https://raw.githubusercontent.com/marigold-dev/deku/a26f31e0560ad12fd86cf7fa4667bb147247c7ef/deku-c/interpreter/text/print.ml
ocaml
let instr oc width e = Sexpr.output oc width (Arrange.instr e) let func oc width f = Sexpr.output oc width (Arrange.func f) let module_ oc width m = Sexpr.output oc width (Arrange.module_ m) let script oc width mode s = List.iter (Sexpr.output oc width) (Arrange.script mode s)
ecaaae756ab04f00c82991ef9a404e68cfe2c0efcf16336ac300ad9d02e3151d
careercup/CtCI-6th-Edition-Clojure
chapter_4_q7_test.clj
(ns ^{:author "Leeor Engel"} chapter-4.chapter-4-q7-test (:require [clojure.test :refer :all] [chapter-4.chapter-4-q7 :refer :all])) (deftest build-order-test (let [projects [:a :b :c :d :e :f] dependencies [[:d :a] [:b :f] [:d :b] ...
null
https://raw.githubusercontent.com/careercup/CtCI-6th-Edition-Clojure/ef151b94978af82fb3e0b1b0cd084d910870c52a/test/chapter_4/chapter_4_q7_test.clj
clojure
(ns ^{:author "Leeor Engel"} chapter-4.chapter-4-q7-test (:require [clojure.test :refer :all] [chapter-4.chapter-4-q7 :refer :all])) (deftest build-order-test (let [projects [:a :b :c :d :e :f] dependencies [[:d :a] [:b :f] [:d :b] ...
a9ed7799a855f53d24c68f52282b95ee3943e19f5b9cffc1e31b15e8add1dad1
MassD/99
p71_STAR.ml
Determine the internal path length of a tree . ( easy ) We define the internal path length of a multiway tree as the total sum of the path lengths from the root to all nodes of the tree . By this definition , the tree t in the figure of the previous problem has an internal path length of 9 . Write a function ipl ...
null
https://raw.githubusercontent.com/MassD/99/1d3019eb55b0d621ed1df4132315673dd812b1e1/70c-73-multiway-trees/p71_STAR.ml
ocaml
Determine the internal path length of a tree . ( easy ) We define the internal path length of a multiway tree as the total sum of the path lengths from the root to all nodes of the tree . By this definition , the tree t in the figure of the previous problem has an internal path length of 9 . Write a function ipl ...
c08bcabbfa70cec64ce061d2a3011dde7257ee89e87ee662f2c2061e3860d5b9
conal/lub
AssocRepr.hs
# LANGUAGE TypeFamilies , FlexibleContexts # # OPTIONS_GHC -Wall # ---------------------------------------------------------------------- -- | -- Module : Data.AssocRepr Copyright : ( c ) Conal Elliott 2008 -- License : BSD3 -- -- Maintainer : -- Stability : experimental -- Compute least upp...
null
https://raw.githubusercontent.com/conal/lub/3a146841d1502febf3951d31ec963a4334cd1751/src/Data/AssocRepr.hs
haskell
-------------------------------------------------------------------- | Module : Data.AssocRepr License : BSD3 Maintainer : Stability : experimental -------------------------------------------------------------------- Reprs. TODO: find & use a simple, standard generic programming framework....
# LANGUAGE TypeFamilies , FlexibleContexts # # OPTIONS_GHC -Wall # Copyright : ( c ) Conal Elliott 2008 Compute least upper bounds ( lub / join ) of two values This version uses associated types for HasRepr module Data.AssocRepr (HasRepr(..), onRepr, onRepr2) where class HasRepr t where type Repr t re...
5045d433ad360f5d415c1c79a67acc4404c4dfa5115fbf7d1121afb5a18557f0
cognitect-labs/onto
project.clj
(defproject com.cognitect/onto "0.1.2-SNAPSHOT" :description "Ontological inferencing for Datomic" :license {:name "Eclipse Public License" :url "-v10.html"} :plugins [[codox "0.8.10"]] :dependencies [[org.clojure/clojure "1.9.0"] [com.datomic/datomic-fr...
null
https://raw.githubusercontent.com/cognitect-labs/onto/56eee1833254b902ec7bcf6b82d36e611c1ae207/project.clj
clojure
(defproject com.cognitect/onto "0.1.2-SNAPSHOT" :description "Ontological inferencing for Datomic" :license {:name "Eclipse Public License" :url "-v10.html"} :plugins [[codox "0.8.10"]] :dependencies [[org.clojure/clojure "1.9.0"] [com.datomic/datomic-fr...
102be3bc40a751a9e8a2fdd2577f304757d34549371471664d4816189fcaedf2
input-output-hk/cardano-ledger-byron
Buildable.hs
# LANGUAGE TemplateHaskell # module Test.Cardano.Chain.Buildable ( tests ) where import Cardano.Prelude import Test.Cardano.Prelude import Formatting (Buildable, build, sformat) import Cardano.Chain.Common ( Attributes(Attributes) , UnparsedFields(UnparsedFields) ) import Hedgehog (PropertyT, eval, prope...
null
https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/test/Test/Cardano/Chain/Buildable.hs
haskell
------------------------------------------------------------------------------ Test helpers ------------------------------------------------------------------------------ | Check that the 'Buildable' instance for @a@ doesn't throw exceptions ----------------------------------------------------------------------------...
# LANGUAGE TemplateHaskell # module Test.Cardano.Chain.Buildable ( tests ) where import Cardano.Prelude import Test.Cardano.Prelude import Formatting (Buildable, build, sformat) import Cardano.Chain.Common ( Attributes(Attributes) , UnparsedFields(UnparsedFields) ) import Hedgehog (PropertyT, eval, prope...
4ffe963e17f2a6f4ccb8f8ac98e6107cb41e6269a85b85bc73783251e608446f
brick-lang/kekka
inferMonad.ml
open Core open Common open InferKind type kst = KSub.t type kenv = { current_module : Name.t; imports : ImportMap.t; kgamma : KGamma.t; infgamma : InfKGamma.t; synonyms : Synonyms.t } type 'a kresult = { result: 'a; (* errors: (range * doc) list; *) (* warnings: (range * doc) list; *) st: kst; } ...
null
https://raw.githubusercontent.com/brick-lang/kekka/7ede659ffb49959b140e6ab0a72d38ff6c63311b/kindEngine/inferMonad.ml
ocaml
errors: (range * doc) list; warnings: (range * doc) list; kinfer errors=errs1^errs2; warnings=warns1^warns2; ********************************************************************* * Operations ********************************************************************* * Extend the inference kind assumption; checks f...
open Core open Common open InferKind type kst = KSub.t type kenv = { current_module : Name.t; imports : ImportMap.t; kgamma : KGamma.t; infgamma : InfKGamma.t; synonyms : Synonyms.t } type 'a kresult = { result: 'a; st: kst; } module Let_syntax = struct type 'a t = kenv -> kst -> 'a kresult let ...
3ee7efae0c8f423e890c9444fe6dc68d0ea4d10001029d63611eec6c31ac66fe
karamellpelle/grid
Button.hs
grid is a game written in Haskell Copyright ( C ) 2018 -- -- This file is part of grid. -- -- grid 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 optio...
null
https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/source/Game/Run/Eggs/Button.hs
haskell
This file is part of grid. grid is free software: you can redistribute it and/or modify (at your option) any later version. grid 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 GN...
grid is a game written in Haskell Copyright ( C ) 2018 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 module Game.Run.Eggs.Button ( EggButton (..),...
da289ab8285aef34eff69635872eefb85a81b5ec2b1341788abcba8e5ce0fc1d
elastic/eui-cljs
color_picker_swatch.cljs
(ns eui.color-picker-swatch (:require ["@elastic/eui/lib/components/color_picker/color_picker_swatch.js" :as eui])) (def EuiColorPickerSwatch eui/EuiColorPickerSwatch)
null
https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/color_picker_swatch.cljs
clojure
(ns eui.color-picker-swatch (:require ["@elastic/eui/lib/components/color_picker/color_picker_swatch.js" :as eui])) (def EuiColorPickerSwatch eui/EuiColorPickerSwatch)
45a4387d3761c7c5ca115d2f771050f1ab83f65df3a83b6614eb3a130142f7bc
capnproto/capnp-ocaml
codecs.ml
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * capnp - ocaml * * Copyright ( c ) 2013 - 2014 , * All rights reserved . * * Redistribution and use in source and binary forms , with or without ...
null
https://raw.githubusercontent.com/capnproto/capnp-ocaml/cadb5f8d9138f51d2dd3a7867dabc0c17b7d4ba2/src/runtime/codecs.ml
ocaml
* less than a full frame is available * frame header describes a segment count or segment size that is too large for the implementation * Primary storage for incoming stream segments. * Partially-decoded frame information Now we know the full header size, so try to get the whole thing * Pa...
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * capnp - ocaml * * Copyright ( c ) 2013 - 2014 , * All rights reserved . * * Redistribution and use in source and binary forms , with or without ...
417b6d6de5a593c2bece06edb1f25c3c649fa223491a32186549ed1814cde142
shirok/Gauche
mime-port.scm
;;; ;;; mime-port.scm - submodule to read from mime part body ;;; Copyright ( c ) 2000 - 2022 < > ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code mu...
null
https://raw.githubusercontent.com/shirok/Gauche/b773899dbe0b2955e1c4f1daa066da874070c1e4/lib/rfc/mime-port.scm
scheme
mime-port.scm - submodule to read from mime part body Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions an...
Copyright ( c ) 2000 - 2022 < > " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING (define-module rfc.mime-port (use gauche.u...
4e9e91795bb0fc21a0cde31d27e95fa5aa4f90f379fed4d7a6523969579b10cb
alejandrogallo/keyboard-lab
Cutting.hs
module Cutting where import Diagrams.Prelude cutting = green engraving = orange
null
https://raw.githubusercontent.com/alejandrogallo/keyboard-lab/e261933a5c4ff3733ccbd951b8830b9dc66bbd32/Cutting.hs
haskell
module Cutting where import Diagrams.Prelude cutting = green engraving = orange
b7ff0265f8a960d1a592a5a1ab9cdf3b7abb7a9983669b65d4606bedd774a63e
taktoa/hsdm
Main.hs
module Main where import qualified System.HSDM main :: IO () main = System.HSDM.main
null
https://raw.githubusercontent.com/taktoa/hsdm/e088ddbd20da76ac40450ae4cca9b1f87d042c58/haskell/src/Main.hs
haskell
module Main where import qualified System.HSDM main :: IO () main = System.HSDM.main
be591f2c66082fcff9069b49d463573cc5a72d595bff76219324ebb817498476
joeyadams/haskell-iocp
Clock.hs
module IOCP.Clock ( Clock, Seconds, getTime, getClock, -- * Specific implementations queryPerformanceCounter, getTickCount64, getTickCount, ) where import qualified IOCP.FFI as FFI import Control.Monad (liftM) import Data.IORef import Data.Int (Int32) import Data.Word (Word3...
null
https://raw.githubusercontent.com/joeyadams/haskell-iocp/67b65759b3d1473770533f782ca7a42131ae2ca7/IOCP/Clock.hs
haskell
* Specific implementations | Figure out what time API to use, and return a 'Clock' for accessing it. counter and updating it every time the clock is used. properly. However, convert the offset from unsigned to signed, to avoid a bogus result if now is earlier than before (which should never happen). Add the off...
module IOCP.Clock ( Clock, Seconds, getTime, getClock, queryPerformanceCounter, getTickCount64, getTickCount, ) where import qualified IOCP.FFI as FFI import Control.Monad (liftM) import Data.IORef import Data.Int (Int32) import Data.Word (Word32, Word64) | Monotonic clock ne...
beefe3a78d3b992a25bea7fe3900200764d440a61a2766033eb486ea31038866
xh4/web-toolkit
package.lisp
(in-package :cl-user) (defpackage :utility (:nicknames :wt.utility) (:use :cl :alexandria) (:export ;; tree :walk-tree :map-tree ;; string :string-prefix-p :string-suffix-p ;; function :function-lambda-list ;; class :replace-class-option :rewrite-class-option ;; parser :par...
null
https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/utility/package.lisp
lisp
tree string function class parser
(in-package :cl-user) (defpackage :utility (:nicknames :wt.utility) (:use :cl :alexandria) (:export :walk-tree :map-tree :string-prefix-p :string-suffix-p :function-lambda-list :replace-class-option :rewrite-class-option :parser :define-parser :define-traced-parser :parse :*pa...
3963ed49cb489079e3e920cae2c247c1acd9c2752272b0c5524cf373c2f3854a
rotatef/json-streams
fail33.lisp
() (:begin-array "mismatch" :error)
null
https://raw.githubusercontent.com/rotatef/json-streams/5da012e8133affbf75024e7500feb37394690752/tests/json.org/fail33.lisp
lisp
() (:begin-array "mismatch" :error)
e3e975c04e37ddc56ff18de5fe9f183a35e3df9c29e13e9ab8b66ee50e1f5ed6
albertoruiz/easyVision
play6.hs
import Vision.GUI import Image.Processing import System.Random(randomIO) import Util.Misc(splitEvery) import Util.Statistics(mean) import Control.Concurrent(threadDelay) main = runT_ rnd $ see "x" >>> freqMonitor >>> arrL f >>> see "mean" >>> freqMonitor see name = observe name (te...
null
https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/tour/play6.hs
haskell
import Vision.GUI import Image.Processing import System.Random(randomIO) import Util.Misc(splitEvery) import Util.Statistics(mean) import Control.Concurrent(threadDelay) main = runT_ rnd $ see "x" >>> freqMonitor >>> arrL f >>> see "mean" >>> freqMonitor see name = observe name (te...
4dadfaba42e52ffdd611d6171dae85f329161dda91569428b198faadd5fb7291
cram2/cram
matrix-minmax-index.lisp
Regression test MATRIX - MINMAX - INDEX for GSLL , automatically generated ;; Copyright 2009 , 2011 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 GNU General Public License as published by ...
null
https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/matrix-minmax-index.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...
Regression test MATRIX - MINMAX - INDEX for GSLL , automatically generated Copyright 2009 , 2011 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 , either version 3 of the License , or You sho...
28a3eb2e49e5bf5f68681ffd5dfa1bc6d825f9f44b95a1139ec735ded8518fed
input-output-hk/ouroboros-network
Driver.hs
| Drivers for running ' Peer 's with a ' Codec ' and a ' Channel ' . -- module Ouroboros.Network.Driver ( -- * Normal peers runPeer , runPeerWithLimits , TraceSendRecv (..) * peers , runPipelinedPeer , runPipelinedPeerWithLimits ) where import Ouroboros.Network.Driver.Limits import ...
null
https://raw.githubusercontent.com/input-output-hk/ouroboros-network/6c15a8093bac34091ad96af2b8b0d1f7fe54b732/ouroboros-network-framework/src/Ouroboros/Network/Driver.hs
haskell
* Normal peers
| Drivers for running ' Peer 's with a ' Codec ' and a ' Channel ' . module Ouroboros.Network.Driver runPeer , runPeerWithLimits , TraceSendRecv (..) * peers , runPipelinedPeer , runPipelinedPeerWithLimits ) where import Ouroboros.Network.Driver.Limits import Ouroboros.Network.D...
322eb85fdae7d73a58c94bda065284a235de23adcdb65c07ef96fa45bf5ce6d2
ygrek/mldonkey
filename2.mli
Copyright 2001 , 2002 b8_bavard , b8_fee_carabine , This file is part of mldonkey . mldonkey 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 ...
null
https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/utils/cdk/filename2.mli
ocaml
* character used as a directory separator in file paths d [normalize filename] returns a normalized name for [filename], where no "//", "<name>/.." or "/./" are present. d [last_extension filename] returns the last extension of [filename], which is the substring after the last "." in [filename] (including the "...
Copyright 2001 , 2002 b8_bavard , b8_fee_carabine , This file is part of mldonkey . mldonkey 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 ...
d2989b420ac3667de105b005dc7f0db3e5729ff6f0d033398474ec793c09759a
elaforge/karya
Library.hs
Copyright 2014 -- This program is distributed under the terms of the GNU General Public -- License 3.0, see COPYING or -3.0.txt {-# LANGUAGE RankNTypes #-} | Utilities for the Library type . module Derive.Library ( -- * make Library, library, generators, transformers, vals, pattern , ToLibrary, Entry...
null
https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Derive/Library.hs
haskell
This program is distributed under the terms of the GNU General Public License 3.0, see COPYING or -3.0.txt # LANGUAGE RankNTypes # * make * compile | The holds the libary of statically-declared calls. It gets compiled to 'Derive.Builtins' by 'compile'. * make | This is just a specialization of 'library', just ...
Copyright 2014 | Utilities for the Library type . module Derive.Library ( Library, library, generators, transformers, vals, pattern , ToLibrary, Entry(..) , Calls(..), both , poly_generators, poly_transformers , Shadowed, compile, compile_log ) where import qualified Data.Either as Either imp...
c0d7a931462bcb8f785327289028f10c3159b7bf2929a9268994577d5cebeb78
chvanikoff/cowboy_session
cowboy_session_storage.erl
-module(cowboy_session_storage). -author('chvanikoff <>'). -type error() :: {already_started, pid()} | term(). -callback start_link() -> {ok, pid()} | ignore | {error, error()}. -callback new(SID) -> ok when SID :: bitstring(). -callback set(SID, Key, Value) -> ok when SID :: bitstring(), Key :: term(), Value :...
null
https://raw.githubusercontent.com/chvanikoff/cowboy_session/11950a69686c10c7dad5c5fe2f21f7af0d8cf816/src/cowboy_session_storage.erl
erlang
-module(cowboy_session_storage). -author('chvanikoff <>'). -type error() :: {already_started, pid()} | term(). -callback start_link() -> {ok, pid()} | ignore | {error, error()}. -callback new(SID) -> ok when SID :: bitstring(). -callback set(SID, Key, Value) -> ok when SID :: bitstring(), Key :: term(), Value :...
836fe8e7e04156b906f1c75bf7f40dc2228534731cc9f2fb599a58537243a5bc
imandra-ai/imandra-ros
bond_to_json.ml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Bond;; let status_to_json x = [ ( "header" , x.header |> Std_msgs_to_json.header_to_json ); ( "id" , x.id |> string_to_json ); ( "instance_id" , x.instance_id |> string_to_json ); ( "active" , x.active |> bool_to_json ); ( "heartbeat_ti...
null
https://raw.githubusercontent.com/imandra-ai/imandra-ros/e1380c267ee319dd4f86c4b54e0b270bc0738796/imandra_model/src-messages-pp/bond_to_json.ml
ocaml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Bond;; let status_to_json x = [ ( "header" , x.header |> Std_msgs_to_json.header_to_json ); ( "id" , x.id |> string_to_json ); ( "instance_id" , x.instance_id |> string_to_json ); ( "active" , x.active |> bool_to_json ); ( "heartbeat_ti...
e898cf29d991b2c0c2b0857f08379203c9f62e84d985d629dc6583e1c8fe8f11
camllight/camllight
prop.mli
type proposition = Vrai | Faux | Non of proposition | Et of proposition * proposition | Ou of proposition * proposition | Implique of proposition * proposition | Équivalent of proposition * proposition | Variable of string;; exception Réfutation of (string * bool) list;; value vérifie_tautolo...
null
https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/examples/demonstr/prop.mli
ocaml
type proposition = Vrai | Faux | Non of proposition | Et of proposition * proposition | Ou of proposition * proposition | Implique of proposition * proposition | Équivalent of proposition * proposition | Variable of string;; exception Réfutation of (string * bool) list;; value vérifie_tautolo...
da6464765ee8e04b9c45a34fdd565087c9428ea4e976491d5c7d39c31fbad3d6
fluree/db
retraction_test.clj
(ns fluree.db.transact.retraction-test (:require [clojure.test :refer :all] [fluree.db.test-utils :as test-utils] [fluree.db.json-ld.api :as fluree])) (deftest ^:integration retracting-data (testing "Retractions of individual properties and entire subjects." (let [conn (test-u...
null
https://raw.githubusercontent.com/fluree/db/ef55f39b24f2c9d0770e6cfd096c8337e0040439/test/fluree/db/transact/retraction_test.clj
clojure
(ns fluree.db.transact.retraction-test (:require [clojure.test :refer :all] [fluree.db.test-utils :as test-utils] [fluree.db.json-ld.api :as fluree])) (deftest ^:integration retracting-data (testing "Retractions of individual properties and entire subjects." (let [conn (test-u...
8af840a9299f4a2dd95d75e579031083f8bc9c17d0ebd4ee8d5aab01d370d22c
zotonic/ringbuffer
ringbuffer_app.erl
@author < > 2021 @doc RingBuffer application Copyright 2021 %% 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/zotonic/ringbuffer/5c27f3dcadb20eefa30f165f0836781236bfa289/src/ringbuffer_app.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing perm...
@author < > 2021 @doc RingBuffer application Copyright 2021 Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(ringbuffer_app). -behaviour(application). -export([start/2, stop/1]). @doc Applicatio...
cd3a3f33ed8f28980b065aa1c4177dc14ca4cf033560c85c947058bd524e4816
stumpwm/stumpwm-contrib
stump-nm.lisp
(in-package #:stump-nm) (stumpwm:defcommand nm-list-wireless-networks () () (with-open-bus (bus (system-server-addresses)) (let* ((root (make-root bus)) (primary-connection (primary-connection root)) (is-connected (= (getprop root "State") 70)) (is-wireless (search "wireless" (ge...
null
https://raw.githubusercontent.com/stumpwm/stumpwm-contrib/a7dc1c663d04e6c73a4772c8a6ad56a34381096a/util/stump-nm/stump-nm.lisp
lisp
(in-package #:stump-nm) (stumpwm:defcommand nm-list-wireless-networks () () (with-open-bus (bus (system-server-addresses)) (let* ((root (make-root bus)) (primary-connection (primary-connection root)) (is-connected (= (getprop root "State") 70)) (is-wireless (search "wireless" (ge...
dc5a5791c36b1bfd842e4f529e2df6542f69dbbb7009a3ad78bba150ffccd391
DianaPajon/tiger
TigerSeman.hs
# LANGUAGE TupleSections # module TigerSeman where import TigerAbs import TigerErrores as E import TigerSres import TigerSymbol import TigerTips import TigerUnique Segunda parte imports : import TigerTemp import TigerTrans...
null
https://raw.githubusercontent.com/DianaPajon/tiger/30d360f02f5fc57883f988a1cbb581208ecd2744/src/TigerSeman.hs
haskell
Monads Data Debugging. 'trace :: String -> a -> a' ** Notas : no definidas. que van a tener que reescribir bastante. | Inserta una Variable al entorno | Funciones de Debugging! sort topológico. | Generador de uniques. | Patrón de errores... comparables. Ver 'transExp (RecordExp ...)' de la variable a l...
# LANGUAGE TupleSections # module TigerSeman where import TigerAbs import TigerErrores as E import TigerSres import TigerSymbol import TigerTips import TigerUnique Segunda parte imports : import TigerTemp import TigerTrans...
c2723720641b9ccbf60a3ecd27275aa7e5efe763e41a962e34771ce71a36cd8f
e-bigmoon/haskell-blog
Email.hs
#!/usr/bin/env stack {- stack repl --resolver lts-15.4 --package blaze-html --package http-conduit --package mime-mail --package monad-logger --package persistent-sqlite --package persistent-template --package shakespeare --package text --package yesod --package yesod-auth -} {-#...
null
https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/ch14/Email.hs
haskell
stack repl --resolver lts-15.4 --package blaze-html --package http-conduit --package mime-mail --package monad-logger --package persistent-sqlite --package persistent-template --package shakespeare --package text --package yesod --package yesod-auth # LANGUAGE DeriveDataTypeabl...
#!/usr/bin/env stack # LANGUAGE FlexibleContexts # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE InstanceSigs # # LANGUAGE MultiParamTypeClasses # # LANGUAGE StandaloneDeriving # # LANGUAGE TypeFamilies # import Control.Monad (join) ...
0cb4632ba5e3232105df88a463c34af8a0967a934b4939bd57ec59b0720e71c5
masateruk/micro-caml
sum.ml
let () = let rec sum x = if x <= 0 then 0 else sum (x - 1) + x in print_int (sum 1000)
null
https://raw.githubusercontent.com/masateruk/micro-caml/0c0bd066b87cf54ce33709355c422993a85a86a1/test/sum.ml
ocaml
let () = let rec sum x = if x <= 0 then 0 else sum (x - 1) + x in print_int (sum 1000)
8d49120a9bfe040641c8c21a4985157e38c5208e1486d8a6687f14e7faedbbb9
mhuebert/inside-out
macros.cljc
(ns inside-out.macros (:refer-clojure :exclude [meta]) (:require [clojure.string :as str] [clojure.zip :as z] [inside-out.util :as util] [re-db.hooks :as hooks] [re-db.reactive :as r]) #?(:cljs (:require-macros inside-out.macros))) (defn replace-toplevel [pmap form...
null
https://raw.githubusercontent.com/mhuebert/inside-out/f38b49e8b8f8242d2c0112932e11300ddb2bc47a/src/inside_out/macros.cljc
clojure
utility macros helper functions working with field variables unwraps fields wrapped in lists handling ?field metadata metadata inference: you can pass your own `:infer-meta` function as an option to `with-form*` if these are not sufficient for your use-case core analysis/macro fields know their own symbol...
(ns inside-out.macros (:refer-clojure :exclude [meta]) (:require [clojure.string :as str] [clojure.zip :as z] [inside-out.util :as util] [re-db.hooks :as hooks] [re-db.reactive :as r]) #?(:cljs (:require-macros inside-out.macros))) (defn replace-toplevel [pmap form...
d3a0bb7a077277c01d6dfbd3341e2ceb2615b6e9d644c7c697ed8480adcf9728
letmaik/monadiccp
Alpha.hs
# LANGUAGE TypeFamilies # # LANGUAGE FlexibleContexts # A kid goes into a grocery store and buys four items . The cashier charges $ 7.11 . -- The kid pays and is about to leave when the cashier calls the kid back, and says " Hold on , I multiplied the four items instead of adding them ; I 'll try again ... Gosh...
null
https://raw.githubusercontent.com/letmaik/monadiccp/fe4498e46a7b9d9e387fd5e4ed5d0749a89d0188/examples/Alpha.hs
haskell
The kid pays and is about to leave when the cashier calls the kid back, and says
# LANGUAGE TypeFamilies # # LANGUAGE FlexibleContexts # A kid goes into a grocery store and buys four items . The cashier charges $ 7.11 . " Hold on , I multiplied the four items instead of adding them ; I 'll try again ... Gosh , with adding them the price still comes to $ 7.11 " ! What were the prices of the...
747f8b0d9a2f864eb36f767733e076edbccf1448dd6fbcc24223258f70d6edff
K2InformaticsGmbH/dderl
dderl_dal.erl
-module(dderl_dal). -behavior(gen_server). -include("dderl.hrl"). -export([init/1 ,start_link/0 ,handle_call/3 ,handle_cast/2 ,handle_info/2 ,terminate/2 ,code_change/3 ,format_status/2 ]). -export([get_adapters/1 ,add_adapter/2 ,add_com...
null
https://raw.githubusercontent.com/K2InformaticsGmbH/dderl/84697547fe8009db7964baa4eceb876fd78512a0/src/dderl_dal.erl
erlang
Privileges TODO: Validate result... TODO: At the moment the command and the view always have the same owner. Check for authorization. TODO: Handle multiple adapters. TODO: At the moment the command and the view always have the same owner. Check for authorization. TODO: At the moment the command and ...
-module(dderl_dal). -behavior(gen_server). -include("dderl.hrl"). -export([init/1 ,start_link/0 ,handle_call/3 ,handle_cast/2 ,handle_info/2 ,terminate/2 ,code_change/3 ,format_status/2 ]). -export([get_adapters/1 ,add_adapter/2 ,add_com...
25e048731d1b58583a9408eb9a71e896983894ac970a2888c82beffe27bf7f34
google/ormolu
proc-cases-out.hs
{-# LANGUAGE Arrows #-} foo f = proc a -> case a of Left b -> f -< b bar f g h j = proc a -> case a of Left ( (a, b) , (c, d) ) -> f (a <> c) -< b <> d Right (Left a) -> h -< a Right (Right b) -> j -< b
null
https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/value/function/arrow/proc-cases-out.hs
haskell
# LANGUAGE Arrows #
foo f = proc a -> case a of Left b -> f -< b bar f g h j = proc a -> case a of Left ( (a, b) , (c, d) ) -> f (a <> c) -< b <> d Right (Left a) -> h -< a Right (Right b) -> j -< b
349ff5f3f8e0e17db2f904da97d70a0504f48b9214f1ee17f4b0729abb83a448
release-project/benchmarks
util.erl
-module(util). -compile(export_all). -spec quit(string(),list()) -> ok. quit(Fmt,Args) -> io:format(Fmt,Args), init:stop(). % This isn't ideal. I think it only stops the current process, and there may % be other processes running. Specifically, if you put a non-existent node % in the nodes file, we get an er...
null
https://raw.githubusercontent.com/release-project/benchmarks/55f042dca3a2c680e2967c59edc9636456047bd5/ACO/SMP-ACO/util.erl
erlang
This isn't ideal. I think it only stops the current process, and there may be other processes running. Specifically, if you put a non-existent node in the nodes file, we get an error message but the start_aco function carries on and attempts to start a process on that node anyway. list_to_float doesn't like ".9"...
-module(util). -compile(export_all). -spec quit(string(),list()) -> ok. quit(Fmt,Args) -> io:format(Fmt,Args), init:stop(). -spec int_of_string(string()) -> integer(). int_of_string(S) -> try list_to_integer(S) catch error: _ -> quit ("Error: bad integer ~p~n", [S]) end. -spec float_of_str...
6261f244b6bd33aa248ad5d6b73b9ed587d1cd2e1e017234f25b48f3bb2f9b50
input-output-hk/voting-tools
Extended.hs
module Test.Cardano.API.Extended ( tests ) where import qualified Data.Aeson as Aeson import Hedgehog (Property, forAll, property, tripping) import Test.Tasty (TestTree, testGroup) import Test.Tasty.Hedgehog (testProperty) import qualified Cardano.Catalyst.Test.DSL.Gen as Gen tests...
null
https://raw.githubusercontent.com/input-output-hk/voting-tools/d14c5a456dc440b1dfe7901b6f19e53e8aadea12/test/Test/Cardano/API/Extended.hs
haskell
module Test.Cardano.API.Extended ( tests ) where import qualified Data.Aeson as Aeson import Hedgehog (Property, forAll, property, tripping) import Test.Tasty (TestTree, testGroup) import Test.Tasty.Hedgehog (testProperty) import qualified Cardano.Catalyst.Test.DSL.Gen as Gen tests...
cbf3cc6d8128a4d37216eea204ea0d98a7a8a755b19f1224286bc7e5a57a6d4c
haskell/containers
Set.hs
{-# LANGUAGE BangPatterns #-} module Main where import Control.DeepSeq (rnf) import Control.Exception (evaluate) import Test.Tasty.Bench (bench, defaultMain, whnf) import Data.List (foldl') import qualified Data.Set as S main = do let s = S.fromAscList elems :: S.Set Int s_even = S.fromAscList elems_even...
null
https://raw.githubusercontent.com/haskell/containers/0f4f7be103f4197272e48baaf9de809987b8dc9f/containers-tests/benchmarks/Set.hs
haskell
# LANGUAGE BangPatterns # insert delete reinsert toggle
module Main where import Control.DeepSeq (rnf) import Control.Exception (evaluate) import Test.Tasty.Bench (bench, defaultMain, whnf) import Data.List (foldl') import qualified Data.Set as S main = do let s = S.fromAscList elems :: S.Set Int s_even = S.fromAscList elems_even :: S.Set Int s_odd = ...
1167a0efff0d6a55aca5b193985193050a33d55b8713a780a1c8423080c5a3c9
osa1/sc-plugin
Renaming.hs
{-# LANGUAGE Rank2Types #-} # OPTIONS_GHC -fno - warn - missing - signatures # module Supercompile.Core.Renaming ( | Renaming, emptyRenaming, mkInScopeIdentityRenaming, mkIdentityRenaming, mkTyVarRenaming, mkRenaming, InScopeSet, emptyInScopeSet, mkInScopeSet, | PreRenamings PreRenaming, inver...
null
https://raw.githubusercontent.com/osa1/sc-plugin/1969ad81f16ca8ed8110ca8dadfccf6f3d463635/src/Supercompile/Core/Renaming.hs
haskell
# LANGUAGE Rank2Types # | Extending the renaming | Querying the renaming | Things with associated renamings | Renaming variables occurrences and binding sites | Renaming actual bits of syntax ever substitute variables for variables. The reasons for this are twofold: Unfortunately, in order to make this work w...
# OPTIONS_GHC -fno - warn - missing - signatures # module Supercompile.Core.Renaming ( | Renaming, emptyRenaming, mkInScopeIdentityRenaming, mkIdentityRenaming, mkTyVarRenaming, mkRenaming, InScopeSet, emptyInScopeSet, mkInScopeSet, | PreRenamings PreRenaming, invertRenaming, composeRenamings,...
6ee75e148a8176ccdac32c37f1e93996180ac97097086fc63c5f52749a82a941
rain-1/single_cream
rle.scm
;(define (run-length-decode v) ; (apply string-append (map (lambda (p) (make-string (car p) (cdr p))) v))) (define (run-length-encode s) ((lambda (n) (run-length-encode/loop s (- n 2) (string-ref s (- n 1)) 1 '())) (string-length s))) (define (run-length-encode/loop s i c k v) (if (negative? i) (co...
null
https://raw.githubusercontent.com/rain-1/single_cream/f8989fde4bfcffe0af7f6ed5916885446bf40124/t/rosetta/rle.scm
scheme
(define (run-length-decode v) (apply string-append (map (lambda (p) (make-string (car p) (cdr p))) v)))
(define (run-length-encode s) ((lambda (n) (run-length-encode/loop s (- n 2) (string-ref s (- n 1)) 1 '())) (string-length s))) (define (run-length-encode/loop s i c k v) (if (negative? i) (cons (cons k c) v) ((lambda (x) (if (char=? c x) (run-length-encode/loop s (- i 1) c (+ k 1) v) ...
3925255e37f44f239348cb796ac658e04b4c9fe8ce9928cbf6161b7d3397e490
uim/uim
generic-predict.scm
;;; generic-predict.scm: generic prediction base class ;;; Copyright ( c ) 2009 - 2013 uim Project ;;; ;;; 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 . Redistributions of sourc...
null
https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/scm/generic-predict.scm
scheme
generic-predict.scm: generic prediction base class All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: notice, this list of conditions and the following disclaimer. notice, this list of condit...
Copyright ( c ) 2009 - 2013 uim Project 1 . Redistributions of source code must retain the above copyright 2 . Redistributions in binary form must reproduce the above copyright 3 . Neither the name of authors nor the names of its contributors THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTOR...
169908a04b88c2ee75988fac6d2d2a88759c257dab75b87b0e8db3f847b2b2d4
racket/games
moves.rkt
#lang racket (require "board.rkt") ;; a move is either: ;; - (make-enter-piece pawn) ;; - (make-move-piece-main pawn start distance) ;; - (make-move-piece-home pawn start distance) (define-struct move () #:inspector (make-inspector)) (define-struct (enter-piece move) (pawn) #:inspector (make-inspecto...
null
https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/parcheesi/moves.rkt
racket
a move is either: - (make-enter-piece pawn) - (make-move-piece-main pawn start distance) - (make-move-piece-home pawn start distance) does not return the die moves that correspond to entering pawns board-doubles-penalty : board color -> board raises an exception if the turn is illegal has pieces in start ge...
#lang racket (require "board.rkt") (define-struct move () #:inspector (make-inspector)) (define-struct (enter-piece move) (pawn) #:inspector (make-inspector)) (define-struct (move-piece-main move) (pawn start distance) #:inspector (make-inspector)) (define-struct (move-piece-home move) (pawn start distance)...
d5efcd2369c55d81397dbe219eb2f4c0ca97039acbae36bc2eea10f2e53c4867
vonzhou/LearnYouHaskellForGreatGood
random_str3.hs
import System.Random main = do gen <- getStdGen putStrLn $ take 20 (randomRs ('a', 'z') gen) gen2 <- newStdGen putStrLn $ take 20 (randomRs ('a', 'z') gen2)
null
https://raw.githubusercontent.com/vonzhou/LearnYouHaskellForGreatGood/439d848deac53ef6da6df433078b7f1dcf54d18d/chapter9/random_str3.hs
haskell
import System.Random main = do gen <- getStdGen putStrLn $ take 20 (randomRs ('a', 'z') gen) gen2 <- newStdGen putStrLn $ take 20 (randomRs ('a', 'z') gen2)
1305b03062a31656d8259e649c254f9d267769bb0845e854611f6fc37511b394
oriansj/mes-m2
charalpha.scm
GNU --- Maxwell Equations of Software Copyright ( C ) 2008 Kragen ;;; This file is part of GNU . ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of the License , or ( ...
null
https://raw.githubusercontent.com/oriansj/mes-m2/b44fbc976ae334252de4eb82a57c361a195f2194/test/test058/charalpha.scm
scheme
you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Setup output file Tests for...
GNU --- Maxwell Equations of Software Copyright ( C ) 2008 Kragen This file is part of GNU . under the terms of the GNU General Public License as published by GNU is distributed in the hope that it will be useful , but You should have received a copy of the GNU General Public License along with GNU...
3e7355ae8060915784755b581f8d89aa0b6f211f6f1bd2cfdfce7577f585a2d6
onedata/op-worker
lfm_multipart_upload.erl
%%%------------------------------------------------------------------- @author ( C ) 2022 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . %%% @end %%%------------------------------------------------------------------- %%% @doc %%% This module performs multipart upl...
null
https://raw.githubusercontent.com/onedata/op-worker/71d2ac527f4d20ca40b8f5ae28b8107b68ca90e9/src/modules/logical_file_manager/lfm_submodules/lfm_multipart_upload.erl
erlang
------------------------------------------------------------------- @end ------------------------------------------------------------------- @doc This module performs multipart upload operations of lfm_submodules. @end ------------------------------------------------------------------- API ========================...
@author ( C ) 2022 ACK CYFRONET AGH This software is released under the MIT license cited in ' LICENSE.txt ' . -module(lfm_multipart_upload). -include("global_definitions.hrl"). -include("modules/logical_file_manager/lfm.hrl"). -include("proto/oneclient/fuse_messages.hrl"). -include("proto/oneprovider/provi...
1754392040777381801df98a0ccfe8e6a214b3af75ae1f625aa0f500beaa14bf
jixiuf/helloerlang
cluster.erl
-module(cluster). -export([slaves/1]). %% Argument: %% Hosts: List of hostname (string) cluster : slaves(["gateway " , " yaws1 " , " yaws2 " , " " , " " , " eddieware " ] ) . slaves([]) -> ok; slaves([Host|Hosts]) -> Args = erl_system_args(), NodeName = "cluster", {ok, Node} = slave:start_link(Hos...
null
https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/emysql-test/src/cluster.erl
erlang
Argument: Hosts: List of hostname (string) erl -rsh ssh -sname clustmaster slave:start_link("jf.org","c2","-rsh ssh -setcookie DJQWUOCYZCIZNETCXWES +Mea r10b ")
-module(cluster). -export([slaves/1]). cluster : slaves(["gateway " , " yaws1 " , " yaws2 " , " " , " " , " eddieware " ] ) . slaves([]) -> ok; slaves([Host|Hosts]) -> Args = erl_system_args(), NodeName = "cluster", {ok, Node} = slave:start_link(Host, NodeName, Args), io:format("Erlang node st...
c558eaeb645362406a5a7581e4aaed524de3e0b6046af8b003b43504c3784608
tschady/advent-of-code
d23_test.clj
(ns aoc.2018.d23-test (:require [aoc.2018.d23 :as sut] [clojure.test :refer :all])) (def test-input1 ["pos=<0,0,0>, r=4" "pos=<1,0,0>, r=1" "pos=<4,0,0>, r=3" "pos=<0,2,0>, r=1" "pos=<0,5,0>, r=3" "pos=<0,0,3>, r=1"...
null
https://raw.githubusercontent.com/tschady/advent-of-code/1e4a95ef580c3bf635837eff52aa998b0acfc666/test/aoc/2018/d23_test.clj
clojure
(ns aoc.2018.d23-test (:require [aoc.2018.d23 :as sut] [clojure.test :refer :all])) (def test-input1 ["pos=<0,0,0>, r=4" "pos=<1,0,0>, r=1" "pos=<4,0,0>, r=3" "pos=<0,2,0>, r=1" "pos=<0,5,0>, r=3" "pos=<0,0,3>, r=1"...
1c0145154b58ac31d0b5c5d804ac086860198897de2035c258d3cb9fa649ac9c
xavierleroy/camlidl
fixlabels.ml
(***********************************************************************) (* *) (* CamlIDL *) (* *) , projet ...
null
https://raw.githubusercontent.com/xavierleroy/camlidl/b192760875fe6e97b13004bd289720618e12ee22/compiler/fixlabels.ml
ocaml
********************************************************************* CamlIDL ...
, projet Cristal , INRIA Rocquencourt Copyright 1999 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed $ I d : fixlabels.ml , v 1.4 2001 - 06 - 17 10:50:24 xleroy Exp $ open Printf open Utils open Idltypes open...
5e6660fbee1999c2a586c3a00da5dccb02b1fffb9bb5826675df3986d9d130e9
pirapira/coq2rust
vm_printers.ml
open Format open Term open Names open Cbytecodes open Cemitcodes open Vm let ppripos (ri,pos) = (match ri with | Reloc_annot a -> let sp,i = a.ci.ci_ind in print_string ("annot : MutInd("^(string_of_mind sp)^","^(string_of_int i)^")\n") | Reloc_const _ -> print_string "structured constant\n" ...
null
https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/dev/vm_printers.ml
ocaml
open Format open Term open Names open Cbytecodes open Cemitcodes open Vm let ppripos (ri,pos) = (match ri with | Reloc_annot a -> let sp,i = a.ci.ci_ind in print_string ("annot : MutInd("^(string_of_mind sp)^","^(string_of_int i)^")\n") | Reloc_const _ -> print_string "structured constant\n" ...
f8c6e27762bd666ea567d3b8763acfaba216b3c15c49bfe560b2149d2cd2e476
mars0i/pasta
core.clj
This software is copyright 2016 , 2017 , 2018 , 2019 by , and is distributed under the Gnu General Public License version 3.0 ;; as specified in the the file LICENSE. ;(set! *warn-on-reflection* true) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Clojure main function , and other central utili...
null
https://raw.githubusercontent.com/mars0i/pasta/e835317c932611bfc09cc5a7cdeb4ccc7b6e1339/src/clj/pasta/core.clj
clojure
as specified in the the file LICENSE. (set! *warn-on-reflection* true) for *print-right-margin* Always handy at the repl defined by defsim: records args in commandline$, defined above if commandline options, default to no-gui unless use-gui is true a wrapper around sim/main
This software is copyright 2016 , 2017 , 2018 , 2019 by , and is distributed under the Gnu General Public License version 3.0 Clojure main function , and other central utility functions (ns pasta.core (:require [pasta.Sim :as sim] [pasta.GUI :as gui] (:gen-class)) (defn set-pprint-width "S...
a83e7eee3d34b3d6da56674bf726d45a16c419542e070fd9dcd5685cf6d8ebba
mentat-collective/fdg-book
utils.scm
Utilities I want to share between exercises . ;; Printing (load "exdisplay.scm") (define (replace-all haystack needle replacement) (let ((haystack (string->list haystack)) (replacement (reverse (string->list replacement))) (needle-len (string-length needle))) (let loop (...
null
https://raw.githubusercontent.com/mentat-collective/fdg-book/be6e03e4f917006fa46df956b448e922dd1dc853/scheme/org/utils.scm
scheme
Printing
Utilities I want to share between exercises . (load "exdisplay.scm") (define (replace-all haystack needle replacement) (let ((haystack (string->list haystack)) (replacement (reverse (string->list replacement))) (needle-len (string-length needle))) (let loop ((haystack ha...
eb2e86d02ed887ced76181ab60822b3f332343cf299c7fb01ea81ee6336a157a
racket/plot
snip2d.rkt
#lang racket/base (require racket/gui/base racket/class racket/contract racket/match racket/list racket/math plot/private/common/math plot/private/common/format plot/private/common/ticks plot/private/common/parameters plot/private/common/parameter-groups plot/priva...
null
https://raw.githubusercontent.com/racket/plot/c4126001f2c609e36c3aa12f300e9c673ab1a806/plot-gui-lib/plot/private/gui/snip2d.rkt
racket
assumes: (rect-known? rect) assumes (rect-known? rect) (printf "~a: new-plot-bounds-rect = ~v~n" only #t if clicked on snip Implementation notes: * the `plot-area` routine used to draw plots, expects the origin of `set-origin` call. TOP, RIGHT and BOTTOM values have to be adjusted accordingly. * plot Y axis ...
#lang racket/base (require racket/gui/base racket/class racket/contract racket/match racket/list racket/math plot/private/common/math plot/private/common/format plot/private/common/ticks plot/private/common/parameters plot/private/common/parameter-groups plot/priva...
d3ffaa72910dbec2e948a93d834e93c50608a38dc4599730271678c382cae33b
ragkousism/Guix-on-Hurd
markdown.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2015 > Copyright © 2015 < > Copyright © 2016 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free...
null
https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/markdown.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 © 2015 > Copyright © 2015 < > Copyright © 2016 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-module (gnu packages markdown) #:use-module (guix lic...
70b9e1aeb8f844cf189b220d378fb257ee6a4319654d3304216d8405beb184c9
LeventErkok/sbvPlugin
T26.hs
{-# OPTIONS_GHC -fplugin=Data.SBV.Plugin #-} module T26 where import Data.SBV.Plugin {-# ANN f theorem #-} f :: Bool f = False
null
https://raw.githubusercontent.com/LeventErkok/sbvPlugin/b6a6e94cd237a4f64f985783931bd7656e7a6a69/tests/T26.hs
haskell
# OPTIONS_GHC -fplugin=Data.SBV.Plugin # # ANN f theorem #
module T26 where import Data.SBV.Plugin f :: Bool f = False
45b77afe4c0a316cf3e0db8d4d075c36bf8e7dd22a4304beb99880a45d37c1df
russ/openpoker
game_start.erl
Copyright ( C ) 2005 - 2008 Wager Labs , SA %%%% %%%% THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS %%%% PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF %%%% THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICE...
null
https://raw.githubusercontent.com/russ/openpoker/62edd72a35b9ef52f55da9303cf1e06142e95895/src/game_start.erl
erlang
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERM...
Copyright ( C ) 2005 - 2008 Wager Labs , SA CREATIVE COMMONS PUBLIC LICENSE ( " CCPL " OR " LICENSE " ) . THE WORK IS -nc-sa/3.0/us/ -module(game_start). -export([start/3, game_start/3]). -include("common.hrl"). -include("game.hrl"). -include("texas.hrl"). -include("pp.hrl"). -define(DELAY, 15000). start(Gam...
14b1a44cf02e3b709bba98b255b99650ebccbb716d32376967e9c9258287cfda
oasis-open/openc2-lycan-beam
scan_SUITE.erl
@author ( C ) 2018 , sFractal Consulting LLC %%% -module(scan_SUITE). -author("Duncan Sparrell"). -license("MIT"). -copyright("2018, Duncan Sparrell sFractal Consulting LLC"). %%%------------------------------------------------------------------- Copyright ( c ) 2018 , , sFractal Consulting MIT License %...
null
https://raw.githubusercontent.com/oasis-open/openc2-lycan-beam/c8a580eb79a46cb3fa7db0d6576bfa23eb78c943/haga/erlang/haga/apps/haga/test/scan_SUITE.erl
erlang
------------------------------------------------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or Software...
@author ( C ) 2018 , sFractal Consulting LLC -module(scan_SUITE). -author("Duncan Sparrell"). -license("MIT"). -copyright("2018, Duncan Sparrell sFractal Consulting LLC"). Copyright ( c ) 2018 , , sFractal Consulting MIT License ( the " Software " ) , to deal in the Software without restriction , sel...
dd6ff4d71d87228d687a650e6d2612c35075aba4a759cfb863b50cb122101f91
carl-eastlund/mischief
main.rkt
#lang racket/base (require mischief/require) (module+ test (require rackunit/docs-complete)) (module+ reflection (require scribble/manual) (provide phase-1-exports phase-0-exports) (define phase-1-exports empty) (define phase-0-exports empty)) (define-syntax-rule (require/provide-phase-1 mod-path ...) (b...
null
https://raw.githubusercontent.com/carl-eastlund/mischief/ce58c3170240f12297e2f98475f53c9514225825/mischief/main.rkt
racket
#lang racket/base (require mischief/require) (module+ test (require rackunit/docs-complete)) (module+ reflection (require scribble/manual) (provide phase-1-exports phase-0-exports) (define phase-1-exports empty) (define phase-0-exports empty)) (define-syntax-rule (require/provide-phase-1 mod-path ...) (b...
5d01fa107834cf9e73bebaed6bdf005aae42263bb9272320e4618bafa9604697
haskell-webgear/webgear
QueryParam.hs
# OPTIONS_GHC -Wno - orphans # | OpenApi implementation of ' QueryParam ' trait . module WebGear.OpenApi.Trait.QueryParam where import Data.OpenApi ( Param (..), ParamLocation (ParamQuery), Referenced (Inline), ToSchema, toSchema, ) import Data.Proxy (Proxy (Proxy)) import Data.String (fromString) import...
null
https://raw.githubusercontent.com/haskell-webgear/webgear/52e90e28d81e4ce6d7c8e63b3f9769f6629b031f/webgear-openapi/src/WebGear/OpenApi/Trait/QueryParam.hs
haskell
# OPTIONS_GHC -Wno - orphans # | OpenApi implementation of ' QueryParam ' trait . module WebGear.OpenApi.Trait.QueryParam where import Data.OpenApi ( Param (..), ParamLocation (ParamQuery), Referenced (Inline), ToSchema, toSchema, ) import Data.Proxy (Proxy (Proxy)) import Data.String (fromString) import...
f988edaf151d04d088f1f162f4a97c3843e8357334b1a59e96df079842283cfd
fpco/ide-backend
CopyFile.hs
# LANGUAGE CPP # {-# OPTIONS_HADDOCK hide #-} module Distribution.Compat.CopyFile ( copyFile, copyFileChanged, filesEqual, copyOrdinaryFile, copyExecutableFile, setFileOrdinary, setFileExecutable, setDirOrdinary, ) where import Control.Monad ( when, unless ) import Control.Exception ...
null
https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.22.0.0/Distribution/Compat/CopyFile.hs
haskell
# OPTIONS_HADDOCK hide # file perms -rw-r--r-- file perms -rwxr-xr-x | Copies a file to a new destination. Often you should use `copyFileChanged` instead. | Like `copyFile`, but does not touch the target if source and destination are already byte-identical. This is recommended as it is useful for time-stamp base...
# LANGUAGE CPP # module Distribution.Compat.CopyFile ( copyFile, copyFileChanged, filesEqual, copyOrdinaryFile, copyExecutableFile, setFileOrdinary, setFileExecutable, setDirOrdinary, ) where import Control.Monad ( when, unless ) import Control.Exception ( bracket, bracketOnError, ...
dd6dd1878afeab7dd236becd6d604364da61b3f6d2dd7f35f27fd14aa9826b02
mathematical-systems/clml
packages.lisp
(in-package :cl) (defpackage :ffi-utils (:use :cl :alexandria) (:export #:complex-float #:complex-double #:defffun #:with-safe-foreign-function-call-settings #:make-static-array #:with-arrays-as-foreign-arrays )) (defpackage :mkl.blas-lapack-common (:use :cl :alexandria :ffi-utils) (:e...
null
https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/addons/blas-lapack-ffi/src/packages.lisp
lisp
(in-package :cl) (defpackage :ffi-utils (:use :cl :alexandria) (:export #:complex-float #:complex-double #:defffun #:with-safe-foreign-function-call-settings #:make-static-array #:with-arrays-as-foreign-arrays )) (defpackage :mkl.blas-lapack-common (:use :cl :alexandria :ffi-utils) (:e...
d9d5de44172d84cbb2706873b1385cae963ee7667138f329ae2260503c2347c2
janestreet/base
test_container.ml
open! Base open! Container module Test_generic (Elt : sig type 'a t val of_int : int -> int t val to_int : int t -> int end) (Container : sig type 'a t [@@deriving sexp] include Generic with type ('a, _) t := 'a t with type 'a elt := 'a Elt.t val mem : 'a t -> 'a Elt.t ->...
null
https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/test/helpers/test_container.ml
ocaml
This signature constraint reminds us to add unit tests when functions are added to [Generic].
open! Base open! Container module Test_generic (Elt : sig type 'a t val of_int : int -> int t val to_int : int t -> int end) (Container : sig type 'a t [@@deriving sexp] include Generic with type ('a, _) t := 'a t with type 'a elt := 'a Elt.t val mem : 'a t -> 'a Elt.t ->...
d12393d67b49d823b0a2cf129b60509dce589ca4f27af3891aa5c444fadd6fe3
racket/games
gen-tiles.rkt
(module gen-tiles racket (require racket/gui racket/math) (module test racket/base) (define SIZE 24) (define bm (make-object bitmap% SIZE SIZE)) (define dc (make-object bitmap-dc% bm)) (define dir (build-path (collection-path "games" "mines") "images")) ;; Bomb -...
null
https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/mines/gen-tiles.rkt
racket
Bomb ---------------------------------------- Tiles ---------------------------------------- Flag -----------------------------------------
(module gen-tiles racket (require racket/gui racket/math) (module test racket/base) (define SIZE 24) (define bm (make-object bitmap% SIZE SIZE)) (define dc (make-object bitmap-dc% bm)) (define dir (build-path (collection-path "games" "mines") "images")) (defin...
1fe35f039418269834ef1c199c60136f57fbcb43464bf3338e5201980ed82899
CompSciCabal/SMRTYPRTY
trees.rkt
#lang racket (provide (all-defined-out)) (require "sets-lists-fn.rkt") ;; This module provides the functions which will convert a list of vertices ;; and a list of edges into the data type which the graph algorithm ;; operates on. The code is not very pretty :( I did not adhere to the 79 character line limit . (def...
null
https://raw.githubusercontent.com/CompSciCabal/SMRTYPRTY/4a5550789c997c20fb7256b81469de1f1fce3514/experiments/ynasser/bipartite/trees.rkt
racket
This module provides the functions which will convert a list of vertices and a list of edges into the data type which the graph algorithm operates on. The code is not very pretty :( the reconstructed tree: This needs to be re-factored ... non-empty vertices, but out of edges, but tree is empty non-empty vertice...
#lang racket (provide (all-defined-out)) (require "sets-lists-fn.rkt") I did not adhere to the 79 character line limit . (define (other-vertex vertex edge) (cond [(equal? vertex (first edge)) (second edge)] [else (first edge)])) (define (already-in-tree? vertex tree) (cond [(empty? tree) #f] [(...
61a6f8687bb465cc39973eee54738a772f8863281f1a5ec25515e7f0a96b3f92
silky/myth
rope.ml
open Core type 'a t = | Concat of 'a t * 'a t | OfList of 'a list let rec map (r : 'a t) ~f : 'b t = match r with | Concat(lr, rr) -> let ml = map lr f in let mr = map rr f in begin match (ml, mr) with | OfList [], OfList [] -> OfList [] | OfList [], _ -> mr | _, OfList [] -> ml...
null
https://raw.githubusercontent.com/silky/myth/b631edefb2a27a1d731daa6654517d91ca660b95/src/rope.ml
ocaml
TODO: Factor these implementations to share common code
open Core type 'a t = | Concat of 'a t * 'a t | OfList of 'a list let rec map (r : 'a t) ~f : 'b t = match r with | Concat(lr, rr) -> let ml = map lr f in let mr = map rr f in begin match (ml, mr) with | OfList [], OfList [] -> OfList [] | OfList [], _ -> mr | _, OfList [] -> ml...
0bbdab313830adf43da2789cf323e08a6070c46f36d2f277ed309dbd0b0b805b
input-output-hk/plutus-apps
Chain.hs
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} # LANGUAGE FlexibleInstances # # LANGUAGE GADTs # {-# LANGUAGE LambdaCase #-} # LANGUAGE Mul...
null
https://raw.githubusercontent.com/input-output-hk/plutus-apps/e8688b8f86a92b285e7d93eb418ccc314ad41bf9/cardano-node-emulator/src/Cardano/Node/Emulator/Chain.hs
haskell
# LANGUAGE ConstraintKinds # # LANGUAGE DataKinds # # LANGUAGE DeriveAnyClass # # LANGUAGE DerivingStrategies # # LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE RankNTypes # # LANGUAGE TemplateHaskell # # LANGUAGE TypeOperators # | Ev...
# LANGUAGE FlexibleInstances # # LANGUAGE GADTs # # LANGUAGE MultiParamTypeClasses # # LANGUAGE OverloadedStrings # # LANGUAGE RecordWildCards # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # module Cardano.Node.Emulator.Chain where import Cardano.Api qualifi...
1e80385c44da23ab19734a115a71211ccacbdb0774879d3e87fca8b183ab7bfd
frenetic-lang/ocaml-openflow
Arbitrary_OpenFlow0x04.ml
open OpenFlow0x04 open OpenFlow0x04_Core open Arbitrary_Base open QuickCheck module Gen = QuickCheck_gen let sum (lst : int list) = List.fold_left (fun x y -> x + y) 0 lst let arbitrary_32mask = let open Gen in (choose_int (1, 32)) >>= fun a -> ret_gen (Int32.of_int a) let arbitrary_128mask = let open Gen...
null
https://raw.githubusercontent.com/frenetic-lang/ocaml-openflow/289ffb8a692cf32b8413cc58044aae9c151ddd44/quickcheck/Arbitrary_OpenFlow0x04.ml
ocaml
Use in cases where a `Controller` port is invalid input construct an arbitrary byte of length n buffered packet out don't have payload construct an arbitrary byte of length n construct an arbitrary byte of length n
open OpenFlow0x04 open OpenFlow0x04_Core open Arbitrary_Base open QuickCheck module Gen = QuickCheck_gen let sum (lst : int list) = List.fold_left (fun x y -> x + y) 0 lst let arbitrary_32mask = let open Gen in (choose_int (1, 32)) >>= fun a -> ret_gen (Int32.of_int a) let arbitrary_128mask = let open Gen...