_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 |
|---|---|---|---|---|---|---|---|---|
51e90fbe05dc4af3e4dc2330ac1650cc912bf18446e8dd3473d04192e9b94f02 | ucsd-progsys/liquidhaskell | T1642.hs | {-@ LIQUID "--reflection" @-}
# LANGUAGE GADTs #
# LANGUAGE KindSignatures #
module T1642 where
data A :: * -> * where
A :: Eq a => a -> () -> A a
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/pos/T1642.hs | haskell | @ LIQUID "--reflection" @ | # LANGUAGE GADTs #
# LANGUAGE KindSignatures #
module T1642 where
data A :: * -> * where
A :: Eq a => a -> () -> A a
|
0f07a9928678fe1d1995d472688ba3816c7456fb0ff72ece45740957432d2038 | CryptoKami/cryptokami-core | Mockable.hs | module Mockable
( module M
) where
import Mockable.Channel as M
import Mockable.Class as M
import Mockable.Concurrent as M
import Mockable.CurrentTime as M
import Mockable.Instances as M
import Mockable.Metrics as M
import Mockable.Mon... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/networking/src/Mockable.hs | haskell | module Mockable
( module M
) where
import Mockable.Channel as M
import Mockable.Class as M
import Mockable.Concurrent as M
import Mockable.CurrentTime as M
import Mockable.Instances as M
import Mockable.Metrics as M
import Mockable.Mon... | |
a56738f39ed64261a5bf9d272504d9c56c7cd889311afa7a02227ec614c48e51 | informatimago/lisp | dependency-cycles.lisp | -*- mode : lisp;coding : utf-8 -*-
;;;;**************************************************************************
FILE : dependency-cycles.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
USER - INTERFACE :
;;;;DESCRIPTION
;;;;
;;;; XXX
;;;;
< PJB > < >
MO... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/tools/dependency-cycles.lisp | lisp | coding : utf-8 -*-
**************************************************************************
LANGUAGE: Common-Lisp
SYSTEM: Common-Lisp
DESCRIPTION
XXX
LEGAL
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program i... | FILE : dependency-cycles.lisp
USER - INTERFACE :
< PJB > < >
MODIFICATIONS
2018 - 08 - 18 < PJB > Corrected find - cycles , corrected export list .
2013 - 09 - 06 < PJB > Updated for publication .
2012 - 04 - 06 < PJB > Created .
AGPL3
Copyright 2012 - 2018
... |
5a051227439a267b9c61a255fbf514ac6d599a4168d8cd86480bf6b0692379e3 | unsplash/intlc | Language.hs | module Intlc.Backend.TypeScript.Language where
import Data.Functor.Foldable (cata)
import Data.List.NonEmpty (nub)
import qualified Data.Map as M
import qualified Intlc.ICU as ICU
import Prelude
-- | A representation of the type-level output we will be compili... | null | https://raw.githubusercontent.com/unsplash/intlc/cde1ada3fc472953bd484e9a668a8bb906c2e982/lib/Intlc/Backend/TypeScript/Language.hs | haskell | | A representation of the type-level output we will be compiling. It's a
little verbose split into these various sum types, but in doing so it's
correct by construction.
An endomorphism on `Out`. Omitted as an argument to enforce that it's the
same type as the output of the top-level `Lambda`.
Collate arguments w... | module Intlc.Backend.TypeScript.Language where
import Data.Functor.Foldable (cata)
import Data.List.NonEmpty (nub)
import qualified Data.Map as M
import qualified Intlc.ICU as ICU
import Prelude
data TypeOf = Lambda Args Out
deriving (Show, Eq)
type Uncolla... |
5fca93f2f29e0730ec513a262e80bc99e4ef03b82d01d84f9b06321922dd8929 | tweag/capability | Common.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MagicHash #
# LANGUAGE MultiPa... | null | https://raw.githubusercontent.com/tweag/capability/65271a22ff9c173579f889dc033231f80453b185/src/Capability/State/Internal/Strategies/Common.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE TypeInType #
# OPTIONS_HADDOCK hide #
| Derive 'HasState' from @m@'s
| Derive a state monad from a reader over an 'Data.IORef.IORef'.
Example:
See 'ReaderRef' for a more generic strategy.
| Derive a state monad from a reader over a mutable reference.
... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE MagicHash #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuantifiedConstraints #
# LA... |
6c1924c555f4f02b4f3ab1af62e596ce61d076d691c430364eda2c8610a92939 | broadinstitute/firecloud-ui | tab.cljs | (ns broadfcui.page.workspace.summary.tab
(:require
[dmohs.react :as react]
[clojure.string :as string]
[broadfcui.common :as common]
[broadfcui.common.components :as comps]
[broadfcui.common.icons :as icons]
[broadfcui.common.links :as links]
[broadfcui.common.markdown :refer [MarkdownView Markdo... | null | https://raw.githubusercontent.com/broadinstitute/firecloud-ui/8eb077bc137ead105db5665a8fa47a7523145633/src/cljs/main/broadfcui/page/workspace/summary/tab.cljs | clojure | sidebar takes care of checking for billing loaded, library schema, and curator
status, as it's the part that cares about it
no title | (ns broadfcui.page.workspace.summary.tab
(:require
[dmohs.react :as react]
[clojure.string :as string]
[broadfcui.common :as common]
[broadfcui.common.components :as comps]
[broadfcui.common.icons :as icons]
[broadfcui.common.links :as links]
[broadfcui.common.markdown :refer [MarkdownView Markdo... |
b36e0afb9cb170e2cb300306420c97d94dce6a11acb03f4633dc69f817d31135 | charlieg/Sparser | development-log.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
Copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved
$ Id:$
;;---------- This is a dribble file of examples -- Do not load ------------
;;;------------
;;; crib sheet
;;;------------
;;;-------------------
;;; Dribbled examples
... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/development-log.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
---------- This is a dribble file of examples -- Do not load ------------
------------
crib sheet
------------
-------------------
Dribbled examples
-------------------
------------------------------------------------------------
Finding the data ... | Copyright ( c ) 2009 BBNT Solutions LLC . All Rights Reserved
$ Id:$
6/7/08
"many of the ..."
How do we tell if "many" is defined already?
SPARSER> (p "many")
many
SOURCE-START
e0 "many"
END-OF-SOURCE
:DONE-... |
cc36a8a4b209cae7428fdda8e3500712747cb5b756b2b2c80b4d382b2bfb4ee6 | carotene/carotene | rabbitmq_exchange_sup.erl | -module(rabbitmq_exchange_sup).
-behaviour(supervisor).
%% API
-export([start_link/1]).
%% Supervisor callbacks
-export([init/1]).
%% ===================================================================
%% API functions
%% ===================================================================
start_link(Channel) ->
... | null | https://raw.githubusercontent.com/carotene/carotene/963ecad344ec1c318c173ad828a5af3c000ddbfc/src/rabbitmq_exchange_sup.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
================================================... | -module(rabbitmq_exchange_sup).
-behaviour(supervisor).
-export([start_link/1]).
-export([init/1]).
start_link(Channel) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [Channel]).
init([Channel]) ->
{ok, { {simple_one_for_one, 5, 10}, [
{rabbitmq_exchange,
{rabbitmq_exchang... |
659410b285bd73c195b7f0f6bb9bdbe50140d9e740b7c6c4991644087e41e896 | wireless-net/erlang-nommu | wxGraphicsFont.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxGraphicsFont.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
< br />{@link wxGraphicsObject }
-modul... |
05518c27b2b9f45a694b15211045a21bc32fde4bc9513a271d09a6e88ec2aede | fishcakez/sbroker | srand.erl | %%-------------------------------------------------------------------
%%
Copyright ( c ) 2016 , < >
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% -2.0
... | null | https://raw.githubusercontent.com/fishcakez/sbroker/10f7e3970d0a296fbf08b1d1a94c88979a7deb5e/src/srand.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the Lic... | Copyright ( c ) 2016 , < >
This file is provided to you under the Apache License ,
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
on choosing a random process . It is designed for use with OTP behaviour
messaging using ` via ' names ,... |
75c53ac4c0f8b798574d2b0836e43be5b91deee562863af9e6bed1697f4772eb | Clozure/ccl | ppc-trap-support.lisp | ;;;
Copyright 1994 - 2009 Clozure Associates
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable law or agreed to in writing, ... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-1/ppc-trap-support.lisp | lisp |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing pe... | Copyright 1994 - 2009 Clozure Associates
distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
(eval-when (:compile-toplevel :execute)
(require "NUMBER-MACROS")
(defparameter *ppc-instruction-fields*
`((:opcode . ,(byte 6 26))
(:rt . ,(byte 5 21))
(:to . ... |
f977faeb19ba97a53d599dafd34afaf327e860fcecf3ecb97a6fe39e052a2867 | draperlaboratory/cbat_tools | output.ml | (***************************************************************************)
(* *)
Copyright ( C ) 2018/2019 The Charles Stark Draper Laboratory , Inc.
(* *)
(* This... | null | https://raw.githubusercontent.com/draperlaboratory/cbat_tools/8e6ab1cd6d5d97179989d86ecac8507fbb60d7e1/wp/lib/bap_wp/src/output.ml | ocaml | *************************************************************************
This file is provided under the license found in the LICENSE file in
the top-level director... | Copyright ( C ) 2018/2019 The Charles Stark Draper Laboratory , Inc.
This work is funded in part by ONR / NAWC Contract N6833518C0107 . Its
content does not necessarily reflect the position or policy of the US
open !Core
open Bap.Std
open Bap_core_theory
include Self()
module Expr = Z3.Expr
mod... |
f0d61946843fafb82083502803d6b954f4868dbcfcbf388db399b59b54a16c62 | jxv/dino-rush | Quake.hs | module DinoRush.Effect.Quake where
import Control.Lens
import Control.Monad.State (MonadState(..), modify, gets)
import DinoRush.Effect.Sfx
import DinoRush.Engine.Common
import DinoRush.Engine.Quake
import DinoRush.Engine.Step
import DinoRush.Engine.Sfx
updateQuake :: (AudioSfx m, MonadState s m, HasCommonVars s) =>... | null | https://raw.githubusercontent.com/jxv/dino-rush/f888bc05fe734ced2c49bec81f9c804b47c81069/library/DinoRush/Effect/Quake.hs | haskell | module DinoRush.Effect.Quake where
import Control.Lens
import Control.Monad.State (MonadState(..), modify, gets)
import DinoRush.Effect.Sfx
import DinoRush.Engine.Common
import DinoRush.Engine.Quake
import DinoRush.Engine.Step
import DinoRush.Engine.Sfx
updateQuake :: (AudioSfx m, MonadState s m, HasCommonVars s) =>... | |
dbfa35fb852800958a706402c94147ee201a3249013c74c65dfd24a8a0aaed05 | leo-project/leofs | leo_manager_app.erl | %%======================================================================
%%
LeoManager
%%
Copyright ( c ) 2012 - 2017 Rakuten Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a co... | null | https://raw.githubusercontent.com/leo-project/leofs/4ff701e0f4a4cf39a968dbe078b9c2412a22f995/apps/leo_manager/src/leo_manager_app.erl | erlang | ======================================================================
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permis... | LeoManager
Copyright ( c ) 2012 - 2017 Rakuten Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(leo_manager_app).... |
39ca3151e31003c5270a8dd6580700dbef6f30a16885d572fb08e9cd39ccd912 | BekaValentine/SimpleFP-v2 | TypeChecking.hs | {-# OPTIONS -Wall #-}
-- | A unification-based type checker.
module Continuations.Unification.TypeChecking where
import Utils.ABT
import Utils.Elaborator
import Utils.Eval
import Utils.Names
import Utils.Plicity
import Utils.Pretty
import Utils.Unifier
import Utils.Telescope
import Utils.Vars
import Continuati... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Continuations/Unification/TypeChecking.hs | haskell | # OPTIONS -Wall #
| A unification-based type checker.
| In the dependently typed variant, it's useful to have a type for normal
terms. While this type won't actually be representationally different, we
can use it to help ensure we're using normal forms in places where we want
them, such as the type arguments to ch... |
module Continuations.Unification.TypeChecking where
import Utils.ABT
import Utils.Elaborator
import Utils.Eval
import Utils.Names
import Utils.Plicity
import Utils.Pretty
import Utils.Unifier
import Utils.Telescope
import Utils.Vars
import Continuations.Core.ConSig
import Continuations.Core.Evaluation ()
impor... |
fbba2499a97700380f44fd78bbc6435290fe991b3473ef7b47ae12af8bd27b61 | samply/blaze | conditional_operators_test.clj | (ns blaze.elm.compiler.conditional-operators-test
"15. Conditional Operators
Section numbers are according to
-logicalspecification.html."
(:require
[blaze.elm.compiler :as c]
[blaze.elm.compiler.test-util :as tu]
[blaze.elm.literal-spec]
[clojure.spec.test.alpha :as st]
[clojure.test :as t... | null | https://raw.githubusercontent.com/samply/blaze/f7d26bf3db0bc74b9195c59891261b1eb2c5accb/modules/cql/test/blaze/elm/compiler/conditional_operators_test.clj | clojure |
The If operator evaluates a condition, and returns the then argument if the
condition evaluates to true; if the condition evaluates to false or null, the
result of the else argument is returned. The static type of the then argument
determines the result type of the conditional, and the else argument must be
of th... | (ns blaze.elm.compiler.conditional-operators-test
"15. Conditional Operators
Section numbers are according to
-logicalspecification.html."
(:require
[blaze.elm.compiler :as c]
[blaze.elm.compiler.test-util :as tu]
[blaze.elm.literal-spec]
[clojure.spec.test.alpha :as st]
[clojure.test :as t... |
811f92b7ed2f1173b5576fd151af86d1d5605dd817521fb4ad8750380b6497b7 | HunterYIboHu/htdp2-solution | ex392-simplify-tree-pick.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex392-simplify-tree-pick) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t con... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter4/Section23-Simultaneous-Processing/ex392-simplify-tree-pick.rkt | racket | about the language level of this file in a form that our tools can easily process.
data difinitions
– Symbol
– (make-branch TOS TOS)
– 'left
– 'right
A list of Directions is also called a path.
constants
functions
TOS [List-of Direction] -> TOS
produces the corresponding result in tos by the path;
otherwise... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex392-simplify-tree-pick) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(define-struct branch [left right])
... |
d0409ab82583f6e27e9009f59bb41a04a5477c27204ffae4760298e2cb820eed | mirage/cactus | bench.ml |
* Copyright ( c ) 2021 Tarides < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SO... | null | https://raw.githubusercontent.com/mirage/cactus/3eb2a4abee79bf8f20de5b4b12a57c3421c3e2fe/bench/bench.ml | ocaml | last stable version number
use main/b.tree as reference for the tree |
* Copyright ( c ) 2021 Tarides < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SO... |
2c7ba9c10a38de121d9c565cdf9b82cdf4aaa59d36833ca811dfef0fe85d8b3b | PacktWorkshops/The-Clojure-Workshop | core.cljs | (ns packt-clj.rock-scissors-paper.core
(:require [rum.core :as rum]))
(enable-console-print!)
(println "This text is printed from src/packt-clj.rock-scissors-paper/core.cljs. Go ahead and edit it and see reloading in action.")
;; define your app data so that it doesn't get over-written on reload
(defonce app-st... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter12/Exercise12.05/packt-clj.rock-scissors-paper/src/packt_clj/rock_scissors_paper/core.cljs | clojure | define your app data so that it doesn't get over-written on reload | (ns packt-clj.rock-scissors-paper.core
(:require [rum.core :as rum]))
(enable-console-print!)
(println "This text is printed from src/packt-clj.rock-scissors-paper/core.cljs. Go ahead and edit it and see reloading in action.")
(defonce app-state (atom {:computer-choice nil
:game-state ... |
d2f657467c840be9a037d35491504e4b71f300d8a54e67c57442084d3db6fb88 | aryx/xix | blob.mli | (*s: version_control/blob.mli *)
s : type [ [ Blob.t ] ]
type t = bytes
e : type [ [ Blob.t ] ]
(*s: type [[Blob.hash]] *)
type hash = Sha1.t
(*e: type [[Blob.hash]] *)
s : signature [ [ ] ]
(* assumes have already read the 'blob <size>\000' header from unzipped input *)
val read: IO.input -> t
e : signature [ [ ]... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/version_control/blob.mli | ocaml | s: version_control/blob.mli
s: type [[Blob.hash]]
e: type [[Blob.hash]]
assumes have already read the 'blob <size>\000' header from unzipped input
s: signature [[Blob.write]]
does not write the header, does not compress
e: signature [[Blob.write]]
s: signature [[Blob.show]]
e: signature [[Blob.show]]
e: vers... |
s : type [ [ Blob.t ] ]
type t = bytes
e : type [ [ Blob.t ] ]
type hash = Sha1.t
s : signature [ [ ] ]
val read: IO.input -> t
e : signature [ [ ] ]
val write: t -> bytes IO.output -> unit
val show: t -> unit
|
d2d64b42222a9c26146bf45d1564c42fc2bcaf1e8198d72848ea713785828157 | spawnfest/eep49ers | dets_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2018 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applic... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/stdlib/test/dets_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific l... | Copyright Ericsson AB 1996 - 2018 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(dets_SUITE).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
-define(config(X,Y), foo).
-define(t, t... |
e2fe452bd2cd49caeab10878689bd2c1e1a3c9f8baa6aabee45787f5675b2196 | Frama-C/Frama-C-snapshot | transient_block.ml | open Cil_types
class vis prj = object(self)
inherit Visitor.frama_c_copy prj
val mutable my_var = None
method private create_block create s instr =
let s1 = Cil.mkStmtOneInstr ~valid_sid:true instr in
let b = Cil.mkBlock [s1] in
if create then begin
let f = Visitor_behavior.Get.fundec
... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/tests/syntax/transient_block.ml | ocaml | open Cil_types
class vis prj = object(self)
inherit Visitor.frama_c_copy prj
val mutable my_var = None
method private create_block create s instr =
let s1 = Cil.mkStmtOneInstr ~valid_sid:true instr in
let b = Cil.mkBlock [s1] in
if create then begin
let f = Visitor_behavior.Get.fundec
... | |
f3f82f97828be9c899d187db32167f920152d0a64898e2450d9cb54940578d66 | samply/blaze | output.clj | (ns blaze.rest-api.middleware.output
"JSON/XML serialization middleware."
(:require
[blaze.fhir.spec :as fhir-spec]
[clojure.data.xml :as xml]
[clojure.java.io :as io]
[jsonista.core :as j]
[muuntaja.parse :as parse]
[prometheus.alpha :as prom]
[ring.util.response :as ring]
[taoensso... | null | https://raw.githubusercontent.com/samply/blaze/948eee38021467fa343c522a644a7fd4b24b6467/modules/rest-api/src/blaze/rest_api/middleware/output.clj | clojure | (ns blaze.rest-api.middleware.output
"JSON/XML serialization middleware."
(:require
[blaze.fhir.spec :as fhir-spec]
[clojure.data.xml :as xml]
[clojure.java.io :as io]
[jsonista.core :as j]
[muuntaja.parse :as parse]
[prometheus.alpha :as prom]
[ring.util.response :as ring]
[taoensso... | |
3722f81a6911e978db155d832265d656d80d1e4a1ec35a095cb3fd8c9bc083ed | dimitaruzunov/fp-2018 | middle-digit.scm | (require rackunit rackunit/text-ui)
(define (last-digit n)
(remainder n 10))
(define (without-last-digit n)
(quotient n 10))
(define (count-digits n)
(if (< n 10)
1
(+ 1
(count-digits (without-last-digit n)))))
(define (middle-digit n)
(define (kth-digit-from-last k n)
(if (= k 0)
... | null | https://raw.githubusercontent.com/dimitaruzunov/fp-2018/f75f0cd009cc7f41ce55a5ec71fb4b8eadafc4eb/exercises/05/middle-digit.scm | scheme | (require rackunit rackunit/text-ui)
(define (last-digit n)
(remainder n 10))
(define (without-last-digit n)
(quotient n 10))
(define (count-digits n)
(if (< n 10)
1
(+ 1
(count-digits (without-last-digit n)))))
(define (middle-digit n)
(define (kth-digit-from-last k n)
(if (= k 0)
... | |
2b328bd21df83714e083f2684e783b183b5ee0f648bbcc0af29fe2717447adae | tisnik/clojure-examples | project.clj | (defproject forest-demo "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[tupelo "21.04.13"]]
:main ^:skip-aot forest-demo.core
... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/dead32eda2993d72117d7f23f17a362885b451c3/forest-demo/project.clj | clojure | (defproject forest-demo "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[tupelo "21.04.13"]]
:main ^:skip-aot forest-demo.core
... | |
5c54db36b49091c272351009d7c77db4647ac16ebd4542a4fae27605dccb0bd5 | hjcapple/reading-sicp | constraints.scm | #lang sicp
P198 - [ 3.3.5 约束的传播 ]
(#%provide make-connector adder multiplier constant probe)
(#%provide set-value! forget-value! has-value? get-value connect)
(define (adder a1 a2 sum)
(define (process-new-value)
(cond ((and (has-value? a1) (has-value? a2))
(set-value! sum
(... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_3/constraints.scm | scheme | #lang sicp
P198 - [ 3.3.5 约束的传播 ]
(#%provide make-connector adder multiplier constant probe)
(#%provide set-value! forget-value! has-value? get-value connect)
(define (adder a1 a2 sum)
(define (process-new-value)
(cond ((and (has-value? a1) (has-value? a2))
(set-value! sum
(... | |
00000c9481293dcfdb30f76ae19b9ce8fb5fe0237adbe906d606a6ad05797db9 | hasufell/hsfm | hsimport.hs | import Data.List
import qualified Language.Haskell.Exts as HS
import HsImport
main :: IO ()
main = hsimport $ defaultConfig { prettyPrint = prettyPrint
, findImportPos = findImportPos }
where
prettyPrint :: HS.ImportDecl -> String
prettyPrint (HS.ImportDecl sloc modname q... | null | https://raw.githubusercontent.com/hasufell/hsfm/322c766ae534fb21e3427d2845011123ddb90952/hacking/hsimport.hs | haskell | import Data.List
import qualified Language.Haskell.Exts as HS
import HsImport
main :: IO ()
main = hsimport $ defaultConfig { prettyPrint = prettyPrint
, findImportPos = findImportPos }
where
prettyPrint :: HS.ImportDecl -> String
prettyPrint (HS.ImportDecl sloc modname q... | |
54489dc26dad71729b9c67a67acba4d4ded56f7ca9c4648666a702f2d083a21c | YoshikuniJujo/test_haskell | Flip.hs | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Try.Flip where
import Data.List
import Data.Curry
import Data.Swizzle.TH
concat <$> swizzle `mapM` permutations "xyz"
flip13 :: (a -> b -> c -> r) -> c -> b -> a -> r
flip13 f = crr3 $ unc3 f . zyx
flip' :: (b -> c -> a -> r) -> a -> b -... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/473cea872fd73e369b790668fec9b072d570ffd7/themes/swizzle/try-swizzle/src/Try/Flip.hs | haskell | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Try.Flip where
import Data.List
import Data.Curry
import Data.Swizzle.TH
concat <$> swizzle `mapM` permutations "xyz"
flip13 :: (a -> b -> c -> r) -> c -> b -> a -> r
flip13 f = crr3 $ unc3 f . zyx
flip' :: (b -> c -> a -> r) -> a -> b -... | |
97024e28b1fe1eefe75ac79198c3e444ed85e072735bf8a8331808256ee1067b | fmi/clojure-lectures | generator_test.clj | (ns lectures.generator-test
(:use clojure.test
lectures.generator))
(deftest generator-test
(are [input expected] (= (generate input) expected)
[:code "foo"] [:code "foo"]
[:code "x < y"] [:code "x < y"]
[:bold "foo"] [:strong "foo"]
[:bold "<img>"] [:strong "<img>"]
... | null | https://raw.githubusercontent.com/fmi/clojure-lectures/e9aead137a25f3b01ba7b14d8949fe1e63b222e7/test/lectures/generator_test.clj | clojure | (ns lectures.generator-test
(:use clojure.test
lectures.generator))
(deftest generator-test
(are [input expected] (= (generate input) expected)
[:code "foo"] [:code "foo"]
[:code "x < y"] [:code "x < y"]
[:bold "foo"] [:strong "foo"]
[:bold "<img>"] [:strong "<img>"]
... | |
2fc8a267737f58997027aedffb68feb584c6e296a77dd89ae75737394ca87bf9 | ocaml-ppx/ppx_include | build.ml | #!/usr/bin/env ocaml
#directory "pkg"
#use "topkg.ml"
let ocamlbuild =
"ocamlbuild -use-ocamlfind -classic-display -plugin-tag 'package(cppo_ocamlbuild)'"
let () =
Pkg.describe "ppx_include" ~builder:(`Other (ocamlbuild, "_build")) [
Pkg.lib "pkg/META";
Pkg.bin ~auto:true "src/ppx_include" ~dst:"../lib/pp... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx_include/19a16c29b38fc2fbed23553d2ac4c5678ddd03ec/pkg/build.ml | ocaml | #!/usr/bin/env ocaml
#directory "pkg"
#use "topkg.ml"
let ocamlbuild =
"ocamlbuild -use-ocamlfind -classic-display -plugin-tag 'package(cppo_ocamlbuild)'"
let () =
Pkg.describe "ppx_include" ~builder:(`Other (ocamlbuild, "_build")) [
Pkg.lib "pkg/META";
Pkg.bin ~auto:true "src/ppx_include" ~dst:"../lib/pp... | |
88950b6228ab4efb8edd8916d5518a7314d8578c920ab3034b9979ed3187e266 | esl/MongooseIM | mongoose_graphql_stanza_admin_mutation.erl | -module(mongoose_graphql_stanza_admin_mutation).
-behaviour(mongoose_graphql).
-export([execute/4]).
-ignore_xref([execute/4]).
-include("../mongoose_graphql_types.hrl").
-import(mongoose_graphql_helper, [null_to_undefined/1, format_result/2]).
execute(_Ctx, _Obj, <<"sendMessage">>, Args) ->
send_message(Args)... | null | https://raw.githubusercontent.com/esl/MongooseIM/75c969202f87469eeb028aacc4c3151957151a8b/src/graphql/admin/mongoose_graphql_stanza_admin_mutation.erl | erlang | -module(mongoose_graphql_stanza_admin_mutation).
-behaviour(mongoose_graphql).
-export([execute/4]).
-ignore_xref([execute/4]).
-include("../mongoose_graphql_types.hrl").
-import(mongoose_graphql_helper, [null_to_undefined/1, format_result/2]).
execute(_Ctx, _Obj, <<"sendMessage">>, Args) ->
send_message(Args)... | |
28dee87f7a666af3c69371b5f9e6c8b709c2891f67e0b80b7a6c2ee84ae20ba0 | csabahruska/jhc-components | Prim.hs | # LANGUAGE UnboxedTuples , ForeignFunctionInterface , NoImplicitPrelude #
module Jhc.Prim(module Jhc.Prim.Bits, module Jhc.Prim, module Jhc.Prim.IO) where
import Jhc.Prim.Bits
import Jhc.Prim.IO
-- | this is wrapped around arbitrary expressions and just evaluates them to whnf
foreign import primitive "seq" runRaw :: ... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/lib/jhc/Jhc/Prim.hs | haskell | | this is wrapped around arbitrary expressions and just evaluates them to whnf | # LANGUAGE UnboxedTuples , ForeignFunctionInterface , NoImplicitPrelude #
module Jhc.Prim(module Jhc.Prim.Bits, module Jhc.Prim, module Jhc.Prim.IO) where
import Jhc.Prim.Bits
import Jhc.Prim.IO
foreign import primitive "seq" runRaw :: a -> World__ -> World__
foreign import primitive "unsafeCoerce" unsafeCoerce__ :: ... |
833dfa22c97db7333b9b2a055788d33b4304e87cdf306578eaeda9e24a2d66ad | static-analysis-engineering/codehawk | bCHARMConditionalExpr.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/45f39248b404eeab91ae225243d79ec0583c3331/CodeHawk/CHB/bchlibarm32/bCHARMConditionalExpr.mli | ocaml | xprlib
bchlib
bchlibarm32 | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
aa1dfa8024d9d5d20a2bf4bedf05bde5390aeeaafcacbd2ebf59a5e9257087f1 | bensu/doo | core.clj | (ns doo.core
"Runs a Js script in any Js environment. See doo.core/run-script"
(:import java.io.File)
(:require [clojure.string :as str]
[clojure.set :as set]
[clojure.java.io :as io]
[clojure.data.json :as json]
[doo.karma :as karma]
[doo.shell :as shel... | null | https://raw.githubusercontent.com/bensu/doo/157d80b63483040d7ff4546bbe64531a27d39922/library/src/doo/core.clj | clojure | ======================================================================
JS Environments
All js-envs are keywords.
======================================================================
Runners
doo createst the files necessary for the runners and cleans them up
-phantomjs-as-a-local-resource-when-using-an-executab... | (ns doo.core
"Runs a Js script in any Js environment. See doo.core/run-script"
(:import java.io.File)
(:require [clojure.string :as str]
[clojure.set :as set]
[clojure.java.io :as io]
[clojure.data.json :as json]
[doo.karma :as karma]
[doo.shell :as shel... |
40780c6f72248adf4a78559c5deb08bb2ee52b7fd5764a9aa6c48061cec17d0d | rowangithub/DOrder | traverse.mli | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2007
, and
(* ... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/external/ocamlgraph/src/traverse.mli | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2007
, and
modify it under the terms of the GNU Library General Public
License version 2 , with the special exception on linking
$ I d :... |
46652483d1333976e466b6575b8fca256665cb6877ca05e39e113ab0df09a527 | thephoeron/quipper-language | RegulatorQuantum.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE MultiParamTypeClasses #
| This modu... | null | https://raw.githubusercontent.com/thephoeron/quipper-language/15e555343a15c07b9aa97aced1ada22414f04af6/Algorithms/CL/RegulatorQuantum.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
function used in approximating the regulator. This is the function /h/ of
specified jitter parameter.
consist of the functions /f/... | This file is part of Quipper . Copyright ( C ) 2011 - 2014 . Please see the
# LANGUAGE MultiParamTypeClasses #
| This module implements the specialized quantum operations required in stages 1 and 4 of Hallgren ’s algorithm .
The key operation for stage 1 is ' q_fN ' , implementing /f/[sub /N/ ] , the quasi - pe... |
737177a00bab6f8cb9f08ed700eb6203325388cfe93e40ba172dca6439fa97c2 | dedbox/racket-algebraic | info.rkt | #lang info
(define collection 'multi)
(define scribblings '(("scribblings/algebraic.scrbl" (multi-page))))
| null | https://raw.githubusercontent.com/dedbox/racket-algebraic/706b2d01ab735a01e372c33da49995339194e024/algebraic/info.rkt | racket | #lang info
(define collection 'multi)
(define scribblings '(("scribblings/algebraic.scrbl" (multi-page))))
| |
a0febc8e76833ff928a4a05812dee1b4ebafd72335c66dabc9c2718ca58f6136 | rtoy/cmucl | vm.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Base : 10 ; Package : python - x86 -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to ... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/x86/vm.lisp | lisp | Syntax : Common - Lisp ; Base : 10 ; Package : python - x86 -*-
**********************************************************************
**********************************************************************
This file contains the VM defintion noise for the x86.
eval-when
Note: the encoding here is differe... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
If you want to use this code or any part of CMU Common Lisp , please contact
or .
(ext:file-comment
"$Header: src/compiler/x86/vm.lisp $")
Written by
by Spring / ... |
8947b7bb6f90c092bcf08bc45dbe7d377b9092da0cd2ba0b1b032de7b8024f77 | synacktiv/toy-wasm-symbexp | Expression.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Symb.Expression where
import Control.Lens (Identity (runIdentity))
import Control.Monad.List
import Data.Bits
import Data.Int
import Data.SBV
class Symb f where
inject :: SymVal a => a -> f a
(.+:) :: (Ord a, Num a, SymVal a) => f a -> f a ... | null | https://raw.githubusercontent.com/synacktiv/toy-wasm-symbexp/b458f660e79538079420434254f3f8f0af525b47/src/Symb/Expression.hs | haskell | | resolve a boolean value
| tentatively resolve an arbitrary value | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Symb.Expression where
import Control.Lens (Identity (runIdentity))
import Control.Monad.List
import Data.Bits
import Data.Int
import Data.SBV
class Symb f where
inject :: SymVal a => a -> f a
(.+:) :: (Ord a, Num a, SymVal a) => f a -> f a ... |
f328bf3bff638e20cfec3e5c5ed8449f4f7082b08c588dbef8978e7d731e4099 | jonase/reagent-tutorial | core.clj | (ns reagent-tutorial.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| null | https://raw.githubusercontent.com/jonase/reagent-tutorial/24a3720feac9cb08da10792a163ecce7703ae6b9/src/reagent_tutorial/core.clj | clojure | (ns reagent-tutorial.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| |
93cb4a911592a490a7978299b52ed17556646e44712833fdd957ad8c4a6db429 | lulf/hcoap | Internal.hs | module Network.CoAP.Internal
( createEndpoint
, createOpts
) where
import Network.DNS.Lookup
import Network.DNS.Resolver
import Data.ByteString.Char8
import Network.URI
import Data.IP
import Network.Socket
import Network.CoAP.Types
createIPv4Endpoint :: [IPv4] -> PortNumber -> Endpoint
createIPv4Endpoint (addr:_) por... | null | https://raw.githubusercontent.com/lulf/hcoap/8127520b767430b5513be6cfe646894ae7a2e616/src/Network/CoAP/Internal.hs | haskell | module Network.CoAP.Internal
( createEndpoint
, createOpts
) where
import Network.DNS.Lookup
import Network.DNS.Resolver
import Data.ByteString.Char8
import Network.URI
import Data.IP
import Network.Socket
import Network.CoAP.Types
createIPv4Endpoint :: [IPv4] -> PortNumber -> Endpoint
createIPv4Endpoint (addr:_) por... | |
0270e89e96522ca92bd1aaf69e145a3da97fd1f76d1d1c785fe6aa9c54e80ab7 | gregtatcam/imaplet-lwt | stun_maint.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/servers/stun_maint.ml | ocaml | this smtp server stun records
list of cached stun records for domains
check if 'stun' header is present
remove 'stun' header from the email headers
find message id in reply-to header
in-reply-to could have multiple message-id's TBD
parse one 'stun' record privateaddr:pubaddr:port1,port2..
parse all 'st... |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
a2756070a45aa65202d0c5c5a17faa8aaf8ca001f43d4ecc02da5b6a41bb45fe | avatar29A/hs-aitubots-api | Forms.hs | module Aitu.Bot.Forms
( module Forms
)
where
import Aitu.Bot.Forms.Form as Forms
import Aitu.Bot.Forms.Header as Forms
import Aitu.Bot.Forms.Options as Forms
import Aitu.Bot.Forms.FlexOptions as Forms
import Aitu.Bot.Forms.FormAction... | null | https://raw.githubusercontent.com/avatar29A/hs-aitubots-api/9cc3fd1e4e9e81491628741a6bbb68afbb85704e/src/Aitu/Bot/Forms.hs | haskell | module Aitu.Bot.Forms
( module Forms
)
where
import Aitu.Bot.Forms.Form as Forms
import Aitu.Bot.Forms.Header as Forms
import Aitu.Bot.Forms.Options as Forms
import Aitu.Bot.Forms.FlexOptions as Forms
import Aitu.Bot.Forms.FormAction... | |
3ce54583b54682158948f73658cd9a5450b1ceba19b1ab37584d7e7d84ef88da | BinaryAnalysisPlatform/bap | arm_mov.mli | open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open Arm_types
val lift :
?encoding:Theory.language ->
?dest:op ->
op ->
?src2:op ->
data_oper ->
?sreg:op ->
?simm:op ->
word ->
wflag:op ->
op ->
stmt list
| null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/arm/arm_mov.mli | ocaml | open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open Arm_types
val lift :
?encoding:Theory.language ->
?dest:op ->
op ->
?src2:op ->
data_oper ->
?sreg:op ->
?simm:op ->
word ->
wflag:op ->
op ->
stmt list
| |
8838459347bdb2652c0a302c5f92ba6520079a077a3f03678bbb86350ce832ab | elarous/O2SN | views.cljs | (ns o2sn.common.views
(:require [reagent.core :as r]
[re-frame.core :as rf]
[kee-frame.core :as k]
["semantic-ui-react" :as ui]
["react-motion" :as motion]))
(defn error-label [{:keys [valid? message path-to-ctrl]}]
(let [[start-x end-x] (if valid? [35 0] [0 35])
... | null | https://raw.githubusercontent.com/elarous/O2SN/289e17e5c4b6a19e3c8f964f9faa4efad3edefa8/src/client/main/o2sn/common/views.cljs | clojure | (ns o2sn.common.views
(:require [reagent.core :as r]
[re-frame.core :as rf]
[kee-frame.core :as k]
["semantic-ui-react" :as ui]
["react-motion" :as motion]))
(defn error-label [{:keys [valid? message path-to-ctrl]}]
(let [[start-x end-x] (if valid? [35 0] [0 35])
... | |
660075c121ff15d9228bbd98a3f3609c3d2860228c3a730b237b9e138e9cb69c | cronokirby/haze | Peer.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
{- |
Description: Contains types and functions related to peer communication.
-}
module Haze.Peer
( BlockInfo(..... | null | https://raw.githubusercontent.com/cronokirby/haze/3cfbc9de8d923a541429f4a5cb1eb4151d5aea08/src/Haze/Peer.hs | haskell | |
Description: Contains types and functions related to peer communication.
| The messages sent between peers in a torrent
| Used to keep the connection open (think PING
| The sender has choked the receiver
| The sender has unchoked the receiver
| The sender is now interested in the receiver
| The sender is no l... | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
module Haze.Peer
( BlockInfo(..)
, Message(..)
, encodeMessage
, parseMessage
, ParseCallBack
... |
adfafdea3250bde23f247d1fb3ca722ba6aa1ea8c302b8250c615118246d13da | racket/draw | brush.rkt | #lang racket/base
(require "../private/brush.rkt")
(provide make-handle-brush)
| null | https://raw.githubusercontent.com/racket/draw/a6558bdc18438e784c23d452ffd877dac867a7fd/draw-lib/racket/draw/unsafe/brush.rkt | racket | #lang racket/base
(require "../private/brush.rkt")
(provide make-handle-brush)
| |
81e35291de86b7ed0ba3dc93ff5318a62fca5d0dd76ee79f4e427e2ef7fdbc09 | ocaml-sf/learn-ocaml-corpus | build_does_not_reject_long_input.ml | (* The data values carried by the leaves of a tree. *)
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
(* The depths of the leaves of a tree. *)
let rec depths d t ds =
match t with
| Le... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/spectre/wrong/build_does_not_reject_long_input.ml | ocaml | The data values carried by the leaves of a tree.
The depths of the leaves of a tree.
The elements and depths, combined.
A direct definition can also be given.
A facility for reading and consuming the elements of a list.
Reconstructing a tree from its spectre.
Premature end of input.
If this element lies ... |
let rec elements t xs =
match t with
| Leaf x ->
x :: xs
| Fork (t, u) ->
elements t (elements u xs)
let elements (t : 'a tree) : 'a list =
elements t []
let rec depths d t ds =
match t with
| Leaf _ ->
d :: ds
| Fork (t, u) ->
depths (d + 1) t (depths (d + 1) u ds)
let depths... |
ce734e3b1abdb4188c2dd68810421be4fd7975fcd04debb542c74f82db877329 | mirage/digestif | baijiu_rmd160.ml | module By = Digestif_by
module Bi = Digestif_bi
module type S = sig
type ctx
type kind = [ `RMD160 ]
val init : unit -> ctx
val unsafe_feed_bytes : ctx -> By.t -> int -> int -> unit
val unsafe_feed_bigstring : ctx -> Bi.t -> int -> int -> unit
val unsafe_get : ctx -> By.t
val dup : ctx -> ctx
end
modul... | null | https://raw.githubusercontent.com/mirage/digestif/a94075cfec70fbcb31e15f94e28cb715c9e4d9dd/src-ocaml/baijiu_rmd160.ml | ocaml | module By = Digestif_by
module Bi = Digestif_bi
module type S = sig
type ctx
type kind = [ `RMD160 ]
val init : unit -> ctx
val unsafe_feed_bytes : ctx -> By.t -> int -> int -> unit
val unsafe_feed_bigstring : ctx -> Bi.t -> int -> int -> unit
val unsafe_get : ctx -> By.t
val dup : ctx -> ctx
end
modul... | |
e60503eda3bc45947ff61fa5161dbe9ffbc3cc198a692880795cd238156ee7dc | danilkolikov/dfl | PredefinedIdents.hs | |
Module : Core . PredefinedIdents
Description : Predefined identifiers
Copyright : ( c ) , 2019
License : MIT
Set of predefined identifiers
Module : Core.PredefinedIdents
Description : Predefined identifiers
Copyright : (c) Danil Kolikov, 2019
License : MIT
Set of... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Core/PredefinedIdents.hs | haskell | | Makes a simple ident
| Makes a qualified ident
Modules
| Name of the defautl module
| Default name of a module
| Prelude module
Type constructors
| Constructor of the unit type
| Constructor of the list type
| Constructor of the function type
| Constructor of the tuple type
| Int type
| Float type
| Str... | |
Module : Core . PredefinedIdents
Description : Predefined identifiers
Copyright : ( c ) , 2019
License : MIT
Set of predefined identifiers
Module : Core.PredefinedIdents
Description : Predefined identifiers
Copyright : (c) Danil Kolikov, 2019
License : MIT
Set of... |
e91f727be7df752954538ef347d4caf9738da5f61192e04da3dc679f320b75cd | clojure/core.typed | pred_scoping.clj | (ns clojure.core.typed.test.pred-scoping
(:require [clojure.core.typed :as unique123 :refer [pred]]))
(pred unique123/Int)
| null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/test/clojure/core/typed/test/pred_scoping.clj | clojure | (ns clojure.core.typed.test.pred-scoping
(:require [clojure.core.typed :as unique123 :refer [pred]]))
(pred unique123/Int)
| |
7ab0d3b61b72ad70454f838362ebb14f42f4aeb2a788a9f12d3b7ed450e222ba | kappelmann/engaging-large-scale-functional-programming | Exercise06.hs | module Exercise06 where
import Data.Either
data Colour = Gold | RustyBrown | TurtleGreen
deriving Eq
type Number = Int
data Card = Card Colour Number
tweedledumTweedledee :: [Either Colour Number] -> Integer
tweedledumTweedledee xs = toInteger (length [x | x <- xs, fromLeft RustyBrown x == Gold || even(fromRigh... | null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/8ed2c056fbd611f1531230648497cb5436d489e4/resources/contest/example_data/06/uploads/lemmahaveagoodtime/Exercise06.hs | haskell | module Exercise06 where
import Data.Either
data Colour = Gold | RustyBrown | TurtleGreen
deriving Eq
type Number = Int
data Card = Card Colour Number
tweedledumTweedledee :: [Either Colour Number] -> Integer
tweedledumTweedledee xs = toInteger (length [x | x <- xs, fromLeft RustyBrown x == Gold || even(fromRigh... | |
85882d1270b8a6ea867b343dd4733491342da9ce9f2b730ab1c97032b776840c | Feuerlabs/exo | exo_http_server.erl | %%%---- BEGIN COPYRIGHT -------------------------------------------------------
%%%
Copyright ( C ) 2012 - 2016 Feuerlabs , Inc. All rights reserved .
%%%
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obta... | null | https://raw.githubusercontent.com/Feuerlabs/exo/fe515e08178c122599eb1b7cbd21446cd63d550b/src/exo_http_server.erl | erlang | ---- BEGIN COPYRIGHT -------------------------------------------------------
---- END COPYRIGHT ---------------------------------------------------------
@doc
Simple exo_http_server
@end
exo_socket_server callbacks
Old type
Configurable start
For testing
-----------------------------------------------------... | Copyright ( C ) 2012 - 2016 Feuerlabs , Inc. All rights reserved .
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
@author < >
@author < >
( C ) 2012 , Feuerlabs , Inc. All rig... |
721732347a34bc08b580eaf09488a0d1d485db472099a7da9acc4378078a2073 | haskell-opengl/OpenGLRaw | TextureStorageMultisample.hs | --------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.TextureStorageMultisample
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-----------------------------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/ARB/TextureStorageMultisample.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.ARB.TextureStorageMultisample
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Functi... | Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.ARB.TextureStorageMultisample (
glGetARBTextureStorageMultisample,
gl_ARB_texture_storage_multisample,
glTexStorage2DMultisample,
glTexStorage3DMultisample
) where
import Graphics.GL.ExtensionPredicates
import Graphics.GL.Functions
|
ba0dab33dc94e699a5f47f977311cdfc6c33334037fc5184e66eed0cffa0480d | returntocorp/semgrep | Logging_helpers.mli | (*
Set up logging globally and for each module based on what
we found on the command line or config files.
*)
val setup :
debug:bool ->
log_config_file:Common.filename ->
log_to_file:Common.filename option ->
unit
| null | https://raw.githubusercontent.com/returntocorp/semgrep/e0d996ed1e4d76d0dafd34aec96bde3b718ac05e/libs/commons/Logging_helpers.mli | ocaml |
Set up logging globally and for each module based on what
we found on the command line or config files.
| val setup :
debug:bool ->
log_config_file:Common.filename ->
log_to_file:Common.filename option ->
unit
|
7f4669e43fe6d594633c6a5805091871b83cce882527282eda6573bbaf8e2b8e | jeffa5/mirage-xmpp | stanza.ml | type t =
| Message of Xml.t
| Presence of Xml.t
| Iq of Xml.t
[@@deriving sexp]
let to_xml = function Message xml -> xml | Presence xml -> xml | Iq xml -> xml
let gen_id () = Uuidm.(to_string (create `V4))
let create_presence ?(attributes = []) ?atype ?ato ~id ~from children =
let attributes =
match atype... | null | https://raw.githubusercontent.com/jeffa5/mirage-xmpp/df3dafecba9081880809d8649ed0727b9f6a9dc7/src/stanza.ml | ocaml | type t =
| Message of Xml.t
| Presence of Xml.t
| Iq of Xml.t
[@@deriving sexp]
let to_xml = function Message xml -> xml | Presence xml -> xml | Iq xml -> xml
let gen_id () = Uuidm.(to_string (create `V4))
let create_presence ?(attributes = []) ?atype ?ato ~id ~from children =
let attributes =
match atype... | |
62af83b5f0530b762cc884fbf36d2b57ac9d81d61e390c7c27838c34e76c9bc7 | dyzsr/ocaml-selectml | principality-and-gadts.ml | (* TEST
* expect *)
module M = struct type t = A | B end;;
[%%expect{|
module M : sig type t = A | B end
|}];;
type 'a t = I : int t | M : M.t t;;
[%%expect{|
type 'a t = I : int t | M : M.t t
|}];;
type dyn = Sigma : 'a t * 'a -> dyn;;
[%%expect{|
type dyn = Sigma : 'a t * 'a -> dyn
|}];;
let f = function Sigma... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-gadts/principality-and-gadts.ml | ocaml | TEST
* expect
The following should warn
********************
********************
This should warn
Example showing we need to warn when any part of the type is non generic.
This should warn
Issues with "principal level"
***********
Some more
*********** |
module M = struct type t = A | B end;;
[%%expect{|
module M : sig type t = A | B end
|}];;
type 'a t = I : int t | M : M.t t;;
[%%expect{|
type 'a t = I : int t | M : M.t t
|}];;
type dyn = Sigma : 'a t * 'a -> dyn;;
[%%expect{|
type dyn = Sigma : 'a t * 'a -> dyn
|}];;
let f = function Sigma (M, A) -> ();;
[%%expe... |
5f4ac46eba1aa10469a1b3f5a9bbd10c2801ea1ff917bc0a120a75ed63d42736 | macielti/alura-credit-card-ii | project.clj | (defproject alura-credit-card-ii "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:repositories {"my.datomic.com" {:url ""
:creds :gpg}}
:dependencies [[org.c... | null | https://raw.githubusercontent.com/macielti/alura-credit-card-ii/1fbb7ba9a1e3a81fee4729395378a775fab050c8/project.clj | clojure | (defproject alura-credit-card-ii "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:repositories {"my.datomic.com" {:url ""
:creds :gpg}}
:dependencies [[org.c... | |
f9f2cc87067b9d36626cf3eec71188e1df157d68b22a1f72bd371976be4305ff | roosta/herb | core_test.cljs | (ns herb.core-test
(:require [cljs.test :refer-macros [deftest testing is]]
[herb.core :as core]
[debux.cs.core :as d :refer-macros [clog dbg]]
[goog.object :as gobj]
[herb.runtime :as runtime]))
(deftest init!
(testing "Testing setting options via init function"
... | null | https://raw.githubusercontent.com/roosta/herb/5718582956a3f6c52092e663412debc3983c2ff0/test/herb/core_test.cljs | clojure | (ns herb.core-test
(:require [cljs.test :refer-macros [deftest testing is]]
[herb.core :as core]
[debux.cs.core :as d :refer-macros [clog dbg]]
[goog.object :as gobj]
[herb.runtime :as runtime]))
(deftest init!
(testing "Testing setting options via init function"
... | |
cb4be1e6a61a058ad2c48aec3f5482fc35c83b1f31918b01a68a8a63f0756a56 | deadcode/Learning-CL--David-Touretzky | 8.49.lisp | (defun pairings (listx listy)
(cond ((or (null listx) (null listy)) nil)
(t (append (list (list (car listx) (car listy)))
(pairings (cdr listx) (cdr listy))))))
(let ((test1 '(pairings '(a b c) '(1 2 3)))
(test2 '(pairings '(a b c) '(1 2 3 4)))
(test3 '(pairings '(a b c ... | null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%208/8.49.lisp | lisp | (defun pairings (listx listy)
(cond ((or (null listx) (null listy)) nil)
(t (append (list (list (car listx) (car listy)))
(pairings (cdr listx) (cdr listy))))))
(let ((test1 '(pairings '(a b c) '(1 2 3)))
(test2 '(pairings '(a b c) '(1 2 3 4)))
(test3 '(pairings '(a b c ... | |
06f824256dd911a0bfaa7c30311aaeea1ac100af37bf2e9aa75eecba75e04b49 | edicl/hunchentoot | packages.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
Copyright ( c ) 2004 - 2010 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;; * Redistribut... | null | https://raw.githubusercontent.com/edicl/hunchentoot/0023dd3927e5840f1f02f9a8bdab2b4a7037c652/test/packages.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the... |
Copyright ( c ) 2004 - 2010 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :cl-user)
(defpackage #:hunchentoot-test
(:nicknames #:tbnl-test)
(:use :cl :cl-who :hunchentoot... |
b06ec3ea6a99d0a11b52f6c76ea59232f6993d78fe36f5b4b498d78b75358789 | tomjridge/kv-hash | log_file_opt.ml | (** An optimistic log file. We write strings to a file, append
only. For each string, we write a header consisting of: the length
of the string, the xxhash of the contents.
On crash, we can recover all of the file to the last flush, and
perhaps some entries after the last flush. *)
open Log_file
open E_open
... | null | https://raw.githubusercontent.com/tomjridge/kv-hash/0b5349dd27ed9a14dc7c1f166afd1ad691bcd9dc/src/log_file_opt.ml | ocaml | * An optimistic log file. We write strings to a file, append
only. For each string, we write a header consisting of: the length
of the string, the xxhash of the contents.
On crash, we can recover all of the file to the last flush, and
perhaps some entries after the last flush.
: Log_file.LOG_FILE_W
write ... | open Log_file
open E_open
module Private = struct
let _ = assert(Sys.word_size = 64 || failwith "Need 64bit platform")
let len8 = 8
let len16 = 16
let int64_to_bytes i ~buf ~buf_off =
assert(Bytes.length buf >= 8);
Bytes.set_int64_be buf buf_off (i : Int64.t);
()
let int_to_bytes i ~buf ~bu... |
6a739eb549b2422444855b794e5cc86a768674079322bc141bc17dacf774258b | ff-notes/ron | Data.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
-- | Typed and untyped RON tools
module RON.Data (
Reducible (..),
Replicat... | null | https://raw.githubusercontent.com/ff-notes/ron/0df2b7985996ecc498808ea7247d0d8de471da4f/ron-rdt/lib/RON/Data.hs | haskell | | Typed and untyped RON tools
* Object-state monad
state
patch
| Reduce object with frame from another version of the same object.
| Run ObjectFrame action
| Run ObjectFrame action, starting with an empty frame
| Run ObjectFrame action
| Run ObjectFrame action, starting with an empty frame
| Create new 'Objec... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module RON.Data (
Reducible (..),
Replicated (..),
ReplicatedAsObject (... |
a15192830dc954fff3dcc2c683a6310a690e6a63f4151e6e6149381d8dfc520d | processone/ejabberd | mod_http_api.erl | %%%----------------------------------------------------------------------
%%% File : mod_http_api.erl
Author : >
%%% Purpose : Implements REST API for ejabberd using JSON data
Created : 15 Sep 2014 by
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
%%%
%%% This program is free software;... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/mod_http_api.erl | erlang | ----------------------------------------------------------------------
File : mod_http_api.erl
Purpose : Implements REST API for ejabberd using JSON data
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that... | Author : >
Created : 15 Sep 2014 by
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
wit... |
376b01f8d422a432c113ae9a1b45c708dba3b7789007d0fd51e9184493e2132f | NorfairKing/easyspec | Chunks.hs | module EasySpec.Discover.SignatureInference.Chunks where
import EasySpec.Discover.SignatureInference.ChunksUtils
import EasySpec.Discover.SignatureInference.ShrinkThenDrill
import EasySpec.Discover.Types
inferChunks :: SignatureInferenceStrategy
inferChunks =
SignatureInferenceStrategy
{sigInfStratName = "chu... | null | https://raw.githubusercontent.com/NorfairKing/easyspec/b038b45a375cc0bed2b00c255b508bc06419c986/easyspec/src/EasySpec/Discover/SignatureInference/Chunks.hs | haskell | module EasySpec.Discover.SignatureInference.Chunks where
import EasySpec.Discover.SignatureInference.ChunksUtils
import EasySpec.Discover.SignatureInference.ShrinkThenDrill
import EasySpec.Discover.Types
inferChunks :: SignatureInferenceStrategy
inferChunks =
SignatureInferenceStrategy
{sigInfStratName = "chu... | |
ddccf01583869e41b006ab642a027ace3068172804ab2c5df32ea83791ae9067 | uw-unsat/leanette-popl22-artifact | reals.rkt | #lang rosette
(require "type.rkt" "errors.rkt"
rosette/lib/match (only-in racket/syntax format-symbol)
(for-syntax (only-in racket/syntax format-id))
(only-in rosette/base/core/type subtype? type-cast)
(only-in rosette [void rosette-void]))
(provide real-type? real-type-length
... | null | https://raw.githubusercontent.com/uw-unsat/leanette-popl22-artifact/80fea2519e61b45a283fbf7903acdf6d5528dbe7/rosette-benchmarks-3/synthcl/model/reals.rkt | racket | which can be either a scalar or a vector type. A real type has a
length ( which is 1 for scalar types ) ; a corresponding base
(element) type; and a procedure for implicitly converting values
to that type, and for constructing values of that type from base
components. The base type of a scalar type is its corr... | #lang rosette
(require "type.rkt" "errors.rkt"
rosette/lib/match (only-in racket/syntax format-symbol)
(for-syntax (only-in racket/syntax format-id))
(only-in rosette/base/core/type subtype? type-cast)
(only-in rosette [void rosette-void]))
(provide real-type? real-type-length
... |
0941876f25f5887cce87fbe5d6dcbb0abc1056159a9fe786e596f59ee2682030 | anurudhp/CPHaskell | a.hs | {-# LANGUAGE Safe #-}
import safe Control.Arrow ((>>>))
main :: IO ()
main = interact $ words >>> drop 1 >>> map (read >>> solve >>> showAns) >>> unlines
where
showAns Nothing = "-1"
showAns (Just (x, y, z)) = unwords $ show <$> [x, y, z]
type TIII = (Int, Int, Int)
solve :: Int -> Maybe TIII
solve n = dp... | null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/codeforces/1430/a.hs | haskell | # LANGUAGE Safe # |
import safe Control.Arrow ((>>>))
main :: IO ()
main = interact $ words >>> drop 1 >>> map (read >>> solve >>> showAns) >>> unlines
where
showAns Nothing = "-1"
showAns (Just (x, y, z)) = unwords $ show <$> [x, y, z]
type TIII = (Int, Int, Int)
solve :: Int -> Maybe TIII
solve n = dp !! n
where
dp :... |
21553b6fc822b4715099b490757f6e36579325557b75ed8aff7edf03e694a018 | tonsky/datascript | serialize.cljc | (ns datascript.serialize
(:refer-clojure :exclude [amap array?])
(:require
[clojure.edn :as edn]
[clojure.string :as str]
[datascript.db :as db #?(:cljs :refer-macros :clj :refer) [raise cond+] #?@(:cljs [:refer [Datom]])]
[datascript.lru :as lru]
[me.tonsky.persistent-sorted-set :as set]
[me.tons... | null | https://raw.githubusercontent.com/tonsky/datascript/9e3ad968ec6b25b53963f3f96c8f6cae6713d918/src/datascript/serialize.cljc | clojure | (ns datascript.serialize
(:refer-clojure :exclude [amap array?])
(:require
[clojure.edn :as edn]
[clojure.string :as str]
[datascript.db :as db #?(:cljs :refer-macros :clj :refer) [raise cond+] #?@(:cljs [:refer [Datom]])]
[datascript.lru :as lru]
[me.tonsky.persistent-sorted-set :as set]
[me.tons... | |
a0ba5f4bb8abfdf37dd9494048cd2341f8679ec61349ac2b153dd7c9a7b82576 | HealthSamurai/re-form | select_input_impl.cljs | (ns re-form.inputs.select-input-impl
(:require [reagent.core :as r]
[re-form.inputs.common :as cmn]
[garden.units :as u]))
(defn select-input-style
[{:keys [h h2 h3 selection-bg-color hover-bg-color border]}]
[:.re-select
{:position :relative
:display "inline-block"
:background... | null | https://raw.githubusercontent.com/HealthSamurai/re-form/810321d67e3946876c834998e3472d0693846953/src/cljs/re_form/inputs/select_input_impl.cljs | clojure | (ns re-form.inputs.select-input-impl
(:require [reagent.core :as r]
[re-form.inputs.common :as cmn]
[garden.units :as u]))
(defn select-input-style
[{:keys [h h2 h3 selection-bg-color hover-bg-color border]}]
[:.re-select
{:position :relative
:display "inline-block"
:background... | |
f6d2ac81bfa9189e69e9431955077fb823907bded18e11c3ce877f360753a192 | nitrogen/NitrogenProject.com | demos_recaptcha.erl | %% vim: ts=4 sw=4 et
-module (demos_recaptcha).
-include_lib ("nitrogen_core/include/wf.hrl").
-compile(export_all).
main() -> #template { file="./templates/demos46.html" }.
title() -> "Recaptcha".
headline() -> "Recaptcha".
left() ->
[
"
<p>
You can minimize the effects of automated s... | null | https://raw.githubusercontent.com/nitrogen/NitrogenProject.com/b4b3a0dbe17394608d2ee6eaa089e3ece1285075/src/demos/demos_recaptcha.erl | erlang | vim: ts=4 sw=4 et | -module (demos_recaptcha).
-include_lib ("nitrogen_core/include/wf.hrl").
-compile(export_all).
main() -> #template { file="./templates/demos46.html" }.
title() -> "Recaptcha".
headline() -> "Recaptcha".
left() ->
[
"
<p>
You can minimize the effects of automated spam by employing the ... |
727306eb2843479d6e81be72720484ca8714a344b53ccd870b6f20ee62aaea55 | flosell/lambdacd-git | simple_pipeline.clj | (ns lambdacd-git.example.simple-pipeline
(:use [compojure.core])
(:require [lambdacd.steps.shell :as shell]
[lambdacd.steps.manualtrigger :refer [wait-for-manual-trigger]]
[lambdacd.steps.control-flow :refer [either with-workspace in-parallel run]]
[lambdacd.core :as lambdacd]
... | null | https://raw.githubusercontent.com/flosell/lambdacd-git/3677c7afc1324bef6eb1c20f66bd83d99a1c54a9/example/lambdacd_git/example/simple_pipeline.clj | clojure | (ns lambdacd-git.example.simple-pipeline
(:use [compojure.core])
(:require [lambdacd.steps.shell :as shell]
[lambdacd.steps.manualtrigger :refer [wait-for-manual-trigger]]
[lambdacd.steps.control-flow :refer [either with-workspace in-parallel run]]
[lambdacd.core :as lambdacd]
... | |
320da9585107f1ab7beca9a284deefad7aa6e9302ddcc246adae9007fbafdbd2 | lpeterse/koka | Failure.hs | -----------------------------------------------------------------------------
Copyright 2012 Microsoft Corporation .
--
-- This is free software; you can redistribute it and/or modify it under the
terms of the Apache License , Version 2.0 . A copy of the License can be
found in the file " license.txt " at the roo... | null | https://raw.githubusercontent.com/lpeterse/koka/43feefed258b9a533f07967d3f8867b02384df0e/src/Common/Failure.hs | haskell | ---------------------------------------------------------------------------
This is free software; you can redistribute it and/or modify it under the
---------------------------------------------------------------------------
|
Internal errors and assertions.
| Copyright 2012 Microsoft Corporation .
terms of the Apache License , Version 2.0 . A copy of the License can be
found in the file " license.txt " at the root of this distribution .
module Common.Failure( failure, assertion, todo, matchFailure
, raise, raiseIO, catchIO
)... |
e7ac526528c846f4c6376bfc7ac7bda81c2b81cc1d0bd978e52cba016188afba | CryptoKami/cryptokami-core | Hashing.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE RankNTypes #-}
-- | Hashing capabilities.
module Pos.Crypto.Hashing
(
* WithHash
WithHash (..)
, withHash
, _whData
, _whHash
-- * AbstractHash
, AbstractHash (..)
, decodeAbstractHash
, decode... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/crypto/Pos/Crypto/Hashing.hs | haskell | # LANGUAGE RankNTypes #
| Hashing capabilities.
* AbstractHash
* Common Hash
* Utility
--------------------------------------------------------------------------
--------------------------------------------------------------------------
| Hash wrapper with phantom type for more type-safety.
Made abstract... | # LANGUAGE AllowAmbiguousTypes #
module Pos.Crypto.Hashing
(
* WithHash
WithHash (..)
, withHash
, _whData
, _whHash
, AbstractHash (..)
, decodeAbstractHash
, decodeHash
, abstractHash
, unsafeAbstractHash
, unsafeMkAbstractHash
... |
7e3c88fc0bef103821e7caf0e061d5a657286e9323b8d0c707e1977ff05b2fd4 | funcool/clojure.jdbc | meta.clj | Copyright 2014 - 2015 < >
;;
Licensed under the Apache License , Version 2.0 ( the " License " )
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, software
distributed un... | null | https://raw.githubusercontent.com/funcool/clojure.jdbc/0828e9361e867181ddd2199f53ffa4de86904c83/src/jdbc/meta.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2014 - 2015 < >
Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns jdbc.meta
"Connection metadata access methods."
(:require [jdbc.types :as types]
[jdbc.proto :as proto]))
(defn vendor-name
... |
d01892821dd426be35c54ba0239b6a68f3614fa76d0a715e712ed026b7012a77 | appleby/Lisp-In-Small-Pieces | bibrun.scm | $ I d : bibrun.scm , v 1.2 1994/08/21 19:35:32
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is derived from the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge Unive... | null | https://raw.githubusercontent.com/appleby/Lisp-In-Small-Pieces/af4139232bb7170f32470774a92d647e83254721/si/bibrun.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is derived from the files that accompany the book:
The original sources can be downloaded from the author's website at
-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html
This file may have been altered from the original in order to... | $ I d : bibrun.scm , v 1.2 1994/08/21 19:35:32
LISP Implantation Semantique Programmation ( InterEditions , France )
or Lisp In Small Pieces ( Cambridge University Press ) .
By Christian Queinnec < >
(define (fact1 n) (if (= n 0) 1 (* n (fact1 (- n 1)))))
|
e7d9b2b7db26410a32e2c76ac656a52efb38730914e55f7836c8563b445e2059 | wpfjtmwls/TensorFlOcaml | alexnet.ml | open Owl
open Tf
open Tfgraph
open Tfgraphst
open Tfnode
module AlexNet : SUBGRAPH = struct
let default_name = "ALEXNET"
let create in_list name graph graphst =
if List.length in_list <> 1 then failwith "Wrong number of arguments" else
let input = List.nth in_list 0 in
let num_dims = (List.nth i... | null | https://raw.githubusercontent.com/wpfjtmwls/TensorFlOcaml/aa08d5da1f622e40dc0002e3879aab70b928e132/tests/alexnet.ml | ocaml | open Owl
open Tf
open Tfgraph
open Tfgraphst
open Tfnode
module AlexNet : SUBGRAPH = struct
let default_name = "ALEXNET"
let create in_list name graph graphst =
if List.length in_list <> 1 then failwith "Wrong number of arguments" else
let input = List.nth in_list 0 in
let num_dims = (List.nth i... | |
a786d2fdfc7f28d2ae6f51b9c618fe8635670fa67887de0a4b02c0d112b130c4 | marigold-dev/deku | request_hash.ml | open Deku_repr
open Deku_crypto
open BLAKE2b
type request_hash = BLAKE2b.t
and t = request_hash [@@deriving eq, ord]
let to_blake2b request_hash = request_hash
include With_b58_and_encoding (struct
let name = "Deku_gossip.Request_hash"
let prefix = Prefix.deku_request_hash
end)
let hash = hash
let show = to_b58... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/gossip/request_hash.ml | ocaml | open Deku_repr
open Deku_crypto
open BLAKE2b
type request_hash = BLAKE2b.t
and t = request_hash [@@deriving eq, ord]
let to_blake2b request_hash = request_hash
include With_b58_and_encoding (struct
let name = "Deku_gossip.Request_hash"
let prefix = Prefix.deku_request_hash
end)
let hash = hash
let show = to_b58... | |
96aa65d59d52da8dc7126551a336fe60096323441846829cd810ab849dbd0f17 | jeapostrophe/raart | key.rkt | #lang racket/base
(require racket/list
racket/format
racket/match
lux
raart)
(define (key)
(define base (word #:fps 0.0 #:label "Key Debug" #:return (void)))
(define (show-key k)
(word base
#:output (text (~a k))
#:event
(match-lambda
... | null | https://raw.githubusercontent.com/jeapostrophe/raart/9d82f2f8ad0052c2f4a6a75a00d957b9806f33df/t/key.rkt | racket | #lang racket/base
(require racket/list
racket/format
racket/match
lux
raart)
(define (key)
(define base (word #:fps 0.0 #:label "Key Debug" #:return (void)))
(define (show-key k)
(word base
#:output (text (~a k))
#:event
(match-lambda
... | |
7db5a08f8a6d68e2453631b8f31ab6e3aec03e3d2535f89b67283f4f835c88e5 | vehicle-lang/vehicle | Type.hs | module Vehicle.Compile.Type.Subsystem.Polarity.Type
( typePolarityBuiltin,
handlePolarityTypingError,
relevanceOfTypeClass,
freshPolarityMeta,
convertToPolarityTypes,
)
where
import Data.Text qualified as Text
import Vehicle.Compile.Error (MonadCompile, compilerDeveloperError)
import Vehicle.Compil... | null | https://raw.githubusercontent.com/vehicle-lang/vehicle/3a3548f9b48c3969212ccb51e954d4d4556ea815/vehicle/src/Vehicle/Compile/Type/Subsystem/Polarity/Type.hs | haskell | | Return the type of the provided builtin.
Comparisons
Arithmetic operations
Conversion functions | module Vehicle.Compile.Type.Subsystem.Polarity.Type
( typePolarityBuiltin,
handlePolarityTypingError,
relevanceOfTypeClass,
freshPolarityMeta,
convertToPolarityTypes,
)
where
import Data.Text qualified as Text
import Vehicle.Compile.Error (MonadCompile, compilerDeveloperError)
import Vehicle.Compil... |
14b4add9e765bf29a0e475d8d9d72424e464c99f65e97860a83229a1c7171365 | ideas-edu/ideas | Object.hs | -----------------------------------------------------------------------------
Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are included in the distribution .
-------... | null | https://raw.githubusercontent.com/ideas-edu/ideas/f84907f92a8c407b7313f99e65a08d2646dc1565/src/Ideas/Text/OpenMath/Object.hs | haskell | ---------------------------------------------------------------------------
---------------------------------------------------------------------------
|
Maintainer :
Stability : provisional
---------------------------------------------------------------------------
internal representation for OpenMat... | Copyright 2019 , Ideas project team . This file is distributed under the
terms of the Apache License 2.0 . For more information , see the files
" LICENSE.txt " and " NOTICE.txt " , which are included in the distribution .
Portability : portable ( depends on ghc )
module Ideas.Text.OpenMath.Object
... |
3da91fe0101decc395d5342aca0e3552cab3c4dea08e14976ddde5ea792dd2e1 | samply/blaze | include_spec.clj | (ns blaze.interaction.search.include-spec
(:require
[blaze.db.spec]
[blaze.interaction.search.include :as include]
[blaze.interaction.search.spec]
[clojure.spec.alpha :as s]))
(s/fdef include/add-includes
:args (s/cat :db :blaze.db/db
:include-defs :blaze.interaction.search/include-... | null | https://raw.githubusercontent.com/samply/blaze/c479410a9198526453a0df769ab7db2e6d5dd654/modules/interaction/test/blaze/interaction/search/include_spec.clj | clojure | (ns blaze.interaction.search.include-spec
(:require
[blaze.db.spec]
[blaze.interaction.search.include :as include]
[blaze.interaction.search.spec]
[clojure.spec.alpha :as s]))
(s/fdef include/add-includes
:args (s/cat :db :blaze.db/db
:include-defs :blaze.interaction.search/include-... | |
92e90999a5e5ddb17aea444e7b8dd2fbe9506b7cce153e59d2e9d3ac3e45cc1d | G-Corp/vice | vice.erl | -module(vice).
-behaviour(gen_server).
-include("../include/vice.hrl").
%% Common API
-export([
start/0
, stop/0
, start_link/0
, type/1
, infos/1
, infos/2
, info/2
, info/3
, status/1
, stop/1
, convert/2
, co... | null | https://raw.githubusercontent.com/G-Corp/vice/de0fab6441e7be9fc807d85ca21899d1fc2b533a/src/vice.erl | erlang | Common API
Video API
DEPRECATED -- REMOVE in 1.0.0
gen_server callbacks
@doc
Start vice application
@end
@doc
Stop vice application
@end
@hidden
@doc
Return the file type (image, audio or video)
@end
@equiv infos(File, [])
@doc
Return all media informations
@end
@equiv info(File, Info, [])
@doc
Re... | -module(vice).
-behaviour(gen_server).
-include("../include/vice.hrl").
-export([
start/0
, stop/0
, start_link/0
, type/1
, infos/1
, infos/2
, info/2
, info/3
, status/1
, stop/1
, convert/2
, convert/3
... |
cfc4369d58d23fe30c59ce8051acc6790bd9f7aa62a7e024f1ac1dbc325a1c0b | ghcjs/jsaddle | Native.hs | -----------------------------------------------------------------------------
--
Module : Language . Javascript . JSaddle . Native
Copyright : ( c )
License : MIT
--
Maintainer : < >
--
-- |
--
-----------------------------------------------------------------------------
module Lan... | null | https://raw.githubusercontent.com/ghcjs/jsaddle/97273656e28790ab6e35c827f8086cf47bfbedca/jsaddle/src/Language/Javascript/JSaddle/Native.hs | haskell | ---------------------------------------------------------------------------
|
--------------------------------------------------------------------------- | Module : Language . Javascript . JSaddle . Native
Copyright : ( c )
License : MIT
Maintainer : < >
module Language.Javascript.JSaddle.Native (
module Language.Javascript.JSaddle.Native.Internal
, withToJSVal
) where
import GHCJS.Marshal.Internal (ToJSVal(..))
import Language... |
1e4c9c8dcb18ed038fae4c00e80126bcb87f0b8ed41c2a029afadf18ea87550d | 2600hz-archive/whistle | rebar.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% -------------------------------------------------------------------
%%
rebar : Erlang Build Tools
%%
Copyright ( c ) 2009 ( )
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this softw... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/utils/rebar/src/rebar.erl | erlang | ex: ts=4 sw=4 et
-------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sel... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
rebar : Erlang Build Tools
Copyright ( c ) 2009 ( )
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the... |
9590475517cfe5aaf3d746f6a2d8e75bc099ff75ef1898c303e9c99f68e2b612 | chenyukang/eopl | 04.scm | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
;; remove-fisrt
;; procedure version
(define end-cont
(lambda()
(lambda (v)
(begin
(printf "procedure end-cont : ~a\n" v)
v))))
(define apply-cont
(lambda (cont val)
(cont val)))
(define remove-first
(lambda (lst)
(remove-... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch6/04.scm | scheme | remove-fisrt
procedure version
remove-fisrt, datatype version
list-sum,
procedure version
list-sum
datatype version
subst
procedure version | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
(define end-cont
(lambda()
(lambda (v)
(begin
(printf "procedure end-cont : ~a\n" v)
v))))
(define apply-cont
(lambda (cont val)
(cont val)))
(define remove-first
(lambda (lst)
(remove-first/k lst (end-cont))))
(define re... |
b37a54ea318131651ae5201e8857a82157f4a74a1aa8f4c732b51154052f07a7 | bartavelle/language-puppet | Value.hs | # LANGUAGE TemplateHaskell #
module Puppet.Language.Value
where
import XPrelude
import Data.Aeson
import Data.Aeson.TH
import qualified Data.HashMap.Strict as HM
import Data.Scientific (isInteger)
import Foreign.Ruby.Helpers
import Puppet.Language.Core
... | null | https://raw.githubusercontent.com/bartavelle/language-puppet/ff66c06c93040ee63f33d899e171167cd4260d92/src/Puppet/Language/Value.hs | haskell | | A puppet value. | # LANGUAGE TemplateHaskell #
module Puppet.Language.Value
where
import XPrelude
import Data.Aeson
import Data.Aeson.TH
import qualified Data.HashMap.Strict as HM
import Data.Scientific (isInteger)
import Foreign.Ruby.Helpers
import Puppet.Language.Core
... |
c9fa11df0a2f098c90c029b2900047a8024b1cb0bd81f5b0f500da37cacb561b | metametadata/carry | blueprint.cljs | (ns app.blueprint
(:require [app.model :refer [initial-model]]
[app.signals :refer [on-signal]]
[app.actions :refer [on-action]]))
(def blueprint
{:initial-model initial-model
:on-signal on-signal
:on-action on-action}) | null | https://raw.githubusercontent.com/metametadata/carry/fa5c7cd0d8f1b71edca70330acc97c6245638efb/examples/counter-list/src/app/blueprint.cljs | clojure | (ns app.blueprint
(:require [app.model :refer [initial-model]]
[app.signals :refer [on-signal]]
[app.actions :refer [on-action]]))
(def blueprint
{:initial-model initial-model
:on-signal on-signal
:on-action on-action}) | |
52a1ebb8ba890d9d1eb03e599e7654f8918abe9bc7ac772a05b99e5c34c9e3d9 | DavidAlphaFox/RabbitMQ | rabbit_mnesia.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/src/rabbit_mnesia.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
RabbitMQ 对Mnesi... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
018c776c463d96a4f8b317fe69292cd7e8c292afade658636d5b2456fe95ec27 | stackbuilders/tutorials | Main.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Main (main) where
import Data.Aeson
import Data.Semigroup ((<>))
import Data.Text (Text)
import GHC.Generics
import Text.Mustache
import qualified Text.Mustache.Compile.TH as TH
import qualified Data.Text.Lazy.IO... | null | https://raw.githubusercontent.com/stackbuilders/tutorials/c6100b5bf7a00a3669444313159dfc2ca0cf8eb7/tutorials/haskell/mustache-templates/code/src/Main.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Main (main) where
import Data.Aeson
import Data.Semigroup ((<>))
import Data.Text (Text)
import GHC.Generics
import Text.Mustache
import qualified Text.Mustache.Compile.TH as TH
import qualified Data.Text.Lazy.IO as TIO
data Release = Release
{... |
3a83396dd1aa9d9077ed4db41f4f70fec3b4829cb04181cca19aa21ca477e4e3 | jaseemabid/mit-scheme | test-file-attributes.scm | (define-test 'parse-file-attributes-string
(map
(lambda (p)
(let ((string (car p))
(expected-value (cdr p)))
(lambda ()
(with-test-properties
(lambda ()
(assert-equal (parse-file-attributes-string string)
expected-value))
'ex... | null | https://raw.githubusercontent.com/jaseemabid/mit-scheme/d30da6b2c103e34b6e0805bd5cbefeb9501382c1/tests/runtime/test-file-attributes.scm | scheme |
+\" -*-" | (define-test 'parse-file-attributes-string
(map
(lambda (p)
(let ((string (car p))
(expected-value (cdr p)))
(lambda ()
(with-test-properties
(lambda ()
(assert-equal (parse-file-attributes-string string)
expected-value))
'ex... |
612e92f13c1328ecc31c79d71ab8d66a15bce76bb37e72e4543f2a937ab7aa0f | pyr/net | buffer_test.clj | (ns net.ty.buffer-test
(:require [clojure.test :refer :all]
[net.ty.buffer :refer :all]
[clojure.core.async :as a]))
(def one? (partial = 1))
(def two? (partial = 2))
(deftest composite-buffer
(let [parts ["f" "o" "o" "b" "a" "r"]
cb (composite)]
(doseq [p parts]
(augm... | null | https://raw.githubusercontent.com/pyr/net/a2120bf61b6fd480707ea6b217545b3d640288d0/test/net/ty/buffer_test.clj | clojure | Same tests, but on direct buffers
Composite buffer behavior
Asynchronous buffers
====================
Ensure
We enqueued the composite last, we can now release it | (ns net.ty.buffer-test
(:require [clojure.test :refer :all]
[net.ty.buffer :refer :all]
[clojure.core.async :as a]))
(def one? (partial = 1))
(def two? (partial = 2))
(deftest composite-buffer
(let [parts ["f" "o" "o" "b" "a" "r"]
cb (composite)]
(doseq [p parts]
(augm... |
b4654ff01a779fac29f0b9f882b90ec280a5abc7439d8aea1ee6547eaf4c0a77 | arthurbarroso/lovelace | core.clj | (ns lovelace.users.core
(:require [cheshire.core :as json]
[lovelace.users.requests :refer [fetch-user fetch-users]]))
(defn list-all-users
"Retrieves a list of users of a given workspace. Takes the authentication token as a parameter.
Is also able to take the optional parameters `page-size` and `s... | null | https://raw.githubusercontent.com/arthurbarroso/lovelace/a6cadfc83953f3488117ee46a0bec768fe616ba0/src/lovelace/users/core.clj | clojure | (ns lovelace.users.core
(:require [cheshire.core :as json]
[lovelace.users.requests :refer [fetch-user fetch-users]]))
(defn list-all-users
"Retrieves a list of users of a given workspace. Takes the authentication token as a parameter.
Is also able to take the optional parameters `page-size` and `s... | |
a94a372d931a33ec18830177b4af337befb2a4c4baf0f75c252530b3c5e950ec | hasufell/hpath | Directory.hs | -- |
Module : System . . RawFilePath . Directory
Copyright : © 2020
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
-- Portability : portable
--
This module provides IO related file operations like
-- copy, delete, move and so on, similar to the 'directory' pack... | null | https://raw.githubusercontent.com/hasufell/hpath/167a9fcd19af628ec51e60e116a9a7d573be0cae/hpath-directory/src/System/Posix/RawFilePath/Directory.hs | haskell | |
License : BSD3
Stability : experimental
Portability : portable
copy, delete, move and so on, similar to the 'directory' package.
Some of these operations are due to their nature __not atomic__, which
of them also have to examine the filetypes explicitly before the
syscalls, so a reasonable decisio... | Module : System . . RawFilePath . Directory
Copyright : © 2020
Maintainer : < >
This module provides IO related file operations like
means they may do multiple syscalls which form one context . Some
Note : ` BlockDevice ` , ` CharacterDevice ` , ` NamedPipe ` and ` Socket `
> import... |
a96ee89e52139bd9b4712c7bd3c0a74b363af1dca39738ebbcbc6b1e2ca4443e | lambdamikel/DLMAPS | macros.lisp | ;; -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
(in-package :PROVER)
;;;
;;;
;;;
(defmacro defvar1 (&rest body)
`(#+:lispworks SYSTEM::WITHOUT-WARNING-ON-REDEFINITION
#-:lispworks progn
(defvar ,@body)))
(defmacro defparameter1 (&rest body)
`(#+:lispworks SYSTEM::W... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/prover/macros.lisp | lisp | -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*-
die "*"-Varianten evaluieren das "name"-Argument!
|
(in-package :PROVER)
(defmacro defvar1 (&rest body)
`(#+:lispworks SYSTEM::WITHOUT-WARNING-ON-REDEFINITION
#-:lispworks progn
(defvar ,@body)))
(defmacro defparameter1 (&rest body)
`(#+:lispworks SYSTEM::WITHOUT-WARNING-ON-REDEFINITION
#-:lispworks progn
... |
d8a424f144d5a9f9e2f46a80cfec7b9fa15df7c254947edbf72437164b849a2d | kupl/LearnML | original.ml | type nat = ZERO | SUCC of nat
let rec natadd (n1 : nat) (n2 : nat) : nat =
match n1 with ZERO -> n2 | SUCC n1_next -> natadd n1_next n2
let rec natmul (n1 : nat) (n2 : nat) : nat =
match n2 with ZERO -> ZERO | SUCC n2_next -> natadd n1 (natmul n1 n2_next)
| null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/nat/sub33/original.ml | ocaml | type nat = ZERO | SUCC of nat
let rec natadd (n1 : nat) (n2 : nat) : nat =
match n1 with ZERO -> n2 | SUCC n1_next -> natadd n1_next n2
let rec natmul (n1 : nat) (n2 : nat) : nat =
match n2 with ZERO -> ZERO | SUCC n2_next -> natadd n1 (natmul n1 n2_next)
| |
d3eb9d1467bbee5f03e04532307a7e56c42f37346870a77565867b24909c255f | yeller/logfmt | logfmt_test.clj | (ns logfmt-test
(:require [clojure.test :refer :all]
[logfmt :refer :all]))
(defmacro with-err-str [& body]
`(with-out-str
(binding [~'*err* ~'*out*]
~@body)))
(deftest msg-formats-a-message
(is (= "foo=bar baz=1"
(msg :foo "bar" :baz "1"))))
(deftest map->msg-formats-a-message... | null | https://raw.githubusercontent.com/yeller/logfmt/381af9fe7717b64a79f3eba617ccceeb59b77323/test/logfmt_test.clj | clojure | (ns logfmt-test
(:require [clojure.test :refer :all]
[logfmt :refer :all]))
(defmacro with-err-str [& body]
`(with-out-str
(binding [~'*err* ~'*out*]
~@body)))
(deftest msg-formats-a-message
(is (= "foo=bar baz=1"
(msg :foo "bar" :baz "1"))))
(deftest map->msg-formats-a-message... | |
a071e78ff3637519d23e6f990df416c44ad94f4c39f90d96964435db44c6d4f2 | victornicolet/parsynt | TermUtils.ml | open Base
open Term
open TermPp
open Typ
let type_of_exn t =
match type_of t with
| Ok t -> t
| Error e ->
typecheck_err e;
failwith "Type checking error"
let count_terms (eq : term -> bool) ~(in_term : term) =
Transform.recurse
{ init = 0; join = ( + ); case = (fun _ _t -> if eq _t then Some ... | null | https://raw.githubusercontent.com/victornicolet/parsynt/d3f530923c0c75537b92c2930eb882921f38268c/src/lang/TermUtils.ml | ocaml | Short operations
=============================================================================================
========================= Function Construction Helpers =================================
=============================================================================================
============... | open Base
open Term
open TermPp
open Typ
let type_of_exn t =
match type_of t with
| Ok t -> t
| Error e ->
typecheck_err e;
failwith "Type checking error"
let count_terms (eq : term -> bool) ~(in_term : term) =
Transform.recurse
{ init = 0; join = ( + ); case = (fun _ _t -> if eq _t then Some ... |
9dd7df05b9927833b3c53a4e2a8540dddfd67e3a84a6c7b6326755a5b82183c8 | hidaris/thinking-dumps | semantics.rkt | #lang racket
(provide B 𝑩)
(require redex/reduction-semantics)
(define-language B
(e ::= i (add1 e) (sub1 e))
(i ::= integer))
(define-judgment-form B
#:mode (𝑩 I O)
#:contract (𝑩 e i)
[----------
(𝑩 i i)]
[(𝑩 e_0 i_0)
(where i_1 ,(+ (term i_0) 1))
-----------
(𝑩 (add1 e_0) i_1)]
[(�... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/compiler/blackmail/semantics.rkt | racket | #lang racket
(provide B 𝑩)
(require redex/reduction-semantics)
(define-language B
(e ::= i (add1 e) (sub1 e))
(i ::= integer))
(define-judgment-form B
#:mode (𝑩 I O)
#:contract (𝑩 e i)
[----------
(𝑩 i i)]
[(𝑩 e_0 i_0)
(where i_1 ,(+ (term i_0) 1))
-----------
(𝑩 (add1 e_0) i_1)]
[(�... | |
7d09121066c12df97209e31ddaf396fec7b97f4433e499cdfc84728fc12d9c7d | cmcl/franklyfrank | midEvaluator.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Evaluator defined in terms of a denotational semantics for the
* mid - level language .
*
*
* Created by on 21/07/2015 .
* * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/cmcl/franklyfrank/6cc1c4f7377ea2a907675ec0fae9ff32829cec83/eval/midEvaluator.mli | ocaml | i | k vs
| command
| top-level-handler (name)
| built-in-handler (name)
| local-handler (handler-def, locals)
| continuation
* Kleisli composition of computations
* Evaluation function
* Module representing evaluation of mid-level tree to monadic computation
trees.
increment function
command "... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Evaluator defined in terms of a denotational semantics for the
* mid - level language .
*
*
* Created by on 21/07/2015 .
* * * * * * * * * * * * * * * * * * *... |
0c1bc12dca1b8e1323b70ade3df6665b8427226abcfa88472719500fbfd3c367 | chrisdone/intero | GhciTypes.hs | -- | Types used separate to GHCi vanilla.
module GhciTypes where
import Data.Time
import GHC
import Intero.Compat
import Outputable
-- | Info about a module. This information is generated every time a
-- module is loaded.
data ModInfo =
ModInfo {modinfoSummary :: !ModSummary
^ Summary generated by GHC . Can be u... | null | https://raw.githubusercontent.com/chrisdone/intero/fdb0550a2ddb5692d470336aa4a057717d572695/src/GhciTypes.hs | haskell | | Types used separate to GHCi vanilla.
| Info about a module. This information is generated every time a
module is loaded.
information about the module.
^ Generated set of information about all spans in the
module that correspond to some kind of identifier for
which there will be type info and/or location info.
... |
module GhciTypes where
import Data.Time
import GHC
import Intero.Compat
import Outputable
data ModInfo =
ModInfo {modinfoSummary :: !ModSummary
^ Summary generated by GHC . Can be used to access more
,modinfoSpans :: ![SpanInfo]
,modinfoInfo :: !ModuleInfo
^ Again , useful from GHC for acce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.