_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 |
|---|---|---|---|---|---|---|---|---|
8cdece42bd74fe20f0c579a346600b1b35706b1824127c768683f306f132d0f5 | Ptival/language-ocaml | Test.hs | # LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.CoreTypeNoAttr.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.CoreType2.Test as CoreType2
import qualified Language.OCaml.Parser.Ident.Test as Ident
import Prelude hiding (id)
testStrings :: [String]
testStri... | null | https://raw.githubusercontent.com/Ptival/language-ocaml/7b07fd3cc466bb2ad2cac4bfe3099505cb63a4f4/test/Language/OCaml/Parser/CoreTypeNoAttr/Test.hs | haskell | # LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.CoreTypeNoAttr.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.CoreType2.Test as CoreType2
import qualified Language.OCaml.Parser.Ident.Test as Ident
import Prelude hiding (id)
testStrings :: [String]
testStri... | |
159ce2cb93f37dfa4cbbdac5472d5d289036a158d2db21c9163976ad89bc4524 | mathematical-systems/clml | dlasd1.lisp | ;;; Compiled by f2cl version:
( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:0... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/lapack/dlasd1.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t)
(:relaxed-array-decls t) (:coerce-assigns :as-needed)
(:array-type ':array) (:array-slicing t)
(:declare-common nil) (:float-format double-float)) | ( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:03:25 rtoy Exp $ "
" $ I d :... |
8c8690896b05401aa0271bf271caa0d769161206fbd60d5d59776731e934d79f | softwarelanguageslab/maf | R5RS_gambit_diviter-1.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((create-n (lambda (n)
(letrec ((__do_loop (lambda (n a)
(if (= n 0) a (__do_loop (- n 1) (cons () a))))))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_gambit_diviter-1.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 1
* swaps : 0
(letrec ((create-n (lambda (n)
(letrec ((__do_loop (lambda (n a)
(if (= n 0) a (__do_loop (- n 1) (cons () a))))))
(__do_loop n ()))))
(*ll* (create-n 200))
(iterative-di... |
8fae16d67a998621f5bb4bce4074a1ae7c0e7a72c60ebc635720bb4c86e70c5e | milgra/cljs-brawl | math4.cljc | (ns gui.math4)
(defn proj_ortho
"create orthographic projection"
[left right bottom top near far]
(let [rpl (+ right left)
rml (- right left)
tpb (+ top bottom)
tmb (- top bottom)
fpn (+ far near)
fmn (- far near)]
[(/ 2.0 rml)
0.0
0.0
0.0
0.0
... | null | https://raw.githubusercontent.com/milgra/cljs-brawl/e03cf6f032b1af0f6e38396e43e739f83446a3e4/src/gui/math4.cljc | clojure | (ns gui.math4)
(defn proj_ortho
"create orthographic projection"
[left right bottom top near far]
(let [rpl (+ right left)
rml (- right left)
tpb (+ top bottom)
tmb (- top bottom)
fpn (+ far near)
fmn (- far near)]
[(/ 2.0 rml)
0.0
0.0
0.0
0.0
... | |
077356c15c0139e7c95c1d5d01c24ce84b2edc5d9a24c3111d42d873d47fab2f | EFanZh/EOPL-Exercises | exercise-6.23.rkt | #lang eopl
Exercise 6.23 [ ★ ★ ] Observe that our rule for if makes two copies of the continuation K , so in a nested if the size
;; of the transformed program can grow exponentially. Run an example to confirm this observation. Then show how this may
;; be avoided by changing the transformation to bind a fresh varia... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-6.23.rkt | racket | of the transformed program can grow exponentially. Run an example to confirm this observation. Then show how this may
be avoided by changing the transformation to bind a fresh variable to K.
Transformer.
Data structures - expressed values.
Data structures - environment.
Data structures - continuation.
Interprete... | #lang eopl
Exercise 6.23 [ ★ ★ ] Observe that our rule for if makes two copies of the continuation K , so in a nested if the size
CPS - IN grammar .
(define the-lexical-spec
'([whitespace (whitespace) skip]
[comment ("%" (arbno (not #\newline))) skip]
[identifier (letter (arbno (or letter digit "_" "-"... |
671100b4a347863cfb22b2f9804d7daaf3945dfb121867472105afe020b35db0 | evdubs/renegade-way | trade.rkt | #lang racket/base
(require gregor
racket/string)
(provide (struct-out trade)
trade->tsv
tsv->trade)
(struct trade
(symbol
expirations
strikes
rights
open-date
open-price
open-contracts
open-commission
close-date
close-price
close-contracts
close-commissio... | null | https://raw.githubusercontent.com/evdubs/renegade-way/d10acd321939320843e594120a1feb7dec5cdf4f/sim/trade.rkt | racket | symbol
expirations
strikes
rights
open-date
open-price
open-contracts
open-commission
close-date
close-price
close-contracts
close-commission
profit-loss
market-rating
sector-rating
industry-rating
stock-rating
stock-risk-reward
earnings-date
option-spread
num
patterns
entry-price
stop-price
ta... | #lang racket/base
(require gregor
racket/string)
(provide (struct-out trade)
trade->tsv
tsv->trade)
(struct trade
(symbol
expirations
strikes
rights
open-date
open-price
open-contracts
open-commission
close-date
close-price
close-contracts
close-commissio... |
eccf088437b39f2aa7259d36655e9a700f889edde73790485013b6b8d27a8010 | bluddy/rails | pani_interp.ml | open Containers
(* Pani Interpreter: interprets the language of the PANI file *)
Notes : pay attention to signed vs unsigned comparisons
module Ndarray = Owl_base_dense_ndarray.Generic
let debug = false
type ndarray = (int, Bigarray.int8_unsigned_elt) Ndarray.t
(* background pic type *)
type bg = {
x: int;
y... | null | https://raw.githubusercontent.com/bluddy/rails/b2a8dd700fdcbdf36984ba50eb148000c1f0b32f/bin/anim/pani_interp.ml | ocaml | Pani Interpreter: interprets the language of the PANI file
background pic type
single register. also used for timeout
reversed
Push to stack, either from register or from animation registers
Set main register from code. If 0<value<=50, also set animation reg from stack
Assume other_anim_idx is valid or we ... | open Containers
Notes : pay attention to signed vs unsigned comparisons
module Ndarray = Owl_base_dense_ndarray.Generic
let debug = false
type ndarray = (int, Bigarray.int8_unsigned_elt) Ndarray.t
type bg = {
x: int;
y: int;
pic_idx: int;
}
type t = {
mutable is_done: bool;
mutable timeout: bool;
bu... |
7d0a8a926b7c6d6dc0922b0fd600add28f0e2afc51d13e1a3b0730a4c0f8093f | stepcut/plugins | API.hs | {-# OPTIONS -fglasgow-exts #-}
^ needed to derive
module API where
import Data.Dynamic
data Tiny = Tiny { field :: String }
deriving (Typeable, Show)
tiny :: Tiny
tiny = Tiny { field = "default value" }
| null | https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/testsuite/makewith/tiny/api/API.hs | haskell | # OPTIONS -fglasgow-exts # | ^ needed to derive
module API where
import Data.Dynamic
data Tiny = Tiny { field :: String }
deriving (Typeable, Show)
tiny :: Tiny
tiny = Tiny { field = "default value" }
|
4b905d0e318348073721ec1803ac1fc6db4068c30195a8d939b59227527dae0c | fp-works/2019-winter-Haskell-school | Homework.hs | # OPTIONS_GHC -Wall #
module Homework where
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
fn :: Integer -> Integer -> Integer
fn a b
| even a = b * (a - 2)
| otherwise = b
fun1' :: [Integer] -> Integer
fun1' xs = foldr fn 1 xs
fun2 :: Integer -> ... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week4/stevemao/Homework.hs | haskell | # OPTIONS_GHC -Wall #
module Homework where
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
fn :: Integer -> Integer -> Integer
fn a b
| even a = b * (a - 2)
| otherwise = b
fun1' :: [Integer] -> Integer
fun1' xs = foldr fn 1 xs
fun2 :: Integer -> ... | |
8a375285d04b301a450dc87f9228eff3c3b661322947e10040f629dfd644edce | HunterYIboHu/htdp2-solution | 31.1-relative-to-aboslute.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 31.1-relative-to-aboslute) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t co... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter6/Section31-the-loss-of-knowledge/31.1-relative-to-aboslute.rkt | racket | about the language level of this file in a form that our tools can easily process.
[List-of Number] -> [List-of Number]
convert a list of relative to absolute distances
auxiliary functions
Number [List-of Number] -> [List-of Number]
add n to each number on l | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname 31.1-relative-to-aboslute) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
the first number represents the d... |
05c506c8c9b219974c21ed7b197a1f45d7619504d676643760321e4ae3e566c8 | jtod/Hydra | RBG.hs | -- RBG: state machine circuit
This file is part of Hydra . See README and
Copyright ( c ) 2022
module RBG where
import HDL.Hydra.Core.Lib
import HDL.Hydra.Circuits.Combinational
The stateMachine circuit has an internal state , which is one of
Red , Blue , Green . If reset=1 the machine goe... | null | https://raw.githubusercontent.com/jtod/Hydra/cf67a88050720acfff6a51b16d5f9efbd154dc1e/examples/stateMachine/RBG.hs | haskell | RBG: state machine circuit
which is red. It performs a state transition:
red -> blue
blue -> green
green -> red
| This file is part of Hydra . See README and
Copyright ( c ) 2022
module RBG where
import HDL.Hydra.Core.Lib
import HDL.Hydra.Circuits.Combinational
The stateMachine circuit has an internal state , which is one of
Red , Blue , Green . If reset=1 the machine goes to initial state ,
stateM... |
7f1cd5ef5bd852c9238459e8876d1389024aa334ff4d0f52f9f8e91b34f7202d | babashka/babashka | empty_block_test.clj | (ns clarktown.parsers.empty-block-test
(:require
[clojure.test :refer [deftest testing is]]
[clarktown.parsers.empty-block :as empty-block]))
(deftest empty-block-test
(testing "Rendering an empty block"
(is (= (empty-block/render "" nil)
"")))
(testing "Checking an empty block"
(is ... | null | https://raw.githubusercontent.com/babashka/babashka/1113037b51733466faceda72d98dab5c1513a6e1/test-resources/lib_tests/clarktown/parsers/empty_block_test.clj | clojure | (ns clarktown.parsers.empty-block-test
(:require
[clojure.test :refer [deftest testing is]]
[clarktown.parsers.empty-block :as empty-block]))
(deftest empty-block-test
(testing "Rendering an empty block"
(is (= (empty-block/render "" nil)
"")))
(testing "Checking an empty block"
(is ... | |
ee20ca574c4fb1bc585a646f538b77b0db9417e729bc767ea2fcfd77ac96aca0 | marigold-dev/deku | effects.mli | open Deku_ledger
open Deku_stdlib
type _ Effect.t +=
| Deposit_tickets : Address.t * (Ticket_id.t * N.t) list -> unit Effect.t
| Take_tickets : Address.t -> (Ticket_id.t * N.t) list Effect.t
| Self_addr : Contract_address.t Effect.t
| Sender_address : Address.t Effect.t
| Source_address : Address.t Effect.t
... | null | https://raw.githubusercontent.com/marigold-dev/deku/152d5bbe3c30912aa28b5ab810e03216e8c22710/deku-c/wasm-vm-ocaml/effects.mli | ocaml | open Deku_ledger
open Deku_stdlib
type _ Effect.t +=
| Deposit_tickets : Address.t * (Ticket_id.t * N.t) list -> unit Effect.t
| Take_tickets : Address.t -> (Ticket_id.t * N.t) list Effect.t
| Self_addr : Contract_address.t Effect.t
| Sender_address : Address.t Effect.t
| Source_address : Address.t Effect.t
... | |
6dacc03d46c2ceced949599b84570e984a346521a255da736716af080ffaf935 | ghcjs/jsaddle-dom | TextTrackCueList.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.TextTrackCueList
(item, item_, getCueById, getCueById_, getLength,
TextTrackCueList(..), gTypeTextTrackCueL... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/TextTrackCueList.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.TextTrackCueList
(item, item_, getCueById, getCueById_, getLength,
TextTrackCueList(..), gTypeTextTrackCueList)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe... |
258bef514cbb7705a03085cff058a693a1b5bf1a0313b49424e3e5d369a18402 | vikram/lisplibraries | araneida.lisp | ;; -*- lisp -*-
(in-package :it.bese.ucw)
;;;; ** The araneida backend
(deflogger araneida ()
:level +debug+
:appender (make-instance 'brief-stream-log-appender :stream t))
(defclass araneida-backend (backend)
((listener :accessor listener :initarg :listener :initform nil)
(default-url :accessor default-u... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/ucw_ajax/src/backend/araneida.lisp | lisp | -*- lisp -*-
** The araneida backend
we prefer araneida-serve-event if that's
available, otherwise we fall back to araneida
threads
request/response
a list with multiple values
a single value, just pass it
um, it's not text. this is really wrong
All rights reserved.
Redistribution and use in source and bi... |
(in-package :it.bese.ucw)
(deflogger araneida ()
:level +debug+
:appender (make-instance 'brief-stream-log-appender :stream t))
(defclass araneida-backend (backend)
((listener :accessor listener :initarg :listener :initform nil)
(default-url :accessor default-url :initarg :default-url)
(listener-class ... |
15a5eaee07773ebd0f4630728936ccf3405d02bf2495054a6ebca62254cf562f | guix-science/guix-science | jupyter-node.scm | ;;;
Copyright © 2019 , 2020 < >
;;;
;;; This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or ( at
;;; your option) any later version.
;;;
;;; This program i... | null | https://raw.githubusercontent.com/guix-science/guix-science/495039f94b06792d667f0c8c378fa74ff676bbef/guix-science/packages/jupyter-node.scm | scheme |
This program is free software; you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTI... | Copyright © 2019 , 2020 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(define-module (guix-science packages jupyter-node)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module ... |
8599bc93cbf39e364e0a32587fee98a8e660c02b8c5bae25431937b4559bb65c | tizoc/ppx_pgsql | ppx_pgsql_runtime.ml | module PGOCamlBind (PGOCaml : PGOCaml_generic.PGOCAML_GENERIC) = struct
let dbh_private_data dbh =
try PGOCaml.private_data dbh
with
| Not_found ->
let hash = Hashtbl.create 17 in
(PGOCaml.set_private_data dbh hash; hash)
let maybe_prepare_query ~dbh ~query ~name =
let hash = dbh_priv... | null | https://raw.githubusercontent.com/tizoc/ppx_pgsql/b681d069fb3afe0b990a39452c8d2a5656fe7a8f/lib/runtime/ppx_pgsql_runtime.ml | ocaml | is_list
is_list | module PGOCamlBind (PGOCaml : PGOCaml_generic.PGOCAML_GENERIC) = struct
let dbh_private_data dbh =
try PGOCaml.private_data dbh
with
| Not_found ->
let hash = Hashtbl.create 17 in
(PGOCaml.set_private_data dbh hash; hash)
let maybe_prepare_query ~dbh ~query ~name =
let hash = dbh_priv... |
ed44e95a83529a907ab640ed7cca7711774c4ed39151892767104735a0f6661e | sgbj/MaximaSharp | transl.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The data in this file contains enhancments. ;;;;;
;;; ;;;;;
... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/transl.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
The data in this file contains enhancments. ;;;;;
;;;;;
; ; ; ;
All rights reserved ;;;;;
; ;
; ;
File dir... |
(in-package :maxima)
(macsyma-module transl)
TRANSS User - interaction , FILE - I / O etc .
TRANS5 FSUBRS from COMM , and others , these are mere MACRO
FSUBRS .
TRANSF floating point intensive properties . BIGFLOAT stuff .
TRUTIL transl utilities .
TRMODE definition of MODEDECLAR... |
8ec5dec88b72762363105ba53311461092d22d8fd3485defd2a872e000047e09 | grzm/awyeah-api | rest_xml.clj | Copyright ( c ) Cognitect , Inc.
;; All rights reserved.
(ns ^:skip-wiki com.grzm.awyeah.protocols.rest-xml
"Impl, don't call directly."
(:require
[com.grzm.awyeah.protocols :as aws.protocols]
[com.grzm.awyeah.protocols.rest :as rest]
[com.grzm.awyeah.shape :as shape]))
(set! *warn-on-reflection* true)... | null | https://raw.githubusercontent.com/grzm/awyeah-api/5111c627f73955af8d2529f7ae793ca8203cff15/src/com/grzm/awyeah/protocols/rest_xml.clj | clojure | All rights reserved. | Copyright ( c ) Cognitect , Inc.
(ns ^:skip-wiki com.grzm.awyeah.protocols.rest-xml
"Impl, don't call directly."
(:require
[com.grzm.awyeah.protocols :as aws.protocols]
[com.grzm.awyeah.protocols.rest :as rest]
[com.grzm.awyeah.shape :as shape]))
(set! *warn-on-reflection* true)
(defn serialize
"xml... |
a2d09f308403b573f93e1d26310cfc22f176abe2431aee5bf574c3bbcf0995e9 | schemedoc/implementation-metadata | pcs-geneva.scm | (title "PCS/Geneva")
(long-title "PC-Scheme/Geneva")
Based on TI PC - Scheme 3.03
(person "Larry Bartholdi")
(person "Marc Vuilleumier")
(group "C.U.I. - Scheme group")
(academy "University of Geneva, Switzerland")
(country "CH")
(release
(version "4.02PL1"))
| null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/pcs-geneva.scm | scheme | (title "PCS/Geneva")
(long-title "PC-Scheme/Geneva")
Based on TI PC - Scheme 3.03
(person "Larry Bartholdi")
(person "Marc Vuilleumier")
(group "C.U.I. - Scheme group")
(academy "University of Geneva, Switzerland")
(country "CH")
(release
(version "4.02PL1"))
| |
aec5c25dba95ea70ae9398e2a49fbe5ea4dd064a5c8df9538175937ea62fa217 | show-matz/CL-STL | cl-stl-map.lisp | (in-package :cl-stl)
;;------------------------------------------------------------------------------
;;
;; class difinition
;;
;;------------------------------------------------------------------------------
(locally (declare (optimize speed))
(defclass map (bidirectional_container)
((rbtree :type :rbtree
... | null | https://raw.githubusercontent.com/show-matz/CL-STL/c6ffeac2815fa933121bc4c8b331d9c3516dff88/src/cl-stl-map.lisp | lisp | ------------------------------------------------------------------------------
class difinition
------------------------------------------------------------------------------
# + cl - stl - debug
( i d : type : symbol
: initform ( " MAP- " )
: initarg : i d
: accessor _ _ insta... | (in-package :cl-stl)
(locally (declare (optimize speed))
(defclass map (bidirectional_container)
((rbtree :type :rbtree
:initform nil
:initarg :core
:accessor __assoc-tree)
))
(defclass map_const_iterator (bidirectional_iterator)
((node :type :rbnode
:initform nil
:initarg :nod... |
e18add8b3efd9781987905a8fb6f8a7a6c2d2efc28f20899eddbdc28a3e3036d | friemen/metam | model.clj | (ns samples.statemachine.model
(require [clojure.java.io :as io]
[samples.statemachine.metamodel :refer :all]
[samples.statemachine.diagram :refer [generate-png]]
[metam.core :refer [pr-model]]))
(defn unlock-door [state] state)
(defn lock-door [state] state)
(defn unlock-panel [stat... | null | https://raw.githubusercontent.com/friemen/metam/35ed8d062c75418c792745ba91e2260b3b7dcbcf/samples/src/samples/statemachine/model.clj | clojure | (ns samples.statemachine.model
(require [clojure.java.io :as io]
[samples.statemachine.metamodel :refer :all]
[samples.statemachine.diagram :refer [generate-png]]
[metam.core :refer [pr-model]]))
(defn unlock-door [state] state)
(defn lock-door [state] state)
(defn unlock-panel [stat... | |
fdd8f036e379ee9045627b4f81510bcfc335b84f0450f76d1f736ca14f601ef0 | clckwrks/clckwrks | Pandoc.hs | module Clckwrks.Markup.Pandoc where
import Clckwrks.Types (Trust(..))
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
import Control.Monad.Trans (MonadIO(liftIO))
import Data.Text ... | null | https://raw.githubusercontent.com/clckwrks/clckwrks/dd4ea1e2f41066aa5779f1cc22f3b7a0ca8a0bed/Clckwrks/Markup/Pandoc.hs | haskell | | run the text through the 'markdown' executable. If successful,
and the input is marked 'Untrusted', run the output through
^ override command-line flags
^ do we trust the author
^ markdown text
^ Left error, Right html | module Clckwrks.Markup.Pandoc where
import Clckwrks.Types (Trust(..))
import Control.Concurrent (forkIO)
import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
import Control.Monad.Trans (MonadIO(liftIO))
import Data.Text ... |
3846517344fcdd75d6eab923aa9a6cb998b717681885adfbd21304b63d559810 | slipstream/SlipStreamServer | core_test.clj | (ns sixsq.slipstream.placement.core-test
(:require
[clojure.test :refer :all]
[sixsq.slipstream.placement.core :as pc]))
(deftest check-number-or-nil
(let [nils [nil -1 -1.0 -3/4 "a" true ["some" "values"]]
selves [nil 0 0.0 1 1.0 3/4]]
(doseq [v nils]
(is (nil? (pc/number-or-nil v))))
... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/jar-placement-lib/test/sixsq/slipstream/placement/core_test.clj | clojure | (ns sixsq.slipstream.placement.core-test
(:require
[clojure.test :refer :all]
[sixsq.slipstream.placement.core :as pc]))
(deftest check-number-or-nil
(let [nils [nil -1 -1.0 -3/4 "a" true ["some" "values"]]
selves [nil 0 0.0 1 1.0 3/4]]
(doseq [v nils]
(is (nil? (pc/number-or-nil v))))
... | |
81e64c26f3898c1469a769003d6332931002a0c27d3860b90145593262800d26 | jordwalke/rehp | findlib.ml | Js_of_ocaml compiler
* /
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your option ) any l... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/compiler/lib/findlib.ml | ocaml | Js_of_ocaml compiler
* /
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your option ) any l... | |
1fa71b76deb99de7a8ed29e604647ab42f6d0af45212d0fd83adc6ef3dbc7052 | GaloisInc/mistral | Parser.hs | module Mistral.Parser (
parseFile
, parseModule
, testLexer
, testLayout
) where
import Mistral.Driver
import qualified Mistral.Parser.AST as P
import qualified Mistral.Parser.Finalize as P
import qualified Mistral.Parser.Layout as P
import qualified Mistral.Parser.Lexer as P
i... | null | https://raw.githubusercontent.com/GaloisInc/mistral/3464ab332d73c608e64512e822fe2b8a619ec8f3/src/Mistral/Parser.hs | haskell | module Mistral.Parser (
parseFile
, parseModule
, testLexer
, testLayout
) where
import Mistral.Driver
import qualified Mistral.Parser.AST as P
import qualified Mistral.Parser.Finalize as P
import qualified Mistral.Parser.Layout as P
import qualified Mistral.Parser.Lexer as P
i... | |
ad600f7057d8c27ca0c920b4b2734f7b266cc38ebf09589f53f80594e7347423 | janestreet/accessor | custom_mappings_intf.ml | open! Base
open! Import
open Subtyping
module type S = sig
type ('inner, 'outer, 'kind) accessor
(** An [equality] can transform any mapping. There is no need for you to provide any
functionality of your own. *)
module Equality : sig
module Make_access (T : sig
type ('a, 'b) t
end) : sig... | null | https://raw.githubusercontent.com/janestreet/accessor/e905e32c808dfda6950be29987a4bf4f2595fbfc/src/custom_mappings_intf.ml | ocaml | * An [equality] can transform any mapping. There is no need for you to provide any
functionality of your own.
* A legal implementation of this function must satisfy the following properties:
{[
optional_getter Option.some = Fn.id
]}
{[
Fn.compose ... | open! Base
open! Import
open Subtyping
module type S = sig
type ('inner, 'outer, 'kind) accessor
module Equality : sig
module Make_access (T : sig
type ('a, 'b) t
end) : sig
val access
: ('i -> 'a -> 'b, 'it -> 'at -> 'bt, [> equality ]) accessor
-> ('i Index.t * 'a, 'b) T... |
5fe557c8468d405d80756b2d88a4c6cd7cf4e7a703eb89cde404aaa419b62993 | SRI-CSL/f3d | cmake-library.lisp | (in-package :cl-user)
;;;
;;; Cmake stuff:
;;;
(defparameter *automatically-run-cmake* t)
;;;
;;;
(defun load-foreign-library (path &key reload)
;; FIXME: should we cache using evp::ev-pathname-translate value or original path?
;; Is this right when using disksaves?
(let ((namestring (namestring path)))
... | null | https://raw.githubusercontent.com/SRI-CSL/f3d/93285f582198bfbab33ca96ff71efda539b1bec7/f3d-core/other/cmake-library.lisp | lisp |
Cmake stuff:
FIXME: should we cache using evp::ev-pathname-translate value or original path?
Is this right when using disksaves?
do not push unless load succeeds.
their DLLs in the correct place. We still need to manually copy
the files after building...
automatically run cmake once
cmake-library - ... | (in-package :cl-user)
(defparameter *automatically-run-cmake* t)
(defun load-foreign-library (path &key reload)
(let ((namestring (namestring path)))
(when (or reload (not (member namestring *loaded-foreign-libraries* :test #'string=)))
(unwind-protect
(prog1
#+cmu (multiple-value-bind (sta... |
cc16c0b47c8d159867033e78c8e256b3d210849d0277f2e464a548fb0ff13a1f | McCLIM/McCLIM | window-stream.lisp | ;;; ---------------------------------------------------------------------------
;;; License: LGPL-2.1+ (See file 'Copyright' for details).
;;; ---------------------------------------------------------------------------
( c ) copyright 2002 < >
( c ) copyright 2002 < adejneka >
( c ) copyright 2003 < ... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/4f6f655bcea615722aefd86695c5147ee8a4fde4/Core/clim-core/frames/window-stream.lisp | lisp | ---------------------------------------------------------------------------
License: LGPL-2.1+ (See file 'Copyright' for details).
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Input buffers in the spec a... | ( c ) copyright 2002 < >
( c ) copyright 2002 < adejneka >
( c ) copyright 2003 < >
( c ) copyright 2017 < >
29.4.5 Creating a Standalone CLIM Window
(in-package #:clim-internals)
(defclass window-stream (clim-stream-pane)
())
(define-application-frame a-window-stream (standard-application... |
2656c39db8148cd077725178082d49f7d79eb11514ea6ab43f37bfd1a943f8bd | GrammaticalFramework/gf-core | RunHTTP.hs | module RunHTTP(runHTTP,Options(..),cgiHandler) where
import Network.URI(uriPath,uriQuery)
import CGI(ContentType(..))
import CGI(CGIResult(..),CGIRequest(..),Input(..),
Headers,HeaderName(..))
import CGI(runCGIT)
import Network.Shed.Httpd(initServer,Request(..),Response(..))
import qualified... | null | https://raw.githubusercontent.com/GrammaticalFramework/gf-core/9b4f2dd18b64b770aaebfa1885085e8e3447f119/src/server/RunHTTP.hs | haskell | assumes method=="GET"
httpd-shed bug workaround | module RunHTTP(runHTTP,Options(..),cgiHandler) where
import Network.URI(uriPath,uriQuery)
import CGI(ContentType(..))
import CGI(CGIResult(..),CGIRequest(..),Input(..),
Headers,HeaderName(..))
import CGI(runCGIT)
import Network.Shed.Httpd(initServer,Request(..),Response(..))
import qualified... |
8bb9fd0e8b79054a1514c40dbd11474eeb900261300acc13b68c9481a41344c8 | sellout/haskerwaul | Preorder.hs | # language UndecidableInstances
, UndecidableSuperClasses #
, UndecidableSuperClasses #-}
module Haskerwaul.Preorder
( module Haskerwaul.Preorder
-- * extended modules
, module Haskerwaul.Relation.Homogeneous
) where
import Data.Bool (Bool)
import Data.Int (Int, Int... | null | https://raw.githubusercontent.com/sellout/haskerwaul/b32ecdb141a5f9cca04ed85dc952028242c160a8/src/Haskerwaul/Preorder.hs | haskell | * extended modules
| There are too many valid instances of this for almost any type for it to be
something to implement directly. This is generally provided automatically
via other instances where there is a /canonical/ instance for this type.
[nLab]()
= laws
[`Haskerwaul.Law.Reflexivity.reflexivity`]: ... | # language UndecidableInstances
, UndecidableSuperClasses #
, UndecidableSuperClasses #-}
module Haskerwaul.Preorder
( module Haskerwaul.Preorder
, module Haskerwaul.Relation.Homogeneous
) where
import Data.Bool (Bool)
import Data.Int (Int, Int8, Int16, Int32, Int64)
... |
4f61eb46865d86fea391fc380b6c2f8af3b914a7d9157787b92b76f2e870fdb3 | bmourad01/ocamlchess | version.ml | let major = 0
let minor = 1
| null | https://raw.githubusercontent.com/bmourad01/ocamlchess/6c7214f5b709d9b1327b384a057fbdb2b5a9c3db/chess/bin/version.ml | ocaml | let major = 0
let minor = 1
| |
70f72a1ade8d3e747bc9ee3d122370ad90e361631bd7c74defab3e64ee88b8ff | sunshineclt/Racket-Helper | 01.rkt | #lang racket
(define (cont-frac-iter N D k)
(define (solve-iter N D k idx result)
(if (= idx 0)
result
(solve-iter N D k (- idx 1) (/ (N idx) (+ (D idx) result))))
)
(solve-iter N D k k 0))
(cont-frac-iter (lambda (x) x)
(lambda (x) 1.0)
30)
(cont-frac-iter... | null | https://raw.githubusercontent.com/sunshineclt/Racket-Helper/bf85f38dd8d084db68265bb98d8c38bada6494ec/%E9%AA%86%E6%A2%81%E5%AE%B8/Assignment/2/01.rkt | racket | #lang racket
(define (cont-frac-iter N D k)
(define (solve-iter N D k idx result)
(if (= idx 0)
result
(solve-iter N D k (- idx 1) (/ (N idx) (+ (D idx) result))))
)
(solve-iter N D k k 0))
(cont-frac-iter (lambda (x) x)
(lambda (x) 1.0)
30)
(cont-frac-iter... | |
5b4c40d441d66a8c27a6448f6fdaf695cc60453b325f7f2514b2434e3f704ca3 | avsm/platform | p3.ml | let z () =
try P1.x ()
with _ -> 0
| null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/opam-client.2.0.5%2Bdune/tests/packages/P3/p3.ml | ocaml | let z () =
try P1.x ()
with _ -> 0
| |
ebe54ebbc0e9dbf1322aeaa51dc1b9f37ba03d850d4bbb6e4cd5137dcb14c1b9 | andrewthad/quickcheck-classes | Alternative.hs | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
#if HAVE_QUANTIFIED_CONSTRAINTS
# LANGUAGE QuantifiedConstraints #
#endif
# OPTIONS_GHC -Wall #
module Test.QuickCheck.Classes.Alternative
(
#if HAVE_UNARY_LAWS
alternativeLaws
#endif
) where
import Control.Applicative (Alternative(..))
import Test.QuickChec... | null | https://raw.githubusercontent.com/andrewthad/quickcheck-classes/0fc6c0602bc6875cdbde34cbdbcf229a175af62f/quickcheck-classes-base/src/Test/QuickCheck/Classes/Alternative.hs | haskell | | Tests the following alternative properties:
[/Left Identity/]
[/Associativity/] | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
#if HAVE_QUANTIFIED_CONSTRAINTS
# LANGUAGE QuantifiedConstraints #
#endif
# OPTIONS_GHC -Wall #
module Test.QuickCheck.Classes.Alternative
(
#if HAVE_UNARY_LAWS
alternativeLaws
#endif
) where
import Control.Applicative (Alternative(..))
import Test.QuickChec... |
8349a4313cb97d63db1cae990b04f33d3127b4429be9af8724a5d6cfc7eaf384 | dyzsr/ocaml-selectml | w47_inline.ml | (* TEST
flags = "-w +A-70"
* setup-ocamlc.byte-build-env
** ocamlc.byte
compile_only = "true"
*** check-ocamlc.byte-output
*)
let a = (fun x -> x) [@inline] (* accepted *)
let b = (fun x -> x) [@inline never] (* accepted *)
let c = (fun x -> x) [@inline always] (* accepted *)
let d = (fun x -> x) [@inline malformed... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/warnings/w47_inline.ml | ocaml | TEST
flags = "-w +A-70"
* setup-ocamlc.byte-build-env
** ocamlc.byte
compile_only = "true"
*** check-ocamlc.byte-output
accepted
accepted
accepted
rejected
rejected
rejected
rejected
accepted
accepted
accepted
rejected
accepted
ok
ok
bad payload
not local
ok
ok |
let test x =
let r =
if x = 1 then f1 x
else if x = 2 then f4 x
else if x = 3 then f1 x
else f5 x
in
f4 (f6 r)
|
50d9412ee928c281fb5551e140ca910cb7f77c2ecf07621ffb4d950c9b61533b | gchrupala/morfette | Models2.hs | module GramLab.Morfette.Models2 ( train
, trainFun
, predict
, predictPipeline
, toModelFun
, mkPreprune
, sentToExamples
... | null | https://raw.githubusercontent.com/gchrupala/morfette/be40676c975d660bbb893953d354168506069862/src/GramLab/Morfette/Models2.hs | haskell | beam size
models for each output column
prob dist over sequences of "tokens"
add label to output
multiply probability in
for each sequence (lzipper)
get label and prob by applying
model.
of any lzipper at end then return tokens
otherwise apply both classifiers in turn in the lzipper seq,
prune, adjust probs... | module GramLab.Morfette.Models2 ( train
, trainFun
, predict
, predictPipeline
, toModelFun
, mkPreprune
, sentToExamples
... |
c8ad6f765daefbed298f1fb3c44481c54c44f8fe4fb13ae94d27e03501bae047 | mishadoff/project-euler | problem037.clj | (ns project-euler
(:use [clojure.contrib.lazy-seqs :only (primes)]))
(defn is-prime? [prime]
(if (= 1 prime) false
(not-any? #(zero? (rem prime %)) (take-while #(<= (* % %) prime) primes))))
(defn to-seq [n]
(map #(- (int %) 48) (seq (str n))))
(defn to-num [seq]
(bigint (reduce str seq)))
(defn is-trun... | null | https://raw.githubusercontent.com/mishadoff/project-euler/45642adf29626d3752227c5a342886b33c70b337/src/project_euler/problem037.clj | clojure | (ns project-euler
(:use [clojure.contrib.lazy-seqs :only (primes)]))
(defn is-prime? [prime]
(if (= 1 prime) false
(not-any? #(zero? (rem prime %)) (take-while #(<= (* % %) prime) primes))))
(defn to-seq [n]
(map #(- (int %) 48) (seq (str n))))
(defn to-num [seq]
(bigint (reduce str seq)))
(defn is-trun... | |
f11b3c53817d6b3172e81f418a9cfb2c8d0e4cff0860cab0866b366e1bef757b | melange-re/melange | bsb_helper_depfile_gen.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/melange-re/melange/d40ae922fc3b317da5351dec5f5f79b8b52cf3f2/meldep/bsb_helper_depfile_gen.mli | ocaml | empty string means no mliast | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... |
920101062919c915f794afe82d7b9ed86635ac89b0932b407600a44d6154bdf5 | rumblesan/improviz | Geometries.hs | {-# LANGUAGE OverloadedStrings #-}
module Configuration.Geometries where
import Data.Either ( partitionEithers )
import qualified Data.List as L
import System.FilePath.Posix ( (</>) )
import Codec.Wavefront ( WavefrontOBJ
... | null | https://raw.githubusercontent.com/rumblesan/improviz/23e16ae7b2d55d2204417ec60c7cb6673a93df7d/src/Configuration/Geometries.hs | haskell | # LANGUAGE OverloadedStrings # |
module Configuration.Geometries where
import Data.Either ( partitionEithers )
import qualified Data.List as L
import System.FilePath.Posix ( (</>) )
import Codec.Wavefront ( WavefrontOBJ
... |
0b7c5dbbc8bca1e769a288641d99a556663afb1e0031d4215b10720a7b8bdbc1 | facebook/pyre-check | internalTaintIntegrationTest.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/974da4ba03fcb1115ccdec002b660da81af10d90/source/external/test/internalTaintIntegrationTest.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
4037b9adf4334ffaa7723ff3954e5344a2c8b04a43f7e2d2d28169d82652ca3c | SmiteshP/nvim-gps | nvimGPS.scm |
; Struct and Interface
((type_spec
name: (type_identifier) @class-name) @scope-root)
; Function
((function_declaration
name: (identifier) @function-name) @scope-root)
; Method
((method_declaration
receiver: (parameter_list
(parameter_declaration
type: (type_identifier) @class-name))
name: (field_identifier)... | null | https://raw.githubusercontent.com/SmiteshP/nvim-gps/642ff75e734d83b0d8f69234e612bdc343148eec/queries/go/nvimGPS.scm | scheme | Struct and Interface
Function
Method
Method with pointer |
((type_spec
name: (type_identifier) @class-name) @scope-root)
((function_declaration
name: (identifier) @function-name) @scope-root)
((method_declaration
receiver: (parameter_list
(parameter_declaration
type: (type_identifier) @class-name))
name: (field_identifier) @method-name) @scope-root-2)
((method_dec... |
a93f493d36c20f6dba2942f8695b9631619e2d1f24f3e612c82ec5c57e93e83f | clojurebook/ClojureProgramming | core.clj | (ns simple.core)
| null | https://raw.githubusercontent.com/clojurebook/ClojureProgramming/bcc7c58862982a5793e22788fc11a9ed7ffc548f/ch08-maven/src/main/clojure/simple/core.clj | clojure | (ns simple.core)
| |
66dfb2b670bea01c7f87516be2fdacd4bb20e723021e604b37d55a0cbc47c6bc | gethop-dev/hop-cli | settings.cljs | 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 /
(ns settings
(:require [clojure.string :as str]
[clojure.walk :as walk]
[re-frame.core :as rf]))
(defn build-node-id
... | null | https://raw.githubusercontent.com/gethop-dev/hop-cli/0b3240371fd2b7fbedf29d7420ce860619cc4f24/src/hop_cli/bootstrap/settings_editor/settings.cljs | clojure | file, You can obtain one at / | 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
(ns settings
(:require [clojure.string :as str]
[clojure.walk :as walk]
[re-frame.core :as rf]))
(defn build-node-id
[path]
(str/join "_" path))
... |
29ed331a29657b5f8ff15d9caa976b25021079cb1a6a445c69f49414d2067a64 | dyzsr/ocaml-selectml | t240-c_call1.ml | TEST
include tool - ocaml - lib
flags = " -w -a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w -a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Stdlib.int_of_string "123" <> 123 then raise Not_found;;
(** t... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/tool-ocaml/t240-c_call1.ml | ocaml | * test for fix of bug 6649: | TEST
include tool - ocaml - lib
flags = " -w -a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w -a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Stdlib.int_of_string "123" <> 123 then raise Not_found;;
if St... |
017124b41709b2319aea0b204db17a28fd99bc43b1bda1dedc598ea26e942e21 | btmura/b1 | Price.hs | -- | Module for getting stock prices.
module B1.Data.Price
( Price (..)
, getPriceChange
, getWeeklyPrices
) where
import Data.List
import Data.Time
import Data.Time.Calendar.WeekDate
-- | Price information during some time interval.
data Price = Price
{ startTime :: LocalTime -- ^ Start time of the trading... | null | https://raw.githubusercontent.com/btmura/b1/9cf0514ba1e03e9f4da05be9231acde07b199864/src/B1/Data/Price.hs | haskell | | Module for getting stock prices.
| Price information during some time interval.
^ Start time of the trading period
^ End time of the trading period
^ Opening price of the trading period
^ Highest price during the trading period
^ Lowest price during the trading period
^ Closing price of the trading period.
^... | module B1.Data.Price
( Price (..)
, getPriceChange
, getWeeklyPrices
) where
import Data.List
import Data.Time
import Data.Time.Calendar.WeekDate
data Price = Price
} deriving (Show, Eq)
getPriceChange :: [Price] -> Int -> Float
getPriceChange prices index
| index + 1 < length prices = change
| otherw... |
a0b83bdc8aa88dbf801d7536cc86c1292ad2ddc6ad5005677f8f4fc25203fbd3 | tanders/cluster-engine | 7e.lisp | (in-package cluster-engine)
(setf *random-state* (make-random-state t))
(print (cluster-engine::ClusterEngine 21 t nil
(append (cluster-engine::R-metric-hierarchy 0 :durations)
(r-note-meter #'(lambda (x) (progn (print x)
(if (equal '(4 4)... | null | https://raw.githubusercontent.com/tanders/cluster-engine/064ad4fd107f8d9a3dfcaf260524c2ab034c6d3f/test_files/7e.lisp | lisp | (in-package cluster-engine)
(setf *random-state* (make-random-state t))
(print (cluster-engine::ClusterEngine 21 t nil
(append (cluster-engine::R-metric-hierarchy 0 :durations)
(r-note-meter #'(lambda (x) (progn (print x)
(if (equal '(4 4)... | |
a45871355aa64ad368b91212aa2232c10a49847da2b68ad2f681aa16c9cc3107 | shirok/Gauche-makiki | connect.scm | ;;;
Copyright ( c ) 2015 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
1 . Redistributions of source code must retain the above copyright
;;; notice, this list of conditions... | null | https://raw.githubusercontent.com/shirok/Gauche-makiki/4e5b7d8eb867d09053e2376cc879c603efac6df5/makiki/connect.scm | scheme |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documentation... | Copyright ( c ) 2015 < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of the authors nor the names of its contributors
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING ... |
8144c27fb74d4c9452c2cc84f9d7037aea3d5838047ee4a97e0d0b3f5861ae03 | PrecursorApp/precursor | sliding_send.clj | (ns pc.http.sente.sliding-send
(:require [clojure.core.async :as async]
[pc.http.sente.common :as common]
[pc.util.seq :refer (dissoc-in)]
[slingshot.slingshot :refer (try+ throw+)]))
(defonce sliding-send-state (atom {:sending {:example-msg-type #{}}
... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src/pc/http/sente/sliding_send.clj | clojure | (ns pc.http.sente.sliding-send
(:require [clojure.core.async :as async]
[pc.http.sente.common :as common]
[pc.util.seq :refer (dissoc-in)]
[slingshot.slingshot :refer (try+ throw+)]))
(defonce sliding-send-state (atom {:sending {:example-msg-type #{}}
... | |
ec92949180013d598e5ad05189a146d7f6fb88629c9fffe5b9db1e7fb33de833 | metabase/connection-pool | connection_pool_test.clj | (ns metabase.connection-pool-test
(:require [clojure.test :refer :all]
[metabase.connection-pool :as connection-pool]))
(def ^:private spec
{:classname "org.h2.Driver", :subprotocol "h2", :subname "mem:db"})
(deftest properties-test
(testing "Options passed in to `connection-pool-spec` should get pa... | null | https://raw.githubusercontent.com/metabase/connection-pool/68b9967ab179a9f1551a29171d52ca306bd71217/test/metabase/connection_pool_test.clj | clojure | Properties are equality-comparable to maps | (ns metabase.connection-pool-test
(:require [clojure.test :refer :all]
[metabase.connection-pool :as connection-pool]))
(def ^:private spec
{:classname "org.h2.Driver", :subprotocol "h2", :subname "mem:db"})
(deftest properties-test
(testing "Options passed in to `connection-pool-spec` should get pa... |
40b30fa612e6cf1f7cef08505a223bbd56c9b8f6df884abc4c3e440e0a1a1ede | dhleong/spade | core.cljc | (ns spade.core
#?(:cljs (:require-macros [net.cgrand.macrovich :as macros]))
(:require [clojure.string :as str]
[clojure.walk :refer [postwalk prewalk]]
#?@(:clj [[net.cgrand.macrovich :as macros]
[spade.runtime]])
[spade.util :refer [factory->name build-sty... | null | https://raw.githubusercontent.com/dhleong/spade/d77c2adcf451aa9c0b55bd0a835d53f95c7becf4/src/spade/core.cljc | clojure | easiest case: no params? no need to call build-style-name
if we can extract the key statically, that's better
this (let) might get compiled out in advanced mode anyway, but
let's just generate simpler code instead of having a redundant
(let) if the keyframes take no params
keyframes are a bit of a special case
g... | (ns spade.core
#?(:cljs (:require-macros [net.cgrand.macrovich :as macros]))
(:require [clojure.string :as str]
[clojure.walk :refer [postwalk prewalk]]
#?@(:clj [[net.cgrand.macrovich :as macros]
[spade.runtime]])
[spade.util :refer [factory->name build-sty... |
e7142079008895ac7f098f25a665e6348b828dfa529a86060d1dea5f0628cf62 | LeiWangHoward/Common-Lisp-Playground | best-change-xiaotian.lisp | ;;make-best-change
(defun make-best-change (total &optional coins)
(let ((changes (if coins coins '(25 10 5 1))))
(values-list (reverse (car (best-change-helper total changes))))))
(defun best-change-helper (total changes &optional (result nil) (best nil))
(do ((lst (get-coin-set total changes) (cdr lst))
... | null | https://raw.githubusercontent.com/LeiWangHoward/Common-Lisp-Playground/4130232954f1bbf8aa003d856ccb2ab382da0534/graham-exercise/best-change-xiaotian.lisp | lisp | make-best-change | (defun make-best-change (total &optional coins)
(let ((changes (if coins coins '(25 10 5 1))))
(values-list (reverse (car (best-change-helper total changes))))))
(defun best-change-helper (total changes &optional (result nil) (best nil))
(do ((lst (get-coin-set total changes) (cdr lst))
(best-opt best ... |
1b7ae798e0111669c7b8c42b6d44d587bd5c90252fd9d93c6771f651b21c52fb | squirrel-prover/squirrel-prover | systemExpr.ml | open Utils
module L = Location
type error =
| Invalid_projection
| Missing_projection
| Incompatible_systems
| Expected_compatible
| Expected_fset
| Expected_pair
exception Error of error
let error e = raise (Error e)
let pp_error fmt = function
| Invalid_projection -> Format.fprintf fmt "invalid proj... | null | https://raw.githubusercontent.com/squirrel-prover/squirrel-prover/b50eebf07debe8b39bd317c2c39046c0fa3ce60c/src/systemExpr.ml | ocaml | ------------------------------------------------------------------
* Each single system is identified by a label.
The list cannot be empty. All single systems are compatible.
------------------------------------------------------------------
------------------------------------------------------------------
... | open Utils
module L = Location
type error =
| Invalid_projection
| Missing_projection
| Incompatible_systems
| Expected_compatible
| Expected_fset
| Expected_pair
exception Error of error
let error e = raise (Error e)
let pp_error fmt = function
| Invalid_projection -> Format.fprintf fmt "invalid proj... |
95cd30c74c970cfe31dac43513101738e164e02265e053b21bf6140ef9ee46fd | AlacrisIO/legicash-facts | rlptest_util.ml | open Ppx_deriving_rlp_runtime
(* --------------------------------------------------------------- *)
(* Parsing the JSON inputs and outputs in the tests *)
let rec json_to_rlp_item json =
match json with
| `Int i -> int_to_rlp_item i
Strings that start with ` # ` are parsed as decimal numbers ,
... | null | https://raw.githubusercontent.com/AlacrisIO/legicash-facts/5d3663bade68c09bed47b3f58fa12580f38fdb46/src/ppx_deriving_rlp/test/rlptest_util.ml | ocaml | ---------------------------------------------------------------
Parsing the JSON inputs and outputs in the tests
---------------------------------------------------------------
Show function for test cases | open Ppx_deriving_rlp_runtime
let rec json_to_rlp_item json =
match json with
| `Int i -> int_to_rlp_item i
Strings that start with ` # ` are parsed as decimal numbers ,
see mediumint4 , , and bigint for examples .
see mediumint4, mediumint5, and bigint for example... |
99d318fb622d6767f03f9f28dd784c806e72ac3a77896223e6f0feed44c5c3ef | digitallyinduced/ihp | Types.hs | |
Module : IHP.FileStorage . Types
Copyright : ( c ) digitally induced GmbH , 2021
Module: IHP.FileStorage.Types
Copyright: (c) digitally induced GmbH, 2021
-}
module IHP.FileStorage.Types
( FileStorage (..)
, StoredFile (..)
, StoreFileOptions (..)
, TemporaryDownloadUrl (..)
) where
import IHP.Prelude
import q... | null | https://raw.githubusercontent.com/digitallyinduced/ihp/18f104da69c526ff9e8ad3a6cdaedc6d39afb38c/IHP/FileStorage/Types.hs | haskell | ^ Stores files publicly visible inside the project's @static@ directory
^ Stores files inside a S3 compatible cloud storage
| Result of a 'storeFile' operation
| Options that can be passed to 'storeFileWithOptions'
^ Directory on S3 or inside the @static@ where all files are placed
^ The browser uses the content ... | |
Module : IHP.FileStorage . Types
Copyright : ( c ) digitally induced GmbH , 2021
Module: IHP.FileStorage.Types
Copyright: (c) digitally induced GmbH, 2021
-}
module IHP.FileStorage.Types
( FileStorage (..)
, StoredFile (..)
, StoreFileOptions (..)
, TemporaryDownloadUrl (..)
) where
import IHP.Prelude
import q... |
0659785dd7b585d2a53ed14d770543f5c452ffcb68dfe6e8f42a299ffcb94af9 | qkrgud55/ocamlmulti | kb.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/testsuite/tests/misc-kb/kb.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 Q Public License version 1.0 .
$ I d : 12800 2012 - 07 - 30 18:59:0... |
b94ccc1c093c72e7c707ee6e18bcca3c475f11191d69af4e97929d1e4d2febd2 | fpco/ide-backend | Configure.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Configure
Copyright : 2003 - 2005
--
-- Maintainer :
-- Portability : portable
--
-- This deals with the /configure/ phase. It provides the 'configure' action
-- which is given the packa... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.14.0/Distribution/Simple/Configure.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Simple.Configure
Maintainer :
Portability : portable
This deals with the /configure/ phase. It provides the 'configure' action
which is given the package description and configure flags. It then tries
... | Copyright : 2003 - 2005
any required @pkg - config@ packages ( updating the ' ' with the
Then based on all this it saves the info in the ' ' and writes
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the followin... |
39398b8ea99c1c65ef674ea179884c0bff98daaaef239e184b38e0b06ad0ab77 | swlkr/majestic-web | majestic_web.clj | (ns leiningen.new.majestic-web
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main])
(:import (java.text SimpleDateFormat)
(java.util Date UUID)))
(def render (renderer "majestic_web"))
(def date-format "yyyyMMddHHmmss")
(def alphanumeri... | null | https://raw.githubusercontent.com/swlkr/majestic-web/3d247f6b5ccc4ff3662a64544a4ca27beada971b/src/leiningen/new/majestic_web.clj | clojure | root folder
src folder
src/users folder
src/home folder
src/sessions folder
test folder
resources folder | (ns leiningen.new.majestic-web
(:require [leiningen.new.templates :refer [renderer name-to-path ->files]]
[leiningen.core.main :as main])
(:import (java.text SimpleDateFormat)
(java.util Date UUID)))
(def render (renderer "majestic_web"))
(def date-format "yyyyMMddHHmmss")
(def alphanumeri... |
20074d2de5df8e962ec8df7017efa0ec75eeca905a9eefcd8a6c139f779fa104 | flipstone/haskell-for-beginners | 2_guards_guards.hs | Write a function that compares two
-- pairs and determines the ordering of them
pairCompare :: Ord a => (a,a) -> (a,a) -> Ordering
pairCompare (x1,y1) (x2,y2)
| x1 < x2 = LT
| x1 > x2 = GT
| y1 < y2 = LT
| y1 > y2 = GT
| otherwise = EQ
Write a function that implements
-- ()
-- for all positive integers... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_04/2_guards_guards.hs | haskell | pairs and determines the ordering of them
()
for all positive integers using guards. | Write a function that compares two
pairCompare :: Ord a => (a,a) -> (a,a) -> Ordering
pairCompare (x1,y1) (x2,y2)
| x1 < x2 = LT
| x1 > x2 = GT
| y1 < y2 = LT
| y1 > y2 = GT
| otherwise = EQ
Write a function that implements
fizzBuzz x
| x `mod` 15 == 0 = "Fizz Buzz"
| x `mod` 5 == 0 = "Buzz"
| x ... |
e0d3edad259cc5f0faf5210ecac4d766e23b3bc21ad19387b5f3328b134dc276 | incoherentsoftware/defect-process | Run.hs | module Enemy.All.Giant.AI.Run
( runBehaviorInstr
) where
import Control.Monad.IO.Class (liftIO)
import System.Random (randomRIO)
import Attack
import Collision
import Configs.All.Enemy
import Configs.All.Enemy.Giant
import Constants
import Enemy as E
import Enemy.All.Giant.Behavior
import Enemy.All.G... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Enemy/All/Giant/AI/Run.hs | haskell | module Enemy.All.Giant.AI.Run
( runBehaviorInstr
) where
import Control.Monad.IO.Class (liftIO)
import System.Random (randomRIO)
import Attack
import Collision
import Configs.All.Enemy
import Configs.All.Enemy.Giant
import Constants
import Enemy as E
import Enemy.All.Giant.Behavior
import Enemy.All.G... | |
9c50f90908b6f7cd585e88fa35dae8f09ab51d0142fa0e2c7c6ed1f6a2cf6990 | elaforge/fast-tags | Lexer.hs | -- | This is a fake module so ghci works. When cabal builds, it will be
-- shadowed by Lexer.x output. TODO get ghci to generate and use the alex
-- output.
module FastTags.Lexer where
import qualified Data.Text as Text
import qualified FastTags.Token as Token
tokenize :: FilePath -> Bool -> Text.Text -> Either St... | null | https://raw.githubusercontent.com/elaforge/fast-tags/085f7ffdd93d7152c9544ac8c8e4e3b0226b0d93/src/FastTags/Lexer.hs | haskell | | This is a fake module so ghci works. When cabal builds, it will be
shadowed by Lexer.x output. TODO get ghci to generate and use the alex
output. | module FastTags.Lexer where
import qualified Data.Text as Text
import qualified FastTags.Token as Token
tokenize :: FilePath -> Bool -> Text.Text -> Either String [Token.Token]
tokenize _ _ _ = Left "no lexer"
|
38f8289a580f61bc9b12515fa42ad7cf76fd3fa907c92726994d240603f2bf3d | screenshotbot/screenshotbot-oss | image.lisp | (defpackage :scale/image
(:use #:cl)
(:import-from #:scale/core
#:snapshot-pending-p
#:with-cached-ssh-connections
#:delete-instance
#:make-snapshot
#:create-instance-from-snapshot
#:snapshot-exists-p
#:c... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/7a56e6db4377e3bb9d4808939f0352cd88c4fc17/src/scale/image.lisp | lisp | todo: more carefully... | (defpackage :scale/image
(:use #:cl)
(:import-from #:scale/core
#:snapshot-pending-p
#:with-cached-ssh-connections
#:delete-instance
#:make-snapshot
#:create-instance-from-snapshot
#:snapshot-exists-p
#:c... |
e9f5dbf93febcbd543b741b62a7c17f2cf53500bb9c25e6dda62377bd0a2c466 | commercialhaskell/stack | Source.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
-- Load information on package sources
module Stack.Build.Source
( projectLocalPackages
, localDependencies
, loadCommonPackage
, loadLocalPackage
, loadSourceMap
, getLocalFlags
, addUnlistedToBui... | null | https://raw.githubusercontent.com/commercialhaskell/stack/7e35041ed27ebc9f3076d201a1c3f42dd04111db/src/Stack/Build/Source.hs | haskell | Load information on package sources
| loads and returns project packages
| loads all local dependencies - project packages and local extra-deps
| Given the parsed targets and build command line options constructs a source
map
Basic rules:
they voided the warranty. This includes installing a brand new build t... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
module Stack.Build.Source
( projectLocalPackages
, localDependencies
, loadCommonPackage
, loadLocalPackage
, loadSourceMap
, getLocalFlags
, addUnlistedToBuildCache
, hashSourceMapData
) where... |
914d3c354f331e21e4380dc6600d269a615d80eae9161d776f19928833e550cf | uwplse/PUMPKIN-PATCH | proofdifferencers.mli | (* --- Differencing of Proofs --- *)
open Evd
open Searchopts
open Differencers
(*
* Primitive differencing function
*)
val find_difference : proof_differencer configurable
* Determine if two proof diffs are identical
* Determine if two proof diffs are identical
*)
val no_diff : proof_diff_predicate config... | null | https://raw.githubusercontent.com/uwplse/PUMPKIN-PATCH/73fd77ba49388fdc72702a252a8fa8f071a8e1ea/plugin/src/core/components/differencing/proofdifferencers.mli | ocaml | --- Differencing of Proofs ---
* Primitive differencing function
* Return the identity candidates applied to the type
* of the new proof in the diff
|
open Evd
open Searchopts
open Differencers
val find_difference : proof_differencer configurable
* Determine if two proof diffs are identical
* Determine if two proof diffs are identical
*)
val no_diff : proof_diff_predicate configurable
val identity_candidates : proof_differencer
|
c0a41d7c4eab0b2156c61701e960ef52c65b4fd3a495af79e5e619b768fd0e80 | ghcjs/ghcjs-dom | QuickTimePluginReplacement.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.QuickTimePluginReplacement
(js_postEvent, postEvent, js_getMovieSize, getMovieSize,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/QuickTimePluginReplacement.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.QuickTimePluginReplacement
(js_postEvent, postEvent, js_getMovieSize, getMovieSize,
js_getTimedMetaData, getTimedMetaData, js_getAccessLog,
getAccessLog, js_getErrorLog, ... |
3e5a0d48b66a7c941cbae43526b4d2fa61f2517a3c5da7efccd9930eaba97d53 | philbaker/reagent-tailwind | state.cljs | (ns frontend.state
(:require [reagent.core :refer [atom]]))
(defonce app-state (atom {:count 0}))
| null | https://raw.githubusercontent.com/philbaker/reagent-tailwind/b31b0795f4d9e88a63af6fcabc3aa63601515c7d/src/main/frontend/state.cljs | clojure | (ns frontend.state
(:require [reagent.core :refer [atom]]))
(defonce app-state (atom {:count 0}))
| |
88954e6981f2fd10ef41849a198c369b944b943946b7e8bf034a8b84994d06c1 | hyperledger-labs/fabric-chaincode-haskell | Stub.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module Stub where
import qualified Common.Common as Pb
import Control.Monad.Except ( ExceptT(..), runExceptT, throwError )
import Data.Bifunctor
import Data.ByteString ... | null | https://raw.githubusercontent.com/hyperledger-labs/fabric-chaincode-haskell/9594e82371a9a805ad812e38fd58e063df5ca4e7/src/Stub.hs | haskell | # LANGUAGE OverloadedStrings #
NOTE: When support for concurrency transaction is added, this function will no longer be required
as the stub function will block and listen for responses over a channel when the code is concurrent
getStringArgs :: ccs -> [Text]
getFunctionAndParameters :: ccs -> Either Error (Text, [... |
# OPTIONS_GHC -fno - warn - orphans #
module Stub where
import qualified Common.Common as Pb
import Control.Monad.Except ( ExceptT(..), runExceptT, throwError )
import Data.Bifunctor
import Data.ByteString as BS
import qualified Data.Byt... |
c3407cb7635e2f7adfb45a339c11a8fc245e8885111d628668caf9bb6ec38552 | erikd/vector-algorithms | Intro.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
-- ---------------------------------------------------------------------------
-- |
-- Module : Data.Vector.Algorithms.Intro
Copyright : ( c ) 2008 - 2015
Maintainer : < >
-- Stability... | null | https://raw.githubusercontent.com/erikd/vector-algorithms/a8b985c16ae9d6560376f57eb7a9a175b4e3ea78/src/Data/Vector/Algorithms/Intro.hs | haskell | # LANGUAGE BangPatterns #
---------------------------------------------------------------------------
|
Module : Data.Vector.Algorithms.Intro
Stability : Experimental
Portability : Non-portable (type operators, bang patterns)
This module implements various algorithms based on the introsort algorithm,
fo... | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
Copyright : ( c ) 2008 - 2015
Maintainer : < >
originally described by in the paper /Introspective Sorting
and Selection Algorithms/. It is also in widespread practical use , as the
standard unstable sort used ... |
a3cb25504db926ac837913780c81a986440e28dd59e0ef7ddb51fd68d8f9208f | tarides/current-albatross-deployer | iptables_daemon_api.ml | module Rpc = struct
type ('a, 'b) t = { tag : string; query : 'a Asn.t; resp : 'b Asn.t }
type untagged_buffer = Cstruct.t
module Tag = struct
type ('a, 'b) rpc = ('a, 'b) t
type t = string
module Map = Map.Make (String)
let header tag =
let tag_buffer = Cstruct.of_string tag in
let... | null | https://raw.githubusercontent.com/tarides/current-albatross-deployer/f4e7b88edf2c2d71a571178466d34048dad57bf7/lib/iptables-api/iptables_daemon_api.ml | ocaml | what to do with the trailing bytes?
what to do with the trailing bytes? | module Rpc = struct
type ('a, 'b) t = { tag : string; query : 'a Asn.t; resp : 'b Asn.t }
type untagged_buffer = Cstruct.t
module Tag = struct
type ('a, 'b) rpc = ('a, 'b) t
type t = string
module Map = Map.Make (String)
let header tag =
let tag_buffer = Cstruct.of_string tag in
let... |
d3eb3c47fe15e5dd98015ebcbc5b00b781a92673f22513c32359c820936e6ea4 | wireless-net/erlang-nommu | wxEraseEvent.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxEraseEvent.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
See also the message variant { @link wxE... |
41c1211e2aadda60045dd15802cddde1ec346c2e16d33b19a89caf52c66e6633 | ocaml-omake/omake | lm_bitset.mli | (* This is for VERY SMALL bitsets only that fit into a few machine words *)
type t
val create : unit -> t
val is_set : t -> int -> bool
val set : t -> int -> t
val set_multiple : t -> int list -> t
| null | https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/libmojave/lm_bitset.mli | ocaml | This is for VERY SMALL bitsets only that fit into a few machine words |
type t
val create : unit -> t
val is_set : t -> int -> bool
val set : t -> int -> t
val set_multiple : t -> int list -> t
|
8211de6986c0b7c076e6aab8926424c04a71e0356b498ae5ac0d37fa8311c095 | inria-parkas/sundialsml | idaHeat2D_klu.ml |
* -----------------------------------------------------------------
* $ Revision : 1.2 $
* $ Date : 2009/09/30 23:25:59 $
* -----------------------------------------------------------------
* Programmer(s ): @ LLNL
* -----------------------------------------------------------------
* Example prob... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/a1848318cac2e340c32ddfd42671bef07b1390db/examples/ida/serial/idaHeat2D_klu.ml | ocaml | Problem Constants
mesh grid size
total num of nonzero elements
set up number of elements in each column
set up data and row values stored
---- set up number of elements in each column ----
count by twos in the middle
count by fours in the middle
*** repeated (mgrid-4 times) middle column blocks ***
sh... |
* -----------------------------------------------------------------
* $ Revision : 1.2 $
* $ Date : 2009/09/30 23:25:59 $
* -----------------------------------------------------------------
* Programmer(s ): @ LLNL
* -----------------------------------------------------------------
* Example prob... |
913b2d620089e28a138eadb346aed96ea3cb46bf2bf13be8224bc3033b465bee | rowangithub/DOrder | 459_a-dotprod.ml | (*
USED: PLDI2011 as a-prod
*)
let make_array n i = assert (0 <= i && i < n); 0
let rec dotprod n v1 v2 i sum =
if i >= n then
sum
else
dotprod n v1 v2 (i + 1) (sum + v1 i * v2 i)
let main z n =
let v1 = make_array n in
let v2 = make_array n in
if z=0 then (dotprod n v1 v2 z z; ())
else ()
let _ =... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/459_a-dotprod.ml | ocaml |
USED: PLDI2011 as a-prod
|
let make_array n i = assert (0 <= i && i < n); 0
let rec dotprod n v1 v2 i sum =
if i >= n then
sum
else
dotprod n v1 v2 (i + 1) (sum + v1 i * v2 i)
let main z n =
let v1 = make_array n in
let v2 = make_array n in
if z=0 then (dotprod n v1 v2 z z; ())
else ()
let _ = main 2 3
let _ = main 3 2
let ... |
9332ec9dbd8d67ae725beab97d2a30a21c87e97b8347b680942d6d1d299b155a | anwarmamat/cmsc330spring18-public | public.ml | open OUnit2
open Disc
let test_one ctxt =
assert_equal ([EOF], Int 1) (parse_S [Tok_Int 1; EOF])
;;
let test_one_plus_two ctxt =
assert_equal ([EOF], Plus (Int 1, Int 2)) (parse_S [Tok_Int 1; Tok_Plus; Tok_Int 2; EOF])
;;
let test_right_associative ctxt =
assert_equal ([EOF], Plus (Int 1, Plus (Int 2, Int 3)))... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330spring18-public/b401e5157c05c7f47ee2d0ec1b21c7b142316031/discussions/disc8/public.ml | ocaml | open OUnit2
open Disc
let test_one ctxt =
assert_equal ([EOF], Int 1) (parse_S [Tok_Int 1; EOF])
;;
let test_one_plus_two ctxt =
assert_equal ([EOF], Plus (Int 1, Int 2)) (parse_S [Tok_Int 1; Tok_Plus; Tok_Int 2; EOF])
;;
let test_right_associative ctxt =
assert_equal ([EOF], Plus (Int 1, Plus (Int 2, Int 3)))... | |
544bf21f358e88b28005316815705a22f672275f79287f5b1e072a74d4635e29 | jarohen/yoyo | css.clj | (ns {{name}}.service.css
(:require [garden.core :as css]))
(defn site-css []
(css/css []))
| null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/templates/yoyo-webapp/src/leiningen/new/yoyo_webapp/clj/css.clj | clojure | (ns {{name}}.service.css
(:require [garden.core :as css]))
(defn site-css []
(css/css []))
| |
8eaf5147e9ba488bb86af28445f6fe001a433c07fc796e670ec257ed37df16aa | bmillare/dj | datomic.clj | (ns dj.datomic
(:require [cemerick.pomegranate :as pom]
[dj]
[dj.io]))
(defn download []
"goto and download the newest version of datomic")
(defn install [datomic-zip-file]
"installs the downloaded version of datomic in local maven repository"
(let [tmp-dir (dj.io/file dj/system-root ... | null | https://raw.githubusercontent.com/bmillare/dj/d87fd279c304b2552ffa5e5ab0e740ae48582bb6/src/dj/datomic.clj | clojure | (ns dj.datomic
(:require [cemerick.pomegranate :as pom]
[dj]
[dj.io]))
(defn download []
"goto and download the newest version of datomic")
(defn install [datomic-zip-file]
"installs the downloaded version of datomic in local maven repository"
(let [tmp-dir (dj.io/file dj/system-root ... | |
2abe49d5fac970a813ea97ee1ffa5fd6db0657d415ebb74f4ce3b049e6d9d127 | ygmpkk/house | QuickCheck.hs | module QuickCheck (module Debug.QuickCheck) where
import Debug.QuickCheck
| null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/hslibs/util/check/QuickCheck.hs | haskell | module QuickCheck (module Debug.QuickCheck) where
import Debug.QuickCheck
| |
785cca077e5341714d5c1246bbd4200483c16d3401e6a2bd06aba0a199731d10 | YoungTurks/hackerdict | web.clj | (ns hackerdict.web
(:require [compojure.core :refer [defroutes GET ANY]]
[compojure.handler :refer [site]]
[compojure.route :as route]
[clojure.java.io :as io]
[hackerdict.helpers.auth :as auth]
[hackerdict.db :as db]
[hackerdict.rest.auth :refer... | null | https://raw.githubusercontent.com/YoungTurks/hackerdict/44e5c285b3195718c4d5bc9cb4423623f22d3da3/src/hackerdict/web.clj | clojure | Private functions
TODO: heroku config:add SESSION_SECRET=$RANDOM_16_CHARS
(db/connect!)
(db/get-db!)
For interactive development: | (ns hackerdict.web
(:require [compojure.core :refer [defroutes GET ANY]]
[compojure.handler :refer [site]]
[compojure.route :as route]
[clojure.java.io :as io]
[hackerdict.helpers.auth :as auth]
[hackerdict.db :as db]
[hackerdict.rest.auth :refer... |
3d14603fe999644b7c1ae9b58401aeeb857f6a45c1dde5cdfc6ad998c02ffc0e | EarnestResearch/yambda | Main.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{- | Simple JSON webserver.
Example taken from -servant/servant/blob/master/s... | null | https://raw.githubusercontent.com/EarnestResearch/yambda/b1f45e42447c08d7da4b3f470bdb849c9ea1b200/examples/wai/Main.hs | haskell | # LANGUAGE DerivingVia #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
| Simple JSON webserver.
Example taken from -servant/servant/blob/master/servant-server/example/greet.hs
* Example
| A greet message data type
API specification
GET /hello/:name?capita... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE PolyKinds #
module Main where
import AWS.Lambda.Wai.Handler
import Control.Monad.Logger
import Data.Aeson
import Data.Proxy
import Data.Text
import GHC.Generics
import Network.Wai
import Servant
newtype Greet = Greet { _msg :: Text ... |
6890681f9272cecfe13313da3db19f85a1e80f31e7ee6d003ef0e3ad37975cf2 | ConsumerDataStandardsAustralia/validation-prototype | Banking.hs | {-# LANGUAGE OverloadedStrings #-}
module Web.ConsumerData.Au.LambdaBank.Server.Banking where
-
Notes : this is just moving the FakeServer from the types tests across for now .
We will split it apart and make it into a real server with config and a database
and not all in one file . Do n't be too upset
that it... | null | https://raw.githubusercontent.com/ConsumerDataStandardsAustralia/validation-prototype/ff63338b77339ee49fa3e0be5bb9d7f74e50c28b/consumer-data-au-lambdabank/src/Web/ConsumerData/Au/LambdaBank/Server/Banking.hs | haskell | # LANGUAGE OverloadedStrings #
} | module Web.ConsumerData.Au.LambdaBank.Server.Banking where
-
Notes : this is just moving the FakeServer from the types tests across for now .
We will split it apart and make it into a real server with config and a database
and not all in one file . Do n't be too upset
that it looks heinous for now !
-
Notes:... |
6de448a8b276a833d6a1f945d4473b978a106818aed26930561e7d8b750c5a29 | stopachka/godel-numbers | godel_numbers.clj | (ns godel-numbers
(:require [clojure.set :refer [map-invert]]
[clojure.string :as string]))
(defn primes
([] (primes 2 []))
([current known-primes]
(let [factors (take-while #(<= (* % %) current) known-primes)
remainders (map #(mod current %) factors)]
(if (some zero? remainders)
... | null | https://raw.githubusercontent.com/stopachka/godel-numbers/a84ae18aae64f469d6bc27769b10f902014b81e1/src/godel_numbers.clj | clojure | (ns godel-numbers
(:require [clojure.set :refer [map-invert]]
[clojure.string :as string]))
(defn primes
([] (primes 2 []))
([current known-primes]
(let [factors (take-while #(<= (* % %) current) known-primes)
remainders (map #(mod current %) factors)]
(if (some zero? remainders)
... | |
2f19ddba3d3bc2811008cdfceb628cba335c2d2b6cfeae9cd6d639baa0b0ab63 | nuprl/gradual-typing-performance | copy.rkt | #lang racket/base
;; Usage:
< benchmark - dir > < bitstring >
;; Given the name of a benchmark with N files and an N-bit number
( represented as a string of 1 and 0 )
;; copy the corresponding typed and untyped files from the benchmark
;; to the current directory.
(require
file/glob
racket/file
ra... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/tools/summarize/copy.rkt | racket | Usage:
Given the name of a benchmark with N files and an N-bit number
copy the corresponding typed and untyped files from the benchmark
to the current directory.
=============================================================================
========================================================================... | #lang racket/base
< benchmark - dir > < bitstring >
( represented as a string of 1 and 0 )
(require
file/glob
racket/file
racket/path)
(define BASE "base")
(define BOTH "both")
(define TYPED "typed")
(define UNTYPED "untyped")
(define (benchmark-directory? x)
(and (path-string? x)
(direc... |
81382e5092f39120274bbd0342282c2188022531ee6cf814eae10c724c12b5f9 | sbcl/sbcl | defmacro.lisp | ;;;; DEFMACRO machinery
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provi... | null | https://raw.githubusercontent.com/sbcl/sbcl/e61b98dc5f979d1c0fbf0587d3cdea02ad5d8a89/src/code/defmacro.lisp | lisp | DEFMACRO machinery
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
local function definitions (ordinary) can shadow a global macro
Note: Technically there could be an ENV optional argument ... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-C")
(defun macro-function (symbol &optional env)
"If SYMBOL names a macro in ENV, returns the expansion fu... |
720e7de989426f51bceb8e63284a348f6c817e4caf145dcb5a327a27405bb814 | ocaml-sf/learn-ocaml-corpus | build_forgets_to_consume_leaf.ml | (* The data values carried by the leaves of a tree. *)
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
(* The depths of the leaves of a tree. *)
let rec depths d t ds =
match t with
| Le... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/spectre/wrong/build_forgets_to_consume_leaf.ml | ocaml | The data values carried by the leaves of a tree.
The depths of the leaves of a tree.
The elements and depths, combined.
A direct definition can also be given.
A facility for reading and consuming the elements of a list.
Reconstructing a tree from its spectre.
Premature end of input.
If this element lies ... |
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
let rec depths d t ds =
match t with
| Leaf _ ->
d :: ds
| Fork (t, u) ->
depths (d + 1) t (depths (d + 1) u ds)
let depths... |
8c0c54d782999e2a5f5e32061150eae0f0036b0df5e8f31009b230aa33c479de | janegca/htdp2e | 1301-SP-WordGameV2.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-abbr-reader.ss" "lang")((modname 1301-SP-WordGameV2) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") ... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/02-ArbitrarilyLargeData/1301-SP-WordGameV2.rkt | racket | about the language level of this file in a form that our tools can easily process.
Given a word, find (all possible) words that are made up from some letters.
For example “cat” also spells “act.”
String -> List-of-strings
find all words that the letters of some given word spell
List-of-words -> List-of-string... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname 1301-SP-WordGameV2) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (h... |
9d83a85708bb1dca14d055f9685e9a51bb0a59d4cef10b945a8af6a98fb43479 | awslabs/s2n-bignum | bignum_cmul_sm2_alt.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/6b53f075a0e28e6b89db12301de5f59ec788855c/x86/proofs/bignum_cmul_sm2_alt.ml | ocaml | =========================================================================
Multiplication modulo p_sm2 of a single word and a bignum < p_sm2.
=========================================================================
*** print_literal_from_elf "x86/sm2/bignum_cmul_sm2_alt.o";;
***
XOR (% r10) (% r10)
ADD... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_cmul_sm2_alt_mc =
define_assert_from_elf "bignum_cmul... |
3dd2c0a3b2fcb9167953e02c28d6c78b80d6bc2ad7522878ccfc123507e97885 | RolfRolles/PandemicML | Candidate.ml | open FrameworkUtil
open DataStructures
open IOPair
type candidate_results =
{
c_preserved_regs: IRUtil.VarSet.t triplicate;
c_copied_regs: (IRUtil.VarSet.t IRUtil.VarMap.t) triplicate;
c_set_const: VarInt32Set.t triplicate;
c_mem_read_const: VarVarInt32Set.t triplicate;
c_mem_write_reg: VarVarInt32Set.t trip... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/Projects/Nxcroticism/Candidate.ml | ocaml | open FrameworkUtil
open DataStructures
open IOPair
type candidate_results =
{
c_preserved_regs: IRUtil.VarSet.t triplicate;
c_copied_regs: (IRUtil.VarSet.t IRUtil.VarMap.t) triplicate;
c_set_const: VarInt32Set.t triplicate;
c_mem_read_const: VarVarInt32Set.t triplicate;
c_mem_write_reg: VarVarInt32Set.t trip... | |
36fe62be08c2f4c00b7dc514bde6c2988814fcaa258d9e2ebedd39409d60de6b | BillHallahan/G2 | HigherOrderList.hs | module HigherOrderList where
g :: [Int -> Int] -> Int -> [Int]
g [] _ = []
g (f:fs) x = f x:g fs x
| null | https://raw.githubusercontent.com/BillHallahan/G2/dfd377793dcccdc7126a9f4a65b58249673e8a70/tests/TestFiles/HigherOrderList.hs | haskell | module HigherOrderList where
g :: [Int -> Int] -> Int -> [Int]
g [] _ = []
g (f:fs) x = f x:g fs x
| |
b631e486e923548690f74061d4ef8cd6d0cdbfa0cde02d022747f9078039df30 | cyga/real-world-haskell | MaybeTParse.hs | file : ch18 / MaybeTParse.hs
# LANGUAGE GeneralizedNewtypeDeriving #
module MaybeTParse
(
Parse
, evalParse
) where
import MaybeT
import Control.Monad.State
import Data.Int (Int64)
import qualified Data.ByteString.Lazy as L
data ParseState = ParseState {
string :: L.ByteString
, offset ... | null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch18/MaybeTParse.hs | haskell | file : ch18 / MaybeTParse.hs
# LANGUAGE GeneralizedNewtypeDeriving #
module MaybeTParse
(
Parse
, evalParse
) where
import MaybeT
import Control.Monad.State
import Data.Int (Int64)
import qualified Data.ByteString.Lazy as L
data ParseState = ParseState {
string :: L.ByteString
, offset ... | |
0be268ef535fae4113025dd44df383292091ac9056f3924b4a3fff98e7d762a4 | monadbobo/ocaml-core | documented_match_statement.ml | open Core.Std
type ('input,'output) case = {
pattern : 'input list;
documentation : string;
value : 'output;
}
let map_case case ~f_pattern ~f_value =
{ case with
pattern = List.map case.pattern ~f:f_pattern;
value = f_value case.value;
}
type ('input,'output) t = {
specific_cases : ('input, unit... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/documented_match_statement.ml | ocaml | open Core.Std
type ('input,'output) case = {
pattern : 'input list;
documentation : string;
value : 'output;
}
let map_case case ~f_pattern ~f_value =
{ case with
pattern = List.map case.pattern ~f:f_pattern;
value = f_value case.value;
}
type ('input,'output) t = {
specific_cases : ('input, unit... | |
4b8e25142491ef91f014abd9daee089c8b7dcecfd8f8c19518eae3222b8ea938 | PLTools/OCanren | test008.ml | (* Old style names require type name to be called 'ground'.
But we added a renaming that forces the type name to be called 'ground'. *)
let () = print_endline "test008"
(* *)
module _ = struct
[%%distrib type 'a xxx = Cons of 'a * 'a xxx [@@deriving gt ~options:{ show; gmap }]]
end
module _ = struct
[%%distri... | null | https://raw.githubusercontent.com/PLTools/OCanren/eb62e07b7428a44da0925a7e5afc7470896f4307/regression_ppx/test008.ml | ocaml | Old style names require type name to be called 'ground'.
But we added a renaming that forces the type name to be called 'ground'.
| let () = print_endline "test008"
module _ = struct
[%%distrib type 'a xxx = Cons of 'a * 'a xxx [@@deriving gt ~options:{ show; gmap }]]
end
module _ = struct
[%%distrib
type nonrec 'a key_value =
{ name : GT.int
; v : 'a
}
[@@deriving gt ~options:{ show; gmap }]]
end
|
0998ce95e0b9be487c209add8fb10597998691c63820ed63e5c48dc0c17a71db | rmculpepper/gamble | particle-filter.rkt | Copyright ( c ) 2014
Released under the terms of the 2 - clause BSD license .
;; See the file COPYRIGHT for details.
#lang racket/base
(require racket/class
racket/match
racket/math
racket/vector
(only-in "../util/samples.rkt" [resample u:resample])
"../prob-syntax.rk... | null | https://raw.githubusercontent.com/rmculpepper/gamble/a5231e2eb3dc0721eedc63a77ee6d9333846323e/gamble/private/particles/particle-filter.rkt | racket | See the file COPYRIGHT for details.
in-particles : Particles -> (Sequenceof (Values State Real))
FIXME: add in-particles sequence syntax?
pos -> element
next-pos
initial pos
continue-with/after-pos/val
----
-> Nat
-> Real
weights : (Vectorof Real)
If update? is #f, don't store result as new state (but do up... | Copyright ( c ) 2014
Released under the terms of the 2 - clause BSD license .
#lang racket/base
(require racket/class
racket/match
racket/math
racket/vector
(only-in "../util/samples.rkt" [resample u:resample])
"../prob-syntax.rkt")
(provide (all-defined-out))
(defin... |
c76b675494cf2baeb7b88797c5558ba1bc546e0599a7497c686e5a995afd5285 | janestreet/ecaml | test_current_buffer.ml | open! Core
open! Async
open! Import
open! Current_buffer
let show () = print_s [%sexp (get () : Buffer.t)]
let show_point () = print_s [%message "" ~point:(Point.get () : Position.t)]
let%expect_test "[transient_mark_mode] is [true] in tests" =
let show () = print_s [%sexp (Customization.value transient_mark_mode :... | null | https://raw.githubusercontent.com/janestreet/ecaml/25a5a2972b3a94f5529a46363b37670a6c1de195/test/test_current_buffer.ml | ocaml | Pick a name without a leading space so that undo information is recorded.
Incorrectly using [set_values_temporarily _ _ Sync] on an Async value, we get the
wrong result
Correctly using [set_values_temporarily _ _ Async], we get a correct result.
Incorrectly using [set_value_temporarily _ _ Sync] on an Async... | open! Core
open! Async
open! Import
open! Current_buffer
let show () = print_s [%sexp (get () : Buffer.t)]
let show_point () = print_s [%message "" ~point:(Point.get () : Position.t)]
let%expect_test "[transient_mark_mode] is [true] in tests" =
let show () = print_s [%sexp (Customization.value transient_mark_mode :... |
b11391ca8d537e5a085517f0d4c1c4b6a19d2ff955eaeb07edcb531dba858bf6 | typedclojure/auto-annotation | core.clj | (ns runtime-infer-demo.core
{:lang :core.typed
:core.typed {:features #{:runtime-infer}}}
(:require [clojure.core.typed :as t]))
(defn neg
"Returns the negation of the input.
Works with strings.
eg. (neg 1) ;=> -1"
[x]
(cond
(string? x) (- (Long/parseLong x))
:else (- x)))
| null | https://raw.githubusercontent.com/typedclojure/auto-annotation/d51e489379ab0f190ed7f728db73b6ce961fdbd6/src/runtime_infer_demo/core.clj | clojure | => -1" | (ns runtime-infer-demo.core
{:lang :core.typed
:core.typed {:features #{:runtime-infer}}}
(:require [clojure.core.typed :as t]))
(defn neg
"Returns the negation of the input.
Works with strings.
[x]
(cond
(string? x) (- (Long/parseLong x))
:else (- x)))
|
95104abcc94c4341c0af6a8e73d570a9a7c6a5eb6bff6370045a85cc70963b45 | ferdinand-beyer/init | user.clj | (ns user
{:clj-kondo/config
'{:linters {:unused-namespace {:level :off}
:unused-referred-var {:level :off}
:refer-all {:level :off}}}}
(:require [clojure.repl :refer :all]
[clojure.tools.namespace.repl :as tools-ns :refer [clear refresh refresh-all]]
[init.d... | null | https://raw.githubusercontent.com/ferdinand-beyer/init/8c5a0a90f06bb57a2066d6bfd1398d31863a5dfe/dev/user.clj | clojure | (ns user
{:clj-kondo/config
'{:linters {:unused-namespace {:level :off}
:unused-referred-var {:level :off}
:refer-all {:level :off}}}}
(:require [clojure.repl :refer :all]
[clojure.tools.namespace.repl :as tools-ns :refer [clear refresh refresh-all]]
[init.d... | |
219e6c70405ef85fd46568273a064e38c31505b2bc03fe382ca8badc206cd183 | buildsome/buildsome | AsyncContext.hs | module Lib.AsyncContext
( new, AsyncContext
, spawn
) where
import Control.Concurrent.Async
import qualified Control.Exception as E
import Data.IORef
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Lib.Exception (finally, onException)
import ... | null | https://raw.githubusercontent.com/buildsome/buildsome/479b92bb74a474a5f0c3292b79202cc850bd8653/src/Lib/AsyncContext.hs | haskell | TODO: spawnUnmasked | module Lib.AsyncContext
( new, AsyncContext
, spawn
) where
import Control.Concurrent.Async
import qualified Control.Exception as E
import Data.IORef
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import Lib.Exception (finally, onException)
import ... |
6a10d68930fbc2408071f25a024e1567cf8bf548f1b01292a87ed553541b96c1 | ollef/sixty | Telescope.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE QuantifiedConstraints #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE StandaloneDeriving #
module Telescope where
import Data.Persist
import Index
import Plicity
import Protolude
import Unsafe.Coerce
data Telescope name type_ base v
= Empty !(base v)
... | null | https://raw.githubusercontent.com/ollef/sixty/2582551f3c12f84489afb961b800f0d7cfa74844/src/Telescope.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE RankNTypes # | # LANGUAGE DeriveGeneric #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE StandaloneDeriving #
module Telescope where
import Data.Persist
import Index
import Plicity
import Protolude
import Unsafe.Coerce
data Telescope name type_ base v
= Empty !(base v)
| Extend !name !(type_ v) !Plicity !(Scope (Telescope name ... |
2071ba3c00e219cb3a4a2f8214dcbd917879ea022e3098549e5b96dcf526d1b6 | ktakashi/sagittarius-scheme | mt-random.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; mt-random.scm - Mersenne Twister random
;;;
Copyright ( c ) 2010 - 2012 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; ... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/9aecac6e95589345d768e6bfcd76efb7d7a691eb/sitelib/math/mt-random.scm | scheme | coding : utf-8 ; -*-
mt-random.scm - Mersenne Twister random
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list ... | Copyright ( c ) 2010 - 2012 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!core
Scheme implementation of MT random
... |
f64fc7979ddfd9269d9e1eea71a8bb97d43e6d5c1642c430d2a3429341b8e2e6 | tweag/funflow2 | Orphans.hs | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE MultiParamTypeClasses #
module Funflow.Run.Orphans where
import Control.Exception.Safe (Exception)
import Data.CAS.ContentHashable (ContentHashable)
import Docker.API.Client (ContainerSpec, DockerClientError)
instance ContentHashable IO ContainerSpec
instance ContentHashabl... | null | https://raw.githubusercontent.com/tweag/funflow2/642cbb6a1eb3c03b31fe32d22886e4eba4b877cc/funflow/src/Funflow/Run/Orphans.hs | haskell | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE MultiParamTypeClasses #
module Funflow.Run.Orphans where
import Control.Exception.Safe (Exception)
import Data.CAS.ContentHashable (ContentHashable)
import Docker.API.Client (ContainerSpec, DockerClientError)
instance ContentHashable IO ContainerSpec
instance ContentHashabl... | |
86d6a0d1c25b85c01a6fbbc89a57d2d43c73072f09228e6ada1160c0bc42d32a | habit-lang/alb | Base.hs | # LANGUAGE FlexibleContexts , FlexibleInstances , GeneralizedNewtypeDeriving , MultiParamTypeClasses , OverloadedStrings , TypeSynonymInstances #
module Typechecker.TypeInference.Base where
import Prelude hiding ((<$>))
import Common
import Control.Monad
import Control.Monad.State
import qualified Control.Monad.Fail ... | null | https://raw.githubusercontent.com/habit-lang/alb/567d4c86194a884cc1ceeffca9663211de2d554c/src/Typechecker/TypeInference/Base.hs | haskell | --------------------------------------------------------------------------------------------------
Types and type synonyms
# SCC "u##" #
(class, member) |-> impl name
Predicates to be solved, paired with evidence variables
Predicates solved, paired with evidence variables
struct name -> (type, [(field name, type, ... | # LANGUAGE FlexibleContexts , FlexibleInstances , GeneralizedNewtypeDeriving , MultiParamTypeClasses , OverloadedStrings , TypeSynonymInstances #
module Typechecker.TypeInference.Base where
import Prelude hiding ((<$>))
import Common
import Control.Monad
import Control.Monad.State
import qualified Control.Monad.Fail ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.