_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 |
|---|---|---|---|---|---|---|---|---|
1b2cd6c2108de8e78633fc71f504380551c1169217f151f2a6186d18420bf852 | nikita-volkov/rebase | New.hs | module Rebase.Data.Vector.Generic.New
(
module Data.Vector.Generic.New
)
where
import Data.Vector.Generic.New
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Data/Vector/Generic/New.hs | haskell | module Rebase.Data.Vector.Generic.New
(
module Data.Vector.Generic.New
)
where
import Data.Vector.Generic.New
| |
d6e9736e5cb80fe3f4346158ea301ccf3931352db000263821b80b3a71399125 | themattchan/advent-of-code | day10.hs | -- #! /usr/bin/env runhaskell -i../../
# LANGUAGE CPP #
module Day10 (solve1, solve2) where
import Utils
import Data.Bits (xor)
import Data.List.Split (chunksOf)
import Debug.Trace
import Data.Word
#ifdef DEBUG
import Control.Exception.Base (assert)
#endif
type State = ([Int], Int, Int, Int)
-- ^ list being hashe... | null | https://raw.githubusercontent.com/themattchan/advent-of-code/0b08a4fbadf7e713d40044523af3debb7d0cb6b9/2017/day10/day10.hs | haskell | #! /usr/bin/env runhaskell -i../../
^ list being hashed, length of list, actual index of head, skip size
rotate elements such that head of l is at position d
head of the list is always the current position
d tracks the current position as an index in the original ordering | # LANGUAGE CPP #
module Day10 (solve1, solve2) where
import Utils
import Data.Bits (xor)
import Data.List.Split (chunksOf)
import Debug.Trace
import Data.Word
#ifdef DEBUG
import Control.Exception.Base (assert)
#endif
type State = ([Int], Int, Int, Int)
initState :: [Int] -> State
initState xs = (xs,length xs,0,0)... |
cfce5093e960624109d1939445d9cacfb261d652ae645553f6dfe03d5ac18ccb | bollu/koans | y.hs | y :: (a -> a) -> a
y f = f (y f)
fact = y (\f a -> if a == 0 then 1 else a * f(a - 1))
| null | https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/y.hs | haskell | y :: (a -> a) -> a
y f = f (y f)
fact = y (\f a -> if a == 0 then 1 else a * f(a - 1))
| |
5346d8cc94e401c74b0bd22775e444618442d03ca94027e267af9d7bd8971ead | alvatar/spheres | deduction.scm | ; Proving the Deduction Theorem for Hilbert Propositional Calculus
; by induction.
;
; This file is largely based on the paper
;
; * Deduction for functional programmers
by and
Journal of Functional Programming , volume 6 , number 2 , 1996 .
/~leifer/research.html
;
The paper uses . We use our logic syst... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/doc/logic/kanren-examples/deduction.scm | scheme | Proving the Deduction Theorem for Hilbert Propositional Calculus
by induction.
This file is largely based on the paper
* Deduction for functional programmers
The paper stated that the function 'ded' satisfies its specification
and is therefore a constructive proof of the Deduction Theorem
(which is an infer... | by and
Journal of Functional Programming , volume 6 , number 2 , 1996 .
/~leifer/research.html
The paper uses . We use our logic system . You can see
therefore quite a bit of difference between the two approaches .
$ I d : deduction.scm , v 4.50 2005/02/12 00:04:44 oleg Exp $
(newline)
(display "Indu... |
759f2dc5964da31b80d3992b544223713876fd13845262e75e6db96e37435c4f | haskell-tools/haskell-tools | DollarApp.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE MonoLocalBinds #
module Language.Haskell.Tools.Refactor.Builtin.DollarApp (dollarApp, tryItOut) where
import Language.Haskell.Tools.Refactor
import BasicTypes (Fixity(..))
import PrelNames (dollarName)
import SrcLoc (RealSrcSpan, SrcSpan)
import Control.Monad.State
import Co... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/experimental-refactorings/Language/Haskell/Tools/Refactor/Builtin/DollarApp.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE MonoLocalBinds #
module Language.Haskell.Tools.Refactor.Builtin.DollarApp (dollarApp, tryItOut) where
import Language.Haskell.Tools.Refactor
import BasicTypes (Fixity(..))
import PrelNames (dollarName)
import SrcLoc (RealSrcSpan, SrcSpan)
import Control.Monad.State
import Co... | |
5151a9f33fc7a3da2b07225cb48b9bf93d5a2172f0653f8fef2ce01fc5148640 | expipiplus1/vulkan | XR_HUAWEI_controller_interaction.hs | {-# language CPP #-}
-- | = Name
--
-- XR_HUAWEI_controller_interaction - instance extension
--
-- = Specification
--
-- See
-- <#XR_HUAWEI_controller_interaction XR_HUAWEI_controller_interaction>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
70
--
-- = Revision
--
1... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/openxr/src/OpenXR/Extensions/XR_HUAWEI_controller_interaction.hs | haskell | # language CPP #
| = Name
XR_HUAWEI_controller_interaction - instance extension
= Specification
See
<#XR_HUAWEI_controller_interaction XR_HUAWEI_controller_interaction>
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
... | 70
1
- Requires OpenXR 1.0
< #XR_HUAWEI_controller_interaction OpenXR Specification >
module OpenXR.Extensions.XR_HUAWEI_controller_interaction ( HUAWEI_controller_interaction_SPEC_VERSION
, pattern HUAWEI_controller_interaction_SPEC_VERSION
... |
779bd84538f2bf5718e0e41012b045e5e77218cba0cabf2aa5b1265a83b53e42 | aryx/fork-efuns | electric.ml | (*s: features/electric.ml *)
(*s: copyright header2 *)
(***********************************************************************)
(* *)
xlib for
(* *)
... | null | https://raw.githubusercontent.com/aryx/fork-efuns/8f2f8f66879d45e26ecdca0033f9c92aec2b783d/features/electric.ml | ocaml | s: features/electric.ml
s: copyright header2
*********************************************************************
... | xlib for
Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
let previous_char frame =
let (_, text, point) = Frame.buf... |
1c4856e26c2383a821007435ac40fd9488ed168a9751ec8204f9615036074d35 | r0man/grafeo | ring_test.cljc | (ns grafeo.ring-test
(:require [clojure.test :refer [deftest is]]
[grafeo.core :as lang]
[grafeo.examples :as examples]
[grafeo.ring :as ring]))
(def ast
(lang/parse-document (:form examples/variables)))
(def opts
{:variables {:episode "JEDI"}})
(deftest test-body
(is (= (... | null | https://raw.githubusercontent.com/r0man/grafeo/087449efe0dda93eb3aca3ec733d392550cd3562/test/grafeo/ring_test.cljc | clojure | (ns grafeo.ring-test
(:require [clojure.test :refer [deftest is]]
[grafeo.core :as lang]
[grafeo.examples :as examples]
[grafeo.ring :as ring]))
(def ast
(lang/parse-document (:form examples/variables)))
(def opts
{:variables {:episode "JEDI"}})
(deftest test-body
(is (= (... | |
042144f9655f397bfca557ba70f5a05f2cfeafd2e111e93bab7c3ad212abfb37 | MinaProtocol/mina | step_main.ml | module S = Sponge
open Core_kernel
open Pickles_types
open Common
open Poly_types
open Hlist
open Import
open Impls.Step
open Step_main_inputs
open Step_verifier
module B = Inductive_rule.B
Converts from the one hot vector representation of a number
0 < = i < n
0 1 ... i-1 i i+1 n-1
... | null | https://raw.githubusercontent.com/MinaProtocol/mina/8403887a428f56e91bfdf4187c6b8dc260e5424a/src/lib/pickles/step_main.ml | ocaml | TODO: Refactor args into an "unfinalized proof" struct
TODO: Don't rehash when it's not necessary
Use opt sponge for cutting off the bulletproof challenges early
How many branches does this proof system have
The specification, for each proof that this step circuit verifies, of the maximum width used
... | module S = Sponge
open Core_kernel
open Pickles_types
open Common
open Poly_types
open Hlist
open Import
open Impls.Step
open Step_main_inputs
open Step_verifier
module B = Inductive_rule.B
Converts from the one hot vector representation of a number
0 < = i < n
0 1 ... i-1 i i+1 n-1
... |
535c4c85b4c28ccf72c8052b34933d8d8432de56b34f6fb6b3055d49363a447a | input-output-hk/project-icarus-importer | Genesis.hs | -- | Computation of LRC genesis data.
module Pos.Lrc.Genesis
( genesisLeaders
) where
import Universum
import qualified Data.HashMap.Strict as HM
import Pos.Core (GenesisData (..), SharedSeed (..), SlotLeaders, genesisData, HasGenesisData, HasProtocolConstants, HasGeneratedSecrets)
impor... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/block/src/Pos/Lrc/Genesis.hs | haskell | | Computation of LRC genesis data.
| Compute leaders of the 0-th epoch from initial shared seed and stake distribution.
This should not be exported unless it is *needed* elsewhere |
module Pos.Lrc.Genesis
( genesisLeaders
) where
import Universum
import qualified Data.HashMap.Strict as HM
import Pos.Core (GenesisData (..), SharedSeed (..), SlotLeaders, genesisData, HasGenesisData, HasProtocolConstants, HasGeneratedSecrets)
import Pos.Lrc.Fts (followTheSato... |
5134aedccb425cf070e85510a8af156674ce7c040d56481e85ae5bf3afd07525 | kcaze/hgba | Types.hs | module Types ( Immediate, Register, Flag, Bit, Execute
, ProcessorMode(..), CPU(..)
, Instruction(..), RawInstruction(..)
, Shifter(..), AddressingModeType(..)
, AddressingMode2(..), AddressingMode3(..)
, AddressingMode4(..)
, Exception(..)
... | null | https://raw.githubusercontent.com/kcaze/hgba/1e3beb07e54ec20b1991f30bcc009a9cba977cc1/src/Types.hs | haskell | Specializations of Value to CPU specific types
CPU types
Instruction types.
Addressing mode types
Exception type | module Types ( Immediate, Register, Flag, Bit, Execute
, ProcessorMode(..), CPU(..)
, Instruction(..), RawInstruction(..)
, Shifter(..), AddressingModeType(..)
, AddressingMode2(..), AddressingMode3(..)
, AddressingMode4(..)
, Exception(..)
... |
6f11a43ff3604a6b8aa0321c90a06240555a16b4a8f5355f6c105355e075d55c | noss/iserve | iserve_socket.erl | -module(iserve_socket).
-export([start_link/5
,send_reply/3, send_reply/4
]).
-export([init/1]).
%% TODO: Remove me
%%-compile(export_all).
-include("../include/iserve.hrl").
-include("iserve_socket.hrl").
-define(not_implemented_501, <<"HTTP/1.1 501 Not Implemented\r\n\r\n">>).
-define(forbidden_... | null | https://raw.githubusercontent.com/noss/iserve/32281eb830c27d5db8c62730a9386c2d305c0247/src/iserve_socket.erl | erlang | TODO: Remove me
-compile(export_all).
Send the cast message to the listener process
to create a new acceptor
Shall we keep the connection alive?
Exercise for the reader - finish this so it does case insensitivity properly !
to block and read as much as available.
These patterns are hidden from callback code
t... | -module(iserve_socket).
-export([start_link/5
,send_reply/3, send_reply/4
]).
-export([init/1]).
-include("../include/iserve.hrl").
-include("iserve_socket.hrl").
-define(not_implemented_501, <<"HTTP/1.1 501 Not Implemented\r\n\r\n">>).
-define(forbidden_403, <<"HTTP/1.1 403 Forbidden\r\n\r\n">>).... |
30deb640f38200230345d341822e968afe2f55caad4bc1c7194fbce2f085b037 | Clojure2D/clojure2d-examples | main.clj | (ns rt4.the-next-week.ch04a.main
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.common :as common]
[rt4.the-next-week.ch04a.sphere :as sphere]
[rt4.the-next-week.ch04a.moving-sphere :as moving-sphere]
[rt4.the-next-week.ch04a.camera :as camera]... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch04a/main.clj | clojure | camera | (ns rt4.the-next-week.ch04a.main
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.common :as common]
[rt4.the-next-week.ch04a.sphere :as sphere]
[rt4.the-next-week.ch04a.moving-sphere :as moving-sphere]
[rt4.the-next-week.ch04a.camera :as camera]... |
d838a6d57031819949aa1e3b0fa2be0493cdab08e64cf6cdf4abb85366cea15f | fossas/fossa-cli | Subcommand.hs | # LANGUAGE RecordWildCards #
module App.Fossa.Subcommand (
runSubCommand,
EffStack,
GetSeverity (..),
GetCommonOpts (..),
SubCommand (..),
) where
import App.Fossa.Config.Common (CommonOpts, collectTelemetrySink)
import App.Fossa.Config.ConfigFile (ConfigFile)
import App.Fossa.Config.EnvironmentVars (EnvVar... | null | https://raw.githubusercontent.com/fossas/fossa-cli/219bdc6f38d401df2bdb7991114c54083a75f56b/src/App/Fossa/Subcommand.hs | haskell | CLI args can control where we look for config file
We have to extract the severity from the options, which is not straightforward | # LANGUAGE RecordWildCards #
module App.Fossa.Subcommand (
runSubCommand,
EffStack,
GetSeverity (..),
GetCommonOpts (..),
SubCommand (..),
) where
import App.Fossa.Config.Common (CommonOpts, collectTelemetrySink)
import App.Fossa.Config.ConfigFile (ConfigFile)
import App.Fossa.Config.EnvironmentVars (EnvVar... |
6c40cf7e342f8b42e094aa629fd043b567f0dc5cbc79722f647186b14169c576 | exoscale/clojure-kubernetes-client | v1alpha1_webhook.clj | (ns clojure-kubernetes-client.specs.v1alpha1-webhook
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1alpha1-webhook-client-config :refer :all]
[clojure-kubernetes-client.specs.v1alpha1-webhook-throttle-config :refer :all]
... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1alpha1_webhook.clj | clojure | (ns clojure-kubernetes-client.specs.v1alpha1-webhook
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1alpha1-webhook-client-config :refer :all]
[clojure-kubernetes-client.specs.v1alpha1-webhook-throttle-config :refer :all]
... | |
7de17b9862a7b0c113330b1e3647b2f335e101a65306abff1c730cb64614146f | ppaml-op3/insomnia | InsomniaFlagScraper.hs | module InsomniaFlagScraper where
import Control.Applicative
import Data.Text.Lazy as T
import Data.Text.Lazy.IO as T
import Text.Parsec.Char
import Text.Parsec.Combinator
import Text.Parsec.Error (ParseError)
import Text.Parsec.Prim hiding ((<|>))
import Text.Parsec.Text.Lazy (Parser)
import qualified System.IO as IO
... | null | https://raw.githubusercontent.com/ppaml-op3/insomnia/5fc6eb1d554e8853d2fc929a957c7edce9e8867d/tests/InsomniaFlagScraper.hs | haskell | skip junk until next newline
and try again or Nothing if eof | module InsomniaFlagScraper where
import Control.Applicative
import Data.Text.Lazy as T
import Data.Text.Lazy.IO as T
import Text.Parsec.Char
import Text.Parsec.Combinator
import Text.Parsec.Error (ParseError)
import Text.Parsec.Prim hiding ((<|>))
import Text.Parsec.Text.Lazy (Parser)
import qualified System.IO as IO
... |
3fa904a6f5f4428228747439eb3143d03b322ae5889288bc5281e6f34009e80d | PeterDWhite/Osker | StartProcess.hs | Copyright ( c ) , 2003
Copyright ( c ) OHSU , 2003
module StartProcess ( startProcess ) where
----------------------------------------------------------------------
-- Data structure describing the process
----------------------------------------------------------------------
Braid imports
import qualified D... | null | https://raw.githubusercontent.com/PeterDWhite/Osker/301e1185f7c08c62c2929171cc0469a159ea802f/Kernel/Domain/StartProcess.hs | haskell | --------------------------------------------------------------------
Data structure describing the process
--------------------------------------------------------------------
Process imports
The action is part of the domain braid, thus it is not a liftable
action. It is not a "safe" action in that it affects other... | Copyright ( c ) , 2003
Copyright ( c ) OHSU , 2003
module StartProcess ( startProcess ) where
Braid imports
import qualified DomainBraid as DB
import qualified BraidUtilities as BU
import qualified Process as P
Start a process , by starting each of the three portions in
proper order : 1st System half , ... |
91679a2f9a2214b39564558840a79ee929e8d69d36de16aab087f1e6e6968924 | SquidDev/illuaminate | illuaminateLsp.ml | open Lsp
type client_channel = Store.client_channel =
{ notify : Server_notification.t -> unit Fiber.t;
request : 'a. 'a Server_request.t -> ('a, Jsonrpc.Response.Error.t) result Fiber.t
}
type server_channel =
{ request :
'res.
client_channel -> 'res Client_request.t -> ('res, Jsonrpc.Response.... | null | https://raw.githubusercontent.com/SquidDev/illuaminate/92fc63b3c009f48abf22d0d3a7f7b48aa861b1aa/src/bin/lsp/illuaminateLsp.ml | ocaml | open Lsp
type client_channel = Store.client_channel =
{ notify : Server_notification.t -> unit Fiber.t;
request : 'a. 'a Server_request.t -> ('a, Jsonrpc.Response.Error.t) result Fiber.t
}
type server_channel =
{ request :
'res.
client_channel -> 'res Client_request.t -> ('res, Jsonrpc.Response.... | |
da3d955adb8bc15ccd54986ab42f6b00af086b2ec80ce616c87e368e9b94d64a | gw000/wisp | Primitives.hs | # LANGUAGE RankNTypes , PatternGuards , TupleSections #
module Wisp.Primitives (mkToplevel) where
import Wisp.Types
import Wisp.Predicates
import Wisp.Core
import Wisp.Reader
import Wisp.STL
import Control.Monad
import Control.Monad.ST
import Control.Monad.Reader
import Control.Monad.Writer
import Data.HashTable.Class... | null | https://raw.githubusercontent.com/gw000/wisp/febc8dff209bf40aa2c6358f728278d66f235af6/Wisp/Primitives.hs | haskell | PRIMITIVE FN COMBINATORS
| Predicate wrapper for variadic typechecking functions.
PRIMITIVE FUNCTIONS
| string coercion
| call-with-current-continuation
| equality
| apply
| integer coercion
| raise an error
| get fn arity
| string -> symbol coercion
| division
| Parse a string into wisp data.
Math operat... | # LANGUAGE RankNTypes , PatternGuards , TupleSections #
module Wisp.Primitives (mkToplevel) where
import Wisp.Types
import Wisp.Predicates
import Wisp.Core
import Wisp.Reader
import Wisp.STL
import Control.Monad
import Control.Monad.ST
import Control.Monad.Reader
import Control.Monad.Writer
import Data.HashTable.Class... |
142e44fb8da95cabd3cadab3c43bc6721d27daf5b85cbf4c6a6298fff99f3ec5 | mjambon/dune-deps | Find.ml |
Dune file finder .
Dune file finder.
*)
type visit_tracker = {
was_visited : string -> bool;
mark_visited : string -> unit;
}
let memoize f =
let tbl = Hashtbl.create 100 in
fun x ->
let run =
match Compat.Hashtbl.find_opt tbl x with
| Some run -> run
| None ->
let ru... | null | https://raw.githubusercontent.com/mjambon/dune-deps/48897a338bcbf91b57fccbed883497f050870b92/src/lib/Find.ml | ocaml | Cache the results of the 'stat' syscall to speed things up.
(due to calling it multiple times on the same path, and having
possibly a lot of paths, and not so great caching at the OS level).
This is to avoid visiting the same file or directory multiple times.
It can happen if the same folder or overlapping... |
Dune file finder .
Dune file finder.
*)
type visit_tracker = {
was_visited : string -> bool;
mark_visited : string -> unit;
}
let memoize f =
let tbl = Hashtbl.create 100 in
fun x ->
let run =
match Compat.Hashtbl.find_opt tbl x with
| Some run -> run
| None ->
let ru... |
55fe2f88b0d2798055b0fd2db9b8b548ece9dec36975c8c72fd52b7034af7598 | MastodonC/terraboot | cluster_test.clj | (ns terraboot.cluster-test
(:require [terraboot.cluster :refer :all]
[terraboot.core :refer :all]
[clojure.test :refer :all]))
(deftest bucket-policy-test
(is (= {"Statement" {"Effect" "Allow"
"Resource" ["arn:aws:s3:::rick"
"arn:aws... | null | https://raw.githubusercontent.com/MastodonC/terraboot/ff01428214539ad884e5c4a5fcdae8f91feae4a9/test/terraboot/cluster_test.clj | clojure | (ns terraboot.cluster-test
(:require [terraboot.cluster :refer :all]
[terraboot.core :refer :all]
[clojure.test :refer :all]))
(deftest bucket-policy-test
(is (= {"Statement" {"Effect" "Allow"
"Resource" ["arn:aws:s3:::rick"
"arn:aws... | |
2bfc334c617bd110d802cbec9267ca177ab4360f8f8d8e5877f1c9969c49eb4a | sunlightlabs/parmenides | core.cljs | (ns parmenides.core
(:require
[om.core :as om :include-macros true]
[sablono.core :as html :refer-macros [html]]))
(enable-console-print!)
(println "parmenides.core loaded")
(def model
(atom
{:sidebar
[{:label "Overview"}
{:label "Reports"}
{:label "Analytics"}
{:label "Export"}... | null | https://raw.githubusercontent.com/sunlightlabs/parmenides/345e705bc01ceafd6388c3b642a0fc02bef5369e/src-cljs/parmenides/core.cljs | clojure | (ns parmenides.core
(:require
[om.core :as om :include-macros true]
[sablono.core :as html :refer-macros [html]]))
(enable-console-print!)
(println "parmenides.core loaded")
(def model
(atom
{:sidebar
[{:label "Overview"}
{:label "Reports"}
{:label "Analytics"}
{:label "Export"}... | |
11fbba44067af76efd25312291ad3fa5efae5a620b5d538b3a7b508b43860047 | zk/clojuredocs | top_contribs.clj | (ns tools.top-contribs
(:require [somnium.congomongo :as mon]
[clojure.pprint :refer (pprint)]))
(def scores (atom {}))
(time (doseq [{:keys [history]} (mon/fetch :examples)]
(let [history (reverse history)
first-user (-> history first :user)]
(swap! scores update-in [fi... | null | https://raw.githubusercontent.com/zk/clojuredocs/28f5ee500f4349039ee81c70d7ac40acbb19e5d8/tools/top_contribs.clj | clojure | (ns tools.top-contribs
(:require [somnium.congomongo :as mon]
[clojure.pprint :refer (pprint)]))
(def scores (atom {}))
(time (doseq [{:keys [history]} (mon/fetch :examples)]
(let [history (reverse history)
first-user (-> history first :user)]
(swap! scores update-in [fi... | |
b44d1f32039c77f3099a824ba943e5fac93711026c985c9300f1859995afbd5a | clj-kondo/clj-kondo | nested_syntax_quote.clj | (ns nested-syntax-quote
(:require [lib.foo :as foo]))
(defn foo [x]
`(+ ~(+ 1 2 `~x)))
(defn nested-macro [tag]
`(defmacro ~(symbol tag) [& args#]
`(foo/bar ~@args#)))
| null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/626978461cbf113c376634cdf034d7262deb429f/corpus/nested_syntax_quote.clj | clojure | (ns nested-syntax-quote
(:require [lib.foo :as foo]))
(defn foo [x]
`(+ ~(+ 1 2 `~x)))
(defn nested-macro [tag]
`(defmacro ~(symbol tag) [& args#]
`(foo/bar ~@args#)))
| |
985845e6870b838db969feb7ccde96ed5abdbd8bd5e65e388c27dc1ec793f08f | MLstate/opalang | pass_PluginCompilation.mli |
Copyright © 2011 , 2012 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 us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/opa/pass_PluginCompilation.mli | ocaml |
Copyright © 2011 , 2012 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 us... | |
dcd7f4d4bac6e4556d5f2dd5f5b15ae8ef71ab078d86d71ad11d6b5453ab5e32 | stain/rdf-clj | rdf_test.clj | (ns rdf-test
(:import (org.apache.commons.rdf.simple SimpleRDF))
(:require [clojure.test :refer :all]
[rdf :refer :all]))
(deftest test-create-graph
(testing "Creating an empty graph"
(let [g (graph)]
(is (= 0 (triple-count g))))))
(deftest test-create-iri
(testing "Creating IRI"
(... | null | https://raw.githubusercontent.com/stain/rdf-clj/3fc767af3c561cf85b661c27b8d014d395190519/test/rdf_test.clj | clojure | (ns rdf-test
(:import (org.apache.commons.rdf.simple SimpleRDF))
(:require [clojure.test :refer :all]
[rdf :refer :all]))
(deftest test-create-graph
(testing "Creating an empty graph"
(let [g (graph)]
(is (= 0 (triple-count g))))))
(deftest test-create-iri
(testing "Creating IRI"
(... | |
d19293ae30f447e3bdc656e1d32bfd07579d167d45e43b813d1ff4bfd8e5a54d | VisionsGlobalEmpowerment/webchange | views.cljs | (ns webchange.ui.widgets.file.views
(:require
[re-frame.core :as re-frame]
[reagent.core :as r]
[webchange.ui.index :as ui]
[webchange.ui.widgets.file.state :as state]
[webchange.utils.uid :refer [get-uid]]))
(defn file
[]
(let [uid (get-uid)]
(r/create-class
{:component-did-mount
... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/6c2d2d86ee0c2acbfbf212320d3ecfe1c7c67e82/src/cljs/webchange/ui/widgets/file/views.cljs | clojure | (ns webchange.ui.widgets.file.views
(:require
[re-frame.core :as re-frame]
[reagent.core :as r]
[webchange.ui.index :as ui]
[webchange.ui.widgets.file.state :as state]
[webchange.utils.uid :refer [get-uid]]))
(defn file
[]
(let [uid (get-uid)]
(r/create-class
{:component-did-mount
... | |
6b8d02a7c4ec41471db28fb114ef7e32bcdee0b0b47d7990525ed7da277824af | andorp/bead | GetSubmission.hs | {-# LANGUAGE OverloadedStrings #-}
module Bead.View.Content.GetSubmission (
getSubmission
) where
import Data.String (fromString)
import qualified Data.ByteString.UTF8 as BsUTF8 (fromString)
import qualified Bead.Controller.UserStories as Story
import Bead.View.Content
getSubmission = DataH... | null | https://raw.githubusercontent.com/andorp/bead/280dc9c3d5cfe1b9aac0f2f802c705ae65f02ac2/src/Bead/View/Content/GetSubmission.hs | haskell | # LANGUAGE OverloadedStrings # | module Bead.View.Content.GetSubmission (
getSubmission
) where
import Data.String (fromString)
import qualified Data.ByteString.UTF8 as BsUTF8 (fromString)
import qualified Bead.Controller.UserStories as Story
import Bead.View.Content
getSubmission = DataHandler $ do
sk <- getParameter su... |
cae660ee043065d610c9142705500a4255706b50fdfdca80ecfeb57b56b5a2dc | marigold-dev/deku | block_hash.ml | open Deku_repr
open Deku_crypto
open BLAKE2b
type block_hash = BLAKE2b.t
and t = block_hash [@@deriving eq, ord]
let of_blake2b hash = hash
let to_blake2b operation_hash = operation_hash
include With_b58_and_encoding (struct
let name = "Deku_consensus.Block_hash"
let prefix = Prefix.deku_block_hash
end)
let has... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/consensus/block_hash.ml | ocaml | open Deku_repr
open Deku_crypto
open BLAKE2b
type block_hash = BLAKE2b.t
and t = block_hash [@@deriving eq, ord]
let of_blake2b hash = hash
let to_blake2b operation_hash = operation_hash
include With_b58_and_encoding (struct
let name = "Deku_consensus.Block_hash"
let prefix = Prefix.deku_block_hash
end)
let has... | |
5982e1582f6560b3adf025e6736e2fbc9389d0a173bbdddf81437ac0be45092e | modular-macros/ocaml-macros | pr5906.ml | type _ constant =
| Int: int -> int constant
| Bool: bool -> bool constant
type (_, _, _) binop =
| Eq: ('a, 'a, bool) binop
| Leq: ('a, 'a, bool) binop
| Add: (int, int, int) binop
let eval (type a) (type b) (type c) (bop:(a,b,c) binop) (x:a constant)
(y:b constant) : c constant =
match bop, x, ... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/typing-gadts/pr5906.ml | ocaml | type _ constant =
| Int: int -> int constant
| Bool: bool -> bool constant
type (_, _, _) binop =
| Eq: ('a, 'a, bool) binop
| Leq: ('a, 'a, bool) binop
| Add: (int, int, int) binop
let eval (type a) (type b) (type c) (bop:(a,b,c) binop) (x:a constant)
(y:b constant) : c constant =
match bop, x, ... | |
b0fdd4c4cb0bf06850263550fde61eb5ae9dea9bc22ed870e2897dbe649e23de | haroldcarr/learn-haskell-coq-ml-etc | HW12_HC_Risk.hs |
Created : 2014 Jun 22 ( Sun ) 10:02:26 by .
Last Modified : 2014 Jun 22 ( Sun ) 10:14:33 by .
Created : 2014 Jun 22 (Sun) 10:02:26 by Harold Carr.
Last Modified : 2014 Jun 22 (Sun) 10:14:33 by Harold Carr.
-}
# LANGUAGE GeneralizedNewtypeDeriving #
module HW12_HC_Risk where
import Co... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2014-06-upenn/cis194/src/HW12_HC_Risk.hs | haskell | ----------------------------------------------------------
Die values
----------------------------------------------------------
Risk
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------... |
Created : 2014 Jun 22 ( Sun ) 10:02:26 by .
Last Modified : 2014 Jun 22 ( Sun ) 10:14:33 by .
Created : 2014 Jun 22 (Sun) 10:02:26 by Harold Carr.
Last Modified : 2014 Jun 22 (Sun) 10:14:33 by Harold Carr.
-}
# LANGUAGE GeneralizedNewtypeDeriving #
module HW12_HC_Risk where
import Co... |
cdbd62c5d6ebe4f15cc3dff7aeb27db2ed6dc2b346db2d356c9ab95fee8fd97f | someteam/acha | core_test.clj | (ns acha.core-test
(:require [clojure.test :refer :all]
[acha.core :refer :all]))
| null | https://raw.githubusercontent.com/someteam/acha/6b957f6cb6773f4fc184d094b40de79039bb58cc/test/acha/core_test.clj | clojure | (ns acha.core-test
(:require [clojure.test :refer :all]
[acha.core :refer :all]))
| |
f5fb85b717b4a1a00345ec23ce8ff28e4768a351b69f1e3b2a56cf2acd638ae8 | coinmetrics/haskell-tools | Cosmos.hs | # LANGUAGE GeneralizedNewtypeDeriving , OverloadedStrings , TypeFamilies #
module CoinMetrics.Cosmos
( Cosmos(..)
, CosmosBlock
, CosmosTransaction(..)
) where
import Control.Monad
import qualified Crypto.Hash as C
import qualified Data.Aeson as J
import qualified Data.Aeson.Types as J
import qualified Data.A... | null | https://raw.githubusercontent.com/coinmetrics/haskell-tools/94d59497b6c4d829dd680df82c71fe607877ae76/coinmetrics-cosmos/CoinMetrics/Cosmos.hs | haskell | only calculate hex-encoded hash here; transaction is retrieved in JSON format later
retrieve transactions | # LANGUAGE GeneralizedNewtypeDeriving , OverloadedStrings , TypeFamilies #
module CoinMetrics.Cosmos
( Cosmos(..)
, CosmosBlock
, CosmosTransaction(..)
) where
import Control.Monad
import qualified Crypto.Hash as C
import qualified Data.Aeson as J
import qualified Data.Aeson.Types as J
import qualified Data.A... |
114c32245e186c3d73ee228a3b52911c3c1fd8183e6112046e20d3467ad47d37 | ninenines/cowboy | resp_iolist_body_h.erl | %% This module sends an iolist with various odd elements in it as a response.
-module(resp_iolist_body_h).
-dialyzer(no_improper_lists).
-export([init/2]).
init(Req0, State) ->
Req = cowboy_req:reply(200, #{
<<"content-type">> => <<"text/html">>
}, [[[[<<>> | <<>> ] | <<>>] | [ <<>> ]], <<"
<p>
Ne per c... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/resp_iolist_body_h.erl | erlang | This module sends an iolist with various odd elements in it as a response. |
-module(resp_iolist_body_h).
-dialyzer(no_improper_lists).
-export([init/2]).
init(Req0, State) ->
Req = cowboy_req:reply(200, #{
<<"content-type">> => <<"text/html">>
}, [[[[<<>> | <<>> ] | <<>>] | [ <<>> ]], <<"
<p>
Ne per causae definitiones, ut veniam vocent cum. Eu torquatos expetendis eam. Volumus... |
98670d9e121ab942c3ef8b829579f2cb845c3713ea6b069012bda64ac7f318fa | donaldsonjw/bigloo | os.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / runtime / Llib / os.scm * /
;* ------------------------------------------------------------- */
;* Author : SERRANO Manuel */
* Crea... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/runtime/Llib/os.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* Author : SERRANO Manuel */
* ------------------------------------------------------------- */
* Os dependant variables ... | * serrano / prgm / project / bigloo / runtime / Llib / os.scm * /
* Creation : Tue Aug 5 10:57:59 1997 * /
* Last change : Fri Aug 28 08:53:15 2015 ( serrano ) * /
(module __os
(import __error
__param)
(use __type... |
366df601310c477bf6249d34784a6dbc112facb3736cd8cbf13bed7f5ca689f0 | igorhvr/bedlam | srfi-40.scm | STREAM -- LIBRARY OF SYNTAX AND FUNCTIONS TO MANIPULATE STREAMS
;;; A stream is a new data type, disjoint from all other data types, that
;;; contains a promise that, when forced, is either nil (a single object
;;; distinguishable from all other objects) or consists of an object (the
;;; stream element) followed by ... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-1.16.6/full-src/sisc/src/sisc/modules/srfi/srfi-40.scm | scheme | A stream is a new data type, disjoint from all other data types, that
contains a promise that, when forced, is either nil (a single object
distinguishable from all other objects) or consists of an object (the
stream element) followed by a stream. Each stream element is evaluated
once
evaluated its value is saved... | STREAM -- LIBRARY OF SYNTAX AND FUNCTIONS TO MANIPULATE STREAMS
(define-nongenerative-record-type stream-type
sisc.srfi.srfi-40.stream-type
(make-stream promise)
stream?
(promise stream-promise stream-promise-set!))
(define stream-error error)
LOW - LEVEL STREAM FUNCTIONS by ( private e - mail 13 ... |
e167d7381e1d35075a5c67763f24e6ba713aca0685cb46faa36592620867243d | facebookarchive/pfff | parse_erlang.mli |
(* the token list contains also the comment-tokens *)
type program_and_tokens = Ast_erlang.program * Parser_erlang.token list
(* This is the main function *)
val parse:
Common.filename -> (program_and_tokens * Parse_info.parsing_stat)
(* internal *)
val tokens: Common.filename -> Parser_erlang.token list
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_erlang/parsing/parse_erlang.mli | ocaml | the token list contains also the comment-tokens
This is the main function
internal |
type program_and_tokens = Ast_erlang.program * Parser_erlang.token list
val parse:
Common.filename -> (program_and_tokens * Parse_info.parsing_stat)
val tokens: Common.filename -> Parser_erlang.token list
|
618229d2ab027861d683aa5c570177d53e1efd5b7b6eb7536941c924d4d67700 | BranchTaken/Hemlock | test_of_stream.ml | open! Basis.Rudiments
open! Basis
open Array
let test () =
let test stream = begin
File.Fmt.stdout
|> Fmt.fmt "of_stream[_rev] "
|> (Stream.pp Uns.pp) stream
|> Fmt.fmt " -> "
|> (pp Uns.pp) (of_stream stream)
|> Fmt.fmt " / "
|> (pp Uns.pp) (of_stream_rev stream)
|> Fmt.fmt "\n"
... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/array/test_of_stream.ml | ocaml | open! Basis.Rudiments
open! Basis
open Array
let test () =
let test stream = begin
File.Fmt.stdout
|> Fmt.fmt "of_stream[_rev] "
|> (Stream.pp Uns.pp) stream
|> Fmt.fmt " -> "
|> (pp Uns.pp) (of_stream stream)
|> Fmt.fmt " / "
|> (pp Uns.pp) (of_stream_rev stream)
|> Fmt.fmt "\n"
... | |
9068ac78981afb7a167630f7a33b92e9ca86bcff7f4faab6689d35ede881cfe0 | ranjitjhala/sprite-lang | Types.hs | {-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
module Language.Sprite.L6.Types where
import qualified Language.Fixpoint.Misc as Misc
i... | null | https://raw.githubusercontent.com/ranjitjhala/sprite-lang/bebfa8a8de6d558853145cbed8c511daa9bda3c7/src/Language/Sprite/L6/Types.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE PatternSynonyms #
# LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
| Basic types --------------------------------------------------------------
| Refinement Variables -----------------------------------------------------
| Abs... | # LANGUAGE FlexibleInstances #
module Language.Sprite.L6.Types where
import qualified Language.Fixpoint.Misc as Misc
import qualified Language.Fixpoint.Horn.Types as H
import qualified Language.Fixpoint.Horn.Transformations as H
import qualified Language.Fixpoint.Types a... |
124d7406b3ed04ab5cbedd43c5f2d68bfb2216d8f55f83388a389b93582dbe23 | TempusMUD/cl-tempus | guildmaster.lisp | (in-package #:tempus)
(defcommand (ch "practice") ()
(list-skills ch :only-known-p t))
(defcommand (ch "practice" args) ()
(declare (ignore args))
(send-to-char ch "You'll have to do that someplace else.~%"))
(defcommand (ch "learn") ()
(list-skills ch :only-known-p t))
(defcommand (ch "learn" args) ()
(decl... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/specials/guildmaster.lisp | lisp | (in-package #:tempus)
(defcommand (ch "practice") ()
(list-skills ch :only-known-p t))
(defcommand (ch "practice" args) ()
(declare (ignore args))
(send-to-char ch "You'll have to do that someplace else.~%"))
(defcommand (ch "learn") ()
(list-skills ch :only-known-p t))
(defcommand (ch "learn" args) ()
(decl... | |
0a454d705a36e54ebbcc91f33d013f09ca0b9f1afef288c59fd94f28f6d190b0 | mtolly/onyxite-customs | BMS.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
# LANGUAGE TupleSections #
module Onyx.Beatmania.BMS where
import qualified Data.EventList.Relative.TimeBody as RTB
import qualified Data.HashMap.Strict as HM
import qualified Data.Map ... | null | https://raw.githubusercontent.com/mtolly/onyxite-customs/0c8acd6248fe92ea0d994b18b551973816adf85b/haskell/packages/onyx-lib/src/Onyx/Beatmania/BMS.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE PatternSynonyms # | # LANGUAGE LambdaCase #
# LANGUAGE TupleSections #
module Onyx.Beatmania.BMS where
import qualified Data.EventList.Relative.TimeBody as RTB
import qualified Data.HashMap.Strict as HM
import qualified Data.Map as Map
import Data.Maybe
import qualified Data.Tex... |
8712359ada6c30ec935f5d803e092b7187bb5fe99d147812a99501f98df41bd1 | dgtized/shimmers | emitters.cljs | (ns shimmers.sketches.emitters
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.common.framerate :as framerate]
[shimmers.common.particle-system :as particles]
[shimmers.common.sequence :refer [map-kv]]
[shimmers.math.probability :as p]
[shimmers.sketch :as sketc... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/emitters.cljs | clojure | (ns shimmers.sketches.emitters
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.common.framerate :as framerate]
[shimmers.common.particle-system :as particles]
[shimmers.common.sequence :refer [map-kv]]
[shimmers.math.probability :as p]
[shimmers.sketch :as sketc... | |
7884029fbc8733ab38d41f46cd0624de4e6979ece73a8da27e53252c95ea9fe4 | ludwigpacifici/saumon | parser_while_tests.ml | open Base
open Saumon
module A = Alcotest_testable
let check_true = Alcotest.(check bool) "check Parser.parse" true
let check_parse =
Alcotest.(check (result A.ast_program string)) "check Parser.parse"
let left_paren = Token.of_token_kind ~kind:Token_kind.Left_paren
let right_paren = Token.of_token_kind ~kind:Toke... | null | https://raw.githubusercontent.com/ludwigpacifici/saumon/e8a05216ffae5a58ce3ceed5ae3e989b81930ed5/test/unit-tests/parser_while_tests.ml | ocaml | while ( true ) nil ;
while ( ) nil ;
while ( nil ; ) nil ;
while true ) nil ;
while ( true nil ;
while ( true ) | open Base
open Saumon
module A = Alcotest_testable
let check_true = Alcotest.(check bool) "check Parser.parse" true
let check_parse =
Alcotest.(check (result A.ast_program string)) "check Parser.parse"
let left_paren = Token.of_token_kind ~kind:Token_kind.Left_paren
let right_paren = Token.of_token_kind ~kind:Toke... |
32f29363cd468652b7352fb1b8cf4bcd52c4f7e013042978fb1fbfcfaf78e0e6 | Enecuum/Node | Extra.hs | module Data.ByteString.Base64.Extra where
import qualified Data.ByteString.Base64 as B
import Enecuum.Prelude
base64ToText :: ByteString -> Text
base64ToText = decodeUtf8 . B.encode
textToBase64 :: Text -> ByteString
textToBase64 aStr = case B.decode . encodeUtf8 $ aStr of
Right a -> a
... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Data/ByteString/Base64/Extra.hs | haskell | module Data.ByteString.Base64.Extra where
import qualified Data.ByteString.Base64 as B
import Enecuum.Prelude
base64ToText :: ByteString -> Text
base64ToText = decodeUtf8 . B.encode
textToBase64 :: Text -> ByteString
textToBase64 aStr = case B.decode . encodeUtf8 $ aStr of
Right a -> a
... | |
d3e6284cda293a7976a049f6ba827501205e25e440583a173fd490d288522895 | melange-re/melange | ext_position.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/ext/ext_position.mli | ocaml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 License , or
* ( at your option ) any later... | |
5aea42a2f8e8b01956971584fa024292924882c22ec6e52657ef4e10de29b909 | sixthnormal/clj-3df | capm.clj | (ns clj-3df.capm
(:require
[clj-3df.attribute :as attribute]
[clj-3df.core :refer [exec! create-debug-conn! create-db create-attribute
register-source query transact]]))
(def schema
{:user {:db/valueType :Number}
:timestamp {:db/valueType :Number}
:link/uri {:db/valueType... | null | https://raw.githubusercontent.com/sixthnormal/clj-3df/7dfb89a438f9fb1a3c5d0d356f05acf3f9c51177/test/clj_3df/capm.clj | clojure | (ns clj-3df.capm
(:require
[clj-3df.attribute :as attribute]
[clj-3df.core :refer [exec! create-debug-conn! create-db create-attribute
register-source query transact]]))
(def schema
{:user {:db/valueType :Number}
:timestamp {:db/valueType :Number}
:link/uri {:db/valueType... | |
e77c3c2c3668ff6aca1512ea1b1c7eaf55b57edb5e288d481c92265ea86c35be | bobatkey/foveran | Errors.hs | {-# LANGUAGE OverloadedStrings #-}
module Language.Foveran.Typing.Errors
( TypeError (..)
, ppTypeError
, ppTerm
, ppType
, DataDeclError (..)
, ppDataDeclError
)
where
import Text.PrettyPrint
import Language.Foveran.Syntax.Identifier (Ident, UsesIdentifiers, runNam... | null | https://raw.githubusercontent.com/bobatkey/foveran/e57463e3f6923becdf1249cd2fd0ccfcd566f7c5/src/Language/Foveran/Typing/Errors.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
Checking errors
Checking errors for equality
Change of direction error
Term not well-formed
FIXME: try to get rid of this
---------------------------------------------------------------------------- |
module Language.Foveran.Typing.Errors
( TypeError (..)
, ppTypeError
, ppTerm
, ppType
, DataDeclError (..)
, ppDataDeclError
)
where
import Text.PrettyPrint
import Language.Foveran.Syntax.Identifier (Ident, UsesIdentifiers, runNameGeneration)
import qualified Langu... |
a7aa690d0a93b1e5926c7169c34247e9fdf97f864e2eaaf13bbdefcd2c531ce8 | HuwCampbell/orc-haskell | Prelude.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Orc.Prelude (
-- * Primitive types
* *
Bool (..)
, bool
, (&&)
, (||)
, not
, otherwise
* *
, Char
-- ** Int
, Intege... | null | https://raw.githubusercontent.com/HuwCampbell/orc-haskell/259649bc5fa5c6d8bd850fdad0517af6c028e00e/src/Orc/Prelude.hs | haskell | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveTraversable #
# LANGUAGE OverloadedStrings #
* Primitive types
** Int
** Word
** Real
* Text
* Ratio
* Algebraic structures
** Monoid
** Functor
** Bifunctor
** Applicative
** Alternative
** Monad
* Data structures
** Either
** Maybe
** Tuple
* Typeclass... | # LANGUAGE CPP #
# LANGUAGE NoImplicitPrelude #
module Orc.Prelude (
* *
Bool (..)
, bool
, (&&)
, (||)
, not
, otherwise
* *
, Char
, Integer
, Int
, Int8
, Int16
, Int32
, Int64
, Double
, Float
, Word64
, fromIntegral
, ceiling
, Text
, Ratio
, (%)
,... |
3c126ecea835a463d9ccef9448b3b58be1b9583a4d139d01a013242cba57150e | returntocorp/semgrep | Manifest_jsonnet.mli | exception Error of string * Parse_info.t
(* TODO: at some point we probably would prefer an AST_generic.program
* which could track the origin of tokens through import, eval, and
* manifestation and that we could pass to osemgrep to evaluate the rules.
*)
val manifest_value : Value_jsonnet.value_ -> JSON.t
| null | https://raw.githubusercontent.com/returntocorp/semgrep/1fe267d6fcda7bc470520ebd892d9202b7333437/libs/ojsonnet/Manifest_jsonnet.mli | ocaml | TODO: at some point we probably would prefer an AST_generic.program
* which could track the origin of tokens through import, eval, and
* manifestation and that we could pass to osemgrep to evaluate the rules.
| exception Error of string * Parse_info.t
val manifest_value : Value_jsonnet.value_ -> JSON.t
|
38cb133d80e10fe8161782edc875c21f70924de69da7f8ffe7004c119d896cfc | rain-1/single_cream | combinations.scm | (define (combs-with-rep k lst)
(if (= k 0)
'(())
(if (null? lst)
'()
(append
(map
(lambda (x)
(cons (car lst) x))
(combs-with-rep (- k 1) lst))
(combs-with-rep k (cdr lst))))))
(begin
(for-each print (combs-with-rep 2 (cons "iced... | null | https://raw.githubusercontent.com/rain-1/single_cream/f8989fde4bfcffe0af7f6ed5916885446bf40124/t/rosetta/combinations.scm | scheme | (define (combs-with-rep k lst)
(if (= k 0)
'(())
(if (null? lst)
'()
(append
(map
(lambda (x)
(cons (car lst) x))
(combs-with-rep (- k 1) lst))
(combs-with-rep k (cdr lst))))))
(begin
(for-each print (combs-with-rep 2 (cons "iced... | |
59705aa41bf4cb517e000995c4f656e77f4dece4c5057bc4af272ae8eb9422eb | alex-hhh/data-frame | bsearch.rkt | #lang racket/base
;; bsearch.rkt -- binary search in a sorted vector
;;
;; This file is part of data-frame -- -hhh/data-frame
Copyright ( c ) 2018 < >
;;
;; 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 Fre... | null | https://raw.githubusercontent.com/alex-hhh/data-frame/ea260ee35e87be7f3f2d7808cdaf1d7e5d7d9916/private/bsearch.rkt | racket | bsearch.rkt -- binary search in a sorted vector
This file is part of data-frame -- -hhh/data-frame
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
option) any later version.
This program is distributed in the hope ... | #lang racket/base
Copyright ( c ) 2018 < >
the Free Software Foundation , either version 3 of the License , or ( at your
You should have received a copy of the GNU Lesser General Public License
(require racket/contract
racket/math)
Both ` lower - bound ` and ` upper - bound ` will search a sorted... |
7582c1314f26356d384544c08f4b1b3f04d9e8f948a26512c8f2a59bcc13859a | ocaml-flambda/flambda-backend | to_cmm_env.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/21942b6fbc9c577be4e8c288149dbe63a5d55e72/middle_end/flambda2/to_cmm/to_cmm_env.mli | ocaml | ************************************************************************
OCaml
... | , OCamlPro
Copyright 2022 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
* { 1 Translation environment }
* Environment for Flambda to Cmm translation
type t
type free_vars = Backe... |
5a189faf08aa2a9bb7128f5b6ee43474b5e037cf42d88b3a3203c53c347ffd70 | bnoordhuis/chicken-core | srfi-1.import.scm | ;;;; srfi-1.import.scm - import library for "srfi-1" module
;
Copyright ( c ) 2008 - 2013 , The Chicken Team
; 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 ... | null | https://raw.githubusercontent.com/bnoordhuis/chicken-core/56d30e3be095b6abe1bddcfe10505fa726a43bb5/srfi-1.import.scm | scheme | srfi-1.import.scm - import library for "srfi-1" module
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 notice, this list of conditi... | Copyright ( c ) 2008 - 2013 , 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 LIMITED TO , PROCUREMENT OF SUBSTITUTE... |
45700db4049afca8fb4d068ed1fae6944195bf63551cf78f685d9e9665e56b65 | SKS-Keyserver/sks-keyserver | prefixTree.ml | (***********************************************************************)
(* prefixTree.ml *)
(* *)
Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2... | null | https://raw.githubusercontent.com/SKS-Keyserver/sks-keyserver/a4e5267d817cddbdfee13d07a7fb38a9b94b3eee/prefixTree.ml | ocaml | *********************************************************************
prefixTree.ml
redistribute it and/or modify it under ... | Copyright ( C ) 2002 , 2003 , 2004 , 2005 , 2006 , 2007 , 2008 , 2009 , 2010 ,
2011 , 2012 , 2013 and Contributors
This file is part of SKS . SKS is free software ; you can
Public License as published by the Free Software Foundation ; either
version 2 of the License , or... |
bc9602c1bf528ff5d265595dcde4a10a5c18ccafa76198186290aecd765487a5 | Convex-Dev/convex.cljc | syntax.clj | (ns convex.test.break.syntax
"Testing `Syntax` utilities."
{:author "Adam Helinski"}
(:require [clojure.test.check.generators :as TC.gen]
[clojure.test.check.properties :as TC.prop]
[convex.break :as $.break]
[convex.cell :as $.cell]
... | null | https://raw.githubusercontent.com/Convex-Dev/convex.cljc/effce7127933c0733a7ef00f4ede8fc83277ab28/module/break/src/test/clj/convex/test/break/syntax.clj | clojure | (ns convex.test.break.syntax
"Testing `Syntax` utilities."
{:author "Adam Helinski"}
(:require [clojure.test.check.generators :as TC.gen]
[clojure.test.check.properties :as TC.prop]
[convex.break :as $.break]
[convex.cell :as $.cell]
... | |
b72a98d81a514257c83cd1f4940106cff200b8e174d80059d596b062bc8479de | silky/quipper | Synthesis.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
-- | A Quipper library for synthesizing Clifford+... | null | https://raw.githubusercontent.com/silky/quipper/1ef6d031984923d8b7ded1c14f05db0995791633/QuipperLib/Synthesis.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
| A Quipper library for synthesizing Clifford+/T/ circuits directly
operator. This library provides both exact and approximate
synthe... | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
from a matrix description or Euler angle description of a unitary
module QuipperLib.Synthesis where
import Quipper
import Quipper.Internal
import Quantum.Synthesis.CliffordT
import Quantum.Synthesis.MultiQubitSynthesis
import Quantum.S... |
e986d5c55dec91bd0ed6e4d75b34f284baab45dfcfb240f4ffae21e4df7e9ef4 | LuisThiamNye/chic | demo.clj | (ns chic.quantum.demo
(:require
[clojure.core.matrix :as matrix]
[chic.paint :as cpaint]
[chic.util :as util]
[chic.ui.event :as uievt]
[io.github.humbleui.core :as hui]
[io.github.humbleui.paint :as huipaint]
[chic.ui.error :as cui.error]
[chic.ui :as cui]
[chic.ui.layout :as cuilay]
[i... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/quantum/demo.clj | clojure | guides
main
ui-h-gate (fn [qid gid]
(ui-box-gate qid gid (ui-h-gate))) | (ns chic.quantum.demo
(:require
[clojure.core.matrix :as matrix]
[chic.paint :as cpaint]
[chic.util :as util]
[chic.ui.event :as uievt]
[io.github.humbleui.core :as hui]
[io.github.humbleui.paint :as huipaint]
[chic.ui.error :as cui.error]
[chic.ui :as cui]
[chic.ui.layout :as cuilay]
[i... |
4c68f63cfc78f0de670b5149047412e7cccfd90e33d5fc97a44ddb13017b7fde | cl-babel/babel | enc-cp437.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
enc-cp437.lisp --- Implementation of the IBM Code Page 437
;;;
Copyright ( C ) 2020 , < >
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to d... | null | https://raw.githubusercontent.com/cl-babel/babel/f892d0587c7f3a1e6c0899425921b48008c29ee3/src/enc-cp437.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to... | enc-cp437.lisp --- Implementation of the IBM Code Page 437
Copyright ( C ) 2020 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " ... |
288d8136d5e4e4092d7cc183af6030039be775e541a5433036c60b080d586451 | boxer-project/boxer-sunrise | ftgl.lisp | -*- Mode : Lisp ; rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / ftgl.lisp , v 1.2.3.1 2021/07/12 15:10:01 " -*-
Copyright ( c ) 1987 - -2021 LispWorks Ltd. All rights reserved .
;; An FTGL interface.
(cl:defpackage "FTGL"
(:export
#:ft-error
#:ft-glyph-s... | null | https://raw.githubusercontent.com/boxer-project/boxer-sunrise/535fc1b2a35b4462f6931133a86953c78bed26b1/src/opengl-lw-8/ftgl.lisp | lisp | rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / ftgl.lisp , v 1.2.3.1 2021/07/12 15:10:01 " -*-
An FTGL interface.
Misc FreeType definitions. |
Copyright ( c ) 1987 - -2021 LispWorks Ltd. All rights reserved .
(cl:defpackage "FTGL"
(:export
#:ft-error
#:ft-glyph-slot
#:ft-encoding
#:FTGL_RENDER_FRONT
#:FTGL_RENDER_BACK
#:FTGL_RENDER_SIDE
#:FTGL_RENDER_ALL
#:ftgl-double
#:ftgl-float
#:ftglglyph
#:ftgl-create-custom-glyph
... |
40b44e7ef989d5631ba6a9121b9e179f547f65f4fe56ea44a61b623d6afacf6b | sha49/Primes | isprime.hs | import Primes
import System.Environment
import System.Random
main = do x <- getArgs
seed <- newStdGen
print $ isPrime seed $ rInteger $ head x
rInteger :: String -> Integer
rInteger = read | null | https://raw.githubusercontent.com/sha49/Primes/7f8e9532f0a03bb7d82eeeeb9ddc7f190c230b0d/isprime.hs | haskell | import Primes
import System.Environment
import System.Random
main = do x <- getArgs
seed <- newStdGen
print $ isPrime seed $ rInteger $ head x
rInteger :: String -> Integer
rInteger = read | |
ec1745031029685782bf0cf688d95d03c9ca7ae39bf8725e0ab320c3ae35df15 | nitrogen/NitrogenProject.com | demos_state.erl | -module (demos_state).
-include_lib ("nitrogen_core/include/wf.hrl").
-compile(export_all).
main() -> #template { file="./templates/demos46.html" }.
title() -> "Session State and Page State".
headline() -> "Session State and Page State".
left() ->
[
"
<p>
The first counter to the right ... | null | https://raw.githubusercontent.com/nitrogen/NitrogenProject.com/b4b3a0dbe17394608d2ee6eaa089e3ece1285075/src/demos/demos_state.erl | erlang | Update the elements with their values... | -module (demos_state).
-include_lib ("nitrogen_core/include/wf.hrl").
-compile(export_all).
main() -> #template { file="./templates/demos46.html" }.
title() -> "Session State and Page State".
headline() -> "Session State and Page State".
left() ->
[
"
<p>
The first counter to the right ... |
408931bcc86f2bd84114afef43eacd4130c5654a300db94c7ab4a675a68b276b | kafka4beam/snabbkaffe | is_subset_tests.erl | -module(is_subset_tests).
-include_lib("eunit/include/eunit.hrl").
-include_lib("snabbkaffe.hrl").
-define(foo(A), #{foo => A, bar => bar}).
-define(valid(T, L),
?assert(?projection_is_subset(foo, [?foo(I) || I <- T], L))).
-define(invalid(T, L),
?assertError( {panic, #{?snk_kind := "Trace contains ... | null | https://raw.githubusercontent.com/kafka4beam/snabbkaffe/581c73a601ee3377fad85132323fd2b675dacd71/test/is_subset_tests.erl | erlang | -module(is_subset_tests).
-include_lib("eunit/include/eunit.hrl").
-include_lib("snabbkaffe.hrl").
-define(foo(A), #{foo => A, bar => bar}).
-define(valid(T, L),
?assert(?projection_is_subset(foo, [?foo(I) || I <- T], L))).
-define(invalid(T, L),
?assertError( {panic, #{?snk_kind := "Trace contains ... | |
0e12d82d1c3867e5e017d125f25d622fbc6d4611e0613f0ad43088c706448284 | rtoy/cmucl | dri2.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : XLIB ; -*-
;;; ---------------------------------------------------------------------------
;;; Title: DRI Extension
Created : 2014 - 11 - 17
Author : < >
;;; ---------------------------------------------------------------------------
;;;
( c ) cop... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/clx/extensions/dri2.lisp | lisp | Syntax : Common - Lisp ; Package : XLIB ; -*-
---------------------------------------------------------------------------
Title: DRI Extension
---------------------------------------------------------------------------
Permission is granted to any individual or institution to use,
copy, modify, and distribu... | Created : 2014 - 11 - 17
Author : < >
( c ) copyright 2014 by
(in-package :xlib)
(export '(dri2-query-version
dri2-authenticate
dri2-connect
dri2-get-buffersxo))
(define-extension "DRI2")
(defun dri2-opcode (display)
(extension-opcode display "DRI2"))
(defconstant +dri-major+ 2)
(defcon... |
38e2e35d113c89dfc5a4f00a21edbb3d82b4cd9003a64a17c70241247c6859c8 | malcolmreynolds/GSLL | body-expand.lisp | ;; Expand the body of a defmfun
2009 - 04 - 13 22:07:13EDT body-expand.lisp
Time - stamp : < 2009 - 05 - 03 22:18:13EDT body-expand.lisp >
;; $Id: $
(in-package :gsl)
(defun creturn-st (c-return)
"The symbol-type of the return from the C function."
(make-st
(if (listp c-return)
(st-symbol c-return... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/init/body-expand.lisp | lisp | Expand the body of a defmfun
$Id: $
because the potential callers should all have #-fsbv
conditionalization. It is here just so that body-expand can
will actually
Catch programming errors, usually typos
passed by value
better as a symbol macro
fill in arguments
success-failure more important than passed-in
... | 2009 - 04 - 13 22:07:13EDT body-expand.lisp
Time - stamp : < 2009 - 05 - 03 22:18:13EDT body-expand.lisp >
(in-package :gsl)
(defun creturn-st (c-return)
"The symbol-type of the return from the C function."
(make-st
(if (listp c-return)
(st-symbol c-return)
(make-symbol "CRETURN"))
(if (... |
3652b173a1c80a2fdf27eb98c7a7229dfd3b85fd9a96405db8a80592aacf7dad | BumblebeeBat/pink_crypto | elliptic.erl | -module(elliptic).
-export([add/2, make_point/2, multiply/2, hex2int/1, modsqrt/1, powrem/2,
compress_pub/1, decompress_pub/1,
base/0, random_int/0,
inverse/1, inverse_old/1,
pedersen/2,
test/0, test5/0, test6/0]).
Y^2 = X^3 + 7 .
the prime p that defines the group is " FFFFFFFFFFFFFFFFFFFFF... | null | https://raw.githubusercontent.com/BumblebeeBat/pink_crypto/fd79361eb3e7dc4e9ac5b36e38d58f3542755613/src/elliptic.erl | erlang | The base point G in compressed form is:
and in uncompressed form is:
N (order) = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
L is the slope of the line
Xr = L^2 - Xp - Xq
Yr = L(Xp - Xr) - Yp
If Xp == Xq and Yp == Yq
a is zero for bitcoin curve .
All the elliptic curve stuff explained above an... | -module(elliptic).
-export([add/2, make_point/2, multiply/2, hex2int/1, modsqrt/1, powrem/2,
compress_pub/1, decompress_pub/1,
base/0, random_int/0,
inverse/1, inverse_old/1,
pedersen/2,
test/0, test5/0, test6/0]).
Y^2 = X^3 + 7 .
the prime p that defines the group is " FFFFFFFFFFFFFFFFFFFFF... |
3b43035d0f6976af00f16a9cc95f53b6cf253880eef8d5bc7da4a9dd714d232e | hadolint/hadolint | DL3037.hs | module Hadolint.Rule.DL3037 (rule) where
import qualified Data.Text as Text
import Hadolint.Rule
import qualified Hadolint.Shell as Shell
import Language.Docker.Syntax
rule :: Rule Shell.ParsedShell
rule = dl3037 <> onbuild dl3037
# INLINEABLE rule #
dl3037 :: Rule Shell.ParsedShell
dl3037 = simpleRule code severit... | null | https://raw.githubusercontent.com/hadolint/hadolint/6c4632387a3485a9b7e1bf46c58da697178e02e2/src/Hadolint/Rule/DL3037.hs | haskell | # INLINEABLE dl3037 # | module Hadolint.Rule.DL3037 (rule) where
import qualified Data.Text as Text
import Hadolint.Rule
import qualified Hadolint.Shell as Shell
import Language.Docker.Syntax
rule :: Rule Shell.ParsedShell
rule = dl3037 <> onbuild dl3037
# INLINEABLE rule #
dl3037 :: Rule Shell.ParsedShell
dl3037 = simpleRule code severit... |
3f1c96bc04b8b78edaafb5a1606d36434f8afb5d6270935a0215f6e1f571feae | stuarthalloway/programming-clojure | server.clj | (ns clojurebreaker.server
(:require [noir.server :as server]))
(server/load-views "src/clojurebreaker/views/")
(defn -main [& m]
(let [mode (keyword (or (first m) :dev))
port (Integer. (get (System/getenv) "PORT" "8080"))]
(server/start port {:mode mode
:ns 'clojurebreaker})))
... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/clojurebreaker/src/clojurebreaker/server.clj | clojure | (ns clojurebreaker.server
(:require [noir.server :as server]))
(server/load-views "src/clojurebreaker/views/")
(defn -main [& m]
(let [mode (keyword (or (first m) :dev))
port (Integer. (get (System/getenv) "PORT" "8080"))]
(server/start port {:mode mode
:ns 'clojurebreaker})))
... | |
363bd706f80eb34d5df4b0d7b2ac3bb857901221891bfee1d2418edb1cab9877 | acieroid/scala-am | satMiddle.scm | (define (phi x1 x2 x3 x4)
(and (<change> (or x1 (not x2) (not x3))
(or x1 (not x2) (not x3) (not x4)))
(<change> (or (not x2) (not x3))
(or x2 (not x3)))
(<change> (or x4 x2)
(or (not x1) x4 x2))))
(define (try f)
(or (f #t) (f #f)))
(define (sat-solv... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/changes/scheme/satMiddle.scm | scheme | (define (phi x1 x2 x3 x4)
(and (<change> (or x1 (not x2) (not x3))
(or x1 (not x2) (not x3) (not x4)))
(<change> (or (not x2) (not x3))
(or x2 (not x3)))
(<change> (or x4 x2)
(or (not x1) x4 x2))))
(define (try f)
(or (f #t) (f #f)))
(define (sat-solv... | |
51cfc3c00494793c7f6345faaa383c60d31c8c75a06f1d5ecd1a1b9c7c55f4dd | dharmatech/abstracting | source.scm |
(define (rgba red green blue alpha)
(let ((message-handler
(lambda (msg)
(case msg
((red) (lambda () red))
((green) (lambda () green))
((blue) (lambda () blue))
((alpha) (lambda () alpha))
((red!) (lambda (new) (set! red new)))
((green!) (lambda (n... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/ext/color/rgba/source.scm | scheme |
(define (rgba red green blue alpha)
(let ((message-handler
(lambda (msg)
(case msg
((red) (lambda () red))
((green) (lambda () green))
((blue) (lambda () blue))
((alpha) (lambda () alpha))
((red!) (lambda (new) (set! red new)))
((green!) (lambda (n... | |
6c9f1e3f38bda08f5a5e1a5eeb219c7009bae8a35a2fa6064b61c39dfed9978d | vouillon/osm | profile_pedestrian.ml | OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... | null | https://raw.githubusercontent.com/vouillon/osm/a42d1bcc82a4ad73c26c81ac7a75f9f1c7470344/osm/profile_pedestrian.ml | ocaml | "no";
XXX is round about | OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... |
b8e62ce4fe5b159c66f9916196768496e7d77b7c7a6373383d8ff609a4213937 | bubba/lsp-test | Session.hs | # LANGUAGE CPP #
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeIn... | null | https://raw.githubusercontent.com/bubba/lsp-test/e5f79572bad3163f6f60a3f9254e8eda9e78f8b9/src/Language/LSP/Test/Session.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeInType #
You can send and receive messages to the server within 'Session' via
'Language.LSP.Test.message',
'Language.LSP.Test.sendRequest' and
| Stuff you can configure for a 'Session... | # LANGUAGE CPP #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
module Language.LSP.Test.Session
( Session(..)
, SessionConfig(..)
, defaultConfig
, SessionMessage(..)
, SessionContext(..)
, SessionState... |
27fa25e3d7996724677fc99c217dc0054b602fd43f00effe4e3a7ac6c79c6ea4 | janestreet/bonsai | elements.ml | open! Core
module Private_view = View
open! Bonsai_web
open Bonsai.Let_syntax
module Extendy = Bonsai_web_ui_extendy
module Selectable_style = Vdom_input_widgets.Selectable_style
module View = Private_view
module type Stringable_model = sig
type t
include Bonsai.Model with type t := t
include Stringable with ty... | null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/web_ui/form/src/elements.ml | ocaml | try to get the actual state of the checkbox, but if
that doesn't work, assume that clicking on the
element toggled the state.
Most of this css is from
We can't just use the default Stringable interface provided by Float, so we
overwrite it with a custom one. For more... | open! Core
module Private_view = View
open! Bonsai_web
open Bonsai.Let_syntax
module Extendy = Bonsai_web_ui_extendy
module Selectable_style = Vdom_input_widgets.Selectable_style
module View = Private_view
module type Stringable_model = sig
type t
include Bonsai.Model with type t := t
include Stringable with ty... |
8d5494008fe7697b5c6e3e98d9b6a2fa43604bbe48138b4a89fd7d264b008147 | linyinfeng/myml | Parser.hs | # LANGUAGE LambdaCase #
module Myml.Parser
( parseTerm,
parseTermAtom,
letBindingPair,
parseType,
parseTypeAtom,
parseTypeRow,
parseScheme,
parseSchemeAtom,
parseKind,
parseKindAtom,
)
where
import Control.Applicative
import qualified Data.Map as Map
import Myml.Parser.Common
i... | null | https://raw.githubusercontent.com/linyinfeng/myml/1220a1474784eebce9ff95f46a3ff0a5f756e9a7/src/Myml/Parser.hs | haskell | # LANGUAGE LambdaCase #
module Myml.Parser
( parseTerm,
parseTermAtom,
letBindingPair,
parseType,
parseTypeAtom,
parseTypeRow,
parseScheme,
parseSchemeAtom,
parseKind,
parseKindAtom,
)
where
import Control.Applicative
import qualified Data.Map as Map
import Myml.Parser.Common
i... | |
e916d1683970882958a207e63a0da5cc98e04cb3c900dd12a6bee5dfa8ac575e | flipstone/haskell-for-beginners | 1_functors_redux.hs | -- For all the problems here, try to write
the type signature first to understand
-- the problem. If you can't figure it out,
-- use GHCI to help you.
--
-- Use IO as a Functor to define an IO action
that reads a line from stdin as an Int
--
getIntLine :: IO Int
getIntLine = fmap read getLine
-- Define a functio... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_11/1_functors_redux.hs | haskell | For all the problems here, try to write
the problem. If you can't figure it out,
use GHCI to help you.
Use IO as a Functor to define an IO action
Define a function that will read an Int
from a String within any Functor, not
just IO. You are 'lifting' the read
function into the Functor.
uses readIntF
Defin... | the type signature first to understand
that reads a line from stdin as an Int
getIntLine :: IO Int
getIntLine = fmap read getLine
readIntF :: Functor f => f String -> f Int
readIntF = fmap read
Define a new version of getIntLine that
getIntLine' :: IO Int
getIntLine' = readIntF getLine
Functors .
readDou... |
bfbc35428d53bffdc1ef17a734394f54919641c9cebefa18618b0f6f54f96299 | tek/ribosome | Filters.hs | module Ribosome.Menu.Filters where
import Control.Lens.Regex.Text (Regex, match, regexing)
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Text as Text
import Text.FuzzyFind (Alignment (Alignment), bestMatch)
import qualified Ribosome.Menu.Data.Entry as Entry
import Ribosome.Menu.Data.Entry (Entri... | null | https://raw.githubusercontent.com/tek/ribosome/ec3dd63ad47322e7fec66043dd7e6ade2f547ac1/packages/menu/lib/Ribosome/Menu/Filters.hs | haskell | |If the query is empty, score shorter strings higher. | module Ribosome.Menu.Filters where
import Control.Lens.Regex.Text (Regex, match, regexing)
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Text as Text
import Text.FuzzyFind (Alignment (Alignment), bestMatch)
import qualified Ribosome.Menu.Data.Entry as Entry
import Ribosome.Menu.Data.Entry (Entri... |
8bd3bf2df7b393c39dc56f55370a671377e803af3c36b8d71cb7ab0f3f34c821 | LightTable/LightTable | version.cljs | (ns lt.objs.version
"Provide LT version command"
(:require [lt.object :as object]
[lt.objs.sidebar.command :as cmd]
[lt.objs.opener :as opener]
[lt.objs.editor.pool :as pool]
[lt.objs.editor :as editor]
[lt.objs.files :as files]
[lt.objs.tabs :... | null | https://raw.githubusercontent.com/LightTable/LightTable/3760844132a17fb0c9cf3f3b099905865aed7e3b/src/lt/objs/version.cljs | clojure | (ns lt.objs.version
"Provide LT version command"
(:require [lt.object :as object]
[lt.objs.sidebar.command :as cmd]
[lt.objs.opener :as opener]
[lt.objs.editor.pool :as pool]
[lt.objs.editor :as editor]
[lt.objs.files :as files]
[lt.objs.tabs :... | |
bf28c99c613c1043aed71cd6442e7a85e9a48614b4060e733774b01543f767d4 | tgass/macbeth | Configuration.hs | module Macbeth.Wx.Configuration (
wxConfiguration
) where
import Control.Lens hiding (set)
import Control.Monad.Cont
import Control.Concurrent.Chan
import Control.Monad.Except
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromMaybe)
import qualified... | null | https://raw.githubusercontent.com/tgass/macbeth/c64b3cc9b641444688b14a2838ee554932f0e9e6/macbeth-wx/src/Macbeth/Wx/Configuration.hs | haskell | module Macbeth.Wx.Configuration (
wxConfiguration
) where
import Control.Lens hiding (set)
import Control.Monad.Cont
import Control.Concurrent.Chan
import Control.Monad.Except
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (fromMaybe)
import qualified... | |
5bea3d3181fd410dcd63a6e208c6a0cfe139d1b6f38f949c3bcf2f194760fb13 | mbj/stratosphere | RegexPatternSet.hs | module Stratosphere.WAFv2.RegexPatternSet (
RegexPatternSet(..), mkRegexPatternSet
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data RegexPatt... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/RegexPatternSet.hs | haskell | module Stratosphere.WAFv2.RegexPatternSet (
RegexPatternSet(..), mkRegexPatternSet
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data RegexPatt... | |
c84f7d59d2f8be9bd8570a6c5819856c791b77b3e8a177648cfd60bdcd11a833 | mark-watson/Clojure-AI-Book-Code | kgn_test.clj | (ns knowledge-graph-navigator-clj.kgn-test
(:require [clojure.test :as test]
[knowledge-graph-navigator-clj.kgn :as kgn])
(:require [knowledge-graph-navigator-clj.relationships :as enitites])
(:require [clojure.pprint :as pp]))
(test/deftest get-relations-test
(test/testing "test dbpedia-get-rel... | null | https://raw.githubusercontent.com/mark-watson/Clojure-AI-Book-Code/c68c71f671fc2bf75d95616348a9e04303d0da75/knowledge_graph_navigator/test/knowledge_graph_navigator_clj/kgn_test.clj | clojure | (ns knowledge-graph-navigator-clj.kgn-test
(:require [clojure.test :as test]
[knowledge-graph-navigator-clj.kgn :as kgn])
(:require [knowledge-graph-navigator-clj.relationships :as enitites])
(:require [clojure.pprint :as pp]))
(test/deftest get-relations-test
(test/testing "test dbpedia-get-rel... | |
6f4a0ba7fc5aaf4e9cdb6afaffce692b6c30e764e3a3c14ea410d3e49c0c2d76 | kbaba1001/todo | articles.clj | (ns todo.handler.articles
(:require [ataraxy.response :as response]
[integrant.core :as ig]
[buddy.auth :as buddy]
[todo.boundary.articles :as articles]))
(defmethod ig/init-key ::index [_ {:keys [db]}]
(fn [request]
(let [articles (articles/index-articles db)]
[::resp... | null | https://raw.githubusercontent.com/kbaba1001/todo/bf48c99a97ece1726bdd4b2e2ce0e53ae9e93a31/src/todo/handler/articles.clj | clojure | (ns todo.handler.articles
(:require [ataraxy.response :as response]
[integrant.core :as ig]
[buddy.auth :as buddy]
[todo.boundary.articles :as articles]))
(defmethod ig/init-key ::index [_ {:keys [db]}]
(fn [request]
(let [articles (articles/index-articles db)]
[::resp... | |
044de4c714f2f4b182e862ee00294ac8a8888a6bb2af4bda6f64e2a7e1d3d3c2 | brendanhay/amazonka | CreateSamplingRule.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused -... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-xray/gen/Amazonka/XRay/CreateSamplingRule.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Creates a rule to control sampling behavior for instrumented
applications. Services retrieve rules with
< GetSamplingRules>,
and evaluate each rule in ascending order of /priority/ for each
request. If a rule matches, the serv... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
De... |
b343d26bf5ae1aa974214b8e0145dfce84042a7c5bc285f80e97072feffdf1c3 | scarvalhojr/haskellbook | section5.8.hs | # LANGUAGE NoMonomorphismRestriction #
example1 = (* 9) 6
example2 = head [(0, "dodge"), (1, "kitteh")]
example3 = head [(0 :: Integer, "dodge"), (1, "kitteh")]
example4 = if False then True else False
example5 = length [1, 2, 3, 4, 5]
example6 = (length [1, 2, 3, 4]) > (length "TACOCAT")
| null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter5/section5.8.hs | haskell | # LANGUAGE NoMonomorphismRestriction #
example1 = (* 9) 6
example2 = head [(0, "dodge"), (1, "kitteh")]
example3 = head [(0 :: Integer, "dodge"), (1, "kitteh")]
example4 = if False then True else False
example5 = length [1, 2, 3, 4, 5]
example6 = (length [1, 2, 3, 4]) > (length "TACOCAT")
| |
32e20cdedf0819a3b353e31d8b778ab7aa34638aa0801b993af9daa198f749a7 | wargrey/graphics | color.rkt | #lang typed/racket/base
(provide (all-defined-out))
(require bitmap/base)
(require racket/format)
(require racket/list)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define label-font (desc-font #:family 'monospace #:size 'large))
;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/wargrey/graphics/3b46bc26f00145a2488c9adbc06deb7fbec98fb1/bitmap/tamer/bridge/color.rkt | racket | #lang typed/racket/base
(provide (all-defined-out))
(require bitmap/base)
(require racket/format)
(require racket/list)
(define label-font (desc-font #:family 'monospace #:size 'large))
(define named-color-list : (-> Bitmap)
(lambda []
(define all-names (sort (list-color-names) symbol<?))
(define-val... | |
e28a16206ef7a25e7bafd450bfb8a6a513965ce30f82f814d23b2e20c5deccd2 | danoctavian/bit-smuggler | Utils.hs | {-# LANGUAGE TypeSynonymInstances, ScopedTypeVariables #-}
# LANGUAGE FlexibleInstances , UndecidableInstances #
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RankNTypes #-}
module Network.BitSmuggler.Utils (
localhost
, milli
, getRemaining
, eitherToMaybe
, fromRight
, try'
, catchAny
, if'
,... | null | https://raw.githubusercontent.com/danoctavian/bit-smuggler/4385ed67f1fec4ed441832fc9a119de632b796aa/BitSmuggler/src/Network/BitSmuggler/Utils.hs | haskell | # LANGUAGE TypeSynonymInstances, ScopedTypeVariables #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE RankNTypes #
bitsmuggler logger
exceptions
TODO: move this to a more appropriate place
constants
just because i made the infohash a word160...
i got this ugly thing
CEREAL
given a type that has a Binary instance
... | # LANGUAGE FlexibleInstances , UndecidableInstances #
module Network.BitSmuggler.Utils (
localhost
, milli
, getRemaining
, eitherToMaybe
, fromRight
, try'
, catchAny
, if'
, sourceTQueue
, sinkTQueue
, conduitBytes
, alwaysRetry
, allocAsync
, allocLinkedAsync
, AsyncRes
, portNumF... |
82668037afa21517eaa6f2d74e861e73b3ee41b24dd1c9368ad7b091e25f1291 | quek/paiprolog | prologc1.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prologc1.lisp : Version 1 of the prolog compiler ,
including the destructive unification routines from Chapter 11 .
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding ... | null | https://raw.githubusercontent.com/quek/paiprolog/012d6bb255d8af7f1c8b1d061dcd8a474fb3b57a/prologc1.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
Compile the clauses with this arity
Compile all the clauses with any other arity
Note NAME is the raw name, not the name/arity | Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prologc1.lisp : Version 1 of the prolog compiler ,
including the destructive unification routines from Chapter 11 .
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding unbound))
(defun bound-p (var) (not (eq (var... |
5dd9450929a69e3910730d7266da919c0468e9c87674150eba8926d457a511be | TrustInSoft/tis-interpreter | cil_const.mli | Modified by TrustInSoft
(****************************************************************************)
(* *)
Copyright ( C ) 2001 - 2003
< >
(* Scott M... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/ast_queries/cil_const.mli | ocaml | **************************************************************************
Scott McPeak <>
All rights reserved.
... | Modified by TrustInSoft
Copyright ( C ) 2001 - 2003
< >
< >
< >
1 . Redistributions of source code must retain the above copyright ... |
8f18d48fb192ae6e701f078b67c6ffa7c3ce27f690e2ef3e027944958a440343 | riak-haskell-client/riak-haskell-client | Functions.hs | -- |
-- Module: Network.Riak.Functions
Copyright : ( c ) 2011 MailRank , Inc.
License : Apache
Maintainer : < > , < > , < >
-- Stability: experimental
-- Portability: portable
--
-- Useful functions.
module Network.Riak.Functions
(
strict
, lazy
) where
import qualifi... | null | https://raw.githubusercontent.com/riak-haskell-client/riak-haskell-client/a1eafc4c16b85a98b2d29e306165f4d93819609f/riak/src/Network/Riak/Functions.hs | haskell | |
Module: Network.Riak.Functions
Stability: experimental
Portability: portable
Useful functions. | Copyright : ( c ) 2011 MailRank , Inc.
License : Apache
Maintainer : < > , < > , < >
module Network.Riak.Functions
(
strict
, lazy
) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Lazy.Internal as L
st... |
bbe75a0e0d9f59428a26b709e108a6ec8924a77f86801bad9cc864ffba018030 | ahushh/monaba | Hellban.hs | module Handler.Admin.Hellban where
import Import
import qualified Data.Text as T
import Handler.Admin.Modlog (addModlogEntry)
import Utils.YobaMarkup (makeExternalRef)
-------------------------------------------------------------------------------------------------------------
getHel... | null | https://raw.githubusercontent.com/ahushh/monaba/9fbfffcc970da0ebaf2d5df716c3bb075b1c761a/monaba/src/Handler/Admin/Hellban.hs | haskell | -----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------... | module Handler.Admin.Hellban where
import Import
import qualified Data.Text as T
import Handler.Admin.Modlog (addModlogEntry)
import Utils.YobaMarkup (makeExternalRef)
getHellBanNoPageR :: Handler Html
getHellBanNoPageR = getHellBanR 0
getHellBanR :: Int -> Handler Html
getHellBanR ... |
ef7a33b6424f3ae1fde700af658014b05ad0e5766b3ff2c1efbe00526cf205bf | deobald/jok | db.clj | (ns jukebox-web.models.db
(:import [java.util UUID]
[java.io File])
(:require [fleetdb.embedded :as fleetdb])
(:use [clojure.contrib.string :only [as-str]]))
(def *db*)
(defn- open-db [file]
(if (.exists (File. file))
(fleetdb/load-persistent file)
(fleetdb/init-persistent file)))
(defn co... | null | https://raw.githubusercontent.com/deobald/jok/e1b9373603ad7fcc3dbc7304cb8b88b8163e73bc/src/jukebox_web/models/db.clj | clojure | (ns jukebox-web.models.db
(:import [java.util UUID]
[java.io File])
(:require [fleetdb.embedded :as fleetdb])
(:use [clojure.contrib.string :only [as-str]]))
(def *db*)
(defn- open-db [file]
(if (.exists (File. file))
(fleetdb/load-persistent file)
(fleetdb/init-persistent file)))
(defn co... | |
df1542378438f879dd14f86093401f8c2fd9bc6b21cee2e54a9d31449bc4d50b | static-analysis-engineering/codehawk | cHStringIndexTable.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Analyzer Infrastructure Utilities
Author : ------------------------------------------------------------------------------
The MIT License... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/418c95f77e6ece464df2ade519f27d95aa0119d6/CodeHawk/CH/chutil/cHStringIndexTable.mli | ocaml | chutil | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Analyzer Infrastructure Utilities
Author : ------------------------------------------------------------------------------
The MIT License... |
96de731864e1196e23bd45f42fbf9859f6624edaa9b964fdcfc7abf6b94eb2c9 | sonowz/advent-of-code-haskell | Day16.hs | module Y2021.Day16 where
import Lib.IO
import Lib.Types
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.Foldable1
import Relude.Extra.Map
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import qualified Relude.Unsafe as Unsafe
import Text.Parsec.Combinator
import Text.Parsec.Pos (SourcePos, incSo... | null | https://raw.githubusercontent.com/sonowz/advent-of-code-haskell/cab72324d8e0979093a8ad7e4c384149b89e3905/src/Y2021/Day16.hs | haskell | ---------------------
Type declarations --
---------------------
This solution uses 'parsec' library
in order to parse 'BinStream' (= '[Binary]') type into 'Packet' type
This also shows number as integer
----------
Part 1 --
----------
Primitive parsers --
Composite parsers --
Not aligned packet
----------
---... | module Y2021.Day16 where
import Lib.IO
import Lib.Types
import Relude
import Relude.Extra.Bifunctor
import Relude.Extra.Foldable1
import Relude.Extra.Map
import Relude.Extra.Newtype
import Relude.Extra.Tuple
import qualified Relude.Unsafe as Unsafe
import Text.Parsec.Combinator
import Text.Parsec.Pos (SourcePos, incSo... |
733b36917279a31395d6e519edfcbdf8faeb22f1a90a60d2ce98507e0c9b8e4e | irastypain/sicp-on-language-racket | exercise_2_19.rkt | #lang racket
(require "../lib/lists.rkt")
Процедура размена суммы денег ,
использующая
(define (cc amount coin-values)
(cond ((= amount 0) 1)
((or (< amount 0) (no-more? coin-values)) 0)
(else
(+ (cc amount
(except-first-denomination coin-values))
(cc (- a... | null | https://raw.githubusercontent.com/irastypain/sicp-on-language-racket/0052f91d3c2432a00e7e15310f416cb77eeb4c9c/src/chapter02/exercise_2_19.rkt | racket | #lang racket
(require "../lib/lists.rkt")
Процедура размена суммы денег ,
использующая
(define (cc amount coin-values)
(cond ((= amount 0) 1)
((or (< amount 0) (no-more? coin-values)) 0)
(else
(+ (cc amount
(except-first-denomination coin-values))
(cc (- a... | |
deab0e6558de5bdec99c23a770854bb7d0b55079a0406ea31789de718b4c3945 | juxt-site/site | conditional.clj | Copyright © 2021 , JUXT LTD .
(ns juxt.site.conditional
(:require
[clojure.tools.logging :as log]
[juxt.reap.alpha.decoders :as reap]
[juxt.reap.alpha.rfc7231 :as-alias rfc7231]
[juxt.reap.alpha.rfc7232 :as rfc7232]))
(defn evaluate-if-match!
"Evaluate an If-None-Match precondition header field in t... | null | https://raw.githubusercontent.com/juxt-site/site/c96ae41b02688f231e3fbadb76e42d3d64e94565/src/juxt/site/conditional.clj | clojure | unless otherwise stated).
"If the field-value is '*' …"
"… the condition is false if the origin server does not have a current
representation for the target resource."
"An origin server MUST use the strong comparison function
when comparing entity-tags"
TODO: See Section 4.1, RFC 7232:
unless otherwise stated)... | Copyright © 2021 , JUXT LTD .
(ns juxt.site.conditional
(:require
[clojure.tools.logging :as log]
[juxt.reap.alpha.decoders :as reap]
[juxt.reap.alpha.rfc7231 :as-alias rfc7231]
[juxt.reap.alpha.rfc7232 :as rfc7232]))
(defn evaluate-if-match!
"Evaluate an If-None-Match precondition header field in t... |
db7cbd2756e2d94084af5df315aeb7f9359f4db625120ef0ae0c2c8f1fadb2ce | 8c6794b6/guile-tjit | t-toplevel-box-03.scm | ;; Redefining top-level procedure, more than twice. Test for replacing
the first bailout code in side trace . Failing guard tests whether the
;; IP of callee procedure passed at runtime matches with the one used
;; at compilation time.
(define *result* '())
(define *num-loops* 1000)
(define (add-result! r)
(set! ... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/t-toplevel-box-03.scm | scheme | Redefining top-level procedure, more than twice. Test for replacing
IP of callee procedure passed at runtime matches with the one used
at compilation time. | the first bailout code in side trace . Failing guard tests whether the
(define *result* '())
(define *num-loops* 1000)
(define (add-result! r)
(set! *result* (cons r *result*)))
(define (f a)
(+ a 1))
(define (loop n)
(let lp ((n n) (acc 0))
(if (= 0 n)
acc
(lp (- n 1) (f acc)))))
(add-... |
b5ba2328049a99d839e071498c9706f2bf63c767528e43192f768a427b901f07 | dmiller/clr.core.async | channels.clj | Copyright ( c ) and contributors . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are a... | null | https://raw.githubusercontent.com/dmiller/clr.core.async/bb861242531cdd6ba727283bf3ddee73db1e1c2d/src/clojure/clojure/core/async/impl/channels.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not re... | Copyright ( c ) and contributors . All rights reserved .
Ported to by
(ns ^{:skip-wiki true}
clojure.core.async.impl.channels
(:require [clojure.core.async.impl.protocols :as impl]
[clojure.core.async.impl.dispatch :as dispatch]
[clojure.core.async.impl.mutex :as mutex])
... |
43ce074ad325c84be13427d5809af95316f9b8e219f41f71155b712afb97d38a | mransan/raft-udp | raft_srv_storage.mli | (** Persistent Storage for the RAFT protocol *)
(** {2 Types} *)
type t
(** Handle to be maintain by client application. *)
* { 2 Creators }
val make : Raft_com_conf.t -> int -> t Lwt.t
(** [make configuration] initialize the disk based storage. *)
* { 2 Log Storage }
val add_logs :
Raft_log.log_entry list... | null | https://raw.githubusercontent.com/mransan/raft-udp/ffa307fa6d8bdaa3133f3cc66149ac7dfda5fc7c/src/srv/raft_srv_storage.mli | ocaml | * Persistent Storage for the RAFT protocol
* {2 Types}
* Handle to be maintain by client application.
* [make configuration] initialize the disk based storage.
* [set_committed log_entries storage] udpates the permanent records of
the logs to be committed.
* [delete_logs log_entries storage] deletes the give... |
type t
* { 2 Creators }
val make : Raft_com_conf.t -> int -> t Lwt.t
* { 2 Log Storage }
val add_logs :
Raft_log.log_entry list ->
t ->
unit Lwt.t
* [ add_logs log_entries storage ] permanently records the [ log_entries ] .
val set_committed :
Raft_log.log_entry list ->
t ->
unit Lwt.t
val d... |
d041c66fd3983c58b2762de469e2bfa353a3275b29f54619887c85370f540065 | jesperes/aoc_erlang | aoc2016_day15.erl | -module(aoc2016_day15).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2016,
day = 15,
name = "Timing Is Everything",
e... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2016/aoc2016_day15.erl | erlang | -module(aoc2016_day15).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2016,
day = 15,
name = "Timing Is Everything",
e... | |
65887cf0372eba136b3b5eda1c62775086a90c0a9c8091f806e03ac70ab163d9 | goldfirere/units | Misc.hs | # LANGUAGE TemplateHaskell , TypeFamilies , TypeOperators #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Units.US.Misc
Copyright : ( C ) 2013
-- License : BSD-style (see LICENSE)
Maintainer : ( )
-- Stability : experimental
-- Porta... | null | https://raw.githubusercontent.com/goldfirere/units/4941c3b4325783ad3c5b6486231f395279d8511e/units-defs/Data/Units/US/Misc.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Units.US.Misc
License : BSD-style (see LICENSE)
Stability : experimental
Portability : non-portable
other categories.
Included are all units mentioned here:
<>
Where possible, conversion rates have been... | # LANGUAGE TemplateHaskell , TypeFamilies , TypeOperators #
Copyright : ( C ) 2013
Maintainer : ( )
This module defines American customary units that do n't fit into
at a US government website . However , Wikipedia 's base is /much/
The US government references used are as follows :
module Dat... |
89cf5b5b2da4f66eeadd2b3731c6e1567842c8a956c9a8cf74e7632f87872d89 | macourtney/Conjure | test_server.clj | (ns conjure.script.test-server
(:use clojure.test
conjure.script.server))
| null | https://raw.githubusercontent.com/macourtney/Conjure/1d6cb22d321ea75af3a6abe2a5bc140ad36e20d1/conjure_server/test/conjure/script/test_server.clj | clojure | (ns conjure.script.test-server
(:use clojure.test
conjure.script.server))
| |
ce8dd97897a89783fe0ac77424dfba91a9f203726f5bb1d4584f447a16ede8cb | nasser/magic | vars.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/nasser/magic/7a46f773bc7785c82d9527d52c1a8c28ac16e195/tests/clojure/test_clojure/vars.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author : ,
(ns clojure.test-clojure.vars
(:use clojure.test))
defn defn- defonce
(def ^:dynamic a)
(deftest test-binding
(are [x y] (= x y)
regression in Clojure SVN r1370
))
(deftest test-with-local-vars
(let [factorial (fn [x]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.