_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 |
|---|---|---|---|---|---|---|---|---|
ecb7bab04649ca8025440bb7465819b2e167347f8f305db9dc92d82faf259ebe | AdRoll/rebar3_hank | parse_transf.erl | -module(parse_transf).
-export([parse_transform/2]).
-spec parse_transform(Forms, Options) -> Forms
when Forms :: [erl_parse:abstract_form() | erl_parse:form_info()],
Options :: [compile:option()].
parse_transform(Forms, _Options) -> % Options is purposefully left unused, here.
Forms.
| null | https://raw.githubusercontent.com/AdRoll/rebar3_hank/92dbd8292b797d2363f8572acaa99edd42fff727/test/files/unnecessary_function_arguments/parse_transf.erl | erlang | Options is purposefully left unused, here. | -module(parse_transf).
-export([parse_transform/2]).
-spec parse_transform(Forms, Options) -> Forms
when Forms :: [erl_parse:abstract_form() | erl_parse:form_info()],
Options :: [compile:option()].
Forms.
|
aa02d47e6aae2e6c420803b78149a640b16eb900fec6370e07051ee7dbcd866b | codedownio/sandwich | Baz.hs |
module UnitTests.NestedWithFile.Baz where
import Test.Sandwich
tests :: TopSpec
tests = it "tests baz nested with file" $ do
2 `shouldBe` 2
main = runSandwichWithCommandLineArgs defaultOptions tests
| null | https://raw.githubusercontent.com/codedownio/sandwich/950991e34f15f5bee5b258bb828b0cce4eb2b4ab/demos/demo-discover/app/UnitTests/NestedWithFile/Baz.hs | haskell |
module UnitTests.NestedWithFile.Baz where
import Test.Sandwich
tests :: TopSpec
tests = it "tests baz nested with file" $ do
2 `shouldBe` 2
main = runSandwichWithCommandLineArgs defaultOptions tests
| |
77417cfed352efc2fb558f64a97773f1275173d64ea01c0ada258a6491f026b4 | devaspot/games | id_generator.erl | -module(id_generator).
-behaviour(gen_server).
-export([start_link/0]).
-export([get_id/0,get_id2/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-record(state, {lastid = 1000000, robotid = 1500000}).
get_id() -> gen_server:call(?MODULE, get_id... | null | https://raw.githubusercontent.com/devaspot/games/a1f7c3169c53d31e56049e90e0094a3f309603ae/apps/server/src/sup/id_generator.erl | erlang | -module(id_generator).
-behaviour(gen_server).
-export([start_link/0]).
-export([get_id/0,get_id2/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-record(state, {lastid = 1000000, robotid = 1500000}).
get_id() -> gen_server:call(?MODULE, get_id... | |
257a20262223f5b0367048446dd8602cb20566176d979036333078c2011f73ea | facebookincubator/hsthrift | ServiceTest.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
# OPTIONS_GHC -fno - warn - unused - imports #
module ServiceTest where
import Data.Either.Combinators
import Test.HUnit
import TestRunner
import qualified Data.Map.Strict as Map
import Thrift.Compiler.Options
import Thrift.Compiler.Parser
import Thrift.Compiler... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/0d7e1c9a5d4fcb0996afada56534c3b081d0f566/tests/ServiceTest.hs | haskell | This import just makes sure the file compiles
Invalid Inputs --------------------------------------------------------------
------------------------------------------------------------------------------ | Copyright ( c ) Facebook , Inc. and its affiliates .
# OPTIONS_GHC -fno - warn - unused - imports #
module ServiceTest where
import Data.Either.Combinators
import Test.HUnit
import TestRunner
import qualified Data.Map.Strict as Map
import Thrift.Compiler.Options
import Thrift.Compiler.Parser
import Thrift.Compiler... |
2fb58fe60512064e2f2921c9d11fd270738896ff4b281a4ae67c2a9e2ccfe8cc | glebec/left-recursion | Expr.hs | module Expr where
data Expr = Lit Int | Sub Expr Expr deriving Show
-- alternatively, could use infix contructor:
data = Lit Int | Expr : - : deriving Show
| null | https://raw.githubusercontent.com/glebec/left-recursion/0364d9a4aed12c32acc6ecb236b2860ae15e51f3/src/Expr.hs | haskell | alternatively, could use infix contructor: | module Expr where
data Expr = Lit Int | Sub Expr Expr deriving Show
data = Lit Int | Expr : - : deriving Show
|
cb7cf2c2544130df53d7d51d34d6cda07aae8d919a7d94a56b2f9a902a2e07e1 | scheme/terminfo | terminfo-capabilities.scm | -*- Mode : Scheme ; scheme48 - package : terminfo -*-
;;;
(define *capabilities* (make-hash-table))
see tigetflag , tigetnum ,
(define (terminal:capability terminal name)
(let ((capability (hash-table-ref *capabilities* name)))
(when (or (null? terminal)
(not (terminal? terminal)))
(err... | null | https://raw.githubusercontent.com/scheme/terminfo/45541fdb8ffbc51dc1c894ac447a21161688fe1e/terminfo-capabilities.scm | scheme | scheme48 - package : terminfo -*-
|
(define *capabilities* (make-hash-table))
see tigetflag , tigetnum ,
(define (terminal:capability terminal name)
(let ((capability (hash-table-ref *capabilities* name)))
(when (or (null? terminal)
(not (terminal? terminal)))
(error "Invalid terminfo object"))
(when (null? capability)
... |
41ca59eb606b302a1e97a3dd5c1fb091c425911ab427aecf87aac77530c743c4 | fakedata-haskell/fakedata | Myst.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.Game.Myst where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Myst
import Faker.TH
$(generateFakeField "myst" "games")
$(generateFakeField "myst" "creatures")
$(generateFakeField "myst" "characters")
$(generat... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Game/Myst.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Game.Myst where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Myst
import Faker.TH
$(generateFakeField "myst" "games")
$(generateFakeField "myst" "creatures")
$(generateFakeField "myst" "characters")
$(generateFakeField "myst" "ages")
$(genera... |
25758d44965ff3203d475d549c8d0125b9ae39fdae1bd99f4a37c3448a4d6257 | racket/htdp | shared-typed.rkt | #lang typed/racket/base
;; the parts of shared.rkt that can easily
;; be represented using typed racket
(provide Varref-Set
Binding-Set
Arglist
varref-set?
binding-set?
label?
step-result?
(struct-out Before-After-Result)
(struct-out Before-Error... | null | https://raw.githubusercontent.com/racket/htdp/f40ad0ce8d3424dd0ffed6ca61a3abcc81c7cd5a/htdp-lib/stepper/private/shared-typed.rkt | racket | the parts of shared.rkt that can easily
be represented using typed racket
should be set?
possible values for the label on a mark
represents the result of a step, traveling from the model
to the view-controller
dropping types on structure elements to allow
compilation to convert these into flat contracts.
hopin... | #lang typed/racket/base
(provide Varref-Set
Binding-Set
Arglist
varref-set?
binding-set?
label?
step-result?
(struct-out Before-After-Result)
(struct-out Before-Error-Result)
(struct-out Error-Result)
(struct-out Runaway-Process... |
090f7909a1f7fa6a32c51ffbfb398dc981e2d4fbbfc95fe8cec285890d7dd49a | flipstone/haskell-for-beginners | 2_a_few_more_recursive_functions.hs | -- Define a function to remove all the elements of
one list from another . Given the lists [ 1,2,3 ]
and [ 5,6,1,7,2,8 ] it should return [ 5,6,7,8 ]
remove :: Eq a => [a] -> [a] -> [a]
remove _ [] = []
remove xs (y:ys) | y `elem` xs = remove xs ys
| otherwise = y:remove xs ys
Define a function... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_05/2_a_few_more_recursive_functions.hs | haskell | Define a function to remove all the elements of
Given the lists [1,2,3]
zips them into triples, stopping at the end of the
shortest list.
Define a function to count the occurrences of
a given element in a list
(Hint: you may need a helper function to do the recursion) | one list from another . Given the lists [ 1,2,3 ]
and [ 5,6,1,7,2,8 ] it should return [ 5,6,7,8 ]
remove :: Eq a => [a] -> [a] -> [a]
remove _ [] = []
remove xs (y:ys) | y `elem` xs = remove xs ys
| otherwise = y:remove xs ys
Define a function to perform the union of two
lists . Any elements... |
095041f032ada823a4343cf4f7a230d13d89a55a94b8ec3629ff65f5634e9950 | TrustInSoft/tis-interpreter | kernel_function.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/ast_data/kernel_function.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
2c6aff4b672bc42882f0a558a1d0d962e5c4843770cd07e6b543e9adee983c4b | CLowcay/hgbc | Envelope.hs | # LANGUAGE RecordWildCards #
module Machine.GBC.Audio.Envelope
( Envelope,
newEnvelope,
initEnvelope,
clockEnvelope,
envelopeVolume,
)
where
import Control.Monad (unless)
import Data.Bits (Bits (..))
import Data.Word (Word8)
import Machine.GBC.Audio.Common (FrameSequencerOutput, nextStepWillClockE... | null | https://raw.githubusercontent.com/CLowcay/hgbc/76a8cf91f3c3b160eadf019bc8fc75ef07601c2f/core/src/Machine/GBC/Audio/Envelope.hs | haskell | # LANGUAGE RecordWildCards #
module Machine.GBC.Audio.Envelope
( Envelope,
newEnvelope,
initEnvelope,
clockEnvelope,
envelopeVolume,
)
where
import Control.Monad (unless)
import Data.Bits (Bits (..))
import Data.Word (Word8)
import Machine.GBC.Audio.Common (FrameSequencerOutput, nextStepWillClockE... | |
efb4ee0cbf752d1d3ea164f0a0a3dc3fb2b325fbba7e5e41b956f51c17dfefab | footprintanalytics/footprint-web | tiles_test.clj | (ns metabase.api.tiles-test
"Tests for `/api/tiles` endpoints."
(:require [cheshire.core :as json]
[clojure.set :as set]
[clojure.test :refer :all]
[metabase.api.tiles :as api.tiles]
[metabase.query-processor :as qp]
[metabase.test :as mt]
[sch... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/api/tiles_test.clj | clojure | lat
lon | (ns metabase.api.tiles-test
"Tests for `/api/tiles` endpoints."
(:require [cheshire.core :as json]
[clojure.set :as set]
[clojure.test :refer :all]
[metabase.api.tiles :as api.tiles]
[metabase.query-processor :as qp]
[metabase.test :as mt]
[sch... |
bcfbfe8aa6ceb50d18c211aa912032aa90242d14524946230e4ba64869ba92bc | yetibot/yetibot | clojure.clj | (ns yetibot.test.commands.clojure
(:require [midje.sweet :refer [=> fact facts throws]]
[yetibot.commands.clojure :refer :all]
[yetibot.core.midje :refer [data value]]))
(def sample-data
{:id 1234,
:members
'({:id 1001, :tid 2001}
{:id 1002, :tid 2002}
{:id 1003, :tid 2003}
... | null | https://raw.githubusercontent.com/yetibot/yetibot/2fb5c1182b1a53ab0e433d6bab2775ebd43367de/test/yetibot/test/commands/clojure.clj | clojure | (ns yetibot.test.commands.clojure
(:require [midje.sweet :refer [=> fact facts throws]]
[yetibot.commands.clojure :refer :all]
[yetibot.core.midje :refer [data value]]))
(def sample-data
{:id 1234,
:members
'({:id 1001, :tid 2001}
{:id 1002, :tid 2002}
{:id 1003, :tid 2003}
... | |
1d92f7ad33ffa3563223824839c1d28b9c71e69000f70073cd14b0ceaee03350 | graninas/Hydra | Main.hs | {-# LANGUAGE PackageImports #-}
module Main where
import Labyrinth.Prelude
import qualified "hydra-base" Hydra.Domain as D
import qualified "hydra-base" Hydra.Runtime as R
import qualified "hydra-free" Hydra.Interpreters as R
import qualified Labyrinth as Lab
import ... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/app/labyrinth/src/Main.hs | haskell | # LANGUAGE PackageImports # |
module Main where
import Labyrinth.Prelude
import qualified "hydra-base" Hydra.Domain as D
import qualified "hydra-base" Hydra.Runtime as R
import qualified "hydra-free" Hydra.Interpreters as R
import qualified Labyrinth as Lab
import Labyrinth.KVDB.Model (LabK... |
288f8a53c1c4293035e73d150f21637ee479e8d1a34759d51f7f969e42e9a847 | bravit/hid-examples | dicegame.hs | import Control.Monad.RWS
import System.Random
type Dice = Int
type DiceGame = RWS (Int, Int) [Dice] StdGen
dice' :: DiceGame Dice
dice' = do
bs <- ask
g <- get
let (r, g') = uniformR bs g
put g'
tell [r]
pure r
dice :: DiceGame Dice
dice = do
bs <- ask
r <- state (uniformR bs)
tell [r]
pure r
d... | null | https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch05/dicegame.hs | haskell | import Control.Monad.RWS
import System.Random
type Dice = Int
type DiceGame = RWS (Int, Int) [Dice] StdGen
dice' :: DiceGame Dice
dice' = do
bs <- ask
g <- get
let (r, g') = uniformR bs g
put g'
tell [r]
pure r
dice :: DiceGame Dice
dice = do
bs <- ask
r <- state (uniformR bs)
tell [r]
pure r
d... | |
752ae1127f1dc6b7037da11a08483eac1e8ea8ce3f1b540322598a9e0b42d1b7 | disconcision/fructure | fructure-utility.rkt | #lang racket
(provide atom?
proper-list?
transpose
map-rec
undotdotdot
redotdotdot
eval-match-λ
eval-match-?
\\
//
/@)
(define atom? (compose not pair?))
(define proper-list? (conjoin list? (compose not empty?)))
(define trans... | null | https://raw.githubusercontent.com/disconcision/fructure/d434086052eab3c450f631b7b14dcbf9358f45b7/archive/fructure.0.2/fructure-utility.rkt | racket | pre-applies fn into source tree
desugars _ ... into (ooo _)
resugars (ooo _) into _ ...
meta-quotation | #lang racket
(provide atom?
proper-list?
transpose
map-rec
undotdotdot
redotdotdot
eval-match-λ
eval-match-?
\\
//
/@)
(define atom? (compose not pair?))
(define proper-list? (conjoin list? (compose not empty?)))
(define trans... |
6bb5a60c03e9482a96e40dc0c25285e6e774f11b3947ac3841de178f6dc3e885 | composewell/streamly | Interleave.hs | -- |
Module : Streamly . Internal . Data . Stream . Concurrent . Channel . Interleave
Copyright : ( c ) 2017 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
(
... | null | https://raw.githubusercontent.com/composewell/streamly/7252323b76a291aca9f512d39f0d464d992f0f00/src/Streamly/Internal/Data/Stream/Concurrent/Channel/Interleave.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
----------------------------------------------------------------------------
Creating a channel
----------------------------------------------------------------------------
XXX This is not strictly round-robin as the streams that are faster ma... | Module : Streamly . Internal . Data . Stream . Concurrent . Channel . Interleave
Copyright : ( c ) 2017 Composewell Technologies
Portability : GHC
module Streamly.Internal.Data.Stream.Concurrent.Channel.Interleave
(
newChannel
)
where
#include "inline.hs"
import Control.Concurrent (myThr... |
0353a8b30abfa0ffbb2ceccead695d2a57d3ebc6a8692c628b2eb3b5305192c8 | SamB/coq | rules.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/contrib/firstorder/rules.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ Id$
open Term
open Tac... |
09a54731b0eaff2fb1d3b08e88719f9351d5c5a454f67eed8f3b6e58c454e216 | oakes/tile-soup | polygon.cljc | (ns tile-soup.polygon
(:require [clojure.spec.alpha :as s]
[tile-soup.utils :as u]))
(s/def ::points u/comma-str->vector)
(s/def ::attrs (s/keys :req-un [::points]))
(s/def ::polygon (s/keys :req-un [::attrs]))
| null | https://raw.githubusercontent.com/oakes/tile-soup/e2d495523af59322891f667859d39478d118a7c2/src/tile_soup/polygon.cljc | clojure | (ns tile-soup.polygon
(:require [clojure.spec.alpha :as s]
[tile-soup.utils :as u]))
(s/def ::points u/comma-str->vector)
(s/def ::attrs (s/keys :req-un [::points]))
(s/def ::polygon (s/keys :req-un [::attrs]))
| |
a7587be0b801018f48bd90a3de65e0070dd385c9641983f2e8b8ee4d33955f69 | zeniuseducation/poly-euler | p83.clj | (ns clein.p83)
(def raw
(->> (slurp "resources/p082_matrix.txt")
(partition-by #{\newline})
(remove #{[\newline]})
(map #(apply str %))
(map #(str "[" % "]"))
(map read-string)))
(def num
(memoize
(fn [[x y]]
(nth (nth raw y) x))))
(def ways
(fn [[x y]]
(if (every... | null | https://raw.githubusercontent.com/zeniuseducation/poly-euler/734fdcf1ddd096a8730600b684bf7398d071d499/clein/src/clein/p83.clj | clojure | (ns clein.p83)
(def raw
(->> (slurp "resources/p082_matrix.txt")
(partition-by #{\newline})
(remove #{[\newline]})
(map #(apply str %))
(map #(str "[" % "]"))
(map read-string)))
(def num
(memoize
(fn [[x y]]
(nth (nth raw y) x))))
(def ways
(fn [[x y]]
(if (every... | |
ffadeaefc187bfb39ac224732bd5df89652a5d653315945b7c43996e8a5e7e08 | leon-gondelman/ocaml2lang | lang.ml | # directory " + threads " ; ;
# load " unix.cma " ; ;
# load " threads.cma " ; ;
#load "unix.cma";;
#load "threads.cma";; *)
open Unix
open Network
(* type ('a, 'b) sumTy = InjL of 'a | InjR of 'b *)
let[@builtin "MakeAddress"] makeAddress ip port =
ADDR_INET (inet_addr_of_string ip, port)
let[@builtin ... | null | https://raw.githubusercontent.com/leon-gondelman/ocaml2lang/f94f02d35b537623b7e4da812d33eb6c29cc9214/tmp/lib/lang.ml | ocaml | type ('a, 'b) sumTy = InjL of 'a | InjR of 'b
translate only name
translate only name
translate only name
Translate to UnOp IntOfString e
Notations: | # directory " + threads " ; ;
# load " unix.cma " ; ;
# load " threads.cma " ; ;
#load "unix.cma";;
#load "threads.cma";; *)
open Unix
open Network
let[@builtin "MakeAddress"] makeAddress ip port =
ADDR_INET (inet_addr_of_string ip, port)
let[@builtin "NewSocket"] socket x y z = socket x y (num_of_proto... |
399ee8d6a395d60c6b13914ba3f644a456d74d0892ba81c282fed30420a91b73 | xapi-project/libvhd | open.ml | open Vhd
let _ =
let filename = Sys.argv.(1) in
let vhd = _open filename [] in
close vhd
| null | https://raw.githubusercontent.com/xapi-project/libvhd/de1383ead6e529f4718ca34234e747a51e50b6e3/lib_test/open.ml | ocaml | open Vhd
let _ =
let filename = Sys.argv.(1) in
let vhd = _open filename [] in
close vhd
| |
e128dc2cb279154f6579dfd275cc290b913bcc50d1d67d4d26578aed3aa0861d | alezost/stumpwm-config | misc.lisp | (defun al/ml-windows ()
;; Original version of `al/ml-windows'
(when-let ((cur-win (current-window)))
(let* ((win-class (window-class cur-win))
(win-list (remove-if-not
(lambda (win)
(equal win-class (window-class win)))
(sort-window... | null | https://raw.githubusercontent.com/alezost/stumpwm-config/ac4d669ef77b0fd6072197876e097f1c66e8d942/unused/misc.lisp | lisp | Original version of `al/ml-windows' | (defun al/ml-windows ()
(when-let ((cur-win (current-window)))
(let* ((win-class (window-class cur-win))
(win-list (remove-if-not
(lambda (win)
(equal win-class (window-class win)))
(sort-windows (current-group))))
(num (len... |
ecac4a99661c804256390cd78560ef306fcd10c666e3170245a6b2edb5c8f11e | YoshikuniJujo/test_haskell | try-allocation.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import Foreign.Ptr
import Foreign.Marshal
import qualified Vulkan as Vk
import qualified Vulkan.Instance as Vk
import qualified Vulkan.AllocationCallbacks as Vk
main :: IO ()
main = do
let appInfo = Vk.ApplicationInfo {
Vk.applicationInfoNext = Nothing ... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/b20f86a2b14e8136df18e3990f98a206790a01ce/themes/gui/vulkan/try-my-vulkan/app/try-allocation.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import Foreign.Ptr
import Foreign.Marshal
import qualified Vulkan as Vk
import qualified Vulkan.Instance as Vk
import qualified Vulkan.AllocationCallbacks as Vk
main :: IO ()
main = do
let appInfo = Vk.ApplicationInfo {
Vk.applicationInfoNext = Nothing ... | |
e5cff7d6807e148442cf191e3c39d21320c39638712fc61ff89a83b82d7b306f | mihaiolteanu/zbucium | zbucium.lisp | (in-package :zbucium)
(defparameter *still-playing* nil
"Set to true when player started, set to nil when stopped.")
(defparameter *playing-thread* nil
"Playing a song or list of songs starts a new thread since we also want to
return from the call while the player is running. ")
(defparameter *artist* nil
"T... | null | https://raw.githubusercontent.com/mihaiolteanu/zbucium/5b0135f5c586088ae40183b0d7661fec5eb47791/zbucium.lisp | lisp | Make sure there is a way to stop this endless loop.
Setup for scrobbling
Save the lyrics for each song that is being played.
If, after waking up, the same song is playing,
scrobble it.
Wait for this song to end before playing the next one.
Exported interfaces. Most of these functions simply create lastfm generato... | (in-package :zbucium)
(defparameter *still-playing* nil
"Set to true when player started, set to nil when stopped.")
(defparameter *playing-thread* nil
"Playing a song or list of songs starts a new thread since we also want to
return from the call while the player is running. ")
(defparameter *artist* nil
"T... |
ac35a679dfd0e77feb76849541f715bb9ce66b268fd143cac952c394fe23c5a6 | startalkIM/ejabberd | pubsub_db_sql.erl | %%%----------------------------------------------------------------------
%%% File : pubsub_db_sql.erl
Author : >
Purpose : Provide helpers for PubSub ODBC backend
Created : 7 Aug 2009 by >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/pubsub_db_sql.erl | erlang | ----------------------------------------------------------------------
File : pubsub_db_sql.erl
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even... | Author : >
Purpose : Provide helpers for PubSub ODBC backend
Created : 7 Aug 2009 by >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have receive... |
f72960d59ce9911c06884583e007a233ec4b889af03e169794d8b3f226e25130 | rescript-association/genType | ExportModule.ml | open GenTypeCommon
type exportModuleItem = (string, exportModuleValue) Hashtbl.t
and exportModuleValue =
| S of string * type_ * Converter.t
| M of exportModuleItem
type exportModuleItems = (string, exportModuleItem) Hashtbl.t
type types = {typeForValue : type_; typeForType : type_; needsConversion : bool}
typ... | null | https://raw.githubusercontent.com/rescript-association/genType/22b666a1004b5079c2a5f76d20e79a3b11c9e2dd/src/ExportModule.ml | ocaml | open GenTypeCommon
type exportModuleItem = (string, exportModuleValue) Hashtbl.t
and exportModuleValue =
| S of string * type_ * Converter.t
| M of exportModuleItem
type exportModuleItems = (string, exportModuleItem) Hashtbl.t
type types = {typeForValue : type_; typeForType : type_; needsConversion : bool}
typ... | |
a3c7436174998a6fcf8c6dd0c3f98af7dc93212dcfa620ce435bb117dd73e7f6 | bufferswap/ViralityEngine | group.lisp | (in-package #:virality)
Implementation of datatypes : GEOMETRY - GROUP , GEOMETRY - GROUP / SEPARATE ,
GEOMETRY - GROUP / INTERLEAVED
(defun make-geometry-groups (spec)
(let ((groups (u:dict #'eq))
(order))
(dolist (group spec)
(destructuring-bind (name (&key (format 'interleaved) (divisor 0))... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/geometry/group.lisp | lisp | (in-package #:virality)
Implementation of datatypes : GEOMETRY - GROUP , GEOMETRY - GROUP / SEPARATE ,
GEOMETRY - GROUP / INTERLEAVED
(defun make-geometry-groups (spec)
(let ((groups (u:dict #'eq))
(order))
(dolist (group spec)
(destructuring-bind (name (&key (format 'interleaved) (divisor 0))... | |
192c747bb772b8775157ad2642ae063fe25f1615e22835ae1024edf39163788b | martinslota/protocell | google_protobuf_descriptor_pc.ml | [@@@ocaml.warning "-39"]
let ( >>= ) = Runtime.Result.( >>= )
let ( >>| ) = Runtime.Result.( >>| )
module Field' = Runtime.Field_value
module Bin' = Runtime.Binary_format
module Text' = Runtime.Text_format
module rec File_descriptor_set : sig
type t = {file : File_descriptor_proto.t list} [@@deriving eq, show]
... | null | https://raw.githubusercontent.com/martinslota/protocell/62545c7fb63ff76c95449ba015e40e0c3e0d94a5/src/protoc_interface/google_protobuf_descriptor_pc.ml | ocaml | [@@@ocaml.warning "-39"]
let ( >>= ) = Runtime.Result.( >>= )
let ( >>| ) = Runtime.Result.( >>| )
module Field' = Runtime.Field_value
module Bin' = Runtime.Binary_format
module Text' = Runtime.Text_format
module rec File_descriptor_set : sig
type t = {file : File_descriptor_proto.t list} [@@deriving eq, show]
... | |
35522e85b7a4aaf1c70d759bb520340ac1ed624dd63feeee48865a4c376606b0 | fukamachi/caveman | db.lisp | (in-package :cl-user)
(defpackage caveman2.db
(:use :cl)
(:import-from :caveman.middleware.dbimanager
:connect-db)
(:import-from :dbi
:prepare
:execute
:fetch-all
:fetch)
(:import-from :sxql
:from
:wh... | null | https://raw.githubusercontent.com/fukamachi/caveman/faa5f7e3b364fd7e7096af9a7bb06728b8d80441/v2/src/db.lisp | lisp | (in-package :cl-user)
(defpackage caveman2.db
(:use :cl)
(:import-from :caveman.middleware.dbimanager
:connect-db)
(:import-from :dbi
:prepare
:execute
:fetch-all
:fetch)
(:import-from :sxql
:from
:wh... | |
471c978382314e0fd3b41bc2b65f721a0b6912a43c58e86f2cfbdf88105878f7 | well-typed-lightbulbs/ocaml-esp32 | reflector.ml | let copyline input output =
let rec copy() = match input_char input with
| exception End_of_file ->
output_string output "<end of file>\n"
| char ->
output_char output char;
if char='\n' then () else copy()
in
copy();
flush output
let output_endline output str =
output_string output... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/lib-unix/common/reflector.ml | ocaml | let copyline input output =
let rec copy() = match input_char input with
| exception End_of_file ->
output_string output "<end of file>\n"
| char ->
output_char output char;
if char='\n' then () else copy()
in
copy();
flush output
let output_endline output str =
output_string output... | |
7e48b52829e0b61f3d7646578bf3578abed0e9cf3398305df4c262a99cc7e472 | jackfirth/lens | main.rkt | #lang reprovide
"arrow.rkt"
"define-nested.rkt"
"dict-nested.rkt"
"flatten.rkt"
"hash-filterer.rkt"
"if.rkt"
"isomorphism.rkt"
"join-assoc.rkt"
"lazy.rkt"
"map.rkt"
"match.rkt"
"set-filterer.rkt"
"set-member.rkt"
"string-split.rkt"
"struct-join.rkt"
"struct-list.rkt"
"struct-nested.rkt"
"struct-provide.rkt"
"sublist.rk... | null | https://raw.githubusercontent.com/jackfirth/lens/733db7744921409b69ddc78ae5b23ffaa6b91e37/lens-unstable/unstable/lens/main.rkt | racket | #lang reprovide
"arrow.rkt"
"define-nested.rkt"
"dict-nested.rkt"
"flatten.rkt"
"hash-filterer.rkt"
"if.rkt"
"isomorphism.rkt"
"join-assoc.rkt"
"lazy.rkt"
"map.rkt"
"match.rkt"
"set-filterer.rkt"
"set-member.rkt"
"string-split.rkt"
"struct-join.rkt"
"struct-list.rkt"
"struct-nested.rkt"
"struct-provide.rkt"
"sublist.rk... | |
4c59aad74b1980c908e99bd80e0f264abecd7fdd609895a78a270ca3a6b04dd2 | fp-works/2019-winter-Haskell-school | Exercise1.hs | module Exercise1
( fun1Original
, fun1
, fun2Original
, fun2
) where
import Data.Bool
fun1Original :: [Integer] -> Integer
fun1Original [] = 1
fun1Original (x:xs)
| even x = (x - 2) * fun1Original xs
| otherwise = fun1Original xs
fun1 :: [Integer] -> Integer
fun1 = (foldr (*) 1)... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week4/weining/src/Exercise1.hs | haskell | alternative (shorter)
even better
or (squeeze out the flip)
fun1 = product . map (+ (-2)) . (filter even) | module Exercise1
( fun1Original
, fun1
, fun2Original
, fun2
) where
import Data.Bool
fun1Original :: [Integer] -> Integer
fun1Original [] = 1
fun1Original (x:xs)
| even x = (x - 2) * fun1Original xs
| otherwise = fun1Original xs
fun1 :: [Integer] -> Integer
fun1 = (foldr (*) 1)... |
90e2eeb704670858096be735a71a2ef15e26f63876a5157d639457a1d4ba9a38 | uhc/uhc | AsmToLvm.hs | -----------------------------------------------------------------------
The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/src/lvm/Asm/AsmToLvm.hs | haskell | ---------------------------------------------------------------------
---------------------------------------------------------------------
----------------------------------------------------------------------}
--------------------------------------------------------------
asmToLvm: generate instructions from As... | The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
The Core Assembler.
Copyright 2001, Daan Leijen. All rights reserv... |
3d639ae38f5e0498e9c010b5a669fbdf2cad439276ebb3441af0aeba6c289c27 | clash-lang/clash-compiler | Ram.hs | module Ram where
import Clash.Prelude
import qualified Clash.Explicit.Prelude as Explicit
import Clash.Explicit.Testbench
import qualified Data.List as L
zeroAt0
:: HiddenClockResetEnable dom
=> Signal dom (Unsigned 8,Unsigned 8)
-> Signal dom (Unsigned 8,Unsigned 8)
zeroAt0 a = mux en a (bundle (0,0))
where
... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/tests/shouldwork/Signal/Ram.hs | haskell | # NOINLINE topEntity # | module Ram where
import Clash.Prelude
import qualified Clash.Explicit.Prelude as Explicit
import Clash.Explicit.Testbench
import qualified Data.List as L
zeroAt0
:: HiddenClockResetEnable dom
=> Signal dom (Unsigned 8,Unsigned 8)
-> Signal dom (Unsigned 8,Unsigned 8)
zeroAt0 a = mux en a (bundle (0,0))
where
... |
39a1ba1cb183c366ddb1a960ef40dc7729dc1910397971e773d36d4825b2b7d1 | alex-gutev/static-dispatch | method-functions.lisp | ;;;; method-functions.lisp
;;;;
Copyright 2021
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limitation the rights to use,
;;... | null | https://raw.githubusercontent.com/alex-gutev/static-dispatch/e8cd52a4302186b8f6e056d7cd58c11578875724/src/method-functions.lisp | lisp | method-functions.lisp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject ... | Copyright 2021
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package #:static-dispatch)
(defi... |
69d5f67a598246827bcda0ad1152bfff15c8292dad724faa4792e64b5567db8a | fstamour/breeze | min.lisp | ;;; This is just an example used to test the parsing of source code
(in-package #:common-lisp-user)
(defpackage #:min
(:use :cl))
(in-package #:min)
;; A less powerful min!
(defun min2 (a b)
(cl:min a b))
| null | https://raw.githubusercontent.com/fstamour/breeze/e76ce087980fdb30a4124c77177d06748ad5c73e/scratch-files/notes/min.lisp | lisp | This is just an example used to test the parsing of source code
A less powerful min! |
(in-package #:common-lisp-user)
(defpackage #:min
(:use :cl))
(in-package #:min)
(defun min2 (a b)
(cl:min a b))
|
a5992f4b350fcdb5a76b6cc955450a9c7ae77d7eb2b9cd8c9c63805f1f3d7acd | racket/web-server | iteration-10.rkt | #lang web-server/insta
(require "model-3.rkt")
;; start: request -> doesn't return
;; Consumes a request and produces a page that displays
;; all of the web content.
(define (start request)
(render-blog-page
(initialize-blog!
(build-path (current-directory)
"the-blog-data.sqlite"))
req... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-doc/web-server/scribblings/tutorial/examples/iteration-10.rkt | racket | start: request -> doesn't return
Consumes a request and produces a page that displays
all of the web content.
render-blog-page: blog request -> doesn't return
Produces an HTML page of the content of the
blog.
render-post-detail-page: post request -> doesn't return
Consumes a post and produces a detail page of t... | #lang web-server/insta
(require "model-3.rkt")
(define (start request)
(render-blog-page
(initialize-blog!
(build-path (current-directory)
"the-blog-data.sqlite"))
request))
(define (render-blog-page a-blog request)
(define (response-generator embed/url)
(response/xexpr
... |
ebdb29de59287862b93cf2f10dfdb33bea9af5d7cc8e3d0b35c1eb85f14f50f0 | Gbury/dolmen | response.ml |
(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
module type S = sig
type file
type statement
exception Extension_not_found of string
type language =
| Smtlib2 of Dolmen_smtlib2.Response.version
val enum : (string * language) list
val string_of_language : la... | null | https://raw.githubusercontent.com/Gbury/dolmen/58903349a3c422402f25ec479ce90d944f44f148/src/classes/response.ml | ocaml | This file is free software, part of dolmen. See file "LICENSE" for more information
Smtlib2 |
module type S = sig
type file
type statement
exception Extension_not_found of string
type language =
| Smtlib2 of Dolmen_smtlib2.Response.version
val enum : (string * language) list
val string_of_language : language -> string
val find :
?language:language ->
?dir:string -> string -> stri... |
ab01ff2fd6f469a25fd7ce42b516e7267a50cd123341397c9deea7c760bc4887 | triffon/fp-2022-23 | 07-stream-zip.rkt | #lang racket
(require "00-stream.rkt")
(define (stream-zip func stream1 stream2)
(if (or (empty-stream? stream1) (empty-stream? stream2))
the-empty-stream
(cons-stream
(func (head stream1) (head stream2))
(stream-zip func (tail stream1) (tail stream2))))) | null | https://raw.githubusercontent.com/triffon/fp-2022-23/22826e457f2d1add264aa1f02ebb9e796712d5b6/exercises/inf2/09/scheme/07-stream-zip.rkt | racket | #lang racket
(require "00-stream.rkt")
(define (stream-zip func stream1 stream2)
(if (or (empty-stream? stream1) (empty-stream? stream2))
the-empty-stream
(cons-stream
(func (head stream1) (head stream2))
(stream-zip func (tail stream1) (tail stream2))))) | |
5a86b5dab0b61a1d9a06e9d0a2040880c0eb1d616a0fabfe7a73872360c18f3d | malcolmreynolds/GSLL | numerical-integration.lisp | Regression test NUMERICAL - INTEGRATION for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST
NUMERICAL-INTEGRATION
(let ((lisp-unit:*epsilon* (* 5.0d7 double-float-epsilon)))
(LISP-UNIT:ASSERT-NUMERICAL-EQUAL
(LIST -0.18927518534894017d0 1.1291337120150095d-8)
(MULTIPLE-VA... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/numerical-integration.lisp | lisp | Regression test NUMERICAL - INTEGRATION for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST
NUMERICAL-INTEGRATION
(let ((lisp-unit:*epsilon* (* 5.0d7 double-float-epsilon)))
(LISP-UNIT:ASSERT-NUMERICAL-EQUAL
(LIST -0.18927518534894017d0 1.1291337120150095d-8)
(MULTIPLE-VA... | |
3617d7e5c97483ef4ec6bdf25f92fbe957ae563b82d8749ee0b620c31f6cfdda | FranklinChen/learn-you-some-erlang | curling_scoreboard.erl | -module(curling_scoreboard).
-behaviour(gen_event).
-export([init/1, handle_event/2, handle_call/2, handle_info/2, code_change/3,
terminate/2]).
init([]) ->
{ok, []}.
handle_event({set_teams, TeamA, TeamB}, State) ->
curling_scoreboard_hw:set_teams(TeamA, TeamB),
{ok, State};
handle_event({add_p... | null | https://raw.githubusercontent.com/FranklinChen/learn-you-some-erlang/878c8bc2011a12862fe72dd7fdc6c921348c79d6/curling_scoreboard.erl | erlang | -module(curling_scoreboard).
-behaviour(gen_event).
-export([init/1, handle_event/2, handle_call/2, handle_info/2, code_change/3,
terminate/2]).
init([]) ->
{ok, []}.
handle_event({set_teams, TeamA, TeamB}, State) ->
curling_scoreboard_hw:set_teams(TeamA, TeamB),
{ok, State};
handle_event({add_p... | |
f824efd1cadd2fb002fea8b43256cc6b82a5a1ba50d6e60aa7c7bee209342837 | robrix/sequoia | Bottom.hs | module Sequoia.Calculus.Bottom
( -- * Bottom
BottomIntro(..)
, botR'
-- * Connectives
, module Sequoia.Connective.Bottom
) where
import Sequoia.Calculus.Context
import Sequoia.Calculus.Core
import Sequoia.Connective.Bottom
-- Bottom
class Core s => BottomIntro s where
botL
-- --------------------------
... | null | https://raw.githubusercontent.com/robrix/sequoia/e4fae1100fa977a656f2fc654762f23d4448ad76/src/Sequoia/Calculus/Bottom.hs | haskell | * Bottom
* Connectives
Bottom
--------------------------
--------------------------
-------------------------- | module Sequoia.Calculus.Bottom
BottomIntro(..)
, botR'
, module Sequoia.Connective.Bottom
) where
import Sequoia.Calculus.Context
import Sequoia.Calculus.Core
import Sequoia.Connective.Bottom
class Core s => BottomIntro s where
botL
:: Bottom r < _Γ ⊣s e r⊢ _Δ
botR
:: _Γ ⊣s e r⊢ _Δ
-> _Γ ⊣s e r⊢ _... |
f0af763a80d64111cbca266453ff099be22cbf621fa9b2f4d88b1e036c17705d | racket/pkg-build | extract-doc.rkt | #lang racket/base
(require racket/file
racket/format
setup/getinfo
setup/collection-name
file/unzip
pkg/strip)
(provide extract-documentation)
(define (extract-documentation zip pkg dest-dir)
(define temp-dir (make-temporary-file "docs~a" 'directory))
(dynamic-wind
... | null | https://raw.githubusercontent.com/racket/pkg-build/31fea3651b501e2ad333cf6133527290abd2eed1/private/extract-doc.rkt | racket | #lang racket/base
(require racket/file
racket/format
setup/getinfo
setup/collection-name
file/unzip
pkg/strip)
(provide extract-documentation)
(define (extract-documentation zip pkg dest-dir)
(define temp-dir (make-temporary-file "docs~a" 'directory))
(dynamic-wind
... | |
16c5fa8989016c0fa8969269355bb378f524fb46a36d2e8bec4c4c136dcf46e8 | wilkerlucio/cljc-misc | refs.cljc | (ns com.wsscode.misc.refs
#?(:clj
(:import
(clojure.lang
Atom
IDeref
Volatile))))
(defn kw-identical?
"Clojure/Clojurescript efficient keyword comparison."
[kw-a kw-b]
#?(:clj (identical? kw-a kw-b)
:cljs (keyword-identical? kw-a kw-b)))
(defn atom?
"Check if x i... | null | https://raw.githubusercontent.com/wilkerlucio/cljc-misc/edfde02ec562dd15bf0a3500c50d9e96b4286f21/src/main/com/wsscode/misc/refs.cljc | clojure | (ns com.wsscode.misc.refs
#?(:clj
(:import
(clojure.lang
Atom
IDeref
Volatile))))
(defn kw-identical?
"Clojure/Clojurescript efficient keyword comparison."
[kw-a kw-b]
#?(:clj (identical? kw-a kw-b)
:cljs (keyword-identical? kw-a kw-b)))
(defn atom?
"Check if x i... | |
67202afaee22ba9063d793cb5d0468a2f743861d281e755614b524d6a75fc353 | russell/cl-git | proxy.lisp | -*- Mode : Lisp ; Syntax : COMMON - LISP ; Base : 10 -*-
;; cl-git is a Common Lisp interface to git repositories.
Copyright ( C ) 2011 - 2022 < >
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
as published by the Free ... | null | https://raw.githubusercontent.com/russell/cl-git/e5ae490f6d8bc6f0f7354b344342da32ea06c97e/src/proxy.lisp | lisp | Syntax : COMMON - LISP ; Base : 10 -*-
cl-git is a Common Lisp interface to git repositories.
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY;... |
Copyright ( C ) 2011 - 2022 < >
as published by the Free Software Foundation , either version 3 of
the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
(in-package #:cl-git)
(defconstant +git-proxy-options-version+ 1)
(define-foreign-t... |
d95524277945505b4a115907bb8e2be4628f59b4e1541f474c1e62b0c8b26366 | ninenines/cowboy | provide_callback_missing_h.erl | -module(provide_callback_missing_h).
-export([init/2]).
-export([content_types_provided/2]).
init(Req, State) ->
{cowboy_rest, Req, State}.
content_types_provided(Req, State) ->
ct_helper_error_h:ignore(cowboy_rest, set_resp_body, 2),
{[{<<"text/plain">>, provide}], Req, State}.
| null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/provide_callback_missing_h.erl | erlang | -module(provide_callback_missing_h).
-export([init/2]).
-export([content_types_provided/2]).
init(Req, State) ->
{cowboy_rest, Req, State}.
content_types_provided(Req, State) ->
ct_helper_error_h:ignore(cowboy_rest, set_resp_body, 2),
{[{<<"text/plain">>, provide}], Req, State}.
| |
0203e62352457dbdeba99cb931d373aebb576db8e170d5dbbb8319ed7ded0296 | the-dr-lazy/cascade | Model.hs | |
Module : Test . Cascade . Api . StateMachine . Model
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCR... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-api/test/Test/Cascade/Api/StateMachine/Model.hs | haskell | |
Module : Test . Cascade . Api . StateMachine . Model
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCR... | |
d3a7a30a139b24349855dff247d3c9b9f2b32b775a98b77141ac2a4e642d8202 | callum-oakley/advent-of-code | 10.clj | (ns aoc.2017.10
(:require
[aoc.hash :as hash]
[clojure.test :refer [deftest is]]))
(defn rev [n knot i length]
(reduce (fn [k j]
(assoc k (mod (+ i j) n) (knot (mod (- (+ i length) j 1) n))))
knot
(range length)))
(defn sparse-hash [n lengths]
(first (reduce (fn [[knot i sk... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/da5233fc0fd3d3773d35ee747fd837c59c2b1c04/src/aoc/2017/10.clj | clojure | (ns aoc.2017.10
(:require
[aoc.hash :as hash]
[clojure.test :refer [deftest is]]))
(defn rev [n knot i length]
(reduce (fn [k j]
(assoc k (mod (+ i j) n) (knot (mod (- (+ i length) j 1) n))))
knot
(range length)))
(defn sparse-hash [n lengths]
(first (reduce (fn [[knot i sk... | |
d062e4f1e65a6f5d098803db52c5de5a86e651f353744abf76a717f663cfbc4b | gwkkwg/trivial-shell | cmucl.lisp | (in-package #:trivial-shell)
(defun %shell-command (command input)
(let* ((process (ext:run-program
*bourne-compatible-shell*
(list "-c" command)
:input input :output :stream :error :stream))
(output (file-to-string-as-lines (ext::process-output proce... | null | https://raw.githubusercontent.com/gwkkwg/trivial-shell/e02ec191b34b52deca5d1c4ee99d4fa13b8772e0/dev/cmucl.lisp | lisp | (in-package #:trivial-shell)
(defun %shell-command (command input)
(let* ((process (ext:run-program
*bourne-compatible-shell*
(list "-c" command)
:input input :output :stream :error :stream))
(output (file-to-string-as-lines (ext::process-output proce... | |
04a69d4a000feac638d0fd171e98d916ce6216768af07b629323338e4c5ca1dd | jeluard/lucuma | browser_runner.cljs | (ns lucuma.test.browser-runner
(:require [clojure.string :as s]
[cemerick.cljs.test :refer [report] :as t]
[lucuma.core-test :as l]
[lucuma.attribute-test :as att]
[lucuma.custom-elements-test :as cet]
[lucuma.util-test :as ut]
[hipo.core :as hip... | null | https://raw.githubusercontent.com/jeluard/lucuma/110e35327bff98e5421d0e7e03f0e0a3dc2995c3/examples/src/lucuma/test/browser_runner.cljs | clojure | Something, somewhere does not like those characters | (ns lucuma.test.browser-runner
(:require [clojure.string :as s]
[cemerick.cljs.test :refer [report] :as t]
[lucuma.core-test :as l]
[lucuma.attribute-test :as att]
[lucuma.custom-elements-test :as cet]
[lucuma.util-test :as ut]
[hipo.core :as hip... |
b085497c1ca1aab3fae42092635779330740b4687c42b26969b71f54afe64fcf | emqx/emqx | emqx_authn_mysql.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/969cbecf91cd71f3f4a0d83f6fa4a9f45329645e/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_authn_mysql).
-include("emqx_authn.hrl").
-include_lib("emqx/include/logger.hrl").... |
fdd74e76cfd73d9b080f0bfa582dd9b693f12c876e4fd581202c0caf982efe3e | samth/git-slice | chop.rkt | #lang racket
(require "git.rkt")
(provide go)
(define (go dest-dir tmp-dir dry-run?)
(define-values (oldest-relevant start-at-commit drop-oldest?)
(apply values
(call-with-input-file (build-path dest-dir "oldest.rktd")
read)))
(cond
[start-at-commit
(define start-time (curr... | null | https://raw.githubusercontent.com/samth/git-slice/110b361425280e61abf8de99e5d41865afc5cddb/chop.rkt | racket | Dropping `oldest-now` might would multiple initial
commits, which is potentially confusing (to `git-slice`
itself, for example). Add an empty commit to serve
as the root. | #lang racket
(require "git.rkt")
(provide go)
(define (go dest-dir tmp-dir dry-run?)
(define-values (oldest-relevant start-at-commit drop-oldest?)
(apply values
(call-with-input-file (build-path dest-dir "oldest.rktd")
read)))
(cond
[start-at-commit
(define start-time (curr... |
35bd20ad307d42676259006a546a8c69725ab033c722b9bfd133bd9340ff7f77 | tonsky/compact-uuids | test.cljc | (ns compact-uuids.core.test
(:require
[clojure.string :as str]
#?(:clj [clojure.test :refer [deftest is are testing]])
#?(:cljs [cljs.test :refer [deftest is are testing]])
[compact-uuids.core :as uuid]))
#?(:cljs (enable-console-print!))
(defn gen-uuid []
#?(:clj (java.util.UUID/randomUUID)
... | null | https://raw.githubusercontent.com/tonsky/compact-uuids/de6f44c393a008dfcefc30bc42d8519312a66175/test/compact_uuids/core/test.cljc | clojure | (ns compact-uuids.core.test
(:require
[clojure.string :as str]
#?(:clj [clojure.test :refer [deftest is are testing]])
#?(:cljs [cljs.test :refer [deftest is are testing]])
[compact-uuids.core :as uuid]))
#?(:cljs (enable-console-print!))
(defn gen-uuid []
#?(:clj (java.util.UUID/randomUUID)
... | |
f2b1c61e92bff3d9da158d8ba4bbbe9c726f770839b7cb5d918cfc9de84e0f9d | Eelis/cxxdraft-htmlgen | CxxParser.hs | # OPTIONS_GHC -fno - warn - tabs #
# LANGUAGE
OverloadedStrings ,
RecordWildCards ,
TupleSections ,
ViewPatterns ,
LambdaCase ,
TypeSynonymInstances ,
FlexibleInstances #
OverloadedStrings,
RecordWildCards,
TupleSections,
ViewPatterns,
LambdaCase,
TypeSynonymInstances,
FlexibleInstances #-}
... | null | https://raw.githubusercontent.com/Eelis/cxxdraft-htmlgen/1895c574355cca37a941669b69bb83c89ee2111f/CxxParser.hs | haskell | rest without the closing '
rest
rest
comment
subsequent lines
rest
raw:
normal:
rest | # OPTIONS_GHC -fno - warn - tabs #
# LANGUAGE
OverloadedStrings ,
RecordWildCards ,
TupleSections ,
ViewPatterns ,
LambdaCase ,
TypeSynonymInstances ,
FlexibleInstances #
OverloadedStrings,
RecordWildCards,
TupleSections,
ViewPatterns,
LambdaCase,
TypeSynonymInstances,
FlexibleInstances #-}
... |
420be2136a38a260b203b1fdd095e7a9667b8d2df80b81cecc319555eacba338 | tomahawkins/atom | Parser.hs | module Parser
( Module (..)
, parseProgram
) where
import Control.Monad
import Data.List
import Data.Maybe
import AST
import Common
import Parser.Lex
import Parser.Parse
import Parser.Tokens
data Module a = Module FilePath Path [Import] [Export] [InfixDef] a deriving Show
data Import = Import Path deriving Sho... | null | https://raw.githubusercontent.com/tomahawkins/atom/e552e18859c6d249af4b293e9d2197878c0fd4fd/src/Parser.hs | haskell | Given a list of program modules, build a list of infix definitions (precedence and associativity).
Looks up a symbol in the infix table to change the token.
Parses a module's code.
| Remove comments from code.
Extracts imports from a module.
Extracts exports from a module.
Extracts the infix declarations from a ... | module Parser
( Module (..)
, parseProgram
) where
import Control.Monad
import Data.List
import Data.Maybe
import AST
import Common
import Parser.Lex
import Parser.Parse
import Parser.Tokens
data Module a = Module FilePath Path [Import] [Export] [InfixDef] a deriving Show
data Import = Import Path deriving Sho... |
9faefdd1e407864a14f636e7e0ddd18bf745c3d362476516dd05f69c724792fa | dfdx/flatparser | hemnet.clj | (ns flatparser.parser.hemnet
(:require [clj-http.client :as client])
(:import [org.eclipse.jetty.util UrlEncoded MultiMap]
[java.io StringReader])
(:use [net.cgrand enlive-html]
[clojure.java io]
[clojure.data json]
[flatparser geo util]
[flatparser.parser putil])
(:ge... | null | https://raw.githubusercontent.com/dfdx/flatparser/223595db24b55f7b5438907963c98e9828a40245/src/flatparser/parser/hemnet.clj | clojure | (ns flatparser.parser.hemnet
(:require [clj-http.client :as client])
(:import [org.eclipse.jetty.util UrlEncoded MultiMap]
[java.io StringReader])
(:use [net.cgrand enlive-html]
[clojure.java io]
[clojure.data json]
[flatparser geo util]
[flatparser.parser putil])
(:ge... | |
139358a51f7aeebf4d8bd92801279e53cf7debf34a95cbb970e93c2cd62751ac | andorp/pearls | Comonad.hs | -- -are-the-coalgebras-for-the-costate-comonad/
{-# LANGUAGE RankNTypes #-}
module Comonad where
import Prelude hiding ((.), id)
import Control.Category
class Functor w => Comonad w where
extract :: w a -> a
duplicate :: w a -> w (w a)
f <==> g = \x -> f x == g x
type ComonadLaw = forall a w . (Eq (w a... | null | https://raw.githubusercontent.com/andorp/pearls/8de29b8d6bbd083d190ada8eb5f705666b7e34d2/Comonad.hs | haskell | -are-the-coalgebras-for-the-costate-comonad/
# LANGUAGE RankNTypes # | module Comonad where
import Prelude hiding ((.), id)
import Control.Category
class Functor w => Comonad w where
extract :: w a -> a
duplicate :: w a -> w (w a)
f <==> g = \x -> f x == g x
type ComonadLaw = forall a w . (Eq (w a), Eq (w (w (w a))), Comonad w)
=> w a -> Bool
law1 :: Como... |
b2fb71455fbe050eaba4df73bdcaee53b11f8703dd166f86b548a9bbb1d99c82 | scalaris-team/scalaris | yaws_shaper.erl | %%%----------------------------------------------------------------------
%%% File : yaws_shaper.erl
Author : < >
%%% Purpose :
Created : 14 Dec 2010 by < >
%%%----------------------------------------------------------------------
-module(yaws_shaper).
-author('').
-export([behaviour_info/1]).
%% API... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/contrib/yaws/src/yaws_shaper.erl | erlang | ----------------------------------------------------------------------
File : yaws_shaper.erl
Purpose :
----------------------------------------------------------------------
API
----------------------------------------------------------------------
API
-----------------------------------------------------------... | Author : < >
Created : 14 Dec 2010 by < >
-module(yaws_shaper).
-author('').
-export([behaviour_info/1]).
-export([
check/2,
update/3
]).
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
behaviour_info(callbacks) ->
[{che... |
7788da4bc09603a70f30d1d0ad28a4fd9a5337ec21511dbc95092b5ead7b87fb | jaspervdj/psqueues | IntPSQ.hs | | ' IntPSQ ' fixes the key type to ' Int ' . It is generally much faster than
-- an 'OrdPSQ'.
--
Many operations have a worst - case complexity of O(min(n , W ) ) . This means that
-- the operation can -- become linear in the number of elements with a maximum
of W -- the number of bits in an Int ( 32 or 64 ) .
{-... | null | https://raw.githubusercontent.com/jaspervdj/psqueues/f6c8e112a7e6bc3e75303d87473f72e3c34822ec/src/Data/IntPSQ.hs | haskell | an 'OrdPSQ'.
the operation can -- become linear in the number of elements with a maximum
the number of bits in an Int ( 32 or 64 ) .
# LANGUAGE CPP #
* Type
* Query
* Construction
* Insertion
* Delete/update
* Lists
* Views
* Traversal
* Unsafe operations
* Validity check | | ' IntPSQ ' fixes the key type to ' Int ' . It is generally much faster than
Many operations have a worst - case complexity of O(min(n , W ) ) . This means that
# LANGUAGE BangPatterns #
# LANGUAGE UnboxedTuples #
module Data.IntPSQ
IntPSQ
, null
, size
, member
, lookup
, findMin
... |
3b9905b58449095b89761a1e56342fd4e4967340078facafc10017aa5d77e211 | brendanhay/amazonka | MeasureValue.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-timestream-write/gen/Amazonka/TimeStreamWrite/Types/MeasureValue.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
example, the CPU utilization of an EC2 instance or the RPM of a wind
can pass multiple data attributes associated with the same time series
in a single record
/See:/ 'newMeasureValue' smart constructor.
point.
|
The foll... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Mo... |
b9d8a18b9c9e3628b025fadda7712e14f7e0d13343ba95506df8ca51764b5073 | Clozure/ccl-tests | printer-control-vars.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Thu Jun 3 06:25:52 2004
;;;; Contains: Tests of initial values of printer control variables
(in-package :cl-test)
(deftest print-base.init.1
*print-base*
10)
(deftest print-radix.init.1
*print-radix*
nil)
(deftest print-case.init.1
*print-case*
:up... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/printer-control-vars.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of initial values of printer control variables | Author :
Created : Thu Jun 3 06:25:52 2004
(in-package :cl-test)
(deftest print-base.init.1
*print-base*
10)
(deftest print-radix.init.1
*print-radix*
nil)
(deftest print-case.init.1
*print-case*
:upcase)
(deftest print-circle.init.1
*print-circle*
nil)
(deftest print-escape.init.1
... |
440360c0bfd19f2bbd8d700cb762cf638b02280bebb68cfbf3b3e2f4b8dba604 | padsproj/pads-haskell | PCAPBodyGen.hs | # LANGUAGE DeriveDataTypeable
, DeriveGeneric
, DeriveLift
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, QuasiQuotes
, ScopedTypeVariables
, TemplateHaskell
, TypeFamilies
... | null | https://raw.githubusercontent.com/padsproj/pads-haskell/8dce6b2b28bf7d98028e67f6faa2be753a6ad691/examples/PCAPBodyGen.hs | haskell | generator read from an IORef acting as a global variable, taking as many
bytes as possible - inclLen generator reads from the same ref to ensure
correct lengths at the packet header stage, which will propagate down through
the packet
See PCAPBodyFill.hs for an alternate approach
| Global-variable-acting reference... | # LANGUAGE DeriveDataTypeable
, DeriveGeneric
, DeriveLift
, FlexibleContexts
, FlexibleInstances
, MultiParamTypeClasses
, QuasiQuotes
, ScopedTypeVariables
, TemplateHaskell
, TypeFamilies
... |
3b29080e2f56b2f69e24454d7c091445c708f502b619ce7e812d034c38d75b86 | runtimeverification/haskell-backend | Idem.hs | module Test.Kore.Attribute.Idem (
test_idem,
test_Attributes,
test_duplicate,
test_arguments,
test_parameters,
) where
import Kore.Attribute.Idem
import Kore.Syntax.Pattern
import Prelude.Kore
import Test.Kore.Attribute.Parser
import Test.Tasty
import Test.Tasty.HUnit
parseIdem :: Attributes -> Pa... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/b06757e252ee01fdd5ab8f07de2910711997d845/kore/test/Test/Kore/Attribute/Idem.hs | haskell | module Test.Kore.Attribute.Idem (
test_idem,
test_Attributes,
test_duplicate,
test_arguments,
test_parameters,
) where
import Kore.Attribute.Idem
import Kore.Syntax.Pattern
import Prelude.Kore
import Test.Kore.Attribute.Parser
import Test.Tasty
import Test.Tasty.HUnit
parseIdem :: Attributes -> Pa... | |
58c0eca1fbcc4ae25548e7e4914f4c47a3cc2bf005d0fef41df432c04b238e26 | anishathalye/knox | correctness-lang.rkt | #lang racket/base
(require
(for-syntax racket/base racket/syntax syntax/parse)
"correctness.rkt")
(provide
(except-out
(all-from-out racket/base)
#%module-begin)
(rename-out [$#%module-begin #%module-begin]))
(define-syntax ($#%module-begin stx)
(syntax-parse stx
[(_
#:spec spec-module
#:ci... | null | https://raw.githubusercontent.com/anishathalye/knox/161cda3e5274cc69012830f477749954ddcf736d/knox/correctness/correctness-lang.rkt | racket | #lang racket/base
(require
(for-syntax racket/base racket/syntax syntax/parse)
"correctness.rkt")
(provide
(except-out
(all-from-out racket/base)
#%module-begin)
(rename-out [$#%module-begin #%module-begin]))
(define-syntax ($#%module-begin stx)
(syntax-parse stx
[(_
#:spec spec-module
#:ci... | |
6140d03e3f59afb75133b36eb103a7a4c28a13e5299e80d5a2083b37f40911bb | mlabs-haskell/bot-plutus-interface | TimeSlot.hs | | This module provides conversions between ` Slot ` and ` POSIXTime ` .
It uses node queries to get additional parameters and emulate conversions that happen in the ledger
when it builds ` TxInfo ` . It aims to provide reliable conversion , enabling execution of contracts
with exact time intervals validation... | null | https://raw.githubusercontent.com/mlabs-haskell/bot-plutus-interface/a1f1d0ec7112b5ecde5ac31471c1a75b67b9dd9d/src/BotPlutusInterface/TimeSlot.hs | haskell | | Error returned by the functions of this module
Analogous to `slotToBeginPOSIXTime` from plutus-ledger
| Convert `Slot` to `POSIXTime`.
| Convert `POSIXTime` to `Slot`.
Analogous to `posixTimeRangeToContainedSlotRange` from plutus-ledger
getting required info from node
conversions
helper to convert `Extended P... | | This module provides conversions between ` Slot ` and ` POSIXTime ` .
It uses node queries to get additional parameters and emulate conversions that happen in the ledger
when it builds ` TxInfo ` . It aims to provide reliable conversion , enabling execution of contracts
with exact time intervals validation... |
cd1885fc5bb7c7197fe599dc324df8d2306344000c55359f008f8a6ac33a1373 | maxsnyder2000/TheRelationalParser | parser.scm | (define (the-relational-parser code)
`(letrec
PARSER ( Core - OMeta )
(lambda (grammar in rule-name)
(if (get grammar rule-name)
(cabr (parse-rule
grammar
in
'()
(get grammar rule-name)))
(cons #f (list in))))]
ALTERNATION
(lambda (grammar in store rule)
... | null | https://raw.githubusercontent.com/maxsnyder2000/TheRelationalParser/196188becbe3ea441cdf76479317ce5075057066/parser.scm | scheme | failure
next
EMPTY
success
ATOM
success
failure
NONTERMINAL
success
failure
repetition
termination
success
failure
BINDING
success
failure
SEMANTIC ACTION
LIST
success
failure
helper: dictionary get
helper: dictionary set
helper: list reverse | (define (the-relational-parser code)
`(letrec
PARSER ( Core - OMeta )
(lambda (grammar in rule-name)
(if (get grammar rule-name)
(cabr (parse-rule
grammar
in
'()
(get grammar rule-name)))
(cons #f (list in))))]
ALTERNATION
(lambda (grammar in store rule)
... |
83d630fa0208ff4634540da63e7727b1e87b51cff9ae6622c5e7518e92123ef5 | votinginfoproject/data-processor | retention_contests.clj | (ns vip.data-processor.db.translations.v5-2.retention-contests
(:require [korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.db.translations.util :as util]))
(defn row-fn [import-id]
(korma/select (postgres/v5-2-tables :retention-contests)
(korma/whe... | null | https://raw.githubusercontent.com/votinginfoproject/data-processor/b4baf334b3a6219d12125af8e8c1e3de93ba1dc9/src/vip/data_processor/db/translations/v5_2/retention_contests.clj | clojure | (ns vip.data-processor.db.translations.v5-2.retention-contests
(:require [korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.db.translations.util :as util]))
(defn row-fn [import-id]
(korma/select (postgres/v5-2-tables :retention-contests)
(korma/whe... | |
d30ed1ed5e252f15cf4e427c6e82c03f51f7a00419ec5963725bc64311ff9504 | vikram/lisplibraries | html4.lisp | ;; -*- lisp -*-
(in-package :it.bese.yaclml)
* YACLML tags mapping to HTML4 tags .
;;;; ** Helper macro fer defining the tag macros
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun make-effective-attributes (attributes)
(with-collector (attrs)
(dolist (attr attributes)
(case attr
... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/yaclml_0.5.2/src/tags/html4.lisp | lisp | -*- lisp -*-
** Helper macro fer defining the tag macros
This list taken from
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 copyrigh... |
(in-package :it.bese.yaclml)
* YACLML tags mapping to HTML4 tags .
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun make-effective-attributes (attributes)
(with-collector (attrs)
(dolist (attr attributes)
(case attr
(:core (attrs 'class 'id 'style 'title))
(:i... |
968ee70e053162c5e459933a8a033fa699756f7edc848b72cc50be4d3f2e971c | umd-cmsc330/cmsc330spring22 | disc5.ml | (* Typing Practice *)
1) let f x y = x + y
2) let f x y = [x; y]
3)
let f a =
if a then 1 else "hi"
4)
let f a b =
if a then 0 else b
5)
let f a b c =
let d = "hi" ^ a ^ b ^ c in
d == "hello"
(* Creating functions *)
1) float -> float -> float
2) 'a -> 'b -> 'b list
3) int -> float -> int
... | null | https://raw.githubusercontent.com/umd-cmsc330/cmsc330spring22/38f025e4eaf567c6802c6ade3936e4e0f994092a/discussions/d5_typing/disc5.ml | ocaml | Typing Practice
Creating functions
Records and New Types |
1) let f x y = x + y
2) let f x y = [x; y]
3)
let f a =
if a then 1 else "hi"
4)
let f a b =
if a then 0 else b
5)
let f a b c =
let d = "hi" ^ a ^ b ^ c in
d == "hello"
1) float -> float -> float
2) 'a -> 'b -> 'b list
3) int -> float -> int
4) 'a -> 'a -> 'a list
1)
type hello = (st... |
a75e66f582c901f31a4a7e41879cc6aed8c120c9a83b5ee671511676631aa8de | xclerc/ocamljava | javaReferenceArray.ml |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at yo... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/library/javalib/src/javaReferenceArray.ml | ocaml | Usual operations |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at yo... |
c110c1c0f3ffec74d9c35614c74fc4d55162a7a133cb1ce3f87beca9b3e1c006 | THISISDINOSAUR/Anatomy | point.rkt | #lang racket
(provide (all-defined-out))
(require racket/draw)
(struct point (x y z)
#:auto-value 0
#:transparent
#:mutable)
(define point-zero (point 0 0 0))
(define (add-points point1 point2)
(point (+ (point-x point1) (point-x point2)) (+ (point-y point1) (point-y point2)) (+ (point-z point1) (point-z p... | null | https://raw.githubusercontent.com/THISISDINOSAUR/Anatomy/883aa140c41cd375575a2944bda79608c660935b/structs/point.rkt | racket | we changed the handidness of the system
y used to point down, now it points up
-a-point-about-another-point-2d | #lang racket
(provide (all-defined-out))
(require racket/draw)
(struct point (x y z)
#:auto-value 0
#:transparent
#:mutable)
(define point-zero (point 0 0 0))
(define (add-points point1 point2)
(point (+ (point-x point1) (point-x point2)) (+ (point-y point1) (point-y point2)) (+ (point-z point1) (point-z p... |
2477b8762a96f942f1483d6b48b46c74a5133e4708acb24bb06ee8d215423c63 | carld/wangs-algorithm | wang.rkt | #lang racket
(define (sequent->string sequent)
(let* [(seq-as-str (format "~a" sequent))
(sequent-max-width 50)
(padding (make-string (- sequent-max-width (string-length seq-as-str)) #\space))]
(format "~a~a" sequent padding)))
(define wang-eval0
(case-lambda
[(sequent rule line)
... | null | https://raw.githubusercontent.com/carld/wangs-algorithm/8c0677561d1ed0e4d3a1749454d0088c99324e28/wang.rkt | racket | NOT on the right
OR on the right | #lang racket
(define (sequent->string sequent)
(let* [(seq-as-str (format "~a" sequent))
(sequent-max-width 50)
(padding (make-string (- sequent-max-width (string-length seq-as-str)) #\space))]
(format "~a~a" sequent padding)))
(define wang-eval0
(case-lambda
[(sequent rule line)
... |
b44e2aea1060846a346793a390722ea234a4483c8fd7032c9b65f67070c7c439 | uhc/uhc | CoreParse.hs | -----------------------------------------------------------------------
The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
... | null | https://raw.githubusercontent.com/uhc/uhc/8eb6914df3ba2ba43916a1a4956c6f25aa0e07c5/EHC/src/lvm/Core/CoreParse.hs | haskell | ---------------------------------------------------------------------
---------------------------------------------------------------------
----------------------------------------------------------------------}
--------------------------------------------------------------
-----------------------------------------... | The Core Assembler .
Copyright 2001 , . All rights reserved . This file
is distributed under the terms of the GHC license . For more
information , see the file " license.txt " , which is included in
the distribution .
The Core Assembler.
Copyright 2001, Daan Leijen. All rights reserv... |
caadece157d609c13311847d71357f5b08d186648b83ffc34757e49f1d853ed9 | dcastro/twenty48 | Moves.hs | module Game.Optimized.Moves
( playPlayer
, playComputer
, transpose
, computerAvailableMoves
, randomComputerMove
, randomCoord
, randomCell
) where
import Control.Monad.Random (MonadRandom)
import Control.Monad.ST (ST)
import qualified Data.List ... | null | https://raw.githubusercontent.com/dcastro/twenty48/d4a58bfa389bb247525fd18f80ef428d84ef5fe9/src/Game/Optimized/Moves.hs | haskell | -----------------------------------------------------
-----------------------------------------------------
| merge cells left to right, as if they were all pushed to the left
| moves all occupied cells to the left, and all zeroes to the right
| pushes an unoccupied cell at index `i` to the right, and leaves it amon... | module Game.Optimized.Moves
( playPlayer
, playComputer
, transpose
, computerAvailableMoves
, randomComputerMove
, randomCoord
, randomCell
) where
import Control.Monad.Random (MonadRandom)
import Control.Monad.ST (ST)
import qualified Data.List ... |
6c581f74912405f6036c42c8345d1460cc2964a5103c14f95b5af95cf0523015 | cdsmith/HMock | DeriveRecursive.hs | module Util.DeriveRecursive where
import Control.Monad (replicateM)
import Control.Monad.Extra (concatMapM)
import Control.Monad.State (StateT, evalStateT, gets, modify)
import Control.Monad.Trans (MonadTrans (lift))
import Language.Haskell.TH
import Data.List (foldl')
deriveRecursive :: Maybe DerivStrategy -> Name -... | null | https://raw.githubusercontent.com/cdsmith/HMock/0bd43c3fb0ea755336b031fa00a68ce5722cf42b/test/Util/DeriveRecursive.hs | haskell | module Util.DeriveRecursive where
import Control.Monad (replicateM)
import Control.Monad.Extra (concatMapM)
import Control.Monad.State (StateT, evalStateT, gets, modify)
import Control.Monad.Trans (MonadTrans (lift))
import Language.Haskell.TH
import Data.List (foldl')
deriveRecursive :: Maybe DerivStrategy -> Name -... | |
292972bc2313797ae754d23bb2b87c271ca9ffd8c79762368f0bcccc3b38c147 | cdaringe/protohacks | budgetchat_test.ml | open Eio
let run f = Eio_main.run (fun env -> Switch.run (fun sw -> f ~env ~sw))
let main ~env ~sw =
let pool, enqueue = Budgetchat.create_msg_queue_env () in
let _net = Eio_mock.Net.make "mocknet" in
let in_fiber socket =
Fiber.fork ~sw (fun _ -> Budgetchat.handle_socket ~enqueue ~pool socket ())
in
le... | null | https://raw.githubusercontent.com/cdaringe/protohacks/2884c92e8a41013163d8d6b6a08354916480b4c9/tests/budgetchat/budgetchat_test.ml | ocaml | open Eio
let run f = Eio_main.run (fun env -> Switch.run (fun sw -> f ~env ~sw))
let main ~env ~sw =
let pool, enqueue = Budgetchat.create_msg_queue_env () in
let _net = Eio_mock.Net.make "mocknet" in
let in_fiber socket =
Fiber.fork ~sw (fun _ -> Budgetchat.handle_socket ~enqueue ~pool socket ())
in
le... | |
56d38babc047c1d136dd11026792439def6a9b7753a5bdf2f218319edee2fff2 | MBcode/LispUtils | aq.lisp | ;;; This is a version of the AQ algorithm for learning from examples which uses
;;; beam search to generate bounded stars.
Copyright ( c ) 1993 by . This program may be freely
;;;; copied, used, or modified provided that this copyright notice is included
;;;; in each copy of this code and parts thereof.
This ... | null | https://raw.githubusercontent.com/MBcode/LispUtils/8c9d09aa732fca1c7c5b42b6c5067b89de98cb49/stat/ml-progs/ml/aq.lisp | lisp | This is a version of the AQ algorithm for learning from examples which uses
beam search to generate bounded stars.
copied, used, or modified provided that this copyright notice is included
in each copy of this code and parts thereof.
nominal feature values and that complexes are represented similarly with
?'s fo... |
Copyright ( c ) 1993 by . This program may be freely
This version of AQ assumes that events are represented as ordered lists of
not include negation , internal disjunction , linear or structural features .
It has a general LEF function but does not support tolerances .
(in-package :user)
(provide 'aq)
(re... |
741f3faadbdea4e33126ccb8bea84a12b00cc79ed7423200d110fda073cc71d9 | scicloj/metamorph.ml | toydata.clj | (ns scicloj.metamorph.ml.toydata
(:require
[camel-snake-kebab.core :as csk]
[clojure.java.io :as io]
[tablecloth.api :as tc]
[tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]))
(defn sonar-ds []
(-> (ds/->dataset
(io/input-stream (io/resource "data/sonar.csv"))
... | null | https://raw.githubusercontent.com/scicloj/metamorph.ml/795ac6b0618a510e91ca3e0c5c9a01523e32d827/src/scicloj/metamorph/ml/toydata.clj | clojure | (ns scicloj.metamorph.ml.toydata
(:require
[camel-snake-kebab.core :as csk]
[clojure.java.io :as io]
[tablecloth.api :as tc]
[tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]))
(defn sonar-ds []
(-> (ds/->dataset
(io/input-stream (io/resource "data/sonar.csv"))
... | |
c06b96fa87e15605792ba7995de9174c4056b049249b5ae1e2d5129d20d2a249 | tnelson/Forge | eval-thing.rkt | #lang forge
option problem_type temporal
option verbose 4
sig Node {
var edges: set Node
}
run {
all n1, n2: Node | lone n1.edges
always edges != edges'
-- test
--edges'.edges' != (edges.edges)' -- PARSE ERROR
--(edges').(edges') != (edges.edges)' -- UNSAT
-- [1] And yet, in the evaluator,... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/examples/eval-thing.rkt | racket | #lang forge
option problem_type temporal
option verbose 4
sig Node {
var edges: set Node
}
run {
all n1, n2: Node | lone n1.edges
always edges != edges'
-- test
--edges'.edges' != (edges.edges)' -- PARSE ERROR
--(edges').(edges') != (edges.edges)' -- UNSAT
-- [1] And yet, in the evaluator,... | |
6fd4a1feb1d36b4da6a19e399f7da1612976439a96a1a61a61f7269faa9d87d3 | SimulaVR/Simula | Grab.hs | # LANGUAGE LambdaCase #
module Plugin.Input.Grab where
import qualified Godot.Gdnative.Internal.Api as Api
import qualified Godot.Methods as G
import Plugin.Imports
import Plugin.SimulaController
import Plugin.SimulaViewSprite
import Plugin.Types
data GrabSta... | null | https://raw.githubusercontent.com/SimulaVR/Simula/f4ebd0dd2266c62c49b06b08a6f425d454ed5814/addons/godot-haskell-plugin/src/Plugin/Input/Grab.hs | haskell | dist
Position of this controller
Position of other controller | # LANGUAGE LambdaCase #
module Plugin.Input.Grab where
import qualified Godot.Gdnative.Internal.Api as Api
import qualified Godot.Methods as G
import Plugin.Imports
import Plugin.SimulaController
import Plugin.SimulaViewSprite
import Plugin.Types
data GrabSta... |
e59188d3410e692a6f1c8e530fee9e1dee82b6773f5e380f30204529b7309069 | barko/brr-eg | ttt_history.ml | open Util
type player = X | O
type field =
| Empty
| Marked of player
type turn =
| Playing of player
| Winner of player
| Draw
type state = {
board : field IntMap.t;
turn : turn;
}
open Note
open Brr
type msg = [ `JumpTo of int | `Mark of int ]
type snapshot = {
state : state;
button : El.t;
... | null | https://raw.githubusercontent.com/barko/brr-eg/912ac110fd8ef139e163a086bf3e25e0ccc35740/tic-tac-toe/ttt_history.ml | ocaml | index into history list | open Util
type player = X | O
type field =
| Empty
| Marked of player
type turn =
| Playing of player
| Winner of player
| Draw
type state = {
board : field IntMap.t;
turn : turn;
}
open Note
open Brr
type msg = [ `JumpTo of int | `Mark of int ]
type snapshot = {
state : state;
button : El.t;
... |
c276ae2c66e0e84e09845e9a74da01b1beae4e1d8d463a21bbacb58ed37a7694 | ghc/packages-Cabal | setup.test.hs | import Test.Cabal.Prelude
Test unneed version bound on internal build - tools
main = setupAndCabalTest $ do
setup' "configure" []
assertOutputContains "extraneous version range"
=<< setup' "sdist" []
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs | haskell | import Test.Cabal.Prelude
Test unneed version bound on internal build - tools
main = setupAndCabalTest $ do
setup' "configure" []
assertOutputContains "extraneous version range"
=<< setup' "sdist" []
| |
ba723db686f76f82a01e719079719e0dd8603686eafc9487c275652c758c61ca | weldr/bdcs | Comps.hs | Copyright ( C ) 2016 - 2017 Red Hat , Inc.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
--
-- Th... | null | https://raw.githubusercontent.com/weldr/bdcs/cf360c3240644b4847336b9d58b2067f3aa1ec50/src/BDCS/Import/Comps.hs | haskell |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU... | Copyright ( C ) 2016 - 2017 Red Hat , Inc.
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module... |
d3dda6d8289f05145f63c82b91b3af7f60346c66b7e7089f29b2ab3b22dc6e0f | qkrgud55/ocamlmulti | tscanf2_master.ml | A very simple master :
- first launch a slave process ,
- then repeat a random number of times :
+ print the string " " on stderr ,
+ send it to the slave ,
+ and wait for its answer " -pong " ,
- finally send the string " stop " to the slave
and wait for its answer " OK , ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/testsuite/tests/lib-scanf-2/tscanf2_master.ml | ocaml |
Random.self_init ();
let n = max (Random.int 8) 1 in
| A very simple master :
- first launch a slave process ,
- then repeat a random number of times :
+ print the string " " on stderr ,
+ send it to the slave ,
+ and wait for its answer " -pong " ,
- finally send the string " stop " to the slave
and wait for its answer " OK , ... |
03341c762f3ca02eb0684ea01c501a35f88f4cdb5a2f954e7ef95bb1f49b9c74 | 8c6794b6/guile-tjit | t-subr-call-11.scm | ;;; Test for inlined subr-call `cadr'.
(define (loop n proc)
(let lp ((n n) (acc 0))
(if (zero? n)
acc
(lp (- n 1) (+ acc (proc '(1 2 3 4 5)))))))
(loop 100 cadr)
| null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/t-subr-call-11.scm | scheme | Test for inlined subr-call `cadr'. |
(define (loop n proc)
(let lp ((n n) (acc 0))
(if (zero? n)
acc
(lp (- n 1) (+ acc (proc '(1 2 3 4 5)))))))
(loop 100 cadr)
|
f093921f5776579dd276f2fb6d79c74749237e41982303d9e59c0133497535e0 | CodyReichert/qi | symbols.lisp | (in-package :alexandria)
(declaim (inline ensure-symbol))
(defun ensure-symbol (name &optional (package *package*))
"Returns a symbol with name designated by NAME, accessible in package
designated by PACKAGE. If symbol is not already accessible in PACKAGE, it is
interned there. Returns a secondary value reflecting t... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/alexandria-latest/symbols.lisp | lisp | (in-package :alexandria)
(declaim (inline ensure-symbol))
(defun ensure-symbol (name &optional (package *package*))
"Returns a symbol with name designated by NAME, accessible in package
designated by PACKAGE. If symbol is not already accessible in PACKAGE, it is
interned there. Returns a secondary value reflecting t... | |
762deb6cb50d41aca328991da3a19bfe616a2d03c92495f6080651f0513dc962 | bos/rwh | PrettyStub.hs | module PrettyStub where
{-- snippet stubs --}
import SimpleJSON
data Doc = ToBeDefined
deriving (Show)
string :: String -> Doc
string str = undefined
text :: String -> Doc
text str = undefined
double :: Double -> Doc
double num = undefined
{-- /snippet stubs --}
{-- snippet append --}
(<>) :: Doc -> Doc ... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch05/PrettyStub.hs | haskell | - snippet stubs -
- /snippet stubs -
- snippet append -
- /snippet append -
- snippet hcat -
- /snippet hcat -
- snippet fsep -
- /snippet fsep - | module PrettyStub where
import SimpleJSON
data Doc = ToBeDefined
deriving (Show)
string :: String -> Doc
string str = undefined
text :: String -> Doc
text str = undefined
double :: Double -> Doc
double num = undefined
(<>) :: Doc -> Doc -> Doc
a <> b = undefined
char :: Char -> Doc
char c = undefined
h... |
8d68823208b1e577cbd0840853b0a6c2c6902c1649fc0f81ca4ee4313cc19bbe | jfischoff/hasql-queue | AtLeastOnce.hs | module Hasql.Queue.High.AtLeastOnce where
import qualified Hasql.Queue.High.ExactlyOnce as H
import qualified Hasql.Queue.Internal as I
import Hasql.Connection
import qualified Hasql.Encoders as E
import qualified Hasql.Decoders as D
import Control.Exception
import Data.Function
{-|Enqueu... | null | https://raw.githubusercontent.com/jfischoff/hasql-queue/49f4cba713bedf6ce907cc89794f2567befed396/src/Hasql/Queue/High/AtLeastOnce.hs | haskell | |Enqueue a list of payloads.
^ Connection
^ Payload encoder
^ List of payloads to enqueue
^ Connection
^ Payload decoder
^ Retry count
^ Element count
^ Continuation
|
Retrieve the payloads that have entered a failed state. See 'withDequeue' for how that
occurs. The function returns a list of values and an id.... | module Hasql.Queue.High.AtLeastOnce where
import qualified Hasql.Queue.High.ExactlyOnce as H
import qualified Hasql.Queue.Internal as I
import Hasql.Connection
import qualified Hasql.Encoders as E
import qualified Hasql.Decoders as D
import Control.Exception
import Data.Function
enqueue :... |
23f111668c740e89f0d3e27de1beeb8c562c6d258cdfb553a147a7f475926afd | alexandergunnarson/quantum | data.cljc | (ns quantum.untyped.core.data
(:require
[quantum.untyped.core.convert :as uconv
:refer [>keyword]]
[quantum.untyped.core.core :as ucore]))
(ucore/log-this-ns)
(defn quote-map-base [kw-modifier ks & [no-quote?]]
(->> ks
(map #(vector (cond->> (kw-modifier %) (not no-quote?) (list 'quote)) %... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src-untyped/quantum/untyped/core/data.cljc | clojure | (ns quantum.untyped.core.data
(:require
[quantum.untyped.core.convert :as uconv
:refer [>keyword]]
[quantum.untyped.core.core :as ucore]))
(ucore/log-this-ns)
(defn quote-map-base [kw-modifier ks & [no-quote?]]
(->> ks
(map #(vector (cond->> (kw-modifier %) (not no-quote?) (list 'quote)) %... | |
c57b9332d20db2c102f853fa2d4826fb899286d021ccd5d9ce3a1a88760f0cd7 | ocsigen/ocaml-eliom | ignored_scan_counters.ml | 's patch did not support % _ [ nlNL ] ; test their behavior
not supported by Printf or Format : fails at runtime
let () = Printf.printf "%_n"
;;
let () = Printf.printf "%_N"
;;
let () = Printf.printf "%_l"
;;
let () = Printf.printf "%_L"
;;
let () = Format.printf "%_n"
;;
let () = Format.printf "%_N"
;;
let () =... | null | https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/formats-transition/ignored_scan_counters.ml | ocaml | identity for Scanf | 's patch did not support % _ [ nlNL ] ; test their behavior
not supported by Printf or Format : fails at runtime
let () = Printf.printf "%_n"
;;
let () = Printf.printf "%_N"
;;
let () = Printf.printf "%_l"
;;
let () = Printf.printf "%_L"
;;
let () = Format.printf "%_n"
;;
let () = Format.printf "%_N"
;;
let () =... |
63da8b5daf4401994848bc3bc7de054ce94ad1006ea27b065b3bd4b9ec2928a8 | magthe/sandi | Base64.hs | # LANGUAGE ForeignFunctionInterface #
-- |
-- Module: Codec.Binary.Base64
Copyright : ( c ) 2012
-- License: BSD3
--
Implemented as specified in RFC 4648 ( < > ) .
--
Base64 encoding works by expanding blocks of 3 bytes of data into blocks of
4 bytes of data . Finally it also includes a well defined endin... | null | https://raw.githubusercontent.com/magthe/sandi/a8ef86ec3798a640d86342421a7fa7fa97bdedd4/sandi/src/Codec/Binary/Base64.hs | haskell | |
Module: Codec.Binary.Base64
License: BSD3
bytes too.
| Encoding function.
This function encodes as large a portion of the input as possible and
returns the encoded part together with the remaining part. Enough space is
allocated for the encoding to make sure that the remaining part is less than
>>> b64E... | # LANGUAGE ForeignFunctionInterface #
Copyright : ( c ) 2012
Implemented as specified in RFC 4648 ( < > ) .
Base64 encoding works by expanding blocks of 3 bytes of data into blocks of
4 bytes of data . Finally it also includes a well defined ending of the
encoded data to make sure the size of the final ... |
8904d0b56d8375b15d5a92676577fe9604f2799f599afb018956f6e6c09b5a89 | TorXakis/TorXakis | TestBehExprDefs.hs |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
{-# LANGUAGE OverloadedStrings #-}
# LAN... | null | https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/sys/bexpr/test/TestBehExprDefs.hs | haskell | # LANGUAGE OverloadedStrings #
variables
valExpr: True
valExpr: False
valExpr : 0 <= x
valExpr : x == y
offer: A
offer: B!1
offer: B ? x
-------------------------------------------------------------------------
Tests
-------------------------------------------------------------------------
temporarily disabled,
... |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
# LANGUAGE TemplateHaskell #
module T... |
ace3a66123a4dec7b70f8f35092bc5b29c97e707edef15cdefa098cc9f88efc6 | VictorNicollet/99-Problems-OCaml | p22.ml | (* Create a list containing all integers within a given range. *)
let (--) a b =
let rec aux a b =
if a > b then [] else a :: aux (a+1) b
in
if a > b then List.rev (aux b a) else aux a b
;;
assert (4 -- 9 = [4;5;6;7;8;9]) ;;
assert (9 -- 4 = [9;8;7;6;5;4]) ;;
| null | https://raw.githubusercontent.com/VictorNicollet/99-Problems-OCaml/a13e625545d54d4d927b39b18ab1ffba7de6b7e6/21-30/p22.ml | ocaml | Create a list containing all integers within a given range. |
let (--) a b =
let rec aux a b =
if a > b then [] else a :: aux (a+1) b
in
if a > b then List.rev (aux b a) else aux a b
;;
assert (4 -- 9 = [4;5;6;7;8;9]) ;;
assert (9 -- 4 = [9;8;7;6;5;4]) ;;
|
512907bec85f0eee41adb0de7e85d3bc8f49259bc52a87281140fab80298d510 | scarvalhojr/haskellbook | section22.2.hs |
import Control.Applicative (liftA2)
import Data.Char (toUpper)
boop :: Num a => a -> a
boop = (*2)
doop :: Num a => a -> a
doop = (+10)
bip :: Num a => a -> a
bip = boop . doop
bloop :: Num a => a -> a
bloop = fmap boop doop
bbop :: Num a => a -> a
bbop = (+) <$> boop <*> doop
duwop :: Num a => a -> a
duwop = l... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter22/section22.2.hs | haskell | - |
import Control.Applicative (liftA2)
import Data.Char (toUpper)
boop :: Num a => a -> a
boop = (*2)
doop :: Num a => a -> a
doop = (+10)
bip :: Num a => a -> a
bip = boop . doop
bloop :: Num a => a -> a
bloop = fmap boop doop
bbop :: Num a => a -> a
bbop = (+) <$> boop <*> doop
duwop :: Num a => a -> a
duwop = l... |
03bf514a9f2f1f86987b19f006f2768fc38ac1a7beda789cf816e0a3646094fd | BillHallahan/G2 | UnionPoly.hs | # LANGUAGE FlexibleContexts , OverloadedStrings #
module G2.Liquid.Inference.UnionPoly (UnionedTypes, sharedTyConsEE, lookupUT) where
import qualified G2.Data.UFMap as UF
import qualified G2.Data.UnionFind as UFind
import G2.Language
import qualified G2.Language.ExprEnv as E
import G2.Language.Monad.AST
import G2.Lan... | null | https://raw.githubusercontent.com/BillHallahan/G2/9f282cfa5e3806acad4fd7c0f70936022a740fc1/src/G2/Liquid/Inference/UnionPoly.hs | haskell | We want to try and be clever with passed in functions/lamdas to unify types when required,
but we can do too much if we unify non-function types or inner lambdas.
This is very much a heuristic. | # LANGUAGE FlexibleContexts , OverloadedStrings #
module G2.Liquid.Inference.UnionPoly (UnionedTypes, sharedTyConsEE, lookupUT) where
import qualified G2.Data.UFMap as UF
import qualified G2.Data.UnionFind as UFind
import G2.Language
import qualified G2.Language.ExprEnv as E
import G2.Language.Monad.AST
import G2.Lan... |
9023bc2bfc98e3ebf6df4fe585c5209b9e3c5f66653e984a5ce1ca8e753429b7 | hipsleek/hipsleek | termUtils.ml | #include "xdebug.cppo"
open VarGen
module MCP = Mcpure
open Gen.Basic
open Globals
open Others
open Cprinter
open Cpure
open Cformula
To find a LexVar formula
exception LexVar_Not_found;;
exception Invalid_Phase_Num;;
let find_lexvar_b_formula (bf: b_formula): lex_info =
let (pf, _) = bf in
match pf with
| L... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/bef_indent/termUtils.ml | ocaml | if l==[] then true
else List.exists (fun s -> s="") l
This is to ensure we strip Lexvar only once or when necessary
match sf with
formula_struc_continuation = map_opt strip_lexvar_post eb.formula_struc_continuation }
|... | #include "xdebug.cppo"
open VarGen
module MCP = Mcpure
open Gen.Basic
open Globals
open Others
open Cprinter
open Cpure
open Cformula
To find a LexVar formula
exception LexVar_Not_found;;
exception Invalid_Phase_Num;;
let find_lexvar_b_formula (bf: b_formula): lex_info =
let (pf, _) = bf in
match pf with
| L... |
f4276cfc8accc15dd47682d7ac99cdcc4b54bd83ea751a8609601200ca6c8616 | iskandr/parakeet-retired | Ptr.ml |
type setters = {
: ( Int64.t - > int - > bool - > unit ) ;
set_char : ( Int64.t - > int - > char - > unit ) ;
set_int32 : ( Int64.t - > int - > Int32.t - > unit ) ;
set_int64 : ( Int64.t - > int - > Int64.t - > unit ) ;
set_float32 : ( Int64.t - > int - > float - > unit ) ;
set_floa... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/Runtime/Memory/Ptr.ml | ocaml |
type setters = {
: ( Int64.t - > int - > bool - > unit ) ;
set_char : ( Int64.t - > int - > char - > unit ) ;
set_int32 : ( Int64.t - > int - > Int32.t - > unit ) ;
set_int64 : ( Int64.t - > int - > Int64.t - > unit ) ;
set_float32 : ( Int64.t - > int - > float - > unit ) ;
set_floa... | |
3c67a27cbb408f8b1025fc04ceb0beee1a8c1c90ec64266e280acc8200b14da6 | aliter/aliter | gen_server_tcp.erl | -module(gen_server_tcp).
-author('').
-behaviour(gen_server).
-include("include/records.hrl").
-export([behaviour_info/1]).
%% API
-export([
start/3,
start/4,
start_link/3,
start_link/4]).
%% gen_server callbacks
-export([
init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
te... | null | https://raw.githubusercontent.com/aliter/aliter/03c7d395d5812887aecdca20b16369f8a8abd278/src/gen_server_tcp.erl | erlang | API
gen_server callbacks
helpers
gen_server callbacks
Helpers | -module(gen_server_tcp).
-author('').
-behaviour(gen_server).
-include("include/records.hrl").
-export([behaviour_info/1]).
-export([
start/3,
start/4,
start_link/3,
start_link/4]).
-export([
init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).... |
0f58bd6c7d826fa73889eceb93c25c9dd5a1e65f1c34f004954ee29469d4f789 | SonyCSLParis/BENG | wh-pronouns.lisp | Copyright ( C ) 2019 Sony Computer Science Laboratories Paris
( www.remivantrijp.eu )
;;;
;;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , version 3 o... | null | https://raw.githubusercontent.com/SonyCSLParis/BENG/1eb525e132d2b1f74ae18532657561725f6fbb78/lexicon/pronouns/wh-pronouns.lisp | lisp |
This program is free software: you can redistribute it and/or modify
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for mo... | Copyright ( C ) 2019 Sony Computer Science Laboratories Paris
( www.remivantrijp.eu )
it under the terms of the GNU General Public License as published by
the Free Software Foundation , version 3 of the License .
You should have received a copy of the GNU General Public Li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.