_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 |
|---|---|---|---|---|---|---|---|---|
6d22a8bbf2ee11506f83d947fd0e92d5b4b738ea628c4154dcfd428dcf943423 | justinmeiners/exercises | 3_07.scm | ; this turned out to be a terrible way to implement this
; what I did is evidence of my set way of thinking
; the better way is incredibly simple
(define (make-account balance pass)
(define pass-list (list pass))
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount)... | null | https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/sicp/3/3_07.scm | scheme | this turned out to be a terrible way to implement this
what I did is evidence of my set way of thinking
the better way is incredibly simple
statey password list manipulation
I had to add this here to access the local functions
more procedural |
(define (make-account balance pass)
(define pass-list (list pass))
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount)) balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(define (pass-complain ... |
cbbc30435c89c74efe041460a34fedac8710cc92e6656d94ed303876eccff088 | ocaml-multicore/tezos | script_timestamp_repr.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/script_timestamp_repr.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
33e70e209ae8f99ef7b479ebcd0a4025573e0d044c872f218e4a81ce1a959124 | mlabs-haskell/apropos-tx | ContextBuilder.hs | module Apropos.ContextBuilder (
TxInfoBuilder (..),
ScriptContextBuilder (..),
TxInInfo' (..),
TxOut' (..),
buildContext,
withTxInfo,
nullTxId,
nullTxOutRef,
) where
import Control.Monad.Trans.Class (MonadTrans, lift)
import Control.Monad.Trans.State (StateT, execStateT, get, modify)
import Data.Functo... | null | https://raw.githubusercontent.com/mlabs-haskell/apropos-tx/e07943eee2f00adc05fe2a7389ed9419fc94499d/src/Apropos/ContextBuilder.hs | haskell | Inline datum types
with concrete types and extra packaging for convenience
with concrete types for convenience | module Apropos.ContextBuilder (
TxInfoBuilder (..),
ScriptContextBuilder (..),
TxInInfo' (..),
TxOut' (..),
buildContext,
withTxInfo,
nullTxId,
nullTxOutRef,
) where
import Control.Monad.Trans.Class (MonadTrans, lift)
import Control.Monad.Trans.State (StateT, execStateT, get, modify)
import Data.Functo... |
b02607e4112508077234bfb88205cede9e680ef75d34b067edb2b82fbf1d6082 | haskellweekly/haskellweekly | Summary.hs | -- | This module defines a type for a brief summary of a piece of content. It's
-- useful to have a summary as a separate concept so that it can be included
with metadata , like a podcast feed or a link on Twitter .
module HW.Type.Summary
( Summary,
fromText,
toText,
)
where
import qualified Data.Char as... | null | https://raw.githubusercontent.com/haskellweekly/haskellweekly/615526de6f1e590fff3bac5a7911aaaacf149b09/source/library/HW/Type/Summary.hs | haskell | | This module defines a type for a brief summary of a piece of content. It's
useful to have a summary as a separate concept so that it can be included
| Converts text into a summary. Currently this makes sure that the
string isn't completely blank. In the future it might put some limits on the
length of the summar... | with metadata , like a podcast feed or a link on Twitter .
module HW.Type.Summary
( Summary,
fromText,
toText,
)
where
import qualified Data.Char as Char
import qualified Data.Text as Text
newtype Summary
= Summary Text.Text
deriving (Eq, Show)
fromText :: Text.Text -> Either String Summary
fromTex... |
9a6b5bb3cd714ba55421c6c2ed3593ad807a7b1abf97e759b285767b6e08b06e | bob-cd/bob | artifact_test.clj | ; Copyright 2018- Rahul De
;
Use of this source code is governed by an MIT - style
; license that can be found in the LICENSE file or at
; .
(ns runner.artifact-test
(:require
[babashka.http-client :as http]
[clojure.test :refer [deftest is testing]]
[failjure.core :as f]
[runner.artifact :as a]
[ru... | null | https://raw.githubusercontent.com/bob-cd/bob/7e171012f0750f108c9d8499201d1ec65f30efbb/runner/test/runner/artifact_test.clj | clojure | Copyright 2018- Rahul De
license that can be found in the LICENSE file or at
. | Use of this source code is governed by an MIT - style
(ns runner.artifact-test
(:require
[babashka.http-client :as http]
[clojure.test :refer [deftest is testing]]
[failjure.core :as f]
[runner.artifact :as a]
[runner.engine :as eng]
[runner.util :as u]
[xtdb.api :as xt]))
(deftest upload-art... |
c06e41f957530f04b37e02da51f30d64d7ce92eb838404d011fe2b43b47f5e0a | GaloisInc/mistral | Main.hs | # LANGUAGE FlexibleContexts #
module Main where
import OptParser
import Mistral.Driver
import Mistral.Simple ( compileFile, linkProgram )
import Mistral.Utils.PP
import Mistral.Semantics.SimpleInterp as M
import Control.Monad ( when, unless )
import Data.Monoid ( mconcat, mappend )
import System.Console.GetOpt
... | null | https://raw.githubusercontent.com/GaloisInc/mistral/3464ab332d73c608e64512e822fe2b8a619ec8f3/mistral/Main.hs | haskell | Options ---------------------------------------------------------------------
Main ------------------------------------------------------------------------
XXX this should fail in a more graceful manner
XXX output a linked program
XXX print the final result? | # LANGUAGE FlexibleContexts #
module Main where
import OptParser
import Mistral.Driver
import Mistral.Simple ( compileFile, linkProgram )
import Mistral.Utils.PP
import Mistral.Semantics.SimpleInterp as M
import Control.Monad ( when, unless )
import Data.Monoid ( mconcat, mappend )
import System.Console.GetOpt
... |
b4e6febe30e65c37130fd63227db0d887dd9ad5b9b0c6e9c448c437c4a082e48 | puppetlabs/trapperkeeper | plugins.clj | (ns puppetlabs.trapperkeeper.plugins
(:import (java.util.jar JarFile)
(java.io File))
(:require [clojure.java.io :refer [file]]
[clojure.tools.logging :as log]
[puppetlabs.kitchensink.classpath :as kitchensink]
[puppetlabs.i18n.core :as i18n]))
(defn- should-process?
... | null | https://raw.githubusercontent.com/puppetlabs/trapperkeeper/3e5e7e286287d75e7fdf7eb1dabb2fa534091329/src/puppetlabs/trapperkeeper/plugins.clj | clojure | ignore directories
necessary for directories in .jars
lein includes project.clj ... no thank you
handles a found duplicate. Throws an exception
It is common to have other conflicts (besides classes and clojure
namespaces), especially during development (for example,
jetty-servlet and jetty-http both contain an ... | (ns puppetlabs.trapperkeeper.plugins
(:import (java.util.jar JarFile)
(java.io File))
(:require [clojure.java.io :refer [file]]
[clojure.tools.logging :as log]
[puppetlabs.kitchensink.classpath :as kitchensink]
[puppetlabs.i18n.core :as i18n]))
(defn- should-process?
... |
504b974ad51f41d782d5c01285ea0e657c2aac4e5d5136a947c301572d084269 | okuoku/nausicaa | make-inspector.sps | ;;;!mosh
-*- coding : utf-8 - unix -*-
;;;
Part of : Nausicaa / cURL
;;;Contents: foreign library inspection generator
Date : We d Nov 25 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 , 2010 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/curl/make-inspector.sps | scheme | !mosh
Contents: foreign library inspection generator
Abstract
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ... | -*- coding : utf-8 - unix -*-
Part of : Nausicaa / cURL
Date : We d Nov 25 , 2009
Copyright ( c ) 2009 , 2010 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
(import (... |
773985fc2a59ab63459c49c396290d850d74d58ca0186ec3c97783fcb09b501b | bjornbm/dimensional | Internal.hs | # LANGUAGE CPP #
# LANGUAGE DataKinds #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVari... | null | https://raw.githubusercontent.com/bjornbm/dimensional/bcea815463e76b18fedbe20ffa0e2bbf09c97e88/src/Numeric/Units/Dimensional/Internal.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
# LANGUAGE TypeSynonymInstances #
$setup
>>> :set -XNoImplicitPrelude
>>> import Numeric.Units.Dimensional.Prelude
| A unit of measurement.
| A dimensional quantity.
The name is an abbreviation for scaled quantity.
and manipulate with certain functions, no... | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies ... |
5456013469ab9c966506e137da1fe6f8dfe164116f48480bf92a273086843776 | 1HaskellADay/1HAD | Exercise.hs | module HAD.Y2014.M03.D10.Exercise where
-- $setup
-- >>> import Test.QuickCheck
> > > import Control . Applicative
-- | maybeReadPositiveInt Try to parse a positive Int
-- Can be done point-free (and it's probably funnier this way).
--
-- Examples:
--
-- prop> (==) <$> Just <*> maybeReadPositiveInt . show $ getNonN... | null | https://raw.githubusercontent.com/1HaskellADay/1HAD/3b3f9b7448744f9b788034f3aca2d5050d1a5c73/exercises/HAD/Y2014/M03/D10/Exercise.hs | haskell | $setup
>>> import Test.QuickCheck
| maybeReadPositiveInt Try to parse a positive Int
Can be done point-free (and it's probably funnier this way).
Examples:
prop> (==) <$> Just <*> maybeReadPositiveInt . show $ getNonNegative x
Nothing
Nothing
| module HAD.Y2014.M03.D10.Exercise where
> > > import Control . Applicative
prop > Nothing = = ( maybeReadPositiveInt . show . negate . getPositive $ x )
> > > maybeReadPositiveInt " foo "
> > > maybeReadPositiveInt " 12 "
maybeReadPositiveInt :: String -> Maybe Int
maybeReadPositiveInt = undefined
|
4dc00d73efe60a231e3568d5740fa1fdeb35e17e2b7cfc23de9bda75e923352b | haskell-tools/haskell-tools | AnotherOperator.hs | module Refactor.DollarApp.AnotherOperator where
import Refactor.DollarApp.Defs
x = f (g $$ 3) | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/experimental-refactorings/examples/Refactor/DollarApp/AnotherOperator.hs | haskell | module Refactor.DollarApp.AnotherOperator where
import Refactor.DollarApp.Defs
x = f (g $$ 3) | |
fe3c82f6b1f5ec6213c361c064c57825c6335f8dc7455f5c55218ff5447dd115 | SKS-Keyserver/sks-keyserver | wserver.mli | exception Page_not_found of string
exception No_results of string
exception Not_implemented of string
exception Bad_request of string
exception Entity_too_large of string
exception Misc_error of string
val ( |= ) : ('a, 'b) PMap.Map.t -> 'a -> 'b
val ( |< ) : ('a, 'b) PMap.Map.t -> 'a * 'b -> ('a, 'b) PMap.Map.t
val he... | null | https://raw.githubusercontent.com/SKS-Keyserver/sks-keyserver/a4e5267d817cddbdfee13d07a7fb38a9b94b3eee/wserver.mli | ocaml | exception Page_not_found of string
exception No_results of string
exception Not_implemented of string
exception Bad_request of string
exception Entity_too_large of string
exception Misc_error of string
val ( |= ) : ('a, 'b) PMap.Map.t -> 'a -> 'b
val ( |< ) : ('a, 'b) PMap.Map.t -> 'a * 'b -> ('a, 'b) PMap.Map.t
val he... | |
76d801a5eaed784f35d571daef906cec8c7e90c495a87ce0819ce19996934128 | yuriy-chumak/ol | base.scm | (define-library (scheme base)
(export
(exports (scheme core))
(exports (scheme process-context))
caaar caadr cadar caddr ; moved from (scheme cxr)
cdaar cdadr cddar cdddr ; moved from (scheme cxr)
; -----------------------------------------
; r7rs small (scheme base) list
*
+
-
; ... ... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/cd18acee6e3cc22e17bdd89a0535ce5aceb47e3d/libraries/scheme/base.scm | scheme | moved from (scheme cxr)
moved from (scheme cxr)
-----------------------------------------
r7rs small (scheme base) list
... * reserved for use by Scheme
* ol specific
=> * reserved for use by Scheme
* ol specific
binary-port?
[yc] why not bytevector-ref like vector-ref?
[yc] why not ... | (define-library (scheme base)
(export
(exports (scheme core))
(exports (scheme process-context))
*
+
-
/
<
<=
=
>
>=
abs
and
append
apply
assoc
assq
assv
begin
boolean=?
boolean?
bytevector
bytevector-append
bytevector-copy
bytevector-copy!
... |
04487d086dcefd28ca8bdc73d5b51987f1dcc5362cd0ffda0254616a6c3354d6 | janestreet/redis-async | sha1.mli | open Core
include Identifiable.S_plain
| null | https://raw.githubusercontent.com/janestreet/redis-async/38bfabc1110030673ce223e5e5d3011f691a5338/src/sha1.mli | ocaml | open Core
include Identifiable.S_plain
| |
0784acfea80ab6592193695767e706032000b916e5fe174124de01caf2538e7d | yetanalytics/flint | axiom.cljc | (ns com.yetanalytics.flint.spec.axiom
(:require [clojure.spec.alpha :as s]
[com.yetanalytics.flint.axiom.protocol :as p]
[com.yetanalytics.flint.axiom.impl]))
Axiom specs
;; We need to wrap them in functions in order to ensure that the functions
;; are called dynamically, rather than have f... | null | https://raw.githubusercontent.com/yetanalytics/flint/b0a2530582e04f5592869b0152b846864c283d77/src/main/com/yetanalytics/flint/spec/axiom.cljc | clojure | We need to wrap them in functions in order to ensure that the functions
are called dynamically, rather than have fixed definitions. Otherwise
`extend-protocol` will not work.
Composite specs | (ns com.yetanalytics.flint.spec.axiom
(:require [clojure.spec.alpha :as s]
[com.yetanalytics.flint.axiom.protocol :as p]
[com.yetanalytics.flint.axiom.impl]))
Axiom specs
(def iri-spec
#(p/-valid-iri? %))
(def prefix-spec
#(p/-valid-prefix? %))
(def prefix-iri-spec
#(p/-valid-prefi... |
6c2d0d59065539e18aaec2b561aabcc82e2d3c294eefdb60a41bc63f6c33a25f | Ericson2314/lighthouse | Concurrency.hs | | Concurrency support ( inherited from Concurrent Haskell )
module H.Concurrency(module H.Concurrency,{- H,-} Chan,MVar,QSem,ThreadId,L.Lock,L.LockKey) where
import qualified Control.Concurrent as IO
import Control.Concurrent(Chan,MVar,QSem,ThreadId)
import qualified Control.Concurrent.Lock as L
import LwConc.PTM as ... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/kernel/H/Concurrency.hs | haskell | H,
---------------------- INTERFACE ---------------------------------------------
* Thread control
* Channels
* MVars
* Semaphores
* Locks (Mutexes)
---------------------- IMPLEMENTATION ----------------------------------------
Thread control---------------------------------------------------------------
-------... | | Concurrency support ( inherited from Concurrent Haskell )
import qualified Control.Concurrent as IO
import Control.Concurrent(Chan,MVar,QSem,ThreadId)
import qualified Control.Concurrent.Lock as L
import LwConc.PTM as PTM
import H.Monad(H,liftIO,runH)
forkH :: (H a) -> H ThreadId
killH :: ThreadId -> H ()
yield :... |
294f8a8187b8bcadd3e4bb8edd968400f2fdf16005d0af7632d768f88d25c1da | brianhempel/maniposynth | std_exit.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/brianhempel/maniposynth/8c8e72f2459f1ec05fefcb994253f99620e377f3/ocaml-4.07.1/stdlib/std_exit.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
let _ = do_at_exit()
|
7a980c4a7aebd9dcf8b4f53395ab5bf22152f9d07edb6d42fce6ab279ff485a7 | isakmp/ike | encode.mli |
(* high-level -> Cstruct.t [no option, no error -- we can encode all high level things] *)
| null | https://raw.githubusercontent.com/isakmp/ike/fa93543941a77f6b09c88d8bb149dd0d40acc635/src/encode.mli | ocaml | high-level -> Cstruct.t [no option, no error -- we can encode all high level things] | |
b31a209f1a7831745ca3baa200776bf4f9893ade19e6ff0883c06b2146da91e1 | fossas/fossa-cli | Internal.hs | # LANGUAGE RecordWildCards #
-- | Description: These are internal functions for parsing an RPM package header blob. The
-- main entry-point is 'readPackageInfo'.
module Data.Rpm.DbHeaderBlob.Internal (
-- * Main interface
-- | You should not use this module directly. Use 'Data.Rpm.DbHeaderBlob'
-- instead.
Pk... | null | https://raw.githubusercontent.com/fossas/fossa-cli/ba98598f3b8316d37ac818aed1efaf30c9b6e531/src/Data/Rpm/DbHeaderBlob/Internal.hs | haskell | | Description: These are internal functions for parsing an RPM package header blob. The
main entry-point is 'readPackageInfo'.
* Main interface
| You should not use this module directly. Use 'Data.Rpm.DbHeaderBlob'
instead.
* Internal Types
* Internal Functions
* Magic numbers
| RPM tags (keys). This is not ex... | # LANGUAGE RecordWildCards #
module Data.Rpm.DbHeaderBlob.Internal (
PkgInfo (..),
readPackageInfo,
HeaderBlob (..),
EntryMetadata (..),
TagValueData (..),
IndexCount (..),
RpmTagType (..),
RpmTag (..),
readHeaderMetaData,
getV3RegionCount,
calcDataLength,
readHeaderBlobTagData,
regionTag... |
67fabb56c86f653b507a2998bbd558731419f8cb3e84d49506c167fa11378f80 | TorXakis/TorXakis | MCRL2PrettyPrint.hs |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and University of Twente
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and University of Twente
See LICENSE at root directory of this repository.
-}
-----------------------------------... | null | https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/sys/lpeops/src/mcrl2/MCRL2PrettyPrint.hs | haskell | ---------------------------------------------------------------------------
|
Module : MCRL2PrettyPrint
License : BSD3
Maintainer :
Stability : experimental
---------------------------------------------------------------------------
showEquationGroup |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and University of Twente
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and University of Twente
See LICENSE at root directory of this repository.
-}
Copyright : TNO and Universi... |
0e3ef0853979c1b5ef9d12708087049853c67d0eed7e73c5843175c1528c7ef5 | jacekschae/learn-reitit-course-files | middleware.clj | (ns cheffy.middleware
(:require [ring.middleware.jwt :as jwt]
[cheffy.recipe.db :as recipe-db]
[ring.util.response :as rr]))
(def wrap-auth0
{:name ::auth0
:description "Middleware for auth0 authentication and authorization"
:wrap (fn [handler]
(jwt/wra... | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/50-list-conversations/src/cheffy/middleware.clj | clojure | (ns cheffy.middleware
(:require [ring.middleware.jwt :as jwt]
[cheffy.recipe.db :as recipe-db]
[ring.util.response :as rr]))
(def wrap-auth0
{:name ::auth0
:description "Middleware for auth0 authentication and authorization"
:wrap (fn [handler]
(jwt/wra... | |
e101d6db6bf310cd8bf721ae053763dcd90f53b016f1c9166f294e7d3d594ea3 | coq/bot | GitHub_app.mli | val get_installation_token :
bot_info:Bot_info.t
-> key:Mirage_crypto_pk.Rsa.priv
-> app_id:int
-> owner:string
-> repo:string
-> (string * float, string) result Lwt.t
val get_installations :
bot_info:Bot_info.t
-> key:Mirage_crypto_pk.Rsa.priv
-> app_id:int
-> (string list, string) result Lw... | null | https://raw.githubusercontent.com/coq/bot/a8cb60d34a09d6fdfa7f2478e62f29edc060d866/bot-components/GitHub_app.mli | ocaml | val get_installation_token :
bot_info:Bot_info.t
-> key:Mirage_crypto_pk.Rsa.priv
-> app_id:int
-> owner:string
-> repo:string
-> (string * float, string) result Lwt.t
val get_installations :
bot_info:Bot_info.t
-> key:Mirage_crypto_pk.Rsa.priv
-> app_id:int
-> (string list, string) result Lw... | |
979ab2473a14e9103632f067fbee4a19b9379746ed55a98f86fb0eb779fcecc2 | input-output-hk/cardano-base | Class.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE Un... | null | https://raw.githubusercontent.com/input-output-hk/cardano-base/dd60865a18478aa7f2936693da952cd22d76b080/cardano-crypto-class/src/Cardano/Crypto/DSIGN/Class.hs | haskell | # LANGUAGE OverloadedStrings #
| Abstract digital signatures.
* 'SignedDSIGN' wrapper
* CBOR encoding and decoding
* Encoded 'Size' expresssions
Key and signature types
Unit by default (no context required)
Key generation
| Note that this function may error (with 'SeedBytesExhausted') if the
provided ... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Cardan... |
b1f19423a19951edfc1fc8912d35a2ce4f7bfc096327cf3f5557b74673f433c1 | racket/compatibility | math.rkt | (module math racket/base
(require racket/math)
(provide (all-from-out racket/math)
e)
(define e (exp 1.0)))
| null | https://raw.githubusercontent.com/racket/compatibility/492030dac6f095045ce8a13dca75204dd5f34e32/compatibility-lib/mzlib/math.rkt | racket | (module math racket/base
(require racket/math)
(provide (all-from-out racket/math)
e)
(define e (exp 1.0)))
| |
51e4f8649ec907022443e651188aff773dc6f60bbf87805627f722fe9c1c7307 | kongo2002/statser | test_util.erl | -module(test_util).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-export([start_statser/0,
start_statser/1,
stop/1]).
-export([send_metric/2,
send_metric/3,
with_tempfile/1]).
-define(DEFAULT_APPS, [compiler, syntax_tools, goldrush, xmerl, yamerl, jiffy, elli]).
-recor... | null | https://raw.githubusercontent.com/kongo2002/statser/1cb0498f56c97d8a010b979c5163dd2750064e98/test/test_util.erl | erlang | -module(test_util).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-export([start_statser/0,
start_statser/1,
stop/1]).
-export([send_metric/2,
send_metric/3,
with_tempfile/1]).
-define(DEFAULT_APPS, [compiler, syntax_tools, goldrush, xmerl, yamerl, jiffy, elli]).
-recor... | |
829a2d465e65c55b6ba2c391da03f199185b032b284650ff54ccf83ab5c16cd0 | ocsigen/ocaml-eliom | htbl.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/lib-hashtbl/htbl.ml | ocaml | ************************************************************************
OCaml
... | , projet Gallium , INRIA Rocquencourt
Copyright 2011 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Printf
module Test(H: Hashtbl.S) (M: Map.S with type key = H.key) = struct
let incl_mh m h =
... |
35116a816bef2fd4799e90cd7c37413cbd6c5b4bbffcb1644f43af676ecef8f3 | hjcapple/reading-sicp | exercise_2_61_62.scm | #lang racket
P105 - [ 练习 2.61 ]
P105 - [ 练习 2.62 ]
(define (element-of-set? x set)
(cond ((null? set) false)
((= x (car set)) true)
((< x (car set)) false)
(else (element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(cond ((null? set) (list x))
((= x (car set)) set)
... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_2/exercise_2_61_62.scm | scheme | #lang racket
P105 - [ 练习 2.61 ]
P105 - [ 练习 2.62 ]
(define (element-of-set? x set)
(cond ((null? set) false)
((= x (car set)) true)
((< x (car set)) false)
(else (element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(cond ((null? set) (list x))
((= x (car set)) set)
... | |
23d984f2900bb2deb49c0c1aa35cd551522f84ae3750c2537642fde977fb3d54 | ryukinix/discrete-mathematics | notes.hs | {-- RECURSION --}
-- Recursion is a self referential style of definitions commonly used
-- in both mathematics and computer science.
-- Let's write some examples of recursive functions definitions
in Haskell
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial (n-1)
-- A template for recursion ove... | null | https://raw.githubusercontent.com/ryukinix/discrete-mathematics/1f779e05822c094af33745e2dd3c9a35c6dfb388/src/03-recursion/notes.hs | haskell | - RECURSION -
Recursion is a self referential style of definitions commonly used
in both mathematics and computer science.
Let's write some examples of recursive functions definitions
A template for recursion over lists
-
f :: [a] -> `type of result`
f [] = `result for empty list`
f (x:xs) = `result defined using (... |
in Haskell
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial (n-1)
length' :: [a] -> Int
length' [] = 0
length' (x:xs) = 1 + length' xs
- Hand evaluation of length function
length [ 1,2,3 ]
= 1 + length [ 2,3 ]
= 1 + ( 1 + length [ 3 ] )
= 1 + ( 1 + ( 1 + length [ ] ) )
= 1 + ( 1... |
bc810c565fdcc5f48eaf6d682a769bc3f5199092fc65a5fcca935d666969a148 | eponai/sulolive | core.cljs | (ns sulo-native.android.core
(:require [om.next :as om :refer-macros [defui]]
[re-natal.support :as sup]
[sulo-native.state :as state]))
(set! js/window.React (js/require "react"))
(def ReactNative (js/require "react-native"))
(defn create-element [rn-comp opts & children]
(apply js/Re... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/sulo-native/src/sulo_native/android/core.cljs | clojure | (ns sulo-native.android.core
(:require [om.next :as om :refer-macros [defui]]
[re-natal.support :as sup]
[sulo-native.state :as state]))
(set! js/window.React (js/require "react"))
(def ReactNative (js/require "react-native"))
(defn create-element [rn-comp opts & children]
(apply js/Re... | |
370898f47f3e35dcd8d8d55f6b1b1978c333abee9bbb3173e82e9ed2b81eaab8 | bsansouci/bsb-native | opam_config_compiler_packed.ml | module Ext_bytes : sig
#1 "ext_bytes.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 Lic... | null | https://raw.githubusercontent.com/bsansouci/bsb-native/9a89457783d6e80deb0fba9ca7372c10a768a9ea/scripts/opam_config_compiler_packed.ml | ocaml | * Port the {!Bytes.escaped} from trunk to make it not locale sensitive
* Extension to the standard library [String] module, fixed some bugs like
avoiding locale sensitivity
* default is false
* remove whitespace letters ('\t', '\n', ' ') on both side
* default is false
* split by space chars for quick scripting... | module Ext_bytes : sig
#1 "ext_bytes.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 Lic... |
0385191cee851eaa199e26ae890bc15e78c156d25d932027c297d97585923de6 | Opetushallitus/ataru | application_subs.cljs | (ns ataru.virkailija.application.application-subs
(:require [ataru.application-common.application-field-common :as common]
[ataru.cljs-util :as util]
[ataru.component-data.person-info-module :as person-info-module]
[ataru.util :as u]
[ataru.virkailija.application.kevyt-... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/e4dcd90670d1d1018642f0cbb7c9c14b72d82fd8/src/cljs/ataru/virkailija/application/application_subs.cljs | clojure | (ns ataru.virkailija.application.application-subs
(:require [ataru.application-common.application-field-common :as common]
[ataru.cljs-util :as util]
[ataru.component-data.person-info-module :as person-info-module]
[ataru.util :as u]
[ataru.virkailija.application.kevyt-... | |
c124f090edfd5b1153b41c9b423505c0f4115ca04aaf3abb30c7376486632ce4 | zen-lang/zen | core_test.clj | (ns zen.core-test
(:require [zen.core :as sut]
[clojure.test :as t]
[matcho.core :as matcho]))
(t/deftest errors-test
(def ztx (sut/new-context))
(sut/load-ns ztx '{:ns my-ns
:import #{doesnt-exist}
sym {:zen/tags #{zen/schema}
... | null | https://raw.githubusercontent.com/zen-lang/zen/a1fa15448dfdd7389f46bd2e29badbc0ebc0e1fe/test/zen/core_test.clj | clojure | (ns zen.core-test
(:require [zen.core :as sut]
[clojure.test :as t]
[matcho.core :as matcho]))
(t/deftest errors-test
(def ztx (sut/new-context))
(sut/load-ns ztx '{:ns my-ns
:import #{doesnt-exist}
sym {:zen/tags #{zen/schema}
... | |
06081aa646859278945e0dda231ff8207e94484f5261b1d0d381f12fe3528a46 | Clozure/ccl | name-translation.lisp | -*- Mode : Lisp ; Package : CCL -*-
;;;
Copyright 2003 Randall D. Beer
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable l... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/objc-bridge/name-translation.lisp | lisp | Package : CCL -*-
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 la... | Copyright 2003 Randall D. Beer
distributed under the License is distributed on an " AS IS " BASIS ,
name-translation.lisp
(in-package "CCL")
(require "SEQUENCE-UTILS")
(defvar *special-objc-words* nil)
(defmacro define-special-objc-word (str)
`(setf *special-objc-words*
(sort (pushnew ,str *... |
081650bfecf52f58797a4808ec86a81f7e65ea2766dfbea5e69e45f3e4c09a9b | shirok/Gauche | cgi.scm | ;;;
;;; cgi.scm - CGI utility
;;;
Copyright ( c ) 2000 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must retain the above copyright
;;... | null | https://raw.githubusercontent.com/shirok/Gauche/e97efb5e54f9ab97746369b8ac748f338224c746/lib/www/cgi.scm | scheme |
cgi.scm - CGI utility
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
... | Copyright ( c ) 2000 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
TODO : a method should provided to return... |
c40a007ba1107e22dc32f998463007670f76793e58db51d145ebc5b7e3bb0300 | Ericson2314/hasnip | Main.hs | module Main where
main :: IO ()
main = putStrLn "this clearly doesn't do anything yet" | null | https://raw.githubusercontent.com/Ericson2314/hasnip/bf85ae6dec4790067e9be0a998461b9950e7a521/test/Main.hs | haskell | module Main where
main :: IO ()
main = putStrLn "this clearly doesn't do anything yet" | |
1241fe5132ad226afcc14c2f61530fccd05247e103c487a88cfcaf459636e936 | litaocheng/erlips | erlips_httpd.erl | %%%----------------------------------------------------------------------
%%%
erlips 2009
%%%
@author
%%% @doc the erlips app framework, handle the http request
%%%
%%%----------------------------------------------------------------------
-module(erlips_httpd).
-author('').
-vsn('0.1').
-include("erlips.hrl").
-... | null | https://raw.githubusercontent.com/litaocheng/erlips/192ef13c1d6de0cbb81ec5d6ca8b21bb6c0c806c/src/erlips_httpd.erl | erlang | ----------------------------------------------------------------------
@doc the erlips app framework, handle the http request
----------------------------------------------------------------------
@doc start the http server
@doc start the http server
@doc handle the http request
handle the request
internal AP... | erlips 2009
@author
-module(erlips_httpd).
-author('').
-vsn('0.1').
-include("erlips.hrl").
-export([start_link/0, start_link/2]).
-export([handle_request/2]).
-define(MAX_MOD_LEN, 255).
-spec start_link() ->
{'ok', pid()} | {'error', any()}.
start_link() ->
load_mods_name(),
DocRoot = ?CONF_GET2(d... |
6e53482c8b8b3065725e681d73e4928dacc67ce1eb6f86465453c4ebc409669a | tsloughter/kuberl | kuberl_v1alpha1_runtime_class.erl | -module(kuberl_v1alpha1_runtime_class).
-export([encode/1]).
-export_type([kuberl_v1alpha1_runtime_class/0]).
-type kuberl_v1alpha1_runtime_class() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_meta(),
'spec' := kuberl_v1alpha1_runti... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1alpha1_runtime_class.erl | erlang | -module(kuberl_v1alpha1_runtime_class).
-export([encode/1]).
-export_type([kuberl_v1alpha1_runtime_class/0]).
-type kuberl_v1alpha1_runtime_class() ::
#{ 'apiVersion' => binary(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_meta(),
'spec' := kuberl_v1alpha1_runti... | |
b8a375aef0b941c328a7203210341d7a9f976b41f523bea03991e096e67d89ab | poscat0x04/telegram-types | StopPoll.hs | module Web.Telegram.Types.Internal.API.StopPoll where
import Common
import Web.Telegram.Types.Internal.API.ChatId
import Web.Telegram.Types.Internal.InlineKeyboardMarkup
data StopPoll = StopPoll
{ chatId :: ChatId,
messageId :: Int,
replyMarkup :: Maybe InlineKeyboardMarkup
}
deriving stock (Show, Eq)
... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/3de0710640f5303638a83e409001b0342299aeb8/src/Web/Telegram/Types/Internal/API/StopPoll.hs | haskell | module Web.Telegram.Types.Internal.API.StopPoll where
import Common
import Web.Telegram.Types.Internal.API.ChatId
import Web.Telegram.Types.Internal.InlineKeyboardMarkup
data StopPoll = StopPoll
{ chatId :: ChatId,
messageId :: Int,
replyMarkup :: Maybe InlineKeyboardMarkup
}
deriving stock (Show, Eq)
... | |
7e12944859732be10b99d3086c5cc528d625cf94ab8cb2b4ff3da20236045862 | cedlemo/OCaml-GI-ctypes-bindings-generator | Print_operation_result.mli | open Ctypes
type t = Error | Apply | Cancel | In_progress
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Print_operation_result.mli | ocaml | open Ctypes
type t = Error | Apply | Cancel | In_progress
val of_value:
Unsigned.uint32 -> t
val to_value:
t -> Unsigned.uint32
val t_view: t typ
| |
b6f1300d76a98cbfeeff7bd82f43357fe8795bf10dcd59d8e19043e3897d68da | jmayaalv/graffito | eql.clj | (ns graffito.lacinia.eql
(:require
[clojure.set :as set]
[clojure.walk :as walk]
[com.walmartlabs.lacinia.executor :as executor]
[com.wsscode.pathom3.connect.indexes :as pci]
[graffito.lacinia.schema :as schema]))
(defn- attribute? [attributes attribute]
(contains? attributes attribute))
(defn- sel... | null | https://raw.githubusercontent.com/jmayaalv/graffito/43abbd6a0033e57917646154cb08c3a6e5d67aec/src/graffito/lacinia/eql.clj | clojure | (ns graffito.lacinia.eql
(:require
[clojure.set :as set]
[clojure.walk :as walk]
[com.walmartlabs.lacinia.executor :as executor]
[com.wsscode.pathom3.connect.indexes :as pci]
[graffito.lacinia.schema :as schema]))
(defn- attribute? [attributes attribute]
(contains? attributes attribute))
(defn- sel... | |
b8e6bd507205c9d5bc572aae7c4dec70d24257ee71b6774ef00d36cb9a505a33 | lenary/idris-erlang | Main.hs | module Main where
import Idris.AbsSyntax
import Idris.Core.TT
import Idris.ElabDecls
import Idris.Main
import Idris.ModeCommon
import Idris.REPL
import IRTS.Compiler
import IRTS.CodegenErlang
import System.Environment
import System.Exit
import Control.Monad (liftM)
import Paths_idris_erlang
data Opts = Opts { inp... | null | https://raw.githubusercontent.com/lenary/idris-erlang/4b7c5aab6bcbe66eb76c90d07e358e500d6c05d9/src/Main.hs | haskell | module Main where
import Idris.AbsSyntax
import Idris.Core.TT
import Idris.ElabDecls
import Idris.Main
import Idris.ModeCommon
import Idris.REPL
import IRTS.Compiler
import IRTS.CodegenErlang
import System.Environment
import System.Exit
import Control.Monad (liftM)
import Paths_idris_erlang
data Opts = Opts { inp... | |
b6289f4fcc937b7f444c66f88c80f3529cea9387dacd6477e539db29f41af5d4 | camlspotter/ocamloscope.2 | t16_class.ml | module M : sig
class c : object
method x : int
end
end = struct
class c = object
method x = 1
end
end
class q = object
method x = 1
end
| null | https://raw.githubusercontent.com/camlspotter/ocamloscope.2/49b5977a283cdd373021d41cb3620222351a2efe/tests/t16_class.ml | ocaml | module M : sig
class c : object
method x : int
end
end = struct
class c = object
method x = 1
end
end
class q = object
method x = 1
end
| |
8fb115eb66b8fb73daafa6ed2c02f0a7ac0935738558191686a8a0063caaa383 | google/lisp-koans | condition-handlers.lisp | Copyright 2013 Google Inc.
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable law or agreed to in writing, software
distrib... | null | https://raw.githubusercontent.com/google/lisp-koans/1e797dbf3246c7af7bbdf4d87a9e8f9b6e1f7692/koans/condition-handlers.lisp | lisp |
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 language governing per... | Copyright 2013 Google Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(define-condition my-condition () ())
(define-condition my-warning (warning) ())
(define-condition my-serious-condition (serious-condition) ())
(define-condition my-error (error) ())
(define-test type-hierarchy... |
2a3f43bd53b06e7381beca4b71a70905d1cfe83b82ca4eb2b026e85ce58ec361 | Drup/peahell | input.ml | module Lex = struct
type error = ..
exception Error of error * Location.loc
type error +=
| Illegal_character of char
let prepare_error = function
| Error (Illegal_character c, loc) ->
Some (Report.errorf ~loc "Illegal character (%s)" (Char.escaped c))
| _ -> None
let () = Report.register... | null | https://raw.githubusercontent.com/Drup/peahell/970d45c789229789a4a876af3ab768a0547e7bf5/common/input.ml | ocaml | module Lex = struct
type error = ..
exception Error of error * Location.loc
type error +=
| Illegal_character of char
let prepare_error = function
| Error (Illegal_character c, loc) ->
Some (Report.errorf ~loc "Illegal character (%s)" (Char.escaped c))
| _ -> None
let () = Report.register... | |
55e584b7c8132cf8aea3a4a7d6bfe7ab9e2d440a5d914a88c91f695f0cb1d302 | ghcjs/ghcjs-dom | VideoTrackList.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.VideoTrackList
(js_item, item, item_, js_getTrackById, getTrackById,
getTrackBy... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/VideoTrackList.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/VideoTrackList.getTrackById Mozilla VideoTrackList.getTrackById documentation>
| <-US/docs/Web/API/VideoTrackList.getTrackById Mozilla VideoTrackList.getTrackById documentation>
| <-US/docs/Web/API/Vide... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.VideoTrackList
(js_item, item, item_, js_getTrackById, getTrackById,
getTrackById_, js_getLength, getLength, js_getSelectedIndex,
getSelectedIndex, change, addTrack, remo... |
c3024a6e4056b816eb184d24bf5d554326f41d00b044705ec6d9a2270ad5ab58 | GrammaTech/sel | terminal-package.lisp | (defpackage :software-evolution-library/terminal
(:use :gt :cffi :cl-interpol)
(:export :make-terminal-raw
:make-terminal-unraw
:ioctl
:term-size
:return-no-extent-term
:*view-stream*
;; Colors and control sequences.
:+set-G1+
:... | null | https://raw.githubusercontent.com/GrammaTech/sel/a59174c02a454e8d588614e221cf281260cf12f8/terminal-package.lisp | lisp | Colors and control sequences. | (defpackage :software-evolution-library/terminal
(:use :gt :cffi :cl-interpol)
(:export :make-terminal-raw
:make-terminal-unraw
:ioctl
:term-size
:return-no-extent-term
:*view-stream*
:+set-G1+
:+reset-G1+
:+b-start+
... |
af24e779ba15611342f248e4f93fa4e707948e2d5f0d4f6b9ff50e2c40ee0033 | nikita-volkov/rerebase | Flip.hs | module Data.Bifunctor.Flip
(
module Rebase.Data.Bifunctor.Flip
)
where
import Rebase.Data.Bifunctor.Flip
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Data/Bifunctor/Flip.hs | haskell | module Data.Bifunctor.Flip
(
module Rebase.Data.Bifunctor.Flip
)
where
import Rebase.Data.Bifunctor.Flip
| |
158ccef0b8277de7b33bd544daad1ae5d78113b1f6d28c28034c265deb6a56a6 | stchang/macrotypes | stlc+rec-iso-tests.rkt | #lang s-exp turnstile/examples/stlc+rec-iso
(require "rackunit-typechecking.rkt")
(define-type-alias IntList (μ (X) (∨ [nil : Unit] [cons : (× Int X)])))
(define-type-alias ILBody (∨ [nil : Unit] [cons : (× Int IntList)]))
;; nil
(define nil (fld {IntList} (var nil = (void) as ILBody)))
(check-type nil : IntList)
;;... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-test/tests/turnstile/stlc%2Brec-iso-tests.rkt | racket | nil
cons
isnil
hd
tl
define-type-alias
error , Complex undefined
records (ie labeled tuples)
no records, only tuples
variants
not enough clauses
wrong clause
too many clauses
mismatched branch types
previous tests: ------------------------------------------------------------
tests for tuples -----------... | #lang s-exp turnstile/examples/stlc+rec-iso
(require "rackunit-typechecking.rkt")
(define-type-alias IntList (μ (X) (∨ [nil : Unit] [cons : (× Int X)])))
(define-type-alias ILBody (∨ [nil : Unit] [cons : (× Int IntList)]))
(define nil (fld {IntList} (var nil = (void) as ILBody)))
(check-type nil : IntList)
(define c... |
74f41a346ed5f01dfa2899721127804e0b04a51c7f72d8c260e4863965b098ad | Haskell-Things/HSlice | Facets.hs | {- ORMOLU_DISABLE -}
-- Slicer.
- Copyright 2016 and
- Copyright 2019
-
- 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
-... | null | https://raw.githubusercontent.com/Haskell-Things/HSlice/a9ac8e51b3031351a34e6a1cfae2a5b7f0319545/Graphics/Slicer/Formats/STL/Facets.hs | haskell | ORMOLU_DISABLE
Slicer.
# LANGUAGE OverloadedStrings #
For our implementation of i2d.
--------------------------------------------------------------
------- Functions to deal with ASCII STL reading -----------
--------------------------------------------------------------
FIXME: handle upper case files.
Separate S... |
- Copyright 2016 and
- Copyright 2019
-
- 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 ve... |
58849541596a570c611314d4993c68367c5b4445ef58f5e52cca07228c4e1c67 | Shinmera/synthy | ui.lisp | (in-package #:org.shirakumo.synthy)
(defclass ui (org.shirakumo.fraf.trial.alloy:ui
org.shirakumo.alloy:smooth-scaling-ui
org.shirakumo.alloy.renderers.simple.presentations:default-look-and-feel)
((alloy:target-resolution :initform (alloy:px-size 1280 720))
(alloy:base-scale :initform ... | null | https://raw.githubusercontent.com/Shinmera/synthy/df4a0889c1baf4b06c15c42f00536907f314e857/ui.lisp | lisp | (in-package #:org.shirakumo.synthy)
(defclass ui (org.shirakumo.fraf.trial.alloy:ui
org.shirakumo.alloy:smooth-scaling-ui
org.shirakumo.alloy.renderers.simple.presentations:default-look-and-feel)
((alloy:target-resolution :initform (alloy:px-size 1280 720))
(alloy:base-scale :initform ... | |
94202b04e40dfe55fba73eef333f64853c5b225fb809a11822ab336e5d16a56e | ocaml/merlin | ptyp_of_type.ml | open Std
open Typedtree
open Types
let var_of_id id = Location.mknoloc @@ Ident.name id
type signature_elt =
| Item of Types.signature_item
| Type of Asttypes.rec_flag * Parsetree.type_declaration list
let rec module_type =
let open Ast_helper in function
| Mty_for_hole -> failwith "Holes are not allowed in ... | null | https://raw.githubusercontent.com/ocaml/merlin/89b9410800dac7bf777f4d3ea8d233c9d8c7e122/src/analysis/ptyp_of_type.ml | ocaml | TODO NOT ALWAYS NONE
mutually recursive types are really handled by [signature] | open Std
open Typedtree
open Types
let var_of_id id = Location.mknoloc @@ Ident.name id
type signature_elt =
| Item of Types.signature_item
| Type of Asttypes.rec_flag * Parsetree.type_declaration list
let rec module_type =
let open Ast_helper in function
| Mty_for_hole -> failwith "Holes are not allowed in ... |
0d7d50f25a2e6c2a062b5b4390da45106cacc0740651c7ec1b6def035cb49512 | sshirokov/CLSQL | expressions.lisp | -*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;; *************************************************************************
;;;;
;;;; Classes defining SQL expressions and methods for formatting the
;;;; appropriate SQL commands.
;;;;
This file is part of CLSQL .
;;;;
CLSQL users are granted the... | null | https://raw.githubusercontent.com/sshirokov/CLSQL/c680432aea0177677ae2ee7b810a7404f7a05cab/sql/expressions.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
*************************************************************************
Classes defining SQL expressions and methods for formatting the
appropriate SQL commands.
(), also known as the LLGPL.
************************************************************************... | This file is part of CLSQL .
CLSQL users are granted the rights to distribute and use this software
as governed by the terms of the Lisp Lesser GNU Public License
(in-package #:clsql-sys)
(defvar +empty-string+ "''")
(defvar +null-string+ "NULL")
(defvar *sql-stream* nil
"stream which accumulates SQL output... |
b89fcd00079254e3ad4358212cef4da62f2b2153ad1c6ba3b28a3528d72e5bb2 | dstarcev/stepic-haskell | Task12.hs | module Module5.Task12 where
pythagoreanTriple :: Int -> [(Int, Int, Int)]
pythagoreanTriple x
| x <= 0 = []
| otherwise = do
b <- [1..x]
a <- [1..b-1]
c <- [1..x]
True <- return $ (a^2 + b^2) == c^2
return (a,b,c)
| null | https://raw.githubusercontent.com/dstarcev/stepic-haskell/6a8cf4b3cc17333ac4175e825db57dbe151ebae0/src/Module5/Task12.hs | haskell | module Module5.Task12 where
pythagoreanTriple :: Int -> [(Int, Int, Int)]
pythagoreanTriple x
| x <= 0 = []
| otherwise = do
b <- [1..x]
a <- [1..b-1]
c <- [1..x]
True <- return $ (a^2 + b^2) == c^2
return (a,b,c)
| |
5b7b9f3490a17de3daaf6bbf35d3f66bb1f85ffeb6198877c1a86c1a014c1966 | ekmett/ersatz | Equatable.hs | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# OPTIONS_HADDOCK not - home #
--------------------------------------------------------------------
-- |
Copyright : © 2010 - 2014 , ... | null | https://raw.githubusercontent.com/ekmett/ersatz/7e08a601391cdf3273207b6dd8cb7c9be6e5564e/src/Ersatz/Equatable.hs | haskell | ------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Portability: non-portable
------------------------------------------------------------------
| Instances for this class for arbitrary types can be automatically derived from 'Generic'.
| Compare for e... | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# OPTIONS_HADDOCK not - home #
Copyright : © 2010 - 2014 , 2013
Maintainer : < >
module Ersatz.Equatable
( Equatable(..)
... |
3fc405976355d74119bbb049fe749192b2018f3ff7948f149d436cdf3f102116 | isakmp/ike | engine.mli | open Return
(* the main engine *)
type t
(* failures, to be shown to us *)
type failure = [
| `InvalidFoo
| `InvalidBar
]
val pp_failure : Format.formatter * failure -> unit
type sad_change
type ret =
(t * sad_change list * Cstruct.t list,
sad_change list) return
val active_pads : Config.t -> peer_auth l... | null | https://raw.githubusercontent.com/isakmp/ike/fa93543941a77f6b09c88d8bb149dd0d40acc635/src/engine.mli | ocaml | the main engine
failures, to be shown to us
main handler for incoming bytes | open Return
type t
type failure = [
| `InvalidFoo
| `InvalidBar
]
val pp_failure : Format.formatter * failure -> unit
type sad_change
type ret =
(t * sad_change list * Cstruct.t list,
sad_change list) return
val active_pads : Config.t -> peer_auth list
val initiator : Config.t -> peer_auth -> t * (Ipadd... |
e8704c9be0197563d095a20fc70f69d40fa6773318f6b0992c4585b727b0430f | raimohanska/rx-haskell | Examples.hs | import Rx
import PushCollection
putStrLnObserver = onEnd (toObserver putStrLn) (putStrLn "end")
testPushCollection :: IO ()
testPushCollection = do
pushCollection <- newPushCollection
dispose <- subscribe (observablePushCollection pushCollection) putStrLnObserver
dispose2 <- subscribe (observablePushCollecti... | null | https://raw.githubusercontent.com/raimohanska/rx-haskell/4218f9c1f02f5237ce4f3d9b9ceb8356d66300aa/Examples.hs | haskell | import Rx
import PushCollection
putStrLnObserver = onEnd (toObserver putStrLn) (putStrLn "end")
testPushCollection :: IO ()
testPushCollection = do
pushCollection <- newPushCollection
dispose <- subscribe (observablePushCollection pushCollection) putStrLnObserver
dispose2 <- subscribe (observablePushCollecti... | |
6254b154f1c9c389192088e71eb73b89560b2eb752c32bed8690ceb9cf1b9bd3 | arow-oss/goat-guardian | Types.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module GoatGuardian.Types where
import Control.Monad (replicateM)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Data.Text (Text, pack)
import Database.Persist (PersistField)
import Database.Persist.Sql (PersistFieldSql)
import System.Random (randomRIO)
import Web.HttpA... | null | https://raw.githubusercontent.com/arow-oss/goat-guardian/85e25fe8d618a0707b54e0e25858429158d96f75/src/GoatGuardian/Types.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
module GoatGuardian.Types where
import Control.Monad (replicateM)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Data.Text (Text, pack)
import Database.Persist (PersistField)
import Database.Persist.Sql (PersistFieldSql)
import System.Random (randomRIO)
import Web.HttpA... | |
c3ccd78c27dd85288838bb6cc77eef8b4eeb50bfee0fb9ecbbe215cd2309a3c1 | bennn/dissertation | strategy.rkt | #lang typed/racket
;; ---------------------------------------------------------------------------------------------------
;; implementing Acquire game strategies
(provide
ordered-s
random-s
)
;; ---------------------------------------------------------------------------------------------------
;; IMPLEMENTATION
(... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/jfp-2019/benchmarks/acquire/typed/strategy.rkt | racket | ---------------------------------------------------------------------------------------------------
implementing Acquire game strategies
---------------------------------------------------------------------------------------------------
IMPLEMENTATION
===============================================================... | #lang typed/racket
(provide
ordered-s
random-s
)
(require
require-typed-check
"../base/types.rkt"
"board-adapted.rkt"
"state-adapted.rkt"
)
(require/typed/check "basics.rkt"
(ALL-HOTELS (Listof Hotel))
(SHARES-PER-TURN# Integer)
(hotel<=? (-> Hotel Hotel Boolean))
(price-per-share (-> Hotel Natural (... |
c5670670d9a2bcae51d3ce457f223b1325bbe17ef767b9982bcc3dea4c94f5bc | oshyshko/adventofcode | D16.hs | module Y21.D16 where
import Imports
import Parser
import Util
data Packet = Packet
{ version :: Int
, op :: Op
, args :: [Packet]
} deriving (Show, Eq)
data Op
= Sum
| Product
| Minimum
| Maximum
| Literal Int
| Greater
| Lesser
| ... | null | https://raw.githubusercontent.com/oshyshko/adventofcode/95938bb9b91b964394d4ee1def3bc9bf9c928e09/src/Y21/D16.hs | haskell | op args
(Literal x, [])
(<all other Ops>, [args]) | module Y21.D16 where
import Imports
import Parser
import Util
data Packet = Packet
{ version :: Int
, op :: Op
, args :: [Packet]
} deriving (Show, Eq)
data Op
= Sum
| Product
| Minimum
| Maximum
| Literal Int
| Greater
| Lesser
| ... |
406d20827521e267891a0060057c6b6b6d7319cd0404b82cadc0a9cda0405b56 | cjay/vulkyrie | FPS.hs | {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Strict #-}
module Vulkyrie.Examples.FPS
( runMyVulkanProgram
) where
import Control.Monad
import qualified Graphics.UI.GLFW as GLFW
import Graphics.Vulkan.Core_1_0
import Graphics.Vulkan.Ext.VK_KHR_swapchain
import Numeric.Dat... | null | https://raw.githubusercontent.com/cjay/vulkyrie/b0fda92a843882d30137ead57670a42fa9abdf1c/src/Vulkyrie/Examples/FPS.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE Strict #
rectangle
coordinate texture coordinate
rectangle
| cam rotation using (yaw, pitch)
[uniformBinding 0]
push constant ranges
descriptorBufferInfos <- mapM (uboBufferInfo transObjSize) transObjBufs
forM_ (zip descriptorBufferInfos frameDescr... | module Vulkyrie.Examples.FPS
( runMyVulkanProgram
) where
import Control.Monad
import qualified Graphics.UI.GLFW as GLFW
import Graphics.Vulkan.Core_1_0
import Graphics.Vulkan.Ext.VK_KHR_swapchain
import Numeric.DataFrame
import UnliftIO.MVar
import ... |
0cd0c7cffcdb0a47409c06b9cf524368c36b8d6ab47a4a214cb2d9adc2ae31e3 | cardmagic/lucash | signals.scm | Signal constant definitions for " generic "
Copyright ( c ) 1994 by . See file COPYING .
Copyright ( c ) 1994 by .
;;POSIX only defined here.
(define-enum-constants signal
;; POSIX
(hup 1) ; hangup
(int 2) ; interrupt
(quit 3) ; quit
(ill 4) ; illegal instruction (not reset when caught)
(io... | null | https://raw.githubusercontent.com/cardmagic/lucash/0452d410430d12140c14948f7f583624f819cdad/reference/scsh-0.6.6/scsh/generic/signals.scm | scheme | POSIX only defined here.
POSIX
hangup
interrupt
quit
illegal instruction (not reset when caught)
IOT instruction
floating point exception
kill (cannot be caught or ignored)
segmentation violation
write on a pipe with no one to read it
alarm clock
software termination signal from kill
stop signal ... | Signal constant definitions for " generic "
Copyright ( c ) 1994 by . See file COPYING .
Copyright ( c ) 1994 by .
(define-enum-constants signal
used by abort , replace in the future
sendable stop signal not from tty
user defined signal 1
user defined signal 2
)
(define signals-ignored-by-defau... |
aaff008e35b942152788693ef12e4d10dde04a2def8ea31e627f73aaef0c346f | halgari/mjolnir | bf.clj | (ns examples.bf
(:require [mjolnir.expressions :as exp]
[mjolnir.inference :refer [infer-all]]
[mjolnir.validation :refer [validate]]
[mjolnir.constructors-init :as const]
[mjolnir.types :refer [Int64 ->PointerType valid? ->ArrayType]]
[mjolnir.llvmc :as l]
... | null | https://raw.githubusercontent.com/halgari/mjolnir/cfb82a55bc316a6a0e235b46f6ee04c6b55c8cc5/src/examples/bf.clj | clojure | loop logic | (ns examples.bf
(:require [mjolnir.expressions :as exp]
[mjolnir.inference :refer [infer-all]]
[mjolnir.validation :refer [validate]]
[mjolnir.constructors-init :as const]
[mjolnir.types :refer [Int64 ->PointerType valid? ->ArrayType]]
[mjolnir.llvmc :as l]
... |
4c5ad7fcc66e829f5de8cb79ce49ed52b227d89d819675b1635bbe54a265c543 | ds-wizard/engine-backend | Detail_GET.hs | module Wizard.Specs.API.DocumentTemplateDraft.Asset.Detail_GET (
detail_GET,
) where
import Data.Aeson (encode)
import Network.HTTP.Types
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai hiding (shouldRespondWith)
import Test.Hspec.Wai.Matcher
import Shared.Database.Migration.Development.Doc... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/acb7588714b0082ae5afaa166aa61c89c602526e/engine-wizard/test/Wizard/Specs/API/DocumentTemplateDraft/Asset/Detail_GET.hs | haskell | ------------------------------------------------------------------------
GET /document-template-drafts/{documentTemplateId}/assets/{assetUuid}
------------------------------------------------------------------------
----------------------------------------------------
----------------------------------------------... | module Wizard.Specs.API.DocumentTemplateDraft.Asset.Detail_GET (
detail_GET,
) where
import Data.Aeson (encode)
import Network.HTTP.Types
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai hiding (shouldRespondWith)
import Test.Hspec.Wai.Matcher
import Shared.Database.Migration.Development.Doc... |
35e3352d44a23d989967485437071377ba0d5734ebbedf50fb310a1b3527ff7a | DSiSc/why3 | parse_smtv2_model.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/driver/parse_smtv2_model.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
Parses the model returned by CVC4 and Z3 .
open Model_parser
open Lexing
let debug = Debug.register_inf... |
8f23d231badc02d6ffca2fbf436be01fd5737abcfe3e5f5e1f21354e96ae5c6a | motoshira/lib_for_competitive_programming | binary-trie.lisp | (defpackage :test/binary-trie
(:use #:cl #:binary-trie)
(:import-from #:rove
#:testing
#:ok
#:deftest))
(in-package #:test/binary-trie)
(deftest binary-trie-test
(testing "add! and remove!"
(let ((bnt nil))
(add! bnt 1)
(add! bnt 10)
(add! bn... | null | https://raw.githubusercontent.com/motoshira/lib_for_competitive_programming/f0e8129d7747dbde946162c37e82c49577b01f15/test/binary-trie.lisp | lisp | (defpackage :test/binary-trie
(:use #:cl #:binary-trie)
(:import-from #:rove
#:testing
#:ok
#:deftest))
(in-package #:test/binary-trie)
(deftest binary-trie-test
(testing "add! and remove!"
(let ((bnt nil))
(add! bnt 1)
(add! bnt 10)
(add! bn... | |
0c0e322641ebe3ea682b11fbffa870e0483fed348d5cab0079c9b5efb203e88d | andrewjstone/rafter | rafter_backend_ets.erl | -module(rafter_backend_ets).
-behaviour(rafter_backend).
%% rafter_backend callbacks
-export([init/1, stop/1, read/2, write/2]).
-record(state, {peer :: atom() | {atom(), atom()}}).
init(Peer) ->
State = #state{peer=Peer},
NewState = stop(State),
_Tid1 = ets:new(rafter_backend_ets, [set, named_table, pu... | null | https://raw.githubusercontent.com/andrewjstone/rafter/6bc630b487ef26770df78afbbc97995cfe0b7b5a/src/rafter_backend_ets.erl | erlang | rafter_backend callbacks | -module(rafter_backend_ets).
-behaviour(rafter_backend).
-export([init/1, stop/1, read/2, write/2]).
-record(state, {peer :: atom() | {atom(), atom()}}).
init(Peer) ->
State = #state{peer=Peer},
NewState = stop(State),
_Tid1 = ets:new(rafter_backend_ets, [set, named_table, public]),
_Tid2 = ets:new(... |
c55193b0fda0626a978d431f7ab1c7718308a414f6e673a2b1444a50f2999090 | jlongster/gambit-iphone-example | image.scm |
(c-declare #<<end-c-code
CGImageRef CGImageRef_load(const char *filename) {
NSString *path = [NSString stringWithFormat:@"%@/%s",
[[NSBundle mainBundle] resourcePath],
filename];
UIImage *img = [UIImage imageWithContentsOfFile:path];
if(img) return [img CGImage... | null | https://raw.githubusercontent.com/jlongster/gambit-iphone-example/e55d915180cb6c57312cbb683d81823ea455e14f/lib/ffi/image.scm | scheme |
(c-declare #<<end-c-code
CGImageRef CGImageRef_load(const char *filename) {
NSString *path = [NSString stringWithFormat:@"%@/%s",
[[NSBundle mainBundle] resourcePath],
}
unsigned char* CGImageRef_data(CGImageRef image) {
CGContextRef context = CGBitmapContextCreate(data,
... | |
6b7b6edb8bf8088fcfde167f7e9a8887b079383d7fb703e173b1f98ed90b3c85 | mikelevins/folio2 | as-syntax.lisp | ;;;; ***********************************************************************
;;;;
Name : syntax.lisp
;;;; Project: folio2 - Functional idioms for Common Lisp
;;;; Purpose: reader macro for type conversions
;;;; Author: mikel evins
Copyright : 2015 by mikel evins
;;;;
;;;; *********... | null | https://raw.githubusercontent.com/mikelevins/folio2/a96052f78f0e0358376a498c6351342ece6a9b7b/src/as-syntax.lisp | lisp | ***********************************************************************
Project: folio2 - Functional idioms for Common Lisp
Purpose: reader macro for type conversions
Author: mikel evins
*********************************************************************** | Name : syntax.lisp
Copyright : 2015 by mikel evins
(in-package :net.bardcode.folio2.as)
(defun read-type-constraint (stream subchar num)
(declare (ignore num subchar))
(let* ((constraint-spec (read-delimited-list #\] stream t))
(type-constraint (first constraint-spec))
(expr (... |
2ec8ee1bae1e00dde7853996d63271373c93c035e3dcbc3aad930cc94a9bd9b1 | fgalassi/cs61a-sp11 | 3.13.scm | (define (make-cycle x)
(set-cdr! (last-pair x) x)
x)
(define z (make-cycle (list 'a 'b 'c)))
; -> [a|*] -> [b|*] -> [c|*]-
; ^ |
; | |
; ---------------------
;
; (last-pair z) generates an infinite loop
| null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/homework/3.13.scm | scheme | -> [a|*] -> [b|*] -> [c|*]-
^ |
| |
---------------------
(last-pair z) generates an infinite loop | (define (make-cycle x)
(set-cdr! (last-pair x) x)
x)
(define z (make-cycle (list 'a 'b 'c)))
|
cc6160b781251abc323bb0b8910f42b37dae6243ca8e0816c37db175d4e4c617 | ocaml-opam/opam2web | o2wGlobals.mli | (**************************************************************************)
(* *)
Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml-opam/opam2web/0797940ad5fa779555d34a5561dc288e10fca0b1/src/o2wGlobals.mli | ocaml | ************************************************************************
All rights reserved.This file is distributed under the terms of the
exception. ... | Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 3.0 with linking
OPAM is distributed in the hope that it will be useful , but WITHOUT
or FITNESS FOR A P... |
da2e8c1f0140de322746005e81b5cbcad121fe63a5f4a6171b2dae5d5b4fde40 | LuxLang/lux | common.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.analyser.proc.common
(:require (clojure [template :refer [do-template]])
clojure.core.match
clojure.core.match.... | null | https://raw.githubusercontent.com/LuxLang/lux/91bc060bc498a0d2418198cfcb9dc39636d1d867/lux-bootstrapper/src/lux/analyser/proc/common.clj | clojure | lux.Left
lux.Right
Special extensions for performance reasons
Will be replaced by custom extensions in the future.
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.analyser.proc.common
(:require (clojure [template :refer [do-template]])
clojure.core.match
clojure.core.match.... |
10940a607dd5770636f7ffb2a3846e9a6a6bdcfd7dc18c9cd3abdd413bcd1a01 | clj-kondo/config | with_mock.clj | (ns clj-kondo.mockery.with-mock
(:require [clj-kondo.hooks-api :as api]))
(defn with-mock [{:keys [:node]}]
(let [[mock map & body] (rest (:children node))]
(try
(when-not (symbol? (api/sexpr mock))
(throw (ex-info "Mock is not a symbol" (meta mock))))
(when-not (map? (api/sexpr map))
... | null | https://raw.githubusercontent.com/clj-kondo/config/b31c108bf13ece623850596363d2cb7350a5e5fe/resources/clj-kondo.exports/clj-kondo/mockery/clj_kondo/mockery/with_mock.clj | clojure | when there is an error, ignore macro and only return body (in vector to prevent redundant do) | (ns clj-kondo.mockery.with-mock
(:require [clj-kondo.hooks-api :as api]))
(defn with-mock [{:keys [:node]}]
(let [[mock map & body] (rest (:children node))]
(try
(when-not (symbol? (api/sexpr mock))
(throw (ex-info "Mock is not a symbol" (meta mock))))
(when-not (map? (api/sexpr map))
... |
abdc135bc70c37f5d49c1fa3ba7a50de37a24fe2ed05d249b545d2170872ec68 | geremih/xcljb | xf86vidmode.clj | This file is automatically generated . DO NOT MODIFY .
(clojure.core/ns
xcljb.gen.xf86vidmode
(:require xcljb.conn-ext xcljb.gen.xf86vidmode-types))
(def
-XCLJB
{:minor-version 2,
:major-version 2,
:header "xf86vidmode",
:extension-multiword false,
:extension-name "XF86VidMode",
:extension-xname "XFre... | null | https://raw.githubusercontent.com/geremih/xcljb/59e9ff795bf00595a3d46231a7bb4ec976852396/src/xcljb/gen/xf86vidmode.clj | clojure | Manually written. | This file is automatically generated . DO NOT MODIFY .
(clojure.core/ns
xcljb.gen.xf86vidmode
(:require xcljb.conn-ext xcljb.gen.xf86vidmode-types))
(def
-XCLJB
{:minor-version 2,
:major-version 2,
:header "xf86vidmode",
:extension-multiword false,
:extension-name "XF86VidMode",
:extension-xname "XFre... |
6dbaa7f9dec1fd18b374dfc43a418a44c1c9613dc48c971e09d3f1ef5cec3086 | coq/coq | autorewrite.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/8f1590f7840d0dff71fa9b7a7bbc1ed01d779359/tactics/autorewrite.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
3249645abc0410cebeb071a012e381a2849a9189c19d2b97b77d4f38cdb6cddc | racket/web-server | elim-letrec.rkt | #lang racket/base
(require (for-template racket/base)
syntax/kerncase
racket/list
racket/contract
(for-template "abort-resume.rkt")
"util.rkt")
(provide/contract
[elim-letrec ((listof syntax?) . -> . (syntax? . -> . syntax?))]
[elim-letrec-term (syntax? . -> . syn... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/lang/elim-letrec.rkt | racket | Eliminates letrec-values from syntax[2] and correctly handles references to | #lang racket/base
(require (for-template racket/base)
syntax/kerncase
racket/list
racket/contract
(for-template "abort-resume.rkt")
"util.rkt")
(provide/contract
[elim-letrec ((listof syntax?) . -> . (syntax? . -> . syntax?))]
[elim-letrec-term (syntax? . -> . syn... |
61255ef72342efd380efc67ef2a47285e55e9244dcd540902478db23102e1898 | avieth/diplomacy | GreatPower.hs | |
Module : Diplomacy . GreatPower
Description : Definition of the great powers ( countries ) .
Copyright : ( c ) , 2015
Licence : :
Stability : experimental
Portability : non - portable ( GHC only )
Module : Diplomacy.GreatPower
Description : Definition of the great powers (c... | null | https://raw.githubusercontent.com/avieth/diplomacy/a8cd128a05ca683618704ad585ca6051ebff2f5b/src/Diplomacy/GreatPower.hs | haskell | # LANGUAGE GADTs # | |
Module : Diplomacy . GreatPower
Description : Definition of the great powers ( countries ) .
Copyright : ( c ) , 2015
Licence : :
Stability : experimental
Portability : non - portable ( GHC only )
Module : Diplomacy.GreatPower
Description : Definition of the great powers (c... |
a951bb7195023985c35746cdd3459744825d703fcf92b1053c1d1bfc6e16a3f8 | soenkehahn/getopt-generics | Test03.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
module Test03 where
import WithCli
main :: IO ()
main = withCli run
run :: (A, B) -> IO ()
run options = do
print (options :: (A, B))
data A
= A {
aa :: String
}
deriving (Show, Generic, HasArguments)
data B
= B {
bb :: String
}
deri... | null | https://raw.githubusercontent.com/soenkehahn/getopt-generics/735319c8146043f704d17f06b7bbfa41d84fe3e6/docs/Test03.hs | haskell | # LANGUAGE DeriveAnyClass # | # LANGUAGE DeriveGeneric #
module Test03 where
import WithCli
main :: IO ()
main = withCli run
run :: (A, B) -> IO ()
run options = do
print (options :: (A, B))
data A
= A {
aa :: String
}
deriving (Show, Generic, HasArguments)
data B
= B {
bb :: String
}
deriving (Show, Generic, HasArgument... |
3e3de71514fa0e2a92e159d2b6c64baaee672fc85a0ed2a97555c4269a5ed420 | gfngfn/apbuf | genMlScheme.ml |
open Types
module type CONSTANT = sig
val fun_decode_field : string
val fun_decode_and_then : string * bool
val fun_decode_map : string
val fun_decode_succeed : string
val fun_decode_fail : string
val fun_decode_string : string
val fun_encode_object : string
val fun_encode_string : st... | null | https://raw.githubusercontent.com/gfngfn/apbuf/8f5cfb009d6e07236d3ac5aacfd4247017f20cc1/src/genMlScheme.ml | ocaml |
open Types
module type CONSTANT = sig
val fun_decode_field : string
val fun_decode_and_then : string * bool
val fun_decode_map : string
val fun_decode_succeed : string
val fun_decode_fail : string
val fun_decode_string : string
val fun_encode_object : string
val fun_encode_string : st... | |
53a88ba80c040c03da11f56a81a6e2a750cc27d78807a4d546e09b29aebf9f45 | GaloisInc/lean-haskell-bindings | Exception.hs | |
Module : Language . . Exception
Copyright : ( c ) Galois Inc , 2015
License : Apache-2
Maintainer : ,
Exceptions thrown by .
Module : Language.Lean.Exception
Copyright : (c) Galois Inc, 2015
License : Apache-2
Maintainer : ,
Exceptions thrown by Lean.
-}
{-# LANGUAGE Saf... | null | https://raw.githubusercontent.com/GaloisInc/lean-haskell-bindings/2b2baa147af804551c8bcbe44f0ef3f53f8a3e9c/src/Language/Lean/Exception.hs | haskell | # LANGUAGE Safe #
, exceptionDetailedMessage | |
Module : Language . . Exception
Copyright : ( c ) Galois Inc , 2015
License : Apache-2
Maintainer : ,
Exceptions thrown by .
Module : Language.Lean.Exception
Copyright : (c) Galois Inc, 2015
License : Apache-2
Maintainer : ,
Exceptions thrown by Lean.
-}
module Language.... |
e4701403115120d6ff3b574b832673ed23c194491be62b14a1bf359adbf9cacd | melange-re/melange-compiler-libs | matching.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/melange-re/melange-compiler-libs/2fac95b0ea97fb676240662aeeec8c6f6495dd9c/lambda/matching.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Compilation of pattern matching
Based upon Lefessant - Maranget ` ` Optimizing Pattern - Matching... |
16f8bd84111ff0298ffb349abb3af2af630f13326499b81281cb00aa0308f050 | thizanne/ocaml-hamt | hamt_tests.ml | module Int_map = Hamt.Int
let print pp map =
let bindings = Int_map.bindings map in
let pp_sep fmt () = Format.pp_print_char fmt ';' in
let pair fmt (k, v) = Format.fprintf fmt "%d = %a" k pp v in
Format.printf "[%a]@." (Format.pp_print_list ~pp_sep pair) bindings
let print_str map = print (fun fmt s -> Forma... | null | https://raw.githubusercontent.com/thizanne/ocaml-hamt/bb01c38ee47727d2d447c78e0b87a6593dca6377/lib_test/inline/hamt_tests.ml | ocaml | module Int_map = Hamt.Int
let print pp map =
let bindings = Int_map.bindings map in
let pp_sep fmt () = Format.pp_print_char fmt ';' in
let pair fmt (k, v) = Format.fprintf fmt "%d = %a" k pp v in
Format.printf "[%a]@." (Format.pp_print_list ~pp_sep pair) bindings
let print_str map = print (fun fmt s -> Forma... | |
6a397cdc6795dbd2a2434077dfea716603ca3a2bb519393f10159fc235046fce | theodormoroianu/SecondYearCourses | HaskellChurch_20210415163014.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 = show $ cIf b True False
The boolean constant true always chooses the ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163014.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 = show $ cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: C... |
2d9262276666e3cfafe57893771bc7b8760f6556cfb5b8016ac526a3f8db8485 | larsen/wiz | Parser.hs | module Wiz.Parser (
pForm,
pProgram,
loadProgram
) where
import Wiz.Types
-- import Wiz.Environment
import Text.Parsec.Char (spaces)
import Text.Parsec.String (Parser)
import Text.Parsec (anyChar, endOfLine, parse, char, digit, string, noneOf, try, sepBy, (<|>))
import Text.Parsec.Combinator (choice, man... | null | https://raw.githubusercontent.com/larsen/wiz/59b8c5fa5a1bde0a5ed83261599407e2d80efb25/src/Wiz/Parser.hs | haskell | import Wiz.Environment
test rule = parse rule "(source)" | module Wiz.Parser (
pForm,
pProgram,
loadProgram
) where
import Wiz.Types
import Text.Parsec.Char (spaces)
import Text.Parsec.String (Parser)
import Text.Parsec (anyChar, endOfLine, parse, char, digit, string, noneOf, try, sepBy, (<|>))
import Text.Parsec.Combinator (choice, many1, manyTill)
import Contr... |
3368e6f8178a5ee276fc0464d078bf4592e831947e85c5b2081828dd29a297ac | RBornat/jape | predicate.mli |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... | null | https://raw.githubusercontent.com/RBornat/jape/1f757680878527eebd04919f00bfb18a9b41bdf2/distrib/camlengine/predicate.mli | ocaml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either ver... | |
0f949558801ea58f1e4779505251a1e39d84a00016e1ed852fc53d4ecf8d5469 | haskell-perf/xml | Time.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import Control.Monad.ST
import Criterion... | null | https://raw.githubusercontent.com/haskell-perf/xml/2d11ed2a2fd53721429dfcdcf3e3e0aa58c432c7/Time.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import Control.Monad.ST
import Criterion.Main
import Criterion.Ty... |
1ca9d7deb224e7454c5c48730e88ef480f1362a70473db9bcff8375079ebfe81 | DavidVujic/clojurescript-amplified | core.cljs | (ns app.amplified.core
(:require ["/aws-exports" :default ^js aws-exports]
["aws-amplify" :default Amplify]
[app.amplified.auth :as auth]
[app.amplified.events]
[app.amplified.views :as views]
[re-frame.core :as rf]
[reagent.dom :as rdom]))
(def... | null | https://raw.githubusercontent.com/DavidVujic/clojurescript-amplified/5bdc42f8803a72395e29e8739fcb252d7d97791b/src/main/app/amplified/core.cljs | clojure | (ns app.amplified.core
(:require ["/aws-exports" :default ^js aws-exports]
["aws-amplify" :default Amplify]
[app.amplified.auth :as auth]
[app.amplified.events]
[app.amplified.views :as views]
[re-frame.core :as rf]
[reagent.dom :as rdom]))
(def... | |
ec3d98131b5c6a7291866ba3d483ae904893641b04ae8ce001785e75dac13c54 | jeroanan/rkt-coreutils | tac.rkt | #lang s-exp "util/frontend-program.rkt"
(simple-file-handler-program2 "repl/tac.rkt" tac)
| null | https://raw.githubusercontent.com/jeroanan/rkt-coreutils/571629d1e2562c557ba258b31ce454add2e93dd9/src/tac.rkt | racket | #lang s-exp "util/frontend-program.rkt"
(simple-file-handler-program2 "repl/tac.rkt" tac)
| |
4da724ceadc32c685bdaa51b9bd94df66993ec637036ef8416ab3c557aea8693 | haskell-suite/base | Data.hs | # LANGUAGE Trustworthy #
# LANGUAGE CPP , RankNTypes , ScopedTypeVariables #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Data
Copyright : ( c ) The University of Glasgow , CWI 2001 - -2004
-- License : BSD-style (see the file libraries/base/LICE... | null | https://raw.githubusercontent.com/haskell-suite/base/1ee14681910c76d0a5a436c33ecf3289443e65ed/Data/Data.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Data
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (local universal quantification)
- Generic programming in Haskell .
See ... | # LANGUAGE Trustworthy #
# LANGUAGE CPP , RankNTypes , ScopedTypeVariables #
Copyright : ( c ) The University of Glasgow , CWI 2001 - -2004
the ' Data ' class with its primitives for generic programming , along
the previous " Data . Generics . Basics " and almost all of
" Data . Generics . Instances " . T... |
2517d2a43835996d87107effe9598d9ed7d440e4a7d18e9182236f28212b971b | mirage/irmin-server | tree.ml | open Lwt.Syntax
open Lwt.Infix
open Irmin_client_unix
module Store = Irmin_mem.KV.Make (Irmin.Contents.String)
module Client = Make (Store)
module Info = Info (Client.Info)
let main =
let uri = Utils.get_url in
let* repo = Client.connect uri in
let* client = Client.main repo in
(* Create an empty tree. This t... | null | https://raw.githubusercontent.com/mirage/irmin-server/d7dc30e5644160f4004dd7b708a841fbc99ad8c0/examples/tree.ml | ocaml | Create an empty tree. This tree will remain on the client-side until
committed to the store.
Set foo => bar
Check that the tree has been updated
Commit the tree
Get the tree back, now instead of existing on the client-side, you get a
key to the stored tree
Check to make sure the store contains foo ... | open Lwt.Syntax
open Lwt.Infix
open Irmin_client_unix
module Store = Irmin_mem.KV.Make (Irmin.Contents.String)
module Client = Make (Store)
module Info = Info (Client.Info)
let main =
let uri = Utils.get_url in
let* repo = Client.connect uri in
let* client = Client.main repo in
let tree = Client.Tree.empty ()... |
4216db9a7bb5f6262983380f85cdbcf3e44ca8b01b479daa64b961f191a08ebd | acieroid/scala-am | my-list.scm | Expected result : 3
(define (my-cons el lst)
(cons el lst))
(define my-list
(my-cons 1
(my-cons 2
(my-cons 3 '()))))
my-list | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/R5RS/my-list.scm | scheme | Expected result : 3
(define (my-cons el lst)
(cons el lst))
(define my-list
(my-cons 1
(my-cons 2
(my-cons 3 '()))))
my-list | |
d15962283a81572a4c5c09cb720c72c7bd2168bfc010305a88ae506b0f48f427 | mbillingr/lisp-in-small-pieces | exercise6-03.scm | (import (builtin core)
(libs utils)
(libs book)
(06-fast-interpreter common))
(define (meaning e r tail?)
(if (atom? e)
(if (symbol? e) (meaning-reference e r tail?)
(meaning-quotation e r tail?))
(case (car e)
((quote) (meaning-quotation (cadr e) r... | null | https://raw.githubusercontent.com/mbillingr/lisp-in-small-pieces/b2b158dfa91dc95d75af4bd7d93f8df22219047e/06-fast-interpreter/exercise6-03.scm | scheme | the form (do) and because of lazyness. | (import (builtin core)
(libs utils)
(libs book)
(06-fast-interpreter common))
(define (meaning e r tail?)
(if (atom? e)
(if (symbol? e) (meaning-reference e r tail?)
(meaning-quotation e r tail?))
(case (car e)
((quote) (meaning-quotation (cadr e) r... |
8b0f9930142df7746f40bcb28b90344d9b282c6dd4fd9565024e9f3854cb0486 | podenv/podenv | Notifications.hs | # LANGUAGE NumericUnderscores #
# LANGUAGE NoImplicitPrelude #
module Podenv.Notifications
( Notifier (..),
Severity (..),
Output (..),
pickNotifier,
-- * helpers
defaultNotifier,
consoleNotifier,
zenityNotifier,
)
where
import Podenv.Prelude
import System.Exit (ExitCode (..))
import ... | null | https://raw.githubusercontent.com/podenv/podenv/7288356d7b6acef7ea74052229ec00491b440d3d/src/Podenv/Notifications.hs | haskell | * helpers | # LANGUAGE NumericUnderscores #
# LANGUAGE NoImplicitPrelude #
module Podenv.Notifications
( Notifier (..),
Severity (..),
Output (..),
pickNotifier,
defaultNotifier,
consoleNotifier,
zenityNotifier,
)
where
import Podenv.Prelude
import System.Exit (ExitCode (..))
import System.Posix.IO q... |
0fef2ecb879f4a127c035de8e1532b3b5cffad06d8d24dcdbed04c654e0bd474 | lamdu/hypertypes | Nodes.hs | # LANGUAGE EmptyCase #
# LANGUAGE TemplateHaskell #
| Generate ' HNodes ' instances via
module Hyper.TH.Nodes
( makeHNodes
) where
import qualified Control.Lens as Lens
import GHC.Generics (V1)
import Hyper.Class.Nodes (HNodes (..), HWitness (..))
import Hyper.TH.Internal.Utils
import Language.Haskell.TH
i... | null | https://raw.githubusercontent.com/lamdu/hypertypes/0ec0aa2a7fb6af4bb70727d7ee590bcc02b607ed/src/Hyper/TH/Nodes.hs | haskell | | Generate a 'HNodes' instance | # LANGUAGE EmptyCase #
# LANGUAGE TemplateHaskell #
| Generate ' HNodes ' instances via
module Hyper.TH.Nodes
( makeHNodes
) where
import qualified Control.Lens as Lens
import GHC.Generics (V1)
import Hyper.Class.Nodes (HNodes (..), HWitness (..))
import Hyper.TH.Internal.Utils
import Language.Haskell.TH
i... |
e7cc378933469c5c3afb931dd866a6999968251cc1c52d4a337abe8d94860163 | goldfirere/singletons | ShowSing.hs | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 806
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE... | null | https://raw.githubusercontent.com/goldfirere/singletons/04d7d253bf5e5f4a2533bc1257bfb0a07645a154/singletons/src/Data/Singletons/ShowSing.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Singletons.ShowSing
License : BSD-style (see LICENSE)
Stability : experimental
Portability : non-portable
Defines the class 'ShowSing' which is useful for defining 'Show' instances
for singleton types. Bec... | # LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 806
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MonoLocalBinds #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE... |
1e251d01cb9864b14aa51b6f321e06ae35cd31f80107907da75777342ff2c133 | eyedouble/couchdb | couchdb_attachments.erl | %% @doc The `couchdb_attachments' module contains functionality listed under CouchDB API
%% Reference section 1.4.2.
%% CouchDB documents can have attachments just like an email message can have attachments.
%% An attachment is identified by a name and includes its MIME type (or Content-Type) and the
%% number of byt... | null | https://raw.githubusercontent.com/eyedouble/couchdb/39830e536e803dfb492bfdb8b3644839cdd7e356/src/sections/couchdb_documents/couchdb_attachments.erl | erlang | @doc The `couchdb_attachments' module contains functionality listed under CouchDB API
Reference section 1.4.2.
CouchDB documents can have attachments just like an email message can have attachments.
An attachment is identified by a name and includes its MIME type (or Content-Type) and the
number of bytes the att... | -module(couchdb_attachments).
-include("couchdb.hrl").
-include("../../dev.hrl").
-export([
get/3
,get/4
,get_stream/3
,get_stream/4
,stream/1
,delete/3
,delete/4
,put/4
,put/5
,send/2
]).
@equiv get(Db , DocId , Name , [ ] )
-spec(get(db(), map(), binary()) -> {ok, binary(... |
f54a1646e87a32e9deea895aaf772a1c511cf8bce680ee772435e8c872722d5b | fulcrologic/fulcro-rad-demo | save_middleware.clj | (ns com.example.components.save-middleware
(:require
[com.fulcrologic.rad.middleware.save-middleware :as r.s.middleware]
[com.fulcrologic.rad.database-adapters.sql.middleware :as sql-middleware]
[com.fulcrologic.rad.blob :as blob]
[com.example.model :as model]))
(def middleware
(->
(sql-middleware/wrap-s... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-demo/28b8c2dd3cd9f9be66a621627d079bb19bd5e53b/src/sql/com/example/components/save_middleware.clj | clojure | (ns com.example.components.save-middleware
(:require
[com.fulcrologic.rad.middleware.save-middleware :as r.s.middleware]
[com.fulcrologic.rad.database-adapters.sql.middleware :as sql-middleware]
[com.fulcrologic.rad.blob :as blob]
[com.example.model :as model]))
(def middleware
(->
(sql-middleware/wrap-s... | |
130702fb8e064c8c16813de87d841f3db073f7ffa47da80134f430c517bbb030 | tolysz/ghcjs-stack | Index.hs | module Distribution.Client.Dependency.Modular.Index
( Index
, PInfo(..)
, defaultQualifyOptions
, mkIndex
) where
import Data.List as L
import Data.Map as M
import Prelude hiding (pi)
import Distribution.Client.Dependency.Modular.Dependency
import Distribution.Client.Dependency.Modular.Flag
import... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal-next/cabal-install/Distribution/Client/Dependency/Modular/Index.hs | haskell | | An index contains information about package instances. This is a nested
dictionary. Package names are mapped to instances, which in turn is mapped
to info.
| Info associated with a package instance.
Currently, dependencies, flags and failure reasons.
Packages that have a failure reason recorded for them are dis... | module Distribution.Client.Dependency.Modular.Index
( Index
, PInfo(..)
, defaultQualifyOptions
, mkIndex
) where
import Data.List as L
import Data.Map as M
import Prelude hiding (pi)
import Distribution.Client.Dependency.Modular.Dependency
import Distribution.Client.Dependency.Modular.Flag
import... |
459a063ef39b735066d4ce5d402eaed0ba350644fae1496eb91cc7fa376b8061 | 2600hz-archive/whistle | amqp_channel.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/rabbitmq_erlang_client-2.4.1/src/amqp_channel.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
@type close_rea... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is VMware , Inc.
Copyright ( c ) 2007 - 2011 VMware , Inc. All rights reserved .
< td><s... |
89685ff123331d0a2f9b9d6cb761c56e1475c033c5d1f01bfcc35279da8d5028 | msantos/erpcgen | rpc_client.erl | Copyright ( c ) 2000 Sendmail , Inc. All rights reserved .
ONC / RPC client - side server : takes RPC requests with XDR - encoded
%%% arguments, transmits them over the network, and receives the reply.
-module(rpc_client).
-behaviour(gen_server).
%%% API
-export([open/4, open/5, close/1, call/3, call/4]).
-exp... | null | https://raw.githubusercontent.com/msantos/erpcgen/f4d14eebd689496ef30acf08ed16db1c0e3f5004/rpc/rpc_client.erl | erlang | arguments, transmits them over the network, and receives the reply.
API
gen_server callbacks
In milliseconds
Note on state structure(s): the state can get quite large and may be
we can mimize the problem by splitting out the mostly-static state elements
into a substructure. No need to do this until it becomes a... | Copyright ( c ) 2000 Sendmail , Inc. All rights reserved .
ONC / RPC client - side server : takes RPC requests with XDR - encoded
-module(rpc_client).
-behaviour(gen_server).
-export([open/4, open/5, close/1, call/3, call/4]).
-export([call_bulk/4, call_bulk/5]).
-export([control/2, control/3,
get_xid/1, se... |
cc9629ac6add99a954e4450f37be1f95700312139c7221a140a31cb2fcabe9eb | jdan/ocaml-data-structures | functor_test.ml | open Functor;;
(* Define a Maybe functor *)
module Maybe : (Functor with type 'a t = 'a option) = struct
type 'a t = 'a option
let fmap f x = match x with
| Some v -> Some (f v)
| None -> None
end
let get_age = function
| "Jordan" -> Some 25
| "Steve" -> Some 29
| "Jake" -> Some 1
| _ -> None
let... | null | https://raw.githubusercontent.com/jdan/ocaml-data-structures/b27e0c4fd8997900b5852a110a971f00ce3e922c/src/functor_test.ml | ocaml | Define a Maybe functor
An either module | open Functor;;
module Maybe : (Functor with type 'a t = 'a option) = struct
type 'a t = 'a option
let fmap f x = match x with
| Some v -> Some (f v)
| None -> None
end
let get_age = function
| "Jordan" -> Some 25
| "Steve" -> Some 29
| "Jake" -> Some 1
| _ -> None
let age_next_year = Maybe.fmap (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.