_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 |
|---|---|---|---|---|---|---|---|---|
67a0b1651e356f8a56256ae9c0a14789214118a99fc921a7da137155eeacd11a | tsloughter/elna | elna_sup.erl | -module(elna_sup).
-export([start_link/5]).
-export([init/1]).
-include_lib("chatterbox/include/http2.hrl").
-spec start_link(elna:id(), elna:elli_opts(), elna:chatterbox_opts(), elna:listen_opts(), elna:acceptor_opts())
-> {ok, pid()}.
start_link(Id, ElliOpts, ChatterboxOpts, ListenOpts, AcceptorOp... | null | https://raw.githubusercontent.com/tsloughter/elna/a444fdbd6d44c82eb61473e0d95c122b89a4e057/src/elna_sup.erl | erlang | -module(elna_sup).
-export([start_link/5]).
-export([init/1]).
-include_lib("chatterbox/include/http2.hrl").
-spec start_link(elna:id(), elna:elli_opts(), elna:chatterbox_opts(), elna:listen_opts(), elna:acceptor_opts())
-> {ok, pid()}.
start_link(Id, ElliOpts, ChatterboxOpts, ListenOpts, AcceptorOp... | |
5d9bf3b23187eb400dddf650494f9b7e9096a7c741e76cb9ab28c718d5fe58b4 | bobzhang/ocaml-book | priv.ml |
module Int = struct
type t = int
let of_int x = x
let to_int x = x
end
module Priv : sig
type t = private int
val of_int : int -> t
val to_int : t -> int
end = Int
module Abstr : sig
type t
val of_int : int -> t
val to_int : t -> int
end = Int
let _ =
print_int (Priv.of_int 3 :> int)
let ... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/code/types/priv.ml | ocaml | * non-container type
* this is is hard to do when abstract types |
module Int = struct
type t = int
let of_int x = x
let to_int x = x
end
module Priv : sig
type t = private int
val of_int : int -> t
val to_int : t -> int
end = Int
module Abstr : sig
type t
val of_int : int -> t
val to_int : t -> int
end = Int
let _ =
print_int (Priv.of_int 3 :> int)
let ... |
b2364ad807364cb26a90c208773af5b4e751982f92425351db5eab194346393f | OCamlPro/ez_pgocaml | ezPG_lwt.ml | module PGOCaml = PGOCaml_generic.Make(Thread)
module Pool = struct
let pool = ref (None : PGOCaml.pa_pg_data PGOCaml.t Lwt_pool.t option)
let init ?(n=20) ?host ?port ?user ?password ?database ?unix_domain_socket_dir () =
pool := Some (
Lwt_pool.create n
~check:(fun _conn ok -> ok false)
... | null | https://raw.githubusercontent.com/OCamlPro/ez_pgocaml/e84e6835e6048a27fcdfdc58403ca3a8ce16d744/src/impl/lwt/ezPG_lwt.ml | ocaml | module PGOCaml = PGOCaml_generic.Make(Thread)
module Pool = struct
let pool = ref (None : PGOCaml.pa_pg_data PGOCaml.t Lwt_pool.t option)
let init ?(n=20) ?host ?port ?user ?password ?database ?unix_domain_socket_dir () =
pool := Some (
Lwt_pool.create n
~check:(fun _conn ok -> ok false)
... | |
ca8d2753b7fbab9ced86abf0289b0db74201db3dd97cc9d762cc7f2a97222659 | NetComposer/nksip | auth_test_client3.erl | %% -------------------------------------------------------------------
%%
%% auth_test: Authentication Tests
%%
Copyright ( c ) 2013 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the Licen... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/auth_test_client3.erl | erlang | -------------------------------------------------------------------
auth_test: Authentication Tests
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
spe... | Copyright ( c ) 2013 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(auth_test_client3).
... |
f3caae17126aa67410771fcf16494d0ded5cd74418b81b403c2ec6b8c7776013 | potatosalad/erlang-jose | jose_jws_alg.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2022 ,
%%% @doc
%%%
%%% @end
Created : 29 Jul 2015 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/dbc4074066080692246afe613345ef6becc2a3fe/src/jws/jose_jws_alg.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
===================================================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2022 ,
Created : 29 Jul 2015 by < >
-module(jose_jws_alg).
-callback generate_key(ALG, Fields) -> JWK
when
ALG :: any(),
Fields :: map(),
JWK :: jose_jwk:key().
-callback sign(Ke... |
db7b79e53abd39b37ae8c5be5736104bf96a28cb4454d0711b29a7d7c5e6bdbb | janestreet/ecaml | buffer_helper.mli | open! Core
open! Import
(** [with_buffer_and_point contents { col; row } ~f] runs [f] in a temp buffer with
[contents] and point at [row] and [col]. *)
val with_buffer_and_point
: (_, 'a) Sync_or_async.t
-> string
-> Line_and_column.t
-> f:(unit -> 'a)
-> 'a
val show_buffer : block_out:Position.t list ... | null | https://raw.githubusercontent.com/janestreet/ecaml/25a5a2972b3a94f5529a46363b37670a6c1de195/ecaml_test_helpers/src/buffer_helper.mli | ocaml | * [with_buffer_and_point contents { col; row } ~f] runs [f] in a temp buffer with
[contents] and point at [row] and [col].
* Print buffer contents with the point shown as a solid block.
* [with_buffer_and_active_region contents region ~f] runs [f] in a temp buffer with
[contents], mark at [region.start], and... | open! Core
open! Import
val with_buffer_and_point
: (_, 'a) Sync_or_async.t
-> string
-> Line_and_column.t
-> f:(unit -> 'a)
-> 'a
val show_buffer : block_out:Position.t list -> unit
val show_point : unit -> unit
module Region : sig
type t =
{ start : Line_and_column.t
; end_ : Line_and_column.... |
3a09e2118ea97d767ffedb9dc34e928891cce07654981210474f7df02a2a379b | rickardlindberg/brainfuck | Brainfuck.hs | module Brainfuck where
import Data.Char (chr, ord)
import Prelude hiding (Left, Right)
import qualified Data.Map as M
class Data d where
emptyData :: d
dataGet :: d -> Int
dataModifyValue :: d -> (Int -> Int) -> d
dataModifyPos :: (Int -> Int) -> d -> d
dataMoveRight :: Data d => d ->... | null | https://raw.githubusercontent.com/rickardlindberg/brainfuck/fa4940f131adb3682b892f05bb5debef9576b27d/versions/bitetail/Brainfuck.hs | haskell | module Brainfuck where
import Data.Char (chr, ord)
import Prelude hiding (Left, Right)
import qualified Data.Map as M
class Data d where
emptyData :: d
dataGet :: d -> Int
dataModifyValue :: d -> (Int -> Int) -> d
dataModifyPos :: (Int -> Int) -> d -> d
dataMoveRight :: Data d => d ->... | |
d7aa81d7f2b61c3f117474e4d6644fdbb916bbcf6fd80450a83309576134a89a | michaelochurch/summer-2015-haskell-class | Builtins.hs | module Lisp.Builtins where
import Control.Lens
import Control.Monad.Trans (liftIO)
import qualified Data.Map as M
import qualified Data.Set as S
import Lisp.Evaluator
import Lisp.Parser
import Lisp.Printer
import Lisp.Reader
import Lisp.Types
dSum :: [Double] -> Double
dSum = sum
plus :: LispFunction
plus = liftFunc... | null | https://raw.githubusercontent.com/michaelochurch/summer-2015-haskell-class/2513dc5951604766850255484da37fe480048e0d/Lisp/Builtins.hs | haskell | module Lisp.Builtins where
import Control.Lens
import Control.Monad.Trans (liftIO)
import qualified Data.Map as M
import qualified Data.Set as S
import Lisp.Evaluator
import Lisp.Parser
import Lisp.Printer
import Lisp.Reader
import Lisp.Types
dSum :: [Double] -> Double
dSum = sum
plus :: LispFunction
plus = liftFunc... | |
f1e83887a14f66c0519d200699b374782ac8a53d47f0131577e73e61ea997b52 | input-output-hk/plutus-apps | V1.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE NamedFieldPuns #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
# OPTIONS_GHC -Wno - simplifiable - class - c... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/006f4ae4461094d3e9405a445b0c9cf48727fa81/plutus-tx-constraints/src/Ledger/Tx/Constraints/OnChain/V1.hs | haskell | # LANGUAGE MonoLocalBinds #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
| Does the 'ScriptContext' satisfy the constraints?
"Input constraint"
"Output constraint"
"Missing datum"
"Wrong validation interval"
"Missing signature"
"Spent value not OK"
"Produce... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -Wno - simplifiable - class - constraints #
# OPTIONS_GHC -fno - specialise #
# OPTIONS_GHC -fno - omit - interface - pragmas #
module Ledger.Tx.Constraints.OnChain.V1
( c... |
2421b6a5da6deed82f9e1bc98fe4e223ae9638480265152a0ef629f2168ad0b6 | tekul/jose-jwt | JweSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - orphans #
module Tests.JweSpec where
import Data.Aeson (decodeStrict')
import Data.Bits (xor)
import Data.Word (Word8, Word64)
import qualified Data.ByteArray as BA
import qualified Data.... | null | https://raw.githubusercontent.com/tekul/jose-jwt/1ac2335d4feda47da21075f39b8c8805a51583f0/tests/Tests/JweSpec.hs | haskell | # LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
A decidedly non-random, random number generator which allows specific
------------------------------------------------------------... | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - orphans #
module Tests.JweSpec where
import Data.Aeson (decodeStrict')
import Data.Bits (xor)
import Data.Word (Word8, Word64)
import qualified Data.ByteArray as BA
import qualified Data.ByteString as B
import qualified Da... |
b8e2eae29054f1c3bcf050d9030bcf78bb4e7c9df044caa460aef0d2a277fff0 | threatgrid/ctia | update_index_state_test.clj | (ns ctia.task.update-index-state-test
(:require [clojure.test :refer [deftest is use-fixtures]]
[ctia.task.update-index-state :as sut]
[ductile.index :as es-index]
[ctia.test-helpers.core :as h]
[ctia.test-helpers.es :as es-helpers]))
(use-fixtures :once
es-helpers/f... | null | https://raw.githubusercontent.com/threatgrid/ctia/9b9f333aeb91dd9faf2541f9d736b8539162d6e9/test/ctia/task/update_index_state_test.clj | clojure | (ns ctia.task.update-index-state-test
(:require [clojure.test :refer [deftest is use-fixtures]]
[ctia.task.update-index-state :as sut]
[ductile.index :as es-index]
[ctia.test-helpers.core :as h]
[ctia.test-helpers.es :as es-helpers]))
(use-fixtures :once
es-helpers/f... | |
10cdc841cb4ccceaa098d939ec8b13b3a4b9bf9e28a22dd064ef20a6eca5fea2 | synsem/texhs | Walk.hs | # LANGUAGE GeneralizedNewtypeDeriving #
----------------------------------------------------------------------
-- |
Module : Text . TeX.Context . Walk
Copyright : 2015 - 2017 ,
2015 - 2016 Language Science Press .
-- License : GPL-3
--
-- Maintainer :
-- Stability : experi... | null | https://raw.githubusercontent.com/synsem/texhs/9e2dce4ec8ae0b2c024e1883d9a93bab15f9a86f/src/Text/TeX/Context/Walk.hs | haskell | --------------------------------------------------------------------
|
License : GPL-3
Maintainer :
Stability : experimental
--------------------------------------------------------------------
* Types
* Basic combinators
* Command parsers
** Specific command
* Group parsers
** Specific group
**... | # LANGUAGE GeneralizedNewtypeDeriving #
Module : Text . TeX.Context . Walk
Copyright : 2015 - 2017 ,
2015 - 2016 Language Science Press .
Portability : GHC
Parser type for walking contexts
module Text.TeX.Context.Walk
Parser
, ParserS
, runParser
, runParserWithStat... |
f8e893ba88852888c940b7bf57dc855b3ead2f7d6f6638d644bf282058fa80cb | nasa/Common-Metadata-Repository | search_service.clj | (ns cmr.metadata-db.services.search-service
"Contains functions for retrieving concepts using parameter search"
(:require
[clojure.set :as set]
[cmr.common.concepts :as cc]
[cmr.common.log :refer (debug info warn error)]
[cmr.common.util :as util]
[cmr.metadata-db.data.concepts :as c]
[cmr.metadat... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/98b8c05fa0e0dbba5cec095aa4cc7fd7ebf1f912/metadata-db-app/src/cmr/metadata_db/services/search_service.clj | clojure |
For performance reasons we only support finding granules using combinations of indexed fields,
so we validate the parameters for granules separately from other concept types that allow
finds using single fields.
Service methods for finding concepts | (ns cmr.metadata-db.services.search-service
"Contains functions for retrieving concepts using parameter search"
(:require
[clojure.set :as set]
[cmr.common.concepts :as cc]
[cmr.common.log :refer (debug info warn error)]
[cmr.common.util :as util]
[cmr.metadata-db.data.concepts :as c]
[cmr.metadat... |
a042c7f66bfb2658600401714220b9865bcbf85e15226a5086b26ce19ff4b535 | lesguillemets/sicp-haskell | 2.28.hs | module TwoTwentyeight where
import TList
fringe :: TList a -> [a]
fringe Nil = []
fringe (V a) = [a]
fringe (Cons p q) = fringe p ++ fringe q
-- |
> > > let x = list [ fromList [ 1,2 ] , fromList [ 3,4 ] ]
-- >>> fringe x
-- [1,2,3,4]
--
-- >>> fringe $ list [x,x]
[ 1,2,3,4,1,2,3,4 ]
| null | https://raw.githubusercontent.com/lesguillemets/sicp-haskell/df524a1e28c45fb16a56f539cad8babc881d0431/exercise/chap02/sect2/2.28.hs | haskell | |
>>> fringe x
[1,2,3,4]
>>> fringe $ list [x,x] | module TwoTwentyeight where
import TList
fringe :: TList a -> [a]
fringe Nil = []
fringe (V a) = [a]
fringe (Cons p q) = fringe p ++ fringe q
> > > let x = list [ fromList [ 1,2 ] , fromList [ 3,4 ] ]
[ 1,2,3,4,1,2,3,4 ]
|
2ea81cdc463a464a671ed014b4c4c8d658e98c819863d3ccca7c10735b8a4591 | tolysz/prepare-ghcjs | Traversable.hs | {-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE StandaloneDeriving #
# LANGUAGE Trustworthy #
# LANGUAGE TypeOperators #
-----------------------------------------------------------------------------
-- |
Module : Data .
Copyright : and 2... | null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts8/base-pure/Data/Traversable.hs | haskell | # LANGUAGE DeriveTraversable #
---------------------------------------------------------------------------
|
License : BSD-style (see the LICENSE file in the distribution)
Maintainer :
Stability : experimental
Portability : portable
Class of data structures that can be traversed from left to right,
... | # LANGUAGE FlexibleInstances #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE StandaloneDeriving #
# LANGUAGE Trustworthy #
# LANGUAGE TypeOperators #
Module : Data .
Copyright : and 2005
by and ,
/Journal of Functional Programming/ 18:1 ( 2008 ) 1 - 13 , online at
by and ,
... |
1232729714ceed7712595b8f0d90a346a36a418ce69eb6a22c05fa2c0c3264b4 | r0man/netcdf-clj | location_test.clj | (ns netcdf.location-test
(:import (ucar.unidata.geoloc LatLonPointImpl LatLonPoint))
(:use clojure.test
netcdf.location))
(def berlin (make-location 52.523 13.411))
(def paris (make-location 48.857 2.351))
(def vienna (make-location 48.209 16.373))
(deftest test-to-location
(testing "LatLonPoint"
(l... | null | https://raw.githubusercontent.com/r0man/netcdf-clj/90f40ab958d3ebc16a4fcfc882c9cd7ef469d054/test/netcdf/location_test.clj | clojure | (deftest test-destination-point
(let [location (destination-point berlin 30 100)] | (ns netcdf.location-test
(:import (ucar.unidata.geoloc LatLonPointImpl LatLonPoint))
(:use clojure.test
netcdf.location))
(def berlin (make-location 52.523 13.411))
(def paris (make-location 48.857 2.351))
(def vienna (make-location 48.209 16.373))
(deftest test-to-location
(testing "LatLonPoint"
(l... |
1da3856817e5eb00e3d8dcbccb2a6b6d66601f66674d2e3177dd26b27eb8975b | sulami/spielwiese | Set3.hs | # LANGUAGE MonadComprehensions #
# LANGUAGE RebindableSyntax #
module Set3 where
import MCPrelude
301
allPairs :: [a] -> [b] -> [(a,b)]
allPairs l0 l1 = concatMap (\e -> zip (repeat e) l1) l0
302
data Card = Card Int String
instance Show Card where
show (Card x y) = show x ++ y
allCards :: [... | null | https://raw.githubusercontent.com/sulami/spielwiese/da354aa112d43d7ec5f258f4b5afafd7a88c8aa8/mc/Set3.hs | haskell | # LANGUAGE MonadComprehensions #
# LANGUAGE RebindableSyntax #
module Set3 where
import MCPrelude
301
allPairs :: [a] -> [b] -> [(a,b)]
allPairs l0 l1 = concatMap (\e -> zip (repeat e) l1) l0
302
data Card = Card Int String
instance Show Card where
show (Card x y) = show x ++ y
allCards :: [... | |
4b7f27416aa3266ecfeccb3d655405684bbf50d77d7844c33a1dc18de3945342 | pavlobaron/ErlangOTPBookSamples | wk_build.erl | -module(wk_build).
-export([all/0, compile/0, dialyzer/0, test1/0, test2/0, doc/0]).
all() ->
compile(),
dialyzer(),
test1(),
test2(),
doc(),
cprof(),
% perf_kursinfo1(),
% perf_kursinfo2(),
cover().
files() ->
["wechselkurs_server.erl" ,
"wechselkurs_client... | null | https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/entwicklung/chapex/src/wk_build.erl | erlang | perf_kursinfo1(),
perf_kursinfo2(),
| -module(wk_build).
-export([all/0, compile/0, dialyzer/0, test1/0, test2/0, doc/0]).
all() ->
compile(),
dialyzer(),
test1(),
test2(),
doc(),
cprof(),
cover().
files() ->
["wechselkurs_server.erl" ,
"wechselkurs_client.erl",
"wechselkurs_client_rpc.erl",
... |
c929a473d396a2b21c7bd37178166b1f50ee6305d1ade6e065c77246079a1003 | dcos/lashup | lashup_app.erl | -module(lashup_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
lashup_sup:start_link().
stop(_State) ->
ok.
| null | https://raw.githubusercontent.com/dcos/lashup/a0661006c38237147252ebe0b98cc2c29352c976/src/lashup_app.erl | erlang | -module(lashup_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
lashup_sup:start_link().
stop(_State) ->
ok.
| |
89c655ab01cec72a0b1775cce745c74cce93f0ca2e678ec0479ba19c1721c8e6 | ds-wizard/engine-backend | List_GET.hs | module Wizard.Specs.API.Submission.List_GET (
list_GET,
) where
import Data.Aeson (encode)
import Network.HTTP.Types
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai hiding (shouldRespondWith)
import Test.Hspec.Wai.Matcher
import Shared.Api.Resource.Error.ErrorJM ()
import Shared.Localizatio... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/test/Wizard/Specs/API/Submission/List_GET.hs | haskell | ------------------------------------------------------------------------
POST /documents/{docUuid}/submissions
------------------------------------------------------------------------
----------------------------------------------------
----------------------------------------------------
------------------------... | module Wizard.Specs.API.Submission.List_GET (
list_GET,
) where
import Data.Aeson (encode)
import Network.HTTP.Types
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai hiding (shouldRespondWith)
import Test.Hspec.Wai.Matcher
import Shared.Api.Resource.Error.ErrorJM ()
import Shared.Localizatio... |
091149cc87e9a1a82b7f96f45f2f33e972cd8b1a17536fe1972432321678d2cc | willdonnelly/dyre | configCheckTestA.hs | import Lib
main = configCheckTest "custom-a"
| null | https://raw.githubusercontent.com/willdonnelly/dyre/f1ebc1592fb188fa173f8c1baa325fc61f527825/Tests/config-check/configCheckTestA.hs | haskell | import Lib
main = configCheckTest "custom-a"
| |
4c91c919a733021ad9dbc2a82dda4c12e12f6c2e8b08539c514b8574c57e0e86 | duo-lang/duo-lang | Primitives.hs | module TypeInference.GenerateConstraints.Primitives where
import Syntax.RST.Terms (PrimitiveOp(..))
import Syntax.CST.Types (PrdCnsRep(..))
import Syntax.RST.Types
( LinearContext,
PrdCnsType(PrdCnsType),
Typ(TyString, TyI64, TyF64, TyChar)
, Polarity(..)
, PolarityRep(..)
)
import Lo... | null | https://raw.githubusercontent.com/duo-lang/duo-lang/326a8776d36ae702786f7a22c71289d7bf98717d/src/TypeInference/GenerateConstraints/Primitives.hs | haskell | | Primitive operations and their signatures
I64
F64
Char
String | module TypeInference.GenerateConstraints.Primitives where
import Syntax.RST.Terms (PrimitiveOp(..))
import Syntax.CST.Types (PrdCnsRep(..))
import Syntax.RST.Types
( LinearContext,
PrdCnsType(PrdCnsType),
Typ(TyString, TyI64, TyF64, TyChar)
, Polarity(..)
, PolarityRep(..)
)
import Lo... |
ac50287bf074264d2459626bc578759349ab2dfd27a5a4cd72adcdb5fae596c2 | morpheusgraphql/morpheus-graphql | Schema.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
module Client.Schema where
import Data.Morpheus.Client.CodeGen.Internal
import Globals.GQLScalars (Euro)
newtype Bird = Bird
{ name :: Maybe String
}
deriving (Gene... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/1d3ab7e3bc723e29ef8bd2a0c818a03ae82ce8ad/examples/code-gen/src/Client/Schema.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE LambdaCase #
# LANGUAGE TypeFamilies #
module Client.Schema where
import Data.Morpheus.Client.CodeGen.Internal
import Globals.GQLScalars (Euro)
newtype Bird = Bird
{ name :: Maybe String
}
deriving (Generic, Show, Eq)
instance ToJSON Bir... |
b7e6784e55850c6bd105921ab354953e95b24b83ddf9772d51e6bcff0b503d9a | moonlightdrive/ocaml-ec2 | myocamlbuild.ml | OASIS_START
DO NOT EDIT ( digest : 8d562c7396a91e74254b267b11879a01 )
module OASISGettext = struct
# 22 " src / oasis / OASISGettext.ml "
let ns_ str =
str
let s_ str =
str
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
... | null | https://raw.githubusercontent.com/moonlightdrive/ocaml-ec2/06df35a4a29f1b51416013ddf126eeb43587dc11/myocamlbuild.ml | ocaml | these functions are not really officially exported
ocamlfind command
This lists all supported packages.
Mock to list available syntaxes.
By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher p... | OASIS_START
DO NOT EDIT ( digest : 8d562c7396a91e74254b267b11879a01 )
module OASISGettext = struct
# 22 " src / oasis / OASISGettext.ml "
let ns_ str =
str
let s_ str =
str
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
... |
b87a7f00fce20660711add6c46c88553b46ef96bb91067768c25d38aecac9804 | findmyway/reinforcement-learning-an-introduction | infinite_variance.clj | gorilla-repl.fileformat = 1
;; @@
(ns rl.chapter05.infinite-variance
(:require [incanter.stats :refer [sample-binomial]]
[clojure.core.matrix :as m])
(:use [plotly-clj.core]))
;; @@
;; =>
;;; {"type":"html","content":"<span class='clj-nil'>nil</span>","value":"nil"}
;; <=
;; @@
(online-init)
;; @@
;... | null | https://raw.githubusercontent.com/findmyway/reinforcement-learning-an-introduction/6911efbe7a6478658b188022ebad542751146ddd/src/rl/chapter05/infinite_variance.clj | clojure | @@
@@
=>
{"type":"html","content":"<span class='clj-nil'>nil</span>","value":"nil"}
<=
@@
@@
=>
{"type":"html","content":"<script src=\"-latest.min.js\" type=\"text/javascript\"></script>","value":"pr'ed value"}
<=
@@
@@
=>
<=
@@
@@
=>
{"type":"html","content":"<iframe height=\"600\" src=\"//plot.ly/~... | gorilla-repl.fileformat = 1
(ns rl.chapter05.infinite-variance
(:require [incanter.stats :refer [sample-binomial]]
[clojure.core.matrix :as m])
(:use [plotly-clj.core]))
(online-init)
(defn behavior-policy [] (if (zero? (sample-binomial 1)) :end :back))
(defn target-policy [] :back)
(defn play
[... |
a4f2d8d5b66dc209b16ceed191f0e2cb86c8efbfedcdfd70a5d79f42df01f9a0 | haskell-mafia/mismi | Amazonka.hs | # LANGUAGE NoImplicitPrelude #
module Mismi.EC2.Amazonka (
module AWS
) where
import Network.AWS.EC2 as AWS
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-ec2/src/Mismi/EC2/Amazonka.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Mismi.EC2.Amazonka (
module AWS
) where
import Network.AWS.EC2 as AWS
| |
3877174ef166b78f753ac27ccaa7073f01f4ed6f020b5c48b5ff55d9fa969524 | troydm/edda | ShipyardV1.hs | {-# LANGUAGE OverloadedStrings #-}
module EDDA.Schema.ShipyardV1 where
import EDDA.Types
import EDDA.Schema.Util
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.HashMap.Strict as HM
import qualified Data.HashSet as HS
getShips... | null | https://raw.githubusercontent.com/troydm/edda/710856d5bc3bf70c1061c50ae159107ca51c15f0/src/EDDA/Schema/ShipyardV1.hs | haskell | # LANGUAGE OverloadedStrings # | module EDDA.Schema.ShipyardV1 where
import EDDA.Types
import EDDA.Schema.Util
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.HashMap.Strict as HM
import qualified Data.HashSet as HS
getShips :: Value -> ConfigT (Maybe [Str])
... |
ec8967d7527af2fd46f5c6404adb1021251390dfa3bae27695a83386e2cc6477 | dom8509/logseq-to-markdown | config.cljs | (ns logseq-to-markdown.config
(:refer-clojure :exclude [set]))
(def exporter-config-data (atom {}))
(defn set
[config-data]
(reset! exporter-config-data config-data))
(defn entry
[key]
(get @exporter-config-data key))
| null | https://raw.githubusercontent.com/dom8509/logseq-to-markdown/de0988f700cb1a31207ee9167187bf690dbd8af6/src/logseq_to_markdown/config.cljs | clojure | (ns logseq-to-markdown.config
(:refer-clojure :exclude [set]))
(def exporter-config-data (atom {}))
(defn set
[config-data]
(reset! exporter-config-data config-data))
(defn entry
[key]
(get @exporter-config-data key))
| |
48698170544400fa1add6733bd156dd2ac654acf9ac417cd62e20808b437b1be | tonyg/kali-scheme | mini-package.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; Miniature package system. This links mini-eval up to the output of
; the package reifier.
Reified package
(lambda (name)
(let loop ((i (- (vector-length names) 1)))
(if (< i 0)
... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/debug/mini-package.scm | scheme | Miniature package system. This links mini-eval up to the output of
the package reifier.
Structures
Things used by reification forms
Etc.
--------------------
???
(define (integrate-all-primitives! . rest) 'lose)
((p '%%lookup-operator%%) name))
(define (package-ensure-defined! p name)
(package-define! p na... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
Reified package
(lambda (name)
(let loop ((i (- (vector-length names) 1)))
(if (< i 0)
(error "unbound" name)
(if (eq? name (vector-ref names i))
(contents (get-location ... |
e2db1b8f1f00ac9a9b0fe5ab0c47e55662c828cbe9cb05f559366cd3bee89ffd | skanev/playground | 22-tests.scm | (require rackunit rackunit/text-ui)
(load "../22.scm")
(define sicp-3.22-tests
(test-suite
"Tests for SICP exercise 3.22"
(test-begin "empty-queue?"
(check-true (empty-queue? (make-queue))))
(test-begin "insert-queue!"
(define q (make-queue))
(insert-queue! q 'a)
(check-equal? ... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/03/tests/22-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load "../22.scm")
(define sicp-3.22-tests
(test-suite
"Tests for SICP exercise 3.22"
(test-begin "empty-queue?"
(check-true (empty-queue? (make-queue))))
(test-begin "insert-queue!"
(define q (make-queue))
(insert-queue! q 'a)
(check-equal? ... | |
2cb2f90a3414b45aeb60414983a5f0d5b52c0e7f3f4812bd2896d54b3a95c8c5 | nubank/k8s-api | auth_test.clj | (ns kubernetes-api.interceptors.auth-test
(:require [clojure.test :refer :all]
[kubernetes-api.interceptors.auth :as interceptors.auth]
[matcher-combinators.matchers :as m]
[matcher-combinators.test]
[mockfn.core :refer [providing]]))
(deftest auth-test
(testing "req... | null | https://raw.githubusercontent.com/nubank/k8s-api/5d8fb2e3ef789222f98092d48af454d297a41bc7/test/kubernetes_api/interceptors/auth_test.clj | clojure | (ns kubernetes-api.interceptors.auth-test
(:require [clojure.test :refer :all]
[kubernetes-api.interceptors.auth :as interceptors.auth]
[matcher-combinators.matchers :as m]
[matcher-combinators.test]
[mockfn.core :refer [providing]]))
(deftest auth-test
(testing "req... | |
d021ae65b0e6a5062ddabd6630737cbbc97bf14e44e4656ffcce2ba5d14a4baf | discus-lang/salt | Base.hs |
module Salt.LSP.Task.Diagnostics.Base where
import Salt.Data.Location
-- | Severity of a diagnostic.
data Severity
= SeverityError
| SeverityWarning
| SeverityInformation
| SeverityHint
deriving (Eq, Show)
-- | Get the numeric code of a severity level.
codeOfSeverity :: Sever... | null | https://raw.githubusercontent.com/discus-lang/salt/33c14414ac7e238fdbd8161971b8b8ac67fff569/src/salt/Salt/LSP/Task/Diagnostics/Base.hs | haskell | | Severity of a diagnostic.
| Get the numeric code of a severity level.
to just after where to put the red wiggle. |
module Salt.LSP.Task.Diagnostics.Base where
import Salt.Data.Location
data Severity
= SeverityError
| SeverityWarning
| SeverityInformation
| SeverityHint
deriving (Eq, Show)
codeOfSeverity :: Severity -> Int
codeOfSeverity sv
= case sv of
SeverityError -> ... |
c08bb3f01a4e808dd83d42be73d3a919c42c6df84b860ef78094ad2477baac2a | hanshuebner/bknr-web | url-handlers.lisp | (in-package :bknr-user)
(enable-interpol-syntax)
(defmethod object-url ((url url))
(format nil "/url/~A"
(store-object-id url)))
(defclass url-handler (object-handler)
())
(defmethod object-handler-get-object ((handler url-handler))
(find-store-object (parse-url) :class 'url))
(defmethod handle-object ((h... | null | https://raw.githubusercontent.com/hanshuebner/bknr-web/5c30b61818a2f02f6f2e5dc69fd77396ec3afc51/modules/url/url-handlers.lisp | lisp | (in-package :bknr-user)
(enable-interpol-syntax)
(defmethod object-url ((url url))
(format nil "/url/~A"
(store-object-id url)))
(defclass url-handler (object-handler)
())
(defmethod object-handler-get-object ((handler url-handler))
(find-store-object (parse-url) :class 'url))
(defmethod handle-object ((h... | |
211380b0db148980b5ac4aa56b98d3c7dbab934db82ef7b6bef9f106860b354f | craigfe/sink | tuple.ml | $
let alpha i = Char.chr ( i + 96 )
let rec interleave ~sep = function
| ( [ ] | [ _ ] ) as l - > l
| h1 : : ( _ : : _ as tl ) - > h1 : : sep : : interleave ~sep tl
type component = { fmap : string ; proj : string }
let component = function
| 1 - > { fmap = " first " ; proj = " p1 "... | null | https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/sink/tuple.ml | ocaml | * Projecting each component from the tuple:
* Functor instances on each of the components:
* Projecting each component from the tuple:
* Functor instances on each of the components:
* Projecting each component from the tuple:
* Functor instances on each of the components:
* Projecting each component from the tupl... | $
let alpha i = Char.chr ( i + 96 )
let rec interleave ~sep = function
| ( [ ] | [ _ ] ) as l - > l
| h1 : : ( _ : : _ as tl ) - > h1 : : sep : : interleave ~sep tl
type component = { fmap : string ; proj : string }
let component = function
| 1 - > { fmap = " first " ; proj = " p1 "... |
6859e6f8309ab495399d23eb4910bb2f583a4237958c84759c6becf1c6404020 | shayan-najd/NativeMetaprogramming | DList.hs | module DList where
newtype DList a = DList ([a] -> [a])
snoc :: DList a -> a -> DList a
DList f `snoc` x = DList (f . (x:))
toList :: DList a -> [a]
toList (DList f) = f []
instance Monoid (DList a) where
mempty = DList id
DList a `mappend` DList b = DList (a . b)
| null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/utils/mkUserGuidePart/DList.hs | haskell | module DList where
newtype DList a = DList ([a] -> [a])
snoc :: DList a -> a -> DList a
DList f `snoc` x = DList (f . (x:))
toList :: DList a -> [a]
toList (DList f) = f []
instance Monoid (DList a) where
mempty = DList id
DList a `mappend` DList b = DList (a . b)
| |
7f9365b7a760d3b0d9cf16ff3c755fb2836dfaa0e32db62894f3a2026621f863 | jyh/metaprl | itt_singleton.mli |
declare singleton{'a;'A}
| null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/itt/core/itt_singleton.mli | ocaml |
declare singleton{'a;'A}
| |
fef32e6f44bd926ca60e2594ac46853f93c849195d980719fe392fd1a825262c | ericdrgn/drgn.nyxt | init.lisp | (in-package #:nyxt-user)
;;loading of config files
;;add theme here
(nyxt::load-lisp "~/.config/nyxt/themes/standard-dark.lisp")
;;base
(nyxt::load-lisp "~/.config/nyxt/base/keybindings.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/urlprompt.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/commands.lisp")
(nyxt::load-lisp ... | null | https://raw.githubusercontent.com/ericdrgn/drgn.nyxt/f7cc9a5351b9fa3e002fe56d870f1c7cef22cafb/init.lisp | lisp | loading of config files
add theme here
base
extending
configuration for browser
configuration for buffer and nosave buffer to have reduce tracking by default
setting new buffer url and having nyxt start full screen
when reloading init.lisp file shows in message bar once finished | (in-package #:nyxt-user)
(nyxt::load-lisp "~/.config/nyxt/themes/standard-dark.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/keybindings.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/urlprompt.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/commands.lisp")
(nyxt::load-lisp "~/.config/nyxt/base/glyphs.lisp")
(nyxt::load-lis... |
e72f94735dbca3a7b36110f301f28644a7135344dbd87c57647fd470aee11b46 | roburio/albatross | albatross_console.ml | ( c ) 2017 , all rights reserved
(* the process responsible for buffering console IO *)
communication channel is a single unix domain socket . The following commands
can be issued :
- Add name ( by ) -- > creates a new console slurper for name ,
and starts a read_console task
- Attach... | null | https://raw.githubusercontent.com/roburio/albatross/99d7dad34e71120b673d040b1edc2ff55872c61a/daemon/albatross_console.ml | ocaml | the process responsible for buffering console IO
now we wait for the next read and terminate | ( c ) 2017 , all rights reserved
communication channel is a single unix domain socket . The following commands
can be issued :
- Add name ( by ) -- > creates a new console slurper for name ,
and starts a read_console task
- Attach name -- > attaches console of name : send existing stu... |
84cdb58c169320d6e154a9682d1506df8b30fde1096d3f1f528e9d81525a8087 | rururu/r4f-pro | core_test.clj | (ns r4f-pro.core-test
(:require [clojure.test :refer :all]
[r4f-pro.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/rururu/r4f-pro/c472b902049f620e25b36a197a42f07f5796620d/test/r4f_pro/core_test.clj | clojure | (ns r4f-pro.core-test
(:require [clojure.test :refer :all]
[r4f-pro.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
5f891b0df414ed1688e904930ddf29d8389877eff0f66ff28ee3a4d0bc41fbe9 | ku-fpg/sunroof-compiler | JQuery.hs | # LANGUAGE DataKinds #
| This module provides parts of the JQuery API ( < / > ) .
module Language.Sunroof.JS.JQuery
(
-- * General JQuery API
dollar
, jQuery, jq
-- * DOM
, append
, html, setHtml
, text, setText
-- * CSS
, css, setCss
, addClass, removeClass
-- * Attributes
, attribute, a... | null | https://raw.githubusercontent.com/ku-fpg/sunroof-compiler/5d8edafea515c4c2b4e7631799f35d8df977e289/Language/Sunroof/JS/JQuery.hs | haskell | * General JQuery API
* DOM
* CSS
* Attributes
* Event Handling
* Manipulation
-----------------------------------------------------------------------
JQuery interface
-----------------------------------------------------------------------
| The dollar function.
See </>.
| Calls the JQuery dollar function.... | # LANGUAGE DataKinds #
| This module provides parts of the JQuery API ( < / > ) .
module Language.Sunroof.JS.JQuery
(
dollar
, jQuery, jq
, append
, html, setHtml
, text, setText
, css, setCss
, addClass, removeClass
, attribute, attr'
, setAttr
, removeAttr
, on
, innerWidth
, innerHei... |
73c60a1102105010e3829a760a7102c107e7a60e962ef83dcc46ef5bdd928a49 | alanz/ghc-exactprint | ExpandSynsFail1.hs | type Foo = Int
type Bar = Bool
main = print $ (1 :: Foo) == (False :: Bar)
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/ExpandSynsFail1.hs | haskell | type Foo = Int
type Bar = Bool
main = print $ (1 :: Foo) == (False :: Bar)
| |
573dcc71998ade4e011cf5b569a50659206f439fc58dddb0d7603bc83e40b547 | altsun/My-Lisps | (FLEX) [FlexSpline] Ve duong luon song.lsp | FlexSpline . LSP [ Command name : FLEX ]
;;; To draw a Spline approximation of a sine wave Centered on a path, such as is used by many
;;; to represent flexible duct or conduit. [Not a precisely accurate sine-wave shape, but close.]
;;; Draws continuous Spline along fit points zig-zagging across center of pat... | null | https://raw.githubusercontent.com/altsun/My-Lisps/85476bb09b79ef5e966402cc5158978d1cebd7eb/Other/(FLEX)%20%5BFlexSpline%5D%20Ve%20duong%20luon%20song.lsp | lisp | To draw a Spline approximation of a sine wave Centered on a path, such as is used by many
to represent flexible duct or conduit. [Not a precisely accurate sine-wave shape, but close.]
Draws continuous Spline along fit points zig-zagging across center of path object.
width in various entity types, will yiel... | FlexSpline . LSP [ Command name : FLEX ]
[ Non - tangent changes in direction in paths , or overly tight curves relative to wave
is fully collinear , will pick a UCS related to current one . Forbids 3D Spline . ]
an even number of half - waves for closed paths so that result is complete S - waves c... |
ae739dd15b82d8080ba0ff900440e2efb403b3c952c8e081af65cb32701de51c | tylerholien/milena | tests.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Functor
import Data.Either (isRight, isLeft)
import qualified Data.List.NonEmpty as NE
import Control.Lens
import Control.Monad.Except (catchError, throwError)
import Control.Monad.Trans (liftIO)
import Network.Kafka
import Network.Kafka.Consumer
import... | null | https://raw.githubusercontent.com/tylerholien/milena/5b46dccfb35017a0c6705db525b4b09f8b48139d/test/tests.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import Data.Functor
import Data.Either (isRight, isLeft)
import qualified Data.List.NonEmpty as NE
import Control.Lens
import Control.Monad.Except (catchError, throwError)
import Control.Monad.Trans (liftIO)
import Network.Kafka
import Network.Kafka.Consumer
import Network.Kafka.Producer
import Netw... |
63eeccbc211e8f6e8bf8558ab9920d13b5af2acb4b7a0d12c620d641f4313be8 | peterholko/pax_server | map.erl | %% -------------------------------------------------------------------
Author :
%%% Description :
%%%
Created : June 23 , 2010
%%% -------------------------------------------------------------------
-module(map).
-behaviour(gen_server).
%% --------------------------------------------------------------------
%% ... | null | https://raw.githubusercontent.com/peterholko/pax_server/62b2ec1fae195ff915d19af06e56a7c4567fd4b8/src/map.erl | erlang | -------------------------------------------------------------------
Description :
-------------------------------------------------------------------
--------------------------------------------------------------------
Include files
--------------------------------------------------------------------
----------... | Author :
Created : June 23 , 2010
-module(map).
-behaviour(gen_server).
-include("schema.hrl").
-include("common.hrl").
-export([start/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([load/0, get_tile/2, get_tile_type/2, get_explored_map/1, get_surrounding_tiles/2])... |
d3a15d301af594b9e05fd93523b39c955d9026f61299102bd9add73aab061609 | penpot/penpot | page.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.ui.workspace.sidebar.options.page
"Page options menu entries."
(:require
[app.common.color... | null | https://raw.githubusercontent.com/penpot/penpot/694d90d485cc916ff104f1e845d1e6453ddacbaf/frontend/src/app/main/ui/workspace/sidebar/options/page.cljs | clojure |
Copyright (c) KALEIDOS INC | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.ui.workspace.sidebar.options.page
"Page options menu entries."
(:require
[app.common.colors :as clr]
[app.main.data.work... |
ba990070841f7db67731f1643aad239df30ba49ddbc6ddbf0ba926f69b551860 | den1k/vimsical | core.cljc | (ns vimsical.common.core )
(defn =by
([f a]
(fn [b]
(= (f a) (f b))))
([f x y] (= (f x) (f y)))
([f g x y] (= (f x) (g y))))
(defn some-val
[f coll]
(some (fn [x] (when (f x) x)) coll))
| null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/common/vimsical/common/core.cljc | clojure | (ns vimsical.common.core )
(defn =by
([f a]
(fn [b]
(= (f a) (f b))))
([f x y] (= (f x) (f y)))
([f g x y] (= (f x) (g y))))
(defn some-val
[f coll]
(some (fn [x] (when (f x) x)) coll))
| |
59f33765bbeb839988290ee2a2b66701e090da50e98dc4bb306d3aaad848051c | dgiot/dgiot | dgiot_opc_channel.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 DGIOT Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the... | null | https://raw.githubusercontent.com/dgiot/dgiot/a6b816a094b1c9bd024ce40b8142375a0f0289d8/apps/dgiot_opc/src/dgiot_opc_channel.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 DGIOT 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(dgiot_opc_channel).
-behavior(dgiot_channelx).
-define(TYPE, <<"DGIOTOPC">>).
-author("johnliu... |
54fe01c1d2a9962a86cf55428eccc69fbe5c077ccff34270394c57345fa425e5 | ulisses/Static-Code-Analyzer | ExtractValues.hs | {-#OPTIONS -XFlexibleInstances#-}
module ExtractValues where
import Data.List
import ProcessDirectory
{-
Here we have: (x,y,r)
where 'x' and 'y' are the coordinates and 'r' the radius
of the circular spot
-}
vals = [(1,2,1),(1,5,1),(1,8,1)]
fog = scan "/Users/ulissesaraujocosta/ulisses/univ/msc/el/... | null | https://raw.githubusercontent.com/ulisses/Static-Code-Analyzer/4c3f6423d43e1bccb9d1cf04e74ae60d9170186f/Haskell/graphForContest/ExtractValues.hs | haskell | #OPTIONS -XFlexibleInstances#
Here we have: (x,y,r)
where 'x' and 'y' are the coordinates and 'r' the radius
of the circular spot
getNameContests :: Disk Data -> [String]
getNameContests (File _) = []
getNameContests (Folder a l) | intersect (name a) "contest-" == "contest-" = name a : concat ( map g... |
module ExtractValues where
import Data.List
import ProcessDirectory
vals = [(1,2,1),(1,5,1),(1,8,1)]
fog = scan "/Users/ulissesaraujocosta/ulisses/univ/msc/el/pi/Static-Code-Analyzer/sample_app/data/concursos"
type ContestName = String
getContestsName :: IO [ContestName]
getContestsName = fog >>= return . get... |
2a09027b64501221181c7d70f1f3a1277a38a48616160a1aacc1ecb9bd3aa8e2 | retro/keechma-next-realworld-app | core_test.cljs | (ns router.core-test
(:require [cljs.test :refer-macros [deftest is use-fixtures testing are]]
[router.core :as router]
[router.util :refer [encode-query-params decode-query-params]]))
#_(use-fixtures :once {:before (fn [] (js/console.clear))})
(deftest route->parts
(is (= [":foo" "/" "bar... | null | https://raw.githubusercontent.com/retro/keechma-next-realworld-app/47a14f4f3f6d56be229cd82f7806d7397e559ebe/classes/test/realworld-2/router/core_test.cljs | clojure | (ns router.core-test
(:require [cljs.test :refer-macros [deftest is use-fixtures testing are]]
[router.core :as router]
[router.util :refer [encode-query-params decode-query-params]]))
#_(use-fixtures :once {:before (fn [] (js/console.clear))})
(deftest route->parts
(is (= [":foo" "/" "bar... | |
399def629747ba150e4d541953de5eb30e91116821fc206c1031290018647d00 | jlongster/gambit-iphone-example | osx#.scm | " osx ffi types "
Defines c types for the osx ffi .
;;;; Cocoa
(c-define-type id (pointer (struct "objc_object") #f))
(c-define-type NSTimeInterval double)
(c-define-type NSArray "NSArray")
(c-define-type NSArray* (pointer NSArray))
(c-define-type NSSet "NSSet")
(c-define-type NSSet* (pointer NSSet))
(c-define-ty... | null | https://raw.githubusercontent.com/jlongster/gambit-iphone-example/e55d915180cb6c57312cbb683d81823ea455e14f/lib/ffi/osx%23.scm | scheme | Cocoa | " osx ffi types "
Defines c types for the osx ffi .
(c-define-type id (pointer (struct "objc_object") #f))
(c-define-type NSTimeInterval double)
(c-define-type NSArray "NSArray")
(c-define-type NSArray* (pointer NSArray))
(c-define-type NSSet "NSSet")
(c-define-type NSSet* (pointer NSSet))
(c-define-type NSString... |
c71a96047b62dde692d8dcaa515c9eb75548475d51ca290893834fda782b1e8f | reflectionalist/S9fES | programp.scm | Scheme 9 from Empty Space , Function Library
By , 2009
; Placed in the Public Domain
;
; (program? object) ==> boolean
;
; (load-from-library "programp.scm")
;
; Return #T, if OBJECT is a syntactically correct Scheme program.
This program does not implement all of R4RS . Caveat utilitor .
;
Example : ( ... | null | https://raw.githubusercontent.com/reflectionalist/S9fES/0ade11593cf35f112e197026886fc819042058dd/lib/programp.scm | scheme | Placed in the Public Domain
(program? object) ==> boolean
(load-from-library "programp.scm")
Return #T, if OBJECT is a syntactically correct Scheme program.
not formally correct, but useful | Scheme 9 from Empty Space , Function Library
By , 2009
This program does not implement all of R4RS . Caveat utilitor .
Example : ( program ? ' ( let ( ( x 1 ) ) ( cons x x ) ) ) = = > # t
(load-from-library "for-all.scm")
(define (program? x)
(define INF #f)
(define (list-of-programs? x)
(... |
41ef354bad22def00ed6c022901b38bf4effc120d203ec6b9abd359ab892d155 | copton/ocram | DebugInfo.hs | # LANGUAGE TemplateHaskell , ViewPatterns #
module Ocram.Debug.DebugInfo
exports { { { 1
(
t2p_map, p2e_map, var_map, all_threads, non_critical_functions
) where
imports { { { 1
import Control.Applicative ((<$>), (<*>))
import Data.List (nub)
import Data.Maybe (mapMaybe)
import Language.C.Syntax.AST (CExternal... | null | https://raw.githubusercontent.com/copton/ocram/c7166eab0187868a52a61017c6d3687e5a1a6162/ocram/src/Ocram/Debug/DebugInfo.hs | haskell | prefix, match, postfix, groups | # LANGUAGE TemplateHaskell , ViewPatterns #
module Ocram.Debug.DebugInfo
exports { { { 1
(
t2p_map, p2e_map, var_map, all_threads, non_critical_functions
) where
imports { { { 1
import Control.Applicative ((<$>), (<*>))
import Data.List (nub)
import Data.Maybe (mapMaybe)
import Language.C.Syntax.AST (CExternal... |
9ffac0258800020fb6f88a55e065688023d6bd4588b77ffe2ec12c48f5ac34c5 | katox/4clojure-solutions | project.clj | (defproject foreclojure-solutions "0.1.0-SNAPSHOT"
:description "My take on problems on "
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]])
| null | https://raw.githubusercontent.com/katox/4clojure-solutions/e7d9edc8af41934f2087c7a25b28799acac70374/project.clj | clojure | (defproject foreclojure-solutions "0.1.0-SNAPSHOT"
:description "My take on problems on "
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]])
| |
83a2869143ba4de9fe1a0f7f666239a141dbabc5cffbc9ff75c12a42cb74f677 | graninas/Functional-Design-and-Architecture | ScenarioDSL4Advanced.hs | module ScenarioDSL4Advanced where
import Data.Time
type Name = String
type Duration = DiffTime
-- service function:
seconds s = secondsToDiffTime s
data Value = FloatValue Float
| IntValue Int
| StringValue String
deriving (Show, Read, Eq)
data Controller = Controller Name
... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/1736abc16d3e4917fc466010dcc182746af2fd0e/First-Edition/BookSamples/CH02/ScenarioDSL4Advanced.hs | haskell | service function:
interpret (Script ps) = interpretMany ps | module ScenarioDSL4Advanced where
import Data.Time
type Name = String
type Duration = DiffTime
seconds s = secondsToDiffTime s
data Value = FloatValue Float
| IntValue Int
| StringValue String
deriving (Show, Read, Eq)
data Controller = Controller Name
deriving (Show, Read,... |
0f931a75d8d0ecd67c4d978ec643b796f90709f0f26e202cd6b75b410449022c | fpco/stackage-server | ModuleForest.hs | -- Adopted from -server/blob/master/Distribution/Server/Packages/ModuleForest.hs
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ViewPatterns #
module Distribution.Package.ModuleForest
( moduleName
, moduleForest
, ModuleTree(..)
, ModuleForest
, NameComponent
) where
import Distribution.ModuleName (... | null | https://raw.githubusercontent.com/fpco/stackage-server/b707b5a0d72c44a3134a305b628c3f0b28db2697/src/Distribution/Package/ModuleForest.hs | haskell | Adopted from -server/blob/master/Distribution/Server/Packages/ModuleForest.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ViewPatterns #
module Distribution.Package.ModuleForest
( moduleName
, moduleForest
, ModuleTree(..)
, ModuleForest
, NameComponent
) where
import Distribution.ModuleName (ModuleName)
import qualified Distribution.ModuleName as ModuleName
import RIO
imp... |
809dcf28169a56eea11d78c3b5e8e51bb4e79614b1c419406522e4014d8ded88 | cxphoe/SICP-solutions | environment.rkt | (load "expression.rkt")
; environment operations
(define (enclosing-environment env) (cdr env))
(define (first-frame env) (car env))
(define the-empty-environment '())
(define (make-frame variables values)
(cons variables values))
(define (frame-variables frame) (car frame))
(define (frame-values frame) (cdr fr... | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%204-Metalinguistic%20Abstraction/1.The%20Meta-cycle%20Evaluator/environment.rkt | racket | environment operations | (load "expression.rkt")
(define (enclosing-environment env) (cdr env))
(define (first-frame env) (car env))
(define the-empty-environment '())
(define (make-frame variables values)
(cons variables values))
(define (frame-variables frame) (car frame))
(define (frame-values frame) (cdr frame))
(define (add-bindi... |
bddb79260b59ce37f822cfd4986a8972e572b9d37c7486be1848b41ba6caf6cf | nomnom-insights/nomnom.lockjaw | project.clj | (defproject nomnom/lockjaw "0.3.1"
:description "Postgres Advisory Locks as a Component"
:url "-insights/nomnom.lockjaw"
:license {:name "MIT License"
:url ""
:year 2018
:key "mit"}
:deploy-repositories {"clojars" {:sign-releases false
:user... | null | https://raw.githubusercontent.com/nomnom-insights/nomnom.lockjaw/8d568d1ec36054ca25e798613ccd3e1d229c94cf/project.clj | clojure | pulls in all the PG bits and a connection pool
component | (defproject nomnom/lockjaw "0.3.1"
:description "Postgres Advisory Locks as a Component"
:url "-insights/nomnom.lockjaw"
:license {:name "MIT License"
:url ""
:year 2018
:key "mit"}
:deploy-repositories {"clojars" {:sign-releases false
:user... |
2cd8329ffe7241bd686898c6f77288bbf75f6991e06a73370b36cab6652d0e77 | chaw/r7rs-libs | red-line.sps |
(import (scheme base)
(srfi 42)
(rebottled pstk))
;; set up the graphical display
(let ((tk (tk-start)))
(tk/wm 'title tk "Example")
(tk 'configure 'width: 300 'height: 200)
(let ((canvas (tk 'create-widget 'canvas 'width: 300 'height: 200))
(image (tk/image 'create 'photo 'width: 300 'h... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/rebottled-examples/pstk/red-line.sps | scheme | set up the graphical display
clear the image
draw a line across the centre
place image in canvas
put canvas on window |
(import (scheme base)
(srfi 42)
(rebottled pstk))
(let ((tk (tk-start)))
(tk/wm 'title tk "Example")
(tk 'configure 'width: 300 'height: 200)
(let ((canvas (tk 'create-widget 'canvas 'width: 300 'height: 200))
(image (tk/image 'create 'photo 'width: 300 'height: 200)))
(tk-eval (stri... |
078c6c016f75d93d12350df6d650ee1eefdd539125a0554ab5dcb8596d68119c | portkey-cloud/aws-clj-sdk | _2012-10-29.clj | (ns portkey.aws.datapipeline.-2012-10-29 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope
{:service "datapipeline", :region "ap-northeast-1"},
:ssl-common-name "datapipeline.ap-northeast-1.amazonaws.com",
:endpoint "-northeast-1.amazonaws.com",
:signature-version :v4}... | null | https://raw.githubusercontent.com/portkey-cloud/aws-clj-sdk/10623a5c86bd56c8b312f56b76ae5ff52c26a945/src/portkey/aws/datapipeline/_2012-10-29.clj | clojure | (ns portkey.aws.datapipeline.-2012-10-29 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope
{:service "datapipeline", :region "ap-northeast-1"},
:ssl-common-name "datapipeline.ap-northeast-1.amazonaws.com",
:endpoint "-northeast-1.amazonaws.com",
:signature-version :v4}... | |
c7a87a5d724e392674c11a1cd4d1cb075f7743565dac1b80e5ad01edd0662fc4 | xapi-project/xen-api | mime.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/libs/http-svr/mime.ml | ocaml | MIME handling for HTTP responses
* Map extension to MIME type
* Map a file extension to a MIME type
* Figure out a mime type from a full filename
split filename into dot components |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
de1ad678bc30d4f9b8dbec3aa74f2a1bd955c9fe527ee446198d884059091da3 | djjolicoeur/datamaps | core_test.clj | (ns datamaps.core-test
(:require [clojure.test :refer :all]
[datamaps.core :refer :all]
[datamaps.facts :as df]
[datomic.api :as datomic]))
(def test-users
[{:firstname "Dan"
:lastname "Joli"
:cats ["islay" "zorro" "lily"]
:dogs ["ginny"]
:location {:city "Annap... | null | https://raw.githubusercontent.com/djjolicoeur/datamaps/f7523e83a87c5f790f492bbfcce8a23980ef0077/test/datamaps/core_test.clj | clojure | (ns datamaps.core-test
(:require [clojure.test :refer :all]
[datamaps.core :refer :all]
[datamaps.facts :as df]
[datomic.api :as datomic]))
(def test-users
[{:firstname "Dan"
:lastname "Joli"
:cats ["islay" "zorro" "lily"]
:dogs ["ginny"]
:location {:city "Annap... | |
a81a30ff42dba7bec8cc664197effea1b1b2ce5effe548fb7e17c06630718cc3 | jrh13/hol-light | herbrand.ml | (* ========================================================================= *)
(* Refinement of canonical model theorem to consider ground terms only. *)
(* ========================================================================= *)
let herbase_RULES,herbase_INDUCT,herbase_CASES = new_inductive_definition
`(~... | null | https://raw.githubusercontent.com/jrh13/hol-light/ea44a4cacd238d7fa5a397f043f3e3321eb66543/Logic/herbrand.ml | ocaml | =========================================================================
Refinement of canonical model theorem to consider ground terms only.
=========================================================================
-------------------------------------------------------------------------
Canonical model... |
let herbase_RULES,herbase_INDUCT,herbase_CASES = new_inductive_definition
`(~(?c. (c,0) IN fns) ==> herbase fns (V 0)) /\
(!f l. (f,LENGTH l) IN fns /\ ALL (herbase fns) l
==> herbase fns (Fn f l))`;;
let herbrand = new_definition
`herbrand (L:(num#num->bool)#(num#num->bool)) M <=>
(Dom M = h... |
cc805b5f1c60240ff08f43d1b60fa7e92c66d6175e5630475f5366e1e6d14a6e | namin/logically | smt_test.clj | (ns logically.exp.smt_test
(:use [logically.exp.smt] :reload)
(:refer-clojure :exclude [==])
(:use [clojure.core.logic :exclude [is] :as l])
(:use [clojure.test]))
(deftest unsat-1
(is (= '()
(run* [q]
(smtc `(~'= ~q 1))
(smtc `(~'= ~q 2))
(smtc `(~'= ~q 3))))))
(deftest sa... | null | https://raw.githubusercontent.com/namin/logically/902258221e347edf16e8ff37f918a534ff1088b4/test/logically/exp/smt_test.clj | clojure | just to get a smaller answer... | (ns logically.exp.smt_test
(:use [logically.exp.smt] :reload)
(:refer-clojure :exclude [==])
(:use [clojure.core.logic :exclude [is] :as l])
(:use [clojure.test]))
(deftest unsat-1
(is (= '()
(run* [q]
(smtc `(~'= ~q 1))
(smtc `(~'= ~q 2))
(smtc `(~'= ~q 3))))))
(deftest sa... |
3d96a3436aad48fd66b5c3e008487d38dcc76a468cc9aa09e5f6fb75686a8d12 | endobson/racket-grpc | slice.rkt | #lang racket/base
(require
"base-lib.rkt"
ffi/unsafe
ffi/unsafe/atomic
(rename-in
racket/contract
[-> c:->]))
(module* unsafe #f
(provide
_grpc-slice/arg ;; fun-syntax
_grpc-slice-pointer/arg ;; fun-syntax
_grpc-slice-pointer/output-arg ;; fun-syntax
(contract-out
[immobile-grp... | null | https://raw.githubusercontent.com/endobson/racket-grpc/7f3cca4b66f71490236c8db40f0011595f890fa0/ffi/slice.rkt | racket | fun-syntax
fun-syntax
fun-syntax | #lang racket/base
(require
"base-lib.rkt"
ffi/unsafe
ffi/unsafe/atomic
(rename-in
racket/contract
[-> c:->]))
(module* unsafe #f
(provide
(contract-out
[immobile-grpc-slice? predicate/c]
[malloc-immobile-grpc-slice (c:-> immobile-grpc-slice?)]
[free-immobile-grpc-slice (c:-> im... |
3e9f7dac1142baa1e7c530d630dcd527010a4df59fb4c8eb2d8eef308d74035e | innoq/innoq-blockchain-erlang | erl_sals_chain_root.erl | -module(erl_sals_chain_root).
-export([init/2, info/3]).
init(Req, _Opts) ->
self() ! handle_request,
{cowboy_loop, Req, rumpelstielzchen}.
info(_Msg, Req, State) ->
Uuid = erl_sals_chain_uuid:get_uuid(),
BlockHeight = erl_sals_chain_keeper:get_index_of_last_block(),
Doc = {[{nodeId, Uuid}, {curr... | null | https://raw.githubusercontent.com/innoq/innoq-blockchain-erlang/52187e5f572a3d9681fe172b38dd32758fde2602/erl_sals_chain/apps/erl_sals_chain/src/erl_sals_chain_root.erl | erlang | -module(erl_sals_chain_root).
-export([init/2, info/3]).
init(Req, _Opts) ->
self() ! handle_request,
{cowboy_loop, Req, rumpelstielzchen}.
info(_Msg, Req, State) ->
Uuid = erl_sals_chain_uuid:get_uuid(),
BlockHeight = erl_sals_chain_keeper:get_index_of_last_block(),
Doc = {[{nodeId, Uuid}, {curr... | |
317e992494340062752e75862ff5e44f1494c3562fdaac03571c2e8fbb1a08cd | electric-sql/vaxine | antidotec_set.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2014 SyncFree Consortium . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain... | null | https://raw.githubusercontent.com/electric-sql/vaxine/872a83ea8d4935a52c7b850bb17ab099ee9c346b/apps/antidotec_pb/src/antidotec_set.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2014 SyncFree Consortium . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(anti... |
7e140599a439811625023b003121f86310f3dee756759256499eb09c77042d3d | janestreet/base | test_globalize_lib.mli | (*_ Intentionally blank *)
| null | https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/test/test_globalize_lib.mli | ocaml | _ Intentionally blank | |
f96da046ca9f5ed9dfd7a07480037c7780af2c15fa8e150d7ffba2551797ee7f | typelead/intellij-eta | JpsCompositeElement.hs | module FFI.Org.JetBrains.JPS.Model.JpsCompositeElement where
import P
import FFI.Org.JetBrains.JPS.Model.JpsElement
import FFI.Org.JetBrains.JPS.Model.JpsElementContainer
Start org.jetbrains.jps.model .
data JpsCompositeElement = JpsCompositeElement @org.jetbrains.jps.model.JpsCompositeElement
deriving Class
t... | null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/main/eta/FFI/Org/JetBrains/JPS/Model/JpsCompositeElement.hs | haskell | module FFI.Org.JetBrains.JPS.Model.JpsCompositeElement where
import P
import FFI.Org.JetBrains.JPS.Model.JpsElement
import FFI.Org.JetBrains.JPS.Model.JpsElementContainer
Start org.jetbrains.jps.model .
data JpsCompositeElement = JpsCompositeElement @org.jetbrains.jps.model.JpsCompositeElement
deriving Class
t... | |
61f05f8914ffe20e9ea1710b1159cb685cc968f9936558618ff68df74ea3fc08 | rd--/hsc3 | wrap.help.hs | wrap ; ln 2021 - 04 - 15 /
let s = sinOsc ar (sinOsc ar (1 / 40) 0 * 100 + 20000) 0
in wrap s (xLine ar (-1.0) (-0.01) 20 DoNothing) 1 * 0.1
---- ; drawings
UI.ui_baudline 4096 50 "linear" 2
| null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/wrap.help.hs | haskell | -- ; drawings | wrap ; ln 2021 - 04 - 15 /
let s = sinOsc ar (sinOsc ar (1 / 40) 0 * 100 + 20000) 0
in wrap s (xLine ar (-1.0) (-0.01) 20 DoNothing) 1 * 0.1
UI.ui_baudline 4096 50 "linear" 2
|
a47c6a8c007a4bee20f7c506a6091476f5d56ba077ed1b382bca33ba133a0037 | bobzhang/ocaml-book | basic_ulex.ml |
open Ulexing
open Batteries
let regexp op_ar = ['+' '-' '*' '/']
let regexp op_bool = ['!' '&' '|']
let regexp rel = ['=' '<' '>']
(** get string output, not int array *)
let lexeme = Ulexing.utf8_lexeme
let rec basic = lexer
| [' '] -> basic lexbuf
| op_ar | op_bool ->
let ar = lexeme lexbuf in
... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/code/basic_ulex.ml | ocaml | * get string output, not int array
*Remark
|
open Ulexing
open Batteries
let regexp op_ar = ['+' '-' '*' '/']
let regexp op_bool = ['!' '&' '|']
let regexp rel = ['=' '<' '>']
let lexeme = Ulexing.utf8_lexeme
let rec basic = lexer
| [' '] -> basic lexbuf
| op_ar | op_bool ->
let ar = lexeme lexbuf in
`Lsymbol ar
| "<=" | ">="| "<>" | rel ... |
f1733428ca7cb0776dfa115613ed6e5fd1231b944200d561264e80e9d92166b5 | AccelerateHS/accelerate | Main.hs | -- |
-- Module : Main
Copyright : [ 2017 .. 2020 ] The Accelerate Team
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
Portability : non - portable ( GHC extensions )
--
module Main where
import Build_doctests ( flags, pkgs, module_sources )
import... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate/63e53be22aef32cd0b3b6f108e637716a92b72dc/test/doctest/Main.hs | haskell | |
Module : Main
License : BSD3
Stability : experimental
| Copyright : [ 2017 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Main where
import Build_doctests ( flags, pkgs, module_sources )
import Data.Foldable ( traverse_ )
import Test.DocTest
main :: ... |
410fb4984b0897686d8d1007fd6c60b07d666094a0c5151641db42fea77cfa04 | JoeDralliam/Ocsfml | myocamlbuild.ml | open Ocamlbuild_plugin
open OcamlbuildCpp
open Pathname
let link_to_static_sfml_libraries = false ;;
let compiler = List.hd (Compiler.available ()) ;;
let add_sfml_flags static =
let open FindSfml in
let modules = SfmlConfiguration.([System ; Window ; Graphics ; Audio ; Network]) in
let sfml = Sf... | null | https://raw.githubusercontent.com/JoeDralliam/Ocsfml/e1bf50665aa34dea4e4d249bf73ab0036b3731fb/myocamlbuild.ml | ocaml | open Ocamlbuild_plugin
open OcamlbuildCpp
open Pathname
let link_to_static_sfml_libraries = false ;;
let compiler = List.hd (Compiler.available ()) ;;
let add_sfml_flags static =
let open FindSfml in
let modules = SfmlConfiguration.([System ; Window ; Graphics ; Audio ; Network]) in
let sfml = Sf... | |
9abba96bcddb970451c9a56ee5233bb760aa5e4181ba08ccc7ba7a354dec6683 | mwsundberg/2020-brickhack | proper_ribbons.cljs | (ns brickhack.proper-ribbons
(:require [brickhack.common :as c]
[quil.core :as q]
[quil.middleware :as middleware]))
(def body (.-body js/document))
(def w (.-clientWidth body))
(def h (.-clientHeight body))
; This-sketch custom code
(def palette (rand-n... | null | https://raw.githubusercontent.com/mwsundberg/2020-brickhack/522855b897aa57c346d79d7a594cf99e7d381b76/src/brickhack/proper_ribbons.cljs | clojure | This-sketch custom code
changes how much each point jumps
Start of the sketch codes
(render-field w h)
Reduce each trail to a list of point pairs (ready for cons-ing)
Replace each trail with a list of pairs
Merge all of the trails' points
Sort them on the y axis
Hopefully this works | (ns brickhack.proper-ribbons
(:require [brickhack.common :as c]
[quil.core :as q]
[quil.middleware :as middleware]))
(def body (.-body js/document))
(def w (.-clientWidth body))
(def h (.-clientHeight body))
(def palette (rand-nth c/palettes))
(defn trail
[id]
(c/particle-trail id (q/rando... |
358f785dbe26afe11b11b000954eb220c9b2086210ad3ecfc4763487c676095f | gafiatulin/codewars | Backronym.hs | -- makeBackronym
-- /
module Codewars.Exercise.Backronym where
import Codewars.Exercise.Backronym.Dictionary (dict)
import Data.Char (toUpper)
makeBackronym :: String -> String
makeBackronym = unwords . map (dict . toUpper)
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/Backronym.hs | haskell | makeBackronym
/ |
module Codewars.Exercise.Backronym where
import Codewars.Exercise.Backronym.Dictionary (dict)
import Data.Char (toUpper)
makeBackronym :: String -> String
makeBackronym = unwords . map (dict . toUpper)
|
03c6d9ebe85b1da4989130de1b51a8d43f2db8902045e4e8f3b7e40bd3ac3fa4 | metabase/metabase | metric.clj | (ns metabase.api.metric
"/api/metric endpoints."
(:require
[clojure.data :as data]
[compojure.core :refer [DELETE GET POST PUT]]
[metabase.api.common :as api]
[metabase.api.query-description :as api.qd]
[metabase.events :as events]
[metabase.mbql.normalize :as mbql.normalize]
[metabase.models.i... | null | https://raw.githubusercontent.com/metabase/metabase/dad3d414e5bec482c15d826dcc97772412c98652/src/metabase/api/metric.clj | clojure | TODO - why can't set the other properties like `show_in_getting_started` when you create a Metric?
delete old fields as needed
add new fields as needed | (ns metabase.api.metric
"/api/metric endpoints."
(:require
[clojure.data :as data]
[compojure.core :refer [DELETE GET POST PUT]]
[metabase.api.common :as api]
[metabase.api.query-description :as api.qd]
[metabase.events :as events]
[metabase.mbql.normalize :as mbql.normalize]
[metabase.models.i... |
a6b8d1767d49b2f72ebd6e8879f7ec8a55afa4ee9e5d285913273f18c566078b | mtolly/onyxite-customs | GuitarHero1.hs | # LANGUAGE LambdaCase #
# LANGUAGE OverloadedRecordDot #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE TupleSections #
module Onyx.Build.GuitarHero1 where
import Control.Monad.Extra
import Control.Monad.Random (evalRand, mkStdG... | null | https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/Build/GuitarHero1.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
True if part has own audio
A single guitar track apparently doesn't work;
guitar also takes over channel 0 (left backing track) somehow?
always stereo as per above
should always be this for our output
don't know what these are yet
gh2 crashes if m... | # LANGUAGE LambdaCase #
# LANGUAGE OverloadedRecordDot #
# LANGUAGE TupleSections #
module Onyx.Build.GuitarHero1 where
import Control.Monad.Extra
import Control.Monad.Random (evalRand, mkStdGen)
import Control.Monad.Trans.Resource
import Data.Bi... |
d79bdeafadcf9994d3c099490ccaadaf60a2f3c690e7b96998a6d4204e023680 | DSiSc/why3 | abstraction.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/transform/abstraction.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
val abstraction : (Term.lsymbol -> bool) -> Task.task Trans.trans
* [ abstract keep t ] applies variable a... |
e8fa50751108af54a61b1ce7e5adcd526d8967d0e603b0d4eb84a744e7677441 | guildhall/guile-sly | font.scm |
Copyright ( C ) 2013 , 2014 >
;;;
;;; 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 version.
;;;
;;; This program is ... | null | https://raw.githubusercontent.com/guildhall/guile-sly/92f5f21da76986c5b606b36afc4bb984cc63da5b/examples/font.scm | scheme |
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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General P... |
Copyright ( C ) 2013 , 2014 >
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation , either version 3 of the
You should have received a copy of the GNU General Public License
(use-modules (sly game)
(sly fps)
(sly signal)
... |
08eff7d41dcb0e5c774fe7d3e0191388db80284dcb63cccac750bdb96411a5f0 | vii/dysfunkycom | bezier.lisp | ;;;;; Converted from the "Bezier" Processing example at:
;;;;; ""
;;;;; (C)2006 Luke J Crook
(in-package #:sdl-examples)
(defun bezier ()
(let ((width 200) (height 200))
(sdl:with-init ()
(sdl:window width height :title-caption "Bezier, from Processing.org")
(setf (sdl:frame-rate) 5)
... | null | https://raw.githubusercontent.com/vii/dysfunkycom/a493fa72662b79e7c4e70361ad0ea3c7235b6166/addons/lispbuilder-sdl/examples/bezier.lisp | lisp | Converted from the "Bezier" Processing example at:
""
(C)2006 Luke J Crook |
(in-package #:sdl-examples)
(defun bezier ()
(let ((width 200) (height 200))
(sdl:with-init ()
(sdl:window width height :title-caption "Bezier, from Processing.org")
(setf (sdl:frame-rate) 5)
(sdl:clear-display (sdl:color :r 0 :g 0 :b 0))
(sdl:with-color (a-col (sdl:color :r 255... |
12177c7b1d6bf9a84415ed7edf4751b7c3e9b6751165dd1f3921d5540a51e63d | PacktPublishing/Haskell-High-Performance-Programming | ioref-supply.hs | -- file: ioref-supply.hs
import Data.IORef
type Supply = IORef Int
createSupply :: IO Supply
createSupply = newIORef 0
newUID :: Supply -> IO Int
newUID supply = atomicModifyIORef' supply $ \uid -> (uid + 1, uid)
| null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter07/ioref-supply.hs | haskell | file: ioref-supply.hs |
import Data.IORef
type Supply = IORef Int
createSupply :: IO Supply
createSupply = newIORef 0
newUID :: Supply -> IO Int
newUID supply = atomicModifyIORef' supply $ \uid -> (uid + 1, uid)
|
4da320f90f4df39f4cf77df5c9b77d956739ae1585e4a896ac54cea212ed95d4 | techascent/tech.resource | gc_resource_test.clj | (ns tech.v3.gc-resource-test
(:require [tech.v3.resource :as resource]
[clojure.test :refer [deftest is testing]]))
(deftest gc-resources
(testing "System.gc cleans up the things"
(let [counter (atom 0)]
(let [create-fn (fn []
(swap! counter inc)
... | null | https://raw.githubusercontent.com/techascent/tech.resource/d27e56d14f60504a343fc221d520797231fd11ba/test/tech/v3/gc_resource_test.clj | clojure | The compiler is careful to null out things that are no longer in use. | (ns tech.v3.gc-resource-test
(:require [tech.v3.resource :as resource]
[clojure.test :refer [deftest is testing]]))
(deftest gc-resources
(testing "System.gc cleans up the things"
(let [counter (atom 0)]
(let [create-fn (fn []
(swap! counter inc)
... |
7a3d471d7a9d656b8d8978c76072ed37857b1f4d32664f10e54e6513cc63e70e | binaryage/chromex | instance_id.clj | (ns chromex.app.instance-id
"Use chrome.instanceID to access the Instance ID service.
* available since Chrome 46
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps/chromex/app/instance_id.clj | clojure | -- events -----------------------------------------------------------------------------------------------------------------
docs: /#tapping-events
-- convenience ------------------------------------------------------------------------------------------------------------
--------------------------------------------... | (ns chromex.app.instance-id
"Use chrome.instanceID to access the Instance ID service.
* available since Chrome 46
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-... |
6de9301bd38a45faaa2597412e97776e9036498224bfc84fa234602deeea4268 | mewhhaha/apecs-unity-tutorial-haskell | Resource.hs | module Game.Resource where
import Apecs qualified
import Data.Map.Strict qualified as Map
import Optics.Core (Lens', set, view)
import Relude hiding (init)
import SDL qualified
import SDL.Font qualified as SDLFont
import SDL.Image qualified as SDLImage
import SDL.Mixer qualified as SDLMixer
import System.FilePath ((</... | null | https://raw.githubusercontent.com/mewhhaha/apecs-unity-tutorial-haskell/d995e5311210b4c186ededbd38c64f6861f5eae1/src/Game/Resource.hs | haskell | module Game.Resource where
import Apecs qualified
import Data.Map.Strict qualified as Map
import Optics.Core (Lens', set, view)
import Relude hiding (init)
import SDL qualified
import SDL.Font qualified as SDLFont
import SDL.Image qualified as SDLImage
import SDL.Mixer qualified as SDLMixer
import System.FilePath ((</... | |
f66c6055c0a6a47fdb732eb50d68fbb16146f0499f206c52c5add2c1afca4441 | degree9/meta | promise.clj | (ns meta.promise)
(defmacro defpromise [name args & body]
`(def ~name (meta.promise/promise (fn ~args ~@body))))
(defmacro with-callback [cb & body]
`(meta.promise/promise
(fn [resolve# reject#]
(let [~cb (fn [err# result#] (if err# (reject# err#) (resolve# result#)))]
~@body))))
| null | https://raw.githubusercontent.com/degree9/meta/16dee6b01dd6402250b4b7a30185c0c0466985b3/src/meta/promise.clj | clojure | (ns meta.promise)
(defmacro defpromise [name args & body]
`(def ~name (meta.promise/promise (fn ~args ~@body))))
(defmacro with-callback [cb & body]
`(meta.promise/promise
(fn [resolve# reject#]
(let [~cb (fn [err# result#] (if err# (reject# err#) (resolve# result#)))]
~@body))))
| |
dca6146d6ba3734e8c070d4b3c4eb30e013a6d7265510b1c9cf798f2774dcdde | mmontone/cl-rest-server | error-handling.lisp | (in-package :rest-server.error)
;; Error handling configuration
(defvar *catch-errors* t)
(defvar *server-catch-errors*)
(defvar *error-handler* 'log-api-error)
(defvar *default-error-handler* 'default-error-handler)
;; Conditions
(define-condition http-error (simple-error)
((status-code :initarg :status-code
... | null | https://raw.githubusercontent.com/mmontone/cl-rest-server/cd3a08681a1c3215866fedcd36a6bc98d223d52d/src/error-handling.lisp | lisp | Error handling configuration
Conditions
We don't want to log HTTP "error" signals like
an application error
else, debug mode
http-return-code decides the HTTP status code to return for
the signaled condition. Implement this method for new conditions.
Example:
Plugging | (in-package :rest-server.error)
(defvar *catch-errors* t)
(defvar *server-catch-errors*)
(defvar *error-handler* 'log-api-error)
(defvar *default-error-handler* 'default-error-handler)
(define-condition http-error (simple-error)
((status-code :initarg :status-code
:initform (error "Provide the ... |
24ea6ee823a46713e3e448a56a814369b77d1eb1e5f2b828f05235bc06a71f60 | shayne-fletcher/zen | bdate_test.ml | let _ =
let t = Bdate.local_day ()
and u = Bdate.mk_date (2015, 01, 01) in
let yr, mon, day= Bdate.year_month_day u in
Printf.printf "%s\n" (Bdate.string_of_date t);
Printf.printf "%s\n" (Bdate.string_of_date u);
Printf.printf "%d\n" (compare u t);
Printf.printf "%d\n" (compare t u);
Printf.printf "%d\... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/bdate/bdate_test.ml | ocaml | let _ =
let t = Bdate.local_day ()
and u = Bdate.mk_date (2015, 01, 01) in
let yr, mon, day= Bdate.year_month_day u in
Printf.printf "%s\n" (Bdate.string_of_date t);
Printf.printf "%s\n" (Bdate.string_of_date u);
Printf.printf "%d\n" (compare u t);
Printf.printf "%d\n" (compare t u);
Printf.printf "%d\... | |
341cae67835055cd4dd6a990034c577f05961c8629e8120051120c63fdf19845 | lambdacube3d/lambdacube-edsl | CubeMap.hs | {-# OPTIONS -cpp #-}
# LANGUAGE OverloadedStrings , , TypeOperators , DataKinds , FlexibleContexts #
import Control.Applicative hiding (Const)
import Control.Monad
import qualified Data.ByteString.Char8 as SB
import qualified Data.Trie as T
import Data.Vect hiding (reflect')
import Data.Vect.Float.Instances ()
import... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-edsl/4347bb0ed344e71c0333136cf2e162aec5941df7/lambdacube-samples/CubeMap.hs | haskell | # OPTIONS -cpp # | # LANGUAGE OverloadedStrings , , TypeOperators , DataKinds , FlexibleContexts #
import Control.Applicative hiding (Const)
import Control.Monad
import qualified Data.ByteString.Char8 as SB
import qualified Data.Trie as T
import Data.Vect hiding (reflect')
import Data.Vect.Float.Instances ()
import FRP.Elerea.Param
imp... |
9250d4239458b229fe1d0635e016b4826262add79c07c081091eead709fe8540 | RunOrg/RunOrg | rich.mli | (* © 2014 RunOrg *)
* A rich text block is a long UTF-8 string that includes formatting tags .
Tags follow an XML - like syntax , but the parser has been kept intentionally
simple . Supported tags are : < h1 > to < h6 > , < strong > , < em > , < p > , < ,
< a href > and < blockquote > .
Th... | null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/stdLib/rich.mli | ocaml | © 2014 RunOrg
* Attempt to parse a string as a rich text block. Return [None] if the string
does not satisfy the requirements.
Also, even if [let Some rich = Rich.of_string str], there is no guarantee
that [Rich.to_string rich = str] (and indeed, the rich text block might
rename and reformat tags a... |
* A rich text block is a long UTF-8 string that includes formatting tags .
Tags follow an XML - like syntax , but the parser has been kept intentionally
simple . Supported tags are : < h1 > to < h6 > , < strong > , < em > , < p > , < ,
< a href > and < blockquote > .
The intent is that a r... |
4f05c53d091c7ee79523c1faac301d9f4ab9060fbb0cdb03da292816de4c5d68 | cgrand/boring | project.clj | (defproject net.cgrand/boring "0.1.0-SNAPSHOT"
:description "A library to bore tunnels."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.apache.sshd/sshd-core "1.7.0"]])
| null | https://raw.githubusercontent.com/cgrand/boring/bca8885f01f8c7c0ad67c8d23cdd4ccc199dec1c/project.clj | clojure | (defproject net.cgrand/boring "0.1.0-SNAPSHOT"
:description "A library to bore tunnels."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.apache.sshd/sshd-core "1.7.0"]])
| |
a74d14bd88ebe231b611f2d101b0fd474033f8f96551bae128c76b475d2137a7 | backtracking/bibtex2html | biboutput.mli | (**************************************************************************)
(* bibtex2html - A BibTeX to HTML translator *)
Copyright ( C ) 1997 - 2014 and
(* *)
(* This software is free software; you can r... | null | https://raw.githubusercontent.com/backtracking/bibtex2html/7c9547da79a13c3accffc9947c846df96a6edd68/biboutput.mli | ocaml | ************************************************************************
bibtex2html - A BibTeX to HTML translator
This software is free software; you can redistribute it and/or
... | Copyright ( C ) 1997 - 2014 and
modify it under the terms of the GNU General Public
License version 2 , as published by the Free Software Foundation .
See the GNU General Public License version 2 for more details
s [ output_bib html ch bib keys ] outputs to the ch... |
cb4b8d289e3e5de4ea0e9d2cc9ffdadb1d8bb214847d476a955538f71d207534 | ml4tp/tcoq | scheme.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/plugins/extraction/scheme.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
s Production of Scheme syntax.
s Sc... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open CErrors
open Ut... |
96f8d2d5217387bf06aa7dd3ce4879278c019c5e805ab344355d4ec10eec25b6 | ekmett/hask | Fin.hs | # LANGUAGE DeriveFunctor , , DeriveTraversable , LambdaCase #
import Control.Applicative
import Control.Monad
import Data.Foldable hiding (elem)
import Data.List (nub)
import Data.Traversable
import Data.Void
import Prelude hiding (all, any, elem)
newtype Fin a = Fin { runFin :: [Monomial a] }
deriving (Show, Read,... | null | https://raw.githubusercontent.com/ekmett/hask/54ea964af8e0c1673ac2699492f4c07d977cb3c8/wip/Fin.hs | haskell | countable if made up of all initial elements | # LANGUAGE DeriveFunctor , , DeriveTraversable , LambdaCase #
import Control.Applicative
import Control.Monad
import Data.Foldable hiding (elem)
import Data.List (nub)
import Data.Traversable
import Data.Void
import Prelude hiding (all, any, elem)
newtype Fin a = Fin { runFin :: [Monomial a] }
deriving (Show, Read,... |
c5677d72bcb91e89e5b4e5cf9e13e49b3486906efde2ecdc12064255e91e4c69 | tonsky/advent2018 | day4.clj | (ns advent2018.day4
(:require
[clojure.string :as str]
[clojure.set :as set]
[clojure.walk :as walk]))
(def input (slurp "inputs/day4"))
(def lines (->> (str/split input #"\n") sort))
(defn parse-line
"line => [:asleep minute] | [:awake minute] | [:guard id]"
[l]
(let [[_ m t] (re-matches #"\[\d{... | null | https://raw.githubusercontent.com/tonsky/advent2018/6f8d15bf37a150a288e3447df7766c362f7086e9/src/advent2018/day4.clj | clojure | guard minute times | (ns advent2018.day4
(:require
[clojure.string :as str]
[clojure.set :as set]
[clojure.walk :as walk]))
(def input (slurp "inputs/day4"))
(def lines (->> (str/split input #"\n") sort))
(defn parse-line
"line => [:asleep minute] | [:awake minute] | [:guard id]"
[l]
(let [[_ m t] (re-matches #"\[\d{... |
706933fff459b77c88ac08d0e1e6e757b915d06df736bdd4b89735dd14dc8501 | nikodemus/SBCL | seq.pure.lisp | ;;;; tests related to sequences
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;;;;
;;;; This software is in the public... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/tests/seq.pure.lisp | lisp | tests related to sequences
more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
Make sure it doesn't happen again.
And equally similarly, REMOV... |
This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
(in-package :cl-user)
As reported by from his ansi - test suite for gcl , REMOVE
malfunctioned when given : START , : END and : FROM - END arguments .
(let* ((o... |
85a591b9abf8dfb6d6b5cae8dc1bc002b69544cc3fda7fc42802ed51838330b6 | coq-tactician/coq-tactician | find_tactic_syntax.ml | open Ltac_plugin
open Monad_util
open Map_all_the_things
open Tacexpr
open Names
module TacticFinderDef = struct
module M = WriterMonad
(struct type w = bool let id = false let comb = Bool.(||) end)
include MapDefTemplate (M)
end
module TacticFinderMapper = MakeMapper(TacticFinderDef)
open TacticFinderDef
l... | null | https://raw.githubusercontent.com/coq-tactician/coq-tactician/989067831f1ab76d0676e8ddcdd3c963a2335de7/src/find_tactic_syntax.ml | ocaml | open Ltac_plugin
open Monad_util
open Map_all_the_things
open Tacexpr
open Names
module TacticFinderDef = struct
module M = WriterMonad
(struct type w = bool let id = false let comb = Bool.(||) end)
include MapDefTemplate (M)
end
module TacticFinderMapper = MakeMapper(TacticFinderDef)
open TacticFinderDef
l... | |
7961300e7b8600c6521444527cf288497eb698e4dfb1251df03101f71fe33ef0 | JacquesCarette/Drasil | AST.hs | module GOOL.Drasil.AST (Terminator(..), ScopeTag(..), QualifiedName, qualName,
FileType(..), isSource, Binding(..), onBinding, BindData(bind, bindDoc), bd,
FileData(filePath, fileMod), fileD, updateFileMod, FuncData(fType, funcDoc),
fd, ModData(name, modDoc), md, updateMod, MethodData(mthdDoc), mthd,
update... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/92dddf7a545ba5029f99ad5c5eddcd8dad56a2d8/code/drasil-gool/lib/GOOL/Drasil/AST.hs | haskell | For how statement endings are printed
Used for state variables and methods
Eq is needed for organizing methods and state variables into public and
private groups for C++ class rendering
Used in method exception map and call map.
(Combined) file
Used as the underlying data type for Files in all renderers
Used ... | module GOOL.Drasil.AST (Terminator(..), ScopeTag(..), QualifiedName, qualName,
FileType(..), isSource, Binding(..), onBinding, BindData(bind, bindDoc), bd,
FileData(filePath, fileMod), fileD, updateFileMod, FuncData(fType, funcDoc),
fd, ModData(name, modDoc), md, updateMod, MethodData(mthdDoc), mthd,
update... |
a3ad9c866465809fd904f8108fc41db9802133065161035987248c10c6f46f90 | PacktWorkshops/The-Clojure-Workshop | project.clj | (defproject hello-clojurescript.core "0.1.0-SNAPSHOT"
:description "Sample project showing a Figwheel and Rum application"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter09/Exercise9.08/hello-clojurescript.core/project.clj | clojure | (defproject hello-clojurescript.core "0.1.0-SNAPSHOT"
:description "Sample project showing a Figwheel and Rum application"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "... | |
ca2d1b2d5059b40a1518acb967abb0bea5ce23f2afa17ecb40dd75385d60a6aa | ygmpkk/house | PointParameter.hs | -- #hide
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PointParameter
Copyright : ( c ) 2003
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer :
-- Stability : provisional
-- Portabi... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/PointParameter.hs | haskell | #hide
------------------------------------------------------------------------------
|
Module : Graphics.Rendering.OpenGL.GL.PointParameter
License : BSD-style (see the file libraries/OpenGL/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
This is a purely internal modul... | Copyright : ( c ) 2003
module Graphics.Rendering.OpenGL.GL.PointParameter (
PointParameter(..), pointParameterf, pointParameterfv, pointParameteri
) where
import Foreign.Ptr ( Ptr )
import Graphics.Rendering.OpenGL.GL.BasicTypes ( GLenum, GLfloat, GLint )
import Graphics.Rendering.OpenGL.GL.Extensions (
... |
cb373e66b4ecda77b79342f5e68c368378ccc14cf4b67cd975bf59eb29595664 | phadej/staged | Main.hs | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -ddump - splices #
module Main (main) where
import Examples
import Staged.Commons
main :: IO ()
main = do
-- simple example
print $$(ex01 [|| True ||])
-- letrec and letrecH
print $$(fromCode $ fibnr 8)
print $ $$(fromCode $ isEvenCodeH TagE) (10 :: Int... | null | https://raw.githubusercontent.com/phadej/staged/b51c8c508af71ddb2aca4a75030da9b2c4f9e3dd/staged-commons/example/Main.hs | haskell | simple example
letrec and letrecH | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -ddump - splices #
module Main (main) where
import Examples
import Staged.Commons
main :: IO ()
main = do
print $$(ex01 [|| True ||])
print $$(fromCode $ fibnr 8)
print $ $$(fromCode $ isEvenCodeH TagE) (10 :: Int)
|
ffe1ba600ee36c31164dc49c13634024576e64b52e1e4913a620d2d8bb477f57 | haskell-tools/haskell-tools | InRhsGuard.hs | {-# LANGUAGE BangPatterns #-}
module InRhsGuard where
f x
| [!y] <- x = 5 {-* BangPatterns *-}
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/test/ExtensionOrganizerTest/BangPatternsTest/InRhsGuard.hs | haskell | # LANGUAGE BangPatterns #
* BangPatterns * |
module InRhsGuard where
f x
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.