_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 |
|---|---|---|---|---|---|---|---|---|
5f6f1313db6adfc3b133fa98a781cc4b4dd5656813afb2c45bbc04e0f854f31e | zack-bitcoin/amoveo | potential_block.erl | -module(potential_block).
-behaviour(gen_server).
-export([start_link/0,code_change/3,handle_call/3,handle_cast/2,handle_info/2,init/1,terminate/2]).
%This module keeps track of what might become the next block of the blockchain, if you are mining or running a mining pool.
-export([new/0, read/0, save/0, dump/0, check/... | null | https://raw.githubusercontent.com/zack-bitcoin/amoveo/a487c1af726cb0acc17dfec67bc7d44b322f0f37/apps/amoveo_core/src/consensus/chain/potential_block.erl | erlang | This module keeps track of what might become the next block of the blockchain, if you are mining or running a mining pool.
, save/2
-define(potential_block, "data/potential_blocks.db").
how often we check if there are new txs that can be included in the block . in seconds
Top = headers:top_with_block(),
pool_co... | -module(potential_block).
-behaviour(gen_server).
-export([start_link/0,code_change/3,handle_call/3,handle_cast/2,handle_info/2,init/1,terminate/2]).
-export([new/0, read/0, save/0, dump/0, check/0
]).
-include("../../records.hrl").
-record(pb, {block, time}).
init(ok) ->
process_flag(trap_exit, true),
Z = #p... |
57bf5451381853b79ad04dd943bc8c50cb7e6a9b26ddbf9acd07f0612a1622bf | robert-strandh/Gsharp | melody.lisp | (cl:in-package #:gsharp-buffer)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Clef
;;; The line number on which the clef is located on the staff.
The bottom line of the staff is number 1 .
(defgeneric lineno (clef))
;;; for key signature drawing calcluations. FIXME: in fact the layout
;;; o... | null | https://raw.githubusercontent.com/robert-strandh/Gsharp/20b4a30ebf1e211bf421563278d425b3b06607e9/melody.lisp | lisp |
Clef
The line number on which the clef is located on the staff.
for key signature drawing calcluations. FIXME: in fact the layout
of key signatures isn't the same across all clefs.
the note number of the bottom line of this clef.
given a clef, return the staff step of the B that should have
Note
or the p... | (cl:in-package #:gsharp-buffer)
The bottom line of the staff is number 1 .
(defgeneric lineno (clef))
(defgeneric b-position (clef))
(defgeneric f-position (clef))
(defgeneric bottom-line (clef))
(defclass clef (staffwise-element gsharp-object name-mixin)
((lineno :reader lineno :initarg :lineno
:ty... |
a3f3840f63c06ca7bc9ede2a56688d7b863b38a2ab665f3500096a2a211bf282 | kmi/irs | saved-new.lisp | Mode : Lisp ; Package :
Author :
The Open University
(in-package "OCML")
(in-ontology organization-ontology)
(def-class network-based-organization (organization))
(def-class voluntary-organization (non-profit-organization))
(def-class government-organization (organization))
(def-class employer-lead-org... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/ontologies/domains/organization-ontology/saved-new.lisp | lisp | Package : |
Author :
The Open University
(in-package "OCML")
(in-ontology organization-ontology)
(def-class network-based-organization (organization))
(def-class voluntary-organization (non-profit-organization))
(def-class government-organization (organization))
(def-class employer-lead-organization (profit-organizat... |
c3595fd6e1726ea91a46f6dd2811741e9993e1536c33be4df4138656d596ae2e | originrose/cortex | cuda_train_test.clj | (ns ^:gpu cortex.compute.nn.cuda-train-test
(:require [clojure.test :refer :all]
[cortex.verify.nn.train :as verify-train]
[cortex.compute.verify.utils :refer [def-double-float-test] :as verify-utils]
[cortex.nn.execute :as ce]))
(use-fixtures :each verify-utils/test-wrapper)
(de... | null | https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/test/clj/cortex/compute/nn/cuda_train_test.clj | clojure | (ns ^:gpu cortex.compute.nn.cuda-train-test
(:require [clojure.test :refer :all]
[cortex.verify.nn.train :as verify-train]
[cortex.compute.verify.utils :refer [def-double-float-test] :as verify-utils]
[cortex.nn.execute :as ce]))
(use-fixtures :each verify-utils/test-wrapper)
(de... | |
62a4e0fab075ddaf273518ca4bc15c86745648408d3c030b62cf5ca8e02be96f | well-typed-lightbulbs/ocaml-esp32 | client.ml | let () = Static.f Abstract.x
| null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/lib-dynlink-pr4229/client.ml | ocaml | let () = Static.f Abstract.x
| |
731876b87af7d81eff6dc67ca9434a5078d71d7cf67637afabfb63a2c0d2106a | klutometis/clrs | 16.1-2.scm | (require-extension syntax-case check (srfi 11))
(require '../16.1/section)
(import section-16.1)
(let* ((activities '((0 . 0)
(1 . 4)
(3 . 5)
(0 . 6)
(5 . 7)
(3 . 8)
(5 . 9)
... | null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/16.1/16.1-2.scm | scheme | Defective null case (0 . 0)
The same greedy and optimality arguments for earliest-first apply
to latest-first, since latest-first is symmetrical to earliest-
first; and relies merely upon the reversal of time. | (require-extension syntax-case check (srfi 11))
(require '../16.1/section)
(import section-16.1)
(let* ((activities '((0 . 0)
(1 . 4)
(3 . 5)
(0 . 6)
(5 . 7)
(3 . 8)
(5 . 9)
... |
2c04241358722f243faef99a0e34d00d16f0ca496b88de24496920c4c5e34089 | amuletml/amulet | Desugar.hs | # LANGUAGE FlexibleContexts , ScopedTypeVariables , OverloadedStrings , TypeFamilies #
{- | The desugar process is run before the type checker in order to
simplify the number of cases it needs to handle.
* Replace sections and tuple sections with a lambda (or function
symbol).
* Removes 'Parens' ... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Syntax/Desugar.hs | haskell | | The desugar process is run before the type checker in order to
simplify the number of cases it needs to handle.
* Replace sections and tuple sections with a lambda (or function
symbol).
* Removes 'Parens' and 'OpenIn' (these are only required by the
resolver).
* Replace @\@\@@ with... | # LANGUAGE FlexibleContexts , ScopedTypeVariables , OverloadedStrings , TypeFamilies #
module Syntax.Desugar (desugarProgram) where
import Control.Monad.Namey
import Data.Text (Text)
import Data.Bifunctor
import Data.Foldable
import Data.Spanned
import Syntax.Builtin
import Syntax.Var
import Syntax
| a program ... |
68b97377cbeb23af434deb619707d34089eb67c94c33cdac0f2015d9c1c4d3f1 | RedPRL/redtt | Diagnostics.mli | val on_termination : (unit -> unit) -> unit
val terminated : unit -> unit
| null | https://raw.githubusercontent.com/RedPRL/redtt/50689559ff970e33013b8cf8a3bbc8be18ec4e09/src/core/Diagnostics.mli | ocaml | val on_termination : (unit -> unit) -> unit
val terminated : unit -> unit
| |
a53f93d6d027eeb17ce3b2d477ff8a1e60d06d8883516c245d2d4a3a9f56a1a6 | dangning602/emqx_mysql_plugin | buildrun_emqx_backend_mysql_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 Buildrun Technologies Co. , Ltd. 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 ... | null | https://raw.githubusercontent.com/dangning602/emqx_mysql_plugin/de19ae279afccfa6b41e5b0f3b38fbc17403b8a3/test/buildrun_emqx_backend_mysql_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 Buildrun Technologies Co. , Ltd. 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(buildrun_emqx_backend_mysql_SUITE).
-compile(export_all).
all() -> [].
groups() -> [].
|
d4a13f890be96a51bf5acd9a3dc8b1475adcd7cc8e79612f1073b2d24c3078db | tsloughter/kuberl | kuberl_autoscaling_v2beta1_api.erl | -module(kuberl_autoscaling_v2beta1_api).
-export([create_namespaced_horizontal_pod_autoscaler/3, create_namespaced_horizontal_pod_autoscaler/4,
delete_collection_namespaced_horizontal_pod_autoscaler/2, delete_collection_namespaced_horizontal_pod_autoscaler/3,
delete_namespaced_horizontal_pod_autoscal... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_autoscaling_v2beta1_api.erl | erlang | @doc
create a HorizontalPodAutoscaler
@doc
delete collection of HorizontalPodAutoscaler
@doc
delete a HorizontalPodAutoscaler
@doc
get available resources
@doc
list or watch objects of kind HorizontalPodAutoscaler
@doc
list or watch objects of kind HorizontalPodAutoscaler
@doc
partially update the ... | -module(kuberl_autoscaling_v2beta1_api).
-export([create_namespaced_horizontal_pod_autoscaler/3, create_namespaced_horizontal_pod_autoscaler/4,
delete_collection_namespaced_horizontal_pod_autoscaler/2, delete_collection_namespaced_horizontal_pod_autoscaler/3,
delete_namespaced_horizontal_pod_autoscal... |
3c4c23a793ddddb579138e9118ed3a981b33a15b2dd1f82bba1fe7d656df7c26 | mauricioszabo/generic-lsp | datatip.cljs | (ns generic-lsp.datatip
(:require [promesa.core :as p]
[clojure.string :as str]
[generic-lsp.commands :as cmds]))
(defonce service (atom nil))
(defn- datatip [^js editor position]
(p/let [results (cmds/hover! editor)]
(when results
(clj->js {:markedStrings (map (fn [{:keys [type ... | null | https://raw.githubusercontent.com/mauricioszabo/generic-lsp/246d754bbfbcc442f3f00b2a7780c8431b4c18a6/src/generic_lsp/datatip.cljs | clojure | (ns generic-lsp.datatip
(:require [promesa.core :as p]
[clojure.string :as str]
[generic-lsp.commands :as cmds]))
(defonce service (atom nil))
(defn- datatip [^js editor position]
(p/let [results (cmds/hover! editor)]
(when results
(clj->js {:markedStrings (map (fn [{:keys [type ... | |
7a16209d1270d475cb612fcaf799e5a15f7b90cc10cef772bb3dd496fab513aa | facundoolano/advenjure | dialogs.cljc | (ns advenjure.dialogs
#?(:cljs (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
(:require #?(:clj [clojure.core.async :refer [go go-loop <!]]
:cljs [cljs.core.async :refer [<!]])
#?(:cljs [goog.string :refer [format]])
#?(:cljs [advenjure.eval :refer [eval]])
... | null | https://raw.githubusercontent.com/facundoolano/advenjure/2f05fdae9439ab8830753cc5ef378be66b7db6ef/src/advenjure/dialogs.cljc | clojure | OPTIONAL DIALOGS
INLINE HELPERS | (ns advenjure.dialogs
#?(:cljs (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
(:require #?(:clj [clojure.core.async :refer [go go-loop <!]]
:cljs [cljs.core.async :refer [<!]])
#?(:cljs [goog.string :refer [format]])
#?(:cljs [advenjure.eval :refer [eval]])
... |
9b9f53cc3d68435bcce87ca4f8ee8595a680ee96fb109b5e561929b538d906b0 | fragnix/fragnix | Network.Wai.Handler.Warp.Settings.hs | # LANGUAGE Haskell98 #
# LINE 1 " Network / Wai / Handler / Warp / Settings.hs " #
# LANGUAGE OverloadedStrings , ScopedTypeVariables , ViewPatterns #
# LANGUAGE PatternGuards , RankNTypes #
# LANGUAGE ... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/Network.Wai.Handler.Warp.Settings.hs | haskell | | Various Warp server settings. This is purposely kept as an abstract data
type so that new settings can be added without breaking backwards
compatibility. In order to create a 'Settings' value, use 'defaultSettings'
^ Default value: HostIPv4
^ What to do with exceptions thrown by either the application or server... | # LANGUAGE Haskell98 #
# LINE 1 " Network / Wai / Handler / Warp / Settings.hs " #
# LANGUAGE OverloadedStrings , ScopedTypeVariables , ViewPatterns #
# LANGUAGE PatternGuards , RankNTypes #
# LANGUAGE ... |
048cd6b8188421168a730274ca0a5e9565a1425644f4a2f291cd74724d952feb | dbuenzli/logs | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let jsoo = Conf.with_pkg "js_of_ocaml"
let cmdliner = Conf.with_pkg "cmdliner"
let fmt = Conf.with_pkg "fmt"
let lwt = Conf.with_pkg "lwt"
let threads = Conf.with_pkg "base-threads"
let () =
Pkg.describe "logs" @@ fun c ->
let jsoo = Conf.value c jso... | null | https://raw.githubusercontent.com/dbuenzli/logs/4fa6017f8e87f46a174843a1fb3f0e2130d5b0d7/pkg/pkg.ml | ocaml | Pkg.test "test/test_browser.js";
Pkg.test "test/test_browser.html"; | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let jsoo = Conf.with_pkg "js_of_ocaml"
let cmdliner = Conf.with_pkg "cmdliner"
let fmt = Conf.with_pkg "fmt"
let lwt = Conf.with_pkg "lwt"
let threads = Conf.with_pkg "base-threads"
let () =
Pkg.describe "logs" @@ fun c ->
let jsoo = Conf.value c jso... |
68f06714eecdb6f441cc10bdd9c0efad9183e8bcb06c40d32e9a812c6ca22c71 | grin-compiler/ghc-wpc-sample-programs | Helpers.hs | # LANGUAGE CPP #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
|
Module : Tests . Helpers
Copyright : © 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < jgm@berkeley@edu >
Stability : alpha
... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/test/Tests/Helpers.hs | haskell | # LANGUAGE TypeSynonymInstances #
^ function to test
^ name of test case
^ (input, expected value)
avoid wide output
| Find pandoc executable relative to test-pandoc
disable - optimization
disable - optimization
cabalv1
need this to get meta output | # LANGUAGE CPP #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE FlexibleInstances #
|
Module : Tests . Helpers
Copyright : © 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < jgm@berkeley@edu >
Stability : alpha
Portability : portable
Utility fun... |
9fdbdf93e2a111e11baecad889655dc0bc7f5ebf2bcbd4b5efab2d29f3fcdf8b | exoscale/seql | params_test.clj | (ns seql.params-test
(:require [seql.params :as p]
[clojure.spec.alpha :as s]
[clojure.test :refer [deftest testing are]]))
(def abc-schema
{:a {:table :a}
:b {:table :b}
:c {:table :x}})
(defn find-selections
[schema y]
(#'p/find-selections schema (s/conform :seql.query/seql-que... | null | https://raw.githubusercontent.com/exoscale/seql/7142132a5c364baf201936052095589489320e99/test/seql/params_test.clj | clojure | (ns seql.params-test
(:require [seql.params :as p]
[clojure.spec.alpha :as s]
[clojure.test :refer [deftest testing are]]))
(def abc-schema
{:a {:table :a}
:b {:table :b}
:c {:table :x}})
(defn find-selections
[schema y]
(#'p/find-selections schema (s/conform :seql.query/seql-que... | |
1b4f5d89d748b45919f7cba254084ab8d92983d226f16c54a5057eca6a17e154 | jkvor/log_roller | lrb.erl | Copyright ( c ) 2009 < >
%%
%% Permission is hereby granted, free of charge, to any person
%% obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
%% restriction, including without limitation the rights to use,
%% copy, modify, merge, publis... | null | https://raw.githubusercontent.com/jkvor/log_roller/1f072ab74532314f94bdc94dd5a8572d5ceb8d4e/src/lrb.erl | erlang |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the following
condi... | Copyright ( c ) 2009 < >
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
-module(lrb).
-author('').
-... |
b6af3cc61620ed49a7bddebaa96e9375908cf93761e88e78c9350de43a982224 | eval/deps-try | user.clj | (ns user)
(defn test-bound-output []
(.start
(Thread.
(bound-fn []
(dotimes [n 10]
(Thread/sleep 2000)
(println "Testing Bound!!"))))))
(defn test-output []
(.start
(Thread.
(fn []
(dotimes [n 10]
(Thread/sleep 2000)
(println "Testing!!"))))))
(defn compl... | null | https://raw.githubusercontent.com/eval/deps-try/da691c68b527ad5f9e770dbad82cce6cbbe16fb4/vendor/rebel-readline/rebel-readline/dev/user.clj | clojure | (ns user)
(defn test-bound-output []
(.start
(Thread.
(bound-fn []
(dotimes [n 10]
(Thread/sleep 2000)
(println "Testing Bound!!"))))))
(defn test-output []
(.start
(Thread.
(fn []
(dotimes [n 10]
(Thread/sleep 2000)
(println "Testing!!"))))))
(defn compl... | |
5d595236fd88a8c94c54898c51c8d9a16e8e81e2787b4bf759daf6d497040182 | ivanperez-keera/dunai | InternalCore.hs | {-# LANGUAGE Rank2Types #-}
-- |
Copyright : ( c ) and , 2016
-- License : BSD3
Maintainer :
--
-- Monadic Stream Functions are synchronized stream functions with side
-- effects.
--
' MSF 's are defined by a function
@unMSF : : MSF m a b - > a - > m ( b , MSF m a b)@
that executes one step of a sim... | null | https://raw.githubusercontent.com/ivanperez-keera/dunai/9c90202aeac2aa2a344f6eacf6ab549ebd09534e/dunai/src/Data/MonadicStreamFunction/InternalCore.hs | haskell | # LANGUAGE Rank2Types #
|
License : BSD3
Monadic Stream Functions are synchronized stream functions with side
effects.
context, and a continuation to be used for future steps.
Wormholes and other FRP and reactive implementations.
This modules defines only the minimal core. By default, you should import
T... | Copyright : ( c ) and , 2016
Maintainer :
' MSF 's are defined by a function
@unMSF : : MSF m a b - > a - > m ( b , MSF m a b)@
that executes one step of a simulation , and produces an output in a monadic
' MSF 's are a generalisation of the implementation mechanism used by Yampa ,
" Data . Monadic... |
2ac83f0994bc584c6cafc622a330545b67ca64808c7c56c28b07916fa5a0cb72 | ThoughtWorksInc/stonecutter | jwt.clj | (ns stonecutter.jwt
(:require [clojure.tools.logging :as log]
[stonecutter.routes :as routes]
[stonecutter.util.time :as t])
(:import [org.jose4j.jwk JsonWebKey$Factory JsonWebKey$OutputControlLevel RsaJwkGenerator JsonWebKeySet]
[org.jose4j.jws JsonWebSignature AlgorithmIdentifie... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/src/stonecutter/jwt.clj | clojure | (ns stonecutter.jwt
(:require [clojure.tools.logging :as log]
[stonecutter.routes :as routes]
[stonecutter.util.time :as t])
(:import [org.jose4j.jwk JsonWebKey$Factory JsonWebKey$OutputControlLevel RsaJwkGenerator JsonWebKeySet]
[org.jose4j.jws JsonWebSignature AlgorithmIdentifie... | |
5cc4d5a72b7f97d90559418f3e1a02f946098ec2064ecbf01206c37a97e48cab | protosens/monorepo.cljc | string.clj | (ns protosens.string
"Collection of string manipulation utilities."
(:refer-clojure :exclude [newline])
(:require [clojure.string :as string]))
(declare line+
trunc-left)
(set! *warn-on-reflection*
true)
;;;;;;;;;;
(defn count-leading-space
"Returns the number of whitespaces in the giv... | null | https://raw.githubusercontent.com/protosens/monorepo.cljc/1c7cc00cbfb7c7484521146bf998438d2867552f/module/string/src/main/clj/protosens/string.clj | clojure | (ns protosens.string
"Collection of string manipulation utilities."
(:refer-clojure :exclude [newline])
(:require [clojure.string :as string]))
(declare line+
trunc-left)
(set! *warn-on-reflection*
true)
(defn count-leading-space
"Returns the number of whitespaces in the given string.
... | |
9438de695fe9977717ce81c78a2ce6367ae8de81e070d5878a809a3c788784ab | WorksHub/client | events.cljs | (ns wh.company.create-job.events
(:require [camel-snake-kebab.core :as c]
[camel-snake-kebab.extras :as ce]
[clojure.set :as set]
[clojure.string :as str]
[re-frame.core :refer [path reg-event-db reg-event-fx]]
[wh.common.cases :as cases]
[wh.com... | null | https://raw.githubusercontent.com/WorksHub/client/d272a976e4119b056d4c118c884f6940fe00ad80/client/src/wh/company/create_job/events.cljs | clojure | at the top because it might be culled
add + sign to plus value, since we use strings as options
in select fields
default to true
Benefits
Tags
Company | (ns wh.company.create-job.events
(:require [camel-snake-kebab.core :as c]
[camel-snake-kebab.extras :as ce]
[clojure.set :as set]
[clojure.string :as str]
[re-frame.core :refer [path reg-event-db reg-event-fx]]
[wh.common.cases :as cases]
[wh.com... |
7a4b56d75e46c4e4413b23cd009cc990566b6ca6e5e3513d6efc19c97c2b5413 | liamoc/holbert | Prop.hs | # LANGUAGE TupleSections , FlexibleContexts , GADTs , , DeriveGeneric , OverloadedStrings #
module Prop where
import Unification
import qualified StringRep as SR
import Miso.String(MisoString)
import qualified Miso.String as MS
import qualified Terms as T
import GHC.Generics(Generic)
import Data.Aeson (ToJSON,FromJSON... | null | https://raw.githubusercontent.com/liamoc/holbert/2733be72ac99cab4db9a804c097e5e6e3a7c3334/Prop.hs | haskell | below are for presentation only in proofs
built in equality law
bool is if it is flipped
we do no raising because substitutions should only map metavariables to closed terms
A bit disappointing that this can't be cleanly lensified. | # LANGUAGE TupleSections , FlexibleContexts , GADTs , , DeriveGeneric , OverloadedStrings #
module Prop where
import Unification
import qualified StringRep as SR
import Miso.String(MisoString)
import qualified Miso.String as MS
import qualified Terms as T
import GHC.Generics(Generic)
import Data.Aeson (ToJSON,FromJSON... |
a6efa7fa1639f632c64b50d086e2c70be2a6d6ae5131a38f5c1dde2d497202f2 | mvdcamme/meta-tracing-JIT | meta-circ.scm | Utilities .
(begin
;;; Forward referencing
(define env-lookup #f)
(define perform-apply #f)
(define three-d-quote #f)
(define three-d-if #f)
(define three-d-cond #f)
(define three-d-and #f)
(define three-d-or #f)
(define three-d-let #f)
(define three-d-let* #f)
(define three-d-letrec #f)
(define three-d-b... | null | https://raw.githubusercontent.com/mvdcamme/meta-tracing-JIT/640af917e473f3793ab12791dcb2c80f617b8a0d/benchmarks/meta-circ.scm | scheme | Forward referencing
gensym-count : integer
gensym : symbol -> symbol
in case it's a three-d s-expression
tagged-list? : symbol s-exp -> boolean
singlet? : list -> boolean
partition-k :
Definition types.
Expression types.
if
quote
lambda
begin
application
binding
letrec
let
let*
or
and
cond
set!
m... | Utilities .
(begin
(define env-lookup #f)
(define perform-apply #f)
(define three-d-quote #f)
(define three-d-if #f)
(define three-d-cond #f)
(define three-d-and #f)
(define three-d-or #f)
(define three-d-let #f)
(define three-d-let* #f)
(define three-d-letrec #f)
(define three-d-begin #f)
(define three-d-s... |
faaae98ec7f203587b0311a07e9db27108e201676a1048636334338b43fbe60f | pjotrp/guix | engineering.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/engineering.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages engineering)
#:use-module (guix packages)
#:use-module ... |
1a8f2fb325b523b63ea7936cc3c2ed30dfc55d55113fc08e82a15f5010fd75b0 | alexpeits/harg | JSON.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Options.Harg.Sources.JSON
( JSONSource (..),
)
where
import qualified Barbies as B
import qualified Data.Aeson as JSON
import qualified Data.ByteString.Lazy as LBS
import Data.Functor.Comp... | null | https://raw.githubusercontent.com/alexpeits/harg/a5a684ba974a788f97836888e8631199c550a73f/src/Options/Harg/Sources/JSON.hs | haskell | # LANGUAGE DeriveAnyClass #
| Source that enables a parser to read options from a JSON file.
| The result of reading a JSON file. @JSONSourceNotRequired@ is used when
the JSON file as a 'JSON.Value'. | # LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Options.Harg.Sources.JSON
( JSONSource (..),
)
where
import qualified Barbies as B
import qualified Data.Aeson as JSON
import qualified Data.ByteString.Lazy as LBS
import Data.Functor.Compose (Compose (..))
import Data.F... |
3faaa27100026686955fae4367b375670ec78be82c34e04986b8f556297d5dd7 | adomokos/haskell-katas | Ex26_TypesTypeParametersSpec.hs | module Solutions.Ex26_TypesTypeParametersSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
Create a Vector type constractor ,
Data constructor should take in 3 arguments
Type could be displayed and eq
Create a Vector type constractor,
Data constructor should take i... | null | https://raw.githubusercontent.com/adomokos/haskell-katas/be06d23192e6aca4297814455247fc74814ccbf1/test/Solutions/Ex26_TypesTypeParametersSpec.hs | haskell | module Solutions.Ex26_TypesTypeParametersSpec
( spec
) where
import Test.Hspec
main :: IO ()
main = hspec spec
Create a Vector type constractor ,
Data constructor should take in 3 arguments
Type could be displayed and eq
Create a Vector type constractor,
Data constructor should take i... | |
1a478f4b60a12f5d81fb6d0a01cc64402ff1c9d9865b10f238bdca91ac1c3612 | ocaml-ppx/ppx_view | generator_config.mli | (* distribution information *)
type file = {
path : string;
ignored_types : string list;
desc_shortcuts : bool;
}
val files : file list
| null | https://raw.githubusercontent.com/ocaml-ppx/ppx_view/ffc7ecc3aa21af798a315ddd27538333e31080c5/generator/generator_config.mli | ocaml | distribution information |
type file = {
path : string;
ignored_types : string list;
desc_shortcuts : bool;
}
val files : file list
|
d74287835721ff9edcb9360f47355c1a4a9a40176e219217e347b312dff8e8e3 | ilmotta/clojure-ants-simulation | core.clj | (ns demo.core
(:require [demo.ant :as ant]
[demo.domain :as domain]
[demo.ui.core :as ui]
[demo.ui.world :as ui-world])
(:import (javax.swing JPanel))
(:gen-class))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Copyright ( c ) . All rights r... | null | https://raw.githubusercontent.com/ilmotta/clojure-ants-simulation/e1b4d76219bbd030b55e343fbf632e08115f7072/src/demo/core.clj | clojure | ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Public License 1.0 () which can be
found in the file CPL.TXT 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.
World dime... | (ns demo.core
(:require [demo.ant :as ant]
[demo.domain :as domain]
[demo.ui.core :as ui]
[demo.ui.world :as ui-world])
(:import (javax.swing JPanel))
(:gen-class))
Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by th... |
f6811f8535b30ced190b423ee4f37a64aa8629ab841574547102cc03ddc32234 | tfausak/monadoc-5 | UserSpec.hs | module Monadoc.Type.UserSpec where
import Monadoc.Prelude
import Test.Hspec
spec :: Spec
spec = describe "Monadoc.Type.User" <| do
it "needs tests" pending
| null | https://raw.githubusercontent.com/tfausak/monadoc-5/5361dd1870072cf2771857adbe92658118ddaa27/src/test/Monadoc/Type/UserSpec.hs | haskell | module Monadoc.Type.UserSpec where
import Monadoc.Prelude
import Test.Hspec
spec :: Spec
spec = describe "Monadoc.Type.User" <| do
it "needs tests" pending
| |
f67b662ed9959e5e12242f92efdc32117fbd3e405cb491368d95d85bd155573a | BinaryAnalysisPlatform/bap | x86_legacy_bil_type.ml | Copyright ( C ) 2017 ForAllSecure , Inc. - All Rights Reserved .
* Type declarations for BAP .
@author
@author Ivan Jager
*)
open Core_kernel[@@warning "-D"]
(** Addresses are big_ints *)
type addr = Big_int_Z.big_int
(** Support for s-expressions *)
let addr_of_sexp sexp =
String.t_of_sexp sexp |... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/plugins/x86/x86_legacy_bil_type.ml | ocaml | * Addresses are big_ints
* Support for s-expressions
* Labels are program locations that can be jumped to.
* For named labels
* For addresses. Cast REG_type as unsigned when comparing.
* Memory of given index type, element type.
* Array of index type, element type.
* Different forms of casting
* 0-padding wideni... | Copyright ( C ) 2017 ForAllSecure , Inc. - All Rights Reserved .
* Type declarations for BAP .
@author
@author Ivan Jager
*)
open Core_kernel[@@warning "-D"]
type addr = Big_int_Z.big_int
let addr_of_sexp sexp =
String.t_of_sexp sexp |> Big_int_Z.big_int_of_string
let sexp_of_addr bi =
Big_int_Z... |
4495ff82c8baa0a5a3d38f189b2d8ff267ad633121ffbde4bb63ec9865d1ff4d | jarvinet/scheme | list.scm | Structure and Interpretation of Computer Programs , 1st edition
;-------------------------------------------------------------
; Section 3.3.2
; Representing queues
;-------------------------------------------------------------
exercise 3.23
We make a two directional list to support O(1 ) -operations on bo... | null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/bin/test/list.scm | scheme | -------------------------------------------------------------
Section 3.3.2
Representing queues
-------------------------------------------------------------
front and rear of the deque
containing the data and a pointer to both next and previous nodes.
f = front
r = rear
n = next
p = prev
a,b,c... | Structure and Interpretation of Computer Programs , 1st edition
exercise 3.23
We make a two directional list to support O(1 ) -operations on both
The list nodes are represented by triples ( list of three elements )
Deque with one element , ( a ):
with three elements , ( a b c ):
... |
e0c2eb77b69a49ce6fc70d487ae0699a5de546b6559bc14b3dab5605c9539403 | Eventuria/demonstration-gsd | Generic.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NamedFieldPuns #
module Eventuria.GSD.Write.CommandConsumer.Service.Generic where
import Control.Exception
import Eventuria.Commons.Logger.Core
import Eventuria.Libraries.PersistedStreamEngine.Interface.Write.W... | null | https://raw.githubusercontent.com/Eventuria/demonstration-gsd/5c7692b310086bc172d3fd4e1eaf09ae51ea468f/src/Eventuria/GSD/Write/CommandConsumer/Service/Generic.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
module Eventuria.GSD.Write.CommandConsumer.Service.Generic where
import Control.Exception
import Eventuria.Commons.Logger.Core
import Eventuria.Libraries.PersistedStreamEngine.Interface.Write.Writing
import Eventuria.L... |
d70c80e21ce6e8662c258c550b6870c4618c3101c3af5a3a18805160d15f9869 | scalaris-team/scalaris | configure.erl | 2014 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distribut... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/src/configure.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2014 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(configure).
-author('').
-vsn('$Id:$').
-export([is_enable_debug/0,
get_proplist/0,
show_config/0... |
90315eed9fe2cb2ab377b22ac3feacfc83bdc8937c07c93b6ce6ed99cdc51f3b | relferreira/metabase-sparksql-databricks-driver | project.clj | (defproject metabase/sparksql-databricks-driver "1.2.0"
:min-lein-version "2.5.0"
:repositories {"project" "file:repo"}
:dependencies
[
[local/simba-spark-jdbc42 "2.6.22"]
]
only used for the with - drivers stuff ( i.e. tests and REPL )
:aot [metabase.driver.FixedHiveDriver]
:profiles
{:provid... | null | https://raw.githubusercontent.com/relferreira/metabase-sparksql-databricks-driver/226dde39cbfb1901bd9498052950a267917b82ec/project.clj | clojure | (defproject metabase/sparksql-databricks-driver "1.2.0"
:min-lein-version "2.5.0"
:repositories {"project" "file:repo"}
:dependencies
[
[local/simba-spark-jdbc42 "2.6.22"]
]
only used for the with - drivers stuff ( i.e. tests and REPL )
:aot [metabase.driver.FixedHiveDriver]
:profiles
{:provid... | |
fe79c57aa78a87d76db8eee70adee741601b0322f71e64c19dcba56292a6b89d | clojurecademy/clojurecademy | sub_chapter.clj | (ns clojurecademy.dao.sub-chapter
(:require [clojurecademy.dao.db :as db]
[kezban.core :refer :all]))
(defn find-next-sub-chapter-id-by-sub-chapter-id
[t sub-chapter-id]
(when-let [sub-chapter (db/entity-as-of t sub-chapter-id)]
(db/q-as-of t '[:find ?s .
:in $ ?chapter-id ?i... | null | https://raw.githubusercontent.com/clojurecademy/clojurecademy/97dc7f9b91a90a3f30ca5a3de88542c90a50ce01/src/clj/clojurecademy/dao/sub_chapter.clj | clojure | (ns clojurecademy.dao.sub-chapter
(:require [clojurecademy.dao.db :as db]
[kezban.core :refer :all]))
(defn find-next-sub-chapter-id-by-sub-chapter-id
[t sub-chapter-id]
(when-let [sub-chapter (db/entity-as-of t sub-chapter-id)]
(db/q-as-of t '[:find ?s .
:in $ ?chapter-id ?i... | |
3ed89cc6d120e3c49319809ef87a1ba56102905fbead784b8ac2438fead7aad7 | 5HT/ant | ALEnvironment.mli |
open XNum;
open Runtime;
open Unicode.Types;
open Unicode.SymbolTable;
open VM;
open Types;
open Engine;
open Environment;
open ALCoding;
value wrap_env : environment -> partial_value;
value unwrap_env : string -> unknown -> environment;
value decode_env_cmd : string -> unknown -> env_cmd;
value encode_env_cmd : s... | null | https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Markup/ALEnvironment.mli | ocaml | value prim_set_par_shape : unknown -> unknown -> unit;
value prim_get_math_font : unknown -> list unknown -> unit; |
open XNum;
open Runtime;
open Unicode.Types;
open Unicode.SymbolTable;
open VM;
open Types;
open Engine;
open Environment;
open ALCoding;
value wrap_env : environment -> partial_value;
value unwrap_env : string -> unknown -> environment;
value decode_env_cmd : string -> unknown -> env_cmd;
value encode_env_cmd : s... |
c6e19b237245ae17494164125c030d39fdbabe7fcc13ea2664e5a431b2377ad8 | well-typed/large-records | R050.hs | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.PreEval_Nominal.Sized.R050 where
import Data.Proxy
import Common.EmptyClass_Tree_Nominal
... | null | https://raw.githubusercontent.com/well-typed/large-records/c6c2b51af11e90f30822543d7ce4d1cb28cee294/large-records-benchmarks/bench/experiments/Experiment/PreEval_Nominal/Sized/R050.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | # LANGUAGE TypeApplications #
#if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.PreEval_Nominal.Sized.R050 where
import Data.Proxy
import Common.EmptyClass_Tree_Nominal
import Common.HListOfSize.HL050
requiresInstance :: ()
requiresInstance = requireEmptyClass_preEval (Proxy @ExampleFields)
|
e6945b6408bd1ed52ad569986e3db2d18d3ce3b5d32431b7c52e16cac9a1e97f | dreyk/zraft_lib | zraft_quorum_counter.erl | %% -------------------------------------------------------------------
@author < >
Copyright ( c ) 2015 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% ... | null | https://raw.githubusercontent.com/dreyk/zraft_lib/ead65c45df576be3758639e3fe3a46edefdeae1d/src/zraft_quorum_counter.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permission... | @author < >
Copyright ( c ) 2015 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(zraft... |
5d5bdb3284aefacc8fb1c5ddc8370fbffe40be36f8fee54756c370c034ddb0e6 | garrigue/labltk | builtini_GetBitmap.ml | ##ifdef CAMLTK
let cCAMLtoTKbitmap = function
BitmapFile s -> TkToken ("@" ^ s)
| Predefined s -> TkToken s
;;
let cTKtoCAMLbitmap s =
if s = "" then Predefined ""
else if String.get s 0 = '@'
then BitmapFile (String.sub s 1 (String.length s - 1))
else Predefined s
;;
##else
let cCAMLtoTKbitmap : bitmap -> tk... | null | https://raw.githubusercontent.com/garrigue/labltk/c7f50b4faed57f1ac03cb3c9aedc35b10d36bdb6/builtin/builtini_GetBitmap.ml | ocaml | ##ifdef CAMLTK
let cCAMLtoTKbitmap = function
BitmapFile s -> TkToken ("@" ^ s)
| Predefined s -> TkToken s
;;
let cTKtoCAMLbitmap s =
if s = "" then Predefined ""
else if String.get s 0 = '@'
then BitmapFile (String.sub s 1 (String.length s - 1))
else Predefined s
;;
##else
let cCAMLtoTKbitmap : bitmap -> tk... | |
ca11d53176c7eb43b95e935523c3987e0adc5e27eaadc3f122ed0f048be38a91 | VisionsGlobalEmpowerment/webchange | levels.cljs | (ns webchange.logger.levels
(:require
[webchange.utils.list :refer [in-list?]]))
(def current-level (atom :log))
(def levels (atom {:trace 300
:log 400
:warn 500
:error 600}))
(def synonyms {:trace [:group :group-folded :group-end]})
(defn- check-syn... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/eeb2012ad0651f7fff225c135696b5e5876aa409/src/cljs/webchange/logger/levels.cljs | clojure | (ns webchange.logger.levels
(:require
[webchange.utils.list :refer [in-list?]]))
(def current-level (atom :log))
(def levels (atom {:trace 300
:log 400
:warn 500
:error 600}))
(def synonyms {:trace [:group :group-folded :group-end]})
(defn- check-syn... | |
591b9eb2588f0cc7325ef45a1abb61b547c2da3f001c778f0d5829f6e62c7b53 | camfort/fortran-src | Machine.hs | | Machine Fortran LOGICAL values .
compilers usually store LOGICALs as ( they former is tied to the
latter in the specifications ) . To more accurately simulate their behaviour , we
represent them directly as integers , and simply provide a handful of definitions
for using them as booleans .
Fortran com... | null | https://raw.githubusercontent.com/camfort/fortran-src/43058030e2f6f9e5264b923134da0291e7ae807f/src/Language/Fortran/Repr/Value/Scalar/Logical/Machine.hs | haskell | | Machine Fortran LOGICAL values .
compilers usually store LOGICALs as ( they former is tied to the
latter in the specifications ) . To more accurately simulate their behaviour , we
represent them directly as integers , and simply provide a handful of definitions
for using them as booleans .
Fortran com... | |
128ad7efb0fcd1941413b307f1ee50bbb6c6d7b9e1263a665d3e7c758edc9a0d | jarohen/yoyo | project.clj | (defproject {{name}} ""
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/tools.reader "0.9.2"]
[jarohen/embed-nrepl "0.1.2"]
[jaro... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/templates/yoyo-webapp/src/leiningen/new/yoyo_webapp/project.clj | clojure | (defproject {{name}} ""
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/tools.reader "0.9.2"]
[jarohen/embed-nrepl "0.1.2"]
[jaro... | |
3e3681ef4c28cbacf3dbe4ed6b8df6c43cf5f0531d5e2f414e49de67c58710a9 | ninenines/cowboy | proxy_header_SUITE.erl | Copyright ( c ) 2018 , < >
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS A... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/proxy_header_SUITE.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2018 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(proxy_header_SUITE).
-compile(export_all).
-compile(... |
543b301290b1802409d79695e5968164f9f9d6f5f9adee553f063db02d057ec2 | jacekschae/learn-pedestal-course-files | routes.clj | (ns cheffy.routes
(:require [io.pedestal.http.route :as route]))
(defn list-recipes
[request]
{:status 200
:body "list recipes"})
(defn upsert-recipe
[request]
{:status 200
:body "upsert recipes"})
(def routes
(route/expand-routes
#{{:app-name :cheffy :schema :http :host "learnpedestal.com"}
... | null | https://raw.githubusercontent.com/jacekschae/learn-pedestal-course-files/33c62931273d30860e6efeeb9513dc4630c75218/increments/16-system-interceptor/src/main/cheffy/routes.clj | clojure | (ns cheffy.routes
(:require [io.pedestal.http.route :as route]))
(defn list-recipes
[request]
{:status 200
:body "list recipes"})
(defn upsert-recipe
[request]
{:status 200
:body "upsert recipes"})
(def routes
(route/expand-routes
#{{:app-name :cheffy :schema :http :host "learnpedestal.com"}
... | |
60d339c6db266e232504cf41bff5962d886a2e22e509c81ef02f9a429b37b76c | ghc/ghc | Bifunctor.hs | # LANGUAGE CPP #
# LANGUAGE QuantifiedConstraints #
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Bifunctor
Copyright : ( C ) 2008 - 2014 ,
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer :
-- Stability ... | null | https://raw.githubusercontent.com/ghc/ghc/bfd7c1e653c207dd5dea599f16ee4afad03f2ea5/libraries/base/Data/Bifunctor.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
Module : Data.Bifunctor
License : BSD-style (see the file LICENSE)
Maintainer :
Stability : provisional
Portability : portable
-----------------------------------------------------------------------... | # LANGUAGE CPP #
# LANGUAGE QuantifiedConstraints #
Copyright : ( C ) 2008 - 2014 ,
@since 4.8.0.0
module Data.Bifunctor
( Bifunctor(..)
) where
import Control.Applicative ( Const(..) )
import GHC.Generics ( K1(..) )
> > > import Prelude
> > > import Data . ( toUpper )
two type arguments and ... |
fd5bfab7b89972442f7a3505c282536314802c103b279a546bbb7f1b19bb5920 | QuickChick/TestingNoninterference | Timeout.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Timeout where
import Data.Typeable
import Control.Concurrent (myThreadId, forkIO, killThread)
import Control.Concurrent.Thread.Delay ( delay )
import Control.Exception (bracket, throwTo )
import qualified Control.Exception as E ( Exception, handleJust )
-- For other attempt... | null | https://raw.githubusercontent.com/QuickChick/TestingNoninterference/29cc71ec6aa734e84b4087556ddf8d5555cf8819/register/Timeout.hs | haskell | # LANGUAGE DeriveDataTypeable #
For other attempts to do this, and further comments please see:
old-code/tmu/QuickCheckTimeout.hs
Always propagate it!
Return nothing, we will the results from the state |
module Timeout where
import Data.Typeable
import Control.Concurrent (myThreadId, forkIO, killThread)
import Control.Concurrent.Thread.Delay ( delay )
import Control.Exception (bracket, throwTo )
import qualified Control.Exception as E ( Exception, handleJust )
data MyTimeout = MyTimeout Int
deriving (Eq, Typeable... |
4c94ab27ecf887e7d9448834e206789d689d26b4220fcf0072a0132a6996cc67 | grin-compiler/ghc-whole-program-compiler-project | AddrSpec.hs | # LANGUAGE OverloadedStrings , PatternSynonyms , MagicHash , UnboxedTuples , BangPatterns , CPP , ScopedTypeVariables #
module PrimOp.AddrSpec where
import Control.Monad.State.Strict
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Modifiers
import Test.QuickCheck.Monadic
import Stg.Syntax (Name, Typ... | null | https://raw.githubusercontent.com/grin-compiler/ghc-whole-program-compiler-project/3fe5fb0aaebfe8005d44d29357dc53156c8b6537/external-stg-interpreter/test/PrimOp/AddrSpec.hs | haskell | # LANGUAGE OverloadedStrings , PatternSynonyms , MagicHash , UnboxedTuples , BangPatterns , CPP , ScopedTypeVariables #
module PrimOp.AddrSpec where
import Control.Monad.State.Strict
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Modifiers
import Test.QuickCheck.Monadic
import Stg.Syntax (Name, Typ... | |
b0346ce87aa35be3b01768761980ad5c1a4febc0db9bea2734e70673f78b035c | mtgred/netrunner | about.cljs | (ns nr.about
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<!]]
[nr.ajax :refer [GET]]
[nr.appstate :refer [app-state]]
[nr.utils :refer [set-scroll-top store-scroll-top]]
[reagent.core :as r]))
(defn- single-artist [info]
^{:key (:name info)}
[:li [:a... | null | https://raw.githubusercontent.com/mtgred/netrunner/5245a4cbcda4b789addd2b8b9213276422718f23/src/cljs/nr/about.cljs | clojure | (ns nr.about
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
[cljs.core.async :refer [<!]]
[nr.ajax :refer [GET]]
[nr.appstate :refer [app-state]]
[nr.utils :refer [set-scroll-top store-scroll-top]]
[reagent.core :as r]))
(defn- single-artist [info]
^{:key (:name info)}
[:li [:a... | |
54702f4f8acc513779009028d9849e0009acda3eba0af867db6729e3224cf1f7 | keechma/forms | common.cljs | (ns forms.test.common)
(def not-nil? [:not-nil (fn [v path full-data] (not (nil? v)))])
(def not-empty? [:not-empty (fn [v path full-data] (not (empty? v)))])
(def is-one? [:is-one (fn [v path full-data] (= 1 v))])
(def is-twitter? [:is-twitter (fn [v path full-data] (= v "twitter"))])
(def is-facebook? [:is-facebook ... | null | https://raw.githubusercontent.com/keechma/forms/5a9e02b76a4b5efd441f9a71e9831b2161139fdd/test/forms/test/common.cljs | clojure | (ns forms.test.common)
(def not-nil? [:not-nil (fn [v path full-data] (not (nil? v)))])
(def not-empty? [:not-empty (fn [v path full-data] (not (empty? v)))])
(def is-one? [:is-one (fn [v path full-data] (= 1 v))])
(def is-twitter? [:is-twitter (fn [v path full-data] (= v "twitter"))])
(def is-facebook? [:is-facebook ... | |
1191b27eeb14ba433572a5ed66fc7d81d2cd4ff2284b8525f45d3c83af08d2a5 | ivarref/double-trouble | log_init.clj | (ns com.github.ivarref.log-init
(:require [clojure.term.colors :as colors]
[taoensso.timbre :as timbre]
[clojure.string :as str]))
(def level-colors
{;:warn colors/red
:error colors/red})
(def ^:dynamic *override-color* nil)
(defn min-length [n s]
(loop [s s]
(if (>= (count s) n)... | null | https://raw.githubusercontent.com/ivarref/double-trouble/ab84a54ddcba92d597dfda100f84eb69246a4aa6/test/com/github/ivarref/log_init.clj | clojure | :warn colors/red | (ns com.github.ivarref.log-init
(:require [clojure.term.colors :as colors]
[taoensso.timbre :as timbre]
[clojure.string :as str]))
(def level-colors
:error colors/red})
(def ^:dynamic *override-color* nil)
(defn min-length [n s]
(loop [s s]
(if (>= (count s) n)
s
(recur... |
7dc4cb3ea54bcf522e471ed5a0fa47678c5ba6a4f2a49276f583b26e9da6c31a | fpco/ide-backend | Issues.hs | -- Tests for specific issues
# LANGUAGE CPP #
module TestSuite.Tests.Issues (testGroupIssues) where
import Prelude hiding (span, mod)
import Control.Concurrent
import Control.Exception (bracket)
import Control.Monad
import Data.List (isInfixOf)
import Data.Monoid
import System.Exit
import System.FilePath
import System... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/TestSuite/Tests/Issues.hs | haskell | Tests for specific issues
See -backend/issues/301 for why these are disabled.
Compile code and execute
Update the code and execute again
Error message expected, invalid data file
See <>
TODO: Add process ID in OK message
Try to load without enabling -lz. Will fail
FIXME: see -backend/issues/300
assertSomeErro... | # LANGUAGE CPP #
module TestSuite.Tests.Issues (testGroupIssues) where
import Prelude hiding (span, mod)
import Control.Concurrent
import Control.Exception (bracket)
import Control.Monad
import Data.List (isInfixOf)
import Data.Monoid
import System.Exit
import System.FilePath
import System.Process
import System.Timeou... |
5b7ee0d69c82bca180dff3626e5d2abc0facd1febd17583c93011ec282b4f202 | 8c6794b6/guile-tjit | ir.scm | ;;;; Definitions for compiling to IR
Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of the L... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/trace/ir.scm | scheme | Definitions for compiling to IR
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNE... |
Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02110 - 1301 USA
A module containing definiti... |
b1e2d8b1e34cf3d2cc0861b3e51f9c0284eaa509bbf1cec9e8c9b5b13ab3a548 | CloudI/CloudI | cloudi_service_oauth1_SUITE.erl | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
-module(cloudi_service_oauth1_SUITE).
-behaviour(cloudi_service).
cloudi_service callbacks
-export([cloudi_service_init/4,
cloudi_service_handle_request/11,
... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/lib/cloudi_service_oauth1/test_ct/cloudi_service_oauth1_SUITE.erl | erlang | CT callbacks
test callbacks
minutes
milliseconds
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
Callback functions from CT
--------------------... | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
-module(cloudi_service_oauth1_SUITE).
-behaviour(cloudi_service).
cloudi_service callbacks
-export([cloudi_service_init/4,
cloudi_service_handle_request/11,
... |
1285c4f46761211f2ccd34a39c48012d69bf7f115ae010432612649dc13f464d | McCLIM/McCLIM | transforms.lisp | ;;; ---------------------------------------------------------------------------
;;; License: LGPL-2.1+ (See file 'Copyright' for details).
;;; ---------------------------------------------------------------------------
;;;
( c ) copyright 1998 - 2005 < >
( c ) copyright 1998 - 2000 < >
( c ) copyright ... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/d49fef5c2bb1307a006cdadfc4061e0a6b0fff79/Core/geometry/transforms.lisp | lisp | ---------------------------------------------------------------------------
License: LGPL-2.1+ (See file 'Copyright' for details).
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Transformation classes and ... | ( c ) copyright 1998 - 2005 < >
( c ) copyright 1998 - 2000 < >
( c ) copyright 2000,2014 < >
( c ) copyright 2001,2002
( c ) copyright 2018,2019 < >
(in-package #:clim-internals)
The CLIM 2 spec says :
TRANSFORMATION - EQUAL . An appropriate level of ' fuzziness ' is
RECTILINEAR... |
d2358ede3323f8a2ad2dcc8ba018a35b0a16ba019b6a3f3f7192b3fa81ac38a7 | cartazio/tlaps | module.ml |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 32860 $";;
module T = M_t;;
module Fmt = M_fmt;;
module Gen = M_gen;;
module Elab = M_elab;;
module Standard = M_standard;;
module Flatten = M_flatten;;
module Dep = M_dep;;
modu... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/module.ml | ocaml |
* Copyright ( C ) 2011 INRIA and Microsoft Corporation
* Copyright (C) 2011 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 32860 $";;
module T = M_t;;
module Fmt = M_fmt;;
module Gen = M_gen;;
module Elab = M_elab;;
module Standard = M_standard;;
module Flatten = M_flatten;;
module Dep = M_dep;;
modu... | |
052cd10a43e3afc001f3a731e06843ff6844cc6817a795838a6a9b3596767c51 | scalaris-team/scalaris | gossip_load.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2008 - 2015 Zuse Institute Berlin
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
%
% Un... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/src/gossip_load.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language go... | 2008 - 2015 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
The aggregation of load information is used in Scalaris for two purposes :
First , for passive load b... |
560b930e7084cd5e075daaf805abec14bfaa25b96ac6a4f7a0ea1ae2df64465e | joshaber/clojurem | reader_test.cljs | (ns cljs.reader-test
(:require [cljs.reader :as reader]
[goog.object :as o]))
(deftype T [a b])
(defrecord R [a b])
(defn test-reader
[]
(assert (= 1 (reader/read-string "1")))
(assert (= 2 (reader/read-string "#_nope 2")))
(assert (= -1 (reader/read-string "-1")))
(assert (= -1.5 (reader/read... | null | https://raw.githubusercontent.com/joshaber/clojurem/cf60fc6a8ef0e9065a1219c33ca39176ee88c2de/test/cljs/cljs/reader_test.cljs | clojure | queue literals
inst
uuid literals
new tag parsers
Unicode Tests
sample unicode strings, symbols, keywords
thai
yiddish
polish
' and : at the "start"
compound data
unicode error cases
truncated
incorrect code
incorrect code | (ns cljs.reader-test
(:require [cljs.reader :as reader]
[goog.object :as o]))
(deftype T [a b])
(defrecord R [a b])
(defn test-reader
[]
(assert (= 1 (reader/read-string "1")))
(assert (= 2 (reader/read-string "#_nope 2")))
(assert (= -1 (reader/read-string "-1")))
(assert (= -1.5 (reader/read... |
6fab5d386edc08dbf88168cdb46558af454095aa745203835168ec60dd32081e | njordhov/mclide | symbols.lisp | Copyright ( C ) 2007 - 2012 Terje Norderhaug < >
;;;
;;; Bugs-To: <>
;;;
;;; You are hereby granted the rights to distribute and use this
software as governed by the terms of the Lisp Lesser GNU Public
;;; License (), known as the
;;; LLGPL. Other free licenses available upon request.
;;;
;;; This software is di... | null | https://raw.githubusercontent.com/njordhov/mclide/fab77f3b3c856ef211bbaf1158127669759f6fff/mclide/src/swank-client/symbols.lisp | lisp |
Bugs-To: <>
You are hereby granted the rights to distribute and use this
License (), known as the
LLGPL. Other free licenses available upon request.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR ... | Copyright ( C ) 2007 - 2012 Terje Norderhaug < >
software as governed by the terms of the Lisp Lesser GNU Public
(defpackage :swank-client (:use :cl)) |
adf3d3c895aaed894bac85b5a2159056e4aaf0333eb0c53f3f58b0368eebb109 | mbj/stratosphere | AssociationDataProperty.hs | module Stratosphere.Wisdom.AssistantAssociation.AssociationDataProperty (
AssociationDataProperty(..), mkAssociationDataProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratospher... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wisdom/gen/Stratosphere/Wisdom/AssistantAssociation/AssociationDataProperty.hs | haskell | module Stratosphere.Wisdom.AssistantAssociation.AssociationDataProperty (
AssociationDataProperty(..), mkAssociationDataProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratospher... | |
29b229a000658026188ce650f65547207d9a3c8065206e286d44f7bfd5bba58e | anoma/zkp-compiler-shootout | programs.lisp | (in-package :miden)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fibonacci
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; we can't call ourselves recursively is an issue, I'd have to
;; maintain a stack with a loop point!
(defproc fib_rec 0 ... | null | https://raw.githubusercontent.com/anoma/zkp-compiler-shootout/9f68a5baa97320cdef9f668c6ddb38cdc61a0bbe/miden-assembler/src/programs.lisp | lisp |
Fibonacci
we can't call ourselves recursively is an issue, I'd have to
maintain a stack with a loop point!
setup the starting values!
move back our starting value
clean up the pushes, otherwise rust throws a fit
Fibonacci Fixed looping
Sudoku
TODO ∷ Memory isn't continuous like I'd expect, thus Ι have to... | (in-package :miden)
(defproc fib_rec 0 (--))
(-> loop-check-sub (&key (:pos fixnum) (:by fixnum)) instruction)
(defbegin loop-check-sub (&key pos by)
"STACK EFFECT: ( ... a -- a ... a )"
(movup pos) (sub by) (dup) (movdn (1+ pos)))
(defproc fib_iter 0 (iteration-amount -- fib-answer)
(push 0)
(push 1)
(d... |
13abaeaad17847f9a8ec16a8158c509570e8622c2f540ebb6c9ba95e14525a6c | Leystryku/mpbomberman_racket | sv_network_ingame_bomb.rkt | #lang racket
;; import
(require 2htdp/universe)
(require "sv_helper.rkt")
(require "sh_structs.rkt")
(require "sh_config.rkt")
;; export
(provide (all-defined-out))
;; [processLayerLayedBombParseExtraData] processes the extradata for a bomb
(define (processLayerLayedBombParseExtraData currentWorld connection explod... | null | https://raw.githubusercontent.com/Leystryku/mpbomberman_racket/059d95040cfad2e27237f8dd41fc32a4fc698afe/game/sv_network_ingame_bomb.rkt | racket | import
export
[processLayerLayedBombParseExtraData] processes the extradata for a bomb
[processLayerLayedBombParseElement] Creates a new bomb fieldElement
[processPlayerLayedBomb] Processes the laying of a bomb and appends it to our current serverside gameField
[messageIngamePlayerLayedBombSend] Sends the laying ... | #lang racket
(require 2htdp/universe)
(require "sv_helper.rkt")
(require "sh_structs.rkt")
(require "sh_config.rkt")
(provide (all-defined-out))
(define (processLayerLayedBombParseExtraData currentWorld connection explodeWhen)
(extraData-bomb
explodeWhen
#t
0
1
(iworld-name connection)
)
)
... |
8787ff8f9fefbd1b2e093cb1055e834e24ffff6d5abb0f54f4e696d28f805b5a | bmeurer/ocamljit2 | plugin.mli | (***********************************************************************)
(* ocamlbuild *)
(* *)
, , projet Gallium , INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/ocamlbuild/plugin.mli | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
Original author :
val execute_plugin_if_needed :... |
8946cb24a0dcaa2b58805c3ca6ce82f42625e0acc665efaab419de1a11e8e2a5 | well-typed/large-records | Generics_LR.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE IncoherentInstances #-}
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
{-# LANGUAGE ScopedTy... | null | https://raw.githubusercontent.com/well-typed/large-records/551f265845fbe56346988a6b484dca40ef380609/large-records-benchmarks/bench/experiments/Experiment/Generics_LR.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE IncoherentInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
------------------------------------------------------------------------------
Reflect type-level tree to th... | # LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
| Generic instance for HList using... |
2ae672f551eaa745c87d27c7f8842b14137c810c570a0d353526ac4b3fc4b4ab | cedlemo/OCaml-GI-ctypes-bindings-generator | Switch.mli | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Widget.t ptr
val get_active :
t -> bool
val get_state :
t -> bool
val set_active :
t -> bool -> unit
val set_state :
t -> bool -> unit
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Switch.mli | ocaml | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Widget.t ptr
val get_active :
t -> bool
val get_state :
t -> bool
val set_active :
t -> bool -> unit
val set_state :
t -> bool -> unit
| |
602a9e2d49b6c5fb7fca3f2ee276ae3ba7a3e9556740f50bfda28008fad4e2fe | openbadgefactory/salava | routes.cljs | (ns salava.connections.ui.routes
(:require [salava.core.ui.layout :as layout]
[salava.core.i18n :as i18n :refer [t]]
[salava.connections.ui.badge :as b]
[salava.core.ui.helper :refer [base-path]]
[salava.badge.ui.stats :as stats]
[salava.badge.ui.endorsement... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/connections/ui/routes.cljs | clojure | (ns salava.connections.ui.routes
(:require [salava.core.ui.layout :as layout]
[salava.core.i18n :as i18n :refer [t]]
[salava.connections.ui.badge :as b]
[salava.core.ui.helper :refer [base-path]]
[salava.badge.ui.stats :as stats]
[salava.badge.ui.endorsement... | |
79160f592ec5c2a5429d13d13ea4167848d53edf452119dc5e3fcca1fd27e2b5 | erlang-ls/erlang_ls | els_fungraph_SUITE.erl | -module(els_fungraph_SUITE).
-include_lib("eunit/include/eunit.hrl").
-export([all/0]).
-export([dense_graph_traversal/1]).
-spec all() -> [atom()].
all() ->
[dense_graph_traversal].
-spec dense_graph_traversal(_Config) -> ok.
dense_graph_traversal(_) ->
MaxID = 40,
% Visited nodes must be unique
?... | null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/2dfb48aca3879e5b44f6fd676f8349525262779f/apps/els_lsp/test/els_fungraph_SUITE.erl | erlang | Visited nodes must be unique | -module(els_fungraph_SUITE).
-include_lib("eunit/include/eunit.hrl").
-export([all/0]).
-export([dense_graph_traversal/1]).
-spec all() -> [atom()].
all() ->
[dense_graph_traversal].
-spec dense_graph_traversal(_Config) -> ok.
dense_graph_traversal(_) ->
MaxID = 40,
?assertEqual(
lists:reverse(... |
4ae0c677c0ebbb195bd0696a2cb38f01223ee60c040e95cebb32a274ef4d20c0 | LexiFi/menhir | LALRAsFixedPoint.mli | (******************************************************************************)
(* *)
(* *)
... | null | https://raw.githubusercontent.com/LexiFi/menhir/794e64e7997d4d3f91d36dd49aaecc942ea858b7/attic/src/LALRAsFixedPoint.mli | ocaml | ****************************************************************************
file LICEN... |
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU General Public License version 2 , as... |
b64568c245e93ebc51435408b2dac558a882d59ed1dcc35c883102eb2145ff26 | manuel-serrano/bigloo | lexer.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / cigloo / Parser / lexer.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/cigloo/Parser/lexer.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The C lexer */
*===========================... | * serrano / prgm / project / bigloo / cigloo / Parser / lexer.scm * /
* Author : * /
* Creation : Fri Nov 24 11:36:25 1995 * /
* Last change : Sun Sep 7 10:15:25 2014 ( serrano ) * /
(module ... |
b1a0387fa07aefa795efae3e4d67cbf8e859e15066ab95c85235e085b1004a42 | bcc32/projecteuler-ocaml | sol_022.ml | open! Core
open! Import
let letter_score ch = Char.to_int ch - Char.to_int 'A' + 1
let name_score name = String.to_list name |> List.sum (module Int) ~f:letter_score
let main () =
let names =
Problem_022.data |> Parse.csv_line ~f:Fn.id |> List.sort ~compare:String.compare
in
List.mapi names ~f:(fun i name -... | null | https://raw.githubusercontent.com/bcc32/projecteuler-ocaml/712f85902c70adc1ec13dcbbee456c8bfa8450b2/sol/sol_022.ml | ocaml | open! Core
open! Import
let letter_score ch = Char.to_int ch - Char.to_int 'A' + 1
let name_score name = String.to_list name |> List.sum (module Int) ~f:letter_score
let main () =
let names =
Problem_022.data |> Parse.csv_line ~f:Fn.id |> List.sort ~compare:String.compare
in
List.mapi names ~f:(fun i name -... | |
d96ab1c3fce039a009e82a912f065984bfb43a0db33bfa6f3040acc789b3f80f | zkincaid/duet | patools.ml | open Patop
open Srk
include Log.Make(struct let name = "patools" end)
module F = PaFormula
module Smt = PaSmt
let execute cmd f =
let chan = Unix.open_process_in cmd in
ignore (Unix.wait ());
(try
while true do
f (input_line chan)
done
with End_of_file -> ());
close_in chan
let z3 file =
... | null | https://raw.githubusercontent.com/zkincaid/duet/eb3dbfe6c51d5e1a11cb39ab8f70584aaaa309f9/patools/patools.ml | ocaml | open Patop
open Srk
include Log.Make(struct let name = "patools" end)
module F = PaFormula
module Smt = PaSmt
let execute cmd f =
let chan = Unix.open_process_in cmd in
ignore (Unix.wait ());
(try
while true do
f (input_line chan)
done
with End_of_file -> ());
close_in chan
let z3 file =
... | |
d8561f0dfa84442699bf491b4d4d0275eb0f816e6d9788e5e76611b25336e26b | fourmolu/fourmolu | Class.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
-- | Rendering of type class declarations.
module Ormolu.Printer.Meat.Declaration.Class
( p_classDecl,
)
where
import Control.Arrow
import Control.Monad
import Data.Foldable
import Data.Function (on)
import Data.List (sortBy)
... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/9fa78507fcd3b17f4868b30cc1c19e6bda57b6d3/src/Ormolu/Printer/Meat/Declaration/Class.hs | haskell | # LANGUAGE OverloadedStrings #
| Rendering of type class declarations.
# SOURCE #
location order. This happens because different declarations are stored
in different lists. Consequently, to get all the declarations in proper
order, they need to be manually sorted.
Ensure whitespace is added after where clause.
---... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Ormolu.Printer.Meat.Declaration.Class
( p_classDecl,
)
where
import Control.Arrow
import Control.Monad
import Data.Foldable
import Data.Function (on)
import Data.List (sortBy)
import Data.Maybe
import GHC.Hs
import GHC.Types.Fixity
import GHC.Types.Name.... |
d3277f5851ec5b2414b6663c8243ee716444f4cc0ba49e5814c7c8a105bd4718 | jwiegley/notes | foo.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
import Control.Exception (evaluate)
import Control.Monad
import Control.Applicative hiding (empty)
import Data.Attoparsec.ByteString
import Data.Attoparsec.ByteString.Char8 (decimal, endOfLine, char)
import Data.ByteString as B (getContents)
import Data.... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/gists/8663380/foo.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings # |
import Control.Exception (evaluate)
import Control.Monad
import Control.Applicative hiding (empty)
import Data.Attoparsec.ByteString
import Data.Attoparsec.ByteString.Char8 (decimal, endOfLine, char)
import Data.ByteString as B (getContents)
import Data.Vector as V (fromList, length)
main :: IO ()
main = do
conte... |
74bdd485dadcf7104fb701b75df6a516ac2d29ad8d48295619be9a8d39fa4481 | clj-kondo/configs | build.clj | (ns build
(:require
[clojure.edn :as edn]
[clojure.tools.build.api :as b]))
(def project (-> (edn/read-string (slurp "deps.edn"))
:aliases :neil :project))
(def lib (or (:name project) 'my/lib1))
use neil project set version 1.2.0 to update the version in deps.edn
(def version (or (:versio... | null | https://raw.githubusercontent.com/clj-kondo/configs/717e604ac3f91e941ca342af58dcbc6573adc626/configs/rum/rum/build.clj | clojure | (ns build
(:require
[clojure.edn :as edn]
[clojure.tools.build.api :as b]))
(def project (-> (edn/read-string (slurp "deps.edn"))
:aliases :neil :project))
(def lib (or (:name project) 'my/lib1))
use neil project set version 1.2.0 to update the version in deps.edn
(def version (or (:versio... | |
2d9a0f3c9ce957159d7379a7e3d0378548659222811b8f756eeff49be5ca1fff | TheLortex/mirage-monorepo | seq_alias.ml | include Stdlib.Seq
| null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/seq/src/seq_alias.ml | ocaml | include Stdlib.Seq
| |
6177ce911a8a27666505e2ed9008964a9688df7b09eed479e258a0f154d3adf5 | exercism/common-lisp | atbash-cipher-test.lisp | ;; Ensures that atbash-cipher.lisp and the testing library are always loaded
(eval-when (:compile-toplevel :load-toplevel :execute)
(load "atbash-cipher")
(quicklisp-client:quickload :fiveam))
;; Defines the testing package with symbols from atbash-cipher and FiveAM in scope
;; The `run-tests` function is exported... | null | https://raw.githubusercontent.com/exercism/common-lisp/f3cdf6cf7e607138d1bb4d26c57999d4364af243/exercises/practice/atbash-cipher/atbash-cipher-test.lisp | lisp | Ensures that atbash-cipher.lisp and the testing library are always loaded
Defines the testing package with symbols from atbash-cipher and FiveAM in scope
The `run-tests` function is exported for use by both the user and test-runner
Enter the testing package
Define and enter a new FiveAM test-suite | (eval-when (:compile-toplevel :load-toplevel :execute)
(load "atbash-cipher")
(quicklisp-client:quickload :fiveam))
(defpackage :atbash-cipher-test
(:use :cl :fiveam)
(:export :run-tests))
(in-package :atbash-cipher-test)
(def-suite* atbash-cipher-suite)
(test encode-no (is (equal "ml" (atbash-cipher:encode... |
206a071c7eb65dd1043562d440e41d4f45bc47fce3758d3849f4422474495cb6 | Ptival/ocamelf | ELF.ml | open ELF_Identification
open Library
let infer_elfclass (bs: bitstring): ei_class =
bitmatch bs with
| { ei_class : 8 : int, offset(32), bind(read_ei_class ei_class)
} -> ei_class
module type ELFCLASS =
sig
module Identification:
sig
type elf_identification
val read: bitstring -> elf_identificatio... | null | https://raw.githubusercontent.com/Ptival/ocamelf/da5821aef102f3f60e4bd072b9e44b9a5cb6bf1f/src/ELF.ml | ocaml | open ELF_Identification
open Library
let infer_elfclass (bs: bitstring): ei_class =
bitmatch bs with
| { ei_class : 8 : int, offset(32), bind(read_ei_class ei_class)
} -> ei_class
module type ELFCLASS =
sig
module Identification:
sig
type elf_identification
val read: bitstring -> elf_identificatio... | |
3b339cc496293c4b42cbe2e1dccde9baee785b240404e861a1033c16fa94b993 | tsloughter/kuberl | kuberl_v1_node_selector_term.erl | -module(kuberl_v1_node_selector_term).
-export([encode/1]).
-export_type([kuberl_v1_node_selector_term/0]).
-type kuberl_v1_node_selector_term() ::
#{ 'matchExpressions' => list(),
'matchFields' => list()
}.
encode(#{ 'matchExpressions' := MatchExpressions,
'matchFields' := MatchFields
... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_node_selector_term.erl | erlang | -module(kuberl_v1_node_selector_term).
-export([encode/1]).
-export_type([kuberl_v1_node_selector_term/0]).
-type kuberl_v1_node_selector_term() ::
#{ 'matchExpressions' => list(),
'matchFields' => list()
}.
encode(#{ 'matchExpressions' := MatchExpressions,
'matchFields' := MatchFields
... | |
1f275e9a058dde79c24ef107362655a43e4437b00e77e130386149449b64b2eb | ds-wizard/engine-backend | AddCommentSpec.hs | module Wizard.Specs.Websocket.Questionnaire.Detail.AddCommentSpec where
import Data.Aeson
import Network.WebSockets
import Test.Hspec hiding (shouldBe)
import Test.Hspec.Expectations.Pretty
import Shared.Database.DAO.Package.PackageDAO
import Shared.Database.Migration.Development.Package.Data.Packages
import Wizard.A... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/test/Wizard/Specs/Websocket/Questionnaire/Detail/AddCommentSpec.hs | haskell | ----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
GIVEN: Prepare database
AND: Connect to websocket
WHEN:
THEN:
AND: Close sockets
----------------------------------------------------
-----------------... | module Wizard.Specs.Websocket.Questionnaire.Detail.AddCommentSpec where
import Data.Aeson
import Network.WebSockets
import Test.Hspec hiding (shouldBe)
import Test.Hspec.Expectations.Pretty
import Shared.Database.DAO.Package.PackageDAO
import Shared.Database.Migration.Development.Package.Data.Packages
import Wizard.A... |
da1e722d1f2d33e11d9dee698a6d0c9287916b8f8f901254776f36ebb9d1c519 | haskell-opengl/OpenGLRaw | Compatibility32.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.Compatibility32
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
--------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/Compatibility32.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.Compatibility32
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Types
* Enums
* Functions | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.Compatibility32 (
GLbitfield,
GLboolean,
GLbyte,
GLchar,
GLclampd,
GLclampf,
GLdouble,
GLenum,
GLfloat,
GLhalf,
GLint,
GLint64,
GLintptr,
GLshort,
GLsizei,
GLsizeiptr,
GLsync,
G... |
c50d85bfda5d79e4948056cba42b96efbcbdfe8dc3e61f6b5702f67d77fcb97c | gebi/jungerl | ssh_cm.erl | %%% File : ssh_cm.erl
Author : < tony@bulldog >
%%% Description : SSH connection protocol manager
Created : 23 Aug 2004 by < tony@bulldog >
-module(ssh_cm).
-vsn("$Revision$ ").
-rcsid("$Id$\n").
-include("../include/ssh.hrl").
-include("../include/ssh_connect.hrl").
-include("../include/ssh_userauth.... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ssh/src/ssh_cm.erl | erlang | File : ssh_cm.erl
Description : SSH connection protocol manager
"session", "x11", "forwarded-tcpip", "direct-tcpip"
"none", "shell", "exec" "subsystem"
"user" process id (default to cm user)
user want ack packet when data is sent
local channel id
remote channel id
API functions
special ssh distributio... | Author : < tony@bulldog >
Created : 23 Aug 2004 by < tony@bulldog >
-module(ssh_cm).
-vsn("$Revision$ ").
-rcsid("$Id$\n").
-include("../include/ssh.hrl").
-include("../include/ssh_connect.hrl").
-include("../include/ssh_userauth.hrl").
-define(DEFAULT_PACKET_SIZE, 32768).
-define(DEFAULT_WINDOW_SIZE, 2... |
7619079d2adbd0ad938f39fe2e88cbbf7608cd721fb08f739a6781f45aeb95d2 | MinaProtocol/mina | signed_command_payload.ml | (* user_command_payload.ml *)
[%%import "/src/config.mlh"]
open Core_kernel
open Snark_params.Tick
open Signature_lib
module Memo = Signed_command_memo
module Account_nonce = Mina_numbers.Account_nonce
module Global_slot = Mina_numbers.Global_slot
This represents the random oracle input corresponding to the old fo... | null | https://raw.githubusercontent.com/MinaProtocol/mina/2bfe8358b46cfac5486f1f8bfe161729a08f6673/src/lib/mina_base/signed_command_payload.ml | ocaml | user_command_payload.ml
omitting token commands, none were ever created
such omission doesn't affect serialization/Base58Check of payments, delegations
don't need to coerce old transactions to newer version
* This module defines a weight for each payload component |
[%%import "/src/config.mlh"]
open Core_kernel
open Snark_params.Tick
open Signature_lib
module Memo = Signed_command_memo
module Account_nonce = Mina_numbers.Account_nonce
module Global_slot = Mina_numbers.Global_slot
This represents the random oracle input corresponding to the old form of the token
ID , whic... |
f0303910d9409aa0a3dc87bd33505bf18edc9428333bc88723185643c4bd5302 | RedPRL/redtt | Elaborator.mli | module type Import =
sig
val top_load_file : FileRes.filepath -> unit Contextual.m
val top_load_stdin : red : FileRes.filepath -> unit Contextual.m
val import : selector : FileRes.selector -> Contextual.rotted_resolver Contextual.m
end
module type S =
sig
val eval_cmd : ML.mlcmd -> ML.semcmd Contextual.m
end
... | null | https://raw.githubusercontent.com/RedPRL/redtt/50689559ff970e33013b8cf8a3bbc8be18ec4e09/src/frontend/Elaborator.mli | ocaml | module type Import =
sig
val top_load_file : FileRes.filepath -> unit Contextual.m
val top_load_stdin : red : FileRes.filepath -> unit Contextual.m
val import : selector : FileRes.selector -> Contextual.rotted_resolver Contextual.m
end
module type S =
sig
val eval_cmd : ML.mlcmd -> ML.semcmd Contextual.m
end
... | |
7f5ce2e99fcc4d53ff88a2f03c9fea94592c5d7bcb640eeee19de1d2f136c2b9 | minoki/yurumath | Parser.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE DeriveFunctor #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE StandaloneDeriving #
module Text.YuruMath.TeX.Math.Parser
(MMDGlobal(..)
,MMDInline(..)
,MMDDisplay(..)
,readMathMaterial
) where
import Text.YuruMath.TeX.Typ... | null | https://raw.githubusercontent.com/minoki/yurumath/8529390f351654b3ea3157e2852497d0d09e7601/src/Text/YuruMath/TeX/Math/Parser.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
\mathchar or \mathchardef-ed
\delimiter
\displaystyle, \textstyle, etc
\over, \atop, \above<dimen>, ..withdelims<delim><delim>
\Ustack
\mathchoice
`$' or \Ustopmath
`$$' or \Ustopdisplaymath
end of input
other assignments, etc
without expansion
do nothing
end... | # LANGUAGE FlexibleContexts #
# LANGUAGE DeriveFunctor #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
module Text.YuruMath.TeX.Math.Parser
(MMDGlobal(..)
,MMDInline(..)
,MMDDisplay(..)
,readMathMaterial
) where
import Text.YuruMath.TeX.Types
import Text.YuruMath.TeX.Quantity
import Text.YuruMat... |
bfb2c3dd7db5148ad1e22a69d052ebb7b66d79115e656e0039cd13bdb7ce15b0 | glebec/haskell-programming-allen-moronuki | Ex27_14.hs | module Ex27_14 where
Q1 , see StrictList.hs
-- Q2: What will :spring output?
s1 = let x = 1 in x -- 1 (actual: _)
s2 = let x = ['1'] in x -- _ (correct)
s3 = let x = [1] in x -- _ (correct)
s4 = let x = 1 :: Int in x -- 1 (actual: _)
s5 = let f = \x -> x
x = f 1
in x -- 1 (actual: _)
s6 = let f... | null | https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/27-nonstrictness/Ex27_14.hs | haskell | Q2: What will :spring output?
1 (actual: _)
_ (correct)
_ (correct)
1 (actual: _)
1 (actual: _)
1 (actual: _)
Q3: Will printing this expression result in bottom?
no
yes
yes
no
no
no
yes
Q4: Make the expression bottom, only using `seq` or bang pattern(s) | module Ex27_14 where
Q1 , see StrictList.hs
s5 = let f = \x -> x
x = f 1
s6 = let f :: Int -> Int
f = \x -> x
x = f 1
GHC 8.6 . ? seems to thunk everything …
b2 = let x = undefined
y = x `seq` 1
x = undefined
y = x `seq` "blah"
main :: IO ()
main = print (snd ... |
296ac22909b213688f80017094551d97ff323863142be69d52ab7fcfc8198a1a | vonzhou/LearnYouHaskellForGreatGood | Cuboid.hs | module Geometry.Cuboid
( volume
, area
) where
volume :: Float -> Float -> Float -> Float
volume a b c = rectArea a b * c
area :: Float -> Float -> Float -> Float
area a b c = rectArea a b * 2 + rectArea a c * 2 + rectArea c b * 2
rectArea :: Float -> Float -> Float
rectArea a b = a * b
| null | https://raw.githubusercontent.com/vonzhou/LearnYouHaskellForGreatGood/439d848deac53ef6da6df433078b7f1dcf54d18d/chapter6/Geometry/Cuboid.hs | haskell | module Geometry.Cuboid
( volume
, area
) where
volume :: Float -> Float -> Float -> Float
volume a b c = rectArea a b * c
area :: Float -> Float -> Float -> Float
area a b c = rectArea a b * 2 + rectArea a c * 2 + rectArea c b * 2
rectArea :: Float -> Float -> Float
rectArea a b = a * b
| |
d5ed75bf4386549df0e390d50d1929f35eabcd00f378f1cc94d7974a6cf51ee3 | fossas/fossa-cli | SetuptoolsSpec.hs | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.Python.SetuptoolsSpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Python.Setuptools qualified as Setuptools
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (..))
... | null | https://raw.githubusercontent.com/fossas/fossa-cli/e1edac30265888f0252c58598f63b9e475813128/integration-test/Analysis/Python/SetuptoolsSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Analysis.Python.SetuptoolsSpec (spec) where
import Analysis.FixtureExpectationUtils
import Analysis.FixtureUtils
import Path
import Strategy.Python.Setuptools qualified as Setuptools
import Test.Hspec
import Types (DiscoveredProjectType (..), GraphBreadth (..))
... | |
bf8e4e2a649ece000fae66976282acbe43711c8948aeadee1d0229d270d65f0b | padsproj/oforest | utility.mli | * Utility defines a number of global variables and functions mainly used by
Ppx_forest_lib and skins .
Uses Forest_types , , Parsetree , and Ast_helper .
Ppx_forest_lib and skins.
Uses Forest_types, Asttypes, Parsetree, and Ast_helper.
*)
open Forest_types
(** {2 Globals} *)
v... | null | https://raw.githubusercontent.com/padsproj/oforest/e10abf1c35f6d49d4bdf13d51cab44487629b3a3/ppx/utility.mli | ocaml | * {2 Globals}
* [debug] is used for debugging. Some extra debug information is printed when
it it true
* Used for making new forest variables
* {2 AST Functions }
* These functions are all used to make OCaml AST nodes and identifiers of
various types, usually from strings and other AST nodes
* {2 Helper Fu... | * Utility defines a number of global variables and functions mainly used by
Ppx_forest_lib and skins .
Uses Forest_types , , Parsetree , and Ast_helper .
Ppx_forest_lib and skins.
Uses Forest_types, Asttypes, Parsetree, and Ast_helper.
*)
open Forest_types
val debug : bool
... |
3b144b3efa39ddc813147fddbfda035ac81c59b0fe566c952295b5ad87c6c4da | synduce/Synduce | lpeak.ml | type 'a clist = CNil | Single of 'a | Concat of 'a clist * 'a clist
type 'a list = Nil | Cons of 'a * 'a list
let rec lpeak = function
| Nil -> (0, true, 0, 0)
| Cons (hd, tl) ->
let cnt, aux1, aux2, lp = lpeak tl in
let new_cnt = if hd >= 0 then cnt + hd else 0 in
let new_aux = aux1 && hd >= 0 ... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/list/lpeak.ml | ocaml | type 'a clist = CNil | Single of 'a | Concat of 'a clist * 'a clist
type 'a list = Nil | Cons of 'a * 'a list
let rec lpeak = function
| Nil -> (0, true, 0, 0)
| Cons (hd, tl) ->
let cnt, aux1, aux2, lp = lpeak tl in
let new_cnt = if hd >= 0 then cnt + hd else 0 in
let new_aux = aux1 && hd >= 0 ... | |
2cafb4da2c77c8296f74907f1a85cd853aab73665f94cb59ccd6ac456a87c9ff | ChrisPenner/eve | Lib.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
module Lib where
import Eve
import System.IO
import System.Random
import Control.Concurrent
import Control.Lens
import Control.Monad
import Control.Monad.State
import Control.Monad.Trans
import Data.Default
import Data.List
data Timer = Timer
data KeyPress = Ke... | null | https://raw.githubusercontent.com/ChrisPenner/eve/6081b1ff13229b93e5e5a4505fd23aa0a25c96b1/examples/tunnel-crawler/src/Lib.hs | haskell | # LANGUAGE RankNTypes #
A simple tunnel drawing
Replace the char at a position with a new char | # LANGUAGE TemplateHaskell #
module Lib where
import Eve
import System.IO
import System.Random
import Control.Concurrent
import Control.Lens
import Control.Monad
import Control.Monad.State
import Control.Monad.Trans
import Data.Default
import Data.List
data Timer = Timer
data KeyPress = KeyPress Char
data TreasureCol... |
9492b0ed59817783eacc1b6f68762b124fe0c7c9bc9683b2d3b0d41a8fc8a740 | xapi-project/xen-api | perftest.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/50c8a2edfd1c78eb35ec75348738f8ae9ccf5f3e/ocaml/perftest/perftest.ml | ocaml | Performance testing |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
1830269bf0140f52eb2101bd3b5742ddb3633f7969a8d44fe418156992792722 | ocaml-ppx/ppxlib | quoter.mli | * Generate expressions in a hygienic way .
The idea is that whenever we want to refer to an expression in generated
code we first quote it . The result will be an identifier that is guaranteed
to refer to the expression it was created from . This way it is impossible
for quoted fragments to ref... | null | https://raw.githubusercontent.com/ocaml-ppx/ppxlib/1110af2ea18f351cc3f2ccbee8444bb2a4b257b7/src/quoter.mli | ocaml | * Creates a quoter. A quoter guarantees to give names that do not clash with
any other names used before
* [quote t e] returns the expression that is safe to use in place of [e] in
generated code
* [sanitize t e] Returns [e] wrapped with bindings for all quoted expressions
in the quoter [t] | * Generate expressions in a hygienic way .
The idea is that whenever we want to refer to an expression in generated
code we first quote it . The result will be an identifier that is guaranteed
to refer to the expression it was created from . This way it is impossible
for quoted fragments to ref... |
dbc665ec01eef4d546c623954f0c8ee7c890f3a09107e6f67fa31e5e9926262b | mhuebert/maria | kinds.cljs | (ns maria.friendly.kinds)
(defprotocol IDoc
(doc [this] "Return a docstring for type"))
(def kinds
{:maria.kinds/character {:doc "a character: a unit of writing (letter, emoji, and so on)"}
:maria.kinds/false {:doc "false: the Boolean value 'false'"}
:maria.kinds/function {:doc "a function: so... | null | https://raw.githubusercontent.com/mhuebert/maria/15586564796bc9273ace3101b21662d0c66b4d22/friendly/src/maria/friendly/kinds.cljs | clojure | (ns maria.friendly.kinds)
(defprotocol IDoc
(doc [this] "Return a docstring for type"))
(def kinds
{:maria.kinds/character {:doc "a character: a unit of writing (letter, emoji, and so on)"}
:maria.kinds/false {:doc "false: the Boolean value 'false'"}
:maria.kinds/function {:doc "a function: so... | |
5585af64a7270d861d4bd285b37435e01f4106f23ffb8c1d767b5786ea8a5f2e | Chris00/ocaml-rope | bench_rope.ml | open Benchmark
let empty = Rope.empty
let ( ^^ ) = Rope.concat2
let random_string len =
let s = Bytes.create len in
for i = 0 to len - 1 do Bytes.set s i (Char.chr(Random.int 255)) done;
Bytes.unsafe_to_string s
(* Creates the list [[f 0;...; f(len - 1)]] *)
let list_init len f =
let rec build acc i =
if... | null | https://raw.githubusercontent.com/Chris00/ocaml-rope/7d457b2e69a16aede8cfbae43be29f208d007694/bench/bench_rope.ml | ocaml | Creates the list [[f 0;...; f(len - 1)]]
----------------------------------------
size of initial strings
howmany initial strings | open Benchmark
let empty = Rope.empty
let ( ^^ ) = Rope.concat2
let random_string len =
let s = Bytes.create len in
for i = 0 to len - 1 do Bytes.set s i (Char.chr(Random.int 255)) done;
Bytes.unsafe_to_string s
let list_init len f =
let rec build acc i =
if i >= 0 then build (f i :: acc) (i - 1) else ac... |
61beadee56b343342d2082acbaa32588d55bc0acf9f8bb55c8afc63176f78463 | mitar/nxt | MotorControl.hs | |
A message - based control of a NXT brick via remotely executed @MotorControl@ program . The main goal of this approach is to achieve
better precision of motor movements as program monitors and adapts motor commands on the NXT brick itself . For example , common
motor 's overshoot is thus removed in most cases .... | null | https://raw.githubusercontent.com/mitar/nxt/5c811b03308f106e9dbf1055c8c92a860c533ca3/lib/Robotics/NXT/MotorControl.hs | haskell | * Initialization
* Control
* Types
TODO: Implement dynamic/minimal pauses internally.
|
Interface to @CONTROLLED_MOTORCMD@ command which takes care of precise motor movements.
Requires dynamic\/minimal pauses.
|
Interface to @ISMOTORREADY@ command which determine the state of a motor: is it currently executing a ... | |
A message - based control of a NXT brick via remotely executed @MotorControl@ program . The main goal of this approach is to achieve
better precision of motor movements as program monitors and adapts motor commands on the NXT brick itself . For example , common
motor 's overshoot is thus removed in most cases .... |
75f8e18b0bbce2fc66ed08ea364d61eafbd792ace76213d42a826809d5c10626 | braintripping/magic-tree | nav.cljc | (ns magic-tree.nav
(:refer-clojure :exclude [range])
(:require [fast-zip.core :as z]
[magic-tree.node :as n]
[magic-tree.emit :as emit]
[magic-tree.range :as range]))
(defn include-prefix-parents [loc]
(if (emit/prefix-parent? (some-> (z/up loc) (z/node) :tag))
(include-pr... | null | https://raw.githubusercontent.com/braintripping/magic-tree/963f940d1bdcd07e7b5d95af883e75fb1415fa3e/src/magic_tree/nav.cljc | clojure | do we want to avoid 'base'? | (ns magic-tree.nav
(:refer-clojure :exclude [range])
(:require [fast-zip.core :as z]
[magic-tree.node :as n]
[magic-tree.emit :as emit]
[magic-tree.range :as range]))
(defn include-prefix-parents [loc]
(if (emit/prefix-parent? (some-> (z/up loc) (z/node) :tag))
(include-pr... |
dce6332cd23310a73e837e9073cde3cc4038d6267b41e9704c626b080e689e10 | rabbitmq/rabbitmq-management | rabbit_mgmt_wm_bindings.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_mgmt_wm_bindings).
-export([init/... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/543906f01ccd0344aff648f21bb6b5156b2a2ca2/src/rabbit_mgmt_wm_bindings.erl | erlang |
--------------------------------------------------------------------
The current version of Cowboy forces us to report the resource doesn't
resource from the request and the resource that will be created by POST.
#issuecomment-161319576
This clause is called by rabbit_mgmt_cors:handle_options/2
------------------... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_mgmt_wm_bindings).
-export([init/2, to_... |
bf871ccd47bc4bd375c188fa97b739d8447d1bffdc7e9c5e49c46788bc62654b | mfoemmel/erlang-otp | wxDirDialog.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxDirDialog.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxDirDialog).
-include("wxe.hrl")... |
d1904ba864dea8642e656330faef30bfec8607603740abd8d40378181d203b36 | wjrforcyber/SystemT | Tests.hs | # LANGUAGE ScopedTypeVariables #
module Lang.L2.Tests (unitTests, propertyTests) where
import Common.Types
import Data.Maybe
import Lang.L2.Eval
import Lang.L2.Syntax
import Lang.L2.Typecheck
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck as QC
propertyTests :: TestTree
propertyTests = testGr... | null | https://raw.githubusercontent.com/wjrforcyber/SystemT/0b402e5a9a335e28e8a19ba0274f1b8e40c08eaf/tests/Lang/L2/Tests.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Lang.L2.Tests (unitTests, propertyTests) where
import Common.Types
import Data.Maybe
import Lang.L2.Eval
import Lang.L2.Syntax
import Lang.L2.Typecheck
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck as QC
propertyTests :: TestTree
propertyTests = testGr... | |
a1bcc55b666d9b544c3270a43fed636fbf6b3c4f82b0b661237628d27d021d41 | well-typed-lightbulbs/ocaml-esp32 | marshal.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/stdlib/marshal.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1997 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type extern_flags =
No_sharing
| Closures
| Compat_32
external to_channel: out_channel -> 'a -> ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.