_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 |
|---|---|---|---|---|---|---|---|---|
b5c91da61f4dd6c6ae1aab39214f343095cf6f7f7aeb0b4f422aeeb0f60b1a7e | brendanzab/language-garden | BinaryTree.ml | * From the { { : -system#Example_2:_Fractal_(binary)_tree }
L - system page } on Wikipedia .
L-system page} on Wikipedia. *)
type symbol =
| Bud
| Branch
| Push
| Pop
let axiom = [Bud]
let rules =
function
| Branch -> [Branch; Branch] (* Grow the branch *)
Split a bud into a branc... | null | https://raw.githubusercontent.com/brendanzab/language-garden/35cb10beeb2f0220f77252b25650583a64eb8758/lang-fractal-growth/examples/BinaryTree.ml | ocaml | Grow the branch
TODO: Terminal symbols | * From the { { : -system#Example_2:_Fractal_(binary)_tree }
L - system page } on Wikipedia .
L-system page} on Wikipedia. *)
type symbol =
| Bud
| Branch
| Push
| Pop
let axiom = [Bud]
let rules =
function
Split a bud into a branch and two buds
| s -> [s]
let string_of_symbol =
function
... |
e699dee9e67d360c9a8e2e97c7cd8877a02ac485825c33c8c738c025be690ca2 | jvf/scalaris | yaws_sendfile.erl | %%% File : yaws_sendfile.erl
Author : < >
%%% Description : interface to sendfile linked-in driver for Yaws
Created : 9 Nov 2008 by < >
-module(yaws_sendfile).
-author('').
-include("../include/yaws.hrl").
-include_lib("kernel/include/file.hrl").
-export([send/2, send/3, send/4]).
-export([have_send... | null | https://raw.githubusercontent.com/jvf/scalaris/c069f44cf149ea6c69e24bdb08714bda242e7ee0/contrib/yaws/src/yaws_sendfile.erl | erlang | File : yaws_sendfile.erl
Description : interface to sendfile linked-in driver for Yaws
export bytes_to_transfer to avoid warning when sendfile is disabled (or not
supported)
below, ignore dialyzer warning:
The pattern depends on the macro HAVE_ERLANG_SENDFILE
below, ignore dialyzer warning:
The pattern depen... | Author : < >
Created : 9 Nov 2008 by < >
-module(yaws_sendfile).
-author('').
-include("../include/yaws.hrl").
-include_lib("kernel/include/file.hrl").
-export([send/2, send/3, send/4]).
-export([have_sendfile/0, have_erlang_sendfile/0, check_gc_flags/1]).
-export([bytes_to_transfer/3]).
-ifdef(HAVE... |
0dff985fb677232eecdd67bc3d347b3fa53e4674a92e628a8787faeac3e6e3b3 | jarvinet/scheme | section134.scm | Structure and Interpretation of Computer Programs , 1st edition
;-------------------------------------------------------------
Section 1.3.4
(define (deriv f dx)
(lambda (x)
(/ (- (f (+ x dx)) (f x))
dx)))
Newton 's method for arbitrary functions
(define (newton f guess)
(if (good-enough? gue... | null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/Book/Edition1/section134.scm | scheme | -------------------------------------------------------------
-------------------------------------------------------------
Return a function that performs n repeated applications of the function f
This works OK alone, but combined with e.g. smooth (see below), does not.
when this version of repeated is used.
Retu... | Structure and Interpretation of Computer Programs , 1st edition
Section 1.3.4
(define (deriv f dx)
(lambda (x)
(/ (- (f (+ x dx)) (f x))
dx)))
Newton 's method for arbitrary functions
(define (newton f guess)
(if (good-enough? guess f)
guess
(newton f (improve guess f))))
(define... |
8c1411e9e98ef7b7a98d3aacb5fb4940ccb2943eecf78952eed6801447578dda | jhb563/ProdHaskellSeries | MigrateDB.hs | module Main where
import Database (localConnString, migrateDB)
main :: IO ()
main = migrateDB localConnString
| null | https://raw.githubusercontent.com/jhb563/ProdHaskellSeries/6f04f908152860dd9ded3a6ead4300104a4f20a5/app/MigrateDB.hs | haskell | module Main where
import Database (localConnString, migrateDB)
main :: IO ()
main = migrateDB localConnString
| |
10fed712688b6c4490b95c1a5e32b80f92cfd797d145b2f01a6ccc964cd3d7bf | patricoferris/meio | task.ml | open Nottui
module W = Nottui_widgets
module H = Hdr_histogram
type t = {
id : int;
domain : int;
start : int64;
mutable busy : int64 ref list;
mutable info : string list; (* include location *)
mutable selected : bool;
active : bool;
}
let get_current_busy t = match t.busy with [] -> 0L | x :: _ -> !x
... | null | https://raw.githubusercontent.com/patricoferris/meio/635b3dcaecd84ffacb2b6f7d2990cb668d61d5bb/src/lib/task.ml | ocaml | include location | open Nottui
module W = Nottui_widgets
module H = Hdr_histogram
type t = {
id : int;
domain : int;
start : int64;
mutable busy : int64 ref list;
mutable selected : bool;
active : bool;
}
let get_current_busy t = match t.busy with [] -> 0L | x :: _ -> !x
let equal a b = a.id = b.id && a.domain = b.domain
l... |
6ff2303438b0ab9a5e0fcd24420382df33a2eecb34c2dc68d648e95efdc54f3c | seckcoder/iu_c311 | grammar.rkt | #lang eopl
(provide (all-defined-out))
(define scanner-spec-a
'((white-sp (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier (letter (arbno (or letter digit))) symbol)
(number (digit (arbno digit)) number)
(number ("-" digit (arbno digit)) number)
))
(define grammar-al... | null | https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/thread/grammar.rkt | racket | #lang eopl
(provide (all-defined-out))
(define scanner-spec-a
'((white-sp (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier (letter (arbno (or letter digit))) symbol)
(number (digit (arbno digit)) number)
(number ("-" digit (arbno digit)) number)
))
(define grammar-al... | |
3c5dc3c0712a643bf298f718afe74b40135848769d83017fb4a188450ff62aa5 | wattlebirdaz/rclref | rclref_backend.erl | -module(rclref_backend).
-type state() :: term().
-type fold_keys_fun() :: fun((term(), any()) -> any() | no_return()).
-type fold_objects_fun() :: fun((term(), term(), any()) -> any() | no_return()).
-type fold_acc() :: term().
-type fold_opts() :: [term()].
-type fold_result() :: {ok, fold_acc()} | {async, fun()} | ... | null | https://raw.githubusercontent.com/wattlebirdaz/rclref/0e31857de43e3930f69d4063f79a518fe9fdbb79/apps/rclref/src/rclref_backend.erl | erlang | -module(rclref_backend).
-type state() :: term().
-type fold_keys_fun() :: fun((term(), any()) -> any() | no_return()).
-type fold_objects_fun() :: fun((term(), term(), any()) -> any() | no_return()).
-type fold_acc() :: term().
-type fold_opts() :: [term()].
-type fold_result() :: {ok, fold_acc()} | {async, fun()} | ... | |
5cd2ee581ce3075114c47404f943673ff295ac3fddaefd8f5762ce6005e6093a | pdarragh/parsing-with-zippers-paper-artifact | pwz_nary_list.ml | open Pyast
open Pytokens
(* Define abstract types. *)
type pos = int ref (* Using ref makes it easy to create values that are not pointer equal *)
let p_bottom = ref (-1)
let s_bottom = "<s_bottom>"
type tok = token_pair
let t_eof = (-1, "<t_eof>")
(* Define types. *)
type exp = { mutable m : mem; e' : exp' }
and e... | null | https://raw.githubusercontent.com/pdarragh/parsing-with-zippers-paper-artifact/c5c08306cfe4eec588237c7fa45b794649ccb68a/benchmark/pwz_bench/generate/static/pwz_nary_list/pwz_nary_list.ml | ocaml | Define abstract types.
Using ref makes it easy to create values that are not pointer equal
Define types.
Define bottom values. | open Pyast
open Pytokens
let p_bottom = ref (-1)
let s_bottom = "<s_bottom>"
type tok = token_pair
let t_eof = (-1, "<t_eof>")
type exp = { mutable m : mem; e' : exp' }
and exp' = Tok of tok
| Seq of sym * exp list
| Alt of (exp list) ref
and cxt = TopC
| SeqC of mem * sym * exp list * e... |
67c5ce933d42a887f68a5876cf939979499f8fe4dc7f23cc5fbe3dc7fe589727 | askvortsov1/nittany_market | templates.ml | open! Core
open Bonsai_web
let skeleton ?(nav = Vdom.Node.none) title body =
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "container"; "min-vh-100" ])
[
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "row"; "min-vh-100" ])
[
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "col-md-1... | null | https://raw.githubusercontent.com/askvortsov1/nittany_market/08ffcad2bb2ead9aaeb85b22b88aa2af879e36ad/frontend/templates.ml | ocaml | open! Core
open Bonsai_web
let skeleton ?(nav = Vdom.Node.none) title body =
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "container"; "min-vh-100" ])
[
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "row"; "min-vh-100" ])
[
Vdom.Node.div
~attr:(Vdom.Attr.classes [ "col-md-1... | |
4e243b6bd2d63317251fadb246825c489d7e21017f1a604def3409f785075b46 | aigarashi/copl-tools | keywords.ml | open Parser
let v = [
(* game-specific keywords *)
("evalto", EVALTO);
("minus", MINUS);
("times", MULT);
("plus", PLUS);
("is", IS);
("less", LESS);
("than", THAN);
("not", NOT);
("true", TRUE);
("false", FALSE);
("if", IF);
("then", THEN);
("else", ELSE);
("*", AST);
("+", CROSS);
... | null | https://raw.githubusercontent.com/aigarashi/copl-tools/3c4da117083a0870334c8eef270206b11060514e/checker/EvalML1Err/keywords.ml | ocaml | game-specific keywords | open Parser
let v = [
("evalto", EVALTO);
("minus", MINUS);
("times", MULT);
("plus", PLUS);
("is", IS);
("less", LESS);
("than", THAN);
("not", NOT);
("true", TRUE);
("false", FALSE);
("if", IF);
("then", THEN);
("else", ELSE);
("*", AST);
("+", CROSS);
("-", HYPHEN);
("<", LT);
... |
88568b8e5330fa3d2257433b7ba49f4a69776d200b150d9ced1d0a0670e628da | ConsumerDataStandardsAustralia/validation-prototype | ProductsTest.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE TypeApplications #
module Web.ConsumerData.Au.Api.Types.Banking.ProductsTest where
import Control.Lens
import Data.Functor.Identity (Identity)
import Data.Tagged (Tagged)
import Data.Time (UTCTime (UTCTime), fromG... | null | https://raw.githubusercontent.com/ConsumerDataStandardsAustralia/validation-prototype/ff63338b77339ee49fa3e0be5bb9d7f74e50c28b/consumer-data-au-api-types/tests/Web/ConsumerData/Au/Api/Types/Banking/ProductsTest.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes # | # LANGUAGE TypeApplications #
module Web.ConsumerData.Au.Api.Types.Banking.ProductsTest where
import Control.Lens
import Data.Functor.Identity (Identity)
import Data.Tagged (Tagged)
import Data.Time (UTCTime (UTCTime), fromGregorian)
import Test.Tasty (TestTree)
import Text.URI.QQ ... |
681b84441af304ad923694232f564ad44fbd32844cf42036ceea45b984461e1d | ayamada/copy-of-svn.tir.jp | ircbot.scm | #!/usr/bin/env gosh
;;; coding: euc-jp
;;; -*- scheme -*-
;;; vim:set ft=scheme ts=8 sts=2 sw=2 et:
$ Id$
;;; basis on #ircbot
;;; 使い方:
;;; - 以下のパラメータを使いたいように変更する
;;; - 実行する(おそらく、以下のようなコマンドになる)
./ircbot.scm > stdout.log 2>&1 &
;;; - 実行すると、S式書式のログが*log-dir*に、チャンネル別、日別で保存される
;;; - 実行すると、*pipe-file*が生成されるので、そこに
... | null | https://raw.githubusercontent.com/ayamada/copy-of-svn.tir.jp/101cd00d595ee7bb96348df54f49707295e9e263/iafse/pib/tags/0.1.5/sample/ircbot.scm | scheme | coding: euc-jp
-*- scheme -*-
vim:set ft=scheme ts=8 sts=2 sw=2 et:
basis on #ircbot
使い方:
- 以下のパラメータを使いたいように変更する
- 実行する(おそらく、以下のようなコマンドになる)
- 実行すると、S式書式のログが*log-dir*に、チャンネル別、日別で保存される
- 実行すると、*pipe-file*が生成されるので、そこに
のように文字列を流し込むと、botがそのコマンドをサーバに送信する
流し込む際の日本語コードは、(gauche-character-encoding)にする事
ircコマンド... | #!/usr/bin/env gosh
$ Id$
./ircbot.scm > stdout.log 2>&1 &
echo ' PRIVMSG # hoge : ほげほげ '
(add-load-path "../lib")
(add-load-path "lib")
(add-load-path ".")
(use pib)
(use gauche.threads)
(define *irc-server-ip* "localhost")
(define *irc-server-port* 6667)
(define *irc-server-encoding* "iso-2022-jp")
(d... |
d61ab271afe540051a6fa59cd03a1cfdda67434f63f1415cc0a76bb5baec430f | cognitect/transit-cljs | repl.clj | (require '[cljs.repl :as repl])
(require '[cljs.repl.node :as node])
(repl/repl (node/repl-env)
:verbose true) | null | https://raw.githubusercontent.com/cognitect/transit-cljs/9fe7e61799c0c7523ac8cdbd91c7de2f91d174d1/script/repl.clj | clojure | (require '[cljs.repl :as repl])
(require '[cljs.repl.node :as node])
(repl/repl (node/repl-env)
:verbose true) | |
ab4255a89c57eb10373cae33d87bbf3ff65b7a864c828476a25b06af98cd953c | digitallyinduced/ihp-boilerplate | View.hs | module Application.Helper.View where
import IHP.ViewPrelude
-- Here you can add functions which are available in all your views | null | https://raw.githubusercontent.com/digitallyinduced/ihp-boilerplate/2c702f42b84db7c3143e16c654ddb0fe158ed113/Application/Helper/View.hs | haskell | Here you can add functions which are available in all your views | module Application.Helper.View where
import IHP.ViewPrelude
|
062987e574fd41ee592df1708dddc27cb20f0863ce4e42b4f6bb6a878a667c48 | Elzair/nazghul | enchanters-tower.scm | (kern-load "enchanters-tower-mech.scm")
;;----------------------------------------------------------------------------
;; Map
;;
;; Declare the map for the place here.
;;----------------------------------------------------------------------------
(kern-mk-map
'm_enchanters_tower 31 31 pal_expanded
(list
"tt tt b... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.002/enchanters-tower.scm | scheme | ----------------------------------------------------------------------------
Map
Declare the map for the place here.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Characters
---------------------------------... | (kern-load "enchanters-tower-mech.scm")
(kern-mk-map
'm_enchanters_tower 31 31 pal_expanded
(list
"tt tt bb te bb |v |v tt %a %% %% %% %% %c .. .. .. %a %% %% %% %% %% %% %% %% %% %% %% %% %% "
"bb te .. t% tb tt |v |v tt t5 %% %% %% bb .. .. .. bb .. bb .. bb .. bb .. bb .. bb .. %a %% "
"td t# .. .. .. .... |
3c55f7da0518a36ad4d2c02983d0f4bf9f7394766907d195ad2c768b5e91d9eb | bobzhang/fan | astn_util.ml | open Astfn
let sem = function | a -> (function | b -> `Sem (a, b))
let com = function | a -> (function | b -> `Com (a, b))
let app = function | a -> (function | b -> `App (a, b))
let apply = function | a -> (function | b -> `Apply (a, b))
let sta = function | a -> (function | b -> `Sta (a, b))
let bar = function | a ->... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/cold/astn_util.ml | ocaml | open Astfn
let sem = function | a -> (function | b -> `Sem (a, b))
let com = function | a -> (function | b -> `Com (a, b))
let app = function | a -> (function | b -> `App (a, b))
let apply = function | a -> (function | b -> `Apply (a, b))
let sta = function | a -> (function | b -> `Sta (a, b))
let bar = function | a ->... | |
1c21748c106297849c306d71ffbb3ab4533fdd29436000c93afaf8620a7cddfe | klutometis/sicp-chicken | queue.scm | (define front-ptr car)
(define rear-ptr cdr)
(define set-front-ptr! set-car!)
(define set-rear-ptr! set-cdr!)
(define empty-queue? (compose null? front-ptr))
(define (make-queue) (cons '() '()))
(define (front-queue queue)
(if (empty-queue? queue)
(error "FRONT called with an empty queue" queue)
(car (fro... | null | https://raw.githubusercontent.com/klutometis/sicp-chicken/0f65de82acb06ae6abcff655dc1aea115cfdc142/queue.scm | scheme | (define front-ptr car)
(define rear-ptr cdr)
(define set-front-ptr! set-car!)
(define set-rear-ptr! set-cdr!)
(define empty-queue? (compose null? front-ptr))
(define (make-queue) (cons '() '()))
(define (front-queue queue)
(if (empty-queue? queue)
(error "FRONT called with an empty queue" queue)
(car (fro... | |
88bb4a480529eb3bdcc2f044a2a13e457262d0c711a454332530d650a63815ba | adamwalker/clash-utils | MultiPortBlockRam.hs | {-|
Build multi port rams out of block rams as described in /~steffan/papers/laforest_xor_fpga12.pdf.
-}
module Clash.Container.MultiPortBlockRam (
multiPortBlockRam
) where
import Clash.Prelude
multiPortBlockRam
:: forall dom nWrites nWrites' nReads n addrBits
. (HiddenClockResetEnable dom... | null | https://raw.githubusercontent.com/adamwalker/clash-utils/375c61131e21e9a239b80bdb929ae77f156d056f/src/Clash/Container/MultiPortBlockRam.hs | haskell | |
Build multi port rams out of block rams as described in /~steffan/papers/laforest_xor_fpga12.pdf.
^ Read ports
^ Write ports
^ Read results
Writeback state machine
Initial read of other banks before write
Write bank
Inner dimension is for one write
Read bank | module Clash.Container.MultiPortBlockRam (
multiPortBlockRam
) where
import Clash.Prelude
multiPortBlockRam
:: forall dom nWrites nWrites' nReads n addrBits
. (HiddenClockResetEnable dom, nWrites ~ (nWrites' + 1), KnownNat n, KnownNat addrBits, KnownNat nWrites)
multiPortBlockRam reads writes = ... |
8ea7787f7bd6849de3d43b99d19e689288ed3c5573688a9bad21c86940bed3a8 | jlouis/etorrent_core | etorrent_http.erl | @author < >
%% @doc HTTP protocol helpers
%% <p>Etorrent uses the HTTP protocol for tracker communication. What
is surprising though is the lack of proper HTTP 1.1 handling at the
%% trackers. They are usually quick hacks to make them work as
%% expected.</p>
< p > One of the problems is that content are retu... | null | https://raw.githubusercontent.com/jlouis/etorrent_core/7db7f4ef36c1d055812504f00df92c6a67c2e4af/src/etorrent_http.erl | erlang | @doc HTTP protocol helpers
<p>Etorrent uses the HTTP protocol for tracker communication. What
trackers. They are usually quick hacks to make them work as
expected.</p>
even though we did not request it to be such. This module captures
<p>The module is also home to other small HTTP-like helpers</p>
@end
API
===... | @author < >
is surprising though is the lack of proper HTTP 1.1 handling at the
< p > One of the problems is that content are returned as ,
the condition and fixes it by ungzipping data as >
-module(etorrent_http).
-include("etorrent_version.hrl").
-export([request/1, build_encoded_form_rfc1738/1, mk_hea... |
e32ed4951c8d3be0724d579b966b26970d77505afa274704e5acb7c00ef4aee8 | onyx-platform/onyx | basic_windowing_crash_test.clj | (ns onyx.windowing.basic-windowing-crash-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is]]
[taoensso.timbre :refer [info error warn trace fatal] :as timbre]
[onyx.tasks.seq]
[onyx.plugin.core-async :refer ... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/test/onyx/windowing/basic_windowing_crash_test.clj | clojure | Inject very frequently so we can get some full snapshots
Align threshhold with batch-size since we'll be restarting | (ns onyx.windowing.basic-windowing-crash-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is]]
[taoensso.timbre :refer [info error warn trace fatal] :as timbre]
[onyx.tasks.seq]
[onyx.plugin.core-async :refer ... |
6e27f69ad4446d5a2d7249ce91671c12c2eefe12e2d853e08b3bc037908177f4 | lambdacube3d/lambdacube-quake3 | GameCharacter.hs | # LANGUAGE OverloadedStrings , TupleSections #
module GameEngine.Loader.GameCharacter
( parseCharacter
) where
import Control.Applicative hiding (many, some)
import Control.Monad
import Data.Char
import Data.HashMap.Strict (HashMap,(!))
import qualified Data.HashMap.Strict as HashMap
import Data.ByteString (ByteSt... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-quake3/2fbc17eeea7567f2876d86a7ccce4bd8c8e1927c/game-engine/GameEngine/Loader/GameCharacter.hs | haskell | properties
animations
unify the map
postprocess
parser primitives | # LANGUAGE OverloadedStrings , TupleSections #
module GameEngine.Loader.GameCharacter
( parseCharacter
) where
import Control.Applicative hiding (many, some)
import Control.Monad
import Data.Char
import Data.HashMap.Strict (HashMap,(!))
import qualified Data.HashMap.Strict as HashMap
import Data.ByteString (ByteSt... |
011e98ae108ec06108c46738541b39256b40a24cd3badebd861bab1bde042f34 | naqsha/naqsha | Instances.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - orphans #
module Naqsha.Instances where
import Test.QuickCheck
import Test.SmallCheck.Series
import... | null | https://raw.githubusercontent.com/naqsha/naqsha/c7215a484cdb394c317fb61a93824e5ba3c9fb60/tests/Naqsha/Instances.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE Rank2Types # | # LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
# LANGUAGE MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - orphans #
module Naqsha.Instances where
import Test.QuickCheck
import Test.SmallCheck.Series
import Naqsha.Geometry.Angle.Internal
import Naqsha.Geometry.GeoHash
import Naqsha... |
bca35ac34d68d420a4b0160131296613dff99ef0a9515fc8c4ecc02272f35596 | tommay/pokemon-go | Stats.hs | -- So .: works with literal Strings.
{-# LANGUAGE OverloadedStrings #-}
module Stats (
Stats (Stats),
new,
attack,
defense,
stamina,
) where
import qualified Yaml
import qualified Data.Yaml as Yaml
import Data.Yaml ((.:))
import qualified Data.Yaml.Builder as Builder
import Data.Yaml.Bu... | null | https://raw.githubusercontent.com/tommay/pokemon-go/6b0132f03a1d50ad5513b70fe715e57879dfa597/src/Stats.hs | haskell | So .: works with literal Strings.
# LANGUAGE OverloadedStrings # |
module Stats (
Stats (Stats),
new,
attack,
defense,
stamina,
) where
import qualified Yaml
import qualified Data.Yaml as Yaml
import Data.Yaml ((.:))
import qualified Data.Yaml.Builder as Builder
import Data.Yaml.Builder ((.=))
data Stats = Stats {
attack :: Float,
defense ... |
05f79b2b0853e33adfe1ad87ebc1edfe47807cbaea903e69f3a779a787740b29 | xvw/muhokama | migration_test.ml | open Lib_test
open Lib_crypto
open Lib_migration
let test_is_valid_filename_when_it_is_valid =
test
~about:"is_valid_filename"
~desc:
"When the given filename is valid it should returns a triple with the \
expected data"
(fun () ->
let filename = "1-a_migration_example.yml" in
let ex... | null | https://raw.githubusercontent.com/xvw/muhokama/dcfa488169677ff7f1a3ed71182524aeb0b13c53/test/unit/migration/migration_test.ml | ocaml | open Lib_test
open Lib_crypto
open Lib_migration
let test_is_valid_filename_when_it_is_valid =
test
~about:"is_valid_filename"
~desc:
"When the given filename is valid it should returns a triple with the \
expected data"
(fun () ->
let filename = "1-a_migration_example.yml" in
let ex... | |
3d14dd03d93d9247cf542e2bf668338969a2b8e8134a02f132967266749a3e45 | threatgrid/ctia | unknown.clj | (ns ctia.http.middleware.unknown
(:require [ring.util.response :refer [not-found]]))
(defn err-html
"Construct an HTML body for a 404 response."
([] (err-html nil))
([uri]
(str "<html> <head> "
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=ISO-8859-1\"/>"
" <title>Error 404 ... | null | https://raw.githubusercontent.com/threatgrid/ctia/32857663cdd7ac385161103dbafa8dc4f98febf0/src/ctia/http/middleware/unknown.clj | clojure | charset=ISO-8859-1\"/>" | (ns ctia.http.middleware.unknown
(:require [ring.util.response :refer [not-found]]))
(defn err-html
"Construct an HTML body for a 404 response."
([] (err-html nil))
([uri]
(str "<html> <head> "
" <title>Error 404 </title> </head> "
"<body> <h2>HTTP ERROR: 404</h2> <p>"
(when uri
... |
4d8246a9383229338c08e9ed499529ceb91b5cc12ab346e0b4ddd81c154595e5 | Hendrick/avenue | project.clj | (defproject com.hendrick/avenue "0.1.0-SNAPSHOT"
:description "Compojure routing assistance"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[compojure "1.4.0"]])
| null | https://raw.githubusercontent.com/Hendrick/avenue/e2ab19c56d8cd0e195fd674cb1c1f3466660205a/project.clj | clojure | (defproject com.hendrick/avenue "0.1.0-SNAPSHOT"
:description "Compojure routing assistance"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[compojure "1.4.0"]])
| |
8fcc4da761f68f72a570fd59805805f69b2a7e12cfcc2be51b2193ae5789cc22 | matsen/pplacer | guppy_splitify.ml | open Subcommand
open Guppy_cmdobjs
open Ppatteries
(* *** splitify *** *)
let fal_to_strll fal =
List.map
(fun (name, v) -> name::(List.map string_of_float (Array.to_list v)))
fal
let save_out_named_fal ch fal =
csv_out_channel ch
|> Csv.to_out_obj
|> flip Csv.output_all (fal_to_strll fal)
clas... | null | https://raw.githubusercontent.com/matsen/pplacer/f40a363e962cca7131f1f2d372262e0081ff1190/pplacer_src/guppy_splitify.ml | ocaml | *** splitify *** | open Subcommand
open Guppy_cmdobjs
open Ppatteries
let fal_to_strll fal =
List.map
(fun (name, v) -> name::(List.map string_of_float (Array.to_list v)))
fal
let save_out_named_fal ch fal =
csv_out_channel ch
|> Csv.to_out_obj
|> flip Csv.output_all (fal_to_strll fal)
class cmd () =
object (self... |
b1ededc9e2e0ab365d09fe88ce64c70b416d3af230346093a50d82b5fa170312 | grin-compiler/ghc-whole-program-compiler-project | zip-cmd.hs | # language LambdaCase , RecordWildCards #
import Control.Monad
import Control.Monad.IO.Class
import Options.Applicative
import Data.List
import Data.Text (Text)
import Data.ByteString (ByteString)
import System.FilePath
import Codec.Archive.Zip
import Data.Time.Clock
import Data.Word
import qualified ShellWords
data Z... | null | https://raw.githubusercontent.com/grin-compiler/ghc-whole-program-compiler-project/260337c8aee02c9a2f0a75ad2e6c0f202c57b9a7/mod-pak/app/zip-cmd.hs | haskell |
TODO:
- support regex patterns for filtering (i.e. unpack only the selected content)
| # language LambdaCase , RecordWildCards #
import Control.Monad
import Control.Monad.IO.Class
import Options.Applicative
import Data.List
import Data.Text (Text)
import Data.ByteString (ByteString)
import System.FilePath
import Codec.Archive.Zip
import Data.Time.Clock
import Data.Word
import qualified ShellWords
data Z... |
f87903944d9f040b2e81d6b8f00a929cdfdd697bbb2484ec82be4c9a0cdf999b | duo-lang/duo-lang | Definition.hs | module Resolution.Definition where
import Control.Monad.Except (MonadError, throwError, ExceptT, runExceptT)
import Control.Monad.Reader
import Data.Bifunctor (second)
import Data.Map (Map)
import Data.Map qualified as M
import Data.Text qualified as T
import Resolution.SymbolTable
import Syntax.CST.Names
import Synt... | null | https://raw.githubusercontent.com/duo-lang/duo-lang/926c8e843687ee408027c21483aa2369b4cd0580/duo-lang-renamer/src/Resolution/Definition.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Helper Functions
-----------------------------------------------------------------------... | module Resolution.Definition where
import Control.Monad.Except (MonadError, throwError, ExceptT, runExceptT)
import Control.Monad.Reader
import Data.Bifunctor (second)
import Data.Map (Map)
import Data.Map qualified as M
import Data.Text qualified as T
import Resolution.SymbolTable
import Syntax.CST.Names
import Synt... |
42cccf89b42a9018996e4e4a118e6b14b716ae615c56e037caa3deeb1436bb3e | robrix/sequoia | Context.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TypeFamilies #
module Sequoia.Context
*
type (|-)(..)
-- * Empty contexts
, ΓΔ(..)
-- * Context extensions
, type (<)(..)
, type (>)(..)
-- * Typed de Bruijn indices
, IxL(..)
, IxR(..)
, Index(getIndex)
, indexToLevel
-- * Typed de Bruijn levels
, Level(getLevel)
, levelT... | null | https://raw.githubusercontent.com/robrix/sequoia/592b87cd901475dd1363760ac3ebc30d980c609b/src/Sequoia/Context.hs | haskell | # LANGUAGE GADTs #
* Empty contexts
* Context extensions
* Typed de Bruijn indices
* Typed de Bruijn levels
* Context abstractions
Sequents
Empty contexts
Context extensions
Typed de Bruijn indices
Typed de Bruijn levels
Context abstractions | # LANGUAGE TypeFamilies #
module Sequoia.Context
*
type (|-)(..)
, ΓΔ(..)
, type (<)(..)
, type (>)(..)
, IxL(..)
, IxR(..)
, Index(getIndex)
, indexToLevel
, Level(getLevel)
, levelToIndex
, Ctx(..)
, Cardinality(..)
) where
import Data.Functor.Classes
import Sequoia.Profunctor.Continuation
data _Γ |- _Δ = _Γ ... |
6df38e426219a4acbc2b86ea048aaacc392bdf1cb4e423a2740836d27205953f | lmj/cayley-dickson | test.hs | import Math.CayleyDickson
import Data.Proxy (Proxy(Proxy))
import Data.Ratio (Ratio, (%))
import Control.Monad (replicateM, replicateM_, forM_, liftM)
import System.Random (Random, randomRIO)
import System.IO (hFlush, stdout)
----------------------------------------------------------
-- alternate formulas
pureDir :: ... | null | https://raw.githubusercontent.com/lmj/cayley-dickson/76bfa107ead61464a5cadee2318feaa13251169b/test/test.hs | haskell | --------------------------------------------------------
alternate formulas
--------------------------------------------------------
test utils
--------------------------------------------------------
checks | import Math.CayleyDickson
import Data.Proxy (Proxy(Proxy))
import Data.Ratio (Ratio, (%))
import Control.Monad (replicateM, replicateM_, forM_, liftM)
import System.Random (Random, randomRIO)
import System.IO (hFlush, stdout)
pureDir :: (Conjugable a, Floating a) => Nion n a -> Nion n a
pureDir x = p /. (norm p) wher... |
1e631c944d68b6fed42640106e1cf8140b98727ba83556f41b795c64ba5b0bb0 | chenweiqi/erl_protobuffs | protobuffs.erl | Copyright ( c ) 2009
< >
< >
%%
%% 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, modify, mer... | null | https://raw.githubusercontent.com/chenweiqi/erl_protobuffs/ded499d4d38109e08d34bbdeb552378eeef7b9a5/src/protobuffs.erl | erlang |
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 following
condit... | Copyright ( c ) 2009
< >
< >
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 ,
-module(protobuffs... |
7a9872b3cabe8aaa50cbe5faee4bf43e602e24903ffc269faedd2eeb2976c41f | schemedoc/surveys | www-index.scm | (("Features"
"c-plus-plus"
"comma-commands"
"compiler-available"
"disassemble"
"five-to-six-to-seven"
"implementation-language"
"implementation-support"
"jiffies-per-second"
"load-path"
"optionality"
"profiling"
"scheme-number-implementations"
"scheme-on-windows"
"standalone-executables")
... | null | https://raw.githubusercontent.com/schemedoc/surveys/d5cf420747d134e6eb5ec135540efcba16429430/www-index.scm | scheme | (("Features"
"c-plus-plus"
"comma-commands"
"compiler-available"
"disassemble"
"five-to-six-to-seven"
"implementation-language"
"implementation-support"
"jiffies-per-second"
"load-path"
"optionality"
"profiling"
"scheme-number-implementations"
"scheme-on-windows"
"standalone-executables")
... | |
6c9f4511dadfe27da681d01ecd8d42956fc42b39474b19852a361bb0ae431a66 | dyzsr/ocaml-selectml | pr10693_bad.ml | TEST
flags = " -no - app - funct "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = "-no-app-funct"
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
module type Dep = sig... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-modules-bugs/pr10693_bad.ml | ocaml | TEST
flags = " -no - app - funct "
ocamlc_byte_exit_status = " 2 "
* setup - ocamlc.byte - build - env
* * ocamlc.byte
* * * check - ocamlc.byte - output
flags = "-no-app-funct"
ocamlc_byte_exit_status = "2"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
module type Dep = sig... | |
ef0094252c3b414d0b81ef5d8920f4f98f57e7ab639dccb1eed70e54f79119b8 | xoken/xoken-core | Constants.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
|
Module : Network . . Constants
Copyright : Xoken Labs
License : Open BSV License
Stability : experimental
Portability : POSIX
Network constants for the Bitcoin SV networks , public , test and staling test networks .
Modul... | null | https://raw.githubusercontent.com/xoken/xoken-core/34399655febdc8c0940da7983489f0c9d58c35d2/core/src/Network/Xoken/Constants.hs | haskell | # LANGUAGE OverloadedStrings #
| Constants for network.
| lowercase alphanumeric and dashes
| prefix for WIF private key
| prefix for extended public key
| prefix for extended private key
| network magic
| genesis block header
| maximum block size in bytes
| maximum amount of satoshi
| user agent string
| de... | # LANGUAGE DeriveGeneric #
|
Module : Network . . Constants
Copyright : Xoken Labs
License : Open BSV License
Stability : experimental
Portability : POSIX
Network constants for the Bitcoin SV networks , public , test and staling test networks .
Module : Network.Xoken.Constants
Co... |
8f13a9b164be577a6704bb8a45636422e0dc275c3fd76e8fb702309b11bbabf5 | ocaml-sf/learn-ocaml-corpus | return_double.ml | let return (x : 'a) : 'a m =
(* wrong: return [x] twice *)
let compute s f = s x (fun () -> s x f) in
{ compute }
let (>>=) (m1 : 'a m) (f2 : 'a -> 'b m) : 'b m =
let compute s f = m1.compute (fun x f' -> (f2 x).compute s f') f in
{ compute }
let fail : 'a m =
let compute s f = f() in
{ compute }
let c... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/nondet_monad_cont/wrong/return_double.ml | ocaml | wrong: return [x] twice
The functions [reflect] and [msplit] witness an isomorphism between the
type ['a m] and the type [unit -> ('a * 'a m) option]. | let return (x : 'a) : 'a m =
let compute s f = s x (fun () -> s x f) in
{ compute }
let (>>=) (m1 : 'a m) (f2 : 'a -> 'b m) : 'b m =
let compute s f = m1.compute (fun x f' -> (f2 x).compute s f') f in
{ compute }
let fail : 'a m =
let compute s f = f() in
{ compute }
let choose (m1 : 'a m) (m2 : 'a m) : ... |
ef00869c942a1125da72d5f6733dc591760311c4d066d0ff80c50d80728b0f7a | pflanze/chj-schemelib | wbtree-benchmarks.scm | Copyright 2014 - 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require wbt... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/wbtree-benchmarks.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
(not safe)
tests and benchmarks:
NOTE: I did put the benchmark runs into a TEST form even though at
that time it was basically just a way to comment them out. The idea
is not to |run-tests|, but to run them... | Copyright 2014 - 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require wbtree
define-macro-star
(cj-env IF)
test)
(include "cj-standarddeclares.scm")
( set ! top 100000... |
33337734387c88aa75566b59392e68fd54f85e2836b5a7f2b0c41500e530a15e | mirage/lwt-dllist | main.ml | Test.run "dllist" [ Test_lwt_dllist.suite ]
| null | https://raw.githubusercontent.com/mirage/lwt-dllist/9405bc1f1479ac94322a536e95bc64b03559996e/test/main.ml | ocaml | Test.run "dllist" [ Test_lwt_dllist.suite ]
| |
a1a7ef990d733e0f6f6b302f295396c004d81c6a1c67d7e025a04624211cb109 | alanzplus/EOPL | 5.1.rkt | #lang eopl
; Procedural Representation Of Continuation
; () -> Cont
(define end-cont
(lambda ()
(lambda (val)
(begin
(eopl:printf "End of computation. ~%s")
val))))
; Cont -> Cont
(define zero-cont
(lambda (cont)
(lambda (val)
(apply-con... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch5/5.1.rkt | racket | Procedural Representation Of Continuation
() -> Cont
Cont -> Cont
Var x Exp x Env x Cont -> Cont
Exp x Exp x Env x Cont -> Cont
Exp x Env x Cont -> Cont
Exp x Env x Cont -> Cont
Cont x ExpVal -> FinalAnswer | #lang eopl
(define end-cont
(lambda ()
(lambda (val)
(begin
(eopl:printf "End of computation. ~%s")
val))))
(define zero-cont
(lambda (cont)
(lambda (val)
(apply-cont cont (bool-val (zero? (expval->num val)))))))
(define let-exp-cont
... |
e9e0d7cdc0dcba4ca8f54a28aec9be505d0c8945e92ab179edb81749e2aaf890 | gregtatcam/imaplet-lwt | bigstringable.ml | open Core_replace
module type S = sig
type t
val of_bigstring : Bigstring_.t -> t
val to_bigstring : t -> Bigstring_.t
end
| null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/parsemail/bigstringable.ml | ocaml | open Core_replace
module type S = sig
type t
val of_bigstring : Bigstring_.t -> t
val to_bigstring : t -> Bigstring_.t
end
| |
824eea14e703dd583a9c78e2a9efaa38aac540a7f90bc713b38dd46321d2acb2 | agj/nendo | polygons.rkt | #lang racket
(require "../src/ale/main.rkt")
(define (polygon n size)
(draw-turtle
(repeat n
(right (/ 360 n))
(forward size))))
(superimpose (polygon 3 80)
(polygon 4 80)
(polygon 5 80)
(polygon 6 80))
| null | https://raw.githubusercontent.com/agj/nendo/d668ef17349e3336269f7d03e7f71df0f06caa57/examples/polygons.rkt | racket | #lang racket
(require "../src/ale/main.rkt")
(define (polygon n size)
(draw-turtle
(repeat n
(right (/ 360 n))
(forward size))))
(superimpose (polygon 3 80)
(polygon 4 80)
(polygon 5 80)
(polygon 6 80))
| |
9562013525f54249a5ccf4d36bbab51929be0b9dafb8f1c2497cd5f941d8be82 | arttuka/reagent-material-ui | date_picker_pro.cljs | (ns reagent-mui.x.date-picker-pro
"Imports @mui/x-date-pickers-pro/DatePicker as a Reagent component.
Original documentation is at -pickers/date-picker/ ."
(:require [reagent.core :as r]
["@mui/x-date-pickers-pro/DatePicker" :as MuiDatePicker]))
(def date-picker (r/adapt-react-class MuiDatePicker/Da... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/x/reagent_mui/x/date_picker_pro.cljs | clojure | (ns reagent-mui.x.date-picker-pro
"Imports @mui/x-date-pickers-pro/DatePicker as a Reagent component.
Original documentation is at -pickers/date-picker/ ."
(:require [reagent.core :as r]
["@mui/x-date-pickers-pro/DatePicker" :as MuiDatePicker]))
(def date-picker (r/adapt-react-class MuiDatePicker/Da... | |
fb98a6262df56a276c6ce6ca08380fc595832c44bf209c03f41991e392b4d8bb | rtoy/cmucl | codegen.lisp | ;;; -*- Package: C; Log: C.Log -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/compiler/codegen.lisp $")
;;... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/codegen.lisp | lisp | -*- Package: C; Log: C.Log -*-
**********************************************************************
**********************************************************************
The implementation-independent parts of the code generator. We use
assembly code. After emitting code, we finish the assembly and the... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/compiler/codegen.lisp $")
functions and information provided by the VM definition to convert IR2 into
Written by
(in-package :c)
(intl:textd... |
b3326754d4cd075002bb6af1a6b4a345cb71c5554ec6d3458211dc965af15da0 | jchavarri/rebind | warnings.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
Pierre Weis... | null | https://raw.githubusercontent.com/jchavarri/rebind/ccfa1725ff5b16574daf4d0044c49dbf719aa105/vendor/ocaml/utils/warnings.mli | ocaml | *********************************************************************
OCaml
... | Pierre Weis & & Damien Doligez , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
open Format
type t =
1
... |
41541d5d4e556866bd00b2b86618bfda2eabbde7c9fd2190c23ed4a0ac84f233 | mfikes/fifth-postulate | ns10.cljs | (ns fifth-postulate.ns10)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns10.cljs | clojure | (ns fifth-postulate.ns10)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | |
9f26580adb60ad3f46d94d1807f204ede9a0e1dc46822ec735cc13223af2d8ac | GrammaTech/sel | style-features.lisp | ;;;; style-features.lisp --- Style features tests.
(defpackage :software-evolution-library/test/style-features
(:nicknames :sel/test/style-features)
(:use
:gt/full
:metabang-bind ; FIXME: Remove.
#+gt :testbot
:software-evolution-library/test/util
:software-evolution-library/tes... | null | https://raw.githubusercontent.com/GrammaTech/sel/a59174c02a454e8d588614e221cf281260cf12f8/test/style-features.lisp | lisp | style-features.lisp --- Style features tests.
FIXME: Remove.
depths of all function asts are 0 (all top-level)
list of (ast-class, occurrences)
for each ast-class, verify occurrence count is correct
correct number of keys/values
correct set of keys | (defpackage :software-evolution-library/test/style-features
(:nicknames :sel/test/style-features)
(:use
:gt/full
#+gt :testbot
:software-evolution-library/test/util
:software-evolution-library/test/util-clang
:stefil+
:software-evolution-library
:software-evolution-library/software/parseable
... |
c751a483cde1bd9de9352b6b913e143e9343aa458d30d6545ed79dae7de608d7 | autolwe/autolwe | Norm.mli | (* * Normal form computation for expressions. *)
open Expr
(** [norm_expr e] computes the normal form of the expression [e], if strong is true,
then and will be sorted and equations a = b will be simplified to a - b = 0. *)
val norm_expr : strong:bool -> expr -> expr
val norm_expr_weak : expr -> expr
val norm_e... | null | https://raw.githubusercontent.com/autolwe/autolwe/3452c3dae06fc8e9815d94133fdeb8f3b8315f32/src/Norm/Norm.mli | ocaml | * Normal form computation for expressions.
* [norm_expr e] computes the normal form of the expression [e], if strong is true,
then and will be sorted and equations a = b will be simplified to a - b = 0.
* [equalmod_expr e1 e2] (strongly) normalizes both terms to check if they
are equal modulo the equational ... |
open Expr
val norm_expr : strong:bool -> expr -> expr
val norm_expr_weak : expr -> expr
val norm_expr_strong : expr -> expr
val equalmod_expr : expr -> expr -> bool
|
a4dba45c550a03865eb479ae0354643be1410d01170a269e2c6bea821e769fee | RunOrg/RunOrg | tplGen.ml | (* © 2013 RunOrg *)
module Js = struct
open Printf
let render_raw_html h =
sprintf "this.raw(%S)" h
let echo expr =
sprintf "this.esc(%s)" expr
let sub expr =
sprintf "(%s).call(this)" expr
let each expr body =
sprintf "(function(_a,_i){for(;_i<_a.length;++_i)(function(__){%s}).cal... | null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/plang/tplGen.ml | ocaml | © 2013 RunOrg
Generates the code that is inserted as "{{ TEMPLATES }}" into the builtins |
module Js = struct
open Printf
let render_raw_html h =
sprintf "this.raw(%S)" h
let echo expr =
sprintf "this.esc(%s)" expr
let sub expr =
sprintf "(%s).call(this)" expr
let each expr body =
sprintf "(function(_a,_i){for(;_i<_a.length;++_i)(function(__){%s}).call(this,_a[_i])}).cal... |
3e9afb0027186208399bc0483c7f505ac9f42f37628ec4d45b7b3ba608c1ce1d | fujita-y/ypsilon | lazy.scm | #!nobacktrace
Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
;;; See LICENSE file for terms and conditions of use.
(define-library (scheme lazy)
(import (core primitives))
(export delay
force
promise?
delay-force
make-promise)
(begin
(de... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/a71750e259d29788ef3e74f2b4306ad9720bd4a7/sitelib/scheme/lazy.scm | scheme | See LICENSE file for terms and conditions of use. | #!nobacktrace
Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
(define-library (scheme lazy)
(import (core primitives))
(export delay
force
promise?
delay-force
make-promise)
(begin
(define-syntax delay
(syntax-rules ()
((_ e... |
bddf784532333d1f84848825d78e2e2347eff0e297f1b0e78d8bf12ff333fb0e | toschoo/mom | Session.hs | module Session (startSession)
where
import Types
import Config
import Factory
import qualified Socket as S
import State
import Queue
import Fifo hiding (empty)
import qualified Fifo as FIFO (empty)
import Sender
import ... | null | https://raw.githubusercontent.com/toschoo/mom/b58ca23d05c98ab50d9e981bd4ad2cdb76846399/src/broker/src/Session.hs | haskell | version
heartbeat
ignore
from config
config
start heartbeat
server desc, heartbeat, versions from config
log error
heartbeat, version
log error ?
decrement no of active sessions
raise disconnect error
update heartbeat in Connection
startTx
endTx
endTx | module Session (startSession)
where
import Types
import Config
import Factory
import qualified Socket as S
import State
import Queue
import Fifo hiding (empty)
import qualified Fifo as FIFO (empty)
import Sender
import ... |
1f54fba920170cc9072a8813639c6b4344805f1ba23dc76c46018d5c8e15ad03 | fulcro-legacy/semantic-ui-wrapper | ui_table_footer.cljs | (ns fulcrologic.semantic-ui.collections.table.ui-table-footer
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/collections/Table/TableFooter" :default TableFooter]))
(def ui-table-footer
"A table can have a footer.
Props:
- as (custom): An element type to... | null | https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/collections/table/ui_table_footer.cljs | clojure | (ns fulcrologic.semantic-ui.collections.table.ui-table-footer
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/collections/Table/TableFooter" :default TableFooter]))
(def ui-table-footer
"A table can have a footer.
Props:
- as (custom): An element type to... | |
e70216b6aa38357bfdc903a2378a36c7d50ed099664bf3d84ea96e8f1ec241d8 | sky-big/RabbitMQ | rabbit_amqp1_0_channel.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-amqp1.0/src/rabbit_amqp1_0_channel.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
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 Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
1b19419a9d394b2c3050c7b1519da6cbf951ba1fbc721f587c7d225d6c108025 | iconnect/regex | TDFA.hs | {-# LANGUAGE NoImplicitPrelude #-}
# LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE TemplateHaskellQuotes #-}
#else
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
#endif
module Text.RE.ZeInternals.SearchReplace.TDFA
( ed
, e... | null | https://raw.githubusercontent.com/iconnect/regex/5f9669274b7436468af6c87babc2d3682cc7d21a/Text/RE/ZeInternals/SearchReplace/TDFA.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskellQuotes #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
| the @[ed| ... /// ... |]@ quasi quoters | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
#else
#endif
module Text.RE.ZeInternals.SearchReplace.TDFA
( ed
, edMS
, edMI
, edBS
, edBI
, edMultilineSensitive
, edMultilineInsensitive
, edBlockSensitive
, edBlockInsensitive
, ed_
) where
import Language.Hask... |
67c5dbbb0a054fe9d3f7016cccd46439d2d55aa2d8a3971d97100ca37dd63849 | sadiqj/ocaml-esp32 | cmt_format.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/sadiqj/ocaml-esp32/33aad4ca2becb9701eb90d779c1b1183aefeb578/typing/cmt_format.ml | ocaml | ************************************************************************
OCaml
Fabrice L... | Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Cmi_format
open Typedtree
Note that in Typerex , there is an awful hack to save a cmt file
together with the interface file that was generated by ( this
... |
d4f2cfa2f4a4e3882d98006b911ad91a358c2679c1b0944c21ad5744ce52597e | input-output-hk/project-icarus-importer | Update.hs | module Pos.Aeson.Update
(
) where
import Data.Aeson (FromJSON (..))
import Data.Aeson.TH (deriveToJSON)
import Serokell.Aeson.Options (defaultOptions)
import Universum
import Pos.Core.Update (SystemTag (..))
instance FromJSON SystemTag where
parseJSON v =... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/update/Pos/Aeson/Update.hs | haskell | module Pos.Aeson.Update
(
) where
import Data.Aeson (FromJSON (..))
import Data.Aeson.TH (deriveToJSON)
import Serokell.Aeson.Options (defaultOptions)
import Universum
import Pos.Core.Update (SystemTag (..))
instance FromJSON SystemTag where
parseJSON v =... | |
430f63ccb1cdeda9822d329db06c38f1535aaf7f2831bfd4aa0c20110289ca98 | clash-lang/clash-prelude | RAM.hs | |
Copyright : ( C ) 2015 - 2016 , University of Twente ,
2017 , Myrtle Software Ltd , Google Inc.
License : BSD2 ( see the file LICENSE )
Maintainer : < >
RAM primitives with a combinational read port .
Copyright : (C) 2015-2016, University of Twente,
... | null | https://raw.githubusercontent.com/clash-lang/clash-prelude/5645d8417ab495696cf4e0293796133c7fe2a9a7/src/Clash/Explicit/RAM.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
See: -lang/clash-compiler/commit/721fcfa9198925661cd836668705f817bddaae3c
as to why we need this.
# OPTIONS_HADDOCK show-extensions #
* RAM synchronised to an arbitrary clock
* Interna... | |
Copyright : ( C ) 2015 - 2016 , University of Twente ,
2017 , Myrtle Software Ltd , Google Inc.
License : BSD2 ( see the file LICENSE )
Maintainer : < >
RAM primitives with a combinational read port .
Copyright : (C) 2015-2016, University of Twente,
... |
81a81c9f4b4b65b347ec82a7bffb3a524363a9ebf4b724a109916e979f64d522 | clojure/clojurescript | cljs2261.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the t... | null | https://raw.githubusercontent.com/clojure/clojurescript/a4673b880756531ac5690f7b4721ad76c0810327/src/test/cljs/cljs/macro_test/cljs2261.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns cljs.macro-test.cljs2261)
(defmacro cake []
`(X.))
|
c978167066cfdb269c6dc0044df304235569b4658444d8c046a57d2730811cfc | marcin-rzeznicki/stackcollapse-ghc | Main.hs | #!/usr/bin/env stack
-- stack script --compile --resolver nightly-2020-09-16 --package data-ordlist --package pqueue --package vector --package deepseq
import System.Environment (getArgs)
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad (void, forM... | null | https://raw.githubusercontent.com/marcin-rzeznicki/stackcollapse-ghc/6ff9b8d526dbeccb68aab02bec7cd7b2e53515ef/examples/prog/Main.hs | haskell | stack script --compile --resolver nightly-2020-09-16 --package data-ordlist --package pqueue --package vector --package deepseq
# SCC "program" # | #!/usr/bin/env stack
import System.Environment (getArgs)
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad (void, forM_)
import qualified Data.PQueue.Prio.Min as PQ
import Data.List.Ordered (union)
import Data.Vector.Unboxed (Vec... |
55bf6ca40112a0abc58e1dd02a7482d10e9e61bf1769741a2b0a978dd983befe | puppetlabs/trapperkeeper | signal_handling_test.clj | (ns puppetlabs.trapperkeeper.signal-handling-test
(:require
[puppetlabs.trapperkeeper.core :as core]))
(defn- start-test [context get-in-config]
(let [continue? (atom true)
thread (future
(try ;; future just discards top-level exceptions
(while @continue?
... | null | https://raw.githubusercontent.com/puppetlabs/trapperkeeper/b4b179f775d9b755c6a8d418d648e56f42c86da0/test/puppetlabs/trapperkeeper/signal_handling_test.clj | clojure | future just discards top-level exceptions | (ns puppetlabs.trapperkeeper.signal-handling-test
(:require
[puppetlabs.trapperkeeper.core :as core]))
(defn- start-test [context get-in-config]
(let [continue? (atom true)
thread (future
(while @continue?
(let [target (get-in-config [:signal-test-target])]
... |
4ef769f02ae6faf98e5a92ec64c163e5ea46557f40de4c40c15d62c683e83213 | kazu-yamamoto/http2 | Manager.hs | -- | A thread pool manager.
-- The manager has responsibility to spawn and kill
-- worker threads.
module Network.HTTP2.Arch.Manager (
Manager
, Action
, start
, setAction
, stop
, spawnAction
, addMyId
, deleteMyId
, timeoutKillThread
, timeoutClose
) where
import Data.Foldable
import Data... | null | https://raw.githubusercontent.com/kazu-yamamoto/http2/88b3c192c251c15fa4dc426aa0372841dc3fee49/Network/HTTP2/Arch/Manager.hs | haskell | | A thread pool manager.
The manager has responsibility to spawn and kill
worker threads.
--------------------------------------------------------------
| Action to be spawned by the manager.
| Manager to manage the thread pool and the timer.
| Starting a thread pool manager.
Its action is initially set to... | module Network.HTTP2.Arch.Manager (
Manager
, Action
, start
, setAction
, stop
, spawnAction
, addMyId
, deleteMyId
, timeoutKillThread
, timeoutClose
) where
import Data.Foldable
import Data.IORef
import Data.Set (Set)
import qualified Data.Set as Set
import qualified System.TimeManager as T
... |
10ba4a8affad31b558773e3e7892ca8d6554cf93b8b91c53608cdcee9f740592 | ndmitchell/cmdargs | Annotate.hs | # LANGUAGE PatternGuards , ScopedTypeVariables , ExistentialQuantification , DeriveDataTypeable #
{-# OPTIONS_GHC -O0 #-}
-- | This module captures annotations on a value, and builds a 'Capture' value.
This module has two ways of writing annotations :
--
/Impure/ : The impure method of writing annotations is s... | null | https://raw.githubusercontent.com/ndmitchell/cmdargs/7c206f464fa666b2654ae9da59cdff44e310de66/System/Console/CmdArgs/Annotate.hs | haskell | # OPTIONS_GHC -O0 #
| This module captures annotations on a value, and builds a 'Capture' value.
/Pure/: The pure method is more verbose, and lacks some type safety.
Both evaluate to:
* Capture framework
* Impure
* Pure
| The result of capturing some annotations.
^ Many values collapsed ('many' or '... | # LANGUAGE PatternGuards , ScopedTypeVariables , ExistentialQuantification , DeriveDataTypeable #
This module has two ways of writing annotations :
/Impure/ : The impure method of writing annotations is susceptible to over - optimisation by GHC
- sometimes @\{\-\ # OPTIONS_GHC -fno - cse \#\-\}@ will be re... |
e181cfda104125e7f76d2929cf86d540f0ec354fb2daf3d6b15ee88d0e77b8a6 | janestreet/ppx_expect | import.ml | module Ppx_compare_lib = Base.Exported_for_specific_uses.Ppx_compare_lib
| null | https://raw.githubusercontent.com/janestreet/ppx_expect/8b40772aeff9baebaf6506b83af968f6d1efd46e/matcher/import.ml | ocaml | module Ppx_compare_lib = Base.Exported_for_specific_uses.Ppx_compare_lib
| |
30174082978b7dc954199d079a176c0056efece85b0e559bd96da77f9f4132b5 | MLstate/opalang | hdList.mli |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/ocamllib/libbase/hdList.mli | ocaml | *
Manipulation of non empty lists
* unwrap a value of type t
* wrap a list
@raise Invalid_argument if the list is empty
|
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... |
6fc5db0d49b61ac970ad3876f3af6c8e3256dc949c629a64a577cd30c50559cb | VisionsGlobalEmpowerment/webchange | state.cljs | (ns webchange.admin.pages.school-courses.state
(:require
[goog.string :as gstring]
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.admin.widgets.confirm.state :as confirm]
[webchange.state.warehouse :as warehouse]
[webchange.val... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/ab9c40d461dd76b19938d8846660c1ee50d793af/src/cljs/webchange/admin/pages/school_courses/state.cljs | clojure | available-courses
| (ns webchange.admin.pages.school-courses.state
(:require
[goog.string :as gstring]
[re-frame.core :as re-frame]
[re-frame.std-interceptors :as i]
[webchange.admin.routes :as routes]
[webchange.admin.widgets.confirm.state :as confirm]
[webchange.state.warehouse :as warehouse]
[webchange.val... |
141bda1ea619587599afbdccf8a6ab4d3049fe1e78658fea4598dc093f841abd | wilbowma/cur | racket-ascii.rkt | #lang racket/base
(require data/bit-vector)
(provide (all-defined-out))
(define (ascii-char? c)
(< (char->integer c) 127))
(define (ascii-string? str)
(andmap ascii-char? (string->list str)))
(define (byte->ascii-bit-vector b)
(bit-vector
(bitwise-bit-set? b 6)
(bitwise-bit-set? b 5)
(bitwise-bit-set... | null | https://raw.githubusercontent.com/wilbowma/cur/e039c98941b3d272c6e462387df22846e10b0128/cur-lib/cur/stdlib/racket-ascii.rkt | racket | #lang racket/base
(require data/bit-vector)
(provide (all-defined-out))
(define (ascii-char? c)
(< (char->integer c) 127))
(define (ascii-string? str)
(andmap ascii-char? (string->list str)))
(define (byte->ascii-bit-vector b)
(bit-vector
(bitwise-bit-set? b 6)
(bitwise-bit-set? b 5)
(bitwise-bit-set... | |
3e668626ec2d688ab7c417f9828871f2b563c50b561af248307ea7fe76ea7dc2 | takikawa/racket-ppa | info.rkt | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define build-deps (quote ("net-doc" "net-cookies-doc" "rackunit-doc" "db-doc" "scribble-doc" "db-lib" "net-lib" "net-cookies-lib" "rackunit-lib" "sandbox-lib" "scribble-lib" "web-server-lib" "racket-doc"))) (define deps (quote ("base"))) (def... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/share/pkgs/web-server-doc/info.rkt | racket | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define build-deps (quote ("net-doc" "net-cookies-doc" "rackunit-doc" "db-doc" "scribble-doc" "db-lib" "net-lib" "net-cookies-lib" "rackunit-lib" "sandbox-lib" "scribble-lib" "web-server-lib" "racket-doc"))) (define deps (quote ("base"))) (def... | |
0a472dd131cffb54594a8b344ff7d38d6057051fbc07efc6e981df0cdd3ead95 | stchang/macrotypes | stlc-tests.rkt | ;; s-exp = use s-expression parser
#lang s-exp turnstile/examples/cmu15-814/stlc
(require rackunit/turnstile)
(typecheck-fail (λ ([x : Undef]) x) #:with-msg "Undef: unbound identifier")
(typecheck-fail (λ ([x : →]) x)
#:with-msg "Improper usage of type constructor →.+expected >= 1 arguments")
(typecheck-fail (λ ([x ... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-test/tests/turnstile/cmu15-814/stlc-tests.rkt | racket | s-exp = use s-expression parser | #lang s-exp turnstile/examples/cmu15-814/stlc
(require rackunit/turnstile)
(typecheck-fail (λ ([x : Undef]) x) #:with-msg "Undef: unbound identifier")
(typecheck-fail (λ ([x : →]) x)
#:with-msg "Improper usage of type constructor →.+expected >= 1 arguments")
(typecheck-fail (λ ([x : (→)]) x)
#:with-msg "Improper us... |
2b975a2a12e2406622799ffbee94c05e1b850b1db29c14e4e0964fcb85f97a44 | jfischoff/hasql-queue | ExactlyOnce.hs | module Hasql.Queue.Low.ExactlyOnce
( enqueue
, withDequeue
, withDequeueWith
) where
import qualified Hasql.Queue.High.ExactlyOnce as H
import Control.Exception
import qualified Hasql.Encoders as E
import qualified Hasql.Decoders as D
import Hasql.Session
import Hasql.Statement
import ... | null | https://raw.githubusercontent.com/jfischoff/hasql-queue/49f4cba713bedf6ce907cc89794f2567befed396/src/Hasql/Queue/Low/ExactlyOnce.hs | haskell | |Enqueue a payload send a notification on the
specified channel.
^ Notification channel name. Any valid PostgreSQL identifier
^ Payload encoder
^ List of payloads to enqueue
^ Notification channel name. Any valid PostgreSQL identifier
^ Connection
^ Payload decoder
^ Batch count
^ Transaction runner
^ Event h... | module Hasql.Queue.Low.ExactlyOnce
( enqueue
, withDequeue
, withDequeueWith
) where
import qualified Hasql.Queue.High.ExactlyOnce as H
import Control.Exception
import qualified Hasql.Encoders as E
import qualified Hasql.Decoders as D
import Hasql.Session
import Hasql.Statement
import ... |
76e60ca48ba8b2e16d40efe20724a8f2b414496448c21615063243af2121b846 | haskell-tools/haskell-tools | FunctionArgs.hs | module CommentHandling.FunctionArgs where
f :: Int -- something
-> {-| result -} Int
-> Int -- ^ other thing
f = undefined
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/refactor/examples/CommentHandling/FunctionArgs.hs | haskell | something
| result
^ other thing | module CommentHandling.FunctionArgs where
f = undefined
|
02efbaaa9ac5c80b93edaaa885ed754b8dfce7845a525e4e6a480ff4d3f03085 | zenspider/schemers | exercise.4.39.scm | #!/usr/bin/env csi -s
(require rackunit)
(use amb amb-extras)
Exercise 4.39
;; Does the order of the restrictions in the multiple-dwelling
;; procedure affect the answer? Does it affect the time to find an
;; answer? If you think it matters, demonstrate a faster program
;; obtained from the given one by reordering... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.39.scm | scheme | Does the order of the restrictions in the multiple-dwelling
procedure affect the answer? Does it affect the time to find an
answer? If you think it matters, demonstrate a faster program
obtained from the given one by reordering the restrictions. If you
think it does not matter, argue your case.
Answered in semina... | #!/usr/bin/env csi -s
(require rackunit)
(use amb amb-extras)
Exercise 4.39
of Eratosthenes , if that came after other checks ( eg , if you tested
against known primes in descending order ) you 'd do a LOT more work .
(define (multiple-dwelling)
(let ((baker (amb 1 2 3 4 5))
(cooper (amb 1 2 ... |
7e79ca994ad64fdeb64321205289d86fda98d786d0caabec5c798bde21487130 | gergoerdi/tandoori | pat.hs | data Foo1 = Bar1 | Baz1
data Foo2 = Bar2 | Baz2
(x,y) = (Bar1, Bar2)
| null | https://raw.githubusercontent.com/gergoerdi/tandoori/515142ce76b96efa75d7044c9077d85394585556/input/pat.hs | haskell | data Foo1 = Bar1 | Baz1
data Foo2 = Bar2 | Baz2
(x,y) = (Bar1, Bar2)
| |
05d342f61ba324f7f95b980cd099cc0b5e19704717d159eb9243f4f652e61623 | kaoskorobase/mescaline | Server.hs | module Mescaline.Synth.BufferCache.Server (
BufferCache
, Buffer
, uid
, numChannels
, numFrames
, Alloc
, allocBytes
, allocFrames
, new
, release
, allocBuffer
, freeBuffer
) where
import Control.Concurrent.MVar
import Control.Monad (forM, forM_)
import qualified Data.Se... | null | https://raw.githubusercontent.com/kaoskorobase/mescaline/13554fc4826d0c977d0010c0b4fb74ba12ced6b9/lib/mescaline/Mescaline/Synth/BufferCache/Server.hs | haskell | Allocate buffer id
Allocate buffer
Insert into used | module Mescaline.Synth.BufferCache.Server (
BufferCache
, Buffer
, uid
, numChannels
, numFrames
, Alloc
, allocBytes
, allocFrames
, new
, release
, allocBuffer
, freeBuffer
) where
import Control.Concurrent.MVar
import Control.Monad (forM, forM_)
import qualified Data.Se... |
e9ffadfe64e18f45a71b3d67b0011ae7908b7385735f2ae9ccccafcbf81e1eff | janestreet/memtrace_viewer_with_deps | ppx_jane_test_alert_in_mli.mli | [@@@alert interface "This signature contains an alert."]
val x : int
| null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/ppx_jane/test/alert_in_mli/ppx_jane_test_alert_in_mli.mli | ocaml | [@@@alert interface "This signature contains an alert."]
val x : int
| |
b3d1f18b097aed6e0c3bdfabd2ef824189da702796fe843f014c7140c22d9403 | spurious/sagittarius-scheme-mirror | %3a126.scm | ;; Test from sample implementation
(import (rnrs base)
(rnrs control)
(rnrs io simple)
(only (srfi :1) lset= lset-adjoin)
(srfi :64)
(srfi :126))
(define (exact-integer? obj)
(and (integer? obj) (exact? obj)))
;; INCLUDE test-suite.body.scm
;;; This doesn't test weakness, external representation, and quasiquot... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/tests/srfi/%253a126.scm | scheme | Test from sample implementation
INCLUDE test-suite.body.scm
This doesn't test weakness, external representation, and quasiquote.
extra tests for weakness
it raises error on macro expansion time
extra tests for alist->*hashtable | (import (rnrs base)
(rnrs control)
(rnrs io simple)
(only (srfi :1) lset= lset-adjoin)
(srfi :64)
(srfi :126))
(define (exact-integer? obj)
(and (integer? obj) (exact? obj)))
(test-begin "SRFI-126")
(test-group "constructors & inspection"
(test-group "eq"
(let ((tables (list (make-eq-hashtable)
... |
08265179b1fc4dcdc63277732d9266d318e917ac680e49651e497905de1da1d8 | mput/sicp-solutions | 2_84.rkt | #lang racket
Solution for exercise 2_84 .
(require (only-in "../solutions/dispatch-table.rkt" type-tag contents get put get-coercion put-coercion))
(provide apply-generic-coercion)
(define (try-raise n)
(let ((proc (get 'raise (type-tag n))))
(if proc
(proc n)
false)))
(define (get-types args) (m... | null | https://raw.githubusercontent.com/mput/sicp-solutions/fe12ad2b6f17c99978c8fe04b2495005986b8496/solutions/2_84.rkt | racket | #lang racket
Solution for exercise 2_84 .
(require (only-in "../solutions/dispatch-table.rkt" type-tag contents get put get-coercion put-coercion))
(provide apply-generic-coercion)
(define (try-raise n)
(let ((proc (get 'raise (type-tag n))))
(if proc
(proc n)
false)))
(define (get-types args) (m... | |
2021f0b53c5ad9124f2a033effb60bc9855f31cda0a01c8d3e46430e8d201c14 | moby/vpnkit | host.mli | include Sig.HOST
val start_background_gc : int option -> unit
* [ start_background_gc interval ] starts a background thread which compacts
the heap every [ interval ] seconds . An immediate compact can be triggered
by sending
the heap every [interval] seconds. An immediate compact can be triggered
... | null | https://raw.githubusercontent.com/moby/vpnkit/6039eac025e0740e530f2ff11f57d6d990d1c4a1/src/hostnet/host.mli | ocaml | include Sig.HOST
val start_background_gc : int option -> unit
* [ start_background_gc interval ] starts a background thread which compacts
the heap every [ interval ] seconds . An immediate compact can be triggered
by sending
the heap every [interval] seconds. An immediate compact can be triggered
... | |
cd818c9f1897d0a66db9f3cdaffe69e50ab86cde9eb7758211297925a68133cf | taffybar/status-notifier-item | Util.hs | {-# LANGUAGE OverloadedStrings #-}
module StatusNotifier.Util where
import Control.Arrow
import Control.Lens
import DBus.Client
import qualified DBus.Generation as G
import qualified DBus.Internal.Message as M
import qualified DBus.Internal.Types as T
import qualified DBus.Introspection a... | null | https://raw.githubusercontent.com/taffybar/status-notifier-item/fe6fddc6827635a5c9cc450e502dcd28b11d7fba/src/StatusNotifier/Util.hs | haskell | # LANGUAGE OverloadedStrings # | module StatusNotifier.Util where
import Control.Arrow
import Control.Lens
import DBus.Client
import qualified DBus.Generation as G
import qualified DBus.Internal.Message as M
import qualified DBus.Internal.Types as T
import qualified DBus.Introspection as I
import Data.Bits
impo... |
b4166858957d11024d79d39b030d080a07d2f2bf18a99856c16e9f40c2bbdb2c | pokepay/paras | parser.lisp | (defpackage #:paras/tests/parser
(:use #:cl
#:rove
#:paras/parser
#:paras/errors)
(:shadowing-import-from #:paras/errors
#:undefined-function
#:end-of-file))
(in-package #:paras/tests/parser)
(deftest can-parse-values
(ok (= (parse-strin... | null | https://raw.githubusercontent.com/pokepay/paras/3718799c0d736524a225bf3fc453c43ad83c4df6/tests/parser.lisp | lisp | (defpackage #:paras/tests/parser
(:use #:cl
#:rove
#:paras/parser
#:paras/errors)
(:shadowing-import-from #:paras/errors
#:undefined-function
#:end-of-file))
(in-package #:paras/tests/parser)
(deftest can-parse-values
(ok (= (parse-strin... | |
9101a7fa6622a1a95f7a1ac913e4e32a3648b63f025402aacb17241da1d7b8d8 | wireapp/wire-server | Assert.hs | # LANGUAGE LambdaCase #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either... | null | https://raw.githubusercontent.com/wireapp/wire-server/6bc787fde0a767f96492e68e722c912ef343c6b2/libs/api-bot/src/Network/Wire/Bot/Assert.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | # LANGUAGE LambdaCase #
Copyright ( C ) 2022 Wire Swiss GmbH < >
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
You should have received a copy of the GNU Affero General Public License along
module ... |
3518ca1590f0406265a8f0829b6ae55a525772a48038cc5e9995a019d8e2a727 | penpot/penpot | spec.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.path.spec
(:require
[clojure.spec.alpha :as s]))
SCHEMAS
(s/def ::command... | null | https://raw.githubusercontent.com/penpot/penpot/cc18f84d620e37d8efafc5bed1bcdbe70ec23c1e/frontend/src/app/main/data/workspace/path/spec.cljs | clojure |
Copyright (c) KALEIDOS INC | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.data.workspace.path.spec
(:require
[clojure.spec.alpha :as s]))
SCHEMAS
(s/def ::command #{:move-to
:l... |
c1de063e503745d034e00e4a4e384899ffdbdfc67989f374d032604e7cf3562f | awakesecurity/proto3-suite | Option.hs |
module Test.Proto.Parse.Option (tests) where
import Hedgehog (Property, PropertyT, forAll, property, (===))
import qualified Hedgehog as Hedgehog
import qualified Hedgehog.Gen as Gen
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testProperty)
import qualified Test.Proto.Parse.Gen as Gen
import... | null | https://raw.githubusercontent.com/awakesecurity/proto3-suite/f54801824bbfc752477338c37a93eba9e2983a37/tests/Test/Proto/Parse/Option.hs | haskell | orphan Pretty DotProtoIdentifier
------------------------------------------------------------------------------
| Ensure the parser handling the keyword "option" must be followed by a
non-alphanumeric, otherwise the parser should fail. |
module Test.Proto.Parse.Option (tests) where
import Hedgehog (Property, PropertyT, forAll, property, (===))
import qualified Hedgehog as Hedgehog
import qualified Hedgehog.Gen as Gen
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testProperty)
import qualified Test.Proto.Parse.Gen as Gen
import... |
792301e2f7cf9dfe3e7c642c3928a14118a6440ee6124eef396e661a5b1c2ef0 | racket/typed-racket | cast-top-level.rkt | #lang racket/load
(require typed/racket/base/shallow)
(require typed/rackunit)
(cast 2 Number)
(cast 2 Integer)
(cast (list 2 4) (Listof Byte))
(cast (vector 2 4) (Vectorof Byte))
(check-equal? (cast 2 Number) 2)
(check-equal? (cast 2 Integer) 2)
(check-equal? (cast (list 2 4) (Listof Byte)) (list 2 4))
(check-pred ... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/cast-top-level.rkt | racket | Struct definitions need to be at the top level for some reason. | #lang racket/load
(require typed/racket/base/shallow)
(require typed/rackunit)
(cast 2 Number)
(cast 2 Integer)
(cast (list 2 4) (Listof Byte))
(cast (vector 2 4) (Vectorof Byte))
(check-equal? (cast 2 Number) 2)
(check-equal? (cast 2 Integer) 2)
(check-equal? (cast (list 2 4) (Listof Byte)) (list 2 4))
(check-pred ... |
6f03d28a156a9c9f08c5e2b0222d6c5ab866ab894dc899c3d80550553f47b4fa | ghc/nofib | RA.hs | #include "unboxery.h"
module RA(rA,rAs) where
import Types
rA
= Nuc
(Tfo FL_LIT(-0.0018) FL_LIT(-0.8207) FL_LIT(0.5714) -- dgf_base_tfo
FL_LIT(0.2679) FL_LIT(-0.5509) FL_LIT(-0.7904)
FL_LIT(0.9634) FL_LIT(0.1517) FL_LIT(0.2209)
FL_LIT(0.0073) FL_LIT(8.4030) FL... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/spectral/hartel/nucleic2/RA.hs | haskell | dgf_base_tfo
p_o3'_275_tfo
p_o3'_180_tfo
p_o3'_60_tfo
P
O1P
O2P
H5'
H5''
C4'
H4'
C1'
H1'
H2''
H2'
C3'
H3'
O3'
N1
C4
H2
H62
dgf_base_tfo
p_o3'_275_tfo
p_o3'_180_tfo
p_o3'_60_tfo
P
O1P
O2P
H5'
H5''
C4'
H4'
C1'
H1'
H2''
H2'
C3'
H3'
O3'
N1
C4
H2
H62
dgf_base_tfo
p_o3'_275_tfo
... | #include "unboxery.h"
module RA(rA,rAs) where
import Types
rA
= Nuc
FL_LIT(0.2679) FL_LIT(-0.5509) FL_LIT(-0.7904)
FL_LIT(0.9634) FL_LIT(0.1517) FL_LIT(0.2209)
FL_LIT(0.0073) FL_LIT(8.4030) FL_LIT(0.6232))
FL_LIT(-0.0433) FL_LIT(-0.4257) FL_LIT(0.9038)
... |
5d59e141049c1f9a4e2a3e9e5e489b9e992fe5946f274e4b3839e543a5281b57 | ChrisPenner/lens-regex-pcre | Bench.hs | # LANGUAGE QuasiQuotes #
{-# LANGUAGE OverloadedStrings #-}
import Gauge.Benchmark
import Gauge.Main
import Data.ByteString as BS
import qualified Text.Regex.PCRE.Heavy as PCRE
import Control.Lens
import Control.Lens.Regex.ByteString
main :: IO ()
main = do
srcFile <- BS.readFile "./bench/data/small-bible.txt"
... | null | https://raw.githubusercontent.com/ChrisPenner/lens-regex-pcre/c7587b825f8ab788720d88cbafab72cc72690802/bench/Bench.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE QuasiQuotes #
import Gauge.Benchmark
import Gauge.Main
import Data.ByteString as BS
import qualified Text.Regex.PCRE.Heavy as PCRE
import Control.Lens
import Control.Lens.Regex.ByteString
main :: IO ()
main = do
srcFile <- BS.readFile "./bench/data/small-bible.txt"
defaultMain
[ bgroup "stati... |
fc798f58779b226d61f569fd103a20b6e04ce6d30a2099a02135504371891bbb | ryzhyk/cocoon | OpenFlow.hs |
Copyrights ( c ) 2016 . Samsung Electronics Ltd. All right 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 License at
-2.0
Unless required by applicable law or agreed to in ... | null | https://raw.githubusercontent.com/ryzhyk/cocoon/409d10b848a4512e7cf653d5b6cf6ecf247eb794/cocoon/OpenFlow/OpenFlow.hs | haskell | Generator state
e must be a scalar expression
Generate all switches in the topology
Generate OF switch
Input table: map input port number into logical Cocoon port number
Compute an expression and optionally place the result to a provided location
next - next table in the chain
e - expression to be computed... |
Copyrights ( c ) 2016 . Samsung Electronics Ltd. All right 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 License at
-2.0
Unless required by applicable law or agreed to in ... |
c336d876148a672d90213ced1aac85e58dbe7960a1e43a92a189782ebd7c0cd3 | valderman/haste-compiler | list.hs | module Main where
import Haste
import Haste.DOM
import Haste.Events
main :: IO ()
main = do
ul <- elemsByQS document "ul#demo-list"
case ul of
(el:_) -> mapQS_ document "#demo-list li" (handleRemove el)
_ -> error "Element 'ul#demo-list' not found"
handleRemove :: Elem -> Elem -> IO HandlerInfo
handl... | null | https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/examples/list/list.hs | haskell | module Main where
import Haste
import Haste.DOM
import Haste.Events
main :: IO ()
main = do
ul <- elemsByQS document "ul#demo-list"
case ul of
(el:_) -> mapQS_ document "#demo-list li" (handleRemove el)
_ -> error "Element 'ul#demo-list' not found"
handleRemove :: Elem -> Elem -> IO HandlerInfo
handl... | |
df25ffa73118e3286680a4c2a16068f5604572277639048ef1c73c109fcfe526 | clj-puredata/clj-puredata | song01.clj | (ns clj-puredata.song01
(:require [clj-puredata.core :refer [open-pd
load-patch
with-patch
pd
inlet
outlet
... | null | https://raw.githubusercontent.com/clj-puredata/clj-puredata/bb4879891b4960fee0fc511d4289a967ff0be393/src/clj_puredata/song01.clj | clojure | output sum
misc
(startup) | (ns clj-puredata.song01
(:require [clj-puredata.core :refer [open-pd
load-patch
with-patch
pd
inlet
outlet
... |
46fd7fe526447e0e20a8640856ce7a847984ca838e05eea7961c0bc32dd03a08 | input-output-hk/cardano-sl | Class.hs | # LANGUAGE TypeFamilies #
-- | Monad abstracting delegation access. Sometimes we want to combine
-- reading from database and some in-memory map, so that's the
-- solution for these cases.
module Pos.Chain.Delegation.Cede.Class
( MonadCedeRead (..)
, getPskPk
, MonadCede (..)
) where
impo... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/src/Pos/Chain/Delegation/Cede/Class.hs | haskell | | Monad abstracting delegation access. Sometimes we want to combine
reading from database and some in-memory map, so that's the
solution for these cases.
| This monad abstracts data needed for verifying headers/blocks
from the standpoint of delegation component.
| Returns 'True' if given stakeholder has already p... | # LANGUAGE TypeFamilies #
module Pos.Chain.Delegation.Cede.Class
( MonadCedeRead (..)
, getPskPk
, MonadCede (..)
) where
import Universum
import Control.Monad.Trans (MonadTrans)
import Pos.Chain.Delegation.Cede.Types (DlgEdgeAction (..))
import P... |
deae737afa62dc68bf2a12e98cf761a98453ed34d654f5c5f03a137771181f29 | haskell-opengl/OpenGL | TransformFeedback.hs | -----------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.TransformFeedback
Copyright : ( c ) 2011 - 2019 , 2011 - 2016
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
----------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGL/f7af8fe04b0f19c260a85c9ebcad612737cd7c8c/src/Graphics/Rendering/OpenGL/GL/TransformFeedback.hs | haskell | ---------------------------------------------------------------------------
|
Module : Graphics.Rendering.OpenGL.GL.TransformFeedback
License : BSD3
Stability : stable
Portability : portable
---------------------------------------------------------------------------
* starting and ending
* Shade... | Copyright : ( c ) 2011 - 2019 , 2011 - 2016
Maintainer : < >
module Graphics.Rendering.OpenGL.GL.TransformFeedback (
beginTransformFeedback, endTransformFeedback,
*
TransformFeedbackBufferMode(..), marshalTransformFeedbackBufferMode,
unmarshalTransformFeedbackBufferMode,
transformF... |
7a3bf1f55fc20d9e7873e72b43af9e8f804c4af30d19d695a9704b9031db195d | aggieben/weblocks | compiler.lisp |
(in-package :weblocks-test)
;;; Test view-argument-quoting-strategy
(deftest view-argument-quoting-strategy-1
(view-argument-quoting-strategy 'some-arg)
:none)
;;; Test quote-property-list-arguments
(deftest quote-property-list-arguments-1
(weblocks::quote-property-list-arguments '(:a 1 :b 2 :c 3))
(:a 1... | null | https://raw.githubusercontent.com/aggieben/weblocks/8d86be6a4fff8dde0b94181ba60d0dca2cbd9e25/test/views/view/compiler.lisp | lisp | Test view-argument-quoting-strategy
Test quote-property-list-arguments |
(in-package :weblocks-test)
(deftest view-argument-quoting-strategy-1
(view-argument-quoting-strategy 'some-arg)
:none)
(deftest quote-property-list-arguments-1
(weblocks::quote-property-list-arguments '(:a 1 :b 2 :c 3))
(:a 1 :b 2 :c 3))
(deftest quote-property-list-arguments-2
(weblocks::quote-pro... |
8402c8fe858bc17b0f916a2368a676d81b35de0022ad4159cf51cfc67fb772df | processone/xmpp | xep0234.erl | Created automatically by XML generator ( fxml_gen.erl )
%% Source: xmpp_codec.spec
-module(xep0234).
-compile(export_all).
do_decode(<<"file-too-large">>,
<<"urn:xmpp:jingle:apps:file-transfer:errors:0">>, El,
Opts) ->
decode_jingle_ft_error_file_too_large(<<"urn:xmpp:jingle:apps:file-trans... | null | https://raw.githubusercontent.com/processone/xmpp/88c43c3cf5843a8a0f76eac390980a3a39c972dd/src/xep0234.erl | erlang | Source: xmpp_codec.spec | Created automatically by XML generator ( fxml_gen.erl )
-module(xep0234).
-compile(export_all).
do_decode(<<"file-too-large">>,
<<"urn:xmpp:jingle:apps:file-transfer:errors:0">>, El,
Opts) ->
decode_jingle_ft_error_file_too_large(<<"urn:xmpp:jingle:apps:file-transfer:errors:0">>,
... |
be3fc79c04341a03f78e885fd171943c23c1852a37f825fc575c20aa77d5b02d | bennn/dissertation | morse-code-strings.rkt | #lang racket/base
Copyright 2013 ( )
;; Code licensed under the Mozilla Public License 2.0
;; this file contains functions to convert text into sounds
;;bg
;; Original file would make a SOUND from the sequence of dots and dashes.
;; We just make the . and -
(provide string->morse)
(require "morse-code-table.r... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/jfp-2019/benchmarks/morsecode/untyped/morse-code-strings.rkt | racket | Code licensed under the Mozilla Public License 2.0
this file contains functions to convert text into sounds
bg
Original file would make a SOUND from the sequence of dots and dashes.
We just make the . and -
map a character to a dit-dah string | #lang racket/base
Copyright 2013 ( )
(provide string->morse)
(require "morse-code-table.rkt")
(define (char->dit-dah-string letter)
(define res (hash-ref char-table (char-downcase letter) #f))
(if (eq? #f res)
(raise-argument-error 'letter-map "character in map"
0 letter... |
93c716413e2f08b2acab09a5bb41099834e5fb3a8104dc6cc7ffd8f7f13bb9ac | godfat/sandbox | flatten.hs |
module Flatten where
| null | https://raw.githubusercontent.com/godfat/sandbox/eb6294238f92543339adfdfb4ba88586ba0e82b8/haskell/flatten.hs | haskell |
module Flatten where
| |
e31bed92c02318c411b968253a67889e541b9ddab1328673fd53b96892f44b2f | jfacorro/fp-interpreter-in-lisp | parser.lisp | (in-package :com.facorro.parser)
;:--------------------------------------
;; List that contains all parsing rules
;;--------------------------------------
(defparameter *rules* nil)
;;--------------------------------------
;; add-rule
;;--------------------------------------
(defun add-rule (rule)
"Adds a rul... | null | https://raw.githubusercontent.com/jfacorro/fp-interpreter-in-lisp/b0c520593e98cce83b571939a22d7efd7926c711/src/parser.lisp | lisp | :--------------------------------------
List that contains all parsing rules
--------------------------------------
--------------------------------------
add-rule
--------------------------------------
--------------------------------------
apply-all-rules
--------------------------------------
-----------... | (in-package :com.facorro.parser)
(defparameter *rules* nil)
(defun add-rule (rule)
"Adds a rule to the parsing rules list"
(setf *rules* (append *rules* (list rule))))
(defun parse (expr)
"Applies rules in the order they were added and returns the last result"
(unless (stringp expr) (error "PARSE: expr shou... |
da8ae024826bafac31d39170c9450d1370c66f57d3243ae0650a02dc0811b0f3 | metabase/metabase | users.clj | (ns metabase.test.data.users
"Code related to creating / managing fake `Users` for testing purposes."
(:require
[clojure.test :as t]
[medley.core :as m]
[metabase.db.connection :as mdb.connection]
[metabase.http-client :as client]
[metabase.models.interface :as mi]
[metabase.models.permissions-gro... | null | https://raw.githubusercontent.com/metabase/metabase/b1298421ac2d7b157bb3578ac1679a0da6ba8f9f/test/metabase/test/data/users.clj | clojure | ------------------------------------------------ User Definitions ------------------------------------------------
These users have permissions for the Test. They are lazily created as needed.
* rasta
* crowberto - superuser
* lucky
------------------------------------------------- Test User Fns -------------... | (ns metabase.test.data.users
"Code related to creating / managing fake `Users` for testing purposes."
(:require
[clojure.test :as t]
[medley.core :as m]
[metabase.db.connection :as mdb.connection]
[metabase.http-client :as client]
[metabase.models.interface :as mi]
[metabase.models.permissions-gro... |
b13e3b9c21f7bc6294d0fc3c1ebab911a89b73e03d51d3eb3659a678d0a80ee6 | rnons/shadowsocks-haskell | server.hs | {-# LANGUAGE OverloadedStrings #-}
import Conduit (ConduitT, Void, await, connect,
liftIO, ($$+), ($$+-), (.|))
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO)
import Control.Concurr... | null | https://raw.githubusercontent.com/rnons/shadowsocks-haskell/5d73db35e0a9f186b74a9e746ad9c9c6b41fb94d/app/server.hs | haskell | # LANGUAGE OverloadedStrings # |
import Conduit (ConduitT, Void, await, connect,
liftIO, ($$+), ($$+-), (.|))
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO)
import Control.Concurrent.Async (race_)
import ... |
5f4e8381653259f8b54ce1bbf759096e297873aa11c71060d1e2a7cc02bb7f03 | mruegenberg/Hs-Game | Common.hs | # LANGUAGE GADTs , StandaloneDeriving #
-- | Definitions for internal use.
module Math.GameTheory.Internal.Common (
Pos(..)
, yank
) where
import Data.Ix
import Data.List(elemIndex, intercalate)
import TypeLevel.NaturalNumber
data Pos a n where
Pos :: (NaturalNumber n) => [a] -> n -> Pos a n
deriving... | null | https://raw.githubusercontent.com/mruegenberg/Hs-Game/730e964edf49a40e15d953043769ba3308d59280/Math/GameTheory/Internal/Common.hs | haskell | | Definitions for internal use.
FIXME: inefficient | # LANGUAGE GADTs , StandaloneDeriving #
module Math.GameTheory.Internal.Common (
Pos(..)
, yank
) where
import Data.Ix
import Data.List(elemIndex, intercalate)
import TypeLevel.NaturalNumber
data Pos a n where
Pos :: (NaturalNumber n) => [a] -> n -> Pos a n
deriving instance (Eq a, Eq n) => Eq (Pos a... |
e217298c802ac11e2798f639cf4c4156781a1a9ebc63b67ef5d467b34b04c78d | m1kal/charbel | synthesis.cljc | (ns charbel.synthesis
(:require [charbel.expressions :refer [expression from-intermediate]]
[clojure.string :as s]))
(defn signal-width [width]
(if (= width 1) "" (str "[" (from-intermediate width) "-1:0]")))
(defn find-clock [clocks value]
(if (number? value) [(nth clocks value [:clk])] (filter #(=... | null | https://raw.githubusercontent.com/m1kal/charbel/0924a31ed8ff045a5fd3bcbfa45ba6d438be69a9/src/charbel/synthesis.cljc | clojure | (ns charbel.synthesis
(:require [charbel.expressions :refer [expression from-intermediate]]
[clojure.string :as s]))
(defn signal-width [width]
(if (= width 1) "" (str "[" (from-intermediate width) "-1:0]")))
(defn find-clock [clocks value]
(if (number? value) [(nth clocks value [:clk])] (filter #(=... | |
856d4c4fa126b60067984c4b93a5e8fc39f8d0ada317a7f1dbe923c53b246bc9 | weavejester/ataraxy | core.clj | (ns ataraxy.core
"The core Ataraxy namespace. Includes functions for compiling and matching
routes, and for building a Ring handler function."
(:refer-clojure :exclude [compile])
(:require [ataraxy.coerce :as coerce]
[ataraxy.error :as err]
[ataraxy.handler :as handler]
[atar... | null | https://raw.githubusercontent.com/weavejester/ataraxy/3622011ee8254bf8af936714b12e40b0c0666f45/src/ataraxy/core.clj | clojure | (ns ataraxy.core
"The core Ataraxy namespace. Includes functions for compiling and matching
routes, and for building a Ring handler function."
(:refer-clojure :exclude [compile])
(:require [ataraxy.coerce :as coerce]
[ataraxy.error :as err]
[ataraxy.handler :as handler]
[atar... | |
decad33b77eefbe317a432c40526804e345c9be7c78224dd04b073e905bb988b | boomerang-lang/boomerang | language_equivalences.ml | open Stdlib
open Lang
open Normalized_lang
open Permutation
let rec to_dnf_regex (r:Regex.t) : dnf_regex =
let atom_to_dnf_regex (a:atom) : dnf_regex =
[([a],["";""])]
in
begin match r with
| Regex.RegExEmpty -> []
| Regex.RegExBase c -> [([],[c])]
| Regex.RegExConcat (r1,r2) ->
cartesian_map
... | null | https://raw.githubusercontent.com/boomerang-lang/boomerang/b42c2bfc72030bbe5c32752c236c0aad3b17d149/optician/language_equivalences.ml | ocaml | open Stdlib
open Lang
open Normalized_lang
open Permutation
let rec to_dnf_regex (r:Regex.t) : dnf_regex =
let atom_to_dnf_regex (a:atom) : dnf_regex =
[([a],["";""])]
in
begin match r with
| Regex.RegExEmpty -> []
| Regex.RegExBase c -> [([],[c])]
| Regex.RegExConcat (r1,r2) ->
cartesian_map
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.