_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 |
|---|---|---|---|---|---|---|---|---|
37acad232c6b2dbd40cd8843c1a1394afb45610c6dbbeb1b17012a42bee4fab6 | lisp-korea/sicp | ch4-mceval.scm | METACIRCULAR EVALUATOR FROM CHAPTER 4 ( SECTIONS 4.1.1 - 4.1.4 ) of
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;;Matches code in ch4.scm
;;;;This file can be loaded into Scheme as a whole.
;;;;Then you can initialize and start the evaluator by evaluating
the two commented - out lines at the end of the... | null | https://raw.githubusercontent.com/lisp-korea/sicp/4cdc1b1d858c6da7c9f4ec925ff4a724f36041cc/ch04/4.3/ch4-mceval.scm | scheme | STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
Matches code in ch4.scm
This file can be loaded into Scheme as a whole.
Then you can initialize and start the evaluator by evaluating
global environment and starting the driver loop).
**WARNING: Don't load this file twice (or you'll lose the primitives
interface, du... | METACIRCULAR EVALUATOR FROM CHAPTER 4 ( SECTIONS 4.1.1 - 4.1.4 ) of
the two commented - out lines at the end of the file ( setting up the
from section 4.1.4 -- must precede def of metacircular apply
(define apply-in-underlying-scheme apply)
SECTION 4.1.1
(define (mceval exp env)
(cond ((self-evaluating? exp) ... |
f4113210b2d6a666a2b5ec3b4d4a7790b80d3873e5fcf3e101257adb6bf44b73 | xapi-project/message-switch | apis.ml |
let apis =
[ Plugin.interfaces
; Control.interfaces
; Data.interfaces
; Task.interfaces
]
| null | https://raw.githubusercontent.com/xapi-project/message-switch/bd10e096c56f149d6cb0831a520a84843ebca300/xapi-storage/generator/lib/apis.ml | ocaml |
let apis =
[ Plugin.interfaces
; Control.interfaces
; Data.interfaces
; Task.interfaces
]
| |
b2557780d7c9e6a6a1d2eda36bd23972c01de1088abc181c877cda7563d0b089 | AeroNotix/lispkit | settings.lisp | (in-package :lispkit)
(defparameter *cookie-path-dir* (merge-pathnames #P"lispkit/" (get-xdg-config-dir)))
(defparameter *cookie-type* :webkit-cookie-persistent-storage-text)
(defparameter *cookie-accept-policy* :webkit-cookie-policy-accept-always)
(defun ensure-cookies-folder-exists (path)
"Ensures that the cooki... | null | https://raw.githubusercontent.com/AeroNotix/lispkit/2482dbeabc79667407dabe7765dfbffc16584b08/settings.lisp | lisp | (in-package :lispkit)
(defparameter *cookie-path-dir* (merge-pathnames #P"lispkit/" (get-xdg-config-dir)))
(defparameter *cookie-type* :webkit-cookie-persistent-storage-text)
(defparameter *cookie-accept-policy* :webkit-cookie-policy-accept-always)
(defun ensure-cookies-folder-exists (path)
"Ensures that the cooki... | |
03b208f8971196f1ecc176cb6a024d21e3a8596ae82ce32a15f488cb0fa9dc74 | appleby/Lisp-In-Small-Pieces | chap8f.scm | $ I d : chap8f.scm , v 4.1 2006/11/24 18:40:55 queinnec Exp $
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is derived from the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cam... | null | https://raw.githubusercontent.com/appleby/Lisp-In-Small-Pieces/af4139232bb7170f32470774a92d647e83254721/src/chap8f.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is derived from the files that accompany the book:
The original sources can be downloaded from the author's website at
-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html
This file may have been altered from the original in order to... | $ I d : chap8f.scm , v 4.1 2006/11/24 18:40:55 queinnec Exp $
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge University Press ) .
By Christian Queinnec < >
(definitial eval
(let* ((arity 1)
(arity+1 (+ arity 1)) )
(make-prim... |
0abeea63a6fabfc8ffda312a6d32c9e96b012f075ef32da1d18a86869b1c8ce6 | fantasytree/fancy_game_server | sup_boot.erl | %%----------------------------------------------------
%% 游戏区监控树
%%----------------------------------------------------
-module(sup_boot).
-behaviour(supervisor).
-export([start_link/1, init/1]).
start_link(NodeType) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [NodeType]).
init([NodeType]) ->
{ok, {
... | null | https://raw.githubusercontent.com/fantasytree/fancy_game_server/4ca93486fc0d5b6630170e79b48fb31e9c6e2358/src/sys/sup_boot.erl | erlang | ----------------------------------------------------
游戏区监控树
---------------------------------------------------- | -module(sup_boot).
-behaviour(supervisor).
-export([start_link/1, init/1]).
start_link(NodeType) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [NodeType]).
init([NodeType]) ->
{ok, {
{one_for_one, 50, 1}
,[
{env, {env, start_link, ["env.cfg"]}, transient, 10000, w... |
45a95cf174209969ee54efc560320338504cd74762377ce3b8ed225ae074bb8e | processone/ejabberd | mod_delegation_opt.erl | %% Generated automatically
%% DO NOT EDIT: run `make options` instead
-module(mod_delegation_opt).
-export([namespaces/1]).
-spec namespaces(gen_mod:opts() | global | binary()) -> [{binary(),[binary()],acl:acl()}].
namespaces(Opts) when is_map(Opts) ->
gen_mod:get_opt(namespaces, Opts);
namespaces(Host) ->
g... | null | https://raw.githubusercontent.com/processone/ejabberd/b860a25c82515ba51b044e13ea4e040e3b9bbc41/src/mod_delegation_opt.erl | erlang | Generated automatically
DO NOT EDIT: run `make options` instead |
-module(mod_delegation_opt).
-export([namespaces/1]).
-spec namespaces(gen_mod:opts() | global | binary()) -> [{binary(),[binary()],acl:acl()}].
namespaces(Opts) when is_map(Opts) ->
gen_mod:get_opt(namespaces, Opts);
namespaces(Host) ->
gen_mod:get_module_opt(Host, mod_delegation, namespaces).
|
e37516b08e85b29a664c0bb80ea5f8988849836fa4078eb11dce3d9381c5566a | dundalek/closh | history_test.cljc | (ns closh.history-test
(:require [clojure.test :refer [deftest is testing]]
[closh.test-util.util :refer [with-tempfile] #?@(:cljs [:refer-macros [with-async]])]
[closh.zero.macros #?(:clj :refer :cljs :refer-macros) [chain->]]
#?(:cljs [closh.zero.service.history-common :refer [ch... | null | https://raw.githubusercontent.com/dundalek/closh/b1a7fd310b6511048fbacb8e496f574c8ccfa291/test/closh/history_test.cljc | clojure | (ns closh.history-test
(:require [clojure.test :refer [deftest is testing]]
[closh.test-util.util :refer [with-tempfile] #?@(:cljs [:refer-macros [with-async]])]
[closh.zero.macros #?(:clj :refer :cljs :refer-macros) [chain->]]
#?(:cljs [closh.zero.service.history-common :refer [ch... | |
1e9551f1243b8594ea2318c7bfac1607d4b6336a9e12814e9ede6f2584f51cd2 | ashinkarov/heh | parser.ml |
* Copyright ( c ) 2017 - 2018 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS ... | null | https://raw.githubusercontent.com/ashinkarov/heh/42866803b2ffacdc42b8f06203bf4e5bd18e03b0/parser.ml | ocaml | This is a helper type to allow for short generators of form:
_(iv): expr
as opposed to regular generators
lb_expr <= iv < ub_expr
generator: [0] <= iv |__x|
body: 0 * __x.iv
= and <> have the least priority
comparisons <, <=, >, >=
addition/subtraction: +, -
multiplication/division/modulo: *, /... |
* Copyright ( c ) 2017 - 2018 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS ... |
d3e974141d59b54f39dae3e3b3f595c0420aaa00fe384eabab473b65ee05bcff | cojna/iota | UtilsSpec.hs | # LANGUAGE ViewPatterns #
module Math.UtilsSpec where
import Data.Bits
import Math.Utils
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "floorSqrt" $ do
prop "floor (sqrt x)" prop_floorSqrt
describe "floorLog2" $ do
it "floorLog2 0 = -1023" $ do
floorLog2 0 `sh... | null | https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/test/Math/UtilsSpec.hs | haskell | # LANGUAGE ViewPatterns #
module Math.UtilsSpec where
import Data.Bits
import Math.Utils
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "floorSqrt" $ do
prop "floor (sqrt x)" prop_floorSqrt
describe "floorLog2" $ do
it "floorLog2 0 = -1023" $ do
floorLog2 0 `sh... | |
3a0909a211c0a85200fae6b6bb366c08ad85d9c6170c6a34202124ca52754131 | Frama-C/Frama-C-snapshot | source_viewer.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/gui/source_viewer.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
3d52e3cdd706a37175e7e2f239be081623467759aa634c66f81776d4a48ee0f3 | startalkIM/ejabberd | mod_blocking_mnesia.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2016 ,
%%% @doc
%%%
%%% @end
Created : 14 Apr 2016 by < >
%%%-------------------------------------------------------------------
-module(mod_blocking_mnesia).
-behaviour(mod_blocking).
%% API
-export([process_block... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/mod_blocking_mnesia.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
No lists, nothing to unb... | @author < >
( C ) 2016 ,
Created : 14 Apr 2016 by < >
-module(mod_blocking_mnesia).
-behaviour(mod_blocking).
-export([process_blocklist_block/3, unblock_by_filter/3,
process_blocklist_get/2]).
-include("jlib.hrl").
-include("mod_privacy.hrl").
process_blocklist_block(LUser, LServer, Filter) ->
... |
349f606b21a91ccaf68beeff4134c081a4a8e13de19590c0243b05f8d3835a20 | andrejbauer/marshall | interval.ml | (* \section{Interval arithmetic (module [Interval])} *)
An interval is a pair [ ( l , u ) ] of [ Dyadic ] numbers . There is no
restriction that [ l ] should be smaller than [ u ] , i.e. , the library
also works with back - to - front intervals . It uses
multiplication for back - to - front intervals... | null | https://raw.githubusercontent.com/andrejbauer/marshall/1e630b34b7ae880835aca31fd2b3eda562348b2e/src/interval.ml | ocaml | \section{Interval arithmetic (module [Interval])}
An interval is a record with fields [lower] and [upper].
\subsection{Basic mainpulation}
[lower i] computes the lower endpoint.
[upper i] computes the upper endpoint.
[flip i] exchanges the lower and upper endpoints.
Compute the width of the interval
\sub... |
An interval is a pair [ ( l , u ) ] of [ Dyadic ] numbers . There is no
restriction that [ l ] should be smaller than [ u ] , i.e. , the library
also works with back - to - front intervals . It uses
multiplication for back - to - front intervals . Infinity and negative
infinity are allowed as en... |
135f13bda89e53cf3622d437abb8950c7698178f047c79dd26f21b88995e4224 | cxphoe/SICP-solutions | 3.3.rkt | (define (make-account balance password)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount)))
(define (dispatch pw m)
(if (eq? pw password)
... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%203-Modeling%20with%20Mutable%20Data/1.Assignment%20and%20Local%20state/3.3.rkt | racket | (define (make-account balance password)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount)))
(define (dispatch pw m)
(if (eq? pw password)
... | |
eef55cb3137549af6b5c9f010c6cd33842051261118aff94c243dea9e4a8e1d0 | naoto-ogawa/h-xproto-mysql | Example03.hs | {-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-}
# LANGUAGE TypeInType , TypeFamilies , KindSignatures , DataKinds , TypeOperators , GADTs , TypeSynonymInstances , FlexibleInstances #
module Example.Example03 where
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Control.Exception.Safe (Ex... | null | https://raw.githubusercontent.com/naoto-ogawa/h-xproto-mysql/1eacd6486c99b849016bf088788cb8d8b166f964/src/Example/Example03.hs | haskell | # LANGUAGE ScopedTypeVariables, TemplateHaskell #
my library
| # LANGUAGE TypeInType , TypeFamilies , KindSignatures , DataKinds , TypeOperators , GADTs , TypeSynonymInstances , FlexibleInstances #
module Example.Example03 where
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Control.Exception.Safe (Exception, MonadThrow, SomeException, throwM, bracket, ca... |
67fa8542921d8140512974676303f36aa114b6046dd89b0617bbe44d0ca06862 | Simre1/hero | Component.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DefaultSignatures #
# LANGUAGE FunctionalDependencies #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Hero.Component.Component where
import Data.Kind
import Hero.Entity (Entity, MaxEntities)
import Type.Reflection (Typeable)
| ' ' is unique to a ... | null | https://raw.githubusercontent.com/Simre1/hero/61e18ad87e93b349c0bc453c405bfa76feda62bc/src/Hero/Component/Component.hs | haskell | For example `data Position = Position Float Float`
| The datastructure used to store the component (for example BoxedSparseSet)
| Store which do not require systems to run can be automatically created (the sparse sets can be set up automatically!). Then, you do not have to
set them up yourself and the defualt 'crea... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DefaultSignatures #
# LANGUAGE FunctionalDependencies #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Hero.Component.Component where
import Data.Kind
import Hero.Entity (Entity, MaxEntities)
import Type.Reflection (Typeable)
| ' ' is unique to a ... |
9fc63e45dbdd6390a3cc9cbc2555c447101e8e01fb0b804f5152adbef102858d | kawasima/darzana | template.clj | (ns darzana.template
(:require [integrant.core :as ig]))
(defprotocol TemplateEngine
(render-html [this ctx template-name]))
(defmethod ig/init-key :darzana/template [_ spec]
)
| null | https://raw.githubusercontent.com/kawasima/darzana/4b37c8556f74219b707d23cb2d6dce70509a0c1b/src/darzana/template.clj | clojure | (ns darzana.template
(:require [integrant.core :as ig]))
(defprotocol TemplateEngine
(render-html [this ctx template-name]))
(defmethod ig/init-key :darzana/template [_ spec]
)
| |
a0996bb33d26c2285510980478575170d3e3eb54c6119427236834872f5210ac | ds-wizard/engine-backend | LocaleBundleService.hs | module Registry.Service.Locale.Bundle.LocaleBundleService where
import Control.Monad.Except (throwError)
import qualified Data.ByteString.Lazy.Char8 as BSL
import qualified Data.UUID as U
import Registry.Api.Resource.Locale.LocaleDTO
import Registry.Model.Context.AppContext
import Registry.S3.Locale.LocaleS3
import R... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/090f4f3460e8df128e88e2c3ce266b165e4a0a50/engine-registry/src/Registry/Service/Locale/Bundle/LocaleBundleService.hs | haskell | module Registry.Service.Locale.Bundle.LocaleBundleService where
import Control.Monad.Except (throwError)
import qualified Data.ByteString.Lazy.Char8 as BSL
import qualified Data.UUID as U
import Registry.Api.Resource.Locale.LocaleDTO
import Registry.Model.Context.AppContext
import Registry.S3.Locale.LocaleS3
import R... | |
7df978866bad627c9800c8add5918a68de12d6e20e44b673f73cfe0f78d14e44 | xvw/muhokama | db_migrate.ml | open Lib_common
module Migration_context = Lib_migration.Context
module Db = Lib_db
let reset migrations_path =
let promise =
let open Lwt_util in
let*? env = Env.init () in
let*? pool = Db.connect env in
Lib_db.use pool @@ Lib_migration.Migrate.reset migrations_path
in
Termination.handle promise... | null | https://raw.githubusercontent.com/xvw/muhokama/d628d05e2fc5af3fbf86d2177458336b647ece08/bin/db_migrate.ml | ocaml | open Lib_common
module Migration_context = Lib_migration.Context
module Db = Lib_db
let reset migrations_path =
let promise =
let open Lwt_util in
let*? env = Env.init () in
let*? pool = Db.connect env in
Lib_db.use pool @@ Lib_migration.Migrate.reset migrations_path
in
Termination.handle promise... | |
7bc1c79db0b496938829495a4c4b81aef90b3af129c7a3420f395a0fd4d4ce0e | phoe/damn-fast-priority-queue | src.lisp | ;;;; damn-fast-priority-queue.lisp
(defpackage #:damn-fast-priority-queue
(:use #:cl)
(:shadow #:map)
(:local-nicknames (#:a #:alexandria))
(:export #:queue #:make-queue #:copy-queue
#:enqueue #:dequeue #:peek #:size #:trim #:map #:do-queue
#:queue-size-limit-reached
#:queue-si... | null | https://raw.githubusercontent.com/phoe/damn-fast-priority-queue/9b436de2c1dd296180c10e57e96227e5b4193ff1/damn-fast-priority-queue/src.lisp | lisp | damn-fast-priority-queue.lisp
Read-time variables
Good luck.
Type definitions
Structure definition
Enqueueing
Introspection and maintenance
Conditions |
(defpackage #:damn-fast-priority-queue
(:use #:cl)
(:shadow #:map)
(:local-nicknames (#:a #:alexandria))
(:export #:queue #:make-queue #:copy-queue
#:enqueue #:dequeue #:peek #:size #:trim #:map #:do-queue
#:queue-size-limit-reached
#:queue-size-limit-reached-queue #:queue-size... |
ed704c8723640440b774c9334cc49314cd1ff3849bac8bfbbd4eb7e47ca28e4d | haskell/haskell-language-server | AutoTypeLevel.expected.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE GADTs #
# LANGUAGE KindSignatures #
{-# LANGUAGE TypeOperators #-}
import Data.Kind
data Nat = Z | S Nat
data HList (ls :: [Type]) where
HNil :: HList '[]
HCons :: t -> HList ts -> HList (t ': ts)
data ElemAt (n :: Nat) t (ts :: [Type]) where
AtZ :: ElemAt... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/AutoTypeLevel.expected.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators # | # LANGUAGE GADTs #
# LANGUAGE KindSignatures #
import Data.Kind
data Nat = Z | S Nat
data HList (ls :: [Type]) where
HNil :: HList '[]
HCons :: t -> HList ts -> HList (t ': ts)
data ElemAt (n :: Nat) t (ts :: [Type]) where
AtZ :: ElemAt 'Z t (t ': ts)
AtS :: ElemAt k t ts -> ElemAt ('S k) t (u ': ... |
b49c2bb68790076ddd9ed1194e3486ea295a75a936b1ea1de4a7aa1adcd077d2 | OCADml/OCADml | offset.mli | val offset
: ?fn:int
-> ?fs:float
-> ?fa:float
-> ?closed:bool
-> ?check_valid:[ `Quality of int | `No ]
-> ?mode:[< `Chamfer | `Delta | `Radius > `Delta ]
-> float
-> V2.t list
-> V2.t list
val offset_with_faces
: ?fn:int
-> ?fs:float
-> ?fa:float
-> ?closed:bool
-> ?check_valid:[ `Quali... | null | https://raw.githubusercontent.com/OCADml/OCADml/ceed2bfce640667580f7286b46864a69cdc1d4d7/lib/offset.mli | ocaml | val offset
: ?fn:int
-> ?fs:float
-> ?fa:float
-> ?closed:bool
-> ?check_valid:[ `Quality of int | `No ]
-> ?mode:[< `Chamfer | `Delta | `Radius > `Delta ]
-> float
-> V2.t list
-> V2.t list
val offset_with_faces
: ?fn:int
-> ?fs:float
-> ?fa:float
-> ?closed:bool
-> ?check_valid:[ `Quali... | |
c4c453782dde5b58df70e1224d86d23bf249a645e8943ffa95f015279b33720c | casperschipper/ocaml-cisp | cisp8.ml | open Cisp
open Seq
(* open Format *)
let sec s = !Process.sample_rate *. s
let msec = map sec
let place =
(seq [0.0;4.0 |> sec]) +.~ (rvf (st 0.0) (st 3.0))
let dura =
(ch [|0.1;0.5;1.0;2.0;1.5;0.75;4.0;8.0|])
let myLineTest () =
tline dura place
let sum lst =
List.fold_right (fun x acc ->... | null | https://raw.githubusercontent.com/casperschipper/ocaml-cisp/571ffb8e508c5427d01e407ba5e91ff2a4604f40/examples/cisp_backup/beforeDecoherence/cisp8.ml | ocaml | open Format | open Cisp
open Seq
let sec s = !Process.sample_rate *. s
let msec = map sec
let place =
(seq [0.0;4.0 |> sec]) +.~ (rvf (st 0.0) (st 3.0))
let dura =
(ch [|0.1;0.5;1.0;2.0;1.5;0.75;4.0;8.0|])
let myLineTest () =
tline dura place
let sum lst =
List.fold_right (fun x acc -> x +.~ acc) lst (st ... |
75ebf1d1183d859c784d0ccccd40f941acdde7886828a4b874e896a075d804ed | intermine/bluegenes | events.cljs | (ns bluegenes.pages.templates.events
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :refer [reg-event-db reg-event-fx reg-fx dispatch subscribe]]
[re-frame.events]
[oops.core :refer [oset!]]
[goog.dom :as gdom]
[cljs.core.async... | null | https://raw.githubusercontent.com/intermine/bluegenes/13b43c3ca0cec7b1596a51d4254a519266a28d6e/src/cljs/bluegenes/pages/templates/events.cljs | clojure | This effect handler is used from routes and has different behaviour
depending on if it's called from a different panel, or the template panel.
This is because we'll be scrolling to the template, so the
Clear filters by using assoc-in instead of update-in assoc.
Will always scroll as this clause means the user cann... | (ns bluegenes.pages.templates.events
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :refer [reg-event-db reg-event-fx reg-fx dispatch subscribe]]
[re-frame.events]
[oops.core :refer [oset!]]
[goog.dom :as gdom]
[cljs.core.async... |
7ed35076c6d5d84d49ca06f7e62a8534cbc6fcb6f8dd8d2ec04ee8524cc5eaa7 | Bogdanp/racket-kafka | help.rkt | #lang racket/base
(require racket/port)
(provide
null8
null16
null32
ref
opt
with-output-bytes)
(define null8 #"\xFF")
(define null16 #"\xFF\xFF")
(define null32 #"\xFF\xFF\xFF\xFF")
(define ref
(case-lambda
[(id v)
(define p (assq id v))
(unless p
(error 'ref "key not found: ~s~n hav... | null | https://raw.githubusercontent.com/Bogdanp/racket-kafka/39a25759a312b535666cb7f247b6ac00cb76e4b8/kafka-lib/private/help.rkt | racket | #lang racket/base
(require racket/port)
(provide
null8
null16
null32
ref
opt
with-output-bytes)
(define null8 #"\xFF")
(define null16 #"\xFF\xFF")
(define null32 #"\xFF\xFF\xFF\xFF")
(define ref
(case-lambda
[(id v)
(define p (assq id v))
(unless p
(error 'ref "key not found: ~s~n hav... | |
cbbc1e42375edd3effd5c720466327f2617a5107fe3b251a38cecb518b505b20 | dparis/gen-phzr | net.cljs | (ns phzr.net
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Net
"Phaser.Net handles browser URL related tasks such as checking host names, domain names and query string manipulation.
Parameters:
* game (Phaser.Gam... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/net.cljs | clojure | (ns phzr.net
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Net
"Phaser.Net handles browser URL related tasks such as checking host names, domain names and query string manipulation.
Parameters:
* game (Phaser.Gam... | |
182d27ab41254e5256d8240b5fc95e30ffc925827244152d061dd34d4e559ae2 | didierverna/clon | termio.lisp | ;;; termio.lisp --- Clon termio setup
Copyright ( C ) 2015 , 2021
Author : < >
This file is part of .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission notice appear i... | null | https://raw.githubusercontent.com/didierverna/clon/98e95c0635ec80517711d5e5c2ad43884cbb275f/setup/src/termio.lisp | lisp | termio.lisp --- Clon termio setup
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANT... |
Copyright ( C ) 2015 , 2021
Author : < >
This file is part of .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
Conten... |
64a9f9b5829d7a87f67cac20965e277c893746919e7a72065687262baf35078d | cyga/real-world-haskell | LineCount.hs | file : ch24 / LineCount.hs
module Main where
import Control.Monad (forM_)
import Data.Int (Int64)
import qualified Data.ByteString.Lazy.Char8 as LB
import System.Environment (getArgs)
import LineChunks (chunkedReadWith)
import MapReduce (mapReduce, rnf)
lineCount :: [LB.ByteString] -> Int64
lineCount = mapReduce r... | null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch24/LineCount.hs | haskell | file : ch24 / LineCount.hs
module Main where
import Control.Monad (forM_)
import Data.Int (Int64)
import qualified Data.ByteString.Lazy.Char8 as LB
import System.Environment (getArgs)
import LineChunks (chunkedReadWith)
import MapReduce (mapReduce, rnf)
lineCount :: [LB.ByteString] -> Int64
lineCount = mapReduce r... | |
5f3461af41cb717fc63f965cdbb9b411103799eeaffb8958b9b03d931aa139e1 | michalkonecny/aern2 | Variables.hs | module ERC.Variables where
import Prelude
import Control.Monad.ST.Trans
import ERC.Monad
type Var s = STRef s
(?) :: Var s t -> ERC s t
(?) = readSTRef
assign :: Var s t -> ERC s t -> ERC s ()
assign v valERC =
do
val <- valERC
ifInvalidUseDummy () $ writeSTRef v val
(.=) :: Var s t -> ERC s t -> ERC s ()
... | null | https://raw.githubusercontent.com/michalkonecny/aern2/1c8f12dfcb287bd8e3353802a94865d7c2c121ec/aern2-erc/src/ERC/Variables.hs | haskell | module ERC.Variables where
import Prelude
import Control.Monad.ST.Trans
import ERC.Monad
type Var s = STRef s
(?) :: Var s t -> ERC s t
(?) = readSTRef
assign :: Var s t -> ERC s t -> ERC s ()
assign v valERC =
do
val <- valERC
ifInvalidUseDummy () $ writeSTRef v val
(.=) :: Var s t -> ERC s t -> ERC s ()
... | |
96cedca53c2ac92f4d3e879f301320a56438250f02c6459ee9fb557969662be0 | janestreet/universe | ppx_sexp_value.ml | open Base
open Ppxlib
open Ast_builder.Default
let omit_nil =
Attribute.declare "sexp_value.sexp.omit_nil"
Attribute.Context.core_type
Ast_pattern.(pstr nil)
()
let option =
Attribute.declare "sexp_value.sexp.option"
Attribute.Context.core_type
Ast_pattern.(pstr nil)
()
let sexp_atom ~loc... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/ppx_sexp_value/src/ppx_sexp_value.ml | ocaml | We match simultaneously on the head and tail in the generated code to avoid
changing their respective typing environments.
{ foo : int } | open Base
open Ppxlib
open Ast_builder.Default
let omit_nil =
Attribute.declare "sexp_value.sexp.omit_nil"
Attribute.Context.core_type
Ast_pattern.(pstr nil)
()
let option =
Attribute.declare "sexp_value.sexp.option"
Attribute.Context.core_type
Ast_pattern.(pstr nil)
()
let sexp_atom ~loc... |
162a906530265ff6afdf20cd28d7d65809f774e0b2e81107ef0c2c0ad3562d1c | cxphoe/SICP-solutions | 2.66.rkt | (define (lookup given-key set-of-records)
(if (null? set-of-records)
false
(let ((set-entry (entry set-of-records)))
(cond ((= given-key (key set-entry))
set-entry)
((< given-key (key set-entry))
(lookup given-key (left-branch set-of-records)))
... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%202-Building%20Abstractions%20with%20Data/3.Symbolic%20Data/2.66.rkt | racket | (define (lookup given-key set-of-records)
(if (null? set-of-records)
false
(let ((set-entry (entry set-of-records)))
(cond ((= given-key (key set-entry))
set-entry)
((< given-key (key set-entry))
(lookup given-key (left-branch set-of-records)))
... | |
366817b77e1797127249e4ecd8824df3a6d2465c58e9d017ec0b03a5aae730a6 | yapsterapp/er-cassandra | unique_key_test.clj | (ns er-cassandra.model.alia.unique-key-test
(:require
[er-cassandra.model.util.test :as tu :refer [fetch-record]]
[clojure.test :as test :refer [deftest is are testing use-fixtures]]
[schema.test :as st]
[clj-uuid :as uuid]
[er-cassandra.record :as r]
[er-cassandra.model.util.timestamp :as ts]
[e... | null | https://raw.githubusercontent.com/yapsterapp/er-cassandra/1d059f47bdf8654c7a4dd6f0759f1a114fdeba81/test/er_cassandra/model/alia/unique_key_test.clj | clojure | remove the owning record so the ref is stale
check something actually happened
check nothing happened
only unique key cols should get written
should not get written
idb gets the new keys
only unique key cols should get written
stale keys
preserved and new keys | (ns er-cassandra.model.alia.unique-key-test
(:require
[er-cassandra.model.util.test :as tu :refer [fetch-record]]
[clojure.test :as test :refer [deftest is are testing use-fixtures]]
[schema.test :as st]
[clj-uuid :as uuid]
[er-cassandra.record :as r]
[er-cassandra.model.util.timestamp :as ts]
[e... |
538ad5191d77fb6b6c8927a7a1dee9580609ac093d4bd87061f066da22336773 | ocaml-obuild/obuild | filetype.ml | open Ext.Filepath
type t = FileML
| FileMLI
| FileH
| FileC
| FileCMX
| FileCMO
| FileCMI
| FileCMA
| FileCMXA
| FileCMXS
| FileCMT
| FileCMTI
| FileO
| FileA
| FileSO
| FileEXE
| FileOther of string
let of... | null | https://raw.githubusercontent.com/ocaml-obuild/obuild/28252e8cee836448e85bfbc9e09a44e7674dae39/obuild/filetype.ml | ocaml | +1 to remove the dot
best effort, suit our case for unix | open Ext.Filepath
type t = FileML
| FileMLI
| FileH
| FileC
| FileCMX
| FileCMO
| FileCMI
| FileCMA
| FileCMXA
| FileCMXS
| FileCMT
| FileCMTI
| FileO
| FileA
| FileSO
| FileEXE
| FileOther of string
let of... |
8dbfbc4fc13e77e20a1cf439a893223746898452df3848dea367ae4f5665d24d | amnh/PCG | Converter.hs | -----------------------------------------------------------------------------
-- |
-- Module : File.Format.Fasta.Converter
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Functions for interpreting a... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/lib/file-parsers/src/File/Format/Fasta/Converter.hs | haskell | ---------------------------------------------------------------------------
|
Module : File.Format.Fasta.Converter
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
Functions for interpreting and converting parsed abiguous FASTA sequences.
----------------------... | Copyright : ( c ) 2015 - 2021 Ward Wheeler
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE UnboxedSums #
module File.Format.Fasta.Converter
( FastaSequenceType(..)
, fastaStreamConverter
) where
import Control.DeepSeq
import ... |
aee5a7d4e168f3c96eb8fa63f8cca529a44bd512a8a194b0023a73e0a013f3b5 | HaskellCNOrg/snaplet-oauth | Splices.hs | {-# LANGUAGE OverloadedStrings #-}
module Splices where
import Snap.Snaplet.OAuth
import Text.Templating.Heist
----------------------------------------------------------------------
-- Splices
----------------------------------------------------------------------
rawResponseSplices :: (Monad ... | null | https://raw.githubusercontent.com/HaskellCNOrg/snaplet-oauth/17318ef528512370b892b6cb91de7c5e6e1d7814/example/src/Splices.hs | haskell | # LANGUAGE OverloadedStrings #
--------------------------------------------------------------------
Splices
-------------------------------------------------------------------- |
module Splices where
import Snap.Snaplet.OAuth
import Text.Templating.Heist
rawResponseSplices :: (Monad m, Show a) => a -> Splice m
rawResponseSplices = textSplice . sToText
bindRawResponseSplices :: (Monad m, Show a)
=> a
-> HeistState m
... |
d29cb9682e57d215fca60b95d2444168c3ad1c51e55518853373a00a3310f81c | melange-re/melange | js_name_of_module_id.ml | 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 License , or
* ( at your option ) any later versi... | null | https://raw.githubusercontent.com/melange-re/melange/47a2971b65d5abf996457bdcc9fc483bdb9551e6/jscomp/core/js_name_of_module_id.ml | ocaml | dependency is runtime module
Runtime files end up in the same directory, `lib/js` or `lib/es6`
lib/ocaml/xx.cmj --
HACKING: FIXME
maybe we can caching relative package path calculation or employ package map
Invariant: the package path to bs-platform, it is used to
... | 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 License , or
* ( at your option ) any later versi... |
d5ba2fda89e01a3edfa8fe0d91f9e7a005a1a884a39b917979dcd9015e023099 | input-output-hk/cardano-ledger | Internal.hs | {-# OPTIONS_HADDOCK hide, not-home #-}
-- | Provide Tools for debugging
-- Feel free to add new things as they are developed.
module Cardano.Ledger.Shelley.Internal (
trace,
totalAdaPotsES,
compareAdaPots,
producedTxBody,
consumedTxBody,
showCred,
showIR,
showKeyHash,
showListy,
showMap,
showWi... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/6ac1edddfb207cff0c61481f8918b656021c14de/eras/shelley/impl/src/Cardano/Ledger/Shelley/Internal.hs | haskell | # OPTIONS_HADDOCK hide, not-home #
| Provide Tools for debugging
Feel free to add new things as they are developed.
============================================== |
module Cardano.Ledger.Shelley.Internal (
trace,
totalAdaPotsES,
compareAdaPots,
producedTxBody,
consumedTxBody,
showCred,
showIR,
showKeyHash,
showListy,
showMap,
showWithdrawal,
showSafeHash,
synopsisCert,
synopsisCoinMap,
trim,
showTxCerts,
)
where
import Cardano.Ledger.Shelley.AdaPo... |
7f08a45bca950f4e63527ef87646379a3484a6cb42589e71edeb3ff2e6fef7e9 | vernemq/vernemq | vmq_metrics_http.erl | Copyright 2018 Erlio GmbH Basel Switzerland ( )
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/vernemq/vernemq/72b565d20defbc2339d4c2cb8f19daba80357305/apps/vmq_server/src/vmq_metrics_http.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2018 Erlio GmbH Basel Switzerland ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vmq_metrics_http).
-behaviour(vmq_http_config).
-include("vmq_metrics.hrl").
-export([routes/0, is_authorized/2]).
... |
41b431020c7ab70b8bd92592c45a5e3465796293f893abea6c4c947f4ec9176b | ocaml-flambda/flambda-backend | inlining_report.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/f1af4294b2eb49c7938da6d93d68391d2c7cb035/middle_end/flambda2/simplify_shared/inlining_report.ml | ocaml | ************************************************************************
OCaml
... | , OCamlPro
Copyright 2020 - -2021 OCamlPro SAS
Copyright 2021 - -2021 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
Inlining reports for Flambda... |
74af1956f4b2e402d1f0ff62a8f515e26daea8dd4d1b466d39630c2789979749 | bufferswap/ViralityEngine | component-mop-defs.lisp | (in-package #:virality)
;; In the component-class we keep annotation values for annotations that are
;; identified by symbol.
(defclass annotation-value ()
((%serialnum :accessor serialnum
:initarg :serialnum)
(%name :accessor name
:initarg :name)
(%state :accessor state ;; :initialize... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/datatype/component-mop-defs.lisp | lisp | In the component-class we keep annotation values for annotations that are
identified by symbol.
:initialized or :forward-reference
The meta-class for the component class.
Each created annotation gets a serialnumber gotten from here.
The annotation database for all annotations
key: symbol, value: component-class/... | (in-package #:virality)
(defclass annotation-value ()
((%serialnum :accessor serialnum
:initarg :serialnum)
(%name :accessor name
:initarg :name)
:initarg :state)
(%setter :accessor setter
:initarg :setter)
(%getter :accessor getter
:initarg :gette... |
0d0b9ec61a39db4c25fe712bf98d6b31fe996a20681d91edd196c4b09d4b20b1 | metosin/komponentit | clipboard.cljs | (ns example.clipboard
(:require [komponentit.clipboard :as clipboard]
[reagent.core :as r]
[devcards.core :as dc :include-macros true]
[clojure.string :as str]
[example.core :as e]))
(dc/defcard (str
(e/header 'clipboard "Clipboard")
(:doc (meta #'clipboard/copy-text))... | null | https://raw.githubusercontent.com/metosin/komponentit/d962ce1d69ccc3800db0d6b4fc18fc2fd30b494a/example-src/cljs/example/clipboard.cljs | clojure | (ns example.clipboard
(:require [komponentit.clipboard :as clipboard]
[reagent.core :as r]
[devcards.core :as dc :include-macros true]
[clojure.string :as str]
[example.core :as e]))
(dc/defcard (str
(e/header 'clipboard "Clipboard")
(:doc (meta #'clipboard/copy-text))... | |
c5a25da88d6610b68e028ada41c7845f55b14331e345dad0a33a2a70c5fc7285 | wangzhe3224/cs3110 | print.ml | module type ToString =
sig
type t
val to_string : t -> string
end
module Print (M: ToString) =
struct
let print t = print_endline (M.to_string t)
end
module Int = struct
type t = int
let to_string = string_of_int
end
module MyString = struct
type t = string
l... | null | https://raw.githubusercontent.com/wangzhe3224/cs3110/33c1b9662ee5ba4bd13d7ec5a116b539bf086605/labs/lab8/print.ml | ocaml | module PrintWith = Print(StringWithPrint) | module type ToString =
sig
type t
val to_string : t -> string
end
module Print (M: ToString) =
struct
let print t = print_endline (M.to_string t)
end
module Int = struct
type t = int
let to_string = string_of_int
end
module MyString = struct
type t = string
l... |
19a4e0f29a2e733a0591c1294a8960768cea9768e6250af3a7805f3ac05e9705 | g-andrade/deigma | deigma_sup.erl | Copyright ( c ) 2018 - 2022
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , including without limitation
%% the rights to use, copy, modify, merge, publish, di... | null | https://raw.githubusercontent.com/g-andrade/deigma/85b63171f00a557b7b688b5d6c510baeb5de2a99/src/deigma_sup.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following conditions:
The above copyright not... | Copyright ( c ) 2018 - 2022
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
... |
399d1b5d896e81b7f949c1ef56d3b3e7e8aab2ece72a10c57562b45673956d6c | argp/bap | generate_mli.ml |
Build a .mli from a .dist file .
Files with extension .dist are used to assemble modules into a
consistent hierarchy . Essentially , .dist files are .ml files
with additional annotations designed to allow generation of
the corresponding .mli .
Format of a .dist file :
{ [
( * Modul... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/build/preprocess_mli/generate_mli.ml | ocaml | Module comment
%mli "a/file/path/foo.mli" aka "InnerFoo"
Module comment
%mli "another/file/path/foo.mli" submodule "Bar"
Module comment
%mli "a/file/path/foo.mli"
...same grammar...
Stuff
*The list of include directories.
Specified on the command-line
* Invoke ocamldep and compute the dependencies of a .mli
* Import... |
Build a .mli from a .dist file .
Files with extension .dist are used to assemble modules into a
consistent hierarchy . Essentially , .dist files are .ml files
with additional annotations designed to allow generation of
the corresponding .mli .
Format of a .dist file :
{ [
( * Modul... |
cde6f652c4c6433dfe8ac7814170f45d7686836f8d2a1e59ef63ec0347e494bd | keithj/cl-genomic | conditions.lisp | ;;;
Copyright ( c ) 2007 - 2011 . All rights reserved .
;;;
;;; This file is part of cl-genomic.
;;;
;;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;... | null | https://raw.githubusercontent.com/keithj/cl-genomic/d160199c2b369df97afd3fded16b1ade507b80dd/src/conditions.lisp | lisp |
This file is part of cl-genomic.
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR P... | Copyright ( c ) 2007 - 2011 . All rights reserved .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(in-package :bio-sequence)
(define-condition bio-sequ... |
e507832c82568438a70cec67abf58dda0c67ad1dce980cd1b0f236ae7e06cffc | ejgallego/coq-serapi | sertop_sexp.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * INRIA , CNRS and contributors - Copyright 1999 - 2018
(* <O___,, * (see CREDITS file for the list of authors) *)
\VV/ * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/dd9e3fbf7faaf3bf365fa3eff134641055151a9b/sertop/sertop_sexp.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
<O___,, * (see CREDITS file for the list of authors)
// * This file is distributed under the terms of the
* (see LICENSE file for... | v * INRIA , CNRS and contributors - Copyright 1999 - 2018
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser General Public License Version 2.1
Copyright 2016 - 2018 MINES ParisT... |
29f3a839a438a4d8f461478dd9416388d4ec805c457d666b00d3c43bd78e7a87 | OCamlPro/typerex-lint | type_collector.mli | val typ_collector : (string * Parsetree.core_type) list ref -> Ast_mapper.mapper
val collect : Parsetree.type_declaration list -> Parsetree.type_declaration list
| null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/libs/ocplib-sempatch/lib/automaton/generator/type_collector.mli | ocaml | val typ_collector : (string * Parsetree.core_type) list ref -> Ast_mapper.mapper
val collect : Parsetree.type_declaration list -> Parsetree.type_declaration list
| |
772ea90799b0f97580786b3615cf0cc57ead3ba5eb4d01f08cd0129fae58e15a | SjVer/Som-Lang | malfunction_compiler.mli |
type outfiles = {
objfile : string;
cmxfile : string;
cmifile : string option
}
val delete_temps : outfiles -> unit
val compile_module :
filename:string ->
Malfunction.moduleexp ->
outfiles
val link_executable : string -> outfiles -> int
| null | https://raw.githubusercontent.com/SjVer/Som-Lang/4d2f62d7f3bfe5929a962bdeddbd94ea75439ad7/somc/lib/malfunction/malfunction_compiler.mli | ocaml |
type outfiles = {
objfile : string;
cmxfile : string;
cmifile : string option
}
val delete_temps : outfiles -> unit
val compile_module :
filename:string ->
Malfunction.moduleexp ->
outfiles
val link_executable : string -> outfiles -> int
| |
bc444a572578d5697be7297695d8a807882bf2079d4c32e5b904017b4a864d73 | pcapriotti/optparse-applicative | Help.hs | module Options.Applicative.Help (
-- | This is an empty module which re-exports
-- the help text system for optparse.
| Pretty printer . most combinators
from Text . PrettyPrint .
module Options.Applicative.Help.Pretty,
-- | A free monoid over Doc with helpers for
-- composing help text componen... | null | https://raw.githubusercontent.com/pcapriotti/optparse-applicative/8edc41994984cbfdfc1ee960e4d4d112cfccbc11/src/Options/Applicative/Help.hs | haskell | | This is an empty module which re-exports
the help text system for optparse.
| A free monoid over Doc with helpers for
composing help text components.
| Types required by the help system.
| Core implementation of the help text
generator.
| Edit distance calculations for suggestions | module Options.Applicative.Help (
| Pretty printer . most combinators
from Text . PrettyPrint .
module Options.Applicative.Help.Pretty,
module Options.Applicative.Help.Chunk,
module Options.Applicative.Help.Types,
module Options.Applicative.Help.Core,
module Options.Applicative.Help.Levenshtein
... |
29cd1d10cb27b25f1e0871468786b69b5e37569b552f996fa01d972fa288f845 | capnproto/capnp-ocaml | generate.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* capnp - ocaml
*
* Copyright ( c ) 2013 - 2014 ,
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without ... | null | https://raw.githubusercontent.com/capnproto/capnp-ocaml/dda3d811aa7734110d7af051465011f1f823ffb9/src/compiler/generate.ml | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* capnp - ocaml
*
* Copyright ( c ) 2013 - 2014 ,
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without ... | |
3ccaa8e141f307056f0ecad02a5db96aaf1099b2a820239a7a0ed6518a482151 | facebook/pyre-check | cache.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/536e4a2c008726d0ce5589eaef681166923b6183/source/interprocedural_analyses/taint/cache.ml | ocaml | Cache: implements caching capabilities for the taint analysis. This is what
* powers the `--use-cache` command line option. This is basically implemented
* by writing the shared memory into a file and restoring it later.
Re-write the original taint configuration in shared memory,
* in case it was overwritten... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
e28681a731c331f7589fbfcbad08e0a3f1805a190f8fb37817cf46b0f6fd9d51 | input-output-hk/cardano-wallet | Coin.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
{-# LANGUAGE ExplicitForAll #-}
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
-- |
Copyright : © 2018 - 2020 IOHK
-- License: Apache-2.0
--
-- This module provides the 'Coin' data type, which represents a ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/157a6d5f977f4600373596b7cfa9700138e8e140/lib/primitive/lib/Cardano/Wallet/Primitive/Types/Coin.hs | haskell | # LANGUAGE ExplicitForAll #
|
License: Apache-2.0
This module provides the 'Coin' data type, which represents a quantity of
lovelace.
* Type
* Conversions (Safe)
* Conversions (Unsafe)
* Arithmetic operations
* Partitioning
| A 'Coin' represents a quantity of lovelace.
to ordinary addition and summation.... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
Copyright : © 2018 - 2020 IOHK
module Cardano.Wallet.Primitive.Types.Coin
Coin (..)
, fromIntegralMaybe
, fromNatural
, fromQuantity
, f... |
a00644e2739702fc0ed6289ca32dc616875b2811e885cb602fe3edf4a1670450 | nickewing/netz | util.clj | (defn- matrix-mult
"Multiply two matrices and ensure the result is also a matrix."
[a b]
(let [result (mmult a b)]
(if (matrix? result)
result
(matrix [result]))))
(defn- round-output
"Round outputs to nearest integer."
[output]
(vec (map #(Math/round ^Double %) output)))
(defn- sign
"Re... | null | https://raw.githubusercontent.com/nickewing/netz/8103cb947f7fea989f12aec5debed7823950ac06/src/netz/util.clj | clojure | (defn- matrix-mult
"Multiply two matrices and ensure the result is also a matrix."
[a b]
(let [result (mmult a b)]
(if (matrix? result)
result
(matrix [result]))))
(defn- round-output
"Round outputs to nearest integer."
[output]
(vec (map #(Math/round ^Double %) output)))
(defn- sign
"Re... | |
32b7fcae2e0436a23462051937ee7d558a90737749cdbd2105880780f3815a48 | UU-ComputerScience/uhc | Main.hs | -- There was a lot of discussion about various ways of computing
numbers ( whatever they are ) on haskell - cafe in March 2003
Here 's one of the programs .
-- It's not a very good test, I suspect, because it manipulates big integers,
and so probably spends most of its time in GMP .
import Data.Ratio
import ... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/benchmark/nofib/imag/bernouilli/Main.hs | haskell | There was a lot of discussion about various ways of computing
It's not a very good test, I suspect, because it manipulates big integers,
powers = [[r^n | r<-[2..]] | n<-1..]
type signature required for compilers lacking the monomorphism restriction
powers = [[(-1)^r * r^n | r<-[2..]] | n<-1..] | numbers ( whatever they are ) on haskell - cafe in March 2003
Here 's one of the programs .
and so probably spends most of its time in GMP .
import Data.Ratio
import System.Environment
powers :: [[Integer]]
powers = [2..] : map (zipWith (*) (head powers)) powers
neg_powers =
map (zipWith (\n x -> if n t... |
8ce9d733c2278ae8ed7518f4020d4e1031f17c8d80b7d13b0060b5ba99dadbf8 | alicemaz/digital_henge | Moon.hs | module Moon () where
import GHC.Exts
import Data.Tuple.Curry
import Control.Lens.Operators
import Control.Lens.Tuple
import Types
import Util
basically just generate illumination for every minute of the interval
-- for full/new if it crosses the target it reverses direction
-- so we just take time at max/min
-- fo... | null | https://raw.githubusercontent.com/alicemaz/digital_henge/0a1c75a5088fc6f256179024b51ebbbf4381c9e4/src/Moon.hs | haskell | for full/new if it crosses the target it reverses direction
so we just take time at max/min
for other phases if it crosses, we take the closest to the target
otherwise there is no phase point in the interval
actual min/max t are always t0/tN because... that's how time works
but monomorphism restriction I guess is... | module Moon () where
import GHC.Exts
import Data.Tuple.Curry
import Control.Lens.Operators
import Control.Lens.Tuple
import Types
import Util
basically just generate illumination for every minute of the interval
instance CheckEvent Moon where
checkEvent y m d = checkPhase ival
where jds = (dateToJD y m... |
e61437d856c524545b8881ac1a2a0b696aea7de962bade33f0ba81e374d22baa | thheller/shadow-cljs | chokidar.cljs | (ns shadow.chokidar
(:require ["chokidar" :refer (watch)]))
(def watcher
(watch
#js ["src/dev" "src/main" "src/test"]
#js {}))
(defn watch-callback [event path]
(js/console.log event path))
(defn main [& args]
(.on watcher "all" watch-callback)) | null | https://raw.githubusercontent.com/thheller/shadow-cljs/ba0a02aec050c6bc8db1932916009400f99d3cce/src/repl/shadow/chokidar.cljs | clojure | (ns shadow.chokidar
(:require ["chokidar" :refer (watch)]))
(def watcher
(watch
#js ["src/dev" "src/main" "src/test"]
#js {}))
(defn watch-callback [event path]
(js/console.log event path))
(defn main [& args]
(.on watcher "all" watch-callback)) | |
877f7a0372252cb04c2a6713bf3cd273888c0efc36225e70c0625fd79c3e2587 | softwarelanguageslab/maf | phil.scm | Adapted from Savina benchmarks ( " Dining Philosophers benchmarks " , coming from Wikipedia )
(define Rounds (int-top))
(define NumForks (int-top))
(define NumPhilosophers NumForks)
(define counter
(actor "counter" (n)
(add (m) (become counter (+ n m)))
(finish () (display n) (terminate))))
(d... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/4ad15e2fe3b8ceeb1bb77c1ff2737582675bfb77/test/concurrentScheme/actors/savina/phil.scm | scheme | Modeled as side effects, probably not the best thing to do...
was: (send self start) | Adapted from Savina benchmarks ( " Dining Philosophers benchmarks " , coming from Wikipedia )
(define Rounds (int-top))
(define NumForks (int-top))
(define NumPhilosophers NumForks)
(define counter
(actor "counter" (n)
(add (m) (become counter (+ n m)))
(finish () (display n) (terminate))))
(d... |
d0ad98bd648df6f375cb88b7950dc82d8f6a30950d5c1da83a0b139a386d66d8 | alex-gutev/generic-cl | equality.lisp | ;;;; equality.lisp
;;;;
Copyright 2018 - 2021
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limitation the rights to use,
;;;... | null | https://raw.githubusercontent.com/alex-gutev/generic-cl/a2626e85f400ba6f453ce849899071b722c2b6b5/test/equality.lisp | lisp | equality.lisp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the f... | Copyright 2018 - 2021
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package :generic-cl/test)
... |
987c0030c153fd4fe4419f4a0f6862e14f6cd8f4b5d08ca8df5dbec9a127ff84 | fogfish/pts | pts_sup.erl | %%
Copyright ( c ) 2012 ,
%% All Rights Reserved.
%%
%% This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License , version 3.0
as published by the Free Software Foundation ( the " License " ) .
%%
Software distributed under the Li... | null | https://raw.githubusercontent.com/fogfish/pts/f98c594f1e596f81b5e54c9791bf69568327fba2/src/pts_sup.erl | erlang |
All Rights Reserved.
This library is free software; you can redistribute it and/or modify
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
License along with this library; if not, write to the ... | Copyright ( c ) 2012 ,
it under the terms of the GNU Lesser General Public License , version 3.0
as published by the Free Software Foundation ( the " License " ) .
Software distributed under the License is distributed on an " AS IS "
You should have received a copy of the GNU Lesser General Public
... |
f6dedf942964b7e2a4f870b5e49b57a7695efc7c34c6f5dd78a589ddce3fd00d | parapluu/Concuerror | receive_deps.erl | -module(receive_deps).
-export([test/0]).
-export([scenarios/0]).
-concuerror_options_forced([{ignore_error, deadlock}]).
scenarios() -> [{test, inf, dpor}].
test() ->
P = self(),
ets:new(table, [public, named_table]),
Fun =
fun(X) ->
fun() ->
P ! X,
... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/advanced_tests/src/receive_deps.erl | erlang | -module(receive_deps).
-export([test/0]).
-export([scenarios/0]).
-concuerror_options_forced([{ignore_error, deadlock}]).
scenarios() -> [{test, inf, dpor}].
test() ->
P = self(),
ets:new(table, [public, named_table]),
Fun =
fun(X) ->
fun() ->
P ! X,
... | |
2443feb81bedd45fe7b3703da4c3084f7b2ec69dabf1deec17387ebda0224d1b | haskell-works/hw-kafka-avro | Avro.hs | module Kafka.Avro
( module X
, propagateKeySchema
, propagateValueSchema
) where
import Control.Monad.IO.Class
import Data.ByteString.Lazy
import Kafka.Avro.Decode as X
import Kafka.Avro.Encode as X
import Kafka.Avro.SchemaRegistry as X
-- | Registers schema that was used for a given payload against ... | null | https://raw.githubusercontent.com/haskell-works/hw-kafka-avro/12af0eaaae1e0bff227b73864f7305714e458947/src/Kafka/Avro.hs | haskell | | Registers schema that was used for a given payload against the specified subject as a key shema.
It is possible that a given payload doesn't have schema registered against it, in this case no prapagation happens.
| Registers schema that was used for a given payload against the specified subject as a value schema.
... | module Kafka.Avro
( module X
, propagateKeySchema
, propagateValueSchema
) where
import Control.Monad.IO.Class
import Data.ByteString.Lazy
import Kafka.Avro.Decode as X
import Kafka.Avro.Encode as X
import Kafka.Avro.SchemaRegistry as X
propagateKeySchema :: MonadIO m => SchemaRegistry -> Subject -> ... |
1091c726afeed62b37c03d2fde756a00e8f20a6be3b951141dfa4475972390de | spartango/CS153 | compile.ml | (* Compile Cish AST to MIPS AST *)
open Mips
open Ast
open Utility
open Word32
exception TODO
type result = { code : Mips.inst list;
data : Mips.label list }
(* generate fresh labels *)
let label_counter = ref 0
let new_int() = (label_counter := (!label_counter) + 1; !label_counter)
let new_label() =... | null | https://raw.githubusercontent.com/spartango/CS153/16faf133889f1b287cb95c1ea1245d76c1d8db49/ps3/compile.ml | ocaml | Compile Cish AST to MIPS AST
generate fresh labels
Stack Manipulation
Code Gen
Generates code to push a variable on to the stack
Push variable on to stack
Generate corresponding instructions
Move $sp
Generates code to pop a variable off the stack
Provides the offset of a variable relative to the stac... | open Mips
open Ast
open Utility
open Word32
exception TODO
type result = { code : Mips.inst list;
data : Mips.label list }
let label_counter = ref 0
let new_int() = (label_counter := (!label_counter) + 1; !label_counter)
let new_label() = "L" ^ (string_of_int (new_int()))
Offset is with respect t... |
6539b16ee3d5ec95b400b69b55fe9ec961b97fc6a5052c666ca41f6ded5a3aca | chetmurthy/pa_ppx | pa_undo_deriving.ml | (* camlp5r *)
(* pa_undo_deriving.ml,v *)
Copyright ( c ) INRIA 2007 - 2017
#load "pa_extend.cmo";
#load "q_MLast.cmo";
#load "pa_macro.cmo";
#load "pa_macro_gram.cmo";
#load "pa_extfun.cmo";
open Asttools;
open MLast;
open Pa_ppx_utils ;
open Pa_ppx_base ;
open Pa_passthru ;
open Ppxutil ;
value flatten_declare_s... | null | https://raw.githubusercontent.com/chetmurthy/pa_ppx/7c662fcf4897c978ae8a5ea230af0e8b2fa5858b/pa_undo_deriving/pa_undo_deriving.ml | ocaml | camlp5r
pa_undo_deriving.ml,v | Copyright ( c ) INRIA 2007 - 2017
#load "pa_extend.cmo";
#load "q_MLast.cmo";
#load "pa_macro.cmo";
#load "pa_macro_gram.cmo";
#load "pa_extfun.cmo";
open Asttools;
open MLast;
open Pa_ppx_utils ;
open Pa_ppx_base ;
open Pa_passthru ;
open Ppxutil ;
value flatten_declare_str_item l =
l |> List.map (fun [
S... |
7a317efce7c7865c354f835999ffc6c777502ec6e10151a59822759838e69bd6 | lisp-polymorph/polymorph.data-structures | package.lisp | package.lisp
(uiop:define-package #:polymorph.data-structures
(:use)
(:mix #:polymorphic-functions #:polymorph.maths #:introspect-ctype
#:polymorph.copy-cast #:polymorph.macros
#:polymorph.access #:polymorph.traversable
#:common-lisp)
(:reexport #:polymorph.traversable)
(:import-from #:i... | null | https://raw.githubusercontent.com/lisp-polymorph/polymorph.data-structures/ef99e898f115ff6bc224d0497844dda4070df682/src/package.lisp | lisp | TODO export stuff here | package.lisp
(uiop:define-package #:polymorph.data-structures
(:use)
(:mix #:polymorphic-functions #:polymorph.maths #:introspect-ctype
#:polymorph.copy-cast #:polymorph.macros
#:polymorph.access #:polymorph.traversable
#:common-lisp)
(:reexport #:polymorph.traversable)
(:import-from #:i... |
584d036be7fc0e4fc55331b336d7a709201a921c04c725cded63bacb772184ca | binsec/binsec | binpatcher.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/binsec/8ed9991d36451a3ae7487b966c4b38acca21a5b3/src/binpatcher/binpatcher.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
fdeac9a787e85cc0b240b29fb57961495d1ed1611aae22f9b2e21a725ececf6e | blockapps/eth-pruner | Restore.hs | module Restore where
import Control.Monad.IO.Class (liftIO)
import Data.Default
import qualified Database.LevelDB as DB
import Database
restore :: (DB.MonadResource m)
=> String
-> String
-> m ()
restore originDir toDir = do
inDB <- DB.open originDir def... | null | https://raw.githubusercontent.com/blockapps/eth-pruner/513fcc884c93974a29b380ca80669dc0aebec125/src/Restore.hs | haskell | module Restore where
import Control.Monad.IO.Class (liftIO)
import Data.Default
import qualified Database.LevelDB as DB
import Database
restore :: (DB.MonadResource m)
=> String
-> String
-> m ()
restore originDir toDir = do
inDB <- DB.open originDir def... | |
95bccc89f141691b41ec7d42b773d95a7120c89d85d42ee5291e92edd01982ba | Lovesan/bike | invocation-cache.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
Copyright ( C ) 2019 , < lovesan.ru at gmail.com >
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;; restriction, inclu... | null | https://raw.githubusercontent.com/Lovesan/bike/3f43b6c503f6fb3d40d02c75b99e8525253a6bb5/src/invocation-cache.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do... |
Copyright ( C ) 2019 , < lovesan.ru at gmail.com >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KI... |
f0bb9f645445f638424540f6d0fb7e19eef5f5ee21ffa8b37ad7fa927db4ce40 | erlang-lager/lager | pr_composite_test.erl | -module(pr_composite_test).
-compile([{parse_transform, lager_transform}]).
-record(a, {field1 :: term(), field2 :: term()}).
-record(b, {field1 :: term() , field2 :: term()}).
-include_lib("eunit/include/eunit.hrl").
nested_record_test() ->
A = #a{field1 = x, field2 = y},
B = #b{field1 = A, field2 = {}},... | null | https://raw.githubusercontent.com/erlang-lager/lager/8b87339a43721a382eabe35a71f4f1e0e664c0b3/test/pr_composite_test.erl | erlang | -module(pr_composite_test).
-compile([{parse_transform, lager_transform}]).
-record(a, {field1 :: term(), field2 :: term()}).
-record(b, {field1 :: term() , field2 :: term()}).
-include_lib("eunit/include/eunit.hrl").
nested_record_test() ->
A = #a{field1 = x, field2 = y},
B = #b{field1 = A, field2 = {}},... | |
8a6f8a4677669869d6339d9b7cfbf6f47d9eb547104fef7aed3c393cbb28ca73 | threatgrid/ctia | hooks_service_core.clj | (ns ctia.flows.hooks-service-core
"Handle hooks ([Cf. #159]())."
(:require [clojure.tools.logging :as log]
[ctia.flows.hooks.event-hooks :as event-hooks]
[ctia.flows.hook-protocol :as prot]
[ctia.schemas.services :refer [ConfigServiceFns]]
[ctia.flows.hooks-service.sc... | null | https://raw.githubusercontent.com/threatgrid/ctia/32857663cdd7ac385161103dbafa8dc4f98febf0/src/ctia/flows/hooks_service_core.clj | clojure | (ns ctia.flows.hooks-service-core
"Handle hooks ([Cf. #159]())."
(:require [clojure.tools.logging :as log]
[ctia.flows.hooks.event-hooks :as event-hooks]
[ctia.flows.hook-protocol :as prot]
[ctia.schemas.services :refer [ConfigServiceFns]]
[ctia.flows.hooks-service.sc... | |
22b74e93f01b61b6c7fab7b15b7579d1cc925046a0dde429733cad64d7c331a1 | jabber-at/ejabberd-contrib | fusco_lib_tests.erl | %%%-----------------------------------------------------------------------------
( C ) 1999 - 2013 , Erlang Solutions Ltd
@author < >
@author Corbacho < >
%%% @doc
%%% @end
%%%-----------------------------------------------------------------------------
-module(fusco_lib_tests).
-copyright("2013, Erlang So... | null | https://raw.githubusercontent.com/jabber-at/ejabberd-contrib/d5eb036b786c822d9fd56f881d27e31688ec6e91/ejabberd_auth_http/deps/fusco/test/fusco_lib_tests.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
----------------------------------------------------------------------------- | ( C ) 1999 - 2013 , Erlang Solutions Ltd
@author < >
@author Corbacho < >
-module(fusco_lib_tests).
-copyright("2013, Erlang Solutions Ltd.").
-include("../include/fusco_types.hrl").
-include("../include/fusco.hrl").
-include_lib("eunit/include/eunit.hrl").
parse_url_test_() ->
[
?_assertEqua... |
49b84c1053df251560225aa8e925a63a423573be8cf7383d2bf12dbb179e81db | ocaml-community/ulex | utf8.ml | exception MalFormed
(* cf *)
let width = Array.make 256 (-1)
let () =
for i = 0 to 127 do width.(i) <- 1 done;
for i = 192 to 223 do width.(i) <- 2 done;
for i = 224 to 239 do width.(i) <- 3 done;
for i = 240 to 247 do width.(i) <- 4 done
let next s i =
match s.[i] with
| '\000'..'\127' as c ->
... | null | https://raw.githubusercontent.com/ocaml-community/ulex/9a01902864e023939c9021c1320ad81497f1ef3d/utf8.ml | ocaml | cf
************************ | exception MalFormed
let width = Array.make 256 (-1)
let () =
for i = 0 to 127 do width.(i) <- 1 done;
for i = 192 to 223 do width.(i) <- 2 done;
for i = 224 to 239 do width.(i) <- 3 done;
for i = 240 to 247 do width.(i) <- 4 done
let next s i =
match s.[i] with
| '\000'..'\127' as c ->
Char.cod... |
43857ec9fe0e30689cfefadb849860ff41d6fb78fed577dff9b52b7045ae3b93 | CardanoSolutions/kupo | Health.hs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
# LANGUAGE RecordWildCards #
module Kupo.Data.Health
( -- * Health
Health (..)
, emptyHealth
* ConnectionStatus
, Conn... | null | https://raw.githubusercontent.com/CardanoSolutions/kupo/1ee9006d1513037cf0b662feaecbc444d6584bce/src/Kupo/Data/Health.hs | haskell | * Health
| Information about the overall state of the application.
^ Condition of the connection with the underlying node.
^ Absolute slot number of the most recent database checkpoint.
^ Absolute slot number of the tip of the node
| Reflect the current state of the connection with the underlying node. | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
# LANGUAGE RecordWildCards #
module Kupo.Data.Health
Health (..)
, emptyHealth
* ConnectionStatus
, ConnectionStatus (..)
... |
95c48922fd715d4eec9d788cea8261b6748933fd7ad937d158c24cb16a36c00d | GaloisInc/HaLVM | Xenstore.hs | Copyright 2006 - 2008 , Galois , Inc.
This software is distributed under a standard , three - clause BSD license .
-- Please see the file LICENSE, distributed with this software, for specific
-- terms and conditions.
An example showing how programs can interact with the .
import Control.Concurrent
import Control... | null | https://raw.githubusercontent.com/GaloisInc/HaLVM/3ec1d7e4b6bcb91304ba2bfe8ee280cb1699f24d/examples/Core/Xenstore/Xenstore.hs | haskell | Please see the file LICENSE, distributed with this software, for specific
terms and conditions. | Copyright 2006 - 2008 , Galois , Inc.
This software is distributed under a standard , three - clause BSD license .
An example showing how programs can interact with the .
import Control.Concurrent
import Control.Exception
import Control.Monad
import Hypervisor.Console
import Hypervisor.Debug
import Hypervisor.Er... |
c80c22eac51a989f12df3a20118e9896c1695409fa623be29b060bdd2e9c3dfc | gren-lang/compiler | PossibleFilePath.hs | module Gren.PossibleFilePath
( PossibleFilePath (..),
mapWith,
encodeJson,
other,
is,
toChars,
)
where
import Data.Utf8 qualified as Utf8
import Json.Encode qualified as E
data PossibleFilePath a
= Is FilePath
| Other a
deriving (Eq)
mapWith :: (a -> b) -> PossibleFilePath a -> Possible... | null | https://raw.githubusercontent.com/gren-lang/compiler/d15699406d55636a1c0884a31bdc8f6bed995b83/builder/src/Gren/PossibleFilePath.hs | haskell | module Gren.PossibleFilePath
( PossibleFilePath (..),
mapWith,
encodeJson,
other,
is,
toChars,
)
where
import Data.Utf8 qualified as Utf8
import Json.Encode qualified as E
data PossibleFilePath a
= Is FilePath
| Other a
deriving (Eq)
mapWith :: (a -> b) -> PossibleFilePath a -> Possible... | |
dbbadfb550ea9b50bbab04d82a4c9eafaa6543d7d4496770579fbbb30961d305 | xclerc/ocamljava | mapReduce.mli |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library 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 License , or
* ( at yo... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/library/concurrent/src/mapreduce/mapReduce.mli | ocaml | * Map/reduce computations.
* The type of input values.
* The type of keys.
* The type of values.
* The type of output values.
* Ordering over keys.
* {i map} operation, turning an input value into a list of key/value
couples. The various calls to [map] are done in parallel by pool
threads.
* {i reduc... |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library 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 License , or
* ( at yo... |
b9d5ac8bbccf09e126ad0ff6ee01021a29eeea1cc05d22e4a042a754a8b1bc23 | soulomoon/SICP | Exercise4.29.scm | Exercise 4.29 : Exhibit a program that you would expect to run much more slowly without memoization than with memoization . Also , consider the following interaction , where the i d procedure is defined as in Exercise 4.27 and count starts at 0 :
; (define (square x) (* x x))
; ; ; L - Eval input :
; (square (id ... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter4/Exercise4.29.scm | scheme | (define (square x) (* x x))
; ; L - Eval input :
(square (id 10))
; ; L - Eval value :
⟨response⟩
; ; L - Eval input :
count
; ; L - Eval value :
⟨response⟩ | Exercise 4.29 : Exhibit a program that you would expect to run much more slowly without memoization than with memoization . Also , consider the following interaction , where the i d procedure is defined as in Exercise 4.27 and count starts at 0 :
Give the responses both when the evaluator and when it does not... |
1dd25e8b0e55f9519aa01b93c82db55744b6f15acc53e69122d5d133a237fd80 | LexiFi/dead_code_analyzer | anonFn.ml | let f ?(a = 0) ?(b = 0) x = a + b + x
let g ?(a = 0) ?(b = 0) x = a + b + x
let h ?(a = 0) ?(b = 0) x = a + b + x
| null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/examples/dir/anonFn.ml | ocaml | let f ?(a = 0) ?(b = 0) x = a + b + x
let g ?(a = 0) ?(b = 0) x = a + b + x
let h ?(a = 0) ?(b = 0) x = a + b + x
| |
dc2f221337ebc6224404b860ab4d25a14c628d2793018c0d0c1b13f9722e408c | bcc32/advent-of-code | a.ml | open! Core
let visited = Int.Hash_set.create ()
let rec dfs edges x =
if not (Hash_set.mem visited x)
then (
Hash_set.add visited x;
Map.find edges x |> Option.iter ~f:(List.iter ~f:(fun other -> dfs edges other)))
;;
let () =
let pipes =
In_channel.with_file (Sys.get_argv ()).(1) ~f:In_channel.inp... | null | https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2017/12/a.ml | ocaml | open! Core
let visited = Int.Hash_set.create ()
let rec dfs edges x =
if not (Hash_set.mem visited x)
then (
Hash_set.add visited x;
Map.find edges x |> Option.iter ~f:(List.iter ~f:(fun other -> dfs edges other)))
;;
let () =
let pipes =
In_channel.with_file (Sys.get_argv ()).(1) ~f:In_channel.inp... | |
ee66a02e72d1a65351a5fb3b4da2d123b404f3b7353234e7e2b9c06ee41d1d2a | racket/drracket | module-language-tools.rkt | #lang racket/base
(provide module-language-tools@)
(require mrlib/switchable-button
mrlib/bitmap-label
mrlib/close-icon
racket/contract
racket/contract/option
racket/place
racket/format
racket/unit
racket/class
racket/math
racket... | null | https://raw.githubusercontent.com/racket/drracket/a6f6392b6d95c717db9c5fd0c1325444d23b60d9/drracket/drracket/private/module-language-tools.rkt | racket | state : (or/c hash-lang-error-state? #f)
-- string is the error message
when ints-surrogate is #f, then we
should in a language other than the module
language so we can safely skip this
true when we are in the module language
non-false is the string that was parsed for the language
non-false means that an edit... | #lang racket/base
(provide module-language-tools@)
(require mrlib/switchable-button
mrlib/bitmap-label
mrlib/close-icon
racket/contract
racket/contract/option
racket/place
racket/format
racket/unit
racket/class
racket/math
racket... |
e4f41c7b7823b12138febde18b91da97827ca3b73f882f92bcaed87fff9c5f82 | 39aldo39/klfc | Types.hs | {-# LANGUAGE ConstraintKinds #-}
module Layout.Types
( Action
, DeadKey'(..)
, BaseChar'(..)
, BaseChar
, ActionResult'(..)
, ActionResult
, ActionMap
, DeadKey
, Letter(..)
, Key
, _pos
, _shortcutPos
, _shiftlevels
, _letters
, _capslock
, Information
... | null | https://raw.githubusercontent.com/39aldo39/klfc/83908c54c955b9c160b999bc8f0892401ba4adbf/src/Layout/Types.hs | haskell | # LANGUAGE ConstraintKinds # |
module Layout.Types
( Action
, DeadKey'(..)
, BaseChar'(..)
, BaseChar
, ActionResult'(..)
, ActionResult
, ActionMap
, DeadKey
, Letter(..)
, Key
, _pos
, _shortcutPos
, _shiftlevels
, _letters
, _capslock
, Information
, _fullName
, _name
, ... |
bc28434834e7462c9a91c69e5dfb6d8a697804fd3ea871b96c995ab1e8507477 | vert-x/mod-lang-clojure | server.clj | Copyright 2013 the original author or authors .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/vert-x/mod-lang-clojure/dcf713460b8f46c08d0db6e7bf8537f1dd91f297/examples/pubsub/server.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright 2013 the original author or authors .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns example.pubsub.server
(:require [vertx.net :as net]
[vertx.shareddata :as shared]
[clojure.string :as string]
[vertx.stream :as stream]
[vertx.e... |
3d46beb49aa035973523e09a8d312e52d14dbc7ab05c1f1955663171ff716960 | ocaml-ppx/ppx | syntax.ml | (* When upstreaming this, we need to make sure it's built from the lexer's
keyword_table rather than duplicated. *)
let keywords =
[ "and"; "as"; "assert"; "asr"; "begin"; "class"; "constraint"; "do"; "done"
; "downto"; "else"; "end"; "exception"; "external"; "false"; "for"; "fun"
; "function"; "functor"; "if"... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/astlib/syntax.ml | ocaml | When upstreaming this, we need to make sure it's built from the lexer's
keyword_table rather than duplicated. | let keywords =
[ "and"; "as"; "assert"; "asr"; "begin"; "class"; "constraint"; "do"; "done"
; "downto"; "else"; "end"; "exception"; "external"; "false"; "for"; "fun"
; "function"; "functor"; "if"; "in"; "include"; "inherit"; "initializer"
; "land"; "lazy"; "let"; "lor"; "lsl"; "lsr"; "lxor"; "match"; "method"
... |
59371f9a4d98d729e701af885142a74890ecb0e0afd5e7bfafa4689e1b1e4826 | jwiegley/notes | folded.hs | import Control.Applicative
import Control.Lens
import Data.Data.Lens
data Type = Foo Int
| Bar String
| Baz Int
deriving Show
data Foozle = Foozle [Type] deriving Show
_foozle :: Traversal Type Type String String
_foozle f x@(Bar a) = Bar <$> f a
_foozle _ x = pure x
main =
print $
... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/misc/folded.hs | haskell | import Control.Applicative
import Control.Lens
import Data.Data.Lens
data Type = Foo Int
| Bar String
| Baz Int
deriving Show
data Foozle = Foozle [Type] deriving Show
_foozle :: Traversal Type Type String String
_foozle f x@(Bar a) = Bar <$> f a
_foozle _ x = pure x
main =
print $
... | |
317b3e539f34393bf7fd22ae3d0b82ca1508f391f62f0c351fe14c97a48252bd | chenyukang/eopl | 46.scm | (load-relative "../libs/init.scm")
(load-relative "./base/scheduler.scm")
(load-relative "./base/semaphores.scm")
(load-relative "./base/store.scm")
(load-relative "./base/queues.scm")
(load-relative "./base/thread-cases.scm")
(load-relative "./base/environments.scm")
(load-relative "./base/test.scm")
based on 45 , r... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch5/46.scm | scheme | see the new stuff,
here notice the buggy part
like list(n1,...,nk) in exceptions language. Sorry about that.
arbitrary number of unary procedures
new stuff
other unary operators
sllgen boilerplate ;;;;;;;;;;;;;;;;
expressed values ;;;;;;;;;;;;;;;;
extractors:
mutexes ;;;;;;;;;;;;;;;;
ref to bool
procedures ;... | (load-relative "../libs/init.scm")
(load-relative "./base/scheduler.scm")
(load-relative "./base/semaphores.scm")
(load-relative "./base/store.scm")
(load-relative "./base/queues.scm")
(load-relative "./base/thread-cases.scm")
(load-relative "./base/environments.scm")
(load-relative "./base/test.scm")
based on 45 , r... |
deb8772770630ff430a9d1b38d8930f6bed0a2d005bdf5b11274ac63d806b84b | haskell-repa/repa | Flatten.hs |
module Data.Array.Repa.Vector.Operators.Flatten
(Flatten2 (..))
where
import Data.Array.Repa.Repr.Stream
import Data.Array.Repa.Repr.Chain
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Stream.Flatten as S
import Data.Array.Repa as R
import qualified Data.Vector.Unboxed as U
... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/icebox/abandoned/repa-vector-old/chains/Data/Array/Repa/Vector/Operators/Flatten.hs | haskell | | Flatten a vector of tuples into a vector of their elements.
# INLINE [1] vflatten2 #
# INLINE [1] vflatten2 #
# INLINE [1] vflatten2 #
# INLINE [1] vflatten2 # |
module Data.Array.Repa.Vector.Operators.Flatten
(Flatten2 (..))
where
import Data.Array.Repa.Repr.Stream
import Data.Array.Repa.Repr.Chain
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Stream.Flatten as S
import Data.Array.Repa as R
import qualified Data.Vector.Unboxed as U
... |
31b896a1075b62768d654777a06a454a77527ef2914ddfe01118ba6babe5b2b8 | vbmithr/ocaml-ftx | ftx.ml | open Sexplib.Std
let strfloat =
let open Json_encoding in
union [
case float (fun s -> Some s) (fun s -> s) ;
case string (fun s -> Some (string_of_float s)) float_of_string ;
]
module Ezjsonm_encoding = struct
include Json_encoding.Make(Json_repr.Ezjsonm)
let destruct_safe encoding value =
try... | null | https://raw.githubusercontent.com/vbmithr/ocaml-ftx/d3aae520c1ed859162b62b09a8fdb003063be66d/src/ftx.ml | ocaml | open Sexplib.Std
let strfloat =
let open Json_encoding in
union [
case float (fun s -> Some s) (fun s -> s) ;
case string (fun s -> Some (string_of_float s)) float_of_string ;
]
module Ezjsonm_encoding = struct
include Json_encoding.Make(Json_repr.Ezjsonm)
let destruct_safe encoding value =
try... | |
64a3e8ff30d4c6bfa23f39b22e5b05dbd5016fed6eb6423ff9588b1d4016eaf1 | takikawa/racket-ppa | get-extend.rkt | #lang racket/unit
(require racket/class
drracket/private/drsig
framework/private/logging-timer)
(import [prefix drracket:unit: drracket:unit^]
[prefix drracket:frame: drracket:frame^]
[prefix drracket:rep: drracket:rep^]
[prefix drracket:debug: drracket:debug^]
[prefi... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/share/pkgs/drracket/drracket/private/get-extend.rkt | racket | #lang racket/unit
(require racket/class
drracket/private/drsig
framework/private/logging-timer)
(import [prefix drracket:unit: drracket:unit^]
[prefix drracket:frame: drracket:frame^]
[prefix drracket:rep: drracket:rep^]
[prefix drracket:debug: drracket:debug^]
[prefi... | |
4aafe0b6aec359f18954a0131454e7f925423b5a4e6e76f301fb483098922c1d | abhinav/pinch | Bits.hs | {-# LANGUAGE CPP #-}
# LANGUAGE MagicHash #
-- |
Module : Pinch . Internal . Bits
Copyright : ( c ) 2015
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
--
-- Provides unchecked bitwise shift operations. Similar versions of @shiftR@
-- are used by @ByteString.... | null | https://raw.githubusercontent.com/abhinav/pinch/2ac323ab7c64b5fdf8a5f8206f790ef03ec8a23c/src/Pinch/Internal/Bits.hs | haskell | # LANGUAGE CPP #
|
License : BSD3
Stability : experimental
Provides unchecked bitwise shift operations. Similar versions of @shiftR@
are used by @ByteString.Builder.Prim@. | # LANGUAGE MagicHash #
Module : Pinch . Internal . Bits
Copyright : ( c ) 2015
Maintainer : < >
module Pinch.Internal.Bits
( w16ShiftL
, w32ShiftL
, w64ShiftL
) where
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
import GHC.Base (
Int (..),
#if MIN_VERSION_ba... |
068d49cb034037a4ab6690869d7bd667460a4d8344e79540efc70aa3955c350f | the-dr-lazy/cascade | Create.hs | |
Module : Test . Cascade . Api . StateMachine . Command . Project . Create
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INS... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-api/test/Test/Cascade/Api/StateMachine/Command/Project/Create.hs | haskell | |
Module : Test . Cascade . Api . StateMachine . Command . Project . Create
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INS... | |
e771fcc97bbd52696b3816a8a166e1638e35da7c8ffd4dd8fa30c4d09f5627f2 | jwiegley/notes | ComonadGraph.hs | {-# LANGUAGE RankNTypes #-}
-- a tiny annotated graph library
2010
module Data.Graph.Annotated where
import Data.Sequence as S
import Data.Sequence (Sequence, ViewL(..), ViewR(..), (><))
import Data.Vector as V
import Data.Ix
import qualified Data.Graph as G
import Data.Graph (Graph)
import Control.Monad.Writer.... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/ComonadGraph.hs | haskell | # LANGUAGE RankNTypes #
a tiny annotated graph library
TODO: use Vector [Int] or Rope (Vector [Int])
used internally, expose?
existentially wrapped annotation
a boxed up annotated structure
we can transpose node annotations easily |
2010
module Data.Graph.Annotated where
import Data.Sequence as S
import Data.Sequence (Sequence, ViewL(..), ViewR(..), (><))
import Data.Vector as V
import Data.Ix
import qualified Data.Graph as G
import Data.Graph (Graph)
import Control.Monad.Writer.Instances
class PFunctor f where
first :: (a -> b) -> f a c... |
9087828cd5ccc643ed0fa65f8b1cfc2e7cba2e8d8e396daa8e35cf3a15870f55 | mstksg/inCode | invariant.hs | #!/usr/bin/env stack
stack --install - ghc ghci --resolver lts-16 --package prettyprinter --package functor - combinators-0.3.6.0 --package aeson --package vinyl-0.13.0 --package contravariant --package scientific --package text --package semigroupoids --package free --package invariant --package aeson - better - err... | null | https://raw.githubusercontent.com/mstksg/inCode/e1f80a3dfd83eaa2b817dc922fd7f331cd1ece8a/code-samples/functor-structures/invariant.hs | haskell | install - ghc ghci --resolver lts-16 --package prettyprinter --package functor - combinators-0.3.6.0 --package aeson --package vinyl-0.13.0 --package contravariant --package scientific --package text --package semigroupoids --package free --package invariant --package aeson - better - errors --package kan - extensions
... | #!/usr/bin/env stack
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
import Control.Monad
import Data.Functor.Contravariant
import Data.Functor.Invariant.DecAlt
import Data.Functor.Invariant.DivAp
import Data.Functor.Plus
import Data.HF... |
f907ed32940229ac07d7dbe1506ca3dcf525876b59855b69d1a2e76aa8f18fed | jacekschae/learn-reitit-course-files | routes.clj | (ns cheffy.conversation.routes
(:require [cheffy.middleware :as mw]
[cheffy.conversation.db :as conversation-db]
[ring.util.response :as rr]
[cheffy.responses :as responses])
(:import (java.util UUID)))
(defn routes
[env]
(let [db (:jdbc-url env)]
["/conversation" {:swag... | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/57-conversation-tests/src/cheffy/conversation/routes.clj | clojure | (ns cheffy.conversation.routes
(:require [cheffy.middleware :as mw]
[cheffy.conversation.db :as conversation-db]
[ring.util.response :as rr]
[cheffy.responses :as responses])
(:import (java.util UUID)))
(defn routes
[env]
(let [db (:jdbc-url env)]
["/conversation" {:swag... | |
2200cd1f79c4eb9492d49c518e466c8c4cf739ed9b1a100ae6f7077dc7a8be6a | nasser/magic | generated_types.clj | (ns magic.analyzer.generated-types
(:require [magic.analyzer.types :as types])
(:import [System.Reflection TypeAttributes]))
(def ^:dynamic
*reusable-types*
nil)
(def public TypeAttributes/Public)
(def interface (enum-or
TypeAttributes/Public
TypeAttributes/Abstract
... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/src/magic/analyzer/generated_types.clj | clojure | (ns magic.analyzer.generated-types
(:require [magic.analyzer.types :as types])
(:import [System.Reflection TypeAttributes]))
(def ^:dynamic
*reusable-types*
nil)
(def public TypeAttributes/Public)
(def interface (enum-or
TypeAttributes/Public
TypeAttributes/Abstract
... | |
a3e1d7cb0c402505adc5879f827f9eddff787f4680e3ff879b150ac5b2da2e83 | betaveros/bcodex | IntExpr.hs | module Text.Bcodex.IntExpr (parseIntExpr) where
import Text.Read (readMaybe)
Parse an expression such as " 1 " , " -1 " , " i " , " 3 + 4i " , into a list of values
produced by substiting 0 , 1 etc . for i. Right now , only very simple
-- expressions are supported: sums of constants and multiples of i.
parseIn... | null | https://raw.githubusercontent.com/betaveros/bcodex/90fadbf8215efa932212ae95fb5573df835f0c90/Text/Bcodex/IntExpr.hs | haskell | expressions are supported: sums of constants and multiples of i.
modifier will be id or negate | module Text.Bcodex.IntExpr (parseIntExpr) where
import Text.Read (readMaybe)
Parse an expression such as " 1 " , " -1 " , " i " , " 3 + 4i " , into a list of values
produced by substiting 0 , 1 etc . for i. Right now , only very simple
parseIntAtom :: String -> Maybe [Int]
parseIntAtom "" = Just $ repeat 0
par... |
389d785c3b8122ba5d3a26709eaee78ab4e2d94e7346fba669c0315af3a9b514 | lrascao/simple_web_server | simple_web_server_app.erl | -module(simple_web_server_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_Type, _StartArgs) ->
{ok, _} = simple_web_server:http_start(),
simple_web_server_sup:start_link().
stop(_State) ->
ok.
| null | https://raw.githubusercontent.com/lrascao/simple_web_server/d5418f3dca4c436c29223fbb518713e30fb228d0/src/simple_web_server_app.erl | erlang | -module(simple_web_server_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_Type, _StartArgs) ->
{ok, _} = simple_web_server:http_start(),
simple_web_server_sup:start_link().
stop(_State) ->
ok.
| |
d430a61dd07cf0ad0e12225fcebf3d0104705274b7355551b53f17fa04905ecf | Tavistock/lseq-tree | base.cljc | (ns lseq-tree.base
(:require [lseq-tree.util :refer [pow]]))
(defrecord Base [size])
(defn bit
[{:keys [size]} n]
(+ size n))
(defn sum
[{:keys [size] :as base} level]
(let [x (bit base level)
y (- size 1)]
(- (/ (* x (+ x 1)) 2)
(/ (* y (+ y 1)) 2))))
(defn interval
[base lower upper... | null | https://raw.githubusercontent.com/Tavistock/lseq-tree/4b75e43477fdeb421c5bf56f65be71c108378673/src/lseq_tree/base.cljc | clojure | (ns lseq-tree.base
(:require [lseq-tree.util :refer [pow]]))
(defrecord Base [size])
(defn bit
[{:keys [size]} n]
(+ size n))
(defn sum
[{:keys [size] :as base} level]
(let [x (bit base level)
y (- size 1)]
(- (/ (* x (+ x 1)) 2)
(/ (* y (+ y 1)) 2))))
(defn interval
[base lower upper... | |
a60064247099faa1b56b48fbf750e5fbbe7f5970e17881bf38960fc0bf846932 | protolude/protolude | Protolude.hs | # LANGUAGE CPP #
# LANGUAGE Trustworthy #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ExplicitNamespaces #
# OPTIONS_GHC -fno - warn - unused - imports #
module Protolude (
-- * Base functions
module Base,
identity,
pass,
#if !MIN_VERSION_base(4,8,0)
... | null | https://raw.githubusercontent.com/protolude/protolude/3e249724fd0ead27370c8c297b1ecd38f92cbd5b/src/Protolude.hs | haskell | # LANGUAGE BangPatterns #
* Base functions
* Function functions
* List functions
* Data Structures
* Show functions
* Bool functions
* Monad functions
* Functor functions
* Either functions
* Applicative functions
* String conversion
* Debug functions
* Panic functions
* Exception functions
* Semiring fu... | # LANGUAGE CPP #
# LANGUAGE Trustworthy #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ExplicitNamespaces #
# OPTIONS_GHC -fno - warn - unused - imports #
module Protolude (
module Base,
identity,
pass,
#if !MIN_VERSION_base(4,8,0)
(&),
scanl',
#endif
module Function,
applyN,
... |
be9b146b6ee281297bcf4aba3c705f66e638e0e746a2961f052b082e59dec949 | monadbobo/ocaml-core | job.mli | open Core.Std
type 'execution_context t
val create : 'execution_context -> ('a -> unit) -> 'a -> 'execution_context t
val execution_context : 'execution_context t -> 'execution_context
val run : _ t -> unit
| null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/async/core/lib/job.mli | ocaml | open Core.Std
type 'execution_context t
val create : 'execution_context -> ('a -> unit) -> 'a -> 'execution_context t
val execution_context : 'execution_context t -> 'execution_context
val run : _ t -> unit
| |
1bec9b2edfc144732cb7cee0e44f73992f7e4fbca5ca1f0b93dcf696611eb0bf | unison-code/uni-instr-sel | Base.hs | |
Copyright : Copyright ( c ) 2012 - 2017 , < >
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <>
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Main authors:
Gabriel Hjort ... | null | https://raw.githubusercontent.com/unison-code/uni-instr-sel/2edb2f3399ea43e75f33706261bd6b93bedc6762/uni-is/UniIS/Drivers/Base.hs | haskell | # LANGUAGE DeriveDataTypeable #
------------
Data types
------------
| Options that can be given on the command line.
| Represents 'make' actions.
| Represents 'transform' actions.
| Represents 'plot' actions.
| Represents 'check' actions. | |
Copyright : Copyright ( c ) 2012 - 2017 , < >
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2012-2017, Gabriel Hjort Blindell <>
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Main authors:
Gabriel Hjort ... |
7977c4a81b0ca3ea763a989f2bea30aad23fb18e6bf4ee949bb1414ff0f25ef7 | antono/guix-debian | time.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 < >
Copyright © 2013 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/packages/time.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 < >
Copyright © 2013 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages time)
#:use-module (guix licenses)
#:use-module (guix p... |
2c6341ffc7c51723a48121c07394279849a13e2c3e9ca43ee7c494d896e59267 | willijar/LENS | connectivity-map.lisp | ;; Application to send packets at regular intervals.
Copyright ( C ) 2014 Dr.
Author : Dr. < >
;; Keywords:
;;; Copying:
This file is part of Lisp Educational Network Simulator ( LENS )
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publi... | null | https://raw.githubusercontent.com/willijar/LENS/646bc4ca5d4add3fa7e0728f14128e96240a9f36/networks/wsn/application/connectivity-map.lisp | lisp | Application to send packets at regular intervals.
Keywords:
Copying:
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
LENS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or ... | Copyright ( C ) 2014 Dr.
Author : Dr. < >
This file is part of Lisp Educational Network Simulator ( LENS )
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.