_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 |
|---|---|---|---|---|---|---|---|---|
2edf6ba0c47cbda11fd57bd477d0fcf73eac0c55b47aca19165b40bae1490b1d | VisionsGlobalEmpowerment/webchange | icon_page_text_big_at_bottom.cljs | (ns webchange.ui.components.icon.layout.icon-page-text-big-at-bottom)
(def data
[:svg {:xmlns ""
:width "104" :height "142" :viewBox "0 0 104 142"
:fill "none" :stroke "#DCE3F5" :stroke-width "2"
:class-name "stroke-colored"}
[:rect {:x "1" :y "1" :width "102" :height "1... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/0df52dd08d54f14d4ec5d2717f48031849a7ee16/src/cljs/webchange/ui/components/icon/layout/icon_page_text_big_at_bottom.cljs | clojure | (ns webchange.ui.components.icon.layout.icon-page-text-big-at-bottom)
(def data
[:svg {:xmlns ""
:width "104" :height "142" :viewBox "0 0 104 142"
:fill "none" :stroke "#DCE3F5" :stroke-width "2"
:class-name "stroke-colored"}
[:rect {:x "1" :y "1" :width "102" :height "1... | |
785b408ca7128a46cd45b0c246c14ec3cad411a4c40cb692ac0fec8aa9289720 | keera-studios/keera-hails | ReactiveModelInternals.hs | -- | This module holds the reactive program model. It holds a program model,
-- but includes events that other threads can listen to, so that a change
-- in a part of the model is notified to another part of the program. The
-- reactive model is not necessarily concurrent (it doesn't have its own thread),
-- although a... | null | https://raw.githubusercontent.com/keera-studios/keera-hails/bf069e5aafc85a1f55fa119ae45a025a2bd4a3d0/demos/keera-hails-demos-gtk/elementarygtkprogram/src/Model/ReactiveModel/ReactiveModelInternals.hs | haskell | | This module holds the reactive program model. It holds a program model,
but includes events that other threads can listen to, so that a change
in a part of the model is notified to another part of the program. The
reactive model is not necessarily concurrent (it doesn't have its own thread),
although a facility ... | Copyright : ( C ) Keera Studios Ltd , 2013
Maintainer :
module Model.ReactiveModel.ReactiveModelInternals
( ReactiveModel
, GRM.basicModel
, GRM.emptyRM
, GRM.pendingEvents
, GRM.pendingHandlers
, GRM.getPendingHandler
, GRM.onEvent
, GRM.onBasicModel
, GRM.triggerEvent
)
where... |
cbef901825d030724dd2b203f45b77171bb569d8ba93a10346c027b63860a8f3 | iu-parfunc/lvars | bfs_lvish.hs | # LANGUAGE CPP , ScopedTypeVariables #
# LANGUAGE BangPatterns , RankNTypes #
import Data.Set as Set
-- Benchmark utils:
import PBBS.FileReader
import PBBS.Timing (wait_clocks, runAndReport)
calibrate , measureFreq , commaint ,
import Control.LVish
import Control.LVish.Internal
import Control.LVish.DeepFrz (runPar... | null | https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/lvish-apps/pbbs/benchmarks/graphs/bfs_lvish.hs | haskell | Benchmark utils:
define DEBUG_CHECKS
------------------------------------------------------------------------------
they are available to other computations, enabling pipelining.
iteration counter
graph
LVar
set of " seen " node labels , initially size 0
set of " new " node labels , initially size 1
funct... | # LANGUAGE CPP , ScopedTypeVariables #
# LANGUAGE BangPatterns , RankNTypes #
import Data.Set as Set
import PBBS.FileReader
import PBBS.Timing (wait_clocks, runAndReport)
calibrate , measureFreq , commaint ,
import Control.LVish
import Control.LVish.Internal
import Control.LVish.DeepFrz (runParThenFreezeIO)
import... |
f5e18679b10a3a5e61484bf3bfff4036b46f34d40df4bd9a9e43a9756ecb0222 | racketscript/racketscript | for.rkt | #lang racket
(define (fn lst)
(for ([v lst])
(displayln v)))
(fn (list 1 2 3 4))
;; string sequences
;; needs unsafe-string-length
(for ([c "string"])
(displayln c))
(for ([c (string->list "string")])
(displayln c))
| null | https://raw.githubusercontent.com/racketscript/racketscript/11400fdd9d11541e7dd40c536c015677a7fa4181/tests/basic/for.rkt | racket | string sequences
needs unsafe-string-length | #lang racket
(define (fn lst)
(for ([v lst])
(displayln v)))
(fn (list 1 2 3 4))
(for ([c "string"])
(displayln c))
(for ([c (string->list "string")])
(displayln c))
|
00838acd0984202621c5ec50167c175f12b6f4492d9ed6f40e13c63ce7ee43d4 | caadxyz/caad4lisp | autolisp-comm.lisp | (in-package :caad4lisp)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; autolisp command compatibility
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; BREAK
(defun Command-Break(entity p0 p1 )
(if (= Conf-AutoCAD-Version "2015+" )
(command-s ".BREAK" entity "F" p0 p1 )
(command ".BREAK" entity ... | null | https://raw.githubusercontent.com/caadxyz/caad4lisp/393eaa7893bdbf307a3615573fe22a8c1e2b9412/src/autolisp-comm.lisp | lisp |
autolisp command compatibility
BREAK | (in-package :caad4lisp)
(defun Command-Break(entity p0 p1 )
(if (= Conf-AutoCAD-Version "2015+" )
(command-s ".BREAK" entity "F" p0 p1 )
(command ".BREAK" entity p0 p1 )
)
)
|
846230ac270d298216412df9162b67b12d818cc895186951f6efbd24f9fd4e4c | MondayMorningHaskell/Monads | Functors.hs | module Functors where
import Data.Maybe (mapMaybe)
import qualified Data.Map as M
-- Motivating Examples!
-- Simple String conversion. It might fail, so it returns Maybe
tupleFromInputString :: String -> Maybe (String, String, Int)
tupleFromInputString input = if length stringComponents /= 3
then Nothi... | null | https://raw.githubusercontent.com/MondayMorningHaskell/Monads/41bda26e0199c1c0734bd2c8c45f33b880ac3122/src/Functors.hs | haskell | Motivating Examples!
Simple String conversion. It might fail, so it returns Maybe
An alternative to using a tuple (String, String, Int)
Could not use `convertTuple` with the results of this function!
Functor Definitions:
class Functor f where
fmap :: (a -> b) -> f a -> f b
instance Functor [] where
fmap = ma... | module Functors where
import Data.Maybe (mapMaybe)
import qualified Data.Map as M
tupleFromInputString :: String -> Maybe (String, String, Int)
tupleFromInputString input = if length stringComponents /= 3
then Nothing
else Just (stringComponents !! 0, stringComponents !! 1, age)
where
stringCom... |
2cc83bebdb63ef8b10ef385f81cb8b43cb2770446b59f7517a3b686add9d7989 | LispEngineer/aiband | fov.clj | Copyright 2016 , Jr.
symbolics _ at _ lisp.engineer
;; /
;;
Aiband - The Artificial Intelligence Roguelike
;;;; Field of view / Line of sight module
;; Calculates line of sight using a single parameter, distance.
;; As we are on a map where diagonal movement is the same as lateral,
;; you can see that di... | null | https://raw.githubusercontent.com/LispEngineer/aiband/c29181401ba8767099aac52120651f99d36af7a3/Assets/aiband/fov.clj | clojure | /
Field of view / Line of sight module
Calculates line of sight using a single parameter, distance.
As we are on a map where diagonal movement is the same as lateral,
you can see that distance in a square around you.
treated as on horiz/vertical.
We calculate the edges of the square, and then for each edge
... | Copyright 2016 , Jr.
symbolics _ at _ lisp.engineer
Aiband - The Artificial Intelligence Roguelike
Distance 1 is a 3x3 square , Distance 2 is a 5x5 square , etc .
( Distance * 2 + 1 ) ^ 2 .
This is the Chebyshev distance , since movement on diagonals is
out to that edge , using a Bresenham algorit... |
6402d2dd62e357f5fc1d3f537655bafce6618fdff15e60820c8d4a32edb25a4c | sirherrbatka/clusters | utils.lisp | (cl:in-package #:clusters.pam)
(defun clear-cluster-contents (state)
(setf (fill-pointer (access-cluster-contents state))
(read-medoids-count state))
(map nil
(curry #'(setf fill-pointer) 1)
(access-cluster-contents state)))
(defun order-medoids (state)
(setf (access-cluster-contents sta... | null | https://raw.githubusercontent.com/sirherrbatka/clusters/20b8b60005ac8e27d12d05d277b26d8b5ca5c238/source/pam/utils.lisp | lisp | (cl:in-package #:clusters.pam)
(defun clear-cluster-contents (state)
(setf (fill-pointer (access-cluster-contents state))
(read-medoids-count state))
(map nil
(curry #'(setf fill-pointer) 1)
(access-cluster-contents state)))
(defun order-medoids (state)
(setf (access-cluster-contents sta... | |
875f2c79be0bd7e3d62c47ab6a1a9e9bda7051235e811d5fa4d2f08ae35dc294 | uelis/IntML | compile.ml | (** Compilation to circuits
*)
open Term
open Unify
open Typing
(* Conveniencene function for n-ary let on WC level *)
let let_tupleW (x: var) ((sigma: var list), (f: Term.t)) : Term.t =
(* TODO: document *)
let rec remove_shadow sigma =
match sigma with
| [] -> []
| x :: rest ->
... | null | https://raw.githubusercontent.com/uelis/IntML/d0d29b689e2503642aeb9c0b9a35cc61a26419a6/compile.ml | ocaml | * Compilation to circuits
Conveniencene function for n-ary let on WC level
TODO: document
* A wire represents a dart in an undirected graph.
All wires are meant to 'leave' the instructions, i.e. they are all affixed
* with their src-label to the instruction.
* The type of the respective wires is indicated in t... | open Term
open Unify
open Typing
let let_tupleW (x: var) ((sigma: var list), (f: Term.t)) : Term.t =
let rec remove_shadow sigma =
match sigma with
| [] -> []
| x :: rest ->
x :: remove_shadow
(List.map (fun y -> if x = y then Term.unusable_var else y)
... |
78f3ff215fce07486d3273e046fa00312f370e6b37e1c6fa24f6d7f098a132e7 | dyoo/whalesong | sharing.rkt | #lang whalesong
(define infinite-ones
(shared ([a (cons 1 a)])
a))
(car infinite-ones)
(car (cdr infinite-ones))
(car (cdr (cdr infinite-ones)))
(newline)
(equal? (shared ([a (cons 1 (cons 2 a))])
a)
(shared ([a (cons 1 b)]
[b (cons 2 c)]
[c (cons 1 b)... | null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/tests/more-tests/sharing.rkt | racket | b is early...
unbox after a is patched
unbox before c is patched
Make sure cyclic lists are treated correctly by list? | #lang whalesong
(define infinite-ones
(shared ([a (cons 1 a)])
a))
(car infinite-ones)
(car (cdr infinite-ones))
(car (cdr (cdr infinite-ones)))
(newline)
(equal? (shared ([a (cons 1 (cons 2 a))])
a)
(shared ([a (cons 1 b)]
[b (cons 2 c)]
[c (cons 1 b)... |
0b27697e292c7c7bc2e1955d2a5547dcac20a0a2efbef5645f70d1696c20be1f | melange-re/melange | ounit_bal_tree_tests.ml | let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: ))
let ( =~ ) = OUnit.assert_equal
module Set_poly = struct
include Set_int
let of_sorted_list xs = Array.of_list xs |> of_sorted_array
let of_array l = Ext_array.fold_left l empty add
end
let suites =
__FILE__
>::: [
( __LOC__ >:: fun _ ->
... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/ounit_tests/ounit_bal_tree_tests.ml | ocaml | let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: ))
let ( =~ ) = OUnit.assert_equal
module Set_poly = struct
include Set_int
let of_sorted_list xs = Array.of_list xs |> of_sorted_array
let of_array l = Ext_array.fold_left l empty add
end
let suites =
__FILE__
>::: [
( __LOC__ >:: fun _ ->
... | |
d5e3d9ee63126ef8dfc81602b0c51cd38defb719a788d381b66d5de969b9aab7 | OCamlPro/ez_api | ezDebug.mli | (**************************************************************************)
(* *)
(* Copyright 2018-2023 OCamlPro *)
(* *)
(* All righ... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/common/virtual/ezDebug.mli | ocaml | ************************************************************************
Copyright 2018-2023 OCamlPro
All rights reserved. This ... | GNU Lesser General Public License version 2.1 , with the special
val printf : ('a, unit, string, unit) format4 -> 'a
val log : string -> unit
|
139103a96b5b0b1eccc98fd3fdf3e961fd82565878c1f93dabf1f1a50a153677 | coast-framework/db | core.clj | (ns db.core
(:require [db.connector]
[db.transactor]
[db.migrator]
[db.associator]
[db.migrator.helper]
[db.migrator.generator]
[db.defq]
[clojure.java.jdbc :as jdbc])
(:refer-clojure :exclude [update drop]))
(def query db.transact... | null | https://raw.githubusercontent.com/coast-framework/db/e738cd6402a89c591363ac6f3e7a6e08bcc28a0e/src/db/core.clj | clojure | (ns db.core
(:require [db.connector]
[db.transactor]
[db.migrator]
[db.associator]
[db.migrator.helper]
[db.migrator.generator]
[db.defq]
[clojure.java.jdbc :as jdbc])
(:refer-clojure :exclude [update drop]))
(def query db.transact... | |
1591be768a368f9077f0a2bcd76dee76b83f799a82cc2b5a1b09fc215938706d | vmchale/libmeme | Wide.hs | module Text.Convert.Wide ( toWide ) where
import qualified Data.Map as M
import Text.Convert.Common
uppercaseWide :: [Char]
uppercaseWide = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
lowercaseWide :: [Char]
lowercaseWide = ['a','b','... | null | https://raw.githubusercontent.com/vmchale/libmeme/a1880f9c1886260e8d7ebf2e0e7844c63b0ee02b/src/Text/Convert/Wide.hs | haskell | | \\( O(n) \\) | module Text.Convert.Wide ( toWide ) where
import qualified Data.Map as M
import Text.Convert.Common
uppercaseWide :: [Char]
uppercaseWide = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
lowercaseWide :: [Char]
lowercaseWide = ['a','b','... |
9a9101e20db9b031213d26de4dc0dc59b3d7f1cdfc558e8e76c94aab1ec8bca0 | schmee/daguerreo | core.clj | (ns daguerreo.core
(:require [clojure.spec.alpha :as s]
[daguerreo.impl.engine :as engine]
[daguerreo.impl.validation :as validation]
[daguerreo.impl.specs]))
(s/fdef validate-tasks
:args (s/cat :tasks :daguerreo/tasks))
(defn validate-tasks
"Validates the integrity of a sequ... | null | https://raw.githubusercontent.com/schmee/daguerreo/872bab60f627c1cd38274f651c213c0d20c07000/src/daguerreo/core.clj | clojure | (ns daguerreo.core
(:require [clojure.spec.alpha :as s]
[daguerreo.impl.engine :as engine]
[daguerreo.impl.validation :as validation]
[daguerreo.impl.specs]))
(s/fdef validate-tasks
:args (s/cat :tasks :daguerreo/tasks))
(defn validate-tasks
"Validates the integrity of a sequ... | |
bccfe02036871f93214f45a5586e58f64f5029acbe375d1e0a3dddb532ea6308 | ocaml-opam/opam-user-setup | ousMisc.ml | open OusTypes
let msg fmt = Printf.kprintf print_endline fmt
let (|>) a f = f a
let (@@) f a = f a
let (/) = Filename.concat
let (@>) f g x = g (f x)
module StringMap = Map.Make(struct type t = string let compare = compare end)
type 'a stringmap = 'a StringMap.t
let lines_of_string s =
let rex = Re.(compile (ch... | null | https://raw.githubusercontent.com/ocaml-opam/opam-user-setup/8208197c93189ed10db9e4c383377e8c3a1a43cf/ousMisc.ml | ocaml | open OusTypes
let msg fmt = Printf.kprintf print_endline fmt
let (|>) a f = f a
let (@@) f a = f a
let (/) = Filename.concat
let (@>) f g x = g (f x)
module StringMap = Map.Make(struct type t = string let compare = compare end)
type 'a stringmap = 'a StringMap.t
let lines_of_string s =
let rex = Re.(compile (ch... | |
fc95fc3afc06541c996784262cf65a67d422a3263733ec0b4b1c2cb5ecd35650 | syntax-objects/syntax-parse-example | render.rkt | #lang racket/base
;; Helper functions for documenting syntax-parse examples
(provide
(except-out
(all-from-out scribble/doclang scribble/example scribble/manual) #%module-begin)
(for-syntax
(all-from-out racket/base syntax/parse))
(rename-out [module-begin #%module-begin])
tech/guide
;; Usage: @te... | null | https://raw.githubusercontent.com/syntax-objects/syntax-parse-example/0e0f34edcb5e69706b52d0e974b34486c33d8b0c/render.rkt | racket | Helper functions for documenting syntax-parse examples
Usage: @tech/guide{text}
where `text` refers to a technical definition.
Short for @tech[#:doc ....]{text},
where `text` refers to a technical definition.
Short for @tech[#:doc ....]{text},
where the `....` is the module path for The Racket Reference
(If ... | #lang racket/base
(provide
(except-out
(all-from-out scribble/doclang scribble/example scribble/manual) #%module-begin)
(for-syntax
(all-from-out racket/base syntax/parse))
(rename-out [module-begin #%module-begin])
tech/guide
where the ` .... ` is the module path for The Racket Guide
tech/ref... |
e7b400dfc117ee1886dc2f0335cdf1e82a274f4917d1d653a9b409a320514e4c | chenyukang/rubytt | trans.ml | open Core
open Node
open Type
open Global
open State
let new_bind node ty kind =
let bind = Type.new_binding node ty kind in
Global.register_bind bind;
bind
let state_add_mode = ref 0;; (* fixme *)
let state_insert st id node ty kind =
let b = new_bind node ty kind in
let qname = match ty.ty with
| Module... | null | https://raw.githubusercontent.com/chenyukang/rubytt/3b9898cd9e180594ee30fb74cea9a8356a6e0c14/src/trans.ml | ocaml | fixme
fixme
Printf.printf "set qname: %s now: %d\n" qname !state_add_mode;
Printf.printf "bind global name: %s ty: %s\n" id (Printer.type_to_str rt 0);
Printf.printf "bind local name: %s ty: %s\n" id (Printer.type_to_str rt 0);
Printf.printf "error array assign size mismatch: %d %d\n" elems_size ty_size
Pr... | open Core
open Node
open Type
open Global
open State
let new_bind node ty kind =
let bind = Type.new_binding node ty kind in
Global.register_bind bind;
bind
let state_insert st id node ty kind =
let b = new_bind node ty kind in
let qname = match ty.ty with
| Fun_ty(_) -> (extend_path st id "#")
| _ -> e... |
696200b15cf52810a5ffc919002e268dafb054d733e4c3a37da08a2d3dae25ab | vikram/lisplibraries | conditions.lisp | Copyright ( c ) 2006 , All Rights Reserved
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of conditions... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/zpb-ttf-0.7/conditions.lisp | lisp |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form ... | Copyright ( c ) 2006 , All Rights Reserved
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
conditions.lisp , v 1.3 2006/02/18 23:13:43 xach Exp
(in-package #:zpb-ttf)
(define-condition regrettable-value ()
((actual-valu... |
b0e5d332e0438675810574754acdbe0d26e6e29e3b3ab9837d8bc0243d8a1404 | foretspaisibles/blueprint | monadic_buffer.ml | MonadicBuffers -- Monadic output to a buffer
Author :
Date : Tue Sep 16 13:33:01 CEST 2014
Blueprint ( )
This file is part of Blueprint
Copyright © 2014
This file must be used under the terms of the CeCILL - B.
This source file is licensed as described in the file COPYING , which
you should h... | null | https://raw.githubusercontent.com/foretspaisibles/blueprint/e1f384c4e3424f8edc09d6676039a3cc84fb06e2/example/monadic_buffer.ml | ocaml | MonadicBuffers -- Monadic output to a buffer
Author :
Date : Tue Sep 16 13:33:01 CEST 2014
Blueprint ( )
This file is part of Blueprint
Copyright © 2014
This file must be used under the terms of the CeCILL - B.
This source file is licensed as described in the file COPYING , which
you should h... | |
1c63556ba522c4776bc83c9e3152cbde914b2516969fc5a2a5aef5a03691f745 | mwri/erlang-efuse | efuse_hellofs.erl | This file is part of the Erlang FUSE ( Filesystem in Userspace )
%% interface called 'efuse'.
%%
' efuse ' is free software , licensed under the MIT license .
%%
@author < >
2015 < >
%%
@doc Hello world FS example filesystem callback module for ' efuse ' app .
%%
%% The 'efuse_examplefs' is a very m... | null | https://raw.githubusercontent.com/mwri/erlang-efuse/dd2a55e2a17fbe688da0f18dcaccf222e299440b/src/efuse_hellofs.erl | erlang | interface called 'efuse'.
The 'efuse_examplefs' is a very minimal example showing the
callbacks and how they need to be implemented.
For a fuller more interesting example of an implementation, see the
'efuse_erlfs' module, or 'efuse_examplefs' is like this, but with a
few more objects.
@doc Behaviour cal... | This file is part of the Erlang FUSE ( Filesystem in Userspace )
' efuse ' is free software , licensed under the MIT license .
@author < >
2015 < >
@doc Hello world FS example filesystem callback module for ' efuse ' app .
-module(efuse_hellofs).
-behviour(efuse_fs).
-export([efuse_init/1, efuse_... |
4d70e2af9bff163ad359dbb5ff0270ce1626b7c2c0b19a85d4970227d4366bf6 | nomnom-insights/nomnom.lockjaw | core.clj | (ns lockjaw.core
(:require
[clojure.tools.logging :as log]
[com.stuartsierra.component :as component]
[lockjaw.operation :as operation]
[lockjaw.protocol :as lockjaw]
[lockjaw.util :as util]))
(defrecord Lockjaw
[name lock-id db-conn]
component/Lifecycle
(start
[this]
(let [lock-id... | null | https://raw.githubusercontent.com/nomnom-insights/nomnom.lockjaw/8d568d1ec36054ca25e798613ccd3e1d229c94cf/src/lockjaw/core.clj | clojure | (ns lockjaw.core
(:require
[clojure.tools.logging :as log]
[com.stuartsierra.component :as component]
[lockjaw.operation :as operation]
[lockjaw.protocol :as lockjaw]
[lockjaw.util :as util]))
(defrecord Lockjaw
[name lock-id db-conn]
component/Lifecycle
(start
[this]
(let [lock-id... | |
8d54cf8af593acb537d785a4299bde77b0f283cbc69b3695ca915cf6eb3c7077 | chef/concrete | concrete_app_sup.erl | -module({{name}}_sup).
-behaviour(supervisor).
-export([
init/1,
start_link/0
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
Restart = {one_for_one, 10, 10},
{ok, {Restart, []}}.
| null | https://raw.githubusercontent.com/chef/concrete/d29237681f93633c9200c8f0ad448ad47aa1d201/priv/templates/concrete_app_sup.erl | erlang | -module({{name}}_sup).
-behaviour(supervisor).
-export([
init/1,
start_link/0
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
Restart = {one_for_one, 10, 10},
{ok, {Restart, []}}.
| |
0ac0b3c466c5bcdaac5460d906b5753612cc846edca21745e99908767391d1d2 | mbenke/zpf2013 | sudoku2b.hs | import Sudoku
import Control.Exception
import System.Environment
import Control.Parallel.Strategies
import Control.DeepSeq
main :: IO ()
main = do
[f] <- getArgs
grids <- fmap lines $ readFile f
let (as,bs) = splitAt (length grids `div` 2) grids
evaluate $ runEval $ do
a <- rpar (force (map so... | null | https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/Par/Marlow/sudoku2b.hs | haskell | import Sudoku
import Control.Exception
import System.Environment
import Control.Parallel.Strategies
import Control.DeepSeq
main :: IO ()
main = do
[f] <- getArgs
grids <- fmap lines $ readFile f
let (as,bs) = splitAt (length grids `div` 2) grids
evaluate $ runEval $ do
a <- rpar (force (map so... | |
9398261f95b2d22c23aaf0d93921748ee595985753abe5a7ae74e5fe2ac67e46 | MyDataFlow/ttalk-server | ws_echo.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(ws_echo).
-behaviour(cowboy_websocket_handler).
-export([init/3]).
-export([websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init(_Any, _Req, _Opts) ->
{upgrade, protocol, cowboy_websocket}.
websocket_init(_Transpor... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/deps/cowboy/test/ws_SUITE_data/ws_echo.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(ws_echo).
-behaviour(cowboy_websocket_handler).
-export([init/3]).
-export([websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init(_Any, _Req, _Opts) ->
{upgrade, protocol, cowboy_websocket}.
websocket_init(_TransportName, Req, _Opts) ->
Req2 = cowboy_req:compact(Req),
{ok,... |
c4272f4c81e49d804d2e05d2da113481aa8556bff0b09d184a0ed50acc2f9068 | hsyl20/haskus-system | Helper.hs | # LANGUAGE DataKinds #
-- | Helpers for the graphics API
module Haskus.System.Linux.Graphics.Helper
( FrameSourceAction (..)
, setController
, switchFrameSource
)
where
import Haskus.System.Linux.Graphics.State
import Haskus.System.Linux.Graphics.Mode
import Haskus.System.Linux.Graphics.FrameSource
import... | null | https://raw.githubusercontent.com/hsyl20/haskus-system/2f389c6ecae5b0180b464ddef51e36f6e567d690/haskus-system/src/lib/Haskus/System/Linux/Graphics/Helper.hs | haskell | | Helpers for the graphics API
^ Use this given source
^ Release the set source
| Configure a controller
connected one is used.
| Switch to another frame source for the given controller without doing a
full mode change | # LANGUAGE DataKinds #
module Haskus.System.Linux.Graphics.Helper
( FrameSourceAction (..)
, setController
, switchFrameSource
)
where
import Haskus.System.Linux.Graphics.State
import Haskus.System.Linux.Graphics.Mode
import Haskus.System.Linux.Graphics.FrameSource
import Haskus.System.Linux.Graphics.Enti... |
4175e6049b1800400d5cb31ce3ce21a3d665e571e63220cf2db3d1fad8183ac8 | scicloj/notespace | channels.clj | (ns scicloj.notespace.v4.events.channels
(:require [clojure.core.async :as async :refer [<! go go-loop timeout chan thread]]
[scicloj.notespace.v4.log :as v4.log]
[scicloj.notespace.v4.state :as v4.state]
[scicloj.notespace.v4.events.handle]
[scicloj.notespace.v4.state ... | null | https://raw.githubusercontent.com/scicloj/notespace/a3fb553b6992f8f1abbf38cd16b81356d7b10d16/src/scicloj/notespace/v4/events/channels.clj | clojure | else -- valid
((fn [grouped-events]
(when (-> grouped-events seq)
(v4.log/log-data
:debug1
{:grouped-events (->> grouped-events
(map (fn [[k events]]
[k (->> events
(map #(dissoc % :v... | (ns scicloj.notespace.v4.events.channels
(:require [clojure.core.async :as async :refer [<! go go-loop timeout chan thread]]
[scicloj.notespace.v4.log :as v4.log]
[scicloj.notespace.v4.state :as v4.state]
[scicloj.notespace.v4.events.handle]
[scicloj.notespace.v4.state ... |
d9abd25f93d9316844c985122fbc642c28a60219f8b50aa3eddb4f4e43b958aa | haskell-servant/servant-snap | StreamingSpec.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
-- | This module tests whether streaming works from client to server
-- with a server implemented with servant-server.
module Servant.StreamingS... | null | https://raw.githubusercontent.com/haskell-servant/servant-snap/b54c5da86f2f2ed994e9dfbb0694c72301b5a220/test/Servant/StreamingSpec.hs | haskell | # LANGUAGE OverloadedStrings #
| This module tests whether streaming works from client to server
with a server implemented with servant-server.
import Network.Wai
import Network.Wai.Internal
import Prelude.Compat
TODO: This test fails
The idea of this test is this :
- The mock c... | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
module Servant.StreamingSpec where
import Control.Concurrent
import Control.Exception hiding (Handler)
import Control.Monad.IO.Class
import qualifie... |
48856702570deb32ad8e57035efd11a2e819f50220fe40fbaa354b073151d458 | sgbj/MaximaSharp | zgemv.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/blas/zgemv.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
ae8889b1be5664fc13f23a9a349c03430b0e82bfa6e6456759c235b7b54fd71c | sunng87/slacker | client.clj | (ns slacker.client
(:require [clojure.string :refer [split]]
[link.tcp :onlu [stop-clients]]
[slacker.common :refer :all :as c]
[slacker.client.common :refer :all]
[slacker.interceptor :as interceptor]))
(defonce ^{:doc "the default client factory using plain socket"}
... | null | https://raw.githubusercontent.com/sunng87/slacker/8c5b9028e659b821c42f4351c055c1c4f577ae3f/src/slacker/client.clj | clojure | (ns slacker.client
(:require [clojure.string :refer [split]]
[link.tcp :onlu [stop-clients]]
[slacker.common :refer :all :as c]
[slacker.client.common :refer :all]
[slacker.interceptor :as interceptor]))
(defonce ^{:doc "the default client factory using plain socket"}
... | |
fa17d9175b94e5b4e1d3d18d92e771616e5dd1f333c47af4c956c2d4129ebc67 | emptyflash/yinlang | Infer.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Infer where
import Prelude hiding (foldr)
import Type
import Syntax
import Control.Monad.State
import Control.Monad.Except
import Data.Monoid
import Data.List (nub)
import Data.Foldable (foldr)
impor... | null | https://raw.githubusercontent.com/emptyflash/yinlang/23a5f59fe7895e557e54a3a67fef363dce3639ef/src/Infer.hs | haskell | # LANGUAGE TypeSynonymInstances #
TODO: this should return an error if the name already exists and isn't the same type
TODO Actually check that the swizzle is valid for the type and the name exists
Maybe use inferPrim? | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
module Infer where
import Prelude hiding (foldr)
import Type
import Syntax
import Control.Monad.State
import Control.Monad.Except
import Data.Monoid
import Data.List (nub)
import Data.Foldable (foldr)
import qualified Data.Map as Map
import qua... |
c042f48944ed8ce019c80f996d945d0731e7fb680c83bac26bfd004e525825ff | braidchat/braid | state.cljs | (ns braid.base.client.state
(:require
[clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[re-frame.core :as re-frame]
[braid.core.common.util :as util]))
(defn initialize-state
[db]
(-> (db ::initial-state)
(merge (select-keys db [::state-spec
::initial-s... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/base/client/state.cljs | clojure | to finish before initializing the db | (ns braid.base.client.state
(:require
[clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[re-frame.core :as re-frame]
[braid.core.common.util :as util]))
(defn initialize-state
[db]
(-> (db ::initial-state)
(merge (select-keys db [::state-spec
::initial-s... |
b651153bb5aa88a75635aa9f05c705a5bb14b7950e2b0b4776540ecb0406a18e | politrons/Dive_into_Haskell | FirstProgram.hs | module FirstProgram where
import Data.Char
import Data.List
whatTimeIsIt :: IO String
whatTimeIsIt = do
putStrLn "What time is it now?"
getLine
outputProgram = do
timeString <- whatTimeIsIt
putStrLn "Again!"
timeString2 <- whatTimeIsIt
putStrLn ("Ok, you said it was "
++ timeString
... | null | https://raw.githubusercontent.com/politrons/Dive_into_Haskell/fd9dec14b87aecba0b3561385c1d75cf969546a4/src/features/FirstProgram.hs | haskell | module FirstProgram where
import Data.Char
import Data.List
whatTimeIsIt :: IO String
whatTimeIsIt = do
putStrLn "What time is it now?"
getLine
outputProgram = do
timeString <- whatTimeIsIt
putStrLn "Again!"
timeString2 <- whatTimeIsIt
putStrLn ("Ok, you said it was "
++ timeString
... | |
bf392cf6583a90de75eeee0d84f8cecc6e7cbd824a59f8fd5311c84a945cd5e3 | xclerc/ocamljava | bytecodegen_constants.mli |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/compiler/javacomp/bytecodegen_constants.mli | ocaml | * Compilation of atomic and structured constants.
* Returns the name of the class holding constants for the module whose
class name is passed.
* Resets the sets of atomic and structured constants.
* Return the instructions pushing the passed constant as a boxed value.
* Return the instructions pushing the passe... |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... |
c2438f93904bae528b137f24c86f7bda00b3329f0f3bbc387e16d38abe3530ae | typelead/intellij-eta | Let00001.hs | module Layout00001 (
everyNth
) where
import Data.Either
import Data.Time.Calendar
everyNth :: Int -> Either WeekDay Int -> Day -> [Day]
everyNth n tp start = case tp of
WeekDay -> start : everyNth tp (addDays n start)
Int -> let (y, m, d) = toGregorian(start) start : everyNth tp ()
| null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/test/resources/fixtures/eta/sources/Let00001.hs | haskell | module Layout00001 (
everyNth
) where
import Data.Either
import Data.Time.Calendar
everyNth :: Int -> Either WeekDay Int -> Day -> [Day]
everyNth n tp start = case tp of
WeekDay -> start : everyNth tp (addDays n start)
Int -> let (y, m, d) = toGregorian(start) start : everyNth tp ()
| |
4b4a1acc2a1b830824b831ed94b8d89bbd61eb7ebee05d2b33fcd20ad921d848 | openbadgefactory/salava | rate_it.cljs | (ns salava.core.ui.rate-it
(:require [reagent.core :refer [create-class]]
[salava.core.i18n :refer [t]]))
(defn rate-it-stars [id value read-only]
[:div {:id id
:class "rateit"
:data-rateit-value (when value (/ value 10))
:data-rateit-readonly read-only}])
(defn rate-it
([i... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/core/ui/rate_it.cljs | clojure | (ns salava.core.ui.rate-it
(:require [reagent.core :refer [create-class]]
[salava.core.i18n :refer [t]]))
(defn rate-it-stars [id value read-only]
[:div {:id id
:class "rateit"
:data-rateit-value (when value (/ value 10))
:data-rateit-readonly read-only}])
(defn rate-it
([i... | |
52f7b590fa216300a2fa8ac72554ce1df0f04d34b30b5b5480d5edf373df5b4a | wireapp/wire-server | Common.hs | # LANGUAGE GeneralizedNewtypeDeriving #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Fou... | null | https://raw.githubusercontent.com/wireapp/wire-server/72a03a776d4a8607b0a9c3e622003467be914894/libs/gundeck-types/src/Gundeck/Types/Common.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | # LANGUAGE GeneralizedNewtypeDeriving #
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public Licens... |
563d874dcd4759cdfa0dfc164c3b283096682a46d49f25a438534852087b4395 | joearms/elib1 | elib1_new_webkit.erl | Copyright ( c ) 2006 - 2009
See MIT - LICENSE for licensing information .
%% elib1_new_webkit
Time - stamp : < 2009 - 10 - 15 16:43:36 ejoearm >
%%---------------------------------------------------------------------------
Copyright ( c ) 2009 < >
Copyright ( c ) 2009 Whoomph Software AB
%%
%% Permiss... | null | https://raw.githubusercontent.com/joearms/elib1/d617d0ec70a058ef102749eadf51c024444c28d9/src/elib1_new_webkit.erl | erlang | elib1_new_webkit
---------------------------------------------------------------------------
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, distr... | Copyright ( c ) 2006 - 2009
See MIT - LICENSE for licensing information .
Time - stamp : < 2009 - 10 - 15 16:43:36 ejoearm >
Copyright ( c ) 2009 < >
Copyright ( c ) 2009 Whoomph Software AB
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom ... |
716682b28eafa7c3784a7cc8b0b4cc0bfb50a39b1dcfb022f4afb97b9aa7bf47 | gowthamk/ocaml-irmin | monkey.ml | open Printf
(* Utility functions *)
U is a module with two functions
module U = struct
let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]"
let print_header h =
begin
Printf.printf "%s\n" h;
flush_all();
end
let (>>=) = Lwt.Infix.(>>=)
let rec loop_... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/heap_leftist/mem/monkey.ml | ocaml | Utility functions
select a random number and insert it in the tree t
comp_time is initialized as 0 which is mutable
sync_time is initialized as 0 which is mutable
Before time
After time
Then we synchronize using sync operation between diff threads
After synchronization time
comp_time represents the com... | open Printf
U is a module with two functions
module U = struct
let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]"
let print_header h =
begin
Printf.printf "%s\n" h;
flush_all();
end
let (>>=) = Lwt.Infix.(>>=)
let rec loop_until_y (msg:string) : u... |
4c4ee4716adb345b5a2d7b80013484b781a84760ba4020fd3751830cc1c493ba | tomahawkins/ecu | CANDBParser.hs | module Main (main) where
import Data.Bits
import Data.Char
import Data.List
import Data.Word
import Text.Printf
import System.Environment
import CANData
main :: IO ()
main = do
args <- getArgs
case args of
["-h"] -> help
["--help"] -> help
[ file ] -> do
dbc <- readFile file
let candb = m... | null | https://raw.githubusercontent.com/tomahawkins/ecu/7d294eb65de5860b3512c4cfb98e232368145775/src/CANDBParser.hs | haskell | module Main (main) where
import Data.Bits
import Data.Char
import Data.List
import Data.Word
import Text.Printf
import System.Environment
import CANData
main :: IO ()
main = do
args <- getArgs
case args of
["-h"] -> help
["--help"] -> help
[ file ] -> do
dbc <- readFile file
let candb = m... | |
7e3981d53126876515e8a65d4cafb0b1b0893e26bf0274d82557e218029ac2ea | nobutaka/nanopass | tests-6.4-req.scm | (add-tests-with-string-output "byte string"
[(string-size (make-byte-string 0)) => "0\n"]
[(string-size (make-byte-string 1)) => "1\n"]
[(string-size (make-byte-string 1000)) => "1000\n"]
[(let ([s (make-byte-string 1)])
(string-byte-set! s 0 12)
(string-byte-ref s 0)) => "12\n"]
[(let ([s (make-byt... | null | https://raw.githubusercontent.com/nobutaka/nanopass/80e0344a1f143832a75d798be903e05b5dbdd079/tests/tests-6.4-req.scm | scheme | 0xff 0xee | (add-tests-with-string-output "byte string"
[(string-size (make-byte-string 0)) => "0\n"]
[(string-size (make-byte-string 1)) => "1\n"]
[(string-size (make-byte-string 1000)) => "1000\n"]
[(let ([s (make-byte-string 1)])
(string-byte-set! s 0 12)
(string-byte-ref s 0)) => "12\n"]
[(let ([s (make-byt... |
4756926b6f103b624e1cbfa0d334176489e31fff91f1a7f40f54f1f8e752b159 | ghcjs/jsaddle-dom | WebGLDrawBuffers.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGLDrawBuffers
(drawBuffersWEBGL, pattern COLOR_ATTACHMENT0_WEBGL,
pattern COLOR_ATTACHMENT1_WEBGL, patte... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/WebGLDrawBuffers.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGLDrawBuffers
(drawBuffersWEBGL, pattern COLOR_ATTACHMENT0_WEBGL,
pattern COLOR_ATTACHMENT1_WEBGL, pattern COLOR_ATTACHMENT2_WEBGL,
pattern COLOR_ATTACHMENT3_WEBGL, pattern COLOR_ATTACHMENT4_WEBG... |
9e2e3557320aabb25fdecd8643d5b90d7613238564cef89adafadeec943a1a1d | lkuper/rust-redex | lambda-gc.rkt | A Redex model of the lambda - gc language from , Felleisen ,
and , " Abstract Models of Memory Management "
( /~rwh/papers/gc/fpca95.pdf ) .
#lang racket
(require redex)
(define-language lambda-gc
;; Programs.
(Var variable-not-otherwise-mentioned)
(Int number)
(Exp Var Int (pair Exp_1 Exp_2) (proj1 E... | null | https://raw.githubusercontent.com/lkuper/rust-redex/53d19f89f6e569891324e4313e17b19154ebbcf3/lambda-gc.rkt | racket | Programs.
Evaluation contexts and instruction expressions.
We use append rather than cons (here and in the app rule)
to match the semantics of the paper, where new bindings
get added at the end of the heap rather than the
beginning.
conflict with bindings already in the heap.
New binding on the heap: the equiva... | A Redex model of the lambda - gc language from , Felleisen ,
and , " Abstract Models of Memory Management "
( /~rwh/papers/gc/fpca95.pdf ) .
#lang racket
(require redex)
(define-language lambda-gc
(Var variable-not-otherwise-mentioned)
(Int number)
(Exp Var Int (pair Exp_1 Exp_2) (proj1 Exp) (proj2 Exp)... |
8a582136408ae9fd716a429cfb12562400d1270ccc3c18bd51a83ade1a066688 | Clozure/ccl-tests | logical-pathname-translations.lsp | ;-*- Mode: Lisp -*-
Author :
Created : We d Dec 31 09:46:08 2003
;;;; Contains: Tests of LOGICAL-PATHNAME-TRANSLATIONS
(in-package :cl-test)
| null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/logical-pathname-translations.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of LOGICAL-PATHNAME-TRANSLATIONS | Author :
Created : We d Dec 31 09:46:08 2003
(in-package :cl-test)
|
cc0ae8662e9b65a5512fb5aa59936876a392e6bab57f691c13e0b843c979eba2 | gregtatcam/imaplet-lwt | maildir_storage.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* 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 .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/commands/maildir_storage.ml | ocaml | mailbox is in unix format i.e. foo/foo1/foo2
* will change to .foo.foo1.foo2
return full mailbox path formated for use by OS
only convert the mailbox part to the unix format
get location of a file under the mailbox
get location of a file under the mailbox
like Filename.basename
like Filename.dirname
r... |
* Copyright ( c ) 2013 - 2014 < >
*
* 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 .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
27624946515b503d90bdcb4346b54b6316e31b6247a9356571676ba2e696211b | charJe/cl-yxorp | threads.lisp | (in-package #:yxorp)
(defvar *threads*-lock (bt:make-lock))
(defvar *threads* (list))
(defun track-thread (thread)
(bt:with-lock-held (*threads*-lock)
(push (tg:make-weak-pointer thread)
*threads*)))
(defun map-threads (function)
(declare (type function function))
(bt:with-lock-held (*threads*-lo... | null | https://raw.githubusercontent.com/charJe/cl-yxorp/d2e8f9304549e47ae5c7fa35a6b114804603eac9/threads.lisp | lisp | (in-package #:yxorp)
(defvar *threads*-lock (bt:make-lock))
(defvar *threads* (list))
(defun track-thread (thread)
(bt:with-lock-held (*threads*-lock)
(push (tg:make-weak-pointer thread)
*threads*)))
(defun map-threads (function)
(declare (type function function))
(bt:with-lock-held (*threads*-lo... | |
a4df91899b6c1c88b5ba50e0557db38e16f652a7409316d8500a5cb07fc35ebb | TikhonJelvis/Simple-Prolog | Main.hs | module Main where
import Control.Monad (foldM, when)
import Control.Applicative ((<$), (<$>), (<*))
import Data.List (intercalate)
import qualified System.Environment as Env
import System.IO (hFlush, ... | null | https://raw.githubusercontent.com/TikhonJelvis/Simple-Prolog/8dc7a23e41079155f747ffcb3f666fc38b390b4d/src/Main.hs | haskell | module Main where
import Control.Monad (foldM, when)
import Control.Applicative ((<$), (<$>), (<*))
import Data.List (intercalate)
import qualified System.Environment as Env
import System.IO (hFlush, ... | |
a72af871d1eecea416f0ff73d74ba0f89d6fff74aefb8a1d519f561eadbc37de | ktakashi/sagittarius-scheme | inline.scm | part of Sagittarius Scheme
(library (core inline)
(export define-inliner ;; to add inliner into existing procedures
define-inline ;; to define inliners *and* procedures.
;; not export this for now.
;;define-raw-inliner
)
(import (core)
(core errors)
(core base)
(core synta... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/bbdd71f01e8bfe8e25998f5239eb1a3b33b02ac1/lib/core/inline.scm | scheme | to add inliner into existing procedures
to define inliners *and* procedures.
not export this for now.
define-raw-inliner
trick to get pass1 from compiler
library can be #f
$CONST = #($CONST value)
return undefined so that
compiler just compiles to
$call
must return iform
for convenience
the other one is act... | part of Sagittarius Scheme
(library (core inline)
)
(import (core)
(core errors)
(core base)
(core syntax)
(sagittarius)
(sagittarius compiler)
(sagittarius compiler procedure)
(sagittarius compiler util)
(sagittarius vm))
(define pass1 (let ((lib (find-library '(s... |
2b904192145b0da71d687d3517d8acc023594834dcfb25dbb9b3482d44835f73 | ghcjs/jsaddle-dom | MediaDevices.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.MediaDevices
(enumerateDevices, enumerateDevices_, getSupportedConstraints,
getSupportedConstraints_, getUs... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/MediaDevices.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/MediaDevices.ondevicechange Mozilla MediaDevices.ondevicechange documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.MediaDevices
(enumerateDevices, enumerateDevices_, getSupportedConstraints,
getSupportedConstraints_, getUserMedia, getUserMedia_,
devicechange, MediaDevices(..), gTypeMediaDevices)
where
imp... |
27fb98a1d8c20eaef0e29087909eb3c4f832276e9259c4c8155e3130c435558f | Chris00/ocaml-gammu | discover.ml | module C = Configurator.V1
let error_sys sys =
C.die "System %S currently not supported. Please \
contact the OCaml gammu developers." sys
let cflags_default sys =
if sys = "linux" then
["-O3"; "-fPIC"; "-DPIC"; "-I/usr/include/gammu"]
else if sys = "mingw64" then
["-O3"; "-fPIC"; "-DPIC"; "-D... | null | https://raw.githubusercontent.com/Chris00/ocaml-gammu/ad38c6aff25bda8aa6da1db5fdfe61a224b00250/config/discover.ml | ocaml | Check for debug environment variable | module C = Configurator.V1
let error_sys sys =
C.die "System %S currently not supported. Please \
contact the OCaml gammu developers." sys
let cflags_default sys =
if sys = "linux" then
["-O3"; "-fPIC"; "-DPIC"; "-I/usr/include/gammu"]
else if sys = "mingw64" then
["-O3"; "-fPIC"; "-DPIC"; "-D... |
d4b600d069a14aee3c4856e791245c226a21c7b41c15b36ec539ca711b7a9f73 | lancelet/wgpu-hs | WGPUPresentMode.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE NoImplicitPrelude #
-- This file was generated by wgpu-raw-hs-codegen on:
2021 - 08 - 25T10:02:03.522705
-- Using wgpu-native git hash:
b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu - native ( )
m... | null | https://raw.githubusercontent.com/lancelet/wgpu-hs/42d7931cdd793970bf4844906b382d908bbb196f/wgpu-raw-hs/src/WGPU/Raw/Generated/Enum/WGPUPresentMode.hs | haskell | This file was generated by wgpu-raw-hs-codegen on:
Using wgpu-native git hash: | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE NoImplicitPrelude #
2021 - 08 - 25T10:02:03.522705
b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu - native ( )
module WGPU.Raw.Generated.Enum.WGPUPresentMode where
import Data.Word (Word32)
import... |
7b0e3e690190e7d58fbfacc3fd4b412f6739c695a0e06a0fbe6c8731a2e799ca | rtoy/ansi-cl-tests | map.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Aug 17 20:54:48 2002
;;;; Contains: Tests for the MAP function
(in-package :cl-test)
(deftest map-array.1
(map 'list #'1+ #(1 2 3 4))
(2 3 4 5))
(deftest map-array.2
(map 'vector #'+ #(1 2 3 4) #(6 6 6 6))
#(7 8 9 10))
(deftest map-array.3
(map 've... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/map.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests for the MAP function
(deftest map-array.7
(map 'array #'identity '(a b c d e f))
#(a b c d e f))
(deftest map-array.8
(map 'simple-array #'identity '(a b c d e f))
#(a b c d e f))
Use a more elaborate form of the simple-array type specifier
(deftest map-string.31
... | Author :
Created : Sat Aug 17 20:54:48 2002
(in-package :cl-test)
(deftest map-array.1
(map 'list #'1+ #(1 2 3 4))
(2 3 4 5))
(deftest map-array.2
(map 'vector #'+ #(1 2 3 4) #(6 6 6 6))
#(7 8 9 10))
(deftest map-array.3
(map 'vector #'+ #(1 2 3 4 5) #(6 6 6 6))
#(7 8 9 10))
(deftest map-arr... |
ab68fd1e9b6c92d6cf37796fe76c1ea0c5a22e3881291cd33db8300ebf0cb7f3 | jonase/eastwood | utils.clj | Copyright ( c ) , Rich Hickey & contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be b... | null | https://raw.githubusercontent.com/jonase/eastwood/b6cf5e67dec600b7368db012c868103fe8a314ba/copied-deps/eastwood/copieddeps/dep1/clojure/tools/analyzer/utils.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , Rich Hickey & contributors .
(ns eastwood.copieddeps.dep1.clojure.tools.analyzer.utils
(:refer-clojure :exclude [record? boolean? update-keys update-vals])
(:require [eastwood.copieddeps.dep1.clojure.tools.analyzer.env :as env])
(:import (clojure.lang IRecord IType IObj
... |
e9b64563892dd96e3c1d8e9b5e1db405120d6ef0c323790b1f0e85d315836fdf | argp/bap | batRandom.ml |
* BatRandom - Additional randomization operations
* Copyright ( C ) 1996
* 2009 , LIFO , Universite d'Orleans
* 2009
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as pu... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batRandom.ml | ocaml | *A constructor for enumerations of random numbers.
the state we defined up above
external t_of_impl: implementation -> t = "%identity" |
* BatRandom - Additional randomization operations
* Copyright ( C ) 1996
* 2009 , LIFO , Universite d'Orleans
* 2009
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as pu... |
06584377e20bbdc418ce617792d61fa9536c7d71e92177b14aa46c8e601de542 | kitnil/dotfiles | tmux.scm | (define-module (home services tmux)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (gnu services)
#:use-module (home config)
#:export (home-tmux-service
tmuxifier-service))
(define home-tmux-service
... | null | https://raw.githubusercontent.com/kitnil/dotfiles/3083f773c5da0cdb8b715062cec7b4224515ff88/dotfiles/guixsd/modules/home/services/tmux.scm | scheme | TODO: `("web.session.sh.tmpl" ,(local-file "../../dot_tmuxifier-layouts/web.session.sh.tmpl")) | (define-module (home services tmux)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (gnu services)
#:use-module (home config)
#:export (home-tmux-service
tmuxifier-service))
(define home-tmux-service
... |
e8e280f59aa636afe8ad60602936cf9f7963eb3afef5a811ebede145e3e28f6a | ocaml/Zarith | pi.ml | Pi digits computed with the streaming algorithm given on pages 4 , 6
& 7 of " Unbounded Spigot Algorithms for the Digits of Pi " , , August 2004 .
& 7 of "Unbounded Spigot Algorithms for the Digits of Pi", Jeremy
Gibbons, August 2004. *)
open Printf
let zero = Z.zero
and one = Z.one
and three = Z.of_i... | null | https://raw.githubusercontent.com/ocaml/Zarith/39df015463f2797256dfb12440ed8f6c2dfd59cc/tests/pi.ml | ocaml | Pi digits computed with the streaming algorithm given on pages 4 , 6
& 7 of " Unbounded Spigot Algorithms for the Digits of Pi " , , August 2004 .
& 7 of "Unbounded Spigot Algorithms for the Digits of Pi", Jeremy
Gibbons, August 2004. *)
open Printf
let zero = Z.zero
and one = Z.one
and three = Z.of_i... | |
5f549f837517c66edb9aa099758d6ac7d22d68c735b91b88ada1699ba5dd301d | dmitryvk/sbcl-win32-threads | hash.impure.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This software is in the public domain and is provided with
;;;;... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/tests/hash.impure.lisp | lisp | more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
space of possible values, so that collisions between the hash
values of unequal objects sho... | This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(in-package :cl-user)
(use-package :test-util)
(use-package :assertoid)
(defstruct foo)
(defstruct bar x y)
SXHASH and PSXHASH should distribute hash values well o... |
3931ccd674e8577767c38dacb51ba607bb36fcb34f81b8b344d4bf3b9422ff79 | graninas/Hydra | Language.hs | module Hydra.Core.ControlFlow.Language where
import Hydra.Prelude
import Hydra.Core.ControlFlow.Class
data ControlFlowF next where
-- | Freeze the current thread on time (in microseconds).
Delay :: Int -> (() -> next) -> ControlFlowF next
instance Functor ControlFlowF where
fmap g (Delay... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-free/src/Hydra/Core/ControlFlow/Language.hs | haskell | | Freeze the current thread on time (in microseconds). | module Hydra.Core.ControlFlow.Language where
import Hydra.Prelude
import Hydra.Core.ControlFlow.Class
data ControlFlowF next where
Delay :: Int -> (() -> next) -> ControlFlowF next
instance Functor ControlFlowF where
fmap g (Delay i next) = Delay i (g . next)
type ControlFlowL = Free Cont... |
aba5034122895e5d66388a1cbe555505f89157ce307a0c850186c76edb023d33 | c089/haskell-craft3e | Base.hs | -------------------------------------------------------------------------
--
Haskell : The Craft of Functional Programming , 3e
( c ) Addison - Wesley , 1996 - 2011 .
--
-- The basis of the simulation package.
--
-------------------------------------------------------------------------
module Base where
... | null | https://raw.githubusercontent.com/c089/haskell-craft3e/869e382601cab50559c4473dfa9c7480f1acba58/Simulation/Base.hs | haskell | -----------------------------------------------------------------------
The basis of the simulation package.
-----------------------------------------------------------------------
The type of input messages.
The type of output messages. | Haskell : The Craft of Functional Programming , 3e
( c ) Addison - Wesley , 1996 - 2011 .
module Base where
data Inmess = No | Yes Arrival Service
deriving (Eq,Show)
type Arrival = Int
type Service = Int
data Outmess = None | Discharge Arrival Wait Service
deriving (Eq,Show)
type Wait ... |
89783c66f43db0b343bb37d854f5a0961a19a082975f47622429ff59e47057ea | HaskellZhangSong/Introduction_to_Haskell_2ed_source | TypeFamily3.hs | # LANGUAGE TypeFamilies #
import Data.Vector
import Data.Sequence
data family Array a
data instance Array Int = MkArrayInt (Vector Int)
data instance Array Char = MkArrayChar (Seq Char) | null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C16/TypeFamily3.hs | haskell | # LANGUAGE TypeFamilies #
import Data.Vector
import Data.Sequence
data family Array a
data instance Array Int = MkArrayInt (Vector Int)
data instance Array Char = MkArrayChar (Seq Char) | |
36a2e5f243214371dfc963fcb3977644056015db0d27c334a82fdd9a983ea2e1 | alexanderwasey/stupid-computer | Sumif.hs | module Sumif where
sum' :: Num a => [a] -> a
sum' xs = if (not (null xs)) then (head xs) + sum' (tail xs) else 0
demo = sum' [1,2,3] | null | https://raw.githubusercontent.com/alexanderwasey/stupid-computer/a485d2f33a4b8d58128a74b9003b9eadffe42702/examples/Sumif.hs | haskell | module Sumif where
sum' :: Num a => [a] -> a
sum' xs = if (not (null xs)) then (head xs) + sum' (tail xs) else 0
demo = sum' [1,2,3] | |
76d79fb9a0f456d6199ec33547ccc87914c61d4a30e6c2dc7bd3bef88ef66282 | awslabs/s2n-bignum | bignum_deamont_p521.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/bignum_deamont_p521.ml | ocaml | =========================================================================
Mapping out of almost-Montgomery representation modulo p_521.
=========================================================================
PUSH (% rbx)
PUSH (% r12)
PUSH (% r13)
PUSH (% rbp)
ADC (% rcx) (Imm8 (word 0))
A... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
* * * print_literal_from_elf " x86 / p521 / " ; ;
* * *
****)
... |
7aec1fe36685557e7caddc4e8816b2d8eb2992d37b5c0be9b98cc2a28f42f14c | apache/couchdb-couch-replicator | couch_replicator_large_atts_tests.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/apache/couchdb-couch-replicator/d00b981445c03622497088eb872059ab4f48b298/test/couch_replicator_large_atts_tests.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(couch_replicator_large_atts_tests).
-include_lib("couch/include/couch_eunit.hrl").
-include_lib("couch/include/couch_db.hrl").
-import(couch_repli... |
c38b41112a69cd40dbccebaa7821bc27cb5be89733d9137af908071791832012 | skanev/playground | 33-tests.scm | (require rackunit rackunit/text-ui)
(load "../33.scm")
(define sicp-1.33-tests
(test-suite
"Tests for SICP exercise 1.33"
(check-equal? (sum-of-prime-squares 2 10) 87)
(check-equal? (sum-of-prime-squares 10 15) 290)
(check-equal? (product-of-relative-primes-to 10) 189)
(check-equal? (product-of... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/tests/33-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load "../33.scm")
(define sicp-1.33-tests
(test-suite
"Tests for SICP exercise 1.33"
(check-equal? (sum-of-prime-squares 2 10) 87)
(check-equal? (sum-of-prime-squares 10 15) 290)
(check-equal? (product-of-relative-primes-to 10) 189)
(check-equal? (product-of... | |
14db958396e817642cf2b041c6bdf42b273f4bef845defaba75f1f9d9a412ed1 | pfdietz/ansi-test | random-type-prop-tests-02.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Mar 6 20:37:57 2005
Contains : Tests that invoke the random type prop infrastructure , part 2
(in-package :cl-test)
(def-type-prop-test =.1 '= '(number number) 2)
(def-type-prop-test =.2 '= '(number number number) 3)
(def-type-prop-test =.3 '= nil 4 :maxar... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/random/random-type-prop-tests-02.lsp | lisp | -*- Mode: Lisp -*- | Author :
Created : Sun Mar 6 20:37:57 2005
Contains : Tests that invoke the random type prop infrastructure , part 2
(in-package :cl-test)
(def-type-prop-test =.1 '= '(number number) 2)
(def-type-prop-test =.2 '= '(number number number) 3)
(def-type-prop-test =.3 '= nil 4 :maxargs 10 :rest-type 'number... |
1d8972508b1c19bef142a12d0fb7841246fec31caeec07ba8ce082eed03f4312 | FranklinChen/hugs98-plus-Sep2006 | ForeignPtr.hs | # OPTIONS_GHC -fno - implicit - prelude #
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.ForeignPtr
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
Maintainer :
-- Stability... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/base/Foreign/ForeignPtr.hs | haskell | ---------------------------------------------------------------------------
|
Module : Foreign.ForeignPtr
License : BSD-style (see the file libraries/base/LICENSE)
Stability : provisional
Portability : portable
The 'ForeignPtr' type and operations. This module is part of the
the "Foreign" modu... | # OPTIONS_GHC -fno - implicit - prelude #
Copyright : ( c ) The University of Glasgow 2001
Maintainer :
Foreign Function Interface ( FFI ) and will usually be imported via
module Foreign.ForeignPtr
(
ForeignPtr
, FinalizerPtr
#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
, Finaliz... |
6ed1e57243e7d01167bfe69de5a9bc427f7c29b1aa78713fe1da7e760eae55b5 | aeolus-project/zephyrus | json_v0_j.mli | (* Auto-generated from "json_v0.atd" *)
(** Type definitions for naming. *)
type component_type_name = Json_v0_t.component_type_name
type port_name = Json_v0_t.port_name
type component_name = Json_v0_t.component_name
type package_name = Json_v0_t.package_name
type repository_name = Json_v0_t.repository_name
typ... | null | https://raw.githubusercontent.com/aeolus-project/zephyrus/0b52de4038bbab724e6a9628430165a7f09f77ae/src/atd/json_v0_j.mli | ocaml | Auto-generated from "json_v0.atd"
* Type definitions for naming.
* Type definitions for Component Type.
atd conflict
atd conflict
* Type definitions for Configuration.
atd implementation
atd repositories
atd provide_resources
atd packages_installed
atd cost
atd requirer
atd provider
atd locations
atd bin... |
type component_type_name = Json_v0_t.component_type_name
type port_name = Json_v0_t.port_name
type component_name = Json_v0_t.component_name
type package_name = Json_v0_t.package_name
type repository_name = Json_v0_t.repository_name
type location_name = Json_v0_t.location_name
type resource_name = Json_v0_t.re... |
f1409cace3e21eb881750e8053c1b8208259bfdd78438ac9cdc47ccb4ef20ebd | mitchellwrosen/planet-mitchell | Benchmark.hs | module Benchmark
( -- * Running benchmarks
defaultMain
-- * Constructing benchmarks
-- ** Benchmark
, Benchmark
, bench
, bgroup
, env
, envWithCleanup
-- ** Benchmarkable
, Benchmarkable
, nfIO
, whnfIO
, nf
, whnf
, perBatchEnv
, perBatchEnvWithCleanup
, perRunEnv
, perRu... | null | https://raw.githubusercontent.com/mitchellwrosen/planet-mitchell/18dd83204e70fffcd23fe12dd3a80f70b7fa409b/planet-mitchell-test/src/Benchmark.hs | haskell | * Running benchmarks
* Constructing benchmarks
** Benchmark
** Benchmarkable | module Benchmark
defaultMain
, Benchmark
, bench
, bgroup
, env
, envWithCleanup
, Benchmarkable
, nfIO
, whnfIO
, nf
, whnf
, perBatchEnv
, perBatchEnvWithCleanup
, perRunEnv
, perRunEnvWithCleanup
) where
import Gauge
|
27b9a72fc06e8b763f885ab4bb518fe95a6bdf4efc2a995ec6ffe1649ee3c73b | matterhorn-chat/matterhorn | test_messages.hs | {-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
module Main where
import Control.Exception
import Data.Function (on)
import Data.List (sortBy)
import qualified Data.List.UniqueUnsorted as U
import qualified Data.Map as Map
import Data.Maybe (fromJust)
impor... | null | https://raw.githubusercontent.com/matterhorn-chat/matterhorn/19a73ce833a8a8de3616cf884c03e9f08a4db0a7/test/test_messages.hs | haskell | # LANGUAGE TypeSynonymInstances #
note that mappend is literal: there is
no date relationship between the
members l1 and l2 and mappend doesn't
enforce one.
for useful info on failure:
for useful info on failure:
for useful info on failure:
for useful info on failure:
for useful info on failure:
for useful in... | # LANGUAGE FlexibleInstances #
module Main where
import Control.Exception
import Data.Function (on)
import Data.List (sortBy)
import qualified Data.List.UniqueUnsorted as U
import qualified Data.Map as Map
import Data.Maybe (fromJust)
import qualified Data.Sequence as Seq
impor... |
5da334b1fe3e5bca71ae40537424475434911f9597fb24833ba9179c905020da | mneedham/ranking-algorithms | ranking.clj | (ns ranking-algorithms.ranking
(:require [clojure.math.numeric-tower :as math]))
(defn initial-rankings [teams]
(apply array-map (mapcat (fn [x] [x {:points 1200.00}]) teams)))
(defn expected [my-ranking opponent-ranking]
(/ 1.0
(+ 1
(math/expt 10 (/ (- opponent-ranking my-ranking) 400)))))
(defn ... | null | https://raw.githubusercontent.com/mneedham/ranking-algorithms/30d300170f60f24663c3d377ce68565427a42cb4/src/ranking_algorithms/ranking.clj | clojure | (ns ranking-algorithms.ranking
(:require [clojure.math.numeric-tower :as math]))
(defn initial-rankings [teams]
(apply array-map (mapcat (fn [x] [x {:points 1200.00}]) teams)))
(defn expected [my-ranking opponent-ranking]
(/ 1.0
(+ 1
(math/expt 10 (/ (- opponent-ranking my-ranking) 400)))))
(defn ... | |
7dd291687cf026ab4afb51971dfb3992774f1e3fa22f092bfae63467177dc717 | hipsleek/hipsleek | ccl.mli |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions of source code mu... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/cil/src/ext/ccl.mli | ocaml |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions of source code mu... | |
ec4b5d1ea108b1a9a505c1bad01c380ff066da004973f55c992baf3ef5d41a33 | quernd/tea-chess | Nag.ml | exception Nag_error of string
type t = int
let pgn_of_nag = fun nag ->
Printf.sprintf "$%i" nag
let nag_of_string = function
| "!" -> 1
| "?" -> 2
| "!!" -> 3
| "??" -> 4
| "!?" -> 5
| "?!" -> 6
| a -> raise (Nag_error a)
let string_of_nag = function
| 0 -> ""
| 1 -> "!"
| 2 -> "?"
| 3 -> "!... | null | https://raw.githubusercontent.com/quernd/tea-chess/7dc929f406eeada5a72117b1c748fa0edda4c48c/src/Nag.ml | ocaml | alternative: {js|\u203c|js}
alternative: {js|\u2047|js}
alternative: {js|\u2049|js}
forced move
unclear position
White has a slight advantage
Black has a slight advantage
White has a moderate advantage
Black has a moderate advantage
White has a decisive advantage
Black has a decisive advantage
zu... | exception Nag_error of string
type t = int
let pgn_of_nag = fun nag ->
Printf.sprintf "$%i" nag
let nag_of_string = function
| "!" -> 1
| "?" -> 2
| "!!" -> 3
| "??" -> 4
| "!?" -> 5
| "?!" -> 6
| a -> raise (Nag_error a)
let string_of_nag = function
| 0 -> ""
| 1 -> "!"
| 2 -> "?"
alternati... |
8fbe97404ebf9f27d334c7c077c4dd6f22bf25d97e7b9ce70d47552cb180a60a | codereport/SICP-2020 | conor_hoekstra_solutions.rkt | Exercise 3.12 ( page 345 - 6 )
Response from ) after append
'(b)
Response from ) after append !
'(b c d) ; equivalent of passing something by reference and then modifying
Exercise 3.14 ( page 347 )
;; mystery reverses a list
Exercise 3.16 ( 350 - 1 )
- > 3
(define x (cons 1 '()))
(define y (con... | null | https://raw.githubusercontent.com/codereport/SICP-2020/2d1e60048db89678830d93fcc558a846b7f57b76/Chapter%203.3%20Solutions/conor_hoekstra_solutions.rkt | racket | equivalent of passing something by reference and then modifying
mystery reverses a list
for box and pointer diagrams, see conor_hoekstra_solutions.md
Racket and Scheme do n't have it )
((a) a)
((a b) b)
((a b c) c)
((b c) c)
((c) c)
front-ptr essentially grows as a list to represent the queue, back-ptr is
just fo... | Exercise 3.12 ( page 345 - 6 )
Response from ) after append
'(b)
Response from ) after append !
Exercise 3.14 ( page 347 )
Exercise 3.16 ( 350 - 1 )
- > 3
(define x (cons 1 '()))
(define y (cons x x))
(define z (cons y '()))
- > 4
(define x (cons 1 '()))
(define y (cons x x))
(define z (cons... |
698ebd35bc428f7366722acd368987121d81dee0c625afbae753bddddf8675a1 | richhickey/clojure-contrib | test_util.clj | Copyright ( c ) . All rights reserved . The use and
;; distribution terms for this software are covered by the Eclipse Public
;; License 1.0 (-1.0.php) which can
;; be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by t... | null | https://raw.githubusercontent.com/richhickey/clojure-contrib/40b960bba41ba02811ef0e2c632d721eb199649f/src/test/clojure/clojure/contrib/datalog/tests/test_util.clj | clojure | distribution terms for this software are covered by the Eclipse Public
License 1.0 (-1.0.php) which can
be found in the file epl-v10.html at the root of this distribution. By
using this software in any fashion, you are agreeing to be bound by the
terms of this license. You must not remove this notice, or an... | Copyright ( c ) . All rights reserved . The use and
A Clojure implementation of Datalog -- Utilities Tests
straszheimjeffrey ( gmail )
Created 11 Feburary 2009
(ns clojure.contrib.datalog.tests.test-util
(:use clojure.test
clojure.contrib.datalog.util)
(:use [clojure.contrib.except :only (throwf)]... |
dd0f0efc1a8ad3e092a77e646e69d9c96fbc5b83ea8562fd8bb9aa190f90191e | triclops200/quickapp | argument-parsing.lisp | (in-package :quickapp)
(defmacro loop-rec (bindings &body body)
"Similar to the clojure loop macro"
(let ((names (mapcar #'car bindings))
(init-vals (mapcar #'cadr bindings)))
`(labels ((rec ,names
,@body))
(rec ,@init-vals))))
(defun reduce-full (f &rest args)
"A reducer that... | null | https://raw.githubusercontent.com/triclops200/quickapp/20e004d90b971201cb7df3020a05ccebc38763eb/argument-parsing.lisp | lisp | If we have hit the end
Write the rest of the string
to the stream
There is nothing to seperate, return
We have found the seperator
Return the rest of the
We need to keep going
Copy the current char to the
stream
Iterate to the next string
keep track of the unnamed and named args
let l be the next argument
... | (in-package :quickapp)
(defmacro loop-rec (bindings &body body)
"Similar to the clojure loop macro"
(let ((names (mapcar #'car bindings))
(init-vals (mapcar #'cadr bindings)))
`(labels ((rec ,names
,@body))
(rec ,@init-vals))))
(defun reduce-full (f &rest args)
"A reducer that... |
500c881183abde3155e1432279fd245a0a3350ef91b9048d415a29575006819a | clash-lang/clash-prelude | File.hs | |
Copyright : ( C ) 2015 - 2016 , University of Twente ,
2017 , Myrtle Software Ltd , Google Inc.
License : BSD2 ( see the file LICENSE )
Maintainer : < >
= Initialising a BlockRAM with a data file # usingramfiles #
BlockRAM primitives that can be initialised with a d... | null | https://raw.githubusercontent.com/clash-lang/clash-prelude/5645d8417ab495696cf4e0293796133c7fe2a9a7/src/Clash/Prelude/BlockRam/File.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# OPTIONS_HADDOCK show-extensions #
* BlockRAM synchronised to an arbitrary clock
* __NB__: Initial output value is 'undefined'
* __NB__: This function might not work for specific comb... | |
Copyright : ( C ) 2015 - 2016 , University of Twente ,
2017 , Myrtle Software Ltd , Google Inc.
License : BSD2 ( see the file LICENSE )
Maintainer : < >
= Initialising a BlockRAM with a data file # usingramfiles #
BlockRAM primitives that can be initialised with a d... |
297def51ca116198cf614ef1a0c586b9f411c5368013ccbde5ede0d7d801ffff | tgass/macbeth | ChatRegistry.hs | module Macbeth.Wx.ChatRegistry (
wxChatRegistry
) where
import Control.Concurrent.Chan
import Control.Monad
import Macbeth.Fics.Message
import Macbeth.Fics.Api.Api
import Macbeth.Fics.Api.Player
import Macbeth.Wx.Chat
import Macbeth.Wx.RuntimeEnv ... | null | https://raw.githubusercontent.com/tgass/macbeth/c64b3cc9b641444688b14a2838ee554932f0e9e6/macbeth-wx/src/Macbeth/Wx/ChatRegistry.hs | haskell | module Macbeth.Wx.ChatRegistry (
wxChatRegistry
) where
import Control.Concurrent.Chan
import Control.Monad
import Macbeth.Fics.Message
import Macbeth.Fics.Api.Api
import Macbeth.Fics.Api.Player
import Macbeth.Wx.Chat
import Macbeth.Wx.RuntimeEnv ... | |
52dc9d5082aafdb2a936c1b3aafab6b47f4be65d0f870d421db8fc941abd9b9b | dselsam/arc | Goal.hs | Copyright ( c ) 2020 Microsoft Corporation . All rights reserved .
Released under Apache 2.0 license as described in the file LICENSE .
Authors : , , .
{-# LANGUAGE StrictData #-}
module Solver.Tactics.Blast.Goal where
import Util.Imports
import Data.List hiding (partition)
import qualified Data.Map as Ma... | null | https://raw.githubusercontent.com/dselsam/arc/7e68a7ed9508bf26926b0f68336db05505f4e765/src/Solver/Tactics/Blast/Goal.hs | haskell | # LANGUAGE StrictData # | Copyright ( c ) 2020 Microsoft Corporation . All rights reserved .
Released under Apache 2.0 license as described in the file LICENSE .
Authors : , , .
module Solver.Tactics.Blast.Goal where
import Util.Imports
import Data.List hiding (partition)
import qualified Data.Map as Map
import Synth1.Basic
import... |
2602afda14f3d2b3657cac9841533899a6379d05e861bfdc2cbf266041d85442 | comby-tools/comby | patdiff_core_intf.ml | open! Core_kernel
open! Import
module type S = sig
* [ diff ~context ~keep_ws ~prev ~next ] uses [ Patience_diff . String ] to get a list of
hunks describing the comparison between [ prev ] and [ next ] .
hunks describing the comparison between [prev] and [next]. *)
val diff
: context:int
-> l... | null | https://raw.githubusercontent.com/comby-tools/comby/fa71ea540855ba5bd48d948dd8c8ff034714348d/lib/app/vendored/patdiff/kernel/src/patdiff_core_intf.ml | ocaml | * [refine hunks] maps each [Range.Replace (prev, next)] in [hunks] to a diff of [prev]
against [next].
* Print a hunk list, usually from [diff] or [refine]
* Output a hunk list, usually from [diff] or [refine], to a string
* Iter along the lines of the diff and the breaks between hunks. Offers more flexibility... | open! Core_kernel
open! Import
module type S = sig
* [ diff ~context ~keep_ws ~prev ~next ] uses [ Patience_diff . String ] to get a list of
hunks describing the comparison between [ prev ] and [ next ] .
hunks describing the comparison between [prev] and [next]. *)
val diff
: context:int
-> l... |
7252b3ba7e13c2a44cd825224249ad832327f37e8fa59e29b7c65928af5aa2e2 | number571/Haskell | calculator.hs | module Main where
foldl' :: (a -> b -> a) -> a -> [b] -> a
foldl' _ x [] = x
foldl' f x (y:ys) = foldl' f (f x y) ys
head' :: [a] -> a
head' [] = undefined
head' (x:xs) = x
drop' :: Int -> [a] -> [a]
drop' _ [] = []
drop' x (y:ys)
| x /= 0 = drop' (x-1) ys
| otherwise = y:ys
length' :: [a] -> Int
length' []... | null | https://raw.githubusercontent.com/number571/Haskell/7da2676c2604706d43791dc89c0ca8c9842aea48/Templates/calculator.hs | haskell | module Main where
foldl' :: (a -> b -> a) -> a -> [b] -> a
foldl' _ x [] = x
foldl' f x (y:ys) = foldl' f (f x y) ys
head' :: [a] -> a
head' [] = undefined
head' (x:xs) = x
drop' :: Int -> [a] -> [a]
drop' _ [] = []
drop' x (y:ys)
| x /= 0 = drop' (x-1) ys
| otherwise = y:ys
length' :: [a] -> Int
length' []... | |
838702b237e9ae564da1e586ff922ab1b880bb8054145096c5804e4d4b01e6d2 | ijvcms/chuanqi_dev | mmake.erl | %% 多进程编译,修改自otp/lib/tools/src/make.erl
解析Emakefile , 根据获取{mods , options}列表 ,
%% 按照次序编译每项(解决编译顺序的问题)
其中mods也可以包含多个模块 , 当大于1个时 ,
可以启动多个process进行编译 , 从而提高编译速度 .
-module(mmake).
-export([all/1, all/2, files/2, files/3]).
-include_lib("kernel/include/file.hrl").
-define(MakeOpts, [noexec, load, netload, noload]).
... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/tool/misc/mmake.erl | erlang | 多进程编译,修改自otp/lib/tools/src/make.erl
按照次序编译每项(解决编译顺序的问题)
Mods is a list of module names (strings)
Mod.
Mod is a module name which might include '*' as wildcard
or a list of such module names
directory and the options given at command line
options given for the modules.
Any flags that are not recognixed as mak... | 解析Emakefile , 根据获取{mods , options}列表 ,
其中mods也可以包含多个模块 , 当大于1个时 ,
可以启动多个process进行编译 , 从而提高编译速度 .
-module(mmake).
-export([all/1, all/2, files/2, files/3]).
-include_lib("kernel/include/file.hrl").
-define(MakeOpts, [noexec, load, netload, noload]).
all(Worker) when is_integer(Worker) ->
all(Worker, []).
a... |
2c398c99233c1b2658b35ae5b46ebb5d60775f49b81fd34de3a9129750551355 | larcenists/larceny | quicksort.scm | This is probably from MS thesis .
The quick-1 benchmark . ( Figure 35 , page 132 . )
(import (scheme base)
(scheme read)
(scheme write)
(scheme time))
(define (quick-1 v less?)
(define (helper left right)
(if (< left right)
(let ((median (partition v left right less?)... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Benchmarking/R7RS/src/quicksort.scm | scheme | he added a specific random number generator taken from an
extremely slow, causing the Gambit version of this benchmark
to spend nearly all of its time generating the random numbers.
For a benchmark called quicksort to become a bignum benchmark
The following random number generator is much better and
faster than ... | This is probably from MS thesis .
The quick-1 benchmark . ( Figure 35 , page 132 . )
(import (scheme base)
(scheme read)
(scheme write)
(scheme time))
(define (quick-1 v less?)
(define (helper left right)
(if (< left right)
(let ((median (partition v left right less?)... |
c772990b1d133cff695ffb40f63b18a067f73611b21cd5fa4708350c86655556 | pascal-knodel/haskell-craft | E'12'26.hs | --
--
--
------------------
Exercise 12.26 .
------------------
--
--
--
module E'12'26 where
| null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'12'26.hs | haskell |
----------------
----------------
| Exercise 12.26 .
module E'12'26 where
|
4fe77bc9c54501dcd30e2b69251e6ee20c3250051a37a03735b83078b2de8b65 | flipstone/orville | Delete.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Orville.PostgreSQL.Internal.Expr.Delete
( DeleteExpr,
deleteExpr,
)
where
import Data.Maybe (catMaybes)
import Orville.PostgreSQL.Internal.Expr.Name (Qualified, TableName)
import Orville.PostgreSQL.Internal.Expr.ReturningExpr (ReturningExpr)
import Orville.Postg... | null | https://raw.githubusercontent.com/flipstone/orville/a018288c5d3fe8c567b156b980d9f8aab2d06b28/orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/Expr/Delete.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
module Orville.PostgreSQL.Internal.Expr.Delete
( DeleteExpr,
deleteExpr,
)
where
import Data.Maybe (catMaybes)
import Orville.PostgreSQL.Internal.Expr.Name (Qualified, TableName)
import Orville.PostgreSQL.Internal.Expr.ReturningExpr (ReturningExpr)
import Orville.Postg... | |
e45734b1c31687be0fb9934cf5708db86be8f0b660b38bcbbbdb166aa76cc0ab | chaw/r7rs-libs | json-test.sps | ;; Some test cases for the (rebottled json) library testing read/write of JSON format
;; -- this needs some more tests
(import (scheme base)
(rebottled json)
(srfi 64))
(define (test-write val res)
(test-equal res
(parameterize ((current-output-port (open-output-string)))
... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/rebottled-tests/json-test.sps | scheme | Some test cases for the (rebottled json) library testing read/write of JSON format
-- this needs some more tests
Scheme value -> JSON string |
(import (scheme base)
(rebottled json)
(srfi 64))
(define (test-write val res)
(test-equal res
(parameterize ((current-output-port (open-output-string)))
(json-write val)
(get-output-string (current-output-port)))))
(define (test... |
d5192c8b63d3ab1733dee4324d995de4a474c4a34c7aa63508f54a3dc6513f6c | AccelerateHS/accelerate-examples | Util.hs | -- |
-- Module: : Data.Array.Accelerate.Examples.Internal.Util
Copyright : [ 2014 .. 2020 ]
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
Portability : non - portable ( GHC extensions )
--
module Data.Array.Accelerate.Examples.Internal.Util
where
import Numeric... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/lib/Data/Array/Accelerate/Examples/Internal/Util.hs | haskell | |
Module: : Data.Array.Accelerate.Examples.Internal.Util
License : BSD3
Stability : experimental
| Show a floating point number in scientific notation with a specific base.
| Copyright : [ 2014 .. 2020 ]
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.Examples.Internal.Util
where
import Numeric
import Data.List
import Data.Array.Accelerate as A ( Z(..), Elt, Scalar, fromList )
import Prelud... |
ebabf4a19ef1ee22819481e01934ad7a189380196d133bf121d6dd0bdd23fecd | wavewave/hoodle | Attoparsec.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - unused - do - bind #
module Text.Hoodlet.Parse.Attoparsec where
import Control.Applicative ((<|>))
import Data.Attoparsec.ByteString.Char8
( Parser,
char,
string,
try,
(<?>),
)
import qualified Data.ByteString.Char8 as B
import qualifi... | null | https://raw.githubusercontent.com/wavewave/hoodle/fa7481d14a53733b2f6ae9debc95357d904a943c/parser/src/Text/Hoodlet/Parse/Attoparsec.hs | haskell | # LANGUAGE OverloadedStrings #
| | # OPTIONS_GHC -fno - warn - unused - do - bind #
module Text.Hoodlet.Parse.Attoparsec where
import Control.Applicative ((<|>))
import Data.Attoparsec.ByteString.Char8
( Parser,
char,
string,
try,
(<?>),
)
import qualified Data.ByteString.Char8 as B
import qualified Data.Hoodle.Simple as H
import T... |
70d424674a7bc2fc176bf9efbad554da6e429c2af9f7fb0a50edbf7bfa68693a | mbutterick/beautiful-racket | test.rkt | #lang tacogram-demo
##$%#$%#$#$#$$##$%#$%#$#$#$$##$%#$#$#$%#$$##$#$#$%#$%%$#%#$%#$#$%%$##$#$%%#$%%$##$#$%%#$%%$#%%%%#$%%$##$#$#$#$#$%#$$#%%%#$%%%$#%%%%#$%%$##$%#$#$%%%$##$#$%%#$%%$##$#$%#$#$%%$##$%#$#$#$%#$$##$%#$%#$#$#$$##$#$#$%#$%#$$#%%#$%#$%#$$##$#$#$#$#$%#$$#%#$#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$##$%#$%#$%#$$##$... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/tacogram-demo/test.rkt | racket | #lang tacogram-demo
##$%#$%#$#$#$$##$%#$%#$#$#$$##$%#$#$#$%#$$##$#$#$%#$%%$#%#$%#$#$%%$##$#$%%#$%%$##$#$%%#$%%$#%%%%#$%%$##$#$#$#$#$%#$$#%%%#$%%%$#%%%%#$%%$##$%#$#$%%%$##$#$%%#$%%$##$#$%#$#$%%$##$%#$#$#$%#$$##$%#$%#$#$#$$##$#$#$%#$%#$$#%%#$%#$%#$$##$#$#$#$#$%#$$#%#$#$#$%%#$$##$#$#$#$#$%#$$##$#$#$%#$%#$$##$%#$%#$%#$$##$... | |
9e05debdd34efd3176321d09cfec13b8b4e374116b5361c970dece7a9f109182 | shirok/Gauche | serializer.scm | SXML serializer into XML and HTML
;
; Partial conformance with
; [1] XSLT 2.0 and XQuery 1.0 Serialization
W3C Candidate Recommendation 3 November 2005
; -xslt-xquery-serialization-20051103/
;
; This software is in Public Domain.
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
;
; Please send bug report... | null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/ext/sxml/src/serializer.scm | scheme |
Partial conformance with
[1] XSLT 2.0 and XQuery 1.0 Serialization
-xslt-xquery-serialization-20051103/
This software is in Public Domain.
Please send bug reports and comments to:
Dmitry Lizorkin
short for "serialization"
Requires: function `filter' from SRFI-1
syntax `cond-expand' from SRFI... | SXML serializer into XML and HTML
W3C Candidate Recommendation 3 November 2005
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
Prefix for global identifiers in this module is ` srl : '
In particular , for PLT , ` filter ' can be acquired as follows :
( srl : map - append func lst ) = ( apply a... |
66eff8cab48cd30364964a9aabcf064aa2b824c35276958d96d8a18858ccb711 | yrashk/erlang | ex_radioBox.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public Lic... | null | https://raw.githubusercontent.com/yrashk/erlang/e1282325ed75e52a98d58f5bd9fb0fa27896173f/lib/wx/examples/demo/ex_radioBox.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(ex_radioBox).
-behavoiur(wx_object).
-e... |
9d1343936351c88907f6fa36caab9de62e543c98618d244cc1f0f6f4adb52a77 | gar1t/erlang-czmq | czmq_poller.erl | %% ===================================================================
@author < >
2014
%%
%% @doc Polling process for socket messages.
%%
As is implemented as an external port , it uses all .
%% non blocking operations. Message devliery must be performed by
%% routinely polling a socket.
%%
%% @end
%% =... | null | https://raw.githubusercontent.com/gar1t/erlang-czmq/530c976ee4d0892294ac0468e366ad65c70e6a50/src/czmq_poller.erl | erlang | ===================================================================
@doc Polling process for socket messages.
non blocking operations. Message devliery must be performed by
routinely polling a socket.
@end
===================================================================
=====================================... | @author < >
2014
As is implemented as an external port , it uses all .
-module(czmq_poller).
-behavior(gen_server).
-export([start/2, start_link/2, stop/1]).
-export([init/1, handle_info/2, handle_cast/2, handle_call/3,
terminate/2, code_change/3]).
-record(state, {socket, dispatch, interva... |
74e71b2f8b3d835140eef511e85be8b20e3a1e38b1d9e1663478d8b333ae4018 | purcell/adventofcode2016 | Day12.hs | module Main where
import AdventOfCode
import Control.Monad.State
import Control.Monad.Reader
import Data.Maybe (fromMaybe)
import Data.Map (Map)
import qualified Data.Map as M
data Reg =
Reg Char
deriving (Show)
data Value
= LitVal Int
| RegVal Reg
deriving (Show)
data Instr
= Copy Value
Reg
... | null | https://raw.githubusercontent.com/purcell/adventofcode2016/081f30de4ea6b939e6c3736d83836f4dd72ab9a2/src/Day12.hs | haskell | module Main where
import AdventOfCode
import Control.Monad.State
import Control.Monad.Reader
import Data.Maybe (fromMaybe)
import Data.Map (Map)
import qualified Data.Map as M
data Reg =
Reg Char
deriving (Show)
data Value
= LitVal Int
| RegVal Reg
deriving (Show)
data Instr
= Copy Value
Reg
... | |
6c13030452ec793e901b9fa0ef5b216f59476db0f8c3288677a735428566f04d | danx0r/festival | ogi_span_mx_phrasing.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<--CSLU-->;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
Center for Spoken Language Understanding ; ;
Oregon Graduate Institute of Science & Technology ; ;
... | null | https://raw.githubusercontent.com/danx0r/festival/6701715566aee6519a8b7949b567f2fdad1e2772/lib/ogi/ogi_spanish/ogi_span_mx_phrasing.scm | scheme | <--CSLU-->;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;
;
;
;
;;
;
release of the Festival TTS system. ;;
... |
(set! span_mx_phrase_cart_tree
'
((R:Token.parent.punc in ("?" "." ":"))
((B))
((B))
((R:Token.parent.n.name in ("y"))
((B))
((B))
((NB))
)
)
)
)
)
(provide 'cslu_span_mx_phrasing)
|
0243bcf12008e9e954c03d8bc7593797791921746d25738f8b534835645b8bf8 | janestreet/krb | server_key_source.mli | open! Core
open! Async
* Kerberos clients send encrypted tickets for servers . One of the central underpinning
of Kerberos is that only the KDC and the target server know this secret encryption
key .
A [ Server_key_source.t ] represents which key is used to encrypt service tickets . The
[ Keyt... | null | https://raw.githubusercontent.com/janestreet/krb/1105ba1e8b836f80f09e663bc1b4233cf2607e7b/src/server_key_source.mli | ocaml | open! Core
open! Async
* Kerberos clients send encrypted tickets for servers . One of the central underpinning
of Kerberos is that only the KDC and the target server know this secret encryption
key .
A [ Server_key_source.t ] represents which key is used to encrypt service tickets . The
[ Keyt... | |
870a38fc29f113db67edb3b03c0ee73365644ea42be04f102960bfda2fe3ae5c | ekmett/hyphenation | Pattern.hs | # LANGUAGE CPP #
-----------------------------------------------------------------------------
-- |
-- Module : Text.Hyphenation.Pattern
Copyright : ( C ) 2012 - 2019
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : provisional
-- Portability : portable
... | null | https://raw.githubusercontent.com/ekmett/hyphenation/7fc0923f613fca64e3a294ec19f1db46d42c56bc/src/Text/Hyphenation/Pattern.hs | haskell | ---------------------------------------------------------------------------
|
Module : Text.Hyphenation.Pattern
License : BSD-style (see the file LICENSE)
Stability : provisional
Portability : portable
--------------------------------------------------------------------------
* Pattern file suppo... | # LANGUAGE CPP #
Copyright : ( C ) 2012 - 2019
Maintainer : < >
module Text.Hyphenation.Pattern
(
Patterns
, insertPattern
, lookupPattern
, scorePattern
, parsePatterns
) where
import qualified Data.IntMap as IM
import Prelude hiding (lookup)
import Data.Char (digitToInt, isDigit)
... |
4bd1e4ffa688fbeaeb377ffda54332d09e56aed65fff50a4a3f2ba7ec95531cb | scheme-live/live | output.scm | #("\\a") | null | https://raw.githubusercontent.com/scheme-live/live/4c7c9d80f2fcf80692614e10935fa66be69e3708/live/json/data/y-string-double-escape-a/output.scm | scheme | #("\\a") | |
45f4536e21f05c88e499e79fba88e7ffd1e26d1586e50e4c025d155f97f9795d | BinRoot/Haskell-Data-Analysis-Cookbook | Main.hs | import Data.Graph
-- Defining a graphical network
myGraph :: Graph
myGraph = buildG bounds edges
where bounds = (1,4)
edges = [ (1,3), (1,4)
, (2,3), (2,4)
, (3,4) ]
main = do
putStrLn $ "The edges are " ++ (show.edges) myGraph
putStrLn $ "The vertices are " ++ (show.vert... | null | https://raw.githubusercontent.com/BinRoot/Haskell-Data-Analysis-Cookbook/f8c46987d78f4a6c1828b353c5f906b9314c2ef9/Ch06/Code01_graph1/Main.hs | haskell | Defining a graphical network | import Data.Graph
myGraph :: Graph
myGraph = buildG bounds edges
where bounds = (1,4)
edges = [ (1,3), (1,4)
, (2,3), (2,4)
, (3,4) ]
main = do
putStrLn $ "The edges are " ++ (show.edges) myGraph
putStrLn $ "The vertices are " ++ (show.vertices) myGraph
|
446446bd07de80b312b450bb65b649bb3741a992497ef5bf2d3a922629886111 | pokepay/trivial-battery | linux.lisp | (defpackage #:trivial-battery/os/linux
(:use #:cl)
(:import-from #:split-sequence
#:split-sequence)
(:import-from #:uiop)
(:export #:battery-info))
(in-package #:trivial-battery/os/linux)
(defun batteries ()
(let ((supplies
(with-output-to-string (s)
(uiop:run-program '(... | null | https://raw.githubusercontent.com/pokepay/trivial-battery/318c9da88b4d11d3f33062e0fd09be660a383404/os/linux.lisp | lisp | (defpackage #:trivial-battery/os/linux
(:use #:cl)
(:import-from #:split-sequence
#:split-sequence)
(:import-from #:uiop)
(:export #:battery-info))
(in-package #:trivial-battery/os/linux)
(defun batteries ()
(let ((supplies
(with-output-to-string (s)
(uiop:run-program '(... | |
c9a551488e9ab58693813f48bb153e69ea745542869fc875c9bd26e3504768ce | distrap/gcodehs | Pipes.hs | {-# LANGUAGE OverloadedStrings #-}
module Data.GCode.Pipes where
import Control.Monad
import Control.Monad.Trans.State.Strict
import Data.ByteString (ByteString)
import System.IO (Handle)
import Data.GCode.Types
import Data.GCode.Canon
import Data.GCode.Eval
import Data.GCode.Line
import Data.GCode.Parse
import Dat... | null | https://raw.githubusercontent.com/distrap/gcodehs/8a8dbc66445cff4ce832bb56f42ef03b3215e235/src/Data/GCode/Pipes.hs | haskell | # LANGUAGE OverloadedStrings #
something fishy about this type
needs better name
evaluators
liftIO $ print steppedState
mmaped experiment, requires pipes-bytestring-mmap
main' = do
file <- fmap Prelude.head getArgs
(() <$ Pipes.Attoparsec.parsed parseGCodeLine (Pipes.ByteString.MMap.unsafeMMapFile file) )
... | module Data.GCode.Pipes where
import Control.Monad
import Control.Monad.Trans.State.Strict
import Data.ByteString (ByteString)
import System.IO (Handle)
import Data.GCode.Types
import Data.GCode.Canon
import Data.GCode.Eval
import Data.GCode.Line
import Data.GCode.Parse
import Data.GCode.Pretty
import qualified Dat... |
c1a304a5c9bbe8caa202df5c141b29cbc971eff4724acc3b511d6858d0d9df97 | mfoemmel/erlang-otp | wxDialog.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxDialog.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxDialog).
-include("wxe.hrl").
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.