_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 |
|---|---|---|---|---|---|---|---|---|
a1ede73ba291c51c459c8f844fbf788c6bb0d29c0f127a709403216a641996ba | cabol/erlbus | ebus_proc.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% Process utilities.
%%% @end
%%%-------------------------------------------------------------------
-module(ebus_proc).
%% API
-export([wait_for_msg/0, wait_for_msg/1]).
-export([messages/0, messages/1, r_messages/1]).
-export([spawn_ti... | null | https://raw.githubusercontent.com/cabol/erlbus/050cb728ef09a0ad51c9297281602e362b5e233d/src/utils/ebus_proc.erl | erlang | -------------------------------------------------------------------
@doc
Process utilities.
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
@equi... | -module(ebus_proc).
-export([wait_for_msg/0, wait_for_msg/1]).
-export([messages/0, messages/1, r_messages/1]).
-export([spawn_timer_fun/1]).
-export([spawn_handler/1, spawn_handler/2, spawn_handler/3]).
-export([spawn_callback_handler/3, spawn_callback_handler/4]).
wait_for_msg() ->
wait_for_msg(infinity).
Wai... |
8dc1f41eaec6d7e4df01185ad0fe0c6f3863ad53ce02781d11ea281d577d54b4 | ninenines/cowboy | echo_get_sup.erl | %% Feel free to use, reuse and abuse the code in this file.
@private
-module(echo_get_sup).
-behaviour(supervisor).
%% API.
-export([start_link/0]).
%% supervisor.
-export([init/1]).
%% API.
-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% supervisor.
... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/examples/echo_get/src/echo_get_sup.erl | erlang | Feel free to use, reuse and abuse the code in this file.
API.
supervisor.
API.
supervisor. |
@private
-module(echo_get_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
Procs = [],
{ok, {{one_for_one, 10, 10}, Procs}}.
|
2018070f864725b75dd271e571f5c9569746fc36260d8ddd3640142da2d56461 | mnasoft/math | ls-gsll-doc.lisp | (in-package #:MATH/LS-GSLL)
| null | https://raw.githubusercontent.com/mnasoft/math/9bdd318a8653e14694236d79b6d2bd4b6c3f2cee/src/ls-gsll/ls-gsll-doc.lisp | lisp | (in-package #:MATH/LS-GSLL)
| |
05653bcbba6f0a6ee34cc83df7219a68621b947fe14ddbbaf3996de6892bce99 | CSCfi/rems | test_db.clj | (ns ^:integration rems.test-db
"Namespace for tests that use an actual database."
(:require [clojure.test :refer :all]
[rems.config]
[rems.context :as context]
[rems.db.applications :as applications]
[rems.db.core :as db]
[rems.db.roles :as roles]
... | null | https://raw.githubusercontent.com/CSCfi/rems/af65570a5e5a6102aec4dc85d07d0f6fbb60c18d/test/clj/rems/test_db.clj | clojure | add should be idempotent
default role
just a smoke test, check that create-demo-data doesn't fail | (ns ^:integration rems.test-db
"Namespace for tests that use an actual database."
(:require [clojure.test :refer :all]
[rems.config]
[rems.context :as context]
[rems.db.applications :as applications]
[rems.db.core :as db]
[rems.db.roles :as roles]
... |
4a47421634c125a3007d9c463615a3c93aec8023b3dd8e203ecf7e75abb2726a | iustin/corydalis | TypesSpec.hs |
Copyright ( C ) 2013
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed i... | null | https://raw.githubusercontent.com/iustin/corydalis/43f8bf004904847fad43c428a9e1b20e67da964d/test/TypesSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
Copyright ( C ) 2013
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed i... |
d25ceade5f261753a9c2c5f62f540713e0eb493d4e36f05741afeac983bf6d54 | astrada/ocaml-extjs | ext_panel_Panel.ml | class type t =
object('self)
inherit Ext_panel_AbstractPanel.t
method dd : _ Js.t Js.prop
method addTool : _ Js.t -> unit Js.meth
method afterCollapse : bool Js.t -> unit Js.meth
method afterExpand : bool Js.t -> unit Js.meth
method beforeDestroy : unit Js.meth
method close : unit Js.meth
method coll... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_panel_Panel.ml | ocaml | class type t =
object('self)
inherit Ext_panel_AbstractPanel.t
method dd : _ Js.t Js.prop
method addTool : _ Js.t -> unit Js.meth
method afterCollapse : bool Js.t -> unit Js.meth
method afterExpand : bool Js.t -> unit Js.meth
method beforeDestroy : unit Js.meth
method close : unit Js.meth
method coll... | |
e36ca9f8f24d6aaa35292bcfcc4c884781d638d8f77f72ecdcb7137df8a3565e | mariachris/Concuerror | thread_ring.erl | The Computer Language Benchmarks Game
%%% /
Contributed by
-module(thread_ring).
-export([main/1, roundtrip/2, test1/0]).
-define(RING, 5).
start(Token) ->
H = lists:foldl(
fun(Id, Pid) -> spawn(thread_ring, roundtrip, [Id, Pid]) end,
self(),
lists:seq(?RING, 2, -1)),
H ! Token,
roun... | null | https://raw.githubusercontent.com/mariachris/Concuerror/87e63f10ac615bf2eeac5b0916ef54d11a933e0b/testsuite/suites/resources/src/shootout/thread_ring.erl | erlang | / | The Computer Language Benchmarks Game
Contributed by
-module(thread_ring).
-export([main/1, roundtrip/2, test1/0]).
-define(RING, 5).
start(Token) ->
H = lists:foldl(
fun(Id, Pid) -> spawn(thread_ring, roundtrip, [Id, Pid]) end,
self(),
lists:seq(?RING, 2, -1)),
H ! Token,
roundtrip(... |
cfc21674c4ba5204488a32f1d582a9c7df54d767495f32254387c5bff6e9267a | fragnix/fragnix | Data.Text.hs | # LANGUAGE Haskell98 #
{-# LINE 1 "Data/Text.hs" #-}
# LANGUAGE BangPatterns , CPP , MagicHash , , UnboxedTuples #
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE Trustworthy #
# LANGUAGE TypeFamilies #
-- |
-- Module : Data.Text
Copyright : (... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/application/Data.Text.hs | haskell | # LINE 1 "Data/Text.hs" #
|
Module : Data.Text
License : BSD-style
Maintainer :
Stability : experimental
Suitable for performance critical use, both in terms of large data
quantities and high speed.
/Note/: Read below the synopsis for important notes on the use of
this module.
This module is ... | # LANGUAGE Haskell98 #
# LANGUAGE BangPatterns , CPP , MagicHash , , UnboxedTuples #
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE Trustworthy #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2009 , 2010 , 2011 , 2012 ,
( c ) 2009 ... |
69f4df7e9f5ce3b977816999d0ba1663dae9c46cba6d71f8389635598cc9a3b8 | dongcarl/guix | gd.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2016 < >
Copyright © 2015 , 2016 < >
Copyright © 2015 < >
Copyright © 2016 , 2017 < >
Copyright © 2017 < >
Copyright © 2017 < >
Copyright © 2018 , 2019 , 2020 < >
;;;
;;; This file is part of GNU Guix.
;;;
... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/packages/gd.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2016 < >
Copyright © 2015 , 2016 < >
Copyright © 2015 < >
Copyright © 2016 , 2017 < >
Copyright © 2017 < >
Copyright © 2017 < >
Copyright © 2018 , 2019 , 2020 < >
under the terms of the GNU General Public License as published by
You should have received a cop... |
3e90efc0f5be31fa2cdfe54c55569ac12405d3408d320d50cc3f7324b75dfcdf | jhgarner/Xest-Window-Manager | site.hs | --------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "images/*" $ do... | null | https://raw.githubusercontent.com/jhgarner/Xest-Window-Manager/d1e7640b70fea662508f99778535069e9c639517/xest-site/site.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
match "index.html" $ do
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
get... | import Data.Monoid (mappend)
import Hakyll
main :: IO ()
main = hakyll $ do
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match (fromList ["about.rst", "contact.markdown"])... |
a51b4cf376466b1573042634cf924f5cc825a95d1c0240f80e8c6a6d7a9f075b | Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator | Referencable.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Many fields in OpenAPI can be either a reference or a concrete object.
-- This module adds this capabilities.
--
-- For more information see #reference-object
module OpenAPI.Generate.Types.Referencable where
import Data.Text (Text)
import Data.Yaml
-- | Represents either a ref... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/d9cc91717b773882be65ec290c020dd0adb7cc3b/openapi3-code-generator/src/OpenAPI/Generate/Types/Referencable.hs | haskell | # LANGUAGE OverloadedStrings #
| Many fields in OpenAPI can be either a reference or a concrete object.
This module adds this capabilities.
For more information see #reference-object
| Represents either a reference or a concrete value
| A reference with the JSON reference string pointing to the referenced target
... |
module OpenAPI.Generate.Types.Referencable where
import Data.Text (Text)
import Data.Yaml
data Referencable a
Reference Text
Concrete a
deriving (Show, Eq, Ord)
instance FromJSON a => FromJSON (Referencable a) where
parseJSON (Object v) = do
maybeReference <- v .:? "$ref"
case maybeReference of
... |
d2a270b0cb8f1190f963fa92a0e0d03f9309ddb0b9f27ecc580bbbcfc8974c95 | mbutterick/aoc-racket | day09.rkt | #lang scribble/lp2
@(require scribble/manual aoc-racket/helper)
@aoc-title[9]
@defmodule[aoc-racket/day09]
@link[""]{The puzzle}. Our @link-rp["day09-input.txt"]{input} consists of a list of distances between fictional cities, e.g., @italic{AlphaCentauri to Straylight = 133}.
@chunk[<day09>
<day09-setup>
... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/day09.rkt | racket | #lang scribble/lp2
@(require scribble/manual aoc-racket/helper)
@aoc-title[9]
@defmodule[aoc-racket/day09]
@link[""]{The puzzle}. Our @link-rp["day09-input.txt"]{input} consists of a list of distances between fictional cities, e.g., @italic{AlphaCentauri to Straylight = 133}.
@chunk[<day09>
<day09-setup>
... | |
5a631d0cd8c55ba4a7ff7ce189110adb76506bf96cbc958df53cde11685ad0fd | shortishly/pgmp | pgmp_connection_sync.erl | Copyright ( c ) 2022 < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under... | null | https://raw.githubusercontent.com/shortishly/pgmp/6313a48cdcb76e43c0f076635b2753d69b40812c/src/pgmp_connection_sync.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissi... | Copyright ( c ) 2022 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(pgmp_connection_sync).
-export([bind/1]).
-export([describe/1]).
-export([execute/1]).
-export([parameters/1]).
-export([parse/1]).
-ex... |
90b2814dcf72c1e49396437eaf5455b219258b7056b732c61cebdcfe43f67074 | Relph1119/sicp-solutions-manual | p26-fib.scm | (define (fib n)
(fib-iter 1 0 n))
(define (fib-iter a b count)
(if (= count 0)
b
(fib-iter (+ a b) a (- count 1)))) | null | https://raw.githubusercontent.com/Relph1119/sicp-solutions-manual/f2ff309a6c898376209c198030c70d6adfac1fc1/src/examples/ch01/p26-fib.scm | scheme | (define (fib n)
(fib-iter 1 0 n))
(define (fib-iter a b count)
(if (= count 0)
b
(fib-iter (+ a b) a (- count 1)))) | |
d2e56e036d2bada9807d749af565f48ecf9d205c7f05083e6364ce4ca81446c7 | rizo/snowflake-os | sort.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/stdlib/sort.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : sort.ml , v 1.10 2005 - 10 - ... |
61e74e879694d97c69145bc5b9c5daf6af807816e18d94c5adf5e6ed785bfbde | nibbula/yew | time.lisp | ;;;
;;; unix/time.lisp - Unix interface to time and timers
;;;
(in-package :opsys-unix)
(declaim #.`(optimize ,.(getf opsys-config::*config* :optimization-settings)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Timers / Timing
#+linux ;; @@@ Only checked on linux so far
(progn
(d... | null | https://raw.githubusercontent.com/nibbula/yew/d53e707238dccdd69f1f8ed3fa4f8c24f59d28c7/opsys/unix/time.lisp | lisp |
unix/time.lisp - Unix interface to time and timers
@@@ Only checked on linux so far
type of DST correction to apply
adjtime??
setitimer/getitimer
Interval timers are probably best provided in relation to some kind of
"event loop"
timerfd
period
expiration
@@@ maybe make a nice interface to it?
(defun ma... |
(in-package :opsys-unix)
(declaim #.`(optimize ,.(getf opsys-config::*config* :optimization-settings)))
Timers / Timing
(progn
(defparameter *clocks* nil "Types of system clocks.")
(define-to-list *clocks*
#(#(+CLOCK-REALTIME+ 0 "System realtime clock.")
#(+CLOCK-MONOTONIC+ 1 "Monoto... |
e6a05ca7ab2d2f93067206277c66689fdc0061e775a8a3bdd9df4557769cd8b5 | ocaml-community/ocamlscript | revised.ml | Using revised syntax
(* Camlp4 is used by default *)
Ocaml.use_camlp4 : = true
(* this selects the revised syntax: *)
Ocaml.revised := true
--
(* This is the program in the revised syntax: *)
value hello () =
do { print_endline "Hello!";
print_endline "Goodbye!" }
;
value _ = hello ()
;
| null | https://raw.githubusercontent.com/ocaml-community/ocamlscript/df0f04d7e41655944bd14e6989dd695425e5f871/examples/revised.ml | ocaml | Camlp4 is used by default
this selects the revised syntax:
This is the program in the revised syntax: | Using revised syntax
Ocaml.use_camlp4 : = true
Ocaml.revised := true
--
value hello () =
do { print_endline "Hello!";
print_endline "Goodbye!" }
;
value _ = hello ()
;
|
d85a88a6e0c453c0bc6274c89ddfe0aa3bbedfbe90f4b9ad7eea41cf4d4db310 | ds-wizard/engine-backend | ContextLenses.hs | module Registry.Model.Context.ContextLenses where
import Data.Pool (Pool)
import qualified Data.UUID as U
import Database.PostgreSQL.Simple (Connection)
import GHC.Records
import Network.Minio (MinioConn)
import Registry.Model.Config.ServerConfig
import Registry.Model.Context.AppContext
import Registry.Model.Context.... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/12717256cde8d20020e30cd55dc3ef00fef9362a/engine-registry/src/Registry/Model/Context/ContextLenses.hs | haskell | module Registry.Model.Context.ContextLenses where
import Data.Pool (Pool)
import qualified Data.UUID as U
import Database.PostgreSQL.Simple (Connection)
import GHC.Records
import Network.Minio (MinioConn)
import Registry.Model.Config.ServerConfig
import Registry.Model.Context.AppContext
import Registry.Model.Context.... | |
208c5874b34982ff87cb0b0756e9c3f146522dfc55d1d4567d2c19745354ff28 | rbkmoney/genlib | genlib_app.erl | %%
%% Application related activities
-module(genlib_app).
-export([
childspec/4,
childspec/5,
permanent/3,
transient/3,
temporary/3,
supervisor/3,
priv_dir/0,
priv_dir/1,
priv_path/1,
priv_path/2,
start_application/1,
start_application_with/2,
stop_unload_applica... | null | https://raw.githubusercontent.com/rbkmoney/genlib/4565a8d73f34a0b78cca32c9cd2b97d298bdadf8/src/genlib_app.erl | erlang |
Application related activities
Private directories expansion
|
-module(genlib_app).
-export([
childspec/4,
childspec/5,
permanent/3,
transient/3,
temporary/3,
supervisor/3,
priv_dir/0,
priv_dir/1,
priv_path/1,
priv_path/2,
start_application/1,
start_application_with/2,
stop_unload_applications/1,
test_application_start/... |
c93f46646ca0fe5b16d1922a652ddb883b3f0b7da348904bd790c2214cc92996 | fp-works/2019-winter-Haskell-school | GolfSpec.hs | module GolfSpec where
import Golf
import Test.Hspec
import Data.List.HT
spec :: Spec
spec =
describe "Golf" $ do
skipsSpec
localMaximaSpec
skipsSpec :: Spec
skipsSpec = do
it "returns correct" $ do
skips "ABCD" `shouldBe` ["ABCD", "BD", "C", "D"]
skips "hello!" `shouldBe` ["hello!", "el!", "l!"... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week3/robert-change/Golf/test/GolfSpec.hs | haskell | module GolfSpec where
import Golf
import Test.Hspec
import Data.List.HT
spec :: Spec
spec =
describe "Golf" $ do
skipsSpec
localMaximaSpec
skipsSpec :: Spec
skipsSpec = do
it "returns correct" $ do
skips "ABCD" `shouldBe` ["ABCD", "BD", "C", "D"]
skips "hello!" `shouldBe` ["hello!", "el!", "l!"... | |
a6bb99d865b19c84c81e10073671db9ae134fccfade98f1d87d3a7be8d56549e | kqqsysu/ssdb-erlang | ssdb_conn.erl | %%% @author
( C ) 2015 , kongqingquan
@doc SSDB erlang client .
%%% @end
Created : 2015.05.01
%%%-------------------------------------------------------------------
-module(ssdb_conn).
-author("").
-include("ssdb.hrl").
-export([init/1,handle_cast/2,handle_call/3,handle_info/2,terminate/2,code_change/3]).
... | null | https://raw.githubusercontent.com/kqqsysu/ssdb-erlang/158b5b494794f241eded66a1ad04d97e9303975b/src/ssdb_conn.erl | erlang | @author
@end
-------------------------------------------------------------------
parse packet
parse data
wait for get size
packet finish
send_packet | ( C ) 2015 , kongqingquan
@doc SSDB erlang client .
Created : 2015.05.01
-module(ssdb_conn).
-author("").
-include("ssdb.hrl").
-export([init/1,handle_cast/2,handle_call/3,handle_info/2,terminate/2,code_change/3]).
-export([start_link/2]).
start_link(Host,Port) ->
gen_server:start_link(?MODULE,[Host,P... |
75a05d495f6978c636a497320d898bda512339aea12f78d782e3e95f532191cb | rabbitmq/rabbitmq-management | rabbit_mgmt_wm_extensions.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2011 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_mgmt_wm_extensions).
-export([ini... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/543906f01ccd0344aff648f21bb6b5156b2a2ca2/src/rabbit_mgmt_wm_extensions.erl | erlang |
-------------------------------------------------------------------- | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2011 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_mgmt_wm_extensions).
-export([init/2, t... |
6fb7904c481878f85f9ce6b54026a2fde0906e0bb02f0f4e8f75ce47a3d732f6 | cloudkj/lambda-ml | hierarchical.clj | (ns lambda-ml.clustering.hierarchical
"Hierarchical agglomerative clustering.
Example usage:
```
(def data [[1 1 1 0 1 0 0 1 1 1]
[1 1 0 1 1 0 0 0 0 1]
[0 1 1 0 1 0 0 1 0 0]
[0 0 0 1 0 1 0 0 0 0]
[1 1 1 0 1 0 1 1 1 0]
[0 1 0 1 1 0 0 0 0 1]
... | null | https://raw.githubusercontent.com/cloudkj/lambda-ml/a470a375d2b94f5e5e623a5e198ac312b018ffb3/src/lambda_ml/clustering/hierarchical.clj | clojure | Clear queue for k1
Update distances
Deactivate cluster k2
Merge k1 and k2 | (ns lambda-ml.clustering.hierarchical
"Hierarchical agglomerative clustering.
Example usage:
```
(def data [[1 1 1 0 1 0 0 1 1 1]
[1 1 0 1 1 0 0 0 0 1]
[0 1 1 0 1 0 0 1 0 0]
[0 0 0 1 0 1 0 0 0 0]
[1 1 1 0 1 0 1 1 1 0]
[0 1 0 1 1 0 0 0 0 1]
... |
c767022b762e00d73aea57383f931f38213466571a2d368d7d23fd1aa05110af | reborg/clojure-essential-reference | 6.clj | (require '[clojure.main :as main])
(def repl-options
[:prompt #(printf "enter expression :> ")
< 1 >
< 2 >
(main/skip-whitespace *in*))
(re-find #"^(\d+)([\+\-\*\/])(\d+)$" (read-line)))) ; <3>
< 4 >
(({"+" + "-" - "*" * "/" /} op)
(Integer. x) (In... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/TheToolbox/clojure.main/6.clj | clojure | <3>
< 5 >
click ctrl+d to exit calculator | (require '[clojure.main :as main])
(def repl-options
[:prompt #(printf "enter expression :> ")
< 1 >
< 2 >
(main/skip-whitespace *in*))
< 4 >
(({"+" + "-" - "*" * "/" /} op)
(Integer. x) (Integer. y)))])
(apply main/repl repl-options)
6 |
9d5db28bf4b37a2d1f3e92160e058ae519b3731d622926a91fdbc3bc5bea26fb | commercialhaskell/stack | Build.hs | {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Build-specific types.
module Stack.Types.Build
( BuildException (..)
, BuildPrettyException (..)
, pprintTargetParseErrors
, ConstructPlanException (..)
, BadDependency (.... | null | https://raw.githubusercontent.com/commercialhaskell/stack/e140b3a5729d01c60900ed98a3a60845a2fab82b/src/Stack/Types/Build.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
| Build-specific types.
| Type representing exceptions thrown by functions exported by modules with
names beginning @Stack.Build@.
found
expected
expected
expected
Path to the stack.yaml file
... |
module Stack.Types.Build
( BuildException (..)
, BuildPrettyException (..)
, pprintTargetParseErrors
, ConstructPlanException (..)
, BadDependency (..)
, ParentMap
, FlagSource (..)
, UnusedFlags (..)
, InstallLocation (..)
, Installed (..)
, psVersion
, Task (..)
, taskIsTarget
, taskLoca... |
a4d9351490aa25212c086fa295cbbb62bc3a34649b9909c9dc58af86e9f9dc5c | chenyukang/eopl | base-iterp.scm |
(define value-of-simple-exp
(lambda (exp env)
(cases simple-expression exp
(cps-const-exp (num) (num-val num))
(cps-var-exp (var) (apply-env env var))
(cps-diff-exp (exp1 exp2)
(let ((val1
(expval->num
... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch6/base/base-iterp.scm | scheme | value-of/k : TfExp * Env * Cont -> FinalAnswer
apply-cont : Cont * ExpVal -> Final-ExpVal
the end of the computation. |
(define value-of-simple-exp
(lambda (exp env)
(cases simple-expression exp
(cps-const-exp (num) (num-val num))
(cps-var-exp (var) (apply-env env var))
(cps-diff-exp (exp1 exp2)
(let ((val1
(expval->num
... |
7da5898a1a457f2a74feed44348b24cb5383066107bea5f63ebe5f824389c263 | lenn0x/Event-Notifier | thrift_server.erl | %%
Licensed to the Apache Software Foundation ( ASF ) under one
%% or more contributor license agreements. See the NOTICE file
%% distributed with this work for additional information
%% regarding copyright ownership. The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
%% "License"); you ... | null | https://raw.githubusercontent.com/lenn0x/Event-Notifier/5b370624578f4610b4af71c989c13068c2cbbf58/thrift-erl/src/thrift_server.erl | erlang |
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
"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 require... | Licensed to the Apache Software Foundation ( ASF ) under one
to you under the Apache License , Version 2.0 ( the
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(thrift_server).
-behaviour(gen_server).
-export([start_link/3, stop/1,... |
15e3e36b07f0a5a7f75f8ce8c275982796b14d00fd0d6246ab95f477db6d024b | ejgallego/coq-serapi | ser_notation_gram.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/61d2a5c092c1918312b8a92f43a374639d1786f9/serlib/ser_notation_gram.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
************************************... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright 2016 - 2018 MINES... |
a6f890d54747011e2ddfed5a852b924c6f6a9bf13b7eb469af47401f0a22158f | samrushing/irken-compiler | f_anno2.scm |
(define (thing:(char char -> {a=char b=int}) a b)
{a=a b=b}
)
(thing #\a #\b)
| null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/f_anno2.scm | scheme |
(define (thing:(char char -> {a=char b=int}) a b)
{a=a b=b}
)
(thing #\a #\b)
| |
2303d54efc406001d17664c8a9c427b3d562a87c54b6d136b700e9b2ae1758d1 | potatosalad/erlang-jose | jose_curve25519_unsupported.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2022 ,
%%% @doc
%%%
%%% @end
Created : 02 Jan 2016 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/dbc4074066080692246afe613345ef6becc2a3fe/src/jwa/curve25519/jose_curve25519_unsupported.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
jose_curve25519 callbacks
====================================================================
jose_curve25519 callbacks
=================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2022 ,
Created : 02 Jan 2016 by < >
-module(jose_curve25519_unsupported).
-behaviour(jose_curve25519).
-export([eddsa_keypair/0]).
-export([eddsa_keypair/1]).
-export([eddsa_secret_to_public... |
7fd473581acd70507dd336c666a4532654a2f3959a26ee290a3d979a44be4ea9 | lasp-lang/partisan | lampson_2pc.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . 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/lasp-lang/partisan/fd048fc1b34309d9fa41450434a7e7b3b2fa1fb8/protocols/lampson_2pc.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 ) 2019 . 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(lampson_2pc).
-aut... |
9258be2ef5cf0a0c24be6bec7dbe137f54961a862ff31576c15c1d5124c3af5e | pfeodrippe/orchardia | info.clj | (ns orchard.info
(:require [orchard.clr :as clr]
[orchard.meta :as m]))
(defn info
[ns sym]
(or
;; it's a special (special-symbol?)
(m/special-sym-meta sym)
;; it's a var
(m/var-meta (m/resolve-var ns sym))
sym is an alias for another ns
(m/ns-meta (get (m/resolve-aliases ns) sym))
... | null | https://raw.githubusercontent.com/pfeodrippe/orchardia/42cb2b663f59e3ee314e3e2fe128407162a0183a/src/orchard/info.clj | clojure | it's a special (special-symbol?)
it's a var
it's simply a full ns | (ns orchard.info
(:require [orchard.clr :as clr]
[orchard.meta :as m]))
(defn info
[ns sym]
(or
(m/special-sym-meta sym)
(m/var-meta (m/resolve-var ns sym))
sym is an alias for another ns
(m/ns-meta (get (m/resolve-aliases ns) sym))
(m/ns-meta (find-ns sym))
it 's a Java class / membe... |
b633bd7565c081b648eed637945c4a17a9cda799153eb65adcdf5238e97e6583 | jahfer/clj-activitypub | core_test.clj | (ns clj-activitypub.core-test
(:require [clojure.test :as t :refer (is deftest testing)]
[clj-activitypub.core :as core]))
(defn mock-date []
(str "2022-12-27T20:46:05.915189Z"))
(deftest config
(testing "#config creates hash of expected results"
(let [data {:domain "example.com"
... | null | https://raw.githubusercontent.com/jahfer/clj-activitypub/ccf652e3bc3296e5bd9bf549667145857e33feaf/activitypub-core/test/clj_activitypub/core_test.clj | clojure | (ns clj-activitypub.core-test
(:require [clojure.test :as t :refer (is deftest testing)]
[clj-activitypub.core :as core]))
(defn mock-date []
(str "2022-12-27T20:46:05.915189Z"))
(deftest config
(testing "#config creates hash of expected results"
(let [data {:domain "example.com"
... | |
61a7b73a350b004047259d5d82bd514015f0a01a5ae2b67bb6aaae2e31f4fda6 | lokke-org/lokke | uuid.scm | Copyright ( C ) 2021 - 2022 < >
SPDX - License - Identifier : LGPL-2.1 - or - later OR EPL-1.0 +
(define-module (lokke uuid)
#:duplicates (merge-generics replace warn-override-core warn last)
#:use-module ((ice-9 format) #:select (format))
#:use-module ((lokke pr) #:select (pr-readable to-string))
#:use... | null | https://raw.githubusercontent.com/lokke-org/lokke/69a97ca5c6448d7a319cd175594ccf9f2a4a8bde/mod/lokke/uuid.scm | scheme | easily provide a pure scheme basis later.
node-based, etc.) is accepted, even versions that aren't yet
defined in a standard. We assume that all of the versions can be
converted to an integer by reading the serialized string as a
network-byte-order hexadecimal encoding. Currently, the only
allowed variant is t... | Copyright ( C ) 2021 - 2022 < >
SPDX - License - Identifier : LGPL-2.1 - or - later OR EPL-1.0 +
(define-module (lokke uuid)
#:duplicates (merge-generics replace warn-override-core warn last)
#:use-module ((ice-9 format) #:select (format))
#:use-module ((lokke pr) #:select (pr-readable to-string))
#:use... |
8755baf3145be5da0d6ab417e95e59e367d7f2e45341d533aafdcb7a990aecfa | uim/uim | test-light-record.scm | : Unit tests for light-record.scm
;;
Copyright ( c ) 2008 - 2013 uim Project
;;
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
1 . Redistributions of source code must reta... | null | https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/test2/test-light-record.scm | scheme |
All rights reserved.
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
... | : Unit tests for light-record.scm
Copyright ( c ) 2008 - 2013 uim Project
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of authors nor the names of its contributors
THIS SOFTWARE IS PROVIDE... |
7a3e26052584c7b01ed7b65d01f1f49f46a29727fab7cf4de5c3e857748434f7 | bytekid/mkbtt | existentialGoal.ml | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mkbtt/existentialGoal.ml | ocaml | ** SUBMODULES *********************************************************
** FUNCTIONS **********************************************************
------------------------------------------------------------------
CREATE goal
-------------------------------------... | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... |
777849f032488a1d469cbdd4cc3815f1315e5ff1a8b2a2a180ebc2e0b48b4070 | nyu-acsys/drift | x_plus_2_pow_n00.ml |
let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1086 = 0
let rec c0_COEFFICIENT_1085 = 0
let rec succ_without_checking_1117 set_flag_succ_1093 s_succ_n_1090 n_1031 =
let set_flag_succ_1093 = true
in
let s_succ_n_1090 = n_1031
in
n_1031 + 1
let rec succ_... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/termination/x_plus_2_pow_n00.ml | ocaml | -:{v:Int | true}
-:{v:Int | true} |
let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1086 = 0
let rec c0_COEFFICIENT_1085 = 0
let rec succ_without_checking_1117 set_flag_succ_1093 s_succ_n_1090 n_1031 =
let set_flag_succ_1093 = true
in
let s_succ_n_1090 = n_1031
in
n_1031 + 1
let rec succ_... |
98bbe2980b6814b477b2668a61eea774513cbdec7341254c2cea52fdafed02e1 | strega-nil/stregaml | Internal.ml | open! Types.Pervasives
module Span = Spanned.Span
module Untyped_ast = Cafec_Parse.Ast
module Untyped_expr = Untyped_ast.Expr
module Untyped_type = Cafec_Parse.Type
module Attribute = Untyped_ast.Attribute
module Expr = Ast.Expr
module Local = Ast.Expr.Local
module Binding = Ast.Binding
module Function_declaration = s... | null | https://raw.githubusercontent.com/strega-nil/stregaml/83b51826d5776926fb3f4b7ad03c7ffe837ecbf8/lib/typed_ast/Internal.ml | ocaml |
note: since ig < ig2, this means that no matter what,
ig binds looser than ig2
TODO: fix this
probably want to do a fold on locals?
technically should be bottom, but _shrug_
check for triviality of the variant type | open! Types.Pervasives
module Span = Spanned.Span
module Untyped_ast = Cafec_Parse.Ast
module Untyped_expr = Untyped_ast.Expr
module Untyped_type = Cafec_Parse.Type
module Attribute = Untyped_ast.Attribute
module Expr = Ast.Expr
module Local = Ast.Expr.Local
module Binding = Ast.Binding
module Function_declaration = s... |
f64dc2e2b2c52e7e7782f0d823d3f280af9dd13fc5a7c11b7a570acd9b0448a9 | amalloy/aoc-2021 | Main.hs | module Main where
import Control.Arrow ((&&&))
import Data.List (foldl', sort)
import Data.Maybe (mapMaybe)
data Closer = Closer { _opener :: Char, _score :: Int } deriving Show
data ParseResult = Correct | Corrupted Int | Incomplete [Char] deriving Show
closer :: Char -> Maybe Closer
closer = flip lookup
[ (')', ... | null | https://raw.githubusercontent.com/amalloy/aoc-2021/4821bc051ee0ee4120d72b27c00ae009e32f3faa/day10/src/Main.hs | haskell | module Main where
import Control.Arrow ((&&&))
import Data.List (foldl', sort)
import Data.Maybe (mapMaybe)
data Closer = Closer { _opener :: Char, _score :: Int } deriving Show
data ParseResult = Correct | Corrupted Int | Incomplete [Char] deriving Show
closer :: Char -> Maybe Closer
closer = flip lookup
[ (')', ... | |
7fd43259fa41c11c089d3fc362511fc0bb431087262dfa6e84080c1e0d7512bf | c4-project/c4f | flow_dead.ml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/fuzz_actions/src/flow_dead.ml | ocaml | We should already be in a bottom anchor, so this is equivalent
to checking for full, which, in turn, tells us that the loop
is unpopulated. | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... |
b0719ee7c5d671c3b3720cf5ac7f6f66552e5db37e20a577af753acb71a02ad8 | imitator-model-checker/imitator | RunPaTATOR.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Specification et Verification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
*
* Author : ... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/ea560fd1e58fbca9a0666658d9d8fbd232f39dda/src/RunPaTATOR.mli | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Specification et Verification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
*
* Author : ... | |
dee20d9a70fb9757f7f068bb1e866033d1ba9712552a1cc9f5dde060d9d2f8b7 | halcat0x15a/one | core.cljs | (ns one.core
(:require [clojure.string :as string]))
(defn get-buffer [editor]
(let [current (:current editor)]
(case current
:minibuffer (current editor)
(current (:buffers editor)))))
(defn set-buffer [editor buffer]
(let [current (:current editor)]
(case current
:minibuffer (assoc e... | null | https://raw.githubusercontent.com/halcat0x15a/one/b37197ccf47c1dc1fb0e12f1cb2bee8491d07d80/src-cljs/one/core.cljs | clojure | (ns one.core
(:require [clojure.string :as string]))
(defn get-buffer [editor]
(let [current (:current editor)]
(case current
:minibuffer (current editor)
(current (:buffers editor)))))
(defn set-buffer [editor buffer]
(let [current (:current editor)]
(case current
:minibuffer (assoc e... | |
2ed0015410917720d233cfa577344e02a7105a4dc9b902f89477d60a4622d9cb | geophf/1HaskellADay | Exercise.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2017.M09.D25.Exercise where
import qualified Codec.Compression.GZip as GZ
import Data.Aeson
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Map (Map)
import Network.HTTP.Conduit
below import available via 1Haske... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2017/M09/D25/Exercise.hs | haskell | # LANGUAGE OverloadedStrings #
}
n.b. I ignore some attributes in the raw text
}
- BONUS -----------------------------------------------------------------
Output the above structure as JSON. Yeah, I went there. Fight me.
- |
module Y2017.M09.D25.Exercise where
import qualified Codec.Compression.GZip as GZ
import Data.Aeson
import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Map (Map)
import Network.HTTP.Conduit
below import available via 1HaskellADay git repository
import Y2017... |
44a32735dffea83dbca194a354191366283ab07776bd9cd24037bbf6962ced22 | Liutos/Project-Euler | pro16.lisp | (defun pro16 (n)
(labels ((rec (num sum)
(if (zerop num)
sum
(rec (truncate (/ num 10))
(+ sum (rem num 10))))))
(rec n 0))) | null | https://raw.githubusercontent.com/Liutos/Project-Euler/dd59940099ae37f971df1d74c4b7c78131fd5470/pro16.lisp | lisp | (defun pro16 (n)
(labels ((rec (num sum)
(if (zerop num)
sum
(rec (truncate (/ num 10))
(+ sum (rem num 10))))))
(rec n 0))) | |
fbb680562c5ac587493c503c464a4dbcb09660fbc8d3ababaa644ced220e362c | nikodemus/SBCL | assem-rtns.lisp | ;;;; the machine specific support routines needed by the file assembler
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The so... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/src/assembly/x86/assem-rtns.lisp | lisp | the machine specific support routines needed by the file assembler
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
RETURN-MULTIPLE
the frame for the function that is returning to the end of... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!VM")
For RETURN - MULTIPLE , we have to move the results from the end of
(define-assembly-routine
(... |
631410a5fe4d248901938a2294b720d9ee886e2ce14b1204ead01569139e9c13 | Eonblast/Scalaxis | yaws_websockets.erl | %%%----------------------------------------------------------------------
%%% File : yaws_websockets.erl
Author : < >
%%% Purpose :
Created : 18 Dec 2009 by < >
%%% Modified:
%%%----------------------------------------------------------------------
-module(yaws_websockets).
-author('').
-include("../... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/contrib/yaws/src/yaws_websockets.erl | erlang | ----------------------------------------------------------------------
File : yaws_websockets.erl
Purpose :
Modified:
----------------------------------------------------------------------
Yaws will take care of closing the socket
This should take care of all the Data Framing scenarios specified in
-hixie-thew... | Author : < >
Created : 18 Dec 2009 by < >
-module(yaws_websockets).
-author('').
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
-include_lib("kernel/include/file.hrl").
-export([handshake/3, unframe_one/1, unframe_all/2]).
handshake(Arg, ContentPid, S... |
b001b4d410c26e970a4b911176a5cc7553556aca43992427bb980c5d93509279 | asr/apia | IO.hs |
| Utilities on IO .
# LANGUAGE UnicodeSyntax #
module Apia.Utils.IO
( equalFiles
, notEqualFiles
) where
------------------------------------------------------------------------------
import Apia.Prelude
import Agda.Utils.Monad ( ifM )
import qualified Data.ByteString.Lazy as BL ( readFile )
-----------... | null | https://raw.githubusercontent.com/asr/apia/a66c5ddca2ab470539fd68c42c4fbd45f720d682/src/Apia/Utils/IO.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
| Return 'True' if the files are equals, otherwise the function
returns 'False'.
| Return 'True' if the files are different, otherwise the function
returns 'False... |
| Utilities on IO .
# LANGUAGE UnicodeSyntax #
module Apia.Utils.IO
( equalFiles
, notEqualFiles
) where
import Apia.Prelude
import Agda.Utils.Monad ( ifM )
import qualified Data.ByteString.Lazy as BL ( readFile )
equalFiles ∷ FilePath → FilePath → IO Bool
equalFiles f1 f2 = liftM2 (==) (BL.readFile f1... |
f4c21bbd1b91bb5d18ca35c483fe8d6f09dc39cc6ece79496ea5e2665af37e72 | esl/lhttpc | lhttpc_lib.erl | %%% ----------------------------------------------------------------------------
Copyright ( c ) 2009 , Erlang Training and Consulting Ltd.
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without
%%% modification, are permitted provided that the following conditions are met... | null | https://raw.githubusercontent.com/esl/lhttpc/6530ef818bf904bf4ef615f384d2fc7bae44a6dc/src/lhttpc_lib.erl | erlang | ----------------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
... | Copyright ( c ) 2009 , Erlang Training and Consulting Ltd.
* Neither the name of Erlang Training and Consulting Ltd. nor the
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL Erlang Training and Consulting Ltd. BE
@private
@author < >
-modul... |
e467773724242a7c31ec45b6204197f5eeeb2245086af37ec8b228281b3b18aa | fantasytree/fancy_game_server | emysql_worker.erl | -module(emysql_worker).
-export([behaviour_info/1]).
-export([start/1, execute/2]).
-export([start_worker/2, worker_loop/2]).
behaviour_info(callbacks) -> [{init, 1}, {process, 1}];
behaviour_info(_) -> undefined.
@spec start(Module ) - > Result
%% Module = atom()
%% Result = {ok, pid()} | {error, term... | null | https://raw.githubusercontent.com/fantasytree/fancy_game_server/4ca93486fc0d5b6630170e79b48fb31e9c6e2358/apps/emysql/src/emysql_worker.erl | erlang | Module = atom()
Result = {ok, pid()} | {error, term()}
Pid = pid()
Message = term()
Result = term()
@hidden
@hidden
@hidden
@hidden | -module(emysql_worker).
-export([behaviour_info/1]).
-export([start/1, execute/2]).
-export([start_worker/2, worker_loop/2]).
behaviour_info(callbacks) -> [{init, 1}, {process, 1}];
behaviour_info(_) -> undefined.
@spec start(Module ) - > Result
start(Module) ->
proc_lib:start_link(emysql_worker, start_worker,... |
86ff17359a5701c36674ce0ac01bfe97785e9ae2784fbcafb3141caeb30c3d62 | dyoo/whalesong | reader.rkt | #lang s-exp syntax/module-reader
;; -lang.org/planet/hash-lang-planet.html
#:language (lambda (ip)
`(file ,(path->string base-lang-path)))
(require racket/runtime-path)
(define-runtime-path base-lang-path "../../lang/base.rkt")
| null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/base/lang/reader.rkt | racket | -lang.org/planet/hash-lang-planet.html | #lang s-exp syntax/module-reader
#:language (lambda (ip)
`(file ,(path->string base-lang-path)))
(require racket/runtime-path)
(define-runtime-path base-lang-path "../../lang/base.rkt")
|
db72ed06f2f4f602b8bf5f01d0ca9f52d3163573fa478a64bc88a1a9196217a1 | softwarelanguageslab/maf | R5RS_various_work-3.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((fix (let ((z (lambda (P)
(lambda (u)
(lambda (t)
(lambda (t)
(lamb... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_various_work-3.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0 | * removed : 0
* added : 1
* swaps : 0
* calls to i d fun : 1
(letrec ((fix (let ((z (lambda (P)
(lambda (u)
(lambda (t)
(lambda (t)
(lambda (i)
(lambda (n)
... |
6301ef7da0ddb5a43fb63d8b0bc917b1ddb0f104d3bfdb45725e49dae9ecf328 | keera-studios/haskellifi-trayicon | Icon.hs | -- | Installs the icon in the system traybar when the program is initialised
--
-- (Model => View): Installs the icon in the system traybar.
--
-- Note: The event comes from the model, although the exact contents of the
-- model is not used in any way.
--
Copyright : ( C ) trading as Keera Studios , 2012
-- Lice... | null | https://raw.githubusercontent.com/keera-studios/haskellifi-trayicon/d148387bb362f7cdc959c2a07e981675b7e6bc29/src/Controller/Conditions/Icon.hs | haskell | | Installs the icon in the system traybar when the program is initialised
(Model => View): Installs the icon in the system traybar.
Note: The event comes from the model, although the exact contents of the
model is not used in any way.
License : BSD3 | Copyright : ( C ) trading as Keera Studios , 2012
Maintainer :
module Controller.Conditions.Icon where
import Graphics.UI.Gtk
import CombinedEnvironment
import Paths_haskellifi_trayicon
installHandlers :: CEnv -> IO()
installHandlers cenv = onEvent pm Initialised $ condition cenv
where pm = model cenv... |
89204c76b3486bd92e264b404729dd2341dcdaef5464c930f649fe56a74c3362 | johnwhitington/ocamli | exercise03.ml | type 'a tree =
Lf
| Br of 'a * 'a tree * 'a tree
let rec equal_shape tr tr2 =
match tr, tr2 with
Lf, Lf ->
true
| Br (_, l, r), Br (_, l2, r2) ->
equal_shape l l2 && equal_shape r r2
| _, _ ->
false
let rec tree_map f tr =
match tr with
Br (x, l, r) -> Br (f x, tree... | null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/OCaml%20from%20the%20Very%20Beginning/Chapter%2011/exercise03.ml | ocaml | type 'a tree =
Lf
| Br of 'a * 'a tree * 'a tree
let rec equal_shape tr tr2 =
match tr, tr2 with
Lf, Lf ->
true
| Br (_, l, r), Br (_, l2, r2) ->
equal_shape l l2 && equal_shape r r2
| _, _ ->
false
let rec tree_map f tr =
match tr with
Br (x, l, r) -> Br (f x, tree... | |
f868daeb1fdcb9d85e66a779479f72da99e6dd97b84bb929bc30640ad7389116 | denistakeda/re-posh | core_test.cljs | (ns todomvc.core-test
(:require
[cljs.test :refer-macros [deftest is testing]]
[todomvc.core]))
;; TODO: Add tests
| null | https://raw.githubusercontent.com/denistakeda/re-posh/f17ed7b05e930af97dd39ea0555915edac836177/examples/todomvc/test/todomvc/core_test.cljs | clojure | TODO: Add tests | (ns todomvc.core-test
(:require
[cljs.test :refer-macros [deftest is testing]]
[todomvc.core]))
|
79eb011ecc196576f2db312c7a45a53cf8b27b154da2185a33ed0efc0f5adf83 | mhuebert/re-view | util.cljs | (ns re-view.material.util
(:require [re-view.core :refer [defview]]
[clojure.string :as string]
[goog.object :as gobj]
[goog.dom.classes :as classes]
[goog.dom :as gdom]
[clojure.set :as set]
[react]))
(defn ensure-str [s]
(when-not (contains?... | null | https://raw.githubusercontent.com/mhuebert/re-view/ba38cd09b78b3c6db6a2983f3e2cf1bd6294564f/material/src/re_view/material/util.cljs | clojure | always add classes, in case some were removed? | (ns re-view.material.util
(:require [re-view.core :refer [defview]]
[clojure.string :as string]
[goog.object :as gobj]
[goog.dom.classes :as classes]
[goog.dom :as gdom]
[clojure.set :as set]
[react]))
(defn ensure-str [s]
(when-not (contains?... |
4075e666259bc59c646255f495477132a87f139ed7105cdb349a2f7a89b18bdf | xldenis/ill | Interpret.hs | module Thrill.Interpret where
import Thrill.Prelude
import Thrill.Syntax.Core as Core hiding (constructors)
import Thrill.Syntax hiding (Expression(..))
import Thrill.Syntax.Pretty ((<+>), hsep)
import Control.Monad.Except
import Control.Monad.State
import... | null | https://raw.githubusercontent.com/xldenis/ill/46bb41bf5c82cd6fc4ad6d0d8d33cda9e87a671c/src/Thrill/Interpret.hs | haskell | check for partial application | module Thrill.Interpret where
import Thrill.Prelude
import Thrill.Syntax.Core as Core hiding (constructors)
import Thrill.Syntax hiding (Expression(..))
import Thrill.Syntax.Pretty ((<+>), hsep)
import Control.Monad.Except
import Control.Monad.State
import... |
0c81adfd931e1e1fcec7f529d4a96f23126c1a9c4ab01319bd623e71d1c59b95 | monadfix/named | Test.hs | # LANGUAGE OverloadedLabels , DataKinds , TypeOperators , ViewPatterns ,
PartialTypeSignatures #
PartialTypeSignatures #-}
{-# OPTIONS -fno-warn-partial-type-signatures #-}
module Main where
import Data.Maybe (fromMaybe)
import Data.Function ((&))
import Named
test1 ::
String ->
"a" ... | null | https://raw.githubusercontent.com/monadfix/named/6dcdcaf35bd2fd9ddd17c989d38899a4ddc7aad7/test/Test.hs | haskell | # OPTIONS -fno-warn-partial-type-signatures #
Couldn't match type ‘"a"’ with ‘"b"’
arising from the overloaded label ‘#b’
test3' :: _ => "a" :! _ -> _ :! "b" -> _
test3' (arg #b -> a) (arg #a -> b) = a + b | # LANGUAGE OverloadedLabels , DataKinds , TypeOperators , ViewPatterns ,
PartialTypeSignatures #
PartialTypeSignatures #-}
module Main where
import Data.Maybe (fromMaybe)
import Data.Function ((&))
import Named
test1 ::
String ->
"a" :! Bool ->
"b" :! Bool ->
IO ()
test1 "str" (a... |
25b34aec6df62aeaa5d25e7643a4df0961580847f599b99e7d29a5385915f94f | tallaproject/onion | prop_hybrid.erl | %%%
Copyright ( c ) 2016 The Talla Authors . All rights reserved .
%%% Use of this source code is governed by a BSD-style
%%% license that can be found in the LICENSE file.
%%%
%%% -----------------------------------------------------------
@author < >
%%% @doc Property Tests for onion_hybrid.
%%% @end
%%% -----... | null | https://raw.githubusercontent.com/tallaproject/onion/d0c3f86c726c302744d3cfffa2de21f85c190cf0/test/prop_hybrid.erl | erlang |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-----------------------------------------------------------
@doc Property Tests for onion_hybrid.
@end
-----------------------------------------------------------
Properties. | Copyright ( c ) 2016 The Talla Authors . All rights reserved .
@author < >
-module(prop_hybrid).
-export([prop_iso/0]).
-include_lib("onion/include/onion_test.hrl").
-spec prop_iso() -> term().
prop_iso() ->
?FORALL({{S, P}, Message}, {test_keypair(), non_empty(binary())},
begin
Encryp... |
57e4c5eae6a914ea311ddbc94007e237af5216c0f4afa49c1806734b7eaf553f | shayne-fletcher/zen | state.ml | State monad
type ('s, 'a) state =
| State of ('s -> 'a * 's)
;;
let run : ('s, 'a) state -> 's -> ('a * 's) =
fun x ->
match x with
| State u -> u
;;
let bind : ('s, 'a) state -> ('a -> ('s, 'b) state) -> ('s, 'b) state =
fun m k ->
State (
fun state0 ->
let (a, state1) =... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/state/state.ml | ocaml | Basic test. | State monad
type ('s, 'a) state =
| State of ('s -> 'a * 's)
;;
let run : ('s, 'a) state -> 's -> ('a * 's) =
fun x ->
match x with
| State u -> u
;;
let bind : ('s, 'a) state -> ('a -> ('s, 'b) state) -> ('s, 'b) state =
fun m k ->
State (
fun state0 ->
let (a, state1) =... |
c4a8c1d14368ed72645b2c36406c1db0cef24cb6e7f36e57c2bf69d3f559a4b2 | mirage/ocaml-dns | dns.mli | ( c ) 2017 - 2019 , all rights reserved
* µDNS - an opinionated Domain Name System ( DNS ) library
The Domain Name System is a hierarchical and decentralized naming system
used on the Internet . It associates domain names with nearly arbitrary
information . Best known is the translation of easily m... | null | https://raw.githubusercontent.com/mirage/ocaml-dns/5f14bcdeea2868b6fa3086a1ec6404b85bda7608/src/dns.mli | ocaml | * The type of supported protocols. Used by {!Packet.encode} to decide on
maximum buffer length, etc.
* The type of opcodes.
* [pp ppf opcode] pretty-prints the [opcode] on [ppf].
* [compare a b] compares the opcode [a] with [b], using the RFC-specified
integer representation of each opcode.
* The type of... | ( c ) 2017 - 2019 , all rights reserved
* µDNS - an opinionated Domain Name System ( DNS ) library
The Domain Name System is a hierarchical and decentralized naming system
used on the Internet . It associates domain names with nearly arbitrary
information . Best known is the translation of easily m... |
9311af2f0b8714d33da1403fff4fcfd7cfb683b063e12064fa95d0706b88908b | dustmop/co2 | addressing-tests.scm | #lang racket
(require rackunit "../compile.scm")
(define (compile-code code)
(clear-result)
(make-variable! 'n)
(process-form (datum->syntax #f code))
(fetch-result))
(define (compile-code-first-error code)
(clear-errors)
(process-form (datum->syntax #f code))
(first-error))
(check-equal? (compile-cod... | null | https://raw.githubusercontent.com/dustmop/co2/49cd2c9fac25777bb0fe1877075602c167956d90/unit-tests/addressing-tests.scm | scheme | #lang racket
(require rackunit "../compile.scm")
(define (compile-code code)
(clear-result)
(make-variable! 'n)
(process-form (datum->syntax #f code))
(fetch-result))
(define (compile-code-first-error code)
(clear-errors)
(process-form (datum->syntax #f code))
(first-error))
(check-equal? (compile-cod... | |
55f7e6b1408aa9b0a0089e4de4b7edebc5dc86352600ad61f0c6b468ce7f7f58 | hspec/hspec-subject | Subject.hs | # LANGUAGE TemplateHaskell #
module Test.Hspec.Subject (
subject
, describe_
, it_
) where
import Test.Hspec
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Language.Haskell.Meta.Parse (parseExp)... | null | https://raw.githubusercontent.com/hspec/hspec-subject/6b1a1d9e8a633d99728710eb699c6f3db49e4371/src/Test/Hspec/Subject.hs | haskell | # LANGUAGE TemplateHaskell #
module Test.Hspec.Subject (
subject
, describe_
, it_
) where
import Test.Hspec
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Language.Haskell.Meta.Parse (parseExp)... | |
14310b3a4ea13cc542700cfd454e91f2f839458e27f72224e16a90eeaf4baede | williamleferrand/accretio | ys_googlemaps_types.ml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/shared/ys_googlemaps_types.ml | ocaml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | |
5acc497ddccda8e23bbfa41081f9b7eb4a3013dbb8b2f667db3c6501f95bd442 | Sergeileduc/Edit-comics-GIMP | script-clean-page.scm | (define (script-fu-clean-page image)
(let*
(
(drawable (car (gimp-image-active-drawable image)))
)
;Prep
;(gimp-context-push)
(gimp-image-undo-group-start image)
;Context
(gimp-context-set-paint-mode LAYER-MODE-NORMAL)
(gimp-context-set-opacity 100)
(gimp-image-select-color image CHANNEL-OP-REPLAC... | null | https://raw.githubusercontent.com/Sergeileduc/Edit-comics-GIMP/0bc1a89784fadbaf2118251dccb297ff76d0712e/scripts/script-clean-page.scm | scheme | Prep
(gimp-context-push)
Context
Test si la sélection est vide
Enlève les trous la sélection
end if
(gimp-context-pop)
end let | (define (script-fu-clean-page image)
(let*
(
(drawable (car (gimp-image-active-drawable image)))
)
(gimp-image-undo-group-start image)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL)
(gimp-context-set-opacity 100)
(gimp-image-select-color image CHANNEL-OP-REPLACE drawable (car (gimp-context-get-backgrou... |
74a7a255843a6fb68c06c2e24151d92bd3374341ded010ab4d2739ed9add2c2d | arohner/spectrum | invoke_wrong_type.clj | (ns spectrum.examples.bad.invoke-wrong-type
(:require [clojure.spec.alpha :as s]))
(s/fdef foo :args (s/cat :x keyword?) :ret string?)
(defn foo [x]
"foo")
(s/fdef bad :args empty? :ret string?)
(defn bad []
(foo 3))
| null | https://raw.githubusercontent.com/arohner/spectrum/72b47a91a5ce4567eed547507d25b2528f48c2d1/test/spectrum/examples/bad/invoke_wrong_type.clj | clojure | (ns spectrum.examples.bad.invoke-wrong-type
(:require [clojure.spec.alpha :as s]))
(s/fdef foo :args (s/cat :x keyword?) :ret string?)
(defn foo [x]
"foo")
(s/fdef bad :args empty? :ret string?)
(defn bad []
(foo 3))
| |
a3a1e41cf9251a042dbf0b93dc56562094aa38b591e1a2170eb5133305c480e4 | lasp-lang/lasp | lasp_peer_service.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 . 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/lasp-lang/lasp/1701c8af77e193738dfc4ef4a5a703d205da41a1/src/lasp_peer_service.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 ) 2015 . 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(lasp_peer_service).
-... |
c86a502fb6c7ac3ec67c0eb0fd4f52376e6cc333f0d0c748f9d075388b294c16 | incoherentsoftware/defect-process | AI.hs | module Enemy.All.Zombie.AI
( thinkAI
) where
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.State (execStateT, get, lift, modify, put, unless)
import Attack
import Configs
import Configs.All.Enemy
import Configs.All.Enemy.Zombie
import Configs.All.Settings
import Configs.All.Settings.Debug
im... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Enemy/All/Zombie/AI.hs | haskell | module Enemy.All.Zombie.AI
( thinkAI
) where
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.State (execStateT, get, lift, modify, put, unless)
import Attack
import Configs
import Configs.All.Enemy
import Configs.All.Enemy.Zombie
import Configs.All.Settings
import Configs.All.Settings.Debug
im... | |
03566e370ec9cc07debc2b041e517f4e596cf228d69f99239b6e1365be5eb14c | GianlucaGuarini/fortytwo | ConfirmExample.hs | module ConfirmExample where
import FortyTwo (confirm, confirmWithDefault)
main :: IO Bool
main = do
confirm "Do you like music?"
confirmWithDefault "Do you like pop music?" False
confirmWithDefault "Do you play an instrument?" True
| null | https://raw.githubusercontent.com/GianlucaGuarini/fortytwo/6d8d801f85e1dd993ee4cae6490a638872a14b47/demo/ConfirmExample.hs | haskell | module ConfirmExample where
import FortyTwo (confirm, confirmWithDefault)
main :: IO Bool
main = do
confirm "Do you like music?"
confirmWithDefault "Do you like pop music?" False
confirmWithDefault "Do you play an instrument?" True
| |
ad123eecb06706dc0bb2526418ef25505031963e969e91526c1f3734a34e7e25 | lisp-korea/sicp2014 | ex-3-04.scm | ex 3.3
(define (make-account balance passwd)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(define (incorrect-passwd amount)
... | null | https://raw.githubusercontent.com/lisp-korea/sicp2014/9e60f70cb84ad2ad5987a71aebe1069db288b680/vvalkyrie/3.1/ex-3-04.scm | scheme | ex 3.3
(define (make-account balance passwd)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(define (incorrect-passwd amount)
... | |
a177bae5e0b2fa52644f7b3e436f79853f3d4b307d78b708d60e38acb9e3d149 | WhatsApp/erlt | tuple.erl | -file("elm_core/src/tuple.erlt", 1).
-module(tuple).
-eqwalizer_unchecked([]).
-export([pair/2, pair/1]).
-export([first/1, second/1]).
-export([map_first/2,
map_first/1,
map_second/2,
map_second/1,
map_both/3,
map_both/2]).
-spec pair(A, B) -> {A, B}.
pair(A, B) -> {... | null | https://raw.githubusercontent.com/WhatsApp/erlt/616a4adc628ca8754112e659701e57f1cd7fecd1/tests/elm_core/ir-spec/tuple.erl | erlang | -file("elm_core/src/tuple.erlt", 1).
-module(tuple).
-eqwalizer_unchecked([]).
-export([pair/2, pair/1]).
-export([first/1, second/1]).
-export([map_first/2,
map_first/1,
map_second/2,
map_second/1,
map_both/3,
map_both/2]).
-spec pair(A, B) -> {A, B}.
pair(A, B) -> {... | |
430180148b29699bcb7136d1e5ecdd5b851e24808a7facaf99893c9d001f0517 | tlehman/sicp-exercises | ex-2.02.scm | Exercise 2.02 : Consider the problem of representing line segments in
; a plane. Each segment is represented as a pair of points: a starting
; point and and ending point.
;
; Define a constructor make-segment and selectors start-segment and
; end-segment that define the representation of segments in terms of
; point... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-2.02.scm | scheme | a plane. Each segment is represented as a pair of points: a starting
point and and ending point.
Define a constructor make-segment and selectors start-segment and
end-segment that define the representation of segments in terms of
points.
Furthermore, a point can be represented as a pair of
numbers: the x any... | Exercise 2.02 : Consider the problem of representing line segments in
(define (print-point p)
(display "(")
(display (x-point p))
(display ",")
(display (y-point p))
(display ")")
(newline))
(define (make-segment p1 p2)
(cons p1 p2))
(define (start-segment line)
(car line))
(define (end-segment line... |
96919ea93616549f34aa899f1375a424dc3ea1834528e72c0ed15a19e7972147 | Glue42/gateway-modules | project.clj | (defproject com.tick42.gateway/metrics-domain "3.0.19-SNAPSHOT"
:plugins [[lein-modules "0.3.11"]]
:dependencies [[com.tick42.gateway/common :version]
[com.tick42.gateway/metrics-core :version]
[com.taoensso/timbre "_"]
[gnl/ghostwheel "_"]
[org... | null | https://raw.githubusercontent.com/Glue42/gateway-modules/8b91c8714db24161faefa3ce9103a5db594e0b4e/metrics-domain/project.clj | clojure | (defproject com.tick42.gateway/metrics-domain "3.0.19-SNAPSHOT"
:plugins [[lein-modules "0.3.11"]]
:dependencies [[com.tick42.gateway/common :version]
[com.tick42.gateway/metrics-core :version]
[com.taoensso/timbre "_"]
[gnl/ghostwheel "_"]
[org... | |
1d6b4dff6237928d97940a2d0272dc48ddf8fd927061c03c6cac147abf0ccd2c | lindenbaum/eipmi | eipmi_decoder_tests.erl | %%%=============================================================================
Copyright ( c ) 2012 - 2019 Lindenbaum GmbH
%%%
%%% 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 permiss... | null | https://raw.githubusercontent.com/lindenbaum/eipmi/6e4a6676be8c8d5206d8fff6c7864da97c622dd5/test/eipmi_decoder_tests.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 SOFTWA... | Copyright ( c ) 2012 - 2019 Lindenbaum GmbH
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(eipmi_decoder_tests).
-include_lib("e... |
af92cca6a1383207b62a4e345d72ff57c946598ed6f874e58769c181589d8f89 | rescript-association/genType | TranslateStructure.ml | open GenTypeCommon
let rec addAnnotationsToTypes_ ~config ~(expr : Typedtree.expression)
(argTypes : argType list) =
match (expr.exp_desc, expr.exp_type.desc, argTypes) with
| _, _, {aName; aType = GroupOfLabeledArgs fields} :: nextTypes ->
let fields1, nextTypes1 =
addAnnotationsToFields ~config exp... | null | https://raw.githubusercontent.com/rescript-association/genType/c7a5413d1c46fd1481f9cbb54e1702d89d994338/src/TranslateStructure.ml | ocaml | Underscore "_" appears as "param", can occur more than once
* Recover from expr the renaming annotations on named arguments.
Only look at the resulting type of the module
external declaration | open GenTypeCommon
let rec addAnnotationsToTypes_ ~config ~(expr : Typedtree.expression)
(argTypes : argType list) =
match (expr.exp_desc, expr.exp_type.desc, argTypes) with
| _, _, {aName; aType = GroupOfLabeledArgs fields} :: nextTypes ->
let fields1, nextTypes1 =
addAnnotationsToFields ~config exp... |
caa679790e469b466829649c28dce769fbb70bdd67956982afb170f0d8c73d14 | scheme/rx | re-low.scm | ;;; Regular expression matching for scsh
Copyright ( c ) 1994 by .
Match data for regexp matches .
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-record-type :regexp-match
(make-regexp-match string submatches)
regexp-match?
(string regexp-match:string)
(submatche... | null | https://raw.githubusercontent.com/scheme/rx/dd9037f6f9ea01019390614f6b126b7dd293798d/re-low.scm | scheme | Regular expression matching for scsh
Compiling regexps
specially.
one for cre-search?.
(define-record cre ; A compiled regular expression
The string form of the regexp or # F.
in STRING needed for submatches .
(regexp #f) ; Compiled form or #F.
Same as REGEXP , but compiled with no - submatch .
tvec... | Copyright ( c ) 1994 by .
Match data for regexp matches .
(define-record-type :regexp-match
(make-regexp-match string submatches)
regexp-match?
(string regexp-match:string)
(submatches regexp-match:submatches))
(define (match:start match . maybe-index)
(let ((index (:optional maybe-index 0))
... |
6db512d4846a19a91eedc0eed4127dcd6c02ed11e58eeb9cae4fa1ad143f2357 | GumTreeDiff/cgum | oassocdbm.mli | (* !!take care!!: this class does side effect, not a pure oassoc *)
class ['a, 'b] oassocdbm :
'd ->
Dbm.t ->
('b -> 'e) ->
('e -> 'b) ->
object ('o)
inherit ['a,'b] Oassoc.oassoc
(* ocollection concrete instantiation of virtual methods *)
method empty : 'o
method add : 'a * 'b -> 'o
method iter : (... | null | https://raw.githubusercontent.com/GumTreeDiff/cgum/8521aa80fcf4873a19e60ce8c846c886aaefb41b/commons/ocollection/oassocdbm.mli | ocaml | !!take care!!: this class does side effect, not a pure oassoc
ocollection concrete instantiation of virtual methods
oassoc concrete instantiation of virtual methods | class ['a, 'b] oassocdbm :
'd ->
Dbm.t ->
('b -> 'e) ->
('e -> 'b) ->
object ('o)
inherit ['a,'b] Oassoc.oassoc
method empty : 'o
method add : 'a * 'b -> 'o
method iter : ('a * 'b -> unit) -> unit
method view : ('a * 'b, 'o) Ocollection.view
method del : 'a * 'b -> 'o
method mem : 'a * 'b -> bo... |
7abba32d0654043beacf0070a578d33e66126b8d4fd1763eeff3279301cb4075 | commercialhaskell/pantry | InternalSpec.hs | module Pantry.InternalSpec (spec) where
import Test.Hspec
import Pantry (runPantryApp)
import Pantry.Internal (normalizeParents, makeTarRelative, hpackVersion)
spec :: Spec
spec = do
describe "normalizeParents" $ do
let (!) :: HasCallStack => String -> Maybe String -> Spec
input ! output =
it ... | null | https://raw.githubusercontent.com/commercialhaskell/pantry/c7923fc963e36efd179ba301ac426139a9dc182d/test/Pantry/InternalSpec.hs | haskell | instead, since we don't want any absolute paths. However,
that's really a concern for normalizeParents. Point being: if
you refactor in the future, and this turns into Nothing, that's
fine.
let isVersion :: Version -> Bool
isVersion _ = True
version `shouldSatisfy` isVersion
it "External hpack v... | module Pantry.InternalSpec (spec) where
import Test.Hspec
import Pantry (runPantryApp)
import Pantry.Internal (normalizeParents, makeTarRelative, hpackVersion)
spec :: Spec
spec = do
describe "normalizeParents" $ do
let (!) :: HasCallStack => String -> Maybe String -> Spec
input ! output =
it ... |
8b35a46c76c2ac5d555e8f5ae45d5794fdfc8fe8ed0e951f42a7bc55c364afa8 | mivoq/hunpos | morphtable.ml | * This module loads the morphtable ( words with possible tags ) from
a file to a Set . The format is :
1 . one word per line
2 . word tag1 TAB tag2
a file to a Set. The format is:
1. one word per line
2. word TAB tag1 TAB tag2
*)
module SSet = Set.Make(String)
let load fi... | null | https://raw.githubusercontent.com/mivoq/hunpos/0f0f775039fa749e67711c07ac681a16c0979349/hunpos/morphtable.ml | ocaml | "data/hunmorph.cache" | * This module loads the morphtable ( words with possible tags ) from
a file to a Set . The format is :
1 . one word per line
2 . word tag1 TAB tag2
a file to a Set. The format is:
1. one word per line
2. word TAB tag1 TAB tag2
*)
module SSet = Set.Make(String)
let load fi... |
37861445e27f4dbd19aff98fd6f081c7dc4ca0c5de578e7c8e2e7df0462200f6 | dinosaure/paf-le-chien | clients.ml | open Fiber
let pr fmt = Format.printf fmt
let epr fmt = Format.eprintf fmt
external now : unit -> (int64[@unboxed]) = "b_mclock" "n_mclock" [@@noalloc]
let reporter pid ppf =
let report src level ~over k msgf =
let k _ =
over () ;
k () in
let with_metadata header _tags k ppf fmt =
Format.... | null | https://raw.githubusercontent.com/dinosaure/paf-le-chien/c53cef829b67bc72e829ba28da9a82a5e588ced5/test/clients.ml | ocaml | Characters: space @ [0x258F .. 0x2589]
(c) CraigFe
Lwt_preemptive.init !concurrency !concurrency ignore ; | open Fiber
let pr fmt = Format.printf fmt
let epr fmt = Format.eprintf fmt
external now : unit -> (int64[@unboxed]) = "b_mclock" "n_mclock" [@@noalloc]
let reporter pid ppf =
let report src level ~over k msgf =
let k _ =
over () ;
k () in
let with_metadata header _tags k ppf fmt =
Format.... |
e9b6fc6d2af1a5d5d445a79d5feddf632d98b689a9ccd02d07fdee4fc24093ed | Bronsa/tools.decompiler | project.clj | (defproject bronsa/tools.decompiler "0.1.0-alpha1"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:java-source-paths ["java"]
:manifest {"Premain-Class" "clojure.tools.decompiler.RetrieveClasses"}
:dependencies [[org.clojure/clojure "1.... | null | https://raw.githubusercontent.com/Bronsa/tools.decompiler/904d771e59d6c53f7966b9172b3eabc52cafdd17/project.clj | clojure | (defproject bronsa/tools.decompiler "0.1.0-alpha1"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:java-source-paths ["java"]
:manifest {"Premain-Class" "clojure.tools.decompiler.RetrieveClasses"}
:dependencies [[org.clojure/clojure "1.... | |
165985d59ff2916ff64abb1ce5b585df95c36e55a856def940dade13fb700f4d | nyu-acsys/drift | list.ml |
let main n =
ra : { v : Int | v = 2 }
y : { v : Int | v = 3 }
{ v : Int | v = 5 }
let _ = main 10 | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/list.ml | ocaml |
let main n =
ra : { v : Int | v = 2 }
y : { v : Int | v = 3 }
{ v : Int | v = 5 }
let _ = main 10 | |
773cac7ab310b127144df0bafc93a6ec1ba275526c35b835929e7a5bda95ba40 | gonzojive/sbcl | fngen.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright and release statements follow. Later modifications
;;;; to the software are in the public domain and are provided with
;;;; absol... | null | https://raw.githubusercontent.com/gonzojive/sbcl/3210d8ed721541d5bba85cbf51831238990e33f1/src/pcl/fngen.lisp | lisp | more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and copying of this software and preparation of der... | This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , 1989 , 1990 Xerox Corporation .
derivative works must comply with all applicabl... |
09c74febd4a400704cea232c51b8038a19fcc45d7c2b8ce503f5f4ab6713675c | mhallin/graphql_ppx | rule_no_unused_variables.ml | module Visitor: Traversal_utils.VisitorSig = struct
open Traversal_utils
open Source_pos
open Graphql_ast
include AbstractVisitor
type t = (string, string spanning) Hashtbl.t
let make_self () = Hashtbl.create 0
let enter_operation_definition self _ def =
let () = Hashtbl.clear self in
match de... | null | https://raw.githubusercontent.com/mhallin/graphql_ppx/5796b3759bdf0d29112f48e43a2f0623f7466e8a/src/base/rule_no_unused_variables.ml | ocaml | module Visitor: Traversal_utils.VisitorSig = struct
open Traversal_utils
open Source_pos
open Graphql_ast
include AbstractVisitor
type t = (string, string spanning) Hashtbl.t
let make_self () = Hashtbl.create 0
let enter_operation_definition self _ def =
let () = Hashtbl.clear self in
match de... | |
d1bd629dac1604d9a8fea9765b86d53985358b4cff829df1c06d124000610da6 | ghc/ghc | Ast.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE CPP #-}
# LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
{-# LAN... | null | https://raw.githubusercontent.com/ghc/ghc/ac39e8e97fbb69e4a786c1c29d6e477e7944f998/compiler/GHC/Iface/Ext/Ast.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
Main functions for .hie file generation
Used for names and... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableSuperClasses #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
m... |
9eecba2a289429579bb7ced9166e56dc2e3a6c2d3fbde960b9d4a635ec5ae909 | untangled-web/untangled | main.cljs | (ns app.main
(:require [app.ui :as ui]
[app.core :as core]
app.i18n.default-locale
app.mutations
[untangled.client.core :as uc]))
PRODUCTION entry point . Not used during development mode . Simply mounts the app on the DOM .
The reset is so we know the mounted app... | null | https://raw.githubusercontent.com/untangled-web/untangled/705220539ff00b1e487ae387def11daad8638206/src/client/app/main.cljs | clojure | (ns app.main
(:require [app.ui :as ui]
[app.core :as core]
app.i18n.default-locale
app.mutations
[untangled.client.core :as uc]))
PRODUCTION entry point . Not used during development mode . Simply mounts the app on the DOM .
The reset is so we know the mounted app... | |
930951b842e0962478da1ac791c00a81603f57ba031b05d0a5d0ae5b984a0c3c | RedPRL/algaeff | Fun.mli | (** Useful helper functions around effects. *)
module Deep :
sig
(** Useful helper functions for deep handlers. *)
val finally : ('a, 'b) Effect.Deep.continuation -> (unit -> 'a) -> 'b
* [ finally f ] runs the thunk [ f ] and calls [ continue ] if a value is returned and [ discontinue ] if an exception is raised ... | null | https://raw.githubusercontent.com/RedPRL/algaeff/6867d391f2aafb5129bd8e792de5a8f7bad14a76/src/Fun.mli | ocaml | * Useful helper functions around effects.
* Useful helper functions for deep handlers.
* Useful helper functions for shallow handlers. |
module Deep :
sig
val finally : ('a, 'b) Effect.Deep.continuation -> (unit -> 'a) -> 'b
* [ finally f ] runs the thunk [ f ] and calls [ continue ] if a value is returned and [ discontinue ] if an exception is raised .
Here is an example that calls { ! : List.nth } and then either returns the found element... |
132c0dffdefc9b518a8d7d187caaa3770e57ea77174dbf4a7192f9930f1dbf91 | garycrawford/lein-life | system.clj | (ns {{ns-name}}.components.system
(:require [com.stuartsierra.component :as component]
[metrics.core :refer [new-registry]]
[metrics.jvm.core :as jvm]
[{{ns-name}}.components.mongodb.lifecycle :refer [new-mongodb]]
[{{ns-name}}.controllers.home.lifecycle :refer [new-hom... | null | https://raw.githubusercontent.com/garycrawford/lein-life/d55f3636950b58b02399ab32eb1f6d81ecfce823/src/leiningen/new/life/site/mongodb/src/components/system.clj | clojure | (ns {{ns-name}}.components.system
(:require [com.stuartsierra.component :as component]
[metrics.core :refer [new-registry]]
[metrics.jvm.core :as jvm]
[{{ns-name}}.components.mongodb.lifecycle :refer [new-mongodb]]
[{{ns-name}}.controllers.home.lifecycle :refer [new-hom... | |
82260127df1f399b536b651c3bec9f0a68e8a766cdffefa38e4753e9dcf37033 | input-output-hk/cardano-ledger | Era.hs | module Cardano.Ledger.Api.Era (
-- * Eras
* *
Shelley,
ShelleyEra,
* * Allegra
Allegra,
AllegraEra,
* *
Mary,
MaryEra,
* *
Alonzo,
AlonzoEra,
-- ** Babbage
Babbage,
BabbageEra,
* *
Conway,
ConwayEra,
-- * Crypto
StandardCrypto,
Crypto (..),
)
where
import Cardano.... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/31c0bb1f5e78e40b83adfd1a916e69f47fdc9835/libs/cardano-ledger-api/src/Cardano/Ledger/Api/Era.hs | haskell | * Eras
** Babbage
* Crypto | module Cardano.Ledger.Api.Era (
* *
Shelley,
ShelleyEra,
* * Allegra
Allegra,
AllegraEra,
* *
Mary,
MaryEra,
* *
Alonzo,
AlonzoEra,
Babbage,
BabbageEra,
* *
Conway,
ConwayEra,
StandardCrypto,
Crypto (..),
)
where
import Cardano.Ledger.Allegra (Allegra, AllegraEra)
impor... |
87f8421c8975e1098f4908bd69e3d64d1384aea0321075bf5ace69b592929b42 | bytekid/mkbtt | termPermutation.mli | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mkbtt/isomorphisms/termPermutation.mli | ocaml | ** EXCEPTIONS ********************************************************
** TYPES *************************************************************
** VALUES ************************************************************ | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 (... |
03b99dd7821a43f04161b24ef40fe5bf46ff3272856b04b31798d3f73ebb3db2 | B-Lang-org/bsc | VFinalCleanup.hs | module VFinalCleanup (finalCleanup) where
import Data.List(nub)
import qualified Data.Map as M
import qualified Data.Set as S
import Position(noPosition)
import Flags(Flags, keepFires, removeUnusedMods, finalcleanup, keepInlined)
import Id
import FStringCompat(mkFString)
import ASyntax
import ASyntaxUtil
import Backen... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/VFinalCleanup.hs | haskell | import Debug.Trace
import Util(traces)
==============================
Build a state containing:
* the names of the visited instances (for quick lookup)
* a map from local signal names to their definitions
* the instances in the module
* the instances that have been reached (and are thus connected)
Note... | module VFinalCleanup (finalCleanup) where
import Data.List(nub)
import qualified Data.Map as M
import qualified Data.Set as S
import Position(noPosition)
import Flags(Flags, keepFires, removeUnusedMods, finalcleanup, keepInlined)
import Id
import FStringCompat(mkFString)
import ASyntax
import ASyntaxUtil
import Backen... |
e21bf0a07a4deb867d31891b341b1ef5501a355bf8ead6ab2a29c45e2379c66f | gafiatulin/codewars | DoubleEveryOther.hs | -- Double Every Other
--
module Codewars.Kata.DoubleEveryOther where
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther = zipWith ($) (cycle [id,(*2)])
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/DoubleEveryOther.hs | haskell | Double Every Other
|
module Codewars.Kata.DoubleEveryOther where
doubleEveryOther :: [Integer] -> [Integer]
doubleEveryOther = zipWith ($) (cycle [id,(*2)])
|
62617502a95997b71dc20dd9bb8d36e831bee1d05d3b15a143f29b28eaa68420 | effectai/effect-network | macros.cljc | (ns e2e.macros
(:require
[cljs.test :refer-macros [is]]
[cljs.core.async.interop :refer [<p!]]
[cljs.core.async :refer [go <!] ]
[cljs.test :refer-macros [deftest is testing run-tests async use-fixtures]] ))
(defmacro <p-may-fail!
[body msg]
`(try
(cljs.core.async.interop/<p! ~body)
(catc... | null | https://raw.githubusercontent.com/effectai/effect-network/fe205bcfc6a9eb33ea10485917656177cf8f73b7/tests/e2e/macros.cljc | clojure | (ns e2e.macros
(:require
[cljs.test :refer-macros [is]]
[cljs.core.async.interop :refer [<p!]]
[cljs.core.async :refer [go <!] ]
[cljs.test :refer-macros [deftest is testing run-tests async use-fixtures]] ))
(defmacro <p-may-fail!
[body msg]
`(try
(cljs.core.async.interop/<p! ~body)
(catc... | |
00254dba4768c573ae42a29ce47672c858388ad2fde618d02ec2e761b7d23ff6 | YoshikuniJujo/test_haskell | TryMemory.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module TryMemory where
import Foreign.Ptr
import Foreign.C.Types
foreign import ccall "allocate_memory" allocateMemory :: CInt -> IO (Ptr a)
foreign import ccall "free_memory" freeMemory :: Ptr a -> IO CInt
foreign import ccall "draw_memory" drawMemory :: IO ()
| null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/097b4f87463345c1d2c270eee8e72a0617ba386d/tribial/zenn/zenn-use-c-lib/src/TryMemory.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module TryMemory where
import Foreign.Ptr
import Foreign.C.Types
foreign import ccall "allocate_memory" allocateMemory :: CInt -> IO (Ptr a)
foreign import ccall "free_memory" freeMemory :: Ptr a -> IO CInt
foreign import ccall "draw_memory" drawMemory :: IO ()
| |
5e398d6e26465da0a5792fb7f4ba363c33c6df6b3f4bf090af28610e04898370 | cmsc430/www | read-all.rkt | #lang racket
(provide read-all)
;; read all s-expression until eof
(define (read-all p)
(let ((r (read p)))
(if (eof-object? r)
'()
(cons r (read-all p)))))
| null | https://raw.githubusercontent.com/cmsc430/www/4661d3e68d6910656f91d20012f8c31b6ca9344b/langs/iniquity-plus/read-all.rkt | racket | read all s-expression until eof | #lang racket
(provide read-all)
(define (read-all p)
(let ((r (read p)))
(if (eof-object? r)
'()
(cons r (read-all p)))))
|
21c7d6c48d975ea0522d476164b40e4cb2a75d2b6b35de5171d251b95be4d50b | vbmithr/ocaml-bip39 | bip39.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2017 Vincent Bernar... | null | https://raw.githubusercontent.com/vbmithr/ocaml-bip39/5a78a23dbe24b35e6b12607ad346398263bf1b94/src/bip39.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2017 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2017 Vincent Bernar... | |
a9d29f200b3425ecb9b0bcc3ef34f84f77b46ad50ec64273ed7d4b4e0250b426 | target/theta-idl | Import.hs | {-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamili... | null | https://raw.githubusercontent.com/target/theta-idl/d3657b66e2c6e7f6f5375926d808a5d0a4062149/theta/src/Theta/Import.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
import other modules and be imported itself. Circular imports will
not work. Naming conflicts are handled by deferring to the
/importing/ module.
* Module files
** Individual... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
| This module defines how we resolve and import Theta modules .
Each Theta file defines a module wit... |
db42f0d369e8294f76c63230ce6f1bd5fb9ad7eb4f1b9faaaddbaf16489e5c5e | zotonic/zotonic | scomp_base_pager.erl | @author < >
2009 - 2023
%% @doc Show the pager for the search result
%% @end
Copyright 2009 - 2023
%%
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
%%
%%... | null | https://raw.githubusercontent.com/zotonic/zotonic/06873f3bfa81ff8e0d91d2cf94e4076bdd5d44d0/apps/zotonic_mod_base/src/scomps/scomp_base_pager.erl | erlang | @doc Show the pager for the search result
@end
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the... | @author < >
2009 - 2023
Copyright 2009 - 2023
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(scomp_base_pager).
-behaviour(zotonic_scomp).
-export([vary/2, render/3]).
-include_lib("zotonic_core/inc... |
8554bb98dd458961b686c29b5a41646c162b13358988bd1157cf88f75b24f15a | mirage/irmin | time.ml |
* Copyright ( c ) 2020 < >
* Copyright ( c ) 2020 Anirudh Sunder Raj < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
* ... | null | https://raw.githubusercontent.com/mirage/irmin/dc452f5bf314c4f1ac8bf1e5b56f386283fa3401/src/irmin-containers/time.ml | ocaml |
* Copyright ( c ) 2020 < >
* Copyright ( c ) 2020 Anirudh Sunder Raj < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
* ... | |
044ec111528b680a98877c6a6e59a70b73ea753d2257af0033f0f7b99a87bc2c | portkey-cloud/edn-to-cfn | elastic_beanstalk.clj | (ns portkey.cloudformation.elastic-beanstalk
"AUTOGENERATED clojure.spec definitions"
(:require [clojure.spec.alpha]
[portkey.cloudformation]))
(do
(clojure.core/defmethod
portkey.cloudformation/resource-type-spec
:portkey.cloudformation.elastic-beanstalk/application
[___19567__auto__]
(clojur... | null | https://raw.githubusercontent.com/portkey-cloud/edn-to-cfn/7a3d247d35b7c4988c9b55634d03a008b87a2449/src/portkey/cloudformation/elastic_beanstalk.clj | clojure | (ns portkey.cloudformation.elastic-beanstalk
"AUTOGENERATED clojure.spec definitions"
(:require [clojure.spec.alpha]
[portkey.cloudformation]))
(do
(clojure.core/defmethod
portkey.cloudformation/resource-type-spec
:portkey.cloudformation.elastic-beanstalk/application
[___19567__auto__]
(clojur... | |
36843a8fdcdb9bba40e67a35a81d94fa749d157284416a84923bfa6968458b9e | ghc/packages-Cabal | Build.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Build
Copyright : 2003 - 2005 ,
2006 ,
2007 - 2008 , 2012
-- License : BSD3
--
-- Mainta... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/Cabal/Distribution/Simple/Build.hs | haskell | # LANGUAGE RankNTypes #
---------------------------------------------------------------------------
|
Module : Distribution.Simple.Build
License : BSD3
Maintainer :
Portability : portable
This is the entry point to actually building the modules in a package. It
doesn't actually do much itself, m... | # LANGUAGE FlexibleContexts #
Copyright : 2003 - 2005 ,
2006 ,
2007 - 2008 , 2012
module Distribution.Simple.Build (
build, showBuildInfo, repl,
startInterpreter,
initialBuildSteps,
createInternalPackageDB,
componentInitialBuildSteps,
writeAutoge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.