_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 |
|---|---|---|---|---|---|---|---|---|
6e30c31765c58ff3a2fc33148fa19fdb74bba231a1ead2cbf3b9f7a46c3a5025 | avsm/eeww | out_channel.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/avsm/eeww/4d65720b5dd51376842ffe5c8c220d5329c1dc10/boot/ocaml/stdlib/out_channel.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2021 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* Output channels .
This module provides functions for working with output channels .
See {... |
428425d7642a45847a139055152c845c51099baf93c223a53921f64ed992ed68 | zhugecaomao/AutoLISP | TName.lsp |
(defun c:TName (/ tf e p thisdrawing mtext lea)
(setq tf t)
(while tf
(if
(and (setq e (entsel "\nÑ¡ÔñÊ÷ľ: "))
(or (= (cdr (assoc 0 (setq el (entget (car e))))) "INSERT")
(= (cdr (assoc 0 el)) "HATCH")
)
(setq p (getpoint (last e) "\n±ê×¢µã: "))
)
(progn
(if (not thisd... | null | https://raw.githubusercontent.com/zhugecaomao/AutoLISP/3e97f911068124f3ea8a1cf6f1d8be9f8227c64b/TName.lsp | lisp | end progn
end if
end while |
(defun c:TName (/ tf e p thisdrawing mtext lea)
(setq tf t)
(while tf
(if
(and (setq e (entsel "\nÑ¡ÔñÊ÷ľ: "))
(or (= (cdr (assoc 0 (setq el (entget (car e))))) "INSERT")
(= (cdr (assoc 0 el)) "HATCH")
)
(setq p (getpoint (last e) "\n±ê×¢µã: "))
)
(progn
(if (not thisd... |
09f68efb387545996dec66002b9a384be564183323f99db00837ccdd770ad922 | pink-gorilla/goldly | core.cljs | (ns goldly.broadcast.core
(:require
[re-frame.core :as rf]
[taoensso.timbre :as timbre :refer-macros [trace debug debugf info infof error]]
[goldly.system.db :refer [find-system-by-id]]))
(defn clj-response-valid? [{:keys [system-id where]}]
(and (vector? where)
(keyword? system-id)))
(defn get-ru... | null | https://raw.githubusercontent.com/pink-gorilla/goldly/a942f29378e51da5725989ba017bac5a61e7fe54/src-unused/system/goldly/broadcast/core.cljs | clojure | (ns goldly.broadcast.core
(:require
[re-frame.core :as rf]
[taoensso.timbre :as timbre :refer-macros [trace debug debugf info infof error]]
[goldly.system.db :refer [find-system-by-id]]))
(defn clj-response-valid? [{:keys [system-id where]}]
(and (vector? where)
(keyword? system-id)))
(defn get-ru... | |
21e171abf342e4db797ded220d726c0ba650bb735832d2d82caa9d72f5eda6d0 | haskell-repa/repa | Pack.hs |
module Data.Array.Repa.Vector.Operators.Pack
( Pack(..)
, filter
, packs)
where
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Vector.Repr.Delayed
import Data.Array.Repa.Vector.Repr.Unboxed
import Data.Array.Repa.Vector.Repr.Flow
import Data.Array.Repa.Vector.Segd ... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/icebox/abandoned/repa-vector/Data/Array/Repa/Vector/Operators/Pack.hs | haskell | | Produce only those elements that have their corresponding flag set.
-----------------------------------------------------------------------------
------------------------------------------------------------------------------
| Produce only those elements that match the given predicate.
| Segmented Pack
^ Flags ve... |
module Data.Array.Repa.Vector.Operators.Pack
( Pack(..)
, filter
, packs)
where
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Vector.Repr.Delayed
import Data.Array.Repa.Vector.Repr.Unboxed
import Data.Array.Repa.Vector.Repr.Flow
import Data.Array.Repa.Vector.Segd ... |
35d2d94655a4884cc63d3d1448cf8977e0d09e6d74afb79a23bc4c2e42133ae4 | goldfirere/cs380 | ClassOrdList.hs | # LANGUAGE GADTs , TypeInType , TypeOperators #
module ClassOrdList where
import Data.Kind ( Type )
data Nat where
Zero :: Nat
Succ :: Nat -> Nat
data SNat :: Nat -> Type where
SZero :: SNat Zero
SSucc :: SNat n -> SNat (Succ n)
data n :<=: m where
LTEZero :: Zero :<=: m
LTESucc :: n :<=: m -> Succ n :... | null | https://raw.githubusercontent.com/goldfirere/cs380/a9e2d2e610eb4e9e082cef0559b6e29a6d82a253/18_ordlist/ClassOrdList.hs | haskell | # LANGUAGE GADTs , TypeInType , TypeOperators #
module ClassOrdList where
import Data.Kind ( Type )
data Nat where
Zero :: Nat
Succ :: Nat -> Nat
data SNat :: Nat -> Type where
SZero :: SNat Zero
SSucc :: SNat n -> SNat (Succ n)
data n :<=: m where
LTEZero :: Zero :<=: m
LTESucc :: n :<=: m -> Succ n :... | |
671a7d59e2ef79c70303216d2f9e13d35d829d9b610b71eb60909e8ee8ae085a | ghc/ghc | CreateBCO.hs | # OPTIONS_GHC -fno - warn - name - shadowing #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGUAGE RecordWildCards #
# LANGUAGE CPP #
--
( c ) The University of Glasgow 2002 - 2006
--
| Create real byte - cod... | null | https://raw.githubusercontent.com/ghc/ghc/3e09cf82ad111e0a6feed81b726849ceaaf3c805/libraries/ghci/GHCi/CreateBCO.hs | haskell | # LANGUAGE BangPatterns #
See note [Why do we import Prelude here?]
~~~~~~~~~~~~~~~~~~~~~~~~~
Furthermore:
we recursively link any sub-BCOs while making the ptrs array
must be lazy!
without making a thunk turns out to be surprisingly tricky. | # OPTIONS_GHC -fno - warn - name - shadowing #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE MagicHash #
# LANGUAGE UnboxedTuples #
# LANGUAGE RecordWildCards #
# LANGUAGE CPP #
( c ) The University of Glasgow 2002 - 2006
| Create real byte - code objects from ' ResolvedBCO 's .
mo... |
d946223c18b4c6132817cbe86fdd62fd61aafab7ea815a9316656fe01deacfd4 | sweirich/hs-inferno | Generalization.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes , ScopedTypeVariables #
{-# OPTIONS_GHC -fdefer-type-errors #-}
module Language.Inferno.Generalization
-- (Scheme, quantifiers, body,
-- State, initialize, no_rank, register, trivial,
-- enter, exit, instantiate)
where
import Language.Infe... | null | https://raw.githubusercontent.com/sweirich/hs-inferno/08f6c514a695463332b69e5315b324802687328f/src/Language/Inferno/Generic/Generalization.hs | haskell | # OPTIONS_GHC -fdefer-type-errors #
(Scheme, quantifiers, body,
State, initialize, no_rank, register, trivial,
enter, exit, instantiate)
The rank of a variable is set to the current rank when the variable is
first created. During the lifetime of a variable, its rank can only
decrease. Decr... | # LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes , ScopedTypeVariables #
module Language.Inferno.Generalization
where
import Language.Inferno.UnifierSig
import qualified Language.Inferno.Unifier as U
import Data.Array.MArray
import Language.Inferno.InfiniteArray (InfiniteArray)
import qualified Language.In... |
d2134eb3ea39ffcae0f3a7fbfe171fc2dd5bf7281d2f4925f68978f0205d53d2 | racehub/om-bootstrap | loading.cljs | #_
(:require [om-bootstrap.button :as b]
[om-bootstrap.mixins :as m]
[om-tools.core :refer-macros [defcomponentk]]
[om-tools.dom :as d :include-macros true])
(defcomponentk loading-button [state owner]
(:mixins m/set-timeout-mixin)
(init-state [_] {:loading? false})
(render-state
... | null | https://raw.githubusercontent.com/racehub/om-bootstrap/18fb7f67c306d208bcb012a1b765ac1641d7a00b/dev/snippets/button/loading.cljs | clojure | This is required to get around
-tools/issues/29. | #_
(:require [om-bootstrap.button :as b]
[om-bootstrap.mixins :as m]
[om-tools.core :refer-macros [defcomponentk]]
[om-tools.dom :as d :include-macros true])
(defcomponentk loading-button [state owner]
(:mixins m/set-timeout-mixin)
(init-state [_] {:loading? false})
(render-state
... |
33311fac1431f35d2901c6f6187811cb9bcfb20461521f18e7d8c470eb058e57 | zyrolasting/polyglot | macros.rkt | #lang racket
(require scribble/manual)
(provide (all-defined-out))
(define-syntax-rule (base-workflow)
(secref "base-workflow" #:doc '(lib "polyglot/scribblings/guide/polyglot-guide.scrbl")))
(define-syntax-rule (functional-workflow)
(secref "functional-workflow" #:doc '(lib "polyglot/scribblings/guide/polyglot-g... | null | https://raw.githubusercontent.com/zyrolasting/polyglot/d27ca7fe90fd4ba2a6c5bcd921fce89e72d2c408/polyglot-doc/polyglot/scribblings/macros.rkt | racket | #lang racket
(require scribble/manual)
(provide (all-defined-out))
(define-syntax-rule (base-workflow)
(secref "base-workflow" #:doc '(lib "polyglot/scribblings/guide/polyglot-guide.scrbl")))
(define-syntax-rule (functional-workflow)
(secref "functional-workflow" #:doc '(lib "polyglot/scribblings/guide/polyglot-g... | |
5cc76ece2fbc1aaf20727a58ca28112281b8351e3f466294efc8805053705e95 | 2600hz/kazoo | kz_media_tts.erl | %%%-----------------------------------------------------------------------------
( C ) 2012 - 2020 , 2600Hz
%%% @doc
@author
%%%
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 /.
%%%
%%% ... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_media/src/kz_media_tts.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
----------------------------------------------------------------------------- | ( C ) 2012 - 2020 , 2600Hz
@author
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 /.
-module(kz_media_tts).
-export([get_uri/2]).
-include("kazoo_media.hrl").
-spec get_uri(kz_term:ne_... |
5c22cc6dd6c3a4a6e4165dffb21f56bb193b9f8686aacffc722a6432bbcade92 | SimulaVR/godot-haskell | CameraTexture.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.CameraTexture
(Godot.Core.CameraTexture.get_camera_a... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/CameraTexture.hs | haskell | | Convenience property that gives access to the active property of the @CameraFeed@.
| Convenience property that gives access to the active property of the @CameraFeed@.
| The ID of the @CameraFeed@ for which we want to display the image.
| The ID of the @CameraFeed@ for which we want to display the image.
| Conve... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.CameraTexture
(Godot.Core.CameraTexture.get_camera_a... |
601deae82f9e1acad0cb924de02c9457ff21e8ee1c09dd37c192fe598d4188e5 | input-output-hk/cardano-ledger | Random.hs | # LANGUAGE DataKinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Test.Cardano.Ledger.Binary.Random (
QC (..),
mkDummyHash,
mkHashStdGen,
)
where
import Cardano.Crypto.Hash.Class (Hash, HashAlgorithm, hashToBytesShort)
import Cardano.Crypto.Hash.Shor... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/49a84725c4c2ecabc80f6dac215881bc23920962/libs/cardano-ledger-binary/testlib/Test/Cardano/Ledger/Binary/Random.hs | haskell | @random@'s stateful interface to work dierctly in `Gen` monad. This comes from an
| It is possible to use a hash of a binary representation of any type as a source of
randomness, since hash value by its definiteion is uniformly distributed.
that can be further used to generate random values. | # LANGUAGE DataKinds #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Test.Cardano.Ledger.Binary.Random (
QC (..),
mkDummyHash,
mkHashStdGen,
)
where
import Cardano.Crypto.Hash.Class (Hash, HashAlgorithm, hashToBytesShort)
import Cardano.Crypto.Hash.Shor... |
841ccb8e354f42e21b88f2461979ede33725bd5c498cabe674eaaa0f4c3b6165 | racket/racket7 | multi-file.rkt | #lang racket/base
(require "test-util.rkt"
racket/file)
(parameterize ([current-contract-namespace
(make-basic-contract-namespace 'racket/contract)])
(define exn:fail:contract:blame-object (contract-eval 'exn:fail:contract:blame-object))
(define exn:fail:contract:blame? (contract-eval ... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/pkgs/racket-test/tests/racket/contract/multi-file.rkt | racket | (cons/c string[lang-line]
-> any
and returns/raises-the-exception from the require'd file
basic negative blame case
basic positive blame case
positive blame via a re-provide
negative blame via a re-provide
have some sharing in the require graph | #lang racket/base
(require "test-util.rkt"
racket/file)
(parameterize ([current-contract-namespace
(make-basic-contract-namespace 'racket/contract)])
(define exn:fail:contract:blame-object (contract-eval 'exn:fail:contract:blame-object))
(define exn:fail:contract:blame? (contract-eval ... |
ff8535c00bd13423c0ee6d314b7a307394f5c630bada62553751a5470db42140 | simmone/racket-simple-qr | data-group-test.rkt | #lang racket
(require rackunit/text-ui)
(require rackunit "../../share/data-group.rkt")
(define test-data-group
(test-suite
"test-data-group"
(test-case
"test-defines->count_list"
(check-equal?
(defines->count-list '((1 . 19) (0 . 0)))
'(19))
(check-equal?
(defines->count-lis... | null | https://raw.githubusercontent.com/simmone/racket-simple-qr/904f1491bc521badeafeabd0d7d7e97e3d0ee958/simple-qr/tests/share/data-group-test.rkt | racket | #lang racket
(require rackunit/text-ui)
(require rackunit "../../share/data-group.rkt")
(define test-data-group
(test-suite
"test-data-group"
(test-case
"test-defines->count_list"
(check-equal?
(defines->count-list '((1 . 19) (0 . 0)))
'(19))
(check-equal?
(defines->count-lis... | |
50e74b360fc0d458ef960950f959bacf97cf7a77dcea01c64e6a929fb8287eb1 | etrepum/haskell-for-erlangers-2014 | MergeSort2.hs | -- MergeSort2.hs
module MergeSort2 (mergeSort) where
-- | Bottom-up merge sort.
mergeSort :: Ord a => [a] -> [a]
mergeSort = mergeAll . map (:[])
where
mergeAll [] = []
mergeAll [xs] = xs
mergeAll xss = mergeAll (mergePairs xss)
mergePairs (a:b:xs) =
merge a b : mergePairs xs
mergePairs... | null | https://raw.githubusercontent.com/etrepum/haskell-for-erlangers-2014/9fb88fd975df4a9eb1975d7ceb8758e6cb52cc36/examples/MergeSort2.hs | haskell | MergeSort2.hs
| Bottom-up merge sort. | module MergeSort2 (mergeSort) where
mergeSort :: Ord a => [a] -> [a]
mergeSort = mergeAll . map (:[])
where
mergeAll [] = []
mergeAll [xs] = xs
mergeAll xss = mergeAll (mergePairs xss)
mergePairs (a:b:xs) =
merge a b : mergePairs xs
mergePairs xs = xs
merge as@(a:as') bs@(b:bs')
... |
662b084098ee94054a6c043f5d97a83a86f165fcee654a09999d05a5e8da0714 | electric-sql/vaxine | inter_dc_query_router.erl | %% -------------------------------------------------------------------
%%
Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
%% >
%%
This file is provided... | null | https://raw.githubusercontent.com/electric-sql/vaxine/872a83ea8d4935a52c7b850bb17ab099ee9c346b/apps/antidote/src/inter_dc_query_router.erl | erlang | -------------------------------------------------------------------
>
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either expressed or implied. See the License for the
specific language governing perm... | Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
This file is provided to you under the Apache License ,
except in compliance with the License . You... |
be7010ad4fcb0f359d3ebd010e7822a243f2b8d7996c363e837e90fc1a7e18d1 | theodormoroianu/SecondYearCourses | HaskellChurchMonad_20210415140022.hs | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
toBool :: CBool Bool -> Bool
toBool b = cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: CBool t
cTrue = CBool $ \t f -> t
The boolean consta... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurchMonad_20210415140022.hs | haskell | The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply it on them.
A natural nu... | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
toBool :: CBool Bool -> Bool
toBool b = cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: CBool t
cTrue = CBool $ \t f -> t
The boolean consta... |
780721a178731eef4cf497b18aa2ba130852a375417282c6b038fe8d0d7c139e | dharmatech/abstracting | glu.scm |
(include "glu-header.scm")
(c-declare #<<declare-end
#include <GL/gl.h>
#include <GL/glu.h>
declare-end
)
(define gluBeginCurve (c-lambda (GLUnurbs* ) void "gluBeginCurve"))
(define gluBeginPolygon (c-lambda (GLUtesselator* ) void "gluBeginPolygon"))
(define gluBeginSurface (c-lambda (GLUnurbs* ) void "g... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/support/gambit/glu/glu.scm | scheme |
(include "glu-header.scm")
(c-declare #<<declare-end
#include <GL/gl.h>
#include <GL/glu.h>
declare-end
)
(define gluBeginCurve (c-lambda (GLUnurbs* ) void "gluBeginCurve"))
(define gluBeginPolygon (c-lambda (GLUtesselator* ) void "gluBeginPolygon"))
(define gluBeginSurface (c-lambda (GLUnurbs* ) void "g... | |
5c2f7823f2e969539fe6353494c3b9416d85a337d58d08f8aa043e13044616b9 | ghcjs/ghcjs-boot | IO.hs | # LANGUAGE Unsafe #
# LANGUAGE NoImplicitPrelude
, BangPatterns
, RankNTypes
, MagicHash
, UnboxedTuples
#
, BangPatterns
, RankNTypes
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIO... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/GHC/IO.hs | haskell | # OPTIONS_GHC -funbox-strict-fields #
# OPTIONS_HADDOCK hide #
---------------------------------------------------------------------------
|
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
Definitions for the 'IO' monad and its friends.
-----------------------------------------... | # LANGUAGE Unsafe #
# LANGUAGE NoImplicitPrelude
, BangPatterns
, RankNTypes
, MagicHash
, UnboxedTuples
#
, BangPatterns
, RankNTypes
, MagicHash
, UnboxedTuples
#-}
Module : GHC.IO
Copyright : ( c )... |
efc955bcbfb7dd8a2c86337bc5b5b5129848508099504f6affaae29fcfcab2f2 | LuxMiranda/herms | Tests.hs | module UnitConversions.Tests where
import Data.Tuple (swap)
import Instances ()
import Test.HUnit ((@?=))
import Test.QuickCheck ((===), (==>))
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (testCase)
import Test.Tasty.QuickCheck (testProperty)
import Types
import UnitConversions
isMetric :: Unit ->... | null | https://raw.githubusercontent.com/LuxMiranda/herms/cb2bf5be31090300cfd9cae5d5cbf1b1f13c65c4/test/UnitConversions/Tests.hs | haskell | module UnitConversions.Tests where
import Data.Tuple (swap)
import Instances ()
import Test.HUnit ((@?=))
import Test.QuickCheck ((===), (==>))
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (testCase)
import Test.Tasty.QuickCheck (testProperty)
import Types
import UnitConversions
isMetric :: Unit ->... | |
d34ff2a0063a128beaefe1f7887b9be3c3eefc15610aef97f46a37dff86b08b9 | OCamlPro/operf-micro | simple_access_a.ml | let get a i = a.(i - 1)
let sum a =
get a 1 +. get a 2 +. get a 3 +.
get a 4 +. get a 5 +. get a 6 +.
get a 7 +. get a 8 +. get a 9
let arr len =
Array.init len (fun i -> Array.make 9 (float_of_int i))
| null | https://raw.githubusercontent.com/OCamlPro/operf-micro/d5d2bf2068204b889321b0c5a7bc0d079c0fca80/share/operf-micro/benchmarks/num_analysis/simple_access_a.ml | ocaml | let get a i = a.(i - 1)
let sum a =
get a 1 +. get a 2 +. get a 3 +.
get a 4 +. get a 5 +. get a 6 +.
get a 7 +. get a 8 +. get a 9
let arr len =
Array.init len (fun i -> Array.make 9 (float_of_int i))
| |
2a84dbd8c02b0d3acf2be9fefda4da2f698f2b32c1dc3197a11f8db6483ac32c | jaju/lucene-clj | project.clj | (def lucene-version "9.4.2")
(defproject org.msync/lucene-clj "0.2.0-SNAPSHOT"
:description "Lucene bindings for Clojure"
:url "-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.apache.lucene/lucene-core ~lucene-ver... | null | https://raw.githubusercontent.com/jaju/lucene-clj/715bc5bd1516dbc71dc7a4f67a8e9a0555b7b14a/project.clj | clojure | (def lucene-version "9.4.2")
(defproject org.msync/lucene-clj "0.2.0-SNAPSHOT"
:description "Lucene bindings for Clojure"
:url "-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.apache.lucene/lucene-core ~lucene-ver... | |
f1a9ba58bb804dee0978a6ea9e2da3709bde9cfb47277fb6e51f04ccea9b73ed | CatalaLang/catala | name_resolution.mli | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 , contributor :
< >
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with th... | null | https://raw.githubusercontent.com/CatalaLang/catala/5e063dac1b41d77ae44279452f2d03d51e3efaca/compiler/desugared/name_resolution.mli | ocaml | * All variables, including scope variables and subscopes
* What is the default rule to refer to for unnamed exceptions, if any
* Other scopes referred to by this scope. Used for dependency analysis
* Inside a scope, we distinguish between the variables and the subscopes.
* Types of the fields of a struct
* Types o... | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 , contributor :
< >
< >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this file except in compliance with th... |
c7b292b4b2da86cf4b9ef2984f8f559609f600dbbe24eea09c00bee20ceb3e2f | sheyll/b9-vm-image-builder | Docker.hs | module B9.B9Config.Docker
( dockerConfigToCPDocument,
defaultDockerConfig,
parseDockerConfig,
DockerConfig (..),
dockerNetworkId,
dockerCapabilities,
)
where
import B9.B9Config.Container
import Control.Lens (makeLenses)
import Data.ConfigFile.B9Extras
data DockerConfig
= DockerConfig
{... | null | https://raw.githubusercontent.com/sheyll/b9-vm-image-builder/4d2af80d3be4decfce6c137ee284c961e3f4a396/src/lib/B9/B9Config/Docker.hs | haskell | module B9.B9Config.Docker
( dockerConfigToCPDocument,
defaultDockerConfig,
parseDockerConfig,
DockerConfig (..),
dockerNetworkId,
dockerCapabilities,
)
where
import B9.B9Config.Container
import Control.Lens (makeLenses)
import Data.ConfigFile.B9Extras
data DockerConfig
= DockerConfig
{... | |
85f371f771f992ce9de36e74db0741fb5b7322b1156bddeb9ed4cb94d98e1205 | spechub/Hets | Isa2DG.hs | |
Module : ./Isabelle / Isa2DG.hs
Description : Import data generated by hol2hets into a DG
Copyright : ( c ) , DFKI GmbH 2010
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
Module : ./Isabelle/Isa2D... | null | https://raw.githubusercontent.com/spechub/Hets/f582640a174df08d4c965d7c0a1ab24d1a31000d/Isabelle/Isa2DG.hs | haskell | |
Module : ./Isabelle / Isa2DG.hs
Description : Import data generated by hol2hets into a DG
Copyright : ( c ) , DFKI GmbH 2010
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
Module : ./Isabelle/Isa2D... | |
e75de1d1903bb7e6effb498e8d2fca705e915f9be78bb5accbb38751fff4a137 | exercism/clojurescript | raindrops_test.cljs | (ns raindrops-test
(:require raindrops
[cljs.test :refer [deftest testing are is] :as t :include-macros true]))
(deftest literals
(testing "Testing one and two literals..."
(is (= "1" (raindrops/convert 1)))
(is (= "2" (raindrops/convert 2)))))
(deftest three
(testing "Testing, three..."
... | null | https://raw.githubusercontent.com/exercism/clojurescript/7700a33e17a798f6320aad01fb59a637bd21e12b/exercises/practice/raindrops/test/raindrops_test.cljs | clojure | (ns raindrops-test
(:require raindrops
[cljs.test :refer [deftest testing are is] :as t :include-macros true]))
(deftest literals
(testing "Testing one and two literals..."
(is (= "1" (raindrops/convert 1)))
(is (= "2" (raindrops/convert 2)))))
(deftest three
(testing "Testing, three..."
... | |
b2b320b7c9f4cf10553015a553d70a46393ac99beb29202062f36ed45ccbe6ea | static-analysis-engineering/codehawk | jCHSplitArray.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchsys/jCHSplitArray.ml | ocaml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... | |
405414d894a9b25e19042a9c7b0a6c3691c64f62016a14db43379cdd769c219f | roddyyaga/ocoi | db.ml | open Core
let hostname =
match Sys.getenv "POSTGRES_HOSTNAME" with Some s -> s | None -> "localhost"
let pool =
Ocoi.Db.make_pool
(Printf.sprintf "postgresql:12345@%s:5432/postgres" hostname)
let execute query = Caqti_lwt.Pool.use query pool
| null | https://raw.githubusercontent.com/roddyyaga/ocoi/0a07e9457add9890cb507ac8bb4e55044d86a640/ocoi/share/project_template/db/db.ml | ocaml | open Core
let hostname =
match Sys.getenv "POSTGRES_HOSTNAME" with Some s -> s | None -> "localhost"
let pool =
Ocoi.Db.make_pool
(Printf.sprintf "postgresql:12345@%s:5432/postgres" hostname)
let execute query = Caqti_lwt.Pool.use query pool
| |
d2b6c770b23ab0a6d564f3e610b0682326f882038702f463e42ac44d715c0854 | vult-dsp/vult | printProg.ml |
The MIT License ( MIT )
Copyright ( c ) 2014 ,
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
... | null | https://raw.githubusercontent.com/vult-dsp/vult/860b2b7a8e891aa729578175a931ce2a9345428b/src/core/printProg.ml | ocaml | * Printing of types
* Add an identifier to the print buffer
* Adds to the print buffer an expression
* Adds to the print buffer an expression list
* Adds to the print buffer a statement in a block list
* Adds to the print buffer a statement in a block list
* Adds a val declaration part of a type definition
* Con... |
The MIT License ( MIT )
Copyright ( c ) 2014 ,
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
... |
ba9bc38f131b6e29189d641fb192fb8d85b01bac450078f3e0ea6674fd225dd4 | mzp/bs-lwt | lwt_chan.ml | Lightweight thread library for OCaml
*
* Module Lwt_chan
* Copyright ( C ) 2005 - 2008
* Laboratoire PPS - CNRS Université Paris Diderot
* 2009
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Publ... | null | https://raw.githubusercontent.com/mzp/bs-lwt/f37a3c47d038f4efcd65912c41fab95d1e6633ce/lwt/src/unix/lwt_chan.ml | ocaml | Lightweight thread library for OCaml
*
* Module Lwt_chan
* Copyright ( C ) 2005 - 2008
* Laboratoire PPS - CNRS Université Paris Diderot
* 2009
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Publ... | |
8c3323eeb79304f7cd7259c467ca7a17128912215144d1f618feb0d709751009 | SHoltzen/dice | Compiler.mli | open VarState
open Core
open Wmc
(** Result of compiling an expression *)
type compiled_expr = {
state: Bdd.bddptr btree;
z: Bdd.bddptr;
flips: Bdd.bddptr List.t}
type compiled_func = {
args: (Bdd.bddptr btree) List.t;
body: compiled_expr;
}
type compile_context = {
man: Bdd.manager;
name_map: (Bdd.la... | null | https://raw.githubusercontent.com/SHoltzen/dice/83a52ead59f6c7c13c5c0f79dbd89eeb4e4e581a/lib/Compiler.mli | ocaml | * Result of compiling an expression
map from variable identifiers to names, for debugging
map from variables to weights
true if lazy let evaluation
* Compile the input program to a [compiled_program]
* [parse_with_error] parses [lexbuf] as a program or fails with a syntax error
* [parse_and_prob]: [debug flag]... | open VarState
open Core
open Wmc
type compiled_expr = {
state: Bdd.bddptr btree;
z: Bdd.bddptr;
flips: Bdd.bddptr List.t}
type compiled_func = {
args: (Bdd.bddptr btree) List.t;
body: compiled_expr;
}
type compile_context = {
man: Bdd.manager;
funcs: (String.t, compiled_func) Hashtbl.Poly.t;
}
type c... |
09c91c777546a7fe736f1aa46f0113a18dcb13bd89122a58058f108b82255721 | bzliu94/cs61a_fa07 | scheme1_with_map_and_let.scm | ;; Simple evaluator for Scheme without DEFINE, using substitution model.
Version 1 : No DEFINE , only primitive names are global .
;; The "read-eval-print loop" (REPL):
(define (scheme-1)
(display "Scheme-1: ")
(flush)
(print (eval-1 (read)))
(scheme-1))
Two important procedures :
;; EVAL-1 takes an expr... | null | https://raw.githubusercontent.com/bzliu94/cs61a_fa07/12a62689f149ef035a36b326351928928f6e7b5d/01%20-%20homework/hw6/scheme1_with_map_and_let.scm | scheme | Simple evaluator for Scheme without DEFINE, using substitution model.
The "read-eval-print loop" (REPL):
EVAL-1 takes an expression and returns its value.
APPLY-1 takes a procedure and a list of actual argument values, and
calls the procedure.
which have similar meanings.
Comments on EVAL-1:
procedure is here... | Version 1 : No DEFINE , only primitive names are global .
(define (scheme-1)
(display "Scheme-1: ")
(flush)
(print (eval-1 (read)))
(scheme-1))
Two important procedures :
They have these names to avoid conflict with STk 's EVAL and APPLY ,
There are four basic expression types in Scheme :
1 . ... |
29de3ad1648cad32f3d83538782031edc8701a2c9dbf119578d5f3c13fb3936d | SmallImprovements/spring-clean | Main.hs | module Main where
import Control.Exception (evaluate)
import Data.List (isSuffixOf)
import Java (importsToResult, parseAst, toAst, fileName, Result)
import DependencyGraph (getUnused)
import Data.Either (rights)
import Config
import System.FilePath.Find (
(==?), find, always, fileType, (&&?),
FileType(RegularFile)... | null | https://raw.githubusercontent.com/SmallImprovements/spring-clean/000b10dcb570847d60fed3eb4539781ab20ae5b5/src/Main.hs | haskell | module Main where
import Control.Exception (evaluate)
import Data.List (isSuffixOf)
import Java (importsToResult, parseAst, toAst, fileName, Result)
import DependencyGraph (getUnused)
import Data.Either (rights)
import Config
import System.FilePath.Find (
(==?), find, always, fileType, (&&?),
FileType(RegularFile)... | |
c5acbfbe65a9ff85d2c932b3b54e0e6ab46a37ade3a913d5e7343ca9594b35ea | NorfairKing/hastory | Gather.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
module Hastory.Cli.Commands.Gather where
import Control.Monad.IO.Unlift (MonadUnliftIO)
import Control.Monad.Reader
import Data.Text (Text)
import qualified Data.Text.IO as T
import Database.Persist.Sqlite (Entity, upsertBy)
import Hastory.API.Gather
import H... | null | https://raw.githubusercontent.com/NorfairKing/hastory/35abbc79155bc7c5a0f6e0f3618c8b8bcd3889a1/hastory-cli/src/Hastory/Cli/Commands/Gather.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
module Hastory.Cli.Commands.Gather where
import Control.Monad.IO.Unlift (MonadUnliftIO)
import Control.Monad.Reader
import Data.Text (Text)
import qualified Data.Text.IO as T
import Database.Persist.Sqlite (Entity, upsertBy)
import Hastory.API.Gather
import H... | |
1cc47316204fb58ca149a6caa9e090e9933fd3170e9cbafeee6840090d46dcef | soupi/strema-mirror | Ast.hs | | A subset of JavaScript AST
module Language.Backend.JS.Ast where
import qualified Data.Text as T
import qualified Data.Map as M
data File
= File [Statement]
deriving Show
data Definition
= Variable Var Expr
| Function Var [Var] Block
deriving Show
type Block = [Statement]
data Statement
= SExpr Exp... | null | https://raw.githubusercontent.com/soupi/strema-mirror/35f2b7b7ccb9f35127d048a3e693f78f8702def1/src/backend/src/Language/Backend/JS/Ast.hs | haskell | Expr.label = Expr | | A subset of JavaScript AST
module Language.Backend.JS.Ast where
import qualified Data.Text as T
import qualified Data.Map as M
data File
= File [Statement]
deriving Show
data Definition
= Variable Var Expr
| Function Var [Var] Block
deriving Show
type Block = [Statement]
data Statement
= SExpr Exp... |
97204f76e3da215951cda2212bdef2c1b4c327ae9b388f085493154409b66ad2 | Novus-School/novus | db.clj | (ns novus.account.db)
(defn transact-account
[])
(defn retract-account
[])
| null | https://raw.githubusercontent.com/Novus-School/novus/c65b37a654173df52084253651edc87033409f4b/novus/src/main/novus/account/db.clj | clojure | (ns novus.account.db)
(defn transact-account
[])
(defn retract-account
[])
| |
680b9381cc8fd7d9230c28deb3fff4fb8bd6266bb98a1c3429af4f46dac04ff4 | hslua/hslua | hslua.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
|
Module : Main
Copyright : © 2022 - 2023 : MIT
Maintainer : - implementation of the standard Lua interpreter .
Module : Main
Copyright : © 2022-2023 Albert Krewinkel
License : MIT
Maintainer : Albert Kre... | null | https://raw.githubusercontent.com/hslua/hslua/178c225f3da193f09fc27877a5a30e66eef069fb/hslua-cli/app/hslua.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TypeApplications #
|
Module : Main
Copyright : © 2022 - 2023 : MIT
Maintainer : - implementation of the standard Lua interpreter .
Module : Main
Copyright : © 2022-2023 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <>
Re-implementation of the... |
307057fa55fec238e25efd9d67d814ffda1a3e8f54851e47098f2f346787b71b | chiroptical/book-of-monads | Lib.hs | module Lib where
data Tree a
= Leaf a
| Node (Tree a) (Tree a)
numberOfLeaves :: Tree a -> Integer
numberOfLeaves (Leaf _) = 1
numberOfLeaves (Node l r) = numberOfLeaves l + numberOfLeaves r
example :: Tree Integer
example =
Node
(Node (Leaf 1) (Node (Leaf 2) (Leaf 3)))
(Node (Node (Leaf 4) (Leaf 5))... | null | https://raw.githubusercontent.com/chiroptical/book-of-monads/c2eff1c67a8958b28cfd2001d652f8b68e7c84df/chapter1/src/Lib.hs | haskell | data [a] = [] | a : [a]
hlint suggests this should be `foldr (:) input2 input1`
then_ :: Maybe a -> (a -> Maybe a) -> Maybe b
Is it possible to flattenMaybe using only then_?
f :: [a] -> (a -> [b]) -> [b], concatMap
class Functor f => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b
... | module Lib where
data Tree a
= Leaf a
| Node (Tree a) (Tree a)
numberOfLeaves :: Tree a -> Integer
numberOfLeaves (Leaf _) = 1
numberOfLeaves (Node l r) = numberOfLeaves l + numberOfLeaves r
example :: Tree Integer
example =
Node
(Node (Leaf 1) (Node (Leaf 2) (Leaf 3)))
(Node (Node (Leaf 4) (Leaf 5))... |
6ba48e87962986802d2460cbc71851df9880c601325e88daa241a1a028d5b06c | clojure-interop/google-cloud-clients | WebSecurityScannerClient$ListCrawledUrlsPage.clj | (ns com.google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient$ListCrawledUrlsPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.websecurityscanner.v1beta WebSecurityScannerClient$ListCrawledUrlsPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.websecurityscanner/src/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient%24ListCrawledUrlsPage.clj | clojure | (ns com.google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient$ListCrawledUrlsPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.websecurityscanner.v1beta WebSecurityScannerClient$ListCrawledUrlsPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`... | |
229a94710b7becb411ca07834868ad0d9d2a6b612e54b1b64d6da4ecd6107378 | cj1128/sicp-review | 3.47.scm | Exercise 3.47
;; Implements semaphores using mutex or atomic tet-and-set! operations
;; using mutex
(define (make-semaphore n)
(let ((lock (make-mutex)) (count 0))
(define (semaphore m)
(cond ((eq? m 'acquire)
(lock 'acquire)
(if (= count n)
(begin
... | null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-3/3.4/3.47.scm | scheme | Implements semaphores using mutex or atomic tet-and-set! operations
using mutex | Exercise 3.47
(define (make-semaphore n)
(let ((lock (make-mutex)) (count 0))
(define (semaphore m)
(cond ((eq? m 'acquire)
(lock 'acquire)
(if (= count n)
(begin
(lock 'release)
(semaphore 'acquire))
(begin
... |
63893805ad724eeee2db2b76a151dbd8e6edfe8779edbfd1260de5d9a76e2bff | elaforge/karya | NoteEntry.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
# LANGUAGE ViewPatterns #
| This module implements entry by intercepting and MIDI events and
re - emitting them as InputNotes . These then go to the track - specific edit
... | null | https://raw.githubusercontent.com/elaforge/karya/99194874139230dbb9c4d1918082f5a65d2a4d90/Cmd/NoteEntry.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
* with_note
| Like 'cmds_with_input', but figure out kbd_entry and patch on my own.
| Convert a Msg to 'Msg.InputNote's, if applicable. Returns Nothing if
this other cmds shouldn't get it).
| Convert a key... | Copyright 2013
# LANGUAGE ViewPatterns #
| This module implements entry by intercepting and MIDI events and
re - emitting them as InputNotes . These then go to the track - specific edit
cmds to enter notes and to " Cmd . MidiThru " which re - emits them as MIDI .
re-emitting them as InputNo... |
b59691a3e4583c06fb93a7a56924476382c1b3ef9a564e649e23e934fe6c4bfa | ddssff/refact-global-hse | MoveSpec.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
module MoveSpec(MoveSpec(MoveSpec)
, applyMoveSpec
, traceMov... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/tests/expected/decl6/MoveSpec.hs | haskell | # LANGUAGE PackageImports #
# LANGUAGE RankNTypes #
| Specifies where to move each declaration of each module. Given a
departure module key and a declaration, return an arrival module key.
| Build the argument to moveInstDecls
| Build the argument to moveInstDecls | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
module MoveSpec(MoveSpec(MoveSpec)
, applyMoveSpec
, traceMoveSpec
, moveDeclsByName
, moveInstDecls
, instCl... |
61c97b65036e401d58f583698d4f85f7bc64bb77b6352d47f0acdca4867e4c50 | tdammers/sprinkles | Common.hs | # LANGUAGE NoImplicitPrelude #
{-#LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLists #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DeriveGeneric #
module Web.Sprinkles.Handlers.Common
where
im... | null | https://raw.githubusercontent.com/tdammers/sprinkles/a9161e4506427a3cf5f686654edc7ed9aa3ea82b/src/Web/Sprinkles/Handlers/Common.hs | haskell | #LANGUAGE OverloadedStrings #
No session means there's no need to check the
CSRF token, because without a session, the user
cannot be holding an authenticated identity. | # LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedLists #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DeriveGeneric #
module Web.Sprinkles.Handlers.Common
where
import Web.Sprinkles.Prelude
import ... |
0e68a5f00f0069071a130cbac9966b64828b900920e37a5dd6c5dd42df21dc96 | bvaugon/ocapic | sfr.ml | (*************************************************************************)
(* *)
(* OCaPIC *)
(* *)
... | null | https://raw.githubusercontent.com/bvaugon/ocapic/a14cd9ec3f5022aeb5fe2264d595d7e8f1ddf58a/src/ocasim/sfr.ml | ocaml | ***********************************************************************
OCaPIC
... |
This file is distributed under the terms of the CeCILL license .
let ofs = 0xF00
let porta = 0xF80
let portb = 0xF81
let portc = 0xF82
let portd = 0xF83
let porte = 0xF84
let lata = 0xF89
let latb = 0xF8A
let latc = 0xF8B... |
4c0e89fda79056f317ab80c0167b99138ae4bb9bc3f0d10ee27e0f6518f32334 | dnadales/sandbox | TextViaSockets.hs | # LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
-- | Simple line-based text communication via sockets.
module Network.TextViaSockets
( Connection ()
, connectTo
, connectToWithRetry
, readLineFrom
, putLineTo
, close
, acceptOn
, acceptOnSocket
, getFreeSocket
... | null | https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/receiving-strings-via-sockets/src/Network/TextViaSockets.hs | haskell | # LANGUAGE OverloadedStrings #
| Simple line-based text communication via sockets.
| Accept byte-streams by serving on the given port number. This function
will block until a client connects to the server.
| Like @acceptOn@ but it asks the operating system for a free port, and
returns this free port number toget... | # LANGUAGE NamedFieldPuns #
module Network.TextViaSockets
( Connection ()
, connectTo
, connectToWithRetry
, readLineFrom
, putLineTo
, close
, acceptOn
, acceptOnSocket
, getFreeSocket
) where
import Network.Socket hiding (recv, close, send)
import qualified Network.Socket... |
3936ba7f9f4b78070f70f0c4c8961897f42a1bf4a2139c45c251f9e76e990f79 | Bwooce/open-cgf | gtpp_tcp_server.erl | %%%-------------------------------------------------------------------
%%% File : gtp_tcp_server.erl
Author : < >
%%% Description :
%%%
Created : 22 May 2008 by < >
%%%
Copyright 2008
%%%
%%% This file is part of open-cgf.
%%%
%%% open-cgf is free software: you can redistribute it and/or modify
it ... | null | https://raw.githubusercontent.com/Bwooce/open-cgf/929f7e280493ca4bc47be05bb931044ee1321594/src/gtpp_tcp_server.erl | erlang | -------------------------------------------------------------------
File : gtp_tcp_server.erl
Description :
This file is part of open-cgf.
open-cgf is free software: you can redistribute it and/or modify
open-cgf is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the... | Author : < >
Created : 22 May 2008 by < >
Copyright 2008
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have received a copy of the GNU General Public License
-module(gtpp_tcp_server).
-behaviour(gen_server).
-define(SERVE... |
647686b780b6164a7a3f8400bc95d0a34c37f36a8f1dd9fde398cc3529d136ab | gsdlab/clafer | StringAnalyzer.hs | # LANGUAGE RankNTypes , KindSignatures , FlexibleContexts #
Copyright ( C ) 2012 - 2017 , , < >
Permission is hereby granted , free of charge , to any person obtaining a copy of
this software and associated documentation files ( the " Software " ) , to deal in
the Software without restriction , incl... | null | https://raw.githubusercontent.com/gsdlab/clafer/a30a645ae1e4fc793851e53446d220924038873a/src/Language/Clafer/Intermediate/StringAnalyzer.hs | haskell | | Convert all strings into ints for analysis
| Return an inverse map from ints back to strings
astrs single subclafer | # LANGUAGE RankNTypes , KindSignatures , FlexibleContexts #
Copyright ( C ) 2012 - 2017 , , < >
Permission is hereby granted , free of charge , to any person obtaining a copy of
this software and associated documentation files ( the " Software " ) , to deal in
the Software without restriction , incl... |
ff52c593c2474ec197211a332cce41f75593bbe9d08f96db0af2d94486513c6f | mbutterick/aoc-racket | 13.rkt | #lang br
(require racket/file rackunit racket/dict)
(match-define (cons target buses-all)
(for/list ([tok
(in-port read
(open-input-string
(string-replace (file->string "13.rktd") "," " ")))])
tok))
(define (overshoot bus)
(for/last ([i (in-naturals... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2020/13.rkt | racket | #lang br
(require racket/file rackunit racket/dict)
(match-define (cons target buses-all)
(for/list ([tok
(in-port read
(open-input-string
(string-replace (file->string "13.rktd") "," " ")))])
tok))
(define (overshoot bus)
(for/last ([i (in-naturals... | |
e5d677a6e8adb881a7c2f82b876deee961c12194c57510a704d4d44ecde4782b | anwarmamat/cmsc330fall19public | evalUtils.ml | open Parser
open Lexer
open SmallCTypes
open TokenTypes
(* Buffers for testing prints *)
let (print_buffer : Buffer.t) = Buffer.create 100
let flush_print_buffer () : unit = Buffer.clear print_buffer;;
let assert_buffer_equal (s : string) : unit =
let c = Buffer.contents print_buffer in
if not (s = c) then failwi... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330fall19public/e3156c0438a4ccc78793a94cd62fe19d01688c0b/project4b/src/evalUtils.ml | ocaml | Buffers for testing prints
This is the print you must use for the project
Parse the tokens
Read the file into lines
Compress to a single string
Pass string off
Removes shadowed bindings from an execution environment
Eval report print function | open Parser
open Lexer
open SmallCTypes
open TokenTypes
let (print_buffer : Buffer.t) = Buffer.create 100
let flush_print_buffer () : unit = Buffer.clear print_buffer;;
let assert_buffer_equal (s : string) : unit =
let c = Buffer.contents print_buffer in
if not (s = c) then failwith ("Printed: '" ^ c ^ "' Expecte... |
811a3359589b2f035f1d8a06bf876777cf404de7990bd745491ca84108b953b6 | biegunka/terminal-size | Common.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
{-# LANGUAGE DeriveTraversable #-}
#if __GLASGOW_HASKELL__ >= 702
#define LANGUAGE_DeriveGeneric
# LANGUAGE DeriveGeneric #
#endif
module System.Console.Terminal.Common
( Window(..)
) where
import Data.Dat... | null | https://raw.githubusercontent.com/biegunka/terminal-size/d47596c281390f091eb97e3cd40ee374c7f29314/src/System/Console/Terminal/Common.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveTraversable #
| Terminal window width and height | # LANGUAGE CPP #
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
#if __GLASGOW_HASKELL__ >= 702
#define LANGUAGE_DeriveGeneric
# LANGUAGE DeriveGeneric #
#endif
module System.Console.Terminal.Common
( Window(..)
) where
import Data.Data (Typeable, Data)
#if __GLASGOW_HASKELL__ < 710
import Data.Foldable ... |
cb61d96efda029a5671ff3403e366c084cf2908b4437e4c0e3517169032a000c | OCamlPro/liquidity | liquidReasonParse.ml | (****************************************************************************)
(* Liquidity *)
(* *)
Copyright ( C ) 2017 - 2020 OCamlPro SAS
(* ... | null | https://raw.githubusercontent.com/OCamlPro/liquidity/3578de34cf751f54b9e4c001a95625d2041b2962/tools/liquidity/reason/liquidReasonParse.ml | ocaml | **************************************************************************
Liquidity
... | Copyright ( C ) 2017 - 2020 OCamlPro SAS
it under the terms of the GNU General Public License as published by
... |
010d288100593efd6c55b0df7e98c349d7f298ca909e280859acfbe125be6091 | AndrasKovacs/ELTE-func-lang | Notes07.hs | # language DeriveFunctor , InstanceSigs #
--------------------------------------------------------------------------------
parser folyt , kombinátorok ( sepBy etc ) , debug , adat olvasás
token parserek
-- operátor parser
--------------------------------------------------------------------------------
import Cont... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/d6e50f0b54ba9dbb3bc2ba0c2e568691cf893932/2021-22-2/ea/Notes07.hs | haskell | ------------------------------------------------------------------------------
operátor parser
------------------------------------------------------------------------------
olvassunk egy konkrét String-et
mindig hibázó parser
Control.Applicative-ból:
0 - szor vagy többször futtatja
1 - szer vagy többször futtatj... | # language DeriveFunctor , InstanceSigs #
parser folyt , kombinátorok ( sepBy etc ) , debug , adat olvasás
token parserek
import Control.Applicative
import Control.Monad
import Debug.Trace
isSpace , isDigit
newtype Parser a = Parser {runParser :: String -> Maybe (a, String)}
deriving (Functor)
instance Appl... |
afe18f688d646acc995dcfd788df63b90743b45ccd4d0b9892987add8dbf3d89 | dterei/SafeHaskellExamples | TrustedRun.hs | # LANGUAGE Trustworthy #
module Main where
import safe TrustedLib
import safe UntrustedPlug
main = do
let r = res [(1::Int)]
putStrLn $ "Result: " ++ show r
putStrLn $ "Result: " ++ show function
| null | https://raw.githubusercontent.com/dterei/SafeHaskellExamples/0f7bbb53cf1cbb8419ce3a4aa4258b84be30ffcc/incoherent/TrustedRun.hs | haskell | # LANGUAGE Trustworthy #
module Main where
import safe TrustedLib
import safe UntrustedPlug
main = do
let r = res [(1::Int)]
putStrLn $ "Result: " ++ show r
putStrLn $ "Result: " ++ show function
| |
8e637fb2c4eaa486f7e7abf3ead9275028166cdcc4602d282070a0c7f3ae1a39 | cpeikert/Lol | Instances.hs | |
Module : Crypto . Lol . Cyclotomic . Tensor . . Instances
Description : RT - specific instances .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
RT - specific instances .
Module ... | null | https://raw.githubusercontent.com/cpeikert/Lol/4416ac4f03b0bff08cb1115c72a45eed1fa48ec3/lol-repa/Crypto/Lol/Cyclotomic/Tensor/Repa/Instances.hs | haskell | # LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
Unbox, when underlying representation is
purloined and tweaked from code in `vector` package that defines
types as unboxed
Unbox, when underlying representation is
purloined and tweaked from code in `vector` package that defines
types ... | |
Module : Crypto . Lol . Cyclotomic . Tensor . . Instances
Description : RT - specific instances .
Copyright : ( c ) , 2011 - 2017
, 2011 - 2017
License : GPL-3
Maintainer :
Stability : experimental
Portability : POSIX
RT - specific instances .
Module ... |
bcf1a9b3885f253920d8bc4de80a6587d162dbb513c100682bd271d7c8db8dae | fragnix/fragnix | OrdRequiresEq.hs | module OrdRequiresEq where
data Uni = Uni
deriving (Ord)
instance Eq Uni where
(==) Uni Uni = True
| null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/quick/OrdRequiresEq/OrdRequiresEq.hs | haskell | module OrdRequiresEq where
data Uni = Uni
deriving (Ord)
instance Eq Uni where
(==) Uni Uni = True
| |
ed4f7d085585c6e154cbe0ab6cddf1f46d5147da4b4ac4d646889ef7406db925 | rametta/retros | Edit.hs | module Web.View.Retros.Edit where
import Web.View.Prelude
newtype EditView = EditView { retro :: Retro }
instance View EditView where
html EditView { .. } = renderModal Modal
{ modalTitle = "Edit Retro"
, modalCloseUrl = pathTo $ ShowRetroAction $ get #id retro
, modalFooter = Nothing
... | null | https://raw.githubusercontent.com/rametta/retros/624290889df98cd2eb3c37848eeae15281eeda54/Web/View/Retros/Edit.hs | haskell | module Web.View.Retros.Edit where
import Web.View.Prelude
newtype EditView = EditView { retro :: Retro }
instance View EditView where
html EditView { .. } = renderModal Modal
{ modalTitle = "Edit Retro"
, modalCloseUrl = pathTo $ ShowRetroAction $ get #id retro
, modalFooter = Nothing
... | |
58957441da2f39c199dbd99f7830bec3bbe18da9678bddc899a2c34c8d4258f7 | uim/sigscheme | scm-r4rstest.scm | Copyright ( C ) 1991 , 1992 , 1993 , 1994 , 1995 , 2000 , 2003 , 2004 , 2006 , 2007 Free Software Foundation , Inc.
;;
;; This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation ; either version 2 , or (... | null | https://raw.githubusercontent.com/uim/sigscheme/ccf1f92d6c2a0f45c15d93da82e399c2a78fe5f3/test/scm-r4rstest.scm | scheme |
This program is free software; you can redistribute it and/or modify it
either version 2 , or ( at your option ) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ... | Copyright ( C ) 1991 , 1992 , 1993 , 1994 , 1995 , 2000 , 2003 , 2004 , 2006 , 2007 Free Software Foundation , Inc.
under the terms of the GNU General Public License as published by the
To receive a copy of the GNU General Public License , write to the
Free Software Foundation , Inc. , 59 Temple Place - Suite 3... |
056caa46881b2c2b661b12f1d4113c0da80c87073a6e73902ad623e81e37328c | hemmi/coq2scala | string_syntax.ml | (***********************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - Rocquencourt & LRI - CNRS - Orsay
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ... | null | https://raw.githubusercontent.com/hemmi/coq2scala/d10f441c18146933a99bf2088116bd213ac3648d/coq-8.4pl2/plugins/syntax/string_syntax.ml | ocaml | *********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
*********************************************************************
make a string term from the string s | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - Rocquencourt & LRI - CNRS - Orsay
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Util
open Name... |
1a8d48d7c0e256102ac7b419abeb6e030acb3a39d37d230f31da7126a1077a9f | hyperfiddle/electric | popover0.cljc | (ns dustin.y2022.popover0
(:require #?(:clj [datomic.api :as d])
#?(:cljs goog.events)
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui :as ui]
[hyperfiddle.rcf :refer [tests tap % with]]
[missionary.core :as m])... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/popover/popover0.cljc | clojure | only client
popover anchor
popover body
discard, commit
client bias, careful
fork | (ns dustin.y2022.popover0
(:require #?(:clj [datomic.api :as d])
#?(:cljs goog.events)
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.photon-ui :as ui]
[hyperfiddle.rcf :refer [tests tap % with]]
[missionary.core :as m])... |
0e1c6f4d4fe7f327190916677d95df5dded25da33850e5f099a895e71248bd22 | avsm/mirage-duniverse | s.ml |
* Copyright ( c ) 2013,2014 Citrix Systems Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " A... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/vchan/lib/s.ml | ocaml | * an event notification received from a remote domain. Events contain no
data and may be coalesced. Domains which are blocked will be woken up
by an event.
* represents an event which 'fired' when the program started
* [send channel] sends an event along [channel], to another domain
which will be wo... |
* Copyright ( c ) 2013,2014 Citrix Systems Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " A... |
d8d6d80904c2e80d4c0e22512b9f7a86f7b5297f1410068a11287110109f5af3 | waxeye-org/waxeye | racketscript.rkt | Compiles an entry point for using compiled to JavaScript via RacketScript .
;; Defines a window.waxeyeCompiler object.
#lang racketscript/base
(require racketscript/interop
racketscript/browser
waxeye/ast
(only-in "gen.rkt" start-nt!)
(only-in "transform.rkt" transform-grammar)
... | null | https://raw.githubusercontent.com/waxeye-org/waxeye/723da0475fc0c8e3dd43da46665ef7c62734857b/src/waxeye/racketscript.rkt | racket | Defines a window.waxeyeCompiler object. | Compiles an entry point for using compiled to JavaScript via RacketScript .
#lang racketscript/base
(require racketscript/interop
racketscript/browser
waxeye/ast
(only-in "gen.rkt" start-nt!)
(only-in "transform.rkt" transform-grammar)
(only-in "javascript.rkt" gen-java... |
7614e12ffce886e3b3039ddd9ef96112b3f005387a2d65954df6e3631c9b9fa0 | janestreet/bonsai | app_test.ml | open! Core
open! Bonsai_web_test
open! Bonsai_web
let hello_world = Bonsai_testing_example_lib.hello_world
let hello_user = Bonsai_testing_example_lib.hello_user
let hello_textbox = Bonsai_testing_example_lib.hello_textbox
(* $MDX part-begin=hello-world-test *)
module Handle = Bonsai_web_test.Handle
module Result_spe... | null | https://raw.githubusercontent.com/janestreet/bonsai/4baeedc75bf73a0915e04dc02d8a49b78779e9b0/examples/testing_example/test/app_test.ml | ocaml | $MDX part-begin=hello-world-test
$MDX part-end
$MDX part-begin=hello-user-test
$MDX part-end
$MDX part-begin=hello-user-diff-test
$MDX part-end
$MDX part-begin=hello-text-box-diff-test
$MDX part-end
$MDX part-begin=state-test
$MDX part-end | open! Core
open! Bonsai_web_test
open! Bonsai_web
let hello_world = Bonsai_testing_example_lib.hello_world
let hello_user = Bonsai_testing_example_lib.hello_user
let hello_textbox = Bonsai_testing_example_lib.hello_textbox
module Handle = Bonsai_web_test.Handle
module Result_spec = Bonsai_web_test.Result_spec
let%ex... |
79efc56470772f12be1f5cfc75de6e1481f1c76e3c4551fe7b805291d850a0a3 | den1k/vimsical | protocol.clj | (ns vimsical.backend.components.delta-store.protocol)
(defprotocol IDeltaStoreChan
(select-deltas-chan [_ vims-uid])
(insert-deltas-chan [_ vims-uid user-uid vims-session deltas])
(select-vims-session-chan [_ vims-uid user-uid]))
| null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/backend/vimsical/backend/components/delta_store/protocol.clj | clojure | (ns vimsical.backend.components.delta-store.protocol)
(defprotocol IDeltaStoreChan
(select-deltas-chan [_ vims-uid])
(insert-deltas-chan [_ vims-uid user-uid vims-session deltas])
(select-vims-session-chan [_ vims-uid user-uid]))
| |
c8922c28c3dae24043873f974983408b045595a61eabdca50c66e0c8ea33cdb5 | LPCIC/matita | nCicCoercion.ml |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/ng_refiner/nCicCoercion.ml | ocaml |
||M|| This file is part of HELM , an Hypertextual , Electronic
||A|| Library of Mathematics , developed at the Computer Science
||T|| Department , University of Bologna , Italy .
||I||
||T||... | |
522e3b58b718463357f9fcbd3b07046e847e4507413ae431a5a5d575025aed75 | johnyob/dromedary | test_pr10735.ml | open! Import
open Util
let%expect_test "" =
let str =
{|
type 'a t;;
type 'a u;;
type ('a, 'b) eq =
| Refl constraint 'a = 'b
;;
external magic : 'a 'b. 'a -> 'b = "%magic";;
let () =
let (Refl : (bool t, bool u) eq) = magic () in ()
;;
|}
in... | null | https://raw.githubusercontent.com/johnyob/dromedary/6bc34bec7a2faaa5c8930a5eb625b2a165921206/test/typing/gadts/test_pr10735.ml | ocaml | open! Import
open Util
let%expect_test "" =
let str =
{|
type 'a t;;
type 'a u;;
type ('a, 'b) eq =
| Refl constraint 'a = 'b
;;
external magic : 'a 'b. 'a -> 'b = "%magic";;
let () =
let (Refl : (bool t, bool u) eq) = magic () in ()
;;
|}
in... | |
3ada169ec658b6881b60d97ba7f43548a0f872d69052e54d040e7b1461fc1c9e | dym/movitz | error.lisp | ;;;;------------------------------------------------------------------
;;;;
Copyright ( C ) 2001 - 2005 ,
Department of Computer Science , University of Tromso , Norway .
;;;;
;;;; For distribution policy, see the accompanying file COPYING.
;;;;
;;;; Filename: error.lisp
;;;; Description:
Auth... | null | https://raw.githubusercontent.com/dym/movitz/56176e1ebe3eabc15c768df92eca7df3c197cb3d/losp/muerte/error.lisp | lisp | ------------------------------------------------------------------
For distribution policy, see the accompanying file COPYING.
Filename: error.lisp
Description:
------------------------------------------------------------------ | Copyright ( C ) 2001 - 2005 ,
Department of Computer Science , University of Tromso , Norway .
Author : < >
Created at : Sat Sep 1 00:49:11 2001
$ I d : error.lisp , v 1.6 2007/03/11 22:42:01 ffjeld Exp $
(require :muerte/basic-macros)
(provide :muerte/error)
(in-package muerte)
(de... |
60236085279b26821d2b34c0c943c744e2d899fe6eeecbdad10c12d9fa727a01 | monadbobo/ocaml-core | sys_open_patch.mli | * This module is here to avoid holding the runtime lock when doing an
open_in_gen lock . This has been upstreamed as a patch in 3.12.1 .
open_in_gen lock. This has been upstreamed as a patch in 3.12.1. *)
(** This module exists only to workaround some undesirable behavior in
the function [caml_sys_open] i... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/sys_open_patch.mli | ocaml | * This module exists only to workaround some undesirable behavior in
the function [caml_sys_open] in the ocaml runtime. Delete this
module in favor of the same functions in [Pervasives] once the
runtime is patched to our satisfaction
* Reimplementation of [Pervasives.open_in_gen]
* Reimplementation of [P... | * This module is here to avoid holding the runtime lock when doing an
open_in_gen lock . This has been upstreamed as a patch in 3.12.1 .
open_in_gen lock. This has been upstreamed as a patch in 3.12.1. *)
val open_in_gen : open_flag list -> int -> string -> in_channel
val open_out_gen : open_flag list -> in... |
537122334db56d3c2879dd2c063b61f64f7f7952e84a34d371b93607196682a2 | spacegangster/space-ui | status_led__persistence.cljc | (ns space-ui.tiny.status-led--persistence
"Green/yellow/red led indicator"
(:require [space-ui.style.main-mixins :as mm]
[space-ui.style.animations :as animations]))
(def style-rules
[:.status-led-p
{:transition "all .2s ease-in-out"}
(mm/size 6 8)
[:&--error
(mm/size 8 8)
{:backg... | null | https://raw.githubusercontent.com/spacegangster/space-ui/74825c904b6b456d845c3b3d669ce795b33f5ba9/src/space_ui/tiny/status_led__persistence.cljc | clojure | (ns space-ui.tiny.status-led--persistence
"Green/yellow/red led indicator"
(:require [space-ui.style.main-mixins :as mm]
[space-ui.style.animations :as animations]))
(def style-rules
[:.status-led-p
{:transition "all .2s ease-in-out"}
(mm/size 6 8)
[:&--error
(mm/size 8 8)
{:backg... | |
403775af2f199829e17f9a6cecad225e514bd8eaf71b01074a6716760d902166 | hexlet-basics/exercises-racket | test.rkt | #lang racket
(require (only-in rackunit check-equal? test-begin ))
(require "index.rkt")
(test-begin
(check-equal? (sentence-type "HOW?") "cry")
(check-equal? (sentence-type "HoW?") "common"))
| null | https://raw.githubusercontent.com/hexlet-basics/exercises-racket/ae3a45453584de1e5082c841178d4e43dd47e08a/modules/30-logic/20-if/test.rkt | racket | #lang racket
(require (only-in rackunit check-equal? test-begin ))
(require "index.rkt")
(test-begin
(check-equal? (sentence-type "HOW?") "cry")
(check-equal? (sentence-type "HoW?") "common"))
| |
3904754db1ac4f0cb89964414a980fb513ee64e78b0ccd70e1f4cbe04c89c6b3 | AbstractMachinesLab/caramel | nothing.ml | type t = (int, string) Type_eq.t
let unreachable_code = function
| (_ : t) -> .
| null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/vendor/stdune/nothing.ml | ocaml | type t = (int, string) Type_eq.t
let unreachable_code = function
| (_ : t) -> .
| |
862aaf1152eb01e2cd741d6658802282d5bafdf68fff37923fd9f533394de4e7 | schnef/pm | aap.erl | -module(aap).
-include("pm.hrl").
-compile(export_all).
t() ->
[(fun(a) -> "a" end)(R) || R <- [a, b, c]].
%% This module is used for experiments. Ignore!
email() ->
{ok, PC} = pm_pap:c_pc(#pc{value = "Mail System"}),
{ok, Users} = pm_pap:c_ua_in_pc(#ua{value = "Users"}, PC),
{ok, U2} = pm_pap:c_u_in... | null | https://raw.githubusercontent.com/schnef/pm/00d4e643a02430d569650463a77ba22159b847ef/src/aap.erl | erlang | This module is used for experiments. Ignore!
when I < Max ->
The elements of the set are represented as bits
perform some actions on particular subset
powerset2(_, _, _, _) ->
done.
If any nodes in candidates are not in the computed
intersection, delete them from candidates
{ok, _Assoc2} = pm_pap:c_assoc(U... | -module(aap).
-include("pm.hrl").
-compile(export_all).
t() ->
[(fun(a) -> "a" end)(R) || R <- [a, b, c]].
email() ->
{ok, PC} = pm_pap:c_pc(#pc{value = "Mail System"}),
{ok, Users} = pm_pap:c_ua_in_pc(#ua{value = "Users"}, PC),
{ok, U2} = pm_pap:c_u_in_ua(#u{value = "ID u2"}, Users),
{ok, Object... |
1cd17a15a4c03fd60509c79a557d45a31eed43917fe9cac244248c69cfdc3e4c | danieljharvey/mimsa | Main.hs | module Main (main) where
import Test.Hspec
import qualified Test.IR.CompileSpec
import qualified Test.IR.DataTypesSpec
import qualified Test.IR.FromExprSpec
import qualified Test.IR.IRSpec
import qualified Test.IR.PatternSpec
import qualified Test.Interpreter.InterpreterSpec
import qualified Test.ParserSpec
import qua... | null | https://raw.githubusercontent.com/danieljharvey/mimsa/9ea25ade59cc139b3df2f6edd95ac9cb6d9bd6e1/smol-core/test/Main.hs | haskell | module Main (main) where
import Test.Hspec
import qualified Test.IR.CompileSpec
import qualified Test.IR.DataTypesSpec
import qualified Test.IR.FromExprSpec
import qualified Test.IR.IRSpec
import qualified Test.IR.PatternSpec
import qualified Test.Interpreter.InterpreterSpec
import qualified Test.ParserSpec
import qua... | |
0d84224f3dea03e005aa0f98c07fcbf256a90ac95dff91cc65a8788b32b68d56 | vikram/lisplibraries | attribute-bind.lisp | ;; -*- lisp -*-
(in-package :it.bese.yaclml)
;;;; * ATTRIBUTE-BIND
;;;; This macro serves the same purpose as destructuring-bind but
;;;; allows for a different syntax.
(defmacro attribute-bind (attribute-spec list &body body)
"Evaluate BODY with the values in LIST bound according to ATTRIBUTE-SPEC.
ATTRIBUTE-SP... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/yaclml_0.5.2/src/attribute-bind.lisp | lisp | -*- lisp -*-
* ATTRIBUTE-BIND
This macro serves the same purpose as destructuring-bind but
allows for a different syntax.
we want to match against the keyword whose
string name is (symbol-name symbol-to-bind-to),
hence the intern.
the & symbols can be read in from any package. we're kinda
faking keywords...
A... |
(in-package :it.bese.yaclml)
(defmacro attribute-bind (attribute-spec list &body body)
"Evaluate BODY with the values in LIST bound according to ATTRIBUTE-SPEC.
ATTRIBUTE-SPEC has the following form:
( required-args* [ &attribute attributes* ]
[ &allow-other-attributes others ]
... |
d464390626acc65b9ea579740204527278820434605e46bf26278c9ab126c6a8 | Hara-Laboratory/subleq-toolchain | Subleq.hs | # LANGUAGE FlexibleInstances , MultiParamTypeClasses , UndecidableInstances #
module Language.Subleq.Model.InstructionSet.Subleq (step, initialMachine) where
import Language.Subleq.Model.Prim
import qualified Language.Subleq.Model.Memory as Mem
step :: (Memory a a m, Num a, Ord a) => Machine a w m Bool
step = do
... | null | https://raw.githubusercontent.com/Hara-Laboratory/subleq-toolchain/c79ab101c2c50f2975d6087b9727bf024df05195/Language/Subleq/Model/InstructionSet/Subleq.hs | haskell | # LANGUAGE FlexibleInstances , MultiParamTypeClasses , UndecidableInstances #
module Language.Subleq.Model.InstructionSet.Subleq (step, initialMachine) where
import Language.Subleq.Model.Prim
import qualified Language.Subleq.Model.Memory as Mem
step :: (Memory a a m, Num a, Ord a) => Machine a w m Bool
step = do
... | |
4924bb727c0d79ee448440359038108ca0a46fe07eba10b866cffc06e09037dc | garrigue/lablgl | gluQuadric.ml | $ I d : gluQuadric.ml , v 1.5 2000 - 04 - 12 07:40:26 garrigue Exp $
type t
external create : unit -> t = "ml_gluNewQuadric"
external cylinder :
t -> base:float -> top:float -> height:float ->
slices:int -> stacks:int -> unit
= "ml_gluCylinder_bc" "ml_gluCylinder"
let cylinder ~base ~top ~height ~slice... | null | https://raw.githubusercontent.com/garrigue/lablgl/d76e4ac834b6d803e7a6c07c3b71bff0e534614f/src/gluQuadric.ml | ocaml | $ I d : gluQuadric.ml , v 1.5 2000 - 04 - 12 07:40:26 garrigue Exp $
type t
external create : unit -> t = "ml_gluNewQuadric"
external cylinder :
t -> base:float -> top:float -> height:float ->
slices:int -> stacks:int -> unit
= "ml_gluCylinder_bc" "ml_gluCylinder"
let cylinder ~base ~top ~height ~slice... | |
f7710bed7218e63ebbaaa55723cf249c0fe4ea735820641f2cdc31d48e047ffd | LPCIC/matita | multiPassDisambiguator.mli | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... | null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/disambiguation/multiPassDisambiguator.mli | ocaml | the integer is an offset to be added to each location
* parameters are: option name, error message
* initially false; for debugging only (???) | Copyright ( C ) 2004 - 2005 , HELM Team .
*
* This file is part of HELM , an Hypertextual , Electronic
* Library of Mathematics , developed at the Computer Science
* Department , University of Bologna , Italy .
*
* is free software ; you can redistribute it and/or
* modify it under the terms of ... |
332468f4e317e394c6782ed148a5ec75d96b1bb242a0c946f2e9100f612c6050 | anmonteiro/ocaml-mongodb | connection.ml | module Reader = Parse.Reader
module Writer = Serialize.Writer
type error =
[ `Protocol_error of string
| `Eof
of Error_code.t * string
`Exn of exn
]
type ('a, 'b) response_handler = ('a, 'b) result -> unit
type error_handler = error -> unit
type t =
{ config : Config.t
; reader : Reader.reply
; wr... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-mongodb/f491384652eaf24e423204ae79f590bb90fb6506/src/connection.ml | ocaml | TODO(anmonteiro): error_handlers for all of these
check all options
check if then name has been set, create a default name otherwise | module Reader = Parse.Reader
module Writer = Serialize.Writer
type error =
[ `Protocol_error of string
| `Eof
of Error_code.t * string
`Exn of exn
]
type ('a, 'b) response_handler = ('a, 'b) result -> unit
type error_handler = error -> unit
type t =
{ config : Config.t
; reader : Reader.reply
; wr... |
90f681727d6afca011184addb64ce7a7f58a22b82ee7b3e775a66d1b23fc9914 | kuchma19/hi | Evaluator.hs | # LANGUAGE FlexibleInstances #
module HW3.Evaluator (eval) where
import Codec.Compression.Zlib
import Codec.Serialise
import Control.Monad.Cont (lift)
import Control.Monad.Trans.Except
import qualified Data.ByteString as B
import Data.ByteString.Lazy (fromStrict, toStrict)
import qualified Data.ByteString.Lazy.Intern... | null | https://raw.githubusercontent.com/kuchma19/hi/7d4d06acbd73deb625c48a91de269bebe9c2a3fb/hw3/src/HW3/Evaluator.hs | haskell | I ended up with a very bad solution(
I am very sorry
| Count elements in given object
| Take the current number of elements
| Drop the current number of elements
| Corresponding @HiValue@
| Reverse
| Function argument distributor
^ Arguments function
^ Current function
^ The result after applying the functio... | # LANGUAGE FlexibleInstances #
module HW3.Evaluator (eval) where
import Codec.Compression.Zlib
import Codec.Serialise
import Control.Monad.Cont (lift)
import Control.Monad.Trans.Except
import qualified Data.ByteString as B
import Data.ByteString.Lazy (fromStrict, toStrict)
import qualified Data.ByteString.Lazy.Intern... |
daae0879d8553795dff642c184a000ec5d0f8a06ceaa01b9866b8584105449a2 | camlp4/camlp4 | Loc.ml | (****************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/camlp4/camlp4/9b3314ea63288decb857239bd94f0c3342136844/camlp4/Camlp4/Struct/Loc.ml | ocaml | **************************************************************************
OCaml
... | Copyright 2006 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed under
the terms of the GNU Library General Public License , with the special
Authors :
* - Daniel de Rauglaudre : initial version
* - : refactoring
... |
fc03def726ceddeee22f836b03e0e26bc139d19233c54ab0c7eb1dadd4815893 | ocurrent/ocurrent | db.ml | module Db = Current.Db
module Ops = Set.Make(String)
let or_fail label x =
match x with
| Sqlite3.Rc.OK -> ()
| err -> Fmt.failwith "Sqlite3 %s error: %s" label (Sqlite3.Rc.to_string err)
let format_timestamp time =
let { Unix.tm_year; tm_mon; tm_mday; tm_hour; tm_min; tm_sec; _ } = time in
Fmt.str "%04d-%0... | null | https://raw.githubusercontent.com/ocurrent/ocurrent/b9dac6243d38b3ca8487fc6997fad3abeb88179d/lib_cache/db.ml | ocaml | module Db = Current.Db
module Ops = Set.Make(String)
let or_fail label x =
match x with
| Sqlite3.Rc.OK -> ()
| err -> Fmt.failwith "Sqlite3 %s error: %s" label (Sqlite3.Rc.to_string err)
let format_timestamp time =
let { Unix.tm_year; tm_mon; tm_mday; tm_hour; tm_min; tm_sec; _ } = time in
Fmt.str "%04d-%0... | |
d52ef24f70df44862a577cc4e73c79125944f8505a533719d10069a2483e5af5 | CryptoKami/cryptokami-core | Safe.hs | | Module for safe ( zero - memory ) signing .
module Pos.Crypto.Signing.Safe
( changeEncPassphrase
, safeSign
, safeToPublic
, safeKeyGen
, safeDeterministicKeyGen
, withSafeSigner
, withSafeSignerUnsafe
, withSafeSigners
, fakeSigner
, safeCreate... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/crypto/Pos/Crypto/Signing/Safe.hs | haskell | | Regenerates secret key with new passphrase.
Note: This operation keeps corresponding public key and derived (child) keys unchanged.
the default IO generator.
we can manually cleanup all IO buffers we use to store passphrase
(when we'll actually use them)
This function is like @withSafeSigner@ but doesn't check ... | | Module for safe ( zero - memory ) signing .
module Pos.Crypto.Signing.Safe
( changeEncPassphrase
, safeSign
, safeToPublic
, safeKeyGen
, safeDeterministicKeyGen
, withSafeSigner
, withSafeSignerUnsafe
, withSafeSigners
, fakeSigner
, safeCreate... |
225489e0cdf90779bcd45d92234f0d41e39e07c3d21ae09f115244415314aed8 | incoherentsoftware/defect-process | Data.hs | module Player.Gun.All.GrenadeLauncher.Data
( GrenadeLauncherData(..)
, mkGrenadeLauncherData
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (fromMaybe)
import qualified Data.List.NonEmpty as NE
import qualified Data.Map as M
import qualified Data.Vector as V
import Configs
i... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/ae362274cca0e59c0fc0dcaee0f0e208db8ccc46/src/Player/Gun/All/GrenadeLauncher/Data.hs | haskell | module Player.Gun.All.GrenadeLauncher.Data
( GrenadeLauncherData(..)
, mkGrenadeLauncherData
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (fromMaybe)
import qualified Data.List.NonEmpty as NE
import qualified Data.Map as M
import qualified Data.Vector as V
import Configs
i... | |
58766d2516d28571b507cc05663966421983e85562003a8f3a28ec5082d85ae4 | euhmeuh/web-galaxy | test-db.rkt | #lang racket/base
(require
rackunit
web-galaxy/db)
(current-db-path "test-database.sqlite")
(define ponies
(hasheq
'rarity '((name . "Rarity") (fur . "White") (mane . "Purple") (favorite . 1))
'twilight '((name . "Twilight Sparkle") (fur . "Mauve") (mane . "Violet") (favorit... | null | https://raw.githubusercontent.com/euhmeuh/web-galaxy/2d9d5710aec25d961dcfc37a2e88c3c0f435021f/web-galaxy-test/tests/web-galaxy/test-db.rkt | racket | #lang racket/base
(require
rackunit
web-galaxy/db)
(current-db-path "test-database.sqlite")
(define ponies
(hasheq
'rarity '((name . "Rarity") (fur . "White") (mane . "Purple") (favorite . 1))
'twilight '((name . "Twilight Sparkle") (fur . "Mauve") (mane . "Violet") (favorit... | |
02bfbea11f5b2e2e076c1e4947e2d5bc23de5542ec45086fe7eaa2e0e287cf95 | mzp/websocket-ocaml | bigIntUtil.mli | module BigIntOp : sig
val (+) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (-) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val ( * ) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (/) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (=) : Big_int.big_... | null | https://raw.githubusercontent.com/mzp/websocket-ocaml/b584bd20dfe6d95f65bc6e1ba8838b1ecfa8ec0e/webSocket/bigIntUtil.mli | ocaml | module BigIntOp : sig
val (+) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (-) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val ( * ) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (/) : Big_int.big_int -> Big_int.big_int -> Big_int.big_int
val (=) : Big_int.big_... | |
3a84b3a5374b3585569404b7ade3b413610f9eff3f89fbdf686a807ad35168b9 | granule-project/gerty | Interpreter.hs | module Language.Gerty.Interpreter
( runParser
, runScoper
, runTypeChecker
, InterpreterError
, InterpreterResult
, formatError
, formatErrorDefault
) where
import qualified Language.Gerty.Scoping.Monad as SC
import Language.Gerty.Syntax.Abstract
import qualified Language.Gerty.Syntax.Concrete as C
imp... | null | https://raw.githubusercontent.com/granule-project/gerty/972fa027973032a4499747039b45e744ca17e9e2/src/Language/Gerty/Interpreter.hs | haskell | Pretty print CST
Typing | module Language.Gerty.Interpreter
( runParser
, runScoper
, runTypeChecker
, InterpreterError
, InterpreterResult
, formatError
, formatErrorDefault
) where
import qualified Language.Gerty.Scoping.Monad as SC
import Language.Gerty.Syntax.Abstract
import qualified Language.Gerty.Syntax.Concrete as C
imp... |
e4083b74f13b972418c5cfec4e265aa792085a2df357fb358233b191ddfe5583 | tolysz/ghcjs-stack | Update.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Update
Copyright : ( c ) 2005
-- License : BSD-like
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
--
------------------------------------------------... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal-next/cabal-install/Distribution/Client/Update.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Client.Update
License : BSD-like
Maintainer :
Stability : provisional
Portability : portable
---------------------------------------------------------------------------
| 'update' downloads th... | Copyright : ( c ) 2005
# LANGUAGE RecordWildCards #
module Distribution.Client.Update
( update
) where
import Distribution.Client.Types
( Repo(..), RemoteRepo(..), maybeRepoRemote )
import Distribution.Client.HttpUtils
( DownloadResult(..) )
import Distribution.Client.FetchUtils
... |
594c4607e89e3eb8ee1958a241b039d21ffd3385477a128d5c8ae75b1cf9ec67 | ekmett/fractions | Reference.hs | -- |
--
-- ICreals.hs
Haskell implementation of exact real arithmetic using
Linear Fractional Transformations .
--
-- Usage:
-- eshow <expression> <digits>
-- where <expression> is expression to be calculated up to
-- <digits> number of digit matrices (which roughly corresponds
-- to (<digits>/3) decimal digi... | null | https://raw.githubusercontent.com/ekmett/fractions/eefee71a88b6e6c0cc9a20587118f801255e233e/Reference.hs | haskell | |
ICreals.hs
Usage:
eshow <expression> <digits>
where <expression> is expression to be calculated up to
<digits> number of digit matrices (which roughly corresponds
to (<digits>/3) decimal digits.
Examples:
------------------------------------------------------------------------------
Basic Functions... | Haskell implementation of exact real arithmetic using
Linear Fractional Transformations .
eshow epi 100 - calculate pi up to 100 digit matrices
eshow ( esin ( ExpV ( 1,2 ) ) ) 100 - calculate sin(1/2 )
Original version by , circa 1998 .
Updated by to Haskell 98 in 2015
module Reference where
import Da... |
a612097d36c1195189faa4fc33655a97d2d8a45c0169ad0751d433fda124b90b | haskell/haskell-language-server | HaddockComments.hs | {-# LANGUAGE CPP #-}
# LANGUAGE DuplicateRecordFields #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ViewPatterns ... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/aeb57a8eb56964c8666d7cd05b6ba46d531de7c7/plugins/hls-haddock-comments-plugin/src/Ide/Plugin/HaddockComments.hs | haskell | # LANGUAGE CPP #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
---------------------------------------------------------------------------
---------------------------------------------------------------------------
------------... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE RecordWildCards #
module Ide.Plugin.HaddockComments (descriptor, E.Log) where
import Control.Monad (join, when)
import Control.Monad.... |
b02d4a79726505ea7c44163cab094f07821156874ac0d921b5f5fcba1a358bb4 | alex-hhh/ActivityLog2 | humidex.rkt | #lang racket/base
SPDX - License - Identifier : GPL-3.0 - or - later
;;
;; humidex.rkt -- "feels-like" temperature
;;
;; This file is part of ActivityLog2 -- -hhh/ActivityLog2
Copyright ( c ) 2022 < >
;;
;; This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Gene... | null | https://raw.githubusercontent.com/alex-hhh/ActivityLog2/94676896984a4b610c3e188e0db0106b858406cb/rkt/models/humidex.rkt | racket |
humidex.rkt -- "feels-like" temperature
This file is part of ActivityLog2 -- -hhh/ActivityLog2
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
without even the implied warranty of MERCHANTABI... | #lang racket/base
SPDX - License - Identifier : GPL-3.0 - or - later
Copyright ( c ) 2022 < >
under the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option )
You should have received a copy of the GNU General Public L... |
640d8e91d084930a813f665a35698ec5ac97c05ab7cdaf0fd5a4cbb2bbde5531 | dwango/fialyzer | test_type.ml | open Base
open Fialyzer
open Type
let%expect_test "pp" =
let print ty = pp ty |> Caml.print_string in
print TyAny;
[%expect {| any() |}];
print TyBottom;
[%expect {| none() |}];
print (of_elem TyAtom);
[%expect {| atom() |}];
print (of_elem TyNumber);
[%expect {| number() |}];
print (of_elem (... | null | https://raw.githubusercontent.com/dwango/fialyzer/3c4b4fc2dacf84008910135bfef16e4ce79f9c89/test/unit-test/test_type.ml | ocaml | single union
multi union
fun with no args
fun with some args
complex example
* sup of function types
* see:
(any()) -> ok
({foo, bar}) -> ok
(A) -> B when A = {'ok', C}, B = atom(), C = B
-->
({'ok', atom()}) -> atom()
| open Base
open Fialyzer
open Type
let%expect_test "pp" =
let print ty = pp ty |> Caml.print_string in
print TyAny;
[%expect {| any() |}];
print TyBottom;
[%expect {| none() |}];
print (of_elem TyAtom);
[%expect {| atom() |}];
print (of_elem TyNumber);
[%expect {| number() |}];
print (of_elem (... |
c4ad9ebd53f65822c403a1caf1bf216372157f0664e5b909252391f73c05cd6b | ChrisPenner/Candor | TypeInference.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
module TypeInference where
import RIO
import ... | null | https://raw.githubusercontent.com/ChrisPenner/Candor/7003da63cdcf63ee5864bab639a987bb43a4003e/src/TypeInference.hs | haskell | unify (Env a) (Env b) = do
combinedEnvs <- sequenceA $ M.fromSet pairs allKeys
return combinedEnvs
where
pairs k =
Forall [] <$>
(Just (Forall _ a), Just (Forall _ b)) -> unify a b
(Just (Forall _ a), Nothing) -> return a
(Nothing, Just (Forall _ b)) ->... | # LANGUAGE TemplateHaskell #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
module TypeInference where
import RIO
import ... |
4fc8e99eb6d1b64f2f73e714332598d8737f60891ce03f88dd3aa2b0515ebfb3 | xapi-project/xen-api | control.ml | open Rpc
open Idl
open Common
type exns =
| Sr_not_attached of string
(** An SR must be attached in order to access volumes *)
| SR_does_not_exist of string (** The specified SR could not be found *)
| Volume_does_not_exist of string
(** The specified volume could not be found in the SR *)
| Unimp... | null | https://raw.githubusercontent.com/xapi-project/xen-api/1e1165f330c30ee6cb8e8f325af9fdd07474ca24/ocaml/xapi-storage/generator/lib/control.ml | ocaml | * An SR must be attached in order to access volumes
* The specified SR could not be found
* The specified volume could not be found in the SR
* The operation has not been implemented
* The operation has been cancelled
* The Volume is already active on another host
* Storage is fully available
* Storage is busy r... | open Rpc
open Idl
open Common
type exns =
| Sr_not_attached of string
| Volume_does_not_exist of string
| Activated_on_another_host of string
[@@deriving rpcty]
exception Sr_error of exns
let errors =
Error.
{
def= exns
; raiser= (fun e -> Sr_error e)
; matcher= (function Sr_error e -> Some... |
b4a0e77e24d28ba60f3d0b38ef4e687ed3c4645c657f09691c4a2147bf637099 | cdfa/frugel | DisplayProjection.hs | # LANGUAGE LambdaCase #
# OPTIONS_GHC -Wno - orphans #
module Scout.Orphans.DisplayProjection where
import Frugel
import Scout.Node
import Scout.PrettyPrinting
import Scout.Truncatable
-- Orphaned because of dependency on pretty printing
instance DisplayProjection EvaluationError where
renderDoc = \case
... | null | https://raw.githubusercontent.com/cdfa/frugel/8cab27ee93639a108ccf124158c2ac7a364a24f7/scout-src/Scout/Orphans/DisplayProjection.hs | haskell | Orphaned because of dependency on pretty printing | # LANGUAGE LambdaCase #
# OPTIONS_GHC -Wno - orphans #
module Scout.Orphans.DisplayProjection where
import Frugel
import Scout.Node
import Scout.PrettyPrinting
import Scout.Truncatable
instance DisplayProjection EvaluationError where
renderDoc = \case
TypeError e -> "Type error:" <+> renderDoc e
... |
12c6f99866b8d68b5cc58aba110627fd104695fb00e27ede760a292cb4b46195 | ddmcdonald/sparser | tailored-predicates.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
Copyright ( c ) 2021 - 2022 SIFT LLC . All Rights Reserved
;;;
;;; File: "tailored-predicates"
;;; Module: "grammar/model/sl/motifs/
version : January 2022
;; Started 12/2/21 to hold predicates, counters, etc of the sort
;; that would be ... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/8a3df0c47b64c4b0516452e10c2b916627ec9a15/Sparser/code/s/grammar/model/sl/motifs/tailored-predicates.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
File: "tailored-predicates"
Module: "grammar/model/sl/motifs/
Started 12/2/21 to hold predicates, counters, etc of the sort
that would be in objects/doc/content-methods if they weren't
so specific.
--- coverage
-----------------------------... | Copyright ( c ) 2021 - 2022 SIFT LLC . All Rights Reserved
version : January 2022
(in-package :sparser)
(defgeneric motifs-spotted/count (article)
(:documentation "Count the number of instances of motifs noted.
Return that number and the number of other notes")
(:method ((a article))
(let* ((items-... |
3a86ec6d0a48feb1936af5e5fb76f24debe7ad359c9fc0d03c7c4c13423909f5 | agda/agda | Map.hs | # LANGUAGE CPP #
module Agda.Utils.Map where
import Data.Functor.Compose
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (mapMaybe)
import Agda.Utils.Functor
import Agda.Utils.Impossible
-- * Monadic map operations
---------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/agda/agda/2ede73cfa408d6157bb9d811e3a9b3bab8b8b26c/src/full/Agda/Utils/Map.hs | haskell | * Monadic map operations
-------------------------------------------------------------------------
| Wrapper for 'adjustM' for convenience.
-- | Not very efficient (goes via a list), but it'll do.
unionWithM f m1 m2 = fromList <$> mapM combine (toList m)
where
m = unionWith both (map L m1) (map R m2)... | # LANGUAGE CPP #
module Agda.Utils.Map where
import Data.Functor.Compose
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (mapMaybe)
import Agda.Utils.Functor
import Agda.Utils.Impossible
| Update monadically the value at one position ( must exist ! ) .
adjustM :: (Functor f, Ord k) => (v... |
177b6dc3a7a3eac6364b229ec2b9db3e8b8632cb771f58ded4ecaa1dafdeb049 | nasa/Common-Metadata-Repository | core.clj | (ns cmr.opendap.core
(:require
[clojusc.twig :as logger]
[cmr.opendap.components.core :as components]
[com.stuartsierra.component :as component]
[trifl.java :as trifl])
(:gen-class))
(logger/set-level! '[cmr.opendap] :info logger/no-color-log-formatter)
(defn -main
[& args]
(let [system (component... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/63001cf021d32d61030b1dcadd8b253e4a221662/other/cmr-exchange/service-bridge/src/cmr/opendap/core.clj | clojure | (ns cmr.opendap.core
(:require
[clojusc.twig :as logger]
[cmr.opendap.components.core :as components]
[com.stuartsierra.component :as component]
[trifl.java :as trifl])
(:gen-class))
(logger/set-level! '[cmr.opendap] :info logger/no-color-log-formatter)
(defn -main
[& args]
(let [system (component... | |
58371adc527ab6e8926db91b351429bd3a2023375a84c889033ab7b55cc387a9 | maximedenes/native-coq | rules.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/plugins/firstorder/rules.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Term
open Tacmach
open N... |
a8e27b73a73192341891df152783dc1544b77df0199efc59d4dd263ac5aebf7b | leandrosilva/cameron | cameron_app.erl | @author < >
2011 .
@doc Callbacks for the application .
-module(cameron_app).
-author('Leandro Silva <>').
-behaviour(application).
% admin api
-export([start/2, stop/1, upgrade/0]).
%%
%% Admin API --------------------------------------------------------------------------------------
%%
, _ ) -... | null | https://raw.githubusercontent.com/leandrosilva/cameron/34051395b620d2c3cb2cb63c854e65234786a176/src/cameron_app.erl | erlang | admin api
Admin API --------------------------------------------------------------------------------------
@spec stop(_State) -> ok
inets:stop(), | @author < >
2011 .
@doc Callbacks for the application .
-module(cameron_app).
-author('Leandro Silva <>').
-behaviour(application).
-export([start/2, stop/1, upgrade/0]).
, _ ) - > { ok , SupervisorPid } | ignore | { error , Error }
@doc application start callback for .
start(_Type, _StartArg... |
44f5bb61f9c3901297d7517111364ca84c33dd53173c76d5fb9984eb8035bd5f | expipiplus1/vulkan | Name.hs | {-# language DeriveAnyClass #-}
module Haskell.Name
( HName(..)
, isTyConName
)
where
import Data.Text
import Prettyprinter
import Relude
import Text.InterpolatedString.Perl6
import Render.Utils ( unReservedWord )
data HName
= TermName { un... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/generate-new/src/Haskell/Name.hs | haskell | # language DeriveAnyClass # |
module Haskell.Name
( HName(..)
, isTyConName
)
where
import Data.Text
import Prettyprinter
import Relude
import Text.InterpolatedString.Perl6
import Render.Utils ( unReservedWord )
data HName
= TermName { unName :: Text }
| TyConName { u... |
ba78b9c38062dab2f6d837a79eb00d4ba3f5ec3b992b5e45de19c5134f398f4b | FranklinChen/hugs98-plus-Sep2006 | ArrayBase.hs | module ArrayBase
{-# DEPRECATED "This module has moved to Data.Array.Base" #-}
(module Data.Array.Base) where
import Data.Array.Base
| null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/fptools/hslibs/lang/ArrayBase.hs | haskell | # DEPRECATED "This module has moved to Data.Array.Base" # | module ArrayBase
(module Data.Array.Base) where
import Data.Array.Base
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.