code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
module UnionFind(UF, Replacement((:>)), newSym, (=:=), rep, frozen, runUF, S, isRep) where import Prelude hiding (min) import Control.Monad.State.Strict import Data.IntMap(IntMap) import qualified Data.IntMap as IntMap data S = S { links :: IntMap Int, sym :: Int } type UF = State S data Replacement ...
jystic/QuickSpec
qs1/UnionFind.hs
Haskell
bsd-3-clause
1,225
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} module Sys.CreateProcess( CreateProcess(..) , AsCreateProcess(..) , AsWorkingDirectory(..) , AsEnvironment(..) , AsStdin(..) , AsStdout(..) , AsStderr(..) , AsCloseDescriptors(..) , AsCreateGroup(..) , AsDele...
NICTA/sys-process
src/Sys/CreateProcess.hs
Haskell
bsd-3-clause
6,412
----------------------------------------------------------------------------- -- | -- Module : Data.Digest.MD5 -- Copyright : (c) Dominic Steinitz 2004 -- License : BSD-style (see the file ReadMe.tex) -- -- Maintainer : dominic.steinitz@blueyonder.co.uk -- Stability : experimental -- Portability : ...
astro/HTTPbis
Network/HTTP/MD5.hs
Haskell
bsd-3-clause
1,331
module ParserSpec where import qualified Data.Vector as Vec import Function import qualified Library as Lib import Parser import Test.Hspec import Text.Trifecta toEither :: Result a -> Either String a toEither (Success a) = Right a toEither (Failure e) = Left $ show e ...
hrsrashid/nummet
tests/ParserSpec.hs
Haskell
bsd-3-clause
5,553
module Main (main) where import System.Environment import CAN main :: IO () main = do args <- getArgs case args of "-h" : _ -> help "--help" : _ -> help ["--std", id, payload] -> do initCAN bus <- openBus 0 Standard sendMsg bus $ Msg (read id) (toPayload $ read payload) closeB...
tomahawkins/ecu
src/CANSend.hs
Haskell
bsd-3-clause
778
-- Copyright (c) 1998 Chris Okasaki. -- See COPYRIGHT file for terms and conditions. module AssocDefaults where import Prelude hiding (null,map,lookup,foldr,foldl,foldr1,foldl1,filter) import Assoc import qualified Sequence as S -- import qualified ListSeq as L fromSeqUsingInsertSeq :: (AssocX m k,S.Sequence...
OS2World/DEV-UTIL-HUGS
oldlib/AssocDefaults.hs
Haskell
bsd-3-clause
5,161
{-# LANGUAGE BangPatterns #-} module Language.Hakaru.Tests.ImportanceSampler where import Data.Dynamic import Language.Hakaru.Distribution import Test.QuickCheck.Monadic testBeta = undefined mu a b = a / (a + b) var a b = a*b / ((sqr $ a + b) * (a + b + 1)) where sqr x = x * x
zaxtax/hakaru-old
Language/Hakaru/Tests/Distribution.hs
Haskell
bsd-3-clause
284
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ViewPatterns #-} module Cgs ( main ) where import Cgs.Args (runParseArgsIO, CgsOptions(..)) import Control.Exception (assert) import Control.Monad ((<=<)) import Control.Monad.Identity (runIdentity) import Control.Monad.ListM (takeWhileM) import Control.Monad.State....
thomaseding/cgs
src/Cgs.hs
Haskell
bsd-3-clause
6,013
{-# LANGUAGE FlexibleInstances #-} module Language.Haskell.GhcMod.Types where -- | Output style. data OutputStyle = LispStyle -- ^ S expression style. | PlainStyle -- ^ Plain textstyle. -- | The type for line separator. Historically, a Null string is used. newtype LineSeparator = LineSeparator Stri...
vikraman/ghc-mod
Language/Haskell/GhcMod/Types.hs
Haskell
bsd-3-clause
3,690
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. module Duckling.D...
rfranek/duckling
tests/Duckling/Distance/CS/Tests.hs
Haskell
bsd-3-clause
588
import ConllReader import Control.Monad import Data.List.Split (splitOn) import Data.Maybe import System.Console.ParseArgs import System.Exit import System.IO import Text.Printf arg = [ Arg 0 Nothing Nothing (argDataRequired "corpus" ArgtypeString) "corpus in CoNLL format" ] main :: IO () main = do args ...
jsnajder/conll-corpus
src/conll-filter.hs
Haskell
bsd-3-clause
508
-- | Changes to alex's grammar: -- -- * All sets include their unicode equivalents by default -- -- * @%language MultiParamTypeClasses@ to allow language extensions in code fragments -- -- * The @%wrapper@ directive doesn\'t make sense any more and so is removed -- -- * Since it is parsed by TH, some fixities in code f...
ekmett/luthor
Text/Luthor/Parser.hs
Haskell
bsd-3-clause
13,475
module SpatulaStart where import Rumpus start :: Start start entityID = do chan <- traverseM (use (wldComponents . myPdPatch . at entityID)) $ \patch -> do pd <- view wlsPd toDyn <$> makeReceiveChan pd (local patch "freq") return chan
lukexi/rumpus
util/DevScenes/scenes-old/spatula/SpatulaStart.hs
Haskell
bsd-3-clause
260
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Semigroup ((<>)) import qualified Data.Text as Text import qualified Data.Text.IO as Text import Options.Applicative import System.Environment (getEnvironment) import qualified Web.JWT as J...
channable/icepeak
server/app/IcepeakTokenGen/Main.hs
Haskell
bsd-3-clause
3,623
-- | Provides definitions of associated Legendre functions used in spherical harmonic models. module Math.SphericalHarmonics.AssociatedLegendre ( associatedLegendreFunction , schmidtSemiNormalizedAssociatedLegendreFunction ) where import Data.Poly (VPoly, eval, deriv) import Data.Poly.Orthogonal (legendre) import Da...
dmcclean/igrf
src/Math/SphericalHarmonics/AssociatedLegendre.hs
Haskell
bsd-3-clause
2,251
module Main where import Data.Sequence as S import Data.List import Data.Foldable import System.IO import Prelude as P import qualified Data.Text as T import Control.Lens import Types import MeshGenerator import Linear import FractalSurface import MarchingCubes sphere :: V3 Double -> Double sphere v = norm v - 1.0 ...
zobot/MeshGenerator
src/Main.hs
Haskell
bsd-3-clause
3,113
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Puzzles.Euler185 -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for Data.SBV.Examples.Puzzles.Euler185 ------------...
josefs/sbv
SBVTestSuite/TestSuite/Puzzles/Euler185.hs
Haskell
bsd-3-clause
640
module FizzBuzzKata.Day2 (fizzbuzz) where fizzbuzz :: [Int] -> [String] fizzbuzz [] = [] fizzbuzz (n:ns) | isFizz n && isBuzz n = "fizz!buzz!" : fizzbuzz ns | isFizz n = "fizz!" : fizzbuzz ns | isBuzz n = "buzz!" : fizzbuzz ns | otherwise = show n :...
Alex-Diez/haskell-tdd-kata
old-katas/src/FizzBuzzKata/Day2.hs
Haskell
bsd-3-clause
648
module Wholemeal where fun1 :: [Integer] -> Integer fun1 = product . map (\x -> x - 2) . filter even fun2 :: Integer -> Integer fun2 1 = 0 fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1) fun3 :: Integer -> Integer fun3 = sum . filter even . takeWhile (>1) . iterate (\x ...
richard12511/bobs-orders
app/Wholemeal.hs
Haskell
bsd-3-clause
466
{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module Finance.Exchange.OrderBook ( OrderBook ...
schernichkin/exchange
src/Finance/Exchange/OrderBook.hs
Haskell
bsd-3-clause
13,633
{-# LANGUAGE TemplateHaskell #-} module RRTTest (tests) where import Test.Framework import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.Framework.TH (testGroupGenerator) import Test.QuickCheck.Property ((==>)) import Data.MetricSpace import Data.RRT tests :: Test tests = $(testGroupGenerator) ...
jdmarble/rrt
test/RRTTest.hs
Haskell
bsd-3-clause
749
{-# LANGUAGE OverloadedStrings #-} module TW.CodeGen.Flow ( makeFileName, makeModule ) where import TW.Ast import TW.BuiltIn import TW.JsonRepr import Data.Monoid import System.FilePath import qualified Data.List as L import qualified Data.Text as T makeFileName :: ModuleName -> FilePath makeFileName (Module...
agrafix/typed-wire
src/TW/CodeGen/Flow.hs
Haskell
mit
3,368
square :: (Num a) => a -> a square n = n * n isDivisor :: (Integral a) => a -> a -> Bool isDivisor a b = b `mod` a == 0 findDivisor :: (Integral a) => a -> a -> a findDivisor divisor n | square divisor > n = n | isDivisor divisor n = divisor | otherwise = findDivisor (divisor + 1) n smal...
slideclick/sicp-examples
chapters/1/1.2.6/smallest-divisor.hs
Haskell
mit
486
factorial :: Integer -> Integer factorial 0 = 1 factorial n = n * factorial (n - 1)
Sergey-Pravdyukov/Homeworks
term4/hw1/1/1.hs
Haskell
mit
83
{-# LANGUAGE ViewPatterns #-} -- | Specification of Pos.Chain.Lrc.OBFT (which is basically a pure -- version of 'Pos.DB.Lrc.OBFT'). module Test.Pos.Chain.Lrc.ObftRoundRobinSpec ( spec ) where import Universum hiding (sort) import Data.List.NonEmpty (sort, (!!)) import Tes...
input-output-hk/pos-haskell-prototype
chain/test/Test/Pos/Chain/Lrc/ObftRoundRobinSpec.hs
Haskell
mit
2,466
-- -- -- ----------------- -- Exercise 4.23. ----------------- -- -- -- module E'4'23 where import Test.QuickCheck ( quickCheck ) -- Subsection 4.5 (extended definition) ... regions' :: Integer -> Integer regions' n | n < 0 = 0 | n == 0 = 1 | otherwise = regions' ( n - 1 ) + n -- Subsect...
pascal-knodel/haskell-craft
_/links/E'4'23.hs
Haskell
mit
924
{-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.DockerParser where import Data.Char import Data.List (intercalate) import qualified Data.Text as T import Distribution.Version (anyVersion) import Options.Applica...
MichielDerhaeg/stack
src/Stack/Options/DockerParser.hs
Haskell
bsd-3-clause
6,868
{-# LANGUAGE Haskell2010, OverloadedStrings #-} {-# LINE 1 "Network/Wai/EventSource.hs" #-} {-| A WAI adapter to the HTML5 Server-Sent Events API. -} module Network.Wai.EventSource ( ServerEvent(..), eventSourceAppChan, eventSourceAppIO ) where import Data.Function (fix) import ...
phischu/fragnix
tests/packages/scotty/Network.Wai.EventSource.hs
Haskell
bsd-3-clause
1,337
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ro-RO"> <title>Requester</title> <maps> <homeID>requester</homeID> <mapref location="ma...
kingthorin/zap-extensions
addOns/requester/src/main/javahelp/help_ro_RO/helpset_ro_RO.hs
Haskell
apache-2.0
960
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} -- | Versions for packages. module Stack.Types.Version (Version ,Cabal...
CRogers/stack
src/Stack/Types/Version.hs
Haskell
bsd-3-clause
6,337
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Stack.FileWatch ( fileWatch , printExceptionStderr ) where import Blaze.ByteString.Builder (toLazyByteString, copyByteString) import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.Async (race_) import Control....
CRogers/stack
src/Stack/FileWatch.hs
Haskell
bsd-3-clause
3,671
import Control.Concurrent import Control.Exception -- check that async exceptions are restored to their previous -- state after an exception is raised and handled. main = do main_thread <- myThreadId m1 <- newEmptyMVar m2 <- newEmptyMVar m3 <- newEmptyMVar forkIO (do takeMVar m1 throwTo main_th...
urbanslug/ghc
testsuite/tests/concurrent/should_run/conc017a.hs
Haskell
bsd-3-clause
1,238
{-# LANGUAGE ForeignFunctionInterface #-} module Main where -- Test for #1648 import Foreign import Data.Int import Data.Word f :: Int64 -> IO Int64 f x = return $ x + 1 g :: Word64 -> IO Word64 g x = return $ x + 2 type WCall = Word64 -> IO Word64 foreign import ccall "wrapper" mkWCall :: WCall -> IO (FunPtr WCal...
tibbe/ghc
testsuite/tests/ffi/should_run/ffi019.hs
Haskell
bsd-3-clause
645
{-# OPTIONS_GHC -fdefer-type-errors #-} module Main where data Foo = MkFoo data Bar = MkBar Foo deriving Show main = do { print True; print (MkBar MkFoo) }
siddhanathan/ghc
testsuite/tests/deriving/should_run/T9576.hs
Haskell
bsd-3-clause
160
module Main where import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) main :: IO () main = do args <- getArgs putStrLn (readExpr (args !! 0)) symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=>?@^_~#" readExpr :: String -> String readExpr input = case parse symbol "lisp" input of...
tismith/tlisp
write-yourself-a-scheme/listings/listing3.1.hs
Haskell
mit
394
{-# LANGUAGE OverloadedStrings #-} module WordProblem (answer) where import Data.Text (pack) import Data.List (foldl') import Control.Applicative -- (pure, (<|>), (<$>), (<*>), (<*), (*>)) import Data.Attoparsec.Text ( Parser, signed, decimal, space, maybeResult, parse, many' ) import Prelude answerParser :: Parser ...
stevejb71/xhaskell
wordy/example.hs
Haskell
mit
836
-- Copyright 2017 Maximilian Huber <oss@maximilian-huber.de> -- SPDX-License-Identifier: MIT {-# OPTIONS_GHC -W -fwarn-unused-imports -fno-warn-missing-signatures #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} module XMonad.MyConfig ( runMyConfig , composeMyConfig ) where import Syste...
maximilianhuber/myconfig
xmonad/lib/XMonad/MyConfig.hs
Haskell
mit
1,920
module Symmath.Functiontable where import Text.Printf import Text.PrettyPrint import qualified Data.Map.Strict as M import Symmath.Terms import Symmath.Eval data FuncValue = Value Double | Undefined instance Show FuncValue where show (Value n) = show n show Undefined = "undef" -- Use show on the returned...
Spheniscida/symmath
Symmath/Functiontable.hs
Haskell
mit
2,477
-- Countdown example from chapter 11 of Programming in Haskell, -- Graham Hutton, Cambridge University Press, 2007. With help -- from chapter 20 of Pearls of Functional Algorithm Design, -- Richard Bird, Cambridge University Press, 2010. import System.CPUTime import Numeric import System.IO -- Expressions -- -----...
anwb/fp-one-on-one
lecture-10-hw.hs
Haskell
mit
8,958
module Data.DirectoryTreeSpec where import qualified Data.Aeson as AE import qualified Data.Aeson.Encode.Pretty as AE import qualified Data.ByteString.Lazy.Char8 as BS import Data.Tree import Data.DirectoryTree import Data.Either (isRight) import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do de...
gust/feature-creature
legacy/lib/test/Data/DirectoryTreeSpec.hs
Haskell
mit
1,802
{-# htermination intersect :: [Ordering] -> [Ordering] -> [Ordering] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_intersect_7.hs
Haskell
mit
85
{-# LANGUAGE OverloadedStrings #-} import SMTLib1.QF_AUFBV as BV import System.Process import System.IO main :: IO () main = do let txt = show (pp script) putStrLn txt putStrLn (replicate 80 '-') -- putStrLn =<< readProcess "yices" ["-smt", "-tc"] txt putStrLn =<< readProcess "yices" ["-f"] txt ...
yav/smtLib
test/Test1.hs
Haskell
mit
641
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} module Json.UserSpec (spec) where import Data.Aeson.Lens import Lastfm import Lastfm.User import Test.Hspec import SpecHelper spec :: Spec spec = do it "getRecentStations" $ privately (getRecentStations <*> user "liblastfm" <* limit 10) `shouldH...
supki/liblastfm
test/api/Json/UserSpec.hs
Haskell
mit
4,242
{-| Module : Database.Orville.PostgreSQL.Internal.Expr.NameExpr Copyright : Flipstone Technology Partners 2016-2018 License : MIT -} {-# LANGUAGE OverloadedStrings #-} module Database.Orville.PostgreSQL.Internal.Expr.NameExpr where import Data.String import Database.Orville.PostgreSQL.Internal.MappendCompat ((<...
flipstone/orville
orville-postgresql/src/Database/Orville/PostgreSQL/Internal/Expr/NameExpr.hs
Haskell
mit
1,208
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings #-} import Text.XML.HXT.Core import Data.List import Text.HandsomeSoup import System.Random import System.Environment import Network.HTTP.Base import System.Process import Network.HTTP.Enumerator import Network.HTTP.Types (methodPost) import qualified Data.ByteS...
Okasu/randwp
RandWP.hs
Haskell
mit
1,923
module HaskHOL.Lib.CalcNum.Pre where import HaskHOL.Core hiding (base) import HaskHOL.Deductive import HaskHOL.Lib.Nums import HaskHOL.Lib.Arith import HaskHOL.Lib.WF -- Build up lookup table for numeral conversions. tmZero, tmBIT0, tmBIT1, tmM, tmN, tmP, tmAdd, tmSuc :: WFCtxt thry => HOL cls thry HOLTerm tmZero = ...
ecaustin/haskhol-math
src/HaskHOL/Lib/CalcNum/Pre.hs
Haskell
bsd-2-clause
9,511
module Main where import System.Console.CmdArgs import Application.Hoodle.Database.ProgType import Application.Hoodle.Database.Command main :: IO () main = do putStrLn "hoodle-db" param <- cmdArgs mode commandLineProcess param
wavewave/hoodle-db
exe/hoodle-db.hs
Haskell
bsd-2-clause
238
module NeighboursSpec where import Neighbours import Test.Hspec spec :: Spec spec = describe "neighbours" $ do describe "leftCell" $ do it "the left cell of a left-most cell is always dead (top)" $ do leftCell 0 0 [[1,0,0],[0,0,0],[0,0,0]] `shouldBe` 0 it "the left cell of a left-mo...
supersven/game-of-life
test/NeighboursSpec.hs
Haskell
bsd-2-clause
10,080
{-# LANGUAGE DeriveGeneric, FlexibleContexts #-} -- | The following module is responsible for general types used -- throughout the system. module Torrent ( -- * Types InfoHash , PeerId , AnnounceURL , TorrentState(..) , TorrentInfo(..) , PieceNum , PieceSize , PieceMap , Pie...
abhin4v/combinatorrent
src/Torrent.hs
Haskell
bsd-2-clause
4,565
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.APPLE.TextureRange -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabili...
haskell-opengl/OpenGLRaw
src/Graphics/GL/APPLE/TextureRange.hs
Haskell
bsd-3-clause
956
import Data.Binary (decode) import Data.Binary.Put (putWord16host, runPut) import Data.Word (Word8) littleEndian :: Bool littleEndian = (decode . runPut $ putWord16host 42 :: Word8) == 42 main :: IO () main | littleEndian = putStrLn "LittleEndian" | otherwise = putStrLn "BigEndian"
nikai3d/ce-challenges
moderate/endian.hs
Haskell
bsd-3-clause
293
module Monad.Free where import qualified Prelude as P import Data.Constraint import Data.Proxy import Data.Tagged import Category import Functor import Coproduct import Monad import NatTr import NatTr.Coproduct data Free f a where Free :: FMap f (Free f a) -> Free f a Pure :: EndoFunctorOf f (->) => a -> Fre...
ian-mi/extended-categories
Monad/Free.hs
Haskell
bsd-3-clause
1,560
{-# LANGUAGE NoMonomorphismRestriction #-} module Main (main) where import Test.QuickCheck import Test.Framework (Test, defaultMain, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.XBeeTestSupport import Data.Word import Data.ByteString (ByteString,pack,unpack) import qualified Data...
msiegenthaler/haskell-xbee
test/CommandTest.hs
Haskell
bsd-3-clause
9,904
-- Shake Generator for wiki pages {-# LANGUAGE CPP #-} module Main where import Prelude hiding ((*>)) import Control.Concurrent import Data.Char import qualified Data.List as L import Development.Shake hiding (doesFileExist) imp...
ku-fpg/blank-canvas
wiki-suite/Main.hs
Haskell
bsd-3-clause
10,241
-- Copyright 2019 Google LLC -- -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE file or at -- https://developers.google.com/open-source/licenses/bsd {-# LANGUAGE CPP #-} module GHC.SourceGen.Type.Internal where import GHC.Hs (GhcPs) #if MIN_VERSION_ghc(9,0,0) import ...
google/ghc-source-gen
src/GHC/SourceGen/Type/Internal.hs
Haskell
bsd-3-clause
2,294
module Language.Haskell.GhcMod.Boot where import Control.Applicative ((<$>)) import CoreMonad (liftIO, liftIO) import Language.Haskell.GhcMod.Browse import Language.Haskell.GhcMod.Flag import Language.Haskell.GhcMod.Lang import Language.Haskell.GhcMod.List import Language.Haskell.GhcMod.Monad import Language.Haskell.G...
darthdeus/ghc-mod-ng
Language/Haskell/GhcMod/Boot.hs
Haskell
bsd-3-clause
974
{-# LANGUAGE TypeFamilies, TypeOperators #-} ------------------------------------------------------------------------------------------- -- | -- Module : Control.Category.Object -- Copyright: 2010-2012 Edward Kmett -- License : BSD -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Po...
ekmett/categories
old/src/Control/Categorical/Object.hs
Haskell
bsd-3-clause
1,318
import Test.Cabal.Prelude main = cabalTest $ do expectBroken 4477 $ do cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World"
mydaum/cabal
cabal-testsuite/PackageTests/NewBuild/T4477/cabal.test.hs
Haskell
bsd-3-clause
147
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImplicitParams #-} module MLModules where import Prelude hiding (Monoid) -- We can represent a module dependencies with our fake modules! -- This means submodules! -- -- The only thing is I cannot have...
sleexyz/haskell-fun
MLModulesSubmodule.hs
Haskell
bsd-3-clause
794
module PackageTests.Tests(tests) where import PackageTests.PackageTester import qualified PackageTests.BenchmarkStanza.Check import qualified PackageTests.TestStanza.Check import qualified PackageTests.DeterministicAr.Check import qualified PackageTests.TestSuiteTests.ExeV10.Check import Control.Monad import Data.V...
lukexi/cabal
Cabal/tests/PackageTests/Tests.hs
Haskell
bsd-3-clause
9,655
-- | -- Support for source code annotation feature of GHC. That is the ANN pragma. -- -- (c) The University of Glasgow 2006 -- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -- module Annotations ( -- * Main Annotation data types Annotation(..), AnnTarget(..), CoreAnnTarget, ...
nomeata/ghc
compiler/main/Annotations.hs
Haskell
bsd-3-clause
4,023
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS -fno-warn-orphans #-} module PropGenerators ( arbitraryPropWithVarsAndSize , arbitraryPropWithVars , boundShrinkProp ) where import PropositionalPrelude import Prop import Test.QuickCheck (Arbitrary, arbitrary, shrink, Gen, on...
bradlarsen/hs-cudd
test/PropGenerators.hs
Haskell
bsd-3-clause
3,517
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Numeral.KO.Tests ( tests ) where import Prelude import Data.String import Test.Tasty import D...
facebookincubator/duckling
tests/Duckling/Numeral/KO/Tests.hs
Haskell
bsd-3-clause
504
#!/usr/local/bin/runhaskell {-# LANGUAGE DeriveDataTypeable #-} import Text.Hastache import Text.Hastache.Context import qualified Data.Text.Lazy.IO as TL import Data.Data import Data.Generics main = hastacheStr defaultConfig (encodeStr template) context >>= TL.putStrLn -- begin example data Book = Book { t...
lymar/hastache
examples/genericsBig.hs
Haskell
bsd-3-clause
1,235
module Main where import Scraper import Formatter import System.Environment (getArgs) import Data.Maybe import Text.HTML.Scalpel import Control.Monad (when) import Data.List import System.Console.ParseArgs run :: String -> String -> IO() run outputpath uri = do putStrLn "Scraping..." maybeitems <- scrapeURL u...
tsukimizake/haddock2anki
app/Main.hs
Haskell
bsd-3-clause
891
{-# OPTIONS_GHC -Wall #-} module Main where import Data.Proxy import OfflinePlay import qualified Punter.Connector as Connector main :: IO () main = runPunterOffline (Proxy :: Proxy Connector.Punter)
nobsun/icfpc2017
hs/app/connector.hs
Haskell
bsd-3-clause
202
import TestDatas (int1, stringHello) import Test.QuickCheck.Simple (Test, boolTest, qcTest, defaultMain) main :: IO () main = defaultMain tests prop_int1 :: Bool prop_int1 = int1 == 1 prop_stringHello :: Bool prop_stringHello = stringHello == "Hello 2017-01-02 12:34:56" prop_show_read :: Int -> Bool prop_show_r...
khibino/travis-ci-haskell
pkg-a/tests/useQuickCheckSimple.hs
Haskell
bsd-3-clause
531
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TupleSections #-} {-| HAProxy proxying pro...
23Skidoo/io-streams-haproxy
src/System/IO/Streams/Network/HAProxy.hs
Haskell
bsd-3-clause
14,487
module CNC.IntegrationTests where import CNC.Declarative import CNC.HCode import Data.Complex import Control.Monad flake_side = do [p1,p2,p3,p4,p5] <- declarePoints 5 xSize p1 p2 1 len p2 p3 1 len p3 p4 1 xAngle p2 p3 (pi / 3) xAngle p3 p4 (- pi / 3) xSize p4 p5 1 renderPolygon :: Int -> Path -> HCode...
akamaus/gcodec
test/CNC/IntegrationTests.hs
Haskell
bsd-3-clause
777
{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE ViewPatterns #-} module EZConfig (spec) where import Control.Arrow (first, (>>>)) import Data.Coerce import Foreign....
xmonad/xmonad-contrib
tests/EZConfig.hs
Haskell
bsd-3-clause
3,567
module Wow1 where import Haskore.Melody import Haskore.Music as M import Haskore.Basic.Duration as D import Haskore.Basic.Duration import Snippet import Prelude as P import Haskore.Music.GeneralMIDI import Haskore.Basic.Interval flute_base = [ cs 1 qn, fs 1 qn, fs 1 en, e 1 en, fs 1 hn, fs 1 en, gs 1 en ] flute_...
nfjinjing/haskore-guide
src/wow_1.hs
Haskell
bsd-3-clause
806
{-# language CPP #-} -- | = Name -- -- XR_MSFT_unbounded_reference_space - instance extension -- -- = Specification -- -- See -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_unbounded_reference_space XR_MSFT_unbounded_reference_space> -- in the main specification for complete information...
expipiplus1/vulkan
openxr/src/OpenXR/Extensions/XR_MSFT_unbounded_reference_space.hs
Haskell
bsd-3-clause
2,016
module Libv10 ( main' ) where -- v10 : Fill in the division team mapping and other data import Control.Monad import qualified Data.Map.Strict as Map import Data.List import Data.Maybe import Data.Ord import System.Environment import Text.Parsec import Text.Parsec.String import Text.Printf -- data ---------------...
mfine/hs-talks
src/Libv10.hs
Haskell
bsd-3-clause
5,032
{-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} ------------------------------------------------------...
csabahruska/GFXDemo
Thrift/Content_Consts.hs
Haskell
bsd-3-clause
1,066
-- | -- Module : $Header$ -- Copyright : (c) 2013-2015 Galois, Inc. -- License : BSD3 -- Maintainer : cryptol@galois.com -- Stability : provisional -- Portability : portable {-# LANGUAGE Safe #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternGuards #-} modul...
ntc2/cryptol
src/Cryptol/TypeCheck/Solver/CrySAT.hs
Haskell
bsd-3-clause
21,839
module GHCJS.DOM.HTMLInputElement where data HTMLInputElement = HTMLInputElement class IsHTMLInputElement a instance IsHTMLInputElement HTMLInputElement ghcjs_dom_html_input_element_step_up = undefined htmlInputElementStepUp = undefined ghcjs_dom_html_input_element_step_down = undefined htmlInputElementStepDown = und...
mightybyte/reflex-dom-stubs
src/GHCJS/DOM/HTMLInputElement.hs
Haskell
bsd-3-clause
8,767
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Web.Spock.Api.Client (callEndpoint,...
agrafix/Spock
Spock-api-ghcjs/src/Web/Spock/Api/Client.hs
Haskell
bsd-3-clause
3,862
-------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.IBM.MultimodeDrawArrays -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- ----------...
haskell-opengl/OpenGLRaw
src/Graphics/GL/IBM/MultimodeDrawArrays.hs
Haskell
bsd-3-clause
676
{-# LANGUAGE CPP #-} {-# LANGUAGE UnicodeSyntax #-} module Shake.It.C.Make ( make , configure , nmake , vcshell ) where import Control.Monad import Shake.It.Core import System.Environment configure ∷ [String] → IO () configure α = rawSystem "configure" α >>= checkExi...
Heather/Shake.it.off
src/Shake/It/C/Make.hs
Haskell
bsd-3-clause
938
{-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------- -- | -- Module : Generator.Primer.Modern -- Copyright : (c) 2016 Michael Carpenter -- License : BSD3 -- Maintainer : Michael Carpenter <oldmanmike.dev@gmail.com> -- Stability : experimen...
oldmanmike/hs-minecraft-protocol
generate/src/Generator/Primer/Modern.hs
Haskell
bsd-3-clause
2,953
{-# LANGUAGE DataKinds, PolyKinds, TypeFamilies, TypeOperators, OverloadedStrings #-} module Database.Edis.Command.Hash where import Database.Edis.Type import Database.Edis.Helper import Data.ByteString (ByteString) import Data.Proxy (Proxy) import Data.Serialize (Serialize, encode) ...
banacorn/tredis
src/Database/Edis/Command/Hash.hs
Haskell
mit
2,619
{-# LANGUAGE RecordWildCards, ViewPatterns, TupleSections, PatternGuards #-} module General.Log( Log, logCreate, logNone, logAddMessage, logAddEntry, Summary(..), logSummary, ) where import Control.Concurrent.Extra import Control.Applicative import System.IO import Data.Time.Calendar import Data.Time.Cloc...
BartAdv/hoogle
src/General/Log.hs
Haskell
bsd-3-clause
4,539
{-# LANGUAGE BangPatterns #-} -- A simple wc-like program using Data.Iteratee. -- Demonstrates a few different ways of composing iteratees. module Main where import Prelude as P import Data.Iteratee import Data.Iteratee.Char as C import qualified Data.Iteratee as I import qualified Data.ByteString.Char8 as BC import ...
iteloo/tsuru-sample
iteratee-0.8.9.6/Examples/word.hs
Haskell
bsd-3-clause
1,862
{-# LANGUAGE ScopedTypeVariables #-} module Main where import GHC.Conc import Control.Exception -- Create trivial invariants using a single TVar main = do putStr "\nStarting\n" x <- atomically ( newTVar 42 ) putStr "\nAdding trivially true invariant (no TVar access)\n" atomically ( alwaysSucceeds ( return 1 ...
gridaphobe/packages-stm
tests/stm060.hs
Haskell
bsd-3-clause
2,923
{-# LANGUAGE ParallelListComp, BangPatterns #-} import Solver import Graphics.Gloss import System.Environment import Data.Maybe import qualified Data.Vector as V import qualified Data.Vector.Unboxed as VU main :: IO () main = do args <- getArgs mainWithArgs args ...
mainland/dph
dph-examples/examples/spectral/Rotation/MainGloss.hs
Haskell
bsd-3-clause
1,901
{-# LANGUAGE Haskell98, CPP, DeriveDataTypeable, ForeignFunctionInterface, TypeSynonymInstances #-} {-# LINE 1 "dist/dist-sandbox-261cd265/build/Network/Socket.hs" #-} {-# LINE 1 "Network/Socket.hsc" #-} {-# LANGUAGE CPP, ScopedTypeVariables #-} {-# LINE 2 "Network/So...
phischu/fragnix
tests/packages/scotty/Network.Socket.hs
Haskell
bsd-3-clause
60,647
{-# LANGUAGE BangPatterns, DeriveDataTypeable, RecordWildCards #-} -- | -- Module : Criterion.Analysis -- Copyright : (c) 2009-2014 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : GHC -- -- Analysis code for benchmarks. module Cri...
paulolieuthier/criterion
Criterion/Analysis.hs
Haskell
bsd-2-clause
9,668
{-# LANGUAGE DeriveDataTypeable #-} module Main ( main ) where import Test.Tasty import Test.Tasty.Options import Data.Proxy import Data.Typeable import Distribution.Simple.Utils import Distribution.Verbosity import Distribution.Compat.Time import qualified UnitTests.Distribution.Compat.CreatePipe import qu...
thomie/cabal
Cabal/tests/UnitTests.hs
Haskell
bsd-3-clause
2,833
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE BangPatterns, NoImplicitPrelude #-} -- Copyright (c) 2008, Ralf Hinze -- 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 ...
snoyberg/ghc
libraries/base/GHC/Event/PSQ.hs
Haskell
bsd-3-clause
18,113
module AmortizedQueue where import Prelude hiding (head) data AbsQueue a = AQ { front :: [a] , rear :: [a] } {-@ data AbsQueue a = AQ { front :: [a] , rear :: {v:[a] | size v <= size front} } @-} {-@ die :: {v:String | false} -> a @-} die :: String -> a die x = error...
abakst/liquidhaskell
tests/todo/AmortizedQueue.hs
Haskell
bsd-3-clause
4,228
{-# LANGUAGE CPP, TupleSections #-} {-# OPTIONS_GHC -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- Static flags -- -- Static flags can only be set once, on the command-line. Inside GHC, -- each static flag corr...
acowley/ghc
compiler/main/StaticFlags.hs
Haskell
bsd-3-clause
7,834
module Utilities (toBinary, fl) where import Stream import Data.Ratio -- Convert from an Integer to its signed-digit representation toBinary :: Integer -> Stream toBinary 0 = [0] toBinary x = toBinary t ++ [x `mod` 2] where t = x `div` 2 fl :: Stream -> Stream fl (x:xs) = (f x):xs where f 0 = 1 ...
ryantm/ghc
testsuite/tests/concurrent/prog001/Utilities.hs
Haskell
bsd-3-clause
328
{-# LANGUAGE OverloadedStrings #-} {-| Module : Examples.AllPrimitives Description : Predefined network: allPrimitives. Copyright : (c) Sanne Woude 2015 Predefined network: allPrimitives. -} module Examples.AllPrimitives (allPrimitives) where import Madl.Network import Examples.TypesAndFunctions import Utils...
julienschmaltz/madl
examples/Examples/AllPrimitives.hs
Haskell
mit
2,842
-- Peano numbers -- https://www.codewars.com/kata/5779b0f0ec883247b2000117 module Haskell.Codewars.Peano where import Prelude hiding (even, odd, div, compare, Num, Int, Integer, Float, Double, Rational, Word) data Peano = Zero | Succ Peano deriving (Eq, Show) add, sub, mul, div :: Peano -> Peano -> Peano add p1 Zer...
gafiatulin/codewars
src/5 kyu/Peano.hs
Haskell
mit
1,014
module Language.Rebeca.Fold.Erlang.Simulation where import Control.Monad.Reader import Control.Monad.State import Language.Fold import Language.Erlang.Builder import Language.Erlang.Syntax import qualified Language.Rebeca.Absrebeca as R import Language.Rebeca.Algebra import Language.Rebeca.Fold import Language.Rebeca...
arnihermann/timedreb2erl
src/Language/Rebeca/Fold/Erlang/Simulation.hs
Haskell
mit
4,296
-- | Options/Parsing module Vaultaire.Collector.Nagios.Perfdata.Options where import Vaultaire.Collector.Nagios.Perfdata.Types import Options.Applicative parseOptions :: IO NagiosOptions parseOptions = execParser optionParser -- | Parser which include all help info optionParser :: ParserInfo Na...
anchor/vaultaire-collector-nagios
lib/Vaultaire/Collector/Nagios/Perfdata/Options.hs
Haskell
mit
2,266
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.WebKitCSSViewportRule (js_getStyle, getStyle, WebKitCSSViewportRule, castToWebKitCSSViewportRule, gTypeWebKitCSSViewportRule) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, D...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/WebKitCSSViewportRule.hs
Haskell
mit
1,467
{-# htermination transpose :: [[a]] -> [[a]] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_transpose_1.hs
Haskell
mit
61
{-# LANGUAGE LambdaCase #-} module Language.Bison.Summary.Parser ( parseRules ) where import Language.Bison.Summary.Parser.Lexer import Language.Bison.Summary.Syntax import Text.Parsec import Text.Parsec.Prim import Text.Parsec.Pos import Text.Parsec.Error import Control.Applicative hiding ((<|>), optio...
gergoerdi/bison-parser
src/Language/Bison/Summary/Parser.hs
Haskell
mit
2,509
import Text.ParserCombinators.Parsec import qualified Data.Map as M import Text.Parsec.Error (messageString, errorMessages) import Data.Text (pack, unpack, strip) import Data.Monoid type TextLine = String type Name = String data ActionType = FoulCommit | GenericAction String | ActionTy...
ddccffvv/fun-with-haskell
belgie_parser.hs
Haskell
mit
5,711