_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 |
|---|---|---|---|---|---|---|---|---|
79b3d169118a871c3e5e6f1a366f24b1f466a0ffa9c49f7145405e908e909fe3 | jvranish/TheExperiment | Expression.hs | module Language.TheExperiment.Pretty.Expression
( prettyExpression
) where
import Text.PrettyPrint.HughesPJ
import Language.TheExperiment.AST.Expression
import Language.TheExperiment.Parser.Expression
import Language.TheExperiment.Pretty.Literal
data ParenContext = NoneC | FunctionTypeC | TypeCallC
deriving ... | null | https://raw.githubusercontent.com/jvranish/TheExperiment/54ca832d2f62a928a992b4c23dadf9653d13a5a7/src/Language/TheExperiment/Pretty/Expression.hs | haskell |
a * (b * c)
a + b + c
(a +(b + c))
((a + b) + c)
| module Language.TheExperiment.Pretty.Expression
( prettyExpression
) where
import Text.PrettyPrint.HughesPJ
import Language.TheExperiment.AST.Expression
import Language.TheExperiment.Parser.Expression
import Language.TheExperiment.Pretty.Literal
data ParenContext = NoneC | FunctionTypeC | TypeCallC
deriving ... |
7504d8554e8e3cdce8fbc355ebe47876d2521202d0495172183f2f5d203c9ae5 | SonyCSLParis/fcg-hybrids | categories.lisp | Copyright 2021 Sony Computer Science Laboratories Paris
Author ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;; -2.0
;; Unless required by applicable law o... | null | https://raw.githubusercontent.com/SonyCSLParis/fcg-hybrids/2ab920bf22c1482171c678d6b11f52c0e2c536ad/languages/English/categories.lisp | lisp |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permis... | Copyright 2021 Sony Computer Science Laboratories Paris
Author ( )
distributed under the License is distributed on an " AS IS " BASIS ,
(in-package :fcg)
(defvar *english-fcg-categories* nil "FCG-categories for English grammars.")
(setf *english-fcg-categories*
CLAUSES
(clause ()
... |
8c1c744ee5e665876be199dee8d1a16ee6d678f5486d6e0e86b3aaf76ac0513e | pveber/biotk | idr.ml | open Core
type fields = string list
[@@deriving show]
let from_file from_fields fn =
try
Ok (
In_channel.read_lines fn
|> List.map ~f:(fun l ->
String.split l ~on:'\t'
|> from_fields
)
)
with exn -> Error (`Msg (Exn.to_string exn))
module Maybe_strand = struct
ty... | null | https://raw.githubusercontent.com/pveber/biotk/0906a650a324f020c9caa3377233ac3a1f217921/lib/idr.ml | ocaml | open Core
type fields = string list
[@@deriving show]
let from_file from_fields fn =
try
Ok (
In_channel.read_lines fn
|> List.map ~f:(fun l ->
String.split l ~on:'\t'
|> from_fields
)
)
with exn -> Error (`Msg (Exn.to_string exn))
module Maybe_strand = struct
ty... | |
e04919a017a400b1c03c9a453961c424504811d9129aef446315cc0ec1fa3c94 | chetmurthy/pa_ppx | pp_parsetree.ORIG.ml | (* camlp5r *)
pp_parsetree.ml , v
IFDEF BOOTSTRAP THEN
module Lexing = struct
[%%import: Lexing.position] [@@deriving show]
end
module Location = struct
[%%import: Location.t] [@@deriving show]
[%%import: 'a Location.loc] [@@deriving show]
end
module Longident = struct
[%%import: Longident.t] [@@deriving show]
end
... | null | https://raw.githubusercontent.com/chetmurthy/pa_ppx/7c662fcf4897c978ae8a5ea230af0e8b2fa5858b/base/pp_parsetree.ORIG.ml | ocaml | camlp5r | pp_parsetree.ml , v
IFDEF BOOTSTRAP THEN
module Lexing = struct
[%%import: Lexing.position] [@@deriving show]
end
module Location = struct
[%%import: Location.t] [@@deriving show]
[%%import: 'a Location.loc] [@@deriving show]
end
module Longident = struct
[%%import: Longident.t] [@@deriving show]
end
module Asttype... |
04c398293b5e8a0adf1347706dac0cd426b052874e0448b1beb7f9faa638e738 | ygrek/mldonkey | commonRoom.mli | type 'a room_impl = {
mutable impl_room_update : int;
mutable impl_room_state : CommonTypes.room_state;
mutable impl_room_val : 'a;
mutable impl_room_num : int;
mutable impl_room_ops : 'a room_ops;
}
and 'a room_ops = {
mutable op_room_close : 'a -> unit;
mutable op_room_pause : 'a -> unit;
mutable op_... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/daemon/common/commonRoom.mli | ocaml | type 'a room_impl = {
mutable impl_room_update : int;
mutable impl_room_state : CommonTypes.room_state;
mutable impl_room_val : 'a;
mutable impl_room_num : int;
mutable impl_room_ops : 'a room_ops;
}
and 'a room_ops = {
mutable op_room_close : 'a -> unit;
mutable op_room_pause : 'a -> unit;
mutable op_... | |
a41610be79cba0676bdf328b0a54403d96e13f7f8122f044455389d5b05c9070 | dyoo/brainfudge | info.rkt | #lang setup/infotab
(define name "bf: a brainf*ck compiler for Racket")
(define categories '(devtools))
(define can-be-loaded-with 'all)
(define required-core-version "5.1.1")
(define version "1.8")
(define repositories '("4.x"))
(define scribblings '(("manual.scrbl" () (getting-started))))
(define primary-file "langua... | null | https://raw.githubusercontent.com/dyoo/brainfudge/cafaa03cf710f13a2ce5f381ba17c6dfd2ef493a/info.rkt | racket | #lang setup/infotab
(define name "bf: a brainf*ck compiler for Racket")
(define categories '(devtools))
(define can-be-loaded-with 'all)
(define required-core-version "5.1.1")
(define version "1.8")
(define repositories '("4.x"))
(define scribblings '(("manual.scrbl" () (getting-started))))
(define primary-file "langua... | |
519f49a528623b13606a5d6d097cdbec216f7222d09b3c50808e0d8d8dccc090 | urbanslug/wai-devel | CmdArgs.hs | |
Module : Devel .
Description : For handling command line arguments .
Copyright : ( c ) 2015
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
We handle command line arguments for yesod devel here .
Module : Devel.Args
Description : For handling comm... | null | https://raw.githubusercontent.com/urbanslug/wai-devel/6d1c5dc7fe59f8aa3b88b91201e859af9f8a92a4/src/Devel/CmdArgs.hs | haskell | | All arguments are optional.
Default: False
Default: True | |
Module : Devel .
Description : For handling command line arguments .
Copyright : ( c ) 2015
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
We handle command line arguments for yesod devel here .
Module : Devel.Args
Description : For handling comm... |
33f4b9b76f260ba198bd848ef10e2e38e7b812e0c54a3257ec3f0795a96da93d | aitorres/firelink | ExpressionsSpec.hs | module ExpressionsSpec where
import FireLink.FrontEnd.Grammar
import FireLink.FrontEnd.Tokens
import Test.Hspec
import Utils
buildProgramWithExpr :: String -> String
buildProgramWithExpr e = "\
\ hello ashen one \
\ traveling somewhere \
\ go back with " ++ e ++ " \
\ you di... | null | https://raw.githubusercontent.com/aitorres/firelink/075d7aad1c053a54e39a27d8db7c3c719d243225/test/Parser/ExpressionsSpec.hs | haskell | module ExpressionsSpec where
import FireLink.FrontEnd.Grammar
import FireLink.FrontEnd.Tokens
import Test.Hspec
import Utils
buildProgramWithExpr :: String -> String
buildProgramWithExpr e = "\
\ hello ashen one \
\ traveling somewhere \
\ go back with " ++ e ++ " \
\ you di... | |
2650366dbc697c650cf4b7a5638d0881c592f97825b2c9b1610cbb4fdee66971 | spurious/sagittarius-scheme-mirror | %3a113.scm | (import (rnrs)
(srfi :113 sets)
(srfi :114 comparators)
(only (srfi :128 comparators) make-default-comparator)
(prefix (srfi :39) srfi:)
(clos user)
(prefix (srfi :64) srfi:)
(sagittarius control))
(srfi:test-begin "SRFI-113 Sets and bags")
(define current-test-comparator (srfi:make-parameter equal?))
(define... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/tests/srfi/%253a113.scm | scheme | entry point
(srfi:test-assert "dummy" #t)
nums is now {}
syms is now {a, b, c, d}
nums2 is now {}
esyms is now {}
syms is now {a, b, c, d, e, f}
syms is now {a, b, c, d}
end sets/simple
end sets/search
end sets/subsets
Potentially mutable
Never get a chance to be mutated
don't test xor! effect
end sets/su... | (import (rnrs)
(srfi :113 sets)
(srfi :114 comparators)
(only (srfi :128 comparators) make-default-comparator)
(prefix (srfi :39) srfi:)
(clos user)
(prefix (srfi :64) srfi:)
(sagittarius control))
(srfi:test-begin "SRFI-113 Sets and bags")
(define current-test-comparator (srfi:make-parameter equal?))
(define... |
2ebe9aaa6f68bf070daa6f2f6c783e7ffd83f9af9e018003471e41e2926e5eb4 | ocaml-multicore/parafuzz | test_basic_cas.ml | module Crowbar = Parafuzz_lib.Crowbar
let test () =
let v = Atomic.make 1 in
let cas_succedeed_for_d = ref false in
let d = Domain.spawn(fun () -> cas_succedeed_for_d := Atomic.compare_and_set v 1 2) in
let cas_succedeed = Atomic.compare_and_set v 2 3 in
Domain.join d;
if not cas_succedeed th... | null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/otherlibs/parafuzz-lib/test/test_basic_cas.ml | ocaml | module Crowbar = Parafuzz_lib.Crowbar
let test () =
let v = Atomic.make 1 in
let cas_succedeed_for_d = ref false in
let d = Domain.spawn(fun () -> cas_succedeed_for_d := Atomic.compare_and_set v 1 2) in
let cas_succedeed = Atomic.compare_and_set v 2 3 in
Domain.join d;
if not cas_succedeed th... | |
7a9702a53b7a667ff16b3f77d2be44cf98caca67570c8aa2ae147ec3f15a5ad5 | asivitz/Hickory | ObjectPicking.hs | # LANGUAGE DataKinds , PatternSynonyms , QuasiQuotes , TemplateHaskell #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE DeriveGeneric , DerivingStrategies , , , OverloadedLabels #
module Hickory.Vulkan.Forward.ObjectPicking where
import Hickory.Vulkan.Vulkan (mkAcquire, withDepthImage, with2DImageView)
import Vulk... | null | https://raw.githubusercontent.com/asivitz/Hickory/081bffda9a5e9cd0df9dec83b88dfc015ced935f/core/Hickory/Vulkan/Forward/ObjectPicking.hs | haskell | For e.g. mouse picking objects in scene
, finalLayout = IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL | # LANGUAGE DataKinds , PatternSynonyms , QuasiQuotes , TemplateHaskell #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE DeriveGeneric , DerivingStrategies , , , OverloadedLabels #
module Hickory.Vulkan.Forward.ObjectPicking where
import Hickory.Vulkan.Vulkan (mkAcquire, withDepthImage, with2DImageView)
import Vulk... |
860d75b0014fac3f1819e73c6496d2a66d3556d37ec197be5236b49af791d1ca | jeromesimeon/Galax | monitor.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/monitor/monitor.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : monitor.ml , v 1.52 2007/02/01 22:08:51 simeon Exp $
Module : Monitor .
Description :
This module is used for monitoring the activity of Galax .
Description:
This module is used for monitoring the activity of G... |
a59ac21b91f027bfaf7cd6c24e387449c2139a62c102c2456522fe7442124f02 | b0-system/b0caml | b0caml.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2019 The b0caml programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c... | null | https://raw.githubusercontent.com/b0-system/b0caml/6627cebe525575275b20c274f505d4c8dfd0ccd6/src/b0caml.mli | ocaml | * [b0caml] support.
* [b0caml] exit codes.
*
* The type for exits. Either an exit code or a command to [execv].
* [code c] is the code of [c] raises [Invalid_argument] if [c]
is [Exec].
* [conf_error] is for configuration errors.
* [miss_dep_error] is used by the [deps] subcommand to report
missing [#... | ---------------------------------------------------------------------------
Copyright ( c ) 2019 The b0caml programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c... |
3cdfaeea2f463b3bca8442d54208b3dc0b23180940ba5c615932221030e67bd8 | threatgrid/ctim | data_table.cljc | (ns ctim.schemas.data-table
(:require [ctim.lib.schema :refer [describe]]
[ctim.schemas.common :as c]
[ctim.schemas.relationship :as rel]
[ctim.schemas.vocabularies :as v]
#?(:clj [flanders.core :as f :refer [def-entity-type
... | null | https://raw.githubusercontent.com/threatgrid/ctim/2ecae70682e69495cc3a12fd58a474d4ea57ae9c/src/ctim/schemas/data_table.cljc | clojure | (ns ctim.schemas.data-table
(:require [ctim.lib.schema :refer [describe]]
[ctim.schemas.common :as c]
[ctim.schemas.relationship :as rel]
[ctim.schemas.vocabularies :as v]
#?(:clj [flanders.core :as f :refer [def-entity-type
... | |
78369d1d4357a3a722c12807b61964c4fddf606e6ab8b9e5f0a1a59c18f60386 | kubernetes-client/haskell | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent.STM
import Control.Exception.Safe
import Kubernetes.Client
import Kubernetes.OpenAPI
import Kubernetes.OpenAPI.API.AppsV1
import Kubernetes.OpenAPI.API.CoreV1
import Network.HTTP.Client
import Network.HTTP.Types.Status
import System.Environ... | null | https://raw.githubusercontent.com/kubernetes-client/haskell/e848bc0c5c8d4fe4d2c9e8555331c219814c8ec9/examples/simple/Main.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import Control.Concurrent.STM
import Control.Exception.Safe
import Kubernetes.Client
import Kubernetes.OpenAPI
import Kubernetes.OpenAPI.API.AppsV1
import Kubernetes.OpenAPI.API.CoreV1
import Network.HTTP.Client
import Network.HTTP.Types.Status
import System.Environment
import qualified Data.Map ... |
4486f3fff2e1f7ad5c046168909f2662623b07ac493ad74462a79c9097fb5121 | splittist/docxplora | workbook-editor.lisp | ;;;; workbook-editor.lisp
(in-package #:sml)
(defclass workbook-editor (workbook-writer)
((%document
:accessor workbook-editor-document)
(%sst
:accessor workbook-editor-sst
:initform nil)
(%edited-sheets
:initform nil
:accessor workbook-editor-edited-sheets)
(%sheets
:... | null | https://raw.githubusercontent.com/splittist/docxplora/32cdc8f47ed0e58e262699984244e8ef7cd1aab2/sml/workbook-editor.lisp | lisp | workbook-editor.lisp
|
(in-package #:sml)
(defclass workbook-editor (workbook-writer)
((%document
:accessor workbook-editor-document)
(%sst
:accessor workbook-editor-sst
:initform nil)
(%edited-sheets
:initform nil
:accessor workbook-editor-edited-sheets)
(%sheets
:accessor workbook-editor-ad... |
abd767ee249fe66e1fe732f221e208e74d885bcdc994bfe951d0bcaa6d5812be | footprintanalytics/footprint-web | permissions_group_test.clj | (ns metabase.models.permissions-group-test
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.permissions :as perms :refer [Permissions]]
[metabase.models.permissions-group :as perms-group :refer [PermissionsGroup]]
[metab... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/models/permissions_group_test.clj | clojure | e.g. WHERE (object || '%') LIKE '/db/1000/' | (ns metabase.models.permissions-group-test
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.permissions :as perms :refer [Permissions]]
[metabase.models.permissions-group :as perms-group :refer [PermissionsGroup]]
[metab... |
41f5ada89d1d2f6c48fe3013721f66d0eb2fec0af3297a6dbbc41144f82c2f10 | pirapira/coq2rust | rewrite.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/tactics/rewrite.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i camlp4deps: "grammar/grammar.cma" ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Pp
open Erro... |
0dc37d98196da1a90a84796fa9fd8daa429c4770f3a21ffec92f0bf431b77a60 | defunkydrummer/legochain | peertopeer.lisp | (in-package :legochain)
---------------------- PEER TO PEER STUFF------------------------------
;; Type for the data interchanged between peers.
(defparameter *el-type* 'character)
;; default host
(defparameter *default-host* #(127 0 0 1))
;; default port
(defparameter *default-port* 6667)
;; PROTOCOL: ------------... | null | https://raw.githubusercontent.com/defunkydrummer/legochain/88ed2605d8132de02f18119e529415ded93850b1/peertopeer.lisp | lisp | Type for the data interchanged between peers.
default host
default port
PROTOCOL: --------------------------------------------------
message is a lisp object (readable string).
message has the operation symbol, and the data
request complete blockchain from peer
peer replies with the whole blockchain
obtain lat... | (in-package :legochain)
---------------------- PEER TO PEER STUFF------------------------------
(defparameter *el-type* 'character)
(defparameter *default-host* #(127 0 0 1))
(defparameter *default-port* 6667)
(defparameter *operations*
))
(deftype encoded-data-type () 'string)
1 . convert to byte array usin... |
7515fb02ee01c220a6d307005b4a9fd04fae0b9a72ca9b8d3c4c8c30a942cdd5 | Gabriella439/slides | Main.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, ToJSON)
import Data.Monoid ((<>... | null | https://raw.githubusercontent.com/Gabriella439/slides/80e99f789182949bcf250088827af6986c59182a/simple-ci/src/Main.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
addComment
:: Maybe Text -> Maybe Text -> Text -> Text -> Integer -> Comment
-> ClientM Response | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeApplications #
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, ToJSON)
import Data.Monoid ((<>))
import Data.Text (Text)
import GHC.Generics (Generic)
import Network.Wai (Application)
import Servant
... |
0e43cf45b31f5040a16e3f100896546512a5aecc43bc1d951ad7fa62ae08da68 | byorgey/diagrams-play | Foo.hs | dia = (square 2 # fc red ||| circle 1 # fc blue) # bg yellow | null | https://raw.githubusercontent.com/byorgey/diagrams-play/5362c715db394be6848ff5de1bbe71178e5f173f/Foo.hs | haskell | dia = (square 2 # fc red ||| circle 1 # fc blue) # bg yellow | |
ae7e48aacea98690c675316e390e8de2c3b9eeb927202aafd468e5a2553f5181 | alanz/ghc-exactprint | TypeOperators.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverlappingInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeOperators #
-- From -12-08-type-operators.html
import Data.String
data I a = I { unI :: a }
data Var a x = Var { unK :: a }
infixr 8 +
d... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/TypeOperators.hs | haskell | # LANGUAGE OverloadedStrings #
From -12-08-type-operators.html
data (f + g) a = InL (f a) | InR (g a)
------------------------------------------------------------------------------ | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverlappingInstances #
# LANGUAGE TypeOperators #
import Data.String
data I a = I { unI :: a }
data Var a x = Var { unK :: a }
infixr 8 +
data ((f + g)) a = InL (f a) | InR (g a)
class sub :<: sup where
inj... |
47b066258e8ea7b2a1f644f6fc8515170f1956196c4a1301c6574e5f16104af1 | v-kolesnikov/sicp | 2_75.clj | (ns sicp.chapter02.2-75
(:require [sicp.common :as sicp]))
(defn apply-generic [op arg]
(arg op))
(defn real-part [x]
(apply-generic 'real-part x))
(defn imag-part [x]
(apply-generic 'imag-part x))
(defn magnitude [x]
(apply-generic 'magnitude x))
(defn angle [x]
(apply-generic 'angle x))
(defn make-f... | null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/src/sicp/chapter02/2_75.clj | clojure | (ns sicp.chapter02.2-75
(:require [sicp.common :as sicp]))
(defn apply-generic [op arg]
(arg op))
(defn real-part [x]
(apply-generic 'real-part x))
(defn imag-part [x]
(apply-generic 'imag-part x))
(defn magnitude [x]
(apply-generic 'magnitude x))
(defn angle [x]
(apply-generic 'angle x))
(defn make-f... | |
1a2563c1f5d79c43a4609468883e79c1ac1fa17335b450f53046bb320a8f58f3 | plumatic/grab-bag | nameserver.clj | (ns service.nameserver
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.error :as err]
[plumbing.logging :as log]
[plumbing.parallel :as parallel]
[plumbing.resource :as resource]
[crane.config :as config]
[store.bucket :as bucket]))
(def NameserverEntry
{:started long
:uptime... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/service/src/service/nameserver.clj | clojure | maybe is for old services
for old services, remove once everyting redeployed.
TODO: beware of clock skew | (ns service.nameserver
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.error :as err]
[plumbing.logging :as log]
[plumbing.parallel :as parallel]
[plumbing.resource :as resource]
[crane.config :as config]
[store.bucket :as bucket]))
(def NameserverEntry
{:started long
:uptime... |
8b69bec3628cad3e939d24fbd73b8bb0f0f5335a8d5ec6e9c98c11b9e577000f | cram2/cram | prove.lisp |
(in-package :prolog)
(defun rete-prove (expr &optional bdgs)
"Returns a list of bindings that satisfy the conjunction of tokens
in the sense of the rete algorithm. This function is a one-shot
request to the alpha-network and should be used where productions
that are triggered several times and do online-proce... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_core/cram_prolog/src/rete/prove.lisp | lisp | What when it does not hold? |
(in-package :prolog)
(defun rete-prove (expr &optional bdgs)
"Returns a list of bindings that satisfy the conjunction of tokens
in the sense of the rete algorithm. This function is a one-shot
request to the alpha-network and should be used where productions
that are triggered several times and do online-proce... |
31dd38f629333b3ed8920bd7037a35bd3b8a12946254c87fd17864764e0939b5 | bufferswap/ViralityEngine | stages.lisp | (in-package #:vshadow)
(defun stage-type (stage)
(varjo:stage-kind stage))
(defun stage-type->shader-type (stage-type)
(ecase stage-type
(:vertex :vertex-shader)
(:tessellation-control :tess-control-shader)
(:tessellation-evaluation :tess-evaluation-shader)
(:geometry :geometry-shader)
(:fragm... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/support/vshadow/src/stages.lisp | lisp | (in-package #:vshadow)
(defun stage-type (stage)
(varjo:stage-kind stage))
(defun stage-type->shader-type (stage-type)
(ecase stage-type
(:vertex :vertex-shader)
(:tessellation-control :tess-control-shader)
(:tessellation-evaluation :tess-evaluation-shader)
(:geometry :geometry-shader)
(:fragm... | |
6d3b0d444a4894e9e8d7509b77773236760a17b31bcda053eb84fd1c41e17a44 | well-typed/large-records | R070.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
# LANGUAGE OverloadedLabels #
# LANGUAGE RecordWildCards #
{-# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #-}
module Experiment.SetEve... | null | https://raw.githubusercontent.com/well-typed/large-records/78d0966e4871847e2c17a0aa821bacf38bdf96bc/large-records-benchmarks/bench/large-anon/Experiment/SetEvens/Sized/R070.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings #
# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #
00 .. 09 | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
# LANGUAGE OverloadedLabels #
# LANGUAGE RecordWildCards #
module Experiment.SetEvens.Sized.R070 where
import Data.Record.Anon.Simple (Record)
import qualified Data.Record.Anon.Simple as Anon
import Bench.EvensOfSize.Evens070
import Common.RowOfSize.Row070
s... |
257a50a50fb9a9044314c52b958ef4493e3ebcf9bb111e0ffcc64b62463d9c18 | ocaml-jupyter/jupyter-kernel | Base64.mli | val encode : string -> string
val decode : string -> string
| null | https://raw.githubusercontent.com/ocaml-jupyter/jupyter-kernel/a67f94522e2c5cb7248aed8b602d160d26e69825/src/Base64.mli | ocaml | val encode : string -> string
val decode : string -> string
| |
4ccfe16b82d625482dc16bd09bcf2be514039d6b7623ef0f82fbb1a5bbb16c8d | craigfe/brands | spec.ml | open Scaffold
let () =
v ~this_file:__FILE__ ~libraries:[ "brands" ] ~ppx:"ppx_brands"
[ ("ppx_brands", ppx_tests ~styler:"ocamlformat --impl -" ()) ]
|> declare
| null | https://raw.githubusercontent.com/craigfe/brands/9054197120a4f1acdfd6937a31d7097014000f67/test/spec.ml | ocaml | open Scaffold
let () =
v ~this_file:__FILE__ ~libraries:[ "brands" ] ~ppx:"ppx_brands"
[ ("ppx_brands", ppx_tests ~styler:"ocamlformat --impl -" ()) ]
|> declare
| |
fb52be5967117edf796af82aa8726a451314f627ebc527cb63ba8e9aba738781 | tnelson/Forge | expander.rkt | #lang racket
(require (except-in forge/lang/expander
ParagraphClass TestDeclClass TestBlockClass TestExpectDeclClass ExampleDeclClass
AlloyModule TestDecl TestExpectDecl ExampleDecl
test example))
(require (only-in forge/testme/library test example))
(requir... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/testme/lang/expander.rkt | racket | (pattern decl:BreakDeclClass)
(pattern decl:InstanceDeclClass)
(pattern decl:QueryDeclClass)
(pattern decl:TransitionDeclClass)
TestDecl : (Name /COLON-TOK)? Parameters? (QualName | Block)? Scope? (/FOR-TOK Bounds)? /IS-TOK (SAT-TOK | UNSAT-TOK)
TestDecl : (Name /COLON-TOK)? Parameters? (QualName | Block)? Scope?... | #lang racket
(require (except-in forge/lang/expander
ParagraphClass TestDeclClass TestBlockClass TestExpectDeclClass ExampleDeclClass
AlloyModule TestDecl TestExpectDecl ExampleDecl
test example))
(require (only-in forge/testme/library test example))
(requir... |
05f9c3e7729a4d9813200ea127512ea29c71a03d96347146f8c90e892f79c315 | heechul/crest-z3 | llvmutils.ml | Copyright ( c ) 2008 Intel Corporation
* All rights reserved .
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* Redistributions of source code must retain the above copyright
* notice , th... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/ext/llvmutils.ml | ocaml | A few useful predicate / accessor functions - the accessor functions raise Bug
when the argument isn't as expected
Type predicates
Extract information from types
The index of field fi within its structure
Reduce a constant expression to its integer value - fail if it isn't possible
Return the &e expressio... | Copyright ( c ) 2008 Intel Corporation
* All rights reserved .
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* Redistributions of source code must retain the above copyright
* notice , th... |
5527c0084835f5839b8439a87f4f51603489cad9224702656371c4b5d3b39fb2 | chiroptical/optics-by-example | Main.hs | module Main where
import Lib
main :: IO ()
main = putStrLn "chapter 1"
| null | https://raw.githubusercontent.com/chiroptical/optics-by-example/3ee33546ee18c3a6f5510eec17a69d34e750198e/chapter2/app/Main.hs | haskell | module Main where
import Lib
main :: IO ()
main = putStrLn "chapter 1"
| |
917cf5e00992423e14604912f288c46d6d37bfe80c24c33f94d63421d9ea5615 | open-company/open-company-web | invite_picker_modal.cljs | (ns oc.web.components.invite-picker-modal
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.lib.jwt :as jwt]
[oc.web.router :as router]
[oc.web.dispatcher :as dis]
[oc.web.actions.org :as org-actions]
[oc.web.actions.te... | null | https://raw.githubusercontent.com/open-company/open-company-web/246cccb2818cc3bb9f05adeea4364ffa7171a586/src/main/oc/web/components/invite_picker_modal.cljs | clojure | if team has a bot installed | (ns oc.web.components.invite-picker-modal
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.lib.jwt :as jwt]
[oc.web.router :as router]
[oc.web.dispatcher :as dis]
[oc.web.actions.org :as org-actions]
[oc.web.actions.te... |
30e066bb3f08e9b8c75fdb32aa54c16c43122c5faa4471c61cf52763a4b716b2 | ocurrent/solver-service | git_context.mli | include Opam_0install.S.CONTEXT
val read_packages :
?acc:OpamFile.OPAM.t OpamPackage.Version.Map.t OpamPackage.Name.Map.t ->
Git_unix.Store.t ->
Git_unix.Store.Hash.t ->
OpamFile.OPAM.t OpamPackage.Version.Map.t OpamPackage.Name.Map.t Lwt.t
(** [read_packages store commit] is an index of the opam files in [sto... | null | https://raw.githubusercontent.com/ocurrent/solver-service/6b9d62dedcc2d7eddbab523ad7a1a621fef3e6c5/service/git_context.mli | ocaml | * [read_packages store commit] is an index of the opam files in [store] at
[commit]. | include Opam_0install.S.CONTEXT
val read_packages :
?acc:OpamFile.OPAM.t OpamPackage.Version.Map.t OpamPackage.Name.Map.t ->
Git_unix.Store.t ->
Git_unix.Store.Hash.t ->
OpamFile.OPAM.t OpamPackage.Version.Map.t OpamPackage.Name.Map.t Lwt.t
val create :
?test:OpamPackage.Name.Set.t ->
?pins:(OpamPackage.V... |
8489ae8f94a35e65bf04fa8f5373c600fbf0818a4a477fc5b263df4d2c494339 | anwarmamat/cmsc330spring19-public | testUtils.ml | open P4.Nfa
open P4.Regexp
open OUnit2
let re_to_str r =
let surround l = ("(" :: l) @ [")"] in
let rec r2str = function
| Empty_String -> ["E"]
| Char c -> [String.make 1 c]
| Union (r1, r2) ->
let l1 = surround @@ r2str r1 and l2 = surround @@ r2str r2 in
l1 @ ("|" :: l2)
| Concat... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330spring19-public/98af1e8efc3d8756972731eaca19e55fe8febb69/project4/test/testUtils.ml | ocaml | Helpers for clearly testing the accept function | open P4.Nfa
open P4.Regexp
open OUnit2
let re_to_str r =
let surround l = ("(" :: l) @ [")"] in
let rec r2str = function
| Empty_String -> ["E"]
| Char c -> [String.make 1 c]
| Union (r1, r2) ->
let l1 = surround @@ r2str r1 and l2 = surround @@ r2str r2 in
l1 @ ("|" :: l2)
| Concat... |
56c997672178ec63ba7648a51c714431885a2a5fefb576acf5a0d5058669b022 | racket/math | flonum-log1pmx.rkt | #lang typed/racket/base
(require "flonum-functions.rkt"
"flonum-polyfun.rkt"
"flonum-log.rkt"
"../polynomial/chebyshev.rkt")
(provide fllog1pmx)
(define fllog1pmx-neg-0.25-0.5
(inline-chebyshev-flpoly-fun
-0.5 -0.25
(-0.2103141053572070997362823489693816811996
0.077041028867287... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/flonum/flonum-log1pmx.rkt | racket | #lang typed/racket/base
(require "flonum-functions.rkt"
"flonum-polyfun.rkt"
"flonum-log.rkt"
"../polynomial/chebyshev.rkt")
(provide fllog1pmx)
(define fllog1pmx-neg-0.25-0.5
(inline-chebyshev-flpoly-fun
-0.5 -0.25
(-0.2103141053572070997362823489693816811996
0.077041028867287... | |
4a0923095ab0d9f7c987362ed6a29254ae95ff8e07382f1c7525aade3907eb20 | turquoise-hexagon/euler | solution.scm | (import
(euler))
(define (solve n)
(digitsum n))
(let ((_ (solve (factorial 100))))
(print _) (assert (= _ 648)))
| null | https://raw.githubusercontent.com/turquoise-hexagon/euler/592c5f4f45fe8e8b82102be9fe11b3b1134d98fc/src/020/solution.scm | scheme | (import
(euler))
(define (solve n)
(digitsum n))
(let ((_ (solve (factorial 100))))
(print _) (assert (= _ 648)))
| |
cf1440028e3d1b4f753e55bba6638e3f91f40877dfce34f821389885796ffc7c | haskell/hie-bios | Main.hs |
import System.Directory (getCurrentDirectory)
main = return () | null | https://raw.githubusercontent.com/haskell/hie-bios/1875bff093983a0506f80e214eda27e7419da3bc/tests/projects/multi-cabal/app/Main.hs | haskell |
import System.Directory (getCurrentDirectory)
main = return () | |
5e9e892e7b4a74872819f2bda74e34676009cc469dd3772df1b9d1016b0d5037 | realworldocaml/examples | basic_md5.ml | open Core.Std
let do_hash file =
In_channel.with_file file ~f:(fun ic ->
let open Cryptokit in
hash_channel (Hash.md5 ()) ic
|> transform_string (Hexa.encode ())
|> print_endline
)
part 1
let spec =
let open Command.Spec in
empty
+> anon ("filename" %: string)
part 2
let command =
Com... | null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/command-line-parsing/basic_md5.ml | ocaml | open Core.Std
let do_hash file =
In_channel.with_file file ~f:(fun ic ->
let open Cryptokit in
hash_channel (Hash.md5 ()) ic
|> transform_string (Hexa.encode ())
|> print_endline
)
part 1
let spec =
let open Command.Spec in
empty
+> anon ("filename" %: string)
part 2
let command =
Com... | |
b3f0f9124b0c14629bf1b3d15cab6971ae878d5faebc4e4baa614df9e2041eba | kudu-dynamics/blaze | BinaryNinjaSpec.hs | # OPTIONS_GHC -fno - warn - incomplete - uni - patterns #
HLINT ignore " Redundant do "
module Blaze.Import.Source.BinaryNinjaSpec where
import qualified Binja.BasicBlock as BNBb
import qualified Binja.Core as BN
import qualified Binja.Function as BNFunc
import Blaze.Cfg (BranchType (FalseBranch, TrueBranch, Uncon... | null | https://raw.githubusercontent.com/kudu-dynamics/blaze/2220a07d372a817e79525ec2707984b189fe98c9/test/binja/Blaze/Import/Source/BinaryNinjaSpec.hs | haskell | # OPTIONS_GHC -fno - warn - incomplete - uni - patterns #
HLINT ignore " Redundant do "
module Blaze.Import.Source.BinaryNinjaSpec where
import qualified Binja.BasicBlock as BNBb
import qualified Binja.Core as BN
import qualified Binja.Function as BNFunc
import Blaze.Cfg (BranchType (FalseBranch, TrueBranch, Uncon... | |
3d3bd9ef8456523d4b9d2123b3bb6aa6c24c012144de3910d894a2131aa9fd66 | clojusc/ltest | core.clj | (ns ltest.core
(:require
[ltest.reporter :as reporter]
[ltest.runner :as runner]
[ltest.styles :as styles]
[ltest.util :as util]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
utility functions ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ... | null | https://raw.githubusercontent.com/clojusc/ltest/e82073d830e0e66018bbd6c98f49b0617cd2fa88/ltest/src/ltest/core.clj | clojure |
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
Test-running functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Tagged-test-running functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| (ns ltest.core
(:require
[ltest.reporter :as reporter]
[ltest.runner :as runner]
[ltest.styles :as styles]
[ltest.util :as util]))
(defn unit-ns
[re]
(util/filtered-tagged-ns re :unit))
(defn integration-ns
[re]
(util/filtered-tagged-ns re :integration))
(defn system-ns
[re]
(util/filt... |
f3ad298227122539823835b2027247c1f0e9772c8e7650ed2cd51400fbf1bdaf | SamB/coq | egrammar.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/parsing/egrammar.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
************************************... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ Id$
open Pp
open Util
... |
4fb2d69f65e6201b2ca8125dd5dc7b00265513acd1a5147c958bba18af695812 | vibrato-team/vibrato-programming-language | FunctionSpec.hs | module FunctionSpec where
import Test.Hspec
import Frontend.Lexer
import Utils
import Frontend.Tokens
spec :: Spec
spec = describe "Lexer.Functions" $ do
it "accepts `track f(n: quarter): half` as a valid Function Token List" $ do
let x = "track f(n: quarter): half"
let atok = getTok $ runAlexSca... | null | https://raw.githubusercontent.com/vibrato-team/vibrato-programming-language/f6d98c2686604a91cd99307bc3fdc06828c7f538/test/lexer/FunctionSpec.hs | haskell | module FunctionSpec where
import Test.Hspec
import Frontend.Lexer
import Utils
import Frontend.Tokens
spec :: Spec
spec = describe "Lexer.Functions" $ do
it "accepts `track f(n: quarter): half` as a valid Function Token List" $ do
let x = "track f(n: quarter): half"
let atok = getTok $ runAlexSca... | |
f56d909e749f38ab42c8f2e7fb40f31ba3a794c6b68b33a9f5bcb25b0e01b5b4 | clojars/clojars-web | error_api.clj | (ns clojars.web.error-api
(:require
[cheshire.core :as json]
[clojars.web.common :refer [xml-escape]]
[clojure.xml :as xml]))
(defn error-api-response [error-options error-id]
(let [defaults {:status 500}
options (merge defaults error-options)]
(if (= :xml (:format options))
{:status (:s... | null | https://raw.githubusercontent.com/clojars/clojars-web/22f831c9e8749ac7933af48655764ad5f5bdc3e8/src/clojars/web/error_api.clj | clojure | (ns clojars.web.error-api
(:require
[cheshire.core :as json]
[clojars.web.common :refer [xml-escape]]
[clojure.xml :as xml]))
(defn error-api-response [error-options error-id]
(let [defaults {:status 500}
options (merge defaults error-options)]
(if (= :xml (:format options))
{:status (:s... | |
0c071a2f624064f4f769ab7317b9cadad171a93824da0dbd9643226c64a345ab | fragnix/fragnix | Digit.hs | module Digit where
import {-# SOURCE #-} FoldableDigit ()
import {-# SOURCE #-} FunctorDigit ()
import {-# SOURCE #-} SizedDigit ()
data Digit a = One a
| Two a a
| Three a a a
| Four a a a a | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/quick/InstancePropagation/Digit.hs | haskell | # SOURCE #
# SOURCE #
# SOURCE # | module Digit where
data Digit a = One a
| Two a a
| Three a a a
| Four a a a a |
34cbf2a7e88b9eae970b64839f403f7bd96c1fd97523f8fbc67bf1328bb5d7f1 | racket/redex | verification-test.rkt | #lang racket
(require redex/reduction-semantics)
(require "grammar.rkt" "verification.rkt")
;; trim test cases: just test length-related stuff
;; the contents of the stack itself may be completely bogus
(test-equal (term (trim invalid ())) (term invalid))
(test-equal (term (trim (uninit imm box imm-nc box-nc not) (un... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-examples/redex/examples/racket-machine/verification-test.rkt | racket | trim test cases: just test length-related stuff
the contents of the stack itself may be completely bogus
let-one
application
self-app
seq
install-value
let-void
box-env
lam
proc-const
branch
let-rec
ignored? properly maintained
ref args
case-lam
literals | #lang racket
(require redex/reduction-semantics)
(require "grammar.rkt" "verification.rkt")
(test-equal (term (trim invalid ())) (term invalid))
(test-equal (term (trim (uninit imm box imm-nc box-nc not) (uninit imm box imm-nc box-nc not)))
(term (uninit imm box imm-nc box-nc not)))
(test-equal (term (tri... |
be1aadf8c81a2035ff3e4d3db3ab1aca2c7dc2e5886993dfa84591b86241ae7b | brendanhay/terrafomo | Resources.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
Module : . . Resources
Copyright : ( c ) 2017 - 2018
License : Mozil... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-centurylinkcloud/gen/Terrafomo/CenturyLinkCloud/Resources.hs | haskell | This module is auto-generated.
|
Stability : auto-generated
* clc_group
* clc_load_balancer_pool
* clc_public_ip
| The main @clc_group@ resource definition.
^ @custom_fields@
- (Optional)
^ @description@
- (Optional)
- (Required)
^ @name@
- (Required)
^ @parent@
- (Required)
s Text
s Text
Expr... |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
Module : . . Resources
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintain... |
05ea7f47c6d64a2eb20ff18468b4cbaa3c779a76d2a157d0f1f059bee8d0d38e | lemmaandrew/CodingBatHaskell | firstTwo.hs | From
Given a string , return the string made of its first two chars , so the \"Hello\ "
yields \"He\ " . If the string is shorter than length 2 , return whatever there is , so \"X\ "
yields \"X\ " , and the empty string \"\ " yields the empty string \"\ " . Note that str.length ( )
returns the length of a s... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/String-1/firstTwo.hs | haskell | From
Given a string , return the string made of its first two chars , so the \"Hello\ "
yields \"He\ " . If the string is shorter than length 2 , return whatever there is , so \"X\ "
yields \"X\ " , and the empty string \"\ " yields the empty string \"\ " . Note that str.length ( )
returns the length of a s... | |
75fb9763bca7e22a327dedd68911d68c73841aae0eba21429eb584d68fd51aff | silky/myth | list_rev_snoc.ml | type nat =
| O
| S of nat
type list =
| Nil
| Cons of nat * list
let snoc : list -> nat -> list =
let rec f (l:list) : nat -> list =
fun (n:nat) ->
match l with
| Nil -> Cons (n, Nil)
| Cons (x, xs) -> Cons (x, f xs n)
in
f
;;
let list_rev_snoc : list -> list |>
{ [] => []
|... | null | https://raw.githubusercontent.com/silky/myth/b631edefb2a27a1d731daa6654517d91ca660b95/tests/pldi-2015-benchmarks/list_rev_snoc.ml | ocaml | type nat =
| O
| S of nat
type list =
| Nil
| Cons of nat * list
let snoc : list -> nat -> list =
let rec f (l:list) : nat -> list =
fun (n:nat) ->
match l with
| Nil -> Cons (n, Nil)
| Cons (x, xs) -> Cons (x, f xs n)
in
f
;;
let list_rev_snoc : list -> list |>
{ [] => []
|... | |
3e8da2ec967218193f11288d430b8aacbd6991ab55838f59a6a242b1b9aa6f93 | haskell-tools/haskell-tools | GenerateTypeSig.hs | module Refactors.GenerateTypeSig where
import Data.List
import Data.Ord (comparing)
data HTree a = Leaf a | Branch (HTree a) (HTree a)
deriving Show
-- TODO: use [Ctrl, Alt and/or Shift + S] to generate the type signature of the function
Bonus : do the same to the two local definitions ( hint : i... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/demo/website/res/Refactors/GenerateTypeSig.hs | haskell | TODO: use [Ctrl, Alt and/or Shift + S] to generate the type signature of the function
source: / | module Refactors.GenerateTypeSig where
import Data.List
import Data.Ord (comparing)
data HTree a = Leaf a | Branch (HTree a) (HTree a)
deriving Show
Bonus : do the same to the two local definitions ( hint : if struck try to generate the signature of htree first )
| Huffman encoding
huffman fre... |
5c7d9c73b15a397eb8c82bdc854ee8bbf82919287b36881dec1aaf2f32f5e079 | travisbrady/flajolet | hyperloglog.ml | open Core.Std
external clz: int -> int = "caml_clz"
external clzl: int64 -> int = "caml_clzl"
type t = {
p: int;
alpha: float;
m: int;
mf: float;
m64: int64;
vec: int array
}
let log2 x = (log x) /. (log 2.0)
let get_alpha p =
match p with
| 4 -> 0.673
| 5 ->... | null | https://raw.githubusercontent.com/travisbrady/flajolet/a6c530bf1dd73b9fa8b7185d84a5e20458a3d8af/lib/hyperloglog.ml | ocaml | open Core.Std
external clz: int -> int = "caml_clz"
external clzl: int64 -> int = "caml_clzl"
type t = {
p: int;
alpha: float;
m: int;
mf: float;
m64: int64;
vec: int array
}
let log2 x = (log x) /. (log 2.0)
let get_alpha p =
match p with
| 4 -> 0.673
| 5 ->... | |
37f6e7de2c6e46d82af4501018f065306f32bf88bb3ddc84db9fb68f18bfe4bd | aistrate/Okasaki | BankersQueue.hs | -- Source code from
-- Purely Functional Data Structures
Cambridge University Press , 1998
--
Copyright ( c ) 1998 Cambridge University Press
module BankersQueue (module Queue, BankersQueue) where
import Prelude hiding (head,tail)
import Queue
data BankersQueue a = BQ Int [a] Int [a]
check lenf... | null | https://raw.githubusercontent.com/aistrate/Okasaki/cc1473c81d053483bb5e327409346da7fda10fb4/Original/BankersQueue.hs | haskell | Source code from
Purely Functional Data Structures
|
Cambridge University Press , 1998
Copyright ( c ) 1998 Cambridge University Press
module BankersQueue (module Queue, BankersQueue) where
import Prelude hiding (head,tail)
import Queue
data BankersQueue a = BQ Int [a] Int [a]
check lenf f lenr r =
if lenr <= lenf then BQ lenf f lenr r
... |
efa504f413afa3ffc3b2d244bb30dbfe69d539c1b8cd998cfd9e0951dab24d20 | Frama-C/Frama-C-snapshot | va_types.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/variadic/va_types.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
658a4f50aa348d77cebca4111ab38d7baaa7b16c3cf513c05f2a01e11ca7e073 | appleby/Lisp-In-Small-Pieces | book.scm | $ I d : book.scm , v 1.6 1996/02/11 14:09:30 queinnec Exp $
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is derived from the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambr... | null | https://raw.githubusercontent.com/appleby/Lisp-In-Small-Pieces/af4139232bb7170f32470774a92d647e83254721/common/book.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is derived from the files that accompany the book:
The original sources can be downloaded from the author's website at
-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html
This file may have been altered from the original in order to... | $ I d : book.scm , v 1.6 1996/02/11 14:09:30 queinnec Exp $
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge University Press ) .
By Christian Queinnec < >
(load-relative "common/definitions.scm")
(load-relative "common/additional-libs.scm")
... |
6a7ed229ebf209a32d90d7e11dba8ca4a8b79b39e0fbd3916567ee62aed90d23 | tarides/dune-release | upload_response.ml | let gh_v3_api_DR_example =
{|
{
"url":"-release-testing/releases/assets/12789323",
"id":12789323,
"node_id":"MDEyOlJlbGVhc2VBc3NldDEyNzg5MzIz",
"name":"dummy-v0.0.0.tbz",
"label":"",
"uploader":{
"login":"NathanReb",
"id":7419360,
"node_id":"MDQ6VXNlcjc0MTkzNjA=",
"avatar_url":"",
"gra... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/tests/lib/upload_response.ml | ocaml | let gh_v3_api_DR_example =
{|
{
"url":"-release-testing/releases/assets/12789323",
"id":12789323,
"node_id":"MDEyOlJlbGVhc2VBc3NldDEyNzg5MzIz",
"name":"dummy-v0.0.0.tbz",
"label":"",
"uploader":{
"login":"NathanReb",
"id":7419360,
"node_id":"MDQ6VXNlcjc0MTkzNjA=",
"avatar_url":"",
"gra... | |
a1ea6700e76ff960729cb622a63508634beeacef62cfc0eace85fe67fab69c08 | tomhanika/conexp-clj | incremental_ganter.clj | ;; Copyright ⓒ the conexp-clj developers; all rights reserved.
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bou... | null | https://raw.githubusercontent.com/tomhanika/conexp-clj/5e4c15697f06446f925f53d1d143528155d7dd3a/src/main/clojure/conexp/fca/incremental_ganter.clj | clojure | Copyright ⓒ the conexp-clj developers; all rights reserved.
The use and distribution terms for this software are covered by the
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not re... | Eclipse Public License 1.0 ( -1.0.php )
(ns conexp.fca.incremental-ganter
"Implements algorithms from
'Attribute-incremental construction of the canonical
-007-9057-2 "
(:require [conexp.base :refer :all]
[conexp.fca.implications :refer :all]
[conexp.fca.contexts :refer :all]))
(d... |
7f7ab81b46c5c02c22ea217141417facc820a75a9d30678ae2b2771feee3f7c5 | AlexKnauth/reprovide-lang | this-expression-source-file.rkt | #lang racket/base
(provide this-expression-source-file)
(require (only-in
racket/private/this-expression-source-directory
this-expression-source-file))
| null | https://raw.githubusercontent.com/AlexKnauth/reprovide-lang/8c3c912d200eec45d22fc267d151fb1939471b49/reprovide-lang-lib/reprovide/require-transformer/private/this-expression-source-file.rkt | racket | #lang racket/base
(provide this-expression-source-file)
(require (only-in
racket/private/this-expression-source-directory
this-expression-source-file))
| |
c3ec39a56cc5208666a910d591661a2b624dcb8be01beb385bd98a407d846a37 | Gadjib/ocamlhomeworks | p2.ml | open String;;
let f = open_in "file.txt";;
let rec v_read_file n =
try
let x = input_line f in if length n < length x then v_read_file x else v_read_file n
with
End_of_file -> n
;;
let s = v_read_file "";;
print_string s;;
close_in f;;
print_newline();; | null | https://raw.githubusercontent.com/Gadjib/ocamlhomeworks/d5568d4830d4306ea56749f17af355bc35001eff/9%20%D0%BA%D0%BB%D0%B0%D1%81%D1%81/1%20%D1%87%D0%B5%D1%82%D0%B2%D0%B5%D1%80%D1%82%D1%8C/HW%20to%2028-09-2019/p2.ml | ocaml | open String;;
let f = open_in "file.txt";;
let rec v_read_file n =
try
let x = input_line f in if length n < length x then v_read_file x else v_read_file n
with
End_of_file -> n
;;
let s = v_read_file "";;
print_string s;;
close_in f;;
print_newline();; | |
54dce3b417e5e2cb95ec7e93b7cd8b0f2ae8b015b0b1a07091a583d63224a00c | Apress/practical-ocaml | command_line.ml | (** Command Line Utility for Bayesian Spam Library *)
* first we set up some variable that can be
changed
changed *)
let spamfile = ref "";;
let hamfile = ref "";;
let input_file = ref stdin;;
let training_ham = ref false;;
let training_spam = ref false;;
(** our simple usage message *)
let usage_msg... | null | https://raw.githubusercontent.com/Apress/practical-ocaml/c0f1e36283eb0e495ff8db7f2a88cadbf1a3d49e/Chapter14/command_line.ml | ocaml | * Command Line Utility for Bayesian Spam Library
* our simple usage message
* Here we use the arg module to parse the command line and
set the appropriate variables
* Then run |
* first we set up some variable that can be
changed
changed *)
let spamfile = ref "";;
let hamfile = ref "";;
let input_file = ref stdin;;
let training_ham = ref false;;
let training_spam = ref false;;
let usage_msg = "spam [-spam <SPAMFILE>|-ham <HAMFILE>]
[-t TESTFILE] [-v (verbose mode)]";;
le... |
19367acc7d36b814a2641b87384e5a60a61dd01e17122dc058341c792980d033 | arenadotio/sentry-ocaml | dsn.mli | open Core
type t' = private
{ uri : Uri.t
; public_key : string
; private_key : string option
; project_id : int
}
[@@deriving compare, sexp_of]
type t = t' option [@@deriving sexp_of]
val make
: uri:Uri.t
-> public_key:string
-> ?private_key:string
-> project_id:int
-> unit
-> t
* [ default ... | null | https://raw.githubusercontent.com/arenadotio/sentry-ocaml/ed103dca16816fee058904f595ccdc09d9d3b79f/src/dsn.mli | ocaml | * [of_uri dsn] is like [of_string dsn] but takes a [Uri.t]
* [arg] is a Command.Spec argument type which calls [of_string]
* Like [arg] but uses [of_string_exn]
* [event_store_uri] is the URI we should POST Sentry events to | open Core
type t' = private
{ uri : Uri.t
; public_key : string
; private_key : string option
; project_id : int
}
[@@deriving compare, sexp_of]
type t = t' option [@@deriving sexp_of]
val make
: uri:Uri.t
-> public_key:string
-> ?private_key:string
-> project_id:int
-> unit
-> t
* [ default ... |
997782df97ba4dabb23574ae296ec2320173c9e93868c1b8a110a686fbf479bc | faylang/fay | R.hs | module ModuleRecordClash.R where
import Prelude
i :: Double
i = 1
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/ModuleRecordClash/R.hs | haskell | module ModuleRecordClash.R where
import Prelude
i :: Double
i = 1
| |
6a2b23cdc5cf06483c15e77a7458ee8ab9ea8da691468803a3137519bbcc2e85 | panda-planner-dev/ipc2020-domains | p-11.lisp | (defproblem problem domain
(
(visible waypoint0 waypoint4)
(visible waypoint4 waypoint0)
(visible waypoint0 waypoint7)
(visible waypoint7 waypoint0)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint1 waypoint5)
(visible waypoint5 waypoint1)
(visible way... | null | https://raw.githubusercontent.com/panda-planner-dev/ipc2020-domains/9adb54325d3df35907adc7115fcc65f0ce5953cc/partial-order/Rover/other/SHOP2/p-11.lisp | lisp | (defproblem problem domain
(
(visible waypoint0 waypoint4)
(visible waypoint4 waypoint0)
(visible waypoint0 waypoint7)
(visible waypoint7 waypoint0)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint1 waypoint5)
(visible waypoint5 waypoint1)
(visible way... | |
dad363364ad8cca124a599351fc69e166d63856a3733f759f274653d0afb140a | untangled-web/untangled-client | local_storage_io_spec.cljs | (ns untangled.services.local-storage-io-spec
(:require-macros [cljs.test :refer (is deftest run-tests testing)]
[untangled-spec.core :refer (specification behavior provided assertions with-timeline async tick)])
(:require [cljs.test :refer [do-report]]
untangled-spec.stub
... | null | https://raw.githubusercontent.com/untangled-web/untangled-client/d9b350db3a5e19910692ee70281d8c156fd3a3f9/spec/untangled/services/local_storage_io_spec.cljs | clojure | (ns untangled.services.local-storage-io-spec
(:require-macros [cljs.test :refer (is deftest run-tests testing)]
[untangled-spec.core :refer (specification behavior provided assertions with-timeline async tick)])
(:require [cljs.test :refer [do-report]]
untangled-spec.stub
... | |
68b332460cc4804c86305f3dcce1eeb0f69b59914c04ab73b1008d986007cfaf | sheyll/mediabus | OrderedBy.hs | -- | Value level 'Ord'er. Sometimes values stored in e.g. 'Data.Set.Set's have
-- an 'Ord' instance, which does not represent the desired order. In that case
-- use this product type to pass a value along with the value to be for
comparison by the ' Eq ' and ' ' instances .
module Data.MediaBus.Basics.OrderedBy
( ... | null | https://raw.githubusercontent.com/sheyll/mediabus/defe0e2c7bfa21b98b8daf8d7f6bcb221e080f3e/src/Data/MediaBus/Basics/OrderedBy.hs | haskell | | Value level 'Ord'er. Sometimes values stored in e.g. 'Data.Set.Set's have
an 'Ord' instance, which does not represent the desired order. In that case
use this product type to pass a value along with the value to be for
| A wrapper around a /payload/ value paired with a value to be used when /comparing/ that paylo... | comparison by the ' Eq ' and ' ' instances .
module Data.MediaBus.Basics.OrderedBy
( OrderedBy (..),
)
where
data OrderedBy cmp a
= MkOrderedBy
orderedByComparableValue :: cmp,
orderedByValue :: a
}
instance Eq cmp => Eq (OrderedBy cmp a) where
MkOrderedBy cmpa _ == MkOrderedBy cmpb _... |
4f636a72b6cebf0a9c63308eff1be5cb0f1d0254a7a20cc6242e810a5b75b478 | jrm-code-project/LISP-Machine | mite.lisp | -*- Mode : LISP ; Package : USER ; : CL ; -*-
(defvar *source-files* ())
;; run load-source-files on a lambda.
(defun load-source-files (&optional (f "dj:release.reports;mit-explorer-release.text"))
(with-open-file (stream f)
(setq *source-files* nil)
(do ((line))
((null (setq line (readline ... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/gjcx/mite.lisp | lisp | Package : USER ; : CL ; -*-
run load-source-files on a lambda.
)) |
(defvar *source-files* ())
(defun load-source-files (&optional (f "dj:release.reports;mit-explorer-release.text"))
(with-open-file (stream f)
(setq *source-files* nil)
(do ((line))
((null (setq line (readline stream nil))))
(cond ((zerop (string-length line)))
('else
... |
f1ee1b90d4b197810beec79cb6ba322ec72ebea0b2db391fa7d2c76deb0ec755 | Shadytel/osmo_ss7 | sua_codec_tests.erl | -module(sua_codec_tests).
-author('Harald Welte <>').
-include_lib("eunit/include/eunit.hrl").
-include("xua.hrl").
-include("sua.hrl").
-define(MSG_ENC, <<1,0,7,1,0,0,0,208,0,6,0,8,0,0,0,3,1,21,0,8,0,0,0,1,1,2,0,44,0,1,0,7,128,1,0,20,0,0,0,4,12,0,1,4,68,119,121,7,22,0,0,0,128,2,0,8,0,0,8,21,128,3,0,8,0,0,0,7,1,3,0... | null | https://raw.githubusercontent.com/Shadytel/osmo_ss7/eef6ce439727436febc67692c145e07847cc4c89/test/sua_codec_tests.erl | erlang | -module(sua_codec_tests).
-author('Harald Welte <>').
-include_lib("eunit/include/eunit.hrl").
-include("xua.hrl").
-include("sua.hrl").
-define(MSG_ENC, <<1,0,7,1,0,0,0,208,0,6,0,8,0,0,0,3,1,21,0,8,0,0,0,1,1,2,0,44,0,1,0,7,128,1,0,20,0,0,0,4,12,0,1,4,68,119,121,7,22,0,0,0,128,2,0,8,0,0,8,21,128,3,0,8,0,0,0,7,1,3,0... | |
7bcbec767282e2b3339349db0ad46b38df9e375ae95d8ba3fc1956ec9623c3cd | sebfisch/explicit-sharing | Classes.hs | # LANGUAGE
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
Rank2Types
#
MultiParamTypeClasses,
FlexibleInstances,
FlexibleContexts,
Rank2Types
#-}
-- |
Module : Control . . Sharing . Classes
Copyright : , , and
-- Licen... | null | https://raw.githubusercontent.com/sebfisch/explicit-sharing/3c7205d69503db24fd5d3fb0556a35a25c742640/Control/Monad/Sharing/Classes.hs | haskell | |
License : PublicDomain
Stability : experimental
This library provides type classes for explicit sharing of monadic
effects. Usually you don't need to import this library as it is
do so, however, when writing your own implementation of explicit
sharing.
| Interface of monads that support explicit shar... | # LANGUAGE
MultiParamTypeClasses ,
FlexibleInstances ,
FlexibleContexts ,
Rank2Types
#
MultiParamTypeClasses,
FlexibleInstances,
FlexibleContexts,
Rank2Types
#-}
Module : Control . . Sharing . Classes
Copyright : , , and
Maintainer ... |
f8d47ffe22e4cf690ab8594386e55abf6d99a88e2fa08d3c7f60a635268291ad | c-cube/iter | mkshims.ml | module C = Configurator.V1
let shims_pre_408 =
"\nopen! Bigarray\nlet bigarray_map_file = Bigarray.Array1.map_file\n"
let shims_post_408 =
"\n\
let bigarray_map_file fd ty lay b len =\n\
\ Unix.map_file fd ty lay b [| len |] |> Bigarray.array1_of_genarray\n"
let () =
C.main ~name:"mkshims" (fun c ->
... | null | https://raw.githubusercontent.com/c-cube/iter/29ece562e2a1d4e62ca286ffd5af356851ab5bf5/src/bigarray/mkshims.ml | ocaml | module C = Configurator.V1
let shims_pre_408 =
"\nopen! Bigarray\nlet bigarray_map_file = Bigarray.Array1.map_file\n"
let shims_post_408 =
"\n\
let bigarray_map_file fd ty lay b len =\n\
\ Unix.map_file fd ty lay b [| len |] |> Bigarray.array1_of_genarray\n"
let () =
C.main ~name:"mkshims" (fun c ->
... | |
777383c498b3daa42ae3e724358ac868d0a9082ad08af4a382565434d87de085 | bsansouci/bsb-native | float_subst_boxed_number.ml | module PR_6686 = struct
type t =
| A of float
| B of (int * int)
let rec foo = function
| A x -> x
| B (x, y) -> float x +. float y
let (_ : float) = foo (A 4.)
end
module PR_6770 = struct
type t =
| Constant of float
| Exponent of (float * float)
let to_string = function
| Exponent (_... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/testsuite/tests/float-unboxing/float_subst_boxed_number.ml | ocaml | module PR_6686 = struct
type t =
| A of float
| B of (int * int)
let rec foo = function
| A x -> x
| B (x, y) -> float x +. float y
let (_ : float) = foo (A 4.)
end
module PR_6770 = struct
type t =
| Constant of float
| Exponent of (float * float)
let to_string = function
| Exponent (_... | |
90b84a525c6bf741f4b1ca7509c4b1a0c22149b7b3fffc4d05c0d575c4274e25 | waddlaw/TAPL | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
module B.Parser where
import Language.B.Parser
import Language.B.Type
import RIO
import Test.Hspec.Megaparsec
import Test.Tasty.Hspec
import Text.Megaparsec
spec_parser :: Spec
spec_parser = do
describe "values" $ do
it "true" $ parse pTrue "" "true" `shouldParse` TmTrue
... | null | https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/subs/bool/test/B/Parser.hs | haskell | # LANGUAGE OverloadedStrings # |
module B.Parser where
import Language.B.Parser
import Language.B.Type
import RIO
import Test.Hspec.Megaparsec
import Test.Tasty.Hspec
import Text.Megaparsec
spec_parser :: Spec
spec_parser = do
describe "values" $ do
it "true" $ parse pTrue "" "true" `shouldParse` TmTrue
it "false" $ parse pFalse "" "false... |
3179caf17aa57f2dd3dcd0ba7a4b660d989f9de0e7f87e144bd31ae90a7f224c | haslab/HAAP | TagSoup.hs |
HAAP : Haskell Automated Assessment Platform
This module provides wrappers to the _ tagsoup _ library ( < > ) for unstructured processing of HTML / XML documents .
HAAP: Haskell Automated Assessment Platform
This module provides wrappers to the _tagsoup_ library (<>) for unstructured processing of HTML/XML doc... | null | https://raw.githubusercontent.com/haslab/HAAP/5acf9efaf0e5f6cba1c2482e51bda703f405a86f/src/HAAP/Web/HTML/TagSoup.hs | haskell | import Debug.Trace |
HAAP : Haskell Automated Assessment Platform
This module provides wrappers to the _ tagsoup _ library ( < > ) for unstructured processing of HTML / XML documents .
HAAP: Haskell Automated Assessment Platform
This module provides wrappers to the _tagsoup_ library (<>) for unstructured processing of HTML/XML doc... |
426183e34532a8ddca1a6763a4bb812bb86c20f1d0263b4cb1d4c26ca45e7f42 | JakobBruenker/monadic-bang | Offer.hs | # LANGUAGE BlockArguments #
# LANGUAGE DerivingStrategies #
# LANGUAGE UndecidableInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE OverloadedRecordDot #
module MonadicBang.Effect.Offer where
import Control.Algebra
import Control.Carrier.State.Strict
import Data.Map.Strict (Map)
import Data.Map.Strict qualified as M... | null | https://raw.githubusercontent.com/JakobBruenker/monadic-bang/aad1fa42b3639ca9e65feb859ce9122ac014df4a/src/MonadicBang/Effect/Offer.hs | haskell | | Offers a number of things that can be yoinked, but only once
Returns the result of the computation, along with the remaining offers | # LANGUAGE BlockArguments #
# LANGUAGE DerivingStrategies #
# LANGUAGE UndecidableInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE OverloadedRecordDot #
module MonadicBang.Effect.Offer where
import Control.Algebra
import Control.Carrier.State.Strict
import Data.Map.Strict (Map)
import Data.Map.Strict qualified as M... |
3bd0cafb3455402fc88312d0e853a91cc3b855971ff3c7f072e3195a2ac40da0 | tsloughter/kuberl | kuberl_v1beta1_role.erl | -module(kuberl_v1beta1_role).
-export([encode/1]).
-export_type([kuberl_v1beta1_role/0]).
-type kuberl_v1beta1_role() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_meta(),
'rules' => list()
}.
encode(#{ 'apiVersion' := ApiVersi... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_role.erl | erlang | -module(kuberl_v1beta1_role).
-export([encode/1]).
-export_type([kuberl_v1beta1_role/0]).
-type kuberl_v1beta1_role() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_meta(),
'rules' => list()
}.
encode(#{ 'apiVersion' := ApiVersi... | |
4c1c6614719f191c10756a5c8b6d55ecad542ef5443e1dfc6f02554d0a2ad88c | grin-compiler/ghc-wpc-sample-programs | Pandoc.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE ScopedTypeVariables #
|
Module : Text . Pandoc
Copyright : Copyright ( C ) 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable ... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc.hs | haskell | * Definitions
* Generics
* Options
* Logging
* Error handling
* Rendering templates and default templates
* Miscellaneous | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE ScopedTypeVariables #
|
Module : Text . Pandoc
Copyright : Copyright ( C ) 2006 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable ... |
622a5b608cc0cd58172dca65f46f2fd7de0773f510303709d55c1818eda92eed | mflatt/shrubbery-rhombus-0 | input.rkt | #lang racket/base
(provide input1s
input1
expected1
input1a
expected1a
input2
expected2
input3
expected3
input4
expected4
input5
expected5
input6
expected6)
input1 is split into parts ... | null | https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/cfe1b1450cfaef393fc7f33bef4d0aaf5f1837fe/shrubbery/tests/input.rkt | racket | ----------------------------------------
----------------------------------------
----------------------------------------
has « », so unarmoring won't work
b ; c
b »; c
z
z
top_b » top_c
« top_d ;« top_e; top_f » »
z
y
y;
y;
here | here | #lang racket/base
(provide input1s
input1
expected1
input1a
expected1a
input2
expected2
input3
expected3
input4
expected4
input5
expected5
input6
expected6)
input1 is split into parts ... |
0b4c0830d3699f6507d5480a4ed3e6f464c35fd1b7f3a51537845028cc61270b | denisshevchenko/breadu.info | FoodSuggestions.hs | {-|
Module : BreadU.Tools.FoodSuggestions
Description : Food suggestions for autocomplete.
Stability : experimental
Portability : POSIX
Work with food suggestions for autocomplete when user typing food name.
-}
module BreadU.Tools.FoodSuggestions
( foodSuggestions
) where
import BreadU.Types... | null | https://raw.githubusercontent.com/denisshevchenko/breadu.info/b613fa28a4b527f1459876348a72e7748f16cd88/src/lib/BreadU/Tools/FoodSuggestions.hs | haskell | |
Module : BreadU.Tools.FoodSuggestions
Description : Food suggestions for autocomplete.
Stability : experimental
Portability : POSIX
Work with food suggestions for autocomplete when user typing food name.
| Suggestions for autocomplete of the food name. Can be empty.
Since names are ordered, additional sugg... |
module BreadU.Tools.FoodSuggestions
( foodSuggestions
) where
import BreadU.Types ( FoodName
, FoodNamePart
, OrderedFoodNames
)
import Data.Vector ( findIndex, (!), (!... |
7c6849d303e1108fcb0c177253e43999448d817cc07e7cca46e28915993bfa0c | graninas/Functional-Design-and-Architecture | Domain.hs | module Andromeda.Hardware.Domain where
type DeviceName = String
type ComponentIndex = String
type ControllerName = String
data Controller = Controller ControllerName
deriving (Show, Eq, Ord)
data Status
= StatusOk
deriving (Show, Eq, Ord)
| null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/f54faef342bee66be1667d3fb9f54582bbc18a1d/Second-Edition-Manning-Publications/BookSamples/CH05/Section5p2p3/src/Andromeda/Hardware/Domain.hs | haskell | module Andromeda.Hardware.Domain where
type DeviceName = String
type ComponentIndex = String
type ControllerName = String
data Controller = Controller ControllerName
deriving (Show, Eq, Ord)
data Status
= StatusOk
deriving (Show, Eq, Ord)
| |
1956b6f6269d81a21ce0645845497fd0a5191f156024e5aa9348121837941788 | fulcro-legacy/semantic-ui-wrapper | ui_segment_inline.cljs | (ns fulcrologic.semantic-ui.elements.segment.ui-segment-inline
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/elements/Segment/SegmentInline" :default SegmentInline]))
(def ui-segment-inline
"A placeholder segment can be inline.
Props:
- as (custom): An... | null | https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/elements/segment/ui_segment_inline.cljs | clojure | (ns fulcrologic.semantic-ui.elements.segment.ui-segment-inline
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/elements/Segment/SegmentInline" :default SegmentInline]))
(def ui-segment-inline
"A placeholder segment can be inline.
Props:
- as (custom): An... | |
381c247409608f7e06b138153a73a3528b0c676bc844461e631ad430813ffa43 | janestreet/async | rpc_impl.ml | open Core
open Async
open Rpc
Generic wrapper over both the Async . and Netkit backed RPC implementations
module Server = struct
type t =
| Tcp of (Socket.Address.Inet.t, int) Tcp.Server.t
| Netkit of Netkit.Network.Tcp_endpoint.Server.t
let bound_on = function
| Tcp s -> Tcp.Server.listening_on s... | null | https://raw.githubusercontent.com/janestreet/async/a42d7fd4d14b2125c4bdf546d03d1a6aedf76b90/async_rpc/test-bin/rpc_impl.ml | ocaml | open Core
open Async
open Rpc
Generic wrapper over both the Async . and Netkit backed RPC implementations
module Server = struct
type t =
| Tcp of (Socket.Address.Inet.t, int) Tcp.Server.t
| Netkit of Netkit.Network.Tcp_endpoint.Server.t
let bound_on = function
| Tcp s -> Tcp.Server.listening_on s... | |
66de87686c08e5807a503d361cf370f95e76914a82d1c60766c9285f65f62a9e | JamesLavin/ElixirZone | mike.erl | -module(mike).
-export([start/0, call/1]).
-vsn(2.0).
call(Arg1) ->
io:fwrite("~p~n",[Arg1]).
receive_loop() ->
receive
{Sender, Msg} ->
io:fwrite("Mike 2.0 received a message from ~p: ~p~n",[Sender, Msg]),
Sender ! {mike, "Hello from Mike 2.0!"}
end.
start() ->
Pid = spawn(fun() -> call(... | null | https://raw.githubusercontent.com/JamesLavin/ElixirZone/ff23b7d4f3138cbb865df140c888bf8431872ebe/Erlang_Fundamentals/Erlang101/erlang_program_2/mike.erl | erlang | -module(mike).
-export([start/0, call/1]).
-vsn(2.0).
call(Arg1) ->
io:fwrite("~p~n",[Arg1]).
receive_loop() ->
receive
{Sender, Msg} ->
io:fwrite("Mike 2.0 received a message from ~p: ~p~n",[Sender, Msg]),
Sender ! {mike, "Hello from Mike 2.0!"}
end.
start() ->
Pid = spawn(fun() -> call(... | |
5ace18414b9df7e79fadb21374d99a5b1807a67ddb90de7ac7c9fd64c6616559 | Shirakumo/trial | bundle.lisp | (in-package #:org.shirakumo.fraf.trial.release)
(defun bundle-path (bundle &key (version (version)) (output (output)))
(let ((data (or (config :bundles bundle)
(error "No such bundle ~a" bundle))))
(make-pathname :name (format NIL (or (getf data :file-format) "~(~a-~a-~a~)") (config :system) bu... | null | https://raw.githubusercontent.com/Shirakumo/trial/6b669c60643ae80746a26821bd2e3f8b1feb700a/release/bundle.lisp | lisp | FIXME: I don't think the target mapping here is correct yet... | (in-package #:org.shirakumo.fraf.trial.release)
(defun bundle-path (bundle &key (version (version)) (output (output)))
(let ((data (or (config :bundles bundle)
(error "No such bundle ~a" bundle))))
(make-pathname :name (format NIL (or (getf data :file-format) "~(~a-~a-~a~)") (config :system) bu... |
ca2382fcb68e72a89867548158264eda8bd15791539cc0816f22e3b6e56ff887 | GillianPlatform/Gillian | codeLoc.ml | open Lexing
type t = { loc_start : Lexing.position; loc_end : Lexing.position }
let curr lexbuf =
let loc_start = lexeme_start_p lexbuf in
let loc_end = lexeme_end_p lexbuf in
{ loc_start; loc_end }
let fname loc = loc.loc_start.pos_fname
let merge lstart lend = { loc_start = lstart.loc_start; loc_end = lend.l... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/1c8d65120c04ef87cda689a9d41268e25b5ffa7e/wisl/lib/utils/codeLoc.ml | ocaml | open Lexing
type t = { loc_start : Lexing.position; loc_end : Lexing.position }
let curr lexbuf =
let loc_start = lexeme_start_p lexbuf in
let loc_end = lexeme_end_p lexbuf in
{ loc_start; loc_end }
let fname loc = loc.loc_start.pos_fname
let merge lstart lend = { loc_start = lstart.loc_start; loc_end = lend.l... | |
5fb3e8ac5f4484382644071486f0ec50a584cb54424509a4b00006acd6f9a2d1 | ku-fpg/sunroof-compiler | Object.hs |
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
| Abstraction over the most general type in Javascript .
module Language.Sunroof.JS.Object
( JSObject
, object
, this
) where
import Data.Boolean ( BooleanOf, IfB(..), EqB(..) )
import Language.Sunroof.JavaScrip... | null | https://raw.githubusercontent.com/ku-fpg/sunroof-compiler/5d8edafea515c4c2b4e7631799f35d8df977e289/Language/Sunroof/JS/Object.hs | haskell | # LANGUAGE TypeSynonymInstances #
-------------------------------------------------------------
-------------------------------------------------------------
| Data type for all Javascript objects.
| Reference equality, not value equality.
-------------------------------------------------------------
------------... |
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
| Abstraction over the most general type in Javascript .
module Language.Sunroof.JS.Object
( JSObject
, object
, this
) where
import Data.Boolean ( BooleanOf, IfB(..), EqB(..) )
import Language.Sunroof.JavaScript ( Expr, showExpr, literal, binOp )
i... |
07af17e969991a88ec10cb13be3840c895c0eac653e21befc84265278209d887 | typedclojure/typedclojure | coerce_utils.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/5fd7cdf7941c6e7d1dd5df88bf44474fa35e1fca/typed/clj.runtime/src/clojure/core/typed/coerce_utils.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns ^:no-doc clojure.core.typed.coerce-utils
(:require [typed.clojure :as t]
[clojure.string :as str]
[clojure.java.io :as io]
[clojure.core.typed.current-impl :as impl])
(:import (clojure.lang RT Var)))
(t/ann symbol->Class [t/Sym ->... |
993c5b3b60de102e13bf1905581622522c7ab24390c814e06844f72708842c26 | portkey-cloud/aws-clj-sdk | _2016-08-20.clj | (ns portkey.aws.cloudfront.-2016-08-20 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope {:service "cloudfront", :region "us-east-1"},
:ssl-common-name "cloudfront.amazonaws.com",
:endpoint "",
:signature-version :v4},
"eu-west-1"
{:credential-scope {:service "cloudf... | null | https://raw.githubusercontent.com/portkey-cloud/aws-clj-sdk/10623a5c86bd56c8b312f56b76ae5ff52c26a945/src/portkey/aws/cloudfront/_2016-08-20.clj | clojure | (ns portkey.aws.cloudfront.-2016-08-20 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope {:service "cloudfront", :region "us-east-1"},
:ssl-common-name "cloudfront.amazonaws.com",
:endpoint "",
:signature-version :v4},
"eu-west-1"
{:credential-scope {:service "cloudf... | |
d07364c56882f44f2288afc4551867e9e25576c251bd9eebf2b5ead2f096b8c6 | Xetera/proxy-checker | Lib.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
module Lib
( main
) where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Concurrent.Chan
import Control.Concurrent.MVar
import Control.Exception.Safe
import qualified Data.By... | null | https://raw.githubusercontent.com/Xetera/proxy-checker/461569b37b018bd38968ffb1a128b04f732c7851/src/Lib.hs | haskell | # LANGUAGE OverloadedStrings #
I realize finding the IP of the proxy is pretty stupid
since you already need to know the ip to connect in
we need to retain the context of the proxy that's
being checked so we return a (Proxy, Maybe Error) tuple
using the ip as the key for the map
returning Nothing to signal the la... | # LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
module Lib
( main
) where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Concurrent.Chan
import Control.Concurrent.MVar
import Control.Exception.Safe
import qualified Data.ByteString.Char8 as C8
import Data.Ei... |
0edf1a46f5e053716543d08e5679eaa5d6b450e2d59d83d68294e494ddcacfbe | djblue/portal | client.cljs | (ns ^:no-doc portal.runtime.node.client
(:require [portal.runtime :as rt]))
(defonce connections (atom {}))
(defonce ^:private id (atom 0))
(defonce ^:private pending-requests (atom {}))
(defn- next-id [] (swap! id inc))
(def ops
{:portal.rpc/response
(fn [message _done]
(let [id (:portal.rpc/id message... | null | https://raw.githubusercontent.com/djblue/portal/1ee145277b572e572bc3fd88ad0553c9cc15d7be/src/portal/runtime/node/client.cljs | clojure | (ns ^:no-doc portal.runtime.node.client
(:require [portal.runtime :as rt]))
(defonce connections (atom {}))
(defonce ^:private id (atom 0))
(defonce ^:private pending-requests (atom {}))
(defn- next-id [] (swap! id inc))
(def ops
{:portal.rpc/response
(fn [message _done]
(let [id (:portal.rpc/id message... | |
97f165992d654c0361c7de99fe269e8db74af916a62adffd2ea9363b360d05a8 | postspectacular/devart-codefactory | canopy.clj | (ns codefactory.exhibit.canopy
(:require
[codefactory.exhibit.utils :refer :all]
[thi.ng.geom.core :as g]
[thi.ng.geom.core.utils :as gu]
[thi.ng.geom.core.vector :as v :refer [vec3 V3Y V3Z]]
[thi.ng.geom.core.matrix :refer [M44]]
[thi.ng.geom.bezier :as b]
[thi.ng.geom.polygon :as p]
[thi.ng.... | null | https://raw.githubusercontent.com/postspectacular/devart-codefactory/9bccdc10e58fa4861a69767e9ae4be0bb8d7f650/src-fabricate/src/codefactory/exhibit/canopy.clj | clojure | (ns codefactory.exhibit.canopy
(:require
[codefactory.exhibit.utils :refer :all]
[thi.ng.geom.core :as g]
[thi.ng.geom.core.utils :as gu]
[thi.ng.geom.core.vector :as v :refer [vec3 V3Y V3Z]]
[thi.ng.geom.core.matrix :refer [M44]]
[thi.ng.geom.bezier :as b]
[thi.ng.geom.polygon :as p]
[thi.ng.... | |
aaf8f1be8009e9700e101bdb3a16f38c8ddc9248ebf66fca5002e05e1c3f03b8 | lowasser/TrieMap | Build.hs | # LANGUAGE CPP , FlexibleInstances , TypeSynonymInstances , MultiParamTypeClasses , BangPatterns , RecordWildCards , TypeFamilies #
{-# OPTIONS -O -fspec-constr -fliberate-case -fstatic-argument-transformation #-}
module Data.TrieMap.RadixTrie.Build () where
import Data.TrieMap.RadixTrie.Base
import Data.TrieMap.Radix... | null | https://raw.githubusercontent.com/lowasser/TrieMap/1ab52b8d83469974a629f2aa577a85de3f9e867a/Data/TrieMap/RadixTrie/Build.hs | haskell | # OPTIONS -O -fspec-constr -fliberate-case -fstatic-argument-transformation # | # LANGUAGE CPP , FlexibleInstances , TypeSynonymInstances , MultiParamTypeClasses , BangPatterns , RecordWildCards , TypeFamilies #
module Data.TrieMap.RadixTrie.Build () where
import Data.TrieMap.RadixTrie.Base
import Data.TrieMap.RadixTrie.Search
import Data.Functor.Immoral
import GHC.Exts
#define V(f) f (VVector... |
dcce734fd8ae6bd6edccf8683f8a2fa745512136db9ca559b98caf6d278b2b50 | hatsugai/CCLV | main.ml | open Printf
open Col
open IdCol
open S
open Ir
open Compile
open Regalloc
type machine =
Fenestra6502
| W65C02S
| MC6800
let machine = ref Fenestra6502
let usage_msg = "cclv <option>* <source>\n"
let select_machine s =
if s="Fenestra6502" then
machine := Fenestra6502
else if s="6502" then
machine := W... | null | https://raw.githubusercontent.com/hatsugai/CCLV/c661c1814f31471ba1eba7ad1d9949e3c5ae9144/src/main.ml | ocaml | open Printf
open Col
open IdCol
open S
open Ir
open Compile
open Regalloc
type machine =
Fenestra6502
| W65C02S
| MC6800
let machine = ref Fenestra6502
let usage_msg = "cclv <option>* <source>\n"
let select_machine s =
if s="Fenestra6502" then
machine := Fenestra6502
else if s="6502" then
machine := W... | |
32609ecafb37aa8e03885174c73a4b6e54b7e6cc4c7c5cf8beaa2c58cda931bf | lemmaandrew/CodingBatHaskell | sum3.hs | From
Given an array of ints length 3 , return the sum of all the elements .
Given an array of ints length 3, return the sum of all the elements.
-}
import Test.Hspec ( hspec, describe, it, shouldBe )
sum3 :: [Int] -> Int
sum3 nums = undefined
main :: IO ()
main = hspec $ describe "Tests:" $ do
it "6" $
... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Array-1/sum3.hs | haskell | From
Given an array of ints length 3 , return the sum of all the elements .
Given an array of ints length 3, return the sum of all the elements.
-}
import Test.Hspec ( hspec, describe, it, shouldBe )
sum3 :: [Int] -> Int
sum3 nums = undefined
main :: IO ()
main = hspec $ describe "Tests:" $ do
it "6" $
... | |
a17917cde578b16d89347eb9c8c59284604d7e11b82030d5cf0a2129e6764c2a | google/proto-lens | labels_test.hs | # LANGUAGE OverloadedLabels #
module Main where
import Data.Int (Int32)
import Lens.Family ((&))
import qualified Lens.Family2
import qualified Lens.Family
import Proto.Canonical (Test1, Test3)
import Data.ProtoLens (build, defMessage)
import Data.ProtoLens.Labels ()
import Data.ProtoLens.TestUtil
import Test.Tasty.H... | null | https://raw.githubusercontent.com/google/proto-lens/081815877430afc1db669ca5e4edde1558b5fd9d/proto-lens-tests/tests/labels_test.hs | haskell | Test that type inference works in both directions compatibly with
`defMessage :: Message a => a`.
Test the integration with lens-family and lens-family-core.
are higher-rank and don't always do type inference well with our
(see below), and neither do the 'lens' or 'microlens' packages.
| lens-family-core doesn't ... | # LANGUAGE OverloadedLabels #
module Main where
import Data.Int (Int32)
import Lens.Family ((&))
import qualified Lens.Family2
import qualified Lens.Family
import Proto.Canonical (Test1, Test3)
import Data.ProtoLens (build, defMessage)
import Data.ProtoLens.Labels ()
import Data.ProtoLens.TestUtil
import Test.Tasty.H... |
8646d91db52c4c15fc899ae6ef3fe10b4da6f31f0455c5e8b5adc894b4cc7111 | TheBestTvarynka/Lisp-SQL-Parser | encoder.lisp | Copyright ( c ) 2006 - 2008 Henrik Hjelte
Copyright ( c ) 2008 ( marked parts )
;;;; All rights reserved.
;;;; See the file LICENSE for terms of use and distribution.
(in-package :json)
(defvar *json-output* (make-synonym-stream '*standard-output*)
"The default output stream for encoding operations.")
(defin... | null | https://raw.githubusercontent.com/TheBestTvarynka/Lisp-SQL-Parser/d8f1283fc00e394d76e4ac28e434c99d1bee72aa/src/cl-json/src/encoder.lisp | lisp | All rights reserved.
See the file LICENSE for terms of use and distribution.
in inappropriate~] ~
End of YASON code.
You can use the streaming encoder above, or
float types, single- and double- --- we don't consider the
"only single and short" case. Could be added if necessary. | Copyright ( c ) 2006 - 2008 Henrik Hjelte
Copyright ( c ) 2008 ( marked parts )
(in-package :json)
(defvar *json-output* (make-synonym-stream '*standard-output*)
"The default output stream for encoding operations.")
(define-condition unencodable-value-error (type-error)
((context :accessor unencodable-valu... |
05457f238953ba48c36dddada6cb0b4bad5a2aee76879311cd021f780c9c5cd4 | osstotalsoft/functional-guy | 01.Reader.hs | import Control.Monad
newtype Reader e a = Reader {runReader :: e -> a}
instance Functor (Reader e) where
fmap f ra = Reader (f . runReader ra)
instance Applicative (Reader e) where
pure = Reader . const
rf <*> ra =
Reader
( \e ->
let f = runReader rf e
a = runReader ra e
... | null | https://raw.githubusercontent.com/osstotalsoft/functional-guy/95ac3ba0e87d7287d82f4e72a5350355ca233f02/Chapter6.%20Computational%20effects/Examples/Reader/01.Reader.hs | haskell | example2
myComposedFn' = myOtherFn' . myFn' | import Control.Monad
newtype Reader e a = Reader {runReader :: e -> a}
instance Functor (Reader e) where
fmap f ra = Reader (f . runReader ra)
instance Applicative (Reader e) where
pure = Reader . const
rf <*> ra =
Reader
( \e ->
let f = runReader rf e
a = runReader ra e
... |
8211de19a8fca94b34cb5933d2edd25daa7795b47934ded8e3eb8ef208d0e466 | cljdoc/cljdoc | offline.clj | (ns cljdoc.render.offline
"Rendering code for offline bundles.
While more reuse would be possible this is intentionally
kept somewhat separately as DOM stability is more important
for tools like Dash etc."
(:require [babashka.fs :as fs]
[cljdoc.render.layout :as layout]
[cljdoc.render... | null | https://raw.githubusercontent.com/cljdoc/cljdoc/b40932c9398d1f68ef1e8f02df56c0c8d5a8a77b/src/cljdoc/render/offline.clj | clojure | WARN this could lead to overwriting files but nesting
directories complicates linking between files a lot and
so taking a shortcut here.
naive for now, assume a feature's value is always simply `true`
use content-hashed name for source map to preserve link to index.js
Optional assets
Documentation Pages / Articl... | (ns cljdoc.render.offline
"Rendering code for offline bundles.
While more reuse would be possible this is intentionally
kept somewhat separately as DOM stability is more important
for tools like Dash etc."
(:require [babashka.fs :as fs]
[cljdoc.render.layout :as layout]
[cljdoc.render... |
10d3a504215a9a6c6246afcc7c312759f9c34b545a68e3e89dbd01b0e177b5f6 | marigold-dev/deku | arrange.ml | open Source
open Ast
open Script
open Values
open Types
open Sexpr
Generic formatting
let nat n = I32.to_string_u (I32.of_int_u n)
let nat32 = I32.to_string_u
let add_hex_char buf c = Printf.bprintf buf "\\%02x" (Char.code c)
let add_char buf = function
| '\n' -> Buffer.add_string buf "\\n"
| '\t' -> Buffer.ad... | null | https://raw.githubusercontent.com/marigold-dev/deku/a26f31e0560ad12fd86cf7fa4667bb147247c7ef/deku-c/interpreter/text/arrange.ml | ocaml | Types
Expressions
Functions
Tables & memories
Modules
Modules | open Source
open Ast
open Script
open Values
open Types
open Sexpr
Generic formatting
let nat n = I32.to_string_u (I32.of_int_u n)
let nat32 = I32.to_string_u
let add_hex_char buf c = Printf.bprintf buf "\\%02x" (Char.code c)
let add_char buf = function
| '\n' -> Buffer.add_string buf "\\n"
| '\t' -> Buffer.ad... |
fac5d6f7b870c1fdf68dd95c50ec3d00834e5556c58a25f948bffdea78cd28af | purcell/adventofcode2016 | AdventOfCode.hs | module AdventOfCode
( loadDay
, runDay
, Day(..)
, module P
, module S
) where
import Text.Parsec as P hiding (State)
import Text.Parsec.String as P
import Search as S
import System.Environment (getArgs)
import Control.Monad (when)
data Day i = Day
{ dayNum :: Int
, dayParser :: Parser i
, dayPartA ... | null | https://raw.githubusercontent.com/purcell/adventofcode2016/081f30de4ea6b939e6c3736d83836f4dd72ab9a2/lib/AdventOfCode.hs | haskell | module AdventOfCode
( loadDay
, runDay
, Day(..)
, module P
, module S
) where
import Text.Parsec as P hiding (State)
import Text.Parsec.String as P
import Search as S
import System.Environment (getArgs)
import Control.Monad (when)
data Day i = Day
{ dayNum :: Int
, dayParser :: Parser i
, dayPartA ... | |
2f242f873937a21c5153f7093c2677e7fa6397b3d6b76e4bfa5b089a9c60cdaf | dgiot/dgiot | emqx_pool.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_pool.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_pool).
-behaviour(gen_server).
-include("logger.hrl").
-include("types.hrl").
-l... |
8b8dfcaafc98709f26c4c72376b0f3afce9847d1547de22bff3054e262c27411 | singnet/snet-minting-policy | AGIXMultiOwnerMintingPolicy.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module OnChain.AGIXMultiOwnerMintingPolicy
( curSymbol,
serialisedScript,
)
wh... | null | https://raw.githubusercontent.com/singnet/snet-minting-policy/c6ef2bd27c71b23df5d020f911dbbae721582328/src/OnChain/AGIXMultiOwnerMintingPolicy.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
"As long as we sign, we can mint as many tokens as we want, and those tokens can have arbitrary token names.
Also, there is a tiny stylistic issue: the do keyword is strange and unusual - we advise you to skip it.
Takeaway
... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module OnChain.AGIXMultiOwnerMintingPolicy
( curSymbol,
serialisedScript,
)
where
import Cardano.Api hiding (Address)
import Cardano.Api.Shelley (Plut... |
bdff11a905fe278d399b34455ffbf08c2582a3d5af411f3bd29e5a2448c4b88e | flambard/enet | enet_peer_sup.erl | -module(enet_peer_sup).
-behaviour(supervisor).
%% API
-export([
start_link/1,
start_peer/2
]).
%% Supervisor callbacks
-export([ init/1 ]).
%%%===================================================================
%%% API functions
%%%=========================================================... | null | https://raw.githubusercontent.com/flambard/enet/59a564ef3927dc984926e3eb4723415cbda1b2b6/src/enet_peer_sup.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
====================================================... | -module(enet_peer_sup).
-behaviour(supervisor).
-export([
start_link/1,
start_peer/2
]).
-export([ init/1 ]).
start_link(Port) ->
supervisor:start_link(?MODULE, [Port]).
start_peer(Supervisor, Peer) ->
supervisor:start_child(Supervisor, [Peer]).
init([Port]) ->
true = gpro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.