_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 |
|---|---|---|---|---|---|---|---|---|
9b0044dd7fcd8e143de335730cab4eae76d3698706a3e83b3bb33bc9e97f77d2 | YoshikuniJujo/test_haskell | TryTypeLevelList.hs | {-# LANGUAGE ScopedTypeVariables, TypeApplications #-}
{-# LANGUAGE DataKinds, KindSignatures, TypeOperators #-}
# LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts , FlexibleInstances , UndecidableInstances #
# OPTIONS_GHC -Wall -fno - warn - tabs... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/871e64ffcf3e9b8c6eea0604e723dc421179f7fe/tribial/tribial-trials/src/TryTypeLevelList.hs | haskell | # LANGUAGE ScopedTypeVariables, TypeApplications #
# LANGUAGE DataKinds, KindSignatures, TypeOperators #
# OVERLAPPABLE # | # LANGUAGE MonoLocalBinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts , FlexibleInstances , UndecidableInstances #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module TryTypeLevelList where
import Data.Kind
class PrefixOf (xs :: [Type]) (ys :: [Type])
instance Prefi... |
052da81e755cd3e7fcbaff67bca2ea95295ef2bdcced79d55a693346644ddeee | stumpwm/stumpwm-contrib | bitcoin.lisp | bitcoin.lisp
(in-package :bitcoin)
;;; CODE:
Bitcoin formatter for the Stumpwm mode - line .
;;; There is no timestamp, so let's store up to size
;;; values got from url and calculate its average. Comparing
;;; actual value with this average, set a color format.
;;; Exported
(defparameter *modeline-use-colors... | null | https://raw.githubusercontent.com/stumpwm/stumpwm-contrib/1751590093a838ef48721b4eda6980e0b69cd5b3/modeline/bitcoin/bitcoin.lisp | lisp | CODE:
There is no timestamp, so let's store up to size
values got from url and calculate its average. Comparing
actual value with this average, set a color format.
Exported
Get price
Just in case internet drops
Return NIL in case some condition is triggered
Store prices
Write on modeline
Add value to values... | bitcoin.lisp
(in-package :bitcoin)
Bitcoin formatter for the Stumpwm mode - line .
(defparameter *modeline-use-colors* t
"Flag use color or not in price value.")
(defparameter *threshold* 0.001
"Magnitude that must be exceeded for a increasing or decreasing
color.")
(defparameter *time-delay* 30
"Time ... |
b974d600afdd21fcaa31f8436f6b3513c3505c7d434c1565bc1b3e4ff2f6383d | kaizhang/Taiji | Exporter.hs | -- Export results generated by Taiji for visualization by external programs.
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Taiji.Component.Exporter (builder) where
import Bio.Data.Experiment.Types
import Bio.Utils.Misc (readDouble)
import Codec.Compr... | null | https://raw.githubusercontent.com/kaizhang/Taiji/f6a050ba0ee6acb6077435566669279455cef350/Taiji/src/Taiji/Component/Exporter.hs | haskell | Export results generated by Taiji for visualization by external programs.
# LANGUAGE OverloadedStrings #
^ File storing the PageRank results
^ networks
| Read data, normalize and calculate p-values.
^ PageRank | # LANGUAGE TemplateHaskell #
module Taiji.Component.Exporter (builder) where
import Bio.Data.Experiment.Types
import Bio.Utils.Misc (readDouble)
import Codec.Compression.GZip (bestCompression, compressLevel,
compressWith, defaul... |
b0989383bd3901e595f1689552abc70bc3432f9e047dc9d4f8048ae66e1a13b8 | sbcl/specializable | package.lisp | ;;;; package.lisp --- Package definition for the language-extension.prototype-specializer system.
;;;;
Copyright ( C ) 2014 Jan Moringen
;;;;
Author : < >
(cl:defpackage #:prototype-specializer
(:use
#:cl
#:alexandria
#:specializable)
;; Conditions
(:export
#:delegation-cycle-error
#:deleg... | null | https://raw.githubusercontent.com/sbcl/specializable/a08048ce874a2a8c58e4735d88de3bf3da0de052/src/prototype-specializer/package.lisp | lisp | package.lisp --- Package definition for the language-extension.prototype-specializer system.
Conditions | Copyright ( C ) 2014 Jan Moringen
Author : < >
(cl:defpackage #:prototype-specializer
(:use
#:cl
#:alexandria
#:specializable)
(:export
#:delegation-cycle-error
#:delegation-cycle-error-object
#:delegation-cycle-error-delegation
#:delegation-cycle-error-path)
Prototype object protoc... |
9b9de21778e92b48e373628b592ac8512a2475a8a20b6fb03ec3c67015c871e0 | cl-rabbit/cl-bunny | dummy.lisp | (in-package :cl-bunny.test)
(plan 1)
(subtest "Dummy, sanity check"
(ok :t "T is T"))
(finalize)
| null | https://raw.githubusercontent.com/cl-rabbit/cl-bunny/6da7fe161efc8d6bb0b8b09ac8efad03553d765c/t/dummy.lisp | lisp | (in-package :cl-bunny.test)
(plan 1)
(subtest "Dummy, sanity check"
(ok :t "T is T"))
(finalize)
| |
d97c7f1c85f3d30f4e0b41f5c5e4fdbc1a6b76d2fc40b1b6fb6d52247d588bdf | vaibhavsagar/experiments | XmlReader.hs | --
wrapper for Dotnet . System . Xml . XmlReader
--
module Dotnet.System.Xml.XmlReader where
import Dotnet
import qualified Dotnet.System.Object
import Dotnet.System.Xml.XmlNameTable
import Dotnet.System.Xml
data XmlReader_ a
type XmlReader a = Dotnet.System.Object.Object (XmlReader_ a)
attributeCount :: XmlRea... | null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/dotnet/lib/Dotnet/System/Xml/XmlReader.hs | haskell | wrapper for Dotnet . System . Xml . XmlReader
module Dotnet.System.Xml.XmlReader where
import Dotnet
import qualified Dotnet.System.Object
import Dotnet.System.Xml.XmlNameTable
import Dotnet.System.Xml
data XmlReader_ a
type XmlReader a = Dotnet.System.Object.Object (XmlReader_ a)
attributeCount :: XmlReader a -... | |
0286741fafc552f08e47dd5e327253a6fb357795c5eee7508e02e133a2b305cd | rtrusso/scp | read9.scm | (define l (call-with-input-file "tests/read-ext-id.scm"
(lambda (f) (read f))))
(let ((index 0))
(for-each (lambda (x)
(set! index (+ index 1))
(display "index ")
(display index)
(display ": ")
(write x)
(newlin... | null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/tests/read9.scm | scheme | (define l (call-with-input-file "tests/read-ext-id.scm"
(lambda (f) (read f))))
(let ((index 0))
(for-each (lambda (x)
(set! index (+ index 1))
(display "index ")
(display index)
(display ": ")
(write x)
(newlin... | |
340931de985782cabb4e2d4d1b7777d898a13cc39037754778a2eab9479f8284 | psilord/option-9 | scene-man.lisp | (in-package :option-9)
(defmethod add-child ((parent frame) (child frame))
"Return the CHILD after it has been added to PARENT. No checks for
duplicate adds are performed."
(unless (children parent)
(setf (children parent) (make-hash-table :test #'eq)))
(setf (gethash child (children parent)) child)
(set... | null | https://raw.githubusercontent.com/psilord/option-9/44d96cbc5543ee2acbdcf45d300207ef175462bc/scene-man.lisp | lisp | This is recursive from the root (at the parent) to the leaves, but
I don't ever expect the depth of this tree to be stack breaking.
When the child is removed, all children of it are ripped out of the
scene tree with it too. XXX Fix using the orphan-policy mechanism.
XXX If this child had children of its own, where... | (in-package :option-9)
(defmethod add-child ((parent frame) (child frame))
"Return the CHILD after it has been added to PARENT. No checks for
duplicate adds are performed."
(unless (children parent)
(setf (children parent) (make-hash-table :test #'eq)))
(setf (gethash child (children parent)) child)
(set... |
80c1e85fa9a394e5c8b1c16be73fa2a40b10f2b14a3614c1e7eb5fbd64d73836 | metaocaml/ber-metaocaml | recvfrom_unix.ml | (* TEST
include unix
modules = "recvfrom.ml"
* hasunix
** not-windows
*** bytecode
*** native
*)
open Recvfrom
let () =
let server_path = "ocaml-test-socket-unix" in
ensure_no_file server_path;
at_exit (fun () -> ensure_no_file server_path);
with_bound_socket server_path (fun server_addr server_socket ->
(... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/lib-unix/unix-socket/recvfrom_unix.ml | ocaml | TEST
include unix
modules = "recvfrom.ml"
* hasunix
** not-windows
*** bytecode
*** native
path socket, just reuse server addr
unnamed socket
unbound socket should be treated as empty path | open Recvfrom
let () =
let server_path = "ocaml-test-socket-unix" in
ensure_no_file server_path;
at_exit (fun () -> ensure_no_file server_path);
with_bound_socket server_path (fun server_addr server_socket ->
test_sender ~client_socket:server_socket ~server_socket ~server_addr ~client_addr:server_addr;
... |
5db1d36635f49a70666998fe44b373bf6e938d6acb67552dafabaca92b1d70ab | clojure/core.rrb-vector | test_cljs_only.cljs | (ns clojure.core.rrb-vector.test-cljs-only
(:require [clojure.test :as test :refer [deftest testing is are]]
[clojure.core.rrb-vector.test-utils :as u]
[clojure.core.rrb-vector :as fv]
[clojure.core.rrb-vector.debug :as dv]
[clojure.core.rrb-vector.debug-platform-depend... | null | https://raw.githubusercontent.com/clojure/core.rrb-vector/88c2f814b47c0bbc4092dad82be2ec783ed2961f/src/test/cljs/clojure/core/rrb_vector/test_cljs_only.cljs | clojure | (ns clojure.core.rrb-vector.test-cljs-only
(:require [clojure.test :as test :refer [deftest testing is are]]
[clojure.core.rrb-vector.test-utils :as u]
[clojure.core.rrb-vector :as fv]
[clojure.core.rrb-vector.debug :as dv]
[clojure.core.rrb-vector.debug-platform-depend... | |
a7d80a4167537c33503457264c4358210c6cce7fda4c1630125bd17784bff02d | lspector/Clojush | replace_space_with_newline.clj | ;; replace_space_with_newline.clj
,
;;
Problem Source : ( / )
;;
;; Given a string input, print the string, replacing spaces with newlines.
;; The input string will not have tabs or newlines, but may have multiple spaces
in a row . It will have maximum length of 20 characters . Also , the program
;; should re... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/problems/software/replace_space_with_newline.clj | clojure | replace_space_with_newline.clj
Given a string input, print the string, replacing spaces with newlines.
The input string will not have tabs or newlines, but may have multiple spaces
should return the integer count of the non-whitespace characters.
input stack has the input string
Define test cases
Atom generat... | ,
Problem Source : ( / )
in a row . It will have maximum length of 20 characters . Also , the program
(ns clojush.problems.software.replace-space-with-newline
(:use clojush.pushgp.pushgp
[clojush pushstate interpreter random util globals]
clojush.instructions.tag
clojure.math.numeri... |
27d2e9632b52289d289f9e55ff581ec4349df36cafbbb28688f8f60d2f203428 | argp/bap | batLogger.ml | -*- Mode : ; indent - tabs - mode : nil -*-
(******************************************************************************)
Copyright ( c ) 2009 , Metaweb Technologies , Inc.
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted ... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batLogger.ml | ocaml | ****************************************************************************
****************************************************************************
* log utilities
****************************************************************************
* log modules
*********************************************************... | -*- Mode : ; indent - tabs - mode : nil -*-
Copyright ( c ) 2009 , Metaweb Technologies , Inc.
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions
* are met :
* * Redistributions... |
e20e63bd850ff9de52415c2bfc8290507eadf88e0e6d281d7c002a84a7fbe6bd | blindglobe/common-lisp-stat | linear-regression.lisp | ;;; -*- mode: lisp -*-
Time - stamp : < 2009 - 12 - 13 18:02:13 tony >
Creation : < 2009 - 04 - 19 09:41:09 >
;;; File: linear-regression.lisp
Author : < >
Copyright : ( c)2009 - - , . BSD , MIT , LLGPL , or
GPLv2 + , or + depending on how it arrives .
;;; Purpose: E... | null | https://raw.githubusercontent.com/blindglobe/common-lisp-stat/0c657e10a4ee7e8d4ef3737f8c2d4e62abace2d8/examples/OLD/linear-regression.lisp | lisp | -*- mode: lisp -*-
File: linear-regression.lisp
Purpose: Example of basic linear regression data analysis in CLS.
What is this talk of 'release'? Klingons do not make software
'releases'. Our software 'escapes', leaving a bloody trail of
designers and quality assurance people in its wake.
TODO:
- conf... |
Time - stamp : < 2009 - 12 - 13 18:02:13 tony >
Creation : < 2009 - 04 - 19 09:41:09 >
Author : < >
Copyright : ( c)2009 - - , . BSD , MIT , LLGPL , or
GPLv2 + , or + depending on how it arrives .
(in-package :ls-user)
(defparameter *m*
(regression-model (list->vector-l... |
d6d837e39c0af0af1ad73515a026e45f6f4032cfc72b1c1d20b60dc526b1419b | semilin/layoup | real-ev.lisp |
(MAKE-LAYOUT :NAME "real-ev" :MATRIX (APPLY #'KEY-MATRIX 'NIL) :SHIFT-MATRIX
NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/real-ev.lisp | lisp |
(MAKE-LAYOUT :NAME "real-ev" :MATRIX (APPLY #'KEY-MATRIX 'NIL) :SHIFT-MATRIX
NIL :KEYBOARD NIL) | |
9ea6b8a2b695287b6db1ecfe195fd7f17cb2c344591e196c33cebbd9978ec974 | tip-org/tools | Annotations.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Tip.GHC.Annotations(
module Tip.GHC.Annotations,
BuiltinType(..), Builtin(..), Lit(..)) where
import Data.Data
import Tip.Types
-- An annotation that can be attached to a function to give it special
-- meaning in tip-ghc.
data TipAnnotation =
-- Rename the function w... | null | https://raw.githubusercontent.com/tip-org/tools/34350072587bd29157d18331eb895a1b2819555f/tip-types/src/Tip/GHC/Annotations.hs | haskell | # LANGUAGE DeriveDataTypeable #
An annotation that can be attached to a function to give it special
meaning in tip-ghc.
Rename the function when translating it to TIP.
Rename the projection functions for this constructor.
Unconditionally inline the function
(useful when the function must be applied to a monomorph... | module Tip.GHC.Annotations(
module Tip.GHC.Annotations,
BuiltinType(..), Builtin(..), Lit(..)) where
import Data.Data
import Tip.Types
data TipAnnotation =
Name String
| Projections [String]
| Inline
To avoid mishaps , you should also mark the function as NOINLINE .
| Uninterpreted
| PrimType Builti... |
4f571c50651607a65b63128eec9e3e29f756e802efced4249519aba5d6c5041d | arcusfelis/xapian-erlang-bindings | xapian_pool_sup.erl | %% It is a pool of pools
-module(xapian_pool_sup).
-behaviour(supervisor).
-export([start_link/0, start_pool/1]). %% API.
-export([init/1]). %% supervisor.
-define(SUPERVISOR, ?MODULE).
%% API.
-spec start_link() -> {ok, Pid::pid()}.
start_link() ->
supervisor:start_link({local, ?SUPERVISOR}, ?MODULE, []).
%% ... | null | https://raw.githubusercontent.com/arcusfelis/xapian-erlang-bindings/29871b3e64d658e74701c6ba68bf59e1a9b168f1/src/xapian_pool_sup.erl | erlang | It is a pool of pools
API.
supervisor.
API.
supervisor. | -module(xapian_pool_sup).
-behaviour(supervisor).
-define(SUPERVISOR, ?MODULE).
-spec start_link() -> {ok, Pid::pid()}.
start_link() ->
supervisor:start_link({local, ?SUPERVISOR}, ?MODULE, []).
start_pool(Args) ->
supervisor:start_child(?SUPERVISOR, [Args]).
init([]) ->
ChildSpec = {pool,
... |
cb59bfe8a2fbe6e0e84c663b3d13b20ca60af58a0f02fae6944eff2dd94a57c8 | racket/racket-pkg-website | users.rkt | #lang racket/base
;; User management - userdb, plus registration and emailing
(provide login-password-correct?
send-registration-or-reset-email!
registration-code-correct?
register-or-update-user!)
(require net/sendmail)
(require reloadable)
(require infrastructure-userdb)
(require "config.... | null | https://raw.githubusercontent.com/racket/racket-pkg-website/d25b68c125698d944446f8e0a945eff85caebccd/src/users.rkt | racket | User management - userdb, plus registration and emailing
writeable! | #lang racket/base
(provide login-password-correct?
send-registration-or-reset-email!
registration-code-correct?
register-or-update-user!)
(require net/sendmail)
(require reloadable)
(require infrastructure-userdb)
(require "config.rkt")
(require "hash-utils.rkt")
(define-logger racket-pkg-... |
f10d4967d063006d5d4650f0da60a9a16a3a548d6519bf3d3b5f3942e7bc2163 | lambdalille/history | place.mli | type t
include Yocaml.Metadata.READABLE with type t := t
include Yocaml.Metadata.INJECTABLE with type t := t
val fetch
: (module Yocaml.Metadata.VALIDABLE)
-> string
-> (Yocaml.Deps.t * t) Yocaml.t
| null | https://raw.githubusercontent.com/lambdalille/history/6b5dd76b80d095d3a54e8860a7568b115ed747e8/bin/place.mli | ocaml | type t
include Yocaml.Metadata.READABLE with type t := t
include Yocaml.Metadata.INJECTABLE with type t := t
val fetch
: (module Yocaml.Metadata.VALIDABLE)
-> string
-> (Yocaml.Deps.t * t) Yocaml.t
| |
9a3d352f45b612d3df3ac90c8ca9972fae7b8ab6d92d66780563a09aafb3e46f | metaocaml/ber-metaocaml | parsecmmaux.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tools/parsecmmaux.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
val bind_ident: string -> Backend_var.With_provenance.t
val find_ident: string -> Backend_var.t
val unbi... |
1cab7a96987a58577843cac10ec1a9c504aef9c393e407c83425a8bb43dd88a9 | j-mie6/ParsleyHaskell | Analysis.hs | |
Module : Parsley . Internal . Frontend . Analysis
Description : Exposes various analysis passes .
License : BSD-3 - Clause
Maintainer : : experimental
Exposes the analysis passes defined within the analysis submodules via ` analyse ` .
@since 1.5.0.0
Module : Parsley.Internal.... | null | https://raw.githubusercontent.com/j-mie6/ParsleyHaskell/045ab78ed7af0cbb52cf8b42b6aeef5dd7f91ab2/parsley-core/src/ghc/Parsley/Internal/Frontend/Analysis.hs | haskell | |
Module : Parsley . Internal . Frontend . Analysis
Description : Exposes various analysis passes .
License : BSD-3 - Clause
Maintainer : : experimental
Exposes the analysis passes defined within the analysis submodules via ` analyse ` .
@since 1.5.0.0
Module : Parsley.Internal.... | |
c8752f9f33ef71d31e968eae881cf84a53d8730ced0c6386fde0c27c4584f62f | ekmett/semigroupoids | Semigroupoid.hs | # LANGUAGE CPP #
{-# LANGUAGE GADTs #-}
# LANGUAGE PolyKinds #
# LANGUAGE Trustworthy #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Semigroupoid
Copyright : ( C ) 2007 - 2015
-- License : BSD-style (see the file LICENSE)
--
Maintainer : ... | null | https://raw.githubusercontent.com/ekmett/semigroupoids/f63f7a2d696fdd6ed72eea90798fca1f86d6d040/src/Data/Semigroupoid.hs | haskell | # LANGUAGE GADTs #
---------------------------------------------------------------------------
|
Module : Data.Semigroupoid
License : BSD-style (see the file LICENSE)
Stability : provisional
Portability : portable
A semigroupoid satisfies all of the requirements to be a Category except
for the e... | # LANGUAGE CPP #
# LANGUAGE PolyKinds #
# LANGUAGE Trustworthy #
Copyright : ( C ) 2007 - 2015
Maintainer : < >
module Data.Semigroupoid
( Semigroupoid(..)
, WrappedCategory(..)
, Semi(..)
) where
import Control.Applicative
import Control.Arrow
import Control.Category
import Data.Functor.Bin... |
10a063c13b7210908ec851327472c13c3b07f9f7fe6321b5751b6a75017a8497 | athos/pogonos | spec_test.cljc | (ns pogonos.spec-test
(:require clojure.test
pogonos.core
#?(:clj [pogonos.spec-test-macros :refer [import-spec-tests]]))
#?(:cljs (:require-macros [pogonos.spec-test-macros :refer [import-spec-tests]])))
(import-spec-tests)
| null | https://raw.githubusercontent.com/athos/pogonos/42222f73b85814482b1e5bb797ff91ee7ad61c61/test/pogonos/spec_test.cljc | clojure | (ns pogonos.spec-test
(:require clojure.test
pogonos.core
#?(:clj [pogonos.spec-test-macros :refer [import-spec-tests]]))
#?(:cljs (:require-macros [pogonos.spec-test-macros :refer [import-spec-tests]])))
(import-spec-tests)
| |
6668c46f64673f147f39741188f8cb5da4e26c8424798c72c688dfd5badb6c05 | goblint/analyzer | sLRphased.ml | open Prelude
open Analyses
open Constraints
open Messages
open SLR
* the two - phased terminating SLR3 box solver
module Make =
functor (S:EqConstrSys) ->
functor (HM:Hashtbl.S with type key = S.v) ->
struct
include Generic.SolverStats (S) (HM)
module VS = Set.Make (S.Var)
module P =
struct
... | null | https://raw.githubusercontent.com/goblint/analyzer/b9f527f6d3066d548c5551716366fbed8acecf35/src/solvers/sLRphased.ml | ocaml | widening
narrowing
if (b && not (S.Dom.leq old tmp)) then (
assert false
); | open Prelude
open Analyses
open Constraints
open Messages
open SLR
* the two - phased terminating SLR3 box solver
module Make =
functor (S:EqConstrSys) ->
functor (HM:Hashtbl.S with type key = S.v) ->
struct
include Generic.SolverStats (S) (HM)
module VS = Set.Make (S.Var)
module P =
struct
... |
64310181389246f5e83ebe7cfca5cffade12fe40fab9d50e146b1881ef2441ed | ndmitchell/catch | Referee.hs |
module Referee where
main xs ys = case null xs || null ys of
True -> []
False -> [head xs, head ys]
| null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/examples/Example/Referee.hs | haskell |
module Referee where
main xs ys = case null xs || null ys of
True -> []
False -> [head xs, head ys]
| |
7d7982193caf4432126f2720ad2231da23cf5fdb54c1a09559dd926355485d04 | iustin/corydalis | FoundationSpec.hs |
Copyright ( C ) 2013
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed i... | null | https://raw.githubusercontent.com/iustin/corydalis/43f8bf004904847fad43c428a9e1b20e67da964d/test/FoundationSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
Copyright ( C ) 2013
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
This program is distributed i... |
342ef4e1c7513bef072888e866b7e65d81a7c2ba899717da81c64ad4a84c528b | jyh/metaprl | ma_Dconstant_object_directory.mli | extends Nuprl_Dconstant_object_directory
| null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/mesa/ma_Dconstant_object_directory.mli | ocaml | extends Nuprl_Dconstant_object_directory
| |
07dc854c28d2139fdac5992cb27299ce67fde9dc7efc8cdb5ebb26a4985f1490 | danelahman/haskell-coop | FPStateTests.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
|
Module : FPStateTests
Description : Example use cases of the footprint - based runner for state from ` Control . Runner . FPState `
Copyright : ( c ) , 2019
License : MIT
Maintainer :
Stability : experimental
This module provides exam... | null | https://raw.githubusercontent.com/danelahman/haskell-coop/95ddb0f340313a25f2e006c75dab8e2c93add8f8/examples/without_signals/FPStateTests.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
|
Module : FPStateTests
Description : Example use cases of the footprint - based runner for state from ` Control . Runner . FPState `
Copyright : ( c ) , 2019
License : MIT
Maintainer :
Stability : experimental
This module provides example use cases of the fo... |
56e9f5b1c65af2ff86917da1696629a1a506116ad67bc89fb826fc121fdfeae7 | groupoid/alonzo | error.ml | open Expr
exception Parser of int * int * string
exception UnboundVariable of name
exception Type of typexp * typexp
exception Application of exp * typexp * exp * typexp
let print_error : exn -> unit = function
| UnboundVariable var -> Printf.printf "Unbound variable: %s\n" var
| Type (expected, actual) -> Printf... | null | https://raw.githubusercontent.com/groupoid/alonzo/a74e7c4cfdc2bd94402ef9c1c1e8979d91f5ad28/src/error.ml | ocaml | open Expr
exception Parser of int * int * string
exception UnboundVariable of name
exception Type of typexp * typexp
exception Application of exp * typexp * exp * typexp
let print_error : exn -> unit = function
| UnboundVariable var -> Printf.printf "Unbound variable: %s\n" var
| Type (expected, actual) -> Printf... | |
cfb5f03f3140449f62e0e03e3e4767fa60c74a47846029cf9613187da207c078 | racket/web-server | 12658.rkt | #lang racket/base
(require rackunit
"12658-mod.rkt")
(check-exn
(lambda (e)
(and (exn:fail:contract:arity? e)
(regexp-match? #rx"go: arity mismatch;\n the expected number of arguments does not match the given number\n expected: 0\n given: 1"
(exn-message e))))
(lambda () ... | null | https://raw.githubusercontent.com/racket/web-server/39f49dade5edab758ed9c00f35e5093bc5a69da5/web-server-test/tests/web-server/pr/12658.rkt | racket | #lang racket/base
(require rackunit
"12658-mod.rkt")
(check-exn
(lambda (e)
(and (exn:fail:contract:arity? e)
(regexp-match? #rx"go: arity mismatch;\n the expected number of arguments does not match the given number\n expected: 0\n given: 1"
(exn-message e))))
(lambda () ... | |
48c0fe326cf16612933d8fdee79e636a57d3c2db4292e6803d8bd8f5e34e008f | philnguyen/soft-contract | ex-03.rkt | #lang racket
(require soft-contract/fake-contract)
(define (f member v l)
(let ([x (member v l)])
#|HERE|# (cons? x)))
(provide/contract
[f ((any/c (listof any/c) . -> . (or/c false? (cons/c any/c (listof any/c))))
any/c
(listof any/c)
. -> . (not/c false?))])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/unsafe/octy/ex-03.rkt | racket | HERE | #lang racket
(require soft-contract/fake-contract)
(define (f member v l)
(let ([x (member v l)])
(provide/contract
[f ((any/c (listof any/c) . -> . (or/c false? (cons/c any/c (listof any/c))))
any/c
(listof any/c)
. -> . (not/c false?))])
|
0204fee18c527ebbdcc589c0b6031809fc2ae31aa7db607e99d42a82607904fd | bos/rwh | callingpure.hs | {-- snippet all --}
-- ch08/callingpure.hs
name2reply :: String -> String
name2reply name =
"Pleased to meet you, " ++ name ++ ".\n" ++
"Your name contains " ++ charcount ++ " characters."
where charcount = show (length name)
main :: IO ()
main = do
putStrLn "Greetings once again. What is your nam... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch08/callingpure.hs | haskell | - snippet all -
ch08/callingpure.hs
- /snippet all - |
name2reply :: String -> String
name2reply name =
"Pleased to meet you, " ++ name ++ ".\n" ++
"Your name contains " ++ charcount ++ " characters."
where charcount = show (length name)
main :: IO ()
main = do
putStrLn "Greetings once again. What is your name?"
inpStr <- getLine
let out... |
60fe5f0adf4bf71254c937f5715ef7535a33a5e276b183ac9ee330942d749fa2 | scarvalhojr/haskellbook | section9.6.hs |
myWords :: [Char] -> [[Char]]
myWords [] = []
myWords (' ':xs) = myWords xs
myWords xs = takeWhile (/=' ') xs : (myWords (dropWhile (/=' ') xs))
firstSen = "Tyger, Tyger, burning bright\n"
secondSen = "In the forest of the night\n"
thirdSen = "What immortal hand of eye\n"
fourthSen = "Could frame thy fe... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter9/section9.6.hs | haskell |
myWords :: [Char] -> [[Char]]
myWords [] = []
myWords (' ':xs) = myWords xs
myWords xs = takeWhile (/=' ') xs : (myWords (dropWhile (/=' ') xs))
firstSen = "Tyger, Tyger, burning bright\n"
secondSen = "In the forest of the night\n"
thirdSen = "What immortal hand of eye\n"
fourthSen = "Could frame thy fe... | |
307bae080416c2240af91497e47bd3448dfbcd083cd691c9d8670029eba0413a | austral/austral | CliParser.ml |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... | null | https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/CliParser.ml | ocaml | Get the --entrypoint
Get the --entrypoint
An entrypoint was passed in.
No --entrypoint. Did we get the --no-entrypoint flag?
An explicit target type was passed.
Build an executable binary.
The default target is to build an executable binary. This means we need
an entrypoint.
Parse the target type... |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... |
84415c086a378f3ce4974a55605af52ce3a409bd3b64760c1059ac366abac544 | jaspervdj/blaze-html | SnapFramework.hs | | Example with BlazeHtml running behind the Snap Haskell web framework .
For more information on snap , you can refer to .
--
{-# LANGUAGE OverloadedStrings #-}
module SnapFramework where
import Snap.Http.Server
import Snap.Types
import Text.Blaze.Html5
import qualified Text.Blaze.Html5 as H
import Text.Blaze.Re... | null | https://raw.githubusercontent.com/jaspervdj/blaze-html/1c76db3cf02712569fd22b021fb0a367df028eb4/doc/examples/SnapFramework.hs | haskell |
# LANGUAGE OverloadedStrings #
| A welcome page.
| Always return the welcome page.
| Snap main function.
| | Example with BlazeHtml running behind the Snap Haskell web framework .
For more information on snap , you can refer to .
module SnapFramework where
import Snap.Http.Server
import Snap.Types
import Text.Blaze.Html5
import qualified Text.Blaze.Html5 as H
import Text.Blaze.Renderer.Utf8 (renderHtml)
welcomePage ... |
178393a83ef5ca72c8f20af7eb6562be45123e9192221380c420775f10c90669 | iburzynski/EMURGO_71 | Transformers-2.hs | import Data.Char (isUpper, isLower)
import Control.Monad.Trans.Maybe
import Control.Monad.Reader
" Monad transformers are like onions . At first , they make you cry but then you learn to appreciate
-- them. Like onions, they're also made of layers. Each layer is the functionality of a new monad,
-- you lift mona... | null | https://raw.githubusercontent.com/iburzynski/EMURGO_71/c72e8b3259cb33c78867657813d9fcfff12c3e82/Transformers/Transformers-2.hs | haskell | them. Like onions, they're also made of layers. Each layer is the functionality of a new monad,
you lift monadic functions to get into the inner monads and you have transformerised functions
to unwrap each layer."
*** Transformers in Practice: User Login ***
Reference:
Let's say we're creating some login f... | import Data.Char (isUpper, isLower)
import Control.Monad.Trans.Maybe
import Control.Monad.Reader
" Monad transformers are like onions . At first , they make you cry but then you learn to appreciate
main1 :: IO ()
main1 = do
maybeUserName <- readUserName
case maybeUserName of
Nothing -> print "Invalid user ... |
d5dca81dc9e50e3f2ead6bf29228ea29b842c56e12e610549f0ddcd35911a76c | LeventErkok/sbv | Trans.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Trans
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
More generalized alternative to @Data . SBV@ for advanced client use
---------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/ec08aa4274bba469dea67f3c3315d4a7af5144c9/Data/SBV/Trans.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.SBV.Trans
License : BSD3
Maintainer:
Stability : experimental
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -Werror #
* Symbolic types
*** Boolean values and functi... | Copyright : ( c )
More generalized alternative to @Data . SBV@ for advanced client use
module Data.SBV.Trans (
* * Booleans
SBool
, sTrue, sFalse, sNot, (.&&), (.||), (.<+>), (.~&), (.~|), (.=>), (.<=>), fromBool, oneIf
, sAnd, sOr, sAny, sAll
, SWord8, SWord16, SWord32, SWord64... |
be74ac901e413eceb36a7469489ca673b49b12f3e4677d5368308bcb829f78a1 | typedclojure/typedclojure | lex_env.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/2061ee744a021f209ef5ee0a690bb4babddb37c1/typed/clj.checker/src/typed/cljc/checker/lex_env.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns ^:no-doc typed.cljc.checker.lex-env
(:require [clojure.core.typed.contract-utils :as con]
[clojure.core.typed.errors :as err]
[clojure.core.typed.util-vars :as vs]
[typed.clj.checker.path-type :as path-type]
[typed.cljc.c... |
3b3f7324af270791e55f4013d39e41d0e181789dd965da9aa778f76058faeacd | heyarne/airsonic-ui | fixtures.cljs | (ns airsonic-ui.components.library.fixtures)
;; this is straight from the response cache, copied from app db after
browsing through the most recently listened to tracks for the first couple
;; of pages
(def responses
{["getAlbumList2" {:type "recent", :size 100, :offset 0}]
{:album
[{:artistId "478"
... | null | https://raw.githubusercontent.com/heyarne/airsonic-ui/7adb03d6e2ba0ff764796a57b7e87f62b242c9b7/test/cljs/airsonic_ui/components/library/fixtures.cljs | clojure | this is straight from the response cache, copied from app db after
of pages | (ns airsonic-ui.components.library.fixtures)
browsing through the most recently listened to tracks for the first couple
(def responses
{["getAlbumList2" {:type "recent", :size 100, :offset 0}]
{:album
[{:artistId "478"
:name "The OOZ"
:songCount 19
:created "2018-06-02T12:06:11.000Z"
... |
3ecf812fda61c23c0d69993850c07fe858e429b2df3a2af61f7cd66779641c03 | drathier/elm-offline | Canonicalize.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE OverloadedStrings #-}
module Reporting.Error.Canonicalize
( Error(..)
, BadArityContext(..)
, InvalidPayload(..)
, PortProblem(..)
, DuplicatePatternContext(..)
, PossibleNames(..)
, VarKind(..)
, toReport
)
where
import qualified Data.Char as Char
import qualifi... | null | https://raw.githubusercontent.com/drathier/elm-offline/f562198cac29f4cda15b69fde7e66edde89b34fa/compiler/src/Reporting/Error/Canonicalize.hs | haskell | # LANGUAGE OverloadedStrings #
KIND
TO REPORT
NOTE: this should always be detected by `builder`
So this error should never actually get printed out.
BAD TYPE VARIABLES
NOT FOUND
ARG MISMATCH
BAD ALIAS RECURSION | # OPTIONS_GHC -Wall #
module Reporting.Error.Canonicalize
( Error(..)
, BadArityContext(..)
, InvalidPayload(..)
, PortProblem(..)
, DuplicatePatternContext(..)
, PossibleNames(..)
, VarKind(..)
, toReport
)
where
import qualified Data.Char as Char
import qualified Data.Map as Map
import qualified... |
5d393b543ffb19a8364649fa46b497f7a1e3f8f3d3f86cfb8544168797737ee1 | FranklinChen/hugs98-plus-Sep2006 | XmlLex.hs | module XmlLex
( xmlLex -- :: String -> String -> [Token]
, xmlReLex -- :: Posn -> String -> [Token]
, posInNewCxt -- :: String -> Posn
, Posn(..)
, TokenT(..)
, Token
, Special(..)
, Section(..)
) where
-- This is a hand-written lexer for tokenising the text of an XML
-- document s... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/HaXml/bugs/panitz/XmlLex.hs | haskell | :: String -> String -> [Token]
:: Posn -> String -> [Token]
:: String -> Posn
This is a hand-written lexer for tokenising the text of an XML
document so that it is ready for parsing. It attaches position
information in (line,column) format to every token. The main
entry point is xmlLex. A secondary entry po... | module XmlLex
, Posn(..)
, TokenT(..)
, Token
, Special(..)
, Section(..)
) where
import Prelude
import Char
import XmlChar
data Where = InTag | NotInTag
deriving (Eq)
type Token = (Posn, TokenT)
deriving (Eq)
instance Show Posn where
showsPrec p (Pn f l c i) = showString f .
... |
8ca773a5c80a47ac5541e837fd0132a0ccd46b8ae5e3f2981bf83e9a604744b4 | brendanhay/credentials | Format.hs | # LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TupleSections #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - type - defaults #
-- |
Module : Credentials .
Copyright : ( c ) 2... | null | https://raw.githubusercontent.com/brendanhay/credentials/4cba2c238b7d99712ee6745748864134096a106b/credentials-cli/src/Credentials/CLI/Format.hs | haskell | # LANGUAGE OverloadedStrings #
|
Stability : provisional
| # LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - type - defaults #
Module : Credentials .
Copyright : ( c ) 2015 - 2016
License : Mozilla Publi... |
4396e371cf852fb606f00c59b1225d35e8121f4eda7f172b3ef8e46b7d6f3219 | mirage/ocaml-matrix | empty.ml | open Json_encoding
module type JSON = sig
type%accessor t = unit
val encoding : t encoding
val pp : t Fmt.t
end
module type QUERY = sig
type%accessor t = unit
val args : t -> (string * string list) list
end
module Json : JSON = struct
type t = unit [@@deriving accessor]
let encoding = unit
let pp ... | null | https://raw.githubusercontent.com/mirage/ocaml-matrix/2a58d3d41c43404741f2dfdaf1d2d0f3757b2b69/lib/matrix-common/empty.ml | ocaml | open Json_encoding
module type JSON = sig
type%accessor t = unit
val encoding : t encoding
val pp : t Fmt.t
end
module type QUERY = sig
type%accessor t = unit
val args : t -> (string * string list) list
end
module Json : JSON = struct
type t = unit [@@deriving accessor]
let encoding = unit
let pp ... | |
c5401287c5b98d4c2a0ed08f41d636b0bf0cddcac31bf8c4daf8787bf603c8e6 | haskell-mafia/boris | Git.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Boris.Service.Git where
import Boris.Core.Data
import Boris.Service.Git (InitialiseError (..), findRef)
import qualified Data.Text as T
imp... | null | https://raw.githubusercontent.com/haskell-mafia/boris/fb670071600e8b2d8dbb9191fcf6bf8488f83f5a/boris-service/test/Test/Boris/Service/Git.hs | haskell | # LANGUAGE OverloadedStrings #
Single character matches
We've _only_ enabled * and ?
NOTE: This is really a glob, and slashes _do_ mean something
No recursive wildcards | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Boris.Service.Git where
import Boris.Core.Data
import Boris.Service.Git (InitialiseError (..), findRef)
import qualified Data.Text as T
import Disorder.Core (neg)
... |
2cb8aa227e736429229c405230fa98c4f93aebc10894935163a9853f14a2da3d | jrh13/hol-light | bernoulli.ml | (* ========================================================================= *)
numbers and polynomials ; sum of powers .
(* ========================================================================= *)
needs "Library/binomial.ml";;
needs "Library/analysis.ml";;
needs "Library/transc.ml";;
pri... | null | https://raw.githubusercontent.com/jrh13/hol-light/d125b0ae73e546a63ed458a7891f4e14ae0409e2/100/bernoulli.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
A couple of basic lemmas about new-style sums.
---------------... | numbers and polynomials ; sum of powers .
needs "Library/binomial.ml";;
needs "Library/analysis.ml";;
needs "Library/transc.ml";;
prioritize_real();;
let SUM_DIFFS = prove
(`!a m n. m <= n + 1 ==> sum(m..n) (\i. a(i + 1) - a(i)) = a(n + 1) - a(m)`,
GEN_TAC THEN GEN_TAC THEN INDUCT_TAC TH... |
0d0cb4c6776343ebafac91e2bace6ba0ac93c7198b2c287c25d5956d3e384a6d | redis-sd/erlang-ryng | ryng_event.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
%%%-------------------------------------------------------------------
@author < >
@copyright 2014 , Pagoda Box , Inc.
%%% @doc
%%%
%%% @end
Created : 10 Sep 2013 by < >
%%%--------... | null | https://raw.githubusercontent.com/redis-sd/erlang-ryng/6b9f3db2f6380de09b173721108083aade4d53ee/src/ryng_event.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API functions
====================================================... | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
@author < >
@copyright 2014 , Pagoda Box , Inc.
Created : 10 Sep 2013 by < >
-module(ryng_event).
-include("ryng.hrl").
-define(MANAGER, ryng_manager).
-export([manager/0, add_handler/2]).
-export([node_add/2, n... |
517fcd3bc188ec516a6e832a96e823102b56648d63c800529e5acadc82b883ed | hanshuebner/bknr-web | web-utils.lisp | (in-package :bknr.web)
(enable-interpol-syntax)
(defstruct upload name pathname original-filename content-type)
(defgeneric object-url (obj))
(defgeneric edit-object-url (obj))
(defgeneric html-link (obj))
(defgeneric html-edit-link (obj))
(defparameter *upload-file-size-limit* 5000000)
(defun error-404 ()
(with... | null | https://raw.githubusercontent.com/hanshuebner/bknr-web/5c30b61818a2f02f6f2e5dc69fd77396ec3afc51/src/web/web-utils.lisp | lisp | :foo
(:foo ...) or ((:foo ...) ...)
((:foo ...) ...)
(:foo ...)
"foo"
emit < and tag name
emit possible attributes
emit tag body
empty body, close tag immediately | (in-package :bknr.web)
(enable-interpol-syntax)
(defstruct upload name pathname original-filename content-type)
(defgeneric object-url (obj))
(defgeneric edit-object-url (obj))
(defgeneric html-link (obj))
(defgeneric html-edit-link (obj))
(defparameter *upload-file-size-limit* 5000000)
(defun error-404 ()
(with... |
102fa15ac6110a1e0e6110357d3b4ee089a85ed8de88497c833c30baae419d2a | launchdarkly/haskell-server-sdk | Eventing.hs | module LaunchDarkly.Server.Network.Eventing (eventThread) where
import Control.Concurrent (killThread, myThreadId)
import Control.Concurrent.MVar (modifyMVar_, readMVar, swapMVar, takeMVar)
import Control.Monad (forever, unless, void, when)
import Control.Monad.Catch (MonadMask, MonadThrow)
import Control.Monad.IO.Cla... | null | https://raw.githubusercontent.com/launchdarkly/haskell-server-sdk/b8642084591733e620dfc5c1598409be7cc40a63/src/LaunchDarkly/Server/Network/Eventing.hs | haskell | A true result indicates a retry does not need to be attempted | module LaunchDarkly.Server.Network.Eventing (eventThread) where
import Control.Concurrent (killThread, myThreadId)
import Control.Concurrent.MVar (modifyMVar_, readMVar, swapMVar, takeMVar)
import Control.Monad (forever, unless, void, when)
import Control.Monad.Catch (MonadMask, MonadThrow)
import Control.Monad.IO.Cla... |
195dd2775d3382faa1b65df2cbedd62424a91b1589e2fe9320276287c0e3b113 | brandonchinn178/advent-of-code | Day8.hs | {- stack script
--resolver lts-12.12
-}
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
data Node = Node
{ children :: [Node]
, metadata :: [Int]
} deriving (Show)
main :: IO ()
main = do
input <- parse . head . lines <$> readFile "Day8.txt"
let example = fromData [2,3,0,3,10,11,12,1,1,0,1,99... | null | https://raw.githubusercontent.com/brandonchinn178/advent-of-code/a4b0616f8764620e28759276c333fe37d6685d57/2018/Day8.hs | haskell | stack script
--resolver lts-12.12
print example
print $ part1 example
print $ part2 example | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
data Node = Node
{ children :: [Node]
, metadata :: [Int]
} deriving (Show)
main :: IO ()
main = do
input <- parse . head . lines <$> readFile "Day8.txt"
let example = fromData [2,3,0,3,10,11,12,1,1,0,1,99,2,1,1,2]
print $ part1 input
print $ pa... |
0656aef83780b7001536d5388513961293410ddc6637c94a9d897dc1e2e3ac7d | fyquah/hardcaml_zprize | config_presets.mli | open Field_ops_lib
module For_bls12_377 : sig
val karatsuba_ofman_mult_config : Karatsuba_ofman_mult.Config.t
val multiply : Ec_fpn_ops_config.fn
val montgomery_reduce : Ec_fpn_ops_config.fn
val barrett_reduce : Ec_fpn_ops_config.fn
val barrett_reduce_coarse : Ec_fpn_ops_config.fn
val montgomery_reduction_... | null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/7eb1bd214908fa801781db33287eaf12691715f8/libs/elliptic_curve/lib/config_presets.mli | ocaml | open Field_ops_lib
module For_bls12_377 : sig
val karatsuba_ofman_mult_config : Karatsuba_ofman_mult.Config.t
val multiply : Ec_fpn_ops_config.fn
val montgomery_reduce : Ec_fpn_ops_config.fn
val barrett_reduce : Ec_fpn_ops_config.fn
val barrett_reduce_coarse : Ec_fpn_ops_config.fn
val montgomery_reduction_... | |
012e971cae730082d387b1f63daf3cd61481c16d70753810f9e3da44d6eb7bf5 | mankiw/xiaoxiao_s | dota_sup.erl | -module(dota_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
ws_handler:init_ets(),
Procs = [
{
tick_server,
{tick_server, start_link, []},
... | null | https://raw.githubusercontent.com/mankiw/xiaoxiao_s/7cc206240f236c6c71398ed60f5445a7d264c7f1/src/dota_sup.erl | erlang | -module(dota_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
ws_handler:init_ets(),
Procs = [
{
tick_server,
{tick_server, start_link, []},
... | |
c1420e19fa1d2b300e14074014871f6b87350c0cda17731c269da1150ca0dc64 | UCSD-PL/refscript | Transformations.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE TupleSections #
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE ViewPatterns ... | null | https://raw.githubusercontent.com/UCSD-PL/refscript/884306fef72248ac41ecdbb928bbd7b06ca71bd4/src/Language/Rsc/Transformations.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE ViewPatterns #
------------------------------------------------------------------------------
| Transformable
------------------------------------------------------------------------------
PV: a little indirect
Bi... | # LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE TupleSections #
module Language.Rsc.Transformations (
Transformable (..), NameTransformable (..), AnnotTransformable (..)
, transF... |
4bd7fdf0941fed4f08484003afb339878e1482f76a752cf1eb09b5bd733cdd0f | timbertson/nix-wrangle | Cmd.hs | # LANGUAGE CPP #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module Wrangle.Cmd where
import... | null | https://raw.githubusercontent.com/timbertson/nix-wrangle/3c1c3b7785e95a39fbd9c986e113c82c02043c2d/src/Wrangle/Cmd.hs | haskell | # LANGUAGE OverloadedStrings #
this error message is a little presumptuous...
drop nix attribute it if it's explicitly `"false"`
add default nix attribute, unless it's the `self` package
Shortcuts for known attributes
-----------------------------------------------------------------------------
Show
--------------... | # LANGUAGE CPP #
# LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuasiQuotes #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module Wrangle.Cmd where
import Prelude hiding (error)
import Cont... |
21b107ba9ed5da9fc83d4e33f4e4a1e56850ff03c7a6fb5e570e1075f75010fd | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentMethodDetailsAchCreditTransfer.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
| Contains the types generated from the schema PaymentMethodDetailsAchCreditTransfer
module StripeAPI.Types.PaymentMethodDe... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentMethodDetailsAchCreditTransfer.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Defines the object schema located at @components.schemas.payment_method_details_ach_credit_transfer@ in the specification.
| account_number: Account number to transfer funds to.
Constraints:
| bank_name: Name of the bank associated with the routing number.
... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
| Contains the types generated from the schema PaymentMethodDetailsAchCreditTransfer
module StripeAPI.Types.PaymentMethodDetailsAchCreditTransfer where
import qualified Control.Monad.Fa... |
4f696501198f0b7124dcb118ef2f523de8207c6c2fd722f678023a60799fa20d | melange-re/melange | pparse_driver.mli | val parse_implementation : string -> Parsetree.structure
val parse_interface : string -> Parsetree.signature
| null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/core/pparse_driver.mli | ocaml | val parse_implementation : string -> Parsetree.structure
val parse_interface : string -> Parsetree.signature
| |
0ab462239b78d83a0f0526bcfde0ba4406dd229877bee3f0b1f7b139d829c046 | conreality/conreality | irc.mli | (* This is free and unencumbered software released into the public domain. *)
module Message : sig
include module type of struct include Irc_message end
end
module Client : sig
include module type of struct include Irc_client_lwt end
end
module Connection : sig
type t = Client.connection_t
end
module Callback... | null | https://raw.githubusercontent.com/conreality/conreality/e03328ef1f0056b58e4ffe181a279a1dc776e094/src/consensus/messaging/irc.mli | ocaml | This is free and unencumbered software released into the public domain. |
module Message : sig
include module type of struct include Irc_message end
end
module Client : sig
include module type of struct include Irc_client_lwt end
end
module Connection : sig
type t = Client.connection_t
end
module Callback : sig
type t = Connection.t -> Message.parse_result -> unit Lwt.t
end
|
088008c1e1b16bb58e9566b8fbebfc2e99e3ca7474636febb7ce1e995d5d2a26 | g-andrade/quack | quic_instream.erl | -module(quic_instream).
-behaviour(gen_server).
-include("quic_data_kv.hrl").
-include("quic_frame.hrl").
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
-export([start_link/3]). -ignore_xref({start_li... | null | https://raw.githubusercontent.com/g-andrade/quack/b6decb23674dd97f6918d8ac637ede2ef7bcc507/src/quic_instream.erl | erlang | ------------------------------------------------------------------
API Function Exports
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
-------------------------... | -module(quic_instream).
-behaviour(gen_server).
-include("quic_data_kv.hrl").
-include("quic_frame.hrl").
-export([start_link/3]). -ignore_xref({start_link, 3}).
-export([dispatch_frame/2]).
gen_server Function Exports
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
... |
982d148a909fd52d5020e0603aaa59d2aaceff383c9b67c9619f552c52c924db | aws-beam/aws-erlang | aws_savingsplans.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
%% @doc Savings Plans are a pricing model that offer significant savings on
AWS usage ( for example , on Amazon EC2 instances ) .
%%
You commit to a consistent amount of usage , in USD per hour , for a term of
1 or 3 years ,... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_savingsplans.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
@doc Savings Plans are a pricing model that offer significant savings on
information, see the AWS Savings Plans User Guide.
====================================================================
API
====================================================================
@doc ... | See -beam/aws-codegen for more details .
AWS usage ( for example , on Amazon EC2 instances ) .
You commit to a consistent amount of usage , in USD per hour , for a term of
1 or 3 years , and receive a lower price for that usage . For more
-module(aws_savingsplans).
-export([create_savings_plan/2,
cre... |
9757350d183fd574db9119a299f044404c0b978f05f5c9f80b431f68e7e0dbd5 | takikawa/drracket-vim-tool | commands.rkt | #lang racket/base
Parse and output representation of vim commands
(require racket/class
racket/function
racket/gui/base
racket/match)
(provide parse-command
(struct-out motion-command)
(struct-out mark-command)
(struct-out repeat-command)
(struct-out r... | null | https://raw.githubusercontent.com/takikawa/drracket-vim-tool/c347e8f8dcb0d89efd44755587b108e1f420912a/private/commands.rkt | racket | - Symbol
A Repeat is an integer
(or/c 'change
'delete
'yank
'swap-case
'lowercase
'uppercase
'format
'rot13
'shift-right
'shift-left
'filter)
TODO: Operator leaves out
folding, and function calls from vim
- 'a-... | #lang racket/base
Parse and output representation of vim commands
(require racket/class
racket/function
racket/gui/base
racket/match)
(provide parse-command
(struct-out motion-command)
(struct-out mark-command)
(struct-out repeat-command)
(struct-out r... |
958156e8a39aa6970ec2d0b80bddc74ad4b18919e377075bccc0e62c583b37bb | abdulapopoola/SICPBook | eceval-machine.scm | (define eceval-operations
(list
; install inbuilt scheme operators
(list 'read read)
; install operators from scheme-operators.scm
(list 'self-evaluating? self-evaluating?)
(list 'variable? variable?)
(list 'quoted? quoted?)
(list 'text-of-quotation te... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%205/5.4/eceval-machine.scm | scheme | install inbuilt scheme operators
install operators from scheme-operators.scm
install operators from machine-operations.scm
Add stack tracing
clean up stack (from apply-dispatch):
the operands
the operator
save expression for later
evaluate the predicate:
save variable for later
evaluate the assignment value:... | (define eceval-operations
(list
(list 'read read)
(list 'self-evaluating? self-evaluating?)
(list 'variable? variable?)
(list 'quoted? quoted?)
(list 'text-of-quotation text-of-quotation)
(list 'assignment? assignment?)
(list 'assignment-variable assig... |
f070c740b0729c0e9ceab422cd8e299be404752c199c496bd33c48d7c1aa941a | ghcjs/ghcjs-dom | SVGPathSegLinetoAbs.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.SVGPathSegLinetoAbs
(js_setX, setX, js_getX, getX, js_setY, setY, js_getY, getY,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGPathSegLinetoAbs.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/SVGPathSegLinetoAbs.y Mozilla SVGPathSegLinetoAbs.y documentation>
| <-US/docs/Web/API/SVGPathSegLinetoAbs.y Mozilla SVGPathSegLinetoAbs.y documentation> | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.SVGPathSegLinetoAbs
(js_setX, setX, js_getX, getX, js_setY, setY, js_getY, getY,
SVGPathSegLinetoAbs(..), gTypeSVGPathSegLinetoAbs)
where
import Prelude ((.), (==), (>>=),... |
90e69613fa9801bbcb79ad28c43dedbb117829ab0ebf0a276174671e5cc85b50 | roman01la/cljs-rum-realworld-example-app | mixins.cljs | (ns conduit.mixins
(:require [rum.core :as rum]
[citrus.core :as citrus]))
(defn dispatch-on-mount [events-fn]
{:did-mount
(fn [{[r] :rum/args :as state}]
(doseq [[ctrl event-vector] (apply events-fn (:rum/args state))]
(apply citrus/dispatch! (into [r ctrl] event-vector)))
state)
... | null | https://raw.githubusercontent.com/roman01la/cljs-rum-realworld-example-app/962695bd391806a7066340461c3e02f2215fdc48/src/conduit/mixins.cljs | clojure | (ns conduit.mixins
(:require [rum.core :as rum]
[citrus.core :as citrus]))
(defn dispatch-on-mount [events-fn]
{:did-mount
(fn [{[r] :rum/args :as state}]
(doseq [[ctrl event-vector] (apply events-fn (:rum/args state))]
(apply citrus/dispatch! (into [r ctrl] event-vector)))
state)
... | |
c01e20f5c2f206f7cc67dadb5b761da939128646dd3649fb9126fbefa5480f25 | weavejester/lein-generate | namespace.clj | (ns leiningen.generate.namespace
(:refer-clojure :exclude [namespace])
(:require [leiningen.generate.templates :as tmpl]
[leiningen.new.templates :refer [name-to-path]]
[leiningen.core.main :as main]))
(defn namespace
"Generate a new namespace and test file."
[project name]
(let [data... | null | https://raw.githubusercontent.com/weavejester/lein-generate/481a116e5fd652c3d8bcf6b725da97c0129368c8/generators/src/leiningen/generate/namespace.clj | clojure | (ns leiningen.generate.namespace
(:refer-clojure :exclude [namespace])
(:require [leiningen.generate.templates :as tmpl]
[leiningen.new.templates :refer [name-to-path]]
[leiningen.core.main :as main]))
(defn namespace
"Generate a new namespace and test file."
[project name]
(let [data... | |
b3b7161731cc8b92d02a3d2ba38c8ff2f29b5ac55903e29d34435a9368ea020a | mario-goulart/salmonella | srfi-13.scm | (import (chicken string))
(define (string-prefix? prefix str)
(let ((index (substring-index prefix str)))
(and index (zero? index))))
(define (string-pad-right s n char)
(let ((len (string-length s)))
(if (<= n len)
(substring s (- len n) len)
(let ((pad (make-string (- n len) char)))
... | null | https://raw.githubusercontent.com/mario-goulart/salmonella/3b207e3b33490e5a5f81ccaa3c2c7f7ffcbe8125/libs/srfi-13.scm | scheme | (import (chicken string))
(define (string-prefix? prefix str)
(let ((index (substring-index prefix str)))
(and index (zero? index))))
(define (string-pad-right s n char)
(let ((len (string-length s)))
(if (<= n len)
(substring s (- len n) len)
(let ((pad (make-string (- n len) char)))
... | |
1244159c9a6eea2083290a4d932fff13f889b634ab5f11eff127b0e36d375529 | sellout/Kilns | network.lisp | (in-package :kilns)
;; Came up with the default port number by mapping the letters i–s to 0–10, then
;; spelling “kilns” with those numbers:
;; (k -> 2), (i -> 0), (l -> 3), (n -> 5), (s -> 10)
(defvar *base-port* 20360)
Protocol format – use kilns reader
;;; {keep-alive}
{ handshake ( par { path { from { top ... | null | https://raw.githubusercontent.com/sellout/Kilns/467ba599f457812daea41a7c56f74a1ec1cdc9b2/src/network.lisp | lisp | Came up with the default port number by mapping the letters i–s to 0–10, then
spelling “kilns” with those numbers:
(k -> 2), (i -> 0), (l -> 3), (n -> 5), (s -> 10)
{keep-alive}
FIXME: we should try another port
This file implements the behavior of distributed kells. They need to be
modeled on each instance, and... | (in-package :kilns)
(defvar *base-port* 20360)
Protocol format – use kilns reader
{ handshake ( par { path { from { top } } }
{ version " 0.0.1 " } ) }
(defun handle-request (client)
(unwind-protect
(multiple-value-bind (who remote-port) (sockets:remote-name client)
(handle... |
10c05b558acc5656a5db600708183bae8d0058c2a7f575b160d874b99d78c11b | datastax/cass-config-builder | data_test.clj | ;; Copyright DataStax, Inc.
;; Please see the included license file for details.
(ns lcm.utils.data-test
(:refer-clojure :exclude [uuid?])
(:require [lcm.utils.data :refer :all]
[slingshot.test :refer :all]
[clojure.test :refer :all]))
(deftest test-truncate-string
(is (= "hell..." (trun... | null | https://raw.githubusercontent.com/datastax/cass-config-builder/88623cca0c09b510a6e363c4c7579ffa7d773344/test/lcm/utils/data_test.clj | clojure | Copyright DataStax, Inc.
Please see the included license file for details. |
(ns lcm.utils.data-test
(:refer-clojure :exclude [uuid?])
(:require [lcm.utils.data :refer :all]
[slingshot.test :refer :all]
[clojure.test :refer :all]))
(deftest test-truncate-string
(is (= "hell..." (truncate-string "hello" 4)))
(is (= "hello" (truncate-string "hello" 9)))
(is (= ... |
be4d45412bf4c1c34f43dc521f3bf9f63160c8c36fe8d7f5a6a7d8f3fa86e4db | haskell/stm | TArray.hs | # LANGUAGE CPP , DeriveDataTypeable , FlexibleInstances , MultiParamTypeClasses #
#if __GLASGOW_HASKELL__ >= 701
# LANGUAGE Trustworthy #
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Control.Concurrent.STM.TArray
Copyright : ( c ) The University of... | null | https://raw.githubusercontent.com/haskell/stm/319e380ab2ddfb99ab499b6783e22f2b4faaee38/Control/Concurrent/STM/TArray.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Concurrent.STM.TArray
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
---------------------------------------------------------------------------
inte... | # LANGUAGE CPP , DeriveDataTypeable , FlexibleInstances , MultiParamTypeClasses #
#if __GLASGOW_HASKELL__ >= 701
# LANGUAGE Trustworthy #
#endif
Copyright : ( c ) The University of Glasgow 2005
Portability : non - portable ( requires STM )
TArrays : transactional arrays , for use in the STM monad
module... |
a29cbc30ed952ee77149a5724a8ee5c594b522cfbc9e67be356b801753308c8d | peterschwarz/clj-gpio | build.clj | (require 'cljs.build.api)
(cljs.build.api/build
(cljs.build.api/inputs "src/main/clojure" "src/dev/clojure")
{:main 'gpio.dev
:output-to "target/out/dev.js"
:output-dir "target/out"
:target :nodejs })
| null | https://raw.githubusercontent.com/peterschwarz/clj-gpio/88fedec2605f6ff6713bfca382a9451538e99fe2/scripts/build.clj | clojure | (require 'cljs.build.api)
(cljs.build.api/build
(cljs.build.api/inputs "src/main/clojure" "src/dev/clojure")
{:main 'gpio.dev
:output-to "target/out/dev.js"
:output-dir "target/out"
:target :nodejs })
| |
6c35d2f7d7eaa682a21439e6bed0cae2eebe1b392b132fdf6f8cb2d08b4a84c7 | pouyakary/Nota | FunctionCall.hs |
module Language.BackEnd.Evaluator.Nodes.FunctionCall ( evalFunctionCall ) where
-- ─── IMPORTS ────────────────────────────────────────────────────────────────────
import Data.Map ( Map )
import qualified Data.Map as Map
import Data.Time
import Language.BackEnd.Evaluator.Types
import ... | null | https://raw.githubusercontent.com/pouyakary/Nota/d5e29eca7ea34d72835a9708977fa33c030393d1/source/Language/BackEnd/Evaluator/Nodes/FunctionCall.hs | haskell | ─── IMPORTS ────────────────────────────────────────────────────────────────────
─── EVAL FUNCTION CALL ─────────────────────────────────────────────────────────
─── SIGN ───────────────────────────────────────────────────────────────────────
─── ROOT ────────────────────────────────────────────────────────────────... |
module Language.BackEnd.Evaluator.Nodes.FunctionCall ( evalFunctionCall ) where
import Data.Map ( Map )
import qualified Data.Map as Map
import Data.Time
import Language.BackEnd.Evaluator.Types
import Language.FrontEnd.AST
import Model
import System.IO.Unsa... |
172d3e0a960524fb366203c0c31c23af8c4446e98bf4a72e8ef589a4a3dfdd77 | AlexKnauth/unnwraith | snowman.rkt | #lang unnwraith racket
// Example based on "Programmable Publishing: Digital Humanities for Everyone!"
// -humanities/
//
// tutorial on "Building a snowman with Racket"
// -humanities/Snowman.html
//
require pict
define left-arm:
colorize:
text "Y" #'(bold) 30:
pi * .5
"brown"
define r... | null | https://raw.githubusercontent.com/AlexKnauth/unnwraith/779051a56324a71b5ccf90d583855a47228b84cb/unnwraith/test/snowman.rkt | racket | #lang unnwraith racket
// Example based on "Programmable Publishing: Digital Humanities for Everyone!"
// -humanities/
//
// tutorial on "Building a snowman with Racket"
// -humanities/Snowman.html
//
require pict
define left-arm:
colorize:
text "Y" #'(bold) 30:
pi * .5
"brown"
define r... | |
1f0c197b2609e37606c73d2bd7835e7ebdfe0e80f84ce10caf54212bea43a995 | skanev/playground | 49.scm | SICP exercise 3.49
;
; Give a scenario where the deadlock-avoidance mechanism described above does
; not work. (Hint: In the exchange problem, each process knows in advance
; which accounts it will neet to get access to. Consider a situation where a
; process must get access to some shared resource before it can know... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/03/49.scm | scheme |
Give a scenario where the deadlock-avoidance mechanism described above does
not work. (Hint: In the exchange problem, each process knows in advance
which accounts it will neet to get access to. Consider a situation where a
process must get access to some shared resource before it can know which
additional shared ... | SICP exercise 3.49
two locks . We need to acquire the first lock in order to determine what
second lock we need to acquire later . Let 's say we need to acquire a in
order to determine that we need to acquire b second . If the reverse case is
second ) , there is a possibility of a deadlock .
We can solve t... |
36e2559218c008ca5e63c60631d8aac61b97fa117e392dbf8e3846cbaf607f10 | glebec/haskell-programming-allen-moronuki | Benching.hs | module Benching where
import Criterion.Main
-- -- Report-adapted version (slow)
infixl 9 ! ?
( ! ? ) : : ( t , t ) = > [ a ] - > t - > Maybe a
-- _ !? n | n < 0 = Nothing
-- [] !? _ = Nothing
-- (x:_) !? 0 = Just x
-- (_:xs) !? n = xs !? (n - 1)
-- optimized version
infixl 9 !... | null | https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/28-basic-libraries/exercises/src/Benching.hs | haskell | -- Report-adapted version (slow)
_ !? n | n < 0 = Nothing
[] !? _ = Nothing
(x:_) !? 0 = Just x
(_:xs) !? n = xs !? (n - 1)
optimized version
fast
slow | module Benching where
import Criterion.Main
infixl 9 ! ?
( ! ? ) : : ( t , t ) = > [ a ] - > t - > Maybe a
infixl 9 !?
# INLINABLE ( ! ? ) #
xs !? n
| n < 0 = Nothing
| otherwise =
foldr
(\x r k ->
case k of
0 -> Just x
_ -> r ... |
2d8ceab98f21078242a748954654105ddfe49fea23ec5ab5d2d5e2897399d572 | migae/datastore | ekey.clj | (in-ns 'migae.datastore)
;; FIXME: rename: co-ctors-key?
( load " emap " )
(declare keychain? keychain= dogtag)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmulti kind class)
(defmethod kind Key
[^Key k]
(keyword (.getKind k)))
(defmethod kind Entity
[^Entity e]
(keyword (.getKind e... | null | https://raw.githubusercontent.com/migae/datastore/61b2fc243cfd95956d531a57c86ea58eb19af7b7/obsolete/ekey.clj | clojure | FIXME: rename: co-ctors-key?
(defmethod kind migae.datastore.IPersistentEntityMap
[^migae.datastore.PersistentEntityMap e]
(keyword (.getKind (.content e))))
(log/trace "PersistentEntityMap.kind")
(clojure.core/name kw)))
(log/trace "Key identifier" k)
(log/trace "PersistentEntityMap.identifier")
(log/tr... | (in-ns 'migae.datastore)
( load " emap " )
(declare keychain? keychain= dogtag)
(defmulti kind class)
(defmethod kind Key
[^Key k]
(keyword (.getKind k)))
(defmethod kind Entity
[^Entity e]
(keyword (.getKind e)))
( log / trace " IPersistentEntityMap.kind " )
(defmethod kind migae.datastore.PersistentEn... |
c6fffc5c185a7fc496bc82d3c4a7fdb47c0eaa25c4743bf813f3010f3674de7c | anton-k/processing-for-haskell | Output.hs | module Graphics.Proc.Lib.Output(
module Graphics.Proc.Lib.Output.TextArea
) where
import Graphics.Proc.Lib.Output.TextArea
| null | https://raw.githubusercontent.com/anton-k/processing-for-haskell/7f99414f3c266135b6a2848978fcb572fd7b67b1/src/Graphics/Proc/Lib/Output.hs | haskell | module Graphics.Proc.Lib.Output(
module Graphics.Proc.Lib.Output.TextArea
) where
import Graphics.Proc.Lib.Output.TextArea
| |
3c048357fa05481d48f945c6ca5d50caefa0db6b2834bc6f92dfde7dbff95cc1 | KavrakiLab/tmkit | itmp-linear-test.lisp | (in-package :tmsmt)
(defparameter *base*
(robray::format-pathname "~A/../pddl/itmp/"
(asdf:system-source-directory :tmsmt)))
(defparameter *operators*
(load-operators (robray::format-pathname "~A/itmp-blocks-linear.pddl" *base*)))
(defparameter *facts*
(load-facts (robray::format-pa... | null | https://raw.githubusercontent.com/KavrakiLab/tmkit/4fb6fc0fa02c5b242dfcbe0013d3c1178e9d9224/demo/old/test/itmp-linear-test.lisp | lisp | (defparameter *ground* (ground-domain *operators* *facts*)) | (in-package :tmsmt)
(defparameter *base*
(robray::format-pathname "~A/../pddl/itmp/"
(asdf:system-source-directory :tmsmt)))
(defparameter *operators*
(load-operators (robray::format-pathname "~A/itmp-blocks-linear.pddl" *base*)))
(defparameter *facts*
(load-facts (robray::format-pa... |
5b4f288ee129b691b60180f0dbfbfcb5196410566a3d6630dbb19d9efa764b9f | Flexiana/notion-to-md | http_client.clj | (ns notion-to-md.http-client
(:require
[clj-http.client :as client]
[clojure.data.json :as json]))
(defn body->clj [response]
(->> response
:body
json/read-json))
(defn fetch-image [url]
(:body (client/get url {:as :stream
:async? false})))
(defn- fetch-children-... | null | https://raw.githubusercontent.com/Flexiana/notion-to-md/7dea73f01f093e295c824f9111490998a657e0fd/src/notion_to_md/http_client.clj | clojure | (ns notion-to-md.http-client
(:require
[clj-http.client :as client]
[clojure.data.json :as json]))
(defn body->clj [response]
(->> response
:body
json/read-json))
(defn fetch-image [url]
(:body (client/get url {:as :stream
:async? false})))
(defn- fetch-children-... | |
fbafbdbba72512648ffcd88f3f06d6070adcc7abe87a137c70c7366c6f22af61 | peterholko/pax_server | character.erl | Author :
Created : Dec 26 , 2008
%% Description: TODO: Add description to character
-module(character).
-export([]).
| null | https://raw.githubusercontent.com/peterholko/pax_server/62b2ec1fae195ff915d19af06e56a7c4567fd4b8/src/character.erl | erlang | Description: TODO: Add description to character | Author :
Created : Dec 26 , 2008
-module(character).
-export([]).
|
03ebcbe33702b2244326c9bd9ec4d532e53bb8135ad908b56bafbae543aa4bee | mpickering/apply-refact | Duplicate5.hs | main = do a; a; a; b; a; a | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Duplicate5.hs | haskell | main = do a; a; a; b; a; a | |
913ad3bf79ea09cd921687249209c5393ffdbe4794fae2ee62cb7b85f3568890 | ocaml-multicore/parafuzz | uchar_esc.ml | (* TEST
* toplevel
*)
(* Correct escapes and their encoding *)
let () =
assert ("\xF0\x9F\x90\xAB" = "\u{1F42B}");
assert ("\xF0\x9F\x90\xAB" = "\u{01F42B}");
assert ("\x00" = "\u{0}");
assert ("\x00" = "\u{00}");
assert ("\x00" = "\u{000}");
assert ("\x00" = "\u{0000}");
assert ("\x00" = "\u{00000}"... | null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/lexing/uchar_esc.ml | ocaml | TEST
* toplevel
Correct escapes and their encoding
Errors |
let () =
assert ("\xF0\x9F\x90\xAB" = "\u{1F42B}");
assert ("\xF0\x9F\x90\xAB" = "\u{01F42B}");
assert ("\x00" = "\u{0}");
assert ("\x00" = "\u{00}");
assert ("\x00" = "\u{000}");
assert ("\x00" = "\u{0000}");
assert ("\x00" = "\u{00000}");
assert ("\x00" = "\u{000000}");
assert ("\xC3\xA9" = "\u{E9... |
1205c4859313c6cca0ad45ca0b133578f65a7f47437847593b89a82c0202400d | RefactoringTools/HaRe | GA3.hs | module GA3 where
zipperM :: [a] -> IO [(a, Integer)]
zipperM lst = do
lst2 <- getOtherList
return $ zip lst lst2
getOtherList = return [1..]
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/GenApplicative/GA3.hs | haskell | module GA3 where
zipperM :: [a] -> IO [(a, Integer)]
zipperM lst = do
lst2 <- getOtherList
return $ zip lst lst2
getOtherList = return [1..]
| |
4f17fb3b6e0bb41d5a75e802a564b001789e182dd23960299e30149cd8ebef8a | ghc/ghc | Compile.hs | {-# LANGUAGE GADTs #-}
module Rules.Compile (compilePackage) where
import Hadrian.BuildPath
import Hadrian.Oracles.TextFile
import Base
import Context as C
import Expression
import Oracles.Flag (platformSupportsSharedLibs)
import Rules.Generate
import Settings
import Target
import Utilities
import qualified Text.Pa... | null | https://raw.githubusercontent.com/ghc/ghc/97ac8230b0a645aae27b7ee42aa55b0c84735684/hadrian/src/Rules/Compile.hs | haskell | # LANGUAGE GADTs #
We match all file paths that look like:
<root>/...stuffs.../build/...stuffs.../<something>.<suffix>
where:
- the '...stuffs...' bits can be one or more path components,
- the '<suffix>' part is a way prefix (e.g thr_p_, or nothing if
vanilla) followed by an object file extension, wit... |
module Rules.Compile (compilePackage) where
import Hadrian.BuildPath
import Hadrian.Oracles.TextFile
import Base
import Context as C
import Expression
import Oracles.Flag (platformSupportsSharedLibs)
import Rules.Generate
import Settings
import Target
import Utilities
import qualified Text.Parsec as Parsec
* Rul... |
ff6866f956cf90b38be82186dde74df25f2adad244af68903c97d6e412c5a3bf | alexwl/haskell-code-explorer | PackageInfo.hs | # LANGUAGE CPP #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2Types #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DuplicateRecordFields #
# OPTIONS_GHC -fno - warn - orphans #
module HaskellCodeExplorer.PackageInfo
( cre... | null | https://raw.githubusercontent.com/alexwl/haskell-code-explorer/2f1c2a4c87ebd55b8a335bc4670eec875af8b4c4/src/HaskellCodeExplorer/PackageInfo.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE Rank2Types #
^ Relative path to a dist directory
^ Before or after preprocessor
^ Directories to ignore
Tuple up the complete file path with the file contents, by building up the path,
dist-dir\" to get dist directory."
dist-dir\" : " ++ show exception
^ Before or after pr... | # LANGUAGE CPP #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DuplicateRecordFields #
# OPTIONS_GHC -fno - warn - orphans #
module HaskellCodeExplorer.PackageInfo
( createPackageInfo
, ghcVersion
) where
import Control.DeepSeq... |
3ca54a5e7ea1d3769ab38cbac3381f8e6c678a30753bad10ec7b9c742720a685 | froggey/Mezzano | theme.lisp | ;;;; Theme variables
(in-package :mezzano.gui.theme)
(defvar *foreground* (gui:make-colour-from-octets #xDC #xDC #xCC))
(defvar *background* (gui:make-colour-from-octets #x3E #x3E #x3E #xD8))
(defvar *active-frame* (gui:make-colour-from-octets #x80 #x80 #x80))
(defvar *active-frame-top* (gui:make-colour-from-octets #... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/gui/theme.lisp | lisp | Theme variables |
(in-package :mezzano.gui.theme)
(defvar *foreground* (gui:make-colour-from-octets #xDC #xDC #xCC))
(defvar *background* (gui:make-colour-from-octets #x3E #x3E #x3E #xD8))
(defvar *active-frame* (gui:make-colour-from-octets #x80 #x80 #x80))
(defvar *active-frame-top* (gui:make-colour-from-octets #xFF #xFF #xFF))
(defv... |
a6fc409110dd4ed600a27eae7496d2982040bd55a68ce5bac33c03374b618d15 | mgree/smoosh | test_evaluation.ml | open Test_prelude
open Smoosh
open Os_symbolic
open Path
open Printf
(***********************************************************************)
EXIT CODE TESTS * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
(*****************************************************... | null | https://raw.githubusercontent.com/mgree/smoosh/84b1ff86f59573a2e4fd7e23edfa0cf9fdb45db9/src/test_evaluation.ml | ocaml | *********************************************************************
*********************************************************************
basic logic
expansion
exit
break
for loop with no args should exit 0
case cascades
pipes
unset
readonly
export
eval
function calls
$#
set
test
regres... | open Test_prelude
open Smoosh
open Os_symbolic
open Path
open Printf
EXIT CODE TESTS * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
let run_cmd_for_exit_code (cmd : string) (os0 : symbolic os_state) : int =
let c = Shim.parse_string cmd in
let os1 = Se... |
fedf404927ddc3ced8a557e6cfc1bcfb3addbd287137285a4d7b0862c4efdbab | calyau/maxima | fsub.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.221 2010/05/26 19:25:52 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/... | null | https://raw.githubusercontent.com/calyau/maxima/9352a3f5c22b9b5d0b367fddeb0185c53d7f4d02/share/colnew/ex1/fsub.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.221 2010/05/26 19:25:52 "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.204 2010/02/23 05:21:30 "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rtoy Exp $ "
" ... |
75ad0dbb274381ab1a2a3e86ef3f68155e962054286dfdf37817e902164c4f21 | jgm/gitit2 | Cache.hs | module Network.Gitit2.Cache
where
import Blaze.ByteString.Builder (toLazyByteString)
import Control.Applicative ((<$>))
import Control.Monad (filterM, unless, when)
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.ByteString.UTF8 as BSU
import Data.T... | null | https://raw.githubusercontent.com/jgm/gitit2/db61eae0e17c356830979747e2899ac5eaad03a5/Network/Gitit2/Cache.hs | haskell | | Expire the cached feed unless it is younger than 'minutes' old. | module Network.Gitit2.Cache
where
import Blaze.ByteString.Builder (toLazyByteString)
import Control.Applicative ((<$>))
import Control.Monad (filterM, unless, when)
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.ByteString.UTF8 as BSU
import Data.T... |
ad766f6fc91cb9db193db7e4c4b957785a8be12c6e6c536f91c849964f968c10 | unclebob/more-speech | article_panel.clj | (ns more-speech.ui.swing.article-panel
(:require [more-speech.user-configuration :as uconfig]
[more-speech.nostr.events :as events]
[more-speech.nostr.util :as util]
[more-speech.ui.formatters :as formatters]
[more-speech.ui.formatter-util :as f-util]
[more-... | null | https://raw.githubusercontent.com/unclebob/more-speech/a8db802e43a36d359eb46deef41f7edbcda7724c/src/more_speech/ui/swing/article_panel.clj | clojure | icky.
font - size : 14 ; font - weight : lighter ; }
text-decoration: none;}</style>") | (ns more-speech.ui.swing.article-panel
(:require [more-speech.user-configuration :as uconfig]
[more-speech.nostr.events :as events]
[more-speech.nostr.util :as util]
[more-speech.ui.formatters :as formatters]
[more-speech.ui.formatter-util :as f-util]
[more-... |
6c9e7c6a3dff2edc2d362846e78f461a34962e741c53ce5b46d0a12368f0a629 | jacius/lispbuilder | image-example.lisp | Demonstration / Test of using SDL ( Simple Media Layer ) library
using CFFI for foreign function interfacing ...
( C)2006 Justin Heyes - Jones , .
;;;; see COPYING for license
(in-package #:sdl-image-examples)
(defun image-example ()
(sdl:load-library)
(sdl:with-init ()
(sdl:window 540 350 :title-ca... | null | https://raw.githubusercontent.com/jacius/lispbuilder/e693651b95f6818e3cab70f0074af9f9511584c3/lispbuilder-sdl-image/examples/image-example.lisp | lisp | see COPYING for license
libraries to be preloaded to speed subsequent
loading of these images.
And loaded by force
sdl-image:quit *if* sdl-image:init is used. | Demonstration / Test of using SDL ( Simple Media Layer ) library
using CFFI for foreign function interfacing ...
( C)2006 Justin Heyes - Jones , .
(in-package #:sdl-image-examples)
(defun image-example ()
(sdl:load-library)
(sdl:with-init ()
(sdl:window 540 350 :title-caption "Loading images of vari... |
60b86db69639f6f4e034320e5466704ffcdb077df003cd7315a24066a85795ce | piotr-yuxuan/slava | encode_test.clj | (ns piotr-yuxuan.slava.encode-test
(:require [piotr-yuxuan.slava.config :as config]
[piotr-yuxuan.slava.encode :as encode]
[clojure.test :refer [deftest testing are is]])
(:import (piotr_yuxuan.slava.slava_record SlavaGenericRecord)
(org.apache.avro SchemaBuilder SchemaBuilder$Nam... | null | https://raw.githubusercontent.com/piotr-yuxuan/slava/7b018b9ed948f7d5f7470d4a71d77ec1e133f3cd/test/piotr_yuxuan/slava/encode_test.clj | clojure | All concrete, non-container types
map is before record | (ns piotr-yuxuan.slava.encode-test
(:require [piotr-yuxuan.slava.config :as config]
[piotr-yuxuan.slava.encode :as encode]
[clojure.test :refer [deftest testing are is]])
(:import (piotr_yuxuan.slava.slava_record SlavaGenericRecord)
(org.apache.avro SchemaBuilder SchemaBuilder$Nam... |
e11d5651329ebe15a2b00d4769bfc8f03f870b1d627d08a2772f010564664ab1 | LPCIC/matita | nCicDisambiguate.mli |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/ng_disambiguation/nCicDisambiguate.mli | ocaml |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... | |
c041d9b172f76f35c9a31d388b8a30fec9431f5802b197cb61152a9108fa92eb | alvatar/spheres | util.scm |
;; utility
(define (fold kons knil lst)
(let loop ((acc knil)
(lst lst))
(if (null? lst)
acc
(loop (kons (car lst) acc)
(cdr lst)))))
(define (parser-error . args)
(for-each
(lambda (x)
(if (not (string? x))
(write x (current-error-port))
(d... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/doc/parser/silex-ffi-example/util.scm | scheme | utility |
(define (fold kons knil lst)
(let loop ((acc knil)
(lst lst))
(if (null? lst)
acc
(loop (kons (car lst) acc)
(cdr lst)))))
(define (parser-error . args)
(for-each
(lambda (x)
(if (not (string? x))
(write x (current-error-port))
(display x (c... |
85307a08da42abb4adf32a658b9ba730b6fe23036ba088b135310da671def088 | AshleyYakeley/Truth | GetDynamicSupertype.hs | module Pinafore.Language.Type.GetDynamicSupertype
( getGreatestDynamicSupertype
, getOptGreatestDynamicSupertype
, getOptGreatestDynamicSupertypeSW
) where
import Data.Shim
import Language.Expression.Dolan
import Pinafore.Language.Shim
import Pinafore.Language.Type.DynamicSupertype
import Pinafore.Lang... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/ecacfea61f96a9f925606ff06020f4fbcdd37159/Pinafore/pinafore-language/lib/Pinafore/Language/Type/GetDynamicSupertype.hs | haskell | module Pinafore.Language.Type.GetDynamicSupertype
( getGreatestDynamicSupertype
, getOptGreatestDynamicSupertype
, getOptGreatestDynamicSupertypeSW
) where
import Data.Shim
import Language.Expression.Dolan
import Pinafore.Language.Shim
import Pinafore.Language.Type.DynamicSupertype
import Pinafore.Lang... | |
8acf339295428618cad6410548482691b369b4774a05494bc5355d6bc280b2dd | bendyworks/api-server | Server.hs | {-# LANGUAGE RankNTypes #-}
module Api.Types.Server where
import Control.Monad.Reader (ReaderT)
import Data.Text.Lazy (Text, pack)
import Hasql (Session)
import Hasql.Postgres (Postgres)
import Network.Mail.Mime (Mail)
import Web.Scotty.Trans (ActionT, ScottyError(..), ScottyT)
data ApiException
= MalformedParam T... | null | https://raw.githubusercontent.com/bendyworks/api-server/9dd6d7c2599bd1c5a7e898a417a7aeb319415dd2/lib/Api/Types/Server.hs | haskell | # LANGUAGE RankNTypes # |
module Api.Types.Server where
import Control.Monad.Reader (ReaderT)
import Data.Text.Lazy (Text, pack)
import Hasql (Session)
import Hasql.Postgres (Postgres)
import Network.Mail.Mime (Mail)
import Web.Scotty.Trans (ActionT, ScottyError(..), ScottyT)
data ApiException
= MalformedParam Text
| MissingParam Text
... |
58a01267cbb0919adeefa83e2f2bb502cc809ab3e1666d636048ab287fb621f6 | jacobobryant/hallway | api.clj | (ns findka.hallway.api
(:require [biff.util :as bu]
[clj-http.client :as http]
[clojure.java.shell :as sh]
[clojure.string :as str]))
; todo rate limit
; todo cache results in crux
(defmacro catchall-verbose [& forms]
`(try ~@forms (catch Exception e# (.printStackTrace e#))))
... | null | https://raw.githubusercontent.com/jacobobryant/hallway/9326f972a25ca0f77c2901da2b253d149dc4a46d/src/findka/hallway/api.clj | clojure | todo rate limit
todo cache results in crux | (ns findka.hallway.api
(:require [biff.util :as bu]
[clj-http.client :as http]
[clojure.java.shell :as sh]
[clojure.string :as str]))
(defmacro catchall-verbose [& forms]
`(try ~@forms (catch Exception e# (.printStackTrace e#))))
(defn search-hn [subject-url]
(->> (http/get ... |
6a41d9335cb7bf1145d68cb1601a63dd0ccbba165f33d37cce89a0115b87c53d | janestreet/memtrace_viewer_with_deps | table_char.mli | * [ Table_char ] holds a box - drawing character
open! Core_kernel
open! Import
type t =
{ ascii : char
; utf8 : string
}
[@@deriving sexp_of]
val connect : ?top:unit -> ?bottom:unit -> ?left:unit -> ?right:unit -> unit -> t
val to_buffer : t -> Buffer.t -> [ `Ascii | `Unicode ] -> unit
| null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/textutils/ascii_table/kernel/table_char.mli | ocaml | * [ Table_char ] holds a box - drawing character
open! Core_kernel
open! Import
type t =
{ ascii : char
; utf8 : string
}
[@@deriving sexp_of]
val connect : ?top:unit -> ?bottom:unit -> ?left:unit -> ?right:unit -> unit -> t
val to_buffer : t -> Buffer.t -> [ `Ascii | `Unicode ] -> unit
| |
4be4b7a8022ec44db4d2f1d2adfefb8a5488383a1c885df063057448701089ad | GaloisInc/pads-haskell | Errors.hs | {-# LANGUAGE NamedFieldPuns, DeriveDataTypeable #-}
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* ( c ) < > *
* ... | null | https://raw.githubusercontent.com/GaloisInc/pads-haskell/ffa01030cd1c1edf5f50df53f3783ff28bf43c7e/Language/Pads/Errors.hs | haskell | # LANGUAGE NamedFieldPuns, DeriveDataTypeable #
XXX-KSF: fix pretty printing to use pretty printing combinators rather than string ++ |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* ( c ) < > *
* < > *
* ... |
07ed9d549e3f4d40bad0ac5f967bb6a792ee0f12034bbb39223932f590736485 | biokoda/actordb_core | actordb_sqlproc.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(actordb_sqlproc).
-behaviour(gen_server).
-define(LAGERDBG,true).
-export([start/1, stop/1, init/1, handle_call/3, handle_cast/2, handle... | null | https://raw.githubusercontent.com/biokoda/actordb_core/8dcd08a0897055af89c3ce20d99ed5e64d0c33eb/src/actordb_sqlproc.erl | erlang | call_master/4,call_master/5
Read actor number without creating actor.
If call returns redirect, this is slave node not master node.
test_mon_calls(Name,Msg),
?ADBG("Call ~p",[Msg]),
test_mon_stop(),
test_mon_stop(),
test_mon_stop(),
Ref = make_ref(),
put(ref,Ref),
test_mon_proc(Who,Msg,Ref) ->
receive
... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(actordb_sqlproc).
-behaviour(gen_server).
-define(LAGERDBG,true).
-export([start/1, stop/1, init/1, handle_call/3, handle_cast/2, handle... |
7627e75deb1f42a16a9aeebeaaaba19f415802591a55b8e80def7a0532ea1862 | mmottl/lacaml | CZ.ml | File : CZ.ml
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /
This library 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 ; eit... | null | https://raw.githubusercontent.com/mmottl/lacaml/2e01c0747e740e54ab9a23ea59b29ea0d929b50f/src/CZ.ml | ocaml | * Modules with functions specialized for simple (C) or double (Z)
precision complex numbers.
Export [unop],... so they can be explicit in C and Z. | File : CZ.ml
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /
This library 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 ; eit... |
e5f771f1fff0dbee1afe39d2f3c6b0046d1b6b30a5bc5ac273d993869bc665c8 | marijnh/parse-js | package.lisp | (cl:defpackage #:parse-js
(:use #:cl)
(:export #:token-type #:token-value #:token-line #:token-char #:token-pos
#:token-newline-before #:token-comments-before
#:lex-js #:parse-js #:parse-js-string #:read-js-number
#:js-parse-error #:js-parse-error-line #:js-parse-error-char
... | null | https://raw.githubusercontent.com/marijnh/parse-js/fbadc6029bec7039602abfc06c73bb52970998f6/src/package.lisp | lisp | (cl:defpackage #:parse-js
(:use #:cl)
(:export #:token-type #:token-value #:token-line #:token-char #:token-pos
#:token-newline-before #:token-comments-before
#:lex-js #:parse-js #:parse-js-string #:read-js-number
#:js-parse-error #:js-parse-error-line #:js-parse-error-char
... | |
1f7d80dff9a67ce9d9a3320c16a5e546dc948ca563847952769f2e9d54b1fd76 | geneweb/geneweb | image.ml | open Config
open Gwdb
let prefix conf = Util.escape_html conf.image_prefix
* [ default_portrait_filename_of_key fn sn occ ] is the default filename of the corresponding person 's portrait . WITHOUT its file extenssion .
e.g : default_portrait_filename_of_key " " " DUPOND " 3 is " jean_claude.3.dupond "
e.g: ... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/image.ml | ocaml | * [full_portrait_path conf base p] is [Some path] if [p] has a portrait.
[path] is a the full path of the file with file extension.
TODO: size and mime type should be in db
TODO: should match on mime type here
* [has_access_to_portrait conf base p] is true iif we can see [p]'s portrait.
TODO: privacy setting... | open Config
open Gwdb
let prefix conf = Util.escape_html conf.image_prefix
* [ default_portrait_filename_of_key fn sn occ ] is the default filename of the corresponding person 's portrait . WITHOUT its file extenssion .
e.g : default_portrait_filename_of_key " " " DUPOND " 3 is " jean_claude.3.dupond "
e.g: ... |
b3c8be680baff50388f5185c0655c9ba335db0b61d1b19c3e9b4067dbc5e6c0a | lojic/LearningRacket | rna-transcription-test.rkt | #lang racket
(require "rna-transcription.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"Tests for the rna-transcription exercise"
(test-case "transcribes guanine to cytosine"
(check-equal? (to-rna "G") "C"))
(test-case "transcribes cytosine ... | null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/exercism.io/rna-transcription/rna-transcription-test.rkt | racket | #lang racket
(require "rna-transcription.rkt")
(module+ test
(require rackunit rackunit/text-ui)
(define suite
(test-suite
"Tests for the rna-transcription exercise"
(test-case "transcribes guanine to cytosine"
(check-equal? (to-rna "G") "C"))
(test-case "transcribes cytosine ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.