_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 |
|---|---|---|---|---|---|---|---|---|
3593da00030129bf93de41f5d7fc60414b1a21e15857a1ece8d0b2b2dd51efd4 | 8c6794b6/haskell-sc-scratch | Repl00.hs | ------------------------------------------------------------------------------
-- |
-- Module : $Header$
CopyRight : ( c ) 8c6794b6
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : non-portable
--
Playing with Shellac package .
--
module Repl00 where
import System.Console.... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Repl/Repl00.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : non-portable
| CopyRight : ( c ) 8c6794b6
Maintainer :
Playing with Shellac package .
module Repl00 where
import System.Console.Shell
import System.Console.Shell.Backend.Haskeline
import System.Console.Shell.ShellMonad
main :: IO ()
main = do
putStrLn "Type ':h' for help, ':q' to quit"
n <- runShell (mkShellDescrip... |
40bc1840d87597bfa7396149769484800e9ab1c249667cb14687a7b4df857c54 | geneweb/geneweb | update.ml | Copyright ( c ) 1998 - 2007 INRIA
open Config
open Def
open Gwdb
open Util
type update_error =
| UERR of Adef.safe_string
| UERR_sex_married of person
| UERR_sex_incoherent of base * person
| UERR_sex_undefined of string * string * int
| UERR_unknow_person of string * string * int
| UERR_already_defined... | null | https://raw.githubusercontent.com/geneweb/geneweb/7b71f8f2f75e0e847818f821a0267938f38c9cf5/lib/update.ml | ocaml | TODO this max_age should be related to private_years_marriage
**************************************************************************
**************************************************************************
*************************************************************************
*************************... | Copyright ( c ) 1998 - 2007 INRIA
open Config
open Def
open Gwdb
open Util
type update_error =
| UERR of Adef.safe_string
| UERR_sex_married of person
| UERR_sex_incoherent of base * person
| UERR_sex_undefined of string * string * int
| UERR_unknow_person of string * string * int
| UERR_already_defined... |
eafd75e8ae9c938ea56cca3ee6e483dae039f640c08cb82a567ae062fbbd1a72 | jasonstolaruk/CurryMUD | InacTimer.hs | # LANGUAGE LambdaCase , OverloadedStrings , ViewPatterns #
module Mud.Threads.InacTimer ( stopInacTimer
, threadInacTimer ) where
import Mud.Data.State.MsgQueue
import Mud.Data.State.MudData
import Mud.Data.State.Util.Misc
import Mud.Data.State.Util... | null | https://raw.githubusercontent.com/jasonstolaruk/CurryMUD/f9775fb3ede08610f33f27bb1fb5fc0565e98266/lib/Mud/Threads/InacTimer.hs | haskell | ==================================================
--- | # LANGUAGE LambdaCase , OverloadedStrings , ViewPatterns #
module Mud.Threads.InacTimer ( stopInacTimer
, threadInacTimer ) where
import Mud.Data.State.MsgQueue
import Mud.Data.State.MudData
import Mud.Data.State.Util.Misc
import Mud.Data.State.Util... |
0e1a659913ceb44a667aed6c4d7bd0db2cf34348d8b45a57ce8fe18ee50156b8 | sicmutils/sicmutils | simpson_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.numerical.quadrature.simpson-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[same :refer [ish?]]
[sicmutils.abstract.function :as f]
[sicmutils.generic :as g :refer [+ ... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/f427fd073937faf62741fcdda6362f910ecda71f/test/sicmutils/numerical/quadrature/simpson_test.cljc | clojure | Richardson extrapolation step with t=2, p=2
Reference: The derivation at the [Simpson's Rule Wikipedia
page](#Averaging_the_midpoint_and_the_trapezoidal_rules) | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.numerical.quadrature.simpson-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[same :refer [ish?]]
[sicmutils.abstract.function :as f]
[sicmutils.generic :as g :refer [+ ... |
0bc38582c6899a2a9deeba7cd5e1c064363b57d60cf3a3fdae5b78fb66f7f8db | iskandr/parakeet-retired | IntervalDomain.ml | type interval =
| IntInterval of Int64.t * Int64.t
| FloatInterval of float * float
let int_range lower upper =
IntInterval (Int64.of_int lower, Int64.of_int upper)
let int_const x = int_range x x
let float_range lower upper = FloatInterval(lower,upper)
let float_const x = float_range x x
... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/GPU/Ptx/IntervalDomain.ml | ocaml | type interval =
| IntInterval of Int64.t * Int64.t
| FloatInterval of float * float
let int_range lower upper =
IntInterval (Int64.of_int lower, Int64.of_int upper)
let int_const x = int_range x x
let float_range lower upper = FloatInterval(lower,upper)
let float_const x = float_range x x
... | |
7e53b14b1adce89bb7f6f37fcfa6f44db90c3625a06257be1a73c319085b7ba5 | ianmbloom/gudni | Fuzzy.hs | # LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
module Graphics.Gudni.Util.Fuzzy
( Fuzzy (..)
, fuzzyBreak
, fuzzyCurve
, fuzzyRadial
, fuzzyGray
, fuzzyCircle
, fuzzyGlyph
, fuzzySquare
)
where
import Graphics.Gudni.Figure
import Graphics.Gudni.... | null | https://raw.githubusercontent.com/ianmbloom/gudni/fa69f1bf08c194effca05753afe5455ebae51234/src/Graphics/Gudni/Util/Fuzzy.hs | haskell | # LANGUAGE TypeSynonymInstances # | # LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
module Graphics.Gudni.Util.Fuzzy
( Fuzzy (..)
, fuzzyBreak
, fuzzyCurve
, fuzzyRadial
, fuzzyGray
, fuzzyCircle
, fuzzyGlyph
, fuzzySquare
)
where
import Graphics.Gudni.Figure
import Graphics.Gudni.Layout
import Control.Monad.Random
imp... |
6aca9f47f0091b148eb9d23a3ccd1fe4fc6d15b2ceb10b2cc12a97be4ad5fa23 | marick/Midje | t_prerequisites.clj | (ns midje.parsing.1-to-explicit-form.t-prerequisites
(:require [midje.parsing.1-to-explicit-form.prerequisites :as prereqs :refer :all]
[midje.sweet :refer :all]
[midje.test-util :refer :all]
[midje.parsing.2-to-lexical-maps.fakes :refer [fake]]
[midje.parsing.2-to-lexi... | null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/test/midje/parsing/1_to_explicit_form/t_prerequisites.clj | clojure | Use of let is to prevent #'fact from slapping a line number onto the results. | (ns midje.parsing.1-to-explicit-form.t-prerequisites
(:require [midje.parsing.1-to-explicit-form.prerequisites :as prereqs :refer :all]
[midje.sweet :refer :all]
[midje.test-util :refer :all]
[midje.parsing.2-to-lexical-maps.fakes :refer [fake]]
[midje.parsing.2-to-lexi... |
28e31f349034420e781abe2c82ce76b256bc8701014f13660b65b8fc221bffcf | jyh/metaprl | cfol_itt_base.ml |
* Base interpretation of the classical first - order logic .
*
* ----------------------------------------------------------------
*
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment for OCaml and other languages .
*
... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/fol/cfol_itt_base.ml | ocaml | Interpretation
Rules for false
Rules for true
Rules for pred |
* Base interpretation of the classical first - order logic .
*
* ----------------------------------------------------------------
*
* This file is part of MetaPRL , a modular , higher order
* logical framework that provides a logical programming
* environment for OCaml and other languages .
*
... |
92cc0a2f8bbe6f80e0bcfe7030fe7ba400dbdb04c0b4c6dc14aa10d4af0d75b8 | nathanielrb/ftmicroKanren | ftmicroKanren.scm | and
;; microKanren, final implementation from paper
;; extended for temporal logic using promises
by
(define (var c) (vector c))
(define (var? x) (vector? x))
(define (var=? x1 x2) (= (vector-ref x1 0) (vector-ref x2 0)))
(define (walk u s)
(let ((pr (and (var? u) (assp (lambda (v) (var=? u v)) s))))
... | null | https://raw.githubusercontent.com/nathanielrb/ftmicroKanren/2f6452e0db959384dd49c250469d03e2f631b3f2/ftmicroKanren.scm | scheme | microKanren, final implementation from paper
extended for temporal logic using promises | and
by
(define (var c) (vector c))
(define (var? x) (vector? x))
(define (var=? x1 x2) (= (vector-ref x1 0) (vector-ref x2 0)))
(define (walk u s)
(let ((pr (and (var? u) (assp (lambda (v) (var=? u v)) s))))
(if pr (walk (cdr pr) s) u)))
(define (ext-s x v s) `((,x . ,v) . ,s))
(define (== u v)
... |
c4b2b77a6ad949745ffcc59d6416746f7b84f6d1a522a6a474607c7071fa06dc | albertoruiz/easyVision | Moments.hs | # LANGUAGE RecordWildCards #
-----------------------------------------------------------------------------
|
Module : Image . Processing . Moments
Copyright : ( c ) 2010
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Module : Image.Proces... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/hvision/src/Image/Processing/Moments.hs | haskell | ---------------------------------------------------------------------------
--------------------------------------------------------------------------- | # LANGUAGE RecordWildCards #
|
Module : Image . Processing . Moments
Copyright : ( c ) 2010
License : GPL
Maintainer : ( aruiz at um dot es )
Stability : provisional
Module : Image.Processing.Moments
Copyright : (c) Alberto Ruiz 2010
License : GPL
Maintain... |
92c8473bf408b83722dafbbad88615a282ffe77f08ea1950ee17c9d7e1048747 | luminus-framework/examples | layout.clj | ;---
Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
; courses, books, articles, and the like. Contact us if you are in doubt.
; We make no guarantees that this code is fit fo... | null | https://raw.githubusercontent.com/luminus-framework/examples/cbeee2fef8f457a6a6bac2cae0b640370ae2499b/guestbook-cljs/src/clj/guestbook/layout.clj | clojure | ---
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Web Development with Clojure , Second Edition " ,
published by The Pragmatic Bookshelf .
Copyrights apply to this code . It may not be used to create training material ,
(ns guestbook.layout
(:require [selmer.parser :as parser]
[selmer.filters :as filters]
[markdown.core... |
4a29d1ad6aa53c94ca59692eadb8662d069c9d376e66170cbb5a09931ffa6e5c | alda-lang/alda-core | parser.clj | (ns alda.parser
(:require [alda.lisp.score :as score]
[alda.parser
[aggregate-events :as agg]
[parse-events :as event]
[tokenize :as token]]
[clojure.core.async :refer [<!! >!! chan close! go-loop thread]]))
(defn print-stream
"Continuously... | null | https://raw.githubusercontent.com/alda-lang/alda-core/4c92eb4fe363485193c58b77b1ec8e36c8866fb5/src/alda/parser.clj | clojure | feed each character of input to chars-ch
parse tokens from chars-ch and feed them to tokens-ch
expressions.
expressions.
expressions. | (ns alda.parser
(:require [alda.lisp.score :as score]
[alda.parser
[aggregate-events :as agg]
[parse-events :as event]
[tokenize :as token]]
[clojure.core.async :refer [<!! >!! chan close! go-loop thread]]))
(defn print-stream
"Continuously... |
23bc1da8232b6e2985f8e6c62dd38f88f66ba8fffd005cab2154e483e26e2d41 | wireapp/wire-server | Context.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/5e91e50aa6f405cb6fbee05f9122e0f79e796658/libs/wire-api/src/Wire/API/MLS/Context.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Wire.API.MLS.Context wher... |
17a9b78d273ee16827accfd5d7ad9f400df67c5567852cce500eaffadbb7e4c3 | workframers/artemis | artemis_state.cljs | (ns example.artemis-state
(:require-macros [cljs.core.async.macros :refer [go-loop]])
(:require [example.client :refer [client]]
[artemis.core :as a]
[reagent.ratom :as ratom]
[re-frame.core :as rf]
[cljs.core.async :refer [<!]]))
;; Put store and messages into the t... | null | https://raw.githubusercontent.com/workframers/artemis/c67a7891b51b299e974cce6f01f7db9e45dee754/examples/re_frame/example/artemis_state.cljs | clojure | Put store and messages into the the app-db so we can subscribe to them
and have access from within other subscriptions
Create a signal graph layer for the store
Create a signal graph layer for a read against the store
Create a signal graph layer for a message
The main subscription interface layered atop the above... | (ns example.artemis-state
(:require-macros [cljs.core.async.macros :refer [go-loop]])
(:require [example.client :refer [client]]
[artemis.core :as a]
[reagent.ratom :as ratom]
[re-frame.core :as rf]
[cljs.core.async :refer [<!]]))
(rf/reg-event-db
::message-receive... |
aaa9116fc665893582c37eaca7f872c8dfa6d1ed8ceba0bd4a7e869bc7abb9c6 | craigl64/clim-ccl | xt-defs.lisp | ;; See the file LICENSE for the full license governing this code.
;;
;;
;; This file contains compile time only code -- put in clim-debug.fasl.
;;
(in-package :tk)
(def-c-typedef :cardinal :unsigned-int)
(def-c-typedef xt-proc * :unsigned-long)
(def-c-typedef action-list * :char)
(def-c-typedef resource-list * :cha... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/tk/xt-defs.lisp | lisp | See the file LICENSE for the full license governing this code.
This file contains compile time only code -- put in clim-debug.fasl.
Horrible internal stuff
general pointer-array |
(in-package :tk)
(def-c-typedef :cardinal :unsigned-int)
(def-c-typedef xt-proc * :unsigned-long)
(def-c-typedef action-list * :char)
(def-c-typedef resource-list * :char)
(def-c-typedef xrm-quark :int)
(def-c-typedef xrm-quark-list * :int)
(def-c-typedef boolean :char)
(def-c-typedef xrm-class xrm-quark)
(def-c-t... |
f791b0071108e5aed1f8ec8a4917515b7817bfae47b1b4e016b3d3b0063a2c63 | nitrogen/simple_bridge | simple_bridge_test_handler.erl | -module(simple_bridge_test_handler).
-behaviour(simple_bridge_handler).
-export([run/1,
ws_init/1,
ws_message/3,
ws_info/3,
ws_terminate/3]).
run(Bridge) ->
Path = sbw:path(Bridge),
Bridge2 = run(Path, Bridge),
sbw:build_response(Bridge2).
run("/host", Bridge) -> simple_call(host... | null | https://raw.githubusercontent.com/nitrogen/simple_bridge/0b33e15759b23050c151912374a68e18f2a3b83d/test/simple_bridge_test_handler.erl | erlang | base64:encode(RawResponse),
stubs, no real tests | -module(simple_bridge_test_handler).
-behaviour(simple_bridge_handler).
-export([run/1,
ws_init/1,
ws_message/3,
ws_info/3,
ws_terminate/3]).
run(Bridge) ->
Path = sbw:path(Bridge),
Bridge2 = run(Path, Bridge),
sbw:build_response(Bridge2).
run("/host", Bridge) -> simple_call(host... |
32ffc6b2e34871540c615a07db92784de1bddcdfd4594a53adc48ddce8e04489 | jyp/MarXup | Simple.hs | # OPTIONS_GHC -pgmF marchup -F #
import MarchUp.SimpleText
val :: Int
val = 3
sieve (p:xs) = p : sieve [x |x <- xs, x `mod` p /= 0]
primes = sieve [2..]
text = @"
This is an example of simple text with integer elements.
For example, val = @val.
Also, these are primes: @take(10)(primes)
These are also primes: @{tak... | null | https://raw.githubusercontent.com/jyp/MarXup/f9ff1d4aa076dd0844557001b61dff38c5a34a20/examples/Simple.hs | haskell | # OPTIONS_GHC -pgmF marchup -F #
import MarchUp.SimpleText
val :: Int
val = 3
sieve (p:xs) = p : sieve [x |x <- xs, x `mod` p /= 0]
primes = sieve [2..]
text = @"
This is an example of simple text with integer elements.
For example, val = @val.
Also, these are primes: @take(10)(primes)
These are also primes: @{tak... | |
a42d63b30f750089051f5a8296de5cf2fd3cd828704a669a4495a9c0221221a9 | MinaProtocol/mina | signature.ml | [%%import "/src/config.mlh"]
open Core_kernel
open Snark_params.Tick
module Poly = struct
[%%versioned
module Stable = struct
module V1 = struct
[@@@with_all_version_tags]
type ('field, 'scalar) t = 'field * 'scalar
[@@deriving sexp, compare, equal, hash]
end
end]
end
[%%versioned
mo... | null | https://raw.githubusercontent.com/MinaProtocol/mina/465aed0f9c71268e3ebd8428f07005d253a0bde1/src/lib/mina_base/signature.ml | ocaml | Base58Check encodes t | [%%import "/src/config.mlh"]
open Core_kernel
open Snark_params.Tick
module Poly = struct
[%%versioned
module Stable = struct
module V1 = struct
[@@@with_all_version_tags]
type ('field, 'scalar) t = 'field * 'scalar
[@@deriving sexp, compare, equal, hash]
end
end]
end
[%%versioned
mo... |
fb72dea2c2538c53f6367d1f187cbd901514890338021a19aea96e8be45b67f4 | helpshift/gulfstream | usage_test.clj | (ns gulfstream.usage-test
(:require [gulfstream.core :as gs]
[gulfstream.graph :as graph]))
(require '[gulfstream.core :refer :all])
(-> (gs/graph
{:attributes {:layout.quality 1.0 :layout.force 0.8}
:dom (gs/expand {:links
{:poverty #{:mental-health :meals :avaliabilit... | null | https://raw.githubusercontent.com/helpshift/gulfstream/f5e3f4159a9335bcf73ccbb750e0e6b17bde8773/candidates/test/usage_test.clj | clojure | (ns gulfstream.usage-test
(:require [gulfstream.core :as gs]
[gulfstream.graph :as graph]))
(require '[gulfstream.core :refer :all])
(-> (gs/graph
{:attributes {:layout.quality 1.0 :layout.force 0.8}
:dom (gs/expand {:links
{:poverty #{:mental-health :meals :avaliabilit... | |
e5a3d411ee79cccf7c8e1df796c77fc8aadefac4c8fd6b4e89e0cee21e4ee400 | gwkkwg/lift | test-conditions.lisp | (in-package #:lift-test)
(deftestsuite test-normal-conditions (lift-test)
())
(deftestsuite test-normal-conditions-helper (lift-test)
())
(define-condition test-simple-condition-condition-1 () ())
(define-condition test-simple-condition-condition-2 () ())
(addtest (test-normal-conditions-helper)
signal-simpl... | null | https://raw.githubusercontent.com/gwkkwg/lift/2594160d6ca3a77d8750110dfa63214256aab852/test/test-conditions.lisp | lisp | (in-package #:lift-test)
(deftestsuite test-normal-conditions (lift-test)
())
(deftestsuite test-normal-conditions-helper (lift-test)
())
(define-condition test-simple-condition-condition-1 () ())
(define-condition test-simple-condition-condition-2 () ())
(addtest (test-normal-conditions-helper)
signal-simpl... | |
79df676a1303d026105be7862acd8f5fd2e05ee2fc224a561091b9cf41e6ab3f | satori-com/mzbench | loop.erl | [ % the simplest example
three execution " threads "
{worker_type, dummy_worker}],
[{loop, [{time, {5, min}}, % total loop time
one rps for every worker , 3 rps totally
this operation prints " FOO " to console
].
| null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/examples/loop.erl | erlang | the simplest example
total loop time | three execution " threads "
{worker_type, dummy_worker}],
one rps for every worker , 3 rps totally
this operation prints " FOO " to console
].
|
5ea96b418d5d290ee0c1d1cf74086075a8c870b3c6e8c39e2a140e55ccfb3c4e | lambdacube3d/lambdacube-quake3 | Content.hs | # LANGUAGE ViewPatterns , TupleSections , RecordWildCards #
module Content where
import Control.Monad
import Text.Printf
import Data.Set (Set)
import Data.Map (Map)
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Lazy as LB
import qualified Data.ByteString.Char8 as SB
import qualified Data.M... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-quake3/2fbc17eeea7567f2876d86a7ccce4bd8c8e1927c/mapviewer/Content.hs | haskell | # LANGUAGE ViewPatterns , TupleSections , RecordWildCards #
module Content where
import Control.Monad
import Text.Printf
import Data.Set (Set)
import Data.Map (Map)
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Lazy as LB
import qualified Data.ByteString.Char8 as SB
import qualified Data.M... | |
363be0ac9fe11b60441be1a4fafda8496f5e643de7cdcdf5672826cd047dbc98 | keera-studios/keera-posture | NotifyWindow.hs | -- | Shows a pseudo-overlay window when the user must be notified and this kind
-- of notification is enabled
module Controller.Conditions.NotifyWindow where
import Data.ReactiveValue
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Reactive
import CombinedEnvironment
import Model.Model (Status(..))
import Hails.MVC.Mod... | null | https://raw.githubusercontent.com/keera-studios/keera-posture/9de5095a4a10c0cb54f6191f1a448e96645193ae/src/Controller/Conditions/NotifyWindow.hs | haskell | | Shows a pseudo-overlay window when the user must be notified and this kind
of notification is enabled
| Notifies/stops notifying when the system is started, or when notification,
status or overlay are changed.
View elements
FIXME: This should be on the view only
Reactive Rules
onEvent pm Initialised ... | module Controller.Conditions.NotifyWindow where
import Data.ReactiveValue
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Reactive
import CombinedEnvironment
import Model.Model (Status(..))
import Hails.MVC.Model.ProtectedModel.Reactive
installHandlers :: CEnv -> IO()
installHandlers cenv = do
Model RVs
let stFie... |
88a0ab3ae49f8d989c3bb5bde2d4e14adf7bfd168f81ca6dddce6e5bf04b5b7b | wilkerlucio/media-looper | playground.cljs | (ns com.wsscode.fulcro-raw.playground
"Let's do some data playing!"
(:require
["react-dom" :as rdom]
[com.fulcrologic.fulcro.inspect.websocket-preload]
[helix.core :as h]
[helix.dom :as dom]
[helix.hooks :as hooks]
[com.fulcrologic.fulcro.mutations :as fm]
[com.fulcrologic.fulcro.raw.com... | null | https://raw.githubusercontent.com/wilkerlucio/media-looper/b54b89050757f9f46157f8fa7fcccef165409232/src/playground/com/wsscode/fulcro_raw/playground.cljs | clojure | region pathom
endregion | (ns com.wsscode.fulcro-raw.playground
"Let's do some data playing!"
(:require
["react-dom" :as rdom]
[com.fulcrologic.fulcro.inspect.websocket-preload]
[helix.core :as h]
[helix.dom :as dom]
[helix.hooks :as hooks]
[com.fulcrologic.fulcro.mutations :as fm]
[com.fulcrologic.fulcro.raw.com... |
6df44246579c157dfe8ce0ee8fe64d819335f1a9d6bfdf0153852c0c262364a4 | ssor/erlangDemos | icreg_sup.erl | -module(icreg_sup).
-behaviour(supervisor).
% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER,?MODULE).
start_link() ->
icreg_event_sensor:add_handler(),
supervisor:start_link({local,?SERVER}, ?MODULE, []).
init([]) ->
GeneratorSup = {icreg_generator_sup,{icreg_generator_su... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/intelligent_rfid_event_generator/src/icreg_sup.erl | erlang | API
Supervisor callbacks | -module(icreg_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER,?MODULE).
start_link() ->
icreg_event_sensor:add_handler(),
supervisor:start_link({local,?SERVER}, ?MODULE, []).
init([]) ->
GeneratorSup = {icreg_generator_sup,{icreg_generator_sup,start_link,[]},
permane... |
be6ecaf9b8072a6ec1b782ec8233323c1abca1d6445acdda9b5c13e1b767763e | BitGameEN/bitgamex | ranch_tcp.erl | Copyright ( c ) 2011 - 2018 , < >
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/ranch/src/ranch_tcp.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2011 - 2018 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(ranch_tcp).
-behaviour(ranch_transport).
-ex... |
7095eae087dec542bf49079b58d59af5b76854e91484f3116c1e7509e33ffc50 | goncalotomas/FMKe | fmke_http_utils.erl | %% Generally useful HTTP parsing functions. Required for gen_http_handler and for
%% other modules that may wish to manually parse a specific field.
-module (fmke_http_utils).
-include ("fmke_http.hrl").
%%%-------------------------------------------------------------------
%%% API
%%%---------------------------------... | null | https://raw.githubusercontent.com/goncalotomas/FMKe/654d3211ef57d841540e58033a397ce0f3dee0f7/src/fmke_http_utils.erl | erlang | Generally useful HTTP parsing functions. Required for gen_http_handler and for
other modules that may wish to manually parse a specific field.
-------------------------------------------------------------------
API
-------------------------------------------------------------------
Tries to extract a list of proper... | -module (fmke_http_utils).
-include ("fmke_http.hrl").
-export ([
parse_body/2
,parse_body/3
,parse_id/1
,parse_string/1
,parse_csv_string/1
]).
-spec parse_body(list({atom(), atom()}), binary()) -> list({atom(), any()}).
The property list must be an Erlang proplist in the form [ { prop_name , p... |
85dd344c8a4b5d7a27183e25172aeaed7cf7ecef62f163cec816fe9cb64edf44 | commercialhaskell/rio | Partial.hs | -- | Lazy @ByteString@ partial functions. Import as:
--
> import qualified RIO.ByteString . Lazy . Partial as BL '
module RIO.ByteString.Lazy.Partial
(
-- * Basic interface
Data.ByteString.Lazy.head
, Data.ByteString.Lazy.last
, Data.ByteString.Lazy.tail
, Data.ByteString.Lazy.init
-- * Reducing 'Byt... | null | https://raw.githubusercontent.com/commercialhaskell/rio/4eba306d37a60a20f0bed27f40afc23a7c892c40/rio/src/RIO/ByteString/Lazy/Partial.hs | haskell | | Lazy @ByteString@ partial functions. Import as:
* Basic interface
* Reducing 'ByteString's (folds)
** Special folds | > import qualified RIO.ByteString . Lazy . Partial as BL '
module RIO.ByteString.Lazy.Partial
(
Data.ByteString.Lazy.head
, Data.ByteString.Lazy.last
, Data.ByteString.Lazy.tail
, Data.ByteString.Lazy.init
, Data.ByteString.Lazy.foldl1
, Data.ByteString.Lazy.foldl1'
, Data.ByteString.Lazy.foldr1
... |
82065a2ba6538b38653769f3d1d33b96a6b18f32b202927d358572df3c3189dc | jubnzv/iec-checker | config.ml | (** Configuration values including platform and implementation dependent options. *)
(** Maximum size of STRING and WSTRING data types. *)
let max_string_len = 4096
(** Threshold of McCabe complexity to generate warnings. *)
let mccabe_complexity_threshold = 15
* Threshold of maximum number of statements in POU to g... | null | https://raw.githubusercontent.com/jubnzv/iec-checker/2620a17407ffc202310a2e0037bc4fea52143d33/src/core/config.ml | ocaml | * Configuration values including platform and implementation dependent options.
* Maximum size of STRING and WSTRING data types.
* Threshold of McCabe complexity to generate warnings.
{{{ List of the enabled checks
}}} |
let max_string_len = 4096
let mccabe_complexity_threshold = 15
* Threshold of maximum number of statements in POU to generate warnings .
let statements_num_threshold = 25
let check_plcopen_cp1 = true
let check_plcopen_cp2 = true
let check_plcopen_cp3 = true
let check_plcopen_cp4 = true
let check_plcopen_cp6 = true
... |
fab594fdbd6981c58f9c5407c1ed44496e92beb6c347d9649b656a9aaad436a7 | solita/mnt-teet | responsivity_styles.cljs | (ns teet.common.responsivity-styles
(:require [teet.theme.theme-colors :as theme-colors]
[reagent.core :as r]))
(def ^{:const true
:doc "Minimum browser window width that is considered wide for layout purposes."}
wide-display-cutoff-width 2200)
(def ^:const desktop-cutoff-width 1024)
(def ^:co... | null | https://raw.githubusercontent.com/solita/mnt-teet/6fb9a6745951108e27a25f591beca3e3faef178b/app/frontend/src/cljs/teet/common/responsivity_styles.cljs | clojure | (ns teet.common.responsivity-styles
(:require [teet.theme.theme-colors :as theme-colors]
[reagent.core :as r]))
(def ^{:const true
:doc "Minimum browser window width that is considered wide for layout purposes."}
wide-display-cutoff-width 2200)
(def ^:const desktop-cutoff-width 1024)
(def ^:co... | |
652ef4dc0b3b98980d9db02fd97deb2d536f89332d8e63e8039bf8536087f632 | crategus/cl-cffi-gtk | text-glyph.lisp | (in-package :cairo-example)
(defun drawing-text-glyph (widget cr)
(let* ((cr (pointer cr))
(width (gtk-widget-allocated-width widget))
(height (gtk-widget-allocated-height widget))
(font-size (min (truncate (- (/ height 20) 5))
(truncate (- (/ width 36) 5))))
... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/demo/cairo-example/text-glyph.lisp | lisp | Set the color.
Select the font face
Specify the font size
Show the list of glyphs
Show the window. | (in-package :cairo-example)
(defun drawing-text-glyph (widget cr)
(let* ((cr (pointer cr))
(width (gtk-widget-allocated-width widget))
(height (gtk-widget-allocated-height widget))
(font-size (min (truncate (- (/ height 20) 5))
(truncate (- (/ width 36) 5))))
... |
65346e08d115027c1bb5802bed170a33b668d28bf25ecc5fa410b2d6ba79179f | alasconnect/azure-demo | Main.hs | module Main where
--------------------------------------------------------------------------------
import Options.Applicative
--------------------------------------------------------------------------------
import App
import Opts
--------------------------------------------------------------------------------
main ::... | null | https://raw.githubusercontent.com/alasconnect/azure-demo/5d16db775ccf3b753f4ef078bad8e9437b844d76/backend/app/Main.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------ | module Main where
import Options.Applicative
import App
import Opts
main :: IO ()
main = execParser opts >>= run
|
1d8e03ea65cb5027429cf4f32677250676125b98fe10658444c029da495f4852 | bobby/redisconf19-demo | async.clj | (ns redis-streams-clj.common.async
(:require [clojure.core.async :as async]
[com.stuartsierra.component :as c]))
(defrecord PubComponent [channel topic-fn buf-fn pub]
c/Lifecycle
(start [this]
(let [p (if buf-fn
(async/pub channel topic-fn buf-fn)
(async/pub channel to... | null | https://raw.githubusercontent.com/bobby/redisconf19-demo/0191ed1cf6a7cdf47037de3e4dd187a5c6a33a36/common/src/redis_streams_clj/common/async.clj | clojure | (ns redis-streams-clj.common.async
(:require [clojure.core.async :as async]
[com.stuartsierra.component :as c]))
(defrecord PubComponent [channel topic-fn buf-fn pub]
c/Lifecycle
(start [this]
(let [p (if buf-fn
(async/pub channel topic-fn buf-fn)
(async/pub channel to... | |
210273faff57a207c14608a7889b4b77cf6be9553d48e15b74fa994ba077bad9 | satori-com/mzbench | mzb_gc.erl | -module(mzb_gc).
-behaviour(gen_server).
%% API
-export([start_link/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-record(s, {
sleep = undefined :: undefined | integer()
}).
%%%==================================================... | null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/common_apps/mzbench_utils/src/mzb_gc.erl | erlang | API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
==============================================================... | -module(mzb_gc).
-behaviour(gen_server).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-record(s, {
sleep = undefined :: undefined | integer()
}).
start_link(Sleep) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [Sleep], ... |
ee2872ed6e2f0096d430fed8d9ca7b0d75f8e3eed2c8b0e4d5814555f27cc9b7 | byorgey/haskell-course | HW2Test.hs | -- Modules needed:
-- test-framework
test - framework - hunit
-- test-framework-quickcheck2
--
should also pull in QuickCheck-2 and HUnit .
module HW2Test (main) where
import Control.Monad (when)
import qualified Data.Map as M
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.HU... | null | https://raw.githubusercontent.com/byorgey/haskell-course/f928cc8031aec2147f037949826134a484414ed6/weeks/02-ADTs/hw/HW2Test.hs | haskell | Modules needed:
test-framework
test-framework-quickcheck2
[ "Flange is due for a check-up"
, "You really might want to check on that flange"
, "Dude, the FLANGE"
]
| test - framework - hunit
should also pull in QuickCheck-2 and HUnit .
module HW2Test (main) where
import Control.Monad (when)
import qualified Data.Map as M
import Test.Framework (defaultMain, testGroup)
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2 (testProperty)
import Tes... |
72fb1045af7138072ce9636a14994f437e3d69396f3706bf8122c464ee0d1674 | oakes/paren-soup | dev.cljs | (ns paren-soup.dev
(:require [paren-soup.core]
[clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s]))
(st/instrument)
| null | https://raw.githubusercontent.com/oakes/paren-soup/15f55ebb40ee30f75ca960d381ddebd094a76f3d/src/paren_soup/dev.cljs | clojure | (ns paren-soup.dev
(:require [paren-soup.core]
[clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s]))
(st/instrument)
| |
7f3ea8fd0ee88ec568de44303ab8906669b36432cc490196948613df80da2e5b | ten0s/syntaxerl | syntaxerl_logger.erl | -module(syntaxerl_logger).
-author("Dmitry Klionsky <>").
-export([debug/3]).
%% ===================================================================
%% API
%% ===================================================================
-spec debug(Output::boolean(), Fmt::string(), Args::[term()]) -> ok.
debug(true, Fmt, Args)... | null | https://raw.githubusercontent.com/ten0s/syntaxerl/fc5113c68f0ce0c6ef43216e2b3483b090c6dd86/src/syntaxerl_logger.erl | erlang | ===================================================================
API
=================================================================== | -module(syntaxerl_logger).
-author("Dmitry Klionsky <>").
-export([debug/3]).
-spec debug(Output::boolean(), Fmt::string(), Args::[term()]) -> ok.
debug(true, Fmt, Args) ->
io:format("DEBUG: " ++ Fmt ++ "~n", Args);
debug(false, _Fmt, _Args) ->
ok.
|
fb92e48151a52db3429823f110d5caf750ed72710aa00b59d87018cfc35e42c1 | thephoeron/baphomet | definer.lisp | Copyright ( c ) 2022 , " the Phoeron " < >
Released under the MIT License . See baphomet / LICENSE for more information .
(in-package :baphomet)
#-lispworks
(defparameter *user-package* :cl-user)
(defparameter *language* :common-lisp)
;;; ABSTRACT DEFINER DECLARATIONS
(defclass definer-class (funcallable-s... | null | https://raw.githubusercontent.com/thephoeron/baphomet/5249cf5e0cd03c5443715a064879cdb28d4ef20c/definer.lisp | lisp | ABSTRACT DEFINER DECLARATIONS
DEFINER MACRO
(destructuring-bind (name &rest definer-options) (ensure-list name-and-options)
(expand-definer
(initialize-definer (make-instance (get-definer name)
:definer-options definer-options
... | Copyright ( c ) 2022 , " the Phoeron " < >
Released under the MIT License . See baphomet / LICENSE for more information .
(in-package :baphomet)
#-lispworks
(defparameter *user-package* :cl-user)
(defparameter *language* :common-lisp)
(defclass definer-class (funcallable-standard-class)
((name :initarg :... |
9bb20f47b25a67a24799c66ee679d6ea2b67b1bb1646a1ec6024713684fecb51 | bobzhang/fan | test_fan_eval.ml | open Format
open Dynlink
let () = try
print_endline "init";
Dynlink.init ();
print_endline "allowing unsafe modules";
Dynlink.allow_unsafe_modules true;
Dynlink.loadfile "/home1/h/hongboz/ocaml/lib/ocaml/stdlib.cma";
Dynlink.loadfile
"/home1/h/hongboz/ocaml/lib/ocaml/compiler-libs/ocamlcommon.cma";
print_en... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/test/test_fan_eval.ml | ocaml | Dynlink.loadfile "/usr/local/lib/ocaml/topstart.cmo";
now the ocaml toplevel should be running | open Format
open Dynlink
let () = try
print_endline "init";
Dynlink.init ();
print_endline "allowing unsafe modules";
Dynlink.allow_unsafe_modules true;
Dynlink.loadfile "/home1/h/hongboz/ocaml/lib/ocaml/stdlib.cma";
Dynlink.loadfile
"/home1/h/hongboz/ocaml/lib/ocaml/compiler-libs/ocamlcommon.cma";
print_en... |
a03aa8558887b40cd12c0a98adef8a814a88ea3d5102f4e95155dc0f753e9b2c | szktty/starlight | strl.ml | open Core
open Common
let summary = "[WIP] A yet another Erlang implementation"
let runtime_path = "./strlrun"
let file_exists file =
match Sys.file_exists ~follow_symlinks:true file with
| `No | `Unknown ->
Printf.printf "Error: No such file `%s'\n" file;
exit (-1)
| `Yes -> ()
let parse_file file =
... | null | https://raw.githubusercontent.com/szktty/starlight/0dec4d272c3ea5dd0f82940a24dfe758ab641ca5/compiler/strl.ml | ocaml | Example: ./strl build -parsetree -lambda -instr FILE | open Core
open Common
let summary = "[WIP] A yet another Erlang implementation"
let runtime_path = "./strlrun"
let file_exists file =
match Sys.file_exists ~follow_symlinks:true file with
| `No | `Unknown ->
Printf.printf "Error: No such file `%s'\n" file;
exit (-1)
| `Yes -> ()
let parse_file file =
... |
6740da9815673262c396f97113ee26c585b323543c5012ea67294b77a33edce6 | spawnfest/nakaz | nakaz_loader.erl | -module(nakaz_loader).
%% FIXME(Dmitry): comment
-callback parse(Type :: any(), %% FIXME(Dmitry)
Value :: binary()) ->
{ok, ParsedVal :: any()} |
{error, Reason :: binary()}.
%% FIXME(Dmitry): comment
-callback validate(Type :: any(), %% FIXME(Dmitry)
Value :: any()) ->
... | null | https://raw.githubusercontent.com/spawnfest/nakaz/9570f338b42ddbb5a12e4d75126a2a4ebcaf65f2/src/nakaz_loader.erl | erlang | FIXME(Dmitry): comment
FIXME(Dmitry)
FIXME(Dmitry): comment
FIXME(Dmitry) | -module(nakaz_loader).
Value :: binary()) ->
{ok, ParsedVal :: any()} |
{error, Reason :: binary()}.
Value :: any()) ->
ok | {error, Reason :: binary()}.
|
da9beef8295e0e956d6cba1a6d6c66fc7b50ee5e6349437eaa1dfe8a4f081236 | scrintal/heroicons-reagent | view_columns.cljs | (ns com.scrintal.heroicons.mini.view-columns)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M14 17h2.75A2.25 2.25 0 0019 14.75v-9.5A2.25 2.25 0 0016.75 3H14v14zM12.5 3h-5v14h5V3zM3.25 3H6v14H3.25A2.25 2.25 0 ... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/view_columns.cljs | clojure | (ns com.scrintal.heroicons.mini.view-columns)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M14 17h2.75A2.25 2.25 0 0019 14.75v-9.5A2.25 2.25 0 0016.75 3H14v14zM12.5 3h-5v14h5V3zM3.25 3H6v14H3.25A2.25 2.25 0 ... | |
74e216a85cf5bef376895d13708134219ed9fbf4f55ed256898b8704685c5ce1 | chrisa/acts_as_encrypted | mochiweb_util.erl | @author < >
2007 Mochi Media , Inc.
@doc Utilities for parsing and quoting .
-module(mochiweb_util).
-author('').
-export([join/2, quote_plus/1, urlencode/1, parse_qs/1, unquote/1]).
-export([path_split/1]).
-export([urlsplit/1, urlsplit_path/1, urlunsplit/1, urlunsplit_path/1]).
-export([guess_mime/1, pars... | null | https://raw.githubusercontent.com/chrisa/acts_as_encrypted/587558a31876dfbbc47d7ab2070782fd3d9395d7/server/deps/mochiweb-src/src/mochiweb_util.erl | erlang | $\%
$\.
@spec shell_quote(string()) -> string()
surrounded by double quotes.
@doc open_port({spawn, mochiweb_util:cmd_string(Argv)}, Options).
@doc os:cmd(cmd_string(Argv)).
@doc Create a shell quoted command string from a list of arguments.
@spec join([string()], Separator) -> string()
@doc Join a list ... | @author < >
2007 Mochi Media , Inc.
@doc Utilities for parsing and quoting .
-module(mochiweb_util).
-author('').
-export([join/2, quote_plus/1, urlencode/1, parse_qs/1, unquote/1]).
-export([path_split/1]).
-export([urlsplit/1, urlsplit_path/1, urlunsplit/1, urlunsplit_path/1]).
-export([guess_mime/1, pars... |
75700592a4b6d039b9017ea581d0255c4479e65ae9d849fa317d8402de5196b0 | esoeylemez/progress-meter | Progress.hs | -- |
Copyright : ( c ) 2017
-- License: BSD3
Maintainer : < >
--
-- This module implements a progress bar with support for multiple
-- individual text chunks that can be updated independently (called
-- /meters/).
{-# LANGUAGE RankNTypes #-}
module System.Progress
( -- * Tutorial
-- $tutorial
... | null | https://raw.githubusercontent.com/esoeylemez/progress-meter/17e4f419bb41e086533abbb346b3ecb373faa408/src/System/Progress.hs | haskell | |
License: BSD3
This module implements a progress bar with support for multiple
individual text chunks that can be updated independently (called
/meters/).
# LANGUAGE RankNTypes #
* Tutorial
$tutorial
** Zooming
$zooming
** Concurrent updates
$concurrent_updates
** Further notes
$notes
* Progress bars... | Copyright : ( c ) 2017
Maintainer : < >
module System.Progress
Progress(..),
withProgress,
withProgress_,
meterIO,
putMsg,
putMsgLn,
Meter,
Meter',
modifyMeter,
setMeter,
zoomMeter,
zoomMeterL,
* * STM variants
modifyMeter... |
d50fb1850749bc98e40b600287d9816a88bd651564e9296ca0fe3acbba1e8138 | kaznum/programming_in_ocaml_exercise | sample.ml | print_string "Hello, World!\n";;
print_string "こんにちは\n";;
read_line ();;
();;
type 'a seq = Cons of 'a * (unit -> 'a seq);;
let rec from n = Cons (n, fun () -> from (n+1));;
let Cons(x1, f1) = from 1;;
let Cons(x2, f2) = f1 ();;
let Cons(x3, f3) = f2 ();;
let rec mapseq f (Cons (x, tail)) =
Cons (f x, fun () -> ... | null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ch8/sample.ml | ocaml | 本ではうまく動作するように記載されているが、実際にはエラーになる under ocaml 4.0
これもエラーになる
[1]が戻り値になる
引数の評価順序は不定(実装依存) | print_string "Hello, World!\n";;
print_string "こんにちは\n";;
read_line ();;
();;
type 'a seq = Cons of 'a * (unit -> 'a seq);;
let rec from n = Cons (n, fun () -> from (n+1));;
let Cons(x1, f1) = from 1;;
let Cons(x2, f2) = f1 ();;
let Cons(x3, f3) = f2 ();;
let rec mapseq f (Cons (x, tail)) =
Cons (f x, fun () -> ... |
4b3d36f30c316b1e005af6125cf01837f72f68a5f522e26176b83320c2e47152 | exercism/racket | grep.rkt | #lang racket
(provide grep)
(define (grep flags pattern files)
(error "Not implemented yet"))
| null | https://raw.githubusercontent.com/exercism/racket/ce7b72cfde0695588771031d6b69d8d1cb199038/exercises/practice/grep/grep.rkt | racket | #lang racket
(provide grep)
(define (grep flags pattern files)
(error "Not implemented yet"))
| |
735340cc2e17de688ab9a141220e4c77a84115f08e801bb29d779d4949d3e073 | novaframework/nova | nova_ws_handler.erl | @author < >
%%% @doc
Callback controller for handling websockets
%%% @end
-module(nova_ws_handler).
-export([
init/2,
terminate/3,
websocket_init/1,
websocket_handle/2,
websocket_info/2
]).
-include_lib("kernel/include/logger.hrl").
-type nova_ws_state() :... | null | https://raw.githubusercontent.com/novaframework/nova/0e83e936149896e879db9a52637b391298cdbb84/src/nova_ws_handler.erl | erlang | @doc
@end
Public functions %%
Call the http-handler in order to correctly handle potential plugins for the http-request
Inject the websocket process into the state
Call post_ws_connection-plugins
Run the post-plugins
Remove the commands from the map
Check if we are hibernating
Private functions %... | @author < >
Callback controller for handling websockets
-module(nova_ws_handler).
-export([
init/2,
terminate/3,
websocket_init/1,
websocket_handle/2,
websocket_info/2
]).
-include_lib("kernel/include/logger.hrl").
-type nova_ws_state() :: #{controller_dat... |
f5c97d8f34f1df11be2c2da7a23d763b163c54d3fbd3f92ff326467a2e978994 | gwkkwg/cl-containers | test-queues.lisp |
(in-package #:containers)
(lift:deftestsuite test-queues (test-containers) ())
(lift:deftestsuite test-single-queue (test-queues)
(q)
(:cases (q (mapcar #'make-container (concrete-subclass-names-of 'abstract-queue)))))
#+Ignore
(lift:addtest (test-single-queue)
test-ok
(spy q))
(lift:addtest (test-single-... | null | https://raw.githubusercontent.com/gwkkwg/cl-containers/3d1df53c22403121bffb5d553cf7acb1503850e7/tests/test-queues.lisp | lisp |
(in-package #:containers)
(lift:deftestsuite test-queues (test-containers) ())
(lift:deftestsuite test-single-queue (test-queues)
(q)
(:cases (q (mapcar #'make-container (concrete-subclass-names-of 'abstract-queue)))))
#+Ignore
(lift:addtest (test-single-queue)
test-ok
(spy q))
(lift:addtest (test-single-... | |
95dd3d84a314779e8c3ece22fa586593f7346151dabb9320a95b68a71dc309b9 | taruen/apertiumpp | main.rkt | #lang racket
(provide lu-contains?)
(module+ test
(require rackunit))
;;;;;;;;;;;;
;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Macros / syntax / language
;;;;;;;;;;;;;
;; Functions
(define/contract (lu-contains? lu analysis)
(string? string? . -> . (or/c string? #f))
;; return `analysis' if it is amo... | null | https://raw.githubusercontent.com/taruen/apertiumpp/73eeacc19015170e54c77824e015224f6456cf3e/apertiumpp/main.rkt | racket |
Constants
Functions
return `analysis' if it is among analyses of a lelxical unit, #f otherwise | #lang racket
(provide lu-contains?)
(module+ test
(require rackunit))
Macros / syntax / language
(define/contract (lu-contains? lu analysis)
(string? string? . -> . (or/c string? #f))
(let ([m (regexp-match (string-append "/" (regexp-quote analysis) "[/\\$]")
lu)])
(if m... |
8cd7bec9de34f46a3e686e6f6a299cb3e16c3174c31b4407cb61e9fd7c014e28 | funcool/urania | runner.cljs | (ns urania.runner
(:require [cljs.test :as test]
[urania.core-spec-test]))
(enable-console-print!)
(defn main []
(test/run-tests (test/empty-env)
'urania.core-spec-test))
(set! *main-cli-fn* main)
| null | https://raw.githubusercontent.com/funcool/urania/55219ec571dc98675bd8dcc0cc2254738b66578a/test/urania/runner.cljs | clojure | (ns urania.runner
(:require [cljs.test :as test]
[urania.core-spec-test]))
(enable-console-print!)
(defn main []
(test/run-tests (test/empty-env)
'urania.core-spec-test))
(set! *main-cli-fn* main)
| |
0aea842fc394401ba8e52d37f95007e403ad2c2708d4b9c753ddc54df01917fa | ahrefs/ocaml-ahrocksdb | wrap.ml | open Printf
module type Wrap_t = sig
type t
val kind : string
end
module Wrap (M : Wrap_t) = struct
type t = {
mutable valid : bool;
content : M.t;
kind : string;
}
let wrap v = { valid = true; content = v; kind = M.kind; }
let unwrap t f =
match t with
| { valid = false; kind; _ ... | null | https://raw.githubusercontent.com/ahrefs/ocaml-ahrocksdb/bc0475cbfa9daa3a97c2e948f5a8cbe30c5b4828/lib/wrap.ml | ocaml | open Printf
module type Wrap_t = sig
type t
val kind : string
end
module Wrap (M : Wrap_t) = struct
type t = {
mutable valid : bool;
content : M.t;
kind : string;
}
let wrap v = { valid = true; content = v; kind = M.kind; }
let unwrap t f =
match t with
| { valid = false; kind; _ ... | |
76b781fc95ae266e227ac83246acfb098bc7e9147a04896a7b37822d74196b9d | ktahar/ocaml-lp | lp_glpk_js.ml | open Js_of_ocaml
class type var =
object
method name : Js.js_string Js.t Js.prop
method coef : float Js.prop
end
class type row_bound =
object
method _type : int Js.prop
method ub : float Js.prop
method lb : float Js.prop
end
class type col_bound =
object
method name : Js.js_string ... | null | https://raw.githubusercontent.com/ktahar/ocaml-lp/344fc7b99a2d938438ec9abed0d9cd4b3cddc66a/src/lp-glpk-js/lp_glpk_js.ml | ocaml | method cb
specified in glpk.js API. but omit here as it's redundant.
direction
type of auxiliary/structural variable
message level
solution status
version / solve | open Js_of_ocaml
class type var =
object
method name : Js.js_string Js.t Js.prop
method coef : float Js.prop
end
class type row_bound =
object
method _type : int Js.prop
method ub : float Js.prop
method lb : float Js.prop
end
class type col_bound =
object
method name : Js.js_string ... |
3407b3c279a7dc812c7c71bdd913164a4aa44832765dfca2a2b386cf9cfbcbb5 | appleshan/cl-http | patch-local-context.lisp | (in-package :http)
The following is loaded before the setf for local - context is defined
;;; simply reload to avoid the warning
(defun (setf local-context) (new-context)
(set-local-context new-context)) | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/acl/jkf/patches/patch-local-context.lisp | lisp | simply reload to avoid the warning | (in-package :http)
The following is loaded before the setf for local - context is defined
(defun (setf local-context) (new-context)
(set-local-context new-context)) |
22dbb92f4fca573cdd86613b32e257dbe2ba04d9de19de2505ef3ba839b85a4d | ykskb/phrag | adapter.clj | (ns phrag.db.adapter
"DB adapter initialization."
(:require [clojure.string :as s]
[phrag.db.sqlite :as sqlite]
[phrag.db.postgres :as postgres]))
(defn- connection-type [db]
(let [db-info (s/lower-case (-> (.getMetaData (:connection db))
(.getDatabasePro... | null | https://raw.githubusercontent.com/ykskb/phrag/f6e8821840715794b13c305b4a88583afed67b3c/src/phrag/db/adapter.clj | clojure | (ns phrag.db.adapter
"DB adapter initialization."
(:require [clojure.string :as s]
[phrag.db.sqlite :as sqlite]
[phrag.db.postgres :as postgres]))
(defn- connection-type [db]
(let [db-info (s/lower-case (-> (.getMetaData (:connection db))
(.getDatabasePro... | |
b7b96579cf006075312ddb17bfd4ec2274fb0ee4602df2c9eb5bdfd7c5037fc1 | cjdev/haskell-fundamentals | TypesOfLoopsSpec.hs | module TypesOfLoopsSpec where
import Test.Hspec
import qualified Data.Map as Map
import Data.List (foldl', stripPrefix)
sampleLines :: [String]
sampleLines =
[ "red"
, " scarlet"
, " ruby"
, " flame"
, "green"
, " jade"
, " forest"
, " mint"
, "blue"
, " turquoise"
, " az... | null | https://raw.githubusercontent.com/cjdev/haskell-fundamentals/03982d7b3ca140bfecc69fa4873fcc0e4fa54044/test/TypesOfLoopsSpec.hs | haskell | ------------------------------------------------------------------------------
Left folding over lists is always strict, so we should use foldl' instead of
foldl to avoid space leaks. For more information see:
------------------------------------------------------------------------------
Recursive solution
---------... | module TypesOfLoopsSpec where
import Test.Hspec
import qualified Data.Map as Map
import Data.List (foldl', stripPrefix)
sampleLines :: [String]
sampleLines =
[ "red"
, " scarlet"
, " ruby"
, " flame"
, "green"
, " jade"
, " forest"
, " mint"
, "blue"
, " turquoise"
, " az... |
da5e54482f062a71d5ed9abf7f8aa6bb7320bba54f0e5edf11215808c7b9acbd | chicken-mobile/chicken-sdl2-android-builder | rwops.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/functions/rwops.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... |
af7ccf9808fd6483e43dee4830339caa51333e470f8f68994bd3d2d835ea50d8 | 5outh/textlunky | Class.hs | module Control.Process.Class(
UnwrappedCommand(..),
Process(..)
) where
import Types
import Control.Monad.Trans.Free
import Control.Monad.State.Class
| An unwrapped ` TextlunkyCommand `
type UnwrappedCommand = FreeF TextlunkyCommand () (Textlunky ())
-- | A `Process` used to update the game
type Process = Unwrap... | null | https://raw.githubusercontent.com/5outh/textlunky/8dd4d975ed86b761262e3026dd4c22a36b532104/src/Control/Process/Class.hs | haskell | | A `Process` used to update the game | module Control.Process.Class(
UnwrappedCommand(..),
Process(..)
) where
import Types
import Control.Monad.Trans.Free
import Control.Monad.State.Class
| An unwrapped ` TextlunkyCommand `
type UnwrappedCommand = FreeF TextlunkyCommand () (Textlunky ())
type Process = UnwrappedCommand -> Global GameState ()
|
019764eac08b4a81d4fc17bc319318f8ba60c5547f30eb4c1dcb701745b30d93 | bpiel/guildsman | ratom.cljs | (ns reagent.ratom
(:refer-clojure :exclude [atom])
(:require-macros [reagent.ratom :refer [with-let]])
(:require [reagent.impl.util :as util]
[reagent.debug :refer-macros [dbg log warn error dev? time]]
[reagent.impl.batching :as batch]
[clojure.set :as s]))
(declare ^:dynamic... | null | https://raw.githubusercontent.com/bpiel/guildsman/59c9a7459de19525cfc54112f02127e0777a00ce/resources/public/js/compiled/out/reagent/ratom.cljs | clojure | Optimize common case where derefs occur in same order
Copy watches to array for speed
Queueing
Atom
track
cursor
with-let support
reaction
Use = to determine equality from reactions, since
they are likely to produce new data structures.
f is called with the reaction as argument when it is no longer active
w... | (ns reagent.ratom
(:refer-clojure :exclude [atom])
(:require-macros [reagent.ratom :refer [with-let]])
(:require [reagent.impl.util :as util]
[reagent.debug :refer-macros [dbg log warn error dev? time]]
[reagent.impl.batching :as batch]
[clojure.set :as s]))
(declare ^:dynamic... |
34b3052ba9e3543b640db9c7083749486aab9909c74a60dedc16002f47f5d120 | lokedhs/cl-rabbit | examples.lisp | (in-package :cl-rabbit.examples)
(defun test-send ()
(with-connection (conn)
(let ((socket (tcp-socket-new conn)))
(socket-open socket "localhost" 5672)
(login-sasl-plain conn "/" "guest" "guest")
(with-channel (conn 1)
(basic-publish conn 1
:exchange "test-ex"
... | null | https://raw.githubusercontent.com/lokedhs/cl-rabbit/9603204715bb13f09243dc286c5ad4bd51b4fd7b/src/examples.lisp | lisp | (in-package :cl-rabbit.examples)
(defun test-send ()
(with-connection (conn)
(let ((socket (tcp-socket-new conn)))
(socket-open socket "localhost" 5672)
(login-sasl-plain conn "/" "guest" "guest")
(with-channel (conn 1)
(basic-publish conn 1
:exchange "test-ex"
... | |
fe01a0a8cc86ce15d27d6ca169c9aad86b229e593e51e5e1933a7cda23025e8e | austinhaas/kanren | build_oc.clj | (ns pettomato.kanren.cKanren.build-oc)
(defmacro build-oc [op & args]
(let [vars (repeatedly (count args) gensym)]
`(let [~@(interleave vars args)]
(list (~op ~@vars) (quote ~op) ~@vars))))
| null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/src/pettomato/kanren/cKanren/build_oc.clj | clojure | (ns pettomato.kanren.cKanren.build-oc)
(defmacro build-oc [op & args]
(let [vars (repeatedly (count args) gensym)]
`(let [~@(interleave vars args)]
(list (~op ~@vars) (quote ~op) ~@vars))))
| |
47dd63b90da575727425abf865de41d1dff7c7866de4873d8d25a1c883b41c4f | rescript-lang/rescript-editor-support | omd_html.ml | (***********************************************************************)
OMD : Markdown tool in
( c ) 2014 by < >
Licence : ISC
(* -support-policy/isc-license/ *)
(***********************************************************************... | null | https://raw.githubusercontent.com/rescript-lang/rescript-editor-support/f6afacf93194036fafcff050cdaff150a85ccbe0/src/vendor/omd/omd_html.ml | ocaml | *********************************************************************
-support-policy/isc-license/
*********************************************************************
HTML5 | OMD : Markdown tool in
( c ) 2014 by < >
Licence : ISC
type html = html_node list
and html_node =
| Node of nodename * attributes * html
| Data of string
| Rawdata of string
| Comment of string
and nodename = string
and attrib... |
a59d5a437a93e4e0e84e82a0ca2818d6635b568a9d71289acd27c48d5b157b97 | nickzuber/infrared | initialize_function_declarations.ml | open InfraredParser.Ast
open InfraredAst
exception Unexpected_compiler_phase of string
let rec init_func_statement (statement : statement) (env : environment) : statement =
let (loc, statement) = statement in
match statement with
| FunctionDeclaration ((name_loc, name), params, body) ->
let param_d_types = ... | null | https://raw.githubusercontent.com/nickzuber/infrared/904263ad9ee425c536937a48e0c70217e4298257/InfraredCompiler/transformers/initialize_function_declarations.ml | ocaml | Assign types to arguments
Assign types to inner body function declarations
The environment is just mutated here and it doesn't actually conver this into a
* typed program. This is important because this phase happens before we begin to
* typify the program. Function declarations are statements, so they don't act... | open InfraredParser.Ast
open InfraredAst
exception Unexpected_compiler_phase of string
let rec init_func_statement (statement : statement) (env : environment) : statement =
let (loc, statement) = statement in
match statement with
| FunctionDeclaration ((name_loc, name), params, body) ->
let param_d_types = ... |
80a9d4c6552c0b6239529d98c965239802315bf168e16b0cd5df5f118520942c | c4-project/c4f | storelike.ml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/fuzz_actions/test/storelike.ml | ocaml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | |
f7c5d8bf162e04e86363db6023ec9a3d2be06a0175d8bcf3ddd64ccf1a47dc65 | byteverse/byteslice | Types.hs | # language BangPatterns #
# language DataKinds #
# language MagicHash #
{-# language TypeFamilies #-}
# language DuplicateRecordFields #
module Data.Bytes.Types
( Bytes(..)
, Bytes#(..)
, MutableBytes(..)
, UnmanagedBytes(..)
, BytesN(..)
, ByteArrayN(..)
) where
import Data.Bytes.Internal (Bytes(..))
i... | null | https://raw.githubusercontent.com/byteverse/byteslice/965e70d08c012b335104a6572ada68c6289482de/src/Data/Bytes/Types.hs | haskell | # language TypeFamilies #
by a phantom type variable. Consumers of this data constructor must be
careful to preserve the expected invariant.
# UNPACK #
# UNPACK #
by a phantom type variable. Consumers of this data constructor must be
careful to preserve the expected invariant.
| A slice of a 'MutableByteArray'.
# ... | # language BangPatterns #
# language DataKinds #
# language MagicHash #
# language DuplicateRecordFields #
module Data.Bytes.Types
( Bytes(..)
, Bytes#(..)
, MutableBytes(..)
, UnmanagedBytes(..)
, BytesN(..)
, ByteArrayN(..)
) where
import Data.Bytes.Internal (Bytes(..))
import Data.Primitive (ByteArra... |
4accfb92d320136ff2da1872ec847ba6604d081b99eeeea29aa78e412fa523b9 | clj-kondo/clj-kondo | reify_test.clj | (ns clj-kondo.reify-test
(:require [clj-kondo.test-utils :refer [lint! assert-submaps]]
[clojure.test :as t :refer [deftest is]]))
(deftest reify-test
(assert-submaps
'({:file "<stdin>", :row 1, :col 36, :level :warning, :message "unused binding x"})
(lint! "(reify clojure.lang.IDeref (deref [x] ... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/e5ed49ea15c9c0861f80a4135ac8de514afb0b1b/test/clj_kondo/reify_test.clj | clojure | (ns clj-kondo.reify-test
(:require [clj-kondo.test-utils :refer [lint! assert-submaps]]
[clojure.test :as t :refer [deftest is]]))
(deftest reify-test
(assert-submaps
'({:file "<stdin>", :row 1, :col 36, :level :warning, :message "unused binding x"})
(lint! "(reify clojure.lang.IDeref (deref [x] ... | |
1e608c4045bcd6cba3171d540857c484d953ddc8f763cf8142afd9a24c7c0a06 | middlesphere/clj-terminal | core_test.clj | (ns clj-terminal.core-test
(:require [clojure.test :refer :all]
[clj-terminal.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/middlesphere/clj-terminal/aef8d0eca869a958bbe129ec2e878640c5134278/test/clj_terminal/core_test.clj | clojure | (ns clj-terminal.core-test
(:require [clojure.test :refer :all]
[clj-terminal.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
2678a0e92ea56ffbc4ffb51330839a47d6624a016b4d9688c9bd2c80dacda010 | yetanalytics/datasim | user.clj | (ns user
(:require [clojure.repl :refer [source doc apropos]]
[clojure.pprint :refer [pprint]]))
(set! *warn-on-reflection* true)
| null | https://raw.githubusercontent.com/yetanalytics/datasim/0047cb3123e32b72380ea31ec98a26ef85543b63/src/dev/user.clj | clojure | (ns user
(:require [clojure.repl :refer [source doc apropos]]
[clojure.pprint :refer [pprint]]))
(set! *warn-on-reflection* true)
| |
ee212fea482d962cc31981977b3b5ee1bedbf5389ea2f3053e8cf02632671ad3 | G-Corp/kafe | kafe_protocol_describe_group.erl | % @hidden
-module(kafe_protocol_describe_group).
-compile([{parse_transform, lager_transform}]).
-include("../include/kafe.hrl").
-define(MAX_VERSION, 0).
-export([
run/1,
request/2,
response/2
]).
run(GroupId) ->
kafe_protocol:run(
?DESCRIBE_GROUPS_REQUEST,
?MAX_VERSION,... | null | https://raw.githubusercontent.com/G-Corp/kafe/78e014ae5b6d7e1077aa5cabf4adc21ed7abe203/src/kafe_protocol_describe_group.erl | erlang | @hidden
DescribeGroups Request (Version: 0) => [group_ids]
DescribeGroups Response (Version: 0) => [groups]
groups => error_code group_id state protocol_type protocol [members]
error_code => INT16
group_id => STRING
state => STRING
protocol_type => STRING
protocol => STRING
members => member_id ... | -module(kafe_protocol_describe_group).
-compile([{parse_transform, lager_transform}]).
-include("../include/kafe.hrl").
-define(MAX_VERSION, 0).
-export([
run/1,
request/2,
response/2
]).
run(GroupId) ->
kafe_protocol:run(
?DESCRIBE_GROUPS_REQUEST,
?MAX_VERSION,
{fun ... |
1d41d6a18271747cdbb3392424c74a4762c74dcced4d8af567f9e1c68504f689 | JHU-PL-Lab/jaylang | indirect03.ml |
let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1085 = 0
let rec c0_COEFFICIENT_1084 = 0
let id_1030 set_flag_f_1191 s_f_x_1188 x_1031 = x_1031
let app_1032 x_DO_NOT_CARE_1222 x_DO_NOT_CARE_1223 h_EXPARAM_1087 x_DO_NOT_CARE_1220 x_DO_NOT_CARE_1221 h_1033 x_DO_NOT_CARE_1218 x_DO_NO... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/benchmark/cases/mochi_origin/termination/indirect03.ml | ocaml |
let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1085 = 0
let rec c0_COEFFICIENT_1084 = 0
let id_1030 set_flag_f_1191 s_f_x_1188 x_1031 = x_1031
let app_1032 x_DO_NOT_CARE_1222 x_DO_NOT_CARE_1223 h_EXPARAM_1087 x_DO_NOT_CARE_1220 x_DO_NOT_CARE_1221 h_1033 x_DO_NOT_CARE_1218 x_DO_NO... | |
8ce6aa3da016e910e38188e74acd84bbab3901d65ce80839b83c1d49c9ab8270 | camllight/camllight | compile.ml | #open "tables";;
let catenate_sep sep =
function
[] -> ""
| x::l -> it_list (fun s s' -> s^sep^s') x l
;;
(* Left to Right map *)
let maplr f = function
[] -> []
| [a] -> [f a]
| l -> map_f l
where rec map_f = function
[] -> [] | a::l -> let x = f a in x::map_f l
;;
* Pretty pr... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk/compiler/compile.ml | ocaml | Left to Right map
Extract all types from a template
Produce a documentation version of a template
* Type definitions
List of constructors, for runtime subtyping
Definition of a type
The type itself
The set of its constructors
sp before "type" to avoid being picked up in documentation
The set of all... | #open "tables";;
let catenate_sep sep =
function
[] -> ""
| x::l -> it_list (fun s s' -> s^sep^s') x l
;;
let maplr f = function
[] -> []
| [a] -> [f a]
| l -> map_f l
where rec map_f = function
[] -> [] | a::l -> let x = f a in x::map_f l
;;
* Pretty print a type
* used t... |
d6b1c4c1b35e2ebe83b5cd062b80087ea35d83fd3250f8e6c49e28aff49e3a03 | zachjs/sv2v | Package.hs | # LANGUAGE TupleSections #
sv2v
- Author : < >
-
- Conversion for packages and global declarations
-
- This conversion first makes a best - effort pass at resolving any simple
- declaration ordering issues in the input . Many conversions require that
- declarations precede their first usage . ... | null | https://raw.githubusercontent.com/zachjs/sv2v/e00582de8f1ccf9b4ad1f1a262eb43c27cdcc1bd/src/Convert/Package.hs | haskell | utility for inserting package items into a set of module items as needed
utility for appling a prefix to all of the top level items in a module
collect packages and global package items
elaborate all packages and their usages
write down identifiers that might conflict with the generated names for
injected package... | # LANGUAGE TupleSections #
sv2v
- Author : < >
-
- Conversion for packages and global declarations
-
- This conversion first makes a best - effort pass at resolving any simple
- declaration ordering issues in the input . Many conversions require that
- declarations precede their first usage . ... |
fd77a8d2033fe2cf5cf8ad4420699da822d955e17b397bd763ba284aba88c930 | esl/erlang-web | wpart_valid.erl | The contents of this file are subject to the Erlang Web Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
Erlang Web Public License along with this software . If not , it can be
%% retrieved via the world... | null | https://raw.githubusercontent.com/esl/erlang-web/2e5c2c9725465fc5b522250c305a9d553b3b8243/lib/wpart-1.4.1/src/wpart_valid.erl | erlang | compliance with the License. You should have received a copy of the
retrieved via the world wide web at -consulting.com/.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
---------------------------------... | The contents of this file are subject to the Erlang Web Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
Erlang Web Public License along with this software . If not , it can be
Software distributed under the License is distributed on an " AS IS "
The Initial Developer o... |
89f6c66efb79f684a0e1e9d2c43d3fd395beddf0e73c3051cb2febef198103cf | upenn-cis1xx/camelot | match.ml | (*Pattern match with booleans*)
let b () =
let b = false in
let result = begin match b with
| false -> true
| true -> false
end in ()
(*Pattern match with numbers*)
let b () =
let b = 1 in
let result = begin match b with
| 2 -> true
| 3 -> false
end in ()
(*Pattern mat... | null | https://raw.githubusercontent.com/upenn-cis1xx/camelot/2d7e8db8abb8c1ad8187bfeb94499fe1746bb664/test/examples/match.ml | ocaml | Pattern match with booleans
Pattern match with numbers
Pattern match with a long list of strings (this is considered OK)
Pattern match with lists
Pattern matching with a overly complex cons case
should not fire
Pattern matching on a record
shouldn't trigger
tuple unwrapping tests | let b () =
let b = false in
let result = begin match b with
| false -> true
| true -> false
end in ()
let b () =
let b = 1 in
let result = begin match b with
| 2 -> true
| 3 -> false
end in ()
let b () =
let b = "Tuesday" in
let result = begin match b with
|... |
25a0e8c43ef91bbdcade67d81a49690d815e88647813ed4e36211db636a29f45 | RefactoringTools/HaRe | NoWhere.hs | module LiftToToplevel.NoWhere where
liftToTopLevel' modName pn = do
renamed <- getRefactRenamed
return []
where
step1 : divide the module 's top level declaration list into three parts :
' parent ' is the top level declaration containing the lifted declaration ,
' before ' and ` after ` a... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/LiftToToplevel/NoWhere.hs | haskell | do | module LiftToToplevel.NoWhere where
liftToTopLevel' modName pn = do
renamed <- getRefactRenamed
return []
where
step1 : divide the module 's top level declaration list into three parts :
' parent ' is the top level declaration containing the lifted declaration ,
' before ' and ` after ` a... |
82bf524a0942cd0b5b8bd9f8171643900c14fcdde796765e4ca2aac1c9affeff | josephwilk/musical-creativity | musician.clj | (ns musical-creativity.musician
(:require
[overtone.live :refer :all]))
(defn halt []
(stop))
(defn play [events musician-fn]
(let [start-time (+ 1000 (overtone.live/now))]
(println)
(dorun (map #(musician-fn % start-time) events))))
| null | https://raw.githubusercontent.com/josephwilk/musical-creativity/c2e6aab2a26d69ee2e51f4fad84fa3a71805e6ca/src/musical_creativity/musician.clj | clojure | (ns musical-creativity.musician
(:require
[overtone.live :refer :all]))
(defn halt []
(stop))
(defn play [events musician-fn]
(let [start-time (+ 1000 (overtone.live/now))]
(println)
(dorun (map #(musician-fn % start-time) events))))
| |
0e445c2a2065dee4c5acc90fb840c2d9977a5c8bc56d92b24518f7fc6d7b907e | haskell-compat/deriving-compat | Deriving.hs | |
Module : Data . Ix . Deriving
Copyright : ( C ) 2015 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Portability : Template Haskell
Exports functions to mechanically derive ' Ix ' instances .
Module: Data.Ix.Deriving
Copyright: (C) 2015-2017 Ryan Scott
Lice... | null | https://raw.githubusercontent.com/haskell-compat/deriving-compat/23e62c003325258e925e6c2fe7e46fafdeaf199a/src/Data/Ix/Deriving.hs | haskell | * 'Ix'
* 'deriveIx' limitations
$constraints | |
Module : Data . Ix . Deriving
Copyright : ( C ) 2015 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Portability : Template Haskell
Exports functions to mechanically derive ' Ix ' instances .
Module: Data.Ix.Deriving
Copyright: (C) 2015-2017 Ryan Scott
Lice... |
dbfc83d7bae706307ff203b0ec39c8a2d639fe9b219bad83214048dc4996f965 | trefis/Facade | test.ml | open Core.Std
open Lwt
let () =
Lwt_main.run (
Mopidy.search ~tag:`artist "eminem"
>>= function
| Error e ->
printf "Error: %s\n%!" e ;
exit (-1)
| Ok lst ->
printf "Sources:" ;
List.iter lst ~f:(fun sr ->
let open Types in
printf "\n + %s" sr.SearchResult.sou... | null | https://raw.githubusercontent.com/trefis/Facade/1054df7effca8db0b20aeb77490ae93a758b4558/test.ml | ocaml | open Core.Std
open Lwt
let () =
Lwt_main.run (
Mopidy.search ~tag:`artist "eminem"
>>= function
| Error e ->
printf "Error: %s\n%!" e ;
exit (-1)
| Ok lst ->
printf "Sources:" ;
List.iter lst ~f:(fun sr ->
let open Types in
printf "\n + %s" sr.SearchResult.sou... | |
215c095571ca16627c0deb01d6f91e91a1027ec97d246fecfa6e07af71ae0dd0 | imandra-ai/iex-auction-model | short_sale_handling.ml | open Helpers;;
open Iex_model.Prelude;;
open Iex_model.Price;;
open Iex_model.Order;;
open Iex_model.Priority;;
open Iex_model.Fill;;
open Iex_model.Clearing_price;;
open Iex_model.Auction;;
(************************************************************)
(*** Interesting behaviour of short sale order handling ***)
(*... | null | https://raw.githubusercontent.com/imandra-ai/iex-auction-model/41436bd1506992c69188179a330cee1e5244222b/examples/short_sale_handling.ml | ocaml | **********************************************************
** Interesting behaviour of short sale order handling **
**********************************************************
Note that this behaviour is based on our interpretation
of the information in the section on short sale order
handling from the IEX auct... | open Helpers;;
open Iex_model.Prelude;;
open Iex_model.Price;;
open Iex_model.Order;;
open Iex_model.Priority;;
open Iex_model.Fill;;
open Iex_model.Clearing_price;;
open Iex_model.Auction;;
In we showed that it it possible for
the total volume matched to decrease when we add an extra
order into the auct... |
d17bacc53004f7e2f0e70347dac1c92593ef76711a1967d49514804db048201e | imdea-software/leap | ArrangementSolverSpec.mli |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/solvers/theory/ArrangementSolverSpec.mli | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
9d89fb29bb09d02e1642df43f7fdf74c92af37cec76b3e7792d7a52bad80d70a | mhuebert/re-view | drawer.cljs | (ns re-view.material.components.drawer
(:require [re-view.core :as v]
[re-view.material.mdc :as mdc]
[re-view.routing :as routing]
[re-view.material.util :as util]
[re-view.material.ext :as ext]
["@material/animation" :refer [getCorrectEventName]]
... | null | https://raw.githubusercontent.com/mhuebert/re-view/ba38cd09b78b3c6db6a2983f3e2cf1bd6294564f/material/src/re_view/material/components/drawer.cljs | clojure | (ns re-view.material.components.drawer
(:require [re-view.core :as v]
[re-view.material.mdc :as mdc]
[re-view.routing :as routing]
[re-view.material.util :as util]
[re-view.material.ext :as ext]
["@material/animation" :refer [getCorrectEventName]]
... | |
120752ef5bbb41d88aead87d7a9ce3f2f24a316aa0bcde85684b4d124e196c0a | donaldsonjw/bigloo | parse_args.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / bdb / bdb / Init / parse - args.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/bdb/bdb/Init/parse_args.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Command-line parsing */
*===========================... | * serrano / prgm / project / bigloo / bdb / bdb / Init / parse - args.scm * /
* Author : * /
* Creation : Thu Jun 29 11:56:20 1995 * /
* Last change : Fri Aug 11 15:00:04 2006 ( serrano ) * /
(modu... |
038358b72bbaec3ea3850d53f4ceed9a0f805e03a8a7013b07baa2b588f8010c | gorillalabs/sparkling | core_test.clj | (ns sparkling.ml.core-test
(:require [clojure.test :as t]
[sparkling.conf :as conf]
[sparkling.api :as s]
[sparkling.ml.core :as mlc]
[clojure.java.io :as io])
(:import [org.apache.spark.api.java JavaSparkContext]
[org.apache.spark.ml Pipeline PipelineModel Pipeli... | null | https://raw.githubusercontent.com/gorillalabs/sparkling/ffedcc70fd46bf1b48405be8b1f5a1e1c4f9f578/test/sparkling/ml/core_test.clj | clojure | (ns sparkling.ml.core-test
(:require [clojure.test :as t]
[sparkling.conf :as conf]
[sparkling.api :as s]
[sparkling.ml.core :as mlc]
[clojure.java.io :as io])
(:import [org.apache.spark.api.java JavaSparkContext]
[org.apache.spark.ml Pipeline PipelineModel Pipeli... | |
2566aaf141b613fbb7f45b9ddf71991aed35358d07c4fcdfc743ca3114a2b86d | isovector/talks | Effect.hs | module Effect where
------------------------------------------------------------------------------
withdrawMTL :: ( MonadIO m
, MonadLogger m
)
=> Int
-> m (Maybe Int)
withdrawMTL desired = do
amount <- getCurrentBalance
if amount < desired
then do
... | null | https://raw.githubusercontent.com/isovector/talks/78427ecf720fef5cd16572accc245f44d6ebc21f/freer/Effect.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
how can we test this??
----------------------------------------------------------------------------
-----------------------------------------------------------------... | module Effect where
withdrawMTL :: ( MonadIO m
, MonadLogger m
)
=> Int
-> m (Maybe Int)
withdrawMTL desired = do
amount <- getCurrentBalance
if amount < desired
then do
log "not enough funds"
return Nothing
else do
putCurrentBa... |
ade87da1913fe2c0d57e2aaefe4072a07d347cd033d26c35bb9d4e3be509c326 | zadean/xqerl | misc_HigherOrderFunctions_SUITE.erl | -module('misc_HigherOrderFunctions_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['hof-001'/1]).
-export(['hof-002'/1]).
-export(['hof-003'/1]).
-expor... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/misc/misc_HigherOrderFunctions_SUITE.erl | erlang | -module('misc_HigherOrderFunctions_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['hof-001'/1]).
-export(['hof-002'/1]).
-export(['hof-003'/1]).
-expor... | |
acb9af7dfb8d9aec4157317d0a49789ae79ee7eaca0ff8d5fe1012bcefdfdfde | HaskellForCats/HaskellForCats | linkedList.hs | module LinkedList where
Data LinkedList = LinkedList Head | Tail | Next | Prev
| null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/linkedList.hs | haskell | module LinkedList where
Data LinkedList = LinkedList Head | Tail | Next | Prev
| |
20540ddf9f17d578168d0a3b30e9e65d97fa5343e82e93455eb4ad898acf739e | hjcapple/reading-sicp | exercise_4_69.scm | #lang sicp
P324 - [ 练习 4.69 ]
(#%require "queryeval.scm")
(initialize-data-base
'(
表示
(son Cain Enoch)
(son Enoch Irad)
(son Irad Mehujael)
(son Mehujael Methushael)
(son Methushael Lamech)
(wife Lamech Ada)
(son Ada Jabal)
(son Ada Jubal)
(rule (grandson ?G ?S)
... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/76fbac74c0b1ec110fa73459fe029af0552e349b/chapter_4/exercise_4_69.scm | scheme | #lang sicp
P324 - [ 练习 4.69 ]
(#%require "queryeval.scm")
(initialize-data-base
'(
表示
(son Cain Enoch)
(son Enoch Irad)
(son Irad Mehujael)
(son Mehujael Methushael)
(son Methushael Lamech)
(wife Lamech Ada)
(son Ada Jabal)
(son Ada Jubal)
(rule (grandson ?G ?S)
... | |
78316d9cf09246dad2efe4955b38833e9f7a5c9d2b825d76fb5bd0df70c04a82 | steinuil/nene | pattern.ml | type t = { regexp : Re.re; episode_idx : int; version_idx : int }
let ( let* ) = Option.bind
let around sep input =
let around_re =
let open Re in
[
group (seq [ bos; non_greedy (rep any) ]);
str sep;
group (seq [ rep any; eos ]);
]
|> seq |> compile
in
let* groups = Re.exec_op... | null | https://raw.githubusercontent.com/steinuil/nene/7fd538a826fc1c7ad107d931849b1be1b87b0692/nene/pattern.ml | ocaml | type t = { regexp : Re.re; episode_idx : int; version_idx : int }
let ( let* ) = Option.bind
let around sep input =
let around_re =
let open Re in
[
group (seq [ bos; non_greedy (rep any) ]);
str sep;
group (seq [ rep any; eos ]);
]
|> seq |> compile
in
let* groups = Re.exec_op... | |
6755743c2ba5611a02389211bcfadcb68b8a9e08d8b69e5635a80c2e0239ef8d | auser/alice | skel_web.erl | @author author < >
YYYY author .
%% @doc Web server for skel.
-module(skel_web).
-author('author <>').
-export([start/1, stop/0, loop/2]).
%% External API
start(Options) ->
{DocRoot, Options1} = get_option(docroot, Options),
Loop = fun (Req) ->
?MODULE:loop(Req, DocRoot)
... | null | https://raw.githubusercontent.com/auser/alice/e0f867071ede99f451d09053608bd6719c72d1c9/deps/mochiweb/priv/skel/src/skel_web.erl | erlang | @doc Web server for skel.
External API
Internal API | @author author < >
YYYY author .
-module(skel_web).
-author('author <>').
-export([start/1, stop/0, loop/2]).
start(Options) ->
{DocRoot, Options1} = get_option(docroot, Options),
Loop = fun (Req) ->
?MODULE:loop(Req, DocRoot)
end,
mochiweb_http:start([{name, ?MODULE... |
2c1c2f3437de74580677b0147fbe769f5d20c5fa084cebbad679c7b4ae1f7653 | wargrey/graphics | heap.rkt | #lang racket
(require "../../constructor.rkt")
(require "../../composite.rkt")
(require "../../font.rkt")
(require "../../color.rkt")
(require "../../digitama/unsafe/convert.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define index->node
(λ [i]
(def... | null | https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/bitmap/tamer/composite/heap.rkt | racket | #lang racket
(require "../../constructor.rkt")
(require "../../composite.rkt")
(require "../../font.rkt")
(require "../../color.rkt")
(require "../../digitama/unsafe/convert.rkt")
(define index->node
(λ [i]
(define datum (bitmap-text (number->string (add1 i))))
(define r (* (bitmap-height datum) 0.4))
... | |
0b7e09ac1d40978bdfc0b1c3b591b709032b69e974738ca5915965c913b5c430 | racket/web-server | length.rkt | #lang web-server/insta
(define (start req)
(response 200 #"Okay" (current-seconds)
#"text/html" empty
(λ (op) (write-bytes #"PONG" op))))
| null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-test/tests/web-server/pr/length.rkt | racket | #lang web-server/insta
(define (start req)
(response 200 #"Okay" (current-seconds)
#"text/html" empty
(λ (op) (write-bytes #"PONG" op))))
| |
daf8e155c6548dc761861826f9ae5ff29df1eb97c40aabf7764fb71ec7311fb2 | vivid-inc/ash-ra-template | project.clj | ; Copyright 2021 Vivid Inc.
(defproject
net.vivid-inc/art-cli "0.6.1"
:note "THIS FILE IS AUTOMATICALLY GENERATED BY bin/gen.sh"
:description "art-cli aggregates code common to the translation and processing of Ash Ra Template command line parameters into parameters for ART's Clojure API."
:url "-inc/ash-ra-t... | null | https://raw.githubusercontent.com/vivid-inc/ash-ra-template/f64be7efd6f52ccd451cddb851f02511d1665b11/art-cli/project.clj | clojure | Copyright 2021 Vivid Inc.
Enable this to assist with determining :excludes whenever dependencies and
plugins change, then re-disable it.
:pedantic? :abort |
(defproject
net.vivid-inc/art-cli "0.6.1"
:note "THIS FILE IS AUTOMATICALLY GENERATED BY bin/gen.sh"
:description "art-cli aggregates code common to the translation and processing of Ash Ra Template command line parameters into parameters for ART's Clojure API."
:url "-inc/ash-ra-template"
:license {:distri... |
8ec50e3fa151b00dca4d18f6e6d73805c4be89124bb348259fc0419cbd9c3d75 | facebookincubator/hsthrift | Timing.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
module Util.Timing
( reportTime
, reportAndShowTime
, showAllocs
, showTime
, timeIt
, timeNF
, timeItNoGC
) where
import Control.DeepSeq (NFData, force)
import Control.Exception (evaluate)
import Control.Monad.IO.Class
import Data.Time.Clock
impo... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/675666e2b7b6c00426763907ecacbb984d93ddfc/common/util/Util/Timing.hs | haskell | | Runs an 'IO' operation and prints how long it took. Also returns
the timing value for use.
| Runs an 'IO' operation and reports how long it took. Useful for
ad-hoc benchmarking.
| Converts a number of bytes to a human-friendsly string.
the number of bytes it allocated, and the result it returned.
| Runs an 'IO... | Copyright ( c ) Facebook , Inc. and its affiliates .
module Util.Timing
( reportTime
, reportAndShowTime
, showAllocs
, showTime
, timeIt
, timeNF
, timeItNoGC
) where
import Control.DeepSeq (NFData, force)
import Control.Exception (evaluate)
import Control.Monad.IO.Class
import Data.Time.Clock
impo... |
7d0fcad51017b2bbafd4e7d4a68f91942a8af852bf729f657aea9099aeebe0e3 | tek/chiasma | Query.hs | module Chiasma.Codec.Query where
import Data.Char (isUpper, toLower)
import qualified Data.Text as Text (concatMap, singleton)
import GHC.Generics (C1, D1, S1, Selector, selName, (:*:))
class TmuxDataQuery f where
dataQuery :: [Text]
instance TmuxDataQuery f => (TmuxDataQuery (D1 c f)) where
dataQuery = dataQuer... | null | https://raw.githubusercontent.com/tek/chiasma/45ce231f629db9ed67c78ce872ac719a90a217bd/packages/chiasma/lib/Chiasma/Codec/Query.hs | haskell | module Chiasma.Codec.Query where
import Data.Char (isUpper, toLower)
import qualified Data.Text as Text (concatMap, singleton)
import GHC.Generics (C1, D1, S1, Selector, selName, (:*:))
class TmuxDataQuery f where
dataQuery :: [Text]
instance TmuxDataQuery f => (TmuxDataQuery (D1 c f)) where
dataQuery = dataQuer... | |
3f80bef451a85292f1a8cfcd1e152e5c05b0c1225e042aaf4b6975d9b4106d31 | puppetlabs/puppetdb | summary_stats.clj | (ns puppetlabs.puppetdb.query.summary-stats
(:require
[puppetlabs.kitchensink.core :as ks]
[puppetlabs.puppetdb.http :as http]
[puppetlabs.puppetdb.jdbc :as jdbc]
[puppetlabs.puppetdb.meta.version :as v]))
(def metadata-queries
{:table_usage
"select * from pg_stat_user_tables"
:index_usage
"s... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/src/puppetlabs/puppetdb/query/summary_stats.clj | clojure | (ns puppetlabs.puppetdb.query.summary-stats
(:require
[puppetlabs.kitchensink.core :as ks]
[puppetlabs.puppetdb.http :as http]
[puppetlabs.puppetdb.jdbc :as jdbc]
[puppetlabs.puppetdb.meta.version :as v]))
(def metadata-queries
{:table_usage
"select * from pg_stat_user_tables"
:index_usage
"s... | |
9c17c75b1e2db38de27c628a452cbb8ae9f7b475c302197f1bb1fe4f381bd9eb | oral-health-and-disease-ontologies/ohd-ontology | with-iterator-macro.lisp |
;; this macro passes the body in a lambda function to the function with-iterator-1
(defmacro with-iterator
((iterator &key
filespec ; options for opening file
headers-line
data-start-line
jdbc-url ; options for connecting to jdbc database
sql-string
(with-resultset-as-list t)
(with-results-a... | null | https://raw.githubusercontent.com/oral-health-and-disease-ontologies/ohd-ontology/ba3f502b86487c8ba5fa04ff8ba33312a1679570/src/vdw-translation/development-library/macros/with-iterator-macro.lisp | lisp | this macro passes the body in a lambda function to the function with-iterator-1
options for opening file
options for connecting to jdbc database
removing the default option ... causing problems
(iterator-fn '#'project-iterator)) ; function to create the iterator
test if iterator is not bound
this happend when wit... |
(defmacro with-iterator
((iterator &key
headers-line
data-start-line
sql-string
(with-resultset-as-list t)
(with-results-as-list t)
with-cached-results
iterator-fn)
&body body)
`(progn
(handler-case
(progn
( setf , iterator-1 , iterator )
(eval ,iterator... |
2257c60e338d4b24fb0cce2aa5b91d6f01290b1eab5b033d734aa0259460940c | jamii/erl-telehash | th_tapper.erl | % tapper handles .tap commands received from other nodes
% and sends replies whenever matching signals are received
-module(th_tapper).
-include("types.hrl").
-include("conf.hrl").
-include("log.hrl").
-export([start_link/0, tap/1, send_tap/3, match/2]).
-behaviour(gen_server).
-export([init/1, handle_call/3, handl... | null | https://raw.githubusercontent.com/jamii/erl-telehash/2c0218bbf7a543e318ed50a1d48fb481963f151e/src/th_tapper.erl | erlang | tapper handles .tap commands received from other nodes
and sends replies whenever matching signals are received
dict mapping addresses to taps
--- api ---
--- gen_server callbacks ---
--- internal functions ---
!!! have to sort keys to compare structs
--- end --- |
-module(th_tapper).
-include("types.hrl").
-include("conf.hrl").
-include("log.hrl").
-export([start_link/0, tap/1, send_tap/3, match/2]).
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-define(K, ?REPLICATION).
-record(state, {
}).
tap(List... |
c6484972b8a5d3d707076c89ee6ed81269baa712d97b8b091737ba9b0fd374a2 | realworldocaml/book | in_channel.ml | open! Base
type t = Caml.in_channel
let equal (t1 : t) t2 = phys_equal t1 t2
let seek = Caml.LargeFile.seek_in
let pos = Caml.LargeFile.pos_in
let length = Caml.LargeFile.in_channel_length
let stdin = Caml.stdin
let create ?(binary = true) file =
let flags = [ Open_rdonly ] in
let flags = if binary then Open_bin... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/stdio/src/in_channel.ml | ocaml | open! Base
type t = Caml.in_channel
let equal (t1 : t) t2 = phys_equal t1 t2
let seek = Caml.LargeFile.seek_in
let pos = Caml.LargeFile.pos_in
let length = Caml.LargeFile.in_channel_length
let stdin = Caml.stdin
let create ?(binary = true) file =
let flags = [ Open_rdonly ] in
let flags = if binary then Open_bin... | |
d313e1b10f6b789ed4451b473a8455a6333069670c6c255a89c538d521c8e788 | ucsd-progsys/liquidhaskell | Meet.hs | -- | This code has various wrappers around `meet` and `strengthen`
-- that are here so that we can throw decent error messages if
-- they fail. The module depends on `RefType` and `UX.Tidy`.
module Language.Haskell.Liquid.Types.Meet ( meetVarTypes ) where
import Text.PrettyPrint.HughesPJ (Doc)
import qu... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/8d905ff44e3b5c8b94d7ca561a1f1db1452caeec/src/Language/Haskell/Liquid/Types/Meet.hs | haskell | | This code has various wrappers around `meet` and `strengthen`
that are here so that we can throw decent error messages if
they fail. The module depends on `RefType` and `UX.Tidy`.
_hsD = F.pprint hsT
_lqD = F.pprint lqT
// | meetable emb t t '
// | otherwise = panicError... |
module Language.Haskell.Liquid.Types.Meet ( meetVarTypes ) where
import Text.PrettyPrint.HughesPJ (Doc)
import qualified Language.Fixpoint.Types as F
import Language.Haskell.Liquid.Types.Types
import Language.Haskell.Liquid.Types.RefType ()
import Liquid.GHC.API as Ghc
meetVar... |
9d90ddd28457bd672b3e50676f20473417976de19009913180e1e9a0cccd590f | cxxxr/apispec | encode.lisp | (defpackage #:apispec/classes/response/encode
(:use #:cl
#:apispec/utils
#:apispec/classes/response/errors)
(:import-from #:apispec/classes/response/class
#:response
#:responses
#:response-content
#:response-headers)
(:import-from #:a... | null | https://raw.githubusercontent.com/cxxxr/apispec/4bdd238f6b5effed305d284e0e6b7cef214e94a2/src/classes/response/encode.lisp | lisp | (defpackage #:apispec/classes/response/encode
(:use #:cl
#:apispec/utils
#:apispec/classes/response/errors)
(:import-from #:apispec/classes/response/class
#:response
#:responses
#:response-content
#:response-headers)
(:import-from #:a... | |
bcc15736c68f1456cd609740754e8919900a2cde410dc5aaa3bddd6ad0c25c2b | facebook/infer | NSSet.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/9d9a3a42b75697db86bc0da3092137f175782773/sledge/nonstdlib/NSSet.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.