_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 |
|---|---|---|---|---|---|---|---|---|
9eaf5da4f1cd62fbf9e34e6a97484bcf719fde5c678293c4609e9379a8fec2d1 | Incanus3/ExiL | env-watchers.lisp | (in-package :exil-env)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; WATCHERS
(defun assert-watcher (env watcher)
(cl:assert (or (equalp watcher :all)
(is-watcher env watcher))
() "~A is not a watcher name" watcher))
(defun set-one-watcher (env wa... | null | https://raw.githubusercontent.com/Incanus3/ExiL/de0f7c37538cecb7032cc1f2aa070524b0bc048d/src/environment/env-watchers.lisp | lisp |
WATCHERS
public
public | (in-package :exil-env)
(defun assert-watcher (env watcher)
(cl:assert (or (equalp watcher :all)
(is-watcher env watcher))
() "~A is not a watcher name" watcher))
(defun set-one-watcher (env watcher val undo-label)
(let ((original-value (watched-p env watcher)))
(unless (equal or... |
37ede9461b81009f010a5ade4d50d6ecda916033bdf90b6f4d7080157e986e10 | erikd/wide-word | Word64.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
# LANGUAGE MagicHash #
{-# LANGUAGE StrictData #-}
# LANGUAGE UnboxedTuples #
{-# OPTIONS_GHC -funbox-strict-fields #-}
-----------------------------------------------------------------------------
-- |
Module : Data . WideWord . Word64
--
-- Maintainer :
-- ... | null | https://raw.githubusercontent.com/erikd/wide-word/8c13558e5a3348cbd648fb82197377a34b47d551/src/Data/WideWord/Word64.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE StrictData #
# OPTIONS_GHC -funbox-strict-fields #
---------------------------------------------------------------------------
|
Maintainer :
Stability : experimental
of typeclass instances one would expect for a fixed width unsigned integer
type.
Operations like addit... | # LANGUAGE CPP #
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
Module : Data . WideWord . Word64
Portability : non - portable ( GHC extensions and primops )
This module provides an opaque unsigned 64 bit value with the usual set
" modulo 2 ^ 64 " result as one would expect from a fixed width unsi... |
dafbe413e649167f2f2e30251c9588496a4681f5cafcf1cfcf965f10bbedaff3 | philnguyen/soft-contract | board.rkt | #lang racket
;; ---------------------------------------------------------------------------------------------------
;; a data representation for the board with operations for
;; -- inspecting the board to strategize
;; -- placing tiles on the board to realize a player's action
;; the actions do not enforce the rule... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/gradual-typing-benchmarks/acquire/board.rkt | racket | ---------------------------------------------------------------------------------------------------
a data representation for the board with operations for
-- inspecting the board to strategize
-- placing tiles on the board to realize a player's action
the actions do not enforce the rules of the game only consi... | #lang racket
(provide
(struct-out tile)
tile<=?
tile->string
ALL-TILES
( Listof Tile )
STARTER-TILES#
Natural
FOUNDING GROWING MERGING SINGLETON IMPOSSIBLE
(rename-out [board make-board])
board-tiles
( - > Board ( Listof Tile ) )
(rename-out [ext:what-kind-of-spot what-kind-of-spot])
( defi... |
f3541f86a117a95a3f5a5636dce051eb378510c62159fac2319141054a7d333c | fredokun/arbogen | test_gen_sing.ml | let fail format = Format.kasprintf (fun s -> Alcotest.fail s) format
(* XXX. *)
let rec pp_tree fmt = function
| Tree.Label (typ, children) ->
let pp_sep fmt () = Format.fprintf fmt ",@," in
Format.fprintf fmt "%s[%a]" typ
(Format.pp_print_list ~pp_sep pp_tree)
children
| Tree.Tuple children ->... | null | https://raw.githubusercontent.com/fredokun/arbogen/9663b6e16b8a426a9de5ddcaac9f8211e5b71d42/tests/test_gen_sing.ml | ocaml | XXX.
* Adequation with the uniform distribution at fixed size. | let fail format = Format.kasprintf (fun s -> Alcotest.fail s) format
let rec pp_tree fmt = function
| Tree.Label (typ, children) ->
let pp_sep fmt () = Format.fprintf fmt ",@," in
Format.fprintf fmt "%s[%a]" typ
(Format.pp_print_list ~pp_sep pp_tree)
children
| Tree.Tuple children ->
let pp... |
7dfb2c7a44e886d8b2b3c09664b2e4fa8bf8dea66d9ba932c606eb6734863742 | parapluu/Concuerror | processes.erl | -module(processes).
-export([test1/0, test2/0]).
-export([scenarios/0]).
-concuerror_options_forced([{symbolic_names, false}]).
scenarios() -> [{T, inf, dpor} || T <- [test1, test2]].
test1() ->
Fun = fun() -> ok end,
spawn(Fun),
spawn(Fun),
processes().
test2() ->
Fun = fun() -> ok end,
FF... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/basic_tests/src/processes.erl | erlang | -module(processes).
-export([test1/0, test2/0]).
-export([scenarios/0]).
-concuerror_options_forced([{symbolic_names, false}]).
scenarios() -> [{T, inf, dpor} || T <- [test1, test2]].
test1() ->
Fun = fun() -> ok end,
spawn(Fun),
spawn(Fun),
processes().
test2() ->
Fun = fun() -> ok end,
FF... | |
26b1b7480357f3c260095af633db023ac10e37963e4a2f03e2726c2b1ab050bf | herbelin/coq-hh | term.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/kernel/term.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Prop and Set
* Type
* infer prin... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
* { 6 The sorts ... |
060fad7afd2ec2dfea6b90fee5de7d25b9cae2bfabee818882eb9a98df1fbab1 | phadej/vec | Fin.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyCase #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
# LANGUAGE TypeO... | null | https://raw.githubusercontent.com/phadej/vec/800379bd5144c0c9d9c7ce2a849d9a7fc89b3506/fin/src/Data/Fin.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE EmptyCase #
# LANGUAGE GADTs #
# LANGUAGE KindSignatures #
# LANGUAGE Safe #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
| Finite numbers.
This module is designed to ... | # LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
import Data . Fin ( Fin ( .. ) )
module Data.Fin (
Fin (..),
cata,
explicitShow,
explicitShowsPrec,
toNat,
fromNat,
toNatural,
toInteger,
mirror,
inverse,
universe,
inlineUniverse,
universe1,
i... |
06e0cc703e47a993d090cd76d1e440e60346127f5a92c693bf9589e4afa3d9b4 | shop-planner/shop3 | p03.lisp | (in-package :shop-openstacks)
#.(make-problem 'OS-SEQUENCEDSTRIPS-P5_3 'OPENSTACKS-SEQUENCEDSTRIPS-ADL-INCLUDED '((NEXT-COUNT
N0
N1)
... | null | https://raw.githubusercontent.com/shop-planner/shop3/ba429cf91a575e88f28b7f0e89065de7b4d666a6/shop3/examples/openstacks-adl/p03.lisp | lisp | (in-package :shop-openstacks)
#.(make-problem 'OS-SEQUENCEDSTRIPS-P5_3 'OPENSTACKS-SEQUENCEDSTRIPS-ADL-INCLUDED '((NEXT-COUNT
N0
N1)
... | |
6c55cd9df8d4291f8474dda2041a456402d9e56e557178430b81b2f72d96cf71 | AllAlgorithms/haskell | quicksort.hs | quickSort :: (Ord a) => [a] -> [a]
quickSort [] = []
quickSort [a] = [a]
quickSort (x:xs) = smaller ++ [x] ++ bigger where
bigger = quickSort $ filter (>=x) xs
smaller = quickSort $ filter (<x) xs
| null | https://raw.githubusercontent.com/AllAlgorithms/haskell/66611c3abad036db962d6d299dcb39c18b1b3cf8/algorithms/sorting/quicksort.hs | haskell | quickSort :: (Ord a) => [a] -> [a]
quickSort [] = []
quickSort [a] = [a]
quickSort (x:xs) = smaller ++ [x] ++ bigger where
bigger = quickSort $ filter (>=x) xs
smaller = quickSort $ filter (<x) xs
| |
b42659804809c808ae0c215cd315f41a8c59ed33611601a70c73391f97611b1e | ParaPhraseAGH/erlang-mas | mas.erl | %% @doc This module starts the mas framework with given environment,
%% time and parameters
-module (mas).
-export ([start/3]).
-export_type([agent/0,
agent/1,
sim_params/0,
sim_params/1,
agent_behaviour/0,
agent_behaviour/1]).
-include ("mas.hrl")... | null | https://raw.githubusercontent.com/ParaPhraseAGH/erlang-mas/e53ac7ace59b50696bd5e89a1e710d88213e2b1d/src/utils/mas.erl | erlang | @doc This module starts the mas framework with given environment,
time and parameters |
-module (mas).
-export ([start/3]).
-export_type([agent/0,
agent/1,
sim_params/0,
sim_params/1,
agent_behaviour/0,
agent_behaviour/1]).
-include ("mas.hrl").
-type agent(Any) :: Any.
-type agent() :: agent(any()).
-type sim_params(Any) :: Any.
-t... |
fa33f03c1a7123e3765316ae52f3d52df547e063c1496d8b377ebe9edd9d0701 | CatalaLang/catala | to_python.mli | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2021 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... | null | https://raw.githubusercontent.com/CatalaLang/catala/efdf653ec7af75c6da50a405eaa9c5a9c26402c9/compiler/scalc/to_python.mli | ocaml | * Formats a lambda calculus program into a valid Python program
* Usage [format_program fmt p type_dependencies_ordering] | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2021 , contributor :
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with the License . ... |
30116658d9fbffcf9fec63c208b83ba77027335e27cd566bfb82fc3e2bf27baa | dolotech/erlang_server | tester.erl | %%----------------------------------------------------
性能测试工具
%%----------------------------------------------------
-module(tester).
-compile(export_all).
%% 运行一个测试集
run(N, List) ->
[[L, T1, T2] = H | T] = [timer(Label, F, N) || {Label, F} <- List],
io:format("===============================================... | null | https://raw.githubusercontent.com/dolotech/erlang_server/44ea3693317f60e18b19c9ddfa179307cbd646d7/src/test/tester.erl | erlang | ----------------------------------------------------
----------------------------------------------------
运行一个测试集
并行运行单项测试并计时
运行单项测试并计时
比较结果
运行计时器(并发测试时使用)
for循环
产生随机数
取当前时间戳,单位:毫秒
暂停执行T毫秒 | 性能测试工具
-module(tester).
-compile(export_all).
run(N, List) ->
[[L, T1, T2] = H | T] = [timer(Label, F, N) || {Label, F} <- List],
io:format("========================================================================~n"),
io:format("~-20s = ~9.2fms [~8.2f%] ~9.2fms [~8.2f%]~n", [L, T1 + 0.0, 100.0, T2 + 0.0... |
9e6fe4c6585f41c90fcfd2a95c03401a4a949ec59d115cf32e281a72d1c21721 | input-output-hk/qeditas | secp256k1.mli | Copyright ( c ) 2015 The Qeditas developers
Distributed under the MIT software license , see the accompanying
file COPYING or -license.php .
file COPYING or -license.php. *)
This code for secp256k1 is directly taken from Egal .
(* Code for the Elliptic Curve secp256k1 *)
(* *)
Use the Big_int librar... | null | https://raw.githubusercontent.com/input-output-hk/qeditas/f4871bd20833cd08a215f9d5fc9df2d362cba410/src/secp256k1.mli | ocaml | Code for the Elliptic Curve secp256k1
operations module _p
Intended to be points on the curve y^2 = x^3 + 7
scalar multiplication
base point _g
_n : order of _g | Copyright ( c ) 2015 The Qeditas developers
Distributed under the MIT software license , see the accompanying
file COPYING or -license.php .
file COPYING or -license.php. *)
This code for secp256k1 is directly taken from Egal .
Use the Big_int library for arbitrary - precision integers .
open Big_int... |
355f774ce04b55289ee681b32c97b7d5b48ea38ef4d57e1a8d2a9861c60f3903 | agda/agda | Defs.hs |
-- | Extract used definitions from terms.
module Agda.Syntax.Internal.Defs where
import Control.Monad.Reader
import Control.Monad.Writer
import qualified Data.Foldable as Fold
import Agda.Syntax.Common
import Agda.Syntax.Internal
| @getDefs ' lookup emb a@ extracts all used definitions
-- (functions, data/rec... | null | https://raw.githubusercontent.com/agda/agda/d8ec8dd860b21272cb53747e55000c096db75885/src/full/Agda/Syntax/Internal/Defs.hs | haskell | | Extract used definitions from terms.
(functions, data/record types) from @a@, embedded into a monoid via @emb@.
Instantiations of meta variables are obtained via @lookup@.
Typical monoid instances would be @[QName]@ or @Set QName@.
by mapping to the unit of the monoid.
| What it takes to get the used d... |
module Agda.Syntax.Internal.Defs where
import Control.Monad.Reader
import Control.Monad.Writer
import qualified Data.Foldable as Fold
import Agda.Syntax.Common
import Agda.Syntax.Internal
| @getDefs ' lookup emb a@ extracts all used definitions
Note that @emb@ can also choose to discard a used definition
ge... |
6a0276ec25aafe0746da380a090269ff9b0473c65e466d1137a7ff2b21d7f9b6 | scotthaleen/clojure-spring-cloud | project.clj | (def SPRING-BOOT-VERSION "2.2.5.RELEASE")
(defproject spring-cloud "0.2.0-SNAPSHOT"
:description ""
:dependencies [[org.clojure/clojure "1.10.1"]
[org.springframework.boot/spring-boot-starter-web ~SPRING-BOOT-VERSION
:exclusions [org.springframework.boot/spring-boot-starter-tomca... | null | https://raw.githubusercontent.com/scotthaleen/clojure-spring-cloud/56d874c2cd4af616f9b8e62eccd19cbddd47f2fa/project.clj | clojure | (def SPRING-BOOT-VERSION "2.2.5.RELEASE")
(defproject spring-cloud "0.2.0-SNAPSHOT"
:description ""
:dependencies [[org.clojure/clojure "1.10.1"]
[org.springframework.boot/spring-boot-starter-web ~SPRING-BOOT-VERSION
:exclusions [org.springframework.boot/spring-boot-starter-tomca... | |
232dadaa4fbe0d78db089254a851f1c15887d7cff59f97913f71c809ceae4506 | heroku/snit | snit_test_cert_store.erl | -module(snit_test_cert_store).
-behaviour(gen_server).
%% API
-export([
start/0,
add/2,
delete/1,
update/2,
lookup/1
]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
start() ->
ge... | null | https://raw.githubusercontent.com/heroku/snit/024214a9f56bc3896a7a043e94ec3abeb0426159/test/snit_test_cert_store.erl | erlang | API
gen_server callbacks
===================================================================
gen_server callbacks
=================================================================== | -module(snit_test_cert_store).
-behaviour(gen_server).
-export([
start/0,
add/2,
delete/1,
update/2,
lookup/1
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
start() ->
gen_server:start({local, ?MODULE}... |
f3f268e0fcd3ed3f188cec78355182a86ea7d3196021bc63527e079443f4d806 | CryptoKami/cryptokami-core | Demo.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
-- | Demo for the outbound queue
module Network.Broadcast.Outboun... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/networking/src/Network/Broadcast/OutboundQueue/Demo.hs | haskell | # LANGUAGE ScopedTypeVariables #
| Demo for the outbound queue
------------------------------------------------------------------------------
Demo monads
In order to show that it's possible, we use different monads for enqueueing
and dequeueing.
----------------------------------------------------------------... | # LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Network.Broadcast.OutboundQueue.Demo where
import Control.Concurrent
import ... |
030bb844fefefb7cb79d8ac395a06880a5fc47731a177bfcf9a5b5dd1c284ada | josefs/Gradualizer | case_pattern.erl | -module(case_pattern).
-export([f/2]).
-spec f(integer(), atom()) -> ok.
f(X, Y) ->
case Y of
X -> ok
end.
| null | https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/should_fail/case_pattern.erl | erlang | -module(case_pattern).
-export([f/2]).
-spec f(integer(), atom()) -> ok.
f(X, Y) ->
case Y of
X -> ok
end.
| |
b058535a8a525e6f52b377b55d181d0986765d4307c95882244079ef6d26326e | lukeg101/lplzoo | Parser.hs | |
Module : Parser
Description : for the untyped lambda calculus in Haskell .
Copyright : ( c ) , 2018
License : GPL-3
Maintainer :
Stability : stable
Portability : POSIX
The " Parser " module provides the monadic parser combinators , grammars , and top - level functions needed ... | null | https://raw.githubusercontent.com/lukeg101/lplzoo/48de580b44c2c185609bea4e66a45589d3aa8213/SKI/Parser.hs | haskell | Tool Imports.
| Parser type takes input string and returns a list of possible parses.
| Failure parser.
| Parses an element and returns if they satisfy a predicate.
| Parses chars only.
| Parses a string of chars.
| Parses 0 or more elements.
| Parses 0 or more whitespace.
| Parsers 1 or more whitespace.
| Tr... | |
Module : Parser
Description : for the untyped lambda calculus in Haskell .
Copyright : ( c ) , 2018
License : GPL-3
Maintainer :
Stability : stable
Portability : POSIX
The " Parser " module provides the monadic parser combinators , grammars , and top - level functions needed ... |
4480ea5672392424597a4419d5fda2f9e1e39ef96e27996fbd600a16640bbd2f | shirok/Gauche | nqueen.scm | ;; -*- coding: euc-jp -*-
Nqueen
;; n×n の互いに効き線上にないクイーンの配列をみつける
)
;; This software is public domain.
(define (decr x) (- x 1))
(define (incr x) (+ x 1))
rotate : ベクタ x を pos要素 だけ回転させる
(define (rotate x pos)
(do ((last (decr (vector-length x)))
(x0 (vector-ref x pos))
(i pos (incr i)))
... | null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/examples/nqueen.scm | scheme | -*- coding: euc-jp -*-
n×n の互いに効き線上にないクイーンの配列をみつける
This software is public domain.
genpat: n×n の盤の初期パターンを作る
sample
(display (nqueen 8))(newline)(exit) | Nqueen
)
(define (decr x) (- x 1))
(define (incr x) (+ x 1))
rotate : ベクタ x を pos要素 だけ回転させる
(define (rotate x pos)
(do ((last (decr (vector-length x)))
(x0 (vector-ref x pos))
(i pos (incr i)))
((= i last) (vector-set! x last x0))
(vector-set! x i (vector-ref x (incr i)))))
r... |
4849045137a415a8097fd91da7a966a2277af58e992c49ddc17668e3bd4ed2d5 | clojure-interop/java-jdk | SOAPBinding.clj | (ns javax.xml.ws.soap.SOAPBinding
"The SOAPBinding interface is an abstraction for
the SOAP binding."
(:refer-clojure :only [require comment defn ->])
(:import [javax.xml.ws.soap SOAPBinding]))
(defn get-roles
"Gets the roles played by the SOAP binding instance.
returns: Set<String> The set of roles play... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/ws/soap/SOAPBinding.clj | clojure | (ns javax.xml.ws.soap.SOAPBinding
"The SOAPBinding interface is an abstraction for
the SOAP binding."
(:refer-clojure :only [require comment defn ->])
(:import [javax.xml.ws.soap SOAPBinding]))
(defn get-roles
"Gets the roles played by the SOAP binding instance.
returns: Set<String> The set of roles play... | |
626001a03833ed28813b00d368cc06215ac3735925fa4d3e0996ac515808e8dc | geneweb/geneweb | bench.ml | open Geneweb
let style = ref Benchmark.Auto
let test_fn =
try
let l = String.split_on_char ',' @@ Sys.getenv "BENCH_FN" in
fun s -> List.mem s l
with Not_found -> fun _ -> true
let bench ?(t = 1) name fn arg =
if test_fn name then (
Gc.compact ();
Benchmark.throughput1 ~style:!style ~name t (Li... | null | https://raw.githubusercontent.com/geneweb/geneweb/7b71f8f2f75e0e847818f821a0267938f38c9cf5/benchmark/bench.ml | ocaml | open Geneweb
let style = ref Benchmark.Auto
let test_fn =
try
let l = String.split_on_char ',' @@ Sys.getenv "BENCH_FN" in
fun s -> List.mem s l
with Not_found -> fun _ -> true
let bench ?(t = 1) name fn arg =
if test_fn name then (
Gc.compact ();
Benchmark.throughput1 ~style:!style ~name t (Li... | |
c545c915aa01ff330f2400ee1d8b7ae63bf31edb71e13965771b6fca6fd4cbcc | PacktWorkshops/The-Clojure-Workshop | repl.clj | (clojure.core/refer 'clojure.test :only '(are deftest is run-tests testing))
(def three-numbers-array (java.util.ArrayList. [0 1 2]))
(defn array-list-getter [array index]
(.get array index))
(deftest array-list-getter-test
(testing "Getting valid elements"
(are [expected actual] (= ... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter09/tests/Exercise9.10/repl.clj | clojure | (clojure.core/refer 'clojure.test :only '(are deftest is run-tests testing))
(def three-numbers-array (java.util.ArrayList. [0 1 2]))
(defn array-list-getter [array index]
(.get array index))
(deftest array-list-getter-test
(testing "Getting valid elements"
(are [expected actual] (= ... | |
ca9a71d5ae906ff5f17671c718068a0f02641928bde9314a31f8d2da759a67b4 | tpine/.stumpwm.d | init.lisp | ;;; Swap Caps with Ctrl
(run-shell-command "~/fix-screens.sh")
(setq *startup-message* (format nil "Welcome Thomas!~%Slynk is on port 4004~%Happy Hacking!"))
(load "~/.stumpwm.d/visual.lisp")
(load "~/.stumpwm.d/keybindings.lisp")
has some issues with non reparenting window managers
While we could set _ JAVA_AWT... | null | https://raw.githubusercontent.com/tpine/.stumpwm.d/7c26a095400165b4bea9d9c78d77b0932563ea84/init.lisp | lisp | Swap Caps with Ctrl
I find that funnier | (run-shell-command "~/fix-screens.sh")
(setq *startup-message* (format nil "Welcome Thomas!~%Slynk is on port 4004~%Happy Hacking!"))
(load "~/.stumpwm.d/visual.lisp")
(load "~/.stumpwm.d/keybindings.lisp")
has some issues with non reparenting window managers
While we could set _ JAVA_AWT_WM_NONREPARENTING=1 let... |
39e9afb820c3b413fc81c4248f166c205e0373a6b0f148ec7bf89bbb362bd840 | jackfirth/lens | ref.rkt | #lang racket/base
(require racket/contract
fancy-app
lens/private/base/main
"../util/immutable.rkt")
(module+ test
(require rackunit lens/private/test-util/test-lens))
(provide
(contract-out
[vector-ref-lens (-> exact-nonnegative-integer?
(lens/c immutable-vecto... | null | https://raw.githubusercontent.com/jackfirth/lens/733db7744921409b69ddc78ae5b23ffaa6b91e37/lens-data/lens/private/vector/ref.rkt | racket | #lang racket/base
(require racket/contract
fancy-app
lens/private/base/main
"../util/immutable.rkt")
(module+ test
(require rackunit lens/private/test-util/test-lens))
(provide
(contract-out
[vector-ref-lens (-> exact-nonnegative-integer?
(lens/c immutable-vecto... | |
efc8912a49361e7aed8a84b99cec952b3c51cb3926325143f59861d73100bd76 | Factual/skuld | level.clj | (ns skuld.db.level
(:import (java.io Closeable)
(com.aphyr.skuld Bytes))
(:require [clj-leveldb :as level]
[skuld.task :as task]
[skuld.util :refer [fress-read fress-write]])
(:use skuld.db
clojure.tools.logging))
(defrecord Level [level count-cache running]
DB
(ids... | null | https://raw.githubusercontent.com/Factual/skuld/79599f9b13aee35c680183d6bf9e2fcbfde1d7c7/src/skuld/db/level.clj | clojure | We enqueued something new! | (ns skuld.db.level
(:import (java.io Closeable)
(com.aphyr.skuld Bytes))
(:require [clj-leveldb :as level]
[skuld.task :as task]
[skuld.util :refer [fress-read fress-write]])
(:use skuld.db
clojure.tools.logging))
(defrecord Level [level count-cache running]
DB
(ids... |
5e07362fed4da4199566c61eae4a3ea70313bbe833919d5b5f4cd1895cd7dede | kind2-mc/kind2 | ufSymbol.ml | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... | null | https://raw.githubusercontent.com/kind2-mc/kind2/1d7e926da46aa38c0816fb0a327b0e33a8d35cde/src/terms/ufSymbol.ml | ocaml | *********************************************************************
Types and hash-consing
*********************************************************************
A private type that cannot be constructed outside this module
This is necessary to ensure the invar... | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... |
20b0ad507e55e84943347a96f13e8759caa052220dce6eec65622ff729c0c5f8 | otto-de/goo | goo_test.clj | (ns de.otto.goo.goo-test
(:require [clojure.test :refer :all]
[de.otto.goo.goo :as metrics]
[iapetos.core :as p]
[clojure.tools.logging :as log]
[clojure.string :as str])
(:import (io.prometheus.client Collector$MetricFamilySamples$Sample)))
(use-fixtures :each #(do ... | null | https://raw.githubusercontent.com/otto-de/goo/9b9b3f906701c96617b348a3b0ea95557f90f3d4/test/de/otto/goo/goo_test.clj | clojure | (ns de.otto.goo.goo-test
(:require [clojure.test :refer :all]
[de.otto.goo.goo :as metrics]
[iapetos.core :as p]
[clojure.tools.logging :as log]
[clojure.string :as str])
(:import (io.prometheus.client Collector$MetricFamilySamples$Sample)))
(use-fixtures :each #(do ... | |
14337a0d44b0e21aaefb31e6d215fb097a2d2847d6b0cc584b1f20b9ef71c953 | audreyt/openafp | RLI.hs | module OpenAFP.Records.T.RLI where
import OpenAFP.Types
import OpenAFP.Internals
data T_RLI = T_RLI {
t_rli_Type :: !N1
,t_rli_SubType :: !N1
,t_rli :: !N1
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/T/RLI.hs | haskell | module OpenAFP.Records.T.RLI where
import OpenAFP.Types
import OpenAFP.Internals
data T_RLI = T_RLI {
t_rli_Type :: !N1
,t_rli_SubType :: !N1
,t_rli :: !N1
} deriving (Show, Typeable)
| |
a67577905d3f497cd0ee4ef96afac50ffc7036b19f514236a468d197b79a8c2b | mtolly/onyxite-customs | Lipsync.hs | {-# LANGUAGE DeriveFunctor #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Onyx.MIDI.Track.Lipsync where
import ... | null | https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/MIDI/Track/Lipsync.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE OverloadedStrings #
^ hold this weight until its next event | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Onyx.MIDI.Track.Lipsync where
import Control.Monad.Codec
import qualified Data.EventList.Relative.TimeBod... |
d0de25fe69284acdd1f0e8818e3a4627d2cc6aaee9d9b89fa47e103938402bc2 | abdulapopoola/SICPBook | Ex3.50.scm | #lang planet neil/sicp
(define (stream-map proc . argstreams)
(if (stream-null? (car argstreams))
the-empty-stream
(stream-cons
(apply proc (map stream-car argstreams))
(apply stream-map
(cons proc
(map stream-cdr
argstreams))))))... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%203/3.5/Ex3.50.scm | scheme | #lang planet neil/sicp
(define (stream-map proc . argstreams)
(if (stream-null? (car argstreams))
the-empty-stream
(stream-cons
(apply proc (map stream-car argstreams))
(apply stream-map
(cons proc
(map stream-cdr
argstreams))))))... | |
279cf69fb30c8949e2a93ee29df1d8830d24da88d8f383c8562f5a077b326954 | ndmitchell/hoogle | Reorder.hs | {-# LANGUAGE RecordWildCards, OverloadedStrings #-}
module Input.Reorder(reorderItems) where
import Input.Item
import Input.Settings
import Data.List.Extra
import Data.Tuple.Extra
import General.Util
import General.Str
pkgGhc :: PkgName
pkgGhc = strPack "ghc"
packageOrderHacks :: (PkgName -> Int) -> PkgName -> Int... | null | https://raw.githubusercontent.com/ndmitchell/hoogle/25b2872929e3fccd5bbcdef026cec63ce365647e/src/Input/Reorder.hs | haskell | # LANGUAGE RecordWildCards, OverloadedStrings # |
module Input.Reorder(reorderItems) where
import Input.Item
import Input.Settings
import Data.List.Extra
import Data.Tuple.Extra
import General.Util
import General.Str
pkgGhc :: PkgName
pkgGhc = strPack "ghc"
packageOrderHacks :: (PkgName -> Int) -> PkgName -> Int
' ghc ' is the canonical module that both ' ghc -... |
2e5daa917a1abfde67c57e9fe7f5436f387064a72ad4498717fd9364e73643d7 | sneerteam/sneer | http_server.clj | (ns sneer.server.http-server
(:require [org.httpkit.server :as http]
[compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.params :as params]
[clojure.core.async :as async :refer [go <! >! >!! alt!]]
[clojure.core.match :refer [match]]
... | null | https://raw.githubusercontent.com/sneerteam/sneer/b093c46321a5a42ae9418df427dbb237489b7bcb/server/src/sneer/server/http_server.clj | clojure | for REPL usage
(async/go
(notify (keys/->puk "foo"))
(stop) | (ns sneer.server.http-server
(:require [org.httpkit.server :as http]
[compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.params :as params]
[clojure.core.async :as async :refer [go <! >! >!! alt!]]
[clojure.core.match :refer [match]]
... |
a0a0684b3bef1faafe9a6066d58cf664691b30a1b9fdd5fda73120d7103b3404 | silviucpp/eredis_pool | erp_config_parser.erl | -module(erp_config_parser).
-include("eredis_pool.hrl").
-define(CACHED_CONFIG_MODULE, erp_cached_config).
-export([
create_pools/1
]).
create_pools(Pools) ->
Fun = fun({PoolName, PoolArgs}, Acc) ->
PoolNameBin = atom_to_binary(PoolName, latin1),
Shards = get_shards(erp_utils:lookup(shards, ... | null | https://raw.githubusercontent.com/silviucpp/eredis_pool/9b6fd1ffccc7f3a3f40af16a412dcf2d7a16800d/src/erp_config_parser.erl | erlang | create pool for each node in each shard
internals | -module(erp_config_parser).
-include("eredis_pool.hrl").
-define(CACHED_CONFIG_MODULE, erp_cached_config).
-export([
create_pools/1
]).
create_pools(Pools) ->
Fun = fun({PoolName, PoolArgs}, Acc) ->
PoolNameBin = atom_to_binary(PoolName, latin1),
Shards = get_shards(erp_utils:lookup(shards, ... |
af5b3ed713e177d153dd49eb845cb8f82d203d29aed9c21573d302faae6fa171 | bjorng/wings | wings_theme.erl | %%
%% wings_theme.erl --
%%
%% Canned themes for the interface.
%%
Copyright ( c ) 2010 - 2011
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%
%%
-module(wings_theme).
-export([menu/0, native_theme/0,
legacy_colors... | null | https://raw.githubusercontent.com/bjorng/wings/1e2c2d62e93a98c263b167c7a41f8611e0ff08cd/src/wings_theme.erl | erlang |
wings_theme.erl --
Canned themes for the interface.
See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Use system color where possible (and working)
Need to differ from c3dface if no borders is drawn
Since the splitter see... | Copyright ( c ) 2010 - 2011
-module(wings_theme).
-export([menu/0, native_theme/0,
legacy_colors/0,
grey_blue_theme/0,olive_theme/0,dark_blue_theme/0]).
-export([sys_colors/0]).
-include("wings.hrl").
menu() ->
Help = ?__(7,"Change color scheme"),
{?__(1,"Themes"),
{theme,
[{?__(10,"Nati... |
c04c25e47788e28e33b3043bb2932f302932b128e2b12c8b03351509306531f1 | haskell-repa/repa | Gang.hs | # LANGUAGE CPP #
-- | Gang Primitives.
module Data.Array.Repa.Eval.Gang
( theGang
, Gang, forkGang, gangSize, gangIO, gangST)
where
import GHC.IO
import GHC.ST
import GHC.Conc (forkOn)
import Control.Concurrent.MVar
import Control.Exception (assert)
import Control.Monad
impo... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa/Data/Array/Repa/Eval/Gang.hs | haskell | | Gang Primitives.
TheGang --------------------------------------------------------------------
| This globally shared gang is auto-initialised at startup and shared by all
In a data parallel setting, it does not help to have multiple gangs
running at the same time. This is because a single data parallel
c... | # LANGUAGE CPP #
module Data.Array.Repa.Eval.Gang
( theGang
, Gang, forkGang, gangSize, gangIO, gangST)
where
import GHC.IO
import GHC.ST
import GHC.Conc (forkOn)
import Control.Concurrent.MVar
import Control.Exception (assert)
import Control.Monad
import GHC.Conc ... |
c37745d579b4293b8afdd8118fe7d56158a34e87ec761621afc3eb1f2cf1fc7f | nikita-volkov/rebase | QSemN.hs | module Rebase.Control.Concurrent.QSemN
(
module Control.Concurrent.QSemN
)
where
import Control.Concurrent.QSemN
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Control/Concurrent/QSemN.hs | haskell | module Rebase.Control.Concurrent.QSemN
(
module Control.Concurrent.QSemN
)
where
import Control.Concurrent.QSemN
| |
550b1110e2c049d7751f3658d1bc0976669b5a448cd9c927db0b4bef5f78b430 | jeroanan/rkt-coreutils | uniq.rkt | #lang s-exp "util/program/line-by-line-processor-program.rkt"
Copyright 2020
;; See COPYING for licence
(require "../util/stringutil.rkt")
Uniq -- display unique consecutive lines in the provided file
(define help-text
(list"Display uniq lines in FILE"
"(execute FILE) -- Display uniq lines in FILE"))
(... | null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/repl/uniq.rkt | racket | See COPYING for licence | #lang s-exp "util/program/line-by-line-processor-program.rkt"
Copyright 2020
(require "../util/stringutil.rkt")
Uniq -- display unique consecutive lines in the provided file
(define help-text
(list"Display uniq lines in FILE"
"(execute FILE) -- Display uniq lines in FILE"))
(line-by-line-processor uniq... |
c3571ecfb4d3202bb9ae40d521a076ce3074e5f454b70ae2f4aa898dd1169b04 | jbracker/supermonad | Utility.hs |
module Utility
( stm
, trim
, isValidUserName
) where
import Data.Char ( isSpace, isAscii, isAlpha, isNumber )
import Data.List ( dropWhileEnd )
import Control.Concurrent.STM
( STM, atomically )
import Control.Concurrent.SimpleSession.Implicit
( Session, io )
| Execute an atomic portion of ' STM ... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/session-chat/supermonad/Utility.hs | haskell | | Remove whitespaces from beginning and end of string.
| Check if the given username is valid. |
module Utility
( stm
, trim
, isValidUserName
) where
import Data.Char ( isSpace, isAscii, isAlpha, isNumber )
import Data.List ( dropWhileEnd )
import Control.Concurrent.STM
( STM, atomically )
import Control.Concurrent.SimpleSession.Implicit
( Session, io )
| Execute an atomic portion of ' STM ... |
117c7319ab0041ddd2cde1e37afbcb064b386665e49925eaaea636799c567fb4 | spawnfest/eep49ers | ssl_sni_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2015 - 2020 . 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 License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/ssl/test/ssl_sni_SUITE.erl | erlang |
%CopyrightBegin%
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 or implied.
See the License for the specific lan... | Copyright Ericsson AB 2015 - 2020 . 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(ssl_sni_SUITE).
-behaviour(ct_suite).
-include_lib("common_test/include/ct.hrl").
-include_lib("public_key... |
e3baee04a0a74f35eeb6d1031856b6bdfa06ead07136afcc2bb5619c54efc9d2 | aws-beam/aws-erlang | aws_pinpoint.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc Doc Engage API - Amazon Pinpoint API
-module(aws_pinpoint).
-export([create_app/2,
create_app/3,
create_campaign/3,
create_campaign/4,
create_email_template/3,
create_email_tem... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_pinpoint.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc Doc Engage API - Amazon Pinpoint API
====================================================================
API
====================================================================
@doc Creates an application.
@doc Creates a new campaign for an application or updates t... | See -beam/aws-codegen for more details .
-module(aws_pinpoint).
-export([create_app/2,
create_app/3,
create_campaign/3,
create_campaign/4,
create_email_template/3,
create_email_template/4,
create_export_job/3,
create_export_job/4,
create_import... |
2d3f8d182a59d190d5b3c7b25a0a1fc90a94723b1f3a65dbdea3b2aba6b98711 | ashinn/chibi-scheme | totient-impl.scm | (define (totient n)
(let ((limit (exact (ceiling (sqrt n)))))
(let lp ((i 2) (count 1))
(cond ((> i limit)
(if (= count (- i 1))
(- n 1) ; shortcut for prime
(let lp ((i i) (count count))
(cond ((>= i n) count)
... | null | https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/tests/snow/repo3/totient-impl.scm | scheme | shortcut for prime | (define (totient n)
(let ((limit (exact (ceiling (sqrt n)))))
(let lp ((i 2) (count 1))
(cond ((> i limit)
(if (= count (- i 1))
(let lp ((i i) (count count))
(cond ((>= i n) count)
((= 1 (gcd n i)) (lp (+ i 1) (+ count 1)))
... |
a669da596f0d3e1fed77499b157fd20bcd9b049bca379c0bfe4ed6f2423c499e | freizl/dive-into-haskell | Main.hs | module Main where
main :: IO ()
main = print "abc"
| null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/pearls-of-FP/app/Main.hs | haskell | module Main where
main :: IO ()
main = print "abc"
| |
c1a8652e046c7fc8531511a0404431cd773ce3253ee5b7e4f585f0635b4753c6 | RuiL1904/Block-Knight-LI1 | Tarefa1_2021li1g033_Spec.hs | module Tarefa1_2021li1g033_Spec where
import Test.HUnit
import LI12122
import Tarefa1_2021li1g033
import Fixtures
testsT1 =
test
[ "Tarefa 1 - Teste Valida Mapa m1" ~: validaPotencialMapa m1 ~=? True
, "Tarefa 1 - Teste Valida Mapa vazio" ~: validaPotencialMapa [] ~=? False
, "Tarefa 1 - Teste Valida Ma... | null | https://raw.githubusercontent.com/RuiL1904/Block-Knight-LI1/84330a7691b407189771e53a4cd543fdb592bc2b/tests/Tarefa1_2021li1g033_Spec.hs | haskell | module Tarefa1_2021li1g033_Spec where
import Test.HUnit
import LI12122
import Tarefa1_2021li1g033
import Fixtures
testsT1 =
test
[ "Tarefa 1 - Teste Valida Mapa m1" ~: validaPotencialMapa m1 ~=? True
, "Tarefa 1 - Teste Valida Mapa vazio" ~: validaPotencialMapa [] ~=? False
, "Tarefa 1 - Teste Valida Ma... | |
f8047dd5533b302d4751e8e0228876c2605e34716a0228040bc32e95e4471f22 | synduce/Synduce | mss.ml | * @synduce -s 2 -NB
type 'a clist =
| CNil
| Single of 'a
| Concat of 'a clist * 'a clist
type 'a list =
| Nil
| Cons of 'a * 'a list
let rec f = function
| Nil -> 0, 0, 0, 0
| Cons (hd, tl) ->
let sum, mts, mps, mss = f tl in
sum + hd, max mts (sum + hd), max (mps + hd) 0, max mss (max (mps + ... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/list/mss.ml | ocaml | * @synduce -s 2 -NB
type 'a clist =
| CNil
| Single of 'a
| Concat of 'a clist * 'a clist
type 'a list =
| Nil
| Cons of 'a * 'a list
let rec f = function
| Nil -> 0, 0, 0, 0
| Cons (hd, tl) ->
let sum, mts, mps, mss = f tl in
sum + hd, max mts (sum + hd), max (mps + hd) 0, max mss (max (mps + ... | |
42698941f2dcc39c2ee4f6109f420bfcf1504a1f114b37a527cf2fe177c808fd | falsetru/htdp | 16.3.4-extra.scm | (load "16.3.1.scm")
( define ( find name )
; (cond [(memq name (map file-name (dir-files dir)))
( list ( dir - name ) ) ]
[ ( find - in - dirs ( dir - dirs dir ) name )
( cons ( dir - name ) ( find - in - dirs ( dir - dirs dir ) name ) ) ]
; [else false]))
;
;(define (find-in-di... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/16/16.3.4-extra.scm | scheme | (cond [(memq name (map file-name (dir-files dir)))
[else false]))
(define (find-in-dirs dirs name) | (load "16.3.1.scm")
( define ( find name )
( list ( dir - name ) ) ]
[ ( find - in - dirs ( dir - dirs dir ) name )
( cons ( dir - name ) ( find - in - dirs ( dir - dirs dir ) name ) ) ]
( foldr ( lambda ( a b ) ( or a b ) ) false ( map ( lambda ( dir ) ( find name ) ) dirs ) ) )
(... |
a0c94af388e63fac7ac6729bc7eb43adcd822c008a6723a101fcbb9a3eb427a8 | kelamg/HtDP2e-workthrough | ex425.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex425) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Generative-Recursion/ex425.rkt | racket | about the language level of this file in a form that our tools can easily process.
[List-of Number] -> [List-of Number]
produces a sorted version of alon
assume the numbers are all distinct
[List-of Number] Number -> [List-of Number]
produces all the numbers in alon larger than n
[List-of Number] Number -> [List... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex425) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(check-expect
(quick-sort< (list 11 9 2 18 12 14 4 1)... |
dd7c29628e60777bb7f5f7c4a37b1a0342b6d405f71640a934e37326af178da9 | RichiH/git-annex | Init.hs | git - annex repository initialization
-
- Copyright 2011 - 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
# LANGUAGE CPP #
module Annex.Init (
ensureInitialized,
isInitialized,
initia... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Annex/Init.hs | haskell | Has to come before any commits are made as the shared
- clone heuristic expects no local objects.
Everything except for uuid setup, shared clone setup, and initial
description.
Handle case where this repo was cloned from a
direct mode repo
Will automatically initialize if there is already a git-annex
- branch... | git - annex repository initialization
-
- Copyright 2011 - 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
# LANGUAGE CPP #
module Annex.Init (
ensureInitialized,
isInitialized,
initia... |
0f44e2c8bf4b8300b84e4837cb11c32e06cb861e13adb0e893630251ac3f4ead | CRogers/obc | inicheck.ml |
* inicheck.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistribution... | null | https://raw.githubusercontent.com/CRogers/obc/49064db244e0c9d2ec2a83420c8d0ee917b54196/compiler/inicheck.ml | ocaml | a finite set
universal set
Complain only about local, scalar variables -- and only once
Loop over the arms, keeping i = iniset after evaluation of
the chain of guards, j = iniset after execution of any loop
body |
* inicheck.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistribution... |
d7e81a18f606d605862138b4f0f1adc06160dbc7759e70435104a17b1651be47 | vlstill/hsExprTest | GenCurry.hs | module Data.Tuple.TH.GenCurry ( curryN, uncurryN, genCurries, genUncurries ) where
( c ) 2018
import Control.Monad
import Language.Haskell.TH
import Test.Expr.Internal.Compat
-- | For each n >= 0 build a generalization of curry function of given arity
curryN :: Int -> Q Exp
curryN n = do
-- get names for fun... | null | https://raw.githubusercontent.com/vlstill/hsExprTest/0c7754979cf837d48f5740674639e2decb96e547/testlib/Data/Tuple/TH/GenCurry.hs | haskell | | For each n >= 0 build a generalization of curry function of given arity
get names for function arguments
build function patterns
build tuple expression
generate the actual curryN as a lambda
| For each n >= 0 build a generalization of uncurry function of given arity | module Data.Tuple.TH.GenCurry ( curryN, uncurryN, genCurries, genUncurries ) where
( c ) 2018
import Control.Monad
import Language.Haskell.TH
import Test.Expr.Internal.Compat
curryN :: Int -> Q Exp
curryN n = do
f <- newName "f"
xs <- replicateM n (newName "x")
uncurryN :: Int -> Q Exp
uncurryN n = do
... |
5ad579a226cee988a5f19b9227a79b3a11d97d7675b7c89047f56a2f411d63f8 | serioga/webapp-clojure-2020 | app_reload.clj | (ns dev.env.reload.app-reload
(:require [clojure.main :as main]
[clojure.string :as string]
[lib.clojure-tools-logging.logger :as logger]
[lib.clojure.core :as c]
[ns-tracker.core :as ns-tracker])
(:import (java.io FileNotFoundException)))
(set! *warn-on-reflection* ... | null | https://raw.githubusercontent.com/serioga/webapp-clojure-2020/215c4419564c65cb69565774758b4912cafac6e6/dev/dev/env/reload/app_reload.clj | clojure | Reload can fail due to the incorrect order of namespaces.
So we reload multiple times recursively while this reduces amount of failed namespaces. | (ns dev.env.reload.app-reload
(:require [clojure.main :as main]
[clojure.string :as string]
[lib.clojure-tools-logging.logger :as logger]
[lib.clojure.core :as c]
[ns-tracker.core :as ns-tracker])
(:import (java.io FileNotFoundException)))
(set! *warn-on-reflection* ... |
a84313a9818ee16056168ec533feb5137faf1ee48b6fe3c3af5fe4b24a254f00 | borgeby/jarl | base64_test.cljc | (ns jarl.encoding.base64-test
(:require #?(:clj [clojure.test :refer [deftest testing is]]
:cljs [cljs.test :refer [deftest testing is]])
[jarl.encoding.base64 :as base64]))
(deftest base64?-test
(testing "base64?"
(is (= (base64/base64? "abc") false))
(is (= (base64/base64... | null | https://raw.githubusercontent.com/borgeby/jarl/2659afc6c72afb961cb1e98b779beb2b0b5d79c6/core/src/test/cljc/jarl/encoding/base64_test.cljc | clojure | (ns jarl.encoding.base64-test
(:require #?(:clj [clojure.test :refer [deftest testing is]]
:cljs [cljs.test :refer [deftest testing is]])
[jarl.encoding.base64 :as base64]))
(deftest base64?-test
(testing "base64?"
(is (= (base64/base64? "abc") false))
(is (= (base64/base64... | |
329d6536f58883245cd20323333a60b58fe7af49683ab9f1a5ab5a5877cea97b | dalaing/little-languages | TermF.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
module TermF where
import Control.Monad (ap)
import Bound
import Bound.Name
import Bound.Scope
import Prelude.Extras
data TermF n f a =
Var a
| Lam (Sc... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/prototypes/frag/src/TermF.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE TypeSynonymInstances #
Lam e > > = g = ( e > > > = g )
Lam e >>= g = Lam (e >>>= g)
newtype Mu f a = In { out :: f (Mu f) a }
type Term n = Mu (TermF n)
type LocTerm l n = Ann l (TermF n) | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
# LANGUAGE FlexibleInstances #
module TermF where
import Control.Monad (ap)
import Bound
import Bound.Name
import Bound.Scope
import Prelude.Extras
data TermF n f a =
Var a
| Lam (Scope (Name n ()) f a)
| App (f a) (f a)
| TmInt Int
| TmBool Bool
... |
5986eac552da9a4a287061b870d106e785ef1c07ad6d6ac28a65e67c03fc92cb | bluddy/rails | trackmap.ml | open Containers
(* This map contains independent tiles of track *)
type t = {
map: (int, Track.t) Utils.Hashtbl.t;
width: int;
height: int;
} [@@deriving yojson]
let empty width height =
let map = Hashtbl.create 100 in
{map; width; height}
let get v x y = Hashtbl.find_opt v.map (Utils.calc_offset v.width ... | null | https://raw.githubusercontent.com/bluddy/rails/1ebd554f38226567dff89f78caa22b0f9c9fd568/bin/backend/trackmap.ml | ocaml | This map contains independent tiles of track
Common function for moving by dir
Check that we changed something
Do we build new track
Check that a stretch of track is clear: tunnel or bridge
No track can be in the middle, but it's ok if track is at the end
Length: includes middle stretch + last piece
... | open Containers
type t = {
map: (int, Track.t) Utils.Hashtbl.t;
width: int;
height: int;
} [@@deriving yojson]
let empty width height =
let map = Hashtbl.create 100 in
{map; width; height}
let get v x y = Hashtbl.find_opt v.map (Utils.calc_offset v.width x y)
let get_exn v x y = Hashtbl.find v.map (Utils... |
ab65239591f1a7289c4e06cf19da54180d2acb6c212d07a0758b6df5bdabbc65 | Kappa-Dev/KappaTools | list_util.ml | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/dataStructures/list_util.ml | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
let remove_suffix_after_last_occurrence p list =
let rec aux list buffer output =
match list with
| h::t when p h -> aux t [] ((h::buffer)::output)
| h::t -> aux t (h::buffer) output
| [] -> output in
let rev_concat lis... |
cc73daa22f33c0dc12932a49889e393482e8f3afc97364c86dbf3e2bdc9103e9 | NetComposer/nkpacket | nkpacket_transport_udp.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the... | null | https://raw.githubusercontent.com/NetComposer/nkpacket/4d74ab31b20ba7a1449f1f72c1c51829f18d2d5c/src/nkpacket_transport_udp.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2019 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@private UDP Transport Mod... |
b3526260ce805a5c009b640c2e6f1286bedc341e40d24427dab6655456d33531 | CUTE-Lang/miniCUTE | State.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
-- ... | null | https://raw.githubusercontent.com/CUTE-Lang/miniCUTE/b6c8a48b10e2af0786a50175d57b5339be7be2de/main-packages/g-machine-interpreter/lib/Minicute/Data/GMachine/State.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
|
License: BSD 3-Clause
# INLINE _di #
# INLINE findGarbageCollectionRoots #
# INLINE popAddrsFromAddressStack #
|
for pretty printing
# INLINE prettyGMS #
# INLINE prettyGMS #
# INLINE glMap #
# INLINE prettyGMS #
# INLINE nhMap... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2018 - present
module Minicute.Data.GMachine.State
( GMachineState
, buildI... |
0177383faf1f41414b2c135017bca3c985717327a3efa0cc77b9d0ec8a28c6ac | ryukzak/nitta | Analysis.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE TypeFamilies #
|
Module : NITTA.Intermediate . Analysis
Description : Analysis of the process execution flow
Copyright : ( c ) , 2022
License : :
Stability : experimental
Much of the work in this module focuses on building waves of pro... | null | https://raw.githubusercontent.com/ryukzak/nitta/1e1e571fd73b2cb9bea4e5781bf658e7edd264c0/src/NITTA/Intermediate/Analysis.hs | haskell | # LANGUAGE ConstraintKinds #
^ Functions that can be executed at this wave
^ Set of output variables related to the functions from this step
^ Functions that can be calculated due to lack of ready input values
^ Variables that defined at the beginning of the process
^ Variables that is ready to be used us inputs
... | # LANGUAGE TypeFamilies #
|
Module : NITTA.Intermediate . Analysis
Description : Analysis of the process execution flow
Copyright : ( c ) , 2022
License : :
Stability : experimental
Much of the work in this module focuses on building waves of process execution .
In this case ,... |
0d82a313ecc534942b7926719615b71fdb8f5b92fece46361bf17bb76bb8bfe3 | polytypic/rea-ml | Util.ml | let ( >>> ) f g x = g (f x)
let ok a = `Ok a
let error e = `Error e
let flip = Fun.flip
let id = Fun.id
let const = Fun.const
| null | https://raw.githubusercontent.com/polytypic/rea-ml/8dca8f840bc1f4095785c51b3ab13a34f6b17044/src/main/Rea/Util.ml | ocaml | let ( >>> ) f g x = g (f x)
let ok a = `Ok a
let error e = `Error e
let flip = Fun.flip
let id = Fun.id
let const = Fun.const
| |
0fbb67d325abc0ba4a7b0e6fe80405a9a0eb1d2e11209d86df78d1ed87fd500a | yrashk/erlang | reltool_target.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public Lic... | null | https://raw.githubusercontent.com/yrashk/erlang/e1282325ed75e52a98d58f5bd9fb0fa27896173f/lib/reltool/src/reltool_target.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(reltool_target).
-export([
gen_... |
c0f82749c0b897a471c435bcea14d4b3fee5fa613de076d7c78fdc339e6a95b5 | eait-itig/rdp_proto | rdpserv_example.erl | %%
%% rdpproxy
%% remote desktop proxy
%%
Copyright 2022 < >
The University of Queensland
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
1 . Redistributions of source code must re... | null | https://raw.githubusercontent.com/eait-itig/rdp_proto/f096dc9625f328ef71c5ba23521bb8e645723b70/src/rdpserv_example.erl | erlang |
rdpproxy
remote desktop proxy
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the followi... | Copyright 2022 < >
The University of Queensland
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENT... |
a22a644e66b7a71d3c7fd25e9d1b8d695c9b858e83e36c057875b517566641c4 | basho/riak_api | riak_api_basic_pb_service.erl | %% -------------------------------------------------------------------
%%
%% riak_api_basic_pb_service: Simple cluster health service
%%
Copyright ( c ) 2012 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use t... | null | https://raw.githubusercontent.com/basho/riak_api/41f4b72d6a946c710e1523fd69b5b8deb5b57153/src/riak_api_basic_pb_service.erl | erlang | -------------------------------------------------------------------
riak_api_basic_pb_service: Simple cluster health service
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See... | Copyright ( c ) 2012 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@doc ... |
aec7b4345f2d94efc8bbcadc449de0e5a3873e2e9f7ea144657b67ff3028ff4a | goderich/aoc2020 | day14.rkt | #lang racket
;; As usual, my solution includes liberal amounts of threading macros.
(require threading)
;; Part 1
;;
We first define a struct to hold the values of mem lines .
(struct mem (address value))
;; This is a helper function that parses a line like mem[x] = y, and
;; returns a mem struct.
(define (read-nu... | null | https://raw.githubusercontent.com/goderich/aoc2020/96db9aab107e1f4a594319f38a9a309591bd331e/day14.rkt | racket | As usual, my solution includes liberal amounts of threading macros.
Part 1
This is a helper function that parses a line like mem[x] = y, and
returns a mem struct.
This function applies a mask to a decimal number and returns the
resulting decimal number.
current masks, applying them to mem rows, and putting the ... | #lang racket
(require threading)
We first define a struct to hold the values of mem lines .
(struct mem (address value))
(define (read-num line)
(mem
(~>> line
(string-split)
(first)
(string->list)
(filter char-numeric?)
(list->string)
(string->number))
(~>> ... |
fc72df0bb1a56ae92644d859639c66e8f5056f450d28bcae9c216cb5e3bf457f | rmloveland/scheme48-0.53 | destructure.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
This is a destructuring version of LET .
( ( ( < pattern > < expression > ) ... ) body ... )
; The patterns can be:
; identifiers, which are bound to the corresponding part of the value
; lists of patterns (including dotted pairs)
; vectors of pa... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/big/destructure.scm | scheme | The patterns can be:
identifiers, which are bound to the corresponding part of the value
lists of patterns (including dotted pairs)
vectors of patterns
to see if there are more elements than the minimum number required. | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
This is a destructuring version of LET .
( ( ( < pattern > < expression > ) ... ) body ... )
Bug ( ? ): ( ( ( ( a ) ' ( 1 2 ) ) ) ... ) works . The code does not check
(define-syntax destructure
(lambda (form rename compare)
(let ((specs (c... |
5a9b47a4fe51eacfc04b04b9c33570aa9a45e9ca496655a6e743d60422444a74 | cj1128/sicp-review | main.scm | ; Constraint System
;; Implementation
;; basic connector operatios
;; API
;; (has-value? <connector>)
;; (get-value <connector>)
;; (set-value! <connector> <value> <informant>)
;; (forget-value! <connector> <retractor>)
;; (connect <connector> <constraint>)
(define (has-value? connector)
(connector 'has-value?))
... | null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-3/constraint-system/main.scm | scheme | Constraint System
Implementation
basic connector operatios
API
(has-value? <connector>)
(get-value <connector>)
(set-value! <connector> <value> <informant>)
(forget-value! <connector> <retractor>)
(connect <connector> <constraint>)
basic constraint
common functions |
(define (has-value? connector)
(connector 'has-value?))
(define (get-value connector)
(connector 'value))
(define (set-value! connector new-value setter)
((connector 'set-value!) new-value setter))
(define (forget-value! connector retractor)
((connector 'forget-value!) retractor))
(define (connect connector... |
64625f152d393922e38e26145d7b969b001daadd4fe5cf794c717abe354fdf06 | fossas/fossa-cli | RubySpec.hs | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.RubySpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Bundler qualified as Bundler
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (Complete))
rails :: AnalysisTes... | null | https://raw.githubusercontent.com/fossas/fossa-cli/e1edac30265888f0252c58598f63b9e475813128/integration-test/Analysis/RubySpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.RubySpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Bundler qualified as Bundler
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (Complete))
rails :: AnalysisTes... | |
2a12cd39554c29b0c21cec20b6cfd407b5b93f7845b7d229ebce88ee8c7739d8 | flavioc/cl-hurd | dir-mkfile.lisp |
(in-package :hurd)
(defcfun ("dir_mkfile" %dir-mkfile)
err
(dir port)
(flags open-flags)
(mode mode-t)
(newnode port-pointer))
(defun dir-mkfile (dir &key (flags nil) (mode (make-mode)))
"Create a new anonymous file in directory 'dir'."
(declare (type fixnum dir)
(type list flags)
... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/fs/dir-mkfile.lisp | lisp |
(in-package :hurd)
(defcfun ("dir_mkfile" %dir-mkfile)
err
(dir port)
(flags open-flags)
(mode mode-t)
(newnode port-pointer))
(defun dir-mkfile (dir &key (flags nil) (mode (make-mode)))
"Create a new anonymous file in directory 'dir'."
(declare (type fixnum dir)
(type list flags)
... | |
a11c4d520d3d3dc3b3f3c4491e8b1abc41f708e1c183ea48e349c740bf54a129 | quux00/land-of-lisp-in-clojure | clj_sockets.clj | (ns thornydev.clj-sockets
(:import (java.io BufferedReader IOException InputStreamReader PrintWriter)
(java.net ServerSocket Socket InetAddress)))
(defn socket-server [port]
(println "socket server being created")
(ServerSocket. port))
(defn socket-accept [^ServerSocket server-socket]
(println "soc... | null | https://raw.githubusercontent.com/quux00/land-of-lisp-in-clojure/2a15a89afa0cd04cf1757ccf7da289031e135165/webserver/src/thornydev/clj_sockets.clj | clojure | (ns thornydev.clj-sockets
(:import (java.io BufferedReader IOException InputStreamReader PrintWriter)
(java.net ServerSocket Socket InetAddress)))
(defn socket-server [port]
(println "socket server being created")
(ServerSocket. port))
(defn socket-accept [^ServerSocket server-socket]
(println "soc... | |
949e182323cd01dbc1d8b3f8cab9c855ac9ff60fc42a27fbb36f7502619d3f00 | icicle-lang/x-ambiata | Exit.hs | # LANGUAGE NoImplicitPrelude #
module X.Control.Monad.Trans.Either.Exit (
orDie
, orDieWithCode
) where
import Control.Applicative (pure)
import Control.Monad ((>>=), (>>))
import Data.Either (either)
import Data.Function ((.))
import Data.Int (Int)
import ... | null | https://raw.githubusercontent.com/icicle-lang/x-ambiata/532f8473084b24fb9d8c90fda7fee9858b9fbe30/x-eithert/src/X/Control/Monad/Trans/Either/Exit.hs | haskell |
| An idiom for failing hard on EitherT errors.
*This really dies*. There is no other way to say it.
The reason it lives with command line parser tooling, is that is
the only valid place to actually exit like this. Be appropriately
wary.
| # LANGUAGE NoImplicitPrelude #
module X.Control.Monad.Trans.Either.Exit (
orDie
, orDieWithCode
) where
import Control.Applicative (pure)
import Control.Monad ((>>=), (>>))
import Data.Either (either)
import Data.Function ((.))
import Data.Int (Int)
import ... |
5d11b6d0d94c27d9036cb13767260f8b12517417e0f4f650539027257011573a | jscrane/jvml | test_ex8.clj | (ns ml.test-ex8
(:use (clojure test)
(incanter core stats)
(ml ex8 ex8-cofi util testutil)))
(deftest test-estimate-gaussian
(let [{:keys [X Xval yval]} (init-ex8 "data/ex8data1.mat")
[mu sigma2] (estimate-gaussian X)
approx (approximately 1e-4)]
(is (approx [14.112 14.998] mu))... | null | https://raw.githubusercontent.com/jscrane/jvml/844eb267150564a3a0f882edbbd505ce94924c8f/test/ml/test_ex8.clj | clojure | (ns ml.test-ex8
(:use (clojure test)
(incanter core stats)
(ml ex8 ex8-cofi util testutil)))
(deftest test-estimate-gaussian
(let [{:keys [X Xval yval]} (init-ex8 "data/ex8data1.mat")
[mu sigma2] (estimate-gaussian X)
approx (approximately 1e-4)]
(is (approx [14.112 14.998] mu))... | |
f105a6b197538ec93579cff2df6994654139fb8c69092c80dcbbf648c5469130 | ghc/packages-Cabal | B.hs | module B where
import Foobar -- fails
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/Backpack/Includes5/B.hs | haskell | fails | module B where
|
1f8a00e76b76afb329a7950605c74a79dec75df52769f38b250d3dedd0d01609 | metrix-ai/deferred-folds | UnfoldlM.hs | module DeferredFolds.Defs.UnfoldlM where
import qualified Data.ByteString.Internal as ByteString
import qualified Data.ByteString.Short.Internal as ShortByteString
import DeferredFolds.Prelude hiding (foldM, mapM_)
import qualified DeferredFolds.Prelude as A
import DeferredFolds.Types
deriving instance Functor m => F... | null | https://raw.githubusercontent.com/metrix-ai/deferred-folds/41ad482be5b5abae9d20de1c949363b3025d760b/library/DeferredFolds/Defs/UnfoldlM.hs | haskell | # INLINE (<|>) #
# INLINE (>>=) #
# INLINE foldMap #
# INLINE foldl' #
| Check whether it's empty
| Perform a monadic strict left fold
| A more efficient implementation of mapM_
# INLINE mapM_ #
| Same as 'mapM_' with arguments flipped
# INLINE forM_ #
| Lift a fold input mapping function into a mapping of unfolds... | module DeferredFolds.Defs.UnfoldlM where
import qualified Data.ByteString.Internal as ByteString
import qualified Data.ByteString.Short.Internal as ShortByteString
import DeferredFolds.Prelude hiding (foldM, mapM_)
import qualified DeferredFolds.Prelude as A
import DeferredFolds.Types
deriving instance Functor m => F... |
5dc94c067767d3bf4ed1483fc97303850c3e8150428c0206c66567c3450389a4 | emanjavacas/cosycat | viewport.cljs | (ns cosycat.viewport
(:import [goog.dom ViewportSizeMonitor])
(:require [reagent.core :as reagent]
[goog.dom :as gdom]
[goog.events :as goog-events]
[goog.events.EventType :as event-type]))
(defn get-viewport-props []
(let [viewport-size (gdom/getViewportSize)
width (.... | null | https://raw.githubusercontent.com/emanjavacas/cosycat/a7186363d3c0bdc7b714af126feb565f98793a6e/src/cljs/cosycat/viewport.cljs | clojure | (ns cosycat.viewport
(:import [goog.dom ViewportSizeMonitor])
(:require [reagent.core :as reagent]
[goog.dom :as gdom]
[goog.events :as goog-events]
[goog.events.EventType :as event-type]))
(defn get-viewport-props []
(let [viewport-size (gdom/getViewportSize)
width (.... | |
26b2603dbafb7a41dbc06db0d7ad5d0085ae84ed0cc60e1470cfb238ed7fa8c3 | rvirding/flavors | flavors_instance.erl | Copyright ( c ) 2015
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under ... | null | https://raw.githubusercontent.com/rvirding/flavors/249efc49d4c8e38f97c98720b746d21082ecdc73/src/flavors_instance.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 or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2015
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author :
the flaovr instance but be signalled at the caller . I think this is
-module(flavors_instance).
-behaviour(gen_server).
-export([s... |
b7bb7511bed5b99d1bc568a60af3b48c42f453c8abac7b69968309a8537f78a7 | marcoheisig/Loopus | ir-optimize.lisp | (in-package #:loopus.ir)
;; Nothing
(defun ir-optimize (ir) ir)
;; No isl
No common sub expression . Specialize makes ( aref array idx ) pure and
;; sub expression delete it
(defun ir-optimize (ir)
(ir-vectorize
(ir-remove-dead-code
(ir-specialize ir))))
;; deadcode not working for now
;; Isl
(defun ir-... | null | https://raw.githubusercontent.com/marcoheisig/Loopus/bd84132eb5d0e94b1fadcb9be734a3ff8b0c1aff/code/ir/ir-optimize.lisp | lisp | Nothing
No isl
sub expression delete it
deadcode not working for now
Isl
(ir-vectorize
(ir-remove-dead-code | (in-package #:loopus.ir)
(defun ir-optimize (ir) ir)
No common sub expression . Specialize makes ( aref array idx ) pure and
(defun ir-optimize (ir)
(ir-vectorize
(ir-remove-dead-code
(ir-specialize ir))))
(defun ir-optimize (ir)
(ir-isl-optimize
(ir-specialize ir)))
|
0ef50117fab9df204834b344648fb0377a36d32ad6b3a3fe1c827db3da86505b | TurtleKitty/Vaquero | pair.scm |
(define vaquero-send-list-vtable #f)
(define vaquero-send-pair-vtable #f)
(let ()
(method view
(cont (vaquero-view obj)))
(define to-text view)
(set! vaquero-send-list-vtable
(let ()
(define (list-set! list k val)
(if (zero? k)
(set-car! list val)
... | null | https://raw.githubusercontent.com/TurtleKitty/Vaquero/e1ea4cebf82e7de9cbdbdde4b9db5e5cc040eb71/interpreter/pair.scm | scheme | (method to-list (cont (list (car obj) (cdr obj))))
(method to-table (cont (vaquero-table (car obj) (cdr obj)))) |
(define vaquero-send-list-vtable #f)
(define vaquero-send-pair-vtable #f)
(let ()
(method view
(cont (vaquero-view obj)))
(define to-text view)
(set! vaquero-send-list-vtable
(let ()
(define (list-set! list k val)
(if (zero? k)
(set-car! list val)
... |
a6560c198e29a70a426319ec81f92c26de6a058f89e23347c78ce0bc4334854d | technomancy/slamhound | stitch_test.clj | (ns slam.hound.stitch-test
(:require [clojure.java.io :as io]
[clojure.test :refer [deftest is testing]]
[slam.hound.stitch :refer [imports-from-map keyword-list-from-map
metadata-from-map ns-from-map
refer-clojure-f... | null | https://raw.githubusercontent.com/technomancy/slamhound/68bad50282b8b559eb012d6574ef6a0e1485b3a2/test/slam/hound/stitch_test.clj | clojure | This is a common invocation | (ns slam.hound.stitch-test
(:require [clojure.java.io :as io]
[clojure.test :refer [deftest is testing]]
[slam.hound.stitch :refer [imports-from-map keyword-list-from-map
metadata-from-map ns-from-map
refer-clojure-f... |
a2b6de524de38bdfe94e8a504ea830638c46957d0fa90a42ca42c563f40c75ad | sharplispers/ironclad | conditions.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
;;;; conditions.lisp -- various error conditions
(in-package :ironclad)
(define-condition ironclad-error (simple-error)
())
(define-condition key-not-supplied (ironclad-error)
((cipher :initarg :cipher :reader cipher))
(:report (lambda (condition stream)
... | null | https://raw.githubusercontent.com/sharplispers/ironclad/6ad3a482105e1a46b461b1e65bafa769113abf7c/src/conditions.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
conditions.lisp -- various error conditions |
(in-package :ironclad)
(define-condition ironclad-error (simple-error)
())
(define-condition key-not-supplied (ironclad-error)
((cipher :initarg :cipher :reader cipher))
(:report (lambda (condition stream)
(format stream "Cipher ~A requires a key." (cipher condition))))
(:documentation "Signaled... |
6454b55d2c5b29bc8a5fc899b6e4f4267ff2d2f8f81e7d44e038cf78343f21ea | hbr/albatross | command_line.mli | Copyright ( C ) 2017 brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as published... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/alba1/command_line.mli | ocaml | Copyright ( C ) 2017 brandl at gmx dot net >
This file is distributed under the terms of the GNU General Public License
version 2 ( GPLv2 ) as published by the Free Software Foundation .
This file is distributed under the terms of the GNU General Public License
version 2 (GPLv2) as published... | |
fc91640c0e74f1954ee462201b54997513ba67dd0b92bfd2b735cfae2194268d | kudu-dynamics/blaze | FcmpGtOp.hs | module Blaze.Types.Pil.Op.FcmpGtOp where
-- This module is generated. Please use app/gen_pil_ops/Main.hs to modify.
import Blaze.Prelude
data FcmpGtOp expr = FcmpGtOp
{ left :: expr
, right :: expr
} deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, FromJSON, ToJSON)
instance Hashable a => Has... | null | https://raw.githubusercontent.com/kudu-dynamics/blaze/a385bb3b37a0a0e061217ebdd70dd0eecbb20332/src/Blaze/Types/Pil/Op/FcmpGtOp.hs | haskell | This module is generated. Please use app/gen_pil_ops/Main.hs to modify. | module Blaze.Types.Pil.Op.FcmpGtOp where
import Blaze.Prelude
data FcmpGtOp expr = FcmpGtOp
{ left :: expr
, right :: expr
} deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, FromJSON, ToJSON)
instance Hashable a => Hashable (FcmpGtOp a)
|
0853c634cb3b76fd5172602e94b386ed4fbcf7edccc5c42f30acfab7280136f7 | ajhc/ajhc | Ix.hs | # OPTIONS_JHC -fno - prelude #
module Data.Ix ( Ix(range, index, inRange, rangeSize) ) where
import Jhc.Int
import Jhc.Enum
import Jhc.Order
import Jhc.Basics
import Jhc.Num
import Jhc.Tuples
import Jhc.IO
class Ord a => Ix a where
range :: (a,a) -> [a]
index :: (a,a) -> a -> Int
inRange :: (a... | null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/lib/haskell-extras/Data/Ix.hs | haskell | fails if the bounds are tuples. For example,
but the range is nevertheless empty
range (m,n) = [m..n]
index b@(m,n) i
| inRange b i = fromInteger (i - m)
instance (Ix a,Ix b) => Ix (a, b) -- as derived, for all tuples
as derived
as derived
as derived | # OPTIONS_JHC -fno - prelude #
module Data.Ix ( Ix(range, index, inRange, rangeSize) ) where
import Jhc.Int
import Jhc.Enum
import Jhc.Order
import Jhc.Basics
import Jhc.Num
import Jhc.Tuples
import Jhc.IO
class Ord a => Ix a where
range :: (a,a) -> [a]
index :: (a,a) -> a -> Int
inRange :: (a... |
82292da2167b533798f420c9ab773b86eaf060f68d66501b8479e9130b28d751 | ltoth/unison | uimacbridgenew.ml | ML side of a bridge to C for the GUI
open Common;;
open Lwt;;
let debug = Trace.debug "startup"
let unisonNonGuiStartup() = begin
(* If there's no GUI, don't print progress in the GUI *)
Uutil.setProgressPrinter (fun _ _ _ -> ());
Main.nonGuiStartup() (* If this returns the GUI should be started *)
end;;... | null | https://raw.githubusercontent.com/ltoth/unison/e763510165e3d93c5140a4c5f2ea0dcbf5825a0c/uimacbridgenew.ml | ocaml | If there's no GUI, don't print progress in the GUI
If this returns the GUI should be started
Concatenate the new message
Defined in Bridge.m, used to redisplay the table
when the status for a row changes
from uigtk2
Trace.status "showProgress";
Returns a string option: command line profile, if any
Di... | ML side of a bridge to C for the GUI
open Common;;
open Lwt;;
let debug = Trace.debug "startup"
let unisonNonGuiStartup() = begin
Uutil.setProgressPrinter (fun _ _ _ -> ());
end;;
Callback.register "unisonNonGuiStartup" unisonNonGuiStartup;;
type stateItem = { mutable ri : reconItem;
mutable... |
fd2315ed61f15cf5e1021d8d56b2e6dfb1c7f75fd4b28844f7a232e76a8543de | gulige/neuroevo | gstk_rectangle.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2016 . 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 License at
%%
%% -2.0
%%
%% Unless required by applic... | null | https://raw.githubusercontent.com/gulige/neuroevo/09e67928c2417f2b27ec6522acc82f8b3c844949/apps/gs/src/gstk_rectangle.erl | erlang |
%CopyrightBegin%
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 or implied.
See the License for the specific l... | Copyright Ericsson AB 1996 - 2016 . 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(gstk_rectangle).
-compile([{nowarn_deprecated_function,{gs,pair,2}}]).
stipple
scale { Xo , Y... |
6f0341ae11fcc31283d15a2d2e8ece070b4152b16e50ccb822a167e31fa31290 | asivitz/Hickory | Text.hs | module Hickory.Text
( module Hickory.Text.Types
, module Hickory.Text.Text
, module Hickory.Text.ParseJson
) where
import Hickory.Text.Types
import Hickory.Text.Text
import Hickory.Text.ParseJson
| null | https://raw.githubusercontent.com/asivitz/Hickory/10a9359ddbfb5de65045e3b53144c62f729d9cc2/core/Hickory/Text.hs | haskell | module Hickory.Text
( module Hickory.Text.Types
, module Hickory.Text.Text
, module Hickory.Text.ParseJson
) where
import Hickory.Text.Types
import Hickory.Text.Text
import Hickory.Text.ParseJson
| |
ac42216db5d68445d86f135162929e61f52631a43d2432e03d44e156397e1538 | BenjaminVanRyseghem/great-things-done | today.cljs | Copyright ( c ) 2015 , . 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
; t... | null | https://raw.githubusercontent.com/BenjaminVanRyseghem/great-things-done/1db9adc871556a347426df842a4f5ea6b3a1b7e0/src/front/ui/main/today.cljs | 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 ) 2015 , . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns ui.main.today
(:require [gtd.state :as state]
[reagent.core :as reagent :refer [atom]]
[ui.main :as main]
[ui.widgets.tasks :as tasks]))
(defmethod main/main-container-component "tod... |
1a37be4032f9cfa098c31f59b12ea6135f5dd5dc59150c59f367f64db08f3ad5 | camlp5/camlp5 | ast2pt.ml | (* camlp5r *)
ast2pt.ml , v
#load "q_MLast.cmo";
open Parsetree;
open Longident;
open Asttypes;
open Asttools;
open Versdep;
open MLast;
value fast = ref False;
value get_tag x =
if Obj.is_block (Obj.repr x) then Obj.tag (Obj.repr x) else Obj.magic x
;
value error loc str = Ploc.raise loc (Failure str);
valu... | null | https://raw.githubusercontent.com/camlp5/camlp5/bbb254dbf0a2bed0def546632db679e2de6a7d76/main/ast2pt.ml | ocaml | camlp5r | ast2pt.ml , v
#load "q_MLast.cmo";
open Parsetree;
open Longident;
open Asttypes;
open Asttools;
open Versdep;
open MLast;
value fast = ref False;
value get_tag x =
if Obj.is_block (Obj.repr x) then Obj.tag (Obj.repr x) else Obj.magic x
;
value error loc str = Ploc.raise loc (Failure str);
value char_of_char... |
2d3809f4665c6d7e4850446d5e8c47eb3d033509b29e6b447576cb345dd2ea1a | sirherrbatka/statistical-learning | iris-som.lisp | (ql:quickload '(:vellum :vellum-csv :statistical-learning))
(cl:in-package #:cl-user)
(defpackage #:iris-som-example
(:use #:cl #:statistical-learning.aux-package))
(cl:in-package #:iris-som-example)
;; loading data set
(defvar *data*
(vellum:copy-from :csv (~>> (asdf:system-source-directory :statistical-learni... | null | https://raw.githubusercontent.com/sirherrbatka/statistical-learning/74ddb767e76b25799b163714858f62f45728fa7d/examples/iris-som.lisp | lisp | loading data set | (ql:quickload '(:vellum :vellum-csv :statistical-learning))
(cl:in-package #:cl-user)
(defpackage #:iris-som-example
(:use #:cl #:statistical-learning.aux-package))
(cl:in-package #:iris-som-example)
(defvar *data*
(vellum:copy-from :csv (~>> (asdf:system-source-directory :statistical-learning)
... |
f43bc263d9b6770175e026947c9219dafff37850f756ca5690d0aa4a2cdfd8ad | clojure-finance/clojask | groupby.clj | (ns clojask.groupby
(:require [clojure.java.io :as io]
[ : as csv ]
[clojask.utils :as u]
[clojask.classes.MGroup :refer [->MGroup]])
(:import [clojask.classes.MGroup MGroup]))
"contains the utility functions to group by and aggregate"
(defn compute-groupby
"map the result to different f... | null | https://raw.githubusercontent.com/clojure-finance/clojask/1cf122efb05370cacd5412f070cdf6890d9aa2e4/src/main/clojure/clojask/groupby.clj | clojure | ;; the example of how to write a set of aggregate function
[]
[row]
[]
(def output-filename dist)
(doseq [groupby-key groupby-keys]
(str output-filename ".csv")
(map (fn [_] (get key-index _)) groupby-keys)
(if-let [formatter (get formatters _)]
(formatter (nth msg _))
(nth msg _))
msg this tim... | (ns clojask.groupby
(:require [clojure.java.io :as io]
[ : as csv ]
[clojask.utils :as u]
[clojask.classes.MGroup :refer [->MGroup]])
(:import [clojask.classes.MGroup MGroup]))
"contains the utility functions to group by and aggregate"
(defn compute-groupby
"map the result to different f... |
9a22e116e6d373f370dbcf6405fee5b22141bdaf28efd0c9b1b03370e3ca4148 | madstap/comfy | walk_test.cljc | (ns madstap.comfy.walk-test
(:require
[madstap.comfy :as comfy]
[clojure.test :refer [deftest testing is are run-all-tests]]
[clojure.walk :as core.walk]))
;; Alternative implementation using clojure.walk
(defn walk-reduce-factory*
{:no-doc true}
[walker]
(fn walk-reduce [rf init coll]
(let [*acc... | null | https://raw.githubusercontent.com/madstap/comfy/0af9cc940bcf1726e0c11c6f19986620d8cfd345/test/madstap/comfy/walk_test.cljc | clojure | Alternative implementation using clojure.walk
reduction fails to respect reduced. | (ns madstap.comfy.walk-test
(:require
[madstap.comfy :as comfy]
[clojure.test :refer [deftest testing is are run-all-tests]]
[clojure.walk :as core.walk]))
(defn walk-reduce-factory*
{:no-doc true}
[walker]
(fn walk-reduce [rf init coll]
(let [*acc (atom [])]
(walker (fn [x] (swap! *acc con... |
c913ae86294c834ea5619c2f9269d81be80b4c3ba0c7e47f57cecf443426eaba | florentc/youbrick | Name.hs | |
Module : Tui . Name
Description : Names of the TUI widgets
Copyright : ( c ) , 2021
License : GPL-3.0 - or - later
Names of the widgets in the TUI .
Module : Tui.Name
Description : Names of the TUI widgets
Copyright : (c) Florent Ch., 2021
License : GPL-3.0-or-later
Names of ... | null | https://raw.githubusercontent.com/florentc/youbrick/0b0dae7c94773df904b9d6c9172d503d65e86281/src/Tui/Name.hs | haskell | |
Module : Tui . Name
Description : Names of the TUI widgets
Copyright : ( c ) , 2021
License : GPL-3.0 - or - later
Names of the widgets in the TUI .
Module : Tui.Name
Description : Names of the TUI widgets
Copyright : (c) Florent Ch., 2021
License : GPL-3.0-or-later
Names of ... | |
a3ced7ce7cd8424f16cfe803346a8dab8db0862fb6cc902c868346f5b3dca588 | kupl/FixML | sub9.ml | type formula =
True
| False
| Neg of formula
| Or of formula * formula
| And of formula * formula
| Imply of formula * formula
| Equiv of formula * formula
let rec eval : formula -> bool
=fun f ->
match f with
|True -> true
|False -> false
|Neg(f')-> if f'=True then false else true
|Or(f',f'')-> if f... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/formula/formula2/submissions/sub9.ml | ocaml | type formula =
True
| False
| Neg of formula
| Or of formula * formula
| And of formula * formula
| Imply of formula * formula
| Equiv of formula * formula
let rec eval : formula -> bool
=fun f ->
match f with
|True -> true
|False -> false
|Neg(f')-> if f'=True then false else true
|Or(f',f'')-> if f... | |
0d1cf7e254c05efe4700ecbf1d013a0aac8fd01d6509511eaebd1d85ec8a4436 | ghc/nofib | BarakiConc3.hs |
-- ==========================================================--
= = = Implementation of Gebreselassie 's = = = --
-- === polymorphism stuff BarakiConc.hs ===--
-- ==========================================================--
module BarakiConc3 where
import BaseDefs
import Utils
import ... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/real/anna/BarakiConc3.hs | haskell | ==========================================================--
=== polymorphism stuff BarakiConc.hs ===--
==========================================================--
==================================================--
=== Application of a embedding functor (e-app) ===--
=== to a point. ... |
module BarakiConc3 where
import BaseDefs
import Utils
import MyUtils
import AbstractVals2
import SuccsAndPreds2
import AbstractMisc
import DomainExpr
import AbsConc3
import BarakiMeet
bcEApp_d :: DRRSubst -> DExpr -> Domain
bcEApp_d rho DXTwo
= Two
bcEApp_d rho (DXLift1 dxs)
= Lift1 (map (bcEApp_d rho) dxs... |
1b40ccd81c1a55ef88c1f9ccc8ce0f58288746870e5406a35f228f9fe96ecc4d | exercism/babashka | allergies.clj | (ns allergies)
(def ^:private allergens
[:eggs :peanuts :shellfish :strawberries :tomatoes :chocolate :pollen :cats])
(defn- flagged?
[flags index]
(-> (bit-shift-right flags index)
(bit-and 1)
(pos?)))
(defn allergies
"Given an 8-bit bitmap of flags, returns the list of matching allergens."
[f... | null | https://raw.githubusercontent.com/exercism/babashka/707356c52e08490e66cb1b2e63e4f4439d91cf08/exercises/practice/allergies/src/allergies.clj | clojure | (ns allergies)
(def ^:private allergens
[:eggs :peanuts :shellfish :strawberries :tomatoes :chocolate :pollen :cats])
(defn- flagged?
[flags index]
(-> (bit-shift-right flags index)
(bit-and 1)
(pos?)))
(defn allergies
"Given an 8-bit bitmap of flags, returns the list of matching allergens."
[f... | |
51b86012963e09f6bfef3100c4edb82cc9f75fbfdc62eb7d2b148949123dca04 | rabbitmq/rabbitmq-mqtt | rabbit_mqtt_retainer_sup.erl | 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 ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_mqtt_retainer_sup).
-behaviour(sup... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-mqtt/817971bfec4461630a2ef7e27d4fa9f4c4fb8ff9/src/rabbit_mqtt_retainer_sup.erl | erlang |
see start_child/2
we'd like to avoid any conversion here because
this atom isn't meant to be human-readable, only
unique. This makes sure we don't get noisy process restarts
with really unusual vhost names used by various HTTP API test suites | 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 ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_mqtt_retainer_sup).
-behaviour(superviso... |
2c8f040acf3e4050fe6e41634067f1b6c5de637b637ce7838235fa105fd9e42c | johnwhitington/ocamli | ppx_auto.ml | open Ast_helper
open Ast_mapper
open Parsetree
open Longident
open Ppx_auto_util
Parse { |external word_size : unit - > int = " % word_size"| } returning :
a ) n = " word_size " b ) = " Unit " c ) t_out = " Int " d ) = " % word_size "
a) n = "word_size" b) t_in = "Unit" c) t_out = "Int" d) nstr = "%wor... | null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/ppx_auto/ppx_auto.ml | ocaml | Printf.printf "NOTICED IT**************************\n";
flush stdout;
Printf.printf "constr_of_type: %s\n" x;
Extract a -> b -> c -> d to ([a; b; c], d) etc.
Rather than map, to enforce left to right ordering on incrname calls
Build the auto itself. | open Ast_helper
open Ast_mapper
open Parsetree
open Longident
open Ppx_auto_util
Parse { |external word_size : unit - > int = " % word_size"| } returning :
a ) n = " word_size " b ) = " Unit " c ) t_out = " Int " d ) = " % word_size "
a) n = "word_size" b) t_in = "Unit" c) t_out = "Int" d) nstr = "%wor... |
2fa9dae6e8c3d9929c2b104e1cb8f07454a168bcbfa752447f9dd64fce1a5682 | timbertson/passe | db_tests.ml | open Test_common
open Store
module J = struct
include Json_ext
let assert_equal = assert_equal ~cmp:Json_ext.eq ~printer:to_string
end
module Db = struct
let assert_equal = assert_equal ~cmp:Store.eq ~printer: (Store.to_json_string)
end
module Record = struct
let assert_equal = assert_equal
~cmp:(Store.record_e... | null | https://raw.githubusercontent.com/timbertson/passe/467a79ea0cd7b08a97b52be3bd1307a3bdf55799/src/test/db_tests.ml | ocaml | log#debug "serialized: %s" (J.to_string json);
we can't generate new-style hints until all clients support it
parsing ignores unknown fields, so we can just save both for future compat | open Test_common
open Store
module J = struct
include Json_ext
let assert_equal = assert_equal ~cmp:Json_ext.eq ~printer:to_string
end
module Db = struct
let assert_equal = assert_equal ~cmp:Store.eq ~printer: (Store.to_json_string)
end
module Record = struct
let assert_equal = assert_equal
~cmp:(Store.record_e... |
0380b67b581853415a460eb81cf6fbf8904ec8cbffdb0616a4ed63ecd4781928 | xmonad/xmonad-contrib | Directory.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Directory
Description : A directory prompt for XMonad .
Copyright : ( C ) 2007 ,
-- License : BSD3
--
-- Maintainer :
-- Stability : unstable
-- Portability : unportable
--
-- A di... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/3058d1ca22d565b2fa93227fdde44d8626d6f75d/XMonad/Prompt/Directory.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Prompt.Directory
License : BSD3
Maintainer :
Stability : unstable
Portability : unportable
A directory prompt for XMonad
---------------------------------------------------------------------------
* ... | Description : A directory prompt for XMonad .
Copyright : ( C ) 2007 ,
module XMonad.Prompt.Directory (
directoryPrompt,
directoryMultipleModes,
directoryMultipleModes',
Dir
... |
9a590796617dd3b94d5fb0b751f50e7a38cf5d6c43453feda203cd2282f09b42 | gheber/kenzo | cl-space-efhm-test.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
(in-package :kenzo-test-8)
(in-suite :kenzo-8)
(test cs-hat-u-t
(cat-8:cat-init)
(let ((c (cat-8:cs-hat-u-t (cat-8:k-z-1)))
abar-degr
gnrt)
(dotimes (i 10)
(let ((abar (random-abar 8 4)))
... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/test/kenzo-8/cl-space-efhm-test.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - * |
(in-package :kenzo-test-8)
(in-suite :kenzo-8)
(test cs-hat-u-t
(cat-8:cat-init)
(let ((c (cat-8:cs-hat-u-t (cat-8:k-z-1)))
abar-degr
gnrt)
(dotimes (i 10)
(let ((abar (random-abar 8 4)))
(setf abar-degr (apply #'+ (mapcar #'car (cat-8:abar-list abar)... |
06f231546104a5450193500c589fd2b3802d49c42b3a0f9ac7b8ef45a1d8df0a | scrintal/heroicons-reagent | bell_slash.cljs | (ns com.scrintal.heroicons.outline.bell-slash)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/bell_slash.cljs | clojure | (ns com.scrintal.heroicons.outline.bell-slash)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | |
b4f10c50022660057d6e2042411e0c11fbe1f70f9a13b377c80fb14dd153aa91 | g-andrade/erlzord | erlzord.erl | -module(erlzord).
-author('Guilherme Andrade <erlzord(at)gandrade(dot)net>').
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
-export([config/3]). -ignore_xref({config,3}).
-export([encode/2]). ... | null | https://raw.githubusercontent.com/g-andrade/erlzord/5c6856de46bd78dc0460b3d17193705240ca097d/src/erlzord.erl | erlang | ------------------------------------------------------------------
API Function Exports
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
-------------------------... | -module(erlzord).
-author('Guilherme Andrade <erlzord(at)gandrade(dot)net>').
-export([config/3]). -ignore_xref({config,3}).
-export([encode/2]). -ignore_xref({encode,2}).
-export([decode/2]). -ignore_xref({decode,2}).
-export([encode/4]). -ignore_xref({encode,4}).
-export([decode/4]). ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.