_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 |
|---|---|---|---|---|---|---|---|---|
145169c1442fadd0022884e62bd9278b9f59d789729769dfe11d110e0650daae | degree9/uikit-hl | drop.cljs | (ns uikit-hl.drop
(:require [hoplon.core :as h]
[hoplon.jquery]
[uikit-hl.core :as uk]))
(defmulti uk-drop! h/kw-dispatcher :default ::default)
(defmethod h/do! ::default
[elem key val]
(uk-drop! elem key val))
(defn- format-drop [drop]
(str "uk-drop-" drop))
(defmethod uk-drop! ::de... | null | https://raw.githubusercontent.com/degree9/uikit-hl/b226b1429ea50f8e9a6c1d12c082a3be504dda33/src/uikit_hl/drop.cljs | clojure | (ns uikit-hl.drop
(:require [hoplon.core :as h]
[hoplon.jquery]
[uikit-hl.core :as uk]))
(defmulti uk-drop! h/kw-dispatcher :default ::default)
(defmethod h/do! ::default
[elem key val]
(uk-drop! elem key val))
(defn- format-drop [drop]
(str "uk-drop-" drop))
(defmethod uk-drop! ::de... | |
1d8489c55e1155134edd948ab601926ccfde2e2d88870ad3b8826002cf57a853 | vseloved/cl-nlp | ptb-test.lisp | ( c ) 2015 Vsevolod Dyomkin
(in-package #:nlp.contrib.corpora)
(named-readtables:in-readtable rutils-readtable)
(deftest read-ptb ()
(should be string= "Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov."
(slice #1=(text-clean (read-corpus-file :ptb-tagged
... | null | https://raw.githubusercontent.com/vseloved/cl-nlp/f180b6c3c0b9a3614ae43f53a11bc500767307d0/test/corpora/ptb-test.lisp | lisp | ( c ) 2015 Vsevolod Dyomkin
(in-package #:nlp.contrib.corpora)
(named-readtables:in-readtable rutils-readtable)
(deftest read-ptb ()
(should be string= "Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov."
(slice #1=(text-clean (read-corpus-file :ptb-tagged
... | |
abb7d4bc2c2428a375c0b3e74638ab4689acf4498724933c4c4b022c29e18cbc | oreillymedia/etudes-for-erlang | geom.erl | -module(geom).
-export([area/2]).
area(L,W) -> L * W.
| null | https://raw.githubusercontent.com/oreillymedia/etudes-for-erlang/07200372503a8819f9fcc2856f8cb82451be7b48/code/ch02-01/geom.erl | erlang | -module(geom).
-export([area/2]).
area(L,W) -> L * W.
| |
a70f7943c8640e21c2f9d25ea73216c5333861c8540aa50de6e174f52475fd4e | commsor/titanoboa-tasklets | project.clj | (defproject io.titanoboa.tasklet/pdf "0.1.0"
:description "pdf generation step function for titanoboa.io"
:url ""
:license {:name "unlicense"
:url "/"}
:dependencies [[clj-pdf "2.2.33"]]
:source-paths ["src/clj"]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.0"]]}
:prov... | null | https://raw.githubusercontent.com/commsor/titanoboa-tasklets/9e1efdf373243624b5def938900e0d250a5a8580/pdf/project.clj | clojure | (defproject io.titanoboa.tasklet/pdf "0.1.0"
:description "pdf generation step function for titanoboa.io"
:url ""
:license {:name "unlicense"
:url "/"}
:dependencies [[clj-pdf "2.2.33"]]
:source-paths ["src/clj"]
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.0"]]}
:prov... | |
cd36894168baa38f91541b42cd9965b9d0180a8fadda2156f206fc7255b41969 | lisp/de.setf.xml | namespace.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - query - data - model ; -*-
(in-package :xml-query-data-model)
(setq xml-query-data-model:*namespace*
(xml-query-data-model:defnamespace "#"
(:use)
(:ni... | null | https://raw.githubusercontent.com/lisp/de.setf.xml/827681c969342096c3b95735d84b447befa69fa6/namespaces/www-isi-edu/webscripter/person-o-daml/namespace.lisp | lisp | Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - query - data - model ; -*-
(xqdm:find-namespace "#" :if-does-not-exist :load) |
(in-package :xml-query-data-model)
(setq xml-query-data-model:*namespace*
(xml-query-data-model:defnamespace "#"
(:use)
(:nicknames)
(:export)
(:docu... |
65d4ecd70b994411b95105248bcfa33cd2bbdedeaa565e29ac46c9590e61aaec | semerdzhiev/fp-2020-21 | class.rkt | #lang racket
(#%require "../common.scm")
;; Реурсивна дясно асоциативна имплементация на `accumulate`.
(define [accumulate operation
transform
initial
start
next
end]
(define [helper i]
(if [> i end]
init... | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-a/Week3-HigheOrder/class.rkt | racket | Реурсивна дясно асоциативна имплементация на `accumulate`. | #lang racket
(#%require "../common.scm")
(define [accumulate operation
transform
initial
start
next
end]
(define [helper i]
(if [> i end]
initial
(operation (transform i)
(helpe... |
4997eba3af731309a2f3b2272899c8b28a9946d1a3f3110f510de50979326d54 | reactiveml/rml | global.ml | This file was globals.ml from Caml Light
(* Global symbol tables *)
#open "const";;
#open "prim";;
(* A reference to a global, in a source file, is either a qualified identifier
mod__name, or an unqualified identifier name. *)
type global_reference =
GRname of string
| GRmodname of qualified_ident
;;
(*... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/patch/compiler/global/global.ml | ocaml | Global symbol tables
A reference to a global, in a source file, is either a qualified identifier
mod__name, or an unqualified identifier name.
Internally, a global is represented by its fully qualified name,
plus associated information.
Full name
Description
Type constructors
Stamp
Abbreviation or ... | This file was globals.ml from Caml Light
#open "const";;
#open "prim";;
type global_reference =
GRname of string
| GRmodname of qualified_ident
;;
type 'a global =
;;
let little_name_of_global g = g.qualid.id
;;
type type_constr =
and type_abbrev =
Tnotabbrev
and typ =
and typ_desc =
and typ_lin... |
440f581822ccf86d0f3e4e9d34c8a4ba128363ebd9fac551d818cbd7c2d5e6ad | jessealama/argo | ip.rkt | #lang racket/base
(require (only-in racket/match
match-let)
(only-in racket/list
make-list
range))
(module+ test
(require rackunit))
(define (at-most-255? x)
(and (string? x)
(or (regexp-match-exact? #rx"[0-9]" x)
(regexp-match-exac... | null | https://raw.githubusercontent.com/jessealama/argo/aa2e14608dffa648719b3fa6725862a88e1b2477/ip.rkt | racket | #section-2.2
starts with "::"
substitue "::" with n copies of "0:"
ends with "::"
substitue "::" with n copies of ":0"
(log-error "before = \"~a\"" before)
(log-error "after = \"~a\"" after)
substitue "::" with n copies of "0:"
(log-error (format "trying \"~a\"" expanded)) | #lang racket/base
(require (only-in racket/match
match-let)
(only-in racket/list
make-list
range))
(module+ test
(require rackunit))
(define (at-most-255? x)
(and (string? x)
(or (regexp-match-exact? #rx"[0-9]" x)
(regexp-match-exac... |
f08bf9b3417ace20f049cc711b771b61a9792480acfb895dc12973290bb29228 | jellelicht/guix | openstack.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2015 , 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundati... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/openstack.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 < >
Copyright © 2015 , 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages openstack)
#:use-module (gnu packages python)
#:... |
2c489601082ba7d790dba13c975fba469f2dce438ec34d49a5869c44d0aecb02 | MercuryTechnologies/slack-web | Prelude.hs | module Web.Slack.Prelude
( module ClassyPrelude,
module Data.Aeson,
module Data.Aeson.TH,
cs,
ToHttpApiData,
NonEmpty (..),
Default (..),
Proxy (..),
)
where
import ClassyPrelude hiding (link)
import Data.Aeson (FromJSON (..), ToJSON (..), object, withObject, (.:), (.:?), (.=))
import D... | null | https://raw.githubusercontent.com/MercuryTechnologies/slack-web/836b2b81d02eb74c56527d285a0edfac7bc7bce2/src/Web/Slack/Prelude.hs | haskell | module Web.Slack.Prelude
( module ClassyPrelude,
module Data.Aeson,
module Data.Aeson.TH,
cs,
ToHttpApiData,
NonEmpty (..),
Default (..),
Proxy (..),
)
where
import ClassyPrelude hiding (link)
import Data.Aeson (FromJSON (..), ToJSON (..), object, withObject, (.:), (.:?), (.=))
import D... | |
495488b1b4c6cf10555f4171820dd61a801350a56fa8aa0ee3ab9a25ce7d1d37 | NorfairKing/the-notes | Terms.hs | module Cryptography.ComputationalProblems.Games.DiscreteGames.Terms where
import Notes
makeDefs
[ "discrete game"
, "deterministic discrete game"
, "DDS"
, "monotone binary output"
, "MBO"
, "discrete winner"
, "deterministic discrete winner"
, "DDW"
, "probabilistic disc... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Cryptography/ComputationalProblems/Games/DiscreteGames/Terms.hs | haskell | module Cryptography.ComputationalProblems.Games.DiscreteGames.Terms where
import Notes
makeDefs
[ "discrete game"
, "deterministic discrete game"
, "DDS"
, "monotone binary output"
, "MBO"
, "discrete winner"
, "deterministic discrete winner"
, "DDW"
, "probabilistic disc... | |
76ba3660552e4da0caa76d99f1b964f0a9c5f46b2a4c267f02b2fd6bbf95a6af | DuoSRX/ocamnes | input.ml | type controller = {
mutable a : bool;
mutable b : bool;
mutable select : bool;
mutable start : bool;
mutable up : bool;
mutable down : bool;
mutable left : bool;
mutable right : bool;
}
let controller_state = {
a = false;
b = false;
select = false;
start = false;
up = false;
down = false;
left = ... | null | https://raw.githubusercontent.com/DuoSRX/ocamnes/58886a3f327516dcab9622637afac14c3c50738a/lib/input.ml | ocaml | type controller = {
mutable a : bool;
mutable b : bool;
mutable select : bool;
mutable start : bool;
mutable up : bool;
mutable down : bool;
mutable left : bool;
mutable right : bool;
}
let controller_state = {
a = false;
b = false;
select = false;
start = false;
up = false;
down = false;
left = ... | |
383f19dc481697959f895bd608163766701bf788b06b378b7e7cae60390ca059 | mstksg/advent-of-code-2022 | Build.hs | #!/usr/bin/env stack
-- stack --install-ghc runghc --package shake --package template --package directory --package containers --package text --package filepath --package strip-ansi-escape --package html-entities --package time
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
{-# OPTIONS_GHC -Wall ... | null | https://raw.githubusercontent.com/mstksg/advent-of-code-2022/f3c65c773f923b0ffa40ae8f5e3567d1d891ea3c/Build.hs | haskell | stack --install-ghc runghc --package shake --package template --package directory --package containers --package text --package filepath --package strip-ansi-escape --package html-entities --package time
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -Wall #
| Assemble README and Reflections
CONSTANTS
for be... | #!/usr/bin/env stack
# LANGUAGE TypeApplications #
import Control.Monad
import Data.Char
import Data.Foldable
import Data.List
import Data.Maybe
import Data.String.AnsiEscapeCodes.Strip.Text
import Data.Text (Text)
i... |
acc158b67679960b30a3f13ff5864822e1fe8b587ec167b85303443ad6329bc3 | zanfranceschi/desafio-03-processamento_distribuido | core.clj | (ns processamento-distribuido.core
(:require [processamento-distribuido.distribuidor :as distribuidor])
(:gen-class))
;; -and-clojure-a-brief-introduction/
;;
(defn -main
"I don't do a whole lot ... yet."
[& args]
(distribuidor/distribui!)
(println "Hello, World!"))
| null | https://raw.githubusercontent.com/zanfranceschi/desafio-03-processamento_distribuido/16fe3790c2c035052be9a8e448ae85ba62672764/clojure/src/processamento_distribuido/core.clj | clojure | -and-clojure-a-brief-introduction/
| (ns processamento-distribuido.core
(:require [processamento-distribuido.distribuidor :as distribuidor])
(:gen-class))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(distribuidor/distribui!)
(println "Hello, World!"))
|
f598b23fb4b5fbe8a948ed092642ea4a35b80f1a9b4c5c511a9447da2edaccb0 | graninas/The-Amoeba-World | OutputAccessor.hs | module Amoeba.View.Output.OutputAccessor where
import qualified Amoeba.Middleware.GLFW.Facade as GLFW
import Amoeba.View.Output.Types
import Amoeba.View.Output.Runtime
import Amoeba.Middleware.OpenGL.Facade as OGL
import Control.Concurrent.STM.TVar as STM
import Control.Concurrent.STM as STM
type OutputAccessor = S... | null | https://raw.githubusercontent.com/graninas/The-Amoeba-World/a147cd4dabf860bec8a6ae1c45c02b030916ddf4/src/Amoeba/View/Output/OutputAccessor.hs | haskell | antialiasing
From here: -pong/blob/master/src/Main.hs
Strange magic constants.
TODO: investigate. | module Amoeba.View.Output.OutputAccessor where
import qualified Amoeba.Middleware.GLFW.Facade as GLFW
import Amoeba.View.Output.Types
import Amoeba.View.Output.Runtime
import Amoeba.Middleware.OpenGL.Facade as OGL
import Control.Concurrent.STM.TVar as STM
import Control.Concurrent.STM as STM
type OutputAccessor = S... |
cef2465f6ef3180978855bd8ceebb8200647f92b3b498cc65ad76630935ea75a | epgsql/epgsql | epgsql_codec_timerange.erl | %%% @doc
%%% Codec for `tsrange', `tstzrange', `daterange' types.
%%%
%%% <ul>
%%% <li>[#rangetypes-builtin]</li>
%%% <li>$PG$/src/backend/utils/adt/rangetypes.c</li>
%%% </ul>
%%% @end
%%% @see epgsql_codec_datetime
%%% @end
Created : 16 Jul 2018 by < >
%%% TODO: universal range, based on pg_range table
%%% TOD... | null | https://raw.githubusercontent.com/epgsql/epgsql/f811a09926892dbd1359afe44a9bfa8f6907b322/src/datatypes/epgsql_codec_timerange.erl | erlang | @doc
Codec for `tsrange', `tstzrange', `daterange' types.
<ul>
<li>[#rangetypes-builtin]</li>
<li>$PG$/src/backend/utils/adt/rangetypes.c</li>
</ul>
@end
@see epgsql_codec_datetime
@end
TODO: universal range, based on pg_range table
TODO: inclusive/exclusive ranges `[]' `[)' `(]' `()'
() [) (] []
(] ()
... | Created : 16 Jul 2018 by < >
-module(epgsql_codec_timerange).
-behaviour(epgsql_codec).
-export([init/2, names/0, encode/3, decode/3, decode_text/3]).
-include("protocol.hrl").
-export_type([data/0]).
-type data() :: {left(), right()} | empty.
-type left() :: minus_infinity | epgsql_codec_datetime:data().
-t... |
fa7dc37343c986a6a2b164c7a8bb333f226626f100997bf5b3bda2109219f5b5 | kazu-yamamoto/logger | IP.hs | module Network.Wai.Logger.IP (
NumericAddress, showSockAddr
) where
import Data.Bits (shift, (.&.))
import Data.Word (Word32)
import Network.Socket (SockAddr(..))
import System.ByteOrder (ByteOrder(..), byteOrder)
import Text.Printf (printf)
-- | A type for IP address in numeric string representation.
type Num... | null | https://raw.githubusercontent.com/kazu-yamamoto/logger/ca54def2eee1cf70d51588c3c54100b3c6e32977/wai-logger/Network/Wai/Logger/IP.hs | haskell | | A type for IP address in numeric string representation.
HostAddr is network byte order.
HostAddr6 is host byte order. | module Network.Wai.Logger.IP (
NumericAddress, showSockAddr
) where
import Data.Bits (shift, (.&.))
import Data.Word (Word32)
import Network.Socket (SockAddr(..))
import System.ByteOrder (ByteOrder(..), byteOrder)
import Text.Printf (printf)
type NumericAddress = String
showIPv4 :: Word32 -> Bool -> NumericAdd... |
a0959b2020f67192498c73e2dc6c1827451fbcedc7905766d0ad17e612c38c8c | BillHallahan/G2 | TypeClasses.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TupleSections #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module G2.Language.TypeClasses.TypeClasses ( TypeClasses
, Class (..)
, initT... | null | https://raw.githubusercontent.com/BillHallahan/G2/43e7a9f1e8f5131d91e28b54ce669e5e6782412b/src/G2/Language/TypeClasses/TypeClasses.hs | haskell | # LANGUAGE DeriveDataTypeable #
Returns the dictionary for the given typeclass and Type,
if one exists
tcDicts
the typeclass, returns an instance of the typeclass, if possible
satisfyingTCTypes
returns a list of acceptable types
See satisfyingTCTypes | # LANGUAGE DeriveGeneric #
# LANGUAGE TupleSections #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module G2.Language.TypeClasses.TypeClasses ( TypeClasses
, Class (..)
, initTypeClasses
... |
6ebffe9873fc2946ad454bc92cfe1253c20af5c56b323c09393b336d9144830c | philnguyen/soft-contract | id-dependent.rkt | #lang racket
(require soft-contract/fake-contract)
(define (f x) x)
(provide/contract [f (->i ([x real?]) (res (x) (=/c x)))])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/sym-exe/id-dependent.rkt | racket | #lang racket
(require soft-contract/fake-contract)
(define (f x) x)
(provide/contract [f (->i ([x real?]) (res (x) (=/c x)))])
| |
39980d198396608b5b46d0968e09aaac95198686e3774d81d0ae22eed1184e1d | dyne/freecoin-lib | api_key.clj | Freecoin - lib - library to facilitate blockchain functions
part of Decentralized Citizen Engagement Technologies ( D - CENT )
R&D funded by the European Commission ( FP7 / CAPS 610349 )
Copyright ( C ) 2018- Dyne.org foundation
designed , written and maintained by
< >
Freecoin - lib is free softw... | null | https://raw.githubusercontent.com/dyne/freecoin-lib/70eca6858b3765310fdf134378a3026de9adb121/test/freecoin_lib/test/db/api_key.clj | clojure | you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) any later version .
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See th... | Freecoin - lib - library to facilitate blockchain functions
part of Decentralized Citizen Engagement Technologies ( D - CENT )
R&D funded by the European Commission ( FP7 / CAPS 610349 )
Copyright ( C ) 2018- Dyne.org foundation
designed , written and maintained by
< >
You should have received a... |
66da3aa3ef4183d9c9f5d8d5ac14ce7d52e1c743bc3dd7444f097f8b180ecc29 | purebred-mua/purebred | Utils.hs | -- This file is part of purebred
Copyright ( C ) 2017 - 2020 and
--
-- purebred is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) any later ... | null | https://raw.githubusercontent.com/purebred-mua/purebred/14f50e8406dd81f6f506f1352f623948a1ea63ed/src/Purebred/UI/Utils.hs | haskell | This file is part of purebred
purebred is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ... | Copyright ( C ) 2017 - 2020 and
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License
module Purebred.UI.Utils
( titleize
, Titleize
, sa... |
a34c903eae2edd7f9c8c861955877430d19a8079e0c6106bf55c5c686a15f1af | danielsz/system | immutant_web_test.clj | (ns system.components.immutant-web-test
(:require [system.components.immutant-web :refer [new-web-server new-immutant-web]]
[com.stuartsierra.component :as component]
[clj-http.client :as client]
[clojure.test :refer [testing deftest is]]))
(defn handler [request]
{:status 200
... | null | https://raw.githubusercontent.com/danielsz/system/4c8bf677e9988eec59033b3af4352567c459b50c/test/system/components/immutant_web_test.clj | clojure | (ns system.components.immutant-web-test
(:require [system.components.immutant-web :refer [new-web-server new-immutant-web]]
[com.stuartsierra.component :as component]
[clj-http.client :as client]
[clojure.test :refer [testing deftest is]]))
(defn handler [request]
{:status 200
... | |
671126559a4138865640f8cbba5ec45be6a271906bdeae05308dfb0ea68f7875 | rollacaster/sketches | flowers.cljs | (ns sketches.rac-sketches.flowers
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]))
(defn setup []
(q/color-mode :hsb)
(q/frame-rate 2)
1)
(defn constrain-petal-counts [petal-count]
(if (< petal-count 20) petal-count 0))
(defn update-state [petal-count]
(constrain-pe... | null | https://raw.githubusercontent.com/rollacaster/sketches/ba79fccf2a37139de9193ed2ea7a6cc04b63fad0/src/sketches/rac_sketches/flowers.cljs | clojure | (ns sketches.rac-sketches.flowers
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]))
(defn setup []
(q/color-mode :hsb)
(q/frame-rate 2)
1)
(defn constrain-petal-counts [petal-count]
(if (< petal-count 20) petal-count 0))
(defn update-state [petal-count]
(constrain-pe... | |
987fccc6ad45146e89ab640a32673921c67d02221cab0b15a2ff441fbcf863f7 | AndrasKovacs/sett | Cxt.hs |
module Cxt (
module Cxt.Types,
module Cxt.Extension
) where
import Cxt.Types
import Cxt.Extension
| null | https://raw.githubusercontent.com/AndrasKovacs/sett/69b5a6d55358c5977eec282effca45fa04f89178/src/Cxt.hs | haskell |
module Cxt (
module Cxt.Types,
module Cxt.Extension
) where
import Cxt.Types
import Cxt.Extension
| |
b5962e58bbe63a42b71e777bc593b7e63f685f88a9550b9b306578b68a8b5cad | sleexyz/hylogen-fun | Cool.hs | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
{-# LANGUAGE ExplicitForAll #-}
module Cool where
import Hylogen.WithHylide
import Data.VectorSpace
import Data.Function
import Control.Arrow
sel : : n = > Booly - > > > Vec n
-- sel b x y = b ? (x, y)
rot :: Vec... | null | https://raw.githubusercontent.com/sleexyz/hylogen-fun/1f42a4a0d3db418f1786292186b8ff861d3f4011/Cool.hs | haskell | # LANGUAGE ExplicitForAll #
sel b x y = b ? (x, y)
> > > ( \x - > x + vec2 ( 0 , n $ audio!Y ) )
-- >>> (rot (audio!X))
>>> (rot (pi/3))
> > > ( \x - > x + vec2 ( 0 , n $ audio!Y ) )
-- >>> (rot (audio!X))
>>> (rot (x_ audio)) | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Cool where
import Hylogen.WithHylide
import Data.VectorSpace
import Data.Function
import Control.Arrow
sel : : n = > Booly - > > > Vec n
rot :: Vec1 -> Vec2 -> Vec2
rot phi a = vec2 ( cos phi * (x_ a)
... |
09a8a61fff61fdff92128ba4084ffaebe54e78b3b602e9e399535eb835656a2d | deobald/sicp-clojure | ex2_28.clj | (ns sec2_2.ex2_28
(:use clojure.test))
(def x '((1 2) (3 4)))
(defn append [list1 list2]
(if (empty? list1)
list2
(cons (first list1) (append (rest list1) list2))))
(defn fringe [x]
(cond (nil? x) nil
(not (seq? x)) (list x)
(empty? x) '()
:default (append (fringe (first x)) (f... | null | https://raw.githubusercontent.com/deobald/sicp-clojure/fc24e5114604e7a0510dab779bbff962aac7ee7e/src/sec2_2/ex2_28.clj | clojure | (ns sec2_2.ex2_28
(:use clojure.test))
(def x '((1 2) (3 4)))
(defn append [list1 list2]
(if (empty? list1)
list2
(cons (first list1) (append (rest list1) list2))))
(defn fringe [x]
(cond (nil? x) nil
(not (seq? x)) (list x)
(empty? x) '()
:default (append (fringe (first x)) (f... | |
f1cabd281ce004138075382a184ebb3bc8eca526d8894f412f91134d11fbc389 | craff/pacomb | sexp.ml | open Pacomb
let test = Array.length Sys.argv > 1 && Sys.argv.(1) = "--test"
let random_id () =
let c = Char.chr (Char.code 'a' + Random.int 26) in
let n = string_of_int (Random.int 1000) in
String.make 1 c ^ n
let print_spaces ch lvl =
output_string ch "\n";
for _ = 1 to lvl do
output_string ch "\t"
... | null | https://raw.githubusercontent.com/craff/pacomb/3e83f56bc483f6b9c495ae91d773aa9b484eb321/benchmarks/sexp/sexp.ml | ocaml | blanks | open Pacomb
let test = Array.length Sys.argv > 1 && Sys.argv.(1) = "--test"
let random_id () =
let c = Char.chr (Char.code 'a' + Random.int 26) in
let n = string_of_int (Random.int 1000) in
String.make 1 c ^ n
let print_spaces ch lvl =
output_string ch "\n";
for _ = 1 to lvl do
output_string ch "\t"
... |
26323cf7305e7b0ea2b8f516e1823cfbaa6ddfd5faf9daf63c910b0c96601a1b | kupl/LearnML | patch.ml | let rec iter ((n : int), (f : int -> int)) x : int =
if n = 0 then x else f (iter (n - 1, f) x)
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/iter/sub17/patch.ml | ocaml | let rec iter ((n : int), (f : int -> int)) x : int =
if n = 0 then x else f (iter (n - 1, f) x)
| |
6d45cb10e254bc40087db893098f4d887f5d7829c4d6eda41338e4f36b1b3f9b | grin-compiler/grin | Check.hs | # LANGUAGE LambdaCase , BangPatterns #
module Test.Check where
import AbstractInterpretation.HeapPointsTo.Result
import Control.Arrow
import Data.Functor.Foldable
import Data.Maybe
import Data.Monoid
import Grin.Grin
import Data.List as List
import Data.Map.Strict as Map
import Data.Set as Set hiding (fo... | null | https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/src/Test/Check.hs | haskell | AllowedBindStoreValues -> boolResult . allowedBindStoreValues
| Names introduced by fetch def and patterns.
Exp
Alt
| Names that are used in the entire program.
Exp | # LANGUAGE LambdaCase , BangPatterns #
module Test.Check where
import AbstractInterpretation.HeapPointsTo.Result
import Control.Arrow
import Data.Functor.Foldable
import Data.Maybe
import Data.Monoid
import Grin.Grin
import Data.List as List
import Data.Map.Strict as Map
import Data.Set as Set hiding (fo... |
a551679396476ab0408205dd4f94b8988680469efcc0dccdc4e4797c9c7be160 | opencog/opencog | where-q.scm | ; This rule is for where questions without the verb "be"
such as " Where do you go every night ? "
( AN June 2015 )
(define where-q
(BindLink
(VariableList
(var-decl "$a-parse" "ParseNode")
(var-decl "$verb" "WordInstanceNode")
(var-decl "$verb-lemma" "WordNode")
(var-decl "$qVar" "WordInstanceNode"... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/opencog/nlp/relex2logic/rules/where-q.scm | scheme | This rule is for where questions without the verb "be" | such as " Where do you go every night ? "
( AN June 2015 )
(define where-q
(BindLink
(VariableList
(var-decl "$a-parse" "ParseNode")
(var-decl "$verb" "WordInstanceNode")
(var-decl "$verb-lemma" "WordNode")
(var-decl "$qVar" "WordInstanceNode")
)
(AndLink
(word-in-parse "$verb" "$a-parse")
... |
6aabc3f93edd2499cd5318d10ebfee0ba07b576c25860deff467088d7d5c8e96 | eslachance/dithcord | storage.clj | (ns dithcord.storage
(:gen-class)
(:require [datascript.core :as d]
[clojure.string :as str]))
(def schema
{:guild/id {:db/unique :db.unique/identity}
:channel/id {:db/unique :db.unique/identity}
:message/id {:db/unique :db.unique/identity}
:role/id {:db/unique :db.unique/identity}
:emoji... | null | https://raw.githubusercontent.com/eslachance/dithcord/816337e801086b268098d5950ed873c2620ca4f5/src/dithcord/storage.clj | clojure | (get (:tempids result) -1)
blah | (ns dithcord.storage
(:gen-class)
(:require [datascript.core :as d]
[clojure.string :as str]))
(def schema
{:guild/id {:db/unique :db.unique/identity}
:channel/id {:db/unique :db.unique/identity}
:message/id {:db/unique :db.unique/identity}
:role/id {:db/unique :db.unique/identity}
:emoji... |
728e642dc67823dbcf71d9543d57fb5e5278b40044ec849d4699971f2a43ee85 | mpickering/eventlog2html | Events.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE StrictData #-}
# LANGUAGE ViewPatterns #
# LANGUAGE TypeApplications #
module Eventlog.Events(chunk) where
import GHC.RTS.Events hiding (Header, header, liveBytes, blocksSize)
import Prelude hiding (init, lookup)
i... | null | https://raw.githubusercontent.com/mpickering/eventlog2html/170eea6bddb224bcf0e1fd303921d1d348537b31/src/Eventlog/Events.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
If both keys are present, combine
If total is missing, something bad has happened
is the only mode to populate the bucket map
Traces
Messages and UserMessages correspond to high-frequency "traceEvent" or "traceEventIO" events from Debug.Trace and
are only inc... | # LANGUAGE RecordWildCards #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ViewPatterns #
# LANGUAGE TypeApplications #
module Eventlog.Events(chunk) where
import GHC.RTS.Events hiding (Header, header, liveBytes, blocksSize)
import Prelude hiding (init, lookup)
import qualified Data.Text as T
import qualified Data.Text.IO as... |
3b8441296853d5f11f253481850ad142bb95a0fe66eb4672fb2ce5c908d112ae | tlaplus/tlapm | pars.ml |
* Copyright ( C ) 2012 INRIA and Microsoft Corporation
* Copyright (C) 2012 INRIA and Microsoft Corporation
*)
module Error = Error
module Intf = Intf
module LazyList = LazyList
module Pco = Pco
| null | https://raw.githubusercontent.com/tlaplus/tlapm/158386319f5b6cd299f95385a216ade2b85c9f72/src/pars.ml | ocaml |
* Copyright ( C ) 2012 INRIA and Microsoft Corporation
* Copyright (C) 2012 INRIA and Microsoft Corporation
*)
module Error = Error
module Intf = Intf
module LazyList = LazyList
module Pco = Pco
| |
6bc518fa6fa8daa57a0a20cff2752aa68b5e2bf6c48b0964c50c5592020348ad | soegaard/bracket | equation-solving.rkt | #lang bracket
DeclareVars(x,a,b,c);
% x = 1/2
% 1=1
Solve(2*x+3=1,x); % x = -1
Solve(a*x+b=c,x); % x = (c-b)/a
solution:=Solve(a*x+b+x=c,x);
solution;
% Check solution
Expand(Substitute(a*x+b+x,solution)); % This actually simplifies to c
% ... unfortunately not automatically.
| null | https://raw.githubusercontent.com/soegaard/bracket/3d0ace16cf0dbcee4952fd729796e4362e27faa0/bracket/examples/equation-solving.rkt | racket |
% x = -1
% x = (c-b)/a
% This actually simplifies to c | #lang bracket
% x = 1/2
% 1=1
% Check solution
% ... unfortunately not automatically.
|
895a9dbcf4050d555859b6444a7c986809ec5ecaea1166d8fb6b253e2bb1c61d | CindyLinz/Haskell.js | CaseReorder.hs | module Desugar.CaseReorder where
import Language.Haskell.Exts.Annotated.Syntax
import Control.Arrow ((***))
import qualified Data.Map.Strict as M
import CollectData
import SymbolTable
import ForgetL
import Debug.Trace
data OrderedCase l
= OrderedCase
l
(Name l) -- target variable name x0-, x1-..
[Fallba... | null | https://raw.githubusercontent.com/CindyLinz/Haskell.js/78429a49181a15f6bdae426f17bdae722ad17141/trans/src/Desugar/CaseReorder.hs | haskell | target variable name x0-, x1-..
constructor
# UNPACK #
slot begin
# UNPACK #
slot number
constructor
# UNPACK #
slot number
# UNPACK #
slot begin
trace ("sortPat " ++ show (fmap forgetL alts)) $
trace ("eatCons " ++ show (length acc) ++ " " ++ show (forgetL g)) $
trace ("buildBranch " ++ show (length os)) $... | module Desugar.CaseReorder where
import Language.Haskell.Exts.Annotated.Syntax
import Control.Arrow ((***))
import qualified Data.Map.Strict as M
import CollectData
import SymbolTable
import ForgetL
import Debug.Trace
data OrderedCase l
= OrderedCase
l
[FallbackGroup l]
| OrderedCaseRHS l (Rhs l) (Maybe (... |
ba2f58f32fdac4f5c0bacc5f9940c808f31e57a8c94fdd1e6d2ee95aba0f1770 | lipas-liikuntapaikat/lipas | routes.cljs | (ns lipas.ui.swimming-pools.routes
(:require
[lipas.ui.utils :as utils :refer [==>]]
[lipas.ui.swimming-pools.events :as events]
[lipas.ui.swimming-pools.views :as views]))
(def routes
["uimahallit"
{:name :lipas.ui.routes/swimming-pools
:tr-key :swim/headline
:view views/main
:controll... | null | https://raw.githubusercontent.com/lipas-liikuntapaikat/lipas/f60185b597d2a7fca5480b392cd33187bccfb34a/webapp/src/cljs/lipas/ui/swimming_pools/routes.cljs | clojure | (ns lipas.ui.swimming-pools.routes
(:require
[lipas.ui.utils :as utils :refer [==>]]
[lipas.ui.swimming-pools.events :as events]
[lipas.ui.swimming-pools.views :as views]))
(def routes
["uimahallit"
{:name :lipas.ui.routes/swimming-pools
:tr-key :swim/headline
:view views/main
:controll... | |
8e384016382ceab648166765ba346ae3a7388db27b6d562250a44f85750fa592 | kadena-io/chainweb-node | InMemory.hs | # LANGUAGE ScopedTypeVariables #
-- |
Module : Chainweb . Payload . PayloadStore . InMemory
Copyright : Copyright © 2018 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
-- Stability: experimental
--
-- An in-memory block payload store.
--
module Chainweb.Payload.PayloadStore.InMemory
( newPayloadDb
-- *... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/aff594a05096341d01ae50a9f37056b2519025d2/src/Chainweb/Payload/PayloadStore/InMemory.hs | haskell | |
Stability: experimental
An in-memory block payload store.
* Internal
internal modules
-------------------------------------------------------------------------- -- | # LANGUAGE ScopedTypeVariables #
Module : Chainweb . Payload . PayloadStore . InMemory
Copyright : Copyright © 2018 - 2020 Kadena LLC .
License : MIT
Maintainer : < >
module Chainweb.Payload.PayloadStore.InMemory
( newPayloadDb
, newBlockPayloadStore
, newBlockTransactionsStore
, newTransactionDb
, newBloc... |
ad21bc4f5099bba39a8a221dddc60cfb75e7473857631994a03de371a6d1da3b | kelsey-sorrels/robinson | dialog.clj | ;; Functions for drawing dialog trees as finite state machines
(ns robinson.dialog
(:require [robinson.common :as rc]
[taoensso.timbre :as log]
[dorothy.core :refer :all]))
State Machine Functions
;; =======================
(defn state-machine [transition-table initial-state]
{:pre [
... | null | https://raw.githubusercontent.com/kelsey-sorrels/robinson/337fd2646882708331257d1f3db78a3074ccc67a/src/robinson/dialog.clj | clojure | Functions for drawing dialog trees as finite state machines
=======================
Make sure all destination states are valid states
and that there are no unused states. Ie destination
states and state sets are identical.
Make sure that initial-state is a valid state.
Dorothy Drawing Functions
================... | (ns robinson.dialog
(:require [robinson.common :as rc]
[taoensso.timbre :as log]
[dorothy.core :refer :all]))
State Machine Functions
(defn state-machine [transition-table initial-state]
{:pre [
(let [states (map first transition-table)
dest-states (map last (re... |
2824d2135526dbca4518a6affb36cecf3d64db88a0362bb2a2f4cfe091e67911 | pandoc/pandoc-lua-marshal | Cell.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
|
Copyright : © 2021 - 2023 SPDX - License - Identifier : MIT
Maintainer : >
Marshaling / unmarshaling functions of table ' Cell ' values .
Copyright : © 2021-2023 Albert Krewinkel
SPDX-... | null | https://raw.githubusercontent.com/pandoc/pandoc-lua-marshal/26b95fe3a8ef95588d98916f0d6beb7aaa93f786/src/Text/Pandoc/Lua/Marshal/Cell.hs | haskell | # LANGUAGE OverloadedStrings #
# SOURCE #
| Retrieves a 'Cell' object from the stack.
| Retrieves a 'Cell' from the stack, accepting either a 'pandoc Cell'
userdata object or a table with fields @attr@, @alignment@, @row_span@,
@col_span@, and @contents@.
| Cell object type.
| Constructor function for 'Cell' v... | # LANGUAGE LambdaCase #
|
Copyright : © 2021 - 2023 SPDX - License - Identifier : MIT
Maintainer : >
Marshaling / unmarshaling functions of table ' Cell ' values .
Copyright : © 2021-2023 Albert Krewinkel
SPDX-License-Identifier : MIT
Maintainer ... |
2827bc835f029266fb2e255d8c59604d61ff77ced0c13e4ec1e3f5215896467c | blindglobe/clocc | tests.lisp | ;;; Regression Testing
;;;
Copyright ( C ) 1999 - 2008 by
This is Free Software , covered by the GNU GPL ( v2 + )
;;; See
;;;
$ I d : tests.lisp , v 2.52 2008/11/24 18:56:33 sds Exp $
;;; $Source: /cvsroot/clocc/clocc/src/cllib/tests.lisp,v $
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/cllib/tests.lisp | lisp | Regression Testing
See
$Source: /cvsroot/clocc/clocc/src/cllib/tests.lisp,v $
`mesg'
`with-collect'
these files will be tested:
file tests.lisp ends here | Copyright ( C ) 1999 - 2008 by
This is Free Software , covered by the GNU GPL ( v2 + )
$ I d : tests.lisp , v 2.52 2008/11/24 18:56:33 sds Exp $
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :cllib-base (translate-logical-pathname "clocc:src;cllib;base"))
(require :cllib-log (translate-lo... |
052dc17d5f298914e71b579cb1f4511fc322d82eb7fb195c773cf3fb9622a3ca | mtpearce/idyom | midi2db.lisp | ;;;; ======================================================================
;;;; File: midi2db.lisp
Author : < >
Created : < 2007 - 03 - 21 09:47:26 >
Time - stamp : < 2019 - 04 - 08 14:03:58 >
;;;; ======================================================================
(cl:in-package #:midi2d... | null | https://raw.githubusercontent.com/mtpearce/idyom/d0449a978c79f8ded74c509fdfad7c1a253c5a80/database/data-import/midi2db.lisp | lisp | ======================================================================
File: midi2db.lisp
======================================================================
(format t "~&Convert-midi-file: ~A~%" f)
Convert MIDI into
i) a property list of note
ii) an association list of (note onset . pitch bend) pairs
... | Author : < >
Created : < 2007 - 03 - 21 09:47:26 >
Time - stamp : < 2019 - 04 - 08 14:03:58 >
(cl:in-package #:midi2db)
(defvar *timebase* 96 "Basic time units per semibreve")
(defvar *middle-c* (list 60 35) "Chromatic and diatonic integer mappings for c_4")
(defvar *default-midifile-extension* "... |
c5abdb657ee01cb797a26572b252a7a9279e359557ead369c4c5981c8f405084 | dbuenzli/vg | vgr_svg.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2013 The vg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/dbuenzli/vg/2d0cd56636a17280fe938ecaafc6402383dca1f3/src/vgr_svg.ml | ocaml | subset of the graphics state saved by a <g>.
current transformation without view transform.
corresponding renderer.
formatting buffer.
temporary buffer.
cost counter for limit.
current renderable view rectangle.
commands to perform.
uid generator.
cached fonts.
cached primitives.
cached paths.
... | ---------------------------------------------------------------------------
Copyright ( c ) 2013 The vg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
68cef8d27ae4aa630dce6883c59f2311e0ad8008fafac442ef742c6c5ed1e6a0 | gbour/wave | wave_acl.erl | %%
Wave - MQTT Broker
Copyright ( C ) 2014 - 2016 -
%%
%% This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation , version 3 of the License .
%%
%% This program is distribut... | null | https://raw.githubusercontent.com/gbour/wave/fe5b78408a7c6e723b19cd454068958058e5e072/apps/wave/src/wave_acl.erl | erlang |
This program is free software: you can redistribute it and/or modify
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
along with this program. If not, see ... | Wave - MQTT Broker
Copyright ( C ) 2014 - 2016 -
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation , version 3 of the License .
GNU Affero General Public License for more details .
You should have received a copy of the GNU Affero Ge... |
cfb15907ccf716b5a3b4d22509d7cc47dfe872b8db29d5bf46a3b84b7342770f | jafingerhut/clojure-benchmarks | knucleotide.clj-11.clj | The Computer Language Benchmarks Game
;; /
contributed by
(ns knucleotide
(:gen-class)
(:require [clojure.string :as str]))
(set! *warn-on-reflection* true)
(defn my-lazy-map [f coll]
(lazy-seq
(when-let [s (seq coll)]
(cons (f (first s)) (my-lazy-map f (rest s))))))
modified - pmap i... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/knucleotide/knucleotide.clj-11.clj | clojure | /
parallelism as specified by the parameter num-threads. Uses
my-lazy-map instead of map from core.clj, since that version of map
can use unwanted additional parallelism for chunked collections,
like ranges.
ASCII strings as byte arrays (versus Java Strings, which require
more memory per ASCII character), but... | The Computer Language Benchmarks Game
contributed by
(ns knucleotide
(:gen-class)
(:require [clojure.string :as str]))
(set! *warn-on-reflection* true)
(defn my-lazy-map [f coll]
(lazy-seq
(when-let [s (seq coll)]
(cons (f (first s)) (my-lazy-map f (rest s))))))
modified - pmap is like ... |
d84fb64a443a66fb9195e82b8bf2ebb500594cb9713f83f38acad97e9da7b240 | jeffa5/ocaml-grpc | greeter_server_lwt.ml | open Grpc_lwt
let say_hello decoder =
let req = Greeter.Greeter_pb.decode_hello_request decoder in
Format.printf "Received %a" Greeter.Greeter_pp.pp_hello_request req;
print_endline req.name;
let message =
if req.name = "" then "You forgot your name!"
else Format.sprintf "Hello, %s!" req.name
in
le... | null | https://raw.githubusercontent.com/jeffa5/ocaml-grpc/efd6dbfc2d044fef97b122f831a8c162d9d46625/examples/greeter-server-lwt/greeter_server_lwt.ml | ocaml | open Grpc_lwt
let say_hello decoder =
let req = Greeter.Greeter_pb.decode_hello_request decoder in
Format.printf "Received %a" Greeter.Greeter_pp.pp_hello_request req;
print_endline req.name;
let message =
if req.name = "" then "You forgot your name!"
else Format.sprintf "Hello, %s!" req.name
in
le... | |
710d5ae07b2eec3f86430f50536bbbe30e3eda53a25cec8c486854fdde3e2fc0 | gsakkas/rite | 20060323-23:58:10-8a98128ae553a921e83e0e588be1843b.seminal.ml |
exception Unimplemented
exception AlreadyDone
let pi = 3.14159
(*** part a ***)
type move = Home | Forward of float | Turn of float | For of (int * (move list))
(*** part b ***)
let makePoly sides len = For(sides, (Forward(len)::[Turn(2.0 *. pi /. float_of_int(sides))]))
(*** part c ***)
let interpLar... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060323-23%3A58%3A10-8a98128ae553a921e83e0e588be1843b.seminal.ml | ocaml | ** part a **
** part b **
** part c **
** part d **
** part e **
** part f **
** possibly helpful testing code ** |
exception Unimplemented
exception AlreadyDone
let pi = 3.14159
type move = Home | Forward of float | Turn of float | For of (int * (move list))
let makePoly sides len = For(sides, (Forward(len)::[Turn(2.0 *. pi /. float_of_int(sides))]))
let interpLarge (movelist : move list) : (float*float) list =
l... |
1ca563181efd3b63288c36ffd61d8c64b3b1d28ac74f0676e866823bc069ec96 | JeffreyBenjaminBrown/hode | Demo.hs | -- | Unused, but potentially helpful (particularly `demo`)
for understanding . Brick . ScreenWrap .
# LANGUAGE ScopedTypeVariables #
module Hode.Brick.Wrap.Demo
^ IO ( )
, colorStringWrap -- ^ [(String,V.Attr)] -> Widget n
) where
import Lens.Micro
import Brick.Main
import Brick.Types
import Bric... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/hode/79a54a6796fa01570cde6903b398675c42954e62/earlier-work/Brick.Wrap/Demo.hs | haskell | | Unused, but potentially helpful (particularly `demo`)
^ [(String,V.Attr)] -> Widget n
| `colorStringWrap` appears to have been totally unnecessary.
I wrote it because I thought `colorStringWrap` wasn't working,
when in fact the problem was `toLines`.
It is based on `Brick.Widgets.Core.txtWrapWith`. | for understanding . Brick . ScreenWrap .
# LANGUAGE ScopedTypeVariables #
module Hode.Brick.Wrap.Demo
^ IO ( )
) where
import Lens.Micro
import Brick.Main
import Brick.Types
import Brick.Widgets.Core
import qualified Graphics.Vty as V
import Control.DeepSeq (force)
import Hode.Brick
demo :: IO (... |
63f7f89514613d99cc9e7549247c7fd218173cb4129e79a5e54664987899255e | bazurbat/chicken-scheme | typematch-tests.scm | ;;;; typematch-tests.scm
(use srfi-1 lolevel data-structures)
(define-syntax check
(syntax-rules ()
((_ x not-x t)
(begin
(print "check " 't " " 'x)
(compiler-typecase x
(t 'ok))
(compiler-typecase not-x
((not t) 'ok))))))
(define-syntax checkp
(syntax-rules ()
((_ p x t)
... | null | https://raw.githubusercontent.com/bazurbat/chicken-scheme/f0c9d1fd8b68eb322e320e65ec40b0bf7d1b41dc/tests/typematch-tests.scm | scheme | typematch-tests.scm
pairs
special cases
clause order is respected |
(use srfi-1 lolevel data-structures)
(define-syntax check
(syntax-rules ()
((_ x not-x t)
(begin
(print "check " 't " " 'x)
(compiler-typecase x
(t 'ok))
(compiler-typecase not-x
((not t) 'ok))))))
(define-syntax checkp
(syntax-rules ()
((_ p x t)
(let ((tmp x))
... |
465202b363c6f39eb16cd8f9dac2b983037a443f5025656b68aafb2ef9193cac | thierry-martinez/stdcompat | pervasives.mli | external raise : exn -> 'a = "%raise"
val invalid_arg : string -> 'a
val failwith : string -> 'a
exception Exit
external (=) : 'a -> 'a -> bool = "%equal"
external (<>) : 'a -> 'a -> bool = "%notequal"
external (<) : 'a -> 'a -> bool = "%lessthan"
external (>) : 'a -> 'a -> bool = "%greaterthan"
external (<=) : 'a -> ... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/4.00/pervasives.mli | ocaml | external raise : exn -> 'a = "%raise"
val invalid_arg : string -> 'a
val failwith : string -> 'a
exception Exit
external (=) : 'a -> 'a -> bool = "%equal"
external (<>) : 'a -> 'a -> bool = "%notequal"
external (<) : 'a -> 'a -> bool = "%lessthan"
external (>) : 'a -> 'a -> bool = "%greaterthan"
external (<=) : 'a -> ... | |
7f035c7ea2d3d99284fb372636fb89550368de4001d770a5bef783d9d26e7d73 | rmculpepper/gamble | church-compat.rkt | #lang gamble
(require (for-syntax racket/base
syntax/parse))
(provide all
any
fold
pair
sum
uniform-draw
multinomial
rejection-query
enumeration-query)
(define (all ls) (andmap values ls))
(define (any ls) (ormap values ls))
(... | null | https://raw.githubusercontent.com/rmculpepper/gamble/a5231e2eb3dc0721eedc63a77ee6d9333846323e/gamble/examples/forestdb/church-compat.rkt | racket | #lang gamble
(require (for-syntax racket/base
syntax/parse))
(provide all
any
fold
pair
sum
uniform-draw
multinomial
rejection-query
enumeration-query)
(define (all ls) (andmap values ls))
(define (any ls) (ormap values ls))
(... | |
f5f9462abf361f89799c6c294f42348d94ac4d7c1504449478bf5527cc2a3c7b | lemmaandrew/CodingBatHaskell | countXX.hs | From
Count the number of \"xx\ " in the given string . We 'll say that overlapping is allowed ,
so \"xxx\ " contains 2 \"xx\ " .
Count the number of \"xx\" in the given string. We'll say that overlapping is allowed,
so \"xxx\" contains 2 \"xx\".
-}
import Test.Hspec ( hspec, describe, it, shouldBe )
countXX... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Warmup-2/countXX.hs | haskell | From
Count the number of \"xx\ " in the given string . We 'll say that overlapping is allowed ,
so \"xxx\ " contains 2 \"xx\ " .
Count the number of \"xx\" in the given string. We'll say that overlapping is allowed,
so \"xxx\" contains 2 \"xx\".
-}
import Test.Hspec ( hspec, describe, it, shouldBe )
countXX... | |
34494ebe6d81bdb515d82f5005e712c0d67ed8d1538871e52e0a2535994d3bbf | bravit/hid-examples | Main.hs | import SimplifyWiden
import Unescape
import XListable
import Graphs
testGraphs :: IO ()
testGraphs = do
print $ neighbors g1 0
print $ isLoop g1 (MkEdge1 0 1)
main :: IO ()
main = do
print $ simplify True ++ " " ++ widen 'x'
print $ simplify answer + widen (widen False)
uprint "Привет, мир!"
print $ and [... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch11/type-families/Main.hs | haskell | import SimplifyWiden
import Unescape
import XListable
import Graphs
testGraphs :: IO ()
testGraphs = do
print $ neighbors g1 0
print $ isLoop g1 (MkEdge1 0 1)
main :: IO ()
main = do
print $ simplify True ++ " " ++ widen 'x'
print $ simplify answer + widen (widen False)
uprint "Привет, мир!"
print $ and [... | |
6415047ee295775fbd9fe070180b4bdf9226e434a61022e19027fac66100eedc | BitGameEN/bitgamex | compress_h.erl | %% This module sends a response body of varying sizes to test
%% the cowboy_compress_h stream handler.
-module(compress_h).
-export([init/2]).
init(Req0, State=reply) ->
Req = case cowboy_req:binding(what, Req0) of
<<"small">> ->
cowboy_req:reply(200, #{}, lists:duplicate(100, $a), Req0);
<<"large">> ->
c... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/cowboy/test/handlers/compress_h.erl | erlang | This module sends a response body of varying sizes to test
the cowboy_compress_h stream handler. |
-module(compress_h).
-export([init/2]).
init(Req0, State=reply) ->
Req = case cowboy_req:binding(what, Req0) of
<<"small">> ->
cowboy_req:reply(200, #{}, lists:duplicate(100, $a), Req0);
<<"large">> ->
cowboy_req:reply(200, #{}, lists:duplicate(100000, $a), Req0);
<<"content-encoding">> ->
cowboy_req... |
065fecdd9ac63cf0c9d94303fe47850b8a9171b6593d276c378f8d3d0f8497f3 | donaldsonjw/bigloo | man.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / bglpkg / man.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/bglpkg/man.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* man */
*===========================... | * serrano / prgm / project / bigloo / bglpkg / man.scm * /
* Author : * /
* Creation : Sun Feb 25 09:17:51 2007 * /
* Last change : Tue Apr 24 08:41:32 2007 ( serrano ) * /
* Copyri... |
c3a3df7698bf73279a5abb64bafe1b2d4673c455553f6481a76d70120f775ca9 | seriyps/xhttpc | compression_middleware_tests.erl | @author < >
( C ) 2013 ,
%%% @doc
%%%
%%% @end
Created : 27 Jun 2013 by < >
-module(compression_middleware_tests).
-include_lib("eunit/include/eunit.hrl").
-include("xhttpc.hrl").
-include("xhttpc_test.hrl").
comp_middleware_test_() ->
{foreach,
fun() ->
Se = xhttpc:init([]),
... | null | https://raw.githubusercontent.com/seriyps/xhttpc/ae5a8ab5f1d9a301e31dcf0b0b464de747816637/test/compression_middleware_tests.erl | erlang | @doc
@end | @author < >
( C ) 2013 ,
Created : 27 Jun 2013 by < >
-module(compression_middleware_tests).
-include_lib("eunit/include/eunit.hrl").
-include("xhttpc.hrl").
-include("xhttpc_test.hrl").
comp_middleware_test_() ->
{foreach,
fun() ->
Se = xhttpc:init([]),
St = compres... |
3bf4fcc09427914a7fb82adb9be1411369a8cacb20572c886ae4cc9623bd9de0 | alanzplus/EOPL | 2.26.rkt | #lang eopl
; red-blue-tree ::= red-blue-subtree
; red-blue-subtree ::= (red-node Red-blue-subtree Red-blue-subtree)
; ::= (blue-node {Red-blue-subtree}*)
; ::= (leaf-node Int)
(provide red-node)
(provide blue-node)
(provide leaf-node)
(provide mark-leaves-with-red-depth)
(define-dat... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch2/2.26.rkt | racket | red-blue-tree ::= red-blue-subtree
red-blue-subtree ::= (red-node Red-blue-subtree Red-blue-subtree)
::= (blue-node {Red-blue-subtree}*)
::= (leaf-node Int) | #lang eopl
(provide red-node)
(provide blue-node)
(provide leaf-node)
(provide mark-leaves-with-red-depth)
(define-datatype red-blue-tree red-blue-tree?
(red-node
(left red-blue-tree?)
(right red-blue-tree?))
(blue-node
(children (list-of red-blue-tree?)))
(leaf-node
(int integer?)))
(define l... |
c5bec865d306d5ee93c763d31db72cf22192abfd66bc43d0ab711f05e916b121 | UU-ComputerScience/js-asteroids | String.hs | # LANGUAGE MultiParamTypeClasses #
module Language.UHC.JS.ECMA.String where
import Language.UHC.JS.Types
import Language.UHC.JS.Marshal
foreign import js "String.fromCharCode(%*)"
fromCharCode :: Int -> JSString
foreign import js "String.fromCharCode(%*)"
fromCharCode2 :: Int -> Int -> JSString
-- etc.
foreign ... | null | https://raw.githubusercontent.com/UU-ComputerScience/js-asteroids/b7015d8ad4aa57ff30f2631e0945462f6e1ef47a/uhc-js/uhc-js/src/Language/UHC/JS/ECMA/String.hs | haskell | etc.
etc.
TODO: The argument to match() should be a regex. Define a regex type?
TODO: The separator argument can also be a RegExp | # LANGUAGE MultiParamTypeClasses #
module Language.UHC.JS.ECMA.String where
import Language.UHC.JS.Types
import Language.UHC.JS.Marshal
foreign import js "String.fromCharCode(%*)"
fromCharCode :: Int -> JSString
foreign import js "String.fromCharCode(%*)"
fromCharCode2 :: Int -> Int -> JSString
foreign import j... |
54172b6740e89310a0f05566f92513de06d9c5a8c998d940826b47d25b33878c | Gabriella439/slides | reject.hs | import Prelude hiding (abs)
{-@ abs :: Int -> { n : Int | 0 <= n } @-}
abs :: Int -> Int
abs x = x
| null | https://raw.githubusercontent.com/Gabriella439/slides/b3f4c33e3714e186c309aa791ca1bcce68b3cc74/liquidhaskell/examples/reject.hs | haskell | @ abs :: Int -> { n : Int | 0 <= n } @ | import Prelude hiding (abs)
abs :: Int -> Int
abs x = x
|
78b57f0759b7d8402174649327b9e1eb2048d5de4f91b0bf50cb1b39cd5229dc | simmone/racket-simple-qr | poly-dic-func-test.rkt | #lang racket
(require rackunit/text-ui)
(require rackunit "../../../write/lib/func/poly/poly-dic-func.rkt")
(define test-poly-dic-func
(test-suite
"test-poly-dic-func"
(test-case
"test-get-ploy"
(check-equal? (get-poly 42)
"a0x42+a250x41+a103x40+a221x39+a230x38+a25x37+a18x36+a137... | null | https://raw.githubusercontent.com/simmone/racket-simple-qr/904f1491bc521badeafeabd0d7d7e97e3d0ee958/simple-qr/tests/write/func/poly-dic-func-test.rkt | racket | #lang racket
(require rackunit/text-ui)
(require rackunit "../../../write/lib/func/poly/poly-dic-func.rkt")
(define test-poly-dic-func
(test-suite
"test-poly-dic-func"
(test-case
"test-get-ploy"
(check-equal? (get-poly 42)
"a0x42+a250x41+a103x40+a221x39+a230x38+a25x37+a18x36+a137... | |
8eab22a2a495868ece0a55a813cae2428aae0874e6faacd4fbb43e7c44229615 | pjotrp/guix | compression.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/compression.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as... |
4d8967129a3d2df5445967d454522f9f305ad7a3506d79d6b4bbe1712f8091f6 | ajhc/ajhc | FindFixpoint.hs | module FindFixpoint(Ms, getVal, solve) where
import Data.Array
import Control.Monad.Writer
import Data.Array.IO
import Data.Graph
import Data.IntSet as IntSet
import Util.Gen
data Env b = Env {-# UNPACK #-} !(IOArray Int b) {-# UNPACK #-} !(IOArray Int (IntSet)) {-# UNPACK #-} !Int
newtype Ms b c = Ms' (Env b -> IO ... | null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/src/FindFixpoint.hs | haskell | # UNPACK #
# UNPACK #
# UNPACK #
# INLINE (>>) #
# INLINE (>>=) #
li xs [] n = CharIO.putErr ("[" ++ show (I# n) ++ "]") >> li xs xs 0# | module FindFixpoint(Ms, getVal, solve) where
import Data.Array
import Control.Monad.Writer
import Data.Array.IO
import Data.Graph
import Data.IntSet as IntSet
import Util.Gen
newtype Ms b c = Ms' (Env b -> IO c)
instance Monad (Ms b) where
return a = Ms' (\_ -> return a)
Ms' comp >>= fun
= Ms' (\v -... |
f029c0ab3a3e51473bd36c0dce46435204eced1f74cc3ed2c7aae1aa40095ac1 | appleshan/cl-http | post-http.lisp | (in-package :http)
(defun ftp-copy-file-to-http-stream (from-pathname http-stream &key (port 21) data-type url additional-headers
(user-id "anonymous") (user-pw (server-mail-address)))
"Copies the content of FROM-PATHNAME to HTTP-STREAM."
(declare (values success-... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/contrib/kpoeck/port-template/allegro/post-http.lisp | lisp | (in-package :http)
(defun ftp-copy-file-to-http-stream (from-pathname http-stream &key (port 21) data-type url additional-headers
(user-id "anonymous") (user-pw (server-mail-address)))
"Copies the content of FROM-PATHNAME to HTTP-STREAM."
(declare (values success-... | |
d0bbb9b09a8f657e1e835dd875574308591e9095eece224c67a18935c9f769b3 | HaskellEmbedded/data-stm32 | Exception.hs |
module Ivory.BSP.ARMv7M.Exception where
newtype IRQn = IRQn { unIRQn :: Integer }
deriving (Eq, Show, Ord)
data Exception
= Reset
| NonMaskable
| HardFault
| MemoryManagment
| BusFault
| UsageFault
| SVCall
| DebugMonitor
| PendSV
| SysTick
deriving (Eq, Show, Enum)
exceptionHandlerName :: E... | null | https://raw.githubusercontent.com/HaskellEmbedded/data-stm32/204aff53eaae422d30516039719a6ec7522a6ab7/templates/ARMv7M/Exception.hs | haskell |
module Ivory.BSP.ARMv7M.Exception where
newtype IRQn = IRQn { unIRQn :: Integer }
deriving (Eq, Show, Ord)
data Exception
= Reset
| NonMaskable
| HardFault
| MemoryManagment
| BusFault
| UsageFault
| SVCall
| DebugMonitor
| PendSV
| SysTick
deriving (Eq, Show, Enum)
exceptionHandlerName :: E... | |
b5fd7bc672c12d5b4b5f75cfd1a8fe629e714ac9df2858b9fa612c6e41f8ccfc | marick/Midje | t_isolated_metaconstants.clj | (ns behaviors.t-isolated-metaconstants
(:require [midje.sweet :refer :all]))
(defn verify-service [service]
true)
(declare f)
;; In version with bug, the following is required to make this work.
( background ( f ) = > 1 )
(fact
1 => 1
(provided
..service.. =contains=> {:status 200}))
| null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/test/behaviors/t_isolated_metaconstants.clj | clojure | In version with bug, the following is required to make this work. | (ns behaviors.t-isolated-metaconstants
(:require [midje.sweet :refer :all]))
(defn verify-service [service]
true)
(declare f)
( background ( f ) = > 1 )
(fact
1 => 1
(provided
..service.. =contains=> {:status 200}))
|
f5dcd107402c6269eb819d5b1036928534ad89feb40b317af742d0337c59bbcf | facebook/pyre-check | serverTest.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/8b7feecbcc46939f580c5299233874047cd34a14/source/command/test/serverTest.ml | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
fd848ece4be367773c46e895cb666a899e1ba124f6f098adb6acfb5188cb1507 | swaywm/cl-wlroots | matrix.lisp | ;; we could implement all of this in lisp in order to avoid
;; translating from lisp arrays to c arrays, but that is alot of uneccessary work.
;; Instead, we are just going to wrap the
;; see rtg-math for a common lisp graphics math library that is compatable with
;; opengl
(in-package :wlr/types/matrix)
(export '(ma... | null | https://raw.githubusercontent.com/swaywm/cl-wlroots/f8a33979e45086ecd5c7deefd5ee067b941e0998/wlr/types/matrix.lisp | lisp | we could implement all of this in lisp in order to avoid
translating from lisp arrays to c arrays, but that is alot of uneccessary work.
Instead, we are just going to wrap the
see rtg-math for a common lisp graphics math library that is compatable with
opengl |
(in-package :wlr/types/matrix)
(export '(matrix-identity
matrix-multiply
matrix-project-box
matrix-projection
matrix-rotate
matrix-scale
matrix-transform
matrix-transpose
matrix-translate))
(defcfun ("wlr_matrix_identity" matrix-identity) :void
(to-mutate :pointer))
(defcfun ("wlr_matrix_... |
532c711e541a1314a6fcef8e9055e8439a391f4b56a94805ab364643a5edc1a6 | janestreet/ppx_sexp_conv | attrs.mli | open! Base
open! Ppxlib
(** [default], [drop_default], and [drop_if] attributes are annotated with expressions
that should be lifted out of the scope of ppx-generated temporary variables. See the
[Lifted] module. *)
module To_lift : sig
type 'a t = { to_lift : 'a } [@@unboxed]
end
val default : (label_decla... | null | https://raw.githubusercontent.com/janestreet/ppx_sexp_conv/d9f92275eaff71fd721f7902756e621c22e6d118/expander/attrs.mli | ocaml | * [default], [drop_default], and [drop_if] attributes are annotated with expressions
that should be lifted out of the scope of ppx-generated temporary variables. See the
[Lifted] module. | open! Base
open! Ppxlib
module To_lift : sig
type 'a t = { to_lift : 'a } [@@unboxed]
end
val default : (label_declaration, expression To_lift.t) Attribute.t
val drop_default : (label_declaration, expression To_lift.t option) Attribute.t
val drop_if : (label_declaration, expression To_lift.t) Attribute.t
val drop_d... |
6e5b8e32087703c92d3be81802714f1ff5e836a452b2e1d6f5a79aaeadaf8259 | mhallin/graphql_ppx | main.ml | let () = Alcotest.run "Native PPX tests" [
"Argument named 'query'", Arg_named_query.tests;
"Custom decoder", Custom_decoder.tests;
"Custom scalars", Custom_scalars.tests;
"Enum input", Enum_input.tests;
"Fragment definition", Fragment_definition.tests;
"Interface", Interface.tests;
"Lists",... | null | https://raw.githubusercontent.com/mhallin/graphql_ppx/5796b3759bdf0d29112f48e43a2f0623f7466e8a/tests_native/main.ml | ocaml | let () = Alcotest.run "Native PPX tests" [
"Argument named 'query'", Arg_named_query.tests;
"Custom decoder", Custom_decoder.tests;
"Custom scalars", Custom_scalars.tests;
"Enum input", Enum_input.tests;
"Fragment definition", Fragment_definition.tests;
"Interface", Interface.tests;
"Lists",... | |
1dfc79efb08add21bbef9017bd0444698234ee50c26b268dfbe7f59866525548 | Mon-Ouie/blocky | text.lisp | ;;; text.lisp --- a simple text control
Copyright ( C ) 2008 - 2013
Author : < >
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , o... | null | https://raw.githubusercontent.com/Mon-Ouie/blocky/ebc4f4309a15603fb1ef3153050748c17a44e300/text.lisp | lisp | text.lisp --- a simple text control
Keywords:
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A P... |
Copyright ( C ) 2008 - 2013
Author : < >
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
(in-package :blocky)
(defparameter *text-margin* (... |
6efb1d8984abcce0dc6121781cc032f0b9188b1f1bac3817f22b576b047c31c6 | tmattio/spin | {{ project_snake }}.ml | open Js_of_ocaml
let inject elt =
let greeting = "Hello World" in
let content = elt##.innerHTML##concat (Js.string greeting) in
elt##.innerHTML := content
| null | https://raw.githubusercontent.com/tmattio/spin/e9955109659d5246a492b6b1312a4c3eb001e86b/template/js/template/lib/%7B%7B%20project_snake%20%7D%7D.ml | ocaml | open Js_of_ocaml
let inject elt =
let greeting = "Hello World" in
let content = elt##.innerHTML##concat (Js.string greeting) in
elt##.innerHTML := content
| |
f6df29af03ed94397bd7e945b234531342f4870200e726ef674f253c0a61192f | AndrewMagerman/wizard-book-study | amb-eval.rkt | #lang racket
(require (except-in "base-eval.rkt"
interpret))
(provide interpret
driver-loop)
;;;;AMB EVALUATOR FROM SECTION 4.3 OF
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;Code from SECTION 4.3.3, modified as needed to run it
(define (amb? exp) (tagged-list? exp 'amb))... | null | https://raw.githubusercontent.com/AndrewMagerman/wizard-book-study/015f64f1cf86e90b2a6ac4e47ca902fcb6c63e0d/missing_files/week_15/files_from_barry_allisson/wizard-book-solutions-master-ch04-lib/ch04/lib/amb-eval.rkt | racket | AMB EVALUATOR FROM SECTION 4.3 OF
STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
Code from SECTION 4.3.3, modified as needed to run it
and also support for Let
**
**
Simple expressions
Conditionals and sequences
success continuation for evaluating the predicate
to obtain pred-value
failure continuation for eval... | #lang racket
(require (except-in "base-eval.rkt"
interpret))
(provide interpret
driver-loop)
(define (amb? exp) (tagged-list? exp 'amb))
(define (amb-choices exp) (mcdr exp))
analyze from 4.1.6 , with clause from 4.3.3 added
(define (analyze exp)
(cond ((self-evaluating? exp) (ana... |
9b91a9f3868ddc0fa4f99852b3b9ea677e7af29d685fefae0f31657248cc7844 | CrypticButter/snoop | cljs_main.cljs | (ns cljs-main
(:require
[crypticbutter.snoop :refer [>defn]]))
(>defn x []
[:=> [:cat int?] int?])
(defn -main [])
| null | https://raw.githubusercontent.com/CrypticButter/snoop/c802438b0eb2481c5d0eefb0c9670f9936eaa916/test/cljs_main.cljs | clojure | (ns cljs-main
(:require
[crypticbutter.snoop :refer [>defn]]))
(>defn x []
[:=> [:cat int?] int?])
(defn -main [])
| |
7d811d902e59b9458e8fcb6880fc43b49be71193d881bd7b729fa4ac74e3cb33 | zalando-stups/pierone | project.clj | (defproject org.zalando.stups/pierone "1.8.5"
:description "Pier One Docker Registry"
:url "-stups/pierone"
:license {:name "Apache License"
:url "/"}
:scm {:url ":zalando-stups/pierone"}
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.zalando.stups... | null | https://raw.githubusercontent.com/zalando-stups/pierone/e35dc665f1e0e155152f1fcd5d0b301f85d71f50/project.clj | clojure | (defproject org.zalando.stups/pierone "1.8.5"
:description "Pier One Docker Registry"
:url "-stups/pierone"
:license {:name "Apache License"
:url "/"}
:scm {:url ":zalando-stups/pierone"}
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.zalando.stups... | |
ccfb2c7004c260d40f55ce0b85a458a2b9dd7b8520f903fc4f3a22d61f2e1b6f | eneroth/fulcro-template-aleph | dev.clj | (ns dev
(:require [poc.core.main :refer [restart-server]]
[shadow.cljs.devtools.server :as shadow-server]
[shadow.cljs.devtools.api :as shadow]))
(defn start-server? [args-map]
(not= "false" (get args-map "--start-server")))
(defn -main [& args]
(let [args-map (apply hash-map args)]
... | null | https://raw.githubusercontent.com/eneroth/fulcro-template-aleph/ed614f192cee63ee56fcbb325d92ea24a3a95a1f/startup/dev.clj | clojure | Dev tools
Evaluate to switch REPL to the client | (ns dev
(:require [poc.core.main :refer [restart-server]]
[shadow.cljs.devtools.server :as shadow-server]
[shadow.cljs.devtools.api :as shadow]))
(defn start-server? [args-map]
(not= "false" (get args-map "--start-server")))
(defn -main [& args]
(let [args-map (apply hash-map args)]
... |
a88f2ebd2c527cbec5cd1f5d88e9e0144802852787bb2db176fc0ad2785626ec | clojure/core.typed | typedclojure_config.cljc | {:ann [clojure.core.typed.ann.clojure]
:ext [clojure.core.typed.ext.clojure.core]}
| null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/lib.clojure/src/typedclojure_config.cljc | clojure | {:ann [clojure.core.typed.ann.clojure]
:ext [clojure.core.typed.ext.clojure.core]}
| |
3bdd8ab47932d1ad2635cc170a6327f6ed70e33a627d7f0b57c4c1b351e112e0 | stepcut/isomaniac | KeyTest.hs | # LANGUAGE ExtendedDefaultRules , FlexibleInstances , MultiParamTypeClasses , OverloadedStrings , QuasiQuotes , TypeFamilies , RankNTypes #
module Main where
import Control.Monad.Trans (liftIO)
import Data.Char (chr)
import Data.Text (Text, pack, unpack)
import qualified Data.JSString as JS
import GHCJS.Types (JSRef(.... | null | https://raw.githubusercontent.com/stepcut/isomaniac/ee4ab64bb5571b66335a913287d1385dcf9584fe/KeyTest.hs | haskell | Action
Update
View | # LANGUAGE ExtendedDefaultRules , FlexibleInstances , MultiParamTypeClasses , OverloadedStrings , QuasiQuotes , TypeFamilies , RankNTypes #
module Main where
import Control.Monad.Trans (liftIO)
import Data.Char (chr)
import Data.Text (Text, pack, unpack)
import qualified Data.JSString as JS
import GHCJS.Types (JSRef(.... |
83ce479684a3d2864ee1bd7912fb1e55c979f50a1fbbe4f7907daa7464879b4c | flavioc/cl-hurd | dir-unlink.lisp |
(in-package :hurd)
(defcfun ("dir_unlink" %dir-unlink)
err
(dir port)
(name :string))
(defun dir-unlink (dir name)
"Unlink file 'name' from directory 'dir'."
(declare (type fixnum dir)
(type string name))
(select-error (%dir-unlink dir name)))
| null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/fs/dir-unlink.lisp | lisp |
(in-package :hurd)
(defcfun ("dir_unlink" %dir-unlink)
err
(dir port)
(name :string))
(defun dir-unlink (dir name)
"Unlink file 'name' from directory 'dir'."
(declare (type fixnum dir)
(type string name))
(select-error (%dir-unlink dir name)))
| |
18446df3cc3109bb22c03df5e7baa737495d745da6bbd0655bcf17c3c1f43f20 | CryptoKami/cryptokami-core | Neighbors.hs | module Pos.Discovery.Model.Neighbors
( sendToNeighbors
, converseToNeighbors
) where
import Formatting (sformat, shown, (%))
import Mockable (MonadMockable, handleAll)
import Pos.Binary.Class (Bi)
import Pos.Communication.Protocol (ConversationActions, Messa... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/Discovery/Model/Neighbors.hs | haskell | module Pos.Discovery.Model.Neighbors
( sendToNeighbors
, converseToNeighbors
) where
import Formatting (sformat, shown, (%))
import Mockable (MonadMockable, handleAll)
import Pos.Binary.Class (Bi)
import Pos.Communication.Protocol (ConversationActions, Messa... | |
e12279488ad59afc64baa526b108177eff16a4c86877d1a2c2f76c4734cb96f1 | links-lang/links | irTransform.mli | type state = { context: Context.t;
primitive_vars: Utility.IntSet.t;
datatype: Types.datatype }
type result = Result of { state: state;
program: Ir.program }
val context : state -> Context.t
val return : state -> Ir.program -> result
val with_type : Types.dataty... | null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/irTransform.mli | ocaml | type state = { context: Context.t;
primitive_vars: Utility.IntSet.t;
datatype: Types.datatype }
type result = Result of { state: state;
program: Ir.program }
val context : state -> Context.t
val return : state -> Ir.program -> result
val with_type : Types.dataty... | |
f457f5c014a3c08aaee504133607c6475237697f36cb3f8666262df0fba1d963 | unison-code/unison | OG.hs | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Operand Graph .
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
Operand Graph.
-}
Main authors :
< >
This file is ... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Graphs/OG.hs | haskell | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Operand Graph .
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
Operand Graph.
-}
Main authors :
< >
This file is ... | |
90f0cf73f78607db702618eba0b3bd7d880b402c3e1ec82eb69ec4768ded6515 | braidchat/braid | helpers.cljs | (ns braid.core.client.helpers
(:require-macros
[cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<! put! chan alts! timeout]]
[goog.object :as o]
[goog.style :as gstyle]))
(defn debounce
"Given the input channel source and a debouncing time of msecs, return a new
channel that... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/core/client/helpers.cljs | clojure | (ns braid.core.client.helpers
(:require-macros
[cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<! put! chan alts! timeout]]
[goog.object :as o]
[goog.style :as gstyle]))
(defn debounce
"Given the input channel source and a debouncing time of msecs, return a new
channel that... | |
b33f9f88a2444286f7beb37981f5ac66015c25b5b301d30d6ec383b7c89fa840 | asakeron/cljs-webgl | blending_factor_dest.cljs | (ns cljs-webgl.constants.blending-factor-dest)
(def zero 0)
(def one 1)
(def src-color 0x0300)
(def one-minus-src-color 0x0301)
(def src-alpha 0x0302)
(def one-minus-src-alpha 0x0303)
(def dst-alpha 0x0304)
(def one-minus-dst-alpha 0x0305)
| null | https://raw.githubusercontent.com/asakeron/cljs-webgl/f4554fbee6fbc6133a4eb0416548dabd284e735c/src/cljs/cljs_webgl/constants/blending_factor_dest.cljs | clojure | (ns cljs-webgl.constants.blending-factor-dest)
(def zero 0)
(def one 1)
(def src-color 0x0300)
(def one-minus-src-color 0x0301)
(def src-alpha 0x0302)
(def one-minus-src-alpha 0x0303)
(def dst-alpha 0x0304)
(def one-minus-dst-alpha 0x0305)
| |
077c78c23f7037f43423640ff9edcfb22c757a71191f2ff2ce81844cf14d570a | nikita-volkov/rerebase | Cont.hs | module Control.Monad.Trans.Cont
(
module Rebase.Control.Monad.Trans.Cont
)
where
import Rebase.Control.Monad.Trans.Cont
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Control/Monad/Trans/Cont.hs | haskell | module Control.Monad.Trans.Cont
(
module Rebase.Control.Monad.Trans.Cont
)
where
import Rebase.Control.Monad.Trans.Cont
| |
21e1fb6745cea16ae3316e654b8bfc9f7df903c50cb2971af4890d754c9bf58a | swarm-game/swarm | Terrain.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
SPDX - License - Identifier : BSD-3 - Clause
--
Terrain types and properties .
module Swarm.Game.Terrain (
-- * Terrain
TerrainType (..),
terrainMap,
) where
import Data.Aeson (FromJSON (..), withText)
import Data.Map (Map)
import Data.Map qualified as M
import Data.T... | null | https://raw.githubusercontent.com/swarm-game/swarm/affc8668b77b7e85d3d23c182a5159df36d17306/src/Swarm/Game/Terrain.hs | haskell | # LANGUAGE OverloadedStrings #
|
* Terrain
| The different possible types of terrain. Unlike entities and
robots, these are hard-coded into the game. |
SPDX - License - Identifier : BSD-3 - Clause
Terrain types and properties .
module Swarm.Game.Terrain (
TerrainType (..),
terrainMap,
) where
import Data.Aeson (FromJSON (..), withText)
import Data.Map (Map)
import Data.Map qualified as M
import Data.Text qualified as T
import Swarm.Game.Display
import Text.R... |
657b25f5024f696262db01c9eab314fcdacdb8ce14727525a7b0c8258b2d0a29 | davidsun0/jclass | utility.lisp | (in-package #:jclass)
(defmacro with-gensyms (symbols &body body)
`(let ,(loop for s in symbols collect `(,s (gensym)))
,@body))
(defmacro fresh-dolist ((var list-form) &body body)
"A simple version of dolist that also guarantees a fresh binding of `var`."
(with-gensyms (fresh)
`(loop for ,fresh in ,list... | null | https://raw.githubusercontent.com/davidsun0/jclass/0de68ded1a4ffe235ea9f359e76950d03ae12e1f/utility.lisp | lisp | ignore nil
Buffer that represents the elements of array starting at index and ending
at array's fill pointer. | (in-package #:jclass)
(defmacro with-gensyms (symbols &body body)
`(let ,(loop for s in symbols collect `(,s (gensym)))
,@body))
(defmacro fresh-dolist ((var list-form) &body body)
"A simple version of dolist that also guarantees a fresh binding of `var`."
(with-gensyms (fresh)
`(loop for ,fresh in ,list... |
d2a705d33a2d22497170808c598eb5a856aa89a8a01d8e0cc5abfea5070d7a28 | nokia/web-assembly-self-certifying-compilation-framework | test_const_fold.ml | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
open Wasm
open Wasm_utils
open Instr_graph
open Func_types
open State_types
o... | null | https://raw.githubusercontent.com/nokia/web-assembly-self-certifying-compilation-framework/8c31df0bd7d2d94cfbc22089944f5cabb3a61158/src/validator/test/test_const_fold.ml | ocaml | Start making the proof | *
Copyright 2020 Nokia
Licensed under the BSD 3 - Clause License .
SPDX - License - Identifier : BSD-3 - Clause
Copyright 2020 Nokia
Licensed under the BSD 3-Clause License.
SPDX-License-Identifier: BSD-3-Clause
*)
open Wasm
open Wasm_utils
open Instr_graph
open Func_types
open State_types
o... |
20502f504cc9fb177d67903236bd4253bec023edc6f8afb87dc279c904fbb83d | wardle/pc4 | snomed.cljs | (ns pc4.ui.snomed
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.mutations :as m]
[com.fulcrologic.fulcro.data-fetch :as df]
[clojure.string :as str]
[goog.functions :as gf]
[com.fulcrologic.fulcro.dom.even... | null | https://raw.githubusercontent.com/wardle/pc4/ae6a682fb8301932c4192b53584e489f45578a56/pc4-ms/src/main/pc4/ui/snomed.cljs | clojure | generate a lookup map
the component's ID
A place to do the loading, so we can prevent flicker in the UI
the current completion suggestions
the currently selected option
synonyms are lazily loaded when the user selects an option
the current user-entered value
for html label/input association
avoid autocompletio... | (ns pc4.ui.snomed
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.mutations :as m]
[com.fulcrologic.fulcro.data-fetch :as df]
[clojure.string :as str]
[goog.functions :as gf]
[com.fulcrologic.fulcro.dom.even... |
cf7f6d16c65c6093e29dd7a8bf91bc7e56d4f91dd05fa61076ca1a20a1203bbb | garrigue/lablgtk | nd.ml | This examples combines Cairo and Pango to implement a renderer for
natural deduction trees .
Author :
natural deduction trees.
Author: Claudio Sacerdoti Coen
*)
type nd_tree =
{ conclusion: string
; rule : string
; premises: nd_tree list option
}
let test =
{ conclusion = "(A ∨ D ⇒ B) ⇒ ... | null | https://raw.githubusercontent.com/garrigue/lablgtk/504fac1257e900e6044c638025a4d6c5a321284c/examples/nd.ml | ocaml | total width of tree
total height of tree
where the conclusions are printed
the pad must leave enough space for rule names
the minipad is put between the inference rule and the rule name
If centered=true then (x,y) is the middle-point below the conclusion;
otherwise it is the lowermost-leftmost point of th... | This examples combines Cairo and Pango to implement a renderer for
natural deduction trees .
Author :
natural deduction trees.
Author: Claudio Sacerdoti Coen
*)
type nd_tree =
{ conclusion: string
; rule : string
; premises: nd_tree list option
}
let test =
{ conclusion = "(A ∨ D ⇒ B) ⇒ ... |
da72f825f90cc4339d188c803a7b0af38cbd9d8bf4561b8b45e8d9c754c6c08b | gga/json-path | match.clj | (ns json-path.match)
(defrecord Match [path value])
(defn root [value]
(->Match [] value))
(defn with-context
([key value context] (->Match (vec (concat (:path context) [key]))
value)))
(defn create [value path]
(->Match path value))
| null | https://raw.githubusercontent.com/gga/json-path/bfb1e78433b0b56c175b7334c489fe10b2b8fc92/src/json_path/match.clj | clojure | (ns json-path.match)
(defrecord Match [path value])
(defn root [value]
(->Match [] value))
(defn with-context
([key value context] (->Match (vec (concat (:path context) [key]))
value)))
(defn create [value path]
(->Match path value))
| |
b9c264f77fb71ea38b14686cfd706b133e515f410656f942aca4467fb31788a2 | peti/hledger-interest | Main.hs | module Main ( main ) where
import Hledger.Interest
import Hledger.Query
import Hledger.Read
import Hledger.Utils
import Control.Exception ( bracket )
import Control.Monad
import Data.List ( sortOn )
import Data.Maybe
import qualified Data.Text as T
import Data.Version
import System.Console.GetOpt
import System.Enviro... | null | https://raw.githubusercontent.com/peti/hledger-interest/d66c18b54ec7b8b3c71a51d9a0e642894cf7c855/Main.hs | haskell | module Main ( main ) where
import Hledger.Interest
import Hledger.Query
import Hledger.Read
import Hledger.Utils
import Control.Exception ( bracket )
import Control.Monad
import Data.List ( sortOn )
import Data.Maybe
import qualified Data.Text as T
import Data.Version
import System.Console.GetOpt
import System.Enviro... | |
4754e50ff4cb2b37d98d2f2940d4c4b5c2b32f1658e94a81e508e30cdf35c3f4 | ndmitchell/neil | Releases.hs | {-# LANGUAGE RecordWildCards, ScopedTypeVariables #-}
module Releases(run) where
import Control.Monad.Extra
import Control.Exception
import Control.DeepSeq
import Data.Char
import Data.Functor
import Text.HTML.TagSoup
import Data.Time.Format
import Data.Time.Clock
import Data.List.Extra
import System.Directory
import... | null | https://raw.githubusercontent.com/ndmitchell/neil/b06624fe697c23375222856d538cb974e96da048/src/Releases.hs | haskell | # LANGUAGE RecordWildCards, ScopedTypeVariables #
Make sure errors occur early |
module Releases(run) where
import Control.Monad.Extra
import Control.Exception
import Control.DeepSeq
import Data.Char
import Data.Functor
import Text.HTML.TagSoup
import Data.Time.Format
import Data.Time.Clock
import Data.List.Extra
import System.Directory
import System.IO.Extra
import System.FilePath
import System.... |
9d17285dd36cef208bcb0c46d5802fb0a6d5770e36b524bf6febc3fa18e3b111 | guicho271828/trivia | derived.lisp | (in-package :trivia.level2.impl)
(defpattern and (&rest subpatterns)
"Match when all subpatterns match."
(expand-and subpatterns))
(defun expand-and (subpatterns)
(ematch0 subpatterns
((list) '_)
((list sp) sp)
((list* subpatterns)
;; implementing and-pattern requires lifting or-patterns.
;... | null | https://raw.githubusercontent.com/guicho271828/trivia/87ed88e137c107860083af66f85394fed38e35b6/level2/derived.lisp | lisp | implementing and-pattern requires lifting or-patterns.
For example:
subpat3)
should be converted into
optimising the slight inefficiency of having the duplicated subpat3
is a job of optimiser.
no or pattern; perform lifting
If false, then the match should be successful.
analysis phase
this not pattern i... | (in-package :trivia.level2.impl)
(defpattern and (&rest subpatterns)
"Match when all subpatterns match."
(expand-and subpatterns))
(defun expand-and (subpatterns)
(ematch0 subpatterns
((list) '_)
((list sp) sp)
((list* subpatterns)
( and ( or1 )
( ( and )
( and ) )
(let* ((subp... |
546e4ae48384dfb7849f012849c9af898228422f6ba1279c7eaa5975a82bbe2e | emqx/quic | quicer_remote_stream.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/quic/957d86061ed05ed537748acc8a543a0d1e829da6/src/quicer_remote_stream.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(quicer_remote_stream).
-include("quicer_types.hrl").
-callback init_handoff(stream_handle(), s... |
57aca24151a2c2f8f53bbc5d3fb26cec6371bc0bb09dbb1fc3085994e306d1fa | uw-unsat/serval | move-wide-immediate.rkt | #lang rosette
(require
"common.rkt")
(provide
movn movz movk)
; Helpers for updating bits<pos+15:pos>.
;
; We don't want to convert pos to integers, thus explicitly unrolling cases.
; Another approach is to use bit masking, but the code would be harder to read.
(define (update/32 v pos imm16)
(cond
[(bve... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/arm64/interp/move-wide-immediate.rkt | racket | Helpers for updating bits<pos+15:pos>.
We don't want to convert pos to integers, thus explicitly unrolling cases.
Another approach is to use bit masking, but the code would be harder to read.
sf == '0' && hw<1> == '1' | #lang rosette
(require
"common.rkt")
(provide
movn movz movk)
(define (update/32 v pos imm16)
(cond
[(bveq pos (bv 0 6))
(concat (extract 31 16 v) imm16)]
[(bveq pos (bv 16 6))
(concat imm16 (extract 15 0 v))]
[else
(assert #f)]))
(define (update/64 v pos imm16)
(cond
[(bveq... |
4eadda6b693185be7d2cfb100832fc4a904476e800ebbe46956792a202973a7d | mbj/stratosphere | SqliMatchStatementProperty.hs | module Stratosphere.WAFv2.RuleGroup.SqliMatchStatementProperty (
module Exports, SqliMatchStatementProperty(..),
mkSqliMatchStatementProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.W... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/RuleGroup/SqliMatchStatementProperty.hs | haskell | # SOURCE #
# SOURCE # | module Stratosphere.WAFv2.RuleGroup.SqliMatchStatementProperty (
module Exports, SqliMatchStatementProperty(..),
mkSqliMatchStatementProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperti... |
389fd88a5ac16fa8c09bd9c383ac6c894ab260c9eff8d0cfa3623ee44aba097f | ocaml-gospel/ortac | wrapper.expected.ml | include Lib
module Ortac_runtime = Ortac_runtime
let __invariant___001_ __error___002_ __position___003_ t =
if
not
(try
let __t1__004_ =
Ortac_runtime.Z.leq (Ortac_runtime.Z.of_int 0)
(Ortac_runtime.Z.of_int t.size) in
let __t2__005_ =
Ortac_runtime.Z.le... | null | https://raw.githubusercontent.com/ocaml-gospel/ortac/dacc564ffaf8cfeb6f012bacefa5319d042ba29f/test/generated/default/wrapper.expected.ml | ocaml | include Lib
module Ortac_runtime = Ortac_runtime
let __invariant___001_ __error___002_ __position___003_ t =
if
not
(try
let __t1__004_ =
Ortac_runtime.Z.leq (Ortac_runtime.Z.of_int 0)
(Ortac_runtime.Z.of_int t.size) in
let __t2__005_ =
Ortac_runtime.Z.le... | |
b490a2c316add9c14e6dd02dd8762f41d8fcb93a8372abdc90ec4ddc0e2e3ed7 | genenetwork/guix-bioinformatics | bnw-container.scm | (define-module (gn services bnw-container))
(use-modules (gnu)
(gn packages bnw)
(guix records)
(ice-9 match))
(use-service-modules networking web)
(define-record-type* <bnw-configuration>
bnw-configuration
make-bnw-configuration
bnw-configuration?
(package bnw-... | null | https://raw.githubusercontent.com/genenetwork/guix-bioinformatics/9e1e668e4f9f9e2b595620fda831da0525db4095/gn/services/bnw-container.scm | scheme | package
string
list of strings
(root package)
(nginx-location-configuration
(uri "/sourcecodes/data/")
(body (list "alias /tmp/bnw/;")))
Make sure php-fpm is instantiated.
No firmware for VMs.
We don't need any packages inside the container.
The following is for testing: | (define-module (gn services bnw-container))
(use-modules (gnu)
(gn packages bnw)
(guix records)
(ice-9 match))
(use-service-modules networking web)
(define-record-type* <bnw-configuration>
bnw-configuration
make-bnw-configuration
bnw-configuration?
(def... |
9a29b6c3f5b53939995eeb1544e28dec0a10d4126593513dd82ba78b51d9a478 | 1Jajen1/Brokkr | Packet.hs | # LANGUAGE MagicHash #
# LANGUAGE TemplateHaskell #
module Network.Util.Packet (
packetId
, mkPacketParser
) where
import qualified Mason.Builder as B
import GHC.Exts (dataToTag#, Int(I#))
import Network.Util.VarNum
import Util.Binary
import Language.Haskell.TH
import FlatParse.Basic
import Data.Void
packetId :: a... | null | https://raw.githubusercontent.com/1Jajen1/Brokkr/fe56efaf450f29a5571cc34fa01f7301678f3eaf/src/Network/Util/Packet.hs | haskell | # INLINE packetId # | # LANGUAGE MagicHash #
# LANGUAGE TemplateHaskell #
module Network.Util.Packet (
packetId
, mkPacketParser
) where
import qualified Mason.Builder as B
import GHC.Exts (dataToTag#, Int(I#))
import Network.Util.VarNum
import Util.Binary
import Language.Haskell.TH
import FlatParse.Basic
import Data.Void
packetId :: a... |
a82d574c8730d8329b69b4867b9637e0b69413a90b89495856150fc1f1d55d2c | racket/racket-pkg-website | rpc.rkt | #lang racket/base
(provide (struct-out exn:fail:rpc)
rpc-request-evt
rpc-handler
rpc-call
rpc-cast!)
(require racket/match)
(require racket/exn)
(struct exn:fail:rpc exn:fail (inner-exn) #:transparent)
(define (rpc-request-evt)
(handle-evt (thread-receive-evt)
(la... | null | https://raw.githubusercontent.com/racket/racket-pkg-website/d25b68c125698d944446f8e0a945eff85caebccd/src/rpc.rkt | racket | #lang racket/base
(provide (struct-out exn:fail:rpc)
rpc-request-evt
rpc-handler
rpc-call
rpc-cast!)
(require racket/match)
(require racket/exn)
(struct exn:fail:rpc exn:fail (inner-exn) #:transparent)
(define (rpc-request-evt)
(handle-evt (thread-receive-evt)
(la... | |
0272558561983412e160dcbeed86fd8c83cb07311eb7386058e82abeebfb7de3 | samdphillips/raco-run | main.rkt | #lang racket/base
(require racket/string)
(define (build-mod-path mod-string submod-string)
(define mod
(cond
[(and (string-suffix? mod-string ".rkt")
(file-exists? mod-string))
mod-string]
[else
(string->symbol mod-string)]))
(unless (module-path? mod)
(error 'raco-... | null | https://raw.githubusercontent.com/samdphillips/raco-run/a57165d1ba73436476cd9466b74dc1ff71d6b19a/main.rkt | racket | #lang racket/base
(require racket/string)
(define (build-mod-path mod-string submod-string)
(define mod
(cond
[(and (string-suffix? mod-string ".rkt")
(file-exists? mod-string))
mod-string]
[else
(string->symbol mod-string)]))
(unless (module-path? mod)
(error 'raco-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.