_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 |
|---|---|---|---|---|---|---|---|---|
1903c0e8a9e98ab79a4be41986ffa72b960590bde49488bbd611d8a1de33ba08 | exoscale/pithos | cors.clj | (ns io.pithos.cors
(:refer-clojure :exclude [replace])
(:require [clojure.data.xml :refer [parse-str emit-str indent-str]]
[clojure.string :refer [upper-case lower-case replace join split]]
[clojure.tools.logging :refer [debug]]
[clojure.zip :refer [xml-zip ... | null | https://raw.githubusercontent.com/exoscale/pithos/54790f00fbfd330c6196d42e5408385028d5e029/src/io/pithos/cors.clj | clojure | (ns io.pithos.cors
(:refer-clojure :exclude [replace])
(:require [clojure.data.xml :refer [parse-str emit-str indent-str]]
[clojure.string :refer [upper-case lower-case replace join split]]
[clojure.tools.logging :refer [debug]]
[clojure.zip :refer [xml-zip ... | |
e12f1eefe5b61593093a9856ed2f5ba4cd1aa4aa4e0d19b14f871097411a1966 | haskus/packages | Vector.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeApplications #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# LANGUAGE AllowAmbiguo... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-binary/src/lib/Haskus/Binary/Vector.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE BangPatterns #
| Vector with size in the type
| Vector with type-checked size
| Return the buffer backing the vector
| Reverse a vector
| Offset of the i-th element in a stored vector
| /O(1)/ Index safely into the vector using a type level index.
| Convert a list into a vector... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeApplications #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# LANGUAGE AllowAmbiguo... |
f2994f1fcf9d8c782a8c9b9e8641f3f2456ca7dd609e32738d1cecdebee2ee65 | amnh/poy5 | kolmoGrammar.ml | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
(* *)
(* This program is free softwa... | null | https://raw.githubusercontent.com/amnh/poy5/da563a2339d3fa9c0110ae86cc35fad576f728ab/src/kolmoGrammar.ml | ocaml |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This progra... | POY 5.1.1 . A phylogenetic analysis program using Dynamic Homologies .
Copyright ( C ) 2014 , , , Ward Wheeler ,
and the American Museum of Natural History .
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... |
f68f33c5c2bfb56cda82c16603042804b82f5bc0df8755ff352cf4be9989272b | thheller/shadow-arborist | fragments.cljs | (ns shadow.arborist.fragments
(:require
[shadow.arborist.protocols :as p]
[shadow.arborist.common :as common]
[shadow.arborist.components :as comp]))
(defonce fragment-cache-ref (atom {}))
(defn ^:dev/before-load clear-fragments! []
(reset! fragment-cache-ref {}))
(defn array-equiv [a b]
(let [al (... | null | https://raw.githubusercontent.com/thheller/shadow-arborist/39aef8d4361005f3217dc9bab1862aebc56d5990/src/main/shadow/arborist/fragments.cljs | clojure | sometimes need to keep roots and elements in sync
impl decides what to update, no need to compare
FIXME: only necessary because of top level text nodes which aren't in nodes
called from macro
FIXME: should maybe take ::document from env
not sure under which circumstance this would ever need a different document... | (ns shadow.arborist.fragments
(:require
[shadow.arborist.protocols :as p]
[shadow.arborist.common :as common]
[shadow.arborist.components :as comp]))
(defonce fragment-cache-ref (atom {}))
(defn ^:dev/before-load clear-fragments! []
(reset! fragment-cache-ref {}))
(defn array-equiv [a b]
(let [al (... |
37973ae6e14eb2fa52f70c53f0b0ac48e29e8ba272f45cbb65166f3f869ed418 | suhdonghwi/nuri | BuilderInternal.hs | module Haneul.BuilderInternal where
import Control.Lens (makeLenses)
import qualified Data.Set.Ordered as S (OSet, empty)
import Haneul.Constant (ConstTable)
import Text.Megaparsec.Pos (Pos, mkPos)
data BuilderInternal = BuilderInternal
{ _internalConstTable :: ConstTable,
_internalDepth :: Word8,
_internal... | null | https://raw.githubusercontent.com/suhdonghwi/nuri/337550e3d50c290144df905ea3f189e9af6123c2/src/Haneul/BuilderInternal.hs | haskell | module Haneul.BuilderInternal where
import Control.Lens (makeLenses)
import qualified Data.Set.Ordered as S (OSet, empty)
import Haneul.Constant (ConstTable)
import Text.Megaparsec.Pos (Pos, mkPos)
data BuilderInternal = BuilderInternal
{ _internalConstTable :: ConstTable,
_internalDepth :: Word8,
_internal... | |
2991e786d621df0f12c653923836136141af4841d4b13425914684d79b3868d4 | ghc/ghc | Profiling.hs | {-# LANGUAGE OverloadedStrings #-}
module GHC.StgToJS.Profiling
( initCostCentres
, emitCostCentreDecl
, emitCostCentreStackDecl
, enterCostCentreFun
, enterCostCentreThunk
, setCC
, pushRestoreCCS
, jCurrentCCS
, jCafCCS
, jSystemCCS
, costCentreLbl
, costCentreStackLbl
, singletonCCSLbl
,... | null | https://raw.githubusercontent.com/ghc/ghc/cc25d52e0f65d54c052908c7d91d5946342ab88a/compiler/GHC/StgToJS/Profiling.hs | haskell | # LANGUAGE OverloadedStrings #
* Predicates
* helpers
------------------------------------------------------------------------------
Initialization
------------------------------------------------------------------------------
Entering to cost-centres
top-level function, nothing to do
-----------------------------... |
module GHC.StgToJS.Profiling
( initCostCentres
, emitCostCentreDecl
, emitCostCentreStackDecl
, enterCostCentreFun
, enterCostCentreThunk
, setCC
, pushRestoreCCS
, jCurrentCCS
, jCafCCS
, jSystemCCS
, costCentreLbl
, costCentreStackLbl
, singletonCCSLbl
, ccsVarJ
, profiling
, ifProfil... |
5a124a770bd4f23d4b767eefb0137e3c2d1ba680ac3efc81ef953f0f63f23545 | Practical-Formal-Methods/adiff | Ultimate.hs | MIT License
--
Copyright ( c ) 2018
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
-- to use, copy, modify, merge, pu... | null | https://raw.githubusercontent.com/Practical-Formal-Methods/adiff/c18872faf3e31572437686d766f9972e00274588/adiff/src/ADiff/Verifier/Ultimate.hs | haskell |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice... | MIT License
Copyright ( c ) 2018
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS... |
da34b82a96ac27cb44ed9aa84fd057c07fa439dfe72fdb9e5ddca05862858c3d | qfpl/reflex-realworld-example | Users.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeOperators #
module Common.Conduit.Api.Users
( UsersApi
, module Namespace
, module User
, module Users
) where
import Servant.API ((:<|>), (:>),
... | null | https://raw.githubusercontent.com/qfpl/reflex-realworld-example/aca3125e036fbb5edd3a20d0e5a13ec73eaa6fcb/common/src/Common/Conduit/Api/Users.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeOperators #
module Common.Conduit.Api.Users
( UsersApi
, module Namespace
, module User
, module Users
) where
import Servant.API ((:<|>), (:>),
... | |
5ac8fc6e437ee760a99722abe82b6e9427da50ea99ea5bffcb48c3eeab5cd79c | arunisaac/ccwl | capture-output-file-with-parameter-reference.scm | (define extract-specific-file
(command #:inputs (archive #:type File) (extractfile #:type string)
#:run "tar" "--extract" "--file" archive extractfile
#:outputs (extracted-file
#:type File
#:binding '((glob . "$(inputs.extractfile)")))))
(workflow ((a... | null | https://raw.githubusercontent.com/arunisaac/ccwl/22977baf000ff18941eb78dcc300d115667e5ec8/doc/capture-output-file-with-parameter-reference.scm | scheme | (define extract-specific-file
(command #:inputs (archive #:type File) (extractfile #:type string)
#:run "tar" "--extract" "--file" archive extractfile
#:outputs (extracted-file
#:type File
#:binding '((glob . "$(inputs.extractfile)")))))
(workflow ((a... | |
fe55969f7cba4c4440fce9e9a2429587b9dcd6ae0b209c790246b681e1d6253a | wrengr/exact-combinatorics | Binomial.hs | {-# OPTIONS_GHC -Wall -fwarn-tabs #-}
----------------------------------------------------------------
-- 2021.10.17
-- |
-- Module : Math.Combinatorics.Exact.Binomial
Copyright : Copyright ( c ) 2011 - -2021 wren
License : BSD
-- Maintainer : ... | null | https://raw.githubusercontent.com/wrengr/exact-combinatorics/b58165df12fae0caecc68c3b27344cd69cef32c1/src/Math/Combinatorics/Exact/Binomial.hs | haskell | # OPTIONS_GHC -Wall -fwarn-tabs #
--------------------------------------------------------------
2021.10.17
|
Module : Math.Combinatorics.Exact.Binomial
Maintainer :
Stability : experimental
Portability : Haskell98
Binomial coefficients (<>), aka t... | Copyright : Copyright ( c ) 2011 - -2021 wren
License : BSD
module Math.Combinatorics.Exact.Binomial (choose) where
import Data.List (foldl')
import Math.Combinatorics.Exact.Primes (primes)
< >
Some identities , but not really material for RULES :
n ` choose ` 0 ... |
5a21c35e660eeda76d98f3afa368011832b63a2faafdd949f2d1ff2a5af6cd72 | gethop-dev/payments.stripe | webhook.clj | 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 /
(ns dev.gethop.payments.stripe.webhook
(:require [dev.gethop.payments.core :as core])
(:import [com.stripe.net Webhook$Signature]
... | null | https://raw.githubusercontent.com/gethop-dev/payments.stripe/2379ba790123d7380ffc397cf4920cbe2936f840/src/dev/gethop/payments/stripe/webhook.clj | clojure | file, You can obtain one at / | 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
(ns dev.gethop.payments.stripe.webhook
(:require [dev.gethop.payments.core :as core])
(:import [com.stripe.net Webhook$Signature]
[dev.gethop.payments.stripe.core... |
8c8891c2a3ebef6a001782e46de5ca3fd85de4c4c1e0a55d66ee1fe99b5917cb | shayan-najd/QFeldspar | GADTHigherOrder.hs | module Tests.GADTHigherOrder where
import QFeldspar.MyPrelude
import QFeldspar.Expression.GADTHigherOrder
import QFeldspar.Variable.Typed
import QFeldspar.Conversion as E
import QFeldspar.Expression.Conversions.Evaluation.GADTHigherOrder ()
import qualified QFeldspar.Expression.GADTValue as FGV
import QFeldspar.Type.... | null | https://raw.githubusercontent.com/shayan-najd/QFeldspar/ed60ce02794a548833317388f6e82e2ab1eabc1c/Tests/GADTHigherOrder.hs | haskell | module Tests.GADTHigherOrder where
import QFeldspar.MyPrelude
import QFeldspar.Expression.GADTHigherOrder
import QFeldspar.Variable.Typed
import QFeldspar.Conversion as E
import QFeldspar.Expression.Conversions.Evaluation.GADTHigherOrder ()
import qualified QFeldspar.Expression.GADTValue as FGV
import QFeldspar.Type.... | |
6b43a33f8d613de16075140efb8cc40adb8497c6183576b370136afa42bfe8d2 | manuel-serrano/hop | utils.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / js2scheme / utils.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/cbb98da5c9ea8e6e3836f0a5908e5bf782419683/js2scheme/utils.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Utility functions */
*===========================... | * serrano / prgm / project / hop / hop / js2scheme / utils.scm * /
* Author : * /
* Creation : Fri Sep 13 16:59:06 2013 * /
* Last change : Sat Feb 12 12:27:35 2022 ( serrano ) * /
* Copy... |
f01d8ed831ad5970656b035ddd9e2a4357333876b6dbb7b8877e2d5010c0690d | grisp/rebar3_grisp | rebar3_grisp_util.erl | -module(rebar3_grisp_util).
% API
-export([apps/1]).
-export([debug/1]).
-export([debug/2]).
-export([info/1]).
-export([info/2]).
-export([console/1]).
-export([console/2]).
-export([warn/1]).
-export([warn/2]).
-export([error/1]).
-export([error/2]).
-export([abort/1]).
-export([abort/2]).
-export([sh/1]).
-export([... | null | https://raw.githubusercontent.com/grisp/rebar3_grisp/b984690b56b6706ef102fa4ab422cb37bdad2fa5/src/rebar3_grisp_util.erl | erlang | API
--- API -----------------------------------------------------------------------
TODO: Remove
--- Internal ------------------------------------------------------------------ | -module(rebar3_grisp_util).
-export([apps/1]).
-export([debug/1]).
-export([debug/2]).
-export([info/1]).
-export([info/2]).
-export([console/1]).
-export([console/2]).
-export([warn/1]).
-export([warn/2]).
-export([error/1]).
-export([error/2]).
-export([abort/1]).
-export([abort/2]).
-export([sh/1]).
-export([sh/2])... |
a3c3d12f818cec7f17ac5ccb01df4de0681b9b165f42fd6df9473ccd3452ee02 | mtolly/onyxite-customs | DWI.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ViewPatterns #-}
module Onyx.DDR.DWI where
import Control.Monad (forM, guard)
import Data.Char (isSpace)
... | null | https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/DDR/DWI.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE PatternSynonyms #
# LANGUAGE ViewPatterns #
note, several file paths like banner/bg/audio are expected to be named matching the .dwi.
normal .sm import will look for those
initial bpm
TODO add DOUBLE/COUPLE/SOLO
hoping the division brackets can't be nested
Results ... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Onyx.DDR.DWI where
import Control.Monad (forM, guard)
import Data.Char (isSpace)
import qualified Data.EventList.Absolute.TimeBody as ATB
import qualified Data.EventList.Relative.TimeBod... |
a4c3761018191d44c07881b661320099f3b5927dce858116a878f92acefa6545 | blt/locker | lk_proc.erl | -module(lk_proc).
-behaviour(gen_server).
-export([
init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3
]).
-type tref() :: timer:tref() | infinity.
-record(state, {
abs_size = 3 :: pos_integer(),
consumed_... | null | https://raw.githubusercontent.com/blt/locker/afd6ec88f15167305dad3cb132c90e39390522ba/src/lk_proc.erl | erlang | ===================================================================
API
===================================================================
===================================================================
gen_server callbacks
===================================================================
lock setting
... | -module(lk_proc).
-behaviour(gen_server).
-export([
init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3
]).
-type tref() :: timer:tref() | infinity.
-record(state, {
abs_size = 3 :: pos_integer(),
consumed_... |
95bcaa207993d5e1f861d2bc5e051dcdf18caf9012634101854cdd9a9abcc8dc | expipiplus1/vulkan | XR_KHR_composition_layer_cube.hs | {-# language CPP #-}
-- | = Name
--
XR_KHR_composition_layer_cube - instance extension
--
-- = Specification
--
-- See
-- <#XR_KHR_composition_layer_cube XR_KHR_composition_layer_cube>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
7
--
-- = Revision
--
8
--
-- = Ex... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/openxr/src/OpenXR/Extensions/XR_KHR_composition_layer_cube.hs | haskell | # language CPP #
| = Name
= Specification
See
<#XR_KHR_composition_layer_cube XR_KHR_composition_layer_cube>
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
= See Also
= Document Notes
For more information, see th... | XR_KHR_composition_layer_cube - instance extension
7
8
- Requires OpenXR 1.0
' CompositionLayerCubeKHR '
module OpenXR.Extensions.XR_KHR_composition_layer_cube ( CompositionLayerCubeKHR(..)
, KHR_composition_layer_cube_SPEC_VERSION
... |
eb68cf5311268756030128fe054ab09dd7a6308be1a1f0bd092b1c15fb1ceb2f | c-cube/trustee | cbor_pack.mli |
(** Cbor-pack *)
(** CBOR value.
Compatible with the "CBOR.Simple" module. *)
type cbor =
[ `Array of cbor list
| `Bool of bool
| `Bytes of string
| `Float of float
| `Int of int
| `Map of (cbor * cbor) list
| `Null
| `Simple of int
| `Tag of int * cbor
| `Text of string
| `Undefined ]
typ... | null | https://raw.githubusercontent.com/c-cube/trustee/3cce2f89860146b167b59046088111d5e3a15ca8/src/core/cbor_pack.mli | ocaml | * Cbor-pack
* CBOR value.
Compatible with the "CBOR.Simple" module.
heap
key
* Memoized encoder using a key for finding if an entry exists
for this value
* Same as {!decode_string} but can raise
@raise Failure if decoding failed. |
type cbor =
[ `Array of cbor list
| `Bool of bool
| `Bytes of string
| `Float of float
| `Int of int
| `Map of (cbor * cbor) list
| `Null
| `Simple of int
| `Tag of int * cbor
| `Text of string
| `Undefined ]
type t = {
}
type cbor_pack = t
module Enc : sig
type encoder
type ptr = cbor
... |
8a8116a4d288148d13a9d9f798c3a9e75ba5279fec487b1406eaf00cf73b1cc0 | johnlawrenceaspden/hobby-code | kalman-filter-1.clj | ;; Kalman Filtering I - How to take an average
;; Use scheme-like defines
(defmacro define [var expr]
(cond (symbol? var) `(let [tmp# ~expr] (def ~var tmp#) tmp#)
(list? var) `(defn ~(first var) ~(into [] (rest var)) ~expr)))
Imagine you 've got a car battery , which has been sitting in a cupboard for... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/kalman-filter-1.clj | clojure | Kalman Filtering I - How to take an average
Use scheme-like defines
It's in a nice stable state, and will contain some charge.
But you're measuring the voltage with a dodgy voltmeter, which gives a different answer every time you try it.
-> #'user/random-error
-> #'user/get-reading
-> 11.797335826782009
As you ca... |
(defmacro define [var expr]
(cond (symbol? var) `(let [tmp# ~expr] (def ~var tmp#) tmp#)
(list? var) `(defn ~(first var) ~(into [] (rest var)) ~expr)))
Imagine you 've got a car battery , which has been sitting in a cupboard for a few months .
The voltage is a real thing . Imagine it 's 12.4 volts... |
f019e43104aa496bbd46e83bd08c1e40c841721fd6633ddcd178f85cb641998c | GaloisInc/json | GenericTest.hs | # LANGUAGE DeriveDataTypeable , ExtendedDefaultRules , EmptyDataDecls #
module Main where
import Text.JSON.Generic
import Data.Word
import Data.Int
data Foo = Foo { a :: Int, b :: Bool, c :: Baz } | None
deriving (Typeable, Data, Show, Eq)
data Baz = Baz Int
deriving (Typeable, Data, Show, Eq)
data Bar = Int... | null | https://raw.githubusercontent.com/GaloisInc/json/329bbce8fd68a04a5377f48102c37d28160b246b/tests/GenericTest.hs | haskell | x == viaJSON x | # LANGUAGE DeriveDataTypeable , ExtendedDefaultRules , EmptyDataDecls #
module Main where
import Text.JSON.Generic
import Data.Word
import Data.Int
data Foo = Foo { a :: Int, b :: Bool, c :: Baz } | None
deriving (Typeable, Data, Show, Eq)
data Baz = Baz Int
deriving (Typeable, Data, Show, Eq)
data Bar = Int... |
16097f0d77eaa4c0bacac07794d86856bb6670404404b0bf754e48e8f495a34b | falgon/htcc | CompilationState.hs | |
Module : Htcc . Utils . CompilationState
Description : Utilities
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
General - purpose utilities
Module : Htcc.Utils.CompilationState
Description : Utilities
Copyright : (c) ... | null | https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/Utils/CompilationState.hs | haskell | | The state type handled during compilation.
It has informations required during the compilation process and input data consumed.
| `itemsP` peeks at items from input data
Defines information updates by providing a function that
# INLINE itemsC #
| `itemsC` consumes at items from input data.
Defines information u... | |
Module : Htcc . Utils . CompilationState
Description : Utilities
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
General - purpose utilities
Module : Htcc.Utils.CompilationState
Description : Utilities
Copyright : (c) ... |
975b4766dd8fa943e8ec01a0c531adc09c79d849d7aa83de22b67e6b23a78a80 | huangz1990/SICP-answers | test-33-length.scm | (load "test-manager/load.scm")
(load "33-length.scm")
(define-each-check
(= (length '())
0)
(= (length (list 1))
1)
(= (length (list 1 2 3))
3)
)
(run-registered-tests)
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/test-33-length.scm | scheme | (load "test-manager/load.scm")
(load "33-length.scm")
(define-each-check
(= (length '())
0)
(= (length (list 1))
1)
(= (length (list 1 2 3))
3)
)
(run-registered-tests)
| |
0da7236d7fadedf5e9c122bac8843ece856ddf2e10e6f38acc228a046bc286f7 | tclem/twirp-haskell | Errors.hs | # LANGUAGE DerivingVia , , ScopedTypeVariables , ViewPatterns #
| Middlewares for handling Twirp error responses .
module Twirp.Middleware.Errors where
import Data.Aeson
import GHC.Generics
import Network.HTTP.Types
import Network.Wai
import qualified Data.ByteString as BS
| A Twirp error that will be sent as a... | null | https://raw.githubusercontent.com/tclem/twirp-haskell/4e23de13a60f317a1d1becc56f9ac3d44299c1c5/src/Twirp/Middleware/Errors.hs | haskell | See:
when they don't already fit that model. | # LANGUAGE DerivingVia , , ScopedTypeVariables , ViewPatterns #
| Middlewares for handling Twirp error responses .
module Twirp.Middleware.Errors where
import Data.Aeson
import GHC.Generics
import Network.HTTP.Types
import Network.Wai
import qualified Data.ByteString as BS
| A Twirp error that will be sent as a... |
7c020ac30831a9eb405430b0609eb73a84b34af79fde84e5edc0f5df6987d8c4 | twittner/zeromq-haskell | display.hs | {-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import System.Exit
import System.IO
import System.Environment
import System.ZMQ4.Monadic
import qualified Data.ByteString.Char8 as CS
main :: IO ()
main = do
args <- getArgs
when (length args < 1) $ do
hPutStrLn stderr "usage: display <address> [<... | null | https://raw.githubusercontent.com/twittner/zeromq-haskell/4d54a7c4be982e62fd695cb41732c6a4ef7661a5/examples/display.hs | haskell | # LANGUAGE OverloadedStrings # | import Control.Monad
import System.Exit
import System.IO
import System.Environment
import System.ZMQ4.Monadic
import qualified Data.ByteString.Char8 as CS
main :: IO ()
main = do
args <- getArgs
when (length args < 1) $ do
hPutStrLn stderr "usage: display <address> [<address>, ...]"
exitFailure... |
97cbab32fae11f133e4042a7265a807572c170c574847ef840eade87a70d76c6 | glossopoeia/glossolalia | colorer.rkt | #lang racket
(require "lexer.rkt" brag/support)
(provide glossolalia-colorer)
(define (glossolalia-colorer port)
(define (handle-lexer-error excn)
(define excn-srclocs (exn:fail:read-srclocs excn))
(srcloc-token (token 'ERROR) (car excn-srclocs)))
(define srcloc-tok
(with-handlers (... | null | https://raw.githubusercontent.com/glossopoeia/glossolalia/2f7d6c2865267aaee4709ca6640243b89ecf6c6d/colorer.rkt | racket | #lang racket
(require "lexer.rkt" brag/support)
(provide glossolalia-colorer)
(define (glossolalia-colorer port)
(define (handle-lexer-error excn)
(define excn-srclocs (exn:fail:read-srclocs excn))
(srcloc-token (token 'ERROR) (car excn-srclocs)))
(define srcloc-tok
(with-handlers (... | |
0b2657d1b6b474d3476c9914d56828d780333ea5dc0be4ba6010c6374d2a5a79 | Zulu-Inuoe/clution | package.lisp | ;;;; See the LICENSE file for licensing information.
(in-package :cl-user)
(defpackage :usocket-test
(:use :common-lisp
:usocket
:regression-test)
(:export #:do-tests
#:run-usocket-tests))
| null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/usocket-0.7.0.1/test/package.lisp | lisp | See the LICENSE file for licensing information. |
(in-package :cl-user)
(defpackage :usocket-test
(:use :common-lisp
:usocket
:regression-test)
(:export #:do-tests
#:run-usocket-tests))
|
332f3275a50b941a676d81d732b87104ecd5e25719a95a48bacffc74ec1c0f08 | ocaml-multicore/ocaml-tsan | unix_unix.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/otherlibs/unix/unix_unix.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
let shell = "/bin/sh"
type error =
Resource deadlock would occur
Invalid argument
Invalid seek e.... |
3bc107c9dbc1e9b3c0b158ae137e3c74d941a1012d26a689cf8e6c0feac0c856 | ropas/sparrow | vis.ml | (***********************************************************************)
(* *)
Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
(* All rights reserved... | null | https://raw.githubusercontent.com/ropas/sparrow/3ec055b8c87b5c8340ef3ed6cde34f5835865b31/src/core/vis.ml | ocaml | *********************************************************************
All rights reserved.
See the LICENSE file for details. ... | Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
This software is distributed under the term of the BSD license .
open Printf
module Json = Yojson.Safe
let opts = []
let usage = ""
let file = ref ""
let args ... |
890e4c0d490830d3e165ad86deaafda264c917141b0cd21caf5dfa5db1785424 | clojureverse/clojurians-log-app | middleware.clj | (ns co.gaiwan.slack.api.middleware)
(defn wrap-rate-limit
"Decorator for slack request functions which handles rate limiting.
The resulting function will automatically block the thread and retry when
necessary."
[f]
(fn invoke [& args]
(try
(apply f args)
(catch clojure.lang.ExceptionInfo ex
... | null | https://raw.githubusercontent.com/clojureverse/clojurians-log-app/708e4630751f79ad9fedcd087ffda428866f64c5/src/co/gaiwan/slack/api/middleware.clj | clojure | (ns co.gaiwan.slack.api.middleware)
(defn wrap-rate-limit
"Decorator for slack request functions which handles rate limiting.
The resulting function will automatically block the thread and retry when
necessary."
[f]
(fn invoke [& args]
(try
(apply f args)
(catch clojure.lang.ExceptionInfo ex
... | |
8e02d9d44414df40b73f4a50f87e89c9014fa1bbd222995b71430fc28fc2477c | samrocketman/home | all-layers-2-canvas-size.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Layers to Image Size 07/05
;; by noclayto <www.gimptalk.com>
;; Resizes All Layers To The Canvas Size
;; This script is mainly for learning. Use at your own risk.
(define (script-fu-Layers-to-Image-Size img drawable)
(let*... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/all-layers-2-canvas-size.scm | scheme |
Layers to Image Size 07/05
by noclayto <www.gimptalk.com>
Resizes All Layers To The Canvas Size
This script is mainly for learning. Use at your own risk. |
(define (script-fu-Layers-to-Image-Size img drawable)
(let* (
(num (car (gimp-image-get-layers img)))
(layers (cadr (gimp-image-get-layers img)))
)
(gimp-image-undo-group-start img)
(while (>= num 1)
(gimp-layer-resize-to-image-size (aref layers (- num 1)))
(set! num (- num 1))
)
(gim... |
731a0fd94ab75643090cdedaee0afb71d4abeefbf3e99594475ccd7e26c1a783 | blambo/accelerate-repa | Index.hs | import Data.Array.Accelerate
import Data.Array.Accelerate.Repa as Repa
main = do
putStrLn $ Repa.run $ unit $ index0
print $ Repa.run $ unit $ index1 5
print $ Repa.run $ unit $ lift Any
| null | https://raw.githubusercontent.com/blambo/accelerate-repa/5ea4d40ebcca50d5b952e8783a56749cea4431a4/examples/Index.hs | haskell | import Data.Array.Accelerate
import Data.Array.Accelerate.Repa as Repa
main = do
putStrLn $ Repa.run $ unit $ index0
print $ Repa.run $ unit $ index1 5
print $ Repa.run $ unit $ lift Any
| |
e4351507f51da0d535343692abbf62bb8736287fc9842b3787fc416dbbb4f883 | idris-lang/Idris-dev | Output.hs | |
Module : . Output
Description : Utilities to display ' internals and other informtation to the user .
License : : The Idris Community .
Module : Idris.Output
Description : Utilities to display Idris' internals and other informtation to the user.
License : BSD3
Maintainer : The Id... | null | https://raw.githubusercontent.com/idris-lang/Idris-dev/a13caeb4e50d0c096d34506f2ebf6b9d140a07aa/src/Idris/Output.hs | haskell | newline translation on the output
stream should take care of this for
| Write a pretty-printed term to the console with semantic coloring
| Pretty-print a collection of overloadings to REPL or IDEMode - corresponds to :t name
| Write pretty-printed output to IDEMode with semantic annotations
| Show an error with ... | |
Module : . Output
Description : Utilities to display ' internals and other informtation to the user .
License : : The Idris Community .
Module : Idris.Output
Description : Utilities to display Idris' internals and other informtation to the user.
License : BSD3
Maintainer : The Id... |
8437b9018eeeaadca234f8251cd19e644a7d198b0ac7870608ab5f041dd6c34a | skanev/playground | 08.scm | EOPL exercise 3.08
;
; Add a numeric equality predicate equal? and numeric order predicates
; greater? and less? to the set of operations in the defined language.
(load-relative "cases/let/env.scm")
; The parser
(define-datatype expression expression?
(const-exp
(num number?))
(minus-exp
(expr expressi... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/03/08.scm | scheme |
Add a numeric equality predicate equal? and numeric order predicates
greater? and less? to the set of operations in the defined language.
The parser
Eval | EOPL exercise 3.08
(load-relative "cases/let/env.scm")
(define-datatype expression expression?
(const-exp
(num number?))
(minus-exp
(expr expression?))
(add-exp
(left expression?)
(right expression?))
(diff-exp
(left expression?)
(right expression?))
(mult-exp
(left expression... |
b3ab025e3d151eb47944f80a5b552d6ceeaff2d71d00fa8055e3baed59a342b9 | startalkIM/ejabberd | ejabberd_router_multicast.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_router_multicast.erl
Author : >
%%% Purpose : Multicast router
Created : 11 Aug 2007 by >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can redistribut... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/ejabberd_router_multicast.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_router_multicast.erl
Purpose : Multicast router
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,... | Author : >
Created : 11 Aug 2007 by >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with... |
a350b379f3a45c81920dbbe8f4a3609eedd1f994cd1d7cc28912579b0641daa0 | Clozure/ccl-tests | letstar.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Fri Jun 24 20:53:36 2005
;;;; Contains: Tests for LET*
(in-package :cl-test)
(deftest let*.1
(let* ((x 0)) x)
0)
(deftest let*.2
(let* ((x 0) (y 1)) (values x y))
0 1)
(deftest let*.3
(let* ((x 0) (y 1)) (declare (special x y)) (values x y))
0 1)
(d... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/letstar.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests for LET*
(deftest let*.13
(flet ((%f () (declare (special x)) x))
(x (1+ (%f))))
(declare (special x))
x))
Tests of large number of LET* variables
Test that all non-variables exported from COMMON-LISP can be bound
in LET* forms.
Check that LET* does not hav... | Author :
Created : Fri Jun 24 20:53:36 2005
(in-package :cl-test)
(deftest let*.1
(let* ((x 0)) x)
0)
(deftest let*.2
(let* ((x 0) (y 1)) (values x y))
0 1)
(deftest let*.3
(let* ((x 0) (y 1)) (declare (special x y)) (values x y))
0 1)
(deftest let*.4
(let* ((x 0))
(let* ((x 1))
... |
29c0b1f96ca6bdefea87c7b4b55f6d4e95eabda548df5e1bee07b9b8c1955bcc | bobzhang/ocaml-book | myocamlbuild.ml | open Ocamlbuild_plugin
open Command
open Printf
let (^$) f x = f x
let (//) = Filename.concat
let flip f x y = f y x
let prerr_endlinef fmt = ksprintf prerr_endline fmt
let run_and_read = Ocamlbuild_pack.My_unix.run_and_read
let blank_sep_strings = Ocamlbuild_pack.Lexers.blank_sep_strings
let find_packages () =
... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/code/llvm/tutorial/myocamlbuild.ml | ocaml | * list extensions, but not used here
*
configuration syntax extensions
* demo how to use dep
dep ["ocamldep"; "file:test/test_string.ml"]
["test/test_data/string.txt";
"test/test_data/char.txt"];
flag ["ocaml"; "pp"; "use_lambda"] (A"pa_lambda.cmo");
dep ["ocamldep"; "use_lambda"]
... | open Ocamlbuild_plugin
open Command
open Printf
let (^$) f x = f x
let (//) = Filename.concat
let flip f x y = f y x
let prerr_endlinef fmt = ksprintf prerr_endline fmt
let run_and_read = Ocamlbuild_pack.My_unix.run_and_read
let blank_sep_strings = Ocamlbuild_pack.Lexers.blank_sep_strings
let find_packages () =
... |
522171909cc2c871203a4340629a241597fe581725a50a49cf1b1139c2a0ab44 | Clozure/ccl-tests | compile-file-test-file.lsp | (in-package "CL-TEST")
(defun compile-file-test-fun.1 () nil)
| null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/compile-file-test-file.lsp | lisp | (in-package "CL-TEST")
(defun compile-file-test-fun.1 () nil)
| |
2e08bf26f45f79b1aece437d4620ae1f4d1ed48842ee2fa9b67acf89faf75a8f | f-me/carma-public | CaseComment.hs | module Carma.Model.CaseComment where
import Data.Text
import Data.Time.Clock
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Case (Case)
import Carma.Model.Types ()
import Carma.Model.PgTypes ()
import Carma.Model.Usermeta (Usermeta)
data CaseComment = CaseComment
{ ident
:: ... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/carma-models/src/Carma/Model/CaseComment.hs | haskell | module Carma.Model.CaseComment where
import Data.Text
import Data.Time.Clock
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Case (Case)
import Carma.Model.Types ()
import Carma.Model.PgTypes ()
import Carma.Model.Usermeta (Usermeta)
data CaseComment = CaseComment
{ ident
:: ... | |
a2c742b8e0f43a72f5c09a2df0043fc44b641b651047182c84d93ee30d94ce38 | FlowForwarding/loom | tap_install_logic.erl | %%------------------------------------------------------------------------------
Copyright 2014 FlowForwarding.org
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%... | null | https://raw.githubusercontent.com/FlowForwarding/loom/86a9c5aa8b7d4776062365716c9a3dbbf3330bc5/tap_install/apps/tap_install/src/tap_install_logic.erl | erlang | ------------------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe... | Copyright 2014 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2014 FlowForwarding.org
Simple Network executive logic .
-module(tap_install_logic).
-behaviour... |
12e13ad483826df365f36e84a9011aa725238825821016ea5a9c03ec134df58f | dwayne/eopl3 | interpreter.rkt | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
;; Expressed Values
num-val bool-val list-val
;; Interpreter
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/03-ch3/interpreters/racket/LET-3.16/interpreter.rkt | racket | Expressed Values
Interpreter
Values
ExpVal = Int + Bool | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(provide
num-val bool-val list-val
run)
(define (run s)
(let ([init-env (extend-env
'i (num-val 1)
(extend-env
'v (num-val 5)
(extend-env
'x (num-val 10)
... |
2fdbb27124e26f1c0fa274452dca6dc0acd16a9ed434f4c00890166a6386820c | chrisroman/coc | typecheck.ml | open Core
open Ast
open Common
(* Implement Γ ⊢ Δ
* For debugging purposes, keep track of the depth of recursion
*)
let rec typecheck_context ?(depth = 1) (gamma_arg : term_t) (delta_arg : term_t) : unit =
dbg_print ~depth (Printf.sprintf "typecheck_context %s |- %s\n" (string_of_term_t gamma_arg) (string_of_term_... | null | https://raw.githubusercontent.com/chrisroman/coc/95e8c344c0694b4293aad04098c046652bf42652/typecheck.ml | ocaml | Implement Γ ⊢ Δ
* For debugging purposes, keep track of the depth of recursion
Implement Γ ⊢ M : P
* For debugging purposes, keep track of the depth of recursion
Abstraction
Application
TODO: Looks like beta equivalence is broken. For some reason,
doing an application kinda fails
try
with _ ->
... | open Core
open Ast
open Common
let rec typecheck_context ?(depth = 1) (gamma_arg : term_t) (delta_arg : term_t) : unit =
dbg_print ~depth (Printf.sprintf "typecheck_context %s |- %s\n" (string_of_term_t gamma_arg) (string_of_term_t delta_arg));
assert_context gamma_arg;
assert_context delta_arg;
match gamma_a... |
a9abd0fcd847aadbfb37a5dabe047f3c45c046439521e3f2dc5aa2a64c1adc62 | webmachine/webmachine | wmtrace_resource.erl | @author < >
@doc Webmachine trace file interpretter .
-module(wmtrace_resource).
-export([add_dispatch_rule/2,
remove_dispatch_rules/0]).
-export([init/1,
resource_exists/2,
content_types_provided/2,
produce_html/2,
produce_javascript/2,
produce_map/2,
... | null | https://raw.githubusercontent.com/webmachine/webmachine/8a3460fcc5fa1ffabe8bf2bdf3875bb62b5ee196/src/wmtrace_resource.erl | erlang |
Dispatch Modifiers
@doc Add a dispatch rule to point at wmtrace_resource.
Example: to serve wmtrace_resource from
/
with trace files on disk at
priv/traces
call:
add_dispatch_rule("dev/wmtrace", "priv/traces")
@doc Remove all dispatch rules pointing to wm... | @author < >
@doc Webmachine trace file interpretter .
-module(wmtrace_resource).
-export([add_dispatch_rule/2,
remove_dispatch_rules/0]).
-export([init/1,
resource_exists/2,
content_types_provided/2,
produce_html/2,
produce_javascript/2,
produce_map/2,
... |
0c5be8cefa4d2c6d10af35c293698362cee727d2b71d2797fe14df938af4b40a | Tclv/HaskellBook | ChapterExercises.hs | module ChapterExercises where
import Data.Monoid
import Control.Applicative
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
{-
- 1.
-
-pure :: a -> [a]
-(<*>) :: [(a -> b)] -> [a] -> [b]
-
- 2.
-
-pure :: a -> IO a
-(<*>) :: IO (a -> b) -> IO a -> IO b
-
- 3.
-
-pu... | null | https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch17/ChapterExercises.hs | haskell |
- 1.
-
-pure :: a -> [a]
-(<*>) :: [(a -> b)] -> [a] -> [b]
-
- 2.
-
-pure :: a -> IO a
-(<*>) :: IO (a -> b) -> IO a -> IO b
-
- 3.
-
-pure :: Monoid a => b -> (a, b)
-(<*>) :: Monoid c => (c, a -> b) -> (c, a) -> (c, b)
-
- 4.
-
-pure :: a -> (->) e a == a -> (e -> a) == a -> e -> a
-(<*>) :: ... | module ChapterExercises where
import Data.Monoid
import Control.Applicative
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
main = do
quickBatch $ functor $ (Pair (1, 2, 3) (1, 2, 3) :: Pair (Int, Int, Int))
quickBatch $ applicative $ (Pair (1, 2, 3) (1, 2, 3) :: Pair (Int,... |
07a116cd774fef524de5d896f93d409cff6dac5540a3f85b838f897d6052681b | ocsigen/eliomlang | eliom_serial.ml |
type pos = Lexing.position * Lexing.position
type poly
module Fragment_server_repr = struct
type u = {
mutable loc : pos option;
id: int;
unwrapper: Eliom_wrap.unwrapper
}
type 'a[@client] t = u
let unwrap_id = 7
let create ?loc ~id ~unwrapper = { id; loc; unwrapper }
let instance_id cv = ... | null | https://raw.githubusercontent.com/ocsigen/eliomlang/42e55856574e058caca191e50edcb0023900b664/runtime/server/eliom_serial.ml | ocaml |
type pos = Lexing.position * Lexing.position
type poly
module Fragment_server_repr = struct
type u = {
mutable loc : pos option;
id: int;
unwrapper: Eliom_wrap.unwrapper
}
type 'a[@client] t = u
let unwrap_id = 7
let create ?loc ~id ~unwrapper = { id; loc; unwrapper }
let instance_id cv = ... | |
f1dd3b6ff98716d6ab3cea964a999a2b1b18ca02a4eb30295c32f3ff999f2c33 | gedge-platform/gedge-platform | rabbitmq_aws_xml.erl | %% ====================================================================
@author < >
2016 ,
%% @doc Simple XML parser for AWS application/xml responses
%% @end
%% ====================================================================
-module(rabbitmq_aws_xml).
-export([parse/1]).
-include_lib("xmerl/include/... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbitmq_aws/src/rabbitmq_aws_xml.erl | erlang | ====================================================================
@doc Simple XML parser for AWS application/xml responses
@end
==================================================================== | @author < >
2016 ,
-module(rabbitmq_aws_xml).
-export([parse/1]).
-include_lib("xmerl/include/xmerl.hrl").
-spec parse(Value :: string() | binary()) -> list().
parse(Value) ->
{Element, _} = xmerl_scan:string(Value),
parse_node(Element).
parse_node(#xmlElement{name=Name, content=Content}) ->
Valu... |
f900ffe6b2735bec91c32d444fdb269385c5943fad9519f1fb353f9e532bc279 | ocaml/ocaml-lsp | channel.mli | type 'a t
type elt_in_channel
val create : unit -> 'a t
val is_empty : 'a t -> bool
(** Checks whether the channel contains elements *)
val length : 'a t -> int
(** Number of elements currently in the channel not consumed. Runs in O(n). *)
val send_removable : 'a t -> 'a -> (elt_in_channel, [ `Closed ]) result
(** ... | null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/13ca928754cd8730f44382848e0437b3b6768a73/submodules/lev/lev-fiber/src/util/channel.mli | ocaml | * Checks whether the channel contains elements
* Number of elements currently in the channel not consumed. Runs in O(n).
* [send_removable ch v] puts a value [v] in the channel [ch] in a non-blocking
manner (we consider acquiring/waiting for the lock to be "non-blocking").
The returned value [elt_in_channel] ... | type 'a t
type elt_in_channel
val create : unit -> 'a t
val is_empty : 'a t -> bool
val length : 'a t -> int
val send_removable : 'a t -> 'a -> (elt_in_channel, [ `Closed ]) result
val send : 'a t -> 'a -> (unit, [ `Closed ]) result
val remove_if_not_consumed : elt_in_channel -> unit
val get : 'a t -> ('a, [ `Cl... |
2bce378f5632847a71a966c6398a86642b6a62f935d49d9a9ec7fdc6de404f0e | djblue/portal | project.clj | (defproject portal-example-lein "1.0.0"
:dependencies [[ring "1.8.2"]]
:profiles
{:dev {:source-paths ["dev"]
:dependencies [[djblue/portal "0.33.0"]]
:repl-options
{:nrepl-middleware [portal.nrepl/wrap-portal]}}})
| null | https://raw.githubusercontent.com/djblue/portal/afd49269c896de0a352234c14ba25ab907f58296/examples/jvm/project.clj | clojure | (defproject portal-example-lein "1.0.0"
:dependencies [[ring "1.8.2"]]
:profiles
{:dev {:source-paths ["dev"]
:dependencies [[djblue/portal "0.33.0"]]
:repl-options
{:nrepl-middleware [portal.nrepl/wrap-portal]}}})
| |
14a59ed66e5d31de14ee38720dae8a17bcf707eb348532546064e1bdcc923160 | greghendershott/frog | html.rkt | #lang racket/base
(require racket/match
threading
xml
(only-in html read-html-as-xml))
(provide read-html-as-xexprs)
( - > ( ? ) )
(~>> (read-html-as-xml)
(element #f #f 'root '())
xml->xexpr
decode-ampersands-in-attributes
cddr))
(define (decode-ampersan... | null | https://raw.githubusercontent.com/greghendershott/frog/93d8b442c2e619334612b7e2d091e4eb33995021/frog/private/html.rkt | racket | b=2'>link</a></p>") | #lang racket/base
(require racket/match
threading
xml
(only-in html read-html-as-xml))
(provide read-html-as-xexprs)
( - > ( ? ) )
(~>> (read-html-as-xml)
(element #f #f 'root '())
xml->xexpr
decode-ampersands-in-attributes
cddr))
(define (decode-ampersan... |
825fc7e808d2dc44d08e0cea92d772d358e8d3b51a6887857cbfdc3899e55435 | binghe/cl-net-snmp | string.lisp | ;;;; -*- Mode: Lisp -*-
$ Id$
(in-package :asn.1)
(defclass octet-string (general-type)
((value :type (vector (unsigned-byte 8))))
(:documentation "ASN.1 OCTET STRING class"))
(defmethod print-object ((object octet-string) stream)
(print-unreadable-object (object stream :type t)
(format stream "~A" (valu... | null | https://raw.githubusercontent.com/binghe/cl-net-snmp/3cf053bce75734097f0d7e2245a53fa0c45f5e05/runtime/string.lisp | lisp | -*- Mode: Lisp -*-
OCTET STRING (:octet-string) | $ Id$
(in-package :asn.1)
(defclass octet-string (general-type)
((value :type (vector (unsigned-byte 8))))
(:documentation "ASN.1 OCTET STRING class"))
(defmethod print-object ((object octet-string) stream)
(print-unreadable-object (object stream :type t)
(format stream "~A" (value-of object))))
(defgen... |
a388e18602bb54eb04e7c87958924a94b90124bb08795de5a029737fc08b9306 | rescript-lang/rescript-compiler | js_pass_flatten_and_mark_dead.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* 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 , either version 3 of the... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/f93b32e0dee664ac0b257cbdc3bc16127c614f44/jscomp/core/js_pass_flatten_and_mark_dead.ml | ocaml | recursive identifiers
assert false
If we do this, we should prevent incorrect inlning to inline it into an array :)
do it only when block size is larger than one
TODO: check the optimization
tradeoff,
when the block is small, it does not make
... | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* 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 , either version 3 of the... |
7e8b7a16e6314adc2bcc9396d1bfe8ec25a8777606c07ac9fe73852ca8157a92 | nasa/Common-Metadata-Repository | subscription_search_test.clj | (ns cmr.system-int-test.search.subscription.subscription-search-test
"This tests searching subscriptions."
(:require
[clojure.string :as string]
[clojure.test :refer :all]
[cmr.access-control.test.util :as ac-util]
[cmr.common.date-time-parser :as dt-parser]
[cmr.common.mime-types :as mime-types]
... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/0e64f0edcef65742c05b6ccf3da4d5c5586e814b/system-int-test/test/cmr/system_int_test/search/subscription/subscription_search_test.clj | clojure | No read permission granted for guest for PROV3
but it's searchable by registered users because read permission is granted.
subscriberid Param
collection-concept-id Param
native-id Param
concept-id Param
Combination of params | (ns cmr.system-int-test.search.subscription.subscription-search-test
"This tests searching subscriptions."
(:require
[clojure.string :as string]
[clojure.test :refer :all]
[cmr.access-control.test.util :as ac-util]
[cmr.common.date-time-parser :as dt-parser]
[cmr.common.mime-types :as mime-types]
... |
c478ef601d202e7d8067a9629ad1314e38a83bf6948511703c7d4bc695524cb2 | williamleferrand/accretio | ys_viz.ml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/client/ys_viz.ml | ocaml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | |
b768553bcadc0008d26d770f3c41a06dcaad2b98cfdff744106c9c2e3a16f1c3 | mcna/usocket | option.lisp | $ I d : option.lisp 710 2012 - 12 - 27
;;;; $URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/option.lisp $
;;;; SOCKET-OPTION, a high-level socket option get/set framework
;;;; See LICENSE for licensing information.
(in-package :usocket)
;;; Small utility functions
(declaim (inline bool->int) (inlin... | null | https://raw.githubusercontent.com/mcna/usocket/187e0ecd58ec0b2093d972e0eb607a50182a3efd/option.lisp | lisp | $URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/option.lisp $
SOCKET-OPTION, a high-level socket option get/set framework
See LICENSE for licensing information.
Small utility functions
Handling of wrong type of arguments
Socket option: RECEIVE-TIMEOUT (SO_RCVTIMEO) | $ I d : option.lisp 710 2012 - 12 - 27
(in-package :usocket)
(declaim (inline bool->int) (inline int->bool))
(defun bool->int (bool) (if bool 1 0))
(defun int->bool (int) (= 1 int))
Interface definition
(defgeneric socket-option (socket option &key)
(:documentation
"Get a socket's internal options"))
... |
0873a7f462f40768a894bcfde86efe7264e95de75469e8ecfb29d5fc91d2d83f | evolutics/haskell-formatter | TestTool.hs | {-|
Description : Testing utilities
-}
module Language.Haskell.Formatter.Toolkit.TestTool
(testingError, standardSourceCodeTest, documentationTest) where
import qualified Data.List as List
import qualified Data.Monoid as Monoid
import qualified Language.Haskell.HLint as HLint
import qualified Test.DocTest as Doc... | null | https://raw.githubusercontent.com/evolutics/haskell-formatter/3919428e312db62b305de4dd1c84887e6cfa9478/testsuite/src/Language/Haskell/Formatter/Toolkit/TestTool.hs | haskell | |
Description : Testing utilities
| module Language.Haskell.Formatter.Toolkit.TestTool
(testingError, standardSourceCodeTest, documentationTest) where
import qualified Data.List as List
import qualified Data.Monoid as Monoid
import qualified Language.Haskell.HLint as HLint
import qualified Test.DocTest as DocTest
import qualified Test.Tasty as Tas... |
d9b29cb63076aa080978bd8ac809efddf59cae3b1ade643005fcb33df29945f3 | rmloveland/geiser-scsh | doc.scm | ;;; doc.scm -- procedures providing documentation on scheme objects
Copyright ( C ) 2009 , 2010
Copyright ( C ) 2013 , 2014 Rich Loveland
;; This program is free software; you can redistribute it and/or
modify it under the terms of the Modified BSD License . You should
;; have received a copy of the license... | null | https://raw.githubusercontent.com/rmloveland/geiser-scsh/5f7358c39670305a3048388576977f8a43c8daaa/scheme/scsh/geiser/doc.scm | scheme | doc.scm -- procedures providing documentation on scheme objects
This program is free software; you can redistribute it and/or
have received a copy of the license along with this program. If
not, see <#5>.
We keep a hash table whose keys are procedure names and whose
values are alists with their own keys and value... |
Copyright ( C ) 2009 , 2010
Copyright ( C ) 2013 , 2014 Rich Loveland
modify it under the terms of the Modified BSD License . You should
(define (signature id args-list)
(let ((value (ge:symbol->object id)))
(if (and (list? value)
(not (null? value)))
(let ((args (second `(quote ,(first value)... |
02731d8bc660c8d25ba5625d269747bca792b7b0f5e831ea50fcdfaa6ca78db8 | hexlet-codebattle/battle_asserts | rating_sort.clj | (ns battle-asserts.issues.rating-sort
(:require [clojure.test.check.generators :as gen]
[battle-asserts.utility :as util]))
(def level :easy)
(def disabled true)
(def tags ["strings" "collections" "hash-maps" "sorting"])
(def description
{:en "Implement a function that find top 3 Codebattle players ... | null | https://raw.githubusercontent.com/hexlet-codebattle/battle_asserts/3d92dfc8be2379742e554ee1b6e3878372fe9e78/src/battle_asserts/issues/rating_sort.clj | clojure | (ns battle-asserts.issues.rating-sort
(:require [clojure.test.check.generators :as gen]
[battle-asserts.utility :as util]))
(def level :easy)
(def disabled true)
(def tags ["strings" "collections" "hash-maps" "sorting"])
(def description
{:en "Implement a function that find top 3 Codebattle players ... | |
18f64221cdf9e008355df173159a0ab0ec32a8b8b0492ebe123cfccac435f19d | archimag/mongo-cl-driver | constants.lisp | ;;;; constants.lisp
;;;;
;;;; This file is part of the MONGO-CL-DRIVER library, released under Lisp-LGPL.
;;;; See file COPYING for details.
;;;;
Author : < >
(in-package #:mongo-cl-driver)
(defmacro defconstant (name value &optional doc)
"Make sure VALUE is evaluated only once \(to appease SBCL).
Copied from ... | null | https://raw.githubusercontent.com/archimag/mongo-cl-driver/300c10bd3d0b3ca3a82c8b32087bddbc7b6a86c3/driver/constants.lisp | lisp | constants.lisp
This file is part of the MONGO-CL-DRIVER library, released under Lisp-LGPL.
See file COPYING for details.
Write Concern | Author : < >
(in-package #:mongo-cl-driver)
(defmacro defconstant (name value &optional doc)
"Make sure VALUE is evaluated only once \(to appease SBCL).
Copied from Hunchentoot."
`(cl:defconstant ,name (if (boundp ',name) (symbol-value ',name) ,value)
,@(when doc (list doc))))
(defconstant +write-conc... |
b1b33561066c8700a2704ea108ce5d18c89755c613a01dbb6d0002d2dfcdda8b | scrintal/heroicons-reagent | bars_3_center_left.cljs | (ns com.scrintal.heroicons.solid.bars-3-center-left)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75z... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/bars_3_center_left.cljs | clojure | (ns com.scrintal.heroicons.solid.bars-3-center-left)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75z... | |
309a193901191c29c75060a3d190e4a3fba66e976524c48e9de130be2aa12d6e | elisehuard/game-in-haskell | Shapes.hs | {-# LANGUAGE PackageImports #-}
import "GLFW-b" Graphics.UI.GLFW as GLFW
import Graphics.Gloss
import Graphics.Gloss.Rendering
import Graphics.Gloss.Data.Color
import Graphics.Gloss.Data.Picture
import System.Exit ( exitSuccess )
import Control.Concurrent (threadDelay)
import Control.Monad (when, unless)
windowWidth, ... | null | https://raw.githubusercontent.com/elisehuard/game-in-haskell/b755c42d63ff5dc9246b46590fb23ebcc1d455b1/src/Shapes.hs | haskell | # LANGUAGE PackageImports # | import "GLFW-b" Graphics.UI.GLFW as GLFW
import Graphics.Gloss
import Graphics.Gloss.Rendering
import Graphics.Gloss.Data.Color
import Graphics.Gloss.Data.Picture
import System.Exit ( exitSuccess )
import Control.Concurrent (threadDelay)
import Control.Monad (when, unless)
windowWidth, windowHeight :: Int
windowWidth ... |
c4c84c79bed2996aabebf12aab2675a897ea56de319a00ec4feedacc9e8fcfa6 | ds-wizard/engine-backend | Api.hs | module Registry.Api.Handler.DocumentTemplate.Api where
import Servant
import Registry.Api.Handler.DocumentTemplate.Detail_Bundle_GET
import Registry.Api.Handler.DocumentTemplate.Detail_GET
import Registry.Api.Handler.DocumentTemplate.List_Bundle_POST
import Registry.Api.Handler.DocumentTemplate.List_GET
import Regist... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/5769943e7431b353180c97da51eccab4a7179289/engine-registry/src/Registry/Api/Handler/DocumentTemplate/Api.hs | haskell | module Registry.Api.Handler.DocumentTemplate.Api where
import Servant
import Registry.Api.Handler.DocumentTemplate.Detail_Bundle_GET
import Registry.Api.Handler.DocumentTemplate.Detail_GET
import Registry.Api.Handler.DocumentTemplate.List_Bundle_POST
import Registry.Api.Handler.DocumentTemplate.List_GET
import Regist... | |
a9d1c32c7b3d0b5c8d853947f7297d23c40dcfff08fc546161214d140e0c942d | tejasbubane/haskell-book-code | existential-quantification.hs | # LANGUAGE ExistentialQuantification #
{-# LANGUAGE GADTs #-}
module WhySomeException where
import Control.Exception (ArithException(..), AsyncException(..))
import Data.Typeable
data MyException =
forall e . (Show e, Typeable e) => MyException e
instance Show MyException where
showsPrec p (MyException e) = sho... | null | https://raw.githubusercontent.com/tejasbubane/haskell-book-code/deaac8ab4db0ae8692d0278826528bb8a746ed82/ch-30/existential-quantification.hs | haskell | # LANGUAGE GADTs #
Note: MyException does not take any type variable
This is why we need existential quantification - to throw various exception types
without being forced to centralize all error types under single SUM type | # LANGUAGE ExistentialQuantification #
module WhySomeException where
import Control.Exception (ArithException(..), AsyncException(..))
import Data.Typeable
data MyException =
forall e . (Show e, Typeable e) => MyException e
instance Show MyException where
showsPrec p (MyException e) = showsPrec p e
multiError ... |
420943a01ed5ccb94b7a4618e70f819f44e9d3d63b8392bb189c4a01c9b9f5a6 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Duration.CA.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
im... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Duration/CA/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Duration.CA.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import Duckling.Duration.CA.Corpus
import Duckling.Dimensions.Types
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "CA Tests"
[ makeCorpu... |
e20b2c349820004acdeca67553d9fa4520bf12b8fad11fead19e309d1162639a | joinr/spork | parsing.clj | ;;A useful set of parsing functions and parser definitions.
;;Typically used to help read string data effeciently.
(ns spork.util.parsing
(:require [clojure.edn]
[spork.util [general :as gen]]))
;;Note -> this isn't quite so hot, but it's a general failsafe.
;;It's much much better to use a stan... | null | https://raw.githubusercontent.com/joinr/spork/bb80eddadf90bf92745bf5315217e25a99fbf9d6/src/spork/util/parsing.clj | clojure | A useful set of parsing functions and parser definitions.
Typically used to help read string data effeciently.
Note -> this isn't quite so hot, but it's a general failsafe.
It's much much better to use a standard parser for each field, if the
field is a known type.
a schema is just a map of field names to either ... | (ns spork.util.parsing
(:require [clojure.edn]
[spork.util [general :as gen]]))
Borrowed from Incanter Source code , credit
(defn parse-string
"Parses a string, trying various number formats. Note, scientific numbers,
or strings with digits sandwiching an E or an e will be parsed as nu... |
89eb9c63e244264bfa7a0e8c029adbefc003a0639b2f5b699a9fb9d8ba171038 | reflectionalist/S9fES | systest.scm | ; Scheme 9 from Empty Space
; Unix Extension Test Suite
By ,
; NOTE: SOCKET-TEST will fail if this test is run
; multiple times in quick succession.
(load-from-library "mergesort.scm")
(load-from-library "displaystar.scm")
(load-from-library "read-line.scm")
(load-from-library "bitops.scm")
; ----- Prelude ---... | null | https://raw.githubusercontent.com/reflectionalist/S9fES/0ade11593cf35f112e197026886fc819042058dd/util/systest.scm | scheme | Scheme 9 from Empty Space
Unix Extension Test Suite
NOTE: SOCKET-TEST will fail if this test is run
multiple times in quick succession.
----- Prelude --------------------------------------------------------------
errors caught?
(write form) (display " => ") (write passed) (newline)
----- Directory creation and... | By ,
(load-from-library "mergesort.scm")
(load-from-library "displaystar.scm")
(load-from-library "read-line.scm")
(load-from-library "bitops.scm")
(define *SANDBOX* "systest-sandbox")
(define *Errors* 0)
(define fd #f)
(define fd0 #f)
(sys:catch-errors #t)
(if (zero? (sys:getuid))
(error ... |
61562d062b8df2cd2dbb825145d4d9f074f39fe6ba3c1c3494e537b99fcc730e | quil-lang/quilc | resource-tests.lisp | ;;;; resource-tests.lisp
;;;;
Author :
(in-package #:cl-quil-tests)
(defun qr (idx) (quil::make-qubit-resource idx))
(defun make-qubit-resources (indices)
(reduce #'quil::resource-union (mapcar #'qr indices)))
(defun mk-ranges (ranges &optional names)
(unless names
(setf names (make-list (length ranges) ... | null | https://raw.githubusercontent.com/quil-lang/quilc/3f3260aaa65cdde25a4f9c0027959e37ceef9d64/tests/resource-tests.lisp | lisp | resource-tests.lisp
A ∩ B = A - Bᶜ
(A - B)ᶜ = A or Bᶜ
A or B = (Aᶜ ∩ Bᶜ)ᶜ
A - ∅ = A
(B - A) or C = (B or C) - (A - C) | Author :
(in-package #:cl-quil-tests)
(defun qr (idx) (quil::make-qubit-resource idx))
(defun make-qubit-resources (indices)
(reduce #'quil::resource-union (mapcar #'qr indices)))
(defun mk-ranges (ranges &optional names)
(unless names
(setf names (make-list (length ranges) :initial-element "")))
(redu... |
4ac709dbecf15948ad649f0d0e43e7dc2029a46d691c421e6989422fdf06eb19 | Stratus3D/eflambe | arithmetic.erl | -module(arithmetic).
-export([add/2, divide/2, multiply/2]).
add(X, Y) ->
X + Y.
divide(X, Y) ->
X / Y.
multiply(X, Y) ->
% intentionally naive multiply
Result = lists:foldl(fun(_, Seq) ->
X + Seq
end, 0, lists:seq(1, Y)),
Resul... | null | https://raw.githubusercontent.com/Stratus3D/eflambe/0cb4fe69165116ab584733992a93d9b911405ead/test/arithmetic.erl | erlang | intentionally naive multiply | -module(arithmetic).
-export([add/2, divide/2, multiply/2]).
add(X, Y) ->
X + Y.
divide(X, Y) ->
X / Y.
multiply(X, Y) ->
Result = lists:foldl(fun(_, Seq) ->
X + Seq
end, 0, lists:seq(1, Y)),
Result.
|
7d6e2950b5d725bd01cb799c0495ce09f52216aa6c5107e8d034d243bd5a6fec | sebastiaanvisser/ghc-goals | Test2.hs | # LANGUAGE TypeFamilies #
module Test2 where
type family Fam a :: *
type instance Fam Char = Int
type instance Fam Int = Char
hello = undefined
| null | https://raw.githubusercontent.com/sebastiaanvisser/ghc-goals/cf256c99c4b7e3b569bab3e6c10f0903a7c1eac4/tests/Test2.hs | haskell | # LANGUAGE TypeFamilies #
module Test2 where
type family Fam a :: *
type instance Fam Char = Int
type instance Fam Int = Char
hello = undefined
| |
f50a0576c9a129e23652b20a0e15c746b8527e9a8e583a9cf4ec8b852ab9ac9e | flavioc/cl-hurd | trans-flags.lisp |
(in-package :hurd)
;; file-set-translator flags.
(defbitfield fs-trans-flags
(:force #x00000001)
(:excl #x00000002)
(:set #x00000004)
(:orphan #x00000008))
| null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/fs/trans-flags.lisp | lisp | file-set-translator flags. |
(in-package :hurd)
(defbitfield fs-trans-flags
(:force #x00000001)
(:excl #x00000002)
(:set #x00000004)
(:orphan #x00000008))
|
513d722d094b92cfa0d7b82093cd0ca6bcd20bd066aa1a932eed56e19b7b10e6 | Beluga-lang/Beluga | holes.mli | open Support
open Syntax.Int
Define two opaque types to be used as indices for ` hole_info ` .
type lf_hole_info =
{ cPsi : LF.dctx
; lfGoal : LF.tclo
; mutable lfSolution : LF.nclo option
}
type comp_hole_info =
{ cG : Comp.gctx
; compGoal : Comp.typ * LF.msub
; mutable compSolution : Comp.exp optio... | null | https://raw.githubusercontent.com/Beluga-lang/Beluga/520c41534820e12a52d640f3151480e790baa17e/src/core/holes.mli | ocaml | * A hole with a known kind of information.
* "Context Delta", for metavariables.
* information specific to the hole type.
* Existential wrapper for 'a hole with a singleton type.
* A strategy for retrieving a hole.
* Gets a string representation of the given strategy.
* An error that arises when lookup by a given... | open Support
open Syntax.Int
Define two opaque types to be used as indices for ` hole_info ` .
type lf_hole_info =
{ cPsi : LF.dctx
; lfGoal : LF.tclo
; mutable lfSolution : LF.nclo option
}
type comp_hole_info =
{ cG : Comp.gctx
; compGoal : Comp.typ * LF.msub
; mutable compSolution : Comp.exp optio... |
45d62f0d2dbda0e0c1d9a15f07ff04dc744feb2ac88253522e1478e4c5dd3a2c | codinuum/volt | name.mli |
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... | null | https://raw.githubusercontent.com/codinuum/volt/546207693ef102a2f02c85af935f64a8f16882e6/src/library/name.mli | ocaml | * This module defines the type of logger names, as well as conversion
function from/to string. A logger name is a dot-separated list of
strings.
* The type of logger names.
* Converts a string into a logger name.
* Converts a string list into a logger name.
* Converts a logger name into a string.
* Convert... |
* This file is part of Bolt .
* Copyright ( C ) 2009 - 2012 .
*
* Bolt is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) ... |
b007bc27d6247d181ddfb3e0d7007e9ffe2bf72a2d312a05a4bf9c92fb19bc05 | anmonteiro/ocaml-h2 | error.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-h2/66d92f1694b488ea638aa5073c796e164d5fbd9e/lib/error.ml | ocaml | ----------------------------------------------------------------------------
* Copyright ( c ) 2019
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | |
357d2763649dd365262a7940cbc4935ea301063ae6a32236e5ad374ebdd24fdf | luqui/experiments | regular-class.hs | # LANGUAGE ConstraintKinds , DeriveFunctor , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , NoMonomorphismRestriction , TypeFamilies , PolyKinds , RankNTypes , TypeOperators , GADTs , LambdaCase , KindSignatures , AllowAmbiguousTypes #
import qualified Prelude
import Prelude hiding (Num(..), Monoid(..)... | null | https://raw.githubusercontent.com/luqui/experiments/c0b9153c41507afbfdeb2b32bfc65fd1ac83fb26/regular-class.hs | haskell | ghci> mappend ("a", "b") ("c", "d")
("ac", "bd")
Now let's get high
It seems we cannot go up to arbitrary kinds, because polykinds and type equality
level up :(.
ghci> fmap' not (Pair (Just False) (Just True))
Pair (Just True) (Just False) | # LANGUAGE ConstraintKinds , DeriveFunctor , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , NoMonomorphismRestriction , TypeFamilies , PolyKinds , RankNTypes , TypeOperators , GADTs , LambdaCase , KindSignatures , AllowAmbiguousTypes #
import qualified Prelude
import Prelude hiding (Num(..), Monoid(..)... |
098bd0869e598570366442e077f5eb165e8af005eb8397746dd42256132d5629 | yi-editor/yi | Intero.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
Module : . Intero
Description : Intero support for .
Copyright : 2017
License :
-- Maintainer :
--
This module implements actual Yi Actions using the hidden InteroAPI module .
module Yi.Intero (
Intero
, interoStart
, interoLocAt, interoTy... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-intero/src/Yi/Intero.hs | haskell | # LANGUAGE OverloadedStrings #
|
Maintainer :
FIXME: change "." into the correct directory
evaluate any haskell expression, but you can also use commands like
":show modules" or ":show imports" like you would use them in ghci.
features:
FIXME: close previous *intero* buffers before opening a new one.
so I... |
Module : . Intero
Description : Intero support for .
Copyright : 2017
License :
This module implements actual Yi Actions using the hidden InteroAPI module .
module Yi.Intero (
Intero
, interoStart
, interoLocAt, interoTypeAt, interoEval, interoUses, interoJump
, interoModule
)... |
b491fa1f7bea4d423a3d385b0402e49fe0a2458923807db371eb65a2c424b6e5 | stackbuilders/cis194-templates | Wholemeal.hs | ----------------------------------------------------------------------
-- |
--
CIS 194 Spring 2013 : Homework 04
--
----------------------------------------------------------------------
module Homework04.Wholemeal where
----------------------------------------------------------------------
Exercise 1
-----------... | null | https://raw.githubusercontent.com/stackbuilders/cis194-templates/f41b9f0b9945afd387f433ff40fa8988b6a9fe8b/src/Homework04/Wholemeal.hs | haskell | --------------------------------------------------------------------
|
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
|
True
>>> fun1 [1,2,3] /= fun1' [1... | CIS 194 Spring 2013 : Homework 04
module Homework04.Wholemeal where
Exercise 1
fun1 :: [Integer] -> Integer
fun1 [] = 1
fun1 (x:xs)
| even x = (x - 2) * fun1 xs
| otherwise = fun1 xs
fun2 :: Integer -> Integer
fun2 1 = 0
fun2 n
| even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3*n + 1)
... |
37b98da00f935562006a0f3ac72b3ba0976f429dc0ff9f42885cfb59adca0f1d | karimarttila/clojure | prod.cljs | (ns simplefrontend.prod
(:require
[simplefrontend.core :as core]))
;;ignore println statements in prod
(set! *print-fn* (fn [& _]))
(core/init!)
| null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/clj-ring-cljs-reagent-demo/simple-frontend/env/prod/cljs/simplefrontend/prod.cljs | clojure | ignore println statements in prod | (ns simplefrontend.prod
(:require
[simplefrontend.core :as core]))
(set! *print-fn* (fn [& _]))
(core/init!)
|
75619fa59883222c57bb0c62ff2f07ee08cfe32264291da4a16b92245296bef9 | charlieg/Sparser | add-delete-rule.lisp |
When a rule is created it passes through construct-cfr [//double check
ETF entry point]. Besides making the object, that calls these forms:
(note-file-location cfr)
(note-grammar-module cfr :source source)
(knit-into-psg-tables cfr)
(catalog/cfr cfr r-symbol)
The call to note-grammar-module causes t... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/documentation/in%20progress/add-delete-rule.lisp | lisp |
When a rule is created it passes through construct-cfr [//double check
ETF entry point]. Besides making the object, that calls these forms:
(note-file-location cfr)
(note-grammar-module cfr :source source)
(knit-into-psg-tables cfr)
(catalog/cfr cfr r-symbol)
The call to note-grammar-module causes t... | |
858043005d2ae9f706c77a0b8d38e52c03b8619ff8bd7b4fe729d7a6d5452551 | khibino/haskell-relational-record | FromSql.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
-- |
-- Module : Database.Record.FromSql
Copyright : 2013 - 2017
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability ... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/persistable-record/src/Database/Record/FromSql.hs | haskell | |
Module : Database.Record.FromSql
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module defines interfaces
* Conversion from list of database value type into record type
* Derivation rules of 'RecordFromSql' conversion
| Run 'RecordFromSql' parser function obje... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
# LANGUAGE DefaultSignatures #
Copyright : 2013 - 2017
from list of database value type into Haskell type .
module Database.Record.FromSql (
RecordFromSql, runTakeRecord, runToRecord,
... |
c6f78717f5a38249e6e62bf742441ff352d21c183f714929c39786b3ee36c0a7 | marcelosousa/llvmvf | Solver.hs | # LANGUAGE UnicodeSyntax , FlexibleInstances , RecordWildCards , DoAndIfThenElse , NoMonomorphismRestriction #
-------------------------------------------------------------------------------
-- Module : Analysis.Type.Inference.Solver
Copyright : ( c ) 2013
Worklist algorithm
-- Type equality must consider r... | null | https://raw.githubusercontent.com/marcelosousa/llvmvf/c314e43aa8bc8bb7fd9c83cebfbdcabee4ecfe1b/src/Analysis/Type/Inference/Solver.hs | haskell | -----------------------------------------------------------------------------
Module : Analysis.Type.Inference.Solver
Type equality must consider recursive types
That is going to complicate a bit more.
-----------------------------------------------------------------------------
---------------------------------... | # LANGUAGE UnicodeSyntax , FlexibleInstances , RecordWildCards , DoAndIfThenElse , NoMonomorphismRestriction #
Copyright : ( c ) 2013
Worklist algorithm
module Analysis.Type.Inference.Solver where
import Language.LLVMIR hiding (Id, NamedTypes)
import Analysis.Type.Inference.Base
import Analysis.Type.Memory.U... |
45ac13fbee4980fed6bad3183eb53c0ec5e9b4b57214b758314b516114916405 | input-output-hk/cardano-sl | Toil.hs | -- | Explorer's toil.
module Pos.Explorer.Txp.Toil
( module Pos.Explorer.Txp.Toil.Logic
, module Pos.Explorer.Txp.Toil.Monad
, module Pos.Explorer.Txp.Toil.Types
) where
import Pos.Explorer.Txp.Toil.Logic
import Pos.Explorer.Txp.Toil.Monad
import Pos.Explorer.... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/src/Pos/Explorer/Txp/Toil.hs | haskell | | Explorer's toil. |
module Pos.Explorer.Txp.Toil
( module Pos.Explorer.Txp.Toil.Logic
, module Pos.Explorer.Txp.Toil.Monad
, module Pos.Explorer.Txp.Toil.Types
) where
import Pos.Explorer.Txp.Toil.Logic
import Pos.Explorer.Txp.Toil.Monad
import Pos.Explorer.Txp.Toil.Types
|
e1c06f8fb597533a9b78ee4aac303c3b5106f3af7dd3f7e0504729628fbf2535 | yuriy-chumak/ol | version-1-5.scm | OpenGL 1.5 ( 29 Jul 2003 )
(define-library (OpenGL version-1-5)
(export
(exports (OpenGL version-1-4))
GL_VERSION_1_5
; ARB_vertex_buffer_object
GLintptr GLsizeiptr
GL_ARRAY_BUFFER
GL_ELEMENT_ARRAY_BUFFER
GL_ARRAY_BUFFER_BINDING
GL_ELEMENT_ARRAY_BUFFER_BINDING
GL_VERTEX_ARRAY_BUFFER_BI... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/5e00a1d1df8a8f20d5d6b7714275a1578a56b8a0/libraries/OpenGL/version-1-5.scm | scheme | ARB_vertex_buffer_object
...
============================================================================
== implementation ==========================================================
ARB_vertex_buffer_object
ptrdiff_t
ptrdiff_t
ARB_occlusion_query
EXT_shadow_funcs
...
#define GL_FOG_COOR... | OpenGL 1.5 ( 29 Jul 2003 )
(define-library (OpenGL version-1-5)
(export
(exports (OpenGL version-1-4))
GL_VERSION_1_5
GLintptr GLsizeiptr
GL_ARRAY_BUFFER
GL_ELEMENT_ARRAY_BUFFER
GL_ARRAY_BUFFER_BINDING
GL_ELEMENT_ARRAY_BUFFER_BINDING
GL_VERTEX_ARRAY_BUFFER_BINDING
GL_NORMAL_ARRAY_BUF... |
05a18637cec5dec0fe03982fd8490ce1a2987568c2418da6d4327921d02f73a5 | phaul/chess | Board.hs | -- | The state of the current game.
module Chess.Board
( initialBoard
, module B
-- * Properties
-- , prop_Board
, prop_FEN
) where
------------------------------------------------------------------------------
import Data.Maybe
import Chess.Board.Arbitrary as B ()
import Ches... | null | https://raw.githubusercontent.com/phaul/chess/b9c71a0389ed44360caed4b830208ce346211cb8/Chess/Board.hs | haskell | | The state of the current game.
* Properties
, prop_Board
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| The initial position of a chess game.
---------------------------------------------------------... | module Chess.Board
( initialBoard
, module B
, prop_FEN
) where
import Data.Maybe
import Chess.Board.Arbitrary as B ()
import Chess.Board.Attacks as B
import Chess.Board.Board as B
import Chess.Board.Parser as B
initialBoard :: Board
initialBoard =
fromJust $ fromFEN "rnbqkbnr... |
b046a2f94e96a905f3eb4dc509b724a9b71455b778309921dc081b2a0aa011a1 | LeventErkok/sbv | Either.hs | -----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Either
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
Symbolic coproduct , symbolic version of 's ' Either ' type .
--------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/0d791d9f4d1de6bd915b6d7d3f9a550385cb27a5/Data/SBV/Either.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.SBV.Either
License : BSD3
Maintainer:
Stability : experimental
---------------------------------------------------------------------------
# LANGUAGE Rank2Types #
# OPTIONS_GHC -Wall -Werror #
* Constructin... | Copyright : ( c )
Symbolic coproduct , symbolic version of 's ' Either ' type .
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Data.SBV.Either (
sLeft, sRight, liftEither
*
, either
, bimap, first, second
, isLeft, isRight, fromLeft, fromRig... |
4db30005b46755219a5bdd920db221ede0a7f18843670933ea107fb2533f520c | MLstate/opalang | abstr.ml |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/ocamllib/libbase/abstr.ml | ocaml |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | |
5696d424acf08b54e83f4a9dd3cddde7fc3316794434bddfce08f680059f3c34 | rems-project/lem | pattern_syntax.ml | (**************************************************************************)
(* Lem *)
(* *)
, University of Cambridge
, INRIA Paris -... | null | https://raw.githubusercontent.com/rems-project/lem/a839114e468119d9ac0868d7dc53eae7f3cc3a6c/src/pattern_syntax.ml | ocaml | ************************************************************************
Lem
... | , University of Cambridge
, INRIA Paris - Rocquencourt
, University of Cambridge
, University of Cambridge
, University of Cambridge ( while working on Lem )
... |
f8b3cc41810514a9d49280e9f10a07bce25367f9b249c8002b32e9592e220c82 | whalliburton/academy | hall-of-programmers.lisp | (in-package :academy)
;;; !!! Attention Hackers. Get your fork on to make the
;;;
;;; Hall Of Programmers
(defun list-all-programmers ()
(sort
(count-unique (split-string-into-lines
(git '("log" "--format=format:%an"))))
#'> :key #'second))
(defun hall-of-programmers ()
"Show the Hall... | null | https://raw.githubusercontent.com/whalliburton/academy/87a1a13ffbcd60d8553e42e647c59486c761e8cf/hall-of-programmers.lisp | lisp | !!! Attention Hackers. Get your fork on to make the
Hall Of Programmers | (in-package :academy)
(defun list-all-programmers ()
(sort
(count-unique (split-string-into-lines
(git '("log" "--format=format:%an"))))
#'> :key #'second))
(defun hall-of-programmers ()
"Show the Hall of Programmers."
(print-table (list-all-programmers)))
|
074c9daf5d96a4520de135dc8731ecf9aa1af7c089e28a7985b469c52ea5e33a | kfish/const-math-ghc-plugin | arith017.hs | ! ! ! test for a bug in integer->{Int , conversion in GHC 5.04.x
import Data.Int
import Data.Word
main = do
print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer))
:: Data.Int.Int64)
print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer))
:: Data.Word.Word64)
| null | https://raw.githubusercontent.com/kfish/const-math-ghc-plugin/c1d269e0ddc72a782c73cca233ec9488f69112a9/tests/ghc-7.6/arith017.hs | haskell | ! ! ! test for a bug in integer->{Int , conversion in GHC 5.04.x
import Data.Int
import Data.Word
main = do
print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer))
:: Data.Int.Int64)
print (fromIntegral ((2^30 -1 + 2^30) - (2^30 + 2^30 :: Integer))
:: Data.Word.Word64)
| |
1faa448ce1b90526e725ce2c68b5668092aca778d8e31f85a72400cd148a771a | cl-axon/cl-paip | prologc.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
;;;; File prologc.lisp: Final version of the compiler,
;;;; including all improvements from the chapter.
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding unbound))
(defun bo... | null | https://raw.githubusercontent.com/cl-axon/cl-paip/5922be8e3aae00197779bad4a05afa8ea1f6b8c9/prologc.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
File prologc.lisp: Final version of the compiler,
including all improvements from the chapter.
Compile the clauses with this arity
Compile all the clauses with any other arity
Note NAME is the raw name, not the name/arity
Unify constants and conses: ;... | Code from Paradigms of AI Programming
Copyright ( c ) 1991
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding unbound))
(defun bound-p (var) (not (eq (var-binding var) unbound)))
(defmacro deref (exp)
"Follow pointers for bound variables."
`(progn (loop while (and (var-p ,e... |
0cc63393c4fc65fe536884641d6e23ed36f276679dbf480d38035abdc9f50de4 | lpgauth/marina | marina_client.erl | -module(marina_client).
-include("marina_internal.hrl").
-compile(inline).
-compile({inline_size, 512}).
-behavior(shackle_client).
-export([
init/1,
setup/2,
handle_request/2,
handle_data/2,
terminate/1
]).
-record(state, {
buffer = marina_buffer:new() :: buffer(),
frame_flags = 0 ... | null | https://raw.githubusercontent.com/lpgauth/marina/2d775c003f58d125bb38e7c953c30c36aebc72c6/src/marina_client.erl | erlang | shackle_server callbacks | -module(marina_client).
-include("marina_internal.hrl").
-compile(inline).
-compile({inline_size, 512}).
-behavior(shackle_client).
-export([
init/1,
setup/2,
handle_request/2,
handle_data/2,
terminate/1
]).
-record(state, {
buffer = marina_buffer:new() :: buffer(),
frame_flags = 0 ... |
c2ae20a4ea329f27dfe5e78d013ac1f4b39e242ddcac5193a04b16eaa9134e8a | ad044/nmebious | routes.lisp | (in-package #:nmebious)
;; POST text via API
(defroute api-submit-text ("/api/submit/text" :method :post
:decorators (@json @check-api-key)) ()
(with-fail-handler (api-submit-text :type 'api)
(after-submit-text (api-success))))
;; POST file via API
(defroute api-sub... | null | https://raw.githubusercontent.com/ad044/nmebious/3fe48a1b93f9abac5d5403b54108c25984e42a6a/src/routes.lisp | lisp | POST text via API
POST file via API
GET posts via API
Server configuration in JSON format
POST file via the default frontend
POST text via the default frontend
View for a board
About page (basic info on nmebious + configuration for this specific server and additional tips)
Get user preferences for front-end
S... | (in-package #:nmebious)
(defroute api-submit-text ("/api/submit/text" :method :post
:decorators (@json @check-api-key)) ()
(with-fail-handler (api-submit-text :type 'api)
(after-submit-text (api-success))))
(defroute api-submit-file ("/api/submit/file" :method :post... |
4b44cdc481daf381f9d50b8d18598280e7c1c2b008d97371f2f895b3d2469f81 | aumouvantsillage/Hydromel-lang | counter.rkt | 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 /.
#lang racket
(require
racket/runtime-path
hydromel/support
"../common.rkt"
"counter.mel")
(define inst (counter 3))
(instance-set! i... | null | https://raw.githubusercontent.com/aumouvantsillage/Hydromel-lang/914f31409654289f362a9b3d47bcdcd42e391448/examples/counter/counter.rkt | racket | 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 /.
#lang racket
(require
racket/runtime-path
hydromel/support
"../common.rkt"
"counter.mel")
(define inst (counter 3))
(instance-set! i... | |
81f2905cde2d2357bd18559152809506e2fc513ec2955525cf3ff6ced5207cba | sunshowers/z3.rkt | test-nqueens.rkt | #lang racket
(require rackunit)
(require "../examples/nqueens.rkt")
0 is ignored , we start from 1
(define nqueen-solutions '(#f 1 0 0 2 10 4 40 92))
(define/provide-test-suite test-nqueens
(for ([(iqueens i) (in-indexed nqueen-solutions)]
#:when (> i 0))
(check-eq? (solve-nqueens i) iqueens)))
| null | https://raw.githubusercontent.com/sunshowers/z3.rkt/769a734f9751ba2053bdff194d951ca6b21cea9c/tests/test-nqueens.rkt | racket | #lang racket
(require rackunit)
(require "../examples/nqueens.rkt")
0 is ignored , we start from 1
(define nqueen-solutions '(#f 1 0 0 2 10 4 40 92))
(define/provide-test-suite test-nqueens
(for ([(iqueens i) (in-indexed nqueen-solutions)]
#:when (> i 0))
(check-eq? (solve-nqueens i) iqueens)))
| |
5ce72e958c19529582e8fa73a070f9dced12501c59c7b9181bb5a3f77030fff1 | vernemq/vernemq | vmq_ws_transport.erl | Copyright 2018 Erlio GmbH Basel Switzerland ( )
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/vernemq/vernemq/eb1a262035af47e90d9edf07f36c1b1503557c1f/apps/vmq_server/test/vmq_ws_transport.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2018 Erlio GmbH Basel Switzerland ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vmq_ws_transport).
-export([connect/4,
send/2,
recv/3,
close/1
]).
connect(Host, ... |
49ae349be50a87ed1cb06fe4fe9265a0285fe7a4fd7fc2f03987136dc48dac0f | well-typed/large-records | R020.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.Generics_LR.Sized.R020 where
import Data.Aeson (Value)
import Bench.HList
import Experiment.Generics_LR
import Common.H... | null | https://raw.githubusercontent.com/well-typed/large-records/551f265845fbe56346988a6b484dca40ef380609/large-records-benchmarks/bench/experiments/Experiment/Generics_LR/Sized/R020.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.Generics_LR.Sized.R020 where
import Data.Aeson (Value)
import Bench.HList
import Experiment.Generics_LR
import Common.HListOfSize.HL020
hlistToJSON :: HList ExampleFields -> Value
hlistToJSON = gtoJSON |
1a9bb800d9f643287599cd4108153dbc154d4bc305b5055565aa3bba2d515860 | glondu/belenios | tool_js_questions.ml | (**************************************************************************)
(* BELENIOS *)
(* *)
Copyright © 2012 - 2022
(* ... | null | https://raw.githubusercontent.com/glondu/belenios/5306402c15c6a76438b13b8b9da0f45d02a0563d/src/web/clients/tool/tool_js_questions.ml | ocaml | ************************************************************************
BELENIOS
This program is free softw... | Copyright © 2012 - 2022
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
exemption that compiling , linking , and/or using OpenSSL is allowed .
You should have rece... |
17717abddc985f47841fc8fa3a23522d4df15246942f15f0447b12ee1f1b015f | clojure-emacs/sayid | test_ns1.clj | (ns com.billpiel.sayid.test-ns1
(:require [com.billpiel.sayid.util.other :refer [$-]]))
(defn func2
[arg1]
arg1)
(defn func1
[arg1]
(func2 arg1))
(defn func-throws
[arg1]
(throw (Exception. (str "Exception from func-throws: " arg1))))
(defn func3-4
[arg1]
arg1)
(defn func3-2
[arg1]
(* 2 arg1)... | null | https://raw.githubusercontent.com/clojure-emacs/sayid/27f35778de9509067716a7bed14306787334a589/test/com/billpiel/sayid/test_ns1.clj | clojure | (ns com.billpiel.sayid.test-ns1
(:require [com.billpiel.sayid.util.other :refer [$-]]))
(defn func2
[arg1]
arg1)
(defn func1
[arg1]
(func2 arg1))
(defn func-throws
[arg1]
(throw (Exception. (str "Exception from func-throws: " arg1))))
(defn func3-4
[arg1]
arg1)
(defn func3-2
[arg1]
(* 2 arg1)... | |
6bc3c12ff47548642af8e5c955c6dcb676435e93d83425446881336e944f05cb | ocaml-multicore/lockfree | bench_spsc_queue.mli | val bench : unit -> Benchmark_result.t
| null | https://raw.githubusercontent.com/ocaml-multicore/lockfree/7ea6efc60aa32856275a1bd621b786e1ea2b1db0/bench/bench_spsc_queue.mli | ocaml | val bench : unit -> Benchmark_result.t
| |
c25e39e84e756106cd0a69954c5cc9c67963ce0a50b14f444054af02fcf96421 | ocsigen/lwt | test_lwt_mvar.ml | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
open Test
let state_is =
Lwt.debug_state_is
let suite = suite "lwt_mvar" [
test "basic take" begin fun () ->
let x = Lwt_mvar.create 0 in
let y = Lwt_... | null | https://raw.githubusercontent.com/ocsigen/lwt/9943ba77a5508feaea5e1fb60b011db4179f9c61/test/core/test_lwt_mvar.ml | ocaml | This file is part of Lwt , released under the MIT license . See LICENSE.md for
details , or visit .
details, or visit . *)
open Lwt.Infix
open Test
let state_is =
Lwt.debug_state_is
let suite = suite "lwt_mvar" [
test "basic take" begin fun () ->
let x = Lwt_mvar.create 0 in
let y = Lwt_... | |
2fe1eba8f41666d588c689d95e970cfe5874a239d30bb95a065abfc61b4a3e2b | lread/test-doc-blocks | amalg_ns.clj | (ns ^:no-doc lread.test-doc-blocks.impl.amalg-ns
"Support for amalgamating refs from found (require ...), (import ...) and (refer-clojure ...) forms.
Here we try to amalgate the forms of interest we found via lread.test-doc-blocks.impl.inline-ns.
The end goal is to plunk these into the generated test ns declarat... | null | https://raw.githubusercontent.com/lread/test-doc-blocks/3ec9020c51e3b69408120a11df228e6416c453a9/src/lread/test_doc_blocks/impl/amalg_ns.clj | clojure | will not normalize clj shorthand at this time
don't need 'require
don't need the quote
don't need 'import
flatten
turf quote if present
flatten
normalize shorthand to fully qualified
ok, next (import ...) | (ns ^:no-doc lread.test-doc-blocks.impl.amalg-ns
"Support for amalgamating refs from found (require ...), (import ...) and (refer-clojure ...) forms.
Here we try to amalgate the forms of interest we found via lread.test-doc-blocks.impl.inline-ns.
The end goal is to plunk these into the generated test ns declarat... |
1726d00ef1d124b650c9cce02c477b7bace0bdde106cd9577a4c3b4682fe55f4 | billstclair/trubanc-lisp | misc.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
$ Header : /usr / local / cvsrep / hunchentoot / misc.lisp , v 1.17 2008/03/17 11:40:25 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/hunchentoot-1.0.0/misc.lisp | lisp | Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and t... | $ Header : /usr / local / cvsrep / hunchentoot / misc.lisp , v 1.17 2008/03/17 11:40:25 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :... |
d99b1c98041543d7adb9fc42a6b25a86dd6348d7c97a9f25605a0b6de4854f58 | Kappa-Dev/KappaTools | tools.mli | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/dataStructures/tools.mli | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
val iteri : (int -> unit) -> int -> unit
val recti : ('a -> int -> 'a) -> 'a -> int -> 'a
* [ recti f x n ] = f ( f ( f .. ( f ( f x 0 ) 1 ) .. ) ( n-1 )
val array_compare : ('a -> 'a -> int) -> 'a array -> 'a array -> int
val array_map... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.