_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 |
|---|---|---|---|---|---|---|---|---|
c8b4b4e90fa10b06c1f662d94a6691f1a4f7acf9f3c8519f6cdaff0ce726f7a1 | f-o-a-m/kepler | Spec.hs | # OPTIONS_GHC -F #
# OPTIONS_GHC -fno - warn - missing - import - lists #
| null | https://raw.githubusercontent.com/f-o-a-m/kepler/6c1ad7f37683f509c2f1660e3561062307d3056b/hs-abci-docs/simple-storage/test/Spec.hs | haskell | # OPTIONS_GHC -F #
# OPTIONS_GHC -fno - warn - missing - import - lists #
| |
7fdc2d41bfce44a5cabc72c883ba090531aa4ff1d805dd44ec6f48e2c6ad8a0d | rowangithub/DOrder | ex7.ml | let rec loop i len y =
if (i < y) then
let _ = assert (0 <= i && i < len) in
let i = i + 1 in
loop i len y
else ()
let main x y =
if (x < 0 || y < 0 || y > x) then ()
else
let len = x in
let i = 0 in
loop i len y
let _ = main (-1) (-1)
let _ = main 4 4
let _ = main 5 2
let _ =... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/folprograms/mcmc/ex7.ml | ocaml | let rec loop i len y =
if (i < y) then
let _ = assert (0 <= i && i < len) in
let i = i + 1 in
loop i len y
else ()
let main x y =
if (x < 0 || y < 0 || y > x) then ()
else
let len = x in
let i = 0 in
loop i len y
let _ = main (-1) (-1)
let _ = main 4 4
let _ = main 5 2
let _ =... | |
ad456f6f88c05284fe63815b96d5c98408e2d8465ebf65589627f60f4fab41ab | utahstreetlabs/risingtide | solr.clj | (ns risingtide.action.persist.solr
(:require
[clojure
[set :refer [map-invert rename-keys]]
[string :as str]
[walk :refer [keywordize-keys]]]
[risingtide
[config :as config]
[persist :refer [keywordize convert-to-kw-set convert-to-kw-seq convert-to-set]]]
[clojure-solr :as solr]
[clj-t... | null | https://raw.githubusercontent.com/utahstreetlabs/risingtide/bc5b798396679739469b1bd8ee1b03db76178cde/src/risingtide/action/persist/solr.clj | clojure | (ns risingtide.action.persist.solr
(:require
[clojure
[set :refer [map-invert rename-keys]]
[string :as str]
[walk :refer [keywordize-keys]]]
[risingtide
[config :as config]
[persist :refer [keywordize convert-to-kw-set convert-to-kw-seq convert-to-set]]]
[clojure-solr :as solr]
[clj-t... | |
ad6d7d3b7149f6e4aefce13bb0a75478431a064262edf1559ca2d0833c3af7ab | footprintanalytics/footprint-web | resolve_source_table.clj | (ns metabase.query-processor.middleware.resolve-source-table
"Fetches Tables corresponding to any `:source-table` IDs anywhere in the query."
(:require [metabase.mbql.util :as mbql.u]
[metabase.query-processor.store :as qp.store]
[metabase.util.i18n :refer [tru]]
[metabase.util.s... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/query_processor/middleware/resolve_source_table.clj | clojure | Recursively look in the rest of `m` for any other source tables | (ns metabase.query-processor.middleware.resolve-source-table
"Fetches Tables corresponding to any `:source-table` IDs anywhere in the query."
(:require [metabase.mbql.util :as mbql.u]
[metabase.query-processor.store :as qp.store]
[metabase.util.i18n :refer [tru]]
[metabase.util.s... |
19b6893ba3cdf5e51fc8d96a0661685921a4e0f659db8485aba73c54ae1c72ab | brendanhay/gogol | Remove.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-servicenetworking/gen/Gogol/ServiceNetworking/Services/DnsRecordSets/Remove.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
/See:/ <-infrastructure/docs/service-networking/getting-started Service Networking API Reference> for @servicenetworking.services.dnsRecordSets.remove@.
* Resource
** Constructing a Request
/See:/ 'newServiceNetworkingService... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
e480761583c5f66f854f64e392dd197e7297044839ed385cce8b2bc46bb17e66 | manuel-serrano/bigloo | occur.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / / comptime / Ast / occur.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/fdeac39af72d5119d01818815b0f395f2907d6da/comptime/Ast/occur.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Compute the occurrences number and compute the read/write */
* property of local varia... | * serrano / prgm / project / bigloo / / comptime / Ast / occur.scm * /
* Author : * /
* Creation : Fri Jan 6 11:09:14 1995 * /
* Last change : We d Jun 16 15:53:11 2021 ( serrano ) * /
(module ast... |
ab592228d801fadd16b9441089dc65486aae90ca04b8a095aa60b3ff9572aadf | hopv/MoCHi | triple.ml | open Util
(** Triples *)
let make x1 x2 x3 = (x1, x2, x3)
let of_list [x1; x2; x3] = (x1, x2, x3)
let list_of (x1, x2, x3) = [x1; x2; x3]
let fst (x1, x2, x3) = x1
let snd (x1, x2, x3) = x2
let trd (x1, x2, x3) = x3
let get12 (x1, x2, x3) = (x1, x2)
let get13 (x1, x2, x3) = (x1, x3)
let get21 (x1, x2, x3) = (x2, x... | null | https://raw.githubusercontent.com/hopv/MoCHi/b0ac0d626d64b1e3c779d8e98cb232121cc3196a/fpat/triple.ml | ocaml | * Triples | open Util
let make x1 x2 x3 = (x1, x2, x3)
let of_list [x1; x2; x3] = (x1, x2, x3)
let list_of (x1, x2, x3) = [x1; x2; x3]
let fst (x1, x2, x3) = x1
let snd (x1, x2, x3) = x2
let trd (x1, x2, x3) = x3
let get12 (x1, x2, x3) = (x1, x2)
let get13 (x1, x2, x3) = (x1, x3)
let get21 (x1, x2, x3) = (x2, x1)
let get23 (x... |
63dd4c99dccdd2ad8c0efe918b7388f4f8b2a1a412e807547c8239844cedc4a4 | aristidb/aws | GetObjectV4.hs | {-# LANGUAGE OverloadedStrings #-}
import qualified Aws
import qualified Aws.Core as Aws
import qualified Aws.S3 as S3
import Control.Monad.Trans.Resource
import Data.Conduit ((.|), runConduit)
import Data.Conduit.Binary (sinkFile)
import Network.HTTP.Conduit (newManager, tlsMan... | null | https://raw.githubusercontent.com/aristidb/aws/a99113ed7768f9758346052c0d8939b66c6efa87/Examples/GetObjectV4.hs | haskell | # LANGUAGE OverloadedStrings #
Set up AWS credentials and the default configuration.
Set up a ResourceT region with an available HTTP manager.
Save the response to a file. |
import qualified Aws
import qualified Aws.Core as Aws
import qualified Aws.S3 as S3
import Control.Monad.Trans.Resource
import Data.Conduit ((.|), runConduit)
import Data.Conduit.Binary (sinkFile)
import Network.HTTP.Conduit (newManager, tlsManagerSettings, responseBody)
main :... |
6f5606bea35779147022f57237d7a22ed4629cbf84468d5a24d1eea885a856ff | manuel-serrano/hop | verbose.scm | ;*=====================================================================*/
* Author : * /
* Copyright : 2007 - 2009 , see LICENSE file * /
;* ------------------------------------------------------------- */
* This file is part of Scheme2Js . ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/scheme2js/verbose.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* */
* but WITHOUT ANY WARRANTY; without even the implied warranty of */
* MERCHANTABILITY or FITNE... | * Author : * /
* Copyright : 2007 - 2009 , see LICENSE file * /
* This file is part of Scheme2Js . * /
* Scheme2Js is distributed in the hope that it will be useful , * /
(module verbose
(import config)... |
e9b2ec628aa6925048ce77377355618495041ea5ed5938a77e13796f94043c89 | greglook/merkledag-core | store.clj | (ns merkledag.store
"Node store backed by content-addressable blocks, serialized with a codec."
(:require
[blocks.core :as block]
[clojure.core.cache :as cache]
[merkledag.codec.cbor :refer [cbor-codec]]
[merkledag.codec.edn :refer [edn-codec]]
[merkledag.link :as link]
[merkledag.node :as n... | null | https://raw.githubusercontent.com/greglook/merkledag-core/b7fe0f1210d493418ab837e06336f099cd705fd6/src/merkledag/store.clj | clojure | ## Formatting Functions
TODO: encode/decode fn?
TODO: measure node size
Return cached value.
TODO: measure cache hits
Node is not cached.
TODO: measure parse time
TODO: measure cache misses
TODO: measure node creation and size
TODO: measure node deletion | (ns merkledag.store
"Node store backed by content-addressable blocks, serialized with a codec."
(:require
[blocks.core :as block]
[clojure.core.cache :as cache]
[merkledag.codec.cbor :refer [cbor-codec]]
[merkledag.codec.edn :refer [edn-codec]]
[merkledag.link :as link]
[merkledag.node :as n... |
dde7ccf2636e8e8bd2e544e250d8f6f25c41ebb2fea8d528dcd0f299a0367430 | lucasdicioccio/deptrack-project | Storage.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Devops.Storage (
FilePresent (..)
, FileContent, FileLinked(..)
, fileCopy , turnupfileBackup , turndownfileBackup , generatedFile , fileContent
, fileLink
, R... | null | https://raw.githubusercontent.com/lucasdicioccio/deptrack-project/cd3d59a796815af8ae8db32c47b1e1cdc209ac71/deptrack-devops-recipes/src/Devops/Storage.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
| states that a file pre-exists
| states that a given file must be present in a local repository
| generates a directory recursively
| copies a file from an origin repository
| backup a file at turndown
| Backup a file at turnup.
| Links a file ... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module Devops.Storage (
FilePresent (..)
, FileContent, FileLinked(..)
, fileCopy , turnupfileBackup , turndownfileBackup , generatedFile , fileContent
, fileLink
, RepositoryFile (..) , localRepositoryFile
, preExistingFile
, Directory... |
499f158ae1023f428ff8557b02fe88de4a97970e0131a877d2c3c31e005b2bb5 | ocaml-multicore/multicoretests | lin_tests_common.ml | open QCheck
(** ********************************************************************** *)
(** Tests of a simple reference *)
(** ********************************************************************** *)
module Sut_int =
struct
let init () = ref 0
let get r = !r
... | null | https://raw.githubusercontent.com/ocaml-multicore/multicoretests/3e0f2ceb72eaf334e97252140ae5d40bf6461b96/src/neg_tests/lin_tests_common.ml | ocaml | * **********************************************************************
* Tests of a simple reference
* **********************************************************************
buggy: not atomic
buggy: not atomic
buggy: not atomic
buggy: not atomic
buggy: not atomic... | open QCheck
module Sut_int =
struct
let init () = ref 0
let get r = !r
let set r i = r:=i
end
module Sut_int64 =
struct
let init () = ref Int64.zero
let get r = !r
let set r i = r:=i
end
module RConf_int = struct
type t = int ref
type cmd =
| Get
| Set of int'
| Add of in... |
2647d5bce4c8c73c2bab4780a14147aa820753ef12b9973a040c1a2f1df7f0d1 | seagreen/ian | Spec.hs | module Main where
import qualified Scratch.ApplicativeParser
import qualified Scratch.Megaparsec
import qualified Scratch.MonoidLexer
import Scratch.Prelude
import qualified Scratch.ProfunctorParser
import qualified Scratch.StaticMonad
import qualified Scratch.StaticMonadManual
import qualified Scratch.StaticMonadProb... | null | https://raw.githubusercontent.com/seagreen/ian/f245fb68d94299f0e3e12744e9d1549447ad529a/haskell/test/Spec.hs | haskell | module Main where
import qualified Scratch.ApplicativeParser
import qualified Scratch.Megaparsec
import qualified Scratch.MonoidLexer
import Scratch.Prelude
import qualified Scratch.ProfunctorParser
import qualified Scratch.StaticMonad
import qualified Scratch.StaticMonadManual
import qualified Scratch.StaticMonadProb... | |
c03ebcd67dbc8f9908f0ffa2864340d91a9a4f4b37296d8aa13e68f120af66c3 | shirok/Gauche | sql.scm | ;;;
;;; text.sql - SQL parsing
;;;
Copyright ( c ) 2005 - 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/text/sql.scm | scheme |
text.sql - SQL parsing
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 ) 2005 - 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
For the time being , we only use tokenizer... |
bdc41a02430186cf400436bd6eb5f10e2e861028ca39b32a7583d25399846f23 | techascent/tech.ml.dataset | neanderthal.clj | (ns tech.v3.dataset.neanderthal
"Conversion of a dataset to/from a neanderthal dense matrix as well as various
dataset transformations such as pca, covariance and correlation matrixes.
Please include these additional dependencies in your project:
```clojure
[uncomplicate/neanderthal \"0.45.0\"]
```"
(:requ... | null | https://raw.githubusercontent.com/techascent/tech.ml.dataset/e58a1b8aed097ce7cd84a46f9cfe686fd37c18f8/src/tech/v3/dataset/neanderthal.clj | clojure | If possible, these will be accelerated copies
Because we have subtracted out the means above, the covariance matrix
The eigenvalues are the variance.
We know the eigenvalues are sorted from greatest to least | (ns tech.v3.dataset.neanderthal
"Conversion of a dataset to/from a neanderthal dense matrix as well as various
dataset transformations such as pca, covariance and correlation matrixes.
Please include these additional dependencies in your project:
```clojure
[uncomplicate/neanderthal \"0.45.0\"]
```"
(:requ... |
a58ded08d3ba35ee0731baa512db1f821b9982b3858f7d8c4198d1299838fc6d | edbutler/nonograms-rule-synthesis | math.rkt | #lang rosette/safe
; some math routines that are used by a bunch o modules but are quite generic.
(provide
choices
choices-up-to
cartesian-product
transpose)
(require
(only-in racket make-vector for)
rosette/lib/match
"lift.rkt")
COMBINATORICS
;-------------------------------------------------------... | null | https://raw.githubusercontent.com/edbutler/nonograms-rule-synthesis/16f8dacb17bd77c9d927ab9fa0b8c1678dc68088/src/core/math.rkt | racket | some math routines that are used by a bunch o modules but are quite generic.
-----------------------------------------------------------------------------
cartesian product: cons every element in front to each list in back
cartesian product of a list of lists
LIST OPS
-----------------------------------------------... | #lang rosette/safe
(provide
choices
choices-up-to
cartesian-product
transpose)
(require
(only-in racket make-vector for)
rosette/lib/match
"lift.rkt")
COMBINATORICS
list ? , posint ? - > ( listof list ? )
returns all distinct choices of size k for lst .
(define (choices lst k)
(cond
[(> k ... |
9bb729419efaaa4ac45adf9a782ad6bdae5ecfead0475353bfa7e9fcd9a18f53 | anurudhp/CPHaskell | d.hs | import Control.Arrow ((>>>))
import Data.Bits
main :: IO ()
main = interact $ words >>> drop 1 >>> map read >>> solve >>> showAns
where
showAns Nothing = "NO"
showAns (Just xs) =
unlines ("YES" : show (length xs) : map (unwords . map show) xs)
solve :: [Int] -> Maybe [[Int]]
solve xs
| odd n = Just ... | null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/codeforces/1438/d.hs | haskell | import Control.Arrow ((>>>))
import Data.Bits
main :: IO ()
main = interact $ words >>> drop 1 >>> map read >>> solve >>> showAns
where
showAns Nothing = "NO"
showAns (Just xs) =
unlines ("YES" : show (length xs) : map (unwords . map show) xs)
solve :: [Int] -> Maybe [[Int]]
solve xs
| odd n = Just ... | |
ec008626567c2c078e7bf45f9960f1ee98b2366a0bcfcc3999c0f2f1a431387b | toschoo/mom | server4.hs | module Main
where
import Network.Mom.Stompl.Client.Queue
import Network.Mom.Stompl.Patterns.Basic
import qualified Data.ByteString.Char8 as B
import Network.Socket
import Control.Monad (forever)
import Control.Concurrent
import Codec.MIME.Type (nullType)
main :: IO ()
main = withSocketsDo tstReply ... | null | https://raw.githubusercontent.com/toschoo/mom/b58ca23d05c98ab50d9e981bd4ad2cdb76846399/src/stomp-patterns/test/smoke/server4.hs | haskell | module Main
where
import Network.Mom.Stompl.Client.Queue
import Network.Mom.Stompl.Patterns.Basic
import qualified Data.ByteString.Char8 as B
import Network.Socket
import Control.Monad (forever)
import Control.Concurrent
import Codec.MIME.Type (nullType)
main :: IO ()
main = withSocketsDo tstReply ... | |
bf365063efac62c72935e2d41a12a35d5acf2cb14e791f844a74faf55d107e3f | ujihisa/haskell-workshop-project-eular | problem5.hs |
main = print $ foldl lcm 1 [2..20]
| null | https://raw.githubusercontent.com/ujihisa/haskell-workshop-project-eular/96d98133ad42cbacfb83c3a9229410760d7745aa/sixeight/problem5.hs | haskell |
main = print $ foldl lcm 1 [2..20]
| |
dfe479cd60bb54cd0c400c7d4db874e14e346b3c882158600bfc25afccdcce1b | project-oak/hafnium-verification | Sink.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/checkers/Sink.mli | ocaml | * return Some kind if the given procname/actuals are a sink, None otherwise
* return Some sink if the given call site/actuals are a sink, None otherwise
* return the indexes where taint can flow into the sink |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
b6fb065ddb98c04475881f16a03cc42f3336f20d429cec5ba368fbd71b5701f8 | TaktInc/freer | NonDetEff.hs | # LANGUAGE FlexibleContexts #
module Tests.NonDetEff where
import Control.Applicative
import Control.Monad
import Eff
ifte :: Member NonDetEff r
=> Eff r a -> (a -> Eff r b) -> Eff r b -> Eff r b
ifte t th el = msplit t >>= maybe el (\(a,m) -> th a <|> (m >>= th))
generatePrimes :: Member NonDetEff r => [Int] -... | null | https://raw.githubusercontent.com/TaktInc/freer/b1e4911832ad12ef0b9b23883548dcf44ea3bd59/tests/Tests/NonDetEff.hs | haskell | # LANGUAGE FlexibleContexts #
module Tests.NonDetEff where
import Control.Applicative
import Control.Monad
import Eff
ifte :: Member NonDetEff r
=> Eff r a -> (a -> Eff r b) -> Eff r b -> Eff r b
ifte t th el = msplit t >>= maybe el (\(a,m) -> th a <|> (m >>= th))
generatePrimes :: Member NonDetEff r => [Int] -... | |
88d9b66efdf67e6492a7a7ed4cd275fb43a04c40b7d23bd54fa32a06150e13a9 | uw-unsat/jitsynth | stp.rkt | #lang rosette
(require "../synthesis/compiler-query.rkt"
"../ams/machine.rkt"
"../common/data-structures.rkt"
"../common/case-hex.rkt"
"../common/data-utils.rkt"
"../bpf/machine-instance.rkt"
"../lsc/machine-instance.rkt")
(require (only-in "../common/debug.rkt" [... | null | https://raw.githubusercontent.com/uw-unsat/jitsynth/69529e18d4a8d4dace884bfde91aa26b549523fa/lsc2bpf/stp.rkt | racket | #lang rosette
(require "../synthesis/compiler-query.rkt"
"../ams/machine.rkt"
"../common/data-structures.rkt"
"../common/case-hex.rkt"
"../common/data-utils.rkt"
"../bpf/machine-instance.rkt"
"../lsc/machine-instance.rkt")
(require (only-in "../common/debug.rkt" [... | |
cd1b2071792ed3dcc862ed9041fc5e2b7cfc5c896e2f14efc41d54ae1691cb3f | fare/acmart | latex-utils.rkt | #lang racket
;; -*- Scheme -*-
(require racket/port scribble/core scribble/decode)
(provide (all-defined-out))
Magic nest macro
(define-syntax nest
(syntax-rules ()
((_ x) x)
((_ outer ... (prefix ...) inner) (nest outer ... (prefix ... inner)))))
;; Consider x as a tree where nodes are cons cells and le... | null | https://raw.githubusercontent.com/fare/acmart/ce6738818e79515e57e2d554b801806b8b2833ae/acmart-fare/latex-utils.rkt | racket | -*- Scheme -*-
Consider x as a tree where nodes are cons cells and leaves are either
strings or ignorable junk, and concatenate all the strings together.
Null Style
Raw output
No need to call flatten-text, I hope
Style for raw output
Raw output
No need to call flatten-text, I hope
Raw output
Q: Should we be ... | #lang racket
(require racket/port scribble/core scribble/decode)
(provide (all-defined-out))
Magic nest macro
(define-syntax nest
(syntax-rules ()
((_ x) x)
((_ outer ... (prefix ...) inner) (nest outer ... (prefix ... inner)))))
(define (flatten-text . x)
(call-with-output-string
(λ (out)
(let... |
42b3bb5d2497d6c85b12247fb487c245285895bded1cd7364fb0be48102953db | mfp/extprot | inspect_msg.ml | open Codec
module PP = Pretty_print
let read_byte = IO.read_byte
let read_vint t =
let b = ref (read_byte t) in
let x = ref 0 in
let e = ref 0 in
while !b >= 128 do
x := !x + ((!b - 128) lsl !e);
e := !e + 7;
b := read_byte t
done;
!x + (!b lsl !e)
let read_prefix = read_vint
let... | null | https://raw.githubusercontent.com/mfp/extprot/c69eb66398e35b964c4232a7c3c85151fb5eddbe/runtime/inspect_msg.ml | ocaml | len
len | open Codec
module PP = Pretty_print
let read_byte = IO.read_byte
let read_vint t =
let b = ref (read_byte t) in
let x = ref 0 in
let e = ref 0 in
while !b >= 128 do
x := !x + ((!b - 128) lsl !e);
e := !e + 7;
b := read_byte t
done;
!x + (!b lsl !e)
let read_prefix = read_vint
let... |
8d6c6095fe39e98590f31ece748b0f24a91f2b5540f0e78f8e93dfbc88fc1164 | haskell/cabal | Init.hs | module UnitTests.Distribution.Client.Init
( tests
) where
import Test.Tasty
import qualified UnitTests.Distribution.Client.Init.Interactive as Interactive
import qualified UnitTests.Distribution.Client.Init.NonInteractive as NonInteractive
import qualified UnitTests.Distribution.Client.Init.Golden as Golde... | null | https://raw.githubusercontent.com/haskell/cabal/d0b35b404558f5a860e0e8645d085924777b1948/cabal-install/tests/UnitTests/Distribution/Client/Init.hs | haskell | module UnitTests.Distribution.Client.Init
( tests
) where
import Test.Tasty
import qualified UnitTests.Distribution.Client.Init.Interactive as Interactive
import qualified UnitTests.Distribution.Client.Init.NonInteractive as NonInteractive
import qualified UnitTests.Distribution.Client.Init.Golden as Golde... | |
0e34775a8a924dfb26e57db7304f7fe3f2cc4f8560ff1cafa8fa368c6449506b | kadena-io/pact | ReplTools.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
module Pact.ReplTools where
import Prelude hiding (print,putStrLn)
import Control.Lens
... | null | https://raw.githubusercontent.com/kadena-io/pact/307bc4fc0139dd364e186534c7c56f2684e85dcb/src-ghc/Pact/ReplTools.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
Moved from Pact.Repl
----------------------------------------------------------------------------
| Complete function names for _loaded_ modules
write ... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleContexts #
module Pact.ReplTools where
import Prelude hiding (print,putStrLn)
import Control.Lens
import Control.Monad.State.Strict
import Data.List
import qualified Data.HashMap.Strict as HM
import... |
9ae5172a3cf55e3e6e84c6f2c0b3116a24ae3ff152b9830152fc26e484556517 | mpickering/apply-refact | Extensions13.hs | # LANGUAGE RecordWildCards #
record = 1 | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Extensions13.hs | haskell | # LANGUAGE RecordWildCards #
record = 1 | |
34f969252c9ebfbb83b3834dbf663e9bc932aaab298784df9ba81606c27a58f7 | Concordium/concordium-client | Transaction.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Concordium.Client.Types.Transaction where
import Concordium.Client.Types.Account
import qualified Concordium.ID.Types as IDTypes
import ... | null | https://raw.githubusercontent.com/Concordium/concordium-client/ddf772763e9bcdf541620b422b4331606f9b7afe/src/Concordium/Client/Types/Transaction.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
| Base cost of checking the transaction. The cost is always at least this,
but in most cases it will have a transaction specific cost.
^ Size of the transaction payload in bytes
^ Number of signatures.
the total size of the transaction. The +1 is ... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
module Concordium.Client.Types.Transaction where
import Concordium.Client.Types.Account
import qualified Concordium.ID.Types as IDTypes
import Concordium.Types
import Concordium.Types.Execution ... |
88d9b5a84caae8cf8cb0e484673d652a00f53aaac8a79b02d78afe07354ca235 | fission-codes/fission | Login.hs | module Fission.CLI.Parser.Command.User.Login
( parserWithInfo
, parser
-- * Reexport
, module Fission.CLI.Parser.Command.User.Login.Types
) where
import Options.Applicative
import Fission.Prelude
import Fission.User.Username.Types
import Fission.CLI.Parser.Command.U... | null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-cli/library/Fission/CLI/Parser/Command/User/Login.hs | haskell | * Reexport
-
| module Fission.CLI.Parser.Command.User.Login
( parserWithInfo
, parser
, module Fission.CLI.Parser.Command.User.Login.Types
) where
import Options.Applicative
import Fission.Prelude
import Fission.User.Username.Types
import Fission.CLI.Parser.Command.User.Login.Types
... |
de2ebb8f850dc5e322aad6ff631696cf385c152e18536e31ba7af629c886c3c4 | soegaard/little-helper | skew-binary-random-access-list.scm | skew-binary-random-access-list.scm --
SKEW BINARY RANDOM - ACCESS LISTS
; Reference: [Oka, p.132-134]
; Hint: These lists are a good choice if you need
; both list-like and array-like operations.
(module skew-binary-random-access-list "mzscheme-without-lists.scm"
(require (onl... | null | https://raw.githubusercontent.com/soegaard/little-helper/26249c688e5adf1e2535c405c6289030eff561b4/planet/galore.plt/2/2/private/skew-binary-random-access-list.scm | scheme | Reference: [Oka, p.132-134]
Hint: These lists are a good choice if you need
both list-like and array-like operations.
a tree is either leaf or node
e element, l and r trees
w integer, t tree
(pair? l))
(define empty '())
| skew-binary-random-access-list.scm --
SKEW BINARY RANDOM - ACCESS LISTS
(module skew-binary-random-access-list "mzscheme-without-lists.scm"
(require (only (lib "list.ss") foldl)
"../signatures/list-signature.scm")
(provide-random-access-list)
(require (rename mzscheme mz:co... |
6782fbe9a39335709a895dd377d5f0954e09ecb40cd3c34f331b459eb7441cde | codinuum/cca | HCS.ml |
Copyright 2012 - 2020 Codinuum Software Lab < >
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 wri... | null | https://raw.githubusercontent.com/codinuum/cca/88ea07f3fe3671b78518769d804fdebabcd28e90/src/util/HCS.ml | ocaml | HCS: Heaviest Common Subsequence
of functor HCS.F |
Copyright 2012 - 2020 Codinuum Software Lab < >
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 wri... |
c0194f037998a3b6e488e41f0e5da78296f4cd7c33b8a406dd7815fe0cde1d38 | heroku/cowboyku | http_init_shutdown.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(http_init_shutdown).
-behaviour(cowboyku_http_handler).
-export([init/3, handle/2, terminate/3]).
init({_Transport, http}, Req, _Opts) ->
{ok, Req2} = cowboyku_req:reply(<<"666 Init Shutdown Testing">>,
[{<<"connection">>, <<"close">>}], Req),
{s... | null | https://raw.githubusercontent.com/heroku/cowboyku/ba7120bdb119ac676909e51f0738bde1d4fdd4ee/test/http_SUITE_data/http_init_shutdown.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(http_init_shutdown).
-behaviour(cowboyku_http_handler).
-export([init/3, handle/2, terminate/3]).
init({_Transport, http}, Req, _Opts) ->
{ok, Req2} = cowboyku_req:reply(<<"666 Init Shutdown Testing">>,
[{<<"connection">>, <<"close">>}], Req),
{shutdown, Req2, undefined}.
handle(Req, State) ->
{ok, Req2... |
49e973ae04b1a7385999860bc8cd22830a04c0674423f827eed2f65efbdf2ed6 | sof/feed | Export.hs | --------------------------------------------------------------------
-- |
-- Module : Text.Feed.Export
Copyright : ( c ) Galois , Inc. 2008 ,
( c ) Sigbjorn Finne 2009-
-- License : BSD3
--
-- Maintainer: Sigbjorn Finne <>
-- Stability : provisional
--
-- Convert from Feeds to XML.
--
-------------... | null | https://raw.githubusercontent.com/sof/feed/74891cf9d7c9a69e38a8f84dc34fefdb174a9da5/Text/Feed/Export.hs | haskell | ------------------------------------------------------------------
|
Module : Text.Feed.Export
License : BSD3
Maintainer: Sigbjorn Finne <>
Stability : provisional
Convert from Feeds to XML.
------------------------------------------------------------------
:: Feed -> XML.Element
XML toplevel element.
... | Copyright : ( c ) Galois , Inc. 2008 ,
( c ) Sigbjorn Finne 2009-
module Text.Feed.Export
) where
import Text.Feed.Types
import Text.Atom.Feed.Export as Atom
import Text.RSS.Export as RSS
import Text.RSS1.Export as RSS1
import Text.XML.Light as XML
| ' xmlFeed f ' serializes a @Feed@ docu... |
84afd42de0518668c1bf37e394f764ffc879dc0fce3a2719182a8821621c0eb9 | NinjaTrappeur/ex-hack | StackageSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module ExHack.StackageSpec (spec) where
import Data.FileEmbed
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Text.Encoding (decodeUtf8)
import ... | null | https://raw.githubusercontent.com/NinjaTrappeur/ex-hack/dace36926065d5a0dd0076beec1a6eeacd848732/test/unit/ExHack/StackageSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module ExHack.StackageSpec (spec) where
import Data.FileEmbed
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Text.Encoding (decodeUtf8)
import Test.Hspec ... |
f92dfe05e62be6d40488645d3f19095d42e481d54b23aa49fdf1a415535c5ffa | lisp-korea/sicp2014 | ex-3-03.scm | ex 3.3
(define (make-account balance passwd)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(define (incorrect-passwd amount)
... | null | https://raw.githubusercontent.com/lisp-korea/sicp2014/9e60f70cb84ad2ad5987a71aebe1069db288b680/vvalkyrie/3.1/ex-3-03.scm | scheme | ex 3.3
(define (make-account balance passwd)
(define (withdraw amount)
(if (>= balance amount)
(begin (set! balance (- balance amount))
balance)
"Insufficient funds"))
(define (deposit amount)
(set! balance (+ balance amount))
balance)
(define (incorrect-passwd amount)
... | |
10fac1fc1a4e74b9987fab2ebf768ecdb00ba60cdf566c0967d17cd012f88cec | LuisThiamNye/chic | core.clj | (ns chic.controls.textbox.core
(:require
[proteus :refer [let-mutable]]
[clojure.math :as math]
[chic.controls.textbox.edit :as edit]
[chic.controls.textbox.move :as move]
[chic.controls.textbox.select :as select]
[chic.controls.textbox.undo :as undo]
[chic.controls.textbox.helper :as hpr]
[ch... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/controls/textbox/core.clj | clojure | :keybindings nil
which line
:line-end-idxs []
- undo/redo - track the number of characters changed?
- when selecting whitespace, show a dot (at least for trailing whitespace)
also see -sandbox/tree/master/editor-perf
also inspiration: sublime text python API
but certain actions can reset the timer and force a s... | (ns chic.controls.textbox.core
(:require
[proteus :refer [let-mutable]]
[clojure.math :as math]
[chic.controls.textbox.edit :as edit]
[chic.controls.textbox.move :as move]
[chic.controls.textbox.select :as select]
[chic.controls.textbox.undo :as undo]
[chic.controls.textbox.helper :as hpr]
[ch... |
f8737f446a40dc1f36409867012650adce52d8e68d5ceef6299c6311ebefd6dc | maximedenes/native-coq | himsg.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/toplevel/himsg.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
let pe = pr_ne_context_of (str "in... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Errors
open Util... |
472f46e1bb47c4722941e39250d2f8e62bd95127ec6582405bdfa6bec93e307a | sulami/spielwiese | 07.hs | module Main where
import Prelude hiding (lookup)
import Control.Monad (forM_)
import Data.Bits ((.&.), (.|.), complement, shiftL, shiftR)
import Data.Maybe (fromJust, isJust)
import Data.Word (Word16)
import Data.HashMap.Lazy (
HashMap, delete, filterWithKey, fromList, lookup, map, union, elems
)
data AExpr = AP... | null | https://raw.githubusercontent.com/sulami/spielwiese/da354aa112d43d7ec5f258f4b5afafd7a88c8aa8/advent15/07.hs | haskell | module Main where
import Prelude hiding (lookup)
import Control.Monad (forM_)
import Data.Bits ((.&.), (.|.), complement, shiftL, shiftR)
import Data.Maybe (fromJust, isJust)
import Data.Word (Word16)
import Data.HashMap.Lazy (
HashMap, delete, filterWithKey, fromList, lookup, map, union, elems
)
data AExpr = AP... | |
e6a472a485a4f74b056671c5f1343e480327f4eb6007b5f2e39dbff958c9fc5a | vmchale/kempe | Restrict.hs | | Check that sum types have < 256 constructors
module Kempe.Check.Restrict ( restrictConstructors
) where
import Data.Foldable.Ext
import Kempe.AST
import Kempe.Error (Error (FatSumType))
restrictConstructors :: Declarations a c b -> Maybe (Error a)
re... | null | https://raw.githubusercontent.com/vmchale/kempe/05ed82ad51704c092e9cb60ff3d034e4e4bb7407/src/Kempe/Check/Restrict.hs | haskell | | Check that sum types have < 256 constructors
module Kempe.Check.Restrict ( restrictConstructors
) where
import Data.Foldable.Ext
import Kempe.AST
import Kempe.Error (Error (FatSumType))
restrictConstructors :: Declarations a c b -> Maybe (Error a)
re... | |
51176712fcde8619d09154bea0dca8c65858237f8bb4379bd3ee9c7ce06cd6f8 | igorhvr/bedlam | ipoints.scm | (import hashtable)
(define ipoint-files (make-hashtable equal?))
(define ipoints (make-hashtable eq?))
(define (register-ipoint file line col uid)
(hashtable/put! ipoint-files file
(cons (list line col uid)
(hashtable/get ipoint-files file '())))
(hashtable/put! ipoints ... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-contrib/debugger/ipoints.scm | scheme | (import hashtable)
(define ipoint-files (make-hashtable equal?))
(define ipoints (make-hashtable eq?))
(define (register-ipoint file line col uid)
(hashtable/put! ipoint-files file
(cons (list line col uid)
(hashtable/get ipoint-files file '())))
(hashtable/put! ipoints ... | |
fd85802c7ef9f64c7044b189a664c1bbec8c7ece752e41f7a008162a7259b041 | friemen/domaintypes | uml.clj | (ns domaintypes.uml
(:use [domaintypes.core]
[clojure.string :only [join split]]))
Functions to create PlantUML compatible , printable strings from record classes
(defn- cardstr
([card]
(cardstr card "" ""))
([card prefix suffix]
(if (to-one? card)
""
(str prefix
(let [[min max... | null | https://raw.githubusercontent.com/friemen/domaintypes/5f53a2fab6f06e5937b10883bea3ebf9556dec4d/core/src/domaintypes/uml.clj | clojure | (ns domaintypes.uml
(:use [domaintypes.core]
[clojure.string :only [join split]]))
Functions to create PlantUML compatible , printable strings from record classes
(defn- cardstr
([card]
(cardstr card "" ""))
([card prefix suffix]
(if (to-one? card)
""
(str prefix
(let [[min max... | |
be4deb86360257d190f349f7d7bc1979a5e7c13b43729207ac68969da515b1f6 | aryx/xix | graph.ml | Copyright 2016 , see copyright.txt
open Common
module A = Ast
module R = Rules
module Set = Set_
(*****************************************************************************)
(* Prelude *)
(*****************************************************************************)
(****************************************... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/mk/graph.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... | Copyright 2016 , see copyright.txt
open Common
module A = Ast
module R = Rules
module Set = Set_
type node = {
name: string;
mutable because this field can be adjusted later in check_ambiguous
* and vacuous .
* Note that this field was called ' prereqs ' before , but virtual rules
* without... |
5c4a8d187743412d5cb445b4aee1a393dbcc6154c47ce6636396c2629a8a0911 | nlsandler/nqcc | test_lex.ml | open OUnit2
open Tok
(* create a test to lex a single token *)
let test_lex_single input expected_tok test_ctxt =
let tokenized = Lex.lex input in
assert_equal 1 (List.length tokenized);
assert_equal (expected_tok) (List.hd tokenized)
let test_lex_multi input expected_toks test_ctxt =
let tokenized = Lex.lex ... | null | https://raw.githubusercontent.com/nlsandler/nqcc/c30e4c33ec7adfe9710edb948cda380b1fc01715/tst/test_lex.ml | ocaml | create a test to lex a single token
escape sequence - newline
escape sequence - backslash
hex
octal
NOTE: we do NOT test newline handling because all newlines are removed when we read in the input file | open OUnit2
open Tok
let test_lex_single input expected_tok test_ctxt =
let tokenized = Lex.lex input in
assert_equal 1 (List.length tokenized);
assert_equal (expected_tok) (List.hd tokenized)
let test_lex_multi input expected_toks test_ctxt =
let tokenized = Lex.lex input in
let rec compare_token_lists a b... |
fa9a5e9c98642ecf620ce997f28402f89e74fefd5699a76d324ebfd8267ac0ec | ormf/cm | defaults.lisp | -*- syntax : common - lisp ; package : clm ; base : 10 ; mode : lisp -*-
;;;
this file contains most of the global default values that control CLM
;;; in many cases the *clm-<>* form is *<>* during a given run; that is,
;;; *clm-channels* is the default, *channels* is the current setting
(in-package :clm)
(def... | null | https://raw.githubusercontent.com/ormf/cm/26843eec009bd6c214992a8e67c49fffa16d9530/doc/404B-SoundSynth-AlgoComp/www-camil.music.uiuc.edu_16080/classes/404B/clm/clm-3/defaults.lisp | lisp | package : clm ; base : 10 ; mode : lisp -*-
in many cases the *clm-<>* form is *<>* during a given run; that is,
*clm-channels* is the default, *channels* is the current setting
will cause instrument names and so on to be printed out
default for play arg in with-sound
used for table-lookup tables and others
... | this file contains most of the global default values that control CLM
(in-package :clm)
(defvar *clm-srate* 22050)
(defvar *clm-channels* 1)
(defvar *clm-file-buffer-size* (* 64 1024))
(defvar *clm-file-name*
#+ccrma "/zap/test.snd"
#+(or sgi sun hpux linux) "test.snd"
#+windoze "test.wav"
#-(or windoze c... |
db7c36638b779eafee5f79f582670ba1c2dbb327fa9c973344f2efa055b71319 | input-output-hk/plutus-apps | SealedBidAuction.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/8949ce26588166d9961205aa61edd66e4f83d4f5/plutus-use-cases/src/Plutus/Contracts/SealedBidAuction.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
| Definition of an auction
^ Current owner of the asset. This is where the proceeds of the auc... | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
module Plutus.Contracts.SealedBidAuction(
AuctionParams... |
60dc25733e9059c59dd96a98e3f30ec4af5fe2568d889430abc212422ad47b30 | jaredly/belt | belt_Map.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/jaredly/belt/4d07f859403fdbd3fbfc5a9547c6066d657a2131/belt_src/belt_Map.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
module Int = Belt_MapInt
module String ... |
8dce76742917e6fbdb1272eebe140b2033b89f04dea0ecf89f7c2640edf632d2 | input-output-hk/plutus | Default.hs | module PlutusCore.Default
( module Export
) where
import PlutusCore.Default.Builtins as Export
import PlutusCore.Default.Universe as Export
| null | https://raw.githubusercontent.com/input-output-hk/plutus/1f31e640e8a258185db01fa899da63f9018c0e85/plutus-core/plutus-core/src/PlutusCore/Default.hs | haskell | module PlutusCore.Default
( module Export
) where
import PlutusCore.Default.Builtins as Export
import PlutusCore.Default.Universe as Export
| |
4863b8cee595b9c7092840bc3eeebc19039cdc975590316b524e08b2bfdb0e13 | AdaCore/why3 | rc.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/be1023970d48869285e68f12d32858c3383958e0/src/util/rc.mli | 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 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
* { 1 Configuration file management }
type rc_value =
| RCint of int
| RCbool of bool
| RCfloat of f... |
7dba3f4a4a49bd483f324472af1c64f111423fc10bbc1c1d3219d84915d042a3 | nikita-volkov/rerebase | Comonad.hs | module Control.Comonad
(
module Rebase.Control.Comonad
)
where
import Rebase.Control.Comonad
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Control/Comonad.hs | haskell | module Control.Comonad
(
module Rebase.Control.Comonad
)
where
import Rebase.Control.Comonad
| |
7d22c0ed0c3a4f7356f2532803d41b72a1ec0ad581059d847385375c2167065c | jmlowenthal/staged-streams.agda | StreamListVsBase.hs |
--
-- Must have rules off, otherwise the fusion rules will replace the rhs
with the lhs , and we only end up testing lhs = = lhs
--
import System.IO
import Properties.Utils
import qualified Properties.Monomorphic.StreamList as Test -- stream functions
import qualified Properties.Monomorphic.Base as... | null | https://raw.githubusercontent.com/jmlowenthal/staged-streams.agda/3ac5fbff18808a505185c88000a817046de35d0d/lib/stream-fusion-0.1.2.5/tests/Properties/StreamListVsBase.hs | haskell |
Must have rules off, otherwise the fusion rules will replace the rhs
stream functions
Data.List
Data.Stream <=> Data.List
----------------------------------------------------------------------
* Basic interface
----------------------------------------------------------------------
* List transformations
prop... |
with the lhs , and we only end up testing lhs = = lhs
import System.IO
import Properties.Utils
prop_cons = Test.cons `eq2` (:)
prop_snoc = Test.snoc `eq2` (\xs x -> xs Spec.++ [x])
prop_append = Test.append `eq2` (Spec.++)
prop_head = Test.head `... |
2049d2270afb20477d8e44792aa7ea7d6128c7bde259bd7231c2dd5b336dcd9c | lrascao/rebar3_erlesy | rebar3_erlesy_prv_clean.erl | -module(rebar3_erlesy_prv_clean).
-export([init/1,
do/1,
format_error/1]).
-define(PROVIDER, clean).
-define(DEPS, [{default, app_discovery}]).
-define(DESC, "Remove generated state machine charts from apps.").
%% ===================================================================
%% Public API
%% ... | null | https://raw.githubusercontent.com/lrascao/rebar3_erlesy/752b50daae8976de764cf4dcda6f7bc3eef37b44/src/rebar3_erlesy_prv_clean.erl | erlang | ===================================================================
Public API
=================================================================== | -module(rebar3_erlesy_prv_clean).
-export([init/1,
do/1,
format_error/1]).
-define(PROVIDER, clean).
-define(DEPS, [{default, app_discovery}]).
-define(DESC, "Remove generated state machine charts from apps.").
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
Provider = pro... |
83586417d3b2e45924583066477c9b09ac17d15cd4e59d489c00b46e9379668c | nasa/Common-Metadata-Repository | messages.clj | (ns cmr.spatial.messages
"Contains error messages for spatial validation."
(:require
[camel-snake-kebab.core :as csk]
[clojure.string :as str]
[cmr.common.config :as cfg :refer [defconfig]]
[cmr.common.util :as u]
[pjstadig.assertions :as pj]))
(defconfig max-line-points
"The maximum number of poi... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/f6c7d4252e5b47916d0078744f13f8df59c67805/spatial-lib/src/cmr/spatial/messages.clj | clojure |
Shapes with points validation messages
Ring validation messages
Bounding rectangle validation messages
| (ns cmr.spatial.messages
"Contains error messages for spatial validation."
(:require
[camel-snake-kebab.core :as csk]
[clojure.string :as str]
[cmr.common.config :as cfg :refer [defconfig]]
[cmr.common.util :as u]
[pjstadig.assertions :as pj]))
(defconfig max-line-points
"The maximum number of poi... |
39cc1bfd6f55ef9d5dd8d320fe00e8b53ccd4801316d7e7e7f3720d5288e51d6 | sionescu/iolib | sequence.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Sequence utils
;;;
(in-package :iolib/base)
(defmacro check-bounds (sequence start end)
(with-gensyms (length)
`(let ((,length (length ,sequence)))
(check-type ,start unsigned-byte "a non-negative integer")
(when ,end (check-type ,end unsi... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/base/sequence.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Sequence utils
|
(in-package :iolib/base)
(defmacro check-bounds (sequence start end)
(with-gensyms (length)
`(let ((,length (length ,sequence)))
(check-type ,start unsigned-byte "a non-negative integer")
(when ,end (check-type ,end unsigned-byte "a non-negative integer or NIL"))
(unless ,end
(setf... |
66cd354f14eb0dc2ea0afea77abbf9c2e0c1e0b8b75dd19a0b7ffa45c7582ed9 | haskell-foundation/foundation | LargeWords.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE RebindableSyntax #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
module LargeWords where
import Foundation
import Basement.From
import Basement.Types.Word128 (Word128)
import Basement.Types.Word256 (Word256)
import qualified Basement.Types.Word128 as Word128... | null | https://raw.githubusercontent.com/haskell-foundation/foundation/58568e9f5368170d272000ecf16ef64fb91d0732/foundation/benchs/LargeWords.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE RebindableSyntax #
# LANGUAGE TypeApplications #
module LargeWords where
import Foundation
import Basement.From
import Basement.Types.Word128 (Word128)
import Basement.Types.Word256 (Word256)
import qualified Basement.Types.Word128 as Word128
import qualified Basement.Types.Wo... |
269396a766e9b7c6ab0da44cf657d1e55aefd08908cbaf644538b6a4b9542193 | returntocorp/semgrep | Report.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Full result information
*
* In addition to the results ( matches + errors ) , we also may report extra
* information , such as the skipped targets or th... | null | https://raw.githubusercontent.com/returntocorp/semgrep/0c877bb26c2f3f00fcd8c11e9efe58e211e51a97/src/reporting/Report.ml | ocaml | ***************************************************************************
Options for what extra debugging information to output.
These are generally memory intensive fields that aren't strictly needed
***************************************************************************
Coupling: the debug_info variant o... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Full result information
*
* In addition to the results ( matches + errors ) , we also may report extra
* information , such as the skipped targets or th... |
2b495f60ff417e63efbbc270314c994d1991de178ec4bf75d9cc767becff2d91 | freizl/dive-into-haskell | Main.hs | module Main where
import Test.QuickCheck
main :: IO ()
main = do
quickCheck (withMaxSuccess 10000 prop_tensDigit)
quickCheck (withMaxSuccess 10000 prop_hunsDigit)
tensDigit :: Integral a => a -> a
tensDigit x = d
where xLast = x `div` 10
d = xLast `mod` 10
tensDigit2 :: Integral a => a -> a
tensDigit2... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/07/Main.hs | haskell | module Main where
import Test.QuickCheck
main :: IO ()
main = do
quickCheck (withMaxSuccess 10000 prop_tensDigit)
quickCheck (withMaxSuccess 10000 prop_hunsDigit)
tensDigit :: Integral a => a -> a
tensDigit x = d
where xLast = x `div` 10
d = xLast `mod` 10
tensDigit2 :: Integral a => a -> a
tensDigit2... | |
9ba1f45850519e1ecaa39401914d93159d754da0c03df9fdaa97b6752d01be3d | wireapp/wire-server | Auth.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ViewPatterns #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by th... | null | https://raw.githubusercontent.com/wireapp/wire-server/598c3c7b5c3c80a41c713a8fdb88e6658b2daba0/libs/api-client/src/Network/Wire/Client/API/Auth.hs | haskell | # LANGUAGE OverloadedStrings #
This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANT... | # LANGUAGE ViewPatterns #
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
modul... |
6b429def31f911a8c4fe98e0a7c27d4d4f4b8eb22d3b52061cc07a6fc36eed0d | xnning/EvEff | TestPyth.hs | # LANGUAGE
FlexibleContexts
, AllowAmbiguousTypes -- Extensible Effects
, TypeOperators
, FlexibleInstances
, UndecidableInstances
, RankNTypes
#
FlexibleContexts
, AllowAmbiguousTypes -- Extensible Effects
, TypeOperators
, FlexibleInstances
, UndecidableInstances
, RankNTypes... | null | https://raw.githubusercontent.com/xnning/EvEff/c003c04f05c89e8680dc6b2604dc313cd7dea1c8/benchmark/TestPyth.hs | haskell | Extensible Effects
Extensible Effects
Extensible Effects
Fused Effects
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
-----------------------------------------------------
Stream from k to n
--------... | # LANGUAGE
FlexibleContexts
, TypeOperators
, FlexibleInstances
, UndecidableInstances
, RankNTypes
#
FlexibleContexts
, TypeOperators
, FlexibleInstances
, UndecidableInstances
, RankNTypes
#-}
|
Description : Benchmark backtracking pythagorean triples
Copyright : ( c ) 2020 ... |
dd6f486daeea41de749ee7dc421f74a7f24786a75d551548466c9263378b5b64 | ocurrent/mirage-ci | service.ml | open Lwt.Infix
open Capnp_rpc_lwt
module Worker = Solver_api.Worker
module Log = Solver_api.Solver.Log
module Selection = Worker.Selection
module Store = Git_unix.Store
module Epoch : sig
type t
An Epoch handles all requests for a single opam - repository HEAD commit .
val create :
n_workers:int ->
cre... | null | https://raw.githubusercontent.com/ocurrent/mirage-ci/855223ba8dffb153964e0df4f0f1b76713e77199/src/solver/service.ml | ocaml | Send [request] to [worker] and read the reply.
Handle a request by distributing it among the worker processes and then aggregating their responses. | open Lwt.Infix
open Capnp_rpc_lwt
module Worker = Solver_api.Worker
module Log = Solver_api.Solver.Log
module Selection = Worker.Selection
module Store = Git_unix.Store
module Epoch : sig
type t
An Epoch handles all requests for a single opam - repository HEAD commit .
val create :
n_workers:int ->
cre... |
3326a23cbc5685fafdcf3914128f987e5c63087e45d23409d4caab8bddaf6817 | haskell-opengl/OpenGL | Texturing.hs | --------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.Texturing
Copyright : ( c ) 2002 - 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
This module corresponds to s... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGL/f7af8fe04b0f19c260a85c9ebcad612737cd7c8c/src/Graphics/Rendering/OpenGL/GL/Texturing.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.Rendering.OpenGL.GL.Texturing
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------ | Copyright : ( c ) 2002 - 2019
Maintainer : < >
This module corresponds to section 3.8 ( Texturing ) of the OpenGL 2.1 specs .
module Graphics.Rendering.OpenGL.GL.Texturing (
module Graphics.Rendering.OpenGL.GL.Texturing.Specification,
module Graphics.Rendering.OpenGL.GL.Texturing.Parameters,
... |
e026446ac5af7956592f643a2358ef119a3f807c4f6da218b0c4849d4afe3ff3 | KavehYousefi/Esoteric-programming-languages | main.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program implements an interpreter for the esoteric programming
language " Edge " , presented by the Esolang user in
the year 2013 , founded upon Urban Mueller 's " brainfuck " as a
;; derivative destitute of input and output faci... | null | https://raw.githubusercontent.com/KavehYousefi/Esoteric-programming-languages/52621af2248d39caedb974b4ce7d64c85e9843a1/Edge/Edge_001/main.lisp | lisp |
This program implements an interpreter for the esoteric programming
derivative destitute of input and output facilities, yet capable of
Concept
=======
brainfuck, its cleronomy encompassing the application of single
integer-valued cells. Edge, however, is vested with a dioristic
approach to its stock-fath... | language " Edge " , presented by the Esolang user in
the year 2013 , founded upon Urban Mueller 's " brainfuck " as a
the remaining capabilities ' emulation utilizing four symbols in
champarty with two manipulable switches .
The Edge esoteric programming language constitutes a derivative of
character inst... |
d874104834e715b467369bbe7238de17f07bd6f441ee60eefc5f1d442501f495 | GaloisInc/regex-fsm | MBP.hs | {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
module Regex.MBP ( toMatrices, simulateMBP, premultiply, simulateMBPChunks ) where
import Control.Monad.State
import D... | null | https://raw.githubusercontent.com/GaloisInc/regex-fsm/80f371371f40ec842821b58eda44267dbde37c6a/src/Regex/MBP.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE KindSignatures #
# LANGUAGE RecordWildCards #
# LANGUAGE FlexibleContexts #
| Convert to Matrices | # LANGUAGE ScopedTypeVariables #
module Regex.MBP ( toMatrices, simulateMBP, premultiply, simulateMBPChunks ) where
import Control.Monad.State
import Data.Map
import qualified Data.Map as M
import Data.Matrix as Matrix
import Data.Maybe
import Data.S... |
92d7d05a8f32bde2acf608cf603085499de127172da658b41893e6cdc93559d5 | ghcjs/ghcjs-dom | ReadableByteStreamController.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.ReadableByteStreamController
(js_newReadableByteStreamController,
newReadableBy... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/ReadableByteStreamController.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/ReadableByteStreamController.enqueue Mozilla ReadableByteStreamController.enqueue documentation>
| <-US/docs/Web/API/ReadableByteStreamController.error Mozilla ReadableByteStreamController.error documenta... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.ReadableByteStreamController
(js_newReadableByteStreamController,
newReadableByteStreamController, js_enqueue, enqueue, js_close,
close, js_error, error, js_getByobReques... |
294b1b7514ce328b6888ef4bdcb402b65069c3ffe4f3ec82b723e99c2232097e | kazu-yamamoto/bst | Main.hs | module Main where
import Data.RMap
import Data . SMap
import Random
type Key = Int
type Val = ()
seed :: Key
seed = 12345
main :: IO ()
main = do
let !r3 = (take 100000 . randoms . mkStdGen $ seed) :: [Key]
l3 = [1..100000] :: [Key]
!x3 = zip r3 (repeat ())
!x = toList $ fromList x3
... | null | https://raw.githubusercontent.com/kazu-yamamoto/bst/d2c3d277b04d0eb7b97c5e58b709bd40755e0e54/benchmark2/Main.hs | haskell | module Main where
import Data.RMap
import Data . SMap
import Random
type Key = Int
type Val = ()
seed :: Key
seed = 12345
main :: IO ()
main = do
let !r3 = (take 100000 . randoms . mkStdGen $ seed) :: [Key]
l3 = [1..100000] :: [Key]
!x3 = zip r3 (repeat ())
!x = toList $ fromList x3
... | |
c2da0f8f3d607877c4e0efcf8a81d277eedf1ae088bcc6cfd52825626ea59019 | kappelmann/eidi2_repetitorium_tum | Lists.ml | open Collection
let todo = failwith "Ups, there is still something not implemented."
(*An implementation that uses the list implementation provided by OCaml*)
module NativeList : Collection = struct
type 'a t = todo
let empty = todo
let add p l = todo
(*Use a tail recursive fold versi... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/2016/recursive_types/exercises/Lists.ml | ocaml | An implementation that uses the list implementation provided by OCaml
Use a tail recursive fold version!
An implementation that does not use OCaml lists | open Collection
let todo = failwith "Ups, there is still something not implemented."
module NativeList : Collection = struct
type 'a t = todo
let empty = todo
let add p l = todo
let rec fold f a l = todo
end
module MyList : Collection = struct
type 'a t = todo
let emp... |
58e0475c919da185961a0a09f1c407d51d12bb99d9df99ce73e4858a3ade6dd3 | soulomoon/haskell-katas | ALaCarte.hs | # LANGUAGE TypeOperators , DeriveFunctor , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances , FlexibleContexts #
module Kyu3.ALaCarte where
-- Definitions
newtype Expr f = In (f (Expr f))
-- We define a separate data type for each constructor we want to use
-- then we can combine them together using the (:+:) ope... | null | https://raw.githubusercontent.com/soulomoon/haskell-katas/0861338e945e5cbaadf98138cf8f5f24a6ca8bb3/src/Kyu3/ALaCarte.hs | haskell | Definitions
We define a separate data type for each constructor we want to use
then we can combine them together using the (:+:) operator to make
our data types à la carte.
By defining functor instances we can write a generic fold operator
which will be useful to evaluate our expressions.
Now we can write a simp... | # LANGUAGE TypeOperators , DeriveFunctor , MultiParamTypeClasses #
# LANGUAGE FlexibleInstances , FlexibleContexts #
module Kyu3.ALaCarte where
newtype Expr f = In (f (Expr f))
newtype Lit a = Lit Int
data Add a = Add a a
data (f :+: g) e = Inl (f e) | Inr (g e)
infixr 1 :+:
instance Functor Lit where
fmap f... |
e604e76a85fc72bdb6b83c4c9b17482a7e61d2e7a346878245aa7cad70b85d68 | flosell/lambdacd | bash.clj | (ns lambdacd.util.internal.bash
(:require [clojure.tools.logging :as log]
[clojure.java.shell :as jsh]
[clojure.string :as string]))
(defn bash
[cwd & commands]
(let [combined-command (str "bash -c '" (string/join " && " commands) "' 2>&1") ;; very hacky but it does the job of redirecting... | null | https://raw.githubusercontent.com/flosell/lambdacd/e9ba3cebb2d5f0070a2e0e1e08fc85fc99ee7135/src/clj/lambdacd/util/internal/bash.clj | clojure | very hacky but it does the job of redirecting stderr to stdout | (ns lambdacd.util.internal.bash
(:require [clojure.tools.logging :as log]
[clojure.java.shell :as jsh]
[clojure.string :as string]))
(defn bash
[cwd & commands]
result (jsh/sh "bash" "-c" combined-command :dir cwd)]
(log/debug (str "executed " combined-command " in " cwd " with ... |
cbc94f0206281a46687c79e908a5662bebd68b67133df26ab19ce3bc359c967c | zeniuseducation/poly-euler | p250.clj | (ns alfa.p250
(:require
[clojure.set :refer [union difference intersection subset?]]
[clojure.core.reducers :as r]
[clojure.string :refer [split-lines]]
[alfa.common :refer :all]))
(defn geo-arit
[r n]
(transduce
(map #(* (- 900 (* 3 %))
(Math/pow r (- % 1))))
+ (range 1 (+ n... | null | https://raw.githubusercontent.com/zeniuseducation/poly-euler/734fdcf1ddd096a8730600b684bf7398d071d499/Alfa/src/alfa/p250.clj | clojure | (ns alfa.p250
(:require
[clojure.set :refer [union difference intersection subset?]]
[clojure.core.reducers :as r]
[clojure.string :refer [split-lines]]
[alfa.common :refer :all]))
(defn geo-arit
[r n]
(transduce
(map #(* (- 900 (* 3 %))
(Math/pow r (- % 1))))
+ (range 1 (+ n... | |
dd1cbfe66f1b0f9110543d4f0512a65ccc6f81aadfdf6145a43af7452722e777 | Quid2/top | Util.hs | -- |Utilities
module Data.Pattern.Util where
import Data.Either
import Data.Int
import Data.Word
import ZM
chkErrors : : [ Either String b ] - > [ b ]
chkErrors = either error i d .
collectErrors :: [Either String b] -> Either String [b]
collectErrors r = if null (lefts r... | null | https://raw.githubusercontent.com/Quid2/top/0f8dfa54d977053d02396e914c00b84cc1c1c498/src/Data/Pattern/Util.hs | haskell | |Utilities | module Data.Pattern.Util where
import Data.Either
import Data.Int
import Data.Word
import ZM
chkErrors : : [ Either String b ] - > [ b ]
chkErrors = either error i d .
collectErrors :: [Either String b] -> Either String [b]
collectErrors r = if null (lefts r)
... |
7ca162f0a9b3096c0577760a370230144d20cb8473e322b0e13146756ae2ba74 | mmontone/gestalt | test.lisp | (in-package :gst.view.test)
(def-suite view-test-suite)
(in-suite view-test-suite)
(defun run-tests ()
(run 'view-test-suite))
;; basic tests
(test append-child-test
(let* ((node (make-instance 'xml-container))
(child1 (make-instance 'xml-node))
(child2 (make-instance 'xml-node)))
(append-child node ch... | null | https://raw.githubusercontent.com/mmontone/gestalt/fd019c0ca03b4efc73b9ddd3db1e3ed211233428/src/view/test.lisp | lisp | basic tests
test the order in the tree
test the error when trying to append an already appended node
test the order again
test dettaching
test error signaling when trying to remove an object that is not in the node
test order
shouldn't insert an already inserted child
shouldn't insert if the reference-child is... | (in-package :gst.view.test)
(def-suite view-test-suite)
(in-suite view-test-suite)
(defun run-tests ()
(run 'view-test-suite))
(test append-child-test
(let* ((node (make-instance 'xml-container))
(child1 (make-instance 'xml-node))
(child2 (make-instance 'xml-node)))
(append-child node child1)
(is (... |
22484017500142ce79d41c89acda3db64bf30efec2eee159e24b96d36cd00d82 | baryluk/ex11 | example12.erl | -module(example12).
Copyright ( C ) 2004 by ( )
%% All rights reserved.
%% The copyright holder hereby grants the rights of usage, distribution
%% and modification of this software to everyone and for any purpose, as
%% long as this license and the copyright notice above are preserved and
%% not modified. There i... | null | https://raw.githubusercontent.com/baryluk/ex11/be8abc64ab9fb50611f93d6631fc33ffdee08fdb/widgets/example12.erl | erlang | All rights reserved.
The copyright holder hereby grants the rights of usage, distribution
and modification of this software to everyone and for any purpose, as
long as this license and the copyright notice above are preserved and
not modified. There is no warranty for this software.
spmewhat experimental
closing... | -module(example12).
Copyright ( C ) 2004 by ( )
-export([start/0]).
-import(sw, [xStart/1, rpc/2]).
-import(lists, [map/2, mapfoldl/3, max/1]).
-include("sw.hrl").
-define(bg, 16#ffffcc).
start() ->
spawn(fun win/0).
win() ->
Val = form(25, ["Title", "Keywords", "Subject",
"Author", "Date", "... |
0a68b07ffdb25c0204a0a957466cb9200731edf36e7361c042d4781a985229e4 | yapsterapp/deferst | system.cljc | (ns deferst.system
(:require
[schema.core :as s]
[clojure.set :as set]
[cats.context :refer [with-context]]
[cats.data :as data]
[cats.labs.state
:refer [state state? state-t get-state put-state swap-state run-state]]
[cats.labs.monad-trans :refer [lift]]
[deferst.kahn :refer [kahn-sort]]
... | null | https://raw.githubusercontent.com/yapsterapp/deferst/13ef02499211b42b1876e3b170ca27e9f721ad2b/src/deferst/system.cljc | clojure | has to come after state, because of the re-aninated nature
of monad transformers
the monad context - the monadic values are
(fn [state :- SystemStateSchema] :- Deferred<[Any SystemStateSchema]>)
for each key, a map of constructor, destructor config-ctx
the managed objects
simple object factory which returns a [o... | (ns deferst.system
(:require
[schema.core :as s]
[clojure.set :as set]
[cats.context :refer [with-context]]
[cats.data :as data]
[cats.labs.state
:refer [state state? state-t get-state put-state swap-state run-state]]
[cats.labs.monad-trans :refer [lift]]
[deferst.kahn :refer [kahn-sort]]
... |
ef2619267ab94012aadc7b0d3da2acea0735f0b40f90d960c5359a9339d6b853 | tomjaguarpaw/haskell-opaleye | Adaptors.hs | -- We have the following groups. Groups could be merged into one.
--
-- - p (Column a) (Column a)
Not SumProfunctor
-- Not SqlType a
-- - Binaryspec
-- - IfPP
--
-- - p (Column a) (Column a)
Not SumProfunctor
-- Is SqlType a
-- - Valuesspec
--
-- - p (Column a) (Column a)
Is SumProfunctor
-- Not... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/b7aacc07c6392654cae439fc3b997620c3aa7a87/src/Opaleye/Adaptors.hs | haskell | We have the following groups. Groups could be merged into one.
- p (Column a) (Column a)
Not SqlType a
- Binaryspec
- IfPP
- p (Column a) (Column a)
Is SqlType a
- Valuesspec
- p (Column a) (Column a)
Not SqlType a
- Distinctspec
- Unpackspec
- p (Column a) b
- EqPP
- p a (Column b... | Not SumProfunctor
Not SumProfunctor
Is SumProfunctor
module Opaleye.Adaptors
(
*
Binaryspec,
binaryspecField,
binaryspecMaybeFields,
*
Distinctspec,
distinctspecField,
distinctspecMaybeFields,
EqPP,
eqPPField,
eqPPMaybeFields,
IfPP,
ifPPField,
ifPPMay... |
0939ac7df5e6019b60f2eba5664c0d16709a929e8ed9d1ab653fc13e522a7b0f | archaelus/tsung | ts_os_mon_sup.erl | Copyright ( C ) 2009
%%%
%%% This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
%%% (at your option) any later version.
%%%
%%% This program is distrib... | null | https://raw.githubusercontent.com/archaelus/tsung/b4ea0419c6902d8bb63795200964d25b19e46532/src/tsung_controller/ts_os_mon_sup.erl | erlang |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General ... | Copyright ( C ) 2009
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 , US... |
5b0f935756f47026f93e7dfa0030fb02b4cf19cbc3f314d65088d70e7c82eb76 | bjorng/wings | e3d__tga.erl | %%
%% e3d__tga.erl --
%%
Functions for reading and writing TGA files .
%%
Copyright ( c ) 2001 - 2011
%%
%% See the file "license.terms" for information on usage and redistribution
%% of this file, and for a DISCLAIMER OF ALL WARRANTIES.
%%
%% $Id$
%%
-module(e3d__tga).
-export([load/2,save/3,save_bi... | null | https://raw.githubusercontent.com/bjorng/wings/dec64a500220359dbc552600af486be47c45d301/e3d/e3d__tga.erl | erlang |
e3d__tga.erl --
See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
$Id$
Uncompressed image
Compressed image
Black&White Image
Black&White Image Compressed
ColorMap Image (uncompressed)
atleast not the ones created with p... | Functions for reading and writing TGA files .
Copyright ( c ) 2001 - 2011
-module(e3d__tga).
-export([load/2,save/3,save_bin/2]).
-export([format_error/1]).
-include("e3d_image.hrl").
format_error(unsupported_format) ->
"Unsupported format or bad TGA file";
format_error(bad_image_specifiction) ->
"... |
7fe1bdf3cc6d2088cbf0a2411b73a3981de34fbf709020a899e36c755e2e191c | screenshotbot/screenshotbot-oss | test-secret.lisp | ;;;; Copyright 2018-Present Modern Interpreters Inc.
;;;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :screenshotbot/test-secret
(:use #:cl
#:fiveam)
(:import-from... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/4924b86b447045a9dedc3701a14047b73e31e145/src/screenshotbot/test-secret.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
| This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :screenshotbot/test-secret
(:use #:cl
#:fiveam)
(:import-from #:screenshotbot/secret
#:read-secrets
... |
2a5bf273b01fb8fc80f2fb42222837c470b63d3e19843d6ef23dfd7d42bb483d | rd--/hsc3 | membraneCircle.help.hs | -- membraneCircle ; X = tension and impulse frequency, Y = duration, release-time and amplitude
let x = mouseX kr 0 1 Linear 0.2
y = mouseY kr 1e-9 1 Exponential 0.2
loss = linLin y 0 1 0.999999 0.999
wobble = sinOsc kr 2 0
tension = linLin x 0 1 0.01 0.1 + (wobble * 0.0001)
p = envPerc 0.0001 y
... | null | https://raw.githubusercontent.com/rd--/hsc3/e1c9377f4985f4cc209a9cb11421bc8f1686c6f2/Help/Ugen/membraneCircle.help.hs | haskell | membraneCircle ; X = tension and impulse frequency, Y = duration, release-time and amplitude
membraneCircle ; event control | let x = mouseX kr 0 1 Linear 0.2
y = mouseY kr 1e-9 1 Exponential 0.2
loss = linLin y 0 1 0.999999 0.999
wobble = sinOsc kr 2 0
tension = linLin x 0 1 0.01 0.1 + (wobble * 0.0001)
p = envPerc 0.0001 y
tr = impulse kr (linLin x 0 1 3 9) 0
e = envGen kr tr (linLin y 0 1 0.05 0.25) 0 0.1 DoNoth... |
0d33b74f7032fed5aa5995ba08bb49aae701e7148001fca0555a93a4b869a529 | Bogdanp/racket-lua | parser.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse)
racket/match
syntax/parse
syntax/readerr
"ast.rkt"
"lexer.rkt")
(provide
current-source-name
parse-chunk)
(define current-source-name
(make-parameter #f))
(define-syntax-rule (defin... | null | https://raw.githubusercontent.com/Bogdanp/racket-lua/99ffc20e000fe6c26f85122042bac9ff37d587e9/lua-lib/lang/parser.rkt | racket | unary
unary
unary
unary
helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | #lang racket/base
(require (for-syntax racket/base
syntax/parse)
racket/match
syntax/parse
syntax/readerr
"ast.rkt"
"lexer.rkt")
(provide
current-source-name
parse-chunk)
(define current-source-name
(make-parameter #f))
(define-syntax-rule (defin... |
01d7ee435d19668588ab31f42193545d1e2d134948aae7736abec94faf76bcd0 | ret/specifica | Eval.hs | # LANGUAGE FlexibleInstances #
module Language.TLAPlus.Eval where
import Prelude hiding ((<$>))
import Control . Monad . Error
import Control.Monad.Except
import Debug.Trace as Trace
import qualified Data.Set as Set (union, intersection,
isSubsetOf, empty, size, insert)
import Data.... | null | https://raw.githubusercontent.com/ret/specifica/30b9b766d50b3b302f690d40dc33bb14ebba0e13/tlaplus-eval/src/Language/TLAPlus/Eval.hs | haskell | FIXME what about q?
"\n== ENV ==\n"++(show env)) $ return ()
improve error message (say the symbol is missing in .cfg file)
top level evalU should simply bind into the env and not yield a value
FIXME check to see if any free vars exist
is a constant with free vars bound by env
NOTE even if the ari... | # LANGUAGE FlexibleInstances #
module Language.TLAPlus.Eval where
import Prelude hiding ((<$>))
import Control . Monad . Error
import Control.Monad.Except
import Debug.Trace as Trace
import qualified Data.Set as Set (union, intersection,
isSubsetOf, empty, size, insert)
import Data.... |
f57751de64d7e07242bc4a340f54e2b240af7a90de419412779434ad45951947 | rtoy/cmucl | follow-mouse.lisp | ;;; -*- Mode: Lisp; Package: HEMLOCK-INTERNALS -*-
(in-package "HEMLOCK-INTERNALS")
24 mar 88
;;; because we will have lots of windows, with users moving between them lots,
we would like the window the mouse is in to be the one input goes to .
;;;
;;; also, this is more in line with the way most X windo... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/contrib/follow-mouse/follow-mouse.lisp | lisp | -*- Mode: Lisp; Package: HEMLOCK-INTERNALS -*-
because we will have lots of windows, with users moving between them lots,
also, this is more in line with the way most X windows work
(unless you like to use focus)
to change windows upon leaving the echo area if the mouse moves
while we're prompting for input,... |
(in-package "HEMLOCK-INTERNALS")
24 mar 88
we would like the window the mouse is in to be the one input goes to .
Modified by 5/23/88 to fix incremental search problem ,
(defhvar "Follow Mouse to Window"
when NIL ,
behaves the old way"
:value T)
(defhvar "Follow Mouse To Read-only Buffers"
... |
c0d28aa284791df06e81fb2d2891835641006519d92df6c1fb268c9fd06c47e5 | ocaml/dune | bool.ml | let compare x y =
match (x, y) with
| true, true | false, false -> Ordering.Eq
| true, false -> Gt
| false, true -> Lt
include Comparator.Operators (struct
type nonrec t = bool
let compare = compare
end)
let to_string = string_of_bool
let of_string s = bool_of_string_opt s
let to_dyn t = Dyn.Bool t
le... | null | https://raw.githubusercontent.com/ocaml/dune/714626f4d408e5c71c24ba91d0d520588702ec52/otherlibs/stdune/src/bool.ml | ocaml | let compare x y =
match (x, y) with
| true, true | false, false -> Ordering.Eq
| true, false -> Gt
| false, true -> Lt
include Comparator.Operators (struct
type nonrec t = bool
let compare = compare
end)
let to_string = string_of_bool
let of_string s = bool_of_string_opt s
let to_dyn t = Dyn.Bool t
le... | |
f17244c7add37a5d9892846b7b34112ce8315c5e5d9851cceecda374603160ee | janestreet/async_unix | import.ml | open! Core
include Int.Replace_polymorphic_compare
| null | https://raw.githubusercontent.com/janestreet/async_unix/2562a6b9316d7c6757726305482380bd7e6dba06/thread_safe_ivar/src/import.ml | ocaml | open! Core
include Int.Replace_polymorphic_compare
| |
9332f9969f0ca6ab19deda4835e98a536f40e03e4b4d2644faf3cdff028e5ac1 | google/ormolu | bracket-declaration.hs | # LANGUAGE TemplateHaskell #
[d| data T a where Foo :: T () |]
foo = [d|
foo:: Int -> Char
bar = 42
|]
[d|
data T = T
deriving (Eq, Ord, Enum, Bounded, Show)
|]
$( do [d| baz = baz |] )
$(singletons [d| data T = T deriving (Eq, Ord, Enum, Bounded, Show) |])
$(singletons [... | null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/splice/bracket-declaration.hs | haskell | # LANGUAGE TemplateHaskell #
[d| data T a where Foo :: T () |]
foo = [d|
foo:: Int -> Char
bar = 42
|]
[d|
data T = T
deriving (Eq, Ord, Enum, Bounded, Show)
|]
$( do [d| baz = baz |] )
$(singletons [d| data T = T deriving (Eq, Ord, Enum, Bounded, Show) |])
$(singletons [... | |
7c03f259c9ac6078989f27119be503cd0ff039b5d7d18eb12dee212e0f00eee0 | jmid/regexpanalyser | regexpdom.ml | (** Generic lattice signature *)
module type EXTLATTICE =
sig
type elem
val leq : elem -> elem -> bool
val join : elem -> elem -> elem
val meet : elem -> elem -> elem
val bot : elem
val top : elem
val widening : elem -> elem -> elem
val eq : elem -> elem -> bool
v... | null | https://raw.githubusercontent.com/jmid/regexpanalyser/317c2153e593a3abf8887d15b48380672a8021a1/src/regexpdom.ml | ocaml | * Generic lattice signature
* a total ordering of the datatype, useful for sorting
compare : elem -> elem -> int
Or better: factor comparison operator into L
letter : L.elem -> elem
inter : elem * elem -> elem
r & r ~ r
r & Ø ~ Ø
union : elem * elem -> elem
r + r ~ r
Ø + r ~ r ... |
module type EXTLATTICE =
sig
type elem
val leq : elem -> elem -> bool
val join : elem -> elem -> elem
val meet : elem -> elem -> elem
val bot : elem
val top : elem
val widening : elem -> elem -> elem
val eq : elem -> elem -> bool
val to_string : elem -> string
v... |
bd6223839bfe8d8914ade0d4c2189b34e5fc771052861bdd16fcbdbe4964d676 | ocaml/dune | hashtbl_intf.ml | module type S = sig
type 'a t
type key
val create : int -> 'a t
val clear : 'a t -> unit
val mem : 'a t -> key -> bool
val remove : 'a t -> key -> unit
val to_seq_values : 'a t -> 'a Seq.t
val iter : 'a t -> f:('a -> unit) -> unit
val set : 'a t -> key -> 'a -> unit
val add_exn : 'a t -> ke... | null | https://raw.githubusercontent.com/ocaml/dune/714626f4d408e5c71c24ba91d0d520588702ec52/otherlibs/stdune/src/hashtbl_intf.ml | ocaml | module type S = sig
type 'a t
type key
val create : int -> 'a t
val clear : 'a t -> unit
val mem : 'a t -> key -> bool
val remove : 'a t -> key -> unit
val to_seq_values : 'a t -> 'a Seq.t
val iter : 'a t -> f:('a -> unit) -> unit
val set : 'a t -> key -> 'a -> unit
val add_exn : 'a t -> ke... | |
a17318edf50943872c58bad663b4954e0b06e3f8e8c3d05a1154572f485d7304 | otakar-smrz/elixir-fm | Complex.hs |
module Elixir.Data.Sunny.Complex (chapter) where
import Elixir.Lexicon
import qualified Elixir.Data.Sunny.Complex.A as A
import qualified Elixir.Data.Sunny.Complex.B as B
import qualified Elixir.Data.Sunny.Complex.C as C
import qualified Elixir.Data.Sunny.Complex.D as D
import qualified Elixir.Data.Sunny.Complex.E ... | null | https://raw.githubusercontent.com/otakar-smrz/elixir-fm/fae5bab6dd53c15d25c1e147e7787b2c254aabf0/Haskell/ElixirFM/Elixir/Data/Sunny/Complex.hs | haskell |
module Elixir.Data.Sunny.Complex (chapter) where
import Elixir.Lexicon
import qualified Elixir.Data.Sunny.Complex.A as A
import qualified Elixir.Data.Sunny.Complex.B as B
import qualified Elixir.Data.Sunny.Complex.C as C
import qualified Elixir.Data.Sunny.Complex.D as D
import qualified Elixir.Data.Sunny.Complex.E ... | |
239badec7ea04ba46b871f59cf58bccf710a841c9dc65440a817f919ad3e0a91 | WormBase/wormbase_rest | overview.clj | (ns rest-api.classes.operon.widgets.overview
(:require
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn species [o]
{:data (when-let [s (:operon/species o)]
(pack-obj s))
:description "species containing the operon"})
(defn descriptio... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/operon/widgets/overview.clj | clojure | (ns rest-api.classes.operon.widgets.overview
(:require
[rest-api.classes.generic-fields :as generic]
[rest-api.formatters.object :as obj :refer [pack-obj]]))
(defn species [o]
{:data (when-let [s (:operon/species o)]
(pack-obj s))
:description "species containing the operon"})
(defn descriptio... | |
caeebc9f6955fac6dd8421b784355c13cd10f05e2099470eff7ecaf2ded88494 | alanz/ghc-exactprint | SH_Overlap4_A.hs | {-# LANGUAGE Safe #-}
# LANGUAGE FlexibleInstances #
module SH_Overlap4_A (
C(..)
) where
import SH_Overlap4_B
instance
{-# OVERLAPS #-}
C [Int] where
f _ = "[Int]"
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/SH_Overlap4_A.hs | haskell | # LANGUAGE Safe #
# OVERLAPS # | # LANGUAGE FlexibleInstances #
module SH_Overlap4_A (
C(..)
) where
import SH_Overlap4_B
instance
C [Int] where
f _ = "[Int]"
|
d0328bcaa47e6b2fbcf8dbcf36c36c7b2f3af20fe174cef6624eb4a7bd32a46e | MinaProtocol/mina | random_oracle.ml | [%%import "/src/config.mlh"]
open Core_kernel
[%%ifdef consensus_mechanism]
open Pickles.Impls.Step.Internal_Basic
[%%else]
open Snark_params.Tick
[%%endif]
module State = struct
include Array
let map2 = map2_exn
end
module Input = Random_oracle_input
let params : Field.t Sponge.Params.t =
Sponge.Params... | null | https://raw.githubusercontent.com/MinaProtocol/mina/3cece748c078b9d63020e7eed5114f87dd167f68/src/lib/random_oracle/random_oracle.ml | ocaml | x^2
x^4
x^2
x^4 | [%%import "/src/config.mlh"]
open Core_kernel
[%%ifdef consensus_mechanism]
open Pickles.Impls.Step.Internal_Basic
[%%else]
open Snark_params.Tick
[%%endif]
module State = struct
include Array
let map2 = map2_exn
end
module Input = Random_oracle_input
let params : Field.t Sponge.Params.t =
Sponge.Params... |
a34e44f62e4f419793ec226c6d6d54bd3c390f43355e26a48c468896a8967a4c | michiakig/LispInSmallPieces | chap4a.scm | $ I d : chap4a.scm , v 4.7 2006/12/03 10:54:47 queinnec Exp $
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is part of the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
;;; Newest ve... | null | https://raw.githubusercontent.com/michiakig/LispInSmallPieces/0a2762d539a5f4c7488fffe95722790ac475c2ea/src/chap4a.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is part of the files that accompany the book:
Newest version may be retrieved from:
Check the README file before using this file.
(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
Every value is encoded by a ... | $ I d : chap4a.scm , v 4.7 2006/12/03 10:54:47 queinnec Exp $
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz
The interpreter of chapter 4 .
Program e et ef ec
... |
161c6819b2ff4e7c9e3c54ca4e2f5e7dbb6c7fb20130bc70d6648f3843e1f31e | crystodev/cato | create-policy.hs | import Baseutils
( capitalized )
import Configuration.Dotenv
( defaultConfig, loadFile )
import Control.Monad
( void )
import Data.Maybe
( fromJust, isJust )
import Data.Semigroup
( (<>) )
import Options.Applicative
import Policy
( createPolicy, getPoliciesPath, getPolicyId )
import System.Envir... | null | https://raw.githubusercontent.com/crystodev/cato/ae93afe078ffb6d942a5725db07d27d3d896b8a5/app/create-policy.hs | haskell | import Baseutils
( capitalized )
import Configuration.Dotenv
( defaultConfig, loadFile )
import Control.Monad
( void )
import Data.Maybe
( fromJust, isJust )
import Data.Semigroup
( (<>) )
import Options.Applicative
import Policy
( createPolicy, getPoliciesPath, getPolicyId )
import System.Envir... | |
0b774b7c905751dedd72bfa40040f167a79d783c7c00d7e8647a811f26fd7a9e | anik545/OwlPPL | hmm_discrete.ml | open Ppl
open Core
let transition = function
| true -> categorical @@ List.zip_exn [ true; false ] [ 0.7; 0.3 ]
| false -> categorical @@ List.zip_exn [ true; false ] [ 0.3; 0.7 ]
let emission = function
| true -> Primitive.categorical @@ List.zip_exn [ true; false ] [ 0.9; 0.1 ]
| false -> Primitive.categori... | null | https://raw.githubusercontent.com/anik545/OwlPPL/ad650219769d5f32564cc771d63c9a52289043a5/ppl/bin/models/hmm_discrete.ml | ocaml | open Ppl
open Core
let transition = function
| true -> categorical @@ List.zip_exn [ true; false ] [ 0.7; 0.3 ]
| false -> categorical @@ List.zip_exn [ true; false ] [ 0.3; 0.7 ]
let emission = function
| true -> Primitive.categorical @@ List.zip_exn [ true; false ] [ 0.9; 0.1 ]
| false -> Primitive.categori... | |
875941202130210698223d679fd1c09e3ef6b845fa08a7c09532327cff8d5fe3 | jwiegley/notes | AlignPermute.hs | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module AlignPermute where
import Control.Monad
import Data.List (sort)
import Data.Align
import Data.These
import Text.Show.Pretty
subsequences :: [a] -> [[a]]
subsequences xs = [] : nonEmptySubsequences xs
nonEmptySubsequences :: [a] -> [[a]]
nonEmptySubseq... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/AlignPermute.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
module AlignPermute where
import Control.Monad
import Data.List (sort)
import Data.Align
import Data.These
import Text.Show.Pretty
subsequences :: [a] -> [[a]]
subsequences xs = [] : nonEmptySubsequences xs
nonEmptySubsequences :: [a] -> [[a]]
nonEmptySubseq... | |
16054df47f39a1abeee229d6542b7f35ff2d0e7800bd6c7ed70e91959243db0a | dgiot/dgiot | emqx_logger_textfmt.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_logger_textfmt.erl | erlang | --------------------------------------------------------------------
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 ... | Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_logger_textfmt).
-export([format/2]).
-export([check_config/1]).
-define(WITHOUT_... |
0b314b607232c139b69938c3c97d1b9e2772522b7e2353e12f5393ded8882a80 | davelambert/clojure-powerloom | high.clj | Copyright © 2011
(ns powerloom.test.high
(:use clojure.test)
(:require [powerloom.high :as hi]))
(hi/initialize)
(deftest test-high-level
(testing "loading files"
(is (= nil (hi/load "test/plm/clojure-testing.plm"))))
(testing "changing modules"
(is (= "CLOJURE-TESTING" (hi/change-module "CLOJURE... | null | https://raw.githubusercontent.com/davelambert/clojure-powerloom/4988cd8a4d41a62c577abd5c1ed6e2ca0c0e7df9/test/powerloom/test/high.clj | clojure | Copyright © 2011
(ns powerloom.test.high
(:use clojure.test)
(:require [powerloom.high :as hi]))
(hi/initialize)
(deftest test-high-level
(testing "loading files"
(is (= nil (hi/load "test/plm/clojure-testing.plm"))))
(testing "changing modules"
(is (= "CLOJURE-TESTING" (hi/change-module "CLOJURE... | |
c411166e9183fa10dd620a1e8cc82bc2438ee3c1060cef30963a8d2083d8996d | alvatar/spheres | array.scm | ! ! ! FFI arrays
.author , 2013 - 2015 . All Rights Reserved .
(cond-expand
(optimize
(declare (standard-bindings) (extended-bindings) (not safe) (block)))
(debug
(declare (safe) (debug) (debug-location) (debug-source) (debug-environments)))
(else (void)))
;;-----------------------------------------------... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/gambit/ffi/array.scm | scheme | ------------------------------------------------------------------------------
! C arrays
;;! unsigned char
! short
! unsigned short
! int
! unsigned int
! long
! unsigned long
! float
! double | ! ! ! FFI arrays
.author , 2013 - 2015 . All Rights Reserved .
(cond-expand
(optimize
(declare (standard-bindings) (extended-bindings) (not safe) (block)))
(debug
(declare (safe) (debug) (debug-location) (debug-source) (debug-environments)))
(else (void)))
(include "c-define-base-macros#.scm")
(include "... |
aabfb42c71e0901c46289b4a9b2aad7cc093d51e0d450b4ec41fb48b61629a19 | deadcode/Learning-CL--David-Touretzky | 7.11.lisp | (defun num-range (x)
(remove-if-not #'(lambda (n) (and (>= n 1) (<= n 5))) x))
(let ((foo '(num-range '(-4 3 10 21 5 2 7 1 9))))
(format t "~s = ~s~%" foo (eval foo)))
| null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%207/7.11.lisp | lisp | (defun num-range (x)
(remove-if-not #'(lambda (n) (and (>= n 1) (<= n 5))) x))
(let ((foo '(num-range '(-4 3 10 21 5 2 7 1 9))))
(format t "~s = ~s~%" foo (eval foo)))
| |
5926a5eabb2d3d78c8704f14cc2d0fef9a5c3dc6f2efc66f0e7b1634c69f02a7 | mfoemmel/erlang-otp | si_sasl_supp.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/sasl/src/si_sasl_supp.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(si_sasl_supp).
-behaviour(gen_serv... |
aa960565bee9f50c26ae01c56cd5abd3005bd72e373e340f227421f6239952cb | mzp/coq-ide-for-ios | cctac.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/coq-8.2pl2/plugins/cc/cctac.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : cctac.mli 13323 201... |
6e98a279862832f2a5ba405e76156a7771bfd1992817850cfbe974e3aec8db88 | k-bx/protocol-buffers | WireMessage.hs | {-# Language BangPatterns #-}
{- |
Here are the serialization and deserialization functions.
This module cooperates with the generated code to implement the Wire
instances. The encoding is mostly documented at
<>.
The user API functions are grouped into sections and documented. The
rest are for internal use. The ... | null | https://raw.githubusercontent.com/k-bx/protocol-buffers/a1d0fdf6b9df7ed066f623de618a4470f4493d33/Text/ProtocolBuffers/WireMessage.hs | haskell | # Language BangPatterns #
|
Here are the serialization and deserialization functions.
This module cooperates with the generated code to implement the Wire
instances. The encoding is mostly documented at
<>.
The user API functions are grouped into sections and documented. The
rest are for internal use. The main f... | module Text.ProtocolBuffers.WireMessage
messageSize,messagePut,messageGet,messagePutM,messageGetM
, messageWithLengthSize,messageWithLengthPut,messageWithLengthGet,messageWithLengthPutM,messageWithLengthGetM
, messageAsFieldSize,messageAsFieldPutM,messageAsFieldGetM
, Put,PutM,Get,runPut,runPutM,runGe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.