_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 |
|---|---|---|---|---|---|---|---|---|
7f7d7a5011e1419da7abc56d8aab53885fdb60fa9e462e1b7420c93d4ea5c263 | stchang/macrotypes | fomega2-tests.rkt | #lang s-exp turnstile/examples/fomega2
(require "rackunit-typechecking.rkt")
(require "rackunit-kindchecking.rkt")
(check-kind Int :: ★)
(check-kind String :: ★)
(typecheck-fail →)
(check-kind (→ Int Int) :: ★)
(typecheck-fail (→ →))
(typecheck-fail (→ 1))
(check-type 1 : Int)
(typecheck-fail (λ ([x :: ★]) 1) #:with-... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-test/tests/turnstile/fomega2-tests.rkt | racket | (check-type (∀ ([t :: ★]) (→ t t)) :: ★)
tests for λ as a type
partial-apply →
f's type must have kind ★
applied f too early
tapl examples, p441
tapl examples, p451
(check-type Pair :: (→ ★ ★ ★))
parametric pair constructor
Pair Int String value
fst: parametric
fst: concrete Pair Int String accessor
apply fs... | #lang s-exp turnstile/examples/fomega2
(require "rackunit-typechecking.rkt")
(require "rackunit-kindchecking.rkt")
(check-kind Int :: ★)
(check-kind String :: ★)
(typecheck-fail →)
(check-kind (→ Int Int) :: ★)
(typecheck-fail (→ →))
(typecheck-fail (→ 1))
(check-type 1 : Int)
(typecheck-fail (λ ([x :: ★]) 1) #:with-... |
94afea66efdaddee5b2487c09ae42b471966a41a6477b9c6ab2c28bcf3d113e9 | ckirkendall/enfocus-charts | events.cljs | (ns enfocus.charts.events
(:require [goog.events :as events]))
(defn handle-base-events [data elem opts]
(when (:on-value-mouseover opts)
(events/listen elem "mouseover" (partial (:on-value-mouseover opts) data)))
(when (:on-value-mouseout opts)
(events/listen elem "mouseout" (partial (:on-value-mouseou... | null | https://raw.githubusercontent.com/ckirkendall/enfocus-charts/902becf3465d8328ff76e60b037f05bb8365aa1e/cljs-src/enfocus/charts/events.cljs | clojure | (ns enfocus.charts.events
(:require [goog.events :as events]))
(defn handle-base-events [data elem opts]
(when (:on-value-mouseover opts)
(events/listen elem "mouseover" (partial (:on-value-mouseover opts) data)))
(when (:on-value-mouseout opts)
(events/listen elem "mouseout" (partial (:on-value-mouseou... | |
82248e040e5822cf72f0cc58fb193403641601b939843a16382d404e47eb6c43 | helmutkian/cl-wasm-runtime | test-func.lisp | (in-package #:cl-wasm-runtime.test)
(5am:def-suite cl-wasm-runtime.test.func
:in cl-wasm-runtime.test)
(5am:in-suite cl-wasm-runtime.test.func)
(5am:test test-guest-func
(5am:finishes
(let* ((wat "(module
(type $sum_t (func (param i32 i32) (result i32)))
(func $sum_f (type $sum_t) (param $x i32) (p... | null | https://raw.githubusercontent.com/helmutkian/cl-wasm-runtime/e6449be71ccf35c56b972f8ffa30d4f823bb1572/test/test-func.lisp | lisp | (in-package #:cl-wasm-runtime.test)
(5am:def-suite cl-wasm-runtime.test.func
:in cl-wasm-runtime.test)
(5am:in-suite cl-wasm-runtime.test.func)
(5am:test test-guest-func
(5am:finishes
(let* ((wat "(module
(type $sum_t (func (param i32 i32) (result i32)))
(func $sum_f (type $sum_t) (param $x i32) (p... | |
c6183cac14f505f7510560a7cf92c726e8668908a19e07e0d889a8f0ac995443 | easyuc/EasyUC | ucEcInterface.ml | UcEcInterface module
Interface with EasyCrypt
open Batteries
open Format
open EcUtils
open UcMessage
open UcConfig
EasyCrypt critical errors cause termination with an error message ,
but EasyCrypt warnings are collected in a list , which may be retrieved
or reset
but EasyCrypt warnings are collect... | null | https://raw.githubusercontent.com/easyuc/EasyUC/0ee14ef8b024a8e7acde1035d06afecbdcaec990/uc-dsl/ucdsl-proj/src/ucEcInterface.ml | ocaml | won't happen, given default log level
discard
include path setup
lowest precedence
medium high precedence
highest precedence
Register user messages printers | UcEcInterface module
Interface with EasyCrypt
open Batteries
open Format
open EcUtils
open UcMessage
open UcConfig
EasyCrypt critical errors cause termination with an error message ,
but EasyCrypt warnings are collected in a list , which may be retrieved
or reset
but EasyCrypt warnings are collect... |
8327b6f27b6eb3c54dae6353c2ef23a155a7dc68d2e6e0e6296587b2aa3e59d4 | sulami/spielwiese | 06.hs | module Main where
import Data.List (foldl')
import Text.Parsec
import Text.Parsec.Char
import Text.Parsec.String
data CType = TurnOn | TurnOff | Toggle
deriving (Eq, Show)
data Cmd = Cmd
{ ctype :: CType
, cstart :: (Int, Int)
, cstop :: (Int, Int)
} deriving (Eq,... | null | https://raw.githubusercontent.com/sulami/spielwiese/da354aa112d43d7ec5f258f4b5afafd7a88c8aa8/advent15/06.hs | haskell | module Main where
import Data.List (foldl')
import Text.Parsec
import Text.Parsec.Char
import Text.Parsec.String
data CType = TurnOn | TurnOff | Toggle
deriving (Eq, Show)
data Cmd = Cmd
{ ctype :: CType
, cstart :: (Int, Int)
, cstop :: (Int, Int)
} deriving (Eq,... | |
1c5ceabd1eac895602b0dda2bea994945c1b8a7a8d336b5ec4247cebc4095d37 | open-company/open-company-web | theme_settings_modal.cljs | (ns oc.web.components.theme-settings-modal
(:require [rum.core :as rum]
[oc.web.utils.dom :as dom-utils]
[oc.web.utils.theme :as theme-utils]
[oc.web.actions.theme :as theme-actions]
[oc.web.actions.nav-sidebar :as nav-actions]
[oc.web.components.ui.carrot-c... | null | https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/src/main/oc/web/components/theme_settings_modal.cljs | clojure | (ns oc.web.components.theme-settings-modal
(:require [rum.core :as rum]
[oc.web.utils.dom :as dom-utils]
[oc.web.utils.theme :as theme-utils]
[oc.web.actions.theme :as theme-actions]
[oc.web.actions.nav-sidebar :as nav-actions]
[oc.web.components.ui.carrot-c... | |
bf1be96283a6103a8fa199c7c84f639b0a877deb610bab22646fa871ea9f1dd5 | markostanimirovic/re-action | dev.cljs | (ns ^:figwheel-no-load login-form.dev
(:require
[login-form.core :as core]
[devtools.core :as devtools]))
(extend-protocol IPrintWithWriter
js/Symbol
(-pr-writer [sym writer _]
(-write writer (str "\"" (.toString sym) "\""))))
(enable-console-print!)
(devtools/install!)
(core/init!)
| null | https://raw.githubusercontent.com/markostanimirovic/re-action/d6cb33d9ac73bedeac4f09996c2c741d21bda7ba/examples/login-form/env/dev/cljs/login_form/dev.cljs | clojure | (ns ^:figwheel-no-load login-form.dev
(:require
[login-form.core :as core]
[devtools.core :as devtools]))
(extend-protocol IPrintWithWriter
js/Symbol
(-pr-writer [sym writer _]
(-write writer (str "\"" (.toString sym) "\""))))
(enable-console-print!)
(devtools/install!)
(core/init!)
| |
a47d3363eb6cdc35152bc04f7eeda85b63afc0e1acb992c8b593ded611efa74e | HunterYIboHu/htdp2-solution | ex519-our-pair.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex519-our-pair) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor r... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter6/Section33/ex519-our-pair.rkt | racket | about the language level of this file in a form that our tools can easily process.
'()
constructor
data definitions, via a constructor-function
functions
Any -> N
how many items does l contain
Questions
compute its result, regardless of the size of its input.
A1: Because the function just extracts the conten... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex519-our-pair) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define-struct cpair [count left right])
A [... |
adce2261b19cde1c0ef3810d0e44a18cfb12effe1062f0af6951bb273b108747 | 3b/3bgl-misc | graph.lisp | (in-package 3bgl-sg2)
(defclass graph-material (material)
())
(defclass graph-material-lines (graph-material)
())
(3bgl-ssbo::define-ssbo-writer %write-per-object/graph (layout pointer size draws)
(let* ((count (length draws)))
(multiple-value-bind (total-size ok partial partial-count partial-size)
(... | null | https://raw.githubusercontent.com/3b/3bgl-misc/e3bf2781d603feb6b44e5c4ec20f06225648ffd9/scenegraph2/graph.lisp | lisp | probably will remove this, mostly for debugging
currently. Actual displayed label should probably be in
container objects...
upload vertex data
upload per-object data and build commands
fixme: factor out indirect buffer writers
# verices
instance count | (in-package 3bgl-sg2)
(defclass graph-material (material)
())
(defclass graph-material-lines (graph-material)
())
(3bgl-ssbo::define-ssbo-writer %write-per-object/graph (layout pointer size draws)
(let* ((count (length draws)))
(multiple-value-bind (total-size ok partial partial-count partial-size)
(... |
bfdf2376a5001035ef158f7a7c21368748dfa6977620dac911ccd8aa0731263b | input-output-hk/ouroboros-network | Types.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module Ouroboros.Network.PeerSelection.Types
( PeerSource (..)
, PeerAdvertise (..)
, PeerStatus (..)
) where
import Data.Aeson
import Data.Bool (bool)
import GHC.Generics (Generic)
-- | Where did this peer come... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/40f3beb7c7c956ef407e799750dd4809b4827707/ouroboros-network/src/Ouroboros/Network/PeerSelection/Types.hs | haskell | # LANGUAGE OverloadedStrings #
| Where did this peer come from? Policy functions can choose to treat
peers differently depending on where we found them from.
| Should this peer be advertised to other peers asking for known peers?
For certain peers specified by configuration it would be an appropriate
policy to ke... | # LANGUAGE DeriveGeneric #
module Ouroboros.Network.PeerSelection.Types
( PeerSource (..)
, PeerAdvertise (..)
, PeerStatus (..)
) where
import Data.Aeson
import Data.Bool (bool)
import GHC.Generics (Generic)
data PeerSource = PeerSourceLocalRoot
| PeerSour... |
17895db67185f053efbc2a8927308737619b20cb52b29b7f9352d496e769ed52 | RefactoringTools/HaRe | PropLexer.hs | , ( .. )
--import LexerOptions
import HsLexerPass1(lexerPass0,lexerPass0',startPos)
import HsTokens
+
This module defines the lexical analyser for the P - logic extension of Haskell .
Differences from the plain 98 lexical syntax :
- The identifiers " assert " and " property " are reserved .
- The conte... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/tools/property/parse2/PropLexer.hs | haskell | import LexerOptions
P: ...
Replace the delimiting "{-P:" and "-}" with the same amount of space
to preserve layout. | , ( .. )
import HsLexerPass1(lexerPass0,lexerPass0',startPos)
import HsTokens
+
This module defines the lexical analyser for the P - logic extension of Haskell .
Differences from the plain 98 lexical syntax :
- The identifiers " assert " and " property " are reserved .
- The contents of nested comments... |
76608caa083ed815210cea25b46bd3d9e494a45e4e97ca45743b8229034ce72f | garrigue/lablgtk | gdkKeysyms.ml | (**************************************************************************)
(* Lablgtk *)
(* *)
(* This program is free software; you can redistribute it *)
and/or ... | null | https://raw.githubusercontent.com/garrigue/lablgtk/504fac1257e900e6044c638025a4d6c5a321284c/src/gdkKeysyms.ml | ocaml | ************************************************************************
Lablgtk
This program is free software; you can redistribute it
comes with the library. ... | and/or modify it under the terms of the GNU Library General
Public License as published by the Free Software Foundation
version 2 , with the exception described in file COPYING which
GNU Library General Public License for more details .
You should have r... |
cebf154aa4b9139fac35e8e6d3072b3b85c11c9ef574782e700c1bb8517448b4 | kennytilton/cells | hello-world.lisp | ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: triple-cells; -*-
;;;
;;;
Copyright ( c ) 2008 by .
;;;
(in-package :3c)
#+test
(3c-test-reopen)
#+test
(3c-test)
(defun 3c-test ()
(3c-test-build)
(3c-test-reopen)
)
(defun 3c-test-build ()
(ukt:test-prep "3c")
;
; initialize new DB altogether
;... | null | https://raw.githubusercontent.com/kennytilton/cells/64d05c83e155d5f35b3bd115dcd07f152ef79c39/triple-cells/hello-world.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: triple-cells; -*-
initialize new DB altogether
initialize new DB session
change advances pulse
(trc "rule sees happen" h)
#+step2 | Copyright ( c ) 2008 by .
(in-package :3c)
#+test
(3c-test-reopen)
#+test
(3c-test)
(defun 3c-test ()
(3c-test-build)
(3c-test-reopen)
)
(defun 3c-test-build ()
(ukt:test-prep "3c")
(create-triple-store "hello-world"
:if-exists :supersede
:directory (project-path))
(register-namespace "hw... |
deb89fe38eb4c093f17bbc5c1766b252e5475b027e0ad149ba917a32346cd97a | jeapostrophe/srpnt | portaudio.rkt | #lang racket/base
(require portaudio/portaudio
portaudio/devices
racket/match
racket/flonum
racket/contract/base
"h.rkt")
(define reasonable-latency (fl/ 1.0 30.0))
(struct bp (stream buf))
(define (make-bytes-player)
(pa-maybe-initialize)
(define device-number (find-... | null | https://raw.githubusercontent.com/jeapostrophe/srpnt/c26e74ce524bb988d6643273c96f4e94406b1746/srpnt/speaker/portaudio.rkt | racket | #lang racket/base
(require portaudio/portaudio
portaudio/devices
racket/match
racket/flonum
racket/contract/base
"h.rkt")
(define reasonable-latency (fl/ 1.0 30.0))
(struct bp (stream buf))
(define (make-bytes-player)
(pa-maybe-initialize)
(define device-number (find-... | |
b7995eb0b03c5596f130c32432302719ae6681eec23af97cf23af31dc8658cb4 | rems-project/cerberus | interval.ml | open Apron
type state = Box.t Abstract1.t
let man = Box.manager_alloc ()
let empty_env = Environment.make [||] [||]
(* Lift states to a common environment *)
let lift_common_env man (s1, s2) =
let env1 = Abstract1.env s1 in
let env2 = Abstract1.env s2 in
match Environment.compare env1 env2 with
| -2 -> (* i... | null | https://raw.githubusercontent.com/rems-project/cerberus/124c93f10cb4c235f6396adec82ebf9563daeb7e/backend/absint/src/interval.ml | ocaml | Lift states to a common environment
incomparable environments
equal | open Apron
type state = Box.t Abstract1.t
let man = Box.manager_alloc ()
let empty_env = Environment.make [||] [||]
let lift_common_env man (s1, s2) =
let env1 = Abstract1.env s1 in
let env2 = Abstract1.env s2 in
match Environment.compare env1 env2 with
assert false
| -1 ->
let s1 = Abstract1.change... |
ea4c190ac2a7341214a2444fdb0651c36ad3ef96401147e1464bad52966f5e14 | philnguyen/soft-contract | length.rkt | #lang racket
(require soft-contract/fake-contract)
(define (len xs)
(if (empty? xs) 0
(+ 1 (len (cdr xs)))))
(provide/contract
[len (->i ([l (listof any/c)]) (res (l) (and/c integer? (>=/c 0))))])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/softy/length.rkt | racket | #lang racket
(require soft-contract/fake-contract)
(define (len xs)
(if (empty? xs) 0
(+ 1 (len (cdr xs)))))
(provide/contract
[len (->i ([l (listof any/c)]) (res (l) (and/c integer? (>=/c 0))))])
| |
e1f8c7c7c3c9c802eecf9e8f87bf9d08a09a9340721ca834f4e917668d7a24ed | clojurecademy/clojurecademy | util.cljs | (ns clojurecademy.util
(:require [ajax.core :as ajax :refer [GET POST PUT DELETE]]
[clojurecademy.validation :as validation]
[clojure.string :as str]
[clojure.set :as set]
[goog.dom :as dom]
[goog.net.cookies :as cks]))
(defn create-field-val-map
[field-i... | null | https://raw.githubusercontent.com/clojurecademy/clojurecademy/97dc7f9b91a90a3f30ca5a3de88542c90a50ce01/src/cljs/clojurecademy/util.cljs | clojure | (ns clojurecademy.util
(:require [ajax.core :as ajax :refer [GET POST PUT DELETE]]
[clojurecademy.validation :as validation]
[clojure.string :as str]
[clojure.set :as set]
[goog.dom :as dom]
[goog.net.cookies :as cks]))
(defn create-field-val-map
[field-i... | |
d042aa22cd2a839d1e0d94604405357605efa3da852d85e613317d33983d0561 | ocaml/ocaml | w52.ml | (* TEST
flags = "-w +A"
* expect
*)
let () = try () with Invalid_argument "Any" -> ();;
[%%expect{|
Line 1, characters 38-43:
1 | let () = try () with Invalid_argument "Any" -> ();;
^^^^^
Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values o... | null | https://raw.githubusercontent.com/ocaml/ocaml/d71ea3d089ae3c338b8b6e2fb7beb08908076c7a/testsuite/tests/warnings/w52.ml | ocaml | TEST
flags = "-w +A"
* expect
|
let () = try () with Invalid_argument "Any" -> ();;
[%%expect{|
Line 1, characters 38-43:
1 | let () = try () with Invalid_argument "Any" -> ();;
^^^^^
Warning 52 [fragile-literal-pattern]: Code should not depend on the actual values of
this constructor's arguments. They are o... |
3adfac8823d6ffcc25146e9ba25d3bfbea5b16a4aa9f81a7ca6d22ece5acbef3 | brevis-us/brevis | plot.clj | (ns us.brevis.plot
(:import (org.jfree.chart ChartFactory ChartPanel JFreeChart)
(org.jfree.chart.axis NumberAxis)
(org.jfree.chart.plot CombinedDomainXYPlot PlotOrientation XYPlot)
(org.jfree.chart.renderer.xy StandardXYItemRenderer XYLineAndShapeRenderer)
(org.jfree.data.... | null | https://raw.githubusercontent.com/brevis-us/brevis/de51c173279e82cca6d5990010144167050358a3/src/main/clojure/us/brevis/plot.clj | clojure | for add-update-handler
should keep track of plotters in the engine or somewhere and delete then when the window is destroyed
should keep track of plotters in the engine or somewhere and delete then when the window is destroyed | (ns us.brevis.plot
(:import (org.jfree.chart ChartFactory ChartPanel JFreeChart)
(org.jfree.chart.axis NumberAxis)
(org.jfree.chart.plot CombinedDomainXYPlot PlotOrientation XYPlot)
(org.jfree.chart.renderer.xy StandardXYItemRenderer XYLineAndShapeRenderer)
(org.jfree.data.... |
1743a0a760751e19a0df0c70734f88386cdd470fb22fb0c211b60fa2723b57d9 | sellout/haskerwaul | Laws.hs | module Haskerwaul.Semigroupoid.Laws where
import Haskerwaul.Semigroup.Laws
import Haskerwaul.Semigroupoid
import Haskerwaul.Transformation.Dinatural
type SemigroupoidLaws = SemigroupLaws (DinaturalTransformation (->)) Procompose
-- | Simply a specialization of `semigroupLaws` for when we're testing categories.
semig... | null | https://raw.githubusercontent.com/sellout/haskerwaul/cf54bd7ce5bf4f3d1fd0d9d991dc733785b66a73/src/Haskerwaul/Semigroupoid/Laws.hs | haskell | | Simply a specialization of `semigroupLaws` for when we're testing categories. | module Haskerwaul.Semigroupoid.Laws where
import Haskerwaul.Semigroup.Laws
import Haskerwaul.Semigroupoid
import Haskerwaul.Transformation.Dinatural
type SemigroupoidLaws = SemigroupLaws (DinaturalTransformation (->)) Procompose
semigroupoidLaws :: Semigroupoid c => SemigroupoidLaws c
semigroupoidLaws = semigroupLaw... |
7cc1efb7419d79c0a821b42f9485c631fa1e0d78c094f5f610d42ee4878ee1a3 | roosta/herb | text.cljs | (ns site.components.text
(:require [garden.units :refer [rem em px]]
[herb.core :refer [<class]]
[clojure.string :as str]
[reagent.core :as r]))
(def mappings
{:display :h1
:title :h4
:heading :h5
:subtitle :h5
:a :span
:subheading :h3
:body :p})
(defn colors
... | null | https://raw.githubusercontent.com/roosta/herb/64afb133a7bf51d7171a3c5260584c09dbe4e504/site/src/site/components/text.cljs | clojure | (ns site.components.text
(:require [garden.units :refer [rem em px]]
[herb.core :refer [<class]]
[clojure.string :as str]
[reagent.core :as r]))
(def mappings
{:display :h1
:title :h4
:heading :h5
:subtitle :h5
:a :span
:subheading :h3
:body :p})
(defn colors
... | |
36a2fee28100b4e97c7f2e5afd28e4fa190cac545dbebd1f805c339a34f4abf0 | ku-fpg/sunroof-compiler | Selector.hs |
# LANGUAGE ScopedTypeVariables #
-- | 'JSSelector' are used to access fields of Javascript objects.
module Language.Sunroof.Selector
( JSSelector
, label, index
, unboxSelector
, (!)
) where
import Data.String ( IsString(..) )
import Data.Proxy ( Proxy(Proxy) )
import Language.Sunroof.JavaScript ( Expr, E... | null | https://raw.githubusercontent.com/ku-fpg/sunroof-compiler/5d8edafea515c4c2b4e7631799f35d8df977e289/Language/Sunroof/Selector.hs | haskell | | 'JSSelector' are used to access fields of Javascript objects.
| A 'JSSelector' selects a field or attribute from a Javascript object.
The phantom type is the type of the selected value. Note the selected
field or attributes may also array entries ('index').
| Selectors can be created from the name of their a... |
# LANGUAGE ScopedTypeVariables #
module Language.Sunroof.Selector
( JSSelector
, label, index
, unboxSelector
, (!)
) where
import Data.String ( IsString(..) )
import Data.Proxy ( Proxy(Proxy) )
import Language.Sunroof.JavaScript ( Expr, E(Dot), ExprE(ExprE) )
import Language.Sunroof.Classes ( Sunroof(..)... |
6fbfe33a2d29cd048448ce4b7f9a62f68ef7bb233dea129de685dffe6eb9c51b | alex-gutev/cl-environments | util.lisp | ;;;; util.lisp
;;;;
Copyright 2017
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limitation the rights to use,
;;;; copy, mod... | null | https://raw.githubusercontent.com/alex-gutev/cl-environments/0b22154c5afefef23d1eba9a4fae11d73580ef41/src/common/util.lisp | lisp | util.lisp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the follo... | Copyright 2017
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package :cl-environments.util)
(d... |
58cdd084f7ddfc7ee97ab266c342e387d8c3245e6f8ba0c48fb48073637439e7 | fetburner/Coq2SML | retyping.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/pretyping/retyping.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This family of functions assumes i... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Evd... |
99509bbfb8fe0c0c76baccc5372566e2f9eaa9a9a1ec44a7a941d7fd61557c60 | ekmett/ad | Jacobian.hs | # LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
--... | null | https://raw.githubusercontent.com/ekmett/ad/6454d35d1aa6e2af04db9e549146c9cfe8d8bd3b/src/Numeric/AD/Jacobian.hs | haskell | # LANGUAGE Rank2Types #
---------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
---------------------------------------------------------------------------
| 'Jacobian' is useful for defining new AD primitives in a
fairly gener... | # LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
Copyright : ( c ) 201... |
8d5ae2dce7d71886836be3b388b890c05d40285c2cba33a19b063abaa47bd718 | dropbox/datagraph | GraphQLHelpers.hs | module GraphQLHelpers where
import Data.Text (Text)
import GraphQL
class KnownValue v where
encodeKnownValue :: v -> ResolvedValue
instance KnownValue Text where
encodeKnownValue = RScalar . SString
instance KnownValue Int where
encodeKnownValue = RScalar . SInt . fromInteger . toInteger
knownValue :: KnownV... | null | https://raw.githubusercontent.com/dropbox/datagraph/429957ebdbf1ef3553dabb2a8f7b16056ef4ac41/src/GraphQLHelpers.hs | haskell | module GraphQLHelpers where
import Data.Text (Text)
import GraphQL
class KnownValue v where
encodeKnownValue :: v -> ResolvedValue
instance KnownValue Text where
encodeKnownValue = RScalar . SString
instance KnownValue Int where
encodeKnownValue = RScalar . SInt . fromInteger . toInteger
knownValue :: KnownV... | |
243cec383d54d3b6e28da1dafe9d83dabb56ddf4d7cdd25d5cd2949e1d712bbc | freizl/dive-into-haskell | eight-queens.hs | module Main where
type Solution = [Int]
type Column = Int
type Row = Int
type Pos = (Column, Row)
queens :: Int -> [Solution]
queens 0 = [[]]
queens m = [ p ++ [n] | p <- prevs, n <- [1..8], safe p n ]
where prevs = queens (m-1)
| Given a Solution over MxM board , is it safe to place a new one
to ge... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/introduction-to-FP/chapter6/eight-queens.hs | haskell |
| preety print the board
TODO: showing in wrong order (compare the a Solution with string output)
| module Main where
type Solution = [Int]
type Column = Int
type Row = Int
type Pos = (Column, Row)
queens :: Int -> [Solution]
queens 0 = [[]]
queens m = [ p ++ [n] | p <- prevs, n <- [1..8], safe p n ]
where prevs = queens (m-1)
| Given a Solution over MxM board , is it safe to place a new one
to ge... |
771a0f9a74e1a8a4f123aaa1fe02263fb104243d17d5595e3f21b1bcb92a64f8 | ruricolist/serapeum | reader.lisp | (in-package #:serapeum)
(defconst standard-input-syntax-vars
'(*package*
*read-base*
*read-default-float-format*
*read-eval*
*read-suppress*
*readtable*)
"Reader control variables bound by `with-standard-io-syntax'.")
(def standard-input-syntax-values
(with-standard-io-syntax
(mapcar #'s... | null | https://raw.githubusercontent.com/ruricolist/serapeum/d98b4863d7cdcb8a1ed8478cc44ab41bdad5635b/reader.lisp | lisp | (in-package #:serapeum)
(defconst standard-input-syntax-vars
'(*package*
*read-base*
*read-default-float-format*
*read-eval*
*read-suppress*
*readtable*)
"Reader control variables bound by `with-standard-io-syntax'.")
(def standard-input-syntax-values
(with-standard-io-syntax
(mapcar #'s... | |
91ce5f9c54f4f51db7c5934b57de114252b52137a9f07b57a470470db9c032d5 | clj-kondo/clj-kondo | user.clj | (ns user
(:require
[clojure.set :refer :all]
[clojure.string :refer [blank?]]))
| null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/26d59fe3c153a7c756a9f85f60c745bfff09289f/corpus/issue-1366/dir-1/user.clj | clojure | (ns user
(:require
[clojure.set :refer :all]
[clojure.string :refer [blank?]]))
| |
23363fa42efa640af8a39334b0d2fc3c06d31411688e5e64c6301faf5f302f35 | karamellpelle/grid | OutputState.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/source/Game/Run/RunWorld/OutputState.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Game.Run.RunWorld.OutputState
(
#ifdef GR... |
5880e5c155df34d92c6eb3b9ddb1b6f3414c68126957dbfa42e263c0a0ccbe8b | samrushing/irken-tdfa | tdfa.scm | ;; -*- Mode: Irken -*-
(include "nfa.scm")
(include "reorder.scm")
(include "hopcroft.scm")
nfa - target : = { ts =
nfa : = { start = int end = int map=(vector ( list nfa - target ) ) }
;; tag := {tn=int ti=int}
;; substate := {u=int p=int k=(set tag)})
;; superstate := (set substate)
a < substate >... | null | https://raw.githubusercontent.com/samrushing/irken-tdfa/ff56945e371ba7afec884f98a17f291cab083637/tdfa.scm | scheme | -*- Mode: Irken -*-
tag := {tn=int ti=int}
substate := {u=int p=int k=(set tag)})
superstate := (set substate)
u := nfa state number
p := priority
k := tag set (tn.ti := tag-number <tn> with subscript <ti>)
---------------------------------------------------------------------
The following sort functions a... |
(include "nfa.scm")
(include "reorder.scm")
(include "hopcroft.scm")
nfa - target : = { ts =
nfa : = { start = int end = int map=(vector ( list nfa - target ) ) }
a < substate > represents an nfa state :
a < superstate > represents a set of substates , i.e. a dfa state .
(define tag-cmp
{tn=an t... |
807673e44807ae47494606ab866652e13fff42cda21989d39527d6a523f6a254 | rmloveland/geiser-scsh | load.scm | load.scm -- run at geiser - scsh REPL startup
Copyright ( C ) 2013 , 2014 Rich Loveland
;; This program is free software; you can redistribute it and/or
modify it under the terms of the Modified BSD License . You should
;; have received a copy of the license along with this program. If
;; not, see <#5>.
+ + Se... | null | https://raw.githubusercontent.com/rmloveland/geiser-scsh/5f7358c39670305a3048388576977f8a43c8daaa/scheme/scsh/geiser/load.scm | scheme | This program is free software; you can redistribute it and/or
have received a copy of the license along with this program. If
not, see <#5>.
++ Load the geiser packages in the correct (dependency) order.
load.scm ends here | load.scm -- run at geiser - scsh REPL startup
Copyright ( C ) 2013 , 2014 Rich Loveland
modify it under the terms of the Modified BSD License . You should
+ + See geiser-scsh.el for the value of .
(config '(load "=geiser-scsh-dir/interfaces.scm"
"=geiser-scsh-dir/packages.scm"
"=ge... |
cd88bd2e110c23cf9ee35531eb4029739b67d385cfcd2084874b8319a6d95738 | armedbear/abcl | package.lisp | ;;; -*- Mode:Lisp -*-
(in-package :cl-user)
(defpackage :named-readtables-test
(:use :cl :named-readtables)
(:import-from :named-readtables
#:dispatch-macro-char-p
#:do-readtable
#:ensure-function
#:ensure-dispatch-macro-character
#:function=)) | null | https://raw.githubusercontent.com/armedbear/abcl/36a4b5994227d768882ff6458b3df9f79caac664/contrib/named-readtables/test/package.lisp | lisp | -*- Mode:Lisp -*- |
(in-package :cl-user)
(defpackage :named-readtables-test
(:use :cl :named-readtables)
(:import-from :named-readtables
#:dispatch-macro-char-p
#:do-readtable
#:ensure-function
#:ensure-dispatch-macro-character
#:function=)) |
be41ce156eba170dd6d944a253d9d1c85d3f56df1039645662a8d92afd90a9d0 | DYCI2/om-dyci2 | dyci2-utils.lisp | ;;;===================================================
;;;
OM - DYCI2
;;;
;;;===================================================
;
; This program is free software. For information on usage
; and redistribution, see the "LICENSE" file in this distribution.
;
; This program is distributed in the hope that it will... | null | https://raw.githubusercontent.com/DYCI2/om-dyci2/a51e6c51ec60ffabb799c9ee08d2173c30509ac2/om-dyci2/sources/dyci2-utils.lisp | lisp | ===================================================
===================================================
This program is free software. For information on usage
and redistribution, see the "LICENSE" file in this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY... | OM - DYCI2
Authors : / STMS 2018
(in-package :dyci2)
( - ( reduce ' + ( mapcar # ' ( lambda ( seg ) ( - ( nth 2 seg ) ( nth 1 seg ) ) ) ) ) ( * crossface ( 1- ( length sequence ) ) ) )
(defun concat-audiofiles (files &key (sr 44100) (crossfade 0) (out "mix.aiff") (format :wav))
(unless (pathnamep out)
... |
d06d6d9c5ea9e5b81726f83cf32d96e18131ec14107aeee4dd31fef849ccbe31 | thesis/shale | dev.cljs | (ns ^:figwheel-no-load shale.dev
(:require [shale.webapp :as webapp]
[figwheel.client :as figwheel :include-macros true]))
(enable-console-print!)
(figwheel/watch-and-reload
:websocket-url "ws:3449/figwheel-ws"
:jsload-callback webapp/mount-root)
(webapp/init!)
| null | https://raw.githubusercontent.com/thesis/shale/84180532e46ee5d9ee0218138da04ea035bcf7d2/env/dev/cljs/shale/dev.cljs | clojure | (ns ^:figwheel-no-load shale.dev
(:require [shale.webapp :as webapp]
[figwheel.client :as figwheel :include-macros true]))
(enable-console-print!)
(figwheel/watch-and-reload
:websocket-url "ws:3449/figwheel-ws"
:jsload-callback webapp/mount-root)
(webapp/init!)
| |
5eee983b2fc0ba2a5edfe213df0c904864d17a01e7ff7d85c342cb1a397c3a55 | georgjz/raylib-gambit-scheme | main.scm | ;; Simple example of using raylib in Scheme
; (include "raylibbinding/raylib.scm")
;; Some game constants
(define screen-width 800)
(define screen-height 600)
(define CAMERA_PERSPECTIVE 0)
;;; Define a camera
(define camera (make-camera '(10.0 10.0 10.0)
'(0.0 0.0 0.0)
... | null | https://raw.githubusercontent.com/georgjz/raylib-gambit-scheme/df7ea6db54a3196d13c66dac4909c64cea6e5a88/src/main.scm | scheme | Simple example of using raylib in Scheme
(include "raylibbinding/raylib.scm")
Some game constants
Define a camera |
(define screen-width 800)
(define screen-height 600)
(define CAMERA_PERSPECTIVE 0)
(define camera (make-camera '(10.0 10.0 10.0)
'(0.0 0.0 0.0)
'(0.0 1.0 0.0)
45.0
CAMERA_PERSPECTIVE))
(define cube-positio... |
83e7f2486cf485060708c388fc9c9905a372fefc22585c5a25ff38e356093697 | adityaathalye/clojure-by-example | ex07_boldly_go.clj | (ns clojure-by-example.ex07-boldly-go)
EX07 : Lesson Goals
;;
;; - Quickly see how to start and architect your own project.
;; - namespaces, dependencies, project structuring etc...
;;
;; - To be able to run your project as a binary (jar) like this:
;;
;; java -jar ./path/to/the_library_jarfile.jar "arg1" "arg2"... | null | https://raw.githubusercontent.com/adityaathalye/clojure-by-example/5be14f3be0c486a1c1d252d1e018e033789649e0/src/clojure_by_example/ex07_boldly_go.clj | clojure |
- Quickly see how to start and architect your own project.
- namespaces, dependencies, project structuring etc...
- To be able to run your project as a binary (jar) like this:
java -jar ./path/to/the_library_jarfile.jar "arg1" "arg2" "arg3"
- Let's turn code from ex06 into a library for planetary exploration... | (ns clojure-by-example.ex07-boldly-go)
EX07 : Lesson Goals
Your First Clojure Library
mkdir src / planet_coloniser / utils
- right - click on src / planet_coloniser , and create new folder
* Inside this new ` utils ` directory , create two new files :
and create New File from the pop - up m... |
552b851377011f64a57d9e96245294e0c0530372e5770bd374afec76232cfb14 | nikodemus/SBCL | thread.lisp | ;;;; support for threads needed at cross-compile time
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the p... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/src/code/thread.lisp | lisp | support for threads needed at cross-compile time
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
This is about the only use for which a stale value of owner is
sufficient.
SPINLOCK no long... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!THREAD")
(eval-when (:compile-toplevel :load-toplevel :execute)
(sb!xc:proclaim '(sb!ext:always-bound *cur... |
71cdc478590a5b18ac7993e8b6cd23e4967dea41d9435ada4f99caadb5ff7621 | Cantido/horizons | transform_test.clj | (ns horizons.parsing.transform-test
(:require
[clojure.test :refer :all]
[clojure.java.io :as io]
[instaparse.transform :as it]
[horizons.parsing.transform :refer :all])
(:import (org.joda.time Years Duration)))
(defn get-file [name]
(slurp
(io/file
(io/resource name))))
(defn get-edn ... | null | https://raw.githubusercontent.com/Cantido/horizons/989e0964d5eebb82c3968049ffd05649625bc25d/test/horizons/parsing/transform_test.clj | clojure | (ns horizons.parsing.transform-test
(:require
[clojure.test :refer :all]
[clojure.java.io :as io]
[instaparse.transform :as it]
[horizons.parsing.transform :refer :all])
(:import (org.joda.time Years Duration)))
(defn get-file [name]
(slurp
(io/file
(io/resource name))))
(defn get-edn ... | |
59519e2c48b500638b0e2e17ca0827f780205786969c3fa36cb24094ae18134d | jeapostrophe/automata | re-test.rkt | #lang racket
(require automata/machine
automata/re
automata/re-ext
tests/eli-tester)
(define-syntax-rule (test-re* R (succ ...) (fail ...))
(let ()
(define r (re R))
(test #:failure-prefix (format "~s" 'R)
(test
(machine-accepts? r succ) ...
(not (ma... | null | https://raw.githubusercontent.com/jeapostrophe/automata/6abe851b83b18fcdcb8f2b19ab87cdabc90c71ce/automata-test/tests/re-test.rkt | racket | This is correct, because the complement machine | #lang racket
(require automata/machine
automata/re
automata/re-ext
tests/eli-tester)
(define-syntax-rule (test-re* R (succ ...) (fail ...))
(let ()
(define r (re R))
(test #:failure-prefix (format "~s" 'R)
(test
(machine-accepts? r succ) ...
(not (ma... |
dbc39c96d53ae2b174f93df000f7821a637d15c66a297bb911c3155a811f2460 | yav/type-nat-solver | Examples.hs | {-# OPTIONS_GHC -fplugin=TypeNatSolver #-}
# LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
module Examples where
import GHC.TypeLits
import Data.Proxy
data UNat :: Nat -> * where
Zero :: UNat 0
Succ :: UNat n -> UNat (n + 1)
uAdd :: U... | null | https://raw.githubusercontent.com/yav/type-nat-solver/4218b52e1f70df152daa7fc62f7f1c2ef67b60a1/docs/Examples.hs | haskell | # OPTIONS_GHC -fplugin=TypeNatSolver #
# LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE KindSignatures #
module Examples where
import GHC.TypeLits
import Data.Proxy
data UNat :: Nat -> * where
Zero :: UNat 0
Succ :: UNat n -> UNat (n + 1)
uAdd :: UNat m -> UNat n -> UNat (m + n)
uAdd Zero x = x
uAdd (Succ x)... |
5a5139d650c5dfe3ffa0f434c1eddf391f7d34bf3675b69c9970ba7e5aeee095 | alexandergunnarson/quantum | temperature.cljc | (ns quantum.measure.temperature
(:require
[quantum.measure.core :refer [defunits-of]]))
#_(defunits-of temperature [:kelvin #{:K}]
1|273.16 of the thermodynamic temperature of the triple
;; point of water
:celsius {:scale 1 :offset 273.15}
:fahrenheit {:scale 5/9 :offset 255.37})
#?(:clj (set! *unc... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/measure/temperature.cljc | clojure | point of water | (ns quantum.measure.temperature
(:require
[quantum.measure.core :refer [defunits-of]]))
#_(defunits-of temperature [:kelvin #{:K}]
1|273.16 of the thermodynamic temperature of the triple
:celsius {:scale 1 :offset 273.15}
:fahrenheit {:scale 5/9 :offset 255.37})
#?(:clj (set! *unchecked-math* :warn-o... |
34f361f4dd3f06f1f8b91aacfc0bd31ee1028a58fcc740930fef58fc43a74b0f | odis-labs/onix | Onix_lock_json.ml | open Onix_core
let gen ~lock_file_path (lock_file : Lock_file.t) =
Onix_core.Utils.Out_channel.with_open_text lock_file_path (fun chan ->
let out = Format.formatter_of_out_channel chan in
Fmt.pf out "%a" Pp.pp lock_file);
Logs.info (fun log -> log "Created a lock file at %S." lock_file_path)
module P... | null | https://raw.githubusercontent.com/odis-labs/onix/81cc82953ef062425656ac9bf80474f2ce642f5b/src/onix_lock_json/Onix_lock_json.ml | ocaml | open Onix_core
let gen ~lock_file_path (lock_file : Lock_file.t) =
Onix_core.Utils.Out_channel.with_open_text lock_file_path (fun chan ->
let out = Format.formatter_of_out_channel chan in
Fmt.pf out "%a" Pp.pp lock_file);
Logs.info (fun log -> log "Created a lock file at %S." lock_file_path)
module P... | |
8e061017da6a2402d922d75489b05952842c5f7fc55f5a86b3877c94856d7705 | morpheusgraphql/morpheus-graphql | NamedResolvers.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
module NamedResolvers
( runNamedResolversTest,
)
where
import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Morpheus.App
( App (..),
mkApp,
runApp,
)
import Data.Morpheus.App.Internal.Resolving (resultOr)
import Data.Morpheus.... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/2b2eb76e4cf9e9ed07b8cf65d6987af252aecdee/morpheus-graphql-app/test/NamedResolvers.hs | haskell | # LANGUAGE OverloadedStrings #
DEITIES
REALMS | # LANGUAGE NoImplicitPrelude #
module NamedResolvers
( runNamedResolversTest,
)
where
import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Morpheus.App
( App (..),
mkApp,
runApp,
)
import Data.Morpheus.App.Internal.Resolving (resultOr)
import Data.Morpheus.App.NamedResolvers
( NamedResolve... |
0131ba1e3495d2d24b576669b5aca4ed147b76afb4fa9b7d2f0519eb2d99d9bb | sbcl/sbcl | misc-aliens.lisp | ;;;; assorted alien definitions
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;... | null | https://raw.githubusercontent.com/sbcl/sbcl/4154e8d5e7b6054305b596975436b05a17653d3c/src/code/misc-aliens.lisp | lisp | assorted alien definitions
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Declare each of the free space pointers (except dynamic) as an alien var
Maybe this whole file should go in sb-ker... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-IMPL")
with , READ - ONLY - SPACE - START is a constant from genesis
#-darwin-jit
(define-alien-variabl... |
506743cdf2a9cbde1999267b3c16151aa06bb0a2a8f4c5d4907720d5954c2feb | racket/math | number-theory-tests.rkt | #lang typed/racket
(require math/number-theory)
(require typed/rackunit)
; "quadratic.rkt"
(check-equal? (complex-quadratic-solutions 1 0 -4) '(-2 2))
(check-equal? (complex-quadratic-solutions 1 0 +4) '(0-2i 0+2i))
(check-equal? (complex-quadratic-solutions 1 0 0) '(0))
(check-equal? (quadratic-solutions 1 0 -4) '(-... | null | https://raw.githubusercontent.com/racket/math/eebe46aea19eb435b5de023fac248e05321760c5/math-test/math/tests/number-theory-tests.rkt | racket | "quadratic.rkt"
"eulerian-number.rkt"
"primitive-roots.rkt"
"polygonal.rkt"
"fibonacci.rkt"
"partitions.rkt"
"bernoulli.rkt"
"tangent-number.rkt"
"factorial.rkt"
"binomial.rkt"
"number-theory.rkt"
PowerMod[3,-2,47]
PowerMod[3,-4,47]
"quadratic-residues.rkt" | #lang typed/racket
(require math/number-theory)
(require typed/rackunit)
(check-equal? (complex-quadratic-solutions 1 0 -4) '(-2 2))
(check-equal? (complex-quadratic-solutions 1 0 +4) '(0-2i 0+2i))
(check-equal? (complex-quadratic-solutions 1 0 0) '(0))
(check-equal? (quadratic-solutions 1 0 -4) '(-2 2))
(check-equal... |
f2b34863dcf50bfb291fd8d98285c330d6fa6c793105c06393be5204b0d3a657 | buntine/Simply-Scheme-Exercises | 17-5.scm | Here 's a procedure that takes two numbers as arguments and returns whichever
; number is larger:
;
; (define (max2 a b)
; (if (> b a) b a))
;
Use max2 to implement , a procedure that takes one or more numeric arguments
; and returns the largest of them.
(define (max2 a b)
(if (> b a) b a))
(define (maxxx n ... | null | https://raw.githubusercontent.com/buntine/Simply-Scheme-Exercises/c6cbf0bd60d6385b506b8df94c348ac5edc7f646/17-lists/17-5.scm | scheme | number is larger:
(define (max2 a b)
(if (> b a) b a))
and returns the largest of them. | Here 's a procedure that takes two numbers as arguments and returns whichever
Use max2 to implement , a procedure that takes one or more numeric arguments
(define (max2 a b)
(if (> b a) b a))
(define (maxxx n . the-rest)
(if (null? the-rest)
n
(apply maxxx
(cons (max2 n (car the-rest))
... |
2baade642e9d84f46fae967253d097e1c7153835bc21d9e8e53a33ea497a8e86 | skrah/minicaml | test48.ml | Example from 's " Modern Compiler Implementation in ML " , translated
to .
to Caml. *)
let g : int -> int = fun (a : int) -> a
type t = int
let g a = a
| null | https://raw.githubusercontent.com/skrah/minicaml/e5f5cad7fdbcfc11561f717042fae73fa743823f/test/test48.ml | ocaml | Example from 's " Modern Compiler Implementation in ML " , translated
to .
to Caml. *)
let g : int -> int = fun (a : int) -> a
type t = int
let g a = a
| |
1200a29e88d1aec0aa10a6054928673174ce66840654ae53db393de8358f585a | dyzsr/ocaml-selectml | pr10735.ml | (* TEST
* expect
*)
module X : sig
type 'a t
end = struct
type 'a t
end
type 'a t
type (_,_) eq = Refl : ('a,'a) eq
[%%expect{|
module X : sig type 'a t end
type 'a t
type (_, _) eq = Refl : ('a, 'a) eq
|}]
let () =
let (Refl : (bool X.t, bool t) eq) as t = Obj.magic () in ()
[%%expect{|
Line 2, character... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-gadts/pr10735.ml | ocaml | TEST
* expect
|
module X : sig
type 'a t
end = struct
type 'a t
end
type 'a t
type (_,_) eq = Refl : ('a,'a) eq
[%%expect{|
module X : sig type 'a t end
type 'a t
type (_, _) eq = Refl : ('a, 'a) eq
|}]
let () =
let (Refl : (bool X.t, bool t) eq) as t = Obj.magic () in ()
[%%expect{|
Line 2, characters 7-11:
2 | let (Refl... |
333c8a2e1aa9e1e39e9f6dde2ac798c7690c516702e4ceddabbfbe6686a7427b | aiya000/haskell-examples | backtrack.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ViewPatterns #
import Control.Applicative ((<|>))
import Data.ByteString (ByteString)
import Data.Text (Text)
import Text.Trifecta.Delta (delta)
import Text.Trifecta.Parser (Parser, parseString)
import Text.Trifecta.Result (Result(..), ErrInfo(..))
import qualified Data.Te... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Text/Trifecta/backtrack.hs | haskell | # LANGUAGE OverloadedStrings #
{output}
Left "[Columns 1 1]"
Left "[Columns 1 1]"
Right "xyz" | # LANGUAGE ViewPatterns #
import Control.Applicative ((<|>))
import Data.ByteString (ByteString)
import Data.Text (Text)
import Text.Trifecta.Delta (delta)
import Text.Trifecta.Parser (Parser, parseString)
import Text.Trifecta.Result (Result(..), ErrInfo(..))
import qualified Data.Text as T
import qualified Text.Parse... |
9a48732513d34286b4cfb23bb08ef46f81f4c85573583af398db744b00d9d26a | clojure-interop/aws-api | AmazonFSxClient.clj | (ns com.amazonaws.services.fsx.AmazonFSxClient
"Client for accessing Amazon FSx. All service calls made using this client are blocking, and will not return until the
service call completes.
Amazon FSx is a fully managed service that makes it easy for storage and application administrators to launch and use
sh... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.fsx/src/com/amazonaws/services/fsx/AmazonFSxClient.clj | clojure | (ns com.amazonaws.services.fsx.AmazonFSxClient
"Client for accessing Amazon FSx. All service calls made using this client are blocking, and will not return until the
service call completes.
Amazon FSx is a fully managed service that makes it easy for storage and application administrators to launch and use
sh... | |
cbe104770a1465c155c5f0f8bd7e4999bcd0812b612f3aaf4415d1a24f3b971d | input-output-hk/cardano-sl | Generator.hs | {-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Infrastructure.Generator
( GeneratorModel
, genChainUsingModel
, simpleModel
, simpleGen
, simpleParams
, seeds
, mInCommitmentPhase
, chainAddresses
) where
import Universum hiding ((^.))
import Control... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/node/test/Infrastructure/Generator.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
| TODO: if this is what we want it would be better to use smart
constructors to make sure the set of bootstrapStakeholders is a subset of
all addresses.
| Generate an abstract chain using the generator model passed as parameter.
TODO: QUESTION: what pro... | module Infrastructure.Generator
( GeneratorModel
, genChainUsingModel
, simpleModel
, simpleGen
, simpleParams
, seeds
, mInCommitmentPhase
, chainAddresses
) where
import Universum hiding ((^.))
import Control.Lens (to, (^.))
import Control.Monad.Except (ExceptT (Excep... |
591bb4b3e8e7c59b0d432cb08a93f8b7bec48d5553bbe6494684d6931b5f47a2 | reborg/clojure-essential-reference | 3.clj | < 1 >
< 2 >
" Why was 6 afraid of 7 ? Because 7 ate 9 . " | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/StringsandRegularExpressions/replace%2Creplace-first%2Cre-quote-replacement/3.clj | clojure | < 1 >
< 2 >
" Why was 6 afraid of 7 ? Because 7 ate 9 . " | |
9f901b48a4bc254a4897f875bc505c22ebbc5c7d8cf286fd04e6ab81726bd4aa | runtimeverification/haskell-backend | Data.hs | |
Module : Kore . Repl . Data
Description : REPL data structures .
Copyright : ( c ) Runtime Verification , 2019 - 2021
License : BSD-3 - Clause
Maintainer :
Module : Kore.Repl.Data
Description : REPL data structures.
Copyright : (c) Runtime Verification, 2019-2021
License : BS... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/4e9b76ab1f8bd35aabe64e0b0c51ee7d1e243327/kore/src/Kore/Repl/Data.hs | haskell | | Represents an optional file name which contains a sequence of
repl commands.
| Option for viewing the full (expanded) graph
or the collapsed graph where only the branching nodes,
their direct descendents and leafs are visible
| Log options which can be changed by the log command.
is changed, so that this fun... | |
Module : Kore . Repl . Data
Description : REPL data structures .
Copyright : ( c ) Runtime Verification , 2019 - 2021
License : BSD-3 - Clause
Maintainer :
Module : Kore.Repl.Data
Description : REPL data structures.
Copyright : (c) Runtime Verification, 2019-2021
License : BS... |
e9e456f0285eb6e0367756c9adb5fe240c5be9619610a743657f08df7402981b | RailsOnLisp/rol-server | templates.lisp | ;;
RoL - server - Rails on Lisp application server
;;
Copyright 2012 - 2015 < >
;;
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission notice appear in all copies.
;;
... | null | https://raw.githubusercontent.com/RailsOnLisp/rol-server/2cbe4f9f4a682a006ea5b46503c09ad49b833bf6/templates.lisp | lisp |
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO... | RoL - server - Rails on Lisp application server
Copyright 2012 - 2015 < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
(... |
ee7698f4dba1eb828d88375e0b75e6709f9bbdf7f5a7708ae494e5770cc1bea9 | ruuvi/ruuvitracker_server | tracker_api.clj | (ns ruuvi-server.tracker-api
(:require [ruuvi-server.tracker-security :as sec]
[ruuvi-server.parse :as parse]
[ruuvi-server.database.event-dao :as db]
[ruuvi-server.configuration :as conf]
[ruuvi-server.websocket-api :as websocket]
[ruuvi-server.message :as ... | null | https://raw.githubusercontent.com/ruuvi/ruuvitracker_server/269041aa2ff450c0f35183de0264d82a5c3881f1/src/ruuvi_server/tracker_api.clj | clojure | use (error) to printStackTrace
higher levels do not affect anything here | (ns ruuvi-server.tracker-api
(:require [ruuvi-server.tracker-security :as sec]
[ruuvi-server.parse :as parse]
[ruuvi-server.database.event-dao :as db]
[ruuvi-server.configuration :as conf]
[ruuvi-server.websocket-api :as websocket]
[ruuvi-server.message :as ... |
dccc8b462069a6bbc3ac665ba627e7d3093943e0744447b831b0e0115b68b43a | auser/hermes | thrift_file_transport.erl | -module(thrift_file_transport).
-author().
-behaviour(thrift_transport).
-export([new_reader/1,
new/1,
new/2,
write/2, read/2, flush/1, close/1]).
-record(t_file_transport, {device,
should_close = true,
mode = write}).
%%%% CONSTRUCTIO... | null | https://raw.githubusercontent.com/auser/hermes/32741eb75398ebbcbf640e2c73dfd2a54f0d1241/deps/thrift/src/thrift_file_transport.erl | erlang | CONSTRUCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Device :: io_device()
Device should be opened in raw and binary mode.
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % | -module(thrift_file_transport).
-author().
-behaviour(thrift_transport).
-export([new_reader/1,
new/1,
new/2,
write/2, read/2, flush/1, close/1]).
-record(t_file_transport, {device,
should_close = true,
mode = write}).
new_reader(File... |
d446b77dbcc47c27c2dbb85687c9e0289cfdc099a1bf99e58c3fa70c2d1167b5 | LightTable/fetch | core.cljs | (ns fetch.core
(:require [clojure.string :as string]
[clojure.browser.net :as net]
[clojure.browser.event :as event]
[cljs.reader :as reader]
[goog.Uri.QueryData :as query-data]
[goog.structs :as structs]))
(defn ->method [m]
(string/upper-case (name m)))... | null | https://raw.githubusercontent.com/LightTable/fetch/ec9ccb95665c6f267fc13af2f3083c5d452a8ce3/src/fetch/core.cljs | clojure | (ns fetch.core
(:require [clojure.string :as string]
[clojure.browser.net :as net]
[clojure.browser.event :as event]
[cljs.reader :as reader]
[goog.Uri.QueryData :as query-data]
[goog.structs :as structs]))
(defn ->method [m]
(string/upper-case (name m)))... | |
575c8de1a991f13f0f2215f3a894f8c3dba145f13b6f1901cd99fbd86d403b60 | dselsam/arc | Map.hs | Copyright ( c ) 2020 Microsoft Corporation . All rights reserved .
Released under Apache 2.0 license as described in the file LICENSE .
Authors : , , .
# LANGUAGE ScopedTypeVariables #
module Util.Map where
import Util.Imports
import qualified Util.Int as Int
import qualified Data.Map as Map
import qualif... | null | https://raw.githubusercontent.com/dselsam/arc/7e68a7ed9508bf26926b0f68336db05505f4e765/src/Util/Map.hs | haskell | Copyright ( c ) 2020 Microsoft Corporation . All rights reserved .
Released under Apache 2.0 license as described in the file LICENSE .
Authors : , , .
# LANGUAGE ScopedTypeVariables #
module Util.Map where
import Util.Imports
import qualified Util.Int as Int
import qualified Data.Map as Map
import qualif... | |
4193fa2f1a0245ef86a76c18124893eba09a281beb430e8284d307d4e60aeaa0 | kupl/MicSE | refute.mli | Refute : Naïve refuter for bug finding
exception RftError of string
(******************************************************************************)
(******************************************************************************)
Common
(****************... | null | https://raw.githubusercontent.com/kupl/MicSE/e7ac1db2ca7b8736eeacf1448d29177bc0c61200/lib/refute.mli | ocaml | ****************************************************************************
****************************************************************************
****************************************************************************
****************************************************************************
Set of MSta... | Refute : Naïve refuter for bug finding
exception RftError of string
Common
module MSSet : module type of Core.Set.Make (MState)
Map of
module MCIMap : module type of Core.Map.Make (Tz.MichCutInfo_cmp)
Map of Tz.r_mich_cut_info
module RMCIMap : mo... |
fc1ed4d5b7f078b97852e0d872bfb443e43f14839ae28cf48f98cb8bd8ce538f | ajtulloch/dnngraph | Codegen.hs | {-# LANGUAGE DeriveFunctor #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module NN.Backend.Torch.Codegen where
import Control.Applicative
import Control.Lens hiding (assign)
import ... | null | https://raw.githubusercontent.com/ajtulloch/dnngraph/152f45780f3c4e9204cf4e129017df4394df662c/NN/Backend/Torch/Codegen.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell # | # LANGUAGE GeneralizedNewtypeDeriving #
module NN.Backend.Torch.Codegen where
import Control.Applicative
import Control.Lens hiding (assign)
import Control.Monad.State.Strict
import qualified Data.Foldable as F
import Data.Monoid
import Gen.C... |
f31c03245a5347b4bfe7cea99cdab61a4ecaa10d46eeae172f747054c0920606 | replikativ/replikativ | cdvcs_test.clj | (ns replikativ.cdvcs-test
(:require [clojure.test :refer :all]
[replikativ.environ :refer [*id-fn* *date-fn*]]
[replikativ.crdt.cdvcs.core :as cdvcs]
[replikativ.crdt.cdvcs.meta :as meta]
[replikativ.crdt.cdvcs.stage :as s]))
[[:chapter {:tag "metadata" :title "CDVCS m... | null | https://raw.githubusercontent.com/replikativ/replikativ/1533a7e43e46bfb70e8c8eb34dc5708e611a478d/test/replikativ/cdvcs_test.clj | clojure | only new keys (commits) can be added => (merge new-value value)
keys: G-SET
parental values don't change
keys: G-SET
values: similar to OR-SET,
heads cannot become empty
new metadata information:
new metadata information:
new metadata information:
actually uuids pointing to fn and params
normally singular, w... | (ns replikativ.cdvcs-test
(:require [clojure.test :refer :all]
[replikativ.environ :refer [*id-fn* *date-fn*]]
[replikativ.crdt.cdvcs.core :as cdvcs]
[replikativ.crdt.cdvcs.meta :as meta]
[replikativ.crdt.cdvcs.stage :as s]))
[[:chapter {:tag "metadata" :title "CDVCS m... |
287b6a910751f5b7c13f8fe9ae8e49ea232d0b5acd33ff52dfd77cdb59100355 | cbaggers/glsl-spec | docs.variables.lisp | (in-package :glsl-docs)
(defvar *variables* (make-hash-table))
(setf (gethash 'gl-clip-distance *variables*)
"Name
gl_ClipDistance — provides a forward-compatible mechanism for vertex clipping
Declaration
gl_ClipDistance is a member of the gl_PerVertex named block:
out gl_PerVertex {
vec4 gl_Position;... | null | https://raw.githubusercontent.com/cbaggers/glsl-spec/f04476f7da89355ae6856b33283c60ba95c6555d/docs/docs.variables.lisp | lisp |
if the size does not include
| (in-package :glsl-docs)
(defvar *variables* (make-hash-table))
(setf (gethash 'gl-clip-distance *variables*)
"Name
gl_ClipDistance — provides a forward-compatible mechanism for vertex clipping
Declaration
gl_ClipDistance is a member of the gl_PerVertex named block:
out gl_PerVertex {
In fragment shaders, it ... |
0eb0234b2a1c5d71e3eb1357026d492ab99c82b81461e91ab7cb317cf2bba575 | ocaml-multicore/reagents | lock_stack.ml |
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND T... | null | https://raw.githubusercontent.com/ocaml-multicore/reagents/6721db78b21028c807fb13d0af0aaf9407c662b5/tests/references/lock_stack.ml | ocaml |
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND T... | |
4888003af595b0e5bed17fe39506df85f4943618b7d428d8a46bfb4be969d5d2 | ocaml-multicore/parafuzz | nested.ml | (* TEST *)
(* Mantis PR7447 *)
let rec r = (let rec x = `A r and y = fun () -> x in y)
let (`A x) = r ()
let _ = x ()
| null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/letrec-compilation/nested.ml | ocaml | TEST
Mantis PR7447 |
let rec r = (let rec x = `A r and y = fun () -> x in y)
let (`A x) = r ()
let _ = x ()
|
8f2fbc55824266e86b35a10c088107bee668efc1bb963f37b35c7be03ca613f2 | helium/helium-packet-router | hpr_skf.erl | -module(hpr_skf).
-include("../autogen/iot_config_pb.hrl").
-export([
oui/1,
devaddr/1,
session_key/1
]).
-ifdef(TEST).
-export([test_new/1]).
-endif.
-type skf() :: #iot_config_session_key_filter_v1_pb{}.
-export_type([skf/0]).
-spec oui(SessionKeyFilter :: skf()) -> non_neg_integer().
oui(SessionK... | null | https://raw.githubusercontent.com/helium/helium-packet-router/110d069310a54f6ec6d82af6b556b1afef5957c5/src/grpc/iot_config/hpr_skf.erl | erlang | ------------------------------------------------------------------
Tests Functions
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------ | -module(hpr_skf).
-include("../autogen/iot_config_pb.hrl").
-export([
oui/1,
devaddr/1,
session_key/1
]).
-ifdef(TEST).
-export([test_new/1]).
-endif.
-type skf() :: #iot_config_session_key_filter_v1_pb{}.
-export_type([skf/0]).
-spec oui(SessionKeyFilter :: skf()) -> non_neg_integer().
oui(SessionK... |
676dac40a2d1d4a8c5b197c839ea5832e8581cce66f3766ab23ee72c6417bf50 | ninenines/cowboy | ws_max_frame_size.erl | -module(ws_max_frame_size).
-export([init/2]).
-export([websocket_handle/2]).
-export([websocket_info/2]).
init(Req, State) ->
{cowboy_websocket, Req, State, #{max_frame_size => 8}}.
websocket_handle({text, Data}, State) ->
{[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
{[{binary, Data}], Sta... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/ws_SUITE_data/ws_max_frame_size.erl | erlang | -module(ws_max_frame_size).
-export([init/2]).
-export([websocket_handle/2]).
-export([websocket_info/2]).
init(Req, State) ->
{cowboy_websocket, Req, State, #{max_frame_size => 8}}.
websocket_handle({text, Data}, State) ->
{[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
{[{binary, Data}], Sta... | |
173d4444eab43da4909c0e38e70e0ed1666bc700ed2a6fe49d57f341e0105d94 | lisp-mirror/clpm | clpi.lisp | ;;;; CLPI sources
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
;; * define-package
(uiop:define-package #:clpm/sources/clpi
(:use #:cl
#:alexandria
#:anaphora
#:clpm/cache
#:clpm/config
#:clp... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/clpm/sources/clpi.lisp | lisp | CLPI sources
LICENSE for license information.
* define-package
* Source
* Project
* Release
* System
* System file
* System release | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/sources/clpi
(:use #:cl
#:alexandria
#:anaphora
#:clpm/cache
#:clpm/config
#:clpm/data
#:clpm/http-client
#:clpm/install/defs
#:clp... |
d7910ca03659f61f8146f657ee10421b4ab456dd21e3cb9fd7907c81267596da | roburio/caldav | webdav_fs.ml | type file = [ `File of string list ]
type dir = [ `Dir of string list ]
type file_or_dir = [ file | dir ]
module type S =
sig
val (>>==) : ('a, 'b) result Lwt.t -> ('a -> ('c, 'b) result Lwt.t) -> ('c, 'b) result Lwt.t
type t
type error
type write_error
val basename : file_or_dir -> string
val cre... | null | https://raw.githubusercontent.com/roburio/caldav/3914aef28175f22983772b67be3d366a9d2d9e4e/src/webdav_fs.ml | ocaml | TODO: no handling of .. done here yet
TODO `File is wrong here, we're here to figure out whether it is a file or directory
no file without a name
Error e
Error e
careful: unsafe_find, unsafe_add | type file = [ `File of string list ]
type dir = [ `Dir of string list ]
type file_or_dir = [ file | dir ]
module type S =
sig
val (>>==) : ('a, 'b) result Lwt.t -> ('a -> ('c, 'b) result Lwt.t) -> ('c, 'b) result Lwt.t
type t
type error
type write_error
val basename : file_or_dir -> string
val cre... |
d04537b5eca252f1cf16c9f60437e7c6754a6c2cd16d30d403c7d6e70e77c6f9 | plumatic/grab-bag | auth.clj | (ns plumbing.auth
(:use plumbing.core)
(:require
[clojure.string :as str]
[schema.core :as s]
[plumbing.serialize :as serialize]
[plumbing.new-time :as new-time])
(:import
[javax.crypto Mac SecretKey SecretKeyFactory]
[javax.crypto.spec SecretKeySpec PBEKeySpec]
[org.apache.commons.codec.bina... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/plumbing/src/plumbing/auth.clj | clojure |
Private
Public
encryption, currently used for securely storing session info in cookie | (ns plumbing.auth
(:use plumbing.core)
(:require
[clojure.string :as str]
[schema.core :as s]
[plumbing.serialize :as serialize]
[plumbing.new-time :as new-time])
(:import
[javax.crypto Mac SecretKey SecretKeyFactory]
[javax.crypto.spec SecretKeySpec PBEKeySpec]
[org.apache.commons.codec.bina... |
c2f234251bb2c6f901706a780d912da83efdf055a6cc95e447480781c2de556f | zeniuseducation/poly-euler | p98.clj | (ns clein.p98)
(set! *unchecked-math* false)
(defn ^boolean psqr?
[p]
(let [ck (Math/sqrt p)]
(= (Math/floor ck) (Math/ceil ck))))
(defn ^long isqrt
[^long n]
(int (Math/ceil (Math/sqrt n))))
(defn pitas
[^long n]
(loop [i (int n) ires (int 0)]
(if (>= i (* 2 n))
ires
(let [is (+ (* ... | null | https://raw.githubusercontent.com/zeniuseducation/poly-euler/734fdcf1ddd096a8730600b684bf7398d071d499/clein/src/clein/p98.clj | clojure | (ns clein.p98)
(set! *unchecked-math* false)
(defn ^boolean psqr?
[p]
(let [ck (Math/sqrt p)]
(= (Math/floor ck) (Math/ceil ck))))
(defn ^long isqrt
[^long n]
(int (Math/ceil (Math/sqrt n))))
(defn pitas
[^long n]
(loop [i (int n) ires (int 0)]
(if (>= i (* 2 n))
ires
(let [is (+ (* ... | |
acebe23eb49f0762c561b26d9b20deebf5ae98f8f97442abae7e7c9cc7ac00d6 | tezos/tezos-mirror | node_wrapper.ml | let code_for_lib = function
| "hacl-wasm" ->
{|
(function () {
/* We have to cheat to avoid the noise from hacl-wasm */
var old_log = console.log;
console.log = function () {};
var loader = require('hacl-wasm');
console.log = old_log;
return loader.getInitializedHaclModule().then(function(loaded){
... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/f7bdde9d56c8a8e080d1b3f77c5dc2b9d469429a/src/tooling/node_wrapper.ml | ocaml | let code_for_lib = function
| "hacl-wasm" ->
{|
(function () {
/* We have to cheat to avoid the noise from hacl-wasm */
var old_log = console.log;
console.log = function () {};
var loader = require('hacl-wasm');
console.log = old_log;
return loader.getInitializedHaclModule().then(function(loaded){
... | |
406188a256d93638754c91d9a64f87eed4121ad068c16fcecd55c7e3e090ea70 | esl/erlang-web | e_user_annotation.erl | The contents of this file are subject to the Erlang Web Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
Erlang Web Public License along with this software . If not , it can be
%% retrieved via the world... | null | https://raw.githubusercontent.com/esl/erlang-web/2e5c2c9725465fc5b522250c305a9d553b3b8243/lib/eptic-1.4.1/src/e_user_annotation.erl | erlang | compliance with the License. You should have received a copy of the
retrieved via the world wide web at -consulting.com/.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
---------------------------------... | The contents of this file are subject to the Erlang Web Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
Erlang Web Public License along with this software . If not , it can be
Software distributed under the License is distributed on an " AS IS "
The Initial Developer o... |
236f95e61503fc68792aac764c13e956570d26caf1c58f3ce3d26dc13b8ba9b5 | bnoordhuis/chicken-core | path-tests.scm | (use files)
(define-syntax test
(syntax-rules ()
((_ r x) (let ((y x)) (print y) (assert (equal? r y))))))
(test "/" (pathname-directory "/"))
(test "/" (pathname-directory "/abc"))
(test "abc" (pathname-directory "abc/"))
(test "abc" (pathname-directory "abc/def"))
(test "abc" (pathname-directory "abc/def.ghi"... | null | https://raw.githubusercontent.com/bnoordhuis/chicken-core/56d30e3be095b6abe1bddcfe10505fa726a43bb5/tests/path-tests.scm | scheme | (use files)
(define-syntax test
(syntax-rules ()
((_ r x) (let ((y x)) (print y) (assert (equal? r y))))))
(test "/" (pathname-directory "/"))
(test "/" (pathname-directory "/abc"))
(test "abc" (pathname-directory "abc/"))
(test "abc" (pathname-directory "abc/def"))
(test "abc" (pathname-directory "abc/def.ghi"... | |
8b87294af2dfc52a6ba8c854bfaa6d685cf7dceecef2e0840e2b2b9b0f216208 | RyanGlScott/th-lift | Internal.hs | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
#if __GLASGOW_HASKELL__ >= 706
# LANGUAGE PolyKinds #
#endif
| Helper functions used in code that " Language . Haskell . TH.Lift " generates .
--
-- Note: this is an internal module, and as such, the API presented here is not
-- guaranteed to be stable, even between... | null | https://raw.githubusercontent.com/RyanGlScott/th-lift/1aef38766820e8264684db33f39c5f0132b77793/src/Language/Haskell/TH/Lift/Internal.hs | haskell |
Note: this is an internal module, and as such, the API presented here is not
guaranteed to be stable, even between minor releases of this library.
| A type-restricted version of 'error' that ensures 'makeLift' always
even when used on an empty datatype.
@th-compat@ library, which has been copied here to avoid inc... | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
#if __GLASGOW_HASKELL__ >= 706
# LANGUAGE PolyKinds #
#endif
| Helper functions used in code that " Language . Haskell . TH.Lift " generates .
module Language.Haskell.TH.Lift.Internal where
#if MIN_VERSION_template_haskell(2,16,0)
import GHC.Exts (RuntimeRep, TYPE)... |
f05d8bc54f7bc0c7bf2a2782452dcd1a73e602c1d37be0c6d2b5aff43b96b6a1 | alpheccar/HPDF | Pattern.hs | ---------------------------------------------------------
-- |
Copyright : ( c ) 2006 - 2016 , alpheccar.org
-- License : BSD-style
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- PDF Patterns
---------------------------------------------------------
module Graphics.PDF.Patt... | null | https://raw.githubusercontent.com/alpheccar/HPDF/5a901376470b549b2354cdd8013e655f7ac19e0b/Graphics/PDF/Pattern.hs | haskell | -------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : experimental
Portability : portable
PDF Patterns
-------------------------------------------------------
* Pattern
| Tiling type
| Create a colored tiling pattern
^ Left
^ Bottom
^ Right
^ Top
... | Copyright : ( c ) 2006 - 2016 , alpheccar.org
module Graphics.PDF.Pattern(
TilingType(..)
, PDFColoredPattern
, PDFUncoloredPattern
, createColoredTiling
, createUncoloredTiling
, setColoredFillPattern
, setColoredStrokePattern
, setUncoloredFillPattern
, setUncoloredStrokePattern
) where
im... |
021499060e2fd44fad89e050164063b531ba55167731f9768c48091b93a9a839 | abooij/haskell-xkbcommon | bench-key-proc.hs | import Data.Maybe
import qualified Data.Vector.Unboxed as V
import Control.Monad
import System.Random
import Data.Time.Clock
import Text.XkbCommon
import Common
benchmarkIterations = 20000000
--updateHead :: a -> V.Vector a -> V.Vector a
--updateHead a xs = a:V.tail xs
--update i a xs = V.take i xs ++ updateHead a ... | null | https://raw.githubusercontent.com/abooij/haskell-xkbcommon/a337b4f699fef2621ae028eec9171fcd9ea848c5/tests/bench-key-proc.hs | haskell | updateHead :: a -> V.Vector a -> V.Vector a
updateHead a xs = a:V.tail xs
update i a xs = V.take i xs ++ updateHead a (V.drop i xs)
keys // [(rand,(not $ keys V.! rand))] | import Data.Maybe
import qualified Data.Vector.Unboxed as V
import Control.Monad
import System.Random
import Data.Time.Clock
import Text.XkbCommon
import Common
benchmarkIterations = 20000000
update i a xs = xs V.// [(i,a)]
bench :: KeyboardState -> Int -> V.Vector Bool -> IO ()
bench st n keys = unless (n == 0) ... |
9a72139f504542fc964d7c1698c82279b16e45705eef07222d77c247f97d2ded | atgreen/lisp-openshift | encode-float.lisp | (in-package :cl-mongo)
;;--------------------
;; Deal with floats....
;;
From
;;
(defun scale-integer(value bits)
(if (zerop value)
(values 0 0)
(let ((scale (- bits (integer-length value))))
(values (round (* value (expt 2 scale))) scale))))
(defun scale (mantissa exponent mantissa-bits)
(m... | null | https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/cl-mongo-20120208-git/src/encode-float.lisp | lisp | --------------------
Deal with floats....
| (in-package :cl-mongo)
From
(defun scale-integer(value bits)
(if (zerop value)
(values 0 0)
(let ((scale (- bits (integer-length value))))
(values (round (* value (expt 2 scale))) scale))))
(defun scale (mantissa exponent mantissa-bits)
(multiple-value-bind (mantissa scale) (scale-integer ma... |
6ab3603c8ec1aeb25fbbea65e4f93a94dc6fdc063f4c7e3147f8b09ba0a6fb03 | heraldry/heraldicon | charge_group.cljs | (ns heraldicon.reader.blazonry.transform.charge-group
(:require
[heraldicon.reader.blazonry.transform.fimbriation :refer [add-fimbriation]]
[heraldicon.reader.blazonry.transform.shared :refer [ast->hdn transform-first get-child filter-nodes]]
[heraldicon.reader.blazonry.transform.tincture-modifier :refer [ad... | null | https://raw.githubusercontent.com/heraldry/heraldicon/f3298ed0b3394f8db78c4e5e548adc61cd9a256d/src/heraldicon/reader/blazonry/transform/charge_group.cljs | clojure | (ns heraldicon.reader.blazonry.transform.charge-group
(:require
[heraldicon.reader.blazonry.transform.fimbriation :refer [add-fimbriation]]
[heraldicon.reader.blazonry.transform.shared :refer [ast->hdn transform-first get-child filter-nodes]]
[heraldicon.reader.blazonry.transform.tincture-modifier :refer [ad... | |
714bf436eee0c76ca15889c0990f94ec2fd9262597338f7a386b14fdc151daba | phimuemue/lambdainterpreter_haskell | InteractiveTagger.hs | module InteractiveTagger where
import Expression
import Settings
import UserInput
import Taggers
confirmationMsg :: String -> [String] -> IO Char
confirmationMsg heading subs =
getSingleKeyPress $ " " ++ heading ++ concat (map ("\n " ++) subs)
confirmVariableSubs :: String -> Expression -> IO TaggedExpress... | null | https://raw.githubusercontent.com/phimuemue/lambdainterpreter_haskell/1b56487f0bce422cc2a2e448dfef800a4e0a08a4/InteractiveTagger.hs | haskell | module InteractiveTagger where
import Expression
import Settings
import UserInput
import Taggers
confirmationMsg :: String -> [String] -> IO Char
confirmationMsg heading subs =
getSingleKeyPress $ " " ++ heading ++ concat (map ("\n " ++) subs)
confirmVariableSubs :: String -> Expression -> IO TaggedExpress... | |
7505039e6e78e601ac6c1c10e293be3d3207c2df7aaf4bc962ace118eab9cf17 | noamz/linlam | Pretty.hs | module LinLam.Pretty where
import Data.Char
import LinLam.Core
import LinLam.Typing
paren :: String -> String
paren s = "(" ++ s ++ ")"
varnames = map return ['a'..'z'] ++ ["X" ++ show n | n <- [0..]]
prettyLT :: LT -> String
prettyLT (V x) = varnames !! x
prettyLT (A t1 t2)
| isLam t1 = paren (prettyLT t1) ++... | null | https://raw.githubusercontent.com/noamz/linlam/fc5c8bf7fd33826fe880faacde4801b0fdb170b8/src/LinLam/Pretty.hs | haskell | module LinLam.Pretty where
import Data.Char
import LinLam.Core
import LinLam.Typing
paren :: String -> String
paren s = "(" ++ s ++ ")"
varnames = map return ['a'..'z'] ++ ["X" ++ show n | n <- [0..]]
prettyLT :: LT -> String
prettyLT (V x) = varnames !! x
prettyLT (A t1 t2)
| isLam t1 = paren (prettyLT t1) ++... | |
b745cf1d6c5d19b6e74144b830762e701b721bbcd88a224f4d7e6b98bdbae870 | binaryage/chromex | bookmarks.cljs | (ns chromex.app.bookmarks (:require-macros [chromex.app.bookmarks :refer [gen-wrap]])
(:require [chromex.core]))
; -- properties -------------------------------------------------------------------------------------------------------------
(defn max-write-operations-per-hour* [config]
(gen-wrap :property ::max-w... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps/chromex/app/bookmarks.cljs | clojure | -- properties -------------------------------------------------------------------------------------------------------------
-- events ----------------------------------------------------------------------------------------------------------------- | (ns chromex.app.bookmarks (:require-macros [chromex.app.bookmarks :refer [gen-wrap]])
(:require [chromex.core]))
(defn max-write-operations-per-hour* [config]
(gen-wrap :property ::max-write-operations-per-hour config))
(defn max-sustained-write-operations-per-minute* [config]
(gen-wrap :property ::max-susta... |
1823c60446ff64371e0175ff37a1ffe0aceb4e99daf41423ca926c5c3a62c075 | mnieper/unsyntax | 28.scm | Copyright © ( 2020 ) .
;; This file is part of unsyntax.
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation files
( the " Software " ) , to deal in the Software without restriction ,
;; including without limitation the rights to use... | null | https://raw.githubusercontent.com/mnieper/unsyntax/cd12891805a93229255ff0f2c46cf0e2b5316c7c/src/srfi/28.scm | scheme | This file is part of unsyntax.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
including without limitation the rights to use, copy, modify, merge,
subject to the following conditions:
The above copyright notice and this permission n... | Copyright © ( 2020 ) .
( the " Software " ) , to deal in the Software without restriction ,
publish , distribute , sublicense , and/or sell copies of the Software ,
and to permit persons to whom the Software is furnished to do so ,
portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITH... |
732c7bc926191fc590369a0f1b485707a0beb39cffc9984afa7333f3f8703245 | tobbebex/GPipe | Fragment.hs | -----------------------------------------------------------------------------
--
Module : Graphics . . Stream . Fragment
Copyright :
-- License : BSD3
--
Maintainer :
-- Stability : Experimental
Portability : Portable
--
-- | 'FragmentStream's implement the 'Functor' class, which... | null | https://raw.githubusercontent.com/tobbebex/GPipe/9ff3afde0416c118971c5a2f93effdc75ef59e88/src/Graphics/GPipe/Stream/Fragment.hs | haskell | ---------------------------------------------------------------------------
License : BSD3
Stability : Experimental
| 'FragmentStream's implement the 'Functor' class, which provides the
'fmap' method that you can use to manipulate those streams. This corresponds to writing and using
fragment shaders, bu... | Module : Graphics . . Stream . Fragment
Copyright :
Maintainer :
Portability : Portable
Instances are also provided for the ' Monoid ' class , so several streams ( of the same type ) can be
concatenated . The order is preserved , meaning that the fragments in stream @a@ in @a ` mappe... |
73d1a9e71fdc3b83b4779e3a7ac7a5375b8cc2543fc6146e37e911d2e0c46ce0 | JustusAdam/marvin | Types.hs | # OPTIONS_HADDOCK not - home #
|
Module : $ Header$
Description : Common types in .
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : POSIX
Module : $Header$
Description : Common types in marvin.
Copyright : (c) Justus Adam, 2016
License : BSD... | null | https://raw.githubusercontent.com/JustusAdam/marvin/c49db1f7efbd5cc0803c9802ca31bb4488472ac3/src/Marvin/Types.hs | haskell | # OPTIONS_HADDOCK not - home #
|
Module : $ Header$
Description : Common types in .
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : POSIX
Module : $Header$
Description : Common types in marvin.
Copyright : (c) Justus Adam, 2016
License : BSD... | |
d31bfb0964b32252cef62d93859aff0df44ae06becdf15f47c11b28530268d64 | dsorokin/aivika | Generator.hs |
{-# LANGUAGE RankNTypes #-}
-- |
-- Module : Simulation.Aivika.Generator
Copyright : Copyright ( c ) 2009 - 2017 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Tested with : GHC 8.0.1
--
-- Below is defined a type class of the random number generator.
--
module Simulation.A... | null | https://raw.githubusercontent.com/dsorokin/aivika/1f7eac9270b51bc399df6bb57f61e74ee0049d88/Simulation/Aivika/Generator.hs | haskell | # LANGUAGE RankNTypes #
|
Module : Simulation.Aivika.Generator
License : BSD3
Stability : experimental
Below is defined a type class of the random number generator.
| A discrete probability density function.
| Defines a random number generator.
^ Generate an uniform random number
with the specified m... |
Copyright : Copyright ( c ) 2009 - 2017 , < >
Maintainer : < >
Tested with : GHC 8.0.1
module Simulation.Aivika.Generator
(Generator(..),
GeneratorType(..),
DiscretePDF(..),
newGenerator,
newRandomGenerator,
newRandomGenerator01) where
import System.Rando... |
ade15232a9aa8762ef591f04178d8bdebdc7b78afc152994393bec7b3eae62ba | ska80/thinlisp | exports.lisp | (in-package "TLI")
;;;; Module EXPORTS
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright ( c ) 1995 - 1997 Gensym Corporation .
;;; All rights reserved.
This file is part of ThinLisp .
ThinLisp is open source ; you can redistribute it and/or modify it
under the terms of the ThinLisp License as publ... | null | https://raw.githubusercontent.com/ska80/thinlisp/173573a723256d901887f1cbc26d5403025879ca/tlt/lisp/exports.lisp | lisp | Module EXPORTS
All rights reserved.
you can redistribute it and/or modify it
either version 1 or ( at your option ) any later version .
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Exported Symbols
circustances require importing:
* translatable... | (in-package "TLI")
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright ( c ) 1995 - 1997 Gensym Corporation .
This file is part of ThinLisp .
under the terms of the ThinLisp License as published by the ThinLisp
ThinLisp is distributed in the hope that it will be useful , but
For additional inform... |
78c276bc4ccf7ad2fe2f2b92a646e2e4816f0a89e0929fcc572a2c903e5ee97a | VisionsGlobalEmpowerment/webchange | runner.cljs | (ns webchange.runner
(:require [doo.runner :refer-macros [doo-tests]]
[cljs.test :refer-macros [run-all-tests run-tests]]
[webchange.core-test]
[webchange.editor-v2.activity-dialogs.get-phrases-sequence]
[webchange.editor-v2.activity-dialogs.prepare-phrase-actions]
... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/d7572dcbde25159f5a8e59c3f5177e48bdfceb56/test/cljs/webchange/runner.cljs | clojure | (ns webchange.runner
(:require [doo.runner :refer-macros [doo-tests]]
[cljs.test :refer-macros [run-all-tests run-tests]]
[webchange.core-test]
[webchange.editor-v2.activity-dialogs.get-phrases-sequence]
[webchange.editor-v2.activity-dialogs.prepare-phrase-actions]
... | |
f6ad8a77b8070ae2d29432389a64702556e9c8dd1003660cf95bdf470f846fce | jcf/ring-ssl | ssl_test.clj | (ns ring.util.ssl-test
(:require [clojure.test :refer :all]
[ring.mock.request :refer [request header]]
[ring.util.ssl :refer :all]))
(deftest test-add-x-forwarded-proto-header
(let [m (-> (request :get "/")
(add-x-forwarded-proto-header))]
(is (= (get-in m [:headers "x-fo... | null | https://raw.githubusercontent.com/jcf/ring-ssl/4ef90fe7ba65d755a3715bd4dadcb46063109037/test/ring/util/ssl_test.clj | clojure | (ns ring.util.ssl-test
(:require [clojure.test :refer :all]
[ring.mock.request :refer [request header]]
[ring.util.ssl :refer :all]))
(deftest test-add-x-forwarded-proto-header
(let [m (-> (request :get "/")
(add-x-forwarded-proto-header))]
(is (= (get-in m [:headers "x-fo... | |
5102608fd4c2a4d09bfb8fc704a4a7ceee2878d5da97ff65d471ddeb92ad0a77 | ferd/hubble | hubble_parsetrans_SUITE.erl | -module(hubble_parsetrans_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
-compile({parse_transform, hubble_trans}).
%% recommended to avoid errors
-no_auto_import([get/1, put/2]).
all() -> [form_tests, read_write, safe_update, multi_put, multi_up, demo].
-record(testrec, {item=new(),
... | null | https://raw.githubusercontent.com/ferd/hubble/28da897b6bc2654748252038d4748335a5de3aef/test/hubble_parsetrans_SUITE.erl | erlang | recommended to avoid errors
various record forms
bin
blocks
if, after
Case
receive
fun
- records (declarations and use, index, field)
- LCs
- BCs
- bin
- block
- if
- case
- receive
- fun
can't update undef fields
bad key = crash! | -module(hubble_parsetrans_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
-compile({parse_transform, hubble_trans}).
-no_auto_import([get/1, put/2]).
all() -> [form_tests, read_write, safe_update, multi_put, multi_up, demo].
-record(testrec, {item=new(),
other=[put(new(),a,... |
35026d9c876da90ada370941e2c35447250faf7e119e9512258966988687db52 | juxt/spin | reitit_example.clj | Copyright © 2020 - 2021 , JUXT LTD .
(ns reitit-example
(:require
[reitit.core :as r]
[juxt.spin.alpha :as spin]))
(def router
(r/router
[["/api/ping" :ping]
["/api/orders/:id" :order]]))
(comment
(r/match-by-path router "/api/ping"))
(defn locate-resource [request]
(let [target (r/match-by-p... | null | https://raw.githubusercontent.com/juxt/spin/faace930ed2ff05eea0d184eea4b62d00287b611/examples/reitit/src/reitit_example.clj | clojure | Copyright © 2020 - 2021 , JUXT LTD .
(ns reitit-example
(:require
[reitit.core :as r]
[juxt.spin.alpha :as spin]))
(def router
(r/router
[["/api/ping" :ping]
["/api/orders/:id" :order]]))
(comment
(r/match-by-path router "/api/ping"))
(defn locate-resource [request]
(let [target (r/match-by-p... | |
409719c23d2c9302cf6e555c050c28af3bffb55007028684c313e35dcbe2d2fc | adventuring/tootsville.net | moo.lisp | ;;;; -*- lisp -*-
;;;
src / characters / named / moo.lisp is part of
;;;
Copyright © 2008 - 2017 Bruce - Robert Pocock ; © 2018 - 2021 The
Corporation for Inter - World Tourism and Adventuring ( ciwta.org ) .
;;;
This program is Free Software : you can redistribute it and/or
modif... | null | https://raw.githubusercontent.com/adventuring/tootsville.net/985c11a91dd1a21b77d7378362d86cf1c031b22c/src/characters/named/moo.lisp | lisp | -*- lisp -*-
© 2018 - 2021 The
either version 3 of
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more det... | src / characters / named / moo.lisp is part of
Corporation for Inter - World Tourism and Adventuring ( ciwta.org ) .
This program is Free Software : you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License
the License , or ( at your option ) any later ve... |
0bf4dded7239beab47c71f31f7f35f5b217786183fa365d787b03ae9431243d8 | 8c6794b6/guile-tjit | t-side-exit-05.scm | (define (loop low mid high)
(let lp ((i 0) (acc 0))
(cond
((= i 10000)
acc)
((< low i (+ mid 1))
(lp (+ i 1) (+ acc 1)))
((< mid i (+ high 1))
(lp (+ i 1) (+ acc 2)))
(else
(lp (+ i 1) acc)))))
(loop 2000 5000 9000)
| null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/t-side-exit-05.scm | scheme | (define (loop low mid high)
(let lp ((i 0) (acc 0))
(cond
((= i 10000)
acc)
((< low i (+ mid 1))
(lp (+ i 1) (+ acc 1)))
((< mid i (+ high 1))
(lp (+ i 1) (+ acc 2)))
(else
(lp (+ i 1) acc)))))
(loop 2000 5000 9000)
| |
432183677fbb6446e7c65fe80b7fedeea6f1e13ad4a238439a803b4b4e3914d0 | footprintanalytics/footprint-web | env_test.clj | (ns metabase.db.env-test
(:require [clojure.test :refer :all]
[metabase.db.data-source :as mdb.data-source]
[metabase.db.env :as mdb.env]
[metabase.test :as mt]))
(deftest raw-connection-string->type-test
(are [s expected] (= expected (#'mdb.env/raw-connection-string->type s))
... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/db/env_test.clj | clojure | (ns metabase.db.env-test
(:require [clojure.test :refer :all]
[metabase.db.data-source :as mdb.data-source]
[metabase.db.env :as mdb.env]
[metabase.test :as mt]))
(deftest raw-connection-string->type-test
(are [s expected] (= expected (#'mdb.env/raw-connection-string->type s))
... | |
4542eb8a5d5e93fa01299d3b31fa879e9fc2fcb8445d367604c63d185f37ea9b | rumblesan/improviz | StdLib.hs | module Language.Interpreter.StdLib
( addStdLib
) where
import Language.Interpreter.StdLib.BlockHandling
( addBlockHandlingStdLib )
import Language.Interpreter.StdLib.ColourOps
( addColourStdLib )
imp... | null | https://raw.githubusercontent.com/rumblesan/improviz/23e16ae7b2d55d2204417ec60c7cb6673a93df7d/src/Language/Interpreter/StdLib.hs | haskell | module Language.Interpreter.StdLib
( addStdLib
) where
import Language.Interpreter.StdLib.BlockHandling
( addBlockHandlingStdLib )
import Language.Interpreter.StdLib.ColourOps
( addColourStdLib )
imp... | |
bc8aae364bb930174760d59e2c136b97b9d9e1efd8dd46b7bc100903554bbaed | kupl/LearnML | original.ml | type nat = ZERO | SUCC of nat
let rec natadd (nat1 : nat) (nat2 : nat) : nat =
match nat1 with ZERO -> nat2 | SUCC nat -> natadd nat (SUCC nat2)
let rec natmul (nat1 : nat) (nat2 : nat) : nat =
match nat1 with ZERO -> ZERO | SUCC nat -> natmul nat (natadd nat2 nat2)
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/nat/sub4/original.ml | ocaml | type nat = ZERO | SUCC of nat
let rec natadd (nat1 : nat) (nat2 : nat) : nat =
match nat1 with ZERO -> nat2 | SUCC nat -> natadd nat (SUCC nat2)
let rec natmul (nat1 : nat) (nat2 : nat) : nat =
match nat1 with ZERO -> ZERO | SUCC nat -> natmul nat (natadd nat2 nat2)
| |
729be0afe1ca7372a8d9010d78d6848c01b5d90e96ccebedaf85b64774e4e1c1 | project-oak/hafnium-verification | IssueLog.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/IR/IssueLog.mli | ocaml | * Module for maps from procnames to error logs.
* iterate a function on map contents
* Get the error log for a given procname. If there is none, add an empty one to the map. Return
the resulting map together with the errlog. |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
0c50352a4f0df7ae0b75c3995493aad9aeb086ad3ec5c8a605ea13f4756042d4 | Bogdanp/racket-gui-extra | status-bar-menu.rkt | #lang racket/base
(require racket/class
(prefix-in gui: racket/gui)
racket/gui/extra)
(define quit-sema
(make-semaphore))
(define menu
(new status-bar-menu%
[image (make-image-from-symbol #:point-size 16 'ipad)]))
(new gui:menu-item%
[parent menu]
[label "Example 1"]
[cal... | null | https://raw.githubusercontent.com/Bogdanp/racket-gui-extra/6e1d2d154427707424dcc8bbfe2115009e38d3d4/examples/status-bar-menu.rkt | racket | #lang racket/base
(require racket/class
(prefix-in gui: racket/gui)
racket/gui/extra)
(define quit-sema
(make-semaphore))
(define menu
(new status-bar-menu%
[image (make-image-from-symbol #:point-size 16 'ipad)]))
(new gui:menu-item%
[parent menu]
[label "Example 1"]
[cal... | |
c8251734b0e2c1303ba635304ef81c2b004ae086bc24a19d2a1c415e88451994 | gnarroway/tako | tako.clj | (ns tako.tako
"An implementation of Dataloader for efficient data access using batching/caching."
(:require [clojure.core.async
:refer [>! >!! <! chan close! alts! timeout go-loop]]
[clojure.tools.logging :as log])
(:import (java.lang AutoCloseable)))
;; Implementation
(defn- batch
... | null | https://raw.githubusercontent.com/gnarroway/tako/c59bc4a1f3fdeff1ab68bbc6cead86359fb298b8/src/tako/tako.clj | clojure | Implementation
timed out, so process what we got
`in` is closed, so process what we got
we will fill up the batch, so process it
accumulate the buffer
API
Consume batches and deliver promises
got a batch to process
Deliver the exception but clear the cache
Deliver the value
chan is closed
keep listening
Co... | (ns tako.tako
"An implementation of Dataloader for efficient data access using batching/caching."
(:require [clojure.core.async
:refer [>! >!! <! chan close! alts! timeout go-loop]]
[clojure.tools.logging :as log])
(:import (java.lang AutoCloseable)))
(defn- batch
"Collect items on ... |
ff91f006a3ca20c423f39ecb0c53b786cf4fcd4dc9c08596bddda4df44024c01 | OctaviPascual/cis194-IntroductionToHaskell | Fibonacci.hs | # OPTIONS_GHC -Wall -fno - warn - missing - methods -fno - warn - name - shadowing #
# LANGUAGE FlexibleInstances #
module Fibonacci where
-------------------------------- Exercise 1 ----------------------------------
-- Return the nth Fibonacci number
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n-1... | null | https://raw.githubusercontent.com/OctaviPascual/cis194-IntroductionToHaskell/771c9c72d10744dd6593a7478698de640106bb90/homework-06/Fibonacci.hs | haskell | ------------------------------ Exercise 1 ----------------------------------
Return the nth Fibonacci number
------------------------------ Exercise 2 ----------------------------------
------------------------------ Exercise 3 ----------------------------------
Convert a stream into an infinte list
-----------------... | # OPTIONS_GHC -Wall -fno - warn - missing - methods -fno - warn - name - shadowing #
# LANGUAGE FlexibleInstances #
module Fibonacci where
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
Infinte list of all Fibonacci numbers ( this is very slow ! )
fibs1 :: [Integer]
fibs1 = fib <$> ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.