_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 |
|---|---|---|---|---|---|---|---|---|
c982769456e73efdc335d9bfaab79570dd636b8e7252d706e8ecb7be0a203f00 | janestreet/memtrace_viewer_with_deps | test_sexp.ml | open! Core_kernel
open! Import
open! Sexp
module With_text = struct
open! With_text
let sexp_of_il = sexp_of_list sexp_of_int
let il_of_sexp = list_of_sexp int_of_sexp
let il_of_text text = Or_error.ok_exn (of_text il_of_sexp text)
let il_of_value il = of_value sexp_of_il il
module IL = struct
type t... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/core_kernel/test/src/test_sexp.ml | ocaml | open! Core_kernel
open! Import
open! Sexp
module With_text = struct
open! With_text
let sexp_of_il = sexp_of_list sexp_of_int
let il_of_sexp = list_of_sexp int_of_sexp
let il_of_text text = Or_error.ok_exn (of_text il_of_sexp text)
let il_of_value il = of_value sexp_of_il il
module IL = struct
type t... | |
9102b2981caa695cf3a74369cf596d3d1a43824775da34ad1c12316c16ace973 | ocaml-obuild/obuild | modname.ml | open Ext.Filepath
open Ext.Fugue
open Ext.Compat
type t = string
exception InvalidModuleName of string
exception EmptyModuleName
exception ModuleFilenameNotValid of string
let char_isalpha c = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
let char_is_valid_modchar c = char_isalpha c || (c >= '0' && c <= '9') || c... | null | https://raw.githubusercontent.com/ocaml-obuild/obuild/58459992ee9b3d56f09f6ff3dd434a52657b836c/obuild/modname.ml | ocaml | open Ext.Filepath
open Ext.Fugue
open Ext.Compat
type t = string
exception InvalidModuleName of string
exception EmptyModuleName
exception ModuleFilenameNotValid of string
let char_isalpha c = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
let char_is_valid_modchar c = char_isalpha c || (c >= '0' && c <= '9') || c... | |
d57373eaae3de72be83012068dbe774810dea2f9caaf316afc71e806950a2238 | helins/kafka.clj | stream.clj | (ns dvlopt.kstreams.stream
"Kafka Streams' abstraction of streams.
Cf. `dvlopt.kstreams.builder` for the big picture and details
A stream can be transformed by various functions. Those functions returns themselves a new stream representing the transformation.
Hence, a single stream can be used for the ba... | null | https://raw.githubusercontent.com/helins/kafka.clj/ecf688f1a8700491c2cd65bcfb19a3781aa4f575/src/dvlopt/kstreams/stream.clj | clojure | Transformations
The key is an ip address mapped to a country and the value is a collection mapped to its
The key is an ip address mapped to a country.
The value is a collection mapped to its number of items.
The value is a list of tokens and we want to count them individually so that we end up with
Joins
Enrich ... | (ns dvlopt.kstreams.stream
"Kafka Streams' abstraction of streams.
Cf. `dvlopt.kstreams.builder` for the big picture and details
A stream can be transformed by various functions. Those functions returns themselves a new stream representing the transformation.
Hence, a single stream can be used for the ba... |
903dccdf8d6fd5c7dd309ed83bed522bfe075c9dd02628af8da9bf19538a9cc7 | icicle-lang/p-ambiata | Strict.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE NoImplicitPrelude #
module P.Maybe.Strict (
Maybe'(..)
, fromMaybe'
, fromMaybeM'
, isJust'
, isNothing'
, maybe'
) where
import Control.Applicative (Applic... | null | https://raw.githubusercontent.com/icicle-lang/p-ambiata/3098e411c9d521321e866b2f9637113223ef41d1/src/P/Maybe/Strict.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveTraversable #
| Strict version of 'Data.Maybe.Maybe'.
| Not technically a monad due to bottom, but included anyway as we don't
use partial functions. | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveGeneric #
# LANGUAGE NoImplicitPrelude #
module P.Maybe.Strict (
Maybe'(..)
, fromMaybe'
, fromMaybeM'
, isJust'
, isNothing'
, maybe'
) where
import Control.Applicative (Applicative(..), Alternative(..))
import Control.DeepSeq (NFData(..... |
d2cc7ab5ed63b57739f1f4099993cd9daed1b8667a6d6f2d0667c4c90cc2eb1f | mzp/coq-ruby | subtac_utils.mli | open Term
open Libnames
open Coqlib
open Environ
open Pp
open Evd
open Decl_kinds
open Topconstr
open Rawterm
open Util
open Evarutil
open Names
open Sign
val ($) : ('a -> 'b) -> 'a -> 'b
val contrib_name : string
val subtac_dir : string list
val fix_sub_module : string
val fixsub_module : string list
val init_constan... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/subtac/subtac_utils.mli | ocaml | open Term
open Libnames
open Coqlib
open Environ
open Pp
open Evd
open Decl_kinds
open Topconstr
open Rawterm
open Util
open Evarutil
open Names
open Sign
val ($) : ('a -> 'b) -> 'a -> 'b
val contrib_name : string
val subtac_dir : string list
val fix_sub_module : string
val fixsub_module : string list
val init_constan... | |
447b3d38d6626a1a72a1d06f4daca845c0ae65b15df1cbfe4d689c46834664a8 | ocaml-ppx/ocamlformat | profiles2.ml | let a = aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
let b = bbbbbbbbbbbbbbbbbbvvbbb bbbvvvbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbb
| null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/3d1c992240f7d30bcb8151285274f44619dae197/test/passing/tests/profiles2.ml | ocaml | let a = aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
let b = bbbbbbbbbbbbbbbbbbvvbbb bbbvvvbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbb
| |
d01ad2835ead7fa2bac73ef9f713afff4726324e804f05b5b849e18bc5a2bda0 | overtone/overtone | sc-one.clj | (ns sc-one
(:use [overtone.live]))
page 4
play({SinOsc.ar(LFNoise0.kr(12 , mul : 600 , add : 1000 ) , 0.3 ) } )
(demo 10 (sin-osc (+ 1000 (* 600 (lf-noise0:kr 12))) 0.3))
;;;;;;;;
page 5
play({RLPF.ar(Dust.ar([12 , 15 ] ) , LFNoise1.ar(1/[3,4 ] , 1500 , 1600 ) , 0.02 ) } )
(demo 10 (rlpf (dust [12 15]) (+ 1600 (*... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/docs/sc-book/sc-one.clj | clojure |
play({
Mix.fill(sines,
{arg x;
Pan2.ar(
mul: max(0,
LFNoise1.kr(speed) +
)
), rand2(1.0))})/sines})
/////////////
(
play(
{
CombN.ar(
SinOsc.ar(
midicps(
)
),
}
)
)
/////... | (ns sc-one
(:use [overtone.live]))
page 4
play({SinOsc.ar(LFNoise0.kr(12 , mul : 600 , add : 1000 ) , 0.3 ) } )
(demo 10 (sin-osc (+ 1000 (* 600 (lf-noise0:kr 12))) 0.3))
page 5
play({RLPF.ar(Dust.ar([12 , 15 ] ) , LFNoise1.ar(1/[3,4 ] , 1500 , 1600 ) , 0.02 ) } )
(demo 10 (rlpf (dust [12 15]) (+ 1600 (* 1500 (lf... |
d9969ad73b6aff2c98d513a5f09fed88b0a54ed6da0eccc451887e03ad491065 | agda/agda | Statistics.hs | -- | Collect statistics.
module Agda.TypeChecking.Monad.Statistics
( MonadStatistics(..), tick, tickN, tickMax, getStatistics, modifyStatistics, printStatistics
) where
import Control.DeepSeq
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import Control.Monad.Writer
import ... | null | https://raw.githubusercontent.com/agda/agda/c859b5e8737a006b559723a1048bba10806bda2d/src/full/Agda/TypeChecking/Monad/Statistics.hs | haskell | | Collect statistics.
We need to be strict in the map.
Or force the map by looking up the very element we inserted?
force m = Map.lookup x m `seq` m
Or use insertLookupWithKey?
update m = old `seq` m' where
(old, m') = Map.insertLookupWithKey (\ _ new old -> f old) x dummy m
map (nor are they less hacky). It'... |
module Agda.TypeChecking.Monad.Statistics
( MonadStatistics(..), tick, tickN, tickMax, getStatistics, modifyStatistics, printStatistics
) where
import Control.DeepSeq
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import Control.Monad.Writer
import Control.Monad.Trans.Maybe... |
2f26cd2f39e4647fa01e0393003d0175c32e15d818c436045b5de1ab7f38b04e | facebook/duckling | Rules.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
# LANGUAGE NoRebindableSyntax #
module Duckling.Rules
( allRules
, rulesFor
) ... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Rules.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
| Returns the minimal set of rules required for `targets`.
| Returns all the rules for the provided locale.
| Default rules when no locale, for bac... | Copyright ( c ) 2016 - present , Facebook , Inc.
# LANGUAGE NoRebindableSyntax #
module Duckling.Rules
( allRules
, rulesFor
) where
import Data.HashSet (HashSet)
import Prelude
import qualified Data.HashSet as HashSet
import Duckling.Dimensions
import Duckling.Dimensions.Types
import Duckling.Locale
impor... |
3d45ae25033cc9c8445b1d10354a266d968b22baeda039f247c979bd08b1906f | youngnh/parsatron | project.clj | (defproject the/parsatron "0.0.9-SNAPSHOT"
:description "Clojure parser combinators"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]]
:plugins [[lein-cljsbuild "1.1.7"]]
:source-paths ["src/clj" "src/cljs"]
:test-paths ["test/clj"]
:global-vars {*war... | null | https://raw.githubusercontent.com/youngnh/parsatron/418d2d7cd93e6ac6fd72b8516118000e4d5af073/project.clj | clojure | (defproject the/parsatron "0.0.9-SNAPSHOT"
:description "Clojure parser combinators"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]]
:plugins [[lein-cljsbuild "1.1.7"]]
:source-paths ["src/clj" "src/cljs"]
:test-paths ["test/clj"]
:global-vars {*war... | |
c51c1f2d819dff360e40c25c6f8e12f43d42537a2745d6d43e8b1d3368db80ac | rescript-lang/rescript-compiler | cmij_cache.ml | type t = { module_names : string array; module_data : bytes array }
type cmi_data = Cmi_format.cmi_infos
type cmj_data = { values : Js_cmj_format.keyed_cmj_value array; pure : bool }
let marshal_cmi_data (cmi_data : cmi_data) = Marshal.to_bytes cmi_data []
let marshal_cmj_data (cmj_data : cmj_data) = Marshal.to_bytes ... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/81a3dc63ca387b2af23fed297db283254ae3ab20/jscomp/cmij/cmij_cache.ml | ocaml | type t = { module_names : string array; module_data : bytes array }
type cmi_data = Cmi_format.cmi_infos
type cmj_data = { values : Js_cmj_format.keyed_cmj_value array; pure : bool }
let marshal_cmi_data (cmi_data : cmi_data) = Marshal.to_bytes cmi_data []
let marshal_cmj_data (cmj_data : cmj_data) = Marshal.to_bytes ... | |
05616b17f56fbc74138df52b4b3826cc3ff745513fbe01ef3a0837131a77efe4 | chaoxu/fancy-walks | 56.hs |
import Data.Char
problem_56 = maximum $ map (sum.map digitToInt.show) [a^b | a <- [1..100], b <- [1..100]]
main = print problem_56
| null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/56.hs | haskell |
import Data.Char
problem_56 = maximum $ map (sum.map digitToInt.show) [a^b | a <- [1..100], b <- [1..100]]
main = print problem_56
| |
55d665cfe38c293e383a22f27c35566902024b89d4095dc6ea136900b457f88c | danidiaz/colchis | JSONRPC20.hs | # LANGUAGE ViewPatterns #
{-# LANGUAGE OverloadedStrings #-}
module Network.Colchis.Protocol.JSONRPC20 (
module Network.Colchis.Protocol
, jsonRPC20
, JSONRPC20Error (..)
, IN.ErrorObject (..)
) where
import Network.Colchis.Protocol
import qualified Network.Colchis.Protocol.JSONRPC20.Request a... | null | https://raw.githubusercontent.com/danidiaz/colchis/3cf55d337a65f09026e6c9bdbc71f54d6f16f680/src/Network/Colchis/Protocol/JSONRPC20.hs | haskell | # LANGUAGE OverloadedStrings #
| # LANGUAGE ViewPatterns #
module Network.Colchis.Protocol.JSONRPC20 (
module Network.Colchis.Protocol
, jsonRPC20
, JSONRPC20Error (..)
, IN.ErrorObject (..)
) where
import Network.Colchis.Protocol
import qualified Network.Colchis.Protocol.JSONRPC20.Request as OUT
import qualified Network.Colc... |
8e6a9f11858e3cfd5ba9accbcf9582b8a7f804ad7776c21d1f3df251205dd053 | PLTools/GT | discover.ml | module Cfg = Configurator.V1
(*** utility functions ***)
(* pretty dumb file reading *)
let read_file fn =
let ichan = open_in fn in
let rec helper lines =
try
let line = input_line ichan in
helper (line :: lines)
with End_of_file -> lines
in
let lines = List.rev @@ helper [] in
String.c... | null | https://raw.githubusercontent.com/PLTools/GT/62d1a424a3336f2317ba67e447a9ff09d179b583/config/discover.ml | ocaml | ** utility functions **
pretty dumb file reading
scans `regression` folder looking for `test*.ml` files
`dune` doesn't give us direct access to `source` folder, only to the `build` folder,
* thus we have to exclude files generated by the preprocessor
`tester.ml` also should be excluded
** discovering ... | module Cfg = Configurator.V1
let read_file fn =
let ichan = open_in fn in
let rec helper lines =
try
let line = input_line ichan in
helper (line :: lines)
with End_of_file -> lines
in
let lines = List.rev @@ helper [] in
String.concat "\n" lines
let extract_words = Cfg.Flags.extract_com... |
7cd0c49ed1e67a0fcfce49cf581383e73bad649b402f30c7200012cf023b1cbb | richcarl/erlguten | eg_xml2richText.erl | %%==========================================================================
Copyright ( C ) 2003
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
... | null | https://raw.githubusercontent.com/richcarl/erlguten/debd6120907e5e18b4bca5fbd5bdd9cb653f282d/src/eg_xml2richText.erl | erlang | ==========================================================================
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
following conditions:
The above cop... | Copyright ( C ) 2003
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to permit
persons to whom the Software is furnished to do so , subject to the
in all copies or substantial portions of the Software .
THE SOFTWAR... |
5d4316ba4a4536b7591827cf07cd58d4bc489fb01a4aef1c2ae9c14fa81adbed | leifp/clj-isa-protocol | multimethods.clj | (ns dispatch.multimethods
(:refer-clojure :exclude [remove-all-methods remove-method prefer-method
methods get-method prefers defmulti defmethod])
(:use [dispatch.is-a-protocol :only [is-a? global-is-a-hierarchy]]))
mostly stolen from clojurescript
;;NB: hierarchy must be IRef
in t... | null | https://raw.githubusercontent.com/leifp/clj-isa-protocol/98900fee78672e9d5c267f7c51fd59d4f57d3aab/src/dispatch/multimethods.clj | clojure | NB: hierarchy must be IRef
in cljs , they use Atom
IHash
(-hash [this] (hash this))
TODO: do we need all these? can it just be
(invoke [this & args] (-dispatch this args))
TODO: need to throw useful exceptions when dispatch fails | (ns dispatch.multimethods
(:refer-clojure :exclude [remove-all-methods remove-method prefer-method
methods get-method prefers defmulti defmethod])
(:use [dispatch.is-a-protocol :only [is-a? global-is-a-hierarchy]]))
mostly stolen from clojurescript
(defn- reset-cache
[method-cache ... |
ea166af25aadb281cac137a4f23b95280997a27c90767f647e045263bde55e42 | ds-wizard/engine-backend | Api.hs | module Wizard.Api.Handler.DocumentTemplateDraft.Api where
import Servant
import Servant.Swagger.Tags
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_DELETE
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_GET
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_Setti... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/DocumentTemplateDraft/Api.hs | haskell | module Wizard.Api.Handler.DocumentTemplateDraft.Api where
import Servant
import Servant.Swagger.Tags
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_DELETE
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_GET
import Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_Setti... | |
5a1ec3313cf8dee4afa71181152fded567f4b0a66fef61195a03283f752877fd | jeffshrager/biobike | meta1.lisp | Copyright ( c ) 2002 - 2003 by and ; All rights reserved .
;;; This software is made avilable for EDUCATIONAL PURPOSES
;;; ONLY, and WITHOUT ANY WARRANTY, express or implied, of
;;; its merchantability or fitness for a particular purpose.
(in-package USER)
(defstruct reaction
reactants ; Lefthand side
... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/OriginalCode/meta1.lisp | lisp | All rights reserved .
This software is made avilable for EDUCATIONAL PURPOSES
ONLY, and WITHOUT ANY WARRANTY, express or implied, of
its merchantability or fitness for a particular purpose.
Lefthand side
The abbreviation we'll use for convenience.
The pretty-printing name.
Reactions:
When the current path is ... |
(in-package USER)
(defstruct reaction
catalyst
Righthand side
)
(defstruct molecule
S , NS , or INS
)
(defvar *molecules* nil)
(defvar *reactions* nil)
(defmacro add-molecule (abbrev fullname type &rest constituents)
`(push (make-molecule :abbrev ',abbrev
:fullname ,fullname
:type ',typ... |
f55b0e262ddb76f0f9ff1abf5e48104f8feec6da063b06deaa13ab28f82b608c | fimad/prometheus-haskell | HistogramSpec.hs | {-# language OverloadedStrings #-}
module Prometheus.Metric.HistogramSpec (
spec
) where
import Prometheus.Metric.Histogram
import Prometheus.Metric.Observer
import Prometheus.Registry
import Prometheus.Info
import qualified Data.Map.Strict as Map
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = des... | null | https://raw.githubusercontent.com/fimad/prometheus-haskell/4e2c2f1da1f891e9de3ce5a5260ae92882a9f35e/prometheus-client/tests/Prometheus/Metric/HistogramSpec.hs | haskell | # language OverloadedStrings #
------------------------------------------------------------------------------
QuickCheck tests |
module Prometheus.Metric.HistogramSpec (
spec
) where
import Prometheus.Metric.Histogram
import Prometheus.Metric.Observer
import Prometheus.Registry
import Prometheus.Info
import qualified Data.Map.Strict as Map
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = describe "Prometheus.Metric.Histogram"... |
3d084d783e92f6002ebe5640880e992ab68412907d5bbc427a67f5a348115c03 | potapenko/playphraseme-site | favorites.clj | (ns playphraseme.api.routes.favorites
(:require [playphraseme.api.middleware.cors :refer [cors-mw]]
[playphraseme.api.middleware.token-auth :refer [token-auth-mw]]
[playphraseme.api.middleware.authenticated :refer [authenticated-mw]]
[playphraseme.api.route-functions.search.phrases... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/api/routes/favorites.clj | clojure | (ns playphraseme.api.routes.favorites
(:require [playphraseme.api.middleware.cors :refer [cors-mw]]
[playphraseme.api.middleware.token-auth :refer [token-auth-mw]]
[playphraseme.api.middleware.authenticated :refer [authenticated-mw]]
[playphraseme.api.route-functions.search.phrases... | |
e104670e6ca5a2cb401118a13a65ffa4d6da615df6a816bb56aa4180dd2f9d66 | diskuv/dkml-c-probe | show_conf_signature.ml | #use "topfind";;
#require "dkml-c-probe";;
#show Dkml_c_probe.C_conf;;
| null | https://raw.githubusercontent.com/diskuv/dkml-c-probe/c852632a1c091ed212c8af13b4544294cfe03e4b/samples/show_conf_signature.ml | ocaml | #use "topfind";;
#require "dkml-c-probe";;
#show Dkml_c_probe.C_conf;;
| |
279319784e5b0f8f3ef96443d3f5d1f18457129a99d2cb008ed2a40cc7057502 | ckruse/irckerl | irc_parser_test.erl | Copyright ( C ) 2011 by < >
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%% to use, copy, modify, merge, publish, dist... | null | https://raw.githubusercontent.com/ckruse/irckerl/2fd47c79a74b580d2d1448d15c5e9e2271e58daa/test/irc_parser_test.erl | erlang | Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice an... | Copyright ( C ) 2011 by < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRES... |
728a4088a99203f941661afec74651f31db30fde1d11b4ee403b6f583ac1454d | msgpack/msgpack-haskell | Put.hs | # LANGUAGE LambdaCase #
--------------------------------------------------------------------
-- |
-- Module : Data.MessagePack.Put
Copyright : © Hideyuki Tanaka 2009 - 2015
, 2019
-- License : BSD3
--
-- MessagePack Serializer using "Data.Binary".
--
---------------------------------------------... | null | https://raw.githubusercontent.com/msgpack/msgpack-haskell/f52a5d2db620a7be70810eca648fd152141f8b14/msgpack/src/Data/MessagePack/Put.hs | haskell | ------------------------------------------------------------------
|
Module : Data.MessagePack.Put
License : BSD3
MessagePack Serializer using "Data.Binary".
------------------------------------------------------------------
See also 'MPInteger' and its 'Binary' instance.
| @since 1.1.0.0
^ number of arr... | # LANGUAGE LambdaCase #
Copyright : © Hideyuki Tanaka 2009 - 2015
, 2019
module Data.MessagePack.Put (
putNil, putBool, putFloat, putDouble,
putInt, putWord, putInt64, putWord64,
putStr, putBin, putArray, putArray', putMap, putExt, putExt'
) where
import Compat.Prelude
import ... |
045444516058552118e02c195b6d10ef0551b80dabafe61b4f04cd6fd3b7c593 | khibino/haskell-relational-record | Persistable.hs | module Database.HDBC.PostgreSQL.Persistable
# DEPRECATED " import Database . Record . HDBC.PostgreSQL " #
() where
import Database.Relational.HDBC.PostgreSQL ()
| null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/persistable-types-HDBC-pg/src/Database/HDBC/PostgreSQL/Persistable.hs | haskell | module Database.HDBC.PostgreSQL.Persistable
# DEPRECATED " import Database . Record . HDBC.PostgreSQL " #
() where
import Database.Relational.HDBC.PostgreSQL ()
| |
fd34b73a9aa95acdbe1e03e5748c2d6a53a5b342b35d00a6cf92867e18cade41 | fakedata-haskell/fakedata | BoJackHorseman.hs | {-# LANGUAGE OverloadedStrings #-}
module Faker.TvShow.BoJackHorseman where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.BoJackHorseman
character :: Fake Text
character =
Fake $
cachedRandomVec "boJackHorseman" "character" boJackHorsemanCharacterProvider
quote :: Fake Text
quote =
... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/TvShow/BoJackHorseman.hs | haskell | # LANGUAGE OverloadedStrings # |
module Faker.TvShow.BoJackHorseman where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.BoJackHorseman
character :: Fake Text
character =
Fake $
cachedRandomVec "boJackHorseman" "character" boJackHorsemanCharacterProvider
quote :: Fake Text
quote =
Fake $ cachedRandomVec "boJackHors... |
2e46810ea995db7fe009b79a7341712f4ab8e0e206539ef136bc1b59e6ff5d79 | prl-julia/juliette-wa | redex.rkt | #lang racket
(require redex)
; import surface language
(require "../../../src/redex/core/wa-surface.rkt")
; import full language
(require "../../../src/redex/core/wa-full.rkt")
; import optimizations
(require "../../../src/redex/optimizations/wa-optimized.rkt")
(displayln "Test for litmus-wa/test06:")
(define p
... | null | https://raw.githubusercontent.com/prl-julia/juliette-wa/1d1a2154e7b4e232ea2166fba485a3bf574ebd88/tests/litmus-wa/test06/redex.rkt | racket | import surface language
import full language
import optimizations | #lang racket
(require redex)
(require "../../../src/redex/core/wa-surface.rkt")
(require "../../../src/redex/core/wa-full.rkt")
(require "../../../src/redex/optimizations/wa-optimized.rkt")
(displayln "Test for litmus-wa/test06:")
(define p
(term
(evalg
(seq
(mdef "l" () (evalg (seq (evalg (mdef "f1" ()... |
67aef24d8ecfd4c11c327c56d084cf5d93aa740f9af15eb6ae437d135c0fb56c | xclerc/ocamljava | javalink_parameters.mli |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/compiler/javacomp/javalink_parameters.mli | ocaml | * Check and compile a runtime parameter list.
* Compile the passed runtime parameter list, raising an exception if
any parameter is invalid. |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... |
e30157d4ae1042d38d33d3e49b1cbc1bc12b408f8f6e226d11bec0f951f63cbc | mbg/hindley-milner | TypeSpec.hs | --------------------------------------------------------------------------------
module Language.HM.TypeSpec where
--------------------------------------------------------------------------------
import Test.Hspec
import qualified Data.Set as S
import Language.HM
--------------------------------------------------... | null | https://raw.githubusercontent.com/mbg/hindley-milner/015679609409df8c6c2632a99e16aa271f37ed5d/test/Language/HM/TypeSpec.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------ |
module Language.HM.TypeSpec where
import Test.Hspec
import qualified Data.Set as S
import Language.HM
t0 :: Sigma
t0 = forAllT "a" (monoT $ (varT "a") `arrowT` (varT "a"))
t1 :: Sigma
t1 = forAllT "b" (monoT $ (varT "b") `arrowT` (varT "b"))
t2 :: Sigma
t2 = forAllT "b" (monoT $ (varT "b") `arrowT` (varT "a")... |
0e20b20a0ab22a007566c3b83e7d5813f6596303c968df3c5cca860f9ded3dae | yuriy-chumak/ol | opengl.scm | (runtime-error "Example deprecated!" '())
(define SHADER_NUM 1)
/ - The Scheme Programming Language ( Fourth Edition )
; -faq-standards#implementations
;!
(define *USE_GLBEGIN* 1)
(import (owl ffi))
(import (lib windows))
(import (OpenGL version-2-1))
; вспомогательный макрос для собрать в кучку все bor
(define O... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/83dd03d311339763682eab02cbe0c1321daa25bc/tests/disabled/opengl.scm | scheme | -faq-standards#implementations
!
вспомогательный макрос для собрать в кучку все bor
x y width height
no parent window
no menu
instance
PIXELFORMATDESCRIPTOR
real code
typedef float GLfloat (same as type-rational)
typedef unsigned char GLubyte;
todo: вроде бы все строки и так заканчиваются на '\0' - провер... | (runtime-error "Example deprecated!" '())
(define SHADER_NUM 1)
/ - The Scheme Programming Language ( Fourth Edition )
(define *USE_GLBEGIN* 1)
(import (owl ffi))
(import (lib windows))
(import (OpenGL version-2-1))
(define OR (lambda list (fold bor 0 list)))
(define width 1280)
(define height 720)
(define windo... |
a3b2188a3e912ad8b9300418beabb8d95d276ba2c58c378c0cea7c71b1dc2c21 | ocaml-multicore/eventlog-tools | test_parser.ml | module E = Eventlog
module R = Rresult.R
open R.Infix
let load_file path =
let open Rresult.R.Infix in
Fpath.of_string path
>>= Bos.OS.File.read
>>= fun content ->
Ok (Bigstringaf.of_string ~off:0 ~len:(String.length content) content)
let parse path expected =
load_file path >>= fun file ->
let decoder ... | null | https://raw.githubusercontent.com/ocaml-multicore/eventlog-tools/9ed1e4f50ad935c43d6d5a44efc7ed43e381233b/test/test_parser.ml | ocaml | module E = Eventlog
module R = Rresult.R
open R.Infix
let load_file path =
let open Rresult.R.Infix in
Fpath.of_string path
>>= Bos.OS.File.read
>>= fun content ->
Ok (Bigstringaf.of_string ~off:0 ~len:(String.length content) content)
let parse path expected =
load_file path >>= fun file ->
let decoder ... | |
b06b0dd8949dfe1fe3db287602e952b0047c6b08ed2c246c2f99ed22373c3844 | con-kitty/categorifier-c | F.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
| This is similar to the @recursive - types@ example , except that the @Tree@ type
-- is monomorphic. This makes it... | null | https://raw.githubusercontent.com/con-kitty/categorifier-c/dd5ba3ac4d39629b99200bdffa0af54d124233f0/examples/recursive-types-2/F.hs | haskell | is monomorphic. This makes it slightly more complicated, because in the other
@
type instance TargetOb (Tree a) = Tree (TargetOb a)
@
@TargetOb Tree@.
Note that the following won't work:
@
Wo n't work because does not have CGeneric instance
-- Won't work because this doesn't terminate (Tree is... | # LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
| This is similar to the @recursive - types@ example , except that the @Tree@ type
example , we could define the ... |
fee62bf30335703c318dbebcd52e24ca32cef05466e7a4fe1208f4bc1827227c | opencog/learn | class-merge-basic.scm | ;
; class-merge-basic.scm
Unit test for merging of Connectors - merge two classes .
;
Tests merging of two word classes , one into the other . This is
; a basic test of the simplest case.
;
Created October 2021
(use-modules (opencog) (opencog matrix))
(use-modules (opencog nlp))
(use-modules (opencog learn))
(u... | null | https://raw.githubusercontent.com/opencog/learn/e00a803620491a7df4fc0d6b3dda2879a9dcb8cb/tests/merge/class-merge-basic.scm | scheme |
class-merge-basic.scm
a basic test of the simplest case.
---------------------------------------------------------------
This diagram explains what is being tested here:
and so on.
where [] denotes the CrossSection, and <> denotes the Shape. The "v"
is the variable node in the Shape (that the germ of the ... | Unit test for merging of Connectors - merge two classes .
Tests merging of two word classes , one into the other . This is
Created October 2021
(use-modules (opencog) (opencog matrix))
(use-modules (opencog nlp))
(use-modules (opencog learn))
(use-modules (opencog test-runner))
(use-modules (srfi srfi-64))
(op... |
8996c931d73d8c09312c873fe5af566e8e5612e12f9690c173c6ee7ff17b59f4 | haskell-opengl/OpenGLRaw | GPUShader4.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.EXT.GPUShader4
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
---------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/EXT/GPUShader4.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.EXT.GPUShader4
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* Functions | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.EXT.GPUShader4 (
glGetEXTGPUShader4,
gl_EXT_gpu_shader4,
pattern GL_INT_SAMPLER_1D_ARRAY_EXT,
pattern GL_INT_SAMPLER_1D_EXT,
pattern GL_INT_SAMPLER_2D_ARRAY_EXT,
pattern GL_INT_SAMPLER_2D_EXT,
patter... |
5e7ab06da5f4ed5ad7a9aa81014df560770782ddfb1fa687805d41370626a7a1 | originrose/think.image | histogram.clj | (ns think.image.histogram
(:require [think.image.pixel :refer :all]
[think.image.quantize :as quantize]
[mikera.image.core :as image]
[clojure.core.matrix :as mat])
(:import [java.awt.image BufferedImage]))
(defn sparse-histogram-from-pixels
"Create a sparse histogram map of ... | null | https://raw.githubusercontent.com/originrose/think.image/0179d104d5fa74977890942858b44e1349457514/src/clj/think/image/histogram.clj | clojure | (ns think.image.histogram
(:require [think.image.pixel :refer :all]
[think.image.quantize :as quantize]
[mikera.image.core :as image]
[clojure.core.matrix :as mat])
(:import [java.awt.image BufferedImage]))
(defn sparse-histogram-from-pixels
"Create a sparse histogram map of ... | |
3113eb5461b973a16c548e2b6e01630c06897a9a07809d825f4b360647cdf3a1 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | SourceMandateNotificationBacsDebitData.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
| Contains the types generated from the schema SourceMandateNotificationBacsDebitData
module StripeAPI.Types.SourceMandateN... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/SourceMandateNotificationBacsDebitData.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Defines the object schema located at @components.schemas.source_mandate_notification_bacs_debit_data@ in the specification.
| last4: Last 4 digits of the account number associated with the debit.
Constraints:
| Create a new 'SourceMandateNotificationBacsDeb... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
| Contains the types generated from the schema SourceMandateNotificationBacsDebitData
module StripeAPI.Types.SourceMandateNotificationBacsDebitData where
import qualified Control.Monad.... |
c89b5f9dd3eaa63bdf803ac292af2e130146f7e44a9e0f8bbb8bcea419ea8afc | oscoin/oscoin | Arbitrary.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE UndecidableInstances #
module Oscoin.Test.Crypto.Blockchain.Block.Arbitrary where
import Oscoin.Prelude
import Oscoin.Crypto.Blockchain
import Oscoin.Test.Crypto
import Oscoin.Test.Crypto.Blockchain.Block.Generators
import ... | null | https://raw.githubusercontent.com/oscoin/oscoin/2eb5652c9999dd0f30c70b3ba6b638156c74cdb1/test/Oscoin/Test/Crypto/Blockchain/Block/Arbitrary.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE UndecidableInstances #
module Oscoin.Test.Crypto.Blockchain.Block.Arbitrary where
import Oscoin.Prelude
import Oscoin.Crypto.Blockchain
import Oscoin.Test.Crypto
import Oscoin.Test.Crypto.Blockchain.Block.Generators
import ... | |
1d86626f6c1151aafbe7c7ab9d934f950dc6990055fb3acdf3fcc91ffa7541c6 | Glue42/gateway-modules | restrictions.cljc | (ns gateway.restrictions
(:require [gateway.reason :refer [throw-reason]]
[instaparse.transform :as ipt]
[instaparse.core :as ip]
#?(:cljs [cljs.reader :as reader])))
(def restrictions-parser
(ip/parser "
expr=and-or
<and-or>=<ws*> (eq-neq | and | or)
<eq-neq>=<ws*> (term ... | null | https://raw.githubusercontent.com/Glue42/gateway-modules/957c4e91548c9f47b7145a1ee0dad45b56063ed3/common/src/gateway/restrictions.cljc | clojure | (ns gateway.restrictions
(:require [gateway.reason :refer [throw-reason]]
[instaparse.transform :as ipt]
[instaparse.core :as ip]
#?(:cljs [cljs.reader :as reader])))
(def restrictions-parser
(ip/parser "
expr=and-or
<and-or>=<ws*> (eq-neq | and | or)
<eq-neq>=<ws*> (term ... | |
0ede19078eb3f933fd3d40d069624d4c78aaf0ea1719ed450f93de1baf5fd22c | vonli/Ext2-for-movitz | basic-macros.lisp | ;;;;------------------------------------------------------------------
;;;;
Copyright ( C ) 2000 - 2005 ,
Department of Computer Science , University of Tromso , Norway
;;;;
;;;; Filename: basic-macros.lisp
;;;; Description:
Author : < >
;;;; Created at: Wed Nov 8 18:44:57 2000
;;;... | null | https://raw.githubusercontent.com/vonli/Ext2-for-movitz/81b6f8e165de3e1ea9cc7d2035b9259af83a6d26/losp/muerte/basic-macros.lisp | lisp | ------------------------------------------------------------------
Filename: basic-macros.lisp
Description:
Created at: Wed Nov 8 18:44:57 2000
Distribution: See the accompanying file COPYING.
------------------------------------------------------------------
(war... | Copyright ( C ) 2000 - 2005 ,
Department of Computer Science , University of Tromso , Norway
Author : < >
$ I d : basic - macros.lisp , v 1.70 2007/03/26 21:11:40 Exp $
(provide :muerte/basic-macros)
First of all we must define DEFMACRO ..
(muerte::defmacro-compile-time muerte.cl:defmacro... |
68113b982a4c74dd1638cb983cb01318dd02a586c26ae9d1dccfd8c266a6819b | xach/zpng | rgb.lisp | (defpackage #:rgb
(:use #:cl #:zpng))
(in-package #:rgb)
(defun draw-rgb (file)
(let ((png (make-instance 'pixel-streamed-png
:color-type :truecolor-alpha
:width 200
:height 200)))
(with-open-file (stream file
:direc... | null | https://raw.githubusercontent.com/xach/zpng/c808a48eb9ece6f04eb25a11a2eedb738fd4f0e2/doc/rgb.lisp | lisp | (defpackage #:rgb
(:use #:cl #:zpng))
(in-package #:rgb)
(defun draw-rgb (file)
(let ((png (make-instance 'pixel-streamed-png
:color-type :truecolor-alpha
:width 200
:height 200)))
(with-open-file (stream file
:direc... | |
2ea465bccc84bf6e1b2fde06ae06224fe99aa9665e14f79d03a1a5e04b7f45f6 | composewell/streamly | Prelude.hs | -- |
Module : Streamly . Data . Stream . Prelude
Copyright : ( c ) 2022 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
--
This module re - exports the " Streamly . Data . Stream " module from the
-- "streamly-core" package and ad... | null | https://raw.githubusercontent.com/composewell/streamly/769538d8d1dac434fe95dc3d4883c9d05f8ecdef/src/Streamly/Data/Stream/Prelude.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
"streamly-core" package and additionally provides concurrency, time and
lifted exception operations as well in a single module.
Also see the following modules for more pre-release operations:
| Module : Streamly . Data . Stream . Prelude
Copyright : ( c ) 2022 Composewell Technologies
Portability : GHC
This module re - exports the " Streamly . Data . Stream " module from the
* " Streamly . Internal . Data . Stream . Concurrent "
* " Streamly . Internal . Data . Stream . Time "
* " Strea... |
5628e837ce9ef62f5c457425bee442aa3078169c9e6716b31b3639f8d46ba856 | Jell/euroclojure-2016 | enfocus_demo.cljs | (ns euroclojure.enfocus-demo
(:require-macros [euroclojure.utils :refer [code-snippet]])
(:require [reagent.core :as reagent]
[enfocus.core :as ef]
[euroclojure.enfocus-template :refer [mount]]))
(defn slide [opts]
(reagent/create-class
{:component-did-mount
(fn [component]
(... | null | https://raw.githubusercontent.com/Jell/euroclojure-2016/a8ca883e8480a4616ede19995aaacd4a495608af/src/euroclojure/enfocus_demo.cljs | clojure | (ns euroclojure.enfocus-demo
(:require-macros [euroclojure.utils :refer [code-snippet]])
(:require [reagent.core :as reagent]
[enfocus.core :as ef]
[euroclojure.enfocus-template :refer [mount]]))
(defn slide [opts]
(reagent/create-class
{:component-did-mount
(fn [component]
(... | |
d048e1a3a32094fac7cac81ee2a37ef5bcfca9737c4fe3c15140c2e1bf6a16ae | cnuernber/dtype-next | global_to_local_test.clj | (ns tech.v3.tensor.dimensions.global-to-local-test
(:require [tech.v3.tensor.dimensions :as dims]
[tech.v3.tensor.dimensions.global-to-local :as gtol]
[tech.v3.tensor.dimensions.gtol-insn :as gtol-insn]
[tech.v3.tensor.dimensions.analytics :as dims-analytics]
[tech.v3.d... | null | https://raw.githubusercontent.com/cnuernber/dtype-next/8fb3166a44a2ce21a673c864ae4d0351b6813d46/test/tech/v3/tensor/dimensions/global_to_local_test.clj | clojure | TODO - check broadcasting on leading dimension | (ns tech.v3.tensor.dimensions.global-to-local-test
(:require [tech.v3.tensor.dimensions :as dims]
[tech.v3.tensor.dimensions.global-to-local :as gtol]
[tech.v3.tensor.dimensions.gtol-insn :as gtol-insn]
[tech.v3.tensor.dimensions.analytics :as dims-analytics]
[tech.v3.d... |
59ae7664c56c858387305f2fc7b1379cd1687dd4fd17cf4a5dfe54c2d30b36a3 | white-silence88/cse | json-file.lisp | ;; json-file
(in-package #:cse)
;; tree/build-key
;;
;;
;; Description:
;; procedure for get value for key for tree pair
;; Params:
;; key [String] name of tree node
;; type [String] type of tree
;; reserved [List<String>] list of reserved words
;; Returns
;; name of treee node
(defun tree<-get-key (... | null | https://raw.githubusercontent.com/white-silence88/cse/9d938129a86f701fbe618a545b45c8f16f27b879/src/common/json-file.lisp | lisp | json-file
tree/build-key
Description:
procedure for get value for key for tree pair
Params:
key [String] name of tree node
type [String] type of tree
reserved [List<String>] list of reserved words
Returns
name of treee node
tree/value
Description:
procedure for get value for curren... | (in-package #:cse)
(defun tree<-get-key (key type reserved)
(cond
((member key reserved :test (lambda (k v) (string= k v))) key)
(t (if (string= type "routes")
(concatenate 'string "/" key)
key))))
If type of value is HashTable - run hash->>tree procedure with new current arguments
... |
e38f55356885ae810040a91e6e1b3096d3fb9aab31a6c6a0951b2890d2e5d25d | haskell-repa/repa | Simple.hs |
module Data.Repa.Flow.Simple
( module Data.Repa.Flow.States
, Source
, Sink
-- * Evaluation
, drainS
-- * Conversions
, fromList
, toList
, takeList
-- * Finalizers
, finalize_i
, finalize_o
-- * Flow Op... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-flow/Data/Repa/Flow/Simple.hs | haskell | * Evaluation
* Conversions
* Finalizers
* Flow Operators
** Constructors
** Mapping
** Connecting
** Splitting
** Grouping
** Packing
** Folding
** Watching
** Ignorance
* Flow IO
** Sourcing
** Sinking
| Pull all available values from the source and push them to the sink. |
module Data.Repa.Flow.Simple
( module Data.Repa.Flow.States
, Source
, Sink
, drainS
, fromList
, toList
, takeList
, finalize_i
, finalize_o
, repeat_i
, replicate_i
, prepend_i
, map_i, map_o
... |
9b120f87a72169e8e5b35d3a7fcdec11cec75ba64d95afc3cec6c275a3450984 | typedclojure/typedclojure | infer_vars.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/3f30bcedfdca0d4e9a8af3fc95985372d129cd4c/typed/clj.checker/src/typed/clj/checker/experimental/infer_vars.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns typed.clj.checker.experimental.infer-vars
(:require
[clojure.core.typed.util-vars :as vs]
[typed.cljc.checker.type-rep :as r]
[typed.cljc.checker.type-ctors :as c]
[typed.clj.checker.parse-unparse :as prs]
[clojure.core.typed.current-impl :as impl]... |
322e53110851dfe171d9f49cd0c761c9443b88ac9402081648a852ea20035bf2 | ekmett/distributive | Trustworthy.hs | # LANGUAGE Unsafe #
-- |
Copyright : ( c ) 2021
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable
--
Safe Haskell has a pretty egregious design flaw .
--
-- If you use @-Winferred-safe-imports@, which is really
-- your only way t... | null | https://raw.githubusercontent.com/ekmett/distributive/a606a9efd2f3e0458fb5808c70445333fdaae34b/src/Trustworthy.hs | haskell | |
Stability : experimental
Portability : non-portable
If you use @-Winferred-safe-imports@, which is really
your only way to get visibility into upstream safety,
there is generally no way to escape the warnings it
gives except to expect upstream packages to fix their code.
The "fix" is to import a module ... | # LANGUAGE Unsafe #
Copyright : ( c ) 2021
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
Safe Haskell has a pretty egregious design flaw .
I can forcibly downgrade myself to @Trustworthy@.
module Trustworthy () where
|
b4a313e72908886f93981e46f2ab6289a65f93e27069e74d9679b023668fc45e | jackfirth/resyntax | match-shortcuts-test.rkt | #lang resyntax/testing/refactoring-test
require: resyntax/default-recommendations match-shortcuts
header:
------------------------------
#lang racket/base
(require racket/match)
------------------------------
test: "single-clause match expressions can be replaced with match-define expressions"
-------------------... | null | https://raw.githubusercontent.com/jackfirth/resyntax/15b5cdea07ca616b60431fdfc414faae4848f8d9/default-recommendations/match-shortcuts-test.rkt | racket | #lang resyntax/testing/refactoring-test
require: resyntax/default-recommendations match-shortcuts
header:
------------------------------
#lang racket/base
(require racket/match)
------------------------------
test: "single-clause match expressions can be replaced with match-define expressions"
-------------------... | |
d630b3e3d59b99a91b126d23747d507718176a2d5ffd994af5141e7303566fd7 | ds-wizard/engine-backend | Detail_Password_PUT.hs | module Wizard.Api.Handler.User.Detail_Password_PUT where
import Data.Maybe (fromMaybe)
import qualified Data.UUID as U
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.User.UserPasswordDTO
import Wizard.Api.Resourc... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/User/Detail_Password_PUT.hs | haskell | module Wizard.Api.Handler.User.Detail_Password_PUT where
import Data.Maybe (fromMaybe)
import qualified Data.UUID as U
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.User.UserPasswordDTO
import Wizard.Api.Resourc... | |
c9c4acc17ea63b56dff2248f98e0655776f45448a80465d6f0f1021d1e59033a | dpom/clj-duckling | money.clj | (ns clj-duckling.dims.money
(:require
[clj-duckling.util.engine :refer [export-value]]))
(defmethod export-value :amount-of-money [{:keys [value unit] :as token} _]
{:type "value" :value value :unit unit})
(defmethod export-value :budget [{:keys [value unit level] :as token} _]
{:type "value" :value value :u... | null | https://raw.githubusercontent.com/dpom/clj-duckling/8728f9a99b4b002e9ce2ea62b3a82a61b0cdac06/src/clj_duckling/dims/money.clj | clojure | (ns clj-duckling.dims.money
(:require
[clj-duckling.util.engine :refer [export-value]]))
(defmethod export-value :amount-of-money [{:keys [value unit] :as token} _]
{:type "value" :value value :unit unit})
(defmethod export-value :budget [{:keys [value unit level] :as token} _]
{:type "value" :value value :u... | |
84497c432975fca79eca57aa6b25b5547dddeb766cac14b9eb01a2a7cdba5584 | haskell-tools/haskell-tools | Representation.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
-- | Representation of the modules and packages in the daemon session.
module Language.Haskell.Tools.Daemon.Representation where
import Control.Reference
import Data.Function (on)
import Data.Map.Strict as Map
import Data.Maybe
i... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/daemon/Language/Haskell/Tools/Daemon/Representation.hs | haskell | | Representation of the modules and packages in the daemon session.
| The state of a module.
| An alias for module names
| This data structure identifies a module collection. | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Language.Haskell.Tools.Daemon.Representation where
import Control.Reference
import Data.Function (on)
import Data.Map.Strict as Map
import Data.Maybe
import DynFlags
import GHC
import Language.Haskell.Tools.Refactor
| ... |
503504c89bfe3b53fd13a5cd448dcbf46fdd213c32fa3c0eff8de9d18fa4c3df | oker1/websocket-chat | websocket_handler.erl | -module(websocket_handler).
-behaviour(cowboy_websocket_handler).
-export([init/3, websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init({tcp, http}, _Req, _Opts) ->
{upgrade, protocol, cowboy_websocket}.
websocket_init(_Any, Req, _Opts) ->
cset_server:register(self()),
Req2 ... | null | https://raw.githubusercontent.com/oker1/websocket-chat/8dfbd7357b2e37615d1d055f8cbb70777e5d82c8/src/websocket_handler.erl | erlang | -module(websocket_handler).
-behaviour(cowboy_websocket_handler).
-export([init/3, websocket_init/3, websocket_handle/3,
websocket_info/3, websocket_terminate/3]).
init({tcp, http}, _Req, _Opts) ->
{upgrade, protocol, cowboy_websocket}.
websocket_init(_Any, Req, _Opts) ->
cset_server:register(self()),
Req2 ... | |
2b2ae435751ad4cb153817c5469f41d88deedd234930ac658b11cd2f59ca937d | robrix/Manifold | Checking.hs | # LANGUAGE DeriveFunctor , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , PolyKinds , TypeApplications , TypeOperators , UndecidableInstances #
module Manifold.Proof.Checking where
import Control.Effect
import Data.Foldable (foldl')
import Data.Semiring (Semiring(..), Unital(..), zero)
import Data.Semi... | null | https://raw.githubusercontent.com/robrix/Manifold/3cc7a49c90b9cc7d1da61c532d0ee526ccdd3474/src/Manifold/Proof/Checking.hs | haskell | # LANGUAGE DeriveFunctor , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , PolyKinds , TypeApplications , TypeOperators , UndecidableInstances #
module Manifold.Proof.Checking where
import Control.Effect
import Data.Foldable (foldl')
import Data.Semiring (Semiring(..), Unital(..), zero)
import Data.Semi... | |
016a088dab5542fff6bade5a3be5770ac689c3787a34291c5cd28b86fc84c7dd | Ptival/language-ocaml | Test.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.AttrId.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.SingleAttrId.Test as SingleAttrId
limit :: Int
limit = 10
testStrings :: [String]
testStrings =
[]
++ SingleAttr... | null | https://raw.githubusercontent.com/Ptival/language-ocaml/7b07fd3cc466bb2ad2cac4bfe3099505cb63a4f4/test/Language/OCaml/Parser/AttrId/Test.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.AttrId.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.SingleAttrId.Test as SingleAttrId
limit :: Int
limit = 10
testStrings :: [String]
testStrings =
[]
++ SingleAttrId.testStrings
++ [ [i| #{sai}.... |
5fc37cef6c36c5d421f49b6b5e5f3e430bf233e452ca2b8d6fb82343873bc556 | bsansouci/bsb-native | test_nomli.ml | type t = A | B
[@@mli]
and s = C | D
[@@mli abstract]
module X = struct
type t = X | Y
[@@mli]
and s
let id x = x
[@@mli]
end
module Y : sig type t type s end = struct
type t = X | Y
type s = A | B
end
let f x y = x + y
[@@mli]
and g a b = (a, b)
[@@mli]
and h a b = (a, b)
[@@mli (... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/vendor/ocaml/experimental/frisch/test_nomli.ml | ocaml | type t = A | B
[@@mli]
and s = C | D
[@@mli abstract]
module X = struct
type t = X | Y
[@@mli]
and s
let id x = x
[@@mli]
end
module Y : sig type t type s end = struct
type t = X | Y
type s = A | B
end
let f x y = x + y
[@@mli]
and g a b = (a, b)
[@@mli]
and h a b = (a, b)
[@@mli (... | |
dd923ff7922a6dae48ef5d4882ec4f48bc170b269859b96b1ee11d7e8e608c16 | rubenbarroso/EOPL | 1_16.scm | 1
(define up
(lambda (lst)
(cond ((null? lst)
'())
((pair? (car lst))
(append (car lst) (up (cdr lst))))
(else (cons (car lst) (up (cdr lst)))))))
> ( up ' ( ( 1 2 ) ( 3 4 ) ) )
( 1 2 3 4 )
;> (up '((x (y)) z))
;(x (y) z)
Let 's check that ( down ( up lst ) ) is not lst... | null | https://raw.githubusercontent.com/rubenbarroso/EOPL/f9b3c03c2fcbaddf64694ee3243d54be95bfe31d/src/chapter1/1_16.scm | scheme | > (up '((x (y)) z))
(x (y) z)
> (down (up '((x (y)) z)))
((x) ((y)) (z))
This is because we lose information when up-ing, since the non-list
elements are left as-is, and then down does not know if they were
lists or not.
This is a *-function (see Little Schemer)
> (swapper 'a 'd '(a b c d))
(d b c a)
> (swapper 'a 'd '... | 1
(define up
(lambda (lst)
(cond ((null? lst)
'())
((pair? (car lst))
(append (car lst) (up (cdr lst))))
(else (cons (car lst) (up (cdr lst)))))))
> ( up ' ( ( 1 2 ) ( 3 4 ) ) )
( 1 2 3 4 )
Let 's check that ( down ( up lst ) ) is not lst :
2
(define swapper
(lambd... |
d96dc0bf69de5c9c87a883f86cfc295fb108d6cd67a4956f217d0cad48aec952 | dfinity-side-projects/dhc | rundhc.hs | import Data.Char
import qualified Data.ByteString as B
import Hero.Hero
main :: IO ()
main = putStr =<< runDemo =<< B.getContents
runDemo :: B.ByteString -> IO String
runDemo asm = stateVM . snd <$> runWasm "main" [] (mkHeroVM "" syscall wasm [])
where
wasm = either error id $ parseWasm asm
syscall ("system", "... | null | https://raw.githubusercontent.com/dfinity-side-projects/dhc/60ac6c85ca02b53c0fdd1f5852c1eaf35f97d579/test/rundhc.hs | haskell | import Data.Char
import qualified Data.ByteString as B
import Hero.Hero
main :: IO ()
main = putStr =<< runDemo =<< B.getContents
runDemo :: B.ByteString -> IO String
runDemo asm = stateVM . snd <$> runWasm "main" [] (mkHeroVM "" syscall wasm [])
where
wasm = either error id $ parseWasm asm
syscall ("system", "... | |
a77d80f0807a74a4fb040dd2aa008347e041fc0f20b81b0e1e28252fd82c65d5 | NorfairKing/smos | BackupGarbageCollectorSpec.hs | module Smos.Server.Looper.BackupGarbageCollectorSpec where
import Control.Monad
import Control.Monad.State.Strict
import Data.GenValidity.Persist ()
import Data.Int
import Data.Set (Set)
import qualified Data.Set as S
import Data.Time
import Database.Persist.Sql
import Smos.Server.DB
import Smos.Server.Gen ()
import S... | null | https://raw.githubusercontent.com/NorfairKing/smos/41d5ba29be87ce5c224d4b33790809a4528f81e3/smos-server-gen/test/Smos/Server/Looper/BackupGarbageCollectorSpec.hs | haskell | keeping this one
keeping this one
keeping this one
keeping this one
keeping this one
keeping this one
Backup every hour
Backup every hour | module Smos.Server.Looper.BackupGarbageCollectorSpec where
import Control.Monad
import Control.Monad.State.Strict
import Data.GenValidity.Persist ()
import Data.Int
import Data.Set (Set)
import qualified Data.Set as S
import Data.Time
import Database.Persist.Sql
import Smos.Server.DB
import Smos.Server.Gen ()
import S... |
bc7445210e1f02ae0d6d6c4ec2b32f6f63c4caa5584c3ea6baa049a8947a015e | mfey/units2 | ops.clj | ;; Mathy operations on the (generically defined) `units2.core.amount` type.
;; This implementation assumes:
;;
1 . that the values in ` amount ` , and any other numbers , are well - behaved under ` clojure.core/fns ` and ` Math / fns `
;; 2. that the units in `amount` are `Multiplicative`.
;; 3. that the units... | null | https://raw.githubusercontent.com/mfey/units2/16630eab5a7d618216ee2713eb88b75bb6ae5000/src/units2/ops.clj | clojure | Mathy operations on the (generically defined) `units2.core.amount` type.
This implementation assumes:
2. that the units in `amount` are `Multiplicative`.
3. that the units in `amount` are all linear rescalings without any `offset`.
(There are a few offset checks scattered throughout,
so offset... |
1 . that the values in ` amount ` , and any other numbers , are well - behaved under ` clojure.core/fns ` and ` Math / fns `
# #
1 . The ops we define here are fine with ` require : refer : all ` , they reduce to their ` clojure.core/ ` and ` Math/ ` counterparts on non-`amount ? ` quantities .
3 . Fo... |
74ffdb9ef24809c1e2197b368996d065cfd4c21b4efaa4b61dba181c1165e880 | satori-com/mzbench | worker_start_linear.erl | [ % linear worker start, almost similar to loop with "spawn" option,
but in this case workers wo n't share one state
{pool, [{size, 60},
{worker_start, {linear, {1, rps}}},
{worker_type, dummy_worker}],
[{print, {sprintf, "My number is: ~p", [{round_robin, [1, 2, 3, 4, 5, 6, 7, 8,... | null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/examples/worker_start_linear.erl | erlang | linear worker start, almost similar to loop with "spawn" option, | but in this case workers wo n't share one state
{pool, [{size, 60},
{worker_start, {linear, {1, rps}}},
{worker_type, dummy_worker}],
[{print, {sprintf, "My number is: ~p", [{round_robin, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}]}}]}
].
|
c97456ee8c465c14f5fd955b2b3acb411e2e43d08eb4b57c29c44ef0216fc9e7 | clojure-interop/google-cloud-clients | Options$QueryOption.clj | (ns com.google.cloud.spanner.Options$QueryOption
"Marker interface to mark options applicable to query operation."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner Options$QueryOption]))
| null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.spanner/src/com/google/cloud/spanner/Options%24QueryOption.clj | clojure | (ns com.google.cloud.spanner.Options$QueryOption
"Marker interface to mark options applicable to query operation."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner Options$QueryOption]))
| |
be188cabc940a07257cf6db0a5898d50e9f4f094276724fba653ae1e93c2805c | xvw/ocamlectron | Event.ml | open Js_of_ocaml
module EventEmitter = Electron_plumbing.EventEmitter
type 'a t = Js.js_string Js.t
type js = Electron_plumbing.Event.t
type listener_id = (unit -> unit)
let on (source : #EventEmitter.emitter Js.t) (event : ('a -> 'b) t) (f : ('a -> 'b)) =
let callback = Js.wrap_callback f in
let () = source ... | null | https://raw.githubusercontent.com/xvw/ocamlectron/3e0cb9575975e69ab34cb7e0e3549d31c07141c2/lib/electron_api/Event.ml | ocaml | open Js_of_ocaml
module EventEmitter = Electron_plumbing.EventEmitter
type 'a t = Js.js_string Js.t
type js = Electron_plumbing.Event.t
type listener_id = (unit -> unit)
let on (source : #EventEmitter.emitter Js.t) (event : ('a -> 'b) t) (f : ('a -> 'b)) =
let callback = Js.wrap_callback f in
let () = source ... | |
de2a6460ac05ef94ee24102b5d6f8abc055d35f5802a9dc0914d818248c3de88 | babashka/sci | libsci.clj | (ns sci.impl.libsci
(:require [cheshire.core :as cheshire]
[sci.core :as sci])
(:gen-class
:methods [^{:static true} [evalString [String] String]]))
(defn -evalString [s]
(sci/binding [sci/out *out*] ;; this enables println etc.
(str (try (sci/eval-string
s
;; this ... | null | https://raw.githubusercontent.com/babashka/sci/20616983a8be69f2c28c4ef453e7a4eb644a12ee/libsci/src/sci/impl/libsci.clj | clojure | this enables println etc.
this brings cheshire.core into sci | (ns sci.impl.libsci
(:require [cheshire.core :as cheshire]
[sci.core :as sci])
(:gen-class
:methods [^{:static true} [evalString [String] String]]))
(defn -evalString [s]
(str (try (sci/eval-string
s
{:namespaces {'cheshire.core {'generate-string cheshire/generate-str... |
baf659b8ab79aa28a3cd4b8b002a0e8581a69a77f07a6dbb0222ffa206b36d5d | dwayne/eopl3 | parser.test.rkt | #lang racket
(require "./parser.rkt")
(require rackunit)
(check-equal?
(parse "1")
(a-program (const-exp 1)))
(check-equal?
(parse "x")
(a-program (var-exp 'x)))
(check-equal?
(parse "-(5, y)")
(a-program (diff-exp (const-exp 5) (var-exp 'y))))
(check-equal?
(parse "zero?(z)")
(a-program (zero?-exp (var-e... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/05-ch5/interpreters/racket/TRAMPOLINED-5.19/parser.test.rkt | racket | #lang racket
(require "./parser.rkt")
(require rackunit)
(check-equal?
(parse "1")
(a-program (const-exp 1)))
(check-equal?
(parse "x")
(a-program (var-exp 'x)))
(check-equal?
(parse "-(5, y)")
(a-program (diff-exp (const-exp 5) (var-exp 'y))))
(check-equal?
(parse "zero?(z)")
(a-program (zero?-exp (var-e... | |
e2028ee8b3167b6a16d1ea920ccf98983b62c79786af15773d8507c20fb5647c | janestreet/universe | nvim_command.mli | open Core
type nargs =
[ `Exactly of int
| `List
| `At_most_one
| `At_least_one
]
type addr_type =
[ `Lines
| `Args
| `Buffers
| `Loaded_bufs
| `Windows
| `Tabs
]
type range_type =
| Range of
[ `Defaults_to_current_line
| `Defaults_to_whole_file
| `Defaults_to_line_nr of i... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/vcaml/src/nvim_command.mli | ocaml | open Core
type nargs =
[ `Exactly of int
| `List
| `At_most_one
| `At_least_one
]
type addr_type =
[ `Lines
| `Args
| `Buffers
| `Loaded_bufs
| `Windows
| `Tabs
]
type range_type =
| Range of
[ `Defaults_to_current_line
| `Defaults_to_whole_file
| `Defaults_to_line_nr of i... | |
b786bdeca4355ae643db97818a2eaa39ced16f7d9b8c19365dede820ad940cc1 | mejgun/haskell-tdlib | GetChatStatistics.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.GetChatStatistics where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only ... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/GetChatStatistics.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application
|
| |
module TD.Query.GetChatStatistics where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data GetChatStatistics = GetChatStatistics
is_dark :: Maybe Bool,
chat_id :: Maybe Int
}
deriving (Eq)
instance Show GetChatStatistics where
show
GetChatStati... |
a21023ec2296bbfc9567d794f3e8c7f2ddf7be180d3faf14deb92ead87125b74 | emina/rosette | cvc4.rkt | #lang racket
(require racket/runtime-path
"server.rkt" "env.rkt"
"../solver.rkt"
(prefix-in base/ "base-solver.rkt"))
(provide (rename-out [make-cvc4 cvc4]) cvc4? cvc4-available?)
(define-runtime-path cvc4-path (build-path ".." ".." ".." "bin" "cvc4"))
(define cvc4-opts '("-L" "smt2" "-q... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/rosette/solver/smt/cvc4.rkt | racket | #lang racket
(require racket/runtime-path
"server.rkt" "env.rkt"
"../solver.rkt"
(prefix-in base/ "base-solver.rkt"))
(provide (rename-out [make-cvc4 cvc4]) cvc4? cvc4-available?)
(define-runtime-path cvc4-path (build-path ".." ".." ".." "bin" "cvc4"))
(define cvc4-opts '("-L" "smt2" "-q... | |
66158af4f569cd1535da29b38a6893d9c6948a44ff3b1df19ee24fad24fd4077 | den1k/vimsical | redis.clj | (ns vimsical.backend.adapters.redis
(:require
[clojure.spec.alpha :as s]
[com.stuartsierra.component :as cp]
[taoensso.carmine :as car :refer [wcar]]))
;;
;; * Helpers
;;
(defn flushall! [redis]
(car/wcar
redis
(car/flushall)))
;;
;; * Component
;;
(defrecord Redis [host port spec]
cp/Lifecycle... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/backend/vimsical/backend/adapters/redis.clj | clojure |
* Helpers
* Component
| (ns vimsical.backend.adapters.redis
(:require
[clojure.spec.alpha :as s]
[com.stuartsierra.component :as cp]
[taoensso.carmine :as car :refer [wcar]]))
(defn flushall! [redis]
(car/wcar
redis
(car/flushall)))
(defrecord Redis [host port spec]
cp/Lifecycle
(start [this]
(let [spec {:host h... |
e0601abb8a84a86407c6a50a9dad38c71bdcb01a55f884c429ce13195a47ddd7 | OCamlPro/alt-ergo | intervals.mli | (******************************************************************************)
(* *)
(* The Alt-Ergo theorem prover *)
Copyright ( C ) 2006 - 2013 ... | null | https://raw.githubusercontent.com/OCamlPro/alt-ergo/e357e6a828124ed2553ec901728edf381862a77f/src/lib/reasoners/intervals.mli | ocaml | ****************************************************************************
The Alt-Ergo theorem prover
... | Copyright ( C ) 2006 - 2013
... |
db1d155fa64133669a4db3263dc78d8298f8042e8deefee9a19dce13df6905fa | reborg/clojure-essential-reference | 2.clj | < 1 >
(m1 [this])
(m2 [this])
(m3 [this]))
< 2 >
{:m1 (fn [this] (str "AFace::m1"))
:m2 (fn [this] (str "AFace::m2"))})
(defrecord MyFace []) ; <3>
(extend MyFace
IFace
< 4 >
< 5 >
;; "MyFace::m1"
< 6 >
;; "AFace::m2"
< 7 >
No implementation of method : : m3 of protocol : # ' user / IFac... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Types%2CClasses%2CHierarchiesandPolymorphism/extend%2Cextend-typeandextend-protocol/2.clj | clojure | <3>
"MyFace::m1"
"AFace::m2" | < 1 >
(m1 [this])
(m2 [this])
(m3 [this]))
< 2 >
{:m1 (fn [this] (str "AFace::m1"))
:m2 (fn [this] (str "AFace::m2"))})
(extend MyFace
IFace
< 4 >
< 5 >
< 6 >
< 7 >
No implementation of method : : m3 of protocol : # ' user / IFace |
a3f636d95b2406e33e471bfedbbcd5943df4fdfcb510ecd2eeffe0a882b94b17 | ChicagoBoss/ChicagoBoss | boss_template_adapter_jade.erl | %%-------------------------------------------------------------------
@author
ChicagoBoss Team and contributors , see file in root directory
%% @end
This file is part of ChicagoBoss project .
See file in root directory
%% for license information, see LICENSE file in root directory
%% @end
%... | null | https://raw.githubusercontent.com/ChicagoBoss/ChicagoBoss/113bac70c2f835c1e99c757170fd38abf09f5da2/src/boss/template_adapters/boss_template_adapter_jade.erl | erlang | -------------------------------------------------------------------
@end
for license information, see LICENSE file in root directory
@end
@doc
------------------------------------------------------------------- | @author
ChicagoBoss Team and contributors , see file in root directory
This file is part of ChicagoBoss project .
See file in root directory
-module(boss_template_adapter_jade).
-compile(export_all).
file_extensions() -> ["jade"].
translatable_strings(_Module) -> [].
source(_Module) -> "".
... |
88610dc2000a9b240c2b7ec3d53f0bb407d1c5e93d4e01e8604fcdd1454989f1 | Glue42/gateway-modules | util.cljc | (ns gateway.domains.global.util
(:require [gateway.basic-auth.core :as basic]
[gateway.auth.core :as auth]
[gateway.domains.global.core :as global]
[clojure.core.async :as a]))
(defn ->auth []
{:default :basic
:available {:basic (basic/authenticator {})}})
(defn stop-auth ... | null | https://raw.githubusercontent.com/Glue42/gateway-modules/be48a132134b5f9f41fd6a6067800da6be5e6eca/global-domain/test/gateway/domains/global/util.cljc | clojure | (ns gateway.domains.global.util
(:require [gateway.basic-auth.core :as basic]
[gateway.auth.core :as auth]
[gateway.domains.global.core :as global]
[clojure.core.async :as a]))
(defn ->auth []
{:default :basic
:available {:basic (basic/authenticator {})}})
(defn stop-auth ... | |
24d91f562a6fe57cfcfbb3e22fb61eb67c34924572d98605d1ed080acac01ee4 | ygrek/mldonkey | indexer.mli | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 2 of the License , or
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/utils/lib/indexer.mli | ocaml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 2 of the License , or
... | |
3787faf0eb5585c8c8e8d890fafb286db04d85025ea925067a5a9a661ea61b61 | viercc/kitchen-sink-hs | iamemhn.hs | import Runner
main :: IO ()
main = runWork isSquare
-- With and without optimization , adding annotation
isSquare : : ( a , a , a ) = > a - > Bool
-- made no impact on performance
-- With and without optimization, adding annotation
isSquare :: (Num a, Enum a, Ord a) => a -> Bool
-- made no impact on perfor... | null | https://raw.githubusercontent.com/viercc/kitchen-sink-hs/391efc1a30f02a65bbcc37a4391bd5cb0d3eee8c/execs/perf-src/iamemhn.hs | haskell | With and without optimization , adding annotation
made no impact on performance
With and without optimization, adding annotation
made no impact on performance | import Runner
main :: IO ()
main = runWork isSquare
isSquare : : ( a , a , a ) = > a - > Bool
isSquare :: (Num a, Enum a, Ord a) => a -> Bool
-}
isSquare n = n == c * c
where
c = head $ dropWhile (\m -> m * m < n) [0..]
# SCC isSquare #
|
35c86213d6d18c7a2f85d5feee7b6825c03d3025efd95a7142f296a271ccdecc | quintenpalmer/dungeons | Test.hs | module Main where
import Data.Maybe (fromJust)
import Character (selectPlayer,
serializePlayerForTerminal)
main = do
mPlayer <- selectPlayer "Prompt"
putStrLn $ serializePlayerForTerminal $ fromJust mPlayer
| null | https://raw.githubusercontent.com/quintenpalmer/dungeons/ad9445882e3cfd9d63df42a4e37265a71374598d/server/Test.hs | haskell | module Main where
import Data.Maybe (fromJust)
import Character (selectPlayer,
serializePlayerForTerminal)
main = do
mPlayer <- selectPlayer "Prompt"
putStrLn $ serializePlayerForTerminal $ fromJust mPlayer
| |
45b9834b04766ad0bd5ea31ae66a1cba92c74c70f42b790e562a1cb76be8320b | chaoxu/fancy-walks | B.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
{-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control . Monad . State
import Control.Monad
impor... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/codeforces.com/83/B.hs | haskell | # OPTIONS_GHC -O2 # | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control . Monad . State
import Control.Monad
import Control.Applicative
im... |
bd69bb23c68573d002636587e7f7ef7b8bf142f085c86bab3e286f640a074dd2 | refset/xtdb-workshop-reclojure-21 | workshop.clj | ;; # Workshop
# # 👋 XTDB Workshop - Re : Clojure 2021
Prepared by , @refset
# # 🛠 ️ Powered by Notespace ™
;; This experience was built with
... " a notebook experience in your Clojure namespace "
;;
;; Inspired after watching a recent walkthrough by @daslu_ -ws
# # 🧑 💻 To follow along
;; * clone -... | null | https://raw.githubusercontent.com/refset/xtdb-workshop-reclojure-21/c1a01cb5ca5651d5e30f2807354f2f164cad2cbf/src/workshop/workshop.clj | clojure | # Workshop
This experience was built with
Inspired after watching a recent walkthrough by @daslu_ -ws
* clone -workshop-reclojure-22
* fire-up your REPL using `clojure -M:notespace`
* sit back & watch :)
# Setup
## Dependencies
You should see the following message printed in the REPL:
```
Server starting... | # # 👋 XTDB Workshop - Re : Clojure 2021
Prepared by , @refset
# # 🛠 ️ Powered by Notespace ™
... " a notebook experience in your Clojure namespace "
# # 🧑 💻 To follow along
* connect to the REPL from your preferred editor
# # 🥱 Alternatively
:_
(ns workshop.workshop
(:require [xtdb.api :as ... |
4de064ad9d78b1344f29b7e5d8cab5dce679180a2e6876003a5a43691b4ee82f | rd--/hsc3 | miElements.help.hs | -- miElements ; basic ; model=0=Modal
let inp = pinkNoiseId 'α' ar * 0.3
gat = lfPulse kr 2 0 0.5
in X.miElements ar {-blow_in-} inp 0 gat 45 0.5 0.2 0 0 0 0.5 0.5 0.5 0.5 0.5 0.25 0.5 0.7 0.2 0.3 {-model-} 0 0
miElements ; ringing ; useId ' blow ' input and contour set to 0.5
let inp = pinkNoiseId 'α' ar * 0.3
... | null | https://raw.githubusercontent.com/rd--/hsc3/e1c9377f4985f4cc209a9cb11421bc8f1686c6f2/Help/Ugen/miElements.help.hs | haskell | miElements ; basic ; model=0=Modal
blow_in
model
contour
miElements ; ringing ; use theId 'strike' input (which bypasses the exciter section)
miElements ; bow
miElements ; blow
miElements ; blow ; contour
miElements ; model=0=MODAL ; event control
miElements ; metal, bells
miElements ; metal, bells ; event cont... | let inp = pinkNoiseId 'α' ar * 0.3
gat = lfPulse kr 2 0 0.5
miElements ; ringing ; useId ' blow ' input and contour set to 0.5
let inp = pinkNoiseId 'α' ar * 0.3
let inp = pinkNoiseId 'α' ar * 0.3
strike_in
let pit = iRandId 'α' 32 44
bow_timb = lfNoise1Id 'β' kr 0.3 * 0.5 + 0.5
in X.miElements ar 0 0 1 pi... |
b4e505a3e2babf6433551a568d447acf878bfa52ff84af96f80ffd59f385770c | russmatney/org-crud | agenda.clj | (ns org-crud.agenda)
(defn print-agenda [& args]
(println "agenda" args))
| null | https://raw.githubusercontent.com/russmatney/org-crud/11069d59925461601718c4bb4c29f74126093891/src/org_crud/agenda.clj | clojure | (ns org-crud.agenda)
(defn print-agenda [& args]
(println "agenda" args))
| |
d88beb2b200d9785494900d04646e65918d5b7f7a01414a578baca12ee45f81b | seagreen/ian | KiExperiment.hs | -- | Use:
--
-- > stack eval KiExperiment.test
module Scratch.KiExperiment where
import Control.Concurrent (forkIO, threadDelay)
import qualified Ki.Lite as Ki
import Relude
test :: IO ()
test = do
forkKiPrint
forkForkIOPrint
forever (threadDelay maxBound)
forkKiPrint :: IO ()
forkKiPrint = do
Ki.scoped $ \s... | null | https://raw.githubusercontent.com/seagreen/ian/f245fb68d94299f0e3e12744e9d1549447ad529a/haskell/src/Scratch/KiExperiment.hs | haskell | | Use:
> stack eval KiExperiment.test | module Scratch.KiExperiment where
import Control.Concurrent (forkIO, threadDelay)
import qualified Ki.Lite as Ki
import Relude
test :: IO ()
test = do
forkKiPrint
forkForkIOPrint
forever (threadDelay maxBound)
forkKiPrint :: IO ()
forkKiPrint = do
Ki.scoped $ \scope -> do
_ <- Ki.fork scope (printForever... |
a116ec7d080a4d0ad1600761c2b93f937a6a779ac2b2a3836b036b2e9a2cb33a | flodihn/NextGen | sha512.erl | -module(sha512).
-export([start/0, stop/0, init/1]).
-export([hexdigest/1]).
start() ->
case erl_ddll:load_driver(".", "sha512_drv") of
ok -> ok;
{error, already_loaded} -> ok;
_ -> exit({error, could_not_load_driver})
end,
spawn(?MODULE, init, ["sha512_drv"]).
init(SharedLib) ->
... | null | https://raw.githubusercontent.com/flodihn/NextGen/3da1c3ee0d8f658383bdf5fccbdd49ace3cdb323/ConnectionServer/sha512/sha512.erl | erlang | -module(sha512).
-export([start/0, stop/0, init/1]).
-export([hexdigest/1]).
start() ->
case erl_ddll:load_driver(".", "sha512_drv") of
ok -> ok;
{error, already_loaded} -> ok;
_ -> exit({error, could_not_load_driver})
end,
spawn(?MODULE, init, ["sha512_drv"]).
init(SharedLib) ->
... | |
cdee359bb1af219ad02237bafb140cf9ea1e7e586d2b370c3d18bcad85354720 | zlatozar/study-paip | prolog1.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CH11 - FIRST ; Base : 10 -*-
;;; Code from Paradigms of Artificial Intelligence Programming
Copyright ( c ) 1991
prolog1.lisp : First version of Prolog implementation
(in-package #:ch11-first)
;; Clauses are represented as (head . body) cons cells
(defun ... | null | https://raw.githubusercontent.com/zlatozar/study-paip/dfa1ca6118f718f5d47d8c63cbb7b4cad23671e1/ch11/prolog1.lisp | lisp | Syntax : COMMON - LISP ; Package : CH11 - FIRST ; Base : 10 -*-
Code from Paradigms of Artificial Intelligence Programming
Clauses are represented as (head . body) cons cells
Clauses are stored on the predicate's plist
The predicate must be a non-variable symbol.
check if the goal unifies with the head of the cla... |
Copyright ( c ) 1991
prolog1.lisp : First version of Prolog implementation
(in-package #:ch11-first)
(defun clause-head (clause) (first clause))
(defun clause-body (clause) (rest clause))
(defun get-clauses (pred) (get pred 'clauses))
(defun predicate (relation) (first relation))
(defvar *db-predicates* nil... |
75eea64562df4035cbdda7f26bc17376ea2fb69294707f1d6d6966766589c04b | mflatt/plai-typed | use-untyped.rkt | #lang racket
(require "untyped.rkt")
(define-syntax-rule (test a b)
(unless (equal? a b)
(error 'test "failed: ~.s" 'b)))
(test x '(a 2 "c" '(d)))
(test "ok" ((v-f i) "ok"))
(test add1 (v-f (v add1)))
(test #t (v? i))
(test "a" (f "a"))
(test 0 (f 0))
(test #t (ordinal? (ordinal "x")))
(test '(6 6) (apply-id... | null | https://raw.githubusercontent.com/mflatt/plai-typed/419102db1e44b74dea9daf7a75e9b0e2b9c97d05/plai-typed/tests/use-untyped.rkt | racket | #lang racket
(require "untyped.rkt")
(define-syntax-rule (test a b)
(unless (equal? a b)
(error 'test "failed: ~.s" 'b)))
(test x '(a 2 "c" '(d)))
(test "ok" ((v-f i) "ok"))
(test add1 (v-f (v add1)))
(test #t (v? i))
(test "a" (f "a"))
(test 0 (f 0))
(test #t (ordinal? (ordinal "x")))
(test '(6 6) (apply-id... | |
96ad26f1181afcb2563d081ba69b06d52abef41454681fc4ac81aafc8d617d24 | arrayfire/arrayfire-haskell | Lex.hs | {-# LANGUAGE OverloadedStrings #-}
module Lex where
import Control.Arrow
import Data.Text (Text)
import qualified Data.Text as T
import Data.Char
import Types
symbols :: String
symbols = " *();,"
lex :: Text -> [Token]
lex = go NameMode
where
tokenize ' ' = []
token... | null | https://raw.githubusercontent.com/arrayfire/arrayfire-haskell/5d621602bb925ce5122a66011003498cbe638e2b/gen/Lex.hs | haskell | # LANGUAGE OverloadedStrings # | module Lex where
import Control.Arrow
import Data.Text (Text)
import qualified Data.Text as T
import Data.Char
import Types
symbols :: String
symbols = " *();,"
lex :: Text -> [Token]
lex = go NameMode
where
tokenize ' ' = []
tokenize '*' = [Star]
tokenize '(' =... |
2080066bfd79831a55a27591b04fd37e5e810e30563ce2a598b1a21141d9ac0b | binsec/xyntia | bitvector_test.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2019 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/xyntia/523e4c93520843dfd6f84f0ef2cefa6dcef508e8/test/bitvector_test.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2019 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
dbe7c3bf33143b951a7bc7f1be3ce08ff2c640b2504385094e7080cf33e9d4bc | Smart-Sql/smart-sql | my_create_table_0.clj | (ns org.gridgain.plus.ddl.my-create-table-0
(:require
[org.gridgain.plus.dml.select-lexical :as my-lexical]
[org.gridgain.plus.dml.my-select-plus :as my-select]
[org.gridgain.plus.init.plus-init-sql :as plus-init-sql]
[clojure.core.reducers :as r]
[clojure.string :as str])
... | null | https://raw.githubusercontent.com/Smart-Sql/smart-sql/d2f237f935472942a143816925221cdcf8246aff/src/main/clojure/org/gridgain/plus/ddl/my_create_table_0.clj | clojure | 生成 class 的类名
:methods [^:static [plus_create_table [org.apache.ignite.Ignite Long String String Long String String] void]]
形成这样的列表,当执行中有 false 就执行 un_sql,
来回滚事务
获取 items 和 template
(.append sb (.concat (.getColumn_name m) "_pk"))
(get_pk_index_ds pk_sets schema_name table_name schema_name)
... | (ns org.gridgain.plus.ddl.my-create-table-0
(:require
[org.gridgain.plus.dml.select-lexical :as my-lexical]
[org.gridgain.plus.dml.my-select-plus :as my-select]
[org.gridgain.plus.init.plus-init-sql :as plus-init-sql]
[clojure.core.reducers :as r]
[clojure.string :as str])
... |
ac4c0b865fe8f89eb70819f37d3c802cf0051952ea9a1efe026650940b514cfa | CloudI/CloudI | folsom_erlang_checks.erl | %%%
Copyright 2011 , Boundary
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% -2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/external/cloudi_x_folsom/test/folsom_erlang_checks.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2011 , Boundary
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(folsom_erlang_checks).
-include_lib("eunit/include/eunit.hrl").
-export([
create_metrics/0,
popul... |
87510c114ba91a12008c88c51f9e952de33f317fbeffecb301e81881446316e4 | haskus/packages | Error.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PolyKinds #
-- | Type-level Error
module Haskus.Utils.Types.Error
( TypeError
, ErrorMessage (..)
, Assert
)
where
import ... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-utils-types/src/lib/Haskus/Utils/Types/Error.hs | haskell | | Type-level Error
| Like: If cond t (TypeError msg)
For instance:
type family F n where
F n = If (n <=? 8) Int8 (TypeError (Text "ERROR"))
type family G n where
G n = Assert (n <=? 8) Int8 (Text "ERROR")
| # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PolyKinds #
module Haskus.Utils.Types.Error
( TypeError
, ErrorMessage (..)
, Assert
)
where
import GHC.TypeLits
The di... |
cc61a5d9abc6d63b25f9e64f239447c1cba9b4c5d09a3f3980cb5aaada82f0a0 | openbadgefactory/salava | settings_test.clj | (ns salava.page.settings-test
(:require [midje.sweet :refer :all]
[salava.core.migrator :as migrator]
[salava.test-utils :refer [test-api-request login! logout! test-user-credentials]]
[salava.core.helper :refer [dump]]))
(def test-user 1)
(def page-id 1)
(def page-owned-by-anot... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/test_old/clj/salava/page/settings_test.clj | clojure | (ns salava.page.settings-test
(:require [midje.sweet :refer :all]
[salava.core.migrator :as migrator]
[salava.test-utils :refer [test-api-request login! logout! test-user-credentials]]
[salava.core.helper :refer [dump]]))
(def test-user 1)
(def page-id 1)
(def page-owned-by-anot... | |
2c59cf26d16631031502ef43e5ce3f5e052b88a21a544940a6255bc7df984fa3 | haskell-repa/repa | Layout.hs |
module Data.Repa.Array.Internals.Layout
(Layout (..), LayoutI)
where
import Data.Repa.Array.Internals.Shape
-- | A layout provides a total order on the elements of an index space.
--
-- We can talk about the n-th element of an array, independent of its
-- shape and dimensionality.
--
class Shape (Index... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-array/Data/Repa/Array/Internals/Layout.hs | haskell | | A layout provides a total order on the elements of an index space.
We can talk about the n-th element of an array, independent of its
shape and dimensionality.
| Short name for a layout which does not include details of
the exact extent.
| Type used to index into this array layout.
| O(1). Proxy for th... |
module Data.Repa.Array.Internals.Layout
(Layout (..), LayoutI)
where
import Data.Repa.Array.Internals.Shape
class Shape (Index l) => Layout l where
data Name l
type Index l
name :: Name l
create :: Name l -> Index l -> l
extent :: l -> Index l... |
addc9232758306c91e7392f51f65a8c63448934764d69c59e20d2b3daa536f0c | portkey-cloud/aws-clj-sdk | _2016-09-29.clj | (ns portkey.aws.cloudfront.-2016-09-29 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope {:service "cloudfront", :region "us-east-1"},
:ssl-common-name "cloudfront.amazonaws.com",
:endpoint "",
:signature-version :v4},
"eu-west-1"
{:credential-scope {:service "cloudf... | null | https://raw.githubusercontent.com/portkey-cloud/aws-clj-sdk/10623a5c86bd56c8b312f56b76ae5ff52c26a945/src/portkey/aws/cloudfront/_2016-09-29.clj | clojure | (ns portkey.aws.cloudfront.-2016-09-29 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope {:service "cloudfront", :region "us-east-1"},
:ssl-common-name "cloudfront.amazonaws.com",
:endpoint "",
:signature-version :v4},
"eu-west-1"
{:credential-scope {:service "cloudf... | |
52d8cf66b6ed04c9ce24f72ebfe6f6885b810904ee5dfa98f5bd6b006bd4d90d | sorenmacbeth/flambo | accumulator.clj | (ns flambo.accumulator
(:import [org.apache.spark Accumulator]
[scala.Option])
(:refer-clojure :exclude [name]))
(defn accumulator
([sc value]
(.accumulator sc value))
([sc value name]
(.accumulator sc value name)))
(defn value [^Accumulator accumulator-var]
(.value accumulator-var))
(defn... | null | https://raw.githubusercontent.com/sorenmacbeth/flambo/9c61467697547c5fe3d05070be84cd2320cb53ce/src/clojure/flambo/accumulator.clj | clojure | (ns flambo.accumulator
(:import [org.apache.spark Accumulator]
[scala.Option])
(:refer-clojure :exclude [name]))
(defn accumulator
([sc value]
(.accumulator sc value))
([sc value name]
(.accumulator sc value name)))
(defn value [^Accumulator accumulator-var]
(.value accumulator-var))
(defn... | |
34259a975dc4a994782690bef6c3c2705d79ebf8a4eb0b10bd24923a11daaf03 | jeapostrophe/exp | rom-link2.rkt | #lang racket
(require racket/cmdline)
(define wahcade-lst
(command-line #:program "rom-link2"
#:args (wahcade-lst) wahcade-lst))
(define (linkum name rom)
(define rom-pth
(build-path (current-directory)
"Roms"
(string-append rom ".nes")))
(define link-pth ... | null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/rom-link2.rkt | racket | #lang racket
(require racket/cmdline)
(define wahcade-lst
(command-line #:program "rom-link2"
#:args (wahcade-lst) wahcade-lst))
(define (linkum name rom)
(define rom-pth
(build-path (current-directory)
"Roms"
(string-append rom ".nes")))
(define link-pth ... | |
c7263c5c0e1d1edeaf6643bbd55226839e0979f59e56b67e2920553a07973636 | k0001/di | Types.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
{-# LANGUAGE TypeSynonymInstances #-}
module Df1.Types
( Log(Log, log_time, log_level, log_path, log_message)
, Level(Debug, Info, Notice, Warning, Error, Critical, Alert, Emergency)
, Path(Attr, Push), ToPath(path)
,... | null | https://raw.githubusercontent.com/k0001/di/8d9a2aa33bfe42ece88bd398fb44aebcfb1a9525/df1/lib/Df1/Types.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
------------------------------------------------------------------------------
cheaper to obtain and to render. You can use
'Data.Time.Clock.System.systemToUTCTime' to convert it if necessary.
^ Importance level of the logged message.
^ 'Path' where ... | # LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
module Df1.Types
( Log(Log, log_time, log_level, log_path, log_message)
, Level(Debug, Info, Notice, Warning, Error, Critical, Alert, Emergency)
, Path(Attr, Push), ToPath(path)
, Segment, unSegment, ToSegment(segment)
, Key, unKey, ToKey(key)
, Valu... |
c89af150a0b5ddfee3cdbb3e75a2402b069615b99cce488059e104b4064dee0e | sneeuwballen/zipperposition | Position.ml |
This file is free software , part of Logtk . See file " license " for more details .
(** {1 Positions in terms, clauses...} *)
(** A position is a path in a tree *)
type t =
| Stop
| Type of t (** Switch to type *)
| Left of t (** Left term in curried application *)
| Right of t (** Right term in curried a... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/71798cc0559d2c365ad43a0a54e204a2d079cebd/src/core/Position.ml | ocaml | * {1 Positions in terms, clauses...}
* A position is a path in a tree
* Switch to type
* Left term in curried application
* Right term in curried application, and subterm of binder
* Head of uncurried term
* argument term in uncurried term, or in multiset
* Body of binder
Recursive append
* Empty (identity fu... |
This file is free software , part of Logtk . See file " license " for more details .
type t =
| Stop
type position = t
let stop = Stop
let type_ pos = Type pos
let left pos = Left pos
let right pos = Right pos
let head pos = Head pos
let arg i pos = Arg (i, pos)
let body pos = Body pos
let compare = CCShims_.... |
6a73491e9c0b359bf55bd1b6436554ecc74915ebb08b472952e6fa84523b6b86 | bos/rwh | SuffixTree.hs | import Data.List
type Edge = (String, STree)
data STree = Node [Edge]
| Leaf
deriving (Show)
type EdgeFunction = [String] -> (Int, [String])
construct :: String -> STree
construct = suf . suffixes
where suf [[]] = Leaf
suf ss = Node [([a], suf n)
| a <-... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch05/SuffixTree.hs | haskell | - snippet suffixes -
- /snippet suffixes -
- snippet noAsPattern -
- /snippet noAsPattern -
- snippet suffixes2 -
- /snippet suffixes2 -
- snippet compose -
- /snippet compose -
- /snippet suffixes4 - | import Data.List
type Edge = (String, STree)
data STree = Node [Edge]
| Leaf
deriving (Show)
type EdgeFunction = [String] -> (Int, [String])
construct :: String -> STree
construct = suf . suffixes
where suf [[]] = Leaf
suf ss = Node [([a], suf n)
| a <-... |
516178e8021c24de28588c3ba89b1f46c5e737955da1fe13cffff94656bead04 | drfloob/ezic | ezic.erl | -module(ezic).
-include("include/ezic.hrl").
-export([
localtime/1
, utc_to_local/2
, local_to_utc/2
, has_dst_utc/2
, has_dst_local/2
]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PUBLIC API
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... | null | https://raw.githubusercontent.com/drfloob/ezic/d95e92d1dc5ac763558da52c271b8a1b76f48122/src/ezic.erl | erlang |
PUBLIC API
returns local time in given timezone
returns utc time for corresponding time in given timezone utc
PRIVATE
| -module(ezic).
-include("include/ezic.hrl").
-export([
localtime/1
, utc_to_local/2
, local_to_utc/2
, has_dst_utc/2
, has_dst_local/2
]).
localtime(TzName) ->
utc_to_local(erlang:universaltime(), TzName).
returns time in given timezone for corresponding utc time
utc_to_local(UTCDatetime, TzName)... |
97226131be03d4c7d131fe7dc3133aac21ac9c0d6e2674799bf128edcfa1ceec | nyu-acsys/drift | a-mapi.ml |
let rec mapi_helper (hf: int -> int -> int) hi hn (ha: int array) (hb: int array) =
if (hi < hn) then
let _ = Array.set hb hi (hf hi (Array.get ha hi)) in
mapi_helper hf (hi + 1) hn ha hb
else hb
let rec mapi (mf: int -> int -> int) (ma: int array) =
let mn = Array.length ma in
let mb = Array.make mn 0 in
... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks_call/DRIFT/array/a-mapi.ml | ocaml |
let rec mapi_helper (hf: int -> int -> int) hi hn (ha: int array) (hb: int array) =
if (hi < hn) then
let _ = Array.set hb hi (hf hi (Array.get ha hi)) in
mapi_helper hf (hi + 1) hn ha hb
else hb
let rec mapi (mf: int -> int -> int) (ma: int array) =
let mn = Array.length ma in
let mb = Array.make mn 0 in
... | |
886db8635b5a6ed39cf577512a15931a26fdca974e4cea87048e6134ec422d27 | 2600hz/community-scripts | wh_binary.erl | %%%-------------------------------------------------------------------
( C ) 2010 - 2012 , VoIP INC
%%% @doc
%%% Various utilities - a veritable cornicopia
%%% @end
%%% @contributors
%%%-------------------------------------------------------------------
-module(wh_binary).
-export([to_lower/1]).
-export... | null | https://raw.githubusercontent.com/2600hz/community-scripts/b0b81342bf02300fcdbda99e4cecc1ee93823c70/CloneTools/src/wh_binary.erl | erlang | -------------------------------------------------------------------
@doc
Various utilities - a veritable cornicopia
@end
@contributors
-------------------------------------------------------------------
PROPER TESTING | ( C ) 2010 - 2012 , VoIP INC
-module(wh_binary).
-export([to_lower/1]).
-export([to_upper/1]).
-export([ucfirst/1]).
-export([lcfirst/1]).
-export([strip/1
,strip/2
]).
-export([strip_left/2]).
-export([strip_right/2]).
-export([md5/1]).
-export([pad/3]).
-export([join/1
,join/... |
cf32ceeda400a766a6ffa7aab9a822d33bd2eb8cf32021ddb6495279a8c1b2f1 | sgbj/MaximaSharp | dlasd1.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/lapack/dlasd1.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
67d02582ad9e5ba6d68d9ab463b4b938a0ee04f9c1e0e927361bbf0c47250018 | myaosato/clcm | ordered-list.lisp | (defpackage :clcm/nodes/ordered-list
(:use :cl
:clcm/line
:clcm/node
:clcm/nodes/list)
(:import-from :cl-ppcre
:scan-to-strings)
(:export :ordered-list-node
:is-tight
:start
:is-ordered-list-line
:attach-ordered-list!?))
(in-packa... | null | https://raw.githubusercontent.com/myaosato/clcm/fd0390bedf00c5be3f5c2eb8176ff73bede797b0/src/nodes/ordered-list.lisp | lisp | block quote | (defpackage :clcm/nodes/ordered-list
(:use :cl
:clcm/line
:clcm/node
:clcm/nodes/list)
(:import-from :cl-ppcre
:scan-to-strings)
(:export :ordered-list-node
:is-tight
:start
:is-ordered-list-line
:attach-ordered-list!?))
(in-packa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.