_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 |
|---|---|---|---|---|---|---|---|---|
f7ee98b7c556194d641b3605848f78049d116d0355265988c5dd92a978c2bcdc | albertoruiz/easyVision | notracks.hs | import EasyVision
import Data.List
import Data.Function
import Control.Arrow
import Control.Monad
import Vision
import Numeric.LinearAlgebra
import Graphics.UI.GLUT hiding (Size,Point)
import Debug.Trace
import Util.Options
f .***. g = uncurry zip . (f *** g) . unzip
f .&&&. g = virtualCamera (map (id &&& id)) >=> vir... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/old/tracks/notracks.hs | haskell | >>= cornerMonitor "corners"
~~> groupkey
---------------------------------------------------
--------------------------------------------------
--------------------------------------------------
------------------------------------------------
-------------------------------------------------
----------------... | import EasyVision
import Data.List
import Data.Function
import Control.Arrow
import Control.Monad
import Vision
import Numeric.LinearAlgebra
import Graphics.UI.GLUT hiding (Size,Point)
import Debug.Trace
import Util.Options
f .***. g = uncurry zip . (f *** g) . unzip
f .&&&. g = virtualCamera (map (id &&& id)) >=> vir... |
1845889e8cac1d54de5219da459a29b90f600abf469be2c9a50e7170dd636509 | nodew/haskell-dapr | CommonSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Proto.Dapr.CommonSpec where
import Data.ProtoLens (defMessage, showMessage)
import Lens.Micro
import qualified Proto.Dapr.Proto.Common.V1.Common as P
import qualified Proto.Dapr.Proto.Common.V1.Common_Fields as P
import Test.Hspec
spec :: Spe... | null | https://raw.githubusercontent.com/nodew/haskell-dapr/26eaa2e7c04981db3a15da1f9ceef5f3d046f686/dapr-proto/test/Proto/Dapr/CommonSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE ScopedTypeVariables #
module Proto.Dapr.CommonSpec where
import Data.ProtoLens (defMessage, showMessage)
import Lens.Micro
import qualified Proto.Dapr.Proto.Common.V1.Common as P
import qualified Proto.Dapr.Proto.Common.V1.Common_Fields as P
import Test.Hspec
spec :: Spec
spec = do
describe "Dapr Common... |
f389d9ca966e6308c3a45da798f1307b59dd404961e4403822575d8de07fa8b5 | johnwhitington/ocamli | functionapp.ml | let f x = x + 1 in
f (3 + 3)
| null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/newtype/programs/functionapp.ml | ocaml | let f x = x + 1 in
f (3 + 3)
| |
00203bacdd4b991eebb83cc668fe3be8441ec52c34b7b65bd437a236297c787a | hopv/homusat | id.ml | (* Identifiers *)
type t = int
module IdSet = X.Set.Make (struct
type t = int
let compare : t -> t -> int = compare
end)
module IdMap = X.Map.Make (struct
type t = int
let compare : t -> t -> int = compare
end)
module OfStr = X.Map.Make (String)
module ToStr = X.Map.Make (struct
type t = int
... | null | https://raw.githubusercontent.com/hopv/homusat/cc05711a3f9d45b253b83ad09a2d0288115cc4f4/id.ml | ocaml | Identifiers
Generate a fresh identifier from an existing one
Generate a fresh identifier from a string
Get the common identifier of each string |
type t = int
module IdSet = X.Set.Make (struct
type t = int
let compare : t -> t -> int = compare
end)
module IdMap = X.Map.Make (struct
type t = int
let compare : t -> t -> int = compare
end)
module OfStr = X.Map.Make (String)
module ToStr = X.Map.Make (struct
type t = int
let compare : t ->... |
38bf5e50f351eca994941ff8c16ca3c786e3814b33da643aeb06cc5bf82ad319 | OCamlPro/ocp-build | buildScanner.mli | (**************************************************************************)
(* *)
(* Typerex Tools *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/tools/ocp-build/misc/buildScanner.mli | ocaml | ************************************************************************
Typerex Tools
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU General Public License version 3 described in the file
open OcpCompat
exception IgnoreDirectory
val ignore_file_or_directory : unit -> 'a
val scan_directory_for_suffix :
(string -> unit) -> unit
val scan_directory_for_... |
e5e4ff8405ab2b42840a91fac91be468c78bcbe863a806e9b83c7bdabc45561f | jacobhilton/backgammon | equity.ml | open Core
module Setup = struct
type t =
{ player : Player.t
; to_play : Player.t
; board : Board.t
}
end
type t = Setup.t -> float
let create = Fn.id
let eval = Fn.id
let mapi t ~f input = f input (t input)
module Tree = struct
type t =
| Atom of [ `To_play of Player.t ] * Board.t
| L... | null | https://raw.githubusercontent.com/jacobhilton/backgammon/9b5330efa4c8314b8fb7cb6b9b2a428a23d29719/equity.ml | ocaml | open Core
module Setup = struct
type t =
{ player : Player.t
; to_play : Player.t
; board : Board.t
}
end
type t = Setup.t -> float
let create = Fn.id
let eval = Fn.id
let mapi t ~f input = f input (t input)
module Tree = struct
type t =
| Atom of [ `To_play of Player.t ] * Board.t
| L... | |
962b0407e36678f717372db4221de7534add6bee66c8db287c432f32251bd1fe | sky-big/RabbitMQ | rabbit_vhost.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/src/rabbit_vhost.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
4a64907903f92d1ac03d65737ee6110c873f895fcaf274269c2f48d49aa54200 | WhatsApp/eqwalizer | eqwalizer.erl | Copyright ( c ) Meta Platforms , Inc. and affiliates . All rights reserved .
%%%
This source code is licensed under the Apache 2.0 license found in
%%% the LICENSE file in the root directory of this source tree.
-module(eqwalizer).
-compile(warn_missing_spec).
-typing([eqwalizer]).
-export_type([dynamic/0]).
-exp... | null | https://raw.githubusercontent.com/WhatsApp/eqwalizer/8017d486c025eaa5c35ced1481ad5bad0f665efa/eqwalizer_support/src/eqwalizer.erl | erlang |
the LICENSE file in the root directory of this source tree.
This type is intended to help with code being transitioned
from untyped/unchecked mode to gradual mode.
Values of dynamic types slip through
dynamic() is a special type which is a subtype and a supertype of all types.
It is defined as an alias to term()... | Copyright ( c ) Meta Platforms , Inc. and affiliates . All rights reserved .
This source code is licensed under the Apache 2.0 license found in
-module(eqwalizer).
-compile(warn_missing_spec).
-typing([eqwalizer]).
-export_type([dynamic/0]).
-export([dynamic_cast/1, fix_me/1, reveal_type/1]).
the fingers of eq... |
ef5bf93a9c16c3409dfefcef82b313aed2549938c6c70093ca06d7a321839813 | gpwwjr/LISA | tms-support.lisp | This file is part of LISA , the Lisp - based Intelligent Software
;;; Agents platform.
Copyright ( C ) 2000 ( )
;;; 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 versi... | null | https://raw.githubusercontent.com/gpwwjr/LISA/bc7f54b3a9b901d5648d7e9de358e29d3b794c78/src/core/tms-support.lisp | lisp | Agents platform.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 2.1
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FI... | This file is part of LISA , the Lisp - based Intelligent Software
Copyright ( C ) 2000 ( )
of the License , or ( at your option ) any later version .
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 59 T... |
be9c21c34aad440d3b2f833fc51dee88223db872d9ace9460b36aa7c9e60eb2e | puffnfresh/sonic2 | SpriteMappings.hs | module Game.Sega.Sonic.SpriteMappings (
PatternIndex(..)
, SpriteFrame(..)
, SpriteMapping(..)
, DynamicPatternLoadCueFrame(..)
, DynamicPatternLoadCue(..)
, loadMappings
, loadDynamicPatternLoadCues
) where
import Control.Lens
import Data.Bits (shiftR, (.&.))
import qualified Data.Byt... | null | https://raw.githubusercontent.com/puffnfresh/sonic2/0abc3e109a847582c2e16edb13e83e611419fc8a/src/Game/Sega/Sonic/SpriteMappings.hs | haskell | module Game.Sega.Sonic.SpriteMappings (
PatternIndex(..)
, SpriteFrame(..)
, SpriteMapping(..)
, DynamicPatternLoadCueFrame(..)
, DynamicPatternLoadCue(..)
, loadMappings
, loadDynamicPatternLoadCues
) where
import Control.Lens
import Data.Bits (shiftR, (.&.))
import qualified Data.Byt... | |
45c22e20ea8f07cfec0ea09d97c5114c147835050b3444e39c949714ccbdc2e4 | nuvla/api-server | callback_create_user_github.clj | (ns sixsq.nuvla.server.resources.callback-create-user-github
"Creates a new GitHub user resource after external authentication has succeeded."
(:require
[clojure.tools.logging :as log]
[sixsq.nuvla.auth.external :as ex]
[sixsq.nuvla.auth.github :as auth-github]
[sixsq.nuvla.auth.utils.http :as uh]
... | null | https://raw.githubusercontent.com/nuvla/api-server/e4f0535e2e39e5042094fc20bfb811d2a9c75ad5/code/src/sixsq/nuvla/server/resources/callback_create_user_github.clj | clojure | (ns sixsq.nuvla.server.resources.callback-create-user-github
"Creates a new GitHub user resource after external authentication has succeeded."
(:require
[clojure.tools.logging :as log]
[sixsq.nuvla.auth.external :as ex]
[sixsq.nuvla.auth.github :as auth-github]
[sixsq.nuvla.auth.utils.http :as uh]
... | |
671a2c8055bb60efa162f7ed50ff2eaaab1bab4913ebd51e94beaab544fe3e3f | BurntSushi/erd | Spec.hs | module Main
(main)
where
import Test.Erd.Render (testRender)
import Test.Tasty
import Test.Text.Parsec.Erd.Parser (testEr)
main :: IO ()
main = defaultMain $ testGroup "Erd Tests" tests
tests :: [TestTree]
tests = [testEr,
testRender]
| null | https://raw.githubusercontent.com/BurntSushi/erd/06c72643682a42a890a2ffadac82cfc1dafd5edd/test/Spec.hs | haskell | module Main
(main)
where
import Test.Erd.Render (testRender)
import Test.Tasty
import Test.Text.Parsec.Erd.Parser (testEr)
main :: IO ()
main = defaultMain $ testGroup "Erd Tests" tests
tests :: [TestTree]
tests = [testEr,
testRender]
| |
da94c5493b0a931318475064cbb1ec73eab51c7be23a7044cc85437aff09614d | luc-tielen/souffle-dsl | Fixtures.hs |
# LANGUAGE DataKinds , TypeFamilies , DeriveGeneric , DeriveAnyClass #
module Test.Language.Souffle.DSL.Fixtures
( module Test.Language.Souffle.DSL.Fixtures
) where
import GHC.Generics
import Language.Souffle.Class
import Language.Souffle.DSL
data CompiledProgram = CompiledProgram
instance Program CompiledProg... | null | https://raw.githubusercontent.com/luc-tielen/souffle-dsl/b85de30719de2755ea39e9b6c9b96d74db0cf140/tests/Test/Language/Souffle/DSL/Fixtures.hs | haskell |
# LANGUAGE DataKinds , TypeFamilies , DeriveGeneric , DeriveAnyClass #
module Test.Language.Souffle.DSL.Fixtures
( module Test.Language.Souffle.DSL.Fixtures
) where
import GHC.Generics
import Language.Souffle.Class
import Language.Souffle.DSL
data CompiledProgram = CompiledProgram
instance Program CompiledProg... | |
b74230fb3dec452e52c77c2fe50f4bb8f7448ea0826a193790cd52ba90d3b0e1 | mbj/stratosphere | Device.hs | module Stratosphere.SageMaker.Device (
module Exports, Device(..), mkDevice
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SageMaker.Device.DeviceProperty as Exports
import Stratosphere.ResourceProp... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/Device.hs | haskell | # SOURCE # | module Stratosphere.SageMaker.Device (
module Exports, Device(..), mkDevice
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Device
= Devic... |
da678df6572e577f29687c0b17421a0bc51d29abc396f6c256568e79cbaa5a6d | cfelde/ebbs-social-frontend | query.cljs | (ns ebbs-social-frontend.posts.query
(:require [re-frame.core :as rf]
[clojure.string :as str]
[ebbs-social-frontend.misc.utils :as u]))
-- Domino 4 - Query -------------------------------------------------------
(rf/reg-sub
:db
(fn [db [_ & keys]]
(get-in db keys)))
(rf/reg-sub... | null | https://raw.githubusercontent.com/cfelde/ebbs-social-frontend/ad47de958f3e60bbafe0867f3e192981d3acf3d6/src/ebbs_social_frontend/posts/query.cljs | clojure | (ns ebbs-social-frontend.posts.query
(:require [re-frame.core :as rf]
[clojure.string :as str]
[ebbs-social-frontend.misc.utils :as u]))
-- Domino 4 - Query -------------------------------------------------------
(rf/reg-sub
:db
(fn [db [_ & keys]]
(get-in db keys)))
(rf/reg-sub... | |
4eb9a7cec0643de532cfecff6368cf3ac83bc03d65b16539d3fc1fafc226cced | NelosG/fp-tests | T7.hs | module HW1.T7
( DotString (..)
, Fun (..)
, Inclusive (..)
, ListPlus (..)
) where
data ListPlus a =
a :+ ListPlus a
| Last a
infixr 5 :+
instance Semigroup (ListPlus a) where
...
data Inclusive a b =
This a
| That b
| Both a b
instance (Semigroup a, Semigroup b) => Semigroup (Inclu... | null | https://raw.githubusercontent.com/NelosG/fp-tests/f3711e3264f2206c462dd7ceb44cb15202b96fb4/hw1/src/HW1/T7.hs | haskell | module HW1.T7
( DotString (..)
, Fun (..)
, Inclusive (..)
, ListPlus (..)
) where
data ListPlus a =
a :+ ListPlus a
| Last a
infixr 5 :+
instance Semigroup (ListPlus a) where
...
data Inclusive a b =
This a
| That b
| Both a b
instance (Semigroup a, Semigroup b) => Semigroup (Inclu... | |
76b775ca01dc742f22d26af6c955dc06dc1ee335b5f933f124dc32db1413fcb3 | TyOverby/mono | test_css_bonsai_integration.ml | open! Core
open! Bonsai_web
open! Bonsai_web_test
let%expect_test "css censoring" =
let module Style = [%css.raw ".foo {}"] in
let handle =
Handle.create
(Result_spec.vdom Fn.id)
(Bonsai.const (Vdom.Node.div ~attr:(Vdom.Attr.class_ Style.foo) []))
in
Handle.show handle;
[%expect {| <div class... | null | https://raw.githubusercontent.com/TyOverby/mono/7666c0328d194bf9a569fb65babc0486f2aaa40d/vendor/janestreet-ppx_css/web_test/test_css_bonsai_integration.ml | ocaml | open! Core
open! Bonsai_web
open! Bonsai_web_test
let%expect_test "css censoring" =
let module Style = [%css.raw ".foo {}"] in
let handle =
Handle.create
(Result_spec.vdom Fn.id)
(Bonsai.const (Vdom.Node.div ~attr:(Vdom.Attr.class_ Style.foo) []))
in
Handle.show handle;
[%expect {| <div class... | |
8bbce17f267967df51ee6b207b6a13589f021288b81ab210e57b357e0d348540 | albertoruiz/easyVision | st.hs | import Vision.GUI.Simple ( Drawing(Draw), browser, runIt )
import Image.Capture ( readImages )
import Image.Devel
main = do
[img] <- readImages [ "../../data/images/calibration/cube3.png" ]
runIt $ browser "test" [f img, img] (const Draw)
stModifyPix f x p = stRead x p >>= stWrite x p . f
h (Word24 r g b) ... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/examples/st.hs | haskell | import Vision.GUI.Simple ( Drawing(Draw), browser, runIt )
import Image.Capture ( readImages )
import Image.Devel
main = do
[img] <- readImages [ "../../data/images/calibration/cube3.png" ]
runIt $ browser "test" [f img, img] (const Draw)
stModifyPix f x p = stRead x p >>= stWrite x p . f
h (Word24 r g b) ... | |
bd9f178581c21d2284644e6a86fdf95302a9d0c22fb9224664f132da3e2fd265 | mitchellwrosen/riak2 | RiakBucketTypeInternal.hs | module RiakBucketTypeInternal
( BucketType
, defaultBucketType
) where
-- | A bucket type.
--
/Note/ : Must be UTF-8 encoded .
type BucketType
= ByteString
-- | The default bucket type.
defaultBucketType :: BucketType
defaultBucketType =
"default"
| null | https://raw.githubusercontent.com/mitchellwrosen/riak2/d3c4ef4389012c70e72623cdf9a4caec0a07e568/riak2/src/RiakBucketTypeInternal.hs | haskell | | A bucket type.
| The default bucket type. | module RiakBucketTypeInternal
( BucketType
, defaultBucketType
) where
/Note/ : Must be UTF-8 encoded .
type BucketType
= ByteString
defaultBucketType :: BucketType
defaultBucketType =
"default"
|
cf0ad3c2eb2dc6d766a610b025c3e2c6b7f81a65b69d14f416b5ccaec57d958c | albertoruiz/easyVision | Multiview.hs | module Vision.Multiview(
VisualProblem(..),
selectSol,
krms,
loadProblem', loadData', saveData'
) where
import Vision.Types
import Vision.Epipolar
import Vision.Stereo
import Util.Homogeneous
import Numeric.LinearAlgebra
import Vision.IO
data VisualProblem = VP { rawviews :: Projections Uncalibrated
... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/geometry/src/Vision/Multiview.hs | haskell | | points in front of cameras
--------------------------------------------------------------------
| with \"s-\" prefix in the name | module Vision.Multiview(
VisualProblem(..),
selectSol,
krms,
loadProblem', loadData', saveData'
) where
import Vision.Types
import Vision.Epipolar
import Vision.Stereo
import Util.Homogeneous
import Numeric.LinearAlgebra
import Vision.IO
data VisualProblem = VP { rawviews :: Projections Uncalibrated
... |
8531c2e35f906b26597750b2b55cdb554824153a7b3af89f55e767d8547019f1 | fizruk/lambdaconf-2019-workshop | Main.hs | module Main where
import ARCube.Standalone (Mode (..), run)
main :: IO ()
main = run AR
| null | https://raw.githubusercontent.com/fizruk/lambdaconf-2019-workshop/1a7caa4dd03ff1b09877b27d8adf79ca35fcc888/project/ar-cube-client/ar/Main.hs | haskell | module Main where
import ARCube.Standalone (Mode (..), run)
main :: IO ()
main = run AR
| |
f8173838a564421aaab2a72c05e148b5bc583d595d8625b6c20d8491a55f35f6 | thosmos/riverdb | csv.clj | (ns riverdb.import.csv
(:require [clojure.tools.logging :as log :refer [debug info warn error]]
[clojure-csv.core :as csv :refer [write-csv parse-csv]]
[clojure.string :as str :refer [join]]
[io.pedestal.http.route :as route]
[clojure.pprint :refer [pprint]]
... | null | https://raw.githubusercontent.com/thosmos/riverdb/b47f01a938da26298ee7924c8b2b3a2be5371927/src/import/riverdb/import/csv.clj | clojure | csv (rest csv)
_ (println "DAtE" (type (get row (get hidx "Date"))))
(for [[k v] (:params qapp-requirements)]
(let [sample-count (get-in param-config [k :count])]
(let [csv_field (str (name k) "_" i)
csv_idx (get hidx csv_field)]
... | (ns riverdb.import.csv
(:require [clojure.tools.logging :as log :refer [debug info warn error]]
[clojure-csv.core :as csv :refer [write-csv parse-csv]]
[clojure.string :as str :refer [join]]
[io.pedestal.http.route :as route]
[clojure.pprint :refer [pprint]]
... |
bbc20ec46fc7ad5db7572f7e721f54ff5993b05fddc78d91fa8bf77f201edea9 | goldfirere/singletons | Syntax.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
Data / Singletons / TH / Syntax.hs
( c ) 2014
Converts a list of DLetDecs into a LetDecEnv for easier processing ,
and contains various other AST definitions .
(c) Richard Eisenberg 2014
Converts a list of DLetDecs into a LetDecEnv for easier process... | null | https://raw.githubusercontent.com/goldfirere/singletons/58c02cdeab5463d2719425ef8ba3b2f1e8b9e7c2/singletons-th/src/Data/Singletons/TH/Syntax.hs | haskell | from term-level name to type-level name
bring the necessary singleton equality constraints into scope.
See @Note [Singling pattern signatures]@.
The parts of data declarations that are relevant to singletons-th.
The parts of type synonyms that are relevant to singletons-th.
The parts of open type families that ar... | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
Data / Singletons / TH / Syntax.hs
( c ) 2014
Converts a list of DLetDecs into a LetDecEnv for easier processing ,
and contains various other AST definitions .
(c) Richard Eisenberg 2014
Converts a list of DLetDecs into a LetDecEnv for easier process... |
456033e542a47ca5d09009fea1bf3a9ecd68005b8d8c04da821767bf3b50380b | e-bigmoon/haskell-blog | Xml_hamlet3.hs | #!/usr/bin/env stack
-- stack script --resolver lts-16.29
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
import Text.XML
import Text.Hamlet.XML
import Prelude hiding (writeFile)
import Data.Text (Text, pack)
import Data.Map (empty)
data Person = Person
{ personName :: Text
, personAge :: Int
}... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/yesod/appendix/ap5/Xml_hamlet3.hs | haskell | stack script --resolver lts-16.29
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
# LANGUAGE QuasiQuotes #
import Text.XML
import Text.Hamlet.XML
import Prelude hiding (writeFile)
import Data.Text (Text, pack)
import Data.Map (empty)
data Person = Person
{ personName :: Text
, personAge :: Int
}
people :: [Person]
people =
[ Person "Michael" 26
, Person "Mi... |
dd595135b88306820fd797e1f6bab446d9bc49787e6b2e4c22d1dfa13a10f18c | clojure-numerics/expresso | simplify.clj | (ns numeric.expresso.simplify
(:refer-clojure :exclude [== record?])
(:use [clojure.core.logic :exclude [log] :as l]
[numeric.expresso.construct]
[numeric.expresso.impl.polynomial]
[numeric.expresso.properties :as props]
[numeric.expresso.protocols]
[numeric.expresso.impl.pim... | null | https://raw.githubusercontent.com/clojure-numerics/expresso/6905956b759aeff2fce9053910201e2877a2631b/src/main/clojure/numeric/expresso/simplify.clj | clojure | in this namespace are most of expresso's simplification rules defined
It also serves as demonstration of the power of the rule based approach btw.
utility functions for the eval-rules which eval a whole expression if it
contains no undetermined part or evaluates part of it
to read the rule examples
:==> means that the... | (ns numeric.expresso.simplify
(:refer-clojure :exclude [== record?])
(:use [clojure.core.logic :exclude [log] :as l]
[numeric.expresso.construct]
[numeric.expresso.impl.polynomial]
[numeric.expresso.properties :as props]
[numeric.expresso.protocols]
[numeric.expresso.impl.pim... |
a3a5c084e2905f4790951b5630c8a178a016581853f633f5df58925f77946307 | DaMSL/K3 | Test.hs | # LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
{-# LANGUAGE DoAndIfThenElse #-}
module Language.K3.Runtime.Test (tests) where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import qualified Data.HashMap.Lazy as ... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/test/Language/K3/Runtime/Test.hs | haskell | # LANGUAGE DoAndIfThenElse #
TODO: uncomment this stuff and make it compile again
This code has been broken for a while and definitely needs fixed; I've
commented out these unit tests for now to allow the others to work.
( 2013 - 10 - 29 )
Above , NT uses Network . Socket . ByteString.sendMany for its sends .
T... | # LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module Language.K3.Runtime.Test (tests) where
import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import qualified Data.HashMap.Lazy as H
import Data.List
import Data.Ma... |
c4f1f478229d3b8e3d9f0f948af34cb3353fde5c7a9a0eddfb95a6b0c90d4ac8 | BitGameEN/bitgamex | eventsource_app.erl | %% Feel free to use, reuse and abuse the code in this file.
@private
-module(eventsource_app).
-behaviour(application).
%% API.
-export([start/2]).
-export([stop/1]).
%% API.
start(_Type, _Args) ->
Dispatch = cowboy_router:compile([
{'_', [
{"/eventsource", eventsource_handler, []},
{"/", cowboy_static, ... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/cowboy/examples/eventsource/src/eventsource_app.erl | erlang | Feel free to use, reuse and abuse the code in this file.
API.
API. |
@private
-module(eventsource_app).
-behaviour(application).
-export([start/2]).
-export([stop/1]).
start(_Type, _Args) ->
Dispatch = cowboy_router:compile([
{'_', [
{"/eventsource", eventsource_handler, []},
{"/", cowboy_static, {priv_file, eventsource, "index.html"}}
]}
]),
{ok, _} = cowboy:start_cl... |
39da3d23c6847557a073e278907c7b337f9d25ec1922cfa6e43b746d4acdd933 | etarasov/iptadmin | DelPage.hs |
module IptAdmin.DelPage where
import Control.Monad.Error
import Happstack.Server.SimpleHTTP
import IptAdmin.DelPage.Render
import IptAdmin.Render
import IptAdmin.System
import IptAdmin.Template
import IptAdmin.Types
import IptAdmin.Utils
import Iptables
import Iptables.Print
import Iptables.Types
import Safe
import T... | null | https://raw.githubusercontent.com/etarasov/iptadmin/ceaca3424a0b2891da4d5d91eaf516a3566f2885/src/IptAdmin/DelPage.hs | haskell | | Deprecated. Was used before jquery-ui integration.
redir $ "/show?table=" ++ tableName ++ bookmarkForJump chainName (Just rulePosition) |
module IptAdmin.DelPage where
import Control.Monad.Error
import Happstack.Server.SimpleHTTP
import IptAdmin.DelPage.Render
import IptAdmin.Render
import IptAdmin.System
import IptAdmin.Template
import IptAdmin.Types
import IptAdmin.Utils
import Iptables
import Iptables.Print
import Iptables.Types
import Safe
import T... |
fb52c71b6d6baa756a350ca75d50f41260b71c0c0491d6a112ce216518976355 | samcf/ogres | const.cljs | (ns ogres.app.const)
(def ^:const grid-size
"The length, in pixels, of a single square in the canvas grid. This
correlates to 5 feet in this spatial system."
70)
| null | https://raw.githubusercontent.com/samcf/ogres/9e70db1b0675ea0e2ac775887f83066e1fa8b0ad/src/main/ogres/app/const.cljs | clojure | (ns ogres.app.const)
(def ^:const grid-size
"The length, in pixels, of a single square in the canvas grid. This
correlates to 5 feet in this spatial system."
70)
| |
408c3db9bb2c87606639a975daa83f787e3cc75ed26d64c71846a83e97df109a | JustusAdam/schedule-planner | Scale.hs | |
Module : $ Header$
Description : Apply weighing rules to lessons
Copyright : ( c ) , 2015
License : LGPL-3
Maintainer :
Stability : experimental
Portability : POSIX
This module is used to weigh a list of lessons according to rules .
Module : $Header$
Description : Apply w... | null | https://raw.githubusercontent.com/JustusAdam/schedule-planner/ba501c4c8332b5e11379fb500d867fdc8082d482/src/SchedulePlanner/Calculator/Scale.hs | haskell | | Type alias for more expressive function signature
| Type alias for structure holding the dynamic rules
| Scaffolding for a dynamic rule
| Recalculate the lesson weight tuple as a result of dynamic rules
|
Stateful recalculation of the rule map triggered by a change.
|
Main function of the module.
This fun... | |
Module : $ Header$
Description : Apply weighing rules to lessons
Copyright : ( c ) , 2015
License : LGPL-3
Maintainer :
Stability : experimental
Portability : POSIX
This module is used to weigh a list of lessons according to rules .
Module : $Header$
Description : Apply w... |
bce59f2dd2582699cb05fa72401b4fd1143415897137860e575923a486f404f7 | softlab-ntua/bencherl | gui.erl | Copyright ( C ) 2010 - 2014
%
This file is part of the Ceylan Erlang library .
%
% This library is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License or
the GNU General Public License , as they are published by the Free Software
Foundation , eith... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/sim-diasca/common/src/user-interface/gui.erl | erlang |
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License or
any later version.
You can also redistribute it and/or modify it under the terms of the
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; w... | Copyright ( C ) 2010 - 2014
This file is part of the Ceylan Erlang library .
the GNU General Public License , as they are published by the Free Software
Foundation , either version 3 of these Licenses , or ( at your option )
Mozilla Public License , version 1.1 or later .
GNU Lesser General Public License... |
6419c123e35645c7f7c705336a3f0b0a2caf0379d89efb740e9b8bb095c4d1ec | epicallan/hreq | Response.hs | -- | Specification for valid Response component types used at the Kind and Type level
-- for creating an API structure.
--
module Hreq.Core.API.Response where
import Data.Kind (Type)
import Data.Singletons (Sing, SingI (..))
import GHC.TypeLits (Nat, Symbol)
-- * Response type
data ResContent a =
ResBody a a
| ... | null | https://raw.githubusercontent.com/epicallan/hreq/f12fcb9b9dd1ad903c6b36a8cf850edb213d4792/hreq-core/src/Hreq/Core/API/Response.hs | haskell | | Specification for valid Response component types used at the Kind and Type level
for creating an API structure.
* Response type
* Response type synonyms | module Hreq.Core.API.Response where
import Data.Kind (Type)
import Data.Singletons (Sing, SingI (..))
import GHC.TypeLits (Nat, Symbol)
data ResContent a =
ResBody a a
| ResHeaders [(Symbol, a)]
| ResStream a a
| ResStatus a Nat
| Raw a
type ResBody = 'ResBody
type ResHeaders = 'ResHeaders
type ResStream... |
0f2f0f83f6428853baeb310d9f5714ec2adee82ba5ae60a6c2e7212e64b90048 | ygale/strict-concurrency | mvar-test.hs |
The Computer Language Shootout
/
Written by , 13 Nov 2006 . modified by
/
Written by Tom Pledger, 13 Nov 2006. modified by Don Stewart -}
import Control.Concurrent (forkIO,yield)
#if defined(STRICT)
import Control.Concurrent.MVar.Strict
#else
import Control.Concurrent.MVar
#endif
import Control.... | null | https://raw.githubusercontent.com/ygale/strict-concurrency/40e7df9fcb9cf702453cd6ab9d5e6b5a7e7e8dd6/tests/mvar-test.hs | haskell | this should cause a space leak: |
The Computer Language Shootout
/
Written by , 13 Nov 2006 . modified by
/
Written by Tom Pledger, 13 Nov 2006. modified by Don Stewart -}
import Control.Concurrent (forkIO,yield)
#if defined(STRICT)
import Control.Concurrent.MVar.Strict
#else
import Control.Concurrent.MVar
#endif
import Control.... |
5fcc68bc83cafa6dd4a06c94bfd35a32ca1f4fcb5ed92a32306de01794b3eda4 | philnguyen/soft-contract | paraffins.rkt | #lang racket/base
(require soft-contract/fake-contract)
;;; PARAFFINS -- Compute how many paraffins exist with N carbon atoms.
(define (gen n)
(let* ((n/2 (quotient n 2))
(radicals (make-vector (+ n/2 1) '(H))))
(define (rads-of-size n)
(let loop1 ((ps
(three-partitions (- n 1... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/termination/r5rs-ish/paraffins.rkt | racket | PARAFFINS -- Compute how many paraffins exist with N carbon atoms. | #lang racket/base
(require soft-contract/fake-contract)
(define (gen n)
(let* ((n/2 (quotient n 2))
(radicals (make-vector (+ n/2 1) '(H))))
(define (rads-of-size n)
(let loop1 ((ps
(three-partitions (- n 1)))
(lst
'()))
(if (null? ... |
32126310d93c305625e7edd5c55ac40aad8847937e81221f1cefe7ca6a43891f | oakes/Nightcoders | core.clj | (ns nightcoders.core
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[ring.middleware.resource :refer [wrap-resource]]
[ring.middleware.file :refer [wrap-file]]
[ring.middleware.session :refer [wrap-session]]
[ri... | null | https://raw.githubusercontent.com/oakes/Nightcoders/c1b48129b08fdf1a0093878cc9b3249f44a5f732/src/clj/nightcoders/core.clj | clojure | (ns nightcoders.core
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[ring.middleware.resource :refer [wrap-resource]]
[ring.middleware.file :refer [wrap-file]]
[ring.middleware.session :refer [wrap-session]]
[ri... | |
e5a71a29c0efb9e6955f0c8e15e67db8c6325390c0c372d22fe558f289cb955d | austral/austral | Mtast.ml |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... | null | https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/Mtast.ml | ocaml | * Represents a call to a concrete function.
* Represents a call to a generic function.
* Represents a call to an instance method of a concrete instance.
* Represents a call to an instance method of a generic instance. |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... |
d90ae6c46514a65da7d1048c070b61cbb861cdc8a2f3072bda4583cb1def56fd | bobzhang/ocaml-book | myocamlbuild.ml | (********************************************************************************)
plugin for CCSS project .
Based on " Using ocamlfind with " from the wiki :
(* *)
(********************************************************************************)
open Ocamlbuild_plugin
(* these functions are not r... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/code/menhir/ccss-1.2/src/_build/myocamlbuild.ml | ocaml | ******************************************************************************
******************************************************************************
these functions are not really officially exported
this lists all supported packages
this is supposed to list available syntaxes, but I don't know how to ... | plugin for CCSS project .
Based on " Using ocamlfind with " from the wiki :
open Ocamlbuild_plugin
let run_and_read = Ocamlbuild_pack.My_unix.run_and_read
let blank_sep_strings = Ocamlbuild_pack.Lexers.blank_sep_strings
let find_packages () =
blank_sep_strings (Lexing.from_string (run_and_read "o... |
b5f11eb8bc313fcd019fa130228a3aa9bc9461baf28d256cc3f4d10b58e724e4 | victornicolet/parsynt | Consynth.ml | module Canalyst = Canalyst
module Fn = Fn
module SketchJoin = SketchJoin
module Sketch = Sketch
module Utils = Utils
| null | https://raw.githubusercontent.com/victornicolet/parsynt/d3f530923c0c75537b92c2930eb882921f38268c/src/singleloop/Consynth.ml | ocaml | module Canalyst = Canalyst
module Fn = Fn
module SketchJoin = SketchJoin
module Sketch = Sketch
module Utils = Utils
| |
da9548859d8cf06fc8d3d16801e1b0dae92591958e01cb23e13a948caa2abe28 | CRogers/obc | control.ml |
* control.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2008
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions... | null | https://raw.githubusercontent.com/CRogers/obc/49064db244e0c9d2ec2a83420c8d0ee917b54196/debugger/control.ml | ocaml | regs -- the current register contents
Panic exit
Traversing the stack
Fetch the bp and pc from the current frame head,
and the cp from the parent, unless bp is null |
* control.ml
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2008
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions... |
fe084af1006a94a27cdfcf17ce6d1e27c4baddb1331c9cf9f384c64a3c209837 | zadean/xqerl | xqerl_json.erl | Copyright ( c ) 2017 - 2020 .
SPDX - FileCopyrightText : 2022
%
SPDX - License - Identifier : Apache-2.0
%% @doc JSON related functions for de-encoding from/to map/array
-module(xqerl_json).
-compile(inline_list_funcs).
-include("xqerl.hrl").
-define(NS, <<"-functions">>).
-define(QN(Local), {?NS,... | null | https://raw.githubusercontent.com/zadean/xqerl/06c651ec832d0ac2b77bef92c1b4ab14d8da8883/src/xqerl_json.erl | erlang |
@doc JSON related functions for de-encoding from/to map/array
ignored, no liberal parsing
escape = true, %% different from the spec
validate = false, %% always false
====================================================================
API functions
============================================================... | Copyright ( c ) 2017 - 2020 .
SPDX - FileCopyrightText : 2022
SPDX - License - Identifier : Apache-2.0
-module(xqerl_json).
-compile(inline_list_funcs).
-include("xqerl.hrl").
-define(NS, <<"-functions">>).
-define(QN(Local), {?NS, <<>>, Local}).
-define(MQN(Local), {?NS, _, Local}).
-define(AQN(Lo... |
1ef3e0029df966fc839cf3864ed5cec4666cc21ee970ff3af528a506b96550b5 | theodormoroianu/SecondYearCourses | lab6-sol_20210115145343.hs | -- /
import Data.Char
import Data.List
import Test.QuickCheck
1 .
rotate :: Int -> [Char] -> [Char]
rotate n l
| n > 0
, n < length l
= suf ++ pre
where
(pre, suf) = splitAt n l
rotate _ _ = error "număr negativ sau prea mare"
2 .
prop_rotate :: Int -> String -> Bool
prop_rotate k str = rotate (l ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/l/.history/lab6/lab6-sol_20210115145343.hs | haskell | / |
import Data.Char
import Data.List
import Test.QuickCheck
1 .
rotate :: Int -> [Char] -> [Char]
rotate n l
| n > 0
, n < length l
= suf ++ pre
where
(pre, suf) = splitAt n l
rotate _ _ = error "număr negativ sau prea mare"
2 .
prop_rotate :: Int -> String -> Bool
prop_rotate k str = rotate (l + 1 -... |
055dc891f5bfe3744f656e97e3cfe41d4bb4675f5aadcecd7892dd8c19a01a79 | SumitPadhiyar/confuzz | configure.ml | (* top-level lwt feature configuration *)
let use_libev = ref None
let use_pthread = ref None
let android_target = ref None
let libev_default = ref None
let default_configuration = ref None
let arg_bool r =
Arg.Symbol (["true"; "false"],
function
| "true" -> r := Some true
... | null | https://raw.githubusercontent.com/SumitPadhiyar/confuzz/7d6b2af51d7135025f9ed1e013a9ae0940f3663e/src/unix/config/configure.ml | ocaml | top-level lwt feature configuration
Check if we have the opam command and conf-libev is installed. If so,
behave as if -use-libev true was passed.
opam 2.0.0 returns exit code 0 for `opam list` even if the package is not available,
so we instead use opam config vars to detect the presence of con... |
let use_libev = ref None
let use_pthread = ref None
let android_target = ref None
let libev_default = ref None
let default_configuration = ref None
let arg_bool r =
Arg.Symbol (["true"; "false"],
function
| "true" -> r := Some true
| "false" -> r := Some false
... |
8546b46afde0c484ecf6aa3092efc9f7059f2bf97a441c3c2cdcbb00627b2f80 | discus-lang/ddc | AppX.hs | {-# OPTIONS_HADDOCK hide #-}
module DDC.Core.Check.Judge.Type.AppX
(checkAppX)
where
import DDC.Core.Check.Judge.Type.Sub
import DDC.Core.Check.Judge.Type.Prim
import DDC.Core.Check.Judge.Type.Base
import DDC.Data.Label
import qualified DDC.Core.Check.Context.Resolve as Resolve
import qualified DDC.Core.Env.Env... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Check/Judge/Type/AppX.hs | haskell | # OPTIONS_HADDOCK hide #
-------------------------------------------------------------------------------------------------
| Check a value expression application.
Rule (App Recon Project)
Application of the tuple or record projection operator.
We determine the result type by looking up the appropriate field
of ... | module DDC.Core.Check.Judge.Type.AppX
(checkAppX)
where
import DDC.Core.Check.Judge.Type.Sub
import DDC.Core.Check.Judge.Type.Prim
import DDC.Core.Check.Judge.Type.Base
import DDC.Data.Label
import qualified DDC.Core.Check.Context.Resolve as Resolve
import qualified DDC.Core.Env.EnvT as EnvT
import... |
3f2716320d89e0000e2496d7a3e4ab9041753508884f772d9640557970a0982c | alvatar/spheres | cookie.scm | ;;!!! Cookie handling module for the Sack web server middleware
.author Per Eckerdal , 2008 - 2009
.author More , 2012 - 2013
.author , 2015
;;
Copyright ( C ) 2008 - 2009 Per Eckerdal
Copyright ( C ) 2012 - 2013 Mikael More
;;
;;
;; ## Typical usecase
;; Wrap your sack-app procedure with the |cookies->|... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/net/sack/cookie.scm | scheme | !!! Cookie handling module for the Sack web server middleware
## Typical usecase
Wrap your sack-app procedure with the |cookies->| procedure e.g.
(sack-start! (cookies-> (lambda (env) ..your code)))
Then in your sack app, you set, get and remove cookies like this:
; Set cookie string value:
(... | .author Per Eckerdal , 2008 - 2009
.author More , 2012 - 2013
.author , 2015
Copyright ( C ) 2008 - 2009 Per Eckerdal
Copyright ( C ) 2012 - 2013 Mikael More
# # Exports
It is to be used as an adapter between and your sack app , i.e.
' sack : cookie : get - value = Takes one argument , bein... |
d52babc6bef6ed55fd446e17cdf9eb9a44c367deefeef053627fb1783b4295a0 | serras/t-regex | Generics.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependencies #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- ... | null | https://raw.githubusercontent.com/serras/t-regex/8890f99b849baaf55b7e9ae9fbdb6d818b992ba3/src/Data/Regex/Generics.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE ConstraintKinds #
# LANGUAGE DeriveDataTypeable #
| Tree regular expressions over regular data types.
* Base types
Regex(Regex),
* Constructors
| For a description and study of tree regular expressions, you are invited to read
** Emptiness
** Whole language
** Injection
Holes... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependencies #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
module Data.Regex.Generics (
Regex(Inject),
Fix(..),
Chapter 2 of < / Tree Automata Techniq... |
612c9f443099915a3ee050a78b90effebdf2ffaa43b8578cfac5571689b25a76 | stuarthalloway/programming-clojure | midi.clj | (ns examples.datatypes.midi
(:import [javax.sound.midi MidiSystem]))
(defprotocol MidiNote
(to-msec [this tempo])
(key-number [this])
(play [this tempo midi-channel]))
(defn perform [notes & {:keys [tempo] :or {tempo 88}}]
(with-open [synth (doto (MidiSystem/getSynthesizer).open)]
(let [channel (aget (.g... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/src/examples/midi.clj | clojure | (ns examples.datatypes.midi
(:import [javax.sound.midi MidiSystem]))
(defprotocol MidiNote
(to-msec [this tempo])
(key-number [this])
(play [this tempo midi-channel]))
(defn perform [notes & {:keys [tempo] :or {tempo 88}}]
(with-open [synth (doto (MidiSystem/getSynthesizer).open)]
(let [channel (aget (.g... | |
44b9ed7d2db0e57ad7ebd037eeb727be5191d97e4c94b372e7e5cedef084a1d0 | discoproject/disco | ddfs.erl | -module(ddfs).
-include("gs_util.hrl").
-include("config.hrl").
-include("ddfs.hrl").
-include("ddfs_tag.hrl").
-export([new_blob/5, tags/2, get_tag/4, update_tag/5, update_tag_delayed/5,
replace_tag/5, delete/3, delete_attrib/4]).
-define(MAX_BLOB_NAME, 200).
% dummy
-type state() :: none.
-spec new_blob... | null | https://raw.githubusercontent.com/discoproject/disco/be65272d3eecca184a3c8f2fa911b86ac87a4e8a/master/src/ddfs/ddfs.erl | erlang | dummy | -module(ddfs).
-include("gs_util.hrl").
-include("config.hrl").
-include("ddfs.hrl").
-include("ddfs_tag.hrl").
-export([new_blob/5, tags/2, get_tag/4, update_tag/5, update_tag_delayed/5,
replace_tag/5, delete/3, delete_attrib/4]).
-define(MAX_BLOB_NAME, 200).
-type state() :: none.
-spec new_blob(server(... |
0264c1ae4e786c0df6c3da89ec0623d4d150c093a5c1fdee4b9f05da99ff593f | AccelerationNet/function-cache | thunk.lisp | (in-package :function-cache)
(defclass thunk-cache (function-cache)
()
(:documentation "a cache optimized for functions of no arguments
(uses a cons for caching)"))
(defmethod get-cached-value ((cache thunk-cache) cache-key)
(declare (ignore cache-key))
(let* ((res (car (cached-results cache)))
... | null | https://raw.githubusercontent.com/AccelerationNet/function-cache/6a5ada401e57da2c8abf046f582029926e61fce8/src/thunk.lisp | lisp | (in-package :function-cache)
(defclass thunk-cache (function-cache)
()
(:documentation "a cache optimized for functions of no arguments
(uses a cons for caching)"))
(defmethod get-cached-value ((cache thunk-cache) cache-key)
(declare (ignore cache-key))
(let* ((res (car (cached-results cache)))
... | |
2b8319abc237bcc769e89d0ed26b7045ccb6148c4883d389fe534c573f20f350 | mattaudesse/haskell-99-problems | H12.hs | module Problems.H12 where
import Problems.H11 (RunLength(..))
-- |
-- Decode a run-length encoded list.
--
Given a run - length code list generated as specified in problem 11 . Construct
-- its uncompressed version.
--
-- >>> :{
-- decodeModified [
-- Multiple 4 'a'
... | null | https://raw.githubusercontent.com/mattaudesse/haskell-99-problems/f7d57c0bd45c245f10073cf708fbc5e2107e0e23/Problems/H12.hs | haskell | |
Decode a run-length encoded list.
its uncompressed version.
>>> :{
decodeModified [
Multiple 4 'a'
, Multiple 2 'a'
, Multiple 4 'e'
]
:}
"aaaabccaadeeee"
|
Decode a run-length encoded list.
its uncompressed versi... | module Problems.H12 where
import Problems.H11 (RunLength(..))
Given a run - length code list generated as specified in problem 11 . Construct
, Single ' b '
, Multiple 2 ' c '
, Single 'd '
decodeModified :: Eq a => [RunLength a] -> [a]
decodeModif... |
69cd3fb82ad7d9c98fdbcd36209de0576bb85110cbd2fc5ba9c110d7fada4cd1 | mirage/capnp-rpc | main.ml | open Lwt.Infix
open Capnp_rpc_lwt
module Restorer = Capnp_rpc_net.Restorer
let () =
Logs.set_level (Some Logs.Warning);
Logs.set_reporter (Logs_fmt.reporter ())
let secret_key = `Ephemeral
let listen_address = `TCP ("127.0.0.1", 7000)
let or_fail = function
| Ok x -> x
| Error (`Msg m) -> failwith m
let st... | null | https://raw.githubusercontent.com/mirage/capnp-rpc/8a0b6dce373dc2e2d547d85e542962862773f74b/examples/sturdy-refs-3/main.ml | ocaml | $MDX part-begin=root
$MDX part-end
$MDX part-begin=save
$MDX part-end | open Lwt.Infix
open Capnp_rpc_lwt
module Restorer = Capnp_rpc_net.Restorer
let () =
Logs.set_level (Some Logs.Warning);
Logs.set_reporter (Logs_fmt.reporter ())
let secret_key = `Ephemeral
let listen_address = `TCP ("127.0.0.1", 7000)
let or_fail = function
| Ok x -> x
| Error (`Msg m) -> failwith m
let st... |
c494e70f7ccc1ba74a0f92aa6eb346b283d7d077317c5a320126ced03ea1043a | lgandersen/edgedns | edge_core_traffic_logger.erl | %%%-------------------------------------------------------------------
@author
( C ) 2017 , Lasse Grinderslev Andersen
%%% @doc
%%%
%%% @end
%%%-------------------------------------------------------------------
-module(edge_core_traffic_logger).
-include_lib("kernel/src/inet_dns.hrl").
-include("edgedns.hrl"... | null | https://raw.githubusercontent.com/lgandersen/edgedns/6f1d414eed5ec412b934d3a82a694597fdee4649/apps/edge_core/src/edge_core_traffic_logger.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
===================================================================
API
===================================================================
---... | @author
( C ) 2017 , Lasse Grinderslev Andersen
-module(edge_core_traffic_logger).
-include_lib("kernel/src/inet_dns.hrl").
-include("edgedns.hrl").
-behaviour(gen_server).
-export([start_link/0,
log_query/3,
stats_log/2,
dampening_activated/1,
dampening_removed/1]).
-ex... |
80eba28e9a677cbca8d95584115b018f4c9105c5ae4b276fac0699ead49fd798 | charleso/bantam | Api.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
module Bantam.Service.Api (
module X
) where
import Bantam.Service.Api.Fight as X
import Bantam.Service.Api.Login as X
| null | https://raw.githubusercontent.com/charleso/bantam/3af8d08f8e649cb5690815d17e6c79a3a9033d47/bantam-service/src/Bantam/Service/Api.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
module Bantam.Service.Api (
module X
) where
import Bantam.Service.Api.Fight as X
import Bantam.Service.Api.Login as X
| |
4e2f12817a97506fceb52cda95a68a548cd191823e4184b64eef5d6a5fa606ff | joergen7/effi | effi_bash.erl | %% -*- erlang -*-
%%
%% Effi: Erlang foreign function interface
%%
Copyright 2015 - 2019 < >
%%
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 ... | null | https://raw.githubusercontent.com/joergen7/effi/aac0d5716c322200dd1145cf6bb651f79834bfd5/src/effi_bash.erl | erlang | -*- erlang -*-
Effi: Erlang foreign function interface
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.... | Copyright 2015 - 2019 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2015 - 2019
-module( effi_bash ).
-behaviour( effi ).
-export( [bind_singleton_boolean/2,
bind_singleton_string/2... |
a1726388e7a97e564035262b090c4aac4eecd82d02d2fb06bf8b02390fbb6be9 | hjcapple/reading-sicp | exercise_2_58_b.scm | #lang racket
P102 - [ 练习 2.58 - b ]
;; 这道题主要是要解决加法和乘法的二义性问题。比如 (x + y * z)
可以解释成 ( x + y ) * z 也可以解释成 x + ( y * z )
这里使用最简单的方案,先在列表中用 memq 查找 + 号,找到就是加法。假如找不到 + 号就再找 * , 找到就是乘法 。
;; 找到 + 符号后,就可以根据 + 号将列表分为两截。于是 (x + y * z) ,就可以看成是 (x + (y * z))
这种方案是最简单的,deriv
(define (deriv exp var)
(cond ((number? exp... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_2/exercise_2_58_b.scm | scheme | 这道题主要是要解决加法和乘法的二义性问题。比如 (x + y * z)
找到 + 符号后,就可以根据 + 号将列表分为两截。于是 (x + y * z) ,就可以看成是 (x + (y * z))
取出 + 号前面部分
取出 + 号后面部分
取出 * 号前面部分
取出 * 号后面部分
| #lang racket
P102 - [ 练习 2.58 - b ]
可以解释成 ( x + y ) * z 也可以解释成 x + ( y * z )
这里使用最简单的方案,先在列表中用 memq 查找 + 号,找到就是加法。假如找不到 + 号就再找 * , 找到就是乘法 。
这种方案是最简单的,deriv
(define (deriv exp var)
(cond ((number? exp) 0)
((variable? exp)
(if (same-variable? exp var) 1 0))
((sum? exp)
(ma... |
98a428c0d472f75012ed5def028a17761a209bd56212546f1ded86c247700a2b | bhuztez/russell | prim_shell_SUITE.erl | -module(prim_shell_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
all() ->
[file_not_exist,
verify_error,
demo0].
format_prompt(Prompt, Encoding) ->
lists:flatten(io_lib:format_prompt(Prompt, Encoding)).
consume([], Text) ->
Text;
consume([H|T1], [H|T2]) ->
consu... | null | https://raw.githubusercontent.com/bhuztez/russell/eaafa8207f2da3e2544a567edf10e6d33120c4ce/test/prim_shell_SUITE.erl | erlang | -module(prim_shell_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
all() ->
[file_not_exist,
verify_error,
demo0].
format_prompt(Prompt, Encoding) ->
lists:flatten(io_lib:format_prompt(Prompt, Encoding)).
consume([], Text) ->
Text;
consume([H|T1], [H|T2]) ->
consu... | |
913118d672a509f0d78ee46b62491202c1fb21189f3754d84498ffac290fbf63 | madnificent/SEXML | cl-validations.lisp | ;;;; cl-validations.lisp
(in-package #:cl-validations)
(defun object-validp (object)
(if (typep object 'attributes-object)
(let ((slots (closer-mop:class-slots (class-of object)))
(results nil))
(loop for slot in slots
do (let ((slot-name (closer-mop:slot-definition-name slot)))
(multiple-value-bi... | null | https://raw.githubusercontent.com/madnificent/SEXML/c4db46adb60674e81273adbaac7b5f54dd79a438/contrib/sexml-objects/cl-validations/cl-validations.lisp | lisp | cl-validations.lisp |
(in-package #:cl-validations)
(defun object-validp (object)
(if (typep object 'attributes-object)
(let ((slots (closer-mop:class-slots (class-of object)))
(results nil))
(loop for slot in slots
do (let ((slot-name (closer-mop:slot-definition-name slot)))
(multiple-value-bind (slot-result error-msg... |
704d0843777f9fff11a1e0ec57214e9d0a90a6940ade49af7ad0e5055c79b3ad | lojic/RacketChess | board.rkt | #lang racket
(require "./global.rkt"
"./state.rkt")
(require racket/performance-hint)
(provide black-king-idx
create-board
file-rank->idx
full-move
get-ep-idx
idx->pos
init-moves!
is-end-game?
is-whites-move?
may-castle?
... | null | https://raw.githubusercontent.com/lojic/RacketChess/115ca7fecca9eaf31f9b2f4ef59935372c9920c8/src/board.rkt | racket | 10x12 Board Representation
a b c d e f g h
Indexed by move-i
Indexed by depth
Indexed by depth
Indexed by depth
Indexed by depth
depth
squares
move-i
game-state
game-stack
quiet-moves
quiet-head
tactical-moves
tactical-head
Decrement move-i and pop th... | #lang racket
(require "./global.rkt"
"./state.rkt")
(require racket/performance-hint)
(provide black-king-idx
create-board
file-rank->idx
full-move
get-ep-idx
idx->pos
init-moves!
is-end-game?
is-whites-move?
may-castle?
... |
14860de4ae6769451eca9b9ac4786563a3f270fc7e39532541297b5656281aed | qkrgud55/ocamlmulti | typeclass.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet Cri... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/typing/typeclass.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : typeclass.ml 12800 2012 - 07 - 3... |
4530d38b82fad3a651fcb50bc2ddf093cefa4533a8757b61c541196d0ecee2a9 | racket/racket7 | main.rkt | #lang racket/base
(require "../locale/string.rkt"
(rename-in "path.rkt"
[string->path raw:string->path])
"check.rkt"
"sep.rkt"
"build.rkt"
"string.rkt"
"split.rkt"
"protect.rkt"
"relativity.rkt"
"cleanse.rkt"
"... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/path/main.rkt | racket | Quick pre-check: any separators?
Make sure we don't call `protect-path-element` on a
byte string that contains a "\": | #lang racket/base
(require "../locale/string.rkt"
(rename-in "path.rkt"
[string->path raw:string->path])
"check.rkt"
"sep.rkt"
"build.rkt"
"string.rkt"
"split.rkt"
"protect.rkt"
"relativity.rkt"
"cleanse.rkt"
"... |
37a8ad6d4c1ebf91fff2d1abfa84f14661323eaa6a3a8878a80bab644c2bda2e | i-am-tom/haskell-exercises | Exercises.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE KindSignatures #-}
module Exercises where
import Data.Kind (Constraint, Type)
| Fix the following classes by annotating them with kind signatures . GHC
will tell you exactly what the problem is , so be sure to try /before/
-- uncommenting!
ONE
class Question1... | null | https://raw.githubusercontent.com/i-am-tom/haskell-exercises/bdf8160fb7a09d577e1871ae29124b2041b3c079/03-KindSignatures/src/Exercises.hs | haskell | # LANGUAGE KindSignatures #
uncommenting!
instance Question1 Maybe
instance Question2 Either
instance Question3 (,,)
FOUR
instance Question4 (->)
instance Question5 [[Int]]
SEVEN
This instance looks flexible ...
EIGHT
instance Question8 Show
should it be? Which part is broken? What's wrong with it? | # LANGUAGE FlexibleInstances #
module Exercises where
import Data.Kind (Constraint, Type)
| Fix the following classes by annotating them with kind signatures . GHC
will tell you exactly what the problem is , so be sure to try /before/
ONE
class Question1 a
TWO
class Question2 a
THREE
class... |
7a9067fd2085792ce71a8bed724797f8e41e6f71bad7009ba3d5e8376f85a176 | skrah/minicaml | test25.ml | Example from 's " Modern Compiler Implementation in ML " , translated
to .
to Caml. *)
Unbound record field f
let _ =
let d = 0 in d.f
| null | https://raw.githubusercontent.com/skrah/minicaml/e5f5cad7fdbcfc11561f717042fae73fa743823f/test/test25.ml | ocaml | Example from 's " Modern Compiler Implementation in ML " , translated
to .
to Caml. *)
Unbound record field f
let _ =
let d = 0 in d.f
| |
26d04277adbf9e64deeb70433210fc2a1853af8a6e4f7e0bec93ec9a0e115063 | haskell-hvr/hackage-mirror-tool | Common.hs | # LANGUAGE BangPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
-- |
Copyright :
License :
--
module Common
( module Common
, module Control.Applicative
, module Data.Maybe
, module Hackage.Security.Util.Path
, module Data.Semigroup
, module Data.Word
, module Da... | null | https://raw.githubusercontent.com/haskell-hvr/hackage-mirror-tool/ed377c947e7b6a80483b17589194b5427370ab0f/src/Common.hs | haskell | |
Special reserved 'SHA256Val'
Special reserved 'SHA256Val'
strictTriple :: a -> b -> c -> (a,b,c)
strictTriple !a !b !c = (a,b,c) | # LANGUAGE BangPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
Copyright :
License :
module Common
( module Common
, module Control.Applicative
, module Data.Maybe
, module Hackage.Security.Util.Path
, module Data.Semigroup
, module Data.Word
, module Data.Int
... |
edd634462218b07637e2db7c662b6537b206da9555e4c4c16b1f8f383b2555eb | tkaryadis/squery-mongo-core | js_functions.cljc | (ns squery-mongo-core.internal.convert.js-functions
(:require clojure.string
[squery-mongo-core.utils :refer [make-dir delete-dir path-str file-exist? run-shell-command
read-file read-file-read-string write-file get-cwd]]))
(defn js-body [& strings]
(apply str... | null | https://raw.githubusercontent.com/tkaryadis/squery-mongo-core/7df7d6733cfacaf0379d2a39908e6ceb0d86ffeb/src/squery_mongo_core/internal/convert/js_functions.cljc | clojure | --------------------------------------convert-js----------------------------------------------------------------------
clojurescript code
------------------------------------compile---------------------------------------------------------------------------
_
the core is entered in all functions
------------------------... | (ns squery-mongo-core.internal.convert.js-functions
(:require clojure.string
[squery-mongo-core.utils :refer [make-dir delete-dir path-str file-exist? run-shell-command
read-file read-file-read-string write-file get-cwd]]))
(defn js-body [& strings]
(apply str... |
75c75255eb26231f66f5d26125d27f0aef9f032381dc1effba43fcd88b64eda8 | asakeron/cljs-webgl | data_type.cljs | (ns cljs-webgl.constants.data-type
(:refer-clojure :exclude [byte
short
int
float]))
(def byte 0x1400)
(def unsigned-byte 0x1401)
(def short 0x1402)
(def unsigned-short 0x1403)
(def int 0x1404)
(def uns... | null | https://raw.githubusercontent.com/asakeron/cljs-webgl/f4554fbee6fbc6133a4eb0416548dabd284e735c/src/cljs/cljs_webgl/constants/data_type.cljs | clojure | (ns cljs-webgl.constants.data-type
(:refer-clojure :exclude [byte
short
int
float]))
(def byte 0x1400)
(def unsigned-byte 0x1401)
(def short 0x1402)
(def unsigned-short 0x1403)
(def int 0x1404)
(def uns... | |
0dbc7bed9bf22492502f4cd0ac86e1213782ec254b45ba83a3697e93c63a0913 | scicloj/wadogo | histogram.clj | (ns wadogo.scale.histogram
(:require [fastmath.core :as m]
[fastmath.stats :as stats]
[wadogo.common :refer [scale ->ScaleType strip-keys merge-params]]
[wadogo.utils :refer [build-seq interval-steps-before values->reversed-map]]))
;; similar to threshold but splits b... | null | https://raw.githubusercontent.com/scicloj/wadogo/c7e29adf7f271c546a406ba2d4e259005a09f0c6/src/wadogo/scale/histogram.clj | clojure | similar to threshold but splits by bins | (ns wadogo.scale.histogram
(:require [fastmath.core :as m]
[fastmath.stats :as stats]
[wadogo.common :refer [scale ->ScaleType strip-keys merge-params]]
[wadogo.utils :refer [build-seq interval-steps-before values->reversed-map]]))
(defn- ->bins
[xs r]
(let [r (o... |
c2589e70409541f7688298e1da1620044b3962775dbbbe9f97c67c32e2e23b1f | protz/mezzo | TypeChecker.ml | (*****************************************************************************)
(* Mezzo, a programming language based on permissions *)
Copyright ( C ) 2011 , 2012 and
(* *)
(* This program is free softwar... | null | https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/typing/TypeChecker.ml | ocaml | ***************************************************************************
Mezzo, a programming language based on permissions
This program is free software: you can redistribute it and/or modify
(at your optio... | Copyright ( C ) 2011 , 2012 and
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
open Kind
open Either
open TypeCore
op... |
59e84bba1e1ac506cfc630af89db84b348f9524de6c4cd10f9a6a1f6d16afa78 | SKA-ScienceDataProcessor/RC | Run.hs | # LANGUAGE TemplateHaskell #
{-# OPTIONS_HADDOCK hide #-}
-- | Run.hs
--
-- Functions for starting DNA programs
module DNA.Run (
dnaRun
) where
import Control.Applicative
import Control.Monad
import Control.Exception (onException,SomeException)
import Control.Distributed.Process hiding (onException)
import ... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS4/lib/DNA/Run.hs | haskell | # OPTIONS_HADDOCK hide #
| Run.hs
Functions for starting DNA programs
|
invocation of 'remotable' generate @__remoteTable@ top level
tables must composed using '.' and passed to @dnaRun@ as in
following example:
UNIX startup. If command line parameter '--nprocs=N' is
SLURM startup. Jobs of starting processe... | # LANGUAGE TemplateHaskell #
module DNA.Run (
dnaRun
) where
import Control.Applicative
import Control.Monad
import Control.Exception (onException,SomeException)
import Control.Distributed.Process hiding (onException)
import Control.Distributed.Process.Closure
import Control.Distributed.Process.Node (initRe... |
831f572cd0d662996d83cf77a33cb9d6ae346f9daf412ca06ba27dbbe07cd796 | freedict/tools | Test.hs |
- Test.hs - manual testing
-
- Copyright 2020,2022 Einhard Leichtfuß
-
- This file is part of ding2tei - haskell .
-
- ding2tei - haskell is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software ... | null | https://raw.githubusercontent.com/freedict/tools/3596640e6e0582cc5fb76a342e5d8e7413aa4b34/importers/ding2tei/src/Test.hs | haskell | |
- Manual testing. No function exported. To be used in `ghci' exclusively.
-
- Re-exports many data structures and functions.
<-chemnitz.de/doc/syntax.html>.
Outdated syntax:
]
vi: ft=haskell ts=2 sw=2 et |
- Test.hs - manual testing
-
- Copyright 2020,2022 Einhard Leichtfuß
-
- This file is part of ding2tei - haskell .
-
- ding2tei - haskell is free software : you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software ... |
e22e7c6fc02b151602620faa432a9652600b6996d47784ec48f2e7becf274896 | puppetlabs/trapperkeeper | internal_test.clj | (ns puppetlabs.trapperkeeper.internal-test
(:require [clojure.test :refer :all]
[puppetlabs.trapperkeeper.core :as tk]
[puppetlabs.trapperkeeper.app :as tk-app]
[puppetlabs.trapperkeeper.internal :as internal]
[puppetlabs.trapperkeeper.testutils.bootstrap :as testutils]... | null | https://raw.githubusercontent.com/puppetlabs/trapperkeeper/3e5e7e286287d75e7fdf7eb1dabb2fa534091329/test/puppetlabs/trapperkeeper/internal_test.clj | clojure | block on the 'stop-promise', so no more work can be picked up off of the
queue
now we issue how ever many restarts we need to to fill up the queue
now we choose some arbitrary number of additional restarts to request,
and confirm that we get a log message indicating that they were rejected
now we unblock all of t... | (ns puppetlabs.trapperkeeper.internal-test
(:require [clojure.test :refer :all]
[puppetlabs.trapperkeeper.core :as tk]
[puppetlabs.trapperkeeper.app :as tk-app]
[puppetlabs.trapperkeeper.internal :as internal]
[puppetlabs.trapperkeeper.testutils.bootstrap :as testutils]... |
315823d6b16f127a3eee320b05438b4722f23d9fe968803aedb0b31982b0000f | hoplon/castra | core_test.clj | (ns castra.core-test
(:require
[ring.adapter.jetty :as jetty]
[castra.core :refer [defrpc ex]]
[castra.middleware :refer [wrap-castra]]))
(defrpc test1
[x y z]
{:pre [(> x 10)]
:rpc/pre (or (not= z 0)
(throw (ex "Validation" {:z "Can't be zero."})))
:rpc/query (/ (* x y) z)}
(... | null | https://raw.githubusercontent.com/hoplon/castra/17d1aec404f69d340698d55b2e7f61b9315c4fe9/test/castra/core_test.clj | clojure | (ns castra.core-test
(:require
[ring.adapter.jetty :as jetty]
[castra.core :refer [defrpc ex]]
[castra.middleware :refer [wrap-castra]]))
(defrpc test1
[x y z]
{:pre [(> x 10)]
:rpc/pre (or (not= z 0)
(throw (ex "Validation" {:z "Can't be zero."})))
:rpc/query (/ (* x y) z)}
(... | |
53ea4e05b8743b408c40882043391b5cc8aeaf54184b7d9fd313d87250726979 | haskell/ghcup-hs | Prefetch.hs | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE RankNTypes #-}
module GHCup.OptParse.Pref... | null | https://raw.githubusercontent.com/haskell/ghcup-hs/54af66d11525587326e7652de8c4ed3ac84876e1/app/ghcup/GHCup/OptParse/Prefetch.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE RankNTypes #
--------------
[ Commands ]--
--------------
-------------
[ Options ]--
-------------
-------------
-------------
------------
[ Footer ]--
------------
offline' flag, ensuring all assets that
-------------------------
[ Effect inte... | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE DuplicateRecordFields #
module GHCup.OptParse.Prefetch where
import GHCup
import GHCup.Errors
import GHCup.Types
imp... |
715521a83d2ed3f931f52faa12ae28357e74302f916ff874aee40404dc9266a7 | links-lang/links | settings.ml | (* Modular Settings.
This compilation unit implements an abstraction that allow settings
to be defined locally on a per compilation unit basis. All settings
(except for "config") are settable via configuration files. In
addition, some settings may be settable via the
commandline. Settings may be defined... | null | https://raw.githubusercontent.com/links-lang/links/dd7866d63647d2b814900d850279493961b4fefb/core/settings.ml | ocaml | Modular Settings.
This compilation unit implements an abstraction that allow settings
to be defined locally on a per compilation unit basis. All settings
(except for "config") are settable via configuration files. In
addition, some settings may be settable via the
commandline. Settings may be defined a... |
module Printexc = Utility.Printexc
type privilege = [`User | `System]
exception Insufficient_privileges of string
exception Conversion_failure of exn * string * string
exception Missing_argument of string
exception Unknown_option of string
exception Unknown_setting of string
exception Invalid_keyvalue_pair of int * ... |
a80ba41f8fdd047b86cd955fcd565fab4119caa56e4c6dd564d204a7c63c5d16 | REPROSEC/dolev-yao-star | Lib_UpdateMulti.ml | open Prims
type uint8 = FStar_UInt8.t
let (split_block :
Prims.pos ->
uint8 FStar_Seq_Base.seq ->
Prims.nat -> (uint8 FStar_Seq_Base.seq * uint8 FStar_Seq_Base.seq))
=
fun block_length ->
fun data ->
fun n ->
let uu___ = FStar_Seq_Properties.split data (n * block_length) in
ma... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Lib_UpdateMulti.ml | ocaml | open Prims
type uint8 = FStar_UInt8.t
let (split_block :
Prims.pos ->
uint8 FStar_Seq_Base.seq ->
Prims.nat -> (uint8 FStar_Seq_Base.seq * uint8 FStar_Seq_Base.seq))
=
fun block_length ->
fun data ->
fun n ->
let uu___ = FStar_Seq_Properties.split data (n * block_length) in
ma... | |
209c3006a04c801f94c5171ee5b1a036a5a1739e43756dea645d74cf20ebc117 | lambdaclass/holiday_pinger | remind_checker.erl | -module(remind_checker).
-behaviour(gen_server).
%%% This module checks periodically which users have reminders to be sent,
%%% according to their holiday configuration, and calls remind_router with the user
%%% and holiday data.
-export([start_link/0,
check_holidays/0,
init/1,
handle_cal... | null | https://raw.githubusercontent.com/lambdaclass/holiday_pinger/a8a6d1e28de57cf24d6205d275981a718305b351/src/reminders/remind_checker.erl | erlang | This module checks periodically which users have reminders to be sent,
according to their holiday configuration, and calls remind_router with the user
and holiday data.
exported only for tests | -module(remind_checker).
-behaviour(gen_server).
-export([start_link/0,
check_holidays/0,
init/1,
handle_call/3,
handle_cast/2,
handle_info/2]).
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
init([]) ->
Interval = hp_config:get(checker_i... |
7f6e2d60cc08fe97388e74a7c4fa86ee8cb62dfb383adb6229be0cb93c0c830d | drym-org/qi | compiler.rkt | #lang racket/base
(provide (for-syntax compile-flow))
(require (for-syntax racket/base
syntax/parse
racket/match
(only-in racket/list
make-list)
"syntax.rkt"
"aux-syntax.rkt"
... | null | https://raw.githubusercontent.com/drym-org/qi/a8bd930eda09e07b8f44fd2e7100b7be96d446ea/qi-lib/flow/compiler.rkt | racket | note: this does not return compiled code but instead,
syntax whose expansion compiles the code
This is prioritized over other forms so that extensions may
Special words
Conditionals
Exceptions
High level circuit elements
aliases for inputs
common utilities
high level routing
Higher-order flows
map, filter, ... | #lang racket/base
(provide (for-syntax compile-flow))
(require (for-syntax racket/base
syntax/parse
racket/match
(only-in racket/list
make-list)
"syntax.rkt"
"aux-syntax.rkt"
... |
0a1bac475adf2dfd596b69c4209cf8e5bf95e401955de3816600f5f951e8f580 | kopera/erlang-influxdb | influxdb_http.erl | -module(influxdb_http).
-export([
post/7
]).
-export_type([
result/0,
series/0
]).
-spec post(client(), binary(), string(), string(), string(), iodata(), timeout()) ->
ok
| {ok, [result()]}
| {error, {not_found, string()}}
| {error, {server_error, string()}}.
-type client() :: query | write.... | null | https://raw.githubusercontent.com/kopera/erlang-influxdb/40aba37fb6c0008bebfb12ce86413947f7eaa285/src/influxdb_http.erl | erlang | Internals | -module(influxdb_http).
-export([
post/7
]).
-export_type([
result/0,
series/0
]).
-spec post(client(), binary(), string(), string(), string(), iodata(), timeout()) ->
ok
| {ok, [result()]}
| {error, {not_found, string()}}
| {error, {server_error, string()}}.
-type client() :: query | write.... |
491a5cf3b1cb8cf5fb012c3b235b982430b01c9fe66b122da01e01337e92b6c6 | clingen-data-model/genegraph | cancervariants.clj | (ns genegraph.transform.clinvar.cancervariants
(:require [cheshire.core :as json]
[genegraph.database.names :as names :refer [prefix-ns-map]]
[genegraph.rocksdb :as rocksdb]
[genegraph.source.registry.redis :as redis]
[genegraph.transform.clinvar.common :refer [with-ret... | null | https://raw.githubusercontent.com/clingen-data-model/genegraph/a2b2d2a5e335e633afc78efa89cb46da01d9c6a1/src/genegraph/transform/clinvar/cancervariants.clj | clojure | "/"
vicc-db-name is to store the http cache, which caches the full url, params, etc,
and most of the response object.
but really all we need is the expression -> variation object cached.
each normalization function may use a slightly different expr specification, so each
should define their own key fn for how the ... | (ns genegraph.transform.clinvar.cancervariants
(:require [cheshire.core :as json]
[genegraph.database.names :as names :refer [prefix-ns-map]]
[genegraph.rocksdb :as rocksdb]
[genegraph.source.registry.redis :as redis]
[genegraph.transform.clinvar.common :refer [with-ret... |
b95f8e49ab05d50d006717ff937462c7a09be41c1038eb8195b2ba55f371a6ec | binghe/fm-plugin-tools | utils.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : FM - PLUGIN - TOOLS ; Base : 10 -*-
Copyright ( c ) 2006 - 2010 , Dr. . All rights reserved .
Copyright ( c ) 2022 , ( binghe ) . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permit... | null | https://raw.githubusercontent.com/binghe/fm-plugin-tools/7234ca4a0d6a5ab0f5fd22a69b4ecdd798f8a283/utils.lisp | lisp | Syntax : COMMON - LISP ; Package : FM - PLUGIN - TOOLS ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditio... |
Copyright ( c ) 2006 - 2010 , Dr. . All rights reserved .
Copyright ( c ) 2022 , ( binghe ) . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :fm-plugin-tools)
(defun check-plu... |
54750d73011cdddb06ff175f5bbdd7cd1870c0c24de2f79a902742da7aea650d | Vaguery/klapaucius | set_able.clj | (ns push.instructions.aspects.set-able
(:use [push.instructions.core
:only (build-instruction)]
[push.instructions.dsl]))
(defn as-set-instruction
"returns a new x-as-set instruction for a PushType"
[pushtype]
(let [typename (:name pushtype)
instruction-name (str (name typename) "-... | null | https://raw.githubusercontent.com/Vaguery/klapaucius/17b55eb76feaa520a85d4df93597cccffe6bdba4/src/push/instructions/aspects/set_able.clj | clojure | (ns push.instructions.aspects.set-able
(:use [push.instructions.core
:only (build-instruction)]
[push.instructions.dsl]))
(defn as-set-instruction
"returns a new x-as-set instruction for a PushType"
[pushtype]
(let [typename (:name pushtype)
instruction-name (str (name typename) "-... | |
12eec70eddaec342d066ea925afc0668edbf0947d433fee2b4fdb7823c3e5138 | brendanhay/gogol | Product.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/8cbceeaaba36a3c08712b2e272606161500fbe91/lib/services/gogol-admin-datatransfer/gen/Gogol/Admin/DataTransfer/Internal/Product.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Application
* ApplicationTransferParam
* ApplicationsListResponse
* DataTransfer
* DataTransfersListResponse
| Applications resources represent applications installed on the domain that support transferring ownership of user... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
9f18cde2cb0d6689e01c7db8380f016394ab96a6bc5e8b32da12c37b77471455 | korma/Korma | driver_properties.clj | (ns korma.test.integration.driver-properties
(:refer-clojure :exclude [update])
(:use clojure.test
korma.db
korma.core
[korma.test.integration.helpers :only [reset-schema]]))
(defdb mem-db (h2 {:db "mem:driver_properties"}))
(defdb mem-db-no-literals-pooled (h2 {:db "mem:driver_properties" ... | null | https://raw.githubusercontent.com/korma/Korma/6b76592dd54ba2b03c5862701c8d18a8eea8c040/test/korma/test/integration/driver_properties.clj | clojure | (ns korma.test.integration.driver-properties
(:refer-clojure :exclude [update])
(:use clojure.test
korma.db
korma.core
[korma.test.integration.helpers :only [reset-schema]]))
(defdb mem-db (h2 {:db "mem:driver_properties"}))
(defdb mem-db-no-literals-pooled (h2 {:db "mem:driver_properties" ... | |
0895f05e358c95d055a475ed0d70520b3f028fc44453fd7ddab60617eaadde2e | brianium/yoose | spec.clj | (ns brianium.yoose.async.spec
(:require [clojure.spec.alpha :as s]
[clojure.core.async.impl.protocols :refer [ReadPort WritePort Channel]]
[brianium.yoose :as yoose]
[brianium.yoose.async :as async]
[brianium.yoose.spec :as yoose-spec]))
(s/def ::chan async/chan?)
(... | null | https://raw.githubusercontent.com/brianium/yoose/c4f2892798cbdfef726ce221723c9397108e472e/src/brianium/yoose/async/spec.clj | clojure | (ns brianium.yoose.async.spec
(:require [clojure.spec.alpha :as s]
[clojure.core.async.impl.protocols :refer [ReadPort WritePort Channel]]
[brianium.yoose :as yoose]
[brianium.yoose.async :as async]
[brianium.yoose.spec :as yoose-spec]))
(s/def ::chan async/chan?)
(... | |
49b4a675241c76df58652636af81ca30f8eb40d3b1ca13774c48e47bdd96b594 | thheller/shadow | macros.clj | (ns shadow.macros
(:require [clojure.string :as str]))
(defmacro ^{:js-require 'shadow.xhr} wait
[wait-let & body]
if more than 1 result pair , combine and wait for all , otherwise just wait for the one
(if (= 2 (count wait-let))
(let [[value result] wait-let]
`(shadow.xhr/result-wait-on-success ~res... | null | https://raw.githubusercontent.com/thheller/shadow/beab6586a9782ceb3e2a4bfa2935fb8756e13d2c/src/main/shadow/macros.clj | clojure | (ns shadow.macros
(:require [clojure.string :as str]))
(defmacro ^{:js-require 'shadow.xhr} wait
[wait-let & body]
if more than 1 result pair , combine and wait for all , otherwise just wait for the one
(if (= 2 (count wait-let))
(let [[value result] wait-let]
`(shadow.xhr/result-wait-on-success ~res... | |
c116a9b161e5fb121fe7b1c83f900dbcd09abcc9d1744bb6d55e9e59aa3248d3 | compiling-to-categories/concat | Additive.hs | # LANGUAGE TypeApplications #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE CPP #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables... | null | https://raw.githubusercontent.com/compiling-to-categories/concat/48453ec7ac2129e5b44aba449e6ae063261fbde5/classes/src/ConCat/Additive.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE ConstraintKinds #
| Commutative monoid intended to be used with a multiplicative monoid
| Commutative monoid intended to be used with a multiplicative monoid
# INLINE (^+^) #
# INLINE [0] pointNI #
# INLINE [0] zipWithNI #
# INLINE (^+^) #
'Complex' /type/, rather than in... | # LANGUAGE TypeApplications #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE CPP #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE AllowAmbiguousTypes #
... |
ed4b81ca7698db0c541b78847e01bd47ed16144e0cc45ca6a1d2752a43742244 | CoNarrative/precept | app_ns.cljs | (ns precept.app-ns
(:require-macros [precept.dsl :refer [entity entities <-]])
(:require [precept.rules :refer [defsub rule define session q defquery fire-rules]]
[precept.util :as util :refer [insert!]]
[reagent.core :as reagent]
[precept.accumulators :as acc]
[prece... | null | https://raw.githubusercontent.com/CoNarrative/precept/6078286cae641b924a2bffca4ecba19dcc304dde/test/macros/cljs/precept/app_ns.cljs | clojure | (rule greater-than-500
=>
(insert! [?e :greater-than-500 true]))
(rule all-eids-greater-than-500
=>
(util/insert! [:report :eids>500 ?eids])) | (ns precept.app-ns
(:require-macros [precept.dsl :refer [entity entities <-]])
(:require [precept.rules :refer [defsub rule define session q defquery fire-rules]]
[precept.util :as util :refer [insert!]]
[reagent.core :as reagent]
[precept.accumulators :as acc]
[prece... |
623105331f752185b169f2e38d1525b97820fbfb06b31a4f58619cb41bc615df | synduce/Synduce | sum.ml | * @synduce --no - lifting
type nat =
| Z
| S of nat
type list =
| Nil
| Cons of int * list
type compressed_list =
| CNil
| CCons of nat * int * compressed_list
let rec stutter = function
| CNil -> Nil
| CCons (hdc, hdv, tl) -> repeat hdv (stutter tl) hdc
and repeat a cont = function
| Z -> cont
... | null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/compressed_list/sum.ml | ocaml | * @synduce --no - lifting
type nat =
| Z
| S of nat
type list =
| Nil
| Cons of int * list
type compressed_list =
| CNil
| CCons of nat * int * compressed_list
let rec stutter = function
| CNil -> Nil
| CCons (hdc, hdv, tl) -> repeat hdv (stutter tl) hdc
and repeat a cont = function
| Z -> cont
... | |
a4370a564a35617075b18348ab650075b30ac999d91cab8a512d64e3f88948eb | haroldcarr/learn-haskell-coq-ml-etc | Test.hs | # OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - unused - do - bind #
module Test where
import X_1_6_to_1_8_Expr
import X_2_1_Prop_Syntax
import X_2_2_Prop_Semantics
import X_2_3_Prop_Validity_Satisfiability_Tautology
import X_2_4_DeMorgan_Adequacy_Dua... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/math-and-functional-programming/2009-Handbook_of_Practical_Logic_and_Automated_Reasoning/src/Test.hs | haskell | # OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - unused - do - bind #
module Test where
import X_1_6_to_1_8_Expr
import X_2_1_Prop_Syntax
import X_2_2_Prop_Semantics
import X_2_3_Prop_Validity_Satisfiability_Tautology
import X_2_4_DeMorgan_Adequacy_Dua... | |
f0014341e1271809fc6e950acec2bbff23dcf9e6948415b1d53a617bd0891af5 | McCLIM/McCLIM | utilities.lisp | (in-package #:climi)
;;;; Early special variables
(defvar *application-frame* nil)
(defvar *pointer-documentation-output* nil)
;;; Command name utilities that are useful elsewhere.
(defun command-name-from-symbol (symbol)
(let ((name (symbol-name symbol)))
(string-capitalize
(substitute
#\Space #\-... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/d49fef5c2bb1307a006cdadfc4061e0a6b0fff79/Core/clim-core/utilities.lisp | lisp | Early special variables
Command name utilities that are useful elsewhere.
Move this early so it can be used in presentations.lisp, which comes before
commands.lisp.
Convenience macro
It's all (declare ...) | (in-package #:climi)
(defvar *application-frame* nil)
(defvar *pointer-documentation-output* nil)
(defun command-name-from-symbol (symbol)
(let ((name (symbol-name symbol)))
(string-capitalize
(substitute
#\Space #\-
(subseq name (if (string= '#:com- name :end2 (min (length name) 4))
... |
3711a7beb896b1b5fdd4812d5ee4917b1941785a03fdcc06b327ee8e3889491f | rabbitmq/rabbitmq-federation | rabbit_federation_upstream_exchange.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_federation_upstream_exchange).
-r... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-federation/960b8214487ae2495cd39afbbd3a2c4d9ea37985/src/rabbit_federation_upstream_exchange.erl | erlang |
----------------------------------------------------------------------------
This arg was introduced in the same release as this exchange type;
it must be set
Will be missing for pre-3.3.0 versions
Will be missing for pre-3.8.9 versions | 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_federation_upstream_exchange).
-rabbit_... |
5de4156f512e4296d547ac3073de8e3e2a65b7f110507fb2fcdf61d52a28270f | shiguredo/crdt | prop_crdt_orset.erl | -module(prop_crdt_orset).
-include_lib("proper/include/proper.hrl").
Model Callbacks
-export([command/1,
initial_state/0,
next_state/3,
precondition/2,
postcondition/3]).
-export([add/2,
remove/2,
merge/2]).
%%%%%%%%%%%%%%%%%%
%%% PROPERTIES %%%
%%%%%%%%%%%%%%... | null | https://raw.githubusercontent.com/shiguredo/crdt/f72a853fe452a86ed52cd4952c19bf1b2319e930/test/prop_crdt_orset.erl | erlang |
PROPERTIES %%%
MODEL %%%
@doc Initial model value at system start. Should be deterministic.
@doc List of possible commands to run against the system
@doc Determines whether a command should be valid under the
current state.
`Res' (coming from the actual system) makes sense.
@doc Assuming the postcondition f... | -module(prop_crdt_orset).
-include_lib("proper/include/proper.hrl").
Model Callbacks
-export([command/1,
initial_state/0,
next_state/3,
precondition/2,
postcondition/3]).
-export([add/2,
remove/2,
merge/2]).
prop_test() ->
?FORALL(Cmds,
command... |
d47c9087ad6989ab20719be32fc527f53a80728d058668ec5cebd5b5a56286be | kadena-io/chainweb-node | Utils.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - orphans #
-- |
Module : Chainweb . Pac... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/18fc0e71e14d312e1dfa17e94be1a0a080dc958e/src/Chainweb/Pact/Backend/Utils.hs | haskell | # LANGUAGE OverloadedStrings #
|
Stability: experimental
* General utils
pact
-------------------------------------------------------------------------- --
Utf8 Encodings
^ whether to apply module name fix
-------------------------------------------------------------------------- --
/NOTE/ that the savepoin... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - orphans #
Module : Chainweb . Pact . ChainwebPactDb
Copyright : Copyrig... |
9703911d806ad5c5666f53dc8c8ab4e2c8087cb18cc152f4b53622d98910b702 | dbmcclain/regex | packages.lisp |
(in-package "CL-USER")
(defpackage charsets
(:use useful-macros common-lisp)
(:export
#:charset
#:make-charset
#:charset-add-chars
#:charset-remove-chars
#:charset-p
#:charset-contains-char-p
#:charset-empty-p
#:charset-printform
#:concatenate-strings))
(defpackage nregex
(:use usefu... | null | https://raw.githubusercontent.com/dbmcclain/regex/c5a61079b78d45f82b981f1ef357d6c7d3d6c835/packages.lisp | lisp |
(in-package "CL-USER")
(defpackage charsets
(:use useful-macros common-lisp)
(:export
#:charset
#:make-charset
#:charset-add-chars
#:charset-remove-chars
#:charset-p
#:charset-contains-char-p
#:charset-empty-p
#:charset-printform
#:concatenate-strings))
(defpackage nregex
(:use usefu... | |
ab0aa8f3b42d261fcabe1e8a340dbfdc741a9eaa74b39f73e940fbc4c919679f | haskell/cabal | outdated-project-file.test.hs | import Test.Cabal.Prelude
main = cabalTest $ withRepo "repo" $ do
res <- cabal' "outdated" ["--v2-freeze-file", "--project-file", "variant.project"]
assertOutputContains "base" res
assertOutputDoesNotContain "template-haskell" res
assertOutputDoesNotContain "binary" res
-- Test last-one-wins behaviour.
res... | null | https://raw.githubusercontent.com/haskell/cabal/fc4daed11271630aae1954e1520f9c16be2f4cd3/cabal-testsuite/PackageTests/Outdated/outdated-project-file.test.hs | haskell | Test last-one-wins behaviour.
Test for erroring on --project-file without --v2-freeze-file | import Test.Cabal.Prelude
main = cabalTest $ withRepo "repo" $ do
res <- cabal' "outdated" ["--v2-freeze-file", "--project-file", "variant.project"]
assertOutputContains "base" res
assertOutputDoesNotContain "template-haskell" res
assertOutputDoesNotContain "binary" res
res <- cabal' "outdated" ["--v2-freeze... |
726705e3a7bef2852aceb9538ff0d2ace06f61112f0bbc591ee0a20df170b13f | yetanalytics/datasim | io.clj | (ns com.yetanalytics.datasim.io
(:require [clojure.java.io :as io]
[clojure.edn :as edn]
[com.yetanalytics.datasim.protocols :as p]
[cheshire.core :as json]))
(defn read-loc-json
"Reads in a file from the given location and parses it."
[record loc]
(try (with-open [r (io/rea... | null | https://raw.githubusercontent.com/yetanalytics/datasim/bc8c19c036c3003f3b04d73d466f10d28235a7ae/src/main/com/yetanalytics/datasim/io.clj | clojure | (ns com.yetanalytics.datasim.io
(:require [clojure.java.io :as io]
[clojure.edn :as edn]
[com.yetanalytics.datasim.protocols :as p]
[cheshire.core :as json]))
(defn read-loc-json
"Reads in a file from the given location and parses it."
[record loc]
(try (with-open [r (io/rea... | |
422dae09e188fee91e418781dcc90d4663627310919877192a9ff15e7c7f68fe | faylang/fay | calc.hs | -- | Calculator based on
--
-- Compile with
$ fay -p --html - wrapper --html - js - lib jquery.min.js examples / calc.hs
-- You also need to download jquery.min.js.
--
{-# OPTIONS -fno-warn-orphans -fno-warn-type-defaults -fno-warn-unused-do-bind #-}
{-# LANGUAGE EmptyDataDecls #-}
module Calc (main) where
import... | null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/examples/calc.hs | haskell | | Calculator based on
Compile with
html - wrapper --html - js - lib jquery.min.js examples / calc.hs
You also need to download jquery.min.js.
# OPTIONS -fno-warn-orphans -fno-warn-type-defaults -fno-warn-unused-do-bind #
# LANGUAGE EmptyDataDecls #
-----------------------------------------------------------------... |
module Calc (main) where
import FFI
import Prelude
main :: Fay ()
main = do
display <- select "<input type='text' value='' style='text-align:right'>"
operation <- newRef Nothing :: Fay (Ref (Maybe (Double -> Double)))
appendMore <- newRef False
let buttons =
[[enter 7, enter 8, ... |
eb40bb30243d739d278586604dc816a5c677522c47904e389ad76010b01d8432 | erlscripten/erlscripten | ordsets.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applic... | null | https://raw.githubusercontent.com/erlscripten/erlscripten/6b70be39dc51c21388dd7bae1eb46a0d306ecdcc/transpilation_tests/ordsets.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific l... | Copyright Ericsson AB 1996 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(ordsets).
-erlscripten_output(autogenerated_transpilation_tests).
-compile({parse_transform, erlps_parse_tr... |
8d486ce712cb30ff80fd26dcfdb4403e686081c1b68a465ba61d3da2a3479a4f | Zilliqa/scilla | StateIPCTest.ml |
This file is part of scilla .
Copyright ( c ) 2018 - present Zilliqa Research Pvt . Ltd.
scilla is free software : you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at y... | null | https://raw.githubusercontent.com/Zilliqa/scilla/011323ac5da48ee16890b71424e057ffbc4216da/tests/ipc/StateIPCTest.ml | ocaml | Use GlobalLiteral for compatibility with TypeUtil
Ignore - already sorted
New key not present in the gold file
Replace outstates with outstates' in outj.
Start a mock server (if set) at ~sock_addr and initialize server
* (external or mock server) state with ~state_json_path.
Setup a mock server within the t... |
This file is part of scilla .
Copyright ( c ) 2018 - present Zilliqa Research Pvt . Ltd.
scilla is free software : you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at y... |
34c798b398962756755619aa624478aa93c1886704b00564e6243a63e5ce4380 | elizabethsiegle/reddit-slack-bot | Twilio.hs | {-#LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-#LANGUAGE RankNTypes #-}
module Control.Monad.Twilio
( -- * The Twilio monad
Twilio
, runTwilio
, runTwilio'
* The Twilio monad transformer
, TwilioT(..)
, runTwilioT
, runTwilioT'
-- * Types
... | null | https://raw.githubusercontent.com/elizabethsiegle/reddit-slack-bot/a52ab60dcaae8e16bee8cdba22fce627157a42d8/twilio-haskell-move-to-stack/src/Control/Monad/Twilio.hs | haskell | #LANGUAGE DeriveDataTypeable #
#LANGUAGE RankNTypes #
* The Twilio monad
* Types
The Twilio monad
| Print calls .
| Print calls.
^ Account SID
^ Authentication Token
| This monad transformer allows you to make authenticated REST API requests
@m@.
^ Account SID
^ Authentication Token
instance Alternative m... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Control.Monad.Twilio
Twilio
, runTwilio
, runTwilio'
* The Twilio monad transformer
, TwilioT(..)
, runTwilioT
, runTwilioT'
, Credentials
, TwilioException(..)
) where
import Control.Applicative
import Control.Exception
im... |
0eea66564d6b9304bf3f3cfc181a002a816bafb91a87683b891414961171c301 | sharplispers/slitch | netlib-structures.lisp | ;;; netlib-structures.lisp -- networking datatypes
(in-package :netlib)
;; ============================================================
Protocol data structures
(define-unsigned u48 6)
(define-binary-vector ip-addr-octets u8 4)
(define-binary-vector mac-addr-octets u8 6)
(define-binary-struct (ip-addr (:print-f... | null | https://raw.githubusercontent.com/sharplispers/slitch/edd96fde7722ed4ce4678d7041aad69eb0762c9f/src/netlib-structures.lisp | lisp | netlib-structures.lisp -- networking datatypes
============================================================
ha = hardware address
IP header.
IP addresses are inherited from IP layer
IP addresses are inherited from IP layer
============================================================
Read syntax
Looks like this... |
(in-package :netlib)
Protocol data structures
(define-unsigned u48 6)
(define-binary-vector ip-addr-octets u8 4)
(define-binary-vector mac-addr-octets u8 6)
(define-binary-struct (ip-addr (:print-function print-ip-addr)) ()
(value nil :binary-type ip-addr-octets))
(define-binary-struct (mac-addr (:print-func... |
406e7c96bee25152f148eee3ae0d124bd4cf9c14ea1d3549afd23517b87df8db | wilkerlucio/patterny | macros.clj | (ns wilkerdev.util.macros
(:refer-clojure :exclude [test time]))
(defmacro dochan [[binding chan] & body]
`(let [chan# ~chan]
(cljs.core.async.macros/go
(loop []
(if-let [~binding (cljs.core.async/<! chan#)]
(do
~@body
(recur))
:done)))))
(defma... | null | https://raw.githubusercontent.com/wilkerlucio/patterny/e3f548cca7b99cb5ca31b0e6150fcb0958f2a356/src/cljs/wilkerdev/util/macros.clj | clojure | like the regular clojure time, but it takes advantages of javascript console
timing capabilities | (ns wilkerdev.util.macros
(:refer-clojure :exclude [test time]))
(defmacro dochan [[binding chan] & body]
`(let [chan# ~chan]
(cljs.core.async.macros/go
(loop []
(if-let [~binding (cljs.core.async/<! chan#)]
(do
~@body
(recur))
:done)))))
(defma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.