_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 |
|---|---|---|---|---|---|---|---|---|
2a57eb1f0d013df20866d9a2588ceefb3af33e064619fd3583a4ab89dbc17f8d | Elzair/nazghul | money.scm | ;; ----------------------------------------------------------------------------
;; money.scm - items that convert to gold
;; ----------------------------------------------------------------------------
(kern-mk-sprite-set 'ss_money 32 32 1 1 0 0 "gfx/money.png")
(kern-mk-sprite 's_gold_coins ss_money 1 0 #f 0)
(defi... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/template/lib/money.scm | scheme | ----------------------------------------------------------------------------
money.scm - items that convert to gold
---------------------------------------------------------------------------- |
(kern-mk-sprite-set 'ss_money 32 32 1 1 0 0 "gfx/money.png")
(kern-mk-sprite 's_gold_coins ss_money 1 0 #f 0)
(define money-ifc
(ifc '()
(method 'amount (lambda () 1))
(method 'get (lambda (kobj getter)
(kern-obj-inc-ref kobj)
(kern-obj-remove kobj)
... |
5aa87f6f9930ee736d1d949c268b4d438a74385855727741f51ee29f01e4f668 | vbrankov/opencl-ocaml | vector_add.ml | open Bigarray
let program_source = "
__kernel
void vecadd(__global int *A,
__global int *B,
__global int *C)
{
int idx = get_global_id(0);
C[idx] = A[idx] + B[idx];
}
"
let () =
try
let elements = 2048 in
let a = Array1.create int32 c_layout elements in
let b... | null | https://raw.githubusercontent.com/vbrankov/opencl-ocaml/bbfe6b6353e2d508363b8e22e15dd8f3656c88f5/examples/vector_add.ml | ocaml | open Bigarray
let program_source = "
__kernel
void vecadd(__global int *A,
__global int *B,
__global int *C)
{
int idx = get_global_id(0);
C[idx] = A[idx] + B[idx];
}
"
let () =
try
let elements = 2048 in
let a = Array1.create int32 c_layout elements in
let b... | |
7ee629923e7c2422162c4501e69188fbe5664b8f4cea249c5bb5574b49d658d8 | babashka/sci | resolve.cljc | (ns sci.impl.resolve
{:no-doc true}
(:require [clojure.string :as str]
[sci.impl.faster :as faster]
[sci.impl.interop :as interop]
[sci.impl.records :as records]
[sci.impl.types :refer [->Node]]
[sci.impl.utils :as utils :refer [strip-core-ns
... | null | https://raw.githubusercontent.com/babashka/sci/766a2f98405d68b1555c51eb5c0e4191340157a3/src/sci/impl/resolve.cljc | clojure | resolve alias
no sym-ns
env can contain foo/bar symbols from bindings
only valid when the symbol isn't excluded
resolves record or protocol referenced as class
e.g. clojure.lang.IDeref which is really a var in clojure.lang/IDeref
resolve-symbol is already handled in the call case
workaround for evaluator also n... | (ns sci.impl.resolve
{:no-doc true}
(:require [clojure.string :as str]
[sci.impl.faster :as faster]
[sci.impl.interop :as interop]
[sci.impl.records :as records]
[sci.impl.types :refer [->Node]]
[sci.impl.utils :as utils :refer [strip-core-ns
... |
59d0f9f157e452044fcaa5b83bb4771fe59b0b2dd91f400c85c2b7f39dc8cac3 | danownsthisspace/re-frame-form-example | core.cljs | (ns animal-form.core
(:require
[reagent.dom :as rdom]
[re-frame.core :as re-frame]
[animal-form.events :as events]
[animal-form.views :as views]
[animal-form.config :as config]
))
(defn dev-setup []
(when config/debug?
(println "dev mode")))
(defn ^:dev/after-load mount-root []
(re-frame/... | null | https://raw.githubusercontent.com/danownsthisspace/re-frame-form-example/741f05bb20b13bbcb28d8aa5bd834515fa4f13a9/src/animal_form/core.cljs | clojure | (ns animal-form.core
(:require
[reagent.dom :as rdom]
[re-frame.core :as re-frame]
[animal-form.events :as events]
[animal-form.views :as views]
[animal-form.config :as config]
))
(defn dev-setup []
(when config/debug?
(println "dev mode")))
(defn ^:dev/after-load mount-root []
(re-frame/... | |
2a7831fc8d46f43fa2e193f8e26878fd602f2adea0c39abe2a43453c712cee9e | jordanthayer/ocaml-search | normalize_dataset.ml | *
@author jtd7
@since 2010 - 05 - 28
@author jtd7
@since 2010-05-28
*)
let norm_by_alg group_key norm_key ?(wkey = norm_key) norm_to datasets =
List.map (Dataset.transform_with group_key norm_to norm_key ~with_key:wkey
(fun a b -> b /. a)) datasets
let norm_fn norm_by_fn ?(norm_fn =... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/spt_plot/normalize_dataset.ml | ocaml | b is the best / max / min of everyone | *
@author jtd7
@since 2010 - 05 - 28
@author jtd7
@since 2010-05-28
*)
let norm_by_alg group_key norm_key ?(wkey = norm_key) norm_to datasets =
List.map (Dataset.transform_with group_key norm_to norm_key ~with_key:wkey
(fun a b -> b /. a)) datasets
let norm_fn norm_by_fn ?(norm_fn =... |
d8789b1de3d10cf08c9a554e7c1d85d29384d87dfa29a4d17e3955bbcc6be7fe | jtdaugherty/vty | Color240.hs | -- This header file was generated by ./256colres.pl
module Graphics.Vty.Attributes.Color240
( rgbColorToColor240
, color240CodeToRGB
)
where
import Data.Word (Word8)
import Text.Printf
Note : 's mapping from RGB to 240 colors was generated from
-- 256colres.pl which is forked from xterm 256colres.pl.
-- | C... | null | https://raw.githubusercontent.com/jtdaugherty/vty/479d94c099b730c7a813ba2a4492b01ffcf7f09d/src/Graphics/Vty/Attributes/Color240.hs | haskell | This header file was generated by ./256colres.pl
256colres.pl which is forked from xterm 256colres.pl.
| Create a value in the Color240 set from an RGB triple. This maps
| module Graphics.Vty.Attributes.Color240
( rgbColorToColor240
, color240CodeToRGB
)
where
import Data.Word (Word8)
import Text.Printf
Note : 's mapping from RGB to 240 colors was generated from
the input arguments to an entry in the 240 - color palette depicted at :
rgbColorToColor240 :: Integral i => i ->... |
3e363c78c195774a59d44ae541e5f95dd66520bc86facbb15888e8d50fa5b539 | spechub/Hets | KnownIris.hs | |
Module : ./Logic / KnownIris.hs
Description : map of the known logics and serializations
Copyright : ( c ) , Uni Bremen 2012
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
Module : ./Logic/KnownIris.... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/Logic/KnownIris.hs | haskell | |
Module : ./Logic / KnownIris.hs
Description : map of the known logics and serializations
Copyright : ( c ) , Uni Bremen 2012
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
Module : ./Logic/KnownIris.... | |
ecc6e987ed58b9e92ed124cc801b10397faf55277cc420fd1245aed2641f2767 | cyverse-archive/DiscoveryEnvironmentBackend | project.clj | (use '[clojure.java.shell :only (sh)])
(require '[clojure.string :as string])
(defn git-ref
[]
(or (System/getenv "GIT_COMMIT")
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
(defproject org.iplantc/infosquito "5.0.0"
:description "An ICAT database crawler used to index the contents of iROD... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/Infosquito/project.clj | clojure | (use '[clojure.java.shell :only (sh)])
(require '[clojure.string :as string])
(defn git-ref
[]
(or (System/getenv "GIT_COMMIT")
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
(defproject org.iplantc/infosquito "5.0.0"
:description "An ICAT database crawler used to index the contents of iROD... | |
01e2e541d3e8ce1f6596da9f42e771bd77d3f4b31dcc8f1f2daa7c7e651714bb | amuletml/amulet | Wrapper.hs | {-# OPTIONS_GHC -funbox-strict-fields #-}
# LANGUAGE MultiParamTypeClasses , FlexibleInstances #
| An alternative wrapper for the and Happy parser . This
operates on ' T.Text ' objects instead of 's default bytestrings .
As the lexer and parser work in sync ( we only consume one token at a
time ) , we ... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Language/Lua/Parser/Wrapper.hs | haskell | # OPTIONS_GHC -funbox-strict-fields #
| The current state of the lexer and parser
^ Builder for string literals
^ The starting character for the string
^ The position of the start of this token
^ Whether "trivial" tokens such as whitespace and comments should be emitted.
^ Current source position
^ Current input... | # LANGUAGE MultiParamTypeClasses , FlexibleInstances #
| An alternative wrapper for the and Happy parser . This
operates on ' T.Text ' objects instead of 's default bytestrings .
As the lexer and parser work in sync ( we only consume one token at a
time ) , we must manage the state of both at the same ... |
eb94cf8d22c1e3081f05a1122a8262d9329ebbf657241107cd0c010eb51608d5 | egobrain/dbschema | dbschema.erl | -module(dbschema).
-compile({parse_transform, do}).
-export([
up/1,
list/0,
down/2
]).
-include("migrations.hrl").
-type migration() :: #migration{}.
up(MigrationsFolder) ->
do([error_m ||
dbschema_pg_driver:init(),
FileMigrations = get_migrations(Migrati... | null | https://raw.githubusercontent.com/egobrain/dbschema/ce479b6b81b55f3ccd6c88647cfb6dbdc29d951a/src/dbschema.erl | erlang | =============================================================================
============================================================================= | -module(dbschema).
-compile({parse_transform, do}).
-export([
up/1,
list/0,
down/2
]).
-include("migrations.hrl").
-type migration() :: #migration{}.
up(MigrationsFolder) ->
do([error_m ||
dbschema_pg_driver:init(),
FileMigrations = get_migrations(Migrati... |
8c4db0994a9a1cc0c9b5e9cb94a1ad06c0859b5175f3007207c2a56d729c3ad5 | rgleichman/glance | tutorial.hs | Welcome to Glance ! My goal for this tutorial is teach you how to read
Glance drawings , but also to get you thinking about visual programming languages .
Why is Glance designed the way it is ? What are other ways it could work ?
How could it be extended ? I feel that we are just at the very beginning of
visual... | null | https://raw.githubusercontent.com/rgleichman/glance/685abb04a2c93af8aaae1ee81e81e09842eccf88/examples/tutorial.hs | haskell | More explicitly | Welcome to Glance ! My goal for this tutorial is teach you how to read
Glance drawings , but also to get you thinking about visual programming languages .
Why is Glance designed the way it is ? What are other ways it could work ?
How could it be extended ? I feel that we are just at the very beginning of
visual... |
58e8d5e3370ed9a88e8183cf10e316d2ef0801e49545be8f7e3cf42acf3095d6 | YoshikuniJujo/test_haskell | Order.hs | {-# LANGUAGE LinearTypes #-}
# OPTIONS_GHC -Wall -fno - warn - tabs #
module LinearType.Order (Begin, End, A, B, C, begin, funF, funG, funH) where
data Begin = Begin deriving Show
data End = End deriving Show
data A = A deriving Show
data B = B deriving Show
data C = C deriving Show
begin :: (Begin %1 -> IO End) ->... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/44978bae7cafcbe5a4cc1b0aca1550ae5397d0b2/tribial/try-tribials/src/LinearType/Order.hs | haskell | # LANGUAGE LinearTypes # | # OPTIONS_GHC -Wall -fno - warn - tabs #
module LinearType.Order (Begin, End, A, B, C, begin, funF, funG, funH) where
data Begin = Begin deriving Show
data End = End deriving Show
data A = A deriving Show
data B = B deriving Show
data C = C deriving Show
begin :: (Begin %1 -> IO End) -> IO ()
begin f = do
End <- f... |
c8ea0e3d8da79c5caebfdf4540b88e9206f21a13fc1e90ad357397d4d255f3e8 | BekaValentine/SimpleFP-v2 | Decontinuization.hs | {-# OPTIONS -Wall #-}
-- | This module defines the tools for decontinuizing terms.
module Continuations.Core.Decontinuization where
import Utils.ABT hiding (shift)
import Utils.Vars
import Continuations.Core.Term
import Control.Monad.Reader
import Control.Monad.State
-- | Binary composition to make ap... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Continuations/Core/Decontinuization.hs | haskell | # OPTIONS -Wall #
| This module defines the tools for decontinuizing terms.
| Binary composition to make applicative style more convenient.
| Trinary composition to make applicative style more convenient.
| A @Continuer@ is a higher-order representation of the body of a shift,
correspond to a function @\c -> foo... |
module Continuations.Core.Decontinuization where
import Utils.ABT hiding (shift)
import Utils.Vars
import Continuations.Core.Term
import Control.Monad.Reader
import Control.Monad.State
(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
f .: g = \x y -> f (g x y)
(.::) :: (d -> e) -> (a -> b -> c -> ... |
20000237cfe4630057475c4b0787e5c535723edaeaaf0dab7ce2c1286248f8f0 | FranklinChen/learn-you-some-erlang | regis_tests.erl | -module(regis_tests).
-include_lib("eunit/include/eunit.hrl").
app_test_() ->
{inorder,
[?_assert(try application:start(regis) of
ok -> true;
{error, {already_started, regis}} -> true;
_ -> false
catch
_:_ -> false
... | null | https://raw.githubusercontent.com/FranklinChen/learn-you-some-erlang/878c8bc2011a12862fe72dd7fdc6c921348c79d6/processquest/apps/regis-1.0.0/test/regis_tests.erl | erlang | -module(regis_tests).
-include_lib("eunit/include/eunit.hrl").
app_test_() ->
{inorder,
[?_assert(try application:start(regis) of
ok -> true;
{error, {already_started, regis}} -> true;
_ -> false
catch
_:_ -> false
... | |
6577edb33254b0643f516b451f0400c0f1717d4070721d7838e9cb9b268d46da | IronScheme/IronScheme | syntactic.sps | #!r6rs
(import (tests r6rs records syntactic)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs records syntactic)\n")
(run-records-syntactic-tests)
(report-test-results)
| null | https://raw.githubusercontent.com/IronScheme/IronScheme/687cde5d4e463a119e4ba28296f2af42a5c4a9df/IronScheme/IronScheme.Console/tests/r6rs/run/records/syntactic.sps | scheme | #!r6rs
(import (tests r6rs records syntactic)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs records syntactic)\n")
(run-records-syntactic-tests)
(report-test-results)
| |
9da838b6302419cfa67b4a735498a24a8287099508d17007be56407a4a78895c | countvajhula/cli | cli.rkt | #lang racket/base
(require cli
rackunit
rackunit/text-ui
(only-in racket/function [thunk f:thunk]))
(require "test-scripts.rkt")
(define tests
(test-suite
"cli tests"
(test-case
"script with help metadata (smoke test - no functionality)"
(check-equal? (run doc #("blah"... | null | https://raw.githubusercontent.com/countvajhula/cli/26c930e8f8bc4cb9396561f2678d74179473085d/tests/cli.rkt | racket | note that the param value being dynamically bound
means that re-running these tests manually won't
necessarily produce the same results - in particular
passing no flag does not change the existing value
see note above re: reproducibility and dynamic binding
default number of attempts in the script
see note above... | #lang racket/base
(require cli
rackunit
rackunit/text-ui
(only-in racket/function [thunk f:thunk]))
(require "test-scripts.rkt")
(define tests
(test-suite
"cli tests"
(test-case
"script with help metadata (smoke test - no functionality)"
(check-equal? (run doc #("blah"... |
6e874265b3b8c6318ecac2e7de87f1631ca80bc83e40312a536bb2c142f3c032 | crategus/cl-cffi-gtk | package.lisp | (defpackage :gtk-demo
(:use :gtk-example
:gtk-tutorial
:gio-example
:gtk :gdk :gdk-pixbuf :gobject
:glib :gio :pango :cairo :cffi :split-sequence :common-lisp)
(:export #:gtk-demo))
(in-package :gtk-demo)
(defun rel-path (filename)
(let ((system-path (asdf:system-source-directory... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/dfdbad5bb6f18aadb65b171561713af1dfe0dd50/demo/gtk-demo/package.lisp | lisp | (defpackage :gtk-demo
(:use :gtk-example
:gtk-tutorial
:gio-example
:gtk :gdk :gdk-pixbuf :gobject
:glib :gio :pango :cairo :cffi :split-sequence :common-lisp)
(:export #:gtk-demo))
(in-package :gtk-demo)
(defun rel-path (filename)
(let ((system-path (asdf:system-source-directory... | |
ac9b7180fbc827ed123913e1b37a69e6bb6b745f0df0db2d0fb3effca19faeaa | simongray/datalinguist | triple.clj | (ns dk.simongray.datalinguist.triple
"Functions dealing with (subject; relation; object) triples."
(:require [dk.simongray.datalinguist.util :as util])
(:import [edu.stanford.nlp.ie.util RelationTriple]
[edu.stanford.nlp.util Pair]))
;; TODO: unit tests
(defn subject
"The subject of the `triple`; `... | null | https://raw.githubusercontent.com/simongray/datalinguist/9869884d7019e7102efffcb0de66187e9cb126c5/src/dk/simongray/datalinguist/triple.clj | clojure | TODO: unit tests
`style` can be :span, :link, :head, :lemma or
`style` can be :span, :link, :head, :lemma or
`style` can be :span, :head, :lemma or
be; President)."
) . "
United States ) . "
Friday ) . " | (ns dk.simongray.datalinguist.triple
"Functions dealing with (subject; relation; object) triples."
(:require [dk.simongray.datalinguist.util :as util])
(:import [edu.stanford.nlp.ie.util RelationTriple]
[edu.stanford.nlp.util Pair]))
(defn subject
:text (default)."
([style ^RelationTriple triple]... |
a97234631e8f2f7baddb729634d857d8404005f8df230076d2203aa66d062442 | Gbury/archsat | constraints.ml | This file is free software , part of Archsat . See file " LICENSE " for more details .
(* Some helpers *)
(* ************************************************************************ *)
let mapi f =
let i = ref (-1) in
let aux x = incr i; f !i x in
Gen.map aux
Constraint accumulators
(* ********************... | null | https://raw.githubusercontent.com/Gbury/archsat/322fbefa4a58023ddafb3fa1a51f8199c25cde3d/src/algos/constraints.ml | ocaml | Some helpers
************************************************************************
************************************************************************
Getters
************************************************************************
Construction
******************************************************... | This file is free software , part of Archsat . See file " LICENSE " for more details .
let mapi f =
let i = ref (-1) in
let aux x = incr i; f !i x in
Gen.map aux
Constraint accumulators
type ('a, 'b, 'c) refiner = 'b -> 'a -> ('a * 'c) Gen.t
type ('a, 'c) elt = {
elt : 'a;
reason : (int * 'c) option;... |
b5120b0623a231d4c2ef8600462528e0bcce2df0234e09354ca6ceb77c1a7b55 | mejgun/haskell-tdlib | MessageContent.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.MessageContent where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.AnimatedEmoji as AnimatedEmoji
import qualified TD.Data.Animation as Animation
import qualified TD.Data.Audio as Audio
import qualified TD.Data.C... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/b088f5062023fa201a68ebda128ab2fc489329ab/src/TD/Data/MessageContent.hs | haskell | # LANGUAGE OverloadedStrings #
|
| Contains the content of a message
|
|
| An animation message (GIF-style).
| True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
| True, if the animation preview must be covered by a spoiler animation
| Animation caption
| The ani... |
module TD.Data.MessageContent where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.AnimatedEmoji as AnimatedEmoji
import qualified TD.Data.Animation as Animation
import qualified TD.Data.Audio as Audio
import qualified TD.Data.CallDiscardReason as CallDiscardReason
im... |
bd0e5c3eb8f7ef1eedd9ecc03798c1111098c824efad666d90754fc12a5d13a5 | hasktorch/ffi-experimental | ParseDeclarations.hs |
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module ParseDeclarations where
import GHC.Generics
import Data.Yaml
import qualified Data.Yaml as Y
import Data.Aeson.Types (defaultOptions, fieldLabelModifier, genericParseJSON)
import Text.Show.Prettyprint (prettyPrint)
i... | null | https://raw.githubusercontent.com/hasktorch/ffi-experimental/54192297742221c4d50398586ba8d187451f9ee0/codegen/src/ParseDeclarations.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
Declarations.yaml
A example--
, buffers :: [String] |
# LANGUAGE DeriveGeneric #
module ParseDeclarations where
import GHC.Generics
import Data.Yaml
import qualified Data.Yaml as Y
import Data.Aeson.Types (defaultOptions, fieldLabelModifier, genericParseJSON)
import Text.Show.Prettyprint (prettyPrint)
import qualified ParseFunctionSig as S
- name : _ th_set _
mat... |
95779ef93e9da6521e33e2723a19c74af542bc085841474dafbb26f0aa08d777 | larrychristensen/orcpub | index.clj | (ns orcpub.index
(:require [hiccup.page :refer [html5 include-css include-js]]
[orcpub.oauth :as oauth]
[orcpub.dnd.e5.views-2 :as views-2]))
(defn meta-tag [property content]
(if content
[:meta
{:property property
:content content}]))
(defn index-page [{:keys [url
... | null | https://raw.githubusercontent.com/larrychristensen/orcpub/e83995857f7e64af1798009a45a0b03abcd3a4be/src/clj/orcpub/index.clj | clojure | width: 120px}
width: 64px}
width: 32px}
width: 60px; font-size: 10px}
overflow - y : scroll;-webkit - overflow - scrolling : touch;font - family : Open Sans , sans - serif }
}
js.id = id;
"
i[r]=i[r]||function(){
a=s.createElement(o),
a.src = g;m.parentNode.insertBefore(a , m )
"]])) | (ns orcpub.index
(:require [hiccup.page :refer [html5 include-css include-js]]
[orcpub.oauth :as oauth]
[orcpub.dnd.e5.views-2 :as views-2]))
(defn meta-tag [property content]
(if content
[:meta
{:property property
:content content}]))
(defn index-page [{:keys [url
... |
38ee2b45457bcaafb5749fb548633d3ed2af06feceb34a69a4652c78643d0a84 | brownplt/Resugarer | lang-min.rkt | (module lang-min racket
(provide
Min red
test-eval test-expand
test-trace
)
Assembled from Matthias ' letrec ( personal correspondence )
; and redex/example/letrex.rkt.
; The language is probably mostly correct.
(require rackunit)
(require redex)
(require "resugar-redex.rkt")
;;;;;;;;;;;;;;;;
;;... | null | https://raw.githubusercontent.com/brownplt/Resugarer/1353b4309c101f0f1ac2df2cba7f3cba1f0a3a37/prototype/lang-min.rkt | racket | and redex/example/letrex.rkt.
The language is probably mostly correct.
Language ;;;
with [(--> a ,(collect (term b))) (==> a b)]))
Language Testing ;;;
Resugaring Integration ;;; | (module lang-min racket
(provide
Min red
test-eval test-expand
test-trace
)
Assembled from Matthias ' letrec ( personal correspondence )
(require rackunit)
(require redex)
(require "resugar-redex.rkt")
(define-language Min
(p (top s e))
(e (apply o e ...)
(op o e ...)
(set! o x e)
... |
3c05c44b9c6ae07b2a3788a053bdc035c5524a4d02b07f0190d5f378ca36dd9f | chicken-mobile/chicken-sdl2-android-builder | joy-button-event.scm | ;;
chicken - sdl2 : CHICKEN Scheme bindings to Simple DirectMedia Layer 2
;;
Copyright © 2013 , 2015 - 2016 .
;; 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... | null | https://raw.githubusercontent.com/chicken-mobile/chicken-sdl2-android-builder/90ef1f0ff667737736f1932e204d29ae615a00c4/eggs/sdl2/lib/sdl2-internals/accessors/events/joy-button-event.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributio... | chicken - sdl2 : CHICKEN Scheme bindings to Simple DirectMedia Layer 2
Copyright © 2013 , 2015 - 2016 .
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT ,
INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT N... |
66e0c5f6fc8a7902cd6852210ecbed1818746c6f63e4d3ab848aefbd1f67bc57 | eeng/shevek | layout.cljs | (ns shevek.pages.layout
(:require [shevek.reflow.db :as db]
[shevek.navigation :refer [current-page]]
[shevek.components.popup :refer [popup tooltip]]
[shevek.components.modal :refer [modal]]
[shevek.domain.auth :refer [logged-in?]]
[shevek.pages.sidebar :re... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/pages/layout.cljs | clojure | (ns shevek.pages.layout
(:require [shevek.reflow.db :as db]
[shevek.navigation :refer [current-page]]
[shevek.components.popup :refer [popup tooltip]]
[shevek.components.modal :refer [modal]]
[shevek.domain.auth :refer [logged-in?]]
[shevek.pages.sidebar :re... | |
30fd5ee75f231ef19cfac090eb04806eed1ef14215841f8f61851d812d84f8bf | jbracker/supermonad | PPUtilities.hs |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/hmtc/original/PPUtilities.hs | haskell | | Pretty-printing utilities.
:: Name -> ShowS
:: SrcPos -> ShowS
:: Int -> (Int -> a -> ShowS) -> Maybe a -> ShowS
:: Int -> (Int -> a -> ShowS) -> [a] -> ShowS
:: Int -> ShowS
:: ShowS
:: ShowS
:: Int -> ShowS
:: Int -> String -> ShowS
:: Int -> String -> ShowS
----------------------------------------------... |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... |
1921303423e20e57b98c25360022f138ba64cbe9fb5682f681819741cef9f6a2 | The-closed-eye-of-love/pixiv | PixivT.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
| Copyright : ( c ) 2021 The closed eye of love
SPDX - License - Identifier : BSD-3 - Clause
Maintainer : Poscat < > , < >
-- Stability: alpha
-- Portability: portable
-- The core monad of this library. '... | null | https://raw.githubusercontent.com/The-closed-eye-of-love/pixiv/5a9cbe28dd52d2bc80db3320a5311750b837a17b/src/Web/Pixiv/Types/PixivT.hs | haskell | Stability: alpha
Portability: portable
The core monad of this library. 'PixivT' maintains a pixiv login state,
and provides an environment to perform computations created by servant.
* MonadPixiv class
* PixivT monad transformer
* Token
* Utilities
| Executes a computation in the client monad.
| State stored ... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
| Copyright : ( c ) 2021 The closed eye of love
SPDX - License - Identifier : BSD-3 - Clause
Maintainer : Poscat < > , < >
module Web.Pixiv.Types.PixivT
* ClientT monad transformer
ClientT (..),
... |
c14a4887b681c9a849c9f086c45f893ac0facafe59986a84a56a774e22183d92 | 2600hz-archive/whistle | diagnostics.erl | -module(diagnostics).
-author('James Aimonetti <>').
-export([start/0, start_link/0, stop/0]).
( ) - > { ok , Pid::pid ( ) }
%% @doc Starts the app for inclusion in a supervisor tree
start_link() ->
ensure_started(sasl),
ensure_started(crypto),
ensure_started(dynamic_compile),
ensure_started(log_r... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/utils/diagnostics/src/diagnostics.erl | erlang | @doc Starts the app for inclusion in a supervisor tree | -module(diagnostics).
-author('James Aimonetti <>').
-export([start/0, start_link/0, stop/0]).
( ) - > { ok , Pid::pid ( ) }
start_link() ->
ensure_started(sasl),
ensure_started(crypto),
ensure_started(dynamic_compile),
ensure_started(log_roller),
diagnostics_sup:start_link().
@spec start (... |
69a324d1298d21c33c6c76d3ad66ba7da76b060f5fc6ddab28887f1dc8282832 | andersfugmann/amqp-client | amqp.ml | open Amqp_client_lib
module Channel = Channel
module Connection = Connection
module Exchange = Exchange
module Message = Message
module Queue = Queue
module Rpc = Rpc
module Types = Types
| null | https://raw.githubusercontent.com/andersfugmann/amqp-client/e6e92225b91742fa8777a02ad9b59a1dde45e752/async/src/amqp.ml | ocaml | open Amqp_client_lib
module Channel = Channel
module Connection = Connection
module Exchange = Exchange
module Message = Message
module Queue = Queue
module Rpc = Rpc
module Types = Types
| |
1174757dad6b2fa9ed5053bc55b505db76838bd01a1ac8097e962cf027bfc850 | ocaml-gospel/cameleer | timsort.ml | (* Decomposition of the initial list in runs. *)
@ open Permut
type 'a run = Asc of 'a list | Desc of 'a list
(*@ function get_run (r: 'a run) : 'a list = match r with Asc l | Desc l -> l *)
let[@logic] rec sorted_list compare = function
| [] | [ _ ] -> true
| x :: y :: r -> compare x y <= 0 && sorted_list comp... | null | https://raw.githubusercontent.com/ocaml-gospel/cameleer/fcf00fe27e0a41125880043aa9aa633399fc8cc2/examples/in_progress/timsort.ml | ocaml | Decomposition of the initial list in runs.
@ function get_run (r: 'a run) : 'a list = match r with Asc l | Desc l -> l
Merge function (as in MergeSort)
@ merge_desc_rev revacc xs ys
variant xs, ys
@ r = finish stack
requires wf_stack compare stack
ensures sorted_list compare r
... |
@ open Permut
type 'a run = Asc of 'a list | Desc of 'a list
let[@logic] rec sorted_list compare = function
| [] | [ _ ] -> true
| x :: y :: r -> compare x y <= 0 && sorted_list compare (y :: r)
@ sorted_list compare l
requires is_pre_order compare
variant l
requires is_pre_order compare... |
4da126b74d4546c2c7e3589283f05e45631c316c4146a6aa1ae58779e6e41f2d | OCamlPro/ez_api | ezLwtSys.ml | (**************************************************************************)
(* *)
Copyright 2018 - 2022 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/common/unix/ezLwtSys.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2018 - 2022 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
let run f = Lwt_main.run @@ f ()
let sleep f = Lwt_unix.sleep f
|
af4f7d0504a9b47c3b021289e118b911df4ab5615947b42489f4690103ca43bd | huangjs/cl | dqawfe.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" 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.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l ,... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/src/numerical/slatec/dqawfe.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 nil) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" 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.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rt... |
cbe9ab3b420cab0b34b5f68900bb76e330bec919e4a6fc583523a5bfa36c22a1 | ddmcdonald/sparser | others.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1994 - 1997,2013 - 2021 -- all rights reserved
;;;
;;; File: "others"
;;; Module: "grammar;model:core:adjuncts:"
version : February 2021
;; initiated 1/18/13. Goes with the modifiers file in dossiers in that it
;; ... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/304bd02d0cf7337ca25c8f1d44b1d7912759460f/Sparser/code/s/grammar/model/core/adjuncts/others.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "others"
Module: "grammar;model:core:adjuncts:"
initiated 1/18/13. Goes with the modifiers file in dossiers in that it
provides def-forms for all the other sorts of standard modifiers that
--------------------------------------------
i... | copyright ( c ) 1994 - 1997,2013 - 2021 -- all rights reserved
version : February 2021
were n't handled on independently back in the day .
(in-package :sparser)
(define-category intensifier
:specializes adverbial)
(defun define-intensifier (string &rest args
&key (super-... |
b6cd57ba618585a6c923dc13d0c3d4b129770e9a148d96f08d0bdc104ae4cf5c | 8c6794b6/haskell-sc-scratch | Tree.hs | |
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : portable
Representation of scsynth node tree .
CopyRight : (c) 8c6794b6
License : BSD3
Maintainer :
Stability : unstable
Portability : portable
Representation of scsynth node tree.
-}
module Sound.... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/hsc3-tree/src/lib/Sound/SC3/Tree.hs | haskell | * Examples
** Interactive use
$example_interactive
** Routing nodes
$example_routing
** Querying
$example_query
* Module re-exports | |
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : portable
Representation of scsynth node tree .
CopyRight : (c) 8c6794b6
License : BSD3
Maintainer :
Stability : unstable
Portability : portable
Representation of scsynth node tree.
-}
module Sound.... |
35c19308c5779aa61f3ac7fda70760e0ccfb6fe572b76ceaf31f39e37ad9ce95 | jeovazero/hello-haskell-nix | PGInstance.hs | # LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE DuplicateRecordFields #
module Lib.Persistence.User.PGInstance (addUser,getUserByEmail) where
import Lib.Persistence
import Lib.Persistence.User
import qualified Lib.Persistence.User.PGStatements as PG
import Lib.Data.User (NewUser(..),User(..))
impor... | null | https://raw.githubusercontent.com/jeovazero/hello-haskell-nix/8b2be5c31a381dffda79d0a73fbf5ac06487b5f4/src/Lib/Persistence/User/PGInstance.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE DuplicateRecordFields #
module Lib.Persistence.User.PGInstance (addUser,getUserByEmail) where
import Lib.Persistence
import Lib.Persistence.User
import qualified Lib.Persistence.User.PGStatements as PG
import Lib.Data.User (NewUser(..),User(..))
impor... | |
57444b6d41829f50cfc688d3bdb915facbd78a5e20fed58351ca9270ca4d3cb9 | metaocaml/ber-metaocaml | int_replace_polymorphic_compare.mli | val ( = ) : int -> int -> bool
val ( <> ) : int -> int -> bool
val ( < ) : int -> int -> bool
val ( > ) : int -> int -> bool
val ( <= ) : int -> int -> bool
val ( >= ) : int -> int -> bool
val compare : int -> int -> int
| null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/utils/int_replace_polymorphic_compare.mli | ocaml | val ( = ) : int -> int -> bool
val ( <> ) : int -> int -> bool
val ( < ) : int -> int -> bool
val ( > ) : int -> int -> bool
val ( <= ) : int -> int -> bool
val ( >= ) : int -> int -> bool
val compare : int -> int -> int
| |
eca4e26b45d235234070c358ddf53e30cb415e077dcdda84e45eb13e5a65640a | maximedenes/native-coq | pp.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/lib/pp.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Modify pretty printing functions b... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp_control
open Compat
... |
ac2006664ca3b065877ced88513abc09694e5a599457382041e41d1230b251db | chefy-io/clojure-katas | levenshtein_test.clj | (ns clojure-katas.levenshtein-test
(:use clojure.test
clojure-katas.levenshtein))
(deftest levenshtein-test
(testing "return edit distance between two strings"
(is (= 3 (levenshtein "kitten" "sitt")))))
| null | https://raw.githubusercontent.com/chefy-io/clojure-katas/81efe02dfe5add9e10146e10dd2b34f072f7686e/test/clojure_katas/levenshtein_test.clj | clojure | (ns clojure-katas.levenshtein-test
(:use clojure.test
clojure-katas.levenshtein))
(deftest levenshtein-test
(testing "return edit distance between two strings"
(is (= 3 (levenshtein "kitten" "sitt")))))
| |
e7f2c3044006e23eed496bc6f349b3439f1b02598e953d064637cdb3bd449dda | rmloveland/scheme48-0.53 | select.scm | Copyright ( c ) 1994 by . See file COPYING .
(define (test)
(let ((in (current-input-port))
(out (current-output-port))
(s1 (make-port-set))
(s2 (make-port-set)))
(let loop ((i 0))
(cond ((char-ready? in)
(got-char in out i)
(loop 0))
(else
(clear-port-set! s1)
(clear... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/prescheme/test/select.scm | scheme | Printing integers
Write positive integer X out to PORT | Copyright ( c ) 1994 by . See file COPYING .
(define (test)
(let ((in (current-input-port))
(out (current-output-port))
(s1 (make-port-set))
(s2 (make-port-set)))
(let loop ((i 0))
(cond ((char-ready? in)
(got-char in out i)
(loop 0))
(else
(clear-port-set! s1)
(clear... |
d71ce7c1257d5554e254d6e8dd01eae45be1995afbbeede0fa345d4e0abcec38 | metaocaml/ber-metaocaml | oprint.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/typing/oprint.ml | ocaml | ************************************************************************
OCaml
... | Projet Cristal , INRIA Rocquencourt
Copyright 2002 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
open Outcometree
exception Ellipsis
let cautious f ppf arg =
try f ppf arg with... |
8ddd50410d8942db7752e478fa25b70432aab3bd9881b0aff9c84243bbf2a466 | Incanus3/ExiL | fe-base.lisp | (in-package :exil)
EXPORTED FUNCTIONS AND :
;;; multiple environments:
( ( name & key redefine ) )
( defun defenvf ( name & key redefine ) )
( ( name ) )
( defun undefenvf ( name ) )
( ( name ) )
( defun setenvf ( name ) )
;; (defun environments ())
;; (defun current-environment ())
;;; templates... | null | https://raw.githubusercontent.com/Incanus3/ExiL/de0f7c37538cecb7032cc1f2aa070524b0bc048d/src/front-end/fe-base.lisp | lisp | multiple environments:
(defun environments ())
(defun current-environment ())
templates:
(defun deftemplatef (name slots))
(defun undeftemplatef (name))
(defun find-templatef (name)) ;; => external template representation
(defmacro find-template (name))
(defun templates ()) ;; => lis... | (in-package :exil)
EXPORTED FUNCTIONS AND :
( ( name & key redefine ) )
( defun defenvf ( name & key redefine ) )
( ( name ) )
( defun undefenvf ( name ) )
( ( name ) )
( defun setenvf ( name ) )
( ( name & body slots ) )
( defmacro undeftemplate ( name ) )
( ( name ) )
( defmacro as... |
1eebd68fb0134a8effb5f1100c4e157c7f924ac31a63d22b183106e5d6551a4f | okTurtles/strings | js_ast.ml | open! Core
open Flow_ast
let extract ~on_string stmts =
let rec extract_expr_or_spread = function
| Expression.Expression expr -> extract_expression expr
| Expression.Spread (_, { argument; comments = _ }) -> extract_expression argument
and extract_computed_key ComputedKey.(_, { comments = _; expression })... | null | https://raw.githubusercontent.com/okTurtles/strings/f893f71c0bce2bb7630fd1ba6f9da35880c66ae1/src/parsing/js_ast.ml | ocaml | Special case
All expressions | open! Core
open Flow_ast
let extract ~on_string stmts =
let rec extract_expr_or_spread = function
| Expression.Expression expr -> extract_expression expr
| Expression.Spread (_, { argument; comments = _ }) -> extract_expression argument
and extract_computed_key ComputedKey.(_, { comments = _; expression })... |
d6fefa8df441af494822189507a0b87623f627e3bb9e39760e3c7b72ae4281bd | hercules-ci/hercules-ci-agent | LifeCycle.hs | # LANGUAGE DataKinds #
# OPTIONS_GHC -fno - warn - deprecations #
module Hercules.API.Agent.LifeCycle where
import Hercules.API.Agent.LifeCycle.CreateAgentSession_V2 as CreateAgentSession_V2
( CreateAgentSession,
)
import Hercules.API.Agent.LifeCycle.ServiceInfo
import Hercules.API.Agent.LifeCycle.StartInfo
( H... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/3aaa80c8fe8cd252b656d40eeec2428afe884c07/hercules-ci-api-agent/src/Hercules/API/Agent/LifeCycle.hs | haskell | | Agent session and "connection" endpoints | # LANGUAGE DataKinds #
# OPTIONS_GHC -fno - warn - deprecations #
module Hercules.API.Agent.LifeCycle where
import Hercules.API.Agent.LifeCycle.CreateAgentSession_V2 as CreateAgentSession_V2
( CreateAgentSession,
)
import Hercules.API.Agent.LifeCycle.ServiceInfo
import Hercules.API.Agent.LifeCycle.StartInfo
( H... |
2bbe69ac0b94ede834f5c1856a8f3df530d767c0bcc698889186b07f5fed3961 | evturn/haskellbook | write-a-type-signature.hs | 1 .
functionH :: [a] -> a
functionH (x:_) = x
2 .
functionC :: Ord a => a -> a -> Bool
functionC x y = if (x > y) then True else False
3 .
functionS :: (a, b) -> b
functionS (x, y) = y
| null | https://raw.githubusercontent.com/evturn/haskellbook/3d310d0ddd4221ffc5b9fd7ec6476b2a0731274a/05/chapter-exercises/write-a-type-signature.hs | haskell | 1 .
functionH :: [a] -> a
functionH (x:_) = x
2 .
functionC :: Ord a => a -> a -> Bool
functionC x y = if (x > y) then True else False
3 .
functionS :: (a, b) -> b
functionS (x, y) = y
| |
f6346d43b0ea6c0ae0655860128f17483334b58d3233c603df56993a4c584641 | elbrujohalcon/hPage | helpPage.hs | Welcome to hPage !
-- To start using it, just write some haskell expressions separated by empty lines
-- like the following ones:
12 + 30
length [0..41]
-- Now you can place your cursor on any of them and then press the [Interpret] button below
-- or just use Ctrl-I to get their values or types
-- You can also t... | null | https://raw.githubusercontent.com/elbrujohalcon/hPage/401a039332c7b120f76cbcbd5b33f5dca3d8c369/res/help/helpPage.hs | haskell | To start using it, just write some haskell expressions separated by empty lines
like the following ones:
Now you can place your cursor on any of them and then press the [Interpret] button below
or just use Ctrl-I to get their values or types
You can also type in Type names, like...
...to see their kind, using th... | Welcome to hPage !
12 + 30
length [0..41]
Int
IO
fact x = foldl (*) 1 [1..x]
fact 20
|
13368fe8a3fe3f6a58aec1e23c8f609fccb4083f85d30b038d2e7f3a8f453810 | kframework/haskell-core-semantics | Nats.hs | # LANGUAGE NoImplicitPrelude #
module Nats where
data Nat = Z | S Nat
result = S Z
| null | https://raw.githubusercontent.com/kframework/haskell-core-semantics/6dc257b34993970873cf0ea47f29b3d4fad13b1f/test/haskell/Nats.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Nats where
data Nat = Z | S Nat
result = S Z
| |
43409b4d012a9400b8a008acccabc665daac6e76bf6b3274fc9441664849a69d | ArulselvanMadhavan/haskell-first-principles | Text.Fractions.hs | {-# LANGUAGE OverloadedStrings #-}
module Text.Fractions where
import Control.Applicative
import Data.Attoparsec.Text (parseOnly)
import Data.Ratio ((%))
import Data.String (IsString)
import Text.Trifecta
badFraction :: IsString s => s
badFraction ... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter24/src/Text.Fractions.hs | haskell | # LANGUAGE OverloadedStrings # |
module Text.Fractions where
import Control.Applicative
import Data.Attoparsec.Text (parseOnly)
import Data.Ratio ((%))
import Data.String (IsString)
import Text.Trifecta
badFraction :: IsString s => s
badFraction = "1/0"
alsoBad :: IsString s => s... |
c97e70ac6919de359b6c30b8f55333b4611ec0e2fac6b6a5274eb923c5af1e18 | tezos/tezos-mirror | michelson_types.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 - 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/32c9ef7c4ad3c6ec14e16ab3d75e353266925fb1/src/proto_alpha/lib_benchmarks_proto/michelson_types.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 - 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN... |
d1ea6bf67aad1dcad024d760765dd04d57bd186abd79ccb55e9ab5d2faa212f7 | matthewdowney/excel-clj | tree.clj | (ns excel-clj.tree
"Trees are maps, leaves are maps of something->(not a map).
Use ordered maps (like array-map) to enforce order."
{:author "Matthew Downey"}
(:require [clojure.walk :as walk])
(:import (clojure.lang Named)))
(defn leaf?
"A leaf is any map whose values are not maps."
[x]
(and (map? x... | null | https://raw.githubusercontent.com/matthewdowney/excel-clj/0ca12883bbd3a253f1c15f776227f38bf782a85f/src/excel_clj/tree.clj | clojure |
=> {:btc 4, :xrp 0}
=> {:btc 0, :mxn -1}
header
children
total
For example
Render as tables
Do some math to subtract liabilities from assets
this should give us the equity amount
Print a more complex table illustrating that math | (ns excel-clj.tree
"Trees are maps, leaves are maps of something->(not a map).
Use ordered maps (like array-map) to enforce order."
{:author "Matthew Downey"}
(:require [clojure.walk :as walk])
(:import (clojure.lang Named)))
(defn leaf?
"A leaf is any map whose values are not maps."
[x]
(and (map? x... |
45b74a0d243ceb3da498c3cdcf044d4209f50e40a501d3188acdac09bbb674c3 | yetibot/yetibot | json.clj | (ns yetibot.test.commands.json
(:require
[clojure.data.json :as json]
[midje.sweet :refer [fact =>]]
[yetibot.commands.json :refer :all]))
(fact convert-keys-to-keywords-when-parsing-json
(let [args {:match ["" "{\"key\": \"value\"}"]}]
(json-parse-cmd args) => {:key "value"}))
(fact return-value-... | null | https://raw.githubusercontent.com/yetibot/yetibot/2fb5c1182b1a53ab0e433d6bab2775ebd43367de/test/yetibot/test/commands/json.clj | clojure | (ns yetibot.test.commands.json
(:require
[clojure.data.json :as json]
[midje.sweet :refer [fact =>]]
[yetibot.commands.json :refer :all]))
(fact convert-keys-to-keywords-when-parsing-json
(let [args {:match ["" "{\"key\": \"value\"}"]}]
(json-parse-cmd args) => {:key "value"}))
(fact return-value-... | |
5a172f32080bc7e6af88562580215066b82dd2958bb271e84aedd7df3f63c74f | juxt/jig | project.clj | Copyright © 2013 , JUXT LTD . All Rights Reserved .
;;
;; 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 b... | null | https://raw.githubusercontent.com/juxt/jig/3997887e5a56faadb1b48eccecbc7034b3d31e41/console/project.clj | clojure |
The use and distribution terms for this software are covered by the
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 this notice, or any other, from this software.
... | Copyright © 2013 , JUXT LTD . All Rights Reserved .
Eclipse Public License 1.0 ( -1.0.php )
(load-file "project-header.clj")
(def version (get-version))
(defproject jig/console version
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
... |
173c019180749b5dd660e141514bae3162a173e06722da6f58c58ab23a68aea7 | rtoy/ansi-cl-tests | package-nicknames.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Apr 25 07:51:26 1998
;;;; Contains: Tests of PACKAGE-NICKNAMES
(in-package :cl-test)
(declaim (optimize (safety 3)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; package-nicknames
(deftest package-nicknames.1
(progn
(set-up-packages)
(package-nickna... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/package-nicknames.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of PACKAGE-NICKNAMES
package-nicknames
(find-package n) == p for each n in (package-nicknames p),
for any package p
Error tests | Author :
Created : Sat Apr 25 07:51:26 1998
(in-package :cl-test)
(declaim (optimize (safety 3)))
(deftest package-nicknames.1
(progn
(set-up-packages)
(package-nicknames "A"))
("Q"))
(deftest package-nicknames.2
(progn
(set-up-packages)
(package-nicknames #\A))
("Q"))
(deftest p... |
0c867e3b7c84e4f98d36f79f9f4c32f9960f9e298b26c5bc2e8daf763898f271 | NorfairKing/dekking | TopLevel.hs | module TopLevel where
main :: IO ()
main = do
covered
coveredWithArg 5
covered :: IO ()
covered = pure ()
coveredWithArg :: Int -> IO ()
coveredWithArg _ = pure ()
uncovered :: IO ()
uncovered = pure ()
uncoveredWithArg :: Int -> IO ()
uncoveredWithArg _ = pure ()
| null | https://raw.githubusercontent.com/NorfairKing/dekking/0b24602f9762edc203f65168fc8c09e7291b4a4b/e2e-test/syntax/src/TopLevel.hs | haskell | module TopLevel where
main :: IO ()
main = do
covered
coveredWithArg 5
covered :: IO ()
covered = pure ()
coveredWithArg :: Int -> IO ()
coveredWithArg _ = pure ()
uncovered :: IO ()
uncovered = pure ()
uncoveredWithArg :: Int -> IO ()
uncoveredWithArg _ = pure ()
| |
fe3ae2f90e0663e93fe816085827994983ad19c23d33a8c214358e89018f5ff5 | bennn/dissertation | benv.rkt | #lang racket/base
;; Binding environment,
;; helper functions
(require
"structs.rkt"
)
(provide
(struct-out Closure)
(struct-out Binding)
empty-benv
benv-lookup
benv-extend
benv-extend*
)
;; =============================================================================
;; -- private
( define - type B... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/jfp-2019/benchmarks/kcfa/untyped/benv.rkt | racket | Binding environment,
helper functions
=============================================================================
-- private
-- structs
: BEnv]))
: Time]))
-- public
(: empty-benv BEnv) | #lang racket/base
(require
"structs.rkt"
)
(provide
(struct-out Closure)
(struct-out Binding)
empty-benv
benv-lookup
benv-extend
benv-extend*
)
( define - type BEnv ( HashTable ) )
( define - type Addr Binding )
( define - type Time ( Listof Label ) )
(struct Closure
: ]
))
(struct Binding
: ]... |
5b58b1d02ae0f2d986f71b17ab59fe048ced1376ba640330d796467c8d65e3ec | BJTerry/mailchimp | Util.hs | -- |
Utility functions for Mailchimp
--
module Web.Mailchimp.Util
where
import Control.Monad (mzero)
import Data.Aeson (ToJSON(..), FromJSON(..), Value(..), object)
import Data.Text (pack, unpack)
import Data.Char (isAlpha, toLower, isUpper)
import Data.Time.Clock (UTCTime)
import Data.Time.Format (formatTime,... | null | https://raw.githubusercontent.com/BJTerry/mailchimp/40ead48cf0e16c17dfaad63d4d74990c1cc79ae6/Web/Mailchimp/Util.hs | haskell | |
| Creates Aeson objects after filtering to remove null values.
| Converts camelcase identifiers to underscored identifiers | Utility functions for Mailchimp
module Web.Mailchimp.Util
where
import Control.Monad (mzero)
import Data.Aeson (ToJSON(..), FromJSON(..), Value(..), object)
import Data.Text (pack, unpack)
import Data.Char (isAlpha, toLower, isUpper)
import Data.Time.Clock (UTCTime)
import Data.Time.Format (formatTime, parseTi... |
5c9afee713afe590a3e5596612f661115b1f8c3eddd37b5a2ebfce397cb09a84 | erp12/schema-inference | build.clj | (ns build
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(defn tests
[opts]
(bb/run-tests opts))
| null | https://raw.githubusercontent.com/erp12/schema-inference/ce0a18fa49e0ca59b3fc2e65280cfe3520f06bcd/build.clj | clojure | (ns build
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(defn tests
[opts]
(bb/run-tests opts))
| |
0417fd315af87355cc11178cdf76232425d0323671ef93cacc7c7db5db61547e | silent-entertainment/claxiom | notebook.lisp | (in-package #:claxiom)
(define-json-handler (claxiom/notebook/export) ((book :notebook) (format :export-format))
(hash
:contents (export-as format book)
:mimetype (mimetype-of format)
:name (filename-of format book)))
(define-json-handler (claxiom/notebook/fork-at) ((book :notebook) (index :integer))
(le... | null | https://raw.githubusercontent.com/silent-entertainment/claxiom/44c6122ec46859fd881772bfc24ca3a141fb153a/src/ui/http-api/notebook.lisp | lisp | (in-package #:claxiom)
(define-json-handler (claxiom/notebook/export) ((book :notebook) (format :export-format))
(hash
:contents (export-as format book)
:mimetype (mimetype-of format)
:name (filename-of format book)))
(define-json-handler (claxiom/notebook/fork-at) ((book :notebook) (index :integer))
(le... | |
36a50a72604314453ed367e1c47699dd2f02852d46e59e670542a8bf5a935e51 | project-oak/hafnium-verification | Match.mli |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/biabduction/Match.mli | ocaml | TODO: missing documentation
* Type for a hpred pattern. [flag=false] means that the implication between hpreds is not
considered, and [flag = true] means that it is considered during pattern matching. |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
a481cd5161891256ad247d33245814c1c46ef60bf250b2e00ab2d3e998179e6c | hdevtools/hdevtools | SampleError.hs | -- Sample Module used for testing
-- This module should cause a compilation error:
--
-- Sample2.hs:9:1: parse error (possibly incorrect indentation)
module SampleError where
a = foo
| null | https://raw.githubusercontent.com/hdevtools/hdevtools/a866f017b74f4b27fabda0861f635da82e43d9fe/tests/SampleError.hs | haskell | Sample Module used for testing
This module should cause a compilation error:
Sample2.hs:9:1: parse error (possibly incorrect indentation) |
module SampleError where
a = foo
|
b1779715f2d38525e0413b37a0937115f3602a1e09b6d655f692ef031478bc4d | HunterYIboHu/htdp2-solution | ex319-substitute.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex319-substitute) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter4/Section19-the-poetry-of-s-expressions/ex319-substitute.rkt | racket | about the language level of this file in a form that our tools can easily process.
data difinitions
An Atom is one of:
– Number
– String
– Symbol
– '()
functions
S-expr Symbol Symbol -> S-expr
Atom Symbol Symbol -> Atom
produces new if at equals old.
substitue all the occurences of old in the sl with
new,... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex319-substitute) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
An S - expr is one of :
– Atom
– SL
... |
03c4877942b7a761dc3358a4fd729140a17287fe27c74deaa5dcc366c21053c9 | d-cent/coracle | marshaller.clj | (ns coracle.marshaller
(:require [clj-time.coerce :as tc]))
(defn- coerce-time [m key-path optional?]
(let [time-value (get-in m key-path)]
(cond
time-value (if-let [time-as-long (-> time-value tc/from-string tc/to-long)]
(assoc-in m key-path time-as-long)
(assoc-in ... | null | https://raw.githubusercontent.com/d-cent/coracle/da10a7d4b557bb2ab6996e09d99cee5f1ba994e9/src/coracle/marshaller.clj | clojure | (ns coracle.marshaller
(:require [clj-time.coerce :as tc]))
(defn- coerce-time [m key-path optional?]
(let [time-value (get-in m key-path)]
(cond
time-value (if-let [time-as-long (-> time-value tc/from-string tc/to-long)]
(assoc-in m key-path time-as-long)
(assoc-in ... | |
95514d372eaedea967619cf1a46a87b4e0e35e8b5da62c9ccf2003c4e3331006 | ProjectMAC/propagators | insertion-order-sets.scm | ;;; ----------------------------------------------------------------------
Copyright 2009 Massachusetts Institute of Technology .
;;; ----------------------------------------------------------------------
This file is part of Propagator Network Prototype .
;;;
Propagator Network Prototype is free software ; you ... | null | https://raw.githubusercontent.com/ProjectMAC/propagators/add671f009e62441e77735a88980b6b21fad7a79/support/insertion-order-sets.scm | scheme | ----------------------------------------------------------------------
----------------------------------------------------------------------
you can
redistribute it and/or modify it under the terms of the GNU
any later version.
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of M... | Copyright 2009 Massachusetts Institute of Technology .
This file is part of Propagator Network Prototype .
General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option )
Propagator Network Prototype is distributed in the hope that it
You should ... |
12684e7371d532a6b17a37acca5bdb02f1f6296802fd89f8f4790c6f6a9142da | ghcjs/jsaddle-dom | XPathException.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.XPathException
(toString, toString_, pattern INVALID_EXPRESSION_ERR,
pattern TYPE_ERR, getCode, getName, ge... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/XPathException.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/XPathException.code Mozilla XPathException.code documentation> | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.XPathException
(toString, toString_, pattern INVALID_EXPRESSION_ERR,
pattern TYPE_ERR, getCode, getName, getMessage, XPathException(..),
gTypeXPathException)
where
import Prelude ((.), (==), ... |
82f53baa57a899d14b26cbaa6fc80c5e5b9d9cc0f9ee4393cd6a2be0d90e3b0b | brendanhay/gogol | Get.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-tagmanager/gen/Gogol/TagManager/Accounts/Containers/Workspaces/Templates/Get.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Gets a GTM Template.
/See:/ <-manager Tag Manager API Reference> for @tagmanager.accounts.containers.workspaces.templates.get@.
* Resource
** Constructing a Request
| A resource alias for @tagmanager.accounts.containers.works... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
f17b69c1b3f30b3ced0ec804981d9b2f2a2cc2eec2fb5b4ecdd19e65c564de4a | mfikes/fifth-postulate | ns124.cljs | (ns fifth-postulate.ns124)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns124.cljs | clojure | (ns fifth-postulate.ns124)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
94c902a0f9cbb68212c53394c56c30ecf75364931ad22ffbb2a99e8574629af2 | nunchaku-inria/nunchaku | ElimMultipleEqns.ml |
(* This file is free software, part of nunchaku. See file "license" for more details. *)
* { 1 Merge Multiple Equations into One }
open Nunchaku_core
module TI = TermInner
module Stmt = Statement
module Subst = Var.Subst
module T = Term
module PStmt = Statement.Print(T)(T)
module TyMo = TypeMono.Default
type ty = ... | null | https://raw.githubusercontent.com/nunchaku-inria/nunchaku/16f33db3f5e92beecfb679a13329063b194f753d/src/transformations/ElimMultipleEqns.ml | ocaml | This file is free software, part of nunchaku. See file "license" for more details.
should be a pattern, we will see
no pattern, always succeeds
term being pattern matched on (used in "undefined" cases)
current "path" in the matching
for fresh variables
true/false/wildcard
only accepts variables
all con... |
* { 1 Merge Multiple Equations into One }
open Nunchaku_core
module TI = TermInner
module Stmt = Statement
module Subst = Var.Subst
module T = Term
module PStmt = Statement.Print(T)(T)
module TyMo = TypeMono.Default
type ty = T.t
type term = T.t
type env = (term,ty) Env.t
let name = "elim_multi_eqns"
let section ... |
de73e807ae9da73e48656f4e9de26265de849c877cc778df208864ececa8d528 | vii/dysfunkycom | package.lisp | (defpackage #:dysfunkycom
(:use #:cl #:iterate #:alexandria))
(defpackage :dysfunkycom-test
(:use :cl :iterate :alexandria :dysfunkycom))
(in-package #:dysfunkycom)
(defparameter *show-orbits* nil "A list of orbits to be displayed.")
| null | https://raw.githubusercontent.com/vii/dysfunkycom/a493fa72662b79e7c4e70361ad0ea3c7235b6166/src/package.lisp | lisp | (defpackage #:dysfunkycom
(:use #:cl #:iterate #:alexandria))
(defpackage :dysfunkycom-test
(:use :cl :iterate :alexandria :dysfunkycom))
(in-package #:dysfunkycom)
(defparameter *show-orbits* nil "A list of orbits to be displayed.")
| |
86b344551c78b31a762e1c4747802e9e2fc99b17dcdecc08473ae0383f2ae3dc | McParen/croatoan | key_defined.lisp | (in-package :de.anvi.ncurses)
;; key_defined
;; check if a keycode is defined
;; -island.net/ncurses/man/key_defined.3x.html
;;; C prototypes
;; int key_defined(const char *definition);
;;; Low-level CFFI wrappers
(cffi:defcfun ("key_defined" key-defined) :int (definition :string))
| null | https://raw.githubusercontent.com/McParen/croatoan/413e8855b78a2e408f90efc38e8485f880691684/ncurses/key_defined.lisp | lisp | key_defined
check if a keycode is defined
-island.net/ncurses/man/key_defined.3x.html
C prototypes
int key_defined(const char *definition);
Low-level CFFI wrappers | (in-package :de.anvi.ncurses)
(cffi:defcfun ("key_defined" key-defined) :int (definition :string))
|
878069b76936560f69180f0fef84dc759f4642ea731b773fd94dd3c3bffb9b74 | ashinn/chibi-scheme | special-casing.scm | ;; auto-generated by extract-special-casing.scm
(define special-cases
;; <code> <lower> <title> <upper> [<fold>]
'#(#(#xdf "ß" "Ss" "SS" "ss")
#(#x130 "i̇" "İ" "İ" "i̇")
#(#x149 "ʼn" "ʼN" "ʼN" "ʼn")
#(#x1f0 "ǰ" "J̌" "J̌" "ǰ")
#(#x390 "ΐ" "Ϊ́" "Ϊ́" "ΐ")
#(#x3b0 "ΰ" "Ϋ́" "Ϋ́" "ΰ")
... | null | https://raw.githubusercontent.com/ashinn/chibi-scheme/8b27ce97265e5028c61b2386a86a2c43c1cfba0d/lib/scheme/char/special-casing.scm | scheme | auto-generated by extract-special-casing.scm
<code> <lower> <title> <upper> [<fold>]
TODO: this had to be added by hand |
(define special-cases
'#(#(#xdf "ß" "Ss" "SS" "ss")
#(#x130 "i̇" "İ" "İ" "i̇")
#(#x149 "ʼn" "ʼN" "ʼN" "ʼn")
#(#x1f0 "ǰ" "J̌" "J̌" "ǰ")
#(#x390 "ΐ" "Ϊ́" "Ϊ́" "ΐ")
#(#x3b0 "ΰ" "Ϋ́" "Ϋ́" "ΰ")
#(#x587 "և" "Եւ" "ԵՒ" "եւ")
#(#x1e96 "ẖ" "H̱" "H̱" "ẖ")
#(#x1e97 "ẗ" "T̈" "T̈" ... |
ce6624a19a3ae2e836a2b2bc3265a48ea7e87708651b18a013a4b5c5c3cac3fa | byteally/dbrecord | Window.hs | # LANGUAGE KindSignatures , DataKinds , CPP #
module DBRecord.Internal.Window where
import qualified DBRecord.Internal.PrimQuery as PQ
import DBRecord.Internal.Expr
import DBRecord.Internal.Order
import GHC.TypeLits
newtype Window (w :: Symbol) (sc :: *) (scopes :: [*]) = Window { getPartitions :: PQ.WindowPart }
ne... | null | https://raw.githubusercontent.com/byteally/dbrecord/991efe9a293532ee9242b3e9a26434cf16f5b2a0/dbrecord/src/DBRecord/Internal/Window.hs | haskell |
-- We trust the binary input
instance Binary (Window w sc) where
put = put . getPartitions
get = Window <$> get
| # LANGUAGE KindSignatures , DataKinds , CPP #
module DBRecord.Internal.Window where
import qualified DBRecord.Internal.PrimQuery as PQ
import DBRecord.Internal.Expr
import DBRecord.Internal.Order
import GHC.TypeLits
newtype Window (w :: Symbol) (sc :: *) (scopes :: [*]) = Window { getPartitions :: PQ.WindowPart }
ne... |
71c83e882dec4220a92d453ad60a4ca1a73fc39769ea84cfbce23d7141e9ac87 | elaforge/karya | Signal.hs | Copyright 2016
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
# LANGUAGE GeneralizedNewtypeDeriving #
-- | 'Signal' implementation.
module Synth.Shared.Signal (
module Synth.Shared.Signal, module Perform.Signal
) where
import Perform.Signal hidi... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Synth/Shared/Signal.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| 'Signal' implementation. | Copyright 2016
# LANGUAGE GeneralizedNewtypeDeriving #
module Synth.Shared.Signal (
module Synth.Shared.Signal, module Perform.Signal
) where
import Perform.Signal hiding (Signal, Tempo, Warp, Control, Display)
import qualified Perform.Signal as Signal
type Signal = Signal.Control
|
14f8fb481e18d13b784e31c05eb4fb00339c4d787b1bd5a1ee0aaa57ce76ee11 | bvaugon/obytelib | strsec.ml | (*************************************************************************)
(* *)
(* OByteLib *)
(* *)
... | null | https://raw.githubusercontent.com/bvaugon/obytelib/1b5de4e010ff2be6ab4e38c394ca5b669d6d33ef/src/strsec.ml | ocaml | ***********************************************************************
OByteLib
... |
This file is distributed under the terms of the CeCILL license .
module Make(S : sig val section : Section.t end) = struct
type t = string array
let empty = [||]
let print oc strs =
let print_str i str = Printf.fprintf oc "%4d: %s\n" i ... |
b230a7161d881bb3475456d6e75ab5bf31559675964af6e92d68ae3c2fcd5335 | discus-lang/ddc | Write.hs | # LANGUAGE UndecidableInstances #
module DDC.Data.Write where
import Data.Text (Text)
import qualified Data.Text as T
class Write o a where
write :: o -> a -> IO ()
text :: Write o Text => o -> Text -> IO ()
text o t = write o t
# INLINE text #
string :: Write o Text => o -> String -> IO ()... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Data/Write.hs | haskell | # LANGUAGE UndecidableInstances #
module DDC.Data.Write where
import Data.Text (Text)
import qualified Data.Text as T
class Write o a where
write :: o -> a -> IO ()
text :: Write o Text => o -> Text -> IO ()
text o t = write o t
# INLINE text #
string :: Write o Text => o -> String -> IO ()... | |
2603dfbb0ce47435cab6f8c74b77dc991a067890618f9491e53be07d10de0639 | reach-sh/reach-lang | Optimize.hs | module Reach.Optimize (optimize_, optimize, opt_sim, Optimize) where
import Control.Monad.Reader
import qualified Data.Aeson as AS
import Data.IORef
import qualified Data.Map.Strict as M
import Data.Maybe
import qualified Data.Set as S
import Reach.AST.Base
import Reach.AST.DLBase
import Reach.AST.LL
import Reach.AST.... | null | https://raw.githubusercontent.com/reach-sh/reach-lang/f79282c49705c66fc10489045d502d17621d60c5/hs/src/Reach/Optimize.hs | haskell | False
True -- False
Returns `Nothing` if there are impure stmts in `a` or there is no `DL_Set`
we generated a `const` assign, now drop this `var`.
Track that we successfully lifted this assignment
# OVERLAPS #
# OVERLAPS #
# OVERLAPS #
Opt:
const x = xs[idx];
const xs' = xs.set(idx, x);
=>
const xs' = xs
... | module Reach.Optimize (optimize_, optimize, opt_sim, Optimize) where
import Control.Monad.Reader
import qualified Data.Aeson as AS
import Data.IORef
import qualified Data.Map.Strict as M
import Data.Maybe
import qualified Data.Set as S
import Reach.AST.Base
import Reach.AST.DLBase
import Reach.AST.LL
import Reach.AST.... |
6db657c53404b88990a121840c5fc0de8617bf58edf864edee26d2643c12439a | hercules-ci/hercules-ci-agent | JobConfig.hs | {-# LANGUAGE DeriveAnyClass #-}
module Hercules.API.Agent.Evaluate.EvaluateEvent.JobConfig where
import Hercules.API.Prelude
data JobConfig = JobConfig
{ sourceCaches :: Maybe [Text],
binaryCaches :: Maybe [Text]
}
deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON)
| null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/8a476e9328d197d0d41872b1674638827e18bae0/hercules-ci-api-agent/src/Hercules/API/Agent/Evaluate/EvaluateEvent/JobConfig.hs | haskell | # LANGUAGE DeriveAnyClass # |
module Hercules.API.Agent.Evaluate.EvaluateEvent.JobConfig where
import Hercules.API.Prelude
data JobConfig = JobConfig
{ sourceCaches :: Maybe [Text],
binaryCaches :: Maybe [Text]
}
deriving (Generic, Show, Eq, NFData, ToJSON, FromJSON)
|
466b52a170ff34b8924ffc4e3fea4e75b291f14ad7942a29cc5180b883827af8 | kishanov/re-frame-spec-forms-example | state.cljs | (ns re-frame-spec-forms.steps.state
(:require [re-frame.core :as re-frame]
[reagent.core :as reagent]
[re-frame-spec-forms.formatters :as formatters]
[forms.core :as forms]
[re-frame-spec-forms.steps.label-input :as label-input]
[re-frame-spec-forms.steps.r... | null | https://raw.githubusercontent.com/kishanov/re-frame-spec-forms-example/275637cb11fb992f9c6ff6d76ca06daebc22098a/src/cljs/re_frame_spec_forms/steps/state.cljs | clojure | (ns re-frame-spec-forms.steps.state
(:require [re-frame.core :as re-frame]
[reagent.core :as reagent]
[re-frame-spec-forms.formatters :as formatters]
[forms.core :as forms]
[re-frame-spec-forms.steps.label-input :as label-input]
[re-frame-spec-forms.steps.r... | |
0b10323c148579877ab65f49cac388742557d9b9a39c8a17b463f67b91b89872 | racket/typed-racket | threads-and-channels.rkt | #lang typed/racket
(: chan (Channelof Symbol))
(define chan (make-channel))
(define (reader)
(thread
(lambda ()
(let: loop : True ((i : Integer 10))
(if (= i 0)
#t
(begin (channel-get chan)
(loop (- i 1))))))))
(: writer (Symbol -> Thread))
(define (writer x)
... | null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/succeed/threads-and-channels.rkt | racket | #lang typed/racket
(: chan (Channelof Symbol))
(define chan (make-channel))
(define (reader)
(thread
(lambda ()
(let: loop : True ((i : Integer 10))
(if (= i 0)
#t
(begin (channel-get chan)
(loop (- i 1))))))))
(: writer (Symbol -> Thread))
(define (writer x)
... | |
967cc7f71ccee8e25acf000f9120caef2c20c9b53362a495f9c2264c8da28036 | magnolia-lang/magnolia-lang | Monad.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
module Monad (
-- * MgMonad utils
MgMonad
, runMgMonad
-- ** MgMonad scope-related utils
, enter
, getParentPackageName
, getParentModuleName
-- ** MgMonad error-related utils
, foldMAccumErrors
, foldMAccumErrorsAndFail
... | null | https://raw.githubusercontent.com/magnolia-lang/magnolia-lang/bed4f48e7dedc75a649a7347fe18dca1f5495a3b/src/lib/Monad.hs | haskell | # LANGUAGE OverloadedStrings #
* MgMonad utils
** MgMonad scope-related utils
** MgMonad error-related utils
* Reexport error utils
=== magnolia monad utils ===
| A monad transformer wrapping the minimum stack of monads required within
the compiler.
| Retrieves the state within a MgMonadT.
| Modifies the state... | # LANGUAGE GeneralizedNewtypeDeriving #
module Monad (
MgMonad
, runMgMonad
, enter
, getParentPackageName
, getParentModuleName
, foldMAccumErrors
, foldMAccumErrorsAndFail
, recover
, recoverWithDefault
, throwLocatedE
, throwNonLocatedE
, Err (..)
, ErrType (..)
)
where
import Contr... |
1bf992d617ded8c8be8ea649aa2ee967c72254e43b5e678e3ae2701ade15823e | brandonchinn178/advent-of-code | Day6.hs | {- stack script
--resolver lts-14.12
-}
{-# OPTIONS_GHC -Wall -Werror #-}
{-# LANGUAGE BangPatterns #-}
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
import Data.Array ((!))
import qualified Data.Array as Array
import qualified Data.Graph as Graph
import qualified Data.Map.Strict as Map
main :: IO ()... | null | https://raw.githubusercontent.com/brandonchinn178/advent-of-code/a4b0616f8764620e28759276c333fe37d6685d57/2019/Day6.hs | haskell | stack script
--resolver lts-14.12
# OPTIONS_GHC -Wall -Werror #
# LANGUAGE BangPatterns #
get the planet the given person is orbitting around
Graph
need this in case of nodes without any outgoing edges, since graphFromEdges
ignores keys in the outlist that don't correspond to nodes in the graph |
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
import Data.Array ((!))
import qualified Data.Array as Array
import qualified Data.Graph as Graph
import qualified Data.Map.Strict as Map
main :: IO ()
main = do
input <- mkGraph . map (fmap tail . break (== ')')) . lines <$> readFile "Day6.txt"
print $ ... |
cdb69f3e5d61c337323c63f43920584da16e34e693d23879c4b9d155290ed970 | FlowForwarding/LINC-Switch | linc_us5_convert_tests.erl | %%------------------------------------------------------------------------------
Copyright 2012 FlowForwarding.org
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%... | null | https://raw.githubusercontent.com/FlowForwarding/LINC-Switch/9c28e7c8677c03440a62023292dd700fef0c3420/apps/linc_us5/test/linc_us5_convert_tests.erl | erlang | ------------------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe... | Copyright 2012 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2012 FlowForwarding.org
-module(linc_us5_convert_tests).
-import(linc_us5_test_utils, [mock/1,
... |
7127eae1b85396e575012eb443d0a2f6d42412b679b5331747ef27b753c115e8 | pbrisbin/renters-reality | Grade.hs | module Helpers.Grade
( Grade(..)
, prettyGrade
, gpa
) where
import Prelude
import Database.Persist.TH
import Data.Text (Text)
data Grade = Aplus | A | Aminus
| Bplus | B | Bminus
| Cplus | C | Cminus
| Dplus | D | Dminus
| F deriving (Eq, Ord, Read, Show)
... | null | https://raw.githubusercontent.com/pbrisbin/renters-reality/2e20e4ab3f47a62d0bad75f49d5e6beee1d81648/Helpers/Grade.hs | haskell | /~dons/blog/2008/05/16#fast | module Helpers.Grade
( Grade(..)
, prettyGrade
, gpa
) where
import Prelude
import Database.Persist.TH
import Data.Text (Text)
data Grade = Aplus | A | Aminus
| Bplus | B | Bminus
| Cplus | C | Cminus
| Dplus | D | Dminus
| F deriving (Eq, Ord, Read, Show)
... |
02562236acee11c98f22796bca82affe7adcd9ede46db09638ee2d2791d8f70b | overtone/overtone | getonthebus.clj | (ns overtone.examples.buses.getonthebus
(:use overtone.live))
;; Buses are like wires or pipes that you can use to connect the output
of one synth to the inputs of one or more other synths .
There are two types of buses - control buses and audio buses .
;; Control buses are designed to carry control signals - v... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/src/overtone/examples/buses/getonthebus.clj | clojure | Buses are like wires or pipes that you can use to connect the output
Control buses are designed to carry control signals - values changing
at a human rate (i.e. the speed you may turn a dial or slide a slider).
Audio buses are designed to carry audio signals - values changing at
a rate that makes them audible.
Au... | (ns overtone.examples.buses.getonthebus
(:use overtone.live))
of one synth to the inputs of one or more other synths .
There are two types of buses - control buses and audio buses .
60 times a second .
will start with one audio bus per audio input and one audio bus per audio
output . For example , your... |
fbd01b9576d6a77ba78f8a21e5edcbfcb2f7da99b29aed9c4f56fc7a72782aad | jayrbolton/coursework | Hw3.hs | -- Homework 3
-- J Bolton
module Hw3 where
import Funcs {-include my functions from all previous exercises-}
Exercise 4.4
howManyOfFourEqual :: Int -> Int -> Int -> Int -> Int
howManyOfFourEqual a b c d
| fourDifferent a b c d = 0
| fourEqual a b c d = 4
| (threeEqual a b c) || (threeEqual b c ... | null | https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computer_science_foundations/programming/Q1/hws/hw3/Hw3.hs | haskell | Homework 3
J Bolton
include my functions from all previous exercises
x = value, y = last square, z = next square
test for perfect square
base case, where we've found the square greater than our number
(very difficult to understand what the author wanted here...)
base
base
using the euclidean algorithm, because euc... |
module Hw3 where
Exercise 4.4
howManyOfFourEqual :: Int -> Int -> Int -> Int -> Int
howManyOfFourEqual a b c d
| fourDifferent a b c d = 0
| fourEqual a b c d = 4
| (threeEqual a b c) || (threeEqual b c d) || (threeEqual c d a) || (threeEqual a b d) = 3
| otherwise = 2
Exercise 4.... |
2c59d7f92bb75c102a66ea2f66960751833795001266af409be577e19ad6c8cc | nasa/Common-Metadata-Repository | concept.clj | (ns cmr.metadata.proxy.components.concept
"This namespace represents the 'concept query' API for CMR OPeNDAP. This is
where the rest of the application goes when it needs to perform a query to
CMR to get concept data. This is done in order to cache concepts and use
these instead of making repeated queries to th... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/3215ee6945cb1fa82499c3c3d74841c3284eec6e/other/cmr-exchange/metadata-proxy/src/cmr/metadata/proxy/components/concept.clj | clojure |
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
if there is a miss,
Concept Component API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Component Lifecycle Implementation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Component Constructor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | (ns cmr.metadata.proxy.components.concept
"This namespace represents the 'concept query' API for CMR OPeNDAP. This is
where the rest of the application goes when it needs to perform a query to
CMR to get concept data. This is done in order to cache concepts and use
these instead of making repeated queries to th... |
f138f6d61c11ca6cc497488e25a3f2d2d05748f68b2bae03613b44492e19298d | stan-dev/stanc3 | Canonicalize.ml | open Core_kernel
open Ast
open Deprecation_analysis
type canonicalizer_settings =
{deprecations: bool; parentheses: bool; braces: bool; inline_includes: bool}
let all =
{deprecations= true; parentheses= true; inline_includes= true; braces= true}
let none =
{ deprecations= false
; parentheses= false
; inlin... | null | https://raw.githubusercontent.com/stan-dev/stanc3/1c5a68d3453903e1f0fd4f332cbed12e7231e63c/src/frontend/Canonicalize.ml | ocaml | Flatten if ... else if ... constructs | open Core_kernel
open Ast
open Deprecation_analysis
type canonicalizer_settings =
{deprecations: bool; parentheses: bool; braces: bool; inline_includes: bool}
let all =
{deprecations= true; parentheses= true; inline_includes= true; braces= true}
let none =
{ deprecations= false
; parentheses= false
; inlin... |
ea596f96f9d729b732683c546d2928a5d8b4447022b2ec228fbeb5e8f9aa4f44 | ml4tp/tcoq | feedback.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/lib/feedback.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Coq "semantic" infos obtained duri... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Xml_datatype
Old plai... |
a8bd483391b7c0542abff79dd044b6d881c7c41490f05c5490a7cc2563e98e18 | cedlemo/OCaml-GI-ctypes-bindings-generator | Icon_view_accessible_private.ml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Icon_view_accessible_private"
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Icon_view_accessible_private.ml | ocaml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Icon_view_accessible_private"
| |
dff7bc7cfdb32be53dd55553df3ed90cc579327fcd44f29fb3f3484ca6fd5a49 | Beluga-lang/Beluga | debug.mli | File : Debug.sml
Author : ,
Contents : Debug - print library with up to 31 separate categories of information .
Usage :
- show , showAll , showNone determine which categories will be printed .
- In each client module , create debug - printer functions by calling ` makeFunctions ' :
... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/43dbf613ed7158372ad21e52bdd53841ea31505e/src/support/debug.mli | ocaml | * Tests if a given flag is set. | File : Debug.sml
Author : ,
Contents : Debug - print library with up to 31 separate categories of information .
Usage :
- show , showAll , showNone determine which categories will be printed .
- In each client module , create debug - printer functions by calling ` makeFunctions ' :
... |
2631925c0902cd427850991ad0ab378c7f251fcaec57f570ca81d8c25f0eeeea | foreverbell/project-euler-solutions | 120.hs | import Common.List (maximumBy')
import Data.Function (on)
rMax :: Int -> Int
rMax a = f $ maximumBy' (compare `on` f) $ take m $ iterate (\(x, y) -> (x * (a - 1) `mod` m, y * (a + 1) `mod` m)) (1, 1)
where
m = a*a
f (a, b) = (a + b) `mod` m
main = print $ sum $ map rMax [3 .. 1000]
| null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/120.hs | haskell | import Common.List (maximumBy')
import Data.Function (on)
rMax :: Int -> Int
rMax a = f $ maximumBy' (compare `on` f) $ take m $ iterate (\(x, y) -> (x * (a - 1) `mod` m, y * (a + 1) `mod` m)) (1, 1)
where
m = a*a
f (a, b) = (a + b) `mod` m
main = print $ sum $ map rMax [3 .. 1000]
| |
d3cdad44709031ed9aa873234a379e7b5ff87855c4091613fa16b09a163e7142 | nasser/magic | propagate_bindings.clj | (ns magic.analyzer.propagate-bindings
(:require
[clojure.tools.analyzer.ast :refer [prewalk]]
[magic.analyzer [intrinsics :as intrinsics]]))
(defn propagate-bindings
"Propagate bindings into locals"
{:pass-info {:walk :post :after #{#'intrinsics/analyze}}}
[{:keys [op] :as ast}]
(case op
(:let :loo... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/src/magic/analyzer/propagate_bindings.clj | clojure | (ns magic.analyzer.propagate-bindings
(:require
[clojure.tools.analyzer.ast :refer [prewalk]]
[magic.analyzer [intrinsics :as intrinsics]]))
(defn propagate-bindings
"Propagate bindings into locals"
{:pass-info {:walk :post :after #{#'intrinsics/analyze}}}
[{:keys [op] :as ast}]
(case op
(:let :loo... | |
6fa00f5ea20dfcb2730717547c8f02b229cc1769060e8ac77800bbe45725b195 | Kalimehtar/gir | base.rkt | #lang racket/base
(require "loadlib.rkt" ffi/unsafe ffi/unsafe/alloc racket/function)
(provide _info g-base-info-get-name g-base-info-get-type)
(define-gi* g-base-info-unref (_fun _pointer -> _void)
#:wrap (deallocator))
(define-gi* g-base-info-get-name (_fun _pointer -> _string))
(define-gi* g-base-info-get-type ... | null | https://raw.githubusercontent.com/Kalimehtar/gir/80954f0ba563229748bbbe413d50343ca89f9dbe/gir/base.rkt | racket | #lang racket/base
(require "loadlib.rkt" ffi/unsafe ffi/unsafe/alloc racket/function)
(provide _info g-base-info-get-name g-base-info-get-type)
(define-gi* g-base-info-unref (_fun _pointer -> _void)
#:wrap (deallocator))
(define-gi* g-base-info-get-name (_fun _pointer -> _string))
(define-gi* g-base-info-get-type ... | |
b01892fe3838402fa6009e192c319d198dcf0e53cab682cd2cfec59dcdd0f9ba | defndaines/meiro | eller.clj | (ns meiro.eller
"Eller's algorithm generates a forest row-by-row, combining all the forests at
the end into a single result. It behaves like Sidewinder in that it can merge
cells left to right, but then only one passage will link south."
(:require [meiro.core :as m]
[meiro.graph :as graph]
... | null | https://raw.githubusercontent.com/defndaines/meiro/f91d4dee2842c056a162c861baf8b71bb4fb140c/src/meiro/eller.clj | clojure | (ns meiro.eller
"Eller's algorithm generates a forest row-by-row, combining all the forests at
the end into a single result. It behaves like Sidewinder in that it can merge
cells left to right, but then only one passage will link south."
(:require [meiro.core :as m]
[meiro.graph :as graph]
... | |
8342621fd7233889a21b3afdfb4cc771b91f6c3940321888929f0b45c92ffd1e | karimarttila/clojure | user_service.clj | (ns simpleserver.service.user.user-service
"Provides simplified access to user functions."
(:require [simpleserver.service.service :as ss-service]
[simpleserver.service.user.user-interface :as ss-user-i]))
(defn- get-service [env]
(ss-service/get-service env :user))
(defn email-already-exists? [env ... | null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/webstore-demo/integrant-simple-server/src/clj/simpleserver/service/user/user_service.clj | clojure | (ns simpleserver.service.user.user-service
"Provides simplified access to user functions."
(:require [simpleserver.service.service :as ss-service]
[simpleserver.service.user.user-interface :as ss-user-i]))
(defn- get-service [env]
(ss-service/get-service env :user))
(defn email-already-exists? [env ... | |
98c236768be7b22e99730951e43251cc467ba008f3b73efcebedceffe34048c3 | OlivierSohn/hamazed | Animation.hs | TODO refactor and doc
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.UI.Animation
( mkUIAnimation
, getDeltaTime
, drawUIAnimation
, mkTextAnimRightAligned
-- reexports
, module Imj.Graphics.UI.Animation.Types
) where
import ... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-base/src/Imj/Graphics/UI/Animation.hs | haskell | reexports
| Compute the time interval between the current frame and the next.
^ From
^ To
^ Time at which the animation starts
slow down if distances are bigger
^ From
^ To
^ Upper text, Lower text, Left texts
Text will be horizontally right-aligned and vertically centered according to
alignment coordinates... | TODO refactor and doc
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.UI.Animation
( mkUIAnimation
, getDeltaTime
, drawUIAnimation
, mkTextAnimRightAligned
, module Imj.Graphics.UI.Animation.Types
) where
import Imj.Prelude hiding(left... |
ec2bf087038590f0cfd872d044667b408b23b0ac65605d6f558e398b9aeac975 | ku-fpg/kansas-lava | Example.hs | # LANGUAGE ScopedTypeVariables , GADTs , KindSignatures , RankNTypes , FlexibleInstances ,
RecursiveDo , DoRec , FlexibleContexts #
RecursiveDo, DoRec, FlexibleContexts #-}
import Language.KansasLava
import Language.KansasLava.Fabric
import Language.KansasLava.Spark
import Language.KansasLava.VCD
imp... | null | https://raw.githubusercontent.com/ku-fpg/kansas-lava/cc0be29bd8392b57060c3c11e7f3b799a6d437e1/examples/vars/Example.hs | haskell |
assign xxx (xxx + 1)
setProbesAsTrace $ appendFile "DEBUG.out"
system "rm graph.ps"
system "dot -Tps < graph.dot > graph.ps"
system "open -a Skim graph.ps"
TODO : call assignable
something that can be both read and written to
TODO: call assignable
something that can be both ... | # LANGUAGE ScopedTypeVariables , GADTs , KindSignatures , RankNTypes , FlexibleInstances ,
RecursiveDo , DoRec , FlexibleContexts #
RecursiveDo, DoRec, FlexibleContexts #-}
import Language.KansasLava
import Language.KansasLava.Fabric
import Language.KansasLava.Spark
import Language.KansasLava.VCD
imp... |
2693989e462c491b8f7a0b842d58f3a97277a5bb97f26a5c0ce4661971c5e771 | NorfairKing/smos | GetListBackupsSpec.hs | module Smos.Server.Handler.GetListBackupsSpec
( spec,
)
where
import Smos.Client
import Smos.Data.Gen ()
import Smos.Server.InterestingStore
import Smos.Server.TestUtils
import Test.QuickCheck
import Test.Syd
import Test.Syd.Validity
spec :: Spec
spec =
describe "GetListBackups" $ do
serverSpec $
it "... | null | https://raw.githubusercontent.com/NorfairKing/smos/a3ed8fdbcb8f298bc49866bf6d0ee59a964ba0da/smos-server-gen/test/Smos/Server/Handler/GetListBackupsSpec.hs | haskell | module Smos.Server.Handler.GetListBackupsSpec
( spec,
)
where
import Smos.Client
import Smos.Data.Gen ()
import Smos.Server.InterestingStore
import Smos.Server.TestUtils
import Test.QuickCheck
import Test.Syd
import Test.Syd.Validity
spec :: Spec
spec =
describe "GetListBackups" $ do
serverSpec $
it "... | |
c164b8ec422303c036c058e6f1a84751c7b642505c1d01932757285043d04bc7 | input-output-hk/marlowe-cardano | Web.hs | module Language.Marlowe.Runtime.Web
( module Language.Marlowe.Runtime.Web.API
, module Language.Marlowe.Runtime.Web.Types
) where
import Language.Marlowe.Runtime.Web.API
import Language.Marlowe.Runtime.Web.Types
| null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/0daada2f75d940a5b9b5eaee3c41d17b9fded03f/marlowe-runtime-web/src/Language/Marlowe/Runtime/Web.hs | haskell | module Language.Marlowe.Runtime.Web
( module Language.Marlowe.Runtime.Web.API
, module Language.Marlowe.Runtime.Web.Types
) where
import Language.Marlowe.Runtime.Web.API
import Language.Marlowe.Runtime.Web.Types
| |
0f7a25eaa6e6dfa40844bf06db0dbd08121c7e6597da0f9d06e5853a6906a6b7 | bjornbm/dimensional | DimensionalSpec.hs | module Numeric.Units.DimensionalSpec where
import Numeric.Units.Dimensional.Prelude
import Test.Hspec
import qualified Prelude as P
spec :: Spec
spec = do
describe "Exponentiation operators" $ do
it "correctly exponentiate quantities with integer exponents" $ do
((9::Double) *~ one) `... | null | https://raw.githubusercontent.com/bjornbm/dimensional/fb2d9d6c8351ad283ee75f1ae6bee8e8a0dfb28b/tests/Numeric/Units/DimensionalSpec.hs | haskell | note: these comparison literals use non-breaking spaces | module Numeric.Units.DimensionalSpec where
import Numeric.Units.Dimensional.Prelude
import Test.Hspec
import qualified Prelude as P
spec :: Spec
spec = do
describe "Exponentiation operators" $ do
it "correctly exponentiate quantities with integer exponents" $ do
((9::Double) *~ one) `... |
de5fac47218c11bd0c944d552cd62a07a78ab66e8ec29864d7b65f5e67e8ddc6 | foxford/mqtt-gateway | mqttgw_dyn_srv.erl | -module(mqttgw_dyn_srv).
-behaviour(gen_server).
-export([
init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3
]).
-export([
start/0, stop/0, create_dynsub/4,
authz_subscription_topic/1, authz_broadcast_subscription_topic/1,
delete_dynsub/4, delete_dynsub/2
]).
start()... | null | https://raw.githubusercontent.com/foxford/mqtt-gateway/ebf1b2c172321410bc1a211c903c9b29fcaf626f/src/mqttgw_dyn_srv.erl | erlang | if the subject is subscribed on multiple nodes something went wrong
since we disallow same agent ids
happy case when subject is on the same node as we are
Subject is on a different node, we need to create dynsub on that node.
if the subject is subscribed on multiple nodes something went wrong
since we disallow sa... | -module(mqttgw_dyn_srv).
-behaviour(gen_server).
-export([
init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3
]).
-export([
start/0, stop/0, create_dynsub/4,
authz_subscription_topic/1, authz_broadcast_subscription_topic/1,
delete_dynsub/4, delete_dynsub/2
]).
start()... |
0e2a9cc3e3c272bbbb0f771222ec4710b060deced3cbb9913ed3b59423661700 | iambrj/imin | var_test_8.rkt | (let ([y (let ([x 20])
(+ x (let ([x 22]) x)))])
y)
| null | https://raw.githubusercontent.com/iambrj/imin/baf9e829c2aa85b69a2e86bfba320969ddf05f95/tests/var_test_8.rkt | racket | (let ([y (let ([x 20])
(+ x (let ([x 22]) x)))])
y)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.