_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 |
|---|---|---|---|---|---|---|---|---|
8cc678f51fe47eadd81d2c440517a585589ba1f8199142f9af99c7c622f11207 | ucsd-progsys/dsolve | length.ml | sort = { a : int | a > = 0 }
fun ('a)
length [] = 0
| length (x :: xs) = 1 + length (xs)
withtype {n:nat} <n> => 'a list(n) -> int(n)
| null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2008/xiog/DMLex/length.ml | ocaml | sort = { a : int | a > = 0 }
fun ('a)
length [] = 0
| length (x :: xs) = 1 + length (xs)
withtype {n:nat} <n> => 'a list(n) -> int(n)
| |
65f32e4165d0629c34ea17c65323f3fdac7bfcca09fa8984ec7469891fbfc567 | m-schmidt/Asm6502 | Assembler.hs | |Assembling instructions into bute sequences
module Assembler where
import AsmParser
import Arch6502
import Data.List
import Data.Map (Map)
import Data.Word
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Text.Printf
-- |A symboltable maps symbols to their eventually ... | null | https://raw.githubusercontent.com/m-schmidt/Asm6502/bec7b262088b2a125445292ddb9a7cc34859527f/src/Assembler.hs | haskell | |A symboltable maps symbols to their eventually resolved addresses
|Sets of duplicate symbols
|Computes a tuple containing all duplicate symbols and a table mapping symbols to their addresses
accumulate symbol definitions
extract symbol definitions from the program statements
|Convert a symbol table into a list o... | |Assembling instructions into bute sequences
module Assembler where
import AsmParser
import Arch6502
import Data.List
import Data.Map (Map)
import Data.Word
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Text.Printf
type SymbolTable = Map String (Maybe Int)
type Dup... |
a39d65e67da859d82bc057f814c3f173cc474a3e29461b92aff83bda9c1aa417 | OscarSouth/theHarmonicAlgorithm | Perform.hs | module Perform where
-- theHarmonicAlgorithm | null | https://raw.githubusercontent.com/OscarSouth/theHarmonicAlgorithm/645199e958669becc1d70d9b8e75dc0729ef0e27/src/Perform.hs | haskell | theHarmonicAlgorithm | module Perform where
|
d4df51b4825b9c1a5664bb236280241bef17e030efd576ec19622f7ba45905ab | ocurrent/ocaml-ci | pin_depends.ml | open Lwt.Infix
module Repo_map = Map.Make (String)
let ( >>!= ) x f = x >>= function Ok x -> f x | Error (`Msg m) -> failwith m
let repo_locks = ref Repo_map.empty
let repo_lock repo =
match Repo_map.find_opt repo !repo_locks with
| Some l -> l
| None ->
let l = Lwt_mutex.create () in
repo_locks := ... | null | https://raw.githubusercontent.com/ocurrent/ocaml-ci/ed1153393959476c1cc2c464c913110c31859a4a/lib/pin_depends.ml | ocaml | .../var/pin-depends/myrepo-hhh | open Lwt.Infix
module Repo_map = Map.Make (String)
let ( >>!= ) x f = x >>= function Ok x -> f x | Error (`Msg m) -> failwith m
let repo_locks = ref Repo_map.empty
let repo_lock repo =
match Repo_map.find_opt repo !repo_locks with
| Some l -> l
| None ->
let l = Lwt_mutex.create () in
repo_locks := ... |
f0faf99f3caca955603aabec5e204f943f20250d9b3b0490c7bf95eaae48d13b | clj-commons/iapetos | export.clj | (ns iapetos.export
(:require [iapetos.registry :as registry])
(:import [io.prometheus.client CollectorRegistry]
[io.prometheus.client.exporter
PushGateway]
[io.prometheus.client.exporter.common
TextFormat]))
# # TextFormat ( v0.0.4 )
(defn write-text-format!
"Dump... | null | https://raw.githubusercontent.com/clj-commons/iapetos/0fecedaf8454e17e41b05e0e14754a311b9f4ce2/src/iapetos/export.clj | clojure | (ns iapetos.export
(:require [iapetos.registry :as registry])
(:import [io.prometheus.client CollectorRegistry]
[io.prometheus.client.exporter
PushGateway]
[io.prometheus.client.exporter.common
TextFormat]))
# # TextFormat ( v0.0.4 )
(defn write-text-format!
"Dump... | |
d3094ad49582f2f2df4daed77beb4371d1615e016761e74c01e15772979f3a00 | ivanjovanovic/sicp | e-3.50.scm | Exercise 3.50 . Complete the following definition , which generalizes
; stream-map to allow procedures that take multiple arguments, analogous to map
in section 2.2.3 , footnote 12 .
; (define (stream-map proc . argstreams)
; (if (<??> (car argstreams))
; the-empty-stream
; (<??>
; (apply proc (... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/3.5/e-3.50.scm | scheme | stream-map to allow procedures that take multiple arguments, analogous to map
(define (stream-map proc . argstreams)
(if (<??> (car argstreams))
the-empty-stream
(<??>
(apply proc (map <??> argstreams))
(apply stream-map
(cons proc (map <??> argstreams))))))
----------------... | Exercise 3.50 . Complete the following definition , which generalizes
in section 2.2.3 , footnote 12 .
(load "../helpers.scm")
(load "../common.scm")
(load "3.5.scm")
(define (stream-map proc . argstreams)
(if (stream-null? (car argstreams))
the-empty-stream
(cons-stream
(apply proc (map c... |
d570faa94d8dd5a2294f4649f9c6f82ca37c240e3ed50a1fbb87fb4302a3cec8 | ktahar/ocaml-lp | lp_gurobi.mli | * High - level interface to Gurobi .
val solve :
?write_fname:string
-> ?term_output:bool
-> Lp.Problem.t
-> (float * float Lp.PMap.t, string) result
* Solve the problem using Gurobi .
| null | https://raw.githubusercontent.com/ktahar/ocaml-lp/b36816ce9fc61f711b664fc3f3a1ea1a55c31be9/src/lp-gurobi/lp_gurobi.mli | ocaml | * High - level interface to Gurobi .
val solve :
?write_fname:string
-> ?term_output:bool
-> Lp.Problem.t
-> (float * float Lp.PMap.t, string) result
* Solve the problem using Gurobi .
| |
92eb79a11703c40406e8fe6d6ebcf6f217111d73b70310e3306156b7d48979fe | janestreet/universe | bigstring.ml | include Shexp_bigstring.Std.Bigstring
external unsafe_write : Unix.file_descr -> t -> pos:int -> len:int -> int
= "shexp_bigstring_io_write"
external unsafe_read : Unix.file_descr -> t -> pos:int -> len:int -> int
= "shexp_bigstring_io_read"
let write fd buf ~pos ~len =
check_pos_len_exn ~pos ~len ~length:(leng... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/shexp/bigstring-io-lib/src/bigstring.ml | ocaml | include Shexp_bigstring.Std.Bigstring
external unsafe_write : Unix.file_descr -> t -> pos:int -> len:int -> int
= "shexp_bigstring_io_write"
external unsafe_read : Unix.file_descr -> t -> pos:int -> len:int -> int
= "shexp_bigstring_io_read"
let write fd buf ~pos ~len =
check_pos_len_exn ~pos ~len ~length:(leng... | |
11517364c454e72cca7b5e3a2139c80e7912f06a15a4cc59a91126aa1b76fe0b | karamellpelle/grid | Grid.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/designer/source/Game/LevelPuzzleMode/Do/Grid.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Game.LevelPuzzleMode.Do.Grid
(
doGridP... |
c6dbe39a128dae8569e98f2f97e4a0667a3246f19b43022394dc8092c36f9654 | gyounes/RCB | rcb_dlvr.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2017 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the ... | null | https://raw.githubusercontent.com/gyounes/RCB/8f4d6e6fcaf124303c8f7bc80462af678457d1fd/src/rcb_dlvr.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2017 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(rcb_dlvr).
-author("G... |
6176664bda1bff088caa4752f10f7d175d339af0603a2e8f8d8dec9d8fe23c1d | jarohen/yoyo | watcher.cljc | (ns yoyo.system.watcher)
(defprotocol IWatcher
(await! [_ f])
(satisfy! [_ v])
(close! [_]))
(defrecord Watcher [!state]
IWatcher
(await! [_ f]
(loop []
(let [{:keys [fs v] :as state} @!state]
(if (= v ::nil)
(if (compare-and-set! !state state (update state :fs conj f))
... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/core/src/yoyo/system/watcher.cljc | clojure | (ns yoyo.system.watcher)
(defprotocol IWatcher
(await! [_ f])
(satisfy! [_ v])
(close! [_]))
(defrecord Watcher [!state]
IWatcher
(await! [_ f]
(loop []
(let [{:keys [fs v] :as state} @!state]
(if (= v ::nil)
(if (compare-and-set! !state state (update state :fs conj f))
... | |
c518b86a82b0c89adc33a86c193dc79695c3ae36491192a56ac9b810f4619c8e | onedata/op-worker | file_gs_rpc.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module handles gs rpc concern... | null | https://raw.githubusercontent.com/onedata/op-worker/8a90006a45f1220c1e7b2809b694f85534ff5d29/src/graph_sync/server/rpc/file_gs_rpc.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
This module handles gs rpc concerning file entities.
@end
-------------------------------------------------------------------
API
=======================================... | @author
( C ) 2019 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(file_gs_rpc).
-author("Bartosz Walkowicz").
-include("middleware/middleware.hrl").
-include("modules/logical_file_manager/lfm.hrl").
-include_lib("ctool/include/logging.hrl").
-include_lib(... |
adb6b3fdf332d44f6738cbc0f606c35ba0649cd96f7be72f3a1a690c79ca8278 | igorhvr/bedlam | subarray.scm | ;;;;"subarray.scm" Scheme array accessory procedures.
Copyright ( C ) 2002 and
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
1 . Any copy made of this... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/subarray.scm | scheme | "subarray.scm" Scheme array accessory procedures.
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-free, and I am under no oblig... | Copyright ( C ) 2002 and
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
(require 'array)
(require 'multiarg-apply)
list of two integers within the range... |
e4949b72f6123c4c8903b2fb3ee68b4f57301ec2535c5f3c36b70e1de3c8c3ae | LCBH/UKano | version.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/LCBH/UKano/13c046ddaca48b45d3652c3ea08e21599e051527/proverif2.01/src/version.mli | ocaml | Version number | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... |
fd6f255d9890e7141d78739fcaf55c62f543ac8eef1177243f3a898186b2b57d | Tipoca/hlvm | calc.ml | open Printf
open Hlvm
open Expr
open Camlp4.PreCast
let expr = Gram.Entry.mk "expr"
EXTEND Gram
expr:
[ [ e1 = expr; "+"; e2 = expr -> e1 +: e2
| e1 = expr; "-"; e2 = expr -> e1 -: e2 ]
| [ e1 = expr; "*"; e2 = expr -> e1 *: e2
| e1 = expr; "/"; e2 = expr -> e1 /: e2 ]
| [ n = INT -> Fl... | null | https://raw.githubusercontent.com/Tipoca/hlvm/5b6fe8d1ce95d5cfc130dd0e56f0f36bae9b2e0d/examples/calculator/calc.ml | ocaml | open Printf
open Hlvm
open Expr
open Camlp4.PreCast
let expr = Gram.Entry.mk "expr"
EXTEND Gram
expr:
[ [ e1 = expr; "+"; e2 = expr -> e1 +: e2
| e1 = expr; "-"; e2 = expr -> e1 -: e2 ]
| [ e1 = expr; "*"; e2 = expr -> e1 *: e2
| e1 = expr; "/"; e2 = expr -> e1 /: e2 ]
| [ n = INT -> Fl... | |
1b03a14b1ddfc4a05f9a46db1f8e26b6716868925ac6442573c9c74e72263b09 | onedata/op-worker | lfm_symlinks_resolution_test_SUITE.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
This file contains tests of lfm syml... | null | https://raw.githubusercontent.com/onedata/op-worker/9e94ef0b27a79e32c1baf4c4650b04c1dcc89c21/test_distributed/suites/lfm/lfm_symlinks_resolution_test_SUITE.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
====================================================================
Test function
==============... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
This file contains tests of lfm symlink resolution API .
-module(lfm_symlinks_resolution_test_SUITE).
-author("Bartosz Walkowicz").
-include("modules/logical_file_manager/lfm.hrl").
-include("one... |
f3198757925ef6a901924c4522cd31e3a10479fc13187730f758335fcf87a8f4 | inaka/beam_olympics | bo_meta_SUITE.erl | -module(bo_meta_SUITE).
-include_lib("mixer/include/mixer.hrl").
-mixin([ktn_meta_SUITE]).
-export([ init_per_suite/1
, end_per_suite/1]).
-spec init_per_suite(ktn_meta_SUITE:config()) -> ktn_meta_SUITE:config().
init_per_suite(Config) ->
[ {application, beam_olympics}
@todo remove once -173 is fixed
,... | null | https://raw.githubusercontent.com/inaka/beam_olympics/9b16afd54f25c0996430139e9646c3cfdfbdf86b/test/bo_meta_SUITE.erl | erlang | -module(bo_meta_SUITE).
-include_lib("mixer/include/mixer.hrl").
-mixin([ktn_meta_SUITE]).
-export([ init_per_suite/1
, end_per_suite/1]).
-spec init_per_suite(ktn_meta_SUITE:config()) -> ktn_meta_SUITE:config().
init_per_suite(Config) ->
[ {application, beam_olympics}
@todo remove once -173 is fixed
,... | |
9c9974909f50b70b17cbcd27f6534452f27f366202c37d8263c2044c03fc6afc | EveryTian/Haskell-Codewars | factorial-decomposition.hs | -decomposition
module FactorialDecomposition.Kata (decomp) where
import Data.List (intercalate)
decomp :: Int -> String
decomp = strResList . zip primes . foldl zipWithPlus' [] . map (`dc` primes) . enumFromTo 2
strResList :: [(Int, Int)] -> String
strResList = intercalate " * " . map strRes
where... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/5kyu/factorial-decomposition.hs | haskell | -decomposition
module FactorialDecomposition.Kata (decomp) where
import Data.List (intercalate)
decomp :: Int -> String
decomp = strResList . zip primes . foldl zipWithPlus' [] . map (`dc` primes) . enumFromTo 2
strResList :: [(Int, Int)] -> String
strResList = intercalate " * " . map strRes
where... | |
0e4becb018d3d91b0d4a5c255ea7749bd899365d067779e7666ab80af9245752 | OCamlPro/typerex-lint | lintParsingGetFeatures.ml | open SimpleConfig
type feature_analysis_mode =
| Fast
| Slow
let string_of_mode = function
| Fast -> "fast"
| Slow -> "slow"
let mode_of_string = function
| "fast" -> Fast
| "slow" -> Slow
| _ -> failwith "string is not a valid analysis mode"
let default_mode =
Slow
type feature =
| Feature_if_th... | null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/plugins/ocp-lint-plugin-parsing/lintParsingGetFeatures.ml | ocaml | open SimpleConfig
type feature_analysis_mode =
| Fast
| Slow
let string_of_mode = function
| Fast -> "fast"
| Slow -> "slow"
let mode_of_string = function
| "fast" -> Fast
| "slow" -> Slow
| _ -> failwith "string is not a valid analysis mode"
let default_mode =
Slow
type feature =
| Feature_if_th... | |
bae280760056757a55a228cc68fa7702cbf4584a00c57074179d5b4b08f6d73c | uwplse/synapse | data.rkt | #lang racket
(provide cats airplanes)
; this file is auto-generated by parse-data.py
(define cats
(list
'(123 100 142 63 115 173 208 208 153 158 174 188 192 22 41 40 149 88 40 60 174 207 103 118 192 59 36 42 18 23 25 22 80 73 57 40 17 20 21 21 29 98 64 36 20 18 19 21 113 54 37 21 17 21 23 22 84 46 56 32 23 41 80 ... | null | https://raw.githubusercontent.com/uwplse/synapse/10f605f8f1fff6dade90607f516550b961a10169/benchmarks/demos/cats/data.rkt | racket | this file is auto-generated by parse-data.py | #lang racket
(provide cats airplanes)
(define cats
(list
'(123 100 142 63 115 173 208 208 153 158 174 188 192 22 41 40 149 88 40 60 174 207 103 118 192 59 36 42 18 23 25 22 80 73 57 40 17 20 21 21 29 98 64 36 20 18 19 21 113 54 37 21 17 21 23 22 84 46 56 32 23 41 80 89)
'(104 81 52 51 54 56 50 40 87 55 69 50 ... |
96a78c7a5228b97484741cbf9c92a6d2c4c3fb70c0885b5efdafa8b8df35a1f6 | issuu/ocaml-protoc-plugin | infix.ml | module Int64 = struct
open Int64
let (land) = logand
let (lsl) = shift_left
let (lsr) = shift_right_logical
let (lor) = logor
let (lxor) = logxor
let (+) = add
let (/) = div
let ( * ) = mul
let (-) = sub
end
| null | https://raw.githubusercontent.com/issuu/ocaml-protoc-plugin/3d8b3eeb48e2a58dc80fbfdf9d749e69676625ab/src/ocaml_protoc_plugin/infix.ml | ocaml | module Int64 = struct
open Int64
let (land) = logand
let (lsl) = shift_left
let (lsr) = shift_right_logical
let (lor) = logor
let (lxor) = logxor
let (+) = add
let (/) = div
let ( * ) = mul
let (-) = sub
end
| |
b19da3f31d82a902bd08a70c3c26d4189792db03242f84fd8094d2b7bc82e174 | simmsb/calamity | Guild.hs | -- | Discord Guilds
module Calamity.Types.Model.Guild (
module Calamity.Types.Model.Guild.AuditLog,
module Calamity.Types.Model.Guild.Ban,
module Calamity.Types.Model.Guild.Emoji,
module Calamity.Types.Model.Guild.Guild,
module Calamity.Types.Model.Guild.Member,
module Calamity.Types.Model.Guild.Overwrite,
... | null | https://raw.githubusercontent.com/simmsb/calamity/1cdcace44eab62c03350c055e2db045d8a902c2e/calamity/Calamity/Types/Model/Guild.hs | haskell | | Discord Guilds | module Calamity.Types.Model.Guild (
module Calamity.Types.Model.Guild.AuditLog,
module Calamity.Types.Model.Guild.Ban,
module Calamity.Types.Model.Guild.Emoji,
module Calamity.Types.Model.Guild.Guild,
module Calamity.Types.Model.Guild.Member,
module Calamity.Types.Model.Guild.Overwrite,
module Calamity.Ty... |
26657b8c5075bc4e8454d618d75bf79b69dde6d732d8bc5d2d6edbfa0dfa42d8 | rowangithub/DOrder | apache-escape-absolute.ml | let rec loopa cp urilen =
if ( cp != urilen-1) then
if(Random.bool ()) then cp
else
let _ = assert(cp < urilen) in
let _ = assert(0 <= cp) in
loopa (cp+1) urilen
else
let _ = assert(cp < urilen) in
let _ = assert( 0 <= cp ) in
cp
let rec loopb c cp urilen tokenlen =
if ( cp != urile... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/invgen/apache-escape-absolute.ml | ocaml | //token[0] = uri; | let rec loopa cp urilen =
if ( cp != urilen-1) then
if(Random.bool ()) then cp
else
let _ = assert(cp < urilen) in
let _ = assert(0 <= cp) in
loopa (cp+1) urilen
else
let _ = assert(cp < urilen) in
let _ = assert( 0 <= cp ) in
cp
let rec loopb c cp urilen tokenlen =
if ( cp != urile... |
a4a50eb70822859c43cd64c652be73c63f705c8e47f4fa884e1f61426689c941 | EvoLogics/evins | mod_move.erl | Copyright ( c ) 2015 , < >
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
1 . Redistributions of source code must retain the above copyright
%% notice, this list of conditions and the following disc... | null | https://raw.githubusercontent.com/EvoLogics/evins/80401c36601425e302f68f189d9d2e344c7598a7/src/mod_move.erl | erlang |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documentation and/or othe... | Copyright ( c ) 2015 , < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . The name of the author may not be used to endorse or promote products
GNU General Public License ( " GPL " ) version 2 as published by the ... |
0119e7d31e1c197f1b49a3e455e6c4bb680f8d7566d0abfa6a6d62a9d908248f | grin-compiler/ghc-wpc-sample-programs | Headers.hs | -----------------------------------------------------------------------------
-- |
-- Module : Network.HTTP.Headers
-- Copyright : See LICENSE file
License : BSD
--
-- Maintainer : Ganesh Sittampalam <>
-- Stability : experimental
-- Portability : non-portable (not tested)
--
-- This module pro... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/HTTP-4000.3.14/Network/HTTP/Headers.hs | haskell | ---------------------------------------------------------------------------
|
Module : Network.HTTP.Headers
Copyright : See LICENSE file
Maintainer : Ganesh Sittampalam <>
Stability : experimental
Portability : non-portable (not tested)
This module provides the data types for representing HTTP ... | License : BSD
separate set of operations for doing so , we introduce a type class ' HasHeaders '
module Network.HTTP.Headers
, Header(..)
, HeaderName(..)
: : HasHeaders a = > HeaderName - > String - > a - > a
: : HasHeaders a = > HeaderName - > String - > a - > a
: : HasHeaders a = > [ Header... |
9c5686d640a9379310e637a9253c2d543341d4abe00d067f34ace0dea30cb0c7 | janestreet/core | printexc.ml | open! Import
let to_string _ = `Deprecated_use_Exn_to_string_instead
let print _ = `Deprecated_use_Exn_to_string_instead
let catch _ _ = `Deprecated_use_Exn_handle_uncaught_instead
let print_backtrace = Stdlib.Printexc.print_backtrace
let get_backtrace = Stdlib.Printexc.get_backtrace
let record_backtrace = Stdlib.Prin... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/core/src/printexc.ml | ocaml | open! Import
let to_string _ = `Deprecated_use_Exn_to_string_instead
let print _ = `Deprecated_use_Exn_to_string_instead
let catch _ _ = `Deprecated_use_Exn_handle_uncaught_instead
let print_backtrace = Stdlib.Printexc.print_backtrace
let get_backtrace = Stdlib.Printexc.get_backtrace
let record_backtrace = Stdlib.Prin... | |
be9614329b103d0ab81b6048f1243fc7c827df7d820a69718ca8d7a29d4b375e | lambdabot/lambdabot | Config.hs | # LANGUAGE CPP #
{-# LANGUAGE GADTs #-}
# LANGUAGE ViewPatterns #
# LANGUAGE TemplateHaskell #
| Extensible configuration system for
--
TODO : there 's notthing - specific about this , it could be a useful standalone library .
module Lambdabot.Config
( Config
, getConfigDefault
, mergeConfig
, Mo... | null | https://raw.githubusercontent.com/lambdabot/lambdabot/de01f362c7a8fc6f85c37e604168dcccb1283a0e/lambdabot-core/src/Lambdabot/Config.hs | haskell | # LANGUAGE GADTs #
|Define a new configuration key with the specified name, type and
default value
You should probably also provide an explicit export list for any
module that defines config keys, because the definition introduces
a few extra types that will clutter up the export list otherwise.
|Like 'config',... | # LANGUAGE CPP #
# LANGUAGE ViewPatterns #
# LANGUAGE TemplateHaskell #
| Extensible configuration system for
TODO : there 's notthing - specific about this , it could be a useful standalone library .
module Lambdabot.Config
( Config
, getConfigDefault
, mergeConfig
, MonadConfig(..)
, confi... |
1a239e7970f575b9718ba4c0dbfb37ef4895e97beab1366ee02f7d4d12045d17 | geophf/1HaskellADay | Solution.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2018.M05.D18.Solution where
import Data.Aeson
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Time.Clock
import Database.PostgreSQL.Simple
import Network.HTTP.Conduit
below imports available via 1HaskellADay g... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M05/D18/Solution.hs | haskell | # LANGUAGE OverloadedStrings #
Before we insert new articles, let's step back in time for a moment. Recall
}
The JSON format we already know and parse (see above exercise) and the
tags are exhausted when the Value returned is the empty list.
How many tags are there for this REST endpoint?
You may want to use some ... |
module Y2018.M05.D18.Solution where
import Data.Aeson
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Time.Clock
import Database.PostgreSQL.Simple
import Network.HTTP.Conduit
below imports available via 1HaskellADay git repository
import Data.LookupTa... |
3cfaedf101fa786b38b6230a441b8395fc2775613aec9578985cf97f4fe452d1 | fosskers/aura | Test.hs | # LANGUAGE OverloadedLists #
module Main ( main ) where
import Aura.Packages.Repository
import Aura.Pkgbuild.Security
import Aura.Settings.External
import Aura.Types
import Data.Versions
import RIO
import qualified RIO.Map as M
import RIO.Partial
-... | null | https://raw.githubusercontent.com/fosskers/aura/08cd46eaa598094f7395455d66690d3d8c59e965/haskell/aura/test/Test.hs | haskell | import Language.Bash.Pretty (prettyText)
import Text.Pretty.Simple (pPrintNoColor)
-
pPrintNoColor ppb | # LANGUAGE OverloadedLists #
module Main ( main ) where
import Aura.Packages.Repository
import Aura.Pkgbuild.Security
import Aura.Settings.External
import Aura.Types
import Data.Versions
import RIO
import qualified RIO.Map as M
import RIO.Partial
i... |
8a029148ca6b9c735a45708cb063231bb6bd0cf352c8c0d16e72cff306c72949 | gfngfn/otfed | decodeOperation.ml |
open Basic
open Value
open DecodeBasic
include DecodeOperationCore
open Open
let d_uint32_int : int decoder =
d_uint32 >>= fun n ->
return @@ WideInt.to_int n
let d_int32_int : int decoder =
d_uint32_int >>= fun n ->
if n >= (1 lsl 31) then
return @@ n - (1 lsl 32)
else
return n
let d_code_p... | null | https://raw.githubusercontent.com/gfngfn/otfed/5323be485a93fd2328ba5fa3ca9d53346af01aaf/src/decodeOperation.ml | ocaml | Skips `startCoverageIndex` |
open Basic
open Value
open DecodeBasic
include DecodeOperationCore
open Open
let d_uint32_int : int decoder =
d_uint32 >>= fun n ->
return @@ WideInt.to_int n
let d_int32_int : int decoder =
d_uint32_int >>= fun n ->
if n >= (1 lsl 31) then
return @@ n - (1 lsl 32)
else
return n
let d_code_p... |
edd6550d00cd14d4ce4d28972b2ae3c54d4c59f6bffc8069924ab444a100749c | inhabitedtype/ocaml-aws | describePatchGroups.ml | open Types
open Aws
type input = DescribePatchGroupsRequest.t
type output = DescribePatchGroupsResult.t
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoint... | null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/3bc554af7ae7ef9e2dcea44a1b72c9e687435fa9/libraries/ssm/lib/describePatchGroups.ml | ocaml | open Types
open Aws
type input = DescribePatchGroupsRequest.t
type output = DescribePatchGroupsResult.t
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoint... | |
7085d5a9b862f5bdee2ace937ab458a7b216bae5e83786069de47a886526640a | robert-strandh/SICL | condition-reporters-english.lisp | (cl:in-package #:cleavir-code-utilities)
(defmethod acclimation:report-condition
((condition form-must-be-proper-list) stream (language acclimation:english))
(format stream "A form must be a proper list,~@
but the following was found instead:~@
~s" (form condition)))
;;;;;;;;... | null | https://raw.githubusercontent.com/robert-strandh/SICL/98f0c1053a8737d02955eaff3df8153adc8e492f/Code/Cleavir/Code-utilities/condition-reporters-english.lisp | lisp |
Lambda list conditions. | (cl:in-package #:cleavir-code-utilities)
(defmethod acclimation:report-condition
((condition form-must-be-proper-list) stream (language acclimation:english))
(format stream "A form must be a proper list,~@
but the following was found instead:~@
~s" (form condition)))
(defmet... |
e4197ee1198895f151353109f49209db79873c1c56b843b5f2377dbf74775d00 | reflex-frp/reflex-process | Process.hs | |
Module : Reflex . Process
Description : Run processes and interact with them in reflex
Module: Reflex.Process
Description: Run processes and interact with them in reflex
-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
module Reflex.Process
( c... | null | https://raw.githubusercontent.com/reflex-frp/reflex-process/b5a6bba575db63547586454dd64493a0b5c39312/src/Reflex/Process.hs | haskell | # LANGUAGE GADTs #
^ A message that's sent to the underlying process. This does NOT include a trailing newline when sending your message.
| The inputs to a process
^ @stdin@ input to be fed to the process
^ Signals to send to the process
| An alias for 'defProcessConfig'.
You can also use 'Data.Default.def'.
| ... | |
Module : Reflex . Process
Description : Run processes and interact with them in reflex
Module: Reflex.Process
Description: Run processes and interact with them in reflex
-}
# LANGUAGE FlexibleContexts #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
module Reflex.Process
( createProcess
, create... |
75ee1f45fb29e653913359d11ad8e3c1d7555c5409cd5c6d1c839b7eba93b320 | benzap/fif | collecter_test.cljc | (ns fif.stdlib.collecter-test
(:require
[clojure.test :refer [deftest testing is are]]
[fif.stdlib.collecter]
[fif-test.utils :refer [are-eq* teval]]))
(deftest test-collecter-into-list
(testing "<-into! operator with lists"
(are-eq*
(teval () <-into! 1 2 3 !) => '((3 2 1))
(te... | null | https://raw.githubusercontent.com/benzap/fif/972adab8b86c016b04babea49d52198585172fe3/test/fif/stdlib/collecter_test.cljc | clojure | (ns fif.stdlib.collecter-test
(:require
[clojure.test :refer [deftest testing is are]]
[fif.stdlib.collecter]
[fif-test.utils :refer [are-eq* teval]]))
(deftest test-collecter-into-list
(testing "<-into! operator with lists"
(are-eq*
(teval () <-into! 1 2 3 !) => '((3 2 1))
(te... | |
7f97645fe31463b0a0a5101f3c149ba7a36faa243c8a82e5991157545797711a | rpearce/slugger | Slugger.hs | module Data.String.Slugger (toSlug) where
--------------------------------------------------------------------------------
import qualified Data.Text as T
import qualified Data.Text.Slugger as Slugger
--------------------------------------------------------------------------------
| Converts to a US - ASCII , low... | null | https://raw.githubusercontent.com/rpearce/slugger/7090a0630aa99374219f91e4ff83fbf267ca303d/lib/Data/String/Slugger.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
" hey - there - world "
" garcon - deja - foret - zoe "
"hey-there-world"
"garcon-deja-foret-zoe" | module Data.String.Slugger (toSlug) where
import qualified Data.Text as T
import qualified Data.Text.Slugger as Slugger
| Converts to a US - ASCII , lowercase , hyphenated , URI - friendly " slug "
_ _ Examples : _ _
@
toSlug " Hey there , world ! "
toSlug " GARÇON - déjà , — "
@
__Examples:_... |
d68f1069d8ff41b2be96862b7a3e0b602c9939fce90e135de81c57c90c4a9263 | fp-works/2019-winter-Haskell-school | LogAnalysis.hs | # OPTIONS_GHC -Wall #
module LogAnalysis where
import Log
import Text.Read
rmi :: String -> Maybe Int
rmi a = readMaybe a :: Maybe Int
process :: String -> [String] -> String -> MessageType -> LogMessage
process a b d c = maybe (Unknown a) (\ts -> LogMessage c ts (unwords b)) (rmi d)
processError :: String -> [Strin... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week2/stevemao/LogAnalysis.hs | haskell | # OPTIONS_GHC -Wall #
module LogAnalysis where
import Log
import Text.Read
rmi :: String -> Maybe Int
rmi a = readMaybe a :: Maybe Int
process :: String -> [String] -> String -> MessageType -> LogMessage
process a b d c = maybe (Unknown a) (\ts -> LogMessage c ts (unwords b)) (rmi d)
processError :: String -> [Strin... | |
e6a1495f164dfff0fb3d53af529a25c656fecb6b8f4b31dc09320bd65dfb8106 | dtenny/clj-re | package.lisp | (in-package :cl-user)
(defpackage :clj-re
(:use :cl :cl-ppcre)
(:documentation "Functions that implement Clojure style regexp operations.")
(:export
;; Functions taking regular expressions
#:re-find
#:re-groups
#:re-matcher
#:re-matches
#:re-pattern
ala clojure.string/replace , not clojure.co... | null | https://raw.githubusercontent.com/dtenny/clj-re/9534cd2224fbf2db7078839b82549a290839a055/package.lisp | lisp | Functions taking regular expressions
Optional readtable support | (in-package :cl-user)
(defpackage :clj-re
(:use :cl :cl-ppcre)
(:documentation "Functions that implement Clojure style regexp operations.")
(:export
#:re-find
#:re-groups
#:re-matcher
#:re-matches
#:re-pattern
ala clojure.string/replace , not clojure.core/replace
ala clojure.string/replace-first... |
ff95fa4286de4102b2b048a31edba3f7e746e53b6986f5761fa911ab087ca3bd | namenu/tfjs-cljs | color_classifier.cljs | Color Classifier from " The Coding Train Session 7 "
; Video: -frfKR58&list=PLRqwX-V7Uu6bmMRCIoTi72aNWHo7epX4L&index=1
(ns examples.color-classifier
(:require [cljsjs.p5]
[reagent.core :as r]
[tfjs-cljs.core :as tf :refer-macros [with-tidy with-fit-history]]
[tfjs-cljs.core.trai... | null | https://raw.githubusercontent.com/namenu/tfjs-cljs/24d1b22c0be58c38d723dafad9734283d526564d/examples/src/examples/color_classifier.cljs | clojure | Video: -frfKR58&list=PLRqwX-V7Uu6bmMRCIoTi72aNWHo7epX4L&index=1
hidden
output | Color Classifier from " The Coding Train Session 7 "
(ns examples.color-classifier
(:require [cljsjs.p5]
[reagent.core :as r]
[tfjs-cljs.core :as tf :refer-macros [with-tidy with-fit-history]]
[tfjs-cljs.core.train :as train]
[tfjs-cljs.layers.models :as models]
... |
769b891370382a6f12547674632165f4507d398334544090b9b44965b05d6bbc | 2600hz-archive/whistle | logger.erl | -module(logger).
-export([format_log/3, start_link/0, start_link/1, start_link/2]).
-export([emerg/2, alert/2, crit/2, err/2, warning/2, notice/2, info/2, debug/2]).
-spec start_link/0 :: () -> {ok, pid()}.
start_link() ->
start_link(local0).
-spec start_link/1 :: (Facility) -> {ok, pid()} when
Facility :... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/whistle-1.0.0/src/logger.erl | erlang | -module(logger).
-export([format_log/3, start_link/0, start_link/1, start_link/2]).
-export([emerg/2, alert/2, crit/2, err/2, warning/2, notice/2, info/2, debug/2]).
-spec start_link/0 :: () -> {ok, pid()}.
start_link() ->
start_link(local0).
-spec start_link/1 :: (Facility) -> {ok, pid()} when
Facility :... | |
118afcb504d90df199a8099192fc17bee62caba2c329a1554d7019aa3ddc707c | logseq/logseq | global_config.cljc | (ns frontend.schema.handler.global-config
"Malli schemas for global-config"
(:require [frontend.schema.handler.common-config :as common-config]))
;; For now this just references a common schema but repo-config and
;; global-config could diverge
(def Config-edn
"Schema for global config.edn"
common-config/Confi... | null | https://raw.githubusercontent.com/logseq/logseq/72acd0f1d41a2cb62cee7ce509c3112fa50cca1d/src/main/frontend/schema/handler/global_config.cljc | clojure | For now this just references a common schema but repo-config and
global-config could diverge | (ns frontend.schema.handler.global-config
"Malli schemas for global-config"
(:require [frontend.schema.handler.common-config :as common-config]))
(def Config-edn
"Schema for global config.edn"
common-config/Config-edn)
|
3550124da5af308b0b4ba52ee4ebdac6acf224e38cb40866baeab3e186c3ac9b | anoma/juvix | Types.hs | module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.ArityChecking.Data.Types where
import Juvix.Prelude
import Juvix.Prelude.Pretty
data Arity
= ArityUnit
| ArityFunction FunctionArity
| ArityUnknown
deriving stock (Eq)
data FunctionArity = FunctionArity
{ _functionArityLeft :: ArityParameter,... | null | https://raw.githubusercontent.com/anoma/juvix/13b038b5a1daf535d5ee8dbe90f74b661a2543cc/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/ArityChecking/Data/Types.hs | haskell | module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.ArityChecking.Data.Types where
import Juvix.Prelude
import Juvix.Prelude.Pretty
data Arity
= ArityUnit
| ArityFunction FunctionArity
| ArityUnknown
deriving stock (Eq)
data FunctionArity = FunctionArity
{ _functionArityLeft :: ArityParameter,... | |
8670102585c10df8dd23c902560b8d6f1b7d586692c29d08901b59ccfdaef23a | Butanium/monte-carlo-tree-search-TSP | Greedy_example.ml | run command : dune exec ./examples /
let city_config = "att48"
let city_count, cities = Reader_tsp.open_tsp city_config
let adj_matrix = Base_tsp.get_adj_matrix cities
let max_time = 1800.
let max_try = max_int
let random_policy = Greedy_Random.Roulette
let _, tour =
Greedy_Random.greedy adj_matrix city_count... | null | https://raw.githubusercontent.com/Butanium/monte-carlo-tree-search-TSP/293bcbf8fc70fe9b5f27a58c9b729826f5feee6e/examples/Greedy_example.ml | ocaml | run command : dune exec ./examples /
let city_config = "att48"
let city_count, cities = Reader_tsp.open_tsp city_config
let adj_matrix = Base_tsp.get_adj_matrix cities
let max_time = 1800.
let max_try = max_int
let random_policy = Greedy_Random.Roulette
let _, tour =
Greedy_Random.greedy adj_matrix city_count... | |
7adc4f02605aa7e4e2d030ce16b5c1165668582a06435804b6a79c66fae9f556 | atlas-engineer/nyxt | urls.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt/tests)
(define-test parse-url (:tags :online)
(let* ((*browser* (make-instance 'browser)))
;; "full URL"
(assert-equality #'quri:uri=
(quri:uri "")
(url ... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/976cc8cac600c6bf60ae45964d54aee4f22b23e2/tests/online/urls.lisp | lisp | "full URL"
"URL without protocol"
"search engine"
"search engine with special characters"
"default search engine"
"wiki search engine"
"local file"
"empty domain"
"localhost"
"ignore wildcards"
"about:blank"
"valid syntax but unknown scheme"
"Valid URL"
"Valid IP URL"
"Valid IP URL with path"
"same schem... | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt/tests)
(define-test parse-url (:tags :online)
(let* ((*browser* (make-instance 'browser)))
(assert-equality #'quri:uri=
(quri:uri "")
(url (make-instance 'ny... |
91438d7a3df6570a815cbd6c5051781f9b293d9b6a190eee174cfda48f79d300 | seancorfield/macro-day | anaphora.clj | (ns day.anaphora)
;; ~'x => capture x as variable
#_(anaphoric-if (some-computation 11)
(* 2 it))
(defn some-computation [x] (if (even? x) false (inc x)))
(defmacro anaphoric-if [expr & body]
`(if-let [~'it ~expr] (do ~@body)))
(defmacro anaphoric-and
([] true)
([x] x)
([x & more]
`(anap... | null | https://raw.githubusercontent.com/seancorfield/macro-day/776e605e7046bf8f34156c6821ed90c04a202790/bin/day/anaphora.clj | clojure | ~'x => capture x as variable | (ns day.anaphora)
#_(anaphoric-if (some-computation 11)
(* 2 it))
(defn some-computation [x] (if (even? x) false (inc x)))
(defmacro anaphoric-if [expr & body]
`(if-let [~'it ~expr] (do ~@body)))
(defmacro anaphoric-and
([] true)
([x] x)
([x & more]
`(anaphoric-if ~x
... |
3d98ec0d3ee8529703bffb702bd4266d9fa0197fcf5ce9f74bf946fbcb38a1f4 | basho/riak_test | ts_simple_explain_query.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2016 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the Li... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ts_simple_explain_query.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2016 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(ts_simple_explain_query... |
ce62884b26abbb20107e6eda683cee6988f40f2529b34952c8267145fa292222 | fukamachi/utopian | db.lisp | (defpackage #:utopian/cli/db
(:use #:cl)
(:import-from #:utopian/errors
#:invalid-arguments
#:unknown-command
#:file-not-found)
(:import-from #:utopian/tasks/db)
(:export #:main))
(in-package #:utopian/cli/db)
(defun print-usage ()
(format *error-output* "~&Usa... | null | https://raw.githubusercontent.com/fukamachi/utopian/532431b4c5e958995ba2d812751b779f814f9810/src/cli/db.lisp | lisp | (defpackage #:utopian/cli/db
(:use #:cl)
(:import-from #:utopian/errors
#:invalid-arguments
#:unknown-command
#:file-not-found)
(:import-from #:utopian/tasks/db)
(:export #:main))
(in-package #:utopian/cli/db)
(defun print-usage ()
(format *error-output* "~&Usa... | |
5ad0cc30a011bb7eabd9dac25e3da0c03a1fa3ea9045626961425c57c79a6ae2 | chef/chef-server | oc_authz_wm_group_actors.erl | % Pattern for /groups/<id>/actors/<actor_id>
% There would be one of these for /groups/<id>/groups/<group_id>
-module(oc_authz_wm_group_actors).
-include("oc_authz_wm.hrl").
-mixin([{oc_authz_wm_base, [content_types_accepted/2,
content_types_provided/2,
finish... | null | https://raw.githubusercontent.com/chef/chef-server/6d31841ecd73d984d819244add7ad6ebac284323/src/oc_bifrost/doc/sample_code/oc_authz_wm_group_actors.erl | erlang | Pattern for /groups/<id>/actors/<actor_id>
There would be one of these for /groups/<id>/groups/<group_id>
Add actor to group (attempt to save in DB/fail on validation errors)
Remove actor from group (attempt to remove in DB/fail on validation errors)
Key steps in web machine:
malformed_request: figures out the ty... |
-module(oc_authz_wm_group_actors).
-include("oc_authz_wm.hrl").
-mixin([{oc_authz_wm_base, [content_types_accepted/2,
content_types_provided/2,
finish_request/2,
forbidden/2,
malformed_request/2
... |
dc8521c9f0138806b6548395d56282b2dd74e607d6d25279f5753e397289e579 | vaibhavsagar/experiments | ByteString.hs | # OPTIONS_GHC -cpp - orphans #
--
-- Module : ByteString
Copyright : ( c ) The University of Glasgow 2001 ,
( c ) 2003 - 2005 ,
( c ) 2005
( c ) 2005 - 2006
( c ) 2006
--
-- Array fusion code:
( c ) 2001,2002 Manuel ... | null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/packages/base/Data/ByteString.hs | haskell |
Module : ByteString
Array fusion code:
License : BSD-style
Stability : experimental
| A time and space-efficient implementation of byte vectors using
packed Word8 arrays, suitable for high performance use, both in terms
are encoded as strict 'Word8' arrays of bytes, held in a 'ForeignPtr',
Th... | # OPTIONS_GHC -cpp - orphans #
Copyright : ( c ) The University of Glasgow 2001 ,
( c ) 2003 - 2005 ,
( c ) 2005
( c ) 2005 - 2006
( c ) 2006
( c ) 2001,2002 Manuel M T &
( c ) 2006 Roman Les... |
9e836c7d911688ed5414030c14a4735fbd8a7db8fc3e7df3bab559be3947cda3 | kofno/land-of-lisp | dice-of-doom.lisp | (defparameter *num-players* 2)
(defparameter *max-dice* 3)
(defparameter *board-size* 3)
(defparameter *board-hexnum* (* *board-size* *board-size*))
(defun board-array (lst)
(make-array *board-hexnum* :initial-contents lst))
(defun gen-board ()
(board-array (loop for n below *board-hexnum*
co... | null | https://raw.githubusercontent.com/kofno/land-of-lisp/18f4a614ea5f45db205c45522312761855c63c6b/chapter-15/dice-of-doom.lisp | lisp | unusual loop construct | (defparameter *num-players* 2)
(defparameter *max-dice* 3)
(defparameter *board-size* 3)
(defparameter *board-hexnum* (* *board-size* *board-size*))
(defun board-array (lst)
(make-array *board-hexnum* :initial-contents lst))
(defun gen-board ()
(board-array (loop for n below *board-hexnum*
co... |
24495fc87c8275c4465eb1bca11d174c22d6521e1110ed676b9137295fe60434 | juspay/atlas | OnCancel.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/public-transport-bap/src/Core/Spec/API/OnCancel.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
07c3a9c398b3801f149b494f081a258b6739ce7a22f752bc97b1c59964159b03 | nvim-treesitter/nvim-treesitter | folds.scm | (call_expression (block) @fold)
[(class_definition)
(trait_definition)
(object_definition)
(function_definition)
(val_definition)
(import_declaration)
(while_expression)
(do_while_expression)
(for_expression)
(try_expression)
(match_expression)
] @fold
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/ea0f6614b7f67d141b68a8c68dcfbe0dca19009a/queries/scala/folds.scm | scheme | (call_expression (block) @fold)
[(class_definition)
(trait_definition)
(object_definition)
(function_definition)
(val_definition)
(import_declaration)
(while_expression)
(do_while_expression)
(for_expression)
(try_expression)
(match_expression)
] @fold
| |
bcbdae673e3aab90b67a7be278b2bd2691d9bb76f4af36ee8f929bfe605d5f2e | scmlab/gcl | ExportPO.hs | module LSP.ExportPO where
-- import qualified Data.Text as Text
import Data . Text ( Text )
import Language . LSP.Server ( LspT )
-- exportFilepath :: Text
exportFilepath = > " .md "
-- createPOFile :: LspT () ServerM ()
-- createPOFile = do
-- let uri = Uri exportFilepath
-- let createFile = Crea... | null | https://raw.githubusercontent.com/scmlab/gcl/482c20888ab3ba6f4cf0cc57fd9792d60b0bbf2e/src/LSP/ExportPO.hs | haskell | import qualified Data.Text as Text
exportFilepath :: Text
createPOFile :: LspT () ServerM ()
createPOFile = do
let uri = Uri exportFilepath
let createFile = CreateFile uri Nothing
let edit = WorkspaceEdit Nothing (Just (List [InR (InL createFile)]))
pure ()
handleCreatePOFile (Right (ApplyWorks... | module LSP.ExportPO where
import Data . Text ( Text )
import Language . LSP.Server ( LspT )
exportFilepath = > " .md "
_ < - sendRequest SWorkspaceApplyEdit ( ApplyWorkspaceEditParams ( Just " create export file " ) edit ) handleCreatePOFile
handleCreatePOFile : : Either ResponseError ApplyWorksp... |
2867033454552ccd1f789031976109a0ad2aec1538fb6cdcefc28c76f0e7d4fe | composewell/streamly | Dispatcher.hs | -- |
Module : Streamly . Internal . Data . Stream . Concurrent . Channel . Dispatcher
Copyright : ( c ) 2017 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
--
--
module Streamly.Internal.Data.Stream.Concurrent.Channel.Dispatcher
... | null | https://raw.githubusercontent.com/composewell/streamly/9b788e036f57ea85a24d3215fa36d5a94e99f4cf/src/Streamly/Internal/Data/Stream/Concurrent/Channel/Dispatcher.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
* Dispatching
-----------------------------------------------------------------------------
Dispatching workers
-----------------------------------------------------------------------------
This allocation matters when significant number of... | Module : Streamly . Internal . Data . Stream . Concurrent . Channel . Dispatcher
Copyright : ( c ) 2017 Composewell Technologies
Portability : GHC
module Streamly.Internal.Data.Stream.Concurrent.Channel.Dispatcher
(
pushWorker
, dispatchWorker
, dispatchWorkerPaced
, sendWorkerWait
... |
3132274a5420f4b0415df96e32270cf169a239eab6d962a40a399dd13c97f580 | bjorng/esdl | woggle_test.erl | -module(woggle_test).
-compile(export_all).
-include("sdl_video.hrl").
-include("sdl_events.hrl").
-include("gl.hrl").
go() ->
code:add_path("../../ebin"),
woggle:init(),
io:format("Driver ~p ~n", [sdl_video:videoDriverName()]),
io:format("~p~n",[woggle:listModes()]),
io:format("~p~n",[sdl_video:l... | null | https://raw.githubusercontent.com/bjorng/esdl/dbd8ce9228aa36828091df2e8706c364094a3e22/woggle/test/woggle_test.erl | erlang | Misconseption from testgl.erl, but compatibility is useful anyway...
Ignored | -module(woggle_test).
-compile(export_all).
-include("sdl_video.hrl").
-include("sdl_events.hrl").
-include("gl.hrl").
go() ->
code:add_path("../../ebin"),
woggle:init(),
io:format("Driver ~p ~n", [sdl_video:videoDriverName()]),
io:format("~p~n",[woggle:listModes()]),
io:format("~p~n",[sdl_video:l... |
7904346cee8950e5e977c6eaf9e28742e4c87e9ee3e76834690e40adf6aa9af9 | alura-cursos/clojure-mutabilidade-atomos-e-refs | logic.clj | (ns hospital.logic)
(defn cabe-na-fila? [hospital departamento]
(-> hospital
(get,,, departamento)
count,,,
(<,,, 5)))
(defn chega-em
[hospital departamento pessoa]
(if (cabe-na-fila? hospital departamento)
(update hospital departamento conj pessoa)
(throw (ex-info "Fila já está cheia"... | null | https://raw.githubusercontent.com/alura-cursos/clojure-mutabilidade-atomos-e-refs/18c70bc13862df53377ac607b53b8f210f4239dd/aula2.1/hospital/src/hospital/logic.clj | clojure | (ns hospital.logic)
(defn cabe-na-fila? [hospital departamento]
(-> hospital
(get,,, departamento)
count,,,
(<,,, 5)))
(defn chega-em
[hospital departamento pessoa]
(if (cabe-na-fila? hospital departamento)
(update hospital departamento conj pessoa)
(throw (ex-info "Fila já está cheia"... | |
c0e851fff4ca13692a3df686d71be8da2e18f26540098ff8805219d0ea77e63b | FranklinChen/hugs98-plus-Sep2006 | Types.hs | -- #hide
module Graphics.HGL.Win32.Types
( toDimension, fromDimension
, toPoint, fromPoint
, toRGB, fromRGB
, Bitmap(..)
, DC
, Key(MkKey)
) where
import qualified Graphics.Win32 as Win32
import Graphics.HGL.Internals.Types
-- Hugs does not allow operators to have different fixities in
different m... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/HGL/Graphics/HGL/Win32/Types.hs | haskell | #hide
Hugs does not allow operators to have different fixities in
In consequence, we don't declare any fixities in any non-standard
library because it would prevent the programmer from using the same
operator name at a different fixity.
--------------------------------------------------------------
Units
------... | module Graphics.HGL.Win32.Types
( toDimension, fromDimension
, toPoint, fromPoint
, toRGB, fromRGB
, Bitmap(..)
, DC
, Key(MkKey)
) where
import qualified Graphics.Win32 as Win32
import Graphics.HGL.Internals.Types
different modules ( this is a known deviation from Standard Haskell ) .
infixr 9 `... |
efa49dfddba0c73979e418fd861e7a85bf00061eafbb5e4759cba95ca9e9065a | swarmpit/swarmpit | info.cljs | (ns swarmpit.component.registry-gitlab.info
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[material.component.label :as label]
[swarmpit.component.message :as message]
[swarmpit.component.state :as state... | null | https://raw.githubusercontent.com/swarmpit/swarmpit/38ffbe08e717d8620bf433c99f2e85a9e5984c32/src/cljs/swarmpit/component/registry_gitlab/info.cljs | clojure | (ns swarmpit.component.registry-gitlab.info
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[material.component.label :as label]
[swarmpit.component.message :as message]
[swarmpit.component.state :as state... | |
e025fb0fbfe22b30672b779c91ebd84bf4b717d21e63bea9541c1fcbe7048fe5 | acieroid/scala-am | mutex4.scm | (letrec ((lock (atom #f))
(acq (lambda ()
(if (compare-and-set! lock #f #t)
#t
(acq))))
(rel (lambda ()
(set! lock #f)))
(counter 0)
(inc (lambda ()
(acq)
(set! counter (+ counter 1))
... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/concurrentScheme/futures/variations/mutex4.scm | scheme | (letrec ((lock (atom #f))
(acq (lambda ()
(if (compare-and-set! lock #f #t)
#t
(acq))))
(rel (lambda ()
(set! lock #f)))
(counter 0)
(inc (lambda ()
(acq)
(set! counter (+ counter 1))
... | |
06437d891a1c9c205d8468fe24c308f0ca83c699460265dbcc3826639aa26171 | owickstrom/komposition | Paste.hs | -- | Transform a timeline by pasting something from the clipboard.
module Komposition.Composition.Paste where
import Komposition.Prelude
data PastePosition
= PasteLeftOf
| PasteRightOf
deriving (Show, Eq, Ord, Enum, Bounded)
-- NOTE: Implemented in terms of the "Insert" module.
-- | Pastes the cl... | null | https://raw.githubusercontent.com/owickstrom/komposition/64893d50941b90f44d77fea0dc6d30c061464cf3/src/Komposition/Composition/Paste.hs | haskell | | Transform a timeline by pasting something from the clipboard.
NOTE: Implemented in terms of the "Insert" module.
| Pastes the clipboard 'SomeComposition' into the
timeline.
paste
:: Focus (ToFocusType Timeline)
-> SomeComposition a
-> PastePosition
-> Timeline a
-> Maybe (Timeline a)
paste focus ... |
module Komposition.Composition.Paste where
import Komposition.Prelude
data PastePosition
= PasteLeftOf
| PasteRightOf
deriving (Show, Eq, Ord, Enum, Bounded)
SomeSequence s - > InsertSequence s
SomeParallel s - > InsertParallel s
|
a1a2ba621e3605a7ea6eaaed60a9f39758387c9f30edba26e443ffffe2e0b3b1 | vyorkin/tiger | lexbuf.ml | open Core
open Lexing
let mk fn ch =
let lexbuf = Lexing.from_channel ch in
lexbuf.lex_curr_p <- {
lexbuf.lex_curr_p with pos_fname = Filename.basename fn
};
lexbuf
let pos { lex_curr_p = pos; _ } =
let col = pos.pos_cnum - pos.pos_bol + 1 in
Printf.sprintf "%s:%d:%d" pos.pos_fname pos.pos_lnum col
| null | https://raw.githubusercontent.com/vyorkin/tiger/54dd179c1cd291df42f7894abce3ee9064e18def/chapter6/lib/lexbuf.ml | ocaml | open Core
open Lexing
let mk fn ch =
let lexbuf = Lexing.from_channel ch in
lexbuf.lex_curr_p <- {
lexbuf.lex_curr_p with pos_fname = Filename.basename fn
};
lexbuf
let pos { lex_curr_p = pos; _ } =
let col = pos.pos_cnum - pos.pos_bol + 1 in
Printf.sprintf "%s:%d:%d" pos.pos_fname pos.pos_lnum col
| |
386f639105eec78a9525887d0650f382da77783f0091ab209a9ea9ddbfb9950b | pentlandedge/s4607 | test_status_tests.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright 2016 Pentland Edge Ltd.
%%
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
%%
%% U... | null | https://raw.githubusercontent.com/pentlandedge/s4607/b3cdae404ac5bd50419f33259dfa62af9d1a8d60/test/test_status_tests.erl | erlang |
use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitati... | Copyright 2016 Pentland Edge Ltd.
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(test_status_tests).
-include_lib("eunit/include/eunit.hrl").
-export([sample_test_and_status_seg/0]).
test_st... |
b2f846d72c5aa3403e6f56a50e0cbf02138afa4c4b08ffd2bbf2aee25e64b001 | MLstate/opalang | dbGenByPass.ml |
Copyright © 2011 , 2012 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 us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/libqmlcompil/dbGen/dbGenByPass.ml | ocaml | shorthand
alias
========================================================================================================
* 'a -> 'a option
* ('a,'b) map -> 'a -> 'b -> ('a,'b) map
* ('acc -> 'a -> 'b -> 'acc) -> ('a,'b) map -> 'acc -> 'acc
* ('a,'b) map -> 'a -> 'b -> ('a,'b) map
* ('acc -> 'a -> 'b -> 'acc)... |
Copyright © 2011 , 2012 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 us... |
2c14e427424a1154e4228ea6c58e4aadd52278494d986018960ac74aa2ec7347 | metaocaml/ber-metaocaml | expect_test.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tools/expect_test.ml | ocaml | ************************************************************************
OCaml
... | , Jane Street Europe
Copyright 2016 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
Execute a list of phrases from a .ml file and compare the result to the
expected output , written ins... |
898e35665c87f8cec909aee0fbc2f8dc1dd93efd2ca576a617050a57a7219f1e | sjl/cl-nrepl | eval.lisp | (in-package :nrepl)
(define-middleware wrap-eval "eval" message
(evaluate-forms message
(fset:lookup message "code")
(fset:lookup message "in-package")))
| null | https://raw.githubusercontent.com/sjl/cl-nrepl/20a71458344a721d605c349b92268879bdfc98a1/src/middleware/eval.lisp | lisp | (in-package :nrepl)
(define-middleware wrap-eval "eval" message
(evaluate-forms message
(fset:lookup message "code")
(fset:lookup message "in-package")))
| |
1c0250fcf67c7562de93a10380018d387e7e38a223958a8054a7d270b5089884 | bobzhang/fan | default_quotation.ml | #default_quotation "expr";
open Camlp4.PreCast;
fun [ << $x$ - $y$ >> when x = y -> << 0 >>
| e -> e ];
| null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/test/fixtures/default_quotation.ml | ocaml | #default_quotation "expr";
open Camlp4.PreCast;
fun [ << $x$ - $y$ >> when x = y -> << 0 >>
| e -> e ];
| |
a5f136921f76038bac78a912f50e0fcd783f1040f3d3794c4e4b3e1b3a8c2dec | diagrams/geometry | BoundingBox.hs | {-# LANGUAGE DeriveFunctor #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE NoMonomorphismRestriction #-}
# LANGUAGE ScopedTypeVariabl... | null | https://raw.githubusercontent.com/diagrams/geometry/945c8c36b22e71d0c0e4427f23de6614f4e7594a/src/Geometry/BoundingBox.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE NoMonomorphismRestriction #
---------------------------------------------------------------------------
|
License : BSD-style (see LICENSE)
Maintainer :
Bounding boxes are not very compositional (/e.g./ it is not
possible to do anything sensible with the... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies ... |
a971acc09044b0b7d01735a4b5ff533c75e9e456913286f1b075a721619a57af | kadena-io/pact | Keysets.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
Module : Pact . Native . Keysets
Copyright : ( C ) 2016
-- License : BSD-style (see the file LICENSE)
Maintainer : < >
--
-- Builtins for working with keysets.
--
module Pact.Native.Keysets
( keyDefs
, readKeysetDef
)
where
import Control... | null | https://raw.githubusercontent.com/kadena-io/pact/564cf5f3440337f806c249032fb40a2be8aad734/src/Pact/Native/Keysets.hs | haskell | # LANGUAGE OverloadedStrings #
|
License : BSD-style (see the file LICENSE)
Builtins for working with keysets.
if namespaces match, leave the keyset name alone
otherwise, assume mismatching keysets | Module : Pact . Native . Keysets
Copyright : ( C ) 2016
Maintainer : < >
module Pact.Native.Keysets
( keyDefs
, readKeysetDef
)
where
import Control.Lens
import Data.Text (Text)
import Pact.Eval
import Pact.Native.Internal
import Pact.Types.KeySet
import Pact.Types.Purity
import P... |
4597d6dd2792ca0b962a4f99563cd95d698073de2e0ebc493f7317effe4178aa | luposlip/nd-db | project.clj | (defproject com.luposlip/nd-db "0.8.0"
:description "Clojure library to use newline delimited files as fast read-only databases."
:url "-db"
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:dependencies [[org.clojure/clojure "1.11.1"]
[com.taoensso/nippy "3.2.0"]
... | null | https://raw.githubusercontent.com/luposlip/nd-db/7941ecad0cca5704113a038c7789bd623357dc9f/project.clj | clojure | (defproject com.luposlip/nd-db "0.8.0"
:description "Clojure library to use newline delimited files as fast read-only databases."
:url "-db"
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:dependencies [[org.clojure/clojure "1.11.1"]
[com.taoensso/nippy "3.2.0"]
... | |
fbb67195906f382efa7c29cfd0f1315847d19ccd74f3417a38ddf9c177f8be08 | gearnode/erl-imf | imf_date_field.erl | Copyright ( c ) 2022 < > .
Copyright ( c ) 2021 Exograd SAS .
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED... | null | https://raw.githubusercontent.com/gearnode/erl-imf/0a75ff29b7409bb4a60de2ac2e072bc8bac1ce0f/src/imf_date_field.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 EVE... | Copyright ( c ) 2022 < > .
Copyright ( c ) 2021 Exograd SAS .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(imf_date_field).
-... |
b5b995c5d8953a3e18a3f046f5e870560a2d0d1d6e09fdf94c957fa9279fa5dd | dolotech/erlang_server | robot_handle.erl | %%----------------------------------------------------
%% Robot handle
%%
%% @author Rolong<>
%%----------------------------------------------------
-module(robot_handle).
-export([handle/3]).
-include("common.hrl").
-include("robot.hrl").
' 10协议_登陆认证
handle(11000, [LoginState, Growth, Rid], R) ->
%% ?INFO("110... | null | https://raw.githubusercontent.com/dolotech/erlang_server/44ea3693317f60e18b19c9ddfa179307cbd646d7/src/robot/robot_handle.erl | erlang | ----------------------------------------------------
Robot handle
@author Rolong<>
----------------------------------------------------
?INFO("11001:~w", [[LoginState, Growth, Rid]]),
正常登陆
请求玩家所有英雄
正常登陆
请求玩家所有英雄
创建角色
SexS = case Sex of
1 -> <<"男">>;
_ -> <<"未知">>
end,
?INFO("Reg:~s - ~s", [SexS, ... | -module(robot_handle).
-export([handle/3]).
-include("common.hrl").
-include("robot.hrl").
' 10协议_登陆认证
handle(11000, [LoginState, Growth, Rid], R) ->
case LoginState of
1 ->
io:format("1"),
robot ! {login_ok, R#robot.aid, Rid, self()},
赠送英雄
R#robot.pid_sender ! {cmd... |
e1c3f63796158e81d691ab42b94419bf2d5f8ad346cf6b4ff767d82865413637 | AlexKnauth/afl | language-info.rkt | #lang racket/base
(provide get-language-info)
(require racket/match)
(define (get-language-info data)
(define other-get-info
(match data
[(vector mod sym data2)
((dynamic-require mod sym) data2)]
[_ (lambda (key default) default)]))
(lambda (key default)
(case key
[(configure-run... | null | https://raw.githubusercontent.com/AlexKnauth/afl/a51e609615f7645d773a726b225d3356b751d017/afl/lang/language-info.rkt | racket | #lang racket/base
(provide get-language-info)
(require racket/match)
(define (get-language-info data)
(define other-get-info
(match data
[(vector mod sym data2)
((dynamic-require mod sym) data2)]
[_ (lambda (key default) default)]))
(lambda (key default)
(case key
[(configure-run... | |
08e77618e8b047a05351868aa9fc01df9228548a952b81ac73075537efdcf9bb | Kappa-Dev/KappaTools | intertab.mli | module type Tabinter =
sig
type var
type intervalle
type intervalle_tab
val make : int -> intervalle_tab
val set : intervalle_tab -> var -> intervalle -> unit
val read : intervalle_tab -> var -> intervalle
val affiche:
Remanent_parameters_sig.parameters ->
Exception.method_handler ->
interval... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/KaSa_rep/abstract_domains/numerical_domains/intertab.mli | ocaml | module type Tabinter =
sig
type var
type intervalle
type intervalle_tab
val make : int -> intervalle_tab
val set : intervalle_tab -> var -> intervalle -> unit
val read : intervalle_tab -> var -> intervalle
val affiche:
Remanent_parameters_sig.parameters ->
Exception.method_handler ->
interval... | |
b3bc13c08df7343f9adfdb139c6a9110942ea48ab9059fed121b57dd1dc3b49e | metrics-clojure/metrics-clojure | meters_test.clj | (ns metrics.test.meters-test
(:require [metrics.meters :as meters]
[metrics.test.test-utils :refer :all]
[clojure.test :refer :all]))
(meters/defmeter ["test" "meters" "defmetered"])
(deftest test-defmeter
(is (= (meters/rate-mean defmetered) 0.0))
(meters/mark! defmetered)
(is (> (met... | null | https://raw.githubusercontent.com/metrics-clojure/metrics-clojure/a1dbacc748a1f8165f0094e2229c84f228efe29b/metrics-clojure-core/test/metrics/test/meters_test.clj | clojure | (ns metrics.test.meters-test
(:require [metrics.meters :as meters]
[metrics.test.test-utils :refer :all]
[clojure.test :refer :all]))
(meters/defmeter ["test" "meters" "defmetered"])
(deftest test-defmeter
(is (= (meters/rate-mean defmetered) 0.0))
(meters/mark! defmetered)
(is (> (met... | |
7a77524968b1aef1cc9af86be0c043f4b2d757fc7e7412fc786d69fdb9803d5c | racket/draw | bitmap-stress.rkt | #lang racket/base
(require racket/class
racket/draw
racket/file)
;; Check memory-management in the bitmap/PNG/JPEG/etc. library by reading
;; and writing in many threads at the same time.
(define (check src save-type [read-type 'unknown/alpha])
(printf "~s ~s\n" save-type read-type)
(define ts
4... | null | https://raw.githubusercontent.com/racket/draw/a6558bdc18438e784c23d452ffd877dac867a7fd/draw-test/tests/racket/draw/bitmap-stress.rkt | racket | Check memory-management in the bitmap/PNG/JPEG/etc. library by reading
and writing in many threads at the same time.
Also check that we don't run out of C stack space due to error escapes
For the 'racket VM, we can further check that the port is read on demand
Assume other VMs read the poirt eagerly | #lang racket/base
(require racket/class
racket/draw
racket/file)
(define (check src save-type [read-type 'unknown/alpha])
(printf "~s ~s\n" save-type read-type)
(define ts
40 ) ] )
(thread
(lambda()
(for ([i (in-range 10)])
(define bm (read-bitmap (collection-fil... |
684e7a0f71dda00f1b638197d3d21ec596691db3b8deb9b15b94075b87a8d253 | aryx/xix | pattern.ml |
type pattern = string
(* todo: handle [ * ? *)
let match_str s1 s2 =
s1 = s2
| null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/shell/pattern.ml | ocaml | todo: handle [ * ? |
type pattern = string
let match_str s1 s2 =
s1 = s2
|
465aa7a6dc6cd39f156bb1594361306315b050969880a5b46dc79cf20130102b | bakul/s9fes | stddev.scm | Scheme 9 from Empty Space , Function Library
By , 2015
; Placed in the Public Domain
;
; (stddev list) ==> real
;
; (load-from-library "stddev.scm")
;
; Return the standard deviation of the given list of values.
;
Example : ( stddev ' ( 1 1 2 1 1 ) ) = = > 0.4
(load-from-library "variance.scm")
(def... | null | https://raw.githubusercontent.com/bakul/s9fes/74c14c0db5f07f5bc6d94131e9e4ee15a29275aa/lib/stddev.scm | scheme | Placed in the Public Domain
(stddev list) ==> real
(load-from-library "stddev.scm")
Return the standard deviation of the given list of values.
| Scheme 9 from Empty Space , Function Library
By , 2015
Example : ( stddev ' ( 1 1 2 1 1 ) ) = = > 0.4
(load-from-library "variance.scm")
(define (stddev set)
(sqrt (variance set)))
|
f3a9beae4ed3e4db8871d8d5d8566516a948658573b9dd28613c347c92b714fc | monky-hs/monky | Dynamic.hs |
Copyright 2016
This file is part of .
is free software : you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version . ... | null | https://raw.githubusercontent.com/monky-hs/monky/5430352258622bdb0a54f6a197090cc4ef03102f/Monky/Network/Dynamic.hs | haskell | # LANGUAGE TypeSynonymInstances #
|A Wrapper than also carries the name, for comparision
|The map we keep our handles in (the Int is the Interface ID on the system)
|The actual handel exposed and used by this module
|Get the sum of all read/write rates from our network devices or Nothing if none is active
|Logic f... |
Copyright 2016
This file is part of .
is free software : you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version . ... |
0cac62455e12ec2202d71e788784d77a2f31bf5ad2c1d836bb28639adc818d1d | shimmering-void/sketches | core.cljs | (ns ^:figwheel-hooks sketches.core
(:require
[goog.dom :as gdom]))
(println "This text is printed from src/sketches/core.cljs. Go ahead and edit it and see reloading in action.")
(defn multiply [a b] (* a b))
;; define your app data so that it doesn't get over-written on reload
(defonce app-state (atom {:text "... | null | https://raw.githubusercontent.com/shimmering-void/sketches/84d29636a798720e8db3379c21814fe9f92686fd/src/sketches/core.cljs | clojure | define your app data so that it doesn't get over-written on reload
specify reload hook with ^;after-load metadata
optionally touch your app-state to force rerendering depending on
your application
(swap! app-state update-in [:__figwheel_counter] inc) | (ns ^:figwheel-hooks sketches.core
(:require
[goog.dom :as gdom]))
(println "This text is printed from src/sketches/core.cljs. Go ahead and edit it and see reloading in action.")
(defn multiply [a b] (* a b))
(defonce app-state (atom {:text "Hello world!"}))
(defn get-app-element []
(gdom/getElement "app"))
... |
47f0a1395000d51bd2571bba49011aa4fe025ea419fd2f3584041be615e267ba | piotr-yuxuan/malli-cli | malli.clj | (ns piotr-yuxuan.malli-cli.malli
"Functions or overloaded functions that could be part of malli, but aren't (as of now)."
(:require [malli.core :as m]
[malli.util :as mu]))
(defn value-schemas
"Returns all leaf sub schemas for unique paths as a vector of maps
with :schema, :path and :in keys."
[s... | null | https://raw.githubusercontent.com/piotr-yuxuan/malli-cli/35d9634664387afa4121269e35aaacaab8e6bf4d/src/piotr_yuxuan/malli_cli/malli.clj | clojure | (ns piotr-yuxuan.malli-cli.malli
"Functions or overloaded functions that could be part of malli, but aren't (as of now)."
(:require [malli.core :as m]
[malli.util :as mu]))
(defn value-schemas
"Returns all leaf sub schemas for unique paths as a vector of maps
with :schema, :path and :in keys."
[s... | |
e6113a6cf101a20d8107ebe7b20498e1bcb98da620b2dddfd4c782edaa0ebc6f | awakesecurity/hocker | Types.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PartialTy... | null | https://raw.githubusercontent.com/awakesecurity/hocker/b9bc5993aa1eb786633199c1c6017f237de57c2b/src/Hocker/Types.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
# LANGUAGE OverloadedStrings #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE TypeOperators #
# OPTIONS -fno-warn-orphans #
-------------------------------------------------... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE StandaloneDeriving #
# LANGUAGE ViewPatterns #
Module : Hocker . Types
Copyright : ( C ) 2016 Awake Networks
Maintainer : Awake Networks < ... |
7b477c3f7c7b4fe34ae603e191992dbd9d3f02bbdb1d6179c3b4bf07f841e790 | nomnom-insights/nomnom.eternity | with_lock.clj | (ns eternity.middleware.with-lock
(:require
[clojure.tools.logging :as log]
[lockjaw.protocol :as lock]))
(defn handler [scheduled-fn]
(fn [{:keys [lock] :as component}]
(if (lock/acquire! lock)
(do
(log/debugf "lock-status=acquired name=%s" (:name lock))
(scheduled-fn component)... | null | https://raw.githubusercontent.com/nomnom-insights/nomnom.eternity/58dcdb3326e7e41e220c075f1e61e79bcd3d0733/src/eternity/middleware/with_lock.clj | clojure | (ns eternity.middleware.with-lock
(:require
[clojure.tools.logging :as log]
[lockjaw.protocol :as lock]))
(defn handler [scheduled-fn]
(fn [{:keys [lock] :as component}]
(if (lock/acquire! lock)
(do
(log/debugf "lock-status=acquired name=%s" (:name lock))
(scheduled-fn component)... | |
5eb76ece954039583d94799d1916ad169e28469afae0f82f51968231012d6818 | gfngfn/SATySFi | gencode.ml | open U
let failwith _ = ( ) ( * TEMPORARY
let failwith _ = () (* TEMPORARY *)
*)
module Const = struct
let stack = "stack"
let environment = "env"
let code = "code"
let dump = "dump"
let vmexec = "exec"
let func_prefix = "get_"
let ret = "ret"
let make_entry = "make_entry"
let trans_pri... | null | https://raw.githubusercontent.com/gfngfn/SATySFi/fba81313f513370135c662412c695af370be9870/tools/gencode/gencode.ml | ocaml | TEMPORARY
| fs ->
puts " | Op%s(%s) ->" inst @@
String.concat ", " @@ List.map Field.name fs
hmm...
use @ocaml.doc attribute to avoid puzzling over escaping | open U
let failwith _ = ( ) ( * TEMPORARY
*)
module Const = struct
let stack = "stack"
let environment = "env"
let code = "code"
let dump = "dump"
let vmexec = "exec"
let func_prefix = "get_"
let ret = "ret"
let make_entry = "make_entry"
let trans_prim = "transform_0_primitive"
let de... |
980b7f4476c3746ba58e2053de51ac6206242a5fb2888fed461c493a6854c452 | seanhess/yeti | UI.hs | module Yeti.UI
(
-- * Elements
module Yeti.UI.Element
-- * Styles
, module Yeti.UI.CSS
) where
import Yeti.UI.Element
import Yeti.UI.CSS hiding ((-))
| null | https://raw.githubusercontent.com/seanhess/yeti/b274dce41b0bf2f9115ea836d585aaff1cd2f5ac/src/Yeti/UI.hs | haskell | * Elements
* Styles | module Yeti.UI
(
module Yeti.UI.Element
, module Yeti.UI.CSS
) where
import Yeti.UI.Element
import Yeti.UI.CSS hiding ((-))
|
c59acc0a0e7e0ac9c533fd96aac40939ff6a92ea3f2d700efeabaa945b5759a0 | ztellman/penumbra | effects.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/src/penumbra/glsl/effects.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns penumbra.glsl.effects)
(def lighting
'((defn float4 lighting
[(in int -i)
(in float3 -normal)]
(let [n-dot-vp (max 0 (dot -normal (-> :light-source (nth 0) .position float3 normalize)))
n-dot-hv (max 0 (dot -normal (-> :light-source (n... |
da00893640de3c2677f6c0b71e75f1ac7bbd947f01116f5daea12c82b554c10f | ghcjs/ghcjs | throwto001.hs | import Control.Concurrent
import Control.Exception
import Data.Array
import System.Random
import System.Environment
import Control.Monad
import GHC.Conc
-- A fiendish throwTo test. A bunch of threads take random MVars from
a shared array ; if the MVar has Nothing in it , replace it with Just
of the current thread... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/concurrent/throwto001.hs | haskell | A fiendish throwTo test. A bunch of threads take random MVars from
standing.
On multiple CPUs this should give throwTo a good workout.
| import Control.Concurrent
import Control.Exception
import Data.Array
import System.Random
import System.Environment
import Control.Monad
import GHC.Conc
a shared array ; if the MVar has Nothing in it , replace it with Just
of the current thread 's ThreadId . If the MVar has another ThreadId
in it , then that ... |
8e5fa17203c6f8d250f96c8262975308a307fa024f5fa29aa0003f538b97e7ab | oliyh/martian | test_runner.cljs | (ns martian.test-runner
(:require [martian.test-test]
[figwheel.main.testing :refer [run-tests-async]]))
(defn -main [& args]
(run-tests-async 5000))
| null | https://raw.githubusercontent.com/oliyh/martian/c20d3fad47709ecfc0493e2fb607d5b56ea3193d/test/test/martian/test_runner.cljs | clojure | (ns martian.test-runner
(:require [martian.test-test]
[figwheel.main.testing :refer [run-tests-async]]))
(defn -main [& args]
(run-tests-async 5000))
| |
0e87ed5d3b5bf58784fe09dd8065674fc29df1d1f7fd66bdcc367c449ef9e656 | juxt/apex | parameters.clj | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.alpha.params.parameters
(:require
[clojure.string :as str]
[juxt.jinx-alpha :as jinx]
[muuntaja.core :as m]
[muuntaja.format.core :as mfc]
[muuntaja.format.json :as mfj]
[ring.util.codec :refer [url-decode]]))
;; TODO: Promote?
(defn error? [m]
(when... | null | https://raw.githubusercontent.com/juxt/apex/cb4c0016d817ebb03d4f84e572ca71edd84ed79d/modules/params/src/juxt/apex/alpha/params/parameters.clj | clojure | TODO: Promote?
TODO: Promote?
"boolean" (constantly false)
If the requires a boolean value, we treat an
'empty' value as a true.
If valid, add the parameter
If not valid, add an error
TODO: Adding errors should be a common function to promote
consistency across errors.
Complex Situation
Simple Situation
An e... | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.alpha.params.parameters
(:require
[clojure.string :as str]
[juxt.jinx-alpha :as jinx]
[muuntaja.core :as m]
[muuntaja.format.core :as mfc]
[muuntaja.format.json :as mfj]
[ring.util.codec :refer [url-decode]]))
(defn error? [m]
(when (associative? m)
... |
b2714f213ecfb35bebfbd1f1a0c1eb2d3bae1a8d92cf62a813e1fa8c5a1f8928 | ucsd-progsys/dsolve | excep-e.ml | DSOLVE -bare -dontminemlq
let f n k = if n >= 0 then () else k 0
let g n = assert (n = 1)
let n = read_int ()
let _ = f n g
| null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/POPL2010/excep-e.ml | ocaml | DSOLVE -bare -dontminemlq
let f n k = if n >= 0 then () else k 0
let g n = assert (n = 1)
let n = read_int ()
let _ = f n g
| |
37ddb67105fb67a507e57906f460970ff7b6f203a9698ecba25cebf6288ff564 | henryw374/cljc.java-time | temporal_amount.cljs | (ns cljc.java-time.temporal.temporal-amount (:refer-clojure :exclude [abs get range format min max next name resolve short]) (:require [cljc.java-time.extn.calendar-awareness] [goog.object] [java.time.temporal :refer [TemporalAmount]]))
(clojure.core/defn add-to {:arglists (quote (["java.time.temporal.TemporalAmount" "... | null | https://raw.githubusercontent.com/henryw374/cljc.java-time/2e47e8104bc2ec7f68a01bf751a7b9a2dee391b4/src/cljc/java_time/temporal/temporal_amount.cljs | clojure | (ns cljc.java-time.temporal.temporal-amount (:refer-clojure :exclude [abs get range format min max next name resolve short]) (:require [cljc.java-time.extn.calendar-awareness] [goog.object] [java.time.temporal :refer [TemporalAmount]]))
(clojure.core/defn add-to {:arglists (quote (["java.time.temporal.TemporalAmount" "... | |
dca67bfe833a1448aebc713b0370c9a85c8410f6e3afb0d730e0cd4e628ecc91 | ztellman/penumbra | controller.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by... | null | https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/src/penumbra/app/controller.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns penumbra.app.controller
(:import [java.util.concurrent CountDownLatch]))
(defprotocol Controller
(paused? [c] "Returns true if the application is paused.")
(pause! [c] "Pauses the application.")
(stopped? [c] "Returns true if the application is stopped.")
(... |
6d09c7beeaad709b9fa9d3cc7a3ef3a5b8d1b2efcb9bbe82702b32b23cc0d846 | ocsigen/js_of_ocaml | exceptions.ml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2019 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/77ad64fccbc103d3e8168d599a50298f6c123200/compiler/tests-compiler/exceptions.ml | ocaml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2019 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | |
7307a04dfe8a1eb2a27eef23acf722f617df34615cf39371d1fcc43b7dd751e7 | mirage/mirage | opam.ml |
* Copyright ( c ) 2013 - 2020 < >
* Copyright ( c ) 2013 - 2020 Anil Madhavapeddy < >
* Copyright ( c ) 2015 - 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice an... | null | https://raw.githubusercontent.com/mirage/mirage/bf5520527c304ca37795eb454ec0d3d5714d0963/lib/functoria/opam.ml | ocaml | this is invoked from within the mirage subdirectory |
* Copyright ( c ) 2013 - 2020 < >
* Copyright ( c ) 2013 - 2020 Anil Madhavapeddy < >
* Copyright ( c ) 2015 - 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice an... |
f4c73986dc4c7ebe9bca83f4ec97a3a31e66056a5014640835eea95cb2e3a2c3 | nick8325/equinox | Fair.hs | module Equinox.Fair where
Equinox -- Copyright ( c ) 2003 - 2007 , is hereby granted , free of charge , to any person obtaining a
copy of this software and associated documentation files ( the
" Software " ) , to deal in the Software without restriction , including
without limitation the rights to use , co... | null | https://raw.githubusercontent.com/nick8325/equinox/67351fbc4358fdea931b4c1dfb659f5527b40917/Haskell/Equinox/Fair.hs | haskell | Copyright ( c ) 2003 - 2007 , is hereby granted , free of charge , to any person obtaining a
Copyright (c) 2003-2007, Koen Claessen | module Equinox.Fair where
copy of this software and associated documentation files ( the
" Software " ) , to deal in the Software without restriction , including
without limitation the rights to use , copy , modify , merge , publish ,
distribute , sublicense , and/or sell copies of the Software , and to
perm... |
8128f7b53dc67fdf8a7a6d04aebbbbb179b9bb56e997429b12cca3004fc3f20d | realworldocaml/examples | htable_sig2.ml | val create_hashtable :
init_size:int -> allow_shrinking:bool -> ('a,'b) Hashtable.t
| null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/variables-and-functions/htable_sig2.ml | ocaml | val create_hashtable :
init_size:int -> allow_shrinking:bool -> ('a,'b) Hashtable.t
| |
c698725db44bc688a7dd4e4a4ed0213ee226a20122c19ae4c7a637cf64f45154 | simonmichael/hledger | TimedotReader.hs | --- * -*- outline-regexp:"--- \\*"; -*-
--- ** doc
In Emacs , use TAB on lines beginning with " -- * " to collapse / expand sections .
|
A reader for the " timedot " file format .
Example :
@
; DATE
; ACCT DOTS # Each dot represents 15 m , spaces are ignored
; ACCT 8 # numbers with or without ... | null | https://raw.githubusercontent.com/simonmichael/hledger/b46cb8a7f77df569373d0b2b12bba5e97eff76c7/hledger-lib/Hledger/Read/TimedotReader.hs | haskell | - * -*- outline-regexp:"--- \\*"; -*-
- ** doc
- ** language
# LANGUAGE OverloadedStrings #
- ** exports
* Reader
* Misc other exports
- ** imports
- ** doctest setup
$setup
>>> :set -XOverloadedStrings
- ** reader
- ** utilities
for debugging:
traceparse' s = trace s $ return ()
- ** parsers
XXX rename export a... | In Emacs , use TAB on lines beginning with " -- * " to collapse / expand sections .
|
A reader for the " timedot " file format .
Example :
@
; DATE
; ACCT DOTS # Each dot represents 15 m , spaces are ignored
; ACCT 8 # numbers with or without a following h represent hours
; ACCT 5 m # n... |
e0e4d681b5624f18129becf1f8a89a61f056468b6f3e84770dde3fd0fe143861 | himura/twitter-conduit | oauth_callback.hs | {-# LANGUAGE OverloadedStrings #-}
-- Example:
-- $ export OAUTH_CONSUMER_KEY="your consumer key"
-- $ export OAUTH_CONSUMER_SECRET="your consumer secret"
-- $ runhaskell oauth_callback.hs
module Main where
import Control.Monad.IO.Class
import qualified Data.ByteString as S
import qualified Data.ByteString.Cha... | null | https://raw.githubusercontent.com/himura/twitter-conduit/f80058ba58fc6d71437324247eaa34b9fdd6d4d2/sample/oauth_callback.hs | haskell | # LANGUAGE OverloadedStrings #
Example:
$ export OAUTH_CONSUMER_KEY="your consumer key"
$ export OAUTH_CONSUMER_SECRET="your consumer secret"
$ runhaskell oauth_callback.hs |
module Main where
import Control.Monad.IO.Class
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as S8
import Data.IORef
import qualified Data.Map as M
import Data.Maybe
import qualified Data.Text.Lazy as LT
import qualified Network.HTTP.Types as HT
import System.Environment
import System... |
edea9d970f585332296139af5825f150417875a15993f9779c15946c070afa19 | kappelmann/eidi2_repetitorium_tum | More_Threads.ml | open Event
let rec map f = function [] -> []
| x::xs -> f x::map f xs
let tmap f l = let rec help = function [] -> []
| x::xs -> let c = new_channel ()
in let _ = Thread.create (fun c -> sync (send c (f x))) c
in (receive c)::help xs
in map sync (help l)
in den integer si... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/2016/threads/solutions/More_Threads.ml | ocaml | Should print My magnific mailbox makes me marvel!
Should print empty | open Event
let rec map f = function [] -> []
| x::xs -> f x::map f xs
let tmap f l = let rec help = function [] -> []
| x::xs -> let c = new_channel ()
in let _ = Thread.create (fun c -> sync (send c (f x))) c
in (receive c)::help xs
in map sync (help l)
in den integer si... |
1b238426df1418b8229e76864c35cb873f3fb6fcc328cde2d04f8582073d310f | 40ants/lw-vim-mode | vars.lisp | (in-package :vim)
(defparameter *vim-repeat-multiplier* nil
"The repeat multiplier, e.g. the 2 in 2d4j.")
(defparameter *vim-pending-action* (constantly nil)
"Stores a closure to run after the next movement command. Used to implement things
like dj.")
(defparameter *vim-last-action* #'identity
"Stores a closure... | null | https://raw.githubusercontent.com/40ants/lw-vim-mode/ff4e825df34c02692e06da0aebabcabda5bb304a/vars.lisp | lisp | I'd really like a font that says "change the background to yellow but leave
we need a ring of these, too. | (in-package :vim)
(defparameter *vim-repeat-multiplier* nil
"The repeat multiplier, e.g. the 2 in 2d4j.")
(defparameter *vim-pending-action* (constantly nil)
"Stores a closure to run after the next movement command. Used to implement things
like dj.")
(defparameter *vim-last-action* #'identity
"Stores a closure... |
58c7412660c06823a0117c154ba74be4db685d5f172335f4b1371fbc0bf00eb2 | erlang-ls/erlang_ls | diagnostics_gradualizer.erl | -module(diagnostics_gradualizer).
-export([g/1]).
-spec f(integer()) -> integer().
f(N) ->
N.
-spec g(boolean()) -> boolean().
g(N) ->
f(N).
| null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/705f2c0d7a385bc630bf077fd578f1b48578b32c/apps/els_lsp/priv/code_navigation/src/diagnostics_gradualizer.erl | erlang | -module(diagnostics_gradualizer).
-export([g/1]).
-spec f(integer()) -> integer().
f(N) ->
N.
-spec g(boolean()) -> boolean().
g(N) ->
f(N).
| |
72d79f40c396dffefcc34f79a44019c9a5959ee5188dac6b925f95257b0badef | Bogdanp/racket-dbg | backreference.rkt | #lang racket/base
(require racket/class
(prefix-in gui: racket/gui)
racket/gui/easy
"dot.rkt"
"reference-graph.rkt")
(provide
render-backreferences)
(define (render-backreferences what graph)
(define root
(render
(window
#:title (format "~a Backreferences" what)
... | null | https://raw.githubusercontent.com/Bogdanp/racket-dbg/61301be81d74e049d0dc48f4d4f2229639eff01a/dbg-ui/ui/backreference.rkt | racket | #lang racket/base
(require racket/class
(prefix-in gui: racket/gui)
racket/gui/easy
"dot.rkt"
"reference-graph.rkt")
(provide
render-backreferences)
(define (render-backreferences what graph)
(define root
(render
(window
#:title (format "~a Backreferences" what)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.