_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 |
|---|---|---|---|---|---|---|---|---|
d486f7776e2e8e0c1be711b449c8e7511288e77164275b0413b97bdf0d33c216 | braidchat/braid | db_test.clj | (ns braid.test.server.db-test
(:require
[clojure.test :refer :all]
[braid.core.server.db :as db]
[braid.chat.db.group :as group]
[braid.chat.db.invitation :as invitation]
[braid.chat.db.message :as message]
[braid.chat.db.tag :as tag]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as u... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/test/braid/test/server/db_test.clj | clojure | (ns braid.test.server.db-test
(:require
[clojure.test :refer :all]
[braid.core.server.db :as db]
[braid.chat.db.group :as group]
[braid.chat.db.invitation :as invitation]
[braid.chat.db.message :as message]
[braid.chat.db.tag :as tag]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as u... | |
44e79fe567bfd23d02f151a639bafa68486cde67c488ae4bfa3fd4b0ce641a9d | tmfg/mmtis-national-access-point | transit_changes.cljs | (ns ote.app.controller.transit-changes
"Controller for transit changes view"
(:require [tuck.core :as tuck :refer-macros [define-event]]
[ote.communication :as comm]
[ote.app.controller.common :refer [->ServerError]]
[ote.app.routes :as routes]
[ote.time :as time]
... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/src/cljs/ote/app/controller/transit_changes.cljs | clojure | bide converts to string, done also here just in case | (ns ote.app.controller.transit-changes
"Controller for transit changes view"
(:require [tuck.core :as tuck :refer-macros [define-event]]
[ote.communication :as comm]
[ote.app.controller.common :refer [->ServerError]]
[ote.app.routes :as routes]
[ote.time :as time]
... |
f41de1b873f8a0f4d463e3bc4675fee68e6b2dfb1e104be4ce0fb22ae47573da | tmattio/spin | refmt.ml | let run ~cwd ~stdout cmd args =
Logs.debug (fun m -> m "Running \"%s %s\"" cmd (String.concat " " args));
Spawn.exec cmd args ~stdout ~cwd:(Path cwd)
|> Result.map_error (fun err ->
let msg =
Printf.sprintf
"an error occured while running \"%s %s\": %s"
cmd
... | null | https://raw.githubusercontent.com/tmattio/spin/092ab5979d4f1d01f538743443b70465a2d5ed23/lib/spin/refmt.ml | ocaml | let run ~cwd ~stdout cmd args =
Logs.debug (fun m -> m "Running \"%s %s\"" cmd (String.concat " " args));
Spawn.exec cmd args ~stdout ~cwd:(Path cwd)
|> Result.map_error (fun err ->
let msg =
Printf.sprintf
"an error occured while running \"%s %s\": %s"
cmd
... | |
0d4eb01093f24d3a21562dd4f7038c7c7f7719ab9ed7a47411c13d77e838952f | dbuenzli/mu | mu_midi.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2021 The mu programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/dbuenzli/mu/5dc8643db924c1cb7c191fdbbedc4add33808b55/src/mu_midi.ml | ocaml | MIDI messages and events
MIDI files
Encoding
Performance convertion
relativize the time of [evs] and add track end msg | ---------------------------------------------------------------------------
Copyright ( c ) 2021 The mu programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
2bc8d40da1e04e1d1e23d80493b2ea305b6f74deb16c7c73299ac5d24cbf7684 | tfausak/rattletrap | Monad.hs | module Rattletrap.Utility.Monad where
whenMaybe :: (Applicative m) => Bool -> m a -> m (Maybe a)
whenMaybe p f = if p then fmap Just f else pure Nothing
| null | https://raw.githubusercontent.com/tfausak/rattletrap/cc6d6aba923d840f23de7673cab9a043096d3099/src/lib/Rattletrap/Utility/Monad.hs | haskell | module Rattletrap.Utility.Monad where
whenMaybe :: (Applicative m) => Bool -> m a -> m (Maybe a)
whenMaybe p f = if p then fmap Just f else pure Nothing
| |
164063dd7fd5d6b24c23c3f61dc0d6faa9aebd15967f0039153547b46a8a76e4 | bgamari/hs-usdt | Main.hs | # LANGUAGE TemplateHaskell #
module Main where
import System.USDT
tp1 :: Tracepoint ()
tp1 = $(mkTracepoint' "tp1")
main :: IO ()
main = do
triggerTracepoint tp1
$(tracepoint "tp2")
triggerTracepoint tp1
putStrLn "Hello, Haskell!"
| null | https://raw.githubusercontent.com/bgamari/hs-usdt/898287f8e1bbc5400784b9455e763c7522111354/app/Main.hs | haskell | # LANGUAGE TemplateHaskell #
module Main where
import System.USDT
tp1 :: Tracepoint ()
tp1 = $(mkTracepoint' "tp1")
main :: IO ()
main = do
triggerTracepoint tp1
$(tracepoint "tp2")
triggerTracepoint tp1
putStrLn "Hello, Haskell!"
| |
900f31e1fe86f221d4a28d1f247b68bad3ea91d8d1789e1294fe10ed09a159f1 | pirapira/bamboo | location.ml | type 'imm memory_range =
{ memory_start : 'imm (* In byte as in EVM *)
; memory_size : 'imm (* In byte *)
}
type 'imm storage_range =
{ storage_start : 'imm (* In word as in EVM *)
; storage_size : 'imm (* In word *)
}
type 'imm code_range =
{ code_start : 'imm (* In byte *)
; code_size : 'imm
}
... | null | https://raw.githubusercontent.com/pirapira/bamboo/1cca98e0b6d2579fe32885e66aafd0f5e25d9eb5/src/ast/location.ml | ocaml | In byte as in EVM
In byte
In word as in EVM
In word
In byte
* [Stack 0] is the deepest element in the stack.
* The stack usage should be known from the beginning of the
* code generation.
if the cache has to be written again | type 'imm memory_range =
}
type 'imm storage_range =
}
type 'imm code_range =
; code_size : 'imm
}
type 'imm volatile_location =
| Memory of 'imm memory_range
| Stack of int
type 'imm cached_storage =
{ cached_original: 'imm storage_range
; cache : 'imm volatile_location
}
type calldata_range =
... |
23eb50f93837104d867e6d409fb6688987f56a3d277adb7a5483a34149cc53d2 | shirok/Gauche | 78.scm | ;;;
SRFI-78 - Lightweight testing
;;;
Copyright ( c ) 2020 - 2022 < >
;;;
;;; 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 retain the above copyri... | null | https://raw.githubusercontent.com/shirok/Gauche/e606bfe5a94b100d5807bca9c2bb95df94f60aa6/lib/srfi/78.scm | scheme |
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 retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in b... | SRFI-78 - Lightweight testing
Copyright ( c ) 2020 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
Otherwise ... |
c08f1b762dfa1a43799180c2832fb74ae9afcb78164d6410a7f3ee52de0d0ec2 | hyperledger-labs/fabric-chaincode-ocaml | GRPC_protoc_plugin.ml | let from_proto_stream from_proto msgs () =
(Option.map (fun msg ->
let msg = Ocaml_protoc_plugin.Reader.create msg in
Result.get_ok (from_proto msg)))
(msgs ())
let to_proto_stream to_proto rcps rcp =
to_proto rcp |> Ocaml_protoc_plugin.Writer.contents |> rcps
module Server = struct
type regis... | null | https://raw.githubusercontent.com/hyperledger-labs/fabric-chaincode-ocaml/6181ba3e8fb219a9a1b2ce2fe2ac1dc1a477c1bd/grpc-protoc-plugin/GRPC_protoc_plugin.ml | ocaml | let from_proto_stream from_proto msgs () =
(Option.map (fun msg ->
let msg = Ocaml_protoc_plugin.Reader.create msg in
Result.get_ok (from_proto msg)))
(msgs ())
let to_proto_stream to_proto rcps rcp =
to_proto rcp |> Ocaml_protoc_plugin.Writer.contents |> rcps
module Server = struct
type regis... | |
366e7ee7fb19e2502ec7d960c47f7f053be383f58e32ced142e9238b823fbf37 | boxer-project/boxer-sunrise | defsys.lisp | -*- Mode : Lisp ; rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / defsys.lisp , v 1.17.4.1 2017/01/19 11:51:03 martin Exp $ " -*-
Copyright ( c ) 1987 - -2017 LispWorks Ltd. All rights reserved .
(in-package "USER")
(pushnew :use-fli-gl-vector sys::*features*)
(defs... | null | https://raw.githubusercontent.com/boxer-project/boxer-sunrise/1ef5d5a65d00298b0d7a01890b3cd15d78adc1af/src/opengl/defsys.lisp | lisp | rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / defsys.lisp , v 1.17.4.1 2017/01/19 11:51:03 martin Exp $ " -*- |
Copyright ( c ) 1987 - -2017 LispWorks Ltd. All rights reserved .
(in-package "USER")
(pushnew :use-fli-gl-vector sys::*features*)
(defsystem "OPENGL"
(:optimize ((debug 3) (safety 3)))
:members ( "pkg"
"constants"
"types"
"vectors"
"fns"
("xfn... |
408693585632ee4a1e7a905b81c5d8ceab32699a6d88aa6d866e171e26b2d0ad | florence/cover | format-utils.rkt | #lang racket
(require racket/file
racket/function
racket/list
racket/match
racket/port
racket/set
racket/bool
syntax-color/racket-lexer
syntax-color/lexer-contract
syntax/modread
syntax/parse
data/interval-map
... | null | https://raw.githubusercontent.com/florence/cover/bc17e4e22d47b1da91ddaa5eafefe28f4675e85c/cover-test/cover/tests/format-utils.rkt | racket | #lang racket
(require racket/file
racket/function
racket/list
racket/match
racket/port
racket/set
racket/bool
syntax-color/racket-lexer
syntax-color/lexer-contract
syntax/modread
syntax/parse
data/interval-map
... | |
371adf6533b31fdc4206ed0f0124bdec573358c6f188c40d4dd0a46414e8eb9a | vbrankov/hdf5-ocaml | c_string.ml | open Bigarray
type t
external int_as_pointer : 'a -> 'b = "%int_as_pointer"
let null = int_as_pointer 0
external of_string : string -> t = "hdf5_c_string_of_string"
external to_string : t -> string = "hdf5_c_string_to_string"
external to_bigstring : t -> (char, int8_unsigned_elt, c_layout) Array1.t
= "hdf5_c_string... | null | https://raw.githubusercontent.com/vbrankov/hdf5-ocaml/7abc763189767cd6c92620f29ce98f6ee23ba88f/src/raw/c_string.ml | ocaml | open Bigarray
type t
external int_as_pointer : 'a -> 'b = "%int_as_pointer"
let null = int_as_pointer 0
external of_string : string -> t = "hdf5_c_string_of_string"
external to_string : t -> string = "hdf5_c_string_to_string"
external to_bigstring : t -> (char, int8_unsigned_elt, c_layout) Array1.t
= "hdf5_c_string... | |
2fbf05cd556de0ef767d4a24c827ebe1e2cb33914767f88da66778b5e3859477 | aryx/xix | threads_window.mli |
val thread: Window.t -> unit
| null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/windows/threads_window.mli | ocaml |
val thread: Window.t -> unit
| |
fe71b13072dc98a77328f942e1a9fe1017becff56069358487b714121a0804a0 | inaka/elvis_core | pass_operator_spaces_elvis_attr.erl | %% Initial comment
%% Another initial comment
-module(pass_operator_spaces_elvis_attr).
-dialyzer({nowarn_function , function7/0}).
-elvis([{elvis_style , operator_spaces , #{rules => [{right , "++"} ,
{left , ","}]}}]).
-elvis([{elvis_style , no_space , #{rules =>... | null | https://raw.githubusercontent.com/inaka/elvis_core/7838443e81079d3d22c20be1108156ff0e491156/test/examples/pass_operator_spaces_elvis_attr.erl | erlang | Initial comment
Another initial comment
No space before and after coma,on a comment.
commas within strings must be ignored | -module(pass_operator_spaces_elvis_attr).
-dialyzer({nowarn_function , function7/0}).
-elvis([{elvis_style , operator_spaces , #{rules => [{right , "++"} ,
{left , ","}]}}]).
-elvis([{elvis_style , no_space , #{rules => [{right , "("} , {left , ")"}]}}]).
-export([... |
18c2d9043ec0fcc8476a083e48e1527d168cc5851bd503f6c9bd83b6b883015d | iloveponies/i-am-a-horse-in-the-land-of-booleans | i_am_a_horse_in_the_land_of_booleans.clj | (ns i-am-a-horse-in-the-land-of-booleans
(:refer-clojure :exclude [boolean]))
(defn boolean [x]
":(")
(defn abs [x]
":(")
(defn divides? [divisor n]
":(")
(defn fizzbuzz [n]
":(")
(defn teen? [age]
":(")
(defn not-teen? [age]
":(")
(defn generic-doublificate [x]
":(")
(defn leap-year? [year]
"... | null | https://raw.githubusercontent.com/iloveponies/i-am-a-horse-in-the-land-of-booleans/8b7b34d40bf4cf71805cb567468c3f8ee56c16ce/src/i_am_a_horse_in_the_land_of_booleans.clj | clojure | '_______' | (ns i-am-a-horse-in-the-land-of-booleans
(:refer-clojure :exclude [boolean]))
(defn boolean [x]
":(")
(defn abs [x]
":(")
(defn divides? [divisor n]
":(")
(defn fizzbuzz [n]
":(")
(defn teen? [age]
":(")
(defn not-teen? [age]
":(")
(defn generic-doublificate [x]
":(")
(defn leap-year? [year]
"... |
a351ac64203f4395aaf4a32abda366e905e07d2eb1e204396113dd923aec0de5 | sionescu/iolib | unix-syscall-path-strings.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Strings used for decoding Unix pathnames: invalid UTF8 octets
;;; are #\Null-escaped.
;;;
TODO : add 8bit - chars versions of SSTRING - TO - CSTRING ,
;;; COUNT-SSTRING-OCTETS and CSTRING-TO-SSTRING
(in-package :iolib/syscalls)
(eval-when (:compil... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/syscalls/unix-syscall-path-strings.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Strings used for decoding Unix pathnames: invalid UTF8 octets
are #\Null-escaped.
COUNT-SSTRING-OCTETS and CSTRING-TO-SSTRING
Automatic Conversion of Foreign Strings to sstrings
Should we free after translating from foreign?
Should we free after translati... | TODO : add 8bit - chars versions of SSTRING - TO - CSTRING ,
(in-package :iolib/syscalls)
(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew (cond
((<= char-code-limit #x100) :8bit-chars)
((<= #x101 char-code-limit #x10000) :16bit-chars)
((> char-... |
3681568abe7bc93f06c8aaa6d722b0614d63f7a9b21f1e1ba020811c4aafb98c | shirok/Gauche | ideque.scm | edition
(define-module scheme.ideque (extend data.ideque))
| null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/lib/scheme/ideque.scm | scheme | edition
(define-module scheme.ideque (extend data.ideque))
| |
e594d4d22b68382b0ae90e5e71adbc6078e6cffdc3500beb2cfbf192a7b6f859 | atgreen/lisp-openshift | ciphers.lisp | (in-package :crypto-tests)
(rtest:deftest verify-key.bad-cipher
(handler-case (crypto::verify-key :error
(make-array 0
:element-type '(unsigned-byte 8)))
(crypto:unsupported-cipher () :ok)
(:no-error () :error))
:ok)
(rtes... | null | https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/ironclad_0.30/testing/test-vectors/ciphers.lisp | lisp | (in-package :crypto-tests)
(rtest:deftest verify-key.bad-cipher
(handler-case (crypto::verify-key :error
(make-array 0
:element-type '(unsigned-byte 8)))
(crypto:unsupported-cipher () :ok)
(:no-error () :error))
:ok)
(rtes... | |
55dbc7e4c2ff16cb6aa9d2e9f55c19c31ac3ace0885b1a983b08d43f115af5c7 | cmiles74/clojure-hl7-messaging-2-parser | batch.clj | (ns com.nervestaple.hl7-parser.batch
(:require
[clojure.java.io :as io]
[clojure.string :as string]
[com.nervestaple.hl7-parser.parser :as parser])
(:import
(java.io BufferedReader StringReader)))
(defmulti get-lines
"Returns a sequence of lines for the provided Object. We would prefer to wrap
anot... | null | https://raw.githubusercontent.com/cmiles74/clojure-hl7-messaging-2-parser/b541bfa4c1d4d2572a253845d3c4afabe1463fea/src/com/nervestaple/hl7_parser/batch.clj | clojure | we're out of lines, return the last line
if the next line starts a new message, return our messages and the
rest of our lines
accumulate the current message | (ns com.nervestaple.hl7-parser.batch
(:require
[clojure.java.io :as io]
[clojure.string :as string]
[com.nervestaple.hl7-parser.parser :as parser])
(:import
(java.io BufferedReader StringReader)))
(defmulti get-lines
"Returns a sequence of lines for the provided Object. We would prefer to wrap
anot... |
a1145f1b24390923b70cc726c115dd9f63acafa34b2d42ea65bad1bfd23314f6 | standard-fish/summer-competititon-2019 | konas.rkt | #lang racket/base
(require 2htdp/image
racket/list
racket/format
racket/match
racket/string)
(provide kona-palette
kona-names
kona->name
kona->string
name->kona
name->kona-fraction
kona-categories
show-kona-palette
... | null | https://raw.githubusercontent.com/standard-fish/summer-competititon-2019/2e8d74f79b493e0307aa278b4500901c5d5157a8/entries/danprager/konas.rkt | racket | smoke
kona->name : color -> symbol or #f
kona->string : color -> string or #f
Given a category name (e.g. 'neutrals), what are the corresponding ; colors
Convert a color into an integer code
Mapping suitable for conversion to json
(map (λ (c) (list (overlay
(for ([cat kona-categories])
(require json)
(displ... | #lang racket/base
(require 2htdp/image
racket/list
racket/format
racket/match
racket/string)
(provide kona-palette
kona-names
kona->name
kona->string
name->kona
name->kona-fraction
kona-categories
show-kona-palette
... |
cfcc79c96acc042741b3461974da10af9bc97ab604c7b26ca421af7b4ebeb438 | sky-big/RabbitMQ | rabbit_mgmt_util.erl | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITH... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-management/src/rabbit_mgmt_util.erl | erlang | compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
TODO sort all this out; maybe there's scope for rabbit_mgmt_request?
--... | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ Management Plugin .
The Initial Developer of the Original Code... |
ac5e8db2bfe667cfa76ff5596dff7efeb537c836e467096e5bc2395b962d63db | rudymatela/conjure | ints.hs | -- ints.hs: conjuring functions over lists of ints
--
Copyright ( C ) 2021
-- Distributed under the 3-Clause BSD licence (see the file LICENSE).
import Conjure
second :: [Int] -> Int
second [x,y] = y
second [x,y,z] = y
second [x,y,z,w] = y
third :: [Int] -> Int
third [x,y,z] = z
third [x,y,z,w] = z
sum... | null | https://raw.githubusercontent.com/rudymatela/conjure/8681a56c6c005d8e968ab3f3910ec764cd3e8532/eg/ints.hs | haskell | ints.hs: conjuring functions over lists of ints
Distributed under the 3-Clause BSD licence (see the file LICENSE).
sum xs = if null xs then 0 else head xs + sum (tail xs)
product xs = if null xs then 1 else head xs * product (tail xs) | Copyright ( C ) 2021
import Conjure
second :: [Int] -> Int
second [x,y] = y
second [x,y,z] = y
second [x,y,z,w] = y
third :: [Int] -> Int
third [x,y,z] = z
third [x,y,z,w] = z
sum' :: [Int] -> Int
sum' [x] = x
sum' [x,y] = x+y
sum' [x,y,z] = x+y+z
product' :: [Int] -> Int
product' [x] ... |
5d392bd9f10655f9fb2261d973834a8be6d9bb8121df4df5a78ca8942be9a227 | meooow25/haccepted | DSUSpec.hs | module DSUSpec where
import Data.Array.IO
import Data.List
import Data.Maybe
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import Test.QuickCheck.Monadic
import DSU ( newD, sameSetD, unionD )
import Util ( genIntPair )
spec :: Spec
spec = do
prop "unions then find" $
forAll genDS... | null | https://raw.githubusercontent.com/meooow25/haccepted/a9a3f1223c7d1cbdae1bd83b10e721f37853eba6/tests/DSUSpec.hs | haskell | bounds, unions, find | module DSUSpec where
import Data.Array.IO
import Data.List
import Data.Maybe
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import Test.QuickCheck.Monadic
import DSU ( newD, sameSetD, unionD )
import Util ( genIntPair )
spec :: Spec
spec = do
prop "unions then find" $
forAll genDS... |
c2cd9800d678b39a4233b3173436ec7bddd245729d2d9460ecc328cf3d39566c | monadbobo/ocaml-core | error.ml | This module is trying to minimize dependencies on modules in Core , so as to allow Error
( and Or_error ) to be used in various places . Please avoid adding new dependencies .
(and Or_error) to be used in various places. Please avoid adding new dependencies. *)
open Sexplib.Std
open Bin_prot.Std
module C... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/error.ml | ocaml | constructor import
backtrace
We use [Sexp.to_string_mach], despite the fact that we are implementing
[to_strings_hum], because we want the error to fit on a single line, and once
we've had to resort to sexps, the message is going to start not looking so
pretty anyway.
We use [protect] to gua... | This module is trying to minimize dependencies on modules in Core , so as to allow Error
( and Or_error ) to be used in various places . Please avoid adding new dependencies .
(and Or_error) to be used in various places. Please avoid adding new dependencies. *)
open Sexplib.Std
open Bin_prot.Std
module C... |
c37153c8c6aedc34c28f5f4c161127e4fe6cdac83c76b27bb6eba81109ffbbb0 | haskell/cabal | CharParsing.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fspec - constr -fspec - constr - count=8 #
-----------------------------------------------------------------------------
-- |
Module : Distribution . Compat . CharParsing
Copyright : ( c ) 2011
-- Lic... | null | https://raw.githubusercontent.com/haskell/cabal/63841fb3380b902d12118fc272b5421a923cd647/Cabal-syntax/src/Distribution/Compat/CharParsing.hs | haskell | # LANGUAGE GADTs #
---------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
Originally in @parsers@ package.
---------------------------------------------------------------------------
* Combinato... | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fspec - constr -fspec - constr - count=8 #
Module : Distribution . Compat . CharParsing
Copyright : ( c ) 2011
Parsers for character streams
module Distribution.Compat.CharParsing
(
: : = > [ m
: : = > [ ... |
2a2991dc3c759530dbae2ab9cceac2a40a93a410fc56c7a34d1a8a7139d40e8f | gsakkas/rite | 20060312-00:03:36-75e554ed461a798f3b14545e2dfb6e02.seminal.ml | type exp = Int of int | Var of string
| Plus of exp * exp | Times of exp * exp
type stmt = Skip | Assign of string * exp
| Seq of stmt * stmt
| If of exp * stmt * stmt
| While of exp * stmt
type heapElement =
IntEntry of int
| HeapEntry of heap
and heap ... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060312-00%3A03%3A36-75e554ed461a798f3b14545e2dfb6e02.seminal.ml | ocaml | type heap = (string * int) list | type exp = Int of int | Var of string
| Plus of exp * exp | Times of exp * exp
type stmt = Skip | Assign of string * exp
| Seq of stmt * stmt
| If of exp * stmt * stmt
| While of exp * stmt
type heapElement =
IntEntry of int
| HeapEntry of heap
and heap ... |
d12ddefa818b1e0b65dae628c287637f8c7d1fd02f15714b11befd1a8db4401a | PacktWorkshops/The-Clojure-Workshop | project.clj | (defproject hello-drag-and-drop "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.520"]
[j... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter09/Exercise9.09/hello-drag-and-drop/project.clj | clojure | (defproject hello-drag-and-drop "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.520"]
[j... | |
19d0e57d7826dfed332977a533a27374f8f0d13e2923961e14506320ae578b13 | Clojure2D/clojure2d-examples | bvh.clj | (ns rt4.the-next-week.ch07b.bvh
(:require [rt4.the-next-week.ch07b.hittable :as hittable]
[rt4.the-next-week.ch07b.aabb :as aabb]
[rt4.the-next-week.ch07b.interval :as interval]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch07b/bvh.clj | clojure | (ns rt4.the-next-week.ch07b.bvh
(:require [rt4.the-next-week.ch07b.hittable :as hittable]
[rt4.the-next-week.ch07b.aabb :as aabb]
[rt4.the-next-week.ch07b.interval :as interval]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-... | |
404bea08c383b65b5d2c89a365eb1a7352be0b933c86bc55c0caafe45e3102a4 | Simre1/haskell-game | Embed.hs | # LANGUAGE TemplateHaskell #
module Polysemy.Embed
( -- * Effect
Embed (..)
-- * Actions
, embed
-- * Interpretations
, runEmbedded
) where
import Polysemy
import Polysemy.Embed.Type (Embed (..))
------------------------------------------------------------------------------
| Given a natural ... | null | https://raw.githubusercontent.com/Simre1/haskell-game/272a0674157aedc7b0e0ee00da8d3a464903dc67/polysemy/src/Polysemy/Embed.hs | haskell | * Effect
* Actions
* Interpretations
----------------------------------------------------------------------------
| # LANGUAGE TemplateHaskell #
module Polysemy.Embed
Embed (..)
, embed
, runEmbedded
) where
import Polysemy
import Polysemy.Embed.Type (Embed (..))
| Given a natural transform from @m1@ to @m2@
run a @Embed m1@ effect by transforming it into a @Embed m2@ effect .
@since 1.0.0.0
runEmbedded
:: f... |
1a2163e6ee68418524e0460a386d72743ec27060ec8a6045b89f4c83cd5299ab | gowthamk/ocaml-irmin | versioned_types.ml | open Printf
open Msigs
open Lwt.Infix
module Id = Tpcc.Id
type id = Id.t
let id = Id.t
let counter_merge = Tpcc.counter_merge
let from_just op msg = match op with
| Some x -> x
| None -> failwith @@ msg^": Expected Some. Got None."
module Serialization(S:sig
type t
... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/apps/tpcc/versioned_types.ml | ocaml | Creates a Git backend | open Printf
open Msigs
open Lwt.Infix
module Id = Tpcc.Id
type id = Id.t
let id = Id.t
let counter_merge = Tpcc.counter_merge
let from_just op msg = match op with
| Some x -> x
| None -> failwith @@ msg^": Expected Some. Got None."
module Serialization(S:sig
type t
... |
a2fd00c4587544b376f5be36e3768d9b3c7a75feed9a3241ffe09a3f53fa4a99 | input-output-hk/Alonzo-testnet | DeadlinePolicy.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Temp... | null | https://raw.githubusercontent.com/input-output-hk/Alonzo-testnet/1fd8da32d44ba48164931eb3e30f1a34e45955af/resources/plutus-sources/plutus-deadline/src/Cardano/PlutusDeadline/DeadlinePolicy.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
transaction's valid range must be after this
# INLINABLE mkPolicy # | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies... |
251dc2d09700d8b16e75db814e6dd42561cc471127b43b652578621595c9082d | facebookarchive/pfff | ast_ml.ml |
*
* Copyright ( C ) 2010 , 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_ml/parsing/ast_ml.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
* A Concrete Syntax Tree for OCaml.
*
* less: do an Abstract Syntax Tree as in ast_java.ml; need less CST
* now that we use the fuzzy approach for sgrep... |
*
* Copyright ( C ) 2010 , 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file... |
39f1d1495ee3d931b56cab7f0f522c0ef046657e5b5feaf68ca557f1224e51ee | pmatos/racket-loci | test_locus-print.rkt | #lang racket
;; ---------------------------------------------------------------------------------------------------
(require loci)
;; ---------------------------------------------------------------------------------------------------
(define (go)
(printf "Hello World from Locus~n"))
(define (main)
(define l
... | null | https://raw.githubusercontent.com/pmatos/racket-loci/ce063c7e45d5abb7c187766b3ab7045ef2f84099/test/test_locus-print.rkt | racket | ---------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------- | #lang racket
(require loci)
(define (go)
(printf "Hello World from Locus~n"))
(define (main)
(define l
(locus ch
(go)))
(locus-wait l))
(module+ main
(printf "starting up~n")
(main))
|
342b10cd3fb1d3bca58cd28d102cb305f1e2075b5bd0277b27045fde4cfcf378 | privet-kitty/cl-competitive | dinic.lisp | (defpackage :cp/test/dinic
(:use :cl :fiveam :cp/dinic :cp/max-flow)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/dinic)
(in-suite base-suite)
(test dinic
(let ((graph (make-array 2 :element-type 'list :initial-element nil)))
(add-edge graph 0 1 10)
(is (= 10 (max-flow! graph 0 1)))
... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/test/dinic.lisp | lisp | Example from -flow-problem-introduction/ | (defpackage :cp/test/dinic
(:use :cl :fiveam :cp/dinic :cp/max-flow)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/dinic)
(in-suite base-suite)
(test dinic
(let ((graph (make-array 2 :element-type 'list :initial-element nil)))
(add-edge graph 0 1 10)
(is (= 10 (max-flow! graph 0 1)))
... |
447db50b033450dc0e8821ef5df51b6100ea836c18a99c336955c91a16dcdc41 | PEZ/rich4clojure | problem_080.clj | (ns rich4clojure.medium.problem-080
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Perfect Numbers =
By 4Clojure user :
;; Difficulty: Medium
;;
;; A number is "perfect" if the sum of its divisors equal
the number itself . 6 is a perfect number because
1 + 2 + 3=6 . Write a function which returns true for... | null | https://raw.githubusercontent.com/PEZ/rich4clojure/28ea575ede8677f3a97437a646cdb3376a28ebc9/src/rich4clojure/medium/problem_080.clj | clojure | = Perfect Numbers =
Difficulty: Medium
A number is "perfect" if the sum of its divisors equal
perfect numbers and false otherwise.
Share your solution, and/or check how others did it:
| (ns rich4clojure.medium.problem-080
(:require [hyperfiddle.rcf :refer [tests]]))
By 4Clojure user :
the number itself . 6 is a perfect number because
1 + 2 + 3=6 . Write a function which returns true for
(def __ :tests-will-fail)
(comment
)
(tests
(__ 6) := true
(__ 7) := false
(__ 496) := true
... |
8194c886af52fdc192a781d1ac24cf492ac648343b62f45f6cd047c46734f6f0 | yuriy-chumak/ol | srfi-8.scm | (define-library (scheme srfi-8)
(import (scheme core) (srfi 8))
(export
(exports (srfi 8))) )
| null | https://raw.githubusercontent.com/yuriy-chumak/ol/0a38b3f9dbb720aa3fbc3e8219429ebe240c86bf/libraries/scheme/srfi-8.scm | scheme | (define-library (scheme srfi-8)
(import (scheme core) (srfi 8))
(export
(exports (srfi 8))) )
| |
83ceb8fd92a2965ef101f4d5dd1dc21e595391800488c3370ff1e784ff3d075a | overtone/overtone | sample.clj | (ns
^{:doc "Making it easy to load and play audio samples (wav or aif files)."
:author "Jeff Rose"}
overtone.sc.sample
(:use [clojure.java.io :only [file]]
[overtone.helpers.lib]
[overtone.helpers.synth]
[overtone.libs.event]
[overtone.libs.deps]
[overtone.sc.serv... | null | https://raw.githubusercontent.com/overtone/overtone/9afb513297662716860a4010bc76a0e73c65ca37/src/overtone/sc/sample.clj | clojure | e.g.
always load the entire sample, hence same args always
e.g.
Samples are just audio files loaded into a buffer, so buffer
functions work on samples too. | (ns
^{:doc "Making it easy to load and play audio samples (wav or aif files)."
:author "Jeff Rose"}
overtone.sc.sample
(:use [clojure.java.io :only [file]]
[overtone.helpers.lib]
[overtone.helpers.synth]
[overtone.libs.event]
[overtone.libs.deps]
[overtone.sc.serv... |
1a11f82363ba6208641a8e918960795dff9865dca417fd3d2ab89189ebff598a | Leberwurscht/Diaspora-User-Directory | bdb.ml | (* Exception declarations *)
exception DBError of string
let _ = Callback.register_exception "dberror" (DBError "")
exception Key_exists
let _ = Callback.register_exception "keyexists" Key_exists
exception Run_recovery
let _ = Callback.register_exception "dbrunrecovery" Run_recovery
external db_init : unit -> unit ... | null | https://raw.githubusercontent.com/Leberwurscht/Diaspora-User-Directory/1ca4a06a67d591760516edffddb0308b86b6314c/trie_manager/bdb/bdb.ml | ocaml | Exception declarations
Note: A cursor created with a transaction must be closed before
the transaction is committed or aborted
DIRTY_READ |
set max # of active transactions |
exception DBError of string
let _ = Callback.register_exception "dberror" (DBError "")
exception Key_exists
let _ = Callback.register_exception "keyexists" Key_exists
exception Run_recovery
let _ = Callback.register_exception "dbrunrecovery" Run_recovery
external db_init : unit -> unit = "caml_db_init"
let _ = db_i... |
a262fbe0b0c9ba44d2b243f388b217e695fdc9083a126ba8aba58afce54c4398 | rescript-lang/rescript-compiler | lam_compile.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* 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... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/5da6c88fb9237fbc4d61640187b82627690ccf39/jscomp/core/lam_compile.ml | ocaml | All arguments consumed so far
unknown info
alpha conversion now? --
Since we did an alpha conversion before so it is not here
can not happen, unless it's an exception ?
assume outer is [Lstaticcatch]
TODO:
for expression generation,
name, should_return is not needed,
only jmp_table an... | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* 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... |
457f67cead2b4a43e0cf6811d1fec6ff05f46981cbc5caafe179c47e588cdc68 | charlieg/Sparser | extend1.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1997 - 2005 -- all rights reserved
Copyright ( c ) 2007 BBNT Solutions LLC . All Rights Reserved
$ Id:$
;;;
;;; File: "extend"
;;; Module: "objects;model:psi:"
version : 1.0 July 2007
initiated 11/29/97 . First ... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/model/psi/extend1.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "extend"
Module: "objects;model:psi:"
the find call. 2/4/05 Adding some generality - motivated by the call in
*force-new-psi* to handle the case where an identical description in fact
denoted a different individual. 7/29 'hav... | copyright ( c ) 1997 - 2005 -- all rights reserved
Copyright ( c ) 2007 BBNT Solutions LLC . All Rights Reserved
$ Id:$
version : 1.0 July 2007
initiated 11/29/97 . First given any content 7/7/98 . 2/14/99 canonicalized
Spread - sequence - across - ordinals . Added add - binding - to
0.1 ( 2/22/... |
1c07be4461a55634cd44512121756f7aa0032d4a1d08461baa1cbfdc04977cbd | mk270/archipelago | model.ml |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2013
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | null | https://raw.githubusercontent.com/mk270/archipelago/4241bdc994da6d846637bcc079051405ee905c9b/src/model/model.ml | ocaml | ultimately, the submodules in here might be best as separate files
the material in this file is kept together largely to allow the
submodules to call each other without exposing all their interfaces
globally, which, now that I've stated it, sounds less like a bad idea
TBD
type body =
{
bd_heads : i... |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2013
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... |
a75273930fd31288996469940e6dc95bff5af5162d3dc9ca05db051bc580bd99 | MastodonC/kixi.stats | estimate_test.cljc | (ns kixi.stats.estimate-test
(:require [kixi.stats.estimate :as sut]
[kixi.stats.digest :as digest]
[kixi.stats.protocols :as p]
[clojure.test.check.generators :as gen]
[clojure.test.check]
[kixi.stats.test-helpers :refer [=ish approx= seq= numeric]]
... | null | https://raw.githubusercontent.com/MastodonC/kixi.stats/33626268e11238264421d6783ccbc03f9254d549/test/kixi/stats/estimate_test.cljc | clojure | Example from -statistics.com/regression/confidence-and-prediction-intervals/
Example from / | (ns kixi.stats.estimate-test
(:require [kixi.stats.estimate :as sut]
[kixi.stats.digest :as digest]
[kixi.stats.protocols :as p]
[clojure.test.check.generators :as gen]
[clojure.test.check]
[kixi.stats.test-helpers :refer [=ish approx= seq= numeric]]
... |
616bfda2ad5d0d23c7b80e67243770d9217313ea2cc12c15a5ab7215ef1a97a3 | scicloj/clj-djl | dataset.clj | (ns clj-djl.training.dataset
(:import [ai.djl.training.dataset Dataset
ArrayDataset ArrayDataset$Builder]
[ai.djl.ndarray NDArray]
[ai.djl.training.dataset Dataset$Usage BatchSampler SequenceSampler RandomSampler
Batch]))
(defn set-sampling
([builder sampler]
(.setS... | null | https://raw.githubusercontent.com/scicloj/clj-djl/b2ea23d2223a1b2423bf96e3cf2ccc66672b1392/src/clj_djl/training/dataset.clj | clojure | (ns clj-djl.training.dataset
(:import [ai.djl.training.dataset Dataset
ArrayDataset ArrayDataset$Builder]
[ai.djl.ndarray NDArray]
[ai.djl.training.dataset Dataset$Usage BatchSampler SequenceSampler RandomSampler
Batch]))
(defn set-sampling
([builder sampler]
(.setS... | |
dc2a54184f7b4a4ff3cdebafe812aa7edce6c79078f8acf053ea28864d04ce5e | ananthakumaran/eopl | 18.clj | ;; We usually represent a sequence of values as a list. In this
representation , it is easy to move from one element in a sequence
;; to the preceding one without the help of context
;; arguments. Implement non-empty bidirectional sequences of integers,
;; as suggested by the grammer
NodeInSequence : : = ( Int Lis... | null | https://raw.githubusercontent.com/ananthakumaran/eopl/876d6c2e44865e2c89a05a683d99a289c71f1487/src/eopl/chap_2/18.clj | clojure | We usually represent a sequence of values as a list. In this
to the preceding one without the help of context
arguments. Implement non-empty bidirectional sequences of integers,
as suggested by the grammer
In this representation, implement the procedure number->sequence,
which takes a number and produces a sequen... | representation , it is easy to move from one element in a sequence
NodeInSequence : : = ( Int Listof(Int ) Listof(Int ) )
The first list of numbers is the elements of the sequence preceding
the current one in reverse order , and the second list is the
elements of the sequence after the current one . For exa... |
557f5f5623bd2722ce975790b25e4874506810ed032e9720444c8c9f501692c6 | Happy0/wordify | FullGameTest.hs | module Tests.FullGameTest where
import Wordify.Rules.Dictionary
import qualified Data.Map as M
import Wordify.Rules.ScrabbleError
import Wordify.Rules.LetterBag
import Wordify.Rules.Pos
import Wordify.Rules.Tile
import Wordify.Rules.Board
import Data.Maybe
import Wordify.Rules.Move
... | null | https://raw.githubusercontent.com/Happy0/wordify/70704824ae6829c518ab24875ba6b98ebf5db158/test/Tests/FullGameTest.hs | haskell | This player scored a bingo word | module Tests.FullGameTest where
import Wordify.Rules.Dictionary
import qualified Data.Map as M
import Wordify.Rules.ScrabbleError
import Wordify.Rules.LetterBag
import Wordify.Rules.Pos
import Wordify.Rules.Tile
import Wordify.Rules.Board
import Data.Maybe
import Wordify.Rules.Move
... |
26fcad5dba46161efd0a5b1fb7850fbcc4fe6628ba1c07450e2bdeb00e6d72f3 | LightAndLight/closure | LLVM.hs | {-# language FlexibleContexts #-}
{-# language OverloadedStrings #-}
module LLVM where
import Control.Monad (void)
import Control.Monad.Reader (MonadReader, asks, local)
import Data.Foldable (traverse_)
import LLVM.AST (Operand)
import LLVM.IRBuilder (MonadModuleBuilder, MonadIRBuilder)
import qualified LLVM.AST.Con... | null | https://raw.githubusercontent.com/LightAndLight/closure/fc7545d7764d9f1b63f65bbe4d2a2ace35eeaba2/src/LLVM.hs | haskell | # language FlexibleContexts #
# language OverloadedStrings # | module LLVM where
import Control.Monad (void)
import Control.Monad.Reader (MonadReader, asks, local)
import Data.Foldable (traverse_)
import LLVM.AST (Operand)
import LLVM.IRBuilder (MonadModuleBuilder, MonadIRBuilder)
import qualified LLVM.AST.Constant as LLVM
import qualified LLVM.AST.Name as LLVM
import qualified... |
9a95528662e7f715bbb54425b09755aab0fcedfc8342c34bcad9c0245de49a41 | basho/riak_core | riak_core_bucket.erl | %% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
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
except... | null | https://raw.githubusercontent.com/basho/riak_core/762ec81ae9af9a278e853f1feca418b9dcf748a3/src/riak_core_bucket.erl | erlang | -------------------------------------------------------------------
riak_core: Core Riak Application
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
sp... | 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 , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
9d3a6ae393348132ee4eda5ffd6d8b012e2a8215e101d92caca98d6dd68cafbb | hsyl20/haskus-system | Relocation.hs | -- | ELF relocations
module Haskus.Format.Elf.Relocation
( RelocationEntry (..)
, getRelocationEntry
, putRelocationEntry
)
where
import Haskus.Format.Binary.Bits
import Haskus.Format.Binary.Get
import Haskus.Format.Binary.Put
import Haskus.Format.Binary.Word
import Haskus.Format.Elf.PreHeader
import Hasku... | null | https://raw.githubusercontent.com/hsyl20/haskus-system/2f389c6ecae5b0180b464ddef51e36f6e567d690/haskus-system/src/lib/Haskus/Format/Elf/Relocation.hs | haskell | | ELF relocations
| Relocation entry
| Getter for a relocation entry
| Putter for a relocation entry | module Haskus.Format.Elf.Relocation
( RelocationEntry (..)
, getRelocationEntry
, putRelocationEntry
)
where
import Haskus.Format.Binary.Bits
import Haskus.Format.Binary.Get
import Haskus.Format.Binary.Put
import Haskus.Format.Binary.Word
import Haskus.Format.Elf.PreHeader
import Haskus.Format.Elf.Header
i... |
7f9dced32470baad01750b1e2e76fdd6b865be2ac71ae7f3fd10c629786ffa2a | ocaml-ppx/ocamlformat | Fmt_odoc.ml | (**************************************************************************)
(* *)
(* OCamlFormat *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/95ee0a16f2d2d7d57f4df1a1c2a9410f4c0e637a/lib/Fmt_odoc.ml | ocaml | ************************************************************************
OCamlFormat
... | Copyright ( c ) Facebook , Inc. and its affiliates .
This source code is licensed under the MIT license found in
open Fmt
open Odoc_parser.Ast
module Loc = Odoc_parser.Loc
type conf = {fmt_code: Fmt.code_formatter}
* Escape characters if they are not already escaped . [ ] shou... |
ff4ac26b670f0e4661f59a6a891fa94a581c331376f867ed8294704d78cf42f4 | lijunsong/fl-compiler | env.ml | * This file implements type environment and value environment for
type checking .
Separating the two environments allows an identifier to be used as a
type i d as well as a variable or a function name at the same time .
This file sets up initial type environment and value environment .
... | null | https://raw.githubusercontent.com/lijunsong/fl-compiler/6d2938855012a7a0a8767dc342f6abb454c43eec/frontend/env.ml | ocaml | * type ids
* built-in function ids. each tuple is (function name, arg type,
return type)
* value_env maps variable id and function id to its type
* type_env maps type id to types
* initial value environment
pass all args on stack
* initial type environment | * This file implements type environment and value environment for
type checking .
Separating the two environments allows an identifier to be used as a
type i d as well as a variable or a function name at the same time .
This file sets up initial type environment and value environment .
... |
9355f875abd1c92199a244477ee61e201d3b517a9cda53d835613a4b41f2c681 | gjz010/slowql | Utils.hs | {-# LANGUAGE OverloadedStrings #-}
module SlowQL.Utils where
import Data.Maybe
import Foreign.Storable
import Data.Word
import Foreign.Ptr
import Data.Binary.Put
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as B... | null | https://raw.githubusercontent.com/gjz010/slowql/5e8c698eeb10222082f5fb5bf5dabd4105819c77/src/SlowQL/Utils.hs | haskell | # LANGUAGE OverloadedStrings #
we use ascii-form here to make it readable | module SlowQL.Utils where
import Data.Maybe
import Foreign.Storable
import Data.Word
import Foreign.Ptr
import Data.Binary.Put
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BSL
import Data.List (unfoldr)
... |
6fec652834cafc5a8def6139be581d464957ce01e9e079d50ee6edd6f5048a6a | static-analysis-engineering/codehawk | bCHTranslateToCHIF.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/45f39248b404eeab91ae225243d79ec0583c3331/CodeHawk/CHB/bchlibx86/bCHTranslateToCHIF.ml | ocaml | chutil
xprlib
bchlib
bchlibx86
special operation semantics
commands that increment or decrement a register based on the value of the direction flag
control flow is handled separately
move operations
~src_size:1 ~dst_size:w ~zero_extend:tr... | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
beb58bc6be2a88b37b528bf7f46711549a571e2a302782b0f53d735b8bcde662 | oshyshko/adventofcode | D06.hs | module Y21.D06 where
import qualified Data.IntMap.Strict as M
import Imports
solve :: Int -> String -> Int
solve n =
sum
. map snd
. (!! n)
. iterate tick
. map ((, 1::Int) . read @Int)
. splitOn ","
where
tick :: (k ~ M.Key, Num v) => [(k, v)] -> [(k, v)]
tick xs = M.fromListWith... | null | https://raw.githubusercontent.com/oshyshko/adventofcode/921b96e3bfdd791695e07dd7f40e87e217e55d66/src/Y21/D06.hs | haskell | module Y21.D06 where
import qualified Data.IntMap.Strict as M
import Imports
solve :: Int -> String -> Int
solve n =
sum
. map snd
. (!! n)
. iterate tick
. map ((, 1::Int) . read @Int)
. splitOn ","
where
tick :: (k ~ M.Key, Num v) => [(k, v)] -> [(k, v)]
tick xs = M.fromListWith... | |
32c5288955c727fdb419c91054a1a148b023f8081b34290d6fe958bb548fa414 | besport/calendar | version.mli | (**************************************************************************)
(* *)
(* This file is part of Calendar. *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/besport/calendar/f30f515614ee810b2e063f56f5e50f41ecaeae96/src/version.mli | ocaml | ************************************************************************
This file is part of Calendar.
... | Copyright ( C ) 2003 - 2011
Lesser General Public License version 2.1 as published by the
Free Software Foundation , with a special linking exception ( usual
See the GNU Lesser General Public Licence version 2.1 for more
val version: string
val date: string
|
b8ec62ae2bf9cb604518b6dc1744827c357f8f9f56fad26e526bc41ab8fe7d38 | amnh/PCG | Time.hs | ------------------------------------------------------------------------------
-- |
Module : Benchmark .
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
--------------------------------------------... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/lib/file-parsers/bench/Benchmark/FASTA/Time.hs | haskell | ----------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
---------------------------------------------------------------------------
import qualified Data.Text.IO as T
|
Perform the run ti... | Module : Benchmark .
Copyright : ( c ) 2015 - 2021 Ward Wheeler
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Benchmark.FASTA.Time
( benchTime
) where
import Benchmark.FASTA.Files
import Benchmark.Internal (measureParserTime)
import Control... |
44a0f7c43cb8ecebb8300f016cc7467f64b79f132016243d0a6fa04dda974d91 | noinia/hgeometry | HyperPlane.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE UndecidableInstances #
# LANGUAGE TemplateHaskell #
--------------------------------------------------------------------------------
-- |
Module : Geometry . HyperPlane
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
--------... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Geometry/HyperPlane.hs | haskell | # LANGUAGE DeriveAnyClass #
------------------------------------------------------------------------------
|
License : see the LICENSE file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Hyperplanes... | # LANGUAGE UndecidableInstances #
# LANGUAGE TemplateHaskell #
Module : Geometry . HyperPlane
Copyright : ( C )
Maintainer :
module Geometry.HyperPlane where
import Control.DeepSeq
import Control.Lens
import Geometry.Line
import Geometry.Point
import Geometry.Properties
import Geometry.Tra... |
88bb61daced7fef05b992792894dc2115560fa1b410c6f1f7ac7f81541794eaa | iamFIREcracker/adventofcode | day10.lisp | (defpackage :aoc/2019/10 #.cl-user::*aoc-use*)
(in-package :aoc/2019/10)
(defstruct region
height
width
asteroids)
(defun read-asteroids (data height width &aux (asteroids (make-hash-table)))
(prog1 asteroids
(dorange (i 0 height)
(let ((row (nth i data)))
(dorange (j 0 width)
(whe... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/c395df5e15657f0b9be6ec555e68dc777b0eb7ab/src/2019/day10.lisp | lisp | (defpackage :aoc/2019/10 #.cl-user::*aoc-use*)
(in-package :aoc/2019/10)
(defstruct region
height
width
asteroids)
(defun read-asteroids (data height width &aux (asteroids (make-hash-table)))
(prog1 asteroids
(dorange (i 0 height)
(let ((row (nth i data)))
(dorange (j 0 width)
(whe... | |
8217efaea0d938b3b13b105a816e59c2f5d2da96321f403044a698e09a61c078 | jubnzv/moonsmith | generatorCalls.ml | open Core_kernel
(** Generates a call statement for a free function with definition of its
parameters, using information about types of the arguments. *)
let gen_fcall_from_fdef stmt =
let open Ast in
match stmt with
| FuncDefStmt fd -> begin
let gen_varags () =
let rec aux acc num =
... | null | https://raw.githubusercontent.com/jubnzv/moonsmith/267989065d061be114629d7a88c729a02430320e/src/generatorCalls.ml | ocaml | * Generates a call statement for a free function with definition of its
parameters, using information about types of the arguments.
Generate arguments for function call with their initialization
statements.
Set type of the function call.
Assign result to variables.
Generate call expression. | open Core_kernel
let gen_fcall_from_fdef stmt =
let open Ast in
match stmt with
| FuncDefStmt fd -> begin
let gen_varags () =
let rec aux acc num =
let len = List.length acc in
if num > len then
let idx = Context.get_free_idx ()
and id_ty = Util.choose_on... |
f2d20a8e2f1e6a3fa84275e34595c6aaff6f7ea7ab9098eb1bcbe00a7e0ea439 | kappelmann/eidi2_repetitorium_tum | ha8.mli | val get_in_edges :
Ha8_angabe.cfg -> Ha8_angabe.node_id -> Ha8_angabe.edge list
val get_out_edges :
Ha8_angabe.cfg -> Ha8_angabe.node_id -> Ha8_angabe.edge list
val must_compute_wp : Ha8_angabe.cfg -> Ha8_angabe.node_id -> bool
val can_compute_wp : Ha8_angabe.cfg -> Ha8_angabe.node_id -> bool
val set_wp :
Ha8_ang... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/additional_exercises/2016_17/Blatt%208%20L%C3%B6sungen/ocaml/ha8.mli | ocaml | val get_in_edges :
Ha8_angabe.cfg -> Ha8_angabe.node_id -> Ha8_angabe.edge list
val get_out_edges :
Ha8_angabe.cfg -> Ha8_angabe.node_id -> Ha8_angabe.edge list
val must_compute_wp : Ha8_angabe.cfg -> Ha8_angabe.node_id -> bool
val can_compute_wp : Ha8_angabe.cfg -> Ha8_angabe.node_id -> bool
val set_wp :
Ha8_ang... | |
2bf9b816c8e6fa555770d90db14b0a1314e37fea50b2391356e2e5fbadc1fd49 | ghcjs/jsaddle-dom | ReadableStreamSource.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.ReadableStreamSource
(start, pull, cancel, getController, ReadableStreamSource(..),
gTypeReadableStreamSour... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/ReadableStreamSource.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/ReadableStreamSource.start Mozilla ReadableStreamSource.start documentation>
| <-US/docs/Web/API/ReadableStreamSource.cancel Mozilla ReadableStreamSource.cancel documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.ReadableStreamSource
(start, pull, cancel, getController, ReadableStreamSource(..),
gTypeReadableStreamSource)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe,... |
66642eab5ace98feb2160d93716db148ac05d14e33d9ca88b10707a77365b97b | sordina/Deadpan-DDP | PropsBijection.hs |
|
Description : Bijection Properties for the EJsonValue datatype
Bijection Properties for the EJsonValue datatype
Description : Bijection Properties for the EJsonValue datatype
Bijection Properties for the EJsonValue datatype
-}
# OPTIONS_GHC -fno - warn - orphans #
{-# LANGUAGE RankNTypes #-}
{... | null | https://raw.githubusercontent.com/sordina/Deadpan-DDP/d0f115cbc7132a87cababc587064d8f851165e85/src/Data/EJson/PropsBijection.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE FlexibleInstances #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
-util/blob/master/Data/Aeson/Util/Test.hs
TODO: Clean this up by using a proper library for Value Arbitrary instance
| prop> prop_value2EJson_bijection
TODO: Go back the other way... |
|
Description : Bijection Properties for the EJsonValue datatype
Bijection Properties for the EJsonValue datatype
Description : Bijection Properties for the EJsonValue datatype
Bijection Properties for the EJsonValue datatype
-}
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE MultiParamTypeCla... |
598ba214b90350aecf1f7419f7ad966799cf7cad67d299287646775bd3ed9f59 | foretspaisibles/cl-kaputt | example.lisp | example.lisp — A Kaputt Example
( -kaputt )
This file is part of Kaputt .
;;;;
Copyright © 2019–2021
;;;; All rights reserved.
This software is governed by the CeCILL - B license under French law and
;;;; abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute... | null | https://raw.githubusercontent.com/foretspaisibles/cl-kaputt/94ff2a96ced6576e3995b445b78ab2a4bf09c57f/example/example.lisp | lisp |
All rights reserved.
abiding by the rules of distribution of free software. You can use,
"-B_V1-en.txt" | example.lisp — A Kaputt Example
( -kaputt )
This file is part of Kaputt .
Copyright © 2019–2021
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribute the software under the terms of the CeCILL - B
license as circulated by CEA , CNRS and INRIA at the fol... |
da0bf417c62739ede1315ff39beaabbc62249e9f3c9cc16af01c01054a0ff446 | topmonks/fe-mode | ql_tests.cljs | (ns fe-mode.ql-tests
(:require
[goog.dom]
[clojure.test :as test :refer [deftest testing]]
[fe-mode.lit :as lit]
[fe-mode.ql :as ql :refer-macros [get-query]]
["lit-html/lib/template-result" :refer [SVGTemplateResult TemplateResult]]))
(deftest actualize-test
(testing "non-sequences evaluate to... | null | https://raw.githubusercontent.com/topmonks/fe-mode/c68547b7ebd7a8c9bc6f2877856bd8f3b40a71f3/test/fe_mode/ql_tests.cljs | clojure | parsing
a default method is required
rendering | (ns fe-mode.ql-tests
(:require
[goog.dom]
[clojure.test :as test :refer [deftest testing]]
[fe-mode.lit :as lit]
[fe-mode.ql :as ql :refer-macros [get-query]]
["lit-html/lib/template-result" :refer [SVGTemplateResult TemplateResult]]))
(deftest actualize-test
(testing "non-sequences evaluate to... |
6be9259f03bc53c572b67880f81b0227e6da5a5f218b30abc53e8cbfb1721b2a | jackfirth/lens | cadr-etc.rkt | #lang racket/base
(require racket/contract
syntax/parse/define
lens/private/base/main
lens/private/compound/main
"car-cdr.rkt"
(for-syntax racket/base
racket/syntax))
(module+ test
(require rackunit))
(define-simple-macro (provide-c_r-lenses id:id ... | null | https://raw.githubusercontent.com/jackfirth/lens/733db7744921409b69ddc78ae5b23ffaa6b91e37/lens-data/lens/private/list/cadr-etc.rkt | racket | #lang racket/base
(require racket/contract
syntax/parse/define
lens/private/base/main
lens/private/compound/main
"car-cdr.rkt"
(for-syntax racket/base
racket/syntax))
(module+ test
(require rackunit))
(define-simple-macro (provide-c_r-lenses id:id ... | |
196e59e0ebae57155de85ce09b612f40253a1f3c605903296e27f16bb82169fc | anmonteiro/piaf | status.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2020 ,
* 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 . Redistribu... | null | https://raw.githubusercontent.com/anmonteiro/piaf/a4ea85f29f41bd37d88aac2bb94a89967a8136a7/lib/status.ml | ocaml | #section-3 | ----------------------------------------------------------------------------
* Copyright ( c ) 2020 ,
* 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 . Redistribu... |
826b2f00a9a29ee3eb650c8d0382c7b71c2218bf164db988a1f55015e3b6f58b | flipstone/haskell-for-beginners | 2_the_monad_typeclass.hs | -- Use Monad functions to wrap these
-- values in the Maybe monad.
--
foo = return "foo" :: Maybe String
one = return 1 :: Maybe Integer
threes = return [3,3,3] :: Maybe [Integer]
-- Use >>=, return, and the values above
-- to calculate the following values
--
oof = foo >>= (\x -> return (reverse x))
two = one >>= re... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_12/2_the_monad_typeclass.hs | haskell | Use Monad functions to wrap these
values in the Maybe monad.
Use >>=, return, and the values above
to calculate the following values
Re-define your byTwo and byFour functions
from the previous section, but use the
Monads.
Perform the same calculations as in the previous
section | foo = return "foo" :: Maybe String
one = return 1 :: Maybe Integer
threes = return [3,3,3] :: Maybe [Integer]
oof = foo >>= (\x -> return (reverse x))
two = one >>= return . (+1)
to make them work for all
byTwo :: Monad m => Integer -> m Integer
byTwo n = if n `mod` 2 == 0
then return (n `div` 2)
... |
88d2650498338e79beaac7d22d24096409587c262a6118f64686e67952906fa7 | dfordivam/tenjinreader | KanjiBrowser.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE RecursiveDo #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE PartialTypeSignatures #
# LANGUAGE AllowAmbiguousTypes #
module KanjiBrowser where
import FrontendCommon
import qualified Data.Map... | null | https://raw.githubusercontent.com/dfordivam/tenjinreader/894a6f6b23d52c9c048740c0ea62f4c0f47d9561/frontend/src/KanjiBrowser.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs #
For empty Filter all radicals are valid
NW 1.1
Show either the filter options or the kanji details page
NW 1.1.1
NW 1.1.2
NW 1.1.3
NW 1.2
Widget to show kanjifilter
NW 1
NW 2
<- divClass "" $ do
t <- textInput def
d <- dropdown
def
m <- textIn... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE RecursiveDo #
# LANGUAGE FlexibleContexts #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE AllowAmbiguousTypes #
module KanjiBrowser where
import FrontendCommon
import qualified Data.Map as Map
import qualified Data.Text as T
import qualified D... |
99feaff7307e98d162eebfb308bb30952ca31a618d15d87086e1d6d307b70546 | Tim-ats-d/Macron | main.ml | type listen_channel =
| Both of string * string
| Mouse of string
| Keyboard of string
open Lwt.Syntax
let observe istream shortcuts =
let listeners = List.map Listener.make shortcuts in
let rec forever () =
let* input = IStream.get istream in
let* () = Lwt_list.iter_p (fun l -> l#listen input) list... | null | https://raw.githubusercontent.com/Tim-ats-d/Macron/bf9170f98d46b4388b323f31f1d860c2f9d699eb/lib/core/main.ml | ocaml | type listen_channel =
| Both of string * string
| Mouse of string
| Keyboard of string
open Lwt.Syntax
let observe istream shortcuts =
let listeners = List.map Listener.make shortcuts in
let rec forever () =
let* input = IStream.get istream in
let* () = Lwt_list.iter_p (fun l -> l#listen input) list... | |
f9db9cdbb471f4ce27339a16058661b017eace09aeeaf0b7a62fe2fce8577005 | Psi-Prod/Mehari | proxy.ml |
echo -e " gemini/ " | openssl s_client -crlf -connect localhost:1965 -servername foo
echo -e "gemini/" | openssl s_client -crlf -connect localhost:1965 -servername foo -ign_eof
*)
let router =
Mehari_eio.virtual_hosts ~meth:`ByURL
[
("foo", fun _ -> Mehari.response_text "foo");
("bar", fun _ -> ... | null | https://raw.githubusercontent.com/Psi-Prod/Mehari/e57202510dd43fa1ce75695cf1ab8f8caa49f0f0/examples/proxy.ml | ocaml |
echo -e " gemini/ " | openssl s_client -crlf -connect localhost:1965 -servername foo
echo -e "gemini/" | openssl s_client -crlf -connect localhost:1965 -servername foo -ign_eof
*)
let router =
Mehari_eio.virtual_hosts ~meth:`ByURL
[
("foo", fun _ -> Mehari.response_text "foo");
("bar", fun _ -> ... | |
3d32b8bcf50a9ed4b898f8c041b082ee50cb6c16fbbd3b7ecea6d6aa924e8f23 | epicallan/hreq | Main.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, ToJSON)
import Data.Text (Text)
... | null | https://raw.githubusercontent.com/epicallan/hreq/f12fcb9b9dd1ad903c6b36a8cf850edb213d4792/hreq-client/example/Main.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
| Assume we are making requests against an HTTP service providing a JSON user management API
| Don't run main without supplying a functioning baseUrl.
do something with API data | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeApplications #
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, ToJSON)
import Data.Text (Text)
import GHC.Generics (Generic)
import Hreq.Client
data User = User
{ name :: Text
, age :: Int
} d... |
a77db3753b61a42808dbcf7f94110639523b55c387e462665462deb599fae990 | jonase/lein-kibit | project.clj | (defproject lein-kibit "0.1.4-SNAPSHOT"
:description "kibit lein plugin"
:url "-kibit"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[jonase/kibit "0.1.3"]
[org.clojure/tools.namespace "0.2.11"]]
:deploy-repositories [["releases" :clojars]]
:eval-in-l... | null | https://raw.githubusercontent.com/jonase/lein-kibit/20e1e4075bc417e074af1a39b7af8f43404609ac/project.clj | clojure | (defproject lein-kibit "0.1.4-SNAPSHOT"
:description "kibit lein plugin"
:url "-kibit"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[jonase/kibit "0.1.3"]
[org.clojure/tools.namespace "0.2.11"]]
:deploy-repositories [["releases" :clojars]]
:eval-in-l... | |
c5205275d664a1fcfa8d5b8fa267c50c12b4b135152fd6c51677df9a3039e3fd | rpav/cl-cairo2 | lissajous.lisp | (in-package :cl-cairo2)
;;;;
;;;; Lissajous curves
;;;;
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-... | null | https://raw.githubusercontent.com/rpav/cl-cairo2/41ae45aac86553c46f4bb460f80e1fb620930f5b/tutorial/lissajous.lisp | lisp |
Lissajous curves
get context
pastel blue background
Lissajous curves, blue
orange
ask to quit
done | (in-package :cl-cairo2)
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-beari... |
71ba0c30ec9f1a3789d935f0c3a0c25a9a9c92c32ae1494e21cf23d735bf4bca | avh4/elm-format | TransformFiles.hs | module CommandLine.TransformFiles
( Result
, TransformMode(..), applyTransformation
, ValidateMode(..), validateNoChanges
) where
-- This module provides reusable functions for command line tools that
-- transform files.
import qualified CommandLine.InfoFormatter as InfoFormatter
import CommandLine.Wo... | null | https://raw.githubusercontent.com/avh4/elm-format/63a81c4526c2c81bc77667599365fa4db933907c/elm-format-lib/src/CommandLine/TransformFiles.hs | haskell | This module provides reusable functions for command line tools that
transform files. | module CommandLine.TransformFiles
( Result
, TransformMode(..), applyTransformation
, ValidateMode(..), validateNoChanges
) where
import qualified CommandLine.InfoFormatter as InfoFormatter
import CommandLine.World (World)
import qualified CommandLine.World as World
import qualified Data.Either as Eit... |
2f0da95a9e1c05dd628ad2710cbddd17977534f351fb47fd84b4dde275cfbe97 | aziem/binaryninja-ocaml | lowlevelil.ml | open Ctypes
open Foreign
module B = Ffi_bindings.Bindings(Ffi_generated_types)(Ffi_generated)
module U = Utils
open Ffi_bindings
open B
type bn_low_level_il_operation = Typedefs.bn_low_level_il_operation =
| BN_LLIL_NOP
| BN_LLIL_SET_REG
| BN_LLIL_SET_REG_SPLIT
| BN_LLIL_SET_FLAG
| BN_LLIL_LOAD
| BN_LLIL_S... | null | https://raw.githubusercontent.com/aziem/binaryninja-ocaml/5773d791ebb717816b8c47863bce8122f39764b4/lib/lowlevelil.ml | ocaml | DOES NOT WORK | open Ctypes
open Foreign
module B = Ffi_bindings.Bindings(Ffi_generated_types)(Ffi_generated)
module U = Utils
open Ffi_bindings
open B
type bn_low_level_il_operation = Typedefs.bn_low_level_il_operation =
| BN_LLIL_NOP
| BN_LLIL_SET_REG
| BN_LLIL_SET_REG_SPLIT
| BN_LLIL_SET_FLAG
| BN_LLIL_LOAD
| BN_LLIL_S... |
b5bb666351815eab753046d9481f4faa18686bc1ddf90eedaf38508e5aaf01a5 | krajj7/BotHack | term.clj | (ns bothack.term
"An implementation of a Terminal plugin for JTA without a GUI. It interprets
terminal escape sequences, cursor movement etc. using the vt320 emulation in
JTA, keeps a representation of the screen in memory for querying and
publishes redraw events for a higher-level interpretation elsewhere. S... | null | https://raw.githubusercontent.com/krajj7/BotHack/70226b3c8ed12d29c64068aec0acc0ca71d57adf/src/bothack/term.clj | clojure | modify by boldness
modify by inversion
(println "Terminal: drawing whole new frame")
turns char[][] into a vector of Strings
if update[0] == true, all rows need to update
the last (current) display frame
(println "Terminal: about to .read()")
blocking read
-1 would mean the stream is dead
(println "Terminal: rea... | (ns bothack.term
"An implementation of a Terminal plugin for JTA without a GUI. It interprets
terminal escape sequences, cursor movement etc. using the vt320 emulation in
JTA, keeps a representation of the screen in memory for querying and
publishes redraw events for a higher-level interpretation elsewhere. S... |
a0585def6571979aafc1af69169259d28e119c6fc15d84ccf1e04ae59e5e6528 | ogaml/ogaml | shoot.ml | open OgamlGraphics
open OgamlCore
open OgamlUtils
open OgamlMath
module GameState = struct
type t = {
mutable curr_rect : IntRect.t;
mutable right_click : bool;
mutable count : int;
mutable missed : int;
starting_time : float;
mutable last_hits : (float * Vector2i.t) list;
}
let gen_r... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/examples/shoot.ml | ocaml | open OgamlGraphics
open OgamlCore
open OgamlUtils
open OgamlMath
module GameState = struct
type t = {
mutable curr_rect : IntRect.t;
mutable right_click : bool;
mutable count : int;
mutable missed : int;
starting_time : float;
mutable last_hits : (float * Vector2i.t) list;
}
let gen_r... | |
7a15a08b85dd0db96d289f92e87fe94a48864f554761f129ae3f8d60f7b2f13b | mikelevins/categories | c3-domain.scm | ;;;; ***********************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: c3-domain.scm
;;;; Project: Categories
;;;; Purpose: The -c3- domain
;;;; Author: mikel evins
Copyright : Copyright 2009 by mikel evins , all rights reserved
License... | null | https://raw.githubusercontent.com/mikelevins/categories/66e3861071e4d88b7b27421a78ab497e1fb5fa0c/0.2.1/scm/gambit/c3-domain.scm | scheme | ***********************************************************************
FILE IDENTIFICATION
Name: c3-domain.scm
Project: Categories
Purpose: The -c3- domain
Author: mikel evins
See the accompanying file "License" for more information
*********************************... | Copyright : Copyright 2009 by mikel evins , all rights reserved
License : Licensed under the Apache License , version 2.0
(include "structure-macros.scm")
multiple inheritance , using the C3 linearization algorithm
The C3 algorithm is implemented in c3.scm , and may be reused for
Version 0.3 :... |
67f41d5b9c764d6448920db282d925a62e3726c7d60c84223af49dae2ad091f0 | heechul/crest-z3 | cprint.ml |
*
* Copyright ( c ) 2001 - 2003 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/frontc/cprint.ml | ocaml |
** FrontC Pretty printer
stub out the old-style manual space functions
we may implement some of these later
sm: for some reason I couldn't just call print from frontc.... ?
** Useful primitives
** Base Type Printing
print "struct foo", but with specified keyword and a list of
* attributes to put between k... |
*
* Copyright ( c ) 2001 - 2003 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... |
adb1d8d9b85c635c95a58407d6873a0cac48be91c146fb5d3d668d874cc74af7 | marcoheisig/sb-simd | define-types.lisp | (in-package #:sb-simd-internals)
(macrolet
((define-types ()
`(progn
,@(loop for value-record being the hash-values of *value-records*
collect
`(deftype ,(value-record-name value-record) ()
',(value-record-type value-record))))))
(define-t... | null | https://raw.githubusercontent.com/marcoheisig/sb-simd/329bf82363eb4a676e8ab1bf2b34116010e93755/code/define-types.lisp | lisp | (in-package #:sb-simd-internals)
(macrolet
((define-types ()
`(progn
,@(loop for value-record being the hash-values of *value-records*
collect
`(deftype ,(value-record-name value-record) ()
',(value-record-type value-record))))))
(define-t... | |
e0289c5c8dfa4cfcad4cf3f8505b10195658300e180daefeccfcb2a59788b761 | ormf/cm | lispworks.lisp | ;;; **********************************************************************
Copyright ( C ) 2002 ( )
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or... | null | https://raw.githubusercontent.com/ormf/cm/26843eec009bd6c214992a8e67c49fffa16d9530/src/lispworks.lisp | lisp | **********************************************************************
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PART... | Copyright ( C ) 2002 ( )
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
$ Date$
(in-package :cm)
(pushnew ':metaclasses *features*)
(import '(clos:slot-definition-name
clos:slot-definition-initargs
clos:slot-def... |
d3f1d534095f70e5b667e06a9bec4a417de5251f0eda52224150f89a7ca3e616 | input-output-hk/cardano-sl | Integrity.hs | # LANGUAGE RecordWildCards #
{-# LANGUAGE TypeFamilies #-}
-- | Verification of headers and blocks, also chain integrity
-- checks. Almost pure (requires leaders to be explicitly passed).
module Pos.Chain.Block.Logic.Integrity
(
-- * Header
VerifyHeaderParams (..)
, verifyHeader
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/src/Pos/Chain/Block/Logic/Integrity.hs | haskell | # LANGUAGE TypeFamilies #
| Verification of headers and blocks, also chain integrity
checks. Almost pure (requires leaders to be explicitly passed).
* Header
* Block
--------------------------------------------------------------------------
Header
----------------------------------------------------------------... | # LANGUAGE RecordWildCards #
module Pos.Chain.Block.Logic.Integrity
(
VerifyHeaderParams (..)
, verifyHeader
, verifyHeaders
, VerifyBlockParams (..)
, verifyBlock
, verifyBlocks
) where
import Universum
import Control.Lens (ix)
import ... |
6d25f43ca29f49f8d3f2339eaca8f4dbabe5634359c265add6e7418456d08c8a | rixed/ramen | site_name.ml | (* Manually written impostor to site_name_wire, converting to N.site. *)
open DessserOCamlBackEndHelpers
module N = RamenName
module Wire = Site_name_wire.DessserGen
module DessserGen = struct
type t = N.site
let to_row_binary_with_mask m t p =
Wire.to_row_binary_with_mask m (t : N.site :> string) p
let t... | null | https://raw.githubusercontent.com/rixed/ramen/675d0f5ec2baecaad6be1cfbcfb1673048d934a5/src/site_name.ml | ocaml | Manually written impostor to site_name_wire, converting to N.site. | open DessserOCamlBackEndHelpers
module N = RamenName
module Wire = Site_name_wire.DessserGen
module DessserGen = struct
type t = N.site
let to_row_binary_with_mask m t p =
Wire.to_row_binary_with_mask m (t : N.site :> string) p
let to_row_binary t p =
Wire.to_row_binary (t : N.site :> string) p
let... |
0257296f195cfaf628221bf1b107bb930150ccd708c1f95394d1fa6fcca29e6a | 7max/log4cl | test-configurator.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;
Copyright ( c ) 2012 , . All rights reserved .
;;;
This file is licensed 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 Li... | null | https://raw.githubusercontent.com/7max/log4cl/d6293f9f1b6b8871b0a4417c4bb22afb9910b97f/tests/test-configurator.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
you may not use this file except in compliance
-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 permissions and
lim... | Copyright ( c ) 2012 , . All rights reserved .
This file is licensed to You under the Apache License , Version 2.0
with the License . You may obtain a copy of the License at
distributed under the License is distributed on an " AS IS " BASIS ,
(log4cl-test:defsubsuite #:log4cl-test.configurator)
(in-package... |
e46f446a1bab852307a066fc0369e2d54bbc160ba2f1b69e7e5308d8c54e12d3 | JacquesCarette/Drasil | Goals.hs | module Drasil.GlassBR.Goals (goals, willBreakGS) where
import Language.Drasil
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Concepts.Documentation (goalStmtDom, userInput)
import Data.Drasil.Concepts.Thermodynamics (degree_')
import Drasil.GlassBR.Concepts (glaSlab)
import Drasil.Glas... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/f33feefc2325db9776895b3f27f787239f1e9393/code/drasil-example/glassbr/lib/Drasil/GlassBR/Goals.hs | haskell | module Drasil.GlassBR.Goals (goals, willBreakGS) where
import Language.Drasil
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Concepts.Documentation (goalStmtDom, userInput)
import Data.Drasil.Concepts.Thermodynamics (degree_')
import Drasil.GlassBR.Concepts (glaSlab)
import Drasil.Glas... | |
96cc203bf1c706c5bb92234ee8fa856b7028dd7b73e3e549f6c3a16672e62cb9 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Ordinal.BG.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
imp... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Ordinal/BG/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Ordinal.BG.Tests
( tests ) where
import Prelude
import Data.String
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Ordinal.BG.Corpus
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "BG Tests"
[ makeCorpusT... |
57a68683e7ec059383f5dbcc5cc511d95f0ac224cc698fd2a0fd71ac2adc8ee6 | ucsd-progsys/liquidhaskell | GeneralizedTermination.hs | {-@ LIQUID "--no-totality" @-}
module GeneralizedTermination (llen) where
import Prelude hiding (reverse)
foo :: Int -> Int -> Int
@ foo : : n : Nat - > m : /[n+m ] @
foo n m
| cond 1 = 0
| cond 2 && n > 1 = foo (n-1) m
| cond 3 && m > 2 = foo (n+1) (m-2)
{-@ cond :: Int -> Bool @-}
cond :: Int -> Bool
... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/pos/GeneralizedTermination.hs | haskell | @ LIQUID "--no-totality" @
@ cond :: Int -> Bool @
@ data L [llen] @
@ measure llen @
@ llen :: (L a) -> Nat @
@ reverse :: xs: L a -> ys : L a -> L a / [(llen ys)] @ | module GeneralizedTermination (llen) where
import Prelude hiding (reverse)
foo :: Int -> Int -> Int
@ foo : : n : Nat - > m : /[n+m ] @
foo n m
| cond 1 = 0
| cond 2 && n > 1 = foo (n-1) m
| cond 3 && m > 2 = foo (n+1) (m-2)
cond :: Int -> Bool
cond _ = undefined
data L a = N | C a (L a)
llen :: (L ... |
09d08c55ea6707aeb6e0831613d8645985235fb52e39d439ef40f19c9b695bd1 | GaloisInc/HaNS | Handle.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE MultiWayIf #-}
# OPTIONS_GHC -fno - warn - orphans #
module Hans.Socket.Handle(makeHansHandle) where
import Control.Concurrent(threadDelay)
import Control.Exception(throwIO)
import qualified Data.ByteString as BSS
import qualified Data.ByteS... | null | https://raw.githubusercontent.com/GaloisInc/HaNS/2af19397dbb4f828192f896b223ed2b77dd9a055/src/Hans/Socket/Handle.hs | haskell | # LANGUAGE MultiWayIf # | # LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Hans.Socket.Handle(makeHansHandle) where
import Control.Concurrent(threadDelay)
import Control.Exception(throwIO)
import qualified Data.ByteString as BSS
import qualified Data.ByteString.Lazy as BS
import Data... |
aa6cb38e7c654188006525b95b904d1e1a608ecdb853330859210a470880aa2f | generateme/fastmath | easings.clj | (ns fastmath.easings
"Easing functions.
List of all are in [[easings-list]]."
{:metadoc/categories {:lin "Linear"
:back "Anticipatory easings"
:bounce "Bounce"
:circle "Circular"
:cubic "Cubic"
... | null | https://raw.githubusercontent.com/generateme/fastmath/b38b43682b9dd0d3557065ca511518382943ddb6/src/fastmath/easings.clj | clojure | (ns fastmath.easings
"Easing functions.
List of all are in [[easings-list]]."
{:metadoc/categories {:lin "Linear"
:back "Anticipatory easings"
:bounce "Bounce"
:circle "Circular"
:cubic "Cubic"
... | |
aa53c06de8d77f3f8e8e92f737113682db51c755afc98a5a3c922eeacbe215a8 | fission-codes/fission | OpenUnion.hs | # OPTIONS_GHC -fno - warn - orphans #
module Fission.Internal.Orphanage.OpenUnion () where
import Data.WorldPeace
import RIO
instance Display (OpenUnion '[]) where
-- As a base case for the type-level recursion only. Essentially @Void@.
display = absurdUnion
instance (Display a, Display (Ope... | null | https://raw.githubusercontent.com/fission-codes/fission/ae177407dccc20be67948a901956b99f40d37ac8/fission-core/library/Fission/Internal/Orphanage/OpenUnion.hs | haskell | As a base case for the type-level recursion only. Essentially @Void@. | # OPTIONS_GHC -fno - warn - orphans #
module Fission.Internal.Orphanage.OpenUnion () where
import Data.WorldPeace
import RIO
instance Display (OpenUnion '[]) where
display = absurdUnion
instance (Display a, Display (OpenUnion as)) => Display (OpenUnion (a ': as)) where
display err = openUnio... |
5c8fd5a402ed5067cc172de852a9ce964b8c5a123c16d4986540ad8f8741df3f | flannelhead/blackstar | Main.hs | {-# LANGUAGE DeriveDataTypeable #-}
# OPTIONS_GHC -fno - cse #
module Main where
import System.Directory
import Control.Monad (when, forM_)
import Data.Yaml (decodeFileEither, prettyPrintParseException)
import System.Console.CmdArgs
import System.FilePath (takeBaseName, takeExtension, (</>), (<.>))
import Data.List (... | null | https://raw.githubusercontent.com/flannelhead/blackstar/232711ec179eac9290e32618cc8f79d0c31350e1/app/Main.hs | haskell | # LANGUAGE DeriveDataTypeable #
Resolve the output directory
Resolve the input file or directory | # OPTIONS_GHC -fno - cse #
module Main where
import System.Directory
import Control.Monad (when, forM_)
import Data.Yaml (decodeFileEither, prettyPrintParseException)
import System.Console.CmdArgs
import System.FilePath (takeBaseName, takeExtension, (</>), (<.>))
import Data.List (sort)
import System.Console.ANSI (cl... |
b9acaf3e5f06de1d3af8e1fe84b3f9747b9f0dbba3f258d19204b31b1af1cdb4 | barrucadu/dejafu | Chan.hs | -- |
Module : Control . Concurrent . Classy .
Copyright : ( c ) 2016
License : MIT
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-- Unbounded channels.
--
-- __Deviations:__ @Chan@ as defined here does not have an @Eq@
instance , this is because the @MonadConc@ @M... | null | https://raw.githubusercontent.com/barrucadu/dejafu/f805783398e2be60ebabb56fce9f23506b9d1879/concurrency/Control/Concurrent/Classy/Chan.hs | haskell | |
Stability : stable
Portability : portable
Unbounded channels.
__Deviations:__ @Chan@ as defined here does not have an @Eq@
an @Eq@ constraint. The deprecated @unGetChan@ and @isEmptyCHan@
functions are not provided. Furthermore, the @getChanContents@
function is not provided as it needs unsafe I/O.
* Ope... | Module : Control . Concurrent . Classy .
Copyright : ( c ) 2016
License : MIT
Maintainer : < >
instance , this is because the @MonadConc@ @MVar@ type does not have
module Control.Concurrent.Classy.Chan
* The ' ' type
Chan
, newChan
, writeChan
, readChan
, dupChan
, wr... |
afcc4220bdea195c0d9dc1fbb76f9e79cbb69cbe4d49bcbb236228f2e6a69019 | facebookarchive/pfff | view_overlays_codemap.mli |
val mousemove:
Canvas_helpers.context ->
Model_codemap.world_client ->
(Dom_html.element Js.t -> Dom_html.mouseEvent Js.t -> unit)
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/web/code_map/view_overlays_codemap.mli | ocaml |
val mousemove:
Canvas_helpers.context ->
Model_codemap.world_client ->
(Dom_html.element Js.t -> Dom_html.mouseEvent Js.t -> unit)
| |
a21b2e68559728f87c621d010594a7d4863a08e141edf4702e2c0f7fe158801a | flosell/lambdacd | dom_utils.cljs | (ns lambdacd.dom-utils
(:require
[dommy.core :as dommy]
[dommy.core :refer-macros [sel sel1 by-tag]]))
(defn fire!
"Creates an event of type `event-type`, optionally having
`update-event!` mutate and return an updated event object,
and fires it on `node`.
Only works when `node` is in the DOM"
[n... | null | https://raw.githubusercontent.com/flosell/lambdacd/e9ba3cebb2d5f0070a2e0e1e08fc85fc99ee7135/test/cljs/lambdacd/dom_utils.cljs | clojure | (ns lambdacd.dom-utils
(:require
[dommy.core :as dommy]
[dommy.core :refer-macros [sel sel1 by-tag]]))
(defn fire!
"Creates an event of type `event-type`, optionally having
`update-event!` mutate and return an updated event object,
and fires it on `node`.
Only works when `node` is in the DOM"
[n... | |
578e15f35187e6b1a9404fde2f6b733021480c8856891ee6dcb503315f8cc94a | hoplon/boot-hoplon | tagsoup.clj | Copyright ( c ) and . 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/hoplon/boot-hoplon/3e0fdb799c505dc54a2e5953798262538fef2ec4/src/hoplon/boot_hoplon/tagsoup.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright ( c ) and . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns hoplon.boot-hoplon.tagsoup
(:refer-clojure :exclude [replace])
(:require
[pl.danieljanus.tagsoup :as ts]
[clojure.pprint :as pp :refer [pprint]]
[clojure.string :as cs :refer [blank? replace ... |
4caba22863aee5e3231760b2b58ca3f88f1286e25c3e2d752ca3e74cf2386e2a | lamdu/lamdu | CPS.hs | {-# LANGUAGE RankNTypes #-}
module Lamdu.Sugar.Names.CPS
( CPS(..), runcps
, liftCPS
) where
import Lamdu.Prelude
newtype CPS m a = CPS { unCPS :: forall r. m r -> m (a, r) }
deriving stock Functor
runcps :: Applicative f => CPS f b -> f b
runcps act = unCPS act (pure ()) <&> fst
liftCPS :: Monad m ... | null | https://raw.githubusercontent.com/lamdu/lamdu/c1d7d17ebf46f5ad8e110d9ce49625e935a16e80/src/Lamdu/Sugar/Names/CPS.hs | haskell | # LANGUAGE RankNTypes # | module Lamdu.Sugar.Names.CPS
( CPS(..), runcps
, liftCPS
) where
import Lamdu.Prelude
newtype CPS m a = CPS { unCPS :: forall r. m r -> m (a, r) }
deriving stock Functor
runcps :: Applicative f => CPS f b -> f b
runcps act = unCPS act (pure ()) <&> fst
liftCPS :: Monad m => m a -> CPS m a
liftCPS ac... |
7ec370a6459d565306ea8a88d437399ebec5f214c4d1645d9370c47402eae229 | edalorzo/learning-clojure | core_test.clj | (ns learn.core-test
(:require [clojure.test :refer :all]
[learn.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/edalorzo/learning-clojure/b5db63d8e783767a85af19ccb8dbf4d4e0f53d62/test/learn/core_test.clj | clojure | (ns learn.core-test
(:require [clojure.test :refer :all]
[learn.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
af619fc03d27610a55e3de25d2d464c1b4e81298dae54af558e71d9064771a35 | lambduli/frea | Literal.hs | module Compiler.Syntax.Literal where
data Lit
= LitInt Int
| LitDouble Double
| LitChar Char
deriving (Eq, Ord)
I can safely derive and use because the type of Freas comparision operations
prohibits from comparing two things of different types
instance Show Lit where
show (LitInt i) = show i
show (L... | null | https://raw.githubusercontent.com/lambduli/frea/939d8d8efae0147802595af5a9dbf5f2f9a97612/src/Compiler/Syntax/Literal.hs | haskell | module Compiler.Syntax.Literal where
data Lit
= LitInt Int
| LitDouble Double
| LitChar Char
deriving (Eq, Ord)
I can safely derive and use because the type of Freas comparision operations
prohibits from comparing two things of different types
instance Show Lit where
show (LitInt i) = show i
show (L... | |
1c5c099ce2cba7d5e481568a43db100a01c8cf5fb5ba71cd39b2adac7446a516 | racket/racket7 | header.rkt | #lang racket/base
(require "../common/set.rkt"
"../syntax/scope.rkt"
"module-use.rkt"
"../common/module-path.rkt"
"context.rkt"
"built-in-symbol.rkt"
"reserved-symbol.rkt"
"namespace-scope.rkt"
"serialize.rkt"
"vector-ref.rkt")
(provide (... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/compile/header.rkt | racket | A compilation header accumulates information about syntax literals
and about referenced required and defined variables. This
information is accumulated while compiling expressions, and then
header information is extracted into deserialization code that
reconstructs syntax literals, module path indexes, and so on. ... | #lang racket/base
(require "../common/set.rkt"
"../syntax/scope.rkt"
"module-use.rkt"
"../common/module-path.rkt"
"context.rkt"
"built-in-symbol.rkt"
"reserved-symbol.rkt"
"namespace-scope.rkt"
"serialize.rkt"
"vector-ref.rkt")
(provide (... |
7de1303d68c49e0aed3d5d9b7b8c4d6ef0527a16b29c848a2e3198f367950df6 | luminus-framework/examples | home.clj | (ns multi-client-ws-immutant.routes.home
(:require
[clojure.tools.logging :as log]
[immutant.web.async :as async]
[multi-client-ws-immutant.layout :as layout]
[clojure.java.io :as io]
[multi-client-ws-immutant.middleware :as middleware]
[ring.util.http-response :as response]))
(defonce channels (at... | null | https://raw.githubusercontent.com/luminus-framework/examples/cbeee2fef8f457a6a6bac2cae0b640370ae2499b/multi-client-ws-immutant/src/clj/multi_client_ws_immutant/routes/home.clj | clojure | (ns multi-client-ws-immutant.routes.home
(:require
[clojure.tools.logging :as log]
[immutant.web.async :as async]
[multi-client-ws-immutant.layout :as layout]
[clojure.java.io :as io]
[multi-client-ws-immutant.middleware :as middleware]
[ring.util.http-response :as response]))
(defonce channels (at... | |
eef49f2782042ceaa9c9d2b017c38d4c9208b91cd61587c590935d7e7d5475f2 | dylan-thinnes/slide-rules-generator | IO.hs | module SlideRules.IO where
-- base
import System.IO
-- bytestring
import qualified Data.ByteString.Lazy
import qualified Data.ByteString.Builder as Builder
-- diagrams-*
import qualified Diagrams.Backend.SVG as D
import qualified Diagrams.Backend.SVG.CmdLine as D
import qualified Diagrams.Prelude ... | null | https://raw.githubusercontent.com/dylan-thinnes/slide-rules-generator/8e6e36a0a8408883888dd70102fb9410df0f4df5/src/SlideRules/IO.hs | haskell | base
bytestring
diagrams-*
svg-builder
text
local (sliderules) | module SlideRules.IO where
import System.IO
import qualified Data.ByteString.Lazy
import qualified Data.ByteString.Builder as Builder
import qualified Diagrams.Backend.SVG as D
import qualified Diagrams.Backend.SVG.CmdLine as D
import qualified Diagrams.Prelude as D
import qualified Diagrams.TwoD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.