_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
840d9aac2a97126c7a36b34a095a69d889c7f107f2f075cb161a6b2735f0b5ea
kdltr/chicken-core
matchable.scm
;;;; matchable.scm -- portable hygienic pattern matcher ;; This code is written by and placed in the ;; Public Domain. All warranties are disclaimed. Written in fully portable SYNTAX - RULES , with a few non - portable ;; bits at the end of the file conditioned out with COND-EXPAND. ;; This is a simple generat...
null
https://raw.githubusercontent.com/kdltr/chicken-core/b2e6c5243dd469064bec947cb3b49dafaa1514e5/tests/matchable.scm
scheme
matchable.scm -- portable hygienic pattern matcher Public Domain. All warranties are disclaimed. bits at the end of the file conditioned out with COND-EXPAND. This is a simple generative pattern matcher - each pattern is expanded into the required tests, calling a failure continuation if the tests pass. This m...
This code is written by and placed in the Written in fully portable SYNTAX - RULES , with a few non - portable 2008/03/20 - fixing bug where ( a ... ) matched non - lists 2008/03/15 - removing redundant check in vector patterns 2007/09/04 - fixing quasiquote patterns 2007/07/21 - allowing ellipse patte...
5a3f17da9723b05af4bac1131b57fa855ba4e74dcbd1d03d46c61413f3b384eb
aria42/flare
graph_test.clj
(ns flare.graph-test (:require [flare.graph :refer :all] [clojure.test :refer :all])) (deftest post-order-nodes-test (let [g {:node :a :children [{:node :b} {:node :c}]}] (is [:b :c :a] (map :node (post-order-nodes g))))) (deftest bottom-up-walk-test (testing "bottom-up walk" (let [g {:val :...
null
https://raw.githubusercontent.com/aria42/flare/9c7d90bf7bd876a154e705dd78645eb5c69ae590/test/flare/graph_test.clj
clojure
(ns flare.graph-test (:require [flare.graph :refer :all] [clojure.test :refer :all])) (deftest post-order-nodes-test (let [g {:node :a :children [{:node :b} {:node :c}]}] (is [:b :c :a] (map :node (post-order-nodes g))))) (deftest bottom-up-walk-test (testing "bottom-up walk" (let [g {:val :...
a80aae4e1bd2c8792207474576e2debc35d5ad4e9dcbd0b46fb71c031ed63988
GaloisInc/semmc
Location.hs
{-# LANGUAGE GADTs #-} # LANGUAGE TemplateHaskell # # LANGUAGE FlexibleContexts # # LANGUAGE TypeApplications # # LANGUAGE KindSignatures # # LANGUAGE ScopedTypeVariables # # LANGUAGE DataKinds # # LANGUAGE ViewPatterns # # LANGUAGE PatternSynonyms # # LANGUAGE TypeFamilies # {-# LANGUAGE RankNTypes #-} # LANGUAGE Allo...
null
https://raw.githubusercontent.com/GaloisInc/semmc/4dc4439720b3b0de8812a68f8156dc89da76da57/semmc-aarch32/src/SemMC/Architecture/ARM/Location.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # ---------------------------------------------------------------------- | A location is simply an index int o the globals
# LANGUAGE TemplateHaskell # # LANGUAGE FlexibleContexts # # LANGUAGE TypeApplications # # LANGUAGE KindSignatures # # LANGUAGE ScopedTypeVariables # # LANGUAGE DataKinds # # LANGUAGE ViewPatterns # # LANGUAGE PatternSynonyms # # LANGUAGE TypeFamilies # # LANGUAGE AllowAmbiguousTypes # # LANGUAGE TypeOperators # modul...
334bc94e27f262925b5406aeb7aaf067d8809299f338af65cce3b35f0a6201f3
greglook/clj-multiformats
varint.cljc
(ns multiformats.varint "Implementation of an MSB unsigned variable-size integer. Unsigned integers are serialized 7 bits at a time, starting with the least-significant bits. The highest bit (msb) in each output byte indicates if there is a continuation byte. -varint" (:require [alphabase.bytes :as b]...
null
https://raw.githubusercontent.com/greglook/clj-multiformats/ab9990261bdf05df622bc1f8609ae11bc680ffbf/src/multiformats/varint.cljc
clojure
Check for index out of bounds. Check for overflow. Write continuation byte and recur. Final byte. ## Decoding Check for index out of bounds. Check for overflow of soft limit. Decode next byte. Final byte. Continuation byte. Add masked lower bits and recur.
(ns multiformats.varint "Implementation of an MSB unsigned variable-size integer. Unsigned integers are serialized 7 bits at a time, starting with the least-significant bits. The highest bit (msb) in each output byte indicates if there is a continuation byte. -varint" (:require [alphabase.bytes :as b]...
078195849609e95626813dddbeb565a722c6936b4959f8824e5e40a1822bf92b
windorg/app-old
FrontController.hs
module Web.FrontController where import IHP.RouterPrelude import Web.Controller.Prelude import Web.View.Layout import IHP.LoginSupport.Middleware import Web.Controller.Sessions import qualified Prelude -- Controller Imports import Web.Controller.Board import Web.Controller.Card import Web.Controller.CardUpdate imp...
null
https://raw.githubusercontent.com/windorg/app-old/ed9c5322c8ab8a0275bdcd479be12a3f230da8c9/Web/FrontController.hs
haskell
Controller Imports Generator Marker Runs on every request apparently TODO: this might be slow but we'll see later
module Web.FrontController where import IHP.RouterPrelude import Web.Controller.Prelude import Web.View.Layout import IHP.LoginSupport.Middleware import Web.Controller.Sessions import qualified Prelude import Web.Controller.Board import Web.Controller.Card import Web.Controller.CardUpdate import Web.Controller.Fee...
8519bf1e3510273ebbdbb30637cf2af55b83fe7f1ed0c9579b2c184cdda49c54
morpheusgraphql/morpheus-graphql
Main.hs
{-# LANGUAGE OverloadedStrings #-} module Main ( main, ) where import HaxlAPI.API import Web.Scotty (scotty) main :: IO () main = scotty 3000 (httpEndpoint "/")
null
https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/b96a16ec3aa393784456565ae88946dff84bce10/examples/scotty-haxl/src/Main.hs
haskell
# LANGUAGE OverloadedStrings #
module Main ( main, ) where import HaxlAPI.API import Web.Scotty (scotty) main :: IO () main = scotty 3000 (httpEndpoint "/")
221f08f43fb71b0887802ba640e84d6a7d1a05729db0a1164665d69fcf78af06
mzp/coq-ruby
pretype_errors.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/pretyping/pretype_errors.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** Old Case Pretyping This simplif...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $ I d : pretype_errors.ml...
5d868a24797e446e11d4d434aaff5047dbc720a225ff8bffb9439648fdea1ca1
haskell-tools/haskell-tools
TypeEqualityContextSynonyms.hs
# LANGUAGE TypeFamilies # module TypeEqualityContextSynonyms where import Definitions {-@ GADTs @-} * TypeFamilies + GADTs , TypeFamilies + GADTs * f = id {-* TypeFamilies + GADTs *-} * TypeFamilies + GADTs , TypeFamilies + GADTs * g = id {-* TypeFamilies + GADTs *-}
null
https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/test/ExtensionOrganizerTest/TypeFamiliesTest/TypeEqualityContextSynonyms.hs
haskell
@ GADTs @ * TypeFamilies + GADTs * * TypeFamilies + GADTs *
# LANGUAGE TypeFamilies # module TypeEqualityContextSynonyms where import Definitions * TypeFamilies + GADTs , TypeFamilies + GADTs * * TypeFamilies + GADTs , TypeFamilies + GADTs *
bb4cc044679dc5d2d8a2e7bbf8a8dba7c2f1033bcdaa349ea4caa18a6fe5cef4
nicdard/compiler-design-eth-tests
sharedtests.ml
open Assert open X86 open Simulator open Asm (* You can use this file for additional test cases to help your *) (* implementation. *) (* some useful constructs *) let redefinedsym_test (p:prog) () = try ignore (assemble p); failwith "Should have raised Redefined_sym"...
null
https://raw.githubusercontent.com/nicdard/compiler-design-eth-tests/5c26d0acfd0314f1493c61a802512aeb502a0426/02/sharedtests.ml
ocaml
You can use this file for additional test cases to help your implementation. some useful constructs move immidiate to reg move immidiate to reg should return mem_bot + 24 (or + 0x16) move immidiate to reg Function prologue and epilogue. A driver main, just call...
open Assert open X86 open Simulator open Asm let redefinedsym_test (p:prog) () = try ignore (assemble p); failwith "Should have raised Redefined_sym" with | Redefined_sym _ -> () | _ -> failwith "Should have raised Redefined_sym" let prog_nothing = [ text "main" [ Retq, [] ] ] let prog_int (n: i...
c5f189a965205c25c26f8c817251598579dd3ab4a3fc828e8f735f03540ee7f1
mmottl/gsl-ocaml
matrix_flat.mli
gsl - ocaml - OCaml interface to GSL Copyright ( © ) 2002 - 2012 - Olivier Andrieu Distributed under the terms of the GPL version 3 (** Matrices of floats implemented with [float array] *) type double_mat_flat = private { data : float array ; off : int ;...
null
https://raw.githubusercontent.com/mmottl/gsl-ocaml/76f8d93cccc1f23084f4a33d3e0a8f1289450580/src/matrix_flat.mli
ocaml
* Matrices of floats implemented with [float array]
gsl - ocaml - OCaml interface to GSL Copyright ( © ) 2002 - 2012 - Olivier Andrieu Distributed under the terms of the GPL version 3 type double_mat_flat = private { data : float array ; off : int ; dim1 : int ; dim2 : int ; tda : int ; } t...
07fdbee0a22489bbb4572837cd478a904304e41e3a8673258ef2d43d94c2d26b
LukaKurnjek/plutus-pioneer-program-book
payment-key-hash.hs
module Main ( main ) where import System.Environment (getArgs) import Week06.Utils (unsafeReadAddress, unsafePaymentPubKeyHash) main :: IO () main = do [addr'] <- getArgs print $ unsafePaymentPubKeyHash $ unsafeReadAddress addr'
null
https://raw.githubusercontent.com/LukaKurnjek/plutus-pioneer-program-book/0e69b2719dc7412a412a546825a002be5209e733/code/week06/app/payment-key-hash.hs
haskell
module Main ( main ) where import System.Environment (getArgs) import Week06.Utils (unsafeReadAddress, unsafePaymentPubKeyHash) main :: IO () main = do [addr'] <- getArgs print $ unsafePaymentPubKeyHash $ unsafeReadAddress addr'
656ff61bba6ad852ee2710f23c604a6433e64a60c0d9d925f59fc2c566a90919
joehillen/craft
ModeSpec.hs
module Craft.File.ModeSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Craft.File.Mode spec :: Spec spec = do describe "toFileMode" $ prop "is inverse of toMode" $ \x -> (x :: Mode) == (toMode . toFileMode) x describe "toOctalString" $ prop "is...
null
https://raw.githubusercontent.com/joehillen/craft/de31caa7f86cceaab23dbef0f05208bb853cf73b/test/Craft/File/ModeSpec.hs
haskell
module Craft.File.ModeSpec (spec) where import Test.Hspec import Test.Hspec.QuickCheck import Craft.File.Mode spec :: Spec spec = do describe "toFileMode" $ prop "is inverse of toMode" $ \x -> (x :: Mode) == (toMode . toFileMode) x describe "toOctalString" $ prop "is...
71d5dd408d957316ae05a52c5846229e04dc6ffb95cc2b065a66b8bf3f757c17
qitab/cl-protobufs
message-api.lisp
Copyright 2012 - 2020 Google LLC ;;; Use of this source code is governed by an MIT - style ;;; license that can be found in the LICENSE file or at ;;; . (in-package #:cl-protobufs.implementation) (defun object-initialized-p (object message) "Check if OBJECT with proto-message MESSAGE is initialized. The definit...
null
https://raw.githubusercontent.com/qitab/cl-protobufs/2199e5f5f5437eacb18671deae875727856239f4/message-api.lisp
lisp
license that can be found in the LICENSE file or at . Check the same field is set. Check for field equality. Check the messages are the same. Check same fields are set if exact is specified. Bool values are stored in a vector. oneofs regular fields Check the messages are the same.
Copyright 2012 - 2020 Google LLC Use of this source code is governed by an MIT - style (in-package #:cl-protobufs.implementation) (defun object-initialized-p (object message) "Check if OBJECT with proto-message MESSAGE is initialized. The definition of initialized is all required-fields are set." (loop for fi...
c4f37d10f43a18bf4e9a8a81f3eb230568276ac47f85d01685cf82a4114398de
clj-commons/hickory
render.cljc
(ns hickory.test.render (:require [clojure.test :refer [deftest is]] [hickory.core :refer [as-hiccup as-hickory parse parse-fragment]] [hickory.render :refer [hiccup-to-html hickory-to-html]])) ;; Hickory to HTML ;; (deftest hickory-to-html-test (is (= "<!DOCTYPE html><html><head></head><body><p><!--hi-...
null
https://raw.githubusercontent.com/clj-commons/hickory/92499fdd8b8aca5f10b4dc8aa7f74a1eeb4de4a7/test/cljc/hickory/test/render.cljc
clojure
Make sure void elements don't have closing tags. Make sure text is properly escaped. Make sure the contents of script/style tags do not get html escaped. Make sure attribute contents are html-escaped. Hiccup to HTML Make sure void elements don't have closing tags. Make sure text is properly escaped. Make su...
(ns hickory.test.render (:require [clojure.test :refer [deftest is]] [hickory.core :refer [as-hiccup as-hickory parse parse-fragment]] [hickory.render :refer [hiccup-to-html hickory-to-html]])) Hickory to HTML (deftest hickory-to-html-test (is (= "<!DOCTYPE html><html><head></head><body><p><!--hi--><a h...
9dbf5ca9ed3c25412686ed919fb7fb2c061e5bc8c225395ffb08a23bacc47ef1
Dept24c/vivo
mem_block_storage.cljc
(ns com.dept24c.vivo.bristlecone.mem-block-storage (:require [clojure.string :as str] [com.dept24c.vivo.bristlecone.block-ids :as block-ids] [com.dept24c.vivo.utils :as u] [deercreeklabs.async-utils :as au] [deercreeklabs.baracus :as ba])) (defprotocol IMemBlockStorageInternals (check-temp-perm [thi...
null
https://raw.githubusercontent.com/Dept24c/vivo/89e2533883641a711d9bcbd5c3f54df09b509095/src/com/dept24c/vivo/bristlecone/mem_block_storage.cljc
clojure
Can't use clojure's compare-and-set! here b/c byte arrays don't compare properly. Ignore references
(ns com.dept24c.vivo.bristlecone.mem-block-storage (:require [clojure.string :as str] [com.dept24c.vivo.bristlecone.block-ids :as block-ids] [com.dept24c.vivo.utils :as u] [deercreeklabs.async-utils :as au] [deercreeklabs.baracus :as ba])) (defprotocol IMemBlockStorageInternals (check-temp-perm [thi...
0e210f5025a82186d15a84aaa84da2f5a394e390f8ae9901e5586db8703f372d
dktr0/Punctual
Resolution.hs
module Sound.Punctual.Resolution where data Resolution = QHD | FHD | HD | WSVGA | SVGA | VGA | QVGA deriving (Eq,Ord,Show) pixels :: Num a => Resolution -> (a,a) pixels QHD = (2560,1440) pixels FHD = (1920,1080) pixels HD = (1280,720) pixels WSVGA = (1024,576) pixels SVGA = (800,600) pixels VGA = (640...
null
https://raw.githubusercontent.com/dktr0/Punctual/300345fb919c2a300a50105fa3e7b2663244a5d7/library-src/Sound/Punctual/Resolution.hs
haskell
module Sound.Punctual.Resolution where data Resolution = QHD | FHD | HD | WSVGA | SVGA | VGA | QVGA deriving (Eq,Ord,Show) pixels :: Num a => Resolution -> (a,a) pixels QHD = (2560,1440) pixels FHD = (1920,1080) pixels HD = (1280,720) pixels WSVGA = (1024,576) pixels SVGA = (800,600) pixels VGA = (640...
ae8ed00558c3962039b5f22fe64f38db0b0b494c707b991d3cee820e9ca139fb
gtk2hs/webkit
Webkit.hs
-- | WebKit browser demo. Author : Copyright : ( c ) 2010 < > -- | This simple browser base on WebKit API. -- For simple, i just make all link open in current window. -- Of course, you can integrate signal `createWebView` with `notebook` -- to build multi-tab browser. -- -- You can click right-...
null
https://raw.githubusercontent.com/gtk2hs/webkit/0d384e2895c43c5d9c6835153076e2f62050ed1b/demo/Webkit.hs
haskell
| WebKit browser demo. | This simple browser base on WebKit API. For simple, i just make all link open in current window. Of course, you can integrate signal `createWebView` with `notebook` to build multi-tab browser. You can click right-button for forward or backward page. Usage: webkit [uri] | Main e...
Author : Copyright : ( c ) 2010 < > module Main where import Control.Monad.Trans import Data.Text import Graphics.UI.Gtk import Graphics.UI.Gtk.WebKit.WebFrame import Graphics.UI.Gtk.WebKit.WebView import System.Environment import ...
218b7ba03a82fc1e8767238bf518e377e88bccea1d14274164d1e87c821d682d
dradtke/Lisp-Text-Editor
gtk.widget.lisp
(in-package :gtk) TODO : GtkWidget (defun widget-flags (widget) (convert-from-foreign (gtk-object-flags-as-integer widget) 'widget-flags)) (defun (setf widget-flags) (new-value widget) (setf (gtk-object-flags-as-integer widget) (convert-to-foreign new-value 'widget-flags)) new-value) (export 'widget...
null
https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/cl-gtk2/gtk/gtk.widget.lisp
lisp
TODO: gtk_widget_size_allocate TODO: gtk_widget_list_accel_closures PangoFontDescription *font_desc); TODO: gtk_widget_class_install_style_property ignored: gtk_widget_send_expose
(in-package :gtk) TODO : GtkWidget (defun widget-flags (widget) (convert-from-foreign (gtk-object-flags-as-integer widget) 'widget-flags)) (defun (setf widget-flags) (new-value widget) (setf (gtk-object-flags-as-integer widget) (convert-to-foreign new-value 'widget-flags)) new-value) (export 'widget...
674f210f0aab29fc3a91e91bb5acfabebfc4c94047b3058443579166695df330
petitnau/algoml
vault.ml
open General open Int open Frontend (* open Amlprinter *) open Types open OUnit2 open! Comp let script = parse_file "contracts/vaults/vault.aml";; ; ; failwith " end " ; ; let account_a = Account.bind_balance (Account.empty_user()) Algo 1000000 let address_a = Account.get_address account_a let account_r = Account...
null
https://raw.githubusercontent.com/petitnau/algoml/c0122c85004114ba634b4946549a78325ff844ee/src/tests/vault.ml
ocaml
open Amlprinter
open General open Int open Frontend open Types open OUnit2 open! Comp let script = parse_file "contracts/vaults/vault.aml";; ; ; failwith " end " ; ; let account_a = Account.bind_balance (Account.empty_user()) Algo 1000000 let address_a = Account.get_address account_a let account_r = Account.bind_balance (Account...
baf2681a123bd0f0e99e50142d23515cbb4caf21cce1059d02410fc087d3e863
Eduap-com/WordMat
pois3.lisp
-*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The data in this file contains enhancments. ;;;;; ;;; ;;;;; ...
null
https://raw.githubusercontent.com/Eduap-com/WordMat/83c9336770067f54431cc42c7147dc6ed640a339/Windows/ExternalPrograms/maxima-5.45.1/share/maxima/5.45.1/src/pois3.lisp
lisp
Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ; The data in this file contains enhancments. ;;;;; ;;;;; ; ; ; ; All rights reserved ;;;;; ; ; GENERAL POISS...
(in-package :maxima) (macsyma-module pois3) (declare-top (special *argc *coef poisvals b* a* *a ss cc h* poishift poistsm poists $poisz $pois1)) (defvar trim nil) (defun poiscdecode (x) x) INTOPOISCO PUTS AN EXPRESSION INTO POISSON COEFFICIENT FORM (defun intopoisco (x) (simplifya x nil)) POISCO+ A...
a583983e8c553de3f1352e94190665d751a7c8f623370f832bc685ffe6bb1f43
K2InformaticsGmbH/dderl
dderl_prometheus.erl
-module(dderl_prometheus). -behavior(cowboy_rest). -include("dderl.hrl"). % cowboy_handler callback -export([init/2, is_authorized/2, allowed_methods/2, content_types_provided/2, get_metrics/2, service_available/2]). -define(DEFAULT_METRICS, #{process_count => #{type => gauge, help => "Process Coun...
null
https://raw.githubusercontent.com/K2InformaticsGmbH/dderl/84697547fe8009db7964baa4eceb876fd78512a0/src/dderl_prometheus.erl
erlang
cowboy_handler callback private
-module(dderl_prometheus). -behavior(cowboy_rest). -include("dderl.hrl"). -export([init/2, is_authorized/2, allowed_methods/2, content_types_provided/2, get_metrics/2, service_available/2]). -define(DEFAULT_METRICS, #{process_count => #{type => gauge, help => "Process Count", labels => ["node","sch...
0393063b25577bf2e648fd880420e67683f8a7f045fbfbae77c5ab3c2f0466a2
FranklinChen/hugs98-plus-Sep2006
Display.hs
----------------------------------------------------------------------------- -- | -- Module : Graphics.X11.Xlib.Display Copyright : ( c ) , 1999 - 2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : -- Stability : provisional -- Portability : portable -- A ...
null
https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/X11/Graphics/X11/Xlib/Display.hs
haskell
--------------------------------------------------------------------------- | Module : Graphics.X11.Xlib.Display License : BSD-style (see the file libraries/base/LICENSE) Maintainer : Stability : provisional Portability : portable --------------------------------------------------------------...
Copyright : ( c ) , 1999 - 2003 A collection of FFI declarations for interfacing with Xlib Displays . module Graphics.X11.Xlib.Display( allPlanes_aux, blackPixel, whitePixel, connectionNumber, defaultColormap, defaultGC, defaultDepth, defaultS...
cdc4418bb80f23da852f4679b513300c496dcceacfce0156eac356755309b808
christiankissig/ocaml99
problem84.ml
(*# P84 (**) Construct the minimal spanning tree # # Write a predicate ms-tree(Graph,Tree,Sum) to construct the minimal spanning # tree of a given labelled graph. Hint: Use the algorithm of Prim. A small # modification of the solution of P83 does the trick. The data of the example # graph to the right can be found in ...
null
https://raw.githubusercontent.com/christiankissig/ocaml99/c25f1790f695f9dd68b23abb472dc7c860d840f8/problem84.ml
ocaml
# P84 (*
# # Write a predicate ms-tree(Graph,Tree,Sum) to construct the minimal spanning # tree of a given labelled graph. Hint: Use the algorithm of Prim. A small # modification of the solution of P83 does the trick. The data of the example # graph to the right can be found in the file p84.dat.*)
942f451f22187a5849cdec6763db21d6ca20d7f0c8fdee64175b0865ac96a580
steffan-westcott/clj-otel
auto_sdk_config.clj
(ns example.auto-sdk-config (:require [steffan-westcott.clj-otel.api.trace.span :as span] [steffan-westcott.clj-otel.instrumentation.runtime-metrics :as runtime-metrics])) (defn square "Returns the square of a number." [n] (span/with-span! {:name "squaring" :attributes {:...
null
https://raw.githubusercontent.com/steffan-westcott/clj-otel/fbc5304abd4f10b488bd32e8519543dfec89cf41/examples/auto-sdk-config/src/example/auto_sdk_config.clj
clojure
(ns example.auto-sdk-config (:require [steffan-westcott.clj-otel.api.trace.span :as span] [steffan-westcott.clj-otel.instrumentation.runtime-metrics :as runtime-metrics])) (defn square "Returns the square of a number." [n] (span/with-span! {:name "squaring" :attributes {:...
6cc914e9eaa282f55d3d390d0b0b10fa603b6703fc818adc13897d9e2a95666b
input-output-hk/cardano-ledger
Generators.hs
-- | Generators for the 'Ledger.Core' values. module Byron.Spec.Ledger.Core.Generators ( vkGen, vkgenesisGen, addrGen, slotGen, epochGen, blockCountGen, k, kForNumberOfEpochs, ) where import Byron.Spec.Ledger.Core ( Addr (Addr), BlockCount (BlockCount), Epoch (Epoch), Owner (Owner), Slot (Slo...
null
https://raw.githubusercontent.com/input-output-hk/cardano-ledger/31c0bb1f5e78e40b83adfd1a916e69f47fdc9835/eras/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Core/Generators.hs
haskell
| Generators for the 'Ledger.Core' values. | Generates a slot within the given bound | Generates an epoch within the given bound | Generates a block count within the given bound | Generate a chain stability parameter value (@k@) using the given chain length and desired number of epochs. | Chain length | Maximum...
module Byron.Spec.Ledger.Core.Generators ( vkGen, vkgenesisGen, addrGen, slotGen, epochGen, blockCountGen, k, kForNumberOfEpochs, ) where import Byron.Spec.Ledger.Core ( Addr (Addr), BlockCount (BlockCount), Epoch (Epoch), Owner (Owner), Slot (Slot), VKey (VKey), VKeyGenesis (VKeyGenesis)...
d81c1f70fc67d92cf26025fd036daf2e7984651bd41d1d6ce56aa8fcfa758ce3
toyokumo/kintone-client
url_test.cljc
MIT License ; Copyright ( c ) 2017 ayato - p ; ;Permission is hereby granted, free of charge, to any person obtaining a copy ;of this software and associated documentation files (the "Software"), to deal ;in the Software without restriction, including without limitation the rights ;to use, copy, modify, merge, publish,...
null
https://raw.githubusercontent.com/toyokumo/kintone-client/32cf5abec1efa6d7ed5f33cf889535863358875b/test/kintone_client/url_test.cljc
clojure
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell furnished to...
MIT License Copyright ( c ) 2017 ayato - p copies of the Software , and to permit persons to whom the Software is copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY , OR...
7b0478d3e0dc682489e3e962f4a6c18a0969e9420a7d38facc315e5ef20652b5
Kappa-Dev/KappaTools
rules_domain.ml
* * rule_domain.ml * openkappa * , project Antique , INRIA Paris * * Creation : 2016 , the 30th of January * Last modification : Time - stamp : < Dec 04 2018 > * * Abstract domain to record live rules * * Copyright 2010,2011,2012,2013,2014,2015,2016 Institut Natio...
null
https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/KaSa_rep/reachability_analysis/rules_domain.ml
ocaml
the type of the struct that contains all static information as in the previous version of the analysis no domain-specific static information -------------------------------------------------------------------- this array indicates whether a rule has already be applied, or not This array is statically alloca...
* * rule_domain.ml * openkappa * , project Antique , INRIA Paris * * Creation : 2016 , the 30th of January * Last modification : Time - stamp : < Dec 04 2018 > * * Abstract domain to record live rules * * Copyright 2010,2011,2012,2013,2014,2015,2016 Institut Natio...
b26319f0b92dfefa68e2edfb5906cda602596786c26fa3a055ff5e51a3fe33b4
lambdageek/centrinel
ZeptoLens.hs
-- | Just the smallest set of lens operators # language RankNTypes # module ZeptoLens where import Control.Applicative (Const (..)) import Control.Monad.Reader.Class import Data.Functor.Identity (Identity (..)) type Lens s t a b = forall f . Functor f => (a -> f b) -> s -> f t over :: Lens s t a b -> (a -> b) -> s -...
null
https://raw.githubusercontent.com/lambdageek/centrinel/412b620b77c6cb569811fec845b89d04585c1332/src/ZeptoLens.hs
haskell
| Just the smallest set of lens operators # INLINE (%~) # # INLINE set #
# language RankNTypes # module ZeptoLens where import Control.Applicative (Const (..)) import Control.Monad.Reader.Class import Data.Functor.Identity (Identity (..)) type Lens s t a b = forall f . Functor f => (a -> f b) -> s -> f t over :: Lens s t a b -> (a -> b) -> s -> t over l f = runIdentity . l (Identity . f)...
90814e6e8daa0f9dbd075ada09621c8086dd52c3b422758409e53abd0804fceb
NorfairKing/super-user-spark
Diagnose.hs
# LANGUAGE RecordWildCards # {- The responsibility of the diagnoser is to turn baked deployments into diagnosed deployments. This is purely a read-only operation that looks at the current state of the file system. -} module SuperUserSpark.Diagnose ( diagnoseFromArgs , diagnoseAssignment , deriv...
null
https://raw.githubusercontent.com/NorfairKing/super-user-spark/3c286a52a0b81e083c0e6d39f6f2b02aa9bb9231/src/SuperUserSpark/Diagnose.hs
haskell
The responsibility of the diagnoser is to turn baked deployments into diagnosed deployments. This is purely a read-only operation that looks at the current state of the file system.
# LANGUAGE RecordWildCards # module SuperUserSpark.Diagnose ( diagnoseFromArgs , diagnoseAssignment , deriveDiagnoseSettings , diagnose , formatDiagnoseError , diagnoserBake , diagnoseDeployments ) where import Import import qualified Data.Aeson.Encode.Pretty as JSON import qualified ...
190156eeb615e04f4aca7e477f26bca008a39695520187090fb684ada24fed39
technomancy/leiningen
jar.clj
(ns leiningen.jar "Package up all the project's files into a jar file." (:require [leiningen.pom :as pom] [leiningen.clean :as clean] [leiningen.compile :as compile] [leiningen.core.project :as project] [leiningen.core.eval :as eval] [leiningen.core.main :...
null
https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/src/leiningen/jar.clj
clojure
Sub-manifest = manifest section Manifest spec says join with "\n " explicitly set to nil Path may be blank if it is the root path Q: is this a good name for this action? this is hideous
(ns leiningen.jar "Package up all the project's files into a jar file." (:require [leiningen.pom :as pom] [leiningen.clean :as clean] [leiningen.compile :as compile] [leiningen.core.project :as project] [leiningen.core.eval :as eval] [leiningen.core.main :...
6b15008bb3130c565c378470f9f06a41b9dd254fa0bb9208c3c1b808c75fe631
robert-strandh/Clump
check-parents.lisp
(cl:in-package #:clump-test) (defun check-parents (tree) (unless (null tree) (let ((left (clump-binary-tree:left tree)) (right (clump-binary-tree:right tree))) (unless (null left) (assert (eq (clump-binary-tree:parent left) tree))) (unless (null right) (assert (eq (clump-binary-tree:parent right...
null
https://raw.githubusercontent.com/robert-strandh/Clump/1ea4dbac1cb86713acff9ae58727dd187d21048a/Test/check-parents.lisp
lisp
(cl:in-package #:clump-test) (defun check-parents (tree) (unless (null tree) (let ((left (clump-binary-tree:left tree)) (right (clump-binary-tree:right tree))) (unless (null left) (assert (eq (clump-binary-tree:parent left) tree))) (unless (null right) (assert (eq (clump-binary-tree:parent right...
c5e44beac10891d9bd9bce756f69c10dad2b6e399e825e0c72a3e29ede4bc064
fragnix/fragnix
Data.ByteString.Lazy.Builder.Extras.hs
# LANGUAGE Haskell98 # # LINE 1 " Data / ByteString / Lazy / Builder / Extras.hs " # -- | We decided to rename the Builder modules. Sorry about that. -- -- The old names will hang about for at least once release cycle before we -- deprecate them and then later remove them. -- module Data.ByteString.Lazy.Builder.Extras...
null
https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/Data.ByteString.Lazy.Builder.Extras.hs
haskell
| We decided to rename the Builder modules. Sorry about that. The old names will hang about for at least once release cycle before we deprecate them and then later remove them.
# LANGUAGE Haskell98 # # LINE 1 " Data / ByteString / Lazy / Builder / Extras.hs " # module Data.ByteString.Lazy.Builder.Extras ( module Data.ByteString.Builder.Extra ) where import Data.ByteString.Builder.Extra
d576d241b432c1653e9a710b89ad021e42cc341b65f62a1d1e540980d55f70e3
dradtke/Lisp-Text-Editor
vbox.lisp
(in-package :gtk-cffi) (defclass v-box (box) ()) (defcfun "gtk_vbox_new" :pointer (homogeneous :boolean) (spacing :int)) (defmethod gconstructor ((v-box v-box) &key homogeneous (spacing 0) &allow-other-keys) (gtk-vbox-new homogeneous spacing))
null
https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/gtk-cffi-20120208-cvs/gtk/vbox.lisp
lisp
(in-package :gtk-cffi) (defclass v-box (box) ()) (defcfun "gtk_vbox_new" :pointer (homogeneous :boolean) (spacing :int)) (defmethod gconstructor ((v-box v-box) &key homogeneous (spacing 0) &allow-other-keys) (gtk-vbox-new homogeneous spacing))
c89bedcb0959158e1dbfa157275497d91893f1d5b372b962f47d9590e451cfa0
mbutterick/aoc-racket
test2.rkt
#lang reader "main.rkt" ★★ <> <random characters> <<<<> <{!>}> <!!> <!!!>> <{o"i!a,<{i<a>
null
https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2017/d09/test2.rkt
racket
#lang reader "main.rkt" ★★ <> <random characters> <<<<> <{!>}> <!!> <!!!>> <{o"i!a,<{i<a>
f8b3c4f21a4a9e66b4da4362c2500a85620b7e84917838eed83fcb485fed9efa
mbutterick/quad
paths-to-test.rkt
#lang racket/base (require racket/runtime-path racket/match quadwriter) (provide (all-defined-out)) (define-runtime-path here ".") (define (find-test-paths) (for/list ([test-path (in-directory here)] #:when (regexp-match #rx"test-.*.rkt$" (path->string test-path))) test-pa...
null
https://raw.githubusercontent.com/mbutterick/quad/395447f35c2fb9fc7b6199ed185850906d80811d/qtest/paths-to-test.rkt
racket
#lang racket/base (require racket/runtime-path racket/match quadwriter) (provide (all-defined-out)) (define-runtime-path here ".") (define (find-test-paths) (for/list ([test-path (in-directory here)] #:when (regexp-match #rx"test-.*.rkt$" (path->string test-path))) test-pa...
983c3498a32c6a00d36e1e1afb7d8b6f582b591f76c2d8591a771925e2d0f4bd
5HT/ant
ParseState.ml
open XNum; open Runtime; open Unicode; open Types; open Logging; open Typesetting; open Engine; value tracing_stacks = ref False; value tracing_macros = ref False; value tracing_input = ref False; type mode = [= `Preamble | `Galley | `Paragraph | `Math | `HBox | `LRBox | `RLBox | `VBox | `Table ]; type par...
null
https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Markup/ParseState.ml
ocaml
|duplicate <parse-state>| creates a new parse-state where the definitions of commands, environments, and counters are copied from <parse-state>. |set_stream <ps> <stream>| replaces the input-stream of <ps>. Character commands To each character is associated a command which is invoked everytime the character ...
open XNum; open Runtime; open Unicode; open Types; open Logging; open Typesetting; open Engine; value tracing_stacks = ref False; value tracing_macros = ref False; value tracing_input = ref False; type mode = [= `Preamble | `Galley | `Paragraph | `Math | `HBox | `LRBox | `RLBox | `VBox | `Table ]; type par...
016a592f3a2991f9140608d3e84643bfc5287337eb400ce207724b648536bd00
Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library
PaymentMethodBacsDebit.hs
{-# LANGUAGE MultiWayIf #-} CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . {-# LANGUAGE OverloadedStrings #-} -- | Contains the types generated from the schema PaymentMethodBacsDebit module StripeAPI.Types.PaymentMethodBacsDebit where ...
null
https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentMethodBacsDebit.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # | Contains the types generated from the schema PaymentMethodBacsDebit Constraints: Constraints: | sort_code: Sort code of the bank account. (e.g., \`10-20-30\`) Constraints: | Create a new 'PaymentMethodBacsDebit' with all required fields.
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator . module StripeAPI.Types.PaymentMethodBacsDebit where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import qual...
436b59d3f0b2c05fede84158968b531f859f8615c7fbe7044fb91a49ddd46cdb
akamai/cl-http2-protocol
compressor.lisp
Copyright ( c ) 2014 Akamai Technologies , Inc. ( MIT License ) (in-package :cl-http2-protocol) Implementation of header compression for HTTP/2 ( HPACK ) format adapted ;; to efficiently represent HTTP headers in the context of HTTP/2. ;; ;; - -ietf-httpbis-header-compression (defparameter *static-table* '((":...
null
https://raw.githubusercontent.com/akamai/cl-http2-protocol/67fb6befe78ed1e52e1ba1f1e66a0a793119033e/compressor.lisp
lisp
to efficiently represent HTTP headers in the context of HTTP/2. - -ietf-httpbis-header-compression *static-table* and (table encoding-context) should probably be *vectors instead, then keeping this length would not be necessary helper commands for table management: switch on command type and run the appropriate ...
Copyright ( c ) 2014 Akamai Technologies , Inc. ( MIT License ) (in-package :cl-http2-protocol) Implementation of header compression for HTTP/2 ( HPACK ) format adapted (defparameter *static-table* '((":authority" . "") (":method" . "GET") (":method" ...
dc55207136745c02042492f5eb79f488d6f61eaf487e783bf8103dfe1392c9a3
Feuerlabs/exometer_core
exometer_probe.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved . %% This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtai...
null
https://raw.githubusercontent.com/Feuerlabs/exometer_core/358d5c6724b823104f122ca4f16439ae0e767c82/src/exometer_probe.erl
erlang
------------------------------------------------------------------- ------------------------------------------------------------------- @doc Interface library for managing probes.<br/> This library contains the main API for accessing all probes executing in exometer. All exported functions in the `exomter...
Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved . This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. ` /proc ' , ` sysfs ' , and ` netlink ' , through timer - base...
37a650b510eb2fb4bed79d366906276337a2b03e9b3a90f7dadb70007f76e52d
8c6794b6/haskell-sc-scratch
BenchDQ.hs
# LANGUAGE NoImplicitPrelude , BangPatterns # | Module : $ Header$ CopyRight : ( c ) 8c6794b6 License : : Stability : unstable Portability : non - portable Benchmarks for data structures in RecSlowdown . Amortimized time of head , tail , cons , snoc , last , init are /O(1)/. Mod...
null
https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/FP/PFDS/RecSlowdown/BenchDQ.hs
haskell
# LANGUAGE NoImplicitPrelude , BangPatterns # | Module : $ Header$ CopyRight : ( c ) 8c6794b6 License : : Stability : unstable Portability : non - portable Benchmarks for data structures in RecSlowdown . Amortimized time of head , tail , cons , snoc , last , init are /O(1)/. Mod...
873da992ee310ce487329b679c2b76447cac4be2eaabf98bce4b6e091a36e328
theodormoroianu/SecondYearCourses
HaskellChurch_20210415162206.hs
{-# LANGUAGE RankNTypes #-} module HaskellChurch where A boolean is any way to choose between two alternatives newtype CBool = CBool {cIf :: forall t. t -> t -> t} An instance to show as regular Booleans instance Show CBool where show b = show $ cIf b True False The boolean constant true always chooses the ...
null
https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415162206.hs
haskell
# LANGUAGE RankNTypes # The boolean negation switches the alternatives The boolean conjunction can be built as a conditional The boolean disjunction can be built as a conditional a pair is a way to compute something based on the values contained within the pair. a function to be applied on the values, it will apply i...
module HaskellChurch where A boolean is any way to choose between two alternatives newtype CBool = CBool {cIf :: forall t. t -> t -> t} An instance to show as regular Booleans instance Show CBool where show b = show $ cIf b True False The boolean constant true always chooses the first alternative cTrue :: C...
b8179b0884d5c36811756360de2f9116429aa5b14731030584d68f5013d1f933
wireless-net/erlang-nommu
escript_SUITE.erl
%% %% %CopyrightBegin% %% Copyright Ericsson AB 2007 - 2013 . All Rights Reserved . %% The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Publi...
null
https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/test/escript_SUITE.erl
erlang
%CopyrightBegin% compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitatio...
Copyright Ericsson AB 2007 - 2013 . All Rights Reserved . The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in Software distributed under the License is distributed on an " AS IS " -module(escript_SUITE). -export([ all/0, ...
ecc62bbd492b590f20f9bbe5a0374a0ff9bbc33bd9918b719b706a3a4d88a528
shenxs/about-scheme
37.rkt
#lang racket (require 2htdp/batch-io lang/htdp-advanced ) ;; queen (define (imploade l) (cond [(empty? l) ""] [else (string-append (first l) (imploade (rest l)))])) Exercise 478 (define big-list (local ((define (build n) (cond [(= 1 n) (cons 1 '())] [els...
null
https://raw.githubusercontent.com/shenxs/about-scheme/d458776a62cb0bbcbfbb2a044ed18b849f26fd0f/HTDP/37.rkt
racket
queen (time (product.v1 big-list) #t) (time (product.v2 big-list) #t) 生成回文序列 O(n^2) (make-palindrome '("a" "b" "c")) (time (append big-list big-list) #t) (time (make-palindrome big-list) #t) (time (make-palindrome.v2 big-list) #t) (time (make-palindrome.v3 big-list) #t) Matrix -> Matrix termination this funct...
#lang racket (require 2htdp/batch-io lang/htdp-advanced ) (define (imploade l) (cond [(empty? l) ""] [else (string-append (first l) (imploade (rest l)))])) Exercise 478 (define big-list (local ((define (build n) (cond [(= 1 n) (cons 1 '())] [else (cons n...
95f01278cb903cb7be9582854566e6124fd1bdf4171c5351324b543993f228e1
elastic/apm-agent-ocaml
hello.ml
open! Base open Opium type message_object = { message : string } [@@deriving yojson] let reverse_handler req = let%lwt body = Body.to_string req.Request.body in let message_object = body |> Yojson.Safe.from_string |> message_object_of_yojson in let rev_body = `String message_object.message |> Yojson....
null
https://raw.githubusercontent.com/elastic/apm-agent-ocaml/0611fd0176126f9b128fb87e42e849985ef5f20e/example/1-hello-opium/hello.ml
ocaml
open! Base open Opium type message_object = { message : string } [@@deriving yojson] let reverse_handler req = let%lwt body = Body.to_string req.Request.body in let message_object = body |> Yojson.Safe.from_string |> message_object_of_yojson in let rev_body = `String message_object.message |> Yojson....
f3550589ff68d484fc86c8836c14a5437b19870e54c69431aa95a9b2e1dcec0e
cuplv/dai
callgraph.ml
open Dai.Import open Syntax type forward_t = Cfg.Fn.t list Method_id.Map.t type reverse_t = Cfg.Fn.t list Method_id.Map.t type scc = string Graphlib.Std.partition type t = { forward : forward_t; reverse : reverse_t; scc : scc option } let empty = { forward = Method_id.Map.empty; reverse = Method_id.Map.empty; scc ...
null
https://raw.githubusercontent.com/cuplv/dai/b2bdb518ad6e7893b96aa2dd60b42b2ae6dd14ad/src/frontend/callgraph.ml
ocaml
a callgraph is a map from caller [Method_id]'s to sets of callee [Cfg.Fn]'s
open Dai.Import open Syntax type forward_t = Cfg.Fn.t list Method_id.Map.t type reverse_t = Cfg.Fn.t list Method_id.Map.t type scc = string Graphlib.Std.partition type t = { forward : forward_t; reverse : reverse_t; scc : scc option } let empty = { forward = Method_id.Map.empty; reverse = Method_id.Map.empty; scc ...
58ac9838fcd093f774bf2fdeb5b0607960e42947ab19b82959d5554c87902b2a
david-christiansen/pudding-old
error-handling.rkt
#lang racket (require (for-syntax syntax/parse) racket/stxparam (only-in racket/contract/combinator make-flat-contract) "monad-notation.rkt") (provide ;; Re-exported monad stuff pure <- ;; The proof monad proof proof-fail proof-error proof-run proof-eval proof-get...
null
https://raw.githubusercontent.com/david-christiansen/pudding-old/6b9ee633b551226df61d40191bafa14386fc86ad/error-handling.rkt
racket
Re-exported monad stuff The proof monad The proof monad is a state-and-error monad. Values are functions that take a proof state and produce either a pair of a success value and a new state or a failure with an error. In other words, failure undoes any changes to the state. A wrapper around the functions that ...
#lang racket (require (for-syntax syntax/parse) racket/stxparam (only-in racket/contract/combinator make-flat-contract) "monad-notation.rkt") (provide pure <- proof proof-fail proof-error proof-run proof-eval proof-get proof-put proof-modify proof-chain-list proof...
e902a2e5dbad6501381ff6b9b370784bc46fa9e06b2af90203df53518ade9216
blockmason/lndr
Types.hs
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} # LANGUAGE DuplicateRecordFields # # LANGUAGE OverloadedStrings # {-# LANGUAGE TemplateHaskell #-} # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # module Lndr.Types ( -- * server configuration ...
null
https://raw.githubusercontent.com/blockmason/lndr/58fe5f82d5d057e463be23821454e3a0515ef9b9/lndr-backend/src/Lndr/Types.hs
haskell
# LANGUAGE DeriveDataTypeable # # LANGUAGE DeriveGeneric # # LANGUAGE TemplateHaskell # * server configuration * push notifications-related types * identity verification types * network statistics api response types * descriptive bytestring types The 'NotificationAction' type enumerates those eve...
# LANGUAGE DuplicateRecordFields # # LANGUAGE OverloadedStrings # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # module Lndr.Types ( ServerState(..) , ServerConfig(..) * types , NickRequest(..) , EmailRequest(..) , UserInfo(..) , Nick , ProfilePhotoRe...
9aff547478aca2cc84e479914a9b61f7aa12a12327d9c373c8308a0d14528a49
tadeuzagallo/verve-lang
Env.hs
module Env ( Pipeline , Env , defaultEnv , runPipeline , printResults , option , options , reportErrors , puts , updateEnv , getEnv , flush , (|>) , (\>) ) where import Options import Core.Desugar import Util.Error import qualified Interpreter.Env as Interpreter import qualified Reassoc...
null
https://raw.githubusercontent.com/tadeuzagallo/verve-lang/c7db1f5d4bb399b6c2623dd2444a981b5aba1aa4/app/Env.hs
haskell
Internal Helpers Public Helpers pipeline operator
module Env ( Pipeline , Env , defaultEnv , runPipeline , printResults , option , options , reportErrors , puts , updateEnv , getEnv , flush , (|>) , (\>) ) where import Options import Core.Desugar import Util.Error import qualified Interpreter.Env as Interpreter import qualified Reassoc...
15b148e5e3694b1f3c40f713d8d3e7784d9328d9bcd7271d9cb7a0112b53aef8
mzp/bs-lwt
lwt_mutex.ml
Lightweight thread library for OCaml * * Module Lwt_mutex * Copyright ( C ) 2005 - 2008 * Laboratoire PPS - CNRS Université Paris Diderot * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by...
null
https://raw.githubusercontent.com/mzp/bs-lwt/f37a3c47d038f4efcd65912c41fab95d1e6633ce/lwt/src/core/lwt_mutex.ml
ocaml
We do not use [Lwt.wakeup] here to avoid a stack overflow when unlocking a lot of threads.
Lightweight thread library for OCaml * * Module Lwt_mutex * Copyright ( C ) 2005 - 2008 * Laboratoire PPS - CNRS Université Paris Diderot * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by...
cd62e09ed8a7f9118e2cc42f73490851d7b2f289c3b7cd5a90400d3ed7f4b95b
janegca/htdp2e
Exercise-316-eval-variable.rkt
The first three lines of this file were inserted by . They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname Exercise-311-eval-variable) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t c...
null
https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/04-Intertwined%20Data/Exercise-316-eval-variable.rkt
racket
about the language level of this file in a form that our tools can easily process. Design eval-variable. The function consumes a BSL-var-expr and determines its value if numeric? is true. Otherwise it signals an error, saying that it is impossible to evaluate an expression that contains a variable. In general,...
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname Exercise-311-eval-variable) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) Exercise 316 . expressions contai...
a6384b2191b4abb06cdc417c4c199a8fd3da1125333e490eab3b36d66065934f
raxod502/minimal-webapp
splash.cljs
(ns minimal-webapp.pages.splash (:require [reagent.core :as r])) (r/render [:h1 "Hello from Reagent!"] (.getElementById js/document "app"))
null
https://raw.githubusercontent.com/raxod502/minimal-webapp/1771c750541c6ff93d016f3649a074817c185108/src/minimal_webapp/pages/splash.cljs
clojure
(ns minimal-webapp.pages.splash (:require [reagent.core :as r])) (r/render [:h1 "Hello from Reagent!"] (.getElementById js/document "app"))
7718350fe09690659fe8edac3ca1f4133e55d16328eb2fbdf20e380cba2ec439
falgon/htcc
Internal.hs
| Module : Htcc . Asm . Intrinsic . Structure . Internal Description : The modules of intrinsic ( x86_64 ) assembly Copyright : ( c ) roki , 2019 License : MIT Maintainer : Stability : experimental Portability : POSIX The modules of intrinsic ( x86_64 ) assembly Module : Htcc...
null
https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/Asm/Intrinsic/Structure/Internal.hs
haskell
| Counter and label information used when generating assembly code ^ the flag that indicates whether it is inside the label. If True, indent by single tab, ^ the label counter ^ the @break@ label counter ^ the @continue@ label counter ^ the function being processed | A monad that represents the context of the as...
| Module : Htcc . Asm . Intrinsic . Structure . Internal Description : The modules of intrinsic ( x86_64 ) assembly Copyright : ( c ) roki , 2019 License : MIT Maintainer : Stability : experimental Portability : POSIX The modules of intrinsic ( x86_64 ) assembly Module : Htcc...
9ffd6505f0b5171d666c53d42d48c89e977469efdb8fa06df16974ad2c6deac3
ninenines/cowboy
toppage_h.erl
%% Feel free to use, reuse and abuse the code in this file. %% @doc POST echo handler. -module(toppage_h). -export([init/2]). init(Req0, Opts) -> Method = cowboy_req:method(Req0), HasBody = cowboy_req:has_body(Req0), Req = maybe_echo(Method, HasBody, Req0), {ok, Req, Opts}. maybe_echo(<<"POST">>, true, Req0) ->...
null
https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/examples/echo_post/src/toppage_h.erl
erlang
Feel free to use, reuse and abuse the code in this file. @doc POST echo handler. Method not allowed.
-module(toppage_h). -export([init/2]). init(Req0, Opts) -> Method = cowboy_req:method(Req0), HasBody = cowboy_req:has_body(Req0), Req = maybe_echo(Method, HasBody, Req0), {ok, Req, Opts}. maybe_echo(<<"POST">>, true, Req0) -> {ok, PostVals, Req} = cowboy_req:read_urlencoded_body(Req0), Echo = proplists:get_va...
810065765a42d3c91483449bee4bd8547a6d980353cde4fb4baa100501c599d6
TrustInSoft/tis-interpreter
state_builder.ml
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/libraries/project/state_builder.ml
ocaml
************************************************************************ alternatives) ...
This file is part of Frama - C. Copyright ( C ) 2007 - 2015 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , v...
f9953d079c36aaadb96a65afbeffbe13cc15936c3467b74369eca1dcd223afa5
samply/blaze
config.clj
(ns blaze.cassandra.config (:require [clojure.string :as str] [java-time.api :as time]) (:import [com.datastax.oss.driver.api.core.config OptionsMap TypedDriverOption] [java.net InetSocketAddress])) (set! *warn-on-reflection* true) (defn options [{:keys [max-concurrent-requests max-request-que...
null
https://raw.githubusercontent.com/samply/blaze/315385a281e238adbd48df581d8cc52960a3acda/modules/cassandra/src/blaze/cassandra/config.clj
clojure
(ns blaze.cassandra.config (:require [clojure.string :as str] [java-time.api :as time]) (:import [com.datastax.oss.driver.api.core.config OptionsMap TypedDriverOption] [java.net InetSocketAddress])) (set! *warn-on-reflection* true) (defn options [{:keys [max-concurrent-requests max-request-que...
8bb231a42f4ecc1da19a30302a7b33205256e91700190d822a0a528d6596a766
sbcl/sbcl
early-raw-slots.lisp
This software is part of the SBCL system . See the README file for ;;;; more information. ;;;; This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no wa...
null
https://raw.githubusercontent.com/sbcl/sbcl/9255dbbc30f4aaa52164d7d1cdbb7dd901b989d8/src/code/early-raw-slots.lisp
lisp
more information. public domain. The software is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. STRUCTURE-OBJECT supports placement of raw bits within the object to allow representation of native word and float-point types directly. such...
This software is part of the SBCL system . See the README file for This software is derived from the CMU CL system , which was written at Carnegie Mellon University and released into the (in-package "SB-KERNEL") Historically the implementation was optimized for GC by placing all non - raw slot . This impos...
e3d78519adfcd8b62706df41fa34fbb1a67fff515af78ad787c4f11c2863764e
mu-chaco/ReWire
PreludeTest.hs
import ReWire x :: Bool x = True y :: Bool y = x && x loop :: Bool -> ReT Bool Bool I () loop a = do b <- signal ((zookus . zookus) a) loop (a && x && y) zookus :: Bool -> Bool zookus x = fst (x,x) start :: ReT Bool Bool I () start = loop False main = undefined
null
https://raw.githubusercontent.com/mu-chaco/ReWire/a8dcea6ab0989474988a758179a1d876e2c32370/tests/regression/PreludeTest.hs
haskell
import ReWire x :: Bool x = True y :: Bool y = x && x loop :: Bool -> ReT Bool Bool I () loop a = do b <- signal ((zookus . zookus) a) loop (a && x && y) zookus :: Bool -> Bool zookus x = fst (x,x) start :: ReT Bool Bool I () start = loop False main = undefined
650349c09eb78b3d1e11673c881e0d86b0cbf5d4525ce9689c3001e869b86f11
khotyn/4clojure-answer
46-flipping-out.clj
(fn [f] (fn [& args] (apply f (reverse args))))
null
https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/46-flipping-out.clj
clojure
(fn [f] (fn [& args] (apply f (reverse args))))
aee57110245a0c691dea217b2ee7caee8f06520240973732bc9c44594a9db990
granule-project/gerty
Internal.hs
module Language.Gerty.Syntax.Internal ( Type ) where import Language.Gerty.Syntax.Abstract type Type = Expr
null
https://raw.githubusercontent.com/granule-project/gerty/972fa027973032a4499747039b45e744ca17e9e2/src/Language/Gerty/Syntax/Internal.hs
haskell
module Language.Gerty.Syntax.Internal ( Type ) where import Language.Gerty.Syntax.Abstract type Type = Expr
1973c7c91865c9538918a1e87b5151481d48e550bc0156a0cd166ec9938a62e7
imkiva/HiVM
ClassPathManager.hs
module ClassPath.ClassPathManager ( searchClassPath ) where import ClassPath.Base import qualified Data.List.Split as Split import qualified System.Directory as Dir import System.Environment import qualified System.Info as SystemInfo searchClassPath :: JavaClassName -> IO (Either S...
null
https://raw.githubusercontent.com/imkiva/HiVM/c9756e3c8398c896b3fe382ae1ffd2d6b51096d7/src/ClassPath/ClassPathManager.hs
haskell
TODO: replace hardcoded "/"
module ClassPath.ClassPathManager ( searchClassPath ) where import ClassPath.Base import qualified Data.List.Split as Split import qualified System.Directory as Dir import System.Environment import qualified System.Info as SystemInfo searchClassPath :: JavaClassName -> IO (Either S...
6b8cc91aa72dc869b5e99f89067e97d686a1e9582eed13d842fe60110d0bc30c
asivitz/Hickory
GLSupport.hs
# LANGUAGE BlockArguments # module Graphics . GLSupport ( module Graphics . GL.ARB.ES2Compatibility ) where import Graphics . GL.ARB.ES2Compatibility module Graphics.GLSupport ( module Graphics.GL.ARB.ES2Compatibility ) where import Graphics.GL.ARB.ES2Compatibility -} module Hickory.Graphics.GLSupport ( buffe...
null
https://raw.githubusercontent.com/asivitz/Hickory/3a326591d2c5568a7e0bb6f05fdac6798a2c754e/core/Hickory/Graphics/GLSupport.hs
haskell
Types for OSX GL_TABLE_TOO_LARGE -> err "GL_TABLE_TOO_LARGE" GL_TABLE_TOO_LARGE_EXT -> err "GL_TABLE_TOO_LARGE_EXT" GL_TEXTURE_TOO_LARGE_EXT -> err "GL_TEXTURE_TOO_LARGE_EXT"
# LANGUAGE BlockArguments # module Graphics . GLSupport ( module Graphics . GL.ARB.ES2Compatibility ) where import Graphics . GL.ARB.ES2Compatibility module Graphics.GLSupport ( module Graphics.GL.ARB.ES2Compatibility ) where import Graphics.GL.ARB.ES2Compatibility -} module Hickory.Graphics.GLSupport ( buffe...
9acf616cbdaefa77b612e5572d4ff14491358ce8e319a38eac90c8597c4c4fba
egraphdb/egraphdb
egraph_link_model.erl
%%%------------------------------------------------------------------- @author neerajsharma ( C ) 2018 , %%% @doc %%% %%% @end %%% %CopyrightBegin% %%% Copyright < > 2017 . All Rights Reserved . %%% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %%% you may not use this file excep...
null
https://raw.githubusercontent.com/egraphdb/egraphdb/41a0131be227f7f0a35ba0e2c1cb23d70cd86b03/models/egraph_link_model.erl
erlang
------------------------------------------------------------------- @doc @end %CopyrightBegin% you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIO...
@author neerajsharma ( C ) 2018 , Copyright < > 2017 . All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(egraph_link_model). validate/2, create/3, read/2, update/3, delete/2]...
73289eab7a638e2aab00cb1452e83f847e005ed312a20a113c5f456d27a1dbe4
quchen/generative-art
ReconstructWires.hs
module Circuits.ReconstructWires (reconstructWires) where import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S import Circuits.GrowingProcess import Geometry.Coordinates.Hexagonal as Hex reconstructSingleWire :: Map Hex CellState -> Hex -> ...
null
https://raw.githubusercontent.com/quchen/generative-art/9fa2b3527d08f4706823af34c0484e6885c37dfa/showcases/munihac_2022_logo/Circuits/ReconstructWires.hs
haskell
| Convert the (rather abstract) result of the circuit growing process into a set of hex-polylines, which are much simpler to work with.
module Circuits.ReconstructWires (reconstructWires) where import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S import Circuits.GrowingProcess import Geometry.Coordinates.Hexagonal as Hex reconstructSingleWire :: Map Hex CellState -> Hex -> ...
dc6b6295f12fa2dc9d4f77967e811393fde07f0f8dc0c3e5c8f4de325ac393d0
well-typed/optics
Optics.hs
# LANGUAGE CPP # -- | -- Module: Data.Map.Optics -- Description: Optics for working with 'Data.Map.Map's. -- -- This module exists to provide documentation for lenses for working with -- 'Map', which might otherwise be obscured by their genericity. -- -- 'Map' is an instance of 'Optics.At.Core.At' and provides 'Optics....
null
https://raw.githubusercontent.com/well-typed/optics/7cc3f9c334cdf69feaf10f58b11d3dbe2f98812c/optics-core/src/Data/Map/Optics.hs
haskell
| Module: Data.Map.Optics Description: Optics for working with 'Data.Map.Map's. This module exists to provide documentation for lenses for working with 'Map', which might otherwise be obscured by their genericity. 'Map' is an instance of 'Optics.At.Core.At' and provides 'Optics.At.Core.at' as a lens on values ...
# LANGUAGE CPP # > > > Map.fromList [ ( 1 , " world " ) ] ^. at 1 > > > Map.empty & at 1 .~ Just " world " > > > Map.empty & at 0 .~ Just " hello " fromList [ ( 0,"hello " ) ] > > > iover imapped const $ Map.fromList [ ( 1 , " Venus " ) ] fromList [ ( 1,1 ) ] > > > ifoldMapOf ifolded ( \i _ - > Sum i ) $ ...
b7c2db43c7442aef33ddbbac58ff8f10738fdfa23609f3bcfc5b7934bb8d6f12
kompendium-ano/factom-haskell-client
Diagnostics.hs
# LANGUAGE DeriveGeneric # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # {-# LANGUAGE TypeOperators #-} module Factom.RPC.Types.Diagnostics where import Control.Applicative import Control.Mo...
null
https://raw.githubusercontent.com/kompendium-ano/factom-haskell-client/87a73bb9079859f6223f8259da0dc9da568d1233/src/Factom/RPC/Types/Diagnostics.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE RecordWildCards # # LANGUAGE TypeOperators # ------------------------------------------------------------------------------
# LANGUAGE DeriveGeneric # # LANGUAGE ScopedTypeVariables # # LANGUAGE TemplateHaskell # module Factom.RPC.Types.Diagnostics where import Control.Applicative import Control.Monad (forM_, join, mzero) import Data.Aeson (FromJSON (..), ToJ...
80b31c37c85e925fed0b20a60a5ce73b8a5b42e6546421cae18d1ee61ba2cf7a
mfikes/fifth-postulate
ns363.cljs
(ns fifth-postulate.ns363) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
null
https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns363.cljs
clojure
(ns fifth-postulate.ns363) (defn solve-for01 [xs v] (for [ndx0 (range 0 (- (count xs) 3)) ndx1 (range (inc ndx0) (- (count xs) 2)) ndx2 (range (inc ndx1) (- (count xs) 1)) ndx3 (range (inc ndx2) (count xs)) :when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))] (list (x...
35b5265c561ded61550c4f446a190910467e892075fc3b187080708aaf2acdea
nackjicholson/haskellbook-solutions
myListFns.hs
-- myListFns.hs module MyListFns where safeTail :: [a] -> Maybe [a] safeTail [] = Nothing safeTail (x:[]) = Nothing safeTail (_:xs) = Just xs safeHead :: [a] -> Maybe a safeHead [] = Nothing safeHead (x:_) = Just x
null
https://raw.githubusercontent.com/nackjicholson/haskellbook-solutions/c21bd87773734ba2ae1559553a6a4d10891c61c8/chapter9/myListFns.hs
haskell
myListFns.hs
module MyListFns where safeTail :: [a] -> Maybe [a] safeTail [] = Nothing safeTail (x:[]) = Nothing safeTail (_:xs) = Just xs safeHead :: [a] -> Maybe a safeHead [] = Nothing safeHead (x:_) = Just x
3eb34cee94caa12bca6794d77c6f8834e1af7f58ac74df93be4ffdb281422690
RichiH/git-annex
UpdateIndex.hs
git - update - index library - - Copyright 2011 - 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2011-2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} # LANGUAGE BangPatterns , CPP # module Git.UpdateIndex ( Streamer, pureStreamer, strea...
null
https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Git/UpdateIndex.hs
haskell
Streamers are passed a callback and should feed it lines in the form - read by update-index, and generated by ls-tree. A streamer with a precalculated value. Streams content into update-index from a list of Streamers. A streamer that adds the current tree for a ref. Useful for eg, copying - and modifying branc...
git - update - index library - - Copyright 2011 - 2013 < > - - Licensed under the GNU GPL version 3 or higher . - - Copyright 2011-2013 Joey Hess <> - - Licensed under the GNU GPL version 3 or higher. -} # LANGUAGE BangPatterns , CPP # module Git.UpdateIndex ( Streamer, pureStreamer, strea...
2f53a6a2267cf3f66b738ca60cd71cbbceba70a72c88970346837154f4d37e02
haskell-servant/servant
SwaggerSpec.hs
# LANGUAGE CPP # module Servant.Auth.SwaggerSpec (spec) where import Control.Lens import Data.Proxy import Servant.API import Servant.Auth import Servant.Auth.Swagger import Data.Swagger import Servant.Swagger import Test.Hspec spec :: Spec spec = describe "HasSwagger instance" $ do let swag = toSwagger (Proxy :: ...
null
https://raw.githubusercontent.com/haskell-servant/servant/bd9e4b10900d04bb5a24bcbb8ab2f7246fcd15c7/servant-auth/servant-auth-swagger/test/Servant/Auth/SwaggerSpec.hs
haskell
* API
# LANGUAGE CPP # module Servant.Auth.SwaggerSpec (spec) where import Control.Lens import Data.Proxy import Servant.API import Servant.Auth import Servant.Auth.Swagger import Data.Swagger import Servant.Swagger import Test.Hspec spec :: Spec spec = describe "HasSwagger instance" $ do let swag = toSwagger (Proxy :: ...
d5f82a9cff2b498688d77a0557c5a7760a72cad1f5b8cf728a23050db696633e
racket/drdr
notify.rkt
#lang racket/base (require racket/contract/base racket/date) (define (notify! fmt . args) (define now (current-seconds)) (log-info (format "[~a: ~a] ~a" now (seconds->string now) (apply format fmt args)))) (define (seconds->string secs) (parameterize ([date-display-format 'iso-8601]) (date->string ...
null
https://raw.githubusercontent.com/racket/drdr/a3e5e778a1c19e7312b98bab25ed95075783f896/notify.rkt
racket
#lang racket/base (require racket/contract/base racket/date) (define (notify! fmt . args) (define now (current-seconds)) (log-info (format "[~a: ~a] ~a" now (seconds->string now) (apply format fmt args)))) (define (seconds->string secs) (parameterize ([date-display-format 'iso-8601]) (date->string ...
a93ce6f06251f44286baf30bc12ad3bd134922dab6e091f855bd4f4ef8ab332a
OCamlPro/freeton_wallet
commandMultisigListTransactions.ml
(**************************************************************************) (* *) Copyright ( c ) 2021 OCamlPro SAS (* *) (* All right...
null
https://raw.githubusercontent.com/OCamlPro/freeton_wallet/b97877379e51d96cb3544141d386d502348cfca9/src/freeton_wallet_lib/commandMultisigListTransactions.ml
ocaml
************************************************************************ All rights reserved. This file is distributed u...
Copyright ( c ) 2021 OCamlPro SAS Public License version 2.1 , with the special exception on linking for StringMap open Ezcmd.V2 open EZCMD.TYPES open Types.MULTISIG let get_waiting ?(f = fun _ -> ()) account = let config = Config.config () in let net = Config....
807c0d05564a96e3531f249cc834e6e94be0209d926de0a73b30c3c848cfb945
basho/basho_bench
basho_bench_stats_writer_riemann.erl
%% ------------------------------------------------------------------- %% %% basho_bench: Benchmarking Suite %% Copyright ( c ) 2009 - 2014 Basho Techonologies %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License...
null
https://raw.githubusercontent.com/basho/basho_bench/aa66398bb6a91645dbb97e91a236f3cdcd1f188f/src/basho_bench_stats_writer_riemann.erl
erlang
------------------------------------------------------------------- basho_bench: Benchmarking Suite Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the spe...
Copyright ( c ) 2009 - 2014 Basho Techonologies This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY HOWTO : { stats , } ....
1002a1af7c76a4781cd204f9cdaa5ec8a326404e9f85a701c5885d494d278042
thedavidmeister/xoroshiro128
seed.cljc
(ns xoroshiro128.test.seed (:refer-clojure :exclude [random-uuid]) (:require xoroshiro128.core xoroshiro128.test.util [clojure.test :refer [deftest is]])) (deftest ??uuid->seed128 (let [uuids [#uuid "32be7cb8-cef3-4f1f-bfd7-67993641cb9e" #uuid "89e24685-47cb-4cc3-8c94-112873807db5" ...
null
https://raw.githubusercontent.com/thedavidmeister/xoroshiro128/b4d5be3255e3fa8b78289aa5e7e8e41f14f71aca/test/xoroshiro128/test/seed.cljc
clojure
(ns xoroshiro128.test.seed (:refer-clojure :exclude [random-uuid]) (:require xoroshiro128.core xoroshiro128.test.util [clojure.test :refer [deftest is]])) (deftest ??uuid->seed128 (let [uuids [#uuid "32be7cb8-cef3-4f1f-bfd7-67993641cb9e" #uuid "89e24685-47cb-4cc3-8c94-112873807db5" ...
dfdde237496156819d2c84853eadb3a73319af5ad287a12a70f2345e2473b4d2
zenspider/schemers
exercise.4.67.scm
#!/usr/bin/env csi -s (require rackunit) Exercise 4.67 ;; Devise a way to install a loop detector in the ;; query system so as to avoid the kinds of simple loops illustrated in the text and in * Note Exercise 4 - 64 : : . The general idea is that ;; the system should maintain some sort of history of its curren...
null
https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.67.scm
scheme
Devise a way to install a loop detector in the query system so as to avoid the kinds of simple loops illustrated the system should maintain some sort of history of its current chain of deductions and should not begin processing a query that it is already working on. Describe what kind of information (patterns an...
#!/usr/bin/env csi -s (require rackunit) Exercise 4.67 in the text and in * Note Exercise 4 - 64 : : . The general idea is that query - system implementation in section * Note 4 - 4 - 4 : : , you may want
ae8e15f06d89496708f535c50bd53923fe4c8b056ea54411a61699457a041fec
mvaldesdeleon/aoc18
Paths_aoc18.hs
module Paths_aoc18 ( getDataFileName ) where getDataFileName :: FilePath -> IO FilePath getDataFileName = return
null
https://raw.githubusercontent.com/mvaldesdeleon/aoc18/1a6f6de7c482e5de264360e36f97a3c7487e2457/src/Paths_aoc18.hs
haskell
module Paths_aoc18 ( getDataFileName ) where getDataFileName :: FilePath -> IO FilePath getDataFileName = return
8996abfbdcc355f1cd000ef2890b9187b6b30663ae5e7eff6eedd5dd3b70b713
testdouble/baizen
group_trailer_test.clj
(ns baizen.formats.group-trailer-test (:require [clojure.test :refer :all] [baizen.formats :refer :all] [baizen.formats.group-trailer :refer :all]) (:import (baizen.formats.group_trailer GroupTrailer))) (def group-trailer-line ["98" "11800000" "2" "6/"]) (deftest group-trailer-test (test...
null
https://raw.githubusercontent.com/testdouble/baizen/66bc3da3b660bc88317e1be6fce266a95db883fb/test/baizen/formats/group_trailer_test.clj
clojure
(ns baizen.formats.group-trailer-test (:require [clojure.test :refer :all] [baizen.formats :refer :all] [baizen.formats.group-trailer :refer :all]) (:import (baizen.formats.group_trailer GroupTrailer))) (def group-trailer-line ["98" "11800000" "2" "6/"]) (deftest group-trailer-test (test...
ee81bd21e72f11206f90f998251bece782d5a736e7f467fdb8700ea6ce815a27
kupl/FixML
external.ml
open Lang * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Handling OCaml library functions The functions are defined in moduleSpec.ml * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Handling OCaml library functions The fu...
null
https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/engine/external.ml
ocaml
open Lang * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Handling OCaml library functions The functions are defined in moduleSpec.ml * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Handling OCaml library functions The fu...
e9b847b7735e0a045abba01a3cf149f54414366083a50651bba89f4c976275c0
jtanguy/hmacaroons
Verifier.hs
| Module : Crypto . Macaroon . Verifier Copyright : ( c ) 2015 License : BSD3 Maintainer : Stability : experimental Portability : portable Module : Crypto.Macaroon.Verifier Copyright : (c) 2015 Julien Tanguy License : BSD3 Maintainer : Stability : experimental Por...
null
https://raw.githubusercontent.com/jtanguy/hmacaroons/6fbca87836a4baef171c5ffc774387766c709fbf/src/Crypto/Macaroon/Verifier.hs
haskell
and verifiers. A verifier is a function of type @'Monad' m => 'Caveat' -> m VerifierResult@. It should return: * 'Unrelated' if the caveat is not related to the verifier (for instance a time verifier is given an action caveat); caveat, but failed to parse it completely; * 'Refused' ('VerifierError' reason) i...
| Module : Crypto . Macaroon . Verifier Copyright : ( c ) 2015 License : BSD3 Maintainer : Stability : experimental Portability : portable Module : Crypto.Macaroon.Verifier Copyright : (c) 2015 Julien Tanguy License : BSD3 Maintainer : Stability : experimental Por...
b0adfa77c42e387c577d592aa0225616f56c5097bd46e889ba0901added3187e
janestreet/core_unix
test_command_test_helpers.ml
open! Core open! Import (* the command param we are going to pretend we care about testing *) let param = let open Command.Param in choose_one ~if_nothing_chosen:(Default_to "default") [ flag "foo" (optional string) ~doc:"TXT foo doc" ; flag "bar" (optional string) ~doc:"TXT bar doc" ] ;; (* build...
null
https://raw.githubusercontent.com/janestreet/core_unix/a051098a918b950e9d0a5da7248f1bbfb51388e5/command_test_helpers/test/src/test_command_test_helpers.ml
ocaml
the command param we are going to pretend we care about testing build a little model of the CLI for this command
open! Core open! Import let param = let open Command.Param in choose_one ~if_nothing_chosen:(Default_to "default") [ flag "foo" (optional string) ~doc:"TXT foo doc" ; flag "bar" (optional string) ~doc:"TXT bar doc" ] ;; let commander_cli = unstage (Command_test_helpers.parse_command_line ...
33bb8511c003e458cc7813db1477a736f13ddaa5b0988bcdef35255a1a817d40
jcclinton/wow-emulator
login_server_sup.erl
This is a World of Warcraft emulator written in erlang , supporting client 1.12.x %% Copyright ( C ) 2014 < jamieclinton.com > %% %% 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 Found...
null
https://raw.githubusercontent.com/jcclinton/wow-emulator/21bc67bfc9eea131c447c67f7f889ba040dcdd79/src/login_server_sup.erl
erlang
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 G...
This is a World of Warcraft emulator written in erlang , supporting client 1.12.x Copyright ( C ) 2014 < jamieclinton.com > it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the License , or You should have received a copy...
e11d0de925ced1a4d20fd47be8372b9be01a71609c6860b56fd33ad840875e2a
TOTBWF/teenytt
Pretty.hs
# LANGUAGE DataKinds # # LANGUAGE TypeOperators # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # -- | Pretty-Printing Machinery module TeenyTT.Base.Pretty ( -- * Precedences Prec , nonassoc , left , right , prefix , postfix -- * Display , Display(..) , DisplayEnv , initEnv , disp...
null
https://raw.githubusercontent.com/TOTBWF/teenytt/a45162254b4b3c056b1607f4759bd608fd355165/src/TeenyTT/Base/Pretty.hs
haskell
| Pretty-Printing Machinery * Precedences * Display ** Precedences ** Variables ------------------------------------------------------------------------------ Precedences ------------------------------------------------------------------------------ Display Environments [NOTE: Mutable Display Environments] It...
# LANGUAGE DataKinds # # LANGUAGE TypeOperators # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # module TeenyTT.Base.Pretty ( Prec , nonassoc , left , right , prefix , postfix , Display(..) , DisplayEnv , initEnv , display , leftOf , rightOf , surrounded , isolated , isolat...
5c64b1a0fd6a0b00396dcd6dab7c62fe400fb936744e6a294bb296c4c29e0dd5
diagrams/geometry
Transform.hs
# LANGUAGE DeriveFunctor # {-# LANGUAGE FlexibleContexts #-} # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE ScopedTypeVariables #-} # LANGUAGE TypeFamilies # {-# LANGUAGE TypeOperators #-} ------------------------------------------------------------...
null
https://raw.githubusercontent.com/diagrams/geometry/945c8c36b22e71d0c0e4427f23de6614f4e7594a/src/Geometry/ThreeD/Transform.hs
haskell
# LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeOperators # --------------------------------------------------------------------------- | Module : Geometry.ThreeD.Transform License : BSD-style (see LICENSE) Maintainer : transformations (uniform scaling, t...
# LANGUAGE DeriveFunctor # # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeFamilies # Copyright : ( c ) 2013 - 2017 diagrams team ( see LICENSE ) Transformations specific to three dimensions , with a few generic module Geometry.ThreeD.Transform ( T3 ...
4d9f50057758f7e59bedfc0c784457b273405ba87e78fde482ad2f163b787623
SquidDev/urn
usage.lisp
(import test ()) (import tests/compiler/analysis/optimise/optimise-helpers ()) (import urn/analysis/optimise/usage optimise) (describe "The optimiser" (section "has a fast pass which will strip unused definitions on the top level" (it "that are simple" (affirm-optimise (lambda (tracker options nodes) (opt...
null
https://raw.githubusercontent.com/SquidDev/urn/6e6717cf1376b0950e569e3771cb7e287aed291d/tests/compiler/analysis/optimise/usage.lisp
lisp
Multiple arguments More complex arguments Non empty const-struct Side effect in definition x is used Multiple arguments with some used Used indirectly through syntax-quote Side effect in definition Side effect in mutation Side effect in definition x is used x is used
(import test ()) (import tests/compiler/analysis/optimise/optimise-helpers ()) (import urn/analysis/optimise/usage optimise) (describe "The optimiser" (section "has a fast pass which will strip unused definitions on the top level" (it "that are simple" (affirm-optimise (lambda (tracker options nodes) (opt...
b7e15e28d3009352bf69b10535ca2ff0b51bd64c32ae9753a32974d5fb037d23
openmusic-project/openmusic
defsys.lisp
;;;; -*- Mode: Lisp -*- $ I d : defsys.lisp 659 2008 - 11 - 22 12:45:13Z binghe $ System Definition for LispWorks UDP (in-package :cl-user) ;;; Load COMM package (require "comm") #+(and lispworks4 win32) (pushnew :mswindows *features*) (defsystem lispworks-udp (:optimize ((safety 3) (debug 3))) :members (pa...
null
https://raw.githubusercontent.com/openmusic-project/openmusic/9560c064512a1598cd57bcc9f0151c0815178e6f/OPENMUSIC/code/api/externals/lispworks-udp/defsys.lisp
lisp
-*- Mode: Lisp -*- Load COMM package
$ I d : defsys.lisp 659 2008 - 11 - 22 12:45:13Z binghe $ System Definition for LispWorks UDP (in-package :cl-user) (require "comm") #+(and lispworks4 win32) (pushnew :mswindows *features*) (defsystem lispworks-udp (:optimize ((safety 3) (debug 3))) :members (package rtt lispworks-ud...
0458e02a80d2da3274bbe704684db08bdd1e5f1d4959b73412928b198a46b301
ucsd-progsys/liquidhaskell
Logging.hs
| This module exposes variations over the standard GHC 's logging functions to work with the ' Doc ' type from the \"pretty\ " package . We would like LiquidHaskell to emit diagnostic messages using the very same GHC machinery , so that IDE - like programs ( e.g. " , " etc ) would be able to co...
null
https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/5e9347ac719e0ca192b05ccde74617d0cbb05a85/src-ghc/Liquid/GHC/Logging.hs
haskell
| This module exposes variations over the standard GHC 's logging functions to work with the ' Doc ' type from the \"pretty\ " package . We would like LiquidHaskell to emit diagnostic messages using the very same GHC machinery , so that IDE - like programs ( e.g. " , " etc ) would be able to co...
2f6d6f9c9e1696813da90f94d4d64b77b1391d088f62c0ecdade0ae5631ad0d0
NB-Iot/emqx-hw-coap
emqx_hw_coap_registry.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2016 - 2017 EMQ Enterprise , Inc. ( ) %% 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 %% %% ...
null
https://raw.githubusercontent.com/NB-Iot/emqx-hw-coap/76436492a22eaa0cd6560b4f135275ecf16245d0/src/emqx_hw_coap_registry.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2016 - 2017 EMQ Enterprise , Inc. ( ) Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(emqx_hw_coap_registry). -include("emqx_hw_coap.hrl"). -behaviour(gen_server). -export([start_link/0, registe...
233d5c4337204baa6ee8d11eb3b9ebaa98b0907f91891eed6de5879108eb9be0
racket/compatibility
test.rkt
#lang racket/load (define quiet-load (collection-file-path "tests.rktl" "tests" "mzlib")) (load (collection-file-path "quiet.rktl" "tests" "racket"))
null
https://raw.githubusercontent.com/racket/compatibility/492030dac6f095045ce8a13dca75204dd5f34e32/compatibility-test/tests/mzlib/test.rkt
racket
#lang racket/load (define quiet-load (collection-file-path "tests.rktl" "tests" "mzlib")) (load (collection-file-path "quiet.rktl" "tests" "racket"))
be358f232cfb9c482c81c77522c863646565a3f675d971f47ff6c31b37fde61b
voice-literate-programming/xunfei-clj
handler.clj
(ns hello-xunfei.handler (:require [compojure.core :refer :all] [compojure.route :as route] [ring.middleware.defaults :refer [wrap-defaults site-defaults]] [xunfei-clj.core :as xunfei])) (def xunfei-init (xunfei/app-init "your-xunfei-appid")) (defroutes app-routes (GET "/xunfei...
null
https://raw.githubusercontent.com/voice-literate-programming/xunfei-clj/56c79013fa2f87cc8b2f38faf18991a7bf7077c4/examples/hello-xunfei/src/hello_xunfei/handler.clj
clojure
(ns hello-xunfei.handler (:require [compojure.core :refer :all] [compojure.route :as route] [ring.middleware.defaults :refer [wrap-defaults site-defaults]] [xunfei-clj.core :as xunfei])) (def xunfei-init (xunfei/app-init "your-xunfei-appid")) (defroutes app-routes (GET "/xunfei...
ccdc5cf5cdde39fa0626a64526f92b4f8e4813ec55f76bfc118a33b79e85d24d
joearms/adapter_pattern
server.erl
-module(server). -compile(export_all). -import(lists, [reverse/1]). start([Mod]) -> Port = 1234, Z = Mod:start_link([{port, Port}, {handler, fun handle_request/1}]), io:format("Server started with ~w~n",[Mod]), receive after infinity -> void end. handle_request(R) -> Path = R:get(path...
null
https://raw.githubusercontent.com/joearms/adapter_pattern/f9cf77b6326daa47a4e401405d11953e2afc7547/server.erl
erlang
-module(server). -compile(export_all). -import(lists, [reverse/1]). start([Mod]) -> Port = 1234, Z = Mod:start_link([{port, Port}, {handler, fun handle_request/1}]), io:format("Server started with ~w~n",[Mod]), receive after infinity -> void end. handle_request(R) -> Path = R:get(path...
dac8bd8dba6f41eb7d8207b07b9424d32784976fb4bd28c2f66cfe85f908f09c
MLstate/opalang
qmlAnnotMap.ml
Copyright © 2011 MLstate This file is part of . is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . is distributed in the hope that it will be useful , ...
null
https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/libqmlcompil/qmlAnnotMap.ml
ocaml
For the semantics, have a look at the .mli. registering exception printers specific functions: please add more if useful module Ref
Copyright © 2011 MLstate This file is part of . is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . is distributed in the hope that it will be useful , ...
5af708934bdde330e7a72cad4f8e040de5e6931d2a96d273c6893358bb10f8f1
eggzilla/RNAlien
cmsearchToBED.hs
# LANGUAGE RecordWildCards # {-# LANGUAGE DeriveDataTypeable #-} | Convert cmsearch output to Browser Extensible Data ( BED ) format : cmsearchToBED -i /path / to / test.clustal module Main where import Prelude import System.Console.CmdArgs import Biobase.RNAlien.Library import Data.Either.Unwrap import qualifi...
null
https://raw.githubusercontent.com/eggzilla/RNAlien/026b8885482561eb89b738a954829f37050cee4b/Biobase/cmsearchToBED.hs
haskell
# LANGUAGE DeriveDataTypeable # | null cmHits = Left "cmsearch file contains no hits" | otherwise = Right (bedHeader ++ bedEntries) browserPosition = L.unpack (hitSequenceHeader firstHit) ++ ":" ++ entryStart firstHit ++ "-" ++ entryEnd firstHit firstHit = (head cmHits) entryline = L.unpack...
# LANGUAGE RecordWildCards # | Convert cmsearch output to Browser Extensible Data ( BED ) format : cmsearchToBED -i /path / to / test.clustal module Main where import Prelude import System.Console.CmdArgs import Biobase.RNAlien.Library import Data.Either.Unwrap import qualified Data.ByteString.Char8 as B import...
a9e0af8a06db696b9ca9e8ce23e68f2f18be4200b97e9a4f87eaa12e7a4a43b7
composewell/streaming-benchmarks
BenchReport.hs
# LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # module Main where import Control.Exception (catch, ErrorCall(..)) import Control.Monad (mzero) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Maybe import Control.Monad.Trans.State import Data.Char (toLower) import Data.List import GHC.R...
null
https://raw.githubusercontent.com/composewell/streaming-benchmarks/f3f056b315ce3bcb0ecd2fbd7699946d6ce9119d/bench-report/BenchReport.hs
haskell
---------------------------------------------------------------------------- Command line parsing ---------------------------------------------------------------------------- Like the shell "shift" to shift the command line arguments totally imperative style option parsing -------------------------------------------...
# LANGUAGE RecordWildCards # # LANGUAGE ScopedTypeVariables # module Main where import Control.Exception (catch, ErrorCall(..)) import Control.Monad (mzero) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Maybe import Control.Monad.Trans.State import Data.Char (toLower) import Data.List import GHC.R...
f4c803be79031f2bdfa5026acbeff54adc1f617fe5818cecec887ec906dc0f9e
janestreet/memtrace_viewer
panel.mli
open! Core open Bonsai_web module State : sig type t = | Collapsed | Expanded end module Collapsible : sig type t = | No | Yes of { initial_state : State.t } end val panel : ?title:string Value.t -> Vdom.Node.t Value.t -> id:string -> collapsible:Collapsible.t -> Vdom.Node.t Computatio...
null
https://raw.githubusercontent.com/janestreet/memtrace_viewer/46439f8bd16e77c5aa38632c9c4aa53175121d4d/client/src/panel.mli
ocaml
open! Core open Bonsai_web module State : sig type t = | Collapsed | Expanded end module Collapsible : sig type t = | No | Yes of { initial_state : State.t } end val panel : ?title:string Value.t -> Vdom.Node.t Value.t -> id:string -> collapsible:Collapsible.t -> Vdom.Node.t Computatio...
a36bdf31f930404dbfa8a99f2b64d747fb63312e82f77b2d1c20dadcf0a78fbe
alanz/ghc-exactprint
T10561.hs
# LANGUAGE PolyKinds , DeriveFunctor , RankNTypes # module T10561 where Ultimately this should " Just Work " , but in GHC 7.10 it gave a failure For now ( HEAD , Jun 2015 ) it gives a kind error message , -- which is better than a crash newtype Compose f g a = Compose (f (g a)) deriving Functor instance fo...
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/T10561.hs
haskell
which is better than a crash
# LANGUAGE PolyKinds , DeriveFunctor , RankNTypes # module T10561 where Ultimately this should " Just Work " , but in GHC 7.10 it gave a failure For now ( HEAD , Jun 2015 ) it gives a kind error message , newtype Compose f g a = Compose (f (g a)) deriving Functor instance forall ( f_ant : : k_ans - > * ...
9711c84f1d177b5850503b21af57918505e4656d5c2744c7c555f99360fbc759
georgegarrington/Syphon
Common.hs
module TypeCheck.Common where import Prelude hiding (id, log) import qualified Data.Set as S --import qualified Data.Map as M import Control.Monad.State.Strict import Control.Monad.Except import AST.Type data Error = NotFound String | RecordNotFound String | WrongFields [String] --The name of the record with t...
null
https://raw.githubusercontent.com/georgegarrington/Syphon/402a326b482e3ce627a15b651b3097c2e09e8a53/src/TypeCheck/Common.hs
haskell
import qualified Data.Map as M The name of the record with the wrong fields types Cases do not all have the same type Used for development, message along with the thingies Data type that the inference function will use as state A counter for unique type variable ids The messages added will be in reverse order Generate ...
module TypeCheck.Common where import Prelude hiding (id, log) import qualified Data.Set as S import Control.Monad.State.Strict import Control.Monad.Except import AST.Type data Error = NotFound String | RecordNotFound String | MissingField | NoOptionals String | WrongOptField String | Misc String | Debug St...
1b4a952b4267ad101181af481f739ea25c539abace7656733d3083e0c8dfbd2b
haskell-tools/haskell-tools
WithLocals.hs
module Refactor.InlineBinding.WithLocals where b = a a = x y where x = id y = ()
null
https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/InlineBinding/WithLocals.hs
haskell
module Refactor.InlineBinding.WithLocals where b = a a = x y where x = id y = ()
dd90459bce72cf9e2db254a9439655c478d24c2a15c5b2e94bd3957961ccacfc
dselsam/arc
SymmetrifyGrid.hs
Copyright ( c ) 2020 Microsoft Corporation . All rights reserved . Released under Apache 2.0 license as described in the file LICENSE . Authors : , , . # LANGUAGE ScopedTypeVariables # {-# LANGUAGE StrictData #-} module Solver.Tactics.SymmetrifyGrid where import Util.Imports import Solver.SolveM import So...
null
https://raw.githubusercontent.com/dselsam/arc/7e68a7ed9508bf26926b0f68336db05505f4e765/src/Solver/Tactics/SymmetrifyGrid.hs
haskell
# LANGUAGE StrictData #
Copyright ( c ) 2020 Microsoft Corporation . All rights reserved . Released under Apache 2.0 license as described in the file LICENSE . Authors : , , . # LANGUAGE ScopedTypeVariables # module Solver.Tactics.SymmetrifyGrid where import Util.Imports import Solver.SolveM import Solver.Goal import qualified D...
749b7d8adfde52f9cae8c7c113439e709025a10a0741a86a83cc9e7f8c6f1ddd
aistrate/Okasaki
Ex05_04a.hs
# LANGUAGE FlexibleInstances , MultiParamTypeClasses # module Ex05_04a (module Heap, SplayHeap, toList, printHeap) where import Heap data SplayHeap a = E | T (SplayHeap a) a (SplayHeap a) deriving (Eq, Show) bigger pivot E = E bigger pivot (T a x b) = if x <= pivot then bigge...
null
https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/MyCode/Ch05/Ex05_04a.hs
haskell
Helpers
# LANGUAGE FlexibleInstances , MultiParamTypeClasses # module Ex05_04a (module Heap, SplayHeap, toList, printHeap) where import Heap data SplayHeap a = E | T (SplayHeap a) a (SplayHeap a) deriving (Eq, Show) bigger pivot E = E bigger pivot (T a x b) = if x <= pivot then bigge...
a1e643a7c94381f6f03b501376b687e73807db9140ae18b0e7556722d5d5e05c
haskell-lisp/yale-haskell
class.scm
;;; Before classes are converted, the super class relation is computed. ;;; This sets up the super and super* field of each class and ;;; checks for the following errors: in context ;;; cyclic class structure ;;; Non-class in context (define (compute-super-classes modules) (let ((all-classes '())) (walk-m...
null
https://raw.githubusercontent.com/haskell-lisp/yale-haskell/4e987026148fe65c323afbc93cd560c07bf06b3f/tdecl/class.scm
scheme
Before classes are converted, the super class relation is computed. This sets up the super and super* field of each class and checks for the following errors: cyclic class structure Non-class in context This sets up the following fields in the class entry: instances '() defaults = ast for defaults ...
in context (define (compute-super-classes modules) (let ((all-classes '())) (walk-modules modules (lambda () (dolist (c (module-classes *module*)) (remember-context c (with-slots class-decl (super-classes class class-var) c (let* ((def (class-ref-class class)) (local-ctxts '(...
aada6d21d73105c7e5c46e806a36a4d6b6659b5277ee8a1b187bdd7ef9cb4e84
Deducteam/zenon_modulo
index.mli
Copyright 2004 INRIA $ I d : index.mli , v 1.11 2010 - 04 - 20 12:01:12 doligez Exp $ open Expr;; (* ==== main formula list ==== *) (* [add] and [remove] must be used in LIFO order *) val add : expr -> int -> unit;; val remove : expr -> unit;; val member : expr -> bool;; val get_goalness : expr -> int;; v...
null
https://raw.githubusercontent.com/Deducteam/zenon_modulo/9534fbdca0d009a513cb40d9a5a2a98329835c63/index.mli
ocaml
==== main formula list ==== [add] and [remove] must be used in LIFO order ==== transitive relations ==== ==== proof cache ==== ==== definitions ==== ==== depth of metavariables ==== ==== numbering for formulas ==== raises Not_found ==== numbering for tau-expressions ====
Copyright 2004 INRIA $ I d : index.mli , v 1.11 2010 - 04 - 20 12:01:12 doligez Exp $ open Expr;; val add : expr -> int -> unit;; val remove : expr -> unit;; val member : expr -> bool;; val get_goalness : expr -> int;; val get_all : unit -> (expr * goalness) list;; val find_pos : string -> (expr * goalne...