_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 |
|---|---|---|---|---|---|---|---|---|
941d97485565740e8e979b930b204aab47324a327c7de6eae9f1ae4b98f14549 | the-real-blackh/cassandra-cql | test-set.hs | # LANGUAGE OverloadedStrings ,
import Database.Cassandra.CQL
import Control.Monad
import Control.Monad.CatchIO
import Control.Monad.Trans (liftIO)
import Data.Int
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as C
import Data.Set (Set)
import qualified Data.Set as S
import Data.Tex... | null | https://raw.githubusercontent.com/the-real-blackh/cassandra-cql/681d900fadcede786d1008eac2270166ca915e8b/tests/test-set.hs | haskell | Ignore the error if the table doesn't exist | # LANGUAGE OverloadedStrings ,
import Database.Cassandra.CQL
import Control.Monad
import Control.Monad.CatchIO
import Control.Monad.Trans (liftIO)
import Data.Int
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as C
import Data.Set (Set)
import qualified Data.Set as S
import Data.Tex... |
299a00726a82accae0f5836b8caa4e1ed05c11e0e5e8e152eb9e584fbd259e82 | ijp/guildhall | solver.scm | ;;; solver.scm --- Dependency solver, algorithm
Copyright ( C ) 2009 - 2011 < >
Copyright ( C ) 2009
Author : < >
;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either versio... | null | https://raw.githubusercontent.com/ijp/guildhall/2fe2cc539f4b811bbcd69e58738db03eb5a2b778/guildhall/solver.scm | scheme | solver.scm --- Dependency solver, algorithm
This program is free software; you can redistribute it and/or
either version 3
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
G... |
Copyright ( C ) 2009 - 2011 < >
Copyright ( C ) 2009
Author : < >
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
#!r6rs
(library (guildhall solver)
(ex... |
c5514c5170e58c8d8eaa1d3740d1a381c35290cc9a8da448d3b0ca498a4af115 | tezos/tezos-mirror | publisher_worker_types.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2023 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/1b26ce0f9c2a9c508a65c45641a0a146d9b52fc7/src/proto_alpha/lib_sc_rollup_node/publisher_worker_types.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2023 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
695cbde39d1fdb5ac80ad3c279c706bde5a9f3f227254fef7ba491e58ba20e11 | jamesmartin/datomic-tutorial | core.clj | (ns datomic-tutorial.core
(:gen-class))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))
| null | https://raw.githubusercontent.com/jamesmartin/datomic-tutorial/ca381b9be10e10df5a4c9417cacc512f086ff785/src/datomic_tutorial/core.clj | clojure | (ns datomic-tutorial.core
(:gen-class))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))
| |
8308d61838b681aea165c820401104d03910874f597b70becb46ead7799e3f2f | haskell-streaming/streaming | ByteString.hs | # LANGUAGE LambdaCase , RankNTypes , ScopedTypeVariables #
module Stream.Folding.ByteString where
import Stream.Types
import Stream.Folding.Prelude hiding (fromHandle)
import Control.Monad hiding (filterM, mapM)
import Data.Functor.Identity
import Control.Monad.Trans
im... | null | https://raw.githubusercontent.com/haskell-streaming/streaming/eb3073e6ada51b2bae82c15a9ef3a21ffa5f5529/benchmarks/old/Stream/Folding/ByteString.hs | haskell | # INLINABLE fromHandleLn #
# INLINABLE hGet #
span
:: Monad m
=> (Word8 -> Bool)
=> Folding_ (Of ByteString) m r
-> (Word8 -> Bool)
-- span_ :: Folding_ (Of ByteString) m r
-- -> (Word8 -> Bool)
-> (m r' -> r')
-> (Folding (Of ByteString)... | # LANGUAGE LambdaCase , RankNTypes , ScopedTypeVariables #
module Stream.Folding.ByteString where
import Stream.Types
import Stream.Folding.Prelude hiding (fromHandle)
import Control.Monad hiding (filterM, mapM)
import Data.Functor.Identity
import Control.Monad.Trans
im... |
264fad01460446ec830bb103434e378295953dc5d9983dc7efe729c7a4ebcf4f | mbutterick/beautiful-racket | tokenize-only.rkt | #lang br/quicklang
(require "parser.rkt" "tokenizer.rkt" brag/support)
(define (read-syntax path port)
(define tokens (apply-tokenizer-maker make-tokenizer port))
(strip-bindings
#`(module basic-parser-mod basic-demo-3/parse-only
'#,tokens)))
(module+ reader (provide read-syntax))
(define-macro (mb PAR... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/basic-demo-3/tokenize-only.rkt | racket | #lang br/quicklang
(require "parser.rkt" "tokenizer.rkt" brag/support)
(define (read-syntax path port)
(define tokens (apply-tokenizer-maker make-tokenizer port))
(strip-bindings
#`(module basic-parser-mod basic-demo-3/parse-only
'#,tokens)))
(module+ reader (provide read-syntax))
(define-macro (mb PAR... | |
47034bb3302706a433c40cc8e0cdb604c3f5b1829e7984fb9c9b89f06afa05b6 | luc-tielen/eclair-lang | Lower.hs | module Eclair.AST.Lower
( compileToRA
) where
import Prelude hiding (swap, project)
import qualified Data.Graph as G
import qualified Data.Map as M
import Eclair.AST.Codegen
import Eclair.AST.IR hiding (Clause)
import Eclair.Common.Id
import Eclair.Common.Location (NodeId(..))
import qualified Eclair.RA.IR as RA
i... | null | https://raw.githubusercontent.com/luc-tielen/eclair-lang/343db5e350ec8132cf0773b32a4cc112653bdab4/lib/Eclair/AST/Lower.hs | haskell | case for multiple mutually recursive rules
If no top level facts are defined, no entry exists in declLine mapping -> default to -1
Because rejected by parser
NOTE: These rules can all be evaluated in parallel inside the fixpoint loop
TODO: better func name
No starts with check here, since cyclic negation is not a... | module Eclair.AST.Lower
( compileToRA
) where
import Prelude hiding (swap, project)
import qualified Data.Graph as G
import qualified Data.Map as M
import Eclair.AST.Codegen
import Eclair.AST.IR hiding (Clause)
import Eclair.Common.Id
import Eclair.Common.Location (NodeId(..))
import qualified Eclair.RA.IR as RA
i... |
ed2609a688d60f016902eeca4ee6ac68e1299aa93249d517ec98d7b841d8be62 | untangled-web/untangled | locales.cljs | (ns
app.i18n.locales
(:require
goog.module
goog.module.ModuleLoader
[goog.module.ModuleManager :as module-manager]
[untangled.i18n.core :as i18n]
app.i18n.en-US
app.i18n.es-MX)
(:import goog.module.ModuleManager))
(defonce manager (module-manager/getInstance))
(defonce modules #js {"en-US" "/en-US.js",... | null | https://raw.githubusercontent.com/untangled-web/untangled/705220539ff00b1e487ae387def11daad8638206/src/client/app/i18n/locales.cljs | clojure | (ns
app.i18n.locales
(:require
goog.module
goog.module.ModuleLoader
[goog.module.ModuleManager :as module-manager]
[untangled.i18n.core :as i18n]
app.i18n.en-US
app.i18n.es-MX)
(:import goog.module.ModuleManager))
(defonce manager (module-manager/getInstance))
(defonce modules #js {"en-US" "/en-US.js",... | |
67a03b3a1b97e953f40ff934a20b74e63ff7de9b1dfaaa9298758575f055f2a5 | Simre1/hero | Render.hs | # LANGUAGE TypeFamilies #
module Hero.SDL2.Render
( runGraphics,
Graphics (..),
GraphicsConfig (..),
SDL.WindowConfig (..),
defaultGraphics,
Render (..),
render,
Sprite (..),
TextureSprite(..),
SDL.Texture,
loadTexture,
Shape (..),
Fill (..),
fillBorder,
fillCo... | null | https://raw.githubusercontent.com/Simre1/hero/99399835a983cc175870550f88665f50872d8be8/hero-sdl2/src/Hero/SDL2/Render.hs | haskell | | The graphics context containing the window and the renderer.
It can be accessed globally since its stored in a `Global` store.
# UNPACK #
# UNPACK #
| All entities with a Render component get rendered.
Rendering position is its Position2D + offset
Rotation is its Rotation2D + rotation
# UNPACK #
# UNPACK #
# UNP... | # LANGUAGE TypeFamilies #
module Hero.SDL2.Render
( runGraphics,
Graphics (..),
GraphicsConfig (..),
SDL.WindowConfig (..),
defaultGraphics,
Render (..),
render,
Sprite (..),
TextureSprite(..),
SDL.Texture,
loadTexture,
Shape (..),
Fill (..),
fillBorder,
fillCo... |
b065a76ed6f962fd27283feac4fccab972be803e67ad4088e40262e1bf784bc6 | elastic/eui-cljs | timeline_item_icon.cljs | (ns eui.timeline-item-icon
(:require ["@elastic/eui/lib/components/timeline/timeline_item_icon.js" :as eui]))
(def EuiTimelineItemIcon eui/EuiTimelineItemIcon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/timeline_item_icon.cljs | clojure | (ns eui.timeline-item-icon
(:require ["@elastic/eui/lib/components/timeline/timeline_item_icon.js" :as eui]))
(def EuiTimelineItemIcon eui/EuiTimelineItemIcon)
| |
fc661497b529dc1549f49d9f4e3c6df0930fc3c8c2add37e24da913b6a2d2eb5 | startalkIM/ejabberd | iconv.erl | %%%----------------------------------------------------------------------
%%% File : iconv.erl
Author : < >
Purpose : Interface to
Created : 16 Feb 2003 by < >
%%%
%%%
Copyright ( C ) 2002 - 2016 ProcessOne , SARL . All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " ... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/iconv/src/iconv.erl | erlang | ----------------------------------------------------------------------
File : iconv.erl
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 ... | Author : < >
Purpose : Interface to
Created : 16 Feb 2003 by < >
Copyright ( C ) 2002 - 2016 ProcessOne , SARL . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(iconv).
-author... |
85f4c420f2b6e39fe7705bd20ad2beff8840bdc04cfdebb1b92d3baf5e57320b | adamgundry/uom-plugin | Internal.hs | # LANGUAGE DataKinds #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
# LANGUAGE StandaloneDeriving #
# LANGUAGE StandaloneKindSignatures #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
-- | This module defines the core t... | null | https://raw.githubusercontent.com/adamgundry/uom-plugin/067a926042a6279cd13efc50c75112e53c95cb27/uom-plugin/src/Data/UnitsOfMeasure/Internal.hs | haskell | | This module defines the core types used in the @uom-plugin@
library. Note that importing this module may allow you to violate
invariants, so you should generally work with the safe interface in
"Data.UnitsOfMeasure" instead.
* Type-level units of measure
* Values indexed by their units
* Unit-safe 'Fractional... | # LANGUAGE DataKinds #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
# LANGUAGE StandaloneDeriving #
# LANGUAGE StandaloneKindSignatures #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Data.UnitsOfMeasure.Internal... |
a6bf6fbac8213bae57ddb14421ccf6c07271efb5419b3d656dd0c5f54ac290dc | RedPRL/algaeff | TestUniqueID.mli | (* This file is intentionally blank to detect unused declarations. *)
| null | https://raw.githubusercontent.com/RedPRL/algaeff/0a9742860a98d2ad0297ffed4760670baf91d041/test/TestUniqueID.mli | ocaml | This file is intentionally blank to detect unused declarations. | |
108871f454535948703e299817ed590e01390fa48e74c90fd455c41dda348440 | jeroanan/rkt-coreutils | id.rkt | #lang s-exp "util/frontend-program.rkt"
(require "repl/id.rkt")
(id)
| null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/id.rkt | racket | #lang s-exp "util/frontend-program.rkt"
(require "repl/id.rkt")
(id)
| |
8de73bc91e5a5776b13410709932cbac2710df8f9240a618c6c59be2eea78d1a | elaforge/karya | Swam_test.hs | Copyright 2019
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module User.Elaforge.Instrument.Swam_test where
import qualified Derive.Controls as Controls
import qualified Derive.DeriveTest as DeriveTest
import qualified Derive.Score as Score
impor... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/User/Elaforge/Instrument/Swam_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt | Copyright 2019
module User.Elaforge.Instrument.Swam_test where
import qualified Derive.Controls as Controls
import qualified Derive.DeriveTest as DeriveTest
import qualified Derive.Score as Score
import qualified Ui.UiTest as UiTest
import qualified User.Elaforge.Instrument.Swam as Swam
import Util.Tes... |
b8ddb36ecc2aa5d36e61b3ab29765eafb5e9301ad4cab1e9e2a32de11a099e1d | RedPRL/stagedtt | Unfold.mli | open Core
module D := Domain
module I := Inner
val unfold : stage:int -> size:int -> D.t -> D.t
val unfold_top : stage:int -> D.t -> D.t
val unfold_inner : I.t -> I.t
| null | https://raw.githubusercontent.com/RedPRL/stagedtt/f88538036b51cebb83ebb0b418ec9b089550275d/lib/unfold/Unfold.mli | ocaml | open Core
module D := Domain
module I := Inner
val unfold : stage:int -> size:int -> D.t -> D.t
val unfold_top : stage:int -> D.t -> D.t
val unfold_inner : I.t -> I.t
| |
1513de02b6ab26b14d837aaf91c7ff9adfb5eba6753b99014dc61e8f4120eb51 | eugmes/imp | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import IMP.Parser
import IMP.Codegen.Error
import IMP.Emit
import IMP.AST (Program)
import qualified Data.Text.IO as TIO
import qualified Text.Megaparsec as P
import LLVM
import LLVM.Context
import LLVM.PassManager as PM
import LLVM.Analysis
import LLVM.Exce... | null | https://raw.githubusercontent.com/eugmes/imp/7bee4dcff146e041b0242b9e7054dfec4c04c84f/src/Main.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: Use some type class for this |
module Main (main) where
import IMP.Parser
import IMP.Codegen.Error
import IMP.Emit
import IMP.AST (Program)
import qualified Data.Text.IO as TIO
import qualified Text.Megaparsec as P
import LLVM
import LLVM.Context
import LLVM.PassManager as PM
import LLVM.Analysis
import LLVM.Exception
import LLVM.Target
import qua... |
728bc0499843d056f21e7554fb5072cb71a3dfdc75cad9ef16856d8c503eec72 | wireless-net/erlang-nommu | dtls_record.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2013 - 2014 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/ssl/src/dtls_record.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2013 - 2014 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
Purpose : Handle DTLS record protocol . ... |
e7c65c9947d9f36a4c5151e349d972aae89af2a27a763e0e571670834d9ee485 | vernemq/vmq_mzbench | vmq_parser.erl | -module(vmq_parser).
-include("vmq_types.hrl").
-export([parse/1, parse/2, serialise/1]).
-dialyzer({no_match, utf8/1}).
-export([gen_connect/2,
gen_connack/0,
gen_connack/1,
gen_connack/2,
gen_publish/4,
gen_puback/1,
gen_pubrec/1,
gen_pubrel/1,
... | null | https://raw.githubusercontent.com/vernemq/vmq_mzbench/640a6eb73b2ea35f874b798c8480ca91abff59d8/src/vmq_parser.erl | erlang | frame types
no max size limit
reserved
reserved
for test purposes
for test purposes, useful if you want to encode an empty string..
for test purposes
packet generator functions (useful for testing) | -module(vmq_parser).
-include("vmq_types.hrl").
-export([parse/1, parse/2, serialise/1]).
-dialyzer({no_match, utf8/1}).
-export([gen_connect/2,
gen_connack/0,
gen_connack/1,
gen_connack/2,
gen_publish/4,
gen_puback/1,
gen_pubrec/1,
gen_pubrel/1,
... |
e10f54207a5d0a9625f19ba02e7e612e2f2aab42e4fdb1328913501b6cb5952f | hpdeifel/hledger-iadd | DateParserSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module DateParserSpec (spec) where
import Test.Hspec
import Test.QuickCheck
import Control.Monad
import Data.Either
import Data.Text (Text)
import qualified Data.Text as T
import Data.... | null | https://raw.githubusercontent.com/hpdeifel/hledger-iadd/782239929d411bce4714e65dd5c7bb97b2ba4e75/tests/DateParserSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - orphans #
module DateParserSpec (spec) where
import Test.Hspec
import Test.QuickCheck
import Control.Monad
import Data.Either
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time
import Data.Time.Cal... |
f571fcd967d68de623011304ecfa7b1f2e65bf57b32a4851e842028072cb34fb | TrustInSoft/tis-kernel | ival.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/kernel_services/abstract_interp/ival.ml | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
356a63269fe48a370c661df651af8dcfe0c60fe2642dd5524561ecfcfdd85960 | typelead/eta | tc061.hs | module ShouldSucceed where
class Eq1 a where
deq :: a -> a -> Bool
instance (Eq1 a) => Eq1 [a] where
deq (a:as) (b:bs) = deq a b
instance Eq1 Int where
deq x y = True
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tc061.hs | haskell | module ShouldSucceed where
class Eq1 a where
deq :: a -> a -> Bool
instance (Eq1 a) => Eq1 [a] where
deq (a:as) (b:bs) = deq a b
instance Eq1 Int where
deq x y = True
| |
bebcc086ee761a9f2e93a07936e8c20c8488f7e931b0d8f92049bc07f83602e1 | lisp-mirror/cl-tar | extract.lisp | ;;;; This is part of cl-tar. See README.md and LICENSE for more information.
(in-package #:tar-extract)
(defvar *deferred-links*)
(defvar *deferred-directories*)
#+tar-extract-use-openat
(defvar *destination-dir-fd*)
;;; Directory permissions
#+tar-extract-use-openat
(defun handle-deferred-directory (entry pn
... | null | https://raw.githubusercontent.com/lisp-mirror/cl-tar/8369f16b51dfe04dc68c2ebf146c769d4bc7d471/src/extract/extract.lisp | lisp | This is part of cl-tar. See README.md and LICENSE for more information.
Directory permissions
Symbolic links
Extracting entries
There's no great portable to get a file descriptor for a symlink,
so we have to change utimes and owner by pathname.
Extract archive |
(in-package #:tar-extract)
(defvar *deferred-links*)
(defvar *deferred-directories*)
#+tar-extract-use-openat
(defvar *destination-dir-fd*)
#+tar-extract-use-openat
(defun handle-deferred-directory (entry pn
&key
touch no-same-owner numeric-u... |
44d577f341909e37904eda440d83277c5d627ec76aa77cddedb0a478a830f671 | Innf107/cobble-compiler | Context.hs | # LANGUAGE TemplateHaskell #
module Cobble.Util.Polysemy.Context where
import Cobble.Prelude
data Context c m a where
GetContext :: Context c m (Seq c)
WithContext :: c -> m a -> Context c m a
ModifyContext :: (Seq c -> Seq c) -> m a -> Context c m a
makeSem ''Context
runContext :: Sem (Context c : ... | null | https://raw.githubusercontent.com/Innf107/cobble-compiler/d6b0b65dad0fd6f1d593f7f859b1cc832e01e21f/src/Cobble/Util/Polysemy/Context.hs | haskell | # LANGUAGE TemplateHaskell #
module Cobble.Util.Polysemy.Context where
import Cobble.Prelude
data Context c m a where
GetContext :: Context c m (Seq c)
WithContext :: c -> m a -> Context c m a
ModifyContext :: (Seq c -> Seq c) -> m a -> Context c m a
makeSem ''Context
runContext :: Sem (Context c : ... | |
45211ed5efd8f3e2612306df8f6590e742d28885a7b47d772cadfe834654b066 | finnishtransportagency/harja | kuittaus_sampoon_sanoma.clj | (ns harja.palvelin.integraatiot.sampo.sanomat.kuittaus-sampoon-sanoma
(:require [hiccup.core :refer [html]]
[taoensso.timbre :as log]
[harja.tyokalut.xml :as xml]
[clojure.data.zip.xml :as z])
(:import (java.text SimpleDateFormat)
(java.util Date)))
(def +xsd-polku+ "... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/488b1e096f0611e175221d74ba4f2ffed6bea8f1/src/clj/harja/palvelin/integraatiot/sampo/sanomat/kuittaus_sampoon_sanoma.clj | clojure | (ns harja.palvelin.integraatiot.sampo.sanomat.kuittaus-sampoon-sanoma
(:require [hiccup.core :refer [html]]
[taoensso.timbre :as log]
[harja.tyokalut.xml :as xml]
[clojure.data.zip.xml :as z])
(:import (java.text SimpleDateFormat)
(java.util Date)))
(def +xsd-polku+ "... | |
85979b7c7b870b51e83d25a96fcf7dded40b455978eb101853e29234e2e1b27a | souenzzo/eql-as | eql_as.cljc | (ns br.com.souenzzo.eql-as)
| null | https://raw.githubusercontent.com/souenzzo/eql-as/d33de8d1b4428d99c25e0d95b008fe4e3e842f24/src/main/br/com/souenzzo/eql_as.cljc | clojure | (ns br.com.souenzzo.eql-as)
| |
e723f779b6e537d21429f4b9b9886930b63c6a5050c13747e8443ae5aadbbea0 | Clozure/ccl-tests | write-sequence.lsp | ;-*- Mode: Lisp -*-
Author :
Created : We d Jan 21 04:07:58 2004
;;;; Contains: Tests of WRITE-SEQUENCE
(in-package :cl-test)
(defmacro def-write-sequence-test (name input args &rest expected)
`(deftest ,name
(let ((s ,input))
(with-output-to-string
(os)
(assert (eq (write-sequence s ... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/write-sequence.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of WRITE-SEQUENCE
on strings
on lists
on vectors
on vectors with fill pointers
on bit vectors
Error tests | Author :
Created : We d Jan 21 04:07:58 2004
(in-package :cl-test)
(defmacro def-write-sequence-test (name input args &rest expected)
`(deftest ,name
(let ((s ,input))
(with-output-to-string
(os)
(assert (eq (write-sequence s os ,@args) s))))
,@expected))
(def-write-sequence-test w... |
6f2400aa6467ff4b4f66078aea297ac46027390568f8b3461e849ba16fc4038d | 1HaskellADay/1HAD | Exercise.hs | module HAD.Y2014.M03.D18.Exercise where
-- $setup
-- >>> import Data.Maybe
-- >>> let backPartner = (>>= partner) . (>>= partner)
data Person a = Single a | Married a (Person a)
partner :: Person a -> Maybe (Person a)
partner (Married _ p) = Just p
partner _ = Nothing
get :: Person a -> a
get (Single x) = x
get ... | null | https://raw.githubusercontent.com/1HaskellADay/1HAD/3b3f9b7448744f9b788034f3aca2d5050d1a5c73/exercises/HAD/Y2014/M03/D18/Exercise.hs | haskell | $setup
>>> import Data.Maybe
>>> let backPartner = (>>= partner) . (>>= partner)
| wedding
Marry single people, linking them together
Nothing if one is married
Examples:
>>> isNothing $ wedding (Married "foo" (Single "foobar")) (Single "bar")
True
| module HAD.Y2014.M03.D18.Exercise where
data Person a = Single a | Married a (Person a)
partner :: Person a -> Maybe (Person a)
partner (Married _ p) = Just p
partner _ = Nothing
get :: Person a -> a
get (Single x) = x
get (Married x _) = x
If you 're used to Haskell , this one should be VERY easy .
But rem... |
aa6131b007666e13ddcc2bff9a614404d917bec66efec2f23471686fec13a9d7 | johnlinvc/erruby | erruby_nil.erl | -module(erruby_nil).
-export([new_nil/1, install_nil_class/0, nil_instance/0]).
install_nil_class() ->
{ok, NilClass} = erruby_class:new_class(),
'NilClass' = erruby_object:def_global_const('NilClass', NilClass),
erruby_object:def_method(NilClass, '&', fun method_and/2),
erruby_object:def_method(NilClass, '^',... | null | https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erruby_nil.erl | erlang | -module(erruby_nil).
-export([new_nil/1, install_nil_class/0, nil_instance/0]).
install_nil_class() ->
{ok, NilClass} = erruby_class:new_class(),
'NilClass' = erruby_object:def_global_const('NilClass', NilClass),
erruby_object:def_method(NilClass, '&', fun method_and/2),
erruby_object:def_method(NilClass, '^',... | |
93b1bacb66df90d677eaeb32f66a39735285f4466d9b758794a02b37171443a6 | FreeProving/free-compiler | KindCheckPassTests.hs | | This module contains tests for " . " .
module FreeC.Pass.KindCheckPassTests ( testKindCheckPass ) where
import Test.Hspec
import FreeC.Monad.Class.Testable
import FreeC.Pass.KindCheckPass
import FreeC.Test.Environment
import FreeC.Test.Parser
| Test group for... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/test/FreeC/Pass/KindCheckPassTests.hs | haskell | types. | | This module contains tests for " . " .
module FreeC.Pass.KindCheckPassTests ( testKindCheckPass ) where
import Test.Hspec
import FreeC.Monad.Class.Testable
import FreeC.Pass.KindCheckPass
import FreeC.Test.Environment
import FreeC.Test.Parser
| Test group for... |
93d9afe0258736f118e5f971e34509c609e3e34d8fc7474721c0c7c3c377ac7f | mzp/coq-ide-for-ios | extraction_plugin_mod.ml | let _=Mltop.add_known_module"Table"
let _=Mltop.add_known_module"Mlutil"
let _=Mltop.add_known_module"Modutil"
let _=Mltop.add_known_module"Extraction"
let _=Mltop.add_known_module"Common"
let _=Mltop.add_known_module"Ocaml"
let _=Mltop.add_known_module"Haskell"
let _=Mltop.add_known_module"Scheme"
let _=Mltop.... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/coq-8.2pl2/plugins/extraction/extraction_plugin_mod.ml | ocaml | let _=Mltop.add_known_module"Table"
let _=Mltop.add_known_module"Mlutil"
let _=Mltop.add_known_module"Modutil"
let _=Mltop.add_known_module"Extraction"
let _=Mltop.add_known_module"Common"
let _=Mltop.add_known_module"Ocaml"
let _=Mltop.add_known_module"Haskell"
let _=Mltop.add_known_module"Scheme"
let _=Mltop.... | |
ae559d276f1263dd700213ebf98bfed6d52f43b2473a977b9a2dd32b91c096d9 | rescript-lang/rescript-compiler | bsb_ninja_file_groups.ml | Copyright ( C ) 2017 , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later versi... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/f25a373f7f42672dc1288c3eb206c476f622b6fa/jscomp/bsb/bsb_ninja_file_groups.ml | ocaml | TODO: add a loc for better error message
FIXME: better names
TODO: we can get rid of absloute path if we fixed the location to be
[lib/bs], better for testing?
;
Bsb_ninja_targets.phony
oc ~order_only_deps:[] ~inputs:[] ~output:group.dir
pseuduo targets per directory | Copyright ( C ) 2017 , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later versi... |
823a481af81ccd73d461c74a61b93e38d7ecd9f984922a8689575372912029b3 | grin-compiler/ghc-wpc-sample-programs | IdiomBrackets.hs | module Agda.Syntax.IdiomBrackets (parseIdiomBracketsSeq) where
import Control.Monad
import Agda.Syntax.Common
import Agda.Syntax.Position
import Agda.Syntax.Concrete
import Agda.Syntax.Concrete.Operators
import Agda.Syntax.Concrete.Pretty ( leftIdiomBrkt, rightIdiomBrkt )
import Agda.Syntax.Scope.Base
import Agda.Sy... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/Syntax/IdiomBrackets.hs | haskell | module Agda.Syntax.IdiomBrackets (parseIdiomBracketsSeq) where
import Control.Monad
import Agda.Syntax.Common
import Agda.Syntax.Position
import Agda.Syntax.Concrete
import Agda.Syntax.Concrete.Operators
import Agda.Syntax.Concrete.Pretty ( leftIdiomBrkt, rightIdiomBrkt )
import Agda.Syntax.Scope.Base
import Agda.Sy... | |
2b5b60fbf652af7fb88e27aa49f5184314c81c35a4d076a6fe4e3722a1acc94b | mcorbin/meuse | error.clj | (ns meuse.interceptor.error
(:require [meuse.error :as err]
[meuse.log :as log]
[meuse.metric :as metric]
[exoscale.ex :as ex]))
(defn handle-error
[request e]
(cond
(ex/type? e ::err/user) (err/handle-user-error request e)
(ex/type? e ::err/redirect-login) (err/redire... | null | https://raw.githubusercontent.com/mcorbin/meuse/d2b74543fce37c8cde770ae6f6097cabb509a804/src/meuse/interceptor/error.clj | clojure | (ns meuse.interceptor.error
(:require [meuse.error :as err]
[meuse.log :as log]
[meuse.metric :as metric]
[exoscale.ex :as ex]))
(defn handle-error
[request e]
(cond
(ex/type? e ::err/user) (err/handle-user-error request e)
(ex/type? e ::err/redirect-login) (err/redire... | |
15b2741318f9a75ad5073f02838c1468fa5421d262ef96173b1ae584b41bfd7c | gorillalabs/sparkling | dslapi_test.clj | (ns sparkling.ml.dslapi-test
(:require [sparkling.conf :as conf]
[sparkling.core :as s]
[sparkling.ml.core :as m]
[sparkling.ml.classification :as cl]
[sparkling.ml.transform :as xf]
[clojure.test :as t]
[sparkling.ml.validation :as v])
(:impo... | null | https://raw.githubusercontent.com/gorillalabs/sparkling/ffedcc70fd46bf1b48405be8b1f5a1e1c4f9f578/test/sparkling/ml/dslapi_test.clj | clojure | new story to use the middleware pattern
tell the classifier to look for the modified features
sensible defaults
add options for the estimator & evaluator
add options for the handler
train-validation splits
defaults for train-test split validator
set the train-test split ratio
run grid search over regularization parame... | (ns sparkling.ml.dslapi-test
(:require [sparkling.conf :as conf]
[sparkling.core :as s]
[sparkling.ml.core :as m]
[sparkling.ml.classification :as cl]
[sparkling.ml.transform :as xf]
[clojure.test :as t]
[sparkling.ml.validation :as v])
(:impo... |
2075825f04ceaca41fb6f4d87d4c73742acad63d77a8cfe733ea8716eec676d2 | elastic/eui-cljs | context_menu_panel.cljs | (ns eui.context-menu-panel
(:require ["@elastic/eui/lib/components/context_menu/context_menu_panel.js" :as eui]))
(def SIZES eui/SIZES)
(def EuiContextMenuPanel eui/EuiContextMenuPanel)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/context_menu_panel.cljs | clojure | (ns eui.context-menu-panel
(:require ["@elastic/eui/lib/components/context_menu/context_menu_panel.js" :as eui]))
(def SIZES eui/SIZES)
(def EuiContextMenuPanel eui/EuiContextMenuPanel)
| |
133854283b5cd378d61da40d5e7cf684b46233fb46ff3f940740e8bcac7b0d97 | GumTreeDiff/cgum | oset.ml |
* Copyright 2014 , INRIA
*
* This file is part of Cgen . Much of it comes from Coccinelle , which is
* also available under the GPLv2 license
*
* Cgen 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 So... | null | https://raw.githubusercontent.com/GumTreeDiff/cgum/8521aa80fcf4873a19e60ce8c846c886aaefb41b/commons/oset.ml | ocaml | no need virtual, but better to redefine (efficiency)
allow binary methods tricks, generate exception when not good type
generic (not safe) tricks
is_intersect, equal, subset
can be short circuited
just to keep naming conventions
dont work:
method big_union: 'b. ('a -> 'b oset) -> 'b oset = fun f -... |
* Copyright 2014 , INRIA
*
* This file is part of Cgen . Much of it comes from Coccinelle , which is
* also available under the GPLv2 license
*
* Cgen 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 So... |
1471a4add3144fda32074df3502d792ff49e6d874c688b4923f5ebff23479229 | patperry/hs-linear-algebra | Tri.hs | {-# LANGUAGE Rank2Types #-}
-----------------------------------------------------------------------------
-- |
Module : Numeric . LinearAlgebra . Matrix . Tri
Copyright : Copyright ( c ) 2010 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
--
Triangular views of matrices .
... | null | https://raw.githubusercontent.com/patperry/hs-linear-algebra/887939175e03687b12eabe2fce5904b494242a1a/lib/Numeric/LinearAlgebra/Matrix/Tri.hs | haskell | # LANGUAGE Rank2Types #
---------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
* Immutable interface
** Vector multiplication
** Matrix multiplication
** Vector solving
** Matrix solving
* Mutable interface
** Vector multiplication
** Matri... | Module : Numeric . LinearAlgebra . Matrix . Tri
Copyright : Copyright ( c ) 2010 , < >
Maintainer : < >
Triangular views of matrices .
module Numeric.LinearAlgebra.Matrix.Tri (
triMulVector,
triMulMatrix,
triMulMatrixWithScale,
triSolvVector,
triSolvMatrix,
... |
2b483a550d21e8d81601df2d7adc39fc547bcf6fabae70e2bc92f2849ffb9dfd | mrkkrp/parser-combinators | NonEmpty.hs | -- |
-- Module : Control.Applicative.Combinators
Copyright : © 2017 – present
License : BSD 3 clause
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
The module provides ' NonEmpty ' list variants of some of the functions
-- from "Control.Applicative.Co... | null | https://raw.githubusercontent.com/mrkkrp/parser-combinators/290852927db8e252baee8ac7521e153d377e01d3/Control/Applicative/Combinators/NonEmpty.hs | haskell | |
Module : Control.Applicative.Combinators
Stability : experimental
Portability : portable
from "Control.Applicative.Combinators".
@since 0.2.0
| @'some' p@ applies the parser @p@ /one/ or more times and returns a
> word = some letter
should succeed at least once.
@p@. | Copyright : © 2017 – present
License : BSD 3 clause
Maintainer : < >
The module provides ' NonEmpty ' list variants of some of the functions
module Control.Applicative.Combinators.NonEmpty
( some,
endBy1,
someTill,
sepBy1,
sepEndBy1,
)
where
import Control.Applicative h... |
e760a41d9ec7ed99fe7728525b828cbd7ea045f4a823af5e2ac42da7a09d4f77 | ogaml/ogaml | program.ml |
exception Program_error of string
module Uniform = ProgramInternal.Uniform
module Attribute = ProgramInternal.Attribute
type t = ProgramInternal.t
type src = [`File of string | `String of string]
let read_file filename =
let chan = open_in_bin filename in
let len = in_channel_length chan in
let str = B... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/src/graphics/program/program.ml | ocaml |
exception Program_error of string
module Uniform = ProgramInternal.Uniform
module Attribute = ProgramInternal.Attribute
type t = ProgramInternal.t
type src = [`File of string | `String of string]
let read_file filename =
let chan = open_in_bin filename in
let len = in_channel_length chan in
let str = B... | |
0531c2e80cad41a475e44eec6b93b2a87ce2600ff0eccf465f546a53e632dc89 | pavlobaron/ErlangOTPBookSamples | wechselkurs_worker.erl | -module(wechselkurs_worker).
-export([spawn_worker/1, main/0, test1/0, test2/0]).
%%
Interface Funktionen
%%
spawn_worker(Job) ->
Pid = spawn(?MODULE, main,[]),
Pid ! Job.
main() ->
receive
{umrechnen, {Waehrung, Zielwaehrung, Betrag, Kursdatum}, Sender} ->
case wechselkurs_db:find... | null | https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/entwicklung/chapex/src/wechselkurs_worker.erl | erlang |
Tests
| -module(wechselkurs_worker).
-export([spawn_worker/1, main/0, test1/0, test2/0]).
Interface Funktionen
spawn_worker(Job) ->
Pid = spawn(?MODULE, main,[]),
Pid ! Job.
main() ->
receive
{umrechnen, {Waehrung, Zielwaehrung, Betrag, Kursdatum}, Sender} ->
case wechselkurs_db:find_kurs(Wa... |
5abfd527a4b44f31b19722270811a510205f900467223c775df73ffc7236a544 | ofmooseandmen/jord | Models.hs | -- |
Module : Data . Geo . . Models
Copyright : ( c ) 2020
License : BSD3
Maintainer : < >
-- Stability: experimental
-- Portability: portable
--
-- Common ellipsoidal and spherical models.
--
-- This module has been generated.
module Data.Geo.Jord.Models where
import Data.Geo.Jord.E... | null | https://raw.githubusercontent.com/ofmooseandmen/jord/9acd8d9aec817ce05de6ed1d78e025437e1193bf/src/Data/Geo/Jord/Models.hs | haskell | |
Stability: experimental
Portability: portable
Common ellipsoidal and spherical models.
This module has been generated.
| Irland. | Module : Data . Geo . . Models
Copyright : ( c ) 2020
License : BSD3
Maintainer : < >
module Data.Geo.Jord.Models where
import Data.Geo.Jord.Ellipsoids
import Data.Geo.Jord.Ellipsoid
import Data.Geo.Jord.Model
| World Geodetic System 1984 .
data WGS84 =
WGS84
instance Model WGS84... |
73d0ef5e7acfd5bd54dc56f4121a2652c722d3f7ea691549b0de5fe2fe43a61e | offby1/rudybot | analyze-quotes.rkt | ;; Run me in "drRacket"
#lang racket
(require plot)
(module+ test (require rackunit))
;; jordanb says the quotes aren't coming out randomly. I don't
;; particularly believe him, but let's see. I'll find (what look
;; like) quotes in the log, and then measure how often each appears,
;; and then ... somehow ... do so... | null | https://raw.githubusercontent.com/offby1/rudybot/74773ce9c1224813ee963f4d5d8a7748197f6963/analyze-quotes.rkt | racket | Run me in "drRacket"
jordanb says the quotes aren't coming out randomly. I don't
particularly believe him, but let's see. I'll find (what look
like) quotes in the log, and then measure how often each appears,
and then ... somehow ... do some sorta statistical analysis (the
details of which are unclear at the mo... | #lang racket
(require plot)
(module+ test (require rackunit))
(define (bounding-box vecs)
(for/fold ([xmin (vector-ref (car vecs) 0)]
[xmax (vector-ref (car vecs) 0)]
[ymin (vector-ref (car vecs) 1)]
[ymax (vector-ref (car vecs) 1)])
([p (in-list vecs)])
(let ([x ... |
b672f4625d56648fabb870c3ecdbbd729f8305c24cc76b6467e97a3e6ff5481d | typedclojure/typedclojure | zip.clj | (ns clojure.core.typed.test.zip
(:require [typed.clojure :as t]
[clojure.test :refer :all]
[typed.clj.checker.test-utils :refer :all]))
(deftest zipper-test
(is-tc-e #(zipper vector? seq (fn [_ c] c) "abc")
[-> (t/Vec t/Any)]
:requires [[clojure.zip :r... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/5fd7cdf7941c6e7d1dd5df88bf44474fa35e1fca/typed/clj.checker/test/clojure/core/typed/test/zip.clj | clojure | (ns clojure.core.typed.test.zip
(:require [typed.clojure :as t]
[clojure.test :refer :all]
[typed.clj.checker.test-utils :refer :all]))
(deftest zipper-test
(is-tc-e #(zipper vector? seq (fn [_ c] c) "abc")
[-> (t/Vec t/Any)]
:requires [[clojure.zip :r... | |
c41e5cc4191705f01ad7ac1eda54eb24fa00b14b8ec917feccae992f6bbdf09f | ocaml-multicore/ocaml-effects-tutorial | generator.ml | type ('elt,'container) iterator = ('elt -> unit) -> 'container -> unit
type 'elt generator = unit -> 'elt option
(* Original solution *)
(* let generate (type elt) (i : (elt, 'container) iterator) (c : 'container) : elt generator = *)
(* let module M = struct effect Yield : elt -> unit end in *)
(* let open M in ... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-effects-tutorial/998376931b7fdaed5d54cb96b39b301b993ba995/sources/solved/generator.ml | ocaml | Original solution
let generate (type elt) (i : (elt, 'container) iterator) (c : 'container) : elt generator =
let module M = struct effect Yield : elt -> unit end in
let open M in
let rec step = ref (fun () ->
i (fun v -> perform (Yield v)) c;
step := (fun () -> None);
None)
in
... | type ('elt,'container) iterator = ('elt -> unit) -> 'container -> unit
type 'elt generator = unit -> 'elt option
let generate (type elt) (i : (elt, 'container) iterator) (c : 'container) : elt generator =
let open Effect in
let open Effect.Shallow in
let module M = struct
type _ Effect.t +=
Yie... |
4cb76f13744811d41b6ae0af45844f7cddc9873c4e26e8429453868e4b2a7622 | racket/eopl | interp.rkt | #lang eopl
interpreter for the LETREC language . The \commentboxes are the
;; latex code for inserting the rules into the code in the book.
;; These are too complicated to put here, see the text, sorry.
(require "lang.rkt")
(require "data-structures.rkt")
(require "environments.rkt")
(provide value-of-program va... | null | https://raw.githubusercontent.com/racket/eopl/43575d6e95dc34ca6e49b305180f696565e16e0f/tests/chapter3/letrec-lang/interp.rkt | racket | latex code for inserting the rules into the code in the book.
These are too complicated to put here, see the text, sorry.
the interpreter ;;;;;;;;;;;;;;;;
\commentbox{ (value-of (const-exp \n{}) \r) = \n{}}
\commentbox{ (value-of (var-exp \x{}) \r) = (apply-env \r \x{})}
\commentbox{\diffspec}
\commentbox{\zerotests... | #lang eopl
interpreter for the LETREC language . The \commentboxes are the
(require "lang.rkt")
(require "data-structures.rkt")
(require "environments.rkt")
(provide value-of-program value-of)
value - of - program : Program - > ExpVal
(define value-of-program
(lambda (pgm)
(cases program pgm
(a-... |
a3db4994bf8149b8d5dcc9993bc76f865bb2e7c511047afcf9a90ef30995ab63 | replomancer/Swordfight | cecp_test.clj | (ns swordfight.cecp-test
(:require [midje.sweet :refer [contains fact facts has-suffix namespace-state-changes]]
[swordfight.ai :refer [hurried-move]]
[swordfight.board :refer [->board]]
[swordfight.core :refer [initial-game-settings]]
[swordfight.rules :refer [initial-... | null | https://raw.githubusercontent.com/replomancer/Swordfight/4ac956d0c9076792774dd05db3f258a8c713c49c/test/swordfight/cecp_test.clj | clojure | (ns swordfight.cecp-test
(:require [midje.sweet :refer [contains fact facts has-suffix namespace-state-changes]]
[swordfight.ai :refer [hurried-move]]
[swordfight.board :refer [->board]]
[swordfight.core :refer [initial-game-settings]]
[swordfight.rules :refer [initial-... | |
e8f8efba35e4ea0760c2c31313395dd3c3a9c2aaa399067e0667e08639df6f7d | benoitc/hackney | hackney_http_tests.erl | -module(hackney_http_tests).
-include_lib("eunit/include/eunit.hrl").
-include("hackney_lib.hrl").
parse_response_correct_200_test() ->
Response = <<"HTTP/1.1 200 OK">>,
St = #hparser{},
{response, _Version, StatusInt, Reason, _NState} = hackney_http:parse_response_version(Response, St),
?assertEqual(StatusInt, 20... | null | https://raw.githubusercontent.com/benoitc/hackney/6e79b2bb11a77389d3ba9ff3a0828a45796fe7a8/test/hackney_http_tests.erl | erlang | -module(hackney_http_tests).
-include_lib("eunit/include/eunit.hrl").
-include("hackney_lib.hrl").
parse_response_correct_200_test() ->
Response = <<"HTTP/1.1 200 OK">>,
St = #hparser{},
{response, _Version, StatusInt, Reason, _NState} = hackney_http:parse_response_version(Response, St),
?assertEqual(StatusInt, 20... | |
7acb2bcea30c2901db07c64d34b466734304f48353ddc73e5ad90a305018e1a2 | thumphries/foundationdb | test-io.hs |
import Data.Traversable (sequenceA)
import System.Exit (ExitCode (..), exitWith)
import qualified Test.IO.FoundationDb.C as C
main :: IO ()
main = do
testMain [
C.tests
]
testMain :: [IO Bool] -> IO ()
testMain tests = do
bs <- sequenceA tests
case and bs of
True ->
r... | null | https://raw.githubusercontent.com/thumphries/foundationdb/4feb5dee361970accf90260f16adc7f0d6ba122b/test/test-io.hs | haskell |
import Data.Traversable (sequenceA)
import System.Exit (ExitCode (..), exitWith)
import qualified Test.IO.FoundationDb.C as C
main :: IO ()
main = do
testMain [
C.tests
]
testMain :: [IO Bool] -> IO ()
testMain tests = do
bs <- sequenceA tests
case and bs of
True ->
r... | |
632a02862b4e701c8a03981c3e374fbb9897dc2e981f4ef5589902d14d9168b3 | georgegarrington/Syphon | Type.hs | module Parse.Testing.Type where
import Text.Megaparsec
import Test.Hspec.Megaparsec
import AST.Type
import Parse.Type
import Parse.Testing.Root
testTup = ("(a,b)" `testParse` pType) `shouldParse` (mkTuple [ParsedQuant 'a',ParsedQuant 'b'])
list1 = ("[[a]]" `testParse` pType) `shouldParse` (listConstr `TyApp` (li... | null | https://raw.githubusercontent.com/georgegarrington/Syphon/402a326b482e3ce627a15b651b3097c2e09e8a53/src/Parse/Testing/Type.hs | haskell | module Parse.Testing.Type where
import Text.Megaparsec
import Test.Hspec.Megaparsec
import AST.Type
import Parse.Type
import Parse.Testing.Root
testTup = ("(a,b)" `testParse` pType) `shouldParse` (mkTuple [ParsedQuant 'a',ParsedQuant 'b'])
list1 = ("[[a]]" `testParse` pType) `shouldParse` (listConstr `TyApp` (li... | |
8aa5f2bf4d299ed570e36f1b5ec78d82dda02dd5d2edebd412147d3da18b473d | bollu/koans | recursion-schemes-from-talk.hs | --
foldr :: (Maybe (a, b) -> b) -> [a] -> b
foldr alg [] = alg $ Nothing
foldr alg (x:xs) = alg $ Just(x, foldr alg xs)
| null | https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/recursion-schemes-from-talk.hs | haskell |
foldr :: (Maybe (a, b) -> b) -> [a] -> b
foldr alg [] = alg $ Nothing
foldr alg (x:xs) = alg $ Just(x, foldr alg xs)
| |
72b0fd5276b9b79c252a837e523dfd00544f9a73a2dda321d500050872692bff | spurious/sagittarius-scheme-mirror | bearer.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
rfc / / bearer.scm - Bearer extension
;;;
Copyright ( c ) 2017 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redist... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/rfc/oauth2/bearer.scm | scheme | coding : utf-8 ; -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime... | rfc / / bearer.scm - Bearer extension
Copyright ( c ) 2017 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library ... |
22c4d518c355905a27caf855c5e8e67574c9dca6be66dbf1ba77d57bd35d7abe | RedPRL/cooltt | LexingUtil.ml | include Lexing
type span =
{start : Lexing.position;
stop : Lexing.position}
let pp_span : span Pp.printer =
fun fmt span ->
Format.fprintf fmt "%a:%i.%i-%i.%i"
(* HACK: We use the basename, rather than the full path here
to avoid issues with the test suite. This is bad, and should
be chang... | null | https://raw.githubusercontent.com/RedPRL/cooltt/2e451ab8b02e8b4306aabbfe3f2197d775def343/src/basis/LexingUtil.ml | ocaml | HACK: We use the basename, rather than the full path here
to avoid issues with the test suite. This is bad, and should
be changed once more thought is put into how we want to
handle fancier imports/project structures. | include Lexing
type span =
{start : Lexing.position;
stop : Lexing.position}
let pp_span : span Pp.printer =
fun fmt span ->
Format.fprintf fmt "%a:%i.%i-%i.%i"
Uuseg_string.pp_utf_8 (Filename.basename span.start.pos_fname)
span.start.pos_lnum
(span.start.pos_cnum - span.start.pos_bol)
span.s... |
71fd6a9c7683e80c5e91584755c69b27908eb8c195ab690cc8e9508439c07885 | basho/riak_cs | riak_cs_wm_common.erl | %% ---------------------------------------------------------------------
%%
Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . Y... | null | https://raw.githubusercontent.com/basho/riak_cs/c0c1012d1c9c691c74c8c5d9f69d388f5047bcd2/src/riak_cs_wm_common.erl | erlang | ---------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permiss... | Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
269da5a15de6163b53488efd871094dd0a82ef8bf7607065d3534cf0a5760650 | metosin/reitit | server.clj | (ns example.server
(:require [reitit.http :as http]
[reitit.ring :as ring]
[reitit.interceptor.sieppari]
[sieppari.async.core-async] ;; needed for core.async
[sieppari.async.manifold] ;; needed for manifold
[ring.adapter.jetty :as jetty]
[muunt... | null | https://raw.githubusercontent.com/metosin/reitit/1ab075bd353966636f154ac36ae9b7990efeb008/examples/http/src/example/server.clj | clojure | needed for core.async
needed for manifold | (ns example.server
(:require [reitit.http :as http]
[reitit.ring :as ring]
[reitit.interceptor.sieppari]
[ring.adapter.jetty :as jetty]
[muuntaja.interceptor]
[clojure.core.async :as a]
[manifold.deferred :as d]
[promesa.core :as p]))... |
c555aae4dd215f226f8c26f2428cab43dacea3d6c94c114b6f628e623f4f9f84 | metosin/komponentit | mixins.cljs | (ns komponentit.mixins
(:require [reagent.core :as r]
[clojure.set :as set]
[clojure.string :as string]))
(defn ->event-type [k]
(-> k name (string/replace #"^on-" "") (string/replace #"-" "")))
(defn- update-listeners [el listeners props this]
(swap! listeners
(fn [listeners]
... | null | https://raw.githubusercontent.com/metosin/komponentit/d962ce1d69ccc3800db0d6b4fc18fc2fd30b494a/src/cljs/komponentit/mixins.cljs | clojure | Need to retrieve latest callback in case the props have been updated | (ns komponentit.mixins
(:require [reagent.core :as r]
[clojure.set :as set]
[clojure.string :as string]))
(defn ->event-type [k]
(-> k name (string/replace #"^on-" "") (string/replace #"-" "")))
(defn- update-listeners [el listeners props this]
(swap! listeners
(fn [listeners]
... |
3ce9f2672c7376e35d4e5d2fee0df030b07f05ccc521a37322ff6570a6c28688 | brendanhay/terrafomo | Resources.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
-- Module : Terrafomo.SoftLayer.Resources
Copyright : ( c ) 2017 - 2018
Licens... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-softlayer/gen/Terrafomo/SoftLayer/Resources.hs | haskell | This module is auto-generated.
|
Module : Terrafomo.SoftLayer.Resources
Stability : auto-generated
* softlayer_ssh_key
* softlayer_virtual_guest
^ @name@
- (Required)
^ @notes@
- (Optional)
- (Required, Forces New)
s Text
s Text
Expr s Text
Expr s Text
^ The minimal/required arguments.
| Th... |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
Por... |
8e320cf064386cce3955d8d66935371c937aa982ab3949be4dc2f2d54e1ba30d | ulricha/dsh | Quote.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE StandaloneDeriving #
module Database.DSH.NKL.Quote
( nkl
, ty
, Var
, ExprQ(..)
, TypeQ(..)
, varName
, toExprQ
, fromExprQ
, typeOf
, (.->)
, elemT
, freeVars
) where
import Control.Monad
import ... | null | https://raw.githubusercontent.com/ulricha/dsh/e6cd5c6bea575e62a381e89bfc4cc7cb97485106/src/Database/DSH/NKL/Quote.hs | haskell | # LANGUAGE DeriveDataTypeable #
Antiquotation node
Antiquotation node
------------------------------------------------------------------------
Conversion to and from quotation types
fromExprQ (Table t n cs ks) = NKL.Table (fromTypeQ t) n cs ks
---------------------------------------------------------------------... | # LANGUAGE TemplateHaskell #
# LANGUAGE StandaloneDeriving #
module Database.DSH.NKL.Quote
( nkl
, ty
, Var
, ExprQ(..)
, TypeQ(..)
, varName
, toExprQ
, fromExprQ
, typeOf
, (.->)
, elemT
, freeVars
) where
import Control.Monad
import Data.Functor
import qualified Data.... |
66e7f4678b6ee7f667d28f4cb38c400823ed396564f238b1237c230959b976c5 | penpot/penpot | util_snap_data_test.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.util-snap-data-test
(:require
[app.common.file-builder :as fb]
[app.common.uuid :as... | null | https://raw.githubusercontent.com/penpot/penpot/2ea81c0114fb13ece945b7082aff0bcd7383e563/frontend/test/frontend_tests/util_snap_data_test.cljs | clojure |
Copyright (c) KALEIDOS INC
Center one point
frame-id (:last-id file)
frame-id (:last-id file)
frame-id (:last-id file)
We can snap in the root
We can snap in the frame
frame-id (:last-id file)
We can snap in the root
We can snap in the frame
frame-id (:last-id file)
frame-id (:last-id file)
We can snap in... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns frontend-tests.util-snap-data-test
(:require
[app.common.file-builder :as fb]
[app.common.uuid :as uuid]
[app.util.snap-data :as... |
947e9e68514ba5ae0a89714705f761fcf069782f148afdb6242a2775f06790a3 | cloudant-labs/couchdb-erlfdb | erlfdb_03_transaction_options_test.erl | 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
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/cloudant-labs/couchdb-erlfdb/510664facbc28c946960db2d12b3baf33923f4ea/test/erlfdb_03_transaction_options_test.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(erlfdb_03_transaction_options_test).
-include_lib("eunit/include/eunit.hrl").
get_approximate_tx_size_test() ->
Db1 = erlfdb_util:get_test_db... |
7d881d97683112a22e36ae01377a8e738db25fa0a084908df23c51439ca516bd | ocaml/opam | opamAdminCommand.ml | (**************************************************************************)
(* *)
Copyright 2012 - 2020 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam/88002fb3ec9e827ae8d1885593efc0d18c196d3c/src/client/opamAdminCommand.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2020 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
open OpamTypes
open OpamProcess.Job.Op
open OpamStateTypes
open Cmdliner
type command = unit ... |
b3f8881978c982148d623a6912e02c2a5377ce5ba5549274bb56b2efc176c2c2 | shaunlebron/parinfer | util.clj | (ns parinfer-site.util)
; Case 1: Show the state of a bunch of variables.
;
; > (inspect a b c)
;
a = > 1
; b => :foo-bar
; c => ["hi" "world"]
;
; Case 2: Print an expression and its result.
;
; > (inspect (+ 1 2 3))
;
( + 1 2 3 ) = > 6
;
(defn- inspect-1 [expr]
`(let [result# ~expr]
(js/conso... | null | https://raw.githubusercontent.com/shaunlebron/parinfer/6705c35adbabc90cc0af3bb4ddf3a60c390f93df/site/src/parinfer_site/util.clj | clojure | Case 1: Show the state of a bunch of variables.
> (inspect a b c)
b => :foo-bar
c => ["hi" "world"]
Case 2: Print an expression and its result.
> (inspect (+ 1 2 3))
| (ns parinfer-site.util)
a = > 1
( + 1 2 3 ) = > 6
(defn- inspect-1 [expr]
`(let [result# ~expr]
(js/console.info (str (pr-str '~expr) " => " (pr-str result#)))
result#))
(defmacro inspect [& exprs]
`(do ~@(map inspect-1 exprs)))
|
53f928a72c8c606ab7326ffe26b9b3d3ff2b90c6372d28064c86a27989c77276 | austinhaas/kanren | tests.cljc | (ns pettomato.kanren.cKanren.tests
(:refer-clojure :exclude [==])
(:require
[clojure.test :refer [is deftest]]
[pettomato.kanren.cKanren.cKanren-api :refer [empty-llist llist llist* llist->seq lcons lvar lvar? lvar=? empty-pkg empty-s ext-s unit mzero choice unit? mzero? take* walk* walk reify-var == succeed ... | null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/test/pettomato/kanren/cKanren/tests.cljc | clojure | Most of these tests were taken from core.logic:
=============================================================================
walk*
=============================================================================
run and unify
=============================================================================
fail
===... | (ns pettomato.kanren.cKanren.tests
(:refer-clojure :exclude [==])
(:require
[clojure.test :refer [is deftest]]
[pettomato.kanren.cKanren.cKanren-api :refer [empty-llist llist llist* llist->seq lcons lvar lvar? lvar=? empty-pkg empty-s ext-s unit mzero choice unit? mzero? take* walk* walk reify-var == succeed ... |
4612c623d722e18b2a242791cae3566b41d9b1230991859081e6662f1b8b1f58 | oakes/play-clj-examples | desktop_launcher.clj | (ns super-koalio.core.desktop-launcher
(:require [super-koalio.core :refer :all])
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
[org.lwjgl.input Keyboard])
(:gen-class))
(defn -main
[]
(LwjglApplication. super-koalio "super-koalio" 800 600)
(Keyboard/enableRepeatEvents true))
| null | https://raw.githubusercontent.com/oakes/play-clj-examples/449a505a068faeeb35d4ee4622c6a05e3fff6763/super-koalio/desktop/src/super_koalio/core/desktop_launcher.clj | clojure | (ns super-koalio.core.desktop-launcher
(:require [super-koalio.core :refer :all])
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
[org.lwjgl.input Keyboard])
(:gen-class))
(defn -main
[]
(LwjglApplication. super-koalio "super-koalio" 800 600)
(Keyboard/enableRepeatEvents true))
| |
5f346095af33137ba36102024423410570daf5271b599b4176f034fde7b18a64 | rtoy/cmucl | values.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Base : 10 ; Package : x86 -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to use this ... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/amd64/values.lisp | lisp | Syntax : Common - Lisp ; Base : 10 ; Package : x86 -*-
**********************************************************************
**********************************************************************
This file contains the implementation of unknown-values VOPs.
Push some values onto the stack, returning the sta... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to use this code or any part of CMU Common Lisp , please contact
or .
(ext:file-comment
"$Header: src/compiler/amd64/values.lisp $")
Written by .
by S... |
6d9c324a305975bc8039b773e196ab3c43c92ab5288c543ca7560bb3e07daca3 | kandersen/dpc | DistributedLocking.hs | {-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
module DPC.Examples.DistributedLocking where
import DPC.Types
import DPC.Specifications
data State = ClientInit NodeID NodeID Int
| ClientAcquired NodeID NodeID Int Int
| ClientUpdateDone NodeID Int
| ClientDone
... | null | https://raw.githubusercontent.com/kandersen/dpc/c2d40a4bbbc1a3bd3f1a0b1b827786e76c5b1bb0/examples/DPC/Examples/DistributedLocking.hs | haskell | # LANGUAGE RecordWildCards # | # LANGUAGE ScopedTypeVariables #
module DPC.Examples.DistributedLocking where
import DPC.Types
import DPC.Specifications
data State = ClientInit NodeID NodeID Int
| ClientAcquired NodeID NodeID Int Int
| ClientUpdateDone NodeID Int
| ClientDone
| LockIdle Int
| L... |
8375541de90c78441d8de5ce92ebfcc18c0dcc3153a5d9d8dcc1db72ace4d413 | manuel-serrano/hop | color.scm | ;*=====================================================================*/
* serrano / prgm / project / hop/2.2.x / runtime / color.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/runtime/color.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Simple color tools */
*===========================... | * serrano / prgm / project / hop/2.2.x / runtime / color.scm * /
* Author : * /
* Creation : Thu Feb 2 15:42:45 2006 * /
* Last change : We d Nov 16 11:53:17 2011 ( serrano ) * /
* Copy... |
293087c97cbe488a22742aea03312f0c67adfdd48c1e6aed58d6113afeef6817 | cartazio/tlaps | loc.mli |
* loc.mli --- source locations
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* loc.mli --- source locations
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
(** Source locations *)
(** A location represents a col in a source file *)
type pt_ = { line : int ;
... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/loc.mli | ocaml | * Source locations
* A location represents a col in a source file
* A location that is always invalid (but both = and == itself).
* The character offset of a location in a file. Raises [Failure
"Loc.point"] if the location is a dummy.
* String representation of a location. The [file] argument is by
default ... |
* loc.mli --- source locations
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* loc.mli --- source locations
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
type pt_ = { line : int ;
bol : int ;
col : int ;
}
type pt =... |
44033c0d03b6f970ed93c9a0fc6987ab5c893a8354f287b07688332f2492828f | nuvla/api-server | spec.cljc | (ns sixsq.nuvla.server.util.spec
"Utilities that provide common spec definition patterns that aren't
supported directly by the core spec functions and macros."
(:require
[clojure.set :as set]
[clojure.spec.alpha :as s]
[spec-tools.impl :as impl]
[spec-tools.json-schema :as jsc]
[spec-tools.pa... | null | https://raw.githubusercontent.com/nuvla/api-server/c11e45419af02b4bd514af10b640aa76c62072fe/code/src/sixsq/nuvla/server/util/spec.cljc | clojure |
spec parsing patches
patches for spec walking via visitor
accept-spec monkey patches
| (ns sixsq.nuvla.server.util.spec
"Utilities that provide common spec definition patterns that aren't
supported directly by the core spec functions and macros."
(:require
[clojure.set :as set]
[clojure.spec.alpha :as s]
[spec-tools.impl :as impl]
[spec-tools.json-schema :as jsc]
[spec-tools.pa... |
f275e544b7701b72d93cdb20074cded42f12928a5da19be13e1fcec89a7e7d53 | mathematical-systems/clml | ihmm.lisp | generalized sticky and blocked HDP - HMM
(defpackage :nonparametric.ihmm
(: nicknames : ihmm )
(:use :cl :hjs.util.meta
:nonpara.stat
:nonparametric.dpm
:nonparametric.hdp
:nonparametric.hdp-hmm
:nonparametric.sticky-hdp-hmm
:nonparametric.blocked-hdp-hmm)
(:export :ihmm
:ihmm-state
:ihmm-state-un... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/nonparametric/ihmm.lisp | lisp | copy
sort spi
sort before
for compare | generalized sticky and blocked HDP - HMM
(defpackage :nonparametric.ihmm
(: nicknames : ihmm )
(:use :cl :hjs.util.meta
:nonpara.stat
:nonparametric.dpm
:nonparametric.hdp
:nonparametric.hdp-hmm
:nonparametric.sticky-hdp-hmm
:nonparametric.blocked-hdp-hmm)
(:export :ihmm
:ihmm-state
:ihmm-state-un... |
2f30ae61f429bf6db2747bc8c9f9fc84e656fc9cc30e08418313853da731fbcf | smimram/saml | lang.ml | (** Internal representation of the language and operations to manipulate it
(typechecking, reduction, etc.). *)
open Extralib
open Common
module T = Type
(** An expression. *)
type t =
{
desc : desc; (** The expression. *)
pos : pos; (** Position in source file. *)
t : T.t; (** Type. *)
}
(** Co... | null | https://raw.githubusercontent.com/smimram/saml/6166a80decdf4ebb0da1d7dd74a9dd22cf65e3eb/src/lang.ml | ocaml | * Internal representation of the language and operations to manipulate it
(typechecking, reduction, etc.).
* An expression.
* The expression.
* Position in source file.
* Type.
* Contents of an expression.
* A variable.
* A function.
* A variable declaration.
* A method.
* A field.
* A closure.
* Type c... |
open Extralib
open Common
module T = Type
type t =
{
}
and desc =
| Bool of bool
| Int of int
| Float of float
| String of string
| FFI of ffi
| App of t * t
| Seq of t * t
| Tuple of t list
and pattern =
| PVar of string
and ffi =
{
ffi_name : string;
}
and environment = (string * ... |
c90c0a2839acca57a2bd66cd7aed5e4353db3dc9f67e7258feb730f70bc0601b | flowyourmoney/malli-ts | to_clj.cljs | (ns malli-ts.data-mapping.to-clj
(:require
[malli-ts.core :as-alias mts]
[malli-ts.data-mapping :as mts-dm]
[malli.core :as m]
[cljs-bean.core :as b :refer [bean?]]))
(defn unwrap [v]
(when v
(or (unchecked-get v "unwrap/clj")
(when (bean? v) v))))
(deftype BeanContext ... | null | https://raw.githubusercontent.com/flowyourmoney/malli-ts/478b5dd190cbdc7a494c03e958ec65d53232441a/src/malli_ts/data_mapping/to_clj.cljs | clojure | else
else
else
else
else | (ns malli-ts.data-mapping.to-clj
(:require
[malli-ts.core :as-alias mts]
[malli-ts.data-mapping :as mts-dm]
[malli.core :as m]
[cljs-bean.core :as b :refer [bean?]]))
(defn unwrap [v]
(when v
(or (unchecked-get v "unwrap/clj")
(when (bean? v) v))))
(deftype BeanContext ... |
19933aa3279b19dd0483a936ed333a79a5b1774a1450f7a6a13d735d8ddd4738 | andrewthad/haskell-ip | IPv4TextVariableBuilder.hs | module IPv4TextVariableBuilder where
import Net.Types (IPv4(..))
import Data.Text (Text)
import Data.Monoid
import Data.Word
import Data.Bits
import qualified Net.IPv4 as IPv4
import qualified Data.Text as Text
import qualified Data.Text.Builder.Variable as VB
encode :: IPv4 -> Text
encode = VB.run variableBuilder
v... | null | https://raw.githubusercontent.com/andrewthad/haskell-ip/4782c5cb44aa6e04c9dbfb4c43909a07ff668216/test/IPv4TextVariableBuilder.hs | haskell | module IPv4TextVariableBuilder where
import Net.Types (IPv4(..))
import Data.Text (Text)
import Data.Monoid
import Data.Word
import Data.Bits
import qualified Net.IPv4 as IPv4
import qualified Data.Text as Text
import qualified Data.Text.Builder.Variable as VB
encode :: IPv4 -> Text
encode = VB.run variableBuilder
v... | |
745d73392b58cd72ae8b97edbf02483761c1d795a7ac98b982212a55e95e89cc | xhtmlboi/yocaml | validate.ml | type 'a t = ('a, Error.t Preface.Nonempty_list.t) Preface.Validation.t
let valid x = Preface.Validation.Valid x
let invalid x = Preface.Validation.Invalid x
let error x = invalid (Preface.Nonempty_list.create x)
let pp inner_pp = Preface.(Validation.pp inner_pp (Nonempty_list.pp Error.pp))
let equal inner_eq =
Pref... | null | https://raw.githubusercontent.com/xhtmlboi/yocaml/3d169cdaaec6f84f841b4212d232c1ee6f749b01/lib/yocaml/validate.ml | ocaml | type 'a t = ('a, Error.t Preface.Nonempty_list.t) Preface.Validation.t
let valid x = Preface.Validation.Valid x
let invalid x = Preface.Validation.Invalid x
let error x = invalid (Preface.Nonempty_list.create x)
let pp inner_pp = Preface.(Validation.pp inner_pp (Nonempty_list.pp Error.pp))
let equal inner_eq =
Pref... | |
10ad047e792ff8f3ce880d0a96e75238c5115aa97bf969e02ed35972f72e6da4 | sgbj/MaximaSharp | brmbrg.lisp | ;;; -*- Lisp -*-
(defvar $brombergit 11)
(defvar $brombergmin 0)
1.b-4
0.0b0
(defun fpscale (x m)
(if (equal (car x) 0)
x
(list (car x) (+ (cadr x) m))))
(defun bfmeval3 (x1)
(cond (($bfloatp (setq x1 ($bfloat (meval x1)))) (cdr x1))
(t (displa x1) (merror "bromberg: encountered a non-bigfloat."... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/numeric/brmbrg.lisp | lisp | -*- Lisp -*- |
(defvar $brombergit 11)
(defvar $brombergmin 0)
1.b-4
0.0b0
(defun fpscale (x m)
(if (equal (car x) 0)
x
(list (car x) (+ (cadr x) m))))
(defun bfmeval3 (x1)
(cond (($bfloatp (setq x1 ($bfloat (meval x1)))) (cdr x1))
(t (displa x1) (merror "bromberg: encountered a non-bigfloat."))))
(defun bqev... |
5417d33f83f8f2c1db5d9ff1168edba6ca311f2d1190ae90f302d22bdd8e9072 | Carnap/Carnap | Util.hs | # LANGUAGE KindSignatures , GADTs , FlexibleContexts , MultiParamTypeClasses , FunctionalDependencies #
module Carnap.Calculi.Util where
import Data.Tree
import Data.Map (Map)
import Carnap.Core.Data.Types
import Carnap.Core.Data.Classes
import Carnap.Core.Unification.Unification
import Carnap.Core.Unification.FirstOr... | null | https://raw.githubusercontent.com/Carnap/Carnap/1b54e377d1f7a08a3455fa626eef05aee186421a/Carnap/src/Carnap/Calculi/Util.hs | haskell | module
local restrictions, based only on given substitutions
meant for blanks | # LANGUAGE KindSignatures , GADTs , FlexibleContexts , MultiParamTypeClasses , FunctionalDependencies #
module Carnap.Calculi.Util where
import Data.Tree
import Data.Map (Map)
import Carnap.Core.Data.Types
import Carnap.Core.Data.Classes
import Carnap.Core.Unification.Unification
import Carnap.Core.Unification.FirstOr... |
1bded2d31eebde2792698ae76874138b2769e739b58fd2121a22bd7e7c9d9ddf | nurpax/snaplet-sqlite-simple | Tests.hs | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
module Tests
( tests
, testsDbInit) where
------------------------------------------------------------------------------
import Control.Error
import Control.Monad.State as S
import qualified Data.Aeson as A
import qualified Data.ByteString.... | null | https://raw.githubusercontent.com/nurpax/snaplet-sqlite-simple/f19f0ff9018f3886544901bdacda133a42bc2476/test/Tests.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Empty db
C... | # LANGUAGE OverloadedStrings , ScopedTypeVariables #
module Tests
( tests
, testsDbInit) where
import Control.Error
import Control.Monad.State as S
import qualified Data.Aeson as A
import qualified Data.ByteString.Char8 as BL
import qualified Data.HashMap.Lazy as HM
import qualified Data.Map ... |
a3ba0ee6fcdf93710e56751981e1e3de3bc0f7940819fc91ff5c2cb4ede6b9bc | exoscale/clojure-kubernetes-client | v1_local_object_reference.clj | (ns clojure-kubernetes-client.specs.v1-local-object-reference
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1-local-object-reference-data v1-local-object-reference)
(def v1-local-object-reference-data
{
(ds/opt :name) string?
... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_local_object_reference.clj | clojure | (ns clojure-kubernetes-client.specs.v1-local-object-reference
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1-local-object-reference-data v1-local-object-reference)
(def v1-local-object-reference-data
{
(ds/opt :name) string?
... | |
c10b2d39657f0a78cfbd1b0006de9bced3004fb2ca14bb16745ec7d0638c83fb | dcastro/haskell-flatbuffers | Generated.hs | # LANGUAGE TemplateHaskell #
module Examples.Generated where
import FlatBuffers ( defaultOptions, mkFlatBuffers )
$(mkFlatBuffers "test/Examples/schema.fbs" defaultOptions)
$(mkFlatBuffers "test/Examples/vector_of_unions.fbs" defaultOptions)
| null | https://raw.githubusercontent.com/dcastro/haskell-flatbuffers/cea6a75109de109ae906741ee73cbb0f356a8e0d/test/Examples/Generated.hs | haskell | # LANGUAGE TemplateHaskell #
module Examples.Generated where
import FlatBuffers ( defaultOptions, mkFlatBuffers )
$(mkFlatBuffers "test/Examples/schema.fbs" defaultOptions)
$(mkFlatBuffers "test/Examples/vector_of_unions.fbs" defaultOptions)
| |
3b94fcf12fd964ee56148a54e2bbc36c03683039de8da84d7ddb351d0354bbbd | haskell/haskell-language-server | PunShadowing.expected.hs | data Bar = Bar { ax :: Int, bax :: Bool }
bar :: () -> Bar -> Int
bar ax Bar {ax = n, bax} = _w0
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/PunShadowing.expected.hs | haskell | data Bar = Bar { ax :: Int, bax :: Bool }
bar :: () -> Bar -> Int
bar ax Bar {ax = n, bax} = _w0
| |
31a6a0336187ddc68728bdaedff931f9efdc1c54e3e923fdcf82bd66919c84b3 | metaocaml/ber-metaocaml | pr9019.ml | (* TEST
* expect
*)
# 9012 by
type ab = A | B
module M : sig
type mab = A | B
type _ t = AB : ab t | MAB : mab t
val ab : mab t
end = struct
type mab = ab = A | B
type _ t = AB : ab t | MAB : mab t
let ab = AB
end
[%%expect{|
type ab = A | B
module M :
sig type mab = A | B type _ t = AB : ab t |... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/typing-gadts/pr9019.ml | ocaml | TEST
* expect
variant
using records
Another example
More polymorphic variants |
# 9012 by
type ab = A | B
module M : sig
type mab = A | B
type _ t = AB : ab t | MAB : mab t
val ab : mab t
end = struct
type mab = ab = A | B
type _ t = AB : ab t | MAB : mab t
let ab = AB
end
[%%expect{|
type ab = A | B
module M :
sig type mab = A | B type _ t = AB : ab t | MAB : mab t val ab : m... |
e2993e690a0b00d920cfe741dda59b6278bd70b752498aefe9a9a19a5a4c7276 | returntocorp/semgrep | Src_file.ml | (*
Keep a copy of the source input, suitable for returning source code
from ranges of locations.
*)
open Printf
type source = File of string | Stdin | String | Channel
(* The contents of the source document. *)
type t = { source : source; contents : string }
let source x = x.source
let show_source = function... | null | https://raw.githubusercontent.com/returntocorp/semgrep/6e182e59a3d7cb8d3c837032dd2fc51091098c10/libs/spacegrep/src/lib/Src_file.ml | ocaml |
Keep a copy of the source input, suitable for returning source code
from ranges of locations.
The contents of the source document.
This needs to work on named pipes such as those created by bash with
so-called "process substitution" (for those, 'in_channel_length' returns
but then we can't read the... |
open Printf
type source = File of string | Stdin | String | Channel
type t = { source : source; contents : string }
let source x = x.source
let show_source = function
| File s -> s
| Stdin -> "<stdin>"
| String -> "<string>"
| Channel -> "<channel>"
let source_string x = x |> source |> show_source
let con... |
3447aa37095f029aaa23109f9f92fc6871e1f9b1de4f988b23039bfa703091b7 | uxbox/uxbox-old | db.cljs | (ns uxbox.data.db
(:require
[datascript :as d]
[uxbox.data.schema :as sch]))
(defn create
[]
(let [conn (d/create-conn sch/schema)]
conn))
(defn restore!
[conn storage]
;; todo: handle diverging schemas, per-user storage key?
(when-let [old-db (get storage ::datoms)]
(reset! conn old-db)))
... | null | https://raw.githubusercontent.com/uxbox/uxbox-old/9c3c3c406a6c629717cfc40e3da2f96df3bdebf7/src/frontend/uxbox/data/db.cljs | clojure | todo: handle diverging schemas, per-user storage key? | (ns uxbox.data.db
(:require
[datascript :as d]
[uxbox.data.schema :as sch]))
(defn create
[]
(let [conn (d/create-conn sch/schema)]
conn))
(defn restore!
[conn storage]
(when-let [old-db (get storage ::datoms)]
(reset! conn old-db)))
(defn persist-to!
[conn storage]
(d/listen! conn
... |
9f60d0ff022b0bd0d68be8291850e454d4f0abc8d255b21771f8fe3abf5b64f7 | ocaml-batteries-team/batteries-included | batDeque.mli |
* Deque -- functional double - ended queues
* Copyright ( C ) 2011 Batteries Included Development Team
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* ... | null | https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/f143ef5ec583d87d538b8f06f06d046d64555e90/src/batDeque.mli | ocaml | * Functional double-ended queues
* The type of double-ended queues
* A synonym for convenience
* {6 Construction}
* The empty deque.
* {6 Deconstruction}
* [front dq] returns [Some (x, dq')] iff [x] is at the front of
[dq] and [dq'] is the rest of [dq] excluding [x], and [None] if
[dq] has no elements. O(... |
* Deque -- functional double - ended queues
* Copyright ( C ) 2011 Batteries Included Development Team
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* ... |
05939e14ffe6926f63eeffa762f005dff25f1e15c8232a6547e5b89d78a3b322 | replikativ/datalog-parser | proto.cljc | (ns datalog.parser.impl.proto)
#?(:clj (set! *warn-on-reflection* true))
(defprotocol ITraversable
(-collect [_ pred acc])
(-collect-vars [_ acc])
(-postwalk [_ f]))
(defprotocol Traversable
(-traversable? [_]))
(defprotocol IFindVars
(-find-vars [this]))
(defprotocol IFindElements
(find-eleme... | null | https://raw.githubusercontent.com/replikativ/datalog-parser/597b6a04fb9d1f5931a40566058620e422a77532/src/datalog/parser/impl/proto.cljc | clojure | (ns datalog.parser.impl.proto)
#?(:clj (set! *warn-on-reflection* true))
(defprotocol ITraversable
(-collect [_ pred acc])
(-collect-vars [_ acc])
(-postwalk [_ f]))
(defprotocol Traversable
(-traversable? [_]))
(defprotocol IFindVars
(-find-vars [this]))
(defprotocol IFindElements
(find-eleme... | |
200e9b73db3630c510fd4ed969c289e16fe4de399d43b52b5ec68b6ebdee29c9 | chanshunli/wechat-clj | core.clj | (ns wechat-clj.public.core
(:require [clj-http.client :as client]
[cheshire.core :as cjson]))
(defn invoke-wx-api-with-cfg-by-get
"微信调用接口辅助函数get"
[cmd form-params]
(let [wx-api-url (format "-bin/%s" cmd)
get-data {:accept :json :query-params form-params}]
(let [resp (client/get wx-api-u... | null | https://raw.githubusercontent.com/chanshunli/wechat-clj/145a99825669b743a09a8565fa1301d90480c91b/src/clj/wechat_clj/public/core.clj | clojure | (ns wechat-clj.public.core
(:require [clj-http.client :as client]
[cheshire.core :as cjson]))
(defn invoke-wx-api-with-cfg-by-get
"微信调用接口辅助函数get"
[cmd form-params]
(let [wx-api-url (format "-bin/%s" cmd)
get-data {:accept :json :query-params form-params}]
(let [resp (client/get wx-api-u... | |
c51035b38a0a352524b697788399826c49f9d1e3208f3345b9e4de154c504437 | binsec/haunted | taint.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/static/ai/domains/taint.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
3903ff982f1f20c6cf1f4bff4a3194adc09561f437358e5be80850b6e6a07562 | 0install/0install | test_qdom.ml | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
open Support
open OUnit
module Q = Support.Qdom
let assert_str_equal = Fake_system.assert_str_equal
let parse_simple s = `String (0, s) |> Xmlm.make_input |> Q.parse_input None
let parse s1... | null | https://raw.githubusercontent.com/0install/0install/22eebdbe51a9f46cda29eed3e9e02e37e36b2d18/src/tests/test_qdom.ml | ocaml | Add a default-ns node to a non-default document
Add a default-ns node to a default-ns document | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
open Support
open OUnit
module Q = Support.Qdom
let assert_str_equal = Fake_system.assert_str_equal
let parse_simple s = `String (0, s) |> Xmlm.make_input |> Q.parse_input None
let parse s1... |
ef1a7128c6b3da0a1be64d8217fc65d511c3022a7eac3e9f10d80721bb33b112 | PLTools/GT | test037.ml | type 'a t1 = [`A | `B of 'a] [@@deriving gt ~show ~gmap]
type 'a t2 = [`C | `D of 'a] [@@deriving gt ~show ~gmap]
type 'a t = ['a t1 | 'a t2] [@@deriving gt ~show ~gmap]
let _ =
let a = `B (`B `A) in
let rec mapt1 x =
GT.fix0 (fun self -> GT.transform(t1) (new gmap_t1 self self) ()) x
in
let rec show1 x ... | null | https://raw.githubusercontent.com/PLTools/GT/62d1a424a3336f2317ba67e447a9ff09d179b583/regression_ppx/test037.ml | ocaml | type 'a t1 = [`A | `B of 'a] [@@deriving gt ~show ~gmap]
type 'a t2 = [`C | `D of 'a] [@@deriving gt ~show ~gmap]
type 'a t = ['a t1 | 'a t2] [@@deriving gt ~show ~gmap]
let _ =
let a = `B (`B `A) in
let rec mapt1 x =
GT.fix0 (fun self -> GT.transform(t1) (new gmap_t1 self self) ()) x
in
let rec show1 x ... | |
ddb9c99655c5f31dcd3f87c58a15b3a6bb9360cc9d3591d3250ef9c421b4cf9d | LLazarek/mutate | low-level.rkt | #lang racket/base
(require "low-level/define.rkt"
"low-level/primitives.rkt"
"low-level/mutators.rkt")
(provide (all-from-out "low-level/define.rkt")
(all-from-out "low-level/primitives.rkt")
(all-from-out "low-level/mutators.rkt"))
| null | https://raw.githubusercontent.com/LLazarek/mutate/297eae74e1969e21ee24382a63165af37631690a/mutate-lib/low-level.rkt | racket | #lang racket/base
(require "low-level/define.rkt"
"low-level/primitives.rkt"
"low-level/mutators.rkt")
(provide (all-from-out "low-level/define.rkt")
(all-from-out "low-level/primitives.rkt")
(all-from-out "low-level/mutators.rkt"))
| |
dba9d4544f1d878561131817756d23a3422bedd1dde5c139df12a6c549bce890 | agentm/project-m36 | DataFrame.hs | # LANGUAGE DeriveGeneric , DerivingVia #
{- A dataframe is a strongly-typed, ordered list of named tuples. A dataframe differs from a relation in that its tuples are ordered.-}
module ProjectM36.DataFrame where
import ProjectM36.Base
import ProjectM36.Attribute as A hiding (drop)
import ProjectM36.Error
import qualifie... | null | https://raw.githubusercontent.com/agentm/project-m36/d05dec56f6a4884f10c49d30efd1db45b7db3a48/src/lib/ProjectM36/DataFrame.hs | haskell | A dataframe is a strongly-typed, ordered list of named tuples. A dataframe differs from a relation in that its tuples are ordered.
terminal display
| A Relation can be converted to a DataFrame for sorting, limits, and offsets.
web browsers don't display tables with empty cells or empty headers, so we have to insert ... | # LANGUAGE DeriveGeneric , DerivingVia #
module ProjectM36.DataFrame where
import ProjectM36.Base
import ProjectM36.Attribute as A hiding (drop)
import ProjectM36.Error
import qualified ProjectM36.Relation as R
import ProjectM36.Relation.Show.Term
import qualified ProjectM36.Relation.Show.HTML as RelHTML
import Project... |
2239ca142f5d789635e50143664d0382a7999c1f6773c54c35a3a54dd4bd07cd | Drup/adtr | types.ml | open Syntax
type error =
| Unbound_type of Name.t
| Unbound_type_variable of Name.t
| Bad_constructor of name * Syntax.type_expr
| No_constructor of Syntax.type_expr
exception Error of error
let error e = raise @@ Error e
let prepare_error = function
| Error (Unbound_type_variable n) ->
Some (Report.er... | null | https://raw.githubusercontent.com/Drup/adtr/a2d1cb8473522a52e475fd1261892cf363f215aa/src/types.ml | ocaml | open Syntax
type error =
| Unbound_type of Name.t
| Unbound_type_variable of Name.t
| Bad_constructor of name * Syntax.type_expr
| No_constructor of Syntax.type_expr
exception Error of error
let error e = raise @@ Error e
let prepare_error = function
| Error (Unbound_type_variable n) ->
Some (Report.er... | |
6f71e79eaf1cb7ee5d445dff1dc8af40fbe2b5899d6ff362b146c78d09a4e07d | winny-/aoc | imm-eq-8.rkt | #lang reader "reader-p2.rkt"
3,3,1108,-1,8,3,4,3,99
| null | https://raw.githubusercontent.com/winny-/aoc/d508caae19899dcab57ac665ef5d1a05b0a90c0c/2019/day05/programs/imm-eq-8.rkt | racket | #lang reader "reader-p2.rkt"
3,3,1108,-1,8,3,4,3,99
| |
e647ce0b98f07a3fe9d515e787a2792693c4c4bf06563fe76135a36329242c6a | lexi-lambda/megaparsack | contract.rkt | #lang racket/base
(require data/applicative
data/monad
megaparsack
megaparsack/text
racket/list
racket/contract
rackunit
rackunit/spec)
(describe "parser/c"
(it "signals a contract violation on invalid input tokens"
(define exn (with-handlers ([exn:... | null | https://raw.githubusercontent.com/lexi-lambda/megaparsack/86cd7bca381e1c58458f26080fa4ed73cf64d67e/megaparsack-test/tests/megaparsack/contract.rkt | racket | #lang racket/base
(require data/applicative
data/monad
megaparsack
megaparsack/text
racket/list
racket/contract
rackunit
rackunit/spec)
(describe "parser/c"
(it "signals a contract violation on invalid input tokens"
(define exn (with-handlers ([exn:... | |
4e2e238590398e20a3b57eb804bf5b14fc71d58cd8b732b776cfe27da51cf9f6 | dnsimple/erldns-admin | erldns_admin_zone_control_handler.erl | Copyright ( c ) 2012 - 2019 , DNSimple Corporation
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND T... | null | https://raw.githubusercontent.com/dnsimple/erldns-admin/37ad199c5a71ea3605a2e43f7c3847f51521516d/src/erldns_admin_zone_control_handler.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2012 - 2019 , DNSimple Corporation
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(erldns_admin_zone_control_handl... |
94120cd2982e7d176e32eb89789523fe6f396ba594dc00ce199cf45ae743c9f5 | ewestern/geos | Prepared.hs | module Data.Geometry.Geos.Raw.Prepared
( PreparedGeometry(..)
, withPreparedGeometry
, prepare
, contains
, containsProperly
, coveredBy
, covers
, crosses
, disjoint
, intersects
, overlaps
, touches
, within
)
where
import Data.Geometry.Geos.Raw.Internal
import Data.Geo... | null | https://raw.githubusercontent.com/ewestern/geos/3568c3449efe180bd89959c9247d4667137662b6/src/Data/Geometry/Geos/Raw/Prepared.hs | haskell | module Data.Geometry.Geos.Raw.Prepared
( PreparedGeometry(..)
, withPreparedGeometry
, prepare
, contains
, containsProperly
, coveredBy
, covers
, crosses
, disjoint
, intersects
, overlaps
, touches
, within
)
where
import Data.Geometry.Geos.Raw.Internal
import Data.Geo... | |
9e3fcc610b5b96bc4a5643a0ab7dfef5c252b4872959aab7a2b65dee4ddab15a | GillianPlatform/Gillian | valueTranslation.ml | open Compcert
module Literal = Gillian.Gil_syntax.Literal
open CConstants
let true_name id =
let str = Camlcoq.extern_atom id in
if str.[0] = '$' then Prefix.uvar ^ String.sub str 1 (String.length str - 1)
else str
let z_of_int z = Camlcoq.Z.of_sint (Z.to_int z)
let int_of_z z = Z.of_int (Camlcoq.Z.to_int z)
le... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/21ba7e6ee56277bbf06eb3a79be4b87f3224bc11/Gillian-C/lib/valueTranslation.ml | ocaml | open Compcert
module Literal = Gillian.Gil_syntax.Literal
open CConstants
let true_name id =
let str = Camlcoq.extern_atom id in
if str.[0] = '$' then Prefix.uvar ^ String.sub str 1 (String.length str - 1)
else str
let z_of_int z = Camlcoq.Z.of_sint (Z.to_int z)
let int_of_z z = Z.of_int (Camlcoq.Z.to_int z)
le... | |
51a64a40918235caa831686dbcb3196aa5ec3a5b86eaf972b76dd1d2fcb3de3c | RefactoringTools/HaRe | OldSyntaxRec.hs | module OldSyntaxRec where
import SyntaxRec
-- For backward compatibility:
type HsPat = HsPatI HsName
type HsType = HsTypeI HsName
type HsExp = HsExpI HsName
type HsDecl = HsDeclI HsName
type HsModuleR = HsModuleRI HsName
type BaseDecl = BaseDeclI HsName
type BaseExp = BaseExpI HsName
type BasePat = BasePatI HsNa... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/tools/base/syntax/OldSyntaxRec.hs | haskell | For backward compatibility: | module OldSyntaxRec where
import SyntaxRec
type HsPat = HsPatI HsName
type HsType = HsTypeI HsName
type HsExp = HsExpI HsName
type HsDecl = HsDeclI HsName
type HsModuleR = HsModuleRI HsName
type BaseDecl = BaseDeclI HsName
type BaseExp = BaseExpI HsName
type BasePat = BasePatI HsName
type BaseType = BaseTypeI Hs... |
a162595810edcf0c367864ca6b40e86b4fb7f967ea6ed6a3c23a8c82a4d9b355 | puppetlabs/puppetdb | queue.clj | (ns puppetlabs.puppetdb.testutils.queue
(:require [me.raynes.fs :refer [delete-dir]]
[puppetlabs.stockpile.queue :as stock]
[puppetlabs.puppetdb.nio :refer [get-path]]
[puppetlabs.puppetdb.testutils.nio :refer [create-temp-dir]]
[puppetlabs.puppetdb.queue :as q]
... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/test/puppetlabs/puppetdb/testutils/queue.clj | clojure | (ns puppetlabs.puppetdb.testutils.queue
(:require [me.raynes.fs :refer [delete-dir]]
[puppetlabs.stockpile.queue :as stock]
[puppetlabs.puppetdb.nio :refer [get-path]]
[puppetlabs.puppetdb.testutils.nio :refer [create-temp-dir]]
[puppetlabs.puppetdb.queue :as q]
... | |
b6d9edcf1f8294ef114bc965cc3ff67126d4994557606f84232dc31bd1f9282f | plewto/Cadejo | keymode.clj | (println "--> cadejo.midi.keymode")
(ns cadejo.midi.keymode)
(defprotocol Keymode
"Defines performance keymode interface.
See mono-mode and poly-mode for concrete implementations."
(set-parent!
[this performance]
"Sets parent performance for this keymode.")
(reset
[this]
"Set all notes ... | null | https://raw.githubusercontent.com/plewto/Cadejo/2a98610ce1f5fe01dce5f28d986a38c86677fd67/src/cadejo/midi/keymode.clj | clojure | (println "--> cadejo.midi.keymode")
(ns cadejo.midi.keymode)
(defprotocol Keymode
"Defines performance keymode interface.
See mono-mode and poly-mode for concrete implementations."
(set-parent!
[this performance]
"Sets parent performance for this keymode.")
(reset
[this]
"Set all notes ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.