_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 |
|---|---|---|---|---|---|---|---|---|
bf53cd8c3154b2bca3b8e8d7152e7aa832400a4d9cce45025339b7db76bcc3b1 | mfine/postgresql-schema | Clear.hs | -- |
-- Module: Clear
Copyright : ( c ) 2015
License : MIT
Maintainer : < >
-- Stability: experimental
-- Portability: portable
--
-- Tool for clearing PostgreSQL migrations.
import BasicPrelude
import Data.Text (pack)
import Database.PostgreSQL.Schema
import Options.Applic... | null | https://raw.githubusercontent.com/mfine/postgresql-schema/5d495382c4e5d97de8103fc8e978503a64ce84b2/main/Clear.hs | haskell | |
Module: Clear
Stability: experimental
Portability: portable
Tool for clearing PostgreSQL migrations. | Copyright : ( c ) 2015
License : MIT
Maintainer : < >
import BasicPrelude
import Data.Text (pack)
import Database.PostgreSQL.Schema
import Options.Applicative
import Shelly
import System.Environment
import System.IO hiding (getLine, putStr)
data Args = Args
{ a... |
55174815cf997a7ccda6bb1e0d2274ece6c2ce2f81fdc1c4e3c5777642459a6e | PLSysSec/FaCT | oobcheck.ml | open Util
open Pos
open Err
open Tast
open Tast_util
open Pseudocode
module LogModule = Log
open Z3
module Log = LogModule
(** TODO:
- if (e1) {
if (e2) {
...
return;
} else {
...
return;
}
}
constraints do not propagate properly
- if... | null | https://raw.githubusercontent.com/PLSysSec/FaCT/c08b2e00751b28e1f25d031c3afafc544acfb892/src/oobcheck.ml | ocaml | * TODO:
- if (e1) {
if (e2) {
...
return;
} else {
...
return;
}
}
constraints do not propagate properly
- if (e_always_true) {
...
return;
}
will still be treated as a possible-return instead of an always-re... | open Util
open Pos
open Err
open Tast
open Tast_util
open Pseudocode
module LogModule = Log
open Z3
module Log = LogModule
let mk_eq = Boolean.mk_eq
let ctx = mk_context []
let bv = BitVector.mk_sort ctx
let zpush exprs e z =
if mlist_mem ! exprs e ~equal:(= ) then
( let ( { pos = p } , _ ) = e in
r... |
aaf20f31f1b233e0ac47428e363a11c8e468c6ca3d4678126ad8e30e743738ac | gmr/privatepaste | privpaste_mnesia.erl | %% ------------------------------------------------------------------
Mnesia startup / cluster functionality
%% ------------------------------------------------------------------
-module(privpaste_mnesia).
%% API
-export([start/0,
backup/0,
reset/0,
restore/0,
node_list/0]).
-inc... | null | https://raw.githubusercontent.com/gmr/privatepaste/4cc53473eb7e3d4d237df4b18fce573e3588ec24/src/privpaste_mnesia.erl | erlang | ------------------------------------------------------------------
------------------------------------------------------------------
API | Mnesia startup / cluster functionality
-module(privpaste_mnesia).
-export([start/0,
backup/0,
reset/0,
restore/0,
node_list/0]).
-include("privpaste.hrl").
-define(TABLES, [pastes]).
-define(WAIT_TIMEOUT, 60000).
start() ->
lager:debug("Starting privpaste_mnesia"),
mnes... |
114148c2a03757ec5eb0252c641df3d3e3d049d62547971ab60cd3a74eb1ebd4 | openbadgefactory/salava | schemas.cljc | (ns salava.page.schemas
(:require [schema.core :as s
:include-macros true] ;; cljs only
[salava.badge.schemas :refer [Badge evidence]]
[salava.file.schemas :refer [File]]))
(def page
{:id s/Int
:name s/Str
:description (s/maybe s/Str)
:tags ... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljc/salava/page/schemas.cljc | clojure | cljs only | (ns salava.page.schemas
(:require [schema.core :as s
[salava.badge.schemas :refer [Badge evidence]]
[salava.file.schemas :refer [File]]))
(def page
{:id s/Int
:name s/Str
:description (s/maybe s/Str)
:tags (s/maybe [s/Str])
:password (s... |
5430175f0de01e8bb7ab3bc25c88b97e02f880b61a727f006c8124fdba4da3af | ivitjuk/Haskell-Music-Player | CurrentSong.hs | -- Haskell Music Player, client for the MPD (Music Player Daemon)
Copyright ( C ) 2011 < >
-- This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at you... | null | https://raw.githubusercontent.com/ivitjuk/Haskell-Music-Player/b4c801d3abae0219bccd48c7f4212b4fd9f98d45/src/CurrentSong.hs | haskell | Haskell Music Player, client for the MPD (Music Player Daemon)
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 will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or ... | Copyright ( C ) 2011 < >
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
module CurrentSong
(
Data,
CurrentSong.init,
update,
)... |
087676a61125b61238279470d01d9c6e4c845acc9ae315c1e9cbe5e3a3d27a4d | letmaik/monadiccp | BIBD.hs | # LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
import Control.CP.FD.Example
-- path :: ModelInt -> ModelCol -> (ModelInt -> ModelInt) -> (ModelInt -> ModelInt) -> ModelCol
-- row :: ModelInt -> ModelCol -> ModelInt -> ModelCol
-- col :: ModelInt -> ModelCol -> ModelInt -> ModelCol
path nc ne l r c = slice l ... | null | https://raw.githubusercontent.com/letmaik/monadiccp/fe4498e46a7b9d9e387fd5e4ed5d0749a89d0188/examples/BIBD.hs | haskell | path :: ModelInt -> ModelCol -> (ModelInt -> ModelInt) -> (ModelInt -> ModelInt) -> ModelCol
row :: ModelInt -> ModelCol -> ModelInt -> ModelCol
col :: ModelInt -> ModelCol -> ModelInt -> ModelCol | # LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
import Control.CP.FD.Example
path nc ne l r c = slice l $ xmap (\k -> nc*(r k)+(c k)) (0 @.. (ne-1))
row nc ne l i = path nc ne l (const i) id
col nc ne l i = path nc ne l id (const i)
model :: ExampleModel (ModelInt,ModelInt,ModelInt)
model (v,k,lambda) = exis... |
2e259d2fbf576fd3e79938d483a59aaf083bef44bb6f098585da80265169b93d | wdebeaum/step | gigahertz.lisp | ;;;;
;;;; W::gigahertz
;;;;
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::gigahertz
(wordfeats (W::morph (:forms (-s-3p) :plur W::gigahertz)))
(SENSES
((meta-data :origin trips :entry-date 20060803 :change-date nil :comments nil :wn ("gigahertz%1:28:00"))
(LF-PARENT ONT::frequency-unit... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/gigahertz.lisp | lisp |
W::gigahertz
|
(define-words :pos W::n :templ COUNT-PRED-TEMPL
:words (
(W::gigahertz
(wordfeats (W::morph (:forms (-s-3p) :plur W::gigahertz)))
(SENSES
((meta-data :origin trips :entry-date 20060803 :change-date nil :comments nil :wn ("gigahertz%1:28:00"))
(LF-PARENT ONT::frequency-unit)
(TEMPL ATTRIBUTE-UNIT... |
7cf545181b6a39346bf7c9e9c0f2f8be57023e71d48cdcc2deae63a9d2b6000d | fakedata-haskell/fakedata | NlTextSpec.hs | # LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
module NlTextSpec where
import Data.Text (Text)
import qualified Data.Text as T
import Faker hiding (defaultFakerSettings)
import qualified Faker.Address as FA
import Faker.Combinators (listOf)
import qualified Faker.Company as CO
import qualified Fa... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/test/NlTextSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE ScopedTypeVariables #
module NlTextSpec where
import Data.Text (Text)
import qualified Data.Text as T
import Faker hiding (defaultFakerSettings)
import qualified Faker.Address as FA
import Faker.Combinators (listOf)
import qualified Faker.Company as CO
import qualified Faker.Internet as IN
import qualified... |
60f4aada85198bbed85cb7f469f681e231b8309a6cc1ea7566faaf8ff0d52ae1 | cmcl/franklyfrank | patternMatching.mli | (* Pattern matching compilation module.
*)
type 'a vector = 'a list
type 'a matrix = 'a vector vector
type action = MidTree.mid_ccomputation deriving (Show)
type pattern = MidTree.pattern
type value = MidTree.mid_cvalue
(** Helpful synonyms. *)
type clause = pattern vector * action
type pmatrix = pattern matrix
type... | null | https://raw.githubusercontent.com/cmcl/franklyfrank/6cc1c4f7377ea2a907675ec0fae9ff32829cec83/mid/patternMatching.mli | ocaml | Pattern matching compilation module.
* Helpful synonyms.
* Shorthands.
* Representation for decision trees the target of pattern matching
compilation.
* Cases which occur at multi-way test nodes within a decision tree.
Pattern and value operations.
* [not_inst p v] returns [true] ([false] otherwise) if [v]... |
type 'a vector = 'a list
type 'a matrix = 'a vector vector
type action = MidTree.mid_ccomputation deriving (Show)
type pattern = MidTree.pattern
type value = MidTree.mid_cvalue
type clause = pattern vector * action
type pmatrix = pattern matrix
type cmatrix = clause vector
type dtree =
Fail
| Leaf of action
Subt... |
406d2295491d83437ae4e30feaa1b57410785515be2945e6dea1773ec9fed76e | mbj/stratosphere | LoRaWANServiceProfileProperty.hs | module Stratosphere.IoTWireless.ServiceProfile.LoRaWANServiceProfileProperty (
LoRaWANServiceProfileProperty(..), mkLoRaWANServiceProfileProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
i... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/iotwireless/gen/Stratosphere/IoTWireless/ServiceProfile/LoRaWANServiceProfileProperty.hs | haskell | module Stratosphere.IoTWireless.ServiceProfile.LoRaWANServiceProfileProperty (
LoRaWANServiceProfileProperty(..), mkLoRaWANServiceProfileProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
i... | |
5542a05e6e48cadecdeb32c3a3d76eec0ba405e5db9d1eba71df7d6d43b63d35 | benweitzman/hooks | Examples.hs | # LANGUAGE PartialTypeSignatures #
# LANGUAGE RecordWildCards #
# LANGUAGE RebindableSyntax #
module Examples where
import Control.Monad.Hooks
import qualified Control.Monad.Hooks.Do as Do
import Prelude
import Control.Concurrent.Async (async, cancel)
import Control.Monad (forever)
import Control.Concurrent (threadDe... | null | https://raw.githubusercontent.com/benweitzman/hooks/4a87c55f78f80b4d751c749672ade496d2b6d843/app/ghc-8/Examples.hs | haskell | # LANGUAGE PartialTypeSignatures #
# LANGUAGE RecordWildCards #
# LANGUAGE RebindableSyntax #
module Examples where
import Control.Monad.Hooks
import qualified Control.Monad.Hooks.Do as Do
import Prelude
import Control.Concurrent.Async (async, cancel)
import Control.Monad (forever)
import Control.Concurrent (threadDe... | |
64cb732064b19262a1c9fc220bb471827d38b37acb44dd2f4322090d805bce81 | mirage/irmin | test.ml |
* Copyright ( c ) 2022 Tarides < >
*
* 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 and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND ... | null | https://raw.githubusercontent.com/mirage/irmin/c8e5327d3c72b12c326dcc416836d69ab100b0a2/test/irmin-cli/test.ml | ocaml |
* Copyright ( c ) 2022 Tarides < >
*
* 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 and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND ... | |
ee1dbd4f7d2eb03a06ef2f137995e8240336f6f3d2487333ba0fc17d3b562127 | rtoal/ple | quicksort.hs | quickSort :: (Ord a) => [a] -> [a]
quickSort [] = []
quickSort (x:xs) = quickSort [a | a <- xs, a < x]
++ [x] ++
quickSort [a | a <- xs, a >= x]
main =
print $ (quickSort [5,3,4,1,2,6] == [1..6]) || error("fail")
| null | https://raw.githubusercontent.com/rtoal/ple/b24cab4de2beca6970833a09d05af6ef96ec3921/haskell/quicksort.hs | haskell | quickSort :: (Ord a) => [a] -> [a]
quickSort [] = []
quickSort (x:xs) = quickSort [a | a <- xs, a < x]
++ [x] ++
quickSort [a | a <- xs, a >= x]
main =
print $ (quickSort [5,3,4,1,2,6] == [1..6]) || error("fail")
| |
a08d13e52122120889589be60e07d2fc250c7d5581e3201eac372adb013f97a3 | andreas/ocaml-graphql-server | graphql_schema.ml | (* Helper modules *)
module List = struct
include List
let assoc_exn = assoc
let assoc x ys = try Some (assoc_exn x ys) with Not_found -> None
let find_exn = find
let find cond xs = try Some (find_exn cond xs) with Not_found -> None
module Result = struct
let rec join ?(memo = []) = function
... | null | https://raw.githubusercontent.com/andreas/ocaml-graphql-server/e893bf30908d88adb684f2f9315c5ba3960e96ba/graphql/src/graphql_schema.ml | ocaml | Helper modules
IO
Field_error
Schema
Built-in argument types
Schema data types
Constructor functions
TODO add subtype check here
Built-in scalars
Mandatory directives: skip and include
Extracts all types contained in a single type
Execution
see /#sec-Response-root-field | module List = struct
include List
let assoc_exn = assoc
let assoc x ys = try Some (assoc_exn x ys) with Not_found -> None
let find_exn = find
let find cond xs = try Some (find_exn cond xs) with Not_found -> None
module Result = struct
let rec join ?(memo = []) = function
| [] -> Ok (List.rev ... |
fda3283160d75457c133069dfa5fccbb6a0ae5615e93bdf51cbec40a82563388 | yi-editor/yi | InteroAPI.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
-- |
-- Module : InteroAPI
Copyright : 2017 , Jaro Reinders
-- License : GPL-2
-- Maintainer :
--
A Haskell API to intero . This is not Yi - specific .
module InteroAPI (
Request
, start
, locAt, uses, typeAt, eval
) where
import... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-intero/src/InteroAPI.hs | haskell | |
Module : InteroAPI
License : GPL-2
Maintainer :
| The request that are send to the background process.
^ The content of the query.
Code taken from: | # LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
Copyright : 2017 , Jaro Reinders
A Haskell API to intero . This is not Yi - specific .
module InteroAPI (
Request
, start
, locAt, uses, typeAt, eval
) where
import Control.Exception (IOException, catch, handle)
import Control.Concurren... |
b8db05fa43acbd05c1de11626b4b6f3cd73a554561e0c33d992d2984c1c694d6 | naoiwata/sicp | q2.31.scm | ;; @author naoiwata
SICP Chapter2
question 2.31
(add-load-path "." :relative)
(load "q2.30.scm")
(define (tree-map square tree)
(abstruct-tree
tree
(lambda (x) (square x))))
(define (square-tree tree)
(tree-map square tree))
; test
(display
(square-tree (list 1 (list 2 (list 3 4) 5) (list 6 7))))
; test | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/q2.31.scm | scheme | @author naoiwata
test
test | SICP Chapter2
question 2.31
(add-load-path "." :relative)
(load "q2.30.scm")
(define (tree-map square tree)
(abstruct-tree
tree
(lambda (x) (square x))))
(define (square-tree tree)
(tree-map square tree))
(display
(square-tree (list 1 (list 2 (list 3 4) 5) (list 6 7))))
|
d44b06c28a7e0cbd1008880ca8091dba0fdc26d9843a12310a21e89812c153db | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-shopping-content/gen/Gogol/ShoppingContent/Content/Productstatuses/Repricingreports/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Lists the metrics report for a given Repricing product.
* Resource
** Constructing a Request
'ContentProductstatusesRepricingreportsList' request conforms to.
| Lists the metrics report for a given Repricing product.
/See:/... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
0a6dc05e9c16d30deef0689f1d4b4b2bcf328c9bc1ce7767108a0351a4b95980 | s-expressionists/Eclector | package.lisp | (cl:defpackage #:eclector.concrete-syntax-tree.test
(:use
#:common-lisp
#:fiveam)
(:import-from #:eclector.test
#:equal*
#:do-input-cases #:expect
#:do-stream-input-cases #:with-stream
#:error-case
#:gen-labels-and-references)
(:export
#:run-tests))
(cl:in-package #:eclector.co... | null | https://raw.githubusercontent.com/s-expressionists/Eclector/acd141db4efdbd88d57a8fe4f258ffc18cc47baa/test/concrete-syntax-tree/package.lisp | lisp | (cl:defpackage #:eclector.concrete-syntax-tree.test
(:use
#:common-lisp
#:fiveam)
(:import-from #:eclector.test
#:equal*
#:do-input-cases #:expect
#:do-stream-input-cases #:with-stream
#:error-case
#:gen-labels-and-references)
(:export
#:run-tests))
(cl:in-package #:eclector.co... | |
f1fdda848fd4d82513e890e08eedcce353253dd40b24412ab7ec69b7d9f917ef | input-output-hk/cardano-sl | Merkle.hs | # LANGUAGE NamedFieldPuns #
-- | Merkle tree implementation.
--
-- See <>.
module Pos.Core.Merkle
( MerkleRoot(..)
, MerkleTree (..)
, mtRoot
, mkMerkleTree
, MerkleNode (..)
, mkBranch
, mkLeaf
) where
Universum has its own Rube Goldberg variant of ' Foldabl... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/src/Pos/Core/Merkle.hs | haskell | | Merkle tree implementation.
See <>.
want. It would be great if we could write
used unqualified. The hiding in fact makes it clearer for the human reader
what's going on.
| Data type for root of merkle tree.
This instance is both faster and more space-efficient (as confirmed by a
benchmark). Hashing turns out... | # LANGUAGE NamedFieldPuns #
module Pos.Core.Merkle
( MerkleRoot(..)
, MerkleTree (..)
, mtRoot
, mkMerkleTree
, MerkleNode (..)
, mkBranch
, mkLeaf
) where
Universum has its own Rube Goldberg variant of ' Foldable ' which we do not
import Unive... |
dc25abc3816b4ba2dcf158f37aa1e6836a82a9c921e02ff767bfb432c4cf0427 | txyyss/Project-Euler | Euler135.hs | -- Given the positive integers, x, y, and z, are consecutive terms of
-- an arithmetic progression, the least value of the positive integer,
n , for which the equation , x² - y² - z² = n , has exactly two
solutions is n = 27 :
34² - 27² - 20² = 12² - 9² - 6² = 27
It turns out that n = 1155 is the least value ... | null | https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler135.hs | haskell | Given the positive integers, x, y, and z, are consecutive terms of
an arithmetic progression, the least value of the positive integer,
solutions.
distinct solutions?
x > k && 4 k - x > 0 | n , for which the equation , x² - y² - z² = n , has exactly two
solutions is n = 27 :
34² - 27² - 20² = 12² - 9² - 6² = 27
It turns out that n = 1155 is the least value which has exactly ten
How many values of n less than one million have exactly ten
module Euler135 where
( x + k)² - x² - ( x - k)² = n... |
862edbc25e5073357eb9444c5422dad53e54e94e23459087d8a22ee571d0e0fd | hunt-framework/hunt | Directory.hs | {-# LANGUAGE DeriveGeneric #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Hunt.SegmentIndex.Directory where
import GHC.Generics
import Hunt.Common.BasicTypes
import Hunt.Index.Schema
import Hunt.SegmentIndex.Directory.Layout
import qua... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-searchengine/src/Hunt/SegmentIndex/Directory.hs | haskell | # LANGUAGE DeriveGeneric #
| A simplified representation for 'Segment' which is used
to store 'Segment's on disk. | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Hunt.SegmentIndex.Directory where
import GHC.Generics
import Hunt.Common.BasicTypes
import Hunt.Index.Schema
import Hunt.SegmentIndex.Directory.Layout
import qualified Hunt.SegmentIndex.Directory.Term... |
e0d04e91899839f1111b6eb59bbf567a54b487cf7897bf493a51824d50711838 | dalaing/little-languages | Text.hs | module Test.Term.Text where
import Test.Tasty
import Test.Tasty.QuickCheck
import Term.Gen
import Term.Parse
import Term.Pretty
textTests :: TestTree
textTests =
testGroup "text" [
testProperty "roundTrip" propRoundTrip
]
propRoundTrip :: AnyTerm
-> Property
propRoundTrip (AnyTerm t) =
cas... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/unityped/lc/tests/Test/Term/Text.hs | haskell | module Test.Term.Text where
import Test.Tasty
import Test.Tasty.QuickCheck
import Term.Gen
import Term.Parse
import Term.Pretty
textTests :: TestTree
textTests =
testGroup "text" [
testProperty "roundTrip" propRoundTrip
]
propRoundTrip :: AnyTerm
-> Property
propRoundTrip (AnyTerm t) =
cas... | |
ec04ca73f40360ab667d27b1b49ebb261d86d18bf900c9d1afec1f9ca403312c | ayamada/copy-of-svn.tir.jp | client.scm | ;;; coding: euc-jp
;;; -*- scheme -*-
;;; vim:set ft=scheme ts=8 sts=2 sw=2 et:
$ Id$
sdssクライアントモジュール
ToDo : どのようにする ? ? ?
;;; - とりあえず、dbm方式で行く事にしてみる。再利用可能方式。
;;; - 或いは、毎回接続切断方式にする?
;;; note:
;;; - このモジュールは、sdss:table-get等の関数を提供する???
;;; -- とりあえず、透過的に使えるようにしたい。そうできれば、すごく便利な為。
(define-module tir03.sdss.client... | null | https://raw.githubusercontent.com/ayamada/copy-of-svn.tir.jp/101cd00d595ee7bb96348df54f49707295e9e263/Gauche-tir/branches/Gauche-tir03/0.0.2/lib/tir03/sdss/client.scm | scheme | coding: euc-jp
-*- scheme -*-
vim:set ft=scheme ts=8 sts=2 sw=2 et:
- とりあえず、dbm方式で行く事にしてみる。再利用可能方式。
- 或いは、毎回接続切断方式にする?
note:
- このモジュールは、sdss:table-get等の関数を提供する???
-- とりあえず、透過的に使えるようにしたい。そうできれば、すごく便利な為。
came from gauche.net
--------
--------
settings
internal slots
check slot
--------
エラー時には、close処理した方が良... | $ Id$
sdssクライアントモジュール
ToDo : どのようにする ? ? ?
(define-module tir03.sdss.client
(use gauche.parameter)
(use gauche.net)
(use srfi-1)
(use tir03.sdss.command)
(export
<sdss-client>
sdss-client-connect
sdss-client-disconnect
sdss-client-connected?
sdss-client-connection-is-alive?
... |
6c8056304add1ab93ee965568c4f338a392c99d4f92fb3dbf78cfdaee65ce42d | zachjs/sv2v | Foreach.hs | sv2v
- Author : < >
-
- Conversion for ` foreach ` loops .
-
- We simply convert these loops to a series of loops , with the bounds and
- direction provided by the array dimension query system functions . Omitted
- indices are skipped .
- Author: Zachary Snow <>
-
- Conversion for `forea... | null | https://raw.githubusercontent.com/zachjs/sv2v/a2b99fa9ddec5af70020cba1668ac8b873ece27e/src/Convert/Foreach.hs | haskell | sv2v
- Author : < >
-
- Conversion for ` foreach ` loops .
-
- We simply convert these loops to a series of loops , with the bounds and
- direction provided by the array dimension query system functions . Omitted
- indices are skipped .
- Author: Zachary Snow <>
-
- Conversion for `forea... | |
8b6d315ade6bad6a9f2c5f73ea04ddabca9573de644c7bbd3827856be7621457 | racket/typed-racket | invalid-unboxed-let2.rkt | #;#;
#<<END
TR opt: invalid-unboxed-let2.rkt 5:30 (+ 1.0+2.0i 2.0+4.0i) -- unboxed binary float complex
TR opt: invalid-unboxed-let2.rkt 5:33 1.0+2.0i -- unboxed literal
TR opt: invalid-unboxed-let2.rkt 5:42 2.0+4.0i -- unboxed literal
TR opt: invalid-unboxed-let2.rkt 5:52 (+ 3.0+6.0i 4.0+8.0i) -- unboxed binary float ... | null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/optimizer/tests/invalid-unboxed-let2.rkt | racket | #;
unboxing of let bindings does not currently work with multiple values | #<<END
TR opt: invalid-unboxed-let2.rkt 5:30 (+ 1.0+2.0i 2.0+4.0i) -- unboxed binary float complex
TR opt: invalid-unboxed-let2.rkt 5:33 1.0+2.0i -- unboxed literal
TR opt: invalid-unboxed-let2.rkt 5:42 2.0+4.0i -- unboxed literal
TR opt: invalid-unboxed-let2.rkt 5:52 (+ 3.0+6.0i 4.0+8.0i) -- unboxed binary float compl... |
77c809e58c12f31df04067b35d123dec0293ae9c38fb55528148c8bd3a54f8f4 | krdlab/haskell-oidc-client | Discovery.hs | {-# OPTIONS_GHC -Wno-warnings-deprecations #-}
{-# LANGUAGE OverloadedStrings #-}
module Spec.Client.Discovery where
import Network.HTTP.Client (path)
import Test.Hspec (Spec, describe, it, shouldBe)
import Web.OIDC.Client.Discovery (generateDiscoveryUrl)
tests :: S... | null | https://raw.githubusercontent.com/krdlab/haskell-oidc-client/b92736ba7d458b4d8571d378ad750b3e1ddaa7c4/test/Spec/Client/Discovery.hs | haskell | # OPTIONS_GHC -Wno-warnings-deprecations #
# LANGUAGE OverloadedStrings # | module Spec.Client.Discovery where
import Network.HTTP.Client (path)
import Test.Hspec (Spec, describe, it, shouldBe)
import Web.OIDC.Client.Discovery (generateDiscoveryUrl)
tests :: Spec
tests =
describe "Discovery.generateDiscoveryUrl" $ do
it "should ... |
19eba0ae2a006bbc29c10f019bf0bbb72a8ff8bf658256eb0eafe8bf8e55daf4 | helmutkian/cl-react | package.lisp | (defpackage #:cl-react.psx
(:nicknames #:psx)
(:use #:cl #:parenscript)
(:export #:compile-psx))
(defpackage #:cl-react
(:nicknames #:react)
(:use :cl :parenscript :cl-react.psx)
(:export #:build
#:psx
#:define-class
#:set-state*
#:bind-lambda
#:create-class
#:create-elemen... | null | https://raw.githubusercontent.com/helmutkian/cl-react/f6c2af7cbd4ad70e3cba6c7e6f9ef789d73bca2b/package.lisp | lisp | (defpackage #:cl-react.psx
(:nicknames #:psx)
(:use #:cl #:parenscript)
(:export #:compile-psx))
(defpackage #:cl-react
(:nicknames #:react)
(:use :cl :parenscript :cl-react.psx)
(:export #:build
#:psx
#:define-class
#:set-state*
#:bind-lambda
#:create-class
#:create-elemen... | |
d7f463f6bfde627d9bd7a7eafa7a1a4b8c302999388117615bb84f95fddf6947 | oxidizing/sihl | postgresql.ml | let services =
[ Sihl.Database.register ()
; Sihl.Database.Migration.PostgreSql.register []
; Sihl_token.PostgreSql.register ()
]
;;
module Test = Token.Make (Sihl_token.PostgreSql)
let () =
Sihl.Configuration.read_string "DATABASE_URL_TEST_POSTGRESQL"
|> Option.value ~default:"postgres:password@127.0.0.1... | null | https://raw.githubusercontent.com/oxidizing/sihl/3f23bb9e6d163278e10bac719cd434194f50baaf/sihl-token/test/postgresql.ml | ocaml | let services =
[ Sihl.Database.register ()
; Sihl.Database.Migration.PostgreSql.register []
; Sihl_token.PostgreSql.register ()
]
;;
module Test = Token.Make (Sihl_token.PostgreSql)
let () =
Sihl.Configuration.read_string "DATABASE_URL_TEST_POSTGRESQL"
|> Option.value ~default:"postgres:password@127.0.0.1... | |
59311173fdcd94fbdcbf7457bd5587ed90d5fb762d456b92b8639af874d6d6ba | the-language/zKanren | unify.rkt | : MicroKanren with Constraints and noto
Copyright ( C ) 2017
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation , either version 3 of the License , or
;; (at your option) any ... | null | https://raw.githubusercontent.com/the-language/zKanren/98df0700cb8935d1bde417ccb7f00b0417e00f6b/prelude/unify.rkt | racket | 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 will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero Gen... | : MicroKanren with Constraints and noto
Copyright ( C ) 2017
it under the terms of the GNU Affero 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 Affero General Public License
#lang racket
(provid... |
722c26806d90354b894460b398f1717a64fb3594ed93012f32d76671ad224378 | ocsigen/obrowser | obj.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocsigen/obrowser/977c09029ea1e4fde4fb0bf92b4d893835bd9504/rt/caml/obj.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : obj.mli 10457 2010 - 05 - 21 ... |
08c38db4360cb7871d8f53aef4d27d95c5ea09d28f5578a89cf722ed2c633610 | symbiont-io/detsys-testkit | State.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE NumericUnderscores #
module Debugger.State where
import Data.Aeson
import Data.Int
import Data.Time.Clock (UTCTime, secondsToNominalDiffTime)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import Data.Vector (Vector)
import GHC.Generics (Generic)
import qualified Data.Vector... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/ba5fe3f3065c17e3c6cbeae68dc80f14813c6531/src/new-debugger/src/Debugger/State.hs | haskell | , receivedSimulated :: Time
Should probably be per reactor
the current height
nanoseconds since posix-epoch
we don't want to select the sent messages | # LANGUAGE DeriveGeneric #
# LANGUAGE NumericUnderscores #
module Debugger.State where
import Data.Aeson
import Data.Int
import Data.Time.Clock (UTCTime, secondsToNominalDiffTime)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import Data.Vector (Vector)
import GHC.Generics (Generic)
import qualified Data.Vector... |
1268e7ede4e1b0b5b935b7b61e2dc0bb25681c4a3bebb6ace8235561393e5d3f | clojure/core.logic | protocols.clj | Copyright ( c ) , , contributors . 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... | null | https://raw.githubusercontent.com/clojure/core.logic/01c0310b0dc4fd3e402bd4dabf5579322a935416/src/main/clojure/clojure/core/logic/protocols.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , , contributors . All rights reserved .
(ns clojure.core.logic.protocols)
(definterface IBindable)
(definterface ITreeTerm)
(definterface IVar)
(defprotocol IUninitialized
(-uninitialized [coll]))
Unification protocols for core Clojure types
(defprotocol IUnifyTerms
(unify-terms [... |
c3a52c6a662ec6b0aa7aef4aee9a01522bc84e397f49aa8c071a755c57f7d242 | emina/rosette | kernel.rkt | #lang s-exp "../../../lang/main.rkt"
(kernel void (sample [int4* dst] [int4* src] [int4 offset])
(: int id idx)
(= id (get_global_id 0))
(= idx (choose id (/ id 4) (% id 4) (+ id 4) (* id 4) (- id 4)))
(= [dst idx] (+ [src idx] offset)))
| null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/sdsl/synthcl/examples/toy/synth/kernel.rkt | racket | #lang s-exp "../../../lang/main.rkt"
(kernel void (sample [int4* dst] [int4* src] [int4 offset])
(: int id idx)
(= id (get_global_id 0))
(= idx (choose id (/ id 4) (% id 4) (+ id 4) (* id 4) (- id 4)))
(= [dst idx] (+ [src idx] offset)))
| |
bae31563bf23db0a739f14cf72b358428723dd4e47526e2806f36f63c66d1712 | GrantMatejka/rasm | set.rkt | #lang racket
(provide x f g)
(define x 1)
(define (f) (begin
(set! x (+ x 1))
x))
(define (g) (begin (set! x 5) x))
| null | https://raw.githubusercontent.com/GrantMatejka/rasm/928175f6d880b99d0b17b43e793240a1d4bf8c6b/examples/set.rkt | racket | #lang racket
(provide x f g)
(define x 1)
(define (f) (begin
(set! x (+ x 1))
x))
(define (g) (begin (set! x 5) x))
| |
f0fb83c2d7508a6447eef90c8eeeb977628853114ede8e470a06f666bbd4a3d8 | Palmik/wai-sockjs | JSONP.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
module Network.Sock.Handler.JSONP
( JSONPPolling
, JSONPSend
) where
------------------------------------------------------------------------------
import Control.Applicative
import Control.Concurrent.STM.TMChan.Extra
import ... | null | https://raw.githubusercontent.com/Palmik/wai-sockjs/d1037cb00450a362b7e593a76d6257d06ecb2405/src/Network/Sock/Handler/JSONP.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------... | # LANGUAGE FlexibleContexts #
module Network.Sock.Handler.JSONP
( JSONPPolling
, JSONPSend
) where
import Control.Applicative
import Control.Concurrent.STM.TMChan.Extra
import Control.Concurrent.MVar.Lifted
import Control.Monad.Trans (lift)
import qualified Data.Aeson ... |
db4dffc21ddc2b29ef50a153f490145452ccc38f0fdc6e5446548e7cf8174598 | Perry961002/SICP | exa4.1.7-grammar.scm | ;analyze过程
(define (analyze exp)
(cond ((self-evaluating? exp)
(analyze-self-evaluating exp))
((quoted? exp)
(analyze-quoted exp))
((variable? exp)
(analyze-variable exp))
((assignment? exp)
(analyze-assignment exp))
((definition? ... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap4/example/exa4.1.7-grammar.scm | scheme | analyze过程
查看变量需要在执行过程中完成
设置变量的值
分析lambda表达式
对序列中的每一个表达式都将被分析,产生对应的执行过程。最后将这些过程组合起来
依次分析每个表达式
分析过程应用 |
(define (analyze exp)
(cond ((self-evaluating? exp)
(analyze-self-evaluating exp))
((quoted? exp)
(analyze-quoted exp))
((variable? exp)
(analyze-variable exp))
((assignment? exp)
(analyze-assignment exp))
((definition? exp)
... |
2780fbe634674bedf0a87b7e8b541df19c871ede85f64f9ac5104ccee767ffc2 | GNOME/aisleriot | isabel.scm | ; AisleRiot - isabel.scm
Copyright ( C ) 2001 < >
;
; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
; (at your option) any later version.
;
; This prog... | null | https://raw.githubusercontent.com/GNOME/aisleriot/5ab7f90d8a196f1fcfe5a552cef4a4c1a4b5ac39/games/isabel.scm | scheme | AisleRiot - isabel.scm
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 will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See... | Copyright ( C ) 2001 < >
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
(use-modules (aisleriot interface) (aisleriot api))
(define (new-game)
(initi... |
73df8dbcd15601baa0b00ee8cda3936b0565332c793c7b45284d9c63d882e07f | racket/old-plt | arlib.scm | ;; Array library: high level implementation of useful array procedures.
array arlib
2001
;;; This is a high level implementation of some generally useful
array procedures . In addition to R5RS and SRFI-25 , only one
;;; tool is used, namely array:apply-to-vector and friends. Thus
;;; this library serves to p... | null | https://raw.githubusercontent.com/racket/old-plt/a580d75deae2a0d2f3d8a93bc3c4f8f1f619b5b7/collects/srfi/25/arlib.scm | scheme | Array library: high level implementation of useful array procedures.
This is a high level implementation of some generally useful
tool is used, namely array:apply-to-vector and friends. Thus
this library serves to prove that the primitives really are
primitives. - A lower level implementation would access some
im... |
array arlib
2001
array procedures . In addition to R5RS and SRFI-25 , only one
( array - equal ?
( array->vector arr ) ( array->list )
( share - array / prefix arr k ... ) ( share - row arr k ) ( share - column )
( share - array / origin arr k ... ) ( share - array / origin )
(define (ar... |
5c1ddb1ec959b318eff7aef70d787993f9e921824bcc0e60a79545a5fa3bae80 | diagrams/diagrams-lib | Trace.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE MonoLocalBinds #-}
# OPTIONS_GHC -fno - warn - unused - imports #
for Data . Semigroup
-----------------------------------------------------------------------------
-- |
-- Module : Diagrams.Trace
Copyright : ( c ) 2013 diagr... | null | https://raw.githubusercontent.com/diagrams/diagrams-lib/6f66ce6bd5aed81d8a1330c143ea012724dbac3c/src/Diagrams/Trace.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE MonoLocalBinds #
---------------------------------------------------------------------------
|
Module : Diagrams.Trace
License : BSD-style (see LICENSE)
Maintainer :
\"Traces\", aka embedded raytracers, for finding points on the edge
implementation details.... | # LANGUAGE FlexibleContexts #
# OPTIONS_GHC -fno - warn - unused - imports #
for Data . Semigroup
Copyright : ( c ) 2013 diagrams - lib team ( see LICENSE )
of a diagram . See " Diagrams . Core . Trace " for internal
module Diagrams.Trace
Trace, Traced
, trace, setTrace, withTrace
, trac... |
b5cf8e2b53a08e31fe98b330ea311f1b2a2769e3646325eaa2a25de6de58009f | janestreet/bonsai | selection_status.ml | open! Core
type t =
| Selected
| Unselected
[@@deriving compare, equal, sexp]
let toggle = function
| Selected -> Unselected
| Unselected -> Selected
;;
| null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/web_ui/multi_select/src/selection_status.ml | ocaml | open! Core
type t =
| Selected
| Unselected
[@@deriving compare, equal, sexp]
let toggle = function
| Selected -> Unselected
| Unselected -> Selected
;;
| |
85e93ee4469d89e6be6ad12887d3ef4d82136f04201cb903bc848e6bf46e24f0 | VisionsGlobalEmpowerment/webchange | index.cljs | (ns webchange.ui.components.icon.layout.index
(:require
[webchange.ui.components.icon.layout.icon-page-image-only :as page-image-only]
[webchange.ui.components.icon.layout.icon-page-text-at-top :as page-text-at-top]
[webchange.ui.components.icon.layout.icon-page-text-big-at-bottom :as page-text-big-at-bot... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/0df52dd08d54f14d4ec5d2717f48031849a7ee16/src/cljs/webchange/ui/components/icon/layout/index.cljs | clojure | (ns webchange.ui.components.icon.layout.index
(:require
[webchange.ui.components.icon.layout.icon-page-image-only :as page-image-only]
[webchange.ui.components.icon.layout.icon-page-text-at-top :as page-text-at-top]
[webchange.ui.components.icon.layout.icon-page-text-big-at-bottom :as page-text-big-at-bot... | |
86bc30ce78d5f8e4af2ca9955cbc404dee385e333075d7446a4ad7cd7cb6685e | cognitect-labs/aws-api | signers.clj | Copyright ( c ) Cognitect , Inc.
;; All rights reserved.
(ns ^:skip-wiki cognitect.aws.signers
"Impl, don't call directly."
(:require [clojure.string :as str]
[cognitect.aws.service :as service]
[cognitect.aws.util :as util])
(:import [java.net URI]
[java.net URLDecoder]))
(... | null | https://raw.githubusercontent.com/cognitect-labs/aws-api/dbd5c31d2c7de3e9c38cd1eee5a9c94ff83ca5d3/src/cognitect/aws/signers.clj | clojure | All rights reserved.
-sdk-java/blob/fd409de/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java#L392-L397
Normalization can leave a trailing slash at the end of the resource path,
Remove the trailing slash if the input path doesn't end with one.
it's already been encoding. Look into avoiding ... | Copyright ( c ) Cognitect , Inc.
(ns ^:skip-wiki cognitect.aws.signers
"Impl, don't call directly."
(:require [clojure.string :as str]
[cognitect.aws.service :as service]
[cognitect.aws.util :as util])
(:import [java.net URI]
[java.net URLDecoder]))
(set! *warn-on-reflection... |
30181a22099c7e7506a27b43bf5d85c2318938db8c6122a8f8fdf4586b82b698 | typedclojure/typedclojure | parse_type.cljc | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/d57fa8d7aba7e035071c0ce3093d08997f51697d/typed/malli/src/typed/malli/parse_type.cljc | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns typed.malli.parse-type
"Parsing Typed Clojure syntax to malli"
(:require [clojure.set :as set]
[typed.clojure :as t]
[clojure.core.typed.parse-ast :as ast]
[clojure.core.typed.unsafe :as unsafe]
[clojure.core.typed.curr... |
53a4aceec1f4ddf89eaaac7fcffc2f90805b19f61bb8f4b8e2ac76ddb352adf9 | bakul/s9fes | c2html1.scm | #! /usr/local/bin/s9
; c2html -- print C code to HTML
By , 2009 - 2012
; Placed in the Public Domain
;
; Usage: c2html [-dL] [file ...]
;
; Render C code contained in the given file. When no file
is given , render stdin . Write output to stdout .
;
; Options:
;
; -d write a full HTML document (default: PRE blo... | null | https://raw.githubusercontent.com/bakul/s9fes/74c14c0db5f07f5bc6d94131e9e4ee15a29275aa/prog/c2html1.scm | scheme | c2html -- print C code to HTML
Placed in the Public Domain
Usage: c2html [-dL] [file ...]
Render C code contained in the given file. When no file
Options:
-d write a full HTML document (default: PRE block only)
-L emit Lout output instead of HTML
syntax highlighting.
NOTE: This program handles only a s... | #! /usr/local/bin/s9
By , 2009 - 2012
is given , render stdin . Write output to stdout .
The CSS2 style sheet " ccode.css " contains the default style for
(load-from-library "c2html.scm")
(load-from-library "parse-optionsb.scm")
(define show-help (option #\h #f))
(define full-html (option #\d #f))
(... |
bcf996ea1c6cc49bebfabffb980f2b51fb25047529f31585fd6a188c0e538035 | mentat-collective/emmy | generic_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.generic-test
(:refer-clojure :exclude [+ - * / zero?])
(:require [clojure.test :refer [is deftest testing]]
[clojure.test.check.generators :as gen]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[emmy.generic :as g]
... | null | https://raw.githubusercontent.com/mentat-collective/emmy/535b237a8e3fd7067b9c0ade8b2a4b3419f9f132/test/emmy/generic_test.cljc | clojure | #_"SPDX-License-Identifier: GPL-3.0"
(ns emmy.generic-test
(:refer-clojure :exclude [+ - * / zero?])
(:require [clojure.test :refer [is deftest testing]]
[clojure.test.check.generators :as gen]
[com.gfredericks.test.chuck.clojure-test :refer [checking]]
[emmy.generic :as g]
... | |
cc91a39f85554228af7facc808baed6dbf56c1bb69eb20e85f3e2a4df655350a | jackfirth/racket-mock | history.rkt | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[mock-call
(->* () (#:name (or/c symbol? #f) #:args arguments? #:results list?)
mock-call?)]
[mock-call? predicate/c]
[mock-call-args (-> mock-call? arguments?)]
[mock-call-name (-> mock-call? (or/c symbol? #f))]
[mock-call-... | null | https://raw.githubusercontent.com/jackfirth/racket-mock/5e8e2a1dd125e5e437510c87dabf903d0ec25749/mock/private/history.rkt | racket | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[mock-call
(->* () (#:name (or/c symbol? #f) #:args arguments? #:results list?)
mock-call?)]
[mock-call? predicate/c]
[mock-call-args (-> mock-call? arguments?)]
[mock-call-name (-> mock-call? (or/c symbol? #f))]
[mock-call-... | |
2d7006bef3b79e3dea9d27f65dbd9fbf162d8cfda3f8349aef8e0f7d5c30d580 | threatgrid/ctia | entities_test.clj | (ns ctia.domain.entities-test
(:require [ctia.domain.entities :as sut]
[ctim.schemas.common :refer [ctim-schema-version]]
[ctim.examples.sightings :refer [sighting-minimal sighting-maximal]]
[ctia.entity.sighting.schemas :as ss]
[ctia.test-helpers.collections :refer [is... | null | https://raw.githubusercontent.com/threatgrid/ctia/dfb4057a90945545ce7c6f5de2a281d6ee3291d8/test/ctia/domain/entities_test.clj | clojure | allow time to pass so :modified != :created below | (ns ctia.domain.entities-test
(:require [ctia.domain.entities :as sut]
[ctim.schemas.common :refer [ctim-schema-version]]
[ctim.examples.sightings :refer [sighting-minimal sighting-maximal]]
[ctia.entity.sighting.schemas :as ss]
[ctia.test-helpers.collections :refer [is... |
c220587ae8138c7051116827a015317c95bdfd4d4695226e3b4220ead2c40542 | ucsd-progsys/nate | tkanim.mli | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/tkanim/tkanim.mli | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
278e991cd57c9e91bfae945aeacb4b064e9683631e54fc9589a36f205133b719 | facet-lang/facet | Lens.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE UndecidableInstances #
module Facet.Carrier.Error.Lens
( -- * Error carrier
runError
, ErrorC(..)
-- * Error effect
, module Control.Effect.Error
) where
import Control.Algebra
import Control.Carrier.Reader
import Control.Effect.Error
import Control.Lens (APrism', withPrism)
impor... | null | https://raw.githubusercontent.com/facet-lang/facet/4626eed1395cd91acc2d38910f27809ad6e753fa/src/Facet/Carrier/Error/Lens.hs | haskell | # LANGUAGE GADTs #
* Error carrier
* Error effect | # LANGUAGE UndecidableInstances #
module Facet.Carrier.Error.Lens
runError
, ErrorC(..)
, module Control.Effect.Error
) where
import Control.Algebra
import Control.Carrier.Reader
import Control.Effect.Error
import Control.Lens (APrism', withPrism)
import Control.Monad.IO.Class
runError :: APrism' e f -> ErrorC e f ... |
5d7d5a4079fe635d4045f4fabde9136730759af8e2c9167dce048d38f091748f | janestreet/universe | ppx_inline_test_runner.ml | let () = Ppx_inline_test_lib.Runtime.exit ()
| null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/ppx_inline_test/runner/ppx_inline_test_runner.ml | ocaml | let () = Ppx_inline_test_lib.Runtime.exit ()
| |
60b78b12b5f44a2ae271dda26c9a01ef8600007ed7ba3619270a186194bfc8c7 | ploeh/advent-of-code-2017 | Solution.hs | module Day03 where
-- Not at all sure about this implementation. I had several false starts, so I'm
-- afraid that I came at this puzzle from the wrong direction.
-- I wouldn't be surprised if a much more elegant solution exists, using a
-- radically different approach, but obviously, it eluded me.
import Data.List (... | null | https://raw.githubusercontent.com/ploeh/advent-of-code-2017/e0f66bf2735cf1e37fbcf001296fdda8df3ece8c/Day03/Solution.hs | haskell | Not at all sure about this implementation. I had several false starts, so I'm
afraid that I came at this puzzle from the wrong direction.
I wouldn't be surprised if a much more elegant solution exists, using a
radically different approach, but obviously, it eluded me.
Enumerates all the coordinates in a ring
Enum... | module Day03 where
import Data.List (find, unfoldr)
Zero - indexed size of each ring side . Ring 0 has size 1 , ring 1 has size 3 ,
ring 2 has size 5 , and so on ...
ringSize :: Num a => a -> a
ringSize n = n * 2 + 1
ringCoordinates :: Integral a => a -> [(a, a)]
ringCoordinates r =
let halfSide = ringSize r ... |
ec679d3d4754aeaec81f2dea56a2b19ec6f1e2f7bb0e99ece8836d7b4b67d031 | boolexpr/boolexpr | Printer.hs | module Data.BoolExpr.Printer
(-- * Printers
boolExprPrinter
, signedPrinter
, disjPrinter
, conjPrinter
, cnfPrinter
, dnfPrinter
)
where
import Data.BoolExpr
-- | Printer
boolExprPrinter :: (a -> ShowS) -> BoolExpr a -> ShowS
boolExprPrinter f = go
where
go (BAnd a b) = paren $ go a . text " ... | null | https://raw.githubusercontent.com/boolexpr/boolexpr/023185a3a2c8b90ef156c2392dfd554447fbeee4/Data/BoolExpr/Printer.hs | haskell | * Printers
| Printer
not in the parser
not in the parser | module Data.BoolExpr.Printer
boolExprPrinter
, signedPrinter
, disjPrinter
, conjPrinter
, cnfPrinter
, dnfPrinter
)
where
import Data.BoolExpr
boolExprPrinter :: (a -> ShowS) -> BoolExpr a -> ShowS
boolExprPrinter f = go
where
go (BAnd a b) = paren $ go a . text " AND " . go b
go (BOr a b)... |
3d9796ebbf9ec7f49ba9ed0ed3b34e2c8b0fdea2719adbdabddd5b61956e480c | aeternity/mnesia_leveled | mnesia_leveled_xform.erl | %%----------------------------------------------------------------
Copyright ( c ) 2013 - 2016 Klarna AB
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/aeternity/mnesia_leveled/11c480b5546ed6087ae688e8596bd596a1f7bdd1/test/mnesia_leveled_xform.erl | erlang | ----------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions an... | Copyright ( c ) 2013 - 2016 Klarna AB
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
via a parse_transform , to replace dis... |
b40c740b2038d38acaec977d4163423c4f793adc438fb429ded15ac0af10036a | yogthos/yuggoth | session.cljs | (ns yuggoth.session
(:refer-clojure :exclude [get get-in reset! swap!])
(:require [reagent.core :as reagent :refer [atom]]))
(def state (atom {}))
(defn get
"Get the key's value from the session, returns nil if it doesn't exist."
[k & [default]]
(clojure.core/get @state k default))
(defn put! [k v]
(cloj... | null | https://raw.githubusercontent.com/yogthos/yuggoth/901541c5809fb1e77c249f26a3aa5df894c88242/src-cljs/yuggoth/session.cljs | clojure | (ns yuggoth.session
(:refer-clojure :exclude [get get-in reset! swap!])
(:require [reagent.core :as reagent :refer [atom]]))
(def state (atom {}))
(defn get
"Get the key's value from the session, returns nil if it doesn't exist."
[k & [default]]
(clojure.core/get @state k default))
(defn put! [k v]
(cloj... | |
63a8636663d7509f6fb9633935d026b4c89c75fc3464e85a4e0eb27a72bbdb3c | jrh13/hol-light | jacobian.ml | (* ------------------------------------------------------------------------- *)
Jacobian coordinates , ( x , y , z ) |- > ( x / z^2,y / z^3 ) and ( 1,1,0 ) |- > infinity
(* ------------------------------------------------------------------------- *)
needs "EC/weierstrass.ml";;
let jacobian_point = define
`jacobi... | null | https://raw.githubusercontent.com/jrh13/hol-light/f25b1592a72d8c1c2666231645cff4809aed1ce4/EC/jacobian.ml | ocaml | -------------------------------------------------------------------------
------------------------------------------------------------------------- | Jacobian coordinates , ( x , y , z ) |- > ( x / z^2,y / z^3 ) and ( 1,1,0 ) |- > infinity
needs "EC/weierstrass.ml";;
let jacobian_point = define
`jacobian_point f (x,y,z) <=>
x IN ring_carrier f /\ y IN ring_carrier f /\ z IN ring_carrier f`;;
let jacobian_curve = define
`jacobian_curve (f,a:A,b) (x,y... |
f2943a844ff2c28b9fd0d6cdc0c1214609f444b780aabd6fcb68fa72694cec83 | sonowz/advent-of-code-haskell | Day02.hs | module Y2019.Day02 where
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.CallStack
import Relude.Extra.Foldable1
import Relude.Extra.Map hiding ((!?))
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import Data.Vector (Vector, (!?))
import qualified Data.Vector as V
import Control.Monad.ST
import... | null | https://raw.githubusercontent.com/sonowz/advent-of-code-haskell/6cec825c5172bbec687aab510e43832e6f2c0372/src/Y2019/Day02.hs | haskell | ---------------------
Type declarations --
---------------------
----------
Part 1 --
----------
----------
----------
------------------
------------------ | module Y2019.Day02 where
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.CallStack
import Relude.Extra.Foldable1
import Relude.Extra.Map hiding ((!?))
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import Data.Vector (Vector, (!?))
import qualified Data.Vector as V
import Control.Monad.ST
import... |
207860ab0b81758250028e08223e1b19fc7c84c88034762f01265b5346c6fea4 | etalab/sill.etalab.gouv.fr | i18n.cljc | Copyright ( c ) 2019 - 2022 DINUM , < >
SPDX - License - Identifier : EPL-2.0
;; License-Filename: LICENSES/EPL-2.0.txt
(ns sillweb.i18n
(:require [taoensso.tempura :refer [tr]]
[markdown-to-hiccup.core :as md]))
(defn md-to-string [s]
(-> s (md/md->hiccup) (md/component)))
(def supported-lang... | null | https://raw.githubusercontent.com/etalab/sill.etalab.gouv.fr/1a2e866cd2ada33f7c5ab7cb81042a456fa368f5/src/cljc/sillweb/i18n.cljc | clojure | License-Filename: LICENSES/EPL-2.0.txt | Copyright ( c ) 2019 - 2022 DINUM , < >
SPDX - License - Identifier : EPL-2.0
(ns sillweb.i18n
(:require [taoensso.tempura :refer [tr]]
[markdown-to-hiccup.core :as md]))
(defn md-to-string [s]
(-> s (md/md->hiccup) (md/component)))
(def supported-languages #{"fr" "en" "de" "es" "it"})
(def l... |
e6a9bbe0015330f7ec6f5130a728f4780608d8e3486816f6d6daff1adbc1d81d | sgbj/MaximaSharp | dqawse.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
;;; "f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/numerical/slatec/dqawse.lisp | lisp | Compiled by f2cl version:
"f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl6.l , v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $ "
" macros.l , v fceac53... |
4d71c4ae7a14b89a62fc1280b26567d4412f12692397b38555761d3ec3c5a75c | triffon/fp-2019-20 | 04-count-digits.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
1.5 - Търсим процедура , число
да работи и за .
(define (abs n)
(if (< n 0)
(* -1 n)
n
)
)
(define (count-digits number)
(if (and (<= 0 (abs number)) (>= 9 (abs number)))
1
това май го проверка
(+ 1 (count-d... | null | https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/computer-science-3/exercises/01.introduction/solutions/04-count-digits.rkt | racket | #lang racket
(require rackunit)
(require rackunit/text-ui)
1.5 - Търсим процедура , число
да работи и за .
(define (abs n)
(if (< n 0)
(* -1 n)
n
)
)
(define (count-digits number)
(if (and (<= 0 (abs number)) (>= 9 (abs number)))
1
това май го проверка
(+ 1 (count-d... | |
78b9fb46000cc3363b89e952d85615c122c3158cb990db0218cd36e4e342255b | johnwhitington/camlpdf | pdfmerge.mli | (** Merge PDF files *)
* Merge PDF files . [ merge_pdfs retain_numbering remove_duplicate_fonts names
pdfs ranges ] will merge the given PDFs . if [ retain_numbering ] is true , page
labels are retained . If [ remove_duplicate_fonts ] is true , duplicate fonts are
detected and coalesced . [ names ] is a list of ... | null | https://raw.githubusercontent.com/johnwhitington/camlpdf/dc7cfafaf9671bed1503a5c4143632922226b02d/pdfmerge.mli | ocaml | * Merge PDF files
* Remove duplicate fonts from a PDF. For example, if it was created by merging
several documents from the same source. |
* Merge PDF files . [ merge_pdfs retain_numbering remove_duplicate_fonts names
pdfs ranges ] will merge the given PDFs . if [ retain_numbering ] is true , page
labels are retained . If [ remove_duplicate_fonts ] is true , duplicate fonts are
detected and coalesced . [ names ] is a list of strings the same length... |
794d2399509438bd392f127776c560173169590a8bacdef09fe8f15c25b3810f | cram2/cram | location-costmap.lisp | Copyright ( c ) 2010 , < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list o... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_common/cram_location_costmap/src/location-costmap.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Red... | Copyright ( c ) 2010 , < >
* Neither the name of the Intelligent Autonomous Systems Group/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
cf05c453c357671d6ca78a67785ec86e68411db8d5a6072d38a513f878a35db1 | tonsky/advent-of-code | day10.clj | (ns advent-of-code.year2022.day10
(:require
[clojure.java.io :as io]
[clojure.math :as math]
[clojure.string :as str]
[clojure.set :as set]
[remote-require.core :as rr]))
(rr/from ""
:require [cond+])
(rr/from ""
:require [zip])
(def sample1
"noop
addx 3
addx -5")
(def sample2
(slurp (... | null | https://raw.githubusercontent.com/tonsky/advent-of-code/d7dbd6681d229a386f718aebcd33596118666d9b/src/advent_of_code/year2022/day10.clj | clojure | (ns advent-of-code.year2022.day10
(:require
[clojure.java.io :as io]
[clojure.math :as math]
[clojure.string :as str]
[clojure.set :as set]
[remote-require.core :as rr]))
(rr/from ""
:require [cond+])
(rr/from ""
:require [zip])
(def sample1
"noop
addx 3
addx -5")
(def sample2
(slurp (... | |
a9e5a13a465d5a7ff83f91cc9db9d07cb93468a8b0efb38d5802b45b8ab11a82 | mfoemmel/erlang-otp | ssh_cm.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2005 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/ssh/src/ssh_cm.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2005 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(ssh_cm).
-include("ssh.hrl").
-... |
859a70901e50cf1093e0dd4eba66d72a8ad356c9290ecc834c07da1edc905653 | alanz/ghc-exactprint | LetStmt.hs | -- A simple let statement, to ensure the layout is detected
module Layout.LetStmt where
foo = do
{- ffo -}let x = 1
y = 2 -- baz
x+y
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc710/LetStmt.hs | haskell | A simple let statement, to ensure the layout is detected
ffo
baz |
module Layout.LetStmt where
foo = do
x+y
|
c075576971ef9e567b2d8b17adcdf338c52bd7742b3ce250549bee0db1fd27b3 | unclebob/AdventOfCode2021 | core.clj | (ns day11.core
(:require [clojure.string :as string]
[clojure.set :as set]))
(defn- char-to-num [char]
(let [i (int char)]
(- i (int \0))))
(defn parse-line [line]
(map char-to-num line))
(defn parse-lines [lines]
(map parse-line (string/split-lines lines)))
(defn grid-to-map [grid]
(let ... | null | https://raw.githubusercontent.com/unclebob/AdventOfCode2021/83d33a3366a6b604a53a32efe0dbc2fa3ede2915/day11/src/day11/core.clj | clojure | (ns day11.core
(:require [clojure.string :as string]
[clojure.set :as set]))
(defn- char-to-num [char]
(let [i (int char)]
(- i (int \0))))
(defn parse-line [line]
(map char-to-num line))
(defn parse-lines [lines]
(map parse-line (string/split-lines lines)))
(defn grid-to-map [grid]
(let ... | |
8c0c73c2108bfdc51e0020144283258b6d7bdb33f546a72a30eba35f39c58fd2 | fission-codes/fission | Types.hs | module Fission.URL.Path.Types (Path (..)) where
import qualified RIO.Text as Text
import Fission.Prelude
data Path a = a `WithPath` [Text]
deriving (Eq, Show)
instance Display a => Display (Path a) where
textDisplay (a `WithPath` segments) = textDisplay a <> "/" <> path
where
path :: ... | null | https://raw.githubusercontent.com/fission-codes/fission/ae177407dccc20be67948a901956b99f40d37ac8/fission-core/library/Fission/URL/Path/Types.hs | haskell | module Fission.URL.Path.Types (Path (..)) where
import qualified RIO.Text as Text
import Fission.Prelude
data Path a = a `WithPath` [Text]
deriving (Eq, Show)
instance Display a => Display (Path a) where
textDisplay (a `WithPath` segments) = textDisplay a <> "/" <> path
where
path :: ... | |
699994acf86df0c7aac23d8fc959fddbdeef54197a867f293c9d1f12b4980362 | hunt-framework/hunt | Position.hs | -- ----------------------------------------------------------------------------
{- |
Normalization and validation for geographic positions.
-}
-- ----------------------------------------------------------------------------
module Hunt.Index.Schema.Normalize.Position
( normalize
, denormalize
, i... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-searchengine/src/Hunt/Index/Schema/Normalize/Position.hs | haskell | ----------------------------------------------------------------------------
|
Normalization and validation for geographic positions.
----------------------------------------------------------------------------
------------------------------------------------------------
validator
-----------------------------... |
module Hunt.Index.Schema.Normalize.Position
( normalize
, denormalize
, isPosition
, position
)
where
import Data.Text (Text)
import qualified Data.Text as T
import Hunt.Utility
import Numeric
import Text.Parsec
import Text.ParserCom... |
813bec754c84bc23bb80d94b29483da1b7335026a4327b56c2182867ce10e9a6 | robert-strandh/SICL | compile-simple-float-related-asts.lisp | (cl:in-package #:cleavir-ast-to-hir)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Compile a SINGLE-FLOAT-P-AST.
(defmethod compile-ast (client (ast cleavir-ast:single-float-p-ast) context)
(assert-context ast context 0 2)
(let ((temp (make-temp)))
(compile-ast
client
(cleavir-ast:objec... | null | https://raw.githubusercontent.com/robert-strandh/SICL/bd3ec8f991d9455541d1629a3c672ae3d46dc16d/Code/Cleavir/AST-to-HIR/compile-simple-float-related-asts.lisp | lisp |
Compile a SINGLE-FLOAT-P-AST.
Utility function for compiling a list of ASTs that are arguments
to some operation, and that need to be unboxed. They will all be
compiled in a context with a single successor and a single result.
Method on COMPILE-AST for all simple floating-point arithmetic ASTs.
Method on... | (cl:in-package #:cleavir-ast-to-hir)
(defmethod compile-ast (client (ast cleavir-ast:single-float-p-ast) context)
(assert-context ast context 0 2)
(let ((temp (make-temp)))
(compile-ast
client
(cleavir-ast:object-ast ast)
(clone-context
context
:result temp
:successor
(m... |
97a69fe49b9a017d14010b91c01b9a033beb667396e7577e1001490b13ece58c | purescript/spago | DryRun.hs | module Spago.DryRun
( DryRun(..)
, DryAction(..)
, runDryActions
) where
import Spago.Prelude
-- | Whether to actually perform side-effects
data DryRun = DryRun | NoDryRun
| Wrapper for Spago actions that can be dry run
data DryAction env
= DryAction
{ dryMessage :: Text
, dryAction :: HasLogFu... | null | https://raw.githubusercontent.com/purescript/spago/8e466899c322d1c561788e5fac1148570bff71d5/src/Spago/DryRun.hs | haskell | | Whether to actually perform side-effects | module Spago.DryRun
( DryRun(..)
, DryAction(..)
, runDryActions
) where
import Spago.Prelude
data DryRun = DryRun | NoDryRun
| Wrapper for Spago actions that can be dry run
data DryAction env
= DryAction
{ dryMessage :: Text
, dryAction :: HasLogFunc env => RIO env ()
}
runDryActions :: H... |
f44404ebcc9552ef06a3bc46df3c4679090f0654415de05b501769bab1f9bafc | gwkkwg/metatilities-base | package.lisp | (in-package #:common-lisp-user)
(defpackage #:metabang.utilities
(:nicknames #:metatilities)
(:use #:common-lisp)
;; just a little bit of mop
(:import-from #+(or allegro abcl) #:mop
#+clisp #:clos
#+clasp #:clos
#+ecl #:clos
#+lispworks #:clos
#+(o... | null | https://raw.githubusercontent.com/gwkkwg/metatilities-base/ef04337759972fd622c9b27b53149f3d594a841f/dev/package.lisp | lisp | just a little bit of mop
FLAG -- DJC
I'm not sure how to achieve the following imports and re-exports
metatilities into a loadable fasl (which should itself be free of
asdf and loadable without asdf having been loaded in the image)
commenting them out for now - and other ideas welcome.
??? I think this is th... | (in-package #:common-lisp-user)
(defpackage #:metabang.utilities
(:nicknames #:metatilities)
(:use #:common-lisp)
(:import-from #+(or allegro abcl) #:mop
#+clisp #:clos
#+clasp #:clos
#+ecl #:clos
#+lispworks #:clos
#+(or mcl openmcl) #:ccl
#+cmu ... |
d706b6516367ec1c1af75d6283b139141804e9ae2219f7a20bfaa144fe9caab6 | sharplispers/ironclad | benchmark-implementation.lisp | (asdf:load-system "ironclad")
(defparameter *data-size*
#+sbcl (expt 2 27)
#+ccl (expt 2 23)
#-(or sbcl ccl) (expt 2 20))
(defparameter *buffer-size* 32768)
(defparameter *iterations* 100)
(defparameter *implementation-result-file* "benchmark-tmp")
(defparameter *result* (acons "version"
... | null | https://raw.githubusercontent.com/sharplispers/ironclad/6cc4da8554558ee2e89ea38802bbf6d83100d4ea/benchmark/benchmark-implementation.lisp | lisp | (asdf:load-system "ironclad")
(defparameter *data-size*
#+sbcl (expt 2 27)
#+ccl (expt 2 23)
#-(or sbcl ccl) (expt 2 20))
(defparameter *buffer-size* 32768)
(defparameter *iterations* 100)
(defparameter *implementation-result-file* "benchmark-tmp")
(defparameter *result* (acons "version"
... | |
4412f7c3e6a1898cc4b227b20b7a0611077e4c0a0901783bc657ce9eb1427d7e | DavidVujic/clojurescript-amplified | song_stories.cljs | (ns app.stories.song-stories
(:require [app.components.song :refer [song-card]]
[app.stories.helper :as helper]
[reagent.core :as reagent]))
(def ^:export default
(helper/->default {:title "Material-UI Song"
:component song-card}))
(defn ^:export song []
(reagent... | null | https://raw.githubusercontent.com/DavidVujic/clojurescript-amplified/2741ba95869de5a28ec97b35d3331995d2082c03/src/stories/app/stories/song_stories.cljs | clojure | (ns app.stories.song-stories
(:require [app.components.song :refer [song-card]]
[app.stories.helper :as helper]
[reagent.core :as reagent]))
(def ^:export default
(helper/->default {:title "Material-UI Song"
:component song-card}))
(defn ^:export song []
(reagent... | |
875cb36b72da7a649f6341af9137ba5d5b5d9cd82ef8c01ce14b652317e9a92e | jbclements/RSound | frequency-response.rkt | #lang racket/base
(require rackunit
plot
"filter.rkt"
"filter-typed.rkt"
racket/flonum
(only-in racket/math pi)
(only-in racket/match match match-define)
racket/contract)
(provide (contract-out [response-plot (->* ((-> number? number?) number? number?)
... | null | https://raw.githubusercontent.com/jbclements/RSound/c699db1ffae4cf0185c46bdc059d7879d40614ce/rsound/frequency-response.rkt | racket | draw a plot of the frequency response from min-freq to max-freq:
max-freq
plot the frequency response of a low-pass filter
min-freq and max-freq just control what portion of the
frequency domain is displayed. The #:db flag controls whether
the result is shown in decibels
(define fun
compensate for gain at 0 Hz ... | #lang racket/base
(require rackunit
plot
"filter.rkt"
"filter-typed.rkt"
racket/flonum
(only-in racket/math pi)
(only-in racket/match match match-define)
racket/contract)
(provide (contract-out [response-plot (->* ((-> number? number?) number? number?)
... |
9182627e06ebc57b6a56aa9053526bc1a87c5723ff8893d99e07bc3115711919 | compiling-to-categories/concat | LC.hs | # LANGUAGE CPP #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeFamilies #-}
# define
#ifdef Alias
# LANGUAGE TypeOperators #
{-# LANGUAGE ConstraintKinds #-}
#endif
# OPTIONS_GHC -Wall #
{-# OPTIONS_GH... | null | https://raw.githubusercontent.com/compiling-to-categories/concat/49e554856576245f583dfd2484e5f7c19f688028/examples/src/ConCat/LC.hs | haskell | # LANGUAGE TypeFamilies #
# LANGUAGE ConstraintKinds #
# OPTIONS_GHC -Wno-unused-imports #
TEMP
| Experimenting with an example. The plugin doesn't find the needed instances
when they're declared in the same module as the example. Hm.
• In the instance declaration for ‘OkLC a’ | # LANGUAGE CPP #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# define
#ifdef Alias
# LANGUAGE TypeOperators #
#endif
# OPTIONS_GHC -Wall #
module ConCat.LC where
import Data.Constraint (Dict(..),(:-)(..))
import ConCat.Misc... |
83f9bb0a04a3d4cbcc3b02039111a37724c4078e3448c87ed48eaf762b1b3ff1 | mdunnio/coinbase-pro | API.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module CoinbasePro.Unauthenticated.API
( products
, singleProduct
, aggregateOrderBook
, fullOrderBook
, trades
, candles
, stats
, currencies
, time
) where
import Data.Proxy (Proxy... | null | https://raw.githubusercontent.com/mdunnio/coinbase-pro/adb2f505a022027670d007964c092676000a7069/src/lib/CoinbasePro/Unauthenticated/API.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module CoinbasePro.Unauthenticated.API
( products
, singleProduct
, aggregateOrderBook
, fullOrderBook
, trades
, candles
, stats
, currencies
, time
) where
import Data.Proxy (Proxy... | |
a36059d854b7717165cd2dcafa6f87cb38036d1f71241c7ec21451801f214a1e | stepcut/plugins | API.hs |
module API where
data Interface = Interface { field : : Int }
-- newtype Interface = Interface Int
type Interface = Int
| null | https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/testsuite/pdynload/spj1/api/API.hs | haskell | newtype Interface = Interface Int |
module API where
data Interface = Interface { field : : Int }
type Interface = Int
|
cad1cdc9c16dadc011828d8bfc29b194d74d73bd05b4b38f9295ef08714bc322 | kadena-io/chainweb-node | Mempool.hs | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
| Tests and test infrastructure common to all backends .
module Chainweb.Test.Mempool
... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/aee77e34f04a6c0a7e587dcdd039f2ba41406dc5/test/Chainweb/Test/Mempool.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
internal modules
----------------------------------------------------------------------------
| Several operations (reintroduce, validate, confirm) can only be performed
by the local consensus layer and are not supported for remote mempools. The
following test ... | # LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
| Tests and test infrastructure common to all backends .
module Chainweb.Test.Mempool
( tests
, remoteTests
, MempoolWithFunc(..)
, InsertChe... |
d26df64244357a69c77f10dd42aad3ad647a644f438fc8bede6147651d84d15d | ocaml-dune/fiber | mvar.ml | open Stdune
open Core
type 'a t =
{ writers : ('a * unit k) Queue.t
; readers : 'a k Queue.t
; mutable value : 'a option
}
Invariant enforced on . We do n't actually call this function , but we
keep it here for documentation and to help understand the implementation :
keep it here for documentation... | null | https://raw.githubusercontent.com/ocaml-dune/fiber/0b322636da0d0cce5b8dd2179b6197a4d765d09a/fiber/src/mvar.ml | ocaml | open Stdune
open Core
type 'a t =
{ writers : ('a * unit k) Queue.t
; readers : 'a k Queue.t
; mutable value : 'a option
}
Invariant enforced on . We do n't actually call this function , but we
keep it here for documentation and to help understand the implementation :
keep it here for documentation... | |
0423413de925788c8d5bc1ebc0b1af50e9f24afc8ae58424cc22b82bcebf25f7 | links-lang/links | links.ml | open Links_core
open Utility
module BS = Basicsettings
let to_evaluate
= Settings.(multi_option "evaluate"
|> synopsis "Evaluates an expression"
|> privilege `System
|> hint "<expression>"
|> hidden
|> convert (fun s -> [s])
|> CLI.... | null | https://raw.githubusercontent.com/links-lang/links/77dc1beeab8475538768da0a5f74eba6eb0ae482/bin/links.ml | ocaml | Attempt to synchronise all settings. If any setting commands are
left unhandled, then error and exit. | open Links_core
open Utility
module BS = Basicsettings
let to_evaluate
= Settings.(multi_option "evaluate"
|> synopsis "Evaluates an expression"
|> privilege `System
|> hint "<expression>"
|> hidden
|> convert (fun s -> [s])
|> CLI.... |
680fb619960f3443a3e79cd04fd44efe80e6abb0803f965fc10d23ec2ab71576 | pmundkur/flowcaml | standard.mli | (**************************************************************************)
(* *)
(* *)
, Projet C... | null | https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-flowcaml/utils/standard.mli | ocaml | ************************************************************************
et en Automatique. All ri... |
, Projet Cristal , INRIA Rocquencourt
Copyright 2002 , 2003 Institut National de Recherche en Informatique
under the terms of the Q Public License version 1.0 .
$ I d : standard.mli , v 1.2 2003/06/26... |
cdbff17730ea69cb0cc345156fe02295a6e831a8c5950bc5591540623e09f812 | laurencer/confluence-sync | Server.hs | -----------------------------------------------------------------------------
-- |
Module : Network . XmlRpc . Server
Copyright : ( c ) 2003
-- License : BSD-style
--
-- Maintainer :
-- Stability : experimental
-- Portability : non-portable (requires extensions and non-portable libraries)... | null | https://raw.githubusercontent.com/laurencer/confluence-sync/442fdbc84fe07471f323af80d2d4580026f8d9e8/vendor/haxr/Network/XmlRpc/Server.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : experimental
Portability : non-portable (requires extensions and non-portable libraries)
>
> add :: Int -> Int -> IO Int
> add x y = return (x + y)
>
> main = cgiXmlRpcSer... | Module : Network . XmlRpc . Server
Copyright : ( c ) 2003
This module contains the server functionality of XML - RPC .
The XML - RPC specifcation is available at < > .
A simple CGI - based XML - RPC server application :
> import Network . XmlRpc . Server
module Network.XmlRpc.Server
(
... |
a789b4edf8834108a9b52b42e6c9dc5d03ce720357da2af568aefb1338d0447a | webyrd/miniKanren | mktests.scm | (load "mkneverequalo.scm")
(load "prelude.scm")
(define-syntax run1 (syntax-rules () ((_ (x) g0 g ...) (run 1 (x) g0 g ...))))
(define-syntax run2 (syntax-rules () ((_ (x) g0 g ...) (run 2 (x) g0 g ...))))
(define-syntax run3 (syntax-rules () ((_ (x) g0 g ...) (run 3 (x) g0 g ...))))
(define-syntax run4 (syntax-rules ... | null | https://raw.githubusercontent.com/webyrd/miniKanren/c8e70e8cf1c49804d9b79c3b336601b2beb5575e/mktests.scm | scheme | (test-check "testc22.tex-24"
(reify x s))
`(a _.0 c _.0))
Will's toys: | (load "mkneverequalo.scm")
(load "prelude.scm")
(define-syntax run1 (syntax-rules () ((_ (x) g0 g ...) (run 1 (x) g0 g ...))))
(define-syntax run2 (syntax-rules () ((_ (x) g0 g ...) (run 2 (x) g0 g ...))))
(define-syntax run3 (syntax-rules () ((_ (x) g0 g ...) (run 3 (x) g0 g ...))))
(define-syntax run4 (syntax-rules ... |
33a41f15f73587f442fa9c168c19b1e2c6e7e4bf769242a76c7d007f6a16f8ea | Oblosys/proxima | DPP_Lib.hs | {-# OPTIONS_GHC -fglasgow-exts -fallow-overlapping-instances -fallow-undecidable-instances -fno-monomorphism-restriction #-}
module DPP_Lib where
fix :: (a->a) -> a
fix a = let fixa = a fixa
in fixa
type LayerFn horArgs vertArg horRess vertRes =
horArgs -> vertArg -> (vertRes, horRess)
newty... | null | https://raw.githubusercontent.com/Oblosys/proxima/f154dff2ccb8afe00eeb325d9d06f5e2a5ee7589/papers/Haskell%202008/Haskell/src/DPP_Lib.hs | haskell | # OPTIONS_GHC -fglasgow-exts -fallow-overlapping-instances -fallow-undecidable-instances -fno-monomorphism-restriction #
(a->b) ->
a -> t -> ((f :.: g) ns)
| module DPP_Lib where
fix :: (a->a) -> a
fix a = let fixa = a fixa
in fixa
type LayerFn horArgs vertArg horRess vertRes =
horArgs -> vertArg -> (vertRes, horRess)
newtype Fix f = Fix (f (Fix f))
newtype (:.:) f g ns = Comp (f (g ns))
newtype Step a b ns = Step (a -> (b, ns))
... |
91be29af7d6138f6fc5bd86a6d14ad3b61ae873099e763d9e3c641c64a7eaef3 | cbaggers/varjo | remove-dead-code.lisp | ;; one quick optimization we can add it to have every function specify if they
;; are pure..then any pure form not in the tail position of a progn gets
;; stripped
| null | https://raw.githubusercontent.com/cbaggers/varjo/9e77f30220053155d2ef8870ceba157f75e538d4/protocode/remove-dead-code.lisp | lisp | one quick optimization we can add it to have every function specify if they
are pure..then any pure form not in the tail position of a progn gets
stripped | |
7717fac85949c9eb41b2ea4244da5752b6ead17bdeea76e4d684109594170874 | tweag/pirouette | Internal.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DeriveLift #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE ... | null | https://raw.githubusercontent.com/tweag/pirouette/1bfaa872dc04654ad32e9f8e7e2420ec4fa6de3b/src/Language/Pirouette/QuasiQuoter/Internal.hs | haskell | # LANGUAGE DeriveLift #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
Orphan instances to 'Lift' the necessary types | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - orphans #
module Language.Pirouette.QuasiQuote... |
121ead7a95aa617f816411c112043b334d1f8da3acd88c9e117a0214c03e1e9d | jwaldmann/haskell-obdd | Oops.hs | module Main where
import OBDD
import OBDD.Data
import OBDD.Operation
import Prelude hiding ( (&&) )
manual = make $ do
fls <- checked_register $ Leaf False
tru <- checked_register $ Leaf True
b1 <- checked_register $ Branch 'b' fls tru
checked_register $ Branch 'a' fls b1
constructed = (unit 'a... | null | https://raw.githubusercontent.com/jwaldmann/haskell-obdd/537f710bc3eb6d06370659fd8c79f4da94554aeb/examples/Oops.hs | haskell | module Main where
import OBDD
import OBDD.Data
import OBDD.Operation
import Prelude hiding ( (&&) )
manual = make $ do
fls <- checked_register $ Leaf False
tru <- checked_register $ Leaf True
b1 <- checked_register $ Branch 'b' fls tru
checked_register $ Branch 'a' fls b1
constructed = (unit 'a... | |
9ac3bc59238219cb41a37d9dbb9eeba10864072f57d0fcf6f9c078240ebcb2e2 | GAumala/TranslateJPBot | JMdictEntryTreeSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module Data.JMdictEntryTreeSpec where
import Data.Maybe
import Data.RedBlackTree
import Data.JMdictEntryTree (jmdictEntryTreeFromFile, lookupWord)
import Test.Hspec
import Data.Text (Text)
spec ::Spec
spec =
describe "jmdictEntryTreeFromFile" $
it "returns a tree with an entr... | null | https://raw.githubusercontent.com/GAumala/TranslateJPBot/af008f0f3a2a13079982b8de5966a3903194380d/test/Data/JMdictEntryTreeSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
module Data.JMdictEntryTreeSpec where
import Data.Maybe
import Data.RedBlackTree
import Data.JMdictEntryTree (jmdictEntryTreeFromFile, lookupWord)
import Test.Hspec
import Data.Text (Text)
spec ::Spec
spec =
describe "jmdictEntryTreeFromFile" $
it "returns a tree with an entry for 'かえる'" $ do
tree <- jmd... |
dddd625cc593d37634de4e122f7a4aa135f98511c14e911773e8bd8106f8929b | gelisam/hawk | Base.hs | {-# LANGUAGE PackageImports #-}
-- | Everything we need to know in order to evaluate a user expression,
-- except for the user expression itself.
module System.Console.Hawk.Context.Base
( Context(..)
, getContext
) where
import "mtl" Control.Monad.Trans
import Data.Maybe
import System.Directory
import System.I... | null | https://raw.githubusercontent.com/gelisam/hawk/1775ab1cfea05e20d1b1a8c0a7b0fe6c4af4b7c5/src/System/Console/Hawk/Context/Base.hs | haskell | # LANGUAGE PackageImports #
| Everything we need to know in order to evaluate a user expression,
except for the user expression itself.
| Obtains a Context, either from the cache or from the user prelude.
Must be called inside a `runHawkInterpreter contextDir` block so that the
context folder is initialized. TO... | module System.Console.Hawk.Context.Base
( Context(..)
, getContext
) where
import "mtl" Control.Monad.Trans
import Data.Maybe
import System.Directory
import System.IO
import Control.Monad.Trans.Uncertain
import Control.Monad.Trans.State.Persistent
import Data.Cache
import qualified Data.HaskellModule as M
impor... |
9c1c25bc44a3399c9bd2a650deb2b5c82cec263024e3552a38d17245fbcb2a09 | beoliver/clj-arangodb | core.clj | (ns clj-arangodb.velocypack.core
(:require [clj-arangodb.velocypack.utils :as utils]
[cheshire.core :as json])
(:import [com.arangodb.velocypack
ObjectIterator
ArrayIterator
VPackSlice
ValueType
VPackBuilder
VPackParser$Builder]))
... | null | https://raw.githubusercontent.com/beoliver/clj-arangodb/a6b2c835278573e2fee3521c63917838e86703eb/src/clojure/clj_arangodb/velocypack/core.clj | clojure | a hack - we pretend that we are passing an Object, but pass it nil | (ns clj-arangodb.velocypack.core
(:require [clj-arangodb.velocypack.utils :as utils]
[cheshire.core :as json])
(:import [com.arangodb.velocypack
ObjectIterator
ArrayIterator
VPackSlice
ValueType
VPackBuilder
VPackParser$Builder]))
... |
4237814596cc0d7e5d1f9a38ca8d8069d90a74070d45c4330915eac57b35bb8b | hanshuebner/vlm | clisp-packages.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : COMMON - LISP - USER ; Base : 10 ; Lowercase : Yes -*-
(in-package "COMMON-LISP-USER")
;;; Packages used by the emulator that aren't defined in OpenMCL
( defpackage LISP
;; (:use COMMON-LISP)
;; (:export "AND" "OR"))
(defpackage CLOS
(:use COMMON-LISP)
(:e... | null | https://raw.githubusercontent.com/hanshuebner/vlm/20510ddc98b52252a406012a50a4d3bbd1b75dd0/support/clisp-packages.lisp | lisp | Syntax : Common - Lisp ; Package : COMMON - LISP - USER ; Base : 10 ; Lowercase : Yes -*-
Packages used by the emulator that aren't defined in OpenMCL
(:use COMMON-LISP)
(:export "AND" "OR"))
(:use COMMON-LISP)
(:export "WARN")) | (in-package "COMMON-LISP-USER")
( defpackage LISP
(defpackage CLOS
(:use COMMON-LISP)
(:export "DEFCLASS" "DEFGENERIC" "DEFMETHOD" "INITIALIZE-INSTANCE" "WITH-SLOTS"
"PRINT-OBJECT" "SLOT-VALUE" "MAKE-INSTANCE"))
(defpackage FUTURE-COMMON-LISP
(:use COMMON-LISP)
(:export "PRINT-UNREADABLE-OBJECT"))
( de... |
b85c755c71a238a5a8cc4df2d60fd35af6746cf6c251de64bbecdb359dcb4f12 | kana/sicp | ex-3.17.scm | Exercise 3.17 . Devise a correct version of the ` count - pairs ` procedure of
exercise 3.16 that returns the number of distinct pairs in any structure .
;;; (Hint: Traverse the structure, maintaining an auxiliary data structure that
;;; is used to keep track of which pairs have already been counted.)
(define (w... | null | https://raw.githubusercontent.com/kana/sicp/912bda4276995492ffc2ec971618316701e196f6/ex-3.17.scm | scheme | (Hint: Traverse the structure, maintaining an auxiliary data structure that
is used to keep track of which pairs have already been counted.)
With set!.
Without set!. | Exercise 3.17 . Devise a correct version of the ` count - pairs ` procedure of
exercise 3.16 that returns the number of distinct pairs in any structure .
(define (wrong-count-pairs x)
(if (not (pair? x))
0
(+ (wrong-count-pairs (car x))
(wrong-count-pairs (cdr x))
1)))
(define (c... |
88f917c5cec4c805c2a9ad828927d5bcdcc32c09d6f87c393739a1ca01cd56ea | kupl/FixML | infinite.ml | open Lang
open Util
(*****************************************************
Detect the infinite program.
If the given program has infinite loop, return true
*****************************************************)
module Static = struct
let name_of_func : let_bind -> id
= fun f ->
match f with
| BindOne f -> f... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/engine/infinite.ml | ocaml | ****************************************************
Detect the infinite program.
If the given program has infinite loop, return true
****************************************************
up to here | open Lang
open Util
module Static = struct
let name_of_func : let_bind -> id
= fun f ->
match f with
| BindOne f -> f
| _ -> raise (Failure "Only variables are allowed as left-hand side of `let rec'")
let rec is_arg : id -> arg -> bool
= fun f arg ->
match arg with
| ArgOne (x, _) when x = f -> true
... |
9da5516a450b74777f3f520571b7458cd02e1f17c6eef4ed15c0e84b38c93c1c | egonSchiele/dominion | Dominion.hs | module Dominion (
-- | How to use: https:\/\/github.com\/egonschiele\/dominion
module Dominion,
Option(..),
has, handValue, pileEmpty, getPlayer, cardsOf, validateBuy, validatePlay, getRound, countNum) where
import Prelude hiding ... | null | https://raw.githubusercontent.com/egonSchiele/dominion/a4b7300f2e445da5e7cfcc1cf9029243a3561ed6/src/Dominion.hs | haskell | | How to use: https:\/\/github.com\/egonschiele\/dominion
@ (name, strategy) @
| The main method to simulate a dominion game. Example:
>
| Same as `dominion`, but allows you to pass in some options. Example:
| Player buys a card. Example:
> playerId `buys` smithy
this works because extraMoney can be negative... | module Dominion (
module Dominion,
Option(..),
has, handValue, pileEmpty, getPlayer, cardsOf, validateBuy, validatePlay, getRound, countNum) where
import Prelude hiding (log)
import qualified Data.Map.Lazy as M
import qualified Dominion.... |
bbc966eeb5812e2c1bb5e32ac2ec69d7a85ad1b4cffad0bfac4197cfc14c4b38 | ryanpbrewster/haskell | parsec_example_4.hs | -- parsec_example_4.hs
{-
- Simple calculator
-}
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Language
import qualified Text.ParserCombinators.Parsec.Token as Token
import Control.Monad
data Expr = Const (Either Integer Double)
| Neg ... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/parsec/parsec_example_4.hs | haskell | parsec_example_4.hs
- Simple calculator
|
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Language
import qualified Text.ParserCombinators.Parsec.Token as Token
import Control.Monad
data Expr = Const (Either Integer Double)
| Neg Expr
| Plus Expr Expr
| Minus E... |
6cb0efbd95d52689b6f4595cbebe3b7bb1d10b633ee218aa862cf3afdc563061 | archaelus/erms | healthcheck_simulator.erl | %%%-------------------------------------------------------------------
@copyright Catalyst IT Ltd ( )
%%%
@author nt < >
%% @version {@vsn}, {@date} {@time}
%% @doc
%% @end
%%%-------------------------------------------------------------------
-module(healthcheck_simulator).
-include_lib("logging.hrl").
-inclu... | null | https://raw.githubusercontent.com/archaelus/erms/5dbe5e79516a16e461e7a2a345dd80fbf92ef6fa/src/healthcheck_simulator.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
@doc
@end
------------------------------------------------------------------- | @copyright Catalyst IT Ltd ( )
@author nt < >
-module(healthcheck_simulator).
-include_lib("logging.hrl").
-include_lib("mnesia_model.hrl").
-export([start_link/2, start_link/3, init/1, loop/1]).
start_link(Host, Port) ->
start_link(Host, Port, timer:seconds(5)).
start_link(Host, Port, CheckMS) ->
pro... |
88c5d37aee308adc924a21efff8f605c203494bbee4cda1eb2bcdd811c35419d | zero-one-group/geni | main.clj | (ns zero-one.geni.main
(:require
[clojure.java.io]
[clojure.pprint]
[zero-one.geni.core :as g]
[zero-one.geni.defaults]
[zero-one.geni.repl :as repl])
(:gen-class))
Removes the pesky ns warning that takes up the first line of the REPL .
(require '[net.cgrand.parsley.fold])
(def spark
"The defau... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/src/clojure/zero_one/geni/main.clj | clojure | :members
(mapv :name)
sort | (ns zero-one.geni.main
(:require
[clojure.java.io]
[clojure.pprint]
[zero-one.geni.core :as g]
[zero-one.geni.defaults]
[zero-one.geni.repl :as repl])
(:gen-class))
Removes the pesky ns warning that takes up the first line of the REPL .
(require '[net.cgrand.parsley.fold])
(def spark
"The defau... |
e7e04ef2f46747c1de1a7e66ec2df95cc190e3e3b538f8adf2253411e5b051ff | fetburner/Coq2SML | smartlocate.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/interp/smartlocate.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* [locate_global_with_alias] locates... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Util
open Names
open Lib... |
ed0c5dfd5a6603c04e9e51cd1c00e21735a33579720f5fed1a4f7a9fa4239024 | mbutterick/typesetting | test13.rkt | #lang racket/base
(require pitfall/pdftest)
(define-runtime-path charter-path "assets/charter.ttf")
(define (proc doc)
;; Register a font name for use later
(register-font doc "Charter" (path->string charter-path))
;; Set the font, draw some text
[font doc "Charter"]
[font-size doc 25]
[text doc "Åcçénts... | null | https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/pitfall/ptest/test13.rkt | racket | Register a font name for use later
Set the font, draw some text
test against non-subsetted font version | #lang racket/base
(require pitfall/pdftest)
(define-runtime-path charter-path "assets/charter.ttf")
(define (proc doc)
(register-font doc "Charter" (path->string charter-path))
[font doc "Charter"]
[font-size doc 25]
[text doc "Åcçénts äre în" 100 100])
(define-runtime-path this "test13rkt.pdf")
(make-doc t... |
af913218d65fc679d58cea1036268677bcfc946985ce04a462955fffa7c6a245 | fmi-lab/fp-elective-2017 | append.scm | (require rackunit rackunit/text-ui)
(define (append l1 l2)
(if (null? l1)
l2
(cons (car l1)
(append (cdr l1) l2))))
(define append-tests
(test-suite
"Tests for append"
(check-equal? (append '() '()) '())
(check-equal? (append '() '(42)) '(42))
(check-equal? (append '(42) '... | null | https://raw.githubusercontent.com/fmi-lab/fp-elective-2017/e88d5c0319b6d03c0ecd8a12a2856fb1bf5dcbf3/exercises/04/append.scm | scheme | (require rackunit rackunit/text-ui)
(define (append l1 l2)
(if (null? l1)
l2
(cons (car l1)
(append (cdr l1) l2))))
(define append-tests
(test-suite
"Tests for append"
(check-equal? (append '() '()) '())
(check-equal? (append '() '(42)) '(42))
(check-equal? (append '(42) '... | |
694b2730026406b4978b47019b3b4b0ca177f7b523464b37dfb0afdb44dd86e0 | obsidiansystems/rhyolite | App.hs | {-|
Description:
'Query' helpers
Miscellaneous utilities related to the 'Query' datatype, and the definition of
'Single', a view for a single piece of data.
-}
{-# Language DeriveFoldable #-}
{-# Language DeriveGeneric #-}
{-# Language DeriveTraversable #-}
{-# Language FlexibleContexts #-}
# Language GeneralizedNew... | null | https://raw.githubusercontent.com/obsidiansystems/rhyolite/43b4b040d3a370c6ec114b7b6001ddb9f8d42ce8/common/Rhyolite/App.hs | haskell | |
Description:
'Query' helpers
Miscellaneous utilities related to the 'Query' datatype, and the definition of
'Single', a view for a single piece of data.
# Language DeriveFoldable #
# Language DeriveGeneric #
# Language DeriveTraversable #
# Language FlexibleContexts #
# Language PatternGuards #
# Language PolyKin... | # Language GeneralizedNewtypeDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Rhyolite.App where
import Data.Aeson (FromJSON, ToJSON)
import Data.Align
import qualified Data.AppendMap as MonoidalMap
import Data.Constraint.Extras
import qualified Data.Dependent.Map as DMap'
import qualified Data.Dependent.Map.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.