_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 |
|---|---|---|---|---|---|---|---|---|
aaf6684c2d4dca10b3a16e5fa9e202a1fb9f54c4f2b3488f8293ab88dd78b88e | avsm/osrelease | osrelease.ml |
* Copyright ( c ) 2020 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " A... | null | https://raw.githubusercontent.com/avsm/osrelease/b7f343c8ecbb63884eb6a94e9bdcbf1c21919f46/lib/osrelease.ml | ocaml | TODO WoW64? |
* Copyright ( c ) 2020 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " A... |
e6e27259f855860f16285d078790021ec8c655961d1337ab3cdcca084cafce36 | ekmartin/sprocket | examples.scm | (load "server.scm")
(define server (create-server))
Middleware , called for each request :
(add-handler
server
(lambda (req params)
(printf "-> request: ~A" req)))
(get server
(lambda (req params) '(200 () "Hello World!"))
'("hello-world"))
(post server
(lambda (req params) '(200 () "\o/"))
... | null | https://raw.githubusercontent.com/ekmartin/sprocket/ed1f6a574521ce389a877333fed5c7824b1fdccb/examples.scm | scheme | Error middleware example:
trigger an error:
Simple handler example:
Static example:
Redirect example:
Routing pattern examples:
JSON parser example: | (load "server.scm")
(define server (create-server))
Middleware , called for each request :
(add-handler
server
(lambda (req params)
(printf "-> request: ~A" req)))
(get server
(lambda (req params) '(200 () "Hello World!"))
'("hello-world"))
(post server
(lambda (req params) '(200 () "\o/"))
... |
04ae98be0cf22026cd9c34ceac9a423ae4a73b674255582537e3d54b76ffb19c | xldenis/ill | Declaration.hs | {-# LANGUAGE OverloadedStrings #-}
module Thrill.Parser.Declaration (declaration) where
import Thrill.Prelude
import Text.Megaparsec hiding (many, some)
import Thrill.Syntax
import Thrill.Parser.Lexer
import Thrill.Parser.Pattern
import Thrill.Parser.Type
import Thrill.Parser.Expression
declaration :: Pa... | null | https://raw.githubusercontent.com/xldenis/ill/46bb41bf5c82cd6fc4ad6d0d8d33cda9e87a671c/src/Thrill/Parser/Declaration.hs | haskell | # LANGUAGE OverloadedStrings # | module Thrill.Parser.Declaration (declaration) where
import Thrill.Prelude
import Text.Megaparsec hiding (many, some)
import Thrill.Syntax
import Thrill.Parser.Lexer
import Thrill.Parser.Pattern
import Thrill.Parser.Type
import Thrill.Parser.Expression
declaration :: Parser (Decl Name SourceSpan)
declara... |
b53c26f1c99ef95b1ce595fc5657f1a043ee563dbbf99a3554dfbb39d596a9ab | ragkousism/Guix-on-Hurd | onc-rpc.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 , 2017 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundati... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/onc-rpc.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 , 2017 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages onc-rpc)
#:use-module (guix licenses)
#:use-modu... |
4469b9aeea5944daba5f8f7361430ead777b2a7d7db1fa523f5a3adbab5b8dc3 | cambium-clojure/cambium.core | util.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the ... | null | https://raw.githubusercontent.com/cambium-clojure/cambium.core/be81c197e44d1aeb787c151d280b1347a8d3dcbf/src/cambium/codec/util.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this ... | Copyright ( c ) . All rights reserved .
(ns cambium.codec.util
(:require
[clojure.edn :as edn]))
(defn as-str
"Turn given argument into string."
^String [^Object x]
(cond
(instance?
clojure.lang.Named x) (if-let [^String the-ns (namespace x)]
(let [^StringBu... |
8450a73cd3711a950dc43be8f74d29558a1c0a3887a84989d4c80d4fda9b1b35 | REPROSEC/dolev-yao-star | Vale_Math_Poly2_Words.ml | open Prims
| null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Vale_Math_Poly2_Words.ml | ocaml | open Prims
| |
decd0fde0a3bc8b05f0ff56a0cc57490f0a28a138a011638413c468b07a75963 | bob-cd/bob | resource_test.clj | ; Copyright 2018- Rahul De
;
Use of this source code is governed by an MIT - style
; license that can be found in the LICENSE file or at
; .
(ns runner.resource-test
(:require
[clojure.java.io :as io]
[clojure.string :as s]
[clojure.test :refer [deftest is testing]]
[contajners.core :as c]
[failjure... | null | https://raw.githubusercontent.com/bob-cd/bob/906f746680585eb6ac5436cb60b386457a379664/runner/test/runner/resource_test.clj | clojure | Copyright 2018- Rahul De
license that can be found in the LICENSE file or at
. | Use of this source code is governed by an MIT - style
(ns runner.resource-test
(:require
[clojure.java.io :as io]
[clojure.string :as s]
[clojure.test :refer [deftest is testing]]
[contajners.core :as c]
[failjure.core :as f]
[runner.engine :as eng]
[runner.resource :as r]
[runner.util :as ... |
403d3486e2a4437634187553724021511817a1c968706aff960446ac82492370 | patricoferris/ocaml-multicore-monorepo | server.ml | let () =
Eio_main.run @@ fun env ->
Dream.run env
@@ Dream.logger
@@ Dream.router [
Dream.get "/:word"
(fun request ->
Dream.param request "word"
|> Template.render
|> Dream.html);
]
@@ Dream.not_found
| null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/example/w-template-files/server.ml | ocaml | let () =
Eio_main.run @@ fun env ->
Dream.run env
@@ Dream.logger
@@ Dream.router [
Dream.get "/:word"
(fun request ->
Dream.param request "word"
|> Template.render
|> Dream.html);
]
@@ Dream.not_found
| |
75ee67b6765c705b7d04e5e634af80454f08bdfc621aa92056f8b8e0396a4f56 | GaloisInc/tower | Tower.hs | # LANGUAGE DataKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Ivory.Tower.Monad.Tower
( Tower(..)
, Tower'
, runTower
, runTower_
, towerGetBackend
, towerGetHandlers
, towerNewChannel
, towerPutHandle... | null | https://raw.githubusercontent.com/GaloisInc/tower/a43f5e36c6443472ea2dc15bbd49faf8643a6f87/tower/src/Ivory/Tower/Monad/Tower.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE DataKinds #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Ivory.Tower.Monad.Tower
( Tower(..)
, Tower'
, runTower
, runTower_
, towerGetBackend
, towerGetHandlers
, towerNewChannel
, towerPutHandler
, towerPutMonitor
, to... |
d6df94bd1f6c37b9eb596638702222506980f1597ddaaf6964892f86fed7fc68 | quil-lang/qvm | misc.lisp | ;;;; misc.lisp
;;;;
Author :
(in-package #:qvm)
;;; Miscellaneous routines that don't have a home.
(defun program-matrix (pp)
"Compute the matrix of the parsed program PP by way of simulating it on every basis element."
(let* ((n (quil:qubits-needed pp))
(dim (expt 2 n))
(m (magicl:zeros (l... | null | https://raw.githubusercontent.com/quil-lang/qvm/de95ead6e7df70a1f8e0212455a802bd0cef201c/src/misc.lisp | lisp | misc.lisp
Miscellaneous routines that don't have a home.
write out the amplitudes | Author :
(in-package #:qvm)
(defun program-matrix (pp)
"Compute the matrix of the parsed program PP by way of simulating it on every basis element."
(let* ((n (quil:qubits-needed pp))
(dim (expt 2 n))
(m (magicl:zeros (list dim dim))))
(dotimes (basis-state dim m)
(let ((q (make-q... |
4ec87b8ee69495d46ee221431237997d44a0b274e62f4b198f6c61d092b10e64 | guicho271828/alien | 6-invariant.lisp |
;; this file is inadequately named as invariant.lisp.
;; it is in fact only running the axiom-layer deduction.
;; the true invariant synthesis code is added in the future.
(in-package :alien)
(named-readtables:in-readtable :fare-quasiquote)
;; (-> "ipc2011-opt/transport-opt11/p01.pddl"
;; %rel
;; parse
;; easy... | null | https://raw.githubusercontent.com/guicho271828/alien/6987d034426b8928adf67f498dc6cb06fd7f923e/preprocess/6-invariant.lisp | lisp | this file is inadequately named as invariant.lisp.
it is in fact only running the axiom-layer deduction.
the true invariant synthesis code is added in the future.
(-> "ipc2011-opt/transport-opt11/p01.pddl"
%rel
parse
easy-invariant
ground
print)
(-> "axiom-domains/opttel-adl-derived/p01.pddl"
%... |
(in-package :alien)
(named-readtables:in-readtable :fare-quasiquote)
(defvar *facts*)
(defvar *ops*)
(defvar *ground-axioms*)
(defvar *axiom-layers*)
(defun mutex-invariant (info)
(with-parsed-information3 info
(list* :axiom-layers (axiom-layers)
info)))
(defun axiom-layers (&optional (package (f... |
6b0e442967bef67a7d1b406ea4238e45fd6d84f4fb9d5b6edde4752aae3d8483 | backtracking/bheap | binary_heap.mli | (**************************************************************************)
(* *)
Copyright ( C )
(* *)
(* This software is free software;... | null | https://raw.githubusercontent.com/backtracking/bheap/46f0f779d8acaf51fee488d350ffb490c7cec79b/binary_heap.mli | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | Copyright ( C )
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
* Traditional implementation of priority queues using a binary heap
encoded in a resizable array .
When... |
417bd087bcec37dba2578bc8a6de202b64f893bea3c410b45a2f1d3d74bce7bc | onyx-platform/learn-onyx | challenge_1_2.clj | (ns workshop.challenge-1-2
(:require [workshop.workshop-utils :as u]))
Workflows ; ; ;
;;; <<< BEGIN FILL ME IN >>>
(def workflow)
;;; <<< END FILL ME IN >>>
;;; Catalogs ;;;
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx/plugin :ony... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/src/workshop/challenge_1_2.clj | clojure | ; ;
<<< BEGIN FILL ME IN >>>
<<< END FILL ME IN >>>
Catalogs ;;;
Functions ;;;
; ; | (ns workshop.challenge-1-2
(:require [workshop.workshop-utils :as u]))
(def workflow)
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx/plugin :onyx.plugin.core-async/input
:onyx/type :input
:onyx/medium :core.async
:... |
adf8c659764f293510e7937caaa7b07e4ee4c9533d5bee51236820fdefe87086 | ocaml-multicore/tezos | ticket_storage.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_protocol/ticket_storage.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN A... |
678c26b51651baa82f69085868dab28af7d63e66b4998fdbd71e3a9d3c08560e | HouzuoGuo/Aurinko | socket.clj | Modified from clojure.contrib.server - socket by
(ns Aurinko.socket
(:import (java.net InetAddress ServerSocket Socket SocketException)
(java.io InputStreamReader OutputStream OutputStreamWriter PrintWriter)
(clojure.lang LineNumberingPushbackReader)))
(defn- on-thread [f]
(doto (Thread. ^... | null | https://raw.githubusercontent.com/HouzuoGuo/Aurinko/f24bcab53da45b477d0b842bc4ab9ff1e08f505c/src/Aurinko/socket.clj | clojure | Modified from clojure.contrib.server - socket by
(ns Aurinko.socket
(:import (java.net InetAddress ServerSocket Socket SocketException)
(java.io InputStreamReader OutputStream OutputStreamWriter PrintWriter)
(clojure.lang LineNumberingPushbackReader)))
(defn- on-thread [f]
(doto (Thread. ^... | |
a93873c9c334d91af0214f27f0319a39b0521c031f11e142e7f8427381d26af4 | e-bigmoon/haskell-blog | Proxy_settings2.hs | #!/usr/bin/env stack
-- stack script --resolver lts-17.3
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Lazy.Char8 as L8
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import Network.HTTP.Types.Status (statusCode)
main :: IO ()
main = do
manager <- new... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/appendix/ap4/Proxy_settings2.hs | haskell | stack script --resolver lts-17.3
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
import qualified Data.ByteString.Lazy.Char8 as L8
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import Network.HTTP.Types.Status (statusCode)
main :: IO ()
main = do
manager <- newManager tlsManagerSettings
let request = ""
{ proxy = ... |
825b3a809259e3b00d115b161674be0345387234b2ea9b13b9a30cc1b7c036b7 | grin-compiler/ghc-wpc-sample-programs | AST.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE LambdaCase #
|
Module : Text . Pandoc . Lua . . AST
Copyright : © 2012 - 2020
© 2017 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Stability : alpha
/ unmarshaling instan... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc/Lua/Marshaling/AST.hs | haskell | Inline
| Interpret the value at the given stack index as meta value.
Get the contents of an AST element.
no meta value tag given, try to guess.
| Return the value at the given index as block if possible.
Get the contents of an AST element.
| Return the value at the given index as inline if possible.
Get the con... | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE LambdaCase #
|
Module : Text . Pandoc . Lua . . AST
Copyright : © 2012 - 2020
© 2017 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Stability : alpha
/ unmarshaling instan... |
9e46107c8219261921579fb81de2d138180b9c99ff294384cf418eb7fd8f6aa8 | ocaml-community/lambda-term | lTerm.ml |
* lTerm.ml
* --------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of Lambda - Term .
* lTerm.ml
* --------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Lambda-Term.
*)
open Lwt_react
open LTerm_geom
let return, (>... | null | https://raw.githubusercontent.com/ocaml-community/lambda-term/8d323b24135a97e30f9a4d10baf93612dc871c1c/src/lTerm.ml | ocaml | +-----------------------------------------------------------------+
| TTYs sizes |
+-----------------------------------------------------------------+
+-----------------------------------------------------------------+
| The terminal type ... |
* lTerm.ml
* --------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of Lambda - Term .
* lTerm.ml
* --------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of Lambda-Term.
*)
open Lwt_react
open LTerm_geom
let return, (>... |
bb341ad0f5c92afe4834ae9103572152f4b553493bda2bec606a391040041162 | nuprl/gradual-typing-performance | main.rkt | #lang typed/racket
(require "base-types.rkt")
(require benchmark-util)
(require/typed/check "aux.rkt"
[list-pick-random (-> (Listof Tetra) Tetra)]
[tetras (Listof Tetra)])
(require/typed/check "bset.rkt"
[blocks-overflow? (-> BSet Boolean)])
(require/typed/check "world.rkt"
[world-key-move (-> World String Wo... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/experimental/unsafe/tetris/typed/main.rkt | racket | 0ms | #lang typed/racket
(require "base-types.rkt")
(require benchmark-util)
(require/typed/check "aux.rkt"
[list-pick-random (-> (Listof Tetra) Tetra)]
[tetras (Listof Tetra)])
(require/typed/check "bset.rkt"
[blocks-overflow? (-> BSet Boolean)])
(require/typed/check "world.rkt"
[world-key-move (-> World String Wo... |
4d0fec8fb4ca5a4ee0fde38d5dcb6f7075c147429c8c81c10900e4a5710f1621 | w3ntao/sicp-solution | 2-1.rkt | #lang racket
(define (gcd a b)
(if (= a 0) b
(gcd (remainder b a) a)))
(define (make-rat n d)
(let ((g (gcd n d)))
(if (< (/ d g) 0) (cons (- (/ n g)) (- (/ d g)))
(cons (/ n g) (/ d g)))))
(define (numer x) (car x))
(define (denom x) (cdr x))
(define (mul-rat x y)
(make-rat (* (numer x) (n... | null | https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-2/2-1.rkt | racket | #lang racket
(define (gcd a b)
(if (= a 0) b
(gcd (remainder b a) a)))
(define (make-rat n d)
(let ((g (gcd n d)))
(if (< (/ d g) 0) (cons (- (/ n g)) (- (/ d g)))
(cons (/ n g) (/ d g)))))
(define (numer x) (car x))
(define (denom x) (cdr x))
(define (mul-rat x y)
(make-rat (* (numer x) (n... | |
1c58964fd850db7be5da0f658e00166bd39e7093238b8aedf5084abf9f436144 | gilith/hol-light | four_squares.ml | (* ========================================================================= *)
Theorems about representations as sums of 2 and 4 squares .
(* ========================================================================= *)
needs "Library/prime.ml";;
* * only for REAL_ARCH_LEAST ! * *
prioritize_num();;... | null | https://raw.githubusercontent.com/gilith/hol-light/f3f131963f2298b4d65ee5fead6e986a4a14237a/100/four_squares.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
Definition of involution and various basic lemmas.
---------------... | Theorems about representations as sums of 2 and 4 squares .
needs "Library/prime.ml";;
* * only for REAL_ARCH_LEAST ! * *
prioritize_num();;
let involution = new_definition
`involution f s = !x. x IN s ==> f(x) IN s /\ (f(f(x)) = x)`;;
let INVOLUTION_IMAGE = prove
(`!f s. involution f s ==> (I... |
7a0c09244d643fb50867ae27cf0a3a351a8949c50985af349ca6e99e618c8e03 | Tyruiop/needle | flow.clj | (ns example.flow
(:require [needle.trace :refer [defn-trace send-flow-event dump-log]]))
(def test-agent (agent []))
(def sum-agent (agent []))
(defn-trace sum-to-many test-agent
[max-val]
(reduce + 0 (range max-val)))
(defn-trace sum-to
{:agent test-agent
:mode :EB
:flow-mode :t
:save-args true
... | null | https://raw.githubusercontent.com/Tyruiop/needle/6bc2bdc680fc218fb75e69eabcb1c55e919ac859/examples/flow.clj | clojure | (ns example.flow
(:require [needle.trace :refer [defn-trace send-flow-event dump-log]]))
(def test-agent (agent []))
(def sum-agent (agent []))
(defn-trace sum-to-many test-agent
[max-val]
(reduce + 0 (range max-val)))
(defn-trace sum-to
{:agent test-agent
:mode :EB
:flow-mode :t
:save-args true
... | |
26990411dc1fe8a63f88bbd59d3b11d65f83a7476c29e004ee1ecff33cdf5867 | graninas/GraphServer | Draw.hs | module Draw.Draw where
import qualified Graphics.Rendering.OpenGL as GL
import Language.Haskell.Syntax
import Structure.StructureObject
import Structure.SOConstruct
import Draw.Render
import Draw.TextureInit
import Common.Units
import Common.GLTypes
import Common.TestData
draw :: DrawFunction
draw ress@(GLResources... | null | https://raw.githubusercontent.com/graninas/GraphServer/088c234ae840162002f707559cfefc96bcc02bda/src/Draw/Draw.hs | haskell | test ress
let c = constructFramedGRhss (OcsGuardedRhss t6) | module Draw.Draw where
import qualified Graphics.Rendering.OpenGL as GL
import Language.Haskell.Syntax
import Structure.StructureObject
import Structure.SOConstruct
import Draw.Render
import Draw.TextureInit
import Common.Units
import Common.GLTypes
import Common.TestData
draw :: DrawFunction
draw ress@(GLResources... |
3b7bdd5c801baf9ba758aa3bdf8e0810f44cf212ac1e12e46c6205949e78ec35 | unisonweb/unison | Path.hs | # LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
module Unison.Test.Codebase.Path where
import Data.Either
import Data.Sequence
import Data.Text
import EasyTest
import Unison.Codebase.Path
import Unison.Codebase.Path.Parse
import qualified Unison.HashQualified' as HQ'
import Unison.NameSegment
import q... | null | https://raw.githubusercontent.com/unisonweb/unison/cf278f9fb66ccb9436bf8a2eb4ab03fc7a92021d/parser-typechecker/tests/Unison/Test/Codebase/Path.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE OverloadedLists #
module Unison.Test.Codebase.Path where
import Data.Either
import Data.Sequence
import Data.Text
import EasyTest
import Unison.Codebase.Path
import Unison.Codebase.Path.Parse
import qualified Unison.HashQualified' as HQ'
import Unison.NameSegment
import qualified Unison.ShortHash as SH
te... |
cd1b394388b6116fd534063ede634fab219170583fd03d15db03f381d1d276de | heitor-lassarote/iolp | Database.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
module Database where
import Universum
import Database.Esqueleto
import qualified Database.Persist.Postgresql as P
import qualified Database.Persist.Postgresql.JSON as P
import qualified Database.Persist.TH as P
import ... | null | https://raw.githubusercontent.com/heitor-lassarote/iolp/6284ff7127969b95a841a5d7b2af07aa77a38b2d/code-generator/app/Database.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE UndecidableInstances #
module Database where
import Universum
import Database.Esqueleto
import qualified Database.Persist.Postgresql as P
import qualified Database.Persist.Postgresql.JSON as P
import qualified Database.Persist.TH as P
import ... | |
3ca8dc9e645c7f4df9e3710c58c7a15f7dc677234ec88ffdeff55aaf16a34e65 | pflanze/chj-schemelib | stream.scm | Copyright 2010 - 2020 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require (fi... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/stream.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
tests:
huh why here? XX vs test-random ?
stream-%cars+cdrs
allocates pairs for nothing but I don't care right now
variant that doesn't delay evaluation:
(ugly copy-paste)
adapted (list-util-1 map/iota)
... | Copyright 2010 - 2020 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require (fixnum inc dec)
lazy
define-strict-and-lazy
cj-struct
list-util
cj-cmp
(cj-functional compose compose*)
... |
1f1be83bf1b68adbe632f671faf6b3f0362459e344846174f114980e545b2ef8 | fujita-y/ypsilon | srfi-14.scm | #!nobacktrace
(define-library (srfi srfi-14)
(import (srfi 14))
(export ->char-set
char-set
char-set->list
char-set->string
char-set-adjoin
char-set-adjoin!
char-set-any
char-set-complement
char-set-complement!
char-set-contai... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/44260d99e24000f9847e79c94826c3d9b76872c2/sitelib/srfi/srfi-14.scm | scheme | #!nobacktrace
(define-library (srfi srfi-14)
(import (srfi 14))
(export ->char-set
char-set
char-set->list
char-set->string
char-set-adjoin
char-set-adjoin!
char-set-any
char-set-complement
char-set-complement!
char-set-contai... | |
a65d6dc968252f4b82322066dda792c215dc57e7965dca03ca119699d97eec8e | gilith/hol-light | pell.ml | (* ========================================================================= *)
Analysis of solutions to equation
(* ========================================================================= *)
needs "Library/analysis.ml";;
needs "Library/transc.ml";;
needs "Library/prime.ml";;
... | null | https://raw.githubusercontent.com/gilith/hol-light/f3f131963f2298b4d65ee5fead6e986a4a14237a/Examples/pell.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
Useful number-theoretic basics
---------------... | Analysis of solutions to equation
needs "Library/analysis.ml";;
needs "Library/transc.ml";;
needs "Library/prime.ml";;
prioritize_real();;
let PELL_INDUCTION = prove
(`P 0 /\ P 1 /\ (!n. P n /\ P (n + 1) ==> P(n + 2)) ==> !n. P n`,
STRIP_TAC THEN
SUBGOAL_THEN `!n. P n /\ P... |
7ae1e0aa47993859a94dd3981d06a97f2f26b4f2b2f1fb8adb32947da9894f9c | Bogdanp/aoc2020 | day02.rkt | #lang racket/base
(require racket/match
racket/port)
(define lines
(call-with-input-file "input02.txt" port->lines))
(define spec
#px"^(\\d+)-(\\d+) (.): (.+)")
(define (read-password-line line)
(match (regexp-match spec line)
[(list _
(app string->number lo)
(app string->nu... | null | https://raw.githubusercontent.com/Bogdanp/aoc2020/4021ed7a85eb58f655f38a9069656d64aaaa2ace/day02.rkt | racket | #lang racket/base
(require racket/match
racket/port)
(define lines
(call-with-input-file "input02.txt" port->lines))
(define spec
#px"^(\\d+)-(\\d+) (.): (.+)")
(define (read-password-line line)
(match (regexp-match spec line)
[(list _
(app string->number lo)
(app string->nu... | |
7aa9376b2c6f2a9a63d15d4e83546533b81a900ce81abb13f2ae5babe66cb9ca | EarnestResearch/honeycomb-haskell | Servant.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
module Network.Wai.Honeycomb.Servant
( traceApplication,
traceApplicationT,
module Network.Wai.Honeycomb,
)
wher... | null | https://raw.githubusercontent.com/EarnestResearch/honeycomb-haskell/0cb643a637e1b23eecded845970e6a973f8385cf/honeycomb-servant-server/src/Network/Wai/Honeycomb/Servant.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
module Network.Wai.Honeycomb.Servant
( traceApplication,
traceApplicationT,
module Network.Wai.Honeycomb,
)
where
import Control.Monad.Read... |
91a0d2f33c4a0c3874faab3094411eda1ffd2c38797e3e5fceb823f12472470f | ghc/ghc | T23019.hs | module T23019
(
eexponent
) where
-- spine lazy, value strict list of doubles
data List
= Nil
| {-# UNPACK #-} !Double :! List
infixr 5 :!
newtype TowerDouble = Tower { getTower :: List }
primal :: TowerDouble -> Double
primal (Tower (x:!_)) = x
primal _ = 0
eexponent :: TowerDouble -> Int
eexponent = ex... | null | https://raw.githubusercontent.com/ghc/ghc/2f97c86151d7eed115ddcbdee1842684aed63176/testsuite/tests/numeric/should_compile/T23019.hs | haskell | spine lazy, value strict list of doubles
# UNPACK # | module T23019
(
eexponent
) where
data List
= Nil
infixr 5 :!
newtype TowerDouble = Tower { getTower :: List }
primal :: TowerDouble -> Double
primal (Tower (x:!_)) = x
primal _ = 0
eexponent :: TowerDouble -> Int
eexponent = exponent . primal
|
59cd658b9743c5d9f30085cb24911fffe51445cf7a5cdcd05c25ce8de9b0e11f | wavejumper/rehook | native.cljs | (ns rehook.dom.native
(:require
["react" :as react]
["react-native" :as rn]
[rehook.util :as util]
[rehook.dom.util :as dom.util]))
(defn handle-type
[args e ctx $]
(cond
(#{:<> :>} e)
[react/Fragment args]
(keyword? e)
(let [[elem extra-args] (dom.util/keyword->elem e)]
[(aget... | null | https://raw.githubusercontent.com/wavejumper/rehook/c1a4207918827f4b738cdad9a9645385e5e10ff4/rehook-dom/src/rehook/dom/native.cljs | clojure | (ns rehook.dom.native
(:require
["react" :as react]
["react-native" :as rn]
[rehook.util :as util]
[rehook.dom.util :as dom.util]))
(defn handle-type
[args e ctx $]
(cond
(#{:<> :>} e)
[react/Fragment args]
(keyword? e)
(let [[elem extra-args] (dom.util/keyword->elem e)]
[(aget... | |
6ac3d243c69b6b1d9ae2b5c993fd44e992933442b0ed2d4d3ca07933d3ee605e | ChristopherBiscardi/snap-for-beginners | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative
import Snap.Core
import Snap.Util.FileServe
import Snap.Http.Server
main :: IO ()
main = quickHttpServe site
site :: Snap ()
site =
ifTop (writeBS "hello world") <|>
route [ ("foo", writeBS... | null | https://raw.githubusercontent.com/ChristopherBiscardi/snap-for-beginners/d35a4bbdd0a459983e2f37400fbc2bf8c8bf6239/code/v2/basic/02-basic/src/Main.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import Control.Applicative
import Snap.Core
import Snap.Util.FileServe
import Snap.Http.Server
main :: IO ()
main = quickHttpServe site
site :: Snap ()
site =
ifTop (writeBS "hello world") <|>
route [ ("foo", writeBS "bar")
, ("echo/:echopar... |
8e776cb2e3fb35832db0da8e640596ae6c42f9305debb30e31f1e71ed0d99d1d | cljfx/cljfx | text_flow.clj | (ns cljfx.fx.text-flow
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.jdk.fx.text-flow :as jdk.fx.text-flow]
[cljfx.fx.pane :as fx.pane])
(:import [javafx.scene.text TextFlow TextAlig... | null | https://raw.githubusercontent.com/cljfx/cljfx/543f7409290051e9444771d2cd86dadeb8cdce33/src/cljfx/fx/text_flow.clj | clojure | overrides
definitions | (ns cljfx.fx.text-flow
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.jdk.fx.text-flow :as jdk.fx.text-flow]
[cljfx.fx.pane :as fx.pane])
(:import [javafx.scene.text TextFlow TextAlig... |
ebe115a34cdbc9e506513e9fa1aa24f8f8682bd417a348fe1d4e597c7d56304c | omariosouto/learnin-public-clojure | middleware.clj | (ns pokebank-ui.middleware
(:require
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.params :refer [wrap-params]]
[prone.middleware :refer [wrap-exceptions]]
[ring.middleware.reload :refer [wrap-reload]]
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]))
(def ... | null | https://raw.githubusercontent.com/omariosouto/learnin-public-clojure/bb66040ef397d4d6e8275330acdd553bbf850a39/projects/pokebank-ui/env/dev/clj/pokebank_ui/middleware.clj | clojure | (ns pokebank-ui.middleware
(:require
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.params :refer [wrap-params]]
[prone.middleware :refer [wrap-exceptions]]
[ring.middleware.reload :refer [wrap-reload]]
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]))
(def ... | |
a7b7a41b7872a73baa32dff280f04bff0a683ed711eb2ed88366ba7e7a21f304 | tatut/xtdberl | xt_supervisor.erl | -module(xt_supervisor).
-behaviour(supervisor).
-export([start_link/1, init/1]).
start_link(Args) ->
supervisor:start_link(xt_supervisor, Args).
init(Args) ->
{ok, {#{strategy => one_for_one},
[#{id => xt,
start => {xt, start_link, [Args]}}]}}.
| null | https://raw.githubusercontent.com/tatut/xtdberl/ddf4c8aea0ddb6934d8a616b99f30a53e52b9b6c/src/xt_supervisor.erl | erlang | -module(xt_supervisor).
-behaviour(supervisor).
-export([start_link/1, init/1]).
start_link(Args) ->
supervisor:start_link(xt_supervisor, Args).
init(Args) ->
{ok, {#{strategy => one_for_one},
[#{id => xt,
start => {xt, start_link, [Args]}}]}}.
| |
8f819faddd3244bc285a1c3fdb51a2f8703c708bec877ea76a212fb91671c534 | nextjournal/clerk | jump_to_definition.clj | ;; # 🤾🏼 Jump to Definition
(ns jump-to-definition
(:require [nextjournal.clerk :as clerk]
[nextjournal.clerk.render :as-alias render]
[nextjournal.clerk.render.hooks :as-alias hooks]
[nextjournal.clerk.viewer :as v]))
;; Trying various ways to support jump to definition
(def my-... | null | https://raw.githubusercontent.com/nextjournal/clerk/94dfb96138cfc549c3e4c0948f6ebf71380a4676/notebooks/jump_to_definition.clj | clojure | # 🤾🏼 Jump to Definition
Trying various ways to support jump to definition | (ns jump-to-definition
(:require [nextjournal.clerk :as clerk]
[nextjournal.clerk.render :as-alias render]
[nextjournal.clerk.render.hooks :as-alias hooks]
[nextjournal.clerk.viewer :as v]))
(def my-code-viewer
{:render-fn 'nextjournal.clerk.render/render-code :transform-fn cler... |
eb43154960d4a988ef556d2dcc31068811053e48623f7b431585f6865095fb3a | marick/Midje | t_defining.clj | (ns midje.checking.checkers.t-defining
(:require [midje.sweet :refer :all]
[midje.checking.checkers.defining :refer [checker?]]
[midje.test-util :refer :all]))
(defchecker magic-number "magic number docstring" {:meta-data :foo} [actual] (= 587 actual))
(fact "checker with a doc string"
magi... | null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/test/midje/checking/checkers/t_defining.clj | clojure | an inline checker | (ns midje.checking.checkers.t-defining
(:require [midje.sweet :refer :all]
[midje.checking.checkers.defining :refer [checker?]]
[midje.test-util :refer :all]))
(defchecker magic-number "magic number docstring" {:meta-data :foo} [actual] (= 587 actual))
(fact "checker with a doc string"
magi... |
d94906a858ee4710bead831978b6b5942e1c75e785642b585fbbb7f0f370ad2f | jimcrayne/jhc | tcfail104.hs | {-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
-- Test the handling of conditionals in rank-n stuff
-- Should fail, regardless of branch ordering
module ShouldFail where
These two are ok
f1 = (\ (x :: forall a. a->a) -> x)
f2 = (\ (x :: forall a. a->a) -> x) id 'c'
-- These fail
f3 v = (if v then
(\ (x :: f... | null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/1_typecheck/4_fail/ghc/tcfail104.hs | haskell | # LANGUAGE Rank2Types, ScopedTypeVariables #
Test the handling of conditionals in rank-n stuff
Should fail, regardless of branch ordering
These fail |
module ShouldFail where
These two are ok
f1 = (\ (x :: forall a. a->a) -> x)
f2 = (\ (x :: forall a. a->a) -> x) id 'c'
f3 v = (if v then
(\ (x :: forall a. a->a) -> x)
else
(\ x -> x)
) id 'c'
f4 v = (if v then
(\ x -> x)
else
(\ (x :: forall a. a->a) -> x)
) id 'c'
|
78e641d61c1074688ca4655c53658b839d62549214739f10aca088b0038619d3 | vaclavsvejcar/headroom | Go.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE NoImplicitPrelude #
-- |
Module : Headroom . FileSupport . Go
-- Description : Support for /Go/ source code files
Copyright : ( c ) 2019 - 2022
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
-- Portability : POSIX
--
-- Basic support for... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/src/Headroom/FileSupport/Go.hs | haskell | |
Description : Support for /Go/ source code files
License : BSD-3-Clause
Maintainer :
Stability : experimental
Portability : POSIX
Basic support for /Go language/ source code files. This implementation doesn't
extract any variables or template data.
---------------------------- PUBLIC FUNCTIONS ----... | # LANGUAGE QuasiQuotes #
# LANGUAGE NoImplicitPrelude #
Module : Headroom . FileSupport . Go
Copyright : ( c ) 2019 - 2022
module Headroom.FileSupport.Go
( fileSupport
)
where
import Headroom.Data.Regex
( isMatch
, re
)
import Headroom.FileSupport.Types
( FileSupport (..)
, ... |
a268623a17ada58c5a59e057ed5df407fd01957dd0d7dbfbda1ebc34a59703c7 | EFanZh/EOPL-Exercises | exercise-6.x-cps-lang.rkt | #lang eopl
CPS - IN grammar .
(define the-lexical-spec
'([whitespace (whitespace) skip]
[comment ("%" (arbno (not #\newline))) skip]
[identifier (letter (arbno (or letter digit "_" "-" "?"))) symbol]
[number (digit (arbno digit)) number]
[number ("-" digit (arbno digit)) number]))
(define the-gra... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-6.x-cps-lang.rkt | racket | Transformer.
Data structures - expressed values.
Data structures - environment.
Data structures - continuation.
Interpreter. | #lang eopl
CPS - IN grammar .
(define the-lexical-spec
'([whitespace (whitespace) skip]
[comment ("%" (arbno (not #\newline))) skip]
[identifier (letter (arbno (or letter digit "_" "-" "?"))) symbol]
[number (digit (arbno digit)) number]
[number ("-" digit (arbno digit)) number]))
(define the-gra... |
d5dba4d75868a78774db5bba4e6946a65d6942251132baf2c301c04dff2840e6 | kelamg/HtDP2e-workthrough | ex62.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-beginner-reader.ss" "lang")((modname ex62) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Fixed-size-Data/ex62.rkt | racket | about the language level of this file in a form that our tools can easily process.
- LOCKED
- CLOSED
- OPEN
turns key event k into an action on state s
translates the state s into a large text image
simulates a door with an automatic door closer | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex62) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(require 2htdp/universe)
(require 2htdp/image)
(define LOCKED "loc... |
c2da420f90d713e914e430fb17655067c6021b47956127e8a85f1a8188ea7c15 | metametadata/carry | project.clj | (defproject
carry-logging "0.3.0"
:description "Console logging middleware for Carry."
:url ""
:license {:name "MIT" :url ""}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.229" :scope "provided"]]
:plugins [[lein-codox "0.10.0"]]
:pedant... | null | https://raw.githubusercontent.com/metametadata/carry/fa5c7cd0d8f1b71edca70330acc97c6245638efb/contrib/logging/project.clj | clojure | (defproject
carry-logging "0.3.0"
:description "Console logging middleware for Carry."
:url ""
:license {:name "MIT" :url ""}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.229" :scope "provided"]]
:plugins [[lein-codox "0.10.0"]]
:pedant... | |
8127ebe8b225e883cea743895ee70ab46397463f2c01c0d0f8614577eb116d55 | AdaCore/why3 | union_find.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/4441127004d53cf2cb0f722fed4a930ccf040ee4/src/infer/union_find.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
type t
type set
val empty: set
val is_leq: set -> set -> bool
val union: t -> t -> set -> set
val join: set... |
8b730ff355fb10c0b9e9e34351cf9360bbe4af205c0dea85a7cb8f1aaa8de544 | xapi-project/stdext | encodings.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/stdext/ac48af8699b7f4d283500139e75cf5167f4f0773/lib/xapi-stdext-encodings/encodings.ml | ocaml | === Utility Functions ===
=== Unicode Functions ===
==== Character Codecs ====
=== Decoding ===
=== Encoding ===
Start by encoding the continuation bytes in reverse order.
Finish by encoding the header byte. |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
37ac8d0623593f5e88306fbdb0b62c27db738bafa622ef414e98e7f04d1d4cc0 | paurkedal/ocaml-prime | unprime_buffer.ml | Copyright ( C ) 2015 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | null | https://raw.githubusercontent.com/paurkedal/ocaml-prime/42efa85317069d726e8e3989e51c24ba03c56b47/lib/unprime_buffer.ml | ocaml | Copyright ( C ) 2015 - -2022 Petter A. Urkedal < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any la... | |
0aa4f40dd20df9e4f21991741474f7203908c0d0bade321c51db7a8cc486f5b6 | chrisdone/ircbrowse | Pagination.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
{-# OPTIONS -fno-warn-name-shadowing -fno-warn-unused-do-bind #-}
-- | Simple pagination support for blaze.
module Text.Blaze.Pagination
(pagination,PN(..))
where
import Data.Foldable hiding (foldr)
import ... | null | https://raw.githubusercontent.com/chrisdone/ircbrowse/d956aaf185500792224b6b0c209eb67c179322a4/upstream/snap-app/src/Text/Blaze/Pagination.hs | haskell | # LANGUAGE OverloadedStrings #
# OPTIONS -fno-warn-name-shadowing -fno-warn-unused-do-bind #
| Simple pagination support for blaze.
| Render pagination as html. | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
module Text.Blaze.Pagination
(pagination,PN(..))
where
import Data.Foldable hiding (foldr)
import Control.Monad hiding (forM_)
import Data.Monoid.Operator
import Data.Pagination
import Network.URI
import ... |
7bb178fa436f65f99fa5a26d958b1a5fe137e47a64bae76dc04b2894b43d5cf9 | robrix/isometry | Algebra.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Standalone... | null | https://raw.githubusercontent.com/robrix/isometry/171b9261b8d7ea32c86ce6019c8c3973742f0349/src/Unit/Algebra.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE GADTs #
* Algebra
* Calculation
* Combinators
* Type-level computation
* Algebra
u * 1 = u
uⁱ * uⁿ = uⁱ⁺ⁿ
u / v * v = u
u * (v * w) = (u * w) * v
u * (v / w) = (u * v) / w
(u * v) * w = (u * w) * v
(u / v) * w = (u * w) / v
u * v = u * v
FIXME: c... | # LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFa... |
e084f02b5839be8ec43efa5e6a0c6ae04c3a370eb44339dcafab4e005ddd1031 | cstar/erls3 | erls3sup.erl | %%%-------------------------------------------------------------------
%% @doc supervisor for gen_server to access S3
%%
%% == Contents ==
%%
%% {@section Introduction}<br/>
%% == Introduction ==
%% This library provides access to the web service using REST based interface.
%% Mostly lifted and adapted from ejabberd... | null | https://raw.githubusercontent.com/cstar/erls3/16f675a30e6866957f7086179fe26648e9432644/src/erls3sup.erl | erlang | -------------------------------------------------------------------
@doc supervisor for gen_server to access S3
== Contents ==
{@section Introduction}<br/>
== Introduction ==
This library provides access to the web service using REST based interface.
Mostly lifted and adapted from ejabberd_odbc_sup code.
A... | 2009
For license information see LICENSE.txt
-module(erls3sup).
-author("Eric Cestari <> []").
-export([start_link/2,
init/1,
get_pids/0,
get_random_pid/0
]).
30 seconds
start_link(Params, N) ->
supervisor:start_link({local, ?MODULE},
?MODULE, [Params, N]).
init([Params, N]) ->
{ok, {{on... |
10021922b4871e273134607b9bfbf8a2c14e330a58e98f9f853f5452f8c3eff4 | alexandroid000/improv | Time.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Ros.Std_msgs.Time where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinary
import R... | null | https://raw.githubusercontent.com/alexandroid000/improv/ef0f4a6a5f99a9c7ff3d25f50529417aba9f757c/roshask/msgs/Std_msgs/Ros/Std_msgs/Time.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE DeriveDataTypeable # | # LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Ros.Std_msgs.Time where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinary
import Ros.Internal.Msg.MsgInfo
import qualified GHC.Generics as G
import quali... |
ce954606f30c41978ade881c2afec4dcaad589e72f070149c045c9603b563476 | panda-planner-dev/ipc2020-domains | p-01.lisp | (defproblem problem domain
(
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint2)
(visible waypoint2 waypoint1)
(visible waypoint1 waypoint2)
(visible waypoint3 waypoint0)
(visible waypoint0 waypoint3)
(visible way... | null | https://raw.githubusercontent.com/panda-planner-dev/ipc2020-domains/9adb54325d3df35907adc7115fcc65f0ce5953cc/partial-order/Rover/other/SHOP2/p-01.lisp | lisp | (defproblem problem domain
(
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint2)
(visible waypoint2 waypoint1)
(visible waypoint1 waypoint2)
(visible waypoint3 waypoint0)
(visible waypoint0 waypoint3)
(visible way... | |
59bfcd3292d174666cf59706009d25569ee1050541ad6dc3f95283496b0989ca | andreas/ocaml-graphql-server | parser_test.ml | let graphql_query =
Alcotest.testable Fmt.string (fun a b ->
let graphql_ignored = Str.regexp "[ ,\t\r\n]" in
let strip = Str.global_replace graphql_ignored "" in
strip a = strip b)
let test_query ?expect query =
match Graphql_parser.parse query with
| Ok doc ->
let query' = Fmt.to_to_str... | null | https://raw.githubusercontent.com/andreas/ocaml-graphql-server/d615cbb164d4ddfdc2efeb246a198dfe114adf24/graphql_parser/test/parser_test.ml | ocaml | let graphql_query =
Alcotest.testable Fmt.string (fun a b ->
let graphql_ignored = Str.regexp "[ ,\t\r\n]" in
let strip = Str.global_replace graphql_ignored "" in
strip a = strip b)
let test_query ?expect query =
match Graphql_parser.parse query with
| Ok doc ->
let query' = Fmt.to_to_str... | |
b3467ffffd5bd7d7ed684451f6950b42a518c71af4d6a446bfbc8596bb670bef | yoonka/migresia | migresia_migrations.erl | Copyright ( c ) 2015 ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%%
%% Redistributions of source code must retain the above copyright notice,
%% this list of conditions and the follo... | null | https://raw.githubusercontent.com/yoonka/migresia/40e11825e01502d045e87bf8b5d7dc5a9d6e3f73/src/migresia_migrations.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in bina... | Copyright ( c ) 2015 ,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , O... |
f25a1d16e6239ab8caf857866f929dc66d9644423beb827136e52e6a53c3e0e9 | GlideAngle/flare-timing | Double.hs | # OPTIONS_GHC -fno - warn - orphans #
module Flight.Mask.Tag.Double where
import Prelude hiding (span)
import Data.Coerce (coerce)
import Data.Maybe (listToMaybe, catMaybes, fromMaybe)
import Data.List ((\\), filter, inits, foldl')
import Control.Arrow (first)
import Flight.Clip (FlyingSection)
import Flight.Units (... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/34873946be9b93c37048ed118ef5b4649c71d630/lang-haskell/mask/library/Flight/Mask/Tag/Double.hs | haskell | ^ The fix indices of the flying section
The start gates with sorted crossings.
for an entry start zone.
WARNING: We have to be careful to exclude those crossings that
happen after the pilot has crossed the next zone. This can happen
when a pilot again crosses the start cylinder enroute between
subsequent turnpoi... | # OPTIONS_GHC -fno - warn - orphans #
module Flight.Mask.Tag.Double where
import Prelude hiding (span)
import Data.Coerce (coerce)
import Data.Maybe (listToMaybe, catMaybes, fromMaybe)
import Data.List ((\\), filter, inits, foldl')
import Control.Arrow (first)
import Flight.Clip (FlyingSection)
import Flight.Units (... |
2be957bebf4f5cb3a1b59e957d0d958964867fe73b234576b2e8ac5a67c3c0ee | Zulu-Inuoe/clution | parse-float.lisp | ;;;; parse-float.lisp
(in-package #:parse-float)
(eval-when (:compile-toplevel)
(declaim (optimize (speed 3) (safety 1))))
(deftype valid-radix ()
"A valid Common Lisp radix."
`(integer 2 36))
(deftype bounding-index ()
"A valid upper bound to a string."
`(integer 0 ,array-total-size-limit))
(deftype str... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/parse-float-20171019-git/parse-float.lisp | lisp | parse-float.lisp
sign of the float
number of decimal digits
index walking through string
parts of the value
final result |
(in-package #:parse-float)
(eval-when (:compile-toplevel)
(declaim (optimize (speed 3) (safety 1))))
(deftype valid-radix ()
"A valid Common Lisp radix."
`(integer 2 36))
(deftype bounding-index ()
"A valid upper bound to a string."
`(integer 0 ,array-total-size-limit))
(deftype string-index ()
"A vali... |
bf9121b000c03575b5290f2a2f1efc04e0cf8d30792ce45bb4ca50625d49a567 | flavioc/cl-hurd | zip.lisp | #!/usr/bin/run-lisp-trans
settrans -ac foo ./zip.lisp zip-file.zip
;
(unless (= (length ext:*args*) 1)
(error "You must pass the target directory path to zip."))
(asdf:operate 'asdf:load-op 'zip-translator)
| null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/zip-translator/zip.lisp | lisp | #!/usr/bin/run-lisp-trans
settrans -ac foo ./zip.lisp zip-file.zip
(unless (= (length ext:*args*) 1)
(error "You must pass the target directory path to zip."))
(asdf:operate 'asdf:load-op 'zip-translator)
| |
b06fc588c656606f46b28af5dec28952b25b37811926c3e810a6abc5acd7a4f6 | thelema/ocaml-community | pervasives.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/stdlib/pervasives.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
external raise : exn -> 'a = "%raise"... |
8b5d2e6dbea41615eeb3a44fcc7778f0bb4ab6fe4b8687ae2bc68e519737ac91 | xmonad/xmonad-contrib | Kde.hs | # OPTIONS_GHC -fno - warn - missing - signatures #
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Config.Kde
-- Description : Config for integrating xmonad with KDE.
Copyright : ( c ) < >
-- License : BSD
--
Maintainer : < >
-- Stabili... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/0e14e1384511e3ddfe007fb841b0501702ebb436/XMonad/Config/Kde.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Config.Kde
Description : Config for integrating xmonad with KDE.
License : BSD
Stability : unstable
Portability : unportable
This module provides a config suitable for use with the KDE desktop
envir... | # OPTIONS_GHC -fno - warn - missing - signatures #
Copyright : ( c ) < >
Maintainer : < >
module XMonad.Config.Kde (
kdeConfig,
kde4Config,
desktopLayoutModifiers
) where
import XMonad
import XMonad.Config.Desktop
import qualified Data.Map as M
> import XMonad
> import XMonad .... |
8ae17b32ddceaefae4391049d83635c12245e6dde7079f21aa9c27349a254ea6 | haskell-hvr/regex-tdfa | Engine_NC_FA.hs | -- | This is the non-capturing form of Text.Regex.TDFA.NewDFA.String
module Text.Regex.TDFA.NewDFA.Engine_NC_FA(execMatch) where
import Control.Monad(unless)
import Prelude hiding ((!!))
import Data.Array.MArray(MArray(..))
import Data.Array.Unsafe(unsafeFreeze)
import Data.Array.ST(STArray)
import qualified Data.Int... | null | https://raw.githubusercontent.com/haskell-hvr/regex-tdfa/a475bd77855d400527eaaefbfb8bbc559703fd50/lib/Text/Regex/TDFA/NewDFA/Engine_NC_FA.hs | haskell | | This is the non-capturing form of Text.Regex.TDFA.NewDFA.String
import Debug.Trace
trace :: String -> a -> a
trace _ a = a
# SCC "goNext" #
# SCC "goNext.next" #
--
CONVERT WINNERS TO MATCHARRAY | module Text.Regex.TDFA.NewDFA.Engine_NC_FA(execMatch) where
import Control.Monad(unless)
import Prelude hiding ((!!))
import Data.Array.MArray(MArray(..))
import Data.Array.Unsafe(unsafeFreeze)
import Data.Array.ST(STArray)
import qualified Data.IntMap.CharMap2 as CMap(findWithDefault)
import qualified Data.IntMap as... |
e1c2815b23cbbf3a9bf2141c2c9204977e882d08f01d39092091816584457858 | SupercedeTech/yesod-auth-simple | EmailText.hs | # OPTIONS_GHC -fno - warn - orphans #
module Yesod.Auth.Simple.Instance.Persist.EmailText where
import ClassyPrelude
import Database.Persist.Sql
import Yesod.Auth.Simple.Types
instance PersistFieldSql Email where
sqlType = const SqlString
instance PersistField Email where
toPersistValue (Email e) = toPersistValu... | null | https://raw.githubusercontent.com/SupercedeTech/yesod-auth-simple/498eb3c280e32a1c4587de3bcfaf160c1008f236/src/Yesod/Auth/Simple/Instance/Persist/EmailText.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Yesod.Auth.Simple.Instance.Persist.EmailText where
import ClassyPrelude
import Database.Persist.Sql
import Yesod.Auth.Simple.Types
instance PersistFieldSql Email where
sqlType = const SqlString
instance PersistField Email where
toPersistValue (Email e) = toPersistValu... | |
61c23caef3e0e67e5da1453b09ae0cc556d52715de3b2d7691c8889e3c7cc1c1 | ndmitchell/build-shootout | wildcard-shake.hs | import Development.Shake
import Development.Shake.FilePath
main = shakeArgs shakeOptions $ do
"*.out" %> \out -> do
copyFile' (out -<.> "in") out
| null | https://raw.githubusercontent.com/ndmitchell/build-shootout/40b2fd3804d89f8c7cf0a37b3a9d45a863be04ce/examples/wildcard-shake.hs | haskell | import Development.Shake
import Development.Shake.FilePath
main = shakeArgs shakeOptions $ do
"*.out" %> \out -> do
copyFile' (out -<.> "in") out
| |
dc9c50a51ea309c8ac71d4d28c5c66c128e20b7e4faf15e5dbe8839b24c11f35 | cosmicoptima/dictator | DictM.hs | | Contains the DictM monad transformer stack and associated code .
module Utils.DictM
( DH
, TwitterAuth(..)
, Env(..)
, Err(..)
, DictM
, getParsed
, ignoreErrors
, ignoreErrors'
) where
import Relude
import qualified Database.Redis as DB
import Discord ... | null | https://raw.githubusercontent.com/cosmicoptima/dictator/7a383b630afaa4c58cf5a80abb6f02842ef004f3/src/Utils/DictM.hs | haskell | | Global error type
| Abort from a command and post a regular message in chat in case of user error.
| Abort from a command and post a debug message in case of programmer error.
| Abort when a command fails to parse.
| Just abort from a command, and silently fail.
| Everything neccesary to post on twitter and not... | | Contains the DictM monad transformer stack and associated code .
module Utils.DictM
( DH
, TwitterAuth(..)
, Env(..)
, Err(..)
, DictM
, getParsed
, ignoreErrors
, ignoreErrors'
) where
import Relude
import qualified Database.Redis as DB
import Discord ... |
fb3f48ace10347746a5e1f0b91bc4b42057f6d024ec4cd88140aa7bcd89598af | purerl/purerl | Memoize.hs | module Language.PureScript.Erl.CodeGen.Optimizer.Memoize
( addMemoizeAnnotations,
)
where
import Prelude
import Language.PureScript.Erl.CodeGen.AST
( Erl(..), Atom, everywhereOnErl, pattern EApp, AppAnnotation (..) )
import Data.Map as Map
addMemoizeAnnotations :: Map Atom Int -> Erl -> Erl
addMemoizeAnnotat... | null | https://raw.githubusercontent.com/purerl/purerl/d4c933b36dfaed8f4ae4e07a8806cf8a822885f4/src/Language/PureScript/Erl/CodeGen/Optimizer/Memoize.hs | haskell | without using the annotation, but inferring things that seem to have fully applied tc args
| Just n <- Map.lookup f memoizable
, length args == n
-> memoizeAnnotation e | module Language.PureScript.Erl.CodeGen.Optimizer.Memoize
( addMemoizeAnnotations,
)
where
import Prelude
import Language.PureScript.Erl.CodeGen.AST
( Erl(..), Atom, everywhereOnErl, pattern EApp, AppAnnotation (..) )
import Data.Map as Map
addMemoizeAnnotations :: Map Atom Int -> Erl -> Erl
addMemoizeAnnotat... |
5d1514cb1632a0922dc69c818f763f2854bbc8a5d16904f12289885c78020510 | heidegger/JSConTest | Contract.ml | open ProglangUtils
open ExtList
type ('b,'a,'dup,'ddown) contract =
| CBase of 'b * 'a list * 'dup list
| CFunction of
('b,'a,'dup,'ddown) contract option (* this object *)
* ('b,'a,'dup,'ddown) contract list (* parameter list *)
* ('b,'a,'dup,'ddown) contract (* result *)
* 'ddown... | null | https://raw.githubusercontent.com/heidegger/JSConTest/7c807a76af998da25775fba1f5cbe1cf8031d121/ocaml/contracts/Contract.ml | ocaml | this object
parameter list
result
information about dependency
effects | open ProglangUtils
open ExtList
type ('b,'a,'dup,'ddown) contract =
| CBase of 'b * 'a list * 'dup list
| CFunction of
| BObjectPL of ('b,'a,'dup,'ddown) property_list * bool * 'a list * 'dup list
| BArray of ('b,'a,'dup,'ddown) contract
| CUnion of ('b,'a,'dup,'ddown) contract list
and ('b,'a,'dup,'ddown) ... |
7e9c9d02f5caab5f1f0c6a1d87319d6cb8ab5c5322545803e7f24373b00de195 | msgpack/msgpack-haskell | Python.hs | {-# LANGUAGE QuasiQuotes, RecordWildCards, OverloadedStrings #-}
module Language.MessagePack.IDL.CodeGen.Python (
Config(..),
generate,
) where
import Data.List
import Data.Monoid
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.Text.Lazy.IO as LT
import System.FilePat... | null | https://raw.githubusercontent.com/msgpack/msgpack-haskell/f52a5d2db620a7be70810eca648fd152141f8b14/msgpack-idl/Language/MessagePack/IDL/CodeGen/Python.hs | haskell | # LANGUAGE QuasiQuotes, RecordWildCards, OverloadedStrings # |
module Language.MessagePack.IDL.CodeGen.Python (
Config(..),
generate,
) where
import Data.List
import Data.Monoid
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.Text.Lazy.IO as LT
import System.FilePath
import Text.Shakespeare.Text
import System.Directory
import La... |
cfc280d8307d274c2dd72ce181a180134c69972ae1a015a40d1068ebe30ad126 | NathanReb/ocaml-afl-examples | awesome_list.mli | val sort : int list -> int list
(** Sorts the given list of integers. Result list is sorted in increasing order, most of the
time... *)
| null | https://raw.githubusercontent.com/NathanReb/ocaml-afl-examples/5eaacb4ee765b17378c7addd26426b4057ddc3a1/awesome-list/lib/awesome_list.mli | ocaml | * Sorts the given list of integers. Result list is sorted in increasing order, most of the
time... | val sort : int list -> int list
|
2d0ca119368fece52feadb57b8ca2d90d5604ab290439bc517f3bc36e994a05d | DaMSL/K3 | BoundEquivalence.hs | # LANGUAGE TemplateHaskell #
{-|
This module defines a simplifier which unifies type variables that have the
exact same sets of lower and upper bounds.
-}
module Language.K3.TypeSystem.Simplification.EquivalenceUnification.BoundEquivalence
( simplifyByBoundEquivalenceUnification
, boundEquivocator
) where
import ... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Simplification/EquivalenceUnification/BoundEquivalence.hs | haskell | |
This module defines a simplifier which unifies type variables that have the
exact same sets of lower and upper bounds.
|A routine which unifies equivalent variables by a common set of upper
and lower bounds. This routine is safe to use only on closed constraint
sets.
|A routine which identifies equivalent... | # LANGUAGE TemplateHaskell #
module Language.K3.TypeSystem.Simplification.EquivalenceUnification.BoundEquivalence
( simplifyByBoundEquivalenceUnification
, boundEquivocator
) where
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import Language.K3.TypeSystem.Data
import Language.K3.TypeSyste... |
a0ae44df4ff4afc349303ee094363c9ec99f03122634e98b356eccd476ad8b45 | metasoarous/oz | project.clj | (defproject example-project "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[metasoarous/oz "1.5.4"]])
| null | https://raw.githubusercontent.com/metasoarous/oz/7676f6c798dafb87381f71ee3451b94f8460e49f/example-projects/lein-repl-example/project.clj | clojure | (defproject example-project "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[metasoarous/oz "1.5.4"]])
| |
930e5e668cbbbae31becd629e3ad6f6797b8206d6ce7c5cc5a5f787bd733560f | manavpatnaik/haskell | 15_interchange_vars_no_3rdvar.hs | interchange :: (a, b) -> (b, a)
interchange (a, b) = (b, a)
main = do
let m = 1
let n = 2
let (a, b) = interchange (m, n)
print((a, b)) | null | https://raw.githubusercontent.com/manavpatnaik/haskell/af45c3eb5c3461aa77cf25610dfcb3b41c7f7ef9/practice-set-1-basics/15_interchange_vars_no_3rdvar.hs | haskell | interchange :: (a, b) -> (b, a)
interchange (a, b) = (b, a)
main = do
let m = 1
let n = 2
let (a, b) = interchange (m, n)
print((a, b)) | |
d98485c094916c19a6f0c56f9f5ba7ac1f8c905d176706e8893e5ec7787c7f27 | AccelerateHS/accelerate | Remote.hs | {-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.Array.Remote
Copyright : [ 2015 .. 2020 ] The Accelerate Team
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
Portability : non - portable ( GHC extensions )
--
Umbrella module for the remote memory managem... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate/63e53be22aef32cd0b3b6f108e637716a92b72dc/src/Data/Array/Accelerate/Array/Remote.hs | haskell | # OPTIONS_HADDOCK hide #
|
Module : Data.Array.Accelerate.Array.Remote
License : BSD3
Stability : experimental
functions to your particular memory table types.
| Copyright : [ 2015 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
Umbrella module for the remote memory management facilities . To
implement an LRU cache for your backend , provide an instance of the
' RemoteMemory ' class , and , if required , specia... |
a088cb6f527c63a68d4e84656e4613f737bddd1de688b205734d39f70dd6ec47 | crategus/cl-cffi-gtk | gtk.scrollbar.lisp | ;;; ----------------------------------------------------------------------------
;;; gtk.scrollbar.lisp
;;;
;;; The documentation of this file is taken from the GTK 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK library .
;;; See <>. The API documentation of the Lisp binding is
... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gtk/gtk.scrollbar.lisp | lisp | ----------------------------------------------------------------------------
gtk.scrollbar.lisp
The documentation of this file is taken from the GTK 3 Reference Manual
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of... | Version 3.24 and modified to document the Lisp binding to the GTK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for us... |
31700dcfb5e5ee634bbd58e1f7768d58107b173031cbdc2344f6ec43fb0c99a6 | shirok/Gauche | baz.scm | (define-module foo.baz
(export baz-prefix)
(define baz-prefix "ARGS"))
| null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/test/test-static/foo/baz.scm | scheme | (define-module foo.baz
(export baz-prefix)
(define baz-prefix "ARGS"))
| |
236c296c5b7b042f213133a4335826dce05d4d6a341d84d1a6899f94feceeedb | msfm2018/Online-Service | t_tcp_sup.erl | %%% 负责处理所有tcp相关
-module(t_tcp_sup).
-behaviour(supervisor).
-include("common.hrl").
-compile(export_all).
start_child(Sup, #t_tcp_sup_options {t_tcp_sup_name = Name} = Options) ->
supervisor:start_child(Sup, {t_tcp_sup, {t_tcp_sup, start_link, [Options]}, transient, infinity, supervisor, []}).
start_link(T_tcp_sup_o... | null | https://raw.githubusercontent.com/msfm2018/Online-Service/281c2db795f09c7e4dc6768d08d35bbe83350670/src/t_tcp_sup.erl | erlang | 负责处理所有tcp相关 | -module(t_tcp_sup).
-behaviour(supervisor).
-include("common.hrl").
-compile(export_all).
start_child(Sup, #t_tcp_sup_options {t_tcp_sup_name = Name} = Options) ->
supervisor:start_child(Sup, {t_tcp_sup, {t_tcp_sup, start_link, [Options]}, transient, infinity, supervisor, []}).
start_link(T_tcp_sup_options) ->
sup... |
675b93913caa157749f454170e64acdc5170944f593580cbb4033a970f249500 | coccinelle/herodotos | debug.ml |
*
* Copyright ( C ) 2010 INRIA , University of Copenhagen DIKU
* Copyright ( C ) 1998 - 2009
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , wit... | null | https://raw.githubusercontent.com/coccinelle/herodotos/5da230a18962ca445ed2368bc21abe0a8402e00f/org2sql/commons/debug.ml | ocaml | ----------------------------------------------------------------------
subtil: don't forget to give all argumens to f, otherwise partial app
* and will profile nothing.
*
* todo: try also detect when complexity augment each time, so can
* detect the situation for a function gets worse and worse ?
add a '*' to... |
*
* Copyright ( C ) 2010 INRIA , University of Copenhagen DIKU
* Copyright ( C ) 1998 - 2009
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , wit... |
978f262c45658b1c39e1c4399f059159c6dc82d378db27efeb798949af41aa44 | byulparan/cl-collider | TJUGens.lisp | (in-package #:sc)
(defugen (dfm-1 "DFM1")
(in &optional (freq 1000) (res 0.1) (input-gain 1) (type 0) (noise-level 0.0003) (mul 1) (add 0))
((:ar
(madd (multinew new 'pure-ugen in freq res input-gain type noise-level) mul add)))
:check-fn #'check-same-rate-as-first-input)
| null | https://raw.githubusercontent.com/byulparan/cl-collider/e1ebe437094720078c0b3ac7a236d679808a3fb5/ugens/SC3plugins/TJUGens.lisp | lisp | (in-package #:sc)
(defugen (dfm-1 "DFM1")
(in &optional (freq 1000) (res 0.1) (input-gain 1) (type 0) (noise-level 0.0003) (mul 1) (add 0))
((:ar
(madd (multinew new 'pure-ugen in freq res input-gain type noise-level) mul add)))
:check-fn #'check-same-rate-as-first-input)
| |
a9423114e2cf9b27a8836c3267a310b19df59f6feeb8d2f952567d780434b92d | coq-community/vscoq | lspData.ml | (**************************************************************************)
(* *)
(* VSCoq *)
(* *)
(* ... | null | https://raw.githubusercontent.com/coq-community/vscoq/39c074268d5d23c43710a2763c690cf27cb81c47/language-server/lsp/lspData.ml | ocaml | ************************************************************************
VSCoq
Copyright... | ( see version control and README file for authors & dates )
This file is distributed under the terms of the MIT License .
open Sexplib.Std
module Position = struct
type t = { line : int; character : int; } [@@deriving sexp, yojson]
let compare pos1 pos2 =
match Int.compare pos1... |
d36733abda08a6d7e8cc19847c68351a798ff5e974d5bed8f3556548d0851c55 | matsen/pplacer | guppy_ograph.ml | open Subcommand
open Guppy_cmdobjs
open Ppatteries
class cmd () =
object (self)
inherit subcommand () as super
inherit placefile_cmd () as super_placefile
inherit output_cmd () as super_output
inherit mass_cmd ~point_choice_allowed:false () as super_mass
method specl =
super_output#specl
@ super_mass#... | null | https://raw.githubusercontent.com/matsen/pplacer/f40a363e962cca7131f1f2d372262e0081ff1190/pplacer_src/guppy_ograph.ml | ocaml | open Subcommand
open Guppy_cmdobjs
open Ppatteries
class cmd () =
object (self)
inherit subcommand () as super
inherit placefile_cmd () as super_placefile
inherit output_cmd () as super_output
inherit mass_cmd ~point_choice_allowed:false () as super_mass
method specl =
super_output#specl
@ super_mass#... | |
0d285d2886c27403dceb673c40c297d6baf4f1154c253ad166b56f5b1749b46f | muesli4/table-layout | HeaderColSpec.hs | module Text.Layout.Table.Spec.HeaderColSpec where
import Data.Default.Class
import Text.Layout.Table.Spec.Position
import Text.Layout.Table.Spec.CutMark
-- | Specifies how a header is rendered.
data HeaderColSpec = HeaderColSpec (Position H) (Maybe CutMark)
| Smart constructor for ' HeaderColSpec ' . By omitting ... | null | https://raw.githubusercontent.com/muesli4/table-layout/751b7c9bf2ee2ac9c6cff408836367e65b961098/src/Text/Layout/Table/Spec/HeaderColSpec.hs | haskell | | Specifies how a header is rendered.
the other cells in that column.
| Header columns are usually centered. | module Text.Layout.Table.Spec.HeaderColSpec where
import Data.Default.Class
import Text.Layout.Table.Spec.Position
import Text.Layout.Table.Spec.CutMark
data HeaderColSpec = HeaderColSpec (Position H) (Maybe CutMark)
| Smart constructor for ' HeaderColSpec ' . By omitting the cut mark , it will
use the one spec... |
5c0bec8581fa01b9c3b001119a7b6581b5d178f2e6fa5ea57f72ae96bd1f1f8c | bob-cd/bob | gen-ci.clj | Copyright 2018 - 2022
;
Use of this source code is governed by an MIT - style
; license that can be found in the LICENSE file or at
; .
(require
'[babashka.process :as p]
'[clj-yaml.core :as yaml]
'[clojure.string :as str]
'[flatland.ordered.map :refer [ordered-map]])
(defn run
[cmd-name cmd]
{:run {:na... | null | https://raw.githubusercontent.com/bob-cd/bob/aed092f3b8125b8a9913d9ec979688312343f58d/.circleci/script/gen-ci.clj | clojure |
license that can be found in the LICENSE file or at
. | Copyright 2018 - 2022
Use of this source code is governed by an MIT - style
(require
'[babashka.process :as p]
'[clj-yaml.core :as yaml]
'[clojure.string :as str]
'[flatland.ordered.map :refer [ordered-map]])
(defn run
[cmd-name cmd]
{:run {:name cmd-name
:command cmd}})
(defn gen-steps
[sho... |
fa8b9cd7bb8892ba86898be65f6f5ea54a63adb98065d4abf93a837bbd308033 | SjVer/Som-Lang | main.ml | open Lsp
open Server
let run () =
setup_log ();
let io = Io.make stdin stdout in
let store = Store.create () in
let server = make io store in
Log.info (fun f -> f "Starting server");
run io server;
Log.info (fun f -> f "Stopping server");
Io.close io
let show_version () =
Printf.printf "%s %s... | null | https://raw.githubusercontent.com/SjVer/Som-Lang/03f36099faa6a5c4fdf4a694e9b7d79d075118d7/tools/language-server/bin/main.ml | ocaml | open Lsp
open Server
let run () =
setup_log ();
let io = Io.make stdin stdout in
let store = Store.create () in
let server = make io store in
Log.info (fun f -> f "Starting server");
run io server;
Log.info (fun f -> f "Stopping server");
Io.close io
let show_version () =
Printf.printf "%s %s... | |
3243fce314320e2edd30904cb08b55d3a93ed45ad12a88b16580350c68735064 | Bogdanp/racket-redis | protocol.rkt | #lang racket/base
;; read ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide
redis-read)
(define (redis-read [in (current-input-port)])
(define p (read-char in))
(define v (read-line in 'return-linefeed))
(case p
[(#\$)
(if (string=? v "-1")
#f
(begin0 (read-b... | null | https://raw.githubusercontent.com/Bogdanp/racket-redis/0f6c1a723f25f40dd9c6f682dee30fa8a9288f86/redis-lib/private/protocol.rkt | racket | read ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
write ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | #lang racket/base
(provide
redis-read)
(define (redis-read [in (current-input-port)])
(define p (read-char in))
(define v (read-line in 'return-linefeed))
(case p
[(#\$)
(if (string=? v "-1")
#f
(begin0 (read-bytes (string->number v) in)
(read-bytes 2 in)))]
[(#\*)
... |
16f1d9e6a379311af90f36219b158aab99ac943aa9aea68c1678d924564d4d75 | fjvallarino/monomer | Grid.hs | |
Module : . Widgets . Containers . Grid
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Layout container which distributes space evenly along the main axis . For the
secondary axis childr... | null | https://raw.githubusercontent.com/fjvallarino/monomer/b8d3b82b50719204385179614f06bae283f90303/src/Monomer/Widgets/Containers/Grid.hs | haskell | # LANGUAGE Strict #
* Configuration
* Constructors
| Creates a grid of items with the same width.
^ The list of items.
^ The created grid.
| Creates a grid of items with the same width. Accepts config.
^ The config options.
^ The list of items.
^ The created grid.
| Creates a grid of items with the same heigh... | |
Module : . Widgets . Containers . Grid
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Layout container which distributes space evenly along the main axis . For the
secondary axis childr... |
d9a8d3c967bbfb038d969e50c4561ca651337d6c65acf09d311e7efe29878584 | sordina/churros | Main.hs |
module Main where
import Test.DocTest ( doctest )
-- TODO: Pass additional paths in automatically or via arguments.
main :: IO ()
main = do
doctest
[ "-isrc"
, "-itest"
, "test/Churro/Test/Examples.hs"
, "src/Control/Churro/Transport/Unagi/Bounded.hs"
]
| null | https://raw.githubusercontent.com/sordina/churros/240416d736f19d4740570d7c3cf91e51038a0649/test/Churro/Test/Main.hs | haskell | TODO: Pass additional paths in automatically or via arguments. |
module Main where
import Test.DocTest ( doctest )
main :: IO ()
main = do
doctest
[ "-isrc"
, "-itest"
, "test/Churro/Test/Examples.hs"
, "src/Control/Churro/Transport/Unagi/Bounded.hs"
]
|
2633d007825a6d314b1ef52e49ba12d5c67d2e9a9dffb02f62169c51d51549da | screenshotbot/screenshotbot-oss | url.lisp | ;; Copyright 2018-Present Modern Interpreters Inc.
;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(in-package :hex)
(defun add-get-param-to-url (url name value)
"URL is assumed to be a... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/b66e24f3993d693630d79d3275ac9df9b3a4efb4/src/hunchentoot-extensions/url.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
possible bug: doesn't check for #\? which is written as, say,
"&x3f;" - also, is there any other way a question mark could be a
legitimate part of a URL?
only render this if all required args are present
the when we're dealint giwht url handlers since, in that case... | 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 /.
(in-package :hex)
(defun add-get-param-to-url (url name value)
"URL is assumed to be a http URL. The pair of NAME and VALUE will be
added as... |
d7e0745968253d04e027da26e43c4cf0b44301f772d79ac618a57cc2566e3158 | hlprmnky/serverless-ish | schema.clj | (ns serverless-ish.schema
(:require [datomic.client.api :as d]))
(def user
[{:db/ident :user/id
:db/valueType :db.type/uuid
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one}
{:db/ident :user/email
:db/valueType :db.type/string
:db/unique :db.unique/value
:db/cardinalit... | null | https://raw.githubusercontent.com/hlprmnky/serverless-ish/bb5b89d68f7209311c16c454dfbe3c548efff0c0/ions/src/serverless_ish/schema.clj | clojure | (ns serverless-ish.schema
(:require [datomic.client.api :as d]))
(def user
[{:db/ident :user/id
:db/valueType :db.type/uuid
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one}
{:db/ident :user/email
:db/valueType :db.type/string
:db/unique :db.unique/value
:db/cardinalit... | |
6826bcfa20ac7ea487bed4cdf1df8971cd408d72d255e9027899bb2f979847f6 | dbuenzli/topkg | tag.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/topkg/ea1e0981a18ce4160ec21e8a73f67cb748059671/src-bin/tag.ml | ocaml | Command line interface | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
5ace1d9462e816340c7972a1eaf7b1be617bd76e29844d973da0c494155566f7 | uw-unsat/leanette-popl22-artifact | synth.rkt | #lang rosette
(require "framework.rkt" "verify.rkt" "util.rkt" "log.rkt"
"../litmus/litmus.rkt"
"../ocelot/ocelot.rkt"
rosette/solver/smt/z3)
(provide synth synth-tests-used)
(define synth-tests-used 0)
; Perform incremental synthesis given a list of tests.
Each test is a pair ( cons... | null | https://raw.githubusercontent.com/uw-unsat/leanette-popl22-artifact/80fea2519e61b45a283fbf7903acdf6d5528dbe7/rosette-benchmarks-4/memsynth/memsynth/synth.rkt | racket | Perform incremental synthesis given a list of tests.
testing them in the order they are provided.
XXX hack
test evaluation
counterexample discovery
do the synthesis | #lang rosette
(require "framework.rkt" "verify.rkt" "util.rkt" "log.rkt"
"../litmus/litmus.rkt"
"../ocelot/ocelot.rkt"
rosette/solver/smt/z3)
(provide synth synth-tests-used)
(define synth-tests-used 0)
Each test is a pair ( cons program outcome ) , where outcome is either # t or # f... |
f4ed74e77427fab7caea84884e73ec56fd3f13f0581596934aea199abd6a92f7 | igorhvr/bedlam | reflection.scm | ;;;;;;;;;; HELPERS ;;;;;;;;;;
(define (filter-map f lis)
(let recur ((lis lis))
(if (null? lis)
lis
(let ((tail (recur (cdr lis))))
(cond ((f (car lis)) => (lambda (x) (cons x tail)))
(else tail))))))
;;;;;;;;;; CLASS PRECEDENCE LIST ;;;;;;;;;;
(define (java-class-de... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-1.16.6/full-src/sisc/src/sisc/modules/s2j/reflection.scm | scheme | HELPERS ;;;;;;;;;;
CLASS PRECEDENCE LIST ;;;;;;;;;;
we always shuffle Object to the end
we pretend that all interfaces have Object as the last element in
fake type hierarchy for primitive types that is consistent with
let X[n] denote the type of an array of type X with n dimensions.
superclass and I_0...I_k are X's ... |
(define (filter-map f lis)
(let recur ((lis lis))
(if (null? lis)
lis
(let ((tail (recur (cdr lis))))
(cond ((f (car lis)) => (lambda (x) (cons x tail)))
(else tail))))))
(define (java-class-declared-superclasses jclass)
((cond [(java/array-class? jclass) java-arra... |
cacdf094e6b7e94803759b603b77741312bd06966d9835b30722844a6b3c7dbd | SamB/coq | dyn.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/lib/dyn.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i $Id$ i
Dynamics. Use with extreme... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
type t
val create : stri... |
7e055016b2845414d9ea525eb60193dccf014ec4e7e243b58232cd1b2cfe0370 | tezos/tezos-mirror | daemon.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs , < >
Copyright ( c ) 2022... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/6053c9173cdad0f2733615a65b3469ea368a9409/src/proto_alpha/lib_sc_rollup_node/daemon.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs , < >
Copyright ( c ) 2022 TriliTech < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHO... |
2aecea51f60a43190d3dc2b597244d2b36c0ffb11c686caba8bfeff1201dd361 | jonase/eastwood | typetags.clj | (ns eastwood.linters.typetags
(:require
[clojure.string :as string]
[eastwood.copieddeps.dep1.clojure.tools.analyzer.ast :as ast]
[eastwood.passes :as passes]
[eastwood.util :as util]))
(def default-classname-mapping
(ns-map 'eastwood.linters.typetags))
(defn replace-variable-tag-part
"Wrong tags th... | null | https://raw.githubusercontent.com/jonase/eastwood/605ab4a1d169270701200005792fa37b4c025405/src/eastwood/linters/typetags.clj | clojure | This set of wrong-tag-keys sometimes occurs for
op :local, but since those can be multiple
the warnings less redundant by restricting them
to the :binding ops (checked for below), and
still not lose any important warnings.
This can also occur for op :quote, but in the
case that I have seen this occur so far
als... | (ns eastwood.linters.typetags
(:require
[clojure.string :as string]
[eastwood.copieddeps.dep1.clojure.tools.analyzer.ast :as ast]
[eastwood.passes :as passes]
[eastwood.util :as util]))
(def default-classname-mapping
(ns-map 'eastwood.linters.typetags))
(defn replace-variable-tag-part
"Wrong tags th... |
733d288fc6892281f07afc79fbd52704217dc84e4b124f15f87d0d3ccac277e8 | GaloisInc/msf-haskell | Server.hs | module MsgPack.RPC.Server where
import MsgPack (pack,fromObject,unpack,toObject)
import MsgPack.RPC.Types
import Data.String (fromString)
import Network.HTTP.Server (Handler,err_response,respond,StatusCode(..))
import qualified Network.HTTP as HTTP
import qualified Data.ByteString as S
| Just handle all top - lev... | null | https://raw.githubusercontent.com/GaloisInc/msf-haskell/76cee10771f9e9d10aa3301198e09f08bde907be/src/MsgPack/RPC/Server.hs | haskell | module MsgPack.RPC.Server where
import MsgPack (pack,fromObject,unpack,toObject)
import MsgPack.RPC.Types
import Data.String (fromString)
import Network.HTTP.Server (Handler,err_response,respond,StatusCode(..))
import qualified Network.HTTP as HTTP
import qualified Data.ByteString as S
| Just handle all top - lev... | |
bddd2caa269ad7f7dc402fed56ef1c9b0fda1278882ecb2ad1a880182cb073de | jaredly/reason-language-server | ident.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/407/ident.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
type t = { stamp: int; name: string; flags: int }
let global_flag = 1
let predef_exn_flag =... |
af6d3cffb03292bb6dcdb1b8b63f98e449491168f036c8a3bff8161aecdee1f4 | tomjaguarpaw/haskell-opaleye | MaybeFields.hs | # OPTIONS_HADDOCK not - home #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE Arrows #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE DeriveFunctor #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Opaleye.Internal.MaybeFields where
import ... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/6edcc5bd25c05d9a323417d0a5dec19ba0013852/src/Opaleye/Internal/MaybeFields.hs | haskell | # LANGUAGE Arrows #
nothing.
Can be useful to avoid type inference problems, because it doesn't
pick up a type class constraint.
| Use a Haskell @\\case@ expression to pattern match on a
@
example mf = matchMaybe mf $ \\case
Nothing -> 0
@
using arrow notation you'll probably find 'catMaybeFields' easier
t... | # OPTIONS_HADDOCK not - home #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE DeriveFunctor #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Opaleye.Internal.MaybeFields where
import Control.Arrow (retur... |
5f81b29ea1cfb1969bc7c6df9ec7251e7dbbdce1c1d1d96776b88c6c19e6a07c | pitag-ha/cardio-crumble | simple_engine.ml | open Runtime_events
open Cmdliner
let starting_time = ref None
let adjust_time ts =
The ints64 representing the duration of a runtime phase are in units of nanoseconds , whereas the ints32 representing the timestamps of midi notes are in units of miliseconds .
So this function indirectly multiplies the tim... | null | https://raw.githubusercontent.com/pitag-ha/cardio-crumble/846309665f9b03120780dd50256f0b86b16982db/bin/simple_engine.ml | ocaml | ~volume:'\070'
~volume:'\070' | open Runtime_events
open Cmdliner
let starting_time = ref None
let adjust_time ts =
The ints64 representing the duration of a runtime phase are in units of nanoseconds , whereas the ints32 representing the timestamps of midi notes are in units of miliseconds .
So this function indirectly multiplies the tim... |
8a355b916f3d5c338e0e7a2d38febe33dcd2474356dde69787be0de132ee058f | clojurebook/ClojureProgramming | game_validators.clj | (ns com.clojurebook.concurrency.game-validators
(:use [com.clojurebook.concurrency :only (futures wait-futures)])
(:require [clojure.set :as set]
[clojure.java.io :as io]
clojure.pprint))
(def console (agent *out*)) ;(java.io.PrintWriter. System/out)
(def character-log (agent (io/writer "ch... | null | https://raw.githubusercontent.com/clojurebook/ClojureProgramming/bcc7c58862982a5793e22788fc11a9ed7ffc548f/ch04-concurrency-game/src/com/clojurebook/concurrency/game_validators.clj | clojure | (java.io.PrintWriter. System/out)
the latter | (ns com.clojurebook.concurrency.game-validators
(:use [com.clojurebook.concurrency :only (futures wait-futures)])
(:require [clojure.set :as set]
[clojure.java.io :as io]
clojure.pprint))
(def character-log (agent (io/writer "character-states.log" :append true)))
(defn write
[^java.io.Wr... |
044bbc54a6e2e6eb691f68348ccb7cee706a2e8d083dcd993081802fe53600fe | links-lang/links | desugarInners.ml | open Utility
open Operators
open SourceCode.WithPos
open Sugartypes
Recursive functions must be used inside their
function bodies ( unless annotated with a polymorphic type ) , but
they may still be used polymorphically outside ( after having been
generalised ) . This pass unifies the inner and outer... | null | https://raw.githubusercontent.com/links-lang/links/ed762101cd98db8910da410941cbe883d1873e3c/core/desugarInners.ml | ocaml | Acts as a stack of which recursive function bodies we are currently
visiting. This allows us to determine which type variables are currently
in-scope or not.
put the outer bindings in the environment
put the extras in the environment
unify inner and outer types for each def
transform the function bod... | open Utility
open Operators
open SourceCode.WithPos
open Sugartypes
Recursive functions must be used inside their
function bodies ( unless annotated with a polymorphic type ) , but
they may still be used polymorphically outside ( after having been
generalised ) . This pass unifies the inner and outer... |
a8350a73b3f048080ea638b245f135dbaa8477207ce1f872fb623daa29b81fa5 | manuel-serrano/bigloo | main.scm | (module foo
(java (class lib
(constructor new (::procedure))
(method static init::bool () "init")
(method static string->cstring::%string (::string) "bytesToString")
(method static show-cstring::string (::%string) "showString")
(method invoke::obj (::lib ::string) "invoke")
"lib")
(cl... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/examples/DNet/main.scm | scheme | (module foo
(java (class lib
(constructor new (::procedure))
(method static init::bool () "init")
(method static string->cstring::%string (::string) "bytesToString")
(method static show-cstring::string (::%string) "showString")
(method invoke::obj (::lib ::string) "invoke")
"lib")
(cl... | |
613f4ca4b5c3f7178fd5a30a21fafee2a33621dca41852283fd7deac4f9032d1 | tmattio/dream-livereload | dream_livereload.ml | let default_script
?(retry_interval_ms = 500)
?(max_retry_ms = 5000)
?(route = "/_livereload")
()
=
Printf.sprintf
{js|
var socketUrl = "ws://" + location.host + "%s"
var s = new WebSocket(socketUrl);
s.onopen = function(even) {
console.log("WebSocket connection open.");
};
s.onclose = funct... | null | https://raw.githubusercontent.com/tmattio/dream-livereload/c4045ed18066a1b0501041777fb1282958a7bae5/lib/dream_livereload.ml | ocaml | let default_script
?(retry_interval_ms = 500)
?(max_retry_ms = 5000)
?(route = "/_livereload")
()
=
Printf.sprintf
{js|
var socketUrl = "ws://" + location.host + "%s"
var s = new WebSocket(socketUrl);
s.onopen = function(even) {
console.log("WebSocket connection open.");
};
s.onclose = funct... | |
9a7310ffa8896b8454f4db221c3d75bf9f670d0379b522a838b91940301e8745 | orionsbelt-battlegrounds/obb-rules | element_test.cljc | (ns obb-rules.element-test
(:require
[obb-rules.element :as element]
[obb-rules.unit :as unit]
#?(:clj [clojure.test :refer [deftest testing is run-tests]]
:cljs [cljs.test :refer-macros [deftest testing is run-tests]])))
(def unit (unit/get-unit-by-name "rain"))
(def player :p1)
(deftest element... | null | https://raw.githubusercontent.com/orionsbelt-battlegrounds/obb-rules/97fad6506eb81142f74f4722aca58b80d618bf45/test/obb_rules/element_test.cljc | clojure | (ns obb-rules.element-test
(:require
[obb-rules.element :as element]
[obb-rules.unit :as unit]
#?(:clj [clojure.test :refer [deftest testing is run-tests]]
:cljs [cljs.test :refer-macros [deftest testing is run-tests]])))
(def unit (unit/get-unit-by-name "rain"))
(def player :p1)
(deftest element... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.