_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 |
|---|---|---|---|---|---|---|---|---|
26a5ffa8bc7bc64204a1770a22cb6e67e0cfedfb20befcae5fecf8f6e90479f2 | bract/bract.core | inducer_test.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the ... | null | https://raw.githubusercontent.com/bract/bract.core/625b8738554b1e1b61bd8522397fb698fb12d3d3/test/bract/core/inducer_test.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this ... | Copyright ( c ) . All rights reserved .
(ns bract.core.inducer-test
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.test :refer :all]
[bract.core.keydef :as kdef]
[bract.core.inducer :as inducer]
[bract.core.util :as util])
(:import
[java.util.concurr... |
8a0669dd34e00099c5bf91beec12cb9803ed76e8874f4e32c88368abaee72ade | cbaggers/talk-20170313-khronos-cepl | package.lisp | package.lisp
(uiop:define-package #:talk
(:use #:cl #:cepl #:named-readtables #:vari
:rtg-math.base-maths :rtg-math.types
#:skitter.sdl2.keys #:skitter.sdl2.mouse-buttons
#:nineveh))
| null | https://raw.githubusercontent.com/cbaggers/talk-20170313-khronos-cepl/937250143c0761709805a4466f185a7772ce2da3/package.lisp | lisp | package.lisp
(uiop:define-package #:talk
(:use #:cl #:cepl #:named-readtables #:vari
:rtg-math.base-maths :rtg-math.types
#:skitter.sdl2.keys #:skitter.sdl2.mouse-buttons
#:nineveh))
| |
6be3561552dfcdc491c1f73703dd1271773b2a20e94aa90664ba500f99db40fb | snapframework/snap-server | Common.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
# OPTIONS_GHC -fno - warn - orphans #
----------------------------------------------------... | null | https://raw.githubusercontent.com/snapframework/snap-server/f9c6e00630a8a78705aceafa0ac046ae70e1310e/test/Snap/Test/Common.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------------------------... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -fno - warn - orphans #
module Snap.Test.Common where
import Control.DeepSeq (deepseq)
import Control.Exception.Lifted (SomeException (..), catch, evaluate, finally, try)
import Control.... |
642b83d9cc399302328f3e540bd96be8b7bc56e025ab9183695cbaa7cbe80c4b | softwarelanguageslab/maf | R5RS_ad_list-1.scm | ; Changes:
* removed : 1
* added : 0
* swaps : 0
* negated predicates : 1
; * swapped branches: 0
* calls to i d fun : 2
(letrec ((create-list (lambda size
(let* ((list-size (if (null? size) 10 (car size)))
(content (make-vector list-size 0))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_ad_list-1.scm | scheme | Changes:
* swapped branches: 0 | * removed : 1
* added : 0
* swaps : 0
* negated predicates : 1
* calls to i d fun : 2
(letrec ((create-list (lambda size
(let* ((list-size (if (null? size) 10 (car size)))
(content (make-vector list-size 0))
(first 0)
... |
36ace30c6c357adef80627570c9df68d6f0e9452a2e4043d6b9fee64a0a612de | jeapostrophe/opencl | MatrixTranspose.rkt | #lang racket
(require opencl/c
"../atiUtils/utils.rkt"
ffi/unsafe
ffi/cvector
ffi/unsafe/cvector)
(define setupTime -1)
(define totalKernelTime -1)
(define devices #f)
(define context #f)
(define commandQueue #f)
(define program #f)
(define kernel #f)
(define width 64)
(define heigh... | null | https://raw.githubusercontent.com/jeapostrophe/opencl/f984050b0c02beb6df186d1d531c4a92a98df1a1/tests/opencl/samples/atiSamples/MatrixTranspose/MatrixTranspose.rkt | racket | #lang racket
(require opencl/c
"../atiUtils/utils.rkt"
ffi/unsafe
ffi/cvector
ffi/unsafe/cvector)
(define setupTime -1)
(define totalKernelTime -1)
(define devices #f)
(define context #f)
(define commandQueue #f)
(define program #f)
(define kernel #f)
(define width 64)
(define heigh... | |
8a7767491b0de7c2181bbfac464be8ed5184aaece9d8262e09563ee02a94c906 | returntocorp/semgrep | token_helpers_js.mli | val is_eof : Parser_js.token -> bool
val is_comment : Parser_js.token -> bool
val token_kind_of_tok : Parser_js.token -> Parse_info.token_kind
val info_of_tok : Parser_js.token -> Parse_info.t
val visitor_info_of_tok :
(Parse_info.t -> Parse_info.t) -> Parser_js.token -> Parser_js.token
val line_of_tok : Parser_js.... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/javascript/menhir/token_helpers_js.mli | ocaml | val is_eof : Parser_js.token -> bool
val is_comment : Parser_js.token -> bool
val token_kind_of_tok : Parser_js.token -> Parse_info.token_kind
val info_of_tok : Parser_js.token -> Parse_info.t
val visitor_info_of_tok :
(Parse_info.t -> Parse_info.t) -> Parser_js.token -> Parser_js.token
val line_of_tok : Parser_js.... | |
29b64b975c9d3f478ec3231867cfd3c232418961ecb9414f8d012649df02afef | melange-re/melange | test_array_primitive.ml | external new_uninitialized_array : int -> 'a array = "" [@@bs.new "Array"]
let caml_array_sub (x : 'a array) (offset : int) (len : int) =
let result = new_uninitialized_array len in
for j = 0 to len - 1 do
result.(j) <- x.(offset+j)
done;
result
(* let rec len l = *)
(* match l with *)
(* | [] ... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/test_array_primitive.ml | ocaml | let rec len l =
match l with
| [] -> 0
let caml_array_concat (l : 'a array list) : 'a array =
let v = len l in
let result = new_uninitialized_array v in | external new_uninitialized_array : int -> 'a array = "" [@@bs.new "Array"]
let caml_array_sub (x : 'a array) (offset : int) (len : int) =
let result = new_uninitialized_array len in
for j = 0 to len - 1 do
result.(j) <- x.(offset+j)
done;
result
| x::xs - > Array.length x + len xs
let caml_ar... |
e9b3be84d87c8057488a428018501131557735cdd4d5cccad09fc767e86d7133 | tmarble/nongrata | login.clj | (ns nongrata.views.login
(:use
noir.fetch.remotes
[clojure.data.json :only [read-json json-str]]
[clojure.tools.logging :only [error info]]
[noir.core :only [defpage]]
[hiccup.core :only [html]])
(:require
[clj-http.client :as client]
[nongrata.views.common :as common]
[noir.content.... | null | https://raw.githubusercontent.com/tmarble/nongrata/42928d982486cd397f4da9b892e59812546de1cf/src/nongrata/views/login.clj | clojure | special case
:headers
"strict-transport-security" "max-age=2419200",
"connection" "close",
:body
"{\"status\":\"okay\",\"email\":\"\",\"audience\":\"localhost\",\"expires\":1336440085619,\"issuer\":\"login.persona.org\"}"} | (ns nongrata.views.login
(:use
noir.fetch.remotes
[clojure.data.json :only [read-json json-str]]
[clojure.tools.logging :only [error info]]
[noir.core :only [defpage]]
[hiccup.core :only [html]])
(:require
[clj-http.client :as client]
[nongrata.views.common :as common]
[noir.content.... |
26cbeaf860c0a8f8f8aa49ccdc03bd3f7fa7c9c3cee59126f6cadd8bbbff6ce0 | databrary/databrary | Form.hs | {-# LANGUAGE OverloadedStrings #-}
module HTTP.Form
( FormKey(..)
, FormPath
, formPathText
, FormData
, FormDatum(..)
, Form(..)
, initForm
, subForm
, subForms
) where
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import q... | null | https://raw.githubusercontent.com/databrary/databrary/685f3c625b960268f5d9b04e3d7c6146bea5afda/src/HTTP/Form.hs | haskell | # LANGUAGE OverloadedStrings #
makeHasRec ''Form ['formData, 'formPath, 'formPathBS, 'formDatum, 'formFile] | module HTTP.Form
( FormKey(..)
, FormPath
, formPathText
, FormData
, FormDatum(..)
, Form(..)
, initForm
, subForm
, subForms
) where
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import qualified Data.HashMap.Strict as HM
... |
0a5434b980d38519f69d6870a92f5daa35b5a90e1b81adfcca48715d18ee0467 | janestreet/core | digit_string_helpers.ml | open! Import
open Std_internal
open Int.Replace_polymorphic_compare
module Round = struct
type t =
| Toward_positive_infinity
| Toward_negative_infinity
[@@deriving compare, sexp_of]
end
let module_name = "Digit_string_helpers"
let int63_two = Int63.of_int 2
let int63_ten = Int63.of_int 10
let int63_twent... | null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/digit_string_helpers.ml | ocaml | Stop if we run out of characters, or if further digits cannot increase our sum.
This line prevents the divisor from growing without bound and overflowing. If
this line actually changes the divisor, then the divisor is larger than the
scale, so the sum will increase if and only if [parsed_rema... | open! Import
open Std_internal
open Int.Replace_polymorphic_compare
module Round = struct
type t =
| Toward_positive_infinity
| Toward_negative_infinity
[@@deriving compare, sexp_of]
end
let module_name = "Digit_string_helpers"
let int63_two = Int63.of_int 2
let int63_ten = Int63.of_int 10
let int63_twent... |
5c0abef91dc01dc362b8e02c24346f40ae30ef1c58c0fe66648588620ecc3fe4 | matthiasn/systems-toolbox | histogram.cljs | (ns example.histogram
"Functions for building a histogram, rendered as SVG using Reagent and React."
(:require [example.hist-calc :as m]))
(def text-default {:stroke "none" :fill "black" :style {:font-size 12}})
(def text-bold (merge text-default {:style {:font-weight :bold :font-size 12}}))
(def x-axis-label (mer... | null | https://raw.githubusercontent.com/matthiasn/systems-toolbox/6bcc44af449b4a5d4e9128cd0f2129b58619a5dc/examples/trailing-mouse-pointer/src/cljs/example/histogram.cljs | clojure | (ns example.histogram
"Functions for building a histogram, rendered as SVG using Reagent and React."
(:require [example.hist-calc :as m]))
(def text-default {:stroke "none" :fill "black" :style {:font-size 12}})
(def text-bold (merge text-default {:style {:font-weight :bold :font-size 12}}))
(def x-axis-label (mer... | |
43f452d33dea536cf589f942718ec77758ff7f880ce00d926365c03062caa3ab | exercism/scheme | test.scm | (load "test-util.ss")
(define test-cases
`((test-success "cleans the number" equal? clean
'("(223) 456-7890") "2234567890")
(test-success "cleans numbers with dots" equal? clean
'("223.456.7890") "2234567890")
(test-success "cleans numbers with multiple spaces" equal?
clean '("223 456 ... | null | https://raw.githubusercontent.com/exercism/scheme/2064dd5e5d5a03a06417d28c33c5349bec97dad7/exercises/practice/phone-number/test.scm | scheme | (load "test-util.ss")
(define test-cases
`((test-success "cleans the number" equal? clean
'("(223) 456-7890") "2234567890")
(test-success "cleans numbers with dots" equal? clean
'("223.456.7890") "2234567890")
(test-success "cleans numbers with multiple spaces" equal?
clean '("223 456 ... | |
bd71d1c9aa930d506a54065886788edb1da86626b0ecaca5dcf64dcb07a28587 | opencog/opencog | data_#1.scm | Test # 1
;; anaphor is "neuter"
;; antecedent is "feminine"
;; Expected result:
;; Rejection
Connection between two clauses
(ListLink
(AnchorNode "CurrentResolution")
(WordInstanceNode "anaphor")
(WordInstanceNode "antecedent")
)
(ListLink
(AnchorNode "CurrentPronoun")
(WordInstanceNode "ana... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/tests/nlp/anaphora/data/propose/filter-%237/data_%231.scm | scheme | anaphor is "neuter"
antecedent is "feminine"
Expected result:
Rejection
filter tests | Test # 1
Connection between two clauses
(ListLink
(AnchorNode "CurrentResolution")
(WordInstanceNode "anaphor")
(WordInstanceNode "antecedent")
)
(ListLink
(AnchorNode "CurrentPronoun")
(WordInstanceNode "anaphor")
)
(ListLink
(AnchorNode "CurrentProposal")
(WordInstanceNode "anteced... |
9df812b84426b5217a32f9093c7c5bcf5480f30807bd5b34f92a2a91877f8abd | alanz/ghc-exactprint | RuleDefiningPlugin.hs | module RuleDefiningPlugin where
import GhcPlugins
{-# RULES "unsound" forall x. show x = "SHOWED" #-}
plugin :: Plugin
plugin = defaultPlugin
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/RuleDefiningPlugin.hs | haskell | # RULES "unsound" forall x. show x = "SHOWED" # | module RuleDefiningPlugin where
import GhcPlugins
plugin :: Plugin
plugin = defaultPlugin
|
b6e65325f4b878f8f72d2318d3e701213f90b205025df1626a1d1c676e9928c9 | liebke/avout | watch_test.clj | (ns avout.test.watch-test
(:require [avout.core :as zk])
(:use [clojure.test]))
(defn count-changes
"A watch function that accepts a counter (atom) and increments it whenever
the watch is triggered."
[counter _ _ _ _]
(swap! counter inc))
(deftest atom-add-watch-test
(let [client (zk/connect "127.0.0.1"... | null | https://raw.githubusercontent.com/liebke/avout/06f3e00d63f487ebd01581343302e96b915f5b03/test/avout/test/watch_test.clj | clojure | Add a simple watch and trigger it twice:
Verify that the swap!! ops worked and the watches triggered:
Trigger the watch again, but decrement the zk-atom this time:
Verify that both atoms still have the correct values:
Test that both are active:
Remove watch-1 and verify that watch-2 is still active:
Add a simple... | (ns avout.test.watch-test
(:require [avout.core :as zk])
(:use [clojure.test]))
(defn count-changes
"A watch function that accepts a counter (atom) and increments it whenever
the watch is triggered."
[counter _ _ _ _]
(swap! counter inc))
(deftest atom-add-watch-test
(let [client (zk/connect "127.0.0.1"... |
6f60b5126ba9214603bb55567f03065e46aba47532337c5398bd6d34dbd940f7 | EduardSergeev/monad-memo | Expandable.hs | |
Module : Control . . Trans . Memo . Vector
Copyright : ( c ) 2013
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : experimental
Portability : non - portable ( multi - param classes , flexible instances )
Vector - based ` MonadCache ` implemen... | null | https://raw.githubusercontent.com/EduardSergeev/monad-memo/f941013e45c5e190ebce08935857ec10355584fd/Control/Monad/Memo/Vector/Expandable.hs | haskell | * UVectorCache for unboxed types
| Generic Vector-based memo cache
# INLINE lookup #
--------------------------
| Boxed vector
| Evaluate computation using mutable boxed vector which dynamically grows to accomodate all requested keys
| Evaluate computation using mutable boxed vector
which dynamically grows to a... | |
Module : Control . . Trans . Memo . Vector
Copyright : ( c ) 2013
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : experimental
Portability : non - portable ( multi - param classes , flexible instances )
Vector - based ` MonadCache ` implemen... |
e6b73c99ad7f99376afb603c9473b45a4d2705a6a93ebc2c2fcf4dea30f1efc4 | nikodemus/SBCL | array.pure.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This software is in the public domain and is provided with
;;;;... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/tests/array.pure.lisp | lisp | more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
Array initialization has complicated defaulting for :ELEMENT-TYPE,
and both compile-time an... | This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(in-package :cl-user)
(#\null (make-array 11 :element-type 'character) simple-string)
(#\space (make-string 11 :initial-element #... |
cd4a6555fdda6808b95a1116efbd351d24b6ddfda04ddc928cad9ca1702ccd1d | avsm/mirage-duniverse | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let speed = Conf.(key ~doc:"Build benchmarks" "benchmarks" bool ~absent:false)
let () =
Pkg.describe "psq" @@ fun c ->
let speed = Conf.value c speed in
Ok [ Pkg.mllib ~api:["Psq"] "src/psq.mllib";
Pkg.test "test/test";
Pkg.test ~cond... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/psq/pkg/pkg.ml | ocaml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let speed = Conf.(key ~doc:"Build benchmarks" "benchmarks" bool ~absent:false)
let () =
Pkg.describe "psq" @@ fun c ->
let speed = Conf.value c speed in
Ok [ Pkg.mllib ~api:["Psq"] "src/psq.mllib";
Pkg.test "test/test";
Pkg.test ~cond... | |
66e2d50eb5fd7bbe888c893d37bc85347420c4c3d730fbe88014e2abc36e0fa8 | istathar/vaultaire | ProfilerTest.hs | {-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception
import Control.Monad
import Control.Monad.Reader
import Control.Monad.Trans.State
import qualified Data.List as L
import Data.Maybe
import Network.URI
import System.ZMQ4 hidi... | null | https://raw.githubusercontent.com/istathar/vaultaire/75603ea614b125568ca871e88280bd29b3aef4ba/tests/ProfilerTest.hs | haskell | # LANGUAGE OverloadedStrings #
setup a broker for telemetry
connect to the broker for telemtrics
setup a broker so we can "send" to this testWriter daemon
start the testWriter daemon and its profiler
perform the fake "send" actions |
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception
import Control.Monad
import Control.Monad.Reader
import Control.Monad.Trans.State
import qualified Data.List as L
import Data.Maybe
import Network.URI
import System.ZMQ4 hiding (shutdown)
import qualified Syst... |
c7682e60d7e8578e7712c7db82f8c700c431fa0c8ce202e247c366f979710d01 | OCamlPro/ez_api | ezReq.ml | (**************************************************************************)
(* *)
Copyright 2018 - 2022 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/request/js/coxhr/ezReq.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2018 - 2022 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
include EzCoXhr
|
0f7f04453ec58b6d8831c023787dd39e453cedbc5d031384460fe0eeffbd386d | ideas-edu/ideas | Decoding.hs | # LANGUAGE GeneralizedNewtypeDeriving #
-----------------------------------------------------------------------------
Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are inclu... | null | https://raw.githubusercontent.com/ideas-edu/ideas/f84907f92a8c407b7313f99e65a08d2646dc1565/src/Ideas/Utils/Decoding.hs | haskell | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
|
Maintainer :
Stability : provisional
---------------------------------------------------------------------------
------------------------------------------... | # LANGUAGE GeneralizedNewtypeDeriving #
Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are included in the distribution .
Portability : portable ( depends on ghc )
Exte... |
047cb86553bea6beb4438a10930a944a4a5bdf94e480138cfae4af30798a7136 | juspay/atlas | Catalog.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/parking-bap/src/Core/OnSearch/Catalog.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
806b976af0f939354bb935717e3b1557c2a4c45ecec019c05a63ba30f52038b8 | bennn/dissertation | main.rkt | #lang typed/racket #:transient
(define-predicate nneg-flonum? Nonnegative-Flonum)
;; comment it out for no-check...
( define ( nneg - flonum ? n ) # t )
(define xxx (current-pseudo-random-generator))
(define (run-trials [trials : Natural])
(exact->inexact
(/ (for/sum : Natural
([i (in-range trials)])
(defi... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/QA/transient-expressive/2019-02-27/main.rkt | racket | comment it out for no-check... | #lang typed/racket #:transient
(define-predicate nneg-flonum? Nonnegative-Flonum)
( define ( nneg - flonum ? n ) # t )
(define xxx (current-pseudo-random-generator))
(define (run-trials [trials : Natural])
(exact->inexact
(/ (for/sum : Natural
([i (in-range trials)])
(define a (assert (random xxx) positive?... |
d9c7d8acbf93321e517d01f41b785fdca360defb49d60a0123b467aa4a57a653 | kofno/land-of-lisp | server.lisp | (require 'usocket)
(defparameter my-socket (usocket:socket-listen #(127 0 0 1) 4321))
(defparameter my-stream (usocket:socket-stream (usocket:socket-accept my-socket)))
;; The rest of the exercise is almost exactly the same as the book
;; Read from the client
(read my-stream)
;; Respond and force the buffer on the ... | null | https://raw.githubusercontent.com/kofno/land-of-lisp/18f4a614ea5f45db205c45522312761855c63c6b/chapter-12/server.lisp | lisp | The rest of the exercise is almost exactly the same as the book
Read from the client
Respond and force the buffer on the stream
Complete | (require 'usocket)
(defparameter my-socket (usocket:socket-listen #(127 0 0 1) 4321))
(defparameter my-stream (usocket:socket-stream (usocket:socket-accept my-socket)))
(read my-stream)
(print "What up, Client?" my-stream)
(force-output my-stream)
(close my-stream)
|
12e11701f751cd490fa9fe1ce89c0898aec675aa18a229411dcd9a68b90ec141 | TyGuS/hoogle_plus | Benchmark.hs | module Main (main) where
import Types.Generate
import Types.Experiments
import Types.Environment
import Types.Program
import Synquid.Util
import HooglePlus.Synthesize
import Database.Presets
import Database.Environment
import Runner
import BConfig
import BTypes hiding (name)
import BOutput
import BPlot
import Data.Ae... | null | https://raw.githubusercontent.com/TyGuS/hoogle_plus/d02a1466d98f872e78ddb2fb612cb67d4bd0ca18/benchmark/Benchmark.hs | haskell | (searchParamsTyGarQB, expTyGarQB),
(searchParamsNoGar, expNoGar) | module Main (main) where
import Types.Generate
import Types.Experiments
import Types.Environment
import Types.Program
import Synquid.Util
import HooglePlus.Synthesize
import Database.Presets
import Database.Environment
import Runner
import BConfig
import BTypes hiding (name)
import BOutput
import BPlot
import Data.Ae... |
afabfef96088ee26a12f631f62b2eda8c7d9d6e4b6017b9c4731807400592ccf | unison-code/unison | Mips.hs | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... | null | https://raw.githubusercontent.com/unison-code/unison/828a77c410a8c59e12d9144b13eba13b57045564/src/unison/src/Unison/Target/Mips.hs | haskell | | Gives the type of natural instruction according to the operation
| Gives the target of a jump instruction and the type of jump
| Gives a set of def copies and a list of sets of use copies to extend
the given temporary
Do not extend temporaries that are congruent to temporaries pre-allocated
to reserved register... | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... |
a43ece2c2df44a5aee2952b79843187ce96ff4453f13044707bab67ffdce90d8 | binghe/PCL | gcl-low.lisp | (in-package "SI")
(export '(%structure-name
%compiled-function-name
%set-compiled-function-name))
(in-package 'pcl)
(eval-when (compile eval load)
(setq *EVAL-WHEN-COMPILE* t)
)
(defmacro memq (item list) `(member ,item ,list :test #'eq))
(defmacro assq (item list) `(assoc ,item ,list :test #'eq))... | null | https://raw.githubusercontent.com/binghe/PCL/7021c061c5eef1466e563c4abb664ab468ee0d80/impl/gcl/gcl-low.lisp | lisp |
}")))
#+turbo-closure-env-size
}
}
}
This is the unsafe but fast version.
allocates-new-storage
side-effect
constantp
result type from args
int available_size;
int i;
*/
(defun structure-slotd-writer-function (slotd)
packages:
proclaims | (in-package "SI")
(export '(%structure-name
%compiled-function-name
%set-compiled-function-name))
(in-package 'pcl)
(eval-when (compile eval load)
(setq *EVAL-WHEN-COMPILE* t)
)
(defmacro memq (item list) `(member ,item ,list :test #'eq))
(defmacro assq (item list) `(assoc ,item ,list :test #'eq))... |
07409e0c3e95da92c5fb2b886cfc3b0b114ea7cd31ed4a246263b3ab6949af18 | haskell/vector | Primitive.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
-- |
-- Module : Data.Vector.Primitive
Copyright : ( c ) Roman Leshchinskiy... | null | https://raw.githubusercontent.com/haskell/vector/967159deb71d376d18179eb9d5f903bded0e8074/vector/src/Data/Vector/Primitive.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
|
Module : Data.Vector.Primitive
License : BSD-style
Stability : experimental
Portability : non-portable
recommended except in very special cases. Adaptive unboxed vectors defined
cost.
* Primitive vectors
* Accessors
** Length information
... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
Copyright : ( c ) Roman Leshchinskiy 2008 - 2010
2020 - 2022
2020 - 2022
2020 ... |
2b1b7b68b7c1110cd61d96c013fa402e32388ae9d88e65d1453fe294d92117d1 | keigoi/ocaml-mpst | monitor.ml | module M = Mutex
module C = Condition
type 'a t = ('a * M.t * C.t)
type 'a wait = WaitMore | Return of 'a
let create v = (v, M.create (), C.create ())
let wait (cell,m,c) (func: 'a -> 'b wait) : 'b =
Mutex.lock m;
let rec loop () =
begin try
match func cell with
| Return v -> v
| WaitMore... | null | https://raw.githubusercontent.com/keigoi/ocaml-mpst/aa6c5fa2b08c4596f41f70dee8601da6a9c80b8f/lib/bare/monitor.ml | ocaml | module M = Mutex
module C = Condition
type 'a t = ('a * M.t * C.t)
type 'a wait = WaitMore | Return of 'a
let create v = (v, M.create (), C.create ())
let wait (cell,m,c) (func: 'a -> 'b wait) : 'b =
Mutex.lock m;
let rec loop () =
begin try
match func cell with
| Return v -> v
| WaitMore... | |
cee39c1817b1b2cbdf76bef907ed7d41e08e3888235779712b0f30fa68e66df1 | day8/re-frame-10x | re_com.clj | (ns day8.re-frame-10x.components.re-com)
There is a trap when writing DOM event handlers . This looks innocent enough :
;;
;; :on-mouse-out #(reset! my-over-atom false)
;;
;; But notice that it inadvertently returns false. returning false means something!!
;; v0.11 of ReactJS will invoke both stopPropagatio... | null | https://raw.githubusercontent.com/day8/re-frame-10x/dad02ff85793119f6ccfeeb9df328cfe91ec6354/src/day8/re_frame_10x/components/re_com.clj | clojure |
:on-mouse-out #(reset! my-over-atom false)
But notice that it inadvertently returns false. returning false means something!!
v0.11 of ReactJS will invoke both stopPropagation() and preventDefault()
on the event. Almost certainly not what we want.
deprecation warning about false returns.
Note: ReactJS ... | (ns day8.re-frame-10x.components.re-com)
There is a trap when writing DOM event handlers . This looks innocent enough :
Note : v0.12 of ReactJS will do the same as v0.11 , except it also issues a
(defmacro handler-fn
([& body]
|
8855e7bffdba0ee4e59e14e8dfe60ed5d65d3685c9d8dcdcbdeefbe73218633c | liqd/aula | AcidState.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE ImpredicativeTypes #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Tup... | null | https://raw.githubusercontent.com/liqd/aula/f96dbf85cd80d0b445e7d198c9b2866bed9c4e3d/src/Persistent/Implementation/AcidState.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
{-# OPTIONS_GHC -Wall -Werror -fno-warn-orphans #-} | # LANGUAGE ImpredicativeTypes #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Persistent.Implementation.AcidState
( mkRunPersistOnDisk
, mkRunPersistInMemory
, mkRunPersistInMemoryWithState
, AcidState
... |
d24cb7bae97bd0c7f246b0f9a084444d0eae6a24278ed1062ce6b929b0b1aa70 | sionescu/iolib | pkgdcl.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Package definition.
;;;
(in-package :iolib/common-lisp-user)
(defpackage :iolib/pathnames
(:nicknames :ipath :iolib.pathnames)
(:use :iolib/base)
(:export
;; Classes and types
#:file-path #:file-path-designator
#+unix #:unix-path
#+window... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/pathnames/pkgdcl.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Package definition.
Classes and types
Constructors
Named reader
Predicates
Conditions
Constants
Specials |
(in-package :iolib/common-lisp-user)
(defpackage :iolib/pathnames
(:nicknames :ipath :iolib.pathnames)
(:use :iolib/base)
(:export
#:file-path #:file-path-designator
#+unix #:unix-path
#+windows #:unc-path
Accessors
#:file-path-host
#:file-path-device
#:file-path-components
#:file-pat... |
c9cc5ae3f2035c4145b970fcba8cbcbce7856af5116d853842bcdd0e2f495f04 | vimus/vimus | KeySpec.hs | module Vimus.KeySpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Vimus.Key
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "expandKeys" $ do
it "expands a single <cr>" $ do
expandKeys "<cr>" `shouldBe` Right "\n"
it "expands a si... | null | https://raw.githubusercontent.com/vimus/vimus/26a164fb50870f8112ca4b6c30820431c015916f/test/Vimus/KeySpec.hs | haskell | module Vimus.KeySpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Vimus.Key
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "expandKeys" $ do
it "expands a single <cr>" $ do
expandKeys "<cr>" `shouldBe` Right "\n"
it "expands a si... | |
3474ea246ca2811b4e9f95d98939b3e430b8c31587db297572e17b97ca41399e | philnguyen/soft-contract | sanity-test.rkt | #lang typed/racket/base
(require racket/match
racket/set
racket/file
racket/string
racket/bool
typed/rackunit
set-extras
"../utils/main.rkt"
"../runtime/signatures.rkt"
"../main.rkt")
(define TIMEOUT 2000)
HACK to avoid passing around... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/13e7d99e061509f0a45605508dd1a27a51f4648e/soft-contract/test/sanity-test.rkt | racket | can't use `time-apply`
(test "safe/issues/issue-103.rkt" check-safe)
(test "unsafe/issues/issue-103.rkt" check-fail)
Mochi
(test "safe/mochi/fhnhn.rkt" check-safe)
(test "safe/mochi/intro2.rkt" check-safe)
(test "safe/mochi/intro3.rkt" check-safe)
(test "safe/mochi/l-zipmap.rkt" check-safe)
(test "safe/mochi/l-zipunz... | #lang typed/racket/base
(require racket/match
racket/set
racket/file
racket/string
racket/bool
typed/rackunit
set-extras
"../utils/main.rkt"
"../runtime/signatures.rkt"
"../main.rkt")
(define TIMEOUT 2000)
HACK to avoid passing around... |
1b3b6319d957a55910d79adce8e1fb6f93ec0d1a252f74fea1cfaaaa7040633c | serokell/universum | Main.hs | module Main
( main
) where
import Universum hiding (show)
import Data.List (nub, zip5)
import qualified Data.Text as T
import Gauge (Benchmark, bench, bgroup, nf, whnf)
import Gauge.Main (defaultMain)
import Prelude (show)
import qualified Data.Foldable as Foldable (elem)
import qualified Data.HashSet as HashSet... | null | https://raw.githubusercontent.com/serokell/universum/1f840f082e9bd2b89967adaf630a607aefe95a51/benchmark/Main.hs | haskell | | Checks that 'foldl'' is implemented efficiently for 'Universum.List'
With @toText . toString -> id@ rewrite rules we expect ~10ns
Without the rules: >10ms | module Main
( main
) where
import Universum hiding (show)
import Data.List (nub, zip5)
import qualified Data.Text as T
import Gauge (Benchmark, bench, bgroup, nf, whnf)
import Gauge.Main (defaultMain)
import Prelude (show)
import qualified Data.Foldable as Foldable (elem)
import qualified Data.HashSet as HashSet... |
3cf27c8e8412291ca30c338df986f62977d1b975eea450c06a81994644609443 | broom-lang/broom | FcTypeSigs.ml | module Tx = Transactional
module type TYPE = sig
The level of a type variable is the number of skolem - binding scopes in the
typing environment at its creation site . Kind of like syntactic closures , but
type inference is ( scoping - wise ) much simpler than hygienic macroexpansion so
th... | null | https://raw.githubusercontent.com/broom-lang/broom/3369a1f4493fa66118842bf6bcf54cb689a17966/compiler/lib/Fc/FcTypeSigs.ml | ocaml | module Tx = Transactional
module type TYPE = sig
The level of a type variable is the number of skolem - binding scopes in the
typing environment at its creation site . Kind of like syntactic closures , but
type inference is ( scoping - wise ) much simpler than hygienic macroexpansion so
th... | |
b38a91dab9448b6a9aaa71d1bd92bea2fc50774b3e5cba746c28129b75bef186 | Plutonomicon/plutarch-plutus | Evaluate.hs | {-# LANGUAGE ImpredicativeTypes #-}
module Plutarch.Evaluate (
E.evalScript,
E.evalScriptHuge,
E.evalScript',
E.EvalError,
evalTerm,
) where
import Plutarch.Internal.Evaluate qualified as E
import Data.Text (Text)
import Plutarch.Internal (ClosedTerm, Config, RawTerm (RCompiled), Term (..), TermResult (Ter... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/Plutarch/Evaluate.hs | haskell | # LANGUAGE ImpredicativeTypes #
| Compile and evaluate term. |
module Plutarch.Evaluate (
E.evalScript,
E.evalScriptHuge,
E.evalScript',
E.EvalError,
evalTerm,
) where
import Plutarch.Internal.Evaluate qualified as E
import Data.Text (Text)
import Plutarch.Internal (ClosedTerm, Config, RawTerm (RCompiled), Term (..), TermResult (TermResult), compile)
import Plutarch.S... |
b40f5e6902c316404d7e7df562e9a25cfede42a77580d5cc542a7d94420ae786 | hbr/albatross | term_builder.ml | Copyright ( C ) < helmut dot brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as publ... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/alba1/term_builder.ml | ocaml |
context: locs + fgs
builder: space locs + globs space + space fgs
The builder has enough space to accomodate all untyped variables and formal
generics of the inner contexts and all global type variables imported from
global generic functions, needed for arguments of lambda express... | Copyright ( C ) < helmut dot brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as publ... |
5ea101453e94c8c1eaa92d47db56075f64edbd8b3892f3dd163381049ffdd9bd | rrnewton/haskell-lockfree | ChaseLev2.hs | # LANGUAGE FlexibleInstances , NamedFieldPuns , CPP #
-- | Chase-Lev work stealing Deques
--
This implementation derives directly from the pseudocode in the 2005 SPAA paper :
--
--
--
module Data.Concurrent.Deque.ChaseLev2
(
-- The convention here is to directly provide the concrete
-- operations as we... | null | https://raw.githubusercontent.com/rrnewton/haskell-lockfree/87122157cbbc96954fcc575b4b110003d3e5c2f8/chaselev-deque/Data/Concurrent/Deque/ChaseLev2.hs | haskell | | Chase-Lev work stealing Deques
The convention here is to directly provide the concrete
operations as well as providing the class instances.
------------------------------------------------------------------------------
Instances
-----------------------------------------------------------------------------... | # LANGUAGE FlexibleInstances , NamedFieldPuns , CPP #
This implementation derives directly from the pseudocode in the 2005 SPAA paper :
module Data.Concurrent.Deque.ChaseLev2
(
ChaseLevDeque(), newQ, nullQ, pushL, tryPopL, tryPopR
)
where
import Data.IORef
import qualified Data.Concurrent.Deque.Class as PC... |
8ac109d82c38baa17302f7ab8bcf34521937a7be7b9bb0e440f13266cd21e940 | JunSuzukiJapan/cl-reex | with-observable.lisp | (in-package :cl-user)
(defpackage cl-reex.macro
(:use :cl)
(:import-from :cl-reex.observable
:subscribe
:observable
:dispose
:observable-from)
(:import-from :cl-reex.observer
:observer
:make-observer
:on-next
:on-error
:on-completed)
(:impo... | null | https://raw.githubusercontent.com/JunSuzukiJapan/cl-reex/94928c7949c235b41902138d9e4a5654b92d67eb/src/macro/with-observable.lisp | lisp | (null body)
not (null body)
Subscribe
Dispose
otherwise
| (in-package :cl-user)
(defpackage cl-reex.macro
(:use :cl)
(:import-from :cl-reex.observable
:subscribe
:observable
:dispose
:observable-from)
(:import-from :cl-reex.observer
:observer
:make-observer
:on-next
:on-error
:on-completed)
(:impo... |
8e833e97bbc964a161531bab52affdbe17cd4999e63f5bcc30cd9e4ecdddcb14 | tkvogt/judy-graph-db | Enum.hs | # LANGUAGE OverloadedStrings , FlexibleContexts , DeriveGeneric , DeriveAnyClass , Strict ,
StrictData , MultiParamTypeClasses , FlexibleInstances , InstanceSigs #
StrictData, MultiParamTypeClasses, FlexibleInstances, InstanceSigs #-}
|
Module : JudyGraph . : ( C ) 2018
License : ... | null | https://raw.githubusercontent.com/tkvogt/judy-graph-db/f7dc90236b6479f6040805d46e2803818f192469/src/JudyGraph/Enum.hs | haskell | * Construction
* Extraction
* Deletion
* Query
* Handling Labels
* Displaying in hex for debugging
| The edges are enumerated, because sometimes the edge attrs are not continuous
^ A nonempty list with an attr for every range
and assigning which edgelabels are valid in each range
labels. The purpose of the ... | # LANGUAGE OverloadedStrings , FlexibleContexts , DeriveGeneric , DeriveAnyClass , Strict ,
StrictData , MultiParamTypeClasses , FlexibleInstances , InstanceSigs #
StrictData, MultiParamTypeClasses, FlexibleInstances, InstanceSigs #-}
|
Module : JudyGraph . : ( C ) 2018
License : ... |
dfc66ec76e7924491ce81e4dc83f3bf93298540d01cfd1c2c540a39b45bcd847 | dmitryvk/sbcl-win32-threads | full-eval.impure.lisp | ;;;; various tests of the interpreter
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This software is in the ... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/tests/full-eval.impure.lisp | lisp | various tests of the interpreter
more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
defstruct constructor
Prior to 1.0.25, the interpreter ch... |
This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
#-sb-eval
(sb-ext:quit :unix-status 104)
(setf sb-ext:*evaluator-mode* :interpret)
(assert (not (typep (lambda ()) 'compiled-function)))
(assert (not (compiled-func... |
97d222f178cc1885f3fd2a46e374cfa6769a56d230528625c85c4d89acd19bfe | SquidDev/illuaminate | on_notification.ml | open Lsp
module D = IlluaminateData
let src = Logs.Src.create ~doc:"Notification handler" __MODULE__
module Log = (val Logs.src_log src)
let send_diagnostics client store ?version doc =
let diagnostics = Lint.diagnostics store doc in
client.Store.notify (PublishDiagnostics { uri = Uri.to_string doc.uri; version;... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/7a6e4bf56f01e81a47c743cb452791c2168ccbda/src/bin/lsp/on_notification.ml | ocaml | TODO: Implement.
Whole bunch of notifications we can ignore. | open Lsp
module D = IlluaminateData
let src = Logs.Src.create ~doc:"Notification handler" __MODULE__
module Log = (val Logs.src_log src)
let send_diagnostics client store ?version doc =
let diagnostics = Lint.diagnostics store doc in
client.Store.notify (PublishDiagnostics { uri = Uri.to_string doc.uri; version;... |
cf877c78378b67fffa74300dd87d6efa407aac4fc41031e2040573906f3187cf | jesperes/aoc_erlang | aoc2021_day09.erl | -module(aoc2021_day09).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 9,
name = ... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/cc2eddaea35a47c1e3cae931a9c16f24b7e8f785/src/2021/aoc2021_day09.erl | erlang | integer().
Helpers | -module(aoc2021_day09).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-include_lib("eunit/include/eunit.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2021,
day = 9,
name = ... |
9bd6ace3b4b5e27042f11943af6328c6172482d0a5f4ea9ee4e898013f6740be | michaelballantyne/syntax-spec | statechart-temp.rkt | #lang racket
(define-statechart temp
(data C #f)
(data F #f)
(state active
(on (celcius val)
(set C val)
(set F (+ (* val (/ 9 5)) 32))
(on (farenheit val)
(set C (* (- val 32) (/ 5 9)))
(set F val))))) | null | https://raw.githubusercontent.com/michaelballantyne/syntax-spec/26d665ebd14910678cf83981ff57c1e1031fef2a/design/statechart-examples/statechart-temp.rkt | racket | #lang racket
(define-statechart temp
(data C #f)
(data F #f)
(state active
(on (celcius val)
(set C val)
(set F (+ (* val (/ 9 5)) 32))
(on (farenheit val)
(set C (* (- val 32) (/ 5 9)))
(set F val))))) | |
4df4a94f80744a3e82ac77a3f0799529dac790e54af7909341395c551946dc97 | synduce/Synduce | smallest_diff.ml | * @synduce -s 2 -NB
type clist =
| Elt of int
| Cons of int * clist
let rec is_sorted = function
| Elt x -> true
| Cons (hd, tl) -> aux hd tl
and aux prev = function
| Elt x -> prev >= x
| Cons (hd, tl) -> prev >= hd && aux hd tl
;;
(* Reference function : quadratic time. *)
let rec ldiff = function
|... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/sortedlist/smallest_diff.ml | ocaml | Reference function : quadratic time. | * @synduce -s 2 -NB
type clist =
| Elt of int
| Cons of int * clist
let rec is_sorted = function
| Elt x -> true
| Cons (hd, tl) -> aux hd tl
and aux prev = function
| Elt x -> prev >= x
| Cons (hd, tl) -> prev >= hd && aux hd tl
;;
let rec ldiff = function
| Elt x -> 0, x
| Cons (hd, tl) ->
let... |
5763fa99df3586a0823dc4ec2c0ff7c1ed09d2d4afc3089e79f43267750439e2 | triffon/fp-2022-23 | 09-fibonacci.rkt | #lang racket
(require "00-stream.rkt")
(define (fibonacci-helper curr next)
(cons-stream curr (fibonacci-helper next (+ curr next))))
(define fibonacci (fibonacci-helper 1 1)) | null | https://raw.githubusercontent.com/triffon/fp-2022-23/22826e457f2d1add264aa1f02ebb9e796712d5b6/exercises/inf2/09/scheme/09-fibonacci.rkt | racket | #lang racket
(require "00-stream.rkt")
(define (fibonacci-helper curr next)
(cons-stream curr (fibonacci-helper next (+ curr next))))
(define fibonacci (fibonacci-helper 1 1)) | |
bc28277826617d4ff9b8b42b6e3c8511b0639d7e7a08055357b5aa9d9885a388 | binaryage/cljs-oops | schema.cljs | (ns oops.schema
"The code for runtime conversion of selectors to paths. Note: we prefer hand-written loops for performance reasons."
(:require-macros [oops.schema]
[oops.helpers :refer [unchecked-aget]]
[oops.debug :refer [debug-assert]]
[oops.constants :refe... | null | https://raw.githubusercontent.com/binaryage/cljs-oops/a2b48d59047c28decb0d6334e2debbf21848e29c/src/lib/oops/schema.cljs | clojure | implementation here should mimic static versions in schema.clj
--- path utils ------------------------------------------------------------------------------------------------------------
note: items is either a seq or nil
transfer modifier
remove standalone item
-2 because it makes no sense to potentially merge l... | (ns oops.schema
"The code for runtime conversion of selectors to paths. Note: we prefer hand-written loops for performance reasons."
(:require-macros [oops.schema]
[oops.helpers :refer [unchecked-aget]]
[oops.debug :refer [debug-assert]]
[oops.constants :refe... |
07ccac11053ea0d5c3e1fd78e4c1127130c890d0d7c1d791e97f7ffb2209e64f | Carnap/Carnap | QualitativeProblem.hs | # LANGUAGE FlexibleContexts , RankNTypes #
module Carnap.GHCJS.Action.QualitativeProblem (qualitativeProblemAction) where
import Lib
import Carnap.GHCJS.SharedFunctions (simpleHash, simpleDecipher)
import Carnap.GHCJS.SharedTypes
import GHCJS.DOM.HTMLTextAreaElement as T (setValue, getValue)
import GHCJS.DOM.HTMLInpu... | null | https://raw.githubusercontent.com/Carnap/Carnap/99546e377008247c5a1e8de1e294aac8e22584d7/Carnap-GHCJS/src/Carnap/GHCJS/Action/QualitativeProblem.hs | haskell | # LANGUAGE FlexibleContexts , RankNTypes #
module Carnap.GHCJS.Action.QualitativeProblem (qualitativeProblemAction) where
import Lib
import Carnap.GHCJS.SharedFunctions (simpleHash, simpleDecipher)
import Carnap.GHCJS.SharedTypes
import GHCJS.DOM.HTMLTextAreaElement as T (setValue, getValue)
import GHCJS.DOM.HTMLInpu... | |
89c3df32a984e5930ed639c4103f07258a2e3dc9c121b43f33f8d8cc7806a3e9 | finnishtransportagency/harja | turvallisuusraportti_test.clj | (ns harja.palvelin.raportointi.turvallisuusraportti-test
(:require [clojure.test :refer :all]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.toimenpidekoodit :refer :all]
[harja.palvelin.palvelut.urakat :refer :all]
[harja.testi :refer :... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/c57d742beaff2bef7b30318819f07d4a13423404/test/clj/harja/palvelin/raportointi/turvallisuusraportti_test.clj | clojure | (ns harja.palvelin.raportointi.turvallisuusraportti-test
(:require [clojure.test :refer :all]
[harja.palvelin.komponentit.tietokanta :as tietokanta]
[harja.palvelin.palvelut.toimenpidekoodit :refer :all]
[harja.palvelin.palvelut.urakat :refer :all]
[harja.testi :refer :... | |
ca87845aceebbb4d16c58ea38b6947a74ec8745c466a194f8511c8b775ce9451 | MariaGrozdeva/Functional_programming | symmetric.rkt | #lang racket/base
(define (reverse tree)
(if (null? tree)
null
(list (car tree) (reverse (caddr tree)) (reverse (cadr tree))) )
)
(define (symmetric? tree)
(define (symmetric-helper tree-left tree-right)
(if (and (null? tree-left) (null? tree-right))
#t
(if (or (and (null? tree-l... | null | https://raw.githubusercontent.com/MariaGrozdeva/Functional_programming/002e3dbbbc64558094eecd147cb1fd064ee84a03/Tasks%20on%20binary%20trees/symmetric.rkt | racket | #lang racket/base
(define (reverse tree)
(if (null? tree)
null
(list (car tree) (reverse (caddr tree)) (reverse (cadr tree))) )
)
(define (symmetric? tree)
(define (symmetric-helper tree-left tree-right)
(if (and (null? tree-left) (null? tree-right))
#t
(if (or (and (null? tree-l... | |
6037ee4caba2c7ba854c781c98266f73675a87a59c8705b19bcb1e842a34b951 | mhjort/d-fold | sqs.clj | (ns d-fold.sqs
(:require [cheshire.core :refer [generate-string parse-string]])
(:import [com.amazonaws.regions Regions]
[com.amazonaws.services.sqs AmazonSQSClient]
[com.amazonaws.services.sqs.model ReceiveMessageRequest]))
(defn- sqs-client [region]
(-> (AmazonSQSClient.)
(.withRegi... | null | https://raw.githubusercontent.com/mhjort/d-fold/d6e9fd92f2a00c29005d7085580fe7dd7707fb45/src/d_fold/sqs.clj | clojure | (ns d-fold.sqs
(:require [cheshire.core :refer [generate-string parse-string]])
(:import [com.amazonaws.regions Regions]
[com.amazonaws.services.sqs AmazonSQSClient]
[com.amazonaws.services.sqs.model ReceiveMessageRequest]))
(defn- sqs-client [region]
(-> (AmazonSQSClient.)
(.withRegi... | |
d9600abc317f78b41124fbebb45bdd428adb3c0270121643b447f07d83e203be | may-liu/qtalk | http_getusers.erl | -module(http_getusers).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("ejb_http_server.hrl").
-include("logger.hrl").
-include("http_req.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
{Method, _} = cowboy_req:method(Req),
catch ejb_monitor:monitor_co... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/scripts/ejb_http_server/src/http_getusers.erl | erlang | http_utils:gen_result(false, <<"-1">>, <<"Not found Mac_Key">>) | -module(http_getusers).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("ejb_http_server.hrl").
-include("logger.hrl").
-include("http_req.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
{Method, _} = cowboy_req:method(Req),
catch ejb_monitor:monitor_co... |
838ef91fb5c2d75cf01bce7c462eaebfe9d02045f489c23e469dba876784cea5 | vikram/lisplibraries | init-session.lisp |
(in-package :{APPNAME})
;; Define callback function to initialize new sessions
(defun init-user-session (comp)
(setf (composite-widgets comp)
(list (lambda (&rest args)
(with-html
(:strong "Happy Hacking!"))))))
| null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/scripts/new-app-templates/init-session.lisp | lisp | Define callback function to initialize new sessions |
(in-package :{APPNAME})
(defun init-user-session (comp)
(setf (composite-widgets comp)
(list (lambda (&rest args)
(with-html
(:strong "Happy Hacking!"))))))
|
5b519ed0d8597e8ca5041580797d1d79e105e8b2a3b96644c1113e9d1fff6878 | smimram/funk | funk.ml | funk.ml [ part of the funk project ]
[ functional kernel , contents : funk functions general module
* copyright : ( C ) 2005 by ,
* email : ,
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/smimram/funk/88328dd9087c9097b1bfe2cf5394ba99fa631934/src/kernel/mk/funk.ml | ocaml | * process context
* ports input/output functions
* Generate an interrupt.
* usleep
early_kprintf will be set to Filecmds.cat_to_append "dmesg_file"
* Print a kernel message. | funk.ml [ part of the funk project ]
[ functional kernel , contents : funk functions general module
* copyright : ( C ) 2005 by ,
* email : ,
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... |
4d33138aba865c18e81ca676e127a07d07152079d0f1f14d6ab363bf35d9b018 | janestreet/hardcaml_of_verilog | verilog_circuit.ml | open Base
module Bus = Netlist.Bus
module Cell = Netlist.Cell
module Port = Netlist.Port
type t =
{ module_name : string
; inputs : int Port.t list
; outputs : int Port.t list
; create_fn :
(Hardcaml.Signal.t Port.t list -> Hardcaml.Signal.t Port.t list Or_error.t
[@sexp.opaque])
}
[@@deriving s... | null | https://raw.githubusercontent.com/janestreet/hardcaml_of_verilog/55da975d4a861418fedd405d7b54973dd56bda77/src/verilog_circuit.ml | ocaml | Create the inputs and outputs of each cell from the bus map. Filter completely empty
ports.
Attach cell outputs to their wires
Add circuit inputs and cell outputs to a map of signal drivers.
Create instantiations for all cells, connecting inputs and outputs | open Base
module Bus = Netlist.Bus
module Cell = Netlist.Cell
module Port = Netlist.Port
type t =
{ module_name : string
; inputs : int Port.t list
; outputs : int Port.t list
; create_fn :
(Hardcaml.Signal.t Port.t list -> Hardcaml.Signal.t Port.t list Or_error.t
[@sexp.opaque])
}
[@@deriving s... |
9a4c67af59532451515ca50aac73757c84efcaa24ff85c69b47344ff2b52da0c | janestreet/async_rpc_kernel | rpc_shapes.ml | module Stable = struct
open! Core.Core_stable
We ca n't make [ Bin_prot . Shape.t ] binable directly because that would introduce a
circular dependency , so we make it [ Binable . Of_sexpable_with_uuid ] here instead . This
allows us to send the shape over the wire as part of the
[ Versioned_r... | null | https://raw.githubusercontent.com/janestreet/async_rpc_kernel/a50a1f82f5e9b013809dc480b80c860896bfc0e6/src/rpc_shapes.ml | ocaml | An unstable sexper that's useful for expect tests, printing out the shape digests
instead of the shapes themselves. | module Stable = struct
open! Core.Core_stable
We ca n't make [ Bin_prot . Shape.t ] binable directly because that would introduce a
circular dependency , so we make it [ Binable . Of_sexpable_with_uuid ] here instead . This
allows us to send the shape over the wire as part of the
[ Versioned_r... |
1173158926a7c22c0f7db3c2b7ea063ca98c307b1dcfd5241f3019f9cfa9a9c9 | RichiH/git-annex | GCryptSetup.hs | git - annex command
-
- Copyright 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.GCryptSetup where
import Command
import Annex.UUID
import qualified Remote.GCrypt
import qualif... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Command/GCryptSetup.hs | haskell | git - annex command
-
- Copyright 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.GCryptSetup where
import Command
import Annex.UUID
import qualified Remote.GCrypt
import qualif... | |
9c44b900d2c3acd76cd4ae6283f43091caa4b2c03b3a52e0e02b2f7b4f240a9b | bdeket/rktsicm | kernel-intr.rkt | #lang racket/base
(require "kernel/deriv.rkt"
"kernel/diff.rkt"
"kernel/express.rkt"
(only-in "kernel/extapply.rkt"
with-literal-apply-enabled
with-literal-reconstruction-enabled
with-self-evaluating-unbound-variables)
"kernel/fu... | null | https://raw.githubusercontent.com/bdeket/rktsicm/d30bdf7b13619f72adab46c0bc617a4ae4bf2141/rktsicm/sicm/kernel-intr.rkt | racket | #lang racket/base
(require "kernel/deriv.rkt"
"kernel/diff.rkt"
"kernel/express.rkt"
(only-in "kernel/extapply.rkt"
with-literal-apply-enabled
with-literal-reconstruction-enabled
with-self-evaluating-unbound-variables)
"kernel/fu... | |
2857da84f0ad69e8d6ef50817b765564a3cc22d42258b114b2f6023a107507f9 | jeromesimeon/Galax | stream_analysis_builtin.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/streaming_xpath/stream_analysis_builtin.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : stream_analysis_builtin.mli , v 1.2 2007/02/01 22:08:54 simeon Exp $
Module : Stream_analysis_builtin
Description :
This module encapsulates judgements for deciding wether a call to
a builtin function is fatal for... |
8878748e9b2064f659c5771d9282c0647f0366161d081f33e40149cbab0031a4 | thelema/ocaml-community | frx_synth.mli | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of OCaml
(* *)
, , and ... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/frx/frx_synth.mli | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of OCaml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
e72357796ed9524637b81f4efac1f0628b8bf698da1424cd667eaba5105095f8 | haskus/packages | Solver.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TupleSections #
module Haskus.Tests.Utils.Solver
( testsSolver
)
where
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Data.List
import qualifi... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-utils/src/tests/Haskus/Tests/Utils/Solver.hs | haskell | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TupleSections #
module Haskus.Tests.Utils.Solver
( testsSolver
)
where
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Data.List
import qualifi... | |
414617117f438834a0bb835218d6826f580808e4a12718adf9701e5a26bb7cd6 | mbj/mhs | TraceHeader.hs | module Test.TraceHeader (testTree) where
import Control.Monad
import Test.Tasty
import Test.Tasty.HUnit
import XRay.Prelude
import XRay.Segment
import XRay.TraceHeader
import XRay.TraceId
testTree :: TestTree
testTree = testGroup "TraceHeader" $
pure $ testGroup "parsing"
[ testCase "parses from expected strings"... | null | https://raw.githubusercontent.com/mbj/mhs/e19bb8429a8a864b5eb435f82c35d8616279c999/xray/test/Test/TraceHeader.hs | haskell | Different order
Extra field
Duplicate invalid field Sampled
Duplicate invalid field Parent
Duplicate invalid field Root | module Test.TraceHeader (testTree) where
import Control.Monad
import Test.Tasty
import Test.Tasty.HUnit
import XRay.Prelude
import XRay.Segment
import XRay.TraceHeader
import XRay.TraceId
testTree :: TestTree
testTree = testGroup "TraceHeader" $
pure $ testGroup "parsing"
[ testCase "parses from expected strings"... |
4c7b84b86ecebea29f0017be4753818148e982a42d76d5a7cb4c5671757050d6 | sjl/sand | profiling.lisp | (in-package :sand.profiling)
#+sbcl
(defun dump-profile ()
(with-open-file (*standard-output* "sand.prof"
:direction :output
:if-exists :supersede)
(sb-sprof:report :type :graph
:sort-by :cumulative-samples
... | null | https://raw.githubusercontent.com/sjl/sand/fc0cb77fd8eefec8d29d69a1eca36f599101b890/src/profiling.lisp | lisp | (sb-sprof::profile-call-counts "SILT")
:mode :time | (in-package :sand.profiling)
#+sbcl
(defun dump-profile ()
(with-open-file (*standard-output* "sand.prof"
:direction :output
:if-exists :supersede)
(sb-sprof:report :type :graph
:sort-by :cumulative-samples
... |
95ac879aa7453a535d6a0c59c234e1d22b55536a9f171da6312eaf91df8e3040 | deadpendency/deadpendency | GenerateDependencyReportBackend.hs | module RG.Effect.GenerateReport.Backend.GenerateDependencyReportBackend
( toMaybePass,
toMaybeWarning,
toMaybeFailure,
toIgnoreReport,
)
where
import Common.Model.Assessment.DependencyAssessment
import Common.Model.Assessment.DependencyAssessmentResult
import Common.Model.Dependency.DependencyIdentifie... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/report-generator/src/RG/Effect/GenerateReport/Backend/GenerateDependencyReportBackend.hs | haskell | module RG.Effect.GenerateReport.Backend.GenerateDependencyReportBackend
( toMaybePass,
toMaybeWarning,
toMaybeFailure,
toIgnoreReport,
)
where
import Common.Model.Assessment.DependencyAssessment
import Common.Model.Assessment.DependencyAssessmentResult
import Common.Model.Dependency.DependencyIdentifie... | |
32ef689294441fbc652554d0543bdb9e2465772bc9ef6b69d7b7c7fd8dc097d8 | Workiva/eva | local_simulation.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/core/src/eva/v2/messaging/node/local_simulation.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.v2.messaging.node.local-simulation
"This messaging implementation was forked from
the local messaging node to provide a less
restricted more-nondeterministic broker."
(:require [eva.v2.system.p... |
4ff79b96c239f11515be1cd2dcb18721c072ff10c8822ae597dffdf79e4230b2 | nedap/formatting-stack | indent_specs.clj | (ns unit.formatting-stack.indent-specs
(:require
[clojure.test :refer [deftest is testing]]
[formatting-stack.formatters.cljfmt.impl :as cljfmt.impl]
[formatting-stack.indent-specs :as sut]
[formatting-stack.processors.cider :as processors.cider]
[formatting-stack.protocols.processor :refer [process!]]... | null | https://raw.githubusercontent.com/nedap/formatting-stack/c43e74d5409e9338f208457bb8928ce437381a3f/test/unit/formatting_stack/indent_specs.clj | clojure | (ns unit.formatting-stack.indent-specs
(:require
[clojure.test :refer [deftest is testing]]
[formatting-stack.formatters.cljfmt.impl :as cljfmt.impl]
[formatting-stack.indent-specs :as sut]
[formatting-stack.processors.cider :as processors.cider]
[formatting-stack.protocols.processor :refer [process!]]... | |
1d5683aa05eab7efc8279410ade01bf7445dea46345a38669c39316f39ad9439 | vzaramel/whatsappweb-clj | utils.clj | (ns whatsapp.codec.utils
(:use [gloss.core.protocols])
(:require [gloss.core.formats :as gf]
[slingshot.slingshot :refer [throw+]]))
(defn take-n [n codec buf-seq]
(loop [bytes (gf/to-buf-seq buf-seq), vals [] n n]
(if (or (= 0 n) (empty? bytes))
[true vals bytes]
(let [[success v b]... | null | https://raw.githubusercontent.com/vzaramel/whatsappweb-clj/c7919b79914e2eaa41973efd15810fb6ca417c61/src/clj/whatsapp/codec/utils.clj | clojure | (ns whatsapp.codec.utils
(:use [gloss.core.protocols])
(:require [gloss.core.formats :as gf]
[slingshot.slingshot :refer [throw+]]))
(defn take-n [n codec buf-seq]
(loop [bytes (gf/to-buf-seq buf-seq), vals [] n n]
(if (or (= 0 n) (empty? bytes))
[true vals bytes]
(let [[success v b]... | |
acc4f885363e04de91f09e8958f39b17e3d93707dca21547f0b33cb92424413e | sarabander/p2pu-sicp | 2.88.scm |
;; Negation and subtraction are added to generic-arithmetic/polynomials.scm:
Negates all terms
(define (negate-termlist termlist)
(if (empty? termlist)
empty
(let ((negator (if (list? (car termlist))
(λ (elem) (list (car elem) (- (cadr elem))))
-)))
(map negator termlist))))
(put 'neg '(poly... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.5/2.88.scm | scheme | Negation and subtraction are added to generic-arithmetic/polynomials.scm:
Tests
remains the same
remains the same
'(polynomial x 0 0 0 0 0)
'(polynomial y) |
Negates all terms
(define (negate-termlist termlist)
(if (empty? termlist)
empty
(let ((negator (if (list? (car termlist))
(λ (elem) (list (car elem) (- (cadr elem))))
-)))
(map negator termlist))))
(put 'neg '(polynomial)
(lambda (p)
(tag (cons (variable p)
(negate-termlis... |
e3680988e7791c40d7042ee52e10aa5c4896c4a58f51abb453524eca77226aaa | michaelmelanson/erlyweb | employee.erl | -module(employee).
-export([table/0, fields/0, type_field/0]).
table() ->
person.
fields() ->
person:fields() ++ [office, department].
type_field() ->
type.
| null | https://raw.githubusercontent.com/michaelmelanson/erlyweb/997df18b70459bfaaf8c3ab70ab4f54907045d0f/test/erlydb/employee.erl | erlang | -module(employee).
-export([table/0, fields/0, type_field/0]).
table() ->
person.
fields() ->
person:fields() ++ [office, department].
type_field() ->
type.
| |
b290a0fef76b40ae77d6154921be2fa115f9784a9c68a829fd571bc054b09050 | ucsd-progsys/nate | odoc_ast.mli | (***********************************************************************)
(* OCamldoc *)
(* *)
, projet Cristal , INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/ocamldoc/odoc_ast.mli | ocaml | *********************************************************************
OCamldoc
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 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 : odoc_ast.mli , v 1.4 2003/11/24 ... |
4b44f52dc20bb34c6c760e7776cdb85bbea004f0bc8faec78e7dfd016af22262 | chenyukang/eopl | 04.scm | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
(load-relative "./base/letrec-cases.scm")
add let3 for lang ,
let3 is like a let expression , except it defines exactly three variables
;; see new stuff
;;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch5/04.scm | scheme | see new stuff
grammatical specification ;;;;;;;;;;;;;;;;
new stuff
sllgen boilerplate ;;;;;;;;;;;;;;;;
extractors:
continuations ;;;;;;;;;;;;;;;;
new stuff
procedures ;;;;;;;;;;;;;;;;
environment structures ;;;;;;;;;;;;;;;;
environment constructors and observers ;;;;;;;;;;;;;;;;
value-of-program : Program -> F... | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
(load-relative "./base/letrec-cases.scm")
add let3 for lang ,
let3 is like a let expression , except it defines exactly three variables
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
... |
a10fdc4ee53ef577656f1814cd9ee9556d5a6bb80d59c7580992986dbe4fdd56 | susisu/est-ocaml | config.ml | open Core
module Reader_config = struct
open Reader
type options = {
table : Table.Config.options [@default Table.Config.empty_options];
table_ex : Table_ex.Config.options [@default Table_ex.Config.empty_options];
} [@@deriving sexp]
let empty_options = {
table = Table.Config.empty_optio... | null | https://raw.githubusercontent.com/susisu/est-ocaml/e610d07b166a51e5763aa4f7b12449ec0438071c/src/config.ml | ocaml | open Core
module Reader_config = struct
open Reader
type options = {
table : Table.Config.options [@default Table.Config.empty_options];
table_ex : Table_ex.Config.options [@default Table_ex.Config.empty_options];
} [@@deriving sexp]
let empty_options = {
table = Table.Config.empty_optio... | |
8cc523ca9e40c05f1a2f7c4485262030514a6a18c6a1059bc17e02e252701ecc | RolfRolles/PandemicML | Z3SymbolicExecute-in_progress.ml | open IR
let mk_context () = Z3.mk_context_x [|("MODEL", "true")|]
let mk_var ctx name ty = Z3.mk_const ctx (Z3.mk_string_symbol ctx name) ty
let sort_of_typereg ctx =
let bv1sort = Z3.mk_bv_sort ctx 1 in
let bv8sort = Z3.mk_bv_sort ctx 8 in
let bv16sort = Z3.mk_bv_sort ctx 16 in
let bv32sort = Z3.mk_bv_s... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/DPI/Z3SymbolicExecute-in_progress.ml | ocaml | Read n bytes linearly (a[i] where 0 <= i < n) and store them into a list
Remove List.rev for big-endian; TypeReg_32 index might break later assumptions
Map these bytes into bit-vectors of size n1 (the size of the read)
Extract n bytes (BV(8)s) from the bitvector specified in t
Remove List.rev for big-endian; T... | open IR
let mk_context () = Z3.mk_context_x [|("MODEL", "true")|]
let mk_var ctx name ty = Z3.mk_const ctx (Z3.mk_string_symbol ctx name) ty
let sort_of_typereg ctx =
let bv1sort = Z3.mk_bv_sort ctx 1 in
let bv8sort = Z3.mk_bv_sort ctx 8 in
let bv16sort = Z3.mk_bv_sort ctx 16 in
let bv32sort = Z3.mk_bv_s... |
cc6c7f2510ca91780a313b8f8e3baaa5ebf8854b1c2792d7d459ad554aab48f3 | phoe/damn-fast-priority-queue | benchmark.lisp | ;;;; benchmark.lisp
(defpackage #:priority-queue-benchmark
(:use #:cl)
(:local-nicknames (#:a #:alexandria))
(:export #:run))
(in-package #:priority-queue-benchmark)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Test parameters
(defconstant +capacity+ 409600)
(defconsta... | null | https://raw.githubusercontent.com/phoe/damn-fast-priority-queue/ed9c537a64a2f6b3f7ee8d22e5b2680a6be1e329/priority-queue-benchmark/benchmark.lisp | lisp | benchmark.lisp
Test parameters
Performance testq
Implementations
No way to pass the starting capacity.
No way to pass the starting capacity.
No way to pass the starting capacity.
No way to pass the starting capacity. |
(defpackage #:priority-queue-benchmark
(:use #:cl)
(:local-nicknames (#:a #:alexandria))
(:export #:run))
(in-package #:priority-queue-benchmark)
(defconstant +capacity+ 409600)
(defconstant +repeat-count+ 10)
(defconstant +pass-capacity-p+ t)
(defparameter *test-vectors*
'(:increasing :decreasing :shuffle... |
16e13826037359010c0a88b4762a98d19998e0ec62782c7216985b245e3d14ea | nkaretnikov/OOHaskell | Polymorph.hs | module Polymorph(main)
where
import Shape
import Circle
import Rectangle
main =
do
-- handle the shapes polymorphically
drawloop scribble
-- handle rectangle specific instance
draw (setWidth arectangle 30)
where
-- create some shape instances (... | null | https://raw.githubusercontent.com/nkaretnikov/OOHaskell/ddf42cfa62f8bd27643ff6db136dec6c14466232/repository/shapes/Haskell/Rathman/Polymorph.hs | haskell | handle the shapes polymorphically
handle rectangle specific instance
create some shape instances (using existential wrapper)
create a rectangle instance
iterate through the list of shapes and draw | module Polymorph(main)
where
import Shape
import Circle
import Rectangle
main =
do
drawloop scribble
draw (setWidth arectangle 30)
where
scribble = [
MakeExistentialShape (MakeRectangle 10 20 5 6),
MakeExistentialShape (MakeCircle 15 25 8... |
a00d3a1259e96a75455a6d75966cbfe133adf14effff20d444f60e281ff63701 | OlivierSohn/hamazed | DiscreteColorableMorphing.hs | {-# OPTIONS_HADDOCK hide #-}
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.Class.DiscreteColorableMorphing
( DiscreteColorableMorphing(..)
*
, module Imj.Graphics.Class.DiscreteDistance
, module Imj.Graphics.Class.Colorable
, module Imj.Graphics.Class.DiscreteMo... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-base/src/Imj/Graphics/Class/DiscreteColorableMorphing.hs | haskell | # OPTIONS_HADDOCK hide #
for haddock link
| A 'Colorable' is colourless so it wouldn't know in which color to draw itself, |
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.Class.DiscreteColorableMorphing
( DiscreteColorableMorphing(..)
*
, module Imj.Graphics.Class.DiscreteDistance
, module Imj.Graphics.Class.Colorable
) where
import Imj.Prelude
import Imj.Graphic... |
6a0caeba3e30e22d21396a590510903348c18110f2d5693a1a430a0caa7d6ba5 | hjcapple/reading-sicp | exercise_3_64.scm | #lang racket
P235 - [ 练习 3.64 ]
(require "stream.scm")
(require "infinite_stream.scm")
(require "stream_iterations.scm") ; for sqrt-stream
(define (stream-limit s tolerance)
(let ((s0 (stream-car s))
(s1 (stream-car (stream-cdr s))))
(if (< (abs (- s0 s1)) tolerance)
s1
(stream-limit ... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_3/exercise_3_64.scm | scheme | for sqrt-stream
| #lang racket
P235 - [ 练习 3.64 ]
(require "stream.scm")
(require "infinite_stream.scm")
(define (stream-limit s tolerance)
(let ((s0 (stream-car s))
(s1 (stream-car (stream-cdr s))))
(if (< (abs (- s0 s1)) tolerance)
s1
(stream-limit (stream-cdr s) tolerance))))
(define (sqrt x tolera... |
0f2d88fa3c3d4da5f5e3b45cca3a71b9c67036708f50fc4d9c0a136b015e2812 | ocaml-flambda/ocaml-jst | closure.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/7e5a626e4b4e12f1e9106564e1baba4d0ef6309a/middle_end/closure/closure.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Asttypes
open Primitive
open Lambda
open Switch
open Clambda
module P = Clambda_primitive... |
de34bfa13d2c65d2b543146770da58989e73bd7b513d0850b17a06073be46b72 | ocamllabs/ocaml-modular-implicits | t110-negint.ml | open Lib;;
let x = 1 in
if -x <> -1 then raise Not_found
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST1
10 PUSHCONSTINT -1
12 PUSHACC1
13 NEGINT
14 NEQ
15 BRANCHIFNOT 22
17 GETGLOBAL Not_found
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t110-negint.ml | ocaml | open Lib;;
let x = 1 in
if -x <> -1 then raise Not_found
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST1
10 PUSHCONSTINT -1
12 PUSHACC1
13 NEGINT
14 NEQ
15 BRANCHIFNOT 22
17 GETGLOBAL Not_found
... | |
d494fc04a648c4f9b3f23f88a9964c05833ed26f8692eba9f3671aa0ffd4e76a | josefs/Gradualizer | lambda_not_fun.erl | -module(lambda_not_fun).
-export([bar/0]).
-spec foo(integer()) -> integer().
foo(N) -> N.
bar() -> foo(fun() -> 0 end).
| null | https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/should_fail/lambda_not_fun.erl | erlang | -module(lambda_not_fun).
-export([bar/0]).
-spec foo(integer()) -> integer().
foo(N) -> N.
bar() -> foo(fun() -> 0 end).
| |
41e66736f1ce40f9e0328e95cd590ef865c5396ff292881e0594dfeaacb9b450 | jellelicht/guix | scheme.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU Gener... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/scheme.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu... |
f0dbbff6a40a720299350316f84752c9874b46830c31711198716a8d32a6a853 | MLstate/opalang | mongo.ml |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/ocamllib/libbase/mongo.ml | ocaml | OP codes
Reply to a client request. responseTo is set
generic msg command followed by a string
update document
insert new document
formerly used for OP_GET_BY_OID
query a collection
Get more data from a query. See Cursors
Delete documents
Tell database client is done with a cursor
Flags
OP_INSER... |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
89f82a7579175dec3c1a733a22becf898fd319a064b685894a638e73cda26745 | chrovis/cljam | bed_test.clj | (ns cljam.io.bed-test
(:require [clojure.java.io :as cio]
[clojure.test :refer [deftest is are testing]]
[cljam.test-common :refer
[with-before-after
prepare-cache!
clean-cache!
not-throw?
http-server
temp-dir
... | null | https://raw.githubusercontent.com/chrovis/cljam/2b8e7386765be8efdbbbb4f18dbc52447f4a08af/test/cljam/io/bed_test.clj | clojure | (ns cljam.io.bed-test
(:require [clojure.java.io :as cio]
[clojure.test :refer [deftest is are testing]]
[cljam.test-common :refer
[with-before-after
prepare-cache!
clean-cache!
not-throw?
http-server
temp-dir
... | |
9f2369c84be5927e600cd3da0c06aa23535bd06cf76c2c6bf0e91b32d485ac04 | babashka/sci | copy_vars.cljc | (ns sci.impl.copy-vars
(:require
[sci.impl.cljs]
[sci.impl.macros :as macros]
[sci.impl.utils :as utils :refer [clojure-core-ns]]
[sci.lang])
#?(:cljs (:require-macros [sci.impl.copy-vars :refer [copy-var copy-core-var macrofy]])))
#?(:clj (set! *warn-on-reflection* true))
;; The following is produced... | null | https://raw.githubusercontent.com/babashka/sci/0fee91953e0d0504e80a5997585c6d00833f98c0/src/sci/impl/copy_vars.cljc | clojure | The following is produced with:
(def inlined (filter (comp :inline meta) (vals (ns-publics 'clojure.core))))
(map (comp :name meta) inlined)
for self-hosted | (ns sci.impl.copy-vars
(:require
[sci.impl.cljs]
[sci.impl.macros :as macros]
[sci.impl.utils :as utils :refer [clojure-core-ns]]
[sci.lang])
#?(:cljs (:require-macros [sci.impl.copy-vars :refer [copy-var copy-core-var macrofy]])))
#?(:clj (set! *warn-on-reflection* true))
(def inlined-vars
'#{+' un... |
53365169ca36149e47b383979bdd508ba30fc737c4fb9067520410dcf672fd6f | hbr/albatross | io.mli | * Definition of an enviroment for console applications which can run natively
or under nodejs or any other module which satisfies the signature [ SIG ] .
The helps you to develop Ocaml programs which run natively and can be
compiled to javascript without changing the code of the application .
You develop y... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/fmlib/basic/io.mli | ocaml | Content of file [program.ml]
* IO Errors
* Statistic data about a file/directory.
* Type of the data.
* Time stamp.
* Compare time stamps.
* Is the node a directory?
* Is the node a file?
* Time of last modification.
* Signature of an IO environment.
* [absolute path] converts [path] into an absolute path.
... | * Definition of an enviroment for console applications which can run natively
or under nodejs or any other module which satisfies the signature [ SIG ] .
The helps you to develop Ocaml programs which run natively and can be
compiled to javascript without changing the code of the application .
You develop y... |
beffa6e5700ea1310bb98b61640a3724c7aa75250d0d40fed8738f058bd45290 | umd-cmsc330/cmsc330spring22 | testUtils.ml | open OUnit2
open P2b.Data
let assert_true x = assert_equal true x
let assert_false x = assert_equal false x
let string_of_string s = s
let string_of_list f xs =
"[" ^ (String.concat "; " (List.map f xs)) ^ "]"
let string_of_pair f g (x, y) =
"(" ^ (f x) ^ ", " ^ (g y) ^ ")"
let string_of_option f o =
match ... | null | https://raw.githubusercontent.com/umd-cmsc330/cmsc330spring22/e499004813cebd2e6aeffc79088ff7279560cbf0/project2b/test/testUtils.ml | ocaml | |_ -> failwith "Empty node found"
| MapNode ((, Some (_, _)), _, _, _) -> failwith "Unbalanced tree_map node @ tree_map_keys"
| MapNode ((None, None), _, _, _) -> failwith "Empty tree_map node @ tree_map_keys"
| open OUnit2
open P2b.Data
let assert_true x = assert_equal true x
let assert_false x = assert_equal false x
let string_of_string s = s
let string_of_list f xs =
"[" ^ (String.concat "; " (List.map f xs)) ^ "]"
let string_of_pair f g (x, y) =
"(" ^ (f x) ^ ", " ^ (g y) ^ ")"
let string_of_option f o =
match ... |
47c67a565d3edfc3eb2285b4390c99f86c4fa6a0f7a90c636d6c73ed9c0e209e | fishcakez/sbroker | sregulator_relative_valve.erl | %%-------------------------------------------------------------------
%%
Copyright ( c ) 2016 , < >
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% -2.0
... | null | https://raw.githubusercontent.com/fishcakez/sbroker/10f7e3970d0a296fbf08b1d1a94c88979a7deb5e/src/sregulator_relative_valve.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the Lic... | Copyright ( c ) 2016 , < >
This file is provided to you under the Apache License ,
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
` sregulator_relative_value ' can be used as the ` sregulator_valve ' in a
` Target ' is the target rela... |
2c99125a0a19ef3c5563a58ac9917e106ee5044ac726cf68aa3aeac329283e62 | jrm-code-project/LISP-Machine | csrpos.lisp | -*- Mode : LISP ; Package : TV ; Base:8 ; : ZL -*-
* * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
For compatibility
;No arguments returns (line . column)
One argument does magic functions
Two arguments sets cursorpos to there ( args there of NIL mean do n't change )
;Returns T if it succe... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/window/csrpos.lisp | lisp | Package : TV ; Base:8 ; : ZL -*-
No arguments returns (line . column)
Returns T if it succeeded, NIL if it didn't.
If the last argument is T (meaning *TERMINAL-IO*)
or a stream, then it is applied to that stream. Otherwise it is applied
Why bother signalling the correct condition?
F forward space
B backspace
D down ... | * * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
For compatibility
One argument does magic functions
Two arguments sets cursorpos to there ( args there of NIL mean do n't change )
Hmm , NEWIO seems to blow out rather than returning NIL now . Change this ?
to * STANDARD - OUTPUT * . Anyt... |
011b0121038795318afb8eaa5e0116a9c6a0c2a588e247a3c32b6890a29eaf44 | patricoferris/ocaml-multicore-monorepo | server.eml.ml | let home =
<html>
<body>
<p><%s Common.greet `Server %></p>
<script src="/static/client.js"></script>
</body>
</html>
let () =
Eio_main.run @@ fun env ->
Dream.run env
@@ Dream.logger
@@ Dream.router [
Dream.get "/"
(fun _ -> Dream.html home);
Dream.get "/static/**"
... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/example/w-fullstack-rescript/server/server.eml.ml | ocaml | let home =
<html>
<body>
<p><%s Common.greet `Server %></p>
<script src="/static/client.js"></script>
</body>
</html>
let () =
Eio_main.run @@ fun env ->
Dream.run env
@@ Dream.logger
@@ Dream.router [
Dream.get "/"
(fun _ -> Dream.html home);
Dream.get "/static/**"
... | |
afa538c7e014d71d23db9df9c9b074ef39d1f993a27228dafc426e4f79c10ba0 | haskell-lisp/yale-haskell | signature.scm | ;;; This file handles the scoping and error checking of signatures.
;;; Possible errors:
;;; Wrong arity in a tycon
;;; Ambiguous context
;;; Other errors may be present; these are detected at a higher level.
;;; The list of variables used in the signature is returned.
(define (resolve-signature signature)
(with... | null | https://raw.githubusercontent.com/haskell-lisp/yale-haskell/4e987026148fe65c323afbc93cd560c07bf06b3f/util/signature.scm | scheme | This file handles the scoping and error checking of signatures.
Possible errors:
Wrong arity in a tycon
Ambiguous context
Other errors may be present; these are detected at a higher level.
The list of variables used in the signature is returned.
This returns the names of the tyvars in a simple tycon
This is u... |
(define (resolve-signature signature)
(with-slots signature (context type) signature
(let ((tyvars (resolve-type type)))
(resolve-signature-aux tyvars context)
tyvars)))
(define (resolve-signature-aux tyvars context)
(dolist (ctxt context)
(with-slots context (class tyvar) ctxt
(when (... |
e91949a82d9a63db348b95b6a5ba491f8acc1893b65f0ba3e4f689f3fd53d58a | swannodette/swannodette.github.com | core.cljs | (ns blog.instrument.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[cljs.reader :as reader]))
(enable-console-print!)
;; =============================================================================
;; Declarations
(def app-state
(atom {:ui [{:c... | null | https://raw.githubusercontent.com/swannodette/swannodette.github.com/91a196ded00bfacd59cc925161312090b2cfa931/code/blog/src/blog/instrument/core.cljs | clojure | =============================================================================
Declarations
=============================================================================
Application
=============================================================================
Inspection
===========================================... | (ns blog.instrument.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[cljs.reader :as reader]))
(enable-console-print!)
(def app-state
(atom {:ui [{:checked false :label "Foo" :count 0}
{:checked false :label "Bar" :count 0}
... |
4f2f63fb9421e036a1e28038f58ec591b4ba6603d7d5bbff2bd58979a5b7a7ed | Haskell-Things/HSlice | CheckFacets.hs | {- ORMOLU_DISABLE -}
- Copyright 2020
-
- This program is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation , either version 3 of the License , or
- ( at your option ) any later version .... | null | https://raw.githubusercontent.com/Haskell-Things/HSlice/e021248ac59fb52c90a65db371e1d206c8e56ab7/Graphics/Slicer/Math/CheckFacets.hs | haskell | ORMOLU_DISABLE
part of an attempt to implement admesh capabilities. woefully incomplete. |
- Copyright 2020
-
- This program is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation , either version 3 of the License , or
- ( at your option ) any later version .
-
- This progr... |
f98e7fc5068515fdaf5dc9c11217d23498a1b8177ec657e2c890629407b20cd0 | glebec/haskell-programming-allen-moronuki | Ini.hs | {-# LANGUAGE OverloadedStrings #-}
-- {-# LANGUAGE QuasiQuotes #-}
module Ini (parseIni, Config) where
INI format parsing
import qualified Data.Map as M
import Data.Map (Map)
import Control.Applicative
import Text.Trifecta
import Data . ByteString ( ByteString )
import Text . . QQ
-- headers
-- headerExampl... | null | https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/29-io/iniparse/src/Ini.hs | haskell | # LANGUAGE OverloadedStrings #
{-# LANGUAGE QuasiQuotes #-}
headers
headerExample :: ByteString
headerExample = "[blah]"
assignments
assignmentExample :: ByteString
assignmentExample = "woot=1"
comments
commentExample :: ByteString
commentExample' :: ByteString
sections
sectionExample :: ByteString
section... |
module Ini (parseIni, Config) where
INI format parsing
import qualified Data.Map as M
import Data.Map (Map)
import Control.Applicative
import Text.Trifecta
import Data . ByteString ( ByteString )
import Text . . QQ
newtype Header = Header String deriving (Eq, Ord, Show)
parseBracketPair :: Parser a -> Par... |
357233bba8aed0c29b555734da3110da46f53d44d9da404ceeac0ff620c8bbcf | stuartsierra/lazytest | agents.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/stuartsierra/lazytest/3b0f419ce3d6f259d2ab3cfde475fa491a4db23e/modules/clojure-language-tests/test/clojure/test_clojure/agents.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
(ns clojure.test-clojure.agents
(:use lazytest.deftest))
(deftest handle-all-throwables-during-agent-actions
(let [agt (agent nil)]
(send agt (fn [state] (throw (Throwable. "just testing Throwables"))))
(try
(await-for 100 agt)
(catch R... |
85807bbf1a427184fb9fac168d600cfbb32a26daf026590ddc1f17fd63c7c121 | abevoelker/haskellbook-solutions | vigenere.hs | module Vigenere where
import Data.Char
infiniteUpper :: String
infiniteUpper = concat $ (repeat ['A'..'Z'])
infiniteLower :: String
infiniteLower = concat $ (repeat ['a'..'z'])
charIdx ' A ' = 0
charIdx ' B ' = 1
charIdx :: Char -> Int
charIdx x
| elem x ['A'..'Z'] = (ord x) - (ord 'A')
| elem x ['a'..'z'] =... | null | https://raw.githubusercontent.com/abevoelker/haskellbook-solutions/9e2804940b3b45bdc1b04cfa5d536097629c9498/ch11/vigenere.hs | haskell | charShift 'Y' 2 = 'A'
charShift 'y' 2 = 'a' | module Vigenere where
import Data.Char
infiniteUpper :: String
infiniteUpper = concat $ (repeat ['A'..'Z'])
infiniteLower :: String
infiniteLower = concat $ (repeat ['a'..'z'])
charIdx ' A ' = 0
charIdx ' B ' = 1
charIdx :: Char -> Int
charIdx x
| elem x ['A'..'Z'] = (ord x) - (ord 'A')
| elem x ['a'..'z'] =... |
10dd571797c43c4cfc4854e8609a040f9d23c9ef2c23a93fd52aed0ae7a535f3 | pallet/pallet | emacs_indent.clj | ;; Indentation settings for pallet code when using emacs
;; Local Variables:
;; mode: clojure
eval : ( define - clojure - indent ( plan - fn 0 ) ( plan - context 1 ) ( defmethod - plan 2 ) )
eval : ( define - clojure - indent ( defaction ' defun)(implement - action 1 ) )
eval : ( define - clojure - indent ( plan... | null | https://raw.githubusercontent.com/pallet/pallet/30226008d243c1072dcfa1f27150173d6d71c36d/dev-resources/emacs_indent.clj | clojure | Indentation settings for pallet code when using emacs
Local Variables:
mode: clojure
eval: (define-clojure-indent (for-all 1))
End: |
eval : ( define - clojure - indent ( plan - fn 0 ) ( plan - context 1 ) ( defmethod - plan 2 ) )
eval : ( define - clojure - indent ( defaction ' defun)(implement - action 1 ) )
eval : ( define - clojure - indent ( plan - when 1)(plan - when - not 1 ) )
eval : ( define - clojure - indent ( with - action - valu... |
48ef0280f0ef1e2dcaf9c9e73846fc6cdc0e8309f237f1a94d6c742fa38b5220 | agda/agda | Reduce.hs | # LANGUAGE NondecreasingIndentation #
module Agda.TypeChecking.Reduce
Meta instantiation
( Instantiate, instantiate', instantiate, instantiateWhen
-- Recursive meta instantiation
, InstantiateFull, instantiateFull', instantiateFull
, instantiateFullExceptForDefinitions
-- Check for meta (no reduction)
, IsMeta... | null | https://raw.githubusercontent.com/agda/agda/9afe77020541b944331685ef2720a81bb312a925/src/full/Agda/TypeChecking/Reduce.hs | haskell | Recursive meta instantiation
Check for meta (no reduction)
Reduction and blocking
Simplification
Normalization
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
| A variant of 'instantiateFull' that only instantiates those
meta-variables that satisfy the predicate.
Reduce a term and a... | # LANGUAGE NondecreasingIndentation #
module Agda.TypeChecking.Reduce
Meta instantiation
( Instantiate, instantiate', instantiate, instantiateWhen
, InstantiateFull, instantiateFull', instantiateFull
, instantiateFullExceptForDefinitions
, IsMeta, isMeta
, Reduce, reduce', reduceB', reduce, reduceB, reduceWithB... |
198980814e020706d8e3be37680cdf068748ec6ddd1679e386afec79e14265fc | futurice/haskell-mega-repo | Types.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module Futurice.App.PlanMillSync.Types where
import Futurice.Prelude
import Prelude ()
import qualified PlanMill as PM
import qualified PlanMill.Queries as PMQ
data PMUser = PMUser
{ pmUser :: !PM.User
, pmTeam :: !(Maybe PM.T... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/planmill-sync/src/Futurice/App/PlanMillSync/Types.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
module Futurice.App.PlanMillSync.Types where
import Futurice.Prelude
import Prelude ()
import qualified PlanMill as PM
import qualified PlanMill.Queries as PMQ
data PMUser = PMUser
{ pmUser :: !PM.User
, pmTeam :: !(Maybe PM.Team)
, pmContract :: !Text
... |
238108510b5d267215eac358230de3f52031f3e13435303d889f48be3a56316d | erlang/rebar3 | rlx_assemble.erl | -module(rlx_assemble).
-export([do/2,
format_error/1]).
-include("relx.hrl").
-include("rlx_log.hrl").
-include_lib("kernel/include/file.hrl").
do(Release, State) ->
RelName = rlx_release:name(Release),
?log_info("Assembling release ~p-~s...", [RelName, rlx_release:vsn(Release)]),
OutputDir = fi... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/vendor/relx/src/rlx_assemble.erl | erlang | don't strip the release in debug mode since that would strip
the beams symlinked to and no one wants that
make *.beam to be writeable for strip.
revert file permissions after strip.
internal functions
No need to do anything here, discover found something already in
a release dir
TODO: support override system li... | -module(rlx_assemble).
-export([do/2,
format_error/1]).
-include("relx.hrl").
-include("rlx_log.hrl").
-include_lib("kernel/include/file.hrl").
do(Release, State) ->
RelName = rlx_release:name(Release),
?log_info("Assembling release ~p-~s...", [RelName, rlx_release:vsn(Release)]),
OutputDir = fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.