_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 |
|---|---|---|---|---|---|---|---|---|
806ea73650170df87cedce90c8fe23b5160cd8169c2cebb1345ae9c953eb1eea | ertugrulcetin/ClojureNews | login.cljs | (ns route.login
(:require-macros [secretary.core :refer [defroute]])
(:require [controller.login :as controller]
[secretary.core]))
(defroute login "/login" []
(controller/log-in-page))
(defroute logout "/logout" []
(controller/log-out)) | null | https://raw.githubusercontent.com/ertugrulcetin/ClojureNews/28002f6b620fa4977d561b0cfca0c7f6a635057b/src/cljs/route/login.cljs | clojure | (ns route.login
(:require-macros [secretary.core :refer [defroute]])
(:require [controller.login :as controller]
[secretary.core]))
(defroute login "/login" []
(controller/log-in-page))
(defroute logout "/logout" []
(controller/log-out)) | |
2b2fc866dfad606f119a1a07b4e8496ecb024c21c98dcfad18a60ba1ed91b10f | gdamjan/erlang-irc-bot | ircbot_plugin_pong.erl | -module(ircbot_plugin_pong).
-author("").
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2, handle_call/2, handle_info/2, code_change/3]).
init(_Args) ->
{ok, []}.
handle_event(Msg, State) ->
case Msg of
{in, Ref, [<<>>,<<>>,<<"PING">>, Server]} ->
Ref:pong(Server),
... | null | https://raw.githubusercontent.com/gdamjan/erlang-irc-bot/5e55848177b1e0e0a71d41c516f41d3cfe112784/src/ircbot_plugin_pong.erl | erlang | -module(ircbot_plugin_pong).
-author("").
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2, handle_call/2, handle_info/2, code_change/3]).
init(_Args) ->
{ok, []}.
handle_event(Msg, State) ->
case Msg of
{in, Ref, [<<>>,<<>>,<<"PING">>, Server]} ->
Ref:pong(Server),
... | |
be3869f47f895e7a18e264ef065df2f149870deacc3e74cc5ddd86d9361f9426 | bondy-io/bondy | bondy_kafka_bridge.erl | %% =============================================================================
%% bondy_kafka_bridge.erl -
%%
Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the Licens... | null | https://raw.githubusercontent.com/bondy-io/bondy/a1267e7e5526db24f278e12315020753f3168b44/apps/bondy_broker_bridge/src/bondy_kafka_bridge.erl | erlang | =============================================================================
bondy_kafka_bridge.erl -
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 ... | Copyright ( c ) 2016 - 2022 Leapsight . 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(bondy_kafka_bridge).
-behaviour(bondy_broker_bridge).
-include_lib("kernel/include/logger.hrl").
-in... |
c9291ca7f177e4b21109ae97708ae06301c7666fbc6d36f17a1960126fc60972 | kupl/LearnML | original.ml | type lambda = V of var | P of (var * lambda) | C of (lambda * lambda)
and var = string
let check (lambda : lambda) : bool =
let rec e (lambda : lambda) : bool =
match lambda with
| V v -> false
| P (p, l) ->
let rec f (p : string) (l : lambda) : bool =
match l with
| V a -> i... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/lambda/sub96/original.ml | ocaml | type lambda = V of var | P of (var * lambda) | C of (lambda * lambda)
and var = string
let check (lambda : lambda) : bool =
let rec e (lambda : lambda) : bool =
match lambda with
| V v -> false
| P (p, l) ->
let rec f (p : string) (l : lambda) : bool =
match l with
| V a -> i... | |
7109b5af3c76b8fdeb51fb99900b24427009442cab097df5e629bb7f756a520a | marigold-dev/deku | receipt.ml | open Deku_ledger
type receipt =
| Ticket_transfer_receipt of { operation : Operation_hash.t }
| Withdraw_receipt of {
operation : Operation_hash.t;
handle : Ledger.Withdrawal_handle.t;
}
| Vm_origination_receipt of {
operation : Operation_hash.t;
contract_address : Deku_ledger.Contrac... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/protocol/receipt.ml | ocaml | open Deku_ledger
type receipt =
| Ticket_transfer_receipt of { operation : Operation_hash.t }
| Withdraw_receipt of {
operation : Operation_hash.t;
handle : Ledger.Withdrawal_handle.t;
}
| Vm_origination_receipt of {
operation : Operation_hash.t;
contract_address : Deku_ledger.Contrac... | |
a11471a9e78666bc5acadfa3a1d7ad3f4fadc4a419078133dd9f78d2cb36c00e | FundingCircle/jackdaw | word_count.clj | (ns word-count
"This is the classic 'word count' example done as a stream
processing application using the Jackdaw Streams API.
The application reads from a Kafka topic called `input` and splits
the value into words. It then writes to a Kafka topic called
`output` for each word seen."
(:require
[clojure... | null | https://raw.githubusercontent.com/FundingCircle/jackdaw/b4f67106cc12a78d9dcc64b6cba668ab6a804d04/examples/word-count/src/word_count.clj | clojure | Install this only if not already installed
Install this only if not already installed
Install this only if not already installed
application.
This comment block introduces an interactive development
workflow. With only a few keystrokes, the application can be
pure functions. We can supply inputs at the REPL, and... | (ns word-count
"This is the classic 'word count' example done as a stream
processing application using the Jackdaw Streams API.
The application reads from a Kafka topic called `input` and splits
the value into words. It then writes to a Kafka topic called
`output` for each word seen."
(:require
[clojure... |
5f5ae1099c6bd61cd19e4ca7e8a06ecd37b83056a0894706ef75663197d44dd0 | dhammikamare/Learn-OCaml | paint.ml | Task : Define types for use in a drawing program .
* ( a ) Write a rotate function that rotates an element by a given angle .
* Hint : x ' = x cos f - y sin f , y ' = y cos f + x sin f
* ( b ) Suppose we want to draw elements using various styles , which have the following at - tributes ,
* • ... | null | https://raw.githubusercontent.com/dhammikamare/Learn-OCaml/2d4e3da38ee86cd7477964ffb8756a8483260322/lab06%20Variants/paint.ml | ocaml | centre coordinates and radius
end-point coordinates
test | Task : Define types for use in a drawing program .
* ( a ) Write a rotate function that rotates an element by a given angle .
* Hint : x ' = x cos f - y sin f , y ' = y cos f + x sin f
* ( b ) Suppose we want to draw elements using various styles , which have the following at - tributes ,
* • ... |
ee76cf039a4cc6c634eca8c7bbb9f4ab49fca74d81004913861588972e203cbb | sbcl/sbcl | defbangtype.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no wa... | null | https://raw.githubusercontent.com/sbcl/sbcl/8045de65e8d6b71bb830441c36a5ef2232f933af/src/code/defbangtype.lisp | lisp | more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
build-the-cross-compiler time defines its macro both in the
set up. | This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-KERNEL")
the DEF!TYPE macro
DEF!TYPE = cold DEFTYPE , a version of DEFTYPE which at
cross - compilati... |
0d62e63b0be909b33dcedf2dced792f857a1d3aea993a20e46182a24ffb3b0f4 | startalkIM/ejabberd | brod_topic_subscriber.erl | %%%
Copyright ( c ) 2016 - 2017 Klarna AB
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% -2.0
%%%
%%% Unless required by applicable law or agreed to in ... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/brod/src/brod_topic_subscriber.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 or implied.
See the License for the specific language g... | Copyright ( c ) 2016 - 2017 Klarna AB
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(brod_topic_subscriber).
-behaviour(gen_server).
-export([ ack/3
, start_link/6
, start_link/7
, ... |
2b717532626d226377fbcb0114e59db85e1cb0d23e5aa8f45d7173fc1722784d | pbrisbin/google-drive | FileSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.Google.Drive.FileSpec
( main
, spec
) where
import SpecHelper
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "Network.Google.Drive.File" $ do
it "can create a file and get it back" $ do
runApiSpec $ \folder -> do
let ... | null | https://raw.githubusercontent.com/pbrisbin/google-drive/7ecfa5e60658758674c521bbeb81be740e6d0b10/test/Network/Google/Drive/FileSpec.hs | haskell | # LANGUAGE OverloadedStrings # | module Network.Google.Drive.FileSpec
( main
, spec
) where
import SpecHelper
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "Network.Google.Drive.File" $ do
it "can create a file and get it back" $ do
runApiSpec $ \folder -> do
let fd = setParent folder $ newFile "te... |
58902d86705851f4dca41c27a833231fc3a98f4d87ad3fe7c5f42fcdc1939318 | graninas/GraphServer | Textures.hs | Textures.hs ; ( ) 2005
This module is for loading textures
This module is for loading textures
-}
module ThirdParty.Frag.Textures where
import Graphics.UI.GLUT
import ThirdParty.Frag.TGA (readTga)
import Data.Word (Word8)
import Foreign.Marshal.Alloc (free)
-- read a list of images an... | null | https://raw.githubusercontent.com/graninas/GraphServer/088c234ae840162002f707559cfefc96bcc02bda/src/ThirdParty/Frag/Textures.hs | haskell | read a list of images and returns a list of textures
read a single texture
read the image data
creates the texture
generate our texture.
make our new texture the current texture.
generateMipmap Texture2D $= Enabled
| Textures.hs ; ( ) 2005
This module is for loading textures
This module is for loading textures
-}
module ThirdParty.Frag.Textures where
import Graphics.UI.GLUT
import ThirdParty.Frag.TGA (readTga)
import Data.Word (Word8)
import Foreign.Marshal.Alloc (free)
all images are assumed to... |
5a51f82b40408621a304a77d1434b68129869e6b95466cee9f62cc0015c347bb | tisnik/clojure-examples | core_test.clj | ;
( C ) Copyright 2016 , 2020
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(ns async5.core-test
(:require [cl... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/async5/test/async5/core_test.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2016 , 2020
-v10.html
(ns async5.core-test
(:require [clojure.test :refer :all]
[async5.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
|
08656fe0fc21f52f85a8335dae255f3808773061628b84efc78312e2d80093a2 | adityaathalye/sicp | ex2-64-list-to-tree-analysis.scm | ;; -*- geiser-scheme-implementation: mit -*-
(load "ex2-63-sets-as-binary-trees.scm")
(define (list->tree elements)
(car (partial-tree elements (length elements))))
(define (partial-tree elts len)
(if (= n 0)
(cons '() elts)
(let ((left-size (quotient (- n 1) 2)))
(let ((left-result (partial-... | null | https://raw.githubusercontent.com/adityaathalye/sicp/4554171b8eaa810c88f6308e590695e625c31180/ex2-64-list-to-tree-analysis.scm | scheme | -*- geiser-scheme-implementation: mit -*- |
(load "ex2-63-sets-as-binary-trees.scm")
(define (list->tree elements)
(car (partial-tree elements (length elements))))
(define (partial-tree elts len)
(if (= n 0)
(cons '() elts)
(let ((left-size (quotient (- n 1) 2)))
(let ((left-result (partial-tree elts left-size)))
(let ((left-... |
f236cc5618d82d9ee53c647a55e1b15acd618e3fb0a00c694830f4f6ca82d11f | Raynes/clj-github | issues.clj | (ns #^{:doc "Implements the API functions described here:
In any function that takes a 'state' argument, state is either \"open\" or \"closed\""}
clj-github.issues
(:use [clj-github.core]))
(defn search-issues
"Search through a project's issues."
[user repo state term]
(make-request ["issues/sea... | null | https://raw.githubusercontent.com/Raynes/clj-github/6e6d6711ff72c58bb2ba067e7c222fc5c7b198ba/src/clj_github/issues.clj | clojure | (ns #^{:doc "Implements the API functions described here:
In any function that takes a 'state' argument, state is either \"open\" or \"closed\""}
clj-github.issues
(:use [clj-github.core]))
(defn search-issues
"Search through a project's issues."
[user repo state term]
(make-request ["issues/sea... | |
3eb5cb264393174fcf561f380a3503b379a56972f2a51a04318216825bb048ec | nuvla/api-server | nuvlabox_peripheral_2_lifecycle_test.clj | (ns sixsq.nuvla.server.resources.nuvlabox-peripheral-2-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest use-fixtures]]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server.middleware.authn-info :ref... | null | https://raw.githubusercontent.com/nuvla/api-server/272c1b8f7a5cd306d01464cf801d6174df146f71/code/test/sixsq/nuvla/server/resources/nuvlabox_peripheral_2_lifecycle_test.clj | clojure | anonymous users cannot create a nuvlabox-peripheral resource
admin/nuvlabox users can create a nuvlabox-peripheral resource
other users can't see the peripheral
owners can see the peripheral
nuvlabox user is able to update nuvlabox-peripheral
verify that the update was written to disk
nuvlabox owner identity can... | (ns sixsq.nuvla.server.resources.nuvlabox-peripheral-2-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest use-fixtures]]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server.middleware.authn-info :ref... |
a418ed4edddfa1374d1b82935ad069100f1665497011e1d0108ab4708201a0b2 | ocharles/haskell-opentracing | TestLib.hs | {-# language OverloadedStrings #-}
module TestLib where
import Control.Concurrent
import Control.Monad.IO.Class
import Control.Monad.OpenTracing
hello :: (MonadIO m, MonadTracing m) => m ()
hello =
inSpan "hello" (liftIO $ threadDelay 10000 >> putStrLn "Hello!")
| null | https://raw.githubusercontent.com/ocharles/haskell-opentracing/8466a47b12fd5dbb7e9293c404c87e5f0222b285/test-lib/TestLib.hs | haskell | # language OverloadedStrings # |
module TestLib where
import Control.Concurrent
import Control.Monad.IO.Class
import Control.Monad.OpenTracing
hello :: (MonadIO m, MonadTracing m) => m ()
hello =
inSpan "hello" (liftIO $ threadDelay 10000 >> putStrLn "Hello!")
|
751c32fff24c00d5832664b9755785b719ba2b0f3362e0d886ea6ed8709a398d | ku-fpg/hermit | Debug.hs | # LANGUAGE FlexibleContexts #
module HERMIT.Dictionary.Debug
( -- * Debugging Rewrites
externals
, bracketR
, observeR
, observeFailureR
, traceR
) where
import Control.Arrow
import HERMIT.Context
import HERMIT.Core
import HERMIT.External
import HERMIT.Kure
import HERMIT.Monad
| Expos... | null | https://raw.githubusercontent.com/ku-fpg/hermit/3e7be430fae74a9e3860b8b574f36efbf9648dec/src/HERMIT/Dictionary/Debug.hs | haskell | * Debugging Rewrites
| If the 'Rewrite' fails, print out the 'Core', with a message.
| Print out the 'Core', with a message.
| Just say something, every time the rewrite is done.
| Show before and after a rewrite.
Be careful to only run the rr once, in case it has side effects. | # LANGUAGE FlexibleContexts #
module HERMIT.Dictionary.Debug
externals
, bracketR
, observeR
, observeFailureR
, traceR
) where
import Control.Arrow
import HERMIT.Context
import HERMIT.Core
import HERMIT.External
import HERMIT.Kure
import HERMIT.Monad
| Exposed debugging ' External 's .
e... |
54222243bf33f7f4aa382c519a027cafe874844fc01425190c728ec47bc9b1ee | gvolpe/exchange-rates | Responses.hs | # LANGUAGE DeriveGeneric #
module Http.Responses where
import Data.Aeson
import Data.Typeable ( Typeable )
import Domain.Currency
import GHC.Generics ( Generic )
data ExchangeResponse = ExchangeResponse
{ rate :: Float
, from :: Currency
... | null | https://raw.githubusercontent.com/gvolpe/exchange-rates/161108bfc859f399f06df7a8ce10e786f01af533/src/Http/Responses.hs | haskell | # LANGUAGE DeriveGeneric #
module Http.Responses where
import Data.Aeson
import Data.Typeable ( Typeable )
import Domain.Currency
import GHC.Generics ( Generic )
data ExchangeResponse = ExchangeResponse
{ rate :: Float
, from :: Currency
... | |
d6a687db84eda6f25f4256985d2e187335875399882285c66dddcbd076379d04 | dennismckinnon/Ethereum-Contracts | ACL->v5.lsp | ;ACL
;Default behaviour: If the permission name has been registered but the rule for a specific permission level
; does not yet exist. The the permission is automatically rejected.
; If the permission name does not exist then the request is automatically rejected
If the ACL does not have any rules for gi... | null | https://raw.githubusercontent.com/dennismckinnon/Ethereum-Contracts/25b5e7037da382dd95a1376fad81f936f6610b36/DOUG-v4%20%2B%20ACL/ACL-%3Ev5.lsp | lisp | ACL
Default behaviour: If the permission name has been registered but the rule for a specific permission level
does not yet exist. The the permission is automatically rejected.
If the permission name does not exist then the request is automatically rejected
permissions are automatically granted.
Use: ... |
If the ACL does not have any rules for giving ACL permissions , then requested
one to have already gotten the ACL permissions . Adding a permission rule similarly requires
Set Permission - Permission needed : 1
- Returns : 1(success ) , )
Add rule - Permission needed : 2
- Returns : 1(... |
f5d26775641ce551d7876da05b8344d01562e6860081b883a31125784148c59e | 8c6794b6/guile-tjit | error.scm | ;;;; Error handling during JIT compilation
Copyright ( C ) 2015 , 2016 Free Software Foundation , 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 3 of... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/trace/error.scm | scheme | Error handling during JIT compilation
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or... |
Copyright ( C ) 2015 , 2016 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA
02110 - 1301 USA
other than explicit retry or... |
e13b59ccac80a0fa7a3c1cb6bb5e6ef7fd3d6d193d825b756ef97642e9622305 | shmookey/solpb | Decode.hs | {-# LANGUAGE OverloadedStrings #-}
module Decode where
import Data.Map (Map)
import Data.Text (Text, pack, strip, stripStart)
import Data.List (nub)
import Data.Semigroup ((<>))
import qualified Data.Text.Template as Template
import qualified Data.Text as T
import qualified Data.Map as Map
import Types
import Util
... | null | https://raw.githubusercontent.com/shmookey/solpb/4263050f9436e0a1d541ac99ab52970e9c2132c6/src/Decode.hs | haskell | # LANGUAGE OverloadedStrings #
| Name of the decoder function for a given field's scalar type
| `fieldHandler i ft firstPass` handles a field by ID, type and pass
| Make code to initialise an array field's length from its counter
insert closing 'else'
delete leading 'else'
| Generate array allocators
| Generate ... |
module Decode where
import Data.Map (Map)
import Data.Text (Text, pack, strip, stripStart)
import Data.List (nub)
import Data.Semigroup ((<>))
import qualified Data.Text.Template as Template
import qualified Data.Text as T
import qualified Data.Map as Map
import Types
import Util
decoderName :: Field -> Name
decod... |
b7851244c185311a694c37b48424d72618aa1480c29ff0fd5c1b25f3ffb8de9d | myshov/programming_in_haskell | 5_step_defs.hs | import Prelude hiding (sum, take, last)
sum :: Num a => [a] -> a
sum [] = 0
sum (x:xs) = x + sum xs
take :: Num a => Int -> [a] -> [a]
take _ [] = []
take 0 _ = []
take n (x:xs) = x : take (n-1) xs
last :: Num a => [a] -> a
last [x] = x
last (_:xs) = last xs
| null | https://raw.githubusercontent.com/myshov/programming_in_haskell/3118695cc09a5ea0954917c318bf007b6ae5fcef/lesson6/5_step_defs.hs | haskell | import Prelude hiding (sum, take, last)
sum :: Num a => [a] -> a
sum [] = 0
sum (x:xs) = x + sum xs
take :: Num a => Int -> [a] -> [a]
take _ [] = []
take 0 _ = []
take n (x:xs) = x : take (n-1) xs
last :: Num a => [a] -> a
last [x] = x
last (_:xs) = last xs
| |
1d58ccaf38480d4e85bacd1b4568ea706fd018350549bd19d3e1315317540a5b | VisionsGlobalEmpowerment/webchange | views.cljs | (ns webchange.admin.pages.course-view.views
(:require
[reagent.core :as r]
[re-frame.core :as re-frame]
[webchange.admin.pages.course-view.state :as state]
[webchange.admin.widgets.page.views :as page]
[webchange.validation.specs.course-spec :as course-spec]
[webchange.ui.index :as ui]
[we... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/9e5cee6b88013b184cde6d53f128666b7ea895ed/src/cljs/webchange/admin/pages/course_view/views.cljs | clojure | (ns webchange.admin.pages.course-view.views
(:require
[reagent.core :as r]
[re-frame.core :as re-frame]
[webchange.admin.pages.course-view.state :as state]
[webchange.admin.widgets.page.views :as page]
[webchange.validation.specs.course-spec :as course-spec]
[webchange.ui.index :as ui]
[we... | |
694164e8855bb2b630b08dac6e1250fe1abd3bb14914937fe038b3cae43bd1e7 | shayan-najd/QFeldspar | Reification.hs | module QFeldspar.Expression.Conversions.Reification(rei,reiVar) where
import QFeldspar.Variable.Typed as VT
import QFeldspar.Environment.Typed
import qualified QFeldspar.Expression.GADTFirstOrder as GFO
import QFeldspar.Variable.Conversion ()
import qualified QFeldspar.Literal.GADT ... | null | https://raw.githubusercontent.com/shayan-najd/QFeldspar/ed60ce02794a548833317388f6e82e2ab1eabc1c/QFeldspar/Expression/Conversions/Reification.hs | haskell | module QFeldspar.Expression.Conversions.Reification(rei,reiVar) where
import QFeldspar.Variable.Typed as VT
import QFeldspar.Environment.Typed
import qualified QFeldspar.Expression.GADTFirstOrder as GFO
import QFeldspar.Variable.Conversion ()
import qualified QFeldspar.Literal.GADT ... | |
6f697da31aeb3581a08927ff6c1568efb6aea630d1030dc37fda6bdf8bb2d05c | Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator | GetUserByName.hs | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
-- | Contains the different functions to run the operation getUserByName
module OpenAPI.Oper... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/d3e9c7db4d8b15de9136007a9b9519a7bd8e2199/example/generatedCode/src/OpenAPI/Operations/GetUserByName.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE ExplicitForAll #
# LANGUAGE MultiWayIf #
| Contains the different functions to run the operation getUserByName
| > GET /user/{username}
^ username: The name that needs to be fetched. Use user1 for testing.
| Represents a response of the operation 'getUserByName'.
Th... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module OpenAPI.Operations.GetUserByName where
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
import qualified Control.Monad.Fail
import qualified Cont... |
f4841068163c43a58e5ea40f65a5dc45fac53a05b80b7220489dfdc4eec143a6 | tfausak/exercism-solutions | Grains.hs | module Grains
( square
, total
) where
square :: Int -> Integer
square n = 2 ^ (n - 1)
total :: Integer
total = 2 ^ 64 - 1
| null | https://raw.githubusercontent.com/tfausak/exercism-solutions/5e6f93979cc61ef5e3b48a09ca316dfd7fcd319c/haskell/grains/Grains.hs | haskell | module Grains
( square
, total
) where
square :: Int -> Integer
square n = 2 ^ (n - 1)
total :: Integer
total = 2 ^ 64 - 1
| |
b221c822c10c0ca14199e6cf2c11bb09a4e51159c15021f38063889249d5f286 | PaulGustafson/stringnet | TwoComplex.hs |
module TwoComplex where
import Data.List
import Finite
import Tree
-- Left and right refer to positions before the braiding operation
data Puncture = LeftPuncture | RightPuncture
deriving (Show, Eq)
data InteriorVertex = Main | Midpoint Edge | Contraction Edge
deriving (Show, Eq)
data Vertex = Punc Puncture | ... | null | https://raw.githubusercontent.com/PaulGustafson/stringnet/10a256e198de40f4f54f3abbf67bab2a87083d6c/TwoComplex.hs | haskell | Left and right refer to positions before the braiding operation
initial edges
Orientations of initial edges are given by arrows in the figures in
the paper
initial edges
(e)-- > ( coev e ) --(e)-- > )
stick together parallel edges
don't use this constructor except to pattern match, use "rev"
instead
type cast
... |
module TwoComplex where
import Data.List
import Finite
import Tree
data Puncture = LeftPuncture | RightPuncture
deriving (Show, Eq)
data InteriorVertex = Main | Midpoint Edge | Contraction Edge
deriving (Show, Eq)
data Vertex = Punc Puncture | IV InteriorVertex
deriving (Show, Eq)
data InitialEdge = LeftLoo... |
6447ae1e29bdd0d876a636bd3547c32f3e00f878934c92f4214abb889e9ed783 | rd--/hsc3 | Edit.hs | -- | Nrt editing
module Sound.Sc3.Server.Nrt.Edit where
import Data.List {- base -}
import qualified Data.List.Ordered {- data-ordlist -}
import qualified Sound.Osc.Datum as Osc {- hosc -}
import qualified Sound.Osc.Packet as Osc {- hosc -}
import qualified Sound.Sc3.Common.Base {- hsc3 -}
import qualified Sound.Sc... | null | https://raw.githubusercontent.com/rd--/hsc3/7dc748106639999947548d0b3205a468cfc55fed/Sound/Sc3/Server/Nrt/Edit.hs | haskell | | Nrt editing
base
data-ordlist
hosc
hosc
hsc3
hsc3
hsc3
| The empty Nrt.
| bundleTime of last of nrt_bundles.
| Delete any internal nrt_end messages, and require one at the final bundle.
apply temporal and message functions to bundle | module Sound.Sc3.Server.Nrt.Edit where
| Merge two Nrt scores . Retains internal nrt_end messages .
nrt_merge :: Nrt -> Nrt -> Nrt
nrt_merge (Nrt p) (Nrt q) = Nrt (Data.List.Ordered.merge p q)
| Merge a set of Nrt . Retains internal ' nrt_end ' messages .
nrt_merge_set :: [Nrt] -> Nrt
nrt_merge_set = fold... |
804c913dd87dc33d21152f70f3cbab940529811aade095951fed626fef104500 | avik-das/garlic | let-list-matching.scm | ; A non-destructuring let binding. Nothing special about this one.
(let ((ls '(1 2 3)))
(display ls) (newline))
(newline)
; A series of singly-nested destructuring let bindings.
(let (((first) '(1)))
(display first) (newline))
(newline)
(let (((first . rest) '(1 2 3)))
(display first) (newline)
(display rest... | null | https://raw.githubusercontent.com/avik-das/garlic/5545f5a70f33c2ff9ec449ef66e6acc7881419dc/test/success/let-list-matching.scm | scheme | A non-destructuring let binding. Nothing special about this one.
A series of singly-nested destructuring let bindings.
The l-value here could be expressed as simply as (a b c), but the form used
here exercises l-values expressed with dotted lists | (let ((ls '(1 2 3)))
(display ls) (newline))
(newline)
(let (((first) '(1)))
(display first) (newline))
(newline)
(let (((first . rest) '(1 2 3)))
(display first) (newline)
(display rest) (newline))
(newline)
(let (((first second . rest) '(1 2 3)))
(display first) (newline)
(display second) (newline)
... |
15bdad93e261e76625ce44cdfa1f2e323018c9a68a29f37a87a98f701ff29db1 | janestreet/async_ssl | opt.mli | (** OpenSSL context options. *)
open! Core
* This mli currently only has SSL / TLS protocol version - related options , though it should
also support additions of any option that can be passed to SSL_CTX_set_options(3 ) and
) .
Best practice : Leave the " version " specified as [ Sslv23 ] ( see ve... | null | https://raw.githubusercontent.com/janestreet/async_ssl/2cc103c0648f5eec8717cd6b09b48bfff21cf3e9/src/opt.mli | ocaml | * OpenSSL context options. |
open! Core
* This mli currently only has SSL / TLS protocol version - related options , though it should
also support additions of any option that can be passed to SSL_CTX_set_options(3 ) and
) .
Best practice : Leave the " version " specified as [ Sslv23 ] ( see version.mli ) and use the
[ ... |
085f7252da2e25110674a1a9c76c9560a698ab94c460cffab141d6fe11f9bd45 | xclerc/ocamljava | macrogen_global.ml |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/compiler/javacomp/macrogen_global.ml | ocaml |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... | |
e2ce14a5721ada1cc7669dbb011f5e371c47cff0286fff7230fe0f211ef4eaf0 | michiakig/sicp | ex-4.35-int-btwn.scm | ;;;; Structure and Interpretation of Computer Programs
Chapter 4 Section 3 Variations on a Scheme - Nondeterministic
Computing
Exercise 4.35
(define (an-integer-between low high)
(require (not (> low high)))
(amb i (an-integer-between (+ 1 low) high)))
| null | https://raw.githubusercontent.com/michiakig/sicp/1aa445f00b7895dbfaa29cf6984b825b4e5af492/ch4/ex-4.35-int-btwn.scm | scheme | Structure and Interpretation of Computer Programs | Chapter 4 Section 3 Variations on a Scheme - Nondeterministic
Computing
Exercise 4.35
(define (an-integer-between low high)
(require (not (> low high)))
(amb i (an-integer-between (+ 1 low) high)))
|
02c711fd8698ebe1bc8c25e8587e6f0494a92b668180ceea324cda66b02d0f6a | phantomics/seed | extension.lisp | ;;;; extension.lisp
(in-package #:seed.ui-model.react)
(export 'interface-units)
| null | https://raw.githubusercontent.com/phantomics/seed/f128969c671c078543574395d6b23a1a5f2723f8/seed.ui-spec.unit.base/extension.lisp | lisp | extension.lisp |
(in-package #:seed.ui-model.react)
(export 'interface-units)
|
7b676058d6749b256ac4801df905aea3bc1f16a0d287223d1d3610524eca4720 | BrunoBonacci/mulog | kinesis.clj | (ns com.brunobonacci.mulog.publishers.kinesis
(:require [com.brunobonacci.mulog.buffer :as rb]
[com.brunobonacci.mulog.utils :as ut]
[com.brunobonacci.mulog.flakes :as f]
[com.brunobonacci.mulog.publisher :as p]
[com.brunobonacci.mulog.common.json :as json]
... | null | https://raw.githubusercontent.com/BrunoBonacci/mulog/e31f84ccf6d62d43c1c620ef5584722886e0d8a5/mulog-kinesis/src/com/brunobonacci/mulog/publishers/kinesis.clj | clojure | -records.html
its absence we generate a snowflake to ensure
a uniform random distribution across partitions
;;
----==| K I N E S I S |==---- ;;
... | (ns com.brunobonacci.mulog.publishers.kinesis
(:require [com.brunobonacci.mulog.buffer :as rb]
[com.brunobonacci.mulog.utils :as ut]
[com.brunobonacci.mulog.flakes :as f]
[com.brunobonacci.mulog.publisher :as p]
[com.brunobonacci.mulog.common.json :as json]
... |
3768c052e12be93508374d698399b4f68025fddb980f07c7667bdd952b8eafe0 | plumatic/plumbing | graph_perf_test.clj | (ns plumbing.graph-perf-test
"Simple performance test based on example graph from Climate."
(:use
[plumbing.core :only [fnk]])
(:require
[plumbing.graph :as graph]))
(def ^:const kelvin 273.15)
(def ^:const days-in-year 365)
(defn to-kelvin
"Converts Celcius to Kelvin"
^double [^double temp]
(+ temp... | null | https://raw.githubusercontent.com/plumatic/plumbing/6d713472f7324344545aa93597cb2a137b3404b3/test/plumbing/graph_perf_test.clj | clojure | solar radiaion
Clear sky solar radiation
net short wave radiation
Simple profiling, comparing the various compilations to the let
implementation.
Interpreted eager
compiling
Eager called with map
compiling
compiling
Let with fn calls
no need to compile
Let
no need to compile | (ns plumbing.graph-perf-test
"Simple performance test based on example graph from Climate."
(:use
[plumbing.core :only [fnk]])
(:require
[plumbing.graph :as graph]))
(def ^:const kelvin 273.15)
(def ^:const days-in-year 365)
(defn to-kelvin
"Converts Celcius to Kelvin"
^double [^double temp]
(+ temp... |
e1d313cee0aab48498a29adb617d09138e986fb0029796bc418bd72d2994c92e | abrantesasf/sicp-abrantes-study-guide | exercise-1.4.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Structure and Interpretation of Computer Programs , 2 . ed . ; ; ; ; ;
Section 1.1 , Exercise 1.4 ; ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Student : ;... | null | https://raw.githubusercontent.com/abrantesasf/sicp-abrantes-study-guide/c8d41093ed3d9944f003e88b7e1b7b29fbb6874a/1/1.1/sicp/exercise-1.4.scm | scheme |
; ; ; ;
; ; ; ;
; ; ; ;
; ; ; ;
Observe that our model of evaluation allows for combinations
whose operators are compound expressions. Use this observation to
describe the behavior of the following procedure:
The procedure is the sum of "a" with the absolute value of "b". The
absolute value is "emulated" b... |
(define (a-plus-abs-b a b)
((if (> b 0) + -) a b))
|
09ee49330f682a50f38b0055cc387842f62ee1c9fbe1cdb7e4f652c2ef2f16b3 | dparis/gen-phzr | tween_manager.cljs | (ns phzr.tween-manager
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser])
(:refer-clojure :exclude [remove update]))
(defn ->TweenManager
"Phaser.Game has a single instance of the TweenManager through which all Tween objects are cr... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/tween_manager.cljs | clojure | (ns phzr.tween-manager
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser])
(:refer-clojure :exclude [remove update]))
(defn ->TweenManager
"Phaser.Game has a single instance of the TweenManager through which all Tween objects are cr... | |
f9121684b25504dd52a4b644775a1ec972fd52f5a2ff2c5f4b004ef7c2abc099 | Beluga-lang/Beluga | misc.ml | (** Totally miscellaneous functions. *)
include Equality
(** Runs a function ignoring all exceptions.
In general this is a terrible idea, but it is sometimes necessary
when performing cleanup that may fail while in an exception
handler.
*)
let noexcept f = try f () with _ -> ()
(** An exception to be ra... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/4d1c1bd917daac43c304c527b155c12dba76391a/src/support/misc.ml | ocaml | * Totally miscellaneous functions.
* Runs a function ignoring all exceptions.
In general this is a terrible idea, but it is sometimes necessary
when performing cleanup that may fail while in an exception
handler.
* An exception to be raised in unimplemented features.
* Code that raises this exception sh... |
include Equality
let noexcept f = try f () with _ -> ()
exception NotImplemented of string
let not_implemented (msg : string) : 'a = raise (NotImplemented msg)
let rec enumerate_with_state (s : 's) (f : 's -> ('s * 'i)) (l : 'a list) : 's * ('i * 'a) list =
match l with
| [] -> (s, [])
| (x :: xs) ->
le... |
8ae133e81434de8bbe7654c7a5b40e3249d12f97fab1c3813bf8eb8a2ab68c17 | Opetushallitus/ataru | fx.cljs | (ns ataru.application-common.fx
(:require [ajax.core :as ajax]
[re-frame.core :as re-frame]
[reagent.core :as reagent]
[cljs.core.async :as async]
[ataru.hakija.has-applied :refer [has-applied]]
[ataru.hakija.application-validators :as validator]
... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/src/cljs/ataru/application_common/fx.cljs | clojure | cljs-ajax calls this handler with nil | (ns ataru.application-common.fx
(:require [ajax.core :as ajax]
[re-frame.core :as re-frame]
[reagent.core :as reagent]
[cljs.core.async :as async]
[ataru.hakija.has-applied :refer [has-applied]]
[ataru.hakija.application-validators :as validator]
... |
76ec35f063124091ca3f2179620ae2f1c4c590158b0762736c9ed2b3bede0cbc | jaspervdj/tweetov | Html.hs | -- | Produce HTML from Twitter data structures.
--
{-# LANGUAGE OverloadedStrings #-}
module Tweetov.Twitter.Html
( viewTweet
) where
import Data.List (intersperse)
import Data.Monoid (mconcat, mappend, mempty)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Blaze.Html
import Text.Blaze.Ht... | null | https://raw.githubusercontent.com/jaspervdj/tweetov/b310da0844ed9bfe8696ffba6f70ea0194dd6144/src/Tweetov/Twitter/Html.hs | haskell | | Produce HTML from Twitter data structures.
# LANGUAGE OverloadedStrings #
| Produce a link (if necessary) from a word.
Empty word (should not happen)
@reply
Link
Regular word
| Produce a pretty HTML tweet
| module Tweetov.Twitter.Html
( viewTweet
) where
import Data.List (intersperse)
import Data.Monoid (mconcat, mappend, mempty)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Blaze.Html
import Text.Blaze.Html5 (a)
import Text.Blaze.Html5.Attributes (href)
import Tweetov.Twitter (Tweet, twee... |
d6b7fc2fdb836357096208901f4559bcd1e7c4df1ec60c686a1e0bd5a97b1130 | imvu/dtm-redis | key_meta.erl | Copyright ( C ) 2011 - 2013 IMVU Inc.
%%
%% 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, copy, modify, merge, publ... | null | https://raw.githubusercontent.com/imvu/dtm-redis/719bca5903ed513d28be3b5e1a210b3e18dcc309/apps/dtm_redis/src/key_meta.erl | erlang |
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
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
so, subject to the following conditions:
The above copyright notice and this ... | Copyright ( C ) 2011 - 2013 IMVU Inc.
the Software without restriction , including without limitation the rights to
of the Software , and to permit persons to whom the Software is furnished to do
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND... |
28d35da079ed129ae78914ec355768eba030429e5371213a2e927e9ed98d3bdb | nmichel/ejpet | ejpet_jsone_generators.erl | -module(ejpet_jsone_generators).
-author('').
-export([generate_matcher/3]).
%% ---- Capture
generate_matcher({capture, Pattern, Mode}, Options, CB) -> %% Mode is Name
Matcher = CB(Pattern, Options, CB),
fun(JSON, Params) ->
case Matcher(JSON, Params) of
{true, Captures} ->
... | null | https://raw.githubusercontent.com/nmichel/ejpet/f2cafee31582d1e538cd3623edf249d0d3fc1162/src/ejpet_jsone_generators.erl | erlang | ---- Capture
Mode is Name
---- Injection
---- Object
---- List
jsx special form for empty object
jsx form for non empty object
jsx special form for empty object
jsx special form for non empty object
cannot match anything in an empty list
----- Iterable
jsone represents both list and object as erlang lists... | -module(ejpet_jsone_generators).
-author('').
-export([generate_matcher/3]).
Matcher = CB(Pattern, Options, CB),
fun(JSON, Params) ->
case Matcher(JSON, Params) of
{true, Captures} ->
{true, add_captures(Captures, Mode, [JSON])};
R ->
... |
57e4e889a0e9984f6fd7d0dadcb7c49826d1e575d8ba55310a5d02f68a5bf6b5 | talex5/wayland-proxy-virtwl | types.ml | type window = [`Window] Xid.t
type atom = [`Atom] Xid.t
type font = [`Font] Xid.t
type cursor = [`Cursor] Xid.t
type visual = [`Visual] Xid.t
type timestamp = int32
type reply = [
| `Reply of Cstruct.t
| `Error of Cstruct.t
| `No_reply
]
type display = {
socket : Lwt_unix.file_descr;
from_server : Lwt_io.i... | null | https://raw.githubusercontent.com/talex5/wayland-proxy-virtwl/0316db2f1ee1a6bcdf7328bc4d4b8de41506ec54/x11/types.ml | ocaml | Reverse of resolved [atoms]
Note: we create a fixed number and assume we won't run out
Expected sequence number and resolver
Send a sync before blocking
Fires when the event loop might need to send a sync
Only one thread can send at a time | type window = [`Window] Xid.t
type atom = [`Atom] Xid.t
type font = [`Font] Xid.t
type cursor = [`Cursor] Xid.t
type visual = [`Visual] Xid.t
type timestamp = int32
type reply = [
| `Reply of Cstruct.t
| `Error of Cstruct.t
| `No_reply
]
type display = {
socket : Lwt_unix.file_descr;
from_server : Lwt_io.i... |
dd2aef3e088cbc9934121fada3ecda6ed0a16aa577fac078b487a69bedbcf754 | gfngfn/SATySFi | parser_test.ml | open Core
open Main__
let () =
let trd3 (_, _, z) = z in
Out_channel.print_endline ";;; generated automatically. DO NOT EDIT";
Out_channel.print_endline ";;; To update this file, you should run `dune runtest; dune promote`.";
let argv = Sys.get_argv () in
argv
|> Array.to_list
|> List.tl
|> Option.valu... | null | https://raw.githubusercontent.com/gfngfn/SATySFi/44c5053495383f0c4ae6b900f966fdf469841f85/test/parsing/parser_test.ml | ocaml | open Core
open Main__
let () =
let trd3 (_, _, z) = z in
Out_channel.print_endline ";;; generated automatically. DO NOT EDIT";
Out_channel.print_endline ";;; To update this file, you should run `dune runtest; dune promote`.";
let argv = Sys.get_argv () in
argv
|> Array.to_list
|> List.tl
|> Option.valu... | |
748c0ff1a80201740b9c3f881485980ab342f91427f6c48e85816a7e7921988f | mariari/vomitchan | Main.hs | # LANGUAGE ScopedTypeVariables #
module Main where
--- IMPORTS -----------------------------------------------------------------------------------
import qualified Control.Concurrent as C
import qualified StmContainers.Map as M
import qualified StmContainers.Set as S
import qualified Data.List as L
impor... | null | https://raw.githubusercontent.com/mariari/vomitchan/3ffde0a983d6545158c1562bd53362d9d0149831/app/Main.hs | haskell | - IMPORTS -----------------------------------------------------------------------------------
- FUNCTIONS ---------------------------------------------------------------------------------
listed threads when finished
Int is the identifier for the current process
peacefully quit from the network!
filter out the curr... | # LANGUAGE ScopedTypeVariables #
module Main where
import qualified Control.Concurrent as C
import qualified StmContainers.Map as M
import qualified StmContainers.Set as S
import qualified Data.List as L
import qualified Data.Text as T
import qualified Data.Hashable as Hashable
import qua... |
40cd4246b7ad5f6c4a99125de73533a40f6770b9c6b4e17ba885e8a966588d29 | glguy/advent | Chinese.hs | # Language UnboxedTuples #
|
Module : Advent . Chinese
Description : Chinese - remainder theorem
Copyright : 2021 , 2011 , 2016 - 2017 , Carter Schonwald , Google Inc.
License : ISC
Maintainer :
< >
Module : Advent.Chinese
Description : Chinese-remainder theorem
Copyright ... | null | https://raw.githubusercontent.com/glguy/advent/b9b3ee3a64e6dfd4171abe8331942e95d69f4632/common/src/Advent/Chinese.hs | haskell | | A package of a residue and modulus. To 'toMod' when constructing
to ensure the reduced invariant is maintained.
| Construct an element of 'Mod' with a given value and modulus.
^ integer
^ modulus
^ residue mod modulus
needs to be `mod` to handle negative values
| Find an integer that is equal to all the gi... | # Language UnboxedTuples #
|
Module : Advent . Chinese
Description : Chinese - remainder theorem
Copyright : 2021 , 2011 , 2016 - 2017 , Carter Schonwald , Google Inc.
License : ISC
Maintainer :
< >
Module : Advent.Chinese
Description : Chinese-remainder theorem
Copyright ... |
c7bea683dc0f1d4c9e9576d07eb84d0704817c6fd414d09fb2f0193853eae67b | metabase/metabase | revision.clj | (ns metabase.events.revision
(:require
[clojure.core.async :as a]
[metabase.events :as events]
[metabase.models.card :refer [Card]]
[metabase.models.dashboard :refer [Dashboard]]
[metabase.models.metric :refer [Metric]]
[metabase.models.revision :refer [push-revision!]]
[metabase.models.segment :... | null | https://raw.githubusercontent.com/metabase/metabase/dad3d414e5bec482c15d826dcc97772412c98652/src/metabase/events/revision.clj | clojure | ## ---------------------------------------- EVENT PROCESSING ----------------------------------------
try/catch here to prevent individual topic processing exceptions from bubbling up. better to handle them here.
TODO: seems unnecessary to select each entity again, is there a reason we aren't using `object` directl... | (ns metabase.events.revision
(:require
[clojure.core.async :as a]
[metabase.events :as events]
[metabase.models.card :refer [Card]]
[metabase.models.dashboard :refer [Dashboard]]
[metabase.models.metric :refer [Metric]]
[metabase.models.revision :refer [push-revision!]]
[metabase.models.segment :... |
f86dc0ae830eb5ddf1ee7e11a4e9a5efa8c5d77dd593419413ba2480b0eec2c8 | 8c6794b6/guile-tjit | networking.scm | ;;; installed-scm-file
Copyright ( C ) 1999 , 2005 , 2006 , 2010 Free Software Foundation , 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 3 of the ... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/ice-9/networking.scm | scheme | installed-scm-file
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PA... |
Copyright ( C ) 1999 , 2005 , 2006 , 2010 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(eval-when (compile)
(set-cu... |
71d99c37677f39bb68094f15be3a93256b46bede901dfaadc3c4b3ddf74954c5 | patricoferris/ocaml-multicore-monorepo | eio_luv.mli | (** Eio backend using libuv.
You will normally not use this module directly.
Instead, use {!Eio_main.run} to start an event loop and then use the API in the {!Eio} module.
However, it is possible to use this module directly if you only want to support libuv. *)
open Eio.Std
module Low_level : sig
type... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/624b3293ee41e83736fe7ac3a79f810c2b70f68b/duniverse/eio/lib_eio_luv/eio_luv.mli | ocaml | * Eio backend using libuv.
You will normally not use this module directly.
Instead, use {!Eio_main.run} to start an event loop and then use the API in the {!Eio} module.
However, it is possible to use this module directly if you only want to support libuv.
* [or_raise (Error e)] raises [Luv_error e].
* ... |
open Eio.Std
module Low_level : sig
type 'a or_error = ('a, Luv.Error.t) result
exception Luv_error of Luv.Error.t
val or_raise : 'a or_error -> 'a
val await_with_cancel :
request:[< `File | `Addr_info | `Name_info | `Random | `Thread_pool ] Luv.Request.t ->
(Luv.Loop.t -> ('a -> unit) -> unit) -> ... |
0e1cb1c192c409e33f5c88b6f470b61befc3f6613eb4ffd2674f1984d4d8aea4 | clojure-finance/clojask | project.clj | (defproject com.github.clojure-finance/clojask "2.0.1"
:description "Data analysis and manipulation library with parallel computing for larger-than-memory datasets"
:url "-finance/clojask"
:license {:name "MIT"
:url "-finance/clojask/blob/1.x.x/LICENSE"}
:dependencies [[org.clojure/clojure "1.10.1"]... | null | https://raw.githubusercontent.com/clojure-finance/clojask/1cf122efb05370cacd5412f070cdf6890d9aa2e4/project.clj | clojure | :java-test-paths ["test/java"] | (defproject com.github.clojure-finance/clojask "2.0.1"
:description "Data analysis and manipulation library with parallel computing for larger-than-memory datasets"
:url "-finance/clojask"
:license {:name "MIT"
:url "-finance/clojask/blob/1.x.x/LICENSE"}
:dependencies [[org.clojure/clojure "1.10.1"]... |
d637782665939d4e480605543c29093dd752099be8ef33e9e613cf3f8d143648 | antifuchs/sbcl | assemfile.lisp | ;;;; the extra code necessary to feed an entire file of assembly code
;;;; to the assembler
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; p... | null | https://raw.githubusercontent.com/antifuchs/sbcl/789bf105edca031aff991ad16a5fd207812336a0/src/assembly/assemfile.lisp | lisp | the extra code necessary to feed an entire file of assembly code
to the assembler
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
a list of (NAME . LABEL) for every entry point
Set this to... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!C")
If non - NIL , emit assembly code . If NIL , emit VOP templates .
(defvar *emit-assembly-code-not-vop... |
039cdb6beacb349f7cf7391257115e346b1ed44aaad120ee318f4030720e40e5 | jonase/eastwood | red.clj | (ns testcases.let.red)
(defn faulty []
(let [a (if (seq? {})
1
2)]
a))
| null | https://raw.githubusercontent.com/jonase/eastwood/09d6e9600205c0090c9c9f01095da727ad9d26fb/cases/testcases/let/red.clj | clojure | (ns testcases.let.red)
(defn faulty []
(let [a (if (seq? {})
1
2)]
a))
| |
bcf377d69187947eb51e9bfadcf679153e1c80c88bf18577cdf55b70aa1aa461 | jimweirich/sicp-study | ex2_54.scm | SICP 2.54
Exercise 2.54 . Two lists are said to be equal ? if they contain
;; equal elements arranged in the same order. For example,
;; (equal? '(this is a list) '(this is a list))
;; is true, but
;; (equal? '(this is a list) '(this (is a) list))
;; is false. To be more precise, we can define equal? rec... | null | https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter2/ex2_54.scm | scheme | equal elements arranged in the same order. For example,
(equal? '(this is a list) '(this is a list))
is true, but
(equal? '(this is a list) '(this (is a) list))
is false. To be more precise, we can define equal? recursively in
terms of the basic eq? equality of symbols by saying that a and b
are equal? if th... | SICP 2.54
Exercise 2.54 . Two lists are said to be equal ? if they contain
(define (myequal? a b)
(cond ((and (symbol? a) (symbol? b))
(eq? a b))
((or (symbol? a) (symbol? b)) #f)
((null? a) (null? b))
((null? b) #f)
(else (and (myequal? (car a) (car b))
... |
b01eebdbb00102dc9250ea93b2fb1f96d6a982e0b41809058e469ecd12cb93ce | mokus0/junkbox | SubType.hs |
- ` ` SubType ''
- ( c ) 2009 , , Inc.
- ``SubType''
- (c) 2009 Cook, J. MR SSD, Inc.
-}
# LANGUAGE
TypeOperators ,
MultiParamTypeClasses ,
FlexibleInstances
#
TypeOperators,
MultiParamTypeClasses,
FlexibleInstances
#-}
module TypeExperiments.... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/TypeExperiments/SubType.hs | haskell |
- ` ` SubType ''
- ( c ) 2009 , , Inc.
- ``SubType''
- (c) 2009 Cook, J. MR SSD, Inc.
-}
# LANGUAGE
TypeOperators ,
MultiParamTypeClasses ,
FlexibleInstances
#
TypeOperators,
MultiParamTypeClasses,
FlexibleInstances
#-}
module TypeExperiments.... | |
67afbc6b67a023df95863a3cd7d4d06083b944f436c405636bcee25bd7c5c952 | ocaml/dune | scope.ml | open Import
open Memo.O
type t =
{ project : Dune_project.t
; db : Lib.DB.t
; coq_db : Coq_lib.DB.t Lazy.t
; root : Path.Build.t
}
let root t = t.root
let project t = t.project
let libs t = t.db
let coq_libs t = Lazy.force t.coq_db
module DB = struct
type scope = t
type t = { by_dir : scope Path.So... | null | https://raw.githubusercontent.com/ocaml/dune/b06584df02043e81a084f97a42504a76bf925a1f/src/dune_rules/scope.ml | ocaml | This function is linear in the depth of [dir] in the worst case, so if it
shows up in the profile we should memoize it.
Create a database from the public libraries defined in the stanzas
Skip hidden or unavailable libraries. TODO we should assert
that the library name is always found some... | open Import
open Memo.O
type t =
{ project : Dune_project.t
; db : Lib.DB.t
; coq_db : Coq_lib.DB.t Lazy.t
; root : Path.Build.t
}
let root t = t.root
let project t = t.project
let libs t = t.db
let coq_libs t = Lazy.force t.coq_db
module DB = struct
type scope = t
type t = { by_dir : scope Path.So... |
9cf8090865fbc38ac439e286a72a7682548069f708dbc734afb1041683114654 | rollacaster/sketches | P_1_2_3_01.cljs | (ns sketches.generative-desgin.P-01.P-1-2-3-01
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]))
(def tile-count-x 50)
(def tile-count-y 10)
(defn color-parts [h s b]
{:hueValues (into [] (for [_ (range 0 tile-count-x)] (h)))
:saturationValues (into [] (for [_ (range 0 til... | null | https://raw.githubusercontent.com/rollacaster/sketches/ba79fccf2a37139de9193ed2ea7a6cc04b63fad0/src/sketches/generative_desgin/P_01/P_1_2_3_01.cljs | clojure | (ns sketches.generative-desgin.P-01.P-1-2-3-01
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]))
(def tile-count-x 50)
(def tile-count-y 10)
(defn color-parts [h s b]
{:hueValues (into [] (for [_ (range 0 tile-count-x)] (h)))
:saturationValues (into [] (for [_ (range 0 til... | |
a32760d851fa25de038ca9cb3faa3e36ad59dcbaf7b639209ab626c5fd90db0d | janestreet/ecaml | var.ml | open! Core
open! Import0
include Var_intf
module Buffer = Buffer0
type 'a t =
{ symbol : Symbol.t
; type_ : 'a Value.Type.t
}
[@@deriving fields]
let sexp_of_t _ { symbol; type_ } =
[%message "" ~_:(symbol : Symbol.t) ~_:(type_ : _ Value.Type.t)]
;;
type 'a var = 'a t [@@deriving sexp_of]
let create symbol ... | null | https://raw.githubusercontent.com/janestreet/ecaml/7c16e5720ee1da04e0757cf185a074debf9088df/src/var.ml | ocaml | open! Core
open! Import0
include Var_intf
module Buffer = Buffer0
type 'a t =
{ symbol : Symbol.t
; type_ : 'a Value.Type.t
}
[@@deriving fields]
let sexp_of_t _ { symbol; type_ } =
[%message "" ~_:(symbol : Symbol.t) ~_:(type_ : _ Value.Type.t)]
;;
type 'a var = 'a t [@@deriving sexp_of]
let create symbol ... | |
15a275b15eda0c289d3f91a6604e51f978c5835adf3b296a1d0322d61f0e75f5 | valpackett/sweetroll | Request.hs | # LANGUAGE NoImplicitPrelude , OverloadedStrings , UnicodeSyntax #
module Sweetroll.Microsub.Request where
import Sweetroll.Prelude
import Web.FormUrlEncoded
type ChanName = Text
type ChanId = Text
type ObjId = Text
type FeedUrl = Text
data MicrosubRequest = MarkRead ChanId ObjId
... | null | https://raw.githubusercontent.com/valpackett/sweetroll/f91501da72fd5bb40743b21b66a9da791f5991a2/sweetroll-be/library/Sweetroll/Microsub/Request.hs | haskell | # LANGUAGE NoImplicitPrelude , OverloadedStrings , UnicodeSyntax #
module Sweetroll.Microsub.Request where
import Sweetroll.Prelude
import Web.FormUrlEncoded
type ChanName = Text
type ChanId = Text
type ObjId = Text
type FeedUrl = Text
data MicrosubRequest = MarkRead ChanId ObjId
... | |
ff95c4445cb5ca923dbe61ed7235274594cd45327766da7d9e9105771102d292 | aryx/lfs | type_logic.ml | open Common
open Common_logic
open Typetype
logic of type
int - > string - > ( x * y ) ( exact )
int * string - > bool ( can have diff between curry and tupling )
? x , ! y ,
% x (= ~ ? | ! ) , ls % bool , % ' a list , % string , % char , % graph , ( verra bien les... | null | https://raw.githubusercontent.com/aryx/lfs/b931530c7132b77dfaf3c99d452dc044fce37589/p_logic/type_logic.ml | ocaml | TODO inversion? with contravariance
not handled, possibly cos contain formula
raise Impossible | open Common
open Common_logic
open Typetype
logic of type
int - > string - > ( x * y ) ( exact )
int * string - > bool ( can have diff between curry and tupling )
? x , ! y ,
% x (= ~ ? | ! ) , ls % bool , % ' a list , % string , % char , % graph , ( verra bien les... |
e666af95b876e796220271f8d413d073f794e5850cff10da515e75602e69b988 | jwarlander/everex | test_membuffer.erl | %%
Licensed to the Apache Software Foundation ( ASF ) under one
%% or more contributor license agreements. See the NOTICE file
%% distributed with this work for additional information
%% regarding copyright ownership. The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
%% "License"); you ... | null | https://raw.githubusercontent.com/jwarlander/everex/559a18e45054abd7d2adfeb3ef060f79b58308e9/test/thrift/test_membuffer.erl | erlang |
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-2.0
Unless require... | Licensed to the Apache Software Foundation ( ASF ) under one
to you under the Apache License , Version 2.0 ( the
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(test_membuffer).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").... |
7f342e866d07d26d79d7461638b56c090b466d5fe5b9f7cca8204d06e82144b6 | ygrek/mldonkey | commonTypes.ml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 ; either version 2 of the License , or
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/daemon/common/commonTypes.ml | ocaml | This should be used for temp. files, because for some
systems the character ":" may be illegal for filenames.
| "aich" -> ???
exact length
acceptable source
manifest topic: url or urn, see -Specsv22.txt
keywords topic
extensions
| _ when v = "" ->
(* This is an error in the magnet, where a & ... | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 ; either version 2 of the License , or
... |
a911461c67b48cba4d933a35ac7e9bd9106d19e46bec0762b81ab3de1e0eb10b | dktr0/estuary | EnsembleC.hs | {-# LANGUAGE OverloadedStrings #-}
The type represents the state of an Ensemble from the perspective
of an Estuary client .
module Estuary.Types.EnsembleC where
import Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import Data.Time
import Data.Time.Clock.POSIX
import Data.Maybe
import Data... | null | https://raw.githubusercontent.com/dktr0/estuary/6d46fff1b34b05772bc2a1fcd2e87dcd88a8e7ae/client/src/Estuary/Types/EnsembleC.hs | haskell | # LANGUAGE OverloadedStrings #
how the user is logged in/appears to others in the ensemble; "" = anonymous
the user's location in the ensemble (cached for re-authentication scenarios)
the participant password for the ensemble (cached for re-authentication scenarios)
Rights are from preset views, Lefts are local vie... |
The type represents the state of an Ensemble from the perspective
of an Estuary client .
module Estuary.Types.EnsembleC where
import Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import Data.Time
import Data.Time.Clock.POSIX
import Data.Maybe
import Data.Text (Text)
import qualified Data.... |
4ee7f5ea4e3bee2216e25bdc6eaec5540e24ef60080e4c8d7d8ca681be6a4a2a | elaforge/karya | Play.hs | Copyright 2018
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
# LANGUAGE CPP #
| Convert solkattu to audio via karya score , and play it .
module Solkattu.Play (
play_m
#ifdef TESTING
, module Solkattu.Play
#endif
) where
import qualified ... | null | https://raw.githubusercontent.com/elaforge/karya/a6638f16da9f018686023977c1292d6ce5095e28/Solkattu/Play.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Play mridangam realization for the korvai.
I think this shouldn't happen?
| Derive the Ui.State and write the im parts to disk.
* to_state
Leave the warnings for the realize call.
, "%just-base = (hz (<-... | Copyright 2018
# LANGUAGE CPP #
| Convert solkattu to audio via karya score , and play it .
module Solkattu.Play (
play_m
#ifdef TESTING
, module Solkattu.Play
#endif
) where
import qualified Control.Concurrent.Async as Async
import qualified Control.Concurrent.MVar as MVar
import qualified Data.Map as M... |
dd7fd7b97fb6d0b67e0d2ac8e02eb42e25de7f61a06d9d80425c7db535858595 | openworkload/swm-core | wm_core.erl | -module(wm_core).
-behaviour(gen_server).
-export([start_link/1, get_parent/0, start_slave/3, has_malfunction/1, allocate_port/0, get_my_gateway_address/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("../../lib/wm_entity.hrl").
-include("../../lib/wm_log.hrl... | null | https://raw.githubusercontent.com/openworkload/swm-core/250facc707739010715cd9f1605b0dda817ab05c/src/srv/core/wm_core.erl | erlang | map: service_id --> supervisor_pid
map: {host, port} --> milliseconds
parents stack
============================================================================
API
============================================================================
@doc Start core service
@doc Get current parent node full name
@doc S... | -module(wm_core).
-behaviour(gen_server).
-export([start_link/1, get_parent/0, start_slave/3, has_malfunction/1, allocate_port/0, get_my_gateway_address/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("../../lib/wm_entity.hrl").
-include("../../lib/wm_log.hrl... |
a2b6f163cc4f6eb7e5909a14b21300181fa4012bdda348f46f0f6c752d2d1e0f | gowthamk/ocaml-irmin | test_merge2.ml | original = | |
q1 =
q2 = |5||6|
q1 = |5|
q2 = |5||6| *)
module U = struct
let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]"
let print_header h = Printf.printf "%s" ("\n" ^ h ^ "\n")
end
(* Queue *)
let _ =
U.print_header "Heap2";
let module Atom = stru... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/heap_leftist/mem/test_merge2.ml | ocaml | Queue | original = | |
q1 =
q2 = |5||6|
q1 = |5|
q2 = |5||6| *)
module U = struct
let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]"
let print_header h = Printf.printf "%s" ("\n" ^ h ^ "\n")
end
let _ =
U.print_header "Heap2";
let module Atom = struct
type t ... |
72cdb35224e4476ea3b93fb4781f34b7e9744763766a872ea4bc1218d486b03e | ix/lazyboy | Spec.hs | |
Module : Main ( Test )
Description : Test suite for Lazyboy
Copyright : ( c ) Rose 2019
License : BSD3
Maintainer :
Stability : experimental
Portability : POSIX
A test suite for Lazyboy .
Module : Main (Test)
Description : Test suite ... | null | https://raw.githubusercontent.com/ix/lazyboy/83838f5e36906fe0262e9d53e6e692796f214e6b/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings #
these fail | |
Module : Main ( Test )
Description : Test suite for Lazyboy
Copyright : ( c ) Rose 2019
License : BSD3
Maintainer :
Stability : experimental
Portability : POSIX
A test suite for Lazyboy .
Module : Main (Test)
Description : Test suite ... |
6ea896929a36a1cbca3cea64eab771d23a9ca37437c3a3d4b4b22d3c2a0e3633 | BranchTaken/Hemlock | test_reduce.ml | open! Basis.Rudiments
open! Basis
open Ordset
let test () =
let test ms = begin
let ordset = of_list (module Uns) ms in
let sum = reduce ~f:( + ) ordset in
File.Fmt.stdout
|> Fmt.fmt "reduce ~f:( + ) "
|> (List.pp Uns.pp) ms
|> Fmt.fmt " -> "
|> (Option.fmt Uns.pp) sum
|> Fmt.fmt "\n"... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a21b462fe7f70475591d2ffae185c91552bf6372/bootstrap/test/basis/ordset/test_reduce.ml | ocaml | open! Basis.Rudiments
open! Basis
open Ordset
let test () =
let test ms = begin
let ordset = of_list (module Uns) ms in
let sum = reduce ~f:( + ) ordset in
File.Fmt.stdout
|> Fmt.fmt "reduce ~f:( + ) "
|> (List.pp Uns.pp) ms
|> Fmt.fmt " -> "
|> (Option.fmt Uns.pp) sum
|> Fmt.fmt "\n"... | |
7922cb86d8552fcff53d79957d9ce311fa38bbc7566e135b3357b18bfafee50d | andersfugmann/amqp-client | async_link.ml | open Async
open Amqp_client_async
let host = "localhost"
let run () =
Amqp.Connection.connect ~id:"MyConnection" host >>= fun connection ->
Amqp.Connection.open_channel ~id:"MyChannel" Amqp.Channel.no_confirm connection >>= fun channel ->
Amqp.Queue.declare channel "MyQueue" >>= fun queue ->
Amqp.Queue.publis... | null | https://raw.githubusercontent.com/andersfugmann/amqp-client/e6e92225b91742fa8777a02ad9b59a1dde45e752/link/async_link.ml | ocaml | open Async
open Amqp_client_async
let host = "localhost"
let run () =
Amqp.Connection.connect ~id:"MyConnection" host >>= fun connection ->
Amqp.Connection.open_channel ~id:"MyChannel" Amqp.Channel.no_confirm connection >>= fun channel ->
Amqp.Queue.declare channel "MyQueue" >>= fun queue ->
Amqp.Queue.publis... | |
6f51889a93bdc5a7f0ac0de23f1e604e0b354c12a965135b5d642af749bc3807 | zack-bitcoin/amoveo-exchange | amoveo_exchange_sup.erl | -module(amoveo_exchange_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1, stop/0]).
-define(SERVER, ?MODULE).
-define(keys, [accounts, trades, trade_limit, message_limit]).
child_killer([]) -> [];
child_killer([H|T]) ->
supervisor:terminate_child(?MODULE, H),
child_killer(T).
stop() -> ch... | null | https://raw.githubusercontent.com/zack-bitcoin/amoveo-exchange/df6b59c139b710faf79e851bdf7e861983511cbe/apps/amoveo_exchange/src/amoveo_exchange_sup.erl | erlang | -module(amoveo_exchange_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1, stop/0]).
-define(SERVER, ?MODULE).
-define(keys, [accounts, trades, trade_limit, message_limit]).
child_killer([]) -> [];
child_killer([H|T]) ->
supervisor:terminate_child(?MODULE, H),
child_killer(T).
stop() -> ch... | |
ec219d9e61da7a183cb2581f091b00c042f5b7039c2831ccac7016cfd199eb02 | ldgrp/uptop | MoneyObject.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
module Up.Model.MoneyObject where
import Data.Aeson
import Data.Aeson.Casing (aesonPrefix, camelCase)
import Data.Int
import qualified Data.Text as T
import GHC.Generics
data MoneyObject = MoneyObject
| The ISO 4217 currency code .
moCurrencyCode ::... | null | https://raw.githubusercontent.com/ldgrp/uptop/53001b39793df4be48c9c3aed9454be0fc178434/up-bank-api/src/Up/Model/MoneyObject.hs | haskell | # LANGUAGE OverloadedStrings #
| The amount of money, formatted as a string in the relevant currency. | # LANGUAGE DeriveGeneric #
module Up.Model.MoneyObject where
import Data.Aeson
import Data.Aeson.Casing (aesonPrefix, camelCase)
import Data.Int
import qualified Data.Text as T
import GHC.Generics
data MoneyObject = MoneyObject
| The ISO 4217 currency code .
moCurrencyCode :: T.Text,
moValue :: T.Text,
|... |
4badc8072fd847b45f9fd0966f23e418f5bd7c2ae20742c99e08ba4fddf221ad | nobrakal/asak | build_assoc.ml | let read threshold x =
let open Asak.Lambda_hash in
let prefix =
try
let start =
try String.rindex x '/' + 1
with Not_found -> 0 in
String.sub x start (String.length x - start)
with
| Not_found -> "" in
let chan = open_in x in
let lambdas : (string * Lambda.lambda) list ... | null | https://raw.githubusercontent.com/nobrakal/asak/c1aaf985815563edd2463f8fe18e2d790f955f05/utils/build_assoc.ml | ocaml | Very ugly | let read threshold x =
let open Asak.Lambda_hash in
let prefix =
try
let start =
try String.rindex x '/' + 1
with Not_found -> 0 in
String.sub x start (String.length x - start)
with
| Not_found -> "" in
let chan = open_in x in
let lambdas : (string * Lambda.lambda) list ... |
a8df49f16cda14c1435cb9b369190ef03602e2dcb150213fe7f9fe90c6381c7f | vraid/earthgen | earthgen.rkt | #lang racket
(require racket/flonum
"planet-display.rkt"
"planet/planet-generation.rkt"
"planet/grid/grid-create.rkt"
"planet/planet.rkt"
"terrain-gen.rkt"
"terrain-dsl.rkt")
(define (algorithms)
(load-algorithms (file->algorithm grids) "terrain-generation"))
(... | null | https://raw.githubusercontent.com/vraid/earthgen/208ac834c02208ddc16a31aa9e7ff7f91c18e046/earthgen.rkt | racket | #lang racket
(require racket/flonum
"planet-display.rkt"
"planet/planet-generation.rkt"
"planet/grid/grid-create.rkt"
"planet/planet.rkt"
"terrain-gen.rkt"
"terrain-dsl.rkt")
(define (algorithms)
(load-algorithms (file->algorithm grids) "terrain-generation"))
(... | |
5c894a6909c513db9c94d8b6965d4de7d88c5ec45f3d1e497a4c3611db850f3b | satori-com/mzbench | mzb_bc.erl | -module(mzb_bc).
Backward compatibility module which implements functions required to run on Erlang 17.0
-export([
maps_with/2,
maps_without/2,
maps_get/3
]).
-spec maps_get(Key, Map, Default) -> Value | Default when
Key :: term(),
Map :: map(),
Value :: term(),
Default :... | null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/common_apps/mzbench_utils/src/mzb_bc.erl | erlang | -module(mzb_bc).
Backward compatibility module which implements functions required to run on Erlang 17.0
-export([
maps_with/2,
maps_without/2,
maps_get/3
]).
-spec maps_get(Key, Map, Default) -> Value | Default when
Key :: term(),
Map :: map(),
Value :: term(),
Default :... | |
ee86bce31e3130821cd7db1c2fc806305b52453f389fe2777cbf1afd25cc4471 | jcmincke/Blast | Types.hs |
Copyright : ( c ) , 2016 - 2017
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright : (c) Jean-Christophe Mincke, 2016-2017
This Source Code Form is subject to the terms o... | null | https://raw.githubusercontent.com/jcmincke/Blast/30a15c039856f78ebc15a4d3de8c9a5e1cb7efd7/src/Control/Distributed/Blast/Types.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
import Debug.Trace
set of parents, that is, nodes that reference this node
$(Lens.makeLenses ''GenericInfo)
| Generic type describing a computation.
| A computation that evaluates as a local value.
| A computation... |
Copyright : ( c ) , 2016 - 2017
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright : (c) Jean-Christophe Mincke, 2016-2017
This Source Code Form is subject to the terms o... |
fa10d476a0409aa68fc223e8886368bd64b829bd285177a682d230ec825bcdf2 | theodormoroianu/SecondYearCourses | HaskellChurch_20210415163538.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163538.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = "cBool " <> show (cIf b True False)
The boolean constant true always chooses the first alternativ... |
133d006bf363e40333be3f0391ef9f41a1d8cea249cc0090f85e3111378de7d3 | DataHaskell/dh-core | InformationTheory.hs | module Core.Numeric.Statistics.InformationTheory where
import Core.Data.Dataset
-- | Differential entropy has a singularity at 0 but converges slowly to 0 for small positive values.
entropyR :: (Foldable t, Ord h, Floating h) => Dataset k (t a) -> h
entropyR = entropyR_ . probClasses
entropyR_ :: (Foldable t, Functo... | null | https://raw.githubusercontent.com/DataHaskell/dh-core/2beb8740f27fa9683db70eb8d8424ee6c75d3e91/dh-core/src/Core/Numeric/Statistics/InformationTheory.hs | haskell | | Differential entropy has a singularity at 0 but converges slowly to 0 for small positive values.
| Gini index (expected error rate) | module Core.Numeric.Statistics.InformationTheory where
import Core.Data.Dataset
entropyR :: (Foldable t, Ord h, Floating h) => Dataset k (t a) -> h
entropyR = entropyR_ . probClasses
entropyR_ :: (Foldable t, Functor t, Ord c, Floating c) => t c -> c
entropyR_ ps = negate . sum $ entropyReg <$> ps where
entropyReg... |
5ef97bc6c87374cd7ecba44eba8dca16167778b6496e03f4f0a791144bd4d890 | alt-romes/ghengin | Input.hs | # LANGUAGE OverloadedRecordDot #
module Ghengin.Input
( GLFW.Key(..)
, ifPressed
, ifReleased
, getKey
) where
import Control.Monad.IO.Class
import Control.Monad.Reader
import qualified Graphics.UI.GLFW as GLFW
import Ghengin.Vulkan.GLFW.Window
import Ghengin.Vulkan
import Ghengin
ifPressed :: GLFW.Key
... | null | https://raw.githubusercontent.com/alt-romes/ghengin/a2305d781ed3548f94bee9f032f15564fae0936b/src/Ghengin/Input.hs | haskell | ^ Then
^ Else
^ Result
| If it is not being pressed currently
^ Then
^ Else
^ Result | # LANGUAGE OverloadedRecordDot #
module Ghengin.Input
( GLFW.Key(..)
, ifPressed
, ifReleased
, getKey
) where
import Control.Monad.IO.Class
import Control.Monad.Reader
import qualified Graphics.UI.GLFW as GLFW
import Ghengin.Vulkan.GLFW.Window
import Ghengin.Vulkan
import Ghengin
ifPressed :: GLFW.Key
ifPr... |
f2759f4fd00cf733bec56ba97333b7d48f2dc450157867b632d4722799eded1f | paroda/trade | util.clj | (ns bindi.util
(:require [clojure.data.csv :as csv]
[clojure.edn :as edn]
[clojure.java.io :as io])
(:import java.text.SimpleDateFormat
org.apache.commons.io.input.BOMInputStream
java.io.PushbackReader))
(defn round [v n]
(let [m (Math/pow 10.0 ^:Double n)]
(/ (M... | null | https://raw.githubusercontent.com/paroda/trade/c7d717ce04f506c821fedb2fd09c8c877ee5176a/src/bindi/util.clj | clojure |
file utility ;;;;
response util ;;;;
| (ns bindi.util
(:require [clojure.data.csv :as csv]
[clojure.edn :as edn]
[clojure.java.io :as io])
(:import java.text.SimpleDateFormat
org.apache.commons.io.input.BOMInputStream
java.io.PushbackReader))
(defn round [v n]
(let [m (Math/pow 10.0 ^:Double n)]
(/ (M... |
6651e80dae72ed607391c3c54a8a11f3868b3ee92d729c16c1b117c610ee102e | triffon/fp-2019-20 | matrix-tests.rkt | #lang racket
(require quickcheck
rackunit
rackunit/quickcheck)
(require (prefix-in solutions. "../solutions/matrix.rkt"))
(define (id x) x)
; didn't find an easier way to check if member returns true
bE CoErCeD To A GeNeRator
(define (elem x xs)
(not (null? (member x xs))))
(define min-size ... | null | https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/lab/homework/01/tests/matrix-tests.rkt | racket | didn't find an easier way to check if member returns true
matrix generation
02. any?
03. concat | #lang racket
(require quickcheck
rackunit
rackunit/quickcheck)
(require (prefix-in solutions. "../solutions/matrix.rkt"))
(define (id x) x)
bE CoErCeD To A GeNeRator
(define (elem x xs)
(not (null? (member x xs))))
(define min-size 0)
(define max-size 100000)
(define integer-gen (choose-int... |
bde0dd6ce68214120119510d42d0b103b9298c23c0b060c3575f470cc1c0f4f7 | haskell/haskell-ide-engine | HlintPragma.hs | {-# ANN module ("hlint: ignore Redundant do" :: String) #-}
main = do
putStrLn ("hello")
| null | https://raw.githubusercontent.com/haskell/haskell-ide-engine/d84b84322ccac81bf4963983d55cc4e6e98ad418/test/testdata/HlintPragma.hs | haskell | # ANN module ("hlint: ignore Redundant do" :: String) # |
main = do
putStrLn ("hello")
|
16468f594c4d11ef4db538ecf50f8c36e168722b95af7d380701c3863ff1a6c5 | haskellfoundation/matchmaker | Signin.hs | module Handler.Login.Signin where
import Data.Password.Argon2
import DB.User
import qualified Data.Map as M
import ImportYesod
import Templates.Partials.FlashAlerts
import Web.FlashAlerts
import Web.Form
import Web.Sessions (markAuthenticated)
postLoginSigninR :: Handler ()
postLoginSigninR = do
postParams <- getP... | null | https://raw.githubusercontent.com/haskellfoundation/matchmaker/d64a1f0782a6be121a5df6038297e72f8d19fe4c/src/Handler/Login/Signin.hs | haskell | module Handler.Login.Signin where
import Data.Password.Argon2
import DB.User
import qualified Data.Map as M
import ImportYesod
import Templates.Partials.FlashAlerts
import Web.FlashAlerts
import Web.Form
import Web.Sessions (markAuthenticated)
postLoginSigninR :: Handler ()
postLoginSigninR = do
postParams <- getP... | |
08a03047b7786e58ce498c63db130805781084685ba5ddb2e9dea0c9c6364883 | junjihashimoto/yesod-raml | Parser.hs | {-#LANGUAGE OverloadedStrings#-}
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Yesod.Raml.Parser (
parseRaml
, parseRamlFile
, applyVersion
, applyTrait
, applyResourceType
, genUriParamDescription
) where
import Control.Applicative... | null | https://raw.githubusercontent.com/junjihashimoto/yesod-raml/2db9965c8a752c01b5d69ca6cf6fc1bfca6392a8/yesod-raml/Yesod/Raml/Parser.hs | haskell | #LANGUAGE OverloadedStrings# | # LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Yesod.Raml.Parser (
parseRaml
, parseRamlFile
, applyVersion
, applyTrait
, applyResourceType
, genUriParamDescription
) where
import Control.Applicative
import Control.Monad
import Data... |
5d57c59fc8a657b5f6d7b6d29fd410791c60656fc3cef7681b0923aa76d0471c | talex5/wayland-proxy-virtwl | request.mli | type reply = Types.reply
type _ checked =
| Unchecked : unit checked
| Checked : (unit, Error.code) result checked
val send_only : Types.display -> major:int -> ?minor:int -> int -> (Cstruct.t -> unit) -> unit Lwt.t
(** Send an X11 message that doesn't produce a reply.
Return as soon as the message is sent, a... | null | https://raw.githubusercontent.com/talex5/wayland-proxy-virtwl/0316db2f1ee1a6bcdf7328bc4d4b8de41506ec54/x11/request.mli | ocaml | * Send an X11 message that doesn't produce a reply.
Return as soon as the message is sent, and if we get an error response, just log it.
* Send an X11 message and wait for the reply.
* Send an X11 message that doesn't have a reply, and wait until we know it succeeded.
* [send_maybe_checked Checked] is [send_chec... | type reply = Types.reply
type _ checked =
| Unchecked : unit checked
| Checked : (unit, Error.code) result checked
val send_only : Types.display -> major:int -> ?minor:int -> int -> (Cstruct.t -> unit) -> unit Lwt.t
val send : Types.display -> major:int -> ?minor:int -> int -> (Cstruct.t -> unit) -> Types.reply ... |
57366d220d39d98a5d5de37f3d96ffc0debe33564b9fe161d31b62fa64a650b9 | lrascao/rebar3_gpb_plugin | rebar3_gpb_compiler.erl | -module(rebar3_gpb_compiler).
-export([compile/2,
clean/2]).
-define(DEFAULT_PROTO_DIR, "proto").
-define(DEFAULT_OUT_ERL_DIR, "src").
-define(DEFAULT_OUT_HRL_DIR, "include").
%% ===================================================================
%% Public API
%% ============================================... | null | https://raw.githubusercontent.com/lrascao/rebar3_gpb_plugin/c4c9586a5587fa0717f6493b2e28cfa5124b97cb/src/rebar3_gpb_compiler.erl | erlang | ===================================================================
Public API
===================================================================
check if non-recursive
search for .proto files
set the full path for the output directories
add to include path dir locations of the protos
=========================... | -module(rebar3_gpb_compiler).
-export([compile/2,
clean/2]).
-define(DEFAULT_PROTO_DIR, "proto").
-define(DEFAULT_OUT_ERL_DIR, "src").
-define(DEFAULT_OUT_HRL_DIR, "include").
-spec compile(rebar_app_info:t(),
rebar_state:t()) -> ok.
compile(AppInfo, State) ->
AppDir = rebar_app_info:dir(... |
4a28b13ab897246acedfc113760bd198b349bd5fd31b407913c1d4759789117e | cldwalker/logseq-query | queries_test.cljc | (ns cldwalker.logseq-query.queries-test
"These are high level tests for queries in queries.edn. These tests use the
test-notes graph."
(:require [clojure.test :refer [is deftest testing]]
[datascript.core :as d]
[clojure.string :as str]
[cldwalker.logseq-query.datascript :as ld... | null | https://raw.githubusercontent.com/cldwalker/logseq-query/064700384723b9c4934e0e73cc75d35f5fd255c3/test/cldwalker/logseq_query/queries_test.cljc | clojure | Tests | (ns cldwalker.logseq-query.queries-test
"These are high level tests for queries in queries.edn. These tests use the
test-notes graph."
(:require [clojure.test :refer [is deftest testing]]
[datascript.core :as d]
[clojure.string :as str]
[cldwalker.logseq-query.datascript :as ld... |
74f71305aaf5a25e9239ae7b9fe335ff16a44dcf92064e3a42e528c8891fc29f | yzhs/ocamlllvm | env.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/yzhs/ocamlllvm/45cbf449d81f2ef9d234968e49a4305aaa39ace2/src/typing/env.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : env.ml 11062 2011 - 06 - 01 2... |
746d31c2dde4199024552afa010da0b82f2f8e980005e06804e1f00e45baee56 | fendor/hsimport | SymbolTest25.hs | module Blub
( blub
, foo
, bar
) where
import Data.Text (Text)
import Data.Maybe (Maybe(Nothing, Just))
| null | https://raw.githubusercontent.com/fendor/hsimport/9be9918b06545cfd7282e4db08c2b88f1d8162cd/tests/goldenFiles/SymbolTest25.hs | haskell | module Blub
( blub
, foo
, bar
) where
import Data.Text (Text)
import Data.Maybe (Maybe(Nothing, Just))
| |
cb966b4a2c265a565d6f69a3fb307dbdef8f9eebd909d330d9a54341d14cfb19 | daveray/dorothy | jvm.clj | (ns dorothy.jvm
(:require [clojure.java.io :as jio]))
(set! *warn-on-reflection* true)
;; ----------------------------------------------------------------------
;; # Graph Rendering
Functions responsible for taking a DOT language graph and rendering it
;; to an image.
(defn ^:private build-render-comm... | null | https://raw.githubusercontent.com/daveray/dorothy/207570804dfda2162a15b9ee55b5e76ec6e1ecfa/src/dorothy/jvm.clj | clojure | ----------------------------------------------------------------------
# Graph Rendering
to an image.
Simple 3 node graph, converted to dot and rendered as SVG.
Write a graph to a png file
Simple 3 node graph, converted to dot and displayed.
| (ns dorothy.jvm
(:require [clojure.java.io :as jio]))
(set! *warn-on-reflection* true)
Functions responsible for taking a DOT language graph and rendering it
(defn ^:private build-render-command [{:keys [format layout scale invert-y?]}]
(->>
["dot"
(if format (str "-T" (name format)))
... |
2cd38b777f574083695c1916aa2740c4a622cedf23399cc21ddb612315da0c67 | LesBoloss-es/sorting | timsort.ml | (* Decomposition of the initial list in runs. *)
type 'a run =
| Asc of 'a list
| Desc of 'a list
let rec next_asc_run_rev compare revrun last len = function
| x :: xs when compare last x <= 0 ->
next_asc_run_rev compare (last :: revrun) x (len + 1) xs
| xs -> len, Desc (last :: revrun), xs
let rec next_... | null | https://raw.githubusercontent.com/LesBoloss-es/sorting/40702b8ff99ac001261af424bd7e0834e2a26bf1/src/list/timsort.ml | ocaml | Decomposition of the initial list in runs.
Merge function (as in MergeSort) |
type 'a run =
| Asc of 'a list
| Desc of 'a list
let rec next_asc_run_rev compare revrun last len = function
| x :: xs when compare last x <= 0 ->
next_asc_run_rev compare (last :: revrun) x (len + 1) xs
| xs -> len, Desc (last :: revrun), xs
let rec next_desc_run_rev compare revrun last len = function
... |
c006b6cb58aaba540e5a0b35f98134d8fe96cd36ff0aa33ff57a58ad0369a2f0 | TempusMUD/cl-tempus | act-comm.lisp | (in-package #:tempus)
(defun perform-tell (ch target message)
(cond
((pref-flagged ch +pref-notell+)
(send-to-char ch "You can't tell other people while you have notell on.~%"))
((and (room-flagged (in-room-of ch) +room-soundproof+)
(not (immortal-level-p ch))
(not (eql (in-room-of c... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/actions/act-comm.lisp | lisp | Pets can't shout on interplanar channels
Drunk people not allowed
Player is muted
Make sure the char is on the channel
High enough level to shout
Only remort players can project
Maximum position of channel
Ensure they are in a clan for clan channels
Ensure they have enough movement for the movement cost
All c... | (in-package #:tempus)
(defun perform-tell (ch target message)
(cond
((pref-flagged ch +pref-notell+)
(send-to-char ch "You can't tell other people while you have notell on.~%"))
((and (room-flagged (in-room-of ch) +room-soundproof+)
(not (immortal-level-p ch))
(not (eql (in-room-of c... |
be4ace1e7d2364fd5bc97d6918583de40dd2fdfa684550e9e70028a4e354e7e4 | Atidot/language-powerquery | Spec.hs | {-# LANGUAGE PackageImports #-}
module Main where
import "hspec" Test.Hspec hiding (example)
import " language - powerquery " Language . PowerQuery . AST.Annotation
import " language - powerquery " Language . PowerQuery .
import " language - powerquery " Language . PowerQuery . AST.AST
main :: IO ()
m... | null | https://raw.githubusercontent.com/Atidot/language-powerquery/e396e2c2f2855b1a82f1158b91c67db6495bc2d3/language-powerquery-ast/test/Spec.hs | haskell | # LANGUAGE PackageImports # | module Main where
import "hspec" Test.Hspec hiding (example)
import " language - powerquery " Language . PowerQuery . AST.Annotation
import " language - powerquery " Language . PowerQuery .
import " language - powerquery " Language . PowerQuery . AST.AST
main :: IO ()
main = return ()
|
b7b77d4a770a89a052a336b4b59aac8bdf0f2b0147abf3d234439c9835fea295 | racket/drracket | language-test.rkt | #lang racket
#|
Make sure there are tests that cover these parameters:
(read-case-sensitive #f)
(read-square-bracket-as-paren #f) -- test: (symbol? '[])
(read-curly-brace-as-paren #f)
(print-vector-length #f)
the settings above should match r5rs
|#
(require "private/drracket-test-util.rkt"
"privat... | null | https://raw.githubusercontent.com/racket/drracket/a0814b581075d74d306669032183aaeea1e6a2b2/drracket-test/tests/drracket/language-test.rkt | racket |
Make sure there are tests that cover these parameters:
(read-case-sensitive #f)
(read-square-bracket-as-paren #f) -- test: (symbol? '[])
(read-curly-brace-as-paren #f)
(print-vector-length #f)
the settings above should match r5rs
set-language : boolean -> void
... | #lang racket
(require "private/drracket-test-util.rkt"
"private/gui.rkt"
mred
framework
(prefix-in fw: framework))
(define language (make-parameter "<<not a language>>"))
(define defs-prefix (make-parameter ""))
(define (set-language close-dialog?)
(if (equal? (car (language))... |
c789ededcf9dc2669f467ff68e49826437ee29a04ace9091292a63d957231f5b | cedlemo/OCaml-GI-ctypes-bindings-generator | Revealer_transition_type.ml | open Ctypes
open Foreign
type t = None | Crossfade | Slide_right | Slide_left | Slide_up | Slide_down
let of_value v =
if v = Unsigned.UInt32.of_int 0 then None
else if v = Unsigned.UInt32.of_int 1 then Crossfade
else if v = Unsigned.UInt32.of_int 2 then Slide_right
else if v = Unsigned.UInt32.of_int 3 then S... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Revealer_transition_type.ml | ocaml | open Ctypes
open Foreign
type t = None | Crossfade | Slide_right | Slide_left | Slide_up | Slide_down
let of_value v =
if v = Unsigned.UInt32.of_int 0 then None
else if v = Unsigned.UInt32.of_int 1 then Crossfade
else if v = Unsigned.UInt32.of_int 2 then Slide_right
else if v = Unsigned.UInt32.of_int 3 then S... | |
19a8d8412490c314193fad9745279c7ea2b1248f2a77b298bdbadd555869bd9c | racket/rackunit | result.rkt | ;;;
Time - stamp : < 2008 - 08 - 11 21:10:24 noel >
;;;
Copyright ( C ) by .
;;;
;;; 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
... | null | https://raw.githubusercontent.com/racket/rackunit/f94364891f201f90c055adb1521e5f038ce75411/rackunit-lib/rackunit/private/result.rkt | racket |
This library is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser
either version 2.1 of the License , or ( at
your option) any later version.
This library is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of M... | Time - stamp : < 2008 - 08 - 11 21:10:24 noel >
Copyright ( C ) by .
General Public License as published by the Free Software
write to the Free Software Foundation , Inc. , 59 Temple
Place , Suite 330 , Boston , MA 02111 - 1307 USA
Author : < >
#lang racket/base
(require "base.rkt"
"test... |
5fd9b2da4b411ef132b98d2c8d744e2c21dbc6a26ed4321237089573863046c9 | k0ral/hbro | Extended.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
-- | Generalized version of 'Network.URI'.
module Network.URI.Extended
( module X
, parseURIReference
, parseURI
, UriException(..)
) where
-- {{{ Imports
import Hbro.Error
import H... | null | https://raw.githubusercontent.com/k0ral/hbro/8926b53960eb7136c4dec94eb31f2426fa34c726/library/Network/URI/Extended.hs | haskell | # LANGUAGE OverloadedStrings #
| Generalized version of 'Network.URI'.
{{{ Imports
}}}
| Generalized version of 'N.parseURIReference'.
| Generalized version of 'N.parseURI'. | # LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
module Network.URI.Extended
( module X
, parseURIReference
, parseURI
, UriException(..)
) where
import Hbro.Error
import Hbro.Prelude
import Network.URI as X hiding (parseURI, parseURIReference)
import q... |
e56072bd444e61bf403c552df87b05b00ccb0adcbf4cea98ae87e1510dc8b22c | softwarelanguageslab/maf | R5RS_scp1_deep-map-combine-1.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((atom? (lambda (x)
(not (pair? x))))
(deep-combine (lambda (combiner null-value l)
(<change>
()
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_deep-map-combine-1.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 1
* swaps : 0
(letrec ((atom? (lambda (x)
(not (pair? x))))
(deep-combine (lambda (combiner null-value l)
(<change>
()
deep-combine)
(if (null? l)
... |
c3db49e55c96dd9326cd8cfb42abbd90b798a01bff49679d017b97f54abff780 | lehins/massiv | Push.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
-- |... | null | https://raw.githubusercontent.com/lehins/massiv/ff6cd4813970d79122bd23edde10ecc6b9846871/massiv/src/Data/Massiv/Array/Delayed/Push.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE RankNTypes #
|
Module : Data.Massiv.Array.Delayed.Push
License : BSD3
Stability : experimental
Portability : non-portable
| Delayed load representation. Also known as Push array.
^ Scheduler that will be used for loading
^ Start loading at this linear index
^ Li... | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
Copyright : ( c ) 2019 - 2022
Maintainer : < >
m... |
8fa7a716b2b1254d44e18dc2687362b79c68ff908ded287e27cdfc188a11c7c3 | pascal-knodel/haskell-craft | B'C'12.hs | --
Relevant definitions from chapter 6 for chapter 12 ...
--
module B'C'12 where
import Pictures
(
Picture
)
-- Subchapter 6.6: "Position", "Image"
type Position = (Int , Int)
type Image = (Picture , Position)
| null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/B'C'12.hs | haskell |
Subchapter 6.6: "Position", "Image" | Relevant definitions from chapter 6 for chapter 12 ...
module B'C'12 where
import Pictures
(
Picture
)
type Position = (Int , Int)
type Image = (Picture , Position)
|
6188aa064e546d620e16931c4f570e63d1866996c1b67e4beb6042cbfc72d3a5 | bbss/cljsc2 | kernel.clj | (ns cljsc2.clj.kernel
(:require
[perseverance.core :as p]
[fulcro.easy-server :as easy]
[me.raynes.conch :refer [programs with-programs let-programs] :as hsh]
[me.raynes.conch.low-level :as sh]
[cheshire.core :as cheshire]
[clojure.string :refer [lower-case includes?]]
[clojure.spec.alpha :as spe... | null | https://raw.githubusercontent.com/bbss/cljsc2/70e720f5bae9b58248df86f3f50d855878ae4f49/src/cljsc2/clj/notebook/kernel.clj | clojure | (ns cljsc2.clj.kernel
(:require
[perseverance.core :as p]
[fulcro.easy-server :as easy]
[me.raynes.conch :refer [programs with-programs let-programs] :as hsh]
[me.raynes.conch.low-level :as sh]
[cheshire.core :as cheshire]
[clojure.string :refer [lower-case includes?]]
[clojure.spec.alpha :as spe... | |
5abb983fc58c017035caf6e45770c7081bf174e99145aa95a90e055f1fb88585 | ocaml-opam/opam-rt | init_setup.ml |
* Copyright ( c ) 2020 OCamlPro
* Authors < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDE... | null | https://raw.githubusercontent.com/ocaml-opam/opam-rt/2f42d8dcdbd9f16e0e385314a8bf9396cb8a88fa/src/tests/init_setup.ml | ocaml | files
tests |
* Copyright ( c ) 2020 OCamlPro
* Authors < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.