_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 |
|---|---|---|---|---|---|---|---|---|
6a8de51973e6944f205c07ded18b7835fd1f97f226e1421542d6c20ef8a02126 | cdepillabout/password | Types.hs | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : Data . Password . Types
Copyright : ( c ) , 2019 ; , 2020
License : BSD - style ( see LICENSE file )
Maintainer :
Stability : experimental
Portability : POSIX
This library provides datatypes for interacting with passwords .
It p... | null | https://raw.githubusercontent.com/cdepillabout/password/e90b7481af2d63de6b2d9ead3c03ddb798707d22/password-types/src/Data/Password/Types.hs | haskell | * Plain-text Password
* Password Hashing
** Unsafe debugging function to show a Password
* Hashing salts
$setup
>>> :set -XOverloadedStrings
| A plain-text password.
You should be careful with 'Password'. Make sure not to write it to logs or
store it in a database.
'fromString' on a 'String'). Alternativel... | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : Data . Password . Types
Copyright : ( c ) , 2019 ; , 2020
License : BSD - style ( see LICENSE file )
Maintainer :
Stability : experimental
Portability : POSIX
This library provides datatypes for interacting with passwords .
It p... |
2215c76b18858b7031bfb152ebcdfb588960ca87fb027de9eb4a83231daeda65 | slipstream/SlipStreamServer | service_offer.clj | (ns com.sixsq.slipstream.ssclj.resources.service-offer
"
The ServiceOffer resource is the primary resource in the Service Catalog. Each
offer describes a specific resource offer from a cloud service provider. The
specific offer for a virtual machine would typically describe the offer's CPU,
RAM, and disk resources, t... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi-resources/src/com/sixsq/slipstream/ssclj/resources/service_offer.clj | clojure |
multimethods for validation and operations
CRUD operations
initialization
| (ns com.sixsq.slipstream.ssclj.resources.service-offer
"
The ServiceOffer resource is the primary resource in the Service Catalog. Each
offer describes a specific resource offer from a cloud service provider. The
specific offer for a virtual machine would typically describe the offer's CPU,
RAM, and disk resources, t... |
1a5016d9bb08d7974389a9bd070ae70f7d78b8d682b6ed4d827944eceb9d6198 | travitch/foreign-inference | SAP.hs | # LANGUAGE TemplateHaskell , DeriveGeneric , ViewPatterns #
# LANGUAGE RankNTypes , FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| An analysis to identify @Symbolic Access Paths@ for each function
-- in a Module.
module Foreign.Inference.Analysis.SAP (
SAPSummary,
identifySAPs,
finalizedPaths,
returned... | null | https://raw.githubusercontent.com/travitch/foreign-inference/9cc0f7c730f7cd19afbd00d890abbc7109391cc6/src/Foreign/Inference/Analysis/SAP.hs | haskell | in a Module.
* Helpers
* Testing
import Debug.Trace
debug = flip trace
| Argument being stored into, Access path into that argument, and
the argument being stored.
| An argument field that is finalized
| A path from an argument that is returned.
| A path from the return value pointing to the actual argument a... | # LANGUAGE TemplateHaskell , DeriveGeneric , ViewPatterns #
# LANGUAGE RankNTypes , FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
| An analysis to identify @Symbolic Access Paths@ for each function
module Foreign.Inference.Analysis.SAP (
SAPSummary,
identifySAPs,
finalizedPaths,
returnedPaths,
returne... |
f3bb720595be8ff47c9cd4bf3dd8198c2c40f6c6de8059b777cf5edf3e2cb424 | dyzsr/ocaml-selectml | caml_tex.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/tools/caml_tex.ml | ocaml | ************************************************************************
OCaml
... | , projet Gallium , INRIA Paris
, Nagoya University
Copyright 2018 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with th... |
a6d40730874b58d65c75276ab896626001b4a0bf77de7de9aad9b0a572a43739 | kloimhardt/babashka-scittle-guestbook | guestbook.cljs | ;---
Excerpted from " Web Development with Clojure , Third Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
; courses, books, articles, and the like. Contact us if you are in doubt.
; We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/kloimhardt/babashka-scittle-guestbook/24ecfb4853fce82648c11fef0e5094cdfa4934fd/guestbook.cljs | clojure | ---
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
---
zip archive retrieved from the "Resources" section of
-development-with-clojure-third-edition/
file: guestbook-reagent/src/cljs/guestbook/c... | Excerpted from " Web Development with Clojure , Third Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
(ns guestbook.core
(:require [reagent.core :as r]
[reagent.dom :as dom]
[ajax.core :refer [GET POST]]... |
6458b5faa0e888f2fdf4ae26c298dea273e720756239fd3dde8377efbf0ec95e | danielfm/bencode | dict_test.clj | (ns bencode.type.dict-test
(:use [clojure.test]
[bencode.core]))
(deftest dict-encoding
(testing "Encoding an empty dictionary"
(is (= "de" (bencode {}))))
(testing "Encoding a simple non-empty dictionary"
(is (= "d3:cow3:moo3:onei2e4:spami64ee"
(bencode {"spam" 64, "cow" "moo", :one ... | null | https://raw.githubusercontent.com/danielfm/bencode/4b47e1c94394c1b5b74171f053873a5df772a8c7/src/test/clojure/bencode/type/dict_test.clj | clojure | (ns bencode.type.dict-test
(:use [clojure.test]
[bencode.core]))
(deftest dict-encoding
(testing "Encoding an empty dictionary"
(is (= "de" (bencode {}))))
(testing "Encoding a simple non-empty dictionary"
(is (= "d3:cow3:moo3:onei2e4:spami64ee"
(bencode {"spam" 64, "cow" "moo", :one ... | |
61ccba73784ace5a249388974bdcfee415b2b7baf00672009d261796f4415cdc | 414owen/phage | Main.hs | module Main where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Except
import Core
import Data.Char
import Data.List
import Data.Maybe
import Data.Monoid
import Interpreter
import Parser
import System.Console.Haskeline
import System.Environment
import System.IO
import Text.Megaparsec
import Val
source :... | null | https://raw.githubusercontent.com/414owen/phage/30d266c4a359c0d33afe99e0bd4d551fe91ed862/app/Main.hs | haskell | module Main where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Except
import Core
import Data.Char
import Data.List
import Data.Maybe
import Data.Monoid
import Interpreter
import Parser
import System.Console.Haskeline
import System.Environment
import System.IO
import Text.Megaparsec
import Val
source :... | |
00aa03b13d37d09d90afce9795595cf04342e51ce1afb3d4938438fdca93157d | bobzhang/fan | ast_inject.ml | open Astf
open Util
type key = string
let inject_exp_tbl: (key,exp) Hashtbl.t = Hashtbl.create 40
let inject_stru_tbl: (key,stru) Hashtbl.t = Hashtbl.create 40
let inject_clfield_tbl: (key,clfield) Hashtbl.t = Hashtbl.create 40
let register_inject_exp =
function | (k,f) -> Hashtbl.replace inject_exp_tbl k f
let regis... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/tests/asts/failed_parse/ast_inject.ml | ocaml | open Astf
open Util
type key = string
let inject_exp_tbl: (key,exp) Hashtbl.t = Hashtbl.create 40
let inject_stru_tbl: (key,stru) Hashtbl.t = Hashtbl.create 40
let inject_clfield_tbl: (key,clfield) Hashtbl.t = Hashtbl.create 40
let register_inject_exp =
function | (k,f) -> Hashtbl.replace inject_exp_tbl k f
let regis... | |
c0ecf4147d2d1ef23fbbc49b2c0323b81d545fa43fcbf6c0f8238d62c2308ed8 | democracyworks/imbarcode | codewords.cljc | (ns imbarcode.codewords
"Handles conversion from binary data to codewords.
See section 3.2.3 and 3.2.4 of the IMb spec."
(:require [imbarcode.big-integer :as bi]))
(defn data->codewords-base [data]
(let [codeword-map {:J (bi/int (bi/rem data 636))}]
(loop [data (bi/quot data 636)
codeword-map c... | null | https://raw.githubusercontent.com/democracyworks/imbarcode/8b4a821a42238c0bd62f5e19fbb51462741b4b9f/src/cljc/imbarcode/codewords.cljc | clojure | (ns imbarcode.codewords
"Handles conversion from binary data to codewords.
See section 3.2.3 and 3.2.4 of the IMb spec."
(:require [imbarcode.big-integer :as bi]))
(defn data->codewords-base [data]
(let [codeword-map {:J (bi/int (bi/rem data 636))}]
(loop [data (bi/quot data 636)
codeword-map c... | |
450edbbf8f8981f6c3d34984196efc2bc56e9cd8bffe923554001244d809b027 | serokell/blog-posts | Code.hs | # LANGUAGE DataKinds #
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
import Control.Monad
import Data.Typeable
import Data.Vinyl
data T =
TInt
| TNat
| TList T
| TPair T T
data UVal =
... | null | https://raw.githubusercontent.com/serokell/blog-posts/9daaf86064b0f366da481f7c038aa11da7b50daa/edsl-michelson/Code.hs | haskell | # LANGUAGE Rank2Types #
# LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
import Control.Monad
import Data.Typeable
import Data.Vinyl
data T =
TInt
| TNat
| TList T
| TPair T T
data UVal =
UInt Int
| UList [UVal]
| UPair UVal UVal
dat... |
6c51bc9989e8d5e8779cb8dd220f5f4ce8b822005742778ab4c38271ecf97abc | cxphoe/SICP-solutions | 2.76.rkt | ; Message-passing style is the most appropriate when new types
; must often be added.
; Data-directed style is the most appropriate when new operations
; must often be added.
; This is the well-known expression problem. | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%202-Building%20Abstractions%20with%20Data/4.Multiple%20Representations%20for%20Abstract%20Data/2.76.rkt | racket | Message-passing style is the most appropriate when new types
must often be added.
Data-directed style is the most appropriate when new operations
must often be added.
This is the well-known expression problem. | |
3fd977fefcdbd234802edbc992f7a11cf7b3295d6362ff9615b4f52383ce6990 | danx0r/festival | ogi_tll_diphone.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<--OHSU-->;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
Oregon Health & Science University ; ;
Division of Biomedical Computer Science ; ;
... | null | https://raw.githubusercontent.com/danx0r/festival/6701715566aee6519a8b7949b567f2fdad1e2772/lib/voices/english/ogi_tll_diphone/festvox/ogi_tll_diphone.scm | scheme | <--OHSU-->;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;
;
;
;
;
;;
;
release of the Festival TTS system. ;;
... |
OGI TLL diphone : female American English ( ) , version 000821 by
(set! ogi_tll_diphone_dir (cdr (assoc 'ogi_tll_diphone voice-locations)))
(set! load-path (cons (path-append ogi_tll_diphone_dir "festvox") load-path))
(set! load-path (cons (path-append libdir "ogi") load-path))
(require 'ogi_con... |
3ea747f7affdc85b46be2fae055f72613a3e7bc14cfd4137fa5d63e559440dbf | mirage/ocaml-vchan | xencat.ml | open Cmdliner
open Vchan_lwt_unix
let (>>=) = Lwt.bind
let listen =
let doc = "Act as a server rather than a client." in
Arg.(value & flag & info [ "l"; "listen"] ~doc)
let domid = Arg.(required & pos 0 (some int) None & info ~docv:"DOMID" ~doc:"Domain id of the remote endpoint." [])
let port =
let port = Vch... | null | https://raw.githubusercontent.com/mirage/ocaml-vchan/cb116c1d79b97f1271189924ddbee73fa5a49456/cli/xencat.ml | ocaml | open Cmdliner
open Vchan_lwt_unix
let (>>=) = Lwt.bind
let listen =
let doc = "Act as a server rather than a client." in
Arg.(value & flag & info [ "l"; "listen"] ~doc)
let domid = Arg.(required & pos 0 (some int) None & info ~docv:"DOMID" ~doc:"Domain id of the remote endpoint." [])
let port =
let port = Vch... | |
67d04942efbcba38fbd33cd794eca534f2a402f77454058de0a64c8134369ff2 | skeuchel/needle | DomainEnvSubstEnv.hs | {-# LANGUAGE GADTs #-}
module KnotCore.Elaboration.Lemma.DomainEnvSubstEnv where
import Control.Applicative
import qualified Coq.Syntax as Coq
import KnotCore.Syntax
import KnotCore.Elaboration.Core
lemmas :: Elab m => [EnvDecl] -> m [Coq.Sentence]
lemmas eds = sequenceA
[ eEnvDecl (typeNameOf bv) (typeNameOf ed... | null | https://raw.githubusercontent.com/skeuchel/needle/25f46005d37571c1585805487a47950dcd588269/src/KnotCore/Elaboration/Lemma/DomainEnvSubstEnv.hs | haskell | # LANGUAGE GADTs # |
module KnotCore.Elaboration.Lemma.DomainEnvSubstEnv where
import Control.Applicative
import qualified Coq.Syntax as Coq
import KnotCore.Syntax
import KnotCore.Elaboration.Core
lemmas :: Elab m => [EnvDecl] -> m [Coq.Sentence]
lemmas eds = sequenceA
[ eEnvDecl (typeNameOf bv) (typeNameOf ed)
| ed <- eds
, Env... |
f79dcdb09e7d20d1ffe1fcb5c0ccafbfed4b0b661532dea1a7bb75d1082caf82 | dsheets/ocaml-unix-sys-stat | unix_sys_stat_bindgen.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/dsheets/ocaml-unix-sys-stat/6e1b61bc9bc19933d4b28e4dccd146089808da95/lib_gen/unix_sys_stat_bindgen.ml | ocaml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
b3d7ea8f55eb5c10343e8626fcea68a7ecaa8bfc1a15b33a1c2246403b147213 | tek/proteome | Mappings.hs | module Proteome.Tags.Mappings where
import Control.Monad.Trans.Maybe (MaybeT (MaybeT, runMaybeT))
import Exon (exon)
import Path (Abs, File, Path)
import Path.IO (doesFileExist)
import Ribosome (Rpc)
import Ribosome.Api (parseNvimFile)
import Ribosome.Host.Data.Report (ReportLog)
import qualified Ribosome.Menu as Menu... | null | https://raw.githubusercontent.com/tek/proteome/a97ea1f111f75fc7f8885ec48a63051cfddd5520/packages/proteome/lib/Proteome/Tags/Mappings.hs | haskell | module Proteome.Tags.Mappings where
import Control.Monad.Trans.Maybe (MaybeT (MaybeT, runMaybeT))
import Exon (exon)
import Path (Abs, File, Path)
import Path.IO (doesFileExist)
import Ribosome (Rpc)
import Ribosome.Api (parseNvimFile)
import Ribosome.Host.Data.Report (ReportLog)
import qualified Ribosome.Menu as Menu... | |
9623d1fcae11e55925ed89bcde551c1063738937390081d9131935bafebf83ed | tfausak/patrol | CErrorSpec.hs | # LANGUAGE QuasiQuotes #
module Patrol.Type.CErrorSpec where
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.QQ.Simple as Aeson
import qualified Data.Text as Text
import qualified Patrol.Type.CError as CError
import qualified Test.Hspec as Hspec
spec :: Hspec.Spec
spec = Hspec.describe "Patrol.Type.... | null | https://raw.githubusercontent.com/tfausak/patrol/1cae55b3840b328cda7de85ea424333fcab434cb/source/test-suite/Patrol/Type/CErrorSpec.hs | haskell | # LANGUAGE QuasiQuotes #
module Patrol.Type.CErrorSpec where
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.QQ.Simple as Aeson
import qualified Data.Text as Text
import qualified Patrol.Type.CError as CError
import qualified Test.Hspec as Hspec
spec :: Hspec.Spec
spec = Hspec.describe "Patrol.Type.... | |
74e5c173eb364de80cb3543c0524ac3b0acf58e31978558429ee1659cb109a64 | logseq/logseq | config.cljs | (ns frontend.handler.config
"Fns for setting repo config"
(:require [frontend.state :as state]
[frontend.handler.file :as file-handler]
[frontend.handler.repo-config :as repo-config-handler]
[frontend.config :as config]
[frontend.db :as db]
[borkdude.rewri... | null | https://raw.githubusercontent.com/logseq/logseq/f223ef535c03275eb1b7b09583eaad4a6c6560ce/src/main/frontend/handler/config.cljs | clojure | (ns frontend.handler.config
"Fns for setting repo config"
(:require [frontend.state :as state]
[frontend.handler.file :as file-handler]
[frontend.handler.repo-config :as repo-config-handler]
[frontend.config :as config]
[frontend.db :as db]
[borkdude.rewri... | |
fe451e0fcb99ea45cf5ffd9f83bf5136c1ab88b66c9547afbf59f03cc9329294 | nikita-volkov/graph-db | Random.hs | module Benchmarks.Random where
import Benchmarks.Prelude
import qualified System.Random.MWC as MWC
import qualified Data.Char as Char
type Gen = MWC.Gen RealWorld
type GenT = ReaderT Gen
newGen :: IO Gen
newGen = MWC.create
runGenT :: MonadIO m => Gen -> GenT m r -> m r
runGenT gen t = runReaderT t gen
generateNam... | null | https://raw.githubusercontent.com/nikita-volkov/graph-db/3e886f6b298d2b2b09eb94c2818a7b648f42cb0a/executables/Benchmarks/Random.hs | haskell | module Benchmarks.Random where
import Benchmarks.Prelude
import qualified System.Random.MWC as MWC
import qualified Data.Char as Char
type Gen = MWC.Gen RealWorld
type GenT = ReaderT Gen
newGen :: IO Gen
newGen = MWC.create
runGenT :: MonadIO m => Gen -> GenT m r -> m r
runGenT gen t = runReaderT t gen
generateNam... | |
e43e455f46e11a8a359d528834994c0afad7a2884a37e657f7299417d2bfb65e | rtoy/ansi-cl-tests | fresh-line.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Jan 18 20:41:18 2004
;;;; Contains: Tests of FRESH-LINE
(in-package :cl-test)
(deftest fresh-line.1
(let (result)
(values
(with-output-to-string
(*standard-output*)
(write-char #\a)
(setq result (notnot (fresh-line))))
resu... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/fresh-line.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of FRESH-LINE
Error tests | Author :
Created : Sun Jan 18 20:41:18 2004
(in-package :cl-test)
(deftest fresh-line.1
(let (result)
(values
(with-output-to-string
(*standard-output*)
(write-char #\a)
(setq result (notnot (fresh-line))))
result))
#.(concatenate 'string "a" (string #\Newline))
t)
... |
8cc8089364e5da7f7f361c9c5d77f7bd85cdd74225fd7ddce565cebff9cbc67e | justinmeiners/exercises | 1_26.scm | ; Excercise 1.26
By not using a square method , the expmod recursive calls is done twice , instead of one for each side of the square . Due to applicative order , scheme would evaluate the procedure and then square it , rather than the other way around .
| null | https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/sicp/1/1_26.scm | scheme | Excercise 1.26 |
By not using a square method , the expmod recursive calls is done twice , instead of one for each side of the square . Due to applicative order , scheme would evaluate the procedure and then square it , rather than the other way around .
|
c1d346df8b025247961f52e73c173f35b2cd9ccaaa1fd1be34c3a9f6bb77cbb0 | grin-compiler/ghc-grin | prel.hs | # INLINE map #
map :: (a -> b) -> [a] -> [b]
map f = map'
where map' [] = []
map' (x:xs) = f x : map' xs
# INLINE concatMap #
concatMap :: (a -> [b]) -> [a] -> [b]
concatMap f = concatMap'
where concatMap' [] = []
concatMap' (x:xs) = f x ++ concatMap' xs
-- list concatenation (righ... | null | https://raw.githubusercontent.com/grin-compiler/ghc-grin/ebc4dca2e1f5b3581d4b84726730564ce909d786/ghc-grin-benchmark/boquist-grin-bench/other/queens/prel.hs | haskell | list concatenation (right-associative) | # INLINE map #
map :: (a -> b) -> [a] -> [b]
map f = map'
where map' [] = []
map' (x:xs) = f x : map' xs
# INLINE concatMap #
concatMap :: (a -> [b]) -> [a] -> [b]
concatMap f = concatMap'
where concatMap' [] = []
concatMap' (x:xs) = f x ++ concatMap' xs
# INLINE ( + + ) #
(++) :... |
775efc6c18d8ee500540ac43bdae06f744166093d6c20faec435b9bd2e6c92be | cmars/sks-keyserver | fingerprint.ml | (***********************************************************************)
(* fingerprint.ml - Computes PGP fingerprints and keyids *)
(* *)
Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2... | null | https://raw.githubusercontent.com/cmars/sks-keyserver/d848c4852cb15585525772b6378670f8724a8f39/fingerprint.ml | ocaml | *********************************************************************
fingerprint.ml - Computes PGP fingerprints and keyids
redistribute it and/or modify it under ... | Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2011 , 2012 , 2013 and Contributors
This file is part of SKS . SKS is free software ; you can
Public License as published by the Free Software Foundation ; either
version 2 of the License , or... |
9218e49e933c8400e41f4fe2d14795812907d4687fc7f3ffa36ba4efd837ef2f | gerlion/secure-e-voting-with-coq | voter_j.ml | (* Auto-generated from "voter.atd" *)
[@@@ocaml.warning "-27-32-35-39"]
type commitment = Voter_t.commitment = { a: string; b: string }[@@deriving show]
type proof = Voter_t.proof = {
challenge: string;
commitment: commitment;
response: string
}[@@deriving show]
type choice = Voter_t.choice = {
choice_alpha ... | null | https://raw.githubusercontent.com/gerlion/secure-e-voting-with-coq/c85f58f5759b960cc9d90a96fe7970e038523a9a/OCaml/voter_j.ml | ocaml | Auto-generated from "voter.atd"
atd alpha | [@@@ocaml.warning "-27-32-35-39"]
type commitment = Voter_t.commitment = { a: string; b: string }[@@deriving show]
type proof = Voter_t.proof = {
challenge: string;
commitment: commitment;
response: string
}[@@deriving show]
type choice = Voter_t.choice = {
atd beta
}[@@deriving show]
type answer = Voter_t.an... |
fecc6f7c77f28623195f6989bd66dd09c5ecb9e425c4b0e84cd0429f813463b3 | kind2-mc/kind2 | lustreDependencies.mli | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... | null | https://raw.githubusercontent.com/kind2-mc/kind2/c601470eb68af9bd3b88828b04dbcdbd6bd6bbf5/src/lustre/lustreDependencies.mli | ocaml | * Reference to an unknown declaration.
* Pretty printer for declarations.
* A dependency context.
* Empty dependency context.
* Adds a dependency in a dependency context.
* Checks if a declaration depends on another.
* Identifier corresponding to a declaration.
* Inserts a declaration in a list of declarations, ... | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... |
38a4a37263467ee42ce0c596f471a2390c8a07229f723f3af6fb151e11bbf1b9 | ComputeSoftware/datomic-client-memdb | core.clj | (ns compute.datomic-client-memdb.core
(:require
[datomic.client.api :as client]
[datomic.client.api.protocols :as client-proto]
[datomic.client.api.impl :as client-impl]
[datomic.query.support :as q-support]
[datomic.api :as peer])
(:import (java.io Closeable)))
(defn- update-vals [m ks f]
(r... | null | https://raw.githubusercontent.com/ComputeSoftware/datomic-client-memdb/b328dc9c1184fa0c67b415f6f7390cd5f253ef77/src/compute/datomic_client_memdb/core.clj | clojure | not exist on an entity. Datomic Cloud returns {} in this case. Since there | (ns compute.datomic-client-memdb.core
(:require
[datomic.client.api :as client]
[datomic.client.api.protocols :as client-proto]
[datomic.client.api.impl :as client-impl]
[datomic.query.support :as q-support]
[datomic.api :as peer])
(:import (java.io Closeable)))
(defn- update-vals [m ks f]
(r... |
dcffdd9ce79cca0739d9df8414a0407f9c5b9adef964759493aa081d8f6331f0 | crategus/cl-cffi-gtk | gobject.boxed.lisp | ;;; ----------------------------------------------------------------------------
;;; gobject.boxed.lisp
;;;
;;; The documentation of this file is taken from the GObject Reference Manual
Version 2.66 and modified to document the Lisp binding to the GObject
;;; library. See <>. The API documentation of the Lisp
;;; bin... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/gobject/gobject.boxed.lisp | lisp | ----------------------------------------------------------------------------
gobject.boxed.lisp
The documentation of this file is taken from the GObject Reference Manual
library. See <>. The API documentation of the Lisp
binding is available from <-cffi-gtk/>.
This program is free software: you can redistribut... | Version 2.66 and modified to document the Lisp binding to the GObject
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2020
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for use
GNU Lesser General Public License fo... |
91bbcba334c47443efccad1742bd89754b35ad9106cfb1455d47672b1cb4cb2a | jacekschae/learn-datomic-course-files | handlers.clj | (ns cheffy.account.handlers
(:require [cheffy.auth0 :as auth0]
[clj-http.client :as http]
[muuntaja.core :as m]
[ring.util.response :as rr]
[datomic.client.api :as d]))
(defn create-account!
[{:keys [env claims] :as _request}]
(let [conn (get-in env [:datomic :conn... | null | https://raw.githubusercontent.com/jacekschae/learn-datomic-course-files/d27af218b89006497fd868d58b58b282e7c3e38c/increments/22-list-all-recipes/src/main/cheffy/account/handlers.clj | clojure | (ns cheffy.account.handlers
(:require [cheffy.auth0 :as auth0]
[clj-http.client :as http]
[muuntaja.core :as m]
[ring.util.response :as rr]
[datomic.client.api :as d]))
(defn create-account!
[{:keys [env claims] :as _request}]
(let [conn (get-in env [:datomic :conn... | |
2d46257977d0b67f0066d3a8ae14f3b1661c78712b15acbdeaac8c6feca9e4cd | cyga/real-world-haskell | hj1new.hs | -- file: ch19/hj1.hs
# LANGUAGE ScopedTypeVariables #
import Control.OldException
handlerArith :: ArithException -> IO ()
handlerArith _ = putStrLn "Caught arith exception"
handlerSome :: SomeException -> IO ()
handlerSome _ = putStrLn "Caught some exception"
safePrint :: Integer -> IO ()
safePrint x = (print x) `ca... | null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch19/hj1new.hs | haskell | file: ch19/hj1.hs | # LANGUAGE ScopedTypeVariables #
import Control.OldException
handlerArith :: ArithException -> IO ()
handlerArith _ = putStrLn "Caught arith exception"
handlerSome :: SomeException -> IO ()
handlerSome _ = putStrLn "Caught some exception"
safePrint :: Integer -> IO ()
safePrint x = (print x) `catches` [
Handler ... |
90d14b083b40c3ddc471291bb5280342a25b6e666a899788bda57d28436cf08d | bos/rwh | funcrecs.hs | {-- snippet all --}
-- ch14/funcrecs.hs
| Our usual CustomColor type to play with
data CustomColor =
CustomColor {red :: Int,
green :: Int,
blue :: Int}
deriving (Eq, Show, Read)
| A new type that stores a name and a function .
The function takes an Int , applies some computat... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch14/funcrecs.hs | haskell | - snippet all -
ch14/funcrecs.hs
- /snippet all - |
| Our usual CustomColor type to play with
data CustomColor =
CustomColor {red :: Int,
green :: Int,
blue :: Int}
deriving (Eq, Show, Read)
| A new type that stores a name and a function .
The function takes an Int , applies some computation to it , and returns
an Int along w... |
6b88d530b2028dd504369c4165f0236bfcaa2a36a9886f1314c88e0ee3634226 | technomancy/leiningen | ssl.clj | (ns leiningen.core.ssl
(:require [cemerick.pomegranate.aether :as aether]
[clojure.java.io :as io]
[leiningen.core.user :as user])
(:import java.security.KeyStore
java.security.KeyStore$TrustedCertificateEntry
java.security.Security
java.security.cert.Certifi... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/leiningen-core/src/leiningen/core/ssl.clj | clojure | TODO: honor settings from project.clj, not just user profile
TODO: Should we support this? | (ns leiningen.core.ssl
(:require [cemerick.pomegranate.aether :as aether]
[clojure.java.io :as io]
[leiningen.core.user :as user])
(:import java.security.KeyStore
java.security.KeyStore$TrustedCertificateEntry
java.security.Security
java.security.cert.Certifi... |
9345875126fe1c9aa6a19dcc3f076ed301dca394ad83d31ad5d727ed03064cf9 | ocsigen/js_of_ocaml | generate.mli | Js_of_ocaml compiler
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/eae34864ebe70c3e93d373e87fcd7432f5a6d1d4/compiler/lib/generate.mli | ocaml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking... | |
9322957422caf7e6e06464cdce778e52006f30e4b9af07c96df28790598ba558 | okuoku/nausicaa | test-platform.sps | -*- coding : utf-8 - unix -*-
;;;
Part of : / Libxml2
;;;Contents: mostly loading test for the platform library
Date : Mon Dec 14 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 , 2010 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU Genera... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/libxml2/tests/test-platform.sps | scheme |
Contents: mostly loading test for the platform library
Abstract
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT... | -*- coding : utf-8 - unix -*-
Part of : / Libxml2
Date : Mon Dec 14 , 2009
Copyright ( c ) 2009 , 2010 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
(import (nausic... |
52e4cde017afbe066233d4294ef638cba32c9f9b11c3131eccafa6ba27961709 | unnohideyuki/bunny | Core.hs | module Core where
import Symbol
import Types
import Typing (Qual (..))
data Module = Module Id [Bind] {- [Axiom] -}
data Var = TermVar Id (Qual Type)
| DictVar Id Id
| CompositDict Expr [Expr]
{- | TypeVar Id Kind -} -- unused
deriving (Show, Eq)
dat... | null | https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/src/Core.hs | haskell | [Axiom]
| TypeVar Id Kind
unused
| Cast Expr Type
unused
| Type Type
unused | module Core where
import Symbol
import Types
import Typing (Qual (..))
data Var = TermVar Id (Qual Type)
| DictVar Id Id
| CompositDict Expr [Expr]
deriving (Show, Eq)
data Literal = LitInt Integer Type
| LitChar Char Type
| LitF... |
57e4f527b9ecf877091d1c5f0441213f1db81b64938a03531fc9bc2278fce7fe | erlang/otp | megaco_config.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2000 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/86d8a75237dea83bd0a774a81343d183594c7495/lib/megaco/src/engine/megaco_config.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2000 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Purpose : Handle configuration of Megaco / H.248
-module(megaco_config).
-behaviour(gen_server).
-export([
... |
3e70fc2498afa725014f81368149c4aca1c359011467f74faacf3be5b2e72686 | austinhaas/kanren | rKanren.cljc | (ns pettomato.kanren.rKanren.rKanren
(:require
[pettomato.kanren.rKanren.pkg :as pkg]
[pettomato.kanren.rKanren.streams :refer [mzero choice]]
[pettomato.kanren.rKanren.rank :refer [set-rank get-rank]]
#?(:clj [pettomato.kanren.rKanren.case-inf :refer [case-inf]])
#?(:clj [pettomato.kanren.rKanren.case... | null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/src/pettomato/kanren/rKanren/rKanren.cljc | clojure | (ns pettomato.kanren.rKanren.rKanren
(:require
[pettomato.kanren.rKanren.pkg :as pkg]
[pettomato.kanren.rKanren.streams :refer [mzero choice]]
[pettomato.kanren.rKanren.rank :refer [set-rank get-rank]]
#?(:clj [pettomato.kanren.rKanren.case-inf :refer [case-inf]])
#?(:clj [pettomato.kanren.rKanren.case... | |
6cc3a4c00bf7afa540b2ab9ddfcc75706d1ac76ae28ef4df1b71b1e5eebab56c | VincentToups/racket-lib | nested-dicts.rkt | #lang racket
(define (pair a b) (cons a b))
(define (key? a) (or (symbol? a) (string? a)))
(define (transform state key-or-keys function)
(match key-or-keys
[(or (? key? key)
(list (? key? key)))
(let ((value (dict-ref state key #f)))
(dict-set state key (function value)))]
[(cons (? ... | null | https://raw.githubusercontent.com/VincentToups/racket-lib/d8aed0959fd148615b000ceecd7b8a6128cfcfa8/pure-lands/utilities/nested-dicts.rkt | racket | #lang racket
(define (pair a b) (cons a b))
(define (key? a) (or (symbol? a) (string? a)))
(define (transform state key-or-keys function)
(match key-or-keys
[(or (? key? key)
(list (? key? key)))
(let ((value (dict-ref state key #f)))
(dict-set state key (function value)))]
[(cons (? ... | |
7abef094424b42b3a98bfdbc9199e170a2197d463dfb8dcb2a83bd2a0ea86bfa | finnishtransportagency/harja | shared_testutils.cljs | (ns harja.testutils.shared-testutils
"Harjan ja mobiilin laadunseurannan yhteiset jaetut fronttitestityökalut"
(:require [cljs.test :as t :refer-macros [is]]
[cljs-react-test.utils :as rt-utils]
[dommy.core :as dommy]
[reagent.core :as r]
[cljs.core.async :refer [<! >... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/488b1e096f0611e175221d74ba4f2ffed6bea8f1/test/shared-cljs/harja/testutils/shared_testutils.cljs | clojure | (ns harja.testutils.shared-testutils
"Harjan ja mobiilin laadunseurannan yhteiset jaetut fronttitestityökalut"
(:require [cljs.test :as t :refer-macros [is]]
[cljs-react-test.utils :as rt-utils]
[dommy.core :as dommy]
[reagent.core :as r]
[cljs.core.async :refer [<! >... | |
e5354487a300b036b6203bd4f6eb0c931db37e8f3498586045fb4c77a781f42d | simmsb/calamity | DispatchEvents.hs | # LANGUAGE TemplateHaskell #
-- | module containing all dispatch events
module Calamity.Gateway.DispatchEvents where
import Calamity.Internal.ConstructorName
import Calamity.Internal.UnixTimestamp
import Calamity.Internal.Utils
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Channel.UpdatedMessage
imp... | null | https://raw.githubusercontent.com/simmsb/calamity/be310255b446e87e7432673de1fbc67ef46de3ae/calamity/Calamity/Gateway/DispatchEvents.hs | haskell | | module containing all dispatch events
^ The shard that pushed this event
^ The attached data
| The data sent to the custom event | # LANGUAGE TemplateHaskell #
module Calamity.Gateway.DispatchEvents where
import Calamity.Internal.ConstructorName
import Calamity.Internal.UnixTimestamp
import Calamity.Internal.Utils
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Channel.UpdatedMessage
import Calamity.Types.Model.Guild.Ban
import C... |
e41cd8bb96b6c2238a65c57692ca0bdf8c1e1862867a6745c8215551e802780e | nvim-treesitter/nvim-treesitter | highlights.scm | [ "." ";" ":" "," ] @punctuation.delimiter
TODO : " \\ ( " " ) " in interpolations should be @punctuation.special
[ "\\(" "(" ")" "[" "]" "{" "}"] @punctuation.bracket
; Identifiers
(attribute) @variable
(type_identifier) @type
(self_expression) @variable.builtin
; Declarations
"func" @keyword.function
[
(visibi... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/67332894efcb6a51a18e1120f2fc242089de7dd1/queries/swift/highlights.scm | scheme | Identifiers
Declarations
Function calls
foo()
foo.bar.baz(): highlight the baz()
Statements
Comments
String literals
Lambda literals
Basic literals | [ "." ";" ":" "," ] @punctuation.delimiter
TODO : " \\ ( " " ) " in interpolations should be @punctuation.special
[ "\\(" "(" ")" "[" "]" "{" "}"] @punctuation.bracket
(attribute) @variable
(type_identifier) @type
(self_expression) @variable.builtin
"func" @keyword.function
[
(visibility_modifier)
(member_modi... |
15e89b5b83df4bb529c39d7814364ccd05fa28a61fc778a6a4c8e4468b5dc4d5 | HugoPeters1024/hs-sleuth | Text.hs | module Text where
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
# INLINE slice #
slice :: Int -> Int -> Text -> Text
slice offset len = T.take len . T.drop offset
-- from:
countChars :: Byte... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/171fe64c1221b175fed1fffd0abeda6becc54a34/test-project/app/Text.hs | haskell | from: | module Text where
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
# INLINE slice #
slice :: Int -> Int -> Text -> Text
slice offset len = T.take len . T.drop offset
countChars :: ByteString -> ... |
fe16a4e40fc566937fb795b1fe987ed047a57e05c238f9f5382be5133f44a3e4 | clojurewerkz/money | format.clj | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
;;
;; The APL v2.0:
;;
;; ----------------------------------------------------------------------------------
Copyright ( c ) 2012 - 2014 , , and the ClojureWerkz Team
;;
Licensed unde... | null | https://raw.githubusercontent.com/clojurewerkz/money/734b99e2c8d4617e69b20a68d1a1760262d7786f/src/clojure/clojurewerkz/money/format.clj | clojure |
The APL v2.0:
----------------------------------------------------------------------------------
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 CONDIT... | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
Copyright ( c ) 2012 - 2014 , , and the ClojureWerkz Team
distributed under the License is distributed on an " AS IS " BASIS ,
The EPL v1.0 :
Copyright ( c ) 2012 - 2014 , , ... |
b30315905e607e7240e5506c791245040c77311fe197e9d9820768607c5a152c | pepeiborra/narradar | Unify.hs | module Narradar.Constraints.Unify where
import Control.Exception (assert)
import qualified Data.Map as Map
import Data.Maybe (isJust)
import Data.Term hiding (unify, unifies)
import qualified Data.Term as Term
import Narradar.Types.Term
unifies x y = isJust (unify x y)
unifies' x y = isJust (unify' x y)
matches' x y... | null | https://raw.githubusercontent.com/pepeiborra/narradar/bc53dcad9aee480ab3424a75239bac67e4794456/src/Narradar/Constraints/Unify.hs | haskell | module Narradar.Constraints.Unify where
import Control.Exception (assert)
import qualified Data.Map as Map
import Data.Maybe (isJust)
import Data.Term hiding (unify, unifies)
import qualified Data.Term as Term
import Narradar.Types.Term
unifies x y = isJust (unify x y)
unifies' x y = isJust (unify' x y)
matches' x y... | |
aebcb036ecc6dbb5c59efc65916de34b9d89d3ae7cf44778e9d0d3a53c3bbce1 | serefayar/ayatori | build.clj | (ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def lib 'ayatori/ayatori)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def main 'ayatori.rest-api.main)
(defn uber "Build the uberjar." [opts]
(-> opts
(assoc :lib lib... | null | https://raw.githubusercontent.com/serefayar/ayatori/808b31f0ee9f00dd884311cd4dbcc4c5199a8b9d/projects/ayatori/build.clj | clojure | (ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def lib 'ayatori/ayatori)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def main 'ayatori.rest-api.main)
(defn uber "Build the uberjar." [opts]
(-> opts
(assoc :lib lib... | |
4cd21f66974c62919d2372daf296d68b792e187e9f31e62180e0de79fe7433e4 | rmloveland/scheme48-0.53 | bignum.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; These need to operate on both bignums and fixnums.
;bignum-add
;bignum-subtract
;bignum-multiply
;bignum-quotient
;bignum-remainder
;bignum-abs
;
; These only see bignums.
;bignum=
;bignum<
; This only sees fixnums.
;fixnum->bignum
; fixnum-as-bignum-l... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/vm/bignum.scm | scheme | These need to operate on both bignums and fixnums.
bignum-add
bignum-subtract
bignum-multiply
bignum-quotient
bignum-remainder
bignum-abs
These only see bignums.
bignum=
bignum<
This only sees fixnums.
fixnum->bignum
fixnum-as-bignum-length - the maximum bignum digits required to hold a fixnum
From struct.scm:
... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
The first word in a bignum is used as a header by the C code .
(define (bignum-digits bignum)
(- (bignum-length bignum) 1))
(define (bignum-digits->size n)
(bignum-size (+ n 1)))
(define (add-space size0 size1)
(bignum-digits->size (+ (max s... |
cf012d0555958d89b00c8eded2c5b3e7405924781ff5b6115668a61aa2e95bdf | onyx-platform/onyx | common.clj | (ns onyx.log.commands.common
(:require [clojure.core.async :refer [chan promise-chan close! thread <!! >!! alts!!]]
[clojure.data :refer [diff]]
[clojure.set :refer [map-invert]]
[schema.core :as s]
[onyx.schema :as os]
[onyx.peer.constants :refer [load-bala... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/log/commands/common.clj | clojure | grouped tasks need to receive on their own slot
input tasks only receive barriers can all can use same channel
Avoids making a key path to nil if there was no task slot
for this peer.
stop lifecycle in future, and send future to peer group for monitoring. | (ns onyx.log.commands.common
(:require [clojure.core.async :refer [chan promise-chan close! thread <!! >!! alts!!]]
[clojure.data :refer [diff]]
[clojure.set :refer [map-invert]]
[schema.core :as s]
[onyx.schema :as os]
[onyx.peer.constants :refer [load-bala... |
369bb5f8bd787ead02b046cd8bc76a3c13c50b9c1fc9f0b6a039d77383883323 | mauriciofierrom/servant-mongodb | EmissionTypeSpec.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeOperators #
module EmissionTypeSpec where
import Data.Maybe (isJust)
import Data.List (find, filter)
import Control.Monad.IO.Class
import Network.HTTP.Types
import Servant
import Servant.Client
import Test.Hspec
import Lib
import Enterprise.API... | null | https://raw.githubusercontent.com/mauriciofierrom/servant-mongodb/a16c2dae92fc4298b6035c32d0158280bcad940b/test/EmissionTypeSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
module EmissionTypeSpec where
import Data.Maybe (isJust)
import Data.List (find, filter)
import Control.Monad.IO.Class
import Network.HTTP.Types
import Servant
import Servant.Client
import Test.Hspec
import Lib
import Enterprise.API hiding (getEmissionTypes, getEmiss... |
14bc4f884226662c56550780c20c3ffea79cac5aec8513ad3cc2e2a0d3e37f7c | korya/efuns | wX_parent.ml | (***********************************************************************)
(* *)
(* ____ *)
(* *)
Fabrice Le Fessa... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/toolkit/wX_parent.ml | ocaml | *********************************************************************
____
... | Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
open Xtypes
open WX_types
class t parent attributes =
object (self)
inherit WX_object.t par... |
0685983b04b3ec4536e8d54e3035851c15bfb86a8855d92ed3061269f0f89f2d | webyrd/mediKanren | csv.rkt | #lang racket/base
(provide
csv-records
set-field-separator!
)
;; Informal CSV Grammar
;RECORD-SEPARATOR ::= \r\n | \n | \r
;record-stream ::= EOF | record EOF | record RECORD-SEPARATOR record-stream
;record ::= field | field FIELD-SEPARATOR record
;field ::= \" inner-content* \" | CONTENT*
;inner-content ::= CO... | null | https://raw.githubusercontent.com/webyrd/mediKanren/a2b80ea94f66bcdd4305b9369ad4184c2afe9829/medikanren/csv.rkt | racket | Informal CSV Grammar
RECORD-SEPARATOR ::= \r\n | \n | \r
record-stream ::= EOF | record EOF | record RECORD-SEPARATOR record-stream
record ::= field | field FIELD-SEPARATOR record
field ::= \" inner-content* \" | CONTENT*
inner-content ::= CONTENT | \"\" | FIELD-SEPARATOR | WHITESPACE
CONTENT includes anything other ... | #lang racket/base
(provide
csv-records
set-field-separator!
)
(define *field-separator* #\,)
(define (set-field-separator! ch) (set! *field-separator* ch))
(define (end-of-record?! in)
(define ch (peek-char in))
(or (and (char=? #\return ch)
(or (and (char=? #\newline (peek-char in 1)) (read-st... |
018e5073056ae2fbe6d227ba4dfae2bc4b8d6951ae6a79ebd6985b30c23ec268 | CUTE-Lang/miniCUTE | LambdaMergeTest.hs | HLINT ignore " Redundant do "
# LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
-- |
Copyright : ( c ) 2018 - present
-- License: BSD 3-Clause
module Minicute.Transpilers.Optimizers.LambdaMergeTest
( spec_lambdaMergeMC
) where
import Test.Tasty.Hspec
import Control.Monad
import Data.Tuple.Extra
import Minicu... | null | https://raw.githubusercontent.com/CUTE-Lang/miniCUTE/b6c8a48b10e2af0786a50175d57b5339be7be2de/main-packages/minicute-optimizer/test/Minicute/Transpilers/Optimizers/LambdaMergeTest.hs | haskell | |
License: BSD 3-Clause | HLINT ignore " Redundant do "
# LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
Copyright : ( c ) 2018 - present
module Minicute.Transpilers.Optimizers.LambdaMergeTest
( spec_lambdaMergeMC
) where
import Test.Tasty.Hspec
import Control.Monad
import Data.Tuple.Extra
import Minicute.Transpilers.Optimizers.Lamb... |
155aa8d3d7b604b34729f80f336e18a19be9ee8f5372e6ca8fc199829e073bc1 | godfat/sandbox | list_comprehension.hs |
module ListComprehension where
import List (delete)
permutation [] = [[]]
permutation xs = [x:ys | x <- xs, ys <- permutation (delete x xs)]
xs = [1..2]
ys = [3..4]
a = [ (x, y) | x <- xs | y <- ys ]
| null | https://raw.githubusercontent.com/godfat/sandbox/eb6294238f92543339adfdfb4ba88586ba0e82b8/haskell/list_comprehension.hs | haskell |
module ListComprehension where
import List (delete)
permutation [] = [[]]
permutation xs = [x:ys | x <- xs, ys <- permutation (delete x xs)]
xs = [1..2]
ys = [3..4]
a = [ (x, y) | x <- xs | y <- ys ]
| |
b03bf6d454589caf717fd603f030af56893febc29f27183f83f01ad2f40f410a | hunt-framework/hunt | DocIdSet.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE GeneralizedNewtypeDeriving #
-- ----------------------------------------------------------------------------
|
Module : . Index . Common . DocIdSet
Copyright : Copyright ( C ) 2014
License : MIT
Maintainer :
Efficient Set im... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-searchengine/src/Hunt/Common/DocIdSet.hs | haskell | # LANGUAGE DeriveDataTypeable #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------ | # LANGUAGE GeneralizedNewtypeDeriving #
|
Module : . Index . Common . DocIdSet
Copyright : Copyright ( C ) 2014
License : MIT
Maintainer :
Efficient Set implementation for ' DocId 's .
Module : Hunt.Index.Common.DocIdSet
Copyright : Copyright (C) 2014 Uwe Schmidt
Li... |
19a19651db94cd80163ca2c57913a2376c042e82ba488ecaca456c480101f09c | clj-kafka/franzy | zookeeper_integration_tests.clj | (ns franzy.admin.zookeeper.zookeeper-integration-tests
(:require [midje.sweet :refer :all]
[franzy.admin.core-test :as core-test]
[franzy.admin.zookeeper.client :as zk]
[franzy.admin.serializers :as serializers]
[franzy.admin.zookeeper.defaults :as zk-defaults])
(:imp... | null | https://raw.githubusercontent.com/clj-kafka/franzy/6c2e2e65ad137d2bcbc04ff6e671f97ea8c0e380/admin/test/franzy/admin/zookeeper/zookeeper_integration_tests.clj | clojure | (ns franzy.admin.zookeeper.zookeeper-integration-tests
(:require [midje.sweet :refer :all]
[franzy.admin.core-test :as core-test]
[franzy.admin.zookeeper.client :as zk]
[franzy.admin.serializers :as serializers]
[franzy.admin.zookeeper.defaults :as zk-defaults])
(:imp... | |
cb0153a6676a4328c2526d2ccd868a748150dfae09a9fbed1d55c68d7ebc9f2e | psg-mit/smooth | Discrete.hs | {-# LANGUAGE RankNTypes #-}
module Types.Discrete where
import Prelude hiding (Real)
import FwdMode ((:~>), pairD, fstD, sndD, dId, (@.), bang, getValue, VectorSpace)
import FwdPSh hiding (fromCPoint)
import qualified FwdPSh as F
import qualified Control.Category as C
import RealExpr (CMap)
newtype Box a g = Box (a ... | null | https://raw.githubusercontent.com/psg-mit/smooth/ad43130f3fb6a506a2f998b221d0783ba6c968eb/src/Types/Discrete.hs | haskell | # LANGUAGE RankNTypes #
there is no tangent space: the tangent bundle consists only of the value
You only need a function on values to implement the function |
module Types.Discrete where
import Prelude hiding (Real)
import FwdMode ((:~>), pairD, fstD, sndD, dId, (@.), bang, getValue, VectorSpace)
import FwdPSh hiding (fromCPoint)
import qualified FwdPSh as F
import qualified Control.Category as C
import RealExpr (CMap)
newtype Box a g = Box (a ())
flat :: PShD a => Vecto... |
6024cb27b2acce02bc8a20e71eac33f5da065fc17c49b90c5bca80e0e2af75ea | dhleong/wish | starter_test.cljs | (ns wish.sheets.dnd5e.subs.starter-test
(:require [cljs.test :refer-macros [deftest testing is]]
[wish.sheets.dnd5e.subs.starter :refer [unpack-eq-choices]]
[wish.sheets.dnd5e.subs.test-util :refer [->ds]]))
(deftest unpack-eq-choices-test
(let [dagger {:id :dagger
:type :we... | null | https://raw.githubusercontent.com/dhleong/wish/9036f9da3706bfcc1e4b4736558b6f7309f53b7b/test/cljs/wish/sheets/dnd5e/subs/starter_test.cljs | clojure | (ns wish.sheets.dnd5e.subs.starter-test
(:require [cljs.test :refer-macros [deftest testing is]]
[wish.sheets.dnd5e.subs.starter :refer [unpack-eq-choices]]
[wish.sheets.dnd5e.subs.test-util :refer [->ds]]))
(deftest unpack-eq-choices-test
(let [dagger {:id :dagger
:type :we... | |
9fe3169c8e754882b6161c5f27b2dad6ac44ccac92f43fe77a3bd9b5d0d52fff | haskell-mafia/projector | Arbitrary.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Projector.Html.Arbitrary where
import Data.Generics.Aliases
import Data.Generics.Schemes
import qualified Data.Li... | null | https://raw.githubusercontent.com/haskell-mafia/projector/6af7c7f1e8a428b14c2c5a508f7d4a3ac2decd52/projector-html/test/Test/Projector/Html/Arbitrary.hs | haskell | # LANGUAGE OverloadedStrings #
-----------------------------------------------------------------------------
Generating core types and expressions
-----------------------------------------------------------------------------
Generating untyped templates | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Projector.Html.Arbitrary where
import Data.Generics.Aliases
import Data.Generics.Schemes
import qualified Data.List as L
import Data.List.... |
d85a9fb62f577efb2425a47f481247342cec28fbc8f0caa0800981a4853fb368 | zotonic/cowmachine | controller.erl | -module(controller).
-export([
execute/2,
process/4,
content_types_provided/1
]).
%% Cowmachine API
Middleware export , place this module in the request as controller .
execute(Req, Env) ->
{ok, Req, Env#{ cowmachine_controller => ?MODULE }}.
% Controller export
process(<<"GET">>, _Acce... | null | https://raw.githubusercontent.com/zotonic/cowmachine/6252b8cab6daa80f60dd40a5c8b0f6217d34b20d/examples/websocket2/src/controller.erl | erlang | Cowmachine API
Controller export
internal functions
| -module(controller).
-export([
execute/2,
process/4,
content_types_provided/1
]).
Middleware export , place this module in the request as controller .
execute(Req, Env) ->
{ok, Req, Env#{ cowmachine_controller => ?MODULE }}.
process(<<"GET">>, _AcceptedCT, _ProvidedCT, Context) ->
Path ... |
1fb249a957adee739bed2ffc2be736c62d1fdd19688b762129ce78e31ebc45ba | valderman/haste-compiler | Builtins.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Various functions generated as builtins
module Haste.Builtins (toBuiltin) where
import GhcPlugins as GHC
import Haste.AST as AST
import Control.Applicative
TODO : proxy # ( and probably void # , realWorld # and coercionToken # as well )
-- should really just go away in t... | null | https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/src/Haste/Builtins.hs | haskell | # LANGUAGE OverloadedStrings #
| Various functions generated as builtins
should really just go away in the final code.
Everything to do with unpacking had better be built in for compactness,
efficiency and space reasons. | module Haste.Builtins (toBuiltin) where
import GhcPlugins as GHC
import Haste.AST as AST
import Control.Applicative
TODO : proxy # ( and probably void # , realWorld # and coercionToken # as well )
toBuiltin :: GHC.Var -> Maybe AST.Var
toBuiltin v =
case (modname, varname) of
(Just "GHC.Prim", "coercionToken#"... |
1d75f6d71dd78001cc0fccc9ca21b8db16fb85b318d4cac6b232f5866aceb7d3 | PacktPublishing/Haskell-High-Performance-Programming | worker_wrapper.hs |
import System.Environment (getArgs)
isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| n <= 3 = True
| otherwise = worker 2
where
worker i | i >= n = True
| mod n i == 0 = False
| otherwise = worker (i+1)
main = getArgs >>= putStrLn . sh... | null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter01/worker_wrapper.hs | haskell |
import System.Environment (getArgs)
isPrime :: Int -> Bool
isPrime n
| n <= 1 = False
| n <= 3 = True
| otherwise = worker 2
where
worker i | i >= n = True
| mod n i == 0 = False
| otherwise = worker (i+1)
main = getArgs >>= putStrLn . sh... | |
4f8e17bbbca5feb4249723fe96ee303ff38ea6d0ac439eee762d10dea39a67d2 | erlang/otp | cth_surefire.erl | %%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2012 - 2022 . 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 cop... | null | https://raw.githubusercontent.com/erlang/otp/5d356a0586c27183d29ea4e3523bf906a81d8635/lib/common_test/src/cth_surefire.erl | erlang | --------------------------------------------------------------------
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KI... | Copyright Ericsson AB 2012 - 2022 . 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(cth_surefire).
-export([id/1, init/2]).
-export([pre_init_per_suite/3]).
-export([post_init_per_suite/4])... |
8acd6eb7a6b24f6b57b216a1261f9855f24465662dcfedc9fdf2edfa9e0af5e6 | facebook/duckling | Corpus.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Ordinal.PL.Corpus
( corpus ) where
import Prelude
imp... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Ordinal/PL/Corpus.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Ordinal.PL.Corpus
( corpus ) where
import Prelude
import Data.String
import Duckling.Locale
import Duckling.Ordinal.Types
import Duckling.Resolve
import Duckling.Testing.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale PL Nothin... |
6bcb7476bd9672d08de35fdee1039001305ca5641ddd1c8391c615f7e35fe662 | crategus/cl-cffi-gtk | gtk.paned.lisp | ;;; ----------------------------------------------------------------------------
;;; gtk.paned.lisp
;;;
;;; The documentation of this file is taken from the GTK 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK library .
;;; See <>. The API documentation of the Lisp binding is
ava... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gtk/gtk.paned.lisp | lisp | ----------------------------------------------------------------------------
gtk.paned.lisp
The documentation of this file is taken from the GTK 3 Reference Manual
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of the... | Version 3.24 and modified to document the Lisp binding to the GTK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for us... |
3931bec0974a4608a1316639e05bd4591591c064b33dc66e6779811820f2c826 | rtoy/cmucl | ssl-cmucl.lisp | ssl-cmucl.lisp -- SSL streams for CMUCL , using OpenSSL library
;;
Author : < >
Time - stamp : < 2003 - 10 - 10 emarsden >
Version : 0.3
;;
Copyright ( C ) 2001 , 2003
;;
;; This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library Gener... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/contrib/ssl-cmucl/ssl-cmucl.lisp | lisp |
This library is free software; you can redistribute it and/or
either
This library 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
License along with... | ssl-cmucl.lisp -- SSL streams for CMUCL , using OpenSSL library
Author : < >
Time - stamp : < 2003 - 10 - 10 emarsden >
Version : 0.3
Copyright ( C ) 2001 , 2003
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later versio... |
9b224f969ea5b28806a658df5853f2b381a2aab0bf3d763315f960f4f6ecd971 | craigl64/clim-ccl | frames.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-internals)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved .
Portions copyright ( c ) 19... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/clim/frames.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
See the file LICENSE for the full license governing this code.
This is a list of stream *names* which will defaultly not be
bind *STANDARD-ERROR* as noise output happens on that.
Actually I think it might be correct to no... |
(in-package :clim-internals)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved .
Portions copyright ( c ) 1991 , 1992 Franz , Inc. All rights reserved .
Portions copyright ( c ) 1989 , 1990 International Lisp Associates . "
(define-protocol-class application-frame ())
(defvar *defaul... |
503a30faa4148737d8b02e3a6473fc5804df6cc8d00508d918298ece3698f025 | coq/coq | string_notation.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/0acddf0c9f33751550f686e495ceacaa60e63c14/plugins/syntax/string_notation.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
281de39990f167ee6f9646157a0a98142a43033e2fdf4e046e1b32f487378544 | chunsj/TH | dlfs04.lisp | (defpackage :dlfs-04
(:use #:common-lisp
#:mu
#:th
#:th.db.mnist))
(in-package :dlfs-04)
;; mnist data loading - takes time, so load and set
(defparameter *mnist* (read-mnist-data))
(prn *mnist*)
;; network parameters
(defparameter *w1* ($parameter (rndn 784 50)))
(defparameter *b1* ($param... | null | https://raw.githubusercontent.com/chunsj/TH/890f05ab81148d9fe558be3979c30c303b448480/examples/books/dlfs/dlfs04.lisp | lisp | mnist data loading - takes time, so load and set
network parameters
write to file
read from file
backprop testing | (defpackage :dlfs-04
(:use #:common-lisp
#:mu
#:th
#:th.db.mnist))
(in-package :dlfs-04)
(defparameter *mnist* (read-mnist-data))
(prn *mnist*)
(defparameter *w1* ($parameter (rndn 784 50)))
(defparameter *b1* ($parameter (zeros 50)))
(defparameter *w2* ($parameter (rndn 50 100)))
(defparam... |
9b97770bca01fc7ba79c3caba1d33ad1c56ceb448f2ec9eaccf51d847df924b6 | juspay/atlas | Item.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/public-transport-bap/src/Core/Spec/OnStatus/Item.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
28a209f7842d58264a163e6fbd0f7e2d54f91169e5dd64e12a52bd71470e018d | duckyuck/flare | cljs_test.cljs | (ns flare.cljs-test
(:require [flare.report :as report]
[flare.diff :as diff]
[cljs.test :as ct]))
(defn render-diff [m]
(let [[pred & values] (second (:actual m))]
(try
(when (and (= pred '=) (= 2 (count values)))
(when-let [diff (apply diff/diff* (reverse values))]
... | null | https://raw.githubusercontent.com/duckyuck/flare/4d983fda75fab718b5ec0bf4e3f8ab4bfa1a2080/src/flare/cljs_test.cljs | clojure | (ns flare.cljs-test
(:require [flare.report :as report]
[flare.diff :as diff]
[cljs.test :as ct]))
(defn render-diff [m]
(let [[pred & values] (second (:actual m))]
(try
(when (and (= pred '=) (= 2 (count values)))
(when-let [diff (apply diff/diff* (reverse values))]
... | |
2edfabd48cfbfd5c8545c35cbaca0efe39db6a6bef6e229c85cbe59da7cda1e4 | pirapira/coq2rust | csymtable.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/kernel/csymtable.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
This file manages the table of glob... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Created by for as part ... |
fdcbcc18ef57f829a8ff3b01cea2c6a321e5bd67f889f4af12b0938b0b4e0fc3 | atlas-engineer/nyxt | no-script.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(nyxt:define-package :nyxt/no-script-mode
(:documentation "Disable Javascript."))
(in-package :nyxt/no-script-mode)
(define-mode no-script-mode ()
"Disable Javascript in current buffer.
If the current URL is an intern... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/c5406683c0aba2e8d7444c8bd73ce8a84f07f2f8/source/mode/no-script.lisp | lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(nyxt:define-package :nyxt/no-script-mode
(:documentation "Disable Javascript."))
(in-package :nyxt/no-script-mode)
(define-mode no-script-mode ()
"Disable Javascript in current buffer.
If the current URL is an intern... | |
92d7f0c9355e555d9a784034ad7c9896f8b94a4128975e0990958e1591362520 | mario-goulart/salmonella | run.scm | (import scheme)
(cond-expand
(chicken-4
(use test)
(use salmonella salmonella-log-parser))
(chicken-5
(import (chicken base)
(chicken string))
(import test salmonella salmonella-log-parser))
(else
(error "Unsupported CHICKEN version.")))
;; FIXME: deduplicate
(define (string-prefix? prefix str)... | null | https://raw.githubusercontent.com/mario-goulart/salmonella/3b207e3b33490e5a5f81ccaa3c2c7f7ffcbe8125/tests/run.scm | scheme | FIXME: deduplicate
Log v2 | (import scheme)
(cond-expand
(chicken-4
(use test)
(use salmonella salmonella-log-parser))
(chicken-5
(import (chicken base)
(chicken string))
(import test salmonella salmonella-log-parser))
(else
(error "Unsupported CHICKEN version.")))
(define (string-prefix? prefix str)
(let ((index (subst... |
c2e2f672214c1b86e7eeb798708d8a103908016b40db5620dc9829c0e2c84301 | kfsm/pipe | flow.erl | %%
Copyright ( c ) 2012 - 2013 ,
Copyright ( c ) 2012 - 2013 ,
%% All Rights Reserved.
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Un... | null | https://raw.githubusercontent.com/kfsm/pipe/aa38648c477aacbc71af03d4651834eb386a39be/examples/flow/src/flow.erl | erlang |
All Rights Reserved.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for... | Copyright ( c ) 2012 - 2013 ,
Copyright ( c ) 2012 - 2013 ,
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
a simple flow - increment integer by 1
-module(flow).
-behaviour(pipe).
-export([start_link/0, s... |
139ee3f8de406620fec51c9c9c4db5298cbd07508a508eaeeaa56970d5d7c69f | aiya000/haskell-examples | ParserBase.hs | module ParserBase where
import Prelude hiding (return, fail)
type Parser a = String -> Maybe (a, String)
return :: a -> Parser a
return v = \inp -> Just (v,inp)
fail :: Parser a
fail = \inp -> Nothing
item :: Parser Char
item = \inp -> case inp of [] -> Nothing
(x:xs) -> Just (x,... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Room/0_Books/Haskell_no_usui_Book/8_Parser/2015-04-25/ParserBase.hs | haskell |
- - - - - - - - - - - - - - - -- | module ParserBase where
import Prelude hiding (return, fail)
type Parser a = String -> Maybe (a, String)
return :: a -> Parser a
return v = \inp -> Just (v,inp)
fail :: Parser a
fail = \inp -> Nothing
item :: Parser Char
item = \inp -> case inp of [] -> Nothing
(x:xs) -> Just (x,... |
b1df4dadf856e6bec5d0b95c2a68659b5f7522d766256bc2dbbff7c36ff78b93 | philnguyen/soft-contract | eta.rkt | ;
#lang racket
(require soft-contract/fake-contract)
(define (do-something)
10)
(define (id y)
(do-something)
y)
((id (λ (a) a)) #t)
((id (λ (b) b)) #f)
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/sergey/eta.rkt | racket | #lang racket
(require soft-contract/fake-contract)
(define (do-something)
10)
(define (id y)
(do-something)
y)
((id (λ (a) a)) #t)
((id (λ (b) b)) #f)
| |
d0b79635472ac69ecbe245e8075f7a1804488ebe9d62c40b82fca16a07b35c5a | BillHallahan/G2 | GetNth.hs | module GetNth where
import Prelude hiding (length)
data CList = Cons Int CList | Nil
getNth :: CList -> Int -> Int
getNth (Cons x _) 0 = x
getNth (Cons _ xs) n = getNth xs (n - 1)
getNth _ _ = -1
length :: CList -> Int
length (Cons _ xs) = 1 + length xs
length Nil = 0
getNthContract :: CList -> Int -> Int ... | null | https://raw.githubusercontent.com/BillHallahan/G2/dfd377793dcccdc7126a9f4a65b58249673e8a70/tests/Samples/GetNth.hs | haskell | module GetNth where
import Prelude hiding (length)
data CList = Cons Int CList | Nil
getNth :: CList -> Int -> Int
getNth (Cons x _) 0 = x
getNth (Cons _ xs) n = getNth xs (n - 1)
getNth _ _ = -1
length :: CList -> Int
length (Cons _ xs) = 1 + length xs
length Nil = 0
getNthContract :: CList -> Int -> Int ... | |
22f646572d618c06ce41becce8514e4ea17f5077c5d48aa60cc77b70f5dfe0fe | CodyReichert/qi | packages.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
$ Header : /usr / local / cvsrep / cl - ppcre / packages.lisp , v 1.39 2009/09/17 19:17:31 edi Exp $
Copyright ( c ) 2002 - 2009 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/cl-ppcre-master/packages.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the... | $ Header : /usr / local / cvsrep / cl - ppcre / packages.lisp , v 1.39 2009/09/17 19:17:31 edi Exp $
Copyright ( c ) 2002 - 2009 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-packag... |
50c64837cfa082c6be54ba785073de8c6e2f2ba6c3922a40bc9bbbd380d7e0ae | glebec/haskell-programming-allen-moronuki | 06-print3fix.hs | module Print3Broken where
printSecond :: IO ()
printSecond = putStrLn greeting
main :: IO ()
main = do
putStrLn greeting
printSecond
greeting = "Yarrrrr"
| null | https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/03-strings/06-print3fix.hs | haskell | module Print3Broken where
printSecond :: IO ()
printSecond = putStrLn greeting
main :: IO ()
main = do
putStrLn greeting
printSecond
greeting = "Yarrrrr"
| |
7390edb206d90b7558f5ec9281e7bb3229bb292af972ed65b4c1d3bd73d77924 | grzm/awyeah-api | validation.clj | Copyright ( c ) Cognitect , Inc.
;; All rights reserved.
(ns ^:skip-wiki com.grzm.awyeah.client.validation
"For internal use. Don't call directly."
(:require
[com.grzm.awyeah.client.protocol :as client.protocol]
[com.grzm.awyeah.service :as service]))
(set! *warn-on-reflection* true)
(defn validate-reque... | null | https://raw.githubusercontent.com/grzm/awyeah-api/1810bf624da2be58c77813106a1d51e32db11690/src/com/grzm/awyeah/client/validation.clj | clojure | All rights reserved. | Copyright ( c ) Cognitect , Inc.
(ns ^:skip-wiki com.grzm.awyeah.client.validation
"For internal use. Don't call directly."
(:require
[com.grzm.awyeah.client.protocol :as client.protocol]
[com.grzm.awyeah.service :as service]))
(set! *warn-on-reflection* true)
(defn validate-requests?
"For internal use... |
2a4775a4d192672dc011bfe28c7a3294d35d86a231e26d11e49123bbfd2e095f | mvr/at | RPn.hs | # LANGUAGE UndecidableInstances #
-- | Real projective space \(ℝP^n\)
module Math.Topology.SSet.RPn where
import Data.Coerce
import Prelude hiding (Bounded)
import Math.Topology.SGrp.KGn
import Math.Topology.SSet
import Math.Topology.SSet.Effective
import Math.Topology.SSet.Skeleton
newtype RPn = RPn Int
instance ... | null | https://raw.githubusercontent.com/mvr/at/f08b25ee2d83f761fd288a66f05dad1943879db1/src/Math/Topology/SSet/RPn.hs | haskell | | Real projective space \(ℝP^n\) | # LANGUAGE UndecidableInstances #
module Math.Topology.SSet.RPn where
import Data.Coerce
import Prelude hiding (Bounded)
import Math.Topology.SGrp.KGn
import Math.Topology.SSet
import Math.Topology.SSet.Effective
import Math.Topology.SSet.Skeleton
newtype RPn = RPn Int
instance Show RPn where
show (RPn n) = "ℝP^... |
8fe6d006a6beee3d915a1c926c83c89caf2aa3ec9d50fcc5a5e830232ebd46de | ferd/recon | recon_alloc_SUITE.erl | %%% Test suite for recon_alloc. Because many of the tests in
%%% here depend on memory allocation and this is *not* transparent,
%%% the tests are rather weak and more or less check for interface
%%% conformance and obvious changes more than anything.
-module(recon_alloc_SUITE).
-include_lib("common_test/include/ct.hrl... | null | https://raw.githubusercontent.com/ferd/recon/0f416e066a1f1ab1b0781c9b433455f0dcb4fed4/test/recon_alloc_SUITE.erl | erlang | Test suite for recon_alloc. Because many of the tests in
here depend on memory allocation and this is *not* transparent,
the tests are rather weak and more or less check for interface
conformance and obvious changes more than anything.
Freeze memory values for tests
memory returns values for 'used', 'allocated', ... | -module(recon_alloc_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
all() -> [memory, fragmentation, cache_hit_rates, average_block_sizes,
sbcs_to_mbcs, allocators, allocators_merged, snapshots, units].
memory(_Config) ->
recon_alloc:snapshot(),
Used = recon_alloc:memory(us... |
c8a6b58e3f0943d70575784a7caefbc81812f940507ee8181a84c544e38c8c93 | cfpb/qu | urls.clj | (ns qu.urls
(:require [clojurewerkz.route-one.core :refer [defroute]]))
(defroute datasets "/data")
(defroute dataset "/data/:dataset")
(defroute concept "/data/:dataset/concept/:concept")
(defroute slice-query "/data/:dataset/slice/:slice")
(defroute slice-metadata "/data/:dataset/slice/:slic... | null | https://raw.githubusercontent.com/cfpb/qu/f460d9ab2f05ac22f6d68a98a9641daf0f7c7ba4/src/qu/urls.clj | clojure | (ns qu.urls
(:require [clojurewerkz.route-one.core :refer [defroute]]))
(defroute datasets "/data")
(defroute dataset "/data/:dataset")
(defroute concept "/data/:dataset/concept/:concept")
(defroute slice-query "/data/:dataset/slice/:slice")
(defroute slice-metadata "/data/:dataset/slice/:slic... | |
be577d2bdba498c27611b6870c727069799e1c6d142c18dafdafd66d5876e196 | imitator-model-checker/imitator | AlgoAGnot.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : " AG not " al... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/AlgoAGnot.ml | ocaml | **********************************************************
**********************************************************
Modules
**********************************************************
**********************************************************
**********************************************************
***************... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : " AG not " al... |
9bd927fadc172debf6a6e7f811b5c2c453ec00fe596496abb6f7c6f873152868 | backtracking/ocamlgraph | ed_display.ml | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
(* ... | null | https://raw.githubusercontent.com/backtracking/ocamlgraph/1c028af097339ca8bc379436f7bd9477fa3a49cd/editor/ed_display.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
This fi... |
45a26fe1d84acdc30033d6cf1ae77af74ad5a397fa46f7b1dc58ddf8850ffddc | kiranlak/austin-sbst | symbolictrace.ml | Copyright : , University College London , 2011
open Cil
open Printf
open Utils
open TraceManager
module Log = LogManager
let ulonglongType = TInt(IULongLong, [])
let longlongType = TInt(ILongLong, [])
let longdblType = TFloat(FLongDouble, [])
let constCharPtrTypeSig = (typeSig charConstPtrType)
(* const char* s ... | null | https://raw.githubusercontent.com/kiranlak/austin-sbst/9c8aac72692dca952302e0e4fdb9ff381bba58ae/AustinOcaml/instrumentation/symbolictrace.ml | ocaml | const char* s
get base and use base address
e.g. *p -> p
ignore | Copyright : , University College London , 2011
open Cil
open Printf
open Utils
open TraceManager
module Log = LogManager
let ulonglongType = TInt(IULongLong, [])
let longlongType = TInt(ILongLong, [])
let longdblType = TFloat(FLongDouble, [])
let constCharPtrTypeSig = (typeSig charConstPtrType)
let constCharPtrT... |
19747d8ff696310a271b100e16983192d91b2b9421f47c732ab991331bc1f0f0 | avsm/platform | svg_types.mli | TyXML
*
* Copyright ( C ) 2010 by
* Copyright ( C ) 2010 by ( C ) 2010 by
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/tyxml.4.3.0/lib/svg_types.mli | ocaml | * SVG types with variants, goes with {!Svg_sigs.T}.
* This module defines basic data types for data, attributes
and element occuring in SVG documents.
It is based on the specification available at /.
This module is experimental, it may lack of some attributes,
and the interface is very low level and d... | TyXML
*
* Copyright ( C ) 2010 by
* Copyright ( C ) 2010 by ( C ) 2010 by
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
... |
b29272d3a21d723f4d0e343fd83e28d412558fb08f503a17ed34c7baebc37eeb | azimut/shiny | class29.lisp | somecepl.lisp
(in-package #:shiny)
;;; "somecepl" goes here. Hacks and glory await!
(defvar *gpu-verts-arr* nil)
(defvar *gpu-index-arr* nil)
(defvar *vert-stream* nil)
(defparameter *texture* nil)
(defvar *offset* nil)
(defun-g draw-verts-vert-stage ((vert :vec2))
(values (v! vert 0 1)
(+ (v2! 0.5) (... | null | https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/examples/class29.lisp | lisp | "somecepl" goes here. Hacks and glory await!
(scTime (* time .01))
(v2! ) | somecepl.lisp
(in-package #:shiny)
(defvar *gpu-verts-arr* nil)
(defvar *gpu-index-arr* nil)
(defvar *vert-stream* nil)
(defparameter *texture* nil)
(defvar *offset* nil)
(defun-g draw-verts-vert-stage ((vert :vec2))
(values (v! vert 0 1)
(+ (v2! 0.5) (* vert 0.5))))
(defun-g draw-verts-frag-stage ((... |
d7ffa3981875c8577810dd40f8a18b413562413d00733e26c4961b28e13e75d8 | gafiatulin/codewars | OneTwoThree.hs | -- Begin your day with a challenge, but an easy one.
--
module Kata (oneTwoThree) where
oneTwoThree :: Integer -> [Integer]
oneTwoThree 0 = [0, 0]
oneTwoThree n = [read . (++ f r) . replicate (fromInteger q) $ '9', read . replicate (fromInteger n) $ '1']
where f 0 = ""
f n = show n
(q, r) = n... | null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/6%20kyu/OneTwoThree.hs | haskell | Begin your day with a challenge, but an easy one.
|
module Kata (oneTwoThree) where
oneTwoThree :: Integer -> [Integer]
oneTwoThree 0 = [0, 0]
oneTwoThree n = [read . (++ f r) . replicate (fromInteger q) $ '9', read . replicate (fromInteger n) $ '1']
where f 0 = ""
f n = show n
(q, r) = n `divMod` 9
|
467b135c736b0e84fb1844cb3c4a94defe64806dd8f8d5351d5d1b723cf42875 | metabase/metabase | insights_test.clj | (ns metabase.sync.analyze.fingerprint.insights-test
(:require
[clojure.test :refer :all]
[metabase.sync.analyze.fingerprint.insights
:as
insights])
(:import
(java.math MathContext RoundingMode)))
(set! *warn-on-reflection* true)
(def ^:private cols [{:base_type :type/DateTime} {:base_type :type/N... | null | https://raw.githubusercontent.com/metabase/metabase/7e3048bf73f6cb7527579446166d054292166163/test/metabase/sync/analyze/fingerprint/insights_test.clj | clojure | Do we correctly handle descending time series?
Fixes
Keep the size of this dataset below `insights/validation-set-size` else result might depend on which
data points are included in the sample, producing intermittent test failures | (ns metabase.sync.analyze.fingerprint.insights-test
(:require
[clojure.test :refer :all]
[metabase.sync.analyze.fingerprint.insights
:as
insights])
(:import
(java.math MathContext RoundingMode)))
(set! *warn-on-reflection* true)
(def ^:private cols [{:base_type :type/DateTime} {:base_type :type/N... |
9d87285713741dcd45090ff5a9eb583c0faccf0cf59310f90b318c89cd0477be | cushon/project-euler | 77.rkt | #lang racket
(require "common.rkt")
Find the first value that can be written as the sum of primes in over five
thousand different ways .
(define (solve)
(define seen (make-hash))
(define (ways n)
(define (h n cap)
(if (hash-has-key? seen (list n cap))
(hash-ref seen (list n cap))
... | null | https://raw.githubusercontent.com/cushon/project-euler/d7fcbfff0cd59b2c3691293ff35bb2043b409f68/77.rkt | racket | #lang racket
(require "common.rkt")
Find the first value that can be written as the sum of primes in over five
thousand different ways .
(define (solve)
(define seen (make-hash))
(define (ways n)
(define (h n cap)
(if (hash-has-key? seen (list n cap))
(hash-ref seen (list n cap))
... | |
4e2bcb9a837c9fe31fe941946a3b5c6d819c2e3d14465250ad979980f32a1c94 | orbitz/gen_server | simple.ml | open Core.Std
open Async.Std
module Resp = Gen_server.Response
module Msg = struct
type t =
| Print of string
| Sync
end
module Simple_server : sig
val start : unit -> (Msg.t Gen_server.t, [> unit Gen_server.init_ret ]) Deferred.Result.t
val stop : Msg.t Gen_server.t -> (unit, [> `Closed ]) Deferred.R... | null | https://raw.githubusercontent.com/orbitz/gen_server/868d5606a96c8cbd6d4da3e4757f309198a6545c/examples/simple.ml | ocaml | Callbacks
Package the callbacks
Actual API level | open Core.Std
open Async.Std
module Resp = Gen_server.Response
module Msg = struct
type t =
| Print of string
| Sync
end
module Simple_server : sig
val start : unit -> (Msg.t Gen_server.t, [> unit Gen_server.init_ret ]) Deferred.Result.t
val stop : Msg.t Gen_server.t -> (unit, [> `Closed ]) Deferred.R... |
dcfa5c17752944cc1bb5e93af2cba301f0e55bd66cefedb7f1f34d4c5ee61023 | macourtney/Conjure | test_flow.clj | (ns flows.test-flow
(:use conjure.flow.base)
(:require [conjure.view.util :as view-util]))
(def-action show
(view-util/render-view)) | null | https://raw.githubusercontent.com/macourtney/Conjure/1d6cb22d321ea75af3a6abe2a5bc140ad36e20d1/conjure_server/test/flows/test_flow.clj | clojure | (ns flows.test-flow
(:use conjure.flow.base)
(:require [conjure.view.util :as view-util]))
(def-action show
(view-util/render-view)) | |
da26cbb778f3bc9a9d5f8a4ca9c8944bc1f1a4f74475b3ad1fc6e75dfa8ba287 | theodormoroianu/SecondYearCourses | LambdaChurch_20210415165827.hs | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415165827.hs | haskell | alpha-equivalence
subst u x t defines [u/x]t, i.e., substituting u for x in t
This substitution avoids variable captures so it is safe to be used when
reducing terms with free variables (e.g., if evaluating inside lambda abstractions)
^ substitution term
^ variable to be substitutes
^ term in which the substit... | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... |
6efcd09ea527ed9d81a694b738c4c1ae8ddc81ab9f910c279caa7de173b972f4 | Elzair/nazghul | anne.scm | ;;----------------------------------------------------------------------------
;; Constants
;;----------------------------------------------------------------------------
(define anne-lvl 4)
(define anne-species sp_human)
(define anne-occ oc_wizard)
;;-------------------------------------------------------------------... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.002/anne.scm | scheme | ----------------------------------------------------------------------------
Constants
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Schedule
------------------------------------------------------------------... | (define anne-lvl 4)
(define anne-species sp_human)
(define anne-occ oc_wizard)
In 's Hold , in the Keep guarding .
(define anne-bed ph-bed2)
(define anne-mealplace ph-tbl2)
(define anne-workplace ph-medik)
(define anne-leisureplace ph-dine)
(kern-mk-sched 'sch_anne
(list 0 0 anne-bed "slee... |
7de2488959181823b2ab6409b2ad0887fc3bf1e015bbf5fed308c66d1e8c2fe5 | jfacorro/klarna-loves-erlang-meetup-2020 | bank_proper_transfer_response.erl | -module(bank_proper_transfer_response).
-include("bank_proper.hrl").
-export([bank_proper_transfer_response/0]).
-export([bank_proper_transfer_response/1]).
-export_type([bank_proper_transfer_response/0]).
-type bank_proper_transfer_response() ::
[ {'id', binary() }
| {'source_account_id', binary() }
| {'des... | null | https://raw.githubusercontent.com/jfacorro/klarna-loves-erlang-meetup-2020/61795af0ac80ac7afa4a00a215342988e5aac45f/apps/bank_proper/src/model/bank_proper_transfer_response.erl | erlang | -module(bank_proper_transfer_response).
-include("bank_proper.hrl").
-export([bank_proper_transfer_response/0]).
-export([bank_proper_transfer_response/1]).
-export_type([bank_proper_transfer_response/0]).
-type bank_proper_transfer_response() ::
[ {'id', binary() }
| {'source_account_id', binary() }
| {'des... | |
f4f104c9421f31bae5a9dc509e705953b61180fdc7054d24c8efce1ff978e3de | dparis/cooler | core.clj | (ns cooler.store.core
"Core definition of RateLimitStore protocol and related functionality.")
(defprotocol RateLimitStore
(read-value [this k])
(set-new-value! [this k v] [this k v ttl-ms])
(compare-and-update! [this k old-val new-val] [this k old-val new-val ttl-ms]))
| null | https://raw.githubusercontent.com/dparis/cooler/38b2efb3c4efb32d1b3d03c70176f690555f94d1/src/cooler/store/core.clj | clojure | (ns cooler.store.core
"Core definition of RateLimitStore protocol and related functionality.")
(defprotocol RateLimitStore
(read-value [this k])
(set-new-value! [this k v] [this k v ttl-ms])
(compare-and-update! [this k old-val new-val] [this k old-val new-val ttl-ms]))
| |
ff76ef4a58b7a546f80f005777d52e3be6a103b09748c5b4c7ef0d382a137fde | typelead/etlas | FieldDescr.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
Module : Distribution . Parsec . Types . FieldDescr
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
-... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Parsec/Types/FieldDescr.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
---------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Portability : portable
* Field name
* Field description
** Pretty printing
* Unknown fields
-----------------------------------------... | # LANGUAGE FlexibleContexts #
Module : Distribution . Parsec . Types . FieldDescr
module Distribution.Parsec.Types.FieldDescr (
FieldName,
FieldDescr (..),
liftField,
simpleField,
boolField,
optsField,
listField,
listFieldWithSep,
commaListField,
commaListFieldWithSep... |
e6583fa73638010f4dd05316ffc16a4a7d0dceb1443a6b90c8a3b3ed812016c3 | neongreen/haskell-ex | Main.hs | README
--- -- Goal
* With a data model for arithmatic , write functions to
print and evaluate expressions .
* Use ` div ` for division .
* Remember : Use parenthesis around negative numbers .
* Bonus : Only print parenthesis when they are needed .
--- Expr
-- Goal
* Wit... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week3/expr/jasonkuhrt/Main.hs | haskell | - -- Goal
- Expr
Goal
- Solution Notes
- Factor 1 : Operator Precedence
------ --------
- Factor 2 : Associativity
------ --------
- Conclusion
- Aside
- Solution Notes
- Factor 1: Operator Precedence
------ --------
- Factor 2: Associativity
------ --------
- Conclusion... | README
* With a data model for arithmatic , write functions to
print and evaluate expressions .
* Use ` div ` for division .
* Remember : Use parenthesis around negative numbers .
* Bonus : Only print parenthesis when they are needed .
* With a data model for arithmatic, wri... |
e106b4644164bf54a03e993cfde863e3a9e41a67060a99c1ca72b1fc629392e8 | FreeProving/free-compiler | CompletePatternPassTests.hs | | This module contains tests for " . CompletePatternPass " .
module FreeC.Pass.CompletePatternPassTests where
import Test.Hspec
import FreeC.Monad.Class.Testable
import FreeC.Pass.CompletePatternPass
import FreeC.Test.Environment
import FreeC.Test.Parser
-- | Test... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/test/FreeC/Pass/CompletePatternPassTests.hs | haskell | | Test group for 'completePatternPass' tests. | | This module contains tests for " . CompletePatternPass " .
module FreeC.Pass.CompletePatternPassTests where
import Test.Hspec
import FreeC.Monad.Class.Testable
import FreeC.Pass.CompletePatternPass
import FreeC.Test.Environment
import FreeC.Test.Parser
testCompl... |
235a7c476c292c3ae04907b05e5faa024024ed2d4819981a1cda274ca59fadf0 | old-reliable/steamroller | steamroller_ast.erl | -module(steamroller_ast).
-export([ast/1, ast/4, tokens/1, eq/2]).
-type ast() :: list(erl_parse:abstract_form()).
-type token() :: erl_scan:token().
-type tokens() :: list(token()).
-type macros() :: list(atom() | {atom(), term()}).
-export_type([token/0, tokens/0, macros/0]).
%% API
-spec ast(binary()) -> {ok, a... | null | https://raw.githubusercontent.com/old-reliable/steamroller/ebe4b5411a74dfda0a40304107464dba5ff109ae/src/steamroller_ast.erl | erlang | API
Add the file dir to includes so we can find necessary headers.
Neither are most of the attributes (things like `-define(BLAH, blah).`).
We'll need them to generate formatted code.
Not exactly sure what these are but we occasionally get them. | -module(steamroller_ast).
-export([ast/1, ast/4, tokens/1, eq/2]).
-type ast() :: list(erl_parse:abstract_form()).
-type token() :: erl_scan:token().
-type tokens() :: list(token()).
-type macros() :: list(atom() | {atom(), term()}).
-export_type([token/0, tokens/0, macros/0]).
-spec ast(binary()) -> {ok, ast()} |... |
f30f6432622ae56a9480174a28c45921cf994e1e23441374cbbf41485e9737e3 | jixiuf/helloerlang | qsort.erl | -*- coding : utf-8 -*-
-module(qsort).
-export([sort/1]).
sort([])->
[];
sort([H|T]) ->
{Bigger,Smaller} = split(H,T),
sort(Bigger)++ [H]++ sort(Smaller).
split(M,Rest)->
split(M,Rest,[],[])
.
split(_M,[],Bigger,Smaller)->
{Bigger,Smaller};
split(M,[H|Rest],Bigger,Smaller)when H >M ->
spl... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/qsort.erl | erlang | -*- coding : utf-8 -*-
-module(qsort).
-export([sort/1]).
sort([])->
[];
sort([H|T]) ->
{Bigger,Smaller} = split(H,T),
sort(Bigger)++ [H]++ sort(Smaller).
split(M,Rest)->
split(M,Rest,[],[])
.
split(_M,[],Bigger,Smaller)->
{Bigger,Smaller};
split(M,[H|Rest],Bigger,Smaller)when H >M ->
spl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.