_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 |
|---|---|---|---|---|---|---|---|---|
dc08c0ffef55b33cb984a08bbffdd77bbc55831527e1d77e4dc9b4c483d2bfee | jeffa5/mirage-xmpp | stanza.mli | * The type of a Stanza .
type t =
| Message of Xml.t
| Presence of Xml.t
| Iq of Xml.t
(** [to_xml t] returns the xml element contained within the stanza type [t]. *)
val to_xml : t -> Xml.t
(** [gen_id ()] generates a new string to use as an id. *)
val gen_id : unit -> string
(** [create_presence ~attributes ... | null | https://raw.githubusercontent.com/jeffa5/mirage-xmpp/df3dafecba9081880809d8649ed0727b9f6a9dc7/src/stanza.mli | ocaml | * [to_xml t] returns the xml element contained within the stanza type [t].
* [gen_id ()] generates a new string to use as an id.
* [create_presence ~attributes ~atype ~ato ~id ~from children] creates a presence stanza with the given attributes and children.
* [create_iq ~attributes ~ato ~atype ~id children] creates ... | * The type of a Stanza .
type t =
| Message of Xml.t
| Presence of Xml.t
| Iq of Xml.t
val to_xml : t -> Xml.t
val gen_id : unit -> string
val create_presence :
?attributes:Xml.attribute list
-> ?atype:string
-> ?ato:Jid.t
-> id:string option
-> from:Jid.t
-> Xml.t list
-> t
val create_iq :
... |
dd83d41dca182aefd2de5f2d8ebef8f8d9de3dcbe1f5c0d7ea23aac82151b5eb | jeromesimeon/Galax | escaping.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/tools/escaping/escaping.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : escaping.ml , v 1.2 2007/02/01 22:08:54 simeon Exp $
let output_all = ref false
let usage_msg =
Format.sprintf "Usage: %s file" Sys.argv.(0)
let input_file = ref ""
let output_file = ref ""
let process_args () =
let args = ref... |
5c9959326f3313f5008cb9bf3606b6b412caf5e06ffcca2c41983c1786e94ee3 | brandonbloom/fipp | cljs_tests.cljs | (ns fipp.cljs-tests
(:require [cljs.test :refer-macros [deftest is testing run-tests]]
[cljs.nodejs :as nodejs]
[fipp.ednize-test]
[fipp.engine-test]
[fipp.edn-test]
[fipp.clojure-test]))
(nodejs/enable-util-print!)
(defn -main [& args]
(run-tests 'fipp.... | null | https://raw.githubusercontent.com/brandonbloom/fipp/3e29a69cd7b93310441efa1de66c98459384ee9c/test/fipp/cljs_tests.cljs | clojure | (ns fipp.cljs-tests
(:require [cljs.test :refer-macros [deftest is testing run-tests]]
[cljs.nodejs :as nodejs]
[fipp.ednize-test]
[fipp.engine-test]
[fipp.edn-test]
[fipp.clojure-test]))
(nodejs/enable-util-print!)
(defn -main [& args]
(run-tests 'fipp.... | |
dbc8497bdf9615b30c9f316f4f4abe82d3d8bd7eb8c93048ea2b7e8046e9e464 | SimulaVR/godot-haskell | Bullet.hs | | This file is AUTOGENERATED by godot - haskell - project - generator . DO NOT EDIT
# LANGUAGE FlexibleContexts , FunctionalDependencies , MultiParamTypeClasses ,
UndecidableInstances , OverloadedStrings , TemplateHaskell , TypeApplications ,
TypeFamilies , DataKinds , TypeOperators , FlexibleInstances , Ran... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/examples/top-down-ten-minutes/src/Project/Scenes/Bullet.hs | haskell | | This file is AUTOGENERATED by godot - haskell - project - generator . DO NOT EDIT
# LANGUAGE FlexibleContexts , FunctionalDependencies , MultiParamTypeClasses ,
UndecidableInstances , OverloadedStrings , TemplateHaskell , TypeApplications ,
TypeFamilies , DataKinds , TypeOperators , FlexibleInstances , Ran... | |
49d92a3bb8c71a3ae50451eb6c2a8e0006e8f7c403af29a80da260ad3b1bebfb | otakar-smrz/elixir-fm | Compose.hs | -- |
--
-- Module : Elixir.Compose
Copyright : 2005 - 2017
-- License : GPL
--
-- Maintainer : otakar-smrz users.sf.net
-- Stability : provisional
-- Portability : portable
--
-- "ElixirFM"
module Elixir.Compose where
import Elixir.Data
import Elixir.Lexicon
import Elixir.Inflect
import... | null | https://raw.githubusercontent.com/otakar-smrz/elixir-fm/fae5bab6dd53c15d25c1e147e7787b2c254aabf0/Haskell/ElixirFM/Elixir/Compose.hs | haskell | |
Module : Elixir.Compose
License : GPL
Maintainer : otakar-smrz users.sf.net
Stability : provisional
Portability : portable
"ElixirFM"
compose = unwords . map (unwraps (uncurry merge . struct))
consider Just ("SP------4-", euphony y)
in modern language
in modern language
in modern langu... | Copyright : 2005 - 2017
module Elixir.Compose where
import Elixir.Data
import Elixir.Lexicon
import Elixir.Inflect
import Elixir.Pretty
import Encode.Arabic
import Data.List
import qualified Data.Map as Map
data Token a = Token { lexeme :: (Lexeme a, Index), struct :: (Root, Morphs a), tag :: Tag }... |
dc484818e08ad599c8f0fb7ccbcc8b337275d4ea52a5e919c9cfb7d5a1614f91 | Convex-Dev/convex-web | convex_test.clj | (ns convex-web.convex-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[convex-web.convex :as convex]
[convex-web.system :as sys]
[convex-web.test :refer [catch-throwable make-system-fixture]])
(:import
(convex.core.data Address Blob Syntax Maps Symbol Keyword Vectors A... | null | https://raw.githubusercontent.com/Convex-Dev/convex-web/9f13d5655427eab9477cc5b9ba56faa0eb3bb1b4/src/test/clojure/convex_web/convex_test.clj | clojure | (ns convex-web.convex-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[convex-web.convex :as convex]
[convex-web.system :as sys]
[convex-web.test :refer [catch-throwable make-system-fixture]])
(:import
(convex.core.data Address Blob Syntax Maps Symbol Keyword Vectors A... | |
279a89c9107ff423cb5f790caa214bb64cd28b33d0b09d702bf85595e862ba71 | AdRoll/rebar3_hank | ignore_config.erl | -module ignore.
-compile(export_all).
%% @doc No warnings should be emitted for this file since
%% rebar.config specifically states that all of them
%% should be ignored.
-record(a_record, {used_field, ignored_field1, ignored_field2}).
-record(ignored_record, {used_field, unused_field, ignored_field_1, ign... | null | https://raw.githubusercontent.com/AdRoll/rebar3_hank/9666a9ffd7a657a34c87a3da5e38a720ad41cdf1/test/files/unused_record_fields/ignore_config.erl | erlang | @doc No warnings should be emitted for this file since
rebar.config specifically states that all of them
should be ignored. | -module ignore.
-compile(export_all).
-record(a_record, {used_field, ignored_field1, ignored_field2}).
-record(ignored_record, {used_field, unused_field, ignored_field_1, ignored_field_2}).
usage() ->
#a_record{used_field = #ignored_record{used_field = used}}.
|
775664c60ad3e608fe6fdaee298fc9081e372cc47481aeff5412406e6a9310b0 | haskell-tools/haskell-tools | Indentation.hs | | Utilities to modify the indentation of AST fragments
module Language.Haskell.Tools.Refactor.Utils.Indentation where
import Control.Monad.Identity (Identity(..))
import Control.Reference ((.=))
import Language.Haskell.Tools.AST (SrcTemplateStage, SourceInfoTrf(..), SourceInfoTraversal(..))
import Language.Haskell.... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/refactor/Language/Haskell/Tools/Refactor/Utils/Indentation.hs | haskell | | Set the minimal indentation recursively for a part of the AST | | Utilities to modify the indentation of AST fragments
module Language.Haskell.Tools.Refactor.Utils.Indentation where
import Control.Monad.Identity (Identity(..))
import Control.Reference ((.=))
import Language.Haskell.Tools.AST (SrcTemplateStage, SourceInfoTrf(..), SourceInfoTraversal(..))
import Language.Haskell.... |
1f66b0ff64c7d554785e8e56f5f0adc548d102c35dfe4ef66dd4bf314a199a0e | haskell/haskell-language-server | TypeLenses.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE OverloadedLabels #
# LANGUAGE TypeFamilies #
| An HLS plugin to provide code lenses for type signatures
module Development.IDE.Plugin.TypeLenses (
descriptor,
suggestSignature,
typeLensCommandId,
GlobalBindingTypeSig (..),
GetGlobalBindingTypeSigs (..),
G... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/6f5a73507f8d9266a486feaf8695c052362b9b95/ghcide/src/Development/IDE/Plugin/TypeLenses.hs | haskell | # LANGUAGE DeriveAnyClass #
we still need diagnostics for local bindings
------------------------------------------------------------------------------
not a top-level thing, to avoid duplication
| similar to 'Always', but only displays for exported global bindings
-------------------------------------------------... | # LANGUAGE OverloadedLabels #
# LANGUAGE TypeFamilies #
| An HLS plugin to provide code lenses for type signatures
module Development.IDE.Plugin.TypeLenses (
descriptor,
suggestSignature,
typeLensCommandId,
GlobalBindingTypeSig (..),
GetGlobalBindingTypeSigs (..),
GlobalBindingTypeSigsResult (..),
... |
0cb445f7385fa8435b1df56a5efccdc5230e35dd259703de3af6f010f8ccb8f6 | babashka/babashka | stacktrace.clj | (ns babashka.impl.clojure.stacktrace
{:no-doc true}
(:require [clojure.stacktrace :as stacktrace]
[sci.core :as sci]))
(def sns (sci/create-ns 'clojure.stacktrace nil))
(defmacro wrap-out [f]
`(fn [& ~'args]
(binding [*out* @sci/out]
(apply ~f ~'args))))
(defn new-var [var-sym f]
(sci... | null | https://raw.githubusercontent.com/babashka/babashka/3f72507f77aaf6c603a24a0f221588dcc2a73934/src/babashka/impl/clojure/stacktrace.clj | clojure | (ns babashka.impl.clojure.stacktrace
{:no-doc true}
(:require [clojure.stacktrace :as stacktrace]
[sci.core :as sci]))
(def sns (sci/create-ns 'clojure.stacktrace nil))
(defmacro wrap-out [f]
`(fn [& ~'args]
(binding [*out* @sci/out]
(apply ~f ~'args))))
(defn new-var [var-sym f]
(sci... | |
db9e3b8cf7fb41e1db64b1ea1cbb91cccf8ad162722a7064f2d80bd532db16b5 | andrejbauer/coop | config.ml | type pervasives =
| PervasivesNone (** Do not load the pervasives file *)
| PervasivesDefault (** Load the default pervasives file *)
| PervasivesFile of string (** Load a specific pervasives file *)
let pervasives_file = ref PervasivesDefault
let interactive_shell = ref true
let wrapper = ref ["rlwrap"; "ledi... | null | https://raw.githubusercontent.com/andrejbauer/coop/173d0889795c55a370f79fb42425b77a5c0c8464/src/config.ml | ocaml | * Do not load the pervasives file
* Load the default pervasives file
* Load a specific pervasives file | type pervasives =
let pervasives_file = ref PervasivesDefault
let interactive_shell = ref true
let wrapper = ref ["rlwrap"; "ledit"]
let max_boxes = ref 42
let columns = ref (Format.get_margin ())
let verbosity = ref 2
let ascii = ref false
|
ef733ac001386444666eaf7c516393ecc4ba3ff18c226594c9613add975ee8a3 | chunsj/TH | ch03.lisp | (defpackage :gdrl-ch03
(:use #:common-lisp
#:mu
#:th
#:th.env)
(:import-from #:th.env.examples))
(in-package :gdrl-ch03)
(let* ((env (th.env.examples:slippery-walk-five-env))
(policy (lambda (s) ($ '(0 0 0 0 0 0 0) s))))
(env/print-policy env policy :action-symbols '("<" ">") :nco... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/examples/books/gdrl/ch03.lisp | lisp | (defpackage :gdrl-ch03
(:use #:common-lisp
#:mu
#:th
#:th.env)
(:import-from #:th.env.examples))
(in-package :gdrl-ch03)
(let* ((env (th.env.examples:slippery-walk-five-env))
(policy (lambda (s) ($ '(0 0 0 0 0 0 0) s))))
(env/print-policy env policy :action-symbols '("<" ">") :nco... | |
439a90335a39c5824048b463747b40b953fb3bfea209eaf1c74abec1e38ecd11 | zwizwa/rai | gnuplot.rkt | #lang racket/base
(require
"tools.rkt"
racket/system
racket/match)
(provide
gnuplot
open-gnuplot
close-gnuplot
current-gnuplot
close-current-gnuplot
;; plot
plot-many
splot
mplot
lplot
plot-function
plot-function-log/log
plot-function-log/log-many
)
;; FIXME: Re-use plot server to allow racket resta... | null | https://raw.githubusercontent.com/zwizwa/rai/6bcacb7da4172971816027fd88a0209adbd60e30/gnuplot.rkt | racket | plot
FIXME: Re-use plot server to allow racket restarts.
Together with spawn.c this gets rid of zombie processes. Child
Can't detect exec errors!
(unless (= 0 (subprocess-status proc))
(error 'dfork-error))
(current-output-port)
(define (plot xs ys #:with [with 'lines])
(for ((x xs)
(y ys))
Each p... | #lang racket/base
(require
"tools.rkt"
racket/system
racket/match)
(provide
gnuplot
open-gnuplot
close-gnuplot
current-gnuplot
close-current-gnuplot
plot-many
splot
mplot
lplot
plot-function
plot-function-log/log
plot-function-log/log-many
)
processes get killed whenever their stdin is closed .
(... |
398c28f9c45bae7fadac9a40fbc29893d6e01aa122eea9cbd44823f83863744a | mmcqd/pure | dynamics.ml |
open Pure
let r = ref 0
let fresh v = (r := !r + 1; v ^ Int.to_string (!r))
let reset_var_stream () = r := 0
let instantiate y =
let rec replace b = function
| F x -> F x
| B i when i = b -> y
| B i -> B i
| APP (m,n) -> APP (replace b m, replace b n)
| ALAM ((x,t),e) -> ALAM ((x,replace b t), replace... | null | https://raw.githubusercontent.com/mmcqd/pure/1a1dcb29925c6713dc295822164b4972f4c0bfc9/dynamics.ml | ocaml |
open Pure
let r = ref 0
let fresh v = (r := !r + 1; v ^ Int.to_string (!r))
let reset_var_stream () = r := 0
let instantiate y =
let rec replace b = function
| F x -> F x
| B i when i = b -> y
| B i -> B i
| APP (m,n) -> APP (replace b m, replace b n)
| ALAM ((x,t),e) -> ALAM ((x,replace b t), replace... | |
36e6ea837572d6ad2b38845c9c9a95f74a3bac1d8030aec1ce36d2d458571823 | tgutu/clunit | assertion-macros.lisp | (in-package :clunit)
(defun assertion-expander (&key result test result-expression report-expression expected forms)
"Expands an assertion macro call."
`(with-assert-restart
(let ((,result ,result-expression))
(if ,test
(signal-assertion :pass)
(signal-assertion :fail
:returned ,result
:expect... | null | https://raw.githubusercontent.com/tgutu/clunit/6f6d72873f0e1207f037470105969384f8380628/src/macros/assertion-macros.lisp | lisp | The members of the forms list are printed out when an assertion test fails. The example below, shows the debug output when an assertion form fails.
(assert-true (= x y z) x y "Comment: This is meant to fail." z)) ; forms = '(x y "Comment: This is meant to fail." z)
======== Debug output ===========
Expressio... | (in-package :clunit)
(defun assertion-expander (&key result test result-expression report-expression expected forms)
"Expands an assertion macro call."
`(with-assert-restart
(let ((,result ,result-expression))
(if ,test
(signal-assertion :pass)
(signal-assertion :fail
:returned ,result
:expect... |
b96b7b47dfb93a3079601348fc444a8f6cbdc5702f4185be44d8a24296af621e | Nike-Inc/hal | Kafka.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE NamedFieldPuns #-}
|
Module : AWS.Lambda . Events .
Description : Data types for consuming events .
License : : stable
It is possible to subscribe Lambda functions to topics . ... | null | https://raw.githubusercontent.com/Nike-Inc/hal/d2142ea440b1f8bada32825925d95fc90593c22b/src/AWS/Lambda/Events/Kafka.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE NamedFieldPuns #
* Internal
conversion for you.
See the <-kafka.html AWS documentation>
for a sample payload.
| Only present when using the "Amazon MSK" event source mapping.
| The map's keys look like @"${topicName}-${partitionNumber}"@
^ @"aws:kafka"@
^ @"SelfMan... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
|
Module : AWS.Lambda . Events .
Description : Data types for consuming events .
License : : stable
It is possible to subscribe Lambda functions to topics . You can
subscribe to topics from Amazon Managed Streaming for ( MSK... |
7b3abdf4b10b5b08f8ee332131a1f7d50fd9ae266cdb798209bced3aa462939a | tdammers/ginger | Type.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-#LANGUAGE OverloadedStrings #-}
# LANGUAGE TupleSections #
{-#LANGUAGE TypeSynonymInstances #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
-- | The internals of the 'Run' monad, and various things needed to make the
-- magic happen... | null | https://raw.githubusercontent.com/tdammers/ginger/eb33b2bdb481d9fcc08e1d59722c52a79687e665/src/Text/Ginger/Run/Type.hs | haskell | #LANGUAGE OverloadedStrings #
#LANGUAGE TypeSynonymInstances #
| The internals of the 'Run' monad, and various things needed to make the
magic happen. You will not normally need to import this module;
'Text.Ginger.Run' re-exports the things you probably want. However, if you
want to provide your own run monad that ... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TupleSections #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
module Text.Ginger.Run.Type
( GingerContext (..)
, makeContext
, makeContextM
, makeContext'
, makeContextM'
, makeContextExM'
, makeContextHtml
, makeContextHtmlM... |
7a79692294a248dba3d645bd4c9873df55612355210b21d609a6984571d71a1f | coq-tactician/coq-tactician | diagonal_search.ml | open Tactician_util
let rec tclFairJoin (tacs : 'a Proofview.tactic Proofview.tactic) : 'a Proofview.tactic =
let open Proofview in
let open Notations in
tclCASE tacs >>= function
| Fail (iexn, info) -> tclZERO ~info:info iexn
| Next (tac1, resttacs) ->
tclCASE tac1 >>= function
| Fail ... | null | https://raw.githubusercontent.com/coq-tactician/coq-tactician/d1a55b3bb2d4bf44ce89042f4a9ab673de5c47c8/src/diagonal_search.ml | ocaml | TODO: This does not use the focus, and is generally entirely wrong. Probably delete or rewrite
print_goal_short <*> | open Tactician_util
let rec tclFairJoin (tacs : 'a Proofview.tactic Proofview.tactic) : 'a Proofview.tactic =
let open Proofview in
let open Notations in
tclCASE tacs >>= function
| Fail (iexn, info) -> tclZERO ~info:info iexn
| Next (tac1, resttacs) ->
tclCASE tac1 >>= function
| Fail ... |
34b68a8b112f0d5d67feb1e948f46c66931e29e056c49626d9028c10111a70ec | gregr/racket-misc | sugar.rkt | #lang racket/base
(provide
def
fn
fnr
for_
forf
forf*
forl
forl*
gn
letn
lets
)
(require
(for-syntax racket/base)
"generator.rkt"
"match.rkt"
racket/match
)
(module+ test
(require rackunit))
(define-syntax lets1
(syntax-rules (=)
((_ (pattern = value) body ...)
(match-l... | null | https://raw.githubusercontent.com/gregr/racket-misc/0a5c9d4875288795e209d06982b82848c989d08b/sugar.rkt | racket | #lang racket/base
(provide
def
fn
fnr
for_
forf
forf*
forl
forl*
gn
letn
lets
)
(require
(for-syntax racket/base)
"generator.rkt"
"match.rkt"
racket/match
)
(module+ test
(require rackunit))
(define-syntax lets1
(syntax-rules (=)
((_ (pattern = value) body ...)
(match-l... | |
f7c2e4ff653147a48c292dc44fb627a3541a165efa18741cc6dfc0cff46fa53c | facebookarchive/pfff | unit_parsing_cpp.ml | open Common
open OUnit
module Ast = Ast_cpp
module Flag = Flag_parsing_cpp
(*****************************************************************************)
(* Helpers *)
(*****************************************************************************)
let parse file =
Common.save_excursion Flag.error_recovery false (... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_cpp/parsing/unit_parsing_cpp.ml | ocaml | ***************************************************************************
Helpers
***************************************************************************
***************************************************************************
Unit tests
*********************************************************************... | open Common
open OUnit
module Ast = Ast_cpp
module Flag = Flag_parsing_cpp
let parse file =
Common.save_excursion Flag.error_recovery false (fun () ->
Common.save_excursion Flag.show_parsing_error false (fun () ->
Common.save_excursion Flag.verbose_parsing false (fun () ->
Parse_cpp.parse file
)))
let u... |
e4580ab7de8401c4afef43b32acbb5d963566eaa8b7e266fbb9f20c70db09070 | cljfx/cljfx | grid_pane.clj | (ns cljfx.fx.grid-pane
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.fx.pane :as fx.pane]
[cljfx.mutator :as mutator]
[cljfx.prop :as prop])
(:import [javafx.scene.layout... | null | https://raw.githubusercontent.com/cljfx/cljfx/543f7409290051e9444771d2cd86dadeb8cdce33/src/cljfx/fx/grid_pane.clj | clojure | (ns cljfx.fx.grid-pane
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.fx.pane :as fx.pane]
[cljfx.mutator :as mutator]
[cljfx.prop :as prop])
(:import [javafx.scene.layout... | |
e7dae03e0d28f9f70d4bf8f8c654964ffd2174c4a42d308fe8aa06ab3411a511 | heroku/cowboyku | ws_init_shutdown.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(ws_init_shutdown).
-behaviour(cowboyku_websocket_handler).
-export([init/3]).
-export([websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init(_Any, _Req, _Opts) ->
{upgrade, protocol, cowboyku_websocket}.
websocket_i... | null | https://raw.githubusercontent.com/heroku/cowboyku/ba7120bdb119ac676909e51f0738bde1d4fdd4ee/test/ws_SUITE_data/ws_init_shutdown.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(ws_init_shutdown).
-behaviour(cowboyku_websocket_handler).
-export([init/3]).
-export([websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init(_Any, _Req, _Opts) ->
{upgrade, protocol, cowboyku_websocket}.
websocket_init(_TransportName, Req, _Opts) ->
{ok, Req2} = cowboyku_re... |
18b46d23fe7c338a2edd258b05053f9df8652a612534154b4a9c3e38242e8abc | chunsj/TH | vgg19.lisp | (defpackage :th.m.vgg19
(:use #:common-lisp
#:mu
#:th)
(:export #:read-vgg19-weights
#:convert-to-vgg19-input
#:vgg19
#:vgg19fcn))
(in-package :th.m.vgg19)
(defparameter +model-location+ ($concat (namestring (user-homedir-pathname)) ".th/models"))
(defun read-text... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/m/vgg19.lisp | lisp | (defpackage :th.m.vgg19
(:use #:common-lisp
#:mu
#:th)
(:export #:read-vgg19-weights
#:convert-to-vgg19-input
#:vgg19
#:vgg19fcn))
(in-package :th.m.vgg19)
(defparameter +model-location+ ($concat (namestring (user-homedir-pathname)) ".th/models"))
(defun read-text... | |
408b2d92ebbb6e932a511f44a08d334240e5de22da7963cd4949485697a4fe9a | kseo/fp | Env.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module FP.Env
( Env
, preludeDefs
, extend
, lookup
, InterpError(..)
, InterpM(..)
, FunDef(..)
) where
import FP.AST
import FP.Value
import FP.Function as Function
import Control.Applicative (Applicative)
import Control.Monad.Except (ExceptT, ... | null | https://raw.githubusercontent.com/kseo/fp/320af9c4c6048442a09c31399f8a00a1a7a3513f/src/FP/Env.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
module FP.Env
( Env
, preludeDefs
, extend
, lookup
, InterpError(..)
, InterpM(..)
, FunDef(..)
) where
import FP.AST
import FP.Value
import FP.Function as Function
import Control.Applicative (Applicative)
import Control.Monad.Except (ExceptT, ... | |
b75aa4db14b1cb132d0eb2485566429bcb9f2a191733dca91c2dd405c1798424 | alsonkemp/turbinado | Types.hs | module Turbinado.Database.ORM.Adapters.Types where
import qualified Data.Map as M
import Database.HDBC
import Turbinado.Database.ORM.Types
import qualified Turbinado.Database.ORM.Adapters.Common as C
baseAdapter = AdapterType {
getPrimaryKeys = error "getPrimaryKeys must be overridden by an ad... | null | https://raw.githubusercontent.com/alsonkemp/turbinado/da2ba7c3443ddf6a51d1ec5b05cb45a85efc0809/Turbinado/Database/ORM/Adapters/Types.hs | haskell | module Turbinado.Database.ORM.Adapters.Types where
import qualified Data.Map as M
import Database.HDBC
import Turbinado.Database.ORM.Types
import qualified Turbinado.Database.ORM.Adapters.Common as C
baseAdapter = AdapterType {
getPrimaryKeys = error "getPrimaryKeys must be overridden by an ad... | |
a7eead68b3e93d1ed1af219fb6006b153c4858edb4420764ce1e7cf1caace268 | s-expressionists/Ecclesia | lambda-lists.lisp | (cl:in-package #:ecclesia)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Lambda list utilities.
;;; There is much to say about lambda lists.
;;;
There are 10 different types of lambda lists and they vary both
;;; with respect to syntax and semantics. It gets pretty messy in
;;; ... | null | https://raw.githubusercontent.com/s-expressionists/Ecclesia/9fa25d8f67c69d6641d04eed7f22cc4cdd7c2d47/lambda-lists.lisp | lisp |
Lambda list utilities.
There is much to say about lambda lists.
with respect to syntax and semantics. It gets pretty messy in
fact.
Lambda lists admit something known as "lambda list keywords".
They are not keywords in the normal sense of the word (i.e.,
the COMMON-LISP package that happen to have names ... | (cl:in-package #:ecclesia)
There are 10 different types of lambda lists and they vary both
symbols in the : KEYWORD package ) , but just ordinary symbols in
the ` & ' character ( ampersand ) .
LAMBDA - LIST - KEYWORDS . However , there is no way to determine what
& allow - other - keys , & aux , & body , ... |
d8735d509ad601654defe395ec908dc0081b2ae2f2c24d93a69d744693e58e1a | MinaProtocol/mina | user_command_info.ml | open Core_kernel
module Fee_currency = Currency.Fee
module Amount_currency = Currency.Amount
open Rosetta_models
module Signed_command = Mina_base.Signed_command
module Token_id = Mina_base.Token_id
module Public_key = Signature_lib.Public_key
module Signed_command_memo = Mina_base.Signed_command_memo
module Payment_pa... | null | https://raw.githubusercontent.com/MinaProtocol/mina/b3149c7cf29b18262e5493d1734829b8eb035349/src/lib/rosetta_lib/user_command_info.ml | ocaml | Note: It's better to have nice errors with the validation than micro-optimize searching through a small list a minimal number of times.
only default token can be delegated
When amount is not none, we move the amount from source to receiver -- unless it's a failure, we will capture that below
default token
defa... | open Core_kernel
module Fee_currency = Currency.Fee
module Amount_currency = Currency.Amount
open Rosetta_models
module Signed_command = Mina_base.Signed_command
module Token_id = Mina_base.Token_id
module Public_key = Signature_lib.Public_key
module Signed_command_memo = Mina_base.Signed_command_memo
module Payment_pa... |
e6111d6340dbb6f682402d2042f287f3894c72d2110c25715d74624f2ce32fdb | jeromesimeon/Galax | streaming_constructors.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/streaming/streaming_constructors.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : streaming_constructors.mli , v 1.10 2007/02/01 22:08:54 simeon Exp $
open Finfo
open Streaming_types
val text_constructor : typed_xml_stream -> typed_xml_stream
val charref_constructor : int -> typed_xml_stream
val pi_cons... |
e2135876e11e1291abe99a9725de180c9ccd788c070067fb99947a1eaefee1cb | jherrlin/guitar-theory-training | chords.cljc | (ns se.jherrlin.drills.chords
(:require
[se.jherrlin.music-theory.utils
:refer [fformat find-chord find-chord-name find-root
fret-table-with-tones match-chord-with-scales]
:as utils]
[clojure.string :as str])
)
(defn tones-in-chords [find-root-f all-tones chords-map]
(let [
;;... | null | https://raw.githubusercontent.com/jherrlin/guitar-theory-training/e31954967311b402d7f7075cae143d0082f8c866/src/se/jherrlin/drills/chords.cljc | clojure | find-root-f se.jherrlin.music-theory/find-root-p
all-tones se.jherrlin.music-theory/tones
chords-map @se.jherrlin.music-theory/chords-atom
(fret-board-table-f chord-tones)
se.jherrlin.music-theory/fret-table-with-tones-p
find-root-f se.jherrlin.music-theory/find-root-p
all-tones ... | (ns se.jherrlin.drills.chords
(:require
[se.jherrlin.music-theory.utils
:refer [fformat find-chord find-chord-name find-root
fret-table-with-tones match-chord-with-scales]
:as utils]
[clojure.string :as str])
)
(defn tones-in-chords [find-root-f all-tones chords-map]
(let [
]
... |
974d4082bf7280bc6cb9b583d4b6fb6cec7b5b6a8486671f79ef553523dad8d1 | skanev/playground | 27.scm | SICP exercise 2.27
;
Modify your reverse procedure in exercise 2.18 to produce a deep - reverse
; procedure that takes a list as argument and returns as its value the list
; with its elements reversed and with all sublists deep-reversed as well. For
; example,
;
( define x ( list ( list 1 2 ) ( list 3 4 ) ) )
;
;... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/27.scm | scheme |
procedure that takes a list as argument and returns as its value the list
with its elements reversed and with all sublists deep-reversed as well. For
example,
x
(reverse x)
(deep-reverse x) | SICP exercise 2.27
Modify your reverse procedure in exercise 2.18 to produce a deep - reverse
( define x ( list ( list 1 2 ) ( list 3 4 ) ) )
( ( 1 2 ) ( 3 4 ) )
( ( 3 4 ) ( 1 2 ) )
( ( 4 3 ) ( 2 1 ) )
(define (deep-reverse items)
(define (iter items result)
(cond ((null? items) result)
((p... |
83fadbbffb0702f2897519b7dc21e6540fd23022e45f0ce6cc20b95c86d24c2e | music-suite/music-suite | Read.hs | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
-- |
Copyright : ( c ) 2020
--
-- License : BSD-style
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
module Data.Music.MusicXml.Read
( parseScore,
)
where
import Control.Applicative
import Control.Category ((>>>))
import... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Data/Music/MusicXml/Read.hs | haskell | |
License : BSD-style
Maintainer :
Stability : experimental
Portability : portable
Percussion clefs can have no line element in which case they appear
in the middle of the staff
TODO metronome, crescendo, diminuendo
For elements with many children corresponding to a sum type. This parser
is much mor... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
Copyright : ( c ) 2020
module Data.Music.MusicXml.Read
( parseScore,
)
where
import Control.Applicative
import Control.Category ((>>>))
import Control.Monad
import Data.Char (toUpper)
import Data.Default
import Data.List.Split (chop, wordsBy)
import Data... |
3b8856ac3be8f14708131696ca26ba3fad0440742af512cb98acfc3d374b40c9 | drathier/elm-offline | Name.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE OverloadedStrings #-}
module AST.Module.Name
( Canonical(..)
, basics, char, string
, maybe, result, list, array, dict, tuple
, platform, cmd, sub
, virtualDom, debug, bitwise
, jsonDecode, jsonEncode
, webgl, texture, vector2, vector3, vector4, matrix4
, isKernel, get... | null | https://raw.githubusercontent.com/drathier/elm-offline/f562198cac29f4cda15b69fde7e66edde89b34fa/compiler/src/AST/Module/Name.hs | haskell | # LANGUAGE OverloadedStrings #
NAMES
PRIMITIVES
CONTAINERS
EFFECTS
# NOINLINE sub #
JSON
# NOINLINE vector3 #
# NOINLINE vector4 #
IS KERNEL
BINARY | # OPTIONS_GHC -Wall #
module AST.Module.Name
( Canonical(..)
, basics, char, string
, maybe, result, list, array, dict, tuple
, platform, cmd, sub
, virtualDom, debug, bitwise
, jsonDecode, jsonEncode
, webgl, texture, vector2, vector3, vector4, matrix4
, isKernel, getKernel, canonicalIsKernel
)
whe... |
e3fc4e1b883823595b432f8c66c45573d62254441acd1a026bf14dc6e6280ba7 | poseidon-framework/poseidon-hs | List.hs | {-# LANGUAGE OverloadedStrings #-}
module Poseidon.CLI.List (runList, ListOptions(..), ListEntity(..), RepoLocationSpec(..)) where
import Poseidon.Janno (JannoList (..), JannoRow (..),
JannoRows (..))
import Poseidon.Package (PackageReadOption... | null | https://raw.githubusercontent.com/poseidon-framework/poseidon-hs/8d43c54cfccae1f05e0f7e7d16cd4d61f3a173f1/src/Poseidon/CLI/List.hs | haskell | # LANGUAGE OverloadedStrings #
| A datatype representing command line options for the list command
^ the list of base directories to search for packages
^ what to list
| A datatype to represent the options what to list
| The main function running the list command
load remote samples list
construct output
constr... |
module Poseidon.CLI.List (runList, ListOptions(..), ListEntity(..), RepoLocationSpec(..)) where
import Poseidon.Janno (JannoList (..), JannoRow (..),
JannoRows (..))
import Poseidon.Package (PackageReadOptions (..),
... |
a84b5e272f0f4f0dd87e07686455180bf786b0db3ec8870b666426dea87b9a6d | clojure/clojurescript | core.cljs | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the t... | null | https://raw.githubusercontent.com/clojure/clojurescript/a4673b880756531ac5690f7b4721ad76c0810327/src/test/cljs_build/foreign_libs/core.cljs | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns foreign-libs.core
(:require [thirdparty.add]))
(defn main []
(println (js/add 1 2)))
|
7df3f0e24a49d9e5b4859e9b7e991a0774aa8e253cc3596513109923a26cf020 | input-output-hk/ouroboros-network | Coherence.hs | # LANGUAGE TypeApplications #
module Test.Consensus.Shelley.Coherence (tests) where
import Data.Word (Word32)
import Test.Tasty
import Test.Tasty.QuickCheck
import qualified Ouroboros.Consensus.Mempool.Capacity as MempoolCapacity
import Cardano.Ledger.Alonzo.Scripts (ExUnits,... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/ebb34fa4d1ba1357e3b803a49f750d2ae3df19e5/ouroboros-consensus-shelley-test/test/Test/Consensus/Shelley/Coherence.hs | haskell | # LANGUAGE TypeApplications #
module Test.Consensus.Shelley.Coherence (tests) where
import Data.Word (Word32)
import Test.Tasty
import Test.Tasty.QuickCheck
import qualified Ouroboros.Consensus.Mempool.Capacity as MempoolCapacity
import Cardano.Ledger.Alonzo.Scripts (ExUnits,... | |
9e3f4b12679af44182edcd8cd46937213e1d896976bbbd658a20e15259567788 | timoore/lpsg | assembly.lisp | (in-package #:lpsg)
;;; An assembly is a collection of shapes and transforms. Effects too?
(defclass assembly ()
((children :accessor children :initarg :children :initform nil)))
(defmethod add-object ((parent assembly) object)
(push object (children parent)))
(defun do-shapes (assembly func)
(loop
for o... | null | https://raw.githubusercontent.com/timoore/lpsg/af2dcddb9d95c350a25e24da1f7dc53ce6d0f22b/lpsg/assembly.lisp | lisp | An assembly is a collection of shapes and transforms. Effects too? | (in-package #:lpsg)
(defclass assembly ()
((children :accessor children :initarg :children :initform nil)))
(defmethod add-object ((parent assembly) object)
(push object (children parent)))
(defun do-shapes (assembly func)
(loop
for obj in (children assembly)
if (typep obj 'shape)
do (funcall f... |
a1ffd9e41f10454417f32ba98a0caf850bb0828717daf4d5a94fd6629cb5d3c9 | dimitri/pgloader | md-methods.lisp | ;;;
Common methods implementations , default behaviour , for
;;;
(in-package #:pgloader.sources)
(defmethod parse-header ((copy md-copy))
"Unsupported by default, to be implemented in each md-copy subclass."
(error "Parsing the header of a ~s is not implemented yet." (type-of copy)))
(defmethod preprocess-ro... | null | https://raw.githubusercontent.com/dimitri/pgloader/3047c9afe141763e9e7ec05b7f2a6aa97cf06801/src/sources/common/md-methods.lisp | lisp |
always double quote column names
source-db is expected unbound here, so bypassed
we might now have to skip the header line
read in the text file, split it into columns | Common methods implementations , default behaviour , for
(in-package #:pgloader.sources)
(defmethod parse-header ((copy md-copy))
"Unsupported by default, to be implemented in each md-copy subclass."
(error "Parsing the header of a ~s is not implemented yet." (type-of copy)))
(defmethod preprocess-row ((copy... |
f745940a74104611da9cf99da9340847f09eea0383ed7870b791f0d13dd60b42 | err0r500/realworld-app-simple-haskell | Logger.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Adapter.Logger where
import Control.Exception
import qualified Domain.Messages as D
import Katip
import RIO
class Show a => Loggable a where
type F a
log... | null | https://raw.githubusercontent.com/err0r500/realworld-app-simple-haskell/20ec982256ec890f0c77b572eccef987cd3799bf/src/Adapter/Logger.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Adapter.Logger where
import Control.Exception
import qualified Domain.Messages as D
import Katip
import RIO
class Show a => Loggable a where
type F a
log... | |
0a752ca9df7d351325777bc4aa98242b0963d271e71660a09c5cfa3b0e33c37b | GaloisInc/daedalus | Parse.hs | {-# Language OverloadedStrings #-}
# Language RecordWildCards #
{-# Language BlockArguments #-}
module Parse where
import Prelude hiding (div)
import Data.Char(toLower, isAlphaNum, isAlpha, isDigit)
import Data.Ratio((%))
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Csv as CSV
import Data.Foldab... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/016da6b2de23747e48642f6ece79c07b436ef5d1/formats/pdf/dom-tool/src/Parse.hs | haskell | # Language OverloadedStrings #
# Language BlockArguments #
(computed later, see orderSpecFields)
??? | # Language RecordWildCards #
module Parse where
import Prelude hiding (div)
import Data.Char(toLower, isAlphaNum, isAlpha, isDigit)
import Data.Ratio((%))
import qualified Data.ByteString.Lazy as LBS
import qualified Data.Csv as CSV
import Data.Foldable(toList)
import Text.ParserCombinators.ReadP
import Control.Monad... |
ddf0a35e3bc79e76e8286f4747779715a250e9ad879a71fb7a4595839cbc3dcf | avsm/platform | uTop_complete.ml |
* uTop_complete.ml
* ----------------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of utop .
* uTop_complete.ml
* ----------------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of utop.
*)
[@@@warning "-9-27-32"]
open ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/utop.2.4.2/src/lib/uTop_complete.ml | ocaml | +-----------------------------------------------------------------+
| Utils |
+-----------------------------------------------------------------+
Check whether an identifier is a valid one.
+------------------------------------------------------------... |
* uTop_complete.ml
* ----------------
* Copyright : ( c ) 2011 , < >
* Licence : BSD3
*
* This file is a part of utop .
* uTop_complete.ml
* ----------------
* Copyright : (c) 2011, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of utop.
*)
[@@@warning "-9-27-32"]
open ... |
55b6ad3e6b88eb5240a341edf42bab44d139c2730fbb7b14423b4e662e338f32 | RefactoringTools/wrangler | refac_force_remove_arg.erl | Copyright ( c ) 2013 , ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%% %% Redistributions of source code must retain the above copyright
%% notice, this list of conditions... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/1c33ad0e923bb7bcebb6fd75347638def91e50a8/src/gen_refacs/refac_force_remove_arg.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
notice, this list of conditions and the following disclaimer.
%% Redi... | Copyright ( c ) 2013 , ,
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
@author < >
@private
-module(refac_force_remove_arg).
-behaviour(gen_refac).
-compile(export_all).
-include("wrangler.hrl")... |
16a2ca3c8618e715ac49460824ba2d915afb0ffedfeee6c21d5adf50f09131c1 | ghc/packages-base | Safe.hs | {-# LANGUAGE Safe #-}
# LANGUAGE NoImplicitPrelude #
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Safe
Copyright : ( c ) The FFI task force 2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
Maintainer :
-- St... | null | https://raw.githubusercontent.com/ghc/packages-base/52c0b09036c36f1ed928663abb2f295fd36a88bb/Foreign/Marshal/Safe.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
Module : Foreign.Marshal.Safe
License : BSD-style (see the file libraries/base/LICENSE)
Stability : provisional
Portability : portable
Marshalling support
Safe API Only.
---------------------------... | # LANGUAGE NoImplicitPrelude #
Copyright : ( c ) The FFI task force 2003
Maintainer :
module Foreign.Marshal.Safe
(
@Foreign . Marshal@ hierarchy :
module Foreign.Marshal.Alloc
, module Foreign.Marshal.Array
, module Foreign.Marshal.Error
, module Foreign.Mars... |
c016f2b1e34c6f56b76131604efc6f0c019c3918dd047f164faa9ceaeca9f3ef | input-output-hk/plutus-apps | Types.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeFamilies #-}
-- | This module provides several type aliases and utility functions to deal with them.
module Marconi.ChainIndex.Types
(
* Addresses alias used to query
TargetAddre... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/9f3c06050718cb6527b5653606b7b9fb1aa79edd/marconi-chain-index/src/Marconi/ChainIndex/Types.hs | haskell | # LANGUAGE PatternSynonyms #
# LANGUAGE TypeFamilies #
| This module provides several type aliases and utility functions to deal with them.
* Aliases for the current Cardano era
* Aliases to ease concept mapping between plutus types and cardano types
* Database file names
| A Cardano TxOut of the current ... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleInstances #
module Marconi.ChainIndex.Types
(
* Addresses alias used to query
TargetAddresses,
CurrentEra,
pattern AsCurrentEra,
pattern CurrentEra,
TxOut,
TxOutRef,
txOutRef,
utxoDbName,
addre... |
21850af5c96826362bf955e6a33c58b409c96b4a5878a8f21b800616ee09c2fc | quark-lang/quark | AST.hs | module Core.Inference.Type.AST where
import Core.Parser.AST (Expression)
import Data.Map (Map)
import Control.Monad.RWS (MonadIO, MonadRWS)
import Control.Monad.Except (MonadError)
type Argument = (String, Type)
data TypedPattern
= VarP String Type
| LitP Literal Type
| WilP Type
| AppP S... | null | https://raw.githubusercontent.com/quark-lang/quark/15ccc341a795190536063d14365a47f20f8fd67b/app/Core/Inference/Type/AST.hs | haskell | (Name, [Generics])
Pattern | [(Case, AST)] | module Core.Inference.Type.AST where
import Core.Parser.AST (Expression)
import Data.Map (Map)
import Control.Monad.RWS (MonadIO, MonadRWS)
import Control.Monad.Except (MonadError)
type Argument = (String, Type)
data TypedPattern
= VarP String Type
| LitP Literal Type
| WilP Type
| AppP S... |
741ae8b6e58289eaa8fa7ae662be06284bcd379d7ea20d1dd034c158dc50e048 | ghcjs/jsaddle-dom | HTMLLIElement.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.HTMLLIElement
(setType, getType, setValue, getValue, HTMLLIElement(..),
gTypeHTMLLIElement)
where
im... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/HTMLLIElement.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.HTMLLIElement
(setType, getType, setValue, getValue, HTMLLIElement(..),
gTypeHTMLLIElement)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegra... |
ade6443b8e781404118115736724bad9c69017f872f67d5ad4357c7bd31c1106 | tanakh/ICFP2011 | KRY2Madan.hs | # LANGUAGE CPP #
{-# OPTIONS -Wall #-}
import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Control.Monad.State
import Data.Maybe
import System.IO
import LTG
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives <- filterM
(\... | null | https://raw.githubusercontent.com/tanakh/ICFP2011/db0d670cdbe12e9cef4242d6ab202a98c254412e/ai/KRY2Madan.hs | haskell | # OPTIONS -Wall #
dec
S (K f) (K g)
lprint $ "Reusing " ++ show f
lprint $ "Failed reusing " ++
show f ++ " [expected " ++ show lval ++ " but was " ++ show ff ++ "]"
f1, f2: temp
f4
target: zombie target
v[f4] <- S (S Help I) (lazyApply Copy f8)
S (S Help I)
temporary fix
num f8 dmg
v[f8] <- (lazy... | # LANGUAGE CPP #
import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Control.Monad.State
import Data.Maybe
import System.IO
import LTG
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives <- filterM
(\ix -> do
... |
3ddab7e1dfb634b571d264c2d040f65708267b918bb27539fc6f76c1709694fd | LPCIC/matita | patternMatcher.mli |
Copyright ( C ) 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of the GN... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/extlib/patternMatcher.mli | ocaml | terms
constructors |
Copyright ( C ) 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of the GN... |
98e177e02ade11a6e446967bc825da97455b0af5d15e0ca81341e2c72f3d6918 | haroldcarr/learn-haskell-coq-ml-etc | BlockchainState.hs | module BlockchainState
( initialBlockchainState
)
where
import Blockchain (Blockchain, genesisBlock)
import Control.Concurrent.MVar (MVar, newMVar)
initialBlockchainState :: IO (MVar Blockchain)
initialBlockchainState = newMVar [genesisBlock]
| null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/playpen/blockchain/blockchain-framework-DELETE/src/BlockchainState.hs | haskell | module BlockchainState
( initialBlockchainState
)
where
import Blockchain (Blockchain, genesisBlock)
import Control.Concurrent.MVar (MVar, newMVar)
initialBlockchainState :: IO (MVar Blockchain)
initialBlockchainState = newMVar [genesisBlock]
| |
c729ba33d3b7e3971f6263e11e52840f25a303bd01a83298d3b7578a4f790e2d | Clojure2D/clojure2d-examples | bouncingball_vectors_type_1_2.clj | (ns examples.NOC.ch01.bouncingball-vectors-type-1.2
(:require [clojure2d.core :refer :all]
[fastmath.vector :as v]
[clojure2d.color :as c])
(:import fastmath.vector.Vec2))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defprotocol BallProto
(update-ball [b canv... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/9de82f5ac0737b7e78e07a17cf03ac577d973817/src/NOC/ch01/bouncingball_vectors_type_1_2.clj | clojure | (ns examples.NOC.ch01.bouncingball-vectors-type-1.2
(:require [clojure2d.core :refer :all]
[fastmath.vector :as v]
[clojure2d.color :as c])
(:import fastmath.vector.Vec2))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defprotocol BallProto
(update-ball [b canv... | |
006c1b4bdcca5c41b1cd12c7711f72112184450a9cc37956b3bbffd07034a75f | degree9/meta | util.clj | (ns meta.boot.util
(:require [boot.core :as boot]
[boot.util :as util]
[clojure.java.io :as io]))
Meta Task Utils ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
(defn read-file [file]
(when (.exists (io/file file)... | null | https://raw.githubusercontent.com/degree9/meta/16dee6b01dd6402250b4b7a30185c0c0466985b3/src/meta/boot/util.clj | clojure | ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
| (ns meta.boot.util
(:require [boot.core :as boot]
[boot.util :as util]
[clojure.java.io :as io]))
(defn read-file [file]
(when (.exists (io/file file))
(read-string (slurp file))))
(defn read-resource [file]
(read-string (slurp (io/resource file))))
(defn validate-checkouts [chk]
... |
17aab40b43d58ec27595e7b5f745bde9f090ba915f43c18f7964f486cf8d1cac | jtza8/interact | sprite-zoo.lisp | ; Use of this source code is governed by a BSD-style
license that can be found in the license.txt file
; in the root directory of this project.
(in-package #:interact-examples)
(export 'sprite-zoo)
(defun sprite-zoo ()
(with-display-system (:width 800 :height 600
:title "Sprite Zoo"
... | null | https://raw.githubusercontent.com/jtza8/interact/ea2121d7e900dac4fe2a085bd5f2783a640e71f8/examples/sprite-zoo/sprite-zoo.lisp | lisp | Use of this source code is governed by a BSD-style
in the root directory of this project. | license that can be found in the license.txt file
(in-package #:interact-examples)
(export 'sprite-zoo)
(defun sprite-zoo ()
(with-display-system (:width 800 :height 600
:title "Sprite Zoo"
:clear-colour '(0.2 0.2 0.2 1.0)
:full-screen t)
... |
d06c6036f4846933ebe5a4aec0cf19b96243808d91ae4e5baaf43d32a4c5b994 | ijvcms/chuanqi_dev | player_charge_db.erl | %%%-------------------------------------------------------------------
@author apple
( C ) 2015 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 30 . 十一月 2015 14:11
%%%-------------------------------------------------------------------
-module(player_charge_db).
-include("common.hrl").
-include("cache.hrl").
%% A... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/charge/player_charge_db.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
====================================================================
API | @author apple
( C ) 2015 , < COMPANY >
Created : 30 . 十一月 2015 14:11
-module(player_charge_db).
-include("common.hrl").
-include("cache.hrl").
-export([
select_row/1,
select_charge_num/1,
insert/1,
update/2,
delete/1,
select_byid/1,
update_byid/2
]).
select_row({Id, PlayerId}) ->
case db:select_row(p... |
2b12cbab2391d43868738e878c8ee143b3106e91f2a49eae0d1ccb8af0f1f76c | bravit/hid-examples | SingManual.hs | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE StandaloneDeriving #
data DoorState = Opened | Closed
deriving Show
data SDoorState (s :: DoorState) where
SClosed :: SDoorState Closed
SOpened :: SDoorState Opened
c... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch13/doors/SingManual.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE StandaloneDeriving #
data DoorState = Opened | Closed
deriving Show
data SDoorState (s :: DoorState) where
SClosed :: SDoorState Closed
SOpened :: SDoorState Opened
class SDoorStateI (s :: ... |
88e947fe53cb5766f87be2d16381a31f1079fa444836d0fa2e61d52d457762cc | raml-org/api-modeling-framework | raml_test.cljc | (ns api-modeling-framework.generators.domain.raml-test
#?(:cljs (:require-macros [cljs.test :refer [deftest is async]]))
(:require #?(:clj [clojure.test :refer :all])
[api-modeling-framework.model.vocabulary :as v]
[api-modeling-framework.model.document :as document]
[api-modelin... | null | https://raw.githubusercontent.com/raml-org/api-modeling-framework/34bb3b6c3e3f91b775e27f8e389e04eb2c36beb7/test/api_modeling_framework/generators/domain/raml_test.cljc | clojure | (ns api-modeling-framework.generators.domain.raml-test
#?(:cljs (:require-macros [cljs.test :refer [deftest is async]]))
(:require #?(:clj [clojure.test :refer :all])
[api-modeling-framework.model.vocabulary :as v]
[api-modeling-framework.model.document :as document]
[api-modelin... | |
4b095d1928f51dc83b48082c8a400fa64eefedbd0fab247df3aed8790172be61 | kitten/bs-flow-parser | parse_error.ml | *
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the... | null | https://raw.githubusercontent.com/kitten/bs-flow-parser/00630c06016b51a7040ef4160ed2999cd208babd/src/parse_error.ml | ocaml | *
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the... | |
9da9b2c067fd99320d5d30e51160273a91c1495b46ad279dde24ad751508fb67 | fluree/ledger | upgrade.clj | (ns fluree.db.ledger.upgrade
(:require [fluree.db.util.log :as log]
[fluree.db.api :as fdb]
[fluree.db.storage.core :as storage]
[fluree.db.flake :as flake]
[fluree.db.index :as index]
[fluree.db.util.async :refer [go-try <? <??]]
[fluree.db.ledg... | null | https://raw.githubusercontent.com/fluree/ledger/31f3e11a0648501b0a8cc6148177e54c67420042/src/fluree/db/ledger/upgrade.clj | clojure | need to update child, out of sync
no change
check every db
dissoc old value
assoc new value
if old network has no ledgers left, delete
marker we used - default | (ns fluree.db.ledger.upgrade
(:require [fluree.db.util.log :as log]
[fluree.db.api :as fdb]
[fluree.db.storage.core :as storage]
[fluree.db.flake :as flake]
[fluree.db.index :as index]
[fluree.db.util.async :refer [go-try <? <??]]
[fluree.db.ledg... |
4540507704a21605a2dd9c0c55009d9f043649413d72ce1948736449478c6721 | lpgauth/shackle | shackle_client.erl | -module(shackle_client).
-include("shackle_internal.hrl").
-optional_callbacks([handle_timeout/2]).
-callback init(Options :: term()) ->
{ok, State :: term()} |
{error, Reason :: term()}.
-callback setup(Socket :: inet:socket(), State :: term()) ->
{ok, State :: term()} |
{error, Reason :: term(), St... | null | https://raw.githubusercontent.com/lpgauth/shackle/ac1de9c9405e83d2f94387642f22ee813ee11aae/src/shackle_client.erl | erlang | -module(shackle_client).
-include("shackle_internal.hrl").
-optional_callbacks([handle_timeout/2]).
-callback init(Options :: term()) ->
{ok, State :: term()} |
{error, Reason :: term()}.
-callback setup(Socket :: inet:socket(), State :: term()) ->
{ok, State :: term()} |
{error, Reason :: term(), St... | |
be2e927b202948f706c9655d377386004347faa2d52be5a427b29c15f03a5eec | zero-one-group/geni | model_selection.clj | (ns examples.classification
(:require
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]))
(def training
(g/table->dataset
[[0 "a b c d e spark" 1.0]
[1 "b d" 0.0]
[2 "spark f g h" 1.0]
[3 "hadoop mapreduce" 0.0]
[4 "b spark who" 1.0]
[5 "g d a y" ... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/examples/model_selection.clj | clojure | => | (ns examples.classification
(:require
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]))
(def training
(g/table->dataset
[[0 "a b c d e spark" 1.0]
[1 "b d" 0.0]
[2 "spark f g h" 1.0]
[3 "hadoop mapreduce" 0.0]
[4 "b spark who" 1.0]
[5 "g d a y" ... |
87f762d5d8f867f05a298c12bb8c514f469ab53c2d105625e974468fad4dc891 | haskell-suite/base | Mem.hs | {-# LANGUAGE Safe #-}
# LANGUAGE CPP #
#ifdef __GLASGOW_HASKELL__
# LANGUAGE ForeignFunctionInterface #
#endif
-----------------------------------------------------------------------------
-- |
-- Module : System.Mem
Copyright : ( c ) The University of Glasgow 2001
-- License : BSD-style (see the fil... | null | https://raw.githubusercontent.com/haskell-suite/base/1ee14681910c76d0a5a436c33ecf3289443e65ed/System/Mem.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
Module : System.Mem
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
Memory-related system things.
---------------------------... | # LANGUAGE CPP #
#ifdef __GLASGOW_HASKELL__
# LANGUAGE ForeignFunctionInterface #
#endif
Copyright : ( c ) The University of Glasgow 2001
module System.Mem (
performGC
) where
import Prelude
#ifdef __HUGS__
import Hugs.IOExts
#endif
#ifdef __GLASGOW_HASKELL__
#endif
|
f8cc8f698b5a2c315f67cbc2ecce36006d6e20156da99c141bf4557426d9c1df | VictorCMiraldo/generics-mrsop | Outline.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE TypeSynonymInstances #-}
# OPTIONS_GHC -cpp #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANG... | null | https://raw.githubusercontent.com/VictorCMiraldo/generics-mrsop/b66bb6c651297cdb71655663e34ab35812b38f72/scratchpad/Outline.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE RankNTypes #
* Codes
can't use type synonyms as they are
not promoted to kinds with -XDataKinds yet.
#Kindsynonymsfromtypesynonympromotion
* Interpretation of Codes
-the-show-class
* SOP functionality
* Recursive Knot
* Cannonical Example
* Metadata a la generics-... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# OPTIONS_GHC -cpp #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE GADTs #
UndecidableInstances needed for Show of Fix
# ... |
c9fbfa09fee18e3829ad70f998045ee9a36cff55877899a953f900c4c3a8b223 | raaz-crypto/raaz | Internal.hs | -- | Some internal functions exposed by raaz mainly for testing
-- purposes. The functions here are pretty low level and/or expose to
-- much of the system details. If you find your self needing some of
-- the functions here, it should be treated as a bug in raaz. Please
-- file an issue.
module Internal
( fillSy... | null | https://raw.githubusercontent.com/raaz-crypto/raaz/91799e1ae528e909ad921f6c0d6f51ebd8c7328f/api/random/Internal.hs | haskell | | Some internal functions exposed by raaz mainly for testing
purposes. The functions here are pretty low level and/or expose to
much of the system details. If you find your self needing some of
the functions here, it should be treated as a bug in raaz. Please
file an issue.
| __WARNING__ Never use this function d... | module Internal
( fillSystemEntropy
) where
import Raaz.Core
import Entropy
fillSystemEntropy :: LengthUnit l => l -> Ptr Word8 -> IO (BYTES Int)
fillSystemEntropy = getEntropy . inBytes
|
108b9dc429265844468041b324cc2cb9b515743c10f8768d3efec29ed2be5d52 | kana-sama/sicp | 1.16 - iter pow.scm | (define (pow x n)
(let loop ((extra 1) (result x) (power n))
(cond ((zero? power) extra)
((even? power) (loop extra (square result) (half power)))
(else (loop (* extra result) result (dec power))))))
| null | https://raw.githubusercontent.com/kana-sama/sicp/fc637d4b057cfcae1bae3d72ebc08e1af52e619d/1/1.16%20-%20iter%20pow.scm | scheme | (define (pow x n)
(let loop ((extra 1) (result x) (power n))
(cond ((zero? power) extra)
((even? power) (loop extra (square result) (half power)))
(else (loop (* extra result) result (dec power))))))
| |
1b1f2b7eb8cbcc4897716ddf5e3d16f07e5c5884fda16e2ec663edb20f93a5a6 | dhess/sicp-solutions | ex1.17.scm | (define (double a)
(* a 2))
(define (even? n)
(= (remainder n 2) 0))
(define (halve a)
(/ a 2))
(define (fast-mul a b)
(cond
((= b 0) 0)
((even? b) (double (fast-mul a (halve b))))
(else (+ a (fast-mul a (- b 1))))))
| null | https://raw.githubusercontent.com/dhess/sicp-solutions/2cf78db98917e9cb1252efda76fddc8e45fe4140/chap1/ex1.17.scm | scheme | (define (double a)
(* a 2))
(define (even? n)
(= (remainder n 2) 0))
(define (halve a)
(/ a 2))
(define (fast-mul a b)
(cond
((= b 0) 0)
((even? b) (double (fast-mul a (halve b))))
(else (+ a (fast-mul a (- b 1))))))
| |
b9df074cca27d26a3a5fe7389d44ba3f45fc7c9a384c1d637ad1db81e0f1f825 | richhickey/clojure-contrib | random_numbers.clj | ;; Random number generators
by
last updated May 3 , 2009
Copyright ( c ) , 2009 . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By usi... | null | https://raw.githubusercontent.com/richhickey/clojure-contrib/40b960bba41ba02811ef0e2c632d721eb199649f/src/main/clojure/clojure/contrib/probabilities/random_numbers.clj | clojure | Random number generators
Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.
(and thus r... |
by
last updated May 3 , 2009
Copyright ( c ) , 2009 . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
(ns
#^{:author "Konrad Hinsen"
:doc "Random number streams
This library provides random number generators with a common
s... |
a23a3ee16a6d9c5e7f1be9aa2ec2bbcc7c791bc2703630c7ff0fd8429d6d5c0c | well-typed/large-records | HKD.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE KindSignatures #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE NamedFieldPuns ... | null | https://raw.githubusercontent.com/well-typed/large-records/fb983aa136c2602499c2421323bd52b6a54b7c9a/large-records/test/Test/Record/Sanity/HKD.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE KindSignatures #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fplugin=Data.Record.Plugin #
| ... | # LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
module Test.Record.Sanity.HKD (
tests
) where
import Data.Functor.Identi... |
f7e5d785ee983766ae82675dc76b241e73e8eff8cbc48790b2282554625e5ae5 | tormaroe/ciki | core.clj | (ns ciki.core
(:require ciki.wikipage)
(:use compojure.core
ring.util.response
ring.adapter.jetty))
(defroutes ciki-routes
(GET "/" [ ] (redirect "/index"))
(GET "/all" [ ] (ciki.wikipage/render-all))
(GET "/:id" [id] (ciki.wikipage/render id :view... | null | https://raw.githubusercontent.com/tormaroe/ciki/19615eb4f9af82e5cb7fc62ebfb12e0cb85cbd5d/src/ciki/core.clj | clojure | (ns ciki.core
(:require ciki.wikipage)
(:use compojure.core
ring.util.response
ring.adapter.jetty))
(defroutes ciki-routes
(GET "/" [ ] (redirect "/index"))
(GET "/all" [ ] (ciki.wikipage/render-all))
(GET "/:id" [id] (ciki.wikipage/render id :view... | |
0ccc4b1dca790a0f573c5f9676f7713046e6375aa0deb4d6754889765471d44c | bigmlcom/sampling | project.clj | (defproject bigml/sampling "3.2"
:description "Random Sampling in Clojure"
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:aliases {"lint" ["do" "check," "eastwood"]
"distcheck" ["do" "clean," "lint," "test"]}
:profiles {:dev {:plugins [[jonase/eastwood "0.2.3"]]}}
... | null | https://raw.githubusercontent.com/bigmlcom/sampling/8242cac714ac45cb4ef93255c4b5ee5135a07389/project.clj | clojure | (defproject bigml/sampling "3.2"
:description "Random Sampling in Clojure"
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:aliases {"lint" ["do" "check," "eastwood"]
"distcheck" ["do" "clean," "lint," "test"]}
:profiles {:dev {:plugins [[jonase/eastwood "0.2.3"]]}}
... | |
ab4a03c846c680bee8c46ec497592f31dc48f8a6e4c8352b097be2d9654d32ce | exercism/ocaml | example.ml | open Base
open Base.Continue_or_stop
Fold over the characters of s. When an open bracket is met , push this onto a
stack . When a close bracket is met , and the most recent open bracket matches
it , pop this from the stack . When a close bracket is met that does n't match
an open bracket ( empty stack... | null | https://raw.githubusercontent.com/exercism/ocaml/914e58d48e58a96fe7635fe4b06cc103af4ed683/exercises/practice/matching-brackets/.meta/example.ml | ocaml | open Base
open Base.Continue_or_stop
Fold over the characters of s. When an open bracket is met , push this onto a
stack . When a close bracket is met , and the most recent open bracket matches
it , pop this from the stack . When a close bracket is met that does n't match
an open bracket ( empty stack... | |
d223cb223051bc1ca6d604d70d2094d99fc78d88f44316999877832c5d83ae32 | privet-kitty/cl-competitive | 2d-bit.lisp | (defpackage :cp/2d-bit
(:use :cl)
(:export #:define-2d-bitree)
(:documentation "Provides 2-dimensional binary indexed tree."))
(in-package :cp/2d-bit)
;; TODO: binary search
(defmacro define-2d-bitree (name &key (operator '#'+) (identity 0) sum-type)
"OPERATOR := binary operator (comprising a commutative monoi... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/946280a0d53c83f93597186d89aebe481d85d65e/module/2d-bit.lisp | lisp | TODO: binary search | (defpackage :cp/2d-bit
(:use :cl)
(:export #:define-2d-bitree)
(:documentation "Provides 2-dimensional binary indexed tree."))
(in-package :cp/2d-bit)
(defmacro define-2d-bitree (name &key (operator '#'+) (identity 0) sum-type)
"OPERATOR := binary operator (comprising a commutative monoid)
IDENTITY := object (... |
10a218453551b9f30ae4f5690d830c1c863f73780a2f196133638b5a8f7d524e | kaznum/programming_in_ocaml_exercise | gcd.ml | let rec gcd (m, n) =
if n mod m = 0 then m
else
if (n - m) < m then gcd(n - m, m) else gcd(m, n - m);;
| null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex3.11/gcd.ml | ocaml | let rec gcd (m, n) =
if n mod m = 0 then m
else
if (n - m) < m then gcd(n - m, m) else gcd(m, n - m);;
| |
8b1756a3c11f3923d633cfdc40e092d9f2707fb42447a90e2c68620ec9dfc3b2 | MinaProtocol/mina | merkle_list_verifier.ml | open Core_kernel
module type Inputs_intf = sig
type proof_elem
type hash [@@deriving equal]
val hash : hash -> proof_elem -> hash
end
module Make_intf (Input : Inputs_intf) = struct
module type S = sig
val verify :
init:Input.hash
-> Input.proof_elem list
-> Input.hash
-> Inpu... | null | https://raw.githubusercontent.com/MinaProtocol/mina/f3f7d625ce45a0820a56ebc8f4f1c967865a3e57/src/lib/merkle_list_verifier/merkle_list_verifier.ml | ocaml | TODO: probably [verify_right] is the right thing in most cases, because we want
hashes to start with that, as we build up a list; the default left fold combines
the init hash with the head element
leaving the default [verify] because it's used a few places in the code
| open Core_kernel
module type Inputs_intf = sig
type proof_elem
type hash [@@deriving equal]
val hash : hash -> proof_elem -> hash
end
module Make_intf (Input : Inputs_intf) = struct
module type S = sig
val verify :
init:Input.hash
-> Input.proof_elem list
-> Input.hash
-> Inpu... |
8b31294dd61bbd1a1748e71ec6d0f0adba5435599e890085db35287bf8b333dd | juspay/euler-hs | MySQL.hs | module SQLDB.TestData.Scenarios.MySQL where
import EulerHS.Prelude
import qualified EulerHS.Language as L
import qualified EulerHS.Types as T
import SQLDB.TestData.Connections (connectOrFail)
import SQLDB.TestData.Types
import Database.Beam ((<-.), (==.))
import qualified Dat... | null | https://raw.githubusercontent.com/juspay/euler-hs/0fdda6ef43c1a6c9c7221d7c194c278e375b9936/testDB/SQLDB/TestData/Scenarios/MySQL.hs | haskell | module SQLDB.TestData.Scenarios.MySQL where
import EulerHS.Prelude
import qualified EulerHS.Language as L
import qualified EulerHS.Types as T
import SQLDB.TestData.Connections (connectOrFail)
import SQLDB.TestData.Types
import Database.Beam ((<-.), (==.))
import qualified Dat... | |
406970b6c78f124a1f469ab6bb613d9caa4d62c8a28e062ef1e4b5c5e3097da6 | oliyh/martian | encoding.cljc | (ns martian.encoding
(:require [clojure.string :as string]))
(defn choose-content-type [encoders options]
(some (set options) (keys encoders)))
(def auto-encoder
{:encode identity
:decode identity
:as :auto})
(defn find-encoder [encoders content-type]
(if (string/blank? content-type)
auto-encoder
... | null | https://raw.githubusercontent.com/oliyh/martian/c20d3fad47709ecfc0493e2fb607d5b56ea3193d/core/src/martian/encoding.cljc | clojure | (ns martian.encoding
(:require [clojure.string :as string]))
(defn choose-content-type [encoders options]
(some (set options) (keys encoders)))
(def auto-encoder
{:encode identity
:decode identity
:as :auto})
(defn find-encoder [encoders content-type]
(if (string/blank? content-type)
auto-encoder
... | |
d45d19e3dffe804176496e533928fcc4275fc336ee1f0595d0e1d24c108fceb7 | nominolo/lambdachine | Jit0006.hs | # LANGUAGE NoImplicitPrelude , BangPatterns , MagicHash #
-- RUN: %bc_vm_chk
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.Jit0006 where
import GHC.Base
import GHC.Integer
import GHC.Num
--import Debug.Trace
import Prelude ( show )
-- Tests register allocator for handling of sunken objects
loop :: I... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/Jit0006.hs | haskell | RUN: %bc_vm_chk
import Debug.Trace
Tests register allocator for handling of sunken objects | # LANGUAGE NoImplicitPrelude , BangPatterns , MagicHash #
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.Jit0006 where
import GHC.Base
import GHC.Integer
import GHC.Num
import Prelude ( show )
loop :: Int -> Int -> Int -> Int
loop x y z | trace ( show ( x , y , z ) ) False = let a = a in a
loop (I# 0... |
9e12d09b491fd692986b88d5f80f537dafc29668673ef4b2371533ea4045933f | vii/dysfunkycom | string-blended.lisp |
(in-package :lispbuilder-sdl)
(defmethod _render-string-blended_ :around ((string string) (font font) (color color) free cache)
(declare (ignore cache))
(when free
(free-cached-surface font))
(call-next-method))
(defmethod _render-string-blended_ ((string string) (font font) (color color) free cache)
(de... | null | https://raw.githubusercontent.com/vii/dysfunkycom/a493fa72662b79e7c4e70361ad0ea3c7235b6166/addons/lispbuilder-sdl/sdl/string-blended.lisp | lisp |
(in-package :lispbuilder-sdl)
(defmethod _render-string-blended_ :around ((string string) (font font) (color color) free cache)
(declare (ignore cache))
(when free
(free-cached-surface font))
(call-next-method))
(defmethod _render-string-blended_ ((string string) (font font) (color color) free cache)
(de... | |
b4dd014b02ab1f47286de1e0b702a94a0dd150a92a00dafb1da0f6627721892a | VERIMAG-Polyhedra/VPL | HOracle_backend.ml | let oracle _ = failwith "Handelman linearization is not currently available"
module Poly = ParamCoeff . Poly
module Coeff = Poly . Coeff
module CP = CstrPoly
module MapMonomial = Map . Make(Poly . MonomialBasis )
module Translation = struct
let rec term_to_poly : ASTerm.BasicQTerm.term - > Poly.t
... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/ocaml/lin/handelman/HOracle_backend.ml | ocaml | Input integer must be nonnegative!
TODO : la traduction de cp terme est elle bonne?
TODO : la traduction de poly à cp est elle bonne?
Constraints need to be reversed, because frontend ones are.
Otherwise, witnesses generated by the oracle are reversed. | let oracle _ = failwith "Handelman linearization is not currently available"
module Poly = ParamCoeff . Poly
module Coeff = Poly . Coeff
module CP = CstrPoly
module MapMonomial = Map . Make(Poly . MonomialBasis )
module Translation = struct
let rec term_to_poly : ASTerm.BasicQTerm.term - > Poly.t
... |
cb921f5062fefebd468ddd59ed3b1e0cb1bea1c182032a45f1a888a4903d6bfc | zenhack/haskell-capnp | GenHelpers.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Capnp.GenHelpers
( dataField,
ptrField,
groupField,
voidFiel... | null | https://raw.githubusercontent.com/zenhack/haskell-capnp/6cf9fae35189a3668f2740d64c634675ec5fbdec/lib/Capnp/GenHelpers.hs | haskell | # LANGUAGE ConstraintKinds #
* Re-exports from the standard library.
variant is the one that is set. This should only be used by generated code.
one pointer, which is the pointer we will retrieve. This is only safe for
(and so is suseptable to denial of service attacks), and it calls 'error'
if decoding is not suc... | # LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Capnp.GenHelpers
( dataField,
ptrField,
groupField,
voidField,
readVariant,
Mutabilit... |
ac9aef574596593d879136fc3ad1ceeedcbae5511a612dbd9de62dd86990dd3c | TerrorJack/ghc-alter | Storable.hs | # LANGUAGE Trustworthy #
# LANGUAGE CPP , NoImplicitPrelude , ScopedTypeVariables , BangPatterns #
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Storable
Copyright : ( c ) The FFI task force 2001
-- License : see libraries/base/LICENSE
--
Ma... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/Foreign/Storable.hs | haskell | ---------------------------------------------------------------------------
|
Module : Foreign.Storable
License : see libraries/base/LICENSE
Stability : provisional
Portability : portable
The module "Foreign.Storable" provides most elementary support for
marshalling and is part of the language-... | # LANGUAGE Trustworthy #
# LANGUAGE CPP , NoImplicitPrelude , ScopedTypeVariables , BangPatterns #
Copyright : ( c ) The FFI task force 2001
Maintainer :
Foreign Function Interface ( FFI ) , and will normally be imported via
module Foreign.Storable
( Storable(
sizeOf,
... |
0dee21899299ce514c3aafaff75b4c3a2af23d089528f341053c90477f4e728b | privet-kitty/cl-competitive | welzl.lisp | (defpackage :cp/test/welzl
(:use :cl :fiveam :cp/welzl :cp/test/nearly-equal)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/welzl)
(in-suite base-suite)
(test welzl
(declare (notinline calc-smallest-circle))
(let ((points (vector #c(10 9) #c(5 9) #c(2 0) #c(0 0) #c(2 7)
... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/test/welzl.lisp | lisp | (defpackage :cp/test/welzl
(:use :cl :fiveam :cp/welzl :cp/test/nearly-equal)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/welzl)
(in-suite base-suite)
(test welzl
(declare (notinline calc-smallest-circle))
(let ((points (vector #c(10 9) #c(5 9) #c(2 0) #c(0 0) #c(2 7)
... | |
631b808bb63ed1f2bd68fd599c7ab892a70665772a98989613e74c9a14eac89f | FPBench/FPBench | evaluate.rkt | #lang racket
(require "src/fpcore-checker.rkt" "src/fpcore-interpreter.rkt" "src/fpcore-reader.rkt")
(provide evaluate-main)
(define (evaluate-main argv stdin-port stdout-port)
(define *in-file* (make-parameter "-"))
(define *out-file* (make-parameter "-"))
(define check-types? #t)
(define ragged-check? #t)
... | null | https://raw.githubusercontent.com/FPBench/FPBench/43a8f4854baebce88614059e4b48bcfc08d97f61/evaluate.rkt | racket | maybe a way to provide a context?
context override information? | #lang racket
(require "src/fpcore-checker.rkt" "src/fpcore-interpreter.rkt" "src/fpcore-reader.rkt")
(provide evaluate-main)
(define (evaluate-main argv stdin-port stdout-port)
(define *in-file* (make-parameter "-"))
(define *out-file* (make-parameter "-"))
(define check-types? #t)
(define ragged-check? #t)
... |
1c783a2bdb9be138aef5e07db6271190c25b8a441c425fdfe7a7245d296e0076 | oliyh/re-learn | context.cljs | (ns re-learn.devcards.context
(:require [devcards.core :as dc :refer-macros [defcard-rg]]
[reagent.core :as reagent]
[re-learn.views :as views]))
(def step-names ["conflogulate-bannisters"
"reticulate-splines"
"bamboozle-conifers"
"combobulat... | null | https://raw.githubusercontent.com/oliyh/re-learn/8fb3307554debb28b6545a4d38fa3b1ccfa43419/test/re_learn/devcards/context.cljs | clojure | (ns re-learn.devcards.context
(:require [devcards.core :as dc :refer-macros [defcard-rg]]
[reagent.core :as reagent]
[re-learn.views :as views]))
(def step-names ["conflogulate-bannisters"
"reticulate-splines"
"bamboozle-conifers"
"combobulat... | |
e8e865f771b49e3fd5f391f67585e4335e88214c03cc826814d408e08df733f3 | noloop/cacau | cacau.lisp | (in-package #:noloop.cacau)
(let ((runner (make-runner)))
(defun cacau-runner () runner)
(defun reset-runner () (setf runner (make-runner)))
(defun create-reporter (runner name reporter-options)
(cond ((equal :min name) (reporter-min runner reporter-options))
((equal :list name) (reporter-list ... | null | https://raw.githubusercontent.com/noloop/cacau/ba0fb36a284ded884f1dab0bd3f0f41ec14e3038/src/cacau.lisp | lisp | (in-package #:noloop.cacau)
(let ((runner (make-runner)))
(defun cacau-runner () runner)
(defun reset-runner () (setf runner (make-runner)))
(defun create-reporter (runner name reporter-options)
(cond ((equal :min name) (reporter-min runner reporter-options))
((equal :list name) (reporter-list ... | |
d42be12a761e31b580d203674da933fb476c0d76239f477b8ad5cd98bf383e43 | iharland/pdf-to-images | core.clj | (ns pdf-to-images.core
(:require [clojure.java.io :as io])
(:import [org.apache.pdfbox.pdmodel PDDocument]
[org.apache.pdfbox.rendering PDFRenderer]
[org.apache.pdfbox.rendering ImageType]
[org.apache.pdfbox.tools.imageio ImageIOUtil]
(java.io ByteArrayOutputStream)))
(d... | null | https://raw.githubusercontent.com/iharland/pdf-to-images/1e5caa2311947cd6a8b995b643dc643095ba2330/src/pdf_to_images/core.clj | clojure | (ns pdf-to-images.core
(:require [clojure.java.io :as io])
(:import [org.apache.pdfbox.pdmodel PDDocument]
[org.apache.pdfbox.rendering PDFRenderer]
[org.apache.pdfbox.rendering ImageType]
[org.apache.pdfbox.tools.imageio ImageIOUtil]
(java.io ByteArrayOutputStream)))
(d... | |
3fa1aa5840b452f44a9ec1102724b1c74462a7bc6f3cbae68efacc246b2e033b | fumieval/objective | Mortal.hs | {-# LANGUAGE Safe #-}
{-# LANGUAGE Rank2Types #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE BangPatterns #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Object.Mortal
Copyright : ( c ) 2015
-- License : BSD3
--
Maintainer : < >
-- Stabil... | null | https://raw.githubusercontent.com/fumieval/objective/04281ce38a7996498a4b0c97783e421f0b841914/src/Control/Object/Mortal.hs | haskell | # LANGUAGE Safe #
# LANGUAGE Rank2Types #
# LANGUAGE BangPatterns #
---------------------------------------------------------------------------
|
Module : Control.Object.Mortal
License : BSD3
Stability : provisional
---------------------------------------------------------------------------
| A 'Mo... | # LANGUAGE LambdaCase #
Copyright : ( c ) 2015
Maintainer : < >
Portability : GADTs , Rank2Types
module Control.Object.Mortal (
Mortal(..),
mortal,
mortal_,
runMortal,
immortal,
apprises,
apprise
) where
import Control.Object.Object
import Control.Monad.Trans.Excep... |
8b9f7b267bef188b2f4779f924f6c23ba172fd4120e5dabd9c0d46dd57e19d8c | Happstack/happstack-server | TimeoutManager.hs | module Happstack.Server.Internal.TimeoutManager
( Manager
, Handle
, initialize
, register
, registerKillThread
, tickle
, pause
, resume
, cancel
, forceTimeout
, forceTimeoutAll
) where
import qualified Data.IORef as I
import Control.Concurrent (forkIO, threadDelay, my... | null | https://raw.githubusercontent.com/Happstack/happstack-server/d9cdb9af5635b1ebd9db0801b66dbf4e58aba66b/src/Happstack/Server/Internal/TimeoutManager.hs | haskell | | A timeout manager
| terminate all threads immediately | module Happstack.Server.Internal.TimeoutManager
( Manager
, Handle
, initialize
, register
, registerKillThread
, tickle
, pause
, resume
, cancel
, forceTimeout
, forceTimeoutAll
) where
import qualified Data.IORef as I
import Control.Concurrent (forkIO, threadDelay, my... |
ade672eb6436e2f043efdad1d88a3891425ea1f67c4b7475986954a5848d13e8 | heyoka/faxe | esp_join.erl | %% Date: 05.01.17 - 14:11
Ⓒ 2017 heyoka
%% @doc
from two or more nodes , given a list of prefixes , for each row
%% If the 'field_merge' parameter is given, the node will merge the field given from every in-node, instead of
%% joining.
%% When considering the "fill" option, the following rules apply:
%% * none - ... | null | https://raw.githubusercontent.com/heyoka/faxe/5ec88d8bfe7ac266c3f1b9406872f3a20bbf7b0d/apps/faxe/src/components/esp_join.erl | erlang | Date: 05.01.17 - 14:11
@doc
If the 'field_merge' parameter is given, the node will merge the field given from every in-node, instead of
joining.
When considering the "fill" option, the following rules apply:
* none - (default) skip rows where a point is missing, inner join.
* null - fill missing points with null... | Ⓒ 2017 heyoka
from two or more nodes , given a list of prefixes , for each row
data - types that can be merged : 2 maps , 2 lists , 2 numbers ( which will be added ) , strings ( will be concatenated )
@todo make sure points that are handled are coming in on different ports ( missing timeout )
-module(esp_join... |
5accd4e046e86245009d582d419e5d76d3e148f25d59c23433144ae708e69e13 | ds-wizard/engine-backend | DocumentTemplateAssetDTO.hs | module Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetDTO where
import Data.Time
import qualified Data.UUID as U
import GHC.Generics
import GHC.Int
data DocumentTemplateAssetDTO = DocumentTemplateAssetDTO
{ uuid :: U.UUID
, fileName :: String
, contentType :: String
, fileSize :: Int64
, ur... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Resource/DocumentTemplate/Asset/DocumentTemplateAssetDTO.hs | haskell | module Wizard.Api.Resource.DocumentTemplate.Asset.DocumentTemplateAssetDTO where
import Data.Time
import qualified Data.UUID as U
import GHC.Generics
import GHC.Int
data DocumentTemplateAssetDTO = DocumentTemplateAssetDTO
{ uuid :: U.UUID
, fileName :: String
, contentType :: String
, fileSize :: Int64
, ur... | |
b58647e1a23c0a7cd8ff8e43a3ffdcffc62e8d0e74556a917db8fee3a54f468c | katcipis/sicp | damp-test.rkt | #lang racket
(require rackunit
"damp.rkt")
(define (square x) (* x x))
(check-equal? (square 2) 4 "SimpleSquare")
(check-equal? (avgdamp square 2) 3 "DampenedSquare")
(check-equal? (avgdamp square 0) 0 "DampenedZeroSquare")
(check-equal? (sin 1) 0.8414709848078965 "Sin")
(check-equal? (avgdamp sin 1) 0.92073... | null | https://raw.githubusercontent.com/katcipis/sicp/d365de58e106d54f83d0ca236ea5ea666253da89/sqrt/damp-test.rkt | racket | #lang racket
(require rackunit
"damp.rkt")
(define (square x) (* x x))
(check-equal? (square 2) 4 "SimpleSquare")
(check-equal? (avgdamp square 2) 3 "DampenedSquare")
(check-equal? (avgdamp square 0) 0 "DampenedZeroSquare")
(check-equal? (sin 1) 0.8414709848078965 "Sin")
(check-equal? (avgdamp sin 1) 0.92073... | |
289e1aa83e653404e1f9f2cfac0bd2fd2cf7b60764547e612e34b36a8d344e3a | cloojure/tupelo | project.clj | (defproject tupelo "23.02.29a"
:description "Tupelo: Clojure With A Spoonful of Honey"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.9.5"
:global-vars {*warn-on-reflection* false}
:excludes [org.clojure/clojure
org.clojure/clojurescript]
:deplo... | null | https://raw.githubusercontent.com/cloojure/tupelo/9776b76421611b7b3274ca317b3429b83f05d710/project.clj | clojure | [org.clojure/clojure "1.11.1"]
Using `lein-ancient check :all` checks plugins
true => suppress printing namespaces when testing
[org.clojure/clojure "1.11.1"]
[org.clojure/clojurescript "1.10.764"] ; "1.10.597"
need to add the compliled assets to the :clean-targets
:main ^:skip-aot tupelo.core
:repl-options {:n... | (defproject tupelo "23.02.29a"
:description "Tupelo: Clojure With A Spoonful of Honey"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.9.5"
:global-vars {*warn-on-reflection* false}
:excludes [org.clojure/clojure
org.clojure/clojurescript]
:deplo... |
3ff9eca08f054a16a7a4fa4ab30b92a561ca25ee5f44f018e60432e8f625ab64 | nikita-volkov/rebase | Lazy.hs | module Rebase.Data.HashMap.Lazy
(
module Data.HashMap.Lazy
)
where
import Data.HashMap.Lazy
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Data/HashMap/Lazy.hs | haskell | module Rebase.Data.HashMap.Lazy
(
module Data.HashMap.Lazy
)
where
import Data.HashMap.Lazy
| |
11becd93367254c30ee318384e04d7d95db634a6f4f5f87507e4f3f7107777a8 | sneeuwballen/zipperposition | phases.mli |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Phases of the Prover }
To process a file , the prover goes through a sequence of phases that
are used to build values . This module reifies the phases .
To process a file, the prover goes through a ... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/333c4a5b0f8a726f414db901a77ca30921178da5/src/prover_phases/phases.mli | ocaml | global setup
parse CLI options: get a list of files to process, and parameters
file to process
parse some file
compute orderign and selection function
* A phase hidden in an existential type
* Monad type, representing an action starting at phase ['p1]
and stopping at phase ['p2]
* Return a value into th... |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Phases of the Prover }
To process a file , the prover goes through a sequence of phases that
are used to build values . This module reifies the phases .
To process a file, the prover goes through a ... |
0ae6faf0020eb3493b548d09a492aee7d0e1cca3fa2c997504968310aea3096b | camfort/camfort | Types.hs | |
Module : Camfort . Specification . Units . . Types
Description : Defines the representation of unit specifications resulting from parsing .
Copyright : ( c ) 2017 , , , , : Apache-2.0
Maintainer :
Stability : experimental
Module : Camfort.Specification.U... | null | https://raw.githubusercontent.com/camfort/camfort/3421e85f6fbbcaa6503a266b3fae029a09d2ff24/src/Camfort/Specification/Units/Parser/Types.hs | haskell | # LANGUAGE DeriveDataTypeable # | |
Module : Camfort . Specification . Units . . Types
Description : Defines the representation of unit specifications resulting from parsing .
Copyright : ( c ) 2017 , , , , : Apache-2.0
Maintainer :
Stability : experimental
Module : Camfort.Specification.U... |
6812fe6bb7f65893c935780d3bdb91a15df51eef50cc0d5c15aa5125ce6b365c | Helium4Haskell/helium | UnifierFunctionBinding.hs | test True = "hello"
test 3 = "world"
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/typeerrors/Heuristics/UnifierFunctionBinding.hs | haskell | test True = "hello"
test 3 = "world"
| |
cb736989aa5fc1e047ba8a5ececb59a00127d611147718d5ecfc35e5be1e546f | purescript/purescript | TestPrimDocs.hs | module TestPrimDocs where
import Prelude
import Data.List (sort)
import Control.Exception (evaluate)
import Control.DeepSeq (force)
import qualified Data.Map as Map
import qualified Data.Text as Text
import qualified Language.PureScript as P
import qualified Language.PureScript.Docs as D
import Test.Hspec
spec :: S... | null | https://raw.githubusercontent.com/purescript/purescript/24eeeb216e73921d8457a641eddba39a0b49b22e/tests/TestPrimDocs.hs | haskell | module TestPrimDocs where
import Prelude
import Data.List (sort)
import Control.Exception (evaluate)
import Control.DeepSeq (force)
import qualified Data.Map as Map
import qualified Data.Text as Text
import qualified Language.PureScript as P
import qualified Language.PureScript.Docs as D
import Test.Hspec
spec :: S... | |
9a0eb0dcd07b3addba740d6b7fe4c2a5b465245809c95bab6b5529bd28c480ed | zliu41/min-max-pqueue | SeqQueue.hs | # LANGUAGE TupleSections #
-----------------------------------------------------------------------------
-- | A min-max priority queue implemented using a min-max heap
-- backed by a 'Seq', for benchmarking purposes.
module SeqQueue (fromList, pollMin) where
import qualified Data.Foldable as Foldable
import ... | null | https://raw.githubusercontent.com/zliu41/min-max-pqueue/62fefaf495334a3238787980eb1e463b3bfb8be2/benchmark/SeqQueue.hs | haskell | ---------------------------------------------------------------------------
| A min-max priority queue implemented using a min-max heap
backed by a 'Seq', for benchmarking purposes. | # LANGUAGE TupleSections #
module SeqQueue (fromList, pollMin) where
import qualified Data.Foldable as Foldable
import Data.Maybe (catMaybes, fromJust)
import qualified Data.Sequence as Seq
import Data.Sequence (Seq, (|>), ViewL((:<)), ViewR((:>)))
import Math.NumberTheory.Logarithms (in... |
724f206c8626c0527a73380940f06f3748c835f02dca084bc160ccc2c1e601f5 | chrismurrph/show-graph | ham_test.clj | (ns graph.layout.ham-test
(:require
[au.com.seasoft.graph.layout.ham :as ham]
[clojure.test :refer :all]
[au.com.seasoft.graph.example-data :as example-data])
(:import (au.com.seasoft.ham InteropEdge InteropNode)))
(deftest interop-node-id
(let [^InteropNode node (ham/node->interop-node 1)]
(is (... | null | https://raw.githubusercontent.com/chrismurrph/show-graph/b77e2e4222a97998bd147036e26671abd515679b/src/test/graph/layout/ham_test.clj | clojure | (ns graph.layout.ham-test
(:require
[au.com.seasoft.graph.layout.ham :as ham]
[clojure.test :refer :all]
[au.com.seasoft.graph.example-data :as example-data])
(:import (au.com.seasoft.ham InteropEdge InteropNode)))
(deftest interop-node-id
(let [^InteropNode node (ham/node->interop-node 1)]
(is (... | |
b37185b71a9aea93e374a2bffbc087b40551bd0b716659b7de116e11026fb5a7 | mentat-collective/sicm-scheme-exercises | ex1-36.scm | Exercise 1.36 : Noether integral
;; :PROPERTIES:
;; :header-args+: :tangle ch1/ex1-36.scm :comments org
;; :END:
(load "ch1/utils.scm")
| null | https://raw.githubusercontent.com/mentat-collective/sicm-scheme-exercises/323300c252641add067f266e23427afd0bb34d8a/ch1/ex1-36.scm | scheme | :PROPERTIES:
:header-args+: :tangle ch1/ex1-36.scm :comments org
:END: | Exercise 1.36 : Noether integral
(load "ch1/utils.scm")
|
742e86f264884a84badabd9b73f888e4060c8db8dd51c765b6d6904343847ae3 | MinaProtocol/mina | zkapps.ml | open Core
open Async
open Integration_test_lib
open Mina_base
module Make (Inputs : Intf.Test.Inputs_intf) = struct
open Inputs
open Engine
open Dsl
open Test_common.Make (Inputs)
type network = Network.t
type node = Network.Node.t
type dsl = Dsl.t
let config =
let open Test_config in
{ de... | null | https://raw.githubusercontent.com/MinaProtocol/mina/9a97ea71909a802f2ade0305a8069f7cbace5619/src/app/test_executive/zkapps.ml | ocaml | Call [f] [n] times in sequence
TODO: capture snark worker processes' failures
construct a Zkapp_command.t, similar to zkapp_test_transaction create-zkapp-account
construct a Zkapp_command.t, similar to zkapp_test_transaction update-permissions
timing can't be updated for an existing account
lower fee than mi... | open Core
open Async
open Integration_test_lib
open Mina_base
module Make (Inputs : Intf.Test.Inputs_intf) = struct
open Inputs
open Engine
open Dsl
open Test_common.Make (Inputs)
type network = Network.t
type node = Network.Node.t
type dsl = Dsl.t
let config =
let open Test_config in
{ de... |
5ee6203f623e92c9f78a3b27059d32cecf27d39c89e2b4c8b02f6cb68eaa1355 | clj-commons/rewrite-clj | remove.clj | ;; DO NOT EDIT FILE, automatically generated from: ./template/rewrite_clj/zip/remove.clj
(ns ^:no-doc rewrite-clj.zip.remove
"This ns exists to preserve compatability for rewrite-clj v0 clj users who were using an internal API.
This ns does not work for cljs due to namespace collisions."
(:refer-clojure :exclude... | null | https://raw.githubusercontent.com/clj-commons/rewrite-clj/6d1ebb0dbed7fb1a1e1109e1957d6f3996e190dd/src/rewrite_clj/zip/remove.clj | clojure | DO NOT EDIT FILE, automatically generated from: ./template/rewrite_clj/zip/remove.clj
DO NOT EDIT FILE, automatically imported from: rewrite-clj.zip.removez
DO NOT EDIT FILE, automatically imported from: rewrite-clj.zip.removez | (ns ^:no-doc rewrite-clj.zip.remove
"This ns exists to preserve compatability for rewrite-clj v0 clj users who were using an internal API.
This ns does not work for cljs due to namespace collisions."
(:refer-clojure :exclude [remove])
(:require [rewrite-clj.zip.removez]))
(set! *warn-on-reflection* true)
(d... |
2635ce351de69e23f9e04f3295475d55d6662902f36d388909489bdea2cdd724 | simingwang/emqx-plugin-kafkav5 | zip.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2006 - 2021 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/stdlib-3.17.1/src/zip.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2006 - 2021 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(zip).
-export([unzip/1, unzip/2, extract/1, extract/2,
zip/2, zip/3, create/2, create/3, foldl/3,
list_d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.