_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 |
|---|---|---|---|---|---|---|---|---|
470edec2e95a273b2fec16d21933e532a45d469dc19cfeb6fedecc69617e2633 | input-output-hk/cardano-shell | DaedalusIPCSpec.hs | module DaedalusIPCSpec
( spec
) where
import Cardano.Prelude
import Test.Hspec (Spec, describe, it, pending)
spec :: Spec
spec = describe "DaedalusIPC" $ do
it "should reply with the port when asked" $ do
pending
--spec = describe "DaedalusIPC" $ do
-- it "should reply wi... | null | https://raw.githubusercontent.com/input-output-hk/cardano-shell/8e0d6f5548c1c13a9edfeb56e4ea27c0a6d10948/cardano-shell/test/DaedalusIPCSpec.hs | haskell | spec = describe "DaedalusIPC" $ do
it "should reply with the port when asked" $ do
let testScript = "test/js/mock-daedalus.js"
(_, _, _, ph) <- createProcess (proc "node" [testScript, show port]) | module DaedalusIPCSpec
( spec
) where
import Cardano.Prelude
import Test.Hspec (Spec, describe, it, pending)
spec :: Spec
spec = describe "DaedalusIPC" $ do
it "should reply with the port when asked" $ do
pending
let port = 42 : : Int
waitForProcess ph ` sh... |
db8edec34faf1b79fb65a94cb204816b7af2d960c75d1b9534dbd71af5ed6f1d | racket/gui | info.rkt | #lang info
(define test-responsibles '((all robby)))
| null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-test/framework/info.rkt | racket | #lang info
(define test-responsibles '((all robby)))
| |
e45679560340665260c9da9c0048da44ef3b9fcb9b9e298573a9e9f7579e04e7 | retro/keechma-next-realworld-app | comment_form.cljs | (ns app.controllers.user.comment-form
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :as pp :refer-macros [pipeline!]]
[keechma.next.controllers.form :as form]
[keechma.next.controllers.entitydb :a... | null | https://raw.githubusercontent.com/retro/keechma-next-realworld-app/47a14f4f3f6d56be229cd82f7806d7397e559ebe/src/app/controllers/user/comment_form.cljs | clojure | (ns app.controllers.user.comment-form
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :as pp :refer-macros [pipeline!]]
[keechma.next.controllers.form :as form]
[keechma.next.controllers.entitydb :a... | |
afadfc1f7943f97146af8cb5bee53e3802b86dc7a52adf7ac726d215afd9903b | intermine/bluegenes | auth.cljs | (ns bluegenes.subs.auth
(:require [re-frame.core :refer [reg-sub]]))
(reg-sub
::auth
:<- [:current-mine]
(fn [current-mine]
(:auth current-mine)))
(reg-sub
::identity
:<- [::auth]
(fn [auth]
(:identity auth)))
(reg-sub
::superuser?
:<- [::identity]
(fn [identity]
(:superuser identity)))
(reg-sub... | null | https://raw.githubusercontent.com/intermine/bluegenes/417ea23b2d00fdca20ce4810bb2838326a09010e/src/cljs/bluegenes/subs/auth.cljs | clojure | Set when using OAuth2, where username is just "GOOGLE:gibberish". | (ns bluegenes.subs.auth
(:require [re-frame.core :refer [reg-sub]]))
(reg-sub
::auth
:<- [:current-mine]
(fn [current-mine]
(:auth current-mine)))
(reg-sub
::identity
:<- [::auth]
(fn [auth]
(:identity auth)))
(reg-sub
::superuser?
:<- [::identity]
(fn [identity]
(:superuser identity)))
(reg-sub... |
62c4b79ffeec95d6cefbe1f8f97e5c6ff2c14df3eb0a185b94cd9a67f80a03ad | sdiehl/picologic | Repl.hs | module Picologic.Repl (
repl,
stdin,
file,
runRepl,
) where
import Picologic.AST
import Picologic.Parser
import Picologic.Solver
import Picologic.Pretty
import Text.PrettyPrint
import Control.Monad.State
import Data.List (isPrefixOf)
import System.Console.Haskeline
-----------------------------------------... | null | https://raw.githubusercontent.com/sdiehl/picologic/5ecd27fd80fea1ef5889f3ef46ea8a7fd917531a/src/Picologic/Repl.hs | haskell | -----------------------------------------------------------------------------
REPL
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Commands
----------------------------------------------------------------------... | module Picologic.Repl (
repl,
stdin,
file,
runRepl,
) where
import Picologic.AST
import Picologic.Parser
import Picologic.Solver
import Picologic.Pretty
import Text.PrettyPrint
import Control.Monad.State
import Data.List (isPrefixOf)
import System.Console.Haskeline
type Repl = StateT IState (InputT IO)
d... |
f46f23c7a941c841aa2a5d6e8729883e34e8fda9ac62853cc4b696248aa66892 | mirleft/ocaml-x509 | public_key.ml | let ( let* ) = Result.bind
type ecdsa = [
| `P224 of Mirage_crypto_ec.P224.Dsa.pub
| `P256 of Mirage_crypto_ec.P256.Dsa.pub
| `P384 of Mirage_crypto_ec.P384.Dsa.pub
| `P521 of Mirage_crypto_ec.P521.Dsa.pub
]
type t = [
| ecdsa
| `RSA of Mirage_crypto_pk.Rsa.pub
| `ED25519 of Mirage_crypto_ec.Ed25519.pub... | null | https://raw.githubusercontent.com/mirleft/ocaml-x509/73f8d60c42f09c9712ad04a62582bda816895dd8/lib/public_key.ml | ocaml | let ( let* ) = Result.bind
type ecdsa = [
| `P224 of Mirage_crypto_ec.P224.Dsa.pub
| `P256 of Mirage_crypto_ec.P256.Dsa.pub
| `P384 of Mirage_crypto_ec.P384.Dsa.pub
| `P521 of Mirage_crypto_ec.P521.Dsa.pub
]
type t = [
| ecdsa
| `RSA of Mirage_crypto_pk.Rsa.pub
| `ED25519 of Mirage_crypto_ec.Ed25519.pub... | |
d20b8d02a66ca48150540a75a29a740366b4de72621b3c7915513c2cf189435e | mnieper/unsyntax | macro.scm | Copyright © ( 2020 ) .
;; This file is part of unsyntax.
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation files
( the " Software " ) , to deal in the Software without restriction ,
;; including without limitation the rights to use... | null | https://raw.githubusercontent.com/mnieper/unsyntax/c3fcb22d9b7021d4dc308b054995e817fa9ccbbd/src/unsyntax/expander/macro.scm | scheme | This file is part of unsyntax.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
including without limitation the rights to use, copy, modify, merge,
subject to the following conditions:
The above copyright notice and this permission n... | Copyright © ( 2020 ) .
( the " Software " ) , to deal in the Software without restriction ,
publish , distribute , sublicense , and/or sell copies of the Software ,
and to permit persons to whom the Software is furnished to do so ,
portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITH... |
ed0706b790de3ed592f46fb10d02ac397fb3631a0191955b5812b9d34badbf1c | elaforge/karya | Control.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 ScopedTypeVariables #
# LANGUAGE LambdaCase #
-- | Control flow and monadic utilities.
module Util.Control (
module Util.Control
, module Data.Bifunctor, module Control... | null | https://raw.githubusercontent.com/elaforge/karya/a6638f16da9f018686023977c1292d6ce5095e28/Util/Control.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Control flow and monadic utilities.
by defining them here I can explicitly INLINE them. Surely they're short
clever. I got around by recompiling all of hackage with
'profiling-detail: none', but I might ... | Copyright 2013
# LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
module Util.Control (
module Util.Control
, module Data.Bifunctor, module Control.Monad.Extra, module Util.CallStack
) where
import qualified Control.Monad as Monad
import qualified Control.Monad.Except as Except
import Contr... |
1874907c8de3198f17faffceffa387916dd2c04dff7333950a283e0f07ac8975 | frankiesardo/sicp-in-clojure | chapter-2.clj | (ns sicp.ch2)
Exercise 2.1 .
;; Define a better version of make-rat that handles both positive and negative arguments.
;; Make-rat should normalize the sign so that if the rational number is positive, both the numerator and denominator are positive, and if the rational number is negative, only the numerator is negat... | null | https://raw.githubusercontent.com/frankiesardo/sicp-in-clojure/dc341617c2ab8eb34ac316175a56141a0c605421/src/sicp/chapter-2.clj | clojure | Define a better version of make-rat that handles both positive and negative arguments.
Make-rat should normalize the sign so that if the rational number is positive, both the numerator and denominator are positive, and if the rational number is negative, only the numerator is negative.
Exercise 2.6
[+, +] * [+, +]
... | (ns sicp.ch2)
Exercise 2.1 .
(defn add-rat [x y]
(make-rat (+ (* (numer x) (denom y))
(* (numer y) (denom x)))
(* (denom x) (denom y))))
(defn sub-rat [x y]
(make-rat (- (* (numer x) (denom y))
(* (numer y) (denom x)))
(* (denom x) (denom y))))
(defn mul-rat... |
3834b12aaa9d083ceebf74c6ae7498dfafd5f42ef96007be0b5e80efe11944ea | joergen7/cre | cre_sup.erl | %% -*- erlang -*-
%%
CRE : common runtime environment for distributed programming languages
%%
Copyright 2015 - 2019 < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/joergen7/cre/06435b4b8be6a74c26b3204314696b05ce066813/src/cre_sup.erl | erlang | -*- erlang -*-
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific langu... | CRE : common runtime environment for distributed programming languages
Copyright 2015 - 2019 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2013 - 2020
-module( cre_sup ).
-behaviour( supervis... |
a09603469a684f9dd58d701c52fa2d5b99b3744e3070f12ea929e12fdc7340cf | msakai/toysolver | PriorityQueue.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wall #
{-# OPTIONS_HADDOCK show-extensions #-}
-----------------------------------------------------------------------------
-- |
-- Module : ToySolver.Internal.Data.Prio... | null | https://raw.githubusercontent.com/msakai/toysolver/6233d130d3dcea32fa34c26feebd151f546dea85/src/ToySolver/Internal/Data/PriorityQueue.hs | haskell | # LANGUAGE BangPatterns #
# OPTIONS_HADDOCK show-extensions #
---------------------------------------------------------------------------
|
Module : ToySolver.Internal.Data.PriorityQueue
License : BSD-style
Maintainer :
Stability : provisional
Portability : non-portable
Priority queue impleme... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wall #
Copyright : ( c ) 2012
module ToySolver.Internal.Data.PriorityQueue
(
PriorityQueue
, Index
, newPriorityQueue
, newPriorityQueueBy
, NewFifo (..)
, getElems
, clear
, ... |
7f4768ef92b66d76043278a838ae063025a68ad40d62486ca83d0acf033ba75d | generateme/fastmath | complex_examples.clj | (ns fastmath.complex-examples
(:refer-clojure :exclude [abs])
(:require [fastmath.complex :refer :all]
[metadoc.examples :refer :all]
[fastmath.core :as m]))
(add-examples complex (example "New complex number." (complex 2 -1)))
(add-examples abs (example "Abs" (abs (complex 1 -3))))
(add-ex... | null | https://raw.githubusercontent.com/generateme/fastmath/19c2a6e9a734c815cc55594fc1b5bb58a5993910/metadoc/fastmath/complex_examples.clj | clojure | (ns fastmath.complex-examples
(:refer-clojure :exclude [abs])
(:require [fastmath.complex :refer :all]
[metadoc.examples :refer :all]
[fastmath.core :as m]))
(add-examples complex (example "New complex number." (complex 2 -1)))
(add-examples abs (example "Abs" (abs (complex 1 -3))))
(add-ex... | |
348c052397702d9352815e21f6e274ba2730b351b47e71a9c18a1324b8ed4596 | emqx/emqx | emqx_authz_mnesia.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_authz/src/emqx_authz_mnesia.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_authz_mnesia).
-include_lib("emqx/include/emqx.hrl").
-include_lib("stdlib/include... |
f3b037cd36da74aa6c30e6ac04bf0c121a6bc70f6619784c5b382cd4b4c77b1e | exercism/racket | gigasecond-test.rkt | #lang racket
(require "gigasecond.rkt")
(module+ test
(require rackunit rackunit/text-ui racket/date))
(module+ test
(define (make-datetime year month day hour minute second)
(seconds->date (find-seconds second minute hour day month year #f)))
(define suite
(test-suite
"Tests for the gigasecond e... | null | https://raw.githubusercontent.com/exercism/racket/4110268ed331b1b4dac8888550f05d0dacb1865b/exercises/practice/gigasecond/gigasecond-test.rkt | racket | #lang racket
(require "gigasecond.rkt")
(module+ test
(require rackunit rackunit/text-ui racket/date))
(module+ test
(define (make-datetime year month day hour minute second)
(seconds->date (find-seconds second minute hour day month year #f)))
(define suite
(test-suite
"Tests for the gigasecond e... | |
2077f80f29b61b8d9e4fa344ec931cecbb55c12e836b4779ebccdcabeeed4442 | metaocaml/ber-metaocaml | test_strongly_connected_components.ml | (* TEST
include config
include testing
binary_modules =
"config build_path_prefix_map misc identifiable numbers \
strongly_connected_components"
* bytecode
*)
module Int = Numbers.Int
module SCC = Strongly_connected_components.Make (Int)
let graph_1 =
[1, [2;3;4];
2, [3;5];
3, [5];
4, [1];
5, [5]]
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/utils/test_strongly_connected_components.ml | ocaml | TEST
include config
include testing
binary_modules =
"config build_path_prefix_map misc identifiable numbers \
strongly_connected_components"
* bytecode
|
module Int = Numbers.Int
module SCC = Strongly_connected_components.Make (Int)
let graph_1 =
[1, [2;3;4];
2, [3;5];
3, [5];
4, [1];
5, [5]]
let empty = []
let print_scc scc =
Printf.printf "begin\n";
Array.iter (function
| SCC.No_loop e -> Printf.printf "%i\n" e
| SCC.Has_loop l ->
... |
a32c58fe96fbf7a98657c231606e07342867137d6f564c7a372fe5d4d5d1a8f4 | haroldcarr/learn-haskell-coq-ml-etc | TreeMap.hs | -- Introducing Functors 244/284
data Tree a = Node (Tree a) (Tree a)
| Leaf a
deriving (Show)
-- take tree of strings and turn into tree of string lengths
treeLengths (Leaf s) = Leaf (length s)
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
-- more abstract
treeMap :: (a ->... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/book/2009-Real_World_Haskell/TreeMap.hs | haskell | Introducing Functors 244/284
take tree of strings and turn into tree of string lengths
more abstract |
data Tree a = Node (Tree a) (Tree a)
| Leaf a
deriving (Show)
treeLengths (Leaf s) = Leaf (length s)
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
treeMap :: (a -> b) -> Tree a -> Tree b
treeMap f (Leaf a) = Leaf (f a)
treeMap f (Node l r) = Nod... |
e1eab4a8f6038ed19717f59179545a49f4d08a4f2de7c1a5118f5653f79f551d | incoherentsoftware/defect-process | Data.hs | module Level.Room.Tutorial.SandbagAir.Data
( SandbagAirData(..)
, mkSandbagAirData
) where
import Control.Monad.IO.Class (MonadIO)
import Configs
import Configs.All.Enemy
import Level.Room.Tutorial.SandbagAir.Behavior
import Level.Room.Tutorial.SandbagAir.Sprites
import FileCache
import Util
import Window... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/c39ce1f742d32a0ffcde82c03bf872adeb7d9162/src/Level/Room/Tutorial/SandbagAir/Data.hs | haskell | module Level.Room.Tutorial.SandbagAir.Data
( SandbagAirData(..)
, mkSandbagAirData
) where
import Control.Monad.IO.Class (MonadIO)
import Configs
import Configs.All.Enemy
import Level.Room.Tutorial.SandbagAir.Behavior
import Level.Room.Tutorial.SandbagAir.Sprites
import FileCache
import Util
import Window... | |
296e0e00277d8b4bca63a612dde53fe9a25ceb03f5918e1c403d8be5cebde46f | rothfield/doremi-script | views.cljs | (ns doremi-script.views
(:require
[doremi-script.dom-utils :refer [by-id]] ;; listen seconds]]
[doremi-script.utils :refer [get-attributes keywordize-vector
log is?] ]
;; [doremi-script.doremi_core :as doremi_core
;; :refer [doremi-text->collapsed-parse-tree]]
[... | null | https://raw.githubusercontent.com/rothfield/doremi-script/7141720e14bb0dbac344b55caab47c4f046635a5/src/doremi_script/views.cljs | clojure | listen seconds]]
[doremi-script.doremi_core :as doremi_core
:refer [doremi-text->collapsed-parse-tree]]
need forward reference since it is recursive
.
. The symbol for double sharp ( double sharp ) is at U+1D12A ( so & # 119082 ;) . These characters may not display correctly in all fonts .
old versions added dat... | (ns doremi-script.views
(:require
[doremi-script.utils :refer [get-attributes keywordize-vector
log is?] ]
[doremi-script.dom-fixes :refer [dom-fixes]]
[goog.dom :as dom]
[goog.Uri]
[goog.events :as events]
[clojure.string :as string :refer [join]]
[dom... |
69b353dd6ff4c22697c4c0d4dadc7ca3f1bfb395804f51eed85e6a5f1301ded8 | mstksg/advent-of-code-2022 | Day08.hs | -- |
Module : AOC.Challenge .
-- License : BSD3
--
-- Stability : experimental
-- Portability : non-portable
--
Day 8 . See " AOC.Solver " for the types used in this module !
module AOC.Challenge.Day08
( day08a
, day08b
)
where
import AOC.Common (countTrue, digitToIntSafe)
import AOC.Solver ((... | null | https://raw.githubusercontent.com/mstksg/advent-of-code-2022/de9ceee002d3a62746468492c746b8d7ca3fc8a0/src/AOC/Challenge/Day08.hs | haskell | |
License : BSD3
Stability : experimental
Portability : non-portable
| Module : AOC.Challenge .
Day 8 . See " AOC.Solver " for the types used in this module !
module AOC.Challenge.Day08
( day08a
, day08b
)
where
import AOC.Common (countTrue, digitToIntSafe)
import AOC.Solver ((:~>) (..))
import Data.List (foldl', mapAccumL, transpose)
import qualified Data.Map as M
imp... |
93a812faa82d832a9c57c9b77ca8910d43fd9df8a06d17c1485ef973217a678d | jarohen/yoyo | project.clj | (defproject yoyo-api/lein-template "0.0.7"
:description "A template to generate a Yo-yo API project"
:url "-henderson/yoyo"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| null | https://raw.githubusercontent.com/jarohen/yoyo/b579d21becd06b5330dee9f5963708db03ce1e25/templates/yoyo-api/project.clj | clojure | (defproject yoyo-api/lein-template "0.0.7"
:description "A template to generate a Yo-yo API project"
:url "-henderson/yoyo"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true)
| |
a56967fe99650ef9022f57d37ba821e425893be53b7699bf5701b6042767c68a | juspay/atlas | Person.hs | # LANGUAGE TypeApplications #
|
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agree... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/driver-offer-bpp/src/Storage/Queries/Person.hs | haskell | # LANGUAGE TypeApplications #
|
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agree... | |
550a96f5120fec2b1fa67a12d64844abdb96bade4744bba8728b8417f7401f9e | NorfairKing/smos | GetListBackups.hs | # LANGUAGE RecordWildCards #
module Smos.Server.Handler.GetListBackups
( serveGetListBackups,
)
where
import Smos.Server.Handler.Import
serveGetListBackups :: AuthNCookie -> ServerHandler [BackupInfo]
serveGetListBackups ac = withUserId ac $ \uid ->
runDB $ do
backupEntities <- selectList [BackupUser ==. u... | null | https://raw.githubusercontent.com/NorfairKing/smos/91efacaede3574e2f8f9d9601bf0383897eebfd8/smos-server/src/Smos/Server/Handler/GetListBackups.hs | haskell | # LANGUAGE RecordWildCards #
module Smos.Server.Handler.GetListBackups
( serveGetListBackups,
)
where
import Smos.Server.Handler.Import
serveGetListBackups :: AuthNCookie -> ServerHandler [BackupInfo]
serveGetListBackups ac = withUserId ac $ \uid ->
runDB $ do
backupEntities <- selectList [BackupUser ==. u... | |
ceb3226957d832328179930339873a24476cbf3ca1e314a6993082d2b92456be | ajhc/ajhc | TypeCheck.hs | module E.TypeCheck(
canBeBox,
eAp,
inferType,
infertype,
typecheck,
match,
sortSortLike,
sortKindLike,
sortTermLike,
sortTypeLike,
typeInfer,
typeInfer'
) where
import Control.Monad.Reader
import Control.Monad.Writer
import qualified Data.Map as Map
import Doc.DocLi... | null | https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/src/E/TypeCheck.hs | haskell | # SOURCE #
# SOURCE #
sort kind
sort superkind
sort box
functions from values to values are boxed and lazy
functions from values to unboxed tuples are boxed and lazy
functions from unboxed tuples to values are boxed and strict
functions from unboxed tuples to unboxed tuples are boxed and strict
may have ... | module E.TypeCheck(
canBeBox,
eAp,
inferType,
infertype,
typecheck,
match,
sortSortLike,
sortKindLike,
sortTermLike,
sortTypeLike,
typeInfer,
typeInfer'
) where
import Control.Monad.Reader
import Control.Monad.Writer
import qualified Data.Map as Map
import Doc.DocLi... |
6e2f6e82bb629e1432e431041cb14fb8d9360f57aafbe810ed57d3e46bbe7d0f | janestreet/ecaml | mode_line.mli | open! Core
open! Import
module Format : sig
type t [@@deriving sexp_of]
(** [(describe-variable 'mode-line-format)] *)
val in_buffer : t Buffer_local.t
end
* [ ( describe - function ' format - mode - line ) ]
Sadly , in test , which runs Emacs batch mode , [ text ] always returns the empty string .
S... | null | https://raw.githubusercontent.com/janestreet/ecaml/7c16e5720ee1da04e0757cf185a074debf9088df/src/mode_line.mli | ocaml | * [(describe-variable 'mode-line-format)] | open! Core
open! Import
module Format : sig
type t [@@deriving sexp_of]
val in_buffer : t Buffer_local.t
end
* [ ( describe - function ' format - mode - line ) ]
Sadly , in test , which runs Emacs batch mode , [ text ] always returns the empty string .
Sadly, in test, which runs Emacs batch mode, [text... |
4d38716311c236372dd4f5f24361dfff7970149bc6f2f160020cfe03ac662dd2 | savonet/ocaml-mm | audio.ml |
* Copyright 2011 The Savonet Team
*
* This file is part of ocaml - mm .
*
* is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your ... | null | https://raw.githubusercontent.com/savonet/ocaml-mm/f931d881512cf3a74399c261aa5877fb69bfe524/src/audio.ml | ocaml | TODO:
- lots of functions require offset and length whereas in most cases we
want to apply the operations on the whole buffers -> labeled optional
arguments?
- do we want to pass samplerate as an argument or to store it in buffers?
* Fractional part of a float.
TODO: sharps and flats
TODO: refined all... |
* Copyright 2011 The Savonet Team
*
* This file is part of ocaml - mm .
*
* is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your ... |
e065c4d15beeee75abc12c77f87e4442bc01636c0e8c426eec6b8bf4189967c1 | QuentinDuval/triboard | store.cljs | (ns triboard.store
(:require
[cljs.spec :as s]
[reagent.core :as reagent]
[triboard.logic.game :as game]
[triboard.logic.player :as player]
[triboard.logic.turn :as turn])
(:require-macros
[reagent.ratom :refer [reaction]]))
;; -----------------------------------------
;; Private
;; ------... | null | https://raw.githubusercontent.com/QuentinDuval/triboard/2641d4c033fa0c64a02ef4564005b616d81b1a13/src/cljs/triboard/store.cljs | clojure | -----------------------------------------
Private
-----------------------------------------
-----------------------------------------
Public API (reactive consumption)
-----------------------------------------
-----------------------------------------
Public API (updates)
--------------------------------------... | (ns triboard.store
(:require
[cljs.spec :as s]
[reagent.core :as reagent]
[triboard.logic.game :as game]
[triboard.logic.player :as player]
[triboard.logic.turn :as turn])
(:require-macros
[reagent.ratom :refer [reaction]]))
(defonce app-state
(reagent/atom
{:game (game/new-game)
... |
074828a33593ff8ab52b7ca3b369d603d394c8ef66274ea4dbb34ec25663330e | thheller/shadow-cljs | debug.clj | (ns shadow.debug)
(defn merge-opts [m opts]
(cond
(map? opts)
(merge m opts)
(keyword? opts)
(assoc m :label opts)
:else
(assoc m :view-opts opts)))
(defn dbg-info [env form opts]
(let [{:keys [line column]} (meta form)]
(-> {:ns (str *ns*)}
(cond->
line
(... | null | https://raw.githubusercontent.com/thheller/shadow-cljs/93f6eea3b02d81440ec2fb97b89f7a99b8459004/src/main/shadow/debug.clj | clojure | abusing tap> because it is in core and doesn't require additional requires
FIXME: make this all noop unless enabled | (ns shadow.debug)
(defn merge-opts [m opts]
(cond
(map? opts)
(merge m opts)
(keyword? opts)
(assoc m :label opts)
:else
(assoc m :view-opts opts)))
(defn dbg-info [env form opts]
(let [{:keys [line column]} (meta form)]
(-> {:ns (str *ns*)}
(cond->
line
(... |
18dd33e90e8ac40f7e094e6dc72eb111fcb00b03a11694b4682552c8715c5789 | chiroptical/polysemy-playground | Main.hs | # LANGUAGE TypeApplications #
module Main where
import Api
import DatabaseEff (
databaseEffToIO,
makeTablesIfNotExists,
)
import Database (DbErr (..))
import Polysemy (runM)
import Polysemy.Error (runError)
import Polysemy.Reader (runReader)
import Colog.Polysemy (runLogAction)
import Message (logMessageStdou... | null | https://raw.githubusercontent.com/chiroptical/polysemy-playground/00e84ddc0f32996e09f48ea45cd9e9333fdcc147/app/Main.hs | haskell | # LANGUAGE TypeApplications #
module Main where
import Api
import DatabaseEff (
databaseEffToIO,
makeTablesIfNotExists,
)
import Database (DbErr (..))
import Polysemy (runM)
import Polysemy.Error (runError)
import Polysemy.Reader (runReader)
import Colog.Polysemy (runLogAction)
import Message (logMessageStdou... | |
3a054750ce0a0eea6149ba8f5fdbe558d2ec63f372ba0347422d13dfb2c50ea2 | mbj/stratosphere | S3OutputProperty.hs | module Stratosphere.SageMaker.ModelBiasJobDefinition.S3OutputProperty (
S3OutputProperty(..), mkS3OutputProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data S3O... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/ModelBiasJobDefinition/S3OutputProperty.hs | haskell | module Stratosphere.SageMaker.ModelBiasJobDefinition.S3OutputProperty (
S3OutputProperty(..), mkS3OutputProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data S3O... | |
a5c35d2905f53ef0ddf96399378311c17300e81788af206f987442f5c86ee369 | Stratus3D/programming_erlang_exercises | spawn_registered_fun.erl | -module(spawn_registered_fun).
-export([start/2]).
% Example usage:
%
1 > spawn_registered_fun : start(foo , fun ( ) - > receive _ - > ok end end ) .
% {ok,<0.40.0>}
2 > spawn_registered_fun : start(foo , fun ( ) - > receive _ - > ok end end ) .
% {error,already_running}
% Use guards to ensure the arguments pass... | null | https://raw.githubusercontent.com/Stratus3D/programming_erlang_exercises/e4fd01024812059d338facc20f551e7dff4dac7e/chapter_12/exercise_1/spawn_registered_fun.erl | erlang | Example usage:
{ok,<0.40.0>}
{error,already_running}
Use guards to ensure the arguments passed in are what this function requires
Since we can only execute Fun after we are sure the the register/2 call
Fun. This is most easily done inside the newly spawned process. If the
register/2 call fails we can simply sen... | -module(spawn_registered_fun).
-export([start/2]).
1 > spawn_registered_fun : start(foo , fun ( ) - > receive _ - > ok end end ) .
2 > spawn_registered_fun : start(foo , fun ( ) - > receive _ - > ok end end ) .
start(AnAtom, Fun) when is_atom(AnAtom), is_function(Fun, 0) ->
Sender = self(),
has succeeded ... |
861833e5f2810ad84cbba35e79374d505f325d4d29e4ff58f3e0d1cc608f85b1 | herd/herdtools7 | ARMBase.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b22ec02af1300a45e2b646cce4253ecd4fa7f250/lib/ARMBase.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
b02ac930720ef4a3c663f7be1ae90e3cfeefabbb0807066d57e06b9b959b32b1 | typelead/eta | T3743.hs | { - # OPTIONS_GHC -fno - warn - redundant - constraints # - }
{-# LANGUAGE ImplicitParams, GADTs #-}
module T3743 where
class Foo a
data M where M :: Foo a => a -> M
x :: (?x :: ()) => ()
x = undefined
-- foo :: (?x :: ()) => M -> ()
foo y = case y of
M _ -> x
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T3743.hs | haskell | # LANGUAGE ImplicitParams, GADTs #
foo :: (?x :: ()) => M -> () | { - # OPTIONS_GHC -fno - warn - redundant - constraints # - }
module T3743 where
class Foo a
data M where M :: Foo a => a -> M
x :: (?x :: ()) => ()
x = undefined
foo y = case y of
M _ -> x
|
c0fd215c18fbfa088459a33fb8b16e28584356f9a31b1eb8db6cae8faa37a0ce | SchornacklabSLCU/amfinder | amfbrowser.ml | AMFinder - amfbrowser.ml
*
* MIT License
* Copyright ( c ) 2021
*
* 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 limit... | null | https://raw.githubusercontent.com/SchornacklabSLCU/amfinder/1053045b431b9e9e85a7bcebea2e38cda92a8dcd/amfbrowser/sources/amfbrowser.ml | ocaml | Callbacks apply to the active image. It is given as
* a reference so changes won't affect callback behavior.
Magnifier events.
Prediction events.
GtkToggleButtons.
GtkDrawingArea events.
Toolbox events.
Retrieve input image.
Displays the main window and sets UI drawing parameters.
Loads the image base... | AMFinder - amfbrowser.ml
*
* MIT License
* Copyright ( c ) 2021
*
* 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 limit... |
31cef171613025bce8146cde93563d2588389dd0ae2972290e492ea308dc39f6 | damhiya/MetaLambda | PrettyPrinter.hs | module MetaLambda.ConcreteSyntax.PrettyPrinter where
import Prettyprinter
import MetaLambda.Syntax
prettyId :: Id -> Doc ann
prettyId (Id x i) = pretty $ mconcat [x,"_",show i]
prettyGId :: GId -> Doc ann
prettyGId (GId u i) = pretty $ mconcat [u,"_",show i]
arrow :: Doc ann
arrow = "->"
vdash ... | null | https://raw.githubusercontent.com/damhiya/MetaLambda/d9fe28f3df1c8020e7d0960ca333b759e1ac5f95/src/MetaLambda/ConcreteSyntax/PrettyPrinter.hs | haskell | module MetaLambda.ConcreteSyntax.PrettyPrinter where
import Prettyprinter
import MetaLambda.Syntax
prettyId :: Id -> Doc ann
prettyId (Id x i) = pretty $ mconcat [x,"_",show i]
prettyGId :: GId -> Doc ann
prettyGId (GId u i) = pretty $ mconcat [u,"_",show i]
arrow :: Doc ann
arrow = "->"
vdash ... | |
4960082828c0b22f02bfa8c51633a8aa278a4e4dc0d36e0d605ca5ec8f3036c6 | akvo/akvo-flow-api | form_instance.clj | (ns org.akvo.flow-api.endpoint.form-instance
(:require [clojure.set :refer [rename-keys]]
[clojure.spec.alpha :as s]
[compojure.core :refer [GET]]
[org.akvo.flow-api.boundary.form-instance :as form-instance]
[org.akvo.flow-api.boundary.survey :as survey]
[or... | null | https://raw.githubusercontent.com/akvo/akvo-flow-api/a4ac1158fe25d64639add86a075c47f8b01b9b68/api/src/clojure/org/akvo/flow_api/endpoint/form_instance.clj | clojure | (ns org.akvo.flow-api.endpoint.form-instance
(:require [clojure.set :refer [rename-keys]]
[clojure.spec.alpha :as s]
[compojure.core :refer [GET]]
[org.akvo.flow-api.boundary.form-instance :as form-instance]
[org.akvo.flow-api.boundary.survey :as survey]
[or... | |
c9f619fe408c9a442fccc305526c559cdde29d97b915fa61ab2a1e0117108e21 | alexandersgreen/qio-haskell | Heap.hs | {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
| This module contains the definition of a Type Class that represents a Heap .
In the context of QIO , a Heap is the type used to represent a classical
basis state . An instance of a Heap is also defined , that makes use of a Map .
module QIO.Heap where
i... | null | https://raw.githubusercontent.com/alexandersgreen/qio-haskell/2525f5bad5f2f5f278da6cdc4771b08650109d04/QIO/Heap.hs | haskell | # LANGUAGE TypeSynonymInstances, FlexibleInstances #
| The Heap Type Class
| define an 'initial' (i.e. empty) Heap
can make use of the underlying Map functions. |
| This module contains the definition of a Type Class that represents a Heap .
In the context of QIO , a Heap is the type used to represent a classical
basis state . An instance of a Heap is also defined , that makes use of a Map .
module QIO.Heap where
import qualified Data.Map as Map
import Data.Maybe as Mayb... |
82d5984b8ddda2e5c29b51537b53ce5aeda8b8295ac0a7040845f7697aa59fc6 | meooow25/haccepted | LabelledGraph.hs | {-# LANGUAGE DeriveTraversable #-}
|
Edge - labeled / weighted graphs
There are useful definitions and algorithms in Data . Tree and Data . Graph but sadly these only deal
with unlabeled graphs .
Most definitions here mirror those in Data . Graph .
buildLG
Builds a LGraph from a list of LEdges . O(n + m )... | null | https://raw.githubusercontent.com/meooow25/haccepted/d7313e905988a5d1ef0f4666aa2b91169d48f26f/src/LabelledGraph.hs | haskell | # LANGUAGE DeriveTraversable #
------------------------------------------------------------------------------
For tests | |
Edge - labeled / weighted graphs
There are useful definitions and algorithms in Data . Tree and Data . Graph but sadly these only deal
with unlabeled graphs .
Most definitions here mirror those in Data . Graph .
buildLG
Builds a LGraph from a list of LEdges . O(n + m ) for bounds size n and m edges .
... |
d0c9c4f126548fdbc2307a6f09ef86d60eda0c1892bc98b6f778d54e80d44ec2 | ocamllabs/ocaml-effects | ocamldep.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-effects/36008b741adc201bf9b547545344507da603ae31/tools/ocamldep.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
open Compenv
open Parsetree
let ppf = ... |
7722540f7c70aba01a96989bd96eb79253d0d573e8003f51d2dbe692753d49d7 | zehaochen19/vanilla-lang | Context.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Vanilla.Static.Context where
import qualified Data.Sequence as S
import Vanilla.Syntax.Cons (ConsVar)
import Vanilla.Syntax.Expr (EVar)
import Vanilla.Syntax.Type
( TEVar,
TVar,
Type (..),
)
data CtxMember
= CVar TVar
| CAssump EVar Type
| CCons ConsVa... | null | https://raw.githubusercontent.com/zehaochen19/vanilla-lang/d1e2bbd3125151ce2c0ddc20f735d3a55aeb6bc8/src/Vanilla/Static/Context.hs | haskell | | Find the solution of alpha hat in the context
| Applying a context, as a substitution, to a type | # LANGUAGE GeneralizedNewtypeDeriving #
module Vanilla.Static.Context where
import qualified Data.Sequence as S
import Vanilla.Syntax.Cons (ConsVar)
import Vanilla.Syntax.Expr (EVar)
import Vanilla.Syntax.Type
( TEVar,
TVar,
Type (..),
)
data CtxMember
= CVar TVar
| CAssump EVar Type
| CCons ConsVa... |
1f689564e6b755f04eb4c9a396f3f210a0336a7a945f52a792ea651a3838b18a | shortishly/tansu | tansu_mnesia.erl | Copyright ( c ) 2016 < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under... | null | https://raw.githubusercontent.com/shortishly/tansu/154811fff81855419de9af380c81c7ae14e435d0/src/tansu_mnesia.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissi... | Copyright ( c ) 2016 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(tansu_mnesia).
-export([activity/1]).
-export([create_table/2]).
-spec create_table(Table :: atom(), Options :: list()) -> ok | {error, R... |
b95e4aaa709fe2a485294083b2cf2b0a4b13a8ac5677a39ee4adef58a490ae91 | tek/polysemy-log | Log.hs | -- |Description: Internal
module Polysemy.Log.Log where
import Polysemy.Conc (Race)
import Polysemy.Internal.Tactics (liftT)
import Polysemy.Time (GhcTime, interpretTimeGhc)
import Polysemy.Log.Conc (interceptDataLogConc)
import Polysemy.Log.Effect.DataLog (DataLog (DataLog, Local), dataLog)
import Polysemy.Log.Effec... | null | https://raw.githubusercontent.com/tek/polysemy-log/385efb9043de0fef84943982723cbf32ed6caee4/packages/polysemy-log/lib/Polysemy/Log/Log.hs | haskell | |Description: Internal
|Interpret 'Log' into the intermediate internal effect 'LogMetadata'.
|Interpret the intermediate internal effect 'LogMetadata' into 'DataLog'.
# inline interpretLogMetadataDataLog #
|Interpret the intermediate internal effect 'LogMetadata' into 'DataLog'.
# inline interpretLogMetadataDataLo... | module Polysemy.Log.Log where
import Polysemy.Conc (Race)
import Polysemy.Internal.Tactics (liftT)
import Polysemy.Time (GhcTime, interpretTimeGhc)
import Polysemy.Log.Conc (interceptDataLogConc)
import Polysemy.Log.Effect.DataLog (DataLog (DataLog, Local), dataLog)
import Polysemy.Log.Effect.Log (Log (Log))
import P... |
8f19984eb46cef6399ca9be0c5fe6deb8b45da670b7a1bfea00dfe083c162815 | input-output-hk/cardano-wallet | Addresses.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.Integration.Scenario.API.Shelley.Addresses
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/7b541e0b11fdd69b30d94104dbd5fa633ff1d5c3/lib/wallet/integration/src/Test/Integration/Scenario/API/Shelley/Addresses.hs | haskell | make sure all transactions are in ledger
integration tests are configured for mainnet
Ideally, we would also like to check that there's no used address on
B yet, but this would make the test quite flaky. Indeed, the integration
tests produces block very fast and by the time we make this call the
transaction may ... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.Integration.Scenario.API.Shelley.Addresses
... |
e63d3e958ed17ef69ef31faecabc1441b6287ec6c8783c2287a984b94a5e9647 | sangkilc/ofuzz | fastlib.mli | (* ofuzz - partition-based mutational fuzzing *)
* fast library
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source and bina... | null | https://raw.githubusercontent.com/sangkilc/ofuzz/ba53cc90cc06512eb90459a7159772d75ebe954f/src/fastlib.mli | ocaml | ofuzz - partition-based mutational fuzzing
* File handler type
* [copy a b] copies file [a] to file [b]
* [exec cmds timeout oflag] executes a command line [cmds] up to [timeout]
seconds, and returns a tuple (code, pid). If [oflag] is true, then the
output of execution is shown. The return code is 0 if ther... |
* fast library
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are p... |
533d7eb8a75330ab93e531ad4e56823a3dd1aa612cab4f9cd0e09f2b798a46a8 | phadej/cabal-extras | Warning.hs | module CabalEnv.Warning where
import Peura
data W = WMissingCabalEnvData
deriving (Eq, Ord, Enum, Bounded)
instance Universe W where universe = [minBound .. maxBound]
instance Finite W
instance Warning W where
warningToFlag WMissingCabalEnvData = "missing-cabal-envdata"
| null | https://raw.githubusercontent.com/phadej/cabal-extras/378cac5495b829794d67f243b27a9317eeed0858/cabal-env/src/CabalEnv/Warning.hs | haskell | module CabalEnv.Warning where
import Peura
data W = WMissingCabalEnvData
deriving (Eq, Ord, Enum, Bounded)
instance Universe W where universe = [minBound .. maxBound]
instance Finite W
instance Warning W where
warningToFlag WMissingCabalEnvData = "missing-cabal-envdata"
| |
ca465715b371498c7575a6744d11cd6dc9286e9d5d3850a600de7a99661a328c | input-output-hk/cardano-sl | Parallelize.hs | module Test.Pos.Util.Parallel.Parallelize
( parallelizeAllCores
) where
import Universum
import GHC.Conc (getNumProcessors, setNumCapabilities)
-- | `parallelizeAllCores` gets the number of processors on a machine and
-- sets the number of threads equal to the number of processors o... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/util/test/Test/Pos/Util/Parallel/Parallelize.hs | haskell | | `parallelizeAllCores` gets the number of processors on a machine and
sets the number of threads equal to the number of processors on the machine. | module Test.Pos.Util.Parallel.Parallelize
( parallelizeAllCores
) where
import Universum
import GHC.Conc (getNumProcessors, setNumCapabilities)
parallelizeAllCores :: IO ()
parallelizeAllCores = getNumProcessors >>= setNumCapabilities
|
a3ab42508d654589146e2624d375fda702704e5b366a9247842e196297ddabd8 | 2600hz/kazoo | kzd_vm_message_metadata.erl | %%%-----------------------------------------------------------------------------
( C ) 2010 - 2020 , 2600Hz
%%% @doc
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 /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_documents/src/kzd_vm_message_metadata.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
----------------------------------------------------------------------------- | ( C ) 2010 - 2020 , 2600Hz
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(kzd_vm_message_metadata).
-export([new/0]).
-export([call_id/1, call_id/2, set_call_id/2]).
-export([call... |
7d207fc22441850fe83a91b7096c63b733663c2fcfb5302d74f7e36685032456 | tnelson/Forge | basic-example-core.rkt | #lang forge/new-mode/core
(sig A)
(sig B)
(relation r (A B))
(run my-run)
(display my-run) | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/new-mode/examples/basic-example-core.rkt | racket | #lang forge/new-mode/core
(sig A)
(sig B)
(relation r (A B))
(run my-run)
(display my-run) | |
427615f47a56be6ba4223f969428abbcb263522f9fbe57c6dff5415987d549a8 | input-output-hk/hydra | MockChain.hs | # LANGUAGE RecordWildCards #
module Hydra.Model.MockChain where
import Hydra.Cardano.Api
import Hydra.Prelude hiding (Any, label)
import Cardano.Binary (serialize', unsafeDeserialize')
import Cardano.Ledger.Alonzo.TxSeq (TxSeq (TxSeq))
import qualified Cardano.Ledger.Babbage.Tx as Ledger
import qualified Cardano.Led... | null | https://raw.githubusercontent.com/input-output-hk/hydra/87eb24e2e29e8cd4c0060569d3d6ce45ded3be1f/hydra-node/test/Hydra/Model/MockChain.hs | haskell | NOTE: this is not used (yet) but could be used to trigger arbitrary rollbacks
in the run model
seconds
direct knowlege of the cardano keys which are stored only at the `ChainComponent` level.
NOTE: The wallet basically does nothing | # LANGUAGE RecordWildCards #
module Hydra.Model.MockChain where
import Hydra.Cardano.Api
import Hydra.Prelude hiding (Any, label)
import Cardano.Binary (serialize', unsafeDeserialize')
import Cardano.Ledger.Alonzo.TxSeq (TxSeq (TxSeq))
import qualified Cardano.Ledger.Babbage.Tx as Ledger
import qualified Cardano.Led... |
6e5eb6ad4f1f349896455df3923bdffab0e54d17c02a5c3fa75e19ee55b4a42a | haskell-opengl/OpenGLRaw | VertexArrayObject.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.VertexArrayObject
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
--------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/ARB/VertexArrayObject.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.ARB.VertexArrayObject
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* Funct... | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.ARB.VertexArrayObject (
glGetARBVertexArrayObject,
gl_ARB_vertex_array_object,
pattern GL_VERTEX_ARRAY_BINDING,
glBindVertexArray,
glDeleteVertexArrays,
glGenVertexArrays,
glIsVertexArray
) where
im... |
587016de2a166426209440b77e0848ef10995822df9fda1b3cc5753f3d902091 | hammerlab/prohlatype | mpjson2tsv.ml |
open Prohlatype
open Cmdline_options
let app_name = "mpjson2tsv"
let f_of_yojson =
ParPHMM_drivers.(Output.of_yojson Multiple_loci.final_read_info_of_yojson)
let of_json_file f =
Yojson.Safe.stream_from_file f
only one element per file .
|> f_of_yojson
|> unwrap
let convert output_opt json_file =
let o... | null | https://raw.githubusercontent.com/hammerlab/prohlatype/3acaf7154f93675fc729971d4c76c2b133e90ce6/src/app/mpjson2tsv.ml | ocaml |
open Prohlatype
open Cmdline_options
let app_name = "mpjson2tsv"
let f_of_yojson =
ParPHMM_drivers.(Output.of_yojson Multiple_loci.final_read_info_of_yojson)
let of_json_file f =
Yojson.Safe.stream_from_file f
only one element per file .
|> f_of_yojson
|> unwrap
let convert output_opt json_file =
let o... | |
96a7353547c5268a2b72e4643162cf5233d287e9fdf21ed9d60beb63ed96fd63 | patzy/glaw | texture.lisp | (in-package #:glaw-examples)
(defstruct texture
view
image
(start-red 0)
texture
sprites)
(defmethod init-example ((it texture))
(setf (texture-image it) (glaw::create-image 256 256 4)
(texture-texture it) (glaw:create-texture-from-image (texture-image it))
(texture-view it) (glaw:create-... | null | https://raw.githubusercontent.com/patzy/glaw/e678fc0c107ce4b1e3ff9921a6de7e32fd39bc37/examples/texture.lisp | lisp | (in-package #:glaw-examples)
(defstruct texture
view
image
(start-red 0)
texture
sprites)
(defmethod init-example ((it texture))
(setf (texture-image it) (glaw::create-image 256 256 4)
(texture-texture it) (glaw:create-texture-from-image (texture-image it))
(texture-view it) (glaw:create-... | |
61ca9d6665b03563673fc3d4bd8282c7f336eaee19c8409a1bfd0cbc89584140 | futurice/haskell-mega-repo | AWS.hs | {-# LANGUAGE OverloadedStrings #-}
module Futurice.App.Sisosota.AWS where
import Futurice.Prelude
import Prelude ()
import Data.Conduit.Binary (sinkLbs)
import qualified Codec.Compression.Lzma as LZMA
import qualified Control.Monad.Trans.AWS as AWS
import qualified Data.HashMap.Strict as HM
import qualified N... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/sisosota-client/src/Futurice/App/Sisosota/AWS.hs | haskell | # LANGUAGE OverloadedStrings #
^ optional mime type
^ content data
& AWS.poContentEncoding ?~ "lzma" | module Futurice.App.Sisosota.AWS where
import Futurice.Prelude
import Prelude ()
import Data.Conduit.Binary (sinkLbs)
import qualified Codec.Compression.Lzma as LZMA
import qualified Control.Monad.Trans.AWS as AWS
import qualified Data.HashMap.Strict as HM
import qualified Network.AWS.S3.GetObject as AWS
impo... |
f8e96f7d21ed75be99445b0c6e15a3eafa68bd6eb5a2dd16147a3056165d8702 | xclerc/ocamljava | bytecodegen_prim.ml |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/compiler/javacomp/bytecodegen_prim.ml | ocaml | tagged values
normalized values
unboxed values
boxed values |
* This file is part of compiler .
* Copyright ( C ) 2007 - 2015 .
*
* compiler is free software ; you can redistribute it and/or modify
* it under the terms of the Q Public License as published by
* ( with a change to choice of law ) .
*
* compiler is distributed in the hope that it ... |
82ff1f2cd52352c9c31e0f95e25db5d3ac815d0f19bdb3ba4f979f27a2956a55 | andrenth/srsly | proxymap.ml | open Lwt
open Printf
open Release_lwt
open Log_lwt
open Util
module O = Release.Util.Option
module B = Release.Buffer
module C = Srslyd_config
let replace_formats =
List.fold_left (fun s (fmt, rep) -> Str.global_replace (Str.regexp fmt) rep s)
let build_request fmt table flags key =
replace_formats fmt
[ ("... | null | https://raw.githubusercontent.com/andrenth/srsly/fce92645781a6a6037512be4d35116ec53737b17/src/proxymap.ml | ocaml | This parser doesn't take advantage of the null-byte separator of the
* postfix query format because there's no guarantee it's not going to
* change in the future.
done
* Queries for `sender` in the appropriate lookup table and checks if the
* result is a remote address.
Chooses a random key from a map, weig... | open Lwt
open Printf
open Release_lwt
open Log_lwt
open Util
module O = Release.Util.Option
module B = Release.Buffer
module C = Srslyd_config
let replace_formats =
List.fold_left (fun s (fmt, rep) -> Str.global_replace (Str.regexp fmt) rep s)
let build_request fmt table flags key =
replace_formats fmt
[ ("... |
e9ec2320afbc1b5f181fdd285e29b38cfe6c51a32402fd5ba02789cb5c42d824 | spwhitton/consfigurator | libcap.lisp | (in-package :consfigurator.util.posix1e)
(include "sys/capability.h")
(ctype cap_t "cap_t")
(ctype cap_value_t "cap_value_t")
(cenum cap_flag_t
((:cap-effective "CAP_EFFECTIVE"))
((:cap-permitted "CAP_PERMITTED"))
((:cap-inheritable "CAP_INHERITABLE")))
(cenum cap_flag_value_t ((:cap-set "CAP_SE... | null | https://raw.githubusercontent.com/spwhitton/consfigurator/3019bfea87ab6df33845f3bf7f7df03a33a5970d/src/libcap.lisp | lisp | (in-package :consfigurator.util.posix1e)
(include "sys/capability.h")
(ctype cap_t "cap_t")
(ctype cap_value_t "cap_value_t")
(cenum cap_flag_t
((:cap-effective "CAP_EFFECTIVE"))
((:cap-permitted "CAP_PERMITTED"))
((:cap-inheritable "CAP_INHERITABLE")))
(cenum cap_flag_value_t ((:cap-set "CAP_SE... | |
1f7753dd1a7fa170e305917a12ff54e4ea292bd60d6e2c52db5f0a5fc6e2d2ca | ekmett/linear | V.hs | # LANGUAGE CPP #
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DefaultSignatures #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE MultiParamTypeClasses , FlexibleContexts , Flex... | null | https://raw.githubusercontent.com/ekmett/linear/7dbe6a55d68311320ca2994ca700392abe938114/src/Linear/V.hs | haskell | # LANGUAGE Rank2Types #
# LANGUAGE EmptyDataDecls #
# LANGUAGE DeriveDataTypeable #
---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable
n-D Vectors
-----------------------------------... | # LANGUAGE CPP #
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE DefaultSignatures #
# LANGUAGE TypeFamilies #
# LANGUAGE MultiParamTypeClasses , FlexibleContexts , FlexibleInstances , UndecidableInstances #
# LANGUAGE DataKinds ... |
af2d8b1b6a9ca27a7c32d10a8286e4eab94ac6bbcc35d25507f21d5b4d748e3e | dnadales/sandbox | BinTree.hs | -- | A binary tree.
module Data.BinTree where
import Control.Monad.State
import Data.Functor.Fixedpoint
data BinTree a = Nil | Fork a (BinTree a) (BinTree a)
deriving (Show, Eq)
-- | Computes the leaves of a binary tree by straightforward recursion,
-- using lists.
leaves :: BinTree a -> [a]
l... | null | https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/leaves-of-a-tree/src/Data/BinTree.hs | haskell | | A binary tree.
| Computes the leaves of a binary tree by straightforward recursion,
using lists.
| Recursion using difference lists.
| Computes the leaves of a binary tree by straightforward recursion,
using difference lists.
| Compute the leaves in a state monad.
| Generate a tree from a list.
| Functor who... |
module Data.BinTree where
import Control.Monad.State
import Data.Functor.Fixedpoint
data BinTree a = Nil | Fork a (BinTree a) (BinTree a)
deriving (Show, Eq)
leaves :: BinTree a -> [a]
leaves Nil = []
leaves (Fork x Nil Nil) = [x]
leaves (Fork _ lt rt) = leaves lt ++ leaves rt
leavesT :: BinT... |
9c1da99e67759914b0a49c243150bc5b816e9b8342df995a24216fd6cb30ad4c | RichiH/git-annex | MagicWormhole.hs | Magic Wormhole integration
-
- Copyright 2016 < >
-
- License : BSD-2 - clause
-
- Copyright 2016 Joey Hess <>
-
- License: BSD-2-clause
-}
module Utility.MagicWormhole (
Code,
mkCode,
toCode,
fromCode,
validCode,
CodeObserver,
CodeProducer,
mkCodeObserver,
mkCodeProducer,
waitCode,
... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Utility/MagicWormhole.hs | haskell | | A Magic Wormhole code.
| Smart constructor for Code
| An appid should be provided when using wormhole in an app, to avoid
using the same channel space as ad-hoc wormhole users.
eg if there's a network problem).
Currently this has to parse the output of wormhole to find the code.
To make this as robust as poss... | Magic Wormhole integration
-
- Copyright 2016 < >
-
- License : BSD-2 - clause
-
- Copyright 2016 Joey Hess <>
-
- License: BSD-2-clause
-}
module Utility.MagicWormhole (
Code,
mkCode,
toCode,
fromCode,
validCode,
CodeObserver,
CodeProducer,
mkCodeObserver,
mkCodeProducer,
waitCode,
... |
baaa8f30db7d899503cc9f598cb8912a0d014ae8eab41d7b1d70d22d717c6e22 | Helium4Haskell/helium | ExprDoLastNotExpr.hs | module ExprDoLastNotExpr where
main = do { x <- main } | null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/staticerrors/ExprDoLastNotExpr.hs | haskell | module ExprDoLastNotExpr where
main = do { x <- main } | |
2e0e84d8e4e233516d3b11eaf3e69350a83ade6c9ba7ea72d9f879e3a1a19244 | ageneau/blossom | utils.cljc | (ns blossom.utils)
(defn wget
"Get index i from v, wrapping negative indices if necessary."
[v i]
(assert (counted? v)
"inefficient count operation")
(nth v (mod i (count v))))
(defn filter-and-find-min-for-key
"Remove nil elements from sequence and find an element for
which (get element key) i... | null | https://raw.githubusercontent.com/ageneau/blossom/67a6a2bcc30776867fe16b4e79122e7f43e4928a/src/blossom/utils.cljc | clojure | (ns blossom.utils)
(defn wget
"Get index i from v, wrapping negative indices if necessary."
[v i]
(assert (counted? v)
"inefficient count operation")
(nth v (mod i (count v))))
(defn filter-and-find-min-for-key
"Remove nil elements from sequence and find an element for
which (get element key) i... | |
13c2ff39afc5cfbac376fccd5d1c0761305bd1d5f633e167adf13efc6f8fac02 | onlyshk/g711 | g711.erl | Copyright ( c ) < 2011 > , < >
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%% * Redistributions of source code must retain the above copyright
%% notice, this list of conditio... | null | https://raw.githubusercontent.com/onlyshk/g711/4eed180db195917bef452f9b8baaa727f7915983/src/g711.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistrib... | Copyright ( c ) < 2011 > , < >
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND
DISCLAIMED . IN NO EVENT SHALL < COPYRIGHT HOLDER > BE LIABLE FOR ANY
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREME... |
58a125ce9ea0f1af554958d545c612c36c37f2f8420c725c662a36c0f5eeaa04 | dwincort/AdaptiveFuzz | prim.ml | file name : prim.ml
created by :
Last modified : 12/20/2015
Description :
This file contains code for interpreting primitives .
created by: Daniel Winograd-Cort
Last modified: 12/20/2015
Description:
This file contains code for interpreting SFuzz primitives.
*)
open Typ... | null | https://raw.githubusercontent.com/dwincort/AdaptiveFuzz/ec937e1ea028e17216928dbdd029a5b9b04a0533/src/prim.ml | ocaml | The expectation functions take a term and return an ocaml value
Theoretically, we could check that it's actually a function, but we don't need to
thunkify is a special function whose purpose is to wrap around a primitive function and prevent
it from being evaluated too soon. Essentially, it helps enforce tha... | file name : prim.ml
created by :
Last modified : 12/20/2015
Description :
This file contains code for interpreting primitives .
created by: Daniel Winograd-Cort
Last modified: 12/20/2015
Description:
This file contains code for interpreting SFuzz primitives.
*)
open Typ... |
59873f45941e5cecc648a9b6b6bc9f81bf22eb25d677387287578a5d51b8213f | tolysz/prepare-ghcjs | Micro.hs | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import qualified Data.Aeson.Encoding.Builder as AB
import qualified Data.ByteString.Builder as B
import qualified Data.Text as T
main :: IO ()
main = do
let txt = "append (append b (primBounded w1 x1)) (primBounded w2 x2)"
def... | null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts8/aeson/benchmarks/Micro.hs | haskell | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import qualified Data.Aeson.Encoding.Builder as AB
import qualified Data.ByteString.Builder as B
import qualified Data.Text as T
main :: IO ()
main = do
let txt = "append (append b (primBounded w1 x1)) (primBounded w2 x2)"
def... | |
069e4f47db5ff3fabb0307c2b3a038da96047357f88eabcadef2d1e887714a64 | gethop-dev/hop-cli | user.cljs | 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 /
{{=<< >>=}}
(ns <<project.name>>.client.user
(:require [<<project.name>>.client.util :as util]
[ajax.core :as ajax]
[d... | null | https://raw.githubusercontent.com/gethop-dev/hop-cli/c7b848915ff268aa41ff9a61a62c614f58ecbeb9/resources/bootstrap/profiles/authentication/cognito/app/src/%7B%7Bproject.files-name%7D%7D/client/user.cljs | clojure | file, You can obtain one at / | 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
{{=<< >>=}}
(ns <<project.name>>.client.user
(:require [<<project.name>>.client.util :as util]
[ajax.core :as ajax]
[dev.gethop.session.re-frame.cognit... |
6d0fcf59879fc480ea41d272d2c392f4dcda6fc343be7b7875efc1a6217cb61b | codinuum/cca | cpp_unparsing.ml |
Copyright 2012 - 2020 Codinuum Software Lab < >
Copyright 2020 Chiba Institute of Technology
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unl... | null | https://raw.githubusercontent.com/codinuum/cca/85fd4426d998036a105509056690e963a174b581/src/ast/analyzing/langs/cpp/cpp_unparsing.ml | ocaml |
* An unparser for C/C++
*
* cpp_unparsing.ml
*
*****
*****
Declaration
Statement
| EmptyStatement -> _pr_semicolon()
Literal
UnqualifiedId
Operator
DefiningTypeSpecifier
AccessSpecifier
PlaceholderTypeSpecifier
StorageClassSpecifier
FunctionSpecifier
Requirement
NoptrAbstractPackDeclarato... |
Copyright 2012 - 2020 Codinuum Software Lab < >
Copyright 2020 Chiba Institute of Technology
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unl... |
57f24c8fc5479acffaaaa69e87356308579e96211f03306a955c38b06e75bc28 | ocaml/oasis2debian | GenPkg.ml | (******************************************************************************)
oasis2debian : Create and maintain Debian package for an OASIS package
(* *)
Copyright ( C ) 2013 ,
(* ... | null | https://raw.githubusercontent.com/ocaml/oasis2debian/41d268cada4afdac8c906ac99277d7c685bc15ae/src/GenPkg.ml | ocaml | ****************************************************************************
This library is free software; you can redistribute it and/or modify it
under the t... | oasis2debian : Create and maintain Debian package for an OASIS package
Copyright ( C ) 2013 ,
the Free Software Foundation ; either version 2.1 of the License , or ( at
You should have received a copy of the GNU Lesser General Public License
along with t... |
747c07f1d7b08baf5376bb88cb8655ecd12862f80184751571800712500a07e9 | bobzhang/ocaml-book | util.ml |
open Camlp4.PreCast.Syntax;
open Camlp4.PreCast;
open Camlp4.PreCast.Ast;
open Camlp4.Sig;
(**
[neg_string "ab" ] = ["-ab"]
[neg_string ""] = ["-"]
*)
value neg_string n =
let len = String.length n in
if len > 0 && n.[0] = '-' then String.sub n 1 (len - 1)
else "-" ^ n
;
(**
| "unary minus" NONA
... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/code/camlp4/parsers/util.ml | ocaml | *
[neg_string "ab" ] = ["-ab"]
[neg_string ""] = ["-"]
*
| "unary minus" NONA
[ "-"; e = SELF -> mkumin _loc "-" e
| "-."; e = SELF -> mkumin _loc "-." e ]
since ocaml respect (~-) as a prefix (-)
and (~-.) as a prefix (-.)
this case takes care about
... |
open Camlp4.PreCast.Syntax;
open Camlp4.PreCast;
open Camlp4.PreCast.Ast;
open Camlp4.Sig;
value neg_string n =
let len = String.length n in
if len > 0 && n.[0] = '-' then String.sub n 1 (len - 1)
else "-" ^ n
;
value mkumin _loc f arg =
match arg with
[ <:expr< $int:n$ >> -> <:expr< $int:neg_string n$ >>... |
213878663e3f8bf98184cb12bed808f549f457aa67136e03d3f08ab8b48bea71 | jtdaugherty/tart | AskToSave.hs | module UI.AskToSave
( drawAskToSaveUI
)
where
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Theme
drawAskToSaveUI :: AppState -> [Widget Name]
drawAskToSaveUI _ = [drawPromptWindow]
drawPromptWindow :: Widget Name
drawPromptWindow =
centerLayer $
borderWithLabe... | null | https://raw.githubusercontent.com/jtdaugherty/tart/03d2bb8c3a01f3249c6a442b42aa319dc3a4f5de/programs/UI/AskToSave.hs | haskell | module UI.AskToSave
( drawAskToSaveUI
)
where
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Theme
drawAskToSaveUI :: AppState -> [Widget Name]
drawAskToSaveUI _ = [drawPromptWindow]
drawPromptWindow :: Widget Name
drawPromptWindow =
centerLayer $
borderWithLabe... | |
443ddf65ceebd114dc22fdc07b5a791ca5c2691ea0c5b347ea10fc658e2faeae | esl/MongooseIM | mongoose_graphql_enum.erl | -module(mongoose_graphql_enum).
-export([input/2, output/2]).
-ignore_xref([input/2, output/2]).
input(<<"PresenceShow">>, Show) ->
{ok, list_to_binary(string:to_lower(binary_to_list(Show)))};
input(<<"PresenceType">>, Type) ->
{ok, list_to_binary(string:to_lower(binary_to_list(Type)))};
input(<<"Affiliation... | null | https://raw.githubusercontent.com/esl/MongooseIM/c863ca0a6109c782577a63e00510f634ca31d831/src/graphql/mongoose_graphql_enum.erl | erlang | -module(mongoose_graphql_enum).
-export([input/2, output/2]).
-ignore_xref([input/2, output/2]).
input(<<"PresenceShow">>, Show) ->
{ok, list_to_binary(string:to_lower(binary_to_list(Show)))};
input(<<"PresenceType">>, Type) ->
{ok, list_to_binary(string:to_lower(binary_to_list(Type)))};
input(<<"Affiliation... | |
5adb3fcebc99dce2bb6b9c1a5f2a6608344ce309b354f5bcbfb2f8de1fc21b3e | qiao/sicp-solutions | 1.19.scm | (define (fib n)
(fit-iter 1 0 0 1 n))
(define (fib-iter a b p q count)
(conf ((= count 0) b)
((even? count)
(fib-iter a
b
(+ (square p) (square q))
(+ (* 2 p q) (square q))
(/ count 2)))
(else (fib-iter (+ (* b q) ... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter1/1.19.scm | scheme | (define (fib n)
(fit-iter 1 0 0 1 n))
(define (fib-iter a b p q count)
(conf ((= count 0) b)
((even? count)
(fib-iter a
b
(+ (square p) (square q))
(+ (* 2 p q) (square q))
(/ count 2)))
(else (fib-iter (+ (* b q) ... | |
1b2b178d70a34edd7ac6034ee7df666ec8d93cecc6d23f0d4edb53cf67f4fef1 | aisamanra/config-ini | basic.hs | fromList
[ ( "s1",
fromList
[ ("foo", "bar"),
("baz", "quux")
]
),
( "s2",
fromList [("argl", "bargl")]
)
]
| null | https://raw.githubusercontent.com/aisamanra/config-ini/35dd9a28d32fde6c78b778653359579d65386d79/test/prewritten/cases/basic.hs | haskell | fromList
[ ( "s1",
fromList
[ ("foo", "bar"),
("baz", "quux")
]
),
( "s2",
fromList [("argl", "bargl")]
)
]
| |
9ac77d492cbf5a7487612ff86ef712c3412d7736f682ff4ed8c242d0cc9e0dc7 | maxcountryman/quanta | test_database.clj | (ns quanta.test_database
(:require [clj-leveldb :as level]
[clojure.set :refer [union]]
[clojure.test :refer [deftest is use-fixtures]]
[quanta.database :as database]))
(def ^{:private true} db (atom nil))
(defn db-fixture
[test-fn]
(let [paths [".test-primary.db" ... | null | https://raw.githubusercontent.com/maxcountryman/quanta/9a1cd9b5b0d2b1706db9c5184fd653f26162cb23/test/quanta/test_database.clj | clojure | Setup the test db instance.
Destroy the test db instance.
Note that we apply str to the regex pattern in order to check equality.
See: -1182
Ensure inserting a fresh vector populates the db.
Ensure only updates are returned.
Ensure partial updates work correctly.
Ensure an empty vector does not change stored v... | (ns quanta.test_database
(:require [clj-leveldb :as level]
[clojure.set :refer [union]]
[clojure.test :refer [deftest is use-fixtures]]
[quanta.database :as database]))
(def ^{:private true} db (atom nil))
(defn db-fixture
[test-fn]
(let [paths [".test-primary.db" ... |
0f9698506a819ef5b3e5e566261e30cf6e6929956e6c0a9b010f845f674872c9 | haskell/cabal | Upload.hs | module Distribution.Client.Upload (upload, uploadDoc, report) where
import Distribution.Client.Compat.Prelude
import qualified Prelude as Unsafe (tail, head, read)
import Distribution.Client.Types.Credentials ( Username(..), Password(..) )
import Distribution.Client.Types.Repo (Repo, RemoteRepo(..), maybeRepoRemote)
... | null | https://raw.githubusercontent.com/haskell/cabal/9f7dc559d682331515692dd7b42f9abd3a087898/cabal-install/src/Distribution/Client/Upload.hs | haskell | > stripExtensions ["tar", "gz"] "foo.tar.gz"
Just "foo"
> stripExtensions ["tar", "gz"] "foo.gz.tar"
Nothing
only pass tar.gz files to upload.
successfully.
save/restore the terminal echoing status (no echoing for entering the password)
We don't want to bomb out just because we haven't built any packages
from ... | module Distribution.Client.Upload (upload, uploadDoc, report) where
import Distribution.Client.Compat.Prelude
import qualified Prelude as Unsafe (tail, head, read)
import Distribution.Client.Types.Credentials ( Username(..), Password(..) )
import Distribution.Client.Types.Repo (Repo, RemoteRepo(..), maybeRepoRemote)
... |
eeb2ee465846b3120a7d9d9c425aa61a9cabfdcdab03a2e38591329e4a654b5c | zachsully/dl | Syntax.hs | module DL.LLVM.Syntax where
data LLVM :: * where
| null | https://raw.githubusercontent.com/zachsully/dl/c99cdfa8a3b59b1977a34876f397c467518091b6/haskell/DL/LLVM/Syntax.hs | haskell | module DL.LLVM.Syntax where
data LLVM :: * where
| |
d89606bc15fb205d759549c5ad30738d0e9811b0c256fc36f7bc8f4f32dd20d8 | naxels/youtube-channel-data | core.clj | (ns youtube-channel-data.core
(:gen-class)
(:require [clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[youtube-channel-data.output :as output]
[youtube-channel-data.utils :as u]
[youtube-channel-data.youtube.request :as yt-request]))
(set! *warn-on-re... | null | https://raw.githubusercontent.com/naxels/youtube-channel-data/05447d2ecdaef714c51548d33cbe9dcc1a2728ef/src/youtube_channel_data/core.clj | clojure | enable mocking with dynamically bound *slurp*
CLI | (ns youtube-channel-data.core
(:gen-class)
(:require [clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[youtube-channel-data.output :as output]
[youtube-channel-data.utils :as u]
[youtube-channel-data.youtube.request :as yt-request]))
(set! *warn-on-re... |
8ffc7dd9113b39ab0c4421753b467d801dbd775181d7a13c403926e79bb97784 | well-typed/large-records | R080.hs | #if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
# OPTIONS_GHC -fplugin = TypeLet #
module Experiment.HListLetAsCPS.Sized.R080 where
import TypeLet
import Bench.HList
import Bench.Types
... | null | https://raw.githubusercontent.com/well-typed/large-records/f75ba52570d07e1171e2c87ad7e4c1f466d9367f/large-records-benchmarks/bench/typelet/Experiment/HListLetAsCPS/Sized/R080.hs | haskell | # OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | #if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
# OPTIONS_GHC -fplugin = TypeLet #
module Experiment.HListLetAsCPS.Sized.R080 where
import TypeLet
import Bench.HList
import Bench.Types
import Common.HListOfSize.HL080
hlist :: HList Fields
hlist = constructLet $ \_ ->
79 .. 70
letAs' (MkT 79 :* Nil) $ ... |
6089ae70910aa2365b10207657d71ba9a7fbf1b5ab4da16b4a60533d78862b67 | AndrasKovacs/ELTE-func-lang | Practice09.hs | # LANGUAGE InstanceSigs #
module Practice09 where
import Control.Applicative
newtype Parser a
= P { runParser :: String -> Maybe (a, String) }
instance Functor Parser where
fmap :: (a -> b) -> Parser a -> Parser b
fmap f (P g) = P $ \str -> case g str of
Just (x, str') -> Just (f x, str')
Nothing ... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-1/szerda_gyak/Practice09.hs | haskell | char 'a' <|> char 'b' <|> char 'c' <|> ... <|> char 'z'
parses a given string
times 0 p = pure []
times n p = (:) <$> p <*> times (n-1) p | # LANGUAGE InstanceSigs #
module Practice09 where
import Control.Applicative
newtype Parser a
= P { runParser :: String -> Maybe (a, String) }
instance Functor Parser where
fmap :: (a -> b) -> Parser a -> Parser b
fmap f (P g) = P $ \str -> case g str of
Just (x, str') -> Just (f x, str')
Nothing ... |
5c0097d5780c4969f1f1007599869a51eef1ca7f042c8f7b78e8c89d9dd46b28 | nvim-treesitter/nvim-treesitter | locals.scm | [
(object)
(array)
] @scope
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/ddc0f1b606472b6a1ab85ee9becfd4877507627d/queries/json/locals.scm | scheme | [
(object)
(array)
] @scope
| |
c144b76f22c5aee821d05c172e5d1661f81018227d7ad04320888e7ca407b49a | emqx/emqx | emqx_authn_enable_flag_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_authn/test/emqx_authn_enable_flag_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2022 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_authn_enable_flag_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-inc... |
afc01f2b768f82937874dd47f904f259c0c9c8e6a97229dd8af0bde355a3488a | rowangithub/DOrder | 030_rlock.ml | let lock st = assert (st=0); 10
let unlock st = assert (st=10); 0
let f n st : int= if n > 0 then lock (st) else st
let g n st : int = if n > 0 then unlock (st) else st
let main n = assert ((g n (f n 0)) = 0) | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/030_rlock.ml | ocaml | let lock st = assert (st=0); 10
let unlock st = assert (st=10); 0
let f n st : int= if n > 0 then lock (st) else st
let g n st : int = if n > 0 then unlock (st) else st
let main n = assert ((g n (f n 0)) = 0) | |
4ffd81b725397104c7ac49b4f549ff35a5178258461ec8aa473301e324ef1cae | facebook/flow | ty_simplifier_test.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/d3c792ce86a18b200eb4cf9ff66734c2002951f1/src/common/ty/__tests__/ty_simplifier_test.ml | ocaml |
* {f: number} | {f: number}
* ~>
* {f: number}
* {+f: number} | {-f: number}
* ~>
* {+f: number} | {-f: number}
When merge_kinds is true, all kinds of `empty` are equivalent, even when
* nested under a type constructor.
*
* {f: empty} | {... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
d71c6a7f5f322295de318878020522ec3fd334d46c39f55ebc62199468e883da | GillianPlatform/Gillian | pc.ml | open Gil_syntax
module PureContext = Engine.PFS
module TypEnv = Engine.TypEnv
module FOSolver = Engine.FOSolver
type t = {
pfs : PureContext.t;
gamma : TypEnv.t;
learned : Formula.Set.t;
learned_types : (string * Type.t) list;
unification : bool;
}
let copy { pfs; gamma; learned; learned_types; unification ... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/1c8d65120c04ef87cda689a9d41268e25b5ffa7e/GillianCore/monadic/pc.ml | ocaml | open Gil_syntax
module PureContext = Engine.PFS
module TypEnv = Engine.TypEnv
module FOSolver = Engine.FOSolver
type t = {
pfs : PureContext.t;
gamma : TypEnv.t;
learned : Formula.Set.t;
learned_types : (string * Type.t) list;
unification : bool;
}
let copy { pfs; gamma; learned; learned_types; unification ... | |
d11b3fa4d477b14680e0253a28d7985c7bc1664231f9788a3e7a941a2ffc2a2f | gossiperl/gossiperl | gossiperl_member_fsm.erl | 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
%% to use, copy, modify, merge, publish, distr... | null | https://raw.githubusercontent.com/gossiperl/gossiperl/0e7a3806bdec94016ba12f069d1699037c477c29/src/gossiperl_member_fsm.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice ... | Copyright ( c ) 2014 < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
... |
bec0fea418117fd1f67981281671f4d63b91a6f8f0f3e3bc43de3f129d691fc2 | Rober-t/apxr_run | apxr_run_app.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright ( C ) 2018 ApproximateReality
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%----------------------------------------------------------------------------
@doc ApxrRun top level application ... | null | https://raw.githubusercontent.com/Rober-t/apxr_run/9c62ab028af7ff3768ffe3f27b8eef1799540f05/src/apxr_run_app.erl | erlang |
----------------------------------------------------------------------------
@end
----------------------------------------------------------------------------
Application callbacks
============================================================================
API
=====================================================... | Copyright ( C ) 2018 ApproximateReality
@doc ApxrRun top level application .
-module(apxr_run_app).
-behaviour(application).
-export([
start/2,
stop/1
]).
@private
-spec start(normal | {takeover, node()} | {failover, node()}, any()) -> {ok, pid()}.
start(_StartType, _StartArgs) ->
apxr_run_sup:start_li... |
ad2862b67599bbd16ac36f3fe692c34067ce5478e44f157fd4bb9eae8d782f12 | tweag/asterius | CmpWord8.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE MagicHash #
module Main where
import Data.Word
import Data.List
import GHC.Prim
import GHC.Exts
Having a wrapper gives us two things :
-- * it's easier to test everything (no need for code using raw primops)
-- * we test the deriving mechanism for Word8#
data TestWord8 = T... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/primops/CmpWord8.hs | haskell | # LANGUAGE BangPatterns #
* it's easier to test everything (no need for code using raw primops)
* we test the deriving mechanism for Word8#
(==)
(/=)
(<)
(>)
(<=)
(>=)
| # LANGUAGE MagicHash #
module Main where
import Data.Word
import Data.List
import GHC.Prim
import GHC.Exts
Having a wrapper gives us two things :
data TestWord8 = T8 Word8#
deriving (Eq, Ord)
mkT8 :: Word -> TestWord8
mkT8 (W# a) = T8 (narrowWord8# a)
main :: IO ()
main = do
let input = [ (a, b) | a <- ... |
d39228c922471ba91504c82c3a78196d30a456a12aae68c2dae9d6f8f97b7f9b | TGOlson/blockchain | Mining.hs | module Data.Blockchain.Mining
( module Data.Blockchain.Mining.Block
, module Data.Blockchain.Mining.Blockchain
) where
import Data.Blockchain.Mining.Block
import Data.Blockchain.Mining.Blockchain
| null | https://raw.githubusercontent.com/TGOlson/blockchain/da53ad888589b5a2f3fd2c53c33a399fefb48ab1/lib/Data/Blockchain/Mining.hs | haskell | module Data.Blockchain.Mining
( module Data.Blockchain.Mining.Block
, module Data.Blockchain.Mining.Blockchain
) where
import Data.Blockchain.Mining.Block
import Data.Blockchain.Mining.Blockchain
| |
50b5c6cff804495ef0cf769f62603cbaa6a31373a80523d49a2eed181e969029 | tari3x/csec-modex | pitranslweak.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/tari3x/csec-modex/5ab2aa18ef308b4d18ac479e5ab14476328a6a50/deps/proverif1.84/src/pitranslweak.ml | ocaml | Find the minimum phase in which choice is used
Rule base
Current hypotheses of the rule
Current constraints of the rule
Current unifications to do
List of constraints that should be false for the evaluation
of destructors to succeed
List of parameters of names
Current phase
For non-interference
Bot... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... |
150ac9188c895d4d37e14e52a8176a2f6b7e4b2593bf32591c605ec5d24e5d39 | epiccastle/spire | upload.clj | (ns spire.module.upload
(:require [spire.output.core :as output]
[spire.ssh :as ssh]
[spire.facts :as facts]
[spire.scp :as scp]
[spire.utils :as utils]
[spire.local :as local]
[spire.state :as state]
[spire.remote :as remote]
... | null | https://raw.githubusercontent.com/epiccastle/spire/f1161ae5ff74124d603c1679507fc0a1b31c26eb/src/clj/spire/module/upload.clj | clojure | analyse local and remote paths
straight single copy
content upload
file upload
_ (do (println "\n\n\n"))
generally we assume that if a copy happened, all attributes
and modes are correctly setup. | (ns spire.module.upload
(:require [spire.output.core :as output]
[spire.ssh :as ssh]
[spire.facts :as facts]
[spire.scp :as scp]
[spire.utils :as utils]
[spire.local :as local]
[spire.state :as state]
[spire.remote :as remote]
... |
b59480c873e888a91083f60cdf7c5d2de909aebab0a7400f5a511dbd830347bf | Nayshins/ocaml-tic-tac-toe | testMain.ml | open Core.Std
open OUnit2
let tests =
"Suite" >:::
[TokenTest.tests;
BoardTest.tests;
RulesTest.tests;
PlayerTest.tests;
BoardPresenterTest.tests;
NegamaxTest.tests;
SimpleComputerTest.tests;
HumanTest.tests;
ConsoleIOTest.tests;
GameTest.tests;
SetupTest.tests;]
let _ =
run_test_t... | null | https://raw.githubusercontent.com/Nayshins/ocaml-tic-tac-toe/a177feed4938552ce7df79f0e4d09b24cdcb3667/test/testMain.ml | ocaml | open Core.Std
open OUnit2
let tests =
"Suite" >:::
[TokenTest.tests;
BoardTest.tests;
RulesTest.tests;
PlayerTest.tests;
BoardPresenterTest.tests;
NegamaxTest.tests;
SimpleComputerTest.tests;
HumanTest.tests;
ConsoleIOTest.tests;
GameTest.tests;
SetupTest.tests;]
let _ =
run_test_t... | |
8b4c28317262649063bc6847d718ae6e7d403cb4ff2a80bd3a549be6b76393df | softwarelanguageslab/maf | R5RS_gambit_matrix-4.scm | ; Changes:
* removed : 0
* added : 0
* swaps : 0
* negated predicates : 1
; * swapped branches: 0
* calls to i d fun : 10
(letrec ((map2 (lambda (f l1 l2)
(if (let ((__or_res (null? l1))) (if __or_res __or_res (null? l2)))
()
(if (if (pair? l1) (pair? l... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_gambit_matrix-4.scm | scheme | Changes:
* swapped branches: 0 | * removed : 0
* added : 0
* swaps : 0
* negated predicates : 1
* calls to i d fun : 10
(letrec ((map2 (lambda (f l1 l2)
(if (let ((__or_res (null? l1))) (if __or_res __or_res (null? l2)))
()
(if (if (pair? l1) (pair? l2) #f)
(cons... |
2130223231dd618a738bf46490b5f150669234339e372e5cca7a8a03448be85e | vii/teepeedee2 | dispatcher.lisp | (in-package #:tpd2.http)
(defstruct dispatcher
canonical-name
(canonical-protocol "http://")
(paths (make-hash-table :test 'equalp))
(error-responder 'default-http-error-page))
(defun dispatch-servestate (con done *servestate*)
(dispatcher-respond (find-dispatcher (first (servestate-host*)))
... | null | https://raw.githubusercontent.com/vii/teepeedee2/a2ed78c51d782993591c3284562daeed3aba3d40/src/http/dispatcher.lisp | lisp | (in-package #:tpd2.http)
(defstruct dispatcher
canonical-name
(canonical-protocol "http://")
(paths (make-hash-table :test 'equalp))
(error-responder 'default-http-error-page))
(defun dispatch-servestate (con done *servestate*)
(dispatcher-respond (find-dispatcher (first (servestate-host*)))
... | |
0e9af661c7f3968b56ce35cd1ccb383e708d2a4ed7b62a4c447dc76c9109f961 | craigfe/sink | eq.ml | module type S = sig
type t
val equal : t -> t -> bool [@@infix ( = )]
end
[@@deriving typeclass, infix]
type 'a ty = 'a t
let poly (type a) (Proxy.T : a Proxy.t) : a t = { equal = Stdlib.( = ) }
module type S1 = sig
type 'a t
val equal : 'a ty -> 'a t -> 'a t -> bool
end
module type S2 = sig
type ('a, '... | null | https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/sink/eq.ml | ocaml | module type S = sig
type t
val equal : t -> t -> bool [@@infix ( = )]
end
[@@deriving typeclass, infix]
type 'a ty = 'a t
let poly (type a) (Proxy.T : a Proxy.t) : a t = { equal = Stdlib.( = ) }
module type S1 = sig
type 'a t
val equal : 'a ty -> 'a t -> 'a t -> bool
end
module type S2 = sig
type ('a, '... | |
d4dae3a17565389b5825fff5024c0e20b0e97344025f01264b52bd77b687f0c0 | janestreet/core_bench | display_column.ml | type t =
[ `Name
| `Speedup
| `Percentage
| `Samples
]
[@@deriving compare, sexp]
let equal = [%compare.equal: t]
| null | https://raw.githubusercontent.com/janestreet/core_bench/746d2440aa10795f1ef286df64be46e7d4ff768c/internals/display_column.ml | ocaml | type t =
[ `Name
| `Speedup
| `Percentage
| `Samples
]
[@@deriving compare, sexp]
let equal = [%compare.equal: t]
| |
34247098b0ab41ea688814500e6c5179269830d970a3a9da7ecc9e3334e82eb5 | PacktWorkshops/The-Clojure-Workshop | update_delete_data.clj | (ns packt-clj.exercises.update-delete-data
(:require
[clojure.java.jdbc :as jdbc]))
(defn update-agassi
[db]
(jdbc/update! db :app_user {:weight 78} ["first_name = 'Andre' and surname = 'Agassi'"]))
(defn delete-agassi
[db]
(jdbc/delete! db :app_user ["first_name = 'Andre' and surname = 'Agassi'"]))
(d... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter13/Exercise13.07/src/packt_clj/exercises/update_delete_data.clj | clojure | (ns packt-clj.exercises.update-delete-data
(:require
[clojure.java.jdbc :as jdbc]))
(defn update-agassi
[db]
(jdbc/update! db :app_user {:weight 78} ["first_name = 'Andre' and surname = 'Agassi'"]))
(defn delete-agassi
[db]
(jdbc/delete! db :app_user ["first_name = 'Andre' and surname = 'Agassi'"]))
(d... | |
1776189f8f239434f8651a40592040b800228ca5772f73314120d57574fffb4b | janestreet/universe | raised_exn.ml | open Core_kernel
open! Import
type t =
{ exn : exn
; backtrace : Backtrace.t
}
[@@deriving sexp_of]
let create exn = { exn; backtrace = Backtrace.Exn.most_recent () }
| null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/incremental/src/raised_exn.ml | ocaml | open Core_kernel
open! Import
type t =
{ exn : exn
; backtrace : Backtrace.t
}
[@@deriving sexp_of]
let create exn = { exn; backtrace = Backtrace.Exn.most_recent () }
| |
bc50ba31d353928e275414af17d1f0eafb5e9910b4d5500f3039e7c93f24dd55 | ocaml/opam | opamListCommand.mli | (**************************************************************************)
(* *)
Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam/3159618528d6240d0c146e94e8a8eb81e6b8df69/src/client/opamListCommand.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2019 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
open OpamParserTypes.FullPos
open OpamTypes
open OpamStateTypes
type dependency_toggles = {
... |
763d6769b9159f7b0783d4d52b31d34a53c4cf55597d69b7a963ef65d310fdd6 | pedestal/samples | server.clj | Copyright 2013 Relevance , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; which can be found in the file epl-v10.html at the root of this distribution.
;
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this licens... | null | https://raw.githubusercontent.com/pedestal/samples/caaf04afe255586f8f4e1235deeb0c1904179355/ring-middleware/src/ring_middleware/server.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright 2013 Relevance , Inc.
Eclipse Public License 1.0 ( )
(ns ring-middleware.server
(:require [ring-middleware.service :as service]
[io.pedestal.service.http :as bootstrap]))
(def service-instance
"Global var to hold service instance."
nil)
(defn create-server
"Standalone dev/prod mod... |
061da91d40af284e9f29d2df46a01690c74ef5d90cd36af4c48540b6d8781863 | rollacaster/sketches | own_force.cljs | (ns sketches.nature-of-code.forces.own-force
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]
[sketches.vector :as v]
[sketches.mover :as m]))
(defn compute-position [{:keys [acceleration velocity location] :as mover}]
(let [velocity (v/add acceleration ... | null | https://raw.githubusercontent.com/rollacaster/sketches/ba79fccf2a37139de9193ed2ea7a6cc04b63fad0/src/sketches/nature_of_code/forces/own_force.cljs | clojure | (ns sketches.nature-of-code.forces.own-force
(:require [quil.core :as q :include-macros true]
[quil.middleware :as md]
[sketches.vector :as v]
[sketches.mover :as m]))
(defn compute-position [{:keys [acceleration velocity location] :as mover}]
(let [velocity (v/add acceleration ... | |
7f580b9abe5eb2d80851bf9b5127e822af9d0c40f8e5d52b509bb8c7a1fea2c2 | cchalmers/circuit-notation | unittests.hs | {-# LANGUAGE Arrows #-}
-- This option is a test by itself: if we were to export a plugin with the
wrong type or name , GHC would refuse to compile this file .
{-# OPTIONS -fplugin=CircuitNotation #-}
module Main where
main :: IO ()
main = pure ()
| null | https://raw.githubusercontent.com/cchalmers/circuit-notation/d8f691faea696248c4621a6bd7b8cbef1687b0b7/tests/unittests.hs | haskell | # LANGUAGE Arrows #
This option is a test by itself: if we were to export a plugin with the
# OPTIONS -fplugin=CircuitNotation # |
wrong type or name , GHC would refuse to compile this file .
module Main where
main :: IO ()
main = pure ()
|
3db08080b160779f860d9538264a7ddb65ba3a484cf845bd95fe91ed55114ae6 | nuprl/gradual-typing-performance | cards.rkt | #lang racket
(require "cards/cards.rkt")
(provide (all-from-out "cards/cards.rkt"))
| null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/gofish/base/cards.rkt | racket | #lang racket
(require "cards/cards.rkt")
(provide (all-from-out "cards/cards.rkt"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.