_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 |
|---|---|---|---|---|---|---|---|---|
8d6879e070fc722e6a4a4ead2e09e1c1e0f8abd2575ea2b2f35a84f19b5fa0a8 | agda/agda | Class.hs |
module Agda.TypeChecking.Substitute.Class where
import Control.Arrow ((***), second)
import Agda.Syntax.Common
import Agda.Syntax.Internal
import Agda.TypeChecking.Free
import Agda.TypeChecking.Substitute.DeBruijn
import Agda.Utils.Empty
import Agda.Utils.List
import Agda.Utils.Impossible
----------------------... | null | https://raw.githubusercontent.com/agda/agda/e3bf58d8b2e95bc0481035756f44ddd9fe19b40d/src/full/Agda/TypeChecking/Substitute/Class.hs | haskell | -------------------------------------------------------------------------
* Application
-------------------------------------------------------------------------
| Apply something to a bunch of arguments.
Preserves blocking tags (application can never resolve blocking).
This default instance should be removed to ... |
module Agda.TypeChecking.Substitute.Class where
import Control.Arrow ((***), second)
import Agda.Syntax.Common
import Agda.Syntax.Internal
import Agda.TypeChecking.Free
import Agda.TypeChecking.Substitute.DeBruijn
import Agda.Utils.Empty
import Agda.Utils.List
import Agda.Utils.Impossible
class Apply t where
... |
1e171dbc92f3d27f1516c07b007b14d97457a5a4f501bfe496e876a2c360b8c5 | Bogdanp/racket-lua | relation.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse)
"adjust.rkt"
"error.rkt"
"string.rkt"
"table.rkt")
;; operators ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; #3.4.4
(provide
lua:==
lua:~=)
(define (lua:== a b)
(or (equal?... | null | https://raw.githubusercontent.com/Bogdanp/racket-lua/cc3371948238d92d9d13dff1702391b79aa57886/lua-lib/private/relation.rkt | racket | operators ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#3.4.4
procedures ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | #lang racket/base
(require (for-syntax racket/base
syntax/parse)
"adjust.rkt"
"error.rkt"
"string.rkt"
"table.rkt")
(provide
lua:==
lua:~=)
(define (lua:== a b)
(or (equal? a b)
(and (table? a)
(table? b)
(let ([lhs-eq (table-m... |
f9bf1ce1206d1819c6705c349d2eb52b0b4c8db707e7567458f9b046d616244b | adamwynne/twitter-api | streaming.clj | (ns twitter.api.streaming
(:require [twitter.api]
[twitter.callbacks :refer [get-default-callbacks]]
[twitter.core :refer [def-twitter-method]])
(:import (twitter.api ApiContext)))
(def ^:dynamic *streaming-api* (ApiContext. "https" "stream.twitter.com" "1.1"))
(defmacro def-twitter-stream... | null | https://raw.githubusercontent.com/adamwynne/twitter-api/6443d1c8ed7d6b6cc9f5efaa5fd9c7cc176e80f0/src/twitter/api/streaming.clj | clojure | (ns twitter.api.streaming
(:require [twitter.api]
[twitter.callbacks :refer [get-default-callbacks]]
[twitter.core :refer [def-twitter-method]])
(:import (twitter.api ApiContext)))
(def ^:dynamic *streaming-api* (ApiContext. "https" "stream.twitter.com" "1.1"))
(defmacro def-twitter-stream... | |
c0d16d286a52af83032d669423fac6dbeb809da2c380b3f19aea19fbf29f58c9 | ChrisPenner/proton | DoubleStar.hs | # LANGUAGE InstanceSigs #
module Data.Profunctor.DoubleStar where
import Data.Profunctor
import Data.Profunctor.Traversing
import Data.Profunctor.MStrong
import Data.Distributive
data DoubleStar f g a b = DoubleStar (f a -> g b)
instance (Functor f, Functor g) => Profunctor (DoubleStar f g) where
dimap l r (Double... | null | https://raw.githubusercontent.com/ChrisPenner/proton/4ce22d473ce5bece8322c841bd2cf7f18673d57d/src/Data/Profunctor/DoubleStar.hs | haskell | instance (Functor f, Applicative g) => Traversing (DoubleStar f g) where
traverse ' : : t = > p a b - > p ( t a ) ( t b )
traverse ' ( DoubleStar p ) = DoubleStar ( traverse m )
wander :: forall s t a b h. Applicative h =>( (a -> h b) -> s -> h t) -> DoubleStar f g a b -> DoubleStar f g s t
where
go ... | # LANGUAGE InstanceSigs #
module Data.Profunctor.DoubleStar where
import Data.Profunctor
import Data.Profunctor.Traversing
import Data.Profunctor.MStrong
import Data.Distributive
data DoubleStar f g a b = DoubleStar (f a -> g b)
instance (Functor f, Functor g) => Profunctor (DoubleStar f g) where
dimap l r (Double... |
d2a9a9860d1230e62a773e9c1c8fdb290c023cfd53e2f9f472fcf58d531fbb2f | lamdu/lamdu | OrderTags.hs | # LANGUAGE TypeApplications , FlexibleInstances , MultiParamTypeClasses , DefaultSignatures #
{-# LANGUAGE ScopedTypeVariables, UndecidableInstances #-}
module Lamdu.Sugar.OrderTags
( orderWorkArea, orderType
) where
import qualified Control.Lens as Lens
import Control.Monad ((>=>), zipWithM_)
impor... | null | https://raw.githubusercontent.com/lamdu/lamdu/5b15688e53ccbf7448ff11134b3e51ed082c6b6c/src/Lamdu/Sugar/OrderTags.hs | haskell | # LANGUAGE ScopedTypeVariables, UndecidableInstances #
Change sequence so that each item will be larger than previous.
TODO: smart algorithm that does minimal changes to sequence
Special case assignment and binder to invoke the special cases in expr
TODO: Sort fields! | # LANGUAGE TypeApplications , FlexibleInstances , MultiParamTypeClasses , DefaultSignatures #
module Lamdu.Sugar.OrderTags
( orderWorkArea, orderType
) where
import qualified Control.Lens as Lens
import Control.Monad ((>=>), zipWithM_)
import Control.Monad.Transaction (MonadTransaction(..)... |
495b1fdd5f1f7bf89c91bf4451f5bb95ec673a55a3def4c10b19137c5bcfde95 | Mayvenn/tocsin | clj_bugsnag.clj | ;; Originally copied from -bugsnag
(ns tocsin.clj-bugsnag
(:require [clj-stacktrace.core :refer [parse-exception]]
[clj-stacktrace.repl :refer [method-str]]
[clojure.java.shell :refer [sh]]
[clj-http.client :as http]
[environ.core :refer [env]]
[cheshire.cor... | null | https://raw.githubusercontent.com/Mayvenn/tocsin/a176e20a00858fa5f0cbb6310e07dc9ee1f18a68/src/tocsin/clj_bugsnag.clj | clojure | Originally copied from -bugsnag | (ns tocsin.clj-bugsnag
(:require [clj-stacktrace.core :refer [parse-exception]]
[clj-stacktrace.repl :refer [method-str]]
[clojure.java.shell :refer [sh]]
[clj-http.client :as http]
[environ.core :refer [env]]
[cheshire.core :as json]
[clojure.re... |
9d359a6fe33f651da361647bd91eb4de4612936ddfeb455c6da6440b3f2d2cc7 | kpblc2000/KpblcLispLib | _kpblc-conv-ver-to-real.lsp | (defun _kpblc-conv-ver-to-real (lst)
;|
* Ïðåîáðàçîâûâàåò ïåðåäàííóþ âåðñèþ â öåëîå ÷èñëî
* Ïàðàìåòðû âûçîâà:
lst âàðèàíòû:
ñòðîêà âèäà "Major.Minor.Assembly". Ïðîïóùåííûå ýëåìåíòû çàìåíÿþòñÿ íà 0.
ñïèñîê âèäà '(Major Minor Assembly). Ïðîïóùåííûå ýëåìåíòû çàìåíÿþòñÿ... | null | https://raw.githubusercontent.com/kpblc2000/KpblcLispLib/49d1d9d29078b4167cc65dc881bea61b706c620d/lsp/conv/ver/_kpblc-conv-ver-to-real.lsp | lisp | |
_ end of mapcar
_ end of apply
_ end of atof
_ end of defun
| (defun _kpblc-conv-ver-to-real (lst)
* Ïðåîáðàçîâûâàåò ïåðåäàííóþ âåðñèþ â öåëîå ÷èñëî
* Ïàðàìåòðû âûçîâà:
lst âàðèàíòû:
ñòðîêà âèäà "Major.Minor.Assembly". Ïðîïóùåííûå ýëåìåíòû çàìåíÿþòñÿ íà 0.
ñïèñîê âèäà '(Major Minor Assembly). Ïðîïóùåííûå ýëåìåíòû çàìåíÿþòñÿ íà 0.
ñïèñîê âèäà '(("major" ... |
7e091fab5b03559c5ba065927c6c72bf2860fb81d13bd7b55521fa9cecbd4b36 | rems-project/cerberus | type.ml | module type T = sig
type t
end | null | https://raw.githubusercontent.com/rems-project/cerberus/124c93f10cb4c235f6396adec82ebf9563daeb7e/backend/rustic/src/type.ml | ocaml | module type T = sig
type t
end | |
8920ebb1eb8f5c90b53c1ecd2864852f405eb7b90a0a969c53165b9098259a6a | vernemq/vernemq | vmq_cluster_test_utils.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 Helium Systems , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain... | null | https://raw.githubusercontent.com/vernemq/vernemq/c144d0a69d156c4079d96222aca2f7ad81f0d721/apps/vmq_server/test/vmq_cluster_test_utils.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 Helium Systems , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(vmq... |
b05591ff6c1720e977169daccafd0907e15f97d6df55a20141bcedcfabc1c0a0 | elastic/eui-cljs | eui_page_inner_styles.cljs | (ns eui.eui-page-inner-styles
(:require ["@elastic/eui/lib/components/page_template/inner/page_inner.styles.js" :as eui]))
(def euiPageInnerStyles eui/euiPageInnerStyles)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/eui_page_inner_styles.cljs | clojure | (ns eui.eui-page-inner-styles
(:require ["@elastic/eui/lib/components/page_template/inner/page_inner.styles.js" :as eui]))
(def euiPageInnerStyles eui/euiPageInnerStyles)
| |
d751c72a4657e0f698133e51544b1802131cb04b998e7f8819c9a968d274771d | imrehg/ypsilon | add.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gdk add)
(export gdk_add_client_message_filter
gdk_add_option_entries_libgtk_only)
(import (rnrs) (ypsilon ffi))
(define l... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gdk/add.scm | scheme | void gdk_add_option_entries_libgtk_only (GOptionGroup* group)
[end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gdk add)
(export gdk_add_client_message_filter
gdk_add_option_entries_libgtk_only)
(import (rnrs) (ypsilon ffi))
(define l... |
003ced0fd90feaa6690e451c055890d9e8a99d130079bd0ae9f1b28e28baa912 | i-am-tom/learn-me-a-haskell | Utils.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DataKinds #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
# LANGUAGE Undecidab... | null | https://raw.githubusercontent.com/i-am-tom/learn-me-a-haskell/08271f6cdd4fc88c26ed7a62ed1e786a900824be/src/Utils.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
inspected, so it must be an operation on the "container" structure.
| Produce a constraint that is built from a type-level list of things
applied to a constraint constructor.
... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Utils
( All
, Between
, CmpType
, Every
, If
, Length
, Lookup
, TypeName
, type (~>)
, type (&&)
, type (||)
... |
f69600790c66c66a37e88ada7714db8558d50323e12a04e3e12e717133d418e5 | Helium4Haskell/Top | Types.hs | -----------------------------------------------------------------------------
-- | License : GPL
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- A collection of type utilities.
--
-----------------------------------------------------------------------------
module T... | null | https://raw.githubusercontent.com/Helium4Haskell/Top/5e900184d6b2ab6d7ce69945287d782252e5ea68/src/Top/Types.hs | haskell | ---------------------------------------------------------------------------
| License : GPL
Maintainer :
Stability : provisional
Portability : portable
A collection of type utilities.
--------------------------------------------------------------------------- |
module Top.Types (module Export) where
import Top.Types.Primitive as Export
import Top.Types.Substitution as Export
import Top.Types.Quantification as Export
import Top.Types.Qualification as Export
import Top.Types.Synonym as Export
import Top.Types.Unification as Export
import Top.Types.Classes ... |
8d3c73c1be08707dc2ff7c23c9c8542584fcff607ee193675dc2695ba5915394 | Ramarren/cffi-stfl | bindings.lisp | (in-package :cffi-stfl)
(define-foreign-library stfl (:unix "./libstfl.so"))
(use-foreign-library stfl)
(defparameter *ipool* nil)
(defctype stfl-form :pointer "STFL form handler")
(defctype stfl-string :pointer)
(defcfun (%create "stfl_create") stfl-form (text stfl-string))
(defcfun (%free "stfl_free") :void (for... | null | https://raw.githubusercontent.com/Ramarren/cffi-stfl/50219f5a033481e1cb2ad4cba6459023eb6a9885/bindings.lisp | lisp | ipool | (in-package :cffi-stfl)
(define-foreign-library stfl (:unix "./libstfl.so"))
(use-foreign-library stfl)
(defparameter *ipool* nil)
(defctype stfl-form :pointer "STFL form handler")
(defctype stfl-string :pointer)
(defcfun (%create "stfl_create") stfl-form (text stfl-string))
(defcfun (%free "stfl_free") :void (for... |
ecc8970ce5dc63d71d72b5c1fe7ed3efe24518925a288d73c14ae44fbe3e6842 | yellowtides/owenbot-hs | TTS.hs | {-# LANGUAGE OverloadedStrings #-}
module TTS (commands) where
import Control.Exception (handle)
import Control.Monad (void)
import qualified Data.ByteString as B
import qualified Data.ByteString.Base64 as B64
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BL
import qualified Dat... | null | https://raw.githubusercontent.com/yellowtides/owenbot-hs/9aaf66cc09b038c8c45b462ed93b77edbe0e5622/src/listeners/TTS.hs | haskell | # LANGUAGE OverloadedStrings #
we are guaranteed input is non-empty by the parser + head/last are O(1)
Response contains the base64 encoded audio data, wrapped in
quotes. So we take strip those off using init and tail, which each
and then filter out the newline characters. | module TTS (commands) where
import Control.Exception (handle)
import Control.Monad (void)
import qualified Data.ByteString as B
import qualified Data.ByteString.Base64 as B64
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy as BL
import qualified Data.HashMap.Strict as HM
import quali... |
01c69e8f5bbe49fab069709624bd3b13ede4a126fc25beebc47f530e804d7bb1 | sulami/spielwiese | 010-summation-of-primes.hs | -- Summation of primes
Problem 10
--
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17 .
--
Find the sum of all the primes below two million .
{-# OPTIONS_GHC -O2 #-}
isPrime :: Integer -> Bool
isPrime n = [] == [x | x <- [2..(n `div` 2)], n `mod` x == 0]
main = print $ sum $ [x | x <- [2..2000000], isPrime... | null | https://raw.githubusercontent.com/sulami/spielwiese/da354aa112d43d7ec5f258f4b5afafd7a88c8aa8/hEuler/010-summation-of-primes.hs | haskell | Summation of primes
# OPTIONS_GHC -O2 # | Problem 10
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17 .
Find the sum of all the primes below two million .
isPrime :: Integer -> Bool
isPrime n = [] == [x | x <- [2..(n `div` 2)], n `mod` x == 0]
main = print $ sum $ [x | x <- [2..2000000], isPrime x]
|
1f6b02783af871dc6b3dbebe689bdcfbd1fdbeb29e563e883b812a96e2f6efc0 | ghcjs/jsaddle | Internal.hs | -----------------------------------------------------------------------------
--
-- Module : Language.Javascript.JSaddle.Value
Copyright : ( c )
License : MIT
--
Maintainer : < >
--
-- |
--
-----------------------------------------------------------------------------
module GHCJS.Foreig... | null | https://raw.githubusercontent.com/ghcjs/jsaddle/97273656e28790ab6e35c827f8086cf47bfbedca/jsaddle/src-ghc/GHCJS/Foreign/Internal.hs | haskell | ---------------------------------------------------------------------------
Module : Language.Javascript.JSaddle.Value
|
---------------------------------------------------------------------------
, fromJSBool
# NOINLINE toJSBool #
^ implementation dependent | Copyright : ( c )
License : MIT
Maintainer : < >
module GHCJS.Foreign.Internal (
jsTrue
, jsFalse
, jsNull
, toJSBool
, jsUndefined
, isTruthy
, isNull
, isUndefined
, JSType(..)
) where
import Language.Javascript.JSaddle.Types (JSVal(..), GHCJSPure(..))
import Language.J... |
e141753e4ff943b368ed5c0c9075ab18a3fd23d9b8fa305741db7955d2a1480a | igrep/typesafe-precure | Words.hs | # OPTIONS_GHC -fno - warn - missing - signatures #
module ACME.PreCure.Textbook.MahoGirls.Words where
groupName_MahoGirls = "魔法つかいプリキュア!"
girlName_Mirai = "朝日奈 みらい"
girlName_Liko = "十六夜 リコ"
girlName_Kotoha = "花海 ことは"
cureName_Miracle = "キュアミラクル"
cureName_Magical = "キュアマジカル"
cureName_Felice = "キュアフェリーチェ"
cureN... | null | https://raw.githubusercontent.com/igrep/typesafe-precure/fc94f5f2c0ca8d8acc0b8eabe890a85bc305d7b3/src/ACME/PreCure/Textbook/MahoGirls/Words.hs | haskell |
TODO: Check the movie again
-hCU8
-Os
| # OPTIONS_GHC -fno - warn - missing - signatures #
module ACME.PreCure.Textbook.MahoGirls.Words where
groupName_MahoGirls = "魔法つかいプリキュア!"
girlName_Mirai = "朝日奈 みらい"
girlName_Liko = "十六夜 リコ"
girlName_Kotoha = "花海 ことは"
cureName_Miracle = "キュアミラクル"
cureName_Magical = "キュアマジカル"
cureName_Felice = "キュアフェリーチェ"
cureN... |
9a5cc17f806c27836c184750d8cec5507375fd934283a18fdb596906cb9fff4a | ChrisPenner/comonads-by-example | App.hs | {-# LANGUAGE OverloadedStrings #-}
module UIPairing.App where
import Brick
import Graphics.Vty.Attributes as V
import Graphics.Vty as V
import Control.Monad
import UI.View
import Control.Comonad
type Event = ()
type ResourceName = String
app :: A... | null | https://raw.githubusercontent.com/ChrisPenner/comonads-by-example/1d7626f759e59ac8019322612ed6d7ff00da75c9/drafts/UIPairing/App.hs | haskell | # LANGUAGE OverloadedStrings # | module UIPairing.App where
import Brick
import Graphics.Vty.Attributes as V
import Graphics.Vty as V
import Control.Monad
import UI.View
import Control.Comonad
type Event = ()
type ResourceName = String
app :: App AppState () ResourceName
app =
... |
cde812fcd3f1098f997b997e03b896a3d97a4e45c9ed3ca2d0e317fd2f778bc1 | Opetushallitus/ataru | subs.cljs | (ns ataru.virkailija.application.hyvaksynnan-ehto.subs
(:require [re-frame.core :as re-frame]
[ataru.util :as util]
[ataru.virkailija.application.hyvaksynnan-ehto.hyvaksynnan-ehto-xforms :as hx]
clojure.set
clojure.string))
(defn- hyvaksynnan-ehto-has-request-in-flight... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/987b4b42446a06a5147328a09a0344b2656cc2e8/src/cljs/ataru/virkailija/application/hyvaksynnan_ehto/subs.cljs | clojure | (ns ataru.virkailija.application.hyvaksynnan-ehto.subs
(:require [re-frame.core :as re-frame]
[ataru.util :as util]
[ataru.virkailija.application.hyvaksynnan-ehto.hyvaksynnan-ehto-xforms :as hx]
clojure.set
clojure.string))
(defn- hyvaksynnan-ehto-has-request-in-flight... | |
7fae932def05194dfa66eee90bae8c2f2afaefe14d91fce2ad8069abd8cd859b | finnishtransportagency/harja | kanavien_liikennetapahtumat.clj | (ns harja.palvelin.raportointi.raportit.kanavien-liikennetapahtumat
(:require [jeesql.core :refer [defqueries]]
[taoensso.timbre :as log]
[harja.palvelin.raportointi.raportit.yleinen :refer [raportin-otsikko]]
[harja.kyselyt.urakat :as urakat-q]))
(defn suorita [db user {:keys [u... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/750cac0acbe103c31a6f9f00fc3dd0c6b078df06/src/clj/harja/palvelin/raportointi/raportit/kanavien_liikennetapahtumat.clj | clojure | (ns harja.palvelin.raportointi.raportit.kanavien-liikennetapahtumat
(:require [jeesql.core :refer [defqueries]]
[taoensso.timbre :as log]
[harja.palvelin.raportointi.raportit.yleinen :refer [raportin-otsikko]]
[harja.kyselyt.urakat :as urakat-q]))
(defn suorita [db user {:keys [u... | |
5639eaac4b73bb3124761d425947e266807e462ca2d610b09d7991a3ad3002dd | circleci/circleci.test | cloverage.clj | (ns circleci.test.cloverage
"Support for Cloverage test coverage tool."
(:require [cloverage.coverage :as cov]
[circleci.test :as test]))
;; This is a copy of the clojure.test runner which ships with cloverage
but with clojure.test swapped out with circleci.test 's run - tests .
(defmethod cov/runner... | null | https://raw.githubusercontent.com/circleci/circleci.test/eb2e44fe94e430648c852f7f736419dc70a4e5a1/src/circleci/test/cloverage.clj | clojure | This is a copy of the clojure.test runner which ships with cloverage | (ns circleci.test.cloverage
"Support for Cloverage test coverage tool."
(:require [cloverage.coverage :as cov]
[circleci.test :as test]))
but with clojure.test swapped out with circleci.test 's run - tests .
(defmethod cov/runner-fn :circleci.test [{}]
(fn [nses]
(apply require (map symbol nses... |
c07006533722d0e79b08194741a15f47db3a4beb23f8f8552d3d221393ae77bb | chaoxu/mgccl-haskell | long.hs | import System.IO
import Data.Graph.Wrapper
import Data.List
main :: IO ()
main = loop []
loop xs = do end <- isEOF
if end
then print $ result xs
else do c <- getLine
loop (c:xs)
where result xs = foldl1' connect $ topologicalSort
... | null | https://raw.githubusercontent.com/chaoxu/mgccl-haskell/bb03e39ae43f410bd2a673ac2b438929ab8ef7a1/rosalind/long.hs | haskell | import System.IO
import Data.Graph.Wrapper
import Data.List
main :: IO ()
main = loop []
loop xs = do end <- isEOF
if end
then print $ result xs
else do c <- getLine
loop (c:xs)
where result xs = foldl1' connect $ topologicalSort
... | |
b20984eb47ba2cb2b1ab007279178cbc64a9eafecba3c830765a4733643ec7c9 | naoiwata/sicp | 2.2.1.scm | ;;
;; @author naoiwata
SICP Chapter2
;; 2.2.1 Representing Sequences
;;
(define one-four
(list 1 2 3 4))
(print one-four) ; (1 2 3 4)
1
(print (cdr one-four)) ; (2 3 4)
( 10 1 2 3 4 )
; List operations
(define (list-ref items n)
(if (= n 0)
(car items)
(list-ref (cdr items) (- n 1))))
(define squares ... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/pages/2.2.1.scm | scheme |
@author naoiwata
2.2.1 Representing Sequences
(1 2 3 4)
(2 3 4)
List operations
(1 4 9 16 25 1 3 5 7)
(1 3 5 7 1 4 9 16 25)
(1 3 5 7)
(1 3 5 7 ())
(1 4 9 16 25 1 3 5 7)
END | SICP Chapter2
(define one-four
(list 1 2 3 4))
1
( 10 1 2 3 4 )
(define (list-ref items n)
(if (= n 0)
(car items)
(list-ref (cdr items) (- n 1))))
(define squares (list 1 4 9 16 25))
16
(define (length items)
(if (null? items)
0
(+ 1 (length (cdr items)))))
(define odds (list 1 3 5 7))
(def... |
70c4ef844f2a442f4c4dd4abf0ae2bb5584892ccaad29c249a77f069c138bca7 | ploeh/advent-of-code-2017 | Solution.hs | module Day01 where
import Data.Char (digitToInt)
digitize :: Functor f => f Char -> f Int
digitize = fmap digitToInt
prep1 :: [b] -> [(b, b)]
prep1 (x:xs) = zip (x:xs) (xs ++ [x])
prep1 [] = []
prep2 :: [b] -> [(b, b)]
prep2 xs =
let xs' = xs ++ xs
l = length xs
fwd = div l 2
in zip xs (take l $ d... | null | https://raw.githubusercontent.com/ploeh/advent-of-code-2017/e0f66bf2735cf1e37fbcf001296fdda8df3ece8c/Day01/Solution.hs | haskell | module Day01 where
import Data.Char (digitToInt)
digitize :: Functor f => f Char -> f Int
digitize = fmap digitToInt
prep1 :: [b] -> [(b, b)]
prep1 (x:xs) = zip (x:xs) (xs ++ [x])
prep1 [] = []
prep2 :: [b] -> [(b, b)]
prep2 xs =
let xs' = xs ++ xs
l = length xs
fwd = div l 2
in zip xs (take l $ d... | |
b18784f8e385b4a621f3e0c1a174c8d0bc14ca064849ed264001ef4d3c13a9b8 | zliu41/min-max-pqueue | Main.hs | module Main where
import qualified Criterion.Main as Criterion
import Data.List (sort, sortBy, unfoldr)
import System.Random
import qualified Data.IntMinMaxQueue as IPQ
import qualified Data.MinMaxQueue as PQ
import qualified SeqQueue as SQ
bench :: [Criterion.Benchmark]
bench =
[ Criterion.ben... | null | https://raw.githubusercontent.com/zliu41/min-max-pqueue/62fefaf495334a3238787980eb1e463b3bfb8be2/benchmark/Main.hs | haskell | module Main where
import qualified Criterion.Main as Criterion
import Data.List (sort, sortBy, unfoldr)
import System.Random
import qualified Data.IntMinMaxQueue as IPQ
import qualified Data.MinMaxQueue as PQ
import qualified SeqQueue as SQ
bench :: [Criterion.Benchmark]
bench =
[ Criterion.ben... | |
344a8f989cb8da1ed15d1d6a717428a2e8df0f90bc194655aaf7ba03efe2a9d6 | samuelrivas/moka | mok_system_functions.erl | Copyright ( c ) 2012 , < >
%%% 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/samuelrivas/moka/92521e43d1d685794f462ed49403c99baeae0226/test/acceptance/mok_system_functions.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.
* Redistr... | Copyright ( c ) 2012 , < >
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTI... |
4a4686489926923b25b94adf55a67d32010ba3e8ac9232d5a6be231a6cbf2349 | jumarko/clojure-experiments | dice.clj | # 🎲
(ns dice
(:require [clojure.java.shell :as shell]
[nextjournal.clerk :as clerk]))
My kids have [ this game]( / produkte / spiele / mitbringspiele / nanu-23063 / index.html ) and we lost the dice that comes with it . It ca n't be too hard to make on in Clojure , can it ? The dice has five color... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/a87098fe69044ad65813a68cb870d824c2c2d18f/src/clojure_experiments/visualizations/clerk/notebooks/dice.clj | clojure | Here, we define a viewer using hiccup that will the dice as well as a button. Note that this button has an `:on-click` event handler that uses `v/clerk-eval` to tell Clerk to evaluate the argument, in this cases `(roll!)` when clicked.
Our roll! function `resets!` our `dice` with a random side and prints and says the... | # 🎲
(ns dice
(:require [clojure.java.shell :as shell]
[nextjournal.clerk :as clerk]))
My kids have [ this game]( / produkte / spiele / mitbringspiele / nanu-23063 / index.html ) and we lost the dice that comes with it . It ca n't be too hard to make on in Clojure , can it ? The dice has five color... |
6ecf353890db7bec75791231174255158813ad2df5d5ae8d456d1cdf94a412c8 | BinaryAnalysisPlatform/bap | thumb_main.ml | let package = "bap"
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open KB.Syntax
include Bap_main.Loggers()
open Thumb_opcodes
open Thumb_core
module MC = Bap.Std.Disasm_expert.Basic
module Target = Arm_target
type insns = opcode * Op.t array
let string_of_opcode x = Sexp.to_string (sexp_of_o... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/cbdf732d46c8e38df79d9942fc49bcb97915c657/plugins/thumb/thumb_main.ml | ocaml | these are not entirely complete | let package = "bap"
open Core_kernel[@@warning "-D"]
open Bap_core_theory
open Bap.Std
open KB.Syntax
include Bap_main.Loggers()
open Thumb_opcodes
open Thumb_core
module MC = Bap.Std.Disasm_expert.Basic
module Target = Arm_target
type insns = opcode * Op.t array
let string_of_opcode x = Sexp.to_string (sexp_of_o... |
b06dfa30d063573d373e53e7a61405bf3e9e78f08f241acb0b62f8edf3d5eccd | LeventErkok/sbv | ProofTests.hs | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.Basics.ProofTests
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Test suite for Examples.Basics.ProofTests
------------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/0d791d9f4d1de6bd915b6d7d3f9a550385cb27a5/SBVTestSuite/TestSuite/Basics/ProofTests.hs | haskell | ---------------------------------------------------------------------------
|
Module : TestSuite.Basics.ProofTests
License : BSD3
Maintainer:
Stability : experimental
Test suite for Examples.Basics.ProofTests
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -W... | Copyright : ( c )
module TestSuite.Basics.ProofTests(tests) where
import Utils.SBVTestFramework
tests :: TestTree
tests =
testGroup "Basics.Proof"
[ testCase "proofs-1" (assertIsThm f1eqf2)
, testCase "proofs-2" (assertIsntThm f1eqf3)
, testCase "proofs-3" (assertIsThm f3eqf4)
, testCase "pro... |
7613562d69cf2f06c36e8cf226dbad4551af43d907b41b747ae42a4c418c8388 | data61/Mirza | PopulateUtils.hs | {-# LANGUAGE DeriveGeneric #-}
# LANGUAGE TypeApplications #
module Mirza.SupplyChain.PopulateUtils where
import GHC.Generics (Generic)
import Mirza.Common.Utils
import Control.Monad.Except
import Control.Monad.Identity
import Data.Foldable ... | null | https://raw.githubusercontent.com/data61/Mirza/24e5ccddfc307cceebcc5ce26d35e91020b8ee10/projects/or_scs/src/Mirza/SupplyChain/PopulateUtils.hs | haskell | # LANGUAGE DeriveGeneric #
=============================================================================
=============================================================================
=============================================================================
====================================================... | # LANGUAGE TypeApplications #
module Mirza.SupplyChain.PopulateUtils where
import GHC.Generics (Generic)
import Mirza.Common.Utils
import Control.Monad.Except
import Control.Monad.Identity
import Data.Foldable (traverse_)
imp... |
9bea11d5d702296d370516fdabf2a6812048137dbf7f05b3b35f2395702294bc | chrislloyd/kepler | entity_test.clj | (ns kepler.entity-test
(:require [clojure.test :refer :all]
[kepler.entity :refer :all]))
(deftest new-entity-test
(is (= (type (new-entity))
java.lang.String))
(is (not (= (new-entity) (new-entity)))))
| null | https://raw.githubusercontent.com/chrislloyd/kepler/bd6f30c20ff9e5ad6749bab0d3589d9ccce6f14f/test/kepler/entity_test.clj | clojure | (ns kepler.entity-test
(:require [clojure.test :refer :all]
[kepler.entity :refer :all]))
(deftest new-entity-test
(is (= (type (new-entity))
java.lang.String))
(is (not (= (new-entity) (new-entity)))))
| |
469bef11ab77facdbd75576be8c4b3ea8d37340350c17b7ced8953788e438332 | facebook/flow | abnormal.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/69dfb697d2939cc32d841f20279c1585a4cb7c62/src/typing/abnormal.ml | ocaml | we model abnormal control flows using exceptions during traversal
control directives encountered during traversal
called from traversal. abnormal indicates control flow directive encountered
if argument is Some abnormal, throw it
If we catch an Expr payload, then it was generated by seeing an invariant() call
... |
* 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... |
85808bdc7dad960bb478f576ec8065e84c28567bb99b56a1923ae9e8697a636c | tarides/opam-monorepo | opam.ml | open Import
let depends_on_any packages (formula : OpamTypes.filtered_formula) =
let packages = List.map ~f:OpamPackage.Name.of_string packages in
let is_one_of_packages name =
List.exists packages ~f:(fun p -> OpamPackage.Name.compare p name = 0)
in
OpamFormula.fold_left
(fun acc (name, _) -> acc || i... | null | https://raw.githubusercontent.com/tarides/opam-monorepo/5ee35996fa796c36bf1754917232ce9040e91fe0/lib/opam.ml | ocaml | ocaml-options-vanilla is purposefully excluded from that list as it doesn't imply
a dependency towards ocaml-variants on its own. | open Import
let depends_on_any packages (formula : OpamTypes.filtered_formula) =
let packages = List.map ~f:OpamPackage.Name.of_string packages in
let is_one_of_packages name =
List.exists packages ~f:(fun p -> OpamPackage.Name.compare p name = 0)
in
OpamFormula.fold_left
(fun acc (name, _) -> acc || i... |
4e390dfa29481a079cc18f2c483df5b438220f01e19c6cd72aa40003652691f4 | thosmos/riverdb | person.cljs | (ns riverdb.ui.person
(:require
[clojure.string :as str]
[clojure.data]
[com.fulcrologic.fulcro.algorithms.form-state :as fs]
[com.fulcrologic.fulcro.algorithms.merge :as merge]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
... | null | https://raw.githubusercontent.com/thosmos/riverdb/c0a31710e4430113924178bd0a3b9e8304f58009/src/main/riverdb/ui/person.cljs | clojure | :dimmer false}
(div :.field
(dom/label {} "Staff?")
(ui-checkbox {:checked (or IsStaff false) :onChange #(fm/toggle! this :person/IsStaff)})))
(fn [{:keys [orig field-k]}]
(let [field-val (get props field-k)
new-val (if (vector? field-val)
nil)]
(debug "CANCEL! NEW VAL" new-val)
... | (ns riverdb.ui.person
(:require
[clojure.string :as str]
[clojure.data]
[com.fulcrologic.fulcro.algorithms.form-state :as fs]
[com.fulcrologic.fulcro.algorithms.merge :as merge]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
... |
c84128c34aee7640b82f2fce2923265c02aa3f87aab21195833f539cd4036bb4 | hasufell/abstract-filepath | Posix.hs | # LANGUAGE CPP #
#define FILEPATH_NAME PosixFilePath
#define OSSTRING_NAME PosixString
#define WORD_NAME PosixChar
#define CTOR PS
#define WTOR PW
#define IS_WINDOWS False
#define POSIX
#undef WINDOWS
module AFP.AbstractFilePath.Posix
(
-- * Types
PosixString
, PosixChar... | null | https://raw.githubusercontent.com/hasufell/abstract-filepath/61fb550abd78805c5ddea232fab8e5e065410b29/abstract-filepath/lib/AFP/AbstractFilePath/Posix.hs | haskell | * Types
* String construction
* String deconstruction
* Word construction
* Word deconstruction
* Separator predicates
* $PATH methods
* Extension functions
* Filename\/directory functions
* Drive functions
* Trailing slash functions
* File name manipulations
* posix specific functions
$setup
>>> :set -X... | # LANGUAGE CPP #
#define FILEPATH_NAME PosixFilePath
#define OSSTRING_NAME PosixString
#define WORD_NAME PosixChar
#define CTOR PS
#define WTOR PW
#define IS_WINDOWS False
#define POSIX
#undef WINDOWS
module AFP.AbstractFilePath.Posix
(
PosixString
, PosixChar
, PosixFil... |
0a7a417a77a82178115e45d266aa639f2f68e395f1cb320037d32d2ecd1e7818 | ndmitchell/rattle | Hash.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Development.Rattle.Hash(
Hash(..), hashLength,
hashFile, hashString, hashByteString, hashHash, hashHex,
hashFileForward, toHashForward, fromHashForward,
hashFileForwardIfStale, hashFileIfStale
) where
import System.IO
import Data.Hashable
import quali... | null | https://raw.githubusercontent.com/ndmitchell/rattle/f1f10504ef175dd005c8affdddfc1fb615c040f2/src/Development/Rattle/Hash.hs | haskell | | Show a hash as hex characters
Hashing lots of files is expensive, so we keep a cache
| If there is a forwarding hash, and this file exists, use the forwarding hash instead
we can get a ModTime on a directory, but can't withFile it | # LANGUAGE GeneralizedNewtypeDeriving #
module Development.Rattle.Hash(
Hash(..), hashLength,
hashFile, hashString, hashByteString, hashHash, hashHex,
hashFileForward, toHashForward, fromHashForward,
hashFileForwardIfStale, hashFileIfStale
) where
import System.IO
import Data.Hashable
import quali... |
259d10e8fb1aa532ed3ddf4694966bf56fd22bd935fb86b2dc1a92451ad647dd | toddaaro/advanced-dan | fd.scm | (library
(fd)
(export
infd domfd =fd =/=fd <=fd <fd
plusfd distinctfd range)
(import (rnrs) (ck))
;;; helpers
(define range
(lambda (lb ub)
(cond
((< lb ub) (cons lb (range (+ lb 1) ub)))
(else (cons lb '())))))
(define-syntax lambdamfd@
(syntax-rules ()
((_ (a) e) (lambdam@ (a)... | null | https://raw.githubusercontent.com/toddaaro/advanced-dan/5d6c0762d998aa37774e0414a0f37404e804b536/valo/fd.scm | scheme | helpers
domains (sorted lists of integers)
n* should be a non-empty sorted (small to large) list
of value-doms?, with no duplicates.
procedures below this point cannot
expose the representations of doms!
(define get-dom
(lambda (x c)
(cond
((find (lambda (oc) (and (eq? (oc->rator oc) 'domfd-c)
... | (library
(fd)
(export
infd domfd =fd =/=fd <=fd <fd
plusfd distinctfd range)
(import (rnrs) (ck))
(define range
(lambda (lb ub)
(cond
((< lb ub) (cons lb (range (+ lb 1) ub)))
(else (cons lb '())))))
(define-syntax lambdamfd@
(syntax-rules ()
((_ (a) e) (lambdam@ (a) e))
((_... |
1a4ac38e207fe65f871fae641c1a3d53c1af906305f81b36f052200d20c68e61 | maxcountryman/quanta | message.clj | (ns quanta.message
"Message abstractions."
(:require [clojure.tools.logging :as log]
[cognitect.transit :as transit]
[quanta.udp :as udp]
[quanta.util :as util])
(:refer-clojure :exclude [send])
(:import [java.io ByteArrayInputStream ByteArrayOutputSt... | null | https://raw.githubusercontent.com/maxcountryman/quanta/9a1cd9b5b0d2b1706db9c5184fd653f26162cb23/src/quanta/message.clj | clojure | (ns quanta.message
"Message abstractions."
(:require [clojure.tools.logging :as log]
[cognitect.transit :as transit]
[quanta.udp :as udp]
[quanta.util :as util])
(:refer-clojure :exclude [send])
(:import [java.io ByteArrayInputStream ByteArrayOutputSt... | |
a89f167e13db9fc320e1226d3f0a52a1b3f4eaa6a6e41bb2074caa5b442172a0 | ndmitchell/ghcid | Ghcid.hs | # LANGUAGE RecordWildCards #
-- | Library for spawning and working with Ghci sessions.
module Language.Haskell.Ghcid(
Ghci, GhciError(..), Stream(..),
Load(..), Severity(..),
startGhci, startGhciProcess, stopGhci, interrupt, process,
execStream, showModules, showPaths, reload, exec, quit
) where
i... | null | https://raw.githubusercontent.com/ndmitchell/ghcid/abbb157ac9d06fdfba537f97ab96e197b3bb36cb/src/Language/Haskell/Ghcid.hs | haskell | | Library for spawning and working with Ghci sessions.
| A GHCi session. Created with 'startGhci', closed with 'stopGhci'.
The interactions with a 'Ghci' session must all occur single-threaded,
or an error will be raised. The only exception is 'interrupt', which aborts
a running computation, or does nothing... | # LANGUAGE RecordWildCards #
module Language.Haskell.Ghcid(
Ghci, GhciError(..), Stream(..),
Load(..), Severity(..),
startGhci, startGhciProcess, stopGhci, interrupt, process,
execStream, showModules, showPaths, reload, exec, quit
) where
import System.IO
import System.IO.Error
import System.Proce... |
6f4c5e7173d6fe26657904ef3143c44a51b4e713fb093a80ada32550e24952fd | haskell/cabal | Lens.hs | module Distribution.Types.TestSuite.Lens (
TestSuite,
module Distribution.Types.TestSuite.Lens,
) where
import Distribution.Compat.Lens
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Types.BuildInfo (BuildInfo)
import Distribution.Types.TestSuite (TestSuite)
i... | null | https://raw.githubusercontent.com/haskell/cabal/0abbe37187f708e0a5daac8d388167f72ca0db7e/Cabal-syntax/src/Distribution/Types/TestSuite/Lens.hs | haskell | # INLINE testName # | module Distribution.Types.TestSuite.Lens (
TestSuite,
module Distribution.Types.TestSuite.Lens,
) where
import Distribution.Compat.Lens
import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Types.BuildInfo (BuildInfo)
import Distribution.Types.TestSuite (TestSuite)
i... |
e4b243362efa8c3eabba080da1ff7fb5f05a943dd75fe4c266d82a47c2d66b78 | patricoferris/ocaml-multicore-monorepo | app.ml | let () =
Eio_main.run @@ fun env ->
Dream.run ~interface:"0.0.0.0" ~port:(int_of_string (Sys.getenv "PORT")) env
@@ Dream.logger
@@ Dream.router [
Dream.get "/" (fun _ -> Dream.html "Dream running in Heroku!");
]
@@ Dream.not_found
| null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/example/z-heroku/app.ml | ocaml | let () =
Eio_main.run @@ fun env ->
Dream.run ~interface:"0.0.0.0" ~port:(int_of_string (Sys.getenv "PORT")) env
@@ Dream.logger
@@ Dream.router [
Dream.get "/" (fun _ -> Dream.html "Dream running in Heroku!");
]
@@ Dream.not_found
| |
0c3b91090d7ecca8fb0ff0cc1eeca40b2db3c7314c7ec5b71a5b96e24b6c936b | rizo/snowflake-os | extList.ml |
* ExtList - additional and modified functions for lists .
* Copyright ( C ) 2003
* Copyright ( C ) 2003
*
* This library 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 ;... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/extlib/extList.ml | ocaml |
* ExtList - additional and modified functions for lists .
* Copyright ( C ) 2003
* Copyright ( C ) 2003
*
* This library 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 ;... | |
58ff57a36c7a59b2553c9f727b25d1b2937bbda1f458bcb51b32533e95df2db8 | travelping/ergw | ergw_core_config.erl | Copyright 2016 , Travelping GmbH < >
%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(ergw_core_config... | null | https://raw.githubusercontent.com/travelping/ergw/b577328c8bbdc4959b45c321338971ed242bb822/apps/ergw_core/src/ergw_core_config.erl | erlang | This program is free software; you can redistribute it and/or
API
===================================================================
API
===================================================================
===================================================================
Get Functions
Get/Put Functions
=========... | Copyright 2016 , Travelping GmbH < >
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version
2 of the License , or ( at your option ) any later version .
-module(ergw_core_config).
-compile({parse_transform, cut}).
-export([validate_options/... |
1aa84407335ba6c7eb1abd57a007e79f922cb1471990b812a1077c54e7e16b25 | atdixon/me.untethr.nostr-desk | timeline_support.clj | (ns me.untethr.nostr.timeline-support
(:require
[clojure.tools.logging :as log]
[me.untethr.nostr.domain :as domain]
[loom.graph :as loom]
[loom.attr :as loom-attr])
(:import
(me.untethr.nostr.domain UITextNote UITextNoteWrapper)))
(defn- create-node->num-predecessors
[graph]
(reduce (fn [acc n]... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-desk/6cb2f2ae1704ce04fe8481cb3b3895a978332e52/src/me/untethr/nostr/timeline_support.clj | clojure | expect parent-ids to be in order and we'll create edges for [:a :b :c]
like so :c -> :b -> :a
shed all edges to root for nodes deeper than one
:loom-graph (or the :loom-graph should be empty) and we expect the
:loom-graph to be connected; this implies that our contributions here
will also leave the gra... | (ns me.untethr.nostr.timeline-support
(:require
[clojure.tools.logging :as log]
[me.untethr.nostr.domain :as domain]
[loom.graph :as loom]
[loom.attr :as loom-attr])
(:import
(me.untethr.nostr.domain UITextNote UITextNoteWrapper)))
(defn- create-node->num-predecessors
[graph]
(reduce (fn [acc n]... |
1fdcd436f8cfba1f4f74b810a938e6e6093e19008a90ac05f7740b5b85edf857 | robert-strandh/CLIMatis | presentation.lisp | (cl:in-package #:clim3-input)
(defparameter clim3-ext:*input-context* nil)
(defparameter clim3-ext:*command-table* nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Function PTYPEP.
;;;
;;; At the moment, this function is equivalent to the Common Lisp
function TYPEP . Later , it will als... | null | https://raw.githubusercontent.com/robert-strandh/CLIMatis/4949ddcc46d3f81596f956d12f64035e04589b29/Input/presentation.lisp | lisp |
Function PTYPEP.
At the moment, this function is equivalent to the Common Lisp
of the presentation type.
Class PRESENTATION.
This class is a subclass of VISIT. In addition, it contains an
Class ACTION | (cl:in-package #:clim3-input)
(defparameter clim3-ext:*input-context* nil)
(defparameter clim3-ext:*command-table* nil)
function TYPEP . Later , it will also check additional parameters
(defun clim3:ptypep (object ptype)
(typep object ptype))
underlying object , called the GEM .
(defclass clim3:presen... |
5eef1bd634850d9f479f4ed34448d7cc8d3db28e8a6e39e11ee96ec2b3e46791 | nrnrnr/qc-- | sparcTrees.ml | module type S =
sig
type nativeint = Base.std_nativeint
type reg_or_imm
= Imode of nativeint (*[~4096..4095]*)
[ 0 .. 31 ]
type address
[ 0 .. 31 ]
[ 0 .. 31 ]
| Absolutea of nativeint (*[~4096..4095]*)
[ 0 .. 31 ]
[ 0 .. 31 ]
type regaddr
[ 0 .. 31 ]
[ 0 .. 31 ]
type t
... | null | https://raw.githubusercontent.com/nrnrnr/qc--/ec56191b669729e7ce8181a2bd97a912842ea716/tdpe/sparcTrees.ml | ocaml | [~4096..4095]
[~4096..4095]
[~4096..4095]
[~4096..4095] | module type S =
sig
type nativeint = Base.std_nativeint
type reg_or_imm
[ 0 .. 31 ]
type address
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
type regaddr
[ 0 .. 31 ]
[ 0 .. 31 ]
type t
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ]
[ 0 .. 31 ... |
698197a1ce224354b3aec9849e3d384c55f588ff4251d6e24b7c67b5fcee961d | bluelisp/hemlock | repl.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(in-package :hi)
;;;; PREPL/background buffer in... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/src/repl.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
PREPL/background buffer integration
Setup an a connection to the editor for the current thread, and
create an editor buffer for I/O and return the client stream. | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(in-package :hi)
(declaim (special hi::*in-hemlock-slave-p*
hemlock::*master-machine-and-port*
hemlock::*original-terminal-io*))
(defun need... |
29fd2f6dbe2253d9ec9043365b72fa74d92f759e642200727a605c1acef15cb3 | jordwalke/rehp | webgldemo.ml | Js_of_ocaml example
* /
* Copyright ( C ) 2012
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ve... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/examples/webgl/webgldemo.ml | ocaml | Js_of_ocaml example
* /
* Copyright ( C ) 2012
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ve... | |
e5dbe0c70690a90a248a08f91998230e9cf53b242eef3d9e6c7e92787c554696 | yetibot/core | specs.clj | (ns yetibot.core.commands.karma.specs
(:require [clojure.spec.alpha :as s]))
(s/def ::name string?)
(s/def ::id string?)
(s/def ::user (s/keys :req-un [::name ::id]))
(s/def ::ctx (s/keys :req-un [::user]))
(s/def ::user-id (s/and string? #(re-matches #"\w[-\w]*\w" %)))
(s/def ::action (s/and string? (s/or :positi... | null | https://raw.githubusercontent.com/yetibot/core/e35cc772622e91aec3ad7f411a99fff09acbd3f9/src/yetibot/core/commands/karma/specs.clj | clojure |
run-time data validators
get-score
adjust-score | (ns yetibot.core.commands.karma.specs
(:require [clojure.spec.alpha :as s]))
(s/def ::name string?)
(s/def ::id string?)
(s/def ::user (s/keys :req-un [::name ::id]))
(s/def ::ctx (s/keys :req-un [::user]))
(s/def ::user-id (s/and string? #(re-matches #"\w[-\w]*\w" %)))
(s/def ::action (s/and string? (s/or :positi... |
1fed7465d30ec473e45d9937ba1e664ecb77deb9c1ea9176a675246f37fe4acc | LukaKurnjek/plutus-pioneer-program-book | Test.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE NumericUnderscores #-}
# LANGUAGE OverloadedStrings #
{-# LANGUAGE Scope... | null | https://raw.githubusercontent.com/LukaKurnjek/plutus-pioneer-program-book/ed8e4a0e54c5246e72c0ba9f832e4b8820458a4a/code/Oracles/src/Week06/Oracle/Test.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators # | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Week06.Oracle.Test where
import Control.Monad hiding (fmap)
import Control.Monad.Freer.Extras as Ex... |
52cc51c1684050bb82389f893ba379c640623ad22d5fdcb148739d7923bc7c60 | msantos/wierl | rfkill.erl | Copyright ( c ) 2011 - 2021 , < >
%% 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 condition... | null | https://raw.githubusercontent.com/msantos/wierl/26fe31d85b5dc04e1c0395030a2e99ac56a2fec7/src/rfkill.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.
Redistributions in bi... | Copyright ( c ) 2011 - 2021 , < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING ,
BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF U... |
3c10893e26d6a80a87557aec85185465ed3695b473b98250c997fc664bf0d303 | Chatanga/codingame-hs | Epsilon.hs | module Epsilon
( (|>)
, epsilon
) where
import Delta.Zeta
infixl 8 |>
x |> y = y $ x
epsilon = putStrLn "epsilon"
| null | https://raw.githubusercontent.com/Chatanga/codingame-hs/1048415c0086d2ef7b1246d24afbb8378c9f0552/data/Delta/Epsilon.hs | haskell | module Epsilon
( (|>)
, epsilon
) where
import Delta.Zeta
infixl 8 |>
x |> y = y $ x
epsilon = putStrLn "epsilon"
| |
c3dd6aec4d1707e9205b03b2b5a9031f56910e67ebd7ab8beadde4b35a14df8f | hazelgrove/HZ | hz_view.ml | generates from terms . styled exclusively using CSS ( www / style.css )
module HTMLView = struct
module Html = Tyxml_js.Html
open Html
open Hz_semantics
let hzdiv cls contents = Html.(div ~a:[a_class ["HZElem";cls]] contents)
let string_of_side side = match side with
| HExp.L -> "L"
| HExp.R ->... | null | https://raw.githubusercontent.com/hazelgrove/HZ/2ec8a4ce37a3c1f6f6cacb2fc3a2421ae3126090/src/hz_view.ml | ocaml | generates from terms . styled exclusively using CSS ( www / style.css )
module HTMLView = struct
module Html = Tyxml_js.Html
open Html
open Hz_semantics
let hzdiv cls contents = Html.(div ~a:[a_class ["HZElem";cls]] contents)
let string_of_side side = match side with
| HExp.L -> "L"
| HExp.R ->... | |
040b4c4d747315f1907ea209effb9065dd50a59626ac799449bbd1bee13c0b87 | noss/iserve | iserve_example.erl | -*- mode : Erlang ; indent - tabs - mode : nil ; -*-
-module(iserve_example).
%% application callbacks
-behaviour(application).
-export([start/2, stop/1]).
%% iserve callbacks
-behaviour(iserve).
-export([iserve_request/2]).
start(_Type, _Args) ->
{ok, Port} = application:get_env(?MODULE, port),
Master = ... | null | https://raw.githubusercontent.com/noss/iserve/32281eb830c27d5db8c62730a9386c2d305c0247/test/iserve_example.erl | erlang | application callbacks
iserve callbacks | -*- mode : Erlang ; indent - tabs - mode : nil ; -*-
-module(iserve_example).
-behaviour(application).
-export([start/2, stop/1]).
-behaviour(iserve).
-export([iserve_request/2]).
start(_Type, _Args) ->
{ok, Port} = application:get_env(?MODULE, port),
Master = iserve_master,
{ok, Pid} = iserve:add_ser... |
c9753a4fda470376deae6a183181f80f34190e58066106a2846ed6b26bbfe784 | ocaml-explore/explore | main.ml | open Js_of_ocaml
[@@@part "0"]
(* Defining the Person object type *)
class type person =
object
val name : Js.js_string Js.prop
method printName : unit -> unit Js.meth
end
[@@@part "1"]
let person : (Js.js_string Js.t -> person Js.t) Js.constr =
Js.Unsafe.js_expr "Person"
let () =
let v = new%js p... | null | https://raw.githubusercontent.com/ocaml-explore/explore/117768b378959f18a8d818f37779a750e90f3438/content/workflows/running-ocaml-in-your-browser/examples/types/main.ml | ocaml | Defining the Person object type | open Js_of_ocaml
[@@@part "0"]
class type person =
object
val name : Js.js_string Js.prop
method printName : unit -> unit Js.meth
end
[@@@part "1"]
let person : (Js.js_string Js.t -> person Js.t) Js.constr =
Js.Unsafe.js_expr "Person"
let () =
let v = new%js person (Js.string "Alice") in
v##prin... |
1e9ccd34431e711dd3428f3cb7bd2d53dee508e10c5abb4d0b1ca712ff106902 | atennapel/tinka-hs | Modules.hs | module Modules where
import Data.IORef
import GHC.IO.Unsafe (unsafeDupablePerformIO)
import Data.Map (Map)
import qualified Data.Map as M
import Data.List (isSuffixOf, delete)
import Surface
import Parser
import Elaboration
import Control.Monad (foldM)
handleFilename :: String -> String
handleFilename s = if ".tinka... | null | https://raw.githubusercontent.com/atennapel/tinka-hs/1fdbcea31252ae575269e441c603a3dd27b00431/src/Modules.hs | haskell | module cache
elaboration
entry point | module Modules where
import Data.IORef
import GHC.IO.Unsafe (unsafeDupablePerformIO)
import Data.Map (Map)
import qualified Data.Map as M
import Data.List (isSuffixOf, delete)
import Surface
import Parser
import Elaboration
import Control.Monad (foldM)
handleFilename :: String -> String
handleFilename s = if ".tinka... |
897a7afccd7bcab0eaae603e12b7785a2247f8bfd7fff9dd720ecb81c090a2fd | BradWBeer/clinch | package.lisp | (in-package #:clinch)
(export 'get-generic-single-diffuse-light-shader)
(export 'load-mesh)
(export 'import-scene)
(export 'skeleton)
| null | https://raw.githubusercontent.com/BradWBeer/clinch/421de1e4844a5142e37cb06805bc2d9d13ba048f/clinch-classimp/package.lisp | lisp | (in-package #:clinch)
(export 'get-generic-single-diffuse-light-shader)
(export 'load-mesh)
(export 'import-scene)
(export 'skeleton)
| |
e24e33328c4a0ad91c49d4cb1e91e2c18e0e951b34dddb8c7ecbe2e9dbc86c2e | jgoerzen/hpodder | Types.hs | hpodder component
Copyright ( C ) 2006 - 2007 < >
This program is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This ... | null | https://raw.githubusercontent.com/jgoerzen/hpodder/bd08d07cc29893177efe8ef0e8be368657d56bbf/Types.hs | haskell | ^ Ready to download
^ Already downloaded
^ Error downloading
^ Skipped by some process or other
Last successful update
Last attempt
failed attempts since last success
Last attempt | hpodder component
Copyright ( C ) 2006 - 2007 < >
This program is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This ... |
d61bba259032fa2f965046be15901df6a9d5be576cad48913fb7f67f185ba952 | hugit-project/hugit | shell.cljs | (ns hugit.shell
(:require [clojure.string :as str]))
(defonce shelljs
(js/require "shelljs"))
(defn- exec*
[command & {:keys [async silent encoding callback]
:or {async false
silent false
encoding "utf8"}
:as options}]
(let [opts (dissoc option... | null | https://raw.githubusercontent.com/hugit-project/hugit/15c750ed633a229b517ffe0f3e8462197e0e3b06/src/hugit/shell.cljs | clojure | (ns hugit.shell
(:require [clojure.string :as str]))
(defonce shelljs
(js/require "shelljs"))
(defn- exec*
[command & {:keys [async silent encoding callback]
:or {async false
silent false
encoding "utf8"}
:as options}]
(let [opts (dissoc option... | |
fc7dcaa5d68a4f3d2474b7baa2660563220f826e1e7a82e1cb4bf18cc98fe6de | jesperes/aoc_erlang | aoc2019_day23.erl | Advent of Code solution for 2019 day 23 .
Created : 2019 - 12 - 23T06:13:41 + 00:00
-module(aoc2019_day23).
-include("aoc_puzzle.hrl").
-export([parse/1, solve/1, info/0]).
-behavior(aoc_puzzle).
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2019/aoc2019_day23.erl | erlang | True when booting, false otherwise
Parent pid
Address for next output package
Buffered outgoing X value
Buffered incoming Y value
Set of idle pids
Parent pid
Wait until all NICs have booted
If we have a buffered Y value, return it.
Poll input queue
This is the only place where the intcode VM actually
waits.... | Advent of Code solution for 2019 day 23 .
Created : 2019 - 12 - 23T06:13:41 + 00:00
-module(aoc2019_day23).
-include("aoc_puzzle.hrl").
-export([parse/1, solve/1, info/0]).
-behavior(aoc_puzzle).
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2019,
... |
31db0cbb73bea201525422d3a5b38db6411cdfe523cbac7c06909e9ca498ca66 | 3b/3bgl-misc | sample.lisp | (defpackage #:gpuanim-test
(:use :cl :basecode))
(in-package #:gpuanim-test)
(defclass gpuanim-test (basecode-glop perspective-projection basecode-clear
basecode-timing-helper::basecode-timing-helper
fps-graph basecode-draw-ground-plane
fre... | null | https://raw.githubusercontent.com/3b/3bgl-misc/e3bf2781d603feb6b44e5c4ec20f06225648ffd9/gpuanim/sample.lisp | lisp | breaks something?
no interesting anims?
material files somewhere with correct textures), so remap them by hand
can't do this in :around since it depends on some stuff that happens in
later :around methods :/
try to load textures
(/ 6619904 3840.0)1723.9333
need at least sort-by-p-type to remove types
re... | (defpackage #:gpuanim-test
(:use :cl :basecode))
(in-package #:gpuanim-test)
(defclass gpuanim-test (basecode-glop perspective-projection basecode-clear
basecode-timing-helper::basecode-timing-helper
fps-graph basecode-draw-ground-plane
fre... |
42a0a218d809e9bf363ec90e8fed79502f074d0349d5300edf03913c664c5ac2 | fmi/clojure-examples | indexed.clj | (ns life.indexed)
(defn empty-board
"Creates an empty board with the given dimensions. The board
is represented as a vector of vectors of the same size."
[w h]
(vec (repeat w (vec (repeat h nil)))))
(defn populate
"Adds living-cells to board."
[board living-cells]
(reduce (fn [board coordinates]
... | null | https://raw.githubusercontent.com/fmi/clojure-examples/46ec0fe7bdfdfccde1ab74a94c64dbd73ea58269/2013/01-game-of-life/src/life/indexed.clj | clojure | (ns life.indexed)
(defn empty-board
"Creates an empty board with the given dimensions. The board
is represented as a vector of vectors of the same size."
[w h]
(vec (repeat w (vec (repeat h nil)))))
(defn populate
"Adds living-cells to board."
[board living-cells]
(reduce (fn [board coordinates]
... | |
4770f42d53fd076fab43ac53b5e6ec744d8f5528c8fe5ea0d9686cab67a1e25d | chef/sqerl | sqerl.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
%% ex: ts=4 sw=4 et
@author < >
@author < >
Copyright 2011 - 2012 Opscode , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
... | null | https://raw.githubusercontent.com/chef/sqerl/a27e3e58da53240dc9925ec03ecdb894b8231cf9/src/sqerl.erl | erlang | ex: ts=4 sw=4 et
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
See -append... | -*- erlang - indent - level : 4;indent - tabs - mode : nil ; fill - column : 92 -*-
@author < >
@author < >
Copyright 2011 - 2012 Opscode , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed... |
3295259d69686cac684a2e245c0bde50de2aa3e533beac596e3e39597505dd73 | svdm/ClojureGP | unc_math_random.clj | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php) which
;; can be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by t... | null | https://raw.githubusercontent.com/svdm/ClojureGP/266e501411b37297bdeb082913df63ececa8515c/src/cljgp/tools/unc_math_random.clj | clojure | Public License 1.0 (-1.0.php) which
can be found in the file epl-v10.html at the root of this distribution. By
using this software in any fashion, you are agreeing to be bound by the
terms of this license. You must not remove this notice, or any other, from
this software.
(let [rng (new MersenneTwisterRNG see... | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse
(ns cljgp.tools.unc-math-random
(:import [org.uncommons.maths.random MersenneTwisterRNG])
(:use [cljgp.random :only (rand-fn)]))
Example of how one would wrap a third party PRNG ... |
72759357cb61f8e145a94bbceb5c1511ffa7c53320bc45dda025f4d509d34bcc | strictly-lang/compiler | Util.hs | module Compiler.Util
( pathToComponent,
slashToDash,
slashToCamelCase,
indent,
rightHandSideValueToJs,
functionToJs,
rightHandSideValueFunctionCallToJs,
leftHandSideToJs,
propertyChainToString,
getGetFreshExprId,
addImport,
splitOn,
)
where
import Compiler.Types
import C... | null | https://raw.githubusercontent.com/strictly-lang/compiler/dc47868e35a6de1e0acabb642a630b2e96bb43fd/src-lib/Compiler/Util.hs | haskell | module Compiler.Util
( pathToComponent,
slashToDash,
slashToCamelCase,
indent,
rightHandSideValueToJs,
functionToJs,
rightHandSideValueFunctionCallToJs,
leftHandSideToJs,
propertyChainToString,
getGetFreshExprId,
addImport,
splitOn,
)
where
import Compiler.Types
import C... | |
1670c13f90d64250eb96659870cb94ede8789110709e7d33a8d4bda89124c46e | puppetlabs/trapperkeeper-metrics | metrics.clj | ;; Utility functions for working with the Metrics library
(ns puppetlabs.metrics
(:import (com.codahale.metrics MetricRegistry RatioGauge RatioGauge$Ratio
Gauge Metric Metered Sampling Timer)
(java.util.concurrent TimeUnit))
(:require [schema.core :as schema]))
;;;;;;;;... | null | https://raw.githubusercontent.com/puppetlabs/trapperkeeper-metrics/47f1534ebb75339eeb42e0de33fab0ec2f6cacdc/src/clj/puppetlabs/metrics.clj | clojure | Utility functions for working with the Metrics library
Public |
(ns puppetlabs.metrics
(:import (com.codahale.metrics MetricRegistry RatioGauge RatioGauge$Ratio
Gauge Metric Metered Sampling Timer)
(java.util.concurrent TimeUnit))
(:require [schema.core :as schema]))
(schema/defn ^:always-validate host-metric-name :- schema/Str
"... |
43ffcb469b46480f7bb0876e65ce704cd8e6e38c580a5d194d092269507dec6a | google/ormolu | promotion-1-out.hs | type S2 = Proxy ('[ '[], '[]])
type S4 = Proxy ('( 'Just, ' T'T))
type S5 = Proxy ('[ 'Just, 'TT'T])
type S6 = Proxy ('( '(), '()))
type S7 = Proxy ('( 'a, 'b))
type S8 = Proxy ('[Int, Bool])
type E = TypeError ('Text "Some text")
type G = '[ '( 'Just, 'Bool)]
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/type/promotion-1-out.hs | haskell | type S2 = Proxy ('[ '[], '[]])
type S4 = Proxy ('( 'Just, ' T'T))
type S5 = Proxy ('[ 'Just, 'TT'T])
type S6 = Proxy ('( '(), '()))
type S7 = Proxy ('( 'a, 'b))
type S8 = Proxy ('[Int, Bool])
type E = TypeError ('Text "Some text")
type G = '[ '( 'Just, 'Bool)]
| |
501815d036577aef2906c9d480c76ad905fea9afa66ba24b221aac623653e80b | serhiip/org2any | CommandSpec.hs | # OPTIONS_GHC -Wno - orphans #
{-# LANGUAGE OverloadedStrings #-}
module CommandSpec
( commandSpec
) where
import Control.Monad.Free ( Free(..) )
import Data.List ( nub )
import Data.OrgMode.Sync.Command ( create
... | null | https://raw.githubusercontent.com/serhiip/org2any/c8b01a08f371593d3d3d8b1125656dd8e02524ca/test/CommandSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -Wno - orphans #
module CommandSpec
( commandSpec
) where
import Control.Monad.Free ( Free(..) )
import Data.List ( nub )
import Data.OrgMode.Sync.Command ( create
, del
... |
c499fdf86a2c340e2ca552a9a9e8f907ce5b51d933ca09dd8d3d13c297b5d298 | ucsd-progsys/liquidhaskell | Types.hs | # LANGUAGE ViewPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
module Language.Haskell.Liquid.GHC.Plugin.Types
( SpecC... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/8d905ff44e3b5c8b94d7ca561a1f1db1452caeec/src/Language/Haskell/Liquid/GHC/Plugin/Types.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE EmptyDataDecls #
# LANGUAGE DeriveDataTypeable #
* Dealing with specs and their dependencies
* Caching specs into interfaces
* Merging specs together
* Carrying data across stages of the compilation pipeline
* Acquiring and manipulating data from the typechecking phase
* Wrapper type... | # LANGUAGE ViewPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE DeriveGeneric #
module Language.Haskell.Liquid.GHC.Plugin.Types
( SpecComment(..)
, LiquidLib
, mkLiquidLib
, libTarget
, libDeps
, allDeps
... |
9cff1e3db9175745f37db1ae68c6a59844972106ef3aa40d21cdf49a29acfced | racket/typed-racket | control-test-3.rkt | #lang racket/load
(module untyped racket
(provide call-f)
(define (call-f f)
(call-with-continuation-prompt
(λ () (f 0))
(default-continuation-prompt-tag)
(λ (x) (x "string")))))
(module typed typed/racket/optional
(require/typed 'untyped
[call-f ((Integer -> Integer) -> Int... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/optional/control-test-3.rkt | racket | #lang racket/load
(module untyped racket
(provide call-f)
(define (call-f f)
(call-with-continuation-prompt
(λ () (f 0))
(default-continuation-prompt-tag)
(λ (x) (x "string")))))
(module typed typed/racket/optional
(require/typed 'untyped
[call-f ((Integer -> Integer) -> Int... | |
4704ed89bcd7e8186e73688c0fcd7c09f63b46fe5e5cddf0bc0d75647996e397 | ssm-lang/sslang | DConToFunc.hs | # LANGUAGE DerivingVia #
| Turns non - nullary data constructors into calls to constructor functions .
Worked example of ADT definition and corresponding constructor functions :
> type Shape
> Square Int
>
Let 's turn data constructor ` Square ` into constructor function ` _ _ Square ` :
> _... | null | https://raw.githubusercontent.com/ssm-lang/sslang/33f173ae72c94ee758d6985fe9d2c9542998e72f/src/IR/DConToFunc.hs | haskell | | Environment storing arity of each 'DCon'
| Arity Reader Monad
| Run a computation within an arity environment
user defined functions
top-level constructor functions
We need to filter defs to account for name collisions
leave nullary data constructors alone
| Create a top level function for each data construc... | # LANGUAGE DerivingVia #
| Turns non - nullary data constructors into calls to constructor functions .
Worked example of ADT definition and corresponding constructor functions :
> type Shape
> Square Int
>
Let 's turn data constructor ` Square ` into constructor function ` _ _ Square ` :
> _... |
70ede70ad9fa434b0a376836b79fed6017908bffe081c60de556841d0564fb6c | scrintal/heroicons-reagent | server.cljs | (ns com.scrintal.heroicons.solid.server)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M4.08 5.227A3 3 0 016.979 3H17.02a3 3 0 012.9 2.227l2.113 7.926A5.228 5.228 0 0018.75 12H5.25a5.228 5.228 0 00-3.284 1.15... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/server.cljs | clojure | (ns com.scrintal.heroicons.solid.server)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:d "M4.08 5.227A3 3 0 016.979 3H17.02a3 3 0 012.9 2.227l2.113 7.926A5.228 5.228 0 0018.75 12H5.25a5.228 5.228 0 00-3.284 1.15... | |
f224996b97035ed5e182cf45f1f07f20d08fdce3533c102d25c7fe2ae32c35df | dparis/gen-phzr | stage.cljs | (ns phzr.impl.accessors.pixi.stage)
(def stage-get-properties
{:alpha "alpha"
:cache-as-bitmap "cacheAsBitmap"
:children "children"
:filter-area "filterArea"
:filters "filters"
:height "height"
:hit-area "hitArea"
:mask "mask"
:parent "parent"
:pivot "pivot"
:position "position"
:ren... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/impl/accessors/pixi/stage.cljs | clojure | (ns phzr.impl.accessors.pixi.stage)
(def stage-get-properties
{:alpha "alpha"
:cache-as-bitmap "cacheAsBitmap"
:children "children"
:filter-area "filterArea"
:filters "filters"
:height "height"
:hit-area "hitArea"
:mask "mask"
:parent "parent"
:pivot "pivot"
:position "position"
:ren... | |
f43a530892bcc35790c3b69d6d4d873525a13c1e08735755b6b6f7c034b21f2f | axelarge/advent-of-code | day15.clj | (ns advent-of-code.y2015.day15
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]
[clojure.math.combinatorics :refer [combinations permutations]]))
(def input (get-input 2015 15))
(defn parse-line [line]
(reverse (find-ints line)))
(defn parse [input]
(map parse-lin... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2015/day15.clj | clojure | (ns advent-of-code.y2015.day15
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]
[clojure.math.combinatorics :refer [combinations permutations]]))
(def input (get-input 2015 15))
(defn parse-line [line]
(reverse (find-ints line)))
(defn parse [input]
(map parse-lin... | |
8b450454a6e844776520191c4feace6cdb5d9f23c657e360faa21ac34026e7e3 | y-taka-23/thank-you-stars | Main.hs | module Main (main) where
import Utils.ThankYouStars.GitHub
import Utils.ThankYouStars.Package
import qualified Data.Set as S
import System.Directory ( getHomeDirectory )
import System.Exit ( die )
import System.FilePath ( joinPath )
main :: IO ()
main = do
homeDir <- g... | null | https://raw.githubusercontent.com/y-taka-23/thank-you-stars/c8d7cf4c2f0ed1d1234108ee507a03bfde3bc4c2/app/Main.hs | haskell | module Main (main) where
import Utils.ThankYouStars.GitHub
import Utils.ThankYouStars.Package
import qualified Data.Set as S
import System.Directory ( getHomeDirectory )
import System.Exit ( die )
import System.FilePath ( joinPath )
main :: IO ()
main = do
homeDir <- g... | |
8e04f825a2ca98fa42d933fcab9e8d769c71206e059937b83087a465373a854c | CryptoKami/cryptokami-core | Payment.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
-- | Transaction creation and fees
module Pos.Wallet.Web.Methods.Payment
( MoneySource(..)
, MonadFees
, getMoneySourceUtxo
, newPayment
, newPaymentBatch
, getTxFee
) where
import Universum
... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/wallet/src/Pos/Wallet/Web/Methods/Payment.hs | haskell | | Transaction creation and fees
`newPayment`s are done continuously.
We add TxHistoryEntry's meta created by us in advance
to make TxHistoryEntry in CTx consistent with entry in history.
--------------------------------------------------------------------------
------------------------------------------------------... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Pos.Wallet.Web.Methods.Payment
( MoneySource(..)
, MonadFees
, getMoneySourceUtxo
, newPayment
, newPaymentBatch
, getTxFee
) where
import Universum
import Control.Monad.Exce... |
ea5b214f571e7595dc107f0f69088b3b9e59c1a4bc029224be46be0d109d6631 | janestreet/lwt-async | pa_optcomp.ml |
* pa_optcomp.ml
* -------------
* Copyright : ( c ) 2008 , < >
* Licence : BSD3
*
* This file is a part of optcomp .
* pa_optcomp.ml
* -------------
* Copyright : (c) 2008, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of optcomp.
*)
open Camlp4.Sig
open Camlp4.PreCast
... | null | https://raw.githubusercontent.com/janestreet/lwt-async/c738e6202c1c7409e079e513c7bdf469f7f9984c/syntax/pa_optcomp.ml | ocaml | Subset of supported caml types
Subset of supported caml values
An identifier. It is either a lower or a upper identifier.
Quotations are evaluated by the token filters, but are expansed
after. Evaluated quotations are kept in this table, which quotation
id to to values:
+-------------+
| Environment |... |
* pa_optcomp.ml
* -------------
* Copyright : ( c ) 2008 , < >
* Licence : BSD3
*
* This file is a part of optcomp .
* pa_optcomp.ml
* -------------
* Copyright : (c) 2008, Jeremie Dimino <>
* Licence : BSD3
*
* This file is a part of optcomp.
*)
open Camlp4.Sig
open Camlp4.PreCast
... |
5d871f4ac2e0ec7d16afed19f83179ea39ec79de4396b5fdcfd08c47518da84e | dbuenzli/uucp | uucp_gc.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The uucp programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/uucp/09d2186c0828465dbe37ed976c8d8ab7a5e7eeed/src/uucp_gc.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The uucp programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) ... | |
e1717ed4bc91a0d62006a7a931f60ca56ab67ca45ff8d7643d536c6c01e73799 | tweag/ormolu | multi-value-out.hs | foo, bar :: Int
foo = 1
bar = 2
a, b, c :: Int
a = 1
b = 2
c = 3
foo,
bar,
baz ::
Int
bar = 2
baz = 3
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/signature/type/multi-value-out.hs | haskell | foo, bar :: Int
foo = 1
bar = 2
a, b, c :: Int
a = 1
b = 2
c = 3
foo,
bar,
baz ::
Int
bar = 2
baz = 3
| |
7b4a3b634f2c8b452656a30a031f7e959c1ef117a7ba6b56f08592a0a0ef2fbd | shirok/Gauche | logger.scm | ;;
;; testing gauche.logger
;;
(use gauche.test)
NB : logger uses gauche.fcntl . Before ' make link ' , it ca n't be
;; loaded by 'use'.
(when (file-exists? "../ext/fcntl/fcntl.scm")
(add-load-path "../ext/fcntl")
(load "../ext/fcntl/fcntl"))
(when (file-exists? "../ext/syslog/syslog.scm")
(add-load-path ".... | null | https://raw.githubusercontent.com/shirok/Gauche/ecaf82f72e2e946f62d99ed8febe0df8960d20c4/test/logger.scm | scheme |
testing gauche.logger
loaded by 'use'.
-------------------------------------------------------------------------
these shouldn't go to the log
------------------------------------------------------------------------- |
(use gauche.test)
NB : logger uses gauche.fcntl . Before ' make link ' , it ca n't be
(when (file-exists? "../ext/fcntl/fcntl.scm")
(add-load-path "../ext/fcntl")
(load "../ext/fcntl/fcntl"))
(when (file-exists? "../ext/syslog/syslog.scm")
(add-load-path "../ext/syslog")
(load "../ext/syslog/syslog"))
(te... |
486a1cbdda3684066489eb6e7f77cbfb3b742051a3e3bd4f235d2c875e81cdc7 | dbuenzli/remat | ui_msg.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2015 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Cop... | null | https://raw.githubusercontent.com/dbuenzli/remat/28d572e77bbd1ad46bbfde87c0ba8bd0ab99ed28/src-www/ui_msg.ml | ocaml | Navigation}
[@localize "Preview"]
[@localize "Show the document's page thumbnails"]
[@localize "Record"]
[@localize "Show the document's record"]
[@localize "Show the document's divisons"]
[@localize "PDF"]
[@localize "Download the document in PDF format"]
[@localize "TXT"]
[@localize "Download the d... | ---------------------------------------------------------------------------
Copyright ( c ) 2015 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Cop... |
1b3f470087c599eeef2f462f5bd3dd28c7f6a5dea23b03290f7f059ea862cd9e | trskop/command-wrapper | Completion.hs | # LANGUAGE DuplicateRecordFields #
-- |
-- Module: $Header$
-- Description: Implementation of internal subcommand that provides command
-- line completion and support for IDE-like functionality.
Copyright : ( c ) 2018 - 2020
License : BSD3
--
-- Maintainer:
-- Stability: experimental... | null | https://raw.githubusercontent.com/trskop/command-wrapper/4f2e2e1f63a3296ccfad9f216d75a708969890ed/command-wrapper/src/CommandWrapper/Toolset/InternalSubcommand/Completion.hs | haskell | |
Module: $Header$
Description: Implementation of internal subcommand that provides command
line completion and support for IDE-like functionality.
Maintainer:
Stability: experimental
Implementation of internal subcommand that provides command line completion
and support for IDE-like fun... | # LANGUAGE DuplicateRecordFields #
Copyright : ( c ) 2018 - 2020
License : BSD3
Portability : GHC specific language extensions ; POSIX .
module CommandWrapper.Toolset.InternalSubcommand.Completion
( completion
, completionSubcommandCompleter
, completionSubcommandDescription
, completion... |
8a683bb8f930e3194e53f8d7c11b334f6c1a6c8596e698afc2ad5c9264161079 | titola/incudine | dlopen.lisp | Copyright ( c ) 2014
;;;
;;; This library 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.1 of the License , or ( at your option ) any later version .
;;;
;;; This library is d... | null | https://raw.githubusercontent.com/titola/incudine/325174a54a540f4daa67bcbb29780073c35b7b80/contrib/cl-ladspa/dlopen.lisp | lisp |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See... | Copyright ( c ) 2014
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
(in-package :ladspa)
(eval-when (:compile-toplevel :load-toplev... |
a5ab53c03df169115247007d0e7127cc1f23a552cd05f328cb79facabd8d2fae | tari3x/csec-modex | pitranslweak.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/tari3x/csec-modex/5ab2aa18ef308b4d18ac479e5ab14476328a6a50/deps/proverif1.84/src/pitranslweak.mli | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | |
4d3cb9e9e8cbc8fad84c309a2398220d244da276b22df16ba0f8b4a9fcf5c91b | leksah/leksah | ClassHierarchy.hs | -----------------------------------------------------------------------------
--
-- Module : IDE.Pane.ClassHierarchy
Copyright : ( c ) ,
-- License : GNU-GPL
--
-- Maintainer : <maintainer at leksah.org>
-- Stability : provisional
-- Portability : portable
--
-- | The pane of ide where mo... | null | https://raw.githubusercontent.com/leksah/leksah/ec95f33af27fea09cba140d7cddd010935a2cf52/src-gtk/IDE/Pane/ClassHierarchy.hs | haskell | ---------------------------------------------------------------------------
Module : IDE.Pane.ClassHierarchy
License : GNU-GPL
Maintainer : <maintainer at leksah.org>
Stability : provisional
Portability : portable
| The pane of ide where modules are presented in tree form with their
packag... | Copyright : ( c ) ,
module IDE.Pane.ClassHierarchy (
IDEClassHierarchy(..)
, ClassHierarchyState(..)
, showClasses
, selectClass
) where
import Prelude ()
import Prelude.Compat
import Graphics.UI.Gtk hiding (get)
import Data.Maybe
import Control.Monad.Reader
import qualified Data.Map as Map
imp... |
e1d83181ea365ec4c3946dbfda914dd74876d79a06f008ffbf56e7c2ce86ae26 | ujamjar/hardcaml | utils.mli |
* hardcaml - hardware design in OCaml
*
* ( c ) 2014 MicroJamJar Ltd
*
* Author(s ):
* Description :
*
* hardcaml - hardware design in OCaml
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s):
* Description:
*
*)
(** Utility functions *)
(** sign designator *)
type signed = Signed | U... | null | https://raw.githubusercontent.com/ujamjar/hardcaml/65f32f543348e81cbb7f6d0e77f1f1203bf4e335/src/utils.mli | ocaml | * Utility functions
* sign designator
* x |> f applies f to x
* forward composition
* reverse composition
* function chaining (avoiding brackets)
* converts a string to a list of chars
* Integer to hex character (0..15)
* converts a binary string to an integer
* converts a binary string to an integer
* conver... |
* hardcaml - hardware design in OCaml
*
* ( c ) 2014 MicroJamJar Ltd
*
* Author(s ):
* Description :
*
* hardcaml - hardware design in OCaml
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s):
* Description:
*
*)
type signed = Signed | Unsigned
val platform_bits : int
val (|>) : 'a ... |
a14fb101da144d65f348fd02b84d953860a9fbfc07b5628c1e96ed9bce59aa38 | janestreet/core_kernel | test_iobuf.ml | open! Core
open Poly
module IR = Int_repr
open! Iobuf
open Expect_test_helpers_core
let arch_sixtyfour = Sys.word_size_in_bits = 64
let is_error = Result.is_error
let is_ok = Result.is_ok
let ok_exn = Or_error.ok_exn
let try_with = Or_error.try_with
let%test_module "[Consume]" =
(module struct
open Consume
... | null | https://raw.githubusercontent.com/janestreet/core_kernel/597299d11c2ee99f219592d89a5890f8f0b6dfe7/iobuf/test/test_iobuf.ml | ocaml | see iobuf_view_tests.ml for expect-tests of these
[create] with random capacity.
[create] with user-supplied capacity.
[create] with invalid capacity.
[window]
[sub_shared ?pos ?len]
Use a [t] where the full window does not encompass the entire buffer
Test with full window
Test with new window
Modif... | open! Core
open Poly
module IR = Int_repr
open! Iobuf
open Expect_test_helpers_core
let arch_sixtyfour = Sys.word_size_in_bits = 64
let is_error = Result.is_error
let is_ok = Result.is_ok
let ok_exn = Or_error.ok_exn
let try_with = Or_error.try_with
let%test_module "[Consume]" =
(module struct
open Consume
... |
c09d87ac8c43df9d66202b3677bb3e9ce5ebc7fe1d9c8b86f045f42d03c5e0a8 | unclebob/AdventOfCode2021 | core.clj | (ns day14.core
(:require [clojure.string :as string]
[clojure.set :as set]))
(defn parse-line [line]
(if (re-matches #"\w\w -> \w" line)
[:insert [(.substring line 0 2)
(.substring line 6 7)]]
[:template line])
)
(defn parse-input [input]
(loop [lines (remove empty? (string/... | null | https://raw.githubusercontent.com/unclebob/AdventOfCode2021/1db64c9fac93fcb1815a24934f476240046eb8e2/day14/src/day14/core.clj | clojure | (ns day14.core
(:require [clojure.string :as string]
[clojure.set :as set]))
(defn parse-line [line]
(if (re-matches #"\w\w -> \w" line)
[:insert [(.substring line 0 2)
(.substring line 6 7)]]
[:template line])
)
(defn parse-input [input]
(loop [lines (remove empty? (string/... | |
239ed5ce221c442a21730268920c48f517cf59c060217cd799800761c7806b31 | stalefruits/aufi | rate_test.clj | (ns aufi.ring.middlewares.rate-test
(:require [clojure.test :refer :all]
[aufi.test :as test]
[aufi.ring.middlewares.rate :refer [wrap-rate]]))
(deftest t-wrap-rate
(testing "local rate limitting."
(let [f (constantly {:status 200})
handler (wrap-rate f {:rate 1, :period 100})... | null | https://raw.githubusercontent.com/stalefruits/aufi/def535f9ef958e6ea7273a19524e8f12c832bd59/test/aufi/ring/middlewares/rate_test.clj | clojure | (ns aufi.ring.middlewares.rate-test
(:require [clojure.test :refer :all]
[aufi.test :as test]
[aufi.ring.middlewares.rate :refer [wrap-rate]]))
(deftest t-wrap-rate
(testing "local rate limitting."
(let [f (constantly {:status 200})
handler (wrap-rate f {:rate 1, :period 100})... | |
4169f4a10f54de88ce18b4cb61a7aa595808e55f3e3764546fc94ad92f5f7359 | carl-eastlund/mischief | reader.rkt | #lang s-exp syntax/module-reader
no-debug/racket/base
| null | https://raw.githubusercontent.com/carl-eastlund/mischief/ce58c3170240f12297e2f98475f53c9514225825/no-debug/racket/base/lang/reader.rkt | racket | #lang s-exp syntax/module-reader
no-debug/racket/base
| |
842df268076cfaf2433f48d2d5578dd088633c9f78832bcb5eb482d82e995a3a | OCamlPro/ocp-build | ocpOption.ml | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-lang/ocpOption.ml | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
let map f = function
| None -> None
| Some x -> Some (f x)
let default d = function
| None -> d
| Some x -> x
let iter fn = function
| None -> ()
| ... |
ce5cdfe6019e3e0614e7442f28421884b3edf28bae5933d2ed124fe3f3469efc | sionescu/iolib | classes.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- fd-streams classes.
;;;
(in-package :iolib/streams)
;;;; Stream Buffers
(deftype stream-buffer () 'foreign-pointer)
(deftype buffer-index () '(unsigned-byte 24))
(defstruct (iobuf (:constructor %make-iobuf ()))
(data (null-pointer) :type stream-buffer)
... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/streams/gray/classes.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- fd-streams classes.
Stream Buffers
File-Descriptor Mixins
Flag used by stream-force-output.
Last read char buffer index. |
(in-package :iolib/streams)
(deftype stream-buffer () 'foreign-pointer)
(deftype buffer-index () '(unsigned-byte 24))
(defstruct (iobuf (:constructor %make-iobuf ()))
(data (null-pointer) :type stream-buffer)
(size 0 :type buffer-index)
(start 0 :type buffer-index)
(end 0 ... |
e97d2e99dec400ca7d00dbdc56dbbde7e197f0b2048762712c3fb7f1c3b4e278 | imrehg/ypsilon | menu.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk menu)
(export gtk_menu_attach
gtk_menu_attach_to_widget
gtk_menu_bar_get_child_pack_direction
gtk_menu_b... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/menu.scm | scheme | GtkPackDirection gtk_menu_bar_get_pack_direction (GtkMenuBar* menubar)
void gtk_menu_bar_set_child_pack_direction (GtkMenuBar* menubar, GtkPackDirection child_pack_dir)
GType gtk_menu_direction_type_get_type (void)
GtkAccelGroup* gtk_menu_get_accel_group (GtkMenu* menu)
const gchar* gtk_menu_get_accel_path (GtkMen... | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk menu)
(export gtk_menu_attach
gtk_menu_attach_to_widget
gtk_menu_bar_get_child_pack_direction
gtk_menu_b... |
2baded946ed7fd7aadb957f99d79f8b143ce92960d48e4427bc3245b050f5585 | haskell-gi/haskell-gi | DocTests.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Build_doctests (flags, pkgs, module_sources)
import Test.DocTest (doctest)
import System.Process
main :: IO ()
main = do
gobjectIntrospectionLibs <- pkgConfigLibs "gobject-introspection-1.0"
-- traverse_ putStrLn args -- optionally print arguments
... | null | https://raw.githubusercontent.com/haskell-gi/haskell-gi/bff8f3b92bf2594ea3d6745c346a8de594fc3709/DocTests.hs | haskell | # LANGUAGE OverloadedStrings #
traverse_ putStrLn args -- optionally print arguments | module Main where
import Build_doctests (flags, pkgs, module_sources)
import Test.DocTest (doctest)
import System.Process
main :: IO ()
main = do
gobjectIntrospectionLibs <- pkgConfigLibs "gobject-introspection-1.0"
doctest (gobjectIntrospectionLibs ++ args)
where
args = flags ++ pkgs ++ module_sources
... |
7dd411b3cdf22c204c408f13f98b3f61c27b79234d523754ae869e2d8977ecf9 | facebook/flow | parse_error.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/876999bc0e135e62bbd5fed2a6f6422e5145e679/src/parser/parse_error.ml | ocaml | Based on the error condition, we will only receive member names starting with [a-z] |
* 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... |
4f5c2a017b5948fd29ca0ca0bcdfaba06348a744d77590c02ee24707045e1ad1 | number571/Haskell | maximum.hs | module Main where
max' :: Ord a => a -> a -> a
max' x y | x > y = x | otherwise = y
maximum' :: Ord a => [a] -> a
maximum' [] = undefined
maximum' [x] = x
maximum' (x:xs) = max' x $ maximum' xs
main :: IO()
main = print $ maximum' [1,5,3,8,2,3,4]
| null | https://raw.githubusercontent.com/number571/Haskell/7da2676c2604706d43791dc89c0ca8c9842aea48/Templates/maximum.hs | haskell | module Main where
max' :: Ord a => a -> a -> a
max' x y | x > y = x | otherwise = y
maximum' :: Ord a => [a] -> a
maximum' [] = undefined
maximum' [x] = x
maximum' (x:xs) = max' x $ maximum' xs
main :: IO()
main = print $ maximum' [1,5,3,8,2,3,4]
| |
051fb24f1a05f5ee04e220f8f4a1fb346fe3e8be9f2bd0ed77894b412b6d3342 | davdar/maam | Examples.hs | module Lang.LamIf.Examples where
import Lang.LamIf
import FP
import qualified FP.Pretty as P
examplesMain :: IO ()
examplesMain = flowSensitivityMain
makeOptions :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [(Doc, Options)]
makeOptions ltime dtime val monad gc cl... | null | https://raw.githubusercontent.com/davdar/maam/2cc3ff3511a7a4daadcd44c60c4b08862c01e183/src/Lang/LamIf/Examples.hs | haskell | module Lang.LamIf.Examples where
import Lang.LamIf
import FP
import qualified FP.Pretty as P
examplesMain :: IO ()
examplesMain = flowSensitivityMain
makeOptions :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [(Doc, Options)]
makeOptions ltime dtime val monad gc cl... | |
0adb009a09f6ff3e3934f06b2a1fc9cdd3433f55eb7b271fd4afc90d4b442937 | dyzsr/ocaml-selectml | bytes.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/stdlib/bytes.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Byte sequence operations
WARNING : Some functions in this file are duplicated in string.ml for
... |
66619b2db234d3d9ecdf79373f54af0b63c73d1cfb9e930d2fbe237571cb67b1 | practicalli/tictactoe-cli | core_test.clj | (ns tictactoe-cli.core-test
(:require [clojure.test :refer :all]
[tictactoe-cli.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/practicalli/tictactoe-cli/6f4e8ba1b6e14402455244d6acd3252de0a27bac/test/tictactoe_cli/core_test.clj | clojure | (ns tictactoe-cli.core-test
(:require [clojure.test :refer :all]
[tictactoe-cli.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.