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 |
|---|---|---|---|---|---|
{-# LANGUAGE TemplateHaskell #-}
module Client.MenuLayerT where
import Control.Lens (makeLenses)
import Types
makeLenses ''MenuLayerT
newMenuLayerT :: MenuLayerT
newMenuLayerT = MenuLayerT
{ _mlDraw = Nothing
, _mlKey = Nothing
}
| ksaveljev/hake-2 | src/Client/MenuLayerT.hs | Haskell | bsd-3-clause | 267 |
module Proper.TestUtils(testFunction) where
import Test.HUnit
testFunction func cases = runTestTT $ makeTestCases func cases
makeTestCases func cases =
TestList $ map (\(input, expected) -> testCase func input expected) cases
testCase func input expected =
TestCase (assertEqual ("Input: " ++ show input) expecte... | dillonhuff/Proper | test/Proper/TestUtils.hs | Haskell | bsd-3-clause | 335 |
main :: IO ()
main = putStrLn "Test suite not yet implemented."
| denibertovic/watcher | test/Spec.hs | Haskell | bsd-3-clause | 64 |
import Intake.Core
import Intake.Job
import System.Exit
main = defaultMain'
[
-- Run `intake run a` and capture its output as SHORT_ID and ID.
defaultJob
{ jobCommand = "./dist/build/intake/intake"
, jobArguments = words "run a"
, jobStderr = Just ""
, jobStdout = Just "{{SHORT_ID}} {{ID}}\n"
}
-- Wa... | noteed/intake | tests/intake-run-00.hs | Haskell | bsd-3-clause | 1,024 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE ParallelListComp #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
-- | Definition of the MonetDB5/SQL backend for DSH: SQL code generation a... | ulricha/dsh-sql | src/Database/DSH/Backend/Sql/M5.hs | Haskell | bsd-3-clause | 1,237 |
module Main where
import Test.Framework
import qualified TestTerm
import qualified TestTheta
import qualified TestASUP
main :: IO ()
main = defaultMain tests
tests :: [Test]
tests = [ TestTerm.tests
, TestTheta.tests
, TestASUP.tests
]
| projedi/type-inference-rank2 | tests/TestMain.hs | Haskell | bsd-3-clause | 264 |
module Arcade.Sequence
( Sequence(..)
) where
import Data.Word
-- wrapping 16 bit sequence numbers
newtype Sequence = Sequence Word16
instance Eq Sequence where
Sequence a == Sequence b = a == b
instance Ord Sequence where
compare (Sequence s1) (Sequence s2) = case compare s1 s2 of
LT | s2 - s1 <= 32768... | ekmett/arcade | src/Arcade/Sequence.hs | Haskell | bsd-3-clause | 370 |
-- Example of Container for Multiple Types
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeF... | notae/haskell-exercise | pack/Container4.hs | Haskell | bsd-3-clause | 3,207 |
module Data.Int.Dom.Common
( Mask
, mkMask
, negative
, zero
, Depth
, depth
, Prefix
, mkPrefix
) where
import Control.Monad ((<=<))
import Data.Bits
import Data.Function (on)
import Data.Functor ((<$>))
import Data.Word (Word)
import Prelude hiding (in... | sonyandy/fd | src/Data/Int/Dom/Common.hs | Haskell | bsd-3-clause | 1,456 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Pack2 where
import Control.Applicative... | notae/haskell-exercise | pack/Pack2.hs | Haskell | bsd-3-clause | 5,650 |
-- example2
import Data.IORef
import Control.Applicative
import Control.Monad
import Control.Exception (SomeException)
import qualified Control.Exception as E
import Control.Concurrent (threadDelay)
import System.IO.Unsafe (unsafePerformIO)
import System.Timeout (timeout)
{-# NOINLINE numHandles #-}
numHandles :: IO... | Yuras/io-region | misc/imask/example2.hs | Haskell | bsd-3-clause | 1,794 |
module PrettyPrinter where
import Syntax
import Text.PrettyPrint
pprExpr :: CoreExpr -> Doc
pprExpr (ENum n) = int n
pprExpr (EVar v) = text v
pprExpr (EBinApp binOp e1 e2)
= hcat
[ pprExpr e1 <+> text (show binOp) <+> pprExpr e2]
pprExpr (ECase e alts) = empty --TODO
pprExpr (EConstr n1 n2) = empty -... | MarkX95/TinyHask | PrettyPrinter.hs | Haskell | bsd-3-clause | 1,145 |
module Network.TigHTTP.Token (
isTokenChar,
isTextChar,
isQdtextChar,
) where
import Data.Char (isAscii)
isCtl, isSeparator, isTokenChar, isTextChar, isQdtextChar :: Char -> Bool
isCtl = (`elem` (['\0' .. '\31'] ++ "\DEL"))
isSeparator = (`elem` "()<>@,;:\\\"/[]?={} \t")
isTokenChar = (&&) <$> not . isCtl <*> n... | YoshikuniJujo/tighttp | src/Network/TigHTTP/Token.hs | Haskell | bsd-3-clause | 433 |
-- | Render an abstract shell script as a bash script
module Shell.Formatter.Bash (
runBash,
bashFormatter
) where
import qualified Text.PrettyPrint.Mainland as PP
import qualified Shell.Diagnostic as D
import qualified Shell.Formatter.Base as F
import qualified Shell.Internal as I
import qualified Shell.Optimi... | travitch/shellDSL | src/Shell/Formatter/Bash.hs | Haskell | bsd-3-clause | 1,071 |
module Trainer.Internal where
boxMueller :: Double -> Double -> Double -> Double -> Double
boxMueller μ σ r1 r2 = μ + σ * sqrt (-2*log r1) * cos (2*pi*r2)
positiveStdNormal :: Double -> Double -> Double -> Double
positiveStdNormal hi r1 r2 = min hi (abs bm)
where bm = boxMueller 0 (hi/25) r... | epsilonhalbe/VocabuLambda | Trainer/Internal.hs | Haskell | bsd-3-clause | 330 |
------------------------------------------------------------------------------
-- |
-- Module : Data.Datamining.Clustering.Gsom
-- Copyright : (c) 2009 Stephan Günther
-- License : BSD3
--
-- Maintainer : gnn.github@gmail.com
-- Stability : experimental
-- Portability : portable
--
-- The network cr... | gnn/hsgsom | Data/Datamining/Clustering/Gsom/coordinates.hs | Haskell | bsd-3-clause | 1,733 |
{-# LANGUAGE PatternGuards #-}
-- |
-- Module : Scion.Types.Notes
-- Copyright : (c) Thomas Schilling 2009
-- License : BSD-style
--
-- Maintainer : nominolo@googlemail.com
-- Stability : experimental
-- Portability : portable
--
-- Notes, i.e., warnings, errors, etc.
--
module Scion.Types.Notes
( Locat... | nominolo/scion | lib/Scion/Types/Notes.hs | Haskell | bsd-3-clause | 8,890 |
--------------------------------------------------------------------------------
--
-- Copyright (c) 2011 - 2014 Tad Doxsee
-- All rights reserved.
--
-- Author: Tad Doxsee
--
--------------------------------------------------------------------------------
module Main where
import RegTesterLib (CmdMaker, regTester... | tdox/regTester | src/regTester2.hs | Haskell | bsd-3-clause | 500 |
{-# LANGUAGE RecordWildCards #-}
-- Chi square tests for random generators
module MWC.ChiSquare (
tests
) where
import Control.Applicative
import Control.Monad
import Data.Typeable
import Data.Word
import Data.List (find)
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.... | bos/mwc-random | mwc-random-bench/test/MWC/ChiSquare.hs | Haskell | bsd-2-clause | 5,175 |
{-# LANGUAGE TypeOperators, GADTs, KindSignatures, ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts, PatternGuards, ViewPatterns, ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wall #-}
-- {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- TEMP
-- {-# OPTIONS_GHC -fno-warn-unused-binds #-} -- TEMP
----... | conal/lambda-ccc | src/LambdaCCC/Unused/ToCircuit.hs | Haskell | bsd-3-clause | 4,036 |
{-# LANGUAGE TypeFamilies, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, RankNTypes, GADTs, ScopedTypeVariables, FunctionalDependencies, RecursiveDo, UndecidableInstances, GeneralizedNewtypeDeriving, StandaloneDeriving, EmptyDataDecls, NoMonomorphismRestriction, TypeOperators, DeriveDataTypeable, PackageI... | k0001/reflex | src/Reflex/Dynamic.hs | Haskell | bsd-3-clause | 22,941 |
import qualified Data.Text.IO as T
import qualified Data.Text as T
import qualified Data.Text.Lazy.IO as TL
import qualified Data.Text.Lazy as TL
import Pipes
import qualified Pipes.Text as TP
import qualified Pipes.ByteString as BP
import Pipes.Safe
main = textaction
big = "../../examples/txt/words2.txt"
textaction... | bitemyapp/text-pipes | bench/IO.hs | Haskell | bsd-3-clause | 441 |
{-# LANGUAGE GADTs #-}
module Syntax.Tree where
--------------------------------------------------------------------------------
-- Identifiers
--------------------------------------------------------------------------------
type Identifier = String
type SnakeId = Identifier
type CamelId = Identifier
-- Used ... | BakerSmithA/Turing | src/Syntax/Tree.hs | Haskell | bsd-3-clause | 5,552 |
import Control.Monad as CM(forM,filterM)
yes = flip mapM | bitemyapp/apply-refact | tests/examples/Default123.hs | Haskell | bsd-3-clause | 57 |
module B2 where
data Data1 a
= C1 a Int Int | C4 Float | C2 Int | C3 Float
addedC4 = error "added C4 Float to Data1"
g (C1 x y z) (C1 n m o) = y + m
g (C4 a) b = addedC4
g a (C4 b) = addedC4
g (C2 x) (C2 y) = x - y
g (C3 x) (C3 k) = 42
| kmate/HaRe | old/testing/addCon/B2AST.hs | Haskell | bsd-3-clause | 245 |
module Syntax (module S) where
import BaseSyntax as S
import SyntaxRec as S
import SyntaxRecPretty as S
| forste/haReFork | tools/base/syntax/Syntax.hs | Haskell | bsd-3-clause | 106 |
module HAD.Y2014.M03.D13.Solution where
import Control.Applicative
-- | pairToList Trnsform a pair of same type elements in a list of two
-- elements.
--
-- Of course, the major challenge is to find a point free function
-- (without lambda)
--
-- prop> replicate 2 (x :: Int) == pairToList (x,x)
--
-- prop> (\(f,s) -... | 1HaskellADay/1HAD | exercises/HAD/Y2014/M03/D13/Solution.hs | Haskell | mit | 421 |
{-# LANGUAGE NoImplicitPrelude #-}
-- | Description: interpret flags parsed by "IHaskell.Flags"
module IHaskell.Convert.Args (ConvertSpec(..), fromJustConvertSpec, toConvertSpec) where
import IHaskellPrelude
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.ByteStri... | artuuge/IHaskell | src/IHaskell/Convert/Args.hs | Haskell | mit | 4,837 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1993-1998
This is useful, general stuff for the Native Code Generator.
Provide trees (of instructions), so that lists of instructions
can be appended in linear time.
-}
{-# LANGUAGE CPP #-}
module OrdList (
OrdList,
nilO... | tjakway/ghcjvm | compiler/utils/OrdList.hs | Haskell | bsd-3-clause | 3,188 |
{-# OPTIONS_GHC -Wunused-binds #-}
{-# LANGUAGE PatternSynonyms #-}
module Foo (pattern P) where
-- x is used!!
x :: Int
x = 0
pattern P :: Int
pattern P <- _ where
P = x
| ezyang/ghc | testsuite/tests/rename/should_compile/T12548.hs | Haskell | bsd-3-clause | 182 |
module TcFail209a where
g :: ((Show a, Num a), Eq a) => a -> a
g = undefined
| urbanslug/ghc | testsuite/tests/typecheck/should_fail/tcfail209a.hs | Haskell | bsd-3-clause | 78 |
module Cli.Cli (listen, prompt, say) where
listen :: IO String
listen = getLine
prompt :: (Read a) => String -> IO a
prompt s = putStr s >> getLine >>= return . read
say :: String -> IO ()
say x = putStrLn x | korczis/skull-haskell | src/Lib/Cli/Cli.hs | Haskell | mit | 211 |
-- ghci
-- :load C:\Users\Thomas\Documents\GitHub\haskell.practice\PE\Problem0016.hs
-- :r
-- :set +s
module Problem16 where
import Data.Char
twoToThePowerOf n =
2 ^ n
sumOfDigits n =
sum
$ map digitToInt
$ show n
sumOfDigitsForTwoToThePowerOf n =
sumOfDigits
$ twoToThePowerOf n
--Tes... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Implementation/Problem0016.hs | Haskell | mit | 965 |
module Euler.P002 (sumEvenFib,
sumEvenFib') where
-- Problem 2
--
-- Each new term in the Fibonacci sequence is generated by adding the previous
-- two terms. By starting with 1 and 2, the first 10 terms will be:
--
-- 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
--
-- By considering the terms in the ... | arnau/haskell-euler | src/Euler/P002.hs | Haskell | mit | 819 |
{-
Copyright (c) 2015 Nils 'bash0r' Jonsson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distr... | project-horizon/framework | src/lib/Language/PolyDSL/DOM/Expression.hs | Haskell | mit | 2,058 |
-- Enumerator and iteratee
-- ref: https://wiki.haskell.org/Enumerator_and_iteratee
-- okmij: http://okmij.org/ftp/Haskell/Iteratee/describe.pdf
-- An enumerator is something that knows how to generate a list
-- An iteratee is something that does one step in processing another piece of the big list.
-- foldl (+) 0 x... | Airtnp/Freshman_Simple_Haskell_Lib | Idioms/Enumerator-Iteratee.hs | Haskell | mit | 5,808 |
-----------------------------------------------------------------------------
-- |
-- Module : StandardLibrary
-- Copyright : (c) University of Saskatchewan 2013
--
-- Maintainer : ivan.vendrov@usask.ca
--
-- The Frabjous standard library
---------------------------------------------------------------------... | ivendrov/frabjous2 | src/Frabjous/StdLib.hs | Haskell | mit | 12,883 |
{-
Package for evaluating Scheme Expressions
-}
module Scheme.Eval (
-- module Scheme.Eval.LispError,
module Scheme.Eval.Prim,
module Scheme.Eval.EvalUtil,
module Scheme.Eval.List,
module Scheme.Eval.Comp,
module Scheme.Eval.Unpack
) where
import Text.ParserCombinators.Parsec hiding (spaces)
import ... | johnellis1392/Haskell-Scheme | Scheme/Eval/Eval.hs | Haskell | mit | 520 |
import Test.HUnit
import System.Exit
import Data.Set.Lazy
tests = TestList [basic, fizzbuzztest, infinity]
---- BASIC -----
basic = TestList [noZero, oneToTen, noEleven]
where
toTenList = [1..10]
toTenSet = fromList toTenList
noZero = TestCase $ assertBool "Zero not in there" $not (member 0 t... | happyherp/lazyset | LazySetTest.hs | Haskell | mit | 1,490 |
{-# LANGUAGE OverloadedStrings #-}
module Codex.Config where
import qualified Data.HashMap.Strict as HM
import Snap.Util.FileServe(MimeMap, defaultMimeTypes)
-- | custom mime type mapping
mimeTypes :: MimeMap
mimeTypes
= HM.union defaultMimeTypes $
HM.fromList [(".mdown", "text/markdown"),
... | pbv/codex | src/Codex/Config.hs | Haskell | mit | 452 |
-- |
-- AST traversal extracting output types.
module Hasql.TH.Extraction.OutputTypeList where
import Hasql.TH.Prelude
import PostgresqlSyntax.Ast
foldable :: Foldable f => (a -> Either Text [Typename]) -> f a -> Either Text [Typename]
foldable fn = fmap join . traverse fn . toList
preparableStmt = \case
SelectPre... | nikita-volkov/hasql-th | library/Hasql/TH/Extraction/OutputTypeList.hs | Haskell | mit | 2,245 |
{-# LANGUAGE PackageImports #-}
{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-}
-- | Reexports "Text.Read.Lex.Compat"
-- from a globally unique namespace.
module Text.Read.Lex.Compat.Repl.Batteries (
module Text.Read.Lex.Compat
) where
import "this" Text.Read.Lex.Compat
| haskell-compat/base-compat | base-compat-batteries/src/Text/Read/Lex/Compat/Repl/Batteries.hs | Haskell | mit | 294 |
module OneDim where
import Data.Bits
import CellularAutomata2D
import GUI
initSpace1D :: Int -> [a] -> Torus (Maybe a)
initSpace1D steps initialSpace1D = setCells emptySpace (zip fstRow $ map Just initialSpace1D)
where emptySpace = initSpace (steps, length initialSpace1D) (const $ Nothing)
fstRow = zip... | orion-42/cellular-automata-2d | OneDim.hs | Haskell | mit | 1,448 |
{- |
Description : Truncation of floating-point significands
Copyright : 2017 Andrew Dawson
License : Apache-2.0
Tools for truncating the number of bits in the significand of floating-point
numbers. The numbers can be represented in decimal, binary or hexadecimal.
You can create additional representations by mak... | aopp-pred/fp-truncate | src/Truncate.hs | Haskell | apache-2.0 | 7,082 |
compress :: Eq a => [a] -> [a]
compress [] = []
compress (x:xs) = compress' x xs
where
compress' x [] = [x]
compress' y (x:xs)
| y == x = compress' x xs
| otherwise = y:(compress' x xs) | alephnil/h99 | 08.hs | Haskell | apache-2.0 | 232 |
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TypeFamilies, TemplateHaskell, OverloadedStrings, InstanceSigs #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Types where
import Control.Applicative ((<$>), pure, (<*>))
import Control.Monad (forM_, mzero)
import Control.Monad.Reader (ask)
import Control.M... | passy/giflib-api | Types.hs | Haskell | apache-2.0 | 2,657 |
module Graphics.GL.Low.Common where
import Graphics.GL
import Graphics.GL.Low.Types
import Graphics.GL.Low.Cube
attachmentPointForImageFormat :: ImageFormat -> GLenum
attachmentPointForImageFormat format = case format of
RGB -> GL_COLOR_ATTACHMENT0
RGBA -> GL_COLOR_ATTACHMENT0
Alpha ... | evanrinehart/lowgl | Graphics/GL/Low/Common.hs | Haskell | bsd-2-clause | 865 |
{-# LANGUAGE TransformListComp #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Backends.Html.Decl
-- Copyright : (c) Simon Marlow 2003-2006,
-- David Waern 2006-2009,
-- Mark Lentczner 2010
-- License : B... | JPMoresmau/haddock | haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | Haskell | bsd-2-clause | 39,178 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QTcpServer_h.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:31
Warning : this file is machine generated - do ... | keera-studios/hsQt | Qtc/Network/QTcpServer_h.hs | Haskell | bsd-2-clause | 24,198 |
-- | Parser for ECMAScript 3.
{-# LANGUAGE FlexibleContexts #-}
module Language.ECMAScript3.Parser
(parse
, Parser
, expression
, statement
, program
, parseFromString
, parseFromFile
-- old and deprecated
, parseScriptFromString
, parseJavaScriptFromFile
, parseScript
, parseExpression
... | sinelaw/language-ecmascript | src/Language/ECMAScript3/Parser.hs | Haskell | bsd-3-clause | 29,230 |
{-|
Module : Idris.Error
Description : Utilities to deal with error reporting.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
module Idris.Error where
import Prelude hiding (catch)
import Idris.AbsSyntax
im... | enolan/Idris-dev | src/Idris/Error.hs | Haskell | bsd-3-clause | 6,583 |
{-# LANGUAGE GeneralizedNewtypeDeriving, TemplateHaskell,
DeriveDataTypeable, PatternGuards,
DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
-- Those extensions are required by the Uniplate instances.
--{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
module Language.LaTeX.Types... | np/hlatex | Language/LaTeX/Types.hs | Haskell | bsd-3-clause | 18,172 |
{-# LANGUAGE TypeFamilies, CPP, FlexibleInstances, FlexibleContexts, NamedFieldPuns, RecordWildCards, UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses, UnboxedTuples, StandaloneDeriving, TypeSynonymInstances #-}
{-# OPTIONS -funbox-strict-fields #-}
module Data.TrieMap.Key () where
import Data.TrieMap.Class... | lowasser/TrieMap | Data/TrieMap/Key.hs | Haskell | bsd-3-clause | 3,563 |
{-# LANGUAGE OverloadedStrings #-}
module Cauterize.Common.ParserUtils
( pSexp
, parseBuiltInName
, parseSchemaVersion
, parseFormHash
) where
import Text.Parsec
import Text.Parsec.Text.Lazy
import Cauterize.FormHash
import Cauterize.Lexer
import Control.Monad
import Data.Word
import qualified Data.Text.L... | reiddraper/cauterize | src/Cauterize/Common/ParserUtils.hs | Haskell | bsd-3-clause | 1,465 |
module Euler.E60
( concatInts
, remarkable
, remarkableSet
, addToRemarkableSet
, solve
, s
)
where
import Data.Monoid
import Data.Maybe
import Data.Numbers.Primes
solve :: Int -> Int
solve n = sum $ head $ dropWhile (\xs -> length xs < n) s
s :: [[Int]]
s = [] : concatMap (\p -> mapM... | lslah/euler | src/Euler/E60.hs | Haskell | bsd-3-clause | 985 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ViewPatterns #-}
-- | Build-specific types.
module Stack.Types.B... | robstewart57/stack | src/Stack/Types/Build.hs | Haskell | bsd-3-clause | 29,426 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.Histogram
-- Copyright : (c) Sven Panne 2002-2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability :... | hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/PixelRectangles/Histogram.hs | Haskell | bsd-3-clause | 4,803 |
-- | Module: Acme.LOLCAT
-- Copyright: (c) 2013 Antonio Nikishaev
-- License: BSD
-- Maintainer: me@lelf.lu
--
-- >>> (OH HAI I CAN HAZ ЙO? THXBYE <*> putStrLn) "LOL" == ()
-- LOL
-- True
{-# LANGUAGE Unsafe #-}
module Acme.LOLCAT.IO (OH(..),HAI(..),I(..),CAN(..),HAZ(..),
I... | llelf/acme-lolcat | Acme/LOLCAT/IO.hs | Haskell | bsd-3-clause | 711 |
module MaybeHero.World
( World
, mkWorld
, moveRoom
, currentRoom
, lookupRoom
, lookupRoomStrict
, rooms
, roomDestinations
, showCurrentInventory
) where
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import qualified Data.List as List
import qualified MaybeHero.Room as Room
import qualified M... | gtrogers/maybe-hero | src/MaybeHero/World.hs | Haskell | bsd-3-clause | 1,768 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PolyKinds #-}
{-# OPTIONS_HADDOCK not-home #-}
module Servant.API.QueryParam (QueryFlag, QueryParam, QueryParams) where
import Data.Typeable (Typeable)
import GHC.Typ... | zerobuzz/servant | servant/src/Servant/API/QueryParam.hs | Haskell | bsd-3-clause | 1,790 |
{-# LANGUAGE RecursiveDo #-}
module Main where
import Reflex
import Reflex.Gloss.Scene
import Reflex.Monad.Time
import Reflex.Animation
import Data.Foldable
import Data.Traversable
import Reflex.Monad
import Graphics.Gloss
import Widgets
foldMerge :: MonadReflex t m => a -> [Event t (a -> a)] -> m (Dynamic t a)
... | Saulzar/scribble | src/Scribble3.hs | Haskell | bsd-3-clause | 2,557 |
-- | Multipart names.
module Text.MultipartNames.MultipartName(
MultipartName,
mkMultipartName,
mkMultipartNameFromWords,
isLegalSegment,
toSegments
) where
-- import Control.Lens
import Data.CaseInsensitive(CI)
import qualified Data.CaseInsensitive as CI
import Data.Char(isAscii, isLetter)
--... | nedervold/multipart-names | src/Text/MultipartNames/MultipartName.hs | Haskell | bsd-3-clause | 1,466 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.ES3Compatibility
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : portabl... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/ES3Compatibility.hs | Haskell | bsd-3-clause | 2,197 |
module Language.Xi.Base.Parser where
| fizruk/xi-base | src/Language/Xi/Base/Parser.hs | Haskell | bsd-3-clause | 37 |
module Parser.Internal where
import Control.Applicative
( (<|>)
)
import ASTree
( Number(..)
, Expr(..)
, LatCalError(..)
)
import Text.ParserCombinators.ReadP
( ReadP
, readP_to_S
, optional
, eof
, char
, munch
, (<++)
, chainl1
, string
, between
,... | bus000/latex-calculator | src/Parser/Internal.hs | Haskell | bsd-3-clause | 3,436 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import qualified System.Exit as Exit
import qualified TsParse as T
main :: IO ()
main = T.runAllTests >>= \b ->
if b then Exit.exitSuccess else Exit.exitFailure
| massysett/tsparse | test-tsp.hs | Haskell | bsd-3-clause | 217 |
-- | This module re-exports everything from 'Pos.Chain.Block.Logic.*'.
module Pos.Chain.Block.Logic
( module Pos.Chain.Block.Logic.Integrity
) where
import Pos.Chain.Block.Logic.Integrity
| input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Block/Logic.hs | Haskell | mit | 213 |
module Interaction where
import Logic
import Browser
-- | number of sentences
type Window = Int
type
data DB = DB {
retrieve :: Int -> Maybe Conversation,
update :: Int -> Conversation -> DB,
data Browsing = Browsing
{ browser :: Browser
data State = State
{ conversations :: [(Int,Browsing)]
}
data M... | paolino/qrmaniacs | Interaction.hs | Haskell | mit | 577 |
{-
SockeyeSymbolTable.hs: Symbol Table for Sockeye
Part of Sockeye
Copyright (c) 2017, ETH Zurich.
All rights reserved.
This file is distributed under the terms in the attached LICENSE file.
If you do not find this file, copies can be found by writing to:
ETH Zurich D-INFK, CA... | kishoredbn/barrelfish | tools/sockeye/SockeyeSymbolTable.hs | Haskell | mit | 4,001 |
--
--
--
-----------------
-- Exercise 5.17.
-----------------
--
--
--
module E'5'17 where
-- GHCi> [2 .. 2]
-- [2]
-- [n .. n] results in the list [n].
-- GHCi> [2, 7 .. 4]
-- [2]
-- [2, 7 .. 4] results in the list [2].
-- GHCi> [2, 2 .. 2]
-- [2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
-- ,2,2,2,2,2,2,2,2,2,2,2,... | pascal-knodel/haskell-craft | _/links/E'5'17.hs | Haskell | mit | 509 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Functor.Indexed
-- Copyright : (C) 2008 Edward Kmett
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : experimental
-- Portability : po... | urska19/MFP---Samodejno-racunanje-dvosmernih-preslikav | Control/Functor/Indexed.hs | Haskell | apache-2.0 | 875 |
<?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="it-IT">
<title>Code Dx | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loc... | veggiespam/zap-extensions | addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_it_IT/helpset_it_IT.hs | Haskell | apache-2.0 | 969 |
<?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="tr-TR">
<title>Pasif Tarama Kuralları - Beta | ZAP Uzantıları</title>
<maps>
<homeID>top</h... | veggiespam/zap-extensions | addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_tr_TR/helpset_tr_TR.hs | Haskell | apache-2.0 | 1,002 |
{-# LANGUAGE ScopedTypeVariables #-}
module Text.XmlHtml.TestCommon where
import Control.Exception as E
import System.IO.Unsafe
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test, Node)
-----------------------------------... | 23Skidoo/xmlhtml | test/suite/Text/XmlHtml/TestCommon.hs | Haskell | bsd-3-clause | 1,466 |
--
-- Data vault for metrics
--
--
-- Copyright © 2013-2014 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
... | afcowie/vaultaire-common | lib/Vaultaire/Types/ContentsResponse.hs | Haskell | bsd-3-clause | 3,024 |
module Main where
import Graphics.X11.Turtle
import Data.IORef
import Control.Concurrent
import Control.Monad
import System.Environment
import Text.XML.YJSVG
import Data.Word
main :: IO ()
main = do
[fn, save] <- getArgs
clr <- newIORef 0
bgclr <- newIORef 0
f <- openField
t <- newTurtle f
threadDelay 100000
h... | YoshikuniJujo/wxturtle | tests/draw.hs | Haskell | bsd-3-clause | 1,723 |
-- %************************************************************************
-- %* *
-- The known-key names for Template Haskell
-- %* *
-- %**********************************... | AlexanderPankiv/ghc | compiler/prelude/THNames.hs | Haskell | bsd-3-clause | 41,406 |
<?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="ur-PK">
<title>Call Home Add-On</title>
<maps>
<homeID>callhome</homeID>
<mapref locati... | thc202/zap-extensions | addOns/callhome/src/main/javahelp/org/zaproxy/addon/callhome/resources/help_ur_PK/helpset_ur_PK.hs | Haskell | apache-2.0 | 966 |
module Foo () where
{-@ measure getfst :: (a, b) -> a
getfst (x, y) = x
@-}
{-@ type Pair a b = {v0 : ({v:a | v = (getfst v0)}, b) | true } @-}
{-@ type OPList a b = [(Pair a b)]<\h -> {v: (a, b) | (getfst v) >= (getfst h)}> @-}
{-@ type OList a = [a]<\h -> {v: a | (v >= h)}> @-}
{-@ getFsts :: O... | ssaavedra/liquidhaskell | tests/pos/PairMeasure.hs | Haskell | bsd-3-clause | 413 |
module Util.Http (
Links(..),
httpGet,
httpGetLink,
httpPost,
httpPostStatus,
httpPut,
httpDelete
) where
import Import.NoFoundation hiding (responseBody, responseStatus, statusCode, checkStatus)
import Data.Text (append)
import qualified Data.ByteString.Lazy as L
import Network.Wreq
import... | vinnymac/glot-www | Util/Http.hs | Haskell | mit | 2,470 |
module OpcodeTypes
( Bytecode(..)
, oneOperandBytecodes
, zeroOperandBytecodes
, twoOperandBytecodes
, varOperandBytecodes
, extBytecodes
, opcodeName
) where
import qualified Story as S
data Bytecode = OP2_1 | OP2_2 | OP2_3 | OP2_4 | OP2_5 | OP2_6 | OP2_7
| OP2_8 | OP2_9 | OP2_10 | OP... | DylanSp/zmachine-interpreter | src/OpcodeTypes.hs | Haskell | mit | 6,699 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}
module Unison.Codebase.SqliteCodebase
( Unison.Codebase.SqliteCodebase.init,
unsafe... | unisonweb/platform | parser-typechecker/src/Unison/Codebase/SqliteCodebase.hs | Haskell | mit | 55,182 |
-- | Commit version.
-- Adapted from Apia.Utils.CommitVersion.hs
-- http://github.com/asr/apia.
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
-- The constructor @versionTagsq (see GHC ticket #2496) is deprecated
-- (at least in GHC 8.0.1). See Issue #83.
{-# OPTIONS_GHC -fno-warn-warnings-... | jonaprieto/athena | src/Athena/Utils/CommitVersion.hs | Haskell | mit | 1,626 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Describes Rowling values, i.e., the entities which are produced by
-- evaluating expressions, and passed as i... | thinkpad20/rowling | src/Language/Rowling/Definitions/Values.hs | Haskell | mit | 8,495 |
module FrontEnd.TypeSynonyms (
removeSynonymsFromType,
declsToTypeSynonyms,
TypeSynonyms,
restrictTypeSynonyms,
expandTypeSyns,
showSynonyms,
showSynonym
) where
import Control.Applicative(Applicative)
import Control.Monad.Writer
import Data.Binary
import Data.List
import qualified Data... | m-alvarez/jhc | src/FrontEnd/TypeSynonyms.hs | Haskell | mit | 6,646 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE Undecida... | nshepperd/funn | AI/Funn/CL/Batched/Param.hs | Haskell | mit | 2,439 |
import Data.List.Split (splitOn)
import Data.List (sort)
import Prelude hiding (readList)
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
import Data.Maybe
part1 input = sum (map (\x -> part1helper $sort x) input)
where
part1helper [a,b,c] = 2*(a*... | jO-Osko/adventofcode2015 | 2015/problems/haskell/day2.hs | Haskell | mit | 804 |
module CSPMTypeChecker.TCDependencies
(Dependencies, dependencies, namesBoundByDecl, namesBoundByDecl',
FreeVars, freeVars, prebindDataType) where
import Data.List (nub, (\\))
import CSPMDataStructures
import CSPMTypeChecker.TCMonad
import Util
-- This method heavily affects the DataType clause of typeCheckDecl.... | tomgr/tyger | src/CSPMTypeChecker/TCDependencies.hs | Haskell | mit | 7,419 |
{-# LANGUAGE FlexibleContexts #-}
module Errors
( AppError (..)
, authenticationRequired
, raiseAppError
, resourceNotFound
, serverError
, badRequest
) where
import Control.Monad.Except
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
imp... | gust/feature-creature | marketing-site/app/Errors.hs | Haskell | mit | 1,337 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Db.Transaction
( Transaction'(Transaction)
, NewTransaction
, Transaction... | benkolera/talk-stacking-your-monads | code-classy/src/Db/Transaction.hs | Haskell | mit | 3,165 |
module Y2016.M12.D20.Exercise where
-- below import available from 1HaskellADay git repository
import Data.SymbolTable
import Data.SymbolTable.Compiler
import Data.SAIPE.USStates
{--
So, yesterday, as you see from the import above, we enumerated the US States!
YAY! *throws confetti
NOW! Using the same data-set, s... | geophf/1HaskellADay | exercises/HAD/Y2016/M12/D20/Exercise.hs | Haskell | mit | 1,493 |
f x = if x < 10
then x
else x*2
| Bolt64/my_code | haskell/hello_haskell.hs | Haskell | mit | 49 |
revList :: [a] -> [a]
revList [] = []
revList (h:t) = revList t ++ [h]
dropList :: Int -> [a] -> [a]
dropList 0 list = list
dropList _ [] = []
dropList n (h:t) = dropList (n-1) t
fizzbuzz :: Int -> String
fizzbuzz a
| a `mod` 15 == 0 = "FizzBuzz"
| a `mod` 3 == 0 = "Fizz"
| a `mod` 5 == 0 = "Buzz"
| ... | anujjamwal/learning | Haskell/first.hs | Haskell | mit | 2,734 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE... | TransportEngineering/nice-html | src/Text/Html/Nice/Internal.hs | Haskell | mit | 12,438 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module BarthPar.Data where
import Conduit
import Control.Error
import Control.Lens
import qualified Data.Aeson as A
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.L... | erochest/barth-scrape | src/BarthPar/Data.hs | Haskell | apache-2.0 | 1,497 |
module Palindromes.A249642Spec (main, spec) where
import Test.Hspec
import Palindromes.A249642 (a249642)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A249642" $
it "correctly computes the first 10 elements" $
take 10 (map a249642 [0..]) `shouldBe` expectedValue where
expectedValue = [0,0,... | peterokagey/haskellOEIS | test/Palindromes/A249642Spec.hs | Haskell | apache-2.0 | 371 |
{-|
Module : Text.ABNF.Document
Description : Documents according to an ABNF definition
Copyright : (c) Martin Zeller, 2016
License : BSD2
Maintainer : Martin Zeller <mz.bremerhaven@gmail.com>
Stability : experimental
Portability : non-portable
-}
module Text.ABNF.Document
(
-- * Document types
... | Xandaros/abnf | src/Text/ABNF/Document.hs | Haskell | bsd-2-clause | 1,662 |
module Main where
import Criterion
import Criterion.Main
main :: IO ()
main = defaultMain
[ env (return ()) $
\ ~() -> bgroup "\"oops\"" [bench "dummy" $ nf id ()]
, env (return ()) $
\ ~() -> bgroup "'oops'" [bench "dummy" $ nf id ()]
]
| bos/criterion | examples/Quotes.hs | Haskell | bsd-2-clause | 266 |
module Database.Narc.Rewrite where
import Data.Maybe (fromMaybe)
import Database.Narc.AST
import Database.Narc.Type
import Database.Narc.Util (alistmap)
-- | In @perhaps f x@, use @f@ to transform @x@, unless it declines by
-- returning @Nothing@, in which case return @x@ unchanged.
perhaps :: (a -> Maybe a) -> a ->... | ezrakilty/narc | Database/Narc/Rewrite.hs | Haskell | bsd-2-clause | 2,786 |
import Types
import Genetic
import Runner
import Control.Monad.State
import Control.Lens
import System.Random
main = do
-- Create a prog with some haskell code
let prog = (def :: StateMachine) & code .~ (read "[+>++<].")
-- Execute the prog
let res =... | Zenol/brainf_gen | Main.hs | Haskell | bsd-2-clause | 1,212 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.