_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 |
|---|---|---|---|---|---|---|---|---|
5d537ad7458a6db948370f6936879b85b602d34410cd6741a7fa4b16e0ec4738 | spechub/Hets | ToLisp.hs | # LANGUAGE FlexibleInstances #
|
Module : ./Omega / ToLisp.hs
Description : : ( c ) , DFKI 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
The Lisp interface
Module : ./Omega/ToLisp.hs
Descrip... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/Omega/ToLisp.hs | haskell | | Render instance to an SExpression string.
* THEORY HANDLING
* TERM HANDLING
| Omegas built in symbols | # LANGUAGE FlexibleInstances #
|
Module : ./Omega / ToLisp.hs
Description : : ( c ) , DFKI 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
The Lisp interface
Module : ./Omega/ToLisp.hs
Descrip... |
d8445e077fab9894ecaa3ca27a5f2795a811d9992d4fae481394c1c1c14ce724 | privet-kitty/cl-competitive | gray-code.lisp | (defpackage :cp/gray-code
(:use :cl)
(:export #:natural-to-gray #:gray-to-natural))
(in-package :cp/gray-code)
(declaim (inline natural-to-gray))
(defun natural-to-gray (x)
"Encodes X into Gray code."
(declare (unsigned-byte x))
(logxor x (ash x -1)))
(declaim (inline natural-to-gray))
(defun gray-to-natura... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/gray-code.lisp | lisp | (defpackage :cp/gray-code
(:use :cl)
(:export #:natural-to-gray #:gray-to-natural))
(in-package :cp/gray-code)
(declaim (inline natural-to-gray))
(defun natural-to-gray (x)
"Encodes X into Gray code."
(declare (unsigned-byte x))
(logxor x (ash x -1)))
(declaim (inline natural-to-gray))
(defun gray-to-natura... | |
ce9f6884c0faa7994d34d5efef6155d675491e8814afda77e29930a67f190f08 | janestreet/hardcaml | property_manager.ml | open Base
type t =
{ ltl : (string, Property.LTL.path) Hashtbl.t
; mutable is_finalized : bool
; aps : (Signal.Uid.t, Signal.t) Hashtbl.t
}
[@@deriving sexp_of]
let create () =
{ ltl = Hashtbl.create (module String)
; is_finalized = false
; aps = Hashtbl.create (module Signal.Uid)
}
;;
let add_ltl t ... | null | https://raw.githubusercontent.com/janestreet/hardcaml/4126f65f39048fef5853ba9b8d766143f678a9e4/src/property_manager.ml | ocaml | open Base
type t =
{ ltl : (string, Property.LTL.path) Hashtbl.t
; mutable is_finalized : bool
; aps : (Signal.Uid.t, Signal.t) Hashtbl.t
}
[@@deriving sexp_of]
let create () =
{ ltl = Hashtbl.create (module String)
; is_finalized = false
; aps = Hashtbl.create (module Signal.Uid)
}
;;
let add_ltl t ... | |
a9753643142b5c3c2532b0acbf6d6cd62a416ff1ff6e93d12b5b2c8f71d42493 | PrincetonUniversity/lucid | coreDfg.ml | coreDfg.ml --
convert a control dependency graph into a data flow graph
( really a data dependency graph )
The control dependency graph has nodes that test
the conditions necessary for their execution , and
an edge ( s , t ) represents that s comes before t
in the control flow of t... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/3a94505efa50e988b4c9ef28048be47cc65b4355/src/lib/backend/layout/coreDfg.ml | ocaml | logging
a node is a statement and a condition that
must hold for it to be executed
an edge between (s, t) is a variable that is either
read or written in s and read or written in t.
* helpers *
* dependency helpers *
invalidate call _writes_ to its arg fields
return the IDs that a statement writes to
... | coreDfg.ml --
convert a control dependency graph into a data flow graph
( really a data dependency graph )
The control dependency graph has nodes that test
the conditions necessary for their execution , and
an edge ( s , t ) represents that s comes before t
in the control flow of t... |
e5ca55551143824ad27689ff6324404e847c4d0fa7b9b2ff71cf119fd2bcc712 | BardurArantsson/cqrs | QuerySpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Data.CQRS.PostgreSQL.Internal.QuerySpec
( mkQuerySpec
) where
import Control.Exception (bracket)
import Control.Monad.IO.Class (liftIO)
import Data.ByteString (isInfixOf)
import Data.CQRS.PostgreS... | null | https://raw.githubusercontent.com/BardurArantsson/cqrs/2491d83e2bcd68c883aaea33cdce6c5ea8c0cd1a/cqrs-postgresql/src-test/Data/CQRS/PostgreSQL/Internal/QuerySpec.hs | haskell | # LANGUAGE OverloadedStrings #
Tests for Data.CQRS.PostgreSQL.Internal.Utils | # LANGUAGE ScopedTypeVariables #
module Data.CQRS.PostgreSQL.Internal.QuerySpec
( mkQuerySpec
) where
import Control.Exception (bracket)
import Control.Monad.IO.Class (liftIO)
import Data.ByteString (isInfixOf)
import Data.CQRS.PostgreSQL.Internal.Query
import ... |
f707a8cb0dd22de30c8a6b3d5e37dc42bfd54c378da1efe3eedd314eaf3d17a9 | jixiuf/helloerlang | param_parent.erl | -module(param_parent,[Name]).
-export([show/0]).
%% 此类为一参数化module
A = param_parent : new(cat ) .
%% A:show().
show()->
io:format("name is :~p~n",[Name]).
| null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/extend_test/src/param_parent.erl | erlang | 此类为一参数化module
A:show(). | -module(param_parent,[Name]).
-export([show/0]).
A = param_parent : new(cat ) .
show()->
io:format("name is :~p~n",[Name]).
|
a91c0ffaa84002e863189a5bf278088478bb8f2c3f667de572b96c552c417094 | davebryson/erlang_websocket | basic.erl | @author author < >
YYYY author .
%% @doc TEMPLATE.
-module(basic).
-export([start/0, stop/0]).
ensure_started(App) ->
case application:start(App) of
ok ->
ok;
{error, {already_started, App}} ->
ok
end.
@spec start ( ) - > ok
%% @doc Start the basic ser... | null | https://raw.githubusercontent.com/davebryson/erlang_websocket/435e2dd8d2a558b539e7bc1a9c4e3eddbdda3a82/examples/basic/src/basic.erl | erlang | @doc TEMPLATE.
@doc Start the basic server.
@doc Stop the basic server. | @author author < >
YYYY author .
-module(basic).
-export([start/0, stop/0]).
ensure_started(App) ->
case application:start(App) of
ok ->
ok;
{error, {already_started, App}} ->
ok
end.
@spec start ( ) - > ok
start() ->
basic_deps:ensure(),
ensur... |
6d54f98088a9c2a0cbecc5794ca0941d8088c3febbf4da358fc1de82df08c052 | facebook/infer | JsonReports.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/bbd1bd7e1d100ca3abf19f8ab04a2fe64349b51b/infer/src/integration/JsonReports.mli | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
8a603fdfcd516d501a8d513adb8783855c8817be473d49d7fdec029637111598 | 2600hz/kazoo | kz_util.erl | %%%-----------------------------------------------------------------------------
( C ) 2010 - 2020 , 2600Hz
%%% @doc Various utilities - a veritable cornucopia.
@author
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed ... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo/src/kz_util.erl | erlang | -----------------------------------------------------------------------------
@doc Various utilities - a veritable cornucopia.
@end
-----------------------------------------------------------------------------
------------------------------------------------------------------------------
@doc Given an object, extra... | ( C ) 2010 - 2020 , 2600Hz
@author
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kz_util).
-export([pretty_print_bytes/1, pretty_print_bytes/2
,bin_usage/... |
e042cb80ebe95c36d922f3015d58c76f0b6424eb5796d5fde8bd9d9907562e1c | QuentinDuval/HaskellTrainReservationKata | ReservationApi.hs | module ReservationApi (reserve) where
import Control.Lens
import Control.Monad
import Data.List(partition)
import Data.Maybe
import qualified Data.Map as Map
import qualified Data.Set as Set
import Occupancy
import ReservationExpr
----------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/QuentinDuval/HaskellTrainReservationKata/7b265c918eb13cd4b48214d51c6274156fe1ce4e/src/ReservationApi.hs | haskell | ------------------------------------------------------------------------------
TODO: refactor (in any case, we should look in reserve... but before)
| module ReservationApi (reserve) where
import Control.Lens
import Control.Monad
import Data.List(partition)
import Data.Maybe
import qualified Data.Map as Map
import qualified Data.Set as Set
import Occupancy
import ReservationExpr
trainMaxOccupancy :: Double
trainMaxOccupancy = 0.7
coachMaxOccupancy ... |
330052aaf6a8adce129bce5d3a7d4d631ab26a032ea39b2fe0b206b4091085f5 | TomLisankie/static-roam | parser_test.clj | (ns static-roam.parser-test
(:require [static-roam.parser :refer :all]
[clojure.test :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= (parse-to-ast "[[Physics]] #Static-Roam") [:block [:page-link "Physics"] " " [:hashtag "Static-Roam"]]))))
| null | https://raw.githubusercontent.com/TomLisankie/static-roam/f8f63825f0e8b7f5b53e3400025aa97a2c5c8061/test/static_roam/parser_test.clj | clojure | (ns static-roam.parser-test
(:require [static-roam.parser :refer :all]
[clojure.test :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= (parse-to-ast "[[Physics]] #Static-Roam") [:block [:page-link "Physics"] " " [:hashtag "Static-Roam"]]))))
| |
281f68cb48ae25039ae08c5d664efa5565bb8ba0bb648f5c92504e066e483aa7 | buntine/Simply-Scheme-Exercises | 20-9.scm | ; The way we invoke the game program isn't very user-friendly. Write a procedure
; game that asks you whether you wish to play x or o, then starts a game. (By definition,
x plays first . ) Then write a procedure games that allows you to keep playing repeatedly .
; It can ask "do you want to play again?" after each ga... | null | https://raw.githubusercontent.com/buntine/Simply-Scheme-Exercises/c6cbf0bd60d6385b506b8df94c348ac5edc7f646/20-input-and-output/20-9.scm | scheme | The way we invoke the game program isn't very user-friendly. Write a procedure
game that asks you whether you wish to play x or o, then starts a game. (By definition,
It can ask "do you want to play again?" after each game. (Make sure that the outcome of
each game is still reported, and that the user can choose whe... | x plays first . ) Then write a procedure games that allows you to keep playing repeatedly .
(define (game)
(display "Please choose x or o:")
(let ((player (read)))
(cond ((equal? player 'x)
(play-ttt ask-user ttt))
((equal? player 'o)
(play-ttt ttt ask-user))
(else... |
29909aed7ed78871dd9098c486c2c37a6f31e418eb0d9c9a705e651c4e812d80 | helvm/helma | ALU.hs | module HelVM.HelMA.Automaton.Units.ALU (
doOutputChar2,
doInputChar2,
doInputDec2,
divMod,
sub,
binaryInstruction,
binaryInstructions,
halibut,
runALI,
move,
discard,
slide,
copy,
flipPush1,
charPush1,
genericPush1,
pop1,
pop2,
push1,
push2,
splitAt,
drop,
ALU,
Stack,
) w... | null | https://raw.githubusercontent.com/helvm/helma/2ae31668ce11ded53daf01effe25047d5ce471cf/hs/src/HelVM/HelMA/Automaton/Units/ALU.hs | haskell | aotALI ::
| Arithmetic instructions
| IO instructions
| Manipulation instructions
| Halibut and Pick instructions
| Slide instructions
| Move instructions
| Copy instructions
| Pop instructions
| Push instructions
| Types | module HelVM.HelMA.Automaton.Units.ALU (
doOutputChar2,
doInputChar2,
doInputDec2,
divMod,
sub,
binaryInstruction,
binaryInstructions,
halibut,
runALI,
move,
discard,
slide,
copy,
flipPush1,
charPush1,
genericPush1,
pop1,
pop2,
push1,
push2,
splitAt,
drop,
ALU,
Stack,
) w... |
1ccae744007f737e49bee0285f4f68a64787f072d9e5f49882d3dff491089380 | fugue/fregot | Object.hs | |
Copyright : ( c ) 2021 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Regex - related builtins .
Copyright : (c) 2021 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portabilit... | null | https://raw.githubusercontent.com/fugue/fregot/c3d87f37c43558761d5f6ac758d2f1a4117adb3e/lib/Fregot/Builtins/Object.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | |
Copyright : ( c ) 2021 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Regex - related builtins .
Copyright : (c) 2021 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portabilit... |
c459f2e549468f8841af29f5eefbdc2dd92bc51fd44b9dda45bdff23ae83606c | xu-hao/QueryArrow | Serialization.hs | # LANGUAGE TemplateHaskell , StandaloneDeriving , DeriveGeneric , TypeFamilies #
module QueryArrow.Remote.NoTranslation.Serialization where
import QueryArrow.Remote.NoTranslation.Definitions
import Data.MessagePack
import GHC.Generics
import QueryArrow.Serialization ()
import QueryArrow.Remote.Serialization ()
derivi... | null | https://raw.githubusercontent.com/xu-hao/QueryArrow/4dd5b8a22c8ed2d24818de5b8bcaa9abc456ef0d/QueryArrow-db-remote/src/QueryArrow/Remote/NoTranslation/Serialization.hs | haskell | # LANGUAGE TemplateHaskell , StandaloneDeriving , DeriveGeneric , TypeFamilies #
module QueryArrow.Remote.NoTranslation.Serialization where
import QueryArrow.Remote.NoTranslation.Definitions
import Data.MessagePack
import GHC.Generics
import QueryArrow.Serialization ()
import QueryArrow.Remote.Serialization ()
derivi... | |
b69507bac77b10bd885d2d2dde3b0e294e5fbafc880ec3d39e7f0391284cff2a | fredokun/arbogen | genState.ml | type t =
{ randgen: string
; rnd_state: Bytes.t
; weighted_grammar: Boltzmann.WeightedGrammar.t }
let from_file filename =
let ic = open_in filename in
try (input_value ic : t) with err -> close_in_noerr ic; raise err
let to_file filename state =
let oc = open_out filename in
try output_value oc state w... | null | https://raw.githubusercontent.com/fredokun/arbogen/cc7485249d7265613c7a8b15c91bb9502e98bb2e/src/bin/genState.ml | ocaml | type t =
{ randgen: string
; rnd_state: Bytes.t
; weighted_grammar: Boltzmann.WeightedGrammar.t }
let from_file filename =
let ic = open_in filename in
try (input_value ic : t) with err -> close_in_noerr ic; raise err
let to_file filename state =
let oc = open_out filename in
try output_value oc state w... | |
f8cd50e4df6d44662d1db1b37df979dc2d853d9e358faf2ee92967e5321870db | kunstmusik/pink | live_code_study.clj | (ns pink.demo.live-code-study
(:require [pink.simple :refer :all]
[pink.live-code :refer :all]
[pink.config :refer :all]
[pink.filters :refer :all]
[pink.envelopes :refer :all]
[pink.util :refer :all]
[pink.node :refer :all]
[pink.osc... | null | https://raw.githubusercontent.com/kunstmusik/pink/7d37764b6a036a68a4619c93546fa3887f9951a7/src/demo/pink/demo/live_code_study.clj | clojure | instr
Download Salamander from and
place within PINK_RESOURCE_ROOT/samples
control
eval to get drums going
eval to get melodic line going
eval multiple times to get parallel melodic lines
modify m5-freq to yield different values
schedule the function change for m5-freq | (ns pink.demo.live-code-study
(:require [pink.simple :refer :all]
[pink.live-code :refer :all]
[pink.config :refer :all]
[pink.filters :refer :all]
[pink.envelopes :refer :all]
[pink.util :refer :all]
[pink.node :refer :all]
[pink.osc... |
3d2c9910a0c88ee5e24df609eed770a677e942a14823df7f1db01dee16bddf62 | kivra/jsonformat | jsonformat.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright ( c ) 2020 , Kivra
%%%
%%% Permission to use, copy, modify, and/or distribute this software for any
%%% purpose with or without fee is hereby granted, provided that the above
%%% copyright notice and this permission notice appea... | null | https://raw.githubusercontent.com/kivra/jsonformat/02ce7411e012e92ed7f453857f96e4f3ba16df86/src/jsonformat.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EV... | Copyright ( c ) 2020 , Kivra
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
@doc Custom formatter for the Erlang OTP logger application ... |
c803b27287adac366a992ccc72a7a67faee3265cea0e4abb12b95a21b883cf5f | uds-psl/Prog | tree.ml | type tree = A | B of tree * tree
let t = B(B(A,A), B(B(A,A),A))
let rec size t =
match t with
| A -> 1
| B(t1,t2) -> 1 + size t1 + size t2
let test = size t
let max x y = if x<y then y else x
let rec depth t =
match t with
| A -> 0
| B(t1,t2) -> 1 + max (depth t1) (depth t2)
let test = depth t
let r... | null | https://raw.githubusercontent.com/uds-psl/Prog/ca0909a87c4ad9091322a873abc4c58aa59f4f96/ml/tree.ml | ocaml | Balanced trees
Prefix linearization
Postfix Linearization
Infix linearization, left-associative
Abstract expressions | type tree = A | B of tree * tree
let t = B(B(A,A), B(B(A,A),A))
let rec size t =
match t with
| A -> 1
| B(t1,t2) -> 1 + size t1 + size t2
let test = size t
let max x y = if x<y then y else x
let rec depth t =
match t with
| A -> 0
| B(t1,t2) -> 1 + max (depth t1) (depth t2)
let test = depth t
let r... |
ef73b42559a7a013f7fe779dfe21fb458381944752d46fd45c46204ffedb466b | dinosaure/pasteur | show.ml | open Tyxml.Html
let css_href = Xml.uri_of_string "/pastisserie.css"
let highlight_js_href = Xml.uri_of_string "highlight.js"
let highlight_css_href = Xml.uri_of_string ""
let pasteur_js_href = Xml.uri_of_string "pasteur.js"
let html ?code:code_class ?(encrypted= true) code_contents =
let a = match code_class with
... | null | https://raw.githubusercontent.com/dinosaure/pasteur/a881b87565e6991b29eb14fbdc141b505f53cc47/show.ml | ocaml | open Tyxml.Html
let css_href = Xml.uri_of_string "/pastisserie.css"
let highlight_js_href = Xml.uri_of_string "highlight.js"
let highlight_css_href = Xml.uri_of_string ""
let pasteur_js_href = Xml.uri_of_string "pasteur.js"
let html ?code:code_class ?(encrypted= true) code_contents =
let a = match code_class with
... | |
10399119e7eb3c8b189a106575a6b07b841e14c6e1b22d23714369b2f2533279 | hbr/albatross | standard_context.ml | open Alba_core
open Ast
module Inductive_parser =
Parser_lang.Make (
struct
type t = Source_entry.inductive array
end)
module Expression_parser =
Parser_lang.Make (Expression)
module Definition_parser =
Parser_lang.Make (
struct
type t = Expression.defin... | null | https://raw.githubusercontent.com/hbr/albatross/8f28ef97951f92f30dc69cf94c0bbe20d64fba21/ocaml/albalib/standard_context.ml | ocaml | Cannot happen.
Cannot happen.
Cannot happen. | open Alba_core
open Ast
module Inductive_parser =
Parser_lang.Make (
struct
type t = Source_entry.inductive array
end)
module Expression_parser =
Parser_lang.Make (Expression)
module Definition_parser =
Parser_lang.Make (
struct
type t = Expression.defin... |
867db6492f689cad8b42668ea99ada7bc3fac0af5e3e000e6007861078608d2e | exercism/haskell | ComplexNumbers.hs | module ComplexNumbers
(Complex,
conjugate,
abs,
exp,
mul,
add,
sub,
div,
real,
imaginary,
complex) where
import Prelude hiding (div, abs, exp)
import qualified Prelude as P
-- Data definition -------------------------------------------------------------
data Complex a = Complex a a deriving (Eq, Show)
----... | null | https://raw.githubusercontent.com/exercism/haskell/ae17e9fc5ca736a228db6dda5e3f3b057fa6f3d0/exercises/practice/complex-numbers/.meta/examples/success-standard/src/ComplexNumbers.hs | haskell | Data definition -------------------------------------------------------------
------------------------------------------------------------------------------
unary operators -------------------------------------------------------------
binary operators ------------------------------------------------------------ | module ComplexNumbers
(Complex,
conjugate,
abs,
exp,
mul,
add,
sub,
div,
real,
imaginary,
complex) where
import Prelude hiding (div, abs, exp)
import qualified Prelude as P
data Complex a = Complex a a deriving (Eq, Show)
complex :: (a, a) -> Complex a
complex = uncurry Complex
exp2 :: Num a => a -> a
exp... |
1df96f95800dfa0e5b574720b6c2b98baabe12c463cdc55cc6821bf323768fdb | scheme/rx | simp.scm | , June 1998
Copyright ( c ) 1998 by the Scheme Underground .
One export : ( simplify - regexp re ) - > re
Regexp simplifier
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; (| (in c1 ...) (in c2 ...) re ...) => (| (in c1 ... c2 ...) re ...)
;;; (| (not-in c1 ...) (not-in c... | null | https://raw.githubusercontent.com/scheme/rx/dd9037f6f9ea01019390614f6b126b7dd293798d/simp.scm | scheme |
(| (in c1 ...) (in c2 ...) re ...) => (| (in c1 ... c2 ...) re ...)
(| (not-in c1 ...) (not-in c2 ...)) => (| (not-in [intersect (c1 ...)
(c2 ...)])
Nested exponents can be collapsed (*, +, ?) -- multiply the "from's"
together; multiply the "to's" together.
Adjacent literals in a sequence can be co... | , June 1998
Copyright ( c ) 1998 by the Scheme Underground .
One export : ( simplify - regexp re ) - > re
Regexp simplifier
A run of BOS 's or a run of EOS 's in a sequence may be elided .
Exponent range [ 1,1 ] simplifies , as does [ 0,0 ] .
Uniquify branches
Singleton choices and sequences can be ... |
e629ecaf1354681d48c03bdab3a9c54f078c36afa07d5afc3ee0e0a75a3b3822 | soulomoon/SICP | Exercise4.66.scm | Exercise 4.66 : has been generalizing the query system to provide statistics about the company . For example , to find the total salaries of all the computer programmers one will be able to say
; (sum ?amount
; (and (job ?x (computer programmer))
; (salary ?x ?amount)))
In general , ’s new system ... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter4/Exercise4.66.scm | scheme | (sum ?amount
(and (job ?x (computer programmer))
(salary ?x ?amount)))
(accumulation-function ⟨variable⟩
⟨query pattern⟩)
there would be duplicate.
way to solve it is to eliminate the duplicate.
that he can keep track on the a frame of variable that has already be in the ac... | Exercise 4.66 : has been generalizing the query system to provide statistics about the company . For example , to find the total salaries of all the computer programmers one will be able to say
In general , ’s new system allows expressions of the form
where accumulation - function can be things like sum , ave... |
e848636eb5fd4819ae0a9e6c7b0c4e6f305ed3fff1de718cbb465516b125de1a | links-lang/links | chaser.mli | val add_dependencies : Sugartypes.program -> Sugartypes.program
val add_dependencies_sentence : Sugartypes.sentence -> Sugartypes.sentence
| null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/chaser.mli | ocaml | val add_dependencies : Sugartypes.program -> Sugartypes.program
val add_dependencies_sentence : Sugartypes.sentence -> Sugartypes.sentence
| |
f46c35a849e8b3cba507512a3d98b323212f37de61044da8c3e40e740ea41b33 | esl/MongooseIM | mam_encoder.erl | -module(mam_encoder).
-export([encode_message/3]).
-export([encode_jid/2]).
-export([encode_direction/1]).
-export([encode_packet/2]).
-export([extend_lookup_params/2]).
-include("jlib.hrl").
-include("mongoose_mam.hrl").
-type value_type() :: int | maybe_string | direction | bare_jid | jid | jid_resource | xml | sea... | null | https://raw.githubusercontent.com/esl/MongooseIM/96839a5077b9df41ab58e241d7a4e9e6df2f4854/src/mam/mam_encoder.erl | erlang | -module(mam_encoder).
-export([encode_message/3]).
-export([encode_jid/2]).
-export([encode_direction/1]).
-export([encode_packet/2]).
-export([extend_lookup_params/2]).
-include("jlib.hrl").
-include("mongoose_mam.hrl").
-type value_type() :: int | maybe_string | direction | bare_jid | jid | jid_resource | xml | sea... | |
11ce051c9592bccd92504895b44fe784b67aa6b45c1cf915c3a785557f1b219c | Bogdanp/racket-http-easy | payload.rkt | #lang racket/base
(require file/gzip
file/md5
json
net/uri-codec
racket/contract
racket/format
racket/match
racket/port
"contract.rkt")
(provide
form-payload
gzip-payload
json-payload
pure-payload)
(define/contract (form-payload v)
(-> for... | null | https://raw.githubusercontent.com/Bogdanp/racket-http-easy/630a982a282a51fd7fd85dc5e2f3f581c564b5e4/http-easy-lib/http-easy/private/payload.rkt | racket | multipart ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
help ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | #lang racket/base
(require file/gzip
file/md5
json
net/uri-codec
racket/contract
racket/format
racket/match
racket/port
"contract.rkt")
(provide
form-payload
gzip-payload
json-payload
pure-payload)
(define/contract (form-payload v)
(-> for... |
228161d8f74a97bfa0dec96f309d8acb4637148590807330ddb99f0d48ba87dd | YoshikuniJujo/funpaala | leibniz.hs | estPi :: Int -> Double
estPi n = 4 * estPi4 n
estPi = (4 *) . estPi4
estPi4 :: Int -> Double
estPi4 0 = 1
estPi4 n = estPi4 (n - 1) + (- 1) ^ n / (2 * fromIntegral n + 1)
estPi' :: Int -> Double
estPi' n = (4 *) . sum . take n $ map (\k -> (- 1) ** k / (2 * k + 1)) [0 ..]
| null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/13_recursion/leibniz.hs | haskell | estPi :: Int -> Double
estPi n = 4 * estPi4 n
estPi = (4 *) . estPi4
estPi4 :: Int -> Double
estPi4 0 = 1
estPi4 n = estPi4 (n - 1) + (- 1) ^ n / (2 * fromIntegral n + 1)
estPi' :: Int -> Double
estPi' n = (4 *) . sum . take n $ map (\k -> (- 1) ** k / (2 * k + 1)) [0 ..]
| |
ee958e09f09bcd964e37c5e34a9ae6fa75cb79ed63ae4bebdfd44fc9ca2aa4ef | beoliver/clj-arangodb | test_data.clj | (ns clj-arangodb.arangodb.test-data
(:require [clj-arangodb.arangodb.databases :as d]
[clj-arangodb.arangodb.adapter :as adapter]
[clj-arangodb.arangodb.aql :as aql]
[clj-arangodb.arangodb.helper :as h]))
(def ^:const game-of-thrones-db-label "gameOfThronesDB")
(def ^:private cha... | null | https://raw.githubusercontent.com/beoliver/clj-arangodb/a6b2c835278573e2fee3521c63917838e86703eb/test/clj_arangodb/arangodb/test_data.clj | clojure | (ns clj-arangodb.arangodb.test-data
(:require [clj-arangodb.arangodb.databases :as d]
[clj-arangodb.arangodb.adapter :as adapter]
[clj-arangodb.arangodb.aql :as aql]
[clj-arangodb.arangodb.helper :as h]))
(def ^:const game-of-thrones-db-label "gameOfThronesDB")
(def ^:private cha... | |
1e133e3c5f96c3bd641dbcf4530f68b2d823fd781a33377be0c31ac4feddbca1 | intermine/im-tables-3 | effects.cljs | (ns im-tables.effects
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :refer [reg-fx dispatch]]
[cljs.core.async :refer [<! timeout close!]]))
(defn im-operation
[{:keys [on-success on-failure response-format op channel params]}]
(go
(let [{:keys [statusC... | null | https://raw.githubusercontent.com/intermine/im-tables-3/1a769d4055611a5c6a098b1b6a085594ea37baf0/src/im_tables/effects.cljs | clojure | Response can be nil or "" when offline.
Note that `s` can be nil for successful responses, due to
imcljs applying a transducer on success. The proper way to
check for null responses (which don't have a status code)
is to check if the response itself is nil.
I commented this out since in some cases, like fetching ... | (ns im-tables.effects
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [re-frame.core :refer [reg-fx dispatch]]
[cljs.core.async :refer [<! timeout close!]]))
(defn im-operation
[{:keys [on-success on-failure response-format op channel params]}]
(go
(let [{:keys [statusC... |
09178692167d204e581c28492d7267e148d69d1152af6d3002b11a7f231c4df8 | let-def/sturgeon | sturgeon_recipes_server.ml | open Sturgeon
type server = {
client: unit -> (Session.t option * (Session.t -> unit) option);
mutable socket: Unix.file_descr option;
mutable clients: (Unix.file_descr) list;
connections:
(Unix.file_descr,
(unit -> Sexp.basic option) * Session.output * Session.status)
Hashtbl.t;
}
let server ~c... | null | https://raw.githubusercontent.com/let-def/sturgeon/97023209c6ddea3b113ef791b40e8e670742379d/lib/recipes_server/sturgeon_recipes_server.ml | ocaml | open Sturgeon
type server = {
client: unit -> (Session.t option * (Session.t -> unit) option);
mutable socket: Unix.file_descr option;
mutable clients: (Unix.file_descr) list;
connections:
(Unix.file_descr,
(unit -> Sexp.basic option) * Session.output * Session.status)
Hashtbl.t;
}
let server ~c... | |
b7b2066c8ca3614e4d89bfc7b6519863281dccee9efda08c04c88bea79b3fd9c | maximedenes/native-coq | sign.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/kernel/sign.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* {6 Signatures of ordered named dec... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
type n... |
31207d4da35c9c1ed3004a0ebbd474bc950953323dbcf1386260d58fc09d8280 | jimpil/hotel-nlp | helper.clj | (ns hotel_nlp.helper
(:require
[clojure.data.zip :as zf]
[clojure.data.csv :as csv]
[clojure.data.zip.xml :as zxml]
[clojure.xml :as xml]
[clojure.zip :as zip]
[clojure.set :as sets]
[clojure.xml :as xml]
... | null | https://raw.githubusercontent.com/jimpil/hotel-nlp/2647f999b5998595a5edac1900e850140f374de6/src/hotel_nlp/helper.clj | clojure | [plumbing.fnk.impl :refer [fnk-form]]
a seq of components
just return all components
the workflow can itself be a component
(run [this] (deploy this))
can act as an fn
Object
(toString [this]
(str "#hotel_nlp.helper.Workflow" {:components (:components this)}))
a map of components -> fnks (see prismatic.plumbing)
just ... | (ns hotel_nlp.helper
(:require
[clojure.data.zip :as zf]
[clojure.data.csv :as csv]
[clojure.data.zip.xml :as zxml]
[clojure.xml :as xml]
[clojure.zip :as zip]
[clojure.set :as sets]
[clojure.xml :as xml]
... |
3a507e44c8936158511855059968b6d268620565d619505ebf0009bde2032ae1 | ocurrent/opam-health-check | admin.mli | val create_admin_key : Server_workdirs.t -> unit Lwt.t
val callback :
on_finished:(Server_workdirs.t -> unit Lwt.t) ->
conf:Server_configfile.t ->
run_trigger:unit Lwt_mvar.t ->
Server_workdirs.t ->
Cohttp_lwt_unix.Server.conn ->
Cohttp.Request.t ->
Cohttp_lwt.Body.t ->
(Cohttp.Response.t * Cohttp_lwt.... | null | https://raw.githubusercontent.com/ocurrent/opam-health-check/04a76d6e89642ed338c5895b17c96cafab9628e3/server/backend/admin.mli | ocaml | val create_admin_key : Server_workdirs.t -> unit Lwt.t
val callback :
on_finished:(Server_workdirs.t -> unit Lwt.t) ->
conf:Server_configfile.t ->
run_trigger:unit Lwt_mvar.t ->
Server_workdirs.t ->
Cohttp_lwt_unix.Server.conn ->
Cohttp.Request.t ->
Cohttp_lwt.Body.t ->
(Cohttp.Response.t * Cohttp_lwt.... | |
65f35f7dc5b4054c2e7f5851cb7753b1c20a07ee6e9e9768f0e9d84c18c1dbb1 | dakrone/clj-http | headers.clj | (ns clj-http.headers
"Provides wrap-header-map, which is middleware allows headers to be
specified more flexibly. In requests and responses, headers can be
accessed as strings or keywords of any case. In requests, string
header names will be sent to the server with their casing unchanged,
while keyword header... | null | https://raw.githubusercontent.com/dakrone/clj-http/dd15359451645f677b3e294164cf70330b92241d/src/clj_http/headers.clj | clojure | a map implementation that stores both the original (or canonical)
key and value for each key/value pair, but performs lookups and
other operations using the normalized -- this allows a value to be
looked up by many similar keys, and not just the exact precise key
it was originally stored with. | (ns clj-http.headers
"Provides wrap-header-map, which is middleware allows headers to be
specified more flexibly. In requests and responses, headers can be
accessed as strings or keywords of any case. In requests, string
header names will be sent to the server with their casing unchanged,
while keyword header... |
c677e3c261c0f732bb18c44df85889aa33f371b2f8ea5291f6f0c75b0ef746e6 | sweirich/haskelltester | Gradescope.hs | # LANGUAGE DeriveAnyClass , DeriveGeneric , DuplicateRecordFields , OverloadedStrings ,
LambdaCase , ScopedTypeVariables , NamedFieldPuns #
LambdaCase, ScopedTypeVariables,NamedFieldPuns #-}
# OPTIONS_GHC -W #
module Gradescope where
import Control.Monad(forM_)
import GHC.Generics
import ... | null | https://raw.githubusercontent.com/sweirich/haskelltester/8aeb19b2dfca87432993817c774ad66dbf44e4a8/src/Gradescope.hs | haskell | remove any ("foo" : null) bindings in objects
B.putStr encoded | # LANGUAGE DeriveAnyClass , DeriveGeneric , DuplicateRecordFields , OverloadedStrings ,
LambdaCase , ScopedTypeVariables , NamedFieldPuns #
LambdaCase, ScopedTypeVariables,NamedFieldPuns #-}
# OPTIONS_GHC -W #
module Gradescope where
import Control.Monad(forM_)
import GHC.Generics
import ... |
b913de5fcc8773e29df6f49bf1b6bbeea227289338dde3bdc090476a23848e0f | stathissideris/dali | dom.clj | (ns dali.dom
(:require [dali :as dali]
[dali.syntax :as s]
[dali.utils :as utils]))
(def SVG-NS "")
(def ns-mapping {"xlink" ""
"svg" SVG-NS})
(defn- create-element [dom name]
(if (dali/dali-tag? name)
(.createElementNS dom SVG-NS "g")
(.createElementNS dom SVG-... | null | https://raw.githubusercontent.com/stathissideris/dali/97ebf43527fe76e838d7b6bb98a953db2747824d/src/dali/dom.clj | clojure | (println "setting attribute" (pr-str k) "with ns" (pr-str ns) "to" (pr-str (str v)))
(println "setting attribute" (pr-str (name k)) "to" (pr-str (str v)))
TODO only first??
(println "RECUR") | (ns dali.dom
(:require [dali :as dali]
[dali.syntax :as s]
[dali.utils :as utils]))
(def SVG-NS "")
(def ns-mapping {"xlink" ""
"svg" SVG-NS})
(defn- create-element [dom name]
(if (dali/dali-tag? name)
(.createElementNS dom SVG-NS "g")
(.createElementNS dom SVG-... |
87058240b181d6230043c0ce1950a64a1eab7683e88c4915bc180d757effa1ba | mzp/coq-ruby | command.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/toplevel/command.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
s Declaration functions. The fol... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : command.mli 12187... |
27d2764695025377144422451a2aeabee3f44ddf2fdfa1cfbedda49ece505c80 | jship/monad-logger-aeson | MetadataNoThreadContextYes.hs | # LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
module TestCase.LogOther.MetadataNoThreadContextYes
( testCase
) where
import Control.Monad.Logger.Aeson
( (.=), Loc(..), LogLevel(..), LoggedMessage(..), logOther, withThreadContext
)
import Data.Aeson.QQ.Simple (aesonQQ)
... | null | https://raw.githubusercontent.com/jship/monad-logger-aeson/b983befb790818628f1c4a5f02a2b96b08dcf6ce/monad-logger-aeson/test-suite/TestCase/LogOther/MetadataNoThreadContextYes.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NamedFieldPuns #
# LANGUAGE QuasiQuotes #
module TestCase.LogOther.MetadataNoThreadContextYes
( testCase
) where
import Control.Monad.Logger.Aeson
( (.=), Loc(..), LogLevel(..), LoggedMessage(..), logOther, withThreadContext
)
import Data.Aeson.QQ.Simple (aesonQQ)
import Data.Time (UTCTime(..))
impo... |
7edcf043eccf15bbf24634db0314fc26c154c639c0d874e1b851448c421aee53 | fulcrologic/fulcro | html_entities.cljc | (ns com.fulcrologic.fulcro.dom.html-entities
"Defs of the proper unicode characters so you can use html entities in your DOM functions without having to
look them up (or type out silly things like \"\\u00C6\"
For example:
```
(ns my.ui
(:require
[com.fulcrologic.fulcro.dom.html-entities :as ent]))... | null | https://raw.githubusercontent.com/fulcrologic/fulcro/71ed79c650222567ac4a566513365a95f12657e3/src/main/com/fulcrologic/fulcro/dom/html_entities.cljc | clojure | sic
sic | (ns com.fulcrologic.fulcro.dom.html-entities
"Defs of the proper unicode characters so you can use html entities in your DOM functions without having to
look them up (or type out silly things like \"\\u00C6\"
For example:
```
(ns my.ui
(:require
[com.fulcrologic.fulcro.dom.html-entities :as ent]))... |
10b0c2d1b3c269b1c3625a6ce72ce59f6896a8ee1c8dfe143c14c19a8c20d067 | connerirwin/musfix | Type.hs | -- | Refinement Types
module Language.Synquid.Type where
import Language.SMT.Syntax
import Language.Synquid.Logic
import Language.Synquid.Tokens
import Language.Synquid.Util
import Data.Maybe
import Data.Either
import Data.List
import qualified Data.Set as Set
import Data.Set (Set)
import qualified Data.... | null | https://raw.githubusercontent.com/connerirwin/musfix/97edf67693d6ee3ea7dc234b20db560af92d95c3/src/Language/Synquid/Type.hs | haskell | | Refinement Types
Type skeletons
| Type skeletons (parametrized by refinements)
isScalarType (LetT _ _ t) = isScalarType t
isFunctionType (LetT _ _ t) = isFunctionType t
| Convention to indicate "any datatype" (for synthesizing match scrtuinees)
TODO: make sure the AnyT case is OK
| Free variables of a ... | module Language.Synquid.Type where
import Language.SMT.Syntax
import Language.Synquid.Logic
import Language.Synquid.Tokens
import Language.Synquid.Util
import Data.Maybe
import Data.Either
import Data.List
import qualified Data.Set as Set
import Data.Set (Set)
import qualified Data.Map as Map
import Data... |
a73bc9ae5baf84f2ef4d3832fe634671fe5aa2ee4af3ab62ebe9fb5668042e98 | GaloisInc/hpb | Resolver.hs | ------------------------------------------------------------------------
-- |
-- Module : Data.HPB.Resolver
-- Description : Provides overrides for symbolic simulator
-- specific operations.
Copyright : ( c ) Galois , Inc 2015
Maintainer : < >
-- Stability ... | null | https://raw.githubusercontent.com/GaloisInc/hpb/60485aa40569f283ca9dfe84677cc4fc9422f528/hpb/Data/HPB/Resolver.hs | haskell | ----------------------------------------------------------------------
|
Module : Data.HPB.Resolver
Description : Provides overrides for symbolic simulator
specific operations.
Stability : provisional
This module provides symbolic simulator specific overrides.
-----------... | Copyright : ( c ) Galois , Inc 2015
Maintainer : < >
# LANGUAGE CPP #
# LANGUAGE PatternGuards #
module Data.HPB.Resolver
( Package(..)
, ModuleName(..)
, resolvePackage
) where
import Control.Lens
import Control.Monad.State
import Data.Char
import qualified Data.Foldable as Fold
import D... |
539e3b3a58530511117650cf144c8e04b0a2dc67042cb81350f2421f3ffa5db8 | sealchain-project/sealchain | TimeGen.hs | # LANGUAGE LambdaCase #
Hedgehog generators of times
module Analyze.TimeGen where
import Hedgehog hiding (Update)
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Text.Printf as T
-- with a few problematic ones disabled
data TimeFormatAtom
= TimeP... | null | https://raw.githubusercontent.com/sealchain-project/sealchain/e97b4bac865fb147979cb14723a12c716a62e51e/pact/tests/Analyze/TimeGen.hs | haskell | with a few problematic ones disabled
| TimeQ
| Times
TimeQ -> "%Q"
Times -> "%s"
Timef -> "%f"
TODO: generalize
caution: locale-dependent
caution: locale-dependent
caution: locale-dependent
TimeQ -> "%Q"
Times -> "%s"
caution: locale-dependent
Timef -> | # LANGUAGE LambdaCase #
Hedgehog generators of times
module Analyze.TimeGen where
import Hedgehog hiding (Update)
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import qualified Text.Printf as T
data TimeFormatAtom
= TimePercent
| Timez
| TimeN
| TimeZ
|... |
b392a43aa150e0470fe068174988868a423387e49944fb03eebb05307354a4b0 | lipas-liikuntapaikat/lipas | reachability.clj | (ns lipas.backend.analysis.reachability
(:require
[clojure.set :as set]
[clojure.string :as str]
[lipas.backend.analysis.common :as common]
[lipas.backend.gis :as gis]
[lipas.backend.osrm :as osrm]
[lipas.data.types :as types]
[lipas.utils :as utils]))
(defn calc-distances
[source-fcoll popula... | null | https://raw.githubusercontent.com/lipas-liikuntapaikat/lipas/b49e5479582462f61462b643552c4118725d6438/webapp/src/clj/lipas/backend/analysis/reachability.clj | clojure | travel time
distance
Combine distance and travel-time calculations to demographics
Resolve zones
Sum by metric, profile, zone and demography
Report generation ;;;; | (ns lipas.backend.analysis.reachability
(:require
[clojure.set :as set]
[clojure.string :as str]
[lipas.backend.analysis.common :as common]
[lipas.backend.gis :as gis]
[lipas.backend.osrm :as osrm]
[lipas.data.types :as types]
[lipas.utils :as utils]))
(defn calc-distances
[source-fcoll popula... |
e789fe47f1aae1833e231995169041c7431528b40eab8c915c4830a85bd04911 | thosmos/riverdb | development_preload.cljs | (ns riverdb.development-preload
(:require
[com.fulcrologic.fulcro.algorithms.timbre-support :as ts]
[taoensso.timbre :as log]
[clojure.string :as str]))
(js/console.log "Turning logging to :debug (in app.development-preload)")
(log/set-level! :debug)
(log/merge-config! {:output-fn ts/prefix-output-fn
... | null | https://raw.githubusercontent.com/thosmos/riverdb/db4567b7eb957d9ee668525c8f48133421dd53e2/src/main/riverdb/development_preload.cljs | clojure | (ns riverdb.development-preload
(:require
[com.fulcrologic.fulcro.algorithms.timbre-support :as ts]
[taoensso.timbre :as log]
[clojure.string :as str]))
(js/console.log "Turning logging to :debug (in app.development-preload)")
(log/set-level! :debug)
(log/merge-config! {:output-fn ts/prefix-output-fn
... | |
4e12d70b4cb16d87e5f74926c58da8a09b85286792bd2a8012377ac3b28af8cb | mankyKitty/fantastic-waddle | Squares.hs | # LANGUAGE NoMonomorphismRestriction #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE ViewPatterns #-}
module SVG.Squares
( squares
) where
import Control.Applicative (liftA2, liftA3)
import Control.Lens (at... | null | https://raw.githubusercontent.com/mankyKitty/fantastic-waddle/680ca473bf7141c63528195ae23cb799b2fb0eac/frontend/src/SVG/Squares.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RecursiveDo #
# LANGUAGE ViewPatterns #
makeSquarePath
:: Size
-> Float
-> Float
-> SVG_Path
makeSquarePath sz x y =
let
in
D $ P._M sX sY :|
a > b
b > c
c > d
d > a
]
createPath
:: ( MonadRandom m
)... | # LANGUAGE NoMonomorphismRestriction #
module SVG.Squares
( squares
) where
import Control.Applicative (liftA2, liftA3)
import Control.Lens (at, mapped, over, to, views,
( # ), (%~), (+~), (?~), (^.), _1,
... |
ff6b8fd20df6b7591a417f8c35d789bb74f1273d6150de82ca6cb7f7452bc888 | haskell-CI/hackage-matrix-builder | Badge.hs | # LANGUAGE BangPatterns #
{-# LANGUAGE LambdaCase #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
-- |
Copyright : © 2018
SPDX - License - Identifier : GPL-3.0 - or - later
--
module Controller.Badge
( Badge(..)
, badgeR... | null | https://raw.githubusercontent.com/haskell-CI/hackage-matrix-builder/bb813e9e4cf0d08352f33004c00ede987f45da56/src-exe/Controller/Badge.hs | haskell | # LANGUAGE LambdaCase #
|
impossible
impossible
| Quick'n'dirty SVG generation | # LANGUAGE BangPatterns #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
Copyright : © 2018
SPDX - License - Identifier : GPL-3.0 - or - later
module Controller.Badge
( Badge(..)
, badgeRender
, badgeEtag
, SVG
) where
i... |
60cced0faf8416f1082e65b1ad8f21dd29ad3ca07a778e1eeaf159f14fe97534 | philnguyen/soft-contract | gregor-structs.rkt | #lang racket/base
(require
"core-structs.rkt")
(provide
(struct-out Date)
(struct-out Time)
(struct-out DateTime)
(struct-out Moment))
;; Structs from the main gregor modules
;; `date.rkt`, `time.rkt`, `datetime.rkt`, `moment-base.rkt`
(struct Date (ymd ;: YMD]
jdn ;: Integer]))
))
: ]
... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/gradual-typing-benchmarks/gregor/gregor-structs.rkt | racket | Structs from the main gregor modules
`date.rkt`, `time.rkt`, `datetime.rkt`, `moment-base.rkt`
: YMD]
: Integer]))
: Natural]))
: Date]
: Time]
: Exact-Rational]))
: DateTime]
: Integer]
: (U String #f)])) | #lang racket/base
(require
"core-structs.rkt")
(provide
(struct-out Date)
(struct-out Time)
(struct-out DateTime)
(struct-out Moment))
))
: ]
))
))
))
|
dd6b7139ee30ef0d7314a4a96ad3a4c270ce148b701798b96a433d9a39aecb6b | spurious/snd-mirror | freeverb.scm | ;;; freeverb.scm -- CLM -> Snd/Scheme translation of freeverb.ins
Translator / Author : < >
Last : Thu Apr 24 01:32:15 CEST 2003
Version : $ Revision : 1.2 $
Original notes of
Freeverb - Free , studio - quality reverb SOURCE CODE in the public domain
;;
Written by Jezar at Dreampoint , June 2000
;... | null | https://raw.githubusercontent.com/spurious/snd-mirror/8e7a643c840592797c29384ffe07c87ba5c0a3eb/freeverb.scm | scheme | freeverb.scm -- CLM -> Snd/Scheme translation of freeverb.ins
/~nando/clm/freeverb/
stream (in the latter case the number of channels of the input and output
streams must match.
- the "wet" parameter has been eliminated as it does not apply to the model
- the "width" parameter name has been changed to :g... |
Translator / Author : < >
Last : Thu Apr 24 01:32:15 CEST 2003
Version : $ Revision : 1.2 $
Original notes of
Freeverb - Free , studio - quality reverb SOURCE CODE in the public domain
Written by Jezar at Dreampoint , June 2000
Translated into clm-2 by < >
Version 1.0 for clm-2 released i... |
b3abb8adc9749b7de9198d82a709e76c2e8b4ad773d17ccc2c28d7e2e1da2d90 | ijvcms/chuanqi_dev | everyday_sign_lib.erl | %%%-------------------------------------------------------------------
%%% @author tuhujia
( C ) 2016 , < COMPANY >
%%% @doc 每日签到活动
%%%
%%% @end
Created : 23 . 二月 2016 18:06
%%%-------------------------------------------------------------------
-module(everyday_sign_lib).
-include("common.hrl").
-include("record.... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/active/everyday_sign_lib.erl | erlang | -------------------------------------------------------------------
@author tuhujia
@doc 每日签到活动
@end
-------------------------------------------------------------------
----------------------------------------------------------------------------
对外接口
--------------------------------------------------------------... | ( C ) 2016 , < COMPANY >
Created : 23 . 二月 2016 18:06
-module(everyday_sign_lib).
-include("common.hrl").
-include("record.hrl").
-include("config.hrl").
-include("cache.hrl").
-include("db_record.hrl").
-include("proto.hrl").
-include("language_config.hrl").
-include("log_type_config.hrl").
-export([
send_play... |
b02f0ff82795c9be12fa4c50c8b974fdff8907265536bf22cd51260d71936a14 | mokus0/junkbox | Block.hs | -- |List block-memoization helpers
--
-- Example usage:
--
> fib 0 = 0
> fib 1 = 1
-- > fib n = fib (n-2) + fib (n-1)
> where fib = unblock fibs
-- >
> fibs = block 0 squares ( map fib [ 0 .. ] )
> squares = ( + ) [ 1,3 .. ]
module Block where
import Data.Array
import Control.Monad
-- |Given a start... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Functions/Block.hs | haskell | |List block-memoization helpers
Example usage:
> fib n = fib (n-2) + fib (n-1)
>
|Given a starting logical offset, a list of chunk sizes, and a list of values,
pack the values into several arrays of the given sizes, with array indices
corresponding to the logical offset of the element in the value list.
|Lo... | > fib 0 = 0
> fib 1 = 1
> where fib = unblock fibs
> fibs = block 0 squares ( map fib [ 0 .. ] )
> squares = ( + ) [ 1,3 .. ]
module Block where
import Data.Array
import Control.Monad
block :: (Integral i, Ix i) => i -> [i] -> [e] -> [Array i e]
block _ _ [] = []
block start (sz:szs) list = case split... |
4ac35a45330a0199b88fe6f3de0cfe4cbc03235daa500101769063a9d6e90e89 | maxlapshin/nfs3 | mount3_xdr.erl | %%
%% mount3_xdr was generated by erpcgen (do not edit)
date : Dec 2 23:48:17 2012
%%
-module(mount3_xdr).
-export([enc_fhandle/1, dec_fhandle/2]).
-export([enc_fhandle3/1, dec_fhandle3/2]).
-export([enc_fhstatus/1, dec_fhstatus/2]).
-export([enc_mountstat3/1, dec_mountstat3/2]).
-export([enc_mountres3_ok/1, dec_moun... | null | https://raw.githubusercontent.com/maxlapshin/nfs3/a10fee483ec2203b1eb1d87b87d5b04c838f6ffa/src/mount3_xdr.erl | erlang |
mount3_xdr was generated by erpcgen (do not edit)
| date : Dec 2 23:48:17 2012
-module(mount3_xdr).
-export([enc_fhandle/1, dec_fhandle/2]).
-export([enc_fhandle3/1, dec_fhandle3/2]).
-export([enc_fhstatus/1, dec_fhstatus/2]).
-export([enc_mountstat3/1, dec_mountstat3/2]).
-export([enc_mountres3_ok/1, dec_mountres3_ok/2]).
-export([enc_mountres3/1, dec_mountres3/2]).
... |
237908cc13d96c77a2e323159cea48c7951f58c2246a5536766288ee72ca9576 | talex5/wayland-proxy-virtwl | composite.ml | open Lwt.Syntax
type t = {
x11 : Display.t;
major_opcode : int;
}
module QueryVersion = struct
[%%cstruct
type req = {
client_major_version : uint32_t;
client_minor_version : uint32_t;
} [@@little_endian]
]
[%%cstruct
type reply = {
opcode : uint8_t;
pad1 : uint8_t;
... | null | https://raw.githubusercontent.com/talex5/wayland-proxy-virtwl/0316db2f1ee1a6bcdf7328bc4d4b8de41506ec54/x11/composite.ml | ocaml | open Lwt.Syntax
type t = {
x11 : Display.t;
major_opcode : int;
}
module QueryVersion = struct
[%%cstruct
type req = {
client_major_version : uint32_t;
client_minor_version : uint32_t;
} [@@little_endian]
]
[%%cstruct
type reply = {
opcode : uint8_t;
pad1 : uint8_t;
... | |
4914ed12c346636c1a6f855915797e4ac839bb5f3b80e7f9bde80cfb41610d2a | webyrd/mediKanren | semmed-index-predicate.rkt | #lang racket/base
(require
"edge.rkt"
racket/file
)
(define argv (current-command-line-arguments))
(define argv-expected '#(SEMMED_DIR))
(define semmed-dir (vector-ref argv 0))
(define ebs-detail-file (build-path semmed-dir "edge-by-subject/detail.bin"))
(define ebp-dir (build-path semmed-dir "edge-by-predicate... | null | https://raw.githubusercontent.com/webyrd/mediKanren/a2b80ea94f66bcdd4305b9369ad4184c2afe9829/attic/code/semmed-index-predicate.rkt | racket | #lang racket/base
(require
"edge.rkt"
racket/file
)
(define argv (current-command-line-arguments))
(define argv-expected '#(SEMMED_DIR))
(define semmed-dir (vector-ref argv 0))
(define ebs-detail-file (build-path semmed-dir "edge-by-subject/detail.bin"))
(define ebp-dir (build-path semmed-dir "edge-by-predicate... | |
5c750f335117ff1aaf0e18379a61f4b24fdc58febef505b841738487c4997d2a | SKA-ScienceDataProcessor/RC | GridMe.hs | # OPTIONS_GHC -fno - warn - orphans #
import qualified Data.Map as M
import Data.List (delete)
import System.IO (
openBinaryFile
, hClose
, IOMode(..)
, hPutBuf
)
import System.IO.MMap (
mmapFilePtr
, munmapFilePtr
, Mode(..)
)
import Control.Exception (bracket)
import qualified Control.Distribut... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS2/CloudGridder/src/GridMe.hs | haskell | For current fake workers which simply
return the copies of inputs
Main
No clutter with newtypes to make code shorter and clearer.
Stubs
FIXME: Put genuine computations here. For now they only make plain copies for tests.
This is deliberately made to be scalable to any number of tasks!
Sets are represented as l... | # OPTIONS_GHC -fno - warn - orphans #
import qualified Data.Map as M
import Data.List (delete)
import System.IO (
openBinaryFile
, hClose
, IOMode(..)
, hPutBuf
)
import System.IO.MMap (
mmapFilePtr
, munmapFilePtr
, Mode(..)
)
import Control.Exception (bracket)
import qualified Control.Distribut... |
34176cc1cff5308f1e0187428ca3bde7901fdcffa6c68c7f517a6288bc866dc4 | racket/math | beta-dist.rkt | #lang typed/racket/base
(require racket/fixnum
racket/performance-hint
racket/promise
"../../flonum.rkt"
"../unsafe.rkt"
"../functions/beta.rkt"
"../functions/incomplete-beta.rkt"
"impl/beta-pdf.rkt"
"impl/beta-inv-cdf.rkt"
"impl/gamma-ra... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/distributions/beta-dist.rkt | racket | #lang typed/racket/base
(require racket/fixnum
racket/performance-hint
racket/promise
"../../flonum.rkt"
"../unsafe.rkt"
"../functions/beta.rkt"
"../functions/incomplete-beta.rkt"
"impl/beta-pdf.rkt"
"impl/beta-inv-cdf.rkt"
"impl/gamma-ra... | |
9747c870b95745c8dcc7eae9fa6812e542b66d808f062039d46a5a9c19918a87 | d-cent/coracle | config.clj | (ns coracle.test.config
(:require [midje.sweet :refer :all]
[coracle.config :as config]))
(facts "about docker mongo host"
(fact "use mongodb host if present"
(with-redefs [config/environment {:mongodb-host "mongohost"
:mongodb-port 1234
... | null | https://raw.githubusercontent.com/d-cent/coracle/da10a7d4b557bb2ab6996e09d99cee5f1ba994e9/test/coracle/test/config.clj | clojure | (ns coracle.test.config
(:require [midje.sweet :refer :all]
[coracle.config :as config]))
(facts "about docker mongo host"
(fact "use mongodb host if present"
(with-redefs [config/environment {:mongodb-host "mongohost"
:mongodb-port 1234
... | |
8599d1cc8cb4f35ebdc56dc3ee8c8328d8a49559440acc6fb7c1fdf9f5a90c06 | Vaguery/klapaucius | quoted.clj | (ns push.type.definitions.quoted)
(defrecord QuotedCode [value])
(defn push-quote
"takes any Push item (single literal, keyword, or code block) and returns a QuotedCode Push item with that value; if the item is nil, returns nil"
[item]
(if (nil? item) nil (->QuotedCode item)))
(defn quoted-code?
"a type c... | null | https://raw.githubusercontent.com/Vaguery/klapaucius/17b55eb76feaa520a85d4df93597cccffe6bdba4/src/push/type/definitions/quoted.clj | clojure | (ns push.type.definitions.quoted)
(defrecord QuotedCode [value])
(defn push-quote
"takes any Push item (single literal, keyword, or code block) and returns a QuotedCode Push item with that value; if the item is nil, returns nil"
[item]
(if (nil? item) nil (->QuotedCode item)))
(defn quoted-code?
"a type c... | |
47a75c7ddc0aba41de2d71afe023cb463f33492c83226122ff7631f81362a9d9 | clojure-clutch/clutch | type.clj | (ns clutch.test.type
(:use clojure.test
com.ashafa.clutch
[test-clutch :only (defdbtest test-database-name test-database-url *test-database*)])
(:refer-clojure :exclude (conj! assoc! dissoc!)))
(deftest create
(let [name (test-database-url (test-database-name "create-type"))
db (couch nam... | null | https://raw.githubusercontent.com/clojure-clutch/clutch/62d5ae95b975e3bd072d83b55dfea540cb7e19f8/test/clutch/test/type.clj | clojure | (ns clutch.test.type
(:use clojure.test
com.ashafa.clutch
[test-clutch :only (defdbtest test-database-name test-database-url *test-database*)])
(:refer-clojure :exclude (conj! assoc! dissoc!)))
(deftest create
(let [name (test-database-url (test-database-name "create-type"))
db (couch nam... | |
cc7dc436b3f6d8d346e9cce061e6e0e8b2b0d173dd5b016a399214b4885f5cd1 | elaforge/karya | Mark.hs | Copyright 2021
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Ui.Meter.Mark (
Marklist, MarklistVector
, marklist, marklist_from_vector
, empty
, to_list
, ascending, descending
, end, start
, insert_mark
, Mark... | null | https://raw.githubusercontent.com/elaforge/karya/a6638f16da9f018686023977c1292d6ce5095e28/Ui/Meter/Mark.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
* for RulerC's eyes only
its own reference count.
I think this should be safe as long as 'marklist' is the only
constructor.
| This should be opaque, but it needs to be exported for RulerC. Don't look
in... | Copyright 2021
module Ui.Meter.Mark (
Marklist, MarklistVector
, marklist, marklist_from_vector
, empty
, to_list
, ascending, descending
, end, start
, insert_mark
, Mark(..)
, Label
, MarklistPtr(..)
, marklist_vec, marklist_fptr
) where
import qualified Control.Concur... |
13469ac3cc9009bb270abc94617309d9353f54aedf839223a7598e8b5f9a9620 | singleheart/programming-in-haskell | ex9a.hs | sum' :: Num p => [p] -> p
sum' [] = 0
sum' (x:xs) = x + sum' xs
| null | https://raw.githubusercontent.com/singleheart/programming-in-haskell/80c7efc0425babea3cd982e47e121f19bec0aba9/ch06/ex9a.hs | haskell | sum' :: Num p => [p] -> p
sum' [] = 0
sum' (x:xs) = x + sum' xs
| |
975eddb84aa7b34c6ec231a8f57d856f0187963627750065f0243c971423e60d | jeromesimeon/Galax | code_typing_context.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/code_selection/code_typing_context.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : code_typing_context.mli , v 1.5 2007/02/01 22:08:45 simeon Exp $
open Xquery_common_ast
type code_type_context
val default_code_type_context : code_type_context
val add_variable_type : code_type_context -> cvname -> Xquery_physi... |
4b209b72caf93e3a0d2c144d4c0af03a8ef9ad64ab3ee8d2732674f0163c121c | eudoxia0/trivial-ssh | solutions.lisp | (in-package :libssh2)
(defvar *session* nil)
(defmethod method-of ((auth auth-password)) :PASSWORD)
(defmethod method-of ((auth auth-publickey)) :PUBLICKEY)
(defmethod method-of ((auth auth-agent)) :PUBLICKEY)
(defmethod authentication ((ssh ssh-connection) (auth-list list))
(unless (or (null auth-list) (not ... | null | https://raw.githubusercontent.com/eudoxia0/trivial-ssh/b0e85a465aec2dc899f69bbf6b4e3bff3cd90103/libssh2/solutions.lisp | lisp | (in-package :libssh2)
(defvar *session* nil)
(defmethod method-of ((auth auth-password)) :PASSWORD)
(defmethod method-of ((auth auth-publickey)) :PUBLICKEY)
(defmethod method-of ((auth auth-agent)) :PUBLICKEY)
(defmethod authentication ((ssh ssh-connection) (auth-list list))
(unless (or (null auth-list) (not ... | |
54ce6017b422cf344f48a4c132af9203d93d02ae0a47fb69c4dfcfd3ac5597f9 | rosejn/byte-spec | bytes_test.clj | (ns bytes-test
(:use
clojure.test
byte-spec))
(defspec basic-type-spec
:a :int8
:b :int16
:c :int32
:d :float32
:e :float64
:f :string)
(deftest basic-type-test []
(let [a {:a 1 :b 2 :c 3 :d 4 :e 5 :f "six"}
b (bytes-and-back basic-type-spec ... | null | https://raw.githubusercontent.com/rosejn/byte-spec/183a9a5d47c06e92ebc2e8312d3bcd7fc9684350/test/bytes_test.clj | clojure | (ns bytes-test
(:use
clojure.test
byte-spec))
(defspec basic-type-spec
:a :int8
:b :int16
:c :int32
:d :float32
:e :float64
:f :string)
(deftest basic-type-test []
(let [a {:a 1 :b 2 :c 3 :d 4 :e 5 :f "six"}
b (bytes-and-back basic-type-spec ... | |
73f68776b923ada8e4690ef93266bfb9cae72025932ab7cab94297a6eb49bc59 | rizo/snowflake-os | e1000.ml |
open PCI
module Int32Ops = struct
let ( +! ) = Int32.add
let ( -! ) = Int32.sub
let ( *! ) = Int32.mul
let ( /! ) = Int32.div
let ( &! ) = Int32.logand
let ( |! ) = Int32.logor
let ( >>! ) = Int32.shift_right_logical
let ( <<! ) = Int32.shift_left
let ( ~! ) = Int32.lognot
let ( ^! ) = Int32.lo... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/e1000.ml | ocaml | microwire
create the driver instance
get the location of the EEPROM
and some helper functions to read/write to the EEPROM
nic stuff, done here to use the helper methods
need to start at right-most array entry, so bits.(n-1) will work
special case when reading single word
sanity checking omitted
we stil... |
open PCI
module Int32Ops = struct
let ( +! ) = Int32.add
let ( -! ) = Int32.sub
let ( *! ) = Int32.mul
let ( /! ) = Int32.div
let ( &! ) = Int32.logand
let ( |! ) = Int32.logor
let ( >>! ) = Int32.shift_right_logical
let ( <<! ) = Int32.shift_left
let ( ~! ) = Int32.lognot
let ( ^! ) = Int32.lo... |
4422908df61d9a9be571b8d627862c1e87ae4f835aef763f75e06cabc00a1244 | mokus0/junkbox | primes2.hs |
-- Early haskell experimentation, with some later updates.
module Math.Main where
import System
import Data.List
-- congruent: given a modulus and a (ordered) list of numbers less than the
-- modulus, generate an infinite (ordered) list of numbers congruent to the
-- numbers in the list modulo the given modulus
co... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Math/primes2.hs | haskell | Early haskell experimentation, with some later updates.
congruent: given a modulus and a (ordered) list of numbers less than the
modulus, generate an infinite (ordered) list of numbers congruent to the
numbers in the list modulo the given modulus
x %= y: "x divides y"
highlyComposite 1 = True
Non-computational p... |
module Math.Main where
import System
import Data.List
congruent modulus list = _congruent 0
where _congruent x = (map (+x) list) ++ (_congruent $! (x + modulus))
wheel30 = congruent 30 [1,7,11,13,17,19,23,29]
skipTo x (y:ys) = if (y > x) then (y:ys) else skipTo x ys
primes = 2 : 3: 5 : (filter isPrime (skipTo ... |
8cf72fec971690c417a30e4ae904692cbd245b0f8ee83fb36c140f4e10fb8d80 | MLstate/opalang | langAst.mli |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/compilerlib/langAst.mli | ocaml | *
*
* {6 Pattern Matching on AST} |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... |
22db5971b64752ae2da581cd3d36d78f5d4f9306a36d829147b4c8726ac57f98 | seralbdev/protocool | build.clj | (ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'seralbdev/protocool)
( def version ( format " 1.2.%s " ( b / git - count - revs nil ) ) )
(def version "0.1.0")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) versi... | null | https://raw.githubusercontent.com/seralbdev/protocool/f190ce51621dab9d407ac7997b083541d7897a6f/build.clj | clojure | (ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'seralbdev/protocool)
( def version ( format " 1.2.%s " ( b / git - count - revs nil ) ) )
(def version "0.1.0")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) versi... | |
e21a5f735f50671b2c241fd9e462f3a1655b4e337488207689acb66c1ca03e34 | audreyt/openafp | UDTS.hs | module OpenAFP.Records.T.UDTS where
import OpenAFP.Types
import OpenAFP.Internals
data T_UDTS = T_UDTS {
t_udts_Type :: !N1
,t_udts :: !NStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/T/UDTS.hs | haskell | module OpenAFP.Records.T.UDTS where
import OpenAFP.Types
import OpenAFP.Internals
data T_UDTS = T_UDTS {
t_udts_Type :: !N1
,t_udts :: !NStr
} deriving (Show, Typeable)
| |
62a9ffa301219287fe1f180e7c47d994bb3822d77b9d8e3de2ef383b93d802e1 | alakahakai/hackerrank | solveMeFirst.hs | getV :: (Int -> Bool) -> IO Int
getV p = do
v <- getLine
let num = read v :: Int
if p num
then return num
else do
putStrLn "Invalid input"
getV p
main :: IO ()
main = do
val1 <- getV (>=1)
val2 <- getV (<=1000)
let sum = val1 + val2
print sum
| null | https://raw.githubusercontent.com/alakahakai/hackerrank/465d17107bbe402daf750651bb57cf092305acf9/fp/solveMeFirst.hs | haskell | getV :: (Int -> Bool) -> IO Int
getV p = do
v <- getLine
let num = read v :: Int
if p num
then return num
else do
putStrLn "Invalid input"
getV p
main :: IO ()
main = do
val1 <- getV (>=1)
val2 <- getV (<=1000)
let sum = val1 + val2
print sum
| |
99e7c79f5e2aeb616557763bcb7bb7574d1dbc58ab3e20d21e7cb85fc49b0024 | racket/games | info.rkt | #lang info
(define game-set "Puzzle Games")
(define game "slidey-main.rkt")
| null | https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/slidey/info.rkt | racket | #lang info
(define game-set "Puzzle Games")
(define game "slidey-main.rkt")
| |
71593676062480420ad20a645c2b11e0bd741e4cde6e40634bef821a0feffb87 | johnswanson/tictag | slack.clj | (ns tictag.slack
(:require [org.httpkit.client :as http]
[com.stuartsierra.component :as component]
[cheshire.core :as json]
[clojure.string :as str]
[oauth.v2 :as v2]
[taoensso.timbre :as timbre]
[tictag.utils :as utils]
[diehard.cor... | null | https://raw.githubusercontent.com/johnswanson/tictag/89140b5084817690ec417b07b7d095ba7677f4e0/src/clj/tictag/slack.clj | clojure | (ns tictag.slack
(:require [org.httpkit.client :as http]
[com.stuartsierra.component :as component]
[cheshire.core :as json]
[clojure.string :as str]
[oauth.v2 :as v2]
[taoensso.timbre :as timbre]
[tictag.utils :as utils]
[diehard.cor... | |
0871e904f61dd8d9001fd04a7575503d6b42456ceef3256153d9a8881d920e92 | russolsen/cloforth | tokenizer.clj | (ns cloforth.tokenizer
(:import (clojure.lang LineNumberingPushbackReader))
(:use [clojure.java.io :as jio]))
(defn to-int [string]
(try
(Long/parseLong string)
(catch Exception e nil)))
(defn- to-char [i]
;;(println "to char:" i)
(if (< i 0) i (char i)))
(defn- get-ch [r]
;;(println "get ch: " r... | null | https://raw.githubusercontent.com/russolsen/cloforth/226c5f7a648f0923e321bc858518a687e0496cf4/src/cloforth/tokenizer.clj | clojure | (println "to char:" i)
(println "get ch: " r)
(flush)
) {:state :comment }
(println "read token: " r) | (ns cloforth.tokenizer
(:import (clojure.lang LineNumberingPushbackReader))
(:use [clojure.java.io :as jio]))
(defn to-int [string]
(try
(Long/parseLong string)
(catch Exception e nil)))
(defn- to-char [i]
(if (< i 0) i (char i)))
(defn- get-ch [r]
(when (and (instance? LineNumberingPushbackReader ... |
735c3b5f280d46c51ad86acd697dd8dac8dd038982db9987a9db7e4e09910ce9 | dongcarl/guix | wget.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 < >
Copyright © 2014 , 2015 , 2017 , 2018 < >
Copyright © 2016 , 2017 , 2019 , 2020 < >
Copyright © 2017 < >
Copyright © 2018–2021 < >
Copyright © 2020 Jan ( janneke ) Nieuwenhuizen < >
;;;
;;; This file is part of GNU... | null | https://raw.githubusercontent.com/dongcarl/guix/d2b30db788f1743f9f8738cb1de977b77748567f/gnu/packages/wget.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 < >
Copyright © 2014 , 2015 , 2017 , 2018 < >
Copyright © 2016 , 2017 , 2019 , 2020 < >
Copyright © 2017 < >
Copyright © 2018–2021 < >
Copyright © 2020 Jan ( janneke ) Nieuwenhuizen < >
under the terms of the GNU General Public License as published by
You should have r... |
958464d74c99298dc09963b90e56870ebb1c15a9724dda6db9033c712e66b0ef | imartayan/KerLang | gklc.ml | *
{ 1 The glorious KerLang Compiler }
also known as the glorious Ker - Lann Compiler but who cares ?
{1 The glorious KerLang Compiler}
also known as the glorious Ker-Lann Compiler but who cares ?
*)
* a KerLang file and print the result of the parsing
let parse_file f =
let lexbuf = Lexing.from_... | null | https://raw.githubusercontent.com/imartayan/KerLang/d55f09cec389671c753b6b24186ed9a465623594/bin/gklc.ml | ocaml | *
{ 1 The glorious KerLang Compiler }
also known as the glorious Ker - Lann Compiler but who cares ?
{1 The glorious KerLang Compiler}
also known as the glorious Ker-Lann Compiler but who cares ?
*)
* a KerLang file and print the result of the parsing
let parse_file f =
let lexbuf = Lexing.from_... | |
76f1244698bee4c4cf2f2ee851c24f6dbe96877b7d4bbfaa9cc55315d3c6ce67 | dmjio/bittrex | Types.hs | --------------------------------------------------------------------------------
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
---------------------------... | null | https://raw.githubusercontent.com/dmjio/bittrex/423750e748efaf38c6aa9b79b56d9fdaf57c8d72/src/Bittrex/Types.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE DeriveGeneric #
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
---... |
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
module Bittrex.Types where
import Data.Aeson
import qualified Data.Aeson.Types as Aeson
import Data.Fixed
import Data.Scientific
import Data.Text ... |
6788ad5e3083e6225765d24885634ceeade004a0c099fff308858dc42bb7a70e | denismerigoux/soutenance | cli.ml | This file is part of the Catala compiler , a specification language for tax and social benefits
computation rules . Copyright ( C ) 2021 < >
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 ... | null | https://raw.githubusercontent.com/denismerigoux/soutenance/acb82a09efdbcfd0e0435f513abbb0d18c9700bc/src/cli.ml | ocaml | * Prints [\[ERROR\]] in red on the terminal error output
* Prints [\[RESULT\]] in green on the terminal standard output
* Prints [\[LOG\]] in red on the terminal error output
* The int argument of the prefix corresponds to the line number, starting at 0 | This file is part of the Catala compiler , a specification language for tax and social benefits
computation rules . Copyright ( C ) 2021 < >
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 ... |
1a7146592e602b724e5abf1dd7b4c7f529dcb915d2b941d678d7fad2f1dfcf03 | ocaml-sf/learn-ocaml-corpus | length_singleton.ml | let length (type a) (s : a seq) : int =
match s with
| Empty ->
0
| Singleton _ ->
0 (* wrong *)
| Sum (length, _, _) ->
length
| Product (length, _, _) ->
length
| Map (length, _, _) ->
length
let is_empty s =
length s = 0
let empty =
Empty
let singleton x =
Singleton... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/symbolic_sequences_data/wrong/length_singleton.ml | ocaml | wrong | let length (type a) (s : a seq) : int =
match s with
| Empty ->
0
| Singleton _ ->
| Sum (length, _, _) ->
length
| Product (length, _, _) ->
length
| Map (length, _, _) ->
length
let is_empty s =
length s = 0
let empty =
Empty
let singleton x =
Singleton x
let sum s1 s2 =
... |
322fd1c06105d27987c58588398b0d28d6817db28ef8a044fb847f67f8f6205f | willghatch/racket-rash | pipeline.rkt | #lang racket/base
(require "private/subprocess-pipeline.rkt")
(define run-pipeline run-subprocess-pipeline)
(define run-pipeline/out run-subprocess-pipeline/out)
(provide
(all-from-out "private/subprocess-pipeline.rkt")
run-pipeline
run-pipeline/out
)
| null | https://raw.githubusercontent.com/willghatch/racket-rash/c40c5adfedf632bc1fdbad3e0e2763b134ee3ff5/shell-pipeline/pipeline.rkt | racket | #lang racket/base
(require "private/subprocess-pipeline.rkt")
(define run-pipeline run-subprocess-pipeline)
(define run-pipeline/out run-subprocess-pipeline/out)
(provide
(all-from-out "private/subprocess-pipeline.rkt")
run-pipeline
run-pipeline/out
)
| |
0e1532e7d4a3e68a2f016ff86cac5d050f79d9284682a029f0b91b89a95034d0 | jaredly/reason-language-server | typeclass.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/407/typeclass.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Asttypes
open Types
open Format
type 'a class_info = {
cls_id : Ident.t;
cls_id_loc : string loc;
... |
f46e007504137e156401453fae7ce211a0c8c13ac9d528f918f47319a23e81bb | purcell/adventofcode2017 | Day09.hs | module Day09
( day09
) where
import Data.Functor (($>))
import Text.Parsec
import Text.Parsec.String (Parser, parseFromFile)
withInput :: FilePath -> Parser a -> IO a
withInput path p = do
result <- parseFromFile (p <* optional newline <* eof) path
either (error . show) return result
data Content
= Garbage... | null | https://raw.githubusercontent.com/purcell/adventofcode2017/745ddefbeb4fcb35a460606c5dad89118adef12a/src/Day09.hs | haskell | module Day09
( day09
) where
import Data.Functor (($>))
import Text.Parsec
import Text.Parsec.String (Parser, parseFromFile)
withInput :: FilePath -> Parser a -> IO a
withInput path p = do
result <- parseFromFile (p <* optional newline <* eof) path
either (error . show) return result
data Content
= Garbage... | |
7f4a6beef1967bf02de710b29378a50db53c2b0cb42b1db3ad4dad349ef2dd19 | JolifantoBambla/vk-generator | write-printers.lisp | (in-package :vk-generator)
(defun write-printers (printers-file vk-spec &optional dry-run)
(flet ((write-to-stream (out)
(format out ";;; this file is automatically generated, do not edit~%~%")
(format out "(in-package :vk)~%~%")
(loop for struct in (sorted-elements (alexandria:hash-... | null | https://raw.githubusercontent.com/JolifantoBambla/vk-generator/1e7cc481d611a4b0308e819980b59e63fbc74243/src/write-printers.lisp | lisp | (in-package :vk-generator)
(defun write-printers (printers-file vk-spec &optional dry-run)
(flet ((write-to-stream (out)
(format out ";;; this file is automatically generated, do not edit~%~%")
(format out "(in-package :vk)~%~%")
(loop for struct in (sorted-elements (alexandria:hash-... | |
8a6f69ca80c9c181ea331840cfee1c108f72137fa5293e0fc65eb77abd348073 | microsoft/SLAyer | Statistics.mli | Copyright ( c ) Microsoft Corporation . All rights reserved .
val report : Timer.t -> Timer.t -> Timer.t -> unit
| null | https://raw.githubusercontent.com/microsoft/SLAyer/6f46f6999c18f415bc368b43b5ba3eb54f0b1c04/src/Statistics.mli | ocaml | Copyright ( c ) Microsoft Corporation . All rights reserved .
val report : Timer.t -> Timer.t -> Timer.t -> unit
| |
aef1a7507e6dbc8336d3802c6f717d27eba4fb591464745a91d8cc04d85c22a1 | imdea-software/leap | DP.mli |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/solvers/theory/DP.mli | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
89365157a50bc280768dc02fe2e1ccf89d020436318ab0dfb6091d4fba0ff6fe | jaspervdj/hakyll | FileType.hs | --------------------------------------------------------------------------------
-- | A module dealing with pandoc file extensions and associated file types
module Hakyll.Web.Pandoc.FileType
( FileType (..)
, fileType
, itemFileType
) where
-------------------------------------------------------------... | null | https://raw.githubusercontent.com/jaspervdj/hakyll/00b5283e9e04f1cd945663ab29fa21ff2b331fcd/lib/Hakyll/Web/Pandoc/FileType.hs | haskell | ------------------------------------------------------------------------------
| A module dealing with pandoc file extensions and associated file types
------------------------------------------------------------------------------
------------------------------------------------------------------------------
---------... | module Hakyll.Web.Pandoc.FileType
( FileType (..)
, fileType
, itemFileType
) where
import System.FilePath (splitExtension)
import Hakyll.Core.Identifier
import Hakyll.Core.Item
| Datatype to represent the different file types Hakyll can deal with by
data Fil... |
8ecf1d88e6f26804a939186f0e4c42cc14f64e72793cfa6814886b5e3c50f369 | ixmatus/orgmode-parse | Section.hs | -----------------------------------------------------------------------------
-- |
Module : Data . . . . Section
Copyright : © 2015 Parnell Springmeyer
-- License : All Rights Reserved
Maintainer : Parnell Springmeyer < >
-- Stability : stable
--
-- Parsing combinators for org-mode he... | null | https://raw.githubusercontent.com/ixmatus/orgmode-parse/89adc4087556bb0dd58a7648a9e7e239463aa059/src/Data/OrgMode/Parse/Attoparsec/Section.hs | haskell | ---------------------------------------------------------------------------
|
License : All Rights Reserved
Stability : stable
Parsing combinators for org-mode headline sections.
--------------------------------------------------------------------------
| Parse a heading section
Headline sections contai... | Module : Data . . . . Section
Copyright : © 2015 Parnell Springmeyer
Maintainer : Parnell Springmeyer < >
module Data.OrgMode.Parse.Attoparsec.Section where
import Control.Applicative (optional)
import Data.Attoparsec.Text (many', opt... |
68920ef4f3afa2733755cffcbfb424d6bcbdcbf252db9d0111b5ffe5bb5984b6 | maranget/hevea | get.mli | (***********************************************************************)
(* *)
(* HEVEA *)
(* *)
, projet , INRIA R... | null | https://raw.githubusercontent.com/maranget/hevea/226eac8c506f82a600d453492fbc1b9784dd865f/get.mli | ocaml | *********************************************************************
HEVEA
... | , projet , INRIA Rocquencourt
Copyright 2001 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
$ I d : get.mli , v 1.12 2001 - 05 - 25 12:37:22 maranget Exp $
open Lexstate
exception Error of string... |
b662bc9ad0e5ccdfd7eab7db667fdd00fb54c909b77bbc073aa5fe7563eda37e | scicloj/tablecloth.time | adjust_frequency.clj | (ns tablecloth.time.api.adjust-frequency
(:require [tech.v3.datatype :refer [emap]]
[tablecloth.time.api.indexing :refer [rename-index]]
[tablecloth.time.utils.indexing :refer [get-index-column-or-error]]
[tablecloth.time.utils.datatypes :refer [get-datatype]]
[tableclo... | null | https://raw.githubusercontent.com/scicloj/tablecloth.time/a2571dfd42dd7f0264eda40f0f1f43f031fb07a0/src/tablecloth/time/api/adjust_frequency.clj | clojure | (ns tablecloth.time.api.adjust-frequency
(:require [tech.v3.datatype :refer [emap]]
[tablecloth.time.api.indexing :refer [rename-index]]
[tablecloth.time.utils.indexing :refer [get-index-column-or-error]]
[tablecloth.time.utils.datatypes :refer [get-datatype]]
[tableclo... | |
dbc1cbf588be7f64aaa66423d0c05b3ad60700d047d7d1ecb2100712712fa139 | rmloveland/scheme48-0.53 | scheduler.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; A parameterized scheduler.
; (run-threads event-handler) -> unspecific
; (event-handler thread time-left event event-data) -> [thread args time]
A bogus BLOCKED event is passed to the handler to get the initial thread .
(define (run-threads event-ha... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/rts/scheduler.scm | scheme | A parameterized scheduler.
(run-threads event-handler) -> unspecific
(event-handler thread time-left event event-data) -> [thread args time]
Same thing, with the addition of a housekeeping thunk that gets
run periodically.
An event-handler that does round-robin scheduling.
Arguments:
runnable ; que... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
A bogus BLOCKED event is passed to the handler to get the initial thread .
(define (run-threads event-handler)
(call-with-values
(lambda ()
(event-handler #f 0 (enum event-type blocked) '()))
(lambda (thread time)
(if thread
(let loo... |
b8e39cfeb9b866760f1ff9c7c3a41922d03666b93c5505c6836c9430d3da47d6 | google/hrepl | ExecutionRoot.hs | {-# LANGUAGE OverloadedStrings #-}
module RuleInfo.ExecutionRoot
( ExecutionRoot
, executionRootPath
, getExecutionRoot
, fixFilePathFlags
, toAbsolute
, toAbsoluteT
, fakeExecutionRoot -- For testing
) where
import Control.Monad (guard)
import Data.List.Extra (firstJust)
import qualifi... | null | https://raw.githubusercontent.com/google/hrepl/2648a55cc38407c5b60a3a086217e2d827ca6cb6/rule_info/RuleInfo/ExecutionRoot.hs | haskell | # LANGUAGE OverloadedStrings #
For testing
| Construct an execution root from a filepath. Should be used for testing.
| Some flags include google3-relative file paths, and they don't work with
execution root directory.
Handles cases like "-foo" "bar".
Handles cases like "-foo=bar".
| Converts the file path argu... | module RuleInfo.ExecutionRoot
( ExecutionRoot
, executionRootPath
, getExecutionRoot
, fixFilePathFlags
, toAbsolute
, toAbsoluteT
) where
import Control.Monad (guard)
import Data.List.Extra (firstJust)
import qualified Data.Text as T
import Data.Text (Text)
import Bazel (BazelOpts, bazelIn... |
cbb15911b1785038992d3e5e804ff97b1cb8beda6fb170cec0c3a35f3c121281 | oakes/Nightweb | formats.clj | (ns nightweb.formats
(:require [nightweb.constants :as c]
[nightweb.crypto :as crypto])
(:import [java.io ByteArrayInputStream]
[org.klomp.snark.bencode BEncoder BDecoder BEValue]))
(defn remove-dupes-and-nils
[the-list]
(->> the-list
distinct
(remove nil?)))
(defn is-nume... | null | https://raw.githubusercontent.com/oakes/Nightweb/089c7a99a9a875fde33cc29d56e1faf54dc9de84/common/clojure/nightweb/formats.clj | clojure | "}))) | (ns nightweb.formats
(:require [nightweb.constants :as c]
[nightweb.crypto :as crypto])
(:import [java.io ByteArrayInputStream]
[org.klomp.snark.bencode BEncoder BDecoder BEValue]))
(defn remove-dupes-and-nils
[the-list]
(->> the-list
distinct
(remove nil?)))
(defn is-nume... |
1c0b30c7ea009994477e34146a9b677d46e17ad970a7cb40eb504798058e80d6 | project-oak/hafnium-verification | PulseAbductiveDomain.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/pulse/PulseAbductiveDomain.ml | ocaml | private because the lattice is not the same for preconditions and postconditions so we don't
want to confuse them
just to expose the [heap] and [stack] record field names without having to type
[BaseDomain.heap]
* represents the post abstract state at each program point
* represents the inferred pre-condit... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
233ab8c8ca0ee965ef29ae847a6b58f6bbf29c70fc5adf43122424967a3a1e1c | Hans-Halverson/myte | aarch64_simplify_cfg.ml | open Aarch64_gen_context
open Asm
open Asm_builders
class compress_branch_aliases ~(gcx : Gcx.t) ~func =
object
inherit Asm_simplify_cfg.compress_jump_aliases ~func
method get_unconditional_branch_block instr =
match instr with
| { instr = `B; operands = [| { value = Block next_jump_block; _ } |... | null | https://raw.githubusercontent.com/Hans-Halverson/myte/5be02709ec400ce573635f4014783db73f12b8ce/src/asm/aarch64/aarch64_simplify_cfg.ml | ocaml | Simplify branch instructions, removing unnecessary branch instructions when possible
An unconditional branch followed by the branched to block can be removed | open Aarch64_gen_context
open Asm
open Asm_builders
class compress_branch_aliases ~(gcx : Gcx.t) ~func =
object
inherit Asm_simplify_cfg.compress_jump_aliases ~func
method get_unconditional_branch_block instr =
match instr with
| { instr = `B; operands = [| { value = Block next_jump_block; _ } |... |
59d0d12a022256d528157bd92f2a1c886b414281a6e3010c0d4027100925b2b3 | justinmeiners/exercises | 4_26.scm |
:
; why not just implement unless as a special form?
; this would probably be faster
; the unless expression would simply be translated into an if
; at expand, or compile time
; I guess the bigger question is, should all lazy evaluation be addressed with special forms (macros)? It seems that provide a solution f... | null | https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/sicp/4/4_26.scm | scheme | why not just implement unless as a special form?
this would probably be faster
the unless expression would simply be translated into an if
at expand, or compile time
I guess the bigger question is, should all lazy evaluation be addressed with special forms (macros)? It seems that provide a solution for most cases.... |
:
:
procedures are first class functions , and can be passed to procedures such as
|
8b6ca9a13779c63d4a2a47ac4c867f141d33dfb4fcdfea0aa6041f391686fa8c | alpmestan/servant | greet.hs | # LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeOperators #
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson
import Data.Monoid
import Data.Proxy
import Data.Text
import GHC.Generics
import Network.Wai
import Network.Wai.Handler.Warp
import Servant... | null | https://raw.githubusercontent.com/alpmestan/servant/d67b5e1f3e9af4b249f95ed72dcaebc4ce328a96/servant/example/greet.hs | haskell | # LANGUAGE OverloadedStrings #
* Example
| A greet message data type
API specification
GET /hello/:name?capital={true, false} returns a Greet as JSON
POST /greet with a Greet as JSON in the request body,
returns a Greet as JSON
DELETE /greet/:greetid
Server-side handlers.
that represents the API,... | # LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeOperators #
import Data.Aeson
import Data.Monoid
import Data.Proxy
import Data.Text
import GHC.Generics
import Network.Wai
import Network.Wai.Handler.Warp
import Servant
newtype Greet = Greet { msg :: T... |
425c0b692dd500b56e8aa2259c0accdccee101adfc151ac4d954d24059aa0db7 | cxxxr/valtan | compilation.lisp | (in-package :common-lisp)
(defun eval (x)
(ffi:js-eval (compiler:compile-toplevel x)))
(defun macroexpand-1 (form &optional environment)
(compiler::!macroexpand-1 form environment))
(defun macroexpand (form &optional environment)
(declare (ignore environment))
(multiple-value-bind (form expanded-p)
(ma... | null | https://raw.githubusercontent.com/cxxxr/valtan/ec3164d42b86869357dc185b747c5dfba25c0a3c/library/valtan-core/lisp/compilation.lisp | lisp | (in-package :common-lisp)
(defun eval (x)
(ffi:js-eval (compiler:compile-toplevel x)))
(defun macroexpand-1 (form &optional environment)
(compiler::!macroexpand-1 form environment))
(defun macroexpand (form &optional environment)
(declare (ignore environment))
(multiple-value-bind (form expanded-p)
(ma... | |
624977d07c5ab959c21691f1bc4944077713f922df77bd1c6ef582a3fffeb713 | typelead/etlas | ReadE.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.ReadE
Copyright : 2008
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
--
-- Simple parsing with failure
module Distribution.ReadE (
-- * ReadE
ReadE(..), succeedRead... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/ReadE.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.ReadE
License : BSD3
Maintainer :
Portability : portable
Simple parsing with failure
* ReadE
* Projections
| Parser with simple error reporting | Copyright : 2008
module Distribution.ReadE (
ReadE(..), succeedReadE, failReadE,
parseReadE, readEOrFail,
readP_to_E
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Compat.ReadP
newtype ReadE a = ReadE {runReadE :: String -> Either ErrorMsg a}
type ErrorMsg = S... |
13771c44f2176e41624496cb25aea325317732b8c17f4f8b47aa33014adcd53c | clojure/core.async | channels.cljs | Copyright ( c ) and contributors . 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 agreei... | null | https://raw.githubusercontent.com/clojure/core.async/5ea114ce36061ec6c0beeca041f4e409b1e2e19c/src/main/clojure/cljs/core/async/impl/channels.cljs | 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 ) and contributors . All rights reserved .
(ns cljs.core.async.impl.channels
(:require [cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.dispatch :as dispatch]
[cljs.core.async.impl.buffers :as buffers]))
(defn box [val]
(reify cljs.core/IDeref
(-der... |
28612551a3543850e1b5ea8187898ab1ad96e6956d718e2f33c987b30f886ccd | spawnfest/eep49ers | wxPopupWindow.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxPopupWindow.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxPopupWindow).
-include("wxe.hrl").
-export([create/2,create/3,destroy/1,new/0,new/1,new/2,position/3]).
-... |
784638bc1b93245ed2a2dedb0fcb0a9213e5d03be2e14ff5ea916000f8458416 | snoyberg/haskellers | Profile.hs | # LANGUAGE QuasiQuotes , OverloadedStrings , TemplateHaskell #
# LANGUAGE CPP #
module Handler.Profile
( getProfileR
, postProfileR
, postDeleteAccountR
, postSkillsR
, postDeleteIdentR
, postRequestRealR
, postRequestRealPicR
, postRequestUnblockR
, postRequestSkillR
, postSetUs... | null | https://raw.githubusercontent.com/snoyberg/haskellers/ff152a73902f0e0e55615c83cfc5e888d052f1e3/src/Handler/Profile.hs | haskell | # LANGUAGE QuasiQuotes , OverloadedStrings , TemplateHaskell #
# LANGUAGE CPP #
module Handler.Profile
( getProfileR
, postProfileR
, postDeleteAccountR
, postSkillsR
, postDeleteIdentR
, postRequestRealR
, postRequestRealPicR
, postRequestUnblockR
, postRequestSkillR
, postSetUs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.