_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 |
|---|---|---|---|---|---|---|---|---|
4b5e7c4bbf090d02263f5115dbfc3d0431db7d6978038768758893ffa540601d | EveryTian/Haskell-Codewars | LeapYear.hs | module LeapYear (isLeapYear) where
isLeapYear :: Int -> Bool
isLeapYear year
| isDivisibleBy 400 = True
| isDivisibleBy 100 = False
| isDivisibleBy 4 = True
| otherwise = False
where isDivisibleBy x = mod year x == 0
| null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/exercism/leap/src/LeapYear.hs | haskell | module LeapYear (isLeapYear) where
isLeapYear :: Int -> Bool
isLeapYear year
| isDivisibleBy 400 = True
| isDivisibleBy 100 = False
| isDivisibleBy 4 = True
| otherwise = False
where isDivisibleBy x = mod year x == 0
| |
0464db405558b46bf844cd6c90989a64afa647b1317b16ec6555c51765be38ad | AdaCore/why3 | hashcons.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/4441127004d53cf2cb0f722fed4a930ccf040ee4/src/util/hashcons.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
s Hash tables for hash - consing . ( Some code is borrowed from the ocaml
standard library , which is... |
b73dda912672407995850348f4aff78f35ed86e11f683c6594d91ee214902f9c | thibautbenjamin/catt | kernel.ml | open Std
open Settings
open Common
open Syntax
open Gassoc
(** Environment variables (i.e. defined coherences or let definitions). *)
module EVar
: sig
type t
val to_string : t -> string
val make : var -> t
val to_var : t -> var
val new_fresh : unit -> t
end
=
struct
type t = var
let next_fresh = ref (N... | null | https://raw.githubusercontent.com/thibautbenjamin/catt/b1734c0ab6f56403d47855829dcf1808b9c53575/src/kernel.ml | ocaml | * Environment variables (i.e. defined coherences or let definitions).
* Context variables (i.e. "arguments of functions").
* Operations on substitutions.
Structural functions
Equality procedures
Printing
* A substitution.
In current implementation, the variable names are given by the codomain.
TODO: add va... | open Std
open Settings
open Common
open Syntax
open Gassoc
module EVar
: sig
type t
val to_string : t -> string
val make : var -> t
val to_var : t -> var
val new_fresh : unit -> t
end
=
struct
type t = var
let next_fresh = ref (New 0)
let to_string v =
string_of_var v
let make v = v
let to_... |
cb5f366d931d319e4441fa82ffdc5b5900cddbe8e1b533e78dfe3c671d1001ab | mfikes/fifth-postulate | ns194.cljs | (ns fifth-postulate.ns194)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns194.cljs | clojure | (ns fifth-postulate.ns194)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
68a2cd9cc2fdcffca59eabe90fd1dd056520b305a2ad714f4e2da4e5a904fb0c | vehicle-lang/vehicle | Instance.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Vehicle.Compile.Type.Monad.Instance
( TypeCheckerT,
runTypeCheckerT,
)
where
import Control.Monad.Except (MonadError (..))
import Control.Monad.Reader (MonadReader (..), ReaderT (..), asks, mapReaderT)
import Control.Monad.State
( MonadState (..),
StateT (.... | null | https://raw.githubusercontent.com/vehicle-lang/vehicle/3a3548f9b48c3969212ccb51e954d4d4556ea815/vehicle/src/Vehicle/Compile/Type/Monad/Instance.hs | haskell | ------------------------------------------------------------------------------
Implementation
------------------------------------------------------------------------------
The type-checking monad
------------------------------------------------------------------------------
Instances that TypeCheckerT satisfies
---... | # LANGUAGE GeneralizedNewtypeDeriving #
module Vehicle.Compile.Type.Monad.Instance
( TypeCheckerT,
runTypeCheckerT,
)
where
import Control.Monad.Except (MonadError (..))
import Control.Monad.Reader (MonadReader (..), ReaderT (..), asks, mapReaderT)
import Control.Monad.State
( MonadState (..),
StateT (.... |
7f4990fb628ae99f22e4f844661187a751d90bf53391fc3592ab626af7a07439 | ericfinster/minitt | Main.hs | ----------------------------------------------------------
-- Expressions
This is a separate module generated by BNF converter
-----------------------------------------------------------
Core / Abs.hs
module Core . Abs where
-- Haskell module generated by the BNF converter
newtype Ident = Ide... | null | https://raw.githubusercontent.com/ericfinster/minitt/19ac0bfa4d1742efb06627f6a9590f601d6f9ecb/src/main/haskell/Main.hs | haskell | --------------------------------------------------------
Expressions
---------------------------------------------------------
Haskell module generated by the BNF converter
Haskell module generated by the BNF converter
---------------------------------------
Main module
-------------------------------------... | This is a separate module generated by BNF converter
Core / Abs.hs
module Core . Abs where
newtype Ident = Ident String deriving ( Eq , Ord , Show )
newtype CaseTk = CaseTk ( ( Int , Int),String ) deriving ( Eq , Ord , Show )
newtype DataTk = DataTk ( ( Int , Int),String ) deriving ( Eq , Ord... |
279edcc7595424090e619ca021e1f7622689e1fb703779ad94d40585a308524f | CafeOBJ/cafeobj | prelude.lisp | -*- Mode : LISP ; Package : CHAOS ; ; Syntax : Common - lisp -*-
;;;
Copyright ( c ) 2000 - 2015 , . All rights reserved .
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of so... | null | https://raw.githubusercontent.com/CafeOBJ/cafeobj/261e3a50407f568272321378df370e5cf7492aaf/chaos/boot/prelude.lisp | lisp | Package : CHAOS ; ; Syntax : Common - lisp -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | Copyright ( c ) 2000 - 2015 , . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :chaos)
(defvar *LAST-TERM-op-term* nil)
(defvar *LAST-TERM-eqn-rhs* nil)
(defun install-last-term ()
(let* ... |
d377f924035812fe1c776ecf0bbc702f05e616434f7f12620828b69dfb8dd27a | lojic/LearningRacket | acronym.rkt | #lang racket
(require threading)
(provide abbreviate)
(define (abbreviate string)
(~> string
(string-split #px" |(?=[A-Z])")
(filter non-empty-string? _)
(map (λ (s) (substring s 0 1)) _)
(string-join "")
string-upcase))
| null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/exercism.io/acronym/acronym.rkt | racket | #lang racket
(require threading)
(provide abbreviate)
(define (abbreviate string)
(~> string
(string-split #px" |(?=[A-Z])")
(filter non-empty-string? _)
(map (λ (s) (substring s 0 1)) _)
(string-join "")
string-upcase))
| |
b7f3d8d3c7418d4dcb6f9d6cdd79c7d3826f95c1af3de8c0b3342513122ffb10 | Plutonomicon/plutarch-plutus | LiftSpec.hs | module Plutarch.LiftSpec (spec) where
import Data.Text (Text)
import Plutarch.Api.V1 ()
import PlutusLedgerApi.V1 (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef))
import PlutusTx qualified
import Plutarch.Lift (PLifted)
import Plutarch.Prelude
import Plutarch.Test
import Test.Hspec (Expectation... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/plutarch-test/tests/Plutarch/LiftSpec.hs | haskell | List of pairs
List of pair of lists | module Plutarch.LiftSpec (spec) where
import Data.Text (Text)
import Plutarch.Api.V1 ()
import PlutusLedgerApi.V1 (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef))
import PlutusTx qualified
import Plutarch.Lift (PLifted)
import Plutarch.Prelude
import Plutarch.Test
import Test.Hspec (Expectation... |
a0e32e4a65ffc8cf4302e809685e5504880a32e41ebcfc8fa7851c66816a95c0 | camllight/camllight | pr_decl.ml | (* To print the things defined by an implementation *)
#open "misc";;
#open "const";;
#open "globals";;
#open "pr_type";;
#open "printf";;
let print_expr ty =
printf "(* - : %a *)\n" output_one_type ty;
flush std_out
;;
let print_valdef env =
do_list
(fun (name, (typ, mut_flag)) ->
printf "value %s ... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/src/compiler/pr_decl.ml | ocaml | To print the things defined by an implementation |
#open "misc";;
#open "const";;
#open "globals";;
#open "pr_type";;
#open "printf";;
let print_expr ty =
printf "(* - : %a *)\n" output_one_type ty;
flush std_out
;;
let print_valdef env =
do_list
(fun (name, (typ, mut_flag)) ->
printf "value %s : %a;;\n" name output_schema typ)
env;
flush std_... |
d93eaa6ce205c0a8a60845fe108bb3a600adb3a0e506835caf28bcecbcf3d77f | hiroshi-unno/coar | problem.ml | open Core
open Common
open Common.Ext
open Common.Util
open Common.Combinator
open Ast
open Ast.LogicOld
ToDo
type query = Formula.t
type t = { preds : Pred.t list; query : query }
type solution = Valid | Invalid | Unknown
exception Timeout
let make preds query = { preds = preds; query = query }
let flip_solutio... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/muCLP/problem.ml | ocaml | (fp pvar(bounds). body)(args)
Debug.print @@ lazy (Printf.sprintf "not implemented for: %s" @@ Formula.str_of fml);
|> detect_arity0_preds
ignore
ignore | open Core
open Common
open Common.Ext
open Common.Util
open Common.Combinator
open Ast
open Ast.LogicOld
ToDo
type query = Formula.t
type t = { preds : Pred.t list; query : query }
type solution = Valid | Invalid | Unknown
exception Timeout
let make preds query = { preds = preds; query = query }
let flip_solutio... |
6c3e1c4f8c6a24e5aa0d33cd1e961b2891f739d3025b524969c38ff765e91490 | aredington/parallel-test | runner.clj | (ns com.holychao.parallel-test.runner
(:require [com.holychao.parallel-test :as ptest]
[clojure.core.async :as async]
[robert.hooke :as hook]
[clojure.test :as test]
[clojure.set :as set]))
(def test-ns-hook-delays (atom {}))
(defn- monkeypatch-clojure-test-report
[... | null | https://raw.githubusercontent.com/aredington/parallel-test/72f21fbd3a062d18310c41277dbc880c2fc5b17e/src/com/holychao/parallel_test/runner.clj | clojure | (ns com.holychao.parallel-test.runner
(:require [com.holychao.parallel-test :as ptest]
[clojure.core.async :as async]
[robert.hooke :as hook]
[clojure.test :as test]
[clojure.set :as set]))
(def test-ns-hook-delays (atom {}))
(defn- monkeypatch-clojure-test-report
[... | |
957cff6fd33359058a9bc96f24df549a17dfa3f9a00d07316e4278c5a246701c | snoyberg/mono-traversable | deque.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TypeFamilies #-}
import Control.Monad
import Gauge.Main
import Data.Mutable
import Data.Sequence (Seq)
test :: (MCState c ~ PrimState IO, CollElement c ~ Int, MutableDeque c)
=> String
-> (c -> c)
-> Benchmark
test name forceType = bench name $ whnfI... | null | https://raw.githubusercontent.com/snoyberg/mono-traversable/7f763974fd312c75b74374bed889a0ee07b21428/mutable-containers/bench/deque.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE TypeFamilies # | import Control.Monad
import Gauge.Main
import Data.Mutable
import Data.Sequence (Seq)
test :: (MCState c ~ PrimState IO, CollElement c ~ Int, MutableDeque c)
=> String
-> (c -> c)
-> Benchmark
test name forceType = bench name $ whnfIO $ do
let x = 5 :: Int
coll <- fmap forceType newColl
... |
20bb3fb643b639a52ef4ac8323f79c3c408f7e2f5709532c001cd8484778a2fa | roswell/roswell | dist-default.lisp | (roswell:include "util")
(defpackage :roswell.dist.default
(:use :cl :roswell.util))
(in-package :roswell.dist.default)
(defun default (&rest r)
(if (null r)
(progn
(format *error-output* "Possible subcommands:~%")
(finish-output *error-output*)
(format t "~{~A~%~}"
(s... | null | https://raw.githubusercontent.com/roswell/roswell/0107dfb54393aff1a776deb79d58f67f642135cb/lisp/dist-default.lisp | lisp | (roswell:include "util")
(defpackage :roswell.dist.default
(:use :cl :roswell.util))
(in-package :roswell.dist.default)
(defun default (&rest r)
(if (null r)
(progn
(format *error-output* "Possible subcommands:~%")
(finish-output *error-output*)
(format t "~{~A~%~}"
(s... | |
aa1462ddbf151fc07999a58e7400f409500b010fe6d1d205fd390285f811168d | Porges/email-validate-hs | QuasiQuotation.hs | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
{-# LANGUAGE TemplateHaskellQuotes #-}
#else
# LANGUAGE TemplateHaskell #
#endif
module Text.Email.QuasiQuotation
( email
) where
import qualified Data.ByteString.Char8 as BS8
import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Text.Email.Validate (valid... | null | https://raw.githubusercontent.com/Porges/email-validate-hs/dc6a7b3df89f0bbc76a0f7e2a6b325275114f128/src/Text/Email/QuasiQuotation.hs | haskell | # LANGUAGE TemplateHaskellQuotes #
| A QuasiQuoter for email addresses.
Use it like this (requires `QuasiQuotes` to be enabled):
>>> [email||]
"" | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
#else
# LANGUAGE TemplateHaskell #
#endif
module Text.Email.QuasiQuotation
( email
) where
import qualified Data.ByteString.Char8 as BS8
import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Text.Email.Validate (validate, localPart, domainPart, unsafeEmail... |
bd540825ba4be78ddc940d1777d0312c4003c0442b361e1dc5c659eec534cf61 | reasonml-old/bs-containers | blist_association.mli |
type ('k, 'v) t = ('k * 'v) list
val get : ?eq:('k -> 'k -> bool) -> 'k -> ('k, 'v) t -> 'v option
(** Find the element *)
val getOrRaise : ?eq:('k -> 'k -> bool) -> 'k -> ('k, 'v) t -> 'v
(** Same as [get], but unsafe
@raise Not_found if the element is not present *)
val set : ?eq:('k -> 'k -> bool) -> 'k -> '... | null | https://raw.githubusercontent.com/reasonml-old/bs-containers/dfd1360dc74ede57c09e9f9d837ce59285af6fd2/src/blist_association.mli | ocaml | * Find the element
* Same as [get], but unsafe
@raise Not_found if the element is not present
* Add the binding into the list (erase it if already present)
* [update k ~f l] updates [l] on the key [k], by calling [f (get l k)]
and removing [k] if it returns [None], mapping [k] to [v'] if it
returns [Some... |
type ('k, 'v) t = ('k * 'v) list
val get : ?eq:('k -> 'k -> bool) -> 'k -> ('k, 'v) t -> 'v option
val getOrRaise : ?eq:('k -> 'k -> bool) -> 'k -> ('k, 'v) t -> 'v
val set : ?eq:('k -> 'k -> bool) -> 'k -> 'v -> ('k, 'v) t -> ('k, 'v) t
val update :
?eq:('k -> 'k -> bool) -> f:('v option -> 'v option) -> 'k -> ... |
3c044f7df5174ace01fdc033aa29d2526ab1034fb53a4cbba1e308ce833a6a15 | sph-mn/sph-web-app | project-name.scm | (library (project-name)
(export
swa-app)
(import
(rnrs base)
(sph web app)
(sph web app http))
(define (app-respond request) (respond "running"))
(define swa-app (swa-create (quote project-name) app-respond)))
| null | https://raw.githubusercontent.com/sph-mn/sph-web-app/9b803d9b7efc15f157c544c726f1f2c0663de5a9/example/project-minimal/modules/project-name.scm | scheme | (library (project-name)
(export
swa-app)
(import
(rnrs base)
(sph web app)
(sph web app http))
(define (app-respond request) (respond "running"))
(define swa-app (swa-create (quote project-name) app-respond)))
| |
b67ccbba8e13d7d6a5c5016f7a596d7f2d60ff33ebbc75ea0c401eecaf4ee515 | fission-codes/fission | Process.hs | module Network.IPFS.Process (runProc) where
import Network.IPFS.Prelude
import Network.IPFS.Process.Types
runProc ::
( MonadIO m
, MonadReader cfg m
, HasProcessContext cfg
, HasLogFunc cfg
)
=> (ProcessConfig stdin stdout () -> m a)
-> FilePath
-> StreamIn stdin
-> Strea... | null | https://raw.githubusercontent.com/fission-codes/fission/fb76d255f06ea73187c9b787bd207c3778e1b559/ipfs/library/Network/IPFS/Process.hs | haskell | module Network.IPFS.Process (runProc) where
import Network.IPFS.Prelude
import Network.IPFS.Process.Types
runProc ::
( MonadIO m
, MonadReader cfg m
, HasProcessContext cfg
, HasLogFunc cfg
)
=> (ProcessConfig stdin stdout () -> m a)
-> FilePath
-> StreamIn stdin
-> Strea... | |
b890dab28a980324acb706914c7631198d9002c3fb495bb11e285c6a1007c3de | AccelerateHS/accelerate-cuda | Base.hs | {-# LANGUAGE CPP #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
{-# LANGUAGE ImpredicativeTypes #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Template... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-cuda/6285f87859788628ce68d1ff76ce7b348f585f9e/Data/Array/Accelerate/CUDA/CodeGen/Base.hs | haskell | # LANGUAGE CPP #
# LANGUAGE ImpredicativeTypes #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
|
License : BSD3
Stability : experimental
Names and Types
Declaration generation
Mutable operations
library
cuda
friends
Names
... | # LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
#if __GLASGOW_HASKELL__ <= 708
# LANGUAGE OverlappingInstances #
# OPTIONS_GHC -fno - warn - unrecognised - pragmas #
#endif
Module : Data . Array . Accelerate . CUDA.C... |
d7be437e2349e6268d8baed8f05637fb978158b7b338c82d603415dafa8a2bea | tlaplus/tlapm | symbol_commute.ml |
* frontend / symbol_commute.ml
*
* For coalescing to be affective , we must try to push problematic symbols up
* the term as much as possible . This will cause the coalesced part of the term
* to be smaller and therefore will preserve as much of the logical content as
* possible .
*
* For exampl... | null | https://raw.githubusercontent.com/tlaplus/tlapm/b82e2fd049c5bc1b14508ae16890666c6928975f/src/frontend/symbol_commute.ml | ocaml | all symbols must be idempotent? |
* frontend / symbol_commute.ml
*
* For coalescing to be affective , we must try to push problematic symbols up
* the term as much as possible . This will cause the coalesced part of the term
* to be smaller and therefore will preserve as much of the logical content as
* possible .
*
* For exampl... |
14376f64cfa4176c09c405f23f077f60e7197c4177600ffcd364744cbbac5c23 | vito/atomo | Time.hs | # LANGUAGE QuasiQuotes #
module Atomo.Kernel.Time (load) where
import Data.Time.Clock.POSIX (getPOSIXTime)
import Atomo
load :: VM ()
load = do
([p|Timer|] =::) =<< eval [e|Object clone|]
[p|Timer now|] =:
liftM (Double . fromRational . toRational) (liftIO getPOSIXTime)
[p|Timer sleep: (n: Int... | null | https://raw.githubusercontent.com/vito/atomo/df22fcb3fbe80abb30b9ab3c6f5d50d3b8477f90/src/Atomo/Kernel/Time.hs | haskell | # LANGUAGE QuasiQuotes #
module Atomo.Kernel.Time (load) where
import Data.Time.Clock.POSIX (getPOSIXTime)
import Atomo
load :: VM ()
load = do
([p|Timer|] =::) =<< eval [e|Object clone|]
[p|Timer now|] =:
liftM (Double . fromRational . toRational) (liftIO getPOSIXTime)
[p|Timer sleep: (n: Int... | |
0d81196b5dcaa8e97571d0781ccdde3abafddc08a3dc13551614b0b2127fddbf | SjVer/Som-Lang | env.ml | module Ident = Symboltable.Ident
module SMap = Map.Make(String)
type t =
{
mutable symbols: Types.t SMap.t;
mutable aliases: Types.t SMap.t;
mutable sections: t SMap.t;
}
let empty () =
{
symbols = SMap.empty;
aliases = SMap.empty;
sections = SMap.empty;
}
let copy env =
{
symbo... | null | https://raw.githubusercontent.com/SjVer/Som-Lang/01b973a39769bba1e4ba71ebcb4e4a970328dfe3/somc/lib/typing/env.ml | ocaml | add functions
get functions
misc
go_env (i+3) e | module Ident = Symboltable.Ident
module SMap = Map.Make(String)
type t =
{
mutable symbols: Types.t SMap.t;
mutable aliases: Types.t SMap.t;
mutable sections: t SMap.t;
}
let empty () =
{
symbols = SMap.empty;
aliases = SMap.empty;
sections = SMap.empty;
}
let copy env =
{
symbo... |
d434957067ce059c6d9cca6fb7adff5c4accfe61f96fdb30e7402058fefb18d5 | hexagonal-sun/hchess | Fen.hs | # LANGUAGE TupleSections #
# LANGUAGE TemplateHaskell #
module Fen
( FEN
, pFen
, parseFen
, processFen
, newGame ) where
import Data.Char
import Data.Void
import Text.Megaparsec hiding (State)
import qualified CastlingRights as CR
import Text.Megaparsec.Char
import Control.Monad.Except
import Control.Monad... | null | https://raw.githubusercontent.com/hexagonal-sun/hchess/34f3be163e04553f34d82d10efedf6bbd25135c1/src/Fen.hs | haskell | # LANGUAGE TupleSections #
# LANGUAGE TemplateHaskell #
module Fen
( FEN
, pFen
, parseFen
, processFen
, newGame ) where
import Data.Char
import Data.Void
import Text.Megaparsec hiding (State)
import qualified CastlingRights as CR
import Text.Megaparsec.Char
import Control.Monad.Except
import Control.Monad... | |
332d0fb49ed5397cf6f07b0b55b4b067eb631bcd210b7d94997dd9f02a331c2a | collaborativetrust/WikiTrust | wikidata.ml |
Copyright ( c ) 2007 - 2008 The Regents of the University of California
All rights reserved .
Authors :
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 ... | null | https://raw.githubusercontent.com/collaborativetrust/WikiTrust/9dd056e65c37a22f67d600dd1e87753aa0ec9e2c/analysis/wikidata.ml | ocaml | File to be read
data consumer
array of page titles, to be built
debug
reads the data
To check that the file is sorted
Printf.printf "%s\n" l;
debug
debug
To guard against disk data corruption, I have to avoid using lines containing \000
Now we must figure out which line l is
Current format
Olde... |
Copyright ( c ) 2007 - 2008 The Regents of the University of California
All rights reserved .
Authors :
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 ... |
f9aa10c09f0d118621ecaa90c0fbfb298c5ae24ad458bffed517482684649a8d | caradoc-org/caradoc | typespage.ml | (*****************************************************************************)
(* Caradoc: a PDF parser and validator *)
Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
(* ... | null | https://raw.githubusercontent.com/caradoc-org/caradoc/100f53bc55ef682049e10fabf24869bc019dc6ce/src/type/pdf/typespage.ml | ocaml | ***************************************************************************
Caradoc: a PDF parser and validator
This program is free software; you can redistribute it and/or modify
... | Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have rece... |
d1170407678782bc53b987c4506b96d166210eba5b8cbc3bfd6b0de8d333df9b | ghcjs/ghcjs-boot | Coercion.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE TypeOperators #-}
# LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GADTs #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE StandaloneDeriving #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PolyKinds #
--------... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/Data/Type/Coercion.hs | haskell | # LANGUAGE TypeOperators #
# LANGUAGE StandaloneDeriving #
---------------------------------------------------------------------------
|
Module : Data.Type.Coercion
License : BSD-style (see the LICENSE file in the distribution)
Maintainer :
Stability : experimental
Portability : not port... | # LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GADTs #
# LANGUAGE FlexibleInstances #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PolyKinds #
module Data.Type.Coercion
( Coercion(..)
, coerceWith
, sym
, trans
, r... |
c738ce6df43f3a38debfc0e56d109821c987db1d56c66e1dd963e1410ecf236f | Frechmatz/cl-threadpool | run-tests.lisp | (load "init-ql")
(asdf:load-system "cl-threadpool/test" :force t)
(in-package :cl-threadpool-test)
(format t "~%Running tests...~%")
(setf lisp-unit:*print-failures* t)
;;(use-debugger)
(run-tests)
| null | https://raw.githubusercontent.com/Frechmatz/cl-threadpool/86ef8a6b3d6a28ce41f25362c1c2db804d3ca605/script/run-tests.lisp | lisp | (use-debugger) | (load "init-ql")
(asdf:load-system "cl-threadpool/test" :force t)
(in-package :cl-threadpool-test)
(format t "~%Running tests...~%")
(setf lisp-unit:*print-failures* t)
(run-tests)
|
c65682f2a30ce7a076707b3302634aec6b32bbe7ec23c322a110014981e6ab30 | roman/TicTacToe | Tests.hs | module Model.Matrix.Tests
(
tests
)
where
import Prelude hiding (lookup)
import Test.Framework (Test)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (assertEqual, assertBool)
import Model.Matrix
tests :: [Test]
tests = [
... | null | https://raw.githubusercontent.com/roman/TicTacToe/3e8b4b35e7da25ee8b83fe26268fe356aeb94791/tests/suite/Model/Matrix/Tests.hs | haskell | module Model.Matrix.Tests
(
tests
)
where
import Prelude hiding (lookup)
import Test.Framework (Test)
import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit (assertEqual, assertBool)
import Model.Matrix
tests :: [Test]
tests = [
... | |
efeef49e28ca23cd5cba82331dfa2e8c10b46c356faad4b169df17a185943fb3 | vouillon/osm | sorting.ml | OSM tools
* Copyright ( C ) 2013
*
* 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 , with linking exception ;
* either version 2.1 of the License , or ( at your opti... | null | https://raw.githubusercontent.com/vouillon/osm/a42d1bcc82a4ad73c26c81ac7a75f9f1c7470344/database/sorting.ml | ocaml | **
Format.eprintf "decoding at %d@." st.pos;
for i = 0 to n - 2 do
Format.eprintf "> %d: %d %d@." i heap_id.(i) heap_v.(i)
done;
;for i = 0 to n - 2 do
Format.eprintf "> %d: %d %d@." i heap_id.(i) heap_v.(i)
done
**
sorting overhead
int size
convert to blocks
**
int size
convert to blocks
Format.eprintf ... | OSM tools
* Copyright ( C ) 2013
*
* 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 , with linking exception ;
* either version 2.1 of the License , or ( at your opti... |
c26197b2df24c38f47a4ad194bb6d4c5aee24d09235b11217a4f6991ad5bfd26 | junegunn/clj-inspector | impl.clj | (ns inspector.impl
"This namespace contains functions that are not supposed to be directly used
by the users"
(:require [clojure.stacktrace :as trace]
[clojure.string :as str]
[clojure.walk :as w]
[puget.printer :as puget]))
(defonce ^:dynamic *indent* -1)
(defn output
([la... | null | https://raw.githubusercontent.com/junegunn/clj-inspector/d0de58df92e52a8de233fda187b516a1cad777c7/src/inspector/impl.clj | clojure | (ns inspector.impl
"This namespace contains functions that are not supposed to be directly used
by the users"
(:require [clojure.stacktrace :as trace]
[clojure.string :as str]
[clojure.walk :as w]
[puget.printer :as puget]))
(defonce ^:dynamic *indent* -1)
(defn output
([la... | |
b3411102c9a05f18370856d8b166e141643e30e8fc2bab1d65e95692cb93451f | zadean/xqerl | prod_StepExpr_SUITE.erl | -module('prod_StepExpr_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['K2-Steps-1'/1]).
-export(['K2-Steps-2'/1]).
-export(['K2-Steps-3'/1]).
-export([... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/prod/prod_StepExpr_SUITE.erl | erlang | -module('prod_StepExpr_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['K2-Steps-1'/1]).
-export(['K2-Steps-2'/1]).
-export(['K2-Steps-3'/1]).
-export([... | |
1fc83fb20d86ebbe25ae40e0e4a67c47c94d0dfb326d21f91c94d86b3295a32f | mmottl/gsl-ocaml | linalg.mli | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
(** Simple linear algebra operations *)
open Vectmat
open Gsl_complex
* { 3 Simple matrix multiplication }
* [ matmult a ~transpa ... | null | https://raw.githubusercontent.com/mmottl/gsl-ocaml/76f8d93cccc1f23084f4a33d3e0a8f1289450580/src/linalg.mli | ocaml | * Simple linear algebra operations
* With these, the arguments are protected (copied) and necessary
intermediate datastructures are allocated;
= "ml_gsl_linalg_R_svx"
* {3 QR Decomposition with Column Pivoting}
* {3 Tridiagonal Decomposition of Real Symmetric Matrices}
* {3 Tridiagonal Decomposition of Hermiti... | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
open Vectmat
open Gsl_complex
* { 3 Simple matrix multiplication }
* [ matmult a ~transpa b ~transpb c ] stores in matrix [ c ] th... |
eca7f8a589b2810b280d25a5cbef0ff3fb0bd10828e6367f59141af1d0cd5afd | gar1t/modlib | modlib.erl | -module(modlib).
-include("httpd.hrl").
-export([start/1, services/0]).
-export([httpd_config/1]).
-export([parse_qs/1,
parse_body/1,
remote_user/1,
body/1,
headers/1,
header/2,
header/3]).
-define(DEFAULT_SERVER_ROOT, ".").
-define(DEFAULT_DOCUMENT_ROOT, ".").
%%--------------------------------------... | null | https://raw.githubusercontent.com/gar1t/modlib/e1e0b2aa160a760964a0508283146af81800d098/src/modlib.erl | erlang | --------------------------------------------------------------------
@doc Starts a modlib server.
@end
--------------------------------------------------------------------
--------------------------------------------------------------------
@doc Returns a list of httpd services.
TODO: Do we need to tag the "servic... | -module(modlib).
-include("httpd.hrl").
-export([start/1, services/0]).
-export([httpd_config/1]).
-export([parse_qs/1,
parse_body/1,
remote_user/1,
body/1,
headers/1,
header/2,
header/3]).
-define(DEFAULT_SERVER_ROOT, ".").
-define(DEFAULT_DOCUMENT_ROOT, ".").
@spec start(modlib_config ( ) ) - > { ... |
2f2db461142a2f98a043ed2898eeff0c62dd60649893d4b4b882dda25dedc002 | hopv/r_type | showsexp.ml |
module type S = sig
type t
val sexp_of_t : t -> Sexplib.Sexp.t
end
module Make (M : S) = struct
let show_sexp (v : M.t) = M.sexp_of_t v |> Sexplib.Sexp.to_string
end
| null | https://raw.githubusercontent.com/hopv/r_type/7120b74912118a8eced8e63d1792907702e090dc/src/concern/showsexp.ml | ocaml |
module type S = sig
type t
val sexp_of_t : t -> Sexplib.Sexp.t
end
module Make (M : S) = struct
let show_sexp (v : M.t) = M.sexp_of_t v |> Sexplib.Sexp.to_string
end
| |
cd08d6ff352590b9f2d76208ffcd4883b3d4a7344b1641a7c08057fa495deba5 | rtoy/cmucl | killcoms.lisp | ;;; -*- Log: hemlock.log; Package: Hemlock -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/hemlock/killcoms... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/hemlock/killcoms.lisp | lisp | -*- Log: hemlock.log; Package: Hemlock -*-
**********************************************************************
**********************************************************************
Killing and unkilling things.
The following are hook functions for keeping things righteous.
Buffer-Mark primitives an... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/hemlock/killcoms.lisp $")
Written by and .
(in-package "HEMLOCK")
(defvar *kill-ring* (make-ring 10) "The Hemlock kill ring.")
Activ... |
15126108de5d9cecf4d930e4ff8200dbaa561e8bfd0efe72a51ec8af848b720d | maximvl/erl9p | erl9p_sup.erl |
-module(erl9p_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ============================================================... | null | https://raw.githubusercontent.com/maximvl/erl9p/c5410da3797811578a248ea4d2b8e449fabd0541/src/erl9p_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API functions
===================================================================
===================================================================
Supervisor callback... |
-module(erl9p_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, { {one_for_one, 5, 10}, []} }.
|
3b396751d0aecc256954f7b8d253bbb64681505f93fd6dbecb41e9bbb1ab492c | ucsd-progsys/liquidhaskell | Expand.hs | -- | This module has the code for applying refinement (and) type aliases
-- and the pipeline for "cooking" a @BareType@ into a @SpecType@.
TODO : _ only _ export ` makeRTEnv ` , ` cookSpecType ` and maybe ` qualifyExpand ` ...
# LANGUAGE FlexibleInstances #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE Ov... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/5e9347ac719e0ca192b05ccde74617d0cbb05a85/src/Language/Haskell/Liquid/Bare/Expand.hs | haskell | | This module has the code for applying refinement (and) type aliases
and the pipeline for "cooking" a @BareType@ into a @SpecType@.
* Create alias expansion environment
* Expand and Qualify
* Re-exported for data-constructors
, Symbol, symbol)
---------------------------------------------------------------... | TODO : _ only _ export ` makeRTEnv ` , ` cookSpecType ` and maybe ` qualifyExpand ` ...
# LANGUAGE FlexibleInstances #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE OverloadedStrings #
module Language.Haskell.Liquid.Bare.Expand
makeRTEnv
, qualifyExpand
* to SpecType
, cookSpecType
, coo... |
5280ad3862a33fc407de7e4df15717c2abfe12e6e744508f8df24358360e109c | michalkonecny/aern2 | Dyadic.hs | # LANGUAGE CPP #
-- #define DEBUG
# LANGUAGE GeneralizedNewtypeDeriving #
|
Module : AERN2.MP.Dyadic
Description : Dyadics with exact ring operations
Copyright : ( c ) : :
Stability : experimental
Portability : portable
Arbitrary precision fl... | null | https://raw.githubusercontent.com/michalkonecny/aern2/f42a9cc59006bdeda270ac969e1e7b414ad2223d/aern2-mp/src/AERN2/MP/Dyadic.hs | haskell | #define DEBUG
* Dyadic numbers and their basic operations
* Dyadic constructors
* tests
import qualified Numeric.CollectErrors as CN
ie, never give up
- conversions -
- comparisons -
unary functions
min/max
addition
subtraction
multiplication | # LANGUAGE CPP #
# LANGUAGE GeneralizedNewtypeDeriving #
|
Module : AERN2.MP.Dyadic
Description : Dyadics with exact ring operations
Copyright : ( c ) : :
Stability : experimental
Portability : portable
Arbitrary precision floating - point nu... |
8236518d4094be7cae51e0df38f7bb9db0a399eb77ce9f19796417f719ae7783 | kazu-yamamoto/quic | PacketSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module PacketSpec where
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS
import Data.IORef
import Data.Tuple (swap)
import Network.UDP
import Test.Hspec
import Network.QUIC.Internal
import Config
spec :: Sp... | null | https://raw.githubusercontent.com/kazu-yamamoto/quic/9dee8dd6f77d636c347ce755e01257d058fdd572/test/PacketSpec.hs | haskell | # LANGUAGE OverloadedStrings #
dummy
--
--
-- Decoding by the receiver
-- Checking
-- Encoding by the sender
-- Decoding by the receiver again
-- Checking |
module PacketSpec where
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS
import Data.IORef
import Data.Tuple (swap)
import Network.UDP
import Test.Hspec
import Network.QUIC.Internal
import Config
spec :: Spec
spec = do
serverConf <- runI... |
46251ab221ae43b096a4a3417f51bd11a6eecab3e81952467de097edb44446c9 | helium/gateway-config | gateway_gatt_char_add_gateway.erl | -module(gateway_gatt_char_add_gateway).
-include("gateway_gatt.hrl").
-include("gateway_config.hrl").
-include("pb/gateway_gatt_char_add_gateway_pb.hrl").
-behavior(gatt_characteristic).
-export([
init/2,
uuid/1,
flags/1,
read_value/2,
write_value/2,
start_notify/1,
stop_notify/1
]).
-re... | null | https://raw.githubusercontent.com/helium/gateway-config/ac7f90f5ac6f698c17a793e75a6e43796eb2f1da/src/gateway_gatt_char_add_gateway.erl | erlang | Already notifying
Already not notifying
Calling start_notify again has no effect | -module(gateway_gatt_char_add_gateway).
-include("gateway_gatt.hrl").
-include("gateway_config.hrl").
-include("pb/gateway_gatt_char_add_gateway_pb.hrl").
-behavior(gatt_characteristic).
-export([
init/2,
uuid/1,
flags/1,
read_value/2,
write_value/2,
start_notify/1,
stop_notify/1
]).
-re... |
d07cf285ed3dfe32e623a782667781f03ccbb6b28852dd1669cc8ffcf9da2ee3 | meain/evil-textobj-tree-sitter | textobjects.scm | (function_def) @function.outer
(function_def
. (function_command)
. (_)? @function.inner._start
(_) @function.inner._end
. (endfunction_command) .
)
(if_condition) @conditional.outer
(if_condition
. (if_command)
. (_)? @conditional.inner._start
(_) @conditional.inner._end
. (endif_command) .
)
... | null | https://raw.githubusercontent.com/meain/evil-textobj-tree-sitter/9dce8dab68c954ae32095328cf898eb856fc341a/queries/cmake/textobjects.scm | scheme | (function_def) @function.outer
(function_def
. (function_command)
. (_)? @function.inner._start
(_) @function.inner._end
. (endfunction_command) .
)
(if_condition) @conditional.outer
(if_condition
. (if_command)
. (_)? @conditional.inner._start
(_) @conditional.inner._end
. (endif_command) .
)
... | |
a09876c19ff061ec30600a678d4927c35fe8b6ca2bc453ee8920c1151857fdd6 | nyu-acsys/drift | foo-nondet.ml | type q = Qerr | Q0
type tup = Tup of q * int
let rec ev d acc =
match acc with
| Tup(Qerr,_) -> acc
| Tup(Q0,_) -> (if d < 0 then (Tup(Qerr,d)) else (Tup(Q0,d)))
let rec foo x acc =
let acc' = ev x acc in
if x = 0 then acc' else ( foo (x-1) acc' )
let main (x:int) =
if x > 0 then begin
let acc' ... | null | https://raw.githubusercontent.com/nyu-acsys/drift/2bdd046f912d761278ee7387f487a2809053220e/tests/benchmarks/effects/foo-nondet.ml | ocaml | type q = Qerr | Q0
type tup = Tup of q * int
let rec ev d acc =
match acc with
| Tup(Qerr,_) -> acc
| Tup(Q0,_) -> (if d < 0 then (Tup(Qerr,d)) else (Tup(Q0,d)))
let rec foo x acc =
let acc' = ev x acc in
if x = 0 then acc' else ( foo (x-1) acc' )
let main (x:int) =
if x > 0 then begin
let acc' ... | |
e11b75d232494569f662e162a6dc0f379dae8138d8399df8fc2680cac2963a88 | pokepay/aws-sdk-lisp | devicefarm.lisp | ;; DO NOT EDIT: File is generated by AWS-SDK/GENERATOR.
(uiop:define-package #:aws-sdk/services/devicefarm
(:use)
(:use-reexport #:aws-sdk/services/devicefarm/api))
| null | https://raw.githubusercontent.com/pokepay/aws-sdk-lisp/836b87df520391478a19462443342dc56f4b3f2c/services/devicefarm.lisp | lisp | DO NOT EDIT: File is generated by AWS-SDK/GENERATOR. |
(uiop:define-package #:aws-sdk/services/devicefarm
(:use)
(:use-reexport #:aws-sdk/services/devicefarm/api))
|
905aa02dfdc806328fb2fd3915bb0f70c20bf07f8e5999eff57e519d8220a815 | aantron/luv | async.ml | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
type t = [ `Async ] Handle.t
let trampoline =
C.Functions.Async.get_trampoline ()
let init ?loop callback =
let async = Handle.allocate C.Types.Async.t in
let callback = fun (... | null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/src/async.ml | ocaml | This file is part of Luv , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
type t = [ `Async ] Handle.t
let trampoline =
C.Functions.Async.get_trampoline ()
let init ?loop callback =
let async = Handle.allocate C.Types.Async.t in
let callback = fun (... | |
6c694273a95facc0af861f6d5184da39a4032842ac536b536458627adf138820 | webyrd/mediKanren | mkconfigref.rkt | #lang racket
(require
racket/runtime-path
)
(provide
config-ref
load-config
override-config
override-dbkanren-defaults
)
(require "configref.rkt")
(define box:verbose? (box #t))
(define (set-verbose! b)
(set-box! box:verbose? b))
(define (read/file path)
(define verbose? #t)
(when verbose? (... | null | https://raw.githubusercontent.com/webyrd/mediKanren/23a4ed6997b0c76c507d867659198fe2ba58f88b/medikanren2/mkconfigref.rkt | racket | BEGIN TEMPORARY: migrated-to-new-db-versioning:
END TEMPORARY
BEGIN TEMPORARY: migrated-to-new-db-versioning:
END TEMPORARY
No fallbacks for this file if missing. Stage files should be in revision control
Primarily for use in the repl, secondarily for use
in automated tests. Use discouraged in applications.
h... | #lang racket
(require
racket/runtime-path
)
(provide
config-ref
load-config
override-config
override-dbkanren-defaults
)
(require "configref.rkt")
(define box:verbose? (box #t))
(define (set-verbose! b)
(set-box! box:verbose? b))
(define (read/file path)
(define verbose? #t)
(when verbose? (... |
de75cf6c49a0b5b7d3815a16452e63577b6e7ffc88ceb0c8b984ff72a35b309d | aryx/fork-efuns | foo.ml | let _ = [%getenv "USER"]
| null | https://raw.githubusercontent.com/aryx/fork-efuns/55c17077b57bbab02c7348780adc99e81f5457fb/ppx_interactive/tests/foo.ml | ocaml | let _ = [%getenv "USER"]
| |
dbdf3da76325def079b6e460b7e2d7bb30aeb055c392e1080a06d87678538fc5 | haskell-tools/haskell-tools | CPPChecker.hs | module Language.Haskell.Tools.Refactor.Builtin.ExtensionOrganizer.Checkers.CPPChecker where
import GHC hiding (Module)
import StringBuffer
import Data.List (isSubsequenceOf)
import Data.String (fromString)
import Text.PortableLines.ByteString.Lazy (lines8)
import Language.Haskell.Tools.PrettyPrint
import Language.Ha... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/Language/Haskell/Tools/Refactor/Builtin/ExtensionOrganizer/Checkers/CPPChecker.hs | haskell | that contain the filepath of the module.
We want to remove these lines, and everything between them.
| Returns the preprocessed source code.
If it is not present, it returns an empty string. | module Language.Haskell.Tools.Refactor.Builtin.ExtensionOrganizer.Checkers.CPPChecker where
import GHC hiding (Module)
import StringBuffer
import Data.List (isSubsequenceOf)
import Data.String (fromString)
import Text.PortableLines.ByteString.Lazy (lines8)
import Language.Haskell.Tools.PrettyPrint
import Language.Ha... |
8857aeef8a60d6bc947e6b0ad1b63889a50989fe798fca92fba452c267b1c49e | alesaccoia/festival_flinger | htstest.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; Language Technologies Institute ;;;
Carnegie Mellon University ; ; ;
... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/testsuite/data/htstest.scm | scheme |
;;;
Language Technologies Institute ;;;
; ;
; ;
; ;
;;;
Permission is hereby granted, free of charge, to use and distribute ;;;
this softwa... | Some test the basic arctic / hts voices
(format t "cmu_us_awb_arctic_hts\n")
(voice_cmu_us_awb_arctic_hts)
(set! utt1 (SynthText "A whole joy was reaping, but they've gone south, you should fetch azure mike."))
(utt.save.segs utt1 "-")
(format t "%l\n" (wave.info (utt.wave utt1)))
(format t "cmu_us_bdl_arctic_hts\... |
25a208392a97e134e38bb02537819d2f1e9570e08a65aab6f59c3fe64fca39f4 | kerneis/cpc | mergecil.ml |
* Copyright ( c ) 2008 - 2010 ( minor changes for CPC compatibility ) ,
* < >
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are... | null | https://raw.githubusercontent.com/kerneis/cpc/0ca695d25e58dadbd92639162338a06a517875d9/src/mergecil.ml | ocaml | mergecil.ml
This module is responsible for merging multiple CIL source trees into
* a single, coherent CIL tree which contains the union of all the
* definitions in the source files. It effectively acts like a linker,
* but at the source code level instead of the object code level.
Try to merge structure with ... |
* Copyright ( c ) 2008 - 2010 ( minor changes for CPC compatibility ) ,
* < >
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are... |
ec9a9471ea48eb86ec1095334e286242afeb3615bb5de46cdc3d98f7e93e4510 | supermario/oak | Evergreen.hs | module Evergreen where
import qualified Hilt.Postgres
-- -orm
import qualified Database.PostgreSQL.Simple as SQL
import Database.PostgreSQL.Migrations (add_column_stmt, drop_column_stmt)
import Database.PostgreSQL.Escape (quoteIdent)
import Database.PostgreSQL.Simple.Types (Query(..))
import qualified Data.ByteString... | null | https://raw.githubusercontent.com/supermario/oak/220a4d378dd192aeebec6c10aa71d630669f7413/evergreen/Evergreen.hs | haskell | -orm
set of statements return in a migration scenario so we can run them all in a
single transaction if possible
Something like
Hilt.evergreen $ do
Could do the magic to handle this under the hood?
db <- Hilt.Evergreen.load
Do we really want a try? Would we rather things failed?
Do we really want a try? Would ... | module Evergreen where
import qualified Hilt.Postgres
import qualified Database.PostgreSQL.Simple as SQL
import Database.PostgreSQL.Migrations (add_column_stmt, drop_column_stmt)
import Database.PostgreSQL.Escape (quoteIdent)
import Database.PostgreSQL.Simple.Types (Query(..))
import qualified Data.ByteString.Char8 a... |
50b5d7e5f3706cef2a63dcec6940f972e19968fe3fb3095387b519f32c0cbb1a | tdammers/sprinkles | JSON.hs | # LANGUAGE NoImplicitPrelude #
{-#LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLists #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
module Web.Sprinkles.Handlers.JSON
( handleJSONTarget
)
where
import Web... | null | https://raw.githubusercontent.com/tdammers/sprinkles/a9161e4506427a3cf5f686654edc7ed9aa3ea82b/src/Web/Sprinkles/Handlers/JSON.hs | haskell | #LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedLists #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
module Web.Sprinkles.Handlers.JSON
( handleJSONTarget
)
where
import Web.Sprinkles.Prelude
import Web.Spri... |
30f0309b5380de803624feb8bff10d1d014faa3adb23532828d266685ce68870 | ddmcdonald/sparser | object.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1993 - 2005,2010 - 2013,2020 - 2021 -- all rights reserved
;;;
;;; File: "object"
;;; Module: "model/core/companies/"
version : September 2021
initiated 5/22/93 v2.3 ; changed index , added print routine 6/7 . Broke that... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/0f5ecedd572bc054725ee0d3b23f390c336b7b0f/Sparser/code/s/grammar/model/core/companies/object.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "object"
Module: "model/core/companies/"
changed index , added print routine 6/7 . Broke that out
find/company to be sensitive to the type of the name individual.
name-word in as case in define-company-given-name.
"United Nations" and look... | copyright ( c ) 1993 - 2005,2010 - 2013,2020 - 2021 -- all rights reserved
version : September 2021
as its own file 11/23/94 . 5/3/95 added Define - company . 5/22 tweeked
0.1 ( 1/7/96 ) reorganized Define - company so that the alternatives would n't be
defined as permanent individuals . 1... |
8caf4428c0869b0d59cd7758634eb4d5822158376adda1228e44e21abe15705c | johnlawrenceaspden/hobby-code | clojure-errs-dict.clj | ;; I often find that the default behaviour of exceptions in emacs/slime is a bit
;; annoying.
;; Up pops up a debugger window, but that moves the focus away from where
;; you're working, and the new window then needs dismissing, and has often
;; buggered up the size of other windows, etc...
;; Also when playing with ... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/clojure-errs-dict.clj | clojure | I often find that the default behaviour of exceptions in emacs/slime is a bit
annoying.
Up pops up a debugger window, but that moves the focus away from where
you're working, and the new window then needs dismissing, and has often
buggered up the size of other windows, etc...
Also when playing with experimental c... |
(defmacro tryc[ & e]
`(try ~@e
(catch Exception a# a#)))
the ability to jump around the code with M - p and M - n is quite handy sometimes .
(defmacro guru [& e]
`(try ~@e
(catch Exception a#
(let [message# (.getMessage a#)
st# (seq (.getStackTrace a#))
u... |
1ec9c92c1105514d86eb9b08c4c2d358c0055db388e6e7ad319374947971f797 | biocad/openapi3 | Schema.hs | # LANGUAGE CPP #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
# LANGUAGE PolyKinds #
# LANGUA... | null | https://raw.githubusercontent.com/biocad/openapi3/acc5ea71a3c58e0f8b25861f6b6feab2cf0cb87e/src/Data/OpenApi/Internal/Schema.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports #
# LANGUAGE TypeSynonymInstances #
# OPTIONS_GHC -Wno-redundant-constraints #
$setup
| Convert a type into @'Schema'@.
An example type and instance:
@
allows to write ' T.Text ' literals
allows to write ' Map ' and ' ' as li... | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE OverloadedLists #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFam... |
63c8f0a337b16f09c1eaa497a5754dde9df7c4ce4669551b2fe7b38293b5cf88 | kupl/LearnML | original.ml | let rec sigma (func : int -> int) (a : int) (b : int) : int =
if func a = func b then func a else func a + sigma func (a + 1) b
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/sigma/sub25/original.ml | ocaml | let rec sigma (func : int -> int) (a : int) (b : int) : int =
if func a = func b then func a else func a + sigma func (a + 1) b
| |
874833966d8c37e641c0e9f1a4447da656cd139d02a33b56fbf85aee9f94da0c | 0zat/gen-bs | gen_bs.ml | open Description
let version = "0.1.0"
let () =
let is_dir = ref false in
let action = ref `webidl in
let external_type_file = ref None in
let output = ref None in
let trace = ref false in
let speclist = [
("-t", (Arg.String (fun x -> external_type_file := Some x)), desc_external_type);
("-o", (A... | null | https://raw.githubusercontent.com/0zat/gen-bs/20348991775d9ef3974c3b824968a0ab219502a8/src/main/gen_bs.ml | ocaml | open Description
let version = "0.1.0"
let () =
let is_dir = ref false in
let action = ref `webidl in
let external_type_file = ref None in
let output = ref None in
let trace = ref false in
let speclist = [
("-t", (Arg.String (fun x -> external_type_file := Some x)), desc_external_type);
("-o", (A... | |
918b870ce7f89b050d2be570b098157198786b7f9a1cfd7c98da4a4525c7499d | athos/JiSE | type_test.clj | (ns jise.type-test
(:require [clojure.test :refer [deftest testing is are]]
[jise.type :as t])
(:import [clojure.asm Type]
[java.lang.reflect Modifier]
[java.io BufferedReader]))
(deftest tag->type-test
(testing "symbol representing primitive type can be converted to correspondi... | null | https://raw.githubusercontent.com/athos/JiSE/b487947d8c367c12c284586c6e11aaeddb4132f5/test/jise/type_test.clj | clojure | (ns jise.type-test
(:require [clojure.test :refer [deftest testing is are]]
[jise.type :as t])
(:import [clojure.asm Type]
[java.lang.reflect Modifier]
[java.io BufferedReader]))
(deftest tag->type-test
(testing "symbol representing primitive type can be converted to correspondi... | |
108f2c5f38b4a53e94a4ae79d45ae972824df0f007bf082d8d72366b51eb780d | awslabs/s2n-bignum | bignum_moddouble.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/arm/proofs/bignum_moddouble.ml | ocaml | =========================================================================
=========================================================================
*** print_literal_from_elf "arm/generic/bignum_moddouble.o";;
***
-------------------------------------------------------------------------
Correctness proof. ... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
Modular doubling of bignums . ... |
9471e8f103e09b38627922b22d5b8cf73ae3d0af7489c0b2b88bebe632c89e14 | wadehennessey/wcl | eval.lisp | ( C ) Copyright 1990 - 2014 by . All rights reserved .
HEY ! Need to do lots more work at EXPAND time rather than EVAL time .
;;; EXPAND should also record the macros FORM depends on
;;; and reexpand automatically if the macro def changes.
;;;
At least do all and lambda - list parsing at expand time ,
;;; fi... | null | https://raw.githubusercontent.com/wadehennessey/wcl/841316ffe06743d4c14b4ed70819bdb39158df6a/src/cl/functions/eval.lisp | lisp | EXPAND should also record the macros FORM depends on
and reexpand automatically if the macro def changes.
figure out which vars are special, etc.
Return a new copy of form with all macros expanded.
HEY! cltl2 says to do this in lex env
allow declares
allow declares
HEY! Add dead block check
Ugly, but...
HEY!... | ( C ) Copyright 1990 - 2014 by . All rights reserved .
HEY ! Need to do lots more work at EXPAND time rather than EVAL time .
At least do all and lambda - list parsing at expand time ,
(defun eval (form)
(eval-1 form nil nil nil nil))
(defun eval-1 (form venv fenv tenv benv)
(let ((expansion (expand fo... |
07e007fc79775b115b4e894e18cf3f8e966f91e8d1ae34a14a5c5411a4b955b8 | shirok/WiLiKi | rss.scm | ;; test wiliki.rss
(use gauche.test)
(use wiliki)
(test-start "rss")
(test-section "wiliki.rss")
(use wiliki.rss)
(test-module 'wiliki.rss)
;; more tests to come...
(test-section "wiliki.rssmix")
(use wiliki.rssmix)
(test-module 'wiliki.rssmix)
(test-end)
| null | https://raw.githubusercontent.com/shirok/WiLiKi/5fce918ed5b3f9c69cd2972c418bd72cbc0b1fe5/test/rss.scm | scheme | test wiliki.rss
more tests to come... |
(use gauche.test)
(use wiliki)
(test-start "rss")
(test-section "wiliki.rss")
(use wiliki.rss)
(test-module 'wiliki.rss)
(test-section "wiliki.rssmix")
(use wiliki.rssmix)
(test-module 'wiliki.rssmix)
(test-end)
|
af5a7207a5e8028823ac2c9aa10eb09fb4b4dc97d3ce500b100a65d7439af1b5 | deadcode/Learning-CL--David-Touretzky | 7.6.lisp | (let ((foo '(mapcar #'(lambda (inp) (or (eq inp t) (eq inp nil))) '(t nil 'a '(a b)))))
(format t "~s = ~s~%" foo (eval foo)))
| null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%207/7.6.lisp | lisp | (let ((foo '(mapcar #'(lambda (inp) (or (eq inp t) (eq inp nil))) '(t nil 'a '(a b)))))
(format t "~s = ~s~%" foo (eval foo)))
| |
bc9896fdc20cdfd420f7c860e3e648157c0fec642b5fce17e52bd6c1933033a5 | default-kramer/plisqin | tokens-skeleton.rkt | #lang at-exp racket
(provide docgen/unsafe
docgen/strict)
(require scribble/manual
(for-label (prefix-in strict: plisqin-lib/strict)
(prefix-in strict: plisqin-lib/strict/operators))
"tokens-helpers.rkt"
"tokens-strict.scrbl")
Defines a " document generator "... | null | https://raw.githubusercontent.com/default-kramer/plisqin/26421c7c42656c873c4e0a4fc7f48c0a3ed7770f/plisqin-doc/scribblings/tokens-skeleton.rkt | racket | a function created by def-content-provider
a syntax object from a scope with the desired `for-label`
the lookup function to get type signatures
plisqin-lib/{variant}
plisqin-lib/{variant}/operators
clauses
aggregates
misc
date math
operators
Pipe everything into GO3 after changing the context of the ids.
At ... | #lang at-exp racket
(provide docgen/unsafe
docgen/strict)
(require scribble/manual
(for-label (prefix-in strict: plisqin-lib/strict)
(prefix-in strict: plisqin-lib/strict/operators))
"tokens-helpers.rkt"
"tokens-strict.scrbl")
Defines a " document generator "... |
7c91e962e9ad289b834e91c08e49b887bd47d2e794cec3e68a1597d0ad88f0c0 | faylang/fay | DoLet3.hs | module DoLet3 where
import FFI
data R = R Int
main = do
print 1
let [a] = [2]
print a
let (b,c) = (3,4)
print b
print c
let R d = R 5
print d
let [e] = []
print e
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/DoLet3.hs | haskell | module DoLet3 where
import FFI
data R = R Int
main = do
print 1
let [a] = [2]
print a
let (b,c) = (3,4)
print b
print c
let R d = R 5
print d
let [e] = []
print e
| |
e4756980d3876e540d23c698524f1341e52c8592d69da682664dd994a97da835 | christian-marie/oauth2-server | UI.hs | --
Copyright © 2013 - 2015 Anchor Systems , Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
the 3 - clause BSD licence .
--
{-# LANGUAGE OverloadedStri... | null | https://raw.githubusercontent.com/christian-marie/oauth2-server/ebb75be9d05dd52d478a6e069d32461d4e54544e/lib/Network/OAuth2/Server/UI.hs | haskell |
The code in this file, and the program it is a part of, is
made available to you by its authors as open source software:
you can redistribute it and/or modify it under the terms of
# LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE ViewPatterns #
| Description: Simple HTML rendering fo... | Copyright © 2013 - 2015 Anchor Systems , Pty Ltd and Others
the 3 - clause BSD licence .
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Network.OAuth2.Server.UI (
renderAuthorizePage,
renderTokensPage,
renderToken,
) where
import Blaze.ByteString.Builder (toByteStr... |
bde9822d7b1bdbd09749c7cdeaf59ccf0a0140eef8e735a0892cb1a4c6f9fc85 | uhc/uhc | Substitution.hs | {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-----------------------------------------------------------------------------
-- | License : GPL
--
-- Maintainer :
-- Stability : provisional
-- Portability : non-portable (requires extensions)
-----------------------------------------... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/src/top/Interface/Substitution.hs | haskell | # OPTIONS -fglasgow-exts -fallow-undecidable-instances #
---------------------------------------------------------------------------
| License : GPL
Maintainer :
Stability : provisional
Portability : non-portable (requires extensions)
---------------------------------------------------------... |
module Top.Interface.Substitution where
import Top.Types
import Top.Monad.Select
import Top.Monad.StateFix
import Top.Interface.Basic (ErrorLabel(..))
data ClassSubst = ClassSubst
deSubst :: (Embedded ClassSubst (s (StateFixT s m)) t, Monad m) => Select t (StateFixT s m) a -> StateFixT s m a
deSubst = deselectFor ... |
85dd78e10d46566729abce9142ca1acd0f6b581a5cd14a367dfa2610cce5ca3b | RefactoringTools/HaRe | tstpfe1.hs | import System(getArgs)
import HsParser(parse)
import ReAssocBase()
import FreeNamesBase()
import PPModules()
import Pfe1Cmds(pfe1)
main = pfe1 parse =<< getArgs
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/tools/pfe/tstpfe1.hs | haskell | import System(getArgs)
import HsParser(parse)
import ReAssocBase()
import FreeNamesBase()
import PPModules()
import Pfe1Cmds(pfe1)
main = pfe1 parse =<< getArgs
| |
c11f30f4108fcacc10d3df1a78e90a82f5f5966c2bc255fe920633ea15e3c65a | nbouscal/poker.hs | Types.hs | # LANGUAGE TemplateHaskell #
module Poker.Types where
------------------------------------------------------------------------------
import Control.Lens
import Control.Monad.State hiding (state)
import Data.DeriveTH
import Data.Function
-----------------------------------------... | null | https://raw.githubusercontent.com/nbouscal/poker.hs/6ece5ee79fa6210867221f5eb35de8ff65bcaae9/src/Poker/Types.hs | haskell | ----------------------------------------------------------------------------
---------------------------------------------------------------------------- | # LANGUAGE TemplateHaskell #
module Poker.Types where
import Control.Lens
import Control.Monad.State hiding (state)
import Data.DeriveTH
import Data.Function
data Rank = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten
| Jack | Queen | King | Ace
derivi... |
26e2faafd10324487c95f89918fb5814d9031f320a6068e75653d7641ea7a2d3 | lamdu/hypertypes | Traversable.hs | # LANGUAGE TemplateHaskell #
| Generate ' HTraversable ' and related instances via
module Hyper.TH.Traversable
( makeHTraversable
, makeHTraversableAndFoldable
, makeHTraversableAndBases
, makeHTraversableApplyAndBases
) where
import qualified Control.Lens as Lens
import Hyper.Class.Traversable... | null | https://raw.githubusercontent.com/lamdu/hypertypes/161142e0d9f503194b85fb6f5b2a5907a1ae3783/src/Hyper/TH/Traversable.hs | haskell | | Generate 'HTraversable' and 'Hyper.Class.Apply.HApply' instances along with all of their base classes:
'Hyper.Class.Pointed.HPointed', and 'Hyper.Class.Nodes.HNodes'.
| Generate a 'HTraversable' instance along with the instance of its base classes:
| Generate a 'HTraversable' instance | # LANGUAGE TemplateHaskell #
| Generate ' HTraversable ' and related instances via
module Hyper.TH.Traversable
( makeHTraversable
, makeHTraversableAndFoldable
, makeHTraversableAndBases
, makeHTraversableApplyAndBases
) where
import qualified Control.Lens as Lens
import Hyper.Class.Traversable... |
d7041ae33ff01ca6d5bf7fd56ced59fb8b89d0de44687ebc0dfd4db65fd59d02 | falgon/htcc | NaturalTransformations.hs | |
Module : Htcc . Utils . NaturalTransformations
Description : Utilities of natural transformations
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Utilities of natural transformations
Module : Htcc.Utils.NaturalTransforma... | null | https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/Utils/NaturalTransformations.hs | haskell | # LANGUAGE Rank2Types, TypeOperators # | |
Module : Htcc . Utils . NaturalTransformations
Description : Utilities of natural transformations
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Utilities of natural transformations
Module : Htcc.Utils.NaturalTransforma... |
8b1f8c9aa3d13716b986fb84d9c1ee3e4031e833c897384002bbac271ad0e217 | HugoPeters1024/hs-sleuth | Cut.hs | | Cut into a file , selecting certain columns ( e.g. columns 10 to 40 )
--
-- Tested in this benchmark:
--
-- * Reading the file
--
-- * Splitting into lines
--
-- * Taking a number of characters from the lines
--
-- * Joining the lines
--
-- * Writing back to a handle
--
module Benchmarks.Programs.Cut
( benchmar... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/385655e62031959a14a3bac5e9ccd1c42c045f0c/test-project/text-1.2.3.2/benchmarks/haskell/Benchmarks/Programs/Cut.hs | haskell |
Tested in this benchmark:
* Reading the file
* Splitting into lines
* Taking a number of characters from the lines
* Joining the lines
* Writing back to a handle
| | Cut into a file , selecting certain columns ( e.g. columns 10 to 40 )
module Benchmarks.Programs.Cut
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnfIO)
import System.IO (Handle, hPutStr)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as BC
import qualified... |
cfc986f6e37efb145dcf6527457963b4a23f17347e2aabb5007497d2c929db52 | lemmaandrew/CodingBatHaskell | in1To10.hs | From
Given a number n , return true if n is in the range 1 .. 10 , inclusive . Unless outsideMode
is true , in which case return true if the number is less or equal to 1 , or greater
or equal to 10 .
Given a number n, return true if n is in the range 1..10, inclusive. Unless outsideMode
is true, in which ca... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Logic-1/in1To10.hs | haskell | From
Given a number n , return true if n is in the range 1 .. 10 , inclusive . Unless outsideMode
is true , in which case return true if the number is less or equal to 1 , or greater
or equal to 10 .
Given a number n, return true if n is in the range 1..10, inclusive. Unless outsideMode
is true, in which ca... | |
cb0d07952c5a50eca2797fb2a745e463e28cfecf2122447f3aa467abfdd91149 | s-expressionists/Concrete-Syntax-Tree | ensure-proper.lisp | (cl:in-package #:concrete-syntax-tree)
(defgeneric ensure-proper (lambda-list))
(defmethod ensure-proper ((lambda-list atom-cst))
(if (null lambda-list)
lambda-list
(list (make-instance 'atom-cst :raw '&rest)
lambda-list)))
(defmethod ensure-proper ((lambda-list cons-cst))
(let ((rest (en... | null | https://raw.githubusercontent.com/s-expressionists/Concrete-Syntax-Tree/a56a5246fbaa90b98a29368c011a6616f2bcb482/Lambda-list/ensure-proper.lisp | lisp | (cl:in-package #:concrete-syntax-tree)
(defgeneric ensure-proper (lambda-list))
(defmethod ensure-proper ((lambda-list atom-cst))
(if (null lambda-list)
lambda-list
(list (make-instance 'atom-cst :raw '&rest)
lambda-list)))
(defmethod ensure-proper ((lambda-list cons-cst))
(let ((rest (en... | |
938568702a7dbbd4d297a2c680c1659dc2ca47999a4226be502e47688551ccaa | helium/erlang-libp2p | libp2p_swarm_group_sup.erl | -module(libp2p_swarm_group_sup).
-behavior(supervisor).
% supervisor
-export([start_link/1, init/1]).
% api
-export([sup/1]).
-define(SUP, group_sup).
start_link(TID) ->
supervisor:start_link(reg_name(TID), ?MODULE, [TID]).
reg_name(TID)->
{local,libp2p_swarm:reg_name_from_tid(TID, ?MODULE)}.
init([TID]) ... | null | https://raw.githubusercontent.com/helium/erlang-libp2p/d587854c8a1f093576bbd05ab4616bcc2693e600/src/libp2p_swarm_group_sup.erl | erlang | supervisor
api | -module(libp2p_swarm_group_sup).
-behavior(supervisor).
-export([start_link/1, init/1]).
-export([sup/1]).
-define(SUP, group_sup).
start_link(TID) ->
supervisor:start_link(reg_name(TID), ?MODULE, [TID]).
reg_name(TID)->
{local,libp2p_swarm:reg_name_from_tid(TID, ?MODULE)}.
init([TID]) ->
_ = ets:inse... |
2d965719e488bfd8e3ce75a6b480e3827bb543a938e7e5a3e315117810ceb023 | ucsd-progsys/liquidhaskell | DupAlias.hs | @ LIQUID " --expect - error - containing = Multiple definitions of Type Alias ` BoundedNat ` " @
{-@ LIQUID "--expect-error-containing=Multiple definitions of Pred Alias `Foo`" @-}
module DupAlias () where
import Language.Haskell.Liquid.Prelude
@ type BoundedNat N = { v : v < N } @
@ predicate = V < N ... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/errors/DupAlias.hs | haskell | @ LIQUID "--expect-error-containing=Multiple definitions of Pred Alias `Foo`" @
FIX: should WARN that there are duplicate aliases!
@ foo :: n:Int -> m:(BoundedNat n) -> Nat @ | @ LIQUID " --expect - error - containing = Multiple definitions of Type Alias ` BoundedNat ` " @
module DupAlias () where
import Language.Haskell.Liquid.Prelude
@ type BoundedNat N = { v : v < N } @
@ predicate = V < N @
TODO : Test fails when this second alias is ALSO defined .
@ type BoundedNat... |
cbbd737e20a2f505658d1a32d4610294f4cda974ba6a1d1cc89ba88c751a3dec | poscat0x04/telegram-types | Commands.hs | module Web.Telegram.Types.API.Commands
( SetMyCommands (..),
)
where
import Web.Telegram.Types.Internal.API.SetMyCommands
| null | https://raw.githubusercontent.com/poscat0x04/telegram-types/c09ccc81cff10399538894cf2d1273022c797e18/src/Web/Telegram/Types/API/Commands.hs | haskell | module Web.Telegram.Types.API.Commands
( SetMyCommands (..),
)
where
import Web.Telegram.Types.Internal.API.SetMyCommands
| |
5faf09762bb5526933e955f1ca7db2ed64de7f531d7ad039ad79805e0f9bf026 | sfertman/easy-rpc | http.clj | (ns easy-rpc.server.http
(:require
[easy-rpc.server.handler :refer [invoke-fn]]
[easy-rpc.wire.core :refer [serialize deserialize]]
[org.httpkit.server :as http]
[reitit.ring :as ring]))
(defn deserialized-body
[wire request]
(update
request
:body
(partial deserialize wire)))
(defn s... | null | https://raw.githubusercontent.com/sfertman/easy-rpc/6c05d2b18fb16671608fdd91a4693a55f473d1b2/src/easy_rpc/server/http.clj | clojure | (ns easy-rpc.server.http
(:require
[easy-rpc.server.handler :refer [invoke-fn]]
[easy-rpc.wire.core :refer [serialize deserialize]]
[org.httpkit.server :as http]
[reitit.ring :as ring]))
(defn deserialized-body
[wire request]
(update
request
:body
(partial deserialize wire)))
(defn s... | |
57968cbc1f4ff26a2c071897dff99ab44056288217f18e3e86ddf1fae47baa5f | clojure/tools.logging | impl.clj | Copyright ( c ) . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By using this software in any fashion, you are
;; agreeing to be bound by the ... | null | https://raw.githubusercontent.com/clojure/tools.logging/31073fe1fbb0533f3c775fa667de70809f24b127/src/main/clojure/clojure/tools/logging/impl.clj | clojure | Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software. | Copyright ( c ) . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
(ns ^{:author "Alex Taggart"
:doc "Protocols used to allow access to logging implementations.
This namespace only need be used by those providing logging
implementat... |
460892559d24cceb9c6d375c6d335a0706e102d86fe2138b5be65f23d4b6306f | victornicolet/parsynt | Naming.ml | (* I/O file utils *)
open Base
open Stdio
open Config
let tmp_file_index = ref 0
let tmp_file (base : string) (extension : string) : string =
let i = !tmp_file_index in
let hd = Caml.Filename.remove_extension (Caml.Filename.basename !master_file) in
tmp_file_index := i + 1;
tmp_dir ^ "/" ^ hd ^ "_" ^ base ^ I... | null | https://raw.githubusercontent.com/victornicolet/parsynt/d3f530923c0c75537b92c2930eb882921f38268c/src/utils/Naming.ml | ocaml | I/O file utils
Other naming conventions
File extensions, | open Base
open Stdio
open Config
let tmp_file_index = ref 0
let tmp_file (base : string) (extension : string) : string =
let i = !tmp_file_index in
let hd = Caml.Filename.remove_extension (Caml.Filename.basename !master_file) in
tmp_file_index := i + 1;
tmp_dir ^ "/" ^ hd ^ "_" ^ base ^ Int.to_string i ^ exte... |
f5e0bf30f92d39ee63022fb743769d3662578e935289f59599daa84a5b821ed8 | ideas-edu/ideas | QuickCheck.hs | -----------------------------------------------------------------------------
Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are included in the distribution .
-------... | null | https://raw.githubusercontent.com/ideas-edu/ideas/f84907f92a8c407b7313f99e65a08d2646dc1565/src/Ideas/Utils/QuickCheck.hs | haskell | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
|
Maintainer :
Stability : provisional
---------------------------------------------------------------------------
* Data type
* Constructors
* ... | Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are included in the distribution .
Portability : portable ( depends on ghc )
Extensions to the QuickCheck library... |
48aeb184ac52c19b5378a53249420a27306a5c0bdbda5dc5c1de562ff6115b7e | DaniruKun/spacex-iss-docking-sim-autopilot | dragon.clj | (ns iss-sim-auto-docking.dragon
(:require [etaoin.keys :as k]
[etaoin.api :refer :all]
[clojure.math.numeric-tower :as math]
[iss-sim-auto-docking.telemetry :as tel])
(:gen-class))
(def comma ",")
(def point ".")
;; thresholds
(def max-def-rot-rate 0.1)
(def max-approach-rate 2... | null | https://raw.githubusercontent.com/DaniruKun/spacex-iss-docking-sim-autopilot/090fd29deead016efe399e5957715dce24a4f2c1/src/iss_sim_auto_docking/dragon.clj | clojure | thresholds
ms
ms
RCS control functions
left
right
Alignment functions
Public functions
Rotation alignment
Translation alignment | (ns iss-sim-auto-docking.dragon
(:require [etaoin.keys :as k]
[etaoin.api :refer :all]
[clojure.math.numeric-tower :as math]
[iss-sim-auto-docking.telemetry :as tel])
(:gen-class))
(def comma ",")
(def point ".")
(def max-def-rot-rate 0.1)
(def max-approach-rate 2.0)
(def max-f... |
ee9838e6bf7238650232352e4b2065ebeba40e9163e78c9a0a696489e454cf81 | CSCfi/rems | applications.clj | (ns rems.db.applications
"Query functions for forms and applications."
(:require [clojure.core.cache.wrapped :as cache]
[clojure.java.jdbc :as jdbc]
[clojure.set :as set]
[clojure.test :refer [deftest is]]
[clojure.tools.logging :as log]
[conman.core :as c... | null | https://raw.githubusercontent.com/CSCfi/rems/a384f86dee110e44e2c09475270ac27f31c6e8b7/src/clj/rems/db/applications.clj | clojure | Creating applications
avoid conflicts due to serializable isolation; otherwise this transaction would need retry logic
Running commands
Fetching applications (for API)
TODO: no caching for these, but they're only used by command handlers currently
application not found
to populate required :field/private attribu... | (ns rems.db.applications
"Query functions for forms and applications."
(:require [clojure.core.cache.wrapped :as cache]
[clojure.java.jdbc :as jdbc]
[clojure.set :as set]
[clojure.test :refer [deftest is]]
[clojure.tools.logging :as log]
[conman.core :as c... |
23e8214ebf281d60946349d6546ce47f43027b21120cd64dd2a698f53f94bf13 | SamuelSchlesinger/hs-ts | API.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE DerivingStrategies #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# LANGUAGE PolyKinds #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds... | null | https://raw.githubusercontent.com/SamuelSchlesinger/hs-ts/426dc6e5149cc5377f94faf717c3b1ab1bfbdb0d/src/Web/API.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE DerivingStrategies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# LANGUAGE PolyKinds #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
# ... |
1de515f0e3831505b480b6a7953757ab03b51bef00b39e4bec34542b2e2ca8a4 | basho-labs/luwak | luwak_checksum.erl | -module(luwak_checksum).
-export([sha1/2]).
sha1(Riak, File) ->
Length = luwak_file:length(Riak, File),
sha1_int(crypto:sha_init(), luwak_get_stream:start(Riak, File, 0, Length)).
sha1_int(Ctx, GetStream) ->
case luwak_get_stream:recv(GetStream, 1000) of
{error, timeout} -> {error, timeout};
... | null | https://raw.githubusercontent.com/basho-labs/luwak/ec413dc5edd3fc7c1acfecac2a954703480d9f78/src/luwak_checksum.erl | erlang | -module(luwak_checksum).
-export([sha1/2]).
sha1(Riak, File) ->
Length = luwak_file:length(Riak, File),
sha1_int(crypto:sha_init(), luwak_get_stream:start(Riak, File, 0, Length)).
sha1_int(Ctx, GetStream) ->
case luwak_get_stream:recv(GetStream, 1000) of
{error, timeout} -> {error, timeout};
... | |
a799d06c136a3bf21726bbb1e86cf1f16f44e4f237fa57e4c904b37eab768b0f | cpeikert/Lol | SymmBGV.hs | |
Module : Crypto . Lol . Applications . SymmBGV
Description : Symmetric - key homomorphic encryption .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
\ ( \def\O{\mathcal{O } } \ )
... | null | https://raw.githubusercontent.com/cpeikert/Lol/4416ac4f03b0bff08cb1115c72a45eed1fa48ec3/lol-apps/Crypto/Lol/Applications/SymmBGV.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeOperators #
* Da... | |
Module : Crypto . Lol . Applications . SymmBGV
Description : Symmetric - key homomorphic encryption .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
\ ( \def\O{\mathcal{O } } \ )
... |
2a664de9def0267705b1ec0f953f31a770efb263fa155d54fc5d0f7907530492 | williamleferrand/accretio | ys_typeahead.ml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/client/ys_typeahead.ml | ocaml | this can probably be refactored and made a little bit more elegant .. |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... |
620c7a8a741082554c6f1b3cb9c19a40585af990451893b9047a1c909e7732a9 | robx/puzzle-draw | PuzzleTypes.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Draw.PuzzleTypes
( lits,
geradeweg,
fillomino,
masyu,
nurikabe,
latintapa,
sudoku,
thermosudoku,
pyramid,
kpyramid,
slither,
liarslither,
... | null | https://raw.githubusercontent.com/robx/puzzle-draw/936f4c9bf8ff576fb657b7c05067504734adae14/src/Draw/PuzzleTypes.hs | haskell | # LANGUAGE ConstraintKinds # | # LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Draw.PuzzleTypes
( lits,
geradeweg,
fillomino,
masyu,
nurikabe,
latintapa,
sudoku,
thermosudoku,
pyramid,
kpyramid,
slither,
liarslither,
tightfitskyscrapers,
wordloop... |
0ccecce5a9bb431534d3da057e712506ea1c03e852e2602a33fbbf6f0d491cc2 | mmirman/ImperativeHaskell | Main.hs | # LANGUAGE
RankNTypes ,
TemplateHaskell ,
NoMonomorphismRestriction
#
RankNTypes,
TemplateHaskell,
NoMonomorphismRestriction
#-}
-----------------------------------------------------------------------------
-- |
-- Module : Main
Author : ( )
-- Stability : experiment... | null | https://raw.githubusercontent.com/mmirman/ImperativeHaskell/08de62743d67be12406afe7ac5e0d1257545c739/Main.hs | haskell | ---------------------------------------------------------------------------
|
Module : Main
Stability : experimental
Portability : portable
Some exampes of use.
---------------------------------------------------------------------------
| # LANGUAGE
RankNTypes ,
TemplateHaskell ,
NoMonomorphismRestriction
#
RankNTypes,
TemplateHaskell,
NoMonomorphismRestriction
#-}
Author : ( )
Description : An example module for Control . Monad . Imperative
module Main where
import Control.Monad.Imperative
swap(r1,... |
38da9eab9cdac8941337d7ecc312718bf56e8c6b070c92aeb8aa0c647b2a4c44 | osimon8/CombinatorC | encode.ml | open Bigarray
let json_output name entities =
`Assoc
[("blueprint",
`Assoc [
("entities", `List entities);
("item", `String "blueprint"); ("label", `String name)
]
)]
let to_json_string js = Yojson.Safe.pretty_to_string js
let bigstring_of_string (src: string): Zlib.bigst... | null | https://raw.githubusercontent.com/osimon8/CombinatorC/5a7ada4bbcbea1a431c92d1ce4b4a9e26b077a55/src/encode.ml | ocaml | text | open Bigarray
let json_output name entities =
`Assoc
[("blueprint",
`Assoc [
("entities", `List entities);
("item", `String "blueprint"); ("label", `String name)
]
)]
let to_json_string js = Yojson.Safe.pretty_to_string js
let bigstring_of_string (src: string): Zlib.bigst... |
e605c9127391b62b23b6296f8ab726c85f9a64c98c89edb23cfcd4ee7db4c5d9 | blitz/stumpwm | sbclfix.lisp | Amixer module for StumpWM .
;;;
Copyright 2008
;;;
Maintainer :
;;;
;;; This module is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 , or ( at your option )
;;; any later version.
;;... | null | https://raw.githubusercontent.com/blitz/stumpwm/439180985920a628b18d4426f1a29b1c36576531/contrib/sbclfix.lisp | lisp |
This module is free software; you can redistribute it and/or modify
either version 2 , or ( at your option )
any later version.
This module 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. Se... | Amixer module for StumpWM .
Copyright 2008
Maintainer :
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
the Free Software Foundation , Inc. , 59 Temple Place , Suite 330 ,
Boston , MA 02111 - 1307 USA
Thanks to ... |
d9f9fda8e65a3eb45615738c7f9f29e9596a2f90e0913fb47ce7dd8415cdf334 | merijn/lambda-except | AST.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module AST
( N... | null | https://raw.githubusercontent.com/merijn/lambda-except/e043c0eb547e58fc9aa06c5fe35bfd9a5c699340/AST.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE RankNTypes #
Functions
Classes
Instances | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module AST
( Name(..)
, Named(..)
, NamedVar
, Type(..)
, Dat... |
044c14f4b6f083859b9e92df5f1ee36dd88442ae4c96dae24f807f2b2bff53f7 | Engil/Toolboy | uint16.ml | let max_int = 65_535
let add a b = (a + b) land max_int
let sub a b = (a - b) land max_int
let succ a = (a + 1) land max_int
let dec a = (a - 1) land max_int
let is_bit_set x bit = x land (1 lsl bit) != 0
| null | https://raw.githubusercontent.com/Engil/Toolboy/04fcda69a8b1c79a68fe316a1e85d70c93238a0c/lesserboy/uint16.ml | ocaml | let max_int = 65_535
let add a b = (a + b) land max_int
let sub a b = (a - b) land max_int
let succ a = (a + 1) land max_int
let dec a = (a - 1) land max_int
let is_bit_set x bit = x land (1 lsl bit) != 0
| |
c7d48747761e6a5812b37f094c1f1aff129bd49f9f321e7ab1bf4d1433d03a08 | prg-titech/Kani-CUDA | toy.rkt | #lang rosette
(require "../../lang.rkt")
(require rosette/lib/synthax)
(current-bitwidth #f)
(define-synthax (arith-exp i j c tid-x tid-y c2 bx by nx ny nz depth)
#:base (choose (??) i j c tid-x tid-y c2 bx by nx ny nz)
#:else (choose
(??) i j c tid-x tid-y c2 bx by nx ny nz
((choose + - * /... | null | https://raw.githubusercontent.com/prg-titech/Kani-CUDA/e97c4bede43a5fc4031a7d2cfc32d71b01ac26c4/Emulator/Examples/Diffusion3d/toy.rkt | racket | (? (eq? i 0)
(eq? i (- nx 1))
(eq? j (- ny 1)))
(for ([i 60])
(for ([i 60])
(for ([i 60])
(synth-bool-exp "profile.rkt")
Desired exp: (i = 0) ? c1 : c1 - 1
'(if (not (eq? (eq? 0 tid-x) (eq? i 0))))
'(if (eq? (eq? (- i 7) -1) (not (eq? bx i))))
'(if (eq? (not (eq? nz i)) (eq? (- bx -3) i)))
'((define (arith-... | #lang rosette
(require "../../lang.rkt")
(require rosette/lib/synthax)
(current-bitwidth #f)
(define-synthax (arith-exp i j c tid-x tid-y c2 bx by nx ny nz depth)
#:base (choose (??) i j c tid-x tid-y c2 bx by nx ny nz)
#:else (choose
(??) i j c tid-x tid-y c2 bx by nx ny nz
((choose + - * /... |
d95146d8b6e4c71376a0c2aca38ad82a5b5423bfc11b7cecb487637639cbd119 | TokTok/hs-toxcore-c | C.hs | module Network.Tox.C
( module M
) where
import Network.Tox.C.Constants as M
import Network.Tox.C.Options as M
import Network.Tox.C.Tox as M
import Network.Tox.C.Type as M
import Network.Tox.C.Version as M
import Network.Tox.Types.Event... | null | https://raw.githubusercontent.com/TokTok/hs-toxcore-c/afe85eb05810abc8d43ca17e31f49b643f7bc89a/src/Network/Tox/C.hs | haskell | module Network.Tox.C
( module M
) where
import Network.Tox.C.Constants as M
import Network.Tox.C.Options as M
import Network.Tox.C.Tox as M
import Network.Tox.C.Type as M
import Network.Tox.C.Version as M
import Network.Tox.Types.Event... | |
b17d1fb683938535cd1e7797846faf0fc54356ccab35cea53c05d369b8c9bd0c | anuragsoni/postgres-protocol | io.mli | module Socket : sig
type t =
| Regular of Lwt_unix.file_descr
| Tls of Tls_lwt.Unix.t
end
val run : Socket.t -> Postgres.Connection.driver
| null | https://raw.githubusercontent.com/anuragsoni/postgres-protocol/e3e1743c138e527a2285dfd1eb240f49fd764b25/postgres-lwt-unix/io.mli | ocaml | module Socket : sig
type t =
| Regular of Lwt_unix.file_descr
| Tls of Tls_lwt.Unix.t
end
val run : Socket.t -> Postgres.Connection.driver
| |
2272d7155c07ae80cfd952fb65e714a6bac2556a01127cfdffe29f20255f5c09 | softwarelanguageslab/maf | R5RS_gabriel_diviter-1.scm | ; Changes:
* removed : 0
* added : 0
* swaps : 1
* negated predicates : 1
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((create-n (lambda (n)
@sensitivity:FA
(letrec ((__do_loop (lambda (n a)
@sensitivity:FA
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_gabriel_diviter-1.scm | scheme | Changes:
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 0
* swaps : 1
* negated predicates : 1
(letrec ((create-n (lambda (n)
@sensitivity:FA
(letrec ((__do_loop (lambda (n a)
@sensitivity:FA
(if (= n 0) a (__do_loop... |
01013c59235b13e6b8168908b0a5815f6d2d0eed757ab2ff135368737ad4bc47 | MarcFontaine/stm32hs | MS5611.hs | {-- todo work in progress I2C not implemented yet -}
module App.MS5611
where
import Control.Monad
import Control.Monad.IO.Class
import STM32.I2C as I2C
import qualified STM32.RTC as RTC
import qualified STM32.RCC as RCC
import qualified STM32.GPIO as GPIO
import Device
import STM32.MachineInterface
import ST... | null | https://raw.githubusercontent.com/MarcFontaine/stm32hs/d7afeb8f9d83e01c76003f4b199b45044bd4e383/STM32-Zombie/src/App/MS5611.hs | haskell | - todo work in progress I2C not implemented yet | module App.MS5611
where
import Control.Monad
import Control.Monad.IO.Class
import STM32.I2C as I2C
import qualified STM32.RTC as RTC
import qualified STM32.RCC as RCC
import qualified STM32.GPIO as GPIO
import Device
import STM32.MachineInterface
import STM32.Utils
barometer :: IO ()
barometer = runM... |
b91312509af9cff3ed8d6aaad7eeceb3f51e4add85cda4d288aec15d0cfa2f1c | Incubaid/arakoon | oUnit_XML.ml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | null | https://raw.githubusercontent.com/Incubaid/arakoon/43a8d0b26e4876ef91d9657149f105c7e57e0cb0/src/tools/oUnit_XML.ml | ocaml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | |
86ebbc766231c9d72842e007d3a1a630f0053955182999740c6332ffe5d2fe37 | hercules-ci/hercules-ci-agent | Effect.hs | # LANGUAGE BlockArguments #
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
module Hercules.Effect where
import Control.Monad.Catch (MonadThrow)
import qualified Data.Aeson as A
import qualified Data.Aeson.KeyMap as AK
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import q... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/be8142e7f38eba5e3805f21d5b6423ce7239e0f0/hercules-ci-agent/src/Hercules/Effect.hs | haskell | | Write secrets to file based on secretsMap value
| Whether we're in a friendly context, such as the CLI.
| Optional source file
| Declared secrets from the effect derivation
| Local secrets
| Server secrets
Hide the condition
This is only ok in friendly mode (hci)
| Whether we can relax security in favor of u... | # LANGUAGE BlockArguments #
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
module Hercules.Effect where
import Control.Monad.Catch (MonadThrow)
import qualified Data.Aeson as A
import qualified Data.Aeson.KeyMap as AK
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import q... |
aa34568af7e82d7fc2a37d2e957d9e6e73df3fa68f2a562fa22f4820f5cf511c | ku-fpg/haskino | GenEitherTypes.hs | -------------------------------------------------------------------------------
-- |
-- Module : GenEitherTypes
Copyright : ( c ) University of Kansas
-- License : BSD3
-- Stability : experimental
--
Generator for Haskino Ether types
---------------------------------------------------------------... | null | https://raw.githubusercontent.com/ku-fpg/haskino/9a0709c92c2da9b9371e292b00fd076e5539eb18/tools/GenEitherTypes.hs | haskell | -----------------------------------------------------------------------------
|
Module : GenEitherTypes
License : BSD3
Stability : experimental
----------------------------------------------------------------------------- | Copyright : ( c ) University of Kansas
Generator for Haskino Ether types
module Main where
typeNameList = ["Unit", "Bool", "W8", "W16", "W32",
"I8", "I16", "I32", "I", "L8", "Float"]
typeList = ["()", "Bool", "Word8", "Word16", "Word32",
"Int8", "In... |
2b3605aa5bb17aff91cca9a9a6d69a8a9f48a4407f5f1cf5e319be2815cca5a5 | helins/kafka.clj | project.clj | (defproject dvlopt/kafka
"1.3.1"
:description "Clojure client for Kafka"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[dvlopt/void "0.0.1"]
[org.apache.kafka/kafka-clients "2.1.0"]
... | null | https://raw.githubusercontent.com/helins/kafka.clj/ecf688f1a8700491c2cd65bcfb19a3781aa4f575/project.clj | clojure | (defproject dvlopt/kafka
"1.3.1"
:description "Clojure client for Kafka"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[dvlopt/void "0.0.1"]
[org.apache.kafka/kafka-clients "2.1.0"]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.