_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 |
|---|---|---|---|---|---|---|---|---|
18e5980ef1c89842c82550ae8528efa4312e5a8c5849027124138f4b6245c545 | simmone/racket-simple-qr | rotate-ratio.rkt | #lang racket
(require "../../../../share/func.rkt")
(provide (contract-out
[write-report-rotate-ratio (-> number? path-string? void?)]
))
(define (write-report-rotate-ratio rotate_ratio express_path)
(let* ([scrbl_dir (build-path express_path "rotate-ratio")]
[scrbl_file (build-path sc... | null | https://raw.githubusercontent.com/simmone/racket-simple-qr/904f1491bc521badeafeabd0d7d7e97e3d0ee958/simple-qr/read/lib/express/rotate-ratio/rotate-ratio.rkt | racket | #lang racket
(require "../../../../share/func.rkt")
(provide (contract-out
[write-report-rotate-ratio (-> number? path-string? void?)]
))
(define (write-report-rotate-ratio rotate_ratio express_path)
(let* ([scrbl_dir (build-path express_path "rotate-ratio")]
[scrbl_file (build-path sc... | |
42acaabe763238fc07f20c8ad0b14774145cb98fff84cb63ef032e155add2c79 | goldfirere/th-desugar | ReifyTypeSigs.hs | # LANGUAGE CPP #
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
#if __GLASGOW_HASKELL__ >= 809
# LANGUAGE StandaloneKindSignatures #
#endif
module ReifyTypeSigs where
#if __GLASGOW_HASKELL__ >= 809
import Data.Kind
import Data.Proxy
#endif
import Language.Haskell.TH.Desugar
import Lang... | null | https://raw.githubusercontent.com/goldfirere/th-desugar/d87ea5678dfd6726a0776db71468dbd97dda2985/Test/ReifyTypeSigs.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE CPP #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
#if __GLASGOW_HASKELL__ >= 809
# LANGUAGE StandaloneKindSignatures #
#endif
module ReifyTypeSigs where
#if __GLASGOW_HASKELL__ >= 809
import Data.Kind
import Data.Proxy
#endif
import Language.Haskell.TH.Desugar
import Language.Haskell.TH.Syntax hidin... |
2f743be35291f7a7e4e207baa89bc45e833f2784ec0e042806477686d3280091 | ten0s/syntaxerl | syntaxerl_yrl.erl | -module(syntaxerl_yrl).
-author("Dmitry Klionsky <>").
-behaviour(syntaxerl).
-export([
check_syntax/3,
output_error/1,
output_warning/1
]).
-include("check_syntax_spec.hrl").
%% ===================================================================
%% API
%% ===============================================... | null | https://raw.githubusercontent.com/ten0s/syntaxerl/fc5113c68f0ce0c6ef43216e2b3483b090c6dd86/src/syntaxerl_yrl.erl | erlang | ===================================================================
API
=================================================================== | -module(syntaxerl_yrl).
-author("Dmitry Klionsky <>").
-behaviour(syntaxerl).
-export([
check_syntax/3,
output_error/1,
output_warning/1
]).
-include("check_syntax_spec.hrl").
check_syntax(FileName, _BaseFileName, _Debug) ->
case yecc:file(FileName, [{report, true}, {return, true}]) of
{ok,... |
e1607a8f7aef35337a7c44c11ad3a27205fa10adfe6598b601dec8c6bbabd496 | AlexKnauth/reprovide-lang | info.rkt | #lang info
(define collection 'multi)
(define implies
'("reprovide-lang-lib"
))
(define deps
'("base"
"reprovide-lang-lib"
))
(define build-deps
'("rackunit-lib"
"scribble-lib"
"racket-doc"
))
| null | https://raw.githubusercontent.com/AlexKnauth/reprovide-lang/8c3c912d200eec45d22fc267d151fb1939471b49/reprovide-lang/info.rkt | racket | #lang info
(define collection 'multi)
(define implies
'("reprovide-lang-lib"
))
(define deps
'("base"
"reprovide-lang-lib"
))
(define build-deps
'("rackunit-lib"
"scribble-lib"
"racket-doc"
))
| |
1dd5e6e127e45be2ec6a462de213ecbeb9bb69e4d7a6c6b8fb9f5bc57e1af31e | c-cube/iter | Iter.mli | * Simple and Efficient Iterators .
The iterators are designed to allow easy transfer ( mappings ) between data
structures , without defining [ n^2 ] conversions between the [ n ] types . The
implementation relies on the assumption that an iterator can be iterated
on as many times as needed ; th... | null | https://raw.githubusercontent.com/c-cube/iter/29ece562e2a1d4e62ca286ffd5af356851ab5bf5/src/Iter.mli | ocaml | * An iterator of values of type ['a]. If you give it a function ['a -> unit]
it will be applied to every element of the iterator successively.
* {1 Creation}
* Build an iterator from a iter function
* Call the function repeatedly until it returns None. This
iterator is transient, use {!persistent} if needed!... | * Simple and Efficient Iterators .
The iterators are designed to allow easy transfer ( mappings ) between data
structures , without defining [ n^2 ] conversions between the [ n ] types . The
implementation relies on the assumption that an iterator can be iterated
on as many times as needed ; th... |
d5fc2b415a142f18e903e0d293107c3db65cbcf01a8cce9efa95ede64b4785d8 | racket/math | utils.rkt | #lang typed/racket/base
(require racket/performance-hint
racket/string
racket/fixnum
math/base
"matrix-types.rkt"
"../unsafe.rkt"
"../array/array-struct.rkt"
"../vector/vector-mutate.rkt")
(provide (all-defined-out))
(: format-matrices/error ((Listof (Ar... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/matrix/utils.rkt | racket | Sometimes necessary because TR can't do inference with keyword arguments yet
Note: this accepts +nan.0
Find the element with maximum magnitude in a column
begin-encourage-inline | #lang typed/racket/base
(require racket/performance-hint
racket/string
racket/fixnum
math/base
"matrix-types.rkt"
"../unsafe.rkt"
"../array/array-struct.rkt"
"../vector/vector-mutate.rkt")
(provide (all-defined-out))
(: format-matrices/error ((Listof (Ar... |
b11d1d9ffa0f34e51c937dd6545f0fdc53dcd2193aed0656ddf2b5176361b4c1 | LexiFi/dead_code_analyzer | inc_val.mli | ./examples/advanced/inc_val.mli:1: x
./examples/advanced/inc_val.mli:2: y
| null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/check/classic/examples/advanced/inc_val.mli | ocaml | ./examples/advanced/inc_val.mli:1: x
./examples/advanced/inc_val.mli:2: y
| |
6fc3663f5e10b5daed9589721b7b8d64b7d91433a6b4b314b653cf393b7142bb | janestreet/core_bench | basic_tests.ml | open Core
open Core_bench
let get_float () = if Random.bool () then 10.0 else 10.0
let get_int () = Random.int 200000
let get_int64 () = if Random.bool () then Int64.of_int 10 else 10L
let scale t mul = Stdlib.int_of_float (Stdlib.float_of_int t *. mul)
let t1 = Bench.Test.create ~name:"Id" (fun () -> ())
let t2 =
... | null | https://raw.githubusercontent.com/janestreet/core_bench/d3bf745cdaf8a0b169c5e464584a35aeb5b08291/test/basic_tests.ml | ocaml | open Core
open Core_bench
let get_float () = if Random.bool () then 10.0 else 10.0
let get_int () = Random.int 200000
let get_int64 () = if Random.bool () then Int64.of_int 10 else 10L
let scale t mul = Stdlib.int_of_float (Stdlib.float_of_int t *. mul)
let t1 = Bench.Test.create ~name:"Id" (fun () -> ())
let t2 =
... | |
0df1122c6da042643ff75be79b93d0b87f62ca39ce593ec3c0a509a1c3e9c2a7 | pascal-knodel/haskell-craft | E'6'37.hs | --
--
--
-----------------
Exercise 6.37 .
-----------------
--
--
--
module E'6'37 where
import B'C'6 ( Image )
import E'6'36 ( superimposeImage )
import Pictures
(
height
, width
)
-- "How would you use Image superimposition to give analogues of above and beside for Images?"
--
above : First image... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Chapter%206/E'6'37.hs | haskell |
---------------
---------------
"How would you use Image superimposition to give analogues of above and beside for Images?"
... other ways of using different Image superimpositions,
coordinate transformations and picture positions exist. | Exercise 6.37 .
module E'6'37 where
import B'C'6 ( Image )
import E'6'36 ( superimposeImage )
import Pictures
(
height
, width
)
above : First image above second image , at the second coordinates .
beside : First image beside second image , at the second coordinates .
imageAbove, imageBeside :: ... |
b87dea8e77209b867a0ebf100ff61610eca64223313323783b70941bf90848da | paurkedal/inhca | inhca_tools.server.ml | Copyright ( C ) 2014 - -2016 Petter A. Urkedal < >
*
* This program 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 your option ) any later ver... | null | https://raw.githubusercontent.com/paurkedal/inhca/c2cc4abce931684fb17ac88169822178956f18e3/web/inhca_tools.server.ml | ocaml | Copyright ( C ) 2014 - -2016 Petter A. Urkedal < >
*
* This program 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 your option ) any later ver... | |
82f53dabc865f811bb91a8ae9ef032fd24f45427b3da753051ff5411e6002c9a | technion/ct_advisor | domain_parse.erl | -module(domain_parse).
-export([cert_domain_list/1]).
% A list of certificates with a list of names
-spec cert_domain_list([any()]) -> 'ok'.
cert_domain_list(Domains) ->
lager:info("Domain list for review: ~p" ,[Domains]),
lists:foreach(fun(X) -> per_cert_domains(X) end, Domains).
% A list of domains for an i... | null | https://raw.githubusercontent.com/technion/ct_advisor/d5f3120c468e4203caefbe57f1c64fa4b7017613/apps/ct_advisor/src/domain_parse.erl | erlang | A list of certificates with a list of names
A list of domains for an individual certificate
using lists:flatten/1 because it is always called this way | -module(domain_parse).
-export([cert_domain_list/1]).
-spec cert_domain_list([any()]) -> 'ok'.
cert_domain_list(Domains) ->
lager:info("Domain list for review: ~p" ,[Domains]),
lists:foreach(fun(X) -> per_cert_domains(X) end, Domains).
-spec per_cert_domains([{'dNSName', _}]) -> 'ok'.
per_cert_domains(Domains... |
fc9d0c53de679bd2697838ed95accf5f866e3d03f651bddc1abcc0521829bab4 | finnishtransportagency/harja | yha_yhteiset.clj | (ns harja.palvelin.integraatiot.yha.yha-yhteiset
"Sisältää YHA:n päällystykseen ja paikkaukseen liittyviä yhteisiä toimintoja.")
(defn yha-otsikot
"Muotoilee YHA:n api-keyn headerin"
[api-key json?]
(merge {"Content-Type" (if json?
"application/json"
"tex... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/222ecd9907e2a34364f8bf7bb4a1035939b039f6/src/clj/harja/palvelin/integraatiot/yha/yha_yhteiset.clj | clojure | (ns harja.palvelin.integraatiot.yha.yha-yhteiset
"Sisältää YHA:n päällystykseen ja paikkaukseen liittyviä yhteisiä toimintoja.")
(defn yha-otsikot
"Muotoilee YHA:n api-keyn headerin"
[api-key json?]
(merge {"Content-Type" (if json?
"application/json"
"tex... | |
1010c58418ea2f48a3fbbd410ad949797fdf06cf5879a5d3958a3b43e7de5ecd | elastic/eui-cljs | icon_app_pipeline.cljs | (ns eui.icon-app-pipeline
(:require ["@elastic/eui/lib/components/icon/assets/app_pipeline.js" :as eui]))
(def appPipeline eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_app_pipeline.cljs | clojure | (ns eui.icon-app-pipeline
(:require ["@elastic/eui/lib/components/icon/assets/app_pipeline.js" :as eui]))
(def appPipeline eui/icon)
| |
8113635c8cf317f2fc3f54952e4005a59bac0a18bd84cb320dde9950562c41ad | wlitwin/graphv | extraStubs.ml | open GlTypes
type vertex_array_object = int
let uniform_buffer_offset_alignment : enum = 0x8A34
let uniform_buffer : buffer_target = 0x8A11
let unpack_row_length : pixel_store_param = 0x0CF2
let unpack_skip_rows : pixel_store_param = 0x0CF3
let unpack_skip_pixels : pixel_store_param = 0x0CF4
let red : pixel_format = 0... | null | https://raw.githubusercontent.com/wlitwin/graphv/d0a09575c5ff5ee3727c222dd6130d22e4cf62d9/src/native3/extraStubs.ml | ocaml | offset
size | open GlTypes
type vertex_array_object = int
let uniform_buffer_offset_alignment : enum = 0x8A34
let uniform_buffer : buffer_target = 0x8A11
let unpack_row_length : pixel_store_param = 0x0CF2
let unpack_skip_rows : pixel_store_param = 0x0CF3
let unpack_skip_pixels : pixel_store_param = 0x0CF4
let red : pixel_format = 0... |
358fb11a5755d7b4554c78a7ad2d1c82d6dd169dbacca9db7aec5f1706f74ab9 | puppetlabs/puppetserver | jruby_puppet_testutils.clj | (ns puppetlabs.services.jruby.jruby-puppet-testutils
(:require [puppetlabs.services.jruby.jruby-puppet-core :as jruby-puppet-core]
[puppetlabs.services.jruby-pool-manager.jruby-core :as jruby-core]
[puppetlabs.services.jruby.jruby-puppet-schemas :as jruby-puppet-schemas]
[puppetlab... | null | https://raw.githubusercontent.com/puppetlabs/puppetserver/2d6ca01b4b72716ca543b606f752261b969e401b/test/unit/puppetlabs/services/jruby/jruby_puppet_testutils.clj | clojure |
Constants
The implementation of this function is based on and very similar to
`prime-pool!` in `puppetlabs.services.jruby-pool-manager.impl.jruby-agents`
from the jruby-utils library. | (ns puppetlabs.services.jruby.jruby-puppet-testutils
(:require [puppetlabs.services.jruby.jruby-puppet-core :as jruby-puppet-core]
[puppetlabs.services.jruby-pool-manager.jruby-core :as jruby-core]
[puppetlabs.services.jruby.jruby-puppet-schemas :as jruby-puppet-schemas]
[puppetlab... |
d1fca57ceb29ed7df34205d5efc65cbffddcbfd80968d75b12cab965f70ac281 | maybevoid/casimir | Base.hs | |
Module : . Base
Base module that defines the basic datatypes for implicit - effects .
Module : Casimir.Base
Base module that defines the basic datatypes for implicit-effects.
-}
module Casimir.Base
( Effect
, EffOps (..)
, EffFunctor (..)
, ImplicitOps (..)
, Eff
, EffConstrain... | null | https://raw.githubusercontent.com/maybevoid/casimir/ebbfa403739d6f258e6ac6793549006a0e8bff42/casimir/src/lib/Casimir/Base.hs | haskell | |
Module : . Base
Base module that defines the basic datatypes for implicit - effects .
Module : Casimir.Base
Base module that defines the basic datatypes for implicit-effects.
-}
module Casimir.Base
( Effect
, EffOps (..)
, EffFunctor (..)
, ImplicitOps (..)
, Eff
, EffConstrain... | |
d710ef1eb11d41c70cad6fec4820fd0c72d03f9f4b828021658fea7817256b96 | jeromesimeon/Galax | function_analysis.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/projection/function_analysis.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : function_analysis.mli , v 1.5 2007/02/01 22:08:52 simeon Exp $
type function_kind =
NOTE : This needs to be documented ! ! -
| UsedReturnSimple
| UsedReturnSubtree
| ReturnsPaths
| ReturnsDefault
val get_fun_analysis_t... |
7ed97bbc26fe425a62c58b7af79620e12d0707ea9c21ca9cae71dd01829b14ef | fluree/ledger | validation.clj | (ns fluree.db.ledger.transact.validation
(:require [fluree.db.util.async :refer [<? <?? go-try channel?] :as async-util]
[fluree.db.dbfunctions.core :as dbfunctions]
[fluree.db.query.range :as query-range]
[fluree.db.constants :as const]
[clojure.core.async :as async]
... | null | https://raw.githubusercontent.com/fluree/ledger/796ea08d2a78f7ebca35301fcb91c4159f68c5c2/src/fluree/db/ledger/transact/validation.clj | clojure | functions to validate transactions
if flakes exist, we already queued a fn for this subject, don't want multiple
TODO - calls to this now block to solve resource contention issues - can remove the promise as no longer do in background
combine multiple functions with an (and ...) wrapper
something put a promise in ... | (ns fluree.db.ledger.transact.validation
(:require [fluree.db.util.async :refer [<? <?? go-try channel?] :as async-util]
[fluree.db.dbfunctions.core :as dbfunctions]
[fluree.db.query.range :as query-range]
[fluree.db.constants :as const]
[clojure.core.async :as async]
... |
43243119ee87e5a9880d29abc3ff19fd88537291d7ff0a32cb81075af710a649 | tz-wrapped/tezos-btc | Parser.hs | SPDX - FileCopyrightText : 2019 Bitcoin Suisse
-
- SPDX - License - Identifier : LicenseRef - MIT - BitcoinSuisse
-
- SPDX-License-Identifier: LicenseRef-MIT-BitcoinSuisse
-}
# LANGUAGE ApplicativeDo #
module Client.Parser
( ClientArgs(..)
, ClientArgsRaw(..)
, DeployContractOptions (..)
, client... | null | https://raw.githubusercontent.com/tz-wrapped/tezos-btc/c26e3cf4e00bd53121c15929407a859b57c74527/src/Client/Parser.hs | haskell | | Tezos-client output parsers | SPDX - FileCopyrightText : 2019 Bitcoin Suisse
-
- SPDX - License - Identifier : LicenseRef - MIT - BitcoinSuisse
-
- SPDX-License-Identifier: LicenseRef-MIT-BitcoinSuisse
-}
# LANGUAGE ApplicativeDo #
module Client.Parser
( ClientArgs(..)
, ClientArgsRaw(..)
, DeployContractOptions (..)
, client... |
730b593b3563bd7e415940fe509979177db9fe233cec7c2f10bbd57f2d49db61 | facebook/flow | timeout.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/52e59c7a9dea8556e7caf0be2b2c5c2e310b5b65/src/hack_forked/utils/sys/timeout.mli | ocaml | Helpers for handling timeout, in particular input timeout.
Some silly people like to catch all exceptions. This means they need to explicitly detect and
* reraise the timeout exn. |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
a6b8946d20bd998fa792deb0e760755e596f43dfbad607fdc0602a36a7dfdd58 | tek/ribosome | PromptMode.hs | module Ribosome.Menu.Prompt.Data.PromptMode where
data PromptMode =
Insert
|
Normal
deriving stock (Eq, Show, Ord)
| null | https://raw.githubusercontent.com/tek/ribosome/8ab6fed463a10cddb8531dc333552707a60c7c96/packages/menu/lib/Ribosome/Menu/Prompt/Data/PromptMode.hs | haskell | module Ribosome.Menu.Prompt.Data.PromptMode where
data PromptMode =
Insert
|
Normal
deriving stock (Eq, Show, Ord)
| |
afa9de96f48b047af33533cb85a7f112917a23114b215c045bc44a3de2c2abb4 | clojure-interop/java-jdk | StAXResult.clj | (ns javax.xml.transform.stax.StAXResult
"Acts as a holder for an XML Result in the
form of a StAX writer,i.e.
XMLStreamWriter or XMLEventWriter.
StAXResult can be used in all cases that accept
a Result, e.g. Transformer,
Validator which accept
Result as input."
(:refer-clojure :only [require comment def... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/transform/stax/StAXResult.clj | clojure | (ns javax.xml.transform.stax.StAXResult
"Acts as a holder for an XML Result in the
form of a StAX writer,i.e.
XMLStreamWriter or XMLEventWriter.
StAXResult can be used in all cases that accept
a Result, e.g. Transformer,
Validator which accept
Result as input."
(:refer-clojure :only [require comment def... | |
f190f52fd34a13a3d6de9260b520b5761d1a4730352a2d45913db02ed2194600 | BranchTaken/Hemlock | test_of_real_to_real.ml | open! Basis.Rudiments
open! Basis
open I256
let test () =
let rec test_rs rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
let x = of_real r in
File.Fmt.stdout
|> Fmt.fmt "of_real "
|> Real.fmt ~alt:true ~radix:Radix.Hex r
|> Fmt.fmt " -> "
|> fmt ~a... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/i256/test_of_real_to_real.ml | ocaml | open! Basis.Rudiments
open! Basis
open I256
let test () =
let rec test_rs rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
let x = of_real r in
File.Fmt.stdout
|> Fmt.fmt "of_real "
|> Real.fmt ~alt:true ~radix:Radix.Hex r
|> Fmt.fmt " -> "
|> fmt ~a... | |
a8ef177dc0295326ec451dd0389b49ae2b9b5df287c299b6f5329e7c7b591ad6 | fused-effects/fused-effects | Parser.hs | {-# LANGUAGE DeriveTraversable #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Parser
( example
) wh... | null | https://raw.githubusercontent.com/fused-effects/fused-effects/9790ed4fb2cbaaf8933ce0eb42d7c55bc38f12ac/examples/Parser.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE GADTs # | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Parser
( example
) where
import Control.Algebra
import Con... |
feaecf216af51468fc3598fe0d026986bd6738351bc0581a64cb67aeaf34a687 | GaloisInc/json | Parallel.hs | -----------------------------------------------------------------------------
-- |
-- Module : Test.QuickCheck.Parallel
Copyright : ( c ) 2006
-- License : BSD-style (see the file LICENSE)
--
Maintainer :
-- Stability : experimental
Portability : non - portable ( uses Control . Except... | null | https://raw.githubusercontent.com/GaloisInc/json/329bbce8fd68a04a5377f48102c37d28160b246b/tests/Parallel.hs | haskell | ---------------------------------------------------------------------------
|
Module : Test.QuickCheck.Parallel
License : BSD-style (see the file LICENSE)
Stability : experimental
See the /Example.hs/ file for a complete overview.
with the SMP runtime's '-N4' (or however many OS threads you want... | Copyright : ( c ) 2006
Maintainer :
Portability : non - portable ( uses Control . Exception , Control . Concurrent )
A parallel batch driver for running QuickCheck on threaded or SMP systems .
module Parallel (
pRun,
pDet,
pNon
) where
import Test.QuickCheck
import Data.List
import... |
e1228e71d03281a6717fa253915ed658bdf1b3730c32d1e92ad31229bf9a7fbd | tonyvanriet/clj-slack-client | rtm_receive.clj | (ns clj-slack-client.rtm-receive
(:gen-class)
(:require
[clj-slack-client.team-state :as state]))
(defn dispatch-handle-event [event pass-event-to-host] (:type event))
(defmulti handle-event #'dispatch-handle-event)
(defmethod handle-event "message"
[event pass-event-to-host]
(pass-event-to-host event))... | null | https://raw.githubusercontent.com/tonyvanriet/clj-slack-client/6783f003ab93adae057890421622eb5e61ab033d/src/clj_slack_client/rtm_receive.clj | clojure | (ns clj-slack-client.rtm-receive
(:gen-class)
(:require
[clj-slack-client.team-state :as state]))
(defn dispatch-handle-event [event pass-event-to-host] (:type event))
(defmulti handle-event #'dispatch-handle-event)
(defmethod handle-event "message"
[event pass-event-to-host]
(pass-event-to-host event))... | |
4c5dd1c16c0e5709820b8ab67f58233a869b90c6e0dd5ac2959424b4f9282dfa | ndmitchell/weeder | Cabal.hs | {-# LANGUAGE ViewPatterns, RecordWildCards #-}
module Cabal(
Cabal(..), CabalSection(..), CabalSectionType,
parseCabal,
selectCabalFile,
selectHiFiles
) where
import System.IO.Extra
import System.Directory.Extra
import System.FilePath
import qualified Data.HashMap.Strict as Map
import Util
import ... | null | https://raw.githubusercontent.com/ndmitchell/weeder/3bc7ee09de6faf34cd60a0f4554aa1baf36f25e8/src/Cabal.hs | haskell | # LANGUAGE ViewPatterns, RecordWildCards #
| Return the (exposed Hi files, internal Hi files, not found)
error $ show (poss, Map.keys his)
| This code is fragile and keeps going wrong, should probably try a less "guess everything"
and a more refined filter and test. |
module Cabal(
Cabal(..), CabalSection(..), CabalSectionType,
parseCabal,
selectCabalFile,
selectHiFiles
) where
import System.IO.Extra
import System.Directory.Extra
import System.FilePath
import qualified Data.HashMap.Strict as Map
import Util
import Data.Char
import Data.Maybe
import Data.List.Ex... |
90b475d93dbef881cb6673e00c5c4217b79abc4e80a91f061f5072be14b614f9 | ocaml-flambda/ocaml-jst | asmlink.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/cc63992838e9c38833bbdf10cc8f70c6c9d077bc/asmcomp/asmlink.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Format
val link: ppf_dump:formatter -> string list -> string -> unit
val link_shared: p... |
7a86163e08e673c4b952f3ce47b028abf0b8bea7ab912959b1684af8e3514469 | lspitzner/brittany | Floating.hs | # LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
module Language.Haskell.Brittany.Internal.Transformations.Floating where
import qualified Data.Generics.Uniplate.Direct as Uniplate
import qualified GHC.OldList as List
import Language.Haskell.Brittany.Internal.Prelude
import Language.Haskell.Brittany.Internal.Pr... | null | https://raw.githubusercontent.com/lspitzner/brittany/7399b7538835411727e025e1480ea96b5496416c/source/library/Language/Haskell/Brittany/Internal/Transformations/Floating.hs | haskell | note that this is not total, and cannot be with that exact signature.
note that semantically, stepFull is completely sufficient.
but the bottom-up switch-to-top-down-on-match transformation has much
better complexity.
the push/pop cases would need to be copied over
prior floating in
post floating in
pos... | # LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
module Language.Haskell.Brittany.Internal.Transformations.Floating where
import qualified Data.Generics.Uniplate.Direct as Uniplate
import qualified GHC.OldList as List
import Language.Haskell.Brittany.Internal.Prelude
import Language.Haskell.Brittany.Internal.Pr... |
25df044d82974fd483284151f350e17937313c19a6b6295b2b43672005f0e0c0 | degree9/enterprise | async.cljs | (ns degree9.async
(:require-macros degree9.async))
| null | https://raw.githubusercontent.com/degree9/enterprise/36e4f242c18b1dde54d5a15c668b17dc800c01ff/src/degree9/async.cljs | clojure | (ns degree9.async
(:require-macros degree9.async))
| |
db9f82dc466634d7b9eb65ad5a7c1804aac3a0d192aa6468441f0e0354e9998f | jebberjeb/viz.cljc | image.cljs | (ns viz.image
(:require [vizjs]))
(defn image
[dot-string]
(js/Viz dot-string))
| null | https://raw.githubusercontent.com/jebberjeb/viz.cljc/0194d6510aa06de03577f8589faf80d7116afe0f/src/viz/image.cljs | clojure | (ns viz.image
(:require [vizjs]))
(defn image
[dot-string]
(js/Viz dot-string))
| |
f19621cd19c86d518ef21036c4e06ba3e3007a62ed057ca86d7b02e1ee9c8cff | spurious/sagittarius-scheme-mirror | private.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
dbm / private.scm - abstract base DBM class library
;;;
Copyright ( c ) 2010 - 2013 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/dbm/private.scm | scheme | coding : utf-8 ; -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime... | dbm / private.scm - abstract base DBM class library
Copyright ( c ) 2010 - 2013 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( I... |
a6d5a2e4f5c6fb9dc615793d594707086c1dc9fd26852b625167fb216b38ad65 | reborg/clojure-essential-reference | 2.clj | < 1 >
< 2 >
{:initial-count 3}
(meta (with-meta (with-meta [1 2 3] {:a 1}) {:a 2})) ; <3>
{ : a 2 }
< 4 >
;; nil
< 5 >
ClassCastException clojure.lang . Atom can not be cast to clojure.lang . | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/OtherFunctions/VarsandNamespaces/meta%2Cwith-meta%2Cvary-meta%2Calter-meta!andreset-meta!/2.clj | clojure | <3>
nil | < 1 >
< 2 >
{:initial-count 3}
{ : a 2 }
< 4 >
< 5 >
ClassCastException clojure.lang . Atom can not be cast to clojure.lang . |
348ba7188c803d8f0ddf66ca0712d0712f9f4a45de53cf114a2ac81a7701d618 | jabber-at/ejabberd | mod_proxy65_sql.erl | %%%-------------------------------------------------------------------
@author < >
Created : 30 Mar 2017 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/src/mod_proxy65_sql.erl | erlang | -------------------------------------------------------------------
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHA... | @author < >
Created : 30 Mar 2017 by < >
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
wit... |
9d45863d909c56a507dbadcc06f9c4ae47163b5da72afe33e8dcc6670c8e198e | dbuenzli/rel | rel_sqlite3.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The rel programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2... | null | https://raw.githubusercontent.com/dbuenzli/rel/004a5582fe88c2dead0ddaf7a6adbe8da5956bde/src/rel_sqlite3.ml | ocaml | Circular doubly linked list
None is for the root.
on root this points to last element.
Key-value map with access to lru binding.
Errors, note that our open' sets the connection to always return extended
error code.
Database connection
Boxed pointer to sqlite3 struct
Errors
Result codes
Errors
... | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The rel programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2... |
b31a23ea49973781369c1c9b27e0c14a6ad0ab8e310b97245e8bb07b34d3594d | gregtatcam/imaplet-lwt | account.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/commands/account.ml | ocaml | encrypt messages, default true
compress messages, but not attachments, default true
compress attachments, default false
compress repo, default None
require user authentication, priv key encrypted with password, default true
*
CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT
SORT=DIS... |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
7fd0ff4e9e364c3eea7f8495b71f76b95fe1a6de9ccb554e8da88eb647c4bde2 | sebsheep/elm2node | Localizer.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE OverloadedStrings #-}
module Reporting.Render.Type.Localizer
( Localizer
, toDoc
, toChars
, empty
, fromNames
, fromModule
)
where
import qualified Data.Map as Map
import qualified Data.Name as Name
import qualified Data.Set as Set
import qualified AST.Source as Sr... | null | https://raw.githubusercontent.com/sebsheep/elm2node/602a64f48e39edcdfa6d99793cc2827b677d650d/compiler/src/Reporting/Render/Type/Localizer.hs | haskell | # LANGUAGE OverloadedStrings #
FROM NAMES
FROM MODULE | # OPTIONS_GHC -Wall #
module Reporting.Render.Type.Localizer
( Localizer
, toDoc
, toChars
, empty
, fromNames
, fromModule
)
where
import qualified Data.Map as Map
import qualified Data.Name as Name
import qualified Data.Set as Set
import qualified AST.Source as Src
import qualified Elm.ModuleName a... |
d9582eaa47ba84105764cee401328f254aaf11ab26011c8dc618c1b5fe605e3f | gstew5/snarkl | Peano.hs | # LANGUAGE RebindableSyntax
, #
, DataKinds
#-}
module Peano where
import Prelude hiding
( (>>)
, (>>=)
, (+)
, (-)
, (*)
, (/)
, (&&)
, return
, fromRational
, negate
)
import SyntaxMonad
import Syntax
import TExpr
type T... | null | https://raw.githubusercontent.com/gstew5/snarkl/d6ce72b13e370d2965bb226f28a1135269e7c198/src/examples/Peano.hs | haskell | # LANGUAGE RebindableSyntax
, #
, DataKinds
#-}
module Peano where
import Prelude hiding
( (>>)
, (>>=)
, (+)
, (-)
, (*)
, (/)
, (&&)
, return
, fromRational
, negate
)
import SyntaxMonad
import Syntax
import TExpr
type T... | |
d9b7fa3bb1e67432ea483cba73e7b3ef8f84f44e1868226715ae628c2214b178 | imdea-software/leap | test_yicesparser.ml |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/tests/test_yicesparser.ml | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
bd125d933b72b81360deba2b4e165ab4e5a1c0807c60b7843e1b36b3ca33fc51 | potatosalad/erlang-jose | jose_SUITE.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
-module(jose_SUITE).
-include_lib("common_test/include/ct.hrl").
-include("jose_public_key.hrl").
-include_lib("public_key/include/public_key.hrl").
-include("jose.hrl").
%% ct.
-export([all/0... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/291dbb86fb5e5c71a8395b3f68c16f31f8bd06db/test/jose_SUITE.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
ct.
Tests.
====================================================================
Tests
====================================================================
A.1. Ed25519 private key
[-ietf-jose-cfrg-curves-00#appendix-A.1]
A.1
A_1_SK = << A_1_Secret/binary, A_1_PK/binary >>,
A.2. ... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
-module(jose_SUITE).
-include_lib("common_test/include/ct.hrl").
-include("jose_public_key.hrl").
-include_lib("public_key/include/public_key.hrl").
-include("jose.hrl").
-export([all/0]).
-export([groups/0]).
-export([init_p... |
6d30f80b6ab8ed5690a47c42fbd8ba27eb485bbd72e45a7f1939370445f0acaf | racket/typed-racket | parse-type-tests.rkt | #lang racket/base
(require "test-utils.rkt"
"evaluator.rkt"
(for-syntax
racket/base
racket/dict
racket/set
racket/list
syntax/parse
typed-racket/base-env/base-structs
typed-racket/env/tvar-env
typed-racket/env/type... | null | https://raw.githubusercontent.com/racket/typed-racket/8b7bd594c66e53beba3d2568ca5ecb28f61c6d96/typed-racket-test/unit-tests/parse-type-tests.rkt | racket | needed for parsing case-lambda/case-> types
requires transformer time stuff that doesn't work
[(Refinement even?) (make-Refinement #'even?)]
[((. Number) -> Number) (->* (list) N N)] ;; not legal syntax
PR 14554, non-productive recursive type
->* types
struct types
keyword function types
#:rest-star tests
Prefa... | #lang racket/base
(require "test-utils.rkt"
"evaluator.rkt"
(for-syntax
racket/base
racket/dict
racket/set
racket/list
syntax/parse
typed-racket/base-env/base-structs
typed-racket/env/tvar-env
typed-racket/env/type... |
b2a1b8307c56f2092c568d0e80a119da960694154f7c8e5977a03852d9dec522 | Daniel-Diaz/HaTeX | Syntax.hs |
# LANGUAGE CPP , DeriveDataTypeable , DeriveGeneric #
-- | LaTeX syntax description in the definition of the 'LaTeX' datatype.
-- If you want to add new commands or environments not defined in
the library , import this module and use ' LaTeX ' data constructors .
module Text.LaTeX.Base.Syntax
( -- * @LaTeX@ da... | null | https://raw.githubusercontent.com/Daniel-Diaz/HaTeX/aae193763157378500ebedc733c913e74f53b060/Text/LaTeX/Base/Syntax.hs | haskell | | LaTeX syntax description in the definition of the 'LaTeX' datatype.
If you want to add new commands or environments not defined in
* @LaTeX@ datatype
* Escaping reserved characters
* Syntax analysis
** Utils
For instance:
^ Centimeter.
^ Inch.
| Different types of syntax for mathematical expressions.... |
# LANGUAGE CPP , DeriveDataTypeable , DeriveGeneric #
the library , import this module and use ' LaTeX ' data constructors .
module Text.LaTeX.Base.Syntax
Measure (..)
, MathType (..)
, LaTeX (..)
, TeXArg (..)
, (<>), between
, protectString
, protectText
, matchCommand
, lookForCommand
, matchEnv
,... |
80ea7ec820ab149fe136d59ce3d7f7dc898b25122923aea1694e0e358c696589 | hidaris/thinking-dumps | tests.rkt | (module tests mzscheme
(provide test-list)
;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;;
(define test-list
'(
;; simple arithmetic
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
;; nested arithmetic
(nested-arith-left "-(-(44,33),22)" -11)
... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/eopl-solutions/chap4/4-10/explicit-refs/tests.rkt | racket | tests ;;;;;;;;;;;;;;;;
simple arithmetic
nested arithmetic
simple variables
simple unbound variables
simple conditionals
test dynamic typechecking
make sure that the test and both arms get evaluated
properly.
and make sure the other arm doesn't get evaluated.
simple let
check nested let and shadowing
simpl... | (module tests mzscheme
(provide test-list)
(define test-list
'(
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
(test-var-1 "x" 10)
(test-var-2 "-(... |
fb8613ee0f8f185cd696afb577627e99827e76f0a73fdbb486a0ad97462b3243 | voxoz/emqttd | emqttd_kvs.erl | -module(emqttd_kvs).
-include_lib("kvs/include/metainfo.hrl").
-include("emqttd.hrl").
-export([metainfo/0,tables/0]).
metainfo() -> #schema{name=kvs,tables= tables() }.
tables() -> [ #table{name=mqtt_subproperty,
fields=record_info(fields,mqtt_subproperty),
copy_type=... | null | https://raw.githubusercontent.com/voxoz/emqttd/2be612e0e7a00a866cd9af350a030966d73fbc09/src/emqttd_kvs.erl | erlang | -module(emqttd_kvs).
-include_lib("kvs/include/metainfo.hrl").
-include("emqttd.hrl").
-export([metainfo/0,tables/0]).
metainfo() -> #schema{name=kvs,tables= tables() }.
tables() -> [ #table{name=mqtt_subproperty,
fields=record_info(fields,mqtt_subproperty),
copy_type=... | |
9f2ef2ba6a0677efb5aa837f63f059d980dad01787854c17306276af9943b715 | sondresl/AdventOfCode | Day18.hs | {-# LANGUAGE OverloadedStrings #-}
module Day18 where
import Text.Parsec
( char, digit, string, between, many1, (<?>), (<|>), parse, Parsec )
import Text.Parsec.Expr
( buildExpressionParser, Assoc(AssocLeft), Operator(Infix) )
import Control.Lens (Identity)
type Op = Operator String () Identity Int
type Parse... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/51525441795417f31b3eb67a690aa5534d1e699b/2020/Haskell/src/Day18.hs | haskell | # LANGUAGE OverloadedStrings # | module Day18 where
import Text.Parsec
( char, digit, string, between, many1, (<?>), (<|>), parse, Parsec )
import Text.Parsec.Expr
( buildExpressionParser, Assoc(AssocLeft), Operator(Infix) )
import Control.Lens (Identity)
type Op = Operator String () Identity Int
type Parser = Parsec String ()
expr1 :: Pars... |
fdaaf7359efd24967206f1663a2d3cbe63ff6479bfc0995ed13ed748281678b9 | fission-codes/fission | Stat.hs | module Network.IPFS.Stat
( getStatRemote
, getSizeRemote
, getSize
, module Network.IPFS.Stat.Types
) where
import Data.ByteString.Lazy.Char8 as CL
import qualified RIO.ByteString.Lazy as Lazy
import qualified RIO.List as List
import qualified Network.IPFS.Internal.UTF8 a... | null | https://raw.githubusercontent.com/fission-codes/fission/fb76d255f06ea73187c9b787bd207c3778e1b559/ipfs/library/Network/IPFS/Stat.hs | haskell | module Network.IPFS.Stat
( getStatRemote
, getSizeRemote
, getSize
, module Network.IPFS.Stat.Types
) where
import Data.ByteString.Lazy.Char8 as CL
import qualified RIO.ByteString.Lazy as Lazy
import qualified RIO.List as List
import qualified Network.IPFS.Internal.UTF8 a... | |
8e2071f667e74eab5309ca2d87e5036fcbb8870dc3e05f495bc4d271d92c3eb4 | prg-titech/baccaml | simple2.ml | ;;
let rec interp code pc a =
jit_dipatch (pc = 0) code a;
(* if pc = 0 then test_trace a bytecode else *)
let instr = code.(pc) in
if instr = 0
then (* INCR_A *)
interp code (pc + 1) (a + 1)
else if instr = 1
then (* DECR_A *)
interp code (pc + 1) (a - 1)
else if instr = 10
then (
JUMP
... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/test/interp_example/simple2.ml | ocaml | if pc = 0 then test_trace a bytecode else
INCR_A
DECR_A
HALT
OTHERS
then
else | ;;
let rec interp code pc a =
jit_dipatch (pc = 0) code a;
let instr = code.(pc) in
if instr = 0
interp code (pc + 1) (a + 1)
else if instr = 1
interp code (pc + 1) (a - 1)
else if instr = 10
then (
JUMP
let t = code.(pc + 1) in
interp code t a)
else if instr = 11
then
JUMP_IF
if... |
9d7569fa1bee361d25a2b1810fa0b123a3307119e491b7492677fdcd7e7ffedc | AndrasKovacs/ELTE-func-lang | Notes12.hs | # language BangPatterns #
module Notes12 where
import Data.List
import Data.Foldable
Haskell fordítás / optimalizálás
--------------------------------------------------------------------------------
Optimalizálás : fordító által
programozó által
-- Haskell-ben:
- GHC jelentősen átalakítja... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-1/ea/Notes12.hs | haskell | ------------------------------------------------------------------------------
Haskell-ben:
Alap futási modell
------------------------------------------------------------------------------
let g = f True
case mf of
( f top - level ( Bool - > Bool ) , , closure is )
closure létrehozása:
primitív 64 bites... | # language BangPatterns #
module Notes12 where
import Data.List
import Data.Foldable
Haskell fordítás / optimalizálás
Optimalizálás : fordító által
programozó által
- GHC jelentősen átalakítja a kódot ,
- ( több transzformálására , mellékhatás - mentes átrendezi a fordító )
... |
7252930bd9f66275401705c2719860285d22a03558ca4a7b12b6d363d282beb9 | mattmundell/nightshade | build.lisp | Interface to build system .
(in-package "ED")
(defhistory *build-target-history* *build-target-history-pointer* 50)
(defcommand "Build" (p)
"Prompt for and build one of the targets defined in Build.lisp in the
current directory.
With an argument first prompt for a directory to make the directory
curren... | null | https://raw.githubusercontent.com/mattmundell/nightshade/7a67f9eac96414355de1463ec251b98237cb4009/src/ed/build.lisp | lisp | Interface to build system .
(in-package "ED")
(defhistory *build-target-history* *build-target-history-pointer* 50)
(defcommand "Build" (p)
"Prompt for and build one of the targets defined in Build.lisp in the
current directory.
With an argument first prompt for a directory to make the directory
curren... | |
2966945fd1e5bdc5bb42cbde7a45c3358c8bdcbde4f00ae89994e17c94bc15c9 | moquist/datomic-schematode | config.clj | (ns datomic-schematode.examples.deli-menu-test.config
(:require [clojure.test :refer :all]
[datomic.api :as d]
[datomic-schematode.examples.deli-menu :as deli-menu]))
(defn with-db [f]
(d/create-database deli-menu/db-url)
(f)
(d/delete-database deli-menu/db-url))
| null | https://raw.githubusercontent.com/moquist/datomic-schematode/b73206fc86bb61bc97ddd5df55f7441bf5fc0447/test/datomic_schematode/examples/deli_menu_test/config.clj | clojure | (ns datomic-schematode.examples.deli-menu-test.config
(:require [clojure.test :refer :all]
[datomic.api :as d]
[datomic-schematode.examples.deli-menu :as deli-menu]))
(defn with-db [f]
(d/create-database deli-menu/db-url)
(f)
(d/delete-database deli-menu/db-url))
| |
6878cae80b97434d307cb1fa9387506a291fccc5041c6e0dd37bc86175ded0e6 | janegca/htdp2e | Exercise-024-MovieTheatreV2.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Exercise-024-MovieTheatreV2) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htd... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/01-FixedSizeData/Exercise-024-MovieTheatreV2.rkt | racket | about the language level of this file in a form that our tools can easily process.
Determine the potential profit for the following ticket prices:
Which price should the owner of the movie theater choose to maximize his
profits? Determine the best ticket price down to a dime.
Constants
# of attendees is based o... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname Exercise-024-MovieTheatreV2) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))... |
f5aa91a4de628d40b7e61d9b2bc504c746fd3e8110b03ac7273c1d58c97e19b9 | Tritlo/PropR | Tests.hs | # LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
module Main where
import Control.Arrow
import Data.Bits (finiteBitSize)
import Data.Default
import Data.Dynamic (Dynamic, fromDynamic)
import Data.List (find, sort)
import qualified Data.Map as Map
import Data.Maybe (catMaybes,... | null | https://raw.githubusercontent.com/Tritlo/PropR/131abe4e67e9854473d778d4fa71cbb12f757ddd/tests/Tests.hs | haskell | Helpers
A simple tests to see if we can repair (foldl (-) 0) to (foldl (+) 0)
We generate the trace
with holes: | # LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
module Main where
import Control.Arrow
import Data.Bits (finiteBitSize)
import Data.Default
import Data.Dynamic (Dynamic, fromDynamic)
import Data.List (find, sort)
import qualified Data.Map as Map
import Data.Maybe (catMaybes,... |
dca50756f2aaa55e2e6bda3a13eb3948dee38c5edad2ccbfa3e35b5034f58308 | elm-lang/elm-reactor | Socket.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE OverloadedStrings #-}
module Socket (watchFile) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Exception (SomeException, catch)
import qualified Data.ByteString.Char8 as BS
import qualified Network.WebSockets as WS
import qualified System.FSNotify.Devel as Notif... | null | https://raw.githubusercontent.com/elm-lang/elm-reactor/6f15395aa307aaaf287919a326f4ffb31bb5eb4a/src/backend/Socket.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -Wall #
module Socket (watchFile) where
import Control.Concurrent (forkIO, threadDelay)
import Control.Exception (SomeException, catch)
import qualified Data.ByteString.Char8 as BS
import qualified Network.WebSockets as WS
import qualified System.FSNotify.Devel as Notify
import qualified System.FSNotify ... |
a89b5041fa4288a6a23a5c161bfb30d9255c6d4238da835cb5579cc680c97b60 | startalkIM/ejabberd | http_clear_staff.erl | -module(http_clear_staff).
-export([handle/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
-record(muc_online_room,
{name_host = {<<"">>, <<"">>} :: {binary(), binary()} | '$1' |{'_', binary()} | '_', pid = self() :: pid() | '$2' | '_' | '$1'}).
handle(Req) ->
{Method, Req1} = cowboy_re... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/http_clear_staff.erl | erlang | -module(http_clear_staff).
-export([handle/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
-record(muc_online_room,
{name_host = {<<"">>, <<"">>} :: {binary(), binary()} | '$1' |{'_', binary()} | '_', pid = self() :: pid() | '$2' | '_' | '$1'}).
handle(Req) ->
{Method, Req1} = cowboy_re... | |
6ec3647b777372bc11ec27ac2ad39b75477f36683643f3955aaaa74e762d2bed | pavlobaron/ErlangOTPBookSamples | lists1.erl | -module(lists1).
-export([first/1, print/1, sum/1, filter/1]).
first([H|_]) ->
H.
print([]) -> ok;
print([H|T]) ->
io:format("~p~n", [H]),
print(T).
sum(L) ->
dosum(L, 0).
dosum([], Sum) ->
io:format("Sum: ~p~n", [Sum]);
dosum([H|T], Sum) ->
dosum(T, Sum + H).
filter(L)... | null | https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/sprache/lists1.erl | erlang | -module(lists1).
-export([first/1, print/1, sum/1, filter/1]).
first([H|_]) ->
H.
print([]) -> ok;
print([H|T]) ->
io:format("~p~n", [H]),
print(T).
sum(L) ->
dosum(L, 0).
dosum([], Sum) ->
io:format("Sum: ~p~n", [Sum]);
dosum([H|T], Sum) ->
dosum(T, Sum + H).
filter(L)... | |
9619ce0f4d58a3844195c09c14632bf9315b57f513a2f1f9186af3ebd4204aef | nuvla/ui | spec.cljs | (ns sixsq.nuvla.ui.apps-component.spec
(:require [clojure.spec.alpha :as s]
[sixsq.nuvla.ui.utils.spec :as spec-utils]))
; create an initial entry for new components
(def defaults {::module-component {::image {}
::ports (sorted-map)
... | null | https://raw.githubusercontent.com/nuvla/ui/239eee3b7661b5f0b84117334d40c645de817c1c/code/src/cljs/sixsq/nuvla/ui/apps_component/spec.cljs | clojure | create an initial entry for new components
Image
Volumes (mounts)
::volume-options
Module | (ns sixsq.nuvla.ui.apps-component.spec
(:require [clojure.spec.alpha :as s]
[sixsq.nuvla.ui.utils.spec :as spec-utils]))
(def defaults {::module-component {::image {}
::ports (sorted-map)
::mounts (sorted-map)
... |
83b33af6765b8db6318ed5a8505476b7fb5cb9cbd2ddf87b1b584b8d75f34a52 | input-output-hk/cardano-wallet-legacy | Scenario.hs | module Test.Integration.Framework.Scenario
( Scenario
) where
import Universum
import Test.Hspec.Core.Spec (Example (..), Result (..),
ResultStatus (..))
-- | A Wrapper around 'StateT' around which we define a few instances. The most
-- interesting one is 'Example'
n... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet-legacy/143e6d0dac0b28b3274600c6c49ec87e42ec9f37/test/integration/Test/Integration/Framework/Scenario.hs | haskell | | A Wrapper around 'StateT' around which we define a few instances. The most
interesting one is 'Example'
| We emulate the 'MonadReader' using the 'MonadState' instance, this way, we
can lower down our constraints for methods that actually just read the state.
| This gives us the ability to define our spec as `Sce... | module Test.Integration.Framework.Scenario
( Scenario
) where
import Universum
import Test.Hspec.Core.Spec (Example (..), Result (..),
ResultStatus (..))
newtype Scenario s m a = Scenario (StateT s m a)
deriving newtype
( Functor
, Applicative
... |
623908601afe47f224f3e555646de5fbeda3e283823249c9e54bfa021ccae3b3 | Clozure/ccl-tests | loop17.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Thu Nov 21 09:48:38 2002
;;;; Contains: Miscellaneous loop tests
(in-package :cl-test)
;;; Initially and finally take multiple forms,
;;; and execute them in the right order
(deftest loop.17.1
(loop
with x = 0
initially (incf x 1) (incf x (+ x x))
initi... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/loop17.lsp | lisp | -*- Mode: Lisp -*-
Contains: Miscellaneous loop tests
Initially and finally take multiple forms,
and execute them in the right order
iteration clause grouping
Test that explicit calls to macroexpand in subforms
are done in the correct environment | Author :
Created : Thu Nov 21 09:48:38 2002
(in-package :cl-test)
(deftest loop.17.1
(loop
with x = 0
initially (incf x 1) (incf x (+ x x))
initially (incf x (+ x x x))
until t
finally (incf x 100) (incf x (+ x x))
finally (return x))
336)
(deftest loop.17.2
(loop
with x = 0
... |
53f76552def019c2ba4609b40514b53761993081af28babed1e552b771528c92 | debug-ito/net-spider | SnapshotSpec.hs | module NetSpider.CLI.SnapshotSpec (main,spec) where
import Data.List (isInfixOf)
import NetSpider.Interval (interval, Extended(..))
import NetSpider.Query
( startsFrom, defQuery, timeInterval,
foundNodePolicy, policyAppend,
Query
)
import NetSpider.Timestamp (fromEpochMillisecond)
import qualified Options.... | null | https://raw.githubusercontent.com/debug-ito/net-spider/82dfbdca1add1edfd54ef36cb1ca5129d528b814/net-spider-cli/test/NetSpider/CLI/SnapshotSpec.hs | haskell | module NetSpider.CLI.SnapshotSpec (main,spec) where
import Data.List (isInfixOf)
import NetSpider.Interval (interval, Extended(..))
import NetSpider.Query
( startsFrom, defQuery, timeInterval,
foundNodePolicy, policyAppend,
Query
)
import NetSpider.Timestamp (fromEpochMillisecond)
import qualified Options.... | |
19657da6ead2a29a35232a05f15dbeb4e3bce0e0833c17d94abbd31bba055452 | ndmitchell/tagsoup | Parser.hs |
module Compiler.Parser(parse) where
import Compiler.Lp
import Compiler.Util
parse :: String -> Program
parse = map parseRule . chunks . filter (not . dull) . lines
where
dull x = all isSpace x || "#" `isPrefixOf` x
chunks = rep (\(x:xs) -> first (x:) $ break (not . isSpace . head) xs)
parseRul... | null | https://raw.githubusercontent.com/ndmitchell/tagsoup/e116d3b965e4f149581bd55e45a05661b1113536/dead/parser/Compiler/Parser.hs | haskell | ------------------------------------------------------------------- |
module Compiler.Parser(parse) where
import Compiler.Lp
import Compiler.Util
parse :: String -> Program
parse = map parseRule . chunks . filter (not . dull) . lines
where
dull x = all isSpace x || "#" `isPrefixOf` x
chunks = rep (\(x:xs) -> first (x:) $ break (not . isSpace . head) xs)
parseRul... |
930b4e66bc06d925f3a2bfa9e23134ef1705b1b6e4763bf8178d389288c43e61 | facebookarchive/pfff | ifdef.ml | let foo x =
match x with
#if XXX
| 1 -> 1
#else
| 1 -> 2
#endif
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/tests/ml/parsing/ifdef.ml | ocaml | let foo x =
match x with
#if XXX
| 1 -> 1
#else
| 1 -> 2
#endif
| |
2d96258e3602bad5bb5a5eecf9f71af91330092c6373c5e4366ffb914f8a5d75 | tejasbubane/haskell-book-code | try.hs | module Main where
import Control.Exception
import System.Environment (getArgs)
willFail :: Integer -> IO (Either ArithException ())
willFail denom =
try $ print $ div 5 denom
-- Handle the error properly
handleArithException :: Show e => IO (Either e a) -> IO ()
handleArithException failure = do
ex <- failure
... | null | https://raw.githubusercontent.com/tejasbubane/haskell-book-code/deaac8ab4db0ae8692d0278826528bb8a746ed82/ch-30/try.hs | haskell | Handle the error properly
Compile and run passing arguments
./try 1 2 0 | module Main where
import Control.Exception
import System.Environment (getArgs)
willFail :: Integer -> IO (Either ArithException ())
willFail denom =
try $ print $ div 5 denom
handleArithException :: Show e => IO (Either e a) -> IO ()
handleArithException failure = do
ex <- failure
case ex of
Left e -> put... |
8bb7e1022f850a6cd16e634b6a9dd4efe5de78c1bfebc4ff87462c6e5d866fdd | patricoferris/ocaml-multicore-monorepo | graphql_async.mli | (** GraphQL schema with Async support *)
module Schema : sig
include Graphql_intf.Schema with type 'a Io.t = 'a Async_kernel.Deferred.t
and type 'a Io.Stream.t = 'a Async_kernel.Pipe.Reader.t
and type field_error = string
end
| null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/ocaml-graphql-server/graphql-async/src/graphql_async.mli | ocaml | * GraphQL schema with Async support | module Schema : sig
include Graphql_intf.Schema with type 'a Io.t = 'a Async_kernel.Deferred.t
and type 'a Io.Stream.t = 'a Async_kernel.Pipe.Reader.t
and type field_error = string
end
|
426ded85868b05de21cca507580e2c6c0431eaa824978ab4c6bf6100ee6e396d | mzp/coq-ide-for-ios | constrextern.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/interp/constrextern.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
Translation of pattern, cases p... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : constrextern.mli 13... |
74b834f535b3bb3446318f4b3e7f28f2e706f7784fdfc39c7d57d5d904634b2f | kudelskisecurity/scannerl | utils_http.erl | %% utils for parsing http and handling redirection
%%
%% when redirections occurs, you still need to check
%% that the redirection does not point back to your
%% original target and page after some redirections
%% as no internal stack of redirections is kept in here
%%
%% type of result returned:
{ ok , { Code , H... | null | https://raw.githubusercontent.com/kudelskisecurity/scannerl/8133065030d014401c47b2470e67a36e9df81b1e/src/utils/utils_http.erl | erlang | utils for parsing http and handling redirection
when redirections occurs, you still need to check
that the redirection does not point back to your
original target and page after some redirections
as no internal stack of redirections is kept in here
type of result returned:
as the body are returned
... | { ok , { Code , Headermap , Body } }
HTTP 200 received and a Map containing the header options as well
{ redirect , { error , empty } , { Code , Headermap , Body } }
Redirection found ( 3XX ) but no value
{ redirect , { error , cyclic } , { Code , Headermap , Body } }
red... |
bcfadb3f98695192f81a8b867a3af605704845356a406c4a908ce3f5c98bed19 | bhaskara/programmable-reinforcement-learning | array-exit-distribution.lisp | (in-package aed)
(defclass <array-exit-distribution> (<cond-prob-dist>)
((featurizer :reader featurizer :initarg :featurizer :type function
:initform (lambda (omega u) (cons (canonicalize omega) (canonicalize u))))
(key-fn :reader key-fn :type function :initarg :key-fn)
(cond-dists :type (simple-... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/alisp/rl-functions/array-exit-distribution.lisp | lisp | (in-package aed)
(defclass <array-exit-distribution> (<cond-prob-dist>)
((featurizer :reader featurizer :initarg :featurizer :type function
:initform (lambda (omega u) (cons (canonicalize omega) (canonicalize u))))
(key-fn :reader key-fn :type function :initarg :key-fn)
(cond-dists :type (simple-... | |
46d4a27172e316b3e95fcdd55c5b350208c98f1a84a44f325de81b0f8a25e22c | racket/web-server | stuffer.rkt | #lang racket/base
(require racket/contract
racket/match)
(define-struct stuffer (in out))
(define (stuffer/c dom rng)
(define in (dom . -> . rng))
(define in-proc (contract-late-neg-projection in))
(define out (rng . -> . dom))
(define out-proc (contract-late-neg-projection out))
(make-contract
... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/stuffers/stuffer.rkt | racket | #lang racket/base
(require racket/contract
racket/match)
(define-struct stuffer (in out))
(define (stuffer/c dom rng)
(define in (dom . -> . rng))
(define in-proc (contract-late-neg-projection in))
(define out (rng . -> . dom))
(define out-proc (contract-late-neg-projection out))
(make-contract
... | |
c435eb703c0b54d84a531cdff490b5084611caba060d5c92c08da38e74babb3c | zmyrgel/tursas | fen.clj | (ns tursas.state0x88.fen
(:use (tursas.state0x88 common util movegen move)
(tursas util)))
(def castling-values (list [8 \K] [4 \Q] [2 \k] [1 \q]))
(defn- castling->str
"Converts internal castling representation to string."
[castling]
(let [result (keep (fn [[value letter]]
(whe... | null | https://raw.githubusercontent.com/zmyrgel/tursas/362551a1861be0728f21b561d8907d0ca04333f7/src/tursas/state0x88/fen.clj | clojure | (ns tursas.state0x88.fen
(:use (tursas.state0x88 common util movegen move)
(tursas util)))
(def castling-values (list [8 \K] [4 \Q] [2 \k] [1 \q]))
(defn- castling->str
"Converts internal castling representation to string."
[castling]
(let [result (keep (fn [[value letter]]
(whe... | |
45236d4fa2d2a7d4a11fd928659656f533902916df27a61efa1aef2aa8a3ff8d | dgiot/dgiot | emqx_mod_delayed.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2021 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/c9f2f78af71692ba532e4806621b611db2afe0c9/lib-ce/emqx_modules/src/emqx_mod_delayed.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2021 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_mod_delayed).
-behaviour(gen_server).
-behaviour(emqx_gen_mod).
-include_lib("emq... |
4b5a66ccd5d7b763993b805e7580e385550206d3b0552bd2774880ec1bfba245 | Clozure/ccl-tests | search-bitvector.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Aug 25 13:06:54 2002
;;;; Contains: Tests for SEARCH on bit vectors
(in-package :cl-test)
(compile-and-load "search-aux.lsp")
(deftest search-bitvector.1
(let ((target *searched-bitvector*)
(pat #*0))
(loop for i from 0 to (1- (length target))
for t... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/search-bitvector.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests for SEARCH on bit vectors
Order of test, test-not | Author :
Created : Sun Aug 25 13:06:54 2002
(in-package :cl-test)
(compile-and-load "search-aux.lsp")
(deftest search-bitvector.1
(let ((target *searched-bitvector*)
(pat #*0))
(loop for i from 0 to (1- (length target))
for tail = (subseq target i)
always
(let ((pos (search pat tail)))
... |
a9c0b9d9ff37581fa66475a1cecae9d26b43963f71b6119fdd0dc768839c41c4 | qfpl/reflex-workshop | Apply.hs | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | null | https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/src/Exercises/Behaviors/Instances/Apply.hs | haskell | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | |
ddde715a1714c6fd1ab61bc73c4c32858dadab8d89770c545a859b8e5a1c50fd | tejasbubane/haskell-book-code | Pair.hs | module Pair where
import Test.QuickCheck
data Pair a b = Pair a b deriving (Eq, Show)
pairGen :: (Arbitrary a, Arbitrary b) => Gen (Pair a b)
pairGen = do
a <- arbitrary
b <- arbitrary
return $ Pair a b
instance (Arbitrary a, Arbitrary b) => Arbitrary (Pair a b) where
arbitrary = pairGen
arbPairIntInt :: G... | null | https://raw.githubusercontent.com/tejasbubane/haskell-book-code/deaac8ab4db0ae8692d0278826528bb8a746ed82/ch-14/testing/Pair.hs | haskell | module Pair where
import Test.QuickCheck
data Pair a b = Pair a b deriving (Eq, Show)
pairGen :: (Arbitrary a, Arbitrary b) => Gen (Pair a b)
pairGen = do
a <- arbitrary
b <- arbitrary
return $ Pair a b
instance (Arbitrary a, Arbitrary b) => Arbitrary (Pair a b) where
arbitrary = pairGen
arbPairIntInt :: G... | |
ddbd843135a82afdf5e3e2203a5cc755353a355464f2c1adbd0577d20f927553 | bhaskara/programmable-reinforcement-learning | hash-table-array.lisp |
(defpackage hash-table-array
(:documentation "Defines a data type for arrays of hash tables.
Types
-----
hash-table-array
Functions
---------
make-hta
get-val
set-val")
(:nicknames hta)
(:use
utils
cl)
(:export
hash-table-array
make-hta
get-val
set-val))
(in-packag... | null | https://raw.githubusercontent.com/bhaskara/programmable-reinforcement-learning/8afc98116a8f78163b3f86076498d84b3f596217/lisp/misc/hash-table-array.lisp | lisp |
(defpackage hash-table-array
(:documentation "Defines a data type for arrays of hash tables.
Types
-----
hash-table-array
Functions
---------
make-hta
get-val
set-val")
(:nicknames hta)
(:use
utils
cl)
(:export
hash-table-array
make-hta
get-val
set-val))
(in-packag... | |
a975bdb59f22462bf56d20867210086307186f9196e9203cfd58ad0f401a3d53 | anchpop/wise_mans_haskell | goodDo.hs | willWork = do
putStrLn "hello"
two <- pure ((1 + 1) :: Int)
putStrLn . show $ two | null | https://raw.githubusercontent.com/anchpop/wise_mans_haskell/021ca3f3d96ebc0ecf2daf1a802fc33d067e24cc/haskelltests/should_compile/goodDo.hs | haskell | willWork = do
putStrLn "hello"
two <- pure ((1 + 1) :: Int)
putStrLn . show $ two | |
7259d9a44a86a7ce385f1a2e3901b8c321e7ca4f05a32bed769c3db4eba57f9f | nikita-volkov/rerebase | Class.hs | module Control.Monad.Error.Class
(
module Rebase.Control.Monad.Error.Class
)
where
import Rebase.Control.Monad.Error.Class
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Control/Monad/Error/Class.hs | haskell | module Control.Monad.Error.Class
(
module Rebase.Control.Monad.Error.Class
)
where
import Rebase.Control.Monad.Error.Class
| |
ea7dd7d4bb140dd8f532ecca196b437f27e677ffa3593b27c5674aeec5197ee8 | iambrj/imin | select-instructions.rkt | #lang racket
(require "utilities.rkt"
"constants.rkt"
"utils.rkt")
(provide select-instructions)
(define (pmask t [mask 0])
(match t
[`(Vector) mask]
[`(Vector (Vector . ,_))
(bitwise-ior mask 1)]
[`(Vector ,_) mask]
[`(Vector . ((Vector . ,_) . ,rest))
(pmask `(Vector... | null | https://raw.githubusercontent.com/iambrj/imin/6365961b9d368c1688f0d43881a98c65a9596e0b/select-instructions.rkt | racket | v = (+ v a2)
v = (+ a1 v)
v = (+ a1 a2)
Invariant : allocate is only called when it is guaranteed that there is
enough space
Invariant : allocate can only appear in rhs of a let
size of tuple
Invariant : grammar restricts to immediate integer references, don't have
to worry about expressions evaluating to inte... | #lang racket
(require "utilities.rkt"
"constants.rkt"
"utils.rkt")
(provide select-instructions)
(define (pmask t [mask 0])
(match t
[`(Vector) mask]
[`(Vector (Vector . ,_))
(bitwise-ior mask 1)]
[`(Vector ,_) mask]
[`(Vector . ((Vector . ,_) . ,rest))
(pmask `(Vector... |
12abbdf5cd882ac2b9f2c456b93097f06bb7e73ca70f6d289323630ced98f81d | MaskRay/CamlFeatherweight | exe.ml | let size_offset =
if Config.word_size = 32 then
20
else
36
let gcsize_offset = 8
let tag_hd hd = Int32.(logand hd 255l |> to_int)
let tag_hd' hd = Int64.(logand hd 255L |> to_int)
let size_hd hd = Int32.(shift_right hd size_offset |> to_int)
let size_hd' hd = Int64.(shift_right hd size_offset |> to_int)
l... | null | https://raw.githubusercontent.com/MaskRay/CamlFeatherweight/989319a830dcf1ae30a4b4ccefb59f73bf966363/exe.ml | ocaml | let size_offset =
if Config.word_size = 32 then
20
else
36
let gcsize_offset = 8
let tag_hd hd = Int32.(logand hd 255l |> to_int)
let tag_hd' hd = Int64.(logand hd 255L |> to_int)
let size_hd hd = Int32.(shift_right hd size_offset |> to_int)
let size_hd' hd = Int64.(shift_right hd size_offset |> to_int)
l... | |
10a95cd84d221a9662910122b4fedfbe12d079cc7acc0066c4ebaa0e264dacfb | ollef/sixten | LanguageServer.hs | # LANGUAGE DisambiguateRecordFields #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
module LanguageServer where
import Protolude hiding (state)
import Control.Concurrent.STM as STM
import Control.Lens hiding (unsnoc)
import Data.Default (def)
import qualified Data.... | null | https://raw.githubusercontent.com/ollef/sixten/60d46eee20abd62599badea85774a9365c81af45/src/LanguageServer.hs | haskell | # LANGUAGE OverloadedStrings #
(Just "sixten-lsp.log")
-----------------------------------------------------------------------------
----------------------------------------------------------------------------- | # LANGUAGE DisambiguateRecordFields #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedLists #
module LanguageServer where
import Protolude hiding (state)
import Control.Concurrent.STM as STM
import Control.Lens hiding (unsnoc)
import Data.Default (def)
import qualified Data.HashMap.Lazy as HashMap
import qual... |
8219ae34e25ce47bd01792d4ed87754fc0ab15f8f4a723ff5fd63d16aeb074d9 | senapk/funcional_arcade | Main.hs | fn [] = True
fn [x] = True
fn (y:x:xs) = (y + 1 == x) && fn(x:xs)
main = do
vet <- readLn :: IO [Int]
print $ fn vet | null | https://raw.githubusercontent.com/senapk/funcional_arcade/70fa04b4799d5a8c7e5add39d9f217f38f418600/drafts/sucessores/Main.hs | haskell | fn [] = True
fn [x] = True
fn (y:x:xs) = (y + 1 == x) && fn(x:xs)
main = do
vet <- readLn :: IO [Int]
print $ fn vet | |
374095d22a123bdf9da2c07165fecfada77188855c7ddc635eaa5341db541e73 | ssor/erlangDemos | hi_server.erl | -module(hi_server).
-behaviour(gen_web_server).
%% API
-export([start_link/1, start_link/2]).
%% gen_web_server callbacks
-export([init/1, get/3, delete/3, put/4, post/4,
head/3, options/4, trace/4, other_methods/4]).
%%%===================================================================
%%% API
start_lin... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/erlware-Erlang-and-OTP-in-Action-Source/chapter_11/http_interface/src/hi_server.erl | erlang | API
gen_web_server callbacks
===================================================================
API
===================================================================
gen_web_server callbacks | -module(hi_server).
-behaviour(gen_web_server).
-export([start_link/1, start_link/2]).
-export([init/1, get/3, delete/3, put/4, post/4,
head/3, options/4, trace/4, other_methods/4]).
start_link(Port) ->
gen_web_server:start_link(?MODULE, Port, []).
start_link(IP, Port) ->
gen_web_server:start_lin... |
ffa31355d318caf954153294d47e2f6b4302b6fdc66ebe8a3faa000d32f19a6f | sondresl/AdventOfCode | Day24.hs | module Day24 where
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Lib
import Linear (V3 (..))
import Text.ParserCombinators.Parsec
type Hex = V3 Integer
data Dir
= NE
| E
| SE
| SW
| W
| NW
deriving (Show, Eq, Ord, Enum, Bounded)
-- -do-i-r... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/51525441795417f31b3eb67a690aa5534d1e699b/2020/Haskell/src/Day24.hs | haskell | -do-i-represent-a-hextile-hex-grid-in-memory
Parsing | module Day24 where
import qualified Data.Map as Map
import Data.Set (Set)
import qualified Data.Set as Set
import Lib
import Linear (V3 (..))
import Text.ParserCombinators.Parsec
type Hex = V3 Integer
data Dir
= NE
| E
| SE
| SW
| W
| NW
deriving (Show, Eq, Ord, Enum, Bounded)
move :: Di... |
b17ed618abe66ad31da5af5320610f2e3955555067f6212a7b4ffe5614b506f8 | artyom-poptsov/guile-ics | guix.scm | guix.scm --- GNU Guix package recipe -*- coding : utf-8 -*-
;;
Copyright ( C ) 2022 < >
;;
This file is part of Guile - ICS .
;;
;; This program 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 , e... | null | https://raw.githubusercontent.com/artyom-poptsov/guile-ics/0e6486244840a459355b017521f8b10f6e4ff118/guix.scm | scheme |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
The program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Publi... | guix.scm --- GNU Guix package recipe -*- coding : utf-8 -*-
Copyright ( C ) 2022 < >
This file is part of Guile - ICS .
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 ... |
94ed6b56cd790f0e1c125f094c5251431de618bceb6fb583b394f08db6cde08c | mbutterick/beautiful-racket | sample-import.rkt | #lang basic-demo-3
10 import [math/number-theory]
20 print [nth-prime](15)
30 print [prime?](24)
40 import [racket/base]
50 print [max](f(1), f(2), f(5), f(4))
60 def f(x) = x + x | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/basic-demo-3/sample-import.rkt | racket | #lang basic-demo-3
10 import [math/number-theory]
20 print [nth-prime](15)
30 print [prime?](24)
40 import [racket/base]
50 print [max](f(1), f(2), f(5), f(4))
60 def f(x) = x + x | |
43489f8d692bf9ebae34dcb5b1d361493cdd9afc2d658ad90df3c67b0db9e6cd | acw/eve | BlueprintInfo.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE PatternGuards #
# LANGUAGE RecordWildCards #
module EVE.Static.Database.BlueprintInfo(
BlueprintDatabase
, BlueprintInfo
)
where
import qualified Data.HashMap.Strict as HM
import Data.Map... | null | https://raw.githubusercontent.com/acw/eve/95c3a158e181e9708c2f3b5d998512bbc1b06e57/src/EVE/Static/Database/BlueprintInfo.hs | haskell | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE PatternGuards #
# LANGUAGE RecordWildCards #
module EVE.Static.Database.BlueprintInfo(
BlueprintDatabase
, BlueprintInfo
)
where
import qualified Data.HashMap.Strict as HM
import Data.Map... | |
a5c672590745ef38fc0a358dcbb238a288748ecf9c8c0172b962dbdb07d5f303 | UU-ComputerScience/uhc | ClassRec1.hs | {- ----------------------------------------------------------------------------------------
what : Recursive use of class in constraint
expected: ok
---------------------------------------------------------------------------------------- -}
module ClassRec1 where
class Data a where
gfoldl :: (forall d. Dat... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/99/ClassRec1.hs | haskell | ----------------------------------------------------------------------------------------
what : Recursive use of class in constraint
expected: ok
---------------------------------------------------------------------------------------- |
module ClassRec1 where
class Data a where
gfoldl :: (forall d. Data d => d) -> a
main
= return ()
|
7ab01f387c66040921770f2b4d7dd6a83063ecf0c74f482b0c9571e7587e1fab | wwezhuimeng/kazoo | rebar_xref.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2009 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this softw... | null | https://raw.githubusercontent.com/wwezhuimeng/kazoo/06a15811dbf123ae1601dc7a4ced956a7e04f58a/utils/rebar/src/rebar_xref.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2009 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the... |
e2aa6e89166fd9257fe83ab41f1cab99652733ed04dc612762aecc47d053c7d1 | lisp-mirror/clpm | paths.lisp | Definitions for pathnames to CLPM configuration .
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/config/paths
(:use #:cl)
(:export #:*clpm-config-directories*
#:clpm-config-pathname))
(in-package #:c... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/clpm/config/paths.lisp | lisp |
LICENSE for license information. | Definitions for pathnames to CLPM configuration .
This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/config/paths
(:use #:cl)
(:export #:*clpm-config-directories*
#:clpm-config-pathname))
(in-package #:clpm/config/paths)
(defvar *clpm-config-dir... |
7a70c7617ebd1ac21ed2df8cfde30c87f20495fe01c33f339575088ef6053782 | advancedtelematic/quickcheck-state-machine-distributed | QuickCheckHelpers.hs | module QuickCheckHelpers
( generateRequests
, shrinkRequests
, generateParallelRequests
, shrinkParallelRequests
, monadicProcess
)
where
import Control.Arrow
(second)
import Control.Distributed.Process
(Process)
import Control.Monad.Sta... | null | https://raw.githubusercontent.com/advancedtelematic/quickcheck-state-machine-distributed/a24e4202845dc48ed0923548c7211dd8670d5460/src/QuickCheckHelpers.hs | haskell | ----------------------------------------------------------------------
| Given shrinkers for the components of a pair we can shrink the pair.
| Same above, but for homogeneous pairs. | module QuickCheckHelpers
( generateRequests
, shrinkRequests
, generateParallelRequests
, shrinkParallelRequests
, monadicProcess
)
where
import Control.Arrow
(second)
import Control.Distributed.Process
(Process)
import Control.Monad.Sta... |
d745ba0288240759cbbdd29c585ec482aae525e3b9ca2147fd74506af5cb0f76 | dybber/fcl | Error.hs | # OPTIONS_GHC -fno - warn - orphans #
module FCL.Error where
import Prelude hiding ((<$>))
import Text.PrettyPrint.Leijen
import FCL.Pretty ()
import FCL.Desugaring (DesugarError(..))
import FCL.Infer.Monad
import FCL.Instantiate (InstantiateError(..))
import FCL.Monomorphization (MonomorphError (..))
import FCL.Exte... | null | https://raw.githubusercontent.com/dybber/fcl/e794a4b9d3ab6207fbe89fcddaafe97ae0d379dd/src/FCL/Error.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module FCL.Error where
import Prelude hiding ((<$>))
import Text.PrettyPrint.Leijen
import FCL.Pretty ()
import FCL.Desugaring (DesugarError(..))
import FCL.Infer.Monad
import FCL.Instantiate (InstantiateError(..))
import FCL.Monomorphization (MonomorphError (..))
import FCL.Exte... | |
67f6d43b58837e6c3757b030f48414e00d080aaa2a6241ea08df1d51ce28cd6a | aluuu/spatial_index | rtree_intf.ml | module type Tree_S =
sig
type bb
type 'a t = Empty |
Node of (bb * 'a t) list |
Leaf of (bb * 'a) list
val empty: 'a t
val empty_node: bb * 'a t
val bounding_box_of_nodes: (bb * 'b) list -> bb
val size: 'a t -> int
val partition_by_min_delta: (bb * 'a ... | null | https://raw.githubusercontent.com/aluuu/spatial_index/5515acca6dbd7f0b733d7e3272f905df3db3fa58/src/rtree_intf.ml | ocaml | module type Tree_S =
sig
type bb
type 'a t = Empty |
Node of (bb * 'a t) list |
Leaf of (bb * 'a) list
val empty: 'a t
val empty_node: bb * 'a t
val bounding_box_of_nodes: (bb * 'b) list -> bb
val size: 'a t -> int
val partition_by_min_delta: (bb * 'a ... | |
fc6e64d6efc820adabd005700e43fc32cad06d937314b2a0d26fcbbbb5dea19f | BranchTaken/Hemlock | test_get.ml | open! Basis.Rudiments
open! Basis
open String
let test () =
let strs = [
"";
"<_>";
"«»";
"‡";
"𐆗";
] in
List.iter strs ~f:(fun s ->
let rec fn i = begin
match Uns.(i = (B.length s)) with
| true -> ()
| false -> begin
File.Fmt.stdout
|> Basis.Fmt.fmt... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/string/test_get.ml | ocaml | open! Basis.Rudiments
open! Basis
open String
let test () =
let strs = [
"";
"<_>";
"«»";
"‡";
"𐆗";
] in
List.iter strs ~f:(fun s ->
let rec fn i = begin
match Uns.(i = (B.length s)) with
| true -> ()
| false -> begin
File.Fmt.stdout
|> Basis.Fmt.fmt... | |
cd7fd29b2643f12f80a0ab7955a7841e3ff023c4ab9430d23a36a62234e907e0 | mattmundell/nightshade | values.lisp | ;;; The implementation of unknown-values VOPs.
(in-package "MIPS")
(define-vop (reset-stack-pointer)
(:args (ptr :scs (any-reg)))
(:generator 1
(move csp-tn ptr)))
;;; Push some values onto the stack, returning the start and number of values
pushed as results . It is assumed that the Vals are wired to th... | null | https://raw.githubusercontent.com/mattmundell/nightshade/d8abd7bd3424b95b70bed599e0cfe033e15299e0/src/compiler/mips/values.lisp | lisp | The implementation of unknown-values VOPs.
Push some values onto the stack, returning the start and number of values
argument locations. Nvals is the number of values to push.
The generator cost is pseudo-random. We could get it right by defining a
operand, but this seems unworthwhile.
Push a list of values o... |
(in-package "MIPS")
(define-vop (reset-stack-pointer)
(:args (ptr :scs (any-reg)))
(:generator 1
(move csp-tn ptr)))
pushed as results . It is assumed that the Vals are wired to the standard
bogus SC that reflects the costs of the memory - to - memory moves for each
(define-vop (push-values)
(:args
... |
299298e2fbd2653867058ef42129c0aff762cdc393f7c482c0c3013193f417d6 | sneeuwballen/zipperposition | proofState.ml |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 The state of a proof , contains a set of active clauses ( processed ) ,
a set of passive clauses ( to be processed ) , and an ordering
that is used for redundancy elimination . }
a set of passive clau... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/7f1455fbe2e7509907f927649c288141b1a3a247/src/prover/proofState.ml | ocaml | NPDtree
* signal triggered when a clause is added to the set
* signal triggered when a clause is removed from the set
* Add clauses to the set
* Remove clauses from the set
num passive, num active, num simplification |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 The state of a proof , contains a set of active clauses ( processed ) ,
a set of passive clauses ( to be processed ) , and an ordering
that is used for redundancy elimination . }
a set of passive clau... |
5a2fa2ebde0cf0d76c78791513fdda3ec4001268795862353742596370ebf788 | IvanRublev/year_progress_bot | chats.erl | -module(chats).
-behaviour(sumo_doc).
-export([sumo_schema/0, sumo_sleep/1, sumo_wakeup/1]).
-export([new/2]).
new(Id, Date) ->
#{id => Id, notified_at => Date}.
% sumo_doc behavior
sumo_wakeup(Data) ->
Data.
sumo_sleep(Chat) ->
Chat.
sumo_schema() ->
sumo:new_schema(chats, [
sumo:new_field(id, string... | null | https://raw.githubusercontent.com/IvanRublev/year_progress_bot/c3e85a5598d768933d5fb676c74d92fa8033cf60/apps/year_progress_bot/src/infra/db/chats.erl | erlang | sumo_doc behavior | -module(chats).
-behaviour(sumo_doc).
-export([sumo_schema/0, sumo_sleep/1, sumo_wakeup/1]).
-export([new/2]).
new(Id, Date) ->
#{id => Id, notified_at => Date}.
sumo_wakeup(Data) ->
Data.
sumo_sleep(Chat) ->
Chat.
sumo_schema() ->
sumo:new_schema(chats, [
sumo:new_field(id, string, [{length, 17}, not... |
34ccca1b4cfa9cc9ff114e64fc7cad90a92e25a72c6ee504b46f751400f4ca8d | tomcobley/haskell-final-exams | Types.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
module Types where
import Data.Bits
type BitVector = Int
data Trie = Leaf [Int] | Node BitVector [SubNode]
deriving (Eq, Show)
data SubNode = Term Int | SubTrie Trie
deriving (Eq, Show)
type Hash = Int
type HashFun = Int ... | null | https://raw.githubusercontent.com/tomcobley/haskell-final-exams/49807e0da0ee7121d19eacff3ccc5ff5d0e4d4a2/2020-hash-array-mapped-tries/Types.hs | haskell | # LANGUAGE TypeSynonymInstances #
---------------------------------------------------------------
Show function for trees
Only needed for displaying bit vectors... | # LANGUAGE FlexibleInstances #
module Types where
import Data.Bits
type BitVector = Int
data Trie = Leaf [Int] | Node BitVector [SubNode]
deriving (Eq, Show)
data SubNode = Term Int | SubTrie Trie
deriving (Eq, Show)
type Hash = Int
type HashFun = Int -> Hash
empty :: Trie
empty
= Node... |
6fb37fbe7c7b6522b8642ffcba4a806e627abe1b8f91a65d3be84ab55eb5b674 | erlware/relx | rlx_tar.erl | -module(rlx_tar).
-export([make_tar/3,
format_error/1]).
-include("relx.hrl").
-include("rlx_log.hrl").
make_tar(Release, OutputDir, State) ->
Name = rlx_release:name(Release),
Vsn = rlx_release:vsn(Release),
TarFile = filename:join(OutputDir, [Name, "-", Vsn, ".tar.gz"]),
?log_info("Buildin... | null | https://raw.githubusercontent.com/erlware/relx/16a7972f7679778d9d7f40228b1a20351f1077bd/src/rlx_tar.erl | erlang | we used extra_files to copy in the overlays
nothing to do now but rename the tarball to <relname>-<vsn>.tar.gz
have to manually add the extra files to the tarball
since we print the warnings already in `rlx_assemble' we just print these as debug logs
the dir passed to `erts'
additional files to add to the releas... | -module(rlx_tar).
-export([make_tar/3,
format_error/1]).
-include("relx.hrl").
-include("rlx_log.hrl").
make_tar(Release, OutputDir, State) ->
Name = rlx_release:name(Release),
Vsn = rlx_release:vsn(Release),
TarFile = filename:join(OutputDir, [Name, "-", Vsn, ".tar.gz"]),
?log_info("Buildin... |
b906155131d7987ae004dc85c126941b735e9b7ef1243dac428d445331a3bdd4 | panda-planner-dev/ipc2020-domains | p-07.lisp | (defproblem problem domain
(
(visible waypoint0 waypoint3)
(visible waypoint3 waypoint0)
(visible waypoint0 waypoint5)
(visible waypoint5 waypoint0)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint2)
(visible way... | null | https://raw.githubusercontent.com/panda-planner-dev/ipc2020-domains/9adb54325d3df35907adc7115fcc65f0ce5953cc/partial-order/Rover/other/SHOP2/p-07.lisp | lisp | (defproblem problem domain
(
(visible waypoint0 waypoint3)
(visible waypoint3 waypoint0)
(visible waypoint0 waypoint5)
(visible waypoint5 waypoint0)
(visible waypoint1 waypoint0)
(visible waypoint0 waypoint1)
(visible waypoint2 waypoint0)
(visible waypoint0 waypoint2)
(visible way... | |
ff7596609299ddadf3c1a9f7f31e56482c2cfb456c49542b809e32d7ac314f66 | mpenet/commons | string.clj | (ns qbits.commons.string
(:require [clojure.string :as str]))
(defn camel->dashed
[s]
(-> s
(str/replace #"^[A-Z]+" str/lower-case)
(str/replace #"_?([A-Z]+)"
(comp (partial str "-")
str/lower-case second))
(str/replace #"-|_" "-")))
| null | https://raw.githubusercontent.com/mpenet/commons/a377fed3a5ef00ba26f704e39ca60ad4039870cb/src/clj/qbits/commons/string.clj | clojure | (ns qbits.commons.string
(:require [clojure.string :as str]))
(defn camel->dashed
[s]
(-> s
(str/replace #"^[A-Z]+" str/lower-case)
(str/replace #"_?([A-Z]+)"
(comp (partial str "-")
str/lower-case second))
(str/replace #"-|_" "-")))
| |
04247b47f80d4cefaf20c86fa3213d6b8f1a65dff0c43bfc059437044411ee6b | seancorfield/next-jdbc | transaction_test.clj | copyright ( c ) 2019 - 2021 , all rights reserved
(ns next.jdbc.transaction-test
"Stub test namespace for transaction handling."
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[next.jdbc :as jdbc]
[next.jdbc.specs :as specs]
[next.jdbc.test-fixtures :refer... | null | https://raw.githubusercontent.com/seancorfield/next-jdbc/91dda2cdae3f9e897a54fe21edf8467acae8aa0d/test/next/jdbc/transaction_test.clj | clojure | copyright ( c ) 2019 - 2021 , all rights reserved
(ns next.jdbc.transaction-test
"Stub test namespace for transaction handling."
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[next.jdbc :as jdbc]
[next.jdbc.specs :as specs]
[next.jdbc.test-fixtures :refer... | |
5793dbd0688d32a3af8db7480c4e04f63559fe20f5b841aa225fbe5d5fa66126 | smallhadroncollider/brok | Options.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Brok.Parser.Options
( options
) where
import ClassyPrelude
import Data.Attoparsec.Text
import Brok.Parser.Attoparsec
import Brok.Parser.Links (url)
import Brok.Types.Config
import Brok.Types.Next (Next (..))
data Option
... | null | https://raw.githubusercontent.com/smallhadroncollider/brok/bf62288d913af5fc694e683cc247f66426025400/src/Brok/Parser/Options.hs | haskell | # LANGUAGE OverloadedStrings #
run parser | # LANGUAGE NoImplicitPrelude #
module Brok.Parser.Options
( options
) where
import ClassyPrelude
import Data.Attoparsec.Text
import Brok.Parser.Attoparsec
import Brok.Parser.Links (url)
import Brok.Types.Config
import Brok.Types.Next (Next (..))
data Option
= Cache (Maybe Integer)
| Int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.