_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 |
|---|---|---|---|---|---|---|---|---|
818ab6638371c81254ee23da0edd6076ebadf12ff62ec9c7d28e19a0190b6942 | tweag/inline-js | Aeson.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
module Language.JavaScript.Inline.Aeson where
import qualified Data.Aeson as A
import Language.JavaScript.Inline.Core
| If a type @a@ has ' A.ToJSON ' and ' A.FromJSON ' instances , then we
-- can derive 'ToJS' and 'FromJS' instances for it using:
--
... | null | https://raw.githubusercontent.com/tweag/inline-js/ef675745e84d23d51c50660d40acf9e684fbb2d6/inline-js/src/Language/JavaScript/Inline/Aeson.hs | haskell | # LANGUAGE OverloadedStrings #
can derive 'ToJS' and 'FromJS' instances for it using:
extension | # LANGUAGE TypeFamilies #
module Language.JavaScript.Inline.Aeson where
import qualified Data.Aeson as A
import Language.JavaScript.Inline.Core
| If a type @a@ has ' A.ToJSON ' and ' A.FromJSON ' instances , then we
1 . @deriving ( ToJS , FromJS ) via ( Aeson a)@ , using the @DerivingVia@ extension
2 . @deriv... |
8947736c9e47a242590e47046374b27dfcf0b4648d583ea893e240edb9e56f09 | tonyg/kali-scheme | ps-syntax.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1998 by NEC Research Institute , Inc. See file COPYING .
; Redefine CASE so that it doesn't call MEMV
(define-syntax case
(lambda (e r c)
(let ((x (r 'x))
(xlet (r 'let))
(xcond (r 'cond))
(xif (r 'if))
(xeq? (r 'eq?))
(xquote (r 'q... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/ps-compiler/prescheme/ps-syntax.scm | scheme | Redefine CASE so that it doesn't call MEMV
RECEIVE (from big-scheme)
vector-posq
(syntax-error "unknown enumerand name" | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1998 by NEC Research Institute , Inc. See file COPYING .
(define-syntax case
(lambda (e r c)
(let ((x (r 'x))
(xlet (r 'let))
(xcond (r 'cond))
(xif (r 'if))
(xeq? (r 'eq?))
(xquote (r 'quote)))
(let ((test (lambda (y)
`... |
e5cd6aadf53f5febff30a70adbf40cc9eae54d4929bfed2440ce81a8bfb09177 | bhk/scam | envcomp.scm | ;;--------------------------------
;; envcomp.scm
;;--------------------------------
;; Analyze compression performance.
(require "core")
(require "gen")
(require "io")
(require "math.scm")
(require "string")
(require "compile.scm" &private)
;; Single character values that can be used to replace longer strings.
;; ... | null | https://raw.githubusercontent.com/bhk/scam/f2d46d8effc40eb00342ad2fc99c123197a42490/envcomp.scm | scheme | --------------------------------
envcomp.scm
--------------------------------
Analyze compression performance.
Single character values that can be used to replace longer strings.
Ideally, these should occur rarely or never in the environment.
"," is more expensive to quote.
+ `")
Escape codes that will replace ... |
(require "core")
(require "gen")
(require "io")
(require "math.scm")
(require "string")
(require "compile.scm" &private)
(define `subchars
(expect subchars
(uniq subchars))
(define `escape-codes
(addprefix
"!"
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"))
Count number of occurrences ... |
c27291fbd401129358f0ae84359156f64122b54efd3fa2ab3a8c1a5f46496edd | BinaryAnalysisPlatform/bap | arm_types.ml | open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
module Basic = Disasm_expert.Basic
exception Lifting_failed of string
type cond = [
| `EQ
| `NE
| `CS
| `CC
| `MI
| `PL
| `VS
| `VC
| `HI
| `LS
| `GE
| `LT
| `GT
| `LE
| `AL
] [@@deriving bin_io, compare, sexp, enumerate]
t... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/arm/arm_types.ml | ocaml | * General purpose registers
* conditition code registers
* Memory access operations
* Types for single-register memory access
* Types for multiple-register memory access
* Types for data movement operations
* shift types | open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap.Std
module Basic = Disasm_expert.Basic
exception Lifting_failed of string
type cond = [
| `EQ
| `NE
| `CS
| `CC
| `MI
| `PL
| `VS
| `VC
| `HI
| `LS
| `GE
| `LT
| `GT
| `LE
| `AL
] [@@deriving bin_io, compare, sexp, enumerate]
t... |
f465dac8d75a00b446fbfd9b93775e9f38e6985cda52b3d3b189f7d20465ab76 | BoeingX/haskell-programming-from-first-principles | LetUsWriteCode.hs | module MoreFunctionalPatterns.ChapterExercises.LetUsWriteCode where
Question 1
tensDigit :: Integral a => a -> a
tensDigit x = d
where (xLast, _) = x `divMod` 10
(_, d) = xLast `divMod` 10
hunsDigit :: Integral a => a -> a
hunsDigit x = d
where xLast = x `div` 100
d = xLast `mod... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/src/MoreFunctionalPatterns/ChapterExercises/LetUsWriteCode.hs | haskell | module MoreFunctionalPatterns.ChapterExercises.LetUsWriteCode where
Question 1
tensDigit :: Integral a => a -> a
tensDigit x = d
where (xLast, _) = x `divMod` 10
(_, d) = xLast `divMod` 10
hunsDigit :: Integral a => a -> a
hunsDigit x = d
where xLast = x `div` 100
d = xLast `mod... | |
b01fb50662932c227fe92d2460ceabc46c552222238ea67a7d826417770e7cfa | eeng/mercurius | withdraw_test.clj | (ns mercurius.wallets.domain.use-cases.withdraw-test
(:require [clojure.test :refer [deftest testing is]]
[spy.core :as spy]
[spy.assert :as assert]
[matcher-combinators.test]
[mercurius.support.factory :refer [build-user-id build-wallet]]
[mercurius.wallets... | null | https://raw.githubusercontent.com/eeng/mercurius/f83778ddde99aa13692e4fe2e70b2e9dc2fd70e9/test/mercurius/wallets/domain/use_cases/withdraw_test.clj | clojure | (ns mercurius.wallets.domain.use-cases.withdraw-test
(:require [clojure.test :refer [deftest testing is]]
[spy.core :as spy]
[spy.assert :as assert]
[matcher-combinators.test]
[mercurius.support.factory :refer [build-user-id build-wallet]]
[mercurius.wallets... | |
7a6d3e05c769cafe4cb4cc4bb9d9e446cd21f44e3833b6ed02f998ed1e57e663 | ghc/ghc | T22513d.hs | module T22513d where
f (Just (x :: id) :: Maybe id) = x | null | https://raw.githubusercontent.com/ghc/ghc/083f701553852c4460159cd6deb2515d3373714d/testsuite/tests/rename/should_compile/T22513d.hs | haskell | module T22513d where
f (Just (x :: id) :: Maybe id) = x | |
cd0a51c0a00d63376ebd2c73c6012c4e8ec87cd3d1856dcc3d9a46a661c3e096 | thi-ng/geom | subdivision.cljc | (ns thi.ng.geom.mesh.subdivision
(:require
[thi.ng.math.core :as m]
[thi.ng.geom.core :as g]
[thi.ng.geom.utils :as gu]
[thi.ng.geom.vector :as v :refer [vec3]]
[thi.ng.geom.gmesh :as gm]
[thi.ng.geom.triangle :as t]
[thi.ng.dstruct.core :as d]
[thi.ng.xerror.core :as err]
[clojure.core.red... | null | https://raw.githubusercontent.com/thi-ng/geom/85783a1f87670c5821473298fa0b491bd40c3028/src/thi/ng/geom/mesh/subdivision.cljc | clojure | Shared helpers
All subdivision methods as implemented here will currently only
types is planned, pending some further refactoring of existing mesh
graph functions.
Based on reference:
Doo-Sabin
This subdivision scheme will only work with pre-triangulated meshes.
The implementation does not check for this f... | (ns thi.ng.geom.mesh.subdivision
(:require
[thi.ng.math.core :as m]
[thi.ng.geom.core :as g]
[thi.ng.geom.utils :as gu]
[thi.ng.geom.vector :as v :refer [vec3]]
[thi.ng.geom.gmesh :as gm]
[thi.ng.geom.triangle :as t]
[thi.ng.dstruct.core :as d]
[thi.ng.xerror.core :as err]
[clojure.core.red... |
114a4b13f6dcd76761082ced3332a07b8ff76aefdda27e12103a201ba51d4af7 | framed-data/overseer | heartbeat_test.clj | (ns overseer.heartbeat-test
(:require [clojure.test :refer :all]
[clj-time.core :as clj-time]
[framed.std.time :as std.time]
[taoensso.timbre :as timbre]
[overseer.api :as api]
[overseer.core :as core]
[overseer.heartbeat :as heartbeat]
... | null | https://raw.githubusercontent.com/framed-data/overseer/f8e435c058047a88377dab1c608292d93e003ada/test/overseer/heartbeat_test.clj | clojure | (ns overseer.heartbeat-test
(:require [clojure.test :refer :all]
[clj-time.core :as clj-time]
[framed.std.time :as std.time]
[taoensso.timbre :as timbre]
[overseer.api :as api]
[overseer.core :as core]
[overseer.heartbeat :as heartbeat]
... | |
f488f7a7cac059646f36b5d011e511ad4f17dcc92e16c7dd7490ce3a31df46b1 | clojure-interop/google-cloud-clients | ResourceManagerRpcFactory.clj | (ns com.google.cloud.resourcemanager.spi.ResourceManagerRpcFactory
"An interface for Resource Manager RPC factory. Implementation will be loaded via ServiceLoader."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.resourcemanager.spi ResourceManagerRpcFactory]))
| null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.resourcemanager/src/com/google/cloud/resourcemanager/spi/ResourceManagerRpcFactory.clj | clojure | (ns com.google.cloud.resourcemanager.spi.ResourceManagerRpcFactory
"An interface for Resource Manager RPC factory. Implementation will be loaded via ServiceLoader."
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.resourcemanager.spi ResourceManagerRpcFactory]))
| |
89fa8feefacd7974f4406e08f974c650911a03b095385f8f9e500832b94e3007 | slipstream/SlipStreamServer | quota.cljc | (ns com.sixsq.slipstream.ssclj.resources.spec.quota
(:require
[clojure.spec.alpha :as s]
[com.sixsq.slipstream.db.filter.parser :as parser]
[com.sixsq.slipstream.ssclj.resources.spec.common :as c]
[com.sixsq.slipstream.ssclj.resources.spec.core :as cimi-core]
[com.sixsq.slipstream.ssclj.util.spec ... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi-resources/src/com/sixsq/slipstream/ssclj/resources/spec/quota.cljc | clojure | (ns com.sixsq.slipstream.ssclj.resources.spec.quota
(:require
[clojure.spec.alpha :as s]
[com.sixsq.slipstream.db.filter.parser :as parser]
[com.sixsq.slipstream.ssclj.resources.spec.common :as c]
[com.sixsq.slipstream.ssclj.resources.spec.core :as cimi-core]
[com.sixsq.slipstream.ssclj.util.spec ... | |
5a14db290127fce8d83d52cdb6ffe055ab7b80e165c9f5e9a81c16ea03602c1b | noloop/cacau | cl.lisp | (in-package #:noloop.cacau)
(defmacro defbefore-all (name options &body body)
(cond-options options
`(common-create-before-all
,name
,(if async-p
`(lambda (,async-done) ,@body)
`(lambda () ,@body))
:async-p ,async-p
:timeout ,timeout)))
(defmacro defafter-all (name ... | null | https://raw.githubusercontent.com/noloop/cacau/ba0fb36a284ded884f1dab0bd3f0f41ec14e3038/src/interfaces/cl.lisp | lisp | (in-package #:noloop.cacau)
(defmacro defbefore-all (name options &body body)
(cond-options options
`(common-create-before-all
,name
,(if async-p
`(lambda (,async-done) ,@body)
`(lambda () ,@body))
:async-p ,async-p
:timeout ,timeout)))
(defmacro defafter-all (name ... | |
543af95edc08f7079c9a5ef6ffb067ef8592cc9fd08d118863d8a052d945ba9e | racket/redex | mod-fx.rkt | #lang racket/base
(provide f)
(define x 'X!)
(define (f x) x)
| null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-doc/redex/scribblings/mod-fx.rkt | racket | #lang racket/base
(provide f)
(define x 'X!)
(define (f x) x)
| |
570100fae8e838265d40851677483df32c907369cc2eee410a60dd83c0b1405f | aowens-21/puzzler | sneaking-example.rkt | #lang puzzler
START_MAP
P#######
##B##G##
####B##T
########
##B#####
###GB###
##B####B
########
P#######
########
#######T
########
####B###
#######G
########
########
END_MAP
draw:
"P" -> "player.png"
"B" -> "rect"
"T" -> "coop.jpg"
"G" -> "guard.png"
action:
"P": "up" -> (0, 1)
"P": "down" -> (0, -1)
... | null | https://raw.githubusercontent.com/aowens-21/puzzler/be84df0049795acddf4eee0cc0225f0659df0445/examples/sneaking-example.rkt | racket | #lang puzzler
START_MAP
P#######
##B##G##
####B##T
########
##B#####
###GB###
##B####B
########
P#######
########
#######T
########
####B###
#######G
########
########
END_MAP
draw:
"P" -> "player.png"
"B" -> "rect"
"T" -> "coop.jpg"
"G" -> "guard.png"
action:
"P": "up" -> (0, 1)
"P": "down" -> (0, -1)
... | |
acaf0a8fd48634d4e121872fa743b76ab420b7b50de46537cb487f2d470dd53d | re-ops/re-core | provider.clj | (ns kvm.provider
"KVM virtualization provider for re-core"
(:refer-clojure :exclude [sync])
(:require
[clojure.core.strint :refer (<<)]
[re-share.config.core :refer (get!)]
[com.rpl.specter :as spec :refer (MAP-VALS ALL ATOM keypath)]
[clojure.core.incubator :refer (dissoc-in)]
[kvm.validations :r... | null | https://raw.githubusercontent.com/re-ops/re-core/865c267dbd2c8981a92d9477478ee650cff215b1/src/kvm/provider.clj | clojure | hotpluging volumes require guest kernel to be up
in case that the node is local host we can't ssh to our public ip! | (ns kvm.provider
"KVM virtualization provider for re-core"
(:refer-clojure :exclude [sync])
(:require
[clojure.core.strint :refer (<<)]
[re-share.config.core :refer (get!)]
[com.rpl.specter :as spec :refer (MAP-VALS ALL ATOM keypath)]
[clojure.core.incubator :refer (dissoc-in)]
[kvm.validations :r... |
47b94d51e40ec3079417a3dc4878f8cc41f0f43d67e10e04f1f209286458122d | finnishtransportagency/harja | puhtaat.cljc | (ns harja.ui.kartta.varit.puhtaat
(:require [harja.ui.kartta.varit :refer [rgb rgba]]
[clojure.set :as set]))
(def punainen (rgb 215 103 0))
(def oranssi (rgb 235 180 0))
(def keltainen (rgb 252 221 122))
(def magenta (rgb 246 143 202))
(def vihrea (rgb 50 203 50))
(def turkoosi (rgb 148 237 216))
(def s... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/6786a5b593f060415fd861f902190b14327b0d98/src/cljc/harja/ui/kartta/varit/puhtaat.cljc | clojure | (ns harja.ui.kartta.varit.puhtaat
(:require [harja.ui.kartta.varit :refer [rgb rgba]]
[clojure.set :as set]))
(def punainen (rgb 215 103 0))
(def oranssi (rgb 235 180 0))
(def keltainen (rgb 252 221 122))
(def magenta (rgb 246 143 202))
(def vihrea (rgb 50 203 50))
(def turkoosi (rgb 148 237 216))
(def s... | |
5df61c7ee5023410a6604a04097c303b045851c6c89b328d422e284c55b64e41 | geneweb/geneweb | calendar.ml | TODO this is probably buggy ,
because geneweb uses month|day = 0 for incomplete dates
because geneweb uses month|day = 0 for incomplete dates *)
* Convert [ Adef.date ] to Calendars.d
let to_calendars : Def.dmy -> Calendars.d =
fun { Def.day; month; year; delta; _ } -> { Calendars.day; month; year; delta }
... | null | https://raw.githubusercontent.com/geneweb/geneweb/5fc16b037954f40682a63b7c22a2403a894782ca/lib/util/calendar.ml | ocaml | TODO this is probably buggy ,
because geneweb uses month|day = 0 for incomplete dates
because geneweb uses month|day = 0 for incomplete dates *)
* Convert [ Adef.date ] to Calendars.d
let to_calendars : Def.dmy -> Calendars.d =
fun { Def.day; month; year; delta; _ } -> { Calendars.day; month; year; delta }
... | |
42ae1cafbf0d233cf92fb09a07dcc95d10a3e8c31d659769685a9390eacc9c01 | uwplse/Cassius | smt.rkt | #lang racket
(provide smt->string)
(define (smt->string query)
;(printf "~a\n\n\n" query)
(apply string-append
(for/list ([cmd query])
(match cmd
[(list 'echo comment) (format "; ~a\n" comment)]
[_ (format "~a\n" cmd)])))) ;; each block of constraings = cmd
| null | https://raw.githubusercontent.com/uwplse/Cassius/edcb8302c43b7b149280504c00672d8133219b44/src/print/smt.rkt | racket | (printf "~a\n\n\n" query)
each block of constraings = cmd | #lang racket
(provide smt->string)
(define (smt->string query)
(apply string-append
(for/list ([cmd query])
(match cmd
[(list 'echo comment) (format "; ~a\n" comment)]
|
a802fed193eefcba0ab526d3df93e55af72502edc624d8b6d7ae4cf48a487faa | diprism/perpl | Lib.hs | module Compile.Lib (compileFile) where
import Compile.Compile (compileFile)
| null | https://raw.githubusercontent.com/diprism/perpl/c3283f13ba5db2cd2a87c064231d88bf61a8236f/src/Compile/Lib.hs | haskell | module Compile.Lib (compileFile) where
import Compile.Compile (compileFile)
| |
cf12566e755efc29f2c0071126ff795f9ca825d5b90e773b693b52a0840fecfd | Haskell-Things/ImplicitCAD | Expr.hs | {- ORMOLU_DISABLE -}
Implicit CAD . Copyright ( C ) 2011 , ( )
Copyright ( C ) 2016 , ( )
-- Released under the GNU AGPLV3+, see LICENSE
-- allow us to specify what package to import what module from.
-- We don't actually care, but when we compile our haskell examples, we do.
{-# LANGUAGE PackageImports #-}
... | null | https://raw.githubusercontent.com/Haskell-Things/ImplicitCAD/bcc5ea9bed6139f06af57205dce2928adad1d2ba/Graphics/Implicit/ExtOpenScad/Eval/Expr.hs | haskell | ORMOLU_DISABLE
Released under the GNU AGPLV3+, see LICENSE
allow us to specify what package to import what module from.
We don't actually care, but when we compile our haskell examples, we do.
# LANGUAGE PackageImports #
Allow us to use string literals for Text
# LANGUAGE OverloadedStrings #
Patterns is the only... | Implicit CAD . Copyright ( C ) 2011 , ( )
Copyright ( C ) 2016 , ( )
module Graphics.Implicit.ExtOpenScad.Eval.Expr (evalExpr, rawRunExpr, matchPat, StateE, ExprState(ExprState), addMessage) where
import Prelude (String, Maybe(Just, Nothing), Bool (True), ($), elem, pure, zip, (&&), const, (<>), foldr, fo... |
e3d337ae645cf5ad7ff31fbfbf62cc43c6779bdb710443fbb46483eab6314ce1 | ahungry/ahungry-fleece | ahungry-fleece.lisp | - A utility library .
Copyright ( C ) 2016 < >
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;; (at your option) any later version.
;;... | null | https://raw.githubusercontent.com/ahungry/ahungry-fleece/1cef1d3a3aa9cffe9f06b7632006565bbc986814/src/ahungry-fleece.lisp | lisp |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General... | - A utility library .
Copyright ( C ) 2016 < >
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License
(in-package #:cl-user)
(defpackage ahu... |
72e47ee44371d3da0ce62265d83548acb319829b3b9d7a6faf8a3d98d4bc63ef | chethan/SICP | SimpsonsRule.hs | h a b n = (b-a)/n
yk f a h k = (f (a+ (k*h)))
summation func low high acc next | low > high = acc
| otherwise = summation func (next low) high (acc+(func low)) next
integral func low high n = let
h_temp = h low high n
yk_temp = yk func low h_temp
odd_sum = summation yk_temp 1 (n-1)... | null | https://raw.githubusercontent.com/chethan/SICP/ff83adc7e3e89e299c772080d32103f72ecf5dbf/Chapter1/SimpsonsRule.hs | haskell | h a b n = (b-a)/n
yk f a h k = (f (a+ (k*h)))
summation func low high acc next | low > high = acc
| otherwise = summation func (next low) high (acc+(func low)) next
integral func low high n = let
h_temp = h low high n
yk_temp = yk func low h_temp
odd_sum = summation yk_temp 1 (n-1)... | |
ddcdd5a12d7b0df90fd4e2e50aebd4e4a791883abb5eca4d284308b3dcefe8a1 | HaskellZhangSong/Introduction_to_Haskell_2ed_source | MonadOrder2.hs | # LANGUAGE DeriveFunctor #
import Control.Monad
import Control.Monad.State
import Control.Monad.Writer
pushWS :: Int -> WriterT String (State [Int]) ()
pushWS x = WriterT $ state $ \xs -> ((()," push "++ show x),x:xs)
popWS :: WriterT String (State [Int]) Int
popWS = WriterT $ state $ \(x:xs) -> ((x," pop ... | null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C13/MonadOrder2.hs | haskell | # LANGUAGE DeriveFunctor #
import Control.Monad
import Control.Monad.State
import Control.Monad.Writer
pushWS :: Int -> WriterT String (State [Int]) ()
pushWS x = WriterT $ state $ \xs -> ((()," push "++ show x),x:xs)
popWS :: WriterT String (State [Int]) Int
popWS = WriterT $ state $ \(x:xs) -> ((x," pop ... | |
e35f35f659b8a422f08cbbcae1199b98ae9bce33f3d7a933e262c06c10839102 | gillchristian/tailwind-purs | CLI.hs | module CLI where
import Options.Applicative ((<**>))
import qualified Options.Applicative as Opt
import qualified System.Directory as Dir
import System.FilePath ((</>))
data PursClassesOptions = PursClassesOptions
{ pursRoot :: FilePath,
pursSrc :: FilePath,
pursClasses :: FilePath,
pursOut :: FilePath,... | null | https://raw.githubusercontent.com/gillchristian/tailwind-purs/5db77c8755f1d8bdc8efd1217df673e8b9cc99b0/src/CLI.hs | haskell | module CLI where
import Options.Applicative ((<**>))
import qualified Options.Applicative as Opt
import qualified System.Directory as Dir
import System.FilePath ((</>))
data PursClassesOptions = PursClassesOptions
{ pursRoot :: FilePath,
pursSrc :: FilePath,
pursClasses :: FilePath,
pursOut :: FilePath,... | |
edf11838a03f6cd56c22353f988b52f543ad8aaafac6b8772008d080be77a839 | rmculpepper/racket-http123 | header.rkt | Copyright 2021
SPDX - License - Identifier : Apache-2.0
#lang racket/base
(require racket/class
racket/contract/base
racket/match
scramble/class
"interfaces.rkt"
"regexp.rkt"
"header-base.rkt"
(submod "util.rkt" ascii))
(provide (all-defined-out)
... | null | https://raw.githubusercontent.com/rmculpepper/racket-http123/313fecf225bf74d8a9a006601048ab76446b800b/http123-lib/private/header.rkt | racket | References:
- HTTP/1.1:
============================================================
Header object
Used to represent response header (and trailer).
- header - for entire thing (not "headers")
- field-name - left-hand side -- we use "key" instead
- field-value - right-hand side
--------------------------------... | Copyright 2021
SPDX - License - Identifier : Apache-2.0
#lang racket/base
(require racket/class
racket/contract/base
racket/match
scramble/class
"interfaces.rkt"
"regexp.rkt"
"header-base.rkt"
(submod "util.rkt" ascii))
(provide (all-defined-out)
... |
15406cf2eeff7097ad02351d2ea0e38b6f88aacd1ba230202122101410af75bb | input-output-hk/cardano-ledger | Utxo.hs | # LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE Undecidab... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/49a84725c4c2ecabc80f6dac215881bc23920962/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs | haskell | ======================================================
| Predicate failure for the Babbage Era
| The collateral is not equivalent to the total collateral asserted by the transaction
^ collateral provided
^ collateral amount declared in transaction body
| list of supplied transaction outputs that are too small,
t... | # LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE Undecidab... |
29b04ba8fb5c95bce9c0ec9358e04f6b345f62d1f051e79662f713842c3eaa1d | weavejester/valip | core.clj | (ns valip.test.core
(:use valip.core :reload)
(:use clojure.test))
(deftest validation-on-test
(let [p? (fn [x] {:pre [(> x 0)]} false)
v (validation-on :x p? "error")]
(is (= (v {:x 1}) {:x ["error"]}))
(is (nil? (v {:x 0})))))
(deftest validate-test
(is (= (validate {:x 17}
[:x (... | null | https://raw.githubusercontent.com/weavejester/valip/6d1e0d91dd787c1906d967354367f6ab57f63442/test/valip/test/core.clj | clojure | (ns valip.test.core
(:use valip.core :reload)
(:use clojure.test))
(deftest validation-on-test
(let [p? (fn [x] {:pre [(> x 0)]} false)
v (validation-on :x p? "error")]
(is (= (v {:x 1}) {:x ["error"]}))
(is (nil? (v {:x 0})))))
(deftest validate-test
(is (= (validate {:x 17}
[:x (... | |
93e41c2f29c02f64e039c4dcfe49d3ef0d8ab2335c33d171aadab1bdab1d0609 | caradoc-org/caradoc | predictor.ml | (*****************************************************************************)
(* Caradoc: a PDF parser and validator *)
Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
(* ... | null | https://raw.githubusercontent.com/caradoc-org/caradoc/100f53bc55ef682049e10fabf24869bc019dc6ce/src/stream/predictor.ml | ocaml | ***************************************************************************
Caradoc: a PDF parser and validator
This program is free software; you can redistribute it and/or modify
... | Copyright ( C ) 2015 ANSSI
Copyright ( C ) 2015 - 2017
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have rece... |
6fca9c02a310f09f7d05c31533b648e08a74ac736039fc2692d1b5b435d4b4bb | facebook/duckling | Corpus.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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Numeral.ES.ES.Corpus (allExamples) where
import Data.Str... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Numeral/ES/ES/Corpus.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.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Numeral.ES.ES.Corpus (allExamples) where
import Data.String
import Prelude
import Duckling.Numeral.Types
import Duckling.Testing.Types
allExamples :: [Example]
allExamples =
concat
[ examples (NumeralValue 1) ["1"]
, examples (NumeralValu... |
650285679dbbbbd4c9db6991fa7283e356bab73db84a8ebde2c2130840360f43 | jappeace/awesome-project-name | Xsrf.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Awe.Common.Xsrf where
import Data.Text
headerName :: Text
headerName = "X-XSRF"
cookieName :: Text
cookieName = headerName -- why should this be different
| null | https://raw.githubusercontent.com/jappeace/awesome-project-name/e80a52dc2673c748a922ec19945cf75368aa3a53/common/src/Awe/Common/Xsrf.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
why should this be different | # LANGUAGE DataKinds #
module Awe.Common.Xsrf where
import Data.Text
headerName :: Text
headerName = "X-XSRF"
cookieName :: Text
|
f298517364da9fa7b6b7db28b6aa4828519d0bbe1a7d4766c7a6e4142f45767f | russelldb/bigsets | comparator_play.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2015 ,
%%% @doc
%%% Quick/dirty by-eye testing of comparator
%%% @end
Created : 15 Oct 2015 by < >
%%%-------------------------------------------------------------------
-module(comparator_play).
-compile(export_all... | null | https://raw.githubusercontent.com/russelldb/bigsets/9e5e81e20e9f3a562044694cd6f28981317eba24/src/comparator_play.erl | erlang | -------------------------------------------------------------------
@doc
Quick/dirty by-eye testing of comparator
@end
-------------------------------------------------------------------
io:format("Key: ~p~n-Val: ~p~n", [K, V]),
BSRef, | @author < >
( C ) 2015 ,
Created : 15 Oct 2015 by < >
-module(comparator_play).
-compile(export_all).
-define(BS_DATA_DIR, "/tmp/comparator_play_bs/").
-define(DEF_DATA_DIR, "/tmp/comparator_play_def/").
-define(DATA_DIR, "/tmp/comparator_play/").
-define(WRITE_OPTS, [{sync, false}]).
-define(FOLD_OPTS... |
ce0878995e3fac5f6a73b1500195d02a095cab1e9b1d0cef1c0bee465022c607 | tfausak/exercism-solutions | Octal.hs | module Octal
( readOct
, showOct
) where
import Data.List (foldl')
readOct :: (Integral a) => String -> a
readOct = foldl' f 0 where
f n x = n * 8 + fromIntegral (fromEnum x - 48)
showOct :: (Integral a) => a -> String
showOct = reverse . showOct' where
showOct' 0 = ""
showOct' n = toEnum (fromIntegral r +... | null | https://raw.githubusercontent.com/tfausak/exercism-solutions/5e6f93979cc61ef5e3b48a09ca316dfd7fcd319c/haskell/octal/Octal.hs | haskell | module Octal
( readOct
, showOct
) where
import Data.List (foldl')
readOct :: (Integral a) => String -> a
readOct = foldl' f 0 where
f n x = n * 8 + fromIntegral (fromEnum x - 48)
showOct :: (Integral a) => a -> String
showOct = reverse . showOct' where
showOct' 0 = ""
showOct' n = toEnum (fromIntegral r +... | |
a61180403c802347bd58d363bea6edfe087a3f868b9f559af460c47b73001f52 | uw-unsat/leanette-popl22-artifact | matrix.rkt | #lang rosette
(require (prefix-in $ racket) "../lang/universe.rkt")
(provide (all-defined-out))
(struct matrix (entries) #:transparent)
(define (matrix-arity universe mat)
(define len (length (if (matrix? mat) (matrix-entries mat) mat)))
(exact-round ($/ (log len) (log (universe-size universe)))))
(define (tupl... | null | https://raw.githubusercontent.com/uw-unsat/leanette-popl22-artifact/80fea2519e61b45a283fbf7903acdf6d5528dbe7/rosette-benchmarks-3/memsynth/ocelot/engine/matrix.rkt | racket | #lang rosette
(require (prefix-in $ racket) "../lang/universe.rkt")
(provide (all-defined-out))
(struct matrix (entries) #:transparent)
(define (matrix-arity universe mat)
(define len (length (if (matrix? mat) (matrix-entries mat) mat)))
(exact-round ($/ (log len) (log (universe-size universe)))))
(define (tupl... | |
be7a9da16861cb6d097f9ea55e92fdfa58d68427829b6d9dc9a0ff74fc639136 | ucsd-progsys/dsolve | dotprod2.ml | let dotprod v1 v2 =
let sz = Array.length v1 in
let sum = ref 0 in
let i = ref 0 in
let rec loop i sum =
if i < sz then
( let get_v1_i = Array.get v1 i in
let get_v2_i = Array.get v2 i in
let get_prod_i = get_v1_i * get_v2_i in
let get_prod_i_plus_sum = get_prod_i + sum in
loop (i+1)... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/tests/PLDI2008/dotprod2.ml | ocaml | let dotprod v1 v2 =
let sz = Array.length v1 in
let sum = ref 0 in
let i = ref 0 in
let rec loop i sum =
if i < sz then
( let get_v1_i = Array.get v1 i in
let get_v2_i = Array.get v2 i in
let get_prod_i = get_v1_i * get_v2_i in
let get_prod_i_plus_sum = get_prod_i + sum in
loop (i+1)... | |
53abf20011d9ddbad387ca9828c648a16dcb0693c96aceed297ec76cd5e07016 | jacekschae/learn-re-frame-course-files | helpers.cljs | (ns app.helpers
(:require [cljs-time.core :as t]))
;; -would-time-ago-function-implementation-look-like-in-clojure
(defn time-ago
[timestamp]
(let [units [{:name "second" :limit 60 :in-second 1}
{:name "minute" :limit 3600 :in-second 60}
{:name "hour" :limit 86400 :in-second 3600}
... | null | https://raw.githubusercontent.com/jacekschae/learn-re-frame-course-files/a86e6f14b89c595b4389b03459539a9544af4e1d/increments/62-wire-spec/src/app/helpers.cljs | clojure | -would-time-ago-function-implementation-look-like-in-clojure | (ns app.helpers
(:require [cljs-time.core :as t]))
(defn time-ago
[timestamp]
(let [units [{:name "second" :limit 60 :in-second 1}
{:name "minute" :limit 3600 :in-second 60}
{:name "hour" :limit 86400 :in-second 3600}
{:name "day" :limit 604800 :in-second 86400}
... |
460d610ae334eb2b09d04c0d526b048394463949cf82d9e2b8eda55fbcf92784 | liquidz/jubot | schedule_test.clj | (ns jubot.schedule-test
(:require
[com.stuartsierra.component :as component]
[jubot.scheduler :refer :all]
[jubot.adapter :as ja]
[cronj.core :as c]
[conjure.core :refer [stubbing]]
[clojure.test :refer :all]))
(defn test-ns-fixture
[f]
(create-ns 'jubot.test.scheduler.a)
(... | null | https://raw.githubusercontent.com/liquidz/jubot/0a2d7b18db801c3fe72f7ff216e8381df9b40815/test/jubot/schedule_test.clj | clojure | (ns jubot.schedule-test
(:require
[com.stuartsierra.component :as component]
[jubot.scheduler :refer :all]
[jubot.adapter :as ja]
[cronj.core :as c]
[conjure.core :refer [stubbing]]
[clojure.test :refer :all]))
(defn test-ns-fixture
[f]
(create-ns 'jubot.test.scheduler.a)
(... | |
6f859ec7ae087cd4eaa655bfd12207f67a848d834804c22cdcb76601938444d9 | smart-chain-fr/tokenomia | Value.hs | # LANGUAGE LambdaCase #
# LANGUAGE TypeApplications #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE ImportQualifiedPost #
module Tokenomia.Common.Value
( getTokenFrom
, getTokensFrom
, assetClassValueOfWith
, containsAssetClass
, maximumAssetClassValueOf
, maximumByAss... | null | https://raw.githubusercontent.com/smart-chain-fr/tokenomia/eacde8e851a2e107c8a4a09ffe85cabaa4f52953/src/Tokenomia/Common/Value.hs | haskell | # LANGUAGE OverloadedStrings #
| Check if a value contains the right amount of an asset class.
| Maximum amount of an asset class in a list of values.
| Element with the maximum amount of an asset class in a list of values.
| Element with the maximum amount of an asset class in a list convertible to values. | # LANGUAGE LambdaCase #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE ImportQualifiedPost #
module Tokenomia.Common.Value
( getTokenFrom
, getTokensFrom
, assetClassValueOfWith
, containsAssetClass
, maximumAssetClassValueOf
, maximumByAssetClassValueOf
, maximumByAssetCl... |
6192861dbae0217f8f29ff6c45f77fa4d57af37724e03b32c8a3b4553218ff48 | metasoarous/oz | user.clj | (ns user
(:require [oz.server :as server]
[oz.core :as oz]
[cheshire.core :as json]
[clojure.pprint :as pp]))
;; Let Clojure warn you when it needs to reflect on types, or when it does math
;; on unboxed numbers. In both cases you should add type annotations to prevent
;; degraded... | null | https://raw.githubusercontent.com/metasoarous/oz/77e40391941c5eb68b6cf9662f47fdb8ba3276c9/dev/user.clj | clojure | Let Clojure warn you when it needs to reflect on types, or when it does math
on unboxed numbers. In both cases you should add type annotations to prevent
degraded performance.
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
Here is some example usage you can play with at the repl
Start the ... | (ns user
(:require [oz.server :as server]
[oz.core :as oz]
[cheshire.core :as json]
[clojure.pprint :as pp]))
(comment
(oz/start-server! 10666)
(defn play-data [& names]
(for [n names
i (range 20)]
{:time i :item n :quantity (+ (Math/pow (* i (count n... |
7dfa59a201771251269d1cd6d5f137e4edd7867b2053895fb57a3f06de108ff2 | riemann/riemann | expiration_test.clj | (ns riemann.expiration-test
(:require [riemann.expiration :refer :all]
[riemann.time :refer [unix-time]]
[riemann.time.controlled :refer :all]
[clojure.test :refer :all]))
(use-fixtures :once control-time!)
(use-fixtures :each reset-time!)
(deftest expiration-time-test
; Uncomm... | null | https://raw.githubusercontent.com/riemann/riemann/1649687c0bd913c378701ee0b964a9863bde7c7c/test/riemann/expiration_test.clj | clojure | Uncomment when we put in strict time requirements
(testing "no time" | (ns riemann.expiration-test
(:require [riemann.expiration :refer :all]
[riemann.time :refer [unix-time]]
[riemann.time.controlled :refer :all]
[clojure.test :refer :all]))
(use-fixtures :once control-time!)
(use-fixtures :each reset-time!)
(deftest expiration-time-test
( testi... |
f67cac261fdab139d17350d5c5d18d836f3dc63ce0190da52d3e6e6cdb1d7e70 | rurban/clisp | loadform.lisp | MAKE - LOAD - FORM for CLISP
2001 - 2004 , 2009 , 2017
2004
;; this could have been placed in in clos.lisp,
;; but `make-init-form' uses conditions
(in-package "CLOS")
(defun make-load-form-saving-slots
(object &key environment
(slot-names
(let ((slots (class-slots (class-of object))))
... | null | https://raw.githubusercontent.com/rurban/clisp/75ed2995ff8f5364bcc18727cde9438cca4e7c2c/src/loadform.lisp | lisp | this could have been placed in in clos.lisp,
but `make-init-form' uses conditions
Condition type thrown by make-load-form.
It's not sufficient to rely on method-call-error because a test like
(eq (method-call-error-generic-function err) #'make-load-form)
doesn't work when make-load-form is traced.
<-load-form... | MAKE - LOAD - FORM for CLISP
2001 - 2004 , 2009 , 2017
2004
(in-package "CLOS")
(defun make-load-form-saving-slots
(object &key environment
(slot-names
(let ((slots (class-slots (class-of object))))
(etypecase object
(standard-object
(mapcan (lambda (slot)
... |
24ce0af4031c27006726c629858fbcef87a631dcfae4117279c32061097fd0b3 | bucko909/erlcapnp | capnp_records.erl | -module(capnp_records).
-include_lib("capnp.hrl").
-export([
generate_record_def/4,
sort/1
]).
-import(capnp_common, [
encoder_name/2,
decoder_name/2,
full_decoder_name/2,
record_name/2,
envelope_fun_name/2,
field_name/1,
append/2,
to_atom/1,
make_atom/2
]).
-import(capnp_schema_wrangle, [... | null | https://raw.githubusercontent.com/bucko909/erlcapnp/813d314ec02f7ca634d4b296e2f57fecf67173d0/src/capnp_records.erl | erlang | Avoid mutual recursion.
or_undefined(Line, {type, Line, record, [make_atom(Line, TypeName)]})
or_undefined(Line, {type, Line, list, [{type, Line, record, [make_atom(Line, TypeName)]}]});
{type, Line, record, [make_atom(Line, record_name(TypeId, Schema))]} | -module(capnp_records).
-include_lib("capnp.hrl").
-export([
generate_record_def/4,
sort/1
]).
-import(capnp_common, [
encoder_name/2,
decoder_name/2,
full_decoder_name/2,
record_name/2,
envelope_fun_name/2,
field_name/1,
append/2,
to_atom/1,
make_atom/2
]).
-import(capnp_schema_wrangle, [... |
e4b6039ecb423e033881818d10aaac6ce65594c1f302a16effe1951976ad9405 | potatosalad/erlang-jose | jose_jwa_unsupported.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2022 ,
%%% @doc
%%%
%%% @end
Created : 10 Aug 2015 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/dbc4074066080692246afe613345ef6becc2a3fe/src/jwa/jose_jwa_unsupported.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
jose_block_encryptor callbacks
Public Key API
====================================================================
jose_block_encryptor c... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2022 ,
Created : 10 Aug 2015 by < >
-module(jose_jwa_unsupported).
-behaviour(jose_block_encryptor).
-export([block_decrypt/3]).
-export([block_decrypt/4]).
-export([block_encrypt/3]).
-expor... |
04ed86f27259079cbe1dc3f15102633301bbcf8822ff2dc912d0283d9cd9a33b | yrashk/rebar_elixir_plugin | rebar_elixir_compiler.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2009 , 2010 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of thi... | null | https://raw.githubusercontent.com/yrashk/rebar_elixir_plugin/7058379b7c7e017555647f6b9cecfd87cd50f884/src/rebar_elixir_compiler.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2009 , 2010 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions... |
0f5c698e435debb66c9c1df2b1d78dc5c0cf6f009f806e22f06b9769420b2e28 | neongreen/haskell-ex | Main.hs |
README
-- Trie
Construct a trie of all words in a dictionary .
Use it for searching words by prefix .
For example , a trie for words : cool , cat , coal , bet , bean .
b c
/ / \
e a o
/ \ / / \
t a t a o
| ... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week4/trie/jasonkuhrt/Main.hs | haskell | Trie
Trie
| Interactive search on the command line.
Index a dictionary of words.
For example:
> wordsToTrie ["bet", "be", "bean","beam"]
Node False (fromList [
('b', Node False (fromList [
('e', Node True (fromList [
('t', Empty),
('a', Node False (fromList [
('m', Empty)... |
README
Construct a trie of all words in a dictionary .
Use it for searching words by prefix .
For example , a trie for words : cool , cat , coal , bet , bean .
b c
/ / \
e a o
/ \ / / \
t a t a o
| | |
... |
36f6b4aee9584f8b07573e5b7668c218c9714e8d4ab1a6e45e9c945a970ad9f0 | mirage/ocaml-github | parse_events.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/ocaml-github/0196f078bfaa460f796b0512717851edf531e31b/lib_test/parse_events.ml | ocaml | so close for lexicographic sort... but they still managed to break it |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
5b21dc03030d33428f4897c8b7b360314ef485d8053c7256f515f6937fda3201 | ChrisPenner/react-tui | Vty.hs | # LANGUAGE LambdaCase #
module React.Vty where
import React
import React.CoreHooks
import React.Component
import Graphics.Vty as Vty
import Control.Concurrent.STM.TChan
import Control.Concurrent.STM
import Control.Monad
import Control.Concurrent.Async
import React.App
import Data.Typeable
import Data.Maybe
newtype Ev... | null | https://raw.githubusercontent.com/ChrisPenner/react-tui/141163f3731363767d8a520f3b470d17d638c6eb/src/React/Vty.hs | haskell | # LANGUAGE LambdaCase #
module React.Vty where
import React
import React.CoreHooks
import React.Component
import Graphics.Vty as Vty
import Control.Concurrent.STM.TChan
import Control.Concurrent.STM
import Control.Monad
import Control.Concurrent.Async
import React.App
import Data.Typeable
import Data.Maybe
newtype Ev... | |
e526214d9d19ba32f8455b3e8351d1238890f02a070d396b0601a3d01ff3e495 | drlivingston/kabob | labels.clj | (ns edu.ucdenver.ccp.kabob.query.labels
(use edu.ucdenver.ccp.kr.kb
edu.ucdenver.ccp.kr.rdf
edu.ucdenver.ccp.kr.sparql
edu.ucdenver.ccp.kr.unify
edu.ucdenver.ccp.utils
edu.ucdenver.ccp.kabob.query.util
edu.ucdenver.ccp.kabob.query.ids
edu.ucdenver.ccp.kabob.query.abst... | null | https://raw.githubusercontent.com/drlivingston/kabob/7038076849744c959da9c8507e8a8ab7215410aa/kabob-query/src/main/clojure/edu/ucdenver/ccp/kabob/query/labels.clj | clojure | --------------------------------------------------------
get shortest label
--------------------------------------------------------
--------------------------------------------------------
hgnc name
--------------------------------------------------------
the capture needs to start with a non digit
(this is to ... | (ns edu.ucdenver.ccp.kabob.query.labels
(use edu.ucdenver.ccp.kr.kb
edu.ucdenver.ccp.kr.rdf
edu.ucdenver.ccp.kr.sparql
edu.ucdenver.ccp.kr.unify
edu.ucdenver.ccp.utils
edu.ucdenver.ccp.kabob.query.util
edu.ucdenver.ccp.kabob.query.ids
edu.ucdenver.ccp.kabob.query.abst... |
1a0a33235f833459e5749fef617845d593f1334549a169f798a41ceb3004c980 | crategus/cl-cffi-gtk | file-chooser-preview.lisp | Example File Chooser Preview ( 2021 - 6 - 6 )
(in-package :gtk-example)
(defun create-file-chooser-preview ()
(let ((response nil)
(preview-width 256)
(preview-height 256)
(chooser (gtk-file-chooser-dialog-new "Example File Chooser Preview"
nil... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/b613a266a5f8e7f477b66a33d4df84fbed3dc7bc/demo/gtk-example/file-chooser-preview.lisp | lisp | Handler for the signal "upadate-preview"
Set the preview widget
Run the file chooser dialog | Example File Chooser Preview ( 2021 - 6 - 6 )
(in-package :gtk-example)
(defun create-file-chooser-preview ()
(let ((response nil)
(preview-width 256)
(preview-height 256)
(chooser (gtk-file-chooser-dialog-new "Example File Chooser Preview"
nil... |
14311aad036f01cc3467e74f677737c5ef9be28e2d1605f4a0cc86c13f9a3aa9 | wireapp/wire-server | CSV.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/72a03a776d4a8607b0a9c3e622003467be914894/libs/wire-api/test/unit/Test/Wire/API/Roundtrip/CSV.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
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
You should have received a copy of the GNU Affero General Public License along
module Test.Wire.API.Roundtrip.C... |
a1f8d107a22c7fa9c34a51306a63b41cf4c7e721efc5e0f034193133ca5859c6 | Happstack/boomerang | Pos.hs | {-# LANGUAGE DeriveDataTypeable, TypeFamilies #-}
module Text.Boomerang.Pos
( Pos
, InitialPosition(..)
, ErrorPosition(..)
, MajorMinorPos(..)
, incMajor, incMinor
)
where
import Data.Data (Data, Typeable)
-- | type synonym family that maps an error type to its position type
type family P... | null | https://raw.githubusercontent.com/Happstack/boomerang/fc819d93181b42002f4733262315a4eb5f1c2781/Text/Boomerang/Pos.hs | haskell | # LANGUAGE DeriveDataTypeable, TypeFamilies #
| type synonym family that maps an error type to its position type
| extract the position information from an error
| the initial position for a position type
| increment major position by 'i', reset minor position to 0..
if you wanted something else.. too bad.
| incr... | module Text.Boomerang.Pos
( Pos
, InitialPosition(..)
, ErrorPosition(..)
, MajorMinorPos(..)
, incMajor, incMinor
)
where
import Data.Data (Data, Typeable)
type family Pos err :: *
class ErrorPosition err where
getPosition :: err -> Maybe (Pos err)
class InitialPosition e where
... |
13c0314a77d427352ed33eefba65ce622c9e1a6aa739aae1a2090f8278ec8d6d | fresnel/fresnel | Run.hs | # LANGUAGE DisambiguateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TupleSections #
module Test.Run
( runEntries
) where
import Control.Carrier.Reader
import Control.Carrier.State.Church
import Control.Exception (SomeException... | null | https://raw.githubusercontent.com/fresnel/fresnel/d96d57da2bf82af90494b77712e29a1dbcc88b87/fresnel/test/Test/Run.hs | haskell | # LANGUAGE DisambiguateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TupleSections #
module Test.Run
( runEntries
) where
import Control.Carrier.Reader
import Control.Carrier.State.Church
import Control.Exception (SomeException... | |
9aed4cdf425b655b50505f0b056ceb67c2e5adf3e4490c3259479ebec174e14b | sph-mn/sph-lib | fibers.scm | (define-module (sph server fibers))
(use-modules (fibers) (sph) (sph server base) ((ice-9 threads) #:select (current-processor-count)))
(export server-listen-fibers server-socket-fibers sph-server-fibers-description)
(define sph-server-fibers-description
"a generic socket data processing server that uses fibers for ... | null | https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/modules/sph/server/fibers.scm | scheme | (define-module (sph server fibers))
(use-modules (fibers) (sph) (sph server base) ((ice-9 threads) #:select (current-processor-count)))
(export server-listen-fibers server-socket-fibers sph-server-fibers-description)
(define sph-server-fibers-description
"a generic socket data processing server that uses fibers for ... | |
4fb886ff56849ec41ce7fc88b6cd23fd16d2e6b274ed80b6bc08200708213151 | screenshotbot/screenshotbot-oss | test-copy-file.lisp | ;;;; Copyright 2018-Present Modern Interpreters Inc.
;;;;
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 /.
(defpackage :util/tests/test-copy-file
(:use #:cl
#:fiveam)
(:import-from... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/2279a097f3e0f733ba30ebca1e5b1c9c84ecb968/src/util/tests/test-copy-file.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
This guards against the possibility that both src and dest point
to the same file. If that happens, then we'll rewrite the file,
and during the rewrite the file might be in a bad state.
This test depends on a very specific directory layout, so it's
disable for now. | 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 /.
(defpackage :util/tests/test-copy-file
(:use #:cl
#:fiveam)
(:import-from #:util/copy-file
#:copy-file-fast)
(:im... |
862a2adc4a3244114512428f0629c98f54cd7ad04c6457e0274e87e1cdb443aa | marcelocra/chrome-extension-cljs | watch-background.clj | (require 'cljs.build.api)
(cljs.build.api/watch "src/chrome_extensions/background"
{:output-dir "out/background/"
:output-to "out/background/background.js"
:optimizations :advanced
; :optimizations :whitespace
... | null | https://raw.githubusercontent.com/marcelocra/chrome-extension-cljs/2a7950dfacfe69f741d4588a2b800c1ad8b823d9/references/0.0.3-cljs-no-tools-implementation/watch-background.clj | clojure | :optimizations :whitespace
:pseudo-names true
:static-fns true | (require 'cljs.build.api)
(cljs.build.api/watch "src/chrome_extensions/background"
{:output-dir "out/background/"
:output-to "out/background/background.js"
:optimizations :advanced
:pretty-print true
:verb... |
2ef1d8d5e26e0ca3fc9edd28763492f0369058bd9cae0763497d5528519451b4 | shop-planner/shop3 | p12.lisp | (in-package :shop-openstacks)
#.(make-problem 'OS-SEQUENCEDSTRIPS-P20_3 'OPENSTACKS-SEQUENCEDSTRIPS-ADL-INCLUDED '((NEXT-COUNT
N0
N1)
... | null | https://raw.githubusercontent.com/shop-planner/shop3/ba429cf91a575e88f28b7f0e89065de7b4d666a6/shop3/examples/openstacks-adl/p12.lisp | lisp | (in-package :shop-openstacks)
#.(make-problem 'OS-SEQUENCEDSTRIPS-P20_3 'OPENSTACKS-SEQUENCEDSTRIPS-ADL-INCLUDED '((NEXT-COUNT
N0
N1)
... | |
0ac1a7c7b517c2f8691720d2975fe6b29236c830b842b67b12ab145e48f86ca0 | startalkIM/ejabberd | mod_register_web.erl | %%%-------------------------------------------------------------------
%%% File : mod_register_web.erl
Author : >
%%% Purpose : Web page to register account and related tasks
Created : 4 May 2008 by >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; ... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/mod_register_web.erl | erlang | -------------------------------------------------------------------
File : mod_register_web.erl
Purpose : Web page to register account and related tasks
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that ... | Author : >
Created : 4 May 2008 by >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
wit... |
ef9fbbda41036795c4b794d3a4ecc2ead66dd7cf56b984733fea76c25ad22a3a | froggey/Mezzano | disk.lisp | Generic interface for disks and other superviser - level block devices
(in-package :mezzano.supervisor)
;;; External API:
;;; ALL-DISKS - Return a list of all disks in the systems. List might not be fresh.
;;; DISK-WRITABLE-P - Return true if a disk is writable.
;;; DISK-N-SECTORS - Number of sectors on the disk.
;... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/supervisor/disk.lisp | lisp | External API:
ALL-DISKS - Return a list of all disks in the systems. List might not be fresh.
DISK-WRITABLE-P - Return true if a disk is writable.
DISK-N-SECTORS - Number of sectors on the disk.
DISK-SECTOR-SIZE - Size of a disk sector in octets.
DISK-READ - Read sectors.
DISK-WRITE - Write sectors.
MAKE-DISK-R... | Generic interface for disks and other superviser - level block devices
(in-package :mezzano.supervisor)
(sys.int::defglobal *log-disk-requests* nil)
(defstruct (disk
(:area :wired))
device
writable-p
n-sectors
sector-size
max-transfer
read-fn
write-fn
flush-fn
(valid t)
name)
(de... |
23719c8a988dafdf9a70fac0295570a0e61052943bc6a667aa7154379e28e83e | theodormoroianu/SecondYearCourses | HaskellChurch_20210415163843.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163843.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always chooses the first alternativ... |
89dcdd8440630eed2e6696ace2d4fb9e73d0ea7d5ab7e47b56168e4376c2fa7c | thma/srv | DemoCertificate.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module DemoCertificate
( demoTLSSettings,
)
where
-
This module provides a self signed certificate for testing the https server .
It was generated with the following commands :
openssl genrsa -out key.pem 2048
openssl x509 -req... | null | https://raw.githubusercontent.com/thma/srv/0eb4fd1367f6bfd364d6773ec284e2a5cc015557/app/DemoCertificate.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
}
---BEGIN CERTIFICATE-----
---END CERTIFICATE-----|]
---BEGIN RSA PRIVATE KEY-----
---END RSA PRIVATE KEY-----|] |
module DemoCertificate
( demoTLSSettings,
)
where
-
This module provides a self signed certificate for testing the https server .
It was generated with the following commands :
openssl genrsa -out key.pem 2048
openssl x509 -req -in certificate.csr -signkey key.pem -out certificate.pem
-
This m... |
005c48426f89522e4418b56cd3609ebba45347ca4ff0bb6c2eec259a60ce9f65 | rescript-association/genType | string_map.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-association/genType/c44251e969fb10d27a38d2bdeff6a5f4d778594f/src/compiler-libs-406/string_map.mli | ocaml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | |
642a8e3e297181d09bcba653c3bd175804b78bc18f47dc3c3af4710904c0a670 | TrustInSoft/tis-kernel | state_topological.mli | (**************************************************************************)
(* *)
: a generic graph library for ocaml
Copyright ( C ) 2004 - 2012
, and
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/libraries/project/state_topological.mli | ocaml | ************************************************************************
This library is free software; you can redistribute it and/or
... | : a generic graph library for ocaml
Copyright ( C ) 2004 - 2012
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , as published by the Free Software Foundation .
See th... |
5cc04eababdb47592f482c15b42aeef8da343823470540e3bdcf4d93eaac3af3 | OCamlPro/ocplib-resto | ezRestoDirectory.ml | (**************************************************************************)
(* ocplib-resto *)
Copyright ( C ) 2016 , OCamlPro .
(* *)
(* All r... | null | https://raw.githubusercontent.com/OCamlPro/ocplib-resto/9c84b7432cee499a2057e372c4d619daeb0b9d6a/src/ezRestoDirectory.ml | ocaml | ************************************************************************
ocplib-resto
All rights reserved. This file is distributed under the terms
special exception on lin... | Copyright ( C ) 2016 , OCamlPro .
of the GNU Lesser General Public License version 2.1 , with the
open Resto
open RestoDirectory
open Lwt
module Answer = RestoDirectory.Answer
open RestoDirectory.Answer
exception Cannot_parse = RestoDirectory.Cannot_parse
type ... |
c2de5dc2ed9aceb853dacc7d16eb56000b38b36a2a6b4f097d64bcc96bc87804 | diffusionkinetics/open | Pretty.hs | {-# LANGUAGE OverloadedStrings #-}
module Dampf.AppFile.Pretty
( pShowDampfApp
) where
import Control.Lens
import Data.List (intersperse)
import qualified Data.Map.Strict as Map
import Data.Text (Text)
import qualified Data.Text as T
import ... | null | https://raw.githubusercontent.com/diffusionkinetics/open/597ef520bb42c4747576032be2f7e3046ca66178/dampf/lib/Dampf/AppFile/Pretty.hs | haskell | # LANGUAGE OverloadedStrings # |
module Dampf.AppFile.Pretty
( pShowDampfApp
) where
import Control.Lens
import Data.List (intersperse)
import qualified Data.Map.Strict as Map
import Data.Text (Text)
import qualified Data.Text as T
import Text.PrettyPrint
import ... |
3729381bd9a5689a3e99eb882c59465c56f92e6de4293a0b63a113d7730c963a | TempusMUD/cl-tempus | act-movement.lisp | (in-package #:tempus)
(defun abs-exit (room dir)
(aref (dir-option-of room) dir))
(defun exit (ch dir)
(abs-exit (in-room-of ch) dir))
(defun first-word (str)
(let ((space-pos (position #\space str)))
(if space-pos
(subseq str 0 space-pos)
str)))
(defun find-door (ch args action)
(destruc... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/actions/act-movement.lisp | lisp | If this room or the one we're going to needs wings, check for some
creature must be flying at this point
success | (in-package #:tempus)
(defun abs-exit (room dir)
(aref (dir-option-of room) dir))
(defun exit (ch dir)
(abs-exit (in-room-of ch) dir))
(defun first-word (str)
(let ((space-pos (position #\space str)))
(if space-pos
(subseq str 0 space-pos)
str)))
(defun find-door (ch args action)
(destruc... |
dbc775664e02edc872aff4bdfb2a7e1eeda48bc1011abf1fc617300fa4c6e727 | tbarnetlamb/hyphen | HyphenExceptions.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE ExistentialQuantification #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RankNTypes #-}
module HyphenExceptions (translatePyException, translatePyExceptionIfAny,
translatingHsExcepts, captureAsyncExceptions... | null | https://raw.githubusercontent.com/tbarnetlamb/hyphen/9f8b5a7adba525e770df1fb8c72475467e7497d2/hyphen/lowlevel_src/HyphenExceptions.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
| This module provides for translating exceptions from Python to
Haskell and back again.
The basic plan for doing so is as follows. When Python exceptions
run up the stack until it hits Python code again. This basically
code---it's only in rare cases (wrappi... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE ExistentialQuantification #
# LANGUAGE GeneralizedNewtypeDeriving #
module HyphenExceptions (translatePyException, translatePyExceptionIfAny,
translatingHsExcepts, captureAsyncExceptions) where
import System.IO.Error (isEOFError)
import System.Exit
... |
7de4f743f2362a60c3db9f609a656dffae1672f2c21f050e4b268178a9c696e3 | phaul/chess | Board.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE Rank2Types #-}
-- | Representation of the current state of the game
module Chess.Board.Board
( Board
-- * Constructors
, emptyBoard
-- * Data manipulation
, flipPiece
, removePiece
-- ** Lenses
, next
, Chess.Board.Board.opponent
, enPassant
, w... | null | https://raw.githubusercontent.com/phaul/chess/b9c71a0389ed44360caed4b830208ce346211cb8/Chess/Board/Board.hs | haskell | # LANGUAGE Rank2Types #
| Representation of the current state of the game
* Constructors
* Data manipulation
** Lenses
* Queries
* Utilities
* QuickCheck
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| A ... | # LANGUAGE TemplateHaskell #
module Chess.Board.Board
( Board
, emptyBoard
, flipPiece
, removePiece
, next
, Chess.Board.Board.opponent
, enPassant
, whiteCastleRights
, blackCastleRights
, hash
, castleRightsByColour
, pawns
, piecesByColour
, pieceAt
, pieceColo... |
fc6995482593287ba7a51fc47dd0a294fe8285d110952cc375f37f16061295b0 | huangz1990/real-world-haskell-cn | SafeHello.hs | file : ch15 / SafeHello.hs
safeHello :: MonadHandle h m => FilePath -> m ()
safeHello path = do
h <- openFile path WriteMode
hPutStrLn h "hello world"
hClose h | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch15/SafeHello.hs | haskell | file : ch15 / SafeHello.hs
safeHello :: MonadHandle h m => FilePath -> m ()
safeHello path = do
h <- openFile path WriteMode
hPutStrLn h "hello world"
hClose h | |
d6feff8754cfce9293d33e098b6496b3bea4798c818114a668a8b4569522f126 | vivid-inc/ash-ra-template | project.clj | (defproject example-override-clojure-version "0"
:plugins [[net.vivid-inc/lein-art "0.6.1"]]
:art {:templates "templates"
:dependencies {org.clojure/clojure {:mvn/version "1.10.1"}}
:output-dir "target"})
| null | https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/examples/override-clojure-version/project.clj | clojure | (defproject example-override-clojure-version "0"
:plugins [[net.vivid-inc/lein-art "0.6.1"]]
:art {:templates "templates"
:dependencies {org.clojure/clojure {:mvn/version "1.10.1"}}
:output-dir "target"})
| |
74a6f417faebec8c08ab901eccbaaa0bb41a22b89a5519706207f95ee083eb4c | clojure-emacs/refactor-nrepl | ns_with_gen_class_methods_meta.clj | (ns ns-with-gen-class-methods-meta
(:gen-class
:methods [^:static [foo [String] String]
^{:test true} [bar [String] String]
^{:other "text"} [baz [String] String]]
:name Name)
(:require [clojure.string :as s]
[clojure.pprint :refer [fresh-line]]))
(defn useit
[]
(fre... | null | https://raw.githubusercontent.com/clojure-emacs/refactor-nrepl/8457b0341fdb220d4cba577ed150565e4d103364/test-resources/ns_with_gen_class_methods_meta.clj | clojure | (ns ns-with-gen-class-methods-meta
(:gen-class
:methods [^:static [foo [String] String]
^{:test true} [bar [String] String]
^{:other "text"} [baz [String] String]]
:name Name)
(:require [clojure.string :as s]
[clojure.pprint :refer [fresh-line]]))
(defn useit
[]
(fre... | |
24568408172d1209910679bebbc2f40a9e72cfbab44e619ce113b0211e79e5a1 | haskell-servant/servant | Alternative.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_HADDOCK not-home #-}
module Servant.API.Alternative ((:<|>)(..)) where
import ... | null | https://raw.githubusercontent.com/haskell-servant/servant/0b706aa6d171c59e010f4ea585c8c59529a8f7df/servant/src/Servant/API/Alternative.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveTraversable #
# LANGUAGE TypeOperators #
# OPTIONS_HADDOCK not-home #
Example:
>>> :{
GET /books
:<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () ... | module Servant.API.Alternative ((:<|>)(..)) where
import Control.Applicative (liftA2)
import Data.Biapplicative
(Biapplicative (..))
import Data.Bifoldable
(Bifoldable (..))
import Data.Bifunctor
(Bifunctor (..))
import ... |
a106005e87c4008e535ed0eee972a8804099608aa8187d3c03c37e8c0de7d174 | jrclogic/SMCDEL | Translations.hs | module Main (main) where
import Data.Dynamic (toDyn)
import Data.List (sort)
import Test.Hspec
import Test.Hspec.QuickCheck
import SMCDEL.Internal.Help (alleq)
import SMCDEL.Language
import SMCDEL.Symbolic.S5 as Sym
import SMCDEL.Explicit.S5 as Exp
import SMCDEL.Translations.S5
import SMCDEL.Examples
import SMCDEL.In... | null | https://raw.githubusercontent.com/jrclogic/SMCDEL/b47d68e7059d942a1f4586834360bbc99f24ff80/test/Translations.hs | haskell | apply equivalent transformer to equivalent kns | module Main (main) where
import Data.Dynamic (toDyn)
import Data.List (sort)
import Test.Hspec
import Test.Hspec.QuickCheck
import SMCDEL.Internal.Help (alleq)
import SMCDEL.Language
import SMCDEL.Symbolic.S5 as Sym
import SMCDEL.Explicit.S5 as Exp
import SMCDEL.Translations.S5
import SMCDEL.Examples
import SMCDEL.In... |
5effb12b0fc35961cabb92b2eaeadfb3fcbebb9f31f31bc4569c3984e2771807 | rizo/snowflake-os | time.ml |
Time
let read addr =
Asm.out8 0x70 addr;
Asm.in8 0x71
let write addr value =
Asm.out8 0x70 addr;
Asm.out8 0x71 value
module R = struct
let second = 0x00
let minute = 0x02
let hour = 0x04
let weekday = 0x06
let day = 0x07
let month = 0x08
let year = 0x09
let century = 0x32
end
let... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/time.ml | ocaml |
Time
let read addr =
Asm.out8 0x70 addr;
Asm.in8 0x71
let write addr value =
Asm.out8 0x70 addr;
Asm.out8 0x71 value
module R = struct
let second = 0x00
let minute = 0x02
let hour = 0x04
let weekday = 0x06
let day = 0x07
let month = 0x08
let year = 0x09
let century = 0x32
end
let... | |
42819a75dca923ad2b38af8370abe1ceee66d238024b4f5aaa2debcce458d4cb | eponai/sulolive | local_storage.cljc | (ns eponai.client.local-storage
#?(:cljs (:require [cognitect.transit :as transit])))
(defprotocol ILocalStorage
(set-item! [this name item])
(get-item [this name])
(remove-item! [this name]))
(defn ->local-storage
"Local storage wrapper which can read and write clojure values.
Using transit on cljs side ... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/client/local_storage.cljc | clojure | (ns eponai.client.local-storage
#?(:cljs (:require [cognitect.transit :as transit])))
(defprotocol ILocalStorage
(set-item! [this name item])
(get-item [this name])
(remove-item! [this name]))
(defn ->local-storage
"Local storage wrapper which can read and write clojure values.
Using transit on cljs side ... | |
d5b6cc2c22c6750dbeaeda0e3c740c9c1ff409bf23283942116cce9048a466d3 | arybczak/ghc-tags | ETag.hs | module GhcTags.ETag
( module X
, compareTags
) where
import Data.Function (on)
import GhcTags.ETag.Formatter as X
import GhcTags.ETag.Parser as X
import GhcTags.Tag ( Tag (..)
, ETag
)
| Order ' ETag 's acc... | null | https://raw.githubusercontent.com/arybczak/ghc-tags/994c748a4c0a71110dd3c39cc4d5680f1afb7401/src/GhcTags/ETag.hs | haskell | module GhcTags.ETag
( module X
, compareTags
) where
import Data.Function (on)
import GhcTags.ETag.Formatter as X
import GhcTags.ETag.Parser as X
import GhcTags.Tag ( Tag (..)
, ETag
)
| Order ' ETag 's acc... | |
d99f352376449cf9cd6f3959400e020d306456d1f7f90ea42262919a4114b1a6 | kupl/VeriSmart-public | transaction.ml | open Lang
open Vocab
type t = int * Path.t
and transaction = t
let get_tid (tid,path) = tid
let get_path (tid,path) = path
let to_string_internal_tseq : Global.t -> transaction -> string
= fun global (tid,path) ->
let f = FuncMap.find (Path.get_fkey path) global.fmap in
let g = get_cfg f in
let enodes = List.f... | null | https://raw.githubusercontent.com/kupl/VeriSmart-public/99be7ba88b61994f1ed4c0d3a8e6a6db0f790431/src/exploit/transaction.ml | ocaml | open Lang
open Vocab
type t = int * Path.t
and transaction = t
let get_tid (tid,path) = tid
let get_path (tid,path) = path
let to_string_internal_tseq : Global.t -> transaction -> string
= fun global (tid,path) ->
let f = FuncMap.find (Path.get_fkey path) global.fmap in
let g = get_cfg f in
let enodes = List.f... | |
7a7c1a69de32a9374eb3bec2db5976240a83c3b0ab58852b210a55c43c5007e9 | simingwang/emqx-plugin-kafkav5 | qlc_pt.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2004 - 2021 . 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/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/stdlib-3.17.1/src/qlc_pt.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 2004 - 2021 . 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(qlc_pt).
-export([parse_transform/2, transform_from_evaluator/2,
transform_expression/2]).
-inclu... |
687a40725ce939f7a46975ee855def0049878e93a1359fa894e0fc9a199f1f27 | LuxLang/lux | host.clj | This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 .
If a copy of the MPL was not distributed with this file , You can obtain one at /.
(ns lux.compiler.jvm.proc.host
(:require (clojure [string :as string]
[set :as set]
[template :refer ... | null | https://raw.githubusercontent.com/LuxLang/lux/91bc060bc498a0d2418198cfcb9dc39636d1d867/lux-bootstrapper/src/lux/compiler/jvm/proc/host.clj | clojure | [Utils]
&type/Any
[Resources]
else
else
(&/$End) special-args
(&/$End) special-args
(&/$End) special-args
(&/$End) special-args
(&/$End) special-args
(&/$End) special-args
(&/$End) ?values
(&/$End) special-args
(&/$End) special-args
(&/$End) special-args
(&/$End) ?values
else | This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 .
If a copy of the MPL was not distributed with this file , You can obtain one at /.
(ns lux.compiler.jvm.proc.host
(:require (clojure [string :as string]
[set :as set]
[template :refer ... |
3067eb7c5a784ae648747b9314aec5c1fcf8ce311ed6a2f95f44fe62c76536f2 | hercules-ci/hercules-ci-agent | ClientInfo.hs | # LANGUAGE DataKinds #
module Hercules.API.ClientInfo where
import Hercules.API.ClientInfo.ClientInfo (ClientInfo)
import Hercules.API.Prelude
import Servant.API
data ClientInfoAPI auth f = ClientInfoAPI
{ getClientInfo ::
f
:- "client"
:> "info"
:> auth
:> Get '[JSON] C... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/b3f8aa8e4a8b22dbbe92cc5a89e6881090b933b3/hercules-ci-api/src/Hercules/API/ClientInfo.hs | haskell | # LANGUAGE DataKinds #
module Hercules.API.ClientInfo where
import Hercules.API.ClientInfo.ClientInfo (ClientInfo)
import Hercules.API.Prelude
import Servant.API
data ClientInfoAPI auth f = ClientInfoAPI
{ getClientInfo ::
f
:- "client"
:> "info"
:> auth
:> Get '[JSON] C... | |
87e7f1807dd750f9bccc0d0f356c9113afe63f214fe5cbd46bec717b5bc22d5e | sweirich/pi-forall | Parser.hs | {- pi-forall language -}
-- | A parsec-based parser for the concrete syntax
module Parser
( parseModuleFile,
parseModuleImports,
parseExpr,
expr,
decl,
testParser,
)
where
import Control.Monad.Except (MonadError (throwError))
import Control.Monad.State.Lazy hiding (join)
import Data.List (fold... | null | https://raw.githubusercontent.com/sweirich/pi-forall/93de2eee777c9123bf67534b7b8453656370542d/version1/src/Parser.hs | haskell | pi-forall language
| A parsec-based parser for the concrete syntax
| Parse a module declaration from the given filepath.
| Test an 'LParser' on a String.
| Parse an expression.
The internal state for generating fresh names,
the type of the object being parsed
-
- Top level declarations
-
----------------------
... |
module Parser
( parseModuleFile,
parseModuleImports,
parseExpr,
expr,
decl,
testParser,
)
where
import Control.Monad.Except (MonadError (throwError))
import Control.Monad.State.Lazy hiding (join)
import Data.List (foldl')
import LayoutToken qualified as Token
import Syntax hiding (moduleImport... |
e40cb2a99b10e1633c6e3e872a9eddc6675618f5aa724878ea8e90efbd5309b3 | funkywork/nightmare | nightmare_dream.mli | MIT License
Copyright ( c ) 2023 funkywork
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to... | null | https://raw.githubusercontent.com/funkywork/nightmare/9345e7d6b0886afa7af8f0b37ce24f99798ff5ed/lib/dream/nightmare_dream.mli | ocaml | * [Nightmare] is a {i relatively} independent overlay, the [Nightmare_dream]
package provides the necessary glue to integrate into a web application
developed with {{:/} Dream}.
* {1 Types}
Some common type aliases to simplify function signatures.
* [router ~services fallback request] defines a [Middlewar... | MIT License
Copyright ( c ) 2023 funkywork
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to... |
2933139488ed52dff0855cecdda08e8dbb17d39e8376a435c80fe261992ad403 | ku-fpg/kansas-lava-cores | FIFO.hs | # LANGUAGE ScopedTypeVariables , TypeFamilies , FlexibleContexts #
module FIFO (tests) where
import Language.KansasLava
import Language.KansasLava.Test
import Hardware.KansasLava.FIFO (fifo)
import Data.Sized.Unsigned
import System.Random
import Data.Ratio
import Data . Maybe
import Debug.Trace
tests :: TestSeq -> I... | null | https://raw.githubusercontent.com/ku-fpg/kansas-lava-cores/028439463b491e691fa4fdcd5e068fdfa2987890/tests/FIFO.hs | haskell | testing FIFOs
trace (show ("cc",length ins,length outs)) $
- Hmm | # LANGUAGE ScopedTypeVariables , TypeFamilies , FlexibleContexts #
module FIFO (tests) where
import Language.KansasLava
import Language.KansasLava.Test
import Hardware.KansasLava.FIFO (fifo)
import Data.Sized.Unsigned
import System.Random
import Data.Ratio
import Data . Maybe
import Debug.Trace
tests :: TestSeq -> I... |
17523d63d8003adc47c2fa0385e3c2565a9a7d614e186491e6d306d9d7f2f84d | informatimago/lisp | c11-parser.lisp | -*- mode : lisp;coding : utf-8 -*-
;;;;**************************************************************************
FILE : c11-parser.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
C11 parser .
;;;;
< PJB > < >
MOD... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/languages/c11/c11-parser.lisp | lisp | coding : utf-8 -*-
**************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
LEGAL
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distri... | FILE : c11-parser.lisp
USER - INTERFACE :
C11 parser .
< PJB > < >
MODIFICATIONS
2015 - 07 - 02 < PJB > Created .
AGPL3
Copyright 2015 - 2016
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either... |
e872b3e0bbc1eecac0b750b74d84dc85b918dfa953f070cef02c4b902797573b | Octachron/codept | bundle.ml | open Module
open Sig
let version () = Scanf.sscanf Sys.ocaml_version "%d.%d" (fun x y -> x, y)
let top f x = Dict.of_list @@ List.map f x
let root ?(special="stdlib") ?(nms=["Stdlib"]) ?(mds=[]) ?(mts=[]) name =
let path = Namespaced.make ~nms name in
let origin =
Origin.Unit {source={source=Special specia... | null | https://raw.githubusercontent.com/Octachron/codept/7e4282b53842203b13568afa5c233961f2015c3e/bundled/bundle.ml | ocaml | ??? | open Module
open Sig
let version () = Scanf.sscanf Sys.ocaml_version "%d.%d" (fun x y -> x, y)
let top f x = Dict.of_list @@ List.map f x
let root ?(special="stdlib") ?(nms=["Stdlib"]) ?(mds=[]) ?(mts=[]) name =
let path = Namespaced.make ~nms name in
let origin =
Origin.Unit {source={source=Special specia... |
43f4c7152e61e6581887c9008d37bfddd38a27c8adcf55db3d2421ed047e6b99 | mentat-collective/Mafs.cljs | matrix.cljs | (ns mafs.matrix
(:refer-clojure :exclude [identity])
(:require [clojure.string :as s]))
(defn create
([a b c d]
[a c 0
b d 0])
([a b c d tx ty]
[a c tx
b d ty]))
(def identity
(create 1 0 0 1))
(defn rotation [a]
(let [c (Math/cos a)
s (Math/sin a)]
(create c s (- s) c)))
(defn... | null | https://raw.githubusercontent.com/mentat-collective/Mafs.cljs/802f147b4ce0372d6cab06dbe1f6000f1b4b63b3/src/mafs/matrix.cljs | clojure | (ns mafs.matrix
(:refer-clojure :exclude [identity])
(:require [clojure.string :as s]))
(defn create
([a b c d]
[a c 0
b d 0])
([a b c d tx ty]
[a c tx
b d ty]))
(def identity
(create 1 0 0 1))
(defn rotation [a]
(let [c (Math/cos a)
s (Math/sin a)]
(create c s (- s) c)))
(defn... | |
ca869c351511a68f9a6bdb5d7af1da2f8578ff81cf955aabe2f9e0b2b805d614 | technomancy/leiningen | core.clj | (ns file-not-found-thrower.core)
(defn -main
"I don't do a whole lot."
[]
(slurp "haha this file does NOT EXIST"))
| null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/test_projects/file-not-found-thrower/src/file_not_found_thrower/core.clj | clojure | (ns file-not-found-thrower.core)
(defn -main
"I don't do a whole lot."
[]
(slurp "haha this file does NOT EXIST"))
| |
aa71297b79d8717ddac6f8d49e3fe6b6824cf30c3a0e3aa9f66961554a93216a | simonmar/monad-par | blackscholes.hs | # LANGUAGE RecordWildCards , CPP , ScopedTypeVariables , FlexibleInstances #
Ported from CnC / C++ program by
Then ported again from the - CnC interface to monad - par . [ 2011.02.16 ]
-- Description
-- ===========
-- The Black-Scholes equation is a differential equation that describes how,
-- under a certa... | null | https://raw.githubusercontent.com/simonmar/monad-par/1266b0ac1b4040963ab356cf032c6aae6b8a7add/examples/src/blackscholes/blackscholes.hs | haskell | Description
===========
The Black-Scholes equation is a differential equation that describes how,
under a certain set of assumptions, the value of an option changes as the
price of the underlying asset changes.
The formula for a put option is similar. The cumulative normal distribution
variable will have a val... | # LANGUAGE RecordWildCards , CPP , ScopedTypeVariables , FlexibleInstances #
Ported from CnC / C++ program by
Then ported again from the - CnC interface to monad - par . [ 2011.02.16 ]
function , CND(x ) , gives the probability that normally distributed random
blackscholes b n
import Control.Seq
im... |
9243498536d7cc7ef90ea7f65d1a4d1ba8732cee57dd22fdf4a7c4929f6e38e5 | stereoknife/cowbot-hs | Youtube.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
module Commands.Youtube where
import Control.Applicative (Alternative)
import Control.Monad (guard)
import Control.Monad.C... | null | https://raw.githubusercontent.com/stereoknife/cowbot-hs/50e80d6ef4b849f27692fad3a4bc2b7187848202/app/Commands/Youtube.hs | haskell | # LANGUAGE OverloadedStrings #
= setRequestHost "/" | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
module Commands.Youtube where
import Control.Applicative (Alternative)
import Control.Monad (guard)
import Control.Monad.Catch (MonadThrow)
import ... |
b0dedd4798ff630550f9d510c0d07bdb56edadd8124d2c99ded2da8515f1bb47 | eponai/sulolive | accounts.cljc | (ns eponai.web.ui.help.accounts
(:require
[om.next :as om :refer [defui]]
[eponai.common.ui.elements.callout :as callout]
[eponai.common.ui.elements.grid :as grid]
[eponai.common.ui.dom :as dom]
[eponai.client.routes :as routes]
[eponai.common.ui.elements.menu :as menu]
[eponai.common.ui.e... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/web/ui/help/accounts.cljc | clojure | (ns eponai.web.ui.help.accounts
(:require
[om.next :as om :refer [defui]]
[eponai.common.ui.elements.callout :as callout]
[eponai.common.ui.elements.grid :as grid]
[eponai.common.ui.dom :as dom]
[eponai.client.routes :as routes]
[eponai.common.ui.elements.menu :as menu]
[eponai.common.ui.e... | |
7bb8de474b6141431bcd4eaf996a6126835d60ef046d69d1a1365ca0076e59d8 | haskell/cabal | Configured.hs | module Distribution.Solver.Modular.Configured
( CP(..)
) where
import Distribution.PackageDescription (FlagAssignment)
import Distribution.Solver.Modular.Package
import Distribution.Solver.Types.ComponentDeps (ComponentDeps)
import Distribution.Solver.Types.OptionalStanza
-- | A configured package is a packa... | null | https://raw.githubusercontent.com/haskell/cabal/6896c6aa0e4804913aaba0bbbe00649e18f17bb8/cabal-install-solver/src/Distribution/Solver/Modular/Configured.hs | haskell | | A configured package is a package instance together with
a flag assignment and complete dependencies. | module Distribution.Solver.Modular.Configured
( CP(..)
) where
import Distribution.PackageDescription (FlagAssignment)
import Distribution.Solver.Modular.Package
import Distribution.Solver.Types.ComponentDeps (ComponentDeps)
import Distribution.Solver.Types.OptionalStanza
data CP qpn = CP (PI qpn) FlagAssign... |
1a71e527bce31566311bd1825c412c6b8cc26cdff034d87f85ba9f3cc7fa7ccd | KaroshiBee/weevil | dap_scopes.ml | module D = Dap_messages.Data
module On_request =
Dap_handlers.Request_response.Make
(struct
type enum = Dap_commands.scopes
type contents = D.ScopesArguments.t
type presence = D.Presence.req
type msg = (enum, contents, presence) Dap_request.Message.t
type t = msg Dap_request.t
... | null | https://raw.githubusercontent.com/KaroshiBee/weevil/1b166ba053062498c1ec05c885e04fba4ae7d831/lib/dapper/dap_scopes.ml | ocaml | module D = Dap_messages.Data
module On_request =
Dap_handlers.Request_response.Make
(struct
type enum = Dap_commands.scopes
type contents = D.ScopesArguments.t
type presence = D.Presence.req
type msg = (enum, contents, presence) Dap_request.Message.t
type t = msg Dap_request.t
... | |
ef4ed0ed165658b13f4ea22c16bf4717466ee1973f0a91d60ef3d2b7f4a5ea1d | budu/lobos | jdbc_1.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 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
; lice... | null | https://raw.githubusercontent.com/budu/lobos/6704f285a7870e84a838fe2e63307730e9d89443/src/lobos/connectivity/jdbc_1.clj | clojure | The use and distribution terms for this software are covered by the
epl-v10.html at the root of this distribution. By using this software
in any fashion, you are agreeing to be bound by the terms of this
license.
You must not remove this notice, or any other, from this software. | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 which can be found in the file
(ns lobos.connectivity
(:refer-clojure :exclude [defonce])
(:require [clojure.java.jdbc.internal :as sqlint]))
|
beb71cf4486660b144f27c37a2a50f5e6790afe19eb1c04165c84fc5fcfee921 | phadej/staged | Convenience.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE TypeOperato... | null | https://raw.githubusercontent.com/phadej/staged/b51c8c508af71ddb2aca4a75030da9b2c4f9e3dd/staged-streams/src/Staged/Stream/Convenience.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| More convenient (than direct) 'StreamM' creation.
* Convenience helpers:
* Constraint
| Create 'StreamM' from ... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Staged.Stream.Convenience (
mkStreamM,
FlattenCode,
) where
import Data.SOP
import Staged.Commons
import Staged.Stream.Internal
import Staged.Stream.Type
Ther... |
64fc3475687f65dca70c6c75c5a3246e3aa2d58a057b86385d1cac623fc9c79d | exercism/ocaml | binary_search.mli | open Base
(* Finds an int in an array of ints via binary search *)
val find : int array -> int -> (int, string) Result.t | null | https://raw.githubusercontent.com/exercism/ocaml/bfd6121f757817865a34db06c3188b5e0ccab518/exercises/practice/binary-search/binary_search.mli | ocaml | Finds an int in an array of ints via binary search | open Base
val find : int array -> int -> (int, string) Result.t |
1e464364fdf8bdee0d977f68bd3f0444dc5d77936d4114a4251ede90ea5f3511 | elaforge/karya | Convert_test.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Cmd.Integrate.Convert_test where
import qualified Data.Map as Map
import qualified Util.Texts as Texts
import qualified Cmd.Integrate.Convert as Convert
import qualified Derive.At... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/Cmd/Integrate/Convert_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
No dyn track if it's just the default value.
Ensure dynamic invert works even when it's set post-integrate.
No pitch track, has a control track.
Attributes get mapped back to their call.
But duplicate pitch... | Copyright 2013
module Cmd.Integrate.Convert_test where
import qualified Data.Map as Map
import qualified Util.Texts as Texts
import qualified Cmd.Integrate.Convert as Convert
import qualified Derive.Attrs as Attrs
import qualified Derive.Derive as Derive
import qualified Derive.DeriveTest as DeriveTest
import qua... |
bd8fe396ae3593ce110d44df6e28fa7bf8d092e70b0a698c957677215138679c | kadena-io/chainweb-node | Payload.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
{-# LAN... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/cd48d11eee306a3ef64eabacd570134c5f573020/src/Chainweb/Payload.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ConstraintKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
TODO KeySet NFData in Pact
|
Stability: experimental
The format abstracts from the smart contract language. I.e. it does not
* Block Chain Data
* Hashes
* Authoritative Data
* API Payload Data
*... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE... |
69d2153c347d21a1c79e7e719cd2111fd404acc6553ded22ab7030c8c50b379c | slyrus/clem | print.lisp | ;;; print.lisp
;;; macros, functions and methods for matrix element access
;;;
Copyright ( c ) 2004 - 2006 ( )
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistri... | null | https://raw.githubusercontent.com/slyrus/clem/5eb055bb3f45840b24fd44825b975aa36bd6d97c/src/print.lisp | lisp | print.lisp
macros, functions and methods for matrix element access
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice,... | Copyright ( c ) 2004 - 2006 ( )
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :clem)
(defparameter *print-matrix-newlines* t)
(defparameter *print-matrix-float-format* nil)
(defparameter *matrix-print* t)
(de... |
796e046c87c64536d180b83b30bef8ab05d0aa2e8a5ab54b39864f377de81da2 | gedge-platform/gedge-platform | jose_public_key.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
2014 - 2017 ,
%%% @doc
%%%
%%% @end
Created : 18 May 2017 by < >
%%%---------------------------... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/jose/src/jose_public_key.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
===================================================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
2014 - 2017 ,
Created : 18 May 2017 by < >
-module(jose_public_key).
-include("jose_compat.hrl").
-include("jose_public_key.hrl").
-export([cipher/3]).
-export([decipher/2]).
-export([encrypt_param... |
890aeb02834e7cdfa633f518b3decf492c09a977ebd00cfbc04c991e27d3a1e1 | gusenov/stepik-functional-programming-hs | Demo.hs | import Control . Monad
import Prelude hiding (Monad, return, fail, (>>=), (>>))
class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
fail :: String -> m a
instance Monad [] where
return x = [x]
xs >>= k = concat (map k xs)
fail _ = []
foo1 = do { x <- [1,2,3]; y... | null | https://raw.githubusercontent.com/gusenov/stepik-functional-programming-hs/904164012b9b842a15d5ba3af05cfe589295fa5c/TheListMonad/Demo.hs | haskell | import Control . Monad
import Prelude hiding (Monad, return, fail, (>>=), (>>))
class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
fail :: String -> m a
instance Monad [] where
return x = [x]
xs >>= k = concat (map k xs)
fail _ = []
foo1 = do { x <- [1,2,3]; y... | |
08bfd97dd7e3c2a34ad7d8d048ae4bb8e4b1551e235b73cbe1d19dfa124b96ea | Clojure2D/clojure2d | signalart.clj | (ns signalart)
;; lowpass
(defn calc-filter-alpha
"Calculate alpha for low/high pass filters."
[rate cutoff]
(let [tinterval (/ 1.0 rate)
tau (/ 1.0 (* cutoff 2.0 Math/PI))]
(/ tinterval (+ tau tinterval))))
(defn make-lowpass-filter
"Create lowpass filter function"
[conf]
(let [alpha (calc-f... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d/26cceb14982a30fa6f867a5e5bf120f270c2b170/generateme/signalart.clj | clojure | lowpass
highpass
processing
let's extract only sample after filtering | (ns signalart)
(defn calc-filter-alpha
"Calculate alpha for low/high pass filters."
[rate cutoff]
(let [tinterval (/ 1.0 rate)
tau (/ 1.0 (* cutoff 2.0 Math/PI))]
(/ tinterval (+ tau tinterval))))
(defn make-lowpass-filter
"Create lowpass filter function"
[conf]
(let [alpha (calc-filter-alpha... |
6cb32dd2bd92f88ae7a4900354231459248a346bc13dfba05d1534d1d9de8369 | onyx-platform/learn-onyx | challenge_6_1.clj | (ns workshop.challenge-6-1
(:require [workshop.workshop-utils :as u]))
Workflows ; ; ;
(def workflow
[[:read-segments :bucket-page-views]])
;;; Catalogs ;;;
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx/plugin :onyx.plugin.core-asyn... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/src/workshop/challenge_6_1.clj | clojure | ; ;
Catalogs ;;;
; ; | (ns workshop.challenge-6-1
(:require [workshop.workshop-utils :as u]))
(def workflow
[[:read-segments :bucket-page-views]])
(defn build-catalog
([] (build-catalog 5 50))
([batch-size batch-timeout]
[{:onyx/name :read-segments
:onyx/plugin :onyx.plugin.core-async/input
:onyx/type :input
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.