_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 |
|---|---|---|---|---|---|---|---|---|
d7c492a24351f64abffac7ddd276bfa1c723b8cb9474deaf43b2d8b709d87670 | tweag/webauthn | PublicKeyWithSignAlg.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE TypeSynonymInstances #-}
-- | Stability: experimental
-- This module contains a partial implementation of the
[ COSE_Key]( / doc / html / rfc8152#section-7 ) format ,
limited to what is needed for Webauthn , and in a structured way .
module Cry... | null | https://raw.githubusercontent.com/tweag/webauthn/b9341781bc82ed32a8b729036ae96f636198542f/src/Crypto/WebAuthn/Cose/PublicKeyWithSignAlg.hs | haskell | # LANGUAGE TypeSynonymInstances #
| Stability: experimental
This module contains a partial implementation of the
* COSE public Key
| A combination of a t'P.PublicKey' holding the public key data and a
acdCredentialPublicKeyBytes. This would then require parametrizing
A structured and checked representation of a
... | # LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
[ COSE_Key]( / doc / html / rfc8152#section-7 ) format ,
limited to what is needed for Webauthn , and in a structured way .
module Crypto.WebAuthn.Cose.PublicKeyWithSignAlg
PublicKeyWithSignAlg (PublicKeyWithSignAlg, Crypto.WebAuthn.Cose.PublicKeyWithSi... |
307e69fa9098deb0fd1fe09000f1b023fbff06cbd46610d5578b37353e3ec44c | LightTable/Clojure | user.cljs | (ns user)
| null | https://raw.githubusercontent.com/LightTable/Clojure/6f335ff3bec841b24a0b8ad7ca0dc126b3352a15/lein-light-nrepl/src/user.cljs | clojure | (ns user)
| |
f94e59ce58ad7b145d37ccd444cc94f895b1c54532815e5b475fefa746d62543 | racket/rhombus-prototype | info.rkt | #lang info
(define collection 'multi)
(define deps
'(["base" #:version "8.8.0.5"]
"syntax-color-lib"
"parser-tools-lib"
["scribble-lib" #:version "1.50"]
"sandbox-lib"
"testing-util-lib"
"draw-lib"
"gui-easy-lib"
"gui-lib"))
(define build-deps
'("at-exp-lib"
"math-lib"
"ra... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/8caedfc19a8ff60f6997fc9cd49b4a39d01f6890/info.rkt | racket | #lang info
(define collection 'multi)
(define deps
'(["base" #:version "8.8.0.5"]
"syntax-color-lib"
"parser-tools-lib"
["scribble-lib" #:version "1.50"]
"sandbox-lib"
"testing-util-lib"
"draw-lib"
"gui-easy-lib"
"gui-lib"))
(define build-deps
'("at-exp-lib"
"math-lib"
"ra... | |
8870360325329862bda13a5917e60c978d90662c5348df796ad3c001a3a7bb01 | practicalli/banking-on-clojure-webapp | banking_on_clojure_test.clj | (ns practicalli.banking-on-clojure-test
(:require [clojure.test :refer [deftest is testing]]
[practicalli.banking-on-clojure :as SUT]))
| null | https://raw.githubusercontent.com/practicalli/banking-on-clojure-webapp/e903e0a72f664ae8959dc5dc05fc5149cd18f422/test/practicalli/banking_on_clojure_test.clj | clojure | (ns practicalli.banking-on-clojure-test
(:require [clojure.test :refer [deftest is testing]]
[practicalli.banking-on-clojure :as SUT]))
| |
2e7b61c587cf4727c6e7c650fa62fc48ebfc8d16594ce207beb470dc2fbc8140 | isovector/design-tools | Cache.hs | # LANGUAGE LambdaCase #
module Cache (caching, hashFile) where
import Data.Hashable
import Data.Maybe
import System.Directory
initCache :: IO ()
initCache = doesDirectoryExist cacheDir >>= \case
True -> pure ()
False -> createDirectory cacheDir
caching :: (Hashable key, Show r, Read r) => key -> IO r -> IO r... | null | https://raw.githubusercontent.com/isovector/design-tools/7e8b246a62cd7a6f1b2994ab61908568feddc86b/src/Cache.hs | haskell | # LANGUAGE LambdaCase #
module Cache (caching, hashFile) where
import Data.Hashable
import Data.Maybe
import System.Directory
initCache :: IO ()
initCache = doesDirectoryExist cacheDir >>= \case
True -> pure ()
False -> createDirectory cacheDir
caching :: (Hashable key, Show r, Read r) => key -> IO r -> IO r... | |
1901d8f36130b799d0323254edec42021aa45d4b957dd61cb2bf0d240f657956 | elaforge/karya | DeriveFile_profile.hs | Copyright 2016
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Derive.DeriveFile_profile where
import qualified Data.Vector as Vector
import Util.Test
import qualified Ui.Ui as Ui
import qualified Cmd.Cmd as Cmd
import qualified Cmd.CmdTest a... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Derive/DeriveFile_profile.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
Run by hand to manually derive a score to see how long it takes. | Copyright 2016
module Derive.DeriveFile_profile where
import qualified Data.Vector as Vector
import Util.Test
import qualified Ui.Ui as Ui
import qualified Cmd.Cmd as Cmd
import qualified Cmd.CmdTest as CmdTest
import qualified Cmd.ResponderTest as ResponderTest
import qualified Cmd.Save as Save
import qualified... |
bfa5ca73a8528ebc1605e81d5d3f1c3668986e149ce8497adef78cb33a29398e | ClojureTO/JS-Workshop | project.clj | (defproject reddit-viewer "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0" :scope "provided"]
[org.clojure/clojurescript "1.10.520" :scope "provided"]
... | null | https://raw.githubusercontent.com/ClojureTO/JS-Workshop/60030e0f3f0b18dc6463d393e23b14e4971f2135/project.clj | clojure | (defproject reddit-viewer "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0" :scope "provided"]
[org.clojure/clojurescript "1.10.520" :scope "provided"]
... | |
921dc7c15ee82cc4786559bf2cc2bbbd66014a972d4c6cfc48e3ff67f3a848b9 | helium/blockchain-core | blockchain_txn_poc_request_v1.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Blockchain Transaction Create Proof of Coverage Request ==
Submitted by a gateway who wishes to initiate a PoC Challenge
%%%-------------------------------------------------------------------
-module(blockchain_txn_poc_request_v1).
... | null | https://raw.githubusercontent.com/helium/blockchain-core/0caf2295d0576c0ef803258e834bf6ec3b3e74bc/src/transactions/v1/blockchain_txn_poc_request_v1.erl | erlang | -------------------------------------------------------------------
@doc
== Blockchain Transaction Create Proof of Coverage Request ==
-------------------------------------------------------------------
--------------------------------------------------------------------
@doc
@end
----------------------------------... | Submitted by a gateway who wishes to initiate a PoC Challenge
-module(blockchain_txn_poc_request_v1).
-behavior(blockchain_txn).
-behavior(blockchain_json).
-include("blockchain_caps.hrl").
-include("blockchain_json.hrl").
-include_lib("helium_proto/include/blockchain_txn_poc_request_v1_pb.hrl").
-include("blockch... |
d13ea737a07349532215f2f197d7dfcb7a457cb7a72aa056fde0091b75e1ea1c | jarohen/yoyo | reresolve.cljc | (ns yoyo.reresolve)
(defn with-reresolve [v]
(cond
(var? v) #?(:clj
(with-reresolve (symbol (str (ns-name (:ns (meta v))))
(str (:name (meta v)))))
:cljs v)
#?@(:clj [(symbol? v) (let [v-ns (symbol (namespace v))
... | null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/core/src/yoyo/reresolve.cljc | clojure | (ns yoyo.reresolve)
(defn with-reresolve [v]
(cond
(var? v) #?(:clj
(with-reresolve (symbol (str (ns-name (:ns (meta v))))
(str (:name (meta v)))))
:cljs v)
#?@(:clj [(symbol? v) (let [v-ns (symbol (namespace v))
... | |
f7477f99ea4b98d22bf5939a03e1dbc356396fd0568bf098a6649422d86239d9 | mainej/schema-voyager | release.clj | (ns release
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]
[clojure.string :as string]))
(def ^:private lib 'com.github.mainej/schema-voyager)
(def ^:private rev-count (Integer/parseInt (b/git-count-revs nil)))
(def ^:private semantic-version "2.0")
(defn- format-versio... | null | https://raw.githubusercontent.com/mainej/schema-voyager/eaf0367ec639f5a2e9238a5b1fbbb2fc2d76d520/release.clj | clojure | The template file is Git-ignored. During a release we put it in the classes
directory so that it is available when Schema Voyager is used as a
dependency. (It's used by `standalone`, the primary interface into Schema
IMPORTANT: keep this in sync with
`schema-voyager.template.config/template-file-name`. We intentio... | (ns release
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]
[clojure.string :as string]))
(def ^:private lib 'com.github.mainej/schema-voyager)
(def ^:private rev-count (Integer/parseInt (b/git-count-revs nil)))
(def ^:private semantic-version "2.0")
(defn- format-versio... |
80fdde3c57563e831c4a78e5303cf7560666042df29cc89290fb96a21d2eb20b | aligusnet/mltool | Main.hs | module Main where
import qualified MachineLearning.Types as T
import qualified Numeric.LinearAlgebra as LA
import qualified MachineLearning as ML
import qualified MachineLearning.Classification.Binary as BC
calcAccuracy :: T.Matrix -> T.Vector -> T.Vector -> T.R
calcAccuracy x y theta = BC.calcAccuracy y yPredicted
... | null | https://raw.githubusercontent.com/aligusnet/mltool/92d74c4cc79221bfdcfb76aa058a2e8992ecfe2b/examples/logistic_regression/Main.hs | haskell | See Linear Regression sample app for dedails. | module Main where
import qualified MachineLearning.Types as T
import qualified Numeric.LinearAlgebra as LA
import qualified MachineLearning as ML
import qualified MachineLearning.Classification.Binary as BC
calcAccuracy :: T.Matrix -> T.Vector -> T.Vector -> T.R
calcAccuracy x y theta = BC.calcAccuracy y yPredicted
... |
101feba66768b916d2837668c2188c9845a8da0c50dd8e6eddfac9440cc0e185 | lisp/de.setf.xml | document-external.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - parser ; -*-
(in-package "XML-PARSER")
;;
;; this file demonstates simple parsing and serialization operations on external
;; document sources which are identified by pathname, http url, and file url.
(defParameter *external-dom* nil)
(... | null | https://raw.githubusercontent.com/lisp/de.setf.xml/827681c969342096c3b95735d84b447befa69fa6/tests/parser/document-external.lisp | lisp | Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - parser ; -*-
this file demonstates simple parsing and serialization operations on external
document sources which are identified by pathname, http url, and file url.
(setq *serialized-p-default* nil)
clear last value otherwise it may hold too much memory... |
(in-package "XML-PARSER")
(defParameter *external-dom* nil)
(defParameter *time-p-default* nil)
(format *trace-output* "~%~%various examples parsing and serializing documents from external sources:~%")
(flet ((parse-and-report (source &rest args &key (serialize-p *serialized-p-default*) trace-p (reduce-p ... |
a06f944d64899bf5794d26fbb91b4ac97c54daa35e8b994917e108a6da9ce4f6 | HealthSamurai/stresty | empty.cljc | (ns anti.empty
(:refer-clojure :exclude [empty])
(:require
[anti.util :refer [block]]
[stylo.core :refer [c]]))
(defn empty
[props]
[:div {:class (c [:space-y 2] :flex :flex-col [:p 2] :items-center)}
[:svg (merge {:width "130" :viewBox "0 0 184 152" :xmlns ""} props)
[:g {:fill "none" :fill-ru... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/130cedde6bf53e07fe25a6b0b13b8bf70846f15a/src-ui/anti/empty.cljc | clojure | (ns anti.empty
(:refer-clojure :exclude [empty])
(:require
[anti.util :refer [block]]
[stylo.core :refer [c]]))
(defn empty
[props]
[:div {:class (c [:space-y 2] :flex :flex-col [:p 2] :items-center)}
[:svg (merge {:width "130" :viewBox "0 0 184 152" :xmlns ""} props)
[:g {:fill "none" :fill-ru... | |
e7a38602500b9bfb06f098d3efc6af5148bf22b18d9840fccfbf38bd43754405 | LeventErkok/sbvPlugin | T07.hs | {-# OPTIONS_GHC -fplugin=Data.SBV.Plugin #-}
module T07 where
import Data.SBV.Plugin
{-# ANN f theorem #-}
f :: Double -> Bool
f x = x == x
| null | https://raw.githubusercontent.com/LeventErkok/sbvPlugin/b6a6e94cd237a4f64f985783931bd7656e7a6a69/tests/T07.hs | haskell | # OPTIONS_GHC -fplugin=Data.SBV.Plugin #
# ANN f theorem # |
module T07 where
import Data.SBV.Plugin
f :: Double -> Bool
f x = x == x
|
216ca0b7b29106e818eafd2088f2e85af03cc046bb5fa1c0dad03f32b2268569 | guix-science/guix-science-nonfree | bioconductor.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2019 , 2020 , 2021 , 2022 , 2023 < >
Copyright © 2020 < >
Copyright © 2023
;;;
;;; This file is NOT part of GNU Guix, but is supposed to be used with GNU
;;; Guix and thus has the same license.
;;;
GNU is free software ; you can red... | null | https://raw.githubusercontent.com/guix-science/guix-science-nonfree/848f970b2aaca2745f2d5588aa2cacbd44b59dab/guix-science-nonfree/packages/bioconductor.scm | scheme | GNU Guix --- Functional package management for GNU
This file is NOT part of GNU Guix, but is supposed to be used with GNU
Guix and thus has the same license.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope t... | Copyright © 2019 , 2020 , 2021 , 2022 , 2023 < >
Copyright © 2020 < >
Copyright © 2023
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (guix-science-nonfre... |
946b071fecd64369b7d81d2e0bd4105ed03235214b211311156a5cb3a45d134d | tonyg/kali-scheme | debug.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; Commands for debugging.
; translate
(define-command-syntax 'translate "<from> <to>"
"establish file name translation"
'(filename filename))
(define translate set-translation!)
; preview ... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/env/debug.scm | scheme | Commands for debugging.
translate
preview -- show continuations
Incestuous!
Proceed
Scrutinize the condition to ensure that it's safe to return from the
call to RAISE.
push
reset
Commands that toggle various flags.
Batch mode
Benchmark mode (i.e., inline primitives)
Break on warnings
Flush debug data base... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
(define-command-syntax 'translate "<from> <to>"
"establish file name translation"
'(filename filename))
(define translate set-translation!)
(define (preview)
(let ((cont (command-contin... |
592710d16594ab4efbb594091de280204c398c6ce0b298a10eb2534c4088954e | AccelerateHS/accelerate-examples | SASUM.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TypeOperators #-}
module Test.Imaginary.SASUM (
test_sasum,
) where
import Config
import QuickCheck.Arbitrary.Array ()
import Prelude ... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/nofib/Test/Imaginary/SASUM.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
------------------------------------------------- | # LANGUAGE ScopedTypeVariables #
module Test.Imaginary.SASUM (
test_sasum,
) where
import Config
import QuickCheck.Arbitrary.Array ()
import Prelude as P
import Data.Array.Accelerate as A
import Data... |
eab9aad9ec7fff0bb55628db7d45a62b0954ac9a6db8b44b0c308ecb91217c29 | mitchellwrosen/planet-mitchell | Monoid.hs | module Alg.Monoid
( -- * Monoid
Monoid(..)
, gmempty
) where
import Data.Monoid (Monoid(mconcat, mempty, mappend))
import Data.Semigroup.Generic (gmempty)
| null | https://raw.githubusercontent.com/mitchellwrosen/planet-mitchell/18dd83204e70fffcd23fe12dd3a80f70b7fa409b/planet-mitchell/src/Alg/Monoid.hs | haskell | * Monoid | module Alg.Monoid
Monoid(..)
, gmempty
) where
import Data.Monoid (Monoid(mconcat, mempty, mappend))
import Data.Semigroup.Generic (gmempty)
|
3a72bdaba7df439600439c12d2f10956927845ec2f131e8bfa25ffaeb3ad075e | arttuka/reagent-material-ui | contact_emergency_two_tone.cljs | (ns reagent-mui.icons.contact-emergency-two-tone
"Imports @mui/icons-material/ContactEmergencyTwoTone as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def contac... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/contact_emergency_two_tone.cljs | clojure | (ns reagent-mui.icons.contact-emergency-two-tone
"Imports @mui/icons-material/ContactEmergencyTwoTone as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def contac... | |
2de553bf49f87a20dded9e9436e431d442d6f75c7b567ee0cf8c3f2cd5d7c958 | cstar/ejabberd-old | extract_translations.erl | %%%----------------------------------------------------------------------
%%% File : extract_translations.erl
Author : < >
%%% Purpose : Auxiliary tool for interface/messages translators
Created : 23 Apr 2005 by < >
I d :
%%%----------------------------------------------------------------------... | null | https://raw.githubusercontent.com/cstar/ejabberd-old/559f8b6b0a935710fe93e9afacb4270d6d6ea00f/contrib/extract_translations/extract_translations.erl | erlang | ----------------------------------------------------------------------
File : extract_translations.erl
Purpose : Auxiliary tool for interface/messages translators
----------------------------------------------------------------------
{undefined, Something} ->
io:format("Undefined: ~p~n", [Something]);
And the ... | Author : < >
Created : 23 Apr 2005 by < >
I d :
-module(extract_translations).
-author('').
-export([start/0]).
-define(STATUS_SUCCESS, 0).
-define(STATUS_ERROR, 1).
-define(STATUS_USAGE, 2).
-include_lib("kernel/include/file.hrl").
start() ->
ets:new(translations, [named_table, publ... |
45109649b132c07749818943743cf23246e4b8ef907ed4217d9836553be5d581 | marcelog/erlagi | erlagi_debug.erl | Useful to debug the IVR .
%%%
Copyright 2012 < >
%%%
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 ... | null | https://raw.githubusercontent.com/marcelog/erlagi/fd406e9b55a04ce14c0e68d7b87bd769a3dd7a6f/src/erlagi_debug.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Useful to debug the IVR .
Copyright 2012 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(erlagi_debug).
-author("Marcelo Gornstein <>").
-github("").
-homepage("/").
-license("Apache License 2.0").
-inclu... |
9deafa87123829bf2fee913d3c06a77a271cbba14d1b56da1716c4089419700a | hexresearch/reflex-material-bootstrap | Router.hs | module Web.Reflex.Bootstrap.Router(
Route(..)
, route
) where
import Reflex
import Reflex.Dom
-- | Like 'Fix' for FRP widget, allow to endlessly jump into
-- returned routes of widgets
newtype Route t m a = Route { unRoute :: Event t (m (a, Route t m a)) }
instance (Reflex t, Functor m) => Functor (Route t m... | null | https://raw.githubusercontent.com/hexresearch/reflex-material-bootstrap/0dbf56c743f9739b4e1ec7af8a47cdd3062f85f7/src/Web/Reflex/Bootstrap/Router.hs | haskell | | Like 'Fix' for FRP widget, allow to endlessly jump into
returned routes of widgets
| Run widget that can replace itself with new widget constructed
internally in the original widget. | module Web.Reflex.Bootstrap.Router(
Route(..)
, route
) where
import Reflex
import Reflex.Dom
newtype Route t m a = Route { unRoute :: Event t (m (a, Route t m a)) }
instance (Reflex t, Functor m) => Functor (Route t m) where
fmap f (Route e) = Route $ fmap (\(a, r) -> (f a, f <$> r)) <$> e
instance Refle... |
f27ce8c6d8ed8b37521a2e14f99d2b3b967f5d7a8e7db97f8a26a138a2d538e6 | CardanoSolutions/ogmios | TxSubmission.hs | 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 /.
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
-- | Transaction submission is pretty simple & works by submitting an already
... | null | https://raw.githubusercontent.com/CardanoSolutions/ogmios/317c826d9d0388cb7efaf61a34085fc7c1b12b06/server/src/Ogmios/App/Protocol/TxSubmission.hs | haskell | | Transaction submission is pretty simple & works by submitting an already
it returns an error with some details about what went wrong. Clients must
thereby know how to construct valid transactions.
only evaluate a transaction redeemers' execution units.
@
│ Busy │◀═══════════════════════════════════════╗... | 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 /.
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
serialized and signed transaction as one single message .
In case of success... |
69c18a8f21eb452ea115fa94b27ecb283fbdeb57763a82f40ac948253add7309 | noinia/hgeometry | Alternating.hs | --------------------------------------------------------------------------------
-- |
-- Module : Data.List.Alternating
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
--------------------------------------------------------------------------------
module Data.List.Alternati... | null | https://raw.githubusercontent.com/noinia/hgeometry/187402ff1fbe4988cac2b27700ba8887cc136a22/hgeometry-combinatorial/src/Data/List/Alternating.hs | haskell | ------------------------------------------------------------------------------
|
Module : Data.List.Alternating
License : see the LICENSE file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| Co... | Copyright : ( C )
Maintainer :
module Data.List.Alternating(
Alternating(..)
, withNeighbours
, mergeAlternating
, insertBreakPoints
, reverse
) where
import Prelude hiding (reverse)
import Control.Lens
import Data.Bifoldable
import Data.Bifunctor
import Data.Bitraversable
import Data.Ex... |
e7d08ae0f997e59e1b4a5f87e80511cb92d9ded7b0657d5e317bc539f0b13bb7 | tamarin-prover/tamarin-prover | ClosedTheory.hs | module ClosedTheory (
module ClosedTheory
) where
import Control.Basics
import Control.Category
import qualified Data.Set as S
import qualified Extension.Data.Label as L
-- import qualified Data.Label.Total
import Lemma
import Rule
import Safe
import Theory.Model
import Theory.Proof
import TheoryObject
import Pre... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/958f8b1767650c06dffe4eba63a38508c9b17a7f/lib/theory/src/ClosedTheory.hs | haskell | import qualified Data.Label.Total
import Data.Typeable
import qualified Data.Label.Total
----------------------------------------------------------------------------
Closed theory querying / construction / modification
----------------------------------------------------------------------------
| Closed ... | module ClosedTheory (
module ClosedTheory
) where
import Control.Basics
import Control.Category
import qualified Data.Set as S
import qualified Extension.Data.Label as L
import Lemma
import Rule
import Safe
import Theory.Model
import Theory.Proof
import TheoryObject
import Prelude hiding (id, (.))
import Text.Pre... |
bf11cce68562c8b6f62bfe7667cc74ce0ddf3fdb8836290653132d9ab92eb687 | haskellfoundation/error-message-index | LambdaInCase.hs | module LambdaInCase where
f :: Int -> Int
f x =
case x of
a -> a
| null | https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-00482/example1/after/LambdaInCase.hs | haskell | module LambdaInCase where
f :: Int -> Int
f x =
case x of
a -> a
| |
5e6e4800c41887ea0a12b67c70b062f8e968980ec459de6373bd5d549f0a513f | rixed/ramen | RamenCompletion.ml | open Batteries
open RamenLog
open RamenHelpersNoLog
module C = RamenConf
module CliInfo = RamenConstsCliInfo
module Default = RamenConstsDefault
module Files = RamenFiles
module N = RamenName
let propose (l, h) =
String.print stdout l ;
if h <> "" then (
Char.print stdout '\t' ;
String.print stdout h) ;
... | null | https://raw.githubusercontent.com/rixed/ramen/11b1b34c3bf73ee6c69d7eb5c5fbf30e6dd2df4f/src/RamenCompletion.ml | ocaml | [basename ""] would be ".", and [basename "toto/"] would be toto ?!
let empty_help s = s, ""
TODO: run `ramen ps` in the background
TODO: run `ramen ps` in the background
??
"ramen<TAB>"
"ramen <TAB>"
"ramen [[other options]] --...<TAB>"
"ramen ... comm<TAB>"
"ramen ... command ...? <TAB>" | open Batteries
open RamenLog
open RamenHelpersNoLog
module C = RamenConf
module CliInfo = RamenConstsCliInfo
module Default = RamenConstsDefault
module Files = RamenFiles
module N = RamenName
let propose (l, h) =
String.print stdout l ;
if h <> "" then (
Char.print stdout '\t' ;
String.print stdout h) ;
... |
3a153c2f35c746f3c40ff2dc96b070ef15130612514ab54eab627376da606548 | plewto/Cadejo | registry_editor.clj | (ns cadejo.ui.scale.registry-editor
"Provides ScaleRegistry GUI"
(:require [cadejo.config :as config])
(:require [cadejo.scale.registry])
(:require [cadejo.util.path :as path])
(:require [cadejo.util.user-message :as umsg])
(:require [cadejo.ui.util.overwrite-warning])
(:require [cadejo.ui.util.undo-stack... | null | https://raw.githubusercontent.com/plewto/Cadejo/2a98610ce1f5fe01dce5f28d986a38c86677fd67/src/cadejo/ui/scale/registry_editor.clj | clojure | West registered scale list
Edit limits
Main Panels
splice labels
update splice source & destination labels
(ss/listen jb-help :action cadejo.ui.util.help/help-listener) | (ns cadejo.ui.scale.registry-editor
"Provides ScaleRegistry GUI"
(:require [cadejo.config :as config])
(:require [cadejo.scale.registry])
(:require [cadejo.util.path :as path])
(:require [cadejo.util.user-message :as umsg])
(:require [cadejo.ui.util.overwrite-warning])
(:require [cadejo.ui.util.undo-stack... |
eb5bf9ea48649ec89815716a7658e03f087c940c5c22da59f8280b82794a70c2 | nikita-volkov/ptr-poker | Ffi.hs | {-# LANGUAGE UnliftedFFITypes #-}
module PtrPoker.Ffi where
import Foreign.C
import PtrPoker.Prelude
foreign import ccall unsafe "static int_dec"
pokeIntInDec :: CInt -> Ptr Word8 -> IO (Ptr Word8)
foreign import ccall unsafe "static long_long_int_dec"
pokeLongLongIntInDec :: CLLong -> Ptr Word8 -> IO (Ptr Word... | null | https://raw.githubusercontent.com/nikita-volkov/ptr-poker/cc1f0ec6411833e82308e552ab69e10c0c9a3a52/library/PtrPoker/Ffi.hs | haskell | # LANGUAGE UnliftedFFITypes # |
module PtrPoker.Ffi where
import Foreign.C
import PtrPoker.Prelude
foreign import ccall unsafe "static int_dec"
pokeIntInDec :: CInt -> Ptr Word8 -> IO (Ptr Word8)
foreign import ccall unsafe "static long_long_int_dec"
pokeLongLongIntInDec :: CLLong -> Ptr Word8 -> IO (Ptr Word8)
foreign import ccall unsafe "s... |
64dde1727b0c20548897291715c7c7027fd4dd3d08e9255e0875a2109bb8761c | stevebleazard/ocaml-jsonxt | extended_stream.mli | * [ Extended_stream ] supports parsing and writing JSON data that
conforms to the { ! type : Json_stream . Extended.json } type as a stream
of { ! type : Json_stream . Extended.json } objects . This supports non - standard
JSON types including integer as well as tuples and variants introduced
... | null | https://raw.githubusercontent.com/stevebleazard/ocaml-jsonxt/fe982b6087dd76ca003d8fbc19ae9a519f54b828/lib/extended_stream.mli | ocaml | * [ Extended_stream ] supports parsing and writing JSON data that
conforms to the { ! type : Json_stream . Extended.json } type as a stream
of { ! type : Json_stream . Extended.json } objects . This supports non - standard
JSON types including integer as well as tuples and variants introduced
... | |
96349e461d00b8237e2db73f04571ebf8e966f989e876e91721c920063784539 | franklindyer/cs357-ta-materials | recitation_week_5_solution.rkt | #lang racket
;; Map and high orders functions, a bit of apply at the end
;;;; Recursive definition of map
(define mymap
(lambda (f ls)
(if (null? ls)
'()
(cons
(f (car ls))
(mymap f (cdr ls))))))
;;;; (map f) . (map g) \equiv (map (compose f g))
;;;; Examples using map
(mymap
(lambda (x) (* x x))
'(1... | null | https://raw.githubusercontent.com/franklindyer/cs357-ta-materials/67334cadc03e547c3490147091106362cc4b8194/scheme/recitations/week5/recitation_week_5_solution.rkt | racket | Map and high orders functions, a bit of apply at the end
Recursive definition of map
(map f) . (map g) \equiv (map (compose f g))
Examples using map
More examples using map
(name . (grade . is_cool?))
Remember: (map f) . (map g) \equiv (map (compose f g))
Could I have used length instead? Yes, actually.
Recita... | #lang racket
(define mymap
(lambda (f ls)
(if (null? ls)
'()
(cons
(f (car ls))
(mymap f (cdr ls))))))
(mymap
(lambda (x) (* x x))
'(1 2 3 4))
(mymap
(lambda (x) (+ x 1))
(mymap
(lambda (x) (* x x))
'(1 2 3 4)))
(mymap
(lambda (x) (+ (* x x) 1))
'(1 2 3 4))
(define student_database
'(
... |
a40da5622d257a74f489bfdd417f8e94ad7e2f6d86d02eeaed856acc5f6b02be | mbutterick/fontland | head.rkt | #lang debug racket/base
(require xenomorph
racket/date)
(provide head)
#|
approximates
|#
` name ` table dates are seconds since 1/1/1904 ( Mac file convention )
whereas Racket / posix tracks since 1/1/1970
so we adjust with the difference in seconds
(define mac-to-posix-delta 2082844800)
(define hfs... | null | https://raw.githubusercontent.com/mbutterick/fontland/e50e4c82f58e2014d64e87a14c1d29b546fb393b/fontland/table/head.rkt | racket |
approximates
set by font manufacturer
for all glyph bounding boxes
for all glyph bounding boxes
for all glyph bounding boxes
for all glyph bounding boxes
smallest readable size in pixels
0 for current format
used in loca table | #lang debug racket/base
(require xenomorph
racket/date)
(provide head)
` name ` table dates are seconds since 1/1/1904 ( Mac file convention )
whereas Racket / posix tracks since 1/1/1970
so we adjust with the difference in seconds
(define mac-to-posix-delta 2082844800)
(define hfs-seconds (x:int #:si... |
9f0a56bc4211bafc6a1c3addfbf8067634b04086633d81652ec5b006d456206d | tnelson/Forge | fancyBoundsTests.rkt | #lang forge
sig A { r: set A }
sig B { s: set B }
one sig C {}
inst define_s {
s = B->(Bob+Bill) -- sees the B already defined
}
inst myInst {
r is cotree
B = Bob+Bill+Ben
define_s -- call define_s
}
inst rlin {
r is linear
}
test expect foo {
t0: { some r } for exactly myInst, rlin,... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/examples/fancyBoundsTests.rkt | racket | #lang forge
sig A { r: set A }
sig B { s: set B }
one sig C {}
inst define_s {
s = B->(Bob+Bill) -- sees the B already defined
}
inst myInst {
r is cotree
B = Bob+Bill+Ben
define_s -- call define_s
}
inst rlin {
r is linear
}
test expect foo {
t0: { some r } for exactly myInst, rlin,... | |
b7206b49626a033914987d16f7156c666711984f1201d054d953c36e72de23c3 | marick/lein-midje | core_test.clj | (ns {{name}}.core-test
(:require [midje.sweet :refer :all]
[{{name}}.core :refer :all]))
(println "You should expect to see three failures below.")
(facts "about `first-element`"
(fact "it normally returns the first element"
(first-element [1 2 3] :default) => 1
(first-element '(1 2 3) :defaul... | null | https://raw.githubusercontent.com/marick/lein-midje/71a98ad1da2b94ed7050cc6b99be798ef3b3837e/src/leiningen/new/midje/core_test.clj | clojure | (ns {{name}}.core-test
(:require [midje.sweet :refer :all]
[{{name}}.core :refer :all]))
(println "You should expect to see three failures below.")
(facts "about `first-element`"
(fact "it normally returns the first element"
(first-element [1 2 3] :default) => 1
(first-element '(1 2 3) :defaul... | |
7b06e258e8eb0bc0ca6195a55a6f7e23e2453249556557bc9f4f710dd03f137a | jdsandifer/AutoLISP | TRYOUT.lsp | ;;;;;;;[ Test ];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Simple file for testing stuff. ;;
;; ;;
;;::::::::::::::::::::::::::::::::::::::::::::::;;
;; ;;
Author : ... | null | https://raw.githubusercontent.com/jdsandifer/AutoLISP/054c8400fae84c223c3113e049a1ab87d374ba37/TRYOUT.lsp | lisp | [ Test ];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
Simple file for testing stuff. ;;
;;
::::::::::::::::::::::::::::::::::::::::::::::;;
;;
;
;
... |
(defun test ( / *error*)
(setq *error* ErrorHandler)
(entmake '((0 . "BLOCK") (8 . "0") (70 . 0) (10 0.0 0.0 0.0) (2 . "TEST1")))
(entmake '((0 . "CIRCLE") (8 . "0") (10 1.875 -1.875 0.0) (40 . 0.549375)))
(entmake '((0 . "CIRCLE") (8 . "0") (10 1.875 -1.875 0.0) (40 . 0.31875)))
(entmake '((0 . "LWPOLYLINE") ... |
839bf944d537025e39487739d060c0710a8e0cad79a257f50e8378892ade3942 | EarnestResearch/yambda | SNS.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module AWS.Lambda.Event.SNS where
import AWS.Lamb... | null | https://raw.githubusercontent.com/EarnestResearch/yambda/b1f45e42447c08d7da4b3f470bdb849c9ea1b200/core/src/AWS/Lambda/Event/SNS.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TemplateHaskell # | # LANGUAGE DuplicateRecordFields #
module AWS.Lambda.Event.SNS where
import AWS.Lambda.Encoding
import AWS.Lambda.Event.JSON
import Control.Lens
import Data.Aeson
import Data.HashMap.Strict
import Data.Text (Text)
import GHC.Generics
newtype SNSEvent = SNSEvent { _records :: [Record] }
deriving (Eq, Generic, Show... |
ebacc1700615d64cd0409a33e4b915e62f0fa316074742370c949b9c53daa6e7 | istathar/vaultaire | CommandRunners.hs | --
-- Data vault for metrics
--
Copyright © 2013 - 2014 Anchor Systems , Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
the 3 - clause BSD licence .
--... | null | https://raw.githubusercontent.com/istathar/vaultaire/75603ea614b125568ca871e88280bd29b3aef4ba/src/CommandRunners.hs | haskell |
Data vault for metrics
The code in this file, and the program it is a part of, is
made available to you by its authors as open source software:
you can redistribute it and/or modify it under the terms of
# LANGUAGE RankNTypes # | Copyright © 2013 - 2014 Anchor Systems , Pty Ltd and Others
the 3 - clause BSD licence .
module CommandRunners
(
runDumpDayMap,
runRegisterOrigin
) where
import Control.Exception (throw)
import Control.Monad
import qualified Data.ByteString.Char8 as S
import Data.Map (fromAscList)
import Data.Word (Word6... |
5e7ab7ad8fc31519b29679b0f543618aa3850bc0e058110813ab62d2f7063885 | nominolo/lambdachine | SumMemLoad.hs | # LANGUAGE NoImplicitPrelude , MagicHash #
-- RUN: %bc_vm_chk
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.SumMemLoad where
import GHC.Prim
import GHC.Types
data X = X Int# Int# X
xs = X 1# 2# (X 3# 4# xs)
loop :: Int# -> Int# -> X -> Int#
loop acc s (X inc1 dec1 x') =
if isTrue# (s <=# 0#) then ... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/SumMemLoad.hs | haskell | RUN: %bc_vm_chk | # LANGUAGE NoImplicitPrelude , MagicHash #
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.SumMemLoad where
import GHC.Prim
import GHC.Types
data X = X Int# Int# X
xs = X 1# 2# (X 3# 4# xs)
loop :: Int# -> Int# -> X -> Int#
loop acc s (X inc1 dec1 x') =
if isTrue# (s <=# 0#) then acc else
loop (... |
0e606644b46c4b5155b5b992108788243b5ffb00615c454aeeec2078956b438f | dinosaure/carton | thin.ml | open Carton
type ('uid, 's) light_load = 'uid -> ((kind * int), 's) io
type ('uid, 's) heavy_load = 'uid -> (Dec.v, 's) io
type optint = Optint.t
let blit_from_string src src_off dst dst_off len =
Bigstringaf.blit_from_string src ~src_off dst ~dst_off ~len
[@@inline]
let src = Logs.Src.create "thin"
module Log = (... | null | https://raw.githubusercontent.com/dinosaure/carton/8cb8b3685fab477594b2d83c70b2fc965d1d59b9/lib/thin.ml | ocaml | open Carton
type ('uid, 's) light_load = 'uid -> ((kind * int), 's) io
type ('uid, 's) heavy_load = 'uid -> (Dec.v, 's) io
type optint = Optint.t
let blit_from_string src src_off dst dst_off len =
Bigstringaf.blit_from_string src ~src_off dst ~dst_off ~len
[@@inline]
let src = Logs.Src.create "thin"
module Log = (... | |
8da97c2c3685041ab84c733bd4cab878787677a095d3ef9a0be2b2241facf489 | xh4/web-toolkit | accessor.lisp | (in-package :uri)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun parse-lambda-list-keywords (lambda-list)
(let ((keyword-specs (fourth
(multiple-value-list
(parse-ordinary-lambda-list lambda-list)))))
(loop for ((keyword-name name)) in key... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/uri/accessor.lisp | lisp | (in-package :uri)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun parse-lambda-list-keywords (lambda-list)
(let ((keyword-specs (fourth
(multiple-value-list
(parse-ordinary-lambda-list lambda-list)))))
(loop for ((keyword-name name)) in key... | |
d94f719a9a23e93578154f6e94b4bb8b43121f91a36d596591ce5e1c5d4cbb25 | krisajenkins/petrol | core.cljs | (ns petrol-examples.counter.core
(:require [petrol.core :as petrol]
[reagent.core :as reagent]
[petrol-examples.counter.processing]
[petrol-examples.counter.view :as view]))
(def initial-state
{:counter 0})
(defonce !app
(reagent/atom initial-state))
figwheel reload - hook... | null | https://raw.githubusercontent.com/krisajenkins/petrol/607166ab48cf6193b6ad00bcd63bd3ff7f3958f7/examples/src/petrol-examples/counter/core.cljs | clojure | (ns petrol-examples.counter.core
(:require [petrol.core :as petrol]
[reagent.core :as reagent]
[petrol-examples.counter.processing]
[petrol-examples.counter.view :as view]))
(def initial-state
{:counter 0})
(defonce !app
(reagent/atom initial-state))
figwheel reload - hook... | |
0b925f52a4b8497369e3944974fff718d9768bcb1d6ba9c6f340927f59fb3183 | graninas/Functional-Design-and-Architecture | ArrowDSL.hs | {-# LANGUAGE Arrows #-}
module ArrowDSL where
import Control.Arrow
import Control.Category
import Control.Monad.Free
import Prelude hiding ((.))
import ControllerDSL as C
import InfrastructureDSL as I
import ScriptingDSL as S
import Control
import ArrEff
-- arrow type
type FlowArr b c = ArrEffFree Control b c
data... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/1736abc16d3e4917fc466010dcc182746af2fd0e/First-Edition/BookSamples/CH04/ArrowizedDSL/ArrowDSL.hs | haskell | # LANGUAGE Arrows #
arrow type | module ArrowDSL where
import Control.Arrow
import Control.Category
import Control.Monad.Free
import Prelude hiding ((.))
import ControllerDSL as C
import InfrastructureDSL as I
import ScriptingDSL as S
import Control
import ArrEff
type FlowArr b c = ArrEffFree Control b c
data ValidationResult = Success
... |
24d09e70f7ade23493f815159b0b8612e40981dfcfce93b1a1c3e0025b188fe9 | dparis/cooler | connection_options.clj | (ns cooler.schemas.redis.connection-options
"Schema which validates a Redis ConnectionOptions map."
(:require [cooler.util :as u]
[schema.core :as s]))
(s/defschema ^:private PoolConfig
{(s/optional-key :min-idle-per-key) s/Int
(s/optional-key :max-idle-per-key) s/In... | null | https://raw.githubusercontent.com/dparis/cooler/38b2efb3c4efb32d1b3d03c70176f690555f94d1/src/cooler/schemas/redis/connection_options.clj | clojure | (ns cooler.schemas.redis.connection-options
"Schema which validates a Redis ConnectionOptions map."
(:require [cooler.util :as u]
[schema.core :as s]))
(s/defschema ^:private PoolConfig
{(s/optional-key :min-idle-per-key) s/Int
(s/optional-key :max-idle-per-key) s/In... | |
b8e67998308f73e9acf66b0885f4e26b460c3a8d075d876c49524c927be20fc3 | input-output-hk/ouroboros-network | ChainUpdates.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
-- | Generate sequences of updates to model an evolving chain
module Test.Util.ChainUpdates (
ChainUpdate (..)
, UpdateBehavior (..)
, genChainUpdates
, toChainUpdates
-- * Tests
, prop_genChainUpdates
)... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2793b6993c8f6ed158f432055fa4ef581acdb661/ouroboros-consensus-test/src/Test/Util/ChainUpdates.hs | haskell | | Generate sequences of updates to model an evolving chain
* Tests
| Roll back to the given 'Point', and then /immediately/ roll
------------------------------------------------------------------------------
Generating ChainUpdates
------------------------------------------------------------------------------
| W... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
module Test.Util.ChainUpdates (
ChainUpdate (..)
, UpdateBehavior (..)
, genChainUpdates
, toChainUpdates
, prop_genChainUpdates
) where
import Control.Monad.State.Strict
import Test.Qu... |
f735c6c397956648efa4537bfed395b75222cee417388f8e452907de28267e39 | ucsd-progsys/nate | helloworld.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/otherlibs/labltk/examples_camltk/helloworld.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
b7947f6087a1b1908f24710bdbe9c0d680502f57ad8de0616a4302e8c86eeaf0 | ocamllabs/ocaml-modular-implicits | t070-branchifnot.ml | open Lib;;
if false then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST0
10 BRANCHIFNOT 17
12 GETGLOBAL Not_found
14 MAKEBLOCK1 0
16 RAISE
17 ATOM0
18 SETGLOBAL T070 - branchifnot
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t070-branchifnot.ml | ocaml | open Lib;;
if false then raise Not_found;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONST0
10 BRANCHIFNOT 17
12 GETGLOBAL Not_found
14 MAKEBLOCK1 0
16 RAISE
17 ATOM0
18 SETGLOBAL T070 - branchifnot
... | |
c987d034d682df3e822d2762fb1249d362d2db3117ab5c4284922e68261a8712 | chenyukang/eopl | 26.scm | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
(load-relative "./base/subst.scm")
(load-relative "./base/inferred-cases.scm")
(load-relative "./base/data-structures.scm")
(load-relative "./base/equal-type.scm")
(load-relative "./base/store.scm")
Extend the inferencer to handle EXPLICIT - REFS ,... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch7/26.scm | scheme | begin new stuff
end new stuff
new stuff
sllgen boilerplate ;;;;;;;;;;;;;;;;
new stuff, use hashtable as substitution.
new implementation of subst
syntactic tests and observers ;;;;;;;;;;;;;;;;
type-to-external-form : Type -> List
unifier : Type * Type * Subst * Exp -> void OR Fails
no-occurrence? : Tvar * Typ... | (load-relative "../libs/init.scm")
(load-relative "./base/test.scm")
(load-relative "./base/subst.scm")
(load-relative "./base/inferred-cases.scm")
(load-relative "./base/data-structures.scm")
(load-relative "./base/equal-type.scm")
(load-relative "./base/store.scm")
Extend the inferencer to handle EXPLICIT - REFS ,... |
efe5f5cb1de5aefb9ff4387665632974eac880b975faf4cc2d2c1163320bb290 | lojic/LearningRacket | day16.rkt | #lang racket
(require threading)
(define (parse-input fname)
(match-let ([ (list fields ticket others) (~> (string-split (file->string fname) "\n\n")
(map (curryr string-split "\n") _)) ])
(list
(map parse-field fields) (parse-ticket (cadr ticket)) (map parse-... | null | https://raw.githubusercontent.com/lojic/LearningRacket/eb0e75b0e16d3e0a91b8fa6612e2678a9e12e8c7/advent-of-code-2020/day16.rkt | racket | #lang racket
(require threading)
(define (parse-input fname)
(match-let ([ (list fields ticket others) (~> (string-split (file->string fname) "\n\n")
(map (curryr string-split "\n") _)) ])
(list
(map parse-field fields) (parse-ticket (cadr ticket)) (map parse-... | |
164981e8e0552efa97b6cbb1c40894143011caea3c45efb42027478fd6987bb2 | dradtke/Lisp-Text-Editor | network.lisp | ;;;
;;; Low-level networking implementations
;;;
(in-package #:ql-network)
(definterface host-address (host)
(:implementation t
host)
(:implementation sbcl
(ql-sbcl:host-ent-address (ql-sbcl:get-host-by-name host))))
(definterface open-connection (host port)
(:documentation "Open and return a network c... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/quicklisp/network.lisp | lisp |
Low-level networking implementations
|
(in-package #:ql-network)
(definterface host-address (host)
(:implementation t
host)
(:implementation sbcl
(ql-sbcl:host-ent-address (ql-sbcl:get-host-by-name host))))
(definterface open-connection (host port)
(:documentation "Open and return a network connection to HOST on the
given PORT.")
(:impl... |
3bd63ed15dc291620f317516a730709ab94083e6e16dd359fb0b47062ca6f776 | FranklinChen/hugs98-plus-Sep2006 | PolyLazy.hs | module Text.ParserCombinators.PolyLazy
* A Parser datatype parameterised on arbitrary token type .
Parsers do not return explicit failure . An exception is
-- raised instead. This allows partial results to be returned
-- before a full parse is complete.
datatype , instance of : Functor , Monad
... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/HaXml/src/Text/ParserCombinators/PolyLazy.hs | haskell | raised instead. This allows partial results to be returned
before a full parse is complete.
:: String -> Parser t a
* Combinators
** primitives
:: (t->Bool) -> Parser t t
** error-handling
:: Int -> String -> String
** choices
** sequences
-> Parser t a -> Parser t [a]
-> Parser t a
** re-parsin... | module Text.ParserCombinators.PolyLazy
* A Parser datatype parameterised on arbitrary token type .
Parsers do not return explicit failure . An exception is
datatype , instance of : Functor , Monad
: : t a - > [ t ] - > ( a , [ t ] )
: : t a - > Parser t a
: : t t
: : t ( a->b ) - > Parser t a - > ... |
f887b3cbb7b65c97b8b1b5bdb1cccdd59876c63d4848805186ac6dc1a6ae9712 | brianhempel/maniposynth | ast.ml | open Parsetree
open Util
type program = structure_item list (* === structure *)
type everything =
{ vbs : value_binding list
; exps : expression list
; pats : pattern list
; struct_items : structure_item list
}
let dflt_iter = Ast_iterator.default_iterator
let dflt_mapper = Ast_m... | null | https://raw.githubusercontent.com/brianhempel/maniposynth/479e8eef740ab02ea3baa60a7b39ab61e9cde6a8/shared/ast.ml | ocaml | === structure
Fresh positions are given new, negative values.
let none = Location.none
Makes a fresh loc
Uses Location.none
Use Loc.ident for a fresh loc
Follow links/substs to a regular type
See printtyp.ml for "safe_repr" version that catches cycles
For cache keying. Faster than unification.
?(show... | open Parsetree
open Util
type everything =
{ vbs : value_binding list
; exps : expression list
; pats : pattern list
; struct_items : structure_item list
}
let dflt_iter = Ast_iterator.default_iterator
let dflt_mapper = Ast_mapper.default_mapper
type node =
| Exp of expression... |
90e9fe13459b2385a8dc6e16f1b811bd680c70169a2157088542648333b53121 | nikita-volkov/rerebase | Types.hs | module GHC.IO.Encoding.Types
(
module Rebase.GHC.IO.Encoding.Types
)
where
import Rebase.GHC.IO.Encoding.Types
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/GHC/IO/Encoding/Types.hs | haskell | module GHC.IO.Encoding.Types
(
module Rebase.GHC.IO.Encoding.Types
)
where
import Rebase.GHC.IO.Encoding.Types
| |
888e893df21a246a3051596505c53191a2dfcf34a430f69f59155cf737120aee | ocaml/ocaml-lsp | LibTypes.mli | type t = string
| null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/e57b34d129fe36e86cb1ac6aad6c53b2e1901b49/ocaml-lsp-server/test/e2e/__tests__/workspace_symbol_A/lib/LibTypes.mli | ocaml | type t = string
| |
e3ef64a000f3b6826d93de344df625147d9e61ecec15378cf0aa86fc7ea706a3 | manuel-serrano/hop | slider.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / widget / slider.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/widget/slider.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The HOP implementation of sliders. */
*===========================... | * serrano / prgm / project / hop / hop / widget / slider.scm * /
* Author : * /
* Creation : Thu Aug 18 10:01:02 2005 * /
* Last change : Sun Apr 28 10:59:26 2019 ( serrano ) * /
* Copy... |
5f479e00fc34b4504911a6fa99ef56819260bf7dd07e0e5f9cd53921162fa350 | savonet/ocaml-mm | mm_pulseaudio.mli | open Mm_audio
class writer : string -> string -> int -> int -> Audio.IO.Writer.t
| null | https://raw.githubusercontent.com/savonet/ocaml-mm/916b007cc7cc4bf250e6f71203bb36afb4ed8634/external/mm_pulseaudio.mli | ocaml | open Mm_audio
class writer : string -> string -> int -> int -> Audio.IO.Writer.t
| |
ff760e3dd27cef292c3b532166f60ab8d6e609be3fb04ff4edbb0f3a8984d833 | metabase/metabase | dimension.clj | (ns metabase.models.dimension
"Dimensions are used to define remappings for Fields handled automatically when those Fields are encountered by the
Query Processor. For a more detailed explanation, refer to the documentation in
`metabase.query-processor.middleware.add-dimension-projections`."
(:require
[metaba... | null | https://raw.githubusercontent.com/metabase/metabase/2d22d3af60fb2c225b60a950a96e21eb7376865d/src/metabase/models/dimension.clj | clojure |
:internal
:external
------------------------------------------------- Serialization --------------------------------------------------
We can reuse the [[serdes.base/load-one!]] logic by implementing [[serdes.base/load-xform]] though.
see Field 's load - one ! | (ns metabase.models.dimension
"Dimensions are used to define remappings for Fields handled automatically when those Fields are encountered by the
Query Processor. For a more detailed explanation, refer to the documentation in
`metabase.query-processor.middleware.add-dimension-projections`."
(:require
[metaba... |
de78416f54023a180a9d57866e52a135712e816705c7f6905496f35cffd5020f | igrishaev/dynamodb | time.clj | (ns dynamodb.time
(:import
java.time.Instant
java.time.ZoneId
java.time.format.DateTimeFormatter))
(def ^DateTimeFormatter
aws-formatter
(-> "yyyyMMdd'T'HHmmss'Z'"
(DateTimeFormatter/ofPattern)
(.withZone (ZoneId/of "UTC"))))
(defn aws-now []
(.format aws-formatter (Instant/now)))
| null | https://raw.githubusercontent.com/igrishaev/dynamodb/0a0fef4232daaba91ff9d16c7638cbb0d9aa36bb/src/dynamodb/time.clj | clojure | (ns dynamodb.time
(:import
java.time.Instant
java.time.ZoneId
java.time.format.DateTimeFormatter))
(def ^DateTimeFormatter
aws-formatter
(-> "yyyyMMdd'T'HHmmss'Z'"
(DateTimeFormatter/ofPattern)
(.withZone (ZoneId/of "UTC"))))
(defn aws-now []
(.format aws-formatter (Instant/now)))
| |
97f0cba9c548aa454d269fdb3ce0ef3bcafc8227511e3992d1ca5a84dbe51ab3 | avsm/mirage-duniverse | text_graph.mli | open! Core_kernel
* This module renders text graphs to visualize data on the terminal . A typical text
graph looks like a bar graph as shown below :
{ [
label1 3786 |----+----1 - ---+----2 - --- ... ----+----7 - ---+----8 - ---+----9 - ---+----|
label2 3653 |----+----1 - ---+----2 - --- ... --... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/textutils_kernel/src/text_graph.mli | ocaml | * Renders a text graph given labels and values. The list should be non-empty and the
specified values must be positive numbers. Setting narrow enables narrower graphs. | open! Core_kernel
* This module renders text graphs to visualize data on the terminal . A typical text
graph looks like a bar graph as shown below :
{ [
label1 3786 |----+----1 - ---+----2 - --- ... ----+----7 - ---+----8 - ---+----9 - ---+----|
label2 3653 |----+----1 - ---+----2 - --- ... --... |
f1da0a8929645b33afce9c8136393625aa0ba148c411d590adb54191cebc18fb | oliyh/slacky | integration_test.clj | (ns slacky.integration-test
(:require [clj-http.client :as http]
[clojure.core.async :as a]
[clojure.string :as string]
[clojure.test :refer [deftest testing is use-fixtures]]
[conjure.core :as cj]
[slacky
[accounts :as accounts]
[m... | null | https://raw.githubusercontent.com/oliyh/slacky/909110e0555b7e443c3cf014c7c34b00b31c1a18/test/clj/slacky/integration_test.clj | clojure | (ns slacky.integration-test
(:require [clj-http.client :as http]
[clojure.core.async :as a]
[clojure.string :as string]
[clojure.test :refer [deftest testing is use-fixtures]]
[conjure.core :as cj]
[slacky
[accounts :as accounts]
[m... | |
ac27dbff76ab1211a3926bc2e37073fc781961541a98f00f71d3e5db0fd37f2c | reborg/clojure-essential-reference | 2.clj | (import '[java.sql ResultSet ResultSetMetaData])
< 1 >
(reify
ResultSet
(getMetaData [_]
(reify
ResultSetMetaData
(getColumnCount [_] (count attrs))
(getColumnLabel [_ idx] (nth attrs (dec idx)))))
(next [_] true)
(close [_])
(^Object getObject [_ ^int idx] (rand-i... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Sequences/OtherGenerators/resultset-seq/2.clj | clojure | (import '[java.sql ResultSet ResultSetMetaData])
< 1 >
(reify
ResultSet
(getMetaData [_]
(reify
ResultSetMetaData
(getColumnCount [_] (count attrs))
(getColumnLabel [_ idx] (nth attrs (dec idx)))))
(next [_] true)
(close [_])
(^Object getObject [_ ^int idx] (rand-i... | |
12a1e5b49c808e7f6fbe6956c5069e3940168a3560142b26afa5ba3e0bec41c5 | Interlisp/medley | construct.lisp | -*-Mode : LISP ; Package:(CLOS LISP 1000 ) ; ; Syntax : Common - lisp -*-
;;;
;;; *************************************************************************
Copyright ( c ) 1991 Venue
;;; All rights reserved.
;;; *************************************************************************
;;;
;;;
;;; This file defines t... | null | https://raw.githubusercontent.com/Interlisp/medley/f0b9ce3daeef95543e452ea4c59cb8e683295035/obsolete/clos/2.0/construct.lisp | lisp | Package:(CLOS LISP 1000 ) ; ; Syntax : Common - lisp -*-
*************************************************************************
All rights reserved.
*************************************************************************
This file defines the defconstructor and other make-instance optimization
mechanisms... | Copyright ( c ) 1991 Venue
(in-package 'clos)
call make - instance with a symbol as the first argument . The semantics
CLOS with a way of noticing these calls to make - instance so that it can
optimize them . Specific ports of CLOS could just have their compiler
special defconstructor facility is the be... |
726001c6d839e05a1aabeb781ea11efdd3241f041cb871536adea4419bffbc6f | mu-chaco/ReWire | twostate.hs | data Bit = Zero | One
data W8 = W8 Bit Bit Bit Bit Bit Bit Bit Bit
grunt :: StT W8 (StT W8 I) ()
grunt = do
r0 <- get
lift (put r0)
incr :: ReT Bit W8 (StT W8 (StT W8 I)) ()
incr = do
--r0 <- lift get
--lift (lift (put r0))
lift grunt
signal (W8 Zero Zero Zero Zero Zero Zero Zero Zero)
... | null | https://raw.githubusercontent.com/mu-chaco/ReWire/a8dcea6ab0989474988a758179a1d876e2c32370/cruft/test/complete/two/twostate.hs | haskell | r0 <- lift get
lift (lift (put r0)) | data Bit = Zero | One
data W8 = W8 Bit Bit Bit Bit Bit Bit Bit Bit
grunt :: StT W8 (StT W8 I) ()
grunt = do
r0 <- get
lift (put r0)
incr :: ReT Bit W8 (StT W8 (StT W8 I)) ()
incr = do
lift grunt
signal (W8 Zero Zero Zero Zero Zero Zero Zero Zero)
incr
start :: ReT Bit W8 I (((),W8),W8)
start = ... |
a1e7bbb97c16a77dd7d8b86694a82541e9250c56420ce154622491b3fa541fb6 | tweag/ormolu | arguments.hs | {-# LANGUAGE RankNTypes #-}
functionName
:: (C1, C2, C3, C4, C5)
=> a
-> b
-> (forall a.
(C6, C7)
=> LongDataTypeName
-> a
-> AnotherLongDataTypeName
-> b
-> c
)
-> (c -> d)
-> (a, b, c, d)
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/signature/type/arguments.hs | haskell | # LANGUAGE RankNTypes # |
functionName
:: (C1, C2, C3, C4, C5)
=> a
-> b
-> (forall a.
(C6, C7)
=> LongDataTypeName
-> a
-> AnotherLongDataTypeName
-> b
-> c
)
-> (c -> d)
-> (a, b, c, d)
|
72e3d545b68dd9241f3b4178c5e4dbc298995d3e3652d0a9b529de795e96921d | hanshuebner/bknr-web | feed-tags.lisp | (in-package :bknr-user)
(enable-interpol-syntax)
(define-bknr-tag feed-keyword-choose-dialog
(&key (size "4") (name "keyword") (create nil))
(let ((size (or (parse-integer size :junk-allowed t) 1)))
(keyword-choose-dialog (all-feed-keywords)
:size size :name name :create create)))
(define-bknr-tag fe... | null | https://raw.githubusercontent.com/hanshuebner/bknr-web/5c30b61818a2f02f6f2e5dc69fd77396ec3afc51/modules/feed/feed-tags.lisp | lisp | XXX ieeks | (in-package :bknr-user)
(enable-interpol-syntax)
(define-bknr-tag feed-keyword-choose-dialog
(&key (size "4") (name "keyword") (create nil))
(let ((size (or (parse-integer size :junk-allowed t) 1)))
(keyword-choose-dialog (all-feed-keywords)
:size size :name name :create create)))
(define-bknr-tag fe... |
36bebc9607b78925b4d388520165b1dc92aa5bd199ba0679135fb4dbc5e1adc7 | pfdietz/ansi-test | random.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Sep 6 15:47:42 2003
Contains : Tests of
(deftest random.error.1
(signals-error (random) program-error)
t)
(deftest random.error.2
(signals-error (random 10 *random-state* nil) program-error)
t)
(deftest random.error.3
(check-type-error #'r... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/numbers/random.lsp | lisp | -*- Mode: Lisp -*-
Do more statistical tests here | Author :
Created : Sat Sep 6 15:47:42 2003
Contains : Tests of
(deftest random.error.1
(signals-error (random) program-error)
t)
(deftest random.error.2
(signals-error (random 10 *random-state* nil) program-error)
t)
(deftest random.error.3
(check-type-error #'random (typef '(real (0))... |
369a00fa100f1383be26d5c65d9b500bdf6eaf20cfa2e7f9c2ccf288f9544942 | clojurewerkz/meltdown | types.clj | (ns clojurewerkz.meltdown.types)
(defprotocol Foldable
(fold [coll f]))
(defprotocol Functor
(fmap [coll f]))
(defprotocol Monoid
(mempty [_])
(mappend [old new]))
(defn mconcat
[m coll]
(reduce mappend (mempty m) coll))
;;
;; Monoid
;;
(extend-protocol Monoid
clojure.lang.PersistentVector
(mempty... | null | https://raw.githubusercontent.com/clojurewerkz/meltdown/58d50141bb35b4a5abf59dcb13db9f577b6b3b9f/src/clojure/clojurewerkz/meltdown/types.clj | clojure |
Monoid
Functor
Foldable
| (ns clojurewerkz.meltdown.types)
(defprotocol Foldable
(fold [coll f]))
(defprotocol Functor
(fmap [coll f]))
(defprotocol Monoid
(mempty [_])
(mappend [old new]))
(defn mconcat
[m coll]
(reduce mappend (mempty m) coll))
(extend-protocol Monoid
clojure.lang.PersistentVector
(mempty [_] [])
(mapp... |
28bc51483f5fac6c3229903463b457a7318c506d4079b568a7401cf5036dcbf5 | noteed/mojito | Inferencer.hs | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleContexts #
module Language.Mojito.Inference.Cardelli.Inferencer where
import Control.Monad.Except
import Control.Monad.Identity
import Control.Monad.State
import Control.Monad.Writer
import Language.Mojito.Syntax.Types
import Language.Mojito.Inference.Substitution
impor... | null | https://raw.githubusercontent.com/noteed/mojito/893d1d826d969b0db7bbc8884df3b417db151d14/Language/Mojito/Inference/Cardelli/Inferencer.hs | haskell | to uniquely name type variables
the available (declared) types
the global substitution
the typings for each key
Creates a unique type variable from a string. The result must be wrapped in
Given a type, returns the same type with all the
generic variables renamed with fresh names.
Compose the given substitution ... | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleContexts #
module Language.Mojito.Inference.Cardelli.Inferencer where
import Control.Monad.Except
import Control.Monad.Identity
import Control.Monad.State
import Control.Monad.Writer
import Language.Mojito.Syntax.Types
import Language.Mojito.Inference.Substitution
impor... |
a41b03f36b3047478024de973fd936e0fbb6efc98c642fe7f9b029d9cd57be10 | kaznum/programming_in_ocaml_exercise | squares.ml | let squares r =
let max = int_of_float(sqrt (float_of_int r)) in
let does_match x y =
if (x * x) + (y * y) = r then true else false in
let rec downto1 a =
if a = 0 then [] else a:: downto1 (a - 1) in
let rec exists f list =
fold_right (fun x -> (||) (f x) ) list false in
let rec count_matched xs =... | null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex5.7/squares.ml | ocaml | let squares r =
let max = int_of_float(sqrt (float_of_int r)) in
let does_match x y =
if (x * x) + (y * y) = r then true else false in
let rec downto1 a =
if a = 0 then [] else a:: downto1 (a - 1) in
let rec exists f list =
fold_right (fun x -> (||) (f x) ) list false in
let rec count_matched xs =... | |
776a1297e75a2cf45d99dbaa111d3f94939a6b5ca0537c7490a0fa58d0ce0078 | facebook/duckling | Corpus.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Numeral.BN.Corpus
( corpus
) where
import Data.Stri... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Numeral/BN/Corpus.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Numeral.BN.Corpus
( corpus
) where
import Data.String
import Prelude
import Duckling.Locale
import Duckling.Numeral.Types
import Duckling.Resolve
import Duckling.Testing.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale BN Noth... |
2e375f6cf87d9db083b7937fcb49291e0436c731771beda643bdf080d90bf218 | DogLooksGood/holdem | ladder.clj | (ns poker.ladder
"Ladder is the leaderboard for player skills."
(:require
[clojure.spec.alpha :as s]
[poker.specs]
[poker.system.db :as db]
[crux.api :as crux]))
(s/def ::player-id some?)
(s/def ::borrow int?)
(s/def ::returns int?)
(s/def ::player-buyin-params (s/keys :req-un [::player-i... | null | https://raw.githubusercontent.com/DogLooksGood/holdem/bc0f93ed65cab54890c91f78bb95fe3ba020a41f/src/clj/poker/ladder.clj | clojure | (ns poker.ladder
"Ladder is the leaderboard for player skills."
(:require
[clojure.spec.alpha :as s]
[poker.specs]
[poker.system.db :as db]
[crux.api :as crux]))
(s/def ::player-id some?)
(s/def ::borrow int?)
(s/def ::returns int?)
(s/def ::player-buyin-params (s/keys :req-un [::player-i... | |
1c43beb311417d08e928cbda1bf51c8b59406978bb9aa381949f8094e999af3d | appleshan/cl-http | micro-defsystem.lisp | -*- Syntax : Ansi - Common - Lisp ; Base : 10 ; Mode : lisp ; Package : Micro - Defsystem ; -*-
;;;
Copyright 1994 - 2001 , 2003 , .
;;; All rights reserved.
;;;-------------------------------------------------------------------
;;;
;;; MICRO-DEFSYSTEM
;;;
(eval-when (:execute :compile-toplevel :load-toplevel)... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/mcl/server/micro-defsystem.lisp | lisp | Base : 10 ; Mode : lisp ; Package : Micro - Defsystem ; -*-
All rights reserved.
-------------------------------------------------------------------
MICRO-DEFSYSTEM
check arguments to operations
Combined operations take precedence
Combined operations
Perform operations
support component systems
conservati... | Copyright 1994 - 2001 , 2003 , .
(eval-when (:execute :compile-toplevel :load-toplevel)
(defpackage micro-defsystem
(:nicknames mds)
(:use #-Genera"COMMON-LISP" #+Genera"FUTURE-COMMON-LISP")
(:export "*STANDARD-SYSTEMS*"
"*SYSTEMS*"
"*SYSTEM-DEFINE-HOOK... |
a349becccd3f33ec0d81f358ad464653b0976322a98ce77b23081745579489d4 | tamarin-prover/tamarin-prover | Theory.hs | -- FIXME: for functions prove
-- |
Copyright : ( c ) 2010 - 2012
-- License : GPL v3 (see LICENSE)
--
Maintainer : < > , >
Portability : GHC only
--
-- Theory datatype and transformations on it.
module Theory (
-- * Restrictions
expandRestriction
-- * Processes
, ProcessDef(..)
,... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/958f8b1767650c06dffe4eba63a38508c9b17a7f/lib/theory/src/Theory.hs | haskell | FIXME: for functions prove
|
License : GPL v3 (see LICENSE)
Theory datatype and transformations on it.
* Restrictions
* Processes
* Options
* Predicates
* Export blocks
* Case Tests
* Lemmas
* Theories
** Open theories
** Closed theories
FIXME: this is only exported for the Binary instances
** Pro... | Copyright : ( c ) 2010 - 2012
Maintainer : < > , >
Portability : GHC only
module Theory (
expandRestriction
, ProcessDef(..)
, TranslationElement(..)
Datastructure added to Theory Items
, addProcess
, findProcess
, mapMProcesses
, mapMProcessesDef
, addProcessDef
, lookupPr... |
7bc08598ffb4bb48666f9cd3b760b8aed73e312be4c73918599c6d0623a70a14 | tezos-checker/checker | liquidationAuctionPrimitiveTypes.ml | open Ptr
open Kit
open Tok
[@@@coverage off]
type avl_ptr = AVLPtr of ptr
[@@deriving show]
type leaf_ptr = LeafPtr of ptr
[@@deriving show]
type liquidation_slice_contents = {
burrow: Ligo.address * Ligo.nat;
tok: tok;
min_kit_for_unwarranted: kit option;
}
[@@deriving show]
type liquidation_slice = {
con... | null | https://raw.githubusercontent.com/tezos-checker/checker/fcca75dfa64950177c0427ad28c0c8d126803091/src/liquidationAuctionPrimitiveTypes.ml | ocaml | open Ptr
open Kit
open Tok
[@@@coverage off]
type avl_ptr = AVLPtr of ptr
[@@deriving show]
type leaf_ptr = LeafPtr of ptr
[@@deriving show]
type liquidation_slice_contents = {
burrow: Ligo.address * Ligo.nat;
tok: tok;
min_kit_for_unwarranted: kit option;
}
[@@deriving show]
type liquidation_slice = {
con... | |
a4ce3bd9304b5e3f2e30b91ae63299abe3c9957036daef408a2481c89f86bbfe | tolysz/ghcjs-stack | JobControl.hs | -----------------------------------------------------------------------------
-- |
Module : Distribution . Client . JobControl
Copyright : ( c ) 2012
-- License : BSD-like
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- A job control concurrency abstraction
-... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/cabal-install/Distribution/Client/JobControl.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-like
Maintainer :
Stability : provisional
Portability : portable
A job control concurrency abstraction
--------------------------------------------------------------------------- | Module : Distribution . Client . JobControl
Copyright : ( c ) 2012
module Distribution.Client.JobControl (
JobControl,
newSerialJobControl,
newParallelJobControl,
spawnJob,
collectJob,
JobLimit,
newJobLimit,
withJobLimit,
Lock,
newLock,
criticalSection
... |
764978e9e678b423d52bd6ce1b3a6b9646e218a0dad7ac5deea1a0fe2eec70b5 | quchen/generative-art | Geodesics.hs | module Geometry.Processes.Geodesics (geodesicEquation) where
import Geometry.Core
-- | A geodesic is a path that takes no local detours: each move to a new point is
done so that no other move would be faster . The shortest path between two points
-- is always a geodesic.
--
-- This function allows creating the ... | null | https://raw.githubusercontent.com/quchen/generative-art/1457b694b2ddf54f878db343d46c63d006573927/src/Geometry/Processes/Geodesics.hs | haskell | | A geodesic is a path that takes no local detours: each move to a new point is
is always a geodesic.
This function allows creating the geodesic differential equation, suitable for
using in ODE solvers such as
'Numerics.DifferentialEquation.rungeKuttaAdaptiveStep'.
Using this is very simple, the equation behind... | module Geometry.Processes.Geodesics (geodesicEquation) where
import Geometry.Core
done so that no other move would be faster . The shortest path between two points
\ddot v^i & = \Gamma^i_{kl}\dot v^k\dot v^l \\
\Gamma^i_{kl } & = \frac12 g^{im } ( g_{mk , l}+g_{ml , k}-g_{kl , m } ) \\
build ourse... |
4e90fcb53402294de38b81fe33a5ff030d686911866f10f7637e3b4b784e6cb3 | facebook/duckling | Corpus.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.AmountOfMoney.EN.GB.Corpus
( allExamples
, negativeEx... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/AmountOfMoney/EN/GB/Corpus.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.AmountOfMoney.EN.GB.Corpus
( allExamples
, negativeExamples
) where
import Data.String
import Data.Text (Text)
import Prelude
import Duckling.AmountOfMoney.Types
import Duckling.Testing.Types
allExamples :: [Example]
allExamples = concat
[ ... |
0f383df91d58f513f18ec908be02627f5e85a62b3a698ecf7e1e6338106ca8be | quchen/stgi | Number.hs | # LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
-- | Operations on boxed integers.
--
-- This module should be imported qualified to avoid clashes with standard
definitions .
module Stg.Prelude.Number (
-- * Arithmetic
add,
sub,
mul,
div,
... | null | https://raw.githubusercontent.com/quchen/stgi/dacd45cb0247f73889713dc92a911aaa835afd19/src/Stg/Prelude/Number.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
| Operations on boxed integers.
This module should be imported qualified to avoid clashes with standard
* Arithmetic
* Comparisons
* Other
$setup
>>> :set -XOverloadedStrings
>>> :set -XQuasiQuotes
>>> :module +Stg.Language.Prettyprint
| Equality ... | # LANGUAGE OverloadedLists #
definitions .
module Stg.Prelude.Number (
add,
sub,
mul,
div,
mod,
eq_Int,
lt_Int,
leq_Int,
gt_Int,
geq_Int,
neq_Int,
min,
max,
) where
import Prelude ()
import Data.Monoid ((<>))
import Data.Text (Text)
import Stg.Language... |
9d145c8911bf6401cea4103dcb598f47972ba8aa7f91c6df94b6e05524213cfa | ocaml-sf/learn-ocaml-corpus | cons4.ml | (* Measuring the length of a sequence. *)
let rec length : 'a . 'a seq -> int =
fun xs ->
match xs with
| Nil -> 0
| Zero xs -> 2 * length xs
| One (_, xs) -> 1 + 2 * length xs
let rec cons : 'a . 'a -> 'a seq -> 'a seq =
fun x ys ->
match ys with
| Nil ->
... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/random_access_lists/wrong/cons4.ml | ocaml | Measuring the length of a sequence.
very wrong |
let rec length : 'a . 'a seq -> int =
fun xs ->
match xs with
| Nil -> 0
| Zero xs -> 2 * length xs
| One (_, xs) -> 1 + 2 * length xs
let rec cons : 'a . 'a -> 'a seq -> 'a seq =
fun x ys ->
match ys with
| Nil ->
One (x, Nil)
| Zero ys ->
... |
1c40f191714b75f59c7264e54d765053b6b42fbc37243d6c2a718581a85b0fbd | awgn/cgrep | Char.hs | module CGrep.Parser.Char where
import Data.Char ( isAlpha, isAlphaNum, isHexDigit )
isCharNumber :: Char -> Bool
isCharNumber c = isHexDigit c || c `elem` (".xX" :: String)
isAlpha_ :: Char -> Bool
isAlpha_ c = isAlpha c || c == '_'
{-# INLINE isAlpha_ #-}
isAlphaNum_ :: Char -> Bool
isAlphaNum_ c = isAlphaNum c ||... | null | https://raw.githubusercontent.com/awgn/cgrep/304d7092cd4b961022abb06103c2bf7bb932ff4a/src/CGrep/Parser/Char.hs | haskell | # INLINE isAlpha_ #
# INLINE isAlpha_' #
# INLINE isBracket' # | module CGrep.Parser.Char where
import Data.Char ( isAlpha, isAlphaNum, isHexDigit )
isCharNumber :: Char -> Bool
isCharNumber c = isHexDigit c || c `elem` (".xX" :: String)
isAlpha_ :: Char -> Bool
isAlpha_ c = isAlpha c || c == '_'
isAlphaNum_ :: Char -> Bool
isAlphaNum_ c = isAlphaNum c || c == '_'
# INLINE isAlp... |
d4758e9df538fe0e2849846bc4f54e2575ecf1d3db65830a81cedc913e8aadfc | lopec/LoPEC | web_login.erl | -module (web_login).
-include_lib ("nitrogen/include/wf.inc").
-compile(export_all).
main() ->
common_web:main().
title() ->
common_web:title().
%% This is not currently used in our design
footer() ->
common_web:footer().
get_info() ->
common_web:get_info().
% Creates the menu.
menu() ->
#pane... | null | https://raw.githubusercontent.com/lopec/LoPEC/29a3989c48a60e5990615dea17bad9d24d770f7b/trunk/lib/master/src/pages/web_login.erl | erlang | This is not currently used in our design
Creates the menu.
We hotwire some properties to our textboxes (Activated when button
is pressed)
This event is fired up when the login-button is pressed | -module (web_login).
-include_lib ("nitrogen/include/wf.inc").
-compile(export_all).
main() ->
common_web:main().
title() ->
common_web:title().
footer() ->
common_web:footer().
get_info() ->
common_web:get_info().
menu() ->
#panel { id=menuitem, body=[
#link { text="Register", url="re... |
f89c27a32c7a9d7eb3110ef8d1fd068cf14c1c1a2748f6373ff6dc875023169b | digikar99/reader | swank.lisp | (cl:defpackage :reader+swank
(:use :cl :reader)
(:export
:enable-package-local-reader-syntax
:disable-package-local-reader-syntax))
(in-package :reader+swank)
(defmacro enable-package-local-reader-syntax (&rest reader-macro-identifiers)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (g... | null | https://raw.githubusercontent.com/digikar99/reader/825c06bad98abdd28ceb85e59c5ae28ba05ff3c3/swank.lisp | lisp | (cl:defpackage :reader+swank
(:use :cl :reader)
(:export
:enable-package-local-reader-syntax
:disable-package-local-reader-syntax))
(in-package :reader+swank)
(defmacro enable-package-local-reader-syntax (&rest reader-macro-identifiers)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (g... | |
50ca87fa6bf43880af8744c10f24321848d046f30ea2e9d08a47f6090c21702b | haskell/cabal | Version.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Version
Copyright : , 2003 - 2004
2008
-- License : BSD3
--
-- Maintainer :
-- Portability : portable
--
-- Exports the 'Version' type along with a parser and pretty p... | null | https://raw.githubusercontent.com/haskell/cabal/0abbe37187f708e0a5daac8d388167f72ca0db7e/Cabal-syntax/src/Distribution/Version.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Version
License : BSD3
Maintainer :
Portability : portable
Exports the 'Version' type along with a parser and pretty printer. A version
* Package versions
* Version ranges
** Constructing
** In... | Copyright : , 2003 - 2004
2008
is something like @\"1.3.3\"@. It also defines the ' VersionRange ' data
types . Version ranges are like @\">= 1.2 & & < 2\"@.
module Distribution.Version (
Version,
version0,
mkVersion,
mkVersion',
versionNumbers,
nullVersion,
alterVersion... |
2809d6030878532f63c4b8a38e48b8f217484164d55e26775879a0536278d4b1 | robert-strandh/Second-Climacs | esa-buffer.lisp | (cl:in-package #:second-climacs-clim-base)
(stealth-mixin:define-stealth-mixin
buffer (esa-buffer:esa-buffer-mixin)
base:buffer
())
(defmethod base:insert-item :after (cursor item)
(setf (esa-buffer:needs-saving (base:buffer cursor)) t))
(defmethod base:delete-item :after (cursor)
(setf (esa-buffer:needs... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/a992665575aae16888e54477ec5ddd251a9ecf1b/Code/GUI/McCLIM-ESA/Base/esa-buffer.lisp | lisp | (cl:in-package #:second-climacs-clim-base)
(stealth-mixin:define-stealth-mixin
buffer (esa-buffer:esa-buffer-mixin)
base:buffer
())
(defmethod base:insert-item :after (cursor item)
(setf (esa-buffer:needs-saving (base:buffer cursor)) t))
(defmethod base:delete-item :after (cursor)
(setf (esa-buffer:needs... | |
037d46f990e9cbfc3303b9cd7f5058263a9d7e5bb549fa612770a81b54e25282 | ertugrulcetin/jme-clj | hello_physics.clj | ;; Please start your REPL with `+test` profile
(ns examples.beginner-tutorials.hello-physics
"Clojure version of "
(:require [jme-clj.core :refer :all])
(:import
(com.jme3.input MouseInput)
(com.jme3.math Vector3f)
(com.jme3.scene.shape Sphere$TextureMode)
(com.jme3.texture Texture$WrapMode)))
(def ... | null | https://raw.githubusercontent.com/ertugrulcetin/jme-clj/167ef8f9e6396cc6e3c234290c5698c098fcad28/test/examples/beginner_tutorials/hello_physics.clj | clojure | Please start your REPL with `+test` profile
for keeping internal *bindings* work, also the app. We need to define
listeners with `defn`. `def` should NOT be used!
Using qualified keywords for inputs is highly recommended!
bullet-as (set* bullet-as :debug-enabled true) | (ns examples.beginner-tutorials.hello-physics
"Clojure version of "
(:require [jme-clj.core :refer :all])
(:import
(com.jme3.input MouseInput)
(com.jme3.math Vector3f)
(com.jme3.scene.shape Sphere$TextureMode)
(com.jme3.texture Texture$WrapMode)))
(def brick-length 0.48)
(def brick-width 0.24)
(def ... |
68dfb502dc81ed883c116385e6c8ab8e8ca04d47c0de074862c5bdf740fc9370 | hstreamdb/hstream | Time.hs | module HStream.Utils.Time
( Interval (..)
, parserInterval
, interval2ms
, diffTimeSince
, usecSince
, msecSince
, secSince
-- * Re-export
, getPOSIXTime
) where
import Control.Applicative ((<|>))
import Data.Attoparsec.Text (Parser, choice, endOfInput, parseOnly,
... | null | https://raw.githubusercontent.com/hstreamdb/hstream/125d9982d47874aee5e33324b55689d64bd664c2/common/hstream/HStream/Utils/Time.hs | haskell | * Re-export | module HStream.Utils.Time
( Interval (..)
, parserInterval
, interval2ms
, diffTimeSince
, usecSince
, msecSince
, secSince
, getPOSIXTime
) where
import Control.Applicative ((<|>))
import Data.Attoparsec.Text (Parser, choice, endOfInput, parseOnly,
... |
d76e2d80174a43feb4e0a7068ead2fe37a08377d2ba11dd1c2ae075ec8a2c6e6 | gonimo/gonimo | Impl.hs | # LANGUAGE TupleSections #
# LANGUAGE RecordWildCards #
|
Module : . Client . Router . Impl
Description : Routing for .
Copyright : ( c ) , 2018
Picks Impl . Native or Impl . Browser based on ` needsNativeHistory ` of the Host .
Module : Gonimo.Client.Router.Impl
Description : Routing for G... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/front/src/Gonimo/Client/Router/Impl.hs | haskell | * Types
* Creation
| Our dependencies | # LANGUAGE TupleSections #
# LANGUAGE RecordWildCards #
|
Module : . Client . Router . Impl
Description : Routing for .
Copyright : ( c ) , 2018
Picks Impl . Native or Impl . Browser based on ` needsNativeHistory ` of the Host .
Module : Gonimo.Client.Router.Impl
Description : Routing for G... |
7186efc73d5202ca56c02d0a6cdef5ff1652d2532b7506c0ffec15562672e5f9 | Clojure2D/clojure2d-examples | hittable.clj | (ns rt4.the-rest-of-your-life.ch06c.hittable
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.the-rest-of-your-life.ch06c.aabb :as aabb]
[rt4.the-rest-of-your-life.ch06c.ray :as ray])
(:import [fastmath.vector Vec3]
[rt4.the_rest_of_your_life.ch06c.ray Ray]... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/f47e1655902cc6bf1590aaecc144ac274ed3af66/src/rt4/the_rest_of_your_life/ch06c/hittable.clj | clojure | (ns rt4.the-rest-of-your-life.ch06c.hittable
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.the-rest-of-your-life.ch06c.aabb :as aabb]
[rt4.the-rest-of-your-life.ch06c.ray :as ray])
(:import [fastmath.vector Vec3]
[rt4.the_rest_of_your_life.ch06c.ray Ray]... | |
7b5cc958ddb0de4d0fa51caee975651f709c196bace8b35ff27f404fdff7ec1a | protojure/lib | grpc.clj | Copyright © 2019 State Street Bank and Trust Company . All rights reserved
Copyright © 2019 - 2022 Manetu , Inc. All rights reserved
;;
SPDX - License - Identifier : Apache-2.0
(ns protojure.pedestal.interceptors.grpc
"A [Pedestal](/) [interceptor]() for [GRPC](/) support"
(:require [clojure.core.async :... | null | https://raw.githubusercontent.com/protojure/lib/a07e407776d094f5dc8bc43cd2c1188550892d38/modules/grpc-server/src/protojure/pedestal/interceptors/grpc.clj | clojure |
client-streaming means simply pass the channel directly
materialize unary params opportunistically, if available
else, defer context until unary params materialize
special-case unary return types
Auto-close the output ch if the user does not signify they have consumed it
by referencing it in the :body | Copyright © 2019 State Street Bank and Trust Company . All rights reserved
Copyright © 2019 - 2022 Manetu , Inc. All rights reserved
SPDX - License - Identifier : Apache-2.0
(ns protojure.pedestal.interceptors.grpc
"A [Pedestal](/) [interceptor]() for [GRPC](/) support"
(:require [clojure.core.async :ref... |
50a32d7b726ed21b9932fa6094f08e3cd049f76456aff65db34df20eff2cbdab | scrintal/heroicons-reagent | clipboard_document_list.cljs | (ns com.scrintal.heroicons.solid.clipboard-document-list)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M7.502 6h7.128A3.375 3.375 0 0118 9.375v9.375a3 3 0 003-3V6.108c0-... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/clipboard_document_list.cljs | clojure | (ns com.scrintal.heroicons.solid.clipboard-document-list)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M7.502 6h7.128A3.375 3.375 0 0118 9.375v9.375a3 3 0 003-3V6.108c0-... | |
0575f8a9b8c8d2d17a19f14ddf27bf01946a1d4540dfadd7555591f3c728b09e | snoyberg/conduit | Foldl.hs | {-# LANGUAGE RankNTypes #-}
-- | Adapter module to work with the < foldl> package.
--
-- @since 1.1.16
module Data.Conduit.Foldl where
import Data.Conduit
import Control.Monad.Trans.Class (lift)
import qualified Data.Conduit.List as CL
-- | Convert a left fold into a 'Consumer'. This function is intended
-- to be use... | null | https://raw.githubusercontent.com/snoyberg/conduit/1771780ff4b606296924a28bf5d4433ae6a916f3/conduit-extra/Data/Conduit/Foldl.hs | haskell | # LANGUAGE RankNTypes #
| Adapter module to work with the < foldl> package.
@since 1.1.16
| Convert a left fold into a 'Consumer'. This function is intended
to be used with @purely@ from the
< foldl> package.
@since 1.1.16
| Convert a monadic left fold into a 'Consumer'. This function is
intended to be used w... | module Data.Conduit.Foldl where
import Data.Conduit
import Control.Monad.Trans.Class (lift)
import qualified Data.Conduit.List as CL
sinkFold :: Monad m => (x -> a -> x) -> x -> (x -> b) -> ConduitT a o m b
sinkFold combine seed extract = fmap extract (CL.fold combine seed)
sinkFoldM :: Monad m => (x -> a -> m x) ->... |
079d153c15d21f2c90e5b70506db3953b13b96745db0332cf05f0a67e8cbda03 | slasser/vermillion | menhirLib.mli | module General : sig
(******************************************************************************)
(* *)
(* ... | null | https://raw.githubusercontent.com/slasser/vermillion/0b60114b27f4f92272129f381ec01e593273e6f2/Evaluation/MenhirLib/menhirLib.mli | ocaml | ****************************************************************************
special ex... | module General : sig
, Paris
, PPS , Université Paris Diderot
. All rights reserved . This file is distributed under the
terms of the GNU Library General ... |
f517eac8eef0000e81d596749341e9a584218ceed9994438015f6b777453d4c1 | facebook/pyre-check | taintTransformOperation.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/3fb5a54822fd237f51009a24ce316dbb29db6efc/source/interprocedural_analyses/taint/taintTransformOperation.ml | ocaml | This module implements common operations on taint transforms.
* Most importantly, it implements adding transforms on a source or sink.
*
* This is intentionally in a separate file to have access to both `Sources` and
* `Sinks`, even though they use `TaintTransforms.t`. This avoids a cyclic
* dependency.
Check ... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
cff2ac5deceee1d9d936946b6dc043fdb9486b15e144dabea586149d1b2be761 | tallaproject/onion | onion_nif.erl | %%%
Copyright ( c ) 2015 The Talla Authors . All rights reserved .
%%% Use of this source code is governed by a BSD-style
%%% license that can be found in the LICENSE file.
%%%
%%% ----------------------------------------------------------------------------
@author < >
@private
%%% ----------------------------... | null | https://raw.githubusercontent.com/tallaproject/onion/d0c3f86c726c302744d3cfffa2de21f85c190cf0/src/onion_nif.erl | erlang |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Private API.
Initializer. | Copyright ( c ) 2015 The Talla Authors . All rights reserved .
@author < >
@private
-module(onion_nif).
-export([rsa_generate_private_key/2]).
-on_load(init/0).
NIF .
-define(nif_stub, nif_stub_error(?LINE)).
-spec init() -> ok | {error, any()}.
init() ->
Module = "onion",
File = case code:priv_d... |
5a6ea0667eda7f7823b926b85458958cbc1933430836e61d0e44cffac1c3f836 | tsloughter/kuberl | kuberl.erl | @doc : Kubernetes Erlang client
%%
-module(kuberl).
%% API
-export([new_cfg/0,
update_cfg/1,
update_cfg/2,
cfg_with_bearer_token/1,
cfg_with_bearer_token/2,
cfg_with_host/1,
cfg_with_host/2,
update_default_cfg/1,
set_default_cfg/0,
set_... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/src/kuberl.erl | erlang |
API
@doc The default config.
@doc Create a config using a given bearer `Token'.
@doc Add a bearer `Token' to a given config.
@equiv cfg_with_host(new_cfg(), Host)
@doc Create a config with a given `Host'.
@doc Add a bearer `Token' to a given config.
@equiv update_cfg(new_cfg(), Map)
@doc Update a default conf... | @doc : Kubernetes Erlang client
-module(kuberl).
-export([new_cfg/0,
update_cfg/1,
update_cfg/2,
cfg_with_bearer_token/1,
cfg_with_bearer_token/2,
cfg_with_host/1,
cfg_with_host/2,
update_default_cfg/1,
set_default_cfg/0,
set_default_cf... |
f836e197d6084a84a2001dc45673bac27732a429b8f8b996165188c47ef4efa4 | ahrefs/atd | ov_run.ml | let validate_list f path l =
let rec loop f path i = function
| [] -> None
| x :: l ->
let subpath = `Index i :: path in
match f subpath x with
None -> loop f path (i+1) l
| err -> err
in
loop f path 0 l
let validate_array f path a =
let rec loop f path a len i =
... | null | https://raw.githubusercontent.com/ahrefs/atd/9a3cb984a695563c04b41cdd7a1ce9454eb40e1c/atdgen-runtime/src/ov_run.ml | ocaml | let validate_list f path l =
let rec loop f path i = function
| [] -> None
| x :: l ->
let subpath = `Index i :: path in
match f subpath x with
None -> loop f path (i+1) l
| err -> err
in
loop f path 0 l
let validate_array f path a =
let rec loop f path a len i =
... | |
cc7e07d962eae443a8dac7ba3cd8d30aea75c53a6a1d291704f0c6969bb56d9e | OCamlPro/freeton_ocaml_sdk | mod_utils.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2021 OCamlPro SAS
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/freeton_ocaml_sdk/9f106db6461707984e1c2f2bafcd75b2850b3e5b/src/freeton_client_lib/mod_utils.ml | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2021 OCamlPro SAS
Public License version 2.1 , with the special exception on linking
module AddressStringFormat = struct
type t =
| AccountId [@kind "AccountId"] [@kind_label "type"]
| Hex [@kind "Hex"] [@kind_label "type"]
| Base64 o... |
1dd8139234511bc79f8028496fd25680910594e11744a85966a2316048d55a76 | vraid/earthgen | logistic.rkt | #lang typed/racket
(provide (all-defined-out))
(: logistic-growth-rate (Float Float Float -> Float))
(define (logistic-growth-rate growth-rate population carrying-capacity)
(* growth-rate population (- 1 (/ population carrying-capacity))))
(: logistic-absolute (Float Float Float Float -> Float))
(define (logistic-... | null | https://raw.githubusercontent.com/vraid/earthgen/208ac834c02208ddc16a31aa9e7ff7f91c18e046/planet/math/logistic.rkt | racket | #lang typed/racket
(provide (all-defined-out))
(: logistic-growth-rate (Float Float Float -> Float))
(define (logistic-growth-rate growth-rate population carrying-capacity)
(* growth-rate population (- 1 (/ population carrying-capacity))))
(: logistic-absolute (Float Float Float Float -> Float))
(define (logistic-... | |
1dc6f0984907b73c695b1383540838b9954c5048c4708aad8862fa6b0fd434fe | Cipherwraith/Rokka | GetHeaders.hs | module GetHeaders where
import Network.HTTP
import Control.Applicative
import Data.Maybe
import qualified Control.Exception as X
import Network.Stream
-- Downloads the URL and isolates the response headers
download url = liftA rspHeaders <$> runHTTP url
-- Do a head request, and catch any exceptions.
runHTTP url = (... | null | https://raw.githubusercontent.com/Cipherwraith/Rokka/46f55dcc5f0c00f2c806670330234b0e7afea5ee/GetHeaders.hs | haskell | Downloads the URL and isolates the response headers
Do a head request, and catch any exceptions.
IF there is any exception in the HTTP head request, then replace it with a request to awaq.com
Pattern match on the Either functor
Header types can be found here:
-HTTP-Headers.html#t:HeaderName
Sugar to get the "las... | module GetHeaders where
import Network.HTTP
import Control.Applicative
import Data.Maybe
import qualified Control.Exception as X
import Network.Stream
download url = liftA rspHeaders <$> runHTTP url
runHTTP url = (simpleHTTP (headRequest url) ) `X.catch` exceptionHandler
exceptionHandler :: X.SomeException -> IO (R... |
1457a5bf857e3696c4b99a4ac2bee6433639c0548844d6359b829a1971a92514 | nd/bird | 4.5.11.hs | data Liste a = Nil | Snoc (Liste a) a
deriving (Show)
convert :: [a] -> Liste a
convert [] = Nil
convert (x:xs) = Snoc (convert xs) x
--or:
--convert = foldr f Nil
where f x y =
--folde f e = foldl f e . convert
--
argument is :
--left side:
--folde f e = e
--right side:
--foldl f e . convert... | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch04/4.5.11.hs | haskell | or:
convert = foldr f Nil
folde f e = foldl f e . convert
left side:
folde f e = e
right side:
foldl f e . convert =
{def of convert}
foldl f e Nil = e
left side:
{def of folde}
f (folde f e xs) x
right side:
foldl f e . convert (x:xs) =
{def of convert}
{def of foldl}
f (foldl f e (convert xs)) x
they are equals ... | data Liste a = Nil | Snoc (Liste a) a
deriving (Show)
convert :: [a] -> Liste a
convert [] = Nil
convert (x:xs) = Snoc (convert xs) x
where f x y =
argument is :
argument is :
folde f e ( ) =
foldl f e ( ( convert xs ) x ) =
qed
|
e712eac4640dc2b210e14deb65da95d9d94c1f299427b9e3e792a5b54d4dfa33 | namin/propagators | ui.scm | This is the ps07 file ui.scm
;;; This removes those annoying hash numbers after ;Value:
(set! repl:write-result-hash-numbers? #f)
;;; This is part of paranoid programming.
(define (assert p #!optional error-comment irritant)
(if (not p)
(begin
(if (not (default-object? irritant))
(pp irritant))
(erro... | null | https://raw.githubusercontent.com/namin/propagators/ae694dfe680125e53a3d49e5e91c378f2d333937/adventures/ps07/ui.scm | scheme | This removes those annoying hash numbers after ;Value:
This is part of paranoid programming.
This abstracts an annoying composition
This is required because (run) returns old value if there is
nothing to do. This is a problem if a contradiction is resolved
by a kick-out! with no propagation. | This is the ps07 file ui.scm
(set! repl:write-result-hash-numbers? #f)
(define (assert p #!optional error-comment irritant)
(if (not p)
(begin
(if (not (default-object? irritant))
(pp irritant))
(error
(if (default-object? error-comment)
"Failed assertion"
error-comment)))))
(define (d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.