code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE OverloadedStrings #-} module Cilia.CI.CI ( checkCIServers )where import Prelude import Control.Monad(forever) import Control.Concurrent(Chan, writeChan, threadDelay) import qualified Data.Text as T import Lens.Micro((^.)) import Cilia.Ui(CustomEvent(..)) import Cilia.Config(Config, travis, defaultSec...
bbiskup/cilia
src-lib/Cilia/CI/CI.hs
mit
865
0
17
183
257
139
118
-1
-1
module Unused.Cache ( FingerprintOutcome(..) , cached ) where import Control.Monad.Reader (ReaderT, runReaderT, ask, liftIO) import qualified Data.ByteString.Lazy as BS import Data.Csv (FromRecord, ToRecord, HasHeader(..), encode, decode) import qualified Data.Vector as V import qualifi...
joshuaclayton/unused
src/Unused/Cache.hs
mit
1,974
0
12
376
587
312
275
43
1
import Network.HTTP import System.Environment import System.IO import Data.List (intercalate) import Data.Text (strip, pack, unpack) main :: IO () main = do base <- getEnv "YETIBOT_ENDPOINT" token <- getEnv "YETIBOT_ACCESS_TOKEN" args <- getArgs -- optionally read in stdin only if it was piped (i.e. if...
devth/yetibot-cli
YetiBot.hs
mit
898
0
17
236
257
131
126
19
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RankNTypes #-} module REPL ( REPL, Settings(..) , runRepl , cmdP , humanInput, putHumanLike ) where import Control.Applicative ((<$>), some) import Control.Arrow (second) import Control.Monad.State im...
pxqr/algorithm-wm
src/REPL.hs
mit
12,416
0
29
3,418
4,375
2,152
2,223
310
6
module BBQ.Config ( BuildConfig(..) , defaultBuildConfig , SiteConfig(..) ) where import System.FilePath import ClassyPrelude -- Don't export the constructor, use record syntax instead data BuildConfig = BuildConfig { targetDir :: FilePath, hsSrcDir :: FilePath, hsOther :: [FilePath], mdSrcDir...
izgzhen/bbq-sg
src/BBQ/Config.hs
mit
850
0
9
195
178
115
63
28
1
{-# LANGUAGE FlexibleContexts #-} module LinearProof where import Control.Monad.State import qualified Data.Map as M import Syntax type RuleName = String data LineRef = LineRefSingle Int | LineRefMulti Int Int | LineRefHole VarName deriving (Eq, Ord, Show) data ProofFragment = VarIntr...
ulrikrasmussen/BoxProver
src/LinearProof.hs
mit
5,970
0
21
1,682
2,369
1,164
1,205
170
29
double2 x y = double x + double y double x = x + x doubleIf x = if x < 100 then x * 2 else x
honux77/practice
haskell/day1/first.hs
mit
96
0
6
31
57
28
29
3
2
module JokingDiffList( DiffList(..), toDiffList, fromDiffList ) where newtype DiffList a = DiffList { getDiffList :: [a] -> [a] } toDiffList :: [a] -> DiffList a toDiffList xs = DiffList (xs++) fromDiffList :: DiffList a -> [a] fromDiffList (DiffList f) = f [] instance Monoid (DiffList a) w...
Forec/learn
2017.1/joking-haskell/jokingDiffList.hs
mit
421
0
10
99
178
99
79
13
1
{-# LANGUAGE UndecidableInstances #-} -- | -- This module contains everything required -- to use \"hasql\" with Postgres. -- For information on how it should be used consult the \"hasql\" docs. -- -- Please note that there is a few limitations inflicted by Postgres, -- encoding which in the type system would seriousl...
mikeplus64/hasql-postgres
library/Hasql/Postgres.hs
mit
25,219
1
20
5,341
5,402
2,862
2,540
-1
-1
module Main where import Text.ParserCombinators.Parsec (parseFromFile) import System.Environment (getArgs) import System.Exit (exitFailure) import Data.List (intersperse) import IO (putStrLn, hPutStrLn, stderr, hFlush, stdout) import Jaml.Parser.File (jamlFile) import Jaml.Generator.Ast (astToJS) import Jaml.Util (jo...
marklar/jaml
Jaml/jamlize.hs
mit
1,053
0
14
278
336
176
160
29
3
{-| Module : Control.Concurrent.Pipeline Copyright : (c) Alejandro Munguia 2015 License : MIT (see the LICENSE file) Maintainer : munguia.jandro@gmail.com Stability : experimental Portability : portable A Pipeline is a sequence of functions that successively transforms a stream of input data. Eac...
amunguia/pipelines
Control/Concurrent/Pipeline.hs
mit
796
0
4
182
80
58
22
17
0
-- -- Copyright (c) 2012 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This progra...
OpenXT/manager
xenmgr/XenMgr/Expose/VmNicObject.hs
gpl-2.0
5,311
17
14
1,285
1,393
717
676
100
2
{- | Module : ./Static/ConsInclusions.hs Description : dump conservative inclusion links Copyright : (c) C. Maeder, DFKI GmbH 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable (via imports) -} module Static.Cons...
gnn/Hets
Static/ConsInclusions.hs
gpl-2.0
2,306
0
21
659
596
308
288
52
1
import System.IO main :: IO () main = do consoleQuestion question consoleQuestion :: IO () consoleQuestion = do putStrLn ("Hello, Stranger! " ++ "What is your name?") name <- getLine putStrLn ("Nice to meet you, " ++ name) question :: IO () question = do putStrLn "Wanna big heap of money?" answer <- getL...
goosecraft/realm
practice.hs
gpl-2.0
517
6
9
109
171
82
89
21
2
-- -- Copyright (c) 2013 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This progra...
cjp256/manager
xenmgr/XenMgr/Expose/XenmgrObject.hs
gpl-2.0
14,792
0
16
2,265
2,453
1,364
1,089
195
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} module LexML.Linker ( LinkerError (..), linker, LinkerOptions (..), RefContexto (..), Result (..), InputType (..), OutputType (..), contextoFederal, defaultLinkerOptions, refContextoFederal ) where import Text.HTML.TagSoup imp...
lexml/lexml-linker
src/main/haskell/LexML/Linker.hs
gpl-2.0
6,992
0
23
1,714
2,051
1,092
959
154
8
{-# language FlexibleContexts #-} module Ersatz.Solver.Minisat.API where import Control.Monad.IO.Class import qualified Data.IntSet as S import qualified Data.IntMap as M import Ersatz import Control.Lens import qualified MiniSat as API -- import Control.Monad.State import Control.Applicative ((<$>)) import Contr...
jwaldmann/ersatz-minisatapi
src/Ersatz/Solver/Minisat/API.hs
gpl-3.0
1,731
0
25
412
584
303
281
45
3
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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 3 of the Lice...
karamellpelle/grid
designer/source/Game/LevelPuzzleMode/Output/Fancy/State.hs
gpl-3.0
5,038
0
18
1,678
950
506
444
84
3
module Options ( Options( .. ) , defaultOptions , optionDescriptions ) where import System.Console.GetOpt import System.Exit import Control.Monad import System.IO import Data.Char import Data.Word import Data.List import Safe import Debug.Trace version :: String version = "0.1.0" data Options = Options { address :: ...
jefflasslett/portio
Options.hs
gpl-3.0
2,263
0
14
733
655
350
305
60
2
module SpecHelper ( module Test.Hspec , module TruthTable , module NaturalDeduction.Proof ) where import Test.Hspec import TruthTable import NaturalDeduction.Proof
adamschoenemann/natural-deduction
test/SpecHelper.hs
gpl-3.0
180
0
5
35
35
23
12
7
0
{- Merch.Race.Economy.ItemSetPrice - Compute prices of sets of items. Copyright 2013 Alan Manuel K. Gloria This file is part of Merchant's Race. Merchant's Race 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, e...
AmkG/merchants-race
Merch/Race/Economy/ItemSetPrice.hs
gpl-3.0
2,122
0
16
387
538
278
260
31
1
{-# LANGUAGE FlexibleInstances,UndecidableInstances #-} module ProbGen where import Test.QuickCheck class ProbGen a where prob_gen :: [Int] -> Int -> Gen a -- instance {-#OVERLAPS#-} Arbitrary a => ProbGen a where -- prob_gen _ _ = arbitrary -- sized_gen :: (ProbGen a) => [Int] -> Gen a sized_gen xs = sized ...
fcostantini/QuickFuzz
src/ProbGen.hs
gpl-3.0
1,770
0
12
523
767
400
367
41
1
{- | Functions for drawing the 'Game' state. -} module RenderGame ( drawTitleScreen, drawLevel ) where import Game import Algebra import Graphics.Rendering.OpenGL import Matrix import Models type Scene = [(Matrix4x4, Model)] type Models = [(String, Model)] type Texts = [(String, (Int,Int,Model))] -- |...
kig/tomtegebra
Tomtegebra/RenderGame.hs
gpl-3.0
9,968
0
12
2,260
3,053
1,633
1,420
153
2
module Estuary.Widgets.PatternTransformer where import Reflex import Reflex.Dom import Estuary.Tidal.Types import Estuary.Reflex.Utility import Data.Map import Text.Read trivialPatternTransformer :: MonadWidget t m => m (Dynamic t (PatternTransformer,())) trivialPatternTransformer = el "div" $ do let ddItems = [NoT...
Moskau/estuary
Estuary/Widgets/PatternTransformer.hs
gpl-3.0
4,917
0
15
842
1,447
743
704
69
11
module Math where data Operation = Plus | Sub | Mult | Power data Expr = Number Int | Symbol Operation | Bracket Equation instance Show Expr where show (Number e) = show e show (Symbol Plus) = "+" show (Symbol Sub) = "-" show (Symbol Mult) = "*" show (Symbol Power) = "^" show (Bracket e) = "(" ++ (conca...
cwlmyjm/haskell
AFP/Math.hs
mpl-2.0
1,119
0
12
234
657
328
329
27
1
module Model.VolumeAccess.Types ( VolumeAccess(..) , getShareFullDefault ) where import Data.Int (Int16) import Model.Id.Types import Model.Permission.Types import Model.Volume.Types import Model.Party.Types data VolumeAccess = VolumeAccess { volumeAccessIndividual, volumeAccessChildren :: Permission , vo...
databrary/databrary
src/Model/VolumeAccess/Types.hs
agpl-3.0
894
0
10
143
195
115
80
23
2
{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module HubicAuthServer ( HubicAuthServerOpts(..) , HubicAuthServerError(..) , runHubicAuthServer ) where import Network.Wai.Handler.Warp (defaultSettings, setPort, setHost, setBefo...
redneb/hubic-auth-swift
src/HubicAuthServer.hs
agpl-3.0
9,098
0
23
2,698
2,330
1,199
1,131
198
6
{-# OPTIONS -Wall #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUA...
johnpmayer/distributed-bvh
DistributedBVH.hs
agpl-3.0
10,571
1
25
2,705
4,116
2,071
2,045
271
10
module Vehicles where data Price = Price Integer deriving (Eq, Show) data Size = Size Integer deriving (Eq, Show) data Manufacturer = Mini | Mazda | Tata deriving (Eq, Show) data Airline = PapuAir | CatapultsRUs | TakeYourChancesUni...
thewoolleyman/haskellbook
11/05/eric/Vehicles.hs
unlicense
990
0
8
363
319
170
149
36
2
{-# LANGUAGE OverloadedStrings #-} module Experiment.Bench.Process ( runProcess , TerminateStep , Termination (..) ) where import Laborantin.DSL import Laborantin.Types import Laborantin.Implementation (EnvIO) import System.Process (createProcess, proc, terminateProcess, waitForProcess, StdStream (..), Create...
lucasdicioccio/laborantin-bench-web
Experiment/Bench/Process.hs
apache-2.0
2,527
3
13
784
751
399
352
51
5
--(*) Find the last element of a list. -- --(Note that the Lisp transcription of this problem is incorrect.) -- --Example in Haskell: -- --Prelude> myLast [1,2,3,4] --4 --Prelude> myLast ['x','y','z'] --'z' -- myLast :: [a] -> a myLast [] = error "Empty List" myLast [x] = x myLast (x: xs) = myLast xs myLast' = head ....
tiann/haskell-learning
haskell99/p01/main.hs
apache-2.0
328
2
8
60
86
45
41
5
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GADTs #-} module WhySomeException where import Control.Exception (ArithException(..), AsyncException(..)) import Data.Typeable data MyException where MyException :: (Show e, Typeable e) => e -> MyException instance Show MyException where showsPrec p ...
nicklawls/haskellbook
src/WhySomeException.hs
bsd-3-clause
583
0
10
157
154
83
71
19
3
{-# LANGUAGE FlexibleInstances #-} module Model where import ClassyPrelude.Yesod import Database.Persist.Quasi import Text.Markdown (Markdown) import Yesod.Text.Markdown () -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities...
trxeste/wrk
haskell/myBlog/Model.hs
bsd-3-clause
483
0
8
62
68
40
28
-1
-1
{-# LANGUAGE Arrows #-} {- ****************************************************************************** * A F R P * * * * Example: Test TG ...
ivanperez-keera/Yampa
yampa/examples/TailgatingDetector/TestTGMain.hs
bsd-3-clause
3,617
28
20
1,631
966
524
442
58
2
module Data.Functor.Foldable1 where import Data.Functor.Foldable import Data.Semigroupoid.Semigroup class Foldable t => Foldable1 t where foldMap1 :: Semigroup m => (a -> m) -> t a -> m
tonymorris/type-class
src/Data/Functor/Foldable1.hs
bsd-3-clause
205
0
10
46
65
35
30
9
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad import qualified Control.Monad.Trans.State as S import Data.Char (ord) import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.IO as T import Options.Applicative impo...
herbertjones/pw-block-gen
src/Main.hs
bsd-3-clause
3,902
0
16
979
1,072
557
515
93
4
{-# LANGUAGE CPP, ScopedTypeVariables #-} module TcErrors( reportUnsolved, reportAllUnsolved, warnAllUnsolved, warnDefaulting, solverDepthErrorTcS ) where #include "HsVersions.h" import TcRnTypes import TcRnMonad import TcMType import TcType import RnEnv( unknownNameSuggestions ) import Type ...
snoyberg/ghc
compiler/typecheck/TcErrors.hs
bsd-3-clause
115,907
5
25
35,623
20,440
10,427
10,013
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-} module BitD.Sync ( daemon ) where #incl...
benma/bitd
src/BitD/Sync.hs
bsd-3-clause
15,751
0
29
3,451
4,849
2,397
2,452
-1
-1
module SkeletonTemplates.CalTypes where import AstMappings import qualified AbsCAL as C import qualified AbsRIPL as R import Debug.Trace
robstewart57/ripl
src/SkeletonTemplates/CalTypes.hs
bsd-3-clause
138
0
4
18
26
19
7
5
0
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} -- | Haste.App client-server protocol. module Haste.App.Protocol where import Control.Applicative import Control.Exception import Data.Typeable import Haste.Binary type Nonce = Int type CallID = Int -- | A method call to the server. data ServerCall = ServerCall {...
joelburget/haste-compiler
libraries/haste-lib/src/Haste/App/Protocol.hs
bsd-3-clause
1,412
0
11
336
362
193
169
41
0
module ShowWords.Output ( putStrF , waitKey , checkAnswer , putLine , putPhrases ) where import System.IO (hFlush, stdout) import Codec.Binary.UTF8.String -- For encode, decode. import qualified Data.ByteString.Lazy as B import qualified Data.Foldable as F import qualified Data.Traversable a...
sgf-dma/show-words
src/ShowWords/Output.hs
bsd-3-clause
2,926
0
14
906
708
374
334
57
2
module Chp3 where -- | Haskell has type inference. If we write a number, we don't have to tell Haskell it's a number. It can infer that on its own -- | :t 'a' => 'a' :: Char -- | :: is read as "has type of" -- | :t "Heelo" -- | "Heelo" :: [Char] -- | Functions also have types. -- | From here on, we'll give all th...
jamesyang124/haskell-playground
src/Chp3.hs
bsd-3-clause
4,664
0
8
999
113
75
38
5
1
{-# LANGUAGE OverloadedStrings #-} module Ttlv.Validator.ObjectsSpec where import Test.Hspec import Control.Applicative ((<|>)) import Ttlv.Data import qualified Ttlv.Enum as TEnum import qualified Ttlv.Tag as T import Ttlv.Validator.Objec...
nymacro/hs-kmip
tests/Ttlv/Validator/ObjectsSpec.hs
bsd-3-clause
5,286
0
29
1,856
1,510
720
790
101
2
module Problems.Lists (tests) where import qualified Data.List as L import Data.Ord(comparing) import qualified Data.Set as S import Solutions.Lists import Test.Tasty import Test.Tasty.QuickCheck import Types import Utils tests ::...
smobs/99Problems
test/Problems/Lists.hs
bsd-3-clause
10,321
0
18
3,353
3,452
1,795
1,657
-1
-1
module TestTypeCheck where import Control.Monad.Trans.State.Lazy import Control.Monad.Except import Control.Monad.Trans.Class (lift) import Data.Maybe (isJust) import Control.Monad (when) import qualified Data.Map as Map import qualified Data.Set as Set import TypeCheck import AST funSms :: Map.Map Name Functiona...
esengie/fpl-exploration-tool
test/specLang/TestSortCheck.hs
bsd-3-clause
1,089
0
11
180
341
183
158
30
2
module HaskellCI.ParsecUtils where import HaskellCI.Prelude import System.Directory (doesFileExist) import System.Exit (exitFailure) import System.IO (hPutStr, stderr) import qualified Data.ByteString as BS import qualified Distribution.Fields as C import qualified Distribution....
hvr/multi-ghc-travis
src/HaskellCI/ParsecUtils.hs
bsd-3-clause
1,597
0
17
483
460
236
224
36
3
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.EXT.TextureEnvDot3 -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable ...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/EXT/TextureEnvDot3.hs
bsd-3-clause
674
0
4
81
40
33
7
4
0
{-# LANGUAGE NoMonomorphismRestriction #-} module Lexer where import Prelude hiding (lex) import Text.Parsec import qualified Text.Parsec.Token as T paneDef = T.LanguageDef { T.commentStart = "/*", T.commentEnd = "*/", T.commentLine = "//", T.nestedComments = False, T.identStart = alphaNum <|> on...
brownsys/pane
src/Lexer.hs
bsd-3-clause
1,318
12
8
344
366
212
154
34
1
{-# LANGUAGE BangPatterns #-} module LRUCache where import Control.Applicative ((<$>)) import Data.Hashable (Hashable, hash) import qualified Data.HashPSQ as HashPSQ import Data.IORef (IORef, newIORef, atomicModifyIORef') import Data.Int (Int64) i...
Garygunn94/DFS
.stack-work/intero/intero2539SA1.hs
bsd-3-clause
2,256
0
16
741
879
471
408
62
3
{-# LANGUAGE OverlappingInstances, FlexibleInstances #-} -- microbench, a tiny microbenchmarking library for Haskell. -- Copyright (C) 2008 Evan Martin <martine@danga.com> -- hacked ever so slightly by mwotton@gmail.com in the interests -- of not spinning forever on very fast operations -- |Microbenchmarking can b...
adarqui/PerfectHash
HackedMicrobench.hs
bsd-3-clause
3,822
0
15
782
501
277
224
39
2
module Math.Polynomial.Operations where import Data.List import Test.QuickCheck _addP :: Num a => [a] -> [a] -> [a] _addP as [] = as _addP [] bs = bs _addP (a:as) (b:bs) = (a + b) : _addP as bs _subP :: Num a => [a] -> [a] -> [a] _subP as [] = as _subP [] bs = map negate bs _subP (a:as) (b:bs) = (a - b) : _subP as b...
bhamrick/hsmath
Math/Polynomial/Operations.hs
bsd-3-clause
2,687
0
13
639
1,614
857
757
65
2
module Math.IRT.Model.OnePLM ( OnePLM (..) ) where import Statistics.Distribution import Math.IRT.Internal.Distribution import Math.IRT.Internal.LogLikelihood import Math.IRT.Model.FourPLM ( FourPLM(..) ) import Math.IRT.Model.Generic data OnePLM = OnePLM { difficulty :: !Double } deriving...
argiopetech/irt
Math/IRT/Model/OnePLM.hs
bsd-3-clause
977
0
9
226
262
144
118
28
1
{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, MagicHash, UnboxedTuples, DeriveGeneric #-} module Main (main) where import Control.Monad.ST import Criterion.Main import Data.Hashable import Data.Hashable.SipHash import Data.Int import Foreign.ForeignPtr import GHC.Exts import GHC.ST (ST(..)) import Dat...
pacak/cuddly-bassoon
hashable-1.2.6.0/benchmarks/Benchmarks.hs
bsd-3-clause
12,104
0
30
4,130
3,846
1,920
1,926
232
1
module Main where import Test.Tasty ( TestTree, defaultIngredients , defaultMainWithIngredients, testGroup) import Test.Tasty.Ingredients ( Ingredient) import Test.Tasty.Runners.AntXML ( antXMLRunner) import Tests.Integration main :: IO () main = defaultMainWithIngredients ingredients tests ingred...
creswick/cabal-query
tests/src/Main.hs
bsd-3-clause
461
0
6
76
106
63
43
13
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} module Y.StringTest where import Test.HUnit import Test.QuickCheck import Test.Tasty (TestTree) import Test.Tasty.HUnit import Test.Tasty.QuickCheck import Test.Tasty.TH import Control.Applicative import Data.Fol...
ethercrow/y
tests/Y/StringTest.hs
bsd-3-clause
5,390
0
15
1,203
2,039
1,036
1,003
-1
-1
{-# LANGUAGE QuasiQuotes, GeneralizedNewtypeDeriving, TypeSynonymInstances, FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | C code generator framework. module Futhark.CodeGen.Backends.GenericC ( compileProg -- * Pluggable compiler , Operations (..) , defaultOper...
mrakgr/futhark
src/Futhark/CodeGen/Backends/GenericC.hs
bsd-3-clause
39,936
0
18
10,177
10,932
5,724
5,208
794
17
module Init ( doit ) where import Control.Monad.Trans.Resource import Data.Default import qualified Database.LevelDB as DB import Data.List import System.FilePath import Text.PrettyPrint.ANSI.Leijen hiding ((<$>), (</>)) import Blockchain.Data.RLP import Blockchain.Data.BlockDB import Blockchain.Data.S...
jamshidh/ethereum-query
src/Init.hs
bsd-3-clause
1,329
0
13
170
379
214
165
32
2
-- 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. {-# LANGUAGE GADTs...
rfranek/duckling
Duckling/Ordinal/HR/Rules.hs
bsd-3-clause
4,520
0
17
876
1,412
918
494
158
2
{-# LANGUAGE RankNTypes #-} module Control.Monad.Trans.Free.Replay where import Control.Replay.Class import Control.Monad import Control.Monad.Trans.Class import Control.Monad.Free.Class import qualified Control.Monad.Trans.Free as FT import qualified Control.Monad.Free as F -- | Replay @FreeT f m a@ computation giv...
bitemyapp/replay-free
src/Control/Monad/Trans/Free/Replay.hs
bsd-3-clause
1,672
0
16
517
508
268
240
30
3
{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE PatternGuards #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} --------------------------------------------------------- -- -- Module : Network.Wai.Handler.Warp -- Copyright : Michael Snoyman -- License : BSD3 -- -- Maintainer : Michael Sn...
awpr/wai
warp/Network/Wai/Handler/Warp.hs
mit
11,832
0
13
2,107
1,484
947
537
143
1
{-| Module : Text.Ogmarkup.Private.Generator Copyright : (c) Ogma Project, 2016 License : MIT Stability : experimental The generation of the output from an 'Ast.Ast' is carried out by the 'Generator' Monad. -} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} modul...
lgeorget/ogmarkup
src/Text/Ogmarkup/Private/Generator.hs
mit
8,199
0
18
2,365
2,459
1,218
1,241
181
5
module Examples.Paths ( psExamples ) where import Utils import LaTeX import Data.Set import Algebra.Matrix import Algebra.Semiring import Policy.Paths psExamples :: Int -> Matrix Paths psExamples 0 = M (toArray 5 [ zero, PS(fromList([P [2]])), zero, zero, zero , PS(fromList([P [1]])), z...
sdynerow/Semirings-Library
haskell/Examples/Paths.hs
apache-2.0
2,907
0
15
990
1,703
948
755
41
1
import qualified Data.ByteString.Char8 as C import qualified Data.Iteratee as I import System cnt :: I.Iteratee C.ByteString IO Int cnt = I.liftI (step 0) where step acc (I.Chunk s) | C.null s = I.icont (step acc) Nothing | True = let acc' = acc + C.count '\n' s in acc' `seq` I.icont (step acc')...
iteloo/tsuru-sample
iteratee-0.8.9.6/Examples/test_wc.hs
bsd-3-clause
437
0
14
109
202
102
100
12
2
----------------------------------------------------------- -- | -- Module : Database.HaskellDB.WX -- Copyright : HWT Group 2003, -- Bjorn Bringert 2005-2006 -- License : BSD-style -- -- Maintainer : haskelldb-users@lists.sourceforge.net -- Stability : experimental -- Portability : ...
chrisdone/haskelldb-demo
lib/haskelldb/driver-wx/Database/HaskellDB/WX.hs
bsd-3-clause
7,286
104
13
1,574
1,889
1,017
872
135
1
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Handlers.Google.Tests ( tests ) where -------------------------------------------------------------------------------- import Test.Framework (Test, testGrou...
itkovian/number-six
tests/NumberSix/Handlers/Google/Tests.hs
bsd-3-clause
844
0
12
178
98
59
39
13
1
{-# LANGUAGE TypeOperators, TypeFamilies, GADTs, UndecidableInstances, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Category.Peano -- License : BSD-style (see the file LICENSE) -- -- Maintainer : sjoerd@w3future.com -- Stability ...
treeowl/data-category
Data/Category/NNO.hs
bsd-3-clause
1,782
4
12
376
615
321
294
34
0
{-# LANGUAGE OverloadedStrings #-} -- Module : SQS -- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- ...
romanb/amazonka
amazonka-sqs/examples/src/SQS.hs
mpl-2.0
2,775
0
17
879
521
263
258
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.SDistParser where import Options.Applicative import Options.Applicative.Builder.Extra import Stack.Prelude import Stack.SDist import Stack.Options.HpcReportParser (pvpBoundsOption) -- | Parser for arguments to `s...
juhp/stack
src/Stack/Options/SDistParser.hs
bsd-3-clause
894
0
14
193
157
83
74
19
1
import Control.Monad(forM) yes = flip mapM
mpickering/hlint-refactor
tests/examples/Default118.hs
bsd-3-clause
43
0
5
6
19
10
9
2
1
simple = h <$> (f $ g $ h t) simple = h <$> (f :+ g :+ h t) simple = h <$> (f `elem` h `elem` h)
mpickering/hlint-refactor
tests/examples/Fixity.hs
bsd-3-clause
99
0
8
31
71
39
32
-1
-1
{-# Language CPP #-} {-# Language DataKinds #-} {-# Language RankNTypes #-} {-# Language PatternSynonyms #-} {-# Language TypeOperators #-} {-# Language PolyKinds #-} {-# Language GADTs #-} {-# Language TypeFamilies #-} {-# Language TypeApplications #-} {-# L...
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T15799.hs
bsd-3-clause
1,265
0
12
319
423
247
176
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} -- | Graph coloring register allocator. module RegAlloc.Graph.Main ( regAlloc ) where import qualified GraphColor as Color import RegAlloc.Liveness import RegAlloc.Graph.Spill import RegAlloc.Graph.SpillClean import RegAlloc.Graph.SpillCost import RegAlloc.Graph.Stats impor...
tjakway/ghcjvm
compiler/nativeGen/RegAlloc/Graph/Main.hs
bsd-3-clause
18,188
0
19
7,110
2,810
1,463
1,347
282
8
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module Opaleye.SQLite.Internal.Values where import qualified Opaleye.SQLite.PGTypes as T import Opaleye.SQLite.Internal.Column (Column(Column)) import qualified Opaleye.SQLite.Internal.Unpackspec as U import qualified Opaleye.SQLite.Internal.Tag as ...
alanz/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/Values.hs
bsd-3-clause
3,723
0
16
785
903
509
394
57
2
-- (c) The University of Glasgow 2006 -- (c) The GRASP/AQUA Project, Glasgow University, 1998 -- -- Type - public interface {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- | Main functions for manipulating types and type-related things module Type ( -- Note some of this is just re-exports from T...
acowley/ghc
compiler/types/Type.hs
bsd-3-clause
66,815
0
14
18,112
13,086
6,880
6,206
-1
-1
{-# LANGUAGE CPP, UnboxedTuples, MagicHash, StandaloneDeriving, DeriveDataTypeable #-} {-# OPTIONS_GHC -O #-} -- In GHC 6.4, compiling this module gave a Core Lint failure following the -- specialiser, because a function was floated out that had a RULE that -- mentioned another function (unpack, in fact). but the lat...
ezyang/ghc
testsuite/tests/simplCore/should_compile/spec001.hs
bsd-3-clause
13,360
0
17
3,232
3,239
1,712
1,527
244
4
{-# LANGUAGE ImplicitParams, ConstraintKinds #-} module T11466 where -- This should be ok type Bla = ?x::Int -- This should be ook f :: Bla => Int -> Int f y = ?x + y data T = T -- But this should be rejected instance Bla => Eq T
ezyang/ghc
testsuite/tests/polykinds/T11466.hs
bsd-3-clause
236
0
6
56
62
35
27
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} -- | Code generation for 'SegMap' is quite straightforward. The only -- trick is virtualisation in case the physical number of threads is -- not sufficient to cover the logical thread space. This is handled -- by having actual workgroups run a loop to i...
HIPERFIT/futhark
src/Futhark/CodeGen/ImpGen/GPU/SegMap.hs
isc
2,369
0
22
566
566
283
283
48
2
module Language.PureScript.Lua.Options where import qualified Language.PureScript.Options as P -- | The data type of compiler options data Options = Options -- | Perform type checks at runtime { optionsPerformRuntimeTypeChecks :: Bool -- | When specified, checks the type of `main` in the module, and -- gene...
osa1/psc-lua
src/Language/PureScript/Lua/Options.hs
mit
987
0
9
216
131
80
51
14
1
module HeatMap.Util where dimTrans w h = f where f x (xOffset,yOffset) | x' >= w = -1 | x' < 0 = -1 | x + y' >= w * h = -1 | otherwise = x + xOffset + y' where y' = yOffset * w x' = (x `mod`...
christiaanb/SoOSiM
examples/HeatMap/Util.hs
mit
334
0
12
185
130
67
63
8
1
{-# htermination elem :: () -> [()] -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_elem_2.hs
mit
48
0
2
10
3
2
1
1
0
module Shexkell.Data.ShapeExpr where import Shexkell.Data.Common (IRI, SemAct, ObjectValue, NumericLiteral) data NodeKind = IRIKind | BNodeKind | NonLiteralKind | LiteralKind deriving (Show, Eq) data XsFacet = XsStringFacet StringFacet | XsNumericFacet NumericFacet deriving (Show, Eq) data Str...
weso/shexkell
src/Shexkell/Data/ShapeExpr.hs
mit
940
0
9
205
234
135
99
34
0
{-# htermination read :: String -> Char #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_read_3.hs
mit
44
0
2
8
3
2
1
1
0
{-# LANGUAGE NoMonomorphismRestriction #-} module Lexer where import qualified Data.ByteString as B import Text.Parsec hiding (State) import Text.Parsec.ByteString hiding (Parser) import Text.Parsec.Language (emptyDef, GenLanguageDef) import Text.Parsec.Pos (SourcePos) import qualified Text.Parsec.Token as Tok import...
mhlakhani/hlisp
src/Lexer.hs
mit
1,859
0
8
748
383
223
160
45
1
module ReaderMonad where newtype Reader e a = Reader { runReader :: e -> a } instance Functor (Reader e) where fmap f (Reader r) = Reader $ \e -> f (r e) instance Applicative (Reader e) where pure a = Reader $ const a (Reader f) <*> (Reader r) = Reader $ \e -> f e $ r e instance Monad...
limdauto/learning-haskell
monads/ReaderMonad.hs
mit
438
0
12
137
214
109
105
10
0
{-# htermination (==) :: Eq a => (Maybe a) -> (Maybe a) -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_EQEQ_10.hs
mit
68
0
2
15
3
2
1
1
0
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PackageImports #-} {-# LANGU...
MaxDaten/yage-examples
src/YageFontSDF.hs
mit
3,765
1
21
916
785
441
344
-1
-1
module Gauges.CLI.Help ( help, interactiveHelp, unknownCmd ) where help = "USAGE: gauges [COMMAND]" interactiveHelp = "This would be where the interactive mode help goes" unknownCmd = "Unkown command"
jrwest/hs-gauges
Gauges/CLI/Help.hs
mit
253
0
4
80
33
21
12
8
1
module Hevents.Eff.WebServer where import Control.Category import Control.Concurrent.Async import Control.Eff import Control.Monad.Except import Network.Socket import Network.Wai.Handler.Warp as W import Prelude hiding ((.)) import...
abailly/hevents
src/Hevents/Eff/WebServer.hs
mit
2,547
0
13
599
700
359
341
-1
-1
module Database.Memcached.Binary.Types where import Network import Data.Time.Clock import Data.Word import Data.Default.Class import qualified Data.ByteString as S import qualified Data.ByteString.Lazy as L type User = S.ByteString type Password = S.ByteString data Auth = Plain User Password deriving Sh...
philopon/memcached-binary
src/Database/Memcached/Binary/Types.hs
mit
937
0
9
211
217
138
79
29
0
{-# LANGUAGE OverloadedStrings #-} module Handler.Root (rootHandler) where import Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes as A hiding (form, label, title, span) import Snap.Blaze (blaze) import Prelude hiding (div, head, id, span) import Application import Html.Util rootHandler :: AppHandler ...
epsilonhalbe/rendezvous
src/Handler/Root.hs
mit
3,597
0
29
1,641
633
284
349
71
1
{-# LANGUAGE TypeFamilies, ExistentialQuantification #-} ----------------------------------------------------------------------------- -- -- Module : DataAssociation.Explore.UI.Application -- Copyright : -- License : MIT -- -- Maintainer : -- Stability : -- Portability : -- -- | -- module DataAssociat...
fehu/min-dat--a-priori
explore/src/DataAssociation/Explore/UI/Application.hs
mit
2,173
0
12
371
401
231
170
-1
-1
main = do input <- lines <$> getContents let nice = filter isNice input print $ length nice isNice :: String -> Bool isNice string = hasThreeVowels && containsDoubleLetter && doesNotContainNaughtyTuplets where hasThreeVowels = length (filter (`elem` vowels) string) >= 3 containsDoubleLetter = any (uncu...
SamirTalwar/advent-of-code
2015/AOC_05_1.hs
mit
653
0
10
134
275
152
123
16
1
{- The MIT License (MIT) Copyright (c) 2015 Wasif Hasan Baig <pr.wasif@gmail.com> 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 u...
baig/pandoc-csv2table
src/Text/Table/Tablify.hs
mit
3,988
0
19
1,197
649
340
309
50
6
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} -- | Histogram metrics allow you to measure not just easy things like the min, mean, max, and standard deviation of values, but also quantiles like the median or 95th percentile. -- -- Traditionally, the way the median (or any other quantile) is ...
graydon/metrics
src/Data/Metrics/Histogram.hs
mit
3,525
0
11
580
737
383
354
55
1
module Irg.Lab1.Lab1 where import qualified Irg.Lab1.Geometry.Matrix as M import qualified Irg.Lab1.Geometry.Vector as V import qualified Data.Vector as V2 import Irg.Lab1.Utility v1 :: V2.Vector Float v1 = V.fromList [2,3,-4] `V.add` V.fromList [-1,4,-1] s :: Float s = V.scalarProduct v1 $ V.fromList [-1, 4, -1] v2 ...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab1/Lab1.hs
mit
1,054
0
8
212
531
280
251
45
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLTableRowElement (js_insertCell, insertCell, js_deleteCell, deleteCell, js_getRowIndex, getRowIndex, js_getSectionRowIndex, getSectionRowIndex, js_getCells, getCells, js_setAlign, setAlig...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/HTMLTableRowElement.hs
mit
7,896
104
11
1,167
1,679
913
766
121
1
{-| A library to make it easier to work with regular expressions. Based on the (original) Javascript VerbalExpression library by jehna. Here's some examples, first a http validator: > let expr = endOfLine > . anythingBut " " > . possibly "www" > ...
VerbalExpressions/HaskellVerbalExpressions
Text/Regex/VerbalExpressions.hs
mit
7,183
0
16
2,210
2,131
1,136
995
160
3
{-# LANGUAGE FlexibleInstances ,FunctionalDependencies ,MultiParamTypeClasses ,UndecidableInstances #-} module Trace.Class where import Control.Monad.Identity import Control.Monad.Reader import Control.Monad.State import Logic class Monad m => MonadTrace a m | m -> a where trace :: a -> m () -- tra...
acharal/hopes
src/prover/Trace/Class.hs
gpl-2.0
808
0
9
193
273
136
137
25
1
import Data.List (subsequences) import Control.Monad (guard) import System.IO (getContents) type Vector = [Int] type Matrix = [Vector] type LabelMatrix = [(Int, Vector)] fromString :: String -> Matrix fromString = map (map read . words) . lines label :: Matrix -> LabelMatrix label = zip [1..] unlabel :: LabelMatrix...
friedbrice/Haskell
algorithm-x/algorithm-x.hs
gpl-2.0
687
0
13
139
280
151
129
22
1
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} module Sortier.Common.Config where import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Config = Config { width :: Int , max_size :: Int } deriving ( Typeable ) $(derives [makeReader, makeToDoc] [''Config]) example :: Config e...
Erdwolf/autotool-bonn
src/Sortier/Common/Config.hs
gpl-2.0
411
2
9
83
103
63
40
12
1