_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 |
|---|---|---|---|---|---|---|---|---|
d70cbb07d3de13cc62533f400837296f8d9ebc6f63472ed8a13d8c0bda397a84 | brightin/pottery | scan_test.clj | (ns pottery.scan-test
(:require [pottery.scan :as sut]
[clojure.test :refer [deftest testing is are]]))
(deftest extract-test
(testing "Default extractor"
(are [expr result] (= result (::sut/value (sut/extract sut/default-extractor expr)))
'(tr "Hello") "Hello"
'(tr "Hello %s" arg1) "He... | null | https://raw.githubusercontent.com/brightin/pottery/33dd155105873e307c6730d6f718d99c60a6d63e/test/pottery/scan_test.clj | clojure | (ns pottery.scan-test
(:require [pottery.scan :as sut]
[clojure.test :refer [deftest testing is are]]))
(deftest extract-test
(testing "Default extractor"
(are [expr result] (= result (::sut/value (sut/extract sut/default-extractor expr)))
'(tr "Hello") "Hello"
'(tr "Hello %s" arg1) "He... | |
a69edf97ab723887df38fefed39231665b4f69fd6bc467a1e0800ccec41de9c1 | kframework/semantic-approaches | Programs.hs | module Programs (programs) where
empty = "int ; skip"
skipSeqComp = "int x; skip ; skip"
assignment = "int x; x = 2"
assignmentSeqComp = "int x, y; x = 2 + 4 ; y = 2 + 3"
ifPgm = "int x; if ( x <= 0 ) { x = 1 } else { }"
whilePgm = "int x, y; while (x <= 2) { skip ; y = 2 ; x = x + 1 }"
... | null | https://raw.githubusercontent.com/kframework/semantic-approaches/6f64eac09e005fe4eae7141e3c0e0f5711da0647/haskell/imp/1-imp-increment/1-imp-bigstep/Programs.hs | haskell | module Programs (programs) where
empty = "int ; skip"
skipSeqComp = "int x; skip ; skip"
assignment = "int x; x = 2"
assignmentSeqComp = "int x, y; x = 2 + 4 ; y = 2 + 3"
ifPgm = "int x; if ( x <= 0 ) { x = 1 } else { }"
whilePgm = "int x, y; while (x <= 2) { skip ; y = 2 ; x = x + 1 }"
... | |
422bbef4a31444fd3a5b63d5b4ad4a095f27436357456430825cead7472883bf | copton/haskell-examples | Foo.hs | #!/usr/bin/runhaskell
# LANGUAGE TemplateHaskell #
module Foo where
import Bar
import Language.Haskell.TH
main = putStrLn $ show $(version)
| null | https://raw.githubusercontent.com/copton/haskell-examples/27c297848ca0f77aa152ab815d1aacd1e01d0830/template_haskell/git-version/Foo.hs | haskell | #!/usr/bin/runhaskell
# LANGUAGE TemplateHaskell #
module Foo where
import Bar
import Language.Haskell.TH
main = putStrLn $ show $(version)
| |
500c79118a76574830c71d20bd8ae7bf7dcc39e3e0e42a891d1ae207ab8c5571 | ucsd-progsys/liquidhaskell | Token.hs | # LANGUAGE TupleSections #
-----------------------------------------------------------------------------
-- |
Module : Language . Stitch .
Copyright : ( C ) 2015
-- License : BSD-style (see LICENSE)
Maintainer : ( )
-- Stability : experimental
--
-- Defines a lexical token
--
-----... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/benchmarks/stitch-lh/src/Language/Stitch/LH/Token.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see LICENSE)
Stability : experimental
Defines a lexical token
--------------------------------------------------------------------------
* Tokens
| A lexed token
| Perhaps extract a 'ArithOp'
| Perhaps e... | # LANGUAGE TupleSections #
Module : Language . Stitch .
Copyright : ( C ) 2015
Maintainer : ( )
module Language.Stitch.LH.Token (
Token(..), LToken(..), noLoc, unLoc, unArithOp, unInt, unBool, unName
) where
import Language.Stitch.LH.Util
import Language.Stitch.LH.Op
import Text.Pre... |
82c92f2bc4d7de3b5f090080b47ee7bc087b2144769f52427bdfd95cad7b0b84 | squaresLab/genprog-code | elfrep.ml |
*
* Copyright ( c ) 2012 - 2018 ,
* < >
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are ... | null | https://raw.githubusercontent.com/squaresLab/genprog-code/7982415b347529efee02190ab9ba6bd7eda6195e/src/elfrep.ml | ocaml | * [Elfrep] provides a representation for binary elf (compiled and linked)
executables. Like [Asmrep], this mostly extends the [Stringrep.stringRep]
functionality (since we represent ELF files as lists of strings), with the
notable exception of the use of oprofile sampling for localization and the
use o... |
*
* Copyright ( c ) 2012 - 2018 ,
* < >
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are ... |
6b08310e3bd2ca3d12bcc11b1dc92fc38bca4f6a75ae66f81a66ea4e7db217e9 | ds-wizard/engine-backend | DocumentTemplateSuggestionSM.hs | module Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionSM where
import Data.Swagger
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateFormatSM ()
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionDTO
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionJM ... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-shared/src/Shared/Api/Resource/DocumentTemplate/DocumentTemplateSuggestionSM.hs | haskell | module Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionSM where
import Data.Swagger
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateFormatSM ()
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionDTO
import Shared.Api.Resource.DocumentTemplate.DocumentTemplateSuggestionJM ... | |
bb71ec769e4de8be07c80488fe5453cfa8a460eb7052e6c0c8b9aa3907b95302 | Opetushallitus/aipal | kyselypohja.clj | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
;;
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
of the EUPL ( the " Licence " ) ;
;;
;; You may not use this work except... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/aipal/src/clj/aipal/rest_api/kyselypohja.clj | clojure |
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: /
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 | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
European Union Public Licence for more details .
(ns aipal.rest-api.kysely... |
12a6dbf60af52805bee4fb3d0b11447975f3ad8dfaa44c1a8def3dc3eed444ed | vouillon/osm | util.mli | OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... | null | https://raw.githubusercontent.com/vouillon/osm/5b06ed6fc6c508b8187209628cf02129a119b50a/generic/util.mli | ocaml | Make sure that the directory containing the file given in argument
exists.
val trim : string -> string
| OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... |
6390ef2495bd6fce33463c52af276391e5496b34e8c9aa1cbc6a6e9adc5ccd8a | antoniogarrote/clj-control | applicative.clj | (ns clj-control.applicative
(:use [clj-control.functor]
[clj-control.utils]))
(defprotocol Applicative
"class Pointed f => Applicative f where
(af-*) :: f (a -> b) -> f a -> f b
laws:
pure id <*> v = v -- Identity
pure (.) <*> u <*> v <*> w = u <*> (v <*> w) -... | null | https://raw.githubusercontent.com/antoniogarrote/clj-control/175ab9f3d0157355b082b3f68472b507261eb941/src/clj_control/applicative.clj | clojure | (ns clj-control.applicative
(:use [clj-control.functor]
[clj-control.utils]))
(defprotocol Applicative
"class Pointed f => Applicative f where
(af-*) :: f (a -> b) -> f a -> f b
laws:
pure id <*> v = v -- Identity
pure (.) <*> u <*> v <*> w = u <*> (v <*> w) -... | |
2d2695a050fd35bcdc5b9587afc43cad4cbd0db4bf63f2b7642368da2bcf62cf | ypyf/fscm | cps.scm | (define-syntax let/cc
(syntax-rules ()
((let/cc k body) (call/cc (lambda (k) body)))))
(+ 1 (let/cc x (+ (lambda () "hell") (x 12))))
;
( ( ( factorial
; (lambda (n)
; (if (> n 0)
; (* n (factorial (- n 1)))
1 ) ) ) )
( factorial 3 ) )
(define (f x) (lamb... | null | https://raw.githubusercontent.com/ypyf/fscm/4e6a31665051d51bbcfc823ac8d85dcc3491a6ef/test/cps.scm | scheme |
(lambda (n)
(if (> n 0)
(* n (factorial (- n 1)))
call/cc用于大规模退出(non-local escapes)
创建当前延续体
回溯
(display (list x y z))
(newline)
(display "迭代次数: ")
(display n)
(lambda (x y z)
(let ((f (lambda (a b)
(+ (* a x) (* b y)))))
f))
延续作为generator/coroutine
(looper)
... | (define-syntax let/cc
(syntax-rules ()
((let/cc k body) (call/cc (lambda (k) body)))))
(+ 1 (let/cc x (+ (lambda () "hell") (x 12))))
( ( ( factorial
1 ) ) ) )
( factorial 3 ) )
(define (f x) (lambda (a) (+ x a)))
(define (g y) (+ y y))
(let ((fx (f 2)))
(let ((gy (g 2)))
(fx gy)))
... |
6949c463bbd3556106fe63f4af32d1c4b5791760ccf71080e14f1e21a4ef776e | chenyukang/eopl | let-lang.scm | ;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
symbol)
(number (digit (arbno digit)) number)
(number ("-" digit (a... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch6/base/let-lang.scm | scheme | grammatical specification ;;;;;;;;;;;;;;;;
sllgen boilerplate ;;;;;;;;;;;;;;;; |
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
symbol)
(number (digit (arbno digit)) number)
(number ("-" digit (arbno digit)) number)
))
(define the-grammar
'((program ... |
918dfcc8e4674fe13b17d9198f0e2a8138b485b3012fd673aefaa66907080a16 | EasyCrypt/easycrypt | XDG.mli | (* -------------------------------------------------------------------- *)
type path = string
type xdgroots = {
xdg_data_home : path;
xdg_config_home : path;
xdg_cache_home : path;
xdg_data_dirs : path list;
xdg_config_dirs : path list;
}
val xdgroots : xdgroots
exception XdgUndefined of string
(* --... | null | https://raw.githubusercontent.com/EasyCrypt/easycrypt/f87695472e70c313ef2966e20979b1afcc2e543e/src/system/XDG.mli | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-----------------------------------... | type path = string
type xdgroots = {
xdg_data_home : path;
xdg_config_home : path;
xdg_cache_home : path;
xdg_data_dirs : path list;
xdg_config_dirs : path list;
}
val xdgroots : xdgroots
exception XdgUndefined of string
val home : string
type mode = [`User | `System | `All]
type xdgfile =
?ro... |
46141670383b2714ff433e2d30aba410d25a9392288c9d5891613dd2359dc61e | 2600hz/kazoo | kzd_callflows_tests.erl | %%%-----------------------------------------------------------------------------
( C ) 2011 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_documents/test/kzd_callflows_tests.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
----------------------------------------------------------------------------- | ( C ) 2011 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kzd_callflows_tests).
-include_lib("eunit/include/eunit.hrl").
-include("kz_documents.hrl").
-define(FL... |
2d212d5bc7fac4ce0d7a019746286045f0b4d9e4d3a96f28835a77a6a3134c54 | ekmett/comonad | Identity.hs | {-# LANGUAGE Safe #-}
-- |
Copyright : ( C ) 2008 - 2014
-- License : BSD-style (see the file LICENSE)
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable (fundeps, MPTCs)
module Control.Comonad.Identity
( module Data.Functor.Identity
, module Control.Comonad.Trans.Id... | null | https://raw.githubusercontent.com/ekmett/comonad/a56373d8981cee27cb3f07ca144565f4164047e1/src/Control/Comonad/Identity.hs | haskell | # LANGUAGE Safe #
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable (fundeps, MPTCs) |
Copyright : ( C ) 2008 - 2014
Maintainer : < >
module Control.Comonad.Identity
( module Data.Functor.Identity
, module Control.Comonad.Trans.Identity
) where
import Data.Functor.Identity
import Control.Comonad.Trans.Identity
|
0939d425d35b64f16f627208b2120badd703880f601e6f7b60fd030b79190981 | moleike/taiwan-aqi-bot | Spec.hs | # LANGUAGE QuasiQuotes #
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Lib (app)
import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
main :: IO ()
main = hspec spec
spec :: Spec
spec = with (return app) $ do
describe "GET /users" $ do
it "responds with 200" $ do
... | null | https://raw.githubusercontent.com/moleike/taiwan-aqi-bot/803e93d3175955b099fbe4cb0417def8e40facf6/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE QuasiQuotes #
module Main (main) where
import Lib (app)
import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
main :: IO ()
main = hspec spec
spec :: Spec
spec = with (return app) $ do
describe "GET /users" $ do
it "responds with 200" $ do
get "/users" `shouldRespondWi... |
2461264d92e72623034419917fe89847054c2b4a1a81aa740b462f9603f2f2b1 | clojure-emacs/cider-nrepl | nrepl.clj | (ns cider.nrepl
"Middleware descriptors and related utility functions.
While normally middleware descriptors live alongside middleware
definitions, cider-nrepl separates those. The rationale behind this
is to avoid loading each middleware definition until its first usage.
For this purpose we're defining each... | null | https://raw.githubusercontent.com/clojure-emacs/cider-nrepl/b885905b7f9938acf075c0417d71f83ae7306c09/src/cider/nrepl.clj | clojure | we load this namespace, so it's directly available to clients
Functionality for deferred middleware loading
cider-nrepl depends on many libraries and loading all middleware at
startup time causes significant delays. That's why we've developed
a simple approach to delay loading the actual definition of a middlewar... | (ns cider.nrepl
"Middleware descriptors and related utility functions.
While normally middleware descriptors live alongside middleware
definitions, cider-nrepl separates those. The rationale behind this
is to avoid loading each middleware definition until its first usage.
For this purpose we're defining each... |
d2e7919beda9a0613c6cee2ab94e64139b2638cb2eb465a81d1da3f57b946fba | mejgun/haskell-tdlib | ClearImportedContacts.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.ClearImportedContacts where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Clears all imported contacts, contact list remains unchanged
data ClearImportedContacts = ClearImportedContacts
{
}
der... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/ClearImportedContacts.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Clears all imported contacts, contact list remains unchanged |
module TD.Query.ClearImportedContacts where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data ClearImportedContacts = ClearImportedContacts
{
}
deriving (Eq)
instance Show ClearImportedContacts where
show ClearImportedContacts =
"ClearImportedContac... |
28cb21f92a71a5bc27c4f455a4861dc868d86fefc73d1fab2881a882ab90bfa7 | cubicle-model-checker/cubicle | exception.mli | (**************************************************************************)
(* *)
Cubicle
(* *)
... | null | https://raw.githubusercontent.com/cubicle-model-checker/cubicle/00f09bb2d4bb496549775e770d7ada08bc1e4866/smt/exception.mli | ocaml | ************************************************************************
... | Cubicle
Copyright ( C ) 2011 - 2014
and
Universite Paris - Sud 11
This file is distributed under the terms ... |
0babcf8eaae31e3e3e89d2211c2cfb9372e0d2ff5ceb113b198c9828f326dc84 | dtgoitia/civil-autolisp | KtfLevelBlocks.lsp | (defun c:xx ()
; Trigger
(defun *error* ( errorMessage ) (princ (strcat "n-------- ERROR: " errorMessage " --------n")) (vl-bt) (DT:ReportError))
(DT:AutoLoadFileFromCivilTemp "ErrorTracing.lsp")
(DT:AutoLoadFileFromCivilTemp "KtfLevelBlocks.lsp")
(c:UpdateKtfZToAtt)
v0.0 - 2017.08.30 - First issue
Autho... | null | https://raw.githubusercontent.com/dtgoitia/civil-autolisp/72d68139d372c84014d160f8e4918f062356349f/Dump%20folder/KtfLevelBlocks.lsp | lisp | Trigger
END if
END foreach
END if
Get object
Get attribute value
END if
END progn
END if | (defun c:xx ()
(defun *error* ( errorMessage ) (princ (strcat "n-------- ERROR: " errorMessage " --------n")) (vl-bt) (DT:ReportError))
(DT:AutoLoadFileFromCivilTemp "ErrorTracing.lsp")
(DT:AutoLoadFileFromCivilTemp "KtfLevelBlocks.lsp")
(c:UpdateKtfZToAtt)
v0.0 - 2017.08.30 - First issue
Author :
Last... |
922c5f5c9e02b6a53b82a512d12f0ce67503212ef193962bddd0717323b16f31 | let-def/lrgrep | tablerepr.ml | type lr1 = int
type clause = int
type var = int
type register = clause * var
type arities = int array
module Code : sig
type bytecode =
| Var of int * int
| Goto of int
| Accept of int
| Match of int
| Halt
type emitter
val make : unit -> emitter
val position : emitter -> int
val emit ... | null | https://raw.githubusercontent.com/let-def/lrgrep/c585518fc153e7407edc7b0b85224012e70989e2/support/tablerepr.ml | ocaml | type lr1 = int
type clause = int
type var = int
type register = clause * var
type arities = int array
module Code : sig
type bytecode =
| Var of int * int
| Goto of int
| Accept of int
| Match of int
| Halt
type emitter
val make : unit -> emitter
val position : emitter -> int
val emit ... | |
fddecd91a2c32deb2e4de4f1d3012e80b53e0b57404f44be82f009635848894d | synduce/Synduce | interval_intersection.ml |
let f0 a b = (false, a, b)
let f1 c x (y0, y1, y2) = ((y2 ≥ c) && (y0 || (x ≥ y1)), c, x)
let rec target =
function Elt(a, b) -> f0 a b | Cons(a, b, l) -> f1 a b (target l)
| null | https://raw.githubusercontent.com/synduce/Synduce/289888afb1c312adfd631ce8d90df2134de827b8/extras/solutions/constraints/sortedlist/interval_intersection.ml | ocaml |
let f0 a b = (false, a, b)
let f1 c x (y0, y1, y2) = ((y2 ≥ c) && (y0 || (x ≥ y1)), c, x)
let rec target =
function Elt(a, b) -> f0 a b | Cons(a, b, l) -> f1 a b (target l)
| |
adffb360d0d01590067ceccd4236bfbd3aa6b7e1554c2bd368477018de150729 | GaloisInc/daedalus | Machine.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplic... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/cd9b0288bace37190e489ffcaf5c4924162bf90b/talos/src/Machine.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
| Bind ( Parser a ) ( Fun a K.Grammar )
| Then ( Parser a ) ( Parser a )
-- | Choose
-- | Fail
-- | Guard
| Bindings for polymorphic type argumens
TODO:
- is store needed?
- Add choose, match bytes
^ How to interpret effects
TCSetComplement e -> _
TCSetUnion es -> _
... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeF... |
1c66986fe6a54b83255bd9eaf0351eaea4da63c6b59daed4f066e894229deedc | cdepillabout/servant-static-th | Internal.hs |
module Servant.Static.TH.Internal
( module Servant.Static.TH.Internal.Api
, module Servant.Static.TH.Internal.FileTree
, module Servant.Static.TH.Internal.Mime
, module Servant.Static.TH.Internal.Server
, module Servant.Static.TH.Internal.Util
) where
import Servant.Static.TH.Internal.Api
import Servant.S... | null | https://raw.githubusercontent.com/cdepillabout/servant-static-th/5ec0027ed2faa6f8c42a2259a963f52e6b30edad/src/Servant/Static/TH/Internal.hs | haskell |
module Servant.Static.TH.Internal
( module Servant.Static.TH.Internal.Api
, module Servant.Static.TH.Internal.FileTree
, module Servant.Static.TH.Internal.Mime
, module Servant.Static.TH.Internal.Server
, module Servant.Static.TH.Internal.Util
) where
import Servant.Static.TH.Internal.Api
import Servant.S... | |
958c5401c32af943608d5c2dfb530965c695305581bc6a308c18ad79cba6fa81 | dharmatech/surfage | and-let.sps | Copyright ( c ) 2009 . All rights reserved . Licensed under an
MIT - style license . My license is in the file named LICENSE from the original
;; collection this file is distributed with. If this file is redistributed with
;; some other collection, my license must also be included.
#!r6rs
(import
(rnrs... | null | https://raw.githubusercontent.com/dharmatech/surfage/895f16af83d9ce3c190f69626c9baba8c44d76bc/tests/and-let.sps | scheme | collection this file is distributed with. If this file is redistributed with
some other collection, my license must also be included.
Taken straight from the reference implementation tests
This next one is from the reference implementation tests
but I can't see how it "must be a syntax-error".
(must-be-a-syntax-e... | Copyright ( c ) 2009 . All rights reserved . Licensed under an
MIT - style license . My license is in the file named LICENSE from the original
#!r6rs
(import
(rnrs)
(rnrs eval)
(surfage s2 and-let)
(surfage s78 lightweight-testing))
(define-syntax expect
(syntax-rules ()
[(_ expr result)
... |
91fe5d287cfb40a8a5140dd41d96ef6f646aa0ea92298193ab7d358ad9a02b75 | irastypain/sicp-on-language-racket | lists.rkt | #lang racket
Процедура получения n - ного элемента списка
(define (list-ref items n)
(if (= n 0)
(car items)
(list-ref (cdr items) (- n 1))))
Процедура вычисления длины списка
( )
(define (length items)
(define (length-iter a count)
(if (null? a)
count
(length-iter (cdr a) ... | null | https://raw.githubusercontent.com/irastypain/sicp-on-language-racket/0052f91d3c2432a00e7e15310f416cb77eeb4c9c/src/lib/lists.rkt | racket | некоторой операции к последовательности
Процедура генерации последовательности целых чисел
Процедура отображения переданной функции | #lang racket
Процедура получения n - ного элемента списка
(define (list-ref items n)
(if (= n 0)
(car items)
(list-ref (cdr items) (- n 1))))
Процедура вычисления длины списка
( )
(define (length items)
(define (length-iter a count)
(if (null? a)
count
(length-iter (cdr a) ... |
c3822e3c6dffbcc9ab63ead4fce7e500402c3992720a808d583b7e821f58d77a | Clojure2D/clojure2d-examples | simple_harmonic_motion_3_6.clj | (ns NOC.ch03.simple-harmonic-motion-3-6
(:require [clojure2d.core :refer :all]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(def ^:const ^int w 640)
(def ^:const ^int h 360)
(def ^:const ^double aVelocity 0.03)
(def ^:const ^double amplitude 300)
(def... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/9de82f5ac0737b7e78e07a17cf03ac577d973817/src/NOC/ch03/simple_harmonic_motion_3_6.clj | clojure | (ns NOC.ch03.simple-harmonic-motion-3-6
(:require [clojure2d.core :refer :all]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(def ^:const ^int w 640)
(def ^:const ^int h 360)
(def ^:const ^double aVelocity 0.03)
(def ^:const ^double amplitude 300)
(def... | |
3c6362f597ca611052dc572abc09e39b1ea57927e571bc8e0b943c52a5c7d624 | onyx-platform/onyx | collect_by_key_test.clj | (ns onyx.windowing.collect-by-key-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is]]
[taoensso.timbre :refer [info error warn trace fatal] :as timbre]
[onyx.static.uuid :refer [random-uuid]]
[onyx.plugin.co... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/test/onyx/windowing/collect_by_key_test.clj | clojure | (ns onyx.windowing.collect-by-key-test
(:require [clojure.core.async :refer [chan >!! <!! close! sliding-buffer]]
[clojure.test :refer [deftest is]]
[taoensso.timbre :refer [info error warn trace fatal] :as timbre]
[onyx.static.uuid :refer [random-uuid]]
[onyx.plugin.co... | |
b2ba43e9b5339fd2ee4cab5a56293b3061cb0aaec6d02c00bfbd894c548c657e | metosin/tilakone | util_test.clj | (ns tilakone.util-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[tilakone.util :as u]))
; can't require tilakone.core, that would be circular dependency:
(def _ :tilakone.core/_)
;;
Generic utils :
;;
(def find-first #'u/find-first)
(deftest find-first-test
(f... | null | https://raw.githubusercontent.com/metosin/tilakone/a6dd133557dbb5d64d9f4ef87e2ab073b3d86761/modules/core/test/tilakone/util_test.clj | clojure | can't require tilakone.core, that would be circular dependency:
Test process:
Guards:
Transitions:
Actions:
| (ns tilakone.util-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[tilakone.util :as u]))
(def _ :tilakone.core/_)
Generic utils :
(def find-first #'u/find-first)
(deftest find-first-test
(fact
(find-first some? [nil 42 nil]) => 42)
(fact
(find-first s... |
c6eb14e0db256d07d35e682f8f3a4f6b306f0378e875c4775b3fcc01f54bc7fb | nd/lein-teamcity | project.clj | (defproject syntax-error "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]]
:plugins [[lein-teamcity "0.2.1"]]
:monkeypatch-clojure-test false)
| null | https://raw.githubusercontent.com/nd/lein-teamcity/9bce8a875c0f1c2060362d33a214c5dd72530b03/test-projects/syntax-error/project.clj | clojure | (defproject syntax-error "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]]
:plugins [[lein-teamcity "0.2.1"]]
:monkeypatch-clojure-test false)
| |
b0060cd32afe32fee183040223b7845b010a83ac5d0ded10504d76582837129c | grin-compiler/ghc-wpc-sample-programs | Irrelevance.hs | # LANGUAGE UndecidableInstances #
# LANGUAGE NondecreasingIndentation #
| Compile - time irrelevance .
In type theory with compile - time irrelevance à ( LiCS 2001 ) ,
variables in the context are annotated with relevance attributes .
@@
Γ = r₁x₁:A₁ , ... , rⱼxⱼ:Aⱼ
@@
To handle irrelevant projections ... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/Agda-2.6.1/src/full/Agda/TypeChecking/Irrelevance.hs | haskell | ------------------
-------------------------------------------------------
---------------------------
----------------------------
------------
---------------------------
-----------------------------------------------
------------------
-------------------------------------------------------
-----------------... | # LANGUAGE UndecidableInstances #
# LANGUAGE NondecreasingIndentation #
| Compile - time irrelevance .
In type theory with compile - time irrelevance à ( LiCS 2001 ) ,
variables in the context are annotated with relevance attributes .
@@
Γ = r₁x₁:A₁ , ... , rⱼxⱼ:Aⱼ
@@
To handle irrelevant projections ... |
48c61355b6c2c4395dfcb183c1ea9b546048d82d363ffcc5644a15e6c6a1812c | stuart/Erlang-Credit-Card-Validation | credit_card_validation_server.erl | -module (credit_card_validation_server).
-export([start/0, validate/3]).
-author({author, "Stuart Coyle",""}).
start() ->
inets:start(),
inets:start(httpd, [{proplist_file, "config/server_config.erl"}]),
io:format("Credit card validation server started.").
validate(SessID, Env, _Input) ->
N = dict:fetch(que... | null | https://raw.githubusercontent.com/stuart/Erlang-Credit-Card-Validation/0676c8fd7c14f8a24e4078726d88896dabd2e94e/src/credit_card_validation_server.erl | erlang | -module (credit_card_validation_server).
-export([start/0, validate/3]).
-author({author, "Stuart Coyle",""}).
start() ->
inets:start(),
inets:start(httpd, [{proplist_file, "config/server_config.erl"}]),
io:format("Credit card validation server started.").
validate(SessID, Env, _Input) ->
N = dict:fetch(que... | |
ff5d1c59da6b00f451eaf023e29c3d451ba7e2800b4ab96a81abcf8fbd1c5ac9 | jayrbolton/coursework | Lab8.hs | J Bolton
Lab 8
10.2
{-
id . f
Bool -> Bool
f . id
a -> a
id f
(Int -> Bool) -> (Int -> Bool)
-}
10.3
composeList :: [a -> a] -> a -> a
composeList (f:[]) = f
composeList (f:fs) = composeList fs . f
10.4
iter 3 double 1
double . double . double 1
double . double 2
double . 4
8
( comp2 succ ( * ) ) 3 ... | null | https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computer_science_foundations/programming/Q1/lab/lab8/Lab8.hs | haskell |
id . f
Bool -> Bool
f . id
a -> a
id f
(Int -> Bool) -> (Int -> Bool)
| J Bolton
Lab 8
10.2
10.3
composeList :: [a -> a] -> a -> a
composeList (f:[]) = f
composeList (f:fs) = composeList fs . f
10.4
iter 3 double 1
double . double . double 1
double . double 2
double . 4
8
( comp2 succ ( * ) ) 3 4
( * ) ( succ 3 ) ( succ 4 )
( * ) 4 5
20
iter 3 double 1
double . dou... |
7a40379c07a26a5ab11fdb2c5bc6fa5af3252d44e73e3d899f11656b63c6fce6 | higherkindness/mu-haskell | Server.hs | # language DataKinds #
# language FlexibleContexts #
# language GADTs #
{-# language OverloadedLists #-}
# language OverloadedStrings #
# language RankNTypes #
{-# language ScopedTypeVariables #-}
# language TypeApplications #
|
Description : Execute a Mu ' Server ' ... | null | https://raw.githubusercontent.com/higherkindness/mu-haskell/df7d1c8409deb04c9d3ecc01100eba1abd73c1e6/graphql/src/Mu/GraphQL/Server.hs | haskell | # language OverloadedLists #
# language ScopedTypeVariables #
* Build a WAI 'Application'
| Turn a Mu GraphQL 'Server' into a WAI 'Application'.
Use this version when your server has not only
queries, but also mutations or subscriptions.
| Turn a Mu GraphQL 'Server' into a WAI 'Application'.
Use this ve... | # language DataKinds #
# language FlexibleContexts #
# language GADTs #
# language OverloadedStrings #
# language RankNTypes #
# language TypeApplications #
|
Description : Execute a Mu ' Server ' using GraphQL
This module allows you to server a Mu ' Server '
as a W... |
e2ecfffd0c30ab4fb0e6dfd05306cafee48c6bf5a6cdf660b97854c70f4405fc | tommaisey/aeon | vlc-distrtn.scm | vlc - distrtn ( rd )
;; caution - audio feedback graph
(import (rnrs) (rhs) (sosc) (rsc3))
(define prep
(lambda (p)
(let ((ampl (list-ref p 0))
(phase (list-ref p 1)))
(list (s:db-amp ampl) phase))))
(define vlc
'((0.00000 1.85550)
(-9.92383 -0.65147)
(-8.74205 -0.74728)
(-3.704... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/graph/vlc-distrtn.scm | scheme | caution - audio feedback graph | vlc - distrtn ( rd )
(import (rnrs) (rhs) (sosc) (rsc3))
(define prep
(lambda (p)
(let ((ampl (list-ref p 0))
(phase (list-ref p 1)))
(list (s:db-amp ampl) phase))))
(define vlc
'((0.00000 1.85550)
(-9.92383 -0.65147)
(-8.74205 -0.74728)
(-3.70464 -1.39796)
(-9.43435 -1.1481... |
3c2e0b8d37abf2899d64e55353771981b828d73b31bd02f0bf7cbd7a64cf08fa | clojure/algo.generic | test_collection.clj | ;; Test routines for clojure.algo.generic.collection
Copyright ( c ) , 2011 . 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 sof... | null | https://raw.githubusercontent.com/clojure/algo.generic/48f3894155abbc14835213281d01355af683b47a/src/test/clojure/clojure/algo/generic/test_collection.clj | clojure | Test routines for clojure.algo.generic.collection
Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this... |
Copyright ( c ) , 2011 . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
(ns clojure.algo.generic.test-collection
(:use [clojure.test :only (deftest is are run-tests)])
(:require [clojure.algo.generic.collection :as gc]))
(defrecord multiset [map])
(defn... |
116bb76f6bffc7882daea13d3b7f28be01b84eccbc2151ed16ac40bcc0c34530 | janestreet/expect_test_helpers_async | test_helpers.ml | open! Core
open! Async
open! Import
let raises_exe = "bin/raises.exe"
let%expect_test "[~hide_positions:true] with a [Time.t]" =
print_s ~hide_positions:true [%message (Time.epoch : Time.t)];
[%expect {|
(Time.epoch (1969-12-31 19:00:00.000000-05:00)) |}];
return ()
;;
let%expect_test "run" =
let%bind ()... | null | https://raw.githubusercontent.com/janestreet/expect_test_helpers_async/417d1ba2436a2a214aab9aaf107e7702110d1f4d/test/test_helpers.ml | ocaml | Can't test [run ~enable_ocaml_backtraces:true] because the backtraces are fragile. | open! Core
open! Async
open! Import
let raises_exe = "bin/raises.exe"
let%expect_test "[~hide_positions:true] with a [Time.t]" =
print_s ~hide_positions:true [%message (Time.epoch : Time.t)];
[%expect {|
(Time.epoch (1969-12-31 19:00:00.000000-05:00)) |}];
return ()
;;
let%expect_test "run" =
let%bind ()... |
d704585e53d3e1eeaf03e7a1ff699ac5cff32782603c963012fd7b37e08fbc9f | AmpersandTarski/Ampersand | FSpecGenOptsParser.hs | module Ampersand.Options.FSpecGenOptsParser (fSpecGenOptsParser, defFSpecGenOpts) where
import Ampersand.Basics
import Ampersand.Misc.HasClasses (FSpecGenOpts (..), Recipe (..), Roots (Roots))
import Ampersand . FSpec . ShowMeatGrinder ( MetaModel ( .. ) )
import Options.Applicative
import Options.Applica... | null | https://raw.githubusercontent.com/AmpersandTarski/Ampersand/8a1c00e3b0aeccd7ea6283b20097a8b73310b138/src/Ampersand/Options/FSpecGenOptsParser.hs | haskell | | Command-line parser for the proto command.
When for the daemon command, the rootfile will eventually come from
the daemon config file.
The rootfile should come from the daemon config file.
TODO: The fatals here should be plain parse errors. Not sure yet how that should be done.
See -applicative | module Ampersand.Options.FSpecGenOptsParser (fSpecGenOptsParser, defFSpecGenOpts) where
import Ampersand.Basics
import Ampersand.Misc.HasClasses (FSpecGenOpts (..), Recipe (..), Roots (Roots))
import Ampersand . FSpec . ShowMeatGrinder ( MetaModel ( .. ) )
import Options.Applicative
import Options.Applica... |
444e0d549d28abbdf12bcaefe51a2684b57ffa7974941b3ee042ba0b2cd18991 | LCBH/UKano | reduction.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/LCBH/UKano/13c046ddaca48b45d3652c3ea08e21599e051527/proverif2.01/src/reduction.mli | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | |
0896a5d64ab48f9d4fb6b562e05a15158589d51268a8e83d56508109338e5b66 | matthias-margush/aka | cmd.clj | (ns aka.cmd
"Implementations of dispatched subcommands."
(:require [aka.log :as log]
[aka.taps :as t]
[clojure.pprint :refer [pprint]]
[clojure.string :as str]))
(defn ->aka
"Parses a command line alias option."
[aka]
(when aka
(keyword (-> (str/replace aka #"^-A:?|:" ... | null | https://raw.githubusercontent.com/matthias-margush/aka/7c71bbe48aa3429a69401ad0ca9ee6361907732b/src/aka/cmd.clj | clojure | (ns aka.cmd
"Implementations of dispatched subcommands."
(:require [aka.log :as log]
[aka.taps :as t]
[clojure.pprint :refer [pprint]]
[clojure.string :as str]))
(defn ->aka
"Parses a command line alias option."
[aka]
(when aka
(keyword (-> (str/replace aka #"^-A:?|:" ... | |
a52f6265115a7dec4239fcfd7b15c39a68cac5038ba0a094af9d79c247c7aa0d | brendanhay/terrafomo | Resources.hs | -- This module is auto-generated.
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
-- Module : Terrafomo.DigitalOcean.Resources
Copyright : ( c ) 2017 - 2018
Lic... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-digitalocean/gen/Terrafomo/DigitalOcean/Resources.hs | haskell | This module is auto-generated.
|
Module : Terrafomo.DigitalOcean.Resources
Stability : auto-generated
* digitalocean_certificate
* digitalocean_domain
* digitalocean_droplet
* digitalocean_firewall
* digitalocean_floating_ip
* digitalocean_loadbalancer
* digitalocean_record
* digitalocean_tag
* dig... |
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - imports #
Copyright : ( c ) 2017 - 2018
License : Mozilla Public License , v. 2.0 .
Maintainer : < brendan.g.hay+ >
Por... |
1694f6804e2f4fc5ec13ef1e23cae4ddd4ebf0fecfeb947d68c0f65545f5780e | 8c6794b6/haskell-sc-scratch | FDandTF.hs | # LANGUAGE TypeFamilies #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE GADTs #-}
# LANGUAGE ExistentialQuantification #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE FlexibleContexts #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : ... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/LangExt/FDandTF.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE Rank2Types #
| This `add` definition:
> add (MkT1 x) (MkT1 y) = MkT1 (x+y)
Shows error:
> Could not deduce (b1 ~ b)
> from the context (F1 t b)
> bound by a pattern with constructor
> in an equation for `add'
| This time, working.
| Same example, with type famili... | # LANGUAGE TypeFamilies #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portable
Comparin... |
52a49117ced835545f50943c8c4ed3ec0aa9f1f619d46175162b8965fe7c31f9 | nilenso/time-tracker | config.clj | (ns time-tracker.config
(:require [aero.core :as aero]
[mount.core :as mount :refer [defstate]]))
(defstate config
:start (let [config-file (get-in (mount/args) [:options :config-file])]
(aero/read-config config-file))
:stop nil)
(defn get-config
([] config)
([key] (get config key)))
| null | https://raw.githubusercontent.com/nilenso/time-tracker/054d0dc6d6b89a4ed234d8f0b0a260b6deeef9e3/src/clj/time_tracker/config.clj | clojure | (ns time-tracker.config
(:require [aero.core :as aero]
[mount.core :as mount :refer [defstate]]))
(defstate config
:start (let [config-file (get-in (mount/args) [:options :config-file])]
(aero/read-config config-file))
:stop nil)
(defn get-config
([] config)
([key] (get config key)))
| |
5997bc49a18eacf84097667b042bc4ec4dbdde5c074edd9939b3a509f0abf6a1 | agilecreativity/gh-utils | git_helper.clj | (ns com.agilecreativity.gh_utils.git_helper
(:require [clj-jgit.porcelain :as cjp :refer :all]
[clojure.java.shell :as shell]
[me.raynes.fs :as fs]))
(defn git-init-commit
"Run initial git commit on a given directory."
[base-dir]
(let [git-repo (cjp/git-init base-dir)]
(cjp/git-add ... | null | https://raw.githubusercontent.com/agilecreativity/gh-utils/dadf5e3bcf9cda65336888c1beaefc32d35ebf57/src/main/clj/com/agilecreativity/gh_utils/git_helper.clj | clojure | "upstream" or "origin"
e.g. git push --set-upstream <origin|upstream> branch-name | (ns com.agilecreativity.gh_utils.git_helper
(:require [clj-jgit.porcelain :as cjp :refer :all]
[clojure.java.shell :as shell]
[me.raynes.fs :as fs]))
(defn git-init-commit
"Run initial git commit on a given directory."
[base-dir]
(let [git-repo (cjp/git-init base-dir)]
(cjp/git-add ... |
a59538e55130fc8f3877bfaf4af163d1ba3d4c4760a14e9328aea49686dca2d9 | duncanatt/detecter | build.erl | %%% ----------------------------------------------------------------------------
@author
%%%
@doc Provides common and experimental build functions for custom EDoc .
%%%
%%% @end
%%%
Copyright ( c ) 2021 , < >
%%%
%%% This program is free software: you can redistribute it and/or modify it
under the term... | null | https://raw.githubusercontent.com/duncanatt/detecter/8bd1cf87355ae1e23e4ff07d109b6d026df80441/detecter/src/build.erl | erlang | ----------------------------------------------------------------------------
@end
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Pub... | @author
@doc Provides common and experimental build functions for custom EDoc .
Copyright ( c ) 2021 , < >
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 WARRANTY ; without even the implied w... |
2b2ce5e02c7e2845ac570bf3cedfa4da1098ff70bdbbfbd9c2d2f3ead540957e | smallmelon/sdzmmo | mod_npc_create.erl | %%%------------------------------------
%%% @Module : mod_npc_create
@Author : xyao
%%% @Email :
@Created : 2010.07.02
%%% @Description: 生成NPC
%%%------------------------------------
-module(mod_npc_create).
-behaviour(gen_server).
-export([start_link/0, create_npc/1]).
-export([init/1, handle_cal... | null | https://raw.githubusercontent.com/smallmelon/sdzmmo/254ff430481de474527c0e96202c63fb0d2c29d2/src/mod/mod_npc_create.erl | erlang | ------------------------------------
@Module : mod_npc_create
@Email :
@Description: 生成NPC
------------------------------------
创建NPC
todo:查询mid为none的怪物重新启动
| @Author : xyao
@Created : 2010.07.02
-module(mod_npc_create).
-behaviour(gen_server).
-export([start_link/0, create_npc/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("common.hrl").
-include("record.hrl").
-record(state, {auto_id}).
create_np... |
9a0ef3ca8ccbd7982f7d7055049fcc9ffef7254383d3c3155729b1163bdb8029 | essen/egs | egs_obj_sensor.erl | @author < >
2011 .
%% @doc Sensor object.
%%
This file is part of EGS .
%%
EGS 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/essen/egs/ceea04c3b438cee9a8470f2abc6297429bf347c5/apps/egs/src/objects/egs_obj_sensor.erl | erlang | @doc Sensor object.
License, or (at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
@todo Real values. | @author < >
2011 .
This file is part of EGS .
EGS 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
EGS is distributed in the hope that it will be useful ,
You ... |
aac254136cf1c11416932f691facc655e9fe0daf32ae265f6059f7acf9197d3d | beeramtheman/99haskell | Script.hs | import Prelude hiding (lookup)
import FFI
data Ace
data Element
data Event
data Ajax
data Param
data Url
data AjaxRes
data Html
data Object
-- General
contains :: String -> String -> Fay Bool
contains = ffi "%1.indexOf(%2) > -1"
query :: String -> Fay Element
query = ffi "document.querySelector(%1)"
addEvent :: St... | null | https://raw.githubusercontent.com/beeramtheman/99haskell/12e5a270da4e584cc9a60fb670b3684d418dd2a9/Script.hs | haskell | General
AJAX
Ace editor
Config
Events / Callbacks
HTML
Main | import Prelude hiding (lookup)
import FFI
data Ace
data Element
data Event
data Ajax
data Param
data Url
data AjaxRes
data Html
data Object
contains :: String -> String -> Fay Bool
contains = ffi "%1.indexOf(%2) > -1"
query :: String -> Fay Element
query = ffi "document.querySelector(%1)"
addEvent :: String -> (Ev... |
5b07d7a6c4a9395d719f6227839129fc08a1c80b833f9f3f112e8d05fd4f9723 | iconnect/api-tools | Tools.hs | | This module provides an interface for generating TH declarations
-- from an 'API'. To use it, splice in a call to 'generate' followed
by one or more calls to ' generateAPITools ' , like so :
--
> $ ( generate myAPI )
-- > $(generateAPITools [enumTool, jsonTool', quickCheckTool] myAPI)
--
-- If you wish to over... | null | https://raw.githubusercontent.com/iconnect/api-tools/3d7b4dfadf82c7cb859b515d033447bd1d8ef6c6/src/Data/API/Tools.hs | haskell | from an 'API'. To use it, splice in a call to 'generate' followed
> $(generateAPITools [enumTool, jsonTool', quickCheckTool] myAPI)
If you wish to override any of the instances generated by the
tools, you can do so by writing instance declarations after the
call to 'generate' but before the call to 'generateAPI... | | This module provides an interface for generating TH declarations
by one or more calls to ' generateAPITools ' , like so :
> $ ( generate myAPI )
module Data.API.Tools
( generate
, generateAPITools
, generateWith
, generateAPIToolsWith
, ToolSettings
, defaultToolSettings
, warnOnOm... |
911a46bebd70ec743309d633e84db903c94e48b152aa32fcb56a2ee519ef4243 | Bogdanp/deta | info.rkt | #lang info
(define license 'BSD-3-Clause)
(define collection "deta")
(define scribblings '(("deta.scrbl")))
(define deps '("base"))
(define build-deps '("db-doc"
"db-lib"
"deta-lib"
"gregor-doc"
"gregor-lib"
"rack... | null | https://raw.githubusercontent.com/Bogdanp/deta/c14d04e68b8698b5ce5f65e3fd8eab8dd4ff0472/deta-doc/info.rkt | racket | #lang info
(define license 'BSD-3-Clause)
(define collection "deta")
(define scribblings '(("deta.scrbl")))
(define deps '("base"))
(define build-deps '("db-doc"
"db-lib"
"deta-lib"
"gregor-doc"
"gregor-lib"
"rack... | |
087d5265cc13e3f850ad7431d017192552c1bc097e6ae880ed002af7f77ebe93 | DaveWM/larch | core_test.cljc | (ns larch.core-test
(:require [clojure.test :refer [deftest testing is #?(:cljs async)]]
[clojure.core.async :refer [chan <! to-chan >! go #?@(:clj (<!! >!!))]]
[larch.core :refer [msgs->updates!]]))
(deftest test-db-updates
(testing "when process-event returns a single-element vector, i... | null | https://raw.githubusercontent.com/DaveWM/larch/33c8c7a8d524e359a02ab3a9eba010d0dbdcd314/test/larch/core_test.cljc | clojure | (ns larch.core-test
(:require [clojure.test :refer [deftest testing is #?(:cljs async)]]
[clojure.core.async :refer [chan <! to-chan >! go #?@(:clj (<!! >!!))]]
[larch.core :refer [msgs->updates!]]))
(deftest test-db-updates
(testing "when process-event returns a single-element vector, i... | |
8d237d73642dd5dd0bd7d836e06633ccb3b5db61d7d5833234471fd23e4cb4e7 | ferd/calcalc | calcalc_aztec_xihuitl.erl | -module(calcalc_aztec_xihuitl).
-export([epoch/0, date/1, is_valid/1, to_fixed/1,
from_fixed/1]).
-compile(export_all).
-import(calcalc_math, [floor/1, ceil/1, amod/2, mod/2]).
-include("calcalc.hrl").
-spec epoch() -> integer().
epoch() ->
calcalc_julian:to_fixed(calcalc_julian:date(
#{year => 1... | null | https://raw.githubusercontent.com/ferd/calcalc/d16eec3512d7b4402b1ddde82128f2483e955e98/src/calcalc_aztec_xihuitl.erl | erlang | Haab months | -module(calcalc_aztec_xihuitl).
-export([epoch/0, date/1, is_valid/1, to_fixed/1,
from_fixed/1]).
-compile(export_all).
-import(calcalc_math, [floor/1, ceil/1, amod/2, mod/2]).
-include("calcalc.hrl").
-spec epoch() -> integer().
epoch() ->
calcalc_julian:to_fixed(calcalc_julian:date(
#{year => 1... |
ee77ed8ba719a9818f3395ebfe61b630e44d63ac8474460789c01a5d2fe1aef9 | thelema/ocaml-community | odoc_class.ml | (***********************************************************************)
(* *)
(* OCamldoc *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/ocamldoc/odoc_class.ml | ocaml | *********************************************************************
OCamldoc
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
module Name = Odoc_name
type class_eleme... |
ea5b88f33d148840a4d482a2c978feed4643859594c8ab85d1c86f75b3d3ea13 | exoscale/vinyl | sql_test.clj | (ns exoscale.vinyl.sql-test
(:require [clojure.test :as test :refer [deftest are]]
[exoscale.vinyl.payload :as p]
[exoscale.vinyl.sql :refer [list-query]]
[exoscale.vinyl.demostore :as ds :refer [*db*]]))
(test/use-fixtures :once ds/with-open-fdb)
(deftest... | null | https://raw.githubusercontent.com/exoscale/vinyl/084ce464fc7637aa0c20ab55ee1c898931da5443/test/exoscale/vinyl/sql_test.clj | clojure | (ns exoscale.vinyl.sql-test
(:require [clojure.test :as test :refer [deftest are]]
[exoscale.vinyl.payload :as p]
[exoscale.vinyl.sql :refer [list-query]]
[exoscale.vinyl.demostore :as ds :refer [*db*]]))
(test/use-fixtures :once ds/with-open-fdb)
(deftest... | |
41e162126757a724e2edccc47150e8a95ecaa22ffc757adf08a2ff6c4a095ccd | input-output-hk/cardano-sl | Subscriber.hs | -- | Definition of a modular subscriber action, which maintains subscriptions
-- through failures etc.
module Pos.Infra.Diffusion.Subscription.Subscriber
( SubscriptionTarget (..)
, constantSubscriptionTarget
, listSubscriptionTarget
, SubscribeTo
, subscriber
) where
import Universu... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/infra/src/Pos/Infra/Diffusion/Subscription/Subscriber.hs | haskell | | Definition of a modular subscriber action, which maintains subscriptions
through failures etc.
| Generate subscription targets in some monad.
TBD any value in using a streaming solution like conduit?
| Use a 'SubscriptionTarget m target' to generate 'target's to subscribe to.
A subscription is attempted to the ... |
module Pos.Infra.Diffusion.Subscription.Subscriber
( SubscriptionTarget (..)
, constantSubscriptionTarget
, listSubscriptionTarget
, SubscribeTo
, subscriber
) where
import Universum
newtype SubscriptionTarget m target = SubscriptionTarget
{ getSubscriptionTarget :: m (Maybe (ta... |
f75a1413c93ca8ed1a5a2c747759baae0f9e3a0b731e1193a940f9110a331696 | fp-works/2019-winter-Haskell-school | Exercise05Spec.hs | module CIS194.Homework05.Exercise05Spec where
import CIS194.Homework05.Exercise03 ( ( .. ) )
import CIS194.Homework05.StackVM (StackExp(..))
import CIS194.Homework05.Exercise05
import Test.Tasty.Hspec
spec_compile :: Spec
spec_compile =
it "as an instance of Expr" $
compile "(2+3)*4" `shouldBe` Just [PushI... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week5/daniel-deng/test/Exercise05Spec.hs | haskell | module CIS194.Homework05.Exercise05Spec where
import CIS194.Homework05.Exercise03 ( ( .. ) )
import CIS194.Homework05.StackVM (StackExp(..))
import CIS194.Homework05.Exercise05
import Test.Tasty.Hspec
spec_compile :: Spec
spec_compile =
it "as an instance of Expr" $
compile "(2+3)*4" `shouldBe` Just [PushI... | |
fdb364548238b3052041233ad9caae2d28d05134bee504dbcbd1046f9a5d304d | biilmann/eventsource-broker | AMQPEvents.hs | {-# LANGUAGE OverloadedStrings #-}
module AMQPEvents
(
AMQPEvent(..)
, Channel
, openEventChannel
, publishEvent
) where
import Control.Applicative((<$>), (<*>))
import Control.Monad(mzero)
import Control.Monad.Fix(fix)
import Control.Concurrent(forkIO)... | null | https://raw.githubusercontent.com/biilmann/eventsource-broker/337fbd0fd6df29588b29b7bcaab333c65678e490/src/AMQPEvents.hs | haskell | # LANGUAGE OverloadedStrings #
mapped to an EventSource event.
|Connects to an AMQP broker.
Tries to get credentials, host and vhost from the AMQP_URL
environment variable
Take an exchange name and a queue name | module AMQPEvents
(
AMQPEvent(..)
, Channel
, openEventChannel
, publishEvent
) where
import Control.Applicative((<$>), (<*>))
import Control.Monad(mzero)
import Control.Monad.Fix(fix)
import Control.Concurrent(forkIO)
import Control.Concurren... |
de30f0dd8147b04426dd542f4d16033876720b415a7a7d6d1bd0493708d101dc | fumieval/mason | Dynamic.hs | module Mason.Builder.Dynamic
( DynBuilder
, DynamicBackend(..)
-- * Runners
, toStrictByteString
, toLazyByteString
, hPutBuilderLen
, hPutBuilder
, sendBuilder
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Mason.Builder as B
import qualifi... | null | https://raw.githubusercontent.com/fumieval/mason/33cc9a9b29426db2deebebd2361fbe349cc16a89/src/Mason/Builder/Dynamic.hs | haskell | * Runners
# INLINE allocate #
| Builder with a fixed set of backends. This helps reducing code size
extensibility. | module Mason.Builder.Dynamic
( DynBuilder
, DynamicBackend(..)
, toStrictByteString
, toLazyByteString
, hPutBuilderLen
, hPutBuilder
, sendBuilder
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Mason.Builder as B
import qualified Mason.Builde... |
ea9236b56cf686d86e7b8d3d01f0d50a0272f2a51710ad5a755edf96e1d3ca85 | racket/macro-debugger | info.rkt | #lang info
(define raco-commands
'(("check-requires"
(submod macro-debugger/analysis/check-requires main)
"check for useless requires"
#f)
("show-dependencies"
(submod macro-debugger/analysis/show-dependencies main)
"show module dependencies"
#f)
("macro-profiler"
(submod m... | null | https://raw.githubusercontent.com/racket/macro-debugger/d4e2325e6d8eced81badf315048ff54f515110d5/macro-debugger-text-lib/macro-debugger/info.rkt | racket | #lang info
(define raco-commands
'(("check-requires"
(submod macro-debugger/analysis/check-requires main)
"check for useless requires"
#f)
("show-dependencies"
(submod macro-debugger/analysis/show-dependencies main)
"show module dependencies"
#f)
("macro-profiler"
(submod m... | |
992df47e838e0f037f3ad1aaf9b53d39dac84127f78b91daff350476f0b1218f | michaelballantyne/multiscope | macros-sep-comp2.rkt | #lang racket/base
(require
rackunit
"macros-sep-comp1.rkt")
(test-case "reference passes through macro without scope modification"
(check-equal?
(let ([x 2])
(macro x))
2))
| null | https://raw.githubusercontent.com/michaelballantyne/multiscope/58af714ee263b3a34006b0aa810d0c6e34ba93f7/test/macros-sep-comp2.rkt | racket | #lang racket/base
(require
rackunit
"macros-sep-comp1.rkt")
(test-case "reference passes through macro without scope modification"
(check-equal?
(let ([x 2])
(macro x))
2))
| |
feb836e9ac8d0f280e0a3090e17980f7b537e02b9e46fe452483405982349626 | craigl64/clim-ccl | macros.lisp | ;; -*- mode: common-lisp; package: tk -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :tk)
(defmacro def-foreign-array-resource (name constructor)
`(progn
(clim-sys:defresource ,name (n)
:constructor (cons n (,constructor :number n))
:matcher (not (< (car ,nam... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/tk/macros.lisp | lisp | -*- mode: common-lisp; package: tk -*-
See the file LICENSE for the full license governing this code.
jis-x208 and gaiji
ascii and jis-x201 |
(in-package :tk)
(defmacro def-foreign-array-resource (name constructor)
`(progn
(clim-sys:defresource ,name (n)
:constructor (cons n (,constructor :number n))
:matcher (not (< (car ,name) n)))
(defmacro ,(fintern "~A-~A" 'with name)
((var n) &body body)
`(clim-sys:using-resource (,... |
c1873d22dd010af52150b31036cffd7f5949c6e9bbf2594a45f48ef7ba3492cd | smimram/monadic-synth | test.ml | open Op
let s =
let+ lfo = sine in
let+ osc = saw in
let s = osc (cst 440.) |> amp (add (lfo (cst 10.)) (cst 0.1)) |> stereo in
return s
let () =
Output.play s
| null | https://raw.githubusercontent.com/smimram/monadic-synth/23721ff81e6f366c9019f93f418c20e1dff6f811/experiments/two-monads/test.ml | ocaml | open Op
let s =
let+ lfo = sine in
let+ osc = saw in
let s = osc (cst 440.) |> amp (add (lfo (cst 10.)) (cst 0.1)) |> stereo in
return s
let () =
Output.play s
| |
60c9bd9157f1336ddb929b2a12762eba4ae13f8fc459066bceb251ed7c2b9383 | mauny/the-functional-approach-to-programming | xHelv-B.ml | (*************************************************************************)
(* *)
(* Projet Formel *)
(* *)
CAML - light :... | null | https://raw.githubusercontent.com/mauny/the-functional-approach-to-programming/1ec8bed5d33d3a67bbd67d09afb3f5c3c8978838/cl-75/MLGRAPH.DIR/MLgraph.lib/Lib/xHelv-B.ml | ocaml | ***********************************************************************
Projet Formel
... | CAML - light :
45 rue d'Ulm
75005 PARIS
France
#open "MLgraph";;
let fn =
Helvetica_Bold,{font_descr_filename="preloaded"; f... |
438e84a7a5a3cecba5f17f4351411939c8333eebb7101e2d84623784cabe7151 | bmeg/ophion | server.clj | (ns ophion.server
(:require
[clojure.string :as string]
[clojure.java.io :as io]
[clojure.tools.cli :as cli]
[manifold.stream :as stream]
[aleph.http :as http]
[cheshire.core :as json]
[taoensso.timbre :as log]
[ring.middleware.resource :as resource]
[ring.middleware.params :as params]
[... | null | https://raw.githubusercontent.com/bmeg/ophion/d22333e8d2b33c6b9e6284ec8ef9fc2a6ce60c8f/src/ophion/server.clj | clojure | (.setLevel
(Logger/ROOT_LOGGER_NAME))
Level/INFO) | (ns ophion.server
(:require
[clojure.string :as string]
[clojure.java.io :as io]
[clojure.tools.cli :as cli]
[manifold.stream :as stream]
[aleph.http :as http]
[cheshire.core :as json]
[taoensso.timbre :as log]
[ring.middleware.resource :as resource]
[ring.middleware.params :as params]
[... |
56b384446f5afb156f01c0bf722f07f5a6fecaa69f53f651a2c01d2070f26e88 | newque/newque | http_format.mli | type t =
| Plaintext
| Json
val create : Config_t.config_channel_format -> t
| null | https://raw.githubusercontent.com/newque/newque/dee73e2cb7be8700847f9e5cf900731cc20b1b8c/src/serialization/http_format.mli | ocaml | type t =
| Plaintext
| Json
val create : Config_t.config_channel_format -> t
| |
c53af82d858c61451af967c7052eba60147657c83e79c9732b76a56556278853 | spawnfest/eep49ers | xref_reader.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2000 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/tools/src/xref_reader.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2000 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(xref_reader).
-export([module/5]).
-import(lists, [keysearch/3, member/2, reverse/1]).
-record(xrefr,
{mo... |
679c07d6a3595f225b525aefee86e2849e8f13e4dff777efd2ea5f61e995bb4f | basho/yokozuna | yz_solrq_eqc_ibrowse.erl | %% -------------------------------------------------------------------
Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
... | null | https://raw.githubusercontent.com/basho/yokozuna/e15fe64f9ef9318c0cc21754f3dfdd073d2dc77d/test/yz_solrq_eqc_ibrowse.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 permission... | Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(yz... |
d0f94c430a1cd79aab8cbe3ab6e6bb91dd58a1706145b4d1d245936c1dd7b751 | ninenines/cowboy | accept_callback_h.erl | %% This module returns something different in
AcceptCallback depending on the query string .
-module(accept_callback_h).
-export([init/2]).
-export([allowed_methods/2]).
-export([content_types_accepted/2]).
-export([put_text_plain/2]).
init(Req, Opts) ->
{cowboy_rest, Req, Opts}.
allowed_methods(Req, State) ->
... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/accept_callback_h.erl | erlang | This module returns something different in | AcceptCallback depending on the query string .
-module(accept_callback_h).
-export([init/2]).
-export([allowed_methods/2]).
-export([content_types_accepted/2]).
-export([put_text_plain/2]).
init(Req, Opts) ->
{cowboy_rest, Req, Opts}.
allowed_methods(Req, State) ->
{[<<"PUT">>, <<"POST">>, <<"PATCH">>], Req, St... |
ccf986d3cd401bc28dd0a29ef932d691a182014a374d0477865ae2ef9f8d16bb | footprintanalytics/footprint-web | rules.clj | (ns metabase.automagic-dashboards.rules
"Validation, transformation to cannonical form, and loading of heuristics."
(:require [clojure.string :as str]
[metabase.automagic-dashboards.populate :as populate]
[metabase.query-processor.util :as qp.util]
[metabase.util :as u]
... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/automagic_dashboards/rules.clj | clojure | (ns metabase.automagic-dashboards.rules
"Validation, transformation to cannonical form, and loading of heuristics."
(:require [clojure.string :as str]
[metabase.automagic-dashboards.populate :as populate]
[metabase.query-processor.util :as qp.util]
[metabase.util :as u]
... | |
8f369b470c2b3954ecbb44c44846b0eec0c2b9b7fbe1c75bcbcc16e591d449bd | peeley/femto | Parser.hs | module Parser where
import ParserType
import LispTypes
import Lexer
import Control.Applicative ((<|>))
import Data.Maybe (fromJust)
import Control.Monad (void)
parseString :: Parser LispVal
parseString = do
char '"' <|> char '\''
str <- zeroOrMore $ satisfies ('"' /=)
char '"' <|> char '\''
return $ S... | null | https://raw.githubusercontent.com/peeley/femto/9ebefade082c1126292dcfaaf6e4e6cbf23086ad/src/Parser.hs | haskell | module Parser where
import ParserType
import LispTypes
import Lexer
import Control.Applicative ((<|>))
import Data.Maybe (fromJust)
import Control.Monad (void)
parseString :: Parser LispVal
parseString = do
char '"' <|> char '\''
str <- zeroOrMore $ satisfies ('"' /=)
char '"' <|> char '\''
return $ S... | |
375c7704effb122efe0a84e5119808878d5bafdbc62e0fe0974415ce620560b3 | cognitect-labs/vase | data_readers.clj | {vase/respond com.cognitect.vase.literals/respond
vase/redirect com.cognitect.vase.literals/redirect
vase/conform com.cognitect.vase.literals/conform
vase/query com.cognitect.vase.literals/query
vase/transact com.cognitect.vase.literals/transact
vase/validate com.cognitect.vase.literals/vali... | null | https://raw.githubusercontent.com/cognitect-labs/vase/d882bc8f28e8af2077b55c80e069aa2238f646b7/src/data_readers.clj | clojure | {vase/respond com.cognitect.vase.literals/respond
vase/redirect com.cognitect.vase.literals/redirect
vase/conform com.cognitect.vase.literals/conform
vase/query com.cognitect.vase.literals/query
vase/transact com.cognitect.vase.literals/transact
vase/validate com.cognitect.vase.literals/vali... | |
cc6d467cf3b58490ecc2a37cc160f7cd2f092f8db826a563c63d60afa0138407 | gklijs/bkes-demo | transfer_command_handlers.clj | (ns nl.openweb.command-handler.transfer-command-handlers
(:require [clojurewerkz.money.amounts :as ma]
[clojurewerkz.money.currencies :as cu]
[clojurewerkz.money.format :as fo]
[nl.openweb.command-handler.db :as db]
[nl.openweb.command-handler.bank-event-handlers :as ba... | null | https://raw.githubusercontent.com/gklijs/bkes-demo/b567f6b32ffb9b5fcb9ee3f73b20f653720a2915/command-handler/src/nl/openweb/command_handler/transfer_command_handlers.clj | clojure | (ns nl.openweb.command-handler.transfer-command-handlers
(:require [clojurewerkz.money.amounts :as ma]
[clojurewerkz.money.currencies :as cu]
[clojurewerkz.money.format :as fo]
[nl.openweb.command-handler.db :as db]
[nl.openweb.command-handler.bank-event-handlers :as ba... | |
8d74ec9b13b7aed0502546c98ec371693d46cfb0d4892facef06ff9f42999bd8 | dwayne/eopl3 | interpreter.rkt | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
;; Expressed Values
num-val bool-val list-val
;; Interpreter
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/05-ch5/interpreters/racket/CONTINUATION-PASSING-5.6/interpreter.rkt | racket | Expressed Values
Interpreter
Continuations
It uses a procedural representation.
(bool-val #t)
(bool-val #f)))
This can be simplified to:
Cont x ExpVal -> FinalAnswer
Procedure ADT
Values
ExpVal = Int + Bool + Proc + List[EvalVal] | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
num-val bool-val list-val
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
'x (num-val 10)
... |
e1668916e9444d6f4e704ba6d64ada23856c4cab85487f3f6076e3f9d10cb344 | aeternity/aeternity | aemon_app.erl | -module(aemon_app).
-behavior(application).
-export([ start/2
, start_phase/3
, prep_stop/1
, stop/1
]).
start(_StartType, _StartArgs) ->
aemon_sup:start_link().
start_phase(_Phase, _StartType, _PhaseArgs) ->
ok.
prep_stop(_State) ->
ok.
stop(_State) ->
ok.
| null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aemon/src/aemon_app.erl | erlang | -module(aemon_app).
-behavior(application).
-export([ start/2
, start_phase/3
, prep_stop/1
, stop/1
]).
start(_StartType, _StartArgs) ->
aemon_sup:start_link().
start_phase(_Phase, _StartType, _PhaseArgs) ->
ok.
prep_stop(_State) ->
ok.
stop(_State) ->
ok.
| |
8cf272edfb743a5fe4980fc8d92f0ae2c80c354606e55a49aa0bc1fb89b70d12 | hstreamdb/hstream | Codec.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module HStream.Utils.Codec where
import Control.Exception (throw)
import qualified Data.Attoparsec.ByteString as P
import ... | null | https://raw.githubusercontent.com/hstreamdb/hstream/125d9982d47874aee5e33324b55689d64bd664c2/common/hstream/HStream/Utils/Codec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
| <- 32 bits BE -> | | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module HStream.Utils.Codec where
import Control.Exception (throw)
import qualified Data.Attoparsec.ByteString as P
import Data.Bits (Bits (shiftL), (.|.))
import qualified ... |
ce9e4c799d16316f5bfe946dc05c8f91a16e48c21cd54e910fb486a9b6a6ffb7 | gtod/postgres-json | query.lisp | (in-package :postgres-json)
;;;; Postmodern queries proper and support
(defun query-key (model-name operation)
"Return a string: *PGJ-SCHEMA*:MODEL-NAME:OPERATION to key a prepared
query. An 'operation' is the name of a DB query, for example FETCH$."
(format nil "~A:~A:~A"
(symbol-name *pgj-schema*)
... | null | https://raw.githubusercontent.com/gtod/postgres-json/a545b6c61ca6ee4c6a579c77dbe6856013c7c34f/model/query.lisp | lisp | Postmodern queries proper and support
Our queries are made on demand for a schema/model/query-name
combination. This is the factory for creating such queries. The
convention is to suffix queries proper (aka 'operations') with
#\$.
Base queries
History queries
Note the dependence on the column ordering of
CRE... | (in-package :postgres-json)
(defun query-key (model-name operation)
"Return a string: *PGJ-SCHEMA*:MODEL-NAME:OPERATION to key a prepared
query. An 'operation' is the name of a DB query, for example FETCH$."
(format nil "~A:~A:~A"
(symbol-name *pgj-schema*)
model-name
(symbol-name o... |
523ce3ed02f8c0ec16e9e7498727c44aa4ba92deb2c3b32db928ad1aee3549d0 | sph-mn/sph-lib | reader.scm | (define-module (sph system reader))
(use-modules (ice-9 peg) (rnrs base)
(sph) (system reader)
((ice-9 rdelim) #:select (read-line)) ((sph io) #:select (read-until-string-proc))
((srfi srfi-1) #:select (reverse)))
(export default-sharp-token-reader-with-comments read-for-formatting
read-with-comments sph-read... | null | https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/modules/sph/system/reader.scm | scheme | (define-module (sph system reader))
(use-modules (ice-9 peg) (rnrs base)
(sph) (system reader)
((ice-9 rdelim) #:select (read-line)) ((sph io) #:select (read-until-string-proc))
((srfi srfi-1) #:select (reverse)))
(export default-sharp-token-reader-with-comments read-for-formatting
read-with-comments sph-read... | |
450da4fae8bce405aca4f63e5b9d557ee35df69f370a8df3e5187f96edd706b4 | pallix/lacij | style.clj | Copyright © 2010 Fraunhofer Gesellschaft
Licensed under the EPL V.1.0
(ns ^{:doc "Utilities functions to manipulate styles and attributes."}
lacij.view.utils.style
(:use clojure.pprint)
(:require [analemma.svg :as s]
[analemma.xml :as xml]))
(defn apply-styles [tag default-style style]
(let [s... | null | https://raw.githubusercontent.com/pallix/lacij/ee9b7dcda13f25f7460acb5995b7970a7564c11e/src/lacij/view/utils/style.clj | clojure | Copyright © 2010 Fraunhofer Gesellschaft
Licensed under the EPL V.1.0
(ns ^{:doc "Utilities functions to manipulate styles and attributes."}
lacij.view.utils.style
(:use clojure.pprint)
(:require [analemma.svg :as s]
[analemma.xml :as xml]))
(defn apply-styles [tag default-style style]
(let [s... | |
13a7628865fd93bf709aa99778e762d1d1b4d4074e519455daa60fdc595e0fa2 | zcaudate/hara | remote_repo_test.clj | (ns hara.lib.aether.remote-repo-test
(:use hara.test)
(:require [hara.object :as object]
[hara.lib.aether.remote-repo])
(:import (org.eclipse.aether.repository RemoteRepository
RemoteRepository$Builder
RepositoryPolicy... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/test/hara/lib/aether/remote_repo_test.clj | clojure | => #builder.remote{:repository-manager false
:type "default"
:default-policy {:checksum-policy "warn",
:enabled? true},
:release-policy {:checksum-policy "warn"
:enabled? true}
... | (ns hara.lib.aether.remote-repo-test
(:use hara.test)
(:require [hara.object :as object]
[hara.lib.aether.remote-repo])
(:import (org.eclipse.aether.repository RemoteRepository
RemoteRepository$Builder
RepositoryPolicy... |
e334b6fa627258ae988482320b5597a92253ccc4ac2145ad6ee949c386ea62b8 | chrisdone/hulk | Client.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ViewPatterns #-}
-- | This module communicates and manages the state of clients
-- connected to the server.
module Hulk.Client
where
import Hulk.Auth
import Hulk.Types
import Control.Monad.RWS hidi... | null | https://raw.githubusercontent.com/chrisdone/hulk/8a7c2cf975a2d40778a26750591c8c69d3ea4ae7/src/Hulk/Client.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
| This module communicates and manages the state of clients
connected to the server.
------------------------------------------------------------------------------
* Top-level dispatchers
| Run the client monad.
^ Server configuration.
^ Server state.
... | # LANGUAGE RecordWildCards #
module Hulk.Client
where
import Hulk.Auth
import Hulk.Types
import Control.Monad.RWS hiding (pass)
import Data.CaseInsensitive (mk)
import Data.Char
import Data.List
import Data.List.Split
import Data... |
314ccb869d86bfcdc5f9ee3f98e6066dda0b46a8c5dd7a900165a1a19c0c3d5d | bvaugon/ocapic | serial.ml | (*************************************************************************)
(* *)
(* OCaPIC *)
(* *)
... | null | https://raw.githubusercontent.com/bvaugon/ocapic/a14cd9ec3f5022aeb5fe2264d595d7e8f1ddf58a/tests/serial1/serial.ml | ocaml | ***********************************************************************
OCaPIC
... |
This file is distributed under the terms of the CeCILL license .
open Pic;;
set_bit IRCF1;;
set_bit IRCF0;;
set_bit PLLEN;;
module Disp = Lcd.Connect (
struct
let bus_size = Lcd.Eight
let e = Pic.LATD0
let rs = Pic.LATD2
let rw ... |
31218630c1b7935ccaf0311e2fc93255ea65e909a9f60354d53541ad16aab8c9 | weavejester/flupot-pixi | pixi.clj | (ns flupot.pixi
(:require [flupot.core :as core]))
(def functions
'{stage ReactPIXI.Stage
sprite ReactPIXI.Sprite
sprite-batch ReactPIXI.SpriteBatch
tiling-sprite ReactPIXI.TilingSprite
text ReactPIXI.Text
bitmap-text ReactPIXI.BitmapText
container ReactPIXI.D... | null | https://raw.githubusercontent.com/weavejester/flupot-pixi/958e42dc5ee5121e77f8776d402c71b096e71da5/src/flupot/pixi.clj | clojure | (ns flupot.pixi
(:require [flupot.core :as core]))
(def functions
'{stage ReactPIXI.Stage
sprite ReactPIXI.Sprite
sprite-batch ReactPIXI.SpriteBatch
tiling-sprite ReactPIXI.TilingSprite
text ReactPIXI.Text
bitmap-text ReactPIXI.BitmapText
container ReactPIXI.D... | |
1db94d2be861b9ae9603b75c0a9547576efd0cc2f3536b4142ac9cd8fa80e58f | noinia/hgeometry | CircularSeqSpec.hs | module Data.CircularSeqSpec where
import Data.CircularSeq
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Instances()
import Data.List.NonEmpty(NonEmpty)
spec :: Spec
spec = do
describe "CircularCeq tests" $ do
it "isShiftOf" $ do
let c1 :: CSeq Int
c1 = fromList [1, 2, 1, 3]
... | null | https://raw.githubusercontent.com/noinia/hgeometry/a6abecb1ce4a7fd96b25cc1a5c65cd4257ecde7a/hgeometry-combinatorial/test/Data/CircularSeqSpec.hs | haskell | property $ \(xs :: NonEmpty Int) i ->
in
it "cyclic shift is symmetric" $
property $ \(xs :: NonEmpty Int) i -> | module Data.CircularSeqSpec where
import Data.CircularSeq
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Instances()
import Data.List.NonEmpty(NonEmpty)
spec :: Spec
spec = do
describe "CircularCeq tests" $ do
it "isShiftOf" $ do
let c1 :: CSeq Int
c1 = fromList [1, 2, 1, 3]
... |
d54f14c7fe37386832ea562020a1773f922d06ffb6c5dd433e988159d48e039d | freckle/stackctl | CloudFormation.hs | module Stackctl.AWS.CloudFormation
( Stack(..)
, stack_stackName
, stackDescription
, stackStatusRequiresDeletion
, StackId(..)
, StackName(..)
, StackDescription(..)
, StackStatus(..)
, StackEvent(..)
, ResourceStatus(..)
, stackEvent_eventId
, stackEvent_logicalResourceId
, stackEvent_resour... | null | https://raw.githubusercontent.com/freckle/stackctl/384066b09335e3750abbbf679c5175a570dbf16f/src/Stackctl/AWS/CloudFormation.hs | haskell | | @stackctl-{timestamp}-{uuid}@
returning an empty list, so we need to do this through exceptions
^ Last-seen Id
Is supporting { k, Nothing } valuable?
deploy it, then you attempt to create another ChangeSet, you need to use the
Our hueristic for finding these is under review but with no previous
updates (no ... | module Stackctl.AWS.CloudFormation
( Stack(..)
, stack_stackName
, stackDescription
, stackStatusRequiresDeletion
, StackId(..)
, StackName(..)
, StackDescription(..)
, StackStatus(..)
, StackEvent(..)
, ResourceStatus(..)
, stackEvent_eventId
, stackEvent_logicalResourceId
, stackEvent_resour... |
d972b65c2ea5d814e8e850466717cf40489517133aeb196f14d55442958db823 | armedbear/abcl | defsetf.lisp | defsetf.lisp
;;;
Copyright ( C ) 2003 - 2005
$ Id$
;;;
;;; 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 2
of the License , or ( at your option ) any later version .
;;... | null | https://raw.githubusercontent.com/armedbear/abcl/0631ea551523bb93c06263e772fbe849008e2f68/src/org/armedbear/lisp/defsetf.lisp | lisp |
This program is free software; you can redistribute it and/or
either version 2
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 General Public License for more details... | defsetf.lisp
Copyright ( C ) 2003 - 2005
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - ... |
faf29c91a161d3b4df60220ab3d252b205f9d22a843a7e9efdbb01347f2d325c | snmsts/cserial-port | interfaces.lisp | (cl:in-package :cserial-port)
(defclass serial ()
((name :initarg :name
:reader serial-name
:documentation "Device name")
(fd :initarg :fd
:reader serial-fd
:documentation "opend handle")
(encoding :initarg :encoding
:reader serial-encoding
:documentation "encoding")
(baud-rate... | null | https://raw.githubusercontent.com/snmsts/cserial-port/87b5713abb17ff4c4694e975d986121223368ee0/src/interfaces.lisp | lisp | convert to native form. | (cl:in-package :cserial-port)
(defclass serial ()
((name :initarg :name
:reader serial-name
:documentation "Device name")
(fd :initarg :fd
:reader serial-fd
:documentation "opend handle")
(encoding :initarg :encoding
:reader serial-encoding
:documentation "encoding")
(baud-rate... |
5dd145ecb77842ad24e1f727514c7037b091388ff56cf5243ca53ee59e338b58 | jtod/Hydra | PrimDataGit.hs | |
Module : HDL.Hydra . Circuits . PrimData
Description : Data types for signal values
Copyright : ( c ) 2016
License : GPL-3
Maintainer :
Stability : experimental
Data types for signal values .
Module : HDL.Hydra.Circuits.PrimData
Description : Data types for signal va... | null | https://raw.githubusercontent.com/jtod/Hydra/b63d54612392565f451fd074a606d1ca9e978a73/src/HDL/Hydra/Core/PrimDataGit.hs | haskell | This module defines basic datatypes and structures used throughout
the program, as well as functions for converting to and from
strings.
--------------------------------------------------------------------
intbin k x returns a list of k bits giving the binary
binint bs gives the integer represented by bs, assuming... | |
Module : HDL.Hydra . Circuits . PrimData
Description : Data types for signal values
Copyright : ( c ) 2016
License : GPL-3
Maintainer :
Stability : experimental
Data types for signal values .
Module : HDL.Hydra.Circuits.PrimData
Description : Data types for signal va... |
d1f7a430e67bb26209c565ba25eb40bdbbd594cbac90617e4bb7a7750f033415 | appleby/99-lisp-problems | p59.lisp | ;;;; (**) Construct height-balanced binary trees
;;;;
;;;; In a height-balanced binary tree, the following property holds
;;;; for every node: The height of its left subtree and the height of
;;;; its right subtree are almost equal, which means their difference
;;;; is not greater than one.
;;;;
Write a function hbal... | null | https://raw.githubusercontent.com/appleby/99-lisp-problems/a12b2a585ac5af06f456f844d308bbada78e647c/p59.lisp | lisp | (**) Construct height-balanced binary trees
In a height-balanced binary tree, the following property holds
for every node: The height of its left subtree and the height of
its right subtree are almost equal, which means their difference
is not greater than one.
trees for a given height. The function should gene... | Write a function hbal - tree to construct height - balanced binary
* ( hbal - tree 3 )
(in-package :99-problems)
(defun hbal-tree (n)
(cond ((<= n 0) (list (make-empty-tree)))
((= n 1) (list (make-leaf-node)))
(t (extend-trees
(append (generate-subtrees #'hbal-tree (- n 1) (- n 1))
(generate-subtre... |
17562d37c1d9440d73ffe31b8e341ed924d5204f78afb4bc4e15b24dce92161a | kpblc2000/KpblcLispLib | _kpblc-get-decimal-separator.lsp | (defun _kpblc-get-decimal-separator ()
;|
* Âîçâðàùàåò óñòàíîâëåííûé â ñèñòåìå ðàçäåëèòåëü öåëîé è äðîáíîé ÷àñòè
|;
(vl-registry-read "HKEY_CURRENT_USER\\Control panel\\International" "sDecimal")
) ;_ end of defun
| null | https://raw.githubusercontent.com/kpblc2000/KpblcLispLib/49d1d9d29078b4167cc65dc881bea61b706c620d/lsp/get/decimal/_kpblc-get-decimal-separator.lsp | lisp | |
_ end of defun
| (defun _kpblc-get-decimal-separator ()
* Âîçâðàùàåò óñòàíîâëåííûé â ñèñòåìå ðàçäåëèòåëü öåëîé è äðîáíîé ÷àñòè
(vl-registry-read "HKEY_CURRENT_USER\\Control panel\\International" "sDecimal")
|
c9bdf4603a9afea7bc6fcb0bdf88c797f3254e6a552255ea9a56e118ccaa1a46 | gedge-platform/gedge-platform | rabbit_password_hashing_sha512.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_password_hashing_sha512).
-behavi... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbit/src/rabbit_password_hashing_sha512.erl | erlang | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_password_hashing_sha512).
-behaviour(ra... | |
0e6f993821d8655a898b4c1a7d6e45b090a0baa0e13f1ef34510b4efac6e2d0b | sarabander/p2pu-sicp | 3.33.scm |
Depends on definitions in ch3.scm , section 3.3.5
(define a (make-connector))
(define b (make-connector))
(define c (make-connector))
(define (averager a b c)
(let ((s (make-connector))
(h (make-connector)))
(adder a b s)
(multiplier s h c)
(constant 1/2 h)
'ok))
(averager a b c)
(probe... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/3.3/3.33.scm | scheme |
Depends on definitions in ch3.scm , section 3.3.5
(define a (make-connector))
(define b (make-connector))
(define c (make-connector))
(define (averager a b c)
(let ((s (make-connector))
(h (make-connector)))
(adder a b s)
(multiplier s h c)
(constant 1/2 h)
'ok))
(averager a b c)
(probe... | |
2ec6919033d169afaf2fd30667da8571a2b4a19a305416ab4e8447336a6a2654 | manuel-serrano/hop | captured_vars.scm | ;*=====================================================================*/
* serrano / prgm / project / hop/2.5.x / scheme2js / captured_vars.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/scheme2js/captured_vars.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Free/bound variables property */
*===========================... | * serrano / prgm / project / hop/2.5.x / scheme2js / captured_vars.scm * /
* Author : * /
* Creation : 2007 - 13 * /
* Last change : Tue Jul 30 07:14:15 2013 ( serrano ) * /
* Copyr... |
55f32c230ff838d3e31d698ae17a76f9183c6fb1956834305e356169c7a11c09 | atdixon/me.untethr.nostr-relay | common.clj | (ns me.untethr.nostr.common
(:require [clojure.set :as set]
[clojure.tools.logging :as log]))
(defn indexable-tag-str?*
[^String s]
;; for now, we'll only index single lowercase ascii character tags, though
;; nip-12 specifies ambiguous "single-letter key"; we'll also reject queries
;; that don't... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-relay/724a2af1599b630de413d78555e70bc57073552c/src/me/untethr/nostr/common.clj | clojure | for now, we'll only index single lowercase ascii character tags, though
nip-12 specifies ambiguous "single-letter key"; we'll also reject queries
that don't use lowercase ascii for generic tags.
@see -protocol/nips/blob/master/12.md | (ns me.untethr.nostr.common
(:require [clojure.set :as set]
[clojure.tools.logging :as log]))
(defn indexable-tag-str?*
[^String s]
(.matches s "[a-z]"))
(def allowed-filter-tag-queries-set
(into #{}
(comp (map char) (map #(str "#" %)) (map keyword))
(range (int \a) (inc (int \z)))))
(def... |
6d68447d9a60566806aae3601fb477888829aa63745c5ac938f707ac5f11d771 | jarohen/yoyo | protocols.cljc | (ns ^{:clojure.tools.namespace.repl/load false
:clojure.tools.namespace.repl/unload false}
yoyo.system.protocols
(:require [cats.core :as c]
[cats.protocols :as cp]))
(declare dependent-monad)
(defprotocol IDependency
(get-dependent [_]))
(defrecord InitialDependency [id dependent-fn]
IDep... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/core/src/yoyo/system/protocols.cljc | clojure | Dependent a = Resolved a | Nested Key (System -> Dependent a) | Env (System -> Dependent a)
dbind :: Dependent a -> (a -> Dependent b) -> Dependent b
inner-f :: a -> Dependent b
f :: System -> Dependent a
returns :: Dependent b
(f system) :: Dependent a | (ns ^{:clojure.tools.namespace.repl/load false
:clojure.tools.namespace.repl/unload false}
yoyo.system.protocols
(:require [cats.core :as c]
[cats.protocols :as cp]))
(declare dependent-monad)
(defprotocol IDependency
(get-dependent [_]))
(defrecord InitialDependency [id dependent-fn]
IDep... |
2ac04fc3463ddce6f04c8157c0f5a7409629c820318e5c7290fd3048c5529597 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Quantity.ES.Tests
( tests
) where
import Data.String
import Test.Tasty
import Duckling... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Quantity/ES/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Quantity.ES.Tests
( tests
) where
import Data.String
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Quantity.ES.Corpus
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "ES Tests"
[ makeCorpusTest [Seal Q... |
fbebf78b5290397d32cf6a39a079988381e0ec6bbcc4c8aecdee805aff175a2b | cognitect-labs/vase | api.clj | (ns vase-component.api
(:require [com.stuartsierra.component :as component]
[com.cognitect.vase :as vase]))
(defrecord VaseAPI [api-root specs routes]
component/Lifecycle
(start [this]
(vase/ensure-schema specs)
(vase/specs specs)
(assoc this :routes (vase/routes api-root specs)))
(sto... | null | https://raw.githubusercontent.com/cognitect-labs/vase/d882bc8f28e8af2077b55c80e069aa2238f646b7/samples/vase-component/src/vase_component/api.clj | clojure | (ns vase-component.api
(:require [com.stuartsierra.component :as component]
[com.cognitect.vase :as vase]))
(defrecord VaseAPI [api-root specs routes]
component/Lifecycle
(start [this]
(vase/ensure-schema specs)
(vase/specs specs)
(assoc this :routes (vase/routes api-root specs)))
(sto... | |
9e31b4584e1453f7e99d4bf8a439b415fd1ea77ebfa928e4cf0dabe9060cea90 | ocaml/odoc | uwt_base.mli | This file is part of uwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
module Base : sig
type 'a uv_result = 'a
module Fs_types : sig
type uv_open_flag =
| O_RDONLY (** Open for reading *)
* Flags for { ! Fs_functions.openfile }
[ O_CLOEXE... | null | https://raw.githubusercontent.com/ocaml/odoc/244b5317d05eaa2815f8f5bd0fbc23e9caafd129/test/xref2/include_module_type_of.t/uwt_base.mli | ocaml | * Open for reading | This file is part of uwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
module Base : sig
type 'a uv_result = 'a
module Fs_types : sig
type uv_open_flag =
* Flags for { ! Fs_functions.openfile }
[ O_CLOEXEC ] does n't exist , because this flag ... |
8a38fbee4284766b5b05925b3a329593e2b735e9a0265206684e1a1d7a4847b4 | janestreet/bonsai | bonsai_drag_and_drop_example.ml | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
module Drag_and_drop = Bonsai_web_ui_drag_and_drop
module Node = Vdom.Node
module Style =
[%css
stylesheet
{|
.centered {
text-align: center;
}
.kanban_container {
display: flex;
flex-direction: row;
}
.kanban_column {
padding: ... | null | https://raw.githubusercontent.com/janestreet/bonsai/8643e8b3717b035386ac36f2bcfa4a05bca0d64f/examples/drag_and_drop/lib/bonsai_drag_and_drop_example.ml | ocaml | Only display items from this column or items that are being hovered
over this column; exclude any items that have been dragged away and
are hovered over a different column | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
module Drag_and_drop = Bonsai_web_ui_drag_and_drop
module Node = Vdom.Node
module Style =
[%css
stylesheet
{|
.centered {
text-align: center;
}
.kanban_container {
display: flex;
flex-direction: row;
}
.kanban_column {
padding: ... |
5f79de0fdfe8f28693addeb2fd81888e42e56d7f23f1b954b00271e60c5b66b0 | ryszard/clsql | example.lisp | -*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
Name : example.lisp
Purpose : Sample code for SQLite 3 initialization functions
Authors :
Created : Oct 2004
;;;;
$ Id$
;;... | null | https://raw.githubusercontent.com/ryszard/clsql/9aafcb72bd7ca1d7e908938b6a5319753b3371d9/examples/sqlite3/init-func/example.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
*************************************************************************
FILE IDENTIFICATION
(), also known as the LLGPL.
*************************************************************************
Load CLSQL.
Load sqlite3-utils.so library. See Makefile for librar... | Name : example.lisp
Purpose : Sample code for SQLite 3 initialization functions
Authors :
Created : Oct 2004
$ Id$
This file , part of CLSQL , is Copyright ( c ) 2004 by
CLSQL users are granted the rights to distribute and use this software
as governed by the terms of the Lisp Lesser GNU ... |
b606c951076ab1029665800b828e816d83c030d4fe633acdc65141d600e8b12a | kennytilton/its-alive | md-utilities.lisp | ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
#|
Cells -- Automatic Dataflow Managememnt
|#
(in-package :cells)
(defun md-awake (self) (eql :awake (md-state self)))
(defun fm-grandparent (md)
(fm-parent (fm-parent md)))
(defmethod md-release (other)
(declare (ignorable other)))
(export!... | null | https://raw.githubusercontent.com/kennytilton/its-alive/9a627c1b7f16efc005103985ce27a4bcdbab9fce/lisp/md-utilities.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
Cells -- Automatic Dataflow Managememnt
___________________ birth / death__________________________________
weird - let's folks function for not-to-be cleanup
(trx not-to-be!!!!!!! self)
(count-it! :live-cell id)
(count-it! :c-input id)
(trc "dd" c) |
(in-package :cells)
(defun md-awake (self) (eql :awake (md-state self)))
(defun fm-grandparent (md)
(fm-parent (fm-parent md)))
(defmethod md-release (other)
(declare (ignorable other)))
(export! mdead)
(defgeneric mdead (self)
(:method ((self model-object))
(eq :eternal-rest (md-state self))))
... |
7ab608608720d44071ee325886272cf00015c2d7bf5aceb6c744318df8f06e7f | rbermani/ib-api | Nums.hs |
module IB.Client.Nums where
no_valid_id = -1 :: Int
no_valid_error_code = 0 :: Int
client_version = 63 :: Int
server_version = 38 :: Int
min_server_ver_pta_orders = 39 :: Int
min_server_ver_fundamental_data = 40 :: Int
min_server_ver_under_comp = 40 :: Int
min_server_ver... | null | https://raw.githubusercontent.com/rbermani/ib-api/c303cb0384ca5dd255acb4da482206dea2b6576a/src/IB/Client/Nums.hs | haskell |
module IB.Client.Nums where
no_valid_id = -1 :: Int
no_valid_error_code = 0 :: Int
client_version = 63 :: Int
server_version = 38 :: Int
min_server_ver_pta_orders = 39 :: Int
min_server_ver_fundamental_data = 40 :: Int
min_server_ver_under_comp = 40 :: Int
min_server_ver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.