_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 |
|---|---|---|---|---|---|---|---|---|
45254385407819cb47381f65ae86313e84990f9d6754ac29980aeaa65d1d4d11 | hedgehogqa/haskell-hedgehog-classes | Storable.hs | # LANGUAGE ScopedTypeVariables #
module Hedgehog.Classes.Storable (storableLaws) where
import Hedgehog
import Hedgehog.Classes.Common
import Hedgehog.Internal.Gen (sample)
import qualified Data.List as List
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Foreign.Marshal.Alloc
im... | null | https://raw.githubusercontent.com/hedgehogqa/haskell-hedgehog-classes/f793c14853b47f1ba2d978e974072b6cdb9c86ec/src/Hedgehog/Classes/Storable.hs | haskell |
[__Set-Get__]: @'pokeElemOff' ptr ix a '>>' 'peekElemOff' ptr ix@ ≡ @'pure' a@
[__Get-Set__]: @'peekElemOff' ptr ix '>>=' 'pokeElemOff' ptr ix@ ≡ @'pure' ()@ (Putting back what you got out has no effect)
[__List Conversion Roundtrips__]: Mallocing a list and then reconstructing it gives you the same list | # LANGUAGE ScopedTypeVariables #
module Hedgehog.Classes.Storable (storableLaws) where
import Hedgehog
import Hedgehog.Classes.Common
import Hedgehog.Internal.Gen (sample)
import qualified Data.List as List
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Foreign.Marshal.Alloc
im... |
c5a5c9ed278b18be48257eed1c4520802e608a3e72405a7ebb78489a9e1c4202 | OCamlPro/ocp-indent | ppx-string.ml | let s = {|
|}
let s = {xx|
xx|}
let s =
{xx|
|}
|xx}
let s = {| foo
bar
|}
let s = {| foo
bar
|}
let s = {| foo
bar
|}
let s =
{|
|}
let s =
{|
|}
let s =
{| foo
|}
let s =
{xx| foo
bar
|yy}
baz
|xx}
let s =
{|
foo bar
baz
|}
| null | https://raw.githubusercontent.com/OCamlPro/ocp-indent/9e26c0a2699b7076cebc04ece59fb354eb84c11c/tests/passing/ppx-string.ml | ocaml | let s = {|
|}
let s = {xx|
xx|}
let s =
{xx|
|}
|xx}
let s = {| foo
bar
|}
let s = {| foo
bar
|}
let s = {| foo
bar
|}
let s =
{|
|}
let s =
{|
|}
let s =
{| foo
|}
let s =
{xx| foo
bar
|yy}
baz
|xx}
let s =
{|
foo bar
baz
|}
| |
ce3149fda6df5064b05e7d0541021838b114cb8d51743e7d5d232dc54ef54f2e | mmontone/cl-rest-server | demo.lisp | (defpackage rest-server-demo.client
(:use :cl))
(defpackage rest-server-demo
(:use :cl :rest-server :schemata :generic-serializer)
(:export :start-demo-api))
(in-package rest-server-demo)
(defun start-demo-api ()
(rs:start-api 'users-demo-api :port 9090))
| null | https://raw.githubusercontent.com/mmontone/cl-rest-server/cd3a08681a1c3215866fedcd36a6bc98d223d52d/demo/demo.lisp | lisp | (defpackage rest-server-demo.client
(:use :cl))
(defpackage rest-server-demo
(:use :cl :rest-server :schemata :generic-serializer)
(:export :start-demo-api))
(in-package rest-server-demo)
(defun start-demo-api ()
(rs:start-api 'users-demo-api :port 9090))
| |
4c250ef6094cb926bb3cb67d4c7ab30015118bac79c321234a57ed75aca61490 | racket/eopl | check-modules.rkt | #lang eopl
(require "lang.rkt")
(require "static-data-structures.rkt")
(require "expand-type.rkt")
(require "checker.rkt")
(require "subtyping.rkt")
(require (only-in racket pretty-print))
(provide type-of-program)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; type-of-program : Program -> Typ... | null | https://raw.githubusercontent.com/racket/eopl/43575d6e95dc34ca6e49b305180f696565e16e0f/tests/chapter8/abstract-types-lang/check-modules.rkt | racket |
type-of-program : Program -> Type
add-module-defns-to-tenv : Listof(ModuleDefn) * Tenv -> Tenv
ok, continue in extended tenv
no, raise error
interface-of : ModuleBody * Tenv -> Iface
defns-to-decls : Listof(Defn) * Tenv -> Listof(Decl)
at every step, so we get the correct let* scoping | #lang eopl
(require "lang.rkt")
(require "static-data-structures.rkt")
(require "expand-type.rkt")
(require "checker.rkt")
(require "subtyping.rkt")
(require (only-in racket pretty-print))
(provide type-of-program)
Page : 286
(define type-of-program
(lambda (pgm)
(cases program pgm
(a-program (module... |
60a66c96004abffba257c20f2ebb3f0fac95bd4d84e5a7bc3de07e07a0ca4834 | fujita-y/ypsilon | synenv.scm | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
;;; See LICENSE file for terms and conditions of use.
(define extend-env
(lambda (bindings env)
(if (null? bindings)
env
(append bindings env))))
(define env-lookup
(lambda (env id)
(or (symbol? id) (scheme-erro... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/df2f76eff07a76fc6102dcd1eb6ef933ab8b8399/heap/boot/macro/synenv.scm | scheme | See LICENSE file for terms and conditions of use. | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
(define extend-env
(lambda (bindings env)
(if (null? bindings)
env
(append bindings env))))
(define env-lookup
(lambda (env id)
(or (symbol? id) (scheme-error "internal error: env-lookup: expect symbol but got ~... |
d13ebb443ab47f572ec87dea662454f9a9ce9e7e9ecf78f43c40a21cbbb652ab | anurudhp/CPHaskell | a.hs | -- AC
import Control.Arrow ((>>>))
main :: IO ()
main = interact $ words >>> map (read :: String -> Int) >>> solve >>> show
solve :: [Int] -> Int
solve xs = sum $ (\x -> (x * (x - 1)) `div` 2) <$> xs
| null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/atcoder/abc159/a.hs | haskell | AC |
import Control.Arrow ((>>>))
main :: IO ()
main = interact $ words >>> map (read :: String -> Int) >>> solve >>> show
solve :: [Int] -> Int
solve xs = sum $ (\x -> (x * (x - 1)) `div` 2) <$> xs
|
20eb9eefc2c5ae649bbe913359bca24ffb69489df32e6d651554c31aaeb5ae7d | racket/typed-racket | type-annotation.rkt | #lang racket/base
(require "../utils/utils.rkt"
"../rep/type-rep.rkt"
"../utils/tc-utils.rkt"
"../env/global-env.rkt"
"../env/mvar-env.rkt"
"../types/subtype.rkt"
"../types/utils.rkt"
"../types/generalize.rkt"
(except-in "../types/abbrev.rkt"
... | null | https://raw.githubusercontent.com/racket/typed-racket/668088fce9c19c2e8c8580fd7b75e0fad9338595/typed-racket-lib/typed-racket/private/type-annotation.rkt | racket | get the type annotation of this syntax
is let-binding really necessary? - remember to record the bugs!
get the type annotation of this identifier, otherwise error
if #:default is provided, return that instead of error
identifier #:default Type -> Type
Listof[identifier] #:default Type -> Listof[Type]
stxs : the ... | #lang racket/base
(require "../utils/utils.rkt"
"../rep/type-rep.rkt"
"../utils/tc-utils.rkt"
"../env/global-env.rkt"
"../env/mvar-env.rkt"
"../types/subtype.rkt"
"../types/utils.rkt"
"../types/generalize.rkt"
(except-in "../types/abbrev.rkt"
... |
68bfa56ba5d77b2dfe99195546d69f1c26b281d85e84204f9ed748f9b8bcff58 | clojure-interop/aws-api | S3ClientOptions.clj | (ns com.amazonaws.services.s3.S3ClientOptions
"S3 client configuration options such as the request access style."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.s3 S3ClientOptions]))
(defn ->s-3-client-options
"Constructor.
Deprecated. Will be removed once S3ClientOptions ... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.s3/src/com/amazonaws/services/s3/S3ClientOptions.clj | clojure | (ns com.amazonaws.services.s3.S3ClientOptions
"S3 client configuration options such as the request access style."
(:refer-clojure :only [require comment defn ->])
(:import [com.amazonaws.services.s3 S3ClientOptions]))
(defn ->s-3-client-options
"Constructor.
Deprecated. Will be removed once S3ClientOptions ... | |
00da103a5dc47fea989e799ccb236540a92a545e562c54aa68efc321908c8774 | sheyll/mediabus | Alaw.hs | | Conduits for converting ' ' ' Stream 's to ' S16 ' streams and vice versa .
module Data.MediaBus.Conduit.Audio.Raw.Alaw
( alawToS16,
s16ToAlaw,
)
where
import Control.DeepSeq (NFData)
import Control.Lens (over)
import Data.Conduit (ConduitT)
import Data.MediaBus.Conduit.Stream (mapFrameContentC')
import D... | null | https://raw.githubusercontent.com/sheyll/mediabus/351272b2bb26a1bde7b0ffda6ceabc623ede2b14/src/Data/MediaBus/Conduit/Audio/Raw/Alaw.hs | haskell | | Conduits for converting ' ' ' Stream 's to ' S16 ' streams and vice versa .
module Data.MediaBus.Conduit.Audio.Raw.Alaw
( alawToS16,
s16ToAlaw,
)
where
import Control.DeepSeq (NFData)
import Control.Lens (over)
import Data.Conduit (ConduitT)
import Data.MediaBus.Conduit.Stream (mapFrameContentC')
import D... | |
fe0305aa3a44b188477475809939bd121ae5be407746f6f0355023c52548047f | ragkousism/Guix-on-Hurd | music.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 < >
Copyright © 2015 , 2016 , 2017 < >
Copyright © 2015 < >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/music.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 < >
Copyright © 2015 , 2016 , 2017 < >
Copyright © 2015 < >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 >
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2017 ng0 < >
under the terms of the GNU General Publi... |
0b4a093af1c1f77a501eeb70c6870d66aa59db25a8d34c361fb0c2b3a7eacb53 | Simspace/avaleryar | Handle.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Language.Avaleryar.PDP.Handle where
import Control.Concurrent.MVar
import Control.DeepSeq (NFData)
import Control.Monad.Except
import Control.Monad.Reader
import ... | null | https://raw.githubusercontent.com/Simspace/avaleryar/dff6048312289f6b8500e60094d7835c78aa5d1e/core/src/Language/Avaleryar/PDP/Handle.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
module Language.Avaleryar.PDP.Handle where
import Control.Concurrent.MVar
import Control.DeepSeq (NFData)
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import ... |
17ad0d0118cafe42da66fc097cfb554934297b1ae4e28feeca59b5e4574f44ec | bkomuves/toy-language-server | ToyLang.hs |
# LANGUAGE BangPatterns , PatternSynonyms , DeriveFunctor , DeriveGeneric , DeriveAnyClass #
module ToyLang where
--------------------------------------------------------------------------------
import Control.Monad
import Control.Monad.State.Strict
import Data.Void
import Data.Either
import Data.Char
import Data.L... | null | https://raw.githubusercontent.com/bkomuves/toy-language-server/de85742b434314ec1b3d2cfbb70c73a324a8ebc7/ToyLang.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
* the AST
------------------------------------------------------------------------------
* colors
some more colors to have interesting completion examples
----... |
# LANGUAGE BangPatterns , PatternSynonyms , DeriveFunctor , DeriveGeneric , DeriveAnyClass #
module ToyLang where
import Control.Monad
import Control.Monad.State.Strict
import Data.Void
import Data.Either
import Data.Char
import Data.List
import qualified Data.Map as Map ; import Data.Map (Map)
import GHC.Generic... |
b93007de22652df3871500c7b6db1d1a58659688e1354c51055058292a44253a | herd/herdtools7 | mode.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/litmus/mode.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2014 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
43d7fea967454f9fb955bb1c4b170815141afb38643c284258f5cb82f8ac1250 | bartima3us/erline-dht | erline_dht_db_ets.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 ,
%%% @doc
%%% ETS backend implementation.
%%% @end
Created : 28 . Mar 2020 10.32
%%%-------------------------------------------------------------------
-module(erline_dht_db_ets).
-author("bartimaeus").
-include("erline_... | null | https://raw.githubusercontent.com/bartima3us/erline-dht/7de9bee0b5b86a347b9527369877e3d97b863d9d/src/erline_dht_db_ets.erl | erlang | -------------------------------------------------------------------
@doc
ETS backend implementation.
@end
-------------------------------------------------------------------
Common API
NOT_ASSIGNED_NODES_TABLE API
GET_PEERS_SEARCHES_TABLE API
===================================================================
AP... | @author
( C ) 2019 ,
Created : 28 . Mar 2020 10.32
-module(erline_dht_db_ets).
-author("bartimaeus").
-include("erline_dht.hrl").
-include_lib("stdlib/include/ms_transform.hrl").
-export([
init/1
]).
-export([
get_not_assigned_nodes/1,
get_not_assigned_nodes/2,
get_not_assigned_node/3,
in... |
fc054443547fb8057df9e6a4afd2e326ed4a52197ed4f0133e43ea9f37c96d5b | Metaxal/quickscript-extra | add-menu.rkt | #lang racket/base
(require racket/gui/base
racket/class
quickscript)
(script-help-string "(Example) Shows how to dynamically add a menu to DrRacket.")
(define-script add-menu
#:label "Add menu"
#:menu-path ("E&xamples")
(λ (str #:frame fr)
(define menu-bar (send fr get-menu-bar))
(de... | null | https://raw.githubusercontent.com/Metaxal/quickscript-extra/526b2eccd9f73ea30bbc013741fdd77f4e2724cf/scripts/add-menu.rkt | racket | #lang racket/base
(require racket/gui/base
racket/class
quickscript)
(script-help-string "(Example) Shows how to dynamically add a menu to DrRacket.")
(define-script add-menu
#:label "Add menu"
#:menu-path ("E&xamples")
(λ (str #:frame fr)
(define menu-bar (send fr get-menu-bar))
(de... | |
1d4c12006eee37a36cf3a1468f132f9c11d20e32df0fff99d8b34d905ffd8f1f | FieryCod/holy-lambda | retriever_test.clj | (ns fierycod.holy-lambda.retriever-test
(:require
[clojure.core.async :as async]
[clojure.test :as t]
[fierycod.holy-lambda.retriever :as r]))
(t/deftest <-wait-for-response-test
(t/testing "<-wait-for-response should wait for either map, future or promise"
(t/is (= {} (r/<-wait-for-response (async/go... | null | https://raw.githubusercontent.com/FieryCod/holy-lambda/5a67b3dfb3d9f8d1ca462c86ada3c0f89d3f3541/modules/holy-lambda-async-retriever/test/fierycod/holy_lambda/retriever_test.clj | clojure | (ns fierycod.holy-lambda.retriever-test
(:require
[clojure.core.async :as async]
[clojure.test :as t]
[fierycod.holy-lambda.retriever :as r]))
(t/deftest <-wait-for-response-test
(t/testing "<-wait-for-response should wait for either map, future or promise"
(t/is (= {} (r/<-wait-for-response (async/go... | |
6d11937f1410577df51de27330324fb8a1aeeef26fe894347bc76570c676eafb | clojurecup2014/parade-route | javadoc.clj | (ns clojure.java.javadoc
(:import (UnityEngine Debug)))
(defn clrdoc-url [class-name]
(str "=" class-name))
(defn browse-url [url]
(Debug/Log (str "browsing url: " url)))
(defn javadoc
"Opens a browser window displaying the javadoc for the argument.
Tries *local-javadocs* first, then *remote-javadocs*."
... | null | https://raw.githubusercontent.com/clojurecup2014/parade-route/adb2e1ea202228e3da07902849dee08f0bb8d81c/Assets/Clojure/Internal/Plugins/clojure/java/javadoc.clj | clojure | (ns clojure.java.javadoc
(:import (UnityEngine Debug)))
(defn clrdoc-url [class-name]
(str "=" class-name))
(defn browse-url [url]
(Debug/Log (str "browsing url: " url)))
(defn javadoc
"Opens a browser window displaying the javadoc for the argument.
Tries *local-javadocs* first, then *remote-javadocs*."
... | |
eee6aa1120b37b62c0defa55667c7e21f664b6c3cee26eac5fd5639a156fe681 | serokell/fift-asm-dsl | Util.hs | SPDX - FileCopyrightText : 2019 >
--
SPDX - License - Identifier : MPL-2.0
# LANGUAGE PolyKinds #
module Util
( Take
, Drop
, Head
, Tail
, Swap
, Reverse
, RecAll_
-- Reexports
, Nat
, type (-)
, type (++)
) where
import GHC... | null | https://raw.githubusercontent.com/serokell/fift-asm-dsl/d710e076d4212aa2cce4aa8bb15277d3b09c48af/src/Util.hs | haskell |
Reexports | SPDX - FileCopyrightText : 2019 >
SPDX - License - Identifier : MPL-2.0
# LANGUAGE PolyKinds #
module Util
( Take
, Drop
, Head
, Tail
, Swap
, Reverse
, RecAll_
, Nat
, type (-)
, type (++)
) where
import GHC.TypeLits (Nat, TypeErr... |
0acda6696548d4f636cf07ac27240434f1ce38e078dc1c47552589fa0001e2c9 | ivanperez-keera/Yampa | Scan.hs | -- |
Module : . Scan
Copyright : ( c ) , 2014 - 2022
( c ) , 2007 - 2012
( c ) , 2005 - 2006
( c ) and , Yale University , 2003 - 2004
-- License : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer :
-- Stability ... | null | https://raw.githubusercontent.com/ivanperez-keera/Yampa/e00c94f39ceaa017d0c5f48c5f504da3ee0c15fa/yampa/src/FRP/Yampa/Scan.hs | haskell | |
License : BSD-style (see the LICENSE file in the distribution)
Maintainer :
Stability : provisional
Simple, stateful signal processing.
Scanning implements elementary, step-based accumulating over signal
functions by means of an auxiliary function applied to each input and to an
accumulator. For... | Module : . Scan
Copyright : ( c ) , 2014 - 2022
( c ) , 2007 - 2012
( c ) , 2005 - 2006
( c ) and , Yale University , 2003 - 2004
Portability : non - portable ( GHC extensions )
module FRP.Yampa.Scan
( sscan
, sscanPrim
)
w... |
37c167210f3cc0b6f2d3517dbcd00c92e1dd7a75c6ccee07f85bb46b974806ea | metametadata/byplay | reporter.clj | Prettify test reports
(ns unit.reporter
(:require
[clojure.test :refer [report with-test-out inc-report-counter *testing-contexts* *testing-vars*
testing-contexts-str testing-vars-str *stack-trace-depth*]]
[clojure.stacktrace :as stack]))
; Change the report multimethod to ignore ... | null | https://raw.githubusercontent.com/metametadata/byplay/bfad346181d519430aaa69008818ced254b80de0/test/unit/reporter.clj | clojure | Change the report multimethod to ignore namespaces that don't contain any tests.
taken from: -introduction.html
Report test names
Error reporting with color
Summary reporting with color
print names of failed tests
clear a list of failed tests (important if tests are automatically rerun) | Prettify test reports
(ns unit.reporter
(:require
[clojure.test :refer [report with-test-out inc-report-counter *testing-contexts* *testing-vars*
testing-contexts-str testing-vars-str *stack-trace-depth*]]
[clojure.stacktrace :as stack]))
(defmethod report :begin-test-ns [m]
(wi... |
abccae708eed81c9ac8907c3b4460d10c80f16d5f651f1e50bdb9773afe9ec16 | amiller/generic-ads | demo_redblack.hs | # LANGUAGE
GADTs , NoMonomorphismRestriction , FlexibleContexts , UnicodeSyntax ,
ScopedTypeVariables , FlexibleInstances , MultiParamTypeClasses , RankNTypes ,
UndecidableInstances
#
GADTs, NoMonomorphismRestriction, FlexibleContexts, UnicodeSyntax,
ScopedTypeVariables, FlexibleInstances, MultiParam... | null | https://raw.githubusercontent.com/amiller/generic-ads/c2789eabbc2e4fa224abf5ea75607f4cd8b3b075/demo_redblack.hs | haskell | Examples
asIO $ foldr (ins'.(\x→[x])) tTip x
y <- return $! unISem' $ foldr (ins'.show) tTip x
tree2png "test.png" $ rbpToRose y
x <- shuffle$ ['A'..'Z']++['a'..'z']
y' <- return $! unISem' $ foldr (del'.(\x→[x])) (ISem' y) x
tree2png "test1.png" $ rbpToRose y'
main' :: IO ()
main' = do
putStrLn $ show $ t... | # LANGUAGE
GADTs , NoMonomorphismRestriction , FlexibleContexts , UnicodeSyntax ,
ScopedTypeVariables , FlexibleInstances , MultiParamTypeClasses , RankNTypes ,
UndecidableInstances
#
GADTs, NoMonomorphismRestriction, FlexibleContexts, UnicodeSyntax,
ScopedTypeVariables, FlexibleInstances, MultiParam... |
551450db7a7c9c8b80d4a44062f9fd072864b24e6b04f3e04062a69979a36eb7 | ghcjs/ghcjs-dom | WebKitMediaKeySession.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.WebKitMediaKeySession
(js_update, update, js_close, close, js_getError, getError,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/WebKitMediaKeySession.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/WebKitMediaKeySession.update Mozilla WebKitMediaKeySession.update documentation>
| <-US/docs/Web/API/WebKitMediaKeySession.error Mozilla WebKitMediaKeySession.error documentation> | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.WebKitMediaKeySession
(js_update, update, js_close, close, js_getError, getError,
js_getKeySystem, getKeySystem, js_getSessionId, getSessionId,
webKitKeyAdded, webKitKeyE... |
65e77980ed5338c27647a7e52e1117aad3b031b33c6af7a1732e49f3130bf69e | toschoo/mom | Streams.new.hs | # LANGUAGE CPP , DeriveDataTypeable , RankNTypes #
module Network.Mom.Patterns.Streams.Streams
where
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.State
import Control.Monad (unless, when)
import Control.Applicative ((<$>))
import Prelude hi... | null | https://raw.githubusercontent.com/toschoo/mom/b58ca23d05c98ab50d9e981bd4ad2cdb76846399/src/patterns/bkp/Streams/Streams.new.hs | haskell | on timeout
error handler
stream handler
catch!
do catch (handleCmd)
(\e -> do onErr Critical e
"Can't handle command"
cleanStream c)
----------------------------------------... | # LANGUAGE CPP , DeriveDataTypeable , RankNTypes #
module Network.Mom.Patterns.Streams.Streams
where
import Control.Monad.Trans (liftIO)
import Control.Monad.Trans.State
import Control.Monad (unless, when)
import Control.Applicative ((<$>))
import Prelude hi... |
5419e8edd8abf8a279d4a95d098e00a3b413f9f629bbd010e216928deadaae8b | finkel-lang/finkel | pat-opexp.hs | case expr of -- Haskell
a1 : a2 : _ -> a1 + a2
_ -> 0
| null | https://raw.githubusercontent.com/finkel-lang/finkel/c3c7729d5228bd7e0cf76e8ff05fe2f79a0ec0a2/doc/include/language-syntax/expr/pat-opexp.hs | haskell | Haskell | a1 : a2 : _ -> a1 + a2
_ -> 0
|
356827413edc38b77610ad49a15a04921d3111bb74f9f5ccc14e380a5688e83d | ericcervin/getting-started-with-sketching | pg085.rkt | #lang sketching
(define easing 0.04)
(struct bot (x y radius body-height neck-height))
(define b (bot 60 440 45 160 70))
(define (setup)
(size 360 480)
(smoothing 'smoothed)
(set-frame-rate! 60)
(background 200)
(ellipse-mode 'radius)
)
(define (draw)
(stroke-weight 2)
(define neck-y (* -1 (+ b.b... | null | https://raw.githubusercontent.com/ericcervin/getting-started-with-sketching/4349702df755a91f29e7750899ba5238f4c966c2/pg085.rkt | racket | BODY
Neck
Hair
Head | #lang sketching
(define easing 0.04)
(struct bot (x y radius body-height neck-height))
(define b (bot 60 440 45 160 70))
(define (setup)
(size 360 480)
(smoothing 'smoothed)
(set-frame-rate! 60)
(background 200)
(ellipse-mode 'radius)
)
(define (draw)
(stroke-weight 2)
(define neck-y (* -1 (+ b.b... |
cfbc2e33fc2f90301ffea53439c7ed1e51af85644a221f93348ac57a85280070 | patricoferris/ocaml-multicore-monorepo | hash.ml | open Uncommon
type digest = Cstruct.t
type 'a iter = 'a Uncommon.iter
module type S = sig
val digest_size : int
type t
val empty : t
val feed : t -> Cstruct.t -> t
val get : t -> Cstruct.t
type hmac
val hmac_empty : key:Cstruct.t -> hmac
val hmac_feed : hmac -> Cstruct.t -> hmac
val hmac_ge... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/mirage-crypto/src/hash.ml | ocaml | open Uncommon
type digest = Cstruct.t
type 'a iter = 'a Uncommon.iter
module type S = sig
val digest_size : int
type t
val empty : t
val feed : t -> Cstruct.t -> t
val get : t -> Cstruct.t
type hmac
val hmac_empty : key:Cstruct.t -> hmac
val hmac_feed : hmac -> Cstruct.t -> hmac
val hmac_ge... | |
88c8f4f7d033609ac4b8ad97a9f702993943d2bbc2269a603c38db9c1e243fa4 | csm/crux-aws | full-aws-test.clj | (in-ns 'crux.aws.repl)
(.setLevel (org.slf4j.LoggerFactory/getLogger "software") ch.qos.logback.classic.Level/INFO)
(.setLevel (org.slf4j.LoggerFactory/getLogger "io.netty") ch.qos.logback.classic.Level/INFO)
(.setLevel (org.slf4j.LoggerFactory/getLogger "crux") ch.qos.logback.classic.Level/INFO)
(require 'crux.aws
... | null | https://raw.githubusercontent.com/csm/crux-aws/34828ddb6e3e1f493d9a09bb275f483ef6e04824/examples/full-aws-test.clj | clojure | (in-ns 'crux.aws.repl)
(.setLevel (org.slf4j.LoggerFactory/getLogger "software") ch.qos.logback.classic.Level/INFO)
(.setLevel (org.slf4j.LoggerFactory/getLogger "io.netty") ch.qos.logback.classic.Level/INFO)
(.setLevel (org.slf4j.LoggerFactory/getLogger "crux") ch.qos.logback.classic.Level/INFO)
(require 'crux.aws
... | |
20bb350e24744bdde74d75bc00138f740e4d5a447b33a7a1c3b8f0af1f68434d | shirok/WiLiKi | core.scm | ;;;
;;; wiliki.core
;;;
Copyright ( c ) 2000 - 2009 < >
;;;
;;; 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 r... | null | https://raw.githubusercontent.com/shirok/WiLiKi/c910d5d936c833887f7c7bc99e0e681e262b5334/src/wiliki/core.scm | scheme |
wiliki.core
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of
furnished to do so, subject to the following co... | Copyright ( c ) 2000 - 2009 < >
files ( the " Software " ) , to deal in the Software without restriction ,
the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND... |
07d77ebbd1807fa6d6d9948e448aaac85a39d1d5b4949b1964082931eb148585 | 40ants/reblocks | render-methods.lisp | (defpackage #:reblocks-tests/widgets/render-methods
(:use #:cl
#:rove)
(:import-from #:reblocks/widget
#:get-html-tag
#:render
#:defwidget)
(:import-from #:reblocks/html
#:with-html)
(:import-from #:reblocks-tests/utils
#:is... | null | https://raw.githubusercontent.com/40ants/reblocks/99986524e61ac90fa73e05b15d07310bbd378dea/t/widgets/render-methods.lisp | lisp | (defpackage #:reblocks-tests/widgets/render-methods
(:use #:cl
#:rove)
(:import-from #:reblocks/widget
#:get-html-tag
#:render
#:defwidget)
(:import-from #:reblocks/html
#:with-html)
(:import-from #:reblocks-tests/utils
#:is... | |
b8c0463d3af14676ae2f00f8082ebd2b5c22bf9d66ca341377764439e093567e | erlang/otp | prim_tty.erl | %% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2021 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicabl... | null | https://raw.githubusercontent.com/erlang/otp/8c2042f14962fd65b833200baa95bd703c0c65a7/lib/kernel/src/prim_tty.erl | erlang | %CopyrightBegin%
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 la... | Copyright Ericsson AB 1996 - 2021 . 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(prim_tty).
* Try to move buffer handling logic to Erlang
* user_drv module should be able to handle bo... |
44d01f2a068bb54d484230e517006fd2bd5d1fbd1c597d2f5de8a807b93b5c53 | lisp/de.setf.xml | init.lisp |
;; init.lisp
(pushnew :ACL-ITASCA-NT *features*)
#|
(make-pathname :device "G" :DIRECTORY (:ABSOLUTE "Source "Lisp") :TYPE "lisp")
SYS:*REQUIRE-SEARCH-LIST*
(pprint SYS:*REQUIRE-SEARCH-LIST*)
|#
(defun |read-mac-comment|
(stream char &optional (eol '(#\newline #\return #\linefeed)))
(loop (setf char (re... | null | https://raw.githubusercontent.com/lisp/de.setf.xml/827681c969342096c3b95735d84b447befa69fa6/tests/implementation/lispworks-4-2/init.lisp | lisp | init.lisp
(make-pathname :device "G" :DIRECTORY (:ABSOLUTE "Source "Lisp") :TYPE "lisp")
SYS:*REQUIRE-SEARCH-LIST*
(pprint SYS:*REQUIRE-SEARCH-LIST*)
#'|read-mac-comment| nil *readtable*)
#'|read-mac-comment| nil) |
(pushnew :ACL-ITASCA-NT *features*)
(defun |read-mac-comment|
(stream char &optional (eol '(#\newline #\return #\linefeed)))
(loop (setf char (read-char stream nil nil))
(unless char (return))
(when (find char eol) (return)))
(values))
(set-syntax-from-char #\return #\space)
|
e2c5f8c96eccfd8b0579fc09b450ff74373033daf042d82387f732c92353d011 | mnasoft/math | coord.lisp | ;;;; tests/array.lisp
(in-package #:math/tests)
(def-suite coord
:description "Мастер-набор всех тестов проекта math/matr для матрицы
типа coord."
:in all)
(in-suite coord)
(def-test coord-dtr-rtd ()
(loop :for (degree radian)
:in `((0 0)
(15 ,(* pi 1/12))
(30 ,(* p... | null | https://raw.githubusercontent.com/mnasoft/math/dca9f4212c800b418aa7ed4422fbe5ac7001bf35/src/tests/coord.lisp | lisp | tests/array.lisp |
(in-package #:math/tests)
(def-suite coord
:description "Мастер-набор всех тестов проекта math/matr для матрицы
типа coord."
:in all)
(in-suite coord)
(def-test coord-dtr-rtd ()
(loop :for (degree radian)
:in `((0 0)
(15 ,(* pi 1/12))
(30 ,(* pi 2/12))
... |
8ef17620be98441d6de2516630786d1516cf45e0fd8a48b91f433686be2a81eb | yuriy-chumak/ol | ai.scm | (define-library (ai)
(import (otus lisp)
(scheme dynamic-bindings))
(export
unhash
new-creature)
(begin
(define unique-id (make-parameter 1))
(define (generate-unique-id)
(let ((id (unique-id)))
(unique-id (+ id 1))
id))
;; ;; ; ------------------------------------------------... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/e6e02f6a3024fec87c88d563be6889b96a2e6f84/samples/Path%20Finder/ai.scm | scheme | ;; ; ---------------------------------------------------------------------------
;; ; assert (start point is free)
закончим сопрограмму
двигаться
осмотреться
no car for vectors
понемногу будем "забывать" карту
уже пришли
строим путь
пустой "закрытый" список
(print " c: " c-list-set)
(print " o: " o-list... | (define-library (ai)
(import (otus lisp)
(scheme dynamic-bindings))
(export
unhash
new-creature)
(begin
(define unique-id (make-parameter 1))
(define (generate-unique-id)
(let ((id (unique-id)))
(unique-id (+ id 1))
id))
(define (horizontal-bresenham x1 y1 x2 y2 dk at)
ass... |
72be56094f9bcb05af1d5fa59bd774870714a954b7142b25ac026cdecb1a8ede | green-labs/ppx_ts | str_pick.ml | open Ppxlib
open Parsetree
open Ast_helper
open Utils
(* pick attribute mapper *)
let make_structure_item name loc manifest kind suffix payload =
match (manifest, kind) with
(* type t *)
| None, Ptype_abstract -> fail loc "Can't handle the unspecified type"
| None, Ptype_record decls -> (
let { pexp_desc... | null | https://raw.githubusercontent.com/green-labs/ppx_ts/9fe8ad9e76dcd5be4335ade31bc68d3f638839d7/src/str_pick.ml | ocaml | pick attribute mapper
type t
Check whether labels in payload are matched to labels in decls | open Ppxlib
open Parsetree
open Ast_helper
open Utils
let make_structure_item name loc manifest kind suffix payload =
match (manifest, kind) with
| None, Ptype_abstract -> fail loc "Can't handle the unspecified type"
| None, Ptype_record decls -> (
let { pexp_desc } = get_expression_from_payload payload in... |
b55bf98e3a61d18cb6274653234e16afd4e83ed63479b188cd801842afa4ce93 | hyperfiddle/electric | user_main.cljc | (ns user-main
(:require contrib.uri ; data_readers
contrib.ednish
[hyperfiddle.api :as hf]
[hyperfiddle.electric :as e]
[hyperfiddle.electric-dom2 :as dom]
[hyperfiddle.history :as history]
[user.demo-index :as demos]
user.demo-1-hel... | null | https://raw.githubusercontent.com/hyperfiddle/electric/e65045f4c8950da98f436391997903385e6bea2e/src-dev/user_main.cljc | clojure | data_readers
this demo require `npm install`
::demos/demo-10k-dom-elements user.demo-10k-dom-elements/App ; todo too slow to unmount, crashes
css fixes
`user.demo-reagent-interop/ReagentInterop (when react-available user.demo-reagent-interop/ReagentInterop)
::demos/dennis-exception-leak wip.dennis-exception-leak/App... | (ns user-main
contrib.ednish
[hyperfiddle.api :as hf]
[hyperfiddle.electric :as e]
[hyperfiddle.electric-dom2 :as dom]
[hyperfiddle.history :as history]
[user.demo-index :as demos]
user.demo-1-hello-world
user.demo-2-toggle... |
15496b0ddd5226bf3740253aefd72c34597ba87efdf4d63bf1b0f84feac41bde | SquidDev/illuaminate | html.ml | module Emitters = struct
open Format
let skip _ () = ()
let attr out (k, v) = CCString.replace ~sub:"\"" ~by:""" v |> fprintf out " %s=\"%s\"" k
let attrs = pp_print_list ~pp_sep:skip attr
end
module Make (X : sig
type event_handler
end) =
struct
type event_handler = X.event_handler
type node =
... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/06a499ba9ac51b605249add0ab2987d1868f8836/src/html/html.ml | ocaml | module Emitters = struct
open Format
let skip _ () = ()
let attr out (k, v) = CCString.replace ~sub:"\"" ~by:""" v |> fprintf out " %s=\"%s\"" k
let attrs = pp_print_list ~pp_sep:skip attr
end
module Make (X : sig
type event_handler
end) =
struct
type event_handler = X.event_handler
type node =
... | |
03cac07dab5da7ca6a6c68b010a726aa35745d784ce36ba97ff5ec4be4b0a572 | erikd/haskell-big-integer-experiment | WordArray.hs | {-# LANGUAGE BangPatterns, Strict #-}
module Common.GHC.Integer.WordArray where
import Control.Monad
import Control.Monad.Primitive
import Data.Primitive
import Common.GHC.Integer.StrictPrim
The ` primitive ` package supports two array types , ` ByteArray ` ( and array of
-- bytes) and `Array a` (an array of boxed... | null | https://raw.githubusercontent.com/erikd/haskell-big-integer-experiment/7841ec3fcc5be219fa16963849bd12137112f8a9/Common/GHC/Integer/WordArray.hs | haskell | # LANGUAGE BangPatterns, Strict #
bytes) and `Array a` (an array of boxed values). Therefore use the former to
on trivial operations like `copyWordArray`.
| allocaWords : Create a temporary array of Word to used for the duration
nothing is written to it os it will actually contain junk data.
# INLINE indexWordAddr ... | module Common.GHC.Integer.WordArray where
import Control.Monad
import Control.Monad.Primitive
import Data.Primitive
import Common.GHC.Integer.StrictPrim
The ` primitive ` package supports two array types , ` ByteArray ` ( and array of
build a ` WordArray ` an array of unboxed ` Word ` values . Benchmarking showe... |
5dfa628cfbd2d71b813be834de33d627bcad2a209a11701e9f4624406293b0f6 | lojic/LearningRacket | day05-toddginsberg.rkt | #lang racket
Modified the solve function to use method vs. my original hash .
(require threading)
(define pattern #px"^(\\d+),(\\d+)\\s+->\\s+(\\d+),(\\d+)$")
(define (make-step p) (/ p (max (abs (real-part p)) (abs (imag-part p)))))
(define input (map (λ (s)
(let* ([ lst (map string->numb... | null | https://raw.githubusercontent.com/lojic/LearningRacket/1133b58c060a6770497fe78dadfdb7c74016942a/advent-of-code-2021/solutions/day05/day05-toddginsberg.rkt | racket | Tests -------------------------------------------------------------------------------------- | #lang racket
Modified the solve function to use method vs. my original hash .
(require threading)
(define pattern #px"^(\\d+),(\\d+)\\s+->\\s+(\\d+),(\\d+)$")
(define (make-step p) (/ p (max (abs (real-part p)) (abs (imag-part p)))))
(define input (map (λ (s)
(let* ([ lst (map string->numb... |
93cb935b902149dfb51e3307b62521e11361a68fba8f0f089c129afd5b540a06 | coccinelle/coccinelle | stdlib.mli | external raise : exn -> 'a = "%raise"
external raise_notrace : exn -> 'a = "%raise_notrace"
val invalid_arg : string -> 'a
val failwith : string -> 'a
exception Exit
exception Match_failure of (string * int * int)
exception Assert_failure of (string * int * int)
exception Invalid_argument of string
exception Failur... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/5448bb2bd03491ffec356bf7bd6ddcdbf4d36bc9/bundles/stdcompat/stdcompat-current/interfaces/4.12/stdlib.mli | ocaml | external raise : exn -> 'a = "%raise"
external raise_notrace : exn -> 'a = "%raise_notrace"
val invalid_arg : string -> 'a
val failwith : string -> 'a
exception Exit
exception Match_failure of (string * int * int)
exception Assert_failure of (string * int * int)
exception Invalid_argument of string
exception Failur... | |
4e46616b0032bc8b667a6c425ebf8aeb0b676c57c06479a6ed7593671d890e6d | rain-1/single_cream | mutable-table.scm | (define tbl (box '()))
(define (add-entry! k v)
(let ((res (assoc k (unbox tbl))))
(if res
(set-cdr! res v)
(set-box! tbl (cons (cons k v) (unbox tbl))))))
(define (show-it)
(print 'table)
(for-each print (unbox tbl))
(newline))
(begin
(show-it)
(add-entry! 'foo 55)
(show-it)
(add-entry! 'bar 6... | null | https://raw.githubusercontent.com/rain-1/single_cream/f8989fde4bfcffe0af7f6ed5916885446bf40124/t/scheme-tests/mutable-table.scm | scheme | (define tbl (box '()))
(define (add-entry! k v)
(let ((res (assoc k (unbox tbl))))
(if res
(set-cdr! res v)
(set-box! tbl (cons (cons k v) (unbox tbl))))))
(define (show-it)
(print 'table)
(for-each print (unbox tbl))
(newline))
(begin
(show-it)
(add-entry! 'foo 55)
(show-it)
(add-entry! 'bar 6... | |
d75bd88c41546bded0fd22c2e4019a1ac382ed7ac90ad7767fb39f2bcdeec915 | wireapp/wire-server | Client.hs | {-# LANGUAGE OverloadedStrings #-}
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundati... | null | https://raw.githubusercontent.com/wireapp/wire-server/598c3c7b5c3c80a41c713a8fdb88e6658b2daba0/libs/api-client/src/Network/Wire/Client/API/Client.hs | haskell | # LANGUAGE OverloadedStrings #
This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANT... |
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Network.Wire.Client.API.... |
9376cf8396253080c4264ca318743d36d11d994390a72724c873dd9870938746 | gedge-platform/gedge-platform | rabbit_auth_backend_ldap_app.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_auth_backend_ldap_app).
-behaviou... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap_app.erl | erlang |
Dummy supervisor to get this application behaviour working
---------------------------------------------------------------------------- | 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 ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_auth_backend_ldap_app).
-behaviour(appl... |
239e13225db9f4db92354fb3ce5fa0eda943d0639a6a408e5dc9ce0fd78c65c0 | NaOHman/XMonadPlus | Decoration.hs | # LANGUAGE DeriveDataTypeable , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , PatternGuards , TypeSynonymInstances #
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.Decoration
Copyright : ( c ) 2007 , 2009 Jan Vornberger
Lice... | null | https://raw.githubusercontent.com/NaOHman/XMonadPlus/1495e102ae3304817d1897a393e1f31fef71d41f/xmonad-contrib-darcs/XMonad/Layout/Decoration.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Layout.Decoration
Maintainer :
Stability : unstable
Portability : unportable
A layout modifier and a class for easily creating decorated
layouts.
----------------------------------------------------------... | # LANGUAGE DeriveDataTypeable , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , PatternGuards , TypeSynonymInstances #
Copyright : ( c ) 2007 , 2009 Jan Vornberger
License : BSD - style ( see xmonad / LICENSE )
module XMonad.Layout.Decoration
decoration
, Theme (..), defaultT... |
d0c33124fa4edcccf9388d37295997182d7468548f4ca114250f03980e83cfa2 | eutro/mc-clojure-lib | clojure_lib_init_fabric.clj | (ns eutros.clojurelib.fabric.clojure-lib-init-fabric
(:require eutros.clojurelib.lib.core))
(when-not *compile-files*
(load "/eutros/clojurelib/fabric/fabric_core"))
(gen-class
:name eutros.clojurelib.fabric.CljLibInitFabric
:implements [net.fabricmc.api.ModInitializer]
:main false)
(defn -onInitialize [_]... | null | https://raw.githubusercontent.com/eutro/mc-clojure-lib/2e0e8b018ca474a63d46f92c34085d0f095bf5c0/src/main/clojure/eutros/clojurelib/fabric/clojure_lib_init_fabric.clj | clojure | NO-OP | (ns eutros.clojurelib.fabric.clojure-lib-init-fabric
(:require eutros.clojurelib.lib.core))
(when-not *compile-files*
(load "/eutros/clojurelib/fabric/fabric_core"))
(gen-class
:name eutros.clojurelib.fabric.CljLibInitFabric
:implements [net.fabricmc.api.ModInitializer]
:main false)
(defn -onInitialize [_]... |
5a017dfeaff6058cdaf88d98bee50359376d39e0fcb6498936c1b63135014272 | gonimo/gonimo | Audio.hs | # LANGUAGE CPP #
{-# LANGUAGE GADTs #-}
module Gonimo.Client.JS.Audio where
import Control.Concurrent.MVar
import GHCJS.DOM.AudioBufferSourceNode (AudioBufferSourceNode (..))
import Language.Javascript.JSaddle (JSVal, eval, jsg)
import qualified Language.Javascript.JSaddle as J... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/front/src/Gonimo/Client/JS/Audio.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE CPP #
module Gonimo.Client.JS.Audio where
import Control.Concurrent.MVar
import GHCJS.DOM.AudioBufferSourceNode (AudioBufferSourceNode (..))
import Language.Javascript.JSaddle (JSVal, eval, jsg)
import qualified Language.Javascript.JSaddle as JS hiding (MonadJSM,
... |
15a28693467bf1d67cc425ffa6f477c38c8ae7ab9831ff2491482cc09ed6b71b | Clozure/ccl-tests | pairlis.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Apr 20 07:30:55 2003
;;;; Contains: Tests of PAIRLIS
(in-package :cl-test)
(compile-and-load "cons-aux.lsp")
Pairlis has two legal behaviors : the pairs
;; can be prepended in the same order, or in the
reverse order , that they appear in the first
two a... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/pairlis.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of PAIRLIS
can be prepended in the same order, or in the
Error tests | Author :
Created : Sun Apr 20 07:30:55 2003
(in-package :cl-test)
(compile-and-load "cons-aux.lsp")
Pairlis has two legal behaviors : the pairs
reverse order , that they appear in the first
two arguments
(defun my-pairlis (x y &optional alist)
(if (null x)
alist
(acons (car x) (car y)
... |
2f499295f56d27ca65747b58ca5ec4cdd412da941a90533b902fa11f26bc1521 | koto-bank/lbge | package.lisp | (defpackage :lbge.engine
(:use :cl :lbge.asset :lbge.hash)
(:local-nicknames (:beacon :lbge.beacon)
(:image :lbge.image)
(:asset :lbge.asset)
(:m :lbge.math)
(:render :lbge.render)
(:render-back :lbge.render.backend)... | null | https://raw.githubusercontent.com/koto-bank/lbge/6be4b3212ea87288b1ee2a655e9a1bb30a74dd27/src/engine/package.lisp | lisp | Engine beacons
Renderer | (defpackage :lbge.engine
(:use :cl :lbge.asset :lbge.hash)
(:local-nicknames (:beacon :lbge.beacon)
(:image :lbge.image)
(:asset :lbge.asset)
(:m :lbge.math)
(:render :lbge.render)
(:render-back :lbge.render.backend)... |
86801553a145ad3c4579632fadc9b90a55633384d5a31ea8aa71f51906ee3a23 | jackfirth/rebellion | regular-immutable-sorted-map.rkt | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[sorted-map->immutable-sorted-map (-> sorted-map? immutable-sorted-map?)]))
(module+ private-for-rebellion-only
(provide
(contract-out
[regular-immutable-sorted-map? predicate/c]
[make-regular-immutable-sorted-map
(-> (se... | null | https://raw.githubusercontent.com/jackfirth/rebellion/206ced365b07d1c6da5dcbe93f892fbb9bd7ba72/collection/private/regular-immutable-sorted-map.rkt | racket | @----------------------------------------------------------------------------------------------------
TODO: check for duplicate keys. | #lang racket/base
(require racket/contract/base)
(provide
(contract-out
[sorted-map->immutable-sorted-map (-> sorted-map? immutable-sorted-map?)]))
(module+ private-for-rebellion-only
(provide
(contract-out
[regular-immutable-sorted-map? predicate/c]
[make-regular-immutable-sorted-map
(-> (se... |
97109fdb2b5197e9e2adb5d83b37dba66393c313df19b69a2acffb6e358c7cf3 | gregwebs/Shelly.hs | LiftedSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module LiftedSpec ( liftedSpec ) where
import Test.HUnit hiding (path)
import Test.Hspec
import Shelly.Lifted
import Control.Concurrent.Async.Lifted
import Control.Monad.Trans.Maybe
import Test.Hspec.Contrib.HUnit ()
liftedSpec :: Spec
liftedSpec =
describe "basic actions" $
... | null | https://raw.githubusercontent.com/gregwebs/Shelly.hs/f11409cf565b782f05576a489b137fd98d3877ca/test/src/LiftedSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
module LiftedSpec ( liftedSpec ) where
import Test.HUnit hiding (path)
import Test.Hspec
import Shelly.Lifted
import Control.Concurrent.Async.Lifted
import Control.Monad.Trans.Maybe
import Test.Hspec.Contrib.HUnit ()
liftedSpec :: Spec
liftedSpec =
describe "basic actions" $
it "lifted sub" $ do
xs <- sh... |
a96432ba3960de34456f1d44d3d460017ece91b858b08f225d1e3fb4d5c079c5 | tmaciejewski/see | see_db.erl | -module(see_db).
-export([start/0, stop/0]).
start() ->
application:start(see_db).
stop() ->
application:stop(see_db).
| null | https://raw.githubusercontent.com/tmaciejewski/see/3838d06c291fe486a5b3634f1fedcd82336ed985/apps/db/src/see_db.erl | erlang | -module(see_db).
-export([start/0, stop/0]).
start() ->
application:start(see_db).
stop() ->
application:stop(see_db).
| |
015cd0116f752db032c37ec1c1eb1404b5bda83f8976deb6a605f2fa842ac1b4 | reactiveml/rml | dom.mli | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/js-of-ocaml/lib/dom.mli | ocaml | Will not happen
* Specification of [Node] objects.
* Specification of [Attr] objects.
* Specification of [NamedNodeMap] objects.
* Specification of [Element] objects.
* Specification of [Text] objects.
* Specification of [DocumentFragment] objects.
* Specification of [Document] objects.
* [insertBefore p n c] ... | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ... |
f6959602ca995c7903b4e634c531a789c01893bf111da566fe64568ec6e5885a | rabbitmq/rabbitmq-stomp | rabbit_stomp_processor.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-stomp/925d78e2c7152723a68452b38fbc2713d2797b8b/src/rabbit_stomp_processor.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
see rabbitmq/ra... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights re... |
c24bccb84adce0b3358d03b3cdf18fb1e9099cbaf9ce5ffc85482b8845e4b2cb | chef/chef-server | bksw_app.erl | 2019 Chef Software , Inc. All Rights Reserved
@author < >
%%
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 y... | null | https://raw.githubusercontent.com/chef/chef-server/31977d245971748468476bc326ed08ce8e1fdffe/src/bookshelf/src/bksw_app.erl | erlang |
contributor license agreements. See the NOTICE file distributed
with this work for additional information regarding copyright
License, Version 2.0 (the "License"); you may not use this file
the License at -2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS ... | 2019 Chef Software , Inc. All Rights Reserved
@author < >
Licensed to the Apache Software Foundation ( ASF ) under one or more
ownership . The ASF licenses this file to you under the Apache
except in compliance with the License . You may obtain a copy of
distributed under the License is distributed ... |
05983de3983f1ffc88651caaa076ac96a064158bfc06f6c7661ff2ce25c12b05 | 15Galan/asignatura-204 | BinarySearchTree.hs | -------------------------------------------------------------------------------
-- Binary Search Trees
--
Data Structures . en Informática . UMA .
, 2011
-------------------------------------------------------------------------------
module BinarySearchTree
( BST
, empty
, isEmpty
, insert
, search
... | null | https://raw.githubusercontent.com/15Galan/asignatura-204/894f33ff8e0f52a75d8f9ff15155c656f1a8f771/Ex%C3%A1menes/2012/Febrero/Haskell/BinarySearchTree.hs | haskell | -----------------------------------------------------------------------------
Binary Search Trees
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
----------------------------------------------------------------... | Data Structures . en Informática . UMA .
, 2011
module BinarySearchTree
( BST
, empty
, isEmpty
, insert
, search
, isElem
, delete
, inOrder
, preOrder
, postOrder
, minim
, maxim
, isBST
, mkBST
, pretty
, drawOnWith
) where
import Data.Maybe(isJust)
import DrawTrees
impo... |
a9eced67e69fa6667331be9c2f5e9b0ccaf1d2a5b46ce041dca19e5a5e0b4da4 | Tehnix/Cminusminus-compiler | Common.hs | module Render.Common where
import Data.Foldable
import Data.List.NonEmpty
import Text.PrettyPrint
import Parser.Common
import Parser.Literal
tabWidth :: Int
tabWidth = 2
newline :: Doc
newline = text "\n"
newlineSemi :: Doc
newlineSemi = semi <> newline
newlineBraces :: Int -> Doc -> Doc
newlineBraces n d =
lbr... | null | https://raw.githubusercontent.com/Tehnix/Cminusminus-compiler/4bf4cff03ce6f8decb676a28348d6d51d9e2513d/src/Render/Common.hs | haskell | # OVERLAPPABLE # | module Render.Common where
import Data.Foldable
import Data.List.NonEmpty
import Text.PrettyPrint
import Parser.Common
import Parser.Literal
tabWidth :: Int
tabWidth = 2
newline :: Doc
newline = text "\n"
newlineSemi :: Doc
newlineSemi = semi <> newline
newlineBraces :: Int -> Doc -> Doc
newlineBraces n d =
lbr... |
3b8ee2f9a07b8efee03dba0bdaa83cbdfc76fa940eea84b16f2ac7a0cd7b5a22 | ploeh/advent-of-code-2017 | Solution.hs | # LANGUAGE NumDecimals #
module Day22 where
import Data.List (unfoldr)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Prelude hiding (Right, Left)
Model
data Direction = Up | Left | Down | Right deriving (Show, Eq)
data Node = Node Integer Integer deriving (Show, Eq, Ord)
data Infect... | null | https://raw.githubusercontent.com/ploeh/advent-of-code-2017/e0f66bf2735cf1e37fbcf001296fdda8df3ece8c/Day22/Solution.hs | haskell | Instead of just returning the next state, this function also returns the new
node state. This is is mostly a performance consideration. While it's
added, that's slower than simply returning this data as it's being decided.
Not the prettiest design, but it gets the job done...
Parsing
Tests | # LANGUAGE NumDecimals #
module Day22 where
import Data.List (unfoldr)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Prelude hiding (Right, Left)
Model
data Direction = Up | Left | Down | Right deriving (Show, Eq)
data Node = Node Integer Integer deriving (Show, Eq, Ord)
data Infect... |
0807da37dc0ef589d6f8977ec7b81bc7c485bc055b9049ef9271f46386562456 | overtone/overtone | at_at.clj | (ns overtone.at-at
(:import [java.util.concurrent ScheduledThreadPoolExecutor TimeUnit ThreadPoolExecutor]
[java.io Writer])
(:require [clojure.pprint]))
(defrecord PoolInfo [thread-pool jobs-ref id-count-ref])
(defrecord MutablePool [pool-atom])
(defrecord RecurringJob [id created-at ms-period initial-... | null | https://raw.githubusercontent.com/overtone/overtone/02f8cdd2817bf810ff390b6f91d3e84d61afcc85/src/overtone/at_at.clj | clojure | => pool is reset gracefully
=> pool is reset forcefully"
return true if success | (ns overtone.at-at
(:import [java.util.concurrent ScheduledThreadPoolExecutor TimeUnit ThreadPoolExecutor]
[java.io Writer])
(:require [clojure.pprint]))
(defrecord PoolInfo [thread-pool jobs-ref id-count-ref])
(defrecord MutablePool [pool-atom])
(defrecord RecurringJob [id created-at ms-period initial-... |
6f380bec732393290ab6cf14446ec19c5127c8d928271241aa89bf96cfdbce39 | christiaanb/DE1-Cyclone-II-FPGA-Board-Support-Package | Keyboard.hs | module Keyboard where
import CLaSH.Prelude
import Keyboard.CaptureKey
import Keyboard.ConstantKey
keyboard kbdata = ((dig3,dig2,dig1,dig0),key)
where
(dig3,dig2,scancode,byteRead) = captureKey kbdata
(dig1,dig0,key) = constantKey (scancode,byteRead)
| null | https://raw.githubusercontent.com/christiaanb/DE1-Cyclone-II-FPGA-Board-Support-Package/4f816856bcda122b5a93a05e99bbab9a5c0e51d2/Keyboard.hs | haskell | module Keyboard where
import CLaSH.Prelude
import Keyboard.CaptureKey
import Keyboard.ConstantKey
keyboard kbdata = ((dig3,dig2,dig1,dig0),key)
where
(dig3,dig2,scancode,byteRead) = captureKey kbdata
(dig1,dig0,key) = constantKey (scancode,byteRead)
| |
9f964ee85a1383879bd73f04169670467f559aa60ef92873d829716619746e31 | rd--/hsc3 | zOsc.help.hs | zOsc
let modulator = sinOsc kr 0.1 0
freq = lfNoise2Id 'α' kr 10 `in_exprange` (10,1000)
formantfreq = lfNoise2Id 'β' kr 1 `in_exprange` (700,1500)
shape = modulator
mode = sinOsc kr 0.91 0
sig = X.zOsc ar freq formantfreq shape mode
in pan2 sig modulator 0.1
| null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/zOsc.help.hs | haskell | zOsc
let modulator = sinOsc kr 0.1 0
freq = lfNoise2Id 'α' kr 10 `in_exprange` (10,1000)
formantfreq = lfNoise2Id 'β' kr 1 `in_exprange` (700,1500)
shape = modulator
mode = sinOsc kr 0.91 0
sig = X.zOsc ar freq formantfreq shape mode
in pan2 sig modulator 0.1
| |
be6f7f120e3f20e5341e3092a4cafc1a6cf302bb4260fb68aba326dfaf20000e | pyr/net | pipeline.clj | (ns net.ty.pipeline
"Utilities to build and work with Netty pipelines"
(:import java.util.concurrent.TimeUnit
java.nio.ByteOrder
io.netty.util.CharsetUtil
io.netty.channel.Channel
io.netty.channel.ChannelHandler
io.netty.channel.ChannelInboundHandlerAdapter
... | null | https://raw.githubusercontent.com/pyr/net/a2120bf61b6fd480707ea6b217545b3d640288d0/src/net/ty/pipeline.clj | clojure | (ns net.ty.pipeline
"Utilities to build and work with Netty pipelines"
(:import java.util.concurrent.TimeUnit
java.nio.ByteOrder
io.netty.util.CharsetUtil
io.netty.channel.Channel
io.netty.channel.ChannelHandler
io.netty.channel.ChannelInboundHandlerAdapter
... | |
8a457424c2af64ef4116ef8ec549ed60bdcfb29cd7a817570f1958aeb64b3aeb | input-output-hk/hydra | Encoding.hs | # OPTIONS_GHC -fno - specialize #
{-# OPTIONS_HADDOCK prune #-}
| An on - chain implementation of [ RFC 8949]( - editor.org / rfc / ): Concise Binary Object Representation ( CBOR ) .
--
-- This is generally something one would want to avoid as the memory and CPU
budgets on - chain are heavily limited . However , ... | null | https://raw.githubusercontent.com/input-output-hk/hydra/c041a8a77a773882d27986d467f603ccdb4dcfd7/plutus-cbor/src/Plutus/Codec/CBOR/Encoding.hs | haskell | # OPTIONS_HADDOCK prune #
This is generally something one would want to avoid as the memory and CPU
needs to serialise some higher level data-type into binary. This library
provides an efficient way of doing it.
= How to use
Let's start with some relatively simple type:
@
, baz :: Integer
}
@
From ther... | # OPTIONS_GHC -fno - specialize #
| An on - chain implementation of [ RFC 8949]( - editor.org / rfc / ): Concise Binary Object Representation ( CBOR ) .
budgets on - chain are heavily limited . However , there are scenarios when one
data
{ bar : :
simple record of unary constructors , so using a 2 - tu... |
485e74f6b64559d45011450234ce03f227ba37f5becf66abb11fb9c3ec05e11e | johnstonskj/rml-core | results.rkt | #lang racket
;;
;; Racket Machine Learning - K-NN.
;;
~ 2018 .
(provide
(contract-out
[result-matrix?
(-> any/c boolean?)]
[make-result-matrix
(-> data-set? result-matrix?)]
[record-result
(-> result-matrix? any/c any/c result-matrix?)]
[result-value
(-> result-matrix? any/c any/c integer?)... | null | https://raw.githubusercontent.com/johnstonskj/rml-core/8f3ca8b47e552911054f2aa12b296dbf40dad637/rml/results.rkt | racket |
Racket Machine Learning - K-NN.
---------- Requirements
---------- Internal types
---------- Implementation | #lang racket
~ 2018 .
(provide
(contract-out
[result-matrix?
(-> any/c boolean?)]
[make-result-matrix
(-> data-set? result-matrix?)]
[record-result
(-> result-matrix? any/c any/c result-matrix?)]
[result-value
(-> result-matrix? any/c any/c integer?)]
[result-matrix-formatted
(-> resu... |
d95c7b42de9965b4622b86737f54786a7654323626575ed717e55d29b38deec5 | DaMSL/K3 | TypeError.hs | {-|
A module defining a monad in which general typing errors can be raised.
-}
module Language.K3.TypeSystem.Monad.Iface.TypeError
( TypeErrorI(..)
) where
import Language.K3.TypeSystem.Error
-- |A monad in which general typing errors can be raised. A minimal complete
-- implementation consists of just @typeError... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Monad/Iface/TypeError.hs | haskell | |
A module defining a monad in which general typing errors can be raised.
|A monad in which general typing errors can be raised. A minimal complete
implementation consists of just @typeError@. | module Language.K3.TypeSystem.Monad.Iface.TypeError
( TypeErrorI(..)
) where
import Language.K3.TypeSystem.Error
class TypeErrorI m where
internalTypeError :: InternalTypeError -> m a
typeError :: TypeError -> m a
internalTypeError = typeError . InternalError
|
2dbd69e4bfb364f1591512676d9bb6e2b025c5743d5c99eec22616999a6cc54c | emqx/emqx | emqx_run_sh.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/test/emqx_run_sh.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_run_sh).
-export([do/2]).
do(Command, Options0) ->
Options =
Options0 +... |
b5f9351961932625f6344ec3cac8270f777993c2b58b36e54320c6847b43b325 | ds-wizard/engine-backend | List_POST.hs | module Wizard.Api.Handler.DocumentTemplateDraft.File.List_POST where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Shared.Model.DocumentTemplate.DocumentTemplate
import Shared.Model.DocumentTemplate.DocumentTemplateJM ()
import Wizard.Api.Handler.Common
import Wiz... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/DocumentTemplateDraft/File/List_POST.hs | haskell | module Wizard.Api.Handler.DocumentTemplateDraft.File.List_POST where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Shared.Model.DocumentTemplate.DocumentTemplate
import Shared.Model.DocumentTemplate.DocumentTemplateJM ()
import Wizard.Api.Handler.Common
import Wiz... | |
04a72cbfaee54c77d5e4226b6b9ea51130f3df90a6dd4b29caafaad40a5ee290 | wenkokke/dep2con | Binary.hs | module Language.Structure.Binary where
import Prelude hiding (Word)
import qualified Data.Tree as Rose
import Language.POS (POS)
import Language.Word (Word (Word))
import Text.Printf (printf)
-- | Constituency trees are rose trees with POS tags in their nodes and words in
-- ... | null | https://raw.githubusercontent.com/wenkokke/dep2con/eec24bc8e1a4db5b1582f0fd933ab02f8a6ce041/src/Language/Structure/Binary.hs | haskell | | Constituency trees are rose trees with POS tags in their nodes and words in
their leaves.
|Get the left-most index from a constituency tree.
|Compute a node with the correct left/right.
|Convert a given tree to an instance of `Data.Tree` and draw it. | module Language.Structure.Binary where
import Prelude hiding (Word)
import qualified Data.Tree as Rose
import Language.POS (POS)
import Language.Word (Word (Word))
import Text.Printf (printf)
data Tree
= Leaf Word
| Node POS Tree Tree
deriving (Eq)
instance Ord Tree whe... |
98538f4081c61aaa63194e4ec00ecf08b1e6faf89846d4a3222bafe1865681ce | dagit/logict-sequence | Test.hs | {-# language CPP #-}
{-# language ScopedTypeVariables #-}
# language DeriveGeneric #
{-# language FlexibleContexts #-}
{-# language UndecidableInstances #-}
# language GeneralizedNewtypeDeriving #
{-# language DeriveTraversable #-}
# language StandaloneDeriving #
# language ViewPatterns #
module Main(main) where
impor... | null | https://raw.githubusercontent.com/dagit/logict-sequence/dd265230574b3cf563b92cdcd85c6924784e2f57/test/Test.hs | haskell | # language CPP #
# language ScopedTypeVariables #
# language FlexibleContexts #
# language UndecidableInstances #
# language DeriveTraversable #
| A generic "container" functor. We can use this with `Free` to get
Note: size
I've found it quite difficult to get a good range of
sizes for SeqT TestM Int using the bas... | # language DeriveGeneric #
# language GeneralizedNewtypeDeriving #
# language StandaloneDeriving #
# language ViewPatterns #
module Main(main) where
import Control.Monad.IO.Class (liftIO)
import Hedgehog (MonadGen, Range)
import qualified Hedgehog as HH
import qualified Hedgehog.Gen as Gen
import Hedgehog.Range (Size)... |
f91fed1f7fe1bd0dfeabfd50dbdcc2851b2c50ba7392294807a8d96c098235f3 | feliciofilipe/university | Probability.hs |
Credits : , and ,
FUNCTIONAL PEARLS : Probabilistic functional programming in Haskell ,
, 2006
DOI : 10.1017 / S0956796805005721
module Probability where
import qualified System.Random
import Data.List (sort,sortBy,transpose)
import Control.Monad
import System.IO.Unsafe (unsaf... | null | https://raw.githubusercontent.com/feliciofilipe/university/f2b5a00921c97d48033edbe21488ac829927caae/2nd/CP/src/Probability.hs | haskell | TO DO:
* create export list
* extend Dist by a constructor for continuous distributions:
C (Float -> Float)
* prove correctness of |||
------------
----- end
----------------------------------------------------------------------------
CONTENTS:
0 AUXILIARY DEFINITIONS
-------------------------------------... |
Credits : , and ,
FUNCTIONAL PEARLS : Probabilistic functional programming in Haskell ,
, 2006
DOI : 10.1017 / S0956796805005721
module Probability where
import qualified System.Random
import Data.List (sort,sortBy,transpose)
import Control.Monad
import System.IO.Unsafe (unsaf... |
582b4d94cb52506e41da56f29399f2a968c46975987e171a956718e08a95d2a5 | exercism/racket | example.rkt | #lang racket
(provide leap-year?)
(define (leap-year? year)
(and (= (modulo year 4) 0)
(or (not (= (modulo year 100) 0))
(= (modulo year 400) 0))))
| null | https://raw.githubusercontent.com/exercism/racket/d171a5fb3595cc09d171051a3f5ef45caedad020/exercises/practice/leap/.meta/example.rkt | racket | #lang racket
(provide leap-year?)
(define (leap-year? year)
(and (= (modulo year 4) 0)
(or (not (= (modulo year 100) 0))
(= (modulo year 400) 0))))
| |
76df39e106184aabc7b55b7c1787aa218409918d05fd62368942dc076479d21d | DKurilo/battleship | Core.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Api.Core where
import Api.Services.GameService
import Control.Lens
import Snap.Core
import Snap.Snaplet
import qualified Data.ByteString.Char8 as B
data Api = Api { _gameService :: Snaplet GameService }
makeLenses ''Api
apiRoutes :: [(B.ByteStr... | null | https://raw.githubusercontent.com/DKurilo/battleship/09e30547a209ffc12f9a9668ebdca489a0a3adfc/server/src/Api/Core.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Api.Core where
import Api.Services.GameService
import Control.Lens
import Snap.Core
import Snap.Snaplet
import qualified Data.ByteString.Char8 as B
data Api = Api { _gameService :: Snaplet GameService }
makeLenses ''Api
apiRoutes :: [(B.ByteString, Handler b Api ())]
apiRoutes =... |
aa3ea683d81b48c447f3e181562c8fba061272a16fcb64d857d8a4cb93ce7d20 | fstamour/breeze | reader.lisp | (in-package #:common-lisp-user)
(uiop:define-package #:breeze.reader
(:documentation
"Parser for common lisp that doesn't lose any information.
This package also re-exports symbols from breeze.syntax-tree.")
(:use :cl)
(:use-reexport #:breeze.syntax-tree)
(:import-from #:alexandria
#:if... | null | https://raw.githubusercontent.com/fstamour/breeze/e76ce087980fdb30a4124c77177d06748ad5c73e/src/reader.lisp | lisp | (log:config '(breeze reader) :debug)
TODO Find a better name... anything better
Define a class representing the "parse result client"
TODO We should probably rename this, to avoid confusion with the
node's source, which is a pair of index into this string.
(dbg "~&make-expression result: ~s children: ~s source: ~... | (in-package #:common-lisp-user)
(uiop:define-package #:breeze.reader
(:documentation
"Parser for common lisp that doesn't lose any information.
This package also re-exports symbols from breeze.syntax-tree.")
(:use :cl)
(:use-reexport #:breeze.syntax-tree)
(:import-from #:alexandria
#:if... |
c63f956fcf273a7ee90ea790409c2ab6a38af70c08f84429cef77f8886b0fe79 | input-output-hk/ouroboros-network | Client.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
-- | A view of the chain synchronisation protocol from the point of view of the
-- client.
--
-- This provides a view that uses less complex types and should be easier to
-- use th... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2793b6993c8f6ed158f432055fa4ef581acdb661/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ChainSync/Client.hs | haskell | # LANGUAGE DataKinds #
| A view of the chain synchronisation protocol from the point of view of the
client.
This provides a view that uses less complex types and should be easier to
use than the underlying typed protocol itself.
For execution, a conversion into the typed protocol is provided.
* Proto... | # LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
module Ouroboros.Network.Protocol.ChainSync.Client
ChainSyncClient (..)
, ClientStIdle (..)
, ClientStNext (..)
, ClientStIntersect (..)
, chainSyncClientPeer
, chainSyncClientNull
, mapChainSyncClient... |
e7ce911b2e00634555a6e95ae246ad0312138641e70e7b8d499472eb7e121e68 | borodust/claw-olm | x86_64-pc-linux-gnu.lisp | (uiop:define-package :%olm (:use))
(uiop:define-package :claw-olm-bindings~pristine (:use :cl))
(common-lisp:in-package :claw-olm-bindings~pristine)
(defparameter %olm::+message-type-message+ 1)
(defparameter %olm::+message-type-pre-key+ 0)
(defparameter %olm::+h-+ nil)
(defparameter %olm::+inbound-group-session-h-... | null | https://raw.githubusercontent.com/borodust/claw-olm/0adcbc0f5f8e51d5bb94d7e5827b63129f536a38/bindings/x86_64-pc-linux-gnu.lisp | lisp | (uiop:define-package :%olm (:use))
(uiop:define-package :claw-olm-bindings~pristine (:use :cl))
(common-lisp:in-package :claw-olm-bindings~pristine)
(defparameter %olm::+message-type-message+ 1)
(defparameter %olm::+message-type-pre-key+ 0)
(defparameter %olm::+h-+ nil)
(defparameter %olm::+inbound-group-session-h-... | |
30e24387003dcdc6aa6d095a855e7a6ed64d762604025e3c95b63ce2ddd80401 | kblake/erlang-chat-demo | element_sparkline.erl | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (element_sparkline).
-include_lib ("wf.hrl").
-compile(export_all).
%% @doc
Usage : # sparkline { values=[1 , 2 , 5 , 6 , 10 , 9 ] }
reflect() -> record_info(fields, sparkline).
render_el... | null | https://raw.githubusercontent.com/kblake/erlang-chat-demo/6fd2fce12f2e059e25a24c9a84169b088710edaf/apps/nitrogen/src/elements/other/element_sparkline.erl | erlang | @doc
Options is a list of {Key,Value} tuples | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (element_sparkline).
-include_lib ("wf.hrl").
-compile(export_all).
Usage : # sparkline { values=[1 , 2 , 5 , 6 , 10 , 9 ] }
reflect() -> record_info(fields, sparkline).
render_element(Re... |
ae25986b8caf89b6e829604dcd6105131f82cc786b9d9e05ff3eebc97318e333 | potapenko/playphraseme-site | config.clj | (ns playphraseme.app.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate] :as mount]))
(defstate env :start (load-config
:merge
[(args)
(source/from-system-props)
... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/clj/playphraseme/app/config.clj | clojure | (ns playphraseme.app.config
(:require [cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate] :as mount]))
(defstate env :start (load-config
:merge
[(args)
(source/from-system-props)
... | |
16b3375d1798eb3974b60274b851218bd78f06804d2528e0d84ae220a3a3f5d7 | mransan/raft-udp | raft_utl_counter.mli | (** Counter utility for measuring rate of a recurrent event *)
(** {2 Types} *)
module Counter : sig
type t
(** Counter type. This is a mutable data structure *)
* { 2 Creators }
val make: ?initial_counter:int -> unit -> t
(** [make ~initial_counter ()] creates a new counter. *)
(** {2 Mutator... | null | https://raw.githubusercontent.com/mransan/raft-udp/ffa307fa6d8bdaa3133f3cc66149ac7dfda5fc7c/src/utl/raft_utl_counter.mli | ocaml | * Counter utility for measuring rate of a recurrent event
* {2 Types}
* Counter type. This is a mutable data structure
* [make ~initial_counter ()] creates a new counter.
* {2 Mutators}
* [incr counter] increments the counter with a single tick
* [set counter v] set the counter value to [v].
* {2 Accessors}
* [r... |
module Counter : sig
type t
* { 2 Creators }
val make: ?initial_counter:int -> unit -> t
val incr : t -> unit
val set : t -> int -> unit
val rate : t -> float
val value : t -> int
module Perf : sig
type t
val make : unit -> t
val add : t -> float -> unit
val... |
6228ea440ce2641216710a02954ab8b9062e350a3bfdd62ab3222ebdf35be1dc | KeliLanguage/compiler | Env.hs | module Env where
import Text.Parsec.Pos
import Prelude hiding (id)
import Data.Map.Ordered
import qualified Ast.Verified as V
data KeliSymbol
= KeliSymFunc
[V.FuncSignature]
| KeliSymGlobalConst
V.StringToken -- this field is used for enhancing DuplicatedIdentifiers error message... | null | https://raw.githubusercontent.com/KeliLanguage/compiler/5cc5f2314fa0e0863a49c504cdb115d799f382f6/src/Env.hs | haskell | this field is used for enhancing DuplicatedIdentifiers error message
this field is used for enhancing DuplicatedIdentifiers error message | module Env where
import Text.Parsec.Pos
import Prelude hiding (id)
import Data.Map.Ordered
import qualified Ast.Verified as V
data KeliSymbol
= KeliSymFunc
[V.FuncSignature]
| KeliSymGlobalConst
V.Type
| KeliSymLocalConst
V.Type
| KeliSymType ... |
63370601d8f8aaf2a56a0f352e7d31e07a541d82d9781f1acc4c8d1aec103232 | incoherentsoftware/defect-process | Main.hs | module Main
( main
) where
import AppEnv
import Configs
import Game
import Window
main :: IO ()
main = do
cfgs <- mkConfigs
window <- mkWindow cfgs
appEnvData <- mkAppEnvData window cfgs
runGame appEnvData window
| null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/15f2569e7d0e481c2e28c0ca3a5e72d2c049b667/src/Main.hs | haskell | module Main
( main
) where
import AppEnv
import Configs
import Game
import Window
main :: IO ()
main = do
cfgs <- mkConfigs
window <- mkWindow cfgs
appEnvData <- mkAppEnvData window cfgs
runGame appEnvData window
| |
d515519d7393eb7387e636982e743967c5ec998404451f84fa2ef82e9202cf70 | opencog/opencog | behavior.scm | ;
; behvaior.scm
;
Configurable robot behavior tree , implemented in Atomese .
;
Defines a set of behaviors that express 's personality . The
; currently-defined behaviors include acknowledging new people who enter
; the room, rotating attention between multiple occupants of the room,
; falling asleep when bored (... | null | https://raw.githubusercontent.com/opencog/opencog/53f2c2c8e26160e3321b399250afb0e3dbc64d4c/opencog/eva/behavior/behavior.scm | scheme |
behvaior.scm
currently-defined behaviors include acknowledging new people who enter
the room, rotating attention between multiple occupants of the room,
falling asleep when bored (i.e. the room is empty), and acting
surprised when someone leaves unexpectedly.
------
Run the main loop:
(run)
Pause the ma... | Configurable robot behavior tree , implemented in Atomese .
Defines a set of behaviors that express 's personality . The
HOWTO :
The current OpenPsi framework allows much more general and flexible
The OpenPsi engine could be ( should be ? ) updated to perform fuzzy
one exact match can be made . If nothin... |
b19ad8ec01f60ef50f3196388cb70c8563e3ad55d20c362f04b1918f6b5dc3e9 | modular-macros/ocaml-macros | t071-boolnot.ml | open Lib;;
if not true then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST1
10 BOOLNOT
11 BRANCHIFNOT 18
13 GETGLOBAL Not_found
15 MAKEBLOCK1 0
17 RAISE
18 ATOM0
19 SETGLOBAL T... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/tool-ocaml/t071-boolnot.ml | ocaml | open Lib;;
if not true then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST1
10 BOOLNOT
11 BRANCHIFNOT 18
13 GETGLOBAL Not_found
15 MAKEBLOCK1 0
17 RAISE
18 ATOM0
19 SETGLOBAL T... | |
af7648a086f116967b69da2398ad787e50f5c6e699eb5a0325d8ff81e67d83ee | hexlet-basics/exercises-clojure | test.clj | (ns hello-world-test
(:require [test-helper :refer [assert-output]]))
(assert-output "Hello, World!")
| null | https://raw.githubusercontent.com/hexlet-basics/exercises-clojure/8e1a0f25a1ed7047fe8f9a5b5df2ce3a7bed5e1f/modules/10-basics/10-hello-world/test.clj | clojure | (ns hello-world-test
(:require [test-helper :refer [assert-output]]))
(assert-output "Hello, World!")
| |
65f277501a5b107e19a12f555ad931183cf691d8516525ac8960dd566b5401fe | afiskon/erlang-http-proxy | toppage_handler.erl | -module(toppage_handler).
-export([init/3]).
-export([handle/2]).
-export([terminate/2]).
-type request() :: cowboy_req:req().
-type headers() :: cowboy_http:headers().
-type processor() :: fun((binary()) -> binary()).
-type finalizer() :: fun(() -> binary()).
-type streamfunc() :: fun((any()) -> ok | { error, atom()... | null | https://raw.githubusercontent.com/afiskon/erlang-http-proxy/081b641c914c822c4b77ba685f55a576686ca1fd/src/toppage_handler.erl | erlang | copy-pasted from /usr/lib/erlang/lib/erts-5.9.1/src/zlib.erl
===================================================================
=================================================================== | -module(toppage_handler).
-export([init/3]).
-export([handle/2]).
-export([terminate/2]).
-type request() :: cowboy_req:req().
-type headers() :: cowboy_http:headers().
-type processor() :: fun((binary()) -> binary()).
-type finalizer() :: fun(() -> binary()).
-type streamfunc() :: fun((any()) -> ok | { error, atom()... |
0ddb4a773e22b4d8125010b3b95b9040ac392847393d08276c37a10f126354c6 | monadbobo/ocaml-core | benchmark_primitives.ml | open Core.Std
this benchmarks three different operations versus their corresponding automatically
generated ones : compare , ( < ) , ( =) . There are three tests :
- array of different_values : this produces an array of different values . The size of
the array , called len , depends upon the type bei... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/compare/benchmarks/benchmark_primitives.ml | ocaml | open Core.Std
this benchmarks three different operations versus their corresponding automatically
generated ones : compare , ( < ) , ( =) . There are three tests :
- array of different_values : this produces an array of different values . The size of
the array , called len , depends upon the type bei... | |
3178f060f66e9f679f2f5aea4782af4c0c45a8c927fe549251e5acf9659f2924 | folivetti/Category4Programmers | monadReader.hs | import Control.Monad
import Control.Monad.Reader
data Config = Conf { alg :: String
, thr :: Double
, it :: Int
}
go :: Int -> [Double] -> [Double]
go _ [] = []
go 0 xs = xs
go i (x:xs) = (i' * x) : go (i-1) xs
where i' = fromIntegral i
filterLess t... | null | https://raw.githubusercontent.com/folivetti/Category4Programmers/b002b7eeeddf272ca94bd2467db535e0ad268176/Monad/monadReader.hs | haskell | where choice a | a == "f2" = f2'' xs
| otherwise = f3'' xs | import Control.Monad
import Control.Monad.Reader
data Config = Conf { alg :: String
, thr :: Double
, it :: Int
}
go :: Int -> [Double] -> [Double]
go _ [] = []
go 0 xs = xs
go i (x:xs) = (i' * x) : go (i-1) xs
where i' = fromIntegral i
filterLess t... |
8d1e54403d49208dba21eaf8a899a9f263ebd1e6f7f0e89013efaa436c047148 | sgbj/MaximaSharp | troper.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The data in this file contains enhancments. ;;;;;
;;; ;;;;;
... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/troper.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
The data in this file contains enhancments. ;;;;;
;;;;;
; ; ; ;
All rights reserved ;;;;;
; ;
this form num... |
(in-package :maxima)
(macsyma-module troper)
The basic OPERATORS properties translators .
(def%tr mminus (form)
(setq form (translate (cadr form)))
(cond ((numberp (cdr form))
`(,(car form) . ,(- (cdr form))))
((eq '$fixnum (car form)) `($fixnum - ,(cdr form)))
((eq '$float (car form)) `($float - ,(cdr fo... |
3db148e4f88626a88f3c47cc84713d633a8dc9a7ce96173cddc48a2054d74364 | 2600hz/kazoo | kzs_loadtest.erl | %%%-----------------------------------------------------------------------------
( C ) 2011 - 2020 , 2600Hz
%%% @doc load testing various caching strategies
%%%
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 c... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_data/src/kzs_loadtest.erl | erlang | -----------------------------------------------------------------------------
@doc load testing various caching strategies
@end
-----------------------------------------------------------------------------
doc_ids_variable_len(_Workers).
fixed number of doc IDs to fetch against
scales doc ids used against wor... | ( C ) 2011 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kzs_loadtest).
-export([start/0, start/1]).
-include("kz_data.hrl").
-dialyzer({'nowarn_function', spaw... |
bfc6df6727c224a49ce87528521a59ee8ac3de96ae5c5ef58497b03952ef112e | astrada/ocaml-extjs | ext_view_AbstractView.mli | * This is an abstract superclass and should not be u ...
{ % < p > This is an abstract superclass and should not be used directly . Please see < a href="#!/api / Ext.view . View " rel="Ext.view . View " class="docClass">Ext.view . View</a>.</p > % }
{% <p>This is an abstract superclass and should not be... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_view_AbstractView.mli | ocaml | * {% <p>Allows addition of behavior after rendering is complete. At this stage the Component’s Element
will have been styled according to the configuration, will have had any configured CSS class
names added, and will be in the configured visibility and the configured enable state.</p> %}
* {% <p>Returns the store... | * This is an abstract superclass and should not be u ...
{ % < p > This is an abstract superclass and should not be used directly . Please see < a href="#!/api / Ext.view . View " rel="Ext.view . View " class="docClass">Ext.view . View</a>.</p > % }
{% <p>This is an abstract superclass and should not be... |
e5a1fc580a78a5e27ef7b32d73c246f1fb4b04bbcf226e2b2d004d684c5db063 | webyrd/n-grams-for-synthesis | srfi-130.scm | (module srfi-130 ()
(import scheme)
(import (only chicken include error))
(import (only chicken open-output-string get-output-string))
(export string-cursor? string-cursor-start string-cursor-end
string-cursor-prev string-cursor-next
string-cursor-forward string-cursor-back
string-... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-130/foof/srfi-130.scm | scheme | (module srfi-130 ()
(import scheme)
(import (only chicken include error))
(import (only chicken open-output-string get-output-string))
(export string-cursor? string-cursor-start string-cursor-end
string-cursor-prev string-cursor-next
string-cursor-forward string-cursor-back
string-... | |
ea9dc81e6b5d281c5da069a10fc8cb87be33287aa93a8b4f73ab7234ea3442a2 | brown131/clmath | defpackage.lisp | (in-package :common-lisp-user)
(defpackage :clmath
(:use :cl)
(:export
;; consts
#:velocity-of-light
#:electronic-charge
#:Plancks-constant
#:Avagadros-number
#:atomic-mass-unit
#:electron-rest-mass
#:proton-rest-mass
#:magnetic-flux-quantum
#:Boltzmanns-constant
#:grav... | null | https://raw.githubusercontent.com/brown131/clmath/0a27ac0be3eeeddd3aa5ebe5945d54ca402c57af/defpackage.lisp | lisp | consts
dft
matrix
FUNCTIONS:
basic
#:fraction
#:entier
#:square-root
bessel
beta
ellip
erf
extfcn
gamma
INTEGRATE:
integr
runge
NUMBER:
combin
factor
fib
mod
fit
fmfp
#:fmfp
regres
STATIS:
binomial
poisson
bisection
falsep | (in-package :common-lisp-user)
(defpackage :clmath
(:use :cl)
(:export
#:velocity-of-light
#:electronic-charge
#:Plancks-constant
#:Avagadros-number
#:atomic-mass-unit
#:electron-rest-mass
#:proton-rest-mass
#:magnetic-flux-quantum
#:Boltzmanns-constant
#:gravitational-cons... |
f17d605e83c3fd31fba2835bdadbe1e939afbbbb061b4782df602dd18d7883a1 | headwinds/reagent-reframe-material-ui | xhrio.cljs | (ns ajax.xhrio
(:require goog.net.EventType
goog.net.ErrorCode
[goog.net.XhrIo :as xhr]
[goog.net.XhrManager :as xhrm]
[goog.Uri :as uri]
[goog.json :as goog-json]
[goog.events :as events]
[ajax.protocols :refer [AjaxImpl AjaxRequest
... | null | https://raw.githubusercontent.com/headwinds/reagent-reframe-material-ui/8a6fba82a026cfedca38491becac85751be9a9d4/resources/public/js/out/ajax/xhrio.cljs | clojure | (ns ajax.xhrio
(:require goog.net.EventType
goog.net.ErrorCode
[goog.net.XhrIo :as xhr]
[goog.net.XhrManager :as xhrm]
[goog.Uri :as uri]
[goog.json :as goog-json]
[goog.events :as events]
[ajax.protocols :refer [AjaxImpl AjaxRequest
... | |
2b34dc36fd02173f612d7ff74df9b5803315e7128085a4bb28969ac278e442c5 | vyorkin/haskbot | Context.hs | module Haskbot.Interpreter.Context
( defaultModules
, defaultQualifiedModules
, defaultPackages
) where
-- | Modules which we should load by default.
-- These are of course whitelisted.
defaultModules :: [String]
defaultModules =
[ "Prelude"
, "Data.Function"
, "Control.Applicative"
, "Control.Monad"
... | null | https://raw.githubusercontent.com/vyorkin/haskbot/efc22a16da229efd7728cfbb1cea823cc4b3fcd5/src/Haskbot/Interpreter/Context.hs | haskell | | Modules which we should load by default.
These are of course whitelisted.
| Whitelist of modules which should be safe to import
functions from, but which we don't want to import by default. | module Haskbot.Interpreter.Context
( defaultModules
, defaultQualifiedModules
, defaultPackages
) where
defaultModules :: [String]
defaultModules =
[ "Prelude"
, "Data.Function"
, "Control.Applicative"
, "Control.Monad"
, "Control.Monad.Cont"
, "Control.Monad.Except"
, "Control.Monad.Fix"
, "Co... |
305ddef0b9b729129c90a2cff233bfd75bc5b62e235ef63d96a07c6a8f901fc7 | kennknowles/aspcc | session_perl.ml |
* ASPCC module with fake ASP intrinsics objects intended for output to
the command line
the command line *)
*
This file has a few methods from ASP intrinsic objects that are
meaningful on the command line , and it is meant to be a ' mockup '
of the real ASP objects , for testing purposes
For example ... | null | https://raw.githubusercontent.com/kennknowles/aspcc/951a91cc21e291b1d3c750bbbca7fa79209edd08/runtime/modules/session_perl.ml | ocaml | * TODO: move this into vbTools or something
* For flagging unimplemented functions
let perlhash =
perl
match session_cookie with
| Some c -> "tie %session, 'Apache::Session::File', " ^ session_cookie
| None -> "tie %session, 'Apache::Session::File', undef"
... |
* ASPCC module with fake ASP intrinsics objects intended for output to
the command line
the command line *)
*
This file has a few methods from ASP intrinsic objects that are
meaningful on the command line , and it is meant to be a ' mockup '
of the real ASP objects , for testing purposes
For example ... |
37fba97cbe7cfef563e1ea606bd40734237d39013221b2b538c6ee231e971c76 | patrickt/possession | Types.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TypeFamilies #
module Raw.Types
( module Raw.Types
, module Raw.Id
) where
import Apecs.Exts
import Dhall.TH
import Optics.TH (makeFieldLabelsNoPr... | null | https://raw.githubusercontent.com/patrickt/possession/7dd830117508f7e5ed003bb0c157e202321ec1ff/src/Raw/Types.hs | haskell | # LANGUAGE OverloadedStrings #
| # LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
# LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TypeFamilies #
module Raw.Types
( module Raw.Types
, module Raw.Id
) where
import Apecs.Exts
import Dhall.TH
import Optics.TH (makeFieldLabelsNoPrefix)
import Raw.Id
import Data.Sto... |
268700bf93dc07bb6b6e8f40ddb162b883c32c8787cca7f16b56f2736e5b8126 | carl-eastlund/dracula | test-dict.rkt | #lang scheme
(require "checks.ss"
"../dict.ss")
(provide dict-suite)
(define (dict=? a b)
(and (subdict? a b)
(subdict? b a)))
(define (subdict? a b)
(for/and ([(k v) (in-dict a)])
(and (dict-has-key? b k)
(equal? (dict-ref b k) v))))
(define (check/dict a b) (check dict=? a b))
(... | null | https://raw.githubusercontent.com/carl-eastlund/dracula/a937f4b40463779246e3544e4021c53744a33847/private/scheme/test/test-dict.rkt | racket | #lang scheme
(require "checks.ss"
"../dict.ss")
(provide dict-suite)
(define (dict=? a b)
(and (subdict? a b)
(subdict? b a)))
(define (subdict? a b)
(for/and ([(k v) (in-dict a)])
(and (dict-has-key? b k)
(equal? (dict-ref b k) v))))
(define (check/dict a b) (check dict=? a b))
(... | |
f545394895158d6703dac6384304c0922473ca8d4ad7ead16146d6fb7c79eaa5 | ocaml/oasis | DevFilesPlugin.ml | (******************************************************************************)
OASIS : architecture for building OCaml libraries and applications
(* *)
Copyright ( C ) 2011 - 2016 ,
Copyrig... | null | https://raw.githubusercontent.com/ocaml/oasis/3d1a9421db92a0882ebc58c5df219b18c1e5681d/src/plugins/extra/devfiles/DevFilesPlugin.ml | ocaml | ****************************************************************************
This library is free software; you can redistribute it and/or modify it
under the t... | OASIS : architecture for building OCaml libraries and applications
Copyright ( C ) 2011 - 2016 ,
Copyright ( C ) 2008 - 2011 , OCamlCore SARL
the Free Software Foundation ; either version 2.1 of the License , or ( at
You s... |
2776108811ef2914dcc8147dec55df2c4330b48b5256d2d119005be2a760eb19 | ixiongdi/sicp | code.scm | (define (suqare x) (* x x))
(define (sum-of-square x y) (+ (square x) (square y)))
(define (sum-of-max a b c)
(cond ((<= a b c) (sum-of-square b c))
((<= b c a) (sum-of-square c a))
((<= c a b) (sum-of-square a b))
)
)
(sum-of-max 1 2 3)
| null | https://raw.githubusercontent.com/ixiongdi/sicp/d591b2e57d325d975bc00460af84c5face94d1a3/exercises/1.3/code.scm | scheme | (define (suqare x) (* x x))
(define (sum-of-square x y) (+ (square x) (square y)))
(define (sum-of-max a b c)
(cond ((<= a b c) (sum-of-square b c))
((<= b c a) (sum-of-square c a))
((<= c a b) (sum-of-square a b))
)
)
(sum-of-max 1 2 3)
| |
f173b86a1b1848ba4063d232e9f8a570a9e00a2f178f2cc4e3c7a770beb8ab68 | cljfx/cljfx | popup_control.clj | (ns cljfx.fx.popup-control
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.fx.popup-window :as fx.popup-window])
(:import [javafx.scene.control PopupControl]
[javafx.stage PopupWindow$A... | null | https://raw.githubusercontent.com/cljfx/cljfx/543f7409290051e9444771d2cd86dadeb8cdce33/src/cljfx/fx/popup_control.clj | clojure | overrides
definitions | (ns cljfx.fx.popup-control
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.coerce :as coerce]
[cljfx.fx.popup-window :as fx.popup-window])
(:import [javafx.scene.control PopupControl]
[javafx.stage PopupWindow$A... |
62e80cb31a369ba92196f50e8f9a45d40ba0ed1c6037a824dc88143d9fdb375f | cl-rabbit/cl-bunny | direct-exchange-routing.lisp | (in-package :cl-bunny.examples)
(defun direct-exchange-routing ()
(log:info "=> Direct exchange routing")
(with-connection ("amqp://")
(with-channel ()
(let ((x (exchange.declare "examples.imaging" :auto-delete t))
(q1 (queue.declare :auto-delete t))
(q2 (queue.declare :auto-del... | null | https://raw.githubusercontent.com/cl-rabbit/cl-bunny/6da7fe161efc8d6bb0b8b09ac8efad03553d765c/examples/guides/exchanges/direct-exchange-routing.lisp | lisp | (in-package :cl-bunny.examples)
(defun direct-exchange-routing ()
(log:info "=> Direct exchange routing")
(with-connection ("amqp://")
(with-channel ()
(let ((x (exchange.declare "examples.imaging" :auto-delete t))
(q1 (queue.declare :auto-delete t))
(q2 (queue.declare :auto-del... | |
be0a7cfc007fe3bc0e4ac94fad9c18f0df281e8ceda84c45660133c5f4692307 | lenary/idris-erlang | CodegenErlang.hs | {-# LANGUAGE OverloadedStrings #-}
module IRTS.CodegenErlang (codegenErlang) where
import Idris.Core.TT
import IRTS.Lang
import IRTS.CodegenCommon
import IRTS.Defunctionalise
import Control.Applicative ((<$>))
import Control.Monad.Except
import Con... | null | https://raw.githubusercontent.com/lenary/idris-erlang/4b7c5aab6bcbe66eb76c90d07e358e500d6c05d9/src/IRTS/CodegenErlang.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: Exports
Everything actually happens in `generateErl`. This is just a bit of
glue code.
their filename (without the extension). Given we're making this, we
should be curteous and give coders a warning that this file was
autogenerated, rather than hand-coded.
exportCompileTag
... | module IRTS.CodegenErlang (codegenErlang) where
import Idris.Core.TT
import IRTS.Lang
import IRTS.CodegenCommon
import IRTS.Defunctionalise
import Control.Applicative ((<$>))
import Control.Monad.Except
import Control.Monad.Trans.State
import ... |
ffb87a047d01cf5196a75babc16b47a77ab28b1f5efaa73ddaaeaabf4bdacd73 | RichiH/git-repair | TestConfig.hs | {- Tests the system and generates Build.SysConfig.hs. -}
module Build.TestConfig where
import Utility.Path
import Utility.Monad
import Utility.SafeCommand
import System.IO
import System.FilePath
import System.Directory
type ConfigKey = String
data ConfigValue =
BoolConfig Bool |
StringConfig String |
MaybeString... | null | https://raw.githubusercontent.com/RichiH/git-repair/c61b677e7a67a286df34c0629c52aeae9be9299a/Build/TestConfig.hs | haskell | Tests the system and generates Build.SysConfig.hs.
Tests that a command is available, aborting if not.
Checks if a command is available by running a command line.
Finds a command, either in PATH or perhaps in a sbin directory not in
- PATH. If it's in PATH the config is set to just the command name,
- but if i... |
module Build.TestConfig where
import Utility.Path
import Utility.Monad
import Utility.SafeCommand
import System.IO
import System.FilePath
import System.Directory
type ConfigKey = String
data ConfigValue =
BoolConfig Bool |
StringConfig String |
MaybeStringConfig (Maybe String) |
MaybeBoolConfig (Maybe Bool)
dat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.