_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
5203cfb43f1f1f9311a40c750da599764bd011b6d91bb9424db7bb8684f578a6
yangchenyun/learning-sicp
smstep.scm
SMSTEP.SCM Code for Sample Pset Routines for One Rewriting Step of Substitution Model FOR THE COMPILER (declare (usual-integrations)) (declare (integrate-external "smsyntax")) (declare (integrate-external "smscope")) The main procedure of the Scheme Term Rewriting Model implementation is ONE - STE...
null
https://raw.githubusercontent.com/yangchenyun/learning-sicp/99a19a06eddc282e0eb364536e297f27c32a9145/practices/assignments/08.term-rewriting-evaluator/smstep.scm
scheme
used effectively without studying, or even looking at, its definition: Tagged-Body = Labelled-Sum[stepped: <body>, val: <body>, stuck: Error-info] BODY must be desugared. lookup of undefined variables, then the call returns the ...
SMSTEP.SCM Code for Sample Pset Routines for One Rewriting Step of Substitution Model FOR THE COMPILER (declare (usual-integrations)) (declare (integrate-external "smsyntax")) (declare (integrate-external "smscope")) The main procedure of the Scheme Term Rewriting Model implementation is ONE - STE...
a70035e797fab9a84e2a8eaf0907622450a4c0dd96562010d7fbb75996cd3c88
alanz/ghc-exactprint
Rename1.hs
foo x y = do c <- getChar return c
null
https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/transform/Rename1.hs
haskell
foo x y = do c <- getChar return c
4b73f3a039bcb4c33d52218b40303ed31f1f4b433557d59690ddbf03b810c315
debug-ito/greskell
JSON.hs
{-# LANGUAGE OverloadedStrings #-} -- | -- Module: Network.Greskell.WebSocket.Codec.JSON Description : application\/json codec Maintainer : < > -- -- module Network.Greskell.WebSocket.Codec.JSON ( jsonCodec ) where import Data.Aeson (FromJSON, ToJSON) import qualified Dat...
null
https://raw.githubusercontent.com/debug-ito/greskell/ff21b8297a158cb4b5bafcbb85094cef462c5390/greskell-websocket/src/Network/Greskell/WebSocket/Codec/JSON.hs
haskell
# LANGUAGE OverloadedStrings # | Module: Network.Greskell.WebSocket.Codec.JSON | Simple \"application\/json\" codec.
Description : application\/json codec Maintainer : < > module Network.Greskell.WebSocket.Codec.JSON ( jsonCodec ) where import Data.Aeson (FromJSON, ToJSON) import qualified Data.Aeson as A import Data.Aeson.Types (parseEith...
c5c1428261d6261710d9f2286563a6cc6478d77f3d4ba0e54203ee577da809b9
zotonic/cowmachine
main.erl
-module(main). -behaviour(gen_server). -export([start_link/0]). % convenience call for startup -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). % gen_server callbacks -define(SERVER, ?MODULE). % macro just defines this module as server ...
null
https://raw.githubusercontent.com/zotonic/cowmachine/ad592a3e70ccce87434e3555c58fa1664bfa00c6/examples/upload/src/main.erl
erlang
convenience call for startup gen_server callbacks macro just defines this module as server convenience function for startup gen_server callbacks The listener name is used to refer to this listener in future calls Use this module as middleware, and controller TypeOfCallingCowmachine = 1+1, ... add your dispatch...
-module(main). -behaviour(gen_server). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). init([]) -> ServerPid = startServer(), {ok, [ServerPid]}. handle_call(_Request, _From,...
ecdfbf1b05aea7544398a91df230a5e7633463f5d0ab00d42db9d1655a2363e0
lambdageek/unbound-generics
TH.hs
{-# OPTIONS_HADDOCK show-extensions #-} -- | Module : Unbound . Generics . LocallyNameless . TH Copyright : ( c ) 2015 , -- License : BSD3 (See LICENSE) Maintainer : -- Stability : experimental -- Template Haskell methods to construct instances of ' Alpha ' for -- datatypes that don't contain any...
null
https://raw.githubusercontent.com/lambdageek/unbound-generics/04fe1ba015adccc6965bbeb814bb22357ff91829/src/Unbound/Generics/LocallyNameless/TH.hs
haskell
# OPTIONS_HADDOCK show-extensions # | License : BSD3 (See LICENSE) Stability : experimental datatypes that don't contain any names and don't participate in 'Alpha' operations in any non-trivial way. contain any bound or free variable names (or any in general any values that are themselves non-trivial insta...
Module : Unbound . Generics . LocallyNameless . TH Copyright : ( c ) 2015 , Maintainer : Template Haskell methods to construct instances of ' Alpha ' for # LANGUAGE TemplateHaskell # module Unbound.Generics.LocallyNameless.TH (makeClosedAlpha) where import Language.Haskell.TH import Control.Applicat...
754c3e3426cde00f918f513bc988d530365a056b94f5be9ba68bc7933a41eac2
esl/MongooseIM
mongoose_domain_sql.erl
-module(mongoose_domain_sql). -export([start/1]). -export([insert_domain/2, delete_domain/2, set_domain_for_deletion/2, set_status/2]). -export([select_domain_admin/1, set_domain_admin/2, delete_domain_admin/1]). -export([select_domain/1, get_minmax_event_id/0, ...
null
https://raw.githubusercontent.com/esl/MongooseIM/c863ca0a6109c782577a63e00510f634ca31d831/src/domain/mongoose_domain_sql.erl
erlang
interfaces only for integration tests Settings Events Admins ---------------------------------------------------------------------------- API that are supposed to be autoincremented, easily -pl/sql/t-sql/statements/set-identity-insert-transact-sql This query could not be a prepared query You will get an error...
-module(mongoose_domain_sql). -export([start/1]). -export([insert_domain/2, delete_domain/2, set_domain_for_deletion/2, set_status/2]). -export([select_domain_admin/1, set_domain_admin/2, delete_domain_admin/1]). -export([select_domain/1, get_minmax_event_id/0, ...
09692154dc893c8d8b894c133f8da2e02887aff120c3a001f93b6c5d8ddf83d8
rorra/rorracasts_erlang
db.erl
-module(db). -include("registros.hrl"). -compile(export_all). init() -> mnesia:start(), mnesia:create_schema([node()]), cargar_tablas(), cargar_datos(), ok. cargar_tablas() -> mnesia:create_table(usuario, [ {attributes, record_info(fields, usuario)}, {type, set}, {index, [email]}]), mnesia:c...
null
https://raw.githubusercontent.com/rorra/rorracasts_erlang/c50d20abe3f1a65001576734caedae90f36e3ecd/023-mnesia-2/db.erl
erlang
-module(db). -include("registros.hrl"). -compile(export_all). init() -> mnesia:start(), mnesia:create_schema([node()]), cargar_tablas(), cargar_datos(), ok. cargar_tablas() -> mnesia:create_table(usuario, [ {attributes, record_info(fields, usuario)}, {type, set}, {index, [email]}]), mnesia:c...
822a02df604f287cd84fff2085632288d04d673861d2ec677973e52b8d1dcf24
hanshuebner/bknr-web
article.lisp
(in-package :bknr.text) (define-persistent-class article (owned-object) ((author :read :initform nil) (time :update :initform (get-universal-time)) (subject :update :initform "") (text :update :initform "") (read-by :update :initform nil) (search-vector :update :initform nil)) (:documentation "gener...
null
https://raw.githubusercontent.com/hanshuebner/bknr-web/5c30b61818a2f02f6f2e5dc69fd77396ec3afc51/modules/text/article.lisp
lisp
XXX new templater XXX :keyword
(in-package :bknr.text) (define-persistent-class article (owned-object) ((author :read :initform nil) (time :update :initform (get-universal-time)) (subject :update :initform "") (text :update :initform "") (read-by :update :initform nil) (search-vector :update :initform nil)) (:documentation "gener...
12ca174f7edcfe855bb3a9b12af083e1786347d630b1a466d951c3ee4841fe37
lgessler/glam
delete_test.clj
(ns glam.xtdb.delete-test (:require [clojure.test :refer :all] [glam.xtdb.access :as access] [glam.xtdb.user :as user] [glam.xtdb.project :as prj] [glam.xtdb.text-layer :as txtl] [glam.xtdb.token-layer :as tokl] [glam.xtdb.span-layer :as sl] ...
null
https://raw.githubusercontent.com/lgessler/glam/5259dbab9198a6c9749650aad61aead7d1ee58e5/src/test/glam/xtdb/delete_test.clj
clojure
(ns glam.xtdb.delete-test (:require [clojure.test :refer :all] [glam.xtdb.access :as access] [glam.xtdb.user :as user] [glam.xtdb.project :as prj] [glam.xtdb.text-layer :as txtl] [glam.xtdb.token-layer :as tokl] [glam.xtdb.span-layer :as sl] ...
a92ebabd8f196fca7938d29ddc7cd4c52653b049110835c1d269961c08f4ef7d
ExtremaIS/ttc-haskell
Username.hs
------------------------------------------------------------------------------ -- | -- Module : Username -- Description : username data type Copyright : Copyright ( c ) 2019 - 2022 License : MIT -- This module defines a username data type , with ' TTC.Render ' and ' ' instances , as an example o...
null
https://raw.githubusercontent.com/ExtremaIS/ttc-haskell/283ca48904f7e94905cc5b2f59abf9bad75a3bff/examples/uvalidqq/Username.hs
haskell
---------------------------------------------------------------------------- | Module : Username Description : username data type The constructor for 'Username' is not exported. The 'TTC.Parse' instance serves as a "smart constructor," ensuring that all values are valid. This version of the module uses '...
Copyright : Copyright ( c ) 2019 - 2022 License : MIT This module defines a username data type , with ' TTC.Render ' and ' ' instances , as an example of TTC usage . quasi - quoter , which does not require a ' Language . Haskell . TH.Syntax . Lift ' # LANGUAGE TemplateHaskell # module Username ...
1e358edf2fc6ace04b41c1f9b8f3b4ccac379bee6984caec413e34f8336a50ce
tfausak/monadoc-5
Timestamp.hs
module Monadoc.Type.Timestamp where import qualified Data.Time as Time import qualified Database.SQLite.Simple.FromField as Sql import qualified Database.SQLite.Simple.ToField as Sql import Monadoc.Prelude import qualified Monadoc.Utility.Sql as Sql import qualified Monadoc.Utility.Time as Time -- | A moment in time....
null
https://raw.githubusercontent.com/tfausak/monadoc-5/5361dd1870072cf2771857adbe92658118ddaa27/src/lib/Monadoc/Type/Timestamp.hs
haskell
| A moment in time. This is a wrapper around 'Time.UTCTime'. Use 'fromUtcTime' and 'toUtcTime' to wrap and unwrap these values. Since this only uses UTC time, be careful with time zones when converting!
module Monadoc.Type.Timestamp where import qualified Data.Time as Time import qualified Database.SQLite.Simple.FromField as Sql import qualified Database.SQLite.Simple.ToField as Sql import Monadoc.Prelude import qualified Monadoc.Utility.Sql as Sql import qualified Monadoc.Utility.Time as Time newtype Timestamp = ...
448b86380081bffcb8f79a33af87dbabc203ed1d309b3628f108923f17d0b071
ocaml-multicore/ocaml-uring
urcp_lib.ml
(* cp(1) built with liburing. Queues up as many reads as the queue * depth allows and then queues up corresponding writes. OCaml version of *) module Int63 = Optint.Int63 let get_file_size fd = Unix.handle_unix_error Unix.fstat fd |> fun {Unix.st_size; _} -> st_size TODO make this work with ST_ISBLK type ...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-uring/4a759a404f05e1bb54d2f2cd68060c63f38ed348/tests/urcp_lib.ml
ocaml
cp(1) built with liburing. Queues up as many reads as the queue * depth allows and then queues up corresponding writes. OCaml version of Perform a complete read into bufs. Check that a read has completely finished, and if not * queue it up for completing the remaining amount requeue the request handle sh...
module Int63 = Optint.Int63 let get_file_size fd = Unix.handle_unix_error Unix.fstat fd |> fun {Unix.st_size; _} -> st_size TODO make this work with ST_ISBLK type t = { mutable insize: int; mutable offset: Int63.t; mutable reads: int; mutable writes: int; mutable write_left: int; mutable read_left:...
43280c922074d909c6720f5ca87a1a8f7448393b06ad59f26028493867836c75
chesseye/chesseye
slowdown.ml
let () = let d = if Array.length Sys.argv = 2 then try float_of_string Sys.argv.(1) with _ -> 0.1 else 0.1 in try while true do let line = input_line stdin in Thread.delay d; print_endline line done with | _ -> ()
null
https://raw.githubusercontent.com/chesseye/chesseye/23402e77292b1eb0758ecd61f30979166743c3b9/controller/slowdown.ml
ocaml
let () = let d = if Array.length Sys.argv = 2 then try float_of_string Sys.argv.(1) with _ -> 0.1 else 0.1 in try while true do let line = input_line stdin in Thread.delay d; print_endline line done with | _ -> ()
b56a3d14c2abc590266f96a081adfeabe6c4d3209cc7d85162c3ad81f259601e
bmeurer/ocaml-arm
profiling.ml
(***********************************************************************) (* *) (* OCaml *) (* *) and , INRIA R...
null
https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/tools/profiling.ml
ocaml
********************************************************************* OCaml ...
and , INRIA Rocquencourt Ported to Caml Special Light by and Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the GNU Library General Public License , with $ Id$...
bbac81af91faa72557faadb6c0dd80c616fdc1975ddb9b5817e7a13937642354
aib/Project-Euler
euler38.hs
import Data.Digits import Data.List import Common panmul x ys = concatMap (digits 10) . map (x*) $ ys muls = map (\x -> [1..x]) [2..9] panmuls x = map (panmul x) muls main = print $ concatMap show $ (last . sort) $ (filter (pandigital 9)) (concat feasibles) where feasibles = takeWhile (any (\x -> length x ...
null
https://raw.githubusercontent.com/aib/Project-Euler/a01a142d360f3a30fcea69ab29d4d198160ee921/euler38.hs
haskell
import Data.Digits import Data.List import Common panmul x ys = concatMap (digits 10) . map (x*) $ ys muls = map (\x -> [1..x]) [2..9] panmuls x = map (panmul x) muls main = print $ concatMap show $ (last . sort) $ (filter (pandigital 9)) (concat feasibles) where feasibles = takeWhile (any (\x -> length x ...
015cd4a39e5f17c3d77f1ec432871a112ef9a209ccb4da9a83fdd5c33109c346
CrossRef/cayenne
fundref.clj
(ns cayenne.ids.fundref (:require [cayenne.ids :as ids] [cayenne.ids.doi :as doi] [clojure.string :as string])) (def funder-prefix "10.13039") (defn id-to-doi [id] (str funder-prefix "/" id)) (defn id-to-doi-uri [id] (doi/to-long-doi-uri (id-to-doi id))) (defn doi-uri-to-id [doi]...
null
https://raw.githubusercontent.com/CrossRef/cayenne/02321ad23dbb1edd3f203a415f4a4b11ebf810d7/src/cayenne/ids/fundref.clj
clojure
(ns cayenne.ids.fundref (:require [cayenne.ids :as ids] [cayenne.ids.doi :as doi] [clojure.string :as string])) (def funder-prefix "10.13039") (defn id-to-doi [id] (str funder-prefix "/" id)) (defn id-to-doi-uri [id] (doi/to-long-doi-uri (id-to-doi id))) (defn doi-uri-to-id [doi]...
3859f2cfe12ca1073c7d73895d77e0b3ecd6fd4e0688d505c789fd397c22a5dd
WhatsApp/erlfmt
comments.erl
-module(comments). -export([ has_fanciness/1 ]). -export([ foo/1, bar/1, baz/1 ]). %% Constants -define(VERSION_CHECK_INTERVAL_MILLIS_DEFAULT, 10000). % Minimum interval between health checks -define(MAX_WRITE_FAILURES, 3). %% Cp stands for "codepoint" has_fanciness([Cp | Rest]) -> case wa_unicode:b...
null
https://raw.githubusercontent.com/WhatsApp/erlfmt/8efa327491aef58f149c032b24588e211975862d/test/erlfmt_SUITE_data/comments.erl
erlang
Constants Minimum interval between health checks Cp stands for "codepoint" comment comment comment other comment
-module(comments). -export([ has_fanciness/1 ]). -export([ foo/1, bar/1, baz/1 ]). -define(MAX_WRITE_FAILURES, 3). has_fanciness([Cp | Rest]) -> case wa_unicode:bidi_class(Cp) of Class when Class =:= 'L' TODO maybe invalidate if there is too many NSM ? -> has_f...
72d7dd84d3169882fac427cccb31dd38ea49cb4a90a2597bc2a4d80ed8a7670c
clojureverse/clojurians-log-app
indexer.clj
(ns clojurians-log.components.indexer (:require [com.stuartsierra.component :as component] [clojurians-log.datomic :as d] [clojurians-log.db.queries :as queries])) (defrecord Indexer [datomic] component/Lifecycle (start [this] (let [thread (Thread. (fn [] ...
null
https://raw.githubusercontent.com/clojureverse/clojurians-log-app/d34c9bd715e492c8f1899653548716d32c623fad/src/clojurians_log/components/indexer.clj
clojure
(ns clojurians-log.components.indexer (:require [com.stuartsierra.component :as component] [clojurians-log.datomic :as d] [clojurians-log.db.queries :as queries])) (defrecord Indexer [datomic] component/Lifecycle (start [this] (let [thread (Thread. (fn [] ...
aa5b6c60b05702ed0e3104d63d92f6023eee350069f7d616449db742afa1599d
ocaml-sf/learn-ocaml-corpus
choose_left.ml
To run a parser , one applies to the input ( a sequence of characters ) . This yields a computation in the [ NonDet ] monad . Running this computation yields a sequence of pairs of a result and a final cursor . Assuming that we are not interested in the final cursors , we can drop them , yielding a seq...
null
https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/parser_combinators/wrong/choose_left.ml
ocaml
drop every final cursor The type [parser] satisfies the monad API: [delay], [return], [>>=]. [delay p] behaves like [p()], except the construction of the monadic computation is delayed until the moment when this computation is run. [return a] always succeeds, consumes no input, and returns [a]. [p >>= f] is...
To run a parser , one applies to the input ( a sequence of characters ) . This yields a computation in the [ NonDet ] monad . Running this computation yields a sequence of pairs of a result and a final cursor . Assuming that we are not interested in the final cursors , we can drop them , yielding a seq...
7662108b4f66a4d52a355f9127680fcbdaa53533b9cb1b0cc0aabced958a7c77
tschady/advent-of-code
d09_test.clj
(ns aoc.2018.d09-test (:require [aoc.2018.d09 :as sut] [clojure.test :refer :all])) (deftest ^:slow part1-examples (are [output input] (= output (sut/part-1 input)) 32 "9 players; last marble is worth 25 points" 8317 "10 players; last marble is worth 1618 points" 146373 "13 players; l...
null
https://raw.githubusercontent.com/tschady/advent-of-code/1e4a95ef580c3bf635837eff52aa998b0acfc666/test/aoc/2018/d09_test.clj
clojure
(ns aoc.2018.d09-test (:require [aoc.2018.d09 :as sut] [clojure.test :refer :all])) (deftest ^:slow part1-examples (are [output input] (= output (sut/part-1 input)) 32 "9 players; last marble is worth 25 points" 8317 "10 players; last marble is worth 1618 points" 146373 "13 players; l...
47ae0a73563ed739e5bea7ddc15fd0680e7907b67533e79ab2489205d9e94a3e
Sudha247/ocaml5-tutorial-icfp-22
counter_mutable_lock_parallel.ml
let n = try int_of_string Sys.argv.(1) with _ -> 10000 let v = ref 0 let m = Mutex.create () let incr n () = for _i = 1 to n do Mutex.lock m; incr v; Mutex.unlock m done let () = let domains = Array.init 4 (fun _ -> Domain.spawn (incr n)) in incr n (); Array.iter Domain.join domains; Printf.p...
null
https://raw.githubusercontent.com/Sudha247/ocaml5-tutorial-icfp-22/7f04991a10270e5f5be0d2b1b6d931b242f4d3a2/code/parallel/counter_mutable_lock_parallel.ml
ocaml
let n = try int_of_string Sys.argv.(1) with _ -> 10000 let v = ref 0 let m = Mutex.create () let incr n () = for _i = 1 to n do Mutex.lock m; incr v; Mutex.unlock m done let () = let domains = Array.init 4 (fun _ -> Domain.spawn (incr n)) in incr n (); Array.iter Domain.join domains; Printf.p...
ec1db4df256fbdbcda3427019a6a8bc60076ea4c709cc502811c0e91f171d2d6
TeMPOraL/alice
person.lisp
(in-package #:alice) ;;; TODO somewhen. (defclass person () () )
null
https://raw.githubusercontent.com/TeMPOraL/alice/4621a53ccd459bebf0b34c531dab49f7b42f35c7/core/person.lisp
lisp
TODO somewhen.
(in-package #:alice) (defclass person () () )
3c200ca5f80f528abd8f8425700b258429591e1fec1624d0ac2be98035b59c9a
haskell-tls/hs-tls
TLS.hs
# LANGUAGE CPP # -- | -- Module : Network.TLS -- License : BSD-style Maintainer : < > -- Stability : experimental -- Portability : unknown -- Native Haskell TLS and SSL protocol implementation for server and -- client. -- -- This provides a high-level implementation of a sensitive security -- protoc...
null
https://raw.githubusercontent.com/haskell-tls/hs-tls/31e95f40b75b541c9817b6b56c363e74c2f3b57d/core/Network/TLS.hs
haskell
| Module : Network.TLS License : BSD-style Stability : experimental Portability : unknown client. This provides a high-level implementation of a sensitive security protocol, eliminating a common set of security issues through the use of the advanced type system, high level constructions and Som...
# LANGUAGE CPP # Maintainer : < > Native Haskell TLS and SSL protocol implementation for server and common features . Currently implement the SSL3.0 , TLS1.0 , TLS1.1 , TLS1.2 and TLS 1.3 protocol , and support RSA and ( Elliptic curve and regular ) Diffie Hellman key exchanges , and many extensions ...
d9a69f56978baaad48a1a24ad720edbee64d06862ef424fe637bc436ffce66b2
ztellman/penumbra
async.clj
Copyright ( c ) . All rights reserved . ;; The use and distribution terms for this software are covered by the ;; Eclipse Public License 1.0 (-1.0.php) ;; which can be found in the file epl-v10.html at the root of this distribution. ;; By using this software in any fashion, you are agreeing to be bound by...
null
https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/test/example/app/async.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove ...
Copyright ( c ) . All rights reserved . (ns example.app.async (:use [penumbra opengl]) (:require [penumbra.app :as app])) (defn quad [] (push-matrix (translate -0.5 -0.5 0.5) (normal 0 0 1) (vertex 0 0) (vertex 1 0) (vertex 1 1) (vertex 0 1))) (defn cube [] (push-matrix (draw-quads (...
c8af46df8e082e91aac2acbca2bf660095f1e359637381cf3f5ff86690b8ddff
tonyg/racket-explorer
frame.rkt
#lang racket/gui ;; frame% subclasses specialized for explorers and similar tools. (provide tool-frame% default-make-tool-keymap current-make-tool-keymap) (define tool-frame% (class frame% (field [keymap ((current-make-tool-keymap))]) (super-new) (define/override (on-subwindow-char rec...
null
https://raw.githubusercontent.com/tonyg/racket-explorer/2a1836d01a7ff2ed025a67cc5f06c38b56776b2d/explorer/frame.rkt
racket
frame% subclasses specialized for explorers and similar tools. augh ^ Heck. This overrides the :c:w Unix emacs-style binding to cut-clipboard.
#lang racket/gui (provide tool-frame% default-make-tool-keymap current-make-tool-keymap) (define tool-frame% (class frame% (field [keymap ((current-make-tool-keymap))]) (super-new) (define/override (on-subwindow-char receiver event) (or (send keymap handle-key-event this event) ...
5a0f2b3adb6e6bba40fd11b6d10176e6b27052e2c4cee1cc44fe02cb26a585a9
BillHallahan/G2
SimplePoly.hs
module SimplePoly where data S a = S a {-@ s :: {s:S Int | 0 /= 0} @-} s :: S Int s = S 0 {-@ measure sget @-} sget :: S a -> a sget (S x) = x {-@ sset :: x:Int -> {s:S Int | sget s /= 7 } @-} sset :: Int -> S Int sset x = S x data Pair a b = Pair a b {-@ p :: {p:Pair Int Int | 0 /= 0} @-} p :: Pair Int Int p = P...
null
https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/Liquid/SimplePoly.hs
haskell
@ s :: {s:S Int | 0 /= 0} @ @ measure sget @ @ sset :: x:Int -> {s:S Int | sget s /= 7 } @ @ p :: {p:Pair Int Int | 0 /= 0} @ @ measure pfst @ @ switch :: x:Pair a a -> {v:Pair a a | pfst x /= psnd v} @
module SimplePoly where data S a = S a s :: S Int s = S 0 sget :: S a -> a sget (S x) = x sset :: Int -> S Int sset x = S x data Pair a b = Pair a b p :: Pair Int Int p = Pair 0 0 @ snd2Int : : x : Int - > { y : Int | x /= y } - > { z : Int | y /= z } @ snd2Int :: Int -> Int -> Int snd2Int x y = snd2 x y snd2 :...
af3fa3142313a375137c7978afd3a98f5a8c6092e380363b711e1098a81aa2ee
fizruk/rzk
Example.hs
# LANGUAGE FlexibleContexts # {-# LANGUAGE OverloadedStrings #-} module Rzk.Free.Example where import Control.Monad.Trans (lift) import Data.String (IsString) import Data.Text.Prettyprint.Doc (Pretty) import Rzk.Free.Parser import Rzk.Free.Syntax...
null
https://raw.githubusercontent.com/fizruk/rzk/cb929e11ccafd43be8ce815ecd4abad81f879d95/rzk/src/Rzk/Free/Example.hs
haskell
# LANGUAGE OverloadedStrings # $setup * Example terms >) :: Term b a -> Term b a -> Term b a > b = Pi a (lift b) > ( Universe -- > Universe ) > UnitType ) | Type and term individually: >>> ex2 λx₁ → refl_{x₁ U : UNIT} >>> ex2Type (x₁ : (x₁ : U) → UNIT) → unit =_{UNIT} x₁ U : U Trying to typecheck: >>> un...
# LANGUAGE FlexibleContexts # module Rzk.Free.Example where import Control.Monad.Trans (lift) import Data.String (IsString) import Data.Text.Prettyprint.Doc (Pretty) import Rzk.Free.Parser import Rzk.Free.Syntax.Term import Rzk.Free.Typ...
6464bcb57fa63f39205d449fc289e05758c4fbe04e58e767155a9ba7201dbe6f
gleber/exat
aclscanner.erl
%% %% %%---------------------------------------------------------------------- %% eXAT , an erlang eXperimental Agent Tool Copyright ( C ) 2005 - 07 ( ) %% %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free So...
null
https://raw.githubusercontent.com/gleber/exat/a7ccf4807a321934d9a69fada59103f580d7fcce/src/aclscanner.erl
erlang
---------------------------------------------------------------------- This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN...
eXAT , an erlang eXperimental Agent Tool Copyright ( C ) 2005 - 07 ( ) it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or You should have received a copy of the GNU General Public License -module(aclscanner). -export([s...
382c9087f886f44a9f83d7d49d19198388554323bbe989c1a6595ff1b4cfb338
Clojure2D/clojure2d-examples
ray.clj
(ns rt4.the-rest-of-your-life.ch02a.ray (:require [fastmath.vector :as v] [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol RayProto (at [ray t])) (defrecord Ray [origin direction ^double time] RayProto (at [_ ...
null
https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/f47e1655902cc6bf1590aaecc144ac274ed3af66/src/rt4/the_rest_of_your_life/ch02a/ray.clj
clojure
(ns rt4.the-rest-of-your-life.ch02a.ray (:require [fastmath.vector :as v] [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol RayProto (at [ray t])) (defrecord Ray [origin direction ^double time] RayProto (at [_ ...
b994720ce3dcce0f360b18da30abdedf82f728a51c6ae4d23cb5ac2c33dce1df
ocamllabs/ocaml-modular-implicits
quicksort.ml
(***********************************************************************) (* *) (* OCaml *) (* *) , projet ...
null
https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/misc-unsafe/quicksort.ml
ocaml
********************************************************************* OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . let rec qsort lo hi (a : int array) = ...
380f11587e8e2e56bc757880f6fc52532f233b6d201de3d2efd9571067321fff
bsansouci/bsb-native
includemod.ml
(***********************************************************************) (* *) (* OCaml *) (* *) , projet ...
null
https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/typing/includemod.ml
ocaml
********************************************************************* OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . open Misc open Path open Typedtree ope...
8a439ebfa15fb413895e784853c5a8937a5465c5d63eb819b5a1546255ee8cb0
clojure-interop/aws-api
AWSServerMigration.clj
(ns com.amazonaws.services.servermigration.AWSServerMigration "Interface for accessing SMS. Note: Do not directly implement this interface, new methods are added to it regularly. Extend from AbstractAWSServerMigration instead. AAWS Sever Migration Service This is the AWS Sever Migration Service API Refere...
null
https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.servermigration/src/com/amazonaws/services/servermigration/AWSServerMigration.clj
clojure
(ns com.amazonaws.services.servermigration.AWSServerMigration "Interface for accessing SMS. Note: Do not directly implement this interface, new methods are added to it regularly. Extend from AbstractAWSServerMigration instead. AAWS Sever Migration Service This is the AWS Sever Migration Service API Refere...
3651e882acba1ac50a6b3cc1493314697ccd4ed50ed88086924c7e89a39aa452
drathier/elm-offline
Expression.hs
# OPTIONS_GHC -Wall # {-# LANGUAGE OverloadedStrings #-} module Canonicalize.Expression ( canonicalize , FreeLocals , Uses(..) , verifyBindings , gatherTypedArgs ) where import Control.Monad (foldM) import qualified Data.Graph as Graph import qualified Data.List as List import qualified Data.Map.Strict ...
null
https://raw.githubusercontent.com/drathier/elm-offline/f562198cac29f4cda15b69fde7e66edde89b34fa/compiler/src/Canonicalize/Expression.hs
haskell
# LANGUAGE OverloadedStrings # RESULTS # UNPACK # # UNPACK # CANONICALIZE CANONICALIZE IF BRANCH CANONICALIZE CASE BRANCH CANONICALIZE BINOPS CANONICALIZE LET ADD BINDINGS GATHER TYPED ARGS DETECT CYCLES so we just keep going until we get to the edges LOG VARIABLE USES MANAGING BINDINGS NOTE: Uses Map.size...
# OPTIONS_GHC -Wall # module Canonicalize.Expression ( canonicalize , FreeLocals , Uses(..) , verifyBindings , gatherTypedArgs ) where import Control.Monad (foldM) import qualified Data.Graph as Graph import qualified Data.List as List import qualified Data.Map.Strict as Map import qualified Data.Map.St...
e5ef8a7028d9f1c4a77bccb62f94e7791cec79c09b55f9ce509d9a2931ec0430
nikomatsakis/a-mir-formality
hook.rkt
#lang racket (require redex/reduction-semantics "../grammar.rkt" "../env.rkt" "../hook.rkt" "unify.rkt") (provide env-with-clauses-and-invariants EmptyEnv ) (define-metafunction formality-logic ;; Creates a suitable env for testing the formality-logic layer ;; that has the given clauses + invaria...
null
https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/9932f8621db162160215c60c323acad56903a4ca/racket-src/logic/test/hook.rkt
racket
Creates a suitable env for testing the formality-logic layer that has the given clauses + invariants as the program. no elaborating relations in tests no built-in predicates A suitable env for testing the formality-logic layer in isolation with no clauses nor invariants. The "grammar" for predicates is just *any...
#lang racket (require redex/reduction-semantics "../grammar.rkt" "../env.rkt" "../hook.rkt" "unify.rkt") (provide env-with-clauses-and-invariants EmptyEnv ) (define-metafunction formality-logic env-with-clauses-and-invariants : Clauses Invariants -> Env [(env-with-clauses-and-invariants Clauses ...
b34467ed7eebe5a7f1c95dd29b4dbebae7964fb2ea6040060713a91dbed10021
ermine/sulci
test.ml
module Elt = struct type t = int let compare = compare end module Ints = Treap.Set(Elt) let _ = Random.self_init (); let t = List.fold_left (fun t elt -> (try let e, p = Ints.get_root t in Printf.printf "Root %d %d\n" e p ...
null
https://raw.githubusercontent.com/ermine/sulci/3ee4bd609b01e2093a6d37bf74579728d0a93b70/libs/treap/test.ml
ocaml
module Elt = struct type t = int let compare = compare end module Ints = Treap.Set(Elt) let _ = Random.self_init (); let t = List.fold_left (fun t elt -> (try let e, p = Ints.get_root t in Printf.printf "Root %d %d\n" e p ...
09c4571461ba96ec31fa0429245f15f22ba22c967540bbdf3d290dda83827db5
xxyzz/SICP
Exercise_4_3.rkt
#lang racket/base (define table (make-hash)) (define (put op type item) (hash-set! table (list op type) item)) (define (get op type) (hash-ref table (list op type))) (define (has op type) (hash-has-key? table (list op type))) (define (self-evaluating? exp) (cond [(number? exp) #t] [(string? exp) #t] ...
null
https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/4_Metalinguistic_Abstraction/4.1_The_Metacircular_Evaluator/Exercise_4_3.rkt
racket
formal parameters body no clause
#lang racket/base (define table (make-hash)) (define (put op type item) (hash-set! table (list op type) item)) (define (get op type) (hash-ref table (list op type))) (define (has op type) (hash-has-key? table (list op type))) (define (self-evaluating? exp) (cond [(number? exp) #t] [(string? exp) #t] ...
2caf5ff64f05f485a9b438c5bade4fffac6cb25416027b74d8839e7b35cc23c2
incoherentsoftware/defect-process
Types.hs
module Menu.SettingsMenu.ControlsTab.Types ( ControlsKeyButton(..) , ControlsSubSelection(..) , SettingsControlsTab(..) ) where import qualified Data.IntMap as IM import Menu.SettingsMenu.ControlsTab.KeyButtons import Menu.SettingsMenu.Util import Window.Graphics import Window.Graphics.UiControls impo...
null
https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Menu/SettingsMenu/ControlsTab/Types.hs
haskell
module Menu.SettingsMenu.ControlsTab.Types ( ControlsKeyButton(..) , ControlsSubSelection(..) , SettingsControlsTab(..) ) where import qualified Data.IntMap as IM import Menu.SettingsMenu.ControlsTab.KeyButtons import Menu.SettingsMenu.Util import Window.Graphics import Window.Graphics.UiControls impo...
cbc460a56760e28825b075335c2316050e71ff83cfd263f54cbd20d0a9bad7fa
mbj/stratosphere
FrameCaptureGroupSettingsProperty.hs
module Stratosphere.MediaLive.Channel.FrameCaptureGroupSettingsProperty ( module Exports, FrameCaptureGroupSettingsProperty(..), mkFrameCaptureGroupSettingsProperty ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SO...
null
https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/medialive/gen/Stratosphere/MediaLive/Channel/FrameCaptureGroupSettingsProperty.hs
haskell
# SOURCE # # SOURCE #
module Stratosphere.MediaLive.Channel.FrameCaptureGroupSettingsProperty ( module Exports, FrameCaptureGroupSettingsProperty(..), mkFrameCaptureGroupSettingsProperty ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import Strato...
19c0ce847d95fb70a69e3a7b949dc6f778d76824a6b08a59929ce05174d17312
paypal/seazme-hub
biz.clj
(ns seazme.hub.biz (:require [ring.util.http-response :refer [ok not-found accepted bad-request]] [clj-uuid :as uuid] [seazme.common.hbase :as hb] [seazme.common.config :as config] [digest :as d] [clojure.tools.logging :as log] [clj-time.format :...
null
https://raw.githubusercontent.com/paypal/seazme-hub/28df31530e87bb23c32275e547803d399de3fa66/src/main/clojure/seazme/hub/biz.clj
clojure
constants has to be a multiple of time-span those are constants per API version, never change in mid-flight interface internal stats, sessions, sizes, counts, etc TODO during truncation, HBASE tables are disabled and scan fails, handle it, also org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsExceptio...
(ns seazme.hub.biz (:require [ring.util.http-response :refer [ok not-found accepted bad-request]] [clj-uuid :as uuid] [seazme.common.hbase :as hb] [seazme.common.config :as config] [digest :as d] [clojure.tools.logging :as log] [clj-time.format :...
3a8c782895effde35df76b1fbdf800939e5286e686f27c35b3658bb7b1276f6c
noinia/hgeometry
Types.hs
# LANGUAGE TemplateHaskell # # LANGUAGE UndecidableInstances # -------------------------------------------------------------------------------- -- | -- Module : Algorithms.Geometry.WellSeparatedPairDecomposition.Types Copyright : ( C ) -- License : see the LICENSE file Maintainer : -- -- D...
null
https://raw.githubusercontent.com/noinia/hgeometry/a6abecb1ce4a7fd96b25cc1a5c65cd4257ecde7a/hgeometry/src/Algorithms/Geometry/WellSeparatedPairDecomposition/Types.hs
haskell
------------------------------------------------------------------------------ | Module : Algorithms.Geometry.WellSeparatedPairDecomposition.Types License : see the LICENSE file Data types that can represent a well separated pair decomposition (wspd). ---------------------------------------------------...
# LANGUAGE TemplateHaskell # # LANGUAGE UndecidableInstances # Copyright : ( C ) Maintainer : FIXME : This module should be internal and not exposed . Fix after 2021 - 06 - 01 . module Algorithms.Geometry.WellSeparatedPairDecomposition.Types # DEPRECATED " This module will be deleted after 2021 - 0...
86d4eb469a1f033ce902dfc15cff660edd528c7da1b1c9a6a48e60cbe92438ec
seckcoder/iu_c311
exception.rkt
#lang eopl (require racket/match) (provide make-exception-handler exception-handler-push! exception-handler-pop! initialize-exception-handlers! lookup-exception-handler!) (define exception-handlers '()) default exceptions : 1 - 100 1 : no exp in compound exp 2 : divide by z...
null
https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/c5_43/exception.rkt
racket
#lang eopl (require racket/match) (provide make-exception-handler exception-handler-push! exception-handler-pop! initialize-exception-handlers! lookup-exception-handler!) (define exception-handlers '()) default exceptions : 1 - 100 1 : no exp in compound exp 2 : divide by z...
5ec3d04b3d7736fad96858a8700ec29d0edb0d723ca930d14ef992dce2eaa88e
potapenko/playphraseme-site
dates_util.clj
(ns playphraseme.common.dates-util (:require [clj-time.core :as t] [clj-time.format :as f] [clj-time.coerce :as c] [clj-time.predicates :as pr] [clojure.core.match :refer [match]])) (defn date-time? [tm] (or (instance? org.joda.time.LocalDateTime tm) (instance?...
null
https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/common/dates_util.clj
clojure
(ns playphraseme.common.dates-util (:require [clj-time.core :as t] [clj-time.format :as f] [clj-time.coerce :as c] [clj-time.predicates :as pr] [clojure.core.match :refer [match]])) (defn date-time? [tm] (or (instance? org.joda.time.LocalDateTime tm) (instance?...
15164807150bc42b73c5d12e3fe6cd9ddefcf6ac915c62e89e17e6c49fdc3bea
ejgallego/coq-serapi
ser_locality.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/ejgallego/coq-serapi/61d2a5c092c1918312b8a92f43a374639d1786f9/serlib/ser_locality.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** ************************************...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright 2016 - 2020 MINES...
6d379837d347e1aee4ecbd4c4a104fc2ae0c19e7030c5b6ca607530748d727f2
csgordon/cayenne
IOUtil.hs
Copyright ( c ) 1982 - 1999 , -- See LICENSE for the full license. -- module Libs.IOUtil(progArgs) where -- Some utilities that are a little dirty, but not very. import IO import System.IO.Unsafe import System.Environment progArgs :: [String] --progArgs = hdl getArgs [] progArgs = unsafePerformIO getArgs hdl : ...
null
https://raw.githubusercontent.com/csgordon/cayenne/7fdf59b5e21124b5caa9f776199a30cd0e5d88b2/Libs/IOUtil.hs
haskell
See LICENSE for the full license. Some utilities that are a little dirty, but not very. progArgs = hdl getArgs []
Copyright ( c ) 1982 - 1999 , module Libs.IOUtil(progArgs) where import IO import System.IO.Unsafe import System.Environment progArgs :: [String] progArgs = unsafePerformIO getArgs hdl : : IO a - > a - > a hdl io def = unsafePerformIO ( catch io ( \err - > return def ) )
a6c5ffbd200bc48f52ade4f25dd8c68b1508edf708bb7642c1407fef6c99bec9
hspec/hspec-wai
WaiSpec.hs
{-# LANGUAGE OverloadedStrings #-} module Test.Hspec.WaiSpec (main, spec) where import Test.Hspec import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as BL import Network.HTTP.Types import Network.Wai import Test.Hspec.Wai import Test.H...
null
https://raw.githubusercontent.com/hspec/hspec-wai/b14c1720376a6535fb63348ea599cfaf04ac1955/test/Test/Hspec/WaiSpec.hs
haskell
# LANGUAGE OverloadedStrings #
module Test.Hspec.WaiSpec (main, spec) where import Test.Hspec import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as BL import Network.HTTP.Types import Network.Wai import Test.Hspec.Wai import Test.Hspec.Wai.Internal (withApplication)...
6a71e215ef65461fdc0c27b59a02f2b6ea82fa2febbe96fc5ddae88cb3dd2062
obsidiansystems/hydra-pay
Server.hs
-- | # LANGUAGE GeneralisedNewtypeDeriving # # LANGUAGE DataKinds # # LANGUAGE TemplateHaskell # # LANGUAGE TypeFamilies # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # {-# LANGUAGE RankNTypes #-} # LANGUAGE PartialTypeSignatures # module HydraPay.Server where import System.Exit (ExitCode(..)) import Cryp...
null
https://raw.githubusercontent.com/obsidiansystems/hydra-pay/263ccf817c5ed447b1bb2f433253b0cde749082a/backend/src/HydraPay/Server.hs
haskell
| # LANGUAGE RankNTypes # | The location where we store cardano and hydra keys | State we need to run/manage Heads ^ The process handles of the try-out/livedoc Cardano devnet node, if any. ^ This is really temporary it has the mapping from cardano address to proxy + keys ^ This is really temporary until we stuff ...
# LANGUAGE GeneralisedNewtypeDeriving # # LANGUAGE DataKinds # # LANGUAGE TemplateHaskell # # LANGUAGE TypeFamilies # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # # LANGUAGE PartialTypeSignatures # module HydraPay.Server where import System.Exit (ExitCode(..)) import Crypto.Random import qualified Data.B...
c9c45a85601d1445fba183376898db57dd4e1385f5a7077953a985e87590f920
goblint/analyzer
hashcons.ml
ocamlbuild -pkg batteries hashcons.native & & ./hashcons.native let pdump s x = Printf.printf "dump %s = %s\n" s (Batteries.dump x) module A = struct type s = A | B of int let x = B 1 let y = B 1 let z = B 2 let c i = B i module HC = BatHashcons.MakeTable (struct type t = s let equal x y = compare x y ...
null
https://raw.githubusercontent.com/goblint/analyzer/0668b5b44e483ae26a4edac32cd13dc7b0560fbb/bench/hashcons/hashcons.ml
ocaml
true true true this already leads to different hashes for x and y because of the different insert order
ocamlbuild -pkg batteries hashcons.native & & ./hashcons.native let pdump s x = Printf.printf "dump %s = %s\n" s (Batteries.dump x) module A = struct type s = A | B of int let x = B 1 let y = B 1 let z = B 2 let c i = B i module HC = BatHashcons.MakeTable (struct type t = s let equal x y = compare x y ...
0e3e20702a890b3a30cab7970709722cad8f9b0bad3a5bffda03159103264f71
uhc/uhc
Unsafe.hs
# LANGUAGE NoImplicitPrelude , CPP # # OPTIONS_GHC -XNoImplicitPrelude # ----------------------------------------------------------------------------- -- | Module : System . Copyright : ( c ) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Mainta...
null
https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/ehclib/uhcbase/System/IO/Unsafe.hs
haskell
--------------------------------------------------------------------------- | License : BSD-style (see the file libraries/base/LICENSE) Maintainer : Stability : provisional Portability : portable \"Unsafe\" IO operations. --------------------------------------------------------------------------- ...
# LANGUAGE NoImplicitPrelude , CPP # # OPTIONS_GHC -XNoImplicitPrelude # Module : System . Copyright : ( c ) The University of Glasgow 2001 module System.IO.Unsafe ( ) where #ifdef __GLASGOW_HASKELL__ import GHC.IOBase (unsafePerformIO, unsafeInterleaveIO) #endif #ifdef __HUGS__ import Hugs.IOExt...
56baca90c10a692c14bcf7ad507d60853115604ddde51da08a550599641817d9
EveryTian/Haskell-Codewars
the-fusc-function-part-1.hs
-- -fusc-function-part-1 module Fusc where fusc :: Int -> Int fusc 0 = 0 fusc 1 = 1 fusc m | even m = let n = div m 2 in fusc n | otherwise = let n = (m - 1) `div` 2 in fusc n + fusc (n + 1)
null
https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/7kyu/the-fusc-function-part-1.hs
haskell
-fusc-function-part-1
module Fusc where fusc :: Int -> Int fusc 0 = 0 fusc 1 = 1 fusc m | even m = let n = div m 2 in fusc n | otherwise = let n = (m - 1) `div` 2 in fusc n + fusc (n + 1)
b37baefcc947bf7394d17d059906c5c24a5bdf1c89671c19df59c5d69b6a4097
klarna-incubator/bec
bitbucket.erl
%%============================================================================== %% A more sane Erlang API towards BitBucket %%============================================================================== -module(bitbucket). -include_lib("kernel/include/logger.hrl"). %%===============================================...
null
https://raw.githubusercontent.com/klarna-incubator/bec/1752d84384dfc196f83579803b77be256e25d9fe/src/bitbucket.erl
erlang
============================================================================== A more sane Erlang API towards BitBucket ============================================================================== ============================================================================== Exports ================================...
-module(bitbucket). -include_lib("kernel/include/logger.hrl"). get_ssh_keys/2 , set_ssh_keys/3 , get_default_branch/2 , set_default_branch/3 Workzone Branch Reviewers , get_wz_branch_reviewers/2 , set_wz_branch_reviewers/3 , get_branch_restrictions/2 ...
40aa79034694d668310ec0cb8e73ae059e447487f06bc55996ddf1710aa60592
padsproj/oforest
ppx_forest.mli
(** Ppx_forest defines the [forest_mapper], which finds structures with [forest] and [skin] extensions and expands them to OCaml ASTs. *) val forest_mapper : string list -> Ast_mapper.mapper
null
https://raw.githubusercontent.com/padsproj/oforest/e10abf1c35f6d49d4bdf13d51cab44487629b3a3/ppx/ppx_forest.mli
ocaml
* Ppx_forest defines the [forest_mapper], which finds structures with [forest] and [skin] extensions and expands them to OCaml ASTs.
val forest_mapper : string list -> Ast_mapper.mapper
d120ac124a841f68eb3d05e74bc51104ba2074ba60c5fd9cce81f58d7eb6c6e1
google/haskell-trainings
Solution.hs
Copyright 2021 Google LLC -- 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 und...
null
https://raw.githubusercontent.com/google/haskell-trainings/214013fc324fd6c8f63b874a58ead0c1d3e6788c/haskell_101/codelab/02_datatypes/src/Solution.hs
haskell
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 2021 Google LLC Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_GHC -fno - warn - unused - matches # # OPTIONS_GHC -fno - warn - unused - binds # # OPTI...
5a6df487d0dd9f4812d04c6439cde5fc181dcdbda9b0fdb0082e76cdd6492a37
scicloj/metamorph.ml
ml.clj
(ns scicloj.metamorph.ml (:require [clojure.string :as str] [pppmap.core :as ppp] [scicloj.metamorph.core :as mm] [scicloj.metamorph.ml.ensemble] [scicloj.metamorph.ml.evaluation-handler] [scicloj.metamorph.ml.loss :as loss] [scicloj.metamorph.ml.malli :as malli] [scicloj.metamorph.ml.tools :r...
null
https://raw.githubusercontent.com/scicloj/metamorph.ml/7407548977d561a3e41fac4adb038bdea88adf2d/src/scicloj/metamorph/ml.clj
clojure
scicloj.ml.smile specific model => {:feature-columns [:abstract], :id #uuid "39cb58e1-a292-4b07-bede-3a0d534f0a79", :model-data {:classes ["yes" "no"]}, :thawed-model #object[ai.djl.fasttext.FtModel 0x72e18cd7 "Model (\n\tName: is-primary-fasttext-model\n\tmodel-type: sup\n)"], :target-col...
(ns scicloj.metamorph.ml (:require [clojure.string :as str] [pppmap.core :as ppp] [scicloj.metamorph.core :as mm] [scicloj.metamorph.ml.ensemble] [scicloj.metamorph.ml.evaluation-handler] [scicloj.metamorph.ml.loss :as loss] [scicloj.metamorph.ml.malli :as malli] [scicloj.metamorph.ml.tools :r...
0eec8a44af1d04bd57cc3b4bd2f1dffb0f34beb3f0c0fb25d83f4ef099fa82d7
jonase/eastwood
f05.clj
(ns testcases.f05 (:require [clojure.set :as set])) The combination of two classes named IInterval and IIntervals , with ;; one being the same as the other except with an "s" appended, used to exhibit a bug in tools.analyzer before ticket TANAL-7 was fixed . ;; The code is copied and modified from part of the li...
null
https://raw.githubusercontent.com/jonase/eastwood/c5b7d9f8ad8f8b38dc7138d853cc65f6987d6058/cases/testcases/f05.clj
clojure
one being the same as the other except with an "s" appended, used The code is copied and modified from part of the library issue.
(ns testcases.f05 (:require [clojure.set :as set])) The combination of two classes named IInterval and IIntervals , with to exhibit a bug in tools.analyzer before ticket TANAL-7 was fixed . core.logic , which I was testing on when I discovered this (alias 'core 'clojure.core) (defprotocol IMergeDomains (-...
a2f56b12a436e88855cd62731ac20aa62f4a15d4a73c4f5fc561fa705abae514
mzp/coq-ide-for-ios
numbers_syntax.ml
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/plugins/syntax/numbers_syntax.ml
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** int31 stuff bigN stuff number of...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * i $ I d : numbers_syntax.ml 1...
806b1613730a363e8a1424f949288cbf7b2bacb020e7300f51eef4a89ff8170e
bsansouci/bsb-native
a.ml
(***********************************************************************) (* *) (* ocamlbuild *) (* *) , , projet Galliu...
null
https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/ocamlbuild/test/test5/a.ml
ocaml
********************************************************************* ocamlbuild ...
, , projet Gallium , INRIA Rocquencourt Copyright 2007 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . let a = 42 + Stack.stack
b7092df6b8cfbe26a161c2f98d7f11b749eb4807ddebc68d758688f1702f1143
pmundkur/flowcaml
subst.ml
(**************************************************************************) (* *) (* *) , Projet C...
null
https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-flowcaml/types/subst.ml
ocaml
************************************************************************ et en Automatique. All ri...
, Projet Cristal , INRIA Rocquencourt Copyright 2002 , 2003 Institut National de Recherche en Informatique under the terms of the Q Public License version 1.0 . $ I d : subst.ml , v 1.5 2003/06/26 13:...
f7195c72f3e448cb452ffb140ddcf0b7d1851221e06250e2cb6e272014f552b2
etnt/gettext
gettext_checker.erl
%% ------------------------------------------------------------------------- %% Permission is hereby granted, free of charge, to any person obtaining a %% copy of this software and associated documentation files (the " Software " ) , to deal in the Software without restriction , including %% without limitation the ri...
null
https://raw.githubusercontent.com/etnt/gettext/9ab211734cf59415617b47c06f77504dd442b40f/src/gettext_checker.erl
erlang
------------------------------------------------------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the without limitation the rights to use, copy, modify, merge, publish, following conditions: The above copy...
" Software " ) , to deal in the Software without restriction , including distribute , sublicense , and/or sell copies of the Software , and to permit persons to whom the Software is furnished to do so , subject to the in all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " ,...
09f8f2add5b691b5f06e1d8bd77f21affaf50958dccaec884aa248953f0b68e2
basho/riak_kv
riak_kv_app.erl
%% ------------------------------------------------------------------- %% riak_app : application startup for Riak %% Copyright ( c ) 2007 - 2010 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 this file ...
null
https://raw.githubusercontent.com/basho/riak_kv/0a5f60faeb11a59ce15acf249c9464f58853c609/src/riak_kv_app.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 permissi...
riak_app : application startup for Riak Copyright ( c ) 2007 - 2010 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 ,...
4a6704785e92bd9452fd841f1a7259925107cae14fb119075396818bb9a0d50d
TrustInSoft/tis-kernel
Region.mli
(**************************************************************************) (* *) This file is part of . (* *) is a fork of Frama - C. Al...
null
https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/wp/Region.mli
ocaml
************************************************************************ ...
This file is part of . is a fork of Frama - C. All the differences are : Copyright ( C ) 2016 - 2017 is released under GPLv2 This file is part of WP plug - in of Frama - C. Copyright ( C ) 2007 - 2015 ...
7f896570df2d0fa6e2900fd1c34648174915e4bbcc80708d28a496c7b3c8ae08
jacekschae/learn-reitit-course-files
db.clj
(ns cheffy.conversation.db (:require [next.jdbc.sql :as sql] [next.jdbc :as jdbc])) (defmulti dispatch (fn [[name _db _data]] name)) (defmethod dispatch :find-conversation-by-uid [[_ db {:keys [uid]}]] (with-open [conn (jdbc/get-connection db)] (let [conversations (sql/find-by-keys conn :convers...
null
https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/51-list-conversations-alternative/src/cheffy/conversation/db.clj
clojure
(ns cheffy.conversation.db (:require [next.jdbc.sql :as sql] [next.jdbc :as jdbc])) (defmulti dispatch (fn [[name _db _data]] name)) (defmethod dispatch :find-conversation-by-uid [[_ db {:keys [uid]}]] (with-open [conn (jdbc/get-connection db)] (let [conversations (sql/find-by-keys conn :convers...
fe4dc1d252bff5ed393fafb5b23fe27de4e090ecb7813be5b8c5d79ebf8f57c5
simmone/racket-simple-qr
transform.rkt
#lang racket (let ([data_map (make-hash)]) (with-input-from-file "capacity_table.txt" (lambda () (let ([version ""]) (let loop ([line (regexp-replace* #rx"\r|\n" (read-line) "")]) (when (not (eof-object? line)) (let ([items (regexp-split #rx"\t" line)]) (...
null
https://raw.githubusercontent.com/simmone/racket-simple-qr/904f1491bc521badeafeabd0d7d7e97e3d0ee958/simple-qr/write/lib/func/capacity/transform.rkt
racket
#lang racket (let ([data_map (make-hash)]) (with-input-from-file "capacity_table.txt" (lambda () (let ([version ""]) (let loop ([line (regexp-replace* #rx"\r|\n" (read-line) "")]) (when (not (eof-object? line)) (let ([items (regexp-split #rx"\t" line)]) (...
c91b2fbba32845edfd971ebbfc82912443efede6e272307bf0bd74b1c08d83e5
clojure-emacs/haystack
util_test.cljc
(ns haystack.parser.util-test (:require [clojure.test :refer [deftest is]] [haystack.parser.util :as util])) (deftest safe-read-edn-test (is (= nil (util/safe-read-edn "["))) (is (= [1 2 3] (util/safe-read-edn "[1 2 3]"))) (let [{:keys [form tag]} (util/safe-read-edn "#error {:a 1}")] (is (= 'error t...
null
https://raw.githubusercontent.com/clojure-emacs/haystack/4e1f835e2255e44d6df091918df3ddbc5b63486d/test/haystack/parser/util_test.cljc
clojure
(ns haystack.parser.util-test (:require [clojure.test :refer [deftest is]] [haystack.parser.util :as util])) (deftest safe-read-edn-test (is (= nil (util/safe-read-edn "["))) (is (= [1 2 3] (util/safe-read-edn "[1 2 3]"))) (let [{:keys [form tag]} (util/safe-read-edn "#error {:a 1}")] (is (= 'error t...
b3e1763e781479e877657cf70b3c077b8e0e8725b1f2c141f794a2a4a15a64de
let-def/owee
owee_marker.mli
(** A module to manually instrument values and implement dynamic services based on the actual type of these values. The idea is to put a distinguished word, of type [t marker] in a value of type [t]. This module implements tools to generate and scan for such word, and execute functions based on the typ...
null
https://raw.githubusercontent.com/let-def/owee/d7e10ec52643a7bfc0de96c427c47528e85b7d7a/src/owee_marker.mli
ocaml
* A module to manually instrument values and implement dynamic services based on the actual type of these values. The idea is to put a distinguished word, of type [t marker] in a value of type [t]. This module implements tools to generate and scan for such word, and execute functions based on the type ...
type 'result service = .. type _ service += | Name : string service | Traverse : ((Obj.t -> 'acc -> 'acc) -> 'acc -> 'acc) service | Locate : Owee_location.t list service type 'a service_result = | Success of 'a | Unsupported_service | Unmanaged_object type 'a marked val get : 'a marked -> 'a val ...
730fe1fc602e93d59c21ce79f3b22c51e4ef56ae78884f247c2ce4bdb474bd55
michaelklishin/langohr
tx.clj
This source code is dual - licensed under the Apache License , version 2.0 , and the Eclipse Public License , version 1.0 . ;; ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- Copyright ( c ) 2011 - 2020 , , and the ClojureWerkz Team ;; Licensed unde...
null
https://raw.githubusercontent.com/michaelklishin/langohr/0c63ac3c6bc97d73e290ed366e9e97e07d39dedb/src/clojure/langohr/tx.clj
clojure
The APL v2.0: ---------------------------------------------------------------------------------- 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 CONDIT...
This source code is dual - licensed under the Apache License , version 2.0 , and the Eclipse Public License , version 1.0 . Copyright ( c ) 2011 - 2020 , , and the ClojureWerkz Team distributed under the License is distributed on an " AS IS " BASIS , The EPL v1.0 : Copyright ( c ) 2011 - 2020 , , ...
b9b74a314d4cd03f1c8cafb4cbafe1ad42c3c8b097f479083a9061733e006e8d
pbrisbin/devsite
Profile.hs
module Handler.Profile ( getProfileR , getEditProfileR , postEditProfileR ) where import Import TODO TODO import Data.Maybe (fromMaybe) import Helpers.Profile import Network.Gravatar getProfileR :: Handler RepHtml getProfileR = do (Entity _ user) <- requireAuth let username = fromMaybe ""...
null
https://raw.githubusercontent.com/pbrisbin/devsite/d12682cf9add9ac1f91abd51cb576f12ca7ca424/Handler/Profile.hs
haskell
module Handler.Profile ( getProfileR , getEditProfileR , postEditProfileR ) where import Import TODO TODO import Data.Maybe (fromMaybe) import Helpers.Profile import Network.Gravatar getProfileR :: Handler RepHtml getProfileR = do (Entity _ user) <- requireAuth let username = fromMaybe ""...
4d9b2c37df3291c715b638b2a82045861de25bdcc15f975cd830c237146db2ba
vaclavsvejcar/headroom
TypesSpec.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE NoImplicitPrelude # module Headroom.TypesSpec ( spec ) where import Headroom.Variables (mkVariables) import RIO import Test.Hspec spec :: Spec spec = do describe "Semigroup Variables" $ do it "combines two instances of variables" $ do let ...
null
https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/test/Headroom/TypesSpec.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE NoImplicitPrelude # module Headroom.TypesSpec ( spec ) where import Headroom.Variables (mkVariables) import RIO import Test.Hspec spec :: Spec spec = do describe "Semigroup Variables" $ do it "combines two instances of variables" $ do let sample1 = mkVariables [("fst", "v1"...
0ad39def798a3a0bab26df193f552bb13809c168143b31fcc42b65ebc4cab076
nd/bird
10.1.1.hs
(>>) :: IO () -> IO () -> IO () (>>) p q = p >>= v where v _ = q
null
https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch10/10.1.1.hs
haskell
(>>) :: IO () -> IO () -> IO () (>>) p q = p >>= v where v _ = q
17afe77fd1803189f8ed81d6bc229dc29f154c9e4792b2a1e492d5c4be53e2df
TorXakis/TorXakis
TorXakisBench.hs
TorXakis - Model Based Testing Copyright ( c ) 2015 - 2017 TNO and Radboud University See LICENSE at root directory of this repository . TorXakis - Model Based Testing Copyright (c) 2015-2017 TNO and Radboud University See LICENSE at root directory of this repository. -} import Benchmarks.All import ...
null
https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/test/sqatt/bench/TorXakisBench.hs
haskell
TorXakis - Model Based Testing Copyright ( c ) 2015 - 2017 TNO and Radboud University See LICENSE at root directory of this repository . TorXakis - Model Based Testing Copyright (c) 2015-2017 TNO and Radboud University See LICENSE at root directory of this repository. -} import Benchmarks.All import ...
51c72fe34dce797fa457c4def311706d9f2af03d4f51f10cc21e8ca68975946e
sinasamavati/leptus
leptus_router_SUITE.erl
Copyright ( c ) 2013 - 2015 Sina Samavati < > %% %% Permission is hereby granted, free of charge, to any person obtaining a copy %% of this software and associated documentation files (the "Software"), to deal in the Software without restriction , including without limitation the rights %% to use, copy, modify, me...
null
https://raw.githubusercontent.com/sinasamavati/leptus/e0d9bd2270dfa85bd5922e0a5c2d0289d2dc0ef9/test/leptus_router_SUITE.erl
erlang
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal to use, copy, modify, merge, publish, distribute, sublicense, and/or sell furnished to do so, subject to the following conditions: The above copyright notice ...
Copyright ( c ) 2013 - 2015 Sina Samavati < > in the Software without restriction , including without limitation the rights copies of the Software , and to permit persons to whom the Software is all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY ...
a4cece5f7b8631ec5c7b0382ae67eaef5ff2af3b54d7d3c966438fccdf1c6e6f
rescript-lang/rescript-compiler
js_of_lam_tuple.mli
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2017 - , Authors of * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the Licens...
null
https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/core/js_of_lam_tuple.mli
ocaml
Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P. * Copyright ( C ) 2017 - , Authors of * This program is free software : you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation , either version 3 of the Licens...
7677145806191a5ffdd5b787853b4a78bf157e835cea7822ce53f9850b3dd72c
clj-commons/potemkin
template.clj
(ns potemkin.template (:require [clojure.set :as s] [riddley.walk :as r] [riddley.compiler :as c])) (defn- validate-body [externs args body] (let [valid? (atom true) externs (set externs) args (set args) check? (s/union externs args)] (when-not (empty? (s/intersection extern...
null
https://raw.githubusercontent.com/clj-commons/potemkin/3e404364ae2fd32f7a53b362a79d2012ab958ab2/src/potemkin/template.clj
clojure
(ns potemkin.template (:require [clojure.set :as s] [riddley.walk :as r] [riddley.compiler :as c])) (defn- validate-body [externs args body] (let [valid? (atom true) externs (set externs) args (set args) check? (s/union externs args)] (when-not (empty? (s/intersection extern...
5fcf1493514c41ae538f66290e8af258e79ac871f2ccd489496d20145d85d0db
huangz1990/real-world-haskell-cn
rewrite_by_map.hs
-- file: ch04/rewrite_by_map.hs import Data.Char (toUpper) square2 xs = map squareOne xs where squareOne x = x * x upperCase2 xs = map toUpper xs
null
https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch04/rewrite_by_map.hs
haskell
file: ch04/rewrite_by_map.hs
import Data.Char (toUpper) square2 xs = map squareOne xs where squareOne x = x * x upperCase2 xs = map toUpper xs
8138539a1fdb8292f931f5a65d5753fe883ddfb9593fc02e7e0523b5544f1d4a
fourmolu/fourmolu
type-operators1-four-out.hs
# LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeOperators # class (:$) a b class (:&) a b class a :* b class a -- Before operator :+ b -- After operator class ( f :. g ) a
null
https://raw.githubusercontent.com/fourmolu/fourmolu/1f8903a92c8d5001dc1ec8ecfd4a04a3b61c3283/data/examples/declaration/class/type-operators1-four-out.hs
haskell
Before operator After operator
# LANGUAGE MultiParamTypeClasses # # LANGUAGE TypeOperators # class (:$) a b class (:&) a b class a :* b class class ( f :. g ) a
a75e0f696d2b14e272524d57e2133d5c55f69dc2728ead736893c0af42895f4b
con-kitty/categorifier-c
F.hs
# LANGUAGE DeriveGeneric # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TemplateHaskell # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # module F (fCategorified) where import qualified Categorifier.C.CExpr.Cat as C import Categorifier.C.CExpr.Cat.TargetOb (TargetOb) import Cat...
null
https://raw.githubusercontent.com/con-kitty/categorifier-c/2cec7b0983592b57ed4c0ab755bd4dd643e38d25/examples/c-wrappers/F.hs
haskell
This is needed to generate the wrapper This is needed to generate the wrapper
# LANGUAGE DeriveGeneric # # LANGUAGE MultiParamTypeClasses # # LANGUAGE TemplateHaskell # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators # # LANGUAGE UndecidableInstances # module F (fCategorified) where import qualified Categorifier.C.CExpr.Cat as C import Categorifier.C.CExpr.Cat.TargetOb (TargetOb) import Cat...
fd08d0d28cc9ad1aa8a3b881d10de7d4fb09f61c5426f77724992d507b8aa8e9
latacora/clj-lambda
core.clj
(ns {{namespace}} (:require [clojure.java.io :as io] [cheshire.core :as json]) #_:clj-kondo/ignore (:import [com.amazonaws.services.lambda.runtime RequestStreamHandler]) (:gen-class :name {{namespace}}.handler :implements [com.amazonaws.services.lambda.runtime.RequestStreamHandler])) (defn -h...
null
https://raw.githubusercontent.com/latacora/clj-lambda/4a3873bb4abc79914cf989556e5513d2d4c64388/resources/clj/new/clj_lambda/core.clj
clojure
(ns {{namespace}} (:require [clojure.java.io :as io] [cheshire.core :as json]) #_:clj-kondo/ignore (:import [com.amazonaws.services.lambda.runtime RequestStreamHandler]) (:gen-class :name {{namespace}}.handler :implements [com.amazonaws.services.lambda.runtime.RequestStreamHandler])) (defn -h...
43f849701d6a9ae634801f002520f92677cfd8d87c9ca25aaca911253f745901
open-company/open-company-web
login_button.cljs
(ns oc.web.components.ui.login-button (:require-macros [dommy.core :refer (sel1)]) (:require [rum.core :as rum] [oc.web.urls :as oc-urls] [oc.web.router :as router] [oc.web.lib.utils :as utils] [oc.web.actions.user :as user] [oc.web.lib.responsive :as resp...
null
https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/src/main/oc/web/components/ui/login_button.cljs
clojure
(ns oc.web.components.ui.login-button (:require-macros [dommy.core :refer (sel1)]) (:require [rum.core :as rum] [oc.web.urls :as oc-urls] [oc.web.router :as router] [oc.web.lib.utils :as utils] [oc.web.actions.user :as user] [oc.web.lib.responsive :as resp...
37fcbd5e5876ad0bb9bcb72828e1832fb8ed5df3112cb23775284621d92bde3f
BillHallahan/G2
Defunc2.hs
module Defunc2 where data IList = I Int IList | INil deriving Eq data FList = F (Int -> Int) FList | FNil add1 :: Int -> Int add1 x = x + 1 sub1 :: Int -> Int sub1 x = x - 1 square :: Int -> Int square x = x * x funcMap :: FList -> IList -> IList funcMap (F f fs) (I i is) = I (f ...
null
https://raw.githubusercontent.com/BillHallahan/G2/088bc30d752df6e5acd397e8238e6279caa8ec41/tests/TestFiles/Defunc2.hs
haskell
module Defunc2 where data IList = I Int IList | INil deriving Eq data FList = F (Int -> Int) FList | FNil add1 :: Int -> Int add1 x = x + 1 sub1 :: Int -> Int sub1 x = x - 1 square :: Int -> Int square x = x * x funcMap :: FList -> IList -> IList funcMap (F f fs) (I i is) = I (f ...
a7b123cc147acea69e18d605a2226b7cbd953b794ef565e434107c1c251e3418
duelinmarkers/insfactor
nrepl.clj
(ns duelinmarkers.insfactor.nrepl (:require [clojure.string :as string] [clojure.tools.nrepl.middleware :as middleware] [duelinmarkers.insfactor :as insfactor])) (defn src->ns-sym [src] (symbol (fnext (re-find #"\(ns\s+([a-zA-Z0-9.*+!?_-]+)" src)))) (defn index-on-load [h] (fn [{:keys [o...
null
https://raw.githubusercontent.com/duelinmarkers/insfactor/8085c4e582735f928752cbed9f5957cf95321e57/src/duelinmarkers/insfactor/nrepl.clj
clojure
(ns duelinmarkers.insfactor.nrepl (:require [clojure.string :as string] [clojure.tools.nrepl.middleware :as middleware] [duelinmarkers.insfactor :as insfactor])) (defn src->ns-sym [src] (symbol (fnext (re-find #"\(ns\s+([a-zA-Z0-9.*+!?_-]+)" src)))) (defn index-on-load [h] (fn [{:keys [o...
d994b5c4bad0087ea92e03e2d05e72ee9d88361269deeb202c61bc04b6daa52b
roswell/roswell
install-clasp.lisp
(roswell:include "util-install-quicklisp") (defpackage :roswell.install.clasp (:use :cl :roswell.install :roswell.util :roswell.locations)) (in-package :roswell.install.clasp) (defparameter *clasp-version* ;; alias commit external-clasp-version '(("2019-09-29" "f0cb8960867be6ed58a82066abb0da2df9da72b3" "6.0.1") ...
null
https://raw.githubusercontent.com/roswell/roswell/0107dfb54393aff1a776deb79d58f67f642135cb/lisp/install-clasp.lisp
lisp
alias commit external-clasp-version replace externals-clasp to externals_clasp
(roswell:include "util-install-quicklisp") (defpackage :roswell.install.clasp (:use :cl :roswell.install :roswell.util :roswell.locations)) (in-package :roswell.install.clasp) (defparameter *clasp-version* '(("2019-09-29" "f0cb8960867be6ed58a82066abb0da2df9da72b3" "6.0.1") ("2019-07-09" "5dce7a8687d761bc91a96e...
3a336fc09b1c681c08cc7aa81c306d42757c2e4e151eb4fefa4d7e8891bcba04
kowainik/extensions
Main.hs
module Main (main) where import Colourista (errorMessage, infoMessage) import Control.Exception (catch) import Data.Foldable (forM_, for_) import Data.List (nub) import Data.Text (Text) import GHC.Exts (sortWith) import System.Directory (doesFileExist, getCurrentDirectory, listDirectory) import System.Exit (exitFailur...
null
https://raw.githubusercontent.com/kowainik/extensions/8c9510e8072e477561b2406136ddd375795501bf/app/Main.hs
haskell
no options specified --no-modules --no-cabal --cabal-file-path --cabal-file-path --no-modules --cabal-file-path --no-cabal --module-file-path --no-modules --module-file-path --module-file-path --no-cabal --cabal-file-path --module-file-path check whether the file exist under the path and run action only if e...
module Main (main) where import Colourista (errorMessage, infoMessage) import Control.Exception (catch) import Data.Foldable (forM_, for_) import Data.List (nub) import Data.Text (Text) import GHC.Exts (sortWith) import System.Directory (doesFileExist, getCurrentDirectory, listDirectory) import System.Exit (exitFailur...
87aae845fcdb920de7ccb67925ae452b865eb91eca0193f01aca95de94d32b5c
veikman/dmote-keycap
schema_test.clj
(ns dmote-keycap.schema-test (:require [clojure.test :refer [deftest testing is]] [clojure.spec.alpha :as spec] [dmote-keycap.data :as data] [dmote-keycap.schema :as schema])) (deftest test-inputs (testing "empty inputs should be permitted" (is (= true (spec/valid? ::schema...
null
https://raw.githubusercontent.com/veikman/dmote-keycap/8d567e7c136cc2f61b125cc6a56cd3b62459b373/test/dmote_keycap/schema_test.clj
clojure
(ns dmote-keycap.schema-test (:require [clojure.test :refer [deftest testing is]] [clojure.spec.alpha :as spec] [dmote-keycap.data :as data] [dmote-keycap.schema :as schema])) (deftest test-inputs (testing "empty inputs should be permitted" (is (= true (spec/valid? ::schema...
3c380510ec9c5dee07788c2df9237d725392595a74d5ac2a47b380bbd6c841ef
joearms/paradis
miller_rabin.erl
-module(miller_rabin). -compile(export_all). -export([test/0, test1/0, test2/0,test3/0,test4/0, is_probably_prime/1, make_prime/1]). %% def miller_rabin_prime?(n,k) return true if n = = 2 return false if n < 2 or n % 2 = = 0 %% d = n - 1 s = 0 %% while d % 2 == 0 %% d /= 2 s + = 1 %% end ...
null
https://raw.githubusercontent.com/joearms/paradis/62055b8db643926fd86c8b79f038beb9ac50916f/client_server_lecture/rsa_pure_erlang/miller_rabin.erl
erlang
def miller_rabin_prime?(n,k) 2 = = 0 d = n - 1 while d % 2 == 0 d /= 2 end k.times do x = (a**d) % n for r in (1 .. s-1) x = (x**2) % n break if x == n-1 end return false if x != n-1 end true # probably end with maximal help from crypto to test for a prime ...
-module(miller_rabin). -compile(export_all). -export([test/0, test1/0, test2/0,test3/0,test4/0, is_probably_prime/1, make_prime/1]). return true if n = = 2 s = 0 s + = 1 a = 2 + rand(n-4 ) next if x = = 1 or x = = n-1 return false if x = = 1 test() -> make_prime(1024). test1...
633b6cf51ed084eaa8d335aa26d8289cd57441f37b1d2a379b6620bef081e883
noloop/cacau
full.lisp
(in-package #:noloop.cacau) (defun reporter-full (runner options) (cacau-logo) (when (or (some #'(lambda (i) (equal :tests-list i)) options) (null options)) (suite-tests-list-events runner)) (lambda () (if (null options) (full-epilogue (result runner) nil) (dolist (i options) ...
null
https://raw.githubusercontent.com/noloop/cacau/ba0fb36a284ded884f1dab0bd3f0f41ec14e3038/src/reporters/full.lisp
lisp
(in-package #:noloop.cacau) (defun reporter-full (runner options) (cacau-logo) (when (or (some #'(lambda (i) (equal :tests-list i)) options) (null options)) (suite-tests-list-events runner)) (lambda () (if (null options) (full-epilogue (result runner) nil) (dolist (i options) ...
cbc3d6a6e4c8b88465a494099e32f69e3a24c828fe5a41a3c9218ce4b80669cc
txyyss/Project-Euler
Euler092.hs
-- A number chain is created by continuously adding the square of the -- digits in a number to form a new number until it has been seen -- before. -- For example, 44 - > 32 - > 13 - > 10 - > 1 - > 1 85 - > 89 - > 145 - > 42 - > 20 - > 4 - > 16 - > 37 - > 58 - > 89 Therefore any chain that arrives at 1 or 89 wi...
null
https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler092.hs
haskell
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, endless loop. What is most amazing is that EVERY starting number
44 - > 32 - > 13 - > 10 - > 1 - > 1 85 - > 89 - > 145 - > 42 - > 20 - > 4 - > 16 - > 37 - > 58 - > 89 Therefore any chain that arrives at 1 or 89 will become stuck in an will eventually arrive at 1 or 89 . How many starting numbers below ten million will arrive at 89 ? module Euler092 where import Data....
cca6f817f85557511177bdad10f6decaaa5b05d2b0ae29ce8fa6be60e875a8e4
CommonDoc/common-doc
macros.lisp
(in-package :common-doc.macro) (defclass macro-node (content-node) ((name :accessor name :initarg :name :type string :documentation "The name of the macro.")) (:documentation "A macro to be expanded.")) (defgeneric expand-macro (node) (:documentation "Replace a macro node with a primi...
null
https://raw.githubusercontent.com/CommonDoc/common-doc/66cabe67241449a1c0e2cbdc955a60c9439869e6/src/macros.lisp
lisp
Define metadata macros
(in-package :common-doc.macro) (defclass macro-node (content-node) ((name :accessor name :initarg :name :type string :documentation "The name of the macro.")) (:documentation "A macro to be expanded.")) (defgeneric expand-macro (node) (:documentation "Replace a macro node with a primi...
75f28790ce1185d44b4f1c93241f8abe15d9c1bd8162ddef1d112ec7b1d852bf
oxidizing/sihl
core_container.ml
module ServiceA : Sihl.Container.Service.Sig = struct let start ctx = print_endline "Starting module A"; Lwt.return ctx ;; let stop _ = Lwt.return () let lifecycle = Sihl.Container.create_lifecycle ~start ~stop "a" end module ServiceB : Sihl.Container.Service.Sig = struct let start ctx = print_e...
null
https://raw.githubusercontent.com/oxidizing/sihl/547e2b51fa59f5f64665c452792cd7fd0aca072b/sihl/test/core_container.ml
ocaml
module ServiceA : Sihl.Container.Service.Sig = struct let start ctx = print_endline "Starting module A"; Lwt.return ctx ;; let stop _ = Lwt.return () let lifecycle = Sihl.Container.create_lifecycle ~start ~stop "a" end module ServiceB : Sihl.Container.Service.Sig = struct let start ctx = print_e...
e54033e307cfad12f51394ce66960eb4fc79161f4d35e37d0f283f06e09dbb21
ygmpkk/house
Maybe.hs
module Maybe ( isJust, isNothing, fromJust, fromMaybe, listToMaybe, maybeToList, catMaybes, mapMaybe, -- ...and what the Prelude exports Maybe(Nothing, Just), maybe ) where import Data.Maybe
null
https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/haskell98/Maybe.hs
haskell
...and what the Prelude exports
module Maybe ( isJust, isNothing, fromJust, fromMaybe, listToMaybe, maybeToList, catMaybes, mapMaybe, Maybe(Nothing, Just), maybe ) where import Data.Maybe
3f4518f73b9cbc068a692016cbc8b0881c0046c94670b17be0be60ac324cff29
roman/TicTacToe
TestSuite.hs
module Main where import Test.Framework (defaultMain, testGroup) import qualified Model.Matrix.Tests import qualified Controller.Tests main :: IO () main = defaultMain tests where tests = [ testGroup "Model.Matrix.Tests.tests" Model.Matr...
null
https://raw.githubusercontent.com/roman/TicTacToe/3e8b4b35e7da25ee8b83fe26268fe356aeb94791/tests/suite/TestSuite.hs
haskell
module Main where import Test.Framework (defaultMain, testGroup) import qualified Model.Matrix.Tests import qualified Controller.Tests main :: IO () main = defaultMain tests where tests = [ testGroup "Model.Matrix.Tests.tests" Model.Matr...
5d7e746681db8f6fa4b23fa94aa44a60fb64062025f78e9812848ad15eac9a6e
pjotrp/guix
syscalls.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2014 , 2015 < > Copyright © 2015 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundati...
null
https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/tests/syscalls.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2014 , 2015 < > Copyright © 2015 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-module (test-syscalls) #:use-module (guix utils) #:use-module (guix b...
6cb7168965112c928de643732603bca77ccb3c6191f8c7c2084e018df49aef20
noteed/rescoyl
Utils.hs
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} module Rescoyl.Utils where import Control.Monad (liftM) import Control.Monad.Trans (liftIO) import Data.Binary.Get (pushChunk, pushChunks) import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as...
null
https://raw.githubusercontent.com/noteed/rescoyl/5ef099ee62584624bfe967a5275b212c0c000749/Rescoyl/Utils.hs
haskell
# LANGUAGE BangPatterns # # LANGUAGE OverloadedStrings # -------------------------------------------------------------------- Extract a docker client's version. -------------------------------------------------------------------- | This docker client version is special in that it is the beginning of a specific way t...
module Rescoyl.Utils where import Control.Monad (liftM) import Control.Monad.Trans (liftIO) import Data.Binary.Get (pushChunk, pushChunks) import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as BC import qualified Data.ByteString.Lazy as L import Data.Digest...
cf4401925ffc0bd714299b0371429c57a31876694b8fcbf42de896d8fb71589f
Dasudian/DSDIN
dsdvm_eeevm_tests.erl
%%%------------------------------------------------------------------- ( C ) 2018 , Dasudian Technologies %%% @doc Basic tests for dsdvm %%% @end %%%------------------------------------------------------------------- -module(dsdvm_eeevm_tests). -include_lib("eunit/include/eunit.hrl"). %%==========================...
null
https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdvm/test/dsdvm_eeevm_tests.erl
erlang
------------------------------------------------------------------- @doc Basic tests for dsdvm @end ------------------------------------------------------------------- ==================================================================== Test harness ===================================================================...
( C ) 2018 , Dasudian Technologies -module(dsdvm_eeevm_tests). -include_lib("eunit/include/eunit.hrl"). For VMTests the opcode could not return the hashes extra_opts(Name) -> maps:merge(default_opts(), extra_opts_tc(Name)). default_opts() -> #{ blockhash => sha3 , no_recursion => true }...
898212fa4530a78762a9d5d3cf429fd0d598457a7a269c9d7f40b0ff23a3005e
herbelin/coq-hh
indfun_common.mli
open Names open Pp (* The mk_?_id function build different name w.r.t. a function Each of their use is justified in the code *) val mk_rel_id : identifier -> identifier val mk_correct_id : identifier -> identifier val mk_complete_id : identifier -> identifier val mk_equation_id : identifier -> identifier val m...
null
https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/plugins/funind/indfun_common.mli
ocaml
The mk_?_id function build different name w.r.t. a function Each of their use is justified in the code [save_named] is a copy of [Command.save_named] but uses [nf_betaiotazeta] instead of [nf_betaiotaevar_preserving_vm_cast] [get_proof_clean do_reduce] : returns the proof name, definition, kind and hook a...
open Names open Pp val mk_rel_id : identifier -> identifier val mk_correct_id : identifier -> identifier val mk_complete_id : identifier -> identifier val mk_equation_id : identifier -> identifier val msgnl : std_ppcmds -> unit val invalid_argument : string -> 'a val fresh_id : identifier list -> string -> identif...
b403bdab49b22413ab8ea81632d3280a1a223e10729d96a24534fc2d9471df4b
robert-strandh/Cluffer
packages.lisp
(cl:in-package #:common-lisp-user) (defpackage #:cluffer-standard-buffer (:use #:common-lisp) (:export #:buffer))
null
https://raw.githubusercontent.com/robert-strandh/Cluffer/4aad29c276a58a593064e79972ee4d77cae0af4a/Standard-buffer/packages.lisp
lisp
(cl:in-package #:common-lisp-user) (defpackage #:cluffer-standard-buffer (:use #:common-lisp) (:export #:buffer))
09c4286fd3801f6daebd2029872ecaaffef29cf760e31fbac2597ca89445df88
replikativ/datahike
sandbox.clj
(ns sandbox (:require [datahike.api :as d])) (comment (def schema [{:db/ident :name :db/cardinality :db.cardinality/one :db/index true :db/unique :db.unique/identity :db/valueType :db.type/string} {:db/ident :s...
null
https://raw.githubusercontent.com/replikativ/datahike/7e60af807dd4db1d0eb73b75ac2f010e31361a3a/dev/sandbox.clj
clojure
(ns sandbox (:require [datahike.api :as d])) (comment (def schema [{:db/ident :name :db/cardinality :db.cardinality/one :db/index true :db/unique :db.unique/identity :db/valueType :db.type/string} {:db/ident :s...
1e386794ae6a49d5aca0141931c67c4216746120767c3613f465ec942c3fdedc
hslua/hslua
RunTests.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE TypeApplications # # OPTIONS_GHC -fno - warn - deprecations # | Module : HsLua . Core . RunTests Copyright : © 2017 - 2023 : MIT Maintainer : < tarleb+ > Stability : stable Portability : portable Tests for different conveni...
null
https://raw.githubusercontent.com/hslua/hslua/178c225f3da193f09fc27877a5a30e66eef069fb/hslua-core/test/HsLua/Core/RunTests.hs
haskell
# LANGUAGE OverloadedStrings # | Specifications for Attributes parsing functions.
# LANGUAGE TypeApplications # # OPTIONS_GHC -fno - warn - deprecations # | Module : HsLua . Core . RunTests Copyright : © 2017 - 2023 : MIT Maintainer : < tarleb+ > Stability : stable Portability : portable Tests for different convenience functions to run Lua operation...
a4373a3cb73dc8fb3fe40d60f5a80baf94c4aa26dfd03686ea2743846d9f3102
heidihoward/ocaml-raft
env.ml
open Core_kernel.Std open Common open MonoTime module RaftMonitor = RaftMonitorWrapper module Mach = Statemach.KeyValStr open State let hist = ref false type t = (IntID.t,State.t status list) List.Assoc.t this is only created by init so we are assuming list always have at least * one element , hence use of hd_ex...
null
https://raw.githubusercontent.com/heidihoward/ocaml-raft/b1502ebf8c19be28270d11994abac68e5a6418be/lib/env.ml
ocaml
like find but also strips status returns a list of state.t for all live nodes, useful for iterating over check majority of nodes are live if hd doesn't know leader check all live nodes agree on leader and term TODO: this condition is too strong adding new node, assume live or already live updating a dead ...
open Core_kernel.Std open Common open MonoTime module RaftMonitor = RaftMonitorWrapper module Mach = Statemach.KeyValStr open State let hist = ref false type t = (IntID.t,State.t status list) List.Assoc.t this is only created by init so we are assuming list always have at least * one element , hence use of hd_ex...
b5fe5a165d7468a0d9484adccfe02e67b3afd8b3be123e81eec09d75e5b88702
dchelimsky/sicp-exercises
ex-2.18.scm
#lang scheme ; Define a procedure reverse that takes a list as argument and returns a list of the same elements in reverse order: (require rackunit) ;;;;;;;;;;;;;;;;;;;;;; (define (all-but-last l) (if (null? (cdr l)) null (cons (car l) (all-but-last (cdr l))))) (check-equal? (list 1 2 3) (all-but-last...
null
https://raw.githubusercontent.com/dchelimsky/sicp-exercises/55c804e3775b87a490e05f8337fc59bc7ce07f28/chapter-2/ex-2.18.scm
scheme
Define a procedure reverse that takes a list as argument and returns a list of the same elements in reverse order:
#lang scheme (require rackunit) (define (all-but-last l) (if (null? (cdr l)) null (cons (car l) (all-but-last (cdr l))))) (check-equal? (list 1 2 3) (all-but-last (list 1 2 3 4))) (define (reverse-using-all-but-last l) (if (null? (cdr l)) (list (car l)) (cons (last l) (reverse-using-all...
a6806d55a768082c65298e7a17f2526572ef7c6fa3fe663d1bd1b2820bfc73f1
rtoy/ansi-cl-tests
make-random-element-of.lsp
;-*- Mode: Lisp -*- Author : Created : Tue Dec 28 20:28:03 2004 ;;;; Contains: Code to make random elements of types (in-package :cl-test) (defgeneric make-random-element-of (type) (:documentation "Create a random element of TYPE, or throw an error if it can't figure out how to do it.")) (defgene...
null
https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/make-random-element-of.lsp
lisp
-*- Mode: Lisp -*- Contains: Code to make random elements of types Put float, complex types here also of certain integers (near 0, near endpoints, near
Author : Created : Tue Dec 28 20:28:03 2004 (in-package :cl-test) (defgeneric make-random-element-of (type) (:documentation "Create a random element of TYPE, or throw an error if it can't figure out how to do it.")) (defgeneric make-random-element-of-compound-type (type args &key &allow-other-keys) ...
bcbd77030337d3f84b5deb373fd66cb0d407de04fa037bbd81120f6076cad9c4
blitz/stumpwm
net.lisp
;;; Network activity formatter for the mode-line ;;; Copyright 2009 ;;; ;;; Maintainer: ;;; ;;; This module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 , or ( at your option ) ;;; any...
null
https://raw.githubusercontent.com/blitz/stumpwm/439180985920a628b18d4426f1a29b1c36576531/contrib/net.lisp
lisp
Network activity formatter for the mode-line Maintainer: This module is free software; you can redistribute it and/or modify either version 2 , or ( at your option ) any later version. This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty o...
Copyright 2009 it under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License the Free Software Foundation , Inc. , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA This is specific to Linux . (defpackage :stumpwm.contrib....