_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 |
|---|---|---|---|---|---|---|---|---|
47e5327023aef384bdbdc163abd2f94f4f3f3f983ea0220f7719c9f7bfa6dd93 | cloojure/tupelo | impl.cljc | 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 th... | null | https://raw.githubusercontent.com/cloojure/tupelo/129e795434637d9c1d744d069a15ed14bd417e07/src/cljc/tupelo/core/impl.cljc | clojure | (-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.
from plumatic schema/macros.clj
from plumatic sche... | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse Public License 1.0
(ns tupelo.core.impl
"Tupelo - Making Clojure even sweeter"
(:require
[clojure.core :as cc]
[clojure.string :as str]
[schema.core :as s]))
"Take the &env fr... |
694ec8d2fc9245b38c21b1cb6aa59f430eebee0a548cde012393dccb83615837 | ghc/testsuite | twins.hs | # LANGUAGE RankNTypes , LiberalTypeSynonyms #
-- This test checks that deep skolemisation and deep
-- instanatiation work right. A buggy prototype
of GHC 7.0 , where the type checker generated wrong
code , sent applyTypeToArgs into a loop .
module Twins where
import Data.Data
type GenericQ r = forall a. Data ... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/twins.hs | haskell | This test checks that deep skolemisation and deep
instanatiation work right. A buggy prototype | # LANGUAGE RankNTypes , LiberalTypeSynonyms #
of GHC 7.0 , where the type checker generated wrong
code , sent applyTypeToArgs into a loop .
module Twins where
import Data.Data
type GenericQ r = forall a. Data a => a -> r
type GenericM m = forall a. Data a => a -> m a
gzip :: GenericQ (GenericM Maybe) -> Generi... |
031ed11396c950b424575ac181e2f982f00504d2a7ff427561c1f6442a757f46 | psholtz/MIT-SICP | exercise1-34.scm | ;;
Exercise 1.34
;;
;; Suppose we define the procedure:
;;
;; (define (f g) (g 2))
;;
;; Then we have:
;;
;; (f square)
4
;;
;; (f (lambda (z) (* z (+ z 1))))
6
;;
;; What happens if we (perversely) ask the interpreter to evaluate the combination (f f)? Explain.
;;
;;
;; Define the procedure f and supporting pro... | null | https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Section-1.3/mit-scheme/exercise1-34.scm | scheme |
Suppose we define the procedure:
(define (f g) (g 2))
Then we have:
(f square)
(f (lambda (z) (* z (+ z 1))))
What happens if we (perversely) ask the interpreter to evaluate the combination (f f)? Explain.
Define the procedure f and supporting procedures:
Expand the expression (f f):
| Exercise 1.34
4
6
(define (f g) (g 2))
(define (square x) (* x x))
Expand the first example :
(f square)
(square 2)
(* 2 2)
4
Expand the second example :
(f (lambda (z) (* z (+ z 1))))
((lambda (z) (* z (+ z 1))) 2)
(* 2 (+ 2 1))
(* 2 3)
6
(f f)
(f 2)
(2 2)
ERROR - > the object 2 is not applicable .
... |
be3531f7a74ba124908d590220849ac10d18c4a7886980ac4c8e2c62d1838227 | uhc/uhc | TySyn1.hs | ----------------------------------------------------------------------------------------
what : type synonym
expected : error about limit of tysyn expansion
----------------------------------------------------------------------------------------
what : type synonym
expected: error about limit... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/test/regress/99/TySyn1.hs | haskell | --------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------- -} | what : type synonym
expected : error about limit of tysyn expansion
what : type synonym
expected: error about limit of tysyn expansion
module Main where
type X a = X a
x :: X Int
x = 3::Int
main = return () |
ce5fa004ad0c1bb8b4dcfbeb16c845872715299bcf4cb1f4e92c74cb4c7441bf | LexiFi/csml | ast.ml | This file is released under the terms of an MIT - like license .
(* See the attached LICENSE file. *)
Copyright 2016 by LexiFi .
open Lexer
AST
type ptyp = PTyp of loc * string * ptyp list | PArrow of arrow
and arrow = ptyp list *... | null | https://raw.githubusercontent.com/LexiFi/csml/1bdffc60b937b0cd23730589b191940cd1861640/src/ast.ml | ocaml | See the attached LICENSE file.
IDL AST for C# -> ML
IDL AST for ML -> C# | This file is released under the terms of an MIT - like license .
Copyright 2016 by LexiFi .
open Lexer
AST
type ptyp = PTyp of loc * string * ptyp list | PArrow of arrow
and arrow = ptyp list * ptyp option
type cs_kind =
| Ctor
| Instance of string
| Static... |
50526ac4c03cd059c86707b094fe695c4d2cda95389a63c69a5dc4f265af1686 | informatimago/lisp | ed.lisp | -*- coding : utf-8 -*-
;;;;****************************************************************************
FILE : ed.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
;;;; See defpackage documentation string.
;;;;
< PJB > ... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/common-lisp/ed/ed.lisp | lisp | ****************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
See defpackage documentation string.
Not complete.
(Still waiting on regexp package...).
In: 1,20!(do-something-with *input*)
*inserted in the ... | -*- coding : utf-8 -*-
FILE : ed.lisp
USER - INTERFACE :
< PJB > < >
MODIFICATIONS
2012 - 03 - 31 < PJB > Made a few corrections .
2003 - 12 - 19 < PJB > Created .
* input * is not bound to the 20 lines , and the output is not
AGPL3
Copyright 2003 - 2016
... |
b965a85c879831253a701fda179a21ca1a2235f2b9fa85ebe256377c0c00a367 | dbuenzli/logs | test_formatter.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 The logs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/logs/f948d255cde88b5b8a3d0e3ab16120e55d748836/test/test_formatter.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 The logs programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | |
2ddd91c39b6069a14bfd0a718560a35158644cf5cc580b2bc0222039c8c571a5 | decomplect/ion | core.cljs | (ns ion.poly.core
(:require-macros
[cljs.core.async.macros :refer [go go-loop]])
(:require
[cljs.core :as cljs]
[cljs.core.async :refer [<! >! chan close! put! sliding-buffer timeout]]
[clojure.string :as string]
[goog.async.AnimationDelay]
[goog.async.nextTick]
[goog.date.Date]
[goog.date.... | null | https://raw.githubusercontent.com/decomplect/ion/72e7a9b9359112832c928017d307a71317b84802/src/ion/poly/core.cljs | clojure | -----------------------------------------------------------------------------
The top-Level goog namespace has properties and functions worth knowing about.
-clojurescript-builds.html
goog.define
-----------------------------------------------------------------------------
String Helpers - For additional function... | (ns ion.poly.core
(:require-macros
[cljs.core.async.macros :refer [go go-loop]])
(:require
[cljs.core :as cljs]
[cljs.core.async :refer [<! >! chan close! put! sliding-buffer timeout]]
[clojure.string :as string]
[goog.async.AnimationDelay]
[goog.async.nextTick]
[goog.date.Date]
[goog.date.... |
95fe46daf465370a6bb1f0bdc88dff9c831803b1c3bddf471dbc083ebfef1d2f | haskell-opengl/OpenGLRaw | DebugOutput.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.AMD.DebugOutput
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
--------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/AMD/DebugOutput.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.AMD.DebugOutput
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* Functions | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.AMD.DebugOutput (
glGetAMDDebugOutput,
gl_AMD_debug_output,
pattern GL_DEBUG_CATEGORY_API_ERROR_AMD,
pattern GL_DEBUG_CATEGORY_APPLICATION_AMD,
pattern GL_DEBUG_CATEGORY_DEPRECATION_AMD,
pattern GL_DEB... |
f2853fd0f7df44948d9f2c34ce74664553a3a49dfa84bc3866fd6168b9a8c85f | vyorkin/tiger | semant.mli | module ST = Symbol_table
(** Translated expression and its type *)
type expr_ty =
{ expr : Translate.t;
ty : Type.t;
}
* Type - checks an AST and produces an error in
case of mismatching types or undeclared identifiers
case of mismatching types or undeclared identifiers *)
val trans_prog : Syntax.ex... | null | https://raw.githubusercontent.com/vyorkin/tiger/54dd179c1cd291df42f7894abce3ee9064e18def/chapter5/lib/semant.mli | ocaml | * Translated expression and its type
* Type-checks and translates the
expression into intermediate code
* Translates a AST type expression into
a digested type description that we keed in
the type-level environment | module ST = Symbol_table
type expr_ty =
{ expr : Translate.t;
ty : Type.t;
}
* Type - checks an AST and produces an error in
case of mismatching types or undeclared identifiers
case of mismatching types or undeclared identifiers *)
val trans_prog : Syntax.expr -> unit
val trans_expr : Syntax.expr L... |
1146535a2c719de6fa9b333bd8f6cc88e26aa71df6e544a5e74d4c3ad39962d5 | trskop/command-wrapper | File.hs | -- |
-- Module: $Header$
-- Description: Global toolset configuration file.
Copyright : ( c ) 2018 - 2020
License : BSD3
--
-- Maintainer:
-- Stability: experimental
Portability : GHC specific language extensions .
--
-- Global toolset configuration file, i.e. one used by @command-wrapper@
-- e... | null | https://raw.githubusercontent.com/trskop/command-wrapper/4f2e2e1f63a3296ccfad9f216d75a708969890ed/command-wrapper/src/CommandWrapper/Toolset/Config/File.hs | haskell | |
Module: $Header$
Description: Global toolset configuration file.
Maintainer:
Stability: experimental
Global toolset configuration file, i.e. one used by @command-wrapper@
executable.
| Represents toolset configuration file.
| Apply configuration file to internal configuration that represents not
... | Copyright : ( c ) 2018 - 2020
License : BSD3
Portability : GHC specific language extensions .
module CommandWrapper.Toolset.Config.File
( Config(..)
, apply
, read
)
where
import Control.Applicative (pure)
import Control.Exception (Exception, catch)
import Data.Either (Either(Left, Ri... |
b115c33ff83cb99ea6e96521ee998e82eb249bb1a30a3746edee4f79bddd44a4 | spechub/Hets | PrintLe.hs | |
Module : ./HasCASL / PrintLe.hs
Description : pretty printing signatures
Copyright : ( c ) , Uni Bremen , DFKI GmbH 2002 - 2009
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
pretty printing a HasCASL env... | null | https://raw.githubusercontent.com/spechub/Hets/bbaa9dd2d2e5eb1f2fd3ec6c799a6dde7dee6da2/HasCASL/PrintLe.hs | haskell | | compute difference of class infos
| compute difference of type infos | |
Module : ./HasCASL / PrintLe.hs
Description : pretty printing signatures
Copyright : ( c ) , Uni Bremen , DFKI GmbH 2002 - 2009
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
pretty printing a HasCASL env... |
7cff99dbd3b30cce240352cf2701ffe2c325652d5fdec60ce43a3388adc75be6 | logseq/logseq | repo_conversion_test.cljs | (ns frontend.handler.repo-conversion-test
"Repo tests of directory conversion"
(:require [cljs.test :refer [deftest use-fixtures is testing]]
[clojure.string :as string]
[logseq.graph-parser.cli :as gp-cli]
[logseq.graph-parser.util :as gp-util]
[logseq.graph-parser.t... | null | https://raw.githubusercontent.com/logseq/logseq/b78c689458953dbbcf8fd93f09523508aa9040a1/src/test/frontend/handler/repo_conversion_test.cljs | clojure | logseq files aren't saved under :block/file
Counts assertions help check for no major regressions. These counts should
only increase over time as the docs graph rarely has deletions
only test file name parsing, don't consider title prop overriding
Integration test that test parsing a large graph like docs
Check i... | (ns frontend.handler.repo-conversion-test
"Repo tests of directory conversion"
(:require [cljs.test :refer [deftest use-fixtures is testing]]
[clojure.string :as string]
[logseq.graph-parser.cli :as gp-cli]
[logseq.graph-parser.util :as gp-util]
[logseq.graph-parser.t... |
de27d9bdfc684cf8d98ebed71fa0fe15da0f650e80780c036d6e5a40b52fcb78 | input-output-hk/plutus | Main.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# OPTIONS_GHC -Wno - orphans #
module Main where
import Control.Lens hiding (argument, set', (<.>))
import Control.Monad.Trans.Except
import Control.Monad.Trans.Reader
import Data.ByteString.Lazy.Char8 qualified as... | null | https://raw.githubusercontent.com/input-output-hk/plutus/bb9b5a18c26476fbf6b2f446ab267706426fec3a/plutus-core/executables/pir/Main.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
| Load flat pir and deserialize it
load pir and make sure that it is globally unique (required for retained size)
all the variable names (tynames coerced to names)
a helper lookup table of uniques to their textual represent... | # OPTIONS_GHC -Wno - orphans #
module Main where
import Control.Lens hiding (argument, set', (<.>))
import Control.Monad.Trans.Except
import Control.Monad.Trans.Reader
import Data.ByteString.Lazy.Char8 qualified as BSL
import Data.Coerce
import Data.Csv qualified as Csv
import Data.IntMap qualified as IM
import Data.L... |
5b1edf6e126700886b519d203a76625e37abb4c76cac7d3baf46e9ba89deffa8 | metosin/ring-swagger | swagger2_unit_test.clj | (ns ring.swagger.swagger2-unit-test
(:require [midje.sweet :refer :all]
[schema.core :as s]
[ring.swagger.json-schema :as rsjs]
[ring.swagger.core :as rsc]
[ring.swagger.swagger2 :as swagger2]))
;;
Schemas
;;
(s/defschema Tag
{(s/optional-key :id) (rsjs/field s/In... | null | https://raw.githubusercontent.com/metosin/ring-swagger/0ef9046174dec0ebd4cbf97d6cc5c6846ef11996/test/ring/swagger/swagger2_unit_test.clj | clojure |
Excepcted JSON Schemas
Facts
Helpers
Final json TODO: (duplicate tests to ring.swagger.swagger2-test?
| (ns ring.swagger.swagger2-unit-test
(:require [midje.sweet :refer :all]
[schema.core :as s]
[ring.swagger.json-schema :as rsjs]
[ring.swagger.core :as rsc]
[ring.swagger.swagger2 :as swagger2]))
Schemas
(s/defschema Tag
{(s/optional-key :id) (rsjs/field s/Int {:de... |
c25d3b428b7892be201d68482f58ca46fe836cc4566574283153944fbabe3caf | mario-goulart/awful | path-procedure.scm | (cond-expand
(chicken-4
(use awful))
(chicken-5
(import (chicken string))
(import awful srfi-13))
(else
(error "Unsupported CHICKEN version.")))
(define (ticket-id path)
(and (string-prefix? "/ticket/" path)
(and-let* ((tokens (string-split path "/"))
(_ (not (null? (cdr to... | null | https://raw.githubusercontent.com/mario-goulart/awful/990f8c6d727f6242ae1857a12164fe6ffa2e5b7f/tests/path-procedure.scm | scheme | (cond-expand
(chicken-4
(use awful))
(chicken-5
(import (chicken string))
(import awful srfi-13))
(else
(error "Unsupported CHICKEN version.")))
(define (ticket-id path)
(and (string-prefix? "/ticket/" path)
(and-let* ((tokens (string-split path "/"))
(_ (not (null? (cdr to... | |
c4b3d149090d1dbd7e98d189a7db3d3e289857223afd35f685917d59ad81943d | threatgrid/asami | analytics.cljc | (ns ^{:doc "Functions for graph analytics in Asami Index graphs"
:author "Paula Gearon"}
asami.analytics
(:require [asami.graph :as graph :refer [Graph GraphType resolve-triple
graph-add new-graph]]
[asami.common-index :as ci :refer [lowest-level-sets-f... | null | https://raw.githubusercontent.com/threatgrid/asami/870b334c5ad28a56de483770329d0f75a2489932/src/asami/analytics.cljc | clojure | (ns ^{:doc "Functions for graph analytics in Asami Index graphs"
:author "Paula Gearon"}
asami.analytics
(:require [asami.graph :as graph :refer [Graph GraphType resolve-triple
graph-add new-graph]]
[asami.common-index :as ci :refer [lowest-level-sets-f... | |
849741fdb9da9bc54ca9a8b023950867cb0f253786d4baab2b607c9466eaff9c | alanzplus/EOPL | remove-first.rkt | #lang eopl
(define remove-first
(lambda (s lst)
(if (null? lst)
'()
(if (eqv? s (car lst))
(cdr lst)
(cons
(car lst)
(remove-first s (cdr lst)))))))
(provide remove-first)
| null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch1/remove-first.rkt | racket | #lang eopl
(define remove-first
(lambda (s lst)
(if (null? lst)
'()
(if (eqv? s (car lst))
(cdr lst)
(cons
(car lst)
(remove-first s (cdr lst)))))))
(provide remove-first)
| |
5212555820e0f23c94354d531b698471e7ec50ce00755686ac54bd849987a853 | angavrilov/ecl-compute | tgt-generic-c.lisp | ;;; -*- mode:lisp; indent-tabs-mode: nil; -*-
(in-package fast-compute)
(defun temp-symbol-name (sym)
(assert (get sym 'let-clause))
(concatenate 'string "tmp_" (symbol-name sym)))
(def-form-compiler compile-generic (form stmt-p)
(`(declare ,@_)
(unless stmt-p
(text "0")))
(`(_grp ,x)
(recurse... | null | https://raw.githubusercontent.com/angavrilov/ecl-compute/466f0d287f8b6ab0e2b5c2ac03693ad4f4df6a3f/gen/tgt-generic-c.lisp | lisp | -*- mode:lisp; indent-tabs-mode: nil; -*-
This is actually incorrect, because integer division
in C is equivalent to truncate, but we use them only
for positive numbers, where there is no difference.
precisely emulate floor&rem using bit operations. |
(in-package fast-compute)
(defun temp-symbol-name (sym)
(assert (get sym 'let-clause))
(concatenate 'string "tmp_" (symbol-name sym)))
(def-form-compiler compile-generic (form stmt-p)
(`(declare ,@_)
(unless stmt-p
(text "0")))
(`(_grp ,x)
(recurse x))
(`(tmp-ref ,x)
(recurse x))
(`(i... |
d784594b9ec34cbb9bd81a51103361f2e12fb21f6b10ca92970b3f69f0ea1bc0 | juspay/atlas | Vehicle.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
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
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/parking-bap/src/Core/Common/Vehicle.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
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
dis... | |
a1f30941bf155e827c364ad0a4f9f9a1a95211cd3639df8d88b87e8cddff477a | caribou/caribou-core | adapter.clj | (ns caribou.db.adapter
(:use caribou.db.adapter.postgres
caribou.db.adapter.mysql
caribou.db.adapter.h2)
(:import [caribou.db.adapter.postgres PostgresAdapter]
[caribou.db.adapter.mysql MysqlAdapter]
[caribou.db.adapter.h2 H2Adapter]))
(defn adapter-for
"Find the right adapt... | null | https://raw.githubusercontent.com/caribou/caribou-core/6ebd9db4e14cddb1d6b4e152e771e016fa9c55f6/src/caribou/db/adapter.clj | clojure | (ns caribou.db.adapter
(:use caribou.db.adapter.postgres
caribou.db.adapter.mysql
caribou.db.adapter.h2)
(:import [caribou.db.adapter.postgres PostgresAdapter]
[caribou.db.adapter.mysql MysqlAdapter]
[caribou.db.adapter.h2 H2Adapter]))
(defn adapter-for
"Find the right adapt... | |
b1804c6d856678d024272e646b548f7a76300d1315fa3ac142dbe1bd5b8de131 | dbuenzli/vz | evidence_iris.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The evidence programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright ... | null | https://raw.githubusercontent.com/dbuenzli/vz/11056a7b5927519b4b7fa7ae762cdd2b7532936b/samples/evidence_iris.ml | ocaml | Data from
Transformed with:
sed "s/I/\"I/;s/$/\";/;s/Iris-//;s/^/ /;s/,/, /g" < bezdekIris.data | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The evidence programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright ... |
9b0d87ee8d79386778d1e056cab6843d1adbe0e50c4a3e445362c4515c9c05ce | c4-project/c4f | loadable.mli | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/plumbing/src/loadable.mli | ocaml | * Functors for constructing {!Loadable_types.S} implementations.
* {1 Functors}
* [Make] extends a [Basic] into an [S].
* [Of_sexpable] extends a [Sexpable.S] into an [S]; the added methods load
S-expressions.
* {2 Chaining}
* Makes a new {!S} from chaining a basic loadable [B] to a transformation
function... | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... |
5313112b1fe4dc4d9a956ff18f240af33cc7b301d3c4685f7c74944e9e85fad6 | cac-t-u-s/om-sharp | text-editor.lisp | ;;===========================================================================
LW Lisp Tools
Lisp programming tools for LispWorks delivered applications
;;===========================================================================
;
; This program is free software: you can redistribute it and/or modify
it un... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/74aa97891177de1d167aa5963be00f0d453a3bcd/src/api/om-lisp-LW/text-editor.lisp | lisp | ===========================================================================
===========================================================================
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed; in the hope that it ... | LW Lisp Tools
Lisp programming tools for LispWorks delivered applications
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
Authors : , ,
In... |
f6099d20b0bc124f009494ebcefd72a5ee3773aa16c4dd3add570838bd2cea16 | cse-bristol/110-thermos-ui | spatial.cljs | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-frontend.spatial
(:require [clojure.set :as set]
[thermos-specs.candidate :as candidate]
[thermos-spec... | null | https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/src/thermos_frontend/spatial.cljs | clojure | how many degrees is the biggest extent
max-extent
(- max-y min-y))
::jsts-simple-geometry jsts-simple-geom
::minimum-zoom visible-zoom
more horrible performance hackery
put new items into the index based on their bounding boxes
deindex things we can no longer see
we conv... | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-frontend.spatial
(:require [clojure.set :as set]
[thermos-specs.candidate :as candidate]
[thermos-spec... |
c54de4f3391c898f031674455bfe50692bd5543ab18c31867ee7fa6f8ed3d919 | jyh/metaprl | kat_bool.ml | extends Kat_terms
open Top_conversionals
open Base_select
open Dtactic
interactive abs_times {| intro[] |}:
[wf] sequent{ <H> >- 'C in bool} -->
[wf] sequent{ <H> >- 'B in bool} -->
sequent{ <H> >- ('B * ('B + 'C)) ~ 'B }
interactive_rw abs_timesl_rw {|reduce|}:
('C in bool) -->
('B in bool... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/kat/kat_bool.ml | ocaml | extends Kat_terms
open Top_conversionals
open Base_select
open Dtactic
interactive abs_times {| intro[] |}:
[wf] sequent{ <H> >- 'C in bool} -->
[wf] sequent{ <H> >- 'B in bool} -->
sequent{ <H> >- ('B * ('B + 'C)) ~ 'B }
interactive_rw abs_timesl_rw {|reduce|}:
('C in bool) -->
('B in bool... | |
c4912273082b484daaf5b26d247e39ea91f9a254b31b1a78bc43790444a09acf | patperry/hs-linear-algebra | Herm.hs | -----------------------------------------------------------------------------
-- |
Module : Numeric . LinearAlgebra . Packed . Herm
Copyright : Copyright ( c ) 2010 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
--
Hermitian views of packed matrices .
--
module Numeric.Lin... | null | https://raw.githubusercontent.com/patperry/hs-linear-algebra/887939175e03687b12eabe2fce5904b494242a1a/lib/Numeric/LinearAlgebra/Packed/Herm.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
* Immutable interface
** Vector multiplication
** Updates
* Mutable interface
** Vector multiplication
** Updates | Module : Numeric . LinearAlgebra . Packed . Herm
Copyright : Copyright ( c ) 2010 , < >
Maintainer : < >
Hermitian views of packed matrices .
module Numeric.LinearAlgebra.Packed.Herm (
hermMulVector,
hermMulVectorWithScale,
addHermMulVectorWithScales,
hermRank1Update,
herm... |
f69da969e62db9da91eb197205f69fdf2f7737168647d4ddfa4992b1674d142b | clj-kafka/franzy | project.clj | (defproject clj-kafka.franzy/embedded "0.0.0"
:description "Embedded Kafka servers with full configuration and validation, components, and more."
:dependencies [[org.clojure/clojure "1.8.0"]
[prismatic/schema "1.1.0"]
[com.taoensso/timbre "4.3.1"]
[com.stuartsierra... | null | https://raw.githubusercontent.com/clj-kafka/franzy/6c2e2e65ad137d2bcbc04ff6e671f97ea8c0e380/embedded/project.clj | clojure | (defproject clj-kafka.franzy/embedded "0.0.0"
:description "Embedded Kafka servers with full configuration and validation, components, and more."
:dependencies [[org.clojure/clojure "1.8.0"]
[prismatic/schema "1.1.0"]
[com.taoensso/timbre "4.3.1"]
[com.stuartsierra... | |
7ce4e8f049db35230da14f4472b305d35a2faa3e7f1e8e84791e9d4b689e1bee | KULeuven-CS/CPL | syntax.rkt | #lang eopl
(provide (all-defined-out))
;;; Syntax
(define-datatype program program?
(a-program (exp1 expression?)))
(define-datatype expression expression?
(const-exp (num number?))
(diff-exp (exp1 expression?) (exp2 expression?))
(zero?-exp (exp1 expression?))
(if-exp
(exp1 expression?)
(exp2 express... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter5/LETREC-CONT/syntax.rkt | racket | Syntax | #lang eopl
(provide (all-defined-out))
(define-datatype program program?
(a-program (exp1 expression?)))
(define-datatype expression expression?
(const-exp (num number?))
(diff-exp (exp1 expression?) (exp2 expression?))
(zero?-exp (exp1 expression?))
(if-exp
(exp1 expression?)
(exp2 expression?)
(e... |
04bf672a7a9bb4afba689cfb4cb7985ee8da71cbe7b64e2475f292944ed767ba | mikelevins/categories | protocol-pairs.scm | ;;;; ***********************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: protocol-pairs.scm
;;;; Project: Categories
;;;; Purpose: the Categories object system
;;;; Author: mikel evins
Copyright : 2013 by mikel evins
;;;;
;;;; *************... | null | https://raw.githubusercontent.com/mikelevins/categories/66e3861071e4d88b7b27421a78ab497e1fb5fa0c/0.4/src/protocol-pairs.scm | scheme | ***********************************************************************
FILE IDENTIFICATION
Name: protocol-pairs.scm
Project: Categories
Purpose: the Categories object system
Author: mikel evins
***********************************************************************
left
pair
pai... | Copyright : 2013 by mikel evins
|
e620e5912c9661b0b6863d41199fe771748909ba7016e9bb6ce2e4d2e38f5862 | lingnand/VIMonad | Submap.hs | -----------------------------------------------------------------------------
-- |
Module : XMonad . Actions . Submap
Copyright : ( c ) < >
-- License : BSD3-style (see LICENSE)
--
Maintainer : < >
-- Stability : unstable
-- Portability : unportable
--
-- A module that allows the u... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Actions/Submap.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
A module that allows the user to create a sub-mapping of key bindings.
-------------------------------------------------------------------------... | Module : XMonad . Actions . Submap
Copyright : ( c ) < >
Maintainer : < >
module XMonad.Actions.Submap (
submap,
submapDefault
) where
import Data.Bits
import XMonad hiding (keys)
import qualified Data.Ma... |
9c0596c8e57c3cef3e0df0230d65f4963f2156315a940265e7c1d25ff299b102 | Perry961002/SICP | exe3.75-make-zero-crossings.scm | 做平滑的两个参数是当前信号和前一次信号
;需要感应过零点的信号应该是当前平滑的信号和上一次平滑的信号
(define (make-zero-crossings input-stream last-value last-avpt)
(let ((avpt (/ (+ (stream-car input-stream) last-value) 2)))
(stream-cons (sign-change-detector avpt last-avpt)
(make-zero-crossings (stream-cdr input-stream)
... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap3/exercise/exe3.75-make-zero-crossings.scm | scheme | 需要感应过零点的信号应该是当前平滑的信号和上一次平滑的信号 | 做平滑的两个参数是当前信号和前一次信号
(define (make-zero-crossings input-stream last-value last-avpt)
(let ((avpt (/ (+ (stream-car input-stream) last-value) 2)))
(stream-cons (sign-change-detector avpt last-avpt)
(make-zero-crossings (stream-cdr input-stream)
(s... |
e367c9515773ba9a62135897149ec493f459411d35389057d489e5695f4214d9 | MastodonC/terraboot | cloud_config.clj | (ns terraboot.cloud-config
(:require
[clj-yaml.core :as yaml]))
(defn add-beginning [s beginning]
(str beginning s))
(defn cloud-config [{:keys [files] :as m}]
(-> m
(yaml/generate-string :dumper-options {:flow-style :block})
(add-beginning "#cloud-config\n")))
| null | https://raw.githubusercontent.com/MastodonC/terraboot/ff01428214539ad884e5c4a5fcdae8f91feae4a9/src/terraboot/cloud_config.clj | clojure | (ns terraboot.cloud-config
(:require
[clj-yaml.core :as yaml]))
(defn add-beginning [s beginning]
(str beginning s))
(defn cloud-config [{:keys [files] :as m}]
(-> m
(yaml/generate-string :dumper-options {:flow-style :block})
(add-beginning "#cloud-config\n")))
| |
5c3f14db322e5affa3d0735301b62908144103296c7b202ad0d643e0850bfb19 | zkincaid/srk | quantifier.ml | open Syntax
open Linear
open BatPervasives
include Log.Make(struct let name = "srk.quantifier" end)
exception Equal_term of Linear.QQVector.t
type quantifier_prefix = ([`Forall | `Exists] * symbol) list
module V = Linear.QQVector
module VS = BatSet.Make(Linear.QQVector)
module VM = BatMap.Make(Linear.QQVector)
mod... | null | https://raw.githubusercontent.com/zkincaid/srk/4809f2b697c02d9e020e4de2c0b11ff4a0c59f7f/src/quantifier.ml | ocaml | Compute the GCD of all coefficients in an affine term (with integral
coefficients)
floor(term/divisor) + offset
s == s' + ax, x not in fv(s')
-s'/a
-s'/a = x = t <==> -s'/a = t
-s'/a <= x = t <==> -s'/a <= t
t = x <= -s'/a <==> t <= -s'/a
-s'/a < x = t <==> -s'/a < t
t = x < -s'/a <==> t < -s'/a
-... | open Syntax
open Linear
open BatPervasives
include Log.Make(struct let name = "srk.quantifier" end)
exception Equal_term of Linear.QQVector.t
type quantifier_prefix = ([`Forall | `Exists] * symbol) list
module V = Linear.QQVector
module VS = BatSet.Make(Linear.QQVector)
module VM = BatMap.Make(Linear.QQVector)
mod... |
999574833dde1b770be394a82205dbe7bdadaf0eebfe6b6c989c6097da24968d | unisonweb/unison | Sql.hs | # LANGUAGE TemplateHaskell #
module Unison.Sqlite.Sql
( Sql (..),
sql,
)
where
import Language.Haskell.TH.Quote (QuasiQuoter (quoteExp))
import qualified Language.Haskell.TH.Syntax as TH
import qualified NeatInterpolation
import Unison.Prelude
-- | A SQL snippet.
newtype Sql
= Sql Text
deriving newtype (... | null | https://raw.githubusercontent.com/unisonweb/unison/570257faca073f73c55fff82e3c6e26d29773001/lib/unison-sqlite/src/Unison/Sqlite/Sql.hs | haskell | | A SQL snippet. | # LANGUAGE TemplateHaskell #
module Unison.Sqlite.Sql
( Sql (..),
sql,
)
where
import Language.Haskell.TH.Quote (QuasiQuoter (quoteExp))
import qualified Language.Haskell.TH.Syntax as TH
import qualified NeatInterpolation
import Unison.Prelude
newtype Sql
= Sql Text
deriving newtype (IsString, Monoid, Se... |
e9cc95031f8a8366fa4b6aef7411d337c7713f3ab6d618d34a551b46298433c7 | metawilm/cl-python | tsetup.lisp | ;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CLPYTHON.TEST -*-
;;
This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
;; distribute and use this software as governed by the terms
of the Lisp Lesser GNU Public License
;; (),
;; known as the LLGPL.
CLPython test harne... | null | https://raw.githubusercontent.com/metawilm/cl-python/bce7f80b0c67d3c9f514556f2d14d098efecdde8/test/tsetup.lisp | lisp | -*- Mode: LISP; Syntax: COMMON-LISP; Package: CLPYTHON.TEST -*-
distribute and use this software as governed by the terms
(),
known as the LLGPL.
Prevent warnings and compiler notes from failing a test.
e.g. "Closure .. will be stack allocated." interferes with test-no-error...
Enable nesting WITH-TESTS, with t... | This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
of the Lisp Lesser GNU Public License
CLPython test harness setup
#+allegro
(eval-when (:compile-toplevel :load-toplevel :execute)
Ensure the Allegro version of tester is loaded , so that package util.test is availa... |
c7f7f560aedc6f3cbec14c9ac42111bc84e6b2a70728bf47bd68ca6f3afd9189 | bscarlet/llvm-general | Coding.hs | # LANGUAGE
TemplateHaskell ,
MultiParamTypeClasses ,
FunctionalDependencies ,
UndecidableInstances
#
TemplateHaskell,
MultiParamTypeClasses,
FunctionalDependencies,
UndecidableInstances
#-}
module LLVM.General.Internal.Coding where
import LLVM.General.Prelude
import Language.Haskell.TH
i... | null | https://raw.githubusercontent.com/bscarlet/llvm-general/61fd03639063283e7dc617698265cc883baf0eec/llvm-general/src/LLVM/General/Internal/Coding.hs | haskell | # LANGUAGE
TemplateHaskell ,
MultiParamTypeClasses ,
FunctionalDependencies ,
UndecidableInstances
#
TemplateHaskell,
MultiParamTypeClasses,
FunctionalDependencies,
UndecidableInstances
#-}
module LLVM.General.Internal.Coding where
import LLVM.General.Prelude
import Language.Haskell.TH
i... | |
c9036edbe295a4cce2256b1d1c022df834a06d4ba5559e29d0a8aaaa8d57b5d4 | TatriX/cl-sdl2-tutorial | 11-clip-rendering-and-sprite-sheets.lisp | (defpackage #:sdl2-tutorial-11-clip-rendering-and-sprite-sheets
(:use :cl)
(:export :run)
(:import-from :sdl2-tutorial-utils :asset-pathname))
(in-package :sdl2-tutorial-11-clip-rendering-and-sprite-sheets)
(defparameter *screen-width* 640)
(defparameter *screen-height* 480)
(defclass tex ()
((renderer
:... | null | https://raw.githubusercontent.com/TatriX/cl-sdl2-tutorial/ac3613160df0120c4b12de6f7989add0e81c9e63/11-clip-rendering-and-sprite-sheets.lisp | lisp | (defpackage #:sdl2-tutorial-11-clip-rendering-and-sprite-sheets
(:use :cl)
(:export :run)
(:import-from :sdl2-tutorial-utils :asset-pathname))
(in-package :sdl2-tutorial-11-clip-rendering-and-sprite-sheets)
(defparameter *screen-width* 640)
(defparameter *screen-height* 480)
(defclass tex ()
((renderer
:... | |
0ec7b51345e6b026232b377e0d9a672eaefab2797d197a206d5b7e95184c7124 | facebook/pyre-check | classHierarchyEnvironmentTest.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/b01273d38792dc2b92ea6b2aa37668c4e86651fb/source/analysis/test/classHierarchyEnvironmentTest.ml | ocaml | Printf.sprintf
"%s[%s]"
Class definition changes trigger
Class attributes do not trigger
Alias changes trigger
Addition should trigger previous failed reads |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
11839161d84361e5eb3d7a08bf4f1ec25f1c523c5313c57af76e9d09b40b5974 | taffybar/taffybar | NetworkGraph.hs | -----------------------------------------------------------------------------
-- |
Module : System . . Widget . NetworkGraph
Copyright : ( c )
-- License : BSD3-style (see LICENSE)
--
Maintainer :
-- Stability : unstable
-- Portability : unportable
--
-- This module provides a channel base... | null | https://raw.githubusercontent.com/taffybar/taffybar/bb348f1c644f79993f994baf804e2673615b6b09/src/System/Taffybar/Widget/NetworkGraph.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
This module provides a channel based network graph widget.
---------------------------------------------------------------------------
| 'NetworkGr... | Module : System . . Widget . NetworkGraph
Copyright : ( c )
Maintainer :
module System.Taffybar.Widget.NetworkGraph where
import Data.Default (Default(..))
import Data.Foldable (for_)
import qualified GI.Gtk
import GI.Gtk.Objects.Widget (widgetSetTooltipMarkup)
import System.Taffybar.Context
i... |
c46e40fd411e5c0990d055ffadad514849e8f89ece83ddc95c831bd5352cb206 | yuriy-chumak/ol | http.scm | ; http server
HTTP/1.0 -
(define-library (lib http)
(export
http:run
http:parse-url
http-parser)
(import (scheme base) (srfi 1)
(owl parse)
(owl math) (owl list) (owl io) (owl string) (owl ff) (owl list-extra) (otus async)
(lang sexp))
(begin
(define (upper-case? x) (<= #\A... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/0a38b3f9dbb720aa3fbc3e8219429ebe240c86bf/libraries/lib/http.scm | scheme | http server
unique session id:
-------------------------------------------
http parser
unwise characters are allowed but may cause problems
(define (separator-char?))
A-F
a-f
a-f
A-F
))
GET/POST/etc.
HTTP/x.x
CRLF, end of request line
HTTP/x.x
OK
until CRLF
CRLF
final CRLF
)
----
todo: use atomic coun... | HTTP/1.0 -
(define-library (lib http)
(export
http:run
http:parse-url
http-parser)
(import (scheme base) (srfi 1)
(owl parse)
(owl math) (owl list) (owl io) (owl string) (owl ff) (owl list-extra) (otus async)
(lang sexp))
(begin
(define (upper-case? x) (<= #\A x #\Z))
(d... |
dcce738e709dbf35f7c25df67580f6b408995660faf1c07fadf69fead6784841 | ghc/testsuite | tc220.hs | {-# LANGUAGE DeriveDataTypeable #-}
See Trac # 1033
module Pointful' where
import Data.Generics
import Control.Monad.State
data HsExp = HsWildCard deriving( Typeable, Data )
data HsName = HsName deriving( Typeable, Data )
rename : : ( ) - > HsExp - > State ( , [ HsName ] ) HsExp
-- Type sig commented out
re... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_compile/tc220.hs | haskell | # LANGUAGE DeriveDataTypeable #
Type sig commented out |
See Trac # 1033
module Pointful' where
import Data.Generics
import Control.Monad.State
data HsExp = HsWildCard deriving( Typeable, Data )
data HsName = HsName deriving( Typeable, Data )
rename : : ( ) - > HsExp - > State ( , [ HsName ] ) HsExp
rename1 = \_ -> everywhereM (mkM (\e -> case e of HsWildCard -> ... |
9608c0cc07b2fbcdc56c58f80e69ecefde21944846eb815b28ca4cbd44b16ca3 | GillianPlatform/Gillian | RelyFramework.ml | module Make (Outcome : Outcome.S) (Suite : Suite.S) = struct
include Rely.Make (struct
let config =
Rely.TestFrameworkConfig.initialize
{
snapshotDir = "path/to/test/lib/__snapshots__";
projectDir = "path/to/your/project";
}
end)
include OutcomeExt.Make (Outcome)
o... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/1c8d65120c04ef87cda689a9d41268e25b5ffa7e/Gillian-Rely-Runner/RelyFramework.ml | ocaml | module Make (Outcome : Outcome.S) (Suite : Suite.S) = struct
include Rely.Make (struct
let config =
Rely.TestFrameworkConfig.initialize
{
snapshotDir = "path/to/test/lib/__snapshots__";
projectDir = "path/to/your/project";
}
end)
include OutcomeExt.Make (Outcome)
o... | |
239c1b1afa0589d09a2478b632b225ca93d6697356b0558016919b16456eb7ba | cbilson/ib-re-actor | account.clj | ;; # Account details
;; This namespace deals monitoring and updating account details.
;;
(ns ib-re-actor.account
(:require [ib-re-actor.gateway :as g]))
;; This atom contains the account details at all times
(defonce account-details (atom nil))
(defn update-account-details
"Update a partical key in the account de... | null | https://raw.githubusercontent.com/cbilson/ib-re-actor/cf1f4de724d2bbc143c09425456609ff385e4258/src/ib_re_actor/account.clj | clojure | # Account details
This namespace deals monitoring and updating account details.
This atom contains the account details at all times
Subscribe immediately to receiving updates | (ns ib-re-actor.account
(:require [ib-re-actor.gateway :as g]))
(defonce account-details (atom nil))
(defn update-account-details
"Update a partical key in the account details"
[{:keys [type key value currency]}]
(case type
:update-account-value
(swap! account-details assoc key
(if (nil? cu... |
97cba5f900761aa348914ed1e2538dd932f780ce73fc2e2c0606a7e36ca98e8b | wiseman/turboshrimp | turboshrimp.clj | (ns com.lemondronor.turboshrimp
"Control and telemetry library for the AR.Drone 2.0.
By John Wiseman /
/ [lemonodor]()"
(:refer-clojure :exclude [ref])
(:require
[clojure.tools.logging :as log]
[com.lemondronor.turboshrimp.at :as at]
[com.lemondronor.turboshrimp.navdata :as navdata]
[com.lemondr... | null | https://raw.githubusercontent.com/wiseman/turboshrimp/a1f53003bd4afd084e1c9e8cb80109ba732854bc/src/com/lemondronor/turboshrimp.clj | clojure | This record represents a drone. The connected?, counter,
Update the drone's current navdata.
Receipt of navdata tells us we're connected to the drone.
If a user has requested a reset of the emergency state, do that
now.
Pops all commands off the command queue and updates the command
sequence number.
Sends queu... | (ns com.lemondronor.turboshrimp
"Control and telemetry library for the AR.Drone 2.0.
By John Wiseman /
/ [lemonodor]()"
(:refer-clojure :exclude [ref])
(:require
[clojure.tools.logging :as log]
[com.lemondronor.turboshrimp.at :as at]
[com.lemondronor.turboshrimp.navdata :as navdata]
[com.lemondr... |
4c6da35a24378853c1c62d901d8b990cd5fb7647cf093429042af98e3cbc6a50 | zsol/hlogster | ConfigBase.hs | module ConfigBase where
import Text.Regex.PCRE.ByteString (Regex)
import RegexCompiler (compileRegex)
compileRegex = RegexCompiler.compileRegex
data Config =
EventCounter {name :: String, category :: String, event :: String} |
FieldCounter {name :: String, fields :: [FieldSpec]} |
RegexCounter {name :: String,... | null | https://raw.githubusercontent.com/zsol/hlogster/54879f5d8522d9685e4c607834931448cff5e92e/ConfigBase.hs | haskell | module ConfigBase where
import Text.Regex.PCRE.ByteString (Regex)
import RegexCompiler (compileRegex)
compileRegex = RegexCompiler.compileRegex
data Config =
EventCounter {name :: String, category :: String, event :: String} |
FieldCounter {name :: String, fields :: [FieldSpec]} |
RegexCounter {name :: String,... | |
e0838cf932b325bcfe23e2652dbb4156d13ed57ae746765f4ce1a521593e5c91 | ocurrent/ocurrent | compose_cli.ml | open Lwt.Infix
type t = { pull : bool }
let id = "docker-compose-cli"
module Key = struct
type t = {
name : string;
docker_context : string option;
detach : bool;
} [@@deriving to_yojson]
let digest t = Yojson.Safe.to_string (to_yojson t)
end
module Value = struct
type t = {
contents: strin... | null | https://raw.githubusercontent.com/ocurrent/ocurrent/49ee5f36da10c53da5eac58fee3d53b85e99b6e5/plugins/docker/compose_cli.ml | ocaml | open Lwt.Infix
type t = { pull : bool }
let id = "docker-compose-cli"
module Key = struct
type t = {
name : string;
docker_context : string option;
detach : bool;
} [@@deriving to_yojson]
let digest t = Yojson.Safe.to_string (to_yojson t)
end
module Value = struct
type t = {
contents: strin... | |
770d248a5ff87e2c2be51265fd9e00385adc09e0d491bfbf2cc7cb2079bdf08e | typedclojure/typedclojure | analyze_test.clj | (ns clojure.core.typed.test.analyze-test
(:require [typed.clj.checker.analyze-clj :as ana]))
(let [{:keys [a]} nil])
| null | https://raw.githubusercontent.com/typedclojure/typedclojure/45556897356f3c9cbc7b1b6b4df263086a9d5803/typed/clj.checker/test/clojure/core/typed/test/analyze_test.clj | clojure | (ns clojure.core.typed.test.analyze-test
(:require [typed.clj.checker.analyze-clj :as ana]))
(let [{:keys [a]} nil])
| |
385e164321004cc5c78f254c97de22916fadf916a1ebad1c65715cb40e1e3ed9 | lingnand/VIMonad | Theme.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Prompt.Theme
Copyright : ( C ) 2007
-- License : BSD3
--
-- Maintainer :
-- Stability : unstable
-- Portability : unportable
--
-- A prompt for changing the theme of the current workspace
---... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Prompt/Theme.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Prompt.Theme
License : BSD3
Maintainer :
Stability : unstable
Portability : unportable
A prompt for changing the theme of the current workspace
-------------------------------------------------------... | Copyright : ( C ) 2007
module XMonad.Prompt.Theme
themePrompt,
ThemePrompt,
) where
import Control.Arrow ( (&&&) )
import qualified Data.Map as M
import Data.Maybe ( fromMaybe )
import XMonad
import XMonad.Prompt
import XMonad.Layout.Decoration
import XMonad.Util.Themes
> import XMonad . P... |
a991320879477c7da31feb14b1204b77444e674277dd4fe2ce1a520d60b7d409 | AppsFlyer/ketu | chain_assoc.clj | (ns ketu.test.chain-assoc
(:require [sieppari.core :as s]))
(defn- associng-enter
"Returns an interceptor that assocs the result of (f ctx) to ctx on key k."
[[k f]]
{:enter (fn [ctx]
(assoc ctx k (f ctx)))})
(defn chain-assoc
"Similar to assoc but with an error-handler and functions instead of ... | null | https://raw.githubusercontent.com/AppsFlyer/ketu/deadce66cb72a0b272ce4397808aba09c1702392/test/ketu/test/chain_assoc.clj | clojure | (ns ketu.test.chain-assoc
(:require [sieppari.core :as s]))
(defn- associng-enter
"Returns an interceptor that assocs the result of (f ctx) to ctx on key k."
[[k f]]
{:enter (fn [ctx]
(assoc ctx k (f ctx)))})
(defn chain-assoc
"Similar to assoc but with an error-handler and functions instead of ... | |
fe5ee91f07209569322ef352062522c64a9066aa01da00413af4c5bab6a5ffe3 | portkey-cloud/aws-clj-sdk | _2013-06-30.clj | (ns portkey.aws.storagegateway.-2013-06-30 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope
{:service "storagegateway", :region "ap-northeast-1"},
:ssl-common-name "storagegateway.ap-northeast-1.amazonaws.com",
:endpoint "-northeast-1.amazonaws.com",
:signature-versio... | null | https://raw.githubusercontent.com/portkey-cloud/aws-clj-sdk/10623a5c86bd56c8b312f56b76ae5ff52c26a945/src/portkey/aws/storagegateway/_2013-06-30.clj | clojure | (ns portkey.aws.storagegateway.-2013-06-30 (:require [portkey.aws]))
(def
endpoints
'{"ap-northeast-1"
{:credential-scope
{:service "storagegateway", :region "ap-northeast-1"},
:ssl-common-name "storagegateway.ap-northeast-1.amazonaws.com",
:endpoint "-northeast-1.amazonaws.com",
:signature-versio... | |
5d6a15e9af844a0bbc8671cb166c0a875f238b428b46404f0fa5b7ab55ae23ca | input-output-hk/cardano-wallet-legacy | Accounts.hs | module Cardano.Wallet.Kernel.Accounts (
createAccount
, deleteAccount
, updateAccount
, updateAccountGap
-- * Errors
, CreateAccountError(..)
) where
import qualified Prelude
import Universum
import Formatting (bprint, build, formatToString, (%))
import qualified Form... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet-legacy/143e6d0dac0b28b3274600c6c49ec87e42ec9f37/src/Cardano/Wallet/Kernel/Accounts.hs | haskell | * Errors
^ When trying to create the 'Account', the parent 'HdRoot' was not
there.
^ When trying to create the 'Account', the 'Keystore' didn't have
^ The available number of HD accounts in use is such that trying
to find another random index would be too expensive.
| Creates a new 'Account' for the input wallet... | module Cardano.Wallet.Kernel.Accounts (
createAccount
, deleteAccount
, updateAccount
, updateAccountGap
, CreateAccountError(..)
) where
import qualified Prelude
import Universum
import Formatting (bprint, build, formatToString, (%))
import qualified Formatting as F
impo... |
8a3ca9ad1f62cf00d0c9e77815b3adcee73c2d8ba775d782861406b5308b4192 | roglo/mlrogue | rob_monster.mli | $ I d : rob_monster.mli , v 1.4 2010/05/10 17:47:51 deraugla Exp $
open Rob_def;
open Rob_misc;
open Rob_position;
type monster_power = list (int * list (int * int));
value is_flaming_monster : game -> char -> bool;
value is_fliting_monster : game -> char -> bool;
value is_freezing_monster : game -> char -> bool;
... | null | https://raw.githubusercontent.com/roglo/mlrogue/b73238bbbc8cd88c83579c3b72772a8c418020e5/rob_monster.mli | ocaml | $ I d : rob_monster.mli , v 1.4 2010/05/10 17:47:51 deraugla Exp $
open Rob_def;
open Rob_misc;
open Rob_position;
type monster_power = list (int * list (int * int));
value is_flaming_monster : game -> char -> bool;
value is_fliting_monster : game -> char -> bool;
value is_freezing_monster : game -> char -> bool;
... | |
198cfd06e414951e4363276f6148fbf2421748090849220826e5b880757dd73b | letmaik/monadiccp | OvertonFD.hs |
- Origin :
- Constraint Programming in Haskell
-
- author : , Melbourne Australia
-
- Modifications :
- Monadic Constraint Programming
- /~toms/Haskell/
-
- Origin:
- Constraint Programming in Haskell
-
- author: David Overton,... | null | https://raw.githubusercontent.com/letmaik/monadiccp/fe4498e46a7b9d9e387fd5e4ed5d0749a89d0188/src/Control/CP/FD/OvertonFD/OvertonFD.hs | haskell | ------------------------------------------------------------------------------
Solver instance -------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Con... |
- Origin :
- Constraint Programming in Haskell
-
- author : , Melbourne Australia
-
- Modifications :
- Monadic Constraint Programming
- /~toms/Haskell/
-
- Origin:
- Constraint Programming in Haskell
-
- author: David Overton,... |
42560c8008ecd31ec807d9891e7a4a3a3227a6179dd291e5c7dc3fbeb2e78df6 | tweag/ormolu | multi-line.hs | type Foo a b c
= Bar c a b
type Foo
a
b c
= Bar c a b
type Foo =
Bar
Baz
Quux
type API
= "route1" :> ApiRoute1
:<|> "route2" :> ApiRoute2 -- comment here
:<|> OmitDocs :> "i" :> ASomething API
type A -- foo
= B
| null | https://raw.githubusercontent.com/tweag/ormolu/308542e06a5042e55f4e96ff23711a6b614d529b/data/examples/declaration/type-synonyms/multi-line.hs | haskell | comment here
foo | type Foo a b c
= Bar c a b
type Foo
a
b c
= Bar c a b
type Foo =
Bar
Baz
Quux
type API
= "route1" :> ApiRoute1
:<|> OmitDocs :> "i" :> ASomething API
= B
|
acb910ada43ae4c7ae9f2b0cc060c9492aff13499a846483bb7650116284b760 | clojurebook/ClojureProgramming | test_array_set.clj | (ns com.clojurebook.test-array-set
(:use [com.clojurebook.array-set :only (array-set)])
(:use [clojure.test]))
(deftest test-array-set
(is (array-set))
(is (= (array-set) #{}))
(is (= #{} (array-set)))
(is (= #{1} (array-set 1)))
(is (false? ((array-set false) false)))
(is (nil? ((array-set nil) nil)))... | null | https://raw.githubusercontent.com/clojurebook/ClojureProgramming/bcc7c58862982a5793e22788fc11a9ed7ffc548f/ch03-array-set/test/com/clojurebook/test_array_set.clj | clojure | (ns com.clojurebook.test-array-set
(:use [com.clojurebook.array-set :only (array-set)])
(:use [clojure.test]))
(deftest test-array-set
(is (array-set))
(is (= (array-set) #{}))
(is (= #{} (array-set)))
(is (= #{1} (array-set 1)))
(is (false? ((array-set false) false)))
(is (nil? ((array-set nil) nil)))... | |
8e7111bf43f35d80ba6410269a65eef3646112609ff599c488930ec970657f9f | osa1/sc-plugin | EvalPlugin.hs | # LANGUAGE GeneralizedNewtypeDeriving , ScopedTypeVariables , TupleSections #
module Supercompilation.EvalPlugin (evalPluginPass) where
import Control.Monad.State
import Data.Bifunctor
import qualified Data.IntMap as IM
import Data.IORef
import Data.Maybe
import HERMIT.Core
import CoreMonad
import CoreSyn
import Co... | null | https://raw.githubusercontent.com/osa1/sc-plugin/1969ad81f16ca8ed8110ca8dadfccf6f3d463635/src/Supercompilation/EvalPlugin.hs | haskell | binds' <- runPE guts $ mapM (evalDef unfoldings_map) binds
evalDef_expr ufs (Case scrt b ty alts) = do
scrt' <- evalDef_expr ufs scrt
alts' <- mapM (evalDef_alt ufs) alts
return $ Case scrt' b ty alts'
-- | Unfold variables in a bottom-up way.
unfoldTemplates :: CoreExpr -> Unfoldings -> CoreExpr
un... | # LANGUAGE GeneralizedNewtypeDeriving , ScopedTypeVariables , TupleSections #
module Supercompilation.EvalPlugin (evalPluginPass) where
import Control.Monad.State
import Data.Bifunctor
import qualified Data.IntMap as IM
import Data.IORef
import Data.Maybe
import HERMIT.Core
import CoreMonad
import CoreSyn
import Co... |
d86eba2ea971a0d4ba6dfb670cd710a6438ffdc4f1b662fe22cd791b78707df3 | VERIMAG-Polyhedra/VPL | OraclePattern.ml | * Interface of linearization Oracles .
module Debug = DebugTypes.Debug(struct let name = "Oracle" end)
* Interface of linearization Oracles .
An Oracle has a modular design : strategies are encoded within Prayers , that are ordered in a list ( prayers ) .
Starting from a polynomial to treat , each prayer ... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/ocaml/lin/oracle/OraclePattern.ml | ocaml | * Module of polynomials
* Prayer interface.
* Prayer Name.
* Type of elements needed by the prayer.
* If set to true, the prayer won't be tried again if it fails once.
* Praying for a pneuma to come.
This is the parsing step of the strategy.
The prayer determines if it can apply on the poly... | * Interface of linearization Oracles .
module Debug = DebugTypes.Debug(struct let name = "Oracle" end)
* Interface of linearization Oracles .
An Oracle has a modular design : strategies are encoded within Prayers , that are ordered in a list ( prayers ) .
Starting from a polynomial to treat , each prayer ... |
cacaa4c4f48ff1a5b1521f678688ec05df084d4ba37048aaec4a2ecf1ae55e66 | rowangithub/DOrder | 172_16_tacas06.ml |
* From " A Practical and Complete Approach to Predicate Refinement " by
* From "A Practical and Complete Approach to Predicate Refinement" by McMillan TACAS'06
*)
let rec loop x y (i:int) (j:int) =
if (x <> 0) then
loop (x-1) (y-1) i j
else if (i = j) then assert (y = 0)
else ()
let main i j =
let x... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/172_16_tacas06.ml | ocaml |
* From " A Practical and Complete Approach to Predicate Refinement " by
* From "A Practical and Complete Approach to Predicate Refinement" by McMillan TACAS'06
*)
let rec loop x y (i:int) (j:int) =
if (x <> 0) then
loop (x-1) (y-1) i j
else if (i = j) then assert (y = 0)
else ()
let main i j =
let x... | |
388758a14f1023d45aed4a0bfc9daa80527d115790d25aeafaaa499bbbdea8c9 | flora-pm/flora-server | Render.hs | module FloraJobs.Render where
import Commonmark qualified
import Commonmark.Extensions qualified as Commonmark
import Control.Exception
import Data.Text (Text)
import Data.Text.Lazy qualified as TL
import FloraJobs.Types (OddJobException (..))
import Lucid (Html, toHtmlRaw)
renderMarkdown :: String -> Text -> Html ()... | null | https://raw.githubusercontent.com/flora-pm/flora-server/c214c0b5d5db71a8330eb69326284be5a4d5e858/src/jobs-worker/FloraJobs/Render.hs | haskell | all gfm extensions apart from pipeTable
default syntax
pipe table spec. This has to be after default syntax due to
-hs/issues/95 | module FloraJobs.Render where
import Commonmark qualified
import Commonmark.Extensions qualified as Commonmark
import Control.Exception
import Data.Text (Text)
import Data.Text.Lazy qualified as TL
import FloraJobs.Types (OddJobException (..))
import Lucid (Html, toHtmlRaw)
renderMarkdown :: String -> Text -> Html ()... |
981c4aa9598630d42382c425e9f0c871449eecd13ce40cd9cec4a70713b17da1 | ghc/packages-Cabal | cabal-old-build.test.hs | import Test.Cabal.Prelude
main = setupAndCabalTest $ withPackageDb $ do
setup_install []
recordMode DoNotRecord $ do
ghc84 <- ghcVersionIs (>= mkVersion [8,4])
let lic = if ghc84 then "BSD-3-Clause" else "BSD3"
ghcPkg' "field" ["my", "license"] >>= assertOutputContains lic
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/SPDX/cabal-old-build.test.hs | haskell | import Test.Cabal.Prelude
main = setupAndCabalTest $ withPackageDb $ do
setup_install []
recordMode DoNotRecord $ do
ghc84 <- ghcVersionIs (>= mkVersion [8,4])
let lic = if ghc84 then "BSD-3-Clause" else "BSD3"
ghcPkg' "field" ["my", "license"] >>= assertOutputContains lic
| |
cb5d23c41825ce896066ce0e1606adfa6174047464700fec65880d8fc2b6f086 | dyzsr/ocaml-selectml | records_errors_test.ml | (* TEST
* expect
*)
module M1 : sig
type t = {f0 : unit * unit * unit * int * unit * unit * unit;
f1 : unit * unit * unit * int * unit * unit * unit}
end = struct
type t = {f0 : unit * unit * unit * float* unit * unit * unit;
f1 : unit * unit * unit * string * unit * unit * unit}
end;;
[%%... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-modules/records_errors_test.ml | ocaml | TEST
* expect
* Random additions and deletions of fields
* Multiple errors
* Existential types introduce equations that must be taken in account
when diffing
|
module M1 : sig
type t = {f0 : unit * unit * unit * int * unit * unit * unit;
f1 : unit * unit * unit * int * unit * unit * unit}
end = struct
type t = {f0 : unit * unit * unit * float* unit * unit * unit;
f1 : unit * unit * unit * string * unit * unit * unit}
end;;
[%%expect{|
Lines 4-7, c... |
efb6dd6352f0f31a51d953e09cd9f862b78cedf7a8a89b07ff49d31b51f6ba83 | rsharifnasab/my-learning | enum.hs | eftBool :: Bool -> Bool -> [Bool]
eftBool from to
| from == to = [from]
| from > to = []
| otherwise = from : eftBool (succ from) to
eft :: (Enum a,Eq a, Ord a) => a -> a -> [a]
eft from to
| from == to = [from]
| from > to = []
| otherwise = from : eft (succ from) to
splitAt' :: Int ->... | null | https://raw.githubusercontent.com/rsharifnasab/my-learning/8555583a772c96e334e3fdace5a295a21c31ea8b/haskell/9-list/enum.hs | haskell | eftBool :: Bool -> Bool -> [Bool]
eftBool from to
| from == to = [from]
| from > to = []
| otherwise = from : eftBool (succ from) to
eft :: (Enum a,Eq a, Ord a) => a -> a -> [a]
eft from to
| from == to = [from]
| from > to = []
| otherwise = from : eft (succ from) to
splitAt' :: Int ->... | |
1e51f68fb8820b0148296d5c0449d82d3203ee12aec8b20fda8cc56ebd5c1920 | lread/sci-test | classes.clj | copied from , turfed features , moved reflection.json generation to its own namespace
(ns sci-test.impl.classes
{:no-doc true})
(defn on-jdk11-plus? []
(let [major (->> (System/getProperty "java.version")
(re-matches #"^(\d+)\..*")
last
Long/parseLong)]
... | null | https://raw.githubusercontent.com/lread/sci-test/b560518e7c36a063347d0c660b819a871f2711c3/src/sci_test/impl/classes.clj | clojure | generated with `public-declared-method-names`, see in
`comment` below
generated with `public-declared-method-names`, see in
`comment` below
java.net.URL, see below
clojure.lang.IDeref
clojure.lang.IAtom
clojure.lang.PersistentHashSet ;; temp for meander
streams
java nio | copied from , turfed features , moved reflection.json generation to its own namespace
(ns sci-test.impl.classes
{:no-doc true})
(defn on-jdk11-plus? []
(let [major (->> (System/getProperty "java.version")
(re-matches #"^(\d+)\..*")
last
Long/parseLong)]
... |
a10da5a1d75ac4c7895e227ae7101995bfd8547942ca36f735bb7e685fead34b | serokell/ariadne | AnsiToVty.hs | module Ariadne.UI.Vty.AnsiToVty
(ansiToVty
, csiToVty
, pprDoc
) where
import Control.Monad.Trans.Writer
import qualified Data.Text as T
import qualified Graphics.Vty as V
import qualified System.Console.ANSI.Types as AT
import qualified Text.PrettyPrint.ANSI.Leijen as Ppr.A
ansiToVty
:... | null | https://raw.githubusercontent.com/serokell/ariadne/5f49ee53b6bbaf332cb6f110c75f7b971acdd452/ui/vty-lib/src/Ariadne/UI/Vty/AnsiToVty.hs | haskell | module Ariadne.UI.Vty.AnsiToVty
(ansiToVty
, csiToVty
, pprDoc
) where
import Control.Monad.Trans.Writer
import qualified Data.Text as T
import qualified Graphics.Vty as V
import qualified System.Console.ANSI.Types as AT
import qualified Text.PrettyPrint.ANSI.Leijen as Ppr.A
ansiToVty
:... | |
c5afdf21a5f675f8a2d979a92020a53b5d11b49e6dfcdb2b15617966b804e658 | chshersh/sauron | Json.hs | |
Copyright : ( c ) 2022
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
JSON parsing helpers and common utilities
Copyright: (c) 2022 Dmitrii Kovanikov
SPDX-License-Identifier: MPL-2.0
Maintainer: Dmitrii Kovanikov <>
JSON parsing helpers and common utilities
-}
module Sauron.Top.Json
( ... | null | https://raw.githubusercontent.com/chshersh/sauron/508cdec3ccd4cdc20de66b75591f0dcd66defd8f/src/Sauron/Top/Json.hs | haskell | | A result of a pagination request
| |
Copyright : ( c ) 2022
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
JSON parsing helpers and common utilities
Copyright: (c) 2022 Dmitrii Kovanikov
SPDX-License-Identifier: MPL-2.0
Maintainer: Dmitrii Kovanikov <>
JSON parsing helpers and common utilities
-}
module Sauron.Top.Json
( ... |
d76f60d553977ebaf94724c5eb5b8744b1e47fc0e56afc4d571455798ea0a6e7 | haskell-servant/servant | ArbitraryMonadServerSpec.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Servant.ArbitraryMonadServerSpec where
import Control.Monad.Reader
import Data.Functor.Identity
import Data.Proxy
import Servant.API
import Servant.Server
impo... | null | https://raw.githubusercontent.com/haskell-servant/servant/d06b65c4e6116f992debbac2eeeb83eafb960321/servant-server/test/Servant/ArbitraryMonadServerSpec.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators # | # LANGUAGE DataKinds #
module Servant.ArbitraryMonadServerSpec where
import Control.Monad.Reader
import Data.Functor.Identity
import Data.Proxy
import Servant.API
import Servant.Server
import Test.Hspec
(Spec, describe, it)
import ... |
c26bdb9a55ce66b745f309a0d53b411613ae61c5d1a336df0b2f137edb45eff0 | michaelklishin/welle | search_test.clj | (ns clojurewerkz.welle.test.search-test
(:require [clojurewerkz.welle.core :as wc]
[clojurewerkz.welle.kv :as kv]
[clojurewerkz.welle.buckets :as wb]
[clojurewerkz.welle.solr :as wsolr]
[clojure.test :refer :all]
[clojurewerkz.welle.testkit :refer [drai... | null | https://raw.githubusercontent.com/michaelklishin/welle/3f3cd24af7c0d95489298e4096b362b6943f85ef/test/clojurewerkz/welle/test/search_test.clj | clojure | (ns clojurewerkz.welle.test.search-test
(:require [clojurewerkz.welle.core :as wc]
[clojurewerkz.welle.kv :as kv]
[clojurewerkz.welle.buckets :as wb]
[clojurewerkz.welle.solr :as wsolr]
[clojure.test :refer :all]
[clojurewerkz.welle.testkit :refer [drai... | |
b384461cc26a1a58e6e0f7a059071e5564192fe64348ea54878c79461f6f6763 | nyu-acsys/drift | enc-zip3.ml |
let rec loop (x:unit) = loop ()
let rec zip x y =
if x = 0
then
if y = 0
then 0
else loop ()
else
if y = 0
then loop ()
else 1 + zip (x - 1) (y - 1)
let main (n:int(*-:{v:Int | true}*)) =
assert (zip n n = n) | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/first/enc-zip3.ml | ocaml | -:{v:Int | true} |
let rec loop (x:unit) = loop ()
let rec zip x y =
if x = 0
then
if y = 0
then 0
else loop ()
else
if y = 0
then loop ()
else 1 + zip (x - 1) (y - 1)
assert (zip n n = n) |
448e647974c33953b29cce06aec9de9a80eb57e8b429dccfdec36248bf772143 | dbuenzli/vz | evidence_flights.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The vz programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/dbuenzli/vz/11056a7b5927519b4b7fa7ae762cdd2b7532936b/samples/evidence_flights.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The vz programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | |
2c4bf5f86a22f7a343e837800d21677da347f78e52db68e2c448f49b7c67bbf7 | ronwalf/HTN-Translation | ProgressionMin.hs | {-# LANGUAGE
FlexibleContexts,
ScopedTypeVariables
#-}
module HTNTranslation.ProgressionMin (minProgression) where
import Data.Function (on)
import Data.List
import Data.Maybe (fromMaybe)
import Data.Text (Text)
--import Debug.Trace
import HTNTranslation.HTNPDDL
import HTNTranslation.ProgressionBounds (find... | null | https://raw.githubusercontent.com/ronwalf/HTN-Translation/dfe39a9444c944e2efd48306e122a17d6c0f2d89/src/HTNTranslation/ProgressionMin.hs | haskell | # LANGUAGE
FlexibleContexts,
ScopedTypeVariables
#
import Debug.Trace
|Provides the minimum progression bound necessary for
# SCC "iterateBounds" #
only consider rebounding with plausible methods (subtasks all have lower bounds)
# SCC "bounds-game" #
The actual game itself
Current bound is bigger than the... | module HTNTranslation.ProgressionMin (minProgression) where
import Data.Function (on)
import Data.List
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import HTNTranslation.HTNPDDL
import HTNTranslation.ProgressionBounds (findMethods, findReachableTasks')
minProgression :: forall action domain problem .
( ... |
5d73a0e2909d6f940fd2511cdec85ed8a4c5a78aff2ac8001cd30b8973b09340 | UCSD-PL/refscript | Constraints.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE TupleSections #
{-# LANGUAGE TypeSynonymInstances ... | null | https://raw.githubusercontent.com/UCSD-PL/refscript/884306fef72248ac41ecdbb928bbd7b06ca71bd4/src/Language/Rsc/Constraints.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE UndecidableInstances #
* Refinement Types
* Constraint Environments
* Constraint Information
* Constraints
--------------------------------------------------------------------------
| Constraint Information
--------------... | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE TupleSections #
module Language.Rsc.Constraints (
RefType
, CGEnvR(..), CGEnv
, Cinfo... |
4cd9d3cbb6c15bf29078b93d1ae63ff5bb4b7e0b5b08b959ea77dc22a71eb3c2 | ocaml/ocaml-lsp | action_mark_remove_unused.mli | val mark : Code_action.t
val remove : Code_action.t
| null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/91c855abcfdb8cb69b30f0454cafa693c0a70a5d/ocaml-lsp-server/src/code_actions/action_mark_remove_unused.mli | ocaml | val mark : Code_action.t
val remove : Code_action.t
| |
a245b8238fad044465b2e57a2a9bb1d2d39bab358c104e9c73aaee501fcce40f | rafd/tada | core.cljc | (ns tada.events.core
(:require
[clojure.spec.alpha :as s]
[clojure.string :as string]
[clojure.core.match :as match]
[spec-tools.core :as st]
[spec-tools.data-spec :as ds]))
(defonce event-store (atom {}))
;; Providing spec for documentation purposes, but not hooking it up
;; since it tries to genera... | null | https://raw.githubusercontent.com/rafd/tada/5ccbb367462d613a9d34905df8602b767cad06df/src/tada/events/core.cljc | clojure | Providing spec for documentation purposes, but not hooking it up
since it tries to generative test the functions, which isn't
necessarily always desired; additionally, we also know that the
condition function will always get input that corresponds to the
params spec, but that spec isn't created until after being c... | (ns tada.events.core
(:require
[clojure.spec.alpha :as s]
[clojure.string :as string]
[clojure.core.match :as match]
[spec-tools.core :as st]
[spec-tools.data-spec :as ds]))
(defonce event-store (atom {}))
(s/def :tada/condition-fn
(ds/spec
{:name :tada/condition-fn
:spec (s/fspec
... |
8cdc8ead305dbf4882c6c2d6511a04ebcfabd200004909325d6aa96140f05c15 | a9032676/Codewars-Haskell | Isomorphism.hs | # LANGUAGE LambdaCase #
module Isomorphism where
import Data.Void
import Data.Maybe
-- A type of `Void` have no value.
-- So it is impossible to construct `Void`,
unless using undefined , error , unsafeCoerce , infinite recursion , etc
-- And there is a function
-- absurd :: Void -> a
-- ... | null | https://raw.githubusercontent.com/a9032676/Codewars-Haskell/6eccd81e9b6ae31b5c0a28ecc16b933f3abae1a5/src/Isomorphism.hs | haskell | A type of `Void` have no value.
So it is impossible to construct `Void`,
And there is a function
absurd :: Void -> a
That get any value out of `Void`
We can do this becuase we can never have void in the zeroth place.
a definition might be, it is possible to go from `a` to `b`,
and from `b` to `a`.
This is call... | # LANGUAGE LambdaCase #
module Isomorphism where
import Data.Void
import Data.Maybe
unless using undefined , error , unsafeCoerce , infinite recursion , etc
so , when are two type , ` a ` and ` b ` , considered equal ?
Going a roundway trip should leave you the same value .
Unfortunately it is vir... |
12fb445cf8dfb75220e13a7194e514da3fb2cc6aaf600cb531fdb2d1a762cc73 | fluree/fluree.crypto | crypto_test.cljc | (ns fluree.crypto-test
(:require
#?@(:clj [[clojure.test :refer :all]]
:cljs [[cljs.test :refer-macros [deftest is testing]]
[goog.object :as gobj]])
[fluree.crypto.test-utils :refer [random-string]]
[fluree.crypto :as crypto]))
(def composed-decomposed-map
{(str "\u00C5") (str... | null | https://raw.githubusercontent.com/fluree/fluree.crypto/345d9a73b5822c8de1121235b34432be92b819ab/test/fluree/crypto_test.cljc | clojure | TODO: What else can assert about account-ids?
TODO: What else can assert about account-id's? | (ns fluree.crypto-test
(:require
#?@(:clj [[clojure.test :refer :all]]
:cljs [[cljs.test :refer-macros [deftest is testing]]
[goog.object :as gobj]])
[fluree.crypto.test-utils :refer [random-string]]
[fluree.crypto :as crypto]))
(def composed-decomposed-map
{(str "\u00C5") (str... |
0dd8a75584d85f747ebcc9dbce5962dbc77bcf0d12e616f07a63d283c56b8b87 | input-output-hk/project-icarus-importer | Global.hs | -- | Explorer's global Txp (expressed as settings).
module Pos.Explorer.Txp.Global
( explorerTxpGlobalSettings
) where
import Universum
import qualified Data.HashMap.Strict as HM
import Pos.Core (ComponentBlock (..), HasConfiguration, HeaderHash, SlotId (..),
... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/explorer/src/Pos/Explorer/Txp/Global.hs | haskell | | Explorer's global Txp (expressed as settings).
| Settings used for global transactions data processing used by explorer.
verification is same
transaction processing. We use it to determine at which slot did a transaction
doesn't contain transactions. It doesn't have a slot, only epoch, but you can
Get the time... |
module Pos.Explorer.Txp.Global
( explorerTxpGlobalSettings
) where
import Universum
import qualified Data.HashMap.Strict as HM
import Pos.Core (ComponentBlock (..), HasConfiguration, HeaderHash, SlotId (..),
epochIndexL, headerHash, headerSlotL)
import ... |
4b7b460ffdf805a85dbe6c0e2ac07da7e4f67a800d11e3b9adb0b273c2b4e302 | goderich/aoc2020 | day05.rkt | #lang racket
(require threading)
part 1
;;
;; Instead of calculating everything by hand,
;; the input strings can be directly translated
into zeros and ones and read as binary numbers .
;; This makes finding the seat IDs trivial.
(define (to-bit c)
(match c
((or #\F #\L) #\0)
((or #\B #\R) #\1)))
(def... | null | https://raw.githubusercontent.com/goderich/aoc2020/96db9aab107e1f4a594319f38a9a309591bd331e/day05.rkt | racket |
Instead of calculating everything by hand,
the input strings can be directly translated
This makes finding the seat IDs trivial.
We declare both seats and max-id as variables,
Since some seats are missing at the beginning of
the answer. This is a good use case for for/last,
since the highest seat number satisf... | #lang racket
(require threading)
part 1
into zeros and ones and read as binary numbers .
(define (to-bit c)
(match c
((or #\F #\L) #\0)
((or #\B #\R) #\1)))
(define (find-seat str)
(~>> str
(string->list)
(map to-bit)
(list->string)
(string->number _ 2)))
because we 'l... |
f918c183f0287fc8c135e8d61781114502bf690e41f17c0d505969458f0bf759 | fukamachi/mito | logger.lisp | (in-package :cl-user)
(defpackage mito.logger
(:use #:cl)
(:import-from #:dbi
#:*sql-execution-hooks*)
(:import-from #:alexandria
#:delete-from-plist)
(:export #:*mito-logger-stream*
#:*mito-migration-logger-stream*
#:*trace-sql-hooks*
#:mito-sql-... | null | https://raw.githubusercontent.com/fukamachi/mito/2ae14a8df02f84a0087c248ef65fc62b38e98d17/src/core/logger.lisp | lisp | (in-package :cl-user)
(defpackage mito.logger
(:use #:cl)
(:import-from #:dbi
#:*sql-execution-hooks*)
(:import-from #:alexandria
#:delete-from-plist)
(:export #:*mito-logger-stream*
#:*mito-migration-logger-stream*
#:*trace-sql-hooks*
#:mito-sql-... | |
5f0bd5b1c40a6a471c862b4d538f00797cdf9c05619a29b6c7448a617223d34c | j3pic/lisp-binary | setup-test-environment.lisp | (load "quicklisp.lisp")
(quicklisp-quickstart:install)
(defun ql-util:press-enter-to-continue ()
t)
(ql:add-to-init-file)
#+sbcl (exit)
#+ccl (ccl:quit)
#+clisp (ext:exit)
| null | https://raw.githubusercontent.com/j3pic/lisp-binary/02ce88f285ef4c8e8b3c2be3385217490fab9628/test/setup-test-environment.lisp | lisp | (load "quicklisp.lisp")
(quicklisp-quickstart:install)
(defun ql-util:press-enter-to-continue ()
t)
(ql:add-to-init-file)
#+sbcl (exit)
#+ccl (ccl:quit)
#+clisp (ext:exit)
| |
08dc2f341b42b70202fc2ca63967999e32de15bf4c9eb952cdc62b61df25500d | Datomic/mbrainz-importer | create_batch_files.clj | (load-file "repl.clj")
(def importer (imp/create-importer "/datomic/mbrainz"))
;; entity types
imp/import-order
(doseq [type imp/import-order]
(println "Creating batch file for " type)
(prn (<!! (imp/create-batch-file importer 1000 type))))
| null | https://raw.githubusercontent.com/Datomic/mbrainz-importer/420edd6c2d07ce9edf48e9b31f047146e6f3c598/examples/create_batch_files.clj | clojure | entity types | (load-file "repl.clj")
(def importer (imp/create-importer "/datomic/mbrainz"))
imp/import-order
(doseq [type imp/import-order]
(println "Creating batch file for " type)
(prn (<!! (imp/create-batch-file importer 1000 type))))
|
3e70a56b11dbbe454cde4996825d8a19543aea8da5c919372bb73ff89dce9ef3 | jyp/lp-diagrams | Shape.hs | # LANGUAGE DataKinds , KindSignatures , OverloadedStrings , EmptyDataDecls , MultiParamTypeClasses , FlexibleContexts , TypeSynonymInstances , FlexibleInstances , GADTs , LambdaCase , RecordWildCards #
module Graphics.Diagrams.Shape where
import Graphics.Diagrams.Path
import Graphics.Diagrams.Point
import Graphics... | null | https://raw.githubusercontent.com/jyp/lp-diagrams/d334eee4343f340976c09d0da27431d5777a0266/Graphics/Diagrams/Shape.hs | haskell | # LANGUAGE DataKinds , KindSignatures , OverloadedStrings , EmptyDataDecls , MultiParamTypeClasses , FlexibleContexts , TypeSynonymInstances , FlexibleInstances , GADTs , LambdaCase , RecordWildCards #
module Graphics.Diagrams.Shape where
import Graphics.Diagrams.Path
import Graphics.Diagrams.Point
import Graphics... | |
35c982dc19b43d91510dc388f38426a9febcec6ba5c3b1dc06f145be8dca3ea8 | luminus-framework/jdbc-ring-session | core_test.clj | (ns jdbc-ring-session.core-test
(:require [clojure.test :refer :all]
[next.jdbc :as jdbc]
[jdbc-ring-session.core :refer :all]))
#_(def db
{:classname "org.h2.Driver"
:subprotocol "h2"
:subname "./test/session.db"
:naming {:keys clojure.string/lower-case
... | null | https://raw.githubusercontent.com/luminus-framework/jdbc-ring-session/2ae6dea18d95306813559f0064fb0b2dfdacb6ed/test/jdbc_ring_session/core_test.clj | clojure | (ns jdbc-ring-session.core-test
(:require [clojure.test :refer :all]
[next.jdbc :as jdbc]
[jdbc-ring-session.core :refer :all]))
#_(def db
{:classname "org.h2.Driver"
:subprotocol "h2"
:subname "./test/session.db"
:naming {:keys clojure.string/lower-case
... | |
e28e9a3adac713d625df35843d5f7d725f1de8cc00d7ed33a987215c602e2946 | hidaris/thinking-dumps | bstree.rkt | #lang typed/racket
(define-type (Tree a) (U E (T a)))
(struct E () #:transparent)
(struct (a) T ([l : (Tree a)]
[e : a]
[r : (Tree a)])
#:transparent)
(define-type Order (U LT EQ GT))
(struct LT () #:transparent)
(struct EQ () #:transparent)
(struct GT () #:transparent)
(define empty ... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/pfds/chap2/bstree.rkt | racket | #lang typed/racket
(define-type (Tree a) (U E (T a)))
(struct E () #:transparent)
(struct (a) T ([l : (Tree a)]
[e : a]
[r : (Tree a)])
#:transparent)
(define-type Order (U LT EQ GT))
(struct LT () #:transparent)
(struct EQ () #:transparent)
(struct GT () #:transparent)
(define empty ... | |
b010f186c7c1834d08dad7bb1b3ef89be29c067dfe569ab8c61a68287c3fadd4 | mirage/mirage | argv.ml |
* Copyright ( c ) 2013 - 2020 < >
* Copyright ( c ) 2013 - 2020 Anil Madhavapeddy < >
* Copyright ( c ) 2015 - 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice an... | null | https://raw.githubusercontent.com/mirage/mirage/7e36d793ad8bd34beb51bbba62a39aa035f7e297/lib/functoria/argv.ml | ocaml |
* Copyright ( c ) 2013 - 2020 < >
* Copyright ( c ) 2013 - 2020 Anil Madhavapeddy < >
* Copyright ( c ) 2015 - 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice an... | |
9edfe2311da0052a399f0d04a4e3d9e0bd597a3a6805b2827368994edb13fbce | quil-lang/quilc | package.lisp | tests / quilt / package.lisp
;;;;
Author :
(fiasco:define-test-package #:cl-quil.quilt-tests
(:local-nicknames (#:a #:alexandria)
(#:quil #:cl-quil))
(:use #:cl-quil #:cl-quil.quilt)
;; suite.lisp
(:export
#:run-quilt-tests)
(:shadowing-import-from #:cl-quil #:pi))
| null | https://raw.githubusercontent.com/quil-lang/quilc/6c9d20892cfc71d8814af0526b78b8215365b512/tests/quilt/package.lisp | lisp |
suite.lisp | tests / quilt / package.lisp
Author :
(fiasco:define-test-package #:cl-quil.quilt-tests
(:local-nicknames (#:a #:alexandria)
(#:quil #:cl-quil))
(:use #:cl-quil #:cl-quil.quilt)
(:export
#:run-quilt-tests)
(:shadowing-import-from #:cl-quil #:pi))
|
bd8fb2d65cfad65a0acc16c5454d2eebabf4a4aa1582d822e0cd9e4caebce1da | deadtrickster/ssl_verify_fun.erl | ssl_verify_hostname_tests.erl | %%% -*- erlang -*-
%%%
MIT License
%%%
Copyright ( c ) 2014 - 2016 < >
-module(ssl_verify_hostname_tests).
-include_lib("eunit/include/eunit.hrl").
verify_hostname_success_test_ () ->
%% presented identifier, reference identifier, validation and parsing result
Tests = [
{"www.example.com", "WWW... | null | https://raw.githubusercontent.com/deadtrickster/ssl_verify_fun.erl/b503f3e1a0397c495dca9930f131613190cea25b/test/ssl_verify_hostname_tests.erl | erlang | -*- erlang -*-
presented identifier, reference identifier, validation and parsing result
case insensitive match
ignore trailing dots (prevenet *.com. matches)
always matching wildcards
presented identifier, reference identifier
Certs generated via:
actual cert content dumped via:
then we write them to der vi... | MIT License
Copyright ( c ) 2014 - 2016 < >
-module(ssl_verify_hostname_tests).
-include_lib("eunit/include/eunit.hrl").
verify_hostname_success_test_ () ->
Tests = [
{"www.example.com", "www.example.com.", false},
{"b*z.example.com", "buzz.example.com", {"b", "z.example.com", false}},... |
ab387fd77b7584caa542ffdfa58f384c643a2e031b0a096811360b9730ae9fe3 | incoherentsoftware/defect-process | Types.hs | module Level.Room.Types
( module Level.Room.Bounds
, RoomName
, RoomType(..)
, Room(..)
) where
import qualified Data.Text as T
import Level.Room.ArenaWalls.Types
import Level.Room.Bounds
import Level.Room.DisappearingPlatform
import Level.Room.DoorLightOverlay
import Level.Room.ImageLayer.Types
i... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/c39ce1f742d32a0ffcde82c03bf872adeb7d9162/src/Level/Room/Types.hs | haskell | module Level.Room.Types
( module Level.Room.Bounds
, RoomName
, RoomType(..)
, Room(..)
) where
import qualified Data.Text as T
import Level.Room.ArenaWalls.Types
import Level.Room.Bounds
import Level.Room.DisappearingPlatform
import Level.Room.DoorLightOverlay
import Level.Room.ImageLayer.Types
i... | |
afa9eb2202005a18dfcff7470c85670e7379208a35131a7c574ea7a1cfc82c04 | aharisu/Gauche-CV | invert.scm | (use cv)
(use math.mt-random)
(define rand (make-cv-rng))
(define-constant nrow 3)
(define-constant ncol 3)
(let ([src (make-cv-mat nrow ncol CV_32FC1)]
[dst (make-cv-mat nrow ncol CV_32FC1)]
[mul (make-cv-mat nrow ncol CV_32FC1)])
(print "src")
(cv-m-set src 0 0 1)
(dotimes [i (slot-ref src 'rows)... | null | https://raw.githubusercontent.com/aharisu/Gauche-CV/5e4c51501431c72270765121ea4d92693f11d60b/sample/invert.scm | scheme | (use cv)
(use math.mt-random)
(define rand (make-cv-rng))
(define-constant nrow 3)
(define-constant ncol 3)
(let ([src (make-cv-mat nrow ncol CV_32FC1)]
[dst (make-cv-mat nrow ncol CV_32FC1)]
[mul (make-cv-mat nrow ncol CV_32FC1)])
(print "src")
(cv-m-set src 0 0 1)
(dotimes [i (slot-ref src 'rows)... | |
63a940d8992646db10dad218aab137978ecfcf78e47dfb427c1fb71da8590881 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentMethodOptionsP24.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
| Contains the types generated from the schema PaymentMethodOptionsP24
module StripeAPI.Types.PaymentMethodOptionsP24 where... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentMethodOptionsP24.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Defines the object schema located at @components.schemas.payment_method_options_p24@ in the specification.
| setup_future_usage: Indicates that you intend to make future payments with this PaymentIntent\'s payment method.
| Defines the enum schema located at... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
| Contains the types generated from the schema PaymentMethodOptionsP24
module StripeAPI.Types.PaymentMethodOptionsP24 where
import qualified Control.Monad.Fail
import qualified Data.Aes... |
af784d825224ddcad9cdc378f91180f441dbc163782295d20693bee0a5be127c | oxidizing/sihl | template.ml | include Sihl.Contract.Email_template
let log_src =
Logs.Src.create ("sihl.service." ^ Sihl.Contract.Email_template.name)
;;
module Logs = (val Logs.src_log log_src : Logs.LOG)
module Make (Repo : Template_repo_sql.Sig) : Sihl.Contract.Email_template.Sig =
struct
let get = Repo.get
let get_by_label = Repo.get_b... | null | https://raw.githubusercontent.com/oxidizing/sihl/547e2b51fa59f5f64665c452792cd7fd0aca072b/sihl-email/src/template.ml | ocaml | include Sihl.Contract.Email_template
let log_src =
Logs.Src.create ("sihl.service." ^ Sihl.Contract.Email_template.name)
;;
module Logs = (val Logs.src_log log_src : Logs.LOG)
module Make (Repo : Template_repo_sql.Sig) : Sihl.Contract.Email_template.Sig =
struct
let get = Repo.get
let get_by_label = Repo.get_b... | |
aedff93e09254000205fc858ace305b437ec4ce4fe5d7c6d99a3f754f926d56b | atzeus/reflectionwithoutremorse | Median.hs | {-# LANGUAGE BangPatterns #-}
import Control.Monad
import Control.Monad.Logic.Class
import Control.Monad.Trans
import System.Environment
import System.IO
import Data.List
-- compute the median of the arguments
code stolen from hstats
-- |Numerically stable mean
mean :: Floating a => [a] -> a
mean x = fst $ foldl'... | null | https://raw.githubusercontent.com/atzeus/reflectionwithoutremorse/2ab000be1ddc49a2ec36afaaa58485df56aef654/Median.hs | haskell | # LANGUAGE BangPatterns #
compute the median of the arguments
|Numerically stable mean
|Same as 'mean'
|Harmonic mean
|Geometric mean
|Median | import Control.Monad
import Control.Monad.Logic.Class
import Control.Monad.Trans
import System.Environment
import System.IO
import Data.List
code stolen from hstats
mean :: Floating a => [a] -> a
mean x = fst $ foldl' (\(!m, !n) x -> (m+(x-m)/(n+1),n+1)) (0,0) x
average :: Floating a => [a] -> a
average = mean
h... |
8ce2b00b1f2e85cab06d819fbfca9bcd1b4edd4dedb629f6b5b9ef10b55e2815 | gafiatulin/codewars | Approxinter.hs | -- Floating-point Approximation (II)
--
module Codewars.G964.Approxinter where
interp :: (Double -> Double) -> Double -> Double -> Int -> [Double]
interp f l u n = map ((/100) . fromInteger . floor . (*100) . (/100000) . fromInteger . round . (* 100000) . f) . take n $ [l,l+((u - l) / fromIntegral n)..]
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/6%20kyu/Approxinter.hs | haskell | Floating-point Approximation (II)
|
module Codewars.G964.Approxinter where
interp :: (Double -> Double) -> Double -> Double -> Int -> [Double]
interp f l u n = map ((/100) . fromInteger . floor . (*100) . (/100000) . fromInteger . round . (* 100000) . f) . take n $ [l,l+((u - l) / fromIntegral n)..]
|
b508f442e5c9395ededeaebf8d451770fed5d3033f564f5bbec44c914462a599 | music-suite/music-suite | ChordAndVoiceEtc.hs |
import Music.Prelude
import qualified Music.Time.Note
renderVoice :: Transformable a => Voice a -> [a]
renderVoice = fmap (view stretchee) . view stretcheds
renderVoice2 :: Voice a -> [Music.Time.Note.Note a]
renderVoice2 = renderVoice . fmap (return :: a -> Music.Time.Note.Note a)
-- TODO "pseq"
renderVoice3 :: Vo... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/sketch/ChordAndVoiceEtc.hs | haskell | TODO "pseq"
TODO "ppar"
A "directed" pitch type, to check if we have double reverse
transform _ = id
rev = id
rev = id
instance Reversible Double where
rev = id
rev = id |
import Music.Prelude
import qualified Music.Time.Note
renderVoice :: Transformable a => Voice a -> [a]
renderVoice = fmap (view stretchee) . view stretcheds
renderVoice2 :: Voice a -> [Music.Time.Note.Note a]
renderVoice2 = renderVoice . fmap (return :: a -> Music.Time.Note.Note a)
renderVoice3 :: Voice a -> Score ... |
227a2a66e55ef3e4f799a5de4bf16cffa6b8d0bb0ed1bacce1a5584f9308f973 | input-output-hk/ouroboros-network | Types.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
For Show Errno and ... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/Storage/FS/API/Types.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DerivingVia #
* Modes
* Paths
** opaque
* Handles
* Offset
* Errors
------------------------------------------------------------------------------
Modes
-------------... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
# LANGUAGE StandaloneDeriving #
For Show Errno and SeekMode instances
# OPTIONS_GHC -Wno - orphans #
module Ouroboros.Consensus.Storage.FS.API.Types (
AllowExisting (..)
, OpenMode (..)
, SeekMode (..)
, allowExistin... |
864590786ded95d7a94c6ba8e71ce8b21a4065dcf8b2d7525b52c2b8ab13d52e | hugoduncan/swell | slingshot.clj | (ns swell.slingshot
"Slingshot bindings for swell."
(:require
[slingshot.slingshot :as slingshot]
[slingshot.support :as support]
[swell.spi :as spi]))
(defn is-restart? [obj]
(isa? :swell/invoke-restart (type obj)))
(defmacro try-with-restarts
[restarts & body]
`(slingshot/try+
~@body
(cat... | null | https://raw.githubusercontent.com/hugoduncan/swell/51932d92b3c4dc13393a28426a4f139b7880ad72/src/swell/slingshot.clj | clojure | (ns swell.slingshot
"Slingshot bindings for swell."
(:require
[slingshot.slingshot :as slingshot]
[slingshot.support :as support]
[swell.spi :as spi]))
(defn is-restart? [obj]
(isa? :swell/invoke-restart (type obj)))
(defmacro try-with-restarts
[restarts & body]
`(slingshot/try+
~@body
(cat... | |
2af117b0c67f42ab2b78478c7c8050fe84eb7b64e7c53288afd5969d74b73662 | fizruk/simple-topes | Layout.hs | module RSTT.Syntax.Layout where
import Prelude
import RSTT.Syntax.Lex
import Data.Maybe (isNothing, fromJust)
-- Generated by the BNF Converter
-- local parameters
topLayout :: Bool
topLayout = True
layoutWords, layoutStopWords :: [String]
layoutWords = ["with","where","prove"]
layoutStopWords = []
-- lay... | null | https://raw.githubusercontent.com/fizruk/simple-topes/3fd557d2830e67d24cce5535ae1ade6e84fd8230/simple-topes/src/RSTT/Syntax/Layout.hs | haskell | Generated by the BNF Converter
local parameters
layout separators
| Replace layout syntax with explicit layout tokens.
^ Whether to use top-level layout.
Do top-level layout if the function parameter and the grammar say so.
^ The previous token, if any.
^ A stack of layout blocks.
The stack should never be emp... | module RSTT.Syntax.Layout where
import Prelude
import RSTT.Syntax.Lex
import Data.Maybe (isNothing, fromJust)
topLayout :: Bool
topLayout = True
layoutWords, layoutStopWords :: [String]
layoutWords = ["with","where","prove"]
layoutStopWords = []
layoutOpen, layoutClose, layoutSep :: String
layoutOpen =... |
668a1114d1ec954bba6a55dc5c8208f73df4bdaaded2584b1c939c93b3cf92bd | ocaml-flambda/flambda-backend | flambda_features.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/2eea6bab3ef6e2d90a9bed292b9547eccf86454d/middle_end/flambda2/ui/flambda_features.mli | ocaml | ************************************************************************
OCaml
... | , Jane Street Europe
Copyright 2020 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
val flambda2_is_enabled : unit -> bool
type 'a mode =
| Normal : [`Normal] mode
| Classic : [`Classic]... |
ebc4315eb7a8138ad701ab525dc7b1013a10b1f9ca76457f8078d9d124ebe1b4 | alanz/ghc-exactprint | T11136.hs | # LANGUAGE TypeFamilies #
module T11136 where
class C a where
type D a
type instance D a x = x
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/T11136.hs | haskell | # LANGUAGE TypeFamilies #
module T11136 where
class C a where
type D a
type instance D a x = x
| |
f7098b088b01208aedae36030a9e48e7030617fe0a30fc9f188b7d7f5c262c00 | politrons/Dive_into_Haskell | LetAndWhere.hs | module LetAndWhere where
import Data.Char (toUpper)
-- | Let
-- ------
{-| The scope of the declarations is the expression and the right hand side of the declarations.
Also if the declaration expect to receive an input value, it's consider as a high order function.
[let] declaration is lazy by default and onl... | null | https://raw.githubusercontent.com/politrons/Dive_into_Haskell/fd9dec14b87aecba0b3561385c1d75cf969546a4/src/features/LetAndWhere.hs | haskell | | Let
------
| The scope of the declarations is the expression and the right hand side of the declarations.
Also if the declaration expect to receive an input value, it's consider as a high order function.
[let] declaration is lazy by default and only when is invoked is when the declaration pass from
lazy... | module LetAndWhere where
import Data.Char (toUpper)
letDeclaration :: IO()
letDeclaration = do
let letFunc z= 1+2+z
value <- invokeLetDeclaration letFunc
print value
invokeLetDeclaration :: (Integer -> Integer) -> IO Integer
invokeLetDeclaration letFunc = return $ (letFunc ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.