_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 |
|---|---|---|---|---|---|---|---|---|
47e9e8d902ee5ccaac646922f28d89f6eabc4aa3153363ce5fae0311a3f6fb4d | spawngrid/htoad | test.erl | -module(test).
-compile({parse_transform, test_pt}).
-export([f/1]).
-export_records([r]).
-record(r, {a = [1,2,3],
b}).
f(X) ->
X.
| null | https://raw.githubusercontent.com/spawngrid/htoad/f0c7dfbd911b29fb0c406b7c26606f553af11194/deps/parse_trans/examples/test.erl | erlang | -module(test).
-compile({parse_transform, test_pt}).
-export([f/1]).
-export_records([r]).
-record(r, {a = [1,2,3],
b}).
f(X) ->
X.
| |
27c4c91a099933e94a86b9814c0944fa664380e36f924ff38255472e11459729 | argp/bap | batBase64.mli |
* Base64 - Base64 codec
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option ) any l... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batBase64.mli | ocaml | * This exception is raised when reading an invalid character
from a base64 input.
* This exception is raised if the encoding or decoding table
size is not correct.
* Encode a string into Base64.
* Decode a string encoded into Base64, raise [Invalid_char] if a
character in the input string is not a valid one.
* G... |
* Base64 - Base64 codec
* Copyright ( C ) 2003
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option ) any l... |
d71b186ce13e59c012048f4d8976034f041235ba262843c3c88db8d89175097f | erszcz/learning | myapp_c1.erl | -module(myapp_c1).
-behaviour(gen_server).
%% API
-export([
start_link/0
]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, myapp_c1).
-record(state, {}).
%%%==============================================... | null | https://raw.githubusercontent.com/erszcz/learning/b21c58a09598e2aa5fa8a6909a80c81dc6be1601/erlang-gen-server-stub/src/myapp_c1.erl | erlang | API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
==============================================================... | -module(myapp_c1).
-behaviour(gen_server).
-export([
start_link/0
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER, myapp_c1).
-record(state, {}).
start_link() ->
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
... |
07fad5d2d61c2636cc6456da99f0962427d4ed68920bc4485fcc5be94316278b | haroldcarr/learn-haskell-coq-ml-etc | X_2013_05_program_imperatively_using_haskell.hs | module X_2013_05_program_imperatively_using_haskell
where
Created : 2013 Oct 05 ( Sat ) 18:42:23 by .
Last Modified : 2015 Sep 01 ( Tue ) 14:49:40 by .
-imperatively-using-haskell.html
Created : 2013 Oct 05 (Sat) 18:42:23 by carr.
Last Modified : 2015 Sep 01 (Tue) 14:49:40 by Harold Carr.
-imp... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/general/haskellforall/src/X_2013_05_program_imperatively_using_haskell.hs | haskell |
execStateT strike initialState
newState <- execStateT strike initialState
newState^.boss.health
newState <- execStateT fireBreath' initialState
toListOf partyHP newState
initialState^..partyHP
newState^..partyHP
initialState^..units.traversed.position
newState <- execStateT (fireBreath (Point 0.5 1.5)) initialStat... | module X_2013_05_program_imperatively_using_haskell
where
Created : 2013 Oct 05 ( Sat ) 18:42:23 by .
Last Modified : 2015 Sep 01 ( Tue ) 14:49:40 by .
-imperatively-using-haskell.html
Created : 2013 Oct 05 (Sat) 18:42:23 by carr.
Last Modified : 2015 Sep 01 (Tue) 14:49:40 by Harold Carr.
-imp... |
6acd7dd9408e25f32868900b04bc0db4c6eefdefa61a08b4a03d9cf0dd415731 | HealthSamurai/re-form | csv_input_impl.cljs | (ns re-form.inputs.csv-input-impl
(:require
[reagent.core :as reagent]
[re-frame.core :as rf]
[clojure.string :as str]))
(def re-list-style
[:.re-list {}])
(defn- parse-value [x]
(->> (str/split x #",")
(mapv str/trim)
(filterv #(not (str/blank? %)))))
(defn- *re-list [{on-change :on-cha... | null | https://raw.githubusercontent.com/HealthSamurai/re-form/810321d67e3946876c834998e3472d0693846953/src/cljs/re_form/inputs/csv_input_impl.cljs | clojure | (ns re-form.inputs.csv-input-impl
(:require
[reagent.core :as reagent]
[re-frame.core :as rf]
[clojure.string :as str]))
(def re-list-style
[:.re-list {}])
(defn- parse-value [x]
(->> (str/split x #",")
(mapv str/trim)
(filterv #(not (str/blank? %)))))
(defn- *re-list [{on-change :on-cha... | |
c2173d8077c56e87dcdf2755785bf34da77e61361db57cb03a59caf197d28f0f | JustusAdam/language-haskell | T0104.hs | SYNTAX TEST " source.haskell " " Comments in export lists "
module StockQuote
( getQuote
-- ^^^^^^^^^^^^^ comment.line.double-dash.haskell
-- ) where
-- ^^^^^^^^^^ comment.line.double-dash.haskell
-- ^^^^^ - keyword.other.where.haskell
where
| null | https://raw.githubusercontent.com/JustusAdam/language-haskell/c9ee1b3ee166c44db9ce350920ba502fcc868245/test/tickets/T0104.hs | haskell | ^^^^^^^^^^^^^ comment.line.double-dash.haskell
) where
^^^^^^^^^^ comment.line.double-dash.haskell
^^^^^ - keyword.other.where.haskell | SYNTAX TEST " source.haskell " " Comments in export lists "
module StockQuote
( getQuote
where
|
dd97f7846ab4a6d31904f6425bc44c490df98740faa358164ff310d4047cff50 | alaricsp/chicken-scheme | chicken-profile.scm | ;;;; chicken-profile.scm - Formatted display of profile outputs - felix -*- Scheme -*-
;
Copyright ( c ) 2000 - 2007 ,
Copyright ( c ) 2008 - 2009 , The Chicken Team
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followi... | null | https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/chicken-profile.scm | scheme | chicken-profile.scm - Formatted display of profile outputs - felix -*- Scheme -*-
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright n... | Copyright ( c ) 2000 - 2007 ,
Copyright ( c ) 2008 - 2009 , The Chicken Team
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIM... |
b258e0e2ebaa41651cc9f7ebcf14693ed5b789468286a381bd7fbe63236ca8e1 | kunstmusik/music-examples | grains.clj | (ns music-examples.grains
(:require [score.core :refer :all]
[score.freq :refer :all])
(:require [pink.simple :refer :all]
[pink.config :refer :all]
[pink.envelopes :refer [xar]]
[pink.util :refer [mul !r!]]
[pink.instruments.horn :refer :all]
... | null | https://raw.githubusercontent.com/kunstmusik/music-examples/6d0410be272d0b86c1851e943c07515af37e5f7a/src/music_examples/grains.clj | clojure | (ns music-examples.grains
(:require [score.core :refer :all]
[score.freq :refer :all])
(:require [pink.simple :refer :all]
[pink.config :refer :all]
[pink.envelopes :refer [xar]]
[pink.util :refer [mul !r!]]
[pink.instruments.horn :refer :all]
... | |
59ae50d6390e9e14423cc62a3d7972533be891190a238e8d22eb130e3fa2b898 | unisonweb/unison | MonadPretty.hs | {-# LANGUAGE ConstraintKinds #-}
module Unison.PrettyPrintEnv.MonadPretty where
import Control.Lens (over, set, view, views, _1, _2)
import Control.Monad.Reader (MonadReader, Reader, local, runReader)
import qualified Data.Set as Set
import Unison.Prelude (Set)
import Unison.PrettyPrintEnv (PrettyPrintEnv)
import Uni... | null | https://raw.githubusercontent.com/unisonweb/unison/cf278f9fb66ccb9436bf8a2eb4ab03fc7a92021d/parser-typechecker/src/Unison/PrettyPrintEnv/MonadPretty.hs | haskell | # LANGUAGE ConstraintKinds #
| Run a computation with a modified PrettyPrintEnv, restoring the original
| Run a computation with a modified PrettyPrintEnv, restoring the original
| Add type variables to the set of variables that need to be avoided
| Check if a list of type variables contains any variables that need... |
module Unison.PrettyPrintEnv.MonadPretty where
import Control.Lens (over, set, view, views, _1, _2)
import Control.Monad.Reader (MonadReader, Reader, local, runReader)
import qualified Data.Set as Set
import Unison.Prelude (Set)
import Unison.PrettyPrintEnv (PrettyPrintEnv)
import Unison.Var (Var)
type MonadPretty v... |
74a7ada36ec8a5d8269bc2f3a0dd2a8458933d238f1d00c09be1fe431f9abc9a | SimulaVR/godot-haskell | InputEventKey.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.InputEventKey
(Godot.Core.InputEventKey.is_echo,
... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/InputEventKey.hs | haskell | # NOINLINE bindInputEventKey_set_scancode # | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.InputEventKey
(Godot.Core.InputEventKey.is_echo,
... |
8286898543c34cfaca25064edf8b7e09affdd1df4ba55c7e83d406986f694e6f | haskell-servant/servant | Ghcjs.hs | -- | This module provides 'client' which can automatically generate
-- querying functions for each endpoint just from the type representing your
-- API.
module Servant.Client.Ghcjs
(
client
, ClientM
, runClientM
, ClientEnv(..)
, module Servant.Client.Core.Reexport
) where
import Servant.Client.Intern... | null | https://raw.githubusercontent.com/haskell-servant/servant/d06b65c4e6116f992debbac2eeeb83eafb960321/servant-client-ghcjs/src/Servant/Client/Ghcjs.hs | haskell | | This module provides 'client' which can automatically generate
querying functions for each endpoint just from the type representing your
API. | module Servant.Client.Ghcjs
(
client
, ClientM
, runClientM
, ClientEnv(..)
, module Servant.Client.Core.Reexport
) where
import Servant.Client.Internal.XhrClient
import Servant.Client.Core.Reexport
|
a34aa888037fa6ff889c85e8f1b307711571095faebf3f527ed523bedfe812a4 | haskell-tools/haskell-tools | RecordWildcards.hs | # LANGUAGE RecordWildCards #
module Refactor.ExtractBinding.RecordWildcards where
data Point = Point { x :: Double, y :: Double }
d = (\(Point {..}) -> x + y) (Point 1 2)
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/ExtractBinding/RecordWildcards.hs | haskell | # LANGUAGE RecordWildCards #
module Refactor.ExtractBinding.RecordWildcards where
data Point = Point { x :: Double, y :: Double }
d = (\(Point {..}) -> x + y) (Point 1 2)
| |
df5fb8054e679d98c679c2f0fd3222a6a22a7255ffb20b578f62e1380be2a02f | google/hrepl | PluginLib.hs | Copyright 2020 Google LLC
--
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, software
distributed un... | null | https://raw.githubusercontent.com/google/hrepl/2648a55cc38407c5b60a3a086217e2d827ca6cb6/hrepl/tests/PluginLib.hs | haskell |
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 per... | Copyright 2020 Google LLC
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
| Test that we can load and use GHC plugins .
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
module PluginLib ... |
34b4c7c00312d5da1bcf151240ee29e235c7eb188637ccc5ed191e5e298a8c4e | gafiatulin/codewars | ProcessTree.hs | -- Process trees
-- /
module ProcessTree where
import ProcessTree.Process
import Data.Maybe (fromJust)
import Data.Tuple (swap)
import Data.List (partition)
makeTree :: [(PID, PID)] -> Process
makeTree ps = subTree rootPID . filter (/= (rootPID, -1)) $ ps
where rootPID = fromJust . lookup (-1) . map swap $ ps
... | null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/5%20kyu/ProcessTree.hs | haskell | Process trees
/ |
module ProcessTree where
import ProcessTree.Process
import Data.Maybe (fromJust)
import Data.Tuple (swap)
import Data.List (partition)
makeTree :: [(PID, PID)] -> Process
makeTree ps = subTree rootPID . filter (/= (rootPID, -1)) $ ps
where rootPID = fromJust . lookup (-1) . map swap $ ps
subTree parent... |
01187b14435a71a38262f4f205ef74b9a4bf10b0a5d2f91ad7ececf202cbee0f | adventuring/tootsville.net | json.lisp | (defpackage #:json-reader
(:use #:cl)
(:export #:enable-json-syntax
#:disable-json-syntax))
(in-package #:json-reader)
(defconstant +left-bracket+ #\[)
(defconstant +right-bracket+ #\])
(defconstant +left-brace+ #\{)
(defconstant +right-brace+ #\})
(defconstant +comma+ #\,)
(defconstant +colon+ #\:)
(... | null | https://raw.githubusercontent.com/adventuring/tootsville.net/985c11a91dd1a21b77d7378362d86cf1c031b22c/src/lib/oliphaunt/json.lisp | lisp | (defpackage #:json-reader
(:use #:cl)
(:export #:enable-json-syntax
#:disable-json-syntax))
(in-package #:json-reader)
(defconstant +left-bracket+ #\[)
(defconstant +right-bracket+ #\])
(defconstant +left-brace+ #\{)
(defconstant +right-brace+ #\})
(defconstant +comma+ #\,)
(defconstant +colon+ #\:)
(... | |
a4ccef1fcf20c7e61dd65b096718b5731b85d66a27fb20cb3cfba9eb64a9b73c | ejgallego/HOARe2 | ecPException.ml | (* -------------------------------------------------------------------- *)
type exn_printer = Format.formatter -> exn -> unit
(* -------------------------------------------------------------------- *)
let exn_printers = (Stack.create () : exn_printer Stack.t)
(* -------------------------------------------------------... | null | https://raw.githubusercontent.com/ejgallego/HOARe2/48d8760696fdf4b8a3eda5a4d2a53eeba53072d8/src-ec/ecPException.ml | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-----------------------------------... | type exn_printer = Format.formatter -> exn -> unit
let exn_printers = (Stack.create () : exn_printer Stack.t)
let core_printer fmt exn =
Format.fprintf fmt "anomaly: %s, please report"
(Printexc.to_string exn)
let () = Stack.push core_printer exn_printers
let register ppexn = Stack.push ppexn exn_printers
e... |
e0b76675de6dac0b6b6863281e2eee0156002412f90219b08d23b52bae6271fa | ropas/sparrow | test.ml | (***********************************************************************)
(* *)
Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
(* All rights reserved... | null | https://raw.githubusercontent.com/ropas/sparrow/3ec055b8c87b5c8340ef3ed6cde34f5835865b31/test/test.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 .
let analyzer = "../bin/sparrow"
let default_opt = "-verbose 0"
type test_suite = {
opt: string;... |
eae9e628606ce692f055ab7db0366d23f43bc61ed6a16ad6105bf5d3384bf484 | CryptoKami/cryptokami-core | SecretStorage.hs | module Pos.Ssc.SecretStorage
( getOurCommitment
, getOurOpening
, putOurSecret
) where
import Universum
import Pos.Binary.Ssc.Types ()
import Pos.Core (EpochIndex)
import Pos.Core.Ssc (Opening, SignedCommitment)
import Pos.DB (MonadDB, Mona... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/ssc/Pos/Ssc/SecretStorage.hs | haskell | | Get our commitment for given epoch if it's known.
| Get our opening corresponding for given epoch if it's known.
[FIXME] This function doesn't care about concurrency! It should be atomic.
Old code didn't care too, btw.
| Put our secret for given epoch.
------------------------------------------------------------... | module Pos.Ssc.SecretStorage
( getOurCommitment
, getOurOpening
, putOurSecret
) where
import Universum
import Pos.Binary.Ssc.Types ()
import Pos.Core (EpochIndex)
import Pos.Core.Ssc (Opening, SignedCommitment)
import Pos.DB (MonadDB, Mona... |
10426d24af6c428c73df305b181ec627a52e4ac5a56a31c2b992a673c55ac10c | haskell-jp/makeMistakesToLearnHaskell | Regex.hs | {-# OPTIONS_GHC -Wno-unused-imports #-}
| Thin wrapper around @Text . Regex . Applicative@
-- useful for evaluating source code input by the user.
module Education.MakeMistakesToLearnHaskell.Evaluator.Regex
( GhcToken
, matchSub
, matchesSub
, dropUntilFirst
, singleArgFunApp
) where
#include <impo... | null | https://raw.githubusercontent.com/haskell-jp/makeMistakesToLearnHaskell/1174d5c6bb82e57622be8033607a4d049e30ae7e/src/Education/MakeMistakesToLearnHaskell/Evaluator/Regex.hs | haskell | # OPTIONS_GHC -Wno-unused-imports #
useful for evaluating source code input by the user.
NOTE: Depth seeems required due to the limitation of regex-applicative,
which has to scan all regex before executing. |
| Thin wrapper around @Text . Regex . Applicative@
module Education.MakeMistakesToLearnHaskell.Evaluator.Regex
( GhcToken
, matchSub
, matchesSub
, dropUntilFirst
, singleArgFunApp
) where
#include <imports/external.hs>
import Education.MakeMistakesToLearnHaskell.Evaluator.Types
type GhcT... |
4061ee47b821e100388a57908a20abb1f92709d3305a640e76dcc6f4fd3c320e | ocaml/dune | jsoo_rules.ml | open Import
module Config : sig
type t
val all : t list
val path : t -> string
val of_string : string -> t
val of_flags : string list -> t
val to_flags : t -> string list
end = struct
type t =
{ js_string : bool option
; effects : bool option
; toplevel : bool option
}
let default... | null | https://raw.githubusercontent.com/ocaml/dune/5463cd87c573c28c71d513fbecd8cb17dbdb27b7/src/dune_rules/jsoo/jsoo_rules.ml | ocaml | open Import
module Config : sig
type t
val all : t list
val path : t -> string
val of_string : string -> t
val of_flags : string list -> t
val to_flags : t -> string list
end = struct
type t =
{ js_string : bool option
; effects : bool option
; toplevel : bool option
}
let default... | |
16474ed167c0bc77a971b0e23d693386b449cc1cc38cf0e71f0a44a264c8db89 | techascent/tech.datatype | concat.clj | (ns tech.v2.datatype.iterable.concat
(:require [tech.v2.datatype.protocols :as dtype-proto]
[tech.v2.datatype.casting :as casting]
[tech.v2.datatype.typecast :as typecast]))
(defmacro make-concat-iterable-impl
[datatype]
`(fn [datatype# concat-args#]
(reify
dtype-proto/PDatat... | null | https://raw.githubusercontent.com/techascent/tech.datatype/8cc83d771d9621d580fd5d4d0625005bd7ab0e0c/src/tech/v2/datatype/iterable/concat.clj | clojure | (ns tech.v2.datatype.iterable.concat
(:require [tech.v2.datatype.protocols :as dtype-proto]
[tech.v2.datatype.casting :as casting]
[tech.v2.datatype.typecast :as typecast]))
(defmacro make-concat-iterable-impl
[datatype]
`(fn [datatype# concat-args#]
(reify
dtype-proto/PDatat... | |
cf7e8989a3fcb6908be03c326ebc64482e1753d951089131be130c035f260f75 | cxphoe/SICP-solutions | 4.62.rkt | (rule (last-pair (?x) (?x)))
(rule (last-pair (?v . ?z) (?x))
(last-pair ?z ?x)) | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%204-Metalinguistic%20Abstraction/4.Logical%20Programing/4.62.rkt | racket | (rule (last-pair (?x) (?x)))
(rule (last-pair (?v . ?z) (?x))
(last-pair ?z ?x)) | |
684c22314a684578519740606e9f98f7054b06b02efb0f0535afcbc14d5fba5f | clojure-interop/aws-api | AmazonSimpleWorkflowAsyncClient.clj | (ns com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowAsyncClient
"Client for accessing Amazon SWF asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Amazon Simple... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.simpleworkflow/src/com/amazonaws/services/simpleworkflow/AmazonSimpleWorkflowAsyncClient.clj | clojure | (ns com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowAsyncClient
"Client for accessing Amazon SWF asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Amazon Simple... | |
dcac1a2967e8a64b5faebb25412172a164bb7ea97dfcb9e809857f28e75244f1 | ChrisPenner/dumbwaiter | Responders.hs | # language NamedFieldPuns #
{-# language OverloadedStrings #-}
module Dumbwaiter.Responders
( allResponders
) where
import qualified Data.Map as M
import Data.Maybe
import qualified Data.CaseInsensitive as CI
import Data.Aeson.Lens
import Control.Lens
import Data.Text.Lens (packed)
import Data.Monoid
import Dumbwa... | null | https://raw.githubusercontent.com/ChrisPenner/dumbwaiter/f47eb441a9083fe1c66dcacc2f0de8e993464372/src/Dumbwaiter/Responders.hs | haskell | # language OverloadedStrings # | # language NamedFieldPuns #
module Dumbwaiter.Responders
( allResponders
) where
import qualified Data.Map as M
import Data.Maybe
import qualified Data.CaseInsensitive as CI
import Data.Aeson.Lens
import Control.Lens
import Data.Text.Lens (packed)
import Data.Monoid
import Dumbwaiter.Types
import Control.Monad.IO.... |
d5dcf1a743e0e47cbab94be8c8569757c12bedde615aa5937fb5283510ed2d47 | OCamlPro/digodoc | patchtml.ml | open Soup
open Ez_file
(* arguments must be valid html, header and footer will be inserted,
respectively, at the top and bottom of the body *)
let edit_html ?header ?footer ~head_childs html =
let html = parse html in
let body = html $ "body" in
let opt_inserter f o id =
Option.iter (fun e ->
f ( pa... | null | https://raw.githubusercontent.com/OCamlPro/digodoc/c7694f2624a1b432caf16998f63b4da297539048/src/digodoc_common/patchtml.ml | ocaml | arguments must be valid html, header and footer will be inserted,
respectively, at the top and bottom of the body
Keeps us from processing url links
Keeps us from processing mail addresses
Keeps us from processing anchors
Escape through this branch if the link points to an http(s) address,
* or is an anc... | open Soup
open Ez_file
let edit_html ?header ?footer ~head_childs html =
let html = parse html in
let body = html $ "body" in
let opt_inserter f o id =
Option.iter (fun e ->
f ( parse e $$ id ) ) o
in
opt_inserter
(fun e -> rev e |> iter (fun e -> prepend_child body e))
header
"#header"... |
3e5ac0da9592086ee91b14e976d58b8b90251ddedd5a50557702c10a5582da9f | graninas/Functional-Design-and-Architecture | Components.hs | module Andromeda.TestData.Components where
import Andromeda.Hardware
import qualified Andromeda.Hardware.Impl.Device.Types as D
import qualified Data.Map as Map
thermometer1Passp :: ComponentPassport
thermometer1Passp =
ComponentPassport (Sensors Temperature) "t1" "t1" "t1"
pressure1Passp :: ComponentPassport
pre... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/735ab44d84ade9825f90cdc83907b95000d089ed/Second-Edition-Manning-Publications/BookSamples/CH04/Section4p2/test/Andromeda/TestData/Components.hs | haskell | module Andromeda.TestData.Components where
import Andromeda.Hardware
import qualified Andromeda.Hardware.Impl.Device.Types as D
import qualified Data.Map as Map
thermometer1Passp :: ComponentPassport
thermometer1Passp =
ComponentPassport (Sensors Temperature) "t1" "t1" "t1"
pressure1Passp :: ComponentPassport
pre... | |
c8d480c0d67688cc5969587fc2e9e2866dfc875b1999c0f9428ee2d56f9b9da6 | mbutterick/typesetting | test22.rkt | #lang debug racket/base
(require pitfall/pdftest)
subset OTF font
(define-runtime-path fira "assets/fira.otf")
(define-runtime-path noto "assets/noto-emoji/NotoEmoji-Regular.ttf")
;; embed otf
(define (proc doc)
Use a font with 2048 em ( noto )
(register-font doc "noto" (path->string noto))
;; Set the font,... | null | https://raw.githubusercontent.com/mbutterick/typesetting/6f7a8bbc422a64d3a54cbbbd78801a01410f5c92/pitfall/ptest/test22.rkt | racket | embed otf
Set the font, draw some text
test against non-subsetted font version | #lang debug racket/base
(require pitfall/pdftest)
subset OTF font
(define-runtime-path fira "assets/fira.otf")
(define-runtime-path noto "assets/noto-emoji/NotoEmoji-Regular.ttf")
(define (proc doc)
Use a font with 2048 em ( noto )
(register-font doc "noto" (path->string noto))
[font doc "noto"]
[font-siz... |
2107b7df7c09c94e0d98bc3d27c325f0cab346ca43a40a71eb0d69632769c651 | bootstrapworld/curr | bootstrap-common.rkt | (module bootstrap-common scheme
(require 2htdp/image
2htdp/universe
"bootstrap-testing.rkt"
(except-in htdp/testing test)
(for-syntax scheme/base)
"save-source.rkt"
lang/posn
scheme/base
(prefix-in draw: racket/draw))
(provide ... | null | https://raw.githubusercontent.com/bootstrapworld/curr/443015255eacc1c902a29978df0e3e8e8f3b9430/courses/reactive/resources/teachers/teachers-guide/teachpacks/bootstrap-common.rkt | racket |
***PLATFORM-SPECIFIC CHANGE*** ;;;;;;;;;;;;;;;;;;;;;;;;;
; ONLY : comment this line out
warn : any* -> any, and a side effect.
display all arguments and return the last one.
type : any -> String
color-object->color-struct Color% -> Color
color-near? : Color Color Number -> Boolean
color=? : Color Color -> B... | (module bootstrap-common scheme
(require 2htdp/image
2htdp/universe
"bootstrap-testing.rkt"
(except-in htdp/testing test)
(for-syntax scheme/base)
"save-source.rkt"
lang/posn
scheme/base
(prefix-in draw: racket/draw))
(provide ... |
474962e24445c2c34925cda9cbf546498029f8ab760c260861f05ec480270b21 | MaskRay/OJHaskell | nlp-compute-the-perplexity.hs | main = print $ round $ 2 ** 9.91
| null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/HackerRank/ai/nlp-compute-the-perplexity.hs | haskell | main = print $ round $ 2 ** 9.91
| |
e7de397b27c76ac3c7a234654b6e7b0dd849f25c8c5de6ec64c0b66de11351e3 | jgm/zip-archive | test-zip-archive.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
-- Test suite for Codec.Archive.Zip
-- runghc Test.hs
import Codec.Archive.Zip
import Control.Monad (unless)
import Control.Exception (try, catch, SomeException)
import System.Directory hiding (isSymbolicLink)
import Test.HUnit.Bas... | null | https://raw.githubusercontent.com/jgm/zip-archive/ea08f39ed10303a7de76c340dc349934c118cf20/tests/test-zip-archive.hs | haskell | Test suite for Codec.Archive.Zip
runghc Test.hs
define equality for Archives so timestamps aren't distinguished if they | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
import Codec.Archive.Zip
import Control.Monad (unless)
import Control.Exception (try, catch, SomeException)
import System.Directory hiding (isSymbolicLink)
import Test.HUnit.Base
import Test.HUnit.Text
import qualified Data.ByteStr... |
58f4c034e320e9c8d0d47599b36cb8ef9a53b6c9ff0b65db6309bca3aa79f3b9 | rtoy/cmucl | gtn.lisp | ;;; -*- Package: C; Log: C.Log -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/compiler/gtn.lisp $")
;;;
;;... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/gtn.lisp | lisp | -*- Package: C; Log: C.Log -*-
**********************************************************************
**********************************************************************
that hold the values of lexical variables and determines the calling
conventions and passing locations used in function calls.
We m... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/compiler/gtn.lisp $")
This file contains the pass in the compiler . allocates the TNs
Written by
(in-package "C")
(intl:textdomain "c... |
ea0062c5de64137135e579285d7ad9743cabc4c4caaf5745f5b2f390788b41d4 | thlack/surfs | section.clj | (ns ^:no-doc thlack.surfs.blocks.spec.section
(:require [clojure.spec.alpha :as s]
[thlack.surfs.composition.spec :as comp.spec]
[thlack.surfs.elements.spec :as elements.spec]
[thlack.surfs.strings.spec :as strings.spec :refer [deftext]]))
(s/def ::type #{:section})
(deftext ::te... | null | https://raw.githubusercontent.com/thlack/surfs/e03d137d6d43c4b73a45a71984cf084d2904c4b0/src/thlack/surfs/blocks/spec/section.clj | clojure | (ns ^:no-doc thlack.surfs.blocks.spec.section
(:require [clojure.spec.alpha :as s]
[thlack.surfs.composition.spec :as comp.spec]
[thlack.surfs.elements.spec :as elements.spec]
[thlack.surfs.strings.spec :as strings.spec :refer [deftext]]))
(s/def ::type #{:section})
(deftext ::te... | |
cde585faebb56aa2be20904d524a2d329ec99dc863cbdc9d988b5ab7496f2de1 | ichistmeinname/free-theorems | Frontend.hs |
-- | Defines functions to ensure that only valid declarations and type
signatures are fed to the FreeTheorems library . The given functions are
intended as second stage after parsing declarations .
module Language.Haskell.FreeTheorems.Frontend (
Checked
, Parsed
, runChecks
, check
, checkAgains... | null | https://raw.githubusercontent.com/ichistmeinname/free-theorems/55f8b7366d960859f303ee81f326428a6ba4976b/free-theorems/src/Language/Haskell/FreeTheorems/Frontend.hs | haskell | | Defines functions to ensure that only valid declarations and type
| Checks a list of declarations.
It returns a list of all declarations which are valid and an error message
for all those declarations which are not valid.
| Checks a list of declarations against a given list of valid
declarations.
valid... |
signatures are fed to the FreeTheorems library . The given functions are
intended as second stage after parsing declarations .
module Language.Haskell.FreeTheorems.Frontend (
Checked
, Parsed
, runChecks
, check
, checkAgainst
) where
import Data.Generics (everything, extQ, mkQ)
import Data.L... |
df9d8efe0f0aed962d0b76436ab35f8354be7c9b964d5d40e751f281431ed6a4 | karamellpelle/grid | State.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/source/Game/LevelPuzzle/Output/Fancy/State.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Game.LevelPuzzle.Output.Fancy.State
(
... |
71f7431ab1ba66099e29d7efaa0ac027befec044cd73f8a47db93615e6956a75 | matijapretnar/eff | untypedSyntax.mli | open Utils
(** Syntax of the core language. *)
type variable = Term.Variable.t
type effect = Effect.t
type label = Type.Label.t
type field = Type.Field.t
type pattern = plain_pattern located
and plain_pattern =
| PVar of variable
| PAnnotated of pattern * Type.ty
| PAs of pattern * variable
| PTuple of p... | null | https://raw.githubusercontent.com/matijapretnar/eff/0b0ec7a83e7db4d040ed8fdfc1ac6e3c0f344be1/src/01-language/untypedSyntax.mli | ocaml | * Syntax of the core language.
* Pure expressions
* Impure computations
* Handler definitions | open Utils
type variable = Term.Variable.t
type effect = Effect.t
type label = Type.Label.t
type field = Type.Field.t
type pattern = plain_pattern located
and plain_pattern =
| PVar of variable
| PAnnotated of pattern * Type.ty
| PAs of pattern * variable
| PTuple of pattern list
| PRecord of pattern T... |
71d8051e8e673147d6c904bb5dfe1ce5e4b947d3269e0fb35eeb81e165c8d189 | gmarpons/asciidoc-hs | Metadata.hs | {-# LANGUAGE OverloadedStrings #-}
module Tests.Metadata
( metadataUnitTests,
)
where
import qualified Data.IntMap as IntMap
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.Map as Map
import Data.Semigroup (Last (..))
import Data.Text (Text)
import Test.Hspec.Expectations.Pretty (shouldBe)
import ... | null | https://raw.githubusercontent.com/gmarpons/asciidoc-hs/7bcda1dcbb70747563085d3926ddd2ddf7fc2250/test/Tests/Metadata.hs | haskell | # LANGUAGE OverloadedStrings #
in shortand syntax.
in shortand syntax. |
module Tests.Metadata
( metadataUnitTests,
)
where
import qualified Data.IntMap as IntMap
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.Map as Map
import Data.Semigroup (Last (..))
import Data.Text (Text)
import Test.Hspec.Expectations.Pretty (shouldBe)
import Test.Tasty (TestTree, testGroup)
im... |
f864bcb41a39503f3224419a24fadd547e28f4ba264d4ac27a985dfa02d67236 | kupl/FixML | sub48.ml |
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let rec diff : aexp * string -> aexp
= fun (exp, var) -> match exp with
| Const x -> Const 0
| Var x -> if x = var then Const 1
else Const 0
| Power (x,y) -> if x = var ... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/differentiate/diff1/submissions/sub48.ml | ocaml |
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let rec diff : aexp * string -> aexp
= fun (exp, var) -> match exp with
| Const x -> Const 0
| Var x -> if x = var then Const 1
else Const 0
| Power (x,y) -> if x = var ... | |
9e04574394fe21c749917e583d64babcb47aafaffb9475560949f74ba09fb2d0 | arichiardi/replumb | self.cljc | (ns foo.bar.self
#?(:cljs (:require-macros [foo.bar.self :refer [add]])))
#?(:clj
(defmacro add
[a b]
`(+ ~a ~b)))
#?(:cljs
(defn sum
[a b]
(add a b)))
| null | https://raw.githubusercontent.com/arichiardi/replumb/dde2228f2e364c3bafdf6585bb1bc1c27a3e336c/dev-resources/private/test/src/cljc/foo/bar/self.cljc | clojure | (ns foo.bar.self
#?(:cljs (:require-macros [foo.bar.self :refer [add]])))
#?(:clj
(defmacro add
[a b]
`(+ ~a ~b)))
#?(:cljs
(defn sum
[a b]
(add a b)))
| |
580eb7792585a97350a291aeb6a6804ed13375dfc63deabb3705443d7f368c59 | vmchale/kempe | Harness.hs | module Harness ( goldenOutput
, crossGolden
) where
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Lazy.Char8 as ASCII
import Data.Functor (void)
import Kempe.File
import System.FilePath ((</>))
im... | null | https://raw.githubusercontent.com/vmchale/kempe/6fe9fc7afb4dc47ec072988d2500d53815196526/golden/Harness.hs | haskell | ^ C test harness
^ Golden file path
^ C test harness
^ Golden file path | module Harness ( goldenOutput
, crossGolden
) where
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Lazy.Char8 as ASCII
import Data.Functor (void)
import Kempe.File
import System.FilePath ((</>))
im... |
ba102137d3b92437d75d0e2971a01fce8ca352fd42a3da819ccd178994bbdc6d | johnlinvc/erruby | erruby_class.erl | -module(erruby_class).
-export([new_class/0, new_named_class/1, new_class/1, install_class_class_methods/0, init_class_class/0, class_name/1]).
TODO return self when calling on self
TODO add name parameter
TODO should call initialize method when new
new_class() ->
new_named_class(undefined).
new_named_class(Name)... | null | https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erruby_class.erl | erlang | -module(erruby_class).
-export([new_class/0, new_named_class/1, new_class/1, install_class_class_methods/0, init_class_class/0, class_name/1]).
TODO return self when calling on self
TODO add name parameter
TODO should call initialize method when new
new_class() ->
new_named_class(undefined).
new_named_class(Name)... | |
57a44bf0a6e11cecafc73b2e5376582762ae73f1a424819184ab0f79ee16308e | stefanhts/wacket | types.rkt | #lang racket
(provide (all-defined-out))
(define imm-shift 3)
(define imm-mask #b111)
(define ptr-mask #b111)
(define type-box #b001)
(define type-cons #b010)
(define type-vect #b011)
(define type-str #b100)
(define type-proc #b101)
(define int-shift (+ 1 imm-shift))
(d... | null | https://raw.githubusercontent.com/stefanhts/wacket/e5c4fdc769ca82ca31e0e53baac1a7715e2983b2/lang/types.rkt | racket | #lang racket
(provide (all-defined-out))
(define imm-shift 3)
(define imm-mask #b111)
(define ptr-mask #b111)
(define type-box #b001)
(define type-cons #b010)
(define type-vect #b011)
(define type-str #b100)
(define type-proc #b101)
(define int-shift (+ 1 imm-shift))
(d... | |
ceefd1f158e3118e76f6e7b6290dc2884a64db7ab386649e79bf24fd9bcf268b | runtimeverification/haskell-backend | InfoJsonRpcCancelRequest.hs | # LANGUAGE NoStrict #
# LANGUAGE NoStrictData #
|
Copyright : ( c ) Runtime Verification , 2022
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2022
License : BSD-3-Clause
-}
module Kore.Log.InfoJsonRpcCancelRequest (
InfoJsonRpcCancelRequest (..),
) where
import Log
import Ne... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/389dc03798cdbb0a13907fa1251686d8a61d8b3e/kore/src/Kore/Log/InfoJsonRpcCancelRequest.hs | haskell | # LANGUAGE NoStrict #
# LANGUAGE NoStrictData #
|
Copyright : ( c ) Runtime Verification , 2022
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2022
License : BSD-3-Clause
-}
module Kore.Log.InfoJsonRpcCancelRequest (
InfoJsonRpcCancelRequest (..),
) where
import Log
import Ne... | |
51232f61b18fb773b430c6ef3f1b308c4a83e926b7491d503aa39635672f1a9b | starbelly/hydro | hydro_api_tests.erl | -module(hydro_api_tests).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
%% The expected results below were obtained directly from libhydrogen in C
api_test_() ->
api_harness_gen(1000).
api_harness_gen(N) ->
Funs = [ fun generichash/0,
fun generichash_multi/0,
fun gen... | null | https://raw.githubusercontent.com/starbelly/hydro/ca408c3fbf196d6028fd7af2d71c4348812bf757/test/hydro_api_tests.erl | erlang | The expected results below were obtained directly from libhydrogen in C | -module(hydro_api_tests).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
api_test_() ->
api_harness_gen(1000).
api_harness_gen(N) ->
Funs = [ fun generichash/0,
fun generichash_multi/0,
fun generichash_keyless/0,
fun generichash_multi_keyless/0],
Shuf... |
cc1cd7c83760eca67e2a10a79ffab32b9e6960e8e3a53df505b4556ee8858366 | sbcl/sbcl | insts.lisp | that part of the description of the ARM instruction set ( for
;;;; ARMv5) which can live on the cross-compilation host
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University... | null | https://raw.githubusercontent.com/sbcl/sbcl/f4ad55431f27407e12d204dc9ed23bea48d86d4d/src/compiler/arm64/insts.lisp | lisp | ARMv5) which can live on the cross-compilation host
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Imports from SB-VM into this package
disassembler field definitions
primitive emitters
... | that part of the description of the ARM instruction set ( for
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-ARM64-ASM")
(eval-when (:compile-toplevel :l... |
759f93dcbd2c82afa161893131cd4fa9eb15515883ef7fb532bcbc74521c46a9 | careercup/CtCI-6th-Edition-Clojure | chapter_2_q2.clj | (ns ^{:author "Leeor Engel"}
chapter-2.chapter-2-q2)
;; O(n+k)
(defn kth-to-last [l k]
(let [len (count l)
node-idx (- len k)]
(reduce (fn [idx node]
(if (= idx node-idx)
(reduced node)
(if (= idx len) nil (inc idx)))) 1 l)))
(defn- kth-to-last? [depth le... | null | https://raw.githubusercontent.com/careercup/CtCI-6th-Edition-Clojure/ef151b94978af82fb3e0b1b0cd084d910870c52a/src/chapter_2/chapter_2_q2.clj | clojure | O(n+k)
O(n) time, O(n) space | (ns ^{:author "Leeor Engel"}
chapter-2.chapter-2-q2)
(defn kth-to-last [l k]
(let [len (count l)
node-idx (- len k)]
(reduce (fn [idx node]
(if (= idx node-idx)
(reduced node)
(if (= idx len) nil (inc idx)))) 1 l)))
(defn- kth-to-last? [depth length k]
... |
c22cc79f58a326a024f13cae0bc6635f7767e93683879f449f451b7c05fe9857 | ocaml-multicore/tezos | test_utils.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_plugin/test/test_utils.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
911f4e7ab442e4504d6a59b8c764fa8a28a7ba711fbdc38a5f3e0cf91b70a844 | essandess/adblock2privoxy | OptionsConverter.hs | module OptionsConverter (
HeaderFilters,
Filter (..),
HeaderType (..),
HeaderFilter (..),
headerFilters
) where
import InputParser
import Control.Monad
import Data.List
import Data.Maybe
import Data.String.Utils (replace)
import {-# SOURCE #-} UrlBlocker
type FilterFabrique = Policy -> RequestOpti... | null | https://raw.githubusercontent.com/essandess/adblock2privoxy/68affb86af325b88beaa7acda8866ad9b1d030f2/adblock2privoxy/src/OptionsConverter.hs | haskell | # SOURCE # | module OptionsConverter (
HeaderFilters,
Filter (..),
HeaderType (..),
HeaderFilter (..),
headerFilters
) where
import InputParser
import Control.Monad
import Data.List
import Data.Maybe
import Data.String.Utils (replace)
type FilterFabrique = Policy -> RequestOptions -> HeaderPolicy
data HeaderTyp... |
90858ca9fd59633ac1ebb2a625d300a1af47ed0133858c23c3bcbd2fb1f00d64 | infi-nl/alibi | sqlite_helpers.clj | (ns alibi.datasource.sqlite.sqlite-helpers)
(def row-id-keyword (keyword "last_insert_rowid()"))
(defn insert-id [insert-result]
(-> insert-result
first
row-id-keyword))
| null | https://raw.githubusercontent.com/infi-nl/alibi/00e97340ebff483f0ecbb3eef929a4052adbc78b/src/alibi/datasource/sqlite/sqlite_helpers.clj | clojure | (ns alibi.datasource.sqlite.sqlite-helpers)
(def row-id-keyword (keyword "last_insert_rowid()"))
(defn insert-id [insert-result]
(-> insert-result
first
row-id-keyword))
| |
746d0961ead2726d080cef928d34283532ca1e529af8a066a2c2c2029f245ab9 | mirage/ptt | spf.ml | open Rresult
open Lwt.Infix
let ( >>? ) = Lwt_result.bind
module DNS = Dns_mirage.Make (Tcpip_stack_socket.V4V6)
let ns_check ~domain spf =
let module DNS = struct
type t = Dns_client_lwt.t
type error =
[ `Msg of string
| `No_data of [ `raw ] Domain_name.t * Dns.Soa.t
| `No_domain of [ `... | null | https://raw.githubusercontent.com/mirage/ptt/25b39546262d8f2dcc79ee98eb35a6ed4b453686/bin/spf.ml | ocaml | open Rresult
open Lwt.Infix
let ( >>? ) = Lwt_result.bind
module DNS = Dns_mirage.Make (Tcpip_stack_socket.V4V6)
let ns_check ~domain spf =
let module DNS = struct
type t = Dns_client_lwt.t
type error =
[ `Msg of string
| `No_data of [ `raw ] Domain_name.t * Dns.Soa.t
| `No_domain of [ `... | |
56dbe2f5ea3b7b2b6501f8efe695efcd9bf335186f6923030c2f63c641db5889 | mmottl/gsl-ocaml | vector.mli | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
(** Vector of floats implemented with [Bigarray] *)
* { 3 Double precision }
type double_vector_bigarr =
(float, Bigarray.float... | null | https://raw.githubusercontent.com/mmottl/gsl-ocaml/76f8d93cccc1f23084f4a33d3e0a8f1289450580/src/vector.mli | ocaml | * Vector of floats implemented with [Bigarray] | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
* { 3 Double precision }
type double_vector_bigarr =
(float, Bigarray.float64_elt, Bigarray.c_layout) Bigarray.Array1.t
type v... |
c861f3fc58abbad73986c44836f6056bac757c1d4f829451adc963f52d588b8a | swarmpit/swarmpit | form_deployment.cljs | (ns swarmpit.component.service.form-deployment
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[swarmpit.component.state :as state]
[swarmpit.component.service.form-labels :as labels]
[swarmpit.component.s... | null | https://raw.githubusercontent.com/swarmpit/swarmpit/38ffbe08e717d8620bf433c99f2e85a9e5984c32/src/cljs/swarmpit/component/service/form_deployment.cljs | clojure | (ns swarmpit.component.service.form-deployment
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[swarmpit.component.state :as state]
[swarmpit.component.service.form-labels :as labels]
[swarmpit.component.s... | |
2a064b2bb6e10f7d7f7288008d70b732f95d8534c4412ab31c276ff2e3871aa2 | phylogeography/spread | db.clj | (ns api.db
(:require [clojure.repl :refer [demunge]]
[hugsql.adapter.next-jdbc :as next-adapter]
[hugsql.core :as hugsql]
[next.jdbc :as jdbc]
[next.jdbc.result-set :as rs]))
(def transform-result-keys-fn (comp keyword demunge))
(defn demunge-result-set-builder [rs op... | null | https://raw.githubusercontent.com/phylogeography/spread/56f3500e6d83e0ebd50041dc336ffa0697d7baf8/src/clj/api/db.clj | clojure | TODO: Important add a pool here!!!!
When next.jdbc is given a datasource, it creates a java.sql.Connection from it,
the connection and the SQL string and parameters passed in), and then closes it.
If you're not using a connection pooling datasource (see below),
that can be quite an overhead: setting up database co... | (ns api.db
(:require [clojure.repl :refer [demunge]]
[hugsql.adapter.next-jdbc :as next-adapter]
[hugsql.core :as hugsql]
[next.jdbc :as jdbc]
[next.jdbc.result-set :as rs]))
(def transform-result-keys-fn (comp keyword demunge))
(defn demunge-result-set-builder [rs op... |
04e27f88ba158b7fe073cb6846b33baaa948087e3ee3196a7d9c23881250be60 | Mesabloo/nihil | Enclosed.hs | {-# LANGUAGE OverloadedStrings #-}
module Nihil.Syntax.Concrete.Parser.Enclosed where
import Nihil.Syntax.Common (Parser)
import Nihil.Syntax.Concrete.Parser.Identifier (pSymbol')
import qualified Text.Megaparsec as MP
pTicks :: Parser a -> Parser a
pTicks = MP.between (pSymbol' "`") (pSymbol' "`")
pParens :: Parse... | null | https://raw.githubusercontent.com/Mesabloo/nihil/3821052ca5691a6492b23bd8a46bfe70567d374f/src/parser/Nihil/Syntax/Concrete/Parser/Enclosed.hs | haskell | # LANGUAGE OverloadedStrings # |
module Nihil.Syntax.Concrete.Parser.Enclosed where
import Nihil.Syntax.Common (Parser)
import Nihil.Syntax.Concrete.Parser.Identifier (pSymbol')
import qualified Text.Megaparsec as MP
pTicks :: Parser a -> Parser a
pTicks = MP.between (pSymbol' "`") (pSymbol' "`")
pParens :: Parser a -> Parser a
pParens = MP.betwee... |
07d9c676e54c34393397bb0c704c4c869ac338192691e049bdd188591f22473e | ageneau/clchess | events.cljs | (ns clchess.events
(:require
[clchess.events-common :refer [view-interceptor databases-interceptor generic-interceptor]]
[clojure.string :as string]
[re-frame.core :refer [dispatch reg-event-db reg-fx reg-event-fx path trim-v after debug]]
[node-webkit.core :as nw]
[clchess.utils :as utils]
[clchess... | null | https://raw.githubusercontent.com/ageneau/clchess/4680d47d2bd919f5bf5eb820deaf97b402de3592/src/node/clchess/events.cljs | clojure | (ns clchess.events
(:require
[clchess.events-common :refer [view-interceptor databases-interceptor generic-interceptor]]
[clojure.string :as string]
[re-frame.core :refer [dispatch reg-event-db reg-fx reg-event-fx path trim-v after debug]]
[node-webkit.core :as nw]
[clchess.utils :as utils]
[clchess... | |
5bc03db35e309253068d60f1d8a6c19c822772f17cd7f26098ae0e4093d8fec1 | LPCIC/matita | utf8Macro.ml | Copyright ( C ) 2004 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of the GNU... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/syntax_extensions/utf8Macro.ml | ocaml | WARNING: the space below is a nbsp (0x00A0), not a normal space
when h1 <> h2 | Copyright ( C ) 2004 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of the GNU... |
ea9edb0a161ed69e8b426ae87995344fc29c373cd2162a6dee5e01b8d96dbb08 | Decentralized-Pictures/T4L3NT | test_merkle.ml | module R = Rustzcash
module Core = Core.Client
module Storage = Storage.Make_Storage (Core)
let ba_of_hex h = Hex.to_bytes_exn (`Hex h)
Some test vectors are in bigendian
let ba_of_hex_be h =
let reverse s =
let l = Bytes.length s in
let res = Bytes.create l in
Bytes.fill res 0 (Bytes.length res) '0' ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/lib_sapling/test/test_merkle.ml | ocaml | test empty tree root computation
arbitrary hashes to insert in tree
inserting uncommitted should not change the ref
we can also check that get_witness doesn't assert false
test a full tree
test that the change is propagated up to the root
We check by inserting by batch
test creation of default nodes a... | module R = Rustzcash
module Core = Core.Client
module Storage = Storage.Make_Storage (Core)
let ba_of_hex h = Hex.to_bytes_exn (`Hex h)
Some test vectors are in bigendian
let ba_of_hex_be h =
let reverse s =
let l = Bytes.length s in
let res = Bytes.create l in
Bytes.fill res 0 (Bytes.length res) '0' ... |
8436ffac121b1c4b8b745d7874a915d973a1606a8159103963b21e1accd2d71d | ckruse/irckerl | irc_controller.erl | Copyright ( C ) 2011 by < >
%% 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, publish, dist... | null | https://raw.githubusercontent.com/ckruse/irckerl/2fd47c79a74b580d2d1448d15c5e9e2271e58daa/src/irc_controller.erl | erlang | Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice an... | Copyright ( C ) 2011 by < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRES... |
f060de621d3fe1e0495819f970450332e0a15e54969cc435b71a58e5a3417c37 | music-suite/music-score | Util.hs |
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ViewPatterns #
# LANGUAGE ViewPatterns #
module Music.Score.Internal.Util where
Rules :
* Functions may depend on any module in the lastest Haskell Platform release
* All functions but those in Prelude must be referred to with their full ,
... | null | https://raw.githubusercontent.com/music-suite/music-score/aa7182d8ded25c03a56b83941fc625123a7931f8/src/Music/Score/Internal/Util.hs | haskell | # LANGUAGE RankNTypes #
| Ordinary commentary ...
> category : Categories ( please use the common Hackage names )
> depends : base ( all packages in HP that the function depends on )
| Ordinary Haddock commentary ...
> category: Categories (please use the common Hackage names)
> depends : base (all packages i... |
# LANGUAGE ViewPatterns #
# LANGUAGE ViewPatterns #
module Music.Score.Internal.Util where
Rules :
* Functions may depend on any module in the lastest Haskell Platform release
* All functions but those in Prelude must be referred to with their full ,
qualified names ( i.e.... |
809c492b92d4cdc47dfcedb44458cca7a3e34923122f843de88f82c923b66edb | migamake/json-autotype | Type.hs | {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
-- | Union types describing JSON objects, and operations for querying these types.
module Data.Aeson.AutoType.Type(typeSize,
... | null | https://raw.githubusercontent.com/migamake/json-autotype/6244e1f2c0352e9a18657051b65df62b9af157cd/json-autotype/src/Data/Aeson/AutoType/Type.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveGeneric #
| Union types describing JSON objects, and operations for querying these types.
* Dictionary types for overloading of usual class instances.
| Dictionary of types indexed by names.
| Make operation on a map to an operation on a Dict.
| Take all ... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
module Data.Aeson.AutoType.Type(typeSize,
Dict(..), keys, get, withDict,
Type(..), emptyType,
isSimple, isArray, isOb... |
db2aebeff92a5b4bc532af9e822279c3d5d8fe3f0c4e3fb7d516dbd25d51dd19 | russ/openpoker | tcp_server.erl | Copyright ( C ) 2002 ,
%% File : tcp_server.erl
Author : ( )
%% Purpose : Keeps track of a number of TCP sessions
Last modified : 2002 - 11 - 17
-module(tcp_server).
-export([start_raw_server/4, start_client/3,
stop/1, children/1]).
-define(KILL_DELAY, 1000).
%% -export([start_child/3]).
... | null | https://raw.githubusercontent.com/russ/openpoker/62edd72a35b9ef52f55da9303cf1e06142e95895/src/tcp_server.erl | erlang | File : tcp_server.erl
Purpose : Keeps track of a number of TCP sessions
-export([start_child/3]).
Then Fun(Socket) is called.
a typical server is usually written like this:
To setup a lister
start_server(Port) ->
S = self(),
process_flag(trap_exit, true),
tcp_server:start_raw_server(Port... | Copyright ( C ) 2002 ,
Author : ( )
Last modified : 2002 - 11 - 17
-module(tcp_server).
-export([start_raw_server/4, start_client/3,
stop/1, children/1]).
-define(KILL_DELAY, 1000).
start_raw_server(Port , Fun , Max )
This server accepts up to connections on Port
The * first * time... |
1b98aa6b8fa06926c2b46baa1c530c14a41689ef550ae737df77ac7cc696c4d7 | albertoruiz/easyVision | param4.hs | # LANGUAGE TemplateHaskell #
import EasyVision
drift (_,a) (r,b) = (r, r .* a |+| (1-r) .* b)
autoParam "Param" "" [("alpha","Float",realParam 0.9 0 1)]
main = run $ (winParam ~> alpha .&. camera ~> float . grayscale)
~~> scanl1 drift
>>= mon
>>= timeMonitor
mon = monitor "drift wi... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/old/tutorial/param4.hs | haskell | # LANGUAGE TemplateHaskell #
import EasyVision
drift (_,a) (r,b) = (r, r .* a |+| (1-r) .* b)
autoParam "Param" "" [("alpha","Float",realParam 0.9 0 1)]
main = run $ (winParam ~> alpha .&. camera ~> float . grayscale)
~~> scanl1 drift
>>= mon
>>= timeMonitor
mon = monitor "drift wi... | |
5ddea67484a822314c56f67ed3a2522e62a9014b11a2d10ce7ba0e6eee2760f4 | open-company/open-company-web | mention.cljs | (ns oc.web.utils.mention
(:require [oops.core :refer (ocall)]
[oc.web.utils.rum :refer (create-element)]
["react-dom" :as react-dom]
["medium-editor" :as medium-editor]
["@open-company/medium-editor-extentions" :refer (TCMention)]
[oc.web.components.ui.custo... | null | https://raw.githubusercontent.com/open-company/open-company-web/700f751b8284d287432ba73007b104f26669be91/src/main/oc/web/utils/mention.cljs | clojure | is a carrot user
is active | (ns oc.web.utils.mention
(:require [oops.core :refer (ocall)]
[oc.web.utils.rum :refer (create-element)]
["react-dom" :as react-dom]
["medium-editor" :as medium-editor]
["@open-company/medium-editor-extentions" :refer (TCMention)]
[oc.web.components.ui.custo... |
a6d57837726757535a4e2a12f0797507abcb54c63586fa723e814d864c968767 | pablomarx/Thomas | load-runtime.scm | * Copyright 1992 Digital Equipment Corporation
;* All Rights Reserved
;*
;* Permission to use, copy, and modify this software and its documentation is
;* hereby granted only under the following terms and conditions. Both the
;* above copyright notice and this permission notice mus... | null | https://raw.githubusercontent.com/pablomarx/Thomas/c8ab3f6fa92a9a39667fe37dfe060b651affb18e/kits/scc/src/load-runtime.scm | scheme | * All Rights Reserved
*
* Permission to use, copy, and modify this software and its documentation is
* hereby granted only under the following terms and conditions. Both the
* above copyright notice and this permission notice must appear in all copies
* of the software, derivative works or modi... | * Copyright 1992 Digital Equipment Corporation
* and hereby grant back to Digital a non - exclusive , unrestricted , royalty - free
* their best efforts to return to Digital any such changes , enhancements or
* extensions that they make and inform Digital of noteworthy uses of this
* software . Correspo... |
236102eef1e823206ac3f4a5591c735afde462b4e98ab97c2c3a0b9384f03e60 | YoshikuniJujo/funpaala | introduction.hs | introduction :: (String, Integer) -> String
introduction (n, a) =
"My name is " ++ n ++
". I'm " ++ show a ++ " years old."
introductionYj :: Integer -> String
introductionYj = curry introduction "Yoshikuni Jujo"
myCurry :: ((a, b) -> c) -> a -> b -> c
myCurry f x y = f (x, y)
| null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/09_tuple/introduction.hs | haskell | introduction :: (String, Integer) -> String
introduction (n, a) =
"My name is " ++ n ++
". I'm " ++ show a ++ " years old."
introductionYj :: Integer -> String
introductionYj = curry introduction "Yoshikuni Jujo"
myCurry :: ((a, b) -> c) -> a -> b -> c
myCurry f x y = f (x, y)
| |
4bab8c66e20b38353eea24544b45bbe430e07d5a78be897f1720ddbed1629297 | jaspervdj/lorem-markdownum | Print.hs | --------------------------------------------------------------------------------
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
module LoremMarkdownum.Print
( PrintConfig (..)
, defaultPrintConfig
, Print
, runPrint
, runPrintWith
, runPrintLength
, pri... | null | https://raw.githubusercontent.com/jaspervdj/lorem-markdownum/fabe4e5f3094467c992b83c1f99ae01a1c3f3155/lib/LoremMarkdownum/Print.hs | haskell | ------------------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-------------------------------------------... | # LANGUAGE GeneralizedNewtypeDeriving #
module LoremMarkdownum.Print
( PrintConfig (..)
, defaultPrintConfig
, Print
, runPrint
, runPrintWith
, runPrintLength
, printText
, printShow
, printBrkSp
, printBrk
, printNl
, printIndent
, printIndent4
, printWrapIn... |
2b7300b6cbb76276db2062604b6d1cb2b278d36bbfec0a86ada8a032811aa2b7 | ygmpkk/house | Draw.hs | -- #hide
-----------------------------------------------------------------------------
-- |
-- Module : Window.Draw
Copyright : ( c ) 2002
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Window.Draw contains the window drawing functions.
-... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/ObjectIO/Graphics/UI/ObjectIO/Window/Draw.hs | haskell | #hide
---------------------------------------------------------------------------
|
Module : Window.Draw
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
Window.Draw contains the window drawing functions.
------------------------------------------------------... | Copyright : ( c ) 2002
module Graphics.UI.ObjectIO.Window.Draw where
import Graphics.UI.ObjectIO.CommonDef
import Graphics.UI.ObjectIO.Control.Layout
import Graphics.UI.ObjectIO.StdPicture
import Graphics.UI.ObjectIO.Window.Access
import Graphics.UI.ObjectIO.OS.Picture
import Graphics.UI.ObjectIO.OS.Rgn
imp... |
4f0e96e15684663903abad596b9a3f2f45c6fb973d75cc52b61963b0d2d6b07e | hongseok-yang/probprog20 | fib_seq1.clj | (ns lecture2e)
(defn rev [l]
(reduce conj (list) l))
(defn conc [l1 l2]
(reduce conj l2 (rev l1)))
(defn fib [n]
(loop [i 2 s (list 1 1)]
(if (= i n)
(rev s)
(recur (+' i 1)
(conj s (+' (first s) (second s)))))))
(defn get-digits [n]
(map (fn [c] (- (int c) (int \0))) (str n))... | null | https://raw.githubusercontent.com/hongseok-yang/probprog20/31ba965ef103b93dd7c492dac7b0246bb6633361/Lectures/Lecture2/fib_seq1.clj | clojure | (ns lecture2e)
(defn rev [l]
(reduce conj (list) l))
(defn conc [l1 l2]
(reduce conj l2 (rev l1)))
(defn fib [n]
(loop [i 2 s (list 1 1)]
(if (= i n)
(rev s)
(recur (+' i 1)
(conj s (+' (first s) (second s)))))))
(defn get-digits [n]
(map (fn [c] (- (int c) (int \0))) (str n))... | |
ee868fc62e003988f76b0566c93da3268ac8f47e825c00240992014c191e3295 | jaredly/reason-language-server | symtable.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/406/symtable.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
open Misc
open Asttypes
open Lambda
open Cmo_format
type error =
Undefined_global of string
| Un... |
aa09e6d2b0950bd255673f204ba62e6b95245030da4b8affb83c2b76415452d4 | novaframework/nova | nova_watcher.erl | %%%-------------------------------------------------------------------
@author < >
%%% @doc
%%%
%%% @end
Created : 3 Mar 2021 by < >
%%%-------------------------------------------------------------------
-module(nova_watcher).
-behaviour(gen_server).
%% API
-export([
start_link/0,
async_... | null | https://raw.githubusercontent.com/novaframework/nova/27abd9b6cab9f64cb1acf85fcad4226599588400/src/nova_watcher.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
===================================================================
API
===================================================================
---... | @author < >
Created : 3 Mar 2021 by < >
-module(nova_watcher).
-behaviour(gen_server).
-export([
start_link/0,
async_cast/4,
async_cast/3,
async_cast/2,
async_cast/1,
stop/0
]).
-export([
init/1,
handle_call/3,
handl... |
14114dd85f5c099b2190e8a788693ed8348a29d87bb09f1052050d82c5be0981 | eschulte/software-evolution | gcd.lisp | (require :software-evolution)
(in-package :software-evolution)
(setq *gcd*
(make-instance 'lisp
:genome '((DEFUN EUCLIDS-GCD (A B)
(IF (= A 0)
B)
(DO ()
((= B 0) A)
(IF (> A B)
... | null | https://raw.githubusercontent.com/eschulte/software-evolution/dbf5900d1eef834b93eeb00eca34eb7c80e701b6/test/lisp-bugs/gcd.lisp | lisp | (require :software-evolution)
(in-package :software-evolution)
(setq *gcd*
(make-instance 'lisp
:genome '((DEFUN EUCLIDS-GCD (A B)
(IF (= A 0)
B)
(DO ()
((= B 0) A)
(IF (> A B)
... | |
936a15c83eb45bafd9308a9436ad0546128e77648c5730cc3149caa14bd06f7a | thma/PolysemyCleanArchitecture | KVSAcidState.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
{-# LANGUAGE StandaloneDeriving #-}
module InterfaceAdapters.KVSAcidState
( runKvsAsAcidState,
)
where
import Control.Monad.Reader
import Control.Monad.State
import Data.Acid
imp... | null | https://raw.githubusercontent.com/thma/PolysemyCleanArchitecture/3bb375a30bcbf35c9df62802902e0faa03e3f03d/src/InterfaceAdapters/KVSAcidState.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE StandaloneDeriving #
-------------------
embed (deleteAction key)
deleteAction key = undefined
do
acid <- openDB
closeAcidState acid
return [] | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module InterfaceAdapters.KVSAcidState
( runKvsAsAcidState,
)
where
import Control.Monad.Reader
import Control.Monad.State
import Data.Acid
import qualified Data.Map as Map
import Data.SafeCopy
i... |
85c69d2e6e1e2707a732fa8e3566279adfd3a2039dd582066740636927ee0342 | termite-analyser/termite | config.mli | (**
Configuration
*)
val version : string
(**
If [debug] is false, termite only displays the resulting ranking function,
else it details the steps of the computation
*)
val debug : bool ref
(** If [quiet] is true, termites will output more compact information. *)
val quiet : bool ref
| null | https://raw.githubusercontent.com/termite-analyser/termite/285d92215a28fcce55614f6d04b44886f253a894/src/config.mli | ocaml | *
Configuration
*
If [debug] is false, termite only displays the resulting ranking function,
else it details the steps of the computation
* If [quiet] is true, termites will output more compact information. |
val version : string
val debug : bool ref
val quiet : bool ref
|
ca6b737351423e0a3607fde9b4a1273527fa4d9fd7e73fc18881209d28dcd2a7 | re-path/studio | styles.cljs | (ns repath.studio.color.styles
(:require [stylefy.core :as stylefy]
[repath.studio.styles :as styles]))
(stylefy/class "palette" {:margin-left styles/h-padding
:flex "1"
:height (* styles/icon-size 2)
:margin "2px"})
(stylefy... | null | https://raw.githubusercontent.com/re-path/studio/8e58ce071d0d4ff1f111fb898f29c016ff664151/src/repath/studio/color/styles.cljs | clojure | (ns repath.studio.color.styles
(:require [stylefy.core :as stylefy]
[repath.studio.styles :as styles]))
(stylefy/class "palette" {:margin-left styles/h-padding
:flex "1"
:height (* styles/icon-size 2)
:margin "2px"})
(stylefy... | |
e3704b693e9dceea6f175e3c66775bc25782011708af6d62a3b8898a78db7028 | mkloczko/derive-storable | GStorable'Spec.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE DeriveGeneric #
{-#LANGUAGE DataKinds #-}
# LANGUAGE GADTs #
module Foreign.Storable.Generic.Internal.GStorable'Spec where
-- Test tools
import Test.Hspec
import Test.QuickCheck
import GenericType
-- Tested modules
import Foreign.Storable.G... | null | https://raw.githubusercontent.com/mkloczko/derive-storable/e215ce0165e0de735189e9d55058df9f62bd8b2a/test/Spec/Foreign/Storable/Generic/Internal/GStorable'Spec.hs | haskell | #LANGUAGE DataKinds #
Test tools
Tested modules
Additional data
Random global offset
Reserve some memory and write some data to it.
Check:
Random global offsets and field offset
Reserve some memory and write some data to it.
Check:
Without K1
Random global offset
Reserve some memory and write some... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE DeriveGeneric #
# LANGUAGE GADTs #
module Foreign.Storable.Generic.Internal.GStorable'Spec where
import Test.Hspec
import Test.QuickCheck
import GenericType
import Foreign.Storable.Generic.Internal
import Foreign.Storable.Generic.Instances
import G... |
082c1b2ba7127ca8e8622a80259b5431e7960dbe145a06ea22e7725c730a42f7 | andrewthad/sockets | Main.hs | # language BangPatterns #
# language LambdaCase #
{-# language OverloadedStrings #-}
import Prelude hiding (log,length)
import Control.Exception (Exception,throwIO)
import System.Environment (getArgs)
import Data.Primitive (ByteArray(..))
import Control.Monad (replicateM_)
import Data.Bytes.Types (Bytes(..))
import ... | null | https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/example/Main.hs | haskell | # language OverloadedStrings #
TODO: Use optparse-applicative to let the user choose
between different commands.
This waits until a single connection is established. It then dumps out
anything it receives to stdout. When the remote application shuts down
its end, this shuts down its end in return and then terminat... | # language BangPatterns #
# language LambdaCase #
import Prelude hiding (log,length)
import Control.Exception (Exception,throwIO)
import System.Environment (getArgs)
import Data.Primitive (ByteArray(..))
import Control.Monad (replicateM_)
import Data.Bytes.Types (Bytes(..))
import qualified Socket.Datagram.IPv4.Unco... |
7a9c93a6ea2fd3e1f9c7316e7e20d3a51ea03987236b057c5e5ffc0332fb5b81 | lamdu/hypertypes | FuncType.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Hyper.Syntax.FuncType
( FuncType (..)
, funcIn
, funcOut
, W_FuncType (..)
, MorphWitness (..)
) where
import Generics.Constraints (makeDerivings, makeInstances)
import Hyper
import Text.PrettyP... | null | https://raw.githubusercontent.com/lamdu/hypertypes/161142e0d9f503194b85fb6f5b2a5907a1ae3783/src/Hyper/Syntax/FuncType.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Hyper.Syntax.FuncType
( FuncType (..)
, funcIn
, funcOut
, W_FuncType (..)
, MorphWitness (..)
) where
import Generics.Constraints (makeDerivings, makeInstances)
import Hyper
import Text.PrettyP... | |
9b06fec1cfdcd53975e0119fe9ed8cbb0cdc87a4ef5cb93f970c57f7db5abbba | elastic/eui-cljs | icon_table_density_normal.cljs | (ns eui.icon-table-density-normal
(:require ["@elastic/eui/lib/components/icon/assets/table_density_normal.js" :as eui]))
(def tableDensityNormal eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_table_density_normal.cljs | clojure | (ns eui.icon-table-density-normal
(:require ["@elastic/eui/lib/components/icon/assets/table_density_normal.js" :as eui]))
(def tableDensityNormal eui/icon)
| |
0f876815c10474ac42e0380cc91e75453edd51a10c4179996b5f18608324fd94 | Emmanuel-PLF/facile | fcl_conjunto.ml | (***********************************************************************)
(* *)
FaCiLe
A Functional Constraint Library
(* ... | null | https://raw.githubusercontent.com/Emmanuel-PLF/facile/3b6902e479019c25b582042d9a02152fec145eb0/lib/fcl_conjunto.ml | ocaml | *********************************************************************
under the terms of the GNU Lesser Gener... | FaCiLe
A Functional Constraint Library
, , LOG , CENA
Copyright 2004 CENA . All rights reserved . This file is distributed
$ I d : , v 1.18 2004/08/12 15:22:07 barnier Exp $
ope... |
265ea3c99a5d21c5b3c8c3364fd9d13ba4e2430ca5a5d16bde312111372799b2 | henryw374/tempo | accessors.clj | (ns com.widdindustries.gen.gen.accessors
(:require [com.widdindustries.gen.graph :as graph]
[com.widdindustries.gen.gen :as gen]
[clojure.walk]
[backtick]
[medley.core :as m]
[clojure.set :as set]
[camel-snake-kebab.core :as csk]
[clo... | null | https://raw.githubusercontent.com/henryw374/tempo/7e22bb5a2984d56b5dabf9a6535425792e4f3383/dev/com/widdindustries/gen/gen/accessors.clj | clojure | _ (comment (eval `(sc.api/defsc ~(sc.api/last-ep-id))))
problems
ignore-accessor
:cljs (methods/from entities/duration s)))
:cljs (duration-parse s)))
construction from clocks
:cljs (clock/plain-date-iso)))
([clock]
| (ns com.widdindustries.gen.gen.accessors
(:require [com.widdindustries.gen.graph :as graph]
[com.widdindustries.gen.gen :as gen]
[clojure.walk]
[backtick]
[medley.core :as m]
[clojure.set :as set]
[camel-snake-kebab.core :as csk]
[clo... |
925fffd454e0f015706b12170281e9a05682025865ed8ccdc01548c21f95721b | hercules-ci/hercules-ci-agent | Set.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - unused - matches #
-- | @std::set@
module Hercules.CNix.Std.Set
( stdSetCtx,
instanceStdSet,
instanceStdSetCopyable,
CStdSet,... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/ff5ab7f4db65a339849d91120c6028a5d2f13e34/hercules-ci-cnix-store/src/Hercules/CNix/Std/Set.hs | haskell | # LANGUAGE OverloadedStrings #
| @std::set@
| Helper for defining templated instances | # LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - unused - matches #
module Hercules.CNix.Std.Set
( stdSetCtx,
instanceStdSet,
instanceStdSetCopyable,
CStdSet,
StdSet (StdSet),
Hercules.CNix.Std.Set.new... |
0c82579cc6e1d7291309628d8a0030833be1bffcd1206f7f4e49bedabcc1c532 | nvim-treesitter/nvim-treesitter | folds.scm | (source (list_lit) @fold)
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/c6f09ef051b7e27a3834070c39584e8ff9b897f9/queries/commonlisp/folds.scm | scheme | (source (list_lit) @fold)
| |
f297943a1035ae0b915d26453bcd549dabb95bffdb6716ad891f27b1c408fc2e | mirage/shared-memory-ring | xenstore_ring.ml |
* Copyright ( c ) 2010 - 2011 Anil Madhavapeddy < >
* Copyright ( c ) 2012 Citrix Systems , Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear i... | null | https://raw.githubusercontent.com/mirage/shared-memory-ring/2ee834deccda7e664b5462557c6bc7a37d5587b0/lib/xenstore_ring.ml | ocaml | memory layout from the frontend's point of view
(* unsafe to use these as they produce multi byte load/stores |
* Copyright ( c ) 2010 - 2011 Anil Madhavapeddy < >
* Copyright ( c ) 2012 Citrix Systems , Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear i... |
a4f270e16a3cfeed002ce188cff4bebed2d0e0bb4e062df32a783b6510658cde | cl-axon/cl-paip | patmatch.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
;;;; File pat-match.lisp: Pattern matcher from section 6.2
Two bug fixes By , October 92 .
;;; The basic are in auxfns.lisp; look for "PATTERN MATCHING FACILITY"
(defun variable-p (x)
"Is x a varia... | null | https://raw.githubusercontent.com/cl-axon/cl-paip/5922be8e3aae00197779bad4a05afa8ea1f6b8c9/patmatch.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
File pat-match.lisp: Pattern matcher from section 6.2
The basic are in auxfns.lisp; look for "PATTERN MATCHING FACILITY"
***
***
*** fix, rjf 10/1/92 (was <)
*** fix, rjf 10/1/92 (used to eval binding values) | Code from Paradigms of AI Programming
Copyright ( c ) 1991
Two bug fixes By , October 92 .
(defun variable-p (x)
"Is x a variable (a symbol beginning with `?')?"
(and (symbolp x) (equal (elt (symbol-name x) 0) #\?)))
(defun pat-match (pattern input &optional (bindings no-bindings))
"Match patter... |
4d6c1a2a7425c4530224baa4be3000a76a2c65d94370d21a6c5f80b01c07b6bb | hamler-lang/hamler | Char.erl | %%---------------------------------------------------------------------------
%% |
Module :
Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd.
%% License : BSD-style (see the LICENSE file)
%%
Maintainer : ,
,
%% Stability : experimental
%% Portability : por... | null | https://raw.githubusercontent.com/hamler-lang/hamler/3ba89dde3067076e112c60351b019eeed6c97dd7/lib/Data/Char.erl | erlang | ---------------------------------------------------------------------------
|
License : BSD-style (see the LICENSE file)
Stability : experimental
Portability : portable
---------------------------------------------------------------------------
isblank(int c);
isgraph(int c);
isprint(int c);
ispunct... | Module :
Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd.
Maintainer : ,
,
The module .
-module('Char').
-export([ isControl/1
, isSpace/1
, isLower/1
, isUpper/1
, isAlpha/1
, isAlphaNum/1
, isPrint/1
,... |
38b5c06d93195b54907e67ec0711b976e47917fdaeb8cb789c2383d6a6ea6a39 | sky-big/RabbitMQ | rabbit_amqp1_0_session.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-amqp1.0/src/rabbit_amqp1_0_session.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
keep track of t... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
550a655ba77b530b93ffd22d0b9be1d659e3e8dcdbb6056e320b28c198ba695c | dbuenzli/hyperbib | container_service.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2021 University of Bern . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/dbuenzli/hyperbib/b17d1ef8cc3a215d04c31c0e56c2de414911c55c/src/service/container_service.ml | ocaml | Data lookups
FIXME only_public, FIXME Ask escape % and _ in selector, order by
Responses
FIXME solve that front end,
the request should not be done if we don't have the data | ---------------------------------------------------------------------------
Copyright ( c ) 2021 University of Bern . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
af5e841911b22b5de17725689750d49ad989609b582957bc76fbdcce2ed084c5 | craigfe/sink | monad.mli | include Monad_intf.Monad
* @inline
| null | https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/sink/monad.mli | ocaml | include Monad_intf.Monad
* @inline
| |
0c38d7785819343cdfec0bb35975ca6ca2780f0715490a24852c7fe598bbda7e | v-kolesnikov/sicp | 1_34.clj | (ns sicp.chapter01.1-34)
(defn f [g]
(g 2))
| null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/src/sicp/chapter01/1_34.clj | clojure | (ns sicp.chapter01.1-34)
(defn f [g]
(g 2))
| |
6b3b7f3f94311baf5284627f040455b2f998989ff40bf21eb48eb9ce3b4b14dc | TrustInSoft/tis-kernel | db.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/kernel_services/plugin_entry_points/db.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
8a1cc1190d262ced3070cd9f41a7ab6d0077b053937eb7051ca12bbea865195d | vaibhavsagar/experiments | ST.hs | module ST
# DEPRECATED " This functionality is now available from Control . Monad . ST , Data . STRef , and Data . Array . ST " #
(
module Control.Monad.ST,
module Data.STRef,
STArray,
newSTArray,
readSTArray,
writeSTArray,
boundsSTArray,
thawSTArray,
freezeSTArray,
unsafeFreezeSTArray,
unsafeThawST... | null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/fptools/hslibs/lang/ST.hs | haskell | module ST
# DEPRECATED " This functionality is now available from Control . Monad . ST , Data . STRef , and Data . Array . ST " #
(
module Control.Monad.ST,
module Data.STRef,
STArray,
newSTArray,
readSTArray,
writeSTArray,
boundsSTArray,
thawSTArray,
freezeSTArray,
unsafeFreezeSTArray,
unsafeThawST... | |
3a7ac3989b0aa53e5c2d52302c8932f310eeefa924727f9952830852cf12946e | rkaippully/webgear | Types.hs | -- |
Copyright : ( c ) , 2020 - 2021
-- License : MPL-2.0
-- Maintainer :
--
Common types and functions used throughout WebGear .
--
module WebGear.Types
( -- * WebGear Request
Request
, remoteHost
, httpVersion
, isSecure
, requestMethod
, pathInfo
, queryString
, requ... | null | https://raw.githubusercontent.com/rkaippully/webgear/db122125c35e5853251bfd68a0e5222fafd6cd49/webgear-server/src/WebGear/Types.hs | haskell | |
License : MPL-2.0
Maintainer :
* WebGear Request
* WebGear Response
* Creating responses
* Handlers and Middlewares
* Routing
* Modifiers
| Get the value of a request header
| An HTTP response sent from the server to the client.
The response contains a status, optional headers and an op... | Copyright : ( c ) , 2020 - 2021
Common types and functions used throughout WebGear .
module WebGear.Types
Request
, remoteHost
, httpVersion
, isSecure
, requestMethod
, pathInfo
, queryString
, requestHeader
, requestHeaders
, requestBodyLength
, getRequestBodyChunk
, Response ... |
e63b97e9356fe312227419808163c6c03c74ed5f6c5df1ad7ea3706a6a369df2 | erlang/otp | mnesia_dirty_access_test.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2023 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/mnesia/test/mnesia_dirty_access_test.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2023 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mnesia_dirty_access_test).
-author('').
-include("mnesia_test_lib.hrl").
-export([init_per_testcase/2, end_... |
31777ac761746c6c1c94de3ed6be30593adffc1b8ef17a9712424cbe95668a5f | ChrisPenner/grids | Benchmarks.hs | # LANGUAGE PolyKinds #
# LANGUAGE AllowAmbiguousTypes #
module Benchmarks where
import Gauge.Main
import Data.Grid as G
import Data.Functor.Compose
main :: IO ()
main =
defaultMain [ bgroup "convolution"
[ bgroup "boxBlur"
[
bench " nf [ 3 , 3 ] window ... | null | https://raw.githubusercontent.com/ChrisPenner/grids/619c72b1e51f96377845c2a15eb100d8f4185fa1/benchmarks/Benchmarks.hs | haskell | # LANGUAGE PolyKinds #
# LANGUAGE AllowAmbiguousTypes #
module Benchmarks where
import Gauge.Main
import Data.Grid as G
import Data.Functor.Compose
main :: IO ()
main =
defaultMain [ bgroup "convolution"
[ bgroup "boxBlur"
[
bench " nf [ 3 , 3 ] window ... | |
57a021c9910ad40dece16c47929cbd9c5b68694cda1c17ce800ce715e29a350f | danr/hipspec | Ordinals.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Ordinals where
import HipSpec
import qualified Prelude as P
data Nat = Z | S Nat deriving (P.Show,Typeable)
Z `plus` y = y
S x `plus` y = S (x `plus` y)
Z `mul` y = Z
S x `mul` y = y `plus` (x `mul` y)
data Ord = Zero | Suc Ord | Lim (Nat -> Ord)
deriving (Typeable)
... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/examples/Ordinals.hs | haskell | # LANGUAGE DeriveDataTypeable # | module Ordinals where
import HipSpec
import qualified Prelude as P
data Nat = Z | S Nat deriving (P.Show,Typeable)
Z `plus` y = y
S x `plus` y = S (x `plus` y)
Z `mul` y = Z
S x `mul` y = y `plus` (x `mul` y)
data Ord = Zero | Suc Ord | Lim (Nat -> Ord)
deriving (Typeable)
Zero `oplus` y = y
Suc x `oplus` y... |
b31cc02ebf07e9863538cad6b14e6271449768fb39bb9b81c1468ed882c9d94c | softwarelanguageslab/maf | R5RS_various_collatz-3.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
* negated predicates : 1
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((div2* (lambda (n s)
(if (= (* 2 n) s)
n
(if (= (+ (* 2 n) 1) s) n (div2* (- n 1) s)))))
(div2 (lambda (n)
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_various_collatz-3.scm | scheme | Changes:
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 1
* swaps : 0
* negated predicates : 1
(letrec ((div2* (lambda (n s)
(if (= (* 2 n) s)
n
(if (= (+ (* 2 n) 1) s) n (div2* (- n 1) s)))))
(div2 (lambda (n)
(div2* n n)))
(hailstone* (lambda (n c... |
48fd2618c07dac7608eaf57ddf464903505e584c5a35b92225caed54894d988f | incanter/incanter | b_spline.clj | (ns ^{:skip-wiki true}
incanter.interp.b-spline
(:require [incanter.interp.utils :refer (binary-search)]))
(defn- calc-Ns [ts m t k]
(letfn [(calc-V [i m]
(let [t-i (nth ts i 0)
t-i+m (nth ts (+ i m) 1)]
(if (zero? (- t-i t-i+m))
0
(/ ... | null | https://raw.githubusercontent.com/incanter/incanter/e0a03aac237fcc60587278a36bd2e76266fc6356/modules/incanter-core/src/incanter/interp/b_spline.clj | clojure | (ns ^{:skip-wiki true}
incanter.interp.b-spline
(:require [incanter.interp.utils :refer (binary-search)]))
(defn- calc-Ns [ts m t k]
(letfn [(calc-V [i m]
(let [t-i (nth ts i 0)
t-i+m (nth ts (+ i m) 1)]
(if (zero? (- t-i t-i+m))
0
(/ ... | |
37b6bcca4e031aae9ea3faa2662a2d236f846d7aeab0d3c74ad2af71ea39d4d9 | michaelmelanson/erlbot | irc_parser.erl | %%% File : irc_parser.erl
Author : nt < >
%%% Description :
Created : 27 Mar 2006 by nt < >
-module(irc_parser).
-include_lib("irc.hrl").
-include_lib("logging.hrl").
-include_lib("eunit.hrl").
-compile(export_all).
-define(IS_DIGIT(Var), $0 =< Var, Var =< $9).
cut_line(Data) ->
Pos = string:st... | null | https://raw.githubusercontent.com/michaelmelanson/erlbot/3bfabfdff803d7cbb48689a7c14d58acf0fa2891/src/irc_parser.erl | erlang | File : irc_parser.erl
Description : | Author : nt < >
Created : 27 Mar 2006 by nt < >
-module(irc_parser).
-include_lib("irc.hrl").
-include_lib("logging.hrl").
-include_lib("eunit.hrl").
-compile(export_all).
-define(IS_DIGIT(Var), $0 =< Var, Var =< $9).
cut_line(Data) ->
Pos = string:str(Data, "\r\n"),
case Pos of
0 -> {D... |
726000c8fbdb2321bc3b5ad88063e275a474cb196917b2b6093b1679a6b4e514 | clojure/tools.nrepl | misc.clj | (ns ^{:doc "Misc utilities used in nREPL's implementation (potentially also useful
for anyone extending it)."
:author "Chas Emerick"}
clojure.tools.nrepl.misc)
(try
(require 'clojure.tools.logging)
(defmacro log [& args] `(clojure.tools.logging/error ~@args))
(catch Throwable t
;(print... | null | https://raw.githubusercontent.com/clojure/tools.nrepl/d4bb14e841b453721f009f4e9e0e9b2742b4bdc2/src/main/clojure/clojure/tools/nrepl/misc.clj | clojure | (println "clojure.tools.logging not available, falling back to stdout/err") | (ns ^{:doc "Misc utilities used in nREPL's implementation (potentially also useful
for anyone extending it)."
:author "Chas Emerick"}
clojure.tools.nrepl.misc)
(try
(require 'clojure.tools.logging)
(defmacro log [& args] `(clojure.tools.logging/error ~@args))
(catch Throwable t
(defn l... |
9a79052eb834dd76fdccb3c7c6f3bf6349a9873502ec08a28c070ff3f8fd8b18 | alt-romes/slfl | final-2-3.hs | # foldl
data List a = Nil | Cons (a * List a);
synth foldl :: (b -o a -o b) -> b -o List a -o b | choose 1;
| null | https://raw.githubusercontent.com/alt-romes/slfl/4956fcce8ff2ca7622799fe0715c118b568b74eb/STLLC/bench/final-2-3.hs | haskell | # foldl
data List a = Nil | Cons (a * List a);
synth foldl :: (b -o a -o b) -> b -o List a -o b | choose 1;
| |
20a0ce85d5552c464524a926cb8f15a7bb74bef38577f31b1bbe7658584e5a2c | rtoy/cmucl | insts.lisp | ;;; -*- Package: SPARC -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/compiler/sparc/insts.lisp $")
;;;
;;... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/sparc/insts.lisp | lisp | -*- Package: SPARC -*-
**********************************************************************
**********************************************************************
Constants, types, conversion functions, some disassembler stuff.
No single register encoding greater than reg 31.
Upper bit of the register num... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/compiler/sparc/insts.lisp $")
Description of the SPARC architecture .
Written by .
(in-package "SPARC")
(intl:textdomain "cmucl-sparc-vm")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.